fixed some targeted cards

This commit is contained in:
BetaSteward 2011-09-27 07:40:17 -04:00
parent d96c983778
commit 33a5a23d33
3 changed files with 26 additions and 22 deletions

View file

@ -92,14 +92,17 @@ class CyclopsGladiatorEffect extends OneShotEffect<CyclopsGladiatorEffect> {
filter.getControllerId().add(defenderId); filter.getControllerId().add(defenderId);
TargetCreaturePermanent target = new TargetCreaturePermanent(filter); TargetCreaturePermanent target = new TargetCreaturePermanent(filter);
Player player = game.getPlayer(source.getControllerId()); Player player = game.getPlayer(source.getControllerId());
player.choose(Outcome.Damage, target, game); if (target.canChoose(source.getSourceId(), source.getControllerId(), game)) {
Permanent permanent = game.getPermanent(target.getFirstTarget()); if (player.chooseTarget(Outcome.Detriment, target, source, game)) {
Permanent cyclops = game.getPermanent(source.getSourceId()); Permanent permanent = game.getPermanent(target.getFirstTarget());
if (permanent != null && cyclops != null) { Permanent cyclops = game.getPermanent(source.getSourceId());
permanent.damage(cyclops.getPower().getValue(), cyclops.getId(), game, true, false); if (permanent != null && cyclops != null) {
cyclops.damage(permanent.getPower().getValue(), permanent.getId(), game, true, false); permanent.damage(cyclops.getPower().getValue(), cyclops.getId(), game, true, false);
return true; cyclops.damage(permanent.getPower().getValue(), permanent.getId(), game, true, false);
} return true;
}
}
}
} }
return false; return false;
} }

View file

@ -161,8 +161,8 @@ class NecroticPlagueEffect2 extends OneShotEffect<NecroticPlagueEffect2> {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
if (controller != null) { if (controller != null) {
TargetCreaturePermanent target = new TargetCreaturePermanent(filter); TargetCreaturePermanent target = new TargetCreaturePermanent(filter);
if (target.canChoose(source.getControllerId(), game)) { if (target.canChoose(source.getSourceId(), source.getControllerId(), game)) {
if (controller.choose(Outcome.Detriment, target, game)) { if (controller.chooseTarget(Outcome.Detriment, target, source, game)) {
Card card = game.getCard(cardId); Card card = game.getCard(cardId);
if (card != null) { if (card != null) {
card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getId(), source.getControllerId()); card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getId(), source.getControllerId());

View file

@ -85,20 +85,21 @@ class GoblinArsonistEffect extends OneShotEffect<GoblinArsonistEffect> {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
TargetCreatureOrPlayer target = new TargetCreatureOrPlayer(); TargetCreatureOrPlayer target = new TargetCreatureOrPlayer();
Player player = game.getPlayer(source.getControllerId()); Player player = game.getPlayer(source.getControllerId());
player.choose(Outcome.Damage, target, game); if (target.canChoose(source.getSourceId(), source.getControllerId(), game)) {
player.chooseTarget(Outcome.Damage, target, source, game);
Permanent permanent = game.getPermanent(target.getFirstTarget()); Permanent permanent = game.getPermanent(target.getFirstTarget());
if (permanent != null) { if (permanent != null) {
permanent.damage(1, source.getSourceId(), game, true, false); permanent.damage(1, source.getSourceId(), game, true, false);
return true; return true;
} }
Player targetPlayer = game.getPlayer(target.getFirstTarget());
if (targetPlayer != null) {
targetPlayer.damage(1, source.getSourceId(), game, true, false);
return true;
}
Player targetPlayer = game.getPlayer(target.getFirstTarget());
if (targetPlayer != null) {
targetPlayer.damage(1, source.getSourceId(), game, true, false);
return true;
}
}
return false; return false;
} }