mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
moved fields related to combat in current and last turn from Card to a dedicated class
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -11294,6 +11294,7 @@ src/main/java/forge/ButtonUtil.java svneol=native#text/plain
|
|||||||
src/main/java/forge/Card.java svneol=native#text/plain
|
src/main/java/forge/Card.java svneol=native#text/plain
|
||||||
src/main/java/forge/CardColor.java svneol=native#text/plain
|
src/main/java/forge/CardColor.java svneol=native#text/plain
|
||||||
src/main/java/forge/CardContainer.java svneol=native#text/plain
|
src/main/java/forge/CardContainer.java svneol=native#text/plain
|
||||||
|
src/main/java/forge/CardDamageHistory.java -text
|
||||||
src/main/java/forge/CardFilter.java svneol=native#text/plain
|
src/main/java/forge/CardFilter.java svneol=native#text/plain
|
||||||
src/main/java/forge/CardKeywords.java -text svneol=native#text/plain
|
src/main/java/forge/CardKeywords.java -text svneol=native#text/plain
|
||||||
src/main/java/forge/CardList.java svneol=native#text/plain
|
src/main/java/forge/CardList.java svneol=native#text/plain
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
|
|
||||||
private Zone castFrom = null;
|
private Zone castFrom = null;
|
||||||
|
|
||||||
|
private final CardDamageHistory damageHistory = new CardDamageHistory();
|
||||||
/**
|
/**
|
||||||
* Instantiates a new card.
|
* Instantiates a new card.
|
||||||
*/
|
*/
|
||||||
@@ -376,20 +377,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
private boolean copiedSpell = false;
|
private boolean copiedSpell = false;
|
||||||
private boolean spellWithChoices = false;
|
private boolean spellWithChoices = false;
|
||||||
private boolean spellCopyingCard = false;
|
private boolean spellCopyingCard = false;
|
||||||
private boolean creatureAttackedThisTurn = false;
|
|
||||||
private boolean creatureAttackedLastHumanTurn = false;
|
|
||||||
private boolean creatureAttackedLastComputerTurn = false;
|
|
||||||
private boolean creatureAttackedThisCombat = false;
|
|
||||||
private boolean creatureBlockedThisCombat = false;
|
|
||||||
private boolean creatureBlockedThisTurn = false;
|
|
||||||
private boolean creatureGotBlockedThisCombat = false;
|
|
||||||
private boolean creatureGotBlockedThisTurn = false;
|
|
||||||
private boolean dealtDmgToHumanThisTurn = false;
|
|
||||||
private boolean dealtDmgToComputerThisTurn = false;
|
|
||||||
private boolean dealtDmgToHumanThisGame = false;
|
|
||||||
private boolean dealtDmgToComputerThisGame = false;
|
|
||||||
private boolean dealtCombatDmgToHumanThisTurn = false;
|
|
||||||
private boolean dealtCombatDmgToComputerThisTurn = false;
|
|
||||||
private boolean sirenAttackOrDestroy = false;
|
private boolean sirenAttackOrDestroy = false;
|
||||||
private final ArrayList<Card> mustBlockCards = new ArrayList<Card>();
|
private final ArrayList<Card> mustBlockCards = new ArrayList<Card>();
|
||||||
|
|
||||||
@@ -881,202 +869,6 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
return this.xLifePaid;
|
return this.xLifePaid;
|
||||||
}
|
}
|
||||||
|
|
||||||
// used to see if an attacking creature with a triggering attack ability
|
|
||||||
// triggered this phase:
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Setter for the field <code>creatureAttackedThisCombat</code>.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @param b
|
|
||||||
* a boolean.
|
|
||||||
*/
|
|
||||||
public final void setCreatureAttackedThisCombat(final boolean b) {
|
|
||||||
this.creatureAttackedThisCombat = b;
|
|
||||||
if (b) {
|
|
||||||
this.setCreatureAttackedThisTurn(true);
|
|
||||||
this.getController().setAttackedWithCreatureThisTurn(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Getter for the field <code>creatureAttackedThisCombat</code>.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @return a boolean.
|
|
||||||
*/
|
|
||||||
public final boolean getCreatureAttackedThisCombat() {
|
|
||||||
return this.creatureAttackedThisCombat;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Setter for the field <code>creatureAttackedThisTurn</code>.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @param b
|
|
||||||
* a boolean.
|
|
||||||
*/
|
|
||||||
public final void setCreatureAttackedThisTurn(final boolean b) {
|
|
||||||
this.creatureAttackedThisTurn = b;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Getter for the field <code>creatureAttackedThisTurn</code>.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @return a boolean.
|
|
||||||
*/
|
|
||||||
public final boolean getCreatureAttackedThisTurn() {
|
|
||||||
return this.creatureAttackedThisTurn;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Setter for the field <code>creatureAttackedLastTurn</code>.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @param b
|
|
||||||
* a boolean.
|
|
||||||
*/
|
|
||||||
public final void setCreatureAttackedLastHumanTurn(final boolean b) {
|
|
||||||
this.creatureAttackedLastHumanTurn = b;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Getter for the field <code>creatureAttackedLastTurn</code>.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @return a boolean.
|
|
||||||
*/
|
|
||||||
public final boolean getCreatureAttackedLastHumanTurn() {
|
|
||||||
return this.creatureAttackedLastHumanTurn;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Setter for the field <code>creatureAttackedLastTurn</code>.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @param b
|
|
||||||
* a boolean.
|
|
||||||
*/
|
|
||||||
public final void setCreatureAttackedLastComputerTurn(final boolean b) {
|
|
||||||
this.creatureAttackedLastComputerTurn = b;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Getter for the field <code>creatureAttackedLastTurn</code>.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @return a boolean.
|
|
||||||
*/
|
|
||||||
public final boolean getCreatureAttackedLastComputerTurn() {
|
|
||||||
return this.creatureAttackedLastComputerTurn;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Setter for the field <code>creatureBlockedThisCombat</code>.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @param b
|
|
||||||
* a boolean.
|
|
||||||
*/
|
|
||||||
public final void setCreatureBlockedThisCombat(final boolean b) {
|
|
||||||
this.creatureBlockedThisCombat = b;
|
|
||||||
if (b) {
|
|
||||||
this.setCreatureBlockedThisTurn(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Getter for the field <code>creatureBlockedThisCombat</code>.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @return a boolean.
|
|
||||||
*/
|
|
||||||
public final boolean getCreatureBlockedThisCombat() {
|
|
||||||
return this.creatureBlockedThisCombat;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Setter for the field <code>creatureBlockedThisTurn</code>.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @param b
|
|
||||||
* a boolean.
|
|
||||||
*/
|
|
||||||
public final void setCreatureBlockedThisTurn(final boolean b) {
|
|
||||||
this.creatureBlockedThisTurn = b;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Getter for the field <code>creatureBlockedThisTurn</code>.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @return a boolean.
|
|
||||||
*/
|
|
||||||
public final boolean getCreatureBlockedThisTurn() {
|
|
||||||
return this.creatureBlockedThisTurn;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Setter for the field <code>creatureGotBlockedThisCombat</code>.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @param b
|
|
||||||
* a boolean.
|
|
||||||
*/
|
|
||||||
public final void setCreatureGotBlockedThisCombat(final boolean b) {
|
|
||||||
this.creatureGotBlockedThisCombat = b;
|
|
||||||
if (b) {
|
|
||||||
this.setCreatureGotBlockedThisTurn(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Getter for the field <code>creatureGotBlockedThisCombat</code>.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @return a boolean.
|
|
||||||
*/
|
|
||||||
public final boolean getCreatureGotBlockedThisCombat() {
|
|
||||||
return this.creatureGotBlockedThisCombat;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Setter for the field <code>creatureGotBlockedThisTurn</code>.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @param b
|
|
||||||
* a boolean.
|
|
||||||
*/
|
|
||||||
public final void setCreatureGotBlockedThisTurn(final boolean b) {
|
|
||||||
this.creatureGotBlockedThisTurn = b;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Getter for the field <code>creatureGotBlockedThisTurn</code>.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @return a boolean.
|
|
||||||
*/
|
|
||||||
public final boolean getCreatureGotBlockedThisTurn() {
|
|
||||||
return this.creatureGotBlockedThisTurn;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the blockedThisTurn
|
* @return the blockedThisTurn
|
||||||
*/
|
*/
|
||||||
@@ -1139,150 +931,6 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Setter for the field <code>dealtDmgToHumanThisTurn</code>.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @param b
|
|
||||||
* a boolean.
|
|
||||||
*/
|
|
||||||
public final void setDealtDmgToHumanThisTurn(final boolean b) {
|
|
||||||
this.dealtDmgToHumanThisTurn = b;
|
|
||||||
if (b) {
|
|
||||||
this.setDealtDmgToHumanThisGame(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Getter for the field <code>dealtDmgToHumanThisTurn</code>.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @return a boolean.
|
|
||||||
*/
|
|
||||||
public final boolean getDealtDmgToHumanThisTurn() {
|
|
||||||
return this.dealtDmgToHumanThisTurn;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Setter for the field <code>dealtDmgToComputerThisTurn</code>.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @param b
|
|
||||||
* a boolean.
|
|
||||||
*/
|
|
||||||
public final void setDealtDmgToComputerThisTurn(final boolean b) {
|
|
||||||
this.dealtDmgToComputerThisTurn = b;
|
|
||||||
if (b) {
|
|
||||||
this.setDealtDmgToComputerThisGame(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Getter for the field <code>dealtCombatDmgToComputerThisGame</code>.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @return a boolean.
|
|
||||||
*/
|
|
||||||
public final boolean getDealtDmgToComputerThisTurn() {
|
|
||||||
return this.dealtDmgToComputerThisTurn;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Setter for the field <code>dealtDmgToHumanThisGame</code>.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @param b
|
|
||||||
* a boolean.
|
|
||||||
*/
|
|
||||||
public final void setDealtDmgToHumanThisGame(final boolean b) {
|
|
||||||
this.dealtDmgToHumanThisGame = b;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Getter for the field <code>dealtDmgToHumanThisGame</code>.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @return a boolean.
|
|
||||||
*/
|
|
||||||
public final boolean getDealtDmgToHumanThisGame() {
|
|
||||||
return this.dealtDmgToHumanThisGame;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Setter for the field <code>dealtDmgToComputerThisGame</code>.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @param b
|
|
||||||
* a boolean.
|
|
||||||
*/
|
|
||||||
public final void setDealtDmgToComputerThisGame(final boolean b) {
|
|
||||||
this.dealtDmgToComputerThisGame = b;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Getter for the field <code>dealtCombatDmgToComputerThisGame</code>.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @return a boolean.
|
|
||||||
*/
|
|
||||||
public final boolean getDealtDmgToComputerThisGame() {
|
|
||||||
return this.dealtDmgToComputerThisGame;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Setter for the field <code>dealtCombatDmgToHumanThisTurn</code>.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @param b
|
|
||||||
* a boolean.
|
|
||||||
*/
|
|
||||||
public final void setDealtCombatDmgToHumanThisTurn(final boolean b) {
|
|
||||||
this.dealtCombatDmgToHumanThisTurn = b;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Getter for the field <code>dealtDmgToHumanThisTurn</code>.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @return a boolean.
|
|
||||||
*/
|
|
||||||
public final boolean getDealtCombatDmgToHumanThisTurn() {
|
|
||||||
return this.dealtCombatDmgToHumanThisTurn;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Setter for the field <code>dealtCombatDmgToComputerThisTurn</code>.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @param b
|
|
||||||
* a boolean.
|
|
||||||
*/
|
|
||||||
public final void setDealtCombatDmgToComputerThisTurn(final boolean b) {
|
|
||||||
this.dealtCombatDmgToComputerThisTurn = b;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Getter for the field <code>dealtDmgToComputerThisTurn</code>.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @return a boolean.
|
|
||||||
*/
|
|
||||||
public final boolean getDealtCombatDmgToComputerThisTurn() {
|
|
||||||
return this.dealtCombatDmgToComputerThisTurn;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* Setter for the field <code>sirenAttackOrDestroy</code>.
|
* Setter for the field <code>sirenAttackOrDestroy</code>.
|
||||||
@@ -7088,19 +6736,19 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (property.startsWith("dealtDamageToYouThisTurn")) {
|
} else if (property.startsWith("dealtDamageToYouThisTurn")) {
|
||||||
if (!(this.dealtDmgToHumanThisTurn && sourceController.isHuman())
|
if (!(this.getDamageHistory().getDealtDmgToHumanThisTurn() && sourceController.isHuman())
|
||||||
&& !(this.dealtDmgToComputerThisTurn && sourceController.isComputer())) {
|
&& !(this.getDamageHistory().getDealtDmgToComputerThisTurn() && sourceController.isComputer())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (property.startsWith("controllerWasDealtCombatDamageByThisTurn")) {
|
} else if (property.startsWith("controllerWasDealtCombatDamageByThisTurn")) {
|
||||||
if (!(source.dealtCombatDmgToHumanThisTurn && this.getController().isPlayer(AllZone.getHumanPlayer()))
|
if (!(source.getDamageHistory().getDealtCombatDmgToHumanThisTurn() && this.getController().isPlayer(AllZone.getHumanPlayer()))
|
||||||
&& !(source.dealtCombatDmgToComputerThisTurn && this.getController().isPlayer(
|
&& !(source.getDamageHistory().getDealtCombatDmgToComputerThisTurn() && this.getController().isPlayer(
|
||||||
AllZone.getComputerPlayer()))) {
|
AllZone.getComputerPlayer()))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (property.startsWith("controllerWasDealtDamageByThisTurn")) {
|
} else if (property.startsWith("controllerWasDealtDamageByThisTurn")) {
|
||||||
if (!(source.dealtDmgToHumanThisTurn && this.getController().isPlayer(AllZone.getHumanPlayer()))
|
if (!(source.getDamageHistory().getDealtDmgToHumanThisTurn() && this.getController().isPlayer(AllZone.getHumanPlayer()))
|
||||||
&& !(source.dealtDmgToComputerThisTurn && this.getController()
|
&& !(source.getDamageHistory().getDealtDmgToComputerThisTurn() && this.getController()
|
||||||
.isPlayer(AllZone.getComputerPlayer()))) {
|
.isPlayer(AllZone.getComputerPlayer()))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -7118,37 +6766,37 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (property.startsWith("attackedThisTurn")) {
|
} else if (property.startsWith("attackedThisTurn")) {
|
||||||
if (!this.getCreatureAttackedThisTurn()) {
|
if (!this.getDamageHistory().getCreatureAttackedThisTurn()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (property.startsWith("attackedLastTurn")) {
|
} else if (property.startsWith("attackedLastTurn")) {
|
||||||
if (this.getController().isComputer() && !this.getCreatureAttackedLastComputerTurn()) {
|
if (this.getController().isComputer() && !this.getDamageHistory().getCreatureAttackedLastComputerTurn()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (this.getController().isHuman() && !this.getCreatureAttackedLastHumanTurn()) {
|
if (this.getController().isHuman() && !this.getDamageHistory().getCreatureAttackedLastHumanTurn()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (property.startsWith("blockedThisTurn")) {
|
} else if (property.startsWith("blockedThisTurn")) {
|
||||||
if (!this.getCreatureBlockedThisTurn()) {
|
if (!this.getDamageHistory().getCreatureBlockedThisTurn()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (property.startsWith("gotBlockedThisTurn")) {
|
} else if (property.startsWith("gotBlockedThisTurn")) {
|
||||||
if (!this.getCreatureGotBlockedThisTurn()) {
|
if (!this.getDamageHistory().getCreatureGotBlockedThisTurn()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (property.startsWith("notAttackedThisTurn")) {
|
} else if (property.startsWith("notAttackedThisTurn")) {
|
||||||
if (this.getCreatureAttackedThisTurn()) {
|
if (this.getDamageHistory().getCreatureAttackedThisTurn()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (property.startsWith("notAttackedLastTurn")) {
|
} else if (property.startsWith("notAttackedLastTurn")) {
|
||||||
if (this.getController().isComputer() && this.getCreatureAttackedLastComputerTurn()) {
|
if (this.getController().isComputer() && this.getDamageHistory().getCreatureAttackedLastComputerTurn()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (this.getController().isHuman() && this.getCreatureAttackedLastHumanTurn()) {
|
if (this.getController().isHuman() && this.getDamageHistory().getCreatureAttackedLastHumanTurn()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (property.startsWith("notBlockedThisTurn")) {
|
} else if (property.startsWith("notBlockedThisTurn")) {
|
||||||
if (this.getCreatureBlockedThisTurn()) {
|
if (this.getDamageHistory().getCreatureBlockedThisTurn()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (property.startsWith("greatestPower")) {
|
} else if (property.startsWith("greatestPower")) {
|
||||||
@@ -9044,4 +8692,8 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
this.castFrom = castFrom0;
|
this.castFrom = castFrom0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CardDamageHistory getDamageHistory() {
|
||||||
|
return damageHistory;
|
||||||
|
}
|
||||||
|
|
||||||
} // end Card class
|
} // end Card class
|
||||||
|
|||||||
336
src/main/java/forge/CardDamageHistory.java
Normal file
336
src/main/java/forge/CardDamageHistory.java
Normal file
@@ -0,0 +1,336 @@
|
|||||||
|
package forge;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TODO: Write javadoc for this type.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class CardDamageHistory {
|
||||||
|
|
||||||
|
private boolean creatureAttackedThisTurn = false;
|
||||||
|
private boolean creatureAttackedLastHumanTurn = false;
|
||||||
|
private boolean creatureAttackedLastComputerTurn = false;
|
||||||
|
private boolean creatureAttackedThisCombat = false;
|
||||||
|
private boolean creatureBlockedThisCombat = false;
|
||||||
|
private boolean creatureBlockedThisTurn = false;
|
||||||
|
private boolean creatureGotBlockedThisCombat = false;
|
||||||
|
private boolean creatureGotBlockedThisTurn = false;
|
||||||
|
private boolean dealtDmgToHumanThisTurn = false;
|
||||||
|
private boolean dealtDmgToComputerThisTurn = false;
|
||||||
|
private boolean dealtDmgToHumanThisGame = false;
|
||||||
|
private boolean dealtDmgToComputerThisGame = false;
|
||||||
|
private boolean dealtCombatDmgToHumanThisTurn = false;
|
||||||
|
private boolean dealtCombatDmgToComputerThisTurn = false;
|
||||||
|
// used to see if an attacking creature with a triggering attack ability
|
||||||
|
// triggered this phase:
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Setter for the field <code>creatureAttackedThisCombat</code>.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @param hasAttacked
|
||||||
|
* a boolean.
|
||||||
|
*/
|
||||||
|
public final void setCreatureAttackedThisCombat(final boolean hasAttacked, final Player controller) {
|
||||||
|
this.creatureAttackedThisCombat = hasAttacked;
|
||||||
|
if (hasAttacked) {
|
||||||
|
this.setCreatureAttackedThisTurn(true);
|
||||||
|
controller.setAttackedWithCreatureThisTurn(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Getter for the field <code>creatureAttackedThisCombat</code>.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @return a boolean.
|
||||||
|
*/
|
||||||
|
public final boolean getCreatureAttackedThisCombat() {
|
||||||
|
return this.creatureAttackedThisCombat;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Setter for the field <code>creatureAttackedThisTurn</code>.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @param b
|
||||||
|
* a boolean.
|
||||||
|
*/
|
||||||
|
public final void setCreatureAttackedThisTurn(final boolean b) {
|
||||||
|
this.creatureAttackedThisTurn = b;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Getter for the field <code>creatureAttackedThisTurn</code>.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @return a boolean.
|
||||||
|
*/
|
||||||
|
public final boolean getCreatureAttackedThisTurn() {
|
||||||
|
return this.creatureAttackedThisTurn;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Setter for the field <code>creatureAttackedLastTurn</code>.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @param b
|
||||||
|
* a boolean.
|
||||||
|
*/
|
||||||
|
public final void setCreatureAttackedLastHumanTurn(final boolean b) {
|
||||||
|
this.creatureAttackedLastHumanTurn = b;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Getter for the field <code>creatureAttackedLastTurn</code>.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @return a boolean.
|
||||||
|
*/
|
||||||
|
public final boolean getCreatureAttackedLastHumanTurn() {
|
||||||
|
return this.creatureAttackedLastHumanTurn;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Setter for the field <code>creatureAttackedLastTurn</code>.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @param b
|
||||||
|
* a boolean.
|
||||||
|
*/
|
||||||
|
public final void setCreatureAttackedLastComputerTurn(final boolean b) {
|
||||||
|
this.creatureAttackedLastComputerTurn = b;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Getter for the field <code>creatureAttackedLastTurn</code>.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @return a boolean.
|
||||||
|
*/
|
||||||
|
public final boolean getCreatureAttackedLastComputerTurn() {
|
||||||
|
return this.creatureAttackedLastComputerTurn;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Setter for the field <code>creatureBlockedThisCombat</code>.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @param b
|
||||||
|
* a boolean.
|
||||||
|
*/
|
||||||
|
public final void setCreatureBlockedThisCombat(final boolean b) {
|
||||||
|
this.creatureBlockedThisCombat = b;
|
||||||
|
if (b) {
|
||||||
|
this.setCreatureBlockedThisTurn(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Getter for the field <code>creatureBlockedThisCombat</code>.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @return a boolean.
|
||||||
|
*/
|
||||||
|
public final boolean getCreatureBlockedThisCombat() {
|
||||||
|
return this.creatureBlockedThisCombat;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Setter for the field <code>creatureBlockedThisTurn</code>.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @param b
|
||||||
|
* a boolean.
|
||||||
|
*/
|
||||||
|
public final void setCreatureBlockedThisTurn(final boolean b) {
|
||||||
|
this.creatureBlockedThisTurn = b;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Getter for the field <code>creatureBlockedThisTurn</code>.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @return a boolean.
|
||||||
|
*/
|
||||||
|
public final boolean getCreatureBlockedThisTurn() {
|
||||||
|
return this.creatureBlockedThisTurn;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Setter for the field <code>creatureGotBlockedThisCombat</code>.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @param b
|
||||||
|
* a boolean.
|
||||||
|
*/
|
||||||
|
public final void setCreatureGotBlockedThisCombat(final boolean b) {
|
||||||
|
this.creatureGotBlockedThisCombat = b;
|
||||||
|
if (b) {
|
||||||
|
this.setCreatureGotBlockedThisTurn(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Getter for the field <code>creatureGotBlockedThisCombat</code>.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @return a boolean.
|
||||||
|
*/
|
||||||
|
public final boolean getCreatureGotBlockedThisCombat() {
|
||||||
|
return this.creatureGotBlockedThisCombat;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Setter for the field <code>creatureGotBlockedThisTurn</code>.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @param b
|
||||||
|
* a boolean.
|
||||||
|
*/
|
||||||
|
public final void setCreatureGotBlockedThisTurn(final boolean b) {
|
||||||
|
this.creatureGotBlockedThisTurn = b;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Getter for the field <code>creatureGotBlockedThisTurn</code>.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @return a boolean.
|
||||||
|
*/
|
||||||
|
public final boolean getCreatureGotBlockedThisTurn() {
|
||||||
|
return this.creatureGotBlockedThisTurn;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Setter for the field <code>dealtDmgToHumanThisTurn</code>.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @param b
|
||||||
|
* a boolean.
|
||||||
|
*/
|
||||||
|
public final void setDealtDmgToHumanThisTurn(final boolean b) {
|
||||||
|
this.dealtDmgToHumanThisTurn = b;
|
||||||
|
if (b) {
|
||||||
|
this.setDealtDmgToHumanThisGame(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Getter for the field <code>dealtDmgToHumanThisTurn</code>.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @return a boolean.
|
||||||
|
*/
|
||||||
|
public final boolean getDealtDmgToHumanThisTurn() {
|
||||||
|
return this.dealtDmgToHumanThisTurn;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Setter for the field <code>dealtDmgToComputerThisTurn</code>.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @param b
|
||||||
|
* a boolean.
|
||||||
|
*/
|
||||||
|
public final void setDealtDmgToComputerThisTurn(final boolean b) {
|
||||||
|
this.dealtDmgToComputerThisTurn = b;
|
||||||
|
if (b) {
|
||||||
|
this.setDealtDmgToComputerThisGame(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Getter for the field <code>dealtCombatDmgToComputerThisGame</code>.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @return a boolean.
|
||||||
|
*/
|
||||||
|
public final boolean getDealtDmgToComputerThisTurn() {
|
||||||
|
return this.dealtDmgToComputerThisTurn;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Setter for the field <code>dealtDmgToHumanThisGame</code>.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @param b
|
||||||
|
* a boolean.
|
||||||
|
*/
|
||||||
|
public final void setDealtDmgToHumanThisGame(final boolean b) {
|
||||||
|
this.dealtDmgToHumanThisGame = b;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Getter for the field <code>dealtDmgToHumanThisGame</code>.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @return a boolean.
|
||||||
|
*/
|
||||||
|
public final boolean getDealtDmgToHumanThisGame() {
|
||||||
|
return this.dealtDmgToHumanThisGame;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Setter for the field <code>dealtDmgToComputerThisGame</code>.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @param b
|
||||||
|
* a boolean.
|
||||||
|
*/
|
||||||
|
public final void setDealtDmgToComputerThisGame(final boolean b) {
|
||||||
|
this.dealtDmgToComputerThisGame = b;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Getter for the field <code>dealtCombatDmgToComputerThisGame</code>.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @return a boolean.
|
||||||
|
*/
|
||||||
|
public final boolean getDealtDmgToComputerThisGame() {
|
||||||
|
return this.dealtDmgToComputerThisGame;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Setter for the field <code>dealtCombatDmgToHumanThisTurn</code>.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @param b
|
||||||
|
* a boolean.
|
||||||
|
*/
|
||||||
|
public final void setDealtCombatDmgToHumanThisTurn(final boolean b) {
|
||||||
|
this.dealtCombatDmgToHumanThisTurn = b;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Getter for the field <code>dealtDmgToHumanThisTurn</code>.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @return a boolean.
|
||||||
|
*/
|
||||||
|
public final boolean getDealtCombatDmgToHumanThisTurn() {
|
||||||
|
return this.dealtCombatDmgToHumanThisTurn;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Setter for the field <code>dealtCombatDmgToComputerThisTurn</code>.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @param b
|
||||||
|
* a boolean.
|
||||||
|
*/
|
||||||
|
public final void setDealtCombatDmgToComputerThisTurn(final boolean b) {
|
||||||
|
this.dealtCombatDmgToComputerThisTurn = b;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Getter for the field <code>dealtDmgToComputerThisTurn</code>.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @return a boolean.
|
||||||
|
*/
|
||||||
|
public final boolean getDealtCombatDmgToComputerThisTurn() {
|
||||||
|
return this.dealtCombatDmgToComputerThisTurn;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -931,7 +931,7 @@ public final class CardUtil {
|
|||||||
res.setChangedCardTypes(c.getChangedCardTypes());
|
res.setChangedCardTypes(c.getChangedCardTypes());
|
||||||
res.setNewPT(new ArrayList<CardPowerToughness>(c.getNewPT()));
|
res.setNewPT(new ArrayList<CardPowerToughness>(c.getNewPT()));
|
||||||
res.setReceivedDamageFromThisTurn(c.getReceivedDamageFromThisTurn());
|
res.setReceivedDamageFromThisTurn(c.getReceivedDamageFromThisTurn());
|
||||||
res.setCreatureGotBlockedThisTurn(c.getCreatureGotBlockedThisTurn());
|
res.getDamageHistory().setCreatureGotBlockedThisTurn(c.getDamageHistory().getCreatureGotBlockedThisTurn());
|
||||||
res.setEnchanting(c.getEnchanting());
|
res.setEnchanting(c.getEnchanting());
|
||||||
res.setHaunting(c.getHaunting());
|
res.setHaunting(c.getHaunting());
|
||||||
for (final Card haunter : c.getHauntedBy()) {
|
for (final Card haunter : c.getHauntedBy()) {
|
||||||
|
|||||||
@@ -2591,7 +2591,7 @@ public class CombatUtil {
|
|||||||
AllZone.getTriggerHandler().runTrigger("Attacks", runParams);
|
AllZone.getTriggerHandler().runTrigger("Attacks", runParams);
|
||||||
|
|
||||||
// Annihilator:
|
// Annihilator:
|
||||||
if (!c.getCreatureAttackedThisCombat()) {
|
if (!c.getDamageHistory().getCreatureAttackedThisCombat()) {
|
||||||
final ArrayList<String> kws = c.getKeyword();
|
final ArrayList<String> kws = c.getKeyword();
|
||||||
final Pattern p = Pattern.compile("Annihilator [0-9]+");
|
final Pattern p = Pattern.compile("Annihilator [0-9]+");
|
||||||
Matcher m;
|
Matcher m;
|
||||||
@@ -2652,7 +2652,7 @@ public class CombatUtil {
|
|||||||
if (list.size() == 0) {
|
if (list.size() == 0) {
|
||||||
c.addExtrinsicKeyword("This card doesn't untap during your next untap step.");
|
c.addExtrinsicKeyword("This card doesn't untap during your next untap step.");
|
||||||
}
|
}
|
||||||
} else if (c.getName().equals("Witch-Maw Nephilim") && !c.getCreatureAttackedThisCombat()
|
} else if (c.getName().equals("Witch-Maw Nephilim") && !c.getDamageHistory().getCreatureAttackedThisCombat()
|
||||||
&& (c.getNetAttack() >= 10)) {
|
&& (c.getNetAttack() >= 10)) {
|
||||||
final Card charger = c;
|
final Card charger = c;
|
||||||
final Ability ability2 = new Ability(c, "0") {
|
final Ability ability2 = new Ability(c, "0") {
|
||||||
@@ -2686,7 +2686,7 @@ public class CombatUtil {
|
|||||||
|
|
||||||
} // Witch-Maw Nephilim
|
} // Witch-Maw Nephilim
|
||||||
|
|
||||||
else if (c.getName().equals("Sapling of Colfenor") && !c.getCreatureAttackedThisCombat()) {
|
else if (c.getName().equals("Sapling of Colfenor") && !c.getDamageHistory().getCreatureAttackedThisCombat()) {
|
||||||
final Player player = c.getController();
|
final Player player = c.getController();
|
||||||
|
|
||||||
final PlayerZone lib = player.getZone(Constant.Zone.Library);
|
final PlayerZone lib = player.getZone(Constant.Zone.Library);
|
||||||
@@ -2705,7 +2705,7 @@ public class CombatUtil {
|
|||||||
}
|
}
|
||||||
} // Sapling of Colfenor
|
} // Sapling of Colfenor
|
||||||
|
|
||||||
c.setCreatureAttackedThisCombat(true);
|
c.getDamageHistory().setCreatureAttackedThisCombat(true, c.getController());
|
||||||
} // checkDeclareAttackers
|
} // checkDeclareAttackers
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2734,13 +2734,13 @@ public class CombatUtil {
|
|||||||
*/
|
*/
|
||||||
public static void checkDeclareBlockers(final CardList cl) {
|
public static void checkDeclareBlockers(final CardList cl) {
|
||||||
for (final Card c : cl) {
|
for (final Card c : cl) {
|
||||||
if (!c.getCreatureBlockedThisCombat()) {
|
if (!c.getDamageHistory().getCreatureBlockedThisCombat()) {
|
||||||
for (final Ability ab : CardFactoryUtil.getBushidoEffects(c)) {
|
for (final Ability ab : CardFactoryUtil.getBushidoEffects(c)) {
|
||||||
AllZone.getStack().add(ab);
|
AllZone.getStack().add(ab);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
c.setCreatureBlockedThisCombat(true);
|
c.getDamageHistory().setCreatureBlockedThisCombat(true);
|
||||||
} // for
|
} // for
|
||||||
|
|
||||||
} // checkDeclareBlockers
|
} // checkDeclareBlockers
|
||||||
@@ -2764,7 +2764,7 @@ public class CombatUtil {
|
|||||||
runParams.put("Blocker", b);
|
runParams.put("Blocker", b);
|
||||||
AllZone.getTriggerHandler().runTrigger("Blocks", runParams);
|
AllZone.getTriggerHandler().runTrigger("Blocks", runParams);
|
||||||
|
|
||||||
if (!a.getCreatureGotBlockedThisCombat()) {
|
if (!a.getDamageHistory().getCreatureGotBlockedThisCombat()) {
|
||||||
final int blockers = AllZone.getCombat().getBlockers(a).size();
|
final int blockers = AllZone.getCombat().getBlockers(a).size();
|
||||||
runParams.put("NumBlockers", blockers);
|
runParams.put("NumBlockers", blockers);
|
||||||
AllZone.getTriggerHandler().runTrigger("AttackerBlocked", runParams);
|
AllZone.getTriggerHandler().runTrigger("AttackerBlocked", runParams);
|
||||||
@@ -2842,7 +2842,7 @@ public class CombatUtil {
|
|||||||
|
|
||||||
} // flanking
|
} // flanking
|
||||||
|
|
||||||
a.setCreatureGotBlockedThisCombat(true);
|
a.getDamageHistory().setCreatureGotBlockedThisCombat(true);
|
||||||
b.addBlockedThisTurn(a);
|
b.addBlockedThisTurn(a);
|
||||||
a.addBlockedByThisTurn(b);
|
a.addBlockedByThisTurn(b);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ public class EndOfTurn extends Phase implements java.io.Serializable {
|
|||||||
}
|
}
|
||||||
// Berserk is using this, so don't check isFaceDown()
|
// Berserk is using this, so don't check isFaceDown()
|
||||||
if (c.hasKeyword("At the beginning of the next end step, destroy CARDNAME if it attacked this turn.")) {
|
if (c.hasKeyword("At the beginning of the next end step, destroy CARDNAME if it attacked this turn.")) {
|
||||||
if (c.getCreatureAttackedThisTurn()) {
|
if (c.getDamageHistory().getCreatureAttackedThisTurn()) {
|
||||||
final Card card = c;
|
final Card card = c;
|
||||||
final SpellAbility sac = new Ability(card, "0") {
|
final SpellAbility sac = new Ability(card, "0") {
|
||||||
@Override
|
@Override
|
||||||
@@ -155,7 +155,7 @@ public class EndOfTurn extends Phase implements java.io.Serializable {
|
|||||||
AllZone.getStack().addSimultaneousStackEntry(change);
|
AllZone.getStack().addSimultaneousStackEntry(change);
|
||||||
|
|
||||||
}
|
}
|
||||||
if (c.getName().equals("Erg Raiders") && !c.getCreatureAttackedThisTurn() && !c.hasSickness()
|
if (c.getName().equals("Erg Raiders") && !c.getDamageHistory().getCreatureAttackedThisTurn() && !c.hasSickness()
|
||||||
&& Singletons.getModel().getGameState().getPhaseHandler().isPlayerTurn(c.getController())) {
|
&& Singletons.getModel().getGameState().getPhaseHandler().isPlayerTurn(c.getController())) {
|
||||||
final Card raider = c;
|
final Card raider = c;
|
||||||
final SpellAbility change = new Ability(raider, "0") {
|
final SpellAbility change = new Ability(raider, "0") {
|
||||||
@@ -279,9 +279,9 @@ public class EndOfTurn extends Phase implements java.io.Serializable {
|
|||||||
|
|
||||||
for (int i = 0; i < list.size(); i++) {
|
for (int i = 0; i < list.size(); i++) {
|
||||||
final Card c = list.get(i);
|
final Card c = list.get(i);
|
||||||
c.setCreatureAttackedThisCombat(false);
|
c.getDamageHistory().setCreatureAttackedThisCombat(false, null);
|
||||||
c.setCreatureBlockedThisCombat(false);
|
c.getDamageHistory().setCreatureBlockedThisCombat(false);
|
||||||
c.setCreatureGotBlockedThisCombat(false);
|
c.getDamageHistory().setCreatureGotBlockedThisCombat(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -755,10 +755,10 @@ public final class GameActionUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (player.isPlayer(AllZone.getHumanPlayer())) {
|
if (player.isPlayer(AllZone.getHumanPlayer())) {
|
||||||
c.setDealtDmgToHumanThisTurn(true);
|
c.getDamageHistory().setDealtDmgToHumanThisTurn(true);
|
||||||
}
|
}
|
||||||
if (player.isPlayer(AllZone.getComputerPlayer())) {
|
if (player.isPlayer(AllZone.getComputerPlayer())) {
|
||||||
c.setDealtDmgToComputerThisTurn(true);
|
c.getDamageHistory().setDealtDmgToComputerThisTurn(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -855,10 +855,10 @@ public final class GameActionUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (player.isPlayer(AllZone.getHumanPlayer())) {
|
if (player.isPlayer(AllZone.getHumanPlayer())) {
|
||||||
c.setDealtCombatDmgToHumanThisTurn(true);
|
c.getDamageHistory().setDealtCombatDmgToHumanThisTurn(true);
|
||||||
}
|
}
|
||||||
if (player.isPlayer(AllZone.getComputerPlayer())) {
|
if (player.isPlayer(AllZone.getComputerPlayer())) {
|
||||||
c.setDealtCombatDmgToComputerThisTurn(true);
|
c.getDamageHistory().setDealtCombatDmgToComputerThisTurn(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // executeCombatDamageToPlayerEffects
|
} // executeCombatDamageToPlayerEffects
|
||||||
|
|||||||
@@ -430,21 +430,21 @@ public class PhaseHandler extends MyObservable implements java.io.Serializable {
|
|||||||
c.resetPreventNextDamage();
|
c.resetPreventNextDamage();
|
||||||
c.resetReceivedDamageFromThisTurn();
|
c.resetReceivedDamageFromThisTurn();
|
||||||
c.resetDealtDamageToThisTurn();
|
c.resetDealtDamageToThisTurn();
|
||||||
c.setDealtDmgToHumanThisTurn(false);
|
c.getDamageHistory().setDealtDmgToHumanThisTurn(false);
|
||||||
c.setDealtDmgToComputerThisTurn(false);
|
c.getDamageHistory().setDealtDmgToComputerThisTurn(false);
|
||||||
c.setDealtCombatDmgToHumanThisTurn(false);
|
c.getDamageHistory().setDealtCombatDmgToHumanThisTurn(false);
|
||||||
c.setDealtCombatDmgToComputerThisTurn(false);
|
c.getDamageHistory().setDealtCombatDmgToComputerThisTurn(false);
|
||||||
c.setRegeneratedThisTurn(0);
|
c.setRegeneratedThisTurn(0);
|
||||||
c.clearMustBlockCards();
|
c.clearMustBlockCards();
|
||||||
if (Singletons.getModel().getGameState().getPhaseHandler().isPlayerTurn(AllZone.getComputerPlayer())) {
|
if (Singletons.getModel().getGameState().getPhaseHandler().isPlayerTurn(AllZone.getComputerPlayer())) {
|
||||||
c.setCreatureAttackedLastComputerTurn(c.getCreatureAttackedThisTurn());
|
c.getDamageHistory().setCreatureAttackedLastComputerTurn(c.getDamageHistory().getCreatureAttackedThisTurn());
|
||||||
}
|
}
|
||||||
if (Singletons.getModel().getGameState().getPhaseHandler().isPlayerTurn(AllZone.getHumanPlayer())) {
|
if (Singletons.getModel().getGameState().getPhaseHandler().isPlayerTurn(AllZone.getHumanPlayer())) {
|
||||||
c.setCreatureAttackedLastHumanTurn(c.getCreatureAttackedThisTurn());
|
c.getDamageHistory().setCreatureAttackedLastHumanTurn(c.getDamageHistory().getCreatureAttackedThisTurn());
|
||||||
}
|
}
|
||||||
c.setCreatureAttackedThisTurn(false);
|
c.getDamageHistory().setCreatureAttackedThisTurn(false);
|
||||||
c.setCreatureBlockedThisTurn(false);
|
c.getDamageHistory().setCreatureBlockedThisTurn(false);
|
||||||
c.setCreatureGotBlockedThisTurn(false);
|
c.getDamageHistory().setCreatureGotBlockedThisTurn(false);
|
||||||
c.clearBlockedByThisTurn();
|
c.clearBlockedByThisTurn();
|
||||||
c.clearBlockedThisTurn();
|
c.clearBlockedThisTurn();
|
||||||
}
|
}
|
||||||
@@ -838,15 +838,15 @@ public class PhaseHandler extends MyObservable implements java.io.Serializable {
|
|||||||
|
|
||||||
for (int i = 0; i < list.size(); i++) {
|
for (int i = 0; i < list.size(); i++) {
|
||||||
final Card c = list.get(i);
|
final Card c = list.get(i);
|
||||||
if (c.getCreatureAttackedThisCombat()) {
|
if (c.getDamageHistory().getCreatureAttackedThisCombat()) {
|
||||||
c.setCreatureAttackedThisCombat(false);
|
c.getDamageHistory().setCreatureAttackedThisCombat(false, null);
|
||||||
}
|
}
|
||||||
if (c.getCreatureBlockedThisCombat()) {
|
if (c.getDamageHistory().getCreatureBlockedThisCombat()) {
|
||||||
c.setCreatureBlockedThisCombat(false);
|
c.getDamageHistory().setCreatureBlockedThisCombat(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c.getCreatureGotBlockedThisCombat()) {
|
if (c.getDamageHistory().getCreatureGotBlockedThisCombat()) {
|
||||||
c.setCreatureGotBlockedThisCombat(false);
|
c.getDamageHistory().setCreatureGotBlockedThisCombat(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -331,7 +331,7 @@ public class PhaseUtil {
|
|||||||
list = list.filter(new CardListFilter() {
|
list = list.filter(new CardListFilter() {
|
||||||
@Override
|
@Override
|
||||||
public boolean addCard(final Card c) {
|
public boolean addCard(final Card c) {
|
||||||
return !c.getCreatureBlockedThisCombat();
|
return !c.getDamageHistory().getCreatureBlockedThisCombat();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -2428,10 +2428,10 @@ public abstract class Player extends GameEntity {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (property.equals("wasDealtDamageBySourceThisGame")) {
|
} else if (property.equals("wasDealtDamageBySourceThisGame")) {
|
||||||
if (this.isHuman() && !source.getDealtDmgToHumanThisGame()) {
|
if (this.isHuman() && !source.getDamageHistory().getDealtDmgToHumanThisGame()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (this.isComputer() && !source.getDealtDmgToComputerThisGame()) {
|
if (this.isComputer() && !source.getDamageHistory().getDealtDmgToComputerThisGame()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (property.startsWith("wasDealtDamageThisTurn")) {
|
} else if (property.startsWith("wasDealtDamageThisTurn")) {
|
||||||
|
|||||||
@@ -494,7 +494,7 @@ public class CardFactoryInstants {
|
|||||||
// +" flag: "+creature.getSirenAttackOrDestroy());
|
// +" flag: "+creature.getSirenAttackOrDestroy());
|
||||||
// System.out.println("Siren's Call - EOT - "+creature.getName()
|
// System.out.println("Siren's Call - EOT - "+creature.getName()
|
||||||
// +" attacked?: "+creature.getCreatureAttackedThisCombat());
|
// +" attacked?: "+creature.getCreatureAttackedThisCombat());
|
||||||
if (creature.getSirenAttackOrDestroy() && !creature.getCreatureAttackedThisTurn()) {
|
if (creature.getSirenAttackOrDestroy() && !creature.getDamageHistory().getCreatureAttackedThisTurn()) {
|
||||||
if (AllZoneUtil.isCardInPlay(creature)) {
|
if (AllZoneUtil.isCardInPlay(creature)) {
|
||||||
// System.out.println("Siren's Call - destroying "+creature.getName());
|
// System.out.println("Siren's Call - destroying "+creature.getName());
|
||||||
// this should probably go on the stack
|
// this should probably go on the stack
|
||||||
|
|||||||
Reference in New Issue
Block a user