Skip to content

Commit

Permalink
typo: robbery spelling mistakes (#932)
Browse files Browse the repository at this point in the history
修正单词拼写错误
  • Loading branch information
vatebur authored Jul 24, 2024
1 parent 18f7716 commit 289e74a
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions plugin/robbery/robbery.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,16 @@ func init() {
}
return
}
userIncrMonry := math.Min(rand.Intn(victimWallet/20)+500, 10000)
victimDecrMonry := userIncrMonry / (rand.Intn(4) + 1)
userIncrMoney := math.Min(rand.Intn(victimWallet/20)+500, 10000)
victimDecrMoney := userIncrMoney / (rand.Intn(4) + 1)

// 记录结果
err = wallet.InsertWalletOf(victimID, -victimDecrMonry)
err = wallet.InsertWalletOf(victimID, -victimDecrMoney)
if err != nil {
ctx.SendChain(message.Text("[ERROR]:钱包坏掉力:\n", err))
return
}
err = wallet.InsertWalletOf(uid, +userIncrMonry)
err = wallet.InsertWalletOf(uid, +userIncrMoney)
if err != nil {
ctx.SendChain(message.Text("[ERROR]:打劫失败,脏款掉入虚无\n", err))
return
Expand All @@ -142,8 +142,8 @@ func init() {
ctx.SendChain(message.At(uid), message.Text("[ERROR]:犯罪记录写入失败\n", err))
}

ctx.SendChain(message.At(uid), message.Text("打劫成功,钱包增加:", userIncrMonry, "ATRI币"))
ctx.SendChain(message.At(victimID), message.Text("保险公司对您进行了赔付,您实际损失:", victimDecrMonry, "ATRI币"))
ctx.SendChain(message.At(uid), message.Text("打劫成功,钱包增加:", userIncrMoney, "ATRI币"))
ctx.SendChain(message.At(victimID), message.Text("保险公司对您进行了赔付,您实际损失:", victimDecrMoney, "ATRI币"))
})
}

Expand All @@ -163,19 +163,19 @@ func (sql *robberyRepo) getRecord(victimID, uid int64) (ok int, err error) {
// 没有记录即不用比较
return 0, nil
}
cdinfo := robberyRecord{}
cdInfo := robberyRecord{}

err = sql.db.FindFor("criminal_record", &cdinfo, limitID, func() error {
if time.Now().Format("2006/01/02") != cdinfo.Time {
err = sql.db.FindFor("criminal_record", &cdInfo, limitID, func() error {
if time.Now().Format("2006/01/02") != cdInfo.Time {
// // 如果跨天了就删除
err = sql.db.Del("criminal_record", limitID)
return nil
}
// 俩个if是为了保证,重复打劫同一个人,ok == 3
if cdinfo.UserID == uid {
if cdInfo.UserID == uid {
ok += 2
}
if cdinfo.VictimID == victimID {
if cdInfo.VictimID == victimID {
// lint 不允许使用 ok += 1
ok++
}
Expand Down

0 comments on commit 289e74a

Please sign in to comment.