mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
- Exalted will now display both the triggering host and the attacker on the stack.
This commit is contained in:
@@ -1274,12 +1274,13 @@ public class CombatUtil {
|
|||||||
* @param magnitude
|
* @param magnitude
|
||||||
* a int.
|
* a int.
|
||||||
*/
|
*/
|
||||||
public static void executeExaltedAbility(final Game game, final Card c, final int magnitude) {
|
public static void executeExaltedAbility(final Game game, final Card c, final int magnitude, final Card host) {
|
||||||
final Card crd = c;
|
final Card crd = c;
|
||||||
Ability ability;
|
Ability ability;
|
||||||
|
// This really should be a trigger on the stack
|
||||||
|
|
||||||
for (int i = 0; i < magnitude; i++) {
|
for (int i = 0; i < magnitude; i++) {
|
||||||
ability = new Ability(c, ManaCost.ZERO) {
|
ability = new Ability(host, ManaCost.ZERO) {
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
final Command untilEOT = new Command() {
|
final Command untilEOT = new Command() {
|
||||||
@@ -1305,10 +1306,13 @@ public class CombatUtil {
|
|||||||
}; // ability
|
}; // ability
|
||||||
|
|
||||||
final StringBuilder sb = new StringBuilder();
|
final StringBuilder sb = new StringBuilder();
|
||||||
sb.append(c).append(" - (Exalted) gets +1/+1 until EOT.");
|
sb.append(host).append(" - Exalted (Whenever a creature you control attacks alone, that creature gets +1/+1 until end of turn.)");
|
||||||
|
|
||||||
|
sb.append(" [Attacker: ").append(c).append("]");
|
||||||
ability.setStackDescription(sb.toString());
|
ability.setStackDescription(sb.toString());
|
||||||
ability.setDescription(sb.toString());
|
ability.setDescription(sb.toString());
|
||||||
ability.setActivatingPlayer(c.getController());
|
ability.setActivatingPlayer(host.getController());
|
||||||
|
ability.setTrigger(true);
|
||||||
|
|
||||||
game.getStack().addSimultaneousStackEntry(ability);
|
game.getStack().addSimultaneousStackEntry(ability);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -124,16 +124,14 @@ public class PhaseUtil {
|
|||||||
// check for exalted:
|
// check for exalted:
|
||||||
if (list.size() == 1) {
|
if (list.size() == 1) {
|
||||||
final Player attackingPlayer = game.getCombat().getAttackingPlayer();
|
final Player attackingPlayer = game.getCombat().getAttackingPlayer();
|
||||||
int exaltedMagnitude = 0;
|
final Card attacker = list.get(0);
|
||||||
for (Card card : attackingPlayer.getCardsIn(ZoneType.Battlefield)) {
|
for (Card card : attackingPlayer.getCardsIn(ZoneType.Battlefield)) {
|
||||||
exaltedMagnitude += card.getKeywordAmount("Exalted");
|
int exaltedMagnitude = card.getKeywordAmount("Exalted");
|
||||||
|
if (exaltedMagnitude > 0) {
|
||||||
|
CombatUtil.executeExaltedAbility(game, attacker, exaltedMagnitude, card);
|
||||||
|
// Make sure exalted effects get applied only once per combat
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (exaltedMagnitude > 0) {
|
|
||||||
CombatUtil.executeExaltedAbility(game, list.get(0), exaltedMagnitude);
|
|
||||||
// Make sure exalted effects get applied only once per combat
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
game.getGameLog().addCombatAttackers(game.getCombat());
|
game.getGameLog().addCombatAttackers(game.getCombat());
|
||||||
|
|||||||
Reference in New Issue
Block a user