Added some test and some minor fixes to effect ability handling.

This commit is contained in:
LevelX2 2015-06-04 13:50:39 +02:00
parent 961e292bc9
commit 53396a44f2
11 changed files with 256 additions and 76 deletions

View file

@ -972,9 +972,11 @@ public class ComputerPlayer extends PlayerImpl implements Player {
@Override
public boolean activateAbility(ActivatedAbility ability, Game game) {
for (Target target: ability.getModes().getMode().getTargets()) {
for (UUID targetId: target.getTargets()) {
game.fireEvent(GameEvent.getEvent(EventType.TARGETED, targetId, ability.getId(), ability.getControllerId()));
if (!isTestMode()) { // Test player already sends target event as he selects the target
for (Target target: ability.getModes().getMode().getTargets()) {
for (UUID targetId: target.getTargets()) {
game.fireEvent(GameEvent.getEvent(EventType.TARGETED, targetId, ability.getId(), ability.getControllerId()));
}
}
}
return super.activateAbility(ability, game);