Merge branch 'melee' into 'master'

Fix Melee

See merge request core-developers/forge!6034
This commit is contained in:
Michael Kamensky
2022-01-11 16:21:06 +00:00
10 changed files with 17 additions and 11 deletions

View File

@@ -384,7 +384,14 @@ public class CombatUtil {
runParams.put(AbilityKey.OtherAttackers, otherAttackers); runParams.put(AbilityKey.OtherAttackers, otherAttackers);
runParams.put(AbilityKey.Attacked, combat.getDefenderByAttacker(c)); runParams.put(AbilityKey.Attacked, combat.getDefenderByAttacker(c));
runParams.put(AbilityKey.DefendingPlayer, combat.getDefenderPlayerByAttacker(c)); runParams.put(AbilityKey.DefendingPlayer, combat.getDefenderPlayerByAttacker(c));
runParams.put(AbilityKey.Defenders, combat.getDefenders()); // only add defenders that were attacked
final FCollection<GameEntity> defenders = new FCollection<>();
for (GameEntity e : combat.getDefenders()) {
if (!combat.getAttackersOf(e).isEmpty()) {
defenders.add(e);
}
}
runParams.put(AbilityKey.Defenders, defenders);
game.getTriggerHandler().runTrigger(TriggerType.Attacks, runParams, false); game.getTriggerHandler().runTrigger(TriggerType.Attacks, runParams, false);
} }

View File

@@ -103,7 +103,7 @@ public class TriggerAttacks extends Trigger {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
List<GameEntity> list = (List<GameEntity>) runParams.get(AbilityKey.Defenders); List<GameEntity> list = (List<GameEntity>) runParams.get(AbilityKey.Defenders);
for (GameEntity e : list) { for (GameEntity e : list) {
if ((e instanceof Player) && !e.equals(attacked)) { if (e instanceof Player && !e.equals(attacked)) {
found = true; found = true;
break; break;
} }

View File

@@ -5,6 +5,6 @@ PT:2/3
K:Flying K:Flying
T:Mode$ Phase | Phase$ End of Turn | TriggerZones$ Battlefield | Execute$ TrigPutCounter | TriggerDescription$ At the beginning of each end step, put a +1/+1 counter on Asmira, Holy Avenger for each creature put into your graveyard from the battlefield this turn. T:Mode$ Phase | Phase$ End of Turn | TriggerZones$ Battlefield | Execute$ TrigPutCounter | TriggerDescription$ At the beginning of each end step, put a +1/+1 counter on Asmira, Holy Avenger for each creature put into your graveyard from the battlefield this turn.
SVar:TrigPutCounter:DB$ PutCounter | Defined$ Self | CounterType$ P1P1 | CounterNum$ X SVar:TrigPutCounter:DB$ PutCounter | Defined$ Self | CounterType$ P1P1 | CounterNum$ X
SVar:X:Count$ThisTurnEntered_Graveyard_from_Battlefield_Creature.YouCtrl SVar:X:Count$ThisTurnEntered_Graveyard_from_Battlefield_Creature.YouOwn
SVar:Picture:http://www.wizards.com/global/images/magic/general/asmira_holy_avenger.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/asmira_holy_avenger.jpg
Oracle:Flying\nAt the beginning of each end step, put a +1/+1 counter on Asmira, Holy Avenger for each creature put into your graveyard from the battlefield this turn. Oracle:Flying\nAt the beginning of each end step, put a +1/+1 counter on Asmira, Holy Avenger for each creature put into your graveyard from the battlefield this turn.

View File

@@ -5,6 +5,6 @@ PT:2/2
K:Flash K:Flash
T:Mode$ ChangesZone | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigToken | TriggerDescription$ When CARDNAME enters the battlefield, create a 2/2 green Bear creature token for each nontoken creature put into your graveyard from the battlefield this turn. T:Mode$ ChangesZone | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigToken | TriggerDescription$ When CARDNAME enters the battlefield, create a 2/2 green Bear creature token for each nontoken creature put into your graveyard from the battlefield this turn.
SVar:TrigToken:DB$ Token | TokenAmount$ X | TokenOwner$ You | TokenScript$ g_2_2_bear | LegacyImage$ g 2 2 bear lgn SVar:TrigToken:DB$ Token | TokenAmount$ X | TokenOwner$ You | TokenScript$ g_2_2_bear | LegacyImage$ g 2 2 bear lgn
SVar:X:Count$ThisTurnEntered_Graveyard_from_Battlefield_Creature.nonToken+YouCtrl SVar:X:Count$ThisTurnEntered_Graveyard_from_Battlefield_Creature.nonToken+YouOwn
SVar:Picture:http://resources.wizards.com/magic/cards/lgn/en-us/card42187.jpg SVar:Picture:http://resources.wizards.com/magic/cards/lgn/en-us/card42187.jpg
Oracle:Flash\nWhen Caller of the Claw enters the battlefield, create a 2/2 green Bear creature token for each nontoken creature put into your graveyard from the battlefield this turn. Oracle:Flash\nWhen Caller of the Claw enters the battlefield, create a 2/2 green Bear creature token for each nontoken creature put into your graveyard from the battlefield this turn.

View File

@@ -3,7 +3,7 @@ ManaCost:B
Types:Creature Zombie Cat Types:Creature Zombie Cat
PT:1/1 PT:1/1
K:Menace K:Menace
A:AB$ PutCounter | Cost$ 2 B Sac<1/Creature.Other,Planeswalker.Other/another creature or planeswalker> | CounterType$ P1P1 | CounterNum$ 2 | AILogic$ AristocratCounters | SpellDescription$ Put two +1/+1 counters on CARDNAME. A:AB$ PutCounter | Cost$ 2 B Sac<1/Creature.Other;Planeswalker.Other/another creature or planeswalker> | CounterType$ P1P1 | CounterNum$ 2 | AILogic$ AristocratCounters | SpellDescription$ Put two +1/+1 counters on CARDNAME.
DeckHas:Ability$Counters DeckHas:Ability$Counters
SVar:AIPreference:SacCost$Creature.Other SVar:AIPreference:SacCost$Creature.Other
Oracle:Menace (This creature can't be blocked except by two or more creatures.)\n{2}{B}, Sacrifice another creature or planeswalker: Put two +1/+1 counters on Dreadmalkin. Oracle:Menace (This creature can't be blocked except by two or more creatures.)\n{2}{B}, Sacrifice another creature or planeswalker: Put two +1/+1 counters on Dreadmalkin.

View File

@@ -2,7 +2,7 @@ Name:Fresh Meat
ManaCost:3 G ManaCost:3 G
Types:Instant Types:Instant
A:SP$ Token | Cost$ 3 G | TokenAmount$ X | TokenOwner$ You | TokenScript$ g_3_3_beast | LegacyImage$ g 3 3 beast nph | SpellDescription$ Create a 3/3 green Beast creature token for each creature put into your graveyard from the battlefield this turn. A:SP$ Token | Cost$ 3 G | TokenAmount$ X | TokenOwner$ You | TokenScript$ g_3_3_beast | LegacyImage$ g 3 3 beast nph | SpellDescription$ Create a 3/3 green Beast creature token for each creature put into your graveyard from the battlefield this turn.
SVar:X:Count$ThisTurnEntered_Graveyard_from_Battlefield_Creature.YouCtrl SVar:X:Count$ThisTurnEntered_Graveyard_from_Battlefield_Creature.YouOwn
AI:RemoveDeck:All AI:RemoveDeck:All
SVar:Picture:http://www.wizards.com/global/images/magic/general/fresh_meat.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/fresh_meat.jpg
Oracle:Create a 3/3 green Beast creature token for each creature put into your graveyard from the battlefield this turn. Oracle:Create a 3/3 green Beast creature token for each creature put into your graveyard from the battlefield this turn.

View File

@@ -4,5 +4,5 @@ Types:Instant
A:SP$ RollDice | Sides$ 20 | Modifier$ X | ResultSubAbilities$ 1-14:DBToHand,Else:DBToField | SpellDescription$ Roll a d20 and add the number of creature cards in your graveyard that were put there from the battlefield this turn. A:SP$ RollDice | Sides$ 20 | Modifier$ X | ResultSubAbilities$ 1-14:DBToHand,Else:DBToField | SpellDescription$ Roll a d20 and add the number of creature cards in your graveyard that were put there from the battlefield this turn.
SVar:DBToHand:DB$ ChangeZone | Origin$ Graveyard | Destination$ Hand | Defined$ ValidGraveyard Creature.YouOwn+ThisTurnEnteredFrom_Battlefield | SpellDescription$ 1—14 VERT Return all creature cards in your graveyard that were put there from the battlefield this turn to your hand. SVar:DBToHand:DB$ ChangeZone | Origin$ Graveyard | Destination$ Hand | Defined$ ValidGraveyard Creature.YouOwn+ThisTurnEnteredFrom_Battlefield | SpellDescription$ 1—14 VERT Return all creature cards in your graveyard that were put there from the battlefield this turn to your hand.
SVar:DBToField:DB$ ChangeZone | Origin$ Graveyard | Destination$ Battlefield | Defined$ ValidGraveyard Creature.YouOwn+ThisTurnEnteredFrom_Battlefield | SpellDescription$ 15+ VERT Return those cards from your graveyard to the battlefield. SVar:DBToField:DB$ ChangeZone | Origin$ Graveyard | Destination$ Battlefield | Defined$ ValidGraveyard Creature.YouOwn+ThisTurnEnteredFrom_Battlefield | SpellDescription$ 15+ VERT Return those cards from your graveyard to the battlefield.
SVar:X:Count$ThisTurnEntered_Graveyard_from_Battlefield_Creature.YouCtrl SVar:X:Count$ThisTurnEntered_Graveyard_from_Battlefield_Creature.YouOwn
Oracle:Roll a d20 and add the number of creature cards in your graveyard that were put there from the battlefield this turn.\n1—14 | Return all creature cards in your graveyard that were put there from the battlefield this turn to your hand.\n15+ | Return those cards from your graveyard to the battlefield. Oracle:Roll a d20 and add the number of creature cards in your graveyard that were put there from the battlefield this turn.\n1—14 | Return all creature cards in your graveyard that were put there from the battlefield this turn to your hand.\n15+ | Return those cards from your graveyard to the battlefield.

View File

@@ -5,7 +5,7 @@ Loyalty:4
Text:CARDNAME can be your commander. Text:CARDNAME can be your commander.
K:Partner K:Partner
A:AB$ Token | Cost$ AddCounter<2/LOYALTY> | Planeswalker$ True | TokenScript$ b_0_1_thrull | TokenAmount$ 2 | SpellDescription$ Create two 0/1 black Thrull creature tokens. A:AB$ Token | Cost$ AddCounter<2/LOYALTY> | Planeswalker$ True | TokenScript$ b_0_1_thrull | TokenAmount$ 2 | SpellDescription$ Create two 0/1 black Thrull creature tokens.
A:AB$ Sacrifice | Cost$ AddCounter<1/LOYALTY> | Planeswalker$ True | SacValid$ Creature,Planeswalker | SacMessage$ creature or planeswalker | Optional$ True | RememberSacrificed$ True | SubAbility$ DBDraw | SpellDescription$ You may sacrifice another creature or planeswalker. If you do, draw two cards, then draw another card if the sacrificed permanent was a commander. A:AB$ Sacrifice | Cost$ AddCounter<1/LOYALTY> | Planeswalker$ True | SacValid$ Creature.Other,Planeswalker.Other | SacMessage$ creature or planeswalker | Optional$ True | RememberSacrificed$ True | SubAbility$ DBDraw | SpellDescription$ You may sacrifice another creature or planeswalker. If you do, draw two cards, then draw another card if the sacrificed permanent was a commander.
SVar:DBDraw:DB$ Draw | Defined$ You | NumCards$ 2 | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 | SubAbility$ DBDraw2 SVar:DBDraw:DB$ Draw | Defined$ You | NumCards$ 2 | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 | SubAbility$ DBDraw2
SVar:DBDraw2:DB$ Draw | Defined$ You | NumCards$ 1 | ConditionDefined$ Remembered | ConditionPresent$ Card.IsCommander | ConditionCompare$ GE1 SVar:DBDraw2:DB$ Draw | Defined$ You | NumCards$ 1 | ConditionDefined$ Remembered | ConditionPresent$ Card.IsCommander | ConditionCompare$ GE1
A:AB$ GainControl | Cost$ SubCounter<10/LOYALTY> | Planeswalker$ True | Ultimate$ True | AllValid$ Card.IsCommander | NewController$ You | SubAbility$ DBChangeZone | SpellDescription$ Gain control of all commanders. Put all commanders from the commander zone onto the battlefield under your control. A:AB$ GainControl | Cost$ SubCounter<10/LOYALTY> | Planeswalker$ True | Ultimate$ True | AllValid$ Card.IsCommander | NewController$ You | SubAbility$ DBChangeZone | SpellDescription$ Gain control of all commanders. Put all commanders from the commander zone onto the battlefield under your control.

View File

@@ -2,6 +2,6 @@ Name:Urborg Justice
ManaCost:B B ManaCost:B B
Types:Instant Types:Instant
A:SP$ Sacrifice | Cost$ B B | ValidTgts$ Opponent | Amount$ X | SacValid$ Creature | SacMessage$ Creature | SpellDescription$ Target opponent sacrifices a creature for each creature put into your graveyard from the battlefield this turn. A:SP$ Sacrifice | Cost$ B B | ValidTgts$ Opponent | Amount$ X | SacValid$ Creature | SacMessage$ Creature | SpellDescription$ Target opponent sacrifices a creature for each creature put into your graveyard from the battlefield this turn.
SVar:X:Count$ThisTurnEntered_Graveyard_from_Battlefield_Creature.YouCtrl SVar:X:Count$ThisTurnEntered_Graveyard_from_Battlefield_Creature.YouOwn
SVar:Picture:http://www.wizards.com/global/images/magic/general/urborg_justice.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/urborg_justice.jpg
Oracle:Target opponent sacrifices a creature for each creature put into your graveyard from the battlefield this turn. Oracle:Target opponent sacrifices a creature for each creature put into your graveyard from the battlefield this turn.

View File

@@ -153,8 +153,7 @@ public class InputAttack extends InputSyncronizedBase {
protected final void onPlayerSelected(Player selected, final ITriggerEvent triggerEvent) { protected final void onPlayerSelected(Player selected, final ITriggerEvent triggerEvent) {
if (defenders.contains(selected)) { if (defenders.contains(selected)) {
setCurrentDefender(selected); setCurrentDefender(selected);
} } else {
else {
getController().getGui().flashIncorrectAction(); // cannot attack that player getController().getGui().flashIncorrectAction(); // cannot attack that player
} }
} }