[STX] Implemented Prismari Apprentice

This commit is contained in:
Evan Kranzler 2021-03-27 08:06:26 -04:00
parent cc9e52e316
commit 730ac37930
3 changed files with 71 additions and 1 deletions

View file

@ -12,6 +12,8 @@ import mage.game.stack.Spell;
*/
public class MagecraftAbility extends TriggeredAbilityImpl {
public static final String SPELL_KEY = "castCopiedSpell";
public MagecraftAbility(Effect effect) {
this(effect, false);
}
@ -33,7 +35,13 @@ public class MagecraftAbility extends TriggeredAbilityImpl {
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Spell spell = game.getSpell(event.getTargetId());
return spell != null && spell.isControlledBy(getControllerId()) && spell.isInstantOrSorcery();
if (spell == null
|| !spell.isControlledBy(getControllerId())
|| !spell.isInstantOrSorcery()) {
return false;
}
getEffects().setValue(SPELL_KEY, spell);
return true;
}
@Override