mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
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:
@@ -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());
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user