fixed Polukranos, Unchained not getting counters when entering from a zone other than the stack

This commit is contained in:
Evan Kranzler 2020-01-12 14:08:31 -05:00
parent 0f6fcaee18
commit 73d87a9432

View file

@ -1,8 +1,5 @@
package mage.cards.p; package mage.cards.p;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.SpellAbility; import mage.abilities.SpellAbility;
@ -26,6 +23,10 @@ import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/** /**
* @author TheElk801 * @author TheElk801
*/ */
@ -92,11 +93,12 @@ class PolukranosUnchainedEffect extends OneShotEffect {
return false; return false;
} }
SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY); SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY);
int counters = (spellAbility instanceof EscapeAbility) ? 12 : 6; int counters = 12;
if (!spellAbility.getSourceId().equals(source.getSourceId()) if (!(spellAbility instanceof EscapeAbility)
|| !spellAbility.getSourceId().equals(source.getSourceId())
|| permanent.getZoneChangeCounter(game) != spellAbility.getSourceObjectZoneChangeCounter() || permanent.getZoneChangeCounter(game) != spellAbility.getSourceObjectZoneChangeCounter()
|| !spellAbility.getSourceId().equals(source.getSourceId())) { || !spellAbility.getSourceId().equals(source.getSourceId())) {
return false; counters = 6;
} }
List<UUID> appliedEffects = (ArrayList<UUID>) this.getValue("appliedEffects"); List<UUID> appliedEffects = (ArrayList<UUID>) this.getValue("appliedEffects");
permanent.addCounters(CounterType.P1P1.createInstance(counters), source, game, appliedEffects); permanent.addCounters(CounterType.P1P1.createInstance(counters), source, game, appliedEffects);