Allow abomination to mimic play abilitites.
This commit is contained in:
+17
-3
@@ -1320,7 +1320,10 @@ func (g *Game) runBattle() *BattleResult {
|
||||
// This runs before the "battle over" check so a parting shot fires even
|
||||
// when its own side is already out (Crocodile's last-pet volley).
|
||||
anyDeath := false
|
||||
for _, q := range plays {
|
||||
// Index-based so effects queued mid-loop (Abomination mimicking a Play
|
||||
// ability) are resolved in the same pass.
|
||||
for i := 0; i < len(plays); i++ {
|
||||
q := plays[i]
|
||||
// Effects sourced from a specific unit fizzle if it's gone — unless
|
||||
// they're posthumous (the Manatee still adds its Apples after rocking
|
||||
// itself to death).
|
||||
@@ -1626,8 +1629,9 @@ func (g *Game) runBattle() *BattleResult {
|
||||
}
|
||||
case ActionGainAbility:
|
||||
// Abomination: copy a random pet's effects from the highest tier
|
||||
// discard pile. Gained abilities fire on their natural triggers going
|
||||
// forward; a gained Play ability doesn't retro-fire this turn.
|
||||
// discard pile. The copied effects join Abomination's own (so its
|
||||
// Faint/Hurt abilities fire later), and any copied Play ability
|
||||
// resolves right now — it's queued onto this same pass.
|
||||
bestTier := 0
|
||||
for tier, pile := range g.Discards {
|
||||
if tier <= bestTier {
|
||||
@@ -1652,6 +1656,16 @@ func (g *Game) runBattle() *BattleResult {
|
||||
q.unit.Card.Effects = append(append([]Effect(nil), q.unit.Card.Effects...), pick.Effects...)
|
||||
emit(BattleEvent{Type: "eat", Seat: q.seat, Bonus: q.unit.Bonus,
|
||||
Text: fmt.Sprintf("%s mimics %s's ability.", q.unit.Card.Name, pick.Name)})
|
||||
// Fire the mimicked Play abilities immediately. Skip another
|
||||
// gainAbility so mimicking can't chain into an infinite loop,
|
||||
// and skip the enter-time shields (armed only on reveal).
|
||||
for _, pe := range pick.Effects {
|
||||
if pe.Trigger != TriggerPlay || pe.Action == ActionGainAbility ||
|
||||
pe.Action == ActionShieldSelf || pe.Action == ActionPreventSelf {
|
||||
continue
|
||||
}
|
||||
plays = append(plays, queuedPlay{seat: q.seat, unit: q.unit, effect: pe})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user