- Added Scars of the Veteran and Sacred Boon

This commit is contained in:
moomarc
2013-06-29 18:44:17 +00:00
parent 8d3067a625
commit 7101dc02c4
5 changed files with 57 additions and 16 deletions

View File

@@ -7386,15 +7386,23 @@ public class Card extends GameEntity implements Comparable<Card> {
System.err.println(shieldSource + " - Targeting for prevention shield's effect should be done with initial spell");
}
if (restDamage >= shieldAmount) {
this.getController().getController().playSpellAbilityNoStack(this.getController(), shieldSA);
this.subtractPreventNextDamageWithEffect(shieldSource, restDamage);
restDamage = restDamage - shieldAmount;
} else {
this.subtractPreventNextDamageWithEffect(shieldSource, restDamage);
this.getController().getController().playSpellAbilityNoStack(this.getController(), shieldSA);
restDamage = 0;
boolean apiIsEffect = (shieldSA.getApi() == ApiType.Effect);
List<Card> cardsInCommand = null;
if (apiIsEffect) {
cardsInCommand = this.getGame().getCardsIn(ZoneType.Command);
}
this.getController().getController().playSpellAbilityNoStack(this.getController(), shieldSA);
if (apiIsEffect) {
List<Card> newCardsInCommand = this.getGame().getCardsIn(ZoneType.Command);
newCardsInCommand.removeAll(cardsInCommand);
if (newCardsInCommand != null && !newCardsInCommand.isEmpty()) {
newCardsInCommand.get(0).setSVar("PreventedDamage", "Number$" + Integer.toString(dmgToBePrevented));
}
}
this.subtractPreventNextDamageWithEffect(shieldSource, restDamage);
restDamage = restDamage - dmgToBePrevented;
if (DEBUGShieldsWithEffects) {
System.out.println("Remaining shields: "
+ (shieldMap.containsKey(shieldSource) ? shieldMap.get(shieldSource).get("ShieldAmount") : "all shields used"));

View File

@@ -44,6 +44,7 @@ import forge.Singletons;
import forge.card.MagicColor;
import forge.card.ability.AbilityFactory;
import forge.card.ability.AbilityUtils;
import forge.card.ability.ApiType;
import forge.card.mana.ManaCost;
import forge.card.mana.ManaPool;
import forge.card.replacement.ReplacementResult;
@@ -932,15 +933,21 @@ public class Player extends GameEntity implements Comparable<Player> {
System.err.println(shieldSource + " - Targeting for prevention shield's effect should be done with initial spell");
}
if (restDamage >= shieldAmount) {
this.getController().playSpellAbilityNoStack(this, shieldSA);
this.subtractPreventNextDamageWithEffect(shieldSource, restDamage);
restDamage = restDamage - shieldAmount;
} else {
this.subtractPreventNextDamageWithEffect(shieldSource, restDamage);
this.getController().playSpellAbilityNoStack(this, shieldSA);
restDamage = 0;
boolean apiIsEffect = (shieldSA.getApi() == ApiType.Effect);
List<Card> cardsInCommand = null;
if (apiIsEffect) {
cardsInCommand = this.getGame().getCardsIn(ZoneType.Command);
}
this.getController().playSpellAbilityNoStack(this, shieldSA);
if (apiIsEffect) {
List<Card> newCardsInCommand = this.getGame().getCardsIn(ZoneType.Command);
newCardsInCommand.removeAll(cardsInCommand);
newCardsInCommand.get(0).setSVar("PreventedDamage", "Number$" + Integer.toString(dmgToBePrevented));
}
this.subtractPreventNextDamageWithEffect(shieldSource, restDamage);
restDamage = restDamage - dmgToBePrevented;
if (DEBUGShieldsWithEffects) {
System.out.println("Remaining shields: "
+ (shieldMap.containsKey(shieldSource) ? shieldMap.get(shieldSource).get("ShieldAmount") : "all shields used"));