Let the Innocents always win when the round ends because of time
This commit is contained in:
parent
2d67cdb3dd
commit
f6aa4e97d8
2 changed files with 3 additions and 7 deletions
|
@ -46,7 +46,7 @@ object GameManager {
|
|||
packetListeners.forEach { ProtocolLibrary.getProtocolManager().addPacketListener(it) }
|
||||
}
|
||||
|
||||
fun letRoleWin(role: Role?) {
|
||||
fun letRoleWin(role: Role) {
|
||||
ensurePhase(GamePhase.COMBAT)
|
||||
GameMessenger.win(role)
|
||||
phase = GamePhase.OVER
|
||||
|
@ -165,11 +165,7 @@ object GameManager {
|
|||
GameMessenger.combatPhaseStarted()
|
||||
|
||||
Timers.startCombatPhaseTimer {
|
||||
if (PlayerManager.getStillLivingRoles().contains(Role.INNOCENT)) {
|
||||
letRoleWin(Role.INNOCENT)
|
||||
} else {
|
||||
letRoleWin(null)
|
||||
}
|
||||
letRoleWin(Role.INNOCENT)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ object PlayerManager {
|
|||
|
||||
private fun getAvailablePlayers() = plugin.server.onlinePlayers.filter { it.gameMode === GameMode.SURVIVAL }
|
||||
private fun getStillLivingRoleGroups() = getStillLivingRoles().map { it.group }.toSet()
|
||||
fun getStillLivingRoles() = tttPlayers.filter {
|
||||
private fun getStillLivingRoles() = tttPlayers.filter {
|
||||
it.alive || SecondChance.getInstance(it)?.preventRoundEnd == true
|
||||
}.map { it.role }.toSet()
|
||||
|
||||
|
|
Reference in a new issue