From 70acd483d11ac44485e5c20cc442a9566dee249c Mon Sep 17 00:00:00 2001 From: swordshine Date: Thu, 8 Aug 2013 04:41:43 +0000 Subject: [PATCH] - Converted the upkeep trigger of Obsidian Fireheart to script --- res/cardsfolder/o/obsidian_fireheart.txt | 6 ++- src/main/java/forge/game/phase/Upkeep.java | 38 ------------------- .../game/zone/PlayerZoneBattlefield.java | 5 --- 3 files changed, 5 insertions(+), 44 deletions(-) diff --git a/res/cardsfolder/o/obsidian_fireheart.txt b/res/cardsfolder/o/obsidian_fireheart.txt index 96f7ae954d8..7b34f58f694 100644 --- a/res/cardsfolder/o/obsidian_fireheart.txt +++ b/res/cardsfolder/o/obsidian_fireheart.txt @@ -2,6 +2,10 @@ Name:Obsidian Fireheart ManaCost:1 R R R Types:Creature Elemental PT:4/4 -A:AB$ PutCounter | Cost$ 1 R R | IsCurse$ True | ValidTgts$ Land.counters_EQ0_BLAZE | TgtPrompt$ Select target Land without a Blaze Counter | CounterType$ BLAZE | CounterNum$ 1 | SpellDescription$ Put a blaze counter on target land without a blaze counter on it. For as long as that land has a blaze counter on it, it has "At the beginning of your upkeep, this land deals 1 damage to you." (The land continues to burn after Obsidian Fireheart has left the battlefield.) +A:AB$ PutCounter | Cost$ 1 R R | IsCurse$ True | ValidTgts$ Land.counters_EQ0_BLAZE | TgtPrompt$ Select target Land without a Blaze Counter | CounterType$ BLAZE | CounterNum$ 1 | SubAbility$ DBAnimate | SpellDescription$ Put a blaze counter on target land without a blaze counter on it. For as long as that land has a blaze counter on it, it has "At the beginning of your upkeep, this land deals 1 damage to you." (The land continues to burn after Obsidian Fireheart has left the battlefield.) +SVar:DBAnimate:DB$ Animate | Defined$ Targeted | staticAbilities$ ObsidianBlaze | sVars$ ObsidianBlazeTrig,ObsidianBlazeDmg | StackDescription$ None | Permanent$ True +SVar:ObsidianBlaze:Mode$ Continuous | EffectZone$ Battlefield | Affected$ Card.Self+counters_GE1_BLAZE | AddTrigger$ ObsidianBlazeTrig +SVar:ObsidianBlazeTrig:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ ObsidianBlazeDmg | TriggerDescription$ At the beginning of your upkeep, CARDNAME deals 1 damage to you. +SVar:ObsidianBlazeDmg:DB$ DealDamage | Defined$ You | NumDmg$ 1 SVar:Picture:http://www.wizards.com/global/images/magic/general/obsidian_fireheart.jpg Oracle:{1}{R}{R}: Put a blaze counter on target land without a blaze counter on it. For as long as that land has a blaze counter on it, it has "At the beginning of your upkeep, this land deals 1 damage to you." (The land continues to burn after Obsidian Fireheart has left the battlefield.) \ No newline at end of file diff --git a/src/main/java/forge/game/phase/Upkeep.java b/src/main/java/forge/game/phase/Upkeep.java index da720441643..e607414347a 100644 --- a/src/main/java/forge/game/phase/Upkeep.java +++ b/src/main/java/forge/game/phase/Upkeep.java @@ -94,7 +94,6 @@ public class Upkeep extends Phase { Upkeep.upkeepOathOfDruids(game); Upkeep.upkeepOathOfGhouls(game); - Upkeep.upkeepBlazeCounters(game); Upkeep.upkeepPowerSurge(game); game.getStack().unfreezeStack(); @@ -612,41 +611,4 @@ public class Upkeep extends Phase { } // foreach(wire) } // upkeepTangleWire() - - /** - *

- * upkeepBlazeCounters. - *

- */ - private static void upkeepBlazeCounters(final Game game) { - final Player player = game.getPhaseHandler().getPlayerTurn(); - - List blaze = player.getCardsIn(ZoneType.Battlefield); - blaze = CardLists.filter(blaze, new Predicate() { - @Override - public boolean apply(final Card c) { - return c.isLand() && (c.getCounters(CounterType.BLAZE) > 0); - } - }); - - for (int i = 0; i < blaze.size(); i++) { - final Card source = blaze.get(i); - final Ability ability = new Ability(blaze.get(i),ManaCost.ZERO) { - @Override - public void resolve() { - player.addDamage(1, source); - } - }; // ability - - final StringBuilder sb = new StringBuilder(); - sb.append(blaze.get(i)).append(" - has a blaze counter and deals 1 damage to "); - sb.append(player).append("."); - ability.setStackDescription(sb.toString()); - ability.setDescription(sb.toString()); - ability.setActivatingPlayer(source.getController()); - - game.getStack().addSimultaneousStackEntry(ability); - - } - } } // end class Upkeep diff --git a/src/main/java/forge/game/zone/PlayerZoneBattlefield.java b/src/main/java/forge/game/zone/PlayerZoneBattlefield.java index 1dd5553dbd6..bed5d4fab1b 100644 --- a/src/main/java/forge/game/zone/PlayerZoneBattlefield.java +++ b/src/main/java/forge/game/zone/PlayerZoneBattlefield.java @@ -25,12 +25,7 @@ import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import forge.Card; -import forge.CardLists; -import forge.CardPredicates; -import forge.CardPredicates.Presets; import forge.card.ability.AbilityFactory; -import forge.card.mana.ManaCost; -import forge.card.spellability.Ability; import forge.card.spellability.SpellAbility; import forge.card.staticability.StaticAbility; import forge.card.trigger.ZCTrigger;