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);
TargetCreaturePermanent target = new TargetCreaturePermanent(filter);
Player player = game.getPlayer(source.getControllerId());
player.choose(Outcome.Damage, target, game);
Permanent permanent = game.getPermanent(target.getFirstTarget());
Permanent cyclops = game.getPermanent(source.getSourceId());
if (permanent != null && cyclops != null) {
permanent.damage(cyclops.getPower().getValue(), cyclops.getId(), game, true, false);
cyclops.damage(permanent.getPower().getValue(), permanent.getId(), game, true, false);
return true;
}
if (target.canChoose(source.getSourceId(), source.getControllerId(), game)) {
if (player.chooseTarget(Outcome.Detriment, target, source, game)) {
Permanent permanent = game.getPermanent(target.getFirstTarget());
Permanent cyclops = game.getPermanent(source.getSourceId());
if (permanent != null && cyclops != null) {
permanent.damage(cyclops.getPower().getValue(), cyclops.getId(), game, true, false);
cyclops.damage(permanent.getPower().getValue(), permanent.getId(), game, true, false);
return true;
}
}
}
}
return false;
}

View file

@ -161,8 +161,8 @@ class NecroticPlagueEffect2 extends OneShotEffect<NecroticPlagueEffect2> {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
TargetCreaturePermanent target = new TargetCreaturePermanent(filter);
if (target.canChoose(source.getControllerId(), game)) {
if (controller.choose(Outcome.Detriment, target, game)) {
if (target.canChoose(source.getSourceId(), source.getControllerId(), game)) {
if (controller.chooseTarget(Outcome.Detriment, target, source, game)) {
Card card = game.getCard(cardId);
if (card != null) {
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) {
TargetCreatureOrPlayer target = new TargetCreatureOrPlayer();
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());
if (permanent != null) {
permanent.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;
}
Permanent permanent = game.getPermanent(target.getFirstTarget());
if (permanent != null) {
permanent.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;
}