fill data to Phase and Turn (#236)

This commit is contained in:
xxyheaven 2023-08-03 13:49:34 +08:00 committed by GitHub
parent 43bdfb8c53
commit c86d6a7249
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -152,7 +152,7 @@ GameEvent.functions[GameEvent.Round] = function(self)
repeat repeat
p = room.current p = room.current
GameEvent(GameEvent.Turn):exec() GameEvent(GameEvent.Turn, p):exec()
if room.game_finished then break end if room.game_finished then break end
room.current = room.current:getNextAlive() room.current = room.current:getNextAlive()
until p.seat >= p:getNextAlive().seat until p.seat >= p:getNextAlive().seat

View File

@ -417,7 +417,7 @@ function ServerPlayer:changePhase(from_phase, to_phase)
table.remove(self.phases, 1) table.remove(self.phases, 1)
end end
GameEvent(GameEvent.Phase, self):exec() GameEvent(GameEvent.Phase, self, self.phase):exec()
return false return false
end end
@ -445,7 +445,7 @@ function ServerPlayer:gainAnExtraPhase(phase, delay)
} }
GameEvent(GameEvent.Phase, self):exec() GameEvent(GameEvent.Phase, self, self.phase):exec()
self.phase = current self.phase = current
room:broadcastProperty(self, "phase") room:broadcastProperty(self, "phase")
@ -511,7 +511,7 @@ function ServerPlayer:play(phase_table)
end end
if (not skip) or (cancel_skip) then if (not skip) or (cancel_skip) then
GameEvent(GameEvent.Phase, self):exec() GameEvent(GameEvent.Phase, self, self.phase):exec()
else else
room:sendLog{ room:sendLog{
type = "#PhaseSkipped", type = "#PhaseSkipped",
@ -559,7 +559,7 @@ function ServerPlayer:gainAnExtraTurn(delay)
local current = room.current local current = room.current
room.current = self room.current = self
GameEvent(GameEvent.Turn):exec() GameEvent(GameEvent.Turn, self):exec()
room.current = current room.current = current
end end