mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
Fix a Card property and remove some unused card-related code.
This commit is contained in:
@@ -6418,7 +6418,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
return false;
|
||||
}
|
||||
} else if (property.startsWith("dealtDamageToOppThisTurn")) {
|
||||
if (!this.getDamageHistory().getThisTurnDamaged().contains(sourceController.getOpponent())) {
|
||||
if (!this.hasDealtDamageToOpponentThisTurn()) {
|
||||
return false;
|
||||
}
|
||||
} else if (property.startsWith("controllerWasDealtCombatDamageByThisTurn")) {
|
||||
@@ -7291,6 +7291,19 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
this.dealtDamageToPlayerThisTurn.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@code true} if and only if this dealt damage to an opponent this
|
||||
* turn.
|
||||
*/
|
||||
public final boolean hasDealtDamageToOpponentThisTurn() {
|
||||
for (final Player p : this.getDamageHistory().getThisTurnDamaged()) {
|
||||
if (this.getController().isOpponentOf(p)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// this is the minimal damage a trampling creature has to assign to a blocker
|
||||
/**
|
||||
* <p>
|
||||
|
||||
@@ -994,8 +994,7 @@ public class CardFactoryUtil {
|
||||
|
||||
|
||||
if (sq[0].equals("YouDrewThisTurn")) return doXMath(c.getController().getNumDrawnThisTurn(), m, c);
|
||||
if (sq[0].equals("OppDrewThisTurn")) return doXMath(c.getController().getOpponent().getNumDrawnThisTurn(), m, c);
|
||||
|
||||
|
||||
if (sq[0].equals("FirstSpellTotalManaSpent")) return doXMath(c.getFirstSpellAbility().getTotalManaSpent(), m, c);
|
||||
if (sq[0].equals("StormCount")) return doXMath(game.getStack().getCardsCastThisTurn().size() - 1, m, c);
|
||||
if (sq[0].equals("DamageDoneThisTurn")) return doXMath(c.getDamageDoneThisTurn(), m, c);
|
||||
@@ -1006,8 +1005,6 @@ public class CardFactoryUtil {
|
||||
if (sq[0].startsWith("Triggered")) return doXMath(xCount((Card) c.getTriggeringObject("Card"), sq[0].substring(9)), m, c);
|
||||
|
||||
if (sq[0].contains("YourStartingLife")) return doXMath(cc.getStartingLife(), m, c);
|
||||
//if (sq[0].contains("OppStartingLife")) return doXMath(oppController.getStartingLife(), m, c); // found no cards using it
|
||||
|
||||
|
||||
if (sq[0].contains("YourLifeTotal")) return doXMath(cc.getLife(), m, c);
|
||||
if (sq[0].contains("OppGreatestLifeTotal")) return doXMath(cc.getOpponentsGreatestLifeTotal(), m, c);
|
||||
|
||||
Reference in New Issue
Block a user