mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
- Fixed Wall of Tears when it's not the first blocker.
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
package forge.card.trigger;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import forge.Card;
|
||||
@@ -58,8 +59,16 @@ public class TriggerAttackerBlocked extends Trigger {
|
||||
}
|
||||
}
|
||||
if (this.mapParams.containsKey("ValidBlocker")) {
|
||||
if (!matchesValid(runParams2.get("Blocker"), this.mapParams.get("ValidBlocker").split(","),
|
||||
this.getHostCard())) {
|
||||
boolean valid = false;
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Card> list = (List<Card>) runParams2.get("Blockers");
|
||||
for (Card b : list) {
|
||||
if (matchesValid(b, this.mapParams.get("ValidBlocker").split(","), this.getHostCard())) {
|
||||
valid = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1179,20 +1179,18 @@ public class CombatUtil {
|
||||
* @param b
|
||||
* a {@link forge.Card} object.
|
||||
*/
|
||||
public static void checkBlockedAttackers(final GameState game, final Card a, final Card b) {
|
||||
public static void checkBlockedAttackers(final GameState game, final Card a, final List<Card> blockers) {
|
||||
// System.out.println(a.getName() + " got blocked by " + b.getName());
|
||||
|
||||
// Run triggers
|
||||
final HashMap<String, Object> runParams = new HashMap<String, Object>();
|
||||
runParams.put("Attacker", a);
|
||||
runParams.put("Blocker", b);
|
||||
runParams.put("Blockers", blockers);
|
||||
runParams.put("NumBlockers", blockers.size());
|
||||
game.getTriggerHandler().runTrigger(TriggerType.AttackerBlocked, runParams, false);
|
||||
//game.getTriggerHandler().runTrigger(TriggerType.Blocks, runParams, false);
|
||||
|
||||
if (!a.getDamageHistory().getCreatureGotBlockedThisCombat()) {
|
||||
final int blockers = game.getCombat().getBlockers(a).size();
|
||||
runParams.put("NumBlockers", blockers);
|
||||
game.getTriggerHandler().runTrigger(TriggerType.AttackerBlocked, runParams, false);
|
||||
|
||||
// Bushido
|
||||
for (final Ability ab : CardFactoryUtil.getBushidoEffects(a)) {
|
||||
game.getStack().add(ab);
|
||||
@@ -1215,6 +1213,7 @@ public class CombatUtil {
|
||||
} // end Rampage
|
||||
}
|
||||
|
||||
for (Card b : blockers) {
|
||||
if (a.hasKeyword("Flanking") && !b.hasKeyword("Flanking")) {
|
||||
int flankingMagnitude = 0;
|
||||
|
||||
@@ -1260,14 +1259,15 @@ public class CombatUtil {
|
||||
|
||||
game.getStack().add(ability2);
|
||||
Log.debug("Adding Flanking!");
|
||||
|
||||
} // flanking
|
||||
|
||||
a.getDamageHistory().setCreatureGotBlockedThisCombat(true);
|
||||
b.addBlockedThisTurn(a);
|
||||
a.addBlockedByThisTurn(b);
|
||||
}
|
||||
|
||||
a.getDamageHistory().setCreatureGotBlockedThisCombat(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* executeExaltedAbility.
|
||||
|
||||
@@ -263,10 +263,7 @@ public class PhaseUtil {
|
||||
CombatUtil.checkDeclareBlockers(game, list);
|
||||
|
||||
for (final Card a : attList) {
|
||||
final List<Card> blockList = combat.getBlockers(a);
|
||||
for (final Card b : blockList) {
|
||||
CombatUtil.checkBlockedAttackers(game, a, b);
|
||||
}
|
||||
CombatUtil.checkBlockedAttackers(game, a, combat.getBlockers(a));
|
||||
}
|
||||
|
||||
game.getStack().unfreezeStack();
|
||||
|
||||
Reference in New Issue
Block a user