mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-14 09:48:02 +00:00
Clean up
This commit is contained in:
@@ -17,7 +17,6 @@ public abstract class TriggerReplacementBase extends CardTraitBase implements II
|
||||
|
||||
/** The overriding ability. */
|
||||
private SpellAbility overridingAbility = null;
|
||||
private CardTraitBase linkedAbility = null;
|
||||
|
||||
@Override
|
||||
public void setHostCard(final Card c) {
|
||||
@@ -77,12 +76,5 @@ public abstract class TriggerReplacementBase extends CardTraitBase implements II
|
||||
this.overridingAbility = overridingAbility0;
|
||||
}
|
||||
|
||||
public CardTraitBase getLinkedAbility() {
|
||||
return this.linkedAbility;
|
||||
}
|
||||
public void setLinkedAbility(final CardTraitBase linked) {
|
||||
this.linkedAbility = linked;
|
||||
}
|
||||
|
||||
abstract public SpellAbility ensureAbility();
|
||||
}
|
||||
|
||||
@@ -5789,13 +5789,12 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
||||
return exertThisTurn;
|
||||
}
|
||||
|
||||
public void exert(StaticAbility host) {
|
||||
public void exert() {
|
||||
exertedByPlayer.add(getController());
|
||||
exertThisTurn++;
|
||||
view.updateExertedThisTurn(this, true);
|
||||
final Map<AbilityKey, Object> runParams = AbilityKey.mapFromCard(this);
|
||||
runParams.put(AbilityKey.Player, getController());
|
||||
runParams.put(AbilityKey.Source, host);
|
||||
game.getTriggerHandler().runTrigger(TriggerType.Exerted, runParams, false);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
*/
|
||||
package forge.game.cost;
|
||||
|
||||
import forge.game.ability.AbilityFactory;
|
||||
import forge.game.ability.AbilityUtils;
|
||||
import forge.game.card.Card;
|
||||
import forge.game.card.CardCollectionView;
|
||||
import forge.game.card.CardLists;
|
||||
import forge.game.player.Player;
|
||||
import forge.game.spellability.SpellAbility;
|
||||
import forge.game.trigger.Trigger;
|
||||
import forge.game.trigger.TriggerHandler;
|
||||
import forge.game.zone.ZoneType;
|
||||
|
||||
/**
|
||||
@@ -99,12 +99,11 @@ public class CostExert extends CostPartWithList {
|
||||
@Override
|
||||
protected Card doPayment(SpellAbility ability, Card targetCard, final boolean effect) {
|
||||
if (trigger != null) {
|
||||
TriggerHandler handler = targetCard.getGame().getTriggerHandler();
|
||||
Trigger trig = TriggerHandler.parseTrigger(trigHost.getSVar(trigger), trigHost.getHostCard(), false);
|
||||
trig.setLinkedAbility(trigHost);
|
||||
handler.registerOneTrigger(trig);
|
||||
SpellAbility trig = AbilityFactory.getAbility(targetCard.getSVar(trigger), targetCard);
|
||||
trig.setActivatingPlayer(ability.getActivatingPlayer());
|
||||
AbilityUtils.resolve(trig);
|
||||
}
|
||||
targetCard.exert(trigHost);
|
||||
targetCard.exert();
|
||||
return targetCard;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@ import forge.game.ability.AbilityUtils;
|
||||
import forge.game.card.Card;
|
||||
import forge.game.player.Player;
|
||||
import forge.game.spellability.SpellAbility;
|
||||
import forge.game.staticability.StaticAbility;
|
||||
|
||||
/**
|
||||
* The Class CostPart.
|
||||
@@ -43,7 +42,6 @@ public abstract class CostPart implements Comparable<CostPart>, Cloneable, Seria
|
||||
private String typeDescription, type;
|
||||
|
||||
protected String trigger;
|
||||
protected transient StaticAbility trigHost;
|
||||
|
||||
/**
|
||||
* Instantiates a new cost part.
|
||||
@@ -158,9 +156,8 @@ public abstract class CostPart implements Comparable<CostPart>, Cloneable, Seria
|
||||
return AbilityUtils.calculateAmount(ability.getHostCard(), getAmount(), ability);
|
||||
}
|
||||
|
||||
public void setTrigger(String trig, StaticAbility host) {
|
||||
public void setTrigger(String trig) {
|
||||
trigger = trig;
|
||||
trigHost = host;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -188,7 +188,7 @@ public class StaticAbilityCantAttackBlock {
|
||||
Cost cost = new Cost(costString, true);
|
||||
|
||||
if (stAb.hasParam("Trigger")) {
|
||||
cost.getCostParts().get(0).setTrigger(stAb.getParam("Trigger"), stAb);
|
||||
cost.getCostParts().get(0).setTrigger(stAb.getParam("Trigger"));
|
||||
}
|
||||
|
||||
return cost;
|
||||
|
||||
@@ -27,9 +27,6 @@ public class TriggerExerted extends Trigger {
|
||||
if (!matchesValidParam("ValidCard", runParams.get(AbilityKey.Card))) {
|
||||
return false;
|
||||
}
|
||||
if (hasParam("Linked") && !runParams.get(AbilityKey.Source).equals(getLinkedAbility())) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,6 @@ Types:Creature Minotaur Warrior
|
||||
PT:3/2
|
||||
K:Haste
|
||||
S:Mode$ CantAttackUnless | ValidCard$ Card.Self | Trigger$ TrigExert | Cost$ Exert<1/CARDNAME> | Description$ You may exert CARDNAME as it attacks. When you do, target creature can't block this turn.
|
||||
SVar:TrigExert:Mode$ Exerted | ValidCard$ Card.Self | Linked$ True | Execute$ TrigCanNotBlock | TriggerDescription$ When you exert CARDNAME, target creature can't block this turn.
|
||||
SVar:TrigExert:DB$ ImmediateTrigger | Execute$ TrigCanNotBlock | TriggerDescription$ When you exert CARDNAME, target creature can't block this turn.
|
||||
SVar:TrigCanNotBlock:DB$ Pump | ValidTgts$ Creature | KW$ HIDDEN CARDNAME can't block. | TgtPrompt$ Select target creature. | IsCurse$ True | SpellDescription$ Target creature can't block this turn.
|
||||
Oracle:Haste\nYou may exert Ahn-Crop Crasher as it attacks. When you do, target creature can't block this turn. (An exerted creature won't untap during your next untap step.)
|
||||
|
||||
Reference in New Issue
Block a user