Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

尝试改data #743

Merged
merged 333 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
333 commits
Select commit Hold shift + click to select a range
dc28c16
添加并发处理,修复FutureEvent问题
fangliuyu Dec 30, 2022
0abac3a
Merge pull request #1 from fangliuyu/create-pull-request/patch
fangliuyu Dec 31, 2022
6dbd04b
fix
fangliuyu Dec 31, 2022
c7bcad4
Merge branch 'master' of github.com:fangliuyu/ZeroBot-Plugin
fangliuyu Dec 31, 2022
4ba86d6
fix
fangliuyu Dec 31, 2022
6e2d343
fix
fangliuyu Dec 31, 2022
3e65b16
fix
fangliuyu Dec 31, 2022
be03b73
fix
fangliuyu Dec 31, 2022
b13c592
Fix
fangliuyu Jan 30, 2023
f4b9219
Update
fangliuyu Feb 5, 2023
046a2ff
Merge branch
fangliuyu Feb 5, 2023
5601c31
Update
fangliuyu Feb 5, 2023
c805b28
Update
fangliuyu Feb 5, 2023
0c2b8ae
Update
fangliuyu Feb 5, 2023
124c07d
Update
fangliuyu Feb 5, 2023
29f1d3e
新增猜卡模式
fangliuyu Feb 5, 2023
d174d40
新增云养猫(虽然并不能工作)
fangliuyu Feb 7, 2023
26e29fd
Fix
fangliuyu Feb 7, 2023
bcb39a4
Fix
fangliuyu Feb 7, 2023
2b0f1bf
Update
fangliuyu Feb 8, 2023
8742e8c
Fix
fangliuyu Feb 8, 2023
0ea90f4
Fix
fangliuyu Feb 8, 2023
88c698c
Fix
fangliuyu Feb 10, 2023
68532a9
🎨 改进代码样式
github-actions[bot] Feb 10, 2023
ed45703
Update 优化云养猫
fangliuyu Feb 11, 2023
5b065c9
Merge pull request #2 from fangliuyu/create-pull-request/patch
fangliuyu Feb 11, 2023
fd557c9
Merge branch 'master' of github.com:fangliuyu/ZeroBot-Plugin
fangliuyu Feb 11, 2023
ab1cbd9
Fix
fangliuyu Feb 11, 2023
b4cf98e
Fix
fangliuyu Feb 11, 2023
d406546
Fix
fangliuyu Feb 11, 2023
fa74561
Fix
fangliuyu Feb 12, 2023
4f720b4
Fix
fangliuyu Feb 12, 2023
cf41066
Fix
fangliuyu Feb 12, 2023
9bd0e96
Fix
fangliuyu Feb 12, 2023
432904f
Fix
fangliuyu Feb 12, 2023
f29aedd
Fix
fangliuyu Feb 12, 2023
88a0113
Fix
fangliuyu Feb 12, 2023
f02bffc
Fix
fangliuyu Feb 13, 2023
f66c88a
Fix
fangliuyu Feb 13, 2023
324c5d3
Fix
fangliuyu Feb 13, 2023
5872022
马赛克调整为随机马赛克大小
fangliuyu Feb 13, 2023
07ea05b
Fix
fangliuyu Feb 13, 2023
97d4b64
Fix
fangliuyu Feb 13, 2023
6b00baa
Fix
fangliuyu Feb 14, 2023
840a5b9
Fix
fangliuyu Feb 14, 2023
d4f2157
Fix
fangliuyu Feb 14, 2023
d5290cf
Fix
fangliuyu Feb 15, 2023
89e67bf
修改PK逻辑
fangliuyu Feb 15, 2023
fd97bc0
调整猫图和喂猫的逻辑
fangliuyu Feb 15, 2023
471aa36
Fix
fangliuyu Feb 15, 2023
0dc7493
Fix
fangliuyu Feb 15, 2023
7b2234a
修复买猫次数
fangliuyu Feb 16, 2023
31b9a07
Fix
fangliuyu Feb 17, 2023
9a96458
修改买猫的逻辑
fangliuyu Feb 17, 2023
34db2b0
修改一些文字输出
fangliuyu Feb 18, 2023
6a02c09
修改买猫逻辑
fangliuyu Feb 18, 2023
ce474ae
Fix
fangliuyu Feb 18, 2023
650b82e
Fix
fangliuyu Feb 18, 2023
ef23e22
Fix
fangliuyu Feb 18, 2023
fbd6808
增加猫粮上限,修复已知问题
fangliuyu Feb 19, 2023
3c3a513
修改工作餐逻辑
fangliuyu Feb 19, 2023
09e142e
FIx
fangliuyu Feb 19, 2023
af9cb2f
限制打工次数
fangliuyu Feb 20, 2023
23a55a1
Fix
fangliuyu Feb 20, 2023
c7eab83
Fix
fangliuyu Feb 21, 2023
04a3116
Fix
fangliuyu Feb 21, 2023
627254a
Fix
fangliuyu Feb 21, 2023
20ae85b
Fix
fangliuyu Feb 21, 2023
1a916f9
修改一些规则
fangliuyu Feb 22, 2023
4d08601
Fix
fangliuyu Feb 22, 2023
1057aa0
Fix
fangliuyu Feb 22, 2023
762b4ef
Fix
fangliuyu Feb 24, 2023
6210e51
Fix
fangliuyu Feb 25, 2023
18d44c1
Fix
fangliuyu Feb 25, 2023
74a1d9b
Fix
fangliuyu Feb 25, 2023
9f13402
Fix
fangliuyu Feb 26, 2023
6601021
Fix
fangliuyu Feb 26, 2023
b336af8
Fix
fangliuyu Feb 26, 2023
cc3a28b
Fix
fangliuyu Feb 26, 2023
94fbf6d
🎨 改进代码样式
github-actions[bot] Feb 26, 2023
9baed38
Merge pull request #3 from fangliuyu/create-pull-request/patch
fangliuyu Feb 26, 2023
8ba6eb0
Fix
fangliuyu Feb 26, 2023
5d85ec9
Merge branch 'master' of github.com:fangliuyu/ZeroBot-Plugin
fangliuyu Feb 26, 2023
688cd06
新增多功能抽签
fangliuyu Feb 26, 2023
ca539c4
新增多功能抽签
fangliuyu Feb 26, 2023
46143ef
Fix
fangliuyu Feb 26, 2023
19d570a
Fix
fangliuyu Feb 26, 2023
2222262
Fix
fangliuyu Feb 26, 2023
8b866c1
Fix
fangliuyu Feb 26, 2023
a3480c4
Fix
fangliuyu Feb 26, 2023
e5d4960
Fix
fangliuyu Feb 28, 2023
0951d7d
优化抽签插件
fangliuyu Mar 2, 2023
c29d5af
限制云养猫
fangliuyu Mar 2, 2023
c546816
🎨 改进代码样式
github-actions[bot] Mar 2, 2023
425b208
Merge pull request #4 from fangliuyu/create-pull-request/patch
fangliuyu Mar 3, 2023
72e6785
新增steam视监插件
fangliuyu Mar 3, 2023
7f968c2
Merge branch 'master' of github.com:fangliuyu/ZeroBot-Plugin
fangliuyu Mar 3, 2023
c9ce004
Fix
fangliuyu Mar 4, 2023
b3679b0
Fix
fangliuyu Mar 4, 2023
8ae8cf4
FIX
fangliuyu Mar 4, 2023
7fa9c59
Fix
fangliuyu Mar 4, 2023
9a05b48
Fix
fangliuyu Mar 4, 2023
9787105
新增电影插件
fangliuyu Mar 6, 2023
4966d31
修改缩放公式
fangliuyu Mar 6, 2023
80bc80d
修改缩放公式
fangliuyu Mar 6, 2023
947ae78
修改缩放公式
fangliuyu Mar 6, 2023
9afcc96
修改缩放比例
fangliuyu Mar 6, 2023
7bc0a4e
Merge branch 'master' of github.com:fangliuyu/ZeroBot-Plugin
fangliuyu Mar 6, 2023
bd06dbb
Fix
fangliuyu Mar 7, 2023
b1f826c
Fix
fangliuyu Mar 8, 2023
eb1aa49
修改自动更新
fangliuyu Mar 11, 2023
602cdf9
Fix
fangliuyu Mar 11, 2023
e32d9d9
update
fangliuyu Mar 11, 2023
25bea67
update
fangliuyu Mar 11, 2023
1f6d426
Merge branch 'master' of github.com:fangliuyu/ZeroBot-Plugin
fangliuyu Mar 11, 2023
7285b3b
Fix
fangliuyu Mar 11, 2023
15739cd
Update
fangliuyu Mar 11, 2023
8e831ee
Merge remote-tracking branch 'upstream/master'
fangliuyu Mar 11, 2023
3e69dd6
Update
fangliuyu Mar 11, 2023
71df6e5
Update
fangliuyu Mar 11, 2023
a4486fa
修复一些已知问题
fangliuyu Mar 15, 2023
1d18240
修改一些问题
fangliuyu Mar 17, 2023
1d3e057
修改图片被拉伸的问题
fangliuyu Mar 17, 2023
18ce35d
Merge remote-tracking branch 'upstream/master'
fangliuyu Mar 20, 2023
fb545f8
修复云养猫一些已知问题,电影毛玻璃处理
fangliuyu Mar 20, 2023
ad5537a
[ fix ] err空传问题
fangliuyu Mar 21, 2023
3dc31f4
新增签到新界面
fangliuyu Mar 23, 2023
46bb2c9
修改进度条样式
fangliuyu Mar 24, 2023
cd1823e
魔改APIkey存储方式
fangliuyu Mar 24, 2023
7face84
微调签到
fangliuyu Mar 24, 2023
e669301
[微调]群昵称自适应
fangliuyu Mar 26, 2023
a0e1db0
fix lint
fangliuyu Mar 26, 2023
6591cee
fix lint
fangliuyu Mar 26, 2023
4785020
Merge
fangliuyu Mar 26, 2023
44aba73
微调签到
fangliuyu Mar 26, 2023
9de847e
本地色图支持自定义多张
fangliuyu Mar 26, 2023
221e1cc
Fix
fangliuyu Mar 26, 2023
35ae1e5
Update
fangliuyu Mar 26, 2023
369d325
Fix
fangliuyu Mar 27, 2023
a6658bd
新增反馈功能
fangliuyu Mar 28, 2023
0f6f175
Fix
fangliuyu Mar 28, 2023
dc98b89
Fix 文心(更新api请求方式)
fangliuyu Apr 1, 2023
416a113
签到图片不在重复下载
fangliuyu Apr 1, 2023
0efd9ed
update
fangliuyu Apr 1, 2023
d3cc2da
Fix
fangliuyu Apr 1, 2023
7adbc66
Debug
fangliuyu Apr 2, 2023
86af3a3
优化
fangliuyu Apr 2, 2023
d170a97
make lint happy
fangliuyu Apr 2, 2023
0f524a8
make lint happy
fangliuyu Apr 2, 2023
985b9ad
make lint happy
fangliuyu Apr 2, 2023
99c1b45
make lint happy
fangliuyu Apr 2, 2023
c99f903
让插卡插件本地化x
fangliuyu Apr 2, 2023
b3f410a
make lint happy
fangliuyu Apr 2, 2023
e44ff1b
fix sql
fangliuyu Apr 2, 2023
d029a89
make lint happy
fangliuyu Apr 2, 2023
c377e07
make lint happy
fangliuyu Apr 2, 2023
d66a0ee
Fix
fangliuyu Apr 3, 2023
2921f6c
Fix
fangliuyu Apr 3, 2023
2d87ac9
Fix
fangliuyu Apr 4, 2023
4e5b391
Merge remote-tracking branch 'upstream/master'
fangliuyu Apr 5, 2023
3c7f623
Merge remote-tracking branch 'upstream/master'
fangliuyu Apr 5, 2023
d37e0d5
Merge remote-tracking branch 'upstream/master'
fangliuyu Apr 5, 2023
4239013
Fix
fangliuyu Apr 5, 2023
279d8db
Merge remote-tracking branch 'upstream/master'
fangliuyu Apr 7, 2023
f963e23
Update
fangliuyu Apr 7, 2023
644eba6
使重启范用化
fangliuyu Apr 7, 2023
38faa43
Merge remote-tracking branch 'upstream/master'
fangliuyu Apr 8, 2023
dc1367f
适应新版zbp
fangliuyu Apr 8, 2023
d635713
Merge branch 'master' of github.com:FloatTech/ZeroBot-Plugin
fangliuyu Apr 10, 2023
397f343
Merge branch 'master' of github.com:FloatTech/ZeroBot-Plugin
fangliuyu Apr 11, 2023
88f4be8
修复一些bug
fangliuyu Apr 14, 2023
a0e632b
Fix
fangliuyu Apr 14, 2023
1af1e98
Fix
fangliuyu Apr 14, 2023
b9302b0
Fix
fangliuyu Apr 14, 2023
bd24fa2
取消并发,加入惩罚机制
fangliuyu Apr 16, 2023
8489daf
Fix
fangliuyu Apr 17, 2023
45b9cc0
提高马赛克难度
fangliuyu Apr 17, 2023
11af984
调整
fangliuyu Apr 18, 2023
5b040db
调整
fangliuyu Apr 21, 2023
4d0ab8c
Update
fangliuyu Apr 25, 2023
2cc54bb
make lint happy
fangliuyu Apr 25, 2023
36d2385
make lint happy
fangliuyu Apr 25, 2023
d3fdb8b
Fix
fangliuyu Apr 25, 2023
ba00eb2
备份代码
fangliuyu May 1, 2023
f279bd4
Update
fangliuyu May 1, 2023
0c57069
Merge remote-tracking branch 'upstream/master'
fangliuyu May 1, 2023
e811ab1
Update
fangliuyu May 18, 2023
3a0f3c3
Merge remote-tracking branch 'upstream/master'
fangliuyu May 18, 2023
3cbd335
Merge remote-tracking branch 'upstream/master'
fangliuyu Jul 21, 2023
bd9a622
Merge remote-tracking branch 'upstream/master'
fangliuyu Jul 30, 2023
d69ed2c
remove 观察猫猫
fangliuyu Jul 30, 2023
ab2a7fd
新增coc辅助器插件
fangliuyu Aug 14, 2023
f813606
make linit happy
fangliuyu Aug 14, 2023
2c246a5
make linit happy
fangliuyu Aug 14, 2023
44d205a
make linit happy
fangliuyu Aug 14, 2023
17ef990
make linit happy
fangliuyu Aug 14, 2023
a857ee3
调整coc插件功能
fangliuyu Aug 15, 2023
0accc2a
fix coc
fangliuyu Aug 15, 2023
a2b1356
Update
fangliuyu Aug 16, 2023
92e1605
新增钓鱼模拟器
fangliuyu Aug 23, 2023
378dfa3
make linit happy
fangliuyu Aug 23, 2023
5c13907
change
fangliuyu Aug 23, 2023
b5ebd9d
use zbpdata pic
fangliuyu Aug 23, 2023
2d77cc0
Fix bug
fangliuyu Aug 23, 2023
e16863a
fix
fangliuyu Aug 23, 2023
dd741bd
Fix bug
fangliuyu Aug 23, 2023
29cc348
Fix bug
fangliuyu Aug 23, 2023
60ff7b9
fix
fangliuyu Aug 23, 2023
bbd8350
fix
fangliuyu Aug 23, 2023
adba847
Merge branch 'master' of github.com:fangliuyu/ZeroBot-Plugin
fangliuyu Aug 23, 2023
133b6a1
fix
fangliuyu Aug 23, 2023
d3e4f0f
增加钓鱼概率
fangliuyu Aug 24, 2023
7f895a9
修复零元购问题
fangliuyu Aug 24, 2023
19dda75
调整商品价格
fangliuyu Aug 24, 2023
b186e78
优化代码
fangliuyu Aug 25, 2023
847b583
优化代码
fangliuyu Aug 27, 2023
f9ae428
新增唱片物品
fangliuyu Aug 28, 2023
1aa7cda
修复 help
fangliuyu Aug 28, 2023
368a85a
调整文本描述
fangliuyu Aug 28, 2023
cac2632
新增三叉戟物品
fangliuyu Aug 30, 2023
ad81ed0
调整合成内容
fangliuyu Aug 30, 2023
4c9df22
修复bug
fangliuyu Sep 2, 2023
698e024
fix
fangliuyu Sep 2, 2023
2bae546
fix
fangliuyu Sep 2, 2023
4e2206e
fix
fangliuyu Sep 2, 2023
ba7f47c
fix
fangliuyu Sep 2, 2023
df02e5f
fix
fangliuyu Sep 2, 2023
f5a1842
fix
fangliuyu Sep 2, 2023
3764c1e
fix
fangliuyu Sep 2, 2023
a6d358b
update
fangliuyu Sep 2, 2023
ad30671
大改钓鱼插件,配置设置到json
fangliuyu Sep 2, 2023
0f8ee9c
make linit happy
fangliuyu Sep 2, 2023
11a9ffa
概率分布修改
fangliuyu Sep 3, 2023
2f8dc91
修复文案错误
fangliuyu Sep 3, 2023
5ef0a61
修复bug
fangliuyu Sep 3, 2023
3107f2d
修复bug
fangliuyu Sep 3, 2023
b2b8146
修复bug
fangliuyu Sep 3, 2023
56e6fda
修复bug
fangliuyu Sep 6, 2023
688abec
修理问题点
fangliuyu Sep 6, 2023
1b87c21
🎨 改进代码样式
github-actions[bot] Sep 6, 2023
9514104
Merge pull request #9 from fangliuyu/create-pull-request/patch
fangliuyu Sep 6, 2023
a534e25
🎨 改进代码样式
github-actions[bot] Sep 17, 2023
d54116d
Merge branch 'master' of github.com:fangliuyu/ZeroBot-Plugin into fis…
fangliuyu Sep 17, 2023
628d51e
update data branch
fangliuyu Sep 17, 2023
7276818
Merge pull request #14 from fangliuyu/create-pull-request/patch
fangliuyu Sep 17, 2023
bce15a7
update
fangliuyu Sep 17, 2023
c5175e6
Merge branch 'fish-plugin' of github.com:fangliuyu/ZeroBot-Plugin int…
fangliuyu Sep 17, 2023
cb4d233
fix
fangliuyu Sep 17, 2023
ce32c07
update
fangliuyu Sep 17, 2023
2b308b5
fix
fangliuyu Sep 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion data
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ import (
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/wordle" // 猜单词
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/ygo" // 游戏王相关插件
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/ymgal" // 月幕galgame

// _ "github.com/FloatTech/ZeroBot-Plugin/plugin/wtf" // 鬼东西

// ^^^^ //
Expand Down
41 changes: 40 additions & 1 deletion plugin/mcfish/fish.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ import (
func init() {
engine.OnRegex(`^进行(([1-5]\d|[1-9])次)?钓鱼$`, getdb).SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) {
uid := ctx.Event.UserID
numberOfPole, err := dbdata.getNumberFor(uid, "竿")
if err != nil {
ctx.SendChain(message.Text("[ERROR at store.go.9.3]:", err))
return
}
if numberOfPole > 30 {
ctx.SendChain(message.Text("你有", numberOfPole, "支鱼竿,大于30支的玩家不允许钓鱼"))
return
}
fishNumber := 1
info := ctx.State["regex_matched"].([]string)[2]
if info != "" {
Expand Down Expand Up @@ -114,7 +123,10 @@ func init() {
if equipInfo.Durable < 10 && equipInfo.Durable > 0 {
msg = "(你的鱼竿耐久仅剩" + strconv.Itoa(equipInfo.Durable) + ")"
} else if equipInfo.Durable <= 0 {
msg = "(你的鱼竿耐已销毁)"
msg = "(你的鱼竿已销毁)"
}
if equipInfo.Equip == "三叉戟" {
fishNumber *= 3
}
} else {
fishNmaes, err := dbdata.pickFishFor(uid, fishNumber)
Expand All @@ -138,6 +150,7 @@ func init() {
msg += strconv.Itoa(number) + name + "、"
}
msg += ")"
fishNumber /= 2
}
waitTime := 120 / (equipInfo.Induce + 1)
ctx.SendChain(message.Reply(ctx.Event.MessageID), message.Text("你开始去钓鱼了,请耐心等待鱼上钩(预计要", time.Second*time.Duration(waitTime), ")"))
Expand All @@ -153,6 +166,11 @@ func init() {
ctx.SendChain(message.Text("[ERROR at fish.go.5.1]:", err))
return
}
number2, err := dbdata.getNumberFor(uid, "海豚")
if err != nil {
ctx.SendChain(message.Text("[ERROR at fish.go.5.1]:", err))
return
}
if number > 100 || equipInfo.Equip == "美西螈" { // 放大概率
probabilities["treasure"] = probabilityLimit{
Min: 0,
Expand All @@ -171,6 +189,11 @@ func init() {
Max: 90,
}
}
if number2 != 0 {
info := probabilities["waste"]
info.Max = 100
probabilities["waste"] = info
}
for name, info := range probabilities {
switch name {
case "treasure":
Expand Down Expand Up @@ -217,6 +240,18 @@ func init() {
typeOfThing = "article"
picName = "book"
thingName = "海之眷顾"
case dice >= probabilities["净化书"].Min && dice < probabilities["净化书"].Max:
typeOfThing = "article"
picName = "book"
thingName = "净化书"
case dice >= probabilities["宝藏诅咒"].Min && dice < probabilities["宝藏诅咒"].Max:
typeOfThing = "article"
picName = "book"
thingName = "宝藏诅咒"
case dice >= probabilities["海豚"].Min && dice < probabilities["海豚"].Max:
typeOfThing = "fish"
picName = "海豚"
thingName = "海豚"
default:
typeOfThing = "article"
picName = "book"
Expand Down Expand Up @@ -300,6 +335,10 @@ func init() {
thingNameList[thingName] += number
}
}
err = dbdata.updateCurseFor(uid, "fish", fishNumber)
if err != nil {
logrus.Warnln(err)
}
if len(thingNameList) == 1 {
thingName := ""
numberOfFish := 0
Expand Down
166 changes: 120 additions & 46 deletions plugin/mcfish/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ type fishdb struct {
// FishLimit 钓鱼次数上限
const FishLimit = 50

// version 规则版本号
const version = "5.4.1"

// 各物品信息
type jsonInfo struct {
ZoneInfo []zoneInfo `json:"分类"` // 区域概率
Expand Down Expand Up @@ -79,6 +82,8 @@ type fishState struct {
Duration int64
Fish int
Equip int
Curse int // 功德--(x)
Bless int // 功德++(x)
}

type storeDiscount struct {
Expand Down Expand Up @@ -109,18 +114,23 @@ var (
Brief: "钓鱼",
Help: "一款钓鱼模拟器\n----------指令----------\n" +
"- 钓鱼看板/钓鱼商店\n- 购买xxx\n- 购买xxx [数量]\n- 出售xxx\n- 出售xxx [数量]\n" +
"- 钓鱼背包\n- 装备[xx竿|三叉戟|美西螈]\n- 附魔[诱钓|海之眷顾]\n- 修复鱼竿\n- 合成[xx竿|三叉戟]\n" +
"- 钓鱼背包\n- 装备[xx竿|三叉戟|美西螈]\n- 附魔[诱钓|海之眷顾]\n- 修复鱼竿\n- 合成[xx竿|三叉戟]\n- 消除绑定诅咒\n- 消除绑定诅咒 [数量]\n" +
"- 进行钓鱼\n- 进行n次钓鱼\n- 当前装备概率明细\n" +
"规则:\n1.每日的商店价格是波动的!!如何最大化收益自己考虑一下喔\n" +
"规则V" + version + ":\n" +
"1.每日的商店价格是波动的!!如何最大化收益自己考虑一下喔\n" +
"2.装备信息:\n-> 木竿 : 耐久上限:30 均价:100 上钩概率:0.7%\n-> 铁竿 : 耐久上限:50 均价:300 上钩概率:0.2%\n-> 金竿 : 耐久上限:70 均价700 上钩概率:0.06%\n" +
"-> 钻石竿 : 耐久上限:100 均价1500 上钩概率:0.03%\n-> 下界合金竿 : 耐久上限:150 均价3100 上钩概率:0.01%\n-> 三叉戟 : 可使钓的鱼类物品数量变成3 耐久上限:300 均价4000 只能合成和交易\n" +
"3.附魔书信息:\n-> 诱钓 : 减少上钩时间. 均价:1000, 上钩概率:0.59%\n-> 海之眷顾 : 增加宝藏上钩概率. 均价:2500, 上钩概率:0.39%\n" +
"4.稀有物品:\n-> 唱片 : 出售物品时使用该物品使价格翻倍. 均价:3000, 上钩概率:0.01%\n-> 美西螈 : 可装备,获得隐形[钓鱼佬]buff,并让钓到除鱼竿和美西螈外的物品数量变成3,无耐久上限.不可修复/附魔,每次钓鱼消耗任意一鱼类物品. 均价:3000, 上钩概率:0.01%\n" +
"-> 钻石竿 : 耐久上限:100 均价1500 上钩概率:0.03%\n-> 下界合金竿 : 耐久上限:150 均价3100 上钩概率:0.01%\n-> 三叉戟 : 可使1次钓鱼视为3次钓鱼. 耐久上限:300 均价4000 只能合成、修复和交易\n" +
"3.附魔书信息:\n-> 诱钓 : 减少上钩时间. 均价:1000, 上钩概率:0.25%\n-> 海之眷顾 : 增加宝藏上钩概率. 均价:2500, 上钩概率:0.10%\n" +
"4.稀有物品:\n-> 唱片 : 出售物品时使用该物品使价格翻倍. 均价:3000, 上钩概率:0.01%\n" +
"-> 美西螈 : 可装备,获得隐形[钓鱼佬]buff,并让钓到除鱼竿和美西螈外的物品数量变成3,无耐久上限.不可修复/附魔,每次钓鱼消耗两任意鱼类物品. 均价:3000, 上钩概率:0.01%\n" +
"-> 海豚 : 使空竿概率变成垃圾概率. 均价:1000, 上钩概率:0.19%\n" +
"-> 宝藏诅咒 : 无法交易,每一层就会增加购买时10%价格和减少出售时10%价格(超过10层会变为倒贴钱). 上钩概率:0.25%\n-> 净化书 : 用于消除宝藏诅咒. 均价:5000, 上钩概率:0.19%\n" +
"5.鱼类信息:\n-> 鳕鱼 : 均价:10 上钩概率:0.69%\n-> 鲑鱼 : 均价:50 上钩概率:0.2%\n-> 热带鱼 : 均价:100 上钩概率:0.06%\n-> 河豚 : 均价:300 上钩概率:0.03%\n-> 鹦鹉螺 : 均价:500 上钩概率:0.01%\n-> 墨鱼 : 均价:500 上钩概率:0.01%\n" +
"6.垃圾:\n-> 均价:10 上钩概率:30%\n" +
"7.物品BUFF:\n-> 钓鱼佬 : 当背包名字含有'鱼'的物品数量超过100时激活,钓到物品概率提高至90%\n-> 修复大师 : 当背包鱼竿数量超过10时激活,修复物品时耐久百分百继承\n" +
"8.合成:\n-> 铁竿 : 3x木竿\n-> 金竿 : 3x铁竿\n-> 钻石竿 : 3x金竿\n-> 下界合金竿 : 3x钻石竿\n-> 三叉戟 : 3x下界合金竿\n注:合成成功率90%,继承附魔等级合/3的等级\n" +
"9.杂项:\n-> 无装备的情况下,每人最多可以购买3次100块钱的鱼竿\n-> 默认状态钓鱼上钩概率为60%(理论值!!!)\n-> 附魔的鱼竿会因附魔变得昂贵,每个附魔最高3级\n-> 三叉戟不算鱼竿",
"9.杂项:\n-> 无装备的情况下,每人最多可以购买3次100块钱的鱼竿\n-> 默认状态钓鱼上钩概率为60%(理论值!!!)\n-> 附魔的鱼竿会因附魔变得昂贵,每个附魔最高3级\n-> 三叉戟不算鱼竿,修复时可直接满耐久\n" +
"-> 鱼竿数量大于50的不能买东西;\n 鱼竿数量大于30的不能钓鱼;\n 每购/售10次物品获得1层宝藏诅咒;\n 每钓鱼75次获得1本净化书",
PublicDataFolder: "McFish",
}).ApplySingle(ctxext.DefaultSingle)
getdb = fcext.DoOnceOnSuccess(func(ctx *zero.Ctx) bool {
Expand Down Expand Up @@ -184,15 +194,17 @@ func init() {
switch {
case info.Type == "pole" || info.Name == "美西螈":
poleList = append(poleList, info.Name)
case info.Type == "fish":
case info.Type == "fish" || info.Name == "海豚":
fishList = append(fishList, info.Name)
case info.Type == "waste":
wasteList = append(wasteList, info.Name)
case info.Type == "treasure":
treasureList = append(treasureList, info.Name)
}
thingList = append(thingList, info.Name)
priceList[info.Name] = info.Price
if info.Name != "宝藏诅咒" {
thingList = append(thingList, info.Name)
priceList[info.Name] = info.Price
}
if info.Durable != 0 {
durationList[info.Name] = info.Durable
}
Expand Down Expand Up @@ -232,6 +244,56 @@ func (sql *fishdb) updateFishInfo(uid int64, number int) (residue int, err error
return
}

// 更新buff
func (sql *fishdb) updateCurseFor(uid int64, info string, number int) (err error) {
if number < 1 {
return
}
sql.Lock()
defer sql.Unlock()
userInfo := fishState{ID: uid}
err = sql.db.Create("fishState", &userInfo)
if err != nil {
return err
}
changeCheck := false
add := 0
buffName := "宝藏诅咒"
_ = sql.db.Find("fishState", &userInfo, "where ID = "+strconv.FormatInt(uid, 10))
if info == "fish" {
userInfo.Bless += number
for userInfo.Bless >= 75 {
add++
changeCheck = true
buffName = "净化书"
userInfo.Bless -= 75
}
} else {
userInfo.Curse += number
for userInfo.Curse >= 10 {
add++
changeCheck = true
userInfo.Curse -= 10
}
}
err = sql.db.Insert("fishState", &userInfo)
if err != nil {
return err
}
if changeCheck {
table := strconv.FormatInt(uid, 10) + "Pack"
thing := article{
Duration: time.Now().Unix(),
Name: buffName,
Type: "treasure",
}
_ = sql.db.Find(table, &thing, "where Name = '"+buffName+"'")
thing.Number += add
return sql.db.Insert(table, &thing)
}
return
}

/*********************************************************/
/************************装备相关函数***********************/
/*********************************************************/
Expand Down Expand Up @@ -322,41 +384,32 @@ func (sql *fishdb) pickFishFor(uid int64, number int) (fishNames map[string]int,
if !sql.db.CanFind(name, "where Type is 'fish'") {
return
}
fishTypes := make([]article, 0, count)
fishInfo := article{}
err = sql.db.FindFor(name, &fishInfo, "where Type is 'fish'", func() error {
fishTypes = append(fishTypes, fishInfo)
return nil
})
if err != nil {
return
}
if len(fishTypes) == 0 {
return
}
max := 0
for _, info := range fishTypes {
max += info.Number
}
if max < number {
number = max
}
for i := number; i > 0; {
randNumber := rand.Intn(len(fishTypes))
if fishTypes[randNumber].Number <= 0 {
k := 0
for i := number * 2; i > 0 && k < len(fishList); {
_ = sql.db.Find(name, &fishInfo, "where Name is '"+fishList[k]+"'")
if fishInfo.Number <= 0 {
k++
continue
}
fishTypes[randNumber].Number--
if fishTypes[randNumber].Number <= 0 {
err = sql.db.Del(name, "where Duration = "+strconv.FormatInt(fishTypes[randNumber].Duration, 10))
if fishInfo.Number < i {
k++
fishInfo.Number = 0
i -= fishInfo.Number
fishNames[fishInfo.Name] += fishInfo.Number
} else {
err = sql.db.Insert(name, &fishTypes[randNumber])
fishNames[fishInfo.Name] += i
fishInfo.Number -= i
i = 0
}
if fishInfo.Number <= 0 {
err = sql.db.Del(name, "where Duration = "+strconv.FormatInt(fishInfo.Duration, 10))
} else {
err = sql.db.Insert(name, &fishInfo)
}
if err != nil {
return
}
fishNames[fishTypes[randNumber].Name]++
i--
}
return
}
Expand Down Expand Up @@ -507,24 +560,45 @@ func (sql *fishdb) refreshStroeInfo() (ok bool, err error) {
discountList[name] = 100
}
}
if refresh { // 每天调控1种鱼
thingInfo := store{}
err = sql.db.Create("store", &thingInfo)
thing := store{}
oldThing := []store{}
_ = sql.db.FindFor("stroeDiscount", &thing, "where type = 'pole'", func() error {
if time.Since(time.Unix(thing.Duration, 0)) > 24 {
oldThing = append(oldThing, thing)
}
return nil
})
for _, info := range oldThing {
_ = sql.db.Del("stroeDiscount", "where Duration = "+strconv.FormatInt(info.Duration, 10))
}
if refresh {
err = sql.db.Create("store", &store{})
if err != nil {
return
}
// 每天调控1种鱼
fish := fishList[rand.Intn(len(fishList))]
_ = sql.db.Find("store", &thingInfo, "where Name = '"+fish+"'")
if thingInfo == (store{}) {
thingInfo.Duration = time.Now().Unix()
thingInfo.Type = "fish"
thingInfo.Name = fish
thingInfo.Price = priceList[fish] * discountList[fish] / 100
thingInfo := store{
Duration: time.Now().Unix(),
Name: fish,
Type: "fish",
Price: priceList[fish] * discountList[fish] / 100,
}
_ = sql.db.Find("store", &thingInfo, "where Name = '"+fish+"'")
thingInfo.Number += (100 - discountList[fish])
if thingInfo.Number < 1 {
thingInfo.Number = 1
thingInfo.Number = 100
}
_ = sql.db.Insert("store", &thingInfo)
// 每天上架20本净化书
thingInfo = store{
Duration: time.Now().Unix(),
Name: "净化书",
Type: "article",
Price: priceList["净化书"] * discountList["净化书"] / 100,
}
_ = sql.db.Find("store", &thingInfo, "where Name = '净化书'")
thingInfo.Number = 20
_ = sql.db.Insert("store", &thingInfo)
}
return true, nil
Expand Down
Loading
Loading