public void setControllerId(UUID controllerId) { this.ability.setControllerId(controllerId); for (SpellAbility spellAbility : spellAbilities) { spellAbility.setControllerId(controllerId); } this.controllerId = controllerId; }
@Override public boolean apply(Card input, Game game) { SpellAbility ability = input.getSpellAbility().copy(); ability.setControllerId(controllerId); input.adjustTargets(ability, game); return ability.canChooseTarget(game); }
@Override public boolean cast(Game game, Zone fromZone, SpellAbility ability, UUID controllerId) { switch (ability.getSpellAbilityType()) { case SPLIT_LEFT: return this.getLeftHalfCard().cast(game, fromZone, ability, controllerId); case SPLIT_RIGHT: return this.getRightHalfCard().cast(game, fromZone, ability, controllerId); default: this.getLeftHalfCard().getSpellAbility().setControllerId(controllerId); this.getRightHalfCard().getSpellAbility().setControllerId(controllerId); return super.cast(game, fromZone, ability, controllerId); } }
public Spell(Card card, SpellAbility ability, UUID controllerId, Zone fromZone) { this.card = card; this.color = card.getColor(null).copy(); this.frameColor = card.getFrameColor(null).copy(); this.frameStyle = card.getFrameStyle(); id = ability.getId(); this.ability = ability; this.ability.setControllerId(controllerId); if (ability.getSpellAbilityType() == SpellAbilityType.SPLIT_FUSED) { spellCards.add(((SplitCard) card).getLeftHalfCard()); spellAbilities.add(((SplitCard) card).getLeftHalfCard().getSpellAbility().copy()); spellCards.add(((SplitCard) card).getRightHalfCard()); spellAbilities.add(((SplitCard) card).getRightHalfCard().getSpellAbility().copy()); } else { spellCards.add(card); spellAbilities.add(ability); } this.controllerId = controllerId; this.fromZone = fromZone; this.countered = false; }
spellAbility.setControllerId(this.getId()); spellAbility.setSourceId(card.getId()); if (cast(spellAbility, game, false, null)) {
ability.setControllerId(getId()); ability.setSourceObjectZoneChangeCounter(game.getState().getZoneChangeCounter(ability.getSourceId())); if (ability.getSpellAbilityType() != SpellAbilityType.BASE) {