mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 05:22:02 -08:00
add unit test for hapatra vizier of poisons + fix issue #5886
This commit is contained in:
parent
7ac58f9787
commit
b05981020c
3 changed files with 42 additions and 1 deletions
|
|
@ -5,6 +5,7 @@ import mage.MageObjectReference;
|
|||
import mage.ObjectColor;
|
||||
import mage.abilities.Abilities;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.RestrictionEffect;
|
||||
|
|
@ -888,7 +889,13 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
|
|||
}
|
||||
for (MarkedDamageInfo mdi : markedDamage) {
|
||||
Ability source = null;
|
||||
if (mdi.sourceObject instanceof Permanent) {
|
||||
if (mdi.sourceObject instanceof PermanentToken) {
|
||||
/* Tokens dont have a spellAbility. We must make a phony one as the source so the events in addCounters
|
||||
* can trace the source back to an object/controller.
|
||||
*/
|
||||
source = new SpellAbility(null, ((PermanentToken) mdi.sourceObject).name);
|
||||
source.setSourceId(((PermanentToken) mdi.sourceObject).objectId);
|
||||
} else if (mdi.sourceObject instanceof Permanent) {
|
||||
source = ((Permanent) mdi.sourceObject).getSpellAbility();
|
||||
}
|
||||
addCounters(mdi.counter, source, game);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue