Skip to content

Toxic spores tweak (#874)

Dread Knight requested to merge github/fork/cxong/master into master

Created by: cxong

Here's the toxic spores part for #874 (closed), but I'm not sure about the changes so I would like a review first.

  • Renamed onAttack to onAttacked, and added an onAttack trigger. So onAttack is when a creature attacks another, and onAttacked is when a creature is attacked by another. I didn't find an existing trigger for when a creature is attacked, hence adding this new trigger.
  • Adding an Ability.triggerFunc(), which is used when Ability.trigger is undefined. This is to implement Toxic Spore's upgrade, which needs to trigger on both onAttack and onAttacked. There's no precedent for dynamic triggers, so this was the one that required the least amount of code changes. If I completely replaced Ability.trigger with a function, that will require code changes to all the existing ability files.
  • Also, I removed this line because otherwise Toxic Spore would trigger twice, but I'm not sure if this breaks any existing abilities.

Merge request reports