Merge branch 'conspiracy' into 'master'

Fix Conspiracy Theorist

See merge request core-developers/forge!5216
This commit is contained in:
Michael Kamensky
2021-08-13 11:46:55 +00:00
9 changed files with 29 additions and 29 deletions

View File

@@ -234,9 +234,6 @@ public class PumpEffect extends SpellAbilityEffect {
final Card host = sa.getHostCard();
final long timestamp = game.getNextTimestamp();
String pumpForget = null;
String pumpImprint = null;
List<String> keywords = Lists.newArrayList();
if (sa.hasParam("KW")) {
keywords.addAll(Arrays.asList(sa.getParam("KW").split(" & ")));
@@ -324,10 +321,6 @@ public class PumpEffect extends SpellAbilityEffect {
}
}
if (sa.hasParam("ForgetObjects")) {
pumpForget = sa.getParam("ForgetObjects");
}
if (sa.hasParam("NoteCardsFor")) {
for (final Card c : AbilityUtils.getDefinedCards(host, sa.getParam("NoteCards"), sa)) {
for (Player p : tgtPlayers) {
@@ -336,17 +329,14 @@ public class PumpEffect extends SpellAbilityEffect {
}
}
if (pumpForget != null) {
for (final Object o : AbilityUtils.getDefinedObjects(host, pumpForget, sa)) {
if (sa.hasParam("ForgetObjects")) {
for (final Object o : AbilityUtils.getDefinedObjects(host, sa.getParam("ForgetObjects"), sa)) {
host.removeRemembered(o);
}
}
if (sa.hasParam("ImprintCards")) {
pumpImprint = sa.getParam("ImprintCards");
}
if (pumpImprint != null) {
for (final Card c : AbilityUtils.getDefinedCards(host, pumpImprint, sa)) {
if (sa.hasParam("ImprintCards")) {
for (final Card c : AbilityUtils.getDefinedCards(host, sa.getParam("ImprintCards"), sa)) {
host.addImprintedCard(c);
}
}

View File

@@ -1771,6 +1771,16 @@ public class CardProperty {
}
}
return false;
} else if (property.startsWith("Triggered")) {
if (spellAbility instanceof SpellAbility) {
final String key = property.substring(9);
CardCollection cc = (CardCollection) ((SpellAbility)spellAbility).getTriggeringObject(AbilityKey.fromString(key));
if (cc == null || !cc.contains(card)) {
return false;
}
} else {
return false;
}
} else if (property.startsWith("NotTriggered")) {
final String key = property.substring("NotTriggered".length());
if (spellAbility instanceof SpellAbility) {

View File

@@ -5,6 +5,7 @@ import java.util.Map;
import forge.game.ability.AbilityKey;
import forge.game.card.Card;
import forge.game.card.CardCollection;
import forge.game.card.CardLists;
import forge.game.spellability.SpellAbility;
import forge.util.Localizer;
@@ -22,6 +23,9 @@ public class TriggerDiscardedAll extends Trigger {
if (!matchesValidParam("ValidCause", runParams.get(AbilityKey.Cause))) {
return false;
}
if (!matchesValidParam("ValidCard", runParams.get(AbilityKey.Cards))) {
return false;
}
if (hasParam("FirstTime")) {
if (!(boolean) runParams.get(AbilityKey.FirstTime)) {
@@ -33,7 +37,11 @@ public class TriggerDiscardedAll extends Trigger {
@Override
public void setTriggeringObjects(SpellAbility sa, Map<AbilityKey, Object> runParams) {
final CardCollection cards = (CardCollection) runParams.get(AbilityKey.Cards);
CardCollection cards = (CardCollection) runParams.get(AbilityKey.Cards);
if (hasParam("ValidCard")) {
cards = CardLists.getValidCards(cards, getParam("ValidCard"), getHostCard().getController(), getHostCard(), this);
}
sa.setTriggeringObject(AbilityKey.Cards, cards);
sa.setTriggeringObject(AbilityKey.Amount, cards.size());

View File

@@ -560,13 +560,6 @@ public class TriggerHandler {
host.addRemembered(triggeredCard);
}
if (regtrig.hasParam("RememberTriggeringCards")) {
CardCollection triggeringCards = ((CardCollection) sa.getTriggeringObject(AbilityKey.Cards));
for (Card c : triggeringCards) {
host.addRemembered(c);
}
}
if (regtrig.hasParam("RememberKey")) {
host.addRemembered(runParams.get(AbilityKey.fromString(regtrig.getParam("RememberKey"))));
}

View File

@@ -11,7 +11,7 @@ ALTERNATE
Name:Bring to Life
ManaCost:2 U
Types:Sorcery Adventure
A:SP$ Animate | Cost$ 2 U | ValidTgts$ Artifact.nonCreature+YouCtrl | TgtPrompt$ Select noncreature artifact | Power$ 0 | Toughness$ 0 | Types$ Artifact,Creature | RemoveCardTypes$ True | Duration$ Permanent | SubAbility$ DBPutCounter | SpellDescription$ Target noncreature artifact you control becomes a 0/0 artifact creature. Put four +1/+1 counters on it.
A:SP$ Animate | Cost$ 2 U | ValidTgts$ Artifact.nonCreature+YouCtrl | TgtPrompt$ Select noncreature artifact | Power$ 0 | Toughness$ 0 | Types$ Artifact,Creature | Duration$ Permanent | SubAbility$ DBPutCounter | SpellDescription$ Target noncreature artifact you control becomes a 0/0 artifact creature. Put four +1/+1 counters on it.
SVar:DBPutCounter:DB$ PutCounter | Defined$ Targeted | CounterType$ P1P1 | CounterNum$ 4
DeckHas:Ability$Counters
Oracle:Target noncreature artifact you control becomes a 0/0 artifact creature. Put four +1/+1 counters on it.

View File

@@ -2,6 +2,6 @@ Name:Ashnod's Transmogrant
ManaCost:1
Types:Artifact
A:AB$ PutCounter | Cost$ T Sac<1/CARDNAME> | ValidTgts$ Creature.nonArtifact | TgtPrompt$ Select target nonartifact creature | CounterType$ P1P1 | CounterNum$ 1 | SubAbility$ DBAnimate | SpellDescription$ Put a +1/+1 counter on target nonartifact creature. That creature becomes an artifact in addition to its other types.
SVar:DBAnimate:DB$Animate | Defined$ Targeted | Types$ Artifact | Duration$ Permanent
SVar:DBAnimate:DB $Animate | Defined$ Targeted | Types$ Artifact | Duration$ Permanent
SVar:Picture:http://www.wizards.com/global/images/magic/general/ashnods_transmogrant.jpg
Oracle:{T}, Sacrifice Ashnod's Transmogrant: Put a +1/+1 counter on target nonartifact creature. That creature becomes an artifact in addition to its other types.

View File

@@ -4,10 +4,9 @@ Types:Creature Human Shaman
PT:2/2
T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ TrigDraw | TriggerDescription$ Whenever CARDNAME attacks, you may pay {1} and discard a card. If you do, draw a card.
SVar:TrigDraw:AB$ Draw | Cost$ 1 Discard<1/Card>
T:Mode$ DiscardedAll | ValidPlayer$ You | ValidCard$ Card.nonLand | TriggerZones$ Battlefield | Execute$ TrigEffect | RememberTriggeringCards$ True | TriggerDescription$ Whenever you discard one or more nonland cards, you may exile one of them from your graveyard. If you do, you may cast it this turn.
SVar:TrigEffect:AB$ Effect | Cost$ ExileFromGrave<1/Card.IsRemembered> | RememberObjects$ ExiledCards | StaticAbilities$ MayCast | ExileOnMoved$ Stack | SubAbility$ DBCleanup
T:Mode$ DiscardedAll | ValidPlayer$ You | ValidCard$ Card.nonLand | TriggerZones$ Battlefield | Execute$ TrigEffect | TriggerDescription$ Whenever you discard one or more nonland cards, you may exile one of them from your graveyard. If you do, you may cast it this turn.
SVar:TrigEffect:AB$ Effect | Cost$ ExileFromGrave<1/Card.TriggeredCards> | RememberObjects$ ExiledCards | StaticAbilities$ MayCast | ExileOnMoved$ Stack
SVar:MayCast:Mode$ Continuous | Affected$ Card.IsRemembered | MayPlay$ True | EffectZone$ Command | AffectedZone$ Exile | Description$ You may cast this spell this turn.
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:HasAttackEffect:TRUE
DeckHas:Ability$Discard
Oracle:Whenever Conspiracy Theorist attacks, you may pay {1} and discard a card. If you do, draw a card.\nWhenever you discard one or more nonland cards, you may exile one of them from your graveyard. If you do, you may cast it this turn.

View File

@@ -2,7 +2,7 @@ Name:Ensouled Scimitar
ManaCost:3
Types:Artifact Equipment
K:Equip:2
A:AB$ Animate | Cost$ 3 | Defined$ Self | Power$ 1 | Toughness$ 5 | Types$ Creature,Artifact,Spirit | Keywords$ Flying | RemoveCardTypes$ True | RemoveCreatureTypes$ True | SpellDescription$ CARDNAME becomes a 1/5 Spirit artifact creature with flying until end of turn. (Equipment that's a creature can't equip a creature.)
A:AB$ Animate | Cost$ 3 | Defined$ Self | Power$ 1 | Toughness$ 5 | Types$ Creature,Artifact,Spirit | Keywords$ Flying | RemoveCreatureTypes$ True | SpellDescription$ CARDNAME becomes a 1/5 Spirit artifact creature with flying until end of turn. (Equipment that's a creature can't equip a creature.)
S:Mode$ Continuous | Affected$ Card.EquippedBy | AddPower$ 1 | AddToughness$ 5 | Description$ Equipped creature gets +1/+5.
SVar:Picture:http://www.wizards.com/global/images/magic/general/ensouled_scimitar.jpg
Oracle:{3}: Ensouled Scimitar becomes a 1/5 Spirit artifact creature with flying until end of turn. (Equipment that's a creature can't equip a creature.)\nEquipped creature gets +1/+5.\nEquip {2} ({2}: Attach to target creature you control. Equip only as a sorcery.)

View File

@@ -3,7 +3,7 @@ ManaCost:2 W
Types:Enchantment
T:Mode$ SpellCast | ValidCard$ Creature | ValidActivatingPlayer$ Opponent | TriggerZones$ Battlefield | IsPresent$ Card.Self+Enchantment | Execute$ TrigAnimate | TriggerDescription$ When an opponent casts a creature spell, if CARDNAME is an enchantment, CARDNAME becomes a 2/4 Soldier creature.
A:AB$ Animate | Cost$ 0 | Defined$ Self | Types$ Enchantment | RemoveCardTypes$ True | Duration$ Permanent | SpellDescription$ CARDNAME becomes an enchantment.
SVar:TrigAnimate:DB$Animate | Defined$ Self | Power$ 2 | Toughness$ 4 | Types$ Creature,Soldier | RemoveCardTypes$ True | Duration$ Permanent
SVar:TrigAnimate:DB$ Animate | Defined$ Self | Power$ 2 | Toughness$ 4 | Types$ Creature,Soldier | RemoveCardTypes$ True | Duration$ Permanent
AI:RemoveDeck:All
SVar:Picture:http://www.wizards.com/global/images/magic/general/opal_acrolith.jpg
Oracle:Whenever an opponent casts a creature spell, if Opal Acrolith is an enchantment, Opal Acrolith becomes a 2/4 Soldier creature.\n{0}: Opal Acrolith becomes an enchantment.