mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
- dealtDamageToYouThisTurn will now work correctly even in corner cases where one of your own creatures damages you.
- Added Retaliate.
This commit is contained in:
@@ -58,7 +58,8 @@ public class Card extends MyObservable {
|
||||
private boolean creatureBlockedThisCombat = false;
|
||||
private boolean creatureGotBlockedThisCombat = false;
|
||||
//private boolean dealtCombatDmgToOppThisTurn = false;
|
||||
private boolean dealtDmgToOppThisTurn = false;
|
||||
private boolean dealtDmgToHumanThisTurn = false;
|
||||
private boolean dealtDmgToComputerThisTurn = false;
|
||||
private boolean sirenAttackOrDestroy = false;
|
||||
private boolean exaltedBonus = false;
|
||||
private boolean faceDown = false;
|
||||
@@ -271,12 +272,20 @@ public class Card extends MyObservable {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setDealtDmgToOppThisTurn(boolean b) {
|
||||
dealtDmgToOppThisTurn = b;
|
||||
public void setDealtDmgToHumanThisTurn(boolean b) {
|
||||
dealtDmgToHumanThisTurn = b;
|
||||
}
|
||||
|
||||
public boolean getDealtDmgToOppThisTurn() {
|
||||
return dealtDmgToOppThisTurn;
|
||||
public boolean getDealtDmgToHumanThisTurn() {
|
||||
return dealtDmgToHumanThisTurn;
|
||||
}
|
||||
|
||||
public void setDealtDmgToComputerThisTurn(boolean b) {
|
||||
dealtDmgToComputerThisTurn = b;
|
||||
}
|
||||
|
||||
public boolean getDealtDmgToComputerThisTurn() {
|
||||
return dealtDmgToComputerThisTurn;
|
||||
}
|
||||
|
||||
public void setSirenAttackOrDestroy(boolean b) {
|
||||
@@ -2443,8 +2452,9 @@ public class Card extends MyObservable {
|
||||
{ if(!isFaceDown()) return false;}
|
||||
else if (Property.startsWith("enteredBattlefieldThisTurn"))
|
||||
{ if(!(getTurnInZone() == AllZone.Phase.getTurn())) return false;}
|
||||
else if (Property.startsWith("dealtDamageToYouThisTurn"))
|
||||
{ if(!(dealtDmgToOppThisTurn && !getController().isPlayer(sourceController))) return false;}
|
||||
else if (Property.startsWith("dealtDamageToYouThisTurn")){
|
||||
if(!(dealtDmgToHumanThisTurn && getController().isPlayer(AllZone.ComputerPlayer))
|
||||
&& !(dealtDmgToComputerThisTurn && getController().isPlayer(AllZone.HumanPlayer))) return false;}
|
||||
|
||||
else if (Property.startsWith("enchanted"))
|
||||
{ if(!isEnchanted()) return false;}
|
||||
@@ -2643,7 +2653,7 @@ public class Card extends MyObservable {
|
||||
//the amount of damage needed to kill the creature
|
||||
public int getKillDamage() {
|
||||
int killDamage = getNetDefense() + preventNextDamage - getDamage();
|
||||
if(killDamage > preventNextDamage && getKeyword().contains("When CARDNAME is dealt damage, destroy it.")) killDamage = 1 + preventNextDamage;
|
||||
if(killDamage > preventNextDamage && hasStartOfKeyword("When CARDNAME is dealt damage, destroy it.")) killDamage = 1 + preventNextDamage;
|
||||
|
||||
return killDamage;
|
||||
}
|
||||
|
||||
@@ -9866,18 +9866,6 @@ public class CardFactory_Creatures {
|
||||
Player opponent = player.getOpponent();
|
||||
|
||||
opponent.addDamage(power, card);
|
||||
|
||||
//unTODO: this may not be needed - definitely not needed (slapshot5)
|
||||
//GameActionUtil.executeLifeLinkEffects(card, power);
|
||||
/*
|
||||
CardList cl = CardFactoryUtil.getAurasEnchanting(card, "Guilty Conscience");
|
||||
for(Card crd:cl) {
|
||||
GameActionUtil.executeGuiltyConscienceEffects(card, crd, power);
|
||||
}
|
||||
*/
|
||||
|
||||
//TODO - this may not bee needed (or may need to be added in player.addDamage
|
||||
card.setDealtDmgToOppThisTurn(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3131,7 +3131,8 @@ public class GameActionUtil {
|
||||
for(int i = 0; i < list.size(); i++) {
|
||||
Card c = list.get(i);
|
||||
//c.setDealtCombatDmgToOppThisTurn(false);
|
||||
c.setDealtDmgToOppThisTurn(false);
|
||||
c.setDealtDmgToHumanThisTurn(false);
|
||||
c.setDealtDmgToComputerThisTurn(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5876,7 +5877,8 @@ public class GameActionUtil {
|
||||
else if(c.getName().equals("Whirling Dervish") || c.getName().equals("Dunerider Outlaw"))
|
||||
playerCombatDamage_Whirling_Dervish(c);
|
||||
|
||||
if (!c.getController().isPlayer(player)) c.setDealtDmgToOppThisTurn(true);
|
||||
if (player.isPlayer(AllZone.HumanPlayer)) c.setDealtDmgToHumanThisTurn(true);
|
||||
if (player.isPlayer(AllZone.ComputerPlayer)) c.setDealtDmgToComputerThisTurn(true);
|
||||
}
|
||||
}
|
||||
//restricted to combat damage, restricted to players
|
||||
|
||||
Reference in New Issue
Block a user