mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
- DOM: Fixed Firesong and Sunspeaker so cycling Renewed Faith wouldn't trigger it
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ public class CostGainLife extends CostPart {
|
||||
return false;
|
||||
|
||||
playersLeft--;
|
||||
opp.gainLife(c, null);
|
||||
opp.gainLife(c, ability.getHostCard(), ability);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user