- Converted the second ability of Fastbond to script.

This commit is contained in:
Sloth
2013-06-26 21:19:20 +00:00
parent 9d78336096
commit bb22cc6ba9
4 changed files with 15 additions and 48 deletions

View File

@@ -1,6 +1,8 @@
Name:Fastbond Name:Fastbond
ManaCost:G ManaCost:G
Types:Enchantment Types:Enchantment
Text:You may play as many lands as you choose on your turn. Whenever you play a land other than the first land of the turn, Fastbond deals 1 damage to you. Text:You may play any number of additional lands on each of your turns.
T:Mode$ LandPlayed | ValidCard$ Land.YouCtrl | NotFirstLand$ True | Execute$ DBPain | TriggerZones$ Battlefield | TriggerDescription$ Whenever you play a land, if it wasn't the first land you played this turn, CARDNAME deals 1 damage to you.
SVar:DBPain:DB$ DealDamage | NumDmg$ 1 | Defined$ You
SVar:Picture:http://www.wizards.com/global/images/magic/general/fastbond.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/fastbond.jpg
Oracle:You may play any number of additional lands on each of your turns.\nWhenever you play a land, if it wasn't the first land you played this turn, Fastbond deals 1 damage to you. Oracle:You may play any number of additional lands on each of your turns.\nWhenever you play a land, if it wasn't the first land you played this turn, Fastbond deals 1 damage to you.

View File

@@ -2141,37 +2141,6 @@ public class CardFactoryUtil {
return neededDamage; return neededDamage;
} }
/**
* <p>
* playLandEffects.
* </p>
*
* @param c
* a {@link forge.Card} object.
*/
public static void playLandEffects(final Card c) {
final Player player = c.getController();
// > 0 because land amount isn't incremented until after playLandEffects
final boolean extraLand = player.getNumLandsPlayed() > 0;
if (extraLand) {
final List<Card> fastbonds = player.getCardsIn(ZoneType.Battlefield, "Fastbond");
for (final Card f : fastbonds) {
final SpellAbility ability = new Ability(f, ManaCost.ZERO) {
@Override
public void resolve() {
f.getController().addDamage(1, f);
}
};
ability.setStackDescription("Fastbond - Deals 1 damage to you.");
c.getGame().getStack().addSimultaneousStackEntry(ability);
}
}
}
public static void correctAbilityChainSourceCard(final SpellAbility sa, final Card card) { public static void correctAbilityChainSourceCard(final SpellAbility sa, final Card card) {
sa.setSourceCard(card); sa.setSourceCard(card);
@@ -2209,13 +2178,6 @@ public class CardFactoryUtil {
// Cards with Cycling abilities // Cards with Cycling abilities
// -1 means keyword "Cycling" not found // -1 means keyword "Cycling" not found
// TODO - certain cards have two different kicker types, kicker will
// need
// to be written differently to handle this
// TODO - kicker costs can only be mana right now i think?
// TODO - this kicker only works for pemanents. maybe we can create an
// optional cost class for buyback, kicker, that type of thing
if (hasKeyword(card, "Multikicker") != -1) { if (hasKeyword(card, "Multikicker") != -1) {
final int n = hasKeyword(card, "Multikicker"); final int n = hasKeyword(card, "Multikicker");
if (n != -1) { if (n != -1) {
@@ -2356,7 +2318,6 @@ public class CardFactoryUtil {
} }
}; };
card.addComesIntoPlayCommand(intoPlay); card.addComesIntoPlayCommand(intoPlay);
} // echo } // echo
if (hasKeyword(card, "Suspend") != -1) { if (hasKeyword(card, "Suspend") != -1) {

View File

@@ -57,9 +57,15 @@ public class TriggerLandPlayed extends Trigger {
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public final boolean performTest(final java.util.Map<String, Object> runParams2) { public final boolean performTest(final java.util.Map<String, Object> runParams2) {
Card land = (Card) runParams2.get("Card");
if (this.mapParams.containsKey("ValidCard")) { if (this.mapParams.containsKey("ValidCard")) {
if (!matchesValid(runParams2.get("Card"), this.mapParams.get("ValidCard").split(","), if (!matchesValid(land, this.mapParams.get("ValidCard").split(","), this.getHostCard())) {
this.getHostCard())) { return false;
}
}
if (this.mapParams.containsKey("NotFirstLand")) {
if (land.getController().getNumLandsPlayed() < 1) {
return false; return false;
} }
} }

View File

@@ -43,7 +43,6 @@ import forge.Singletons;
import forge.card.MagicColor; import forge.card.MagicColor;
import forge.card.ability.AbilityFactory; import forge.card.ability.AbilityFactory;
import forge.card.ability.AbilityUtils; import forge.card.ability.AbilityUtils;
import forge.card.cardfactory.CardFactoryUtil;
import forge.card.mana.ManaCost; import forge.card.mana.ManaCost;
import forge.card.mana.ManaPool; import forge.card.mana.ManaPool;
import forge.card.replacement.ReplacementResult; import forge.card.replacement.ReplacementResult;
@@ -1747,11 +1746,6 @@ public class Player extends GameEntity implements Comparable<Player> {
if (this.canPlayLand(land, ignoreTiming)) { if (this.canPlayLand(land, ignoreTiming)) {
land.setController(this, 0); land.setController(this, 0);
game.getAction().moveTo(this.getZone(ZoneType.Battlefield), land); game.getAction().moveTo(this.getZone(ZoneType.Battlefield), land);
CardFactoryUtil.playLandEffects(land);
this.numLandsPlayed++;
if (land.isBasicLand() && land.isType("Forest")) {
this.numBasicForestsPlayed++;
}
// check state effects for static animate (Living Lands, Conversion, // check state effects for static animate (Living Lands, Conversion,
// etc...) // etc...)
@@ -1765,6 +1759,10 @@ public class Player extends GameEntity implements Comparable<Player> {
runParams.put("Card", land); runParams.put("Card", land);
game.getTriggerHandler().runTrigger(TriggerType.LandPlayed, runParams, false); game.getTriggerHandler().runTrigger(TriggerType.LandPlayed, runParams, false);
game.getStack().unfreezeStack(); game.getStack().unfreezeStack();
this.numLandsPlayed++;
if (land.isBasicLand() && land.isType("Forest")) {
this.numBasicForestsPlayed++;
}
return true; return true;
} }