From 1209b804e919f652dec843e266b40950ab406015 Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Mon, 1 Feb 2021 21:03:58 +0000 Subject: [PATCH] Moved all settings into module Settings --- Data/Scripts/001_Settings.rb | 716 +++++++++--------- .../001_Technical/001_MKXP_Compatibility.rb | 2 +- Data/Scripts/002_Battle settings.rb | 138 ++-- .../004_Sprites/004_Sprite_WaterReflection.rb | 2 +- Data/Scripts/004_Sprites/006_Spriteset_Map.rb | 6 +- .../004_Sprites/007_Spriteset_Global.rb | 2 +- .../001b_Interpreter commands.rb | 6 +- .../002_MessageConfig.rb | 14 +- .../011_Data/001_Game data/007_Move.rb | 4 +- .../011_Data/001_Game data/012_Trainer.rb | 2 +- .../Hardcoded game data/001_PBExperience.rb | 2 +- .../001_Battler/001_PokeBattle_Battler.rb | 8 +- .../001_Battler/003_Battler_ChangeSelf.rb | 4 +- .../001_Battler/004_Battler_Statuses.rb | 4 +- .../001_Battler/007_Battler_UseMove.rb | 2 +- .../009_Battler_UseMove_SuccessChecks.rb | 10 +- .../010_Battler_UseMove_TriggerEffects.rb | 2 +- .../002_Move/001_PokeBattle_Move.rb | 6 +- .../002_Move/003_Move_Usage_Calculations.rb | 14 +- .../002_Move/004_Move_Effects_Generic.rb | 4 +- .../002_Move/005_Move_Effects_000-07F.rb | 48 +- .../002_Move/006_Move_Effects_080-0FF.rb | 56 +- .../002_Move/007_Move_Effects_100-17F.rb | 4 +- .../003_Battle/001_PokeBattle_BattleCommon.rb | 4 +- .../003_Battle/003_Battle_StartAndEnd.rb | 4 +- .../004_Battle_ExpAndMoveLearning.rb | 8 +- .../003_Battle/006_Battle_Action_Switching.rb | 4 +- .../003_Battle/008_Battle_Action_Running.rb | 4 +- .../003_Battle/009_Battle_Action_Other.rb | 8 +- .../003_Battle/011_Battle_Phase_Attack.rb | 2 +- .../003_Battle/012_Battle_Phase_EndOfRound.rb | 6 +- Data/Scripts/012_Battle/004_AI/002_AI_Item.rb | 20 +- .../004_AI/005_AI_Move_EffectScores.rb | 8 +- .../004_AI/006_AI_Move_Utilities.rb | 12 +- .../003_PokeBattle_SceneConstants.rb | 8 +- Data/Scripts/012_Battle/006_BattleHandlers.rb | 10 +- .../007_BattleHandlers_Abilities.rb | 14 +- .../012_Battle/008_BattleHandlers_Items.rb | 4 +- .../012_Battle/009_PokeBall_CatchEffects.rb | 10 +- .../Scripts/013_Overworld/002_PField_Field.rb | 32 +- .../013_Overworld/003_PField_Visuals.rb | 4 +- .../013_Overworld/006_PField_Battles.rb | 8 +- .../013_Overworld/007_PField_Encounters.rb | 18 +- .../008_PField_EncounterModifiers.rb | 2 +- .../009_PField_RoamingPokemon.rb | 12 +- .../010_PField_RandomDungeons.rb | 4 +- .../013_Overworld/011_PField_FieldMoves.rb | 32 +- .../013_Overworld/012_PField_BerryPlants.rb | 14 +- .../013_Overworld/013_PField_DayCare.rb | 10 +- Data/Scripts/013_Overworld/015_PField_Time.rb | 4 +- Data/Scripts/014_Trainers/001_Trainer.rb | 6 +- .../014_Trainers/002_PTrainer_NPCTrainers.rb | 2 +- Data/Scripts/015_Items/001_PItem_Items.rb | 2 +- .../015_Items/002_PItem_ItemEffects.rb | 4 +- .../015_Items/003_PItem_BattleItemEffects.rb | 20 +- Data/Scripts/015_Items/005_PItem_PokeRadar.rb | 20 +- Data/Scripts/015_Items/008_PItem_Bag.rb | 10 +- .../009_Pokemon_Storage.rb | 8 +- Data/Scripts/016_Pokemon/001_Pokemon.rb | 6 +- Data/Scripts/017_UI/001_PScreen_PauseMenu.rb | 6 +- .../Scripts/017_UI/002_PScreen_PokedexMenu.rb | 6 +- .../Scripts/017_UI/003_PScreen_PokedexMain.rb | 10 +- .../017_UI/004_PScreen_PokedexEntry.rb | 14 +- Data/Scripts/017_UI/005_PScreen_Party.rb | 52 +- Data/Scripts/017_UI/006_PScreen_Summary.rb | 4 +- Data/Scripts/017_UI/007_PScreen_Bag.rb | 6 +- Data/Scripts/017_UI/009_PScreen_RegionMap.rb | 2 +- Data/Scripts/017_UI/013_PScreen_Load.rb | 4 +- Data/Scripts/017_UI/015_PScreen_Options.rb | 32 +- .../017_UI/017_PScreen_PokemonStorage.rb | 36 +- Data/Scripts/017_UI/019_PScreen_PC.rb | 2 +- Data/Scripts/017_UI/025_PScreen_Mart.rb | 4 +- .../003_PMinigame_SlotMachine.rb | 12 +- .../004_PMinigame_VoltorbFlip.rb | 8 +- .../019_Other battles/001_PBattle_Safari.rb | 4 +- .../002_PBattle_BugContest.rb | 4 +- .../003_PBattle_OrgBattle.rb | 2 +- .../005_PBattle_OrgBattleGenerator.rb | 8 +- .../002_PSystem_System.rb | 6 +- .../004_PSystem_PokemonUtilities.rb | 2 +- .../005_PSystem_Utilities.rb | 8 +- .../001_Debug menus/002_Debug_MenuCommands.rb | 17 +- .../003_Debug_MenuExtraCode.rb | 14 +- .../004_Debug_PokemonCommands.rb | 4 +- .../005_AnimEditor_Functions.rb | 6 +- Data/Scripts/021_Debug/004_Editor_Screens.rb | 8 +- .../Scripts/021_Debug/007_Editor_DataTypes.rb | 4 +- Data/Scripts/022_Compiler/001_Compiler.rb | 2 +- 88 files changed, 848 insertions(+), 839 deletions(-) diff --git a/Data/Scripts/001_Settings.rb b/Data/Scripts/001_Settings.rb index b56a87035..0a4224d5b 100644 --- a/Data/Scripts/001_Settings.rb +++ b/Data/Scripts/001_Settings.rb @@ -4,381 +4,387 @@ # https://github.com/Maruno17/pokemon-essentials # #==============================================================================# -# The generation that the battle system follows. Used throughout the battle -# scripts, and also by some other settings which are used in and out of battle -# (you can of course change those settings to suit your game). -# Note that this isn't perfect. Essentials doesn't accurately replicate every -# single generation's mechanics. It's considered to be good enough. Only -# generations 5 and later are reasonably supported. -MECHANICS_GENERATION = 7 +module Settings + # The generation that the battle system follows. Used throughout the battle + # scripts, and also by some other settings which are used in and out of battle + # (you can of course change those settings to suit your game). + # Note that this isn't perfect. Essentials doesn't accurately replicate every + # single generation's mechanics. It's considered to be good enough. Only + # generations 5 and later are reasonably supported. + MECHANICS_GENERATION = 7 -#=============================================================================== + #=============================================================================== -# The default screen width (at a scale of 1.0). -SCREEN_WIDTH = 512 -# The default screen height (at a scale of 1.0). -SCREEN_HEIGHT = 384 -# The default screen scale factor. Possible values are 0.5, 1.0, 1.5 and 2.0. -SCREEN_SCALE = 1.0 -# Map view mode (0=original, 1=custom, 2=perspective). -MAP_VIEW_MODE = 1 + # The default screen width (at a scale of 1.0). + SCREEN_WIDTH = 512 + # The default screen height (at a scale of 1.0). + SCREEN_HEIGHT = 384 + # The default screen scale factor. Possible values are 0.5, 1.0, 1.5 and 2.0. + SCREEN_SCALE = 1.0 + # Map view mode (0=original, 1=custom, 2=perspective). + MAP_VIEW_MODE = 1 -#=============================================================================== + #=============================================================================== -# The maximum level Pokémon can reach. -MAXIMUM_LEVEL = 100 -# The level of newly hatched Pokémon. -EGG_LEVEL = 1 -# The odds of a newly generated Pokémon being shiny (out of 65536). -SHINY_POKEMON_CHANCE = (MECHANICS_GENERATION >= 6) ? 16 : 8 -# The odds of a wild Pokémon/bred egg having Pokérus (out of 65536). -POKERUS_CHANCE = 3 -# Whether a bred baby Pokémon can inherit any TM/HM moves from its father. It -# can never inherit TM/HM moves from its mother. -BREEDING_CAN_INHERIT_MACHINE_MOVES = (MECHANICS_GENERATION <= 5) -# Whether a bred baby Pokémon can inherit egg moves from its mother. It can -# always inherit egg moves from its father. -BREEDING_CAN_INHERIT_EGG_MOVES_FROM_MOTHER = (MECHANICS_GENERATION >= 6) + # The maximum level Pokémon can reach. + MAXIMUM_LEVEL = 100 + # The level of newly hatched Pokémon. + EGG_LEVEL = 1 + # The odds of a newly generated Pokémon being shiny (out of 65536). + SHINY_POKEMON_CHANCE = (MECHANICS_GENERATION >= 6) ? 16 : 8 + # The odds of a wild Pokémon/bred egg having Pokérus (out of 65536). + POKERUS_CHANCE = 3 + # Whether a bred baby Pokémon can inherit any TM/HM moves from its father. It + # can never inherit TM/HM moves from its mother. + BREEDING_CAN_INHERIT_MACHINE_MOVES = (MECHANICS_GENERATION <= 5) + # Whether a bred baby Pokémon can inherit egg moves from its mother. It can + # always inherit egg moves from its father. + BREEDING_CAN_INHERIT_EGG_MOVES_FROM_MOTHER = (MECHANICS_GENERATION >= 6) -#=============================================================================== + #=============================================================================== -# The amount of money the player starts the game with. -INITIAL_MONEY = 3000 -# The maximum amount of money the player can have. -MAX_MONEY = 999_999 -# The maximum number of Game Corner coins the player can have. -MAX_COINS = 99_999 -# The maximum length, in characters, that the player's name can be. -MAX_PLAYER_NAME_SIZE = 10 -# The maximum number of Pokémon that can be in the party. -MAX_PARTY_SIZE = 6 + # The amount of money the player starts the game with. + INITIAL_MONEY = 3000 + # The maximum amount of money the player can have. + MAX_MONEY = 999_999 + # The maximum number of Game Corner coins the player can have. + MAX_COINS = 99_999 + # The maximum length, in characters, that the player's name can be. + MAX_PLAYER_NAME_SIZE = 10 + # The maximum number of Pokémon that can be in the party. + MAX_PARTY_SIZE = 6 -#=============================================================================== + #=============================================================================== -# A set of arrays each containing a trainer type followed by a Global Variable -# number. If the variable isn't set to 0, then all trainers with the associated -# trainer type will be named as whatever is in that variable. -RIVAL_NAMES = [ - [:RIVAL1, 12], - [:RIVAL2, 12], - [:CHAMPION, 12] -] + # A set of arrays each containing a trainer type followed by a Global Variable + # number. If the variable isn't set to 0, then all trainers with the associated + # trainer type will be named as whatever is in that variable. + RIVAL_NAMES = [ + [:RIVAL1, 12], + [:RIVAL2, 12], + [:CHAMPION, 12] + ] -#=============================================================================== + #=============================================================================== -# Whether outdoor maps should be shaded according to the time of day. -TIME_SHADING = true + # Whether outdoor maps should be shaded according to the time of day. + TIME_SHADING = true -#=============================================================================== + #=============================================================================== -# Whether poisoned Pokémon will lose HP while walking around in the field. -POISON_IN_FIELD = (MECHANICS_GENERATION <= 4) -# Whether poisoned Pokémon will faint while walking around in the field (true), -# or survive the poisoning with 1 HP (false). -POISON_FAINT_IN_FIELD = (MECHANICS_GENERATION <= 3) -# Whether planted berries grow according to Gen 4 mechanics (true) or Gen 3 -# mechanics (false). -NEW_BERRY_PLANTS = (MECHANICS_GENERATION >= 4) -# Whether fishing automatically hooks the Pokémon (if false, there is a reaction -# test first). -FISHING_AUTO_HOOK = false -# The ID of the common event that runs when the player starts fishing (runs -# instead of showing the casting animation). -FISHING_BEGIN_COMMON_EVENT = -1 -# The ID of the common event that runs when the player stops fishing (runs -# instead of showing the reeling in animation). -FISHING_END_COMMON_EVENT = -1 + # Whether poisoned Pokémon will lose HP while walking around in the field. + POISON_IN_FIELD = (MECHANICS_GENERATION <= 4) + # Whether poisoned Pokémon will faint while walking around in the field (true), + # or survive the poisoning with 1 HP (false). + POISON_FAINT_IN_FIELD = (MECHANICS_GENERATION <= 3) + # Whether planted berries grow according to Gen 4 mechanics (true) or Gen 3 + # mechanics (false). + NEW_BERRY_PLANTS = (MECHANICS_GENERATION >= 4) + # Whether fishing automatically hooks the Pokémon (if false, there is a reaction + # test first). + FISHING_AUTO_HOOK = false + # The ID of the common event that runs when the player starts fishing (runs + # instead of showing the casting animation). + FISHING_BEGIN_COMMON_EVENT = -1 + # The ID of the common event that runs when the player stops fishing (runs + # instead of showing the reeling in animation). + FISHING_END_COMMON_EVENT = -1 -#=============================================================================== + #=============================================================================== -# The number of steps allowed before a Safari Zone game is over (0=infinite). -SAFARI_STEPS = 600 -# The number of seconds a Bug Catching Contest lasts for (0=infinite). -BUG_CONTEST_TIME = 1200 + # The number of steps allowed before a Safari Zone game is over (0=infinite). + SAFARI_STEPS = 600 + # The number of seconds a Bug Catching Contest lasts for (0=infinite). + BUG_CONTEST_TIME = 1200 -#=============================================================================== + #=============================================================================== -# Pairs of map IDs, where the location signpost isn't shown when moving from one -# of the maps in a pair to the other (and vice versa). Useful for single long -# routes/towns that are spread over multiple maps. -# e.g. [4,5,16,17,42,43] will be map pairs 4,5 and 16,17 and 42,43. -# Moving between two maps that have the exact same name won't show the location -# signpost anyway, so you don't need to list those maps here. -NO_SIGNPOSTS = [] + # Pairs of map IDs, where the location signpost isn't shown when moving from one + # of the maps in a pair to the other (and vice versa). Useful for single long + # routes/towns that are spread over multiple maps. + # e.g. [4,5,16,17,42,43] will be map pairs 4,5 and 16,17 and 42,43. + # Moving between two maps that have the exact same name won't show the location + # signpost anyway, so you don't need to list those maps here. + NO_SIGNPOSTS = [] -#=============================================================================== + #=============================================================================== -# Whether the badge restriction on using certain hidden moves is owning at least -# a certain number of badges (true), or owning a particular badge (false). -FIELD_MOVES_COUNT_BADGES = true -# Depending on FIELD_MOVES_COUNT_BADGES, either the number of badges required to -# use each hidden move, or the specific badge number required to use each move. -# Remember that badge 0 is the first badge, badge 1 is the second badge, etc. -# e.g. To require the second badge, put false and 1. -# To require at least 2 badges, put true and 2. -BADGE_FOR_CUT = 1 -BADGE_FOR_FLASH = 2 -BADGE_FOR_ROCKSMASH = 3 -BADGE_FOR_SURF = 4 -BADGE_FOR_FLY = 5 -BADGE_FOR_STRENGTH = 6 -BADGE_FOR_DIVE = 7 -BADGE_FOR_WATERFALL = 8 + # Whether the badge restriction on using certain hidden moves is owning at least + # a certain number of badges (true), or owning a particular badge (false). + FIELD_MOVES_COUNT_BADGES = true + # Depending on FIELD_MOVES_COUNT_BADGES, either the number of badges required to + # use each hidden move, or the specific badge number required to use each move. + # Remember that badge 0 is the first badge, badge 1 is the second badge, etc. + # e.g. To require the second badge, put false and 1. + # To require at least 2 badges, put true and 2. + BADGE_FOR_CUT = 1 + BADGE_FOR_FLASH = 2 + BADGE_FOR_ROCKSMASH = 3 + BADGE_FOR_SURF = 4 + BADGE_FOR_FLY = 5 + BADGE_FOR_STRENGTH = 6 + BADGE_FOR_DIVE = 7 + BADGE_FOR_WATERFALL = 8 -#=============================================================================== + #=============================================================================== -# If a move taught by a TM/HM/TR replaces another move, this setting is whether -# the machine's move retains the replaced move's PP (true) or whether the -# machine's move has full PP (false). -TAUGHT_MACHINES_KEEP_OLD_PP = (MECHANICS_GENERATION == 5) -# Whether Black/White Flute raise/lower the levels of wild Pokémon respectively -# (true) or lower/raise the wild encounter rate respectively (false). -FLUTES_CHANGE_WILD_ENCOUNTER_LEVELS = (MECHANICS_GENERATION >= 6) -# Whether Repel uses the level of the first Pokémon in the party regardless of -# its HP (true) or uses the level of the first unfainted Pokémon (false) -REPEL_COUNTS_FAINTED_POKEMON = (MECHANICS_GENERATION >= 6) -# Whether Rage Candy Bar acts as a Full Heal (true) or a Potion (false). -RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS = (MECHANICS_GENERATION >= 7) + # If a move taught by a TM/HM/TR replaces another move, this setting is whether + # the machine's move retains the replaced move's PP (true) or whether the + # machine's move has full PP (false). + TAUGHT_MACHINES_KEEP_OLD_PP = (MECHANICS_GENERATION == 5) + # Whether Black/White Flute raise/lower the levels of wild Pokémon respectively + # (true) or lower/raise the wild encounter rate respectively (false). + FLUTES_CHANGE_WILD_ENCOUNTER_LEVELS = (MECHANICS_GENERATION >= 6) + # Whether Repel uses the level of the first Pokémon in the party regardless of + # its HP (true) or uses the level of the first unfainted Pokémon (false) + REPEL_COUNTS_FAINTED_POKEMON = (MECHANICS_GENERATION >= 6) + # Whether Rage Candy Bar acts as a Full Heal (true) or a Potion (false). + RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS = (MECHANICS_GENERATION >= 7) -#=============================================================================== + #=============================================================================== -# The name of the person who created the Pokémon storage system. -def pbStorageCreator - return _INTL("Bill") + # The name of the person who created the Pokémon storage system. + def self.storage_creator_name + return _INTL("Bill") + end + # The number of boxes in Pokémon storage. + NUM_STORAGE_BOXES = 30 + + #=============================================================================== + + # The names of each pocket of the Bag. Leave the first entry blank. + def self.bag_pocket_names + return ["", + _INTL("Items"), + _INTL("Medicine"), + _INTL("Poké Balls"), + _INTL("TMs & HMs"), + _INTL("Berries"), + _INTL("Mail"), + _INTL("Battle Items"), + _INTL("Key Items") + ] + end + # The maximum number of slots per pocket (-1 means infinite number). Ignore the + # first number (0). + BAG_MAX_POCKET_SIZE = [0, -1, -1, -1, -1, -1, -1, -1, -1] + # The maximum number of items each slot in the Bag can hold. + BAG_MAX_PER_SLOT = 999 + # Whether each pocket in turn auto-sorts itself by item ID number. Ignore the + # first entry (the 0). + BAG_POCKET_AUTO_SORT = [0, false, false, false, true, true, false, false, false] + + #=============================================================================== + + # Whether the Pokédex list shown is the one for the player's current region + # (true), or whether a menu pops up for the player to manually choose which Dex + # list to view if more than one is available (false). + USE_CURRENT_REGION_DEX = false + # The names of each Dex list in the game, in order and with National Dex at the + # end. This is also the order that $PokemonGlobal.pokedexUnlocked is in, which + # records which Dexes have been unlocked (first is unlocked by default). + # You can define which region a particular Dex list is linked to. This means the + # area map shown while viewing that Dex list will ALWAYS be that of the defined + # region, rather than whichever region the player is currently in. To define + # this, put the Dex name and the region number in an array, like the Kanto and + # Johto Dexes are. The National Dex isn't in an array with a region number, + # therefore its area map is whichever region the player is currently in. + def self.pokedex_names + return [ + [_INTL("Kanto Pokédex"), 0], + [_INTL("Johto Pokédex"), 1], + _INTL("National Pokédex") + ] + end + # Whether all forms of a given species will be immediately available to view in + # the Pokédex so long as that species has been seen at all (true), or whether + # each form needs to be seen specifically before that form appears in the + # Pokédex (false). + DEX_SHOWS_ALL_FORMS = false + # An array of numbers, where each number is that of a Dex list (National Dex is + # -1). All Dex lists included here have the species numbers in them reduced by + # 1, thus making the first listed species have a species number of 0 (e.g. + # Victini in Unova's Dex). + DEXES_WITH_OFFSETS = [] + + #=============================================================================== + + # A set of arrays each containing details of a graphic to be shown on the region + # map if appropriate. The values for each array are as follows: + # - Region number. + # - Global Switch; the graphic is shown if this is ON (non-wall maps only). + # - X coordinate of the graphic on the map, in squares. + # - Y coordinate of the graphic on the map, in squares. + # - Name of the graphic, found in the Graphics/Pictures folder. + # - The graphic will always (true) or never (false) be shown on a wall map. + REGION_MAP_EXTRAS = [ + [0, 51, 16, 15, "mapHiddenBerth", false], + [0, 52, 20, 14, "mapHiddenFaraday", false] + ] + + #=============================================================================== + + # A list of maps used by roaming Pokémon. Each map has an array of other maps it + # can lead to. + ROAMING_AREAS = { + 5 => [ 21, 28, 31, 39, 41, 44, 47, 66, 69], + 21 => [5, 28, 31, 39, 41, 44, 47, 66, 69], + 28 => [5, 21, 31, 39, 41, 44, 47, 66, 69], + 31 => [5, 21, 28, 39, 41, 44, 47, 66, 69], + 39 => [5, 21, 28, 31, 41, 44, 47, 66, 69], + 41 => [5, 21, 28, 31, 39, 44, 47, 66, 69], + 44 => [5, 21, 28, 31, 39, 41, 47, 66, 69], + 47 => [5, 21, 28, 31, 39, 41, 44, 66, 69], + 66 => [5, 21, 28, 31, 39, 41, 44, 47, 69], + 69 => [5, 21, 28, 31, 39, 41, 44, 47, 66 ] + } + # A set of arrays each containing the details of a roaming Pokémon. The + # information within is as follows: + # - Species. + # - Level. + # - Global Switch; the Pokémon roams while this is ON. + # - Encounter type (0=any, 1=grass/walking in cave, 2=surfing, 3=fishing, + # 4=surfing/fishing). See bottom of PField_RoamingPokemon for lists. + # - Name of BGM to play for that encounter (optional). + # - Roaming areas specifically for this Pokémon (optional). + ROAMING_SPECIES = [ + [:LATIAS, 30, 53, 0, "Battle roaming"], + [:LATIOS, 30, 53, 0, "Battle roaming"], + [:KYOGRE, 40, 54, 2, nil, { + 2 => [ 21, 31 ], + 21 => [2, 31, 69], + 31 => [2, 21, 69], + 69 => [ 21, 31 ] + }], + [:ENTEI, 40, 55, 1, nil] + ] + + #=============================================================================== + + # A set of arrays each containing details of a wild encounter that can only + # occur via using the Poké Radar. The information within is as follows: + # - Map ID on which this encounter can occur. + # - Probability that this encounter will occur (as a percentage). + # - Species. + # - Minimum possible level. + # - Maximum possible level (optional). + POKE_RADAR_ENCOUNTERS = [ + [5, 20, :STARLY, 12, 15], + [21, 10, :STANTLER, 14], + [28, 20, :BUTTERFREE, 15, 18], + [28, 20, :BEEDRILL, 15, 18] + ] + + #=============================================================================== + + # The Game Switch that is set to ON when the player blacks out. + STARTING_OVER_SWITCH = 1 + # The Game Switch that is set to ON when the player has seen Pokérus in the Poké + # Center, and doesn't need to be told about it again. + SEEN_POKERUS_SWITCH = 2 + # The Game Switch which, while ON, makes all wild Pokémon created be shiny. + SHINY_WILD_POKEMON_SWITCH = 31 + # The Game Switch which, while ON, makes all Pokémon created considered to be + # met via a fateful encounter. + FATEFUL_ENCOUNTER_SWITCH = 32 + + #=============================================================================== + + # ID of the animation played when the player steps on grass (grass rustling). + GRASS_ANIMATION_ID = 1 + # ID of the animation played when the player lands on the ground after hopping + # over a ledge (shows a dust impact). + DUST_ANIMATION_ID = 2 + # ID of the animation played when a trainer notices the player (an exclamation + # bubble). + EXCLAMATION_ANIMATION_ID = 3 + # ID of the animation played when a patch of grass rustles due to using the Poké + # Radar. + RUSTLE_NORMAL_ANIMATION_ID = 1 + # ID of the animation played when a patch of grass rustles vigorously due to + # using the Poké Radar. (Rarer species) + RUSTLE_VIGOROUS_ANIMATION_ID = 5 + # ID of the animation played when a patch of grass rustles and shines due to + # using the Poké Radar. (Shiny encounter) + RUSTLE_SHINY_ANIMATION_ID = 6 + # ID of the animation played when a berry tree grows a stage while the player is + # on the map (for new plant growth mechanics only). + PLANT_SPARKLE_ANIMATION_ID = 7 + + #=============================================================================== + + # An array of available languages in the game, and their corresponding message + # file in the Data folder. Edit only if you have 2 or more languages to choose + # from. + LANGUAGES = [ + # ["English", "english.dat"], + # ["Deutsch", "deutsch.dat"] + ] + + #=============================================================================== + + # Available speech frames. These are graphic files in "Graphics/Windowskins/". + SPEECH_WINDOWSKINS = [ + "speech hgss 1", + "speech hgss 2", + "speech hgss 3", + "speech hgss 4", + "speech hgss 5", + "speech hgss 6", + "speech hgss 7", + "speech hgss 8", + "speech hgss 9", + "speech hgss 10", + "speech hgss 11", + "speech hgss 12", + "speech hgss 13", + "speech hgss 14", + "speech hgss 15", + "speech hgss 16", + "speech hgss 17", + "speech hgss 18", + "speech hgss 19", + "speech hgss 20", + "speech pl 18" + ] + + # Available menu frames. These are graphic files in "Graphics/Windowskins/". + MENU_WINDOWSKINS = [ + "choice 1", + "choice 2", + "choice 3", + "choice 4", + "choice 5", + "choice 6", + "choice 7", + "choice 8", + "choice 9", + "choice 10", + "choice 11", + "choice 12", + "choice 13", + "choice 14", + "choice 15", + "choice 16", + "choice 17", + "choice 18", + "choice 19", + "choice 20", + "choice 21", + "choice 22", + "choice 23", + "choice 24", + "choice 25", + "choice 26", + "choice 27", + "choice 28" + ] + + # Available fonts, as selectable in the Options Screen. + FONT_OPTIONS = [ + "Power Green", + "Power Red and Blue", + "Power Red and Green", + "Power Clear" + ] end -# The number of boxes in Pokémon storage. -NUM_STORAGE_BOXES = 30 - -#=============================================================================== - -# The names of each pocket of the Bag. Leave the first entry blank. -def pbPocketNames; return ["", - _INTL("Items"), - _INTL("Medicine"), - _INTL("Poké Balls"), - _INTL("TMs & HMs"), - _INTL("Berries"), - _INTL("Mail"), - _INTL("Battle Items"), - _INTL("Key Items") - ]; end -# The maximum number of slots per pocket (-1 means infinite number). Ignore the -# first number (0). -BAG_MAX_POCKET_SIZE = [0, -1, -1, -1, -1, -1, -1, -1, -1] -# The maximum number of items each slot in the Bag can hold. -BAG_MAX_PER_SLOT = 999 -# Whether each pocket in turn auto-sorts itself by item ID number. Ignore the -# first entry (the 0). -BAG_POCKET_AUTO_SORT = [0, false, false, false, true, true, false, false, false] - -#=============================================================================== - -# Whether the Pokédex list shown is the one for the player's current region -# (true), or whether a menu pops up for the player to manually choose which Dex -# list to view if more than one is available (false). -USE_CURRENT_REGION_DEX = false -# The names of each Dex list in the game, in order and with National Dex at the -# end. This is also the order that $PokemonGlobal.pokedexUnlocked is in, which -# records which Dexes have been unlocked (first is unlocked by default). -# You can define which region a particular Dex list is linked to. This means the -# area map shown while viewing that Dex list will ALWAYS be that of the defined -# region, rather than whichever region the player is currently in. To define -# this, put the Dex name and the region number in an array, like the Kanto and -# Johto Dexes are. The National Dex isn't in an array with a region number, -# therefore its area map is whichever region the player is currently in. -def pbDexNames; return [ - [_INTL("Kanto Pokédex"), 0], - [_INTL("Johto Pokédex"), 1], - _INTL("National Pokédex") -]; end -# Whether all forms of a given species will be immediately available to view in -# the Pokédex so long as that species has been seen at all (true), or whether -# each form needs to be seen specifically before that form appears in the -# Pokédex (false). -DEX_SHOWS_ALL_FORMS = false -# An array of numbers, where each number is that of a Dex list (National Dex is -# -1). All Dex lists included here have the species numbers in them reduced by -# 1, thus making the first listed species have a species number of 0 (e.g. -# Victini in Unova's Dex). -DEXES_WITH_OFFSETS = [] - -#=============================================================================== - -# A set of arrays each containing details of a graphic to be shown on the region -# map if appropriate. The values for each array are as follows: -# - Region number. -# - Global Switch; the graphic is shown if this is ON (non-wall maps only). -# - X coordinate of the graphic on the map, in squares. -# - Y coordinate of the graphic on the map, in squares. -# - Name of the graphic, found in the Graphics/Pictures folder. -# - The graphic will always (true) or never (false) be shown on a wall map. -REGION_MAP_EXTRAS = [ - [0, 51, 16, 15, "mapHiddenBerth", false], - [0, 52, 20, 14, "mapHiddenFaraday", false] -] - -#=============================================================================== - -# A list of maps used by roaming Pokémon. Each map has an array of other maps it -# can lead to. -ROAMING_AREAS = { - 5 => [ 21, 28, 31, 39, 41, 44, 47, 66, 69], - 21 => [5, 28, 31, 39, 41, 44, 47, 66, 69], - 28 => [5, 21, 31, 39, 41, 44, 47, 66, 69], - 31 => [5, 21, 28, 39, 41, 44, 47, 66, 69], - 39 => [5, 21, 28, 31, 41, 44, 47, 66, 69], - 41 => [5, 21, 28, 31, 39, 44, 47, 66, 69], - 44 => [5, 21, 28, 31, 39, 41, 47, 66, 69], - 47 => [5, 21, 28, 31, 39, 41, 44, 66, 69], - 66 => [5, 21, 28, 31, 39, 41, 44, 47, 69], - 69 => [5, 21, 28, 31, 39, 41, 44, 47, 66 ] -} -# A set of arrays each containing the details of a roaming Pokémon. The -# information within is as follows: -# - Species. -# - Level. -# - Global Switch; the Pokémon roams while this is ON. -# - Encounter type (0=any, 1=grass/walking in cave, 2=surfing, 3=fishing, -# 4=surfing/fishing). See bottom of PField_RoamingPokemon for lists. -# - Name of BGM to play for that encounter (optional). -# - Roaming areas specifically for this Pokémon (optional). -ROAMING_SPECIES = [ - [:LATIAS, 30, 53, 0, "Battle roaming"], - [:LATIOS, 30, 53, 0, "Battle roaming"], - [:KYOGRE, 40, 54, 2, nil, { - 2 => [ 21, 31 ], - 21 => [2, 31, 69], - 31 => [2, 21, 69], - 69 => [ 21, 31 ] - }], - [:ENTEI, 40, 55, 1, nil] -] - -#=============================================================================== - -# A set of arrays each containing details of a wild encounter that can only -# occur via using the Poké Radar. The information within is as follows: -# - Map ID on which this encounter can occur. -# - Probability that this encounter will occur (as a percentage). -# - Species. -# - Minimum possible level. -# - Maximum possible level (optional). -POKE_RADAR_ENCOUNTERS = [ - [5, 20, :STARLY, 12, 15], - [21, 10, :STANTLER, 14], - [28, 20, :BUTTERFREE, 15, 18], - [28, 20, :BEEDRILL, 15, 18] -] - -#=============================================================================== - -# The Game Switch that is set to ON when the player blacks out. -STARTING_OVER_SWITCH = 1 -# The Game Switch that is set to ON when the player has seen Pokérus in the Poké -# Center, and doesn't need to be told about it again. -SEEN_POKERUS_SWITCH = 2 -# The Game Switch which, while ON, makes all wild Pokémon created be shiny. -SHINY_WILD_POKEMON_SWITCH = 31 -# The Game Switch which, while ON, makes all Pokémon created considered to be -# met via a fateful encounter. -FATEFUL_ENCOUNTER_SWITCH = 32 - -#=============================================================================== - -# ID of the animation played when the player steps on grass (grass rustling). -GRASS_ANIMATION_ID = 1 -# ID of the animation played when the player lands on the ground after hopping -# over a ledge (shows a dust impact). -DUST_ANIMATION_ID = 2 -# ID of the animation played when a trainer notices the player (an exclamation -# bubble). -EXCLAMATION_ANIMATION_ID = 3 -# ID of the animation played when a patch of grass rustles due to using the Poké -# Radar. -RUSTLE_NORMAL_ANIMATION_ID = 1 -# ID of the animation played when a patch of grass rustles vigorously due to -# using the Poké Radar. (Rarer species) -RUSTLE_VIGOROUS_ANIMATION_ID = 5 -# ID of the animation played when a patch of grass rustles and shines due to -# using the Poké Radar. (Shiny encounter) -RUSTLE_SHINY_ANIMATION_ID = 6 -# ID of the animation played when a berry tree grows a stage while the player is -# on the map (for new plant growth mechanics only). -PLANT_SPARKLE_ANIMATION_ID = 7 - -#=============================================================================== - -# An array of available languages in the game, and their corresponding message -# file in the Data folder. Edit only if you have 2 or more languages to choose -# from. -LANGUAGES = [ -# ["English", "english.dat"], -# ["Deutsch", "deutsch.dat"] -] - -#=============================================================================== - -# Available speech frames. These are graphic files in "Graphics/Windowskins/". -$SpeechFrames = [ - "speech hgss 1", - "speech hgss 2", - "speech hgss 3", - "speech hgss 4", - "speech hgss 5", - "speech hgss 6", - "speech hgss 7", - "speech hgss 8", - "speech hgss 9", - "speech hgss 10", - "speech hgss 11", - "speech hgss 12", - "speech hgss 13", - "speech hgss 14", - "speech hgss 15", - "speech hgss 16", - "speech hgss 17", - "speech hgss 18", - "speech hgss 19", - "speech hgss 20", - "speech pl 18" -] - -# Available menu frames. These are graphic files in "Graphics/Windowskins/". -$TextFrames = [ - "choice 1", - "choice 2", - "choice 3", - "choice 4", - "choice 5", - "choice 6", - "choice 7", - "choice 8", - "choice 9", - "choice 10", - "choice 11", - "choice 12", - "choice 13", - "choice 14", - "choice 15", - "choice 16", - "choice 17", - "choice 18", - "choice 19", - "choice 20", - "choice 21", - "choice 22", - "choice 23", - "choice 24", - "choice 25", - "choice 26", - "choice 27", - "choice 28" -] - -# Available fonts. Each one needs to be in its own array. -$VersionStyles = [ - ["Power Green"], - ["Power Red and Blue"], - ["Power Red and Green"], - ["Power Clear"] -] diff --git a/Data/Scripts/001_Technical/001_MKXP_Compatibility.rb b/Data/Scripts/001_Technical/001_MKXP_Compatibility.rb index 3b9d2bf90..b4924431d 100644 --- a/Data/Scripts/001_Technical/001_MKXP_Compatibility.rb +++ b/Data/Scripts/001_Technical/001_MKXP_Compatibility.rb @@ -19,7 +19,7 @@ end def pbSetResizeFactor(factor) if !$ResizeInitialized - Graphics.resize_screen(SCREEN_WIDTH, SCREEN_HEIGHT) + Graphics.resize_screen(Settings::SCREEN_WIDTH, Settings::SCREEN_HEIGHT) $ResizeInitialized = true end if factor < 0 || factor == 4 diff --git a/Data/Scripts/002_Battle settings.rb b/Data/Scripts/002_Battle settings.rb index 8e4782434..bf13bb8c1 100644 --- a/Data/Scripts/002_Battle settings.rb +++ b/Data/Scripts/002_Battle settings.rb @@ -1,76 +1,78 @@ -# Whether a move's physical/special category depends on the move itself as in -# newer Gens (true), or on its type as in older Gens (false). -MOVE_CATEGORY_PER_MOVE = (MECHANICS_GENERATION >= 4) -# Whether turn order is recalculated after a Pokémon Mega Evolves. -RECALCULATE_TURN_ORDER_AFTER_MEGA_EVOLUTION = (MECHANICS_GENERATION >= 7) -# Whether turn order is recalculated after a Pokémon's Speed stat changes. -RECALCULATE_TURN_ORDER_AFTER_SPEED_CHANGES = (MECHANICS_GENERATION >= 8) -# Whether critical hits do 1.5x damage and have 4 stages (true), or they do 2x -# damage and have 5 stages as in Gen 5 (false). Also determines whether critical -# hit rate can be copied by Transform/Psych Up. -NEW_CRITICAL_HIT_RATE_MECHANICS = (MECHANICS_GENERATION >= 6) -# Whether several effects apply relating to a Pokémon's type: -# * Electric-type immunity to paralysis -# * Ghost-type immunity to being trapped -# * Grass-type immunity to powder moves and Effect Spore -# * Poison-type Pokémon can't miss when using Toxic -MORE_TYPE_EFFECTS = (MECHANICS_GENERATION >= 6) -# Whether weather caused by an ability lasts 5 rounds (true) or forever (false). -FIXED_DURATION_WEATHER_FROM_ABILITY = (MECHANICS_GENERATION >= 6) +module Settings + # Whether a move's physical/special category depends on the move itself as in + # newer Gens (true), or on its type as in older Gens (false). + MOVE_CATEGORY_PER_MOVE = (MECHANICS_GENERATION >= 4) + # Whether turn order is recalculated after a Pokémon Mega Evolves. + RECALCULATE_TURN_ORDER_AFTER_MEGA_EVOLUTION = (MECHANICS_GENERATION >= 7) + # Whether turn order is recalculated after a Pokémon's Speed stat changes. + RECALCULATE_TURN_ORDER_AFTER_SPEED_CHANGES = (MECHANICS_GENERATION >= 8) + # Whether critical hits do 1.5x damage and have 4 stages (true), or they do 2x + # damage and have 5 stages as in Gen 5 (false). Also determines whether critical + # hit rate can be copied by Transform/Psych Up. + NEW_CRITICAL_HIT_RATE_MECHANICS = (MECHANICS_GENERATION >= 6) + # Whether several effects apply relating to a Pokémon's type: + # * Electric-type immunity to paralysis + # * Ghost-type immunity to being trapped + # * Grass-type immunity to powder moves and Effect Spore + # * Poison-type Pokémon can't miss when using Toxic + MORE_TYPE_EFFECTS = (MECHANICS_GENERATION >= 6) + # Whether weather caused by an ability lasts 5 rounds (true) or forever (false). + FIXED_DURATION_WEATHER_FROM_ABILITY = (MECHANICS_GENERATION >= 6) -#=============================================================================== + #=============================================================================== -# Whether X items (X Attack, etc.) raise their stat by 2 stages (true) or 1 -# (false). -X_STAT_ITEMS_RAISE_BY_TWO_STAGES = (MECHANICS_GENERATION >= 7) -# Whether some Poké Balls have catch rate multipliers from Gen 7 (true) or from -# earlier generations (false). -NEW_POKE_BALL_CATCH_RATES = (MECHANICS_GENERATION >= 7) -# Whether Soul Dew powers up Psychic and Dragon-type moves by 20% (true) or -# raises the holder's Special Attack and Special Defense by 50% (false). -SOUL_DEW_POWERS_UP_TYPES = (MECHANICS_GENERATION >= 7) + # Whether X items (X Attack, etc.) raise their stat by 2 stages (true) or 1 + # (false). + X_STAT_ITEMS_RAISE_BY_TWO_STAGES = (MECHANICS_GENERATION >= 7) + # Whether some Poké Balls have catch rate multipliers from Gen 7 (true) or from + # earlier generations (false). + NEW_POKE_BALL_CATCH_RATES = (MECHANICS_GENERATION >= 7) + # Whether Soul Dew powers up Psychic and Dragon-type moves by 20% (true) or + # raises the holder's Special Attack and Special Defense by 50% (false). + SOUL_DEW_POWERS_UP_TYPES = (MECHANICS_GENERATION >= 7) -#=============================================================================== + #=============================================================================== -# The minimum number of badges required to boost each stat of a player's -# Pokémon by 1.1x, in battle only. -NUM_BADGES_BOOST_ATTACK = (MECHANICS_GENERATION >= 4) ? 999 : 1 -NUM_BADGES_BOOST_DEFENSE = (MECHANICS_GENERATION >= 4) ? 999 : 5 -NUM_BADGES_BOOST_SPATK = (MECHANICS_GENERATION >= 4) ? 999 : 7 -NUM_BADGES_BOOST_SPDEF = (MECHANICS_GENERATION >= 4) ? 999 : 7 -NUM_BADGES_BOOST_SPEED = (MECHANICS_GENERATION >= 4) ? 999 : 3 + # The minimum number of badges required to boost each stat of a player's + # Pokémon by 1.1x, in battle only. + NUM_BADGES_BOOST_ATTACK = (MECHANICS_GENERATION >= 4) ? 999 : 1 + NUM_BADGES_BOOST_DEFENSE = (MECHANICS_GENERATION >= 4) ? 999 : 5 + NUM_BADGES_BOOST_SPATK = (MECHANICS_GENERATION >= 4) ? 999 : 7 + NUM_BADGES_BOOST_SPDEF = (MECHANICS_GENERATION >= 4) ? 999 : 7 + NUM_BADGES_BOOST_SPEED = (MECHANICS_GENERATION >= 4) ? 999 : 3 -#=============================================================================== + #=============================================================================== -# An array of items which act as Mega Rings for the player (NPCs don't need a -# Mega Ring item, just a Mega Stone held by their Pokémon). -MEGA_RINGS = [:MEGARING, :MEGABRACELET, :MEGACUFF, :MEGACHARM] -# The Game Switch which, while ON, prevents all Pokémon in battle from Mega -# Evolving even if they otherwise could. -NO_MEGA_EVOLUTION = 34 + # An array of items which act as Mega Rings for the player (NPCs don't need a + # Mega Ring item, just a Mega Stone held by their Pokémon). + MEGA_RINGS = [:MEGARING, :MEGABRACELET, :MEGACUFF, :MEGACHARM] + # The Game Switch which, while ON, prevents all Pokémon in battle from Mega + # Evolving even if they otherwise could. + NO_MEGA_EVOLUTION = 34 -#=============================================================================== + #=============================================================================== -# Whether the Exp gained from beating a Pokémon should be scaled depending on -# the gainer's level. -SCALED_EXP_FORMULA = (MECHANICS_GENERATION >= 5 && MECHANICS_GENERATION != 6) -# Whether the Exp gained from beating a Pokémon should be divided equally -# between each participant (true), or whether each participant should gain that -# much Exp (false). This also applies to Exp gained via the Exp Share (held item -# version) being distributed to all Exp Share holders. -SPLIT_EXP_BETWEEN_GAINERS = (MECHANICS_GENERATION <= 5) -# Whether the critical capture mechanic applies. Note that it is based on a -# total of 600+ species (i.e. that many species need to be caught to provide the -# greatest critical capture chance of 2.5x), and there may be fewer species in -# your game. -ENABLE_CRITICAL_CAPTURES = (MECHANICS_GENERATION >= 5) -# Whether Pokémon gain Exp for capturing a Pokémon. -GAIN_EXP_FOR_CAPTURE = (MECHANICS_GENERATION >= 6) -# The Game Switch which determines whether the player will lose money if they -# lose a battle (they can still gain money from trainers for winning). -NO_MONEY_LOSS = 33 -# Whether party Pokémon check whether they can evolve after all battles -# regardless of the outcome (true) or only after battles the player won (false). -CHECK_EVOLUTION_AFTER_ALL_BATTLES = (MECHANICS_GENERATION >= 6) -# Whether fainted Pokémon can try to evolve after a battle. -CHECK_EVOLUTION_FOR_FAINTED_POKEMON = (MECHANICS_GENERATION >= 6) + # Whether the Exp gained from beating a Pokémon should be scaled depending on + # the gainer's level. + SCALED_EXP_FORMULA = (MECHANICS_GENERATION == 5 || MECHANICS_GENERATION >= 7) + # Whether the Exp gained from beating a Pokémon should be divided equally + # between each participant (true), or whether each participant should gain that + # much Exp (false). This also applies to Exp gained via the Exp Share (held item + # version) being distributed to all Exp Share holders. + SPLIT_EXP_BETWEEN_GAINERS = (MECHANICS_GENERATION <= 5) + # Whether the critical capture mechanic applies. Note that it is based on a + # total of 600+ species (i.e. that many species need to be caught to provide the + # greatest critical capture chance of 2.5x), and there may be fewer species in + # your game. + ENABLE_CRITICAL_CAPTURES = (MECHANICS_GENERATION >= 5) + # Whether Pokémon gain Exp for capturing a Pokémon. + GAIN_EXP_FOR_CAPTURE = (MECHANICS_GENERATION >= 6) + # The Game Switch which, whie ON, prevents the player from losing money if they + # lose a battle (they can still gain money from trainers for winning). + NO_MONEY_LOSS = 33 + # Whether party Pokémon check whether they can evolve after all battles + # regardless of the outcome (true) or only after battles the player won (false). + CHECK_EVOLUTION_AFTER_ALL_BATTLES = (MECHANICS_GENERATION >= 6) + # Whether fainted Pokémon can try to evolve after a battle. + CHECK_EVOLUTION_FOR_FAINTED_POKEMON = (MECHANICS_GENERATION >= 6) +end diff --git a/Data/Scripts/004_Sprites/004_Sprite_WaterReflection.rb b/Data/Scripts/004_Sprites/004_Sprite_WaterReflection.rb index 4f199086c..14dc72b9a 100644 --- a/Data/Scripts/004_Sprites/004_Sprite_WaterReflection.rb +++ b/Data/Scripts/004_Sprites/004_Sprite_WaterReflection.rb @@ -74,7 +74,7 @@ class Sprite_Reflection if @height>0 @sprite.color = Color.new(48,96,160,255) # Dark still water @sprite.opacity = @rsprite.opacity - @sprite.visible = !TIME_SHADING # Can't time-tone a colored sprite + @sprite.visible = !Settings::TIME_SHADING # Can't time-tone a colored sprite else @sprite.color = Color.new(224,224,224,96) @sprite.opacity = @rsprite.opacity*3/4 diff --git a/Data/Scripts/004_Sprites/006_Spriteset_Map.rb b/Data/Scripts/004_Sprites/006_Spriteset_Map.rb index 7064d83aa..38be6f280 100644 --- a/Data/Scripts/004_Sprites/006_Spriteset_Map.rb +++ b/Data/Scripts/004_Sprites/006_Spriteset_Map.rb @@ -33,11 +33,11 @@ end class Spriteset_Map attr_reader :map attr_accessor :tilemap - @@viewport0 = Viewport.new(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) # Panorama + @@viewport0 = Viewport.new(0, 0, Settings::SCREEN_WIDTH, Settings::SCREEN_HEIGHT) # Panorama @@viewport0.z = -100 - @@viewport1 = Viewport.new(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) # Map, events, player, fog + @@viewport1 = Viewport.new(0, 0, Settings::SCREEN_WIDTH, Settings::SCREEN_HEIGHT) # Map, events, player, fog @@viewport1.z = 0 - @@viewport3 = Viewport.new(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) # Flashing + @@viewport3 = Viewport.new(0, 0, Settings::SCREEN_WIDTH, Settings::SCREEN_HEIGHT) # Flashing @@viewport3.z = 500 def Spriteset_Map.viewport # For access by Spriteset_Global diff --git a/Data/Scripts/004_Sprites/007_Spriteset_Global.rb b/Data/Scripts/004_Sprites/007_Spriteset_Global.rb index df5417dc9..2b28db7a6 100644 --- a/Data/Scripts/004_Sprites/007_Spriteset_Global.rb +++ b/Data/Scripts/004_Sprites/007_Spriteset_Global.rb @@ -1,6 +1,6 @@ class Spriteset_Global attr_reader :playersprite - @@viewport2 = Viewport.new(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) + @@viewport2 = Viewport.new(0, 0, Settings::SCREEN_WIDTH, Settings::SCREEN_HEIGHT) @@viewport2.z = 200 def initialize diff --git a/Data/Scripts/006_Game processing/001b_Interpreter commands.rb b/Data/Scripts/006_Game processing/001b_Interpreter commands.rb index 4e5ebcfbd..3fb645033 100644 --- a/Data/Scripts/006_Game processing/001b_Interpreter commands.rb +++ b/Data/Scripts/006_Game processing/001b_Interpreter commands.rb @@ -572,10 +572,10 @@ class Interpreter # * Change Windowskin #----------------------------------------------------------------------------- def command_131 - for i in 0...$SpeechFrames.length - next if $SpeechFrames[i] != @parameters[0] + for i in 0...Settings::SPEECH_WINDOWSKINS.length + next if Settings::SPEECH_WINDOWSKINS[i] != @parameters[0] $PokemonSystem.textskin = i - MessageConfig.pbSetSpeechFrame("Graphics/Windowskins/" + $SpeechFrames[i]) + MessageConfig.pbSetSpeechFrame("Graphics/Windowskins/" + Settings::SPEECH_WINDOWSKINS[i]) return true end return true diff --git a/Data/Scripts/009_Objects and windows/002_MessageConfig.rb b/Data/Scripts/009_Objects and windows/002_MessageConfig.rb index 99dd43f24..7dc18aefc 100644 --- a/Data/Scripts/009_Objects and windows/002_MessageConfig.rb +++ b/Data/Scripts/009_Objects and windows/002_MessageConfig.rb @@ -41,25 +41,25 @@ module MessageConfig def self.pbDefaultSystemFrame begin - return pbResolveBitmap("Graphics/Windowskins/" + $TextFrames[$PokemonSystem.frame]) || "" + return pbResolveBitmap("Graphics/Windowskins/" + Settings::MENU_WINDOWSKINS[$PokemonSystem.frame]) || "" rescue - return pbResolveBitmap("Graphics/Windowskins/" + $TextFrames[0]) || "" + return pbResolveBitmap("Graphics/Windowskins/" + Settings::MENU_WINDOWSKINS[0]) || "" end end def self.pbDefaultSpeechFrame begin - return pbResolveBitmap("Graphics/Windowskins/" + $SpeechFrames[$PokemonSystem.textskin]) || "" + return pbResolveBitmap("Graphics/Windowskins/" + Settings::SPEECH_WINDOWSKINS[$PokemonSystem.textskin]) || "" rescue - return pbResolveBitmap("Graphics/Windowskins/" + $SpeechFrames[0]) || "" + return pbResolveBitmap("Graphics/Windowskins/" + Settings::SPEECH_WINDOWSKINS[0]) || "" end end def self.pbDefaultSystemFontName begin - return MessageConfig.pbTryFonts($VersionStyles[$PokemonSystem.font][0], "Arial Narrow", "Arial") + return MessageConfig.pbTryFonts(Settings::FONT_OPTIONS[$PokemonSystem.font], "Arial Narrow", "Arial") rescue - return MessageConfig.pbTryFonts($VersionStyles[0], "Arial Narrow", "Arial") + return MessageConfig.pbTryFonts(Settings::FONT_OPTIONS[0], "Arial Narrow", "Arial") end end @@ -123,7 +123,7 @@ module MessageConfig end def self.pbSetSystemFontName(value) - @@systemFont=MessageConfig.pbTryFonts(value,"Arial Narrow","Arial") + @@systemFont=MessageConfig.pbTryFonts([value],"Arial Narrow","Arial") end def self.pbSetTextSpeed(value) diff --git a/Data/Scripts/011_Data/001_Game data/007_Move.rb b/Data/Scripts/011_Data/001_Game data/007_Move.rb index c752dda4d..9945e293c 100644 --- a/Data/Scripts/011_Data/001_Game data/007_Move.rb +++ b/Data/Scripts/011_Data/001_Game data/007_Move.rb @@ -50,13 +50,13 @@ module GameData def physical? return false if @base_damage == 0 - return @category == 0 if MOVE_CATEGORY_PER_MOVE + return @category == 0 if Settings::MOVE_CATEGORY_PER_MOVE return GameData::Type.get(@type).physical? end def special? return false if @base_damage == 0 - return @category == 1 if MOVE_CATEGORY_PER_MOVE + return @category == 1 if Settings::MOVE_CATEGORY_PER_MOVE return GameData::Type.get(@type).special? end diff --git a/Data/Scripts/011_Data/001_Game data/012_Trainer.rb b/Data/Scripts/011_Data/001_Game data/012_Trainer.rb index 94e11d1f3..cdbb443ff 100644 --- a/Data/Scripts/011_Data/001_Game data/012_Trainer.rb +++ b/Data/Scripts/011_Data/001_Game data/012_Trainer.rb @@ -101,7 +101,7 @@ module GameData def to_trainer # Determine trainer's name tr_name = self.name - RIVAL_NAMES.each do |rival| + Settings::RIVAL_NAMES.each do |rival| next if rival[0] != @trainer_type || !$game_variables[rival[1]].is_a?(String) tr_name = $game_variables[rival[1]] break diff --git a/Data/Scripts/011_Data/Hardcoded game data/001_PBExperience.rb b/Data/Scripts/011_Data/Hardcoded game data/001_PBExperience.rb index a37ad0843..336fdaebf 100644 --- a/Data/Scripts/011_Data/Hardcoded game data/001_PBExperience.rb +++ b/Data/Scripts/011_Data/Hardcoded game data/001_PBExperience.rb @@ -92,7 +92,7 @@ module PBExperience # player's data) is loaded, so make sure they exist before using them, and # make this method return the most maximum ever level if they don't. def self.maxLevel - return MAXIMUM_LEVEL + return Settings::MAXIMUM_LEVEL end # Erratic (600000): diff --git a/Data/Scripts/012_Battle/001_Battler/001_PokeBattle_Battler.rb b/Data/Scripts/012_Battle/001_Battler/001_PokeBattle_Battler.rb index 2cdd46323..3d6a96cf9 100644 --- a/Data/Scripts/012_Battle/001_Battler/001_PokeBattle_Battler.rb +++ b/Data/Scripts/012_Battle/001_Battler/001_PokeBattle_Battler.rb @@ -255,11 +255,11 @@ class PokeBattle_Battler speedMult /= 2 if pbOwnSide.effects[PBEffects::Swamp]>0 # Paralysis if status==PBStatuses::PARALYSIS && !hasActiveAbility?(:QUICKFEET) - speedMult /= (MECHANICS_GENERATION >= 7) ? 2 : 4 + speedMult /= (Settings::MECHANICS_GENERATION >= 7) ? 2 : 4 end # Badge multiplier if @battle.internalBattle && pbOwnedByPlayer? && - @battle.pbPlayer.badge_count >= NUM_BADGES_BOOST_SPEED + @battle.pbPlayer.badge_count >= Settings::NUM_BADGES_BOOST_SPEED speedMult *= 1.1 end # Calculation @@ -524,11 +524,11 @@ class PokeBattle_Battler def affectedByPowder?(showMsg=false) return false if fainted? - if pbHasType?(:GRASS) && MORE_TYPE_EFFECTS + if pbHasType?(:GRASS) && Settings::MORE_TYPE_EFFECTS @battle.pbDisplay(_INTL("{1} is unaffected!",pbThis)) if showMsg return false end - if MECHANICS_GENERATION >= 6 + if Settings::MECHANICS_GENERATION >= 6 if hasActiveAbility?(:OVERCOAT) && !@battle.moldBreaker if showMsg @battle.pbShowAbilitySplash(self) diff --git a/Data/Scripts/012_Battle/001_Battler/003_Battler_ChangeSelf.rb b/Data/Scripts/012_Battle/001_Battler/003_Battler_ChangeSelf.rb index b0352aa8c..7f0a3d820 100644 --- a/Data/Scripts/012_Battle/001_Battler/003_Battler_ChangeSelf.rb +++ b/Data/Scripts/012_Battle/001_Battler/003_Battler_ChangeSelf.rb @@ -137,7 +137,7 @@ class PokeBattle_Battler self.form = newForm pbUpdate(true) @hp = @totalhp-oldDmg - @effects[PBEffects::WeightChange] = 0 if MECHANICS_GENERATION >= 6 + @effects[PBEffects::WeightChange] = 0 if Settings::MECHANICS_GENERATION >= 6 @battle.scene.pbChangePokemon(self,@pokemon) @battle.scene.pbRefreshOne(@index) @battle.pbDisplay(msg) if msg && msg!="" @@ -275,7 +275,7 @@ class PokeBattle_Battler @spdef = target.spdef @speed = target.speed PBStats.eachBattleStat { |s| @stages[s] = target.stages[s] } - if NEW_CRITICAL_HIT_RATE_MECHANICS + if Settings::NEW_CRITICAL_HIT_RATE_MECHANICS @effects[PBEffects::FocusEnergy] = target.effects[PBEffects::FocusEnergy] @effects[PBEffects::LaserFocus] = target.effects[PBEffects::LaserFocus] end diff --git a/Data/Scripts/012_Battle/001_Battler/004_Battler_Statuses.rb b/Data/Scripts/012_Battle/001_Battler/004_Battler_Statuses.rb index 5b2e0bfa4..29ea56922 100644 --- a/Data/Scripts/012_Battle/001_Battler/004_Battler_Statuses.rb +++ b/Data/Scripts/012_Battle/001_Battler/004_Battler_Statuses.rb @@ -93,7 +93,7 @@ class PokeBattle_Battler when PBStatuses::BURN hasImmuneType |= pbHasType?(:FIRE) when PBStatuses::PARALYSIS - hasImmuneType |= pbHasType?(:ELECTRIC) && MORE_TYPE_EFFECTS + hasImmuneType |= pbHasType?(:ELECTRIC) && Settings::MORE_TYPE_EFFECTS when PBStatuses::FROZEN hasImmuneType |= pbHasType?(:ICE) end @@ -189,7 +189,7 @@ class PokeBattle_Battler when PBStatuses::BURN hasImmuneType |= pbHasType?(:FIRE) when PBStatuses::PARALYSIS - hasImmuneType |= pbHasType?(:ELECTRIC) && MORE_TYPE_EFFECTS + hasImmuneType |= pbHasType?(:ELECTRIC) && Settings::MORE_TYPE_EFFECTS end return false if hasImmuneType # Ability immunity diff --git a/Data/Scripts/012_Battle/001_Battler/007_Battler_UseMove.rb b/Data/Scripts/012_Battle/001_Battler/007_Battler_UseMove.rb index e99e32407..65440b854 100644 --- a/Data/Scripts/012_Battle/001_Battler/007_Battler_UseMove.rb +++ b/Data/Scripts/012_Battle/001_Battler/007_Battler_UseMove.rb @@ -61,7 +61,7 @@ class PokeBattle_Battler } @battle.pbJudge # Update priority order - @battle.pbCalculatePriority if RECALCULATE_TURN_ORDER_AFTER_SPEED_CHANGES + @battle.pbCalculatePriority if Settings::RECALCULATE_TURN_ORDER_AFTER_SPEED_CHANGES return true end diff --git a/Data/Scripts/012_Battle/001_Battler/009_Battler_UseMove_SuccessChecks.rb b/Data/Scripts/012_Battle/001_Battler/009_Battler_UseMove_SuccessChecks.rb index 097095e00..c63e88ba2 100644 --- a/Data/Scripts/012_Battle/001_Battler/009_Battler_UseMove_SuccessChecks.rb +++ b/Data/Scripts/012_Battle/001_Battler/009_Battler_UseMove_SuccessChecks.rb @@ -253,7 +253,7 @@ class PokeBattle_Battler else @battle.pbCommonAnimation("Confusion",self) @battle.pbDisplay(_INTL("{1} is confused!",pbThis)) - threshold = (MECHANICS_GENERATION >= 7) ? 33 : 50 # % chance + threshold = (Settings::MECHANICS_GENERATION >= 7) ? 33 : 50 # % chance if @battle.pbRandom(100)= 7 || move.damagingMove?) + (Settings::MECHANICS_GENERATION >= 7 || move.damagingMove?) @battle.pbCommonAnimation("WideGuard",target) @battle.pbDisplay(_INTL("Wide Guard protected {1}!",target.pbThis(true))) target.damageState.protected = true @@ -408,7 +408,7 @@ class PokeBattle_Battler return false end # Dark-type immunity to moves made faster by Prankster - if MECHANICS_GENERATION >= 7 && user.effects[PBEffects::Prankster] && + if Settings::MECHANICS_GENERATION >= 7 && user.effects[PBEffects::Prankster] && target.pbHasType?(:DARK) && target.opposes?(user) PBDebug.log("[Target immune] #{target.pbThis} is Dark-type and immune to Prankster-boosted moves") @battle.pbDisplay(_INTL("It doesn't affect {1}...",target.pbThis(true))) @@ -442,12 +442,12 @@ class PokeBattle_Battler end # Immunity to powder-based moves if move.powderMove? - if target.pbHasType?(:GRASS) && MORE_TYPE_EFFECTS + if target.pbHasType?(:GRASS) && Settings::MORE_TYPE_EFFECTS PBDebug.log("[Target immune] #{target.pbThis} is Grass-type and immune to powder-based moves") @battle.pbDisplay(_INTL("It doesn't affect {1}...",target.pbThis(true))) return false end - if MECHANICS_GENERATION >= 6 + if Settings::MECHANICS_GENERATION >= 6 if target.hasActiveAbility?(:OVERCOAT) && !@battle.moldBreaker @battle.pbShowAbilitySplash(target) if PokeBattle_SceneConstants::USE_ABILITY_SPLASH diff --git a/Data/Scripts/012_Battle/001_Battler/010_Battler_UseMove_TriggerEffects.rb b/Data/Scripts/012_Battle/001_Battler/010_Battler_UseMove_TriggerEffects.rb index 100af47e1..b1b0799b6 100644 --- a/Data/Scripts/012_Battle/001_Battler/010_Battler_UseMove_TriggerEffects.rb +++ b/Data/Scripts/012_Battle/001_Battler/010_Battler_UseMove_TriggerEffects.rb @@ -72,7 +72,7 @@ class PokeBattle_Battler next if b.status!=PBStatuses::FROZEN # NOTE: Non-Fire-type moves that thaw the user will also thaw the # target (in Gen 6+). - if move.calcType == :FIRE || (MECHANICS_GENERATION >= 6 && move.thawsUser?) + if move.calcType == :FIRE || (Settings::MECHANICS_GENERATION >= 6 && move.thawsUser?) b.pbCureStatus end end diff --git a/Data/Scripts/012_Battle/002_Move/001_PokeBattle_Move.rb b/Data/Scripts/012_Battle/002_Move/001_PokeBattle_Move.rb index 545a40a29..3bf15d844 100644 --- a/Data/Scripts/012_Battle/002_Move/001_PokeBattle_Move.rb +++ b/Data/Scripts/012_Battle/002_Move/001_PokeBattle_Move.rb @@ -71,7 +71,7 @@ class PokeBattle_Move # NOTE: This method is only ever called while using a move (and also by the # AI), so using @calcType here is acceptable. def physicalMove?(thisType=nil) - return (@category==0) if MOVE_CATEGORY_PER_MOVE + return (@category==0) if Settings::MOVE_CATEGORY_PER_MOVE thisType ||= @calcType thisType ||= @type return true if !thisType @@ -81,7 +81,7 @@ class PokeBattle_Move # NOTE: This method is only ever called while using a move (and also by the # AI), so using @calcType here is acceptable. def specialMove?(thisType=nil) - return (@category==1) if MOVE_CATEGORY_PER_MOVE + return (@category==1) if Settings::MOVE_CATEGORY_PER_MOVE thisType ||= @calcType thisType ||= @type return false if !thisType @@ -132,7 +132,7 @@ class PokeBattle_Move def nonLethal?(_user,_target); return false; end # For False Swipe def ignoresSubstitute?(user) # user is the Pokémon using this move - if MECHANICS_GENERATION >= 6 + if Settings::MECHANICS_GENERATION >= 6 return true if soundMove? return true if user && user.hasActiveAbility?(:INFILTRATOR) end diff --git a/Data/Scripts/012_Battle/002_Move/003_Move_Usage_Calculations.rb b/Data/Scripts/012_Battle/002_Move/003_Move_Usage_Calculations.rb index 4d317cc35..e2297e76a 100644 --- a/Data/Scripts/012_Battle/002_Move/003_Move_Usage_Calculations.rb +++ b/Data/Scripts/012_Battle/002_Move/003_Move_Usage_Calculations.rb @@ -161,7 +161,7 @@ class PokeBattle_Move def pbIsCritical?(user,target) return false if target.pbOwnSide.effects[PBEffects::LuckyChant]>0 # Set up the critical hit ratios - ratios = (NEW_CRITICAL_HIT_RATE_MECHANICS) ? [24,8,2,1] : [16,8,4,3,2] + ratios = (Settings::NEW_CRITICAL_HIT_RATE_MECHANICS) ? [24,8,2,1] : [16,8,4,3,2] c = 0 # Ability effects that alter critical hit rate if c>=0 && user.abilityActive? @@ -357,16 +357,16 @@ class PokeBattle_Move # Badge multipliers if @battle.internalBattle if user.pbOwnedByPlayer? - if physicalMove? && @battle.pbPlayer.badge_count >= NUM_BADGES_BOOST_ATTACK + if physicalMove? && @battle.pbPlayer.badge_count >= Settings::NUM_BADGES_BOOST_ATTACK multipliers[:attack_multiplier] *= 1.1 - elsif specialMove? && @battle.pbPlayer.badge_count >= NUM_BADGES_BOOST_SPATK + elsif specialMove? && @battle.pbPlayer.badge_count >= Settings::NUM_BADGES_BOOST_SPATK multipliers[:attack_multiplier] *= 1.1 end end if target.pbOwnedByPlayer? - if physicalMove? && @battle.pbPlayer.badge_count >= NUM_BADGES_BOOST_DEFENSE + if physicalMove? && @battle.pbPlayer.badge_count >= Settings::NUM_BADGES_BOOST_DEFENSE multipliers[:defense_multiplier] *= 1.1 - elsif specialMove? && @battle.pbPlayer.badge_count >= NUM_BADGES_BOOST_SPDEF + elsif specialMove? && @battle.pbPlayer.badge_count >= Settings::NUM_BADGES_BOOST_SPDEF multipliers[:defense_multiplier] *= 1.1 end end @@ -396,7 +396,7 @@ class PokeBattle_Move end # Critical hits if target.damageState.critical - if NEW_CRITICAL_HIT_RATE_MECHANICS + if Settings::NEW_CRITICAL_HIT_RATE_MECHANICS multipliers[:final_damage_multiplier] *= 1.5 else multipliers[:final_damage_multiplier] *= 2 @@ -461,7 +461,7 @@ class PokeBattle_Move def pbAdditionalEffectChance(user,target,effectChance=0) return 0 if target.hasActiveAbility?(:SHIELDDUST) && !@battle.moldBreaker ret = (effectChance>0) ? effectChance : @addlEffect - if MECHANICS_GENERATION >= 6 || @function != "0A4" # Secret Power + if Settings::MECHANICS_GENERATION >= 6 || @function != "0A4" # Secret Power ret *= 2 if user.hasActiveAbility?(:SERENEGRACE) || user.pbOwnSide.effects[PBEffects::Rainbow]>0 end diff --git a/Data/Scripts/012_Battle/002_Move/004_Move_Effects_Generic.rb b/Data/Scripts/012_Battle/002_Move/004_Move_Effects_Generic.rb index f1738e368..03ddcce04 100644 --- a/Data/Scripts/012_Battle/002_Move/004_Move_Effects_Generic.rb +++ b/Data/Scripts/012_Battle/002_Move/004_Move_Effects_Generic.rb @@ -555,7 +555,7 @@ class PokeBattle_ProtectMove < PokeBattle_Move @battle.pbDisplay(_INTL("But it failed!")) return true end - if (!@sidedEffect || MECHANICS_GENERATION <= 5) && + if (!@sidedEffect || Settings::MECHANICS_GENERATION <= 5) && user.effects[PBEffects::ProtectRate]>1 && @battle.pbRandom(user.effects[PBEffects::ProtectRate])!=0 user.effects[PBEffects::ProtectRate] = 1 @@ -575,7 +575,7 @@ class PokeBattle_ProtectMove < PokeBattle_Move else user.effects[@effect] = true end - user.effects[PBEffects::ProtectRate] *= (MECHANICS_GENERATION >= 6) ? 3 : 2 + user.effects[PBEffects::ProtectRate] *= (Settings::MECHANICS_GENERATION >= 6) ? 3 : 2 pbProtectMessage(user) end diff --git a/Data/Scripts/012_Battle/002_Move/005_Move_Effects_000-07F.rb b/Data/Scripts/012_Battle/002_Move/005_Move_Effects_000-07F.rb index 64c3a24d5..e6851ef05 100644 --- a/Data/Scripts/012_Battle/002_Move/005_Move_Effects_000-07F.rb +++ b/Data/Scripts/012_Battle/002_Move/005_Move_Effects_000-07F.rb @@ -32,7 +32,7 @@ end #=============================================================================== class PokeBattle_Move_003 < PokeBattle_SleepMove def pbMoveFailed?(user,targets) - if MECHANICS_GENERATION >= 7 && @id == :DARKVOID + if Settings::MECHANICS_GENERATION >= 7 && @id == :DARKVOID if !user.isSpecies?(:DARKRAI) && user.effects[PBEffects::TransformSpecies] != :DARKRAI @battle.pbDisplay(_INTL("But {1} can't use the move!",user.pbThis)) return true @@ -93,7 +93,7 @@ class PokeBattle_Move_006 < PokeBattle_PoisonMove end def pbOverrideSuccessCheckPerHit(user,target) - return (MORE_TYPE_EFFECTS && statusMove? && user.pbHasType?(:POISON)) + return (Settings::MORE_TYPE_EFFECTS && statusMove? && user.pbHasType?(:POISON)) end end @@ -107,7 +107,7 @@ end class PokeBattle_Move_007 < PokeBattle_ParalysisMove def tramplesMinimize?(param=1) # Perfect accuracy and double damage (for Body Slam only) - return MECHANICS_GENERATION >= 6 if @id == :BODYSLAM + return Settings::MECHANICS_GENERATION >= 6 if @id == :BODYSLAM return super end @@ -241,8 +241,8 @@ end #=============================================================================== class PokeBattle_Move_010 < PokeBattle_FlinchMove def tramplesMinimize?(param=1) - return super if @id == :DRAGONRUSH && MECHANICS_GENERATION <= 5 - return true if param==1 && MECHANICS_GENERATION >= 6 # Perfect accuracy + return super if @id == :DRAGONRUSH && Settings::MECHANICS_GENERATION <= 5 + return true if param==1 && Settings::MECHANICS_GENERATION >= 6 # Perfect accuracy return true if param==2 # Double damage return super end @@ -1254,7 +1254,7 @@ end class PokeBattle_Move_048 < PokeBattle_TargetStatDownMove def initialize(battle,move) super - @statDown = [PBStats::EVASION,(MECHANICS_GENERATION >= 6) ? 2 : 1] + @statDown = [PBStats::EVASION, (Settings::MECHANICS_GENERATION >= 6) ? 2 : 1] end end @@ -1284,12 +1284,12 @@ class PokeBattle_Move_049 < PokeBattle_TargetStatDownMove targetSide.effects[PBEffects::Spikes]>0 || targetSide.effects[PBEffects::ToxicSpikes]>0 || targetSide.effects[PBEffects::StickyWeb] - return false if MECHANICS_GENERATION >= 6 && + return false if Settings::MECHANICS_GENERATION >= 6 && (targetOpposingSide.effects[PBEffects::StealthRock] || targetOpposingSide.effects[PBEffects::Spikes]>0 || targetOpposingSide.effects[PBEffects::ToxicSpikes]>0 || targetOpposingSide.effects[PBEffects::StickyWeb]) - return false if MECHANICS_GENERATION >= 8 && + return false if Settings::MECHANICS_GENERATION >= 8 && @battle.field.terrain != PBBattleTerrains::None return super end @@ -1319,34 +1319,34 @@ class PokeBattle_Move_049 < PokeBattle_TargetStatDownMove @battle.pbDisplay(_INTL("{1} is no longer protected by Safeguard!!",target.pbTeam)) end if target.pbOwnSide.effects[PBEffects::StealthRock] || - (MECHANICS_GENERATION >= 6 && + (Settings::MECHANICS_GENERATION >= 6 && target.pbOpposingSide.effects[PBEffects::StealthRock]) target.pbOwnSide.effects[PBEffects::StealthRock] = false - target.pbOpposingSide.effects[PBEffects::StealthRock] = false if MECHANICS_GENERATION >= 6 + target.pbOpposingSide.effects[PBEffects::StealthRock] = false if Settings::MECHANICS_GENERATION >= 6 @battle.pbDisplay(_INTL("{1} blew away stealth rocks!",user.pbThis)) end if target.pbOwnSide.effects[PBEffects::Spikes]>0 || - (MECHANICS_GENERATION >= 6 && + (Settings::MECHANICS_GENERATION >= 6 && target.pbOpposingSide.effects[PBEffects::Spikes]>0) target.pbOwnSide.effects[PBEffects::Spikes] = 0 - target.pbOpposingSide.effects[PBEffects::Spikes] = 0 if MECHANICS_GENERATION >= 6 + target.pbOpposingSide.effects[PBEffects::Spikes] = 0 if Settings::MECHANICS_GENERATION >= 6 @battle.pbDisplay(_INTL("{1} blew away spikes!",user.pbThis)) end if target.pbOwnSide.effects[PBEffects::ToxicSpikes]>0 || - (MECHANICS_GENERATION >= 6 && + (Settings::MECHANICS_GENERATION >= 6 && target.pbOpposingSide.effects[PBEffects::ToxicSpikes]>0) target.pbOwnSide.effects[PBEffects::ToxicSpikes] = 0 - target.pbOpposingSide.effects[PBEffects::ToxicSpikes] = 0 if MECHANICS_GENERATION >= 6 + target.pbOpposingSide.effects[PBEffects::ToxicSpikes] = 0 if Settings::MECHANICS_GENERATION >= 6 @battle.pbDisplay(_INTL("{1} blew away poison spikes!",user.pbThis)) end if target.pbOwnSide.effects[PBEffects::StickyWeb] || - (MECHANICS_GENERATION >= 6 && + (Settings::MECHANICS_GENERATION >= 6 && target.pbOpposingSide.effects[PBEffects::StickyWeb]) target.pbOwnSide.effects[PBEffects::StickyWeb] = false - target.pbOpposingSide.effects[PBEffects::StickyWeb] = false if MECHANICS_GENERATION >= 6 + target.pbOpposingSide.effects[PBEffects::StickyWeb] = false if Settings::MECHANICS_GENERATION >= 6 @battle.pbDisplay(_INTL("{1} blew away sticky webs!",user.pbThis)) end - if MECHANICS_GENERATION >= 8 && @battle.field.terrain != PBBattleTerrains::None + if Settings::MECHANICS_GENERATION >= 8 && @battle.field.terrain != PBBattleTerrains::None case @battle.field.terrain when PBBattleTerrains::Electric @battle.pbDisplay(_INTL("The electricity disappeared from the battlefield.")) @@ -1407,7 +1407,7 @@ class PokeBattle_Move_04D < PokeBattle_TargetStatDownMove def initialize(battle,move) super inc = 2 - inc = 1 if @id == :STRINGSHOT && MECHANICS_GENERATION <= 5 + inc = 1 if @id == :STRINGSHOT && Settings::MECHANICS_GENERATION <= 5 @statDown = [PBStats::SPEED,inc] end end @@ -1561,7 +1561,7 @@ class PokeBattle_Move_055 < PokeBattle_Move def pbEffectAgainstTarget(user,target) PBStats.eachBattleStat { |s| user.stages[s] = target.stages[s] } - if NEW_CRITICAL_HIT_RATE_MECHANICS + if Settings::NEW_CRITICAL_HIT_RATE_MECHANICS user.effects[PBEffects::FocusEnergy] = target.effects[PBEffects::FocusEnergy] user.effects[PBEffects::LaserFocus] = target.effects[PBEffects::LaserFocus] end @@ -1796,7 +1796,7 @@ class PokeBattle_Move_05E < PokeBattle_Move userTypes = user.pbTypes(true) @newTypes = [] user.eachMoveWithIndex do |m,i| - break if MECHANICS_GENERATION >= 6 && i>0 + break if Settings::MECHANICS_GENERATION >= 6 && i>0 next if PBTypes.isPseudoType?(m.type) next if userTypes.include?(m.type) @newTypes.push(m.type) if !@newTypes.include?(m.type) @@ -2169,7 +2169,7 @@ class PokeBattle_Move_067 < PokeBattle_Move def pbFailsAgainstTarget?(user,target) if !target.ability || - (user.ability == target.ability && MECHANICS_GENERATION <= 5) + (user.ability == target.ability && Settings::MECHANICS_GENERATION <= 5) @battle.pbDisplay(_INTL("But it failed!")) return true end @@ -2371,7 +2371,7 @@ class PokeBattle_Move_070 < PokeBattle_FixedDamageMove @battle.pbHideAbilitySplash(target) return true end - if MECHANICS_GENERATION >= 7 && @id == :SHEERCOLD && target.pbHasType?(:ICE) + if Settings::MECHANICS_GENERATION >= 7 && @id == :SHEERCOLD && target.pbHasType?(:ICE) @battle.pbDisplay(_INTL("But it failed!")) return true end @@ -2380,7 +2380,7 @@ class PokeBattle_Move_070 < PokeBattle_FixedDamageMove def pbAccuracyCheck(user,target) acc = @accuracy+user.level-target.level - acc -= 10 if MECHANICS_GENERATION >= 7 && @id == :SHEERCOLD && !user.pbHasType?(:ICE) + acc -= 10 if Settings::MECHANICS_GENERATION >= 7 && @id == :SHEERCOLD && !user.pbHasType?(:ICE) return @battle.pbRandom(100)= 6 + return super if Settings::MECHANICS_GENERATION >= 6 hp = pbHiddenPower(user) return hp[1] end @@ -272,7 +272,7 @@ def pbHiddenPower(pkmn) idxType |= (iv[PBStats::SPDEF]&1)<<5 idxType = (types.length-1)*idxType/63 type = types[idxType] - if MECHANICS_GENERATION <= 5 + if Settings::MECHANICS_GENERATION <= 5 powerMin = 30 powerMax = 70 power |= (iv[PBStats::HP]&2)>>1 @@ -503,7 +503,7 @@ class PokeBattle_Move_096 < PokeBattle_Move @damageArray.each do |dmg, items| next if !items.include?(heldItem) ret = dmg - ret += 20 if MECHANICS_GENERATION >= 6 + ret += 20 if Settings::MECHANICS_GENERATION >= 6 break end return ret @@ -600,7 +600,7 @@ end #=============================================================================== class PokeBattle_Move_09B < PokeBattle_Move def tramplesMinimize?(param=1) - return true if MECHANICS_GENERATION >= 7 # Perfect accuracy and double damage + return true if Settings::MECHANICS_GENERATION >= 7 # Perfect accuracy and double damage return super end @@ -646,7 +646,7 @@ end #=============================================================================== class PokeBattle_Move_09D < PokeBattle_Move def pbMoveFailed?(user,targets) - if MECHANICS_GENERATION >= 6 + if Settings::MECHANICS_GENERATION >= 6 if @battle.field.effects[PBEffects::MudSportField]>0 @battle.pbDisplay(_INTL("But it failed!")) return true @@ -662,7 +662,7 @@ class PokeBattle_Move_09D < PokeBattle_Move end def pbEffectGeneral(user) - if MECHANICS_GENERATION >= 6 + if Settings::MECHANICS_GENERATION >= 6 @battle.field.effects[PBEffects::MudSportField] = 5 else user.effects[PBEffects::MudSport] = true @@ -678,7 +678,7 @@ end #=============================================================================== class PokeBattle_Move_09E < PokeBattle_Move def pbMoveFailed?(user,targets) - if MECHANICS_GENERATION >= 6 + if Settings::MECHANICS_GENERATION >= 6 if @battle.field.effects[PBEffects::WaterSportField]>0 @battle.pbDisplay(_INTL("But it failed!")) return true @@ -694,7 +694,7 @@ class PokeBattle_Move_09E < PokeBattle_Move end def pbEffectGeneral(user) - if MECHANICS_GENERATION >= 6 + if Settings::MECHANICS_GENERATION >= 6 @battle.field.effects[PBEffects::WaterSportField] = 5 else user.effects[PBEffects::WaterSport] = true @@ -1193,7 +1193,7 @@ class PokeBattle_Move_0AF < PokeBattle_Move "133", # Hold Hands "134" # Celebrate ] - if MECHANICS_GENERATION >= 6 + if Settings::MECHANICS_GENERATION >= 6 @moveBlacklist += [ # Target-switching moves "0EB", # Roar, Whirlwind @@ -1325,7 +1325,7 @@ class PokeBattle_Move_0B3 < PokeBattle_Move case @battle.environment when PBEnvironment::Grass, PBEnvironment::TallGrass, PBEnvironment::Forest, PBEnvironment::ForestGrass - if MECHANICS_GENERATION >= 6 + if Settings::MECHANICS_GENERATION >= 6 @npMove = :ENERGYBALL if GameData::Move.exists?(:ENERGYBALL) else @npMove = :SEEDBOMB if GameData::Move.exists?(:SEEDBOMB) @@ -1335,25 +1335,25 @@ class PokeBattle_Move_0B3 < PokeBattle_Move when PBEnvironment::Puddle @npMove = :MUDBOMB if GameData::Move.exists?(:MUDBOMB) when PBEnvironment::Cave - if MECHANICS_GENERATION >= 6 + if Settings::MECHANICS_GENERATION >= 6 @npMove = :POWERGEM if GameData::Move.exists?(:POWERGEM) else @npMove = :ROCKSLIDE if GameData::Move.exists?(:ROCKSLIDE) end when PBEnvironment::Rock - if MECHANICS_GENERATION >= 6 + if Settings::MECHANICS_GENERATION >= 6 @npMove = :EARTHPOWER if GameData::Move.exists?(:EARTHPOWER) else @npMove = :ROCKSLIDE if GameData::Move.exists?(:ROCKSLIDE) end when PBEnvironment::Sand - if MECHANICS_GENERATION >= 6 + if Settings::MECHANICS_GENERATION >= 6 @npMove = :EARTHPOWER if GameData::Move.exists?(:EARTHPOWER) else @npMove = :EARTHQUAKE if GameData::Move.exists?(:EARTHQUAKE) end when PBEnvironment::Snow - if MECHANICS_GENERATION >= 6 + if Settings::MECHANICS_GENERATION >= 6 @npMove = :FROSTBREATH if GameData::Move.exists?(:FROSTBREATH) else @npMove = :BLIZZARD if GameData::Move.exists?(:BLIZZARD) @@ -1519,7 +1519,7 @@ class PokeBattle_Move_0B5 < PokeBattle_Move "133", # Hold Hands "134" # Celebrate ] - if MECHANICS_GENERATION >= 6 + if Settings::MECHANICS_GENERATION >= 6 @moveBlacklist += [ # Moves that call other moves "0B3", # Nature Power @@ -1550,7 +1550,7 @@ class PokeBattle_Move_0B5 < PokeBattle_Move # NOTE: This includes the Pokémon of ally trainers in multi battles. @battle.pbParty(user.index).each_with_index do |pkmn,i| next if !pkmn || i==user.pokemonIndex - next if MECHANICS_GENERATION >= 6 && pkmn.egg? + next if Settings::MECHANICS_GENERATION >= 6 && pkmn.egg? pkmn.moves.each do |move| next if @moveBlacklist.include?(move.function_code) next if move.type == :SHADOW @@ -1783,7 +1783,7 @@ class PokeBattle_Move_0BA < PokeBattle_Move return true end return true if pbMoveFailedAromaVeil?(user,target) - if MECHANICS_GENERATION >= 6 && target.hasActiveAbility?(:OBLIVIOUS) && + if Settings::MECHANICS_GENERATION >= 6 && target.hasActiveAbility?(:OBLIVIOUS) && !@battle.moldBreaker @battle.pbShowAbilitySplash(target) if PokeBattle_SceneConstants::USE_ABILITY_SPLASH @@ -1848,7 +1848,7 @@ class PokeBattle_Move_0BC < PokeBattle_Move # Moves that call other moves (see also below) "0AE" # Mirror Move ] - if MECHANICS_GENERATION >= 7 + if Settings::MECHANICS_GENERATION >= 7 @moveBlacklist += [ # Moves that call other moves # "0AE", # Mirror Move # See above @@ -2241,7 +2241,7 @@ class PokeBattle_Move_0CE < PokeBattle_TwoTurnMove @battle.pbDisplay(_INTL("But it failed!")) return true end - if MECHANICS_GENERATION >= 6 && target.pbWeight>=2000 # 200.0kg + if Settings::MECHANICS_GENERATION >= 6 && target.pbWeight>=2000 # 200.0kg @battle.pbDisplay(_INTL("But it failed!")) return true end @@ -2291,7 +2291,7 @@ class PokeBattle_Move_0CF < PokeBattle_Move return if target.effects[PBEffects::Trapping]>0 # Set trapping effect duration and info if user.hasActiveItem?(:GRIPCLAW) - target.effects[PBEffects::Trapping] = (MECHANICS_GENERATION >= 5) ? 8 : 6 + target.effects[PBEffects::Trapping] = (Settings::MECHANICS_GENERATION >= 5) ? 8 : 6 else target.effects[PBEffects::Trapping] = 5+@battle.pbRandom(2) end @@ -2654,7 +2654,7 @@ end # User gains half the HP it inflicts as damage. #=============================================================================== class PokeBattle_Move_0DD < PokeBattle_Move - def healingMove?; return MECHANICS_GENERATION >= 6; end + def healingMove?; return Settings::MECHANICS_GENERATION >= 6; end def pbEffectAgainstTarget(user,target) return if target.damageState.hpLost<=0 @@ -2670,7 +2670,7 @@ end # (Dream Eater) #=============================================================================== class PokeBattle_Move_0DE < PokeBattle_Move - def healingMove?; return MECHANICS_GENERATION >= 6; end + def healingMove?; return Settings::MECHANICS_GENERATION >= 6; end def pbFailsAgainstTarget?(user,target) if !target.asleep? @@ -2905,7 +2905,7 @@ end #=============================================================================== class PokeBattle_Move_0E7 < PokeBattle_Move def pbMoveFailed?(user,targets) - if MECHANICS_GENERATION >= 7 && user.effects[PBEffects::DestinyBondPrevious] + if Settings::MECHANICS_GENERATION >= 7 && user.effects[PBEffects::DestinyBondPrevious] @battle.pbDisplay(_INTL("But it failed!")) return true end @@ -3150,7 +3150,7 @@ class PokeBattle_Move_0EF < PokeBattle_Move @battle.pbDisplay(_INTL("But it failed!")) return true end - if MORE_TYPE_EFFECTS && target.pbHasType?(:GHOST) + if Settings::MORE_TYPE_EFFECTS && target.pbHasType?(:GHOST) @battle.pbDisplay(_INTL("It doesn't affect {1}...",target.pbThis(true))) return true end @@ -3166,7 +3166,7 @@ class PokeBattle_Move_0EF < PokeBattle_Move def pbAdditionalEffect(user,target) return if target.fainted? || target.damageState.substitute return if target.effects[PBEffects::MeanLook]>=0 - return if MORE_TYPE_EFFECTS && target.pbHasType?(:GHOST) + return if Settings::MORE_TYPE_EFFECTS && target.pbHasType?(:GHOST) target.effects[PBEffects::MeanLook] = user.index @battle.pbDisplay(_INTL("{1} can no longer escape!",target.pbThis)) end @@ -3180,7 +3180,7 @@ end #=============================================================================== class PokeBattle_Move_0F0 < PokeBattle_Move def pbBaseDamage(baseDmg,user,target) - if MECHANICS_GENERATION >= 6 && + if Settings::MECHANICS_GENERATION >= 6 && target.item && !target.unlosableItem?(target.item) # NOTE: Damage is still boosted even if target has Sticky Hold or a # substitute. @@ -3306,7 +3306,7 @@ end #=============================================================================== class PokeBattle_Move_0F3 < PokeBattle_Move def ignoresSubstitute?(user) - return true if MECHANICS_GENERATION >= 6 + return true if Settings::MECHANICS_GENERATION >= 6 return super end @@ -3370,7 +3370,7 @@ class PokeBattle_Move_0F5 < PokeBattle_Move def pbEffectWhenDealingDamage(user,target) return if target.damageState.substitute || target.damageState.berryWeakened return if !target.item || (!target.item.is_berry? && - !(MECHANICS_GENERATION >= 6 && target.item.is_gem?)) + !(Settings::MECHANICS_GENERATION >= 6 && target.item.is_gem?)) target.pbRemoveItem @battle.pbDisplay(_INTL("{1}'s {2} was incinerated!",target.pbThis,target.itemName)) end diff --git a/Data/Scripts/012_Battle/002_Move/007_Move_Effects_100-17F.rb b/Data/Scripts/012_Battle/002_Move/007_Move_Effects_100-17F.rb index da710cce1..d66a2b0fc 100644 --- a/Data/Scripts/012_Battle/002_Move/007_Move_Effects_100-17F.rb +++ b/Data/Scripts/012_Battle/002_Move/007_Move_Effects_100-17F.rb @@ -1445,7 +1445,7 @@ end #=============================================================================== class PokeBattle_Move_144 < PokeBattle_Move def tramplesMinimize?(param=1) - return true if param==1 && MECHANICS_GENERATION >= 6 # Perfect accuracy + return true if param==1 && Settings::MECHANICS_GENERATION >= 6 # Perfect accuracy return true if param==2 # Double damage return super end @@ -1666,7 +1666,7 @@ end # User gains 3/4 the HP it inflicts as damage. (Draining Kiss, Oblivion Wing) #=============================================================================== class PokeBattle_Move_14F < PokeBattle_Move - def healingMove?; return MECHANICS_GENERATION >= 6; end + def healingMove?; return Settings::MECHANICS_GENERATION >= 6; end def pbEffectAgainstTarget(user,target) return if target.damageState.hpLost<=0 diff --git a/Data/Scripts/012_Battle/003_Battle/001_PokeBattle_BattleCommon.rb b/Data/Scripts/012_Battle/003_Battle/001_PokeBattle_BattleCommon.rb index a676e60ca..cd4ed0c93 100644 --- a/Data/Scripts/012_Battle/003_Battle/001_PokeBattle_BattleCommon.rb +++ b/Data/Scripts/012_Battle/003_Battle/001_PokeBattle_BattleCommon.rb @@ -128,7 +128,7 @@ module PokeBattle_BattleCommon @scene.pbThrowSuccess # Play capture success jingle pbRemoveFromParty(battler.index,battler.pokemonIndex) # Gain Exp - if GAIN_EXP_FOR_CAPTURE + if Settings::GAIN_EXP_FOR_CAPTURE battler.captured = true pbGainExp battler.captured = false @@ -192,7 +192,7 @@ module PokeBattle_BattleCommon # Second half of the shakes calculation y = ( 65536 / ((255.0/x)**0.1875) ).floor # Critical capture check - if ENABLE_CRITICAL_CAPTURES + if Settings::ENABLE_CRITICAL_CAPTURES c = 0 numOwned = $Trainer.owned_count if numOwned>600; c = x*5/12 diff --git a/Data/Scripts/012_Battle/003_Battle/003_Battle_StartAndEnd.rb b/Data/Scripts/012_Battle/003_Battle/003_Battle_StartAndEnd.rb index b85b6af25..008c361c0 100644 --- a/Data/Scripts/012_Battle/003_Battle/003_Battle_StartAndEnd.rb +++ b/Data/Scripts/012_Battle/003_Battle/003_Battle_StartAndEnd.rb @@ -365,7 +365,7 @@ class PokeBattle_Battle def pbLoseMoney return if !@internalBattle || !@moneyGain - return if $game_switches[NO_MONEY_LOSS] + return if $game_switches[Settings::NO_MONEY_LOSS] maxLevel = pbMaxLevelInTeam(0,0) # Player's Pokémon only, not partner's multiplier = [8,16,24,36,48,64,80,100,120] idxMultiplier = [pbPlayer.badge_count, multiplier.length - 1].min @@ -446,7 +446,7 @@ class PokeBattle_Battle end ##### CAUGHT WILD POKÉMON ##### when 4 - @scene.pbWildBattleSuccess if !GAIN_EXP_FOR_CAPTURE + @scene.pbWildBattleSuccess if !Settings::GAIN_EXP_FOR_CAPTURE end # Register captured Pokémon in the Pokédex, and store them pbRecordAndStoreCaughtPokemon diff --git a/Data/Scripts/012_Battle/003_Battle/004_Battle_ExpAndMoveLearning.rb b/Data/Scripts/012_Battle/003_Battle/004_Battle_ExpAndMoveLearning.rb index ddc959b08..8eb08cec8 100644 --- a/Data/Scripts/012_Battle/003_Battle/004_Battle_ExpAndMoveLearning.rb +++ b/Data/Scripts/012_Battle/003_Battle/004_Battle_ExpAndMoveLearning.rb @@ -105,15 +105,15 @@ class PokeBattle_Battle a = level*defeatedBattler.pokemon.base_exp if expShare.length>0 && (isPartic || hasExpShare) if numPartic==0 # No participants, all Exp goes to Exp Share holders - exp = a/(SPLIT_EXP_BETWEEN_GAINERS ? expShare.length : 1) - elsif SPLIT_EXP_BETWEEN_GAINERS # Gain from participating and/or Exp Share + exp = a / (Settings::SPLIT_EXP_BETWEEN_GAINERS ? expShare.length : 1) + elsif Settings::SPLIT_EXP_BETWEEN_GAINERS # Gain from participating and/or Exp Share exp = a/(2*numPartic) if isPartic exp += a/(2*expShare.length) if hasExpShare else # Gain from participating and/or Exp Share (Exp not split) exp = (isPartic) ? a : a/2 end elsif isPartic # Participated in battle, no Exp Shares held by anyone - exp = a/(SPLIT_EXP_BETWEEN_GAINERS ? numPartic : 1) + exp = a / (Settings::SPLIT_EXP_BETWEEN_GAINERS ? numPartic : 1) elsif expAll # Didn't participate in battle, gaining Exp due to Exp All # NOTE: Exp All works like the Exp Share from Gen 6+, not like the Exp All # from Gen 1, i.e. Exp isn't split between all Pokémon gaining it. @@ -123,7 +123,7 @@ class PokeBattle_Battle # Pokémon gain more Exp from trainer battles exp = (exp*1.5).floor if trainerBattle? # Scale the gained Exp based on the gainer's level (or not) - if SCALED_EXP_FORMULA + if Settings::SCALED_EXP_FORMULA exp /= 5 levelAdjust = (2*level+10.0)/(pkmn.level+level+10.0) levelAdjust = levelAdjust**5 diff --git a/Data/Scripts/012_Battle/003_Battle/006_Battle_Action_Switching.rb b/Data/Scripts/012_Battle/003_Battle/006_Battle_Action_Switching.rb index 5bc2b677f..f7124396b 100644 --- a/Data/Scripts/012_Battle/003_Battle/006_Battle_Action_Switching.rb +++ b/Data/Scripts/012_Battle/003_Battle/006_Battle_Action_Switching.rb @@ -64,7 +64,7 @@ class PokeBattle_Battle end end # Other certain switching effects - return true if MORE_TYPE_EFFECTS && battler.pbHasType?(:GHOST) + return true if Settings::MORE_TYPE_EFFECTS && battler.pbHasType?(:GHOST) # Other certain trapping effects if battler.effects[PBEffects::Trapping]>0 || battler.effects[PBEffects::MeanLook]>=0 || @@ -286,7 +286,7 @@ class PokeBattle_Battle partyOrder[idxParty],partyOrder[idxPartyOld] = partyOrder[idxPartyOld],partyOrder[idxParty] # Send out the new Pokémon pbSendOut([[idxBattler,party[idxParty]]]) - pbCalculatePriority(false,[idxBattler]) if RECALCULATE_TURN_ORDER_AFTER_SPEED_CHANGES + pbCalculatePriority(false,[idxBattler]) if Settings::RECALCULATE_TURN_ORDER_AFTER_SPEED_CHANGES end # Called from def pbReplace above and at the start of battle. diff --git a/Data/Scripts/012_Battle/003_Battle/008_Battle_Action_Running.rb b/Data/Scripts/012_Battle/003_Battle/008_Battle_Action_Running.rb index 32593e2bf..815090e61 100644 --- a/Data/Scripts/012_Battle/003_Battle/008_Battle_Action_Running.rb +++ b/Data/Scripts/012_Battle/003_Battle/008_Battle_Action_Running.rb @@ -6,7 +6,7 @@ class PokeBattle_Battle return false if trainerBattle? battler = @battlers[idxBattler] return false if !@canRun && !battler.opposes? - return true if battler.pbHasType?(:GHOST) && MORE_TYPE_EFFECTS + return true if battler.pbHasType?(:GHOST) && Settings::MORE_TYPE_EFFECTS return true if battler.abilityActive? && BattleHandlers.triggerRunFromBattleAbility(battler.ability,battler) return true if battler.itemActive? && @@ -71,7 +71,7 @@ class PokeBattle_Battle return 0 end if !duringBattle - if battler.pbHasType?(:GHOST) && MORE_TYPE_EFFECTS + if battler.pbHasType?(:GHOST) && Settings::MORE_TYPE_EFFECTS pbSEPlay("Battle flee") pbDisplayPaused(_INTL("You got away safely!")) @decision = 3 diff --git a/Data/Scripts/012_Battle/003_Battle/009_Battle_Action_Other.rb b/Data/Scripts/012_Battle/003_Battle/009_Battle_Action_Other.rb index 823dd9d05..1199c030b 100644 --- a/Data/Scripts/012_Battle/003_Battle/009_Battle_Action_Other.rb +++ b/Data/Scripts/012_Battle/003_Battle/009_Battle_Action_Other.rb @@ -62,13 +62,13 @@ class PokeBattle_Battle #============================================================================= def pbHasMegaRing?(idxBattler) return true if !pbOwnedByPlayer?(idxBattler) # Assume AI trainer have a ring - MEGA_RINGS.each { |item| return true if $PokemonBag.pbHasItem?(item) } + Settings::MEGA_RINGS.each { |item| return true if $PokemonBag.pbHasItem?(item) } return false end def pbGetMegaRingName(idxBattler) if pbOwnedByPlayer?(idxBattler) - MEGA_RINGS.each do |item| + Settings::MEGA_RINGS.each do |item| return GameData::Item.get(item).name if $PokemonBag.pbHasItem?(item) end end @@ -80,7 +80,7 @@ class PokeBattle_Battle end def pbCanMegaEvolve?(idxBattler) - return false if $game_switches[NO_MEGA_EVOLUTION] + return false if $game_switches[Settings::NO_MEGA_EVOLUTION] return false if !@battlers[idxBattler].hasMega? return false if wildBattle? && opposes?(idxBattler) return true if $DEBUG && Input.press?(Input::CTRL) @@ -157,7 +157,7 @@ class PokeBattle_Battle if battler.isSpecies?(:GENGAR) && battler.mega? battler.effects[PBEffects::Telekinesis] = 0 end - pbCalculatePriority(false,[idxBattler]) if RECALCULATE_TURN_ORDER_AFTER_MEGA_EVOLUTION + pbCalculatePriority(false,[idxBattler]) if Settings::RECALCULATE_TURN_ORDER_AFTER_MEGA_EVOLUTION # Trigger ability battler.pbEffectsOnSwitchIn end diff --git a/Data/Scripts/012_Battle/003_Battle/011_Battle_Phase_Attack.rb b/Data/Scripts/012_Battle/003_Battle/011_Battle_Phase_Attack.rb index dac047a0d..5fddca45a 100644 --- a/Data/Scripts/012_Battle/003_Battle/011_Battle_Phase_Attack.rb +++ b/Data/Scripts/012_Battle/003_Battle/011_Battle_Phase_Attack.rb @@ -84,7 +84,7 @@ class PokeBattle_Battle end return if @decision > 0 end - pbCalculatePriority if RECALCULATE_TURN_ORDER_AFTER_SPEED_CHANGES + pbCalculatePriority if Settings::RECALCULATE_TURN_ORDER_AFTER_SPEED_CHANGES end def pbAttackPhaseMegaEvolution diff --git a/Data/Scripts/012_Battle/003_Battle/012_Battle_Phase_EndOfRound.rb b/Data/Scripts/012_Battle/003_Battle/012_Battle_Phase_EndOfRound.rb index ae7e29b4d..be5a3c805 100644 --- a/Data/Scripts/012_Battle/003_Battle/012_Battle_Phase_EndOfRound.rb +++ b/Data/Scripts/012_Battle/003_Battle/012_Battle_Phase_EndOfRound.rb @@ -370,7 +370,7 @@ class PokeBattle_Battle priority.each do |b| next if b.status!=PBStatuses::BURN || !b.takesIndirectDamage? oldHP = b.hp - dmg = (MECHANICS_GENERATION >= 7) ? b.totalhp/16 : b.totalhp/8 + dmg = (Settings::MECHANICS_GENERATION >= 7) ? b.totalhp/16 : b.totalhp/8 dmg = (dmg/2.0).round if b.hasActiveAbility?(:HEATPROOF) b.pbContinueStatus { b.pbReduceHP(dmg,false) } b.pbItemHPHealCheck @@ -417,9 +417,9 @@ class PokeBattle_Battle else pbCommonAnimation("Wrap", b) end if b.takesIndirectDamage? - hpLoss = (MECHANICS_GENERATION >= 6) ? b.totalhp/8 : b.totalhp/16 + hpLoss = (Settings::MECHANICS_GENERATION >= 6) ? b.totalhp/8 : b.totalhp/16 if @battlers[b.effects[PBEffects::TrappingUser]].hasActiveItem?(:BINDINGBAND) - hpLoss = (MECHANICS_GENERATION >= 6) ? b.totalhp/6 : b.totalhp/8 + hpLoss = (Settings::MECHANICS_GENERATION >= 6) ? b.totalhp/6 : b.totalhp/8 end @scene.pbDamageAnimation(b) b.pbReduceHP(hpLoss,false) diff --git a/Data/Scripts/012_Battle/004_AI/002_AI_Item.rb b/Data/Scripts/012_Battle/004_AI/002_AI_Item.rb index 2d8a9f4e3..4bbf07324 100644 --- a/Data/Scripts/012_Battle/004_AI/002_AI_Item.rb +++ b/Data/Scripts/012_Battle/004_AI/002_AI_Item.rb @@ -44,7 +44,7 @@ class PokeBattle_AI :ENERGYPOWDER => 50, :ENERGYROOT => 200 } - hpItems[:RAGECANDYBAR] = 20 if !RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS + hpItems[:RAGECANDYBAR] = 20 if !Settings::RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS fullRestoreItems = [ :FULLRESTORE ] @@ -59,37 +59,37 @@ class PokeBattle_AI :FULLHEAL, :LAVACOOKIE, :OLDGATEAU, :CASTELIACONE, :LUMIOSEGALETTE, :SHALOURSABLE, :BIGMALASADA, :LUMBERRY, :HEALPOWDER ] - allStatusItems.push(:RAGECANDYBAR) if RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS + allStatusItems.push(:RAGECANDYBAR) if Settings::RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS xItems = { - :XATTACK => [PBStats::ATTACK, (X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1], + :XATTACK => [PBStats::ATTACK, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1], :XATTACK2 => [PBStats::ATTACK, 2], :XATTACK3 => [PBStats::ATTACK, 3], :XATTACK6 => [PBStats::ATTACK, 6], - :XDEFENSE => [PBStats::DEFENSE, (X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1], + :XDEFENSE => [PBStats::DEFENSE, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1], :XDEFENSE2 => [PBStats::DEFENSE, 2], :XDEFENSE3 => [PBStats::DEFENSE, 3], :XDEFENSE6 => [PBStats::DEFENSE, 6], - :XDEFEND => [PBStats::DEFENSE, (X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1], + :XDEFEND => [PBStats::DEFENSE, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1], :XDEFEND2 => [PBStats::DEFENSE, 2], :XDEFEND3 => [PBStats::DEFENSE, 3], :XDEFEND6 => [PBStats::DEFENSE, 6], - :XSPATK => [PBStats::SPATK, (X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1], + :XSPATK => [PBStats::SPATK, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1], :XSPATK2 => [PBStats::SPATK, 2], :XSPATK3 => [PBStats::SPATK, 3], :XSPATK6 => [PBStats::SPATK, 6], - :XSPECIAL => [PBStats::SPATK, (X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1], + :XSPECIAL => [PBStats::SPATK, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1], :XSPECIAL2 => [PBStats::SPATK, 2], :XSPECIAL3 => [PBStats::SPATK, 3], :XSPECIAL6 => [PBStats::SPATK, 6], - :XSPDEF => [PBStats::SPDEF, (X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1], + :XSPDEF => [PBStats::SPDEF, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1], :XSPDEF2 => [PBStats::SPDEF, 2], :XSPDEF3 => [PBStats::SPDEF, 3], :XSPDEF6 => [PBStats::SPDEF, 6], - :XSPEED => [PBStats::SPEED, (X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1], + :XSPEED => [PBStats::SPEED, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1], :XSPEED2 => [PBStats::SPEED, 2], :XSPEED3 => [PBStats::SPEED, 3], :XSPEED6 => [PBStats::SPEED, 6], - :XACCURACY => [PBStats::ACCURACY, (X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1], + :XACCURACY => [PBStats::ACCURACY, (Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1], :XACCURACY2 => [PBStats::ACCURACY, 2], :XACCURACY3 => [PBStats::ACCURACY, 3], :XACCURACY6 => [PBStats::ACCURACY, 6] diff --git a/Data/Scripts/012_Battle/004_AI/005_AI_Move_EffectScores.rb b/Data/Scripts/012_Battle/004_AI/005_AI_Move_EffectScores.rb index da4ead3ef..e3f2b99d2 100644 --- a/Data/Scripts/012_Battle/004_AI/005_AI_Move_EffectScores.rb +++ b/Data/Scripts/012_Battle/004_AI/005_AI_Move_EffectScores.rb @@ -1514,8 +1514,8 @@ class PokeBattle_AI elsif skill>=PBTrainerAI.mediumSkill && target.lastMoveUsed moveData = GameData::Move.get(target.lastMoveUsed) if moveData.base_damage > 0 && - (MOVE_CATEGORY_PER_MOVE && moveData.category == 0) || - (!MOVE_CATEGORY_PER_MOVE && PBTypes.isPhysicalType?(moveData.type)) + (Settings::MOVE_CATEGORY_PER_MOVE && moveData.category == 0) || + (!Settings::MOVE_CATEGORY_PER_MOVE && PBTypes.isPhysicalType?(moveData.type)) score -= 60 end end @@ -1532,8 +1532,8 @@ class PokeBattle_AI elsif skill>=PBTrainerAI.mediumSkill && target.lastMoveUsed moveData = GameData::Move.get(target.lastMoveUsed) if moveData.base_damage > 0 && - (MOVE_CATEGORY_PER_MOVE && moveData.category == 1) || - (!MOVE_CATEGORY_PER_MOVE && !PBTypes.isSpecialType?(moveData.type)) + (Settings::MOVE_CATEGORY_PER_MOVE && moveData.category == 1) || + (!Settings::MOVE_CATEGORY_PER_MOVE && !PBTypes.isSpecialType?(moveData.type)) score -= 60 end end diff --git a/Data/Scripts/012_Battle/004_AI/006_AI_Move_Utilities.rb b/Data/Scripts/012_Battle/004_AI/006_AI_Move_Utilities.rb index 36b7e4b5b..0bd4b8a58 100644 --- a/Data/Scripts/012_Battle/004_AI/006_AI_Move_Utilities.rb +++ b/Data/Scripts/012_Battle/004_AI/006_AI_Move_Utilities.rb @@ -120,7 +120,7 @@ class PokeBattle_AI end return true if target.effects[PBEffects::Substitute]>0 && move.statusMove? && !move.ignoresSubstitute?(user) && user.index!=target.index - return true if MECHANICS_GENERATION >= 7 && user.hasActiveAbility?(:PRANKSTER) && + return true if Settings::MECHANICS_GENERATION >= 7 && user.hasActiveAbility?(:PRANKSTER) && target.pbHasType?(:DARK) && target.opposes?(user) return true if move.priority>0 && @battle.field.terrain==PBBattleTerrains::Psychic && target.affectedByTerrain? && target.opposes?(user) @@ -200,7 +200,7 @@ class PokeBattle_AI baseDmg = move.pbNaturalGiftBaseDamage(user.item_id) when "09B" # Heavy Slam baseDmg = move.pbBaseDamage(baseDmg,user,target) - baseDmg *= 2 if MECHANICS_GENERATION >= 7 && skill>=PBTrainerAI.mediumSkill && + baseDmg *= 2 if Settings::MECHANICS_GENERATION >= 7 && skill>=PBTrainerAI.mediumSkill && target.effects[PBEffects::Minimize] when "0A0", "0BD", "0BE" # Frost Breath, Double Kick, Twineedle baseDmg *= 2 @@ -418,9 +418,9 @@ class PokeBattle_AI # Don't need to check the Atk/Sp Atk-boosting badges because the AI # won't control the player's Pokémon. if target.pbOwnedByPlayer? - if move.physicalMove?(type) && @battle.pbPlayer.badge_count >= NUM_BADGES_BOOST_DEFENSE + if move.physicalMove?(type) && @battle.pbPlayer.badge_count >= Settings::NUM_BADGES_BOOST_DEFENSE multipliers[:defense_multiplier] *= 1.1 - elsif move.specialMove?(type) && @battle.pbPlayer.badge_count >= NUM_BADGES_BOOST_SPDEF + elsif move.specialMove?(type) && @battle.pbPlayer.badge_count >= Settings::NUM_BADGES_BOOST_SPDEF multipliers[:defense_multiplier] *= 1.1 end end @@ -474,7 +474,7 @@ class PokeBattle_AI if skill>=PBTrainerAI.highSkill if user.status==PBStatuses::BURN && move.physicalMove?(type) && !user.hasActiveAbility?(:GUTS) && - !(MECHANICS_GENERATION >= 6 && move.function == "07E") # Facade + !(Settings::MECHANICS_GENERATION >= 6 && move.function == "07E") # Facade multipliers[:final_damage_multiplier] /= 2 end end @@ -651,7 +651,7 @@ class PokeBattle_AI end if skill>=PBTrainerAI.highSkill if move.function=="006" # Toxic - modifiers[:base_accuracy] = 0 if MORE_TYPE_EFFECTS && move.statusMove? && + modifiers[:base_accuracy] = 0 if Settings::MORE_TYPE_EFFECTS && move.statusMove? && user.pbHasType?(:POISON) end if move.function=="070" # OHKO moves diff --git a/Data/Scripts/012_Battle/005_Battle scene/003_PokeBattle_SceneConstants.rb b/Data/Scripts/012_Battle/005_Battle scene/003_PokeBattle_SceneConstants.rb index 854962f7c..389a0bbea 100644 --- a/Data/Scripts/012_Battle/005_Battle scene/003_PokeBattle_SceneConstants.rb +++ b/Data/Scripts/012_Battle/005_Battle scene/003_PokeBattle_SceneConstants.rb @@ -5,15 +5,15 @@ module PokeBattle_SceneConstants MESSAGE_SHADOW_COLOR = Color.new(160, 160, 168) # The number of party balls to show in each side's lineup. - NUM_BALLS = MAX_PARTY_SIZE + NUM_BALLS = Settings::MAX_PARTY_SIZE # Centre bottom of the player's side base graphic PLAYER_BASE_X = 128 - PLAYER_BASE_Y = SCREEN_HEIGHT - 80 + PLAYER_BASE_Y = Settings::SCREEN_HEIGHT - 80 # Centre middle of the foe's side base graphic - FOE_BASE_X = SCREEN_WIDTH - 128 - FOE_BASE_Y = (SCREEN_HEIGHT * 3 / 4) - 112 + FOE_BASE_X = Settings::SCREEN_WIDTH - 128 + FOE_BASE_Y = (Settings::SCREEN_HEIGHT * 3 / 4) - 112 # Returns where the centre bottom of a battler's sprite should be, given its # index and the number of battlers on its side, assuming the battler has diff --git a/Data/Scripts/012_Battle/006_BattleHandlers.rb b/Data/Scripts/012_Battle/006_BattleHandlers.rb index 37c05cdf6..334c99033 100644 --- a/Data/Scripts/012_Battle/006_BattleHandlers.rb +++ b/Data/Scripts/012_Battle/006_BattleHandlers.rb @@ -480,12 +480,12 @@ end def pbBattleConfusionBerry(battler,battle,item,forced,flavor,confuseMsg) return false if !forced && !battler.canHeal? - return false if !forced && !battler.canConsumePinchBerry?(MECHANICS_GENERATION >= 7) + return false if !forced && !battler.canConsumePinchBerry?(Settings::MECHANICS_GENERATION >= 7) itemName = GameData::Item.get(item).name battle.pbCommonAnimation("EatBerry",battler) if !forced fraction_to_heal = 8 # Gens 6 and lower - if MECHANICS_GENERATION == 7; fraction_to_heal = 2 - elsif MECHANICS_GENERATION >= 8; fraction_to_heal = 3 + if Settings::MECHANICS_GENERATION == 7; fraction_to_heal = 2 + elsif Settings::MECHANICS_GENERATION >= 8; fraction_to_heal = 3 end amt = battler.pbRecoverHP(battler.totalhp / fraction_to_heal) if amt>0 @@ -572,7 +572,7 @@ def pbBattleGem(user,type,move,mults,moveType) return if move.is_a?(PokeBattle_PledgeMove) return if moveType != type user.effects[PBEffects::GemConsumed] = user.item_id - if MECHANICS_GENERATION >= 6 + if Settings::MECHANICS_GENERATION >= 6 mults[:base_damage_multiplier] *= 1.3 else mults[:base_damage_multiplier] *= 1.5 @@ -598,7 +598,7 @@ def pbBattleWeatherAbility(weather,battler,battle,ignorePrimal=false) battle.pbDisplay(_INTL("{1}'s {2} activated!",battler.pbThis,battler.abilityName)) end fixedDuration = false - fixedDuration = true if FIXED_DURATION_WEATHER_FROM_ABILITY && + fixedDuration = true if Settings::FIXED_DURATION_WEATHER_FROM_ABILITY && weather != PBWeather::HarshSun && weather != PBWeather::HeavyRain && weather != PBWeather::StrongWinds diff --git a/Data/Scripts/012_Battle/007_BattleHandlers_Abilities.rb b/Data/Scripts/012_Battle/007_BattleHandlers_Abilities.rb index 0f8f8e6c7..95e282903 100644 --- a/Data/Scripts/012_Battle/007_BattleHandlers_Abilities.rb +++ b/Data/Scripts/012_Battle/007_BattleHandlers_Abilities.rb @@ -308,7 +308,7 @@ BattleHandlers::StatusCureAbility.add(:MAGMAARMOR, BattleHandlers::StatusCureAbility.add(:OBLIVIOUS, proc { |ability,battler| next if battler.effects[PBEffects::Attract]<0 && - (battler.effects[PBEffects::Taunt]==0 || MECHANICS_GENERATION <= 5) + (battler.effects[PBEffects::Taunt]==0 || Settings::MECHANICS_GENERATION <= 5) battler.battle.pbShowAbilitySplash(battler) if battler.effects[PBEffects::Attract]>=0 battler.pbCureAttract @@ -319,7 +319,7 @@ BattleHandlers::StatusCureAbility.add(:OBLIVIOUS, battler.pbThis,battler.abilityName)) end end - if battler.effects[PBEffects::Taunt]>0 && MECHANICS_GENERATION >= 6 + if battler.effects[PBEffects::Taunt]>0 && Settings::MECHANICS_GENERATION >= 6 battler.effects[PBEffects::Taunt] = 0 if PokeBattle_SceneConstants::USE_ABILITY_SPLASH battler.battle.pbDisplay(_INTL("{1}'s Taunt wore off!",battler.pbThis)) @@ -741,7 +741,7 @@ BattleHandlers::MoveBaseTypeModifierAbility.add(:LIQUIDVOICE, BattleHandlers::MoveBaseTypeModifierAbility.add(:NORMALIZE, proc { |ability,user,move,type| next if !GameData::Type.exists?(:NORMAL) - move.powerBoost = true if MECHANICS_GENERATION >= 7 + move.powerBoost = true if Settings::MECHANICS_GENERATION >= 7 next :NORMAL } ) @@ -780,7 +780,7 @@ BattleHandlers::AccuracyCalcUserAbility.add(:HUSTLE, BattleHandlers::AccuracyCalcUserAbility.add(:KEENEYE, proc { |ability,mods,user,target,move,type| - mods[:evasion_stage] = 0 if mods[:evasion_stage] > 0 && MECHANICS_GENERATION >= 6 + mods[:evasion_stage] = 0 if mods[:evasion_stage] > 0 && Settings::MECHANICS_GENERATION >= 6 } ) @@ -1606,7 +1606,7 @@ BattleHandlers::TargetAbilityOnHit.add(:WEAKARMOR, battle.pbShowAbilitySplash(target) target.pbLowerStatStageByAbility(PBStats::DEFENSE, 1, target, false) target.pbRaiseStatStageByAbility(PBStats::SPEED, - (MECHANICS_GENERATION >= 7) ? 2 : 1, target, false) + (Settings::MECHANICS_GENERATION >= 7) ? 2 : 1, target, false) battle.pbHideAbilitySplash(target) } ) @@ -2089,7 +2089,7 @@ BattleHandlers::AbilityOnSwitchIn.add(:ANTICIPATION, next if m.statusMove? if type1 moveType = m.type - if MECHANICS_GENERATION >= 6 && m.function == "090" # Hidden Power + if Settings::MECHANICS_GENERATION >= 6 && m.function == "090" # Hidden Power moveType = pbHiddenPower(b.pokemon)[0] end eff = PBTypes.getCombinedEffectiveness(moveType,type1,type2,type3) @@ -2236,7 +2236,7 @@ BattleHandlers::AbilityOnSwitchIn.add(:FRISK, end if foes.length>0 battle.pbShowAbilitySplash(battler) - if MECHANICS_GENERATION >= 6 + if Settings::MECHANICS_GENERATION >= 6 foes.each do |b| battle.pbDisplay(_INTL("{1} frisked {2} and found its {3}!", battler.pbThis,b.pbThis(true),b.itemName)) diff --git a/Data/Scripts/012_Battle/008_BattleHandlers_Items.rb b/Data/Scripts/012_Battle/008_BattleHandlers_Items.rb index e448bca13..d4e092bd5 100644 --- a/Data/Scripts/012_Battle/008_BattleHandlers_Items.rb +++ b/Data/Scripts/012_Battle/008_BattleHandlers_Items.rb @@ -746,7 +746,7 @@ BattleHandlers::DamageCalcUserItem.copy(:SOFTSAND,:EARTHPLATE) BattleHandlers::DamageCalcUserItem.add(:SOULDEW, proc { |item,user,target,move,mults,baseDmg,type| next if !user.isSpecies?(:LATIAS) && !user.isSpecies?(:LATIOS) - if SOUL_DEW_POWERS_UP_TYPES + if Settings::SOUL_DEW_POWERS_UP_TYPES mults[:final_damage_multiplier] *= 1.2 if type == :PSYCHIC || type == :DRAGON else if move.specialMove? && !user.battle.rules["souldewclause"] @@ -932,7 +932,7 @@ BattleHandlers::DamageCalcTargetItem.add(:SHUCABERRY, BattleHandlers::DamageCalcTargetItem.add(:SOULDEW, proc { |item,user,target,move,mults,baseDmg,type| - next if SOUL_DEW_POWERS_UP_TYPES + next if Settings::SOUL_DEW_POWERS_UP_TYPES next if !target.isSpecies?(:LATIAS) && !target.isSpecies?(:LATIOS) if move.specialMove? && !user.battle.rules["souldewclause"] mults[:defense_multiplier] *= 1.5 diff --git a/Data/Scripts/012_Battle/009_PokeBall_CatchEffects.rb b/Data/Scripts/012_Battle/009_PokeBall_CatchEffects.rb index c4449862f..cc0504d46 100644 --- a/Data/Scripts/012_Battle/009_PokeBall_CatchEffects.rb +++ b/Data/Scripts/012_Battle/009_PokeBall_CatchEffects.rb @@ -101,7 +101,7 @@ BallHandlers::ModifyCatchRate.add(:SAFARIBALL,proc { |ball,catchRate,battle,batt }) BallHandlers::ModifyCatchRate.add(:NETBALL,proc { |ball,catchRate,battle,battler,ultraBeast| - multiplier = (NEW_POKE_BALL_CATCH_RATES) ? 3.5 : 3 + multiplier = (Settings::NEW_POKE_BALL_CATCH_RATES) ? 3.5 : 3 catchRate *= multiplier if battler.pbHasType?(:BUG) || battler.pbHasType?(:WATER) next catchRate }) @@ -119,7 +119,7 @@ BallHandlers::ModifyCatchRate.add(:NESTBALL,proc { |ball,catchRate,battle,battle }) BallHandlers::ModifyCatchRate.add(:REPEATBALL,proc { |ball,catchRate,battle,battler,ultraBeast| - multiplier = (NEW_POKE_BALL_CATCH_RATES) ? 3.5 : 3 + multiplier = (Settings::NEW_POKE_BALL_CATCH_RATES) ? 3.5 : 3 catchRate *= multiplier if battle.pbPlayer.owned?(battler.species) next catchRate }) @@ -131,7 +131,7 @@ BallHandlers::ModifyCatchRate.add(:TIMERBALL,proc { |ball,catchRate,battle,battl }) BallHandlers::ModifyCatchRate.add(:DUSKBALL,proc { |ball,catchRate,battle,battler,ultraBeast| - multiplier = (NEW_POKE_BALL_CATCH_RATES) ? 3 : 3.5 + multiplier = (Settings::NEW_POKE_BALL_CATCH_RATES) ? 3 : 3.5 catchRate *= multiplier if battle.time==2 next catchRate }) @@ -161,7 +161,7 @@ BallHandlers::ModifyCatchRate.add(:LEVELBALL,proc { |ball,catchRate,battle,battl }) BallHandlers::ModifyCatchRate.add(:LUREBALL,proc { |ball,catchRate,battle,battler,ultraBeast| - multiplier = (NEW_POKE_BALL_CATCH_RATES) ? 5 : 3 + multiplier = (Settings::NEW_POKE_BALL_CATCH_RATES) ? 5 : 3 catchRate *= multiplier if $PokemonTemp.encounterType==EncounterTypes::OldRod || $PokemonTemp.encounterType==EncounterTypes::GoodRod || $PokemonTemp.encounterType==EncounterTypes::SuperRod @@ -171,7 +171,7 @@ BallHandlers::ModifyCatchRate.add(:LUREBALL,proc { |ball,catchRate,battle,battle BallHandlers::ModifyCatchRate.add(:HEAVYBALL,proc { |ball,catchRate,battle,battler,ultraBeast| next 0 if catchRate==0 weight = battler.pbWeight - if NEW_POKE_BALL_CATCH_RATES + if Settings::NEW_POKE_BALL_CATCH_RATES if weight>=3000; catchRate += 30 elsif weight>=2000; catchRate += 20 elsif weight<1000; catchRate -= 20 diff --git a/Data/Scripts/013_Overworld/002_PField_Field.rb b/Data/Scripts/013_Overworld/002_PField_Field.rb index 084ad9f5b..0400c7402 100644 --- a/Data/Scripts/013_Overworld/002_PField_Field.rb +++ b/Data/Scripts/013_Overworld/002_PField_Field.rb @@ -193,7 +193,7 @@ Events.onMapUpdate += proc { |_sender,_e| # Returns whether the Poké Center should explain Pokérus to the player, if a # healed Pokémon has it. def pbPokerus? - return false if $game_switches[SEEN_POKERUS_SWITCH] + return false if $game_switches[Settings::SEEN_POKERUS_SWITCH] for i in $Trainer.party return true if i.pokerusStage==1 end @@ -274,7 +274,7 @@ Events.onStepTaken += proc { Events.onStepTakenTransferPossible += proc { |_sender,e| handled = e[0] next if handled[0] - if $PokemonGlobal.stepcount%4==0 && POISON_IN_FIELD + if $PokemonGlobal.stepcount%4==0 && Settings::POISON_IN_FIELD flashed = false for i in $Trainer.able_party if i.status==PBStatuses::POISON && !i.hasAbility?(:IMMUNITY) @@ -282,8 +282,8 @@ Events.onStepTakenTransferPossible += proc { |_sender,e| $game_screen.start_flash(Color.new(255,0,0,128), 4) flashed = true end - i.hp -= 1 if i.hp>1 || POISON_FAINT_IN_FIELD - if i.hp==1 && !POISON_FAINT_IN_FIELD + i.hp -= 1 if i.hp>1 || Settings::POISON_FAINT_IN_FIELD + if i.hp==1 && !Settings::POISON_FAINT_IN_FIELD i.status = PBStatuses::NONE pbMessage(_INTL("{1} survived the poisoning.\\nThe poison faded away!\1",i.name)) next @@ -341,7 +341,7 @@ Events.onStepTakenFieldMovement += proc { |_sender,e| if $scene.is_a?(Scene_Map) currentTag = pbGetTerrainTag(event) if PBTerrain.isJustGrass?(pbGetTerrainTag(event,true)) # Won't show if under bridge - $scene.spriteset.addUserAnimation(GRASS_ANIMATION_ID,event.x,event.y,true,1) + $scene.spriteset.addUserAnimation(Settings::GRASS_ANIMATION_ID,event.x,event.y,true,1) elsif event==$game_player if currentTag==PBTerrain::WaterfallCrest # Descend waterfall, but only if this event is the player @@ -470,9 +470,11 @@ Events.onMapSceneChange += proc { |_sender, e| if mapChanged && map_metadata && map_metadata.announce_location nosignpost = false if $PokemonGlobal.mapTrail[1] - for i in 0...NO_SIGNPOSTS.length / 2 - nosignpost = true if NO_SIGNPOSTS[2 * i] == $PokemonGlobal.mapTrail[1] && NO_SIGNPOSTS[2 * i + 1] == $game_map.map_id - nosignpost = true if NO_SIGNPOSTS[2 * i + 1] == $PokemonGlobal.mapTrail[1] && NO_SIGNPOSTS[2 * i] == $game_map.map_id + for i in 0...Settings::NO_SIGNPOSTS.length / 2 + nosignpost = true if Settings::NO_SIGNPOSTS[2 * i] == $PokemonGlobal.mapTrail[1] && + Settings::NO_SIGNPOSTS[2 * i + 1] == $game_map.map_id + nosignpost = true if Settings::NO_SIGNPOSTS[2 * i + 1] == $PokemonGlobal.mapTrail[1] && + Settings::NO_SIGNPOSTS[2 * i] == $game_map.map_id break if nosignpost end mapinfos = load_data("Data/MapInfos.rxdata") @@ -769,7 +771,7 @@ end def pbLedge(_xOffset,_yOffset) if PBTerrain.isLedge?(pbFacingTerrainTag) if pbJumpToward(2,true) - $scene.spriteset.addUserAnimation(DUST_ANIMATION_ID,$game_player.x,$game_player.y,true,1) + $scene.spriteset.addUserAnimation(Settings::DUST_ANIMATION_ID,$game_player.x,$game_player.y,true,1) $game_player.increase_steps $game_player.check_event_trigger_here([1,2]) end @@ -868,7 +870,7 @@ end #=============================================================================== def pbFishingBegin $PokemonGlobal.fishing = true - if !pbCommonEvent(FISHING_BEGIN_COMMON_EVENT) + if !pbCommonEvent(Settings::FISHING_BEGIN_COMMON_EVENT) patternb = 2*$game_player.direction - 1 meta = GameData::Metadata.get_player($PokemonGlobal.playerID) num = ($PokemonGlobal.surfing) ? 7 : 6 @@ -887,7 +889,7 @@ def pbFishingBegin end def pbFishingEnd - if !pbCommonEvent(FISHING_END_COMMON_EVENT) + if !pbCommonEvent(Settings::FISHING_END_COMMON_EVENT) patternb = 2*($game_player.direction - 2) meta = GameData::Metadata.get_player($PokemonGlobal.playerID) num = ($PokemonGlobal.surfing) ? 7 : 6 @@ -927,7 +929,7 @@ def pbFishing(hasEncounter,rodType=1) break end if hasEncounter && rand(100)frames + break if !Settings::FISHING_AUTO_HOOK && numFrame > frames numFrame += 1 end return false diff --git a/Data/Scripts/013_Overworld/003_PField_Visuals.rb b/Data/Scripts/013_Overworld/003_PField_Visuals.rb index 265e1c516..90e9865d9 100644 --- a/Data/Scripts/013_Overworld/003_PField_Visuals.rb +++ b/Data/Scripts/013_Overworld/003_PField_Visuals.rb @@ -640,7 +640,7 @@ def pbStartOver(gameover=false) end pbCancelVehicles pbRemoveDependencies - $game_switches[STARTING_OVER_SWITCH] = true + $game_switches[Settings::STARTING_OVER_SWITCH] = true $game_temp.player_new_map_id = $PokemonGlobal.pokecenterMapId $game_temp.player_new_x = $PokemonGlobal.pokecenterX $game_temp.player_new_y = $PokemonGlobal.pokecenterY @@ -664,7 +664,7 @@ def pbStartOver(gameover=false) if homedata pbCancelVehicles pbRemoveDependencies - $game_switches[STARTING_OVER_SWITCH] = true + $game_switches[Settings::STARTING_OVER_SWITCH] = true $game_temp.player_new_map_id = homedata[0] $game_temp.player_new_x = homedata[1] $game_temp.player_new_y = homedata[2] diff --git a/Data/Scripts/013_Overworld/006_PField_Battles.rb b/Data/Scripts/013_Overworld/006_PField_Battles.rb index a87b2d64a..c210240ce 100644 --- a/Data/Scripts/013_Overworld/006_PField_Battles.rb +++ b/Data/Scripts/013_Overworld/006_PField_Battles.rb @@ -161,7 +161,7 @@ def pbPrepareBattle(battle) if GameData::MapMetadata.exists?($game_map.map_id) && GameData::MapMetadata.get($game_map.map_id).battle_environment == PBEnvironment::Cave battle.time = 2 # This makes Dusk Balls work properly in caves - elsif TIME_SHADING + elsif Settings::TIME_SHADING timeNow = pbGetTimeNow if PBDayNight.isNight?(timeNow); battle.time = 2 elsif PBDayNight.isEvening?(timeNow); battle.time = 1 @@ -487,7 +487,7 @@ def pbTrainerBattle(trainerID, trainerName, endSpeech=nil, # If there is exactly 1 other triggered trainer event, and this trainer has # 6 or fewer Pokémon, record this trainer for a double battle caused by the # other triggered trainer event - if otherEvent.length == 1 && trainer.party.length <= MAX_PARTY_SIZE + if otherEvent.length == 1 && trainer.party.length <= Settings::MAX_PARTY_SIZE trainer.lose_text = endSpeech if endSpeech && !endSpeech.empty? $PokemonTemp.waitingTrainer = [trainer, thisEvent.id] return false @@ -579,7 +579,7 @@ end Events.onEndBattle += proc { |_sender,e| decision = e[0] canLose = e[1] - if CHECK_EVOLUTION_AFTER_ALL_BATTLES || (decision!=2 && decision!=5) # not a loss or a draw + if Settings::CHECK_EVOLUTION_AFTER_ALL_BATTLES || (decision!=2 && decision!=5) # not a loss or a draw if $PokemonTemp.evolutionLevels pbEvolutionCheck($PokemonTemp.evolutionLevels) $PokemonTemp.evolutionLevels = nil @@ -603,7 +603,7 @@ Events.onEndBattle += proc { |_sender,e| def pbEvolutionCheck(currentLevels) for i in 0...currentLevels.length pkmn = $Trainer.party[i] - next if !pkmn || (pkmn.hp==0 && !CHECK_EVOLUTION_FOR_FAINTED_POKEMON) + next if !pkmn || (pkmn.hp==0 && !Settings::CHECK_EVOLUTION_FOR_FAINTED_POKEMON) next if currentLevels[i] && pkmn.level==currentLevels[i] newSpecies = pbCheckEvolution(pkmn) next if !newSpecies diff --git a/Data/Scripts/013_Overworld/007_PField_Encounters.rb b/Data/Scripts/013_Overworld/007_PField_Encounters.rb index 5eeb8198d..7d25944b1 100644 --- a/Data/Scripts/013_Overworld/007_PField_Encounters.rb +++ b/Data/Scripts/013_Overworld/007_PField_Encounters.rb @@ -216,7 +216,7 @@ class PokemonEncounters # with modifiers applied, divided by 180. encount = @step_chances[enc_type].to_f encount *= 0.8 if $PokemonGlobal.bicycle - if !FLUTES_CHANGE_WILD_ENCOUNTER_LEVELS + if !Settings::FLUTES_CHANGE_WILD_ENCOUNTER_LEVELS encount /= 2 if $PokemonMap.blackFluteUsed encount *= 1.5 if $PokemonMap.whiteFluteUsed end @@ -253,7 +253,7 @@ class PokemonEncounters return false if !enc_data # Repel if !ignore_repel && $PokemonGlobal.repel > 0 && !pbPokeRadarOnShakingGrass - first_pkmn = (REPEL_COUNTS_FAINTED_POKEMON) ? $Trainer.first_pokemon : $Trainer.first_able_pokemon + first_pkmn = (Settings::REPEL_COUNTS_FAINTED_POKEMON) ? $Trainer.first_pokemon : $Trainer.first_able_pokemon return false if first_pkmn && enc_data[1] < first_pkmn.level end # Some abilities make wild encounters less likely if the wild Pokémon is @@ -391,7 +391,7 @@ class PokemonEncounters break end # Get the chosen species and level - level = rand(encounter[2], encounter[3]) + level = rand(encounter[2]..encounter[3]) # Some abilities alter the level of the wild Pokémon if first_pkmn case first_pkmn.ability_id @@ -400,11 +400,11 @@ class PokemonEncounters end end # Black Flute and White Flute alter the level of the wild Pokémon - if FLUTES_CHANGE_WILD_ENCOUNTER_LEVELS + if Settings::FLUTES_CHANGE_WILD_ENCOUNTER_LEVELS if $PokemonMap.blackFluteUsed - level = [level + rand(1, 4), PBExperience.maxLevel].min + level = [level + rand(1..4), PBExperience.maxLevel].min elsif $PokemonMap.whiteFluteUsed - level = [level - rand(1, 4), 1].max + level = [level - rand(1..4), 1].max end end # Return [species, level] @@ -441,7 +441,7 @@ class PokemonEncounters break end # Return [species, level] - level = rand(encounter[2], encounter[3]) + level = rand(encounter[2]..encounter[3]) return [encounter[1], level] end end @@ -477,9 +477,7 @@ def pbGenerateWildPokemon(species,level,isRoamer=false) end end # Give Pokérus - if rand(65536)0 && !$game_switches[roamData[2]] # Game Switch is off return if !GameData::Species.exists?(roamData[0]) # Get hash of area patrolled by the roaming Pokémon @@ -151,7 +151,7 @@ EncounterModifier.register(proc { |encounter| currentRegion = pbGetCurrentRegion currentMapName = pbGetMessage(MessageTypes::MapNames, $game_map.map_id) possible_roamers = [] - ROAMING_SPECIES.each_with_index do |data, i| + Settings::ROAMING_SPECIES.each_with_index do |data, i| # data = [species, level, Game Switch, roamer method, battle BGM, area maps hash] next if !GameData::Species.exists?(data[0]) next if data[2] > 0 && !$game_switches[data[2]] # Isn't roaming diff --git a/Data/Scripts/013_Overworld/010_PField_RandomDungeons.rb b/Data/Scripts/013_Overworld/010_PField_RandomDungeons.rb index 3e3f3168a..1860a0893 100644 --- a/Data/Scripts/013_Overworld/010_PField_RandomDungeons.rb +++ b/Data/Scripts/013_Overworld/010_PField_RandomDungeons.rb @@ -85,8 +85,8 @@ module DungeonMaze paintTile(dungeon, xDst, yDst, tile, rotation) return false if rand(100) < 30 # Generate a randomly placed room - width = rand(MINWIDTH, MAXWIDTH) - height = rand(MINHEIGHT, MAXHEIGHT) + width = rand(MINWIDTH..MAXWIDTH) + height = rand(MINHEIGHT..MAXHEIGHT) return false if width <= 0 || height <= 0 centerX = TILE_WIDTH / 2 + rand(5) - 2 centerY = TILE_HEIGHT / 2 + rand(5) - 2 diff --git a/Data/Scripts/013_Overworld/011_PField_FieldMoves.rb b/Data/Scripts/013_Overworld/011_PField_FieldMoves.rb index 9d2a46294..3a49e0ffd 100644 --- a/Data/Scripts/013_Overworld/011_PField_FieldMoves.rb +++ b/Data/Scripts/013_Overworld/011_PField_FieldMoves.rb @@ -55,7 +55,7 @@ end def pbCheckHiddenMoveBadge(badge=-1,showmsg=true) return true if badge<0 # No badge requirement return true if $DEBUG - if (FIELD_MOVES_COUNT_BADGES) ? $Trainer.badge_count >= badge : $Trainer.badges[badge] + if (Settings::FIELD_MOVES_COUNT_BADGES) ? $Trainer.badge_count >= badge : $Trainer.badges[badge] return true end pbMessage(_INTL("Sorry, a new Badge is required.")) if showmsg @@ -188,7 +188,7 @@ end def pbCut move = :CUT movefinder = $Trainer.get_pokemon_with_move(move) - if !pbCheckHiddenMoveBadge(BADGE_FOR_CUT,false) || (!$DEBUG && !movefinder) + if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_CUT,false) || (!$DEBUG && !movefinder) pbMessage(_INTL("This tree looks like it can be cut down.")) return false end @@ -203,7 +203,7 @@ def pbCut end HiddenMoveHandlers::CanUseMove.add(:CUT,proc { |move,pkmn,showmsg| - next false if !pbCheckHiddenMoveBadge(BADGE_FOR_CUT,showmsg) + next false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_CUT,showmsg) facingEvent = $game_player.pbFacingEvent if !facingEvent || facingEvent.name.downcase!="tree" pbMessage(_INTL("Can't use that here.")) if showmsg @@ -298,7 +298,7 @@ def pbDive return false if !map_metadata || !map_metadata.dive_map_id move = :DIVE movefinder = $Trainer.get_pokemon_with_move(move) - if !pbCheckHiddenMoveBadge(BADGE_FOR_DIVE,false) || (!$DEBUG && !movefinder) + if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_DIVE,false) || (!$DEBUG && !movefinder) pbMessage(_INTL("The sea is deep here. A Pokémon may be able to go underwater.")) return false end @@ -334,7 +334,7 @@ def pbSurfacing return if !surface_map_id move = :DIVE movefinder = $Trainer.get_pokemon_with_move(move) - if !pbCheckHiddenMoveBadge(BADGE_FOR_DIVE,false) || (!$DEBUG && !movefinder) + if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_DIVE,false) || (!$DEBUG && !movefinder) pbMessage(_INTL("Light is filtering down from above. A Pokémon may be able to surface here.")) return false end @@ -390,7 +390,7 @@ Events.onAction += proc { |_sender, _e| } HiddenMoveHandlers::CanUseMove.add(:DIVE,proc { |move,pkmn,showmsg| - next false if !pbCheckHiddenMoveBadge(BADGE_FOR_DIVE,showmsg) + next false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_DIVE,showmsg) if $PokemonGlobal.diving surface_map_id = nil GameData::MapMetadata.each do |map_data| @@ -455,7 +455,7 @@ HiddenMoveHandlers::UseMove.add(:DIVE,proc { |move,pokemon| # Flash #=============================================================================== HiddenMoveHandlers::CanUseMove.add(:FLASH,proc { |move,pkmn,showmsg| - next false if !pbCheckHiddenMoveBadge(BADGE_FOR_FLASH,showmsg) + next false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_FLASH,showmsg) if !GameData::MapMetadata.exists?($game_map.map_id) || !GameData::MapMetadata.get($game_map.map_id).dark_map pbMessage(_INTL("Can't use that here.")) if showmsg @@ -492,7 +492,7 @@ HiddenMoveHandlers::UseMove.add(:FLASH,proc { |move,pokemon| # Fly #=============================================================================== HiddenMoveHandlers::CanUseMove.add(:FLY,proc { |move,pkmn,showmsg| - next false if !pbCheckHiddenMoveBadge(BADGE_FOR_FLY,showmsg) + next false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_FLY,showmsg) if $game_player.pbHasDependentEvents? pbMessage(_INTL("It can't be used when you have someone with you.")) if showmsg next false @@ -600,7 +600,7 @@ end def pbRockSmash move = :ROCKSMASH movefinder = $Trainer.get_pokemon_with_move(move) - if !pbCheckHiddenMoveBadge(BADGE_FOR_ROCKSMASH,false) || (!$DEBUG && !movefinder) + if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_ROCKSMASH,false) || (!$DEBUG && !movefinder) pbMessage(_INTL("It's a rugged rock, but a Pokémon may be able to smash it.")) return false end @@ -614,7 +614,7 @@ def pbRockSmash end HiddenMoveHandlers::CanUseMove.add(:ROCKSMASH,proc { |move,pkmn,showmsg| - next false if !pbCheckHiddenMoveBadge(BADGE_FOR_ROCKSMASH,showmsg) + next false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_ROCKSMASH,showmsg) facingEvent = $game_player.pbFacingEvent if !facingEvent || facingEvent.name.downcase!="rock" pbMessage(_INTL("Can't use that here.")) if showmsg @@ -647,7 +647,7 @@ def pbStrength end move = :STRENGTH movefinder = $Trainer.get_pokemon_with_move(move) - if !pbCheckHiddenMoveBadge(BADGE_FOR_STRENGTH,false) || (!$DEBUG && !movefinder) + if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_STRENGTH,false) || (!$DEBUG && !movefinder) pbMessage(_INTL("It's a big boulder, but a Pokémon may be able to push it aside.")) return false end @@ -669,7 +669,7 @@ Events.onAction += proc { |_sender,_e| } HiddenMoveHandlers::CanUseMove.add(:STRENGTH,proc { |move,pkmn,showmsg| - next false if !pbCheckHiddenMoveBadge(BADGE_FOR_STRENGTH,showmsg) + next false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_STRENGTH,showmsg) if $PokemonMap.strengthUsed pbMessage(_INTL("Strength is already being used.")) if showmsg next false @@ -696,7 +696,7 @@ def pbSurf return false if $game_player.pbHasDependentEvents? move = :SURF movefinder = $Trainer.get_pokemon_with_move(move) - if !pbCheckHiddenMoveBadge(BADGE_FOR_SURF,false) || (!$DEBUG && !movefinder) + if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_SURF,false) || (!$DEBUG && !movefinder) return false end if pbConfirmMessage(_INTL("The water is a deep blue...\nWould you like to surf on it?")) @@ -765,7 +765,7 @@ Events.onAction += proc { |_sender,_e| } HiddenMoveHandlers::CanUseMove.add(:SURF,proc { |move,pkmn,showmsg| - next false if !pbCheckHiddenMoveBadge(BADGE_FOR_SURF,showmsg) + next false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_SURF,showmsg) if $PokemonGlobal.surfing pbMessage(_INTL("You're already surfing.")) if showmsg next false @@ -948,7 +948,7 @@ end def pbWaterfall move = :WATERFALL movefinder = $Trainer.get_pokemon_with_move(move) - if !pbCheckHiddenMoveBadge(BADGE_FOR_WATERFALL,false) || (!$DEBUG && !movefinder) + if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_WATERFALL,false) || (!$DEBUG && !movefinder) pbMessage(_INTL("A wall of water is crashing down with a mighty roar.")) return false end @@ -972,7 +972,7 @@ Events.onAction += proc { |_sender,_e| } HiddenMoveHandlers::CanUseMove.add(:WATERFALL,proc { |move,pkmn,showmsg| - next false if !pbCheckHiddenMoveBadge(BADGE_FOR_WATERFALL,showmsg) + next false if !pbCheckHiddenMoveBadge(Settings::BADGE_FOR_WATERFALL,showmsg) if pbFacingTerrainTag!=PBTerrain::Waterfall pbMessage(_INTL("Can't use that here.")) if showmsg next false diff --git a/Data/Scripts/013_Overworld/012_PField_BerryPlants.rb b/Data/Scripts/013_Overworld/012_PField_BerryPlants.rb index 44c465b4c..fc32248f4 100644 --- a/Data/Scripts/013_Overworld/012_PField_BerryPlants.rb +++ b/Data/Scripts/013_Overworld/012_PField_BerryPlants.rb @@ -266,7 +266,7 @@ class BerryPlantSprite @event.character_name="Object ball" end if @oldstage!=berryData[0] && berryData.length>6 # Gen 4 growth mechanisms - $scene.spriteset.addUserAnimation(PLANT_SPARKLE_ANIMATION_ID,@event.x,@event.y,false,1) if $scene.spriteset + $scene.spriteset.addUserAnimation(Settings::PLANT_SPARKLE_ANIMATION_ID,@event.x,@event.y,false,1) if $scene.spriteset end end @oldstage=berryData[0] @@ -280,7 +280,7 @@ def pbBerryPlant thisEvent=interp.get_character(0) berryData=interp.getVariable if !berryData - if NEW_BERRY_PLANTS + if Settings::NEW_BERRY_PLANTS berryData=[0,nil,0,0,0,0,0,0] else berryData=[0,nil,false,0,0,0] @@ -298,7 +298,7 @@ def pbBerryPlant berry=berryData[1] case berryData[0] when 0 # empty - if NEW_BERRY_PLANTS + if Settings::NEW_BERRY_PLANTS # Gen 4 planting mechanics if !berryData[7] || berryData[7]==0 # No mulch used yet cmd=pbMessage(_INTL("It's soft, earthy soil."),[ @@ -421,7 +421,7 @@ def pbBerryPlant when 3 # X taller pbMessage(_INTL("The {1} plant is growing bigger.",GameData::Item.get(berry).name)) when 4 # X flowering - if NEW_BERRY_PLANTS + if Settings::NEW_BERRY_PLANTS pbMessage(_INTL("This {1} plant is in bloom!",GameData::Item.get(berry).name)) else case berryData[4] @@ -475,7 +475,7 @@ def pbBerryPlant end pbMessage(_INTL("{1} put the \\c[1]{2}\\c[0] in the \\c[1]{4}\\c[0] Pocket.\1", $Trainer.name,itemname,pocket,PokemonBag.pocketNames()[pocket])) - if NEW_BERRY_PLANTS + if Settings::NEW_BERRY_PLANTS pbMessage(_INTL("The soil returned to its soft and earthy state.")) berryData=[0,nil,0,0,0,0,0,0] else @@ -502,7 +502,7 @@ def pbBerryPlant end interp.setVariable(berryData) pbMessage(_INTL("{1} watered the plant.\\wtnp[40]",$Trainer.name)) - if NEW_BERRY_PLANTS + if Settings::NEW_BERRY_PLANTS pbMessage(_INTL("There! All happy!")) else pbMessage(_INTL("The plant seemed to be delighted.")) @@ -538,7 +538,7 @@ def pbPickBerry(berry, qty = 1) pocket = berry.pocket pbMessage(_INTL("{1} put the \\c[1]{2}\\c[0] in the \\c[1]{4}\\c[0] Pocket.\1", $Trainer.name,itemname,pocket,PokemonBag.pocketNames()[pocket])) - if NEW_BERRY_PLANTS + if Settings::NEW_BERRY_PLANTS pbMessage(_INTL("The soil returned to its soft and earthy state.")) berryData=[0,nil,0,0,0,0,0,0] else diff --git a/Data/Scripts/013_Overworld/013_PField_DayCare.rb b/Data/Scripts/013_Overworld/013_PField_DayCare.rb index c9a6ffdf3..3a2faab37 100644 --- a/Data/Scripts/013_Overworld/013_PField_DayCare.rb +++ b/Data/Scripts/013_Overworld/013_PField_DayCare.rb @@ -186,7 +186,7 @@ def pbDayCareGenerateEgg end end # Generate egg - egg = Pokemon.new(babyspecies,EGG_LEVEL) + egg = Pokemon.new(babyspecies, Settings::EGG_LEVEL) # Randomise personal ID pid = rand(65536) pid |= (rand(65536)<<16) @@ -217,7 +217,7 @@ def pbDayCareGenerateEgg # Initial Moves initialmoves = egg.getMoveList for k in initialmoves - if k[0]<=EGG_LEVEL + if k[0] <= Settings::EGG_LEVEL moves.push(k[1]) elsif mother.hasMove?(k[1]) && father.hasMove?(k[1]) othermoves.push(k[1]) @@ -228,7 +228,7 @@ def pbDayCareGenerateEgg moves.push(move) end # Inheriting Machine Moves - if BREEDING_CAN_INHERIT_MACHINE_MOVES + if Settings::BREEDING_CAN_INHERIT_MACHINE_MOVES GameData::Item.each do |i| atk = i.move next if !atk @@ -242,7 +242,7 @@ def pbDayCareGenerateEgg if movefather.male? babyEggMoves.each { |m| moves.push(m) if movefather.hasMove?(m) } end - if BREEDING_CAN_INHERIT_EGG_MOVES_FROM_MOTHER + if Settings::BREEDING_CAN_INHERIT_EGG_MOVES_FROM_MOTHER babyEggMoves.each { |m| moves.push(m) if movemother.hasMove?(m) } end # Volt Tackle @@ -361,7 +361,7 @@ def pbDayCareGenerateEgg egg.obtain_text = _INTL("Day-Care Couple") egg.name = _INTL("Egg") egg.steps_to_hatch = egg.species_data.hatch_steps - egg.givePokerus if rand(65536)=Graphics.frame_rate*30 getToneInternal @@ -117,7 +117,7 @@ end def pbDayNightTint(object) return if !$scene.is_a?(Scene_Map) - if TIME_SHADING && GameData::MapMetadata.exists?($game_map.map_id) && + if Settings::TIME_SHADING && GameData::MapMetadata.exists?($game_map.map_id) && GameData::MapMetadata.get($game_map.map_id).outdoor_map tone = PBDayNight.getTone object.tone.set(tone.red,tone.green,tone.blue,tone.gray) diff --git a/Data/Scripts/014_Trainers/001_Trainer.rb b/Data/Scripts/014_Trainers/001_Trainer.rb index 794a9feb9..a56128b34 100644 --- a/Data/Scripts/014_Trainers/001_Trainer.rb +++ b/Data/Scripts/014_Trainers/001_Trainer.rb @@ -77,7 +77,7 @@ class Trainer end def party_full? - return party_count >= MAX_PARTY_SIZE + return party_count >= Settings::MAX_PARTY_SIZE end # Returns true if there are no usable Pokémon in the player's party. @@ -211,7 +211,7 @@ class PlayerTrainer < Trainer end def money=(value) - @money = value.clamp(0, MAX_MONEY) + @money = value.clamp(0, Settings::MAX_MONEY) end def badge_count @@ -301,7 +301,7 @@ class PlayerTrainer < Trainer @character_ID = nil @outfit = 0 @badges = [false] * 8 - @money = INITIAL_MONEY + @money = Settings::INITIAL_MONEY clear_pokedex @pokegear = false @pokedex = false diff --git a/Data/Scripts/014_Trainers/002_PTrainer_NPCTrainers.rb b/Data/Scripts/014_Trainers/002_PTrainer_NPCTrainers.rb index 01524913a..ee95ce0c4 100644 --- a/Data/Scripts/014_Trainers/002_PTrainer_NPCTrainers.rb +++ b/Data/Scripts/014_Trainers/002_PTrainer_NPCTrainers.rb @@ -19,7 +19,7 @@ end def pbNewTrainer(tr_type, tr_name, tr_version, save_changes = true) party = [] - for i in 0...MAX_PARTY_SIZE + for i in 0...Settings::MAX_PARTY_SIZE if i == 0 pbMessage(_INTL("Please enter the first Pokémon.",i)) else diff --git a/Data/Scripts/015_Items/001_PItem_Items.rb b/Data/Scripts/015_Items/001_PItem_Items.rb index e446e8777..e19d16cfb 100644 --- a/Data/Scripts/015_Items/001_PItem_Items.rb +++ b/Data/Scripts/015_Items/001_PItem_Items.rb @@ -432,7 +432,7 @@ def pbLearnMove(pkmn,move,ignoreifknown=false,bymachine=false,&block) oldmovename = pkmn.moves[forgetmove].name oldmovepp = pkmn.moves[forgetmove].pp pkmn.moves[forgetmove] = Pokemon::Move.new(move) # Replaces current/total PP - if bymachine && TAUGHT_MACHINES_KEEP_OLD_PP + if bymachine && Settings::TAUGHT_MACHINES_KEEP_OLD_PP pkmn.moves[forgetmove].pp = [oldmovepp,pkmn.moves[forgetmove].total_pp].min end pbMessage(_INTL("1,\\wt[16] 2, and\\wt[16]...\\wt[16] ...\\wt[16] ... Ta-da!\\se[Battle ball drop]\1"),&block) diff --git a/Data/Scripts/015_Items/002_PItem_ItemEffects.rb b/Data/Scripts/015_Items/002_PItem_ItemEffects.rb index 87894e1f4..11280ce9f 100644 --- a/Data/Scripts/015_Items/002_PItem_ItemEffects.rb +++ b/Data/Scripts/015_Items/002_PItem_ItemEffects.rb @@ -372,7 +372,7 @@ ItemHandlers::UseOnPokemon.add(:POTION,proc { |item,pkmn,scene| }) ItemHandlers::UseOnPokemon.copy(:POTION,:BERRYJUICE,:SWEETHEART) -ItemHandlers::UseOnPokemon.copy(:POTION,:RAGECANDYBAR) if !RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS +ItemHandlers::UseOnPokemon.copy(:POTION,:RAGECANDYBAR) if !Settings::RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS ItemHandlers::UseOnPokemon.add(:SUPERPOTION,proc { |item,pkmn,scene| next pbHPItem(pkmn,50,scene) @@ -489,7 +489,7 @@ ItemHandlers::UseOnPokemon.add(:FULLHEAL,proc { |item,pkmn,scene| ItemHandlers::UseOnPokemon.copy(:FULLHEAL, :LAVACOOKIE,:OLDGATEAU,:CASTELIACONE,:LUMIOSEGALETTE,:SHALOURSABLE, :BIGMALASADA,:LUMBERRY) -ItemHandlers::UseOnPokemon.copy(:FULLHEAL,:RAGECANDYBAR) if RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS +ItemHandlers::UseOnPokemon.copy(:FULLHEAL,:RAGECANDYBAR) if Settings::RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS ItemHandlers::UseOnPokemon.add(:FULLRESTORE,proc { |item,pkmn,scene| if pkmn.fainted? || (pkmn.hp==pkmn.totalhp && pkmn.status==PBStatuses::NONE) diff --git a/Data/Scripts/015_Items/003_PItem_BattleItemEffects.rb b/Data/Scripts/015_Items/003_PItem_BattleItemEffects.rb index c0228448d..4810ff68c 100644 --- a/Data/Scripts/015_Items/003_PItem_BattleItemEffects.rb +++ b/Data/Scripts/015_Items/003_PItem_BattleItemEffects.rb @@ -66,7 +66,7 @@ ItemHandlers::CanUseInBattle.copy(:POTION, :SUPERPOTION,:HYPERPOTION,:MAXPOTION,:BERRYJUICE,:SWEETHEART,:FRESHWATER, :SODAPOP,:LEMONADE,:MOOMOOMILK,:ORANBERRY,:SITRUSBERRY,:ENERGYPOWDER, :ENERGYROOT) -ItemHandlers::CanUseInBattle.copy(:POTION,:RAGECANDYBAR) if !RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS +ItemHandlers::CanUseInBattle.copy(:POTION,:RAGECANDYBAR) if !Settings::RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS ItemHandlers::CanUseInBattle.add(:AWAKENING,proc { |item,pokemon,battler,move,firstAction,battle,scene,showMessages| next pbBattleItemCanCureStatus?(PBStatuses::SLEEP,pokemon,scene,showMessages) @@ -119,7 +119,7 @@ ItemHandlers::CanUseInBattle.add(:FULLHEAL,proc { |item,pokemon,battler,move,fir ItemHandlers::CanUseInBattle.copy(:FULLHEAL, :LAVACOOKIE,:OLDGATEAU,:CASTELIACONE,:LUMIOSEGALETTE,:SHALOURSABLE, :BIGMALASADA,:LUMBERRY,:HEALPOWDER) -ItemHandlers::CanUseInBattle.copy(:FULLHEAL,:RAGECANDYBAR) if RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS +ItemHandlers::CanUseInBattle.copy(:FULLHEAL,:RAGECANDYBAR) if Settings::RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS ItemHandlers::CanUseInBattle.add(:FULLRESTORE,proc { |item,pokemon,battler,move,firstAction,battle,scene,showMessages| if !pokemon.able? || @@ -317,7 +317,7 @@ ItemHandlers::BattleUseOnPokemon.add(:POTION,proc { |item,pokemon,battler,choice }) ItemHandlers::BattleUseOnPokemon.copy(:POTION,:BERRYJUICE,:SWEETHEART) -ItemHandlers::BattleUseOnPokemon.copy(:POTION,:RAGECANDYBAR) if !RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS +ItemHandlers::BattleUseOnPokemon.copy(:POTION,:RAGECANDYBAR) if !Settings::RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS ItemHandlers::BattleUseOnPokemon.add(:SUPERPOTION,proc { |item,pokemon,battler,choices,scene| pbBattleHPItem(pokemon,battler,50,scene) @@ -417,7 +417,7 @@ ItemHandlers::BattleUseOnPokemon.add(:FULLHEAL,proc { |item,pokemon,battler,choi ItemHandlers::BattleUseOnPokemon.copy(:FULLHEAL, :LAVACOOKIE,:OLDGATEAU,:CASTELIACONE,:LUMIOSEGALETTE,:SHALOURSABLE, :BIGMALASADA,:LUMBERRY) -ItemHandlers::BattleUseOnPokemon.copy(:FULLHEAL,:RAGECANDYBAR) if RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS +ItemHandlers::BattleUseOnPokemon.copy(:FULLHEAL,:RAGECANDYBAR) if Settings::RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS ItemHandlers::BattleUseOnPokemon.add(:FULLRESTORE,proc { |item,pokemon,battler,choices,scene| pokemon.heal_status @@ -523,7 +523,7 @@ ItemHandlers::BattleUseOnBattler.add(:YELLOWFLUTE,proc { |item,battler,scene| ItemHandlers::BattleUseOnBattler.copy(:YELLOWFLUTE,:PERSIMBERRY) ItemHandlers::BattleUseOnBattler.add(:XATTACK,proc { |item,battler,scene| - battler.pbRaiseStatStage(PBStats::ATTACK,(X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1,battler) + battler.pbRaiseStatStage(PBStats::ATTACK,(Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1,battler) battler.pokemon.changeHappiness("battleitem") }) @@ -543,7 +543,7 @@ ItemHandlers::BattleUseOnBattler.add(:XATTACK6,proc { |item,battler,scene| }) ItemHandlers::BattleUseOnBattler.add(:XDEFENSE,proc { |item,battler,scene| - battler.pbRaiseStatStage(PBStats::DEFENSE,(X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1,battler) + battler.pbRaiseStatStage(PBStats::DEFENSE,(Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1,battler) battler.pokemon.changeHappiness("battleitem") }) @@ -571,7 +571,7 @@ ItemHandlers::BattleUseOnBattler.add(:XDEFENSE6,proc { |item,battler,scene| ItemHandlers::BattleUseOnBattler.copy(:XDEFENSE6,:XDEFEND6) ItemHandlers::BattleUseOnBattler.add(:XSPATK,proc { |item,battler,scene| - battler.pbRaiseStatStage(PBStats::SPATK,(X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1,battler) + battler.pbRaiseStatStage(PBStats::SPATK,(Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1,battler) battler.pokemon.changeHappiness("battleitem") }) @@ -599,7 +599,7 @@ ItemHandlers::BattleUseOnBattler.add(:XSPATK6,proc { |item,battler,scene| ItemHandlers::BattleUseOnBattler.copy(:XSPATK6,:XSPECIAL6) ItemHandlers::BattleUseOnBattler.add(:XSPDEF,proc { |item,battler,scene| - battler.pbRaiseStatStage(PBStats::SPDEF,(X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1,battler) + battler.pbRaiseStatStage(PBStats::SPDEF,(Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1,battler) battler.pokemon.changeHappiness("battleitem") }) @@ -619,7 +619,7 @@ ItemHandlers::BattleUseOnBattler.add(:XSPDEF6,proc { |item,battler,scene| }) ItemHandlers::BattleUseOnBattler.add(:XSPEED,proc { |item,battler,scene| - battler.pbRaiseStatStage(PBStats::SPEED,(X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1,battler) + battler.pbRaiseStatStage(PBStats::SPEED,(Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1,battler) battler.pokemon.changeHappiness("battleitem") }) @@ -639,7 +639,7 @@ ItemHandlers::BattleUseOnBattler.add(:XSPEED6,proc { |item,battler,scene| }) ItemHandlers::BattleUseOnBattler.add(:XACCURACY,proc { |item,battler,scene| - battler.pbRaiseStatStage(PBStats::ACCURACY,(X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1,battler) + battler.pbRaiseStatStage(PBStats::ACCURACY,(Settings::X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1,battler) battler.pokemon.changeHappiness("battleitem") }) diff --git a/Data/Scripts/015_Items/005_PItem_PokeRadar.rb b/Data/Scripts/015_Items/005_PItem_PokeRadar.rb index dd5fde99e..6cfbafbb5 100644 --- a/Data/Scripts/015_Items/005_PItem_PokeRadar.rb +++ b/Data/Scripts/015_Items/005_PItem_PokeRadar.rb @@ -76,11 +76,11 @@ def pbPokeRadarHighlightGrass(showmessage=true) if PBTerrain.isJustGrass?($game_map.terrain_tag(x,y)) # Choose a rarity for the grass (0=normal, 1=rare, 2=shiny) s = (rand(100) < 25) ? 1 : 0 - if $PokemonTemp.pokeradar && $PokemonTemp.pokeradar[2]>0 - v = [(65536/SHINY_POKEMON_CHANCE)-$PokemonTemp.pokeradar[2]*200,200].max - v = 0xFFFF/v - v = rand(65536)/v - s = 2 if v==0 + if $PokemonTemp.pokeradar && $PokemonTemp.pokeradar[2] > 0 + v = [(65536 / Settings::SHINY_POKEMON_CHANCE) - $PokemonTemp.pokeradar[2] * 200, 200].max + v = 0xFFFF / v + v = rand(65536) / v + s = 2 if v == 0 end grasses.push([x,y,i,s]) end @@ -95,11 +95,11 @@ def pbPokeRadarHighlightGrass(showmessage=true) for grass in grasses case grass[3] when 0 # Normal rustle - $scene.spriteset.addUserAnimation(RUSTLE_NORMAL_ANIMATION_ID,grass[0],grass[1],true,1) + $scene.spriteset.addUserAnimation(Settings::RUSTLE_NORMAL_ANIMATION_ID,grass[0],grass[1],true,1) when 1 # Vigorous rustle - $scene.spriteset.addUserAnimation(RUSTLE_VIGOROUS_ANIMATION_ID,grass[0],grass[1],true,1) + $scene.spriteset.addUserAnimation(Settings::RUSTLE_VIGOROUS_ANIMATION_ID,grass[0],grass[1],true,1) when 2 # Shiny rustle - $scene.spriteset.addUserAnimation(RUSTLE_SHINY_ANIMATION_ID,grass[0],grass[1],true,1) + $scene.spriteset.addUserAnimation(Settings::RUSTLE_SHINY_ANIMATION_ID,grass[0],grass[1],true,1) end end $PokemonTemp.pokeradar[3] = grasses if $PokemonTemp.pokeradar @@ -127,7 +127,7 @@ def pbPokeRadarGetEncounter(rarity = 0) # Get all Poké Radar-exclusive encounters for this map map = $game_map.map_id array = [] - POKE_RADAR_ENCOUNTERS.each do |enc| + Settings::POKE_RADAR_ENCOUNTERS.each do |enc| array.push(enc) if enc[0] == map && GameData::Species.exists?(enc[2]) end # If there are any exclusives, first have a chance of encountering those @@ -137,7 +137,7 @@ def pbPokeRadarGetEncounter(rarity = 0) array.each do |enc| rnd -= enc[1] next if rnd >= 0 - level = (enc[4] && enc[4] > enc[3]) ? rand(enc[3], enc[4]) : enc[3] + level = (enc[4] && enc[4] > enc[3]) ? rand(enc[3]..enc[4]) : enc[3] return [enc[2], level] end end diff --git a/Data/Scripts/015_Items/008_PItem_Bag.rb b/Data/Scripts/015_Items/008_PItem_Bag.rb index 999e3e52f..79ee8b619 100644 --- a/Data/Scripts/015_Items/008_PItem_Bag.rb +++ b/Data/Scripts/015_Items/008_PItem_Bag.rb @@ -5,7 +5,7 @@ class PokemonBag attr_accessor :lastpocket def self.pocketNames - return pbPocketNames + return Settings.bag_pocket_names end def self.numPockets @@ -52,7 +52,7 @@ class PokemonBag end def maxPocketSize(pocket) - maxsize = BAG_MAX_POCKET_SIZE[pocket] + maxsize = Settings::BAG_MAX_POCKET_SIZE[pocket] return -1 if !maxsize return maxsize end @@ -103,7 +103,7 @@ class PokemonBag maxsize = maxPocketSize(pocket) maxsize = @pockets[pocket].length + 1 if maxsize < 0 return ItemStorageHelper.pbCanStore?( - @pockets[pocket], maxsize, BAG_MAX_PER_SLOT, item.id, qty) + @pockets[pocket], maxsize, Settings::BAG_MAX_PER_SLOT, item.id, qty) end def pbStoreItem(item, qty = 1) @@ -112,7 +112,7 @@ class PokemonBag maxsize = maxPocketSize(pocket) maxsize = @pockets[pocket].length + 1 if maxsize < 0 return ItemStorageHelper.pbStoreItem( - @pockets[pocket], maxsize, BAG_MAX_PER_SLOT, item.id, qty, true) + @pockets[pocket], maxsize, Settings::BAG_MAX_PER_SLOT, item.id, qty, true) end def pbStoreAllOrNone(item, qty = 1) @@ -307,7 +307,7 @@ module ItemStorageHelper if !itemslot items[i] = [item, [qty, maxPerSlot].min] qty -= items[i][1] - if itemPocket > 0 && sorting && BAG_POCKET_AUTO_SORT[itemPocket] + if itemPocket > 0 && sorting && Settings::BAG_POCKET_AUTO_SORT[itemPocket] items.sort! { |a, b| GameData::Item.get(a[0]).id_number <=> GameData::Item.get(b[0]).id_number } end return true if qty == 0 diff --git a/Data/Scripts/016_Pokemon/001_Pokemon-related/009_Pokemon_Storage.rb b/Data/Scripts/016_Pokemon/001_Pokemon-related/009_Pokemon_Storage.rb index 585dd3f93..d9ed7e4f7 100644 --- a/Data/Scripts/016_Pokemon/001_Pokemon-related/009_Pokemon_Storage.rb +++ b/Data/Scripts/016_Pokemon/001_Pokemon-related/009_Pokemon_Storage.rb @@ -59,11 +59,11 @@ class PokemonStorage attr_writer :unlockedWallpapers BASICWALLPAPERQTY = 16 - def initialize(maxBoxes = NUM_STORAGE_BOXES, maxPokemon = PokemonBox::BOX_SIZE) + def initialize(maxBoxes = Settings::NUM_STORAGE_BOXES, maxPokemon = PokemonBox::BOX_SIZE) @boxes = [] for i in 0...maxBoxes @boxes[i] = PokemonBox.new(_INTL("Box {1}",i+1),maxPokemon) - @boxes[i].background = i%BASICWALLPAPERQTY + @boxes[i].background = i % BASICWALLPAPERQTY end @currentBox = 0 @boxmode = -1 @@ -131,7 +131,7 @@ class PokemonStorage def maxPokemon(box) return 0 if box >= self.maxBoxes - return (box < 0) ? MAX_PARTY_SIZE : self[box].length + return (box < 0) ? Settings::MAX_PARTY_SIZE : self[box].length end def full? @@ -144,7 +144,7 @@ class PokemonStorage def pbFirstFreePos(box) if box==-1 ret = self.party.length - return (ret >= MAX_PARTY_SIZE) ? -1 : ret + return (ret >= Settings::MAX_PARTY_SIZE) ? -1 : ret end for i in 0...maxPokemon(box) return i if !self[box,i] diff --git a/Data/Scripts/016_Pokemon/001_Pokemon.rb b/Data/Scripts/016_Pokemon/001_Pokemon.rb index 40a2ee86c..8fc773fd3 100644 --- a/Data/Scripts/016_Pokemon/001_Pokemon.rb +++ b/Data/Scripts/016_Pokemon/001_Pokemon.rb @@ -367,7 +367,7 @@ class Pokemon b = a & 0xFFFF c = (a >> 16) & 0xFFFF d = b ^ c - @shiny = d < SHINY_POKEMON_CHANCE + @shiny = d < Settings::SHINY_POKEMON_CHANCE end return @shiny end @@ -734,7 +734,7 @@ class Pokemon # @param strain [Integer] Pokérus strain to give def givePokerus(strain = 0) return if self.pokerusStage == 2 # Can't re-infect a cured Pokémon - strain = rand(1, 16) if strain <= 0 || strain >= 16 + strain = rand(1..16) if strain <= 0 || strain >= 16 time = 1 + (strain % 4) @pokerus = time @pokerus |= strain << 4 @@ -1012,7 +1012,7 @@ class Pokemon @owner = Owner.new(0, '', 2, 2) end @obtain_method = 0 # Met - @obtain_method = 4 if $game_switches && $game_switches[FATEFUL_ENCOUNTER_SWITCH] + @obtain_method = 4 if $game_switches && $game_switches[Settings::FATEFUL_ENCOUNTER_SWITCH] @obtain_map = ($game_map) ? $game_map.map_id : 0 @obtain_text = nil @obtain_level = level diff --git a/Data/Scripts/017_UI/001_PScreen_PauseMenu.rb b/Data/Scripts/017_UI/001_PScreen_PauseMenu.rb index eec49fbfe..4785b315a 100644 --- a/Data/Scripts/017_UI/001_PScreen_PauseMenu.rb +++ b/Data/Scripts/017_UI/001_PScreen_PauseMenu.rb @@ -122,11 +122,11 @@ class PokemonPauseMenu commands[cmdPokegear = commands.length] = _INTL("Pokégear") if $Trainer.pokegear commands[cmdTrainer = commands.length] = $Trainer.name if pbInSafari? - if SAFARI_STEPS<=0 + if Settings::SAFARI_STEPS <= 0 @scene.pbShowInfo(_INTL("Balls: {1}",pbSafariState.ballcount)) else @scene.pbShowInfo(_INTL("Steps: {1}/{2}\nBalls: {3}", - pbSafariState.steps,SAFARI_STEPS,pbSafariState.ballcount)) + pbSafariState.steps, Settings::SAFARI_STEPS, pbSafariState.ballcount)) end commands[cmdQuit = commands.length] = _INTL("Quit") elsif pbInBugContest? @@ -148,7 +148,7 @@ class PokemonPauseMenu loop do command = @scene.pbShowCommands(commands) if cmdPokedex>=0 && command==cmdPokedex - if USE_CURRENT_REGION_DEX + if Settings::USE_CURRENT_REGION_DEX pbFadeOutIn { scene = PokemonPokedex_Scene.new screen = PokemonPokedexScreen.new(scene) diff --git a/Data/Scripts/017_UI/002_PScreen_PokedexMenu.rb b/Data/Scripts/017_UI/002_PScreen_PokedexMenu.rb index 125314e18..ef136f963 100644 --- a/Data/Scripts/017_UI/002_PScreen_PokedexMenu.rb +++ b/Data/Scripts/017_UI/002_PScreen_PokedexMenu.rb @@ -1,8 +1,8 @@ #=============================================================================== # Pokédex Regional Dexes list menu screen # * For choosing which region list to view. Only appears when there is more -# than one viable region list to choose from, and if USE_CURRENT_REGION_DEX is -# false. +# than one viable region list to choose from, and if +# Settings::USE_CURRENT_REGION_DEX is false. #=============================================================================== class Window_DexesList < Window_CommandPokemon def initialize(commands,commands2,width) @@ -93,7 +93,7 @@ class PokemonPokedexMenuScreen def pbStartScreen commands = [] commands2 = [] - dexnames = pbDexNames + dexnames = Settings.pokedex_names for i in 0...$PokemonGlobal.pokedexViable.length index = $PokemonGlobal.pokedexViable[i] if dexnames[index]==nil diff --git a/Data/Scripts/017_UI/003_PScreen_PokedexMain.rb b/Data/Scripts/017_UI/003_PScreen_PokedexMain.rb index c7613e868..f8c6f09ad 100644 --- a/Data/Scripts/017_UI/003_PScreen_PokedexMain.rb +++ b/Data/Scripts/017_UI/003_PScreen_PokedexMain.rb @@ -282,7 +282,7 @@ class PokemonPokedex_Scene # return value of pbGetCurrentRegion, and thus will change according to the # current map's MapPosition metadata setting. def pbGetPokedexRegion - if USE_CURRENT_REGION_DEX + if Settings::USE_CURRENT_REGION_DEX region = pbGetCurrentRegion region = -1 if region>=$PokemonGlobal.pokedexUnlocked.length-1 return region @@ -320,7 +320,7 @@ class PokemonPokedex_Scene regionalSpecies = [] GameData::Species.each { |s| regionalSpecies.push(s.id) if s.form == 0 } end - shift = DEXES_WITH_OFFSETS.include?(region) + shift = Settings::DEXES_WITH_OFFSETS.include?(region) ret = [] regionalSpecies.each_with_index do |species, i| next if !species @@ -386,7 +386,7 @@ class PokemonPokedex_Scene # Write various bits of text dexname = _INTL("Pokédex") if $PokemonGlobal.pokedexUnlocked.length>1 - thisdex = pbDexNames[pbGetSavePositionIndex] + thisdex = Settings.pokedex_names[pbGetSavePositionIndex] if thisdex!=nil dexname = (thisdex.is_a?(Array)) ? thisdex[0] : thisdex end @@ -792,8 +792,8 @@ class PokemonPokedex_Scene def pbDexEntry(index) oldsprites = pbFadeOutAndHide(@sprites) region = -1 - if !USE_CURRENT_REGION_DEX - dexnames = pbDexNames + if !Settings::USE_CURRENT_REGION_DEX + dexnames = Settings.pokedex_names if dexnames[pbGetSavePositionIndex].is_a?(Array) region = dexnames[pbGetSavePositionIndex][1] end diff --git a/Data/Scripts/017_UI/004_PScreen_PokedexEntry.rb b/Data/Scripts/017_UI/004_PScreen_PokedexEntry.rb index 90fa659df..dab8ee9aa 100644 --- a/Data/Scripts/017_UI/004_PScreen_PokedexEntry.rb +++ b/Data/Scripts/017_UI/004_PScreen_PokedexEntry.rb @@ -26,7 +26,7 @@ class PokemonPokedexInfo_Scene @sprites["areamap"].setBitmap("Graphics/Pictures/#{@mapdata[@region][1]}") @sprites["areamap"].x += (Graphics.width-@sprites["areamap"].bitmap.width)/2 @sprites["areamap"].y += (Graphics.height+32-@sprites["areamap"].bitmap.height)/2 - for hidden in REGION_MAP_EXTRAS + for hidden in Settings::REGION_MAP_EXTRAS if hidden[0]==@region && hidden[1]>0 && $game_switches[hidden[1]] pbDrawImagePositions(@sprites["areamap"].bitmap,[ ["Graphics/Pictures/#{hidden[4]}", @@ -73,7 +73,7 @@ class PokemonPokedexInfo_Scene dexnum = species dexnumshift = false if $PokemonGlobal.pokedexUnlocked[$PokemonGlobal.pokedexUnlocked.length - 1] - dexnumshift = true if DEXES_WITH_OFFSETS.include?(-1) # National Dex + dexnumshift = true if Settings::DEXES_WITH_OFFSETS.include?(-1) # National Dex else dexnum = 0 for i in 0...$PokemonGlobal.pokedexUnlocked.length - 1 # Regional Dexes @@ -81,7 +81,7 @@ class PokemonPokedexInfo_Scene num = pbGetRegionalNumber(i,species) next if num <= 0 dexnum = num - dexnumshift = true if DEXES_WITH_OFFSETS.include?(i) + dexnumshift = true if Settings::DEXES_WITH_OFFSETS.include?(i) break end end @@ -153,12 +153,12 @@ class PokemonPokedexInfo_Scene case sp.gender_rate when PBGenderRates::AlwaysMale, PBGenderRates::AlwaysFemale, PBGenderRates::Genderless real_gender = (sp.gender_rate == PBGenderRates::AlwaysFemale) ? 1 : 0 - next if !$Trainer.seen_forms[@species][real_gender][sp.form] && !DEX_SHOWS_ALL_FORMS + next if !$Trainer.seen_forms[@species][real_gender][sp.form] && !Settings::DEX_SHOWS_ALL_FORMS real_gender = 2 if sp.gender_rate == PBGenderRates::Genderless ret.push([sp.form_name, real_gender, sp.form]) else # Both male and female for real_gender in 0...2 - next if !$Trainer.seen_forms[@species][real_gender][sp.form] && !DEX_SHOWS_ALL_FORMS + next if !$Trainer.seen_forms[@species][real_gender][sp.form] && !Settings::DEX_SHOWS_ALL_FORMS ret.push([sp.form_name, real_gender, sp.form]) break if sp.form_name && !sp.form_name.empty? # Only show 1 entry for each non-0 form end @@ -554,14 +554,14 @@ class PokemonPokedexInfoScreen def pbStartSceneSingle(species) # For use from a Pokémon's summary screen region = -1 - if USE_CURRENT_REGION_DEX + if Settings::USE_CURRENT_REGION_DEX region = pbGetCurrentRegion region = -1 if region>=$PokemonGlobal.pokedexUnlocked.length-1 else region = $PokemonGlobal.pokedexDex # National Dex -1, regional dexes 0 etc. end dexnum = pbGetRegionalNumber(region,species) - dexnumshift = DEXES_WITH_OFFSETS.include?(region) + dexnumshift = Settings::DEXES_WITH_OFFSETS.include?(region) dexlist = [[species,GameData::Species.get(species).name,0,0,dexnum,dexnumshift]] @scene.pbStartScene(dexlist,0,region) @scene.pbScene diff --git a/Data/Scripts/017_UI/005_PScreen_Party.rb b/Data/Scripts/017_UI/005_PScreen_Party.rb index b27f948a8..4355dedc7 100644 --- a/Data/Scripts/017_UI/005_PScreen_Party.rb +++ b/Data/Scripts/017_UI/005_PScreen_Party.rb @@ -448,7 +448,7 @@ class PokemonParty_Scene pbBottomLeftLines(@sprites["helpwindow"],1) pbSetHelpText(starthelptext) # Add party Pokémon sprites - for i in 0...MAX_PARTY_SIZE + for i in 0...Settings::MAX_PARTY_SIZE if @party[i] @sprites["pokemon#{i}"] = PokemonPartyPanel.new(@party[i],i,@viewport) else @@ -457,10 +457,10 @@ class PokemonParty_Scene @sprites["pokemon#{i}"].text = annotations[i] if annotations end if @multiselect - @sprites["pokemon#{MAX_PARTY_SIZE}"] = PokemonPartyConfirmSprite.new(@viewport) - @sprites["pokemon#{MAX_PARTY_SIZE + 1}"] = PokemonPartyCancelSprite2.new(@viewport) + @sprites["pokemon#{Settings::MAX_PARTY_SIZE}"] = PokemonPartyConfirmSprite.new(@viewport) + @sprites["pokemon#{Settings::MAX_PARTY_SIZE + 1}"] = PokemonPartyCancelSprite2.new(@viewport) else - @sprites["pokemon#{MAX_PARTY_SIZE}"] = PokemonPartyCancelSprite.new(@viewport) + @sprites["pokemon#{Settings::MAX_PARTY_SIZE}"] = PokemonPartyCancelSprite.new(@viewport) end # Select first Pokémon @activecmd = 0 @@ -573,14 +573,14 @@ class PokemonParty_Scene end def pbAnnotate(annot) - for i in 0...MAX_PARTY_SIZE + for i in 0...Settings::MAX_PARTY_SIZE @sprites["pokemon#{i}"].text = (annot) ? annot[i] : nil end end def pbSelect(item) @activecmd = item - numsprites = MAX_PARTY_SIZE + ((@multiselect) ? 2 : 1) + numsprites = Settings::MAX_PARTY_SIZE + ((@multiselect) ? 2 : 1) for i in 0...numsprites @sprites["pokemon#{i}"].selected = (i==@activecmd) end @@ -620,7 +620,7 @@ class PokemonParty_Scene Input.update self.update end - for i in 0...MAX_PARTY_SIZE + for i in 0...Settings::MAX_PARTY_SIZE @sprites["pokemon#{i}"].preselected = false @sprites["pokemon#{i}"].switching = false end @@ -628,7 +628,7 @@ class PokemonParty_Scene end def pbClearSwitching - for i in 0...MAX_PARTY_SIZE + for i in 0...Settings::MAX_PARTY_SIZE @sprites["pokemon#{i}"].preselected = false @sprites["pokemon#{i}"].switching = false end @@ -674,7 +674,7 @@ class PokemonParty_Scene end def pbChoosePokemon(switching=false,initialsel=-1,canswitch=0) - for i in 0...MAX_PARTY_SIZE + for i in 0...Settings::MAX_PARTY_SIZE @sprites["pokemon#{i}"].preselected = (switching && i==@activecmd) @sprites["pokemon#{i}"].switching = switching end @@ -695,12 +695,12 @@ class PokemonParty_Scene end if @activecmd!=oldsel # Changing selection pbPlayCursorSE - numsprites = MAX_PARTY_SIZE + ((@multiselect) ? 2 : 1) + numsprites = Settings::MAX_PARTY_SIZE + ((@multiselect) ? 2 : 1) for i in 0...numsprites @sprites["pokemon#{i}"].selected = (i==@activecmd) end end - cancelsprite = MAX_PARTY_SIZE + ((@multiselect) ? 1 : 0) + cancelsprite = Settings::MAX_PARTY_SIZE + ((@multiselect) ? 1 : 0) if Input.trigger?(Input::A) && canswitch==1 && @activecmd!=cancelsprite pbPlayDecisionSE return [1,@activecmd] @@ -722,13 +722,13 @@ class PokemonParty_Scene end def pbChangeSelection(key,currentsel) - numsprites = MAX_PARTY_SIZE + ((@multiselect) ? 2 : 1) + numsprites = Settings::MAX_PARTY_SIZE + ((@multiselect) ? 2 : 1) case key when Input::LEFT begin currentsel -= 1 end while currentsel > 0 && currentsel < @party.length && !@party[currentsel] - if currentsel >= @party.length && currentsel < MAX_PARTY_SIZE + if currentsel >= @party.length && currentsel < Settings::MAX_PARTY_SIZE currentsel = @party.length - 1 end currentsel = numsprites - 1 if currentsel < 0 @@ -737,12 +737,12 @@ class PokemonParty_Scene currentsel += 1 end while currentsel < @party.length && !@party[currentsel] if currentsel == @party.length - currentsel = MAX_PARTY_SIZE + currentsel = Settings::MAX_PARTY_SIZE elsif currentsel == numsprites currentsel = 0 end when Input::UP - if currentsel >= MAX_PARTY_SIZE + if currentsel >= Settings::MAX_PARTY_SIZE begin currentsel -= 1 end while currentsel > 0 && !@party[currentsel] @@ -751,19 +751,19 @@ class PokemonParty_Scene currentsel -= 2 end while currentsel > 0 && !@party[currentsel] end - if currentsel >= @party.length && currentsel < MAX_PARTY_SIZE + if currentsel >= @party.length && currentsel < Settings::MAX_PARTY_SIZE currentsel = @party.length-1 end currentsel = numsprites - 1 if currentsel < 0 when Input::DOWN - if currentsel >= MAX_PARTY_SIZE - 1 + if currentsel >= Settings::MAX_PARTY_SIZE - 1 currentsel += 1 else currentsel += 2 - currentsel = MAX_PARTY_SIZE if currentsel < MAX_PARTY_SIZE && !@party[currentsel] + currentsel = Settings::MAX_PARTY_SIZE if currentsel < Settings::MAX_PARTY_SIZE && !@party[currentsel] end - if currentsel >= @party.length && currentsel < MAX_PARTY_SIZE - currentsel = MAX_PARTY_SIZE + if currentsel >= @party.length && currentsel < Settings::MAX_PARTY_SIZE + currentsel = Settings::MAX_PARTY_SIZE elsif currentsel >= numsprites currentsel = 0 end @@ -774,14 +774,14 @@ class PokemonParty_Scene def pbHardRefresh oldtext = [] lastselected = -1 - for i in 0...MAX_PARTY_SIZE + for i in 0...Settings::MAX_PARTY_SIZE oldtext.push(@sprites["pokemon#{i}"].text) lastselected = i if @sprites["pokemon#{i}"].selected @sprites["pokemon#{i}"].dispose end lastselected = @party.length-1 if lastselected>=@party.length lastselected = 0 if lastselected<0 - for i in 0...MAX_PARTY_SIZE + for i in 0...Settings::MAX_PARTY_SIZE if @party[i] @sprites["pokemon#{i}"] = PokemonPartyPanel.new(@party[i],i,@viewport) else @@ -793,7 +793,7 @@ class PokemonParty_Scene end def pbRefresh - for i in 0...MAX_PARTY_SIZE + for i in 0...Settings::MAX_PARTY_SIZE sprite = @sprites["pokemon#{i}"] if sprite if sprite.is_a?(PokemonPartyPanel) @@ -971,7 +971,7 @@ class PokemonPartyScreen positions = [_INTL("FIRST"), _INTL("SECOND"), _INTL("THIRD"), _INTL("FOURTH"), _INTL("FIFTH"), _INTL("SIXTH"), _INTL("SEVENTH"), _INTL("EIGHTH"), _INTL("NINTH"), _INTL("TENTH"), _INTL("ELEVENTH"), _INTL("TWELFTH")] - for i in 0...MAX_PARTY_SIZE + for i in 0...Settings::MAX_PARTY_SIZE if i < positions.length ordinals.push(positions[i]) else @@ -1006,12 +1006,12 @@ class PokemonPartyScreen end @scene.pbAnnotate(annot) if realorder.length==ruleset.number && addedEntry - @scene.pbSelect(MAX_PARTY_SIZE) + @scene.pbSelect(Settings::MAX_PARTY_SIZE) end @scene.pbSetHelpText(_INTL("Choose Pokémon and confirm.")) pkmnid = @scene.pbChoosePokemon addedEntry = false - if pkmnid == MAX_PARTY_SIZE # Confirm was chosen + if pkmnid == Settings::MAX_PARTY_SIZE # Confirm was chosen ret = [] for i in realorder; ret.push(@party[i]); end error = [] diff --git a/Data/Scripts/017_UI/006_PScreen_Summary.rb b/Data/Scripts/017_UI/006_PScreen_Summary.rb index 75ca573fd..e462ffa6c 100644 --- a/Data/Scripts/017_UI/006_PScreen_Summary.rb +++ b/Data/Scripts/017_UI/006_PScreen_Summary.rb @@ -391,7 +391,7 @@ class PokemonSummary_Scene dexnum = @pokemon.species dexnumshift = false if $PokemonGlobal.pokedexUnlocked[$PokemonGlobal.pokedexUnlocked.length-1] - dexnumshift = true if DEXES_WITH_OFFSETS.include?(-1) + dexnumshift = true if Settings::DEXES_WITH_OFFSETS.include?(-1) else dexnum = 0 for i in 0...$PokemonGlobal.pokedexUnlocked.length-1 @@ -399,7 +399,7 @@ class PokemonSummary_Scene num = pbGetRegionalNumber(i,@pokemon.species) next if num<=0 dexnum = num - dexnumshift = true if DEXES_WITH_OFFSETS.include?(i) + dexnumshift = true if Settings::DEXES_WITH_OFFSETS.include?(i) break end end diff --git a/Data/Scripts/017_UI/007_PScreen_Bag.rb b/Data/Scripts/017_UI/007_PScreen_Bag.rb index e91a5d664..2804d403b 100644 --- a/Data/Scripts/017_UI/007_PScreen_Bag.rb +++ b/Data/Scripts/017_UI/007_PScreen_Bag.rb @@ -419,7 +419,7 @@ class PokemonBag_Scene elsif Input.trigger?(Input::A) # Start switching the selected item if !@choosing if thispocket.length>1 && itemwindow.indexqty @bag.pbStoreItem(item,newqty-qty) elsif newqty