mirror of
https://github.com/correl/mage.git
synced 2025-01-11 11:05:23 +00:00
Fixed minor problem of Volrath's Laboratory. Added combat flag to LIFE_LOST event.
This commit is contained in:
parent
9676f24752
commit
9cf9d69c55
134 changed files with 163 additions and 146 deletions
|
@ -99,7 +99,7 @@ class SingeMindOgreEffect extends OneShotEffect {
|
|||
Card card = targetPlayer.getHand().getRandom(game);
|
||||
revealed.add(card);
|
||||
targetPlayer.revealCards("Singe-Mind Ogre", revealed, game);
|
||||
targetPlayer.loseLife(card.getConvertedManaCost(), game);
|
||||
targetPlayer.loseLife(card.getConvertedManaCost(), game, false);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -116,7 +116,7 @@ class DeathEffect extends OneShotEffect {
|
|||
if (game.getState().getZone(creatureCard.getId()).equals(Zone.GRAVEYARD)) {
|
||||
controller.moveCards(creatureCard, Zone.BATTLEFIELD, source, game);
|
||||
}
|
||||
controller.loseLife(creatureCard.getConvertedManaCost(), game);
|
||||
controller.loseLife(creatureCard.getConvertedManaCost(), game, false);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -98,7 +98,7 @@ class EssenceHarvestEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
if (amount > 0) {
|
||||
targetPlayer.loseLife(amount, game);
|
||||
targetPlayer.loseLife(amount, game, false);
|
||||
player.gainLife(amount, game);
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -122,7 +122,7 @@ class KillingWaveEffect extends OneShotEffect {
|
|||
if (lifePaid > 0) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
player.loseLife(lifePaid, game);
|
||||
player.loseLife(lifePaid, game, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ class ScourgeOfNumaiEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
if (game.getBattlefield().countAll(new FilterCreaturePermanent("Ogre", "Ogre"), source.getControllerId(), game) < 1) {
|
||||
controller.loseLife(2, game);
|
||||
controller.loseLife(2, game, false);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ class TakenumaBleederEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
if (game.getBattlefield().countAll(new FilterCreaturePermanent("Demon", "Demon"), source.getControllerId(), game) < 1) {
|
||||
controller.loseLife(1, game);
|
||||
controller.loseLife(1, game, false);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -103,7 +103,7 @@ class PainSeerEffect extends OneShotEffect {
|
|||
|
||||
if (card != null &&
|
||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, false)) {
|
||||
player.loseLife(card.getConvertedManaCost(), game);
|
||||
player.loseLife(card.getConvertedManaCost(), game, false);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ class ServantOfTymaretEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
int lostAmount = 0;
|
||||
for (UUID opponentId: game.getOpponents(source.getControllerId())) {
|
||||
lostAmount += game.getPlayer(opponentId).loseLife(1, game);
|
||||
lostAmount += game.getPlayer(opponentId).loseLife(1, game, false);
|
||||
}
|
||||
game.getPlayer(source.getControllerId()).gainLife(lostAmount, game);
|
||||
return true;
|
||||
|
|
|
@ -108,7 +108,7 @@ class DevouringGreedEffect extends OneShotEffect {
|
|||
Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source));
|
||||
Player sourcePlayer = game.getPlayer(source.getControllerId());
|
||||
if (targetPlayer != null && sourcePlayer != null) {
|
||||
targetPlayer.loseLife(amount, game);
|
||||
targetPlayer.loseLife(amount, game, false);
|
||||
sourcePlayer.gainLife(amount, game);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ class KokushoTheEveningStarEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
int loseLife = 0;
|
||||
for (UUID opponentId : game.getOpponents(source.getControllerId())) {
|
||||
loseLife += game.getPlayer(opponentId).loseLife(5, game);
|
||||
loseLife += game.getPlayer(opponentId).loseLife(5, game, false);
|
||||
}
|
||||
if (loseLife > 0)
|
||||
game.getPlayer(source.getControllerId()).gainLife(loseLife, game);
|
||||
|
|
|
@ -128,7 +128,7 @@ class StabwhiskerLoseLifeEffect extends OneShotEffect {
|
|||
if (opponent != null) {
|
||||
int lifeLose = 3 - opponent.getHand().size();
|
||||
if (lifeLose > 0 ) {
|
||||
opponent.loseLife(lifeLose, game);
|
||||
opponent.loseLife(lifeLose, game, false);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -106,7 +106,7 @@ class LimDulsVaultEffect extends OneShotEffect {
|
|||
player.lookAtCards("Lim-Dul's Vault", cards, game);
|
||||
doAgain = player.chooseUse(outcome, "Pay 1 life and look at the next 5 cards?", source, game);
|
||||
if (doAgain) {
|
||||
player.loseLife(1, game);
|
||||
player.loseLife(1, game, false);
|
||||
} else {
|
||||
player.shuffleLibrary(source, game);
|
||||
}
|
||||
|
|
|
@ -112,7 +112,7 @@ class ObNixilisOfTheBlackOathEffect1 extends OneShotEffect {
|
|||
for (UUID opponentId : game.getOpponents(source.getControllerId())) {
|
||||
Player opponent = game.getPlayer(opponentId);
|
||||
if (opponent != null) {
|
||||
loseLife += opponent.loseLife(1, game);
|
||||
loseLife += opponent.loseLife(1, game, false);
|
||||
}
|
||||
}
|
||||
controller.gainLife(loseLife, game);
|
||||
|
|
|
@ -139,7 +139,7 @@ class RavingDeadDamageEffect extends OneShotEffect {
|
|||
if (player != null) {
|
||||
Integer amount = (int) Math.ceil(player.getLife() / 2f);
|
||||
if (amount > 0) {
|
||||
player.loseLife(amount, game);
|
||||
player.loseLife(amount, game, false);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ class DeadlyTempestEffect extends OneShotEffect {
|
|||
if (count > 0) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
player.loseLife(count, game);
|
||||
player.loseLife(count, game, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -145,7 +145,7 @@ class ScytheclawEffect extends OneShotEffect {
|
|||
if (player != null) {
|
||||
Integer amount = (int) Math.ceil(player.getLife() / 2f);
|
||||
if (amount > 0) {
|
||||
player.loseLife(amount, game);
|
||||
player.loseLife(amount, game, false);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -142,7 +142,7 @@ class BloodTyrantEffect extends OneShotEffect {
|
|||
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
if (player.loseLife(1, game) > 0) {
|
||||
if (player.loseLife(1, game, false) > 0) {
|
||||
counters++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ class InfectiousHorrorEffect extends OneShotEffect {
|
|||
for (UUID opponentId : game.getOpponents(source.getControllerId())) {
|
||||
Player opponent = game.getPlayer(opponentId);
|
||||
if (opponent != null) {
|
||||
opponent.loseLife(2, game);
|
||||
opponent.loseLife(2, game, false);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -155,7 +155,7 @@ class SludgeStriderEffect extends OneShotEffect {
|
|||
Player targetPlayer = game.getPlayer(source.getFirstTarget());
|
||||
Player you = game.getPlayer(source.getControllerId());
|
||||
if (targetPlayer != null) {
|
||||
targetPlayer.loseLife(1, game);
|
||||
targetPlayer.loseLife(1, game, false);
|
||||
}
|
||||
if (you != null) {
|
||||
you.gainLife(1, game);
|
||||
|
|
|
@ -87,7 +87,7 @@ class StrongholdDisciplineEffect extends OneShotEffect {
|
|||
if (count > 0) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
player.loseLife(count, game);
|
||||
player.loseLife(count, game, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -122,7 +122,7 @@ class TyrantsChoiceLoseLifeEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
for (UUID opponentId : game.getOpponents(source.getControllerId())) {
|
||||
game.getPlayer(opponentId).loseLife(4, game);
|
||||
game.getPlayer(opponentId).loseLife(4, game, false);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -142,7 +142,7 @@ class KayaGhostAssassinEffect extends OneShotEffect {
|
|||
game.addDelayedTriggeredAbility(delayedAbility, source);
|
||||
}
|
||||
}
|
||||
controller.loseLife(2, game);
|
||||
controller.loseLife(2, game, false);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -89,7 +89,7 @@ class RainOfGoreEffect extends ReplacementEffectImpl {
|
|||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Player player = game.getPlayer(event.getPlayerId());
|
||||
if (player != null) {
|
||||
player.loseLife(event.getAmount(), game);
|
||||
player.loseLife(event.getAmount(), game, false);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -102,7 +102,7 @@ class BloodScrivenerReplacementEffect extends ReplacementEffectImpl {
|
|||
Player player = game.getPlayer(event.getPlayerId());
|
||||
if (player != null) {
|
||||
player.drawCards(2, game, event.getAppliedEffects());
|
||||
player.loseLife(1, game);
|
||||
player.loseLife(1, game, false);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ class DamnablePactEffect extends OneShotEffect {
|
|||
Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source));
|
||||
if (targetPlayer != null) {
|
||||
targetPlayer.drawCards(source.getManaCostsToPay().getX(), game);
|
||||
targetPlayer.loseLife(source.getManaCostsToPay().getX(), game);
|
||||
targetPlayer.loseLife(source.getManaCostsToPay().getX(), game, false);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -96,7 +96,7 @@ class FoulTongueShriekEffect extends OneShotEffect {
|
|||
if (controller != null && targetOpponent != null) {
|
||||
int amount = new AttackingFilterCreatureCount(filter).calculate(game, source, this);
|
||||
if (amount > 0) {
|
||||
targetOpponent.loseLife(amount, game);
|
||||
targetOpponent.loseLife(amount, game, false);
|
||||
controller.gainLife(amount, game);
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -107,7 +107,7 @@ class SelfInflictedWoundEffect extends OneShotEffect {
|
|||
Permanent permanent = game.getPermanent(target.getFirstTarget());
|
||||
if (permanent != null) {
|
||||
if (permanent.sacrifice(source.getSourceId(), game)) {
|
||||
targetOpponent.loseLife(2, game);
|
||||
targetOpponent.loseLife(2, game, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@ class MurderousBetrayalCost extends CostImpl {
|
|||
if (lifeToPay < 0) {
|
||||
this.paid = true;
|
||||
} else {
|
||||
this.paid = (controller.loseLife(lifeToPay, game) == lifeToPay);
|
||||
this.paid = (controller.loseLife(lifeToPay, game, false) == lifeToPay);
|
||||
}
|
||||
return this.paid;
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ class CertainDeathEffect extends OneShotEffect {
|
|||
permanent.destroy(source.getSourceId(), game, false);
|
||||
Player permController = game.getPlayer(permanent.getControllerId());
|
||||
if (permController != null) {
|
||||
permController.loseLife(2, game);
|
||||
permController.loseLife(2, game, false);
|
||||
you.gainLife(2, game);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -102,7 +102,7 @@ class BatwingBrumeEffect extends OneShotEffect {
|
|||
if (amount > 0) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
player.loseLife(amount, game);
|
||||
player.loseLife(amount, game, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -107,7 +107,7 @@ class SaplingOfColfenorEffect extends OneShotEffect {
|
|||
controller.revealCards(sourceObject.getIdName(), cards, game);
|
||||
if (card.getCardType().contains(CardType.CREATURE)) {
|
||||
controller.gainLife(card.getToughness().getValue(), game);
|
||||
controller.loseLife(card.getPower().getValue(), game);
|
||||
controller.loseLife(card.getPower().getValue(), game, false);
|
||||
return controller.moveCards(cards.getCards(game), Zone.HAND, source, game);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -103,7 +103,7 @@ class SootImpEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player caster = game.getPlayer(targetPointer.getFirst(game, source));
|
||||
if (caster != null) {
|
||||
caster.loseLife(1, game);
|
||||
caster.loseLife(1, game, false);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -168,7 +168,7 @@ class SoulReapEffect extends OneShotEffect {
|
|||
if (creature != null) {
|
||||
Player controller = game.getPlayer(creature.getControllerId());
|
||||
if (controller != null) {
|
||||
controller.loseLife(3, game);
|
||||
controller.loseLife(3, game, false);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -90,7 +90,7 @@ class DevourInShadowEffect extends OneShotEffect {
|
|||
Player player = game.getPlayer(source.getControllerId());
|
||||
Permanent target = game.getPermanentOrLKIBattlefield(this.getTargetPointer().getFirst(game, source));
|
||||
if (player != null && target != null) {
|
||||
player.loseLife(target.getToughness().getValue(), game);
|
||||
player.loseLife(target.getToughness().getValue(), game, false);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -93,7 +93,7 @@ class PoxEffect extends OneShotEffect {
|
|||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
int lifeToLose = (int) Math.ceil(player.getLife() / 3.0);
|
||||
player.loseLife(lifeToLose, game);
|
||||
player.loseLife(lifeToLose, game, false);
|
||||
}
|
||||
}
|
||||
// then discards a third of the cards in his or her hand,
|
||||
|
|
|
@ -126,7 +126,7 @@ class SylvanLibraryEffect extends OneShotEffect {
|
|||
if (controller.canPayLifeCost()
|
||||
&& controller.getLife() >= 4
|
||||
&& controller.chooseUse(outcome, "Pay 4 life for " + card.getLogName() + "? (Otherwise it's put on top of your library)", source, game)) {
|
||||
controller.loseLife(4, game);
|
||||
controller.loseLife(4, game, false);
|
||||
game.informPlayers(controller.getLogName() + " pays 4 life to keep a card on hand");
|
||||
} else {
|
||||
cardsPutBack.add(card);
|
||||
|
|
|
@ -83,7 +83,7 @@ public class MinionsMurmurs extends CardImpl {
|
|||
if (controller != null) {
|
||||
int creaturesControlled = game.getBattlefield().countAll(new FilterCreaturePermanent(), controller.getId(), game);
|
||||
controller.drawCards(creaturesControlled, game);
|
||||
controller.loseLife(creaturesControlled, game);
|
||||
controller.loseLife(creaturesControlled, game, false);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -107,7 +107,7 @@ class DuskmantleSeerEffect extends OneShotEffect {
|
|||
Cards cards = new CardsImpl();
|
||||
cards.add(card);
|
||||
player.revealCards(sourceCard.getName() + ": Revealed by " + player.getName(), cards, game);
|
||||
player.loseLife(card.getConvertedManaCost(), game);
|
||||
player.loseLife(card.getConvertedManaCost(), game, false);
|
||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -156,7 +156,7 @@ class OrzhovCharmDestroyAndLoseLifeEffect extends OneShotEffect {
|
|||
int toughness = target.getToughness().getValue();
|
||||
target.destroy(source.getSourceId(), game, false);
|
||||
if (toughness > 0) {
|
||||
controller.loseLife(toughness, game);
|
||||
controller.loseLife(toughness, game, false);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -107,7 +107,7 @@ class VizkopaConfessorEffect extends OneShotEffect {
|
|||
if (controller != null && targetPlayer != null && sourceCard != null |