mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
- Added TriggerEvolved
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -13871,6 +13871,7 @@ src/main/java/forge/card/trigger/TriggerDestroyed.java -text
|
||||
src/main/java/forge/card/trigger/TriggerDevoured.java -text
|
||||
src/main/java/forge/card/trigger/TriggerDiscarded.java svneol=native#text/plain
|
||||
src/main/java/forge/card/trigger/TriggerDrawn.java svneol=native#text/plain
|
||||
src/main/java/forge/card/trigger/TriggerEvolved.java -text
|
||||
src/main/java/forge/card/trigger/TriggerFlipped.java -text
|
||||
src/main/java/forge/card/trigger/TriggerHandler.java svneol=native#text/plain
|
||||
src/main/java/forge/card/trigger/TriggerLandPlayed.java svneol=native#text/plain
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Name:Reverse the Sands
|
||||
ManaCost:6 W W
|
||||
Types:Sorcery
|
||||
A:SP$ SetLife | Cost$ 6 W W | ValidTgts$ Player | TargetMin$ 0 | TargetMax$ Maxplayer | Redistribute$ True | SpellDescription$ Redistribute any number of players' life totals. (Each of those players gets one life total back.)
|
||||
A:SP$ SetLife | Cost$ 6 W W | ValidTgts$ Player | TargetMin$ 0 | TargetMax$ Maxplayer | References$ Maxplayer | Redistribute$ True | SpellDescription$ Redistribute any number of players' life totals. (Each of those players gets one life total back.)
|
||||
SVar:Maxplayer:PlayerCountPlayers$Amount
|
||||
SVar:RemAIDeck:True
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/reverse_the_sands.jpg
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package forge.card.ability.effects;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
@@ -10,6 +11,7 @@ import forge.card.ability.AbilityUtils;
|
||||
import forge.card.ability.SpellAbilityEffect;
|
||||
import forge.card.spellability.SpellAbility;
|
||||
import forge.card.spellability.Target;
|
||||
import forge.card.trigger.TriggerType;
|
||||
import forge.game.zone.Zone;
|
||||
import forge.game.zone.ZoneType;
|
||||
import forge.gui.GuiChoose;
|
||||
@@ -113,6 +115,11 @@ public class CountersPutEffect extends SpellAbilityEffect {
|
||||
tgtCard.addCountersAddedBy(card, counterType, value);
|
||||
}
|
||||
tgtCard.addCounter(counterType, counterAmount, true);
|
||||
if (sa.hasParam("Evolve")) {
|
||||
final HashMap<String, Object> runParams = new HashMap<String, Object>();
|
||||
runParams.put("Card", tgtCard);
|
||||
tgtCard.getController().getGame().getTriggerHandler().runTrigger(TriggerType.Evolved, runParams, false);
|
||||
}
|
||||
} else {
|
||||
// adding counters to something like re-suspend cards
|
||||
tgtCard.addCounter(counterType, counterAmount, false);
|
||||
|
||||
@@ -2710,7 +2710,7 @@ public class CardFactoryUtil {
|
||||
+ "control, if that creature has greater power or toughness than this creature, put a "
|
||||
+ "+1/+1 counter on this creature.)";
|
||||
final String abString = "AB$ PutCounter | Cost$ 0 | Defined$ Self | CounterType$ P1P1 | "
|
||||
+ "CounterNum$ 1";
|
||||
+ "CounterNum$ 1 | Evolve$ True";
|
||||
final Trigger parsedTrigger = TriggerHandler.parseTrigger(evolveTrigger, card, true);
|
||||
card.addTrigger(parsedTrigger);
|
||||
card.setSVar("EvolveAddCounter", abString);
|
||||
|
||||
79
src/main/java/forge/card/trigger/TriggerEvolved.java
Normal file
79
src/main/java/forge/card/trigger/TriggerEvolved.java
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* 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 forge.Card;
|
||||
import forge.card.spellability.SpellAbility;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Trigger_Evolved class.
|
||||
* </p>
|
||||
*
|
||||
* @author Forge
|
||||
* @version $Id: TriggerEvolved.java 17802 2012-10-31 08:05:14Z Max mtg $
|
||||
*/
|
||||
public class TriggerEvolved extends Trigger {
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Constructor for Trigger_Evolved.
|
||||
* </p>
|
||||
*
|
||||
* @param params
|
||||
* a {@link java.util.HashMap} object.
|
||||
* @param host
|
||||
* a {@link forge.Card} object.
|
||||
* @param intrinsic
|
||||
* the intrinsic
|
||||
*/
|
||||
public TriggerEvolved(final java.util.Map<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 sac = (Card) runParams2.get("Card");
|
||||
if (this.getMapParams().containsKey("ValidCard")) {
|
||||
if (!sac.isValid(this.getMapParams().get("ValidCard").split(","), this.getHostCard().getController(),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final Trigger getCopy() {
|
||||
final Trigger copy = new TriggerEvolved(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
}
|
||||
|
||||
copyFieldsTo(copy);
|
||||
return copy;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final void setTriggeringObjects(final SpellAbility sa) {
|
||||
sa.setTriggeringObject("Card", this.getRunParams().get("Card"));
|
||||
}
|
||||
}
|
||||
@@ -28,6 +28,7 @@ public enum TriggerType {
|
||||
TapsForMana(TriggerTapsForMana.class),
|
||||
CounterAdded(TriggerCounterAdded.class),
|
||||
CounterRemoved(TriggerCounterRemoved.class),
|
||||
Evolved(TriggerEvolved.class),
|
||||
Unequip(TriggerUnequip.class),
|
||||
DamageDone(TriggerDamageDone.class),
|
||||
Championed(TriggerChampioned.class),
|
||||
|
||||
Reference in New Issue
Block a user