增加 下注积分统计

This commit is contained in:
2022-01-17 16:25:01 +08:00
parent e854fa4be5
commit 0fedded7d1
2 changed files with 14 additions and 6 deletions

View File

@ -182,8 +182,10 @@ object JHorseRacing : KotlinPlugin(
if (pool != null && pool.size > 0) { if (pool != null && pool.size > 0) {
for (bet in pool) { for (bet in pool) {
val score = JHRPluginData.Scores[bet.id]!! val score = JHRPluginData.Scores[bet.id]!!
val stat = getPlayerStat(bet.id)
stat.totalBetScore += bet.score
val income = if (winners.indexOf(bet.number) != -1) { val income = if (winners.indexOf(bet.number) != -1) {
getPlayerStat(bet.id).winCount += 1 stat.winCount += 1
(bet.score * 1.5).toInt() (bet.score * 1.5).toInt()
} else { } else {
-bet.score -bet.score
@ -454,11 +456,8 @@ object JHorseRacing : KotlinPlugin(
val stat = getPlayerStat(sender.id) val stat = getPlayerStat(sender.id)
val ret = MessageChainBuilder() val ret = MessageChainBuilder()
ret.append(message.quote()) ret.append(message.quote())
.append("下注次数:${stat.betCount}\n") .append(getPlayerStat(sender.id).toString())
.append("获胜次数:${stat.winCount}\n") .append("\nヾ(◍°∇°◍)ノ゙继续加油吧!")
.append("贡献次数:${stat.contribution}\n")
.append("签到次数:${stat.signCount}\n")
.append("ヾ(◍°∇°◍)ノ゙继续加油吧!")
subject.sendMessage(ret.asMessageChain()) subject.sendMessage(ret.asMessageChain())
} }
} }

View File

@ -7,4 +7,13 @@ class PlayerStatistics {
var winCount = 0 var winCount = 0
var contribution = 0 var contribution = 0
var signCount = 0 var signCount = 0
var totalBetScore = 0
override fun toString(): String {
return "下注次数:${betCount}\n" +
"获胜次数:${winCount}\n" +
"贡献次数:${contribution}\n" +
"签到次数:${signCount}\n" +
"下注积分:${totalBetScore}"
}
} }