mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
Player.isInGame
This commit is contained in:
@@ -21,7 +21,7 @@ public class BondEffect extends SpellAbilityEffect {
|
||||
// gameCard is LKI in that case, the card is not in game anymore
|
||||
// or the timestamp did change
|
||||
// this should check Self too
|
||||
if (gameCard == null || !tgtC.equalsWithGameTimestamp(gameCard)) {
|
||||
if (gameCard == null || !tgtC.equalsWithTimestamp(gameCard)) {
|
||||
continue;
|
||||
}
|
||||
if (gameCard.isPaired() || !gameCard.isCreature() || !gameCard.isInPlay() || gameCard.getController() != p) {
|
||||
|
||||
@@ -549,7 +549,7 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
}
|
||||
|
||||
public final boolean canGainLife() {
|
||||
return !hasLost() && !StaticAbilityCantGainLosePayLife.anyCantGainLife(this);
|
||||
return isInGame() && !StaticAbilityCantGainLosePayLife.anyCantGainLife(this);
|
||||
}
|
||||
|
||||
public final int loseLife(int toLose, final boolean damage, final boolean manaBurn) {
|
||||
@@ -616,7 +616,7 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
}
|
||||
|
||||
public final boolean canLoseLife() {
|
||||
return !hasLost() && !StaticAbilityCantGainLosePayLife.anyCantLoseLife(this);
|
||||
return isInGame() && !StaticAbilityCantGainLosePayLife.anyCantLoseLife(this);
|
||||
}
|
||||
|
||||
public final boolean canPayLife(final int lifePayment, final boolean effect, SpellAbility cause) {
|
||||
@@ -1987,6 +1987,10 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
return getOutcome() != null && getOutcome().lossState == null;
|
||||
}
|
||||
|
||||
public final boolean isInGame() {
|
||||
return getOutcome() == null;
|
||||
}
|
||||
|
||||
public final boolean hasMetalcraft() {
|
||||
return CardLists.count(getCardsIn(ZoneType.Battlefield), CardPredicates.Presets.ARTIFACTS) >= 3;
|
||||
}
|
||||
@@ -2545,10 +2549,7 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
}
|
||||
|
||||
public boolean isSkippingCombat() {
|
||||
if (hasLost()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return !isInGame();
|
||||
}
|
||||
|
||||
public int getStartingHandSize() {
|
||||
@@ -3488,6 +3489,9 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
}
|
||||
|
||||
public void learnLesson(SpellAbility sa, CardZoneTable table, Map<AbilityKey, Object> params) {
|
||||
if (hasLost()) {
|
||||
return;
|
||||
}
|
||||
// Replacement effects
|
||||
Map<AbilityKey, Object> repParams = AbilityKey.mapFromAffected(this);
|
||||
repParams.put(AbilityKey.Cause, sa);
|
||||
|
||||
Reference in New Issue
Block a user