From 97a647a62043ef7e4eceacb71e012a83e365758d Mon Sep 17 00:00:00 2001 From: CUU_rooooo! <67186678+vatebur@users.noreply.github.com> Date: Sat, 3 Aug 2024 11:42:07 +0800 Subject: [PATCH] [mcfish] add Synthesize all pole (#942) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [mcfish] add Synthesize all pole 1. 提升程序便利性,添加合成所有鱼竿功能(梭哈)。 2. 完善附魔功能的用户提示 * [mcfish] 更新合成相关说明 --- plugin/mcfish/main.go | 2 +- plugin/mcfish/pole.go | 33 +++++++++++++++++++++++++-------- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/plugin/mcfish/main.go b/plugin/mcfish/main.go index 8b58a58585..3f33e37f00 100644 --- a/plugin/mcfish/main.go +++ b/plugin/mcfish/main.go @@ -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次物品;", diff --git a/plugin/mcfish/pole.go b/plugin/mcfish/pole.go index ad28ce6b17..859650317d 100644 --- a/plugin/mcfish/pole.go +++ b/plugin/mcfish/pole.go @@ -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() @@ -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: @@ -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)) @@ -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 { @@ -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 { @@ -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) @@ -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), ), ) })