*Added CombatDamage parameter to AF_DealDamage.

*Corrected cards that replace damage dealt with the same damage in a different amount. (Fixes Divine Presence + Sword of X and Y)
	Akki Lavarunner // Tok-Tok Volcano Born
	Curse of Bloodletting
	Divine Presence
	Furnace of Rath
	Gratuitous Violence
	Lashknife Barrier
This commit is contained in:
Hellfish
2012-01-24 12:36:42 +00:00
parent 95e6be0cd8
commit e86a98b4d0

View File

@@ -777,6 +777,7 @@ public class AbilityFactoryDealDamage {
final int dmg = this.getNumDamage(saMe); final int dmg = this.getNumDamage(saMe);
final boolean noPrevention = params.containsKey("NoPrevention"); final boolean noPrevention = params.containsKey("NoPrevention");
final boolean combatDmg = params.containsKey("CombatDamage");
ArrayList<Object> tgts; ArrayList<Object> tgts;
if (saMe.getTarget() == null) { if (saMe.getTarget() == null) {
@@ -814,6 +815,10 @@ public class AbilityFactoryDealDamage {
if (AllZoneUtil.isCardInPlay(c) && (!targeted || c.canBeTargetedBy(saMe))) { if (AllZoneUtil.isCardInPlay(c) && (!targeted || c.canBeTargetedBy(saMe))) {
if (noPrevention) { if (noPrevention) {
c.addDamageWithoutPrevention(dmg, source); c.addDamageWithoutPrevention(dmg, source);
} else if(combatDmg) {
HashMap<Card,Integer> combatmap = new HashMap<Card,Integer>();
combatmap.put(source, dmg);
c.addCombatDamage(combatmap);
} else { } else {
c.addDamage(dmg, source); c.addDamage(dmg, source);
} }
@@ -824,6 +829,8 @@ public class AbilityFactoryDealDamage {
if (!targeted || p.canBeTargetedBy(saMe)) { if (!targeted || p.canBeTargetedBy(saMe)) {
if (noPrevention) { if (noPrevention) {
p.addDamageWithoutPrevention(dmg, source); p.addDamageWithoutPrevention(dmg, source);
} else if(combatDmg) {
p.addCombatDamage(dmg, source);
} else { } else {
p.addDamage(dmg, source); p.addDamage(dmg, source);
} }