mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
Some cleanup (#6696)
This commit is contained in:
@@ -965,7 +965,6 @@ public class PlayerControllerAi extends PlayerController {
|
||||
}
|
||||
}
|
||||
return defaultVal != null && defaultVal;
|
||||
case UntapTimeVault: return false; // TODO Should AI skip his turn for time vault?
|
||||
case LeftOrRight: return brains.chooseDirection(sa);
|
||||
case OddsOrEvens: return brains.chooseEvenOdd(sa); // false is Odd, true is Even
|
||||
default:
|
||||
|
||||
@@ -338,10 +338,16 @@ public class CardStorageReader {
|
||||
final int from = iPart * filesPerPart;
|
||||
final int till = iPart == maxParts - 1 ? totalFiles : from + filesPerPart;
|
||||
tasks.add(() -> {
|
||||
try {
|
||||
final List<CardRules> res = loadCardsInRange(allFiles, from, till);
|
||||
return res;
|
||||
} catch (Exception ex) {
|
||||
throw ex;
|
||||
} finally {
|
||||
// make sure to continue loading when using multiple threads
|
||||
cdl.countDown();
|
||||
progressObserver.report(maxParts - (int)cdl.getCount(), maxParts);
|
||||
return res;
|
||||
}
|
||||
});
|
||||
}
|
||||
return tasks;
|
||||
|
||||
@@ -20,6 +20,7 @@ package forge.game;
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
@@ -70,7 +71,7 @@ public final class GameOutcome implements Iterable<Entry<RegisteredPlayer, Playe
|
||||
private int winningTeam = -1;
|
||||
|
||||
private final HashMap<RegisteredPlayer, PlayerStatistics> playerRating = new HashMap<>();
|
||||
private final HashMap<RegisteredPlayer, String> playerNames = new HashMap<>();
|
||||
private final HashMap<RegisteredPlayer, String> playerNames = new LinkedHashMap<>();
|
||||
|
||||
private final Map<RegisteredPlayer, AnteResult> anteResult = new HashMap<>();
|
||||
private GameEndReason winCondition;
|
||||
|
||||
@@ -1483,7 +1483,7 @@ public class AbilityUtils {
|
||||
if (modifier.startsWith("Minus")) {
|
||||
int max = Integer.parseInt(modifier.substring(5));
|
||||
if (sa.hasParam("UnlessUpTo") && beforePayment) { // Flash
|
||||
max = sa.getActivatingPlayer().getController().chooseNumber(sa, Localizer.getInstance().getMessage("lblChooseNumber"), 0, max);
|
||||
max = sa.getActivatingPlayer().getController().chooseNumberForCostReduction(sa, 0, max);
|
||||
}
|
||||
newCost.decreaseGenericMana(max);
|
||||
} else {
|
||||
@@ -4000,6 +4000,7 @@ public class AbilityUtils {
|
||||
Set<String> types = new HashSet<>();
|
||||
for (Card c1 : list) {
|
||||
c1.getType().getSubtypes().forEach(types::add);
|
||||
c1.getType().getCreatureTypes().forEach(types::add);
|
||||
}
|
||||
|
||||
return types.size();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package forge.game.ability.effects;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import forge.game.Game;
|
||||
import forge.game.ability.AbilityKey;
|
||||
import forge.game.ability.AbilityUtils;
|
||||
@@ -41,12 +42,9 @@ public class ChaosEnsuesEffect extends SpellAbilityEffect {
|
||||
for (final Card c : AbilityUtils.getDefinedCards(host, sa.getParam("Defined"), sa)) {
|
||||
for (Trigger t : c.getTriggers()) {
|
||||
if (t.getMode() == TriggerType.ChaosEnsues) { // also allow current zone for any Defined
|
||||
//String zones = t.getParam("TriggerZones");
|
||||
//t.putParam("TriggerZones", zones + "," + c.getZone().getZoneType().toString());
|
||||
EnumSet<ZoneType> zones = (EnumSet<ZoneType>) t.getActiveZone();
|
||||
tweakedTrigs.put(t.getId(), zones);
|
||||
Set<ZoneType> zones = t.getActiveZone();
|
||||
tweakedTrigs.put(t.getId(), EnumSet.copyOf(zones));
|
||||
zones.add(c.getZone().getZoneType());
|
||||
t.setActiveZone(zones);
|
||||
affected.add(c);
|
||||
game.getTriggerHandler().registerOneTrigger(t);
|
||||
}
|
||||
|
||||
@@ -51,7 +51,6 @@ public class ClashEffect extends SpellAbilityEffect {
|
||||
}
|
||||
}
|
||||
|
||||
// Run triggers
|
||||
final Map<AbilityKey, Object> runParams = AbilityKey.mapFromPlayer(player);
|
||||
runParams.put(AbilityKey.Won, player.equals(winner) ? "True" : "False");
|
||||
source.getGame().getTriggerHandler().runTrigger(TriggerType.Clashed, runParams, false);
|
||||
|
||||
@@ -34,7 +34,7 @@ public class RingTemptsYouEffect extends EffectEffect {
|
||||
|
||||
// Then choose a ring-bearer (You may keep the same one). Auto pick if <2 choices.
|
||||
CardCollection creatures = p.getCreaturesInPlay();
|
||||
Card ringBearer = p.getController().chooseSingleEntityForEffect(creatures, sa, Localizer.getInstance().getMessageorUseDefault("lblChooseRingBearer", "Choose your Ring-bearer"), false, null);
|
||||
Card ringBearer = p.getController().chooseSingleEntityForEffect(creatures, sa, Localizer.getInstance().getMessage("lblChooseRingBearer"), false, null);
|
||||
p.setRingBearer(ringBearer);
|
||||
|
||||
// 701.52a That creature becomes your Ring-bearer until another player gains control of it.
|
||||
@@ -52,7 +52,6 @@ public class RingTemptsYouEffect extends EffectEffect {
|
||||
ringBearer.addLeavesPlayCommand(loseCommand);
|
||||
}
|
||||
|
||||
// Run triggers
|
||||
final Map<AbilityKey, Object> runParams = AbilityKey.mapFromPlayer(p);
|
||||
runParams.put(AbilityKey.Card, ringBearer);
|
||||
game.getTriggerHandler().runTrigger(TriggerType.RingTemptsYou, runParams, false);
|
||||
|
||||
@@ -96,7 +96,7 @@ public class CostGainControl extends CostPartWithList {
|
||||
*/
|
||||
@Override
|
||||
public String getHashForLKIList() {
|
||||
return "ControllGained"; // why the hell double "L"?
|
||||
return "ControlGained";
|
||||
}
|
||||
@Override
|
||||
public String getHashForCardList() {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package forge.game.mana;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import forge.game.event.EventValueChangeType;
|
||||
import forge.game.event.GameEventZone;
|
||||
import forge.game.player.Player;
|
||||
import forge.game.player.PlayerCollection;
|
||||
import forge.game.spellability.SpellAbility;
|
||||
import forge.game.zone.ZoneType;
|
||||
|
||||
@@ -20,7 +20,7 @@ public class ManaRefundService {
|
||||
}
|
||||
|
||||
public void refundManaPaid() {
|
||||
List<Player> payers = Lists.newArrayList();
|
||||
PlayerCollection payers = new PlayerCollection(activator);
|
||||
|
||||
// move non-undoable paying mana back to floating
|
||||
for (Mana mana : sa.getPayingMana()) {
|
||||
@@ -29,10 +29,8 @@ public class ManaRefundService {
|
||||
: mana.getManaAbility().getSourceSA().getActivatingPlayer();
|
||||
|
||||
pl.getManaPool().addMana(mana);
|
||||
if (!payers.contains(pl)) {
|
||||
payers.add(pl);
|
||||
}
|
||||
}
|
||||
|
||||
sa.getPayingMana().clear();
|
||||
|
||||
|
||||
@@ -60,7 +60,6 @@ public abstract class PlayerController {
|
||||
PlayOrDraw,
|
||||
OddsOrEvens,
|
||||
UntapOrLeaveTapped,
|
||||
UntapTimeVault,
|
||||
LeftOrRight,
|
||||
AddOrRemove,
|
||||
}
|
||||
|
||||
@@ -380,13 +380,6 @@ public class StaticAbility extends CardTraitBase implements IIdentifiable, Clone
|
||||
}
|
||||
}
|
||||
|
||||
if (hasParam("UnlessDefinedPlayer")) {
|
||||
List<Player> players = AbilityUtils.getDefinedPlayers(hostCard, getParam("UnlessDefinedPlayer"), this);
|
||||
if (!players.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasParam("TopCardOfLibraryIs")) {
|
||||
if (controller.getCardsIn(ZoneType.Library).isEmpty()) {
|
||||
return false;
|
||||
|
||||
@@ -5,6 +5,6 @@ T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.S
|
||||
SVar:TrigMonarch:DB$ BecomeMonarch | Defined$ You
|
||||
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigCloneCopy | TriggerDescription$ At the beginning of your upkeep, choose up to one other target enchantment or artifact. If you're the monarch, you may create a token that's a copy of it. If you're not the monarch, you may have CARDNAME become a copy of it, except it has this ability.
|
||||
SVar:TrigCloneCopy:DB$ Clone | Optional$ True | GainThisAbility$ True | AddSVars$ TrigCloneCopy | TgtPrompt$ Select up to one other target enchantment or artifact | ValidTgts$ Artifact.Other,Enchantment.Other | TargetMin$ 0 | TargetMax$ 1 | ConditionCheckSVar$ X | ConditionSVarCompare$ LT1 | SubAbility$ DBCopy
|
||||
SVar:DBCopy:DB$ CopyPermanent | Defined$ Targeted | ConditionCheckSVar$ X | ConditionSVarCompare$ GE1
|
||||
SVar:DBCopy:DB$ CopyPermanent | Optional$ True | Defined$ Targeted | ConditionCheckSVar$ X | ConditionSVarCompare$ GE1
|
||||
SVar:X:Count$Monarch.1.0
|
||||
Oracle:When Court of Vantress enters, you become the monarch.\nAt the beginning of your upkeep, choose up to one other target enchantment or artifact. If you're the monarch, you may create a token that's a copy of it. If you're not the monarch, you may have Court of Vantress become a copy of it, except it has this ability.
|
||||
|
||||
@@ -6,5 +6,5 @@ A:SP$ Attach | Cost$ 2 U | ValidTgts$ Creature | AILogic$ KeepTapped | AITgts$ C
|
||||
T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ TrigTap | TriggerDescription$ When CARDNAME enters, tap enchanted creature and you become the monarch.
|
||||
SVar:TrigTap:DB$ Tap | Defined$ Enchanted | SubAbility$ DBMonarch
|
||||
SVar:DBMonarch:DB$ BecomeMonarch | Defined$ You
|
||||
S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddHiddenKeyword$ CARDNAME doesn't untap during your untap step. | UnlessDefinedPlayer$ EnchantedController.isMonarch | Description$ Enchanted creature doesn't untap during its controller's untap step unless that player is the monarch.
|
||||
S:Mode$ Continuous | Affected$ Creature.EnchantedBy+ControlledBy EnchantedController.!isMonarch | AddHiddenKeyword$ CARDNAME doesn't untap during your untap step. | Description$ Enchanted creature doesn't untap during its controller's untap step unless that player is the monarch.
|
||||
Oracle:Enchant creature\nWhen Fall from Favor enters, tap enchanted creature and you become the monarch.\nEnchanted creature doesn't untap during its controller's untap step unless that player is the monarch.
|
||||
|
||||
@@ -2,7 +2,7 @@ Name:Rhystic Cave
|
||||
ManaCost:no cost
|
||||
Types:Land
|
||||
A:AB$ ChooseColor | Cost$ T | AILogic$ MostProminentInComputerDeck | SubAbility$ DBMana | InstantSpeed$ True | SpellDescription$ Choose a color. Add one mana of that color unless any player pays {1}. Activate only as an instant.
|
||||
SVar:DBMana:DB$ Mana | Produced$ Chosen | UnlessCost$ 1 | UnlessPayer$ Player | SubAbility$ DBCleanup | SpellDescription$ Add one mana of the chosen color.
|
||||
SVar:DBMana:DB$ Mana | Produced$ Chosen | UnlessCost$ 1 | UnlessPayer$ Player | SubAbility$ DBCleanup
|
||||
SVar:DBCleanup:DB$ Cleanup | ClearChosenColor$ True
|
||||
AI:RemoveDeck:All
|
||||
Oracle:{T}: Choose a color. Add one mana of that color unless any player pays {1}. Activate only as an instant.
|
||||
|
||||
@@ -1378,7 +1378,6 @@ lblUntap=Enttappen
|
||||
lblOdds=Ungerade
|
||||
lblEvens=Gerade
|
||||
lblLeaveTapped=Getappt lassen
|
||||
lblUntapAndSkipThisTurn=Enttappen (und Zug beenden)
|
||||
lblLeft=Links
|
||||
lblRight=Rechts
|
||||
lblAddCounter=Marke(n) hinzufügen
|
||||
|
||||
@@ -1396,7 +1396,6 @@ lblUntap=Untap
|
||||
lblOdds=Odds
|
||||
lblEvens=Evens
|
||||
lblLeaveTapped=Leave tapped
|
||||
lblUntapAndSkipThisTurn=Untap (and skip this turn)
|
||||
lblLeft=Left
|
||||
lblRight=Right
|
||||
lblAddCounter=Add Counter
|
||||
|
||||
@@ -1387,7 +1387,6 @@ lblUntap=Enderezar
|
||||
lblOdds=Impares
|
||||
lblEvens=Pares
|
||||
lblLeaveTapped=Dejar girado
|
||||
lblUntapAndSkipThisTurn=Enderezar (y saltarse este turno)
|
||||
lblLeft=Izquierda
|
||||
lblRight=Derecha
|
||||
lblAddCounter=Añadir contador
|
||||
|
||||
@@ -1382,7 +1382,6 @@ lblUntap=Dégager
|
||||
lblOdds=Cote
|
||||
lblEvens=Pairs
|
||||
lblLeaveTapped=Laisser tapé
|
||||
lblUntapAndSkipThisTurn=Dégager (et sauter ce tour)
|
||||
lblLeft=Gauche
|
||||
lblRight=Droite
|
||||
lblAddCounter=Ajouter un marqueur
|
||||
|
||||
@@ -1379,7 +1379,6 @@ lblUntap=Stappa
|
||||
lblOdds=Dispari
|
||||
lblEvens=Pari
|
||||
lblLeaveTapped=Lascia tappato
|
||||
lblUntapAndSkipThisTurn=Stappa (e salta questo turno)
|
||||
lblLeft=Sinistra
|
||||
lblRight=Destra
|
||||
lblAddCounter=Aggiungi un segnalino
|
||||
|
||||
@@ -1380,7 +1380,6 @@ lblUntap=アンタップ
|
||||
lblOdds=奇数
|
||||
lblEvens=偶数
|
||||
lblLeaveTapped=タップしない
|
||||
lblUntapAndSkipThisTurn=アンタップ(そしてこのターンをスキップ)
|
||||
lblLeft=左
|
||||
lblRight=右
|
||||
lblAddCounter=カウンターを追加
|
||||
|
||||
@@ -1410,7 +1410,6 @@ lblUntap=Desvirar
|
||||
lblOdds=Ímpares
|
||||
lblEvens=Pares
|
||||
lblLeaveTapped=Deixar virado
|
||||
lblUntapAndSkipThisTurn=Desvirar (e pular este turno)
|
||||
lblLeft=Esquerda
|
||||
lblRight=Direita
|
||||
lblAddCounter=Adicionar Marcador
|
||||
|
||||
@@ -1386,7 +1386,6 @@ lblUntap=重置
|
||||
lblOdds=赔率
|
||||
lblEvens=偶数
|
||||
lblLeaveTapped=轻按一下
|
||||
lblUntapAndSkipThisTurn=取消点击(并跳过当前回合)
|
||||
lblLeft=左
|
||||
lblRight=右
|
||||
lblAddCounter=增加指示物
|
||||
|
||||
@@ -1630,9 +1630,6 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
||||
case UntapOrLeaveTapped:
|
||||
labels = ImmutableList.of(localizer.getMessage("lblUntap"), localizer.getMessage("lblLeaveTapped"));
|
||||
break;
|
||||
case UntapTimeVault:
|
||||
labels = ImmutableList.of(localizer.getMessage("lblUntapAndSkipThisTurn"), localizer.getMessage("lblLeaveTapped"));
|
||||
break;
|
||||
case PlayOrDraw:
|
||||
labels = ImmutableList.of(localizer.getMessage("lblPlay"), localizer.getMessage("lblDraw"));
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user