mirror of
https://github.com/magefree/mage.git
synced 2026-01-10 12:52:06 -08:00
fixed AI - will now attack if opponent has no defenders
This commit is contained in:
parent
65c55e4e2a
commit
d6c30e3734
6 changed files with 17 additions and 6 deletions
|
|
@ -28,9 +28,11 @@
|
|||
|
||||
package mage.abilities.common;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Constants.Zone;
|
||||
import mage.abilities.ActivatedAbilityImpl;
|
||||
import mage.abilities.effects.common.PassEffect;
|
||||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -51,6 +53,11 @@ public class PassAbility extends ActivatedAbilityImpl<PassAbility> {
|
|||
return new PassAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canActivate(UUID playerId, Game game) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Pass";
|
||||
|
|
|
|||
|
|
@ -58,7 +58,10 @@ public class PlayTargetWithoutPayingManaEffect extends OneShotEffect<PlayTargetW
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Card target = (Card) game.getObject(source.getFirstTarget());
|
||||
return controller.cast(target.getSpellAbility(), game, true);
|
||||
if (controller != null && target != null) {
|
||||
return controller.cast(target.getSpellAbility(), game, true);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue