Added setting

Added a setting to toggle the simplified shop (off by default)
This commit is contained in:
RedstonewolfX 2024-07-23 18:35:11 -04:00
parent f5d3128a42
commit 2d3bff06af
3 changed files with 25 additions and 13 deletions

View File

@ -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'

View File

@ -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();
}

View File

@ -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<Setting> = [
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;