mirror of
https://github.com/jie65535/mirai-console-jhr-plugin.git
synced 2025-06-02 17:39:16 +08:00
增加 下注积分统计
This commit is contained in:
parent
e854fa4be5
commit
0fedded7d1
@ -182,8 +182,10 @@ object JHorseRacing : KotlinPlugin(
|
||||
if (pool != null && pool.size > 0) {
|
||||
for (bet in pool) {
|
||||
val score = JHRPluginData.Scores[bet.id]!!
|
||||
val stat = getPlayerStat(bet.id)
|
||||
stat.totalBetScore += bet.score
|
||||
val income = if (winners.indexOf(bet.number) != -1) {
|
||||
getPlayerStat(bet.id).winCount += 1
|
||||
stat.winCount += 1
|
||||
(bet.score * 1.5).toInt()
|
||||
} else {
|
||||
-bet.score
|
||||
@ -454,11 +456,8 @@ object JHorseRacing : KotlinPlugin(
|
||||
val stat = getPlayerStat(sender.id)
|
||||
val ret = MessageChainBuilder()
|
||||
ret.append(message.quote())
|
||||
.append("下注次数:${stat.betCount}\n")
|
||||
.append("获胜次数:${stat.winCount}\n")
|
||||
.append("贡献次数:${stat.contribution}\n")
|
||||
.append("签到次数:${stat.signCount}\n")
|
||||
.append("ヾ(◍°∇°◍)ノ゙继续加油吧!")
|
||||
.append(getPlayerStat(sender.id).toString())
|
||||
.append("\nヾ(◍°∇°◍)ノ゙继续加油吧!")
|
||||
subject.sendMessage(ret.asMessageChain())
|
||||
}
|
||||
}
|
||||
|
@ -7,4 +7,13 @@ class PlayerStatistics {
|
||||
var winCount = 0
|
||||
var contribution = 0
|
||||
var signCount = 0
|
||||
var totalBetScore = 0
|
||||
|
||||
override fun toString(): String {
|
||||
return "下注次数:${betCount}\n" +
|
||||
"获胜次数:${winCount}\n" +
|
||||
"贡献次数:${contribution}\n" +
|
||||
"签到次数:${signCount}\n" +
|
||||
"下注积分:${totalBetScore}"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user