Skip to content
Merged

Clean up #10500

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions forge-ai/src/main/java/forge/ai/ComputerUtilAbility.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@ public static CardCollection getAvailableLandsToPlay(final Game game, final Play
if (!game.getStack().isEmpty() || !game.getPhaseHandler().getPhase().isMain()) {
return null;
}
CardCollection landList = new CardCollection(player.getCardsIn(ZoneType.Hand));

//filter out cards that can't be played
landList = CardLists.filter(landList, c -> {
CardCollection landList = CardLists.filter(player.getCardsIn(ZoneType.Hand), c -> {
if (!c.hasPlayableLandFace()) {
return false;
}
Expand All @@ -62,9 +61,6 @@ public static CardCollection getAvailableLandsToPlay(final Game game, final Play
landList.add(crd);
}
}
if (landList.isEmpty()) {
return null;
}
return landList;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void resolve(SpellAbility sa) {
prepared.setGamePieceType(GamePieceType.TOKEN);
prepared.setState(CardStateName.PreparedSpell, true);
prepared.getOwner().getZone(ZoneType.Exile).add(prepared);
eff = createEffect(sa, activator, gameCard + "'s Prepared Spell", prepared.getImageKey());
eff = createEffect(null, gameCard, activator, gameCard + "'s Prepared Spell", prepared.getImageKey(), game.getNextTimestamp());
eff.addRemembered(prepared);
eff.setRenderForUI(false);
String castTrig = "Mode$ SpellCast | TriggerZones$ Command | Static$ True | ValidSA$ Spell.IsRemembered";
Expand Down
2 changes: 1 addition & 1 deletion forge-game/src/main/java/forge/game/card/CardState.java
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@ public ImmutableList<CardTraitBase> getTraits() {

public void resetOriginalHost(Card oldHost) {
for (final CardTraitBase ctb : getTraits()) {
if (ctb.isIntrinsic() && ctb.getOriginalHost() != null && ctb.getOriginalHost().equals(oldHost)) {
if (ctb.isIntrinsic() && oldHost.equals(ctb.getOriginalHost())) {
// only update traits with undesired host or SVar lookup would fail
ctb.setCardState(this);
}
Expand Down
2 changes: 0 additions & 2 deletions forge-gui-desktop/src/test/java/forge/ai/AITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,9 @@ protected Card findCardWithName(Game game, String name) {
return null;
}


protected SpellAbility findSAWithPrefix(Card c, String prefix) {
return findSAWithPrefix(c.getSpellAbilities(), prefix);
}

protected SpellAbility findSAWithPrefix(Iterable<SpellAbility> abilities, String prefix) {
for (SpellAbility sa : abilities) {
if (sa.getDescription().startsWith(prefix)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public Game resetGame() {
return game;
}


protected GameSimulator createSimulator(Game game, Player p) {
return new GameSimulator(new SimulationController(new Score(0)) {
@Override
Expand Down
6 changes: 3 additions & 3 deletions forge-gui/res/cardsfolder/f/finale_of_promise.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ ManaCost:X R R
Types:Sorcery
A:SP$ Pump | ValidTgts$ Instant.YouOwn+cmcLEX | TgtZone$ Graveyard | TargetMin$ 0 | TargetMax$ 1 | TgtPrompt$ Select target instant card in your graveyard with mana value X or less | RememberObjects$ Targeted | SubAbility$ DBPump | SpellDescription$ You may cast up to one target instant card and/or up to one target sorcery card from your graveyard each with mana value X or less without paying their mana costs. If a spell cast this way would be put into your graveyard this turn, exile it instead. If X is 10 or more, copy each of those spells twice. You may choose new targets for the copies.
SVar:DBPump:DB$ Pump | ValidTgts$ Sorcery.YouOwn+cmcLEX | TgtZone$ Graveyard | TargetMin$ 0 | TargetMax$ 1 | TgtPrompt$ Select target sorcery card in your graveyard with mana value X or less | RememberObjects$ Targeted | SubAbility$ DBPlay | StackDescription$ None
SVar:DBPlay:DB$ Play | Valid$ Card.IsRemembered | ValidZone$ Graveyard | ValidSA$ Spell | Controller$ You | WithoutManaCost$ True | Optional$ True | Amount$ All | SubAbility$ DBRepeat | ReplaceGraveyard$ Exile
SVar:DBRepeat:DB$ RepeatEach | DefinedCards$ Remembered | ClearRemembered$ True | ChooseOrder$ True | RepeatSubAbility$ DBCopy | ConditionCheckSVar$ X | ConditionSVarCompare$ GE10
SVar:DBCopy:DB$ CopySpellAbility | Amount$ 2 | Defined$ Remembered | MayChooseTarget$ True
SVar:DBPlay:DB$ Play | Valid$ Card.IsRemembered | ValidZone$ Graveyard | ValidSA$ Spell | Controller$ You | WithoutManaCost$ True | Optional$ True | Amount$ All | SubAbility$ DBCopy | ReplaceGraveyard$ Exile
SVar:DBCopy:DB$ CopySpellAbility | Amount$ 2 | Defined$ Remembered | MayChooseTarget$ True | ConditionCheckSVar$ X | ConditionSVarCompare$ GE10 | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:X:Count$xPaid
Oracle:You may cast up to one target instant card and/or up to one target sorcery card from your graveyard each with mana value X or less without paying their mana costs. If a spell cast this way would be put into your graveyard this turn, exile it instead. If X is 10 or more, copy each of those spells twice. You may choose new targets for the copies.
1 change: 0 additions & 1 deletion forge-gui/res/cardsfolder/f/firecat_blitz.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ ManaCost:X R R
Types:Sorcery
A:SP$ Token | TokenAmount$ X | TokenScript$ r_1_1_elemental_cat_haste | AtEOT$ Exile | SpellDescription$ Create X 1/1 red Elemental Cat creature tokens with haste. Exile them at the beginning of the next end step.
SVar:X:Count$xPaid
# X will get overwritten by Announce
K:Flashback:R R Sac<X/Mountain>
AI:RemoveDeck:All
DeckHas:Ability$Token
Expand Down
3 changes: 1 addition & 2 deletions forge-gui/res/cardsfolder/n/nahiris_sacrifice.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ Types:Sorcery
A:SP$ DealDamage | Cost$ 1 R Sac<1/Creature.cmcEQX;Artifact.cmcEQX/artifact or creature with mana value X> | Announce$ X | ValidTgts$ Creature | TgtPrompt$ Select any number of target creatures to distribute damage to | NumDmg$ X | TargetMin$ 0 | TargetMax$ MaxTgts | DividedAsYouChoose$ X | SpellDescription$ CARDNAME deals X damage divided as you choose among any number of target creatures.
SVar:MaxTgts:Count$Valid Creature
SVar:AIPreference:SacCost$Creature,Artifact
# X needs to be set this way to allow cost checks to pass — will be overwritten by Announce
SVar:X:Count$Valid Creature.YouCtrl,Artifact.YouCtrl$GreatestCardManaCost
SVar:X:Count$xPaid
Oracle:As an additional cost to cast this spell, sacrifice an artifact or creature with mana value X.\nNahiri's Sacrifice deals X damage divided as you choose among any number of target creatures.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class NetGameController implements IGameController {
private final AutoYieldStore yieldStore = new AutoYieldStore();

public NetGameController(final IToServer server) {
this.sender = new GameProtocolSender(server);
sender = new GameProtocolSender(server);
}

private void send(final ProtocolMethod method, final Object... args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ public enum FPref implements PreferencesStore.IPref {
BRAWL_P6_DECK_STATE(""),
BRAWL_P7_DECK_STATE(""),
BRAWL_P8_DECK_STATE(""),

UI_LANDSCAPE_MODE ("false"),
UI_MATCHES_PER_GAME("3"),
UI_APPLIED_VARIANTS(""),
UI_COMPACT_MAIN_MENU ("false"),
UI_USE_OLD ("false"),
UI_RANDOM_FOIL ("false"),
UI_ENABLE_AI_CHEATS ("false"),
UI_AVATARS ("0,1"),
Expand Down Expand Up @@ -104,7 +104,6 @@ public enum FPref implements PreferencesStore.IPref {
UI_OPEN_PACKS_INDIV ("false"),
UI_STACK_CREATURES ("false"),
UI_TOKENS_IN_SEPARATE_ROW("false"),
UI_UPLOAD_DRAFT ("false"),
UI_SCALE_LARGER ("true"),
UI_RENDER_BLACK_BORDERS ("true"),
UI_LARGE_CARD_VIEWERS ("false"),
Expand All @@ -115,34 +114,24 @@ public enum FPref implements PreferencesStore.IPref {
UI_SMALL_DECK_VIEWER ("false"),
UI_DETAILED_SPELLDESC_IN_PROMPT ("true"),
UI_GRAY_INACTIVE_TEXT ("true"),
UI_CARD_SIZE ("small"),
UI_SINGLE_CARD_ZOOM("false"),
UI_LIBGDX_TEXTURE_FILTERING("true"),
UI_ANTE ("false"),
UI_ANTE_MATCH_RARITY ("false"),
UI_ANTE_INCLUDE_BASIC_LANDS ("false"),
UI_SKIN ("Default"),
UI_CJK_FONT (""),
UI_PREFERRED_AVATARS_ONLY ("false"),
UI_TARGETING_OVERLAY ("2"),
UI_TIMED_TARGETING_OVERLAY_UPDATES ("true"),
UI_ENABLE_SOUNDS ("true"),
UI_ENABLE_MUSIC ("true"),
UI_VOL_SOUNDS ("100"),
UI_VOL_MUSIC ("100"),
UI_ALT_SOUND_SYSTEM ("false"),
UI_CURRENT_SOUND_SET("Default"),
UI_CURRENT_MUSIC_SET("Default"),
UI_CURRENT_AI_PROFILE ("Default"),
UI_CLONE_MODE_SOURCE ("false"),
UI_MATCH_IMAGE_VISIBLE ("true"),
UI_THEMED_COMBOBOX ("true"), // Now applies to all theme settings, not just Combo.
UI_LOCK_TITLE_BAR ("false"),
UI_HIDE_GAME_TABS ("false"), // Visibility of tabs in match screen.
UI_HIDE_GAME_TABS ("false"),
UI_MULTIPLAYER_FIELD_LAYOUT ("OFF"),
UI_MULTIPLAYER_FIELD_PANELS ("SPLIT"),
UI_CLOSE_ACTION ("NONE"),
UI_MANA_LOST_PROMPT ("false"), // Prompt on losing mana when passing priority
UI_MANA_LOST_PROMPT ("false"),
UI_STACK_EFFECT_NOTIFICATION_POLICY ("Never"),
UI_LAND_PLAYED_NOTIFICATION_POLICY ("Never"),
UI_PAUSE_WHILE_MINIMIZED("false"),
Expand Down Expand Up @@ -189,6 +178,14 @@ public enum FPref implements PreferencesStore.IPref {
UI_ZONE_TAB_NEW_COUNT("false"),
UI_ENABLE_AI_PICKER("false"),

UI_ENABLE_SOUNDS ("true"),
UI_ENABLE_MUSIC ("true"),
UI_VOL_SOUNDS ("100"),
UI_VOL_MUSIC ("100"),
UI_ALT_SOUND_SYSTEM ("false"),
UI_CURRENT_SOUND_SET("Default"),
UI_CURRENT_MUSIC_SET("Default"),

UI_VIBRATE_INTENSITY("100"),
UI_VIBRATE_ON_LIFE_LOSS("true"),
UI_VIBRATE_ON_LONG_PRESS("true"),
Expand Down Expand Up @@ -431,12 +428,7 @@ protected String getPrefDefault(final FPref key) {
return key.getDefault();
}

// was not used anywhere else
public static boolean NET_CONN = false;

/** The Constant DevMode. */
// one for normal mode, one for quest mode
public static boolean DEV_MODE;
/** The Constant UpldDrft. */
public static boolean UPLOAD_DRAFT;
}
1 change: 0 additions & 1 deletion forge-gui/src/main/java/forge/model/FModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ public void report(final int current, final int total) {
}

ForgePreferences.DEV_MODE = preferences.getPrefBoolean(FPref.DEV_MODE_ENABLED);
ForgePreferences.UPLOAD_DRAFT = ForgePreferences.NET_CONN;

getMagicDb().setStandardPredicate(getFormats().getStandard().getFilterRules());
getMagicDb().setPioneerPredicate(getFormats().getPioneer().getFilterRules());
Expand Down
Loading