@Override public DynamicManaEffect copy() { return new DynamicManaEffect(this); }
@Override public boolean apply(Game game, Ability source) { checkToFirePossibleEvents(getMana(game, source), game, source); game.getPlayer(source.getControllerId()).getManaPool().addMana(getMana(game, source), game, source); return true; }
@Override public List<Mana> getNetMana(Game game) { List<Mana> newNetMana = new ArrayList<>(); if (game != null) { // TODO: effects from replacement effects like Mana Reflection are not considered yet // TODO: effects that need a X payment (e.g. Mage-Ring Network) return always 0 newNetMana.addAll(manaEffect.getNetMana(game, this)); } return newNetMana; }
Effect effect = getEffects().get(0); if (effect instanceof DynamicManaEffect) { mana = ((DynamicManaEffect) effect).getMana(game, this); } else if (effect instanceof ManaEffect) { mana = ((ManaEffect) effect).getMana(game, this);
/** * * @param mana * @param amount * @param cost * @param text * @param oneChoice is all mana from the same colour or if false the player * can choose different colours * @param netAmount a dynamic value that calculates the possible available * mana (e.g. if you have to pay by removing counters from source) */ public DynamicManaAbility(Mana mana, DynamicValue amount, Cost cost, String text, boolean oneChoice, DynamicValue netAmount) { super(Zone.BATTLEFIELD, new DynamicManaEffect(mana, amount, text, oneChoice, netAmount), cost); manaEffect = (DynamicManaEffect) this.getEffects().get(0); }
public InnerFire(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{R}"); // Add {R} for each card in your hand. this.getSpellAbility().addEffect(new DynamicManaEffect(Mana.RedMana(1), CardsInControllerHandCount.instance)); }
public ManaGeyser(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{R}{R}"); // Add {R} for each tapped land your opponents control. this.getSpellAbility().addEffect(new DynamicManaEffect(Mana.RedMana(1), new PermanentsOnBattlefieldCount(filter))); }
public BrightstoneRitual(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{R}"); // Add {R} for each Goblin on the battlefield. this.getSpellAbility().addEffect(new DynamicManaEffect(Mana.RedMana(1), new PermanentsOnBattlefieldCount(filter))); }
public BattleHymn(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{R}"); // Add {R} for each creature you control. this.getSpellAbility().addEffect(new DynamicManaEffect(Mana.RedMana(1), new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_CREATURE))); }
public ElvishGuidanceTriggeredAbility() { super(Zone.BATTLEFIELD, new DynamicManaEffect(Mana.GreenMana(1), new PermanentsOnBattlefieldCount(new FilterCreaturePermanent(SubType.ELF, "Elf")))); }
public SongsOfTheDamned(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{B}"); // Add {B} for each creature card in your graveyard. DynamicManaEffect effect = new DynamicManaEffect(Mana.BlackMana(1), new CardsInControllerGraveyardCount(new FilterCreatureCard())); this.getSpellAbility().addEffect(effect); }
public VaultOfCatlacan(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.LAND}, ""); this.addSuperType(SuperType.LEGENDARY); this.nightCard = true; // <i>(Transforms from Storm the Vault.)</i> Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new InfoEffect("<i>(Transforms from Storm the Vault.)</i>")); ability.setRuleAtTheTop(true); this.addAbility(ability); // {T}: Add one mana of any color. this.addAbility(new AnyColorManaAbility()); // {T}: Add {U} for each artifact you control. this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, new DynamicManaEffect(Mana.BlueMana(1), new PermanentsOnBattlefieldCount(StaticFilters.FILTER_CONTROLLED_PERMANENT_ARTIFACT)), new TapSourceCost())); }
public Sacrifice(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{B}"); // As an additional cost to cast Sacrifice, sacrifice a creature. this.getSpellAbility().addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); // Add an amount of {B} equal to the sacrificed creature's converted mana cost. this.getSpellAbility().addEffect(new DynamicManaEffect(Mana.BlackMana(1), new SacrificeCostConvertedMana("creature"), "add an amount of {B} equal to the sacrificed creature's converted mana cost")); }
public Dragonrage(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{R}"); // Add {R} for each attacking creature you control. this.getSpellAbility().addEffect(new DynamicManaEffect(Mana.RedMana(1), new PermanentsOnBattlefieldCount(filter))); // Until end of turn, attacking creatures you control gain "{R}: This creature gets +1/+0 until end of turn." Ability abilityToGain = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1,0,Duration.EndOfTurn), new ManaCostsImpl("{R}")); Effect effect = new GainAbilityAllEffect(abilityToGain, Duration.EndOfTurn, filter); effect.setText("Until end of turn, attacking creatures you control gain \"{R}: This creature gets +1/+0 until end of turn.\""); this.getSpellAbility().addEffect(effect); }
public KothOfTheHammer(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{2}{R}{R}"); this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.KOTH); this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +1: Untap target Mountain. It becomes a 4/4 red Elemental creature until end of turn. It's still a land. Ability ability = new LoyaltyAbility(new UntapTargetEffect(), 1); ability.addEffect(new BecomesCreatureTargetEffect(new KothOfTheHammerToken(), false, true, Duration.EndOfTurn)); ability.addTarget(new TargetLandPermanent(filter)); this.addAbility(ability); // -2: Add {R} for each Mountain you control. this.addAbility(new LoyaltyAbility(new DynamicManaEffect(Mana.RedMana(1), new PermanentsOnBattlefieldCount(filterCount)), -2)); // -5: You get an emblem with "Mountains you control have '{T}: This land deals 1 damage to any target.' this.addAbility(new LoyaltyAbility(new GetEmblemEffect(new KothOfTheHammerEmblem()), -5)); }