Emissary of Grudges, Stalking Leonin

This commit is contained in:
Adam Pantel
2021-04-06 19:21:05 -04:00
parent 5b77205b77
commit ef04a4376a
9 changed files with 119 additions and 62 deletions

View File

@@ -53,7 +53,11 @@ public class ChoosePlayerEffect extends SpellAbilityEffect {
chosen = choices.isEmpty() ? null : p.getController().chooseSingleEntityForEffect(choices, sa, choiceDesc, null);
}
if( null != chosen ) {
card.setChosenPlayer(chosen);
if (sa.hasParam("Secretly")) {
card.setSecretChosenPlayer(chosen);
} else {
card.setChosenPlayer(chosen);
}
if (sa.hasParam("ForgetOtherRemembered")) {
card.clearRemembered();
}

View File

@@ -1660,6 +1660,12 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
chosenPlayer = p;
view.updateChosenPlayer(this);
}
public final void setSecretChosenPlayer(final Player p) {
chosenPlayer = p;
}
public final void revealChosenPlayer() {
view.updateChosenPlayer(this);
}
public final boolean hasChosenNumber() {
return chosenNumber != null;

View File

@@ -482,6 +482,10 @@ public class Cost implements Serializable {
return new CostExert(splitStr[0], splitStr[1], description);
}
if (parse.equals("RevealChosenPlayer")) {
return new CostRevealChosenPlayer();
}
// These won't show up with multiples
if (parse.equals("Untap") || parse.equals("Q")) {
return new CostUntap();

View File

@@ -0,0 +1,68 @@
/*
* Forge: Play Magic: the Gathering.
* Copyright (C) 2011 Forge Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package forge.game.cost;
import forge.game.card.Card;
import forge.game.player.Player;
import forge.game.spellability.SpellAbility;
public class CostRevealChosenPlayer extends CostPart {
/**
* Serializables need a version ID.
*/
private static final long serialVersionUID = 1L;
public CostRevealChosenPlayer() { }
/*
* (non-Javadoc)
*
* @see forge.card.cost.CostPart#toString()
*/
@Override
public final String toString() {
return "Reveal the player you chose";
}
/*
* (non-Javadoc)
*
* @see
* forge.card.cost.CostPart#canPay(forge.card.spellability.SpellAbility,
* forge.Card, forge.Player, forge.card.cost.Cost)
*/
@Override
public final boolean canPay(final SpellAbility ability, final Player activator) {
final Card source = ability.getHostCard();
return source.getChosenPlayer() != null && source.getTurnInController().equals(activator);
}
@Override
public boolean payAsDecided(Player ai, PaymentDecision decision, SpellAbility ability) {
ability.getHostCard().revealChosenPlayer();
return true;
}
// Inputs
public <T> T accept(ICostVisitor<T> visitor) {
return visitor.visit(this);
}
}

View File

@@ -23,6 +23,7 @@ public interface ICostVisitor<T> {
T visit(CostSacrifice cost);
T visit(CostReturn cost);
T visit(CostReveal cost);
T visit(CostRevealChosenPlayer cost);
T visit(CostRemoveAnyCounter cost);
T visit(CostRemoveCounter cost);
T visit(CostPutCounter cost);
@@ -138,6 +139,11 @@ public interface ICostVisitor<T> {
return null;
}
@Override
public T visit(CostRevealChosenPlayer cost) {
return null;
}
@Override
public T visit(CostRemoveAnyCounter cost) {
return null;