skip draw step on 0 life

This commit is contained in:
stryan 2021-09-30 22:08:27 -04:00
parent 75e2e7f86e
commit 61fe6b5936

View File

@ -186,8 +186,17 @@ func (g *Game) PlayerStateAct(id int, cmd string) *GameView {
if g.Status == StatusReady { //first turn if g.Status == StatusReady { //first turn
g.Status = StatusPlaying g.Status = StatusPlaying
} }
//skip draw step when 0 life
if id == SentinalID && g.SentinalPlayer.Life <= 0 {
g.CanDraw = false
g.HasDrawn = true
} else if id == ScourgeID && g.ScourgePlayer.Life <= 0 {
g.CanDraw = false
g.HasDrawn = true
} else {
g.CanDraw = true g.CanDraw = true
g.HasDrawn = false g.HasDrawn = false
}
if id != g.CurrentTurn { if id != g.CurrentTurn {
return nil return nil
} }