mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
CardFactoryUtil: move Extort to addTrigger
Pontiff of Blight: cleanup the code
This commit is contained in:
@@ -53,6 +53,7 @@ import forge.game.card.CardPredicates.Presets;
|
|||||||
import forge.game.cost.Cost;
|
import forge.game.cost.Cost;
|
||||||
import forge.game.cost.CostPayment;
|
import forge.game.cost.CostPayment;
|
||||||
import forge.game.event.GameEventCardStatsChanged;
|
import forge.game.event.GameEventCardStatsChanged;
|
||||||
|
import forge.game.keyword.Keyword;
|
||||||
import forge.game.keyword.KeywordsChange;
|
import forge.game.keyword.KeywordsChange;
|
||||||
import forge.game.phase.PhaseHandler;
|
import forge.game.phase.PhaseHandler;
|
||||||
import forge.game.player.Player;
|
import forge.game.player.Player;
|
||||||
@@ -2546,18 +2547,7 @@ public class CardFactoryUtil {
|
|||||||
card.setSVar("TrigBondSelf", abStringOther);
|
card.setSVar("TrigBondSelf", abStringOther);
|
||||||
}
|
}
|
||||||
else if (keyword.equals("Extort")) {
|
else if (keyword.equals("Extort")) {
|
||||||
final String extortTrigger = "Mode$ SpellCast | ValidCard$ Card | ValidActivatingPlayer$ You | "
|
addTriggerAbility(keyword, card, null);
|
||||||
+ "TriggerZones$ Battlefield | Execute$ ExtortOpps | Secondary$ True"
|
|
||||||
+ " | TriggerDescription$ Extort (Whenever you cast a spell, you may pay W/B. If you do, "
|
|
||||||
+ "each opponent loses 1 life and you gain that much life.)";
|
|
||||||
final String abString = "AB$ LoseLife | Cost$ WB | Defined$ Player.Opponent | "
|
|
||||||
+ "LifeAmount$ 1 | SubAbility$ ExtortGainLife";
|
|
||||||
final String dbString = "DB$ GainLife | Defined$ You | LifeAmount$ AFLifeLost | References$ AFLifeLost";
|
|
||||||
final Trigger parsedTrigger = TriggerHandler.parseTrigger(extortTrigger, card, true);
|
|
||||||
card.addTrigger(parsedTrigger);
|
|
||||||
card.setSVar("ExtortOpps", abString);
|
|
||||||
card.setSVar("ExtortGainLife", dbString);
|
|
||||||
card.setSVar("AFLifeLost", "Number$0");
|
|
||||||
}
|
}
|
||||||
else if (keyword.equals("Evolve")) {
|
else if (keyword.equals("Evolve")) {
|
||||||
final String evolveTrigger = "Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | "
|
final String evolveTrigger = "Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | "
|
||||||
@@ -2917,7 +2907,24 @@ public class CardFactoryUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void addTriggerAbility(final String keyword, final Card card, final KeywordsChange kws) {
|
public static void addTriggerAbility(final String keyword, final Card card, final KeywordsChange kws) {
|
||||||
|
final boolean intrinsic = kws == null;
|
||||||
|
|
||||||
|
if (keyword.equals("Extort")) {
|
||||||
|
final String extortTrigger = "Mode$ SpellCast | ValidCard$ Card | ValidActivatingPlayer$ You | "
|
||||||
|
+ "TriggerZones$ Battlefield | Execute$ ExtortOpps | Secondary$ True"
|
||||||
|
+ " | TriggerDescription$ Extort ("+ Keyword.getInstance(keyword).getReminderText() +")";
|
||||||
|
final String abString = "AB$ LoseLife | Cost$ WB | Defined$ Player.Opponent | "
|
||||||
|
+ "LifeAmount$ 1 | SubAbility$ ExtortGainLife";
|
||||||
|
final String dbString = "DB$ GainLife | Defined$ You | LifeAmount$ AFLifeLost | References$ AFLifeLost";
|
||||||
|
final Trigger parsedTrigger = TriggerHandler.parseTrigger(extortTrigger, card, intrinsic);
|
||||||
|
final Trigger cardTrigger = card.addTrigger(parsedTrigger);
|
||||||
|
card.setSVar("ExtortOpps", abString);
|
||||||
|
card.setSVar("ExtortGainLife", dbString);
|
||||||
|
card.setSVar("AFLifeLost", "Number$0");
|
||||||
|
if (!intrinsic) {
|
||||||
|
kws.addTrigger(cardTrigger);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void addReplacementEffect(final String keyword, final Card card, final KeywordsChange kws) {
|
public static void addReplacementEffect(final String keyword, final Card card, final KeywordsChange kws) {
|
||||||
|
|||||||
@@ -3,11 +3,8 @@ ManaCost:4 B B
|
|||||||
Types:Creature Zombie Cleric
|
Types:Creature Zombie Cleric
|
||||||
PT:2/7
|
PT:2/7
|
||||||
K:Extort
|
K:Extort
|
||||||
# Put "AddKeyword$ Extort" here to show the keyword in panel
|
|
||||||
S:Mode$ Continuous | Affected$ Creature.Other+YouCtrl | AddTrigger$ PontiffExtort | AddSVar$ PontiffExtortOpps & PontiffExtortGainLife | Description$ Other creatures you control have Extort.
|
S:Mode$ Continuous | Affected$ Creature.Other+YouCtrl | AddKeyword$ Extort | Description$ Other creatures you control have Extort.
|
||||||
SVar:PontiffExtort:Mode$ SpellCast | ValidCard$ Card | ValidActivatingPlayer$ You | TriggerZones$ Battlefield | Execute$ PontiffExtortOpps | TriggerDescription$ Extort (Whenever you cast a spell, you may pay {W/B}. If you do, each opponent loses 1 life and you gain that much life.)
|
|
||||||
SVar:PontiffExtortOpps:AB$ LoseLife | Cost$ WB | Defined$ Player.Opponent | LifeAmount$ 1 | SubAbility$ PontiffExtortGainLife
|
|
||||||
SVar:PontiffExtortGainLife:DB$ GainLife | Defined$ You | LifeAmount$ AFLifeLost
|
|
||||||
SVar:AFLifeLost:Number$0
|
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/pontiff_of_blight.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/pontiff_of_blight.jpg
|
||||||
Oracle:Extort (Whenever you cast a spell, you may pay {W/B}. If you do, each opponent loses 1 life and you gain that much life.)\nOther creatures you control have extort. (If a creature has multiple instances of extort, each triggers separately.)
|
Oracle:Extort (Whenever you cast a spell, you may pay {W/B}. If you do, each opponent loses 1 life and you gain that much life.)\nOther creatures you control have extort. (If a creature has multiple instances of extort, each triggers separately.)
|
||||||
|
|||||||
Reference in New Issue
Block a user