mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
Make canBlock check if the blocker is a creature. (#7098)
- TokenAi also checks if the spawned token is a creature before running checks.
This commit is contained in:
@@ -206,7 +206,8 @@ public class TokenAi extends SpellAbilityAi {
|
|||||||
&& game.getPhaseHandler().getPlayerTurn().isOpponentOf(ai)
|
&& game.getPhaseHandler().getPlayerTurn().isOpponentOf(ai)
|
||||||
&& game.getCombat() != null
|
&& game.getCombat() != null
|
||||||
&& !game.getCombat().getAttackers().isEmpty()
|
&& !game.getCombat().getAttackers().isEmpty()
|
||||||
&& alwaysOnOppAttack) {
|
&& alwaysOnOppAttack
|
||||||
|
&& actualToken.isCreature()) {
|
||||||
for (Card attacker : game.getCombat().getAttackers()) {
|
for (Card attacker : game.getCombat().getAttackers()) {
|
||||||
if (CombatUtil.canBlock(attacker, actualToken)) {
|
if (CombatUtil.canBlock(attacker, actualToken)) {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -996,7 +996,7 @@ public class CombatUtil {
|
|||||||
* @return a boolean.
|
* @return a boolean.
|
||||||
*/
|
*/
|
||||||
public static boolean canBlock(final Card attacker, final Card blocker, final boolean nextTurn) {
|
public static boolean canBlock(final Card attacker, final Card blocker, final boolean nextTurn) {
|
||||||
if (attacker == null || blocker == null) {
|
if (attacker == null || blocker == null || !blocker.isCreature()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user