From 2d3bff06afcaed110cefa96d3c490b4e5e45e67c Mon Sep 17 00:00:00 2001 From: RedstonewolfX <108761527+RedstonewolfX@users.noreply.github.com> Date: Tue, 23 Jul 2024 18:35:11 -0400 Subject: [PATCH] Added setting Added a setting to toggle the simplified shop (off by default) --- src/battle-scene.ts | 1 + src/modifier/modifier-type.ts | 24 ++++++++++++------------ src/system/settings/settings.ts | 13 ++++++++++++- 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/src/battle-scene.ts b/src/battle-scene.ts index 2088b945838..3f2c9bdde78 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -130,6 +130,7 @@ export default class BattleScene extends SceneBase { public disableDailyShinies: boolean = true; // Disables shiny luck in Daily Runs to prevent affecting RNG public quickloadDisplayMode: string = "Dailies"; public chaosmode: boolean = false; + public simpleShop: boolean = false; /** * Determines the condition for a notification should be shown for Candy Upgrades * - 0 = 'Off' diff --git a/src/modifier/modifier-type.ts b/src/modifier/modifier-type.ts index 5f82d650ec1..d37350a2b91 100644 --- a/src/modifier/modifier-type.ts +++ b/src/modifier/modifier-type.ts @@ -2055,37 +2055,37 @@ export function getPlayerShopModifierTypeOptionsForWave(scene: BattleScene, wave // Assemble the shop by removing items that would just be a waste of money // HP Restore - if (maxdmg > 0) // If any Pokemon has taken any damage, add Potion + if (!scene.simpleShop || maxdmg > 0) // If any Pokemon has taken any damage, add Potion options[0].push(new ModifierTypeOption(modifierTypes.POTION(), 0, baseCost * 0.2)) - if (maxdmg >= 20 || maxdmg_percent >= 0.1) // If Potion isn't enough, add Super Potion + if (!scene.simpleShop || maxdmg >= 20 || maxdmg_percent >= 0.1) // If Potion isn't enough, add Super Potion options[1].push(new ModifierTypeOption(modifierTypes.SUPER_POTION(), 0, baseCost * 0.45)) - if (maxdmg >= 50 || maxdmg_percent >= 0.2) // If Super Potion isn't enough, add Hyper Potion + if (!scene.simpleShop || maxdmg >= 50 || maxdmg_percent >= 0.2) // If Super Potion isn't enough, add Hyper Potion options[3].push(new ModifierTypeOption(modifierTypes.HYPER_POTION(), 0, baseCost * 0.8)) - if (maxdmg >= 200 || maxdmg_percent >= 0.5) // If Hyper Potion isn't enough, add Max Potion + if (!scene.simpleShop || maxdmg >= 200 || maxdmg_percent >= 0.5) // If Hyper Potion isn't enough, add Max Potion options[4].push(new ModifierTypeOption(modifierTypes.MAX_POTION(), 0, baseCost * 1.5)) // Status Restore - if ((maxdmg >= 200 || maxdmg_percent >= 0.5) && hasStatus) // If Hyper Potion isn't enough, and you have a status condition, add Full Restore + if (!scene.simpleShop || (maxdmg >= 200 || maxdmg_percent >= 0.5) && hasStatus) // If Hyper Potion isn't enough, and you have a status condition, add Full Restore options[5].push(new ModifierTypeOption(modifierTypes.FULL_RESTORE(), 0, baseCost * 2.25)) - if (hasStatus) // If you have a status condition, add Full Heal + if (!scene.simpleShop || hasStatus) // If you have a status condition, add Full Heal options[1].push(new ModifierTypeOption(modifierTypes.FULL_HEAL(), 0, baseCost)) // PP Restore - if (hasPPUsed) // If you have used any PP (you probably have), add Ether + if (!scene.simpleShop || hasPPUsed) // If you have used any PP (you probably have), add Ether options[0].push(new ModifierTypeOption(modifierTypes.ETHER(), 0, baseCost * 0.4)) - if (hasPPUsedOver10) // If you used at least 10 PP, add Max Ether + if (!scene.simpleShop || hasPPUsedOver10) // If you used at least 10 PP, add Max Ether options[2].push(new ModifierTypeOption(modifierTypes.MAX_ETHER(), 0, baseCost)) - if (hasPPUsedMulti) // If you have used PP from multiple moves, add Elexir + if (!scene.simpleShop || hasPPUsedMulti) // If you have used PP from multiple moves, add Elexir options[2].push(new ModifierTypeOption(modifierTypes.ELIXIR(), 0, baseCost)) - if (hasPPUsedOver10 && hasPPUsedMulti) // If you have used multiple moves' PP, and have used more than 10 in at least one, add Max Elexir + if (!scene.simpleShop || hasPPUsedOver10 && hasPPUsedMulti) // If you have used multiple moves' PP, and have used more than 10 in at least one, add Max Elexir options[4].push(new ModifierTypeOption(modifierTypes.MAX_ELIXIR(), 0, baseCost * 2.5)) // Revives - if (hasFainted) { // If a Pokemon has fainted, add Revive and Max Revive + if (!scene.simpleShop || hasFainted) { // If a Pokemon has fainted, add Revive and Max Revive options[0].push(new ModifierTypeOption(modifierTypes.REVIVE(), 0, baseCost * 2)) options[3].push(new ModifierTypeOption(modifierTypes.MAX_REVIVE(), 0, baseCost * 2.75)) } - if (multiFainted) // If multiple Pokemon are fainted, add Sacred Ash + if (!scene.simpleShop || multiFainted) // If multiple Pokemon are fainted, add Sacred Ash options[6].push(new ModifierTypeOption(modifierTypes.SACRED_ASH(), 0, baseCost * 10)) return options.slice(0, Math.ceil(Math.max(waveIndex + 10, 0) / 30)).flat(); } diff --git a/src/system/settings/settings.ts b/src/system/settings/settings.ts index 05cc9c7216b..7657b9b1bdd 100644 --- a/src/system/settings/settings.ts +++ b/src/system/settings/settings.ts @@ -106,7 +106,8 @@ export const SettingKeys = { ShowAutosaves: "SHOW_AUTOSAVES", TitleScreenContinueMode: "TITLE_SCREEN_QUICKLOAD", BiomePanels: "BIOME_PANELS", - DailyShinyLuck: "DAILY_LUCK" + DailyShinyLuck: "DAILY_LUCK", + SimpleShop: "SIMPLE_SHOP" }; /** @@ -217,6 +218,13 @@ export const Setting: Array = [ default: 1, type: SettingType.GENERAL, }, + { + key: SettingKeys.SimpleShop, + label: "Simple Shop", + options: OFF_ON, + default: 0, + type: SettingType.GENERAL + }, { key: SettingKeys.DailyShinyLuck, label: "Daily Shiny Luck", @@ -744,6 +752,9 @@ export function setSetting(scene: BattleScene, setting: string, value: integer): scene.disableDailyShinies = Setting[index].options[value].value == "Off" case SettingKeys.TitleScreenContinueMode: scene.quickloadDisplayMode = Setting[index].options[value].value; + case SettingKeys.SimpleShop: + scene.simpleShop = Setting[index].options[value].value == "On"; + break; case SettingKeys.Skip_Seen_Dialogues: scene.skipSeenDialogues = Setting[index].options[value].value === "On"; break;