From 389d43941d950b836f13141d9df2687e26558cb0 Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Sat, 14 Oct 2023 18:32:18 +0100 Subject: [PATCH] Added SKIP_CONTINUE_SCREEN Setting, fix message newline visual bug at slow text speeds, removed Bag rearranging --- Data/Scripts/001_Settings.rb | 556 ++++++++++-------- Data/Scripts/002_BattleSettings.rb | 110 ++-- .../005_SpriteWindow_text.rb | 4 +- Data/Scripts/013_Items/008_PokemonBag.rb | 31 +- Data/Scripts/016_UI/013_UI_Load.rb | 8 + 5 files changed, 382 insertions(+), 327 deletions(-) diff --git a/Data/Scripts/001_Settings.rb b/Data/Scripts/001_Settings.rb index 4b41d7d0a..9519ac754 100644 --- a/Data/Scripts/001_Settings.rb +++ b/Data/Scripts/001_Settings.rb @@ -16,7 +16,34 @@ module Settings # generations 5 and later are reasonably supported. MECHANICS_GENERATION = 8 - #============================================================================= + #----------------------------------------------------------------------------- + # Credits + #----------------------------------------------------------------------------- + + # Your game's credits, in an array. You can allow certain lines to be + # translated by wrapping them in _INTL() as shown. Blank lines are just "". + # To split a line into two columns, put "" in it. Plugin credits and + # Essentials engine credits are added to the end of these credits + # automatically. + def self.game_credits + return [ + _INTL("My Game by:"), + "Maruno", + "", + _INTL("Also involved were:"), + "A. Lee UssAnne O'Nymus", + "Ecksam PellJane Doe", + "Joe DanNick Nayme", + "Sue Donnim", + "", + _INTL("Special thanks to:"), + "Pizza" + ] + end + + #----------------------------------------------------------------------------- + # The player and NPCs + #----------------------------------------------------------------------------- # The maximum amount of money the player can have. MAX_MONEY = 999_999 @@ -28,128 +55,6 @@ module Settings MAX_SOOT = 9_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 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 - # Whether super shininess is enabled (uses a different shiny animation). - SUPER_SHINY = (MECHANICS_GENERATION >= 8) - # The odds of a wild Pokémon/bred egg having Pokérus (out of 65536). - POKERUS_CHANCE = 3 - # Whether IVs and EVs are treated as 0 when calculating a Pokémon's stats. - # IVs and EVs still exist, and are used by Hidden Power and some cosmetic - # things as normal. - DISABLE_IVS_AND_EVS = false - - #============================================================================= - - # Whether outdoor maps should be shaded according to the time of day. - TIME_SHADING = true - # Whether the reflections of the player/events will ripple horizontally. - ANIMATE_REFLECTIONS = 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 (true), or whether there is - # a reaction test first (false). - 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 Pokémon in the Day Care gain Exp for each step the player takes. - # This is true for the Day Care and false for the Pokémon Nursery, both of - # which use the same code in Essentials. - DAY_CARE_POKEMON_GAIN_EXP_FROM_WALKING = (MECHANICS_GENERATION <= 6) - # Whether two Pokémon in the Day Care can learn egg moves from each other if - # they are the same species. - DAY_CARE_POKEMON_CAN_SHARE_EGG_MOVES = (MECHANICS_GENERATION >= 8) - # Whether a bred baby Pokémon can inherit any TM/TR/HM moves from its father. - # It can never inherit TM/TR/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) - # Whether the Pokédex entry of a newly owned species will be shown after it - # hatches from an egg, after it evolves and after obtaining it from a trade, - # in addition to after catching it in battle. - SHOW_NEW_SPECIES_POKEDEX_ENTRY_MORE_OFTEN = (MECHANICS_GENERATION >= 7) - # Whether you get 1 Premier Ball for every 10 of any kind of Poké Ball bought - # at once (true), or 1 Premier Ball for buying 10+ Poké Balls (false). - MORE_BONUS_PREMIER_BALLS = (MECHANICS_GENERATION >= 8) - # 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 = 20 * 60 # 20 minutes - - #============================================================================= - - # 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 the Move Relearner can also teach egg moves that the Pokémon knew - # when it hatched and moves that the Pokémon was once taught by a TR. Moves - # from the Pokémon's level-up moveset of the same or a lower level than the - # Pokémon can always be relearned. - MOVE_RELEARNER_CAN_TEACH_MORE_MOVES = (MECHANICS_GENERATION >= 6) - # Whether various HP-healing items heal the amounts they do in Gen 7+ (true) - # or in earlier Generations (false). - REBALANCED_HEALING_ITEM_AMOUNTS = (MECHANICS_GENERATION >= 7) - # Whether Rage Candy Bar acts as a Full Heal (true) or a Potion (false). - RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS = (MECHANICS_GENERATION >= 7) - # Whether vitamins can add EVs no matter how many that stat already has in it - # (true), or whether they can't make that stat's EVs greater than 100 (false). - NO_VITAMIN_EV_CAP = (MECHANICS_GENERATION >= 8) - # Whether Rare Candy can be used on a Pokémon that is already at its maximum - # level if it is able to evolve by level-up (if so, triggers that evolution). - RARE_CANDY_USABLE_AT_MAX_LEVEL = (MECHANICS_GENERATION >= 8) - # Whether the player can choose how many of an item to use at once on a - # Pokémon. This applies to Exp-changing items (Rare Candy, Exp Candies) and - # EV-changing items (vitamins, feathers, EV-lowering berries). - USE_MULTIPLE_STAT_ITEMS_AT_ONCE = (MECHANICS_GENERATION >= 8) - - #============================================================================= - - # Whether Repel uses the level of the first Pokémon in the party regardless of - # its HP (true), or it uses the level of the first unfainted Pokémon (false). - REPEL_COUNTS_FAINTED_POKEMON = (MECHANICS_GENERATION >= 6) - # Whether more abilities affect whether wild Pokémon appear, which Pokémon - # they are, etc. - MORE_ABILITIES_AFFECT_WILD_ENCOUNTERS = (MECHANICS_GENERATION >= 8) - # Whether the Black/White Flutes will raise/lower the levels of wild Pokémon - # respectively (true), or will lower/raise the wild encounter rate - # respectively (false). - FLUTES_CHANGE_WILD_ENCOUNTER_LEVELS = (MECHANICS_GENERATION >= 6) - # Whether shiny wild Pokémon are more likely to appear if the player has - # previously defeated/caught lots of other Pokémon of the same species. - HIGHER_SHINY_CHANCES_WITH_NUMBER_BATTLED = (MECHANICS_GENERATION >= 8) - # Whether overworld weather can set the default terrain effect in battle. - # Storm weather sets Electric Terrain, and fog weather sets Misty Terrain. - OVERWORLD_WEATHER_SETS_BATTLE_TERRAIN = (MECHANICS_GENERATION >= 8) - # The default setting for Phone.rematches_enabled, which determines whether - # trainers registered in the Phone can become ready for a rematch. If false, - # Phone.rematches_enabled = true will enable rematches at any point you want. - PHONE_REMATCHES_POSSIBLE_FROM_BEGINNING = false - # Whether the messages in a phone call with a trainer are colored blue or red - # depending on that trainer's gender. Note that this doesn't apply to contacts - # that are not trainers; they will need to be colored manually in their Common - # Events. - COLOR_PHONE_CALL_MESSAGES_BY_CONTACT_GENDER = true - - #============================================================================= - # A set of arrays each containing a trainer type followed by a Game 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. @@ -159,8 +64,46 @@ module Settings [:CHAMPION, 12] ] - #============================================================================= + #----------------------------------------------------------------------------- + # Overworld + #----------------------------------------------------------------------------- + # Whether outdoor maps should be shaded according to the time of day. + TIME_SHADING = true + # Whether the reflections of the player/events will ripple horizontally. + ANIMATE_REFLECTIONS = true + # 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 (true), or whether there is + # a reaction test first (false). + 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 = 20 * 60 # 20 minutes + # 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 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) + + #----------------------------------------------------------------------------- + # Using moves in the overworld + #----------------------------------------------------------------------------- # Whether you need at least a certain number of badges to use some hidden # moves in the field (true), or whether you need one specific badge to use # them (false). The amounts/specific badges are defined below. @@ -180,100 +123,51 @@ module Settings BADGE_FOR_DIVE = 7 BADGE_FOR_WATERFALL = 8 - #============================================================================= + #----------------------------------------------------------------------------- + # Pokémon + #----------------------------------------------------------------------------- - # The names of each pocket of the Bag. - 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). - BAG_MAX_POCKET_SIZE = [-1, -1, -1, -1, -1, -1, -1, -1] - # Whether each pocket in turn auto-sorts itself by the order items are defined - # in the PBS file items.txt. - BAG_POCKET_AUTO_SORT = [false, false, false, true, true, false, false, false] - # The maximum number of items each slot in the Bag can hold. - BAG_MAX_PER_SLOT = 999 + # 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 + # Whether super shininess is enabled (uses a different shiny animation). + SUPER_SHINY = (MECHANICS_GENERATION >= 8) + # The odds of a wild Pokémon/bred egg having Pokérus (out of 65536). + POKERUS_CHANCE = 3 + # Whether IVs and EVs are treated as 0 when calculating a Pokémon's stats. + # IVs and EVs still exist, and are used by Hidden Power and some cosmetic + # things as normal. + DISABLE_IVS_AND_EVS = false + # Whether the Move Relearner can also teach egg moves that the Pokémon knew + # when it hatched and moves that the Pokémon was once taught by a TR. Moves + # from the Pokémon's level-up moveset of the same or a lower level than the + # Pokémon can always be relearned. + MOVE_RELEARNER_CAN_TEACH_MORE_MOVES = (MECHANICS_GENERATION >= 6) - #============================================================================= + #----------------------------------------------------------------------------- + # Breeding Pokémon and Day Care + #----------------------------------------------------------------------------- - # The number of boxes in Pokémon storage. - NUM_STORAGE_BOXES = 40 - # Whether putting a Pokémon into Pokémon storage will heal it. If false, they - # are healed by the Recover All: Entire Party event command (at Poké Centers). - HEAL_STORED_POKEMON = (MECHANICS_GENERATION <= 7) + # Whether Pokémon in the Day Care gain Exp for each step the player takes. + # This should be true for the Day Care and false for the Pokémon Nursery, both + # of which use the same code in Essentials. + DAY_CARE_POKEMON_GAIN_EXP_FROM_WALKING = (MECHANICS_GENERATION <= 6) + # Whether two Pokémon in the Day Care can learn egg moves from each other if + # they are the same species. + DAY_CARE_POKEMON_CAN_SHARE_EGG_MOVES = (MECHANICS_GENERATION >= 8) + # Whether a bred baby Pokémon can inherit any TM/TR/HM moves from its father. + # It can never inherit TM/TR/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) - #============================================================================= - - # 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 the Pokédex lists, in the order they are defined in the PBS - # file "regional_dexes.txt". The last name is for the National Dex and is - # added onto the end of this array (remember that you don't need to use it). - # This array's order is also the order of $player.pokedex.unlocked_dexes, - # which records which Dexes have been unlocked (the first is unlocked by - # default). If an entry is just a name, then the region map shown in the Area - # page while viewing that Dex list will be the region map of the region the - # player is currently in. The National Dex entry should always behave like - # this. If an entry is of the form [name, number], then the number is a region - # number, and that region's map will appear in the Area page while viewing - # that Dex list, no matter which 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 (in the same - # order as above, except the National Dex is -1). All Dex lists included here - # will begin their numbering at 0 rather than 1 (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. - # * Game 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/UI/Town Map folder. - # * The graphic will always (true) or never (false) be shown on a wall map. - REGION_MAP_EXTRAS = [ - [0, 51, 16, 15, "hidden_Berth", false], - [0, 52, 20, 14, "hidden_Faraday", false] - ] - # Whether the player can use Fly while looking at the Town Map. This is only - # allowed if the player can use Fly normally. - CAN_FLY_FROM_TOWN_MAP = true - - #============================================================================= - - # 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 = [] - - #============================================================================= + #----------------------------------------------------------------------------- + # Roaming Pokémon + #----------------------------------------------------------------------------- # A list of maps used by roaming Pokémon. Each map has an array of other maps # it can lead to. @@ -301,7 +195,8 @@ module Settings # 3 = fishing # 4 = surfing, fishing # * Name of BGM to play for that encounter (optional). - # * Roaming areas specifically for this Pokémon (optional). + # * Roaming areas specifically for this Pokémon (optional; used instead of + # ROAMING_AREAS). ROAMING_SPECIES = [ [:LATIAS, 30, 53, 0, "Battle roaming"], [:LATIOS, 30, 53, 0, "Battle roaming"], @@ -314,7 +209,166 @@ module Settings [:ENTEI, 40, 55, 1] ] - #============================================================================= + #----------------------------------------------------------------------------- + # Party and Pokémon storage + #----------------------------------------------------------------------------- + + # The maximum number of Pokémon that can be in the party. + MAX_PARTY_SIZE = 6 + # The number of boxes in Pokémon storage. + NUM_STORAGE_BOXES = 40 + # Whether putting a Pokémon into Pokémon storage will heal it. If false, they + # are healed by the Recover All: Entire Party event command (at Poké Centers). + HEAL_STORED_POKEMON = (MECHANICS_GENERATION <= 7) + + #----------------------------------------------------------------------------- + # Items + #----------------------------------------------------------------------------- + + # Whether various HP-healing items heal the amounts they do in Gen 7+ (true) + # or in earlier Generations (false). + REBALANCED_HEALING_ITEM_AMOUNTS = (MECHANICS_GENERATION >= 7) + # Whether vitamins can add EVs no matter how many that stat already has in it + # (true), or whether they can't make that stat's EVs greater than 100 (false). + NO_VITAMIN_EV_CAP = (MECHANICS_GENERATION >= 8) + # Whether Rage Candy Bar acts as a Full Heal (true) or a Potion (false). + RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS = (MECHANICS_GENERATION >= 7) + # Whether the Black/White Flutes will raise/lower the levels of wild Pokémon + # respectively (true), or will lower/raise the wild encounter rate + # respectively (false). + FLUTES_CHANGE_WILD_ENCOUNTER_LEVELS = (MECHANICS_GENERATION >= 6) + # Whether Rare Candy can be used on a Pokémon that is already at its maximum + # level if it is able to evolve by level-up (if so, triggers that evolution). + RARE_CANDY_USABLE_AT_MAX_LEVEL = (MECHANICS_GENERATION >= 8) + # Whether the player can choose how many of an item to use at once on a + # Pokémon. This applies to Exp-changing items (Rare Candy, Exp Candies) and + # EV-changing items (vitamins, feathers, EV-lowering berries). + USE_MULTIPLE_STAT_ITEMS_AT_ONCE = (MECHANICS_GENERATION >= 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 you get 1 Premier Ball for every 10 of any kind of Poké Ball bought + # from a Mart at once (true), or 1 Premier Ball for buying 10+ regular Poké + # Balls (false). + MORE_BONUS_PREMIER_BALLS = (MECHANICS_GENERATION >= 8) + + #----------------------------------------------------------------------------- + # Bag + #----------------------------------------------------------------------------- + + # The names of each pocket of the Bag. + 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). + BAG_MAX_POCKET_SIZE = [-1, -1, -1, -1, -1, -1, -1, -1] + # Whether each pocket in turn auto-sorts itself by the order items are defined + # in the PBS file items.txt. + BAG_POCKET_AUTO_SORT = [false, false, false, true, true, false, false, false] + # The maximum number of items each slot in the Bag can hold. + BAG_MAX_PER_SLOT = 999 + + #----------------------------------------------------------------------------- + # Pokédex + #----------------------------------------------------------------------------- + + # The names of the Pokédex lists, in the order they are defined in the PBS + # file "regional_dexes.txt". The last name is for the National Dex and is + # added onto the end of this array. + # Each entry is either just a name, or is an array containing a name and a + # number. If there is a number, it is a region number as defined in + # town_map.txt. If there is no number, the number of the region the player is + # currently in will be used. The region number determines which Town Map is + # shown in the Area page when viewing that Pokédex list. + def self.pokedex_names + return [ + [_INTL("Kanto Pokédex"), 0], + [_INTL("Johto Pokédex"), 1], + _INTL("National Pokédex") + ] + end + # 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 + # 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 (in the same + # order as above, except the National Dex is -1). All Dex lists included here + # will begin their numbering at 0 rather than 1 (e.g. Victini in Unova's Dex). + DEXES_WITH_OFFSETS = [] + # Whether the Pokédex entry of a newly owned species will be shown after it + # hatches from an egg, after it evolves and after obtaining it from a trade, + # in addition to after catching it in battle. + SHOW_NEW_SPECIES_POKEDEX_ENTRY_MORE_OFTEN = (MECHANICS_GENERATION >= 7) + + #----------------------------------------------------------------------------- + # Town Map + #----------------------------------------------------------------------------- + + # 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. + # * Game 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/UI/Town Map folder. + # * The graphic will always (true) or never (false) be shown on a wall map. + REGION_MAP_EXTRAS = [ + [0, 51, 16, 15, "hidden_Berth", false], + [0, 52, 20, 14, "hidden_Faraday", false] + ] + # Whether the player can use Fly while looking at the Town Map. This is only + # allowed if the player can use Fly normally. + CAN_FLY_FROM_TOWN_MAP = true + + #----------------------------------------------------------------------------- + # Phone + #----------------------------------------------------------------------------- + + # The default setting for Phone.rematches_enabled, which determines whether + # trainers registered in the Phone can become ready for a rematch. If false, + # Phone.rematches_enabled = true will enable rematches at any point you want. + PHONE_REMATCHES_POSSIBLE_FROM_BEGINNING = false + # Whether the messages in a phone call with a trainer are colored blue or red + # depending on that trainer's gender. Note that this doesn't apply to contacts + # whose phone calls are in a Common Event; they will need to be colored + # manually in their Common Events. + COLOR_PHONE_CALL_MESSAGES_BY_CONTACT_GENDER = true + + #----------------------------------------------------------------------------- + # Battle starting + #----------------------------------------------------------------------------- + + # Whether Repel uses the level of the first Pokémon in the party regardless of + # its HP (true), or it uses the level of the first unfainted Pokémon (false). + REPEL_COUNTS_FAINTED_POKEMON = (MECHANICS_GENERATION >= 6) + # Whether more abilities affect whether wild Pokémon appear, which Pokémon + # they are, etc. + MORE_ABILITIES_AFFECT_WILD_ENCOUNTERS = (MECHANICS_GENERATION >= 8) + # Whether shiny wild Pokémon are more likely to appear if the player has + # previously defeated/caught lots of other Pokémon of the same species. + HIGHER_SHINY_CHANCES_WITH_NUMBER_BATTLED = (MECHANICS_GENERATION >= 8) + # Whether overworld weather can set the default terrain effect in battle. + # Storm weather sets Electric Terrain, and fog weather sets Misty Terrain. + OVERWORLD_WEATHER_SETS_BATTLE_TERRAIN = (MECHANICS_GENERATION >= 8) + + #----------------------------------------------------------------------------- + # Game Switches + #----------------------------------------------------------------------------- # The Game Switch that is set to ON when the player blacks out. STARTING_OVER_SWITCH = 1 @@ -331,7 +385,9 @@ module Settings # with it. DISABLE_BOX_LINK_SWITCH = 35 - #============================================================================= + #----------------------------------------------------------------------------- + # Overworld animation IDs + #----------------------------------------------------------------------------- # ID of the animation played when the player steps on grass (grass rustling). GRASS_ANIMATION_ID = 1 @@ -354,16 +410,9 @@ module Settings # is on the map (for new plant growth mechanics only). PLANT_SPARKLE_ANIMATION_ID = 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 - - #============================================================================= + #----------------------------------------------------------------------------- + # Languages + #----------------------------------------------------------------------------- # An array of available languages in the game. Each one is an array containing # the display name of the language in-game, and that language's filename @@ -375,7 +424,22 @@ module Settings # ["Deutsch", "deutsch"] ] - #============================================================================= + #----------------------------------------------------------------------------- + # Screen size and zoom + #----------------------------------------------------------------------------- + + # The default screen width (at a scale of 1.0). You should also edit the + # property "defScreenW" in mkxp.json to match. + SCREEN_WIDTH = 512 + # The default screen height (at a scale of 1.0). You should also edit the + # property "defScreenH" in mkxp.json to match. + SCREEN_HEIGHT = 384 + # The default screen scale factor. Possible values are 0.5, 1.0, 1.5 and 2.0. + SCREEN_SCALE = 1.0 + + #----------------------------------------------------------------------------- + # Messages + #----------------------------------------------------------------------------- # Available speech frames. These are graphic files in "Graphics/Windowskins/". SPEECH_WINDOWSKINS = [ @@ -401,7 +465,6 @@ module Settings "speech hgss 20", "speech pl 18" ] - # Available menu frames. These are graphic files in "Graphics/Windowskins/". MENU_WINDOWSKINS = [ "choice 1", @@ -434,38 +497,23 @@ module Settings "choice 28" ] - #============================================================================= - - # Your game's credits, in an array. You can allow certain lines to be - # translated by wrapping them in _INTL() as shown. Blank lines are just "". - # To split a line into two columns, put "" in it. Plugin credits and - # Essentials engine credits are added to the end of these credits - # automatically. - def self.game_credits - return [ - _INTL("My Game by:"), - "Maruno", - "", - _INTL("Also involved were:"), - "A. Lee UssAnne O'Nymus", - "Ecksam PellJane Doe", - "Joe DanNick Nayme", - "Sue Donnim", - "", - _INTL("Special thanks to:"), - "Pizza" - ] - end - - #============================================================================= + #----------------------------------------------------------------------------- + # Debug helpers + #----------------------------------------------------------------------------- # Whether the game will ask you if you want to fully compile every time you # start the game (in Debug mode). You will not need to hold Ctrl/Shift to # compile anything. - PROMPT_TO_COMPILE = false + PROMPT_TO_COMPILE = false + # Whether the game will skip the Continue/New Game screen and go straight into + # a saved game (if there is one) or start a new game (if there isn't). Only + # applies to playing in Debug mode. + SKIP_CONTINUE_SCREEN = false end +#=============================================================================== # DO NOT EDIT THESE! +#=============================================================================== module Essentials VERSION = "21.1" ERROR_TEXT = "" diff --git a/Data/Scripts/002_BattleSettings.rb b/Data/Scripts/002_BattleSettings.rb index e78560afa..ba84e8f3b 100644 --- a/Data/Scripts/002_BattleSettings.rb +++ b/Data/Scripts/002_BattleSettings.rb @@ -1,4 +1,11 @@ +#=============================================================================== +# +#=============================================================================== module Settings + #----------------------------------------------------------------------------- + # Turn order and disobedience + #----------------------------------------------------------------------------- + # 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. @@ -10,22 +17,44 @@ module Settings # Whether foreign Pokémon can disobey the player's commands if the Pokémon is # too high a level compared to the number of Gym Badges the player has. FOREIGN_HIGH_LEVEL_POKEMON_CAN_DISOBEY = true + + #----------------------------------------------------------------------------- + # Mega Evolution + #----------------------------------------------------------------------------- + + # The Game Switch which, while ON, prevents all Pokémon in battle from Mega + # Evolving even if they otherwise could. + NO_MEGA_EVOLUTION = 34 + + #----------------------------------------------------------------------------- + # Move usage calculations + #----------------------------------------------------------------------------- + # 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) + MOVE_CATEGORY_PER_MOVE = (MECHANICS_GENERATION >= 4) # 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) - - #============================================================================= - + 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) + MORE_TYPE_EFFECTS = (MECHANICS_GENERATION >= 6) + # The minimum number of Gym 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 + + #----------------------------------------------------------------------------- + # Ability and item effects + #----------------------------------------------------------------------------- + # 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 @@ -38,7 +67,9 @@ module Settings # raises the holder's Special Attack and Special Defense by 50% (false). SOUL_DEW_POWERS_UP_TYPES = (MECHANICS_GENERATION >= 7) - #============================================================================= + #----------------------------------------------------------------------------- + # Affection + #----------------------------------------------------------------------------- # Whether Pokémon with high happiness will gain more Exp from battles, have a # chance of avoiding/curing negative effects by themselves, resisting @@ -50,51 +81,44 @@ module Settings # 179. Also lowers the happiness evolution threshold to 160. APPLY_HAPPINESS_SOFT_CAP = AFFECTION_EFFECTS - #============================================================================= + #----------------------------------------------------------------------------- + # Capturing Pokémon + #----------------------------------------------------------------------------- - # 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 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 >= 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 Exp gained from beating a Pokémon is multiplied by 1.5 if that - # Pokémon is owned by another trainer. - MORE_EXP_FROM_TRAINER_POKEMON = (MECHANICS_GENERATION <= 6) - # Whether a Pokémon holding a Power item gains 8 (true) or 4 (false) EVs in - # the relevant stat. - MORE_EVS_FROM_POWER_ITEMS = (MECHANICS_GENERATION >= 7) # Whether the critical capture mechanic applies. Note that its calculation 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) # Whether the player is asked what to do with a newly caught Pokémon if their # party is full. If true, the player can toggle whether they are asked this in # the Options screen. NEW_CAPTURE_CAN_REPLACE_PARTY_MEMBER = (MECHANICS_GENERATION >= 7) - #============================================================================= + #----------------------------------------------------------------------------- + # Exp and EV gain + #----------------------------------------------------------------------------- + + # 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 Exp gained from beating a Pokémon is multiplied by 1.5 if that + # Pokémon is owned by another trainer. + MORE_EXP_FROM_TRAINER_POKEMON = (MECHANICS_GENERATION <= 6) + # Whether a Pokémon holding a Power item gains 8 (true) or 4 (false) EVs in + # the relevant stat. + MORE_EVS_FROM_POWER_ITEMS = (MECHANICS_GENERATION >= 7) + # Whether Pokémon gain Exp for capturing a Pokémon. + GAIN_EXP_FOR_CAPTURE = (MECHANICS_GENERATION >= 6) + + #----------------------------------------------------------------------------- + # End of battle + #----------------------------------------------------------------------------- # 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). @@ -105,7 +129,9 @@ module Settings # Whether fainted Pokémon can try to evolve after a battle. CHECK_EVOLUTION_FOR_FAINTED_POKEMON = true - #============================================================================= + #----------------------------------------------------------------------------- + # AI + #----------------------------------------------------------------------------- # Whether wild Pokémon with the "Legendary", "Mythical" or "UltraBeast" flag # (as defined in pokemon.txt) have a smarter AI. Their skill level is set to diff --git a/Data/Scripts/007_Objects and windows/005_SpriteWindow_text.rb b/Data/Scripts/007_Objects and windows/005_SpriteWindow_text.rb index 94397150a..e8be64d69 100644 --- a/Data/Scripts/007_Objects and windows/005_SpriteWindow_text.rb +++ b/Data/Scripts/007_Objects and windows/005_SpriteWindow_text.rb @@ -529,6 +529,7 @@ class Window_AdvancedTextPokemon < SpriteWindow_Base delta_t = time_now - @display_last_updated @display_last_updated = time_now visiblelines = (self.height - self.borderY) / @lineHeight + @lastchar = -1 if !@lastchar show_more_characters = false # Pauses and new lines if @textchars[@curchar] == "\1" # Waiting @@ -550,7 +551,7 @@ class Window_AdvancedTextPokemon < SpriteWindow_Base show_more_characters = true end else # New line but the next line can be shown without scrolling to it - @linesdrawn += 1 + @linesdrawn += 1 if @lastchar < @curchar show_more_characters = true end elsif @curchar <= @numtextchars # Displaying more text @@ -562,6 +563,7 @@ class Window_AdvancedTextPokemon < SpriteWindow_Base @scroll_timer_start = nil @linesdrawn = 0 end + @lastchar = @curchar # Keep displaying more text if show_more_characters @display_timer += delta_t diff --git a/Data/Scripts/013_Items/008_PokemonBag.rb b/Data/Scripts/013_Items/008_PokemonBag.rb index f850103a4..bb50759bc 100644 --- a/Data/Scripts/013_Items/008_PokemonBag.rb +++ b/Data/Scripts/013_Items/008_PokemonBag.rb @@ -2,6 +2,7 @@ # The Bag object, which actually contains all the items. #=============================================================================== class PokemonBag + attr_reader :pockets attr_accessor :last_viewed_pocket attr_accessor :last_pocket_selections attr_reader :registered_items @@ -34,11 +35,6 @@ class PokemonBag (PokemonBag.pocket_count + 1).times { |i| @last_pocket_selections[i] = 0 } end - def pockets - rearrange - return @pockets - end - #----------------------------------------------------------------------------- # Gets the index of the current selected item in the pocket @@ -46,7 +42,6 @@ class PokemonBag if pocket <= 0 || pocket > PokemonBag.pocket_count raise ArgumentError.new(_INTL("Invalid pocket: {1}", pocket.inspect)) end - rearrange return [@last_pocket_selections[pocket], @pockets[pocket].length].min || 0 end @@ -55,7 +50,6 @@ class PokemonBag if pocket <= 0 || pocket > PokemonBag.pocket_count raise ArgumentError.new(_INTL("Invalid pocket: {1}", pocket.inspect)) end - rearrange @last_pocket_selections[pocket] = value if value <= @pockets[pocket].length end @@ -168,29 +162,6 @@ class PokemonBag def max_pocket_size(pocket) return Settings::BAG_MAX_POCKET_SIZE[pocket - 1] || -1 end - - def rearrange - return if @pockets.length == PokemonBag.pocket_count + 1 - @last_viewed_pocket = 1 - new_pockets = [] - @last_pocket_selections = [] - (PokemonBag.pocket_count + 1).times do |i| - new_pockets[i] = [] - @last_pocket_selections[i] = 0 - end - @pockets.each do |pocket| - next if !pocket - pocket.each do |item| - item_pocket = GameData::Item.get(item[0]).pocket - new_pockets[item_pocket].push(item) - end - end - new_pockets.each_with_index do |pocket, i| - next if i == 0 || !Settings::BAG_POCKET_AUTO_SORT[i - 1] - pocket.sort! { |a, b| GameData::Item.keys.index(a[0]) <=> GameData::Item.keys.index(b[0]) } - end - @pockets = new_pockets - end end #=============================================================================== diff --git a/Data/Scripts/016_UI/013_UI_Load.rb b/Data/Scripts/016_UI/013_UI_Load.rb index 9be8cda4f..225cad94a 100644 --- a/Data/Scripts/016_UI/013_UI_Load.rb +++ b/Data/Scripts/016_UI/013_UI_Load.rb @@ -279,6 +279,14 @@ class PokemonLoadScreen end def pbStartLoadScreen + if $DEBUG && !FileTest.exist?("Game.rgssad") && Settings::SKIP_CONTINUE_SCREEN + if @save_data.empty? + Game.start_new + else + Game.load(@save_data) + end + return + end commands = [] cmd_continue = -1 cmd_new_game = -1