Skip to content

Commit

Permalink
选角色特化
Browse files Browse the repository at this point in the history
  • Loading branch information
CuteReimu committed Sep 25, 2024
1 parent 2665a05 commit bdeedc2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/kotlin/Game.kt
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ class Game(val id: Int, totalPlayerCount: Int, val actorRef: ActorRef) {
roleSkillsDataList[it],
roleSkillsDataList[it + players.size],
roleSkillsDataList[it + players.size * 2]
).filter { r -> r.role != unknown }
).filter { r -> r.role != unknown }.toMutableList()
}))
}

Expand Down
8 changes: 7 additions & 1 deletion src/main/kotlin/phase/WaitForSelectRole.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,19 @@ import kotlin.math.roundToInt
/**
* 等待玩家选择角色
*/
data class WaitForSelectRole(val game: Game, val options: List<List<RoleSkillsData>>) : WaitingFsm {
data class WaitForSelectRole(val game: Game, val options: List<MutableList<RoleSkillsData>>) : WaitingFsm {
private val selected = MutableList<RoleSkillsData?>(game.players.size) { null }
override val whoseTurn = game.players.random()!!

private var endTime = 0L

override fun resolve(): ResolveResult? {
for (player in game.players) {
if (player!!.playerName.run { startsWith("") && endsWith("") }) {
options.all { it.all { o -> o.role != jin_sheng_huo } } || continue
options[player.location][0] = RoleCache.getRoleSkillsData(jin_sheng_huo)!!
}
}
endTime = System.currentTimeMillis() + game.waitSecond * 2 * 1000
for (player in game.players) {
if (player is HumanPlayer) {
Expand Down

0 comments on commit bdeedc2

Please sign in to comment.