mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
- DTK:Added Foe-Razer Regent
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -673,6 +673,7 @@ forge-game/src/main/java/forge/game/trigger/TriggerDiscarded.java svneol=native#
|
||||
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/TriggerExploited.java -text
|
||||
forge-game/src/main/java/forge/game/trigger/TriggerFight.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/TriggerLandPlayed.java svneol=native#text/plain
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
package forge.game.ability.effects;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import forge.game.ability.AbilityUtils;
|
||||
import forge.game.ability.SpellAbilityEffect;
|
||||
import forge.game.card.Card;
|
||||
import forge.game.spellability.SpellAbility;
|
||||
import forge.game.spellability.TargetRestrictions;
|
||||
import forge.game.trigger.TriggerType;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public class FightEffect extends SpellAbilityEffect {
|
||||
@@ -43,6 +46,11 @@ public class FightEffect extends SpellAbilityEffect {
|
||||
final int dmg2 = fightToughness ? fighters.get(1).getNetToughness() : fighters.get(1).getNetPower();
|
||||
fighters.get(1).addDamage(dmg1, fighters.get(0));
|
||||
fighters.get(0).addDamage(dmg2, fighters.get(1));
|
||||
for (Card c : fighters) {
|
||||
final HashMap<String, Object> runParams = new HashMap<String, Object>();
|
||||
runParams.put("Fighter", c);
|
||||
sa.getActivatingPlayer().getGame().getTriggerHandler().runTrigger(TriggerType.Fight, runParams, false);
|
||||
}
|
||||
}
|
||||
|
||||
private static List<Card> getFighters(SpellAbility sa) {
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* 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 TriggerFight extends Trigger {
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Constructor for Trigger_Fight.
|
||||
* </p>
|
||||
*
|
||||
* @param params
|
||||
* a {@link java.util.HashMap} object.
|
||||
* @param host
|
||||
* a {@link forge.game.card.Card} object.
|
||||
* @param intrinsic
|
||||
* the intrinsic
|
||||
*/
|
||||
public TriggerFight(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 fighter = (Card) runParams2.get("Fighter");
|
||||
|
||||
if (this.mapParams.containsKey("ValidCard")) {
|
||||
if (!fighter.isValid(this.mapParams.get("ValidCard").split(","),
|
||||
this.getHostCard().getController(), this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final void setTriggeringObjects(final SpellAbility sa) {
|
||||
sa.setTriggeringObject("Fighter", this.getRunParams().get("Fighter"));
|
||||
}
|
||||
}
|
||||
@@ -41,6 +41,7 @@ public enum TriggerType {
|
||||
Drawn(TriggerDrawn.class),
|
||||
Evolved(TriggerEvolved.class),
|
||||
Exploited(TriggerExploited.class),
|
||||
Fight(TriggerFight.class),
|
||||
FlippedCoin(TriggerFlippedCoin.class),
|
||||
LandPlayed(TriggerLandPlayed.class),
|
||||
LifeGained(TriggerLifeGained.class),
|
||||
|
||||
Reference in New Issue
Block a user