optimize(mcfish): 更改插件规则 (#1122)

每日商店会固定刷新1初始木竿。该木竿价格也会随木竿的价格浮动。
This commit is contained in:
方柳煜
2025-02-20 00:46:35 +08:00
committed by GitHub
parent 659f4e07c2
commit 085e95cd48
3 changed files with 25 additions and 12 deletions

View File

@@ -393,7 +393,7 @@ func init() {
}
ctx.Send(message.ReplyWithMessage(ctx.Event.MessageID, message.Text("出售成功,你赚到了", pice, msg)))
})
engine.OnRegex(`^购买(`+strings.Join(thingList, "|")+`)\s*(\d*)$`, getdb, refreshFish).SetBlock(true).Limit(limitSet).Handle(func(ctx *zero.Ctx) {
engine.OnRegex(`^购买(`+strings.Join(thingList, "|")+`|初始木竿)\s*(\d*)$`, getdb, refreshFish).SetBlock(true).Limit(limitSet).Handle(func(ctx *zero.Ctx) {
uid := ctx.Event.UserID
thingName := ctx.State["regex_matched"].([]string)[1]
number, _ := strconv.Atoi(ctx.State["regex_matched"].([]string)[2])
@@ -472,6 +472,9 @@ func init() {
thingPice := (priceList[info.Name] - (durationList[info.Name] - durable) - maintenance*2 +
induceLevel*600*discountList["诱钓"]/100 +
favorLevel*1800*discountList["海之眷顾"]/100) * discountList[info.Name] / 100
if strings.Contains(thingName, "初始木竿"){
thingPice = priceList["木竿"]+priceList["木竿"] * discountList["木竿"]/100
}
pice = append(pice, thingPice)
} else {
thingPice := priceList[info.Name] * discountList[info.Name] / 100
@@ -618,6 +621,9 @@ func init() {
Number: 1,
Other: thing.Other,
}
if thingName == "初始木竿"{
newCommodity.Name = "木竿"
}
} else {
things, err1 := dbdata.getUserThingInfo(uid, thingName)
if err1 != nil {
@@ -794,6 +800,9 @@ func drawStroeInfoImage(stroeInfo []store) (picImage image.Image, err error) {
induceLevel, _ := strconv.Atoi(poleInfo[2])
favorLevel, _ := strconv.Atoi(poleInfo[3])
pice = (priceList[info.Name] - (durationList[info.Name] - durable) - maintenance*2 + induceLevel*600 + favorLevel*1800) * discountList[info.Name] / 100
if strings.Contains(name, "初始木竿"){
pice = priceList["木竿"]+priceList["木竿"] * discountList["木竿"]/100
}
} else {
pice = priceList[info.Name] * discountList[info.Name] / 100
}