- Converted the upkeep trigger of Obsidian Fireheart to script

This commit is contained in:
swordshine
2013-08-08 04:41:43 +00:00
parent 018699cc39
commit 70acd483d1
3 changed files with 5 additions and 44 deletions

View File

@@ -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.)

View File

@@ -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()
/**
* <p>
* upkeepBlazeCounters.
* </p>
*/
private static void upkeepBlazeCounters(final Game game) {
final Player player = game.getPhaseHandler().getPlayerTurn();
List<Card> blaze = player.getCardsIn(ZoneType.Battlefield);
blaze = CardLists.filter(blaze, new Predicate<Card>() {
@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

View File

@@ -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;