Fix a bunch of bugs.
This commit is contained in:
@@ -136,6 +136,35 @@ func TestManateeSelfRock(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// Even when its own rocks are lethal, the Manatee still stacks all 4 apples —
|
||||
// the summon is posthumous, so it fires after the Manatee faints.
|
||||
func TestManateeSelfRockFatalStillAddsApples(t *testing.T) {
|
||||
g, _, _ := testGame(t)
|
||||
g.RollDie = func() int { return 2 } // 2 rocks = 4 damage, past its 3 power
|
||||
res := forceBattle(t, g,
|
||||
[]Card{g.goldenPet(t, "Manatee")},
|
||||
[]Card{g.pet("Wall", 20)},
|
||||
)
|
||||
var self *BattleEvent
|
||||
for i, ev := range res.Events {
|
||||
if ev.Type == "rock" && ev.Target == 0 {
|
||||
self = &res.Events[i]
|
||||
}
|
||||
}
|
||||
if self == nil || !self.TargetDied {
|
||||
t.Fatalf("Manatee's own rocks should faint it: %+v", eventsOfType(res, "rock"))
|
||||
}
|
||||
apples := 0
|
||||
for _, ev := range eventsOfType(res, "summon") {
|
||||
if ev.Card != nil && ev.Card.Name == "Apple" {
|
||||
apples++
|
||||
}
|
||||
}
|
||||
if apples != 4 {
|
||||
t.Fatalf("Manatee should still add 4 apples after fainting, got %d", apples)
|
||||
}
|
||||
}
|
||||
|
||||
// Poison Dart Frog, once set aside, throws rocks each time a Bee is played.
|
||||
func TestPoisonDartFrogBeeRocks(t *testing.T) {
|
||||
g, _, _ := testGame(t)
|
||||
|
||||
Reference in New Issue
Block a user