mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
Add localization strings, draw markers, and updated Oubliette room
This commit is contained in:
@@ -50,7 +50,7 @@ public class RestartGameEffect extends SpellAbilityEffect {
|
||||
game.resetPlayersAttackedOnNextTurn();
|
||||
game.resetPlayersAttackedOnNextTurn();
|
||||
GameAction action = game.getAction();
|
||||
|
||||
|
||||
for (Player p: players) {
|
||||
p.setStartingLife(p.getStartingLife());
|
||||
p.clearCounters();
|
||||
@@ -58,6 +58,7 @@ public class RestartGameEffect extends SpellAbilityEffect {
|
||||
p.onCleanupPhase();
|
||||
p.setLandsPlayedLastTurn(0);
|
||||
p.resetCommanderStats();
|
||||
p.resetCompletedDungeons();
|
||||
|
||||
CardCollection newLibrary = new CardCollection(p.getCardsIn(restartZones, false));
|
||||
List<Card> filteredCards = null;
|
||||
@@ -74,7 +75,7 @@ public class RestartGameEffect extends SpellAbilityEffect {
|
||||
}
|
||||
}
|
||||
p.getZone(ZoneType.Command).removeAllCards(true);
|
||||
|
||||
|
||||
for (Card c : newLibrary) {
|
||||
action.moveToLibrary(c, 0, sa);
|
||||
}
|
||||
@@ -85,15 +86,15 @@ public class RestartGameEffect extends SpellAbilityEffect {
|
||||
|
||||
trigHandler.clearSuppression(TriggerType.Shuffled);
|
||||
trigHandler.clearSuppression(TriggerType.ChangesZone);
|
||||
|
||||
|
||||
game.resetTurnOrder();
|
||||
game.setAge(GameStage.RestartedByKarn);
|
||||
// Do not need this because ability will resolve only during that player's turn
|
||||
//game.getPhaseHandler().setPlayerTurn(sa.getActivatingPlayer());
|
||||
|
||||
|
||||
// Set turn number?
|
||||
|
||||
// The rest is handled by phaseHandler
|
||||
|
||||
// The rest is handled by phaseHandler
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package forge.game.ability.effects;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -62,18 +63,18 @@ public class SacrificeEffect extends SpellAbilityEffect {
|
||||
Cost cumCost = new Cost(sa.getParam("CumulativeUpkeep"), true);
|
||||
Cost payCost = new Cost(ManaCost.ZERO, true);
|
||||
int n = card.getCounters(CounterEnumType.AGE);
|
||||
|
||||
|
||||
// multiply cost
|
||||
for (int i = 0; i < n; ++i) {
|
||||
payCost.add(cumCost);
|
||||
}
|
||||
|
||||
|
||||
sa.setCumulativeupkeep(true);
|
||||
game.updateLastStateForCard(card);
|
||||
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("Cumulative upkeep for ").append(card);
|
||||
|
||||
|
||||
boolean isPaid = activator.getController().payManaOptional(card, payCost, sa, sb.toString(), ManaPaymentPurpose.CumulativeUpkeep);
|
||||
final Map<AbilityKey, Object> runParams = AbilityKey.mapFromCard(card);
|
||||
runParams.put(AbilityKey.CumulativeUpkeepPaid, isPaid);
|
||||
@@ -90,6 +91,7 @@ public class SacrificeEffect extends SpellAbilityEffect {
|
||||
final List<Player> tgts = getTargetPlayers(sa);
|
||||
final boolean devour = sa.hasParam("Devour");
|
||||
final boolean exploit = sa.hasParam("Exploit");
|
||||
final boolean sacEachValid = sa.hasParam("SacEachValid");
|
||||
|
||||
String valid = sa.getParam("SacValid");
|
||||
if (valid == null) {
|
||||
@@ -118,32 +120,63 @@ public class SacrificeEffect extends SpellAbilityEffect {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
CardCollectionView choosenToSacrifice = null;
|
||||
for (final Player p : tgts) {
|
||||
CardCollectionView battlefield = p.getCardsIn(ZoneType.Battlefield);
|
||||
CardCollectionView validTargets = AbilityUtils.filterListByType(battlefield, valid, sa);
|
||||
if (!destroy) {
|
||||
validTargets = CardLists.filter(validTargets, CardPredicates.canBeSacrificedBy(sa));
|
||||
}
|
||||
|
||||
if (sa.hasParam("Random")) {
|
||||
choosenToSacrifice = Aggregates.random(validTargets, Math.min(amount, validTargets.size()), new CardCollection());
|
||||
} else if (sa.hasParam("OptionalSacrifice") && !p.getController().confirmAction(sa, null, Localizer.getInstance().getMessage("lblDoYouWantSacrifice"))) {
|
||||
choosenToSacrifice = CardCollection.EMPTY;
|
||||
if (sacEachValid) { // Sacrifice maximum permanents in any combination of types specified by SacValid
|
||||
String [] validArray = valid.split(" & ");
|
||||
String [] msgArray = msg.split(" & ");
|
||||
List<CardCollection> validTargetsList = new ArrayList<>(validArray.length);
|
||||
for (String subValid : validArray) {
|
||||
CardCollectionView validTargets = AbilityUtils.filterListByType(battlefield, subValid, sa);
|
||||
validTargets = CardLists.filter(validTargets, CardPredicates.canBeSacrificedBy(sa));
|
||||
validTargetsList.add(new CardCollection(validTargets));
|
||||
}
|
||||
CardCollection chosenCards = new CardCollection();
|
||||
for (int i = 0; i < validArray.length; ++i) {
|
||||
CardCollection validTargets = validTargetsList.get(i);
|
||||
if (validTargets.isEmpty()) continue;
|
||||
if (validTargets.size() > 1 && i < validArray.length - 1) {
|
||||
// remove candidates that must be chosen for later types
|
||||
CardCollection union = new CardCollection();
|
||||
for (int j = i + 1; j < validArray.length; ++j) {
|
||||
union.addAll(validTargetsList.get(j));
|
||||
if (union.size() == (j - i) * amount) {
|
||||
validTargets.removeAll(union);
|
||||
}
|
||||
}
|
||||
}
|
||||
choosenToSacrifice = p.getController().choosePermanentsToSacrifice(sa, amount, amount, validTargets, msgArray[i]);
|
||||
for (int j = i + 1; j < validArray.length; ++j) {
|
||||
validTargetsList.get(j).removeAll(choosenToSacrifice);
|
||||
}
|
||||
chosenCards.addAll(choosenToSacrifice);
|
||||
}
|
||||
choosenToSacrifice = chosenCards;
|
||||
} else {
|
||||
boolean isOptional = sa.hasParam("Optional");
|
||||
boolean isStrict = sa.hasParam("StrictAmount");
|
||||
int minTargets = isOptional ? 0 : amount;
|
||||
boolean notEnoughTargets = isStrict && validTargets.size() < minTargets;
|
||||
|
||||
if (!notEnoughTargets) {
|
||||
choosenToSacrifice = destroy ?
|
||||
p.getController().choosePermanentsToDestroy(sa, minTargets, amount, validTargets, msg) :
|
||||
p.getController().choosePermanentsToSacrifice(sa, minTargets, amount, validTargets, msg);
|
||||
} else {
|
||||
CardCollectionView validTargets = AbilityUtils.filterListByType(battlefield, valid, sa);
|
||||
if (!destroy) {
|
||||
validTargets = CardLists.filter(validTargets, CardPredicates.canBeSacrificedBy(sa));
|
||||
}
|
||||
|
||||
if (sa.hasParam("Random")) {
|
||||
choosenToSacrifice = Aggregates.random(validTargets, Math.min(amount, validTargets.size()), new CardCollection());
|
||||
} else if (sa.hasParam("OptionalSacrifice") && !p.getController().confirmAction(sa, null, Localizer.getInstance().getMessage("lblDoYouWantSacrifice"))) {
|
||||
choosenToSacrifice = CardCollection.EMPTY;
|
||||
} else {
|
||||
boolean isOptional = sa.hasParam("Optional");
|
||||
boolean isStrict = sa.hasParam("StrictAmount");
|
||||
int minTargets = isOptional ? 0 : amount;
|
||||
boolean notEnoughTargets = isStrict && validTargets.size() < minTargets;
|
||||
|
||||
if (!notEnoughTargets) {
|
||||
choosenToSacrifice = destroy ?
|
||||
p.getController().choosePermanentsToDestroy(sa, minTargets, amount, validTargets, msg) :
|
||||
p.getController().choosePermanentsToSacrifice(sa, minTargets, amount, validTargets, msg);
|
||||
} else {
|
||||
choosenToSacrifice = CardCollection.EMPTY;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ public class VentureEffect extends SpellAbilityEffect {
|
||||
for (PaperCard pc : dungeonCards) {
|
||||
faces.add(pc.getRules().getMainPart());
|
||||
}
|
||||
String message = Localizer.getInstance().getMessage("lblChooseACardName");
|
||||
String message = Localizer.getInstance().getMessage("lblChooseDungeon");
|
||||
String chosen = player.getController().chooseCardName(sa, faces, message);
|
||||
Card dungeon = Card.fromPaperCard(StaticData.instance().getVariantCards().getUniqueByName(chosen), player);
|
||||
|
||||
@@ -81,7 +81,7 @@ public class VentureEffect extends SpellAbilityEffect {
|
||||
}
|
||||
}
|
||||
}
|
||||
final String title = Localizer.getInstance().getMessage("lblChooseAbilityForObject", dungeon.toString());
|
||||
final String title = Localizer.getInstance().getMessage("lblChooseRoom");
|
||||
SpellAbility chosen = player.getController().chooseSingleSpellForEffect(candidates, sa, title, null);
|
||||
return chosen.getParam("RoomName");
|
||||
} else {
|
||||
|
||||
@@ -1954,6 +1954,9 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
public void addCompletedDungeon(Card dungeon) {
|
||||
completedDungeons.add(dungeon);
|
||||
}
|
||||
public void resetCompletedDungeons() {
|
||||
completedDungeons.clear();
|
||||
}
|
||||
|
||||
public final void altWinBySpellEffect(final String sourceName) {
|
||||
if (cantWin()) {
|
||||
|
||||
Reference in New Issue
Block a user