Skip to content

Commit

Permalink
Fix shadow wood movement
Browse files Browse the repository at this point in the history
  • Loading branch information
bobtfish committed Dec 24, 2022
1 parent 1d09183 commit c153227
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion TODO
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Bugs
- Magic wood is broken
- second game has player 3+ and never finishes player selection
- When we have multiple players (8) then some are killed select spell screen allows selections for dead players
- Shadow wood attack successful moves the wood

Visual / animation:
Press number to flash characters of one player
Expand Down
3 changes: 2 additions & 1 deletion screen/attack.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ func (screen *DoAttack) Step(ctx screeniface.GameCtx) screeniface.GameScreen {
defenceRating := defender.(movable.Attackable).GetDefence() + rand.Intn(9)
attacker := getAttacker(grid.GetGameObject(screen.AttackerV), screen.IsDismount)
attackRating := attacker.(movable.Attackerable).GetCombat() + rand.Intn(9)
attackerMovement := attacker.(movable.Movable).GetMovement()

fmt.Printf("Attack rating %d defence rating %d\n", attackRating, defenceRating)
if attackRating > defenceRating {
Expand All @@ -329,7 +330,7 @@ func (screen *DoAttack) Step(ctx screeniface.GameCtx) screeniface.GameScreen {
return newScreen
}

if canMoveOnto {
if canMoveOnto && attackerMovement > 0 {
doCharacterMove(screen.AttackerV, screen.DefenderV, grid, screen.IsDismount)
screen.AttackerV = screen.DefenderV
}
Expand Down

0 comments on commit c153227

Please sign in to comment.