mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
Double agenda - Summoner's Bond!
This commit is contained in:
@@ -79,6 +79,7 @@ public abstract class GameState {
|
||||
private final Map<Card, List<String>> cardToRememberedId = new HashMap<>();
|
||||
private final Map<Card, List<String>> cardToImprintedId = new HashMap<>();
|
||||
private final Map<Card, String> cardToNamedCard = new HashMap<>();
|
||||
private final Map<Card, String> cardToNamedCard2 = new HashMap<>();
|
||||
private final Map<Card, String> cardToExiledWithId = new HashMap<>();
|
||||
private final Map<Card, Card> cardAttackMap = new HashMap<>();
|
||||
|
||||
@@ -325,6 +326,9 @@ public abstract class GameState {
|
||||
if (!c.getNamedCard().isEmpty()) {
|
||||
newText.append("|NamedCard:").append(c.getNamedCard());
|
||||
}
|
||||
if (!c.getNamedCard2().isEmpty()) {
|
||||
newText.append("|NamedCard2:").append(c.getNamedCard2());
|
||||
}
|
||||
|
||||
List<String> chosenCardIds = Lists.newArrayList();
|
||||
for (Object obj : c.getChosenCards()) {
|
||||
@@ -1057,6 +1061,12 @@ public abstract class GameState {
|
||||
c.setNamedCard(entry.getValue());
|
||||
}
|
||||
|
||||
// Named card 2
|
||||
for (Entry<Card,String> entry : cardToNamedCard2.entrySet()) {
|
||||
Card c = entry.getKey();
|
||||
c.setNamedCard2(entry.getValue());
|
||||
}
|
||||
|
||||
// Chosen cards
|
||||
for (Entry<Card, CardCollection> entry : cardToChosenCards.entrySet()) {
|
||||
Card c = entry.getKey();
|
||||
@@ -1285,6 +1295,8 @@ public abstract class GameState {
|
||||
cardToChosenCards.put(c, chosen);
|
||||
} else if (info.startsWith("NamedCard:")) {
|
||||
cardToNamedCard.put(c, info.substring(info.indexOf(':') + 1));
|
||||
} else if (info.startsWith("NamedCard2:")) {
|
||||
cardToNamedCard2.put(c, info.substring(info.indexOf(':') + 1));
|
||||
} else if (info.startsWith("ExecuteScript:")) {
|
||||
cardToScript.put(c, info.substring(info.indexOf(':') + 1));
|
||||
} else if (info.startsWith("RememberedCards:")) {
|
||||
|
||||
@@ -342,7 +342,9 @@ public class GameCopier {
|
||||
if (!c.getNamedCard().isEmpty()) {
|
||||
newCard.setNamedCard(c.getNamedCard());
|
||||
}
|
||||
|
||||
if (!c.getNamedCard2().isEmpty()) {
|
||||
newCard.setNamedCard2(c.getNamedCard());
|
||||
}
|
||||
newCard.setSVars(c.getSVars());
|
||||
}
|
||||
|
||||
|
||||
@@ -121,8 +121,14 @@ public class SetStateEffect extends SpellAbilityEffect {
|
||||
String sb = p + " has unmanifested " + tgt.getName();
|
||||
game.getGameLog().add(GameLogEntryType.STACK_RESOLVE, sb);
|
||||
} else if (hiddenAgenda) {
|
||||
String sb = p + " has revealed " + tgt.getName() + " with the chosen name " + tgt.getNamedCard();
|
||||
if (tgt.hasKeyword("Double agenda")) {
|
||||
String sb = p + " has revealed " + tgt.getName() + " with the chosen names " +
|
||||
tgt.getNamedCard() + " and " + tgt.getNamedCard2();
|
||||
game.getGameLog().add(GameLogEntryType.STACK_RESOLVE, sb);
|
||||
} else {
|
||||
String sb = p + " has revealed " + tgt.getName() + " with the chosen name " + tgt.getNamedCard(); game.getGameLog().add(GameLogEntryType.STACK_RESOLVE, sb);
|
||||
game.getGameLog().add(GameLogEntryType.STACK_RESOLVE, sb);
|
||||
}
|
||||
}
|
||||
game.fireEvent(new GameEventCardStatsChanged(tgt));
|
||||
if (sa.hasParam("Mega")) {
|
||||
|
||||
@@ -232,6 +232,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
private String chosenType = "";
|
||||
private List<String> chosenColors;
|
||||
private String chosenName = "";
|
||||
private String chosenName2 = "";
|
||||
private Integer chosenNumber;
|
||||
private Player chosenPlayer;
|
||||
private EvenOdd chosenEvenOdd = null;
|
||||
@@ -1542,6 +1543,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
public boolean hasChosenName() {
|
||||
return chosenName != null;
|
||||
}
|
||||
public boolean hasChosenName2() { return chosenName2 != null; }
|
||||
|
||||
public String getChosenName() {
|
||||
return chosenName;
|
||||
@@ -1550,6 +1552,13 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
chosenName = s;
|
||||
view.updateNamedCard(this);
|
||||
}
|
||||
public String getChosenName2() {
|
||||
return chosenName2;
|
||||
}
|
||||
public final void setChosenName2(final String s) {
|
||||
chosenName2 = s;
|
||||
view.updateNamedCard2(this);
|
||||
}
|
||||
|
||||
public boolean hasChosenEvenOdd() {
|
||||
return chosenEvenOdd != null;
|
||||
@@ -1571,6 +1580,10 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
public final void setNamedCard(final String s) {
|
||||
setChosenName(s);
|
||||
}
|
||||
public final String getNamedCard2() { return getChosenName2(); }
|
||||
public final void setNamedCard2(final String s) {
|
||||
setChosenName2(s);
|
||||
}
|
||||
|
||||
public final boolean getDrawnThisTurn() {
|
||||
return drawnThisTurn;
|
||||
|
||||
@@ -198,10 +198,19 @@ public class CardFactoryUtil {
|
||||
Predicate<ICardFace> cpp = Predicates.alwaysTrue();
|
||||
//Predicate<Card> pc = Predicates.in(player.getAllCards());
|
||||
// TODO This would be better to send in the player's deck, not all cards
|
||||
String name = player.getController().chooseCardName(sa, cpp, "Card", "Name a card for " + card.getName());
|
||||
String name = player.getController().chooseCardName(sa, cpp, "Card",
|
||||
"Name a card for " + card.getName());
|
||||
if (name == null || name.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
if (card.hasKeyword("Double agenda")) {
|
||||
String name2 = player.getController().chooseCardName(sa, cpp, "Card",
|
||||
"Name a second card for " + card.getName());
|
||||
if (name2 == null || name2.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
card.setNamedCard2(name2);
|
||||
}
|
||||
|
||||
card.setNamedCard(name);
|
||||
card.turnFaceDown();
|
||||
|
||||
@@ -54,6 +54,10 @@ public class CardProperty {
|
||||
if (!card.sharesNameWith(source.getNamedCard())) {
|
||||
return false;
|
||||
}
|
||||
} else if (property.equals("NamedCard2")) {
|
||||
if (!card.sharesNameWith(source.getNamedCard2())) {
|
||||
return false;
|
||||
}
|
||||
} else if (property.equals("NamedByRememberedPlayer")) {
|
||||
if (!source.hasRemembered()) {
|
||||
final Card newCard = game.getCardState(source);
|
||||
|
||||
@@ -369,6 +369,12 @@ public class CardView extends GameEntityView {
|
||||
void updateNamedCard(Card c) {
|
||||
set(TrackableProperty.NamedCard, c.getNamedCard());
|
||||
}
|
||||
public String getNamedCard2() {
|
||||
return get(TrackableProperty.NamedCard2);
|
||||
}
|
||||
void updateNamedCard2(Card c) {
|
||||
set(TrackableProperty.NamedCard2, c.getNamedCard2());
|
||||
}
|
||||
|
||||
public boolean mayPlayerLook(PlayerView pv) {
|
||||
TrackableCollection<PlayerView> col = get(TrackableProperty.PlayerMayLook);
|
||||
|
||||
@@ -104,6 +104,7 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
private boolean unlimitedHandSize = false;
|
||||
private Card lastDrawnCard = null;
|
||||
private String namedCard = "";
|
||||
private String namedCard2 = "";
|
||||
private int numDrawnThisTurn = 0;
|
||||
private int numDrawnThisDrawStep = 0;
|
||||
private int numDiscardedThisTurn = 0;
|
||||
@@ -1905,6 +1906,10 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
public final void setNamedCard(final String s) {
|
||||
namedCard = s;
|
||||
}
|
||||
public final String getNamedCard2() { return namedCard2; }
|
||||
public final void setNamedCard2(final String s) {
|
||||
namedCard2 = s;
|
||||
}
|
||||
|
||||
public final int getTurn() {
|
||||
return stats.getTurnsPlayed();
|
||||
@@ -2898,7 +2903,7 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
// Conspiracies
|
||||
for (IPaperCard cp : registeredPlayer.getConspiracies()) {
|
||||
Card conspire = Card.fromPaperCard(cp, this);
|
||||
if (conspire.hasKeyword("Hidden agenda")) {
|
||||
if (conspire.hasKeyword("Hidden agenda") || conspire.hasKeyword("Double agenda")) {
|
||||
if (!CardFactoryUtil.handleHiddenAgenda(this, conspire)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@ public enum TrackableProperty {
|
||||
ChosenMode(TrackableTypes.StringType),
|
||||
Remembered(TrackableTypes.StringType),
|
||||
NamedCard(TrackableTypes.StringType),
|
||||
NamedCard2(TrackableTypes.StringType),
|
||||
PlayerMayLook(TrackableTypes.PlayerViewCollectionType, FreezeMode.IgnoresFreeze),
|
||||
EntityAttachedTo(TrackableTypes.GameEntityViewType),
|
||||
EncodedCards(TrackableTypes.CardViewCollectionType),
|
||||
|
||||
@@ -1029,7 +1029,7 @@ Hymn of the Wilds
|
||||
Incendiary Dissent
|
||||
Natural Unity
|
||||
#Sovereign's Realm
|
||||
#Summoner's Bond
|
||||
Summoner's Bond
|
||||
Weight Advantage
|
||||
|
||||
[KLD Planeswalker Decks]
|
||||
@@ -3579,7 +3579,7 @@ Hymn of the Wilds
|
||||
Incendiary Dissent
|
||||
Natural Unity
|
||||
#Sovereign's Realm
|
||||
#Summoner's Bond
|
||||
Summoner's Bond
|
||||
Weight Advantage
|
||||
Kaya, Ghost Assassin|CN2|2
|
||||
|
||||
|
||||
9
forge-gui/res/cardsfolder/s/summoners_bond.txt
Normal file
9
forge-gui/res/cardsfolder/s/summoners_bond.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
Name:Summoner's Bond
|
||||
ManaCost:no cost
|
||||
Types:Conspiracy
|
||||
K:Double agenda
|
||||
T:Mode$ SpellCast | ValidCard$ Creature.NamedCard | ValidActivatingPlayer$ You | Execute$ TrigSearch | OptionalDecider$ You | TriggerDescription$ Whenever you cast a creature spell with one of the chosen names, you may search your library for a creature card with the other chosen name, reveal it, put it into your hand, then shuffle your library.
|
||||
T:Mode$ SpellCast | ValidCard$ Creature.NamedCard2 | ValidActivatingPlayer$ You | Execute$ TrigSearch2 | OptionalDecider$ You | Secondary$ True | TriggerDescription$ Whenever you cast a creature spell with one of the chosen names, you may search your library for a creature card with the other chosen name, reveal it, put it into your hand, then shuffle your library.
|
||||
SVar:TrigSearch:DB$ ChangeZone | Origin$ Library | Destination$ Hand | ChangeType$ Creature.NamedCard2
|
||||
SVar:TrigSearch2:DB$ ChangeZone | Origin$ Library | Destination$ Hand | ChangeType$ Creature.NamedCard
|
||||
Oracle:Double agenda (Start the game with this conspiracy face down in the command zone and secretly choose two different card names. You may turn this conspiracy face up any time and reveal those names.)\nWhenever you cast a creature spell with one of the chosen names, you may search your library for a creature card with the other chosen name, reveal it, put it into your hand, then shuffle your library.
|
||||
@@ -442,6 +442,9 @@ public class CardDetailUtil {
|
||||
area.append("Hidden");
|
||||
} else {
|
||||
area.append(card.getNamedCard());
|
||||
if (!card.getNamedCard2().isEmpty()) {
|
||||
area.append(", ").append(card.getNamedCard2());
|
||||
}
|
||||
}
|
||||
area.append(")");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user