Replaced some replacement effects with restriction effects. Added new method to restriction effect. Improved canAttack methods (not finished yet).

This commit is contained in:
LevelX2 2014-08-01 15:59:59 +02:00
parent d3dadc41aa
commit cbb6117b8e
17 changed files with 101 additions and 110 deletions

View file

@ -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);

View file

@ -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);
}
}