public override void Apply(ActivatedAbilities abilities) { _abilities = abilities; var ap = new ManaAbilityParameters { Text = string.Format("{{T}}: Add {0} to your mana pool.", BasicLandTypeToManaSymbol[_landSubtype]), }; ap.ManaAmount(Mana.GetBasicLandMana(_landSubtype)); _addedAbility = new ManaAbility(ap); _addedAbility.Initialize(OwningCard, Game); if (_replace) { _modifier = new SetList <ActivatedAbility>(new List <ActivatedAbility> { _addedAbility }); } else { _modifier = new AddToList <ActivatedAbility>(_addedAbility); } _modifier.Initialize(ChangeTracker); _abilities.AddModifier(_modifier); }
public override void Apply(ActivatedAbilities abilities) { _abilities = abilities; if (_isBasicLand) { _removedAbility = _abilities.RemoveFirst(); } var basicLandMana = Mana.GetBasicLandMana(_changeTo); var ap = new ManaAbilityParameters { Text = "{{T}}: Add {0} to your mana pool.", }; ap.ManaAmount(basicLandMana); _addedAbility = new ManaAbility(ap); _addedAbility.Initialize(OwningCard, Game); _abilities.Add(_addedAbility); }
public override void Apply(ActivatedAbilities abilities) { _abilities = abilities; if (_isBasicLand) { _removedAbility = _abilities.RemoveFirst(); } var basicLandMana = Mana.GetBasicLandMana(_changeTo); var ap = new ManaAbilityParameters { Text = "{{T}}: Add {0} to your mana pool.", }; ap.ManaAmount(basicLandMana); _addedAbility = new ManaAbility(ap); _addedAbility.Initialize(OwningCard, Game); _abilities.Add(_addedAbility); }
public AbilityActivatedEvent(ActivatedAbility ability, Targets targets) { Ability = ability; Targets = targets; }
public AddActivatedAbility(ActivatedAbility activatedAbility) { _activatedAbility = activatedAbility; }
public ActivatedAbilityPutOnStackEvent(ActivatedAbility ability, Targets targets) : base(ability, targets) { }
public AbilityActivatedEvent(ActivatedAbility ability, Targets targets) { Ability = ability; Targets = targets; }
public Card(CardId c) { cardId = c; location = null; List<SubEffect> fx = new List<SubEffect>(); keyAbilities = new List<KeyAbility>(); string castDescription = ""; int redCost = 0, greenCost = 0, whiteCost = 0, blackCost = 0, blueCost = 0, greyCost = 0; string s = cardId.ToString(); StringBuilder b = new StringBuilder(); b.Append(s[0]); for (int i = 1; i < s.Length; i++) { char ch = s[i]; if ((byte)ch <= 90) { b.Append(' '); } b.Append(ch); } auras = new List<Aura>(); name = b.ToString(); baseActivatedAbilities = new List<ActivatedAbility>(); baseTriggeredAbilities = new List<TriggeredAbility>(); List<SubCost> castingCosts = new List<SubCost>(); Colour? forceColour = null; int? basePower = null, baseToughness = null; switch (cardId) { #region Kappa case CardId.Kappa: { blueCost = 2; greyCost = 2; basePower = 1; baseToughness = 3; cardType = CardType.Creature; race = Race.Salamander; activatedAbilities.Add(new ActivatedAbility(this, new Cost(new ExhaustCost(this)), new Effect(new Mill(new ResolveTargetRule(ResolveTarget.CONTROLLER), 4)), true, LocationPile.FIELD, "E: Target player mills 4 cards.")); } break; #endregion #region GrizzlyBear case CardId.GrizzlyBear: { greenCost = 2; cardType = CardType.Creature; race = Race.Bear; subType = SubType.Warrior; basePower = 3; baseToughness = 3; } break; #endregion #region LightningBolt case CardId.LightningBolt: { redCost = 1; greyCost = 1; cardType = CardType.Instant; fx.Add(new Ping(new FilterTargetRule(1, FilterLambda.ZAPPABLE), 3)); castDescription = "Deal 3 damage to target player or creature."; } break; #endregion #region ForkedLightning case CardId.ForkedLightning: { redCost = 1; greyCost = 1; cardType = CardType.Sorcery; fx.Add(new Ping(new FilterTargetRule(2, FilterLambda.ZAPPABLE), 1)); castDescription = "Deal 1 damage to 2 target players or creatures."; } break; #endregion #region SolemnAberration case CardId.SolemnAberration: { blackCost = 1; cardType = CardType.Creature; race = Race.Zombie; basePower = 2; baseToughness = 1; } break; #endregion #region PropheticVision case CardId.PropheticVision: { blueCost = 2; cardType = CardType.Sorcery; fx.Add(new Draw(new ResolveTargetRule(ResolveTarget.CONTROLLER), 2)); castDescription = "Draw 2 cards."; } break; #endregion #region DragonHatchling case CardId.DragonHatchling: { redCost = 1; cardType = CardType.Creature; race = Race.Dragon; basePower = 1; baseToughness = 1; keyAbilities.Add(KeyAbility.Fervor); } break; #endregion #region TempleHealer case CardId.TempleHealer: { whiteCost = 3; greyCost = 1; cardType = CardType.Creature; race = Race.Human; subType = SubType.Cleric; basePower = 4; baseToughness = 4; EventFilter e = vanillaETB; baseTriggeredAbilities.Add(new TriggeredAbility(this, friendlyETB, underYourControlETBDescription + "gain 1 life.", LocationPile.FIELD, EventTiming.Post, new GainLife(new ResolveTargetRule(ResolveTarget.CONTROLLER), 1))); } break; #endregion #region Rapture case CardId.Rapture: { whiteCost = 2; greyCost = 1; cardType = CardType.Instant; fx.Add(new MoveTo(new FilterTargetRule(1, FilterLambda.ZAPPABLE, FilterLambda.CREATURE), LocationPile.EXILE)); castDescription = "Exile target creature"; } break; #endregion #region CallToArms case CardId.CallToArms: { whiteCost = 1; cardType = CardType.Sorcery; fx.Add(new SummonTokens(new ResolveTargetRule(ResolveTarget.CONTROLLER), CardId.Squire, CardId.Squire)); castDescription = "Summon two Squires."; } break; #endregion #region Squire case CardId.Squire: { isToken = true; race = Race.Human; baseToughness = 1; basePower = 1; forceColour = Colour.WHITE; } break; #endregion #region ShimmeringKoi case CardId.ShimmeringKoi: { blueCost = 2; greyCost = 2; cardType = CardType.Creature; race = Race.Fish; basePower = 2; baseToughness = 3; baseTriggeredAbilities.Add(new TriggeredAbility(this, thisETB(this), thisETBDescription + "draw a card.", LocationPile.FIELD, EventTiming.Post, new Draw(new ResolveTargetRule(ResolveTarget.CONTROLLER), 1) )); } break; #endregion #region Belwas case CardId.Belwas: { whiteCost = 2; greyCost = 1; basePower = 3; baseToughness = 2; cardType = CardType.Creature; race = Race.Human; Aura a = new Aura( (crd) => crd.controller == this.controller && crd.colour == Colour.WHITE && crd != this, Modifiable.Power, 1, "Other white creatures you control get +1/+0."); auras.Add(a); } break; #endregion #region AlterTime case CardId.AlterTime: { blueCost = 1; cardType = CardType.Instant; fx.Add(new Timelapse(2)); fx.Add(new Draw(new ResolveTargetRule(ResolveTarget.CONTROLLER), 1)); castDescription = "Timelapse 2 " + timelapseReminder2 + "\nDraw a card."; } break; #endregion #region GrizzlyCub case CardId.GrizzlyCub: { greenCost = 1; cardType = CardType.Creature; race = Race.Bear; basePower = 2; baseToughness = 2; } break; #endregion #region EvolveFangs case CardId.EvolveFangs: { greenCost = 1; cardType = CardType.Instant; fx.Add(new ModifyUntil(new FilterTargetRule(1, FilterLambda.ZAPPABLE, FilterLambda.CREATURE), Modifiable.Power, never, 2)); castDescription = "Target creature gets +2/+0."; } break; #endregion #region IlasGambit case CardId.IlasGambit: { name = "Ila's Gambit"; blackCost = 1; castingCosts.Add(new PayLifeCost(3)); cardType = CardType.Sorcery; fx.Add( new MoveTo(new SelectFromTargetRule( new ResolveTargetRule(ResolveTarget.CONTROLLER), new FilterTargetRule(1, FilterLambda.PLAYER), p => p.hand.cards.ToArray()), LocationPile.GRAVEYARD)); castDescription = "As an additional cost to casting this card pay 3 life.\nLook at target players hand and choose 1 card from it. The chosen card is discarded."; } break; #endregion #region YungLich case CardId.YungLich: { blackCost = 1; blueCost = 1; greyCost = 1; cardType = CardType.Creature; race = Race.Zombie; subType = SubType.Wizard; basePower = 2; baseToughness = 2; triggeredAbilities.Add(new TriggeredAbility(this, thisDies(this), thisDiesDescription + "draw a card.", LocationPile.GRAVEYARD, EventTiming.Post, new Draw(new ResolveTargetRule(ResolveTarget.CONTROLLER), 1))); } break; #endregion #region Unmake case CardId.Unmake: { blueCost = 1; cardType = CardType.Instant; fx.Add(new MoveTo(new FilterTargetRule(1, FilterLambda.ZAPPABLE, FilterLambda.CREATURE), LocationPile.HAND)); castDescription = "Return target creature to its owners hand."; } break; #endregion #region EnragedDragon case CardId.EnragedDragon: { redCost = 2; cardType = CardType.Creature; race = Race.Dragon; basePower = 3; baseToughness = 2; triggeredAbilities.Add(new TriggeredAbility(this, thisETB(this), thisETBDescription + " deal 1 damage to target player or creature.", LocationPile.FIELD, EventTiming.Post, () => true, new Ping(new FilterTargetRule(1, FilterLambda.ZAPPABLE), 1))); } break; #endregion #region SteamBolt case CardId.SteamBolt: { redCost = 1; blueCost = 1; cardType = CardType.Instant; fx.Add(new Ping(new FilterTargetRule(1, FilterLambda.ZAPPABLE), 1)); fx.Add(new Draw(new ResolveTargetRule(ResolveTarget.CONTROLLER), 1)); castDescription = "Deal 1 damage to target creature or player.\nDraw a card."; } break; #endregion #region IlasGravekeeper case CardId.IlasGravekeeper: { name = "Ila's Gravekeeper"; blackCost = 3; basePower = 0; baseToughness = 4; cardType = CardType.Creature; race = Race.Zombie; auras.Add(new DynamicAura((a) => a == this, Modifiable.Power, () => owner.field.cards.Count(card => card.race == Race.Zombie), "Ila's Gravekeeper gets +1/+0 for each zombie under your control.")); } break; #endregion #region RottingZombie //todo: phrasing and balance case CardId.RottingZombie: { //todo: phrasing and balance blackCost = 2; greyCost = 1; basePower = 2; baseToughness = 3; cardType = CardType.Creature; race = Race.Zombie; EventFilter f = (e) => { if (e.type != GameEventType.MOVECARD) return false; MoveCardEvent mevent = (MoveCardEvent)e; return mevent.from?.pile == LocationPile.FIELD && mevent.to?.pile == LocationPile.GRAVEYARD && mevent.card.owner == owner && mevent.card.isCreature && mevent.card != this; }; triggeredAbilities.Add(new TriggeredAbility(this, f, "Whenever a friendly creature dies this creature gets +1/+1.", LocationPile.FIELD, EventTiming.Post, new ModifyUntil(new ResolveTargetRule(ResolveTarget.SELF), Modifiable.Power, () => false, 1), new ModifyUntil(new ResolveTargetRule(ResolveTarget.SELF), Modifiable.Toughness, () => false, 1))); } break; #endregion #region Infiltrator case CardId.Infiltrator: { blueCost = 3; basePower = 3; baseToughness = 3; cardType = CardType.Creature; EventFilter f = (e) => { if (e.type != GameEventType.DAMAGEPLAYER) { return false; } DamagePlayerEvent devent = (DamagePlayerEvent)e; return devent.source == this; }; triggeredAbilities.Add(new TriggeredAbility(this, f, "Whenever this creature deals damage to a player that player Mills 3.", LocationPile.FIELD, EventTiming.Post, new Mill(new ResolveTargetRule(ResolveTarget.OPPONENT), 3))); } break; #endregion #region RiderOfDeath case CardId.RiderOfDeath: { name = "Rider of Death"; blackCost = 3; greyCost = 2; cardType = CardType.Creature; basePower = 5; baseToughness = 4; triggeredAbilities.Add(new TriggeredAbility(this, thisETB(this), thisETBDescription + "kill target creature.", LocationPile.FIELD, EventTiming.Post, () => true, new MoveTo(new FilterTargetRule(1, FilterLambda.ZAPPABLE, FilterLambda.CREATURE), LocationPile.GRAVEYARD))); } break; #endregion #region IlatianWineMerchant case CardId.IlatianWineMerchant: { blackCost = 1; greyCost = 2; cardType = CardType.Creature; basePower = 1; baseToughness = 2; activatedAbilities.Add(new ActivatedAbility(this, new Cost(new MoveToCost(LocationPile.HAND, LocationPile.GRAVEYARD, 1)), new Effect(new GainLife(new ResolveTargetRule(ResolveTarget.CONTROLLER), 3)), true, LocationPile.FIELD, "Discard a card: Gain 3 life.")); //triggeredAbilities.Add(new ActivatedAbility(this, new Cost(), )); /* Card c = fx.Add(new MoveTo(new FilterTargetRule(1, FilterLambda.INHAND), LocationPile.GRAVEYARD)); //todo jasin: take cost of creature and put it in gainlife fx.Add(new GainLife(new ResolveTargetRule(ResolveTarget.CONTROLLER), c.manacost)); */ } break; #endregion #region MeteorRain case CardId.MeteorRain: //todo: seba review { redCost = 2; greyCost = 1; cardType = CardType.Sorcery; castDescription = "Deal 3 damage to all creatures."; fx.Add(new Ping(new ResolveTargetRule(ResolveTarget.ALLCREATURES), 3)); } break; #endregion #region FuryOfTheRighteous case CardId.FuryOfTheRighteous: //todo: seba review { name = "Fury of the Righteous"; whiteCost = 2; greyCost = 2; cardType = CardType.Sorcery; castDescription = "Deal 2 damage to all creatures your opponent controls."; fx.Add(new Ping(new ResolveTargetRule(ResolveTarget.OPPONENTCREATURES), 2)); } break; #endregion #region Extinguish case CardId.Extinguish: //todo: seba review { blackCost = 2; cardType = CardType.Instant; castDescription = "Kill target creature."; flavourText = "Be gone!"; fx.Add(new MoveTo(new FilterTargetRule(1, FilterLambda.ZAPPABLE, FilterLambda.CREATURE), LocationPile.GRAVEYARD)); } break; #endregion #region ElderTreeant case CardId.ElderTreeant: //todo serious balance and flavor issues { greenCost = 2; greyCost = 1; basePower = 1; baseToughness = 2; cardType = CardType.Creature; activatedAbilities.Add(new ActivatedAbility(this, new Cost(new ManaCost(0,0,0,0,2,1)), new Effect(new ModifyUntil(new ResolveTargetRule(ResolveTarget.SELF), Modifiable.Power, never, 1), new ModifyUntil(new ResolveTargetRule(ResolveTarget.SELF), Modifiable.Toughness, never, 1)), true, LocationPile.FIELD, "1GG: Gain +1/+1.")); } break; #endregion #region EssenceOfDemise //todo: each time player casts spell deal one damage to face case CardId.EssenceOfDemise: { name = "Essence of Demise"; blackCost = 3; greyCost = 1; cardType = CardType.Relic; auras.Add(new Aura((crd) => crd.isCreature, Modifiable.Power, -1, "All creatures get -1/-1.")); auras.Add(new Aura((crd) => crd.isCreature, Modifiable.Toughness, -1, "")); } break; #endregion #region Counterspell case CardId.Counterspell: { blueCost = 2; greyCost = 1; cardType = CardType.Instant; castDescription = "Counter target spell."; fx.Add(new CounterSpell(new FilterTargetRule(1, FilterLambda.ONSTACK))); } break; #endregion #region EssenceOfRage case CardId.EssenceOfRage: { name = "Essence of Rage"; redCost = 3; greyCost = 1; cardType = CardType.Relic; triggeredAbilities.Add(new TriggeredAbility(this, stepFilter(Step.END), "At the beginning of each end step deal 1 damage to all players.", LocationPile.FIELD, EventTiming.Post, new Ping(new ResolveTargetRule(ResolveTarget.CONTROLLER), 1), new Ping(new ResolveTargetRule(ResolveTarget.OPPONENT), 1))); } break; #endregion #region EssenceOfClarity case CardId.EssenceOfClarity: { name = "Essence of Clarity"; blueCost = 3; greyCost = 1; cardType = CardType.Relic; triggeredAbilities.Add(new TriggeredAbility(this, stepFilter(Step.END), "At the beginning of each player's end step that player draws a card.", LocationPile.FIELD, EventTiming.Post, new Draw(new ResolveTargetRule(ResolveTarget.ACTIVE), 1))); } break; #endregion #region EssenceOfWilderness /* case CardId.EssenceOfWilderness: { name = "Essence of Wilderness"; greenCost = 3; cardType = CardType.Relic; EventFilter f = (gevent) => { if (gevent.type != GameEventType.MOVECARD) return false; MoveCardEvent mevent = (MoveCardEvent) gevent; return mevent.to.pile == LocationPile.FIELD &&mevent.card.cardType == CardType.Creature; }; triggeredAbilities.Add(new TriggeredAbility(this, )); } break; */ #endregion #region EssenceOfValor /* case CardId.EssenceOfValor: { name = "Essence of Valor"; whiteCost = 3; cardType = CardType.Relic; //creatures with more than 3 damage cannot attack } break; */ #endregion #region IlasMagicLamp /* case CardId.IlasMagicLamp: { name = "Ila's Magic Lamp"; blackCost = 1; cardType = CardType.Sorcery; //has three charges, get card from deck and shuffle deck } break; */ #endregion #region StampedingDragon case CardId.StampedingDragon: { redCost = 3; baseToughness = 1; basePower = 6; cardType = CardType.Creature; ; keyAbilities.Add(KeyAbility.Fervor); triggeredAbilities.Add(new TriggeredAbility(this, stepFilter(Step.END), "At the end of turn sacrifice this creature.", LocationPile.FIELD, EventTiming.Post, new MoveTo(new ResolveTargetRule(ResolveTarget.SELF), LocationPile.GRAVEYARD))); } break; #endregion #region MorenianMedic case CardId.MorenianMedic: { whiteCost = 2; basePower = 2; baseToughness = 2; activatedAbilities.Add(new ActivatedAbility(this, new Cost(new ExhaustCost(this), new ManaCost(1, 0, 0, 0, 0, 1)), new Effect(new GainLife(new ResolveTargetRule(ResolveTarget.CONTROLLER), 2)), true, LocationPile.FIELD, "E, 1W: Gain 2 life.")); } break; #endregion #region MattysGambit case CardId.MattysGambit: { name = "Matty's Gambit"; redCost = 1; castingCosts.Add(new PayLifeCost(3)); castDescription = "As an additional cost to casting this card pay 3 life.\nDeal 4 damage to target creature or player."; cardType = CardType.Instant; fx.Add(new Ping(new FilterTargetRule(1, FilterLambda.ZAPPABLE), 4)); } break; #endregion #region BelwasGambit case CardId.BelwasGambit: { name = "Belwas's Gambit"; whiteCost = 1; castingCosts.Add(new PayLifeCost(4)); castDescription = "As an additional cost to casting this card pay 4 life.\nTarget creature gets +3/+3."; cardType = CardType.Instant; fx.Add(new ModifyUntil(new FilterTargetRule(1, FilterLambda.CREATURE, FilterLambda.ONFIELD), Modifiable.Power, never, 3)); fx.Add(new ModifyUntil(new ResolveTargetRule(ResolveTarget.LAST), Modifiable.Toughness, never, 3)); } break; #endregion #region GrazingBison case CardId.GrazingBison: { cardType = CardType.Creature; race = Race.Bison; greenCost = 2; greyCost = 2; basePower = 4; baseToughness = 5; } break; #endregion #region RockhandOgre case CardId.RockhandOgre: { cardType = CardType.Creature; race = Race.Ogre; greenCost = 3; greyCost = 3; basePower = 6; baseToughness = 7; } break; #endregion #region Figment case CardId.Figment: { blackCost = 2; greyCost = 1; cardType = CardType.Sorcery; castDescription = "Search your deck for a card and put it to your hand. Shuffle your deck."; fx.Add(new MoveTo( new SelectFromTargetRule(new ResolveTargetRule(ResolveTarget.CONTROLLER), new ResolveTargetRule(ResolveTarget.LAST), (p) => p.deck.cards.ToArray()), LocationPile.HAND)); fx.Add(new Shuffle(new ResolveTargetRule(ResolveTarget.CONTROLLER), false)); } break; #endregion #region SebasGambit case CardId.SebasGambit: { name = "Seba's Gambit"; blueCost = 1; castingCosts.Add(new PayLifeCost(4)); castDescription = "As an additional cost to casting this card pay 4 life.\nCounter target spell."; cardType = CardType.Instant; fx.Add(new CounterSpell(new FilterTargetRule(1, FilterLambda.ONSTACK))); } break; #endregion #region AberrantSacrifice case CardId.AberrantSacrifice: { blackCost = 2; castingCosts.Add(new MoveToCost(LocationPile.FIELD, LocationPile.GRAVEYARD, 1)); cardType = CardType.Sorcery; fx.Add(new Draw(new ResolveTargetRule(ResolveTarget.CONTROLLER), 2)); castDescription = "As an additional cost to cast this card sacrifice a creature.\nDraw 2 cards."; } break; #endregion #region Spark case CardId.Spark: { redCost = 1; cardType = CardType.Instant; fx.Add(new Ping(new FilterTargetRule(1, FilterLambda.ZAPPABLE), 2)); castDescription = "Deal 2 damage to target creature or player."; } break; #endregion #region MaleficentSpirit case CardId.MaleficentSpirit: { blackCost = 2; greyCost = 2; basePower = 3; baseToughness = 2; cardType = CardType.Creature; triggeredAbilities.Add(new TriggeredAbility(this, thisETB(this), thisETBDescription + "target player discards a card.", LocationPile.FIELD, EventTiming.Post, new Effect(new MoveTo(new SelectFromTargetRule( new FilterTargetRule(1, FilterLambda.PLAYER), new ResolveTargetRule(ResolveTarget.LAST), p => p.hand.cards.ToArray()), LocationPile.GRAVEYARD)) )); } break; #endregion #region Bubastis case CardId.Bubastis: { blueCost = 4; greyCost = 3; basePower = 5; baseToughness = 5; cardType = CardType.Creature; activatedAbilities.Add(new ActivatedAbility(this, new Cost(new ManaCost(0, 2, 0, 0, 0, 1)), new Effect(new Exhaust(new FilterTargetRule(1, FilterLambda.CREATURE, FilterLambda.ONFIELD))), true, LocationPile.FIELD, "1UU: Exhaust target creature." )); } break; #endregion #region HauntedChapel case CardId.HauntedChapel: { blackCost = 2; whiteCost = 2; cardType = CardType.Relic; activatedAbilities.Add(new ActivatedAbility(this, new Cost(new ManaCost(1, 0, 1, 0, 0, 0), new MoveToCost(LocationPile.GRAVEYARD, LocationPile.EXILE, 1), new ExhaustCost(this)), new Effect(new SummonTokens(new ResolveTargetRule(ResolveTarget.CONTROLLER), CardId.Spirit)), true, LocationPile.FIELD, "E, BW, Exile a card from your graveyard: Put a 1/1 white Spirit token with flying onto the battlefield." )); } break; #endregion #region Spirit case CardId.Spirit: { isToken = true; keyAbilities.Add(KeyAbility.Flying); forceColour = Colour.WHITE; basePower = 1; baseToughness = 1; } break; #endregion #region OneWithNature case CardId.OneWithNature: { greenCost = 1; cardType = CardType.Sorcery; fx.Add(new GainBonusMana(new ResolveTargetRule(ResolveTarget.CONTROLLER), Colour.GREEN, Colour.GREEN, Colour.GREEN)); castDescription = "Add GGG until end of step."; } break; #endregion #region MysteriousLilac case CardId.MysteriousLilac: { blueCost = 1; cardType = CardType.Relic; triggeredAbilities.Add(new TriggeredAbility(this, thisETB(this), thisETBDescription + "draw 1 card.", LocationPile.FIELD, EventTiming.Post, new Effect(new Draw(new ResolveTargetRule(ResolveTarget.CONTROLLER), 1)) )); activatedAbilities.Add(new ActivatedAbility(this, new Cost(new ManaCost(0, 0, 0, 0, 0, 2)), new Effect(new GainBonusMana(new ResolveTargetRule(ResolveTarget.CONTROLLER), Colour.BLUE)), true, LocationPile.FIELD, "2: Gain U until end of step." )); } break; #endregion #region Overgrow case CardId.Overgrow: { greenCost = 2; cardType = CardType.Instant; fx.Add(new MoveTo(new FilterTargetRule(1, FilterLambda.RELIC, FilterLambda.ONFIELD), LocationPile.GRAVEYARD)); castDescription = "Destroy target relic."; } break; #endregion #region Abolish case CardId.Abolish: { whiteCost = 2; cardType = CardType.Instant; fx.Add(new MoveTo(new FilterTargetRule(1, FilterLambda.RELIC, FilterLambda.ONFIELD), LocationPile.GRAVEYARD)); castDescription = "Destroy target relic."; } break; #endregion #region ElvenDruid case CardId.ElvenDruid: { greenCost = 1; cardType = CardType.Creature; basePower = 1; baseToughness = 1; activatedAbilities.Add(new ActivatedAbility(this, new Cost(new ExhaustCost(this)), new Effect(new GainBonusMana(new ResolveTargetRule(ResolveTarget.CONTROLLER), Colour.GREEN)), true, LocationPile.FIELD, "E: Gain G until end of step." )); } break; #endregion #region ChromaticUnicorn case CardId.ChromaticUnicorn: { greenCost = 1; cardType = CardType.Creature; basePower = 1; baseToughness = 1; auras.Add(new DynamicAura(crd => this == crd, Modifiable.Power, () => owner.getMaxMana((int)Colour.RED) > 0 ? 2 : 0, "This creature gets +2/+0 as long as you have a red mana orb." )); auras.Add(new DynamicAura(crd => this == crd, Modifiable.Toughness, () => owner.getMaxMana((int)Colour.WHITE) > 0 ? 2 : 0, "This creature gets +0/+2 as long as you have a white mana orb." )); } break; #endregion #region Flamemane case CardId.Flamemane: { redCost = 3; greyCost = 1; cardType = CardType.Creature; basePower = 4; baseToughness = 4; keyAbilities.Add(KeyAbility.Flying); activatedAbilities.Add(new ActivatedAbility(this, new Cost(new ManaCost(0, 0, 0, 2, 0, 0)), new Effect(new Ping(new FilterTargetRule(1, FilterLambda.ZAPPABLE), 1)), true, LocationPile.FIELD, "RR: Deal 1 damage to target creature or player." )); } break; #endregion #region CoupDeGrace case CardId.CoupDeGrace: { whiteCost = 1; cardType = CardType.Instant; fx.Add( new MoveTo( new FilterTargetRule(1, FilterLambda.CREATURE, FilterLambda.ONFIELD, FilterLambda.EXHAUSTED), LocationPile.GRAVEYARD)); castDescription = "Destroy target exhausted creature."; } break; #endregion #region LoneRanger case CardId.LoneRanger: { //better if it isnt when summoned, instead it should be dynamic when no other creatures are on board? //filter doesn't account for relics on board greenCost = 2; cardType = CardType.Creature; basePower = 2; baseToughness = 2; auras.Add(new DynamicAura(crd => crd == this, Modifiable.Power, () => owner.field.cards.Count() == 1 ? 1 : 0, "This creature gains +1/+2 as long as you control no other permanents.")); auras.Add(new DynamicAura(crd => crd == this, Modifiable.Toughness, () => owner.field.cards.Count() == 1 ? 2 : 0, "")); } break; #endregion #region DecayingZombie case CardId.DecayingZombie: { cardType = CardType.Creature; blackCost = 2; basePower = 4; baseToughness = 5; triggeredAbilities.Add(new TriggeredAbility(this, stepFilter(Step.END, true), "At the beginning of your endstep this creature gains -1/-1.", LocationPile.FIELD, EventTiming.Post, new ModifyUntil(new ResolveTargetRule(ResolveTarget.SELF), Modifiable.Power, never, -1), new ModifyUntil(new ResolveTargetRule(ResolveTarget.SELF), Modifiable.Toughness, never, -1))); race = Race.Zombie; } break; #endregion #region AsylumWarden case CardId.AsylumWarden: { cardType = CardType.Creature; blackCost = 1; whiteCost = 1; basePower = 2; baseToughness = 2; triggeredAbilities.Add(new TriggeredAbility(this, thisDies(this), thisDiesDescription + "put a 1/1 white Spirit token with flying onto the battlefield.", LocationPile.GRAVEYARD, EventTiming.Post, new SummonTokens(new ResolveTargetRule(ResolveTarget.CONTROLLER), CardId.Spirit))); } break; #endregion #region default default: { throw new Exception("pls no" + c.ToString()); } #endregion } if (basePower != null) { power = new Modifiable<int>(add, sub); power.setBaseValue(basePower.Value); toughness = new Modifiable<int>(add, sub); toughness.setBaseValue(baseToughness.Value); } Effect x = new Effect(fx.ToArray()); castingCost = new ManaCost(whiteCost, blueCost, blackCost, redCost, greenCost, greyCost); castingCosts.Add(castingCost); Cost cc = new Cost(castingCosts.ToArray()); castAbility = new ActivatedAbility(this, cc, new Effect(fx.ToArray()), cardType == CardType.Instant, LocationPile.HAND, castDescription); baseActivatedAbilities.Add(castAbility); if ((basePower == null) != (baseToughness == null)) { throw new Exception("bad thing b0ss"); } var vs = castingCost.costsEnumerable; List<int> n = new List<int>(); int ctr = 0; foreach (var v in vs) { if (v != 0) { n.Add(ctr); } if (++ctr == 5) { break; } } if (n.Count() == 0) { if (!forceColour.HasValue) { colour = Colour.GREY; } else { colour = forceColour.Value; } } else if (n.Count() == 1) { colour = (Colour)n.First(); } else { colour = Colour.MULTI; } }
public ActivateAbilityAction(ActivatedAbility ability) : base(ActionType.ActivateAbility) { Ability = ability; }
public ActivatedAbilityPutOnStackEvent(ActivatedAbility ability, Targets targets) : base(ability, targets) { }
public AddActivatedAbility(ActivatedAbility activatedAbility) { _activatedAbility = activatedAbility; }