forked from External/mage
AI: improved combat support:
* added support to attack battle permanents (#10246); * fixed that AI was able to attack multiple targets by single creature (#7434); * added docs; * added todos with another bugs or possible problems with AI combat;
This commit is contained in:
parent
6858d43547
commit
e4157fefb8
16 changed files with 239 additions and 89 deletions
|
|
@ -1435,12 +1435,12 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeAttacked(UUID attackerId, UUID playerToAttack, Game game) {
|
||||
public boolean canBeAttacked(UUID attackerId, UUID defendingPlayerId, Game game) {
|
||||
if (isPlaneswalker(game)) {
|
||||
return isControlledBy(playerToAttack);
|
||||
return isControlledBy(defendingPlayerId);
|
||||
}
|
||||
if (isBattle(game)) {
|
||||
return isProtectedBy(playerToAttack);
|
||||
return isProtectedBy(defendingPlayerId);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue