Fixed various bugs - loseLife instead of damage was supposed to be used

This commit is contained in:
drmDev 2016-07-30 21:15:05 -04:00
parent df19372c45
commit 2a51663ebc
5 changed files with 12 additions and 41 deletions

View file

@ -55,8 +55,6 @@ public class SingeMindOgre extends CardImpl {
this.subtype.add("Ogre");
this.subtype.add("Mutant");
this.power = new MageInt(3);
this.toughness = new MageInt(2);
@ -96,7 +94,7 @@ class SingeMindOgreEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player targetPlayer = game.getPlayer(source.getFirstTarget());
if (targetPlayer != null && targetPlayer.getHand().size() > 0) {
if (targetPlayer != null && !targetPlayer.getHand().isEmpty()) {
Cards revealed = new CardsImpl();
Card card = targetPlayer.getHand().getRandom(game);
revealed.add(card);

View file

@ -96,7 +96,7 @@ class DeadlyTempestEffect extends OneShotEffect {
if (count > 0) {
Player player = game.getPlayer(playerId);
if (player != null) {
player.damage(count, playerId, game, false, true);
player.loseLife(count, game);
}
}
}

View file

@ -51,7 +51,6 @@ public class IllicitAuction extends CardImpl {
super(ownerId, 183, "Illicit Auction", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{R}{R}");
this.expansionSetCode = "MIR";
// Each player may bid life for control of target creature. You start the bidding with a bid of 0. In turn order, each player may top the high bid. The bidding ends if the high bid stands. The high bidder loses life equal to the high bid and gains control of the creature.
this.getSpellAbility().addEffect(new IllicitAuctionEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanent());

View file

@ -28,20 +28,17 @@
package mage.sets.newphyrexia;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.common.DiesTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.dynamicvalue.common.SourcePermanentPowerCount;
import mage.abilities.effects.common.LoseLifeTargetEffect;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.cards.CardImpl;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.target.TargetPlayer;
/**
@ -58,8 +55,10 @@ public class MortisDogs extends CardImpl {
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// Whenever Mortis Dogs attacks, it gets +2/+0 until end of turn.
this.addAbility(new AttacksTriggeredAbility(new BoostSourceEffect(2, 0, Duration.EndOfTurn), false));
Ability ability = new DiesTriggeredAbility(new MortisDogsEffect());
// When Mortis Dogs dies, target player loses life equal to its power.
Ability ability = new DiesTriggeredAbility(new LoseLifeTargetEffect(new SourcePermanentPowerCount()));
ability.addTarget(new TargetPlayer());
this.addAbility(ability);
}
@ -72,29 +71,4 @@ public class MortisDogs extends CardImpl {
public MortisDogs copy() {
return new MortisDogs(this);
}
}
class MortisDogsEffect extends OneShotEffect {
public MortisDogsEffect() {
super(Outcome.Damage);
staticText = "target player loses life equal to its power";
}
@Override
public MortisDogsEffect copy() {
return new MortisDogsEffect();
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(targetPointer.getFirst(game, source));
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
if (player != null && sourcePermanent != null) {
player.loseLife(sourcePermanent.getPower().getValue(), game);
return true;
}
return false;
}
}
}

View file

@ -141,7 +141,7 @@ class StarlitSanctumBlackEffect extends OneShotEffect {
if (amount > 0) {
Player player = game.getPlayer(source.getFirstTarget());
if (player != null) {
player.damage(amount, source.getSourceId(), game, false, true);
player.loseLife(amount, game);
return true;
}
}