优化代码 (#501)

This commit is contained in:
方柳煜
2022-11-17 12:08:12 +08:00
committed by GitHub
parent 9f37962d22
commit a55f28c006
3 changed files with 9 additions and 20 deletions

View File

@@ -471,7 +471,7 @@ func init() {
fiancee := ctx.State["regex_matched"].([]string)
gay, _ := strconv.ParseInt(fiancee[2]+fiancee[3], 10, 64)
if gay == uid {
ctx.Send(message.ReplyWithMessage(message.At(uid), message.Text("[qqwife]你想给自己买什么礼物呢?")))
ctx.Send(message.ReplyWithMessage(ctx.Event.MessageID, message.At(uid), message.Text("[qqwife]你想给自己买什么礼物呢?")))
return
}
// 获取CD
@@ -504,12 +504,12 @@ func init() {
// 计算钱对应的好感值
newFavor := 1
if favor > 50 {
newFavor += moneyToFavor % 10 // 礼物厌倦
newFavor = moneyToFavor % 10 // 礼物厌倦
} else {
newFavor += rand.Intn(moneyToFavor)
}
// 随机对方心情
mood := rand.Intn(5)
mood := rand.Intn(2)
if mood == 0 {
newFavor = -newFavor
}