mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
ImmediateTrigger: use this trigger for heart-piercer manticore and get rid of CauseParam
This commit is contained in:
@@ -715,6 +715,16 @@ public class AbilityUtils {
|
||||
list = null;
|
||||
}
|
||||
}
|
||||
else if (calcX[0].startsWith("TriggerRemembered")) {
|
||||
final SpellAbility root = sa.getRootAbility();
|
||||
CardCollection result = new CardCollection();
|
||||
for (Object o : root.getTriggerRemembered()) {
|
||||
if (o instanceof Card) {
|
||||
result.add((Card) o);
|
||||
}
|
||||
}
|
||||
list = result;
|
||||
}
|
||||
else if (calcX[0].startsWith("TriggerObjects")) {
|
||||
final SpellAbility root = sa.getRootAbility();
|
||||
list = (CardCollection) root.getTriggeringObject(AbilityKey.fromString(calcX[0].substring(14)));
|
||||
|
||||
@@ -3,6 +3,7 @@ package forge.game.ability.effects;
|
||||
import com.google.common.collect.Maps;
|
||||
import forge.game.ability.AbilityUtils;
|
||||
import forge.game.ability.SpellAbilityEffect;
|
||||
import forge.game.spellability.AbilitySub;
|
||||
import forge.game.spellability.SpellAbility;
|
||||
import forge.game.trigger.Trigger;
|
||||
import forge.game.trigger.TriggerHandler;
|
||||
@@ -67,8 +68,10 @@ public class ImmediateTriggerEffect extends SpellAbilityEffect {
|
||||
}
|
||||
|
||||
if (mapParams.containsKey("Execute") || sa.hasAdditionalAbility("Execute")) {
|
||||
SpellAbility overridingSA = sa.getAdditionalAbility("Execute");
|
||||
AbilitySub overridingSA = sa.getAdditionalAbility("Execute");
|
||||
overridingSA.setActivatingPlayer(sa.getActivatingPlayer());
|
||||
// need to set Parent to null, otherwise it might have wrong root ability
|
||||
overridingSA.setParent(null);
|
||||
|
||||
if (sa.hasParam("CopyTriggeringObjects")) {
|
||||
overridingSA.setTriggeringObjects(sa.getTriggeringObjects());
|
||||
|
||||
@@ -57,7 +57,6 @@ public class TriggerExiled extends Trigger {
|
||||
* @param runParams*/
|
||||
@Override
|
||||
public final boolean performTest(final Map<AbilityKey, Object> runParams) {
|
||||
final SpellAbility sourceSA = (SpellAbility) runParams.get(AbilityKey.Cause);
|
||||
if (hasParam("Origin")) {
|
||||
if (!getParam("Origin").equals("Any")) {
|
||||
if (getParam("Origin") == null) {
|
||||
@@ -94,16 +93,6 @@ public class TriggerExiled extends Trigger {
|
||||
}
|
||||
}
|
||||
|
||||
if (hasParam("CauseParam")) {
|
||||
// For now only for Heart-Piecer Manticore, extend it if it appears on different effects too
|
||||
if (sourceSA == null || !sourceSA.hasParam("ExileParam")
|
||||
|| !sourceSA.getParam("ExileParam").equals(getParam("CauseParam"))
|
||||
|| !sourceSA.getHostCard().equals(this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -79,15 +79,6 @@ public class TriggerSacrificed extends Trigger {
|
||||
}
|
||||
}
|
||||
|
||||
if (hasParam("CauseParam")) {
|
||||
// For now only for Heart-Piecer Manticore, extend it if it appears on different effects too
|
||||
if (sourceSA == null || !sourceSA.hasParam("SacrificeParam")
|
||||
|| !sourceSA.getParam("SacrificeParam").equals(getParam("CauseParam"))
|
||||
|| !sourceSA.getHostCard().equals(this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasParam("WhileKeyword")) {
|
||||
final String keyword = getParam("WhileKeyword");
|
||||
boolean withKeyword = false;
|
||||
|
||||
@@ -3,12 +3,12 @@ ManaCost:2 R R
|
||||
Types:Creature Manticore
|
||||
PT:4/3
|
||||
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | TriggerZones$ Battlefield | Execute$ TrigSacrifice | TriggerDescription$ When CARDNAME enters the battlefield, you may sacrifice another creature. When you do, CARDNAME deals damage equal to that creature's power to target creature or player.
|
||||
SVar:TrigSacrifice:DB$ Sacrifice | Optional$ True | SacrificeParam$ HeartPiercer | SacValid$ Creature.Other | SacMessage$ another Creature | Amount$ 1 | AILogic$ ConsiderSac
|
||||
T:Mode$ Sacrificed | ValidPlayer$ You | ValidCard$ Creature.Other | CauseParam$ HeartPiercer | Execute$ TrigDamage | Secondary$ True | TriggerDescription$ CARDNAME deals damage equal to that creature's power to any target.
|
||||
SVar:TrigSacrifice:DB$ Sacrifice | Optional$ True | SacValid$ Creature.Other | SacMessage$ another Creature | Amount$ 1 | AILogic$ ConsiderSac | RememberSacrificed$ True | SubAbility$ DBTrigger
|
||||
SVar:DBTrigger:DB$ ImmediateTrigger | Execute$ TrigDamage | RememberObjects$ RememberedCard | ConditionDefined$ Remembered | ConditionPresent$ Card | SubAbility$ DBCleanup | TriggerDescription$ When you do, CARDNAME deals damage equal to that creature's power to any target.
|
||||
SVar:TrigDamage:DB$ DealDamage | ValidTgts$ Creature,Player,Planeswalker | TgtPrompt$ Select any target | NumDmg$ XPower | References$ XPower
|
||||
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||
K:Embalm:5 R
|
||||
SVar:XPower:TriggeredCard$CardPower
|
||||
SVar:XPower:TriggerRemembered$CardPower
|
||||
SVar:AIPreferenceParams:CreatureEvalThreshold$ 200
|
||||
SVar:DeckHas:Ability$Token
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/heart_piercer_manticore.jpg
|
||||
Oracle:When Heart-Piercer Manticore enters the battlefield, you may sacrifice another creature. When you do, Heart-Piercer Manticore deals damage equal to that creature's power to any target.\nEmbalm {5} {R} ({5} {R}, Exile this card from your graveyard: Create a token that's a copy of it, except it's a white Zombie Manticore with no mana cost. Embalm only as a sorcery.)
|
||||
|
||||
@@ -5,11 +5,12 @@ A:AB$ Mana | Cost$ T | Produced$ R R | SpellDescription$ Add {R}{R}.
|
||||
T:Mode$ Phase | Phase$ Upkeep | TriggerZones$ Battlefield | Execute$ TrigDecide | TriggerDescription$ At the beginning of each player's upkeep, that player may put a doom counter on CARDNAME or remove a doom counter from it. Then if it has three or more doom counters on it, sacrifice it. When you do, it deals 6 damage to each creature.
|
||||
SVar:TrigDecide:DB$ GenericChoice | Defined$ TriggeredPlayer | Choices$ PutCounter,RemoveCounter,DoNothing
|
||||
SVar:PutCounter:DB$ PutCounter | Defined$ Self | CounterType$ DOOM | CounterNum$ 1 | Placer$ TriggeredPlayer | SubAbility$ DBSac | SpellDescription$ Put a doom counter on CARDNAME
|
||||
SVar:DBSac:DB$ Sacrifice | SacValid$ Self | ConditionPresent$ Card.Self+counters_GE3_DOOM | SacrificeParam$ LavabrinkFloodgates | SubAbility$ DBDamage
|
||||
T:Mode$ Sacrificed | ValidPlayer$ You | ValidCard$ Card.Self | CauseParam$ LavabrinkFloodgates | Execute$ TrigDamage | Secondary$ True | TriggerDescription$ CARDNAME deals 6 damage to each creature.
|
||||
SVar:RemoveCounter:DB$ RemoveCounter | Defined$ Self | CounterType$ DOOM | CounterNum$ 1 | SubAbility$ DBSac | SpellDescription$ Remove a doom counter from CARDNAME
|
||||
SVar:DoNothing:DB$ Pump | Defined$ Self | SubAbility$ DBSac | SpellDescription$ Do not change the number of doom counters on CARDNAME
|
||||
SVar:DBSac:DB$ Sacrifice | SacValid$ Self | ConditionPresent$ Card.Self+counters_GE3_DOOM | RememberSacrificed$ True | SubAbility$ DBTrigger
|
||||
SVar:DBTrigger:DB$ ImmediateTrigger | Execute$ TrigDamage | RememberObjects$ RememberedCard | ConditionDefined$ Remembered | ConditionPresent$ Card | SubAbility$ DBCleanup | TriggerDescription$ When you do, it deals 6 damage to each creature.
|
||||
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||
SVar:TrigDamage:DB$ DamageAll | ValidCards$ Creature | NumDmg$ 6
|
||||
SVar:RemoveCounter:DB$ RemoveCounter | Defined$ Self | CounterType$ DOOM | CounterNum$ 1 | SpellDescription$ Remove a doom counter from CARDNAME
|
||||
SVar:DoNothing:DB$ Pump | Defined$ Self | SpellDescription$ Do not change the number of doom counters on CARDNAME
|
||||
AI:RemoveDeck:All
|
||||
DeckHas:Ability$Counters
|
||||
Oracle:{T}: Add {R}{R}.\nAt the beginning of each player's upkeep, that player may put a doom counter on Lavabrink Floodgates or remove a doom counter from it. Then if it has three or more doom counters on it, sacrifice it. When you do, it deals 6 damage to each creature.
|
||||
|
||||
@@ -223,10 +223,10 @@ public class HumanPlaySpellAbility {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
final SpellAbility subAbility = currentAbility.getSubAbility();
|
||||
final AbilitySub subAbility = currentAbility.getSubAbility();
|
||||
if (subAbility != null) {
|
||||
// This is necessary for "TargetsWithDefinedController$ ParentTarget"
|
||||
((AbilitySub) subAbility).setParent(currentAbility);
|
||||
subAbility.setParent(currentAbility);
|
||||
}
|
||||
currentAbility = subAbility;
|
||||
} while (currentAbility != null);
|
||||
|
||||
Reference in New Issue
Block a user