Card & Combat & Player: combat damage with Lifelink only causes one lifegain event

This commit is contained in:
Hanmac
2016-07-28 18:15:56 +00:00
parent 08e0d2ef17
commit 1e749a57ab
3 changed files with 9 additions and 6 deletions

View File

@@ -5933,9 +5933,8 @@ public class Card extends GameEntity implements Comparable<Card> {
source.addDealtDamageToThisTurn(this, damageIn);
if (isCombat) {
game.getCombat().addDealtDamageTo(source, this);
}
if (source.hasKeyword("Lifelink")) {
} else if (source.hasKeyword("Lifelink")) {
// LifeLink not for Combat Damage at this place
source.getController().gainLife(damageIn, source);
}

View File

@@ -762,6 +762,10 @@ public class Combat {
for (final Card damageSource : dealtDamageTo.keySet()) {
final HashMap<String, Object> runParams = new HashMap<String, Object>();
int dealtDamage = damageDealtThisCombat.containsKey(damageSource) ? damageDealtThisCombat.get(damageSource) : 0;
// LifeLink for Combat Damage at this place
if (dealtDamage > 0 && damageSource.hasKeyword("Lifelink")) {
damageSource.getController().gainLife(dealtDamage, damageSource);
}
runParams.put("DamageSource", damageSource);
runParams.put("DamageTargets", dealtDamageTo.get(damageSource));
runParams.put("DamageAmount", dealtDamage);

View File

@@ -524,15 +524,15 @@ public class Player extends GameEntity implements Comparable<Player> {
}
assignedDamage.put(source, amount);
if (source.hasKeyword("Lifelink")) {
source.getController().gainLife(amount, source);
}
source.getDamageHistory().registerDamage(this);
if (isCombat) {
for (final String type : source.getType()) {
source.getController().addProwlType(type);
}
} else if (source.hasKeyword("Lifelink")) {
// LifeLink not for Combat Damage at this place
source.getController().gainLife(amount, source);
}
// Run triggers