improve Fight stuff

This commit is contained in:
Northmoc
2023-02-13 15:27:08 -05:00
parent 998eecc923
commit 1003f8272f
6 changed files with 30 additions and 13 deletions

View File

@@ -1251,6 +1251,13 @@ public class AbilityUtils {
else if (defined.startsWith("NextPlayerToYour")) { else if (defined.startsWith("NextPlayerToYour")) {
Direction dir = defined.substring(16).equals("Left") ? Direction.Left : Direction.Right; Direction dir = defined.substring(16).equals("Left") ? Direction.Left : Direction.Right;
players.add(game.getNextPlayerAfter(player, dir)); 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 { else {
// will be filtered below // will be filtered below

View File

@@ -10,12 +10,14 @@ import forge.game.GameEntityCounterTable;
import forge.game.ability.AbilityKey; import forge.game.ability.AbilityKey;
import forge.game.ability.AbilityUtils; import forge.game.ability.AbilityUtils;
import forge.game.card.Card; import forge.game.card.Card;
import forge.game.card.CardCollection;
import forge.game.card.CardDamageMap; import forge.game.card.CardDamageMap;
import forge.game.player.Player; import forge.game.player.Player;
import forge.game.replacement.ReplacementType; import forge.game.replacement.ReplacementType;
import forge.game.spellability.SpellAbility; import forge.game.spellability.SpellAbility;
import forge.game.trigger.TriggerType; import forge.game.trigger.TriggerType;
import forge.util.CardTranslation; import forge.util.CardTranslation;
import forge.util.Lang;
import forge.util.Localizer; import forge.util.Localizer;
public class FightEffect extends DamageBaseEffect { public class FightEffect extends DamageBaseEffect {
@@ -30,10 +32,17 @@ public class FightEffect extends DamageBaseEffect {
List<Card> fighters = getFighters(sa); List<Card> fighters = getFighters(sa);
if (fighters.size() > 1) { 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) { 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(); return sb.toString();
} }
@@ -117,8 +126,9 @@ public class FightEffect extends DamageBaseEffect {
if (defined.size() > 1 && fighter1 == null) { if (defined.size() > 1 && fighter1 == null) {
fighter1 = defined.get(0); fighter1 = defined.get(0);
fighter2 = defined.get(1); fighter2 = defined.get(1);
} else { } else { // template often Defined$ ParentTarget vs. Targeted - this yields good StackDesc order
fighter2 = defined.get(0); fighter2 = fighter1;
fighter1 = defined.get(0);
} }
} }
} else if (tgts.size() > 1) { } else if (tgts.size() > 1) {

View File

@@ -1,7 +1,7 @@
Name:Barroom Brawl Name:Barroom Brawl
ManaCost:1 G ManaCost:1 G
Types:Sorcery 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. 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 NextPlayerToYourLeft | TgtPrompt$ Choose target creature controlled by the opponent to your left | SubAbility$ DBCopy 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$ NextPlayerToYourLeft | Optional$ True | AILogic$ ChainOfAcid | StackDescription$ None | MayChooseTarget$ True 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. 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.

View File

@@ -1,6 +1,6 @@
Name:Prey Upon Name:Prey Upon
ManaCost:G ManaCost:G
Types:Sorcery 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.) 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$ 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.) 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.) Oracle:Target creature you control fights target creature you don't control. (Each deals damage equal to its power to the other.)

View File

@@ -2,7 +2,7 @@ Name:Ulvenwald Tracker
ManaCost:G ManaCost:G
Types:Creature Human Shaman Types:Creature Human Shaman
PT:1/1 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. 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$ Choose target creature to fight the first target 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 AI:RemoveDeck:All
Oracle:{1}{G}, {T}: Target creature you control fights another target creature. Oracle:{1}{G}, {T}: Target creature you control fights another target creature.

View File

@@ -2,6 +2,6 @@ Name:Unnatural Aggression
ManaCost:2 G ManaCost:2 G
Types:Instant Types:Instant
K:Devoid 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. 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$ Targeted | TgtPrompt$ Choose target creature an opponent controls to fight the first target 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. 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.