mirror of
https://github.com/correl/mage.git
synced 2025-04-01 19:07:57 -09:00
- Attempt to fix the AI attacking with your creatures. Small enchancements to AI attacking.
This commit is contained in:
parent
8942a2a00b
commit
8dcfead462
2 changed files with 6 additions and 3 deletions
Mage.Server.Plugins/Mage.Player.AI.MA/src/mage/player/ai
Mage/src/mage/players
|
@ -1099,7 +1099,10 @@ public class ComputerPlayer6 extends ComputerPlayer<ComputerPlayer6> implements
|
|||
|| blocker.getAbilities().containsKey(DoubleStrikeAbility.getInstance().getId())
|
||||
|| blocker.getAbilities().contains(new ExaltedAbility())
|
||||
|| blocker.getAbilities().containsKey(DeathtouchAbility.getInstance().getId())
|
||||
|| blocker.getAbilities().contains(new IndestructibleAbility())) {
|
||||
|| blocker.getAbilities().contains(new IndestructibleAbility())
|
||||
|| !attacker.getAbilities().containsKey(FirstStrikeAbility.getInstance().getId())
|
||||
|| !attacker.getAbilities().containsKey(DoubleStrikeAbility.getInstance().getId())
|
||||
|| !attacker.getAbilities().contains(new ExaltedAbility())) {
|
||||
safeToAttack = false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1111,7 +1111,7 @@ public abstract class PlayerImpl<T extends PlayerImpl<T>> implements Player, Ser
|
|||
@Override
|
||||
public void declareAttacker(UUID attackerId, UUID defenderId, Game game) {
|
||||
Permanent attacker = game.getPermanent(attackerId);
|
||||
if (attacker != null && attacker.canAttack(game)) {
|
||||
if (attacker != null && attacker.canAttack(game) && attacker.getControllerId().equals(playerId)) {
|
||||
if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.DECLARE_ATTACKER, defenderId, attackerId, playerId))) {
|
||||
game.getCombat().declareAttacker(attackerId, defenderId, game);
|
||||
}
|
||||
|
@ -1122,7 +1122,7 @@ public abstract class PlayerImpl<T extends PlayerImpl<T>> implements Player, Ser
|
|||
public void declareBlocker(UUID blockerId, UUID attackerId, Game game) {
|
||||
Permanent blocker = game.getPermanent(blockerId);
|
||||
CombatGroup group = game.getCombat().findGroup(attackerId);
|
||||
if (blocker != null && group != null && group.canBlock(blocker, game)) {
|
||||
if (blocker != null && group != null && group.canBlock(blocker, game) && blocker.getControllerId().equals(playerId)) {
|
||||
group.addBlocker(blockerId, playerId, game);
|
||||
game.getCombat().addBlockingGroup(blockerId, attackerId, playerId, game);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue