diff --git a/Data/Scripts/004_Game classes/010_Game_Player_Visuals.rb b/Data/Scripts/004_Game classes/010_Game_Player_Visuals.rb index 62358f622..8a1938bd0 100644 --- a/Data/Scripts/004_Game classes/010_Game_Player_Visuals.rb +++ b/Data/Scripts/004_Game classes/010_Game_Player_Visuals.rb @@ -56,7 +56,7 @@ class Game_Player < Game_Character self.move_speed = 4 # Sliding on ice elsif !moving? && !@move_route_forcing && $PokemonGlobal if $PokemonGlobal.bicycle - self.move_speed = $game_switches[RACE_BIKE] ? 5.5 : 5 # Cycling + self.move_speed = $game_switches[SWITCH_RACE_BIKE] ? 5.5 : 5 # Cycling elsif pbCanRun? || $PokemonGlobal.surfing self.move_speed = 4 # Running, surfing else diff --git a/Data/Scripts/007_Objects and windows/011_Messages.rb b/Data/Scripts/007_Objects and windows/011_Messages.rb index 4408b62c6..36edfa89d 100644 --- a/Data/Scripts/007_Objects and windows/011_Messages.rb +++ b/Data/Scripts/007_Objects and windows/011_Messages.rb @@ -421,7 +421,7 @@ def pbDisplayGoldWindow(msgwindow) end def pbDisplayBattleFactoryPointsWindow(msgwindow) - pbDisplayVariableWindow(msgwindow,"Tokens",BATTLE_FACTORY_TOKENS) + pbDisplayVariableWindow(msgwindow, "Tokens", VAR_BATTLE_FACTORY_TOKENS) end @@ -728,7 +728,7 @@ def pbMessageDisplay(msgwindow, message, letterbyletter = true, commandProc = ni head = getBasePokemonID(param.to_i, false) body = getBasePokemonID(param.to_i, true) facewindow.dispose if facewindow - path = obtainPokemonSpritePath(body, head, $game_variables[CUSTOM_SPRITES_ENABLED] == 0) + path = obtainPokemonSpritePath(body, head, $game_variables[VAR_CUSTOM_SPRITES_ENABLED] == 0) facewindow = isFusion ? PictureWindow.new(path) : PictureWindow.new("Graphics/Battlers/#{head}/#{head}.png") pbPositionNearMsgWindow(facewindow, msgwindow, :left) facewindow.viewport = msgwindow.viewport @@ -885,8 +885,8 @@ end def pbShowCommands(msgwindow, commands = nil, cmdIfCancel = 0, defaultCmd = 0) return 0 if !commands - if defaultCmd == 0 && $game_variables[COMMAND_WINDOW_INDEX] != 0 - defaultCmd = $game_variables[COMMAND_WINDOW_INDEX] + if defaultCmd == 0 && $game_variables[VAR_COMMAND_WINDOW_INDEX] != 0 + defaultCmd = $game_variables[VAR_COMMAND_WINDOW_INDEX] end cmdwindow = Window_CommandPokemonEx.new(commands) cmdwindow.z = 99999 diff --git a/Data/Scripts/010_Data/002_PBS data/013_Trainer.rb b/Data/Scripts/010_Data/002_PBS data/013_Trainer.rb index afc13259d..10b1bdee4 100644 --- a/Data/Scripts/010_Data/002_PBS data/013_Trainer.rb +++ b/Data/Scripts/010_Data/002_PBS data/013_Trainer.rb @@ -112,12 +112,12 @@ module GameData def replaceSingleSpeciesModeIfApplicable(species) - if $game_switches[SINGLE_POKEMON_MODE_SWITCH] - if $game_switches[SINGLE_POKEMON_MODE_HEAD_SWITCH] + if $game_switches[SWITCH_SINGLE_POKEMON_MODE] + if $game_switches[SWITCH_SINGLE_POKEMON_MODE_HEAD] return replaceFusionsHeadWithSpecies(species) - elsif $game_switches[SINGLE_POKEMON_MODE_BODY_SWITCH] + elsif $game_switches[SWITCH_SINGLE_POKEMON_MODE_BODY] return replaceFusionsBodyWithSpecies(species) - elsif $game_switches[SINGLE_POKEMON_MODE_RANDOM_SWITCH] + elsif $game_switches[SWITCH_SINGLE_POKEMON_MODE_RANDOM] if(rand(2) == 0) return replaceFusionsHeadWithSpecies(species) else @@ -132,7 +132,7 @@ module GameData speciesId = getDexNumberForSpecies(species) if speciesId > NB_POKEMON bodyPoke = getBodyID(speciesId) - headPoke = pbGet(SINGLE_POKEMON_MODE_VAR) + headPoke = pbGet(VAR_SINGLE_POKEMON_MODE) newSpecies = bodyPoke*NB_POKEMON+headPoke return getPokemon(newSpecies) end @@ -142,7 +142,7 @@ module GameData def replaceFusionsBodyWithSpecies(species) speciesId = getDexNumberForSpecies(species) if speciesId > NB_POKEMON - bodyPoke = pbGet(SINGLE_POKEMON_MODE_VAR) + bodyPoke = pbGet(VAR_SINGLE_POKEMON_MODE) headPoke = getHeadID(species) newSpecies = bodyPoke*NB_POKEMON+headPoke return getPokemon(newSpecies) @@ -168,7 +168,7 @@ module GameData trainer.items = @items.clone trainer.lose_text = self.lose_text - isRematch = $game_switches[IS_REMATCH_SWITCH] + isRematch = $game_switches[SWITCH_IS_REMATCH] rematchId = getRematchId(trainer.name, trainer.trainer_type) # Create each Pokémon owned by the trainer @@ -179,11 +179,11 @@ module GameData species = replace_species_with_placeholder(species) end species = replaceSingleSpeciesModeIfApplicable(species) - if $game_switches[REVERSED_MODE] + if $game_switches[SWITCH_REVERSED_MODE] species = reverseFusionSpecies(species) end level = pkmn_data[:level] - if $game_switches[GAME_DIFFICULTY_HARD] + if $game_switches[SWITCH_GAME_DIFFICULTY_HARD] level = (level * Settings::HARD_MODE_LEVEL_MODIFIER).ceil if level > Settings::MAXIMUM_LEVEL level = Settings::MAXIMUM_LEVEL diff --git a/Data/Scripts/011_Battle/001_Battler/003_Battler_ChangeSelf.rb b/Data/Scripts/011_Battle/001_Battler/003_Battler_ChangeSelf.rb index 619d375e6..a5c0a3119 100644 --- a/Data/Scripts/011_Battle/001_Battler/003_Battler_ChangeSelf.rb +++ b/Data/Scripts/011_Battle/001_Battler/003_Battler_ChangeSelf.rb @@ -83,9 +83,9 @@ class PokeBattle_Battler def updateSpirits() if $PokemonBag.pbQuantity(:ODDKEYSTONE)>=1 && @pokemon.hasType?(:GHOST) - nbSpirits = pbGet(ODDKEYSTONE_NB_VARIABLE) + nbSpirits = pbGet(VAR_ODDKEYSTONE_NB) if nbSpirits < 108 - pbSet(ODDKEYSTONE_NB_VARIABLE,nbSpirits+1) + pbSet(VAR_ODDKEYSTONE_NB, nbSpirits+1) end end end diff --git a/Data/Scripts/011_Battle/003_Battle/003_Battle_StartAndEnd.rb b/Data/Scripts/011_Battle/003_Battle/003_Battle_StartAndEnd.rb index 239ef48a5..bdfacdba6 100644 --- a/Data/Scripts/011_Battle/003_Battle/003_Battle_StartAndEnd.rb +++ b/Data/Scripts/011_Battle/003_Battle/003_Battle_StartAndEnd.rb @@ -337,7 +337,7 @@ class PokeBattle_Battle # End of battle #============================================================================= def pbGainMoney - return if $game_switches[IS_REMATCH_SWITCH] #is rematch + return if $game_switches[SWITCH_IS_REMATCH] #is rematch return if !@internalBattle || !@moneyGain # Money rewarded from opposing trainers if trainerBattle? @@ -455,7 +455,7 @@ class PokeBattle_Battle # Register captured Pokémon in the Pokédex, and store them pbRecordAndStoreCaughtPokemon - isRematch = $game_switches[IS_REMATCH_SWITCH] + isRematch = $game_switches[SWITCH_IS_REMATCH] begin if isRematch if @opponent.is_a?(Array) @@ -469,7 +469,7 @@ class PokeBattle_Battle end end rescue - $game_switches[IS_REMATCH_SWITCH]=false + $game_switches[SWITCH_IS_REMATCH]=false end diff --git a/Data/Scripts/011_Battle/003_Battle/004_Battle_ExpAndMoveLearning.rb b/Data/Scripts/011_Battle/003_Battle/004_Battle_ExpAndMoveLearning.rb index c233b46e2..e7425e259 100644 --- a/Data/Scripts/011_Battle/003_Battle/004_Battle_ExpAndMoveLearning.rb +++ b/Data/Scripts/011_Battle/003_Battle/004_Battle_ExpAndMoveLearning.rb @@ -8,7 +8,7 @@ class PokeBattle_Battle return if !@internalBattle || !@expGain # Go through each battler in turn to find the Pokémon that participated in # battle against it, and award those Pokémon Exp/EVs - expAll = (GameData::Item.exists?(:EXPALL) && $PokemonBag.pbHasItem?(:EXPALL)) || $game_switches[GAME_DIFFICULTY_EASY] + expAll = (GameData::Item.exists?(:EXPALL) && $PokemonBag.pbHasItem?(:EXPALL)) || $game_switches[SWITCH_GAME_DIFFICULTY_EASY] p1 = pbParty(0) @battlers.each do |b| next unless b && b.opposes? # Can only gain Exp from fainted foes diff --git a/Data/Scripts/011_Battle/003_Battle/006_Battle_Action_Switching.rb b/Data/Scripts/011_Battle/003_Battle/006_Battle_Action_Switching.rb index 7df14692e..19359a448 100644 --- a/Data/Scripts/011_Battle/003_Battle/006_Battle_Action_Switching.rb +++ b/Data/Scripts/011_Battle/003_Battle/006_Battle_Action_Switching.rb @@ -174,7 +174,7 @@ class PokeBattle_Battle end switchMessageHard = _INTL("{1} is about to send in a new Pokémon. Will you switch your Pokémon?", opponent.fullname) switchMessageNormal = _INTL("{1} is about to send in {2}. Will you switch your Pokémon?", opponent.full_name, enemyParty[idxPartyForName].name) - switchMessage = $game_switches[GAME_DIFFICULTY_HARD] ? switchMessageHard : switchMessageNormal + switchMessage = $game_switches[SWITCH_GAME_DIFFICULTY_HARD] ? switchMessageHard : switchMessageNormal if pbDisplayConfirm(switchMessage) idxPlayerPartyNew = pbSwitchInBetween(0, false, true) if idxPlayerPartyNew >= 0 diff --git a/Data/Scripts/012_Overworld/001_Overworld.rb b/Data/Scripts/012_Overworld/001_Overworld.rb index 29374a679..899d26288 100644 --- a/Data/Scripts/012_Overworld/001_Overworld.rb +++ b/Data/Scripts/012_Overworld/001_Overworld.rb @@ -161,7 +161,7 @@ Events.onStepTakenFieldMovement += proc { |_sender, e| } def isRepelActive() - return false if $game_switches[USED_AN_INCENSE_SWITCH] + return false if $game_switches[SWITCH_USED_AN_INCENSE] return ($PokemonGlobal.repel > 0) || $PokemonTemp.pokeradar end @@ -191,15 +191,15 @@ Events.onChangeDirection += proc { } def isFusionForced? - return false if $game_switches[RANDOMIZED_WILD_POKEMON_SWITCH] - return $game_switches[FORCE_FUSE_NEXT_POKEMON_SWITCH] || $game_switches[FORCE_ALL_WILD_FUSIONS_SWITCH] + return false if $game_switches[SWITCH_RANDOMIZED_WILD_POKEMON] + return $game_switches[SWITCH_FORCE_FUSE_NEXT_POKEMON] || $game_switches[SWITCH_FORCE_ALL_WILD_FUSIONS] end def isFusedEncounter - return false if !FUSED_WILD_POKEMON_SWITCH[35] - return false if $game_switches[RANDOMIZED_WILD_POKEMON_SWITCH] + return false if !SWITCH_FUSED_WILD_POKEMON[35] + return false if $game_switches[SWITCH_RANDOMIZED_WILD_POKEMON] return true if isFusionForced?() - chance = pbGet(WILD_FUSION_RATE_VAR) == 0 ? 5 : pbGet(WILD_FUSION_RATE_VAR) + chance = pbGet(VAR_WILD_FUSION_RATE) == 0 ? 5 : pbGet(VAR_WILD_FUSION_RATE) return (rand(chance) == 0) end @@ -217,7 +217,7 @@ def pbBattleOnStepTaken(repel_active) encounter[0] = getFusionSpecies(encounter[0], encounter_fusedWith[0]) end end - $game_switches[FORCE_FUSE_NEXT_POKEMON_SWITCH] = false + $game_switches[SWITCH_FORCE_FUSE_NEXT_POKEMON] = false encounter = EncounterModifier.trigger(encounter) if $PokemonEncounters.allow_encounter?(encounter, repel_active) diff --git a/Data/Scripts/012_Overworld/002_Battle triggering/001_Overworld_BattleStarting.rb b/Data/Scripts/012_Overworld/002_Battle triggering/001_Overworld_BattleStarting.rb index a4096f2dc..578b80a96 100644 --- a/Data/Scripts/012_Overworld/002_Battle triggering/001_Overworld_BattleStarting.rb +++ b/Data/Scripts/012_Overworld/002_Battle triggering/001_Overworld_BattleStarting.rb @@ -120,7 +120,7 @@ end def pbPrepareBattle(battle) battleRules = $PokemonTemp.battleRules # The size of the battle, i.e. how many Pokémon on each side (default: "single") - battle.setBattleMode(battleRules["size"]) if !battleRules["size"].nil? || $game_switches[NEW_GAME_PLUS] + battle.setBattleMode(battleRules["size"]) if !battleRules["size"].nil? || $game_switches[SWITCH_NEW_GAME_PLUS] # Whether the game won't black out even if the player loses (default: false) battle.canLose = battleRules["canLose"] if !battleRules["canLose"].nil? # Whether the player can choose to run from the battle (default: true) diff --git a/Data/Scripts/012_Overworld/005_Overworld_Fishing.rb b/Data/Scripts/012_Overworld/005_Overworld_Fishing.rb index 70fbaba38..ca618fe0d 100644 --- a/Data/Scripts/012_Overworld/005_Overworld_Fishing.rb +++ b/Data/Scripts/012_Overworld/005_Overworld_Fishing.rb @@ -42,7 +42,7 @@ def pbFishingEnd end def pbFishing(hasEncounter,rodType=1) - autohook= Settings::FISHING_AUTO_HOOK || $game_switches[FISHING_AUTOHOOK_SWITCH] + autohook= Settings::FISHING_AUTO_HOOK || $game_switches[SWITCH_FISHING_AUTOHOOK] speedup = ($Trainer.first_pokemon && [:STICKYHOLD, :SUCTIONCUPS].include?($Trainer.first_pokemon.ability_id)) biteChance = 20+(25*rodType) # 45, 70, 95 biteChance *= 1.5 if speedup # 67.5, 100, 100 @@ -133,7 +133,7 @@ end # A Pokémon is biting, reflex test to reel it in def pbWaitForInput(msgWindow,message,frames) - autohook= Settings::FISHING_AUTO_HOOK || $game_switches[FISHING_AUTOHOOK_SWITCH] + autohook= Settings::FISHING_AUTO_HOOK || $game_switches[SWITCH_FISHING_AUTOHOOK] pbMessageDisplay(msgWindow,message,false) numFrame = 0 twitchFrame = 0 diff --git a/Data/Scripts/013_Items/002_Item_Effects.rb b/Data/Scripts/013_Items/002_Item_Effects.rb index b3fbb8286..570b80d40 100644 --- a/Data/Scripts/013_Items/002_Item_Effects.rb +++ b/Data/Scripts/013_Items/002_Item_Effects.rb @@ -87,7 +87,7 @@ ItemHandlers::ConfirmUseInField.add(:ESCAPEROPE, proc { |item| #=============================================================================== def pbRepel(item, steps) - message = $game_switches[USED_AN_INCENSE_SWITCH] ? "But an incense's effect still lingers from earlier." : "But a repellent's effect still lingers from earlier." + message = $game_switches[SWITCH_USED_AN_INCENSE] ? "But an incense's effect still lingers from earlier." : "But a repellent's effect still lingers from earlier." if $PokemonGlobal.repel > 0 pbMessage(_INTL(message)) return 0 @@ -99,8 +99,8 @@ end ItemHandlers::UseInField.add(:FUSIONREPEL, proc { |item| - $game_switches[FORCE_ALL_WILD_FUSIONS_SWITCH] = true - $game_switches[USED_AN_INCENSE_SWITCH] = true + $game_switches[SWITCH_FORCE_ALL_WILD_FUSIONS] = true + $game_switches[SWITCH_USED_AN_INCENSE] = true next pbRepel(item, 50) }) @@ -120,9 +120,9 @@ Events.onStepTaken += proc { if $PokemonGlobal.repel > 0 && !$game_player.terrain_tag.ice # Shouldn't count down if on ice $PokemonGlobal.repel -= 1 if $PokemonGlobal.repel <= 0 - isIncense = $game_switches[USED_AN_INCENSE_SWITCH] - $game_switches[FORCE_ALL_WILD_FUSIONS_SWITCH] = false - $game_switches[USED_AN_INCENSE_SWITCH] = false + isIncense = $game_switches[SWITCH_USED_AN_INCENSE] + $game_switches[SWITCH_FORCE_ALL_WILD_FUSIONS] = false + $game_switches[SWITCH_USED_AN_INCENSE] = false itemName= isIncense ? "incense" : "repellent" if $PokemonBag.pbHasItem?(:REPEL) || $PokemonBag.pbHasItem?(:SUPERREPEL) || diff --git a/Data/Scripts/015_Trainers and player/001_Trainer.rb b/Data/Scripts/015_Trainers and player/001_Trainer.rb index 34b053460..9c9681df9 100644 --- a/Data/Scripts/015_Trainers and player/001_Trainer.rb +++ b/Data/Scripts/015_Trainers and player/001_Trainer.rb @@ -64,7 +64,7 @@ class Trainer end def skill_level - if $game_switches[GAME_DIFFICULTY_HARD] + if $game_switches[SWITCH_GAME_DIFFICULTY_HARD] return 100 end return GameData::TrainerType.get(@trainer_type).skill_level; diff --git a/Data/Scripts/016_UI/001_Non-interactive UI/006_UI_HallOfFame.rb b/Data/Scripts/016_UI/001_Non-interactive UI/006_UI_HallOfFame.rb index 69d118154..e58482cdb 100644 --- a/Data/Scripts/016_UI/001_Non-interactive UI/006_UI_HallOfFame.rb +++ b/Data/Scripts/016_UI/001_Non-interactive UI/006_UI_HallOfFame.rb @@ -277,9 +277,9 @@ class HallOfFame_Scene end def getDifficulty - if $game_switches[GAME_DIFFICULTY_EASY] + if $game_switches[SWITCH_GAME_DIFFICULTY_EASY] return "Easy" - elsif $game_switches[GAME_DIFFICULTY_HARD] + elsif $game_switches[SWITCH_GAME_DIFFICULTY_HARD] return "Hard" else return "Normal" diff --git a/Data/Scripts/016_UI/012_UI_TrainerCard.rb b/Data/Scripts/016_UI/012_UI_TrainerCard.rb index 80644841e..4fcd69779 100644 --- a/Data/Scripts/016_UI/012_UI_TrainerCard.rb +++ b/Data/Scripts/016_UI/012_UI_TrainerCard.rb @@ -18,7 +18,7 @@ class PokemonTrainerCard_Scene end cardexists = pbResolveBitmap(sprintf("Graphics/Pictures/Trainer Card/card_f")) @sprites["card"] = IconSprite.new(0,0,@viewport) - is_postgame = $game_switches[BEAT_THE_LEAGUE] + is_postgame = $game_switches[SWITCH_BEAT_THE_LEAGUE] if $Trainer.female? && cardexists path = "Graphics/Pictures/Trainer Card/card_f" if is_postgame @@ -74,7 +74,7 @@ class PokemonTrainerCard_Scene pbDrawTextPositions(overlay,textPositions) x = 72 imagePositions = [] - postgame = $game_switches[BEAT_THE_LEAGUE] + postgame = $game_switches[SWITCH_BEAT_THE_LEAGUE] numberOfBadgesDisplayed = postgame ? 16 : 8 for i in 0...numberOfBadgesDisplayed badgeRow= i<8 ? 0 : 1 diff --git a/Data/Scripts/016_UI/015_UI_Options.rb b/Data/Scripts/016_UI/015_UI_Options.rb index b8f4c7ad0..b10d000c8 100644 --- a/Data/Scripts/016_UI/015_UI_Options.rb +++ b/Data/Scripts/016_UI/015_UI_Options.rb @@ -413,19 +413,19 @@ class PokemonOption_Scene ] - if $game_switches && ($game_switches[NEW_GAME_PLUS] || $game_switches[BEAT_THE_LEAGUE]) #beat the league + if $game_switches && ($game_switches[SWITCH_NEW_GAME_PLUS] || $game_switches[SWITCH_BEAT_THE_LEAGUE]) #beat the league options << EnumOption.new(_INTL("Battle type"), [_INTL("1v1"), _INTL("2v2"), _INTL("3v3")], proc { $PokemonSystem.battle_type }, proc { |value| if value == 0 - $game_variables[DEFAULT_BATTLE_TYPE] = [1, 1] + $game_variables[VAR_DEFAULT_BATTLE_TYPE] = [1, 1] elsif value == 1 - $game_variables[DEFAULT_BATTLE_TYPE] = [2, 2] + $game_variables[VAR_DEFAULT_BATTLE_TYPE] = [2, 2] elsif value == 2 - $game_variables[DEFAULT_BATTLE_TYPE] = [3, 3] + $game_variables[VAR_DEFAULT_BATTLE_TYPE] = [3, 3] else - $game_variables[DEFAULT_BATTLE_TYPE] = [1, 1] + $game_variables[VAR_DEFAULT_BATTLE_TYPE] = [1, 1] end $PokemonSystem.battle_type=value } diff --git a/Data/Scripts/049_Compatibility/Constants.rb b/Data/Scripts/049_Compatibility/Constants.rb index f3be2ead5..37dabc76c 100644 --- a/Data/Scripts/049_Compatibility/Constants.rb +++ b/Data/Scripts/049_Compatibility/Constants.rb @@ -1,39 +1,6 @@ -#Switches -NEW_GAME_PLUS = 972 -BEAT_MT_SILVER = 918 -REVERSED_MODE = 47 -GAME_DIFFICULTY_EASY = 665 -GAME_DIFFICULTY_HARD = 666 - -GOT_BADGE_1 = 4 -GOT_BADGE_2 = 5 -GOT_BADGE_3 = 6 -GOT_BADGE_4 = 7 -GOT_BADGE_5 = 8 -GOT_BADGE_6 = 9 -GOT_BADGE_7 = 10 -GOT_BADGE_8 = 11 -BEAT_THE_LEAGUE = 12 -GOT_BADGE_9 = 38 -GOT_BADGE_10 = 39 -GOT_BADGE_11 = 40 -GOT_BADGE_12 = 41 -GOT_BADGE_13 = 43 -GOT_BADGE_14 = 44 -GOT_BADGE_15 = 45 -GOT_BADGE_16 = 50 - -#Variables -DEFAULT_BATTLE_TYPE = 242 -BATTLE_FACTORY_TOKENS = 243 -NB_GYM_REMATCHES = 162 -CUSTOM_SPRITES_ENABLED= 196 -COMMAND_WINDOW_INDEX=249 - -STANDARD_WONDERTRADE_LEFT=248 -PREMIUM_WONDERTRADE_LEFT=111 - -#Settings +############# +# SETTINGS # +############# # This is for settings that are used in scripts since it's a chore to change them everywhere to include the module name NUM_BADGES = Settings::NB_BADGES EGGINITIALLEVEL = Settings::EGG_LEVEL @@ -42,25 +9,71 @@ EGGINITIALLEVEL = Settings::EGG_LEVEL FALSE = false TRUE = true + +############# +# SWITCHES # +############# +#Game mode switches +SWITCH_NEW_GAME_PLUS = 972 +SWITCH_BEAT_MT_SILVER = 918 +SWITCH_REVERSED_MODE = 47 +SWITCH_GAME_DIFFICULTY_EASY = 665 +SWITCH_GAME_DIFFICULTY_HARD = 666 + +#Game progression switches +SWITCH_GOT_BADGE_1 = 4 +SWITCH_GOT_BADGE_2 = 5 +SWITCH_GOT_BADGE_3 = 6 +SWITCH_GOT_BADGE_4 = 7 +SWITCH_GOT_BADGE_5 = 8 +SWITCH_GOT_BADGE_6 = 9 +SWITCH_GOT_BADGE_7 = 10 +SWITCH_GOT_BADGE_8 = 11 +SWITCH_BEAT_THE_LEAGUE = 12 +SWITCH_GOT_BADGE_9 = 38 +SWITCH_GOT_BADGE_10 = 39 +SWITCH_GOT_BADGE_11 = 40 +SWITCH_GOT_BADGE_12 = 41 +SWITCH_GOT_BADGE_13 = 43 +SWITCH_GOT_BADGE_14 = 44 +SWITCH_GOT_BADGE_15 = 45 +SWITCH_GOT_BADGE_16 = 50 + +#Randomizer Switches +SWITCH_RANDOMIZED_WILD_POKEMON=953 +SWITCH_FUSED_WILD_POKEMON=35 +SWITCH_FORCE_FUSE_NEXT_POKEMON=37 +SWITCH_FORCE_ALL_WILD_FUSIONS=828 +SWITCH_USED_AN_INCENSE=798 +SWITCH_RANDOMIZED_AT_LEAST_ONCE = 855 + +#Random switches +SWITCH_RACE_BIKE = 984 +SWITCH_IS_REMATCH=200 +SWITCH_SINGLE_POKEMON_MODE=790 +SWITCH_SINGLE_POKEMON_MODE_HEAD=791 +SWITCH_SINGLE_POKEMON_MODE_BODY=792 +SWITCH_SINGLE_POKEMON_MODE_RANDOM=793 +SWITCH_FISHING_AUTOHOOK = 916 + + + +############# +# VARIABLES # +############# +VAR_SINGLE_POKEMON_MODE=251 +VAR_WILD_FUSION_RATE=210 +VAR_ODDKEYSTONE_NB=252 +VAR_DEFAULT_BATTLE_TYPE = 242 +VAR_BATTLE_FACTORY_TOKENS = 243 +VAR_NB_GYM_REMATCHES = 162 +VAR_CUSTOM_SPRITES_ENABLED= 196 +VAR_COMMAND_WINDOW_INDEX=249 +VAR_STANDARD_WONDERTRADE_LEFT=248 +VAR_PREMIUM_WONDERTRADE_LEFT=111 + +#OTHERS DIRECTION_LEFT = 4 DIRECTION_RIGHT = 6 DIRECTION_DOWN = 2 -DIRECTION_UP = 8 - -RACE_BIKE = 984 -IS_REMATCH_SWITCH=200 -SINGLE_POKEMON_MODE_SWITCH=790 -SINGLE_POKEMON_MODE_VAR=251 -SINGLE_POKEMON_MODE_HEAD_SWITCH=791 -SINGLE_POKEMON_MODE_BODY_SWITCH=792 -SINGLE_POKEMON_MODE_RANDOM_SWITCH=793 -FISHING_AUTOHOOK_SWITCH = 916 -ODDKEYSTONE_NB_VARIABLE=252 - -RANDOMIZED_WILD_POKEMON_SWITCH=953 -FUSED_WILD_POKEMON_SWITCH=35 -FORCE_FUSE_NEXT_POKEMON_SWITCH=37 -FORCE_ALL_WILD_FUSIONS_SWITCH=828 -USED_AN_INCENSE_SWITCH=798 - -WILD_FUSION_RATE_VAR=210 +DIRECTION_UP = 8 \ No newline at end of file diff --git a/Data/Scripts/050_AddOns/New Items effects.rb b/Data/Scripts/050_AddOns/New Items effects.rb index b733f6c8a..0b92c1695 100644 --- a/Data/Scripts/050_AddOns/New Items effects.rb +++ b/Data/Scripts/050_AddOns/New Items effects.rb @@ -376,7 +376,7 @@ ItemHandlers::UseFromBag.add(:DEBUGGER, proc { |item| ItemHandlers::UseFromBag.add(:ODDKEYSTONE, proc { |item| TOTAL_SPIRITS_NEEDED = 108 - nbSpirits = pbGet(ODDKEYSTONE_NB_VARIABLE) + nbSpirits = pbGet(VAR_ODDKEYSTONE_NB) if nbSpirits == 107 Kernel.pbMessage(_INTL("The Odd Keystone appears to be moving on its own.")) Kernel.pbMessage(_INTL("Voices can be heard whispering from it...")) @@ -390,7 +390,7 @@ ItemHandlers::UseFromBag.add(:ODDKEYSTONE, proc { |item| Kernel.pbMessage(_INTL("It seems as if some poweful energy is trying to escape from it.")) if (Kernel.pbMessage("Let it out?", ["No","Yes"], 0)) == 1 pbWildBattle(:SPIRITOMB,27) - pbSet(ODDKEYSTONE_NB_VARIABLE,0) + pbSet(VAR_ODDKEYSTONE_NB, 0) end next 1 end diff --git a/Data/Scripts/050_AddOns/Wondertrade.rb b/Data/Scripts/050_AddOns/Wondertrade.rb index 089cb8083..edb215118 100644 --- a/Data/Scripts/050_AddOns/Wondertrade.rb +++ b/Data/Scripts/050_AddOns/Wondertrade.rb @@ -94,7 +94,7 @@ def pbWonderTrade(lvl, except = [], except2 = [], premiumWonderTrade = true) end if species > 0 skipLegendaryCheck = premiumWonderTrade && rand(100) < luck - species = 0 if pokemonIsPartLegendary(species) && !$game_switches[BEAT_THE_LEAGUE] && !skipLegendaryCheck + species = 0 if pokemonIsPartLegendary(species) && !$game_switches[SWITCH_BEAT_THE_LEAGUE] && !skipLegendaryCheck end #Redo loop if below BST - 200 species = 0 if bst < (chosenBST - 200) @@ -117,9 +117,9 @@ def pbWonderTrade(lvl, except = [], except2 = [], premiumWonderTrade = true) #num of Wondertrade - 1 if premiumWonderTrade - $game_variables[PREMIUM_WONDERTRADE_LEFT] -= 1 + $game_variables[VAR_PREMIUM_WONDERTRADE_LEFT] -= 1 else - $game_variables[STANDARD_WONDERTRADE_LEFT] -= 1 + $game_variables[VAR_STANDARD_WONDERTRADE_LEFT] -= 1 end newpoke = pbStartTrade(pbGet(1), species, pname, tname, 0, true) # Starts the trade