diff --git a/forge-game/src/main/java/forge/game/ability/AbilityUtils.java b/forge-game/src/main/java/forge/game/ability/AbilityUtils.java index 80efbb9c9da..f86b65f196e 100644 --- a/forge-game/src/main/java/forge/game/ability/AbilityUtils.java +++ b/forge-game/src/main/java/forge/game/ability/AbilityUtils.java @@ -1251,6 +1251,13 @@ public class AbilityUtils { else if (defined.startsWith("NextPlayerToYour")) { Direction dir = defined.substring(16).equals("Left") ? Direction.Left : Direction.Right; players.add(game.getNextPlayerAfter(player, dir)); + } else if (defined.startsWith("NextOpponentToYour")) { + Direction dir = defined.substring(18).equals("Left") ? Direction.Left : Direction.Right; + Player next = game.getNextPlayerAfter(player, dir); + while (!next.isOpponentOf(player)) { + next = game.getNextPlayerAfter(next, dir); + } + players.add(next); } else { // will be filtered below diff --git a/forge-game/src/main/java/forge/game/ability/effects/FightEffect.java b/forge-game/src/main/java/forge/game/ability/effects/FightEffect.java index 2b96aa56a4d..84fdb37795c 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/FightEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/FightEffect.java @@ -10,12 +10,14 @@ import forge.game.GameEntityCounterTable; import forge.game.ability.AbilityKey; import forge.game.ability.AbilityUtils; import forge.game.card.Card; +import forge.game.card.CardCollection; import forge.game.card.CardDamageMap; import forge.game.player.Player; import forge.game.replacement.ReplacementType; import forge.game.spellability.SpellAbility; import forge.game.trigger.TriggerType; import forge.util.CardTranslation; +import forge.util.Lang; import forge.util.Localizer; public class FightEffect extends DamageBaseEffect { @@ -30,10 +32,17 @@ public class FightEffect extends DamageBaseEffect { List fighters = getFighters(sa); if (fighters.size() > 1) { - sb.append(fighters.get(0)).append(" fights ").append(fighters.get(1)); + sb.append(fighters.get(0)).append(" fights ").append(fighters.get(1)).append("."); } else if (fighters.size() == 1) { - sb.append(fighters.get(0)).append(" fights unknown"); + sb.append(fighters.get(0)).append(" fights."); + } + if (sa.hasParam("ReplaceDyingDefined")) { + CardCollection cards = AbilityUtils.getDefinedCards(sa.getHostCard(), sa.getParam("ReplaceDyingDefined"), sa); + if (!cards.isEmpty()) { + sb.append(" If ").append(Lang.joinHomogenous(cards, null, "or")); + sb.append(" would die this turn, exile it instead."); + } } return sb.toString(); } @@ -117,8 +126,9 @@ public class FightEffect extends DamageBaseEffect { if (defined.size() > 1 && fighter1 == null) { fighter1 = defined.get(0); fighter2 = defined.get(1); - } else { - fighter2 = defined.get(0); + } else { // template often Defined$ ParentTarget vs. Targeted - this yields good StackDesc order + fighter2 = fighter1; + fighter1 = defined.get(0); } } } else if (tgts.size() > 1) { diff --git a/forge-gui/res/cardsfolder/b/barroom_brawl.txt b/forge-gui/res/cardsfolder/b/barroom_brawl.txt index 3929fda1fa0..9c3a8c36eff 100644 --- a/forge-gui/res/cardsfolder/b/barroom_brawl.txt +++ b/forge-gui/res/cardsfolder/b/barroom_brawl.txt @@ -1,7 +1,7 @@ Name:Barroom Brawl ManaCost:1 G Types:Sorcery -A:SP$ Pump | ValidTgts$ Creature.YouCtrl | AILogic$ Fight | TgtPrompt$ Choose target creature you control | SubAbility$ DBFight | SpellDescription$ SpellDescription$ Target creature you control fights target creature the opponent to your left controls. Then that player may copy this spell and may choose new targets for the copy. -SVar:DBFight:DB$ Fight | Defined$ ParentTarget | ValidTgts$ Creature.ControlledBy NextPlayerToYourLeft | TgtPrompt$ Choose target creature controlled by the opponent to your left | SubAbility$ DBCopy -SVar:DBCopy:DB$ CopySpellAbility | Defined$ Parent | Controller$ NextPlayerToYourLeft | Optional$ True | AILogic$ ChainOfAcid | StackDescription$ None | MayChooseTarget$ True +A:SP$ Pump | ValidTgts$ Creature.YouCtrl | AILogic$ Fight | TgtPrompt$ Select target creature you control | SubAbility$ DBFight | StackDescription$ None +SVar:DBFight:DB$ Fight | Defined$ ParentTarget | ValidTgts$ Creature.ControlledBy NextOpponentToYourLeft | TgtPrompt$ Select target creature controlled by the opponent to your left | SubAbility$ DBCopy | SpellDescription$ Target creature you control fights target creature the opponent to your left controls. +SVar:DBCopy:DB$ CopySpellAbility | Defined$ Parent | Controller$ NextOpponentToYourLeft | Optional$ True | AILogic$ ChainOfAcid | StackDescription$ None | MayChooseTarget$ True | StackDescription$ REP that player_{p:NextPlayerToYourLeft} | SpellDescription$ Then that player may copy this spell and may choose new targets for the copy. Oracle:Target creature you control fights target creature the opponent to your left controls. Then that player may copy this spell and may choose new targets for the copy. diff --git a/forge-gui/res/cardsfolder/p/prey_upon.txt b/forge-gui/res/cardsfolder/p/prey_upon.txt index dd42d714b8b..50f3bebe806 100644 --- a/forge-gui/res/cardsfolder/p/prey_upon.txt +++ b/forge-gui/res/cardsfolder/p/prey_upon.txt @@ -1,6 +1,6 @@ Name:Prey Upon ManaCost:G Types:Sorcery -A:SP$ Pump | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Choose target creature you control | SubAbility$ DBFight | StackDescription$ Target creature you control [{c:ThisTargetedCard}] | SpellDescription$ Target creature you control fights target creature you don't control. (Each deals damage equal to its power to the other.) -SVar:DBFight:DB$ Fight | Defined$ ParentTarget | ValidTgts$ Creature.YouDontCtrl | TgtPrompt$ Choose target creature you don't control | StackDescription$ fights target creature you don't control [{c:ThisTargetedCard}]. (Each deals damage equal to its power to the other.) +A:SP$ Pump | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Select target creature you control | SubAbility$ DBFight | StackDescription$ None +SVar:DBFight:DB$ Fight | Defined$ ParentTarget | ValidTgts$ Creature.YouDontCtrl | TgtPrompt$ Select target creature you don't control | SpellDescription$ Target creature you control fights target creature you don't control. (Each deals damage equal to its power to the other.) Oracle:Target creature you control fights target creature you don't control. (Each deals damage equal to its power to the other.) diff --git a/forge-gui/res/cardsfolder/u/ulvenwald_tracker.txt b/forge-gui/res/cardsfolder/u/ulvenwald_tracker.txt index 97394be3e3d..cdd07d0b52a 100644 --- a/forge-gui/res/cardsfolder/u/ulvenwald_tracker.txt +++ b/forge-gui/res/cardsfolder/u/ulvenwald_tracker.txt @@ -2,7 +2,7 @@ Name:Ulvenwald Tracker ManaCost:G Types:Creature Human Shaman PT:1/1 -A:AB$ Pump | Cost$ 1 G T | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Choose target creature you control | SubAbility$ TrackerFight | StackDescription$ None | SpellDescription$ Target creature you control fights another target creature. -SVar:TrackerFight:DB$ Fight | Defined$ ParentTarget | ValidTgts$ Creature | TargetUnique$ True | TgtPrompt$ Choose target creature to fight the first target +A:AB$ Pump | Cost$ 1 G T | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Select target creature you control | SubAbility$ TrackerFight | StackDescription$ None +SVar:TrackerFight:DB$ Fight | Defined$ ParentTarget | ValidTgts$ Creature | TargetUnique$ True | TgtPrompt$ Select another target creature | SpellDescription$ Target creature you control fights another target creature. AI:RemoveDeck:All Oracle:{1}{G}, {T}: Target creature you control fights another target creature. diff --git a/forge-gui/res/cardsfolder/u/unnatural_aggression.txt b/forge-gui/res/cardsfolder/u/unnatural_aggression.txt index f4fbd24dac4..880c9cce868 100644 --- a/forge-gui/res/cardsfolder/u/unnatural_aggression.txt +++ b/forge-gui/res/cardsfolder/u/unnatural_aggression.txt @@ -2,6 +2,6 @@ Name:Unnatural Aggression ManaCost:2 G Types:Instant K:Devoid -A:SP$ Pump | Cost$ 2 G | AILogic$ Fight | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Choose target creature you control | SubAbility$ DBFight | StackDescription$ None | SpellDescription$ Target creature you control fights target creature an opponent controls. If the creature an opponent controls would die this turn, exile it instead. -SVar:DBFight:DB$ Fight | Defined$ ParentTarget | ValidTgts$ Creature.OppCtrl | ReplaceDyingDefined$ Targeted | TgtPrompt$ Choose target creature an opponent controls to fight the first target +A:SP$ Pump | AILogic$ Fight | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Select target creature you control | SubAbility$ DBFight | StackDescription$ None | SpellDescription$ Target creature you control fights target creature an opponent controls. If the creature an opponent controls would die this turn, exile it instead. +SVar:DBFight:DB$ Fight | Defined$ ParentTarget | ValidTgts$ Creature.OppCtrl | ReplaceDyingDefined$ ThisTargetedCard | TgtPrompt$ Select target creature an opponent controls Oracle:Devoid (This card has no color.)\nTarget creature you control fights target creature an opponent controls. If the creature an opponent controls would die this turn, exile it instead.