@Override public Spell copy() { return new Spell(this); }
@Override public boolean cast(Game game, Zone fromZone, SpellAbility ability, UUID controllerId) { Card mainCard = getMainCard(); ZoneChangeEvent event = new ZoneChangeEvent(mainCard.getId(), ability.getId(), controllerId, fromZone, Zone.STACK); ZoneChangeInfo.Stack info = new ZoneChangeInfo.Stack(event, new Spell(this, ability.getSpellAbilityToResolve(game), controllerId, event.getFromZone())); return ZonesHandler.cast(info, game); }
public Spell copySpell(UUID newController) { Spell copy = new Spell(this.card, this.ability.copySpell(), this.controllerId, this.fromZone); boolean firstDone = false; for (SpellAbility spellAbility : this.getSpellAbilities()) { if (!firstDone) { firstDone = true; continue; } SpellAbility newAbility = spellAbility.copy(); // e.g. spliced spell newAbility.newId(); copy.addSpellAbility(newAbility); } copy.setCopy(true, this); copy.setControllerId(newController); return copy; }
Spell spell = new Spell(); System.out.println(Spell.class.isInstance(spell));
spell = ((ZoneChangeInfo.Stack) info).spell; } else { spell = new Spell(card, card.getSpellAbility().copy(), card.getOwnerId(), event.getFromZone());