mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 02:38:02 +00:00
WHO: idris_soul_of_the_tardis.txt + support
This commit is contained in:
@@ -233,9 +233,11 @@ public class StaticEffect {
|
||||
}
|
||||
|
||||
// remove abilities
|
||||
if (hasParam("AddAbility") || hasParam("GainsAbilitiesOf") || hasParam("GainsAbilitiesOfDefined")
|
||||
|| hasParam("AddTrigger") || hasParam("AddStaticAbility") || hasParam("AddReplacementEffects")
|
||||
|| hasParam("RemoveAllAbilities") || hasParam("RemoveLandTypes")) {
|
||||
if (hasParam("AddAbility") || hasParam("GainsAbilitiesOf")
|
||||
|| hasParam("GainsAbilitiesOfDefined") || hasParam("GainsTriggerAbsOf")
|
||||
|| hasParam("AddTrigger") || hasParam("AddStaticAbility")
|
||||
|| hasParam("AddReplacementEffects") || hasParam("RemoveAllAbilities")
|
||||
|| hasParam("RemoveLandTypes")) {
|
||||
affectedCard.removeChangedCardTraits(getTimestamp(), ability.getId());
|
||||
}
|
||||
|
||||
|
||||
@@ -4515,6 +4515,16 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
||||
return result;
|
||||
}
|
||||
|
||||
public final Trigger addTriggerForStaticAbility(final Trigger trig, final StaticAbility stAb) {
|
||||
String str = trig.toString() + trig.getId();
|
||||
Trigger result = storedTrigger.get(stAb, str);
|
||||
if (result == null) {
|
||||
result = trig.copy(this, false);
|
||||
storedTrigger.put(stAb, str, result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setStoredReplacements(Table<StaticAbility, String, ReplacementEffect> table) {
|
||||
storedReplacementEffect.clear();
|
||||
for (Table.Cell<StaticAbility, String, ReplacementEffect> c : table.cellSet()) {
|
||||
|
||||
@@ -145,11 +145,9 @@ public class StaticAbility extends CardTraitBase implements IIdentifiable, Clone
|
||||
layers.add(StaticAbilityLayer.COLOR);
|
||||
}
|
||||
|
||||
if (hasParam("RemoveAllAbilities") || hasParam("GainsAbilitiesOf") || hasParam("GainsAbilitiesOfDefined")) {
|
||||
layers.add(StaticAbilityLayer.ABILITIES);
|
||||
}
|
||||
|
||||
if (hasParam("AddKeyword") || hasParam("AddAbility")
|
||||
if (hasParam("RemoveAllAbilities") || hasParam("GainsAbilitiesOf")
|
||||
|| hasParam("GainsAbilitiesOfDefined") || hasParam("GainsTriggerAbsOf")
|
||||
|| hasParam("AddKeyword") || hasParam("AddAbility")
|
||||
|| hasParam("AddTrigger") || hasParam("RemoveTriggers")
|
||||
|| hasParam("RemoveKeyword") || hasParam("AddReplacementEffects")
|
||||
|| hasParam("AddStaticAbility") || hasParam("AddSVar")
|
||||
|
||||
@@ -816,23 +816,10 @@ public final class StaticAbilityContinuous {
|
||||
}
|
||||
|
||||
if (params.containsKey("GainsAbilitiesOf") || params.containsKey("GainsAbilitiesOfDefined")) {
|
||||
CardCollection cardsIGainedAbilitiesFrom = new CardCollection();
|
||||
CardCollection cards = cardsGainedFrom(params.containsKey("GainsAbilitiesOfDefined") ?
|
||||
"GainsAbilitiesOfDefined" : "GainsAbilitiesOf", params, hostCard, stAb, game);
|
||||
|
||||
if (params.containsKey("GainsAbilitiesOf")) {
|
||||
final String[] valids = params.get("GainsAbilitiesOf").split(",");
|
||||
List<ZoneType> validZones;
|
||||
if (params.containsKey("GainsAbilitiesOfZones")) {
|
||||
validZones = ZoneType.listValueOf(params.get("GainsAbilitiesOfZones"));
|
||||
} else {
|
||||
validZones = ImmutableList.of(ZoneType.Battlefield);
|
||||
}
|
||||
cardsIGainedAbilitiesFrom.addAll(CardLists.getValidCards(game.getCardsIn(validZones), valids, hostCard.getController(), hostCard, stAb));
|
||||
}
|
||||
if (params.containsKey("GainsAbilitiesOfDefined")) {
|
||||
cardsIGainedAbilitiesFrom.addAll(AbilityUtils.getDefinedCards(hostCard, params.get("GainsAbilitiesOfDefined"), stAb));
|
||||
}
|
||||
|
||||
for (Card c : cardsIGainedAbilitiesFrom) {
|
||||
for (Card c : cards) {
|
||||
for (SpellAbility sa : c.getSpellAbilities()) {
|
||||
if (sa.isActivatedAbility()) {
|
||||
if (!stAb.matchesValidParam("GainsValidAbilities", sa)) {
|
||||
@@ -871,6 +858,17 @@ public final class StaticAbilityContinuous {
|
||||
}
|
||||
}
|
||||
|
||||
if (params.containsKey("GainsTriggerAbsOf")) {
|
||||
CardCollection cards = cardsGainedFrom("GainsTriggerAbsOf", params, hostCard, stAb, game);
|
||||
|
||||
for (Card c : cards) {
|
||||
for (final Trigger trig : c.getTriggers()) {
|
||||
final Trigger newTrigger = affectedCard.addTriggerForStaticAbility(trig, stAb);
|
||||
addedTrigger.add(newTrigger);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// add static abilities
|
||||
if (addStatics != null) {
|
||||
for (String s : addStatics) {
|
||||
@@ -1001,6 +999,24 @@ public final class StaticAbilityContinuous {
|
||||
sourceCard.addLeavesPlayCommand(removeIgnore);
|
||||
}
|
||||
|
||||
private static CardCollection cardsGainedFrom(final String param, final Map<String, String> params,
|
||||
final Card hostCard, final StaticAbility stAb, final Game game) {
|
||||
CardCollection cards = new CardCollection();
|
||||
if (param.contains("Defined")) {
|
||||
cards.addAll(AbilityUtils.getDefinedCards(hostCard, params.get(param), stAb));
|
||||
} else {
|
||||
final String[] valids = params.get(param).split(",");
|
||||
List<ZoneType> validZones;
|
||||
if (params.containsKey("GainsAbilitiesOfZones")) {
|
||||
validZones = ZoneType.listValueOf(params.get("GainsAbilitiesOfZones"));
|
||||
} else {
|
||||
validZones = ImmutableList.of(ZoneType.Battlefield);
|
||||
}
|
||||
cards.addAll(CardLists.getValidCards(game.getCardsIn(validZones), valids, hostCard.getController(), hostCard, stAb));
|
||||
}
|
||||
return cards;
|
||||
}
|
||||
|
||||
private static List<Player> getAffectedPlayers(final StaticAbility stAb) {
|
||||
final Map<String, String> params = stAb.getMapParams();
|
||||
final Card hostCard = stAb.getHostCard();
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
Name:Idris, Soul of the TARDIS
|
||||
ManaCost:1 U R
|
||||
Types:Legendary Creature Human Incarnation
|
||||
PT:3/3
|
||||
K:Vanishing:3
|
||||
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigExile | TriggerDescription$ When CARDNAME enters the battlefield, exile another artifact you control until NICKNAME leaves the battlefield.
|
||||
SVar:TrigExile:DB$ ChangeZone | ChangeType$ Artifact.Other+YouCtrl | SelectPrompt$ Select another artifact you control | ChangeNum$ 1 | Hidden$ True | Mandatory$ True | Origin$ Battlefield | Destination$ Exile | Duration$ UntilHostLeavesPlay
|
||||
S:Mode$ Continuous | Affected$ Card.Self | EffectZone$ Battlefield | GainsAbilitiesOf$ Card.ExiledWithSource | GainsTriggerAbsOf$ Card.ExiledWithSource | GainsAbilitiesOfZones$ Exile | AddPower$ X | AddToughness$ X | Description$ NICKNAME has all activated and triggered abilities of the exiled card and gets +X/+X, where X is the exiled card's mana value.
|
||||
SVar:X:Count$ValidExile Card.ExiledWithSource$CardManaCost
|
||||
DeckHas:Ability$Counters|Sacrifice
|
||||
DeckNeeds:Type$Artifact
|
||||
Oracle:Vanishing 3\nImprint — When Idris, Soul of the TARDIS enters the battlefield, exile another artifact you control until Idris leaves the battlefield.\nIdris has all activated and triggered abilities of the exiled card and gets +X/+X, where X is the exiled card's mana value.
|
||||
Reference in New Issue
Block a user