Skip to content

Commit

Permalink
[mcfish] add Synthesize all pole (#942)
Browse files Browse the repository at this point in the history
* [mcfish] add Synthesize all pole

1. 提升程序便利性,添加合成所有鱼竿功能(梭哈)。
2. 完善附魔功能的用户提示

* [mcfish] 更新合成相关说明
  • Loading branch information
vatebur authored Aug 3, 2024
1 parent 61501d8 commit 97a647a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 9 deletions.
2 changes: 1 addition & 1 deletion plugin/mcfish/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ var (
"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" +
"8.合成:\n-> 铁竿 : 3x木竿\n-> 金竿 : 3x铁竿\n-> 钻石竿 : 3x金竿\n-> 下界合金竿 : 3x钻石竿\n-> 三叉戟 : 3x下界合金竿\n注:合成成功率90%(包括梭哈),合成鱼竿的附魔等级=(附魔等级合/合成鱼竿数量)\n" +
"9.杂项:\n-> 无装备的情况下,每人最多可以购买3次100块钱的鱼竿\n-> 默认状态钓鱼上钩概率为60%(理论值!!!)\n-> 附魔的鱼竿会因附魔变得昂贵,每个附魔最高3级\n-> 三叉戟不算鱼竿,修复时可直接满耐久\n" +
"-> 鱼竿数量大于50的不能买东西;\n 鱼竿数量大于30的不能钓鱼;\n 每购/售10次鱼竿获得1层宝藏诅咒;\n 每购买20次物品将获得3次价格减半福利;\n 每钓鱼75次获得1本净化书;\n" +
" 每天最多只可出售5个鱼竿和购买15次物品;",
Expand Down
33 changes: 25 additions & 8 deletions plugin/mcfish/pole.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ func init() {
msg = append(msg, message.Text("[", i, "] ", info.Equip, " : 耐", info.Durable, "/修", info.Maintenance,
"/诱", enchantLevel[info.Induce], "/眷顾", enchantLevel[info.Favor], "\n"))
}
msg = append(msg, message.Text("————————\n输入对应序号进行装备,或回复“取消”取消"))
msg = append(msg, message.Text("————————\n"))
msg = append(msg, message.Text("- 输入对应序号进行装备\n"))
msg = append(msg, message.Text("- 输入“取消”终止本次操作\n"))
msg = append(msg, message.Text("- 鱼竿数量请使用钓鱼背包查看"))
ctx.Send(msg)
// 等待用户下一步选择
recv, cancel := zero.NewFutureEvent("message", 999, false, zero.RegexRule(`^(取消|\d+)$`), zero.CheckUser(ctx.Event.UserID)).Repeat()
Expand Down Expand Up @@ -316,13 +319,15 @@ func init() {
case "诱钓":
equipInfo.Induce++
if equipInfo.Induce > 3 {
equipInfo.Induce = 3
ctx.SendChain(message.Text("诱钓等级已达到上限,你浪费了一本附魔书"))
return
}
number = equipInfo.Induce
case "海之眷顾":
equipInfo.Favor++
if equipInfo.Favor > 3 {
equipInfo.Favor = 3
ctx.SendChain(message.Text("海之眷顾等级已达到上限,你浪费了一本附魔书"))
return
}
number = equipInfo.Favor
default:
Expand Down Expand Up @@ -378,6 +383,8 @@ func init() {
})
}
list := []int{0, 1, 2}
// 可以用于合成的鱼竿数量(取3的倍数)
upgradeNum := (len(articles) / 3) * 3
check := false
if len(articles) > 3 {
msg := make(message.Message, 0, 3+len(articles))
Expand All @@ -386,10 +393,13 @@ func init() {
msg = append(msg, message.Text("[", i, "] ", info.Equip, " : 耐", info.Durable, "/修", info.Maintenance,
"/诱", enchantLevel[info.Induce], "/眷顾", enchantLevel[info.Favor], "\n"))
}
msg = append(msg, message.Text("————————\n输入3个序号进行合成(用空格分割),或回复“取消”取消"))
msg = append(msg, message.Text("————————\n"))
msg = append(msg, message.Text("- 输入3个序号进行合成(用空格分割)\n"))
msg = append(msg, message.Text("- 输入“取消”,终止本次合成\n"))
msg = append(msg, message.Text("- 输入“梭哈“,合成所有鱼竿"))
ctx.Send(message.ReplyWithMessage(ctx.Event.MessageID, msg...))
// 等待用户下一步选择
recv, cancel := zero.NewFutureEvent("message", 999, false, zero.RegexRule(`^(取消|\d+ \d+ \d+)$`), zero.CheckUser(ctx.Event.UserID)).Repeat()
recv, cancel := zero.NewFutureEvent("message", 999, false, zero.RegexRule(`^(梭哈|取消|\d+ \d+ \d+)$`), zero.CheckUser(ctx.Event.UserID)).Repeat()
defer cancel()
for {
select {
Expand All @@ -410,6 +420,13 @@ func init() {
)
return
}
if nextcmd == "梭哈" {
for i := 3; i < upgradeNum; i++ {
list = append(list, i)
}
check = true
break
}
chooseList := strings.Split(nextcmd, " ")
first, err := strconv.Atoi(chooseList[0])
if err != nil {
Expand Down Expand Up @@ -463,12 +480,12 @@ func init() {
)
return
}
attribute := strconv.Itoa(durationList[thingName]) + "/0/" + strconv.Itoa(induceLevel/3) + "/" + strconv.Itoa(favorLevel/3)
attribute := strconv.Itoa(durationList[thingName]) + "/0/" + strconv.Itoa(induceLevel/upgradeNum) + "/" + strconv.Itoa(favorLevel/upgradeNum)
newthing := article{
Duration: time.Now().Unix(),
Type: "pole",
Name: thingName,
Number: 1,
Number: upgradeNum / 3,
Other: attribute,
}
err = dbdata.updateUserThingInfo(uid, newthing)
Expand All @@ -478,7 +495,7 @@ func init() {
}
ctx.Send(
message.ReplyWithMessage(ctx.Event.MessageID,
message.Text(thingName, "合成成功", list, "\n属性: ", attribute),
message.Text(thingName, "合成成功", upgradeNum/3, "个铁竿\n属性: ", attribute),
),
)
})
Expand Down

0 comments on commit 97a647a

Please sign in to comment.