- Converted Sword of Light and Shadow to script (everything was done already).

This commit is contained in:
Sloth
2011-10-20 20:23:20 +00:00
parent d6f298b37b
commit a2698759b0
2 changed files with 4 additions and 80 deletions

View File

@@ -1,12 +1,11 @@
Name:Sword of Light and Shadow Name:Sword of Light and Shadow
ManaCost:3 ManaCost:3
Types:Artifact Equipment Types:Artifact Equipment
Text:Equipped creature gets +2/+2 and has protection from white and from black.\r\n\r\nWhenever equipped creature deals combat damage to a player, you gain 3 life and you may return up to one target creature card from your graveyard to your hand. Text:Equipped creature gets +2/+2 and has protection from white and from black.
K:eqPump 2:+2/+2/Protection from white & Protection from black K:eqPump 2:+2/+2/Protection from white & Protection from black
#Note: This trigger does not work due to some bug in Input where it is getting cleared. When that's fixed, this trigger should work. T:Mode$ DamageDone | ValidSource$ Creature.AttachedBy | ValidTarget$ Player | CombatDamage$ True | Execute$ TrigGainLife | TriggerZones$ Battlefield | TriggerDescription$ Whenever equipped creature deals combat damage to a player, you gain 3 life and you may return up to one target creature card from your graveyard to your hand.
#T:Mode$ DamageDone | ValidSource$ Creature.AttachedBy | ValidTarget$ Player | CombatDamage$ True | Execute$ TrigGainLife | TriggerZones$ Battlefield | TriggerDescription$ Whenever equipped creature deals combat damage to a player, you gain 3 life and you may return up to one target creature card from your graveyard to your hand. SVar:TrigGainLife:AB$GainLife | Cost$ 0 | Defined$ You | LifeAmount$ 3 | SubAbility$ SVar=DBReturn
#SVar:TrigGainLife:AB$GainLife | Cost$ 0 | Defined$ You | LifeAmount$ 3 | SubAbility$ SVar=DBReturn SVar:DBReturn:DB$ChangeZone | Origin$ Graveyard | Destination$ Hand | ValidTgts$ Creature.YouCtrl | TargetMin$ 0 | TargetMax$ 1 | TgtPrompt$ Select target creature in your graveyard
#SVar:DBReturn:DB$ChangeZone | Origin$ Graveyard | Destination$ Hand | ValidTgts$ Creature.YouCtrl | TargetMin$ 0 | TargetMax$ 1 | TgtPrompt$ Select target creature in your graveyard
SVar:Rarity:Rare SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/sword_of_light_and_shadow.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/sword_of_light_and_shadow.jpg
SetInfo:DST|Rare|http://magiccards.info/scans/en/ds/149.jpg SetInfo:DST|Rare|http://magiccards.info/scans/en/ds/149.jpg

View File

@@ -12,7 +12,6 @@ import forge.card.spellability.Ability;
import forge.card.spellability.Target; import forge.card.spellability.Target;
import forge.game.GameLossReason; import forge.game.GameLossReason;
import forge.gui.GuiUtils; import forge.gui.GuiUtils;
import forge.gui.input.Input;
import forge.gui.input.Input_PayManaCostUtil; import forge.gui.input.Input_PayManaCostUtil;
import forge.gui.input.Input_PayManaCost_Ability; import forge.gui.input.Input_PayManaCost_Ability;
@@ -657,68 +656,6 @@ public final class GameActionUtil {
if (source.hasKeyword("Deathtouch") && affected.isCreature()) { if (source.hasKeyword("Deathtouch") && affected.isCreature()) {
AllZone.getGameAction().destroy(affected); AllZone.getGameAction().destroy(affected);
} }
}
/**
* <p>executeSwordOfLightAndShadowEffects.</p>
*
* @param source a {@link forge.Card} object.
*/
public static void executeSwordOfLightAndShadowEffects(final Card source) {
final Card src = source;
final Ability ability = new Ability(src, "0") {
@Override
public void resolve() {
Card target = getTargetCard();
if (target != null) {
if (src.getController().getZone(Zone.Graveyard).contains(target)) {
PlayerZone hand = src.getController().getZone(Constant.Zone.Hand);
AllZone.getGameAction().moveTo(hand, target);
}
}
src.getController().gainLife(3, source);
}
}; // ability
Command res = new Command() {
private static final long serialVersionUID = -7433708170033536384L;
public void execute() {
CardList list = src.getController().getCardsIn(Zone.Graveyard);
list = list.filter(CardListFilter.creatures);
if (list.isEmpty()) {
AllZone.getStack().addSimultaneousStackEntry(ability);
return;
}
if (src.getController().isHuman()) {
Object o = GuiUtils.getChoiceOptional("Select target card", list.toArray());
if (o != null) {
ability.setTargetCard((Card) o);
AllZone.getStack().addSimultaneousStackEntry(ability);
}
} //if
else { //computer
Card best = CardFactoryUtil.AI_getBestCreature(list);
ability.setTargetCard(best);
AllZone.getStack().addSimultaneousStackEntry(ability);
}
} //execute()
}; //Command
StringBuilder sb = new StringBuilder();
sb.append("Sword of Light and Shadow - You gain 3 life and you may return ");
sb.append("up to one target creature card from your graveyard to your hand");
ability.setStackDescription(sb.toString());
res.execute();
} }
//this is for cards like Sengir Vampire //this is for cards like Sengir Vampire
@@ -898,15 +835,6 @@ public final class GameActionUtil {
} }
} }
if (c.isEquipped()) {
for (Card equip : c.getEquippedBy()) {
if (equip.getName().equals("Sword of Light and Shadow")) {
GameActionUtil.executeSwordOfLightAndShadowEffects(equip);
}
}
} //isEquipped
if (c.getName().equals("Scalpelexis")) { if (c.getName().equals("Scalpelexis")) {
playerCombatDamage_Scalpelexis(c); playerCombatDamage_Scalpelexis(c);
} else if (c.getName().equals("Spawnwrithe")) { } else if (c.getName().equals("Spawnwrithe")) {
@@ -917,9 +845,6 @@ public final class GameActionUtil {
execute_Celestial_Mantle(c); execute_Celestial_Mantle(c);
} }
//Unused variable
//c.setDealtCombatDmgToOppThisTurn(true);
} //executeCombatDamageToPlayerEffects } //executeCombatDamageToPlayerEffects
/** /**