- Converted the triggered ability of Homarid to script.

This commit is contained in:
Sloth
2012-03-05 12:02:41 +00:00
parent a5f81e77a3
commit c58cfe2c6e
5 changed files with 6 additions and 94 deletions

View File

@@ -1,13 +1,16 @@
Name:Homarid Name:Homarid
ManaCost:2 U ManaCost:2 U
Types:Creature Homarid Types:Creature Homarid
Text:Whenever there are four tide counters on CARDNAME, remove all tide counters from it. Text:no text
PT:2/2 PT:2/2
K:etbCounter:TIDE:1 K:etbCounter:TIDE:1
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigPutCounter | TriggerDescription$ At the beginning of your upkeep, put a tide counter on CARDNAME. T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigPutCounter | TriggerDescription$ At the beginning of your upkeep, put a tide counter on CARDNAME.
S:Mode$ Continuous | Affected$ Card.Self+counters_EQ1_TIDE | AddPower$ -1 | AddToughness$ -1 | Description$ As long as there is exactly one tide counter on CARDNAME, it gets -1/-1. S:Mode$ Continuous | Affected$ Card.Self+counters_EQ1_TIDE | AddPower$ -1 | AddToughness$ -1 | Description$ As long as there is exactly one tide counter on CARDNAME, it gets -1/-1.
S:Mode$ Continuous | Affected$ Card.Self+counters_EQ3_TIDE | AddPower$ 1 | AddToughness$ 1 | Description$ As long as there are exactly three tide counters on CARDNAME, it gets +1/+1. S:Mode$ Continuous | Affected$ Card.Self+counters_EQ3_TIDE | AddPower$ 1 | AddToughness$ 1 | Description$ As long as there are exactly three tide counters on CARDNAME, it gets +1/+1.
SVar:TrigPutCounter:AB$PutCounter | Cost$ 0 | Defined$ Self | CounterType$ TIDE | CounterNum$ 1 SVar:TrigPutCounter:AB$PutCounter | Cost$ 0 | Defined$ Self | CounterType$ TIDE | CounterNum$ 1
T:Mode$ Always | TriggerZones$ Battlefield | IsPresent$ Card.Self+counters_GE4_TIDE | Execute$ TrigRemove | TriggerDescription$ Whenever there are four tide counters on CARDNAME, remove all tide counters from it.
SVar:TrigRemove:DB$ RemoveCounter | CounterType$ TIDE | CounterNum$ All
SVar:All:Count$CardCounters.TIDE
SVar:Rarity:Common SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/homarid.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/homarid.jpg
SetInfo:FEM|Common|http://magiccards.info/scans/en/fe/38.jpg|4 SetInfo:FEM|Common|http://magiccards.info/scans/en/fe/38.jpg|4

View File

@@ -1549,23 +1549,6 @@ public final class GameActionUtil {
} }
}; // Old Man of the Sea }; // Old Man of the Sea
/** Constant <code>homarid</code>. */
private static Command homarid = new Command() {
private static final long serialVersionUID = 7156319758035295773L;
@Override
public void execute() {
final CardList list = AllZoneUtil.getCardsIn(Zone.Battlefield, "Homarid");
for (final Card homarid : list) {
final int tide = homarid.getCounters(Counters.TIDE);
if (tide == 4) {
homarid.setCounter(Counters.TIDE, 0, true);
}
}
} // execute()
};
/** Constant <code>liuBei</code>. */ /** Constant <code>liuBei</code>. */
private static Command liuBei = new Command() { private static Command liuBei = new Command() {
@@ -1723,7 +1706,6 @@ public final class GameActionUtil {
GameActionUtil.getCommands().put("Ajani_Avatar_Token", GameActionUtil.ajaniAvatarToken); GameActionUtil.getCommands().put("Ajani_Avatar_Token", GameActionUtil.ajaniAvatarToken);
GameActionUtil.getCommands().put("Alpha_Status", GameActionUtil.alphaStatus); GameActionUtil.getCommands().put("Alpha_Status", GameActionUtil.alphaStatus);
GameActionUtil.getCommands().put("Coat_of_Arms", GameActionUtil.coatOfArms); GameActionUtil.getCommands().put("Coat_of_Arms", GameActionUtil.coatOfArms);
GameActionUtil.getCommands().put("Homarid", GameActionUtil.homarid);
GameActionUtil.getCommands().put("Liu_Bei", GameActionUtil.liuBei); GameActionUtil.getCommands().put("Liu_Bei", GameActionUtil.liuBei);
GameActionUtil.getCommands().put("Old_Man_of_the_Sea", GameActionUtil.oldManOfTheSea); GameActionUtil.getCommands().put("Old_Man_of_the_Sea", GameActionUtil.oldManOfTheSea);

View File

@@ -236,7 +236,6 @@ public class StaticEffects {
StaticEffects.cardToEffectsList.put("Avatar", new String[] { "Ajani_Avatar_Token" }); StaticEffects.cardToEffectsList.put("Avatar", new String[] { "Ajani_Avatar_Token" });
StaticEffects.cardToEffectsList.put("Alpha Status", new String[] { "Alpha_Status" }); StaticEffects.cardToEffectsList.put("Alpha Status", new String[] { "Alpha_Status" });
StaticEffects.cardToEffectsList.put("Coat of Arms", new String[] { "Coat_of_Arms" }); StaticEffects.cardToEffectsList.put("Coat of Arms", new String[] { "Coat_of_Arms" });
StaticEffects.cardToEffectsList.put("Homarid", new String[] { "Homarid" });
StaticEffects.cardToEffectsList.put("Liu Bei, Lord of Shu", new String[] { "Liu_Bei" }); StaticEffects.cardToEffectsList.put("Liu Bei, Lord of Shu", new String[] { "Liu_Bei" });
StaticEffects.cardToEffectsList.put("Old Man of the Sea", new String[] { "Old_Man_of_the_Sea" }); StaticEffects.cardToEffectsList.put("Old Man of the Sea", new String[] { "Old_Man_of_the_Sea" });

View File

@@ -4077,78 +4077,6 @@ public class CardFactoryUtil {
return ""; return "";
} }
/*
* //whenever CARDNAME becomes the target of a spell or ability, ... :
* public static void checkTargetingEffects(SpellAbility sa, final Card c) {
*
* //if (AllZoneUtil.isCardInPlay(c)) //{ if (c.hasKeyword(
* "When CARDNAME becomes the target of a spell or ability, return CARDNAME to its owner's hand."
* ) ) { // || (c.isCreature() && AllZoneUtil.isCardInPlay("Cowardice"))
* SpellAbility ability = new Ability(c, "0") { public void resolve() {
* Singletons.getModel().getGameAction().moveToHand(c); } }; StringBuilder
* sb = new StringBuilder();
* sb.append(c).append(" - return CARDNAME to its owner's hand.");
* ability.setStackDescription(sb.toString());
*
* AllZone.getStack().add(ability); } if (c.hasKeyword(
* "When CARDNAME becomes the target of a spell or ability, destroy CARDNAME."
* ) || AllZoneUtil.isCardInPlay("Horobi, Death's Wail")) {
*
* SpellAbility ability = new Ability(c, "0") { public void resolve() {
* Singletons.getModel().getGameAction().destroy(c); } }; StringBuilder sb =
* new StringBuilder(); sb.append(c).append(" - destroy CARDNAME.");
* ability.setStackDescription(sb.toString());
*
* AllZone.getStack().add(ability); } if (c.hasKeyword(
* "When CARDNAME becomes the target of a spell or ability, sacrifice it."))
* { SpellAbility ability = new Ability(c, "0") { public void resolve() {
* Singletons.getModel().getGameAction().sacrifice(c); } }; StringBuilder sb
* = new StringBuilder(); sb.append(c).append(" - sacrifice CARDNAME.");
* ability.setStackDescription(sb.toString());
*
* AllZone.getStack().add(ability); }
*
* //When enchanted creature becomes the target of a spell or ability,
* <destroy/exile/sacrifice> <that creature/CARDNAME>. (It can't be
* regenerated.) ArrayList<Card> auras = c.getEnchantedBy(); for(int
* a=0;a<auras.size();a++) { final Card aura = auras.get(a);
* ArrayList<String> keywords = aura.getKeyword(); for(int
* i=0;i<keywords.size();i++) { final String keyword = keywords.get(i);
* if(keyword.startsWith(
* "When enchanted creature becomes the target of a spell or ability, ")) {
* final String action[] = new String[1]; action[0] = keyword.substring(66);
* String stackDesc = action[0]; stackDesc = stackDesc.replace("that",
* "enchanted"); stackDesc =
* stackDesc.substring(0,1).toUpperCase().concat(stackDesc.substring(1));
* stackDesc =
* aura.getName().concat(" (").concat(Integer.toString(aura.getUniqueNumber
* ())).concat(") - ").concat(stackDesc);
*
* Ability saTrigger = new Ability(aura,"0") { public void resolve() { Card
* target = null; boolean noRegen = false;
* if(action[0].endsWith(" It can't be regenerated.")) { noRegen = true;
* action[0] = action[0].substring(0,action[0].length()-25); }
*
* if(action[0].endsWith("CARDNAME.")) { target = aura; } else
* if(action[0].endsWith("that creature.")) { target = c; } else { throw new
* IllegalArgumentException("There is a problem in the keyword " + keyword +
* "for card \"" + c.getName() + "\""); }
*
* if(action[0].startsWith("exile")) {
* Singletons.getModel().getGameAction().exile(target); } else
* if(action[0].startsWith("destroy")) { if(noRegen) {
* Singletons.getModel().getGameAction().destroyNoRegeneration(target); }
* else { Singletons.getModel().getGameAction().destroy(target); } } else
* if(action[0].startsWith("sacrifice")) {
* Singletons.getModel().getGameAction().sacrifice(target); } else { throw
* new IllegalArgumentException("There is a problem in the keyword " +
* keyword + "for card \"" + c.getName() + "\""); } } };
*
* saTrigger.setStackDescription(stackDesc);
*
* AllZone.getStack().add(saTrigger); } } } //} }
*/
/** /**
* <p> * <p>
* Copies stats like power, toughness, etc. * Copies stats like power, toughness, etc.
@@ -5188,7 +5116,7 @@ public class CardFactoryUtil {
final int m = Integer.parseInt(parse.substring(8)); final int m = Integer.parseInt(parse.substring(8));
card.addIntrinsicKeyword("etbCounter:P1P1:" + m); card.addIntrinsicKeyword("etbCounter:P1P1:" + m + ":no Condition: ");
final SpellAbility ability = new Ability(card, "0") { final SpellAbility ability = new Ability(card, "0") {
@Override @Override

View File

@@ -386,7 +386,7 @@ public class SpellPermanent extends Spell {
} }
if (card.isCreature() && (card.getNetDefense() <= 0) && !card.hasStartOfKeyword("etbCounter") if (card.isCreature() && (card.getNetDefense() <= 0) && !card.hasStartOfKeyword("etbCounter")
&& !card.getText().contains("Modular") && !mana.contains("X")) { && !mana.contains("X")) {
return false; return false;
} }