by _halgari · 12y ago · 0 comments
So the card that does the damage has to do the removal check for the minions? Talk about duplication of code. Wouldn't something like this be better:
engine.dealDamage(1).to(Category.EnemyMinions);
1. https://github.com/Mischanix/soot/blob/master/src/soot/cards...
For instance, the most common state-based effect in MTG is death from damage. This is perhaps even easier to model in Hearthstone, as damage is persistent. Simply register event handlers on minions which get called whenever the health of a minion changes; if it's <= 0, trigger death.
Death will then cause any "triggered effects" to fire, such as a deathrattle tigger. This is also easy; just a listener on the death event.