- DOM: Fixed Firesong and Sunspeaker so cycling Renewed Faith wouldn't trigger it

This commit is contained in:
swordshine
2018-03-12 09:10:18 +08:00
parent 7b837b4468
commit 0251d5776e
7 changed files with 17 additions and 6 deletions

View File

@@ -65,11 +65,11 @@ public class LifeExchangeEffect extends SpellAbilityEffect {
if ((life1 > life2) && p1.canLoseLife() && p2.canGainLife()) {
final int diff = life1 - life2;
p1.loseLife(diff);
p2.gainLife(diff, source);
p2.gainLife(diff, source, sa);
} else if ((life2 > life1) && p2.canLoseLife() && p1.canGainLife()) {
final int diff = life2 - life1;
p2.loseLife(diff);
p1.gainLife(diff, source);
p1.gainLife(diff, source, sa);
} else {
// they are equal, so nothing to do
}

View File

@@ -84,7 +84,7 @@ public class LifeExchangeVariantEffect extends SpellAbilityEffect {
game.fireEvent(new GameEventCardStatsChanged(source));
} else if ((num > pLife) && p.canGainLife()) {
final int diff = num - pLife;
p.gainLife(diff, source);
p.gainLife(diff, source, sa);
source.addNewPT(power, toughness, timestamp);
game.fireEvent(new GameEventCardStatsChanged(source));
} else {

View File

@@ -46,7 +46,7 @@ public class LifeGainEffect extends SpellAbilityEffect {
for (final Player p : tgtPlayers) {
if (!sa.usesTargeting() || p.canBeTargetedBy(sa)) {
p.gainLife(lifeAmount, sa.getHostCard());
p.gainLife(lifeAmount, sa.getHostCard(), sa);
}
}
}

View File

@@ -114,7 +114,7 @@ public class CostGainLife extends CostPart {
return false;
playersLeft--;
opp.gainLife(c, null);
opp.gainLife(c, ability.getHostCard(), ability);
}
return true;
}

View File

@@ -360,6 +360,10 @@ public class Player extends GameEntity implements Comparable<Player> {
}
public final boolean gainLife(int lifeGain, final Card source) {
return gainLife(lifeGain, source, null);
}
public final boolean gainLife(int lifeGain, final Card source, final SpellAbility sa) {
// Run any applicable replacement effects.
final Map<String, Object> repParams = Maps.newHashMap();
@@ -406,6 +410,7 @@ public class Player extends GameEntity implements Comparable<Player> {
runParams.put("Player", this);
runParams.put("LifeAmount", lifeGain);
runParams.put("Source", source);
runParams.put("SourceSA", sa);
game.getTriggerHandler().runTrigger(TriggerType.LifeGained, runParams, false);
game.fireEvent(new GameEventPlayerLivesChanged(this, oldLife, life));

View File

@@ -61,6 +61,12 @@ public class TriggerLifeGained extends Trigger {
return false;
}
}
if (this.mapParams.containsKey("Spell")) {
final SpellAbility spellAbility = (SpellAbility) runParams2.get("SourceSA");
if (spellAbility == null || !spellAbility.isSpell()) {
return false;
}
}
return true;
}

View File

@@ -3,7 +3,7 @@ ManaCost:4 R W
Types:Legendary Creature Minotaur Cleric
PT:4/6
S:Mode$ Continuous | AddKeyword$ Lifelink | Affected$ Instant.Red+YouCtrl,Sorcery.Red+YouCtrl | AffectedZone$ Stack | Description$ Red instant and sorcery spells you control have lifelink.
T:Mode$ LifeGained | ValidPlayer$ You | ValidSource$ Instant.White,Sorcery.White | TriggerZones$ Battlefield | Execute$ TrigDealDamage | TriggerDescription$ Whenever a white instant or sorcery spell causes you to gain life, CARDNAME deals 3 damage to target creature or player.
T:Mode$ LifeGained | ValidPlayer$ You | ValidSource$ Instant.White,Sorcery.White | Spell$ True | TriggerZones$ Battlefield | Execute$ TrigDealDamage | TriggerDescription$ Whenever a white instant or sorcery spell causes you to gain life, CARDNAME deals 3 damage to target creature or player.
SVar:TrigDealDamage:DB$ DealDamage | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player | NumDmg$ 3
SVar:Picture:http://www.wizards.com/global/images/magic/general/firesong_and_sunspeaker.jpg
Oracle:Red instant and sorcery spells you control have lifelink.\nWhenever a white instant or sorcery spell causes you to gain life, Firesong and Sunspeaker deals 3 damage to target creature or player.