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
f6619d6235
commit
37531ac315
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,5 +1,5 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
@ -549,6 +549,19 @@ object JHorseRacing : KotlinPlugin(
|
|||||||
}
|
}
|
||||||
subject.sendMessage(ret.toString())
|
subject.sendMessage(ret.toString())
|
||||||
}
|
}
|
||||||
|
msg == "胜率榜" -> {
|
||||||
|
logger.info("查询胜率榜")
|
||||||
|
val msgB = MessageChainBuilder(11)
|
||||||
|
msgB.append("胜率榜\n")
|
||||||
|
JHRPluginData.playerStat.entries.filter {
|
||||||
|
subject.contains(it.key)
|
||||||
|
}.sortedByDescending { it.value.winPercentage }
|
||||||
|
.take(10)
|
||||||
|
.onEach {
|
||||||
|
msgB.append("| ${it.value.winPercentage}% | ${subject[it.key]!!.nameCardOrNick}\n")
|
||||||
|
}
|
||||||
|
subject.sendMessage(msgB.asMessageChain())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,9 +46,13 @@ class PlayerStatistics {
|
|||||||
*/
|
*/
|
||||||
val totalProfit get() = totalWinScore + totalLossScore
|
val totalProfit get() = totalWinScore + totalLossScore
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 胜率
|
||||||
|
*/
|
||||||
|
val winPercentage get() = if (betCount > 0) (winCount/betCount.toDouble()*100).toInt() else 0
|
||||||
|
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return "下注次数:${betCount}\n" +
|
return "获胜次数:${winCount}/${betCount} (${winPercentage}%)\n" +
|
||||||
"获胜次数:${winCount}\n" +
|
|
||||||
"贡献次数:${contribution}\n" +
|
"贡献次数:${contribution}\n" +
|
||||||
"签到次数:${signCount}\n" +
|
"签到次数:${signCount}\n" +
|
||||||
"下注积分:${totalBetScore}\n" +
|
"下注积分:${totalBetScore}\n" +
|
||||||
|
Loading…
Reference in New Issue
Block a user