mirror of
https://github.com/magefree/mage.git
synced 2025-12-21 19:11:59 -08:00
Replaced some replacement effects with restriction effects. Added new method to restriction effect. Improved canAttack methods (not finished yet).
This commit is contained in:
parent
d3dadc41aa
commit
cbb6117b8e
17 changed files with 101 additions and 110 deletions
|
|
@ -180,7 +180,7 @@ public class RandomPlayer extends ComputerPlayer {
|
|||
public void selectAttackers(Game game, UUID attackingPlayerId) {
|
||||
//useful only for two player games - will only attack first opponent
|
||||
UUID defenderId = game.getOpponents(playerId).iterator().next();
|
||||
List<Permanent> attackersList = super.getAvailableAttackers(game);
|
||||
List<Permanent> attackersList = super.getAvailableAttackers(defenderId, game);
|
||||
//use binary digits to calculate powerset of attackers
|
||||
int powerElements = (int) Math.pow(2, attackersList.size());
|
||||
int value = rnd.nextInt(powerElements);
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ public class TestPlayer extends ComputerPlayer {
|
|||
FilterCreatureForCombat filter = new FilterCreatureForCombat();
|
||||
filter.add(new NamePredicate(groups[0]));
|
||||
Permanent attacker = findPermanent(filter, playerId, game);
|
||||
if (attacker != null && attacker.canAttack(game)) {
|
||||
if (attacker != null && attacker.canAttack(defenderId, game)) {
|
||||
this.declareAttacker(attacker.getId(), defenderId, game, false);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue