From d01d9d486fee4fd97e001dc17ebeec6c0e7c5aeb Mon Sep 17 00:00:00 2001 From: tool4ever Date: Mon, 24 Jul 2023 09:17:25 +0200 Subject: [PATCH] Support Faramir, Prince of Ithilien (#3520) * Fix Curse of Vitality * Support Faramir, Prince of Ithilien * Fix cards --------- Co-authored-by: tool4EvEr --- .../java/forge/game/ability/effects/LifeGainEffect.java | 8 +------- .../src/main/java/forge/game/player/PlayerProperty.java | 6 ++++++ forge-gui/res/cardsfolder/a/ajanis_last_stand.txt | 4 ++-- forge-gui/res/cardsfolder/h/hivis_of_the_scale.txt | 2 +- forge-gui/res/cardsfolder/k/kros_defense_contractor.txt | 6 +++--- .../res/cardsfolder/upcoming/shadow_of_the_enemy.txt | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/forge-game/src/main/java/forge/game/ability/effects/LifeGainEffect.java b/forge-game/src/main/java/forge/game/ability/effects/LifeGainEffect.java index 01952a587fd..e89d1025d0b 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/LifeGainEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/LifeGainEffect.java @@ -1,7 +1,5 @@ package forge.game.ability.effects; -import java.util.List; - import forge.game.ability.AbilityUtils; import forge.game.ability.SpellAbilityEffect; import forge.game.player.Player; @@ -44,10 +42,6 @@ public class LifeGainEffect extends SpellAbilityEffect { */ @Override public void resolve(SpellAbility sa) { - List tgtPlayers = getDefinedPlayersOrTargeted(sa); - if (tgtPlayers.isEmpty()) { - tgtPlayers.add(sa.getActivatingPlayer()); - } String amount = sa.getParam("LifeAmount"); boolean variableAmount = amount.equals("AFNotDrawnNum"); int lifeAmount = 0; @@ -57,7 +51,7 @@ public class LifeGainEffect extends SpellAbilityEffect { lifeAmount = AbilityUtils.calculateAmount(sa.getHostCard(), amount, sa); } - for (final Player p : tgtPlayers) { + for (final Player p : getDefinedPlayersOrTargeted(sa)) { if (!p.isInGame()) { continue; } diff --git a/forge-game/src/main/java/forge/game/player/PlayerProperty.java b/forge-game/src/main/java/forge/game/player/PlayerProperty.java index e7eba207801..18ae37cadaa 100644 --- a/forge-game/src/main/java/forge/game/player/PlayerProperty.java +++ b/forge-game/src/main/java/forge/game/player/PlayerProperty.java @@ -6,6 +6,8 @@ import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; +import com.google.common.collect.Iterables; + import forge.game.CardTraitBase; import forge.game.Game; import forge.game.ability.AbilityUtils; @@ -404,6 +406,10 @@ public class PlayerProperty { } } return false; + } else if (property.equals("attackedYouTheirCurrentTurn")) { + if (!Iterables.contains(player.getAttackedPlayersMyTurn(), sourceController)) { + return false; + } } else if (property.equals("attackedYouTheirLastTurn")) { if (!player.getAttackedPlayersMyLastTurn().contains(sourceController)) { return false; diff --git a/forge-gui/res/cardsfolder/a/ajanis_last_stand.txt b/forge-gui/res/cardsfolder/a/ajanis_last_stand.txt index 1a28002bb1c..0bda956e990 100644 --- a/forge-gui/res/cardsfolder/a/ajanis_last_stand.txt +++ b/forge-gui/res/cardsfolder/a/ajanis_last_stand.txt @@ -3,6 +3,6 @@ ManaCost:2 W W Types:Enchantment T:Mode$ ChangesZone | ValidCard$ Creature.YouCtrl,Planeswalker.YouCtrl | Origin$ Battlefield | Destination$ Graveyard | Execute$ TrigDiesToken | TriggerZones$ Battlefield | TriggerDescription$ Whenever a creature or planeswalker you control dies, you may sacrifice CARDNAME. If you do, create a 4/4 white Avatar creature token with flying. SVar:TrigDiesToken:AB$ Token | Cost$ Sac<1/CARDNAME> | TokenOwner$ You | TokenAmount$ 1 | TokenScript$ w_4_4_avatar_flying -T:Mode$ Discarded | ValidCard$ Card.Self | ValidCause$ Card.OppCtrl | Execute$ TrigDiscardedToken | TriggerZones$ Battlefield | TriggerDescription$ When a spell or ability an opponent controls causes you to discard this card, if you control a Plains, create a 4/4 white Avatar creature token with flying. -SVar:TrigDiscardedToken:DB$ Token | ConditionPresent$ Plains.YouCtrl | ConditionCompare$ GE1 | TokenOwner$ You | TokenAmount$ 1 | TokenScript$ w_4_4_avatar_flying +T:Mode$ Discarded | ValidCard$ Card.Self | ValidCause$ Card.OppCtrl | IsPresent$ Plains.YouCtrl | Execute$ TrigDiscardedToken | TriggerZones$ Battlefield | TriggerDescription$ When a spell or ability an opponent controls causes you to discard this card, if you control a Plains, create a 4/4 white Avatar creature token with flying. +SVar:TrigDiscardedToken:DB$ Token | TokenOwner$ You | TokenAmount$ 1 | TokenScript$ w_4_4_avatar_flying Oracle:Whenever a creature or planeswalker you control dies, you may sacrifice Ajani's Last Stand. If you do, create a 4/4 white Avatar creature token with flying.\nWhen a spell or ability an opponent controls causes you to discard this card, if you control a Plains, create a 4/4 white Avatar creature token with flying. diff --git a/forge-gui/res/cardsfolder/h/hivis_of_the_scale.txt b/forge-gui/res/cardsfolder/h/hivis_of_the_scale.txt index eb368aa7479..1f4183d63b0 100644 --- a/forge-gui/res/cardsfolder/h/hivis_of_the_scale.txt +++ b/forge-gui/res/cardsfolder/h/hivis_of_the_scale.txt @@ -3,6 +3,6 @@ ManaCost:3 R R Types:Legendary Creature Viashino Shaman PT:3/4 K:You may choose not to untap CARDNAME during your untap step. -A:AB$ GainControl | Cost$ T | ValidTgts$ Dragon | TgtPrompt$ Select target Dragon. | LoseControl$ Untap,LeavesPlay,LoseControl | SpellDescription$ Gain control of target Dragon for as long as you control CARDNAME and CARDNAME remains tapped. +A:AB$ GainControl | Cost$ T | ValidTgts$ Dragon | TgtPrompt$ Select target Dragon. | LoseControl$ Untap,LeavesPlay,LoseControl | SpellDescription$ Gain control of target Dragon for as long as you control NICKNAME and NICKNAME remains tapped. AI:RemoveDeck:Random Oracle:You may choose not to untap Hivis of the Scale during your untap step.\n{T}: Gain control of target Dragon for as long as you control Hivis and Hivis remains tapped. diff --git a/forge-gui/res/cardsfolder/k/kros_defense_contractor.txt b/forge-gui/res/cardsfolder/k/kros_defense_contractor.txt index ef58573c7a5..7156be3eefa 100644 --- a/forge-gui/res/cardsfolder/k/kros_defense_contractor.txt +++ b/forge-gui/res/cardsfolder/k/kros_defense_contractor.txt @@ -5,9 +5,9 @@ PT:2/4 T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigPutCounter | TriggerDescription$ At the beginning of your upkeep, put a shield counter on target creature an opponent controls. SVar:TrigPutCounter:DB$ PutCounter | ValidTgts$ Creature.OppCtrl | TgtPrompt$ Select target creature an opponent controls | CounterType$ SHIELD | AILogic$ Curse T:Mode$ CounterPlayerAddedAll | ValidObject$ Creature.YouDontCtrl+inRealZoneBattlefield | ValidSource$ You | TriggerZones$ Battlefield | Execute$ TrigTap | TriggerDescription$ Whenever you put one or more counters on a creature you don't control, tap that creature and goad it. It gains trample until your next turn. (Until your next turn, that creature attacks each combat if able and attacks a player other than you if able.) -SVar:TrigTap:DB$ Tap | Defined$ TriggeredCardLKICopy | SubAbility$ DBGoad -SVar:DBGoad:DB$ Goad | Defined$ TriggeredCardLKICopy | SubAbility$ DBPump -SVar:DBPump:DB$ Pump | Defined$ TriggeredCardLKICopy | KW$ Trample | Duration$ UntilYourNextTurn +SVar:TrigTap:DB$ Tap | Defined$ TriggeredObjectLKICopy | SubAbility$ DBGoad +SVar:DBGoad:DB$ Goad | Defined$ TriggeredObjectLKICopy | SubAbility$ DBPump +SVar:DBPump:DB$ Pump | Defined$ TriggeredObjectLKICopy | KW$ Trample | Duration$ UntilYourNextTurn #Card doesn't make sense to run unless you have 2 or more opponents AI:RemoveDeck:Random Oracle:At the beginning of your upkeep, put a shield counter on target creature an opponent controls.\nWhenever you put one or more counters on a creature you don't control, tap that creature and goad it. It gains trample until your next turn. (Until your next turn, that creature attacks each combat if able and attacks a player other than you if able.) diff --git a/forge-gui/res/cardsfolder/upcoming/shadow_of_the_enemy.txt b/forge-gui/res/cardsfolder/upcoming/shadow_of_the_enemy.txt index 9a9d8ad4ac8..c1f3bc1cef2 100644 --- a/forge-gui/res/cardsfolder/upcoming/shadow_of_the_enemy.txt +++ b/forge-gui/res/cardsfolder/upcoming/shadow_of_the_enemy.txt @@ -2,7 +2,7 @@ Name:Shadow of the Enemy ManaCost:3 B B B Types:Sorcery Oracle: -A:SP$ ChangeZoneAll | Cost$ 2 B | Origin$ Graveyard | Destination$ Exile | ValidTgts$ Player | TgtPrompt$ Select target player | ChangeType$ Creature | RememberChanged$ True | SubAbility$ DBMayPlay | SpellDescription$ Exile all creature cards from target player's graveyard. You may cast spells from among those cards for as long as they remain exiled, and mana of any type can be spent to cast them. +A:SP$ ChangeZoneAll | Origin$ Graveyard | Destination$ Exile | ValidTgts$ Player | TgtPrompt$ Select target player | ChangeType$ Creature | RememberChanged$ True | SubAbility$ DBMayPlay | SpellDescription$ Exile all creature cards from target player's graveyard. You may cast spells from among those cards for as long as they remain exiled, and mana of any type can be spent to cast them. SVar:DBMayPlay:DB$ Effect | RememberObjects$ RememberedCard | StaticAbilities$ MayPlay | SubAbility$ DBCleanup | Duration$ Permanent | ForgetOnMoved$ Exile SVar:MayPlay:Mode$ Continuous | MayPlay$ True | MayPlayIgnoreType$ True | EffectZone$ Command | Affected$ Card.IsRemembered+nonLand | AffectedZone$ Exile | Description$ You may cast spells from among those cards for as long as they remain exiled, and mana of any type can be spent to cast them. SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True