mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
- !PrintSheets can now be referenced inside Booster contents of an edition file
- M15 Boosters no longer contain cards only found in Intro decks - Adding a few Conspiracy type cards, along with the capability of their use (NOTE: Deck editors still need a way to add Conspiracy types) - Added Brago's Favor, Immediate Action, Muzzio's Preparations, Secret Summoning, Secrets of Paradise
This commit is contained in:
@@ -211,8 +211,6 @@ public class Match {
|
||||
final Player player = players.get(i);
|
||||
final RegisteredPlayer psc = playersConditions.get(i);
|
||||
|
||||
player.initVariantsZones(psc);
|
||||
|
||||
if (canSideBoard) {
|
||||
Deck toChange = psc.getDeck();
|
||||
List<PaperCard> newMain = player.getController().sideboard(toChange, rules.getGameType());
|
||||
@@ -230,6 +228,8 @@ public class Match {
|
||||
}
|
||||
}
|
||||
|
||||
player.initVariantsZones(psc);
|
||||
|
||||
Deck myDeck = psc.getDeck();
|
||||
|
||||
Set<PaperCard> myRemovedAnteCards = null;
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
package forge.game.card;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.base.Predicates;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
@@ -56,6 +57,8 @@ import forge.game.trigger.Trigger;
|
||||
import forge.game.trigger.TriggerHandler;
|
||||
import forge.game.zone.Zone;
|
||||
import forge.game.zone.ZoneType;
|
||||
import forge.item.IPaperCard;
|
||||
import forge.item.PaperCard;
|
||||
import forge.util.Aggregates;
|
||||
import forge.util.Lang;
|
||||
|
||||
@@ -159,6 +162,50 @@ public class CardFactoryUtil {
|
||||
return morphUp;
|
||||
}
|
||||
|
||||
public static boolean handleHiddenAgenda(Player player, Card card) {
|
||||
SpellAbility sa = new SpellAbility.EmptySa(card);
|
||||
sa.getMapParams().put("AILogic", card.getSVar("AgendaLogic"));
|
||||
Predicate<PaperCard> 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());
|
||||
if (name == null || name.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
card.setNamedCard(name);
|
||||
card.turnFaceDown();
|
||||
// Hopefully face down also hides the named card?
|
||||
card.addSpellAbility(abilityRevealHiddenAgenda(card));
|
||||
return true;
|
||||
}
|
||||
|
||||
public static AbilityStatic abilityRevealHiddenAgenda(final Card sourceCard) {
|
||||
final AbilityStatic revealAgenda = new AbilityStatic(sourceCard, Cost.Zero, null) {
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
if (sourceCard.turnFaceUp()) {
|
||||
String sb = this.getActivatingPlayer() + " has revealed " + sourceCard.getName() + " with the chosen name " + sourceCard.getNamedCard();
|
||||
sourceCard.getGame().getGameLog().add(GameLogEntryType.STACK_RESOLVE, sb);
|
||||
sourceCard.getGame().fireEvent(new GameEventCardStatsChanged(sourceCard));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlay() {
|
||||
return sourceCard.getController().equals(this.getActivatingPlayer()) && sourceCard.isFaceDown()
|
||||
&& sourceCard.isInZone(ZoneType.Command);
|
||||
}
|
||||
|
||||
// TODO When should the AI activate this?
|
||||
|
||||
}; // reveal hidden agenda
|
||||
|
||||
revealAgenda.setDescription("Reveal this Hidden Agenda at any time. ");
|
||||
return revealAgenda;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* abilityCycle.
|
||||
|
||||
@@ -30,6 +30,7 @@ import forge.game.ability.AbilityFactory;
|
||||
import forge.game.ability.AbilityUtils;
|
||||
import forge.game.ability.ApiType;
|
||||
import forge.game.card.Card;
|
||||
import forge.game.card.CardFactoryUtil;
|
||||
import forge.game.card.CardLists;
|
||||
import forge.game.card.CardPredicates;
|
||||
import forge.game.card.CardPredicates.Presets;
|
||||
@@ -3321,6 +3322,16 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
|
||||
getZone(ZoneType.Command).add(eff);
|
||||
}
|
||||
|
||||
for (IPaperCard cp : registeredPlayer.getConspiracies()) {
|
||||
Card conspire = Card.fromPaperCard(cp, this);
|
||||
if (conspire.hasKeyword("Hidden agenda")) {
|
||||
if (!CardFactoryUtil.handleHiddenAgenda(this, conspire)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
com.add(conspire);
|
||||
}
|
||||
}
|
||||
|
||||
public void changeOwnership(Card card) {
|
||||
|
||||
@@ -27,6 +27,7 @@ public class RegisteredPlayer {
|
||||
private final List<IPaperCard> cardsInCommand = new ArrayList<IPaperCard>();
|
||||
private Iterable<? extends IPaperCard> schemes = null;
|
||||
private Iterable<PaperCard> planes = null;
|
||||
private Iterable<PaperCard> conspiracies = null;
|
||||
private PaperCard commander = null;
|
||||
private int teamNumber = -1; // members of teams with negative id will play FFA.
|
||||
|
||||
@@ -101,6 +102,15 @@ public class RegisteredPlayer {
|
||||
return planes == null ? EmptyList : planes;
|
||||
}
|
||||
|
||||
public Iterable<PaperCard> getConspiracies() {
|
||||
return conspiracies == null ? EmptyList : conspiracies;
|
||||
}
|
||||
|
||||
public void assignConspiracies() {
|
||||
if (currentDeck.has(DeckSection.Conspiracy))
|
||||
conspiracies = currentDeck.get(DeckSection.Conspiracy).toFlatList();
|
||||
}
|
||||
|
||||
public int getTeamNumber() {
|
||||
return teamNumber;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user