TriggerSacrificed & Player: add Player Param because it might differ from the (original) controller of the card,

while copying does not seems to copy control effects too.
This commit is contained in:
Hanmac
2016-08-16 10:30:11 +00:00
parent 7ce95a0956
commit 8cc647bb93
2 changed files with 4 additions and 1 deletions

View File

@@ -2321,6 +2321,7 @@ public class Player extends GameEntity implements Comparable<Player> {
final HashMap<String, Object> runParams = new HashMap<String, Object>();
// use a copy that preserves last known information about the card (e.g. for Savra, Queen of the Golgari + Painter's Servant)
runParams.put("Card", cpy);
runParams.put("Player", this);
runParams.put("Cause", source);
runParams.put("CostStack", game.costPaymentStack);
runParams.put("IndividualCostPaymentInstance", game.costPaymentStack.peek());

View File

@@ -19,6 +19,7 @@ package forge.game.trigger;
import forge.game.card.Card;
import forge.game.cost.IndividualCostPaymentInstance;
import forge.game.player.Player;
import forge.game.spellability.SpellAbility;
import forge.game.zone.CostPaymentStack;
@@ -52,9 +53,10 @@ public class TriggerSacrificed extends Trigger {
@Override
public final boolean performTest(final java.util.Map<String, Object> runParams2) {
final Card sac = (Card) runParams2.get("Card");
final Player player = (Player) runParams2.get("Player");
final SpellAbility sourceSA = (SpellAbility) runParams2.get("Cause");
if (this.mapParams.containsKey("ValidPlayer")) {
if (!matchesValid(sac.getController(), this.mapParams.get("ValidPlayer").split(","),
if (!matchesValid(player, this.mapParams.get("ValidPlayer").split(","),
this.getHostCard())) {
return false;
}