public EmergeAbility(final EmergeAbility ability) { super(ability); this.emergeCost = ability.emergeCost.copy(); }
public PayCostToAttackBlockEffectImpl(final PayCostToAttackBlockEffectImpl effect) { super(effect); if (effect.cost != null) { this.cost = effect.cost.copy(); } else { this.cost = null; } if (effect.manaCosts != null) { this.manaCosts = effect.manaCosts.copy(); } else { this.manaCosts = null; } this.restrictType = effect.restrictType; }
public MageObjectImpl(final MageObjectImpl object) { objectId = object.objectId; name = object.name; manaCost = object.manaCost.copy(); text = object.text; color = object.color.copy(); frameColor = object.frameColor.copy(); frameStyle = object.frameStyle; power = object.power.copy(); toughness = object.toughness.copy(); abilities = object.abilities.copy(); this.cardType.addAll(object.cardType); this.subtype.addAll(object.subtype); isAllCreatureTypes = object.isAllCreatureTypes; supertype.addAll(object.supertype); this.copy = object.copy; this.copyFrom = (object.copyFrom != null ? object.copyFrom.copy() : null); textParts = new ArrayList<>(); textParts.addAll(object.textParts); }
public PayMoreToCastAsThoughtItHadFlashAbility(Card card, ManaCosts<ManaCost> costsToAdd) { super(card.getSpellAbility().getManaCosts().copy(), card.getName() + " as though it had flash", Zone.HAND, SpellAbilityType.BASE_ALTERNATE); this.costsToAdd = costsToAdd; this.timing = TimingRule.INSTANT; this.ruleAtTheTop = true; CardUtil.increaseCost(this, costsToAdd); }
this.usesStack = ability.usesStack; this.manaCosts = ability.manaCosts; this.manaCostsToPay = ability.manaCostsToPay.copy(); this.costs = ability.costs.copy(); this.optionalCosts = ability.optionalCosts.copy();
@Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { ManaCosts attackBlockManaTax = getManaCostToPay(event, source, game); if (attackBlockManaTax != null) { return handleManaCosts(attackBlockManaTax.copy(), event, source, game); } Cost attackBlockOtherTax = getOtherCostToPay(event, source, game); if (attackBlockOtherTax != null) { return handleOtherCosts(attackBlockOtherTax.copy(), event, source, game); } return false; }
public static void increaseCost(SpellAbility spellAbility, ManaCosts<ManaCost> manaCostsToIncrease) { ManaCosts<ManaCost> increasedCost = spellAbility.getManaCostsToPay().copy(); for (ManaCost manaCost : manaCostsToIncrease) { increasedCost.add(manaCost.copy()); } spellAbility.getManaCostsToPay().clear(); spellAbility.getManaCostsToPay().addAll(increasedCost); }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); if (player != null && permanent != null) { String message = CardUtil.replaceSourceName("Pay {this}'s mana cost?", permanent.getLogName()); Cost cost = permanent.getManaCost().copy(); if (player.chooseUse(Outcome.Benefit, message, source, game)) { cost.clearPaid(); if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) { return true; } } permanent.sacrifice(source.getSourceId(), game); return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); if (player != null && permanent != null) { String message = CardUtil.replaceSourceName("Pay {this} mana cost ?", permanent.getLogName()); Cost cost = permanent.getManaCost().copy(); if (player.chooseUse(Outcome.Benefit, message, source, game)) { cost.clearPaid(); if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) { return true; } } permanent.sacrifice(source.getSourceId(), game); return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); if (player != null && permanent != null) { String message = CardUtil.replaceSourceName("Pay {this} mana cost ?", permanent.getLogName()); Cost cost = permanent.getManaCost().copy(); if (player.chooseUse(Outcome.Benefit, message, source, game)) { cost.clearPaid(); if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) { return true; } } permanent.sacrifice(source.getSourceId(), game); return true; } return false; }
@Override public ActivationStatus canActivate(UUID playerId, Game game) { if (super.canActivate(playerId, game).canActivate()) { Player controller = game.getPlayer(this.getControllerId()); if (controller != null) { for (Permanent creature : game.getBattlefield().getActivePermanents(new FilterControlledCreaturePermanent(), this.getControllerId(), this.getSourceId(), game)) { ManaCost costToPay = CardUtil.reduceCost(emergeCost.copy(), creature.getConvertedManaCost()); if (costToPay.canPay(this, this.getSourceId(), this.getControllerId(), game)) { return ActivationStatus.getTrue(); } } } } return ActivationStatus.getFalse(); }
public EmergeAbility(Card card, ManaCosts<ManaCost> emergeCost) { super(emergeCost, card.getName() + " with emerge", Zone.HAND, SpellAbilityType.BASE_ALTERNATE); this.getCosts().addAll(card.getSpellAbility().getCosts().copy()); this.getEffects().addAll(card.getSpellAbility().getEffects().copy()); this.getTargets().addAll(card.getSpellAbility().getTargets().copy()); this.timing = card.getSpellAbility().getTiming(); this.setRuleAtTheTop(true); this.emergeCost = emergeCost.copy(); }
this.frameColor = card.getFrameColor(game).copy(); this.frameStyle = card.getFrameStyle(); this.manaCost = card.getManaCost().copy(); if (card instanceof PermanentCard) { this.maxLevelCounters = ((PermanentCard) card).maxLevelCounters;
spellAbilityCopy.getManaCostsToPay().clear(); spellAbilityCopy.getCosts().addAll(this.getCosts().copy()); spellAbilityCopy.addCost(this.getManaCosts().copy()); spellAbilityCopy.setSpellAbilityCastMode(this.getSpellAbilityCastMode()); spellAbilityToResolve = spellAbilityCopy;