- DTK:Added Sidisi, Undead Vizier

This commit is contained in:
swordshine
2015-03-03 10:11:09 +00:00
parent 600566a8c7
commit 0ae7fd8d9d
5 changed files with 99 additions and 0 deletions

1
.gitattributes vendored
View File

@@ -672,6 +672,7 @@ forge-game/src/main/java/forge/game/trigger/TriggerDevoured.java -text
forge-game/src/main/java/forge/game/trigger/TriggerDiscarded.java svneol=native#text/plain forge-game/src/main/java/forge/game/trigger/TriggerDiscarded.java svneol=native#text/plain
forge-game/src/main/java/forge/game/trigger/TriggerDrawn.java svneol=native#text/plain forge-game/src/main/java/forge/game/trigger/TriggerDrawn.java svneol=native#text/plain
forge-game/src/main/java/forge/game/trigger/TriggerEvolved.java -text forge-game/src/main/java/forge/game/trigger/TriggerEvolved.java -text
forge-game/src/main/java/forge/game/trigger/TriggerExploited.java -text
forge-game/src/main/java/forge/game/trigger/TriggerFlippedCoin.java -text forge-game/src/main/java/forge/game/trigger/TriggerFlippedCoin.java -text
forge-game/src/main/java/forge/game/trigger/TriggerHandler.java svneol=native#text/plain forge-game/src/main/java/forge/game/trigger/TriggerHandler.java svneol=native#text/plain
forge-game/src/main/java/forge/game/trigger/TriggerLandPlayed.java svneol=native#text/plain forge-game/src/main/java/forge/game/trigger/TriggerLandPlayed.java svneol=native#text/plain

View File

@@ -50,6 +50,7 @@ public class SacrificeEffect extends SpellAbilityEffect {
final int amount = AbilityUtils.calculateAmount(card, num, sa); final int amount = AbilityUtils.calculateAmount(card, num, sa);
final List<Player> tgts = getTargetPlayers(sa); final List<Player> tgts = getTargetPlayers(sa);
final boolean devour = sa.hasParam("Devour"); final boolean devour = sa.hasParam("Devour");
final boolean exploit = sa.hasParam("Exploit");
String valid = sa.getParam("SacValid"); String valid = sa.getParam("SacValid");
if (valid == null) { if (valid == null) {
@@ -106,6 +107,12 @@ public class SacrificeEffect extends SpellAbilityEffect {
runParams.put("Devoured", sac); runParams.put("Devoured", sac);
game.getTriggerHandler().runTrigger(TriggerType.Devoured, runParams, false); game.getTriggerHandler().runTrigger(TriggerType.Devoured, runParams, false);
} }
if (exploit) {
final HashMap<String, Object> runParams = new HashMap<String, Object>();
runParams.put("Exploited", lKICopy);
runParams.put("Card", card);
game.getTriggerHandler().runTrigger(TriggerType.Exploited, runParams, false);
}
if (wasDestroyed || wasSacrificed) { if (wasDestroyed || wasSacrificed) {
countSacrificed++; countSacrificed++;
if (remSacrificed) { if (remSacrificed) {

View File

@@ -3239,6 +3239,7 @@ public class CardFactoryUtil {
card.addTrigger(myTrigger); card.addTrigger(myTrigger);
} }
} // Modular } // Modular
/* /*
* WARNING: must keep this keyword processing before etbCounter keyword * WARNING: must keep this keyword processing before etbCounter keyword
@@ -3402,6 +3403,18 @@ public class CardFactoryUtil {
card.addTrigger(prowessTrigger); card.addTrigger(prowessTrigger);
card.setSVar("BuffedBy", "Card.nonCreature+nonLand"); // for the AI card.setSVar("BuffedBy", "Card.nonCreature+nonLand"); // for the AI
} // Prowess } // Prowess
final int exploit = card.getAmountOfKeyword("Exploit");
card.removeIntrinsicKeyword("Exploit");
final StringBuilder trigExploit = new StringBuilder(
"Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield"
+ " | Execute$ ExploitSac | TriggerDescription$ Exploit (When this creature enters"
+ " the battlefield, you may sacrifice a creature.)");
final String abStringExploit = "DB$ Sacrifice | SacValid$ Creature | Exploit$ True | Optional$ True";
card.setSVar("ExploitSac", abStringExploit);
final Trigger exploitTrigger = TriggerHandler.parseTrigger(trigExploit.toString(), card, true);
for (int i = 0; i < exploit; i++) {
card.addTrigger(exploitTrigger);
} // Exploit
} }
public final static void refreshTotemArmor(Card c) { public final static void refreshTotemArmor(Card c) {

View File

@@ -0,0 +1,77 @@
/*
* 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.game.trigger;
import forge.game.card.Card;
import forge.game.spellability.SpellAbility;
/**
* <p>
* Trigger_Championed class.
* </p>
*
* @author Forge
* @version $Id: TriggerChampioned.java 24762 2014-02-09 10:18:46Z swordshine $
* @since 1.0.15
*/
public class TriggerExploited extends Trigger {
/**
* <p>
* Constructor for Trigger_Exploited.
* </p>
*
* @param params
* a {@link java.util.HashMap} object.
* @param host
* a {@link forge.game.card.Card} object.
* @param intrinsic
* the intrinsic
*/
public TriggerExploited(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 exploited = (Card) runParams2.get("Exploited");
final Card source = (Card) runParams2.get("Card");
if (this.mapParams.containsKey("ValidCard")) {
if (!exploited.isValid(this.mapParams.get("ValidCard").split(","),
this.getHostCard().getController(), this.getHostCard())) {
return false;
}
}
if (this.mapParams.containsKey("ValidSource")) {
if (!source.isValid(this.mapParams.get("ValidSource").split(","),
this.getHostCard().getController(), this.getHostCard())) {
return false;
}
}
return true;
}
/** {@inheritDoc} */
@Override
public final void setTriggeringObjects(final SpellAbility sa) {
sa.setTriggeringObject("Exploited", this.getRunParams().get("Exploited"));
sa.setTriggeringObject("Card", this.getRunParams().get("Card"));
}
}

View File

@@ -40,6 +40,7 @@ public enum TriggerType {
Discarded(TriggerDiscarded.class), Discarded(TriggerDiscarded.class),
Drawn(TriggerDrawn.class), Drawn(TriggerDrawn.class),
Evolved(TriggerEvolved.class), Evolved(TriggerEvolved.class),
Exploited(TriggerExploited.class),
FlippedCoin(TriggerFlippedCoin.class), FlippedCoin(TriggerFlippedCoin.class),
LandPlayed(TriggerLandPlayed.class), LandPlayed(TriggerLandPlayed.class),
LifeGained(TriggerLifeGained.class), LifeGained(TriggerLifeGained.class),