- 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

@@ -2141,37 +2141,6 @@ public class CardFactoryUtil {
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) {
sa.setSourceCard(card);
@@ -2209,13 +2178,6 @@ public class CardFactoryUtil {
// Cards with Cycling abilities
// -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) {
final int n = hasKeyword(card, "Multikicker");
if (n != -1) {
@@ -2356,7 +2318,6 @@ public class CardFactoryUtil {
}
};
card.addComesIntoPlayCommand(intoPlay);
} // echo
if (hasKeyword(card, "Suspend") != -1) {

View File

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

View File

@@ -43,7 +43,6 @@ import forge.Singletons;
import forge.card.MagicColor;
import forge.card.ability.AbilityFactory;
import forge.card.ability.AbilityUtils;
import forge.card.cardfactory.CardFactoryUtil;
import forge.card.mana.ManaCost;
import forge.card.mana.ManaPool;
import forge.card.replacement.ReplacementResult;
@@ -1747,11 +1746,6 @@ public class Player extends GameEntity implements Comparable<Player> {
if (this.canPlayLand(land, ignoreTiming)) {
land.setController(this, 0);
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,
// etc...)
@@ -1765,6 +1759,10 @@ public class Player extends GameEntity implements Comparable<Player> {
runParams.put("Card", land);
game.getTriggerHandler().runTrigger(TriggerType.LandPlayed, runParams, false);
game.getStack().unfreezeStack();
this.numLandsPlayed++;
if (land.isBasicLand() && land.isType("Forest")) {
this.numBasicForestsPlayed++;
}
return true;
}