- Added the Trigger "CounterRemoved".

- Added Riftmarked Knight.
This commit is contained in:
Sloth
2012-02-03 11:20:35 +00:00
parent f637bb2cd7
commit 3904caec2a
7 changed files with 125 additions and 5 deletions

2
.gitattributes vendored
View File

@@ -7058,6 +7058,7 @@ res/cardsfolder/r/ridgetop_raptor.txt svneol=native#text/plain
res/cardsfolder/r/riding_red_hare.txt svneol=native#text/plain
res/cardsfolder/r/riding_the_dilu_horse.txt svneol=native#text/plain
res/cardsfolder/r/rift_bolt.txt svneol=native#text/plain
res/cardsfolder/r/riftmarked_knight.txt -text
res/cardsfolder/r/riftstone_portal.txt svneol=native#text/plain
res/cardsfolder/r/riftwing_cloudskate.txt svneol=native#text/plain
res/cardsfolder/r/righteous_avengers.txt svneol=native#text/plain
@@ -10991,6 +10992,7 @@ src/main/java/forge/card/trigger/TriggerChampioned.java svneol=native#text/plain
src/main/java/forge/card/trigger/TriggerChangesZone.java svneol=native#text/plain
src/main/java/forge/card/trigger/TriggerClashed.java svneol=native#text/plain
src/main/java/forge/card/trigger/TriggerCounterAdded.java svneol=native#text/plain
src/main/java/forge/card/trigger/TriggerCounterRemoved.java -text
src/main/java/forge/card/trigger/TriggerCycled.java svneol=native#text/plain
src/main/java/forge/card/trigger/TriggerDamageDone.java svneol=native#text/plain
src/main/java/forge/card/trigger/TriggerDiscarded.java svneol=native#text/plain

View File

@@ -0,0 +1,15 @@
Name:Riftmarked Knight
ManaCost:1 W W
Types:Creature Human Rebel Knight
Text:no text
PT:2/2
K:Flanking
K:Protection from black
K:Suspend:3:1 W W
T:Mode$ CounterRemoved | ValidCard$ Card.Self | TriggerZones$ Exile | CounterType$ TIME | Execute$ TrigToken | IsPresent$ Card.Self+counters_GE1_TIME | PresentZone$ Exile | PresentCompare$ EQ0 | TriggerDescription$ When the last time counter is removed from CARDNAME while it's exiled, put a 2/2 black Knight creature token with flanking, protection from white, and haste onto the battlefield.
SVar:TrigToken:AB$Token | Cost$ 0 | TokenAmount$ 1 | TokenName$ Knight | TokenTypes$ Creature,Knight | TokenOwner$ You | TokenColors$ Black | TokenPower$ 2 | TokenToughness$ 2 | TokenKeywords$ Flanking<>Protection from white<>Haste
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/riftmarked_knight.jpg
SetInfo:PLC|Uncommon|http://magiccards.info/scans/en/pc/14.jpg
Oracle:Protection from black, flanking (Whenever a creature without flanking blocks this creature, the blocking creature gets -1/-1 until end of turn.)\nSuspend 3-{1}{W}{W} (Rather than cast this card from your hand, you may pay {1}{W}{W} and exile it with three time counters on it. At the beginning of your upkeep, remove a time counter. When the last is removed, cast it without paying its mana cost. It has haste.)\nWhen the last time counter is removed from Riftmarked Knight while it's exiled, put a 2/2 black Knight creature token with flanking, protection from white, and haste onto the battlefield.
End

View File

@@ -7,4 +7,6 @@ SVar:TrigAnimate:AB$ Animate | Cost$ 0 | Defined$ Self | Power$ X | Toughness$ X
SVar:X:TriggeredCard$CardManaCost
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/veiled_sentry.jpg
SetInfo:USG|Uncommon|http://magiccards.info/scans/en/us/109.jpg
Oracle:When an opponent casts a spell, if Veiled Sentry is an enchantment, Veiled Sentry becomes an Illusion creature with power and toughness each equal to that spell's converted mana cost.
End

View File

@@ -10,4 +10,6 @@ SVar:X:Count$YourLifeTotal
SVar:Y:Count$OppLifeTotal
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/wild_dogs.jpg
SetInfo:USG|Common|http://magiccards.info/scans/en/us/284.jpg
Oracle:At the beginning of your upkeep, if a player has more life than each other player, the player with the most life gains control of Wild Dogs.\nCycling {2} ({2}, Discard this card: Draw a card.)
End

View File

@@ -1524,8 +1524,6 @@ public class Card extends GameEntity implements Comparable<Card> {
AllZone.getTriggerHandler().runTrigger("CounterAdded", runParams);
}
AllZone.getGameAction().checkStateEffects();
this.updateObservers();
}
@@ -1546,6 +1544,15 @@ public class Card extends GameEntity implements Comparable<Card> {
aux = 0;
}
this.counters.put(counterName, aux);
// Run triggers
final Map<String, Object> runParams = new TreeMap<String, Object>();
runParams.put("Card", this);
runParams.put("CounterType", counterName);
for (int i = 0; i < n; i++) {
AllZone.getTriggerHandler().runTrigger("CounterRemoved", runParams);
}
if (counterName.equals(Counters.TIME) && (aux == 0)) {
final boolean hasVanish = CardFactoryUtil.hasKeyword(this, "Vanishing") != -1;
@@ -1584,9 +1591,6 @@ public class Card extends GameEntity implements Comparable<Card> {
}
}
}
AllZone.getGameAction().checkStateEffects();
this.updateObservers();
}
}

View File

@@ -0,0 +1,93 @@
/*
* Forge: Play Magic: the Gathering.
* Copyright (C) 2011 Forge Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package forge.card.trigger;
import java.util.HashMap;
import forge.Card;
import forge.Counters;
import forge.card.spellability.SpellAbility;
/**
* <p>
* Trigger_CounterRemoved class.
* </p>
*
* @author Forge
* @version $Id: TriggerCounterAdded.java 12297 2011-11-28 19:56:47Z jendave $
*/
public class TriggerCounterRemoved extends Trigger {
/**
* <p>
* Constructor for Trigger_CounterRemoved.
* </p>
*
* @param params
* a {@link java.util.HashMap} object.
* @param host
* a {@link forge.Card} object.
* @param intrinsic
* the intrinsic
*/
public TriggerCounterRemoved(final HashMap<String, String> params, final Card host, final boolean intrinsic) {
super(params, host, intrinsic);
}
/** {@inheritDoc} */
@Override
public final boolean performTest(final java.util.Map<String, Object> runParams2) {
final Card addedTo = (Card) runParams2.get("Card");
final Counters addedType = (Counters) runParams2.get("CounterType");
if (this.getMapParams().containsKey("ValidCard")) {
if (!addedTo.isValid(this.getMapParams().get("ValidCard").split(","), this.getHostCard().getController(),
this.getHostCard())) {
return false;
}
}
if (this.getMapParams().containsKey("CounterType")) {
final String type = this.getMapParams().get("CounterType");
if (!type.equals(addedType.toString())) {
return false;
}
}
return true;
}
/** {@inheritDoc} */
@Override
public final Trigger getCopy() {
final Trigger copy = new TriggerCounterRemoved(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
if (this.getOverridingAbility() != null) {
copy.setOverridingAbility(this.getOverridingAbility());
}
copy.setName(this.getName());
copy.setID(this.getId());
return copy;
}
/** {@inheritDoc} */
@Override
public final void setTriggeringObjects(final SpellAbility sa) {
sa.setTriggeringObject("Card", this.getRunParams().get("Card"));
}
}

View File

@@ -225,6 +225,8 @@ public class TriggerHandler {
ret = new TriggerClashed(mapParams, host, intrinsic);
} else if (mode.equals("CounterAdded")) {
ret = new TriggerCounterAdded(mapParams, host, intrinsic);
} else if (mode.equals("CounterRemoved")) {
ret = new TriggerCounterRemoved(mapParams, host, intrinsic);
} else if (mode.equals("Cycled")) {
ret = new TriggerCycled(mapParams, host, intrinsic);
} else if (mode.equals("DamageDone")) {