Moved all settings into module Settings

This commit is contained in:
Maruno17
2021-02-01 21:03:58 +00:00
parent 923844fdc7
commit 1209b804e9
88 changed files with 848 additions and 839 deletions
+253 -247
View File
@@ -4,155 +4,157 @@
# https://github.com/Maruno17/pokemon-essentials # # https://github.com/Maruno17/pokemon-essentials #
#==============================================================================# #==============================================================================#
# The generation that the battle system follows. Used throughout the battle module Settings
# scripts, and also by some other settings which are used in and out of battle # The generation that the battle system follows. Used throughout the battle
# (you can of course change those settings to suit your game). # scripts, and also by some other settings which are used in and out of battle
# Note that this isn't perfect. Essentials doesn't accurately replicate every # (you can of course change those settings to suit your game).
# single generation's mechanics. It's considered to be good enough. Only # Note that this isn't perfect. Essentials doesn't accurately replicate every
# generations 5 and later are reasonably supported. # single generation's mechanics. It's considered to be good enough. Only
MECHANICS_GENERATION = 7 # generations 5 and later are reasonably supported.
MECHANICS_GENERATION = 7
#=============================================================================== #===============================================================================
# The default screen width (at a scale of 1.0). # The default screen width (at a scale of 1.0).
SCREEN_WIDTH = 512 SCREEN_WIDTH = 512
# The default screen height (at a scale of 1.0). # The default screen height (at a scale of 1.0).
SCREEN_HEIGHT = 384 SCREEN_HEIGHT = 384
# The default screen scale factor. Possible values are 0.5, 1.0, 1.5 and 2.0. # The default screen scale factor. Possible values are 0.5, 1.0, 1.5 and 2.0.
SCREEN_SCALE = 1.0 SCREEN_SCALE = 1.0
# Map view mode (0=original, 1=custom, 2=perspective). # Map view mode (0=original, 1=custom, 2=perspective).
MAP_VIEW_MODE = 1 MAP_VIEW_MODE = 1
#=============================================================================== #===============================================================================
# The maximum level Pokémon can reach. # The maximum level Pokémon can reach.
MAXIMUM_LEVEL = 100 MAXIMUM_LEVEL = 100
# The level of newly hatched Pokémon. # The level of newly hatched Pokémon.
EGG_LEVEL = 1 EGG_LEVEL = 1
# The odds of a newly generated Pokémon being shiny (out of 65536). # The odds of a newly generated Pokémon being shiny (out of 65536).
SHINY_POKEMON_CHANCE = (MECHANICS_GENERATION >= 6) ? 16 : 8 SHINY_POKEMON_CHANCE = (MECHANICS_GENERATION >= 6) ? 16 : 8
# The odds of a wild Pokémon/bred egg having Pokérus (out of 65536). # The odds of a wild Pokémon/bred egg having Pokérus (out of 65536).
POKERUS_CHANCE = 3 POKERUS_CHANCE = 3
# Whether a bred baby Pokémon can inherit any TM/HM moves from its father. It # 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. # can never inherit TM/HM moves from its mother.
BREEDING_CAN_INHERIT_MACHINE_MOVES = (MECHANICS_GENERATION <= 5) BREEDING_CAN_INHERIT_MACHINE_MOVES = (MECHANICS_GENERATION <= 5)
# Whether a bred baby Pokémon can inherit egg moves from its mother. It can # Whether a bred baby Pokémon can inherit egg moves from its mother. It can
# always inherit egg moves from its father. # always inherit egg moves from its father.
BREEDING_CAN_INHERIT_EGG_MOVES_FROM_MOTHER = (MECHANICS_GENERATION >= 6) BREEDING_CAN_INHERIT_EGG_MOVES_FROM_MOTHER = (MECHANICS_GENERATION >= 6)
#=============================================================================== #===============================================================================
# The amount of money the player starts the game with. # The amount of money the player starts the game with.
INITIAL_MONEY = 3000 INITIAL_MONEY = 3000
# The maximum amount of money the player can have. # The maximum amount of money the player can have.
MAX_MONEY = 999_999 MAX_MONEY = 999_999
# The maximum number of Game Corner coins the player can have. # The maximum number of Game Corner coins the player can have.
MAX_COINS = 99_999 MAX_COINS = 99_999
# The maximum length, in characters, that the player's name can be. # The maximum length, in characters, that the player's name can be.
MAX_PLAYER_NAME_SIZE = 10 MAX_PLAYER_NAME_SIZE = 10
# The maximum number of Pokémon that can be in the party. # The maximum number of Pokémon that can be in the party.
MAX_PARTY_SIZE = 6 MAX_PARTY_SIZE = 6
#=============================================================================== #===============================================================================
# A set of arrays each containing a trainer type followed by a Global Variable # 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 # 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. # trainer type will be named as whatever is in that variable.
RIVAL_NAMES = [ RIVAL_NAMES = [
[:RIVAL1, 12], [:RIVAL1, 12],
[:RIVAL2, 12], [:RIVAL2, 12],
[:CHAMPION, 12] [:CHAMPION, 12]
] ]
#=============================================================================== #===============================================================================
# Whether outdoor maps should be shaded according to the time of day. # Whether outdoor maps should be shaded according to the time of day.
TIME_SHADING = true TIME_SHADING = true
#=============================================================================== #===============================================================================
# Whether poisoned Pokémon will lose HP while walking around in the field. # Whether poisoned Pokémon will lose HP while walking around in the field.
POISON_IN_FIELD = (MECHANICS_GENERATION <= 4) POISON_IN_FIELD = (MECHANICS_GENERATION <= 4)
# Whether poisoned Pokémon will faint while walking around in the field (true), # Whether poisoned Pokémon will faint while walking around in the field (true),
# or survive the poisoning with 1 HP (false). # or survive the poisoning with 1 HP (false).
POISON_FAINT_IN_FIELD = (MECHANICS_GENERATION <= 3) POISON_FAINT_IN_FIELD = (MECHANICS_GENERATION <= 3)
# Whether planted berries grow according to Gen 4 mechanics (true) or Gen 3 # Whether planted berries grow according to Gen 4 mechanics (true) or Gen 3
# mechanics (false). # mechanics (false).
NEW_BERRY_PLANTS = (MECHANICS_GENERATION >= 4) NEW_BERRY_PLANTS = (MECHANICS_GENERATION >= 4)
# Whether fishing automatically hooks the Pokémon (if false, there is a reaction # Whether fishing automatically hooks the Pokémon (if false, there is a reaction
# test first). # test first).
FISHING_AUTO_HOOK = false FISHING_AUTO_HOOK = false
# The ID of the common event that runs when the player starts fishing (runs # The ID of the common event that runs when the player starts fishing (runs
# instead of showing the casting animation). # instead of showing the casting animation).
FISHING_BEGIN_COMMON_EVENT = -1 FISHING_BEGIN_COMMON_EVENT = -1
# The ID of the common event that runs when the player stops fishing (runs # The ID of the common event that runs when the player stops fishing (runs
# instead of showing the reeling in animation). # instead of showing the reeling in animation).
FISHING_END_COMMON_EVENT = -1 FISHING_END_COMMON_EVENT = -1
#=============================================================================== #===============================================================================
# The number of steps allowed before a Safari Zone game is over (0=infinite). # The number of steps allowed before a Safari Zone game is over (0=infinite).
SAFARI_STEPS = 600 SAFARI_STEPS = 600
# The number of seconds a Bug Catching Contest lasts for (0=infinite). # The number of seconds a Bug Catching Contest lasts for (0=infinite).
BUG_CONTEST_TIME = 1200 BUG_CONTEST_TIME = 1200
#=============================================================================== #===============================================================================
# Pairs of map IDs, where the location signpost isn't shown when moving from one # 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 # of the maps in a pair to the other (and vice versa). Useful for single long
# routes/towns that are spread over multiple maps. # 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. # 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 # 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. # signpost anyway, so you don't need to list those maps here.
NO_SIGNPOSTS = [] NO_SIGNPOSTS = []
#=============================================================================== #===============================================================================
# Whether the badge restriction on using certain hidden moves is owning at least # 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). # a certain number of badges (true), or owning a particular badge (false).
FIELD_MOVES_COUNT_BADGES = true FIELD_MOVES_COUNT_BADGES = true
# Depending on FIELD_MOVES_COUNT_BADGES, either the number of badges required to # 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. # 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. # 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. # e.g. To require the second badge, put false and 1.
# To require at least 2 badges, put true and 2. # To require at least 2 badges, put true and 2.
BADGE_FOR_CUT = 1 BADGE_FOR_CUT = 1
BADGE_FOR_FLASH = 2 BADGE_FOR_FLASH = 2
BADGE_FOR_ROCKSMASH = 3 BADGE_FOR_ROCKSMASH = 3
BADGE_FOR_SURF = 4 BADGE_FOR_SURF = 4
BADGE_FOR_FLY = 5 BADGE_FOR_FLY = 5
BADGE_FOR_STRENGTH = 6 BADGE_FOR_STRENGTH = 6
BADGE_FOR_DIVE = 7 BADGE_FOR_DIVE = 7
BADGE_FOR_WATERFALL = 8 BADGE_FOR_WATERFALL = 8
#=============================================================================== #===============================================================================
# If a move taught by a TM/HM/TR replaces another move, this setting is whether # 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 # the machine's move retains the replaced move's PP (true) or whether the
# machine's move has full PP (false). # machine's move has full PP (false).
TAUGHT_MACHINES_KEEP_OLD_PP = (MECHANICS_GENERATION == 5) TAUGHT_MACHINES_KEEP_OLD_PP = (MECHANICS_GENERATION == 5)
# Whether Black/White Flute raise/lower the levels of wild Pokémon respectively # Whether Black/White Flute raise/lower the levels of wild Pokémon respectively
# (true) or lower/raise the wild encounter rate respectively (false). # (true) or lower/raise the wild encounter rate respectively (false).
FLUTES_CHANGE_WILD_ENCOUNTER_LEVELS = (MECHANICS_GENERATION >= 6) FLUTES_CHANGE_WILD_ENCOUNTER_LEVELS = (MECHANICS_GENERATION >= 6)
# Whether Repel uses the level of the first Pokémon in the party regardless of # 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) # its HP (true) or uses the level of the first unfainted Pokémon (false)
REPEL_COUNTS_FAINTED_POKEMON = (MECHANICS_GENERATION >= 6) REPEL_COUNTS_FAINTED_POKEMON = (MECHANICS_GENERATION >= 6)
# Whether Rage Candy Bar acts as a Full Heal (true) or a Potion (false). # Whether Rage Candy Bar acts as a Full Heal (true) or a Potion (false).
RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS = (MECHANICS_GENERATION >= 7) RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS = (MECHANICS_GENERATION >= 7)
#=============================================================================== #===============================================================================
# The name of the person who created the Pokémon storage system. # The name of the person who created the Pokémon storage system.
def pbStorageCreator def self.storage_creator_name
return _INTL("Bill") return _INTL("Bill")
end end
# The number of boxes in Pokémon storage. # The number of boxes in Pokémon storage.
NUM_STORAGE_BOXES = 30 NUM_STORAGE_BOXES = 30
#=============================================================================== #===============================================================================
# The names of each pocket of the Bag. Leave the first entry blank. # The names of each pocket of the Bag. Leave the first entry blank.
def pbPocketNames; return ["", def self.bag_pocket_names
return ["",
_INTL("Items"), _INTL("Items"),
_INTL("Medicine"), _INTL("Medicine"),
_INTL("Poké Balls"), _INTL("Poké Balls"),
@@ -161,67 +163,70 @@ def pbPocketNames; return ["",
_INTL("Mail"), _INTL("Mail"),
_INTL("Battle Items"), _INTL("Battle Items"),
_INTL("Key Items") _INTL("Key Items")
]; end ]
# The maximum number of slots per pocket (-1 means infinite number). Ignore the end
# first number (0). # The maximum number of slots per pocket (-1 means infinite number). Ignore the
BAG_MAX_POCKET_SIZE = [0, -1, -1, -1, -1, -1, -1, -1, -1] # first number (0).
# The maximum number of items each slot in the Bag can hold. BAG_MAX_POCKET_SIZE = [0, -1, -1, -1, -1, -1, -1, -1, -1]
BAG_MAX_PER_SLOT = 999 # The maximum number of items each slot in the Bag can hold.
# Whether each pocket in turn auto-sorts itself by item ID number. Ignore the BAG_MAX_PER_SLOT = 999
# first entry (the 0). # Whether each pocket in turn auto-sorts itself by item ID number. Ignore the
BAG_POCKET_AUTO_SORT = [0, false, false, false, true, true, false, false, false] # 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 # 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 # (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). # list to view if more than one is available (false).
USE_CURRENT_REGION_DEX = false USE_CURRENT_REGION_DEX = false
# The names of each Dex list in the game, in order and with National Dex at the # 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 # end. This is also the order that $PokemonGlobal.pokedexUnlocked is in, which
# records which Dexes have been unlocked (first is unlocked by default). # 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 # 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 # 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 # 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 # 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, # 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. # therefore its area map is whichever region the player is currently in.
def pbDexNames; return [ def self.pokedex_names
return [
[_INTL("Kanto Pokédex"), 0], [_INTL("Kanto Pokédex"), 0],
[_INTL("Johto Pokédex"), 1], [_INTL("Johto Pokédex"), 1],
_INTL("National Pokédex") _INTL("National Pokédex")
]; end ]
# Whether all forms of a given species will be immediately available to view in end
# the Pokédex so long as that species has been seen at all (true), or whether # Whether all forms of a given species will be immediately available to view in
# each form needs to be seen specifically before that form appears in the # the Pokédex so long as that species has been seen at all (true), or whether
# Pokédex (false). # each form needs to be seen specifically before that form appears in the
DEX_SHOWS_ALL_FORMS = false # Pokédex (false).
# An array of numbers, where each number is that of a Dex list (National Dex is DEX_SHOWS_ALL_FORMS = false
# -1). All Dex lists included here have the species numbers in them reduced by # An array of numbers, where each number is that of a Dex list (National Dex is
# 1, thus making the first listed species have a species number of 0 (e.g. # -1). All Dex lists included here have the species numbers in them reduced by
# Victini in Unova's Dex). # 1, thus making the first listed species have a species number of 0 (e.g.
DEXES_WITH_OFFSETS = [] # Victini in Unova's Dex).
DEXES_WITH_OFFSETS = []
#=============================================================================== #===============================================================================
# A set of arrays each containing details of a graphic to be shown on the region # 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: # map if appropriate. The values for each array are as follows:
# - Region number. # - Region number.
# - Global Switch; the graphic is shown if this is ON (non-wall maps only). # - Global Switch; the graphic is shown if this is ON (non-wall maps only).
# - X coordinate of the graphic on the map, in squares. # - X coordinate of the graphic on the map, in squares.
# - Y 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. # - Name of the graphic, found in the Graphics/Pictures folder.
# - The graphic will always (true) or never (false) be shown on a wall map. # - The graphic will always (true) or never (false) be shown on a wall map.
REGION_MAP_EXTRAS = [ REGION_MAP_EXTRAS = [
[0, 51, 16, 15, "mapHiddenBerth", false], [0, 51, 16, 15, "mapHiddenBerth", false],
[0, 52, 20, 14, "mapHiddenFaraday", 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 # A list of maps used by roaming Pokémon. Each map has an array of other maps it
# can lead to. # can lead to.
ROAMING_AREAS = { ROAMING_AREAS = {
5 => [ 21, 28, 31, 39, 41, 44, 47, 66, 69], 5 => [ 21, 28, 31, 39, 41, 44, 47, 66, 69],
21 => [5, 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], 28 => [5, 21, 31, 39, 41, 44, 47, 66, 69],
@@ -232,17 +237,17 @@ ROAMING_AREAS = {
47 => [5, 21, 28, 31, 39, 41, 44, 66, 69], 47 => [5, 21, 28, 31, 39, 41, 44, 66, 69],
66 => [5, 21, 28, 31, 39, 41, 44, 47, 69], 66 => [5, 21, 28, 31, 39, 41, 44, 47, 69],
69 => [5, 21, 28, 31, 39, 41, 44, 47, 66 ] 69 => [5, 21, 28, 31, 39, 41, 44, 47, 66 ]
} }
# A set of arrays each containing the details of a roaming Pokémon. The # A set of arrays each containing the details of a roaming Pokémon. The
# information within is as follows: # information within is as follows:
# - Species. # - Species.
# - Level. # - Level.
# - Global Switch; the Pokémon roams while this is ON. # - Global Switch; the Pokémon roams while this is ON.
# - Encounter type (0=any, 1=grass/walking in cave, 2=surfing, 3=fishing, # - Encounter type (0=any, 1=grass/walking in cave, 2=surfing, 3=fishing,
# 4=surfing/fishing). See bottom of PField_RoamingPokemon for lists. # 4=surfing/fishing). See bottom of PField_RoamingPokemon for lists.
# - Name of BGM to play for that encounter (optional). # - 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).
ROAMING_SPECIES = [ ROAMING_SPECIES = [
[:LATIAS, 30, 53, 0, "Battle roaming"], [:LATIAS, 30, 53, 0, "Battle roaming"],
[:LATIOS, 30, 53, 0, "Battle roaming"], [:LATIOS, 30, 53, 0, "Battle roaming"],
[:KYOGRE, 40, 54, 2, nil, { [:KYOGRE, 40, 54, 2, nil, {
@@ -252,74 +257,74 @@ ROAMING_SPECIES = [
69 => [ 21, 31 ] 69 => [ 21, 31 ]
}], }],
[:ENTEI, 40, 55, 1, nil] [:ENTEI, 40, 55, 1, nil]
] ]
#=============================================================================== #===============================================================================
# A set of arrays each containing details of a wild encounter that can only # 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: # occur via using the Poké Radar. The information within is as follows:
# - Map ID on which this encounter can occur. # - Map ID on which this encounter can occur.
# - Probability that this encounter will occur (as a percentage). # - Probability that this encounter will occur (as a percentage).
# - Species. # - Species.
# - Minimum possible level. # - Minimum possible level.
# - Maximum possible level (optional). # - Maximum possible level (optional).
POKE_RADAR_ENCOUNTERS = [ POKE_RADAR_ENCOUNTERS = [
[5, 20, :STARLY, 12, 15], [5, 20, :STARLY, 12, 15],
[21, 10, :STANTLER, 14], [21, 10, :STANTLER, 14],
[28, 20, :BUTTERFREE, 15, 18], [28, 20, :BUTTERFREE, 15, 18],
[28, 20, :BEEDRILL, 15, 18] [28, 20, :BEEDRILL, 15, 18]
] ]
#=============================================================================== #===============================================================================
# The Game Switch that is set to ON when the player blacks out. # The Game Switch that is set to ON when the player blacks out.
STARTING_OVER_SWITCH = 1 STARTING_OVER_SWITCH = 1
# The Game Switch that is set to ON when the player has seen Pokérus in the Poké # 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. # Center, and doesn't need to be told about it again.
SEEN_POKERUS_SWITCH = 2 SEEN_POKERUS_SWITCH = 2
# The Game Switch which, while ON, makes all wild Pokémon created be shiny. # The Game Switch which, while ON, makes all wild Pokémon created be shiny.
SHINY_WILD_POKEMON_SWITCH = 31 SHINY_WILD_POKEMON_SWITCH = 31
# The Game Switch which, while ON, makes all Pokémon created considered to be # The Game Switch which, while ON, makes all Pokémon created considered to be
# met via a fateful encounter. # met via a fateful encounter.
FATEFUL_ENCOUNTER_SWITCH = 32 FATEFUL_ENCOUNTER_SWITCH = 32
#=============================================================================== #===============================================================================
# ID of the animation played when the player steps on grass (grass rustling). # ID of the animation played when the player steps on grass (grass rustling).
GRASS_ANIMATION_ID = 1 GRASS_ANIMATION_ID = 1
# ID of the animation played when the player lands on the ground after hopping # ID of the animation played when the player lands on the ground after hopping
# over a ledge (shows a dust impact). # over a ledge (shows a dust impact).
DUST_ANIMATION_ID = 2 DUST_ANIMATION_ID = 2
# ID of the animation played when a trainer notices the player (an exclamation # ID of the animation played when a trainer notices the player (an exclamation
# bubble). # bubble).
EXCLAMATION_ANIMATION_ID = 3 EXCLAMATION_ANIMATION_ID = 3
# ID of the animation played when a patch of grass rustles due to using the Poké # ID of the animation played when a patch of grass rustles due to using the Poké
# Radar. # Radar.
RUSTLE_NORMAL_ANIMATION_ID = 1 RUSTLE_NORMAL_ANIMATION_ID = 1
# ID of the animation played when a patch of grass rustles vigorously due to # ID of the animation played when a patch of grass rustles vigorously due to
# using the Poké Radar. (Rarer species) # using the Poké Radar. (Rarer species)
RUSTLE_VIGOROUS_ANIMATION_ID = 5 RUSTLE_VIGOROUS_ANIMATION_ID = 5
# ID of the animation played when a patch of grass rustles and shines due to # ID of the animation played when a patch of grass rustles and shines due to
# using the Poké Radar. (Shiny encounter) # using the Poké Radar. (Shiny encounter)
RUSTLE_SHINY_ANIMATION_ID = 6 RUSTLE_SHINY_ANIMATION_ID = 6
# ID of the animation played when a berry tree grows a stage while the player is # 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). # on the map (for new plant growth mechanics only).
PLANT_SPARKLE_ANIMATION_ID = 7 PLANT_SPARKLE_ANIMATION_ID = 7
#=============================================================================== #===============================================================================
# An array of available languages in the game, and their corresponding message # 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 # file in the Data folder. Edit only if you have 2 or more languages to choose
# from. # from.
LANGUAGES = [ LANGUAGES = [
# ["English", "english.dat"], # ["English", "english.dat"],
# ["Deutsch", "deutsch.dat"] # ["Deutsch", "deutsch.dat"]
] ]
#=============================================================================== #===============================================================================
# Available speech frames. These are graphic files in "Graphics/Windowskins/". # Available speech frames. These are graphic files in "Graphics/Windowskins/".
$SpeechFrames = [ SPEECH_WINDOWSKINS = [
"speech hgss 1", "speech hgss 1",
"speech hgss 2", "speech hgss 2",
"speech hgss 3", "speech hgss 3",
@@ -341,10 +346,10 @@ $SpeechFrames = [
"speech hgss 19", "speech hgss 19",
"speech hgss 20", "speech hgss 20",
"speech pl 18" "speech pl 18"
] ]
# Available menu frames. These are graphic files in "Graphics/Windowskins/". # Available menu frames. These are graphic files in "Graphics/Windowskins/".
$TextFrames = [ MENU_WINDOWSKINS = [
"choice 1", "choice 1",
"choice 2", "choice 2",
"choice 3", "choice 3",
@@ -373,12 +378,13 @@ $TextFrames = [
"choice 26", "choice 26",
"choice 27", "choice 27",
"choice 28" "choice 28"
] ]
# Available fonts. Each one needs to be in its own array. # Available fonts, as selectable in the Options Screen.
$VersionStyles = [ FONT_OPTIONS = [
["Power Green"], "Power Green",
["Power Red and Blue"], "Power Red and Blue",
["Power Red and Green"], "Power Red and Green",
["Power Clear"] "Power Clear"
] ]
end
@@ -19,7 +19,7 @@ end
def pbSetResizeFactor(factor) def pbSetResizeFactor(factor)
if !$ResizeInitialized if !$ResizeInitialized
Graphics.resize_screen(SCREEN_WIDTH, SCREEN_HEIGHT) Graphics.resize_screen(Settings::SCREEN_WIDTH, Settings::SCREEN_HEIGHT)
$ResizeInitialized = true $ResizeInitialized = true
end end
if factor < 0 || factor == 4 if factor < 0 || factor == 4
+70 -68
View File
@@ -1,76 +1,78 @@
# Whether a move's physical/special category depends on the move itself as in module Settings
# newer Gens (true), or on its type as in older Gens (false). # Whether a move's physical/special category depends on the move itself as in
MOVE_CATEGORY_PER_MOVE = (MECHANICS_GENERATION >= 4) # newer Gens (true), or on its type as in older Gens (false).
# Whether turn order is recalculated after a Pokémon Mega Evolves. MOVE_CATEGORY_PER_MOVE = (MECHANICS_GENERATION >= 4)
RECALCULATE_TURN_ORDER_AFTER_MEGA_EVOLUTION = (MECHANICS_GENERATION >= 7) # Whether turn order is recalculated after a Pokémon Mega Evolves.
# Whether turn order is recalculated after a Pokémon's Speed stat changes. RECALCULATE_TURN_ORDER_AFTER_MEGA_EVOLUTION = (MECHANICS_GENERATION >= 7)
RECALCULATE_TURN_ORDER_AFTER_SPEED_CHANGES = (MECHANICS_GENERATION >= 8) # Whether turn order is recalculated after a Pokémon's Speed stat changes.
# Whether critical hits do 1.5x damage and have 4 stages (true), or they do 2x RECALCULATE_TURN_ORDER_AFTER_SPEED_CHANGES = (MECHANICS_GENERATION >= 8)
# damage and have 5 stages as in Gen 5 (false). Also determines whether critical # Whether critical hits do 1.5x damage and have 4 stages (true), or they do 2x
# hit rate can be copied by Transform/Psych Up. # damage and have 5 stages as in Gen 5 (false). Also determines whether critical
NEW_CRITICAL_HIT_RATE_MECHANICS = (MECHANICS_GENERATION >= 6) # hit rate can be copied by Transform/Psych Up.
# Whether several effects apply relating to a Pokémon's type: NEW_CRITICAL_HIT_RATE_MECHANICS = (MECHANICS_GENERATION >= 6)
# * Electric-type immunity to paralysis # Whether several effects apply relating to a Pokémon's type:
# * Ghost-type immunity to being trapped # * Electric-type immunity to paralysis
# * Grass-type immunity to powder moves and Effect Spore # * Ghost-type immunity to being trapped
# * Poison-type Pokémon can't miss when using Toxic # * Grass-type immunity to powder moves and Effect Spore
MORE_TYPE_EFFECTS = (MECHANICS_GENERATION >= 6) # * Poison-type Pokémon can't miss when using Toxic
# Whether weather caused by an ability lasts 5 rounds (true) or forever (false). MORE_TYPE_EFFECTS = (MECHANICS_GENERATION >= 6)
FIXED_DURATION_WEATHER_FROM_ABILITY = (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 # Whether X items (X Attack, etc.) raise their stat by 2 stages (true) or 1
# (false). # (false).
X_STAT_ITEMS_RAISE_BY_TWO_STAGES = (MECHANICS_GENERATION >= 7) X_STAT_ITEMS_RAISE_BY_TWO_STAGES = (MECHANICS_GENERATION >= 7)
# Whether some Poké Balls have catch rate multipliers from Gen 7 (true) or from # Whether some Poké Balls have catch rate multipliers from Gen 7 (true) or from
# earlier generations (false). # earlier generations (false).
NEW_POKE_BALL_CATCH_RATES = (MECHANICS_GENERATION >= 7) NEW_POKE_BALL_CATCH_RATES = (MECHANICS_GENERATION >= 7)
# Whether Soul Dew powers up Psychic and Dragon-type moves by 20% (true) or # 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). # raises the holder's Special Attack and Special Defense by 50% (false).
SOUL_DEW_POWERS_UP_TYPES = (MECHANICS_GENERATION >= 7) SOUL_DEW_POWERS_UP_TYPES = (MECHANICS_GENERATION >= 7)
#=============================================================================== #===============================================================================
# The minimum number of badges required to boost each stat of a player's # The minimum number of badges required to boost each stat of a player's
# Pokémon by 1.1x, in battle only. # Pokémon by 1.1x, in battle only.
NUM_BADGES_BOOST_ATTACK = (MECHANICS_GENERATION >= 4) ? 999 : 1 NUM_BADGES_BOOST_ATTACK = (MECHANICS_GENERATION >= 4) ? 999 : 1
NUM_BADGES_BOOST_DEFENSE = (MECHANICS_GENERATION >= 4) ? 999 : 5 NUM_BADGES_BOOST_DEFENSE = (MECHANICS_GENERATION >= 4) ? 999 : 5
NUM_BADGES_BOOST_SPATK = (MECHANICS_GENERATION >= 4) ? 999 : 7 NUM_BADGES_BOOST_SPATK = (MECHANICS_GENERATION >= 4) ? 999 : 7
NUM_BADGES_BOOST_SPDEF = (MECHANICS_GENERATION >= 4) ? 999 : 7 NUM_BADGES_BOOST_SPDEF = (MECHANICS_GENERATION >= 4) ? 999 : 7
NUM_BADGES_BOOST_SPEED = (MECHANICS_GENERATION >= 4) ? 999 : 3 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 # 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 Ring item, just a Mega Stone held by their Pokémon).
MEGA_RINGS = [:MEGARING, :MEGABRACELET, :MEGACUFF, :MEGACHARM] MEGA_RINGS = [:MEGARING, :MEGABRACELET, :MEGACUFF, :MEGACHARM]
# The Game Switch which, while ON, prevents all Pokémon in battle from Mega # The Game Switch which, while ON, prevents all Pokémon in battle from Mega
# Evolving even if they otherwise could. # Evolving even if they otherwise could.
NO_MEGA_EVOLUTION = 34 NO_MEGA_EVOLUTION = 34
#=============================================================================== #===============================================================================
# Whether the Exp gained from beating a Pokémon should be scaled depending on # Whether the Exp gained from beating a Pokémon should be scaled depending on
# the gainer's level. # the gainer's level.
SCALED_EXP_FORMULA = (MECHANICS_GENERATION >= 5 && MECHANICS_GENERATION != 6) SCALED_EXP_FORMULA = (MECHANICS_GENERATION == 5 || MECHANICS_GENERATION >= 7)
# Whether the Exp gained from beating a Pokémon should be divided equally # Whether the Exp gained from beating a Pokémon should be divided equally
# between each participant (true), or whether each participant should gain that # 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 # much Exp (false). This also applies to Exp gained via the Exp Share (held item
# version) being distributed to all Exp Share holders. # version) being distributed to all Exp Share holders.
SPLIT_EXP_BETWEEN_GAINERS = (MECHANICS_GENERATION <= 5) SPLIT_EXP_BETWEEN_GAINERS = (MECHANICS_GENERATION <= 5)
# Whether the critical capture mechanic applies. Note that it is based on a # 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 # 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 # greatest critical capture chance of 2.5x), and there may be fewer species in
# your game. # your game.
ENABLE_CRITICAL_CAPTURES = (MECHANICS_GENERATION >= 5) ENABLE_CRITICAL_CAPTURES = (MECHANICS_GENERATION >= 5)
# Whether Pokémon gain Exp for capturing a Pokémon. # Whether Pokémon gain Exp for capturing a Pokémon.
GAIN_EXP_FOR_CAPTURE = (MECHANICS_GENERATION >= 6) GAIN_EXP_FOR_CAPTURE = (MECHANICS_GENERATION >= 6)
# The Game Switch which determines whether the player will lose money if they # 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). # lose a battle (they can still gain money from trainers for winning).
NO_MONEY_LOSS = 33 NO_MONEY_LOSS = 33
# Whether party Pokémon check whether they can evolve after all battles # 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). # regardless of the outcome (true) or only after battles the player won (false).
CHECK_EVOLUTION_AFTER_ALL_BATTLES = (MECHANICS_GENERATION >= 6) CHECK_EVOLUTION_AFTER_ALL_BATTLES = (MECHANICS_GENERATION >= 6)
# Whether fainted Pokémon can try to evolve after a battle. # Whether fainted Pokémon can try to evolve after a battle.
CHECK_EVOLUTION_FOR_FAINTED_POKEMON = (MECHANICS_GENERATION >= 6) CHECK_EVOLUTION_FOR_FAINTED_POKEMON = (MECHANICS_GENERATION >= 6)
end
@@ -74,7 +74,7 @@ class Sprite_Reflection
if @height>0 if @height>0
@sprite.color = Color.new(48,96,160,255) # Dark still water @sprite.color = Color.new(48,96,160,255) # Dark still water
@sprite.opacity = @rsprite.opacity @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 else
@sprite.color = Color.new(224,224,224,96) @sprite.color = Color.new(224,224,224,96)
@sprite.opacity = @rsprite.opacity*3/4 @sprite.opacity = @rsprite.opacity*3/4
@@ -33,11 +33,11 @@ end
class Spriteset_Map class Spriteset_Map
attr_reader :map attr_reader :map
attr_accessor :tilemap 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 @@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 @@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 @@viewport3.z = 500
def Spriteset_Map.viewport # For access by Spriteset_Global def Spriteset_Map.viewport # For access by Spriteset_Global
@@ -1,6 +1,6 @@
class Spriteset_Global class Spriteset_Global
attr_reader :playersprite 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 @@viewport2.z = 200
def initialize def initialize
@@ -572,10 +572,10 @@ class Interpreter
# * Change Windowskin # * Change Windowskin
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
def command_131 def command_131
for i in 0...$SpeechFrames.length for i in 0...Settings::SPEECH_WINDOWSKINS.length
next if $SpeechFrames[i] != @parameters[0] next if Settings::SPEECH_WINDOWSKINS[i] != @parameters[0]
$PokemonSystem.textskin = i $PokemonSystem.textskin = i
MessageConfig.pbSetSpeechFrame("Graphics/Windowskins/" + $SpeechFrames[i]) MessageConfig.pbSetSpeechFrame("Graphics/Windowskins/" + Settings::SPEECH_WINDOWSKINS[i])
return true return true
end end
return true return true
@@ -41,25 +41,25 @@ module MessageConfig
def self.pbDefaultSystemFrame def self.pbDefaultSystemFrame
begin begin
return pbResolveBitmap("Graphics/Windowskins/" + $TextFrames[$PokemonSystem.frame]) || "" return pbResolveBitmap("Graphics/Windowskins/" + Settings::MENU_WINDOWSKINS[$PokemonSystem.frame]) || ""
rescue rescue
return pbResolveBitmap("Graphics/Windowskins/" + $TextFrames[0]) || "" return pbResolveBitmap("Graphics/Windowskins/" + Settings::MENU_WINDOWSKINS[0]) || ""
end end
end end
def self.pbDefaultSpeechFrame def self.pbDefaultSpeechFrame
begin begin
return pbResolveBitmap("Graphics/Windowskins/" + $SpeechFrames[$PokemonSystem.textskin]) || "" return pbResolveBitmap("Graphics/Windowskins/" + Settings::SPEECH_WINDOWSKINS[$PokemonSystem.textskin]) || ""
rescue rescue
return pbResolveBitmap("Graphics/Windowskins/" + $SpeechFrames[0]) || "" return pbResolveBitmap("Graphics/Windowskins/" + Settings::SPEECH_WINDOWSKINS[0]) || ""
end end
end end
def self.pbDefaultSystemFontName def self.pbDefaultSystemFontName
begin begin
return MessageConfig.pbTryFonts($VersionStyles[$PokemonSystem.font][0], "Arial Narrow", "Arial") return MessageConfig.pbTryFonts(Settings::FONT_OPTIONS[$PokemonSystem.font], "Arial Narrow", "Arial")
rescue rescue
return MessageConfig.pbTryFonts($VersionStyles[0], "Arial Narrow", "Arial") return MessageConfig.pbTryFonts(Settings::FONT_OPTIONS[0], "Arial Narrow", "Arial")
end end
end end
@@ -123,7 +123,7 @@ module MessageConfig
end end
def self.pbSetSystemFontName(value) def self.pbSetSystemFontName(value)
@@systemFont=MessageConfig.pbTryFonts(value,"Arial Narrow","Arial") @@systemFont=MessageConfig.pbTryFonts([value],"Arial Narrow","Arial")
end end
def self.pbSetTextSpeed(value) def self.pbSetTextSpeed(value)
@@ -50,13 +50,13 @@ module GameData
def physical? def physical?
return false if @base_damage == 0 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? return GameData::Type.get(@type).physical?
end end
def special? def special?
return false if @base_damage == 0 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? return GameData::Type.get(@type).special?
end end
@@ -101,7 +101,7 @@ module GameData
def to_trainer def to_trainer
# Determine trainer's name # Determine trainer's name
tr_name = self.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) next if rival[0] != @trainer_type || !$game_variables[rival[1]].is_a?(String)
tr_name = $game_variables[rival[1]] tr_name = $game_variables[rival[1]]
break break
@@ -92,7 +92,7 @@ module PBExperience
# player's data) is loaded, so make sure they exist before using them, and # 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. # make this method return the most maximum ever level if they don't.
def self.maxLevel def self.maxLevel
return MAXIMUM_LEVEL return Settings::MAXIMUM_LEVEL
end end
# Erratic (600000): # Erratic (600000):
@@ -255,11 +255,11 @@ class PokeBattle_Battler
speedMult /= 2 if pbOwnSide.effects[PBEffects::Swamp]>0 speedMult /= 2 if pbOwnSide.effects[PBEffects::Swamp]>0
# Paralysis # Paralysis
if status==PBStatuses::PARALYSIS && !hasActiveAbility?(:QUICKFEET) if status==PBStatuses::PARALYSIS && !hasActiveAbility?(:QUICKFEET)
speedMult /= (MECHANICS_GENERATION >= 7) ? 2 : 4 speedMult /= (Settings::MECHANICS_GENERATION >= 7) ? 2 : 4
end end
# Badge multiplier # Badge multiplier
if @battle.internalBattle && pbOwnedByPlayer? && if @battle.internalBattle && pbOwnedByPlayer? &&
@battle.pbPlayer.badge_count >= NUM_BADGES_BOOST_SPEED @battle.pbPlayer.badge_count >= Settings::NUM_BADGES_BOOST_SPEED
speedMult *= 1.1 speedMult *= 1.1
end end
# Calculation # Calculation
@@ -524,11 +524,11 @@ class PokeBattle_Battler
def affectedByPowder?(showMsg=false) def affectedByPowder?(showMsg=false)
return false if fainted? 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 @battle.pbDisplay(_INTL("{1} is unaffected!",pbThis)) if showMsg
return false return false
end end
if MECHANICS_GENERATION >= 6 if Settings::MECHANICS_GENERATION >= 6
if hasActiveAbility?(:OVERCOAT) && !@battle.moldBreaker if hasActiveAbility?(:OVERCOAT) && !@battle.moldBreaker
if showMsg if showMsg
@battle.pbShowAbilitySplash(self) @battle.pbShowAbilitySplash(self)
@@ -137,7 +137,7 @@ class PokeBattle_Battler
self.form = newForm self.form = newForm
pbUpdate(true) pbUpdate(true)
@hp = @totalhp-oldDmg @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.pbChangePokemon(self,@pokemon)
@battle.scene.pbRefreshOne(@index) @battle.scene.pbRefreshOne(@index)
@battle.pbDisplay(msg) if msg && msg!="" @battle.pbDisplay(msg) if msg && msg!=""
@@ -275,7 +275,7 @@ class PokeBattle_Battler
@spdef = target.spdef @spdef = target.spdef
@speed = target.speed @speed = target.speed
PBStats.eachBattleStat { |s| @stages[s] = target.stages[s] } 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::FocusEnergy] = target.effects[PBEffects::FocusEnergy]
@effects[PBEffects::LaserFocus] = target.effects[PBEffects::LaserFocus] @effects[PBEffects::LaserFocus] = target.effects[PBEffects::LaserFocus]
end end
@@ -93,7 +93,7 @@ class PokeBattle_Battler
when PBStatuses::BURN when PBStatuses::BURN
hasImmuneType |= pbHasType?(:FIRE) hasImmuneType |= pbHasType?(:FIRE)
when PBStatuses::PARALYSIS when PBStatuses::PARALYSIS
hasImmuneType |= pbHasType?(:ELECTRIC) && MORE_TYPE_EFFECTS hasImmuneType |= pbHasType?(:ELECTRIC) && Settings::MORE_TYPE_EFFECTS
when PBStatuses::FROZEN when PBStatuses::FROZEN
hasImmuneType |= pbHasType?(:ICE) hasImmuneType |= pbHasType?(:ICE)
end end
@@ -189,7 +189,7 @@ class PokeBattle_Battler
when PBStatuses::BURN when PBStatuses::BURN
hasImmuneType |= pbHasType?(:FIRE) hasImmuneType |= pbHasType?(:FIRE)
when PBStatuses::PARALYSIS when PBStatuses::PARALYSIS
hasImmuneType |= pbHasType?(:ELECTRIC) && MORE_TYPE_EFFECTS hasImmuneType |= pbHasType?(:ELECTRIC) && Settings::MORE_TYPE_EFFECTS
end end
return false if hasImmuneType return false if hasImmuneType
# Ability immunity # Ability immunity
@@ -61,7 +61,7 @@ class PokeBattle_Battler
} }
@battle.pbJudge @battle.pbJudge
# Update priority order # Update priority order
@battle.pbCalculatePriority if RECALCULATE_TURN_ORDER_AFTER_SPEED_CHANGES @battle.pbCalculatePriority if Settings::RECALCULATE_TURN_ORDER_AFTER_SPEED_CHANGES
return true return true
end end
@@ -253,7 +253,7 @@ class PokeBattle_Battler
else else
@battle.pbCommonAnimation("Confusion",self) @battle.pbCommonAnimation("Confusion",self)
@battle.pbDisplay(_INTL("{1} is confused!",pbThis)) @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)<threshold if @battle.pbRandom(100)<threshold
pbConfusionDamage(_INTL("It hurt itself in its confusion!")) pbConfusionDamage(_INTL("It hurt itself in its confusion!"))
@lastMoveFailed = true @lastMoveFailed = true
@@ -313,7 +313,7 @@ class PokeBattle_Battler
# Wide Guard # Wide Guard
if target.pbOwnSide.effects[PBEffects::WideGuard] && user.index!=target.index && if target.pbOwnSide.effects[PBEffects::WideGuard] && user.index!=target.index &&
PBTargets.multipleTargets?(move.pbTarget(user)) && PBTargets.multipleTargets?(move.pbTarget(user)) &&
(MECHANICS_GENERATION >= 7 || move.damagingMove?) (Settings::MECHANICS_GENERATION >= 7 || move.damagingMove?)
@battle.pbCommonAnimation("WideGuard",target) @battle.pbCommonAnimation("WideGuard",target)
@battle.pbDisplay(_INTL("Wide Guard protected {1}!",target.pbThis(true))) @battle.pbDisplay(_INTL("Wide Guard protected {1}!",target.pbThis(true)))
target.damageState.protected = true target.damageState.protected = true
@@ -408,7 +408,7 @@ class PokeBattle_Battler
return false return false
end end
# Dark-type immunity to moves made faster by Prankster # 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) target.pbHasType?(:DARK) && target.opposes?(user)
PBDebug.log("[Target immune] #{target.pbThis} is Dark-type and immune to Prankster-boosted moves") 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))) @battle.pbDisplay(_INTL("It doesn't affect {1}...",target.pbThis(true)))
@@ -442,12 +442,12 @@ class PokeBattle_Battler
end end
# Immunity to powder-based moves # Immunity to powder-based moves
if move.powderMove? 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") 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))) @battle.pbDisplay(_INTL("It doesn't affect {1}...",target.pbThis(true)))
return false return false
end end
if MECHANICS_GENERATION >= 6 if Settings::MECHANICS_GENERATION >= 6
if target.hasActiveAbility?(:OVERCOAT) && !@battle.moldBreaker if target.hasActiveAbility?(:OVERCOAT) && !@battle.moldBreaker
@battle.pbShowAbilitySplash(target) @battle.pbShowAbilitySplash(target)
if PokeBattle_SceneConstants::USE_ABILITY_SPLASH if PokeBattle_SceneConstants::USE_ABILITY_SPLASH
@@ -72,7 +72,7 @@ class PokeBattle_Battler
next if b.status!=PBStatuses::FROZEN next if b.status!=PBStatuses::FROZEN
# NOTE: Non-Fire-type moves that thaw the user will also thaw the # NOTE: Non-Fire-type moves that thaw the user will also thaw the
# target (in Gen 6+). # 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 b.pbCureStatus
end end
end end
@@ -71,7 +71,7 @@ class PokeBattle_Move
# NOTE: This method is only ever called while using a move (and also by the # NOTE: This method is only ever called while using a move (and also by the
# AI), so using @calcType here is acceptable. # AI), so using @calcType here is acceptable.
def physicalMove?(thisType=nil) def physicalMove?(thisType=nil)
return (@category==0) if MOVE_CATEGORY_PER_MOVE return (@category==0) if Settings::MOVE_CATEGORY_PER_MOVE
thisType ||= @calcType thisType ||= @calcType
thisType ||= @type thisType ||= @type
return true if !thisType 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 # NOTE: This method is only ever called while using a move (and also by the
# AI), so using @calcType here is acceptable. # AI), so using @calcType here is acceptable.
def specialMove?(thisType=nil) def specialMove?(thisType=nil)
return (@category==1) if MOVE_CATEGORY_PER_MOVE return (@category==1) if Settings::MOVE_CATEGORY_PER_MOVE
thisType ||= @calcType thisType ||= @calcType
thisType ||= @type thisType ||= @type
return false if !thisType return false if !thisType
@@ -132,7 +132,7 @@ class PokeBattle_Move
def nonLethal?(_user,_target); return false; end # For False Swipe def nonLethal?(_user,_target); return false; end # For False Swipe
def ignoresSubstitute?(user) # user is the Pokémon using this move 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 soundMove?
return true if user && user.hasActiveAbility?(:INFILTRATOR) return true if user && user.hasActiveAbility?(:INFILTRATOR)
end end
@@ -161,7 +161,7 @@ class PokeBattle_Move
def pbIsCritical?(user,target) def pbIsCritical?(user,target)
return false if target.pbOwnSide.effects[PBEffects::LuckyChant]>0 return false if target.pbOwnSide.effects[PBEffects::LuckyChant]>0
# Set up the critical hit ratios # 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 c = 0
# Ability effects that alter critical hit rate # Ability effects that alter critical hit rate
if c>=0 && user.abilityActive? if c>=0 && user.abilityActive?
@@ -357,16 +357,16 @@ class PokeBattle_Move
# Badge multipliers # Badge multipliers
if @battle.internalBattle if @battle.internalBattle
if user.pbOwnedByPlayer? 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 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 multipliers[:attack_multiplier] *= 1.1
end end
end end
if target.pbOwnedByPlayer? 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 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 multipliers[:defense_multiplier] *= 1.1
end end
end end
@@ -396,7 +396,7 @@ class PokeBattle_Move
end end
# Critical hits # Critical hits
if target.damageState.critical if target.damageState.critical
if NEW_CRITICAL_HIT_RATE_MECHANICS if Settings::NEW_CRITICAL_HIT_RATE_MECHANICS
multipliers[:final_damage_multiplier] *= 1.5 multipliers[:final_damage_multiplier] *= 1.5
else else
multipliers[:final_damage_multiplier] *= 2 multipliers[:final_damage_multiplier] *= 2
@@ -461,7 +461,7 @@ class PokeBattle_Move
def pbAdditionalEffectChance(user,target,effectChance=0) def pbAdditionalEffectChance(user,target,effectChance=0)
return 0 if target.hasActiveAbility?(:SHIELDDUST) && !@battle.moldBreaker return 0 if target.hasActiveAbility?(:SHIELDDUST) && !@battle.moldBreaker
ret = (effectChance>0) ? effectChance : @addlEffect 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) || ret *= 2 if user.hasActiveAbility?(:SERENEGRACE) ||
user.pbOwnSide.effects[PBEffects::Rainbow]>0 user.pbOwnSide.effects[PBEffects::Rainbow]>0
end end
@@ -555,7 +555,7 @@ class PokeBattle_ProtectMove < PokeBattle_Move
@battle.pbDisplay(_INTL("But it failed!")) @battle.pbDisplay(_INTL("But it failed!"))
return true return true
end end
if (!@sidedEffect || MECHANICS_GENERATION <= 5) && if (!@sidedEffect || Settings::MECHANICS_GENERATION <= 5) &&
user.effects[PBEffects::ProtectRate]>1 && user.effects[PBEffects::ProtectRate]>1 &&
@battle.pbRandom(user.effects[PBEffects::ProtectRate])!=0 @battle.pbRandom(user.effects[PBEffects::ProtectRate])!=0
user.effects[PBEffects::ProtectRate] = 1 user.effects[PBEffects::ProtectRate] = 1
@@ -575,7 +575,7 @@ class PokeBattle_ProtectMove < PokeBattle_Move
else else
user.effects[@effect] = true user.effects[@effect] = true
end end
user.effects[PBEffects::ProtectRate] *= (MECHANICS_GENERATION >= 6) ? 3 : 2 user.effects[PBEffects::ProtectRate] *= (Settings::MECHANICS_GENERATION >= 6) ? 3 : 2
pbProtectMessage(user) pbProtectMessage(user)
end end
@@ -32,7 +32,7 @@ end
#=============================================================================== #===============================================================================
class PokeBattle_Move_003 < PokeBattle_SleepMove class PokeBattle_Move_003 < PokeBattle_SleepMove
def pbMoveFailed?(user,targets) 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 if !user.isSpecies?(:DARKRAI) && user.effects[PBEffects::TransformSpecies] != :DARKRAI
@battle.pbDisplay(_INTL("But {1} can't use the move!",user.pbThis)) @battle.pbDisplay(_INTL("But {1} can't use the move!",user.pbThis))
return true return true
@@ -93,7 +93,7 @@ class PokeBattle_Move_006 < PokeBattle_PoisonMove
end end
def pbOverrideSuccessCheckPerHit(user,target) def pbOverrideSuccessCheckPerHit(user,target)
return (MORE_TYPE_EFFECTS && statusMove? && user.pbHasType?(:POISON)) return (Settings::MORE_TYPE_EFFECTS && statusMove? && user.pbHasType?(:POISON))
end end
end end
@@ -107,7 +107,7 @@ end
class PokeBattle_Move_007 < PokeBattle_ParalysisMove class PokeBattle_Move_007 < PokeBattle_ParalysisMove
def tramplesMinimize?(param=1) def tramplesMinimize?(param=1)
# Perfect accuracy and double damage (for Body Slam only) # 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 return super
end end
@@ -241,8 +241,8 @@ end
#=============================================================================== #===============================================================================
class PokeBattle_Move_010 < PokeBattle_FlinchMove class PokeBattle_Move_010 < PokeBattle_FlinchMove
def tramplesMinimize?(param=1) def tramplesMinimize?(param=1)
return super if @id == :DRAGONRUSH && MECHANICS_GENERATION <= 5 return super if @id == :DRAGONRUSH && Settings::MECHANICS_GENERATION <= 5
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 true if param==2 # Double damage
return super return super
end end
@@ -1254,7 +1254,7 @@ end
class PokeBattle_Move_048 < PokeBattle_TargetStatDownMove class PokeBattle_Move_048 < PokeBattle_TargetStatDownMove
def initialize(battle,move) def initialize(battle,move)
super super
@statDown = [PBStats::EVASION,(MECHANICS_GENERATION >= 6) ? 2 : 1] @statDown = [PBStats::EVASION, (Settings::MECHANICS_GENERATION >= 6) ? 2 : 1]
end end
end end
@@ -1284,12 +1284,12 @@ class PokeBattle_Move_049 < PokeBattle_TargetStatDownMove
targetSide.effects[PBEffects::Spikes]>0 || targetSide.effects[PBEffects::Spikes]>0 ||
targetSide.effects[PBEffects::ToxicSpikes]>0 || targetSide.effects[PBEffects::ToxicSpikes]>0 ||
targetSide.effects[PBEffects::StickyWeb] targetSide.effects[PBEffects::StickyWeb]
return false if MECHANICS_GENERATION >= 6 && return false if Settings::MECHANICS_GENERATION >= 6 &&
(targetOpposingSide.effects[PBEffects::StealthRock] || (targetOpposingSide.effects[PBEffects::StealthRock] ||
targetOpposingSide.effects[PBEffects::Spikes]>0 || targetOpposingSide.effects[PBEffects::Spikes]>0 ||
targetOpposingSide.effects[PBEffects::ToxicSpikes]>0 || targetOpposingSide.effects[PBEffects::ToxicSpikes]>0 ||
targetOpposingSide.effects[PBEffects::StickyWeb]) targetOpposingSide.effects[PBEffects::StickyWeb])
return false if MECHANICS_GENERATION >= 8 && return false if Settings::MECHANICS_GENERATION >= 8 &&
@battle.field.terrain != PBBattleTerrains::None @battle.field.terrain != PBBattleTerrains::None
return super return super
end end
@@ -1319,34 +1319,34 @@ class PokeBattle_Move_049 < PokeBattle_TargetStatDownMove
@battle.pbDisplay(_INTL("{1} is no longer protected by Safeguard!!",target.pbTeam)) @battle.pbDisplay(_INTL("{1} is no longer protected by Safeguard!!",target.pbTeam))
end end
if target.pbOwnSide.effects[PBEffects::StealthRock] || if target.pbOwnSide.effects[PBEffects::StealthRock] ||
(MECHANICS_GENERATION >= 6 && (Settings::MECHANICS_GENERATION >= 6 &&
target.pbOpposingSide.effects[PBEffects::StealthRock]) target.pbOpposingSide.effects[PBEffects::StealthRock])
target.pbOwnSide.effects[PBEffects::StealthRock] = false 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)) @battle.pbDisplay(_INTL("{1} blew away stealth rocks!",user.pbThis))
end end
if target.pbOwnSide.effects[PBEffects::Spikes]>0 || if target.pbOwnSide.effects[PBEffects::Spikes]>0 ||
(MECHANICS_GENERATION >= 6 && (Settings::MECHANICS_GENERATION >= 6 &&
target.pbOpposingSide.effects[PBEffects::Spikes]>0) target.pbOpposingSide.effects[PBEffects::Spikes]>0)
target.pbOwnSide.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)) @battle.pbDisplay(_INTL("{1} blew away spikes!",user.pbThis))
end end
if target.pbOwnSide.effects[PBEffects::ToxicSpikes]>0 || if target.pbOwnSide.effects[PBEffects::ToxicSpikes]>0 ||
(MECHANICS_GENERATION >= 6 && (Settings::MECHANICS_GENERATION >= 6 &&
target.pbOpposingSide.effects[PBEffects::ToxicSpikes]>0) target.pbOpposingSide.effects[PBEffects::ToxicSpikes]>0)
target.pbOwnSide.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)) @battle.pbDisplay(_INTL("{1} blew away poison spikes!",user.pbThis))
end end
if target.pbOwnSide.effects[PBEffects::StickyWeb] || if target.pbOwnSide.effects[PBEffects::StickyWeb] ||
(MECHANICS_GENERATION >= 6 && (Settings::MECHANICS_GENERATION >= 6 &&
target.pbOpposingSide.effects[PBEffects::StickyWeb]) target.pbOpposingSide.effects[PBEffects::StickyWeb])
target.pbOwnSide.effects[PBEffects::StickyWeb] = false 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)) @battle.pbDisplay(_INTL("{1} blew away sticky webs!",user.pbThis))
end end
if MECHANICS_GENERATION >= 8 && @battle.field.terrain != PBBattleTerrains::None if Settings::MECHANICS_GENERATION >= 8 && @battle.field.terrain != PBBattleTerrains::None
case @battle.field.terrain case @battle.field.terrain
when PBBattleTerrains::Electric when PBBattleTerrains::Electric
@battle.pbDisplay(_INTL("The electricity disappeared from the battlefield.")) @battle.pbDisplay(_INTL("The electricity disappeared from the battlefield."))
@@ -1407,7 +1407,7 @@ class PokeBattle_Move_04D < PokeBattle_TargetStatDownMove
def initialize(battle,move) def initialize(battle,move)
super super
inc = 2 inc = 2
inc = 1 if @id == :STRINGSHOT && MECHANICS_GENERATION <= 5 inc = 1 if @id == :STRINGSHOT && Settings::MECHANICS_GENERATION <= 5
@statDown = [PBStats::SPEED,inc] @statDown = [PBStats::SPEED,inc]
end end
end end
@@ -1561,7 +1561,7 @@ class PokeBattle_Move_055 < PokeBattle_Move
def pbEffectAgainstTarget(user,target) def pbEffectAgainstTarget(user,target)
PBStats.eachBattleStat { |s| user.stages[s] = target.stages[s] } 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::FocusEnergy] = target.effects[PBEffects::FocusEnergy]
user.effects[PBEffects::LaserFocus] = target.effects[PBEffects::LaserFocus] user.effects[PBEffects::LaserFocus] = target.effects[PBEffects::LaserFocus]
end end
@@ -1796,7 +1796,7 @@ class PokeBattle_Move_05E < PokeBattle_Move
userTypes = user.pbTypes(true) userTypes = user.pbTypes(true)
@newTypes = [] @newTypes = []
user.eachMoveWithIndex do |m,i| 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 PBTypes.isPseudoType?(m.type)
next if userTypes.include?(m.type) next if userTypes.include?(m.type)
@newTypes.push(m.type) if !@newTypes.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) def pbFailsAgainstTarget?(user,target)
if !target.ability || if !target.ability ||
(user.ability == target.ability && MECHANICS_GENERATION <= 5) (user.ability == target.ability && Settings::MECHANICS_GENERATION <= 5)
@battle.pbDisplay(_INTL("But it failed!")) @battle.pbDisplay(_INTL("But it failed!"))
return true return true
end end
@@ -2371,7 +2371,7 @@ class PokeBattle_Move_070 < PokeBattle_FixedDamageMove
@battle.pbHideAbilitySplash(target) @battle.pbHideAbilitySplash(target)
return true return true
end 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!")) @battle.pbDisplay(_INTL("But it failed!"))
return true return true
end end
@@ -2380,7 +2380,7 @@ class PokeBattle_Move_070 < PokeBattle_FixedDamageMove
def pbAccuracyCheck(user,target) def pbAccuracyCheck(user,target)
acc = @accuracy+user.level-target.level 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)<acc return @battle.pbRandom(100)<acc
end end
@@ -2699,7 +2699,7 @@ end
# Burn's halving of Attack is negated (new mechanics). # Burn's halving of Attack is negated (new mechanics).
#=============================================================================== #===============================================================================
class PokeBattle_Move_07E < PokeBattle_Move class PokeBattle_Move_07E < PokeBattle_Move
def damageReducedByBurn?; return MECHANICS_GENERATION <= 5; end def damageReducedByBurn?; return Settings::MECHANICS_GENERATION <= 5; end
def pbBaseDamage(baseDmg,user,target) def pbBaseDamage(baseDmg,user,target)
baseDmg *= 2 if user.poisoned? || user.burned? || user.paralyzed? baseDmg *= 2 if user.poisoned? || user.burned? || user.paralyzed?
@@ -248,7 +248,7 @@ class PokeBattle_Move_090 < PokeBattle_Move
end end
def pbBaseDamage(baseDmg,user,target) def pbBaseDamage(baseDmg,user,target)
return super if MECHANICS_GENERATION >= 6 return super if Settings::MECHANICS_GENERATION >= 6
hp = pbHiddenPower(user) hp = pbHiddenPower(user)
return hp[1] return hp[1]
end end
@@ -272,7 +272,7 @@ def pbHiddenPower(pkmn)
idxType |= (iv[PBStats::SPDEF]&1)<<5 idxType |= (iv[PBStats::SPDEF]&1)<<5
idxType = (types.length-1)*idxType/63 idxType = (types.length-1)*idxType/63
type = types[idxType] type = types[idxType]
if MECHANICS_GENERATION <= 5 if Settings::MECHANICS_GENERATION <= 5
powerMin = 30 powerMin = 30
powerMax = 70 powerMax = 70
power |= (iv[PBStats::HP]&2)>>1 power |= (iv[PBStats::HP]&2)>>1
@@ -503,7 +503,7 @@ class PokeBattle_Move_096 < PokeBattle_Move
@damageArray.each do |dmg, items| @damageArray.each do |dmg, items|
next if !items.include?(heldItem) next if !items.include?(heldItem)
ret = dmg ret = dmg
ret += 20 if MECHANICS_GENERATION >= 6 ret += 20 if Settings::MECHANICS_GENERATION >= 6
break break
end end
return ret return ret
@@ -600,7 +600,7 @@ end
#=============================================================================== #===============================================================================
class PokeBattle_Move_09B < PokeBattle_Move class PokeBattle_Move_09B < PokeBattle_Move
def tramplesMinimize?(param=1) 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 return super
end end
@@ -646,7 +646,7 @@ end
#=============================================================================== #===============================================================================
class PokeBattle_Move_09D < PokeBattle_Move class PokeBattle_Move_09D < PokeBattle_Move
def pbMoveFailed?(user,targets) def pbMoveFailed?(user,targets)
if MECHANICS_GENERATION >= 6 if Settings::MECHANICS_GENERATION >= 6
if @battle.field.effects[PBEffects::MudSportField]>0 if @battle.field.effects[PBEffects::MudSportField]>0
@battle.pbDisplay(_INTL("But it failed!")) @battle.pbDisplay(_INTL("But it failed!"))
return true return true
@@ -662,7 +662,7 @@ class PokeBattle_Move_09D < PokeBattle_Move
end end
def pbEffectGeneral(user) def pbEffectGeneral(user)
if MECHANICS_GENERATION >= 6 if Settings::MECHANICS_GENERATION >= 6
@battle.field.effects[PBEffects::MudSportField] = 5 @battle.field.effects[PBEffects::MudSportField] = 5
else else
user.effects[PBEffects::MudSport] = true user.effects[PBEffects::MudSport] = true
@@ -678,7 +678,7 @@ end
#=============================================================================== #===============================================================================
class PokeBattle_Move_09E < PokeBattle_Move class PokeBattle_Move_09E < PokeBattle_Move
def pbMoveFailed?(user,targets) def pbMoveFailed?(user,targets)
if MECHANICS_GENERATION >= 6 if Settings::MECHANICS_GENERATION >= 6
if @battle.field.effects[PBEffects::WaterSportField]>0 if @battle.field.effects[PBEffects::WaterSportField]>0
@battle.pbDisplay(_INTL("But it failed!")) @battle.pbDisplay(_INTL("But it failed!"))
return true return true
@@ -694,7 +694,7 @@ class PokeBattle_Move_09E < PokeBattle_Move
end end
def pbEffectGeneral(user) def pbEffectGeneral(user)
if MECHANICS_GENERATION >= 6 if Settings::MECHANICS_GENERATION >= 6
@battle.field.effects[PBEffects::WaterSportField] = 5 @battle.field.effects[PBEffects::WaterSportField] = 5
else else
user.effects[PBEffects::WaterSport] = true user.effects[PBEffects::WaterSport] = true
@@ -1193,7 +1193,7 @@ class PokeBattle_Move_0AF < PokeBattle_Move
"133", # Hold Hands "133", # Hold Hands
"134" # Celebrate "134" # Celebrate
] ]
if MECHANICS_GENERATION >= 6 if Settings::MECHANICS_GENERATION >= 6
@moveBlacklist += [ @moveBlacklist += [
# Target-switching moves # Target-switching moves
"0EB", # Roar, Whirlwind "0EB", # Roar, Whirlwind
@@ -1325,7 +1325,7 @@ class PokeBattle_Move_0B3 < PokeBattle_Move
case @battle.environment case @battle.environment
when PBEnvironment::Grass, PBEnvironment::TallGrass, when PBEnvironment::Grass, PBEnvironment::TallGrass,
PBEnvironment::Forest, PBEnvironment::ForestGrass PBEnvironment::Forest, PBEnvironment::ForestGrass
if MECHANICS_GENERATION >= 6 if Settings::MECHANICS_GENERATION >= 6
@npMove = :ENERGYBALL if GameData::Move.exists?(:ENERGYBALL) @npMove = :ENERGYBALL if GameData::Move.exists?(:ENERGYBALL)
else else
@npMove = :SEEDBOMB if GameData::Move.exists?(:SEEDBOMB) @npMove = :SEEDBOMB if GameData::Move.exists?(:SEEDBOMB)
@@ -1335,25 +1335,25 @@ class PokeBattle_Move_0B3 < PokeBattle_Move
when PBEnvironment::Puddle when PBEnvironment::Puddle
@npMove = :MUDBOMB if GameData::Move.exists?(:MUDBOMB) @npMove = :MUDBOMB if GameData::Move.exists?(:MUDBOMB)
when PBEnvironment::Cave when PBEnvironment::Cave
if MECHANICS_GENERATION >= 6 if Settings::MECHANICS_GENERATION >= 6
@npMove = :POWERGEM if GameData::Move.exists?(:POWERGEM) @npMove = :POWERGEM if GameData::Move.exists?(:POWERGEM)
else else
@npMove = :ROCKSLIDE if GameData::Move.exists?(:ROCKSLIDE) @npMove = :ROCKSLIDE if GameData::Move.exists?(:ROCKSLIDE)
end end
when PBEnvironment::Rock when PBEnvironment::Rock
if MECHANICS_GENERATION >= 6 if Settings::MECHANICS_GENERATION >= 6
@npMove = :EARTHPOWER if GameData::Move.exists?(:EARTHPOWER) @npMove = :EARTHPOWER if GameData::Move.exists?(:EARTHPOWER)
else else
@npMove = :ROCKSLIDE if GameData::Move.exists?(:ROCKSLIDE) @npMove = :ROCKSLIDE if GameData::Move.exists?(:ROCKSLIDE)
end end
when PBEnvironment::Sand when PBEnvironment::Sand
if MECHANICS_GENERATION >= 6 if Settings::MECHANICS_GENERATION >= 6
@npMove = :EARTHPOWER if GameData::Move.exists?(:EARTHPOWER) @npMove = :EARTHPOWER if GameData::Move.exists?(:EARTHPOWER)
else else
@npMove = :EARTHQUAKE if GameData::Move.exists?(:EARTHQUAKE) @npMove = :EARTHQUAKE if GameData::Move.exists?(:EARTHQUAKE)
end end
when PBEnvironment::Snow when PBEnvironment::Snow
if MECHANICS_GENERATION >= 6 if Settings::MECHANICS_GENERATION >= 6
@npMove = :FROSTBREATH if GameData::Move.exists?(:FROSTBREATH) @npMove = :FROSTBREATH if GameData::Move.exists?(:FROSTBREATH)
else else
@npMove = :BLIZZARD if GameData::Move.exists?(:BLIZZARD) @npMove = :BLIZZARD if GameData::Move.exists?(:BLIZZARD)
@@ -1519,7 +1519,7 @@ class PokeBattle_Move_0B5 < PokeBattle_Move
"133", # Hold Hands "133", # Hold Hands
"134" # Celebrate "134" # Celebrate
] ]
if MECHANICS_GENERATION >= 6 if Settings::MECHANICS_GENERATION >= 6
@moveBlacklist += [ @moveBlacklist += [
# Moves that call other moves # Moves that call other moves
"0B3", # Nature Power "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. # NOTE: This includes the Pokémon of ally trainers in multi battles.
@battle.pbParty(user.index).each_with_index do |pkmn,i| @battle.pbParty(user.index).each_with_index do |pkmn,i|
next if !pkmn || i==user.pokemonIndex 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| pkmn.moves.each do |move|
next if @moveBlacklist.include?(move.function_code) next if @moveBlacklist.include?(move.function_code)
next if move.type == :SHADOW next if move.type == :SHADOW
@@ -1783,7 +1783,7 @@ class PokeBattle_Move_0BA < PokeBattle_Move
return true return true
end end
return true if pbMoveFailedAromaVeil?(user,target) return true if pbMoveFailedAromaVeil?(user,target)
if MECHANICS_GENERATION >= 6 && target.hasActiveAbility?(:OBLIVIOUS) && if Settings::MECHANICS_GENERATION >= 6 && target.hasActiveAbility?(:OBLIVIOUS) &&
!@battle.moldBreaker !@battle.moldBreaker
@battle.pbShowAbilitySplash(target) @battle.pbShowAbilitySplash(target)
if PokeBattle_SceneConstants::USE_ABILITY_SPLASH if PokeBattle_SceneConstants::USE_ABILITY_SPLASH
@@ -1848,7 +1848,7 @@ class PokeBattle_Move_0BC < PokeBattle_Move
# Moves that call other moves (see also below) # Moves that call other moves (see also below)
"0AE" # Mirror Move "0AE" # Mirror Move
] ]
if MECHANICS_GENERATION >= 7 if Settings::MECHANICS_GENERATION >= 7
@moveBlacklist += [ @moveBlacklist += [
# Moves that call other moves # Moves that call other moves
# "0AE", # Mirror Move # See above # "0AE", # Mirror Move # See above
@@ -2241,7 +2241,7 @@ class PokeBattle_Move_0CE < PokeBattle_TwoTurnMove
@battle.pbDisplay(_INTL("But it failed!")) @battle.pbDisplay(_INTL("But it failed!"))
return true return true
end 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!")) @battle.pbDisplay(_INTL("But it failed!"))
return true return true
end end
@@ -2291,7 +2291,7 @@ class PokeBattle_Move_0CF < PokeBattle_Move
return if target.effects[PBEffects::Trapping]>0 return if target.effects[PBEffects::Trapping]>0
# Set trapping effect duration and info # Set trapping effect duration and info
if user.hasActiveItem?(:GRIPCLAW) if user.hasActiveItem?(:GRIPCLAW)
target.effects[PBEffects::Trapping] = (MECHANICS_GENERATION >= 5) ? 8 : 6 target.effects[PBEffects::Trapping] = (Settings::MECHANICS_GENERATION >= 5) ? 8 : 6
else else
target.effects[PBEffects::Trapping] = 5+@battle.pbRandom(2) target.effects[PBEffects::Trapping] = 5+@battle.pbRandom(2)
end end
@@ -2654,7 +2654,7 @@ end
# User gains half the HP it inflicts as damage. # User gains half the HP it inflicts as damage.
#=============================================================================== #===============================================================================
class PokeBattle_Move_0DD < PokeBattle_Move 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) def pbEffectAgainstTarget(user,target)
return if target.damageState.hpLost<=0 return if target.damageState.hpLost<=0
@@ -2670,7 +2670,7 @@ end
# (Dream Eater) # (Dream Eater)
#=============================================================================== #===============================================================================
class PokeBattle_Move_0DE < PokeBattle_Move 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) def pbFailsAgainstTarget?(user,target)
if !target.asleep? if !target.asleep?
@@ -2905,7 +2905,7 @@ end
#=============================================================================== #===============================================================================
class PokeBattle_Move_0E7 < PokeBattle_Move class PokeBattle_Move_0E7 < PokeBattle_Move
def pbMoveFailed?(user,targets) 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!")) @battle.pbDisplay(_INTL("But it failed!"))
return true return true
end end
@@ -3150,7 +3150,7 @@ class PokeBattle_Move_0EF < PokeBattle_Move
@battle.pbDisplay(_INTL("But it failed!")) @battle.pbDisplay(_INTL("But it failed!"))
return true return true
end 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))) @battle.pbDisplay(_INTL("It doesn't affect {1}...",target.pbThis(true)))
return true return true
end end
@@ -3166,7 +3166,7 @@ class PokeBattle_Move_0EF < PokeBattle_Move
def pbAdditionalEffect(user,target) def pbAdditionalEffect(user,target)
return if target.fainted? || target.damageState.substitute return if target.fainted? || target.damageState.substitute
return if target.effects[PBEffects::MeanLook]>=0 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 target.effects[PBEffects::MeanLook] = user.index
@battle.pbDisplay(_INTL("{1} can no longer escape!",target.pbThis)) @battle.pbDisplay(_INTL("{1} can no longer escape!",target.pbThis))
end end
@@ -3180,7 +3180,7 @@ end
#=============================================================================== #===============================================================================
class PokeBattle_Move_0F0 < PokeBattle_Move class PokeBattle_Move_0F0 < PokeBattle_Move
def pbBaseDamage(baseDmg,user,target) def pbBaseDamage(baseDmg,user,target)
if MECHANICS_GENERATION >= 6 && if Settings::MECHANICS_GENERATION >= 6 &&
target.item && !target.unlosableItem?(target.item) target.item && !target.unlosableItem?(target.item)
# NOTE: Damage is still boosted even if target has Sticky Hold or a # NOTE: Damage is still boosted even if target has Sticky Hold or a
# substitute. # substitute.
@@ -3306,7 +3306,7 @@ end
#=============================================================================== #===============================================================================
class PokeBattle_Move_0F3 < PokeBattle_Move class PokeBattle_Move_0F3 < PokeBattle_Move
def ignoresSubstitute?(user) def ignoresSubstitute?(user)
return true if MECHANICS_GENERATION >= 6 return true if Settings::MECHANICS_GENERATION >= 6
return super return super
end end
@@ -3370,7 +3370,7 @@ class PokeBattle_Move_0F5 < PokeBattle_Move
def pbEffectWhenDealingDamage(user,target) def pbEffectWhenDealingDamage(user,target)
return if target.damageState.substitute || target.damageState.berryWeakened return if target.damageState.substitute || target.damageState.berryWeakened
return if !target.item || (!target.item.is_berry? && 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 target.pbRemoveItem
@battle.pbDisplay(_INTL("{1}'s {2} was incinerated!",target.pbThis,target.itemName)) @battle.pbDisplay(_INTL("{1}'s {2} was incinerated!",target.pbThis,target.itemName))
end end
@@ -1445,7 +1445,7 @@ end
#=============================================================================== #===============================================================================
class PokeBattle_Move_144 < PokeBattle_Move class PokeBattle_Move_144 < PokeBattle_Move
def tramplesMinimize?(param=1) 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 true if param==2 # Double damage
return super return super
end end
@@ -1666,7 +1666,7 @@ end
# User gains 3/4 the HP it inflicts as damage. (Draining Kiss, Oblivion Wing) # User gains 3/4 the HP it inflicts as damage. (Draining Kiss, Oblivion Wing)
#=============================================================================== #===============================================================================
class PokeBattle_Move_14F < PokeBattle_Move 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) def pbEffectAgainstTarget(user,target)
return if target.damageState.hpLost<=0 return if target.damageState.hpLost<=0
@@ -128,7 +128,7 @@ module PokeBattle_BattleCommon
@scene.pbThrowSuccess # Play capture success jingle @scene.pbThrowSuccess # Play capture success jingle
pbRemoveFromParty(battler.index,battler.pokemonIndex) pbRemoveFromParty(battler.index,battler.pokemonIndex)
# Gain Exp # Gain Exp
if GAIN_EXP_FOR_CAPTURE if Settings::GAIN_EXP_FOR_CAPTURE
battler.captured = true battler.captured = true
pbGainExp pbGainExp
battler.captured = false battler.captured = false
@@ -192,7 +192,7 @@ module PokeBattle_BattleCommon
# Second half of the shakes calculation # Second half of the shakes calculation
y = ( 65536 / ((255.0/x)**0.1875) ).floor y = ( 65536 / ((255.0/x)**0.1875) ).floor
# Critical capture check # Critical capture check
if ENABLE_CRITICAL_CAPTURES if Settings::ENABLE_CRITICAL_CAPTURES
c = 0 c = 0
numOwned = $Trainer.owned_count numOwned = $Trainer.owned_count
if numOwned>600; c = x*5/12 if numOwned>600; c = x*5/12
@@ -365,7 +365,7 @@ class PokeBattle_Battle
def pbLoseMoney def pbLoseMoney
return if !@internalBattle || !@moneyGain 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 maxLevel = pbMaxLevelInTeam(0,0) # Player's Pokémon only, not partner's
multiplier = [8,16,24,36,48,64,80,100,120] multiplier = [8,16,24,36,48,64,80,100,120]
idxMultiplier = [pbPlayer.badge_count, multiplier.length - 1].min idxMultiplier = [pbPlayer.badge_count, multiplier.length - 1].min
@@ -446,7 +446,7 @@ class PokeBattle_Battle
end end
##### CAUGHT WILD POKÉMON ##### ##### CAUGHT WILD POKÉMON #####
when 4 when 4
@scene.pbWildBattleSuccess if !GAIN_EXP_FOR_CAPTURE @scene.pbWildBattleSuccess if !Settings::GAIN_EXP_FOR_CAPTURE
end end
# Register captured Pokémon in the Pokédex, and store them # Register captured Pokémon in the Pokédex, and store them
pbRecordAndStoreCaughtPokemon pbRecordAndStoreCaughtPokemon
@@ -105,15 +105,15 @@ class PokeBattle_Battle
a = level*defeatedBattler.pokemon.base_exp a = level*defeatedBattler.pokemon.base_exp
if expShare.length>0 && (isPartic || hasExpShare) if expShare.length>0 && (isPartic || hasExpShare)
if numPartic==0 # No participants, all Exp goes to Exp Share holders if numPartic==0 # No participants, all Exp goes to Exp Share holders
exp = a/(SPLIT_EXP_BETWEEN_GAINERS ? expShare.length : 1) exp = a / (Settings::SPLIT_EXP_BETWEEN_GAINERS ? expShare.length : 1)
elsif SPLIT_EXP_BETWEEN_GAINERS # Gain from participating and/or Exp Share elsif Settings::SPLIT_EXP_BETWEEN_GAINERS # Gain from participating and/or Exp Share
exp = a/(2*numPartic) if isPartic exp = a/(2*numPartic) if isPartic
exp += a/(2*expShare.length) if hasExpShare exp += a/(2*expShare.length) if hasExpShare
else # Gain from participating and/or Exp Share (Exp not split) else # Gain from participating and/or Exp Share (Exp not split)
exp = (isPartic) ? a : a/2 exp = (isPartic) ? a : a/2
end end
elsif isPartic # Participated in battle, no Exp Shares held by anyone 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 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 # 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. # 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 # Pokémon gain more Exp from trainer battles
exp = (exp*1.5).floor if trainerBattle? exp = (exp*1.5).floor if trainerBattle?
# Scale the gained Exp based on the gainer's level (or not) # Scale the gained Exp based on the gainer's level (or not)
if SCALED_EXP_FORMULA if Settings::SCALED_EXP_FORMULA
exp /= 5 exp /= 5
levelAdjust = (2*level+10.0)/(pkmn.level+level+10.0) levelAdjust = (2*level+10.0)/(pkmn.level+level+10.0)
levelAdjust = levelAdjust**5 levelAdjust = levelAdjust**5
@@ -64,7 +64,7 @@ class PokeBattle_Battle
end end
end end
# Other certain switching effects # 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 # Other certain trapping effects
if battler.effects[PBEffects::Trapping]>0 || if battler.effects[PBEffects::Trapping]>0 ||
battler.effects[PBEffects::MeanLook]>=0 || battler.effects[PBEffects::MeanLook]>=0 ||
@@ -286,7 +286,7 @@ class PokeBattle_Battle
partyOrder[idxParty],partyOrder[idxPartyOld] = partyOrder[idxPartyOld],partyOrder[idxParty] partyOrder[idxParty],partyOrder[idxPartyOld] = partyOrder[idxPartyOld],partyOrder[idxParty]
# Send out the new Pokémon # Send out the new Pokémon
pbSendOut([[idxBattler,party[idxParty]]]) 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 end
# Called from def pbReplace above and at the start of battle. # Called from def pbReplace above and at the start of battle.
@@ -6,7 +6,7 @@ class PokeBattle_Battle
return false if trainerBattle? return false if trainerBattle?
battler = @battlers[idxBattler] battler = @battlers[idxBattler]
return false if !@canRun && !battler.opposes? 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? && return true if battler.abilityActive? &&
BattleHandlers.triggerRunFromBattleAbility(battler.ability,battler) BattleHandlers.triggerRunFromBattleAbility(battler.ability,battler)
return true if battler.itemActive? && return true if battler.itemActive? &&
@@ -71,7 +71,7 @@ class PokeBattle_Battle
return 0 return 0
end end
if !duringBattle if !duringBattle
if battler.pbHasType?(:GHOST) && MORE_TYPE_EFFECTS if battler.pbHasType?(:GHOST) && Settings::MORE_TYPE_EFFECTS
pbSEPlay("Battle flee") pbSEPlay("Battle flee")
pbDisplayPaused(_INTL("You got away safely!")) pbDisplayPaused(_INTL("You got away safely!"))
@decision = 3 @decision = 3
@@ -62,13 +62,13 @@ class PokeBattle_Battle
#============================================================================= #=============================================================================
def pbHasMegaRing?(idxBattler) def pbHasMegaRing?(idxBattler)
return true if !pbOwnedByPlayer?(idxBattler) # Assume AI trainer have a ring 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 return false
end end
def pbGetMegaRingName(idxBattler) def pbGetMegaRingName(idxBattler)
if pbOwnedByPlayer?(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) return GameData::Item.get(item).name if $PokemonBag.pbHasItem?(item)
end end
end end
@@ -80,7 +80,7 @@ class PokeBattle_Battle
end end
def pbCanMegaEvolve?(idxBattler) 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 !@battlers[idxBattler].hasMega?
return false if wildBattle? && opposes?(idxBattler) return false if wildBattle? && opposes?(idxBattler)
return true if $DEBUG && Input.press?(Input::CTRL) return true if $DEBUG && Input.press?(Input::CTRL)
@@ -157,7 +157,7 @@ class PokeBattle_Battle
if battler.isSpecies?(:GENGAR) && battler.mega? if battler.isSpecies?(:GENGAR) && battler.mega?
battler.effects[PBEffects::Telekinesis] = 0 battler.effects[PBEffects::Telekinesis] = 0
end end
pbCalculatePriority(false,[idxBattler]) if RECALCULATE_TURN_ORDER_AFTER_MEGA_EVOLUTION pbCalculatePriority(false,[idxBattler]) if Settings::RECALCULATE_TURN_ORDER_AFTER_MEGA_EVOLUTION
# Trigger ability # Trigger ability
battler.pbEffectsOnSwitchIn battler.pbEffectsOnSwitchIn
end end
@@ -84,7 +84,7 @@ class PokeBattle_Battle
end end
return if @decision > 0 return if @decision > 0
end end
pbCalculatePriority if RECALCULATE_TURN_ORDER_AFTER_SPEED_CHANGES pbCalculatePriority if Settings::RECALCULATE_TURN_ORDER_AFTER_SPEED_CHANGES
end end
def pbAttackPhaseMegaEvolution def pbAttackPhaseMegaEvolution
@@ -370,7 +370,7 @@ class PokeBattle_Battle
priority.each do |b| priority.each do |b|
next if b.status!=PBStatuses::BURN || !b.takesIndirectDamage? next if b.status!=PBStatuses::BURN || !b.takesIndirectDamage?
oldHP = b.hp 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) dmg = (dmg/2.0).round if b.hasActiveAbility?(:HEATPROOF)
b.pbContinueStatus { b.pbReduceHP(dmg,false) } b.pbContinueStatus { b.pbReduceHP(dmg,false) }
b.pbItemHPHealCheck b.pbItemHPHealCheck
@@ -417,9 +417,9 @@ class PokeBattle_Battle
else pbCommonAnimation("Wrap", b) else pbCommonAnimation("Wrap", b)
end end
if b.takesIndirectDamage? 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) 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 end
@scene.pbDamageAnimation(b) @scene.pbDamageAnimation(b)
b.pbReduceHP(hpLoss,false) b.pbReduceHP(hpLoss,false)
+10 -10
View File
@@ -44,7 +44,7 @@ class PokeBattle_AI
:ENERGYPOWDER => 50, :ENERGYPOWDER => 50,
:ENERGYROOT => 200 :ENERGYROOT => 200
} }
hpItems[:RAGECANDYBAR] = 20 if !RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS hpItems[:RAGECANDYBAR] = 20 if !Settings::RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS
fullRestoreItems = [ fullRestoreItems = [
:FULLRESTORE :FULLRESTORE
] ]
@@ -59,37 +59,37 @@ class PokeBattle_AI
:FULLHEAL, :LAVACOOKIE, :OLDGATEAU, :CASTELIACONE, :LUMIOSEGALETTE, :FULLHEAL, :LAVACOOKIE, :OLDGATEAU, :CASTELIACONE, :LUMIOSEGALETTE,
:SHALOURSABLE, :BIGMALASADA, :LUMBERRY, :HEALPOWDER :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 = { 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], :XATTACK2 => [PBStats::ATTACK, 2],
:XATTACK3 => [PBStats::ATTACK, 3], :XATTACK3 => [PBStats::ATTACK, 3],
:XATTACK6 => [PBStats::ATTACK, 6], :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], :XDEFENSE2 => [PBStats::DEFENSE, 2],
:XDEFENSE3 => [PBStats::DEFENSE, 3], :XDEFENSE3 => [PBStats::DEFENSE, 3],
:XDEFENSE6 => [PBStats::DEFENSE, 6], :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], :XDEFEND2 => [PBStats::DEFENSE, 2],
:XDEFEND3 => [PBStats::DEFENSE, 3], :XDEFEND3 => [PBStats::DEFENSE, 3],
:XDEFEND6 => [PBStats::DEFENSE, 6], :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], :XSPATK2 => [PBStats::SPATK, 2],
:XSPATK3 => [PBStats::SPATK, 3], :XSPATK3 => [PBStats::SPATK, 3],
:XSPATK6 => [PBStats::SPATK, 6], :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], :XSPECIAL2 => [PBStats::SPATK, 2],
:XSPECIAL3 => [PBStats::SPATK, 3], :XSPECIAL3 => [PBStats::SPATK, 3],
:XSPECIAL6 => [PBStats::SPATK, 6], :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], :XSPDEF2 => [PBStats::SPDEF, 2],
:XSPDEF3 => [PBStats::SPDEF, 3], :XSPDEF3 => [PBStats::SPDEF, 3],
:XSPDEF6 => [PBStats::SPDEF, 6], :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], :XSPEED2 => [PBStats::SPEED, 2],
:XSPEED3 => [PBStats::SPEED, 3], :XSPEED3 => [PBStats::SPEED, 3],
:XSPEED6 => [PBStats::SPEED, 6], :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], :XACCURACY2 => [PBStats::ACCURACY, 2],
:XACCURACY3 => [PBStats::ACCURACY, 3], :XACCURACY3 => [PBStats::ACCURACY, 3],
:XACCURACY6 => [PBStats::ACCURACY, 6] :XACCURACY6 => [PBStats::ACCURACY, 6]
@@ -1514,8 +1514,8 @@ class PokeBattle_AI
elsif skill>=PBTrainerAI.mediumSkill && target.lastMoveUsed elsif skill>=PBTrainerAI.mediumSkill && target.lastMoveUsed
moveData = GameData::Move.get(target.lastMoveUsed) moveData = GameData::Move.get(target.lastMoveUsed)
if moveData.base_damage > 0 && if moveData.base_damage > 0 &&
(MOVE_CATEGORY_PER_MOVE && moveData.category == 0) || (Settings::MOVE_CATEGORY_PER_MOVE && moveData.category == 0) ||
(!MOVE_CATEGORY_PER_MOVE && PBTypes.isPhysicalType?(moveData.type)) (!Settings::MOVE_CATEGORY_PER_MOVE && PBTypes.isPhysicalType?(moveData.type))
score -= 60 score -= 60
end end
end end
@@ -1532,8 +1532,8 @@ class PokeBattle_AI
elsif skill>=PBTrainerAI.mediumSkill && target.lastMoveUsed elsif skill>=PBTrainerAI.mediumSkill && target.lastMoveUsed
moveData = GameData::Move.get(target.lastMoveUsed) moveData = GameData::Move.get(target.lastMoveUsed)
if moveData.base_damage > 0 && if moveData.base_damage > 0 &&
(MOVE_CATEGORY_PER_MOVE && moveData.category == 1) || (Settings::MOVE_CATEGORY_PER_MOVE && moveData.category == 1) ||
(!MOVE_CATEGORY_PER_MOVE && !PBTypes.isSpecialType?(moveData.type)) (!Settings::MOVE_CATEGORY_PER_MOVE && !PBTypes.isSpecialType?(moveData.type))
score -= 60 score -= 60
end end
end end
@@ -120,7 +120,7 @@ class PokeBattle_AI
end end
return true if target.effects[PBEffects::Substitute]>0 && move.statusMove? && return true if target.effects[PBEffects::Substitute]>0 && move.statusMove? &&
!move.ignoresSubstitute?(user) && user.index!=target.index !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) target.pbHasType?(:DARK) && target.opposes?(user)
return true if move.priority>0 && @battle.field.terrain==PBBattleTerrains::Psychic && return true if move.priority>0 && @battle.field.terrain==PBBattleTerrains::Psychic &&
target.affectedByTerrain? && target.opposes?(user) target.affectedByTerrain? && target.opposes?(user)
@@ -200,7 +200,7 @@ class PokeBattle_AI
baseDmg = move.pbNaturalGiftBaseDamage(user.item_id) baseDmg = move.pbNaturalGiftBaseDamage(user.item_id)
when "09B" # Heavy Slam when "09B" # Heavy Slam
baseDmg = move.pbBaseDamage(baseDmg,user,target) 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] target.effects[PBEffects::Minimize]
when "0A0", "0BD", "0BE" # Frost Breath, Double Kick, Twineedle when "0A0", "0BD", "0BE" # Frost Breath, Double Kick, Twineedle
baseDmg *= 2 baseDmg *= 2
@@ -418,9 +418,9 @@ class PokeBattle_AI
# Don't need to check the Atk/Sp Atk-boosting badges because the AI # Don't need to check the Atk/Sp Atk-boosting badges because the AI
# won't control the player's Pokémon. # won't control the player's Pokémon.
if target.pbOwnedByPlayer? 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 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 multipliers[:defense_multiplier] *= 1.1
end end
end end
@@ -474,7 +474,7 @@ class PokeBattle_AI
if skill>=PBTrainerAI.highSkill if skill>=PBTrainerAI.highSkill
if user.status==PBStatuses::BURN && move.physicalMove?(type) && if user.status==PBStatuses::BURN && move.physicalMove?(type) &&
!user.hasActiveAbility?(:GUTS) && !user.hasActiveAbility?(:GUTS) &&
!(MECHANICS_GENERATION >= 6 && move.function == "07E") # Facade !(Settings::MECHANICS_GENERATION >= 6 && move.function == "07E") # Facade
multipliers[:final_damage_multiplier] /= 2 multipliers[:final_damage_multiplier] /= 2
end end
end end
@@ -651,7 +651,7 @@ class PokeBattle_AI
end end
if skill>=PBTrainerAI.highSkill if skill>=PBTrainerAI.highSkill
if move.function=="006" # Toxic 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) user.pbHasType?(:POISON)
end end
if move.function=="070" # OHKO moves if move.function=="070" # OHKO moves
@@ -5,15 +5,15 @@ module PokeBattle_SceneConstants
MESSAGE_SHADOW_COLOR = Color.new(160, 160, 168) MESSAGE_SHADOW_COLOR = Color.new(160, 160, 168)
# The number of party balls to show in each side's lineup. # 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 # Centre bottom of the player's side base graphic
PLAYER_BASE_X = 128 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 # Centre middle of the foe's side base graphic
FOE_BASE_X = SCREEN_WIDTH - 128 FOE_BASE_X = Settings::SCREEN_WIDTH - 128
FOE_BASE_Y = (SCREEN_HEIGHT * 3 / 4) - 112 FOE_BASE_Y = (Settings::SCREEN_HEIGHT * 3 / 4) - 112
# Returns where the centre bottom of a battler's sprite should be, given its # 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 # index and the number of battlers on its side, assuming the battler has
@@ -480,12 +480,12 @@ end
def pbBattleConfusionBerry(battler,battle,item,forced,flavor,confuseMsg) def pbBattleConfusionBerry(battler,battle,item,forced,flavor,confuseMsg)
return false if !forced && !battler.canHeal? 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 itemName = GameData::Item.get(item).name
battle.pbCommonAnimation("EatBerry",battler) if !forced battle.pbCommonAnimation("EatBerry",battler) if !forced
fraction_to_heal = 8 # Gens 6 and lower fraction_to_heal = 8 # Gens 6 and lower
if MECHANICS_GENERATION == 7; fraction_to_heal = 2 if Settings::MECHANICS_GENERATION == 7; fraction_to_heal = 2
elsif MECHANICS_GENERATION >= 8; fraction_to_heal = 3 elsif Settings::MECHANICS_GENERATION >= 8; fraction_to_heal = 3
end end
amt = battler.pbRecoverHP(battler.totalhp / fraction_to_heal) amt = battler.pbRecoverHP(battler.totalhp / fraction_to_heal)
if amt>0 if amt>0
@@ -572,7 +572,7 @@ def pbBattleGem(user,type,move,mults,moveType)
return if move.is_a?(PokeBattle_PledgeMove) return if move.is_a?(PokeBattle_PledgeMove)
return if moveType != type return if moveType != type
user.effects[PBEffects::GemConsumed] = user.item_id user.effects[PBEffects::GemConsumed] = user.item_id
if MECHANICS_GENERATION >= 6 if Settings::MECHANICS_GENERATION >= 6
mults[:base_damage_multiplier] *= 1.3 mults[:base_damage_multiplier] *= 1.3
else else
mults[:base_damage_multiplier] *= 1.5 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)) battle.pbDisplay(_INTL("{1}'s {2} activated!",battler.pbThis,battler.abilityName))
end end
fixedDuration = false fixedDuration = false
fixedDuration = true if FIXED_DURATION_WEATHER_FROM_ABILITY && fixedDuration = true if Settings::FIXED_DURATION_WEATHER_FROM_ABILITY &&
weather != PBWeather::HarshSun && weather != PBWeather::HarshSun &&
weather != PBWeather::HeavyRain && weather != PBWeather::HeavyRain &&
weather != PBWeather::StrongWinds weather != PBWeather::StrongWinds
@@ -308,7 +308,7 @@ BattleHandlers::StatusCureAbility.add(:MAGMAARMOR,
BattleHandlers::StatusCureAbility.add(:OBLIVIOUS, BattleHandlers::StatusCureAbility.add(:OBLIVIOUS,
proc { |ability,battler| proc { |ability,battler|
next if battler.effects[PBEffects::Attract]<0 && 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) battler.battle.pbShowAbilitySplash(battler)
if battler.effects[PBEffects::Attract]>=0 if battler.effects[PBEffects::Attract]>=0
battler.pbCureAttract battler.pbCureAttract
@@ -319,7 +319,7 @@ BattleHandlers::StatusCureAbility.add(:OBLIVIOUS,
battler.pbThis,battler.abilityName)) battler.pbThis,battler.abilityName))
end end
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 battler.effects[PBEffects::Taunt] = 0
if PokeBattle_SceneConstants::USE_ABILITY_SPLASH if PokeBattle_SceneConstants::USE_ABILITY_SPLASH
battler.battle.pbDisplay(_INTL("{1}'s Taunt wore off!",battler.pbThis)) battler.battle.pbDisplay(_INTL("{1}'s Taunt wore off!",battler.pbThis))
@@ -741,7 +741,7 @@ BattleHandlers::MoveBaseTypeModifierAbility.add(:LIQUIDVOICE,
BattleHandlers::MoveBaseTypeModifierAbility.add(:NORMALIZE, BattleHandlers::MoveBaseTypeModifierAbility.add(:NORMALIZE,
proc { |ability,user,move,type| proc { |ability,user,move,type|
next if !GameData::Type.exists?(:NORMAL) next if !GameData::Type.exists?(:NORMAL)
move.powerBoost = true if MECHANICS_GENERATION >= 7 move.powerBoost = true if Settings::MECHANICS_GENERATION >= 7
next :NORMAL next :NORMAL
} }
) )
@@ -780,7 +780,7 @@ BattleHandlers::AccuracyCalcUserAbility.add(:HUSTLE,
BattleHandlers::AccuracyCalcUserAbility.add(:KEENEYE, BattleHandlers::AccuracyCalcUserAbility.add(:KEENEYE,
proc { |ability,mods,user,target,move,type| 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) battle.pbShowAbilitySplash(target)
target.pbLowerStatStageByAbility(PBStats::DEFENSE, 1, target, false) target.pbLowerStatStageByAbility(PBStats::DEFENSE, 1, target, false)
target.pbRaiseStatStageByAbility(PBStats::SPEED, target.pbRaiseStatStageByAbility(PBStats::SPEED,
(MECHANICS_GENERATION >= 7) ? 2 : 1, target, false) (Settings::MECHANICS_GENERATION >= 7) ? 2 : 1, target, false)
battle.pbHideAbilitySplash(target) battle.pbHideAbilitySplash(target)
} }
) )
@@ -2089,7 +2089,7 @@ BattleHandlers::AbilityOnSwitchIn.add(:ANTICIPATION,
next if m.statusMove? next if m.statusMove?
if type1 if type1
moveType = m.type 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] moveType = pbHiddenPower(b.pokemon)[0]
end end
eff = PBTypes.getCombinedEffectiveness(moveType,type1,type2,type3) eff = PBTypes.getCombinedEffectiveness(moveType,type1,type2,type3)
@@ -2236,7 +2236,7 @@ BattleHandlers::AbilityOnSwitchIn.add(:FRISK,
end end
if foes.length>0 if foes.length>0
battle.pbShowAbilitySplash(battler) battle.pbShowAbilitySplash(battler)
if MECHANICS_GENERATION >= 6 if Settings::MECHANICS_GENERATION >= 6
foes.each do |b| foes.each do |b|
battle.pbDisplay(_INTL("{1} frisked {2} and found its {3}!", battle.pbDisplay(_INTL("{1} frisked {2} and found its {3}!",
battler.pbThis,b.pbThis(true),b.itemName)) battler.pbThis,b.pbThis(true),b.itemName))
@@ -746,7 +746,7 @@ BattleHandlers::DamageCalcUserItem.copy(:SOFTSAND,:EARTHPLATE)
BattleHandlers::DamageCalcUserItem.add(:SOULDEW, BattleHandlers::DamageCalcUserItem.add(:SOULDEW,
proc { |item,user,target,move,mults,baseDmg,type| proc { |item,user,target,move,mults,baseDmg,type|
next if !user.isSpecies?(:LATIAS) && !user.isSpecies?(:LATIOS) 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 mults[:final_damage_multiplier] *= 1.2 if type == :PSYCHIC || type == :DRAGON
else else
if move.specialMove? && !user.battle.rules["souldewclause"] if move.specialMove? && !user.battle.rules["souldewclause"]
@@ -932,7 +932,7 @@ BattleHandlers::DamageCalcTargetItem.add(:SHUCABERRY,
BattleHandlers::DamageCalcTargetItem.add(:SOULDEW, BattleHandlers::DamageCalcTargetItem.add(:SOULDEW,
proc { |item,user,target,move,mults,baseDmg,type| 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) next if !target.isSpecies?(:LATIAS) && !target.isSpecies?(:LATIOS)
if move.specialMove? && !user.battle.rules["souldewclause"] if move.specialMove? && !user.battle.rules["souldewclause"]
mults[:defense_multiplier] *= 1.5 mults[:defense_multiplier] *= 1.5
@@ -101,7 +101,7 @@ BallHandlers::ModifyCatchRate.add(:SAFARIBALL,proc { |ball,catchRate,battle,batt
}) })
BallHandlers::ModifyCatchRate.add(:NETBALL,proc { |ball,catchRate,battle,battler,ultraBeast| 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) catchRate *= multiplier if battler.pbHasType?(:BUG) || battler.pbHasType?(:WATER)
next catchRate 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| 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) catchRate *= multiplier if battle.pbPlayer.owned?(battler.species)
next catchRate 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| 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 catchRate *= multiplier if battle.time==2
next catchRate 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| 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 || catchRate *= multiplier if $PokemonTemp.encounterType==EncounterTypes::OldRod ||
$PokemonTemp.encounterType==EncounterTypes::GoodRod || $PokemonTemp.encounterType==EncounterTypes::GoodRod ||
$PokemonTemp.encounterType==EncounterTypes::SuperRod $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| BallHandlers::ModifyCatchRate.add(:HEAVYBALL,proc { |ball,catchRate,battle,battler,ultraBeast|
next 0 if catchRate==0 next 0 if catchRate==0
weight = battler.pbWeight weight = battler.pbWeight
if NEW_POKE_BALL_CATCH_RATES if Settings::NEW_POKE_BALL_CATCH_RATES
if weight>=3000; catchRate += 30 if weight>=3000; catchRate += 30
elsif weight>=2000; catchRate += 20 elsif weight>=2000; catchRate += 20
elsif weight<1000; catchRate -= 20 elsif weight<1000; catchRate -= 20
+17 -15
View File
@@ -193,7 +193,7 @@ Events.onMapUpdate += proc { |_sender,_e|
# Returns whether the Poké Center should explain Pokérus to the player, if a # Returns whether the Poké Center should explain Pokérus to the player, if a
# healed Pokémon has it. # healed Pokémon has it.
def pbPokerus? def pbPokerus?
return false if $game_switches[SEEN_POKERUS_SWITCH] return false if $game_switches[Settings::SEEN_POKERUS_SWITCH]
for i in $Trainer.party for i in $Trainer.party
return true if i.pokerusStage==1 return true if i.pokerusStage==1
end end
@@ -274,7 +274,7 @@ Events.onStepTaken += proc {
Events.onStepTakenTransferPossible += proc { |_sender,e| Events.onStepTakenTransferPossible += proc { |_sender,e|
handled = e[0] handled = e[0]
next if handled[0] next if handled[0]
if $PokemonGlobal.stepcount%4==0 && POISON_IN_FIELD if $PokemonGlobal.stepcount%4==0 && Settings::POISON_IN_FIELD
flashed = false flashed = false
for i in $Trainer.able_party for i in $Trainer.able_party
if i.status==PBStatuses::POISON && !i.hasAbility?(:IMMUNITY) 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) $game_screen.start_flash(Color.new(255,0,0,128), 4)
flashed = true flashed = true
end end
i.hp -= 1 if i.hp>1 || POISON_FAINT_IN_FIELD i.hp -= 1 if i.hp>1 || Settings::POISON_FAINT_IN_FIELD
if i.hp==1 && !POISON_FAINT_IN_FIELD if i.hp==1 && !Settings::POISON_FAINT_IN_FIELD
i.status = PBStatuses::NONE i.status = PBStatuses::NONE
pbMessage(_INTL("{1} survived the poisoning.\\nThe poison faded away!\1",i.name)) pbMessage(_INTL("{1} survived the poisoning.\\nThe poison faded away!\1",i.name))
next next
@@ -341,7 +341,7 @@ Events.onStepTakenFieldMovement += proc { |_sender,e|
if $scene.is_a?(Scene_Map) if $scene.is_a?(Scene_Map)
currentTag = pbGetTerrainTag(event) currentTag = pbGetTerrainTag(event)
if PBTerrain.isJustGrass?(pbGetTerrainTag(event,true)) # Won't show if under bridge 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 elsif event==$game_player
if currentTag==PBTerrain::WaterfallCrest if currentTag==PBTerrain::WaterfallCrest
# Descend waterfall, but only if this event is the player # 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 if mapChanged && map_metadata && map_metadata.announce_location
nosignpost = false nosignpost = false
if $PokemonGlobal.mapTrail[1] if $PokemonGlobal.mapTrail[1]
for i in 0...NO_SIGNPOSTS.length / 2 for i in 0...Settings::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 Settings::NO_SIGNPOSTS[2 * i] == $PokemonGlobal.mapTrail[1] &&
nosignpost = true if NO_SIGNPOSTS[2 * i + 1] == $PokemonGlobal.mapTrail[1] && NO_SIGNPOSTS[2 * i] == $game_map.map_id 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 break if nosignpost
end end
mapinfos = load_data("Data/MapInfos.rxdata") mapinfos = load_data("Data/MapInfos.rxdata")
@@ -769,7 +771,7 @@ end
def pbLedge(_xOffset,_yOffset) def pbLedge(_xOffset,_yOffset)
if PBTerrain.isLedge?(pbFacingTerrainTag) if PBTerrain.isLedge?(pbFacingTerrainTag)
if pbJumpToward(2,true) 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.increase_steps
$game_player.check_event_trigger_here([1,2]) $game_player.check_event_trigger_here([1,2])
end end
@@ -868,7 +870,7 @@ end
#=============================================================================== #===============================================================================
def pbFishingBegin def pbFishingBegin
$PokemonGlobal.fishing = true $PokemonGlobal.fishing = true
if !pbCommonEvent(FISHING_BEGIN_COMMON_EVENT) if !pbCommonEvent(Settings::FISHING_BEGIN_COMMON_EVENT)
patternb = 2*$game_player.direction - 1 patternb = 2*$game_player.direction - 1
meta = GameData::Metadata.get_player($PokemonGlobal.playerID) meta = GameData::Metadata.get_player($PokemonGlobal.playerID)
num = ($PokemonGlobal.surfing) ? 7 : 6 num = ($PokemonGlobal.surfing) ? 7 : 6
@@ -887,7 +889,7 @@ def pbFishingBegin
end end
def pbFishingEnd def pbFishingEnd
if !pbCommonEvent(FISHING_END_COMMON_EVENT) if !pbCommonEvent(Settings::FISHING_END_COMMON_EVENT)
patternb = 2*($game_player.direction - 2) patternb = 2*($game_player.direction - 2)
meta = GameData::Metadata.get_player($PokemonGlobal.playerID) meta = GameData::Metadata.get_player($PokemonGlobal.playerID)
num = ($PokemonGlobal.surfing) ? 7 : 6 num = ($PokemonGlobal.surfing) ? 7 : 6
@@ -927,7 +929,7 @@ def pbFishing(hasEncounter,rodType=1)
break break
end end
if hasEncounter && rand(100)<biteChance if hasEncounter && rand(100)<biteChance
$scene.spriteset.addUserAnimation(EXCLAMATION_ANIMATION_ID,$game_player.x,$game_player.y,true,3) $scene.spriteset.addUserAnimation(Settings::EXCLAMATION_ANIMATION_ID,$game_player.x,$game_player.y,true,3)
frames = Graphics.frame_rate - rand(Graphics.frame_rate/2) # 0.5-1 second frames = Graphics.frame_rate - rand(Graphics.frame_rate/2) # 0.5-1 second
if !pbWaitForInput(msgWindow,message+_INTL("\r\nOh! A bite!"),frames) if !pbWaitForInput(msgWindow,message+_INTL("\r\nOh! A bite!"),frames)
pbFishingEnd pbFishingEnd
@@ -935,9 +937,9 @@ def pbFishing(hasEncounter,rodType=1)
pbMessageDisplay(msgWindow,_INTL("The Pokémon got away...")) pbMessageDisplay(msgWindow,_INTL("The Pokémon got away..."))
break break
end end
if FISHING_AUTO_HOOK || rand(100)<hookChance if Settings::FISHING_AUTO_HOOK || rand(100) < hookChance
pbFishingEnd pbFishingEnd
pbMessageDisplay(msgWindow,_INTL("Landed a Pokémon!")) if !FISHING_AUTO_HOOK pbMessageDisplay(msgWindow,_INTL("Landed a Pokémon!")) if !Settings::FISHING_AUTO_HOOK
$game_player.setDefaultCharName(nil,oldpattern) $game_player.setDefaultCharName(nil,oldpattern)
ret = true ret = true
break break
@@ -996,7 +998,7 @@ def pbWaitForInput(msgWindow,message,frames)
$game_player.pattern = 0 $game_player.pattern = 0
return true return true
end end
break if !FISHING_AUTO_HOOK && numFrame>frames break if !Settings::FISHING_AUTO_HOOK && numFrame > frames
numFrame += 1 numFrame += 1
end end
return false return false
@@ -640,7 +640,7 @@ def pbStartOver(gameover=false)
end end
pbCancelVehicles pbCancelVehicles
pbRemoveDependencies 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_map_id = $PokemonGlobal.pokecenterMapId
$game_temp.player_new_x = $PokemonGlobal.pokecenterX $game_temp.player_new_x = $PokemonGlobal.pokecenterX
$game_temp.player_new_y = $PokemonGlobal.pokecenterY $game_temp.player_new_y = $PokemonGlobal.pokecenterY
@@ -664,7 +664,7 @@ def pbStartOver(gameover=false)
if homedata if homedata
pbCancelVehicles pbCancelVehicles
pbRemoveDependencies 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_map_id = homedata[0]
$game_temp.player_new_x = homedata[1] $game_temp.player_new_x = homedata[1]
$game_temp.player_new_y = homedata[2] $game_temp.player_new_y = homedata[2]
@@ -161,7 +161,7 @@ def pbPrepareBattle(battle)
if GameData::MapMetadata.exists?($game_map.map_id) && if GameData::MapMetadata.exists?($game_map.map_id) &&
GameData::MapMetadata.get($game_map.map_id).battle_environment == PBEnvironment::Cave GameData::MapMetadata.get($game_map.map_id).battle_environment == PBEnvironment::Cave
battle.time = 2 # This makes Dusk Balls work properly in caves battle.time = 2 # This makes Dusk Balls work properly in caves
elsif TIME_SHADING elsif Settings::TIME_SHADING
timeNow = pbGetTimeNow timeNow = pbGetTimeNow
if PBDayNight.isNight?(timeNow); battle.time = 2 if PBDayNight.isNight?(timeNow); battle.time = 2
elsif PBDayNight.isEvening?(timeNow); battle.time = 1 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 # 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 # 6 or fewer Pokémon, record this trainer for a double battle caused by the
# other triggered trainer event # 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? trainer.lose_text = endSpeech if endSpeech && !endSpeech.empty?
$PokemonTemp.waitingTrainer = [trainer, thisEvent.id] $PokemonTemp.waitingTrainer = [trainer, thisEvent.id]
return false return false
@@ -579,7 +579,7 @@ end
Events.onEndBattle += proc { |_sender,e| Events.onEndBattle += proc { |_sender,e|
decision = e[0] decision = e[0]
canLose = e[1] 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 if $PokemonTemp.evolutionLevels
pbEvolutionCheck($PokemonTemp.evolutionLevels) pbEvolutionCheck($PokemonTemp.evolutionLevels)
$PokemonTemp.evolutionLevels = nil $PokemonTemp.evolutionLevels = nil
@@ -603,7 +603,7 @@ Events.onEndBattle += proc { |_sender,e|
def pbEvolutionCheck(currentLevels) def pbEvolutionCheck(currentLevels)
for i in 0...currentLevels.length for i in 0...currentLevels.length
pkmn = $Trainer.party[i] 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] next if currentLevels[i] && pkmn.level==currentLevels[i]
newSpecies = pbCheckEvolution(pkmn) newSpecies = pbCheckEvolution(pkmn)
next if !newSpecies next if !newSpecies
@@ -216,7 +216,7 @@ class PokemonEncounters
# with modifiers applied, divided by 180. # with modifiers applied, divided by 180.
encount = @step_chances[enc_type].to_f encount = @step_chances[enc_type].to_f
encount *= 0.8 if $PokemonGlobal.bicycle 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 /= 2 if $PokemonMap.blackFluteUsed
encount *= 1.5 if $PokemonMap.whiteFluteUsed encount *= 1.5 if $PokemonMap.whiteFluteUsed
end end
@@ -253,7 +253,7 @@ class PokemonEncounters
return false if !enc_data return false if !enc_data
# Repel # Repel
if !ignore_repel && $PokemonGlobal.repel > 0 && !pbPokeRadarOnShakingGrass 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 return false if first_pkmn && enc_data[1] < first_pkmn.level
end end
# Some abilities make wild encounters less likely if the wild Pokémon is # Some abilities make wild encounters less likely if the wild Pokémon is
@@ -391,7 +391,7 @@ class PokemonEncounters
break break
end end
# Get the chosen species and level # 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 # Some abilities alter the level of the wild Pokémon
if first_pkmn if first_pkmn
case first_pkmn.ability_id case first_pkmn.ability_id
@@ -400,11 +400,11 @@ class PokemonEncounters
end end
end end
# Black Flute and White Flute alter the level of the wild Pokémon # 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 if $PokemonMap.blackFluteUsed
level = [level + rand(1, 4), PBExperience.maxLevel].min level = [level + rand(1..4), PBExperience.maxLevel].min
elsif $PokemonMap.whiteFluteUsed elsif $PokemonMap.whiteFluteUsed
level = [level - rand(1, 4), 1].max level = [level - rand(1..4), 1].max
end end
end end
# Return [species, level] # Return [species, level]
@@ -441,7 +441,7 @@ class PokemonEncounters
break break
end end
# Return [species, level] # Return [species, level]
level = rand(encounter[2], encounter[3]) level = rand(encounter[2]..encounter[3])
return [encounter[1], level] return [encounter[1], level]
end end
end end
@@ -477,9 +477,7 @@ def pbGenerateWildPokemon(species,level,isRoamer=false)
end end
end end
# Give Pokérus # Give Pokérus
if rand(65536)<POKERUS_CHANCE genwildpoke.givePokerus if rand(65536) < Settings::POKERUS_CHANCE
genwildpoke.givePokerus
end
# Change wild Pokémon's gender/nature depending on the lead party Pokémon's # Change wild Pokémon's gender/nature depending on the lead party Pokémon's
# ability # ability
if first_pkmn if first_pkmn
@@ -8,7 +8,7 @@
# Make all wild Pokémon shiny while a certain Switch is ON (see Settings). # Make all wild Pokémon shiny while a certain Switch is ON (see Settings).
Events.onWildPokemonCreate += proc { |_sender, e| Events.onWildPokemonCreate += proc { |_sender, e|
pokemon = e[0] pokemon = e[0]
if $game_switches[SHINY_WILD_POKEMON_SWITCH] if $game_switches[Settings::SHINY_WILD_POKEMON_SWITCH]
pokemon.shiny = true pokemon.shiny = true
end end
} }
@@ -27,9 +27,9 @@ end
# Gets the roaming areas for a particular Pokémon. # Gets the roaming areas for a particular Pokémon.
def pbRoamingAreas(idxRoamer) def pbRoamingAreas(idxRoamer)
# [species ID, level, Game Switch, encounter type, battle BGM, area maps hash] # [species ID, level, Game Switch, encounter type, battle BGM, area maps hash]
roamData = ROAMING_SPECIES[idxRoamer] roamData = Settings::ROAMING_SPECIES[idxRoamer]
return roamData[5] if roamData && roamData[5] return roamData[5] if roamData && roamData[5]
return ROAMING_AREAS return Settings::ROAMING_AREAS
end end
# Puts a roamer in a completely random map available to it. # Puts a roamer in a completely random map available to it.
@@ -45,14 +45,14 @@ def pbRoamPokemon
# Start all roamers off in random maps # Start all roamers off in random maps
if !$PokemonGlobal.roamPosition if !$PokemonGlobal.roamPosition
$PokemonGlobal.roamPosition = {} $PokemonGlobal.roamPosition = {}
for i in 0...ROAMING_SPECIES.length for i in 0...Settings::ROAMING_SPECIES.length
next if !GameData::Species.exists?(i[0]) next if !GameData::Species.exists?(i[0])
keys = pbRoamingAreas(i).keys keys = pbRoamingAreas(i).keys
$PokemonGlobal.roamPosition[i] = keys[rand(keys.length)] $PokemonGlobal.roamPosition[i] = keys[rand(keys.length)]
end end
end end
# Roam each Pokémon in turn # Roam each Pokémon in turn
for i in 0...ROAMING_SPECIES.length for i in 0...Settings::ROAMING_SPECIES.length
pbRoamPokemonOne(i) pbRoamPokemonOne(i)
end end
end end
@@ -61,7 +61,7 @@ end
# currently possible to encounter it (i.e. its Game Switch is off). # currently possible to encounter it (i.e. its Game Switch is off).
def pbRoamPokemonOne(idxRoamer) def pbRoamPokemonOne(idxRoamer)
# [species ID, level, Game Switch, encounter type, battle BGM, area maps hash] # [species ID, level, Game Switch, encounter type, battle BGM, area maps hash]
roamData = ROAMING_SPECIES[idxRoamer] roamData = Settings::ROAMING_SPECIES[idxRoamer]
return if roamData[2]>0 && !$game_switches[roamData[2]] # Game Switch is off return if roamData[2]>0 && !$game_switches[roamData[2]] # Game Switch is off
return if !GameData::Species.exists?(roamData[0]) return if !GameData::Species.exists?(roamData[0])
# Get hash of area patrolled by the roaming Pokémon # Get hash of area patrolled by the roaming Pokémon
@@ -151,7 +151,7 @@ EncounterModifier.register(proc { |encounter|
currentRegion = pbGetCurrentRegion currentRegion = pbGetCurrentRegion
currentMapName = pbGetMessage(MessageTypes::MapNames, $game_map.map_id) currentMapName = pbGetMessage(MessageTypes::MapNames, $game_map.map_id)
possible_roamers = [] 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] # data = [species, level, Game Switch, roamer method, battle BGM, area maps hash]
next if !GameData::Species.exists?(data[0]) next if !GameData::Species.exists?(data[0])
next if data[2] > 0 && !$game_switches[data[2]] # Isn't roaming next if data[2] > 0 && !$game_switches[data[2]] # Isn't roaming
@@ -85,8 +85,8 @@ module DungeonMaze
paintTile(dungeon, xDst, yDst, tile, rotation) paintTile(dungeon, xDst, yDst, tile, rotation)
return false if rand(100) < 30 return false if rand(100) < 30
# Generate a randomly placed room # Generate a randomly placed room
width = rand(MINWIDTH, MAXWIDTH) width = rand(MINWIDTH..MAXWIDTH)
height = rand(MINHEIGHT, MAXHEIGHT) height = rand(MINHEIGHT..MAXHEIGHT)
return false if width <= 0 || height <= 0 return false if width <= 0 || height <= 0
centerX = TILE_WIDTH / 2 + rand(5) - 2 centerX = TILE_WIDTH / 2 + rand(5) - 2
centerY = TILE_HEIGHT / 2 + rand(5) - 2 centerY = TILE_HEIGHT / 2 + rand(5) - 2
@@ -55,7 +55,7 @@ end
def pbCheckHiddenMoveBadge(badge=-1,showmsg=true) def pbCheckHiddenMoveBadge(badge=-1,showmsg=true)
return true if badge<0 # No badge requirement return true if badge<0 # No badge requirement
return true if $DEBUG 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 return true
end end
pbMessage(_INTL("Sorry, a new Badge is required.")) if showmsg pbMessage(_INTL("Sorry, a new Badge is required.")) if showmsg
@@ -188,7 +188,7 @@ end
def pbCut def pbCut
move = :CUT move = :CUT
movefinder = $Trainer.get_pokemon_with_move(move) 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.")) pbMessage(_INTL("This tree looks like it can be cut down."))
return false return false
end end
@@ -203,7 +203,7 @@ def pbCut
end end
HiddenMoveHandlers::CanUseMove.add(:CUT,proc { |move,pkmn,showmsg| 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 facingEvent = $game_player.pbFacingEvent
if !facingEvent || facingEvent.name.downcase!="tree" if !facingEvent || facingEvent.name.downcase!="tree"
pbMessage(_INTL("Can't use that here.")) if showmsg 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 return false if !map_metadata || !map_metadata.dive_map_id
move = :DIVE move = :DIVE
movefinder = $Trainer.get_pokemon_with_move(move) 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.")) pbMessage(_INTL("The sea is deep here. A Pokémon may be able to go underwater."))
return false return false
end end
@@ -334,7 +334,7 @@ def pbSurfacing
return if !surface_map_id return if !surface_map_id
move = :DIVE move = :DIVE
movefinder = $Trainer.get_pokemon_with_move(move) 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.")) pbMessage(_INTL("Light is filtering down from above. A Pokémon may be able to surface here."))
return false return false
end end
@@ -390,7 +390,7 @@ Events.onAction += proc { |_sender, _e|
} }
HiddenMoveHandlers::CanUseMove.add(:DIVE,proc { |move,pkmn,showmsg| 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 if $PokemonGlobal.diving
surface_map_id = nil surface_map_id = nil
GameData::MapMetadata.each do |map_data| GameData::MapMetadata.each do |map_data|
@@ -455,7 +455,7 @@ HiddenMoveHandlers::UseMove.add(:DIVE,proc { |move,pokemon|
# Flash # Flash
#=============================================================================== #===============================================================================
HiddenMoveHandlers::CanUseMove.add(:FLASH,proc { |move,pkmn,showmsg| 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) || if !GameData::MapMetadata.exists?($game_map.map_id) ||
!GameData::MapMetadata.get($game_map.map_id).dark_map !GameData::MapMetadata.get($game_map.map_id).dark_map
pbMessage(_INTL("Can't use that here.")) if showmsg pbMessage(_INTL("Can't use that here.")) if showmsg
@@ -492,7 +492,7 @@ HiddenMoveHandlers::UseMove.add(:FLASH,proc { |move,pokemon|
# Fly # Fly
#=============================================================================== #===============================================================================
HiddenMoveHandlers::CanUseMove.add(:FLY,proc { |move,pkmn,showmsg| 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? if $game_player.pbHasDependentEvents?
pbMessage(_INTL("It can't be used when you have someone with you.")) if showmsg pbMessage(_INTL("It can't be used when you have someone with you.")) if showmsg
next false next false
@@ -600,7 +600,7 @@ end
def pbRockSmash def pbRockSmash
move = :ROCKSMASH move = :ROCKSMASH
movefinder = $Trainer.get_pokemon_with_move(move) 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.")) pbMessage(_INTL("It's a rugged rock, but a Pokémon may be able to smash it."))
return false return false
end end
@@ -614,7 +614,7 @@ def pbRockSmash
end end
HiddenMoveHandlers::CanUseMove.add(:ROCKSMASH,proc { |move,pkmn,showmsg| 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 facingEvent = $game_player.pbFacingEvent
if !facingEvent || facingEvent.name.downcase!="rock" if !facingEvent || facingEvent.name.downcase!="rock"
pbMessage(_INTL("Can't use that here.")) if showmsg pbMessage(_INTL("Can't use that here.")) if showmsg
@@ -647,7 +647,7 @@ def pbStrength
end end
move = :STRENGTH move = :STRENGTH
movefinder = $Trainer.get_pokemon_with_move(move) 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.")) pbMessage(_INTL("It's a big boulder, but a Pokémon may be able to push it aside."))
return false return false
end end
@@ -669,7 +669,7 @@ Events.onAction += proc { |_sender,_e|
} }
HiddenMoveHandlers::CanUseMove.add(:STRENGTH,proc { |move,pkmn,showmsg| 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 if $PokemonMap.strengthUsed
pbMessage(_INTL("Strength is already being used.")) if showmsg pbMessage(_INTL("Strength is already being used.")) if showmsg
next false next false
@@ -696,7 +696,7 @@ def pbSurf
return false if $game_player.pbHasDependentEvents? return false if $game_player.pbHasDependentEvents?
move = :SURF move = :SURF
movefinder = $Trainer.get_pokemon_with_move(move) 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 return false
end end
if pbConfirmMessage(_INTL("The water is a deep blue...\nWould you like to surf on it?")) 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| 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 if $PokemonGlobal.surfing
pbMessage(_INTL("You're already surfing.")) if showmsg pbMessage(_INTL("You're already surfing.")) if showmsg
next false next false
@@ -948,7 +948,7 @@ end
def pbWaterfall def pbWaterfall
move = :WATERFALL move = :WATERFALL
movefinder = $Trainer.get_pokemon_with_move(move) 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.")) pbMessage(_INTL("A wall of water is crashing down with a mighty roar."))
return false return false
end end
@@ -972,7 +972,7 @@ Events.onAction += proc { |_sender,_e|
} }
HiddenMoveHandlers::CanUseMove.add(:WATERFALL,proc { |move,pkmn,showmsg| 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 if pbFacingTerrainTag!=PBTerrain::Waterfall
pbMessage(_INTL("Can't use that here.")) if showmsg pbMessage(_INTL("Can't use that here.")) if showmsg
next false next false
@@ -266,7 +266,7 @@ class BerryPlantSprite
@event.character_name="Object ball" @event.character_name="Object ball"
end end
if @oldstage!=berryData[0] && berryData.length>6 # Gen 4 growth mechanisms 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
end end
@oldstage=berryData[0] @oldstage=berryData[0]
@@ -280,7 +280,7 @@ def pbBerryPlant
thisEvent=interp.get_character(0) thisEvent=interp.get_character(0)
berryData=interp.getVariable berryData=interp.getVariable
if !berryData if !berryData
if NEW_BERRY_PLANTS if Settings::NEW_BERRY_PLANTS
berryData=[0,nil,0,0,0,0,0,0] berryData=[0,nil,0,0,0,0,0,0]
else else
berryData=[0,nil,false,0,0,0] berryData=[0,nil,false,0,0,0]
@@ -298,7 +298,7 @@ def pbBerryPlant
berry=berryData[1] berry=berryData[1]
case berryData[0] case berryData[0]
when 0 # empty when 0 # empty
if NEW_BERRY_PLANTS if Settings::NEW_BERRY_PLANTS
# Gen 4 planting mechanics # Gen 4 planting mechanics
if !berryData[7] || berryData[7]==0 # No mulch used yet if !berryData[7] || berryData[7]==0 # No mulch used yet
cmd=pbMessage(_INTL("It's soft, earthy soil."),[ cmd=pbMessage(_INTL("It's soft, earthy soil."),[
@@ -421,7 +421,7 @@ def pbBerryPlant
when 3 # X taller when 3 # X taller
pbMessage(_INTL("The {1} plant is growing bigger.",GameData::Item.get(berry).name)) pbMessage(_INTL("The {1} plant is growing bigger.",GameData::Item.get(berry).name))
when 4 # X flowering 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)) pbMessage(_INTL("This {1} plant is in bloom!",GameData::Item.get(berry).name))
else else
case berryData[4] case berryData[4]
@@ -475,7 +475,7 @@ def pbBerryPlant
end end
pbMessage(_INTL("{1} put the \\c[1]{2}\\c[0] in the <icon=bagPocket{3}>\\c[1]{4}\\c[0] Pocket.\1", pbMessage(_INTL("{1} put the \\c[1]{2}\\c[0] in the <icon=bagPocket{3}>\\c[1]{4}\\c[0] Pocket.\1",
$Trainer.name,itemname,pocket,PokemonBag.pocketNames()[pocket])) $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.")) pbMessage(_INTL("The soil returned to its soft and earthy state."))
berryData=[0,nil,0,0,0,0,0,0] berryData=[0,nil,0,0,0,0,0,0]
else else
@@ -502,7 +502,7 @@ def pbBerryPlant
end end
interp.setVariable(berryData) interp.setVariable(berryData)
pbMessage(_INTL("{1} watered the plant.\\wtnp[40]",$Trainer.name)) pbMessage(_INTL("{1} watered the plant.\\wtnp[40]",$Trainer.name))
if NEW_BERRY_PLANTS if Settings::NEW_BERRY_PLANTS
pbMessage(_INTL("There! All happy!")) pbMessage(_INTL("There! All happy!"))
else else
pbMessage(_INTL("The plant seemed to be delighted.")) pbMessage(_INTL("The plant seemed to be delighted."))
@@ -538,7 +538,7 @@ def pbPickBerry(berry, qty = 1)
pocket = berry.pocket pocket = berry.pocket
pbMessage(_INTL("{1} put the \\c[1]{2}\\c[0] in the <icon=bagPocket{3}>\\c[1]{4}\\c[0] Pocket.\1", pbMessage(_INTL("{1} put the \\c[1]{2}\\c[0] in the <icon=bagPocket{3}>\\c[1]{4}\\c[0] Pocket.\1",
$Trainer.name,itemname,pocket,PokemonBag.pocketNames()[pocket])) $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.")) pbMessage(_INTL("The soil returned to its soft and earthy state."))
berryData=[0,nil,0,0,0,0,0,0] berryData=[0,nil,0,0,0,0,0,0]
else else
@@ -186,7 +186,7 @@ def pbDayCareGenerateEgg
end end
end end
# Generate egg # Generate egg
egg = Pokemon.new(babyspecies,EGG_LEVEL) egg = Pokemon.new(babyspecies, Settings::EGG_LEVEL)
# Randomise personal ID # Randomise personal ID
pid = rand(65536) pid = rand(65536)
pid |= (rand(65536)<<16) pid |= (rand(65536)<<16)
@@ -217,7 +217,7 @@ def pbDayCareGenerateEgg
# Initial Moves # Initial Moves
initialmoves = egg.getMoveList initialmoves = egg.getMoveList
for k in initialmoves for k in initialmoves
if k[0]<=EGG_LEVEL if k[0] <= Settings::EGG_LEVEL
moves.push(k[1]) moves.push(k[1])
elsif mother.hasMove?(k[1]) && father.hasMove?(k[1]) elsif mother.hasMove?(k[1]) && father.hasMove?(k[1])
othermoves.push(k[1]) othermoves.push(k[1])
@@ -228,7 +228,7 @@ def pbDayCareGenerateEgg
moves.push(move) moves.push(move)
end end
# Inheriting Machine Moves # Inheriting Machine Moves
if BREEDING_CAN_INHERIT_MACHINE_MOVES if Settings::BREEDING_CAN_INHERIT_MACHINE_MOVES
GameData::Item.each do |i| GameData::Item.each do |i|
atk = i.move atk = i.move
next if !atk next if !atk
@@ -242,7 +242,7 @@ def pbDayCareGenerateEgg
if movefather.male? if movefather.male?
babyEggMoves.each { |m| moves.push(m) if movefather.hasMove?(m) } babyEggMoves.each { |m| moves.push(m) if movefather.hasMove?(m) }
end 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) } babyEggMoves.each { |m| moves.push(m) if movemother.hasMove?(m) }
end end
# Volt Tackle # Volt Tackle
@@ -361,7 +361,7 @@ def pbDayCareGenerateEgg
egg.obtain_text = _INTL("Day-Care Couple") egg.obtain_text = _INTL("Day-Care Couple")
egg.name = _INTL("Egg") egg.name = _INTL("Egg")
egg.steps_to_hatch = egg.species_data.hatch_steps egg.steps_to_hatch = egg.species_data.hatch_steps
egg.givePokerus if rand(65536)<POKERUS_CHANCE egg.givePokerus if rand(65536) < Settings::POKERUS_CHANCE
# Add egg to party # Add egg to party
$Trainer.party[$Trainer.party.length] = egg $Trainer.party[$Trainer.party.length] = egg
end end
@@ -79,7 +79,7 @@ module PBDayNight
# tone for the current time of day. # tone for the current time of day.
def self.getTone def self.getTone
@cachedTone = Tone.new(0,0,0) if !@cachedTone @cachedTone = Tone.new(0,0,0) if !@cachedTone
return @cachedTone if !TIME_SHADING return @cachedTone if !Settings::TIME_SHADING
if !@dayNightToneLastUpdate || if !@dayNightToneLastUpdate ||
Graphics.frame_count-@dayNightToneLastUpdate>=Graphics.frame_rate*30 Graphics.frame_count-@dayNightToneLastUpdate>=Graphics.frame_rate*30
getToneInternal getToneInternal
@@ -117,7 +117,7 @@ end
def pbDayNightTint(object) def pbDayNightTint(object)
return if !$scene.is_a?(Scene_Map) 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 GameData::MapMetadata.get($game_map.map_id).outdoor_map
tone = PBDayNight.getTone tone = PBDayNight.getTone
object.tone.set(tone.red,tone.green,tone.blue,tone.gray) object.tone.set(tone.red,tone.green,tone.blue,tone.gray)
+3 -3
View File
@@ -77,7 +77,7 @@ class Trainer
end end
def party_full? def party_full?
return party_count >= MAX_PARTY_SIZE return party_count >= Settings::MAX_PARTY_SIZE
end end
# Returns true if there are no usable Pokémon in the player's party. # Returns true if there are no usable Pokémon in the player's party.
@@ -211,7 +211,7 @@ class PlayerTrainer < Trainer
end end
def money=(value) def money=(value)
@money = value.clamp(0, MAX_MONEY) @money = value.clamp(0, Settings::MAX_MONEY)
end end
def badge_count def badge_count
@@ -301,7 +301,7 @@ class PlayerTrainer < Trainer
@character_ID = nil @character_ID = nil
@outfit = 0 @outfit = 0
@badges = [false] * 8 @badges = [false] * 8
@money = INITIAL_MONEY @money = Settings::INITIAL_MONEY
clear_pokedex clear_pokedex
@pokegear = false @pokegear = false
@pokedex = false @pokedex = false
@@ -19,7 +19,7 @@ end
def pbNewTrainer(tr_type, tr_name, tr_version, save_changes = true) def pbNewTrainer(tr_type, tr_name, tr_version, save_changes = true)
party = [] party = []
for i in 0...MAX_PARTY_SIZE for i in 0...Settings::MAX_PARTY_SIZE
if i == 0 if i == 0
pbMessage(_INTL("Please enter the first Pokémon.",i)) pbMessage(_INTL("Please enter the first Pokémon.",i))
else else
+1 -1
View File
@@ -432,7 +432,7 @@ def pbLearnMove(pkmn,move,ignoreifknown=false,bymachine=false,&block)
oldmovename = pkmn.moves[forgetmove].name oldmovename = pkmn.moves[forgetmove].name
oldmovepp = pkmn.moves[forgetmove].pp oldmovepp = pkmn.moves[forgetmove].pp
pkmn.moves[forgetmove] = Pokemon::Move.new(move) # Replaces current/total 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 pkmn.moves[forgetmove].pp = [oldmovepp,pkmn.moves[forgetmove].total_pp].min
end end
pbMessage(_INTL("1,\\wt[16] 2, and\\wt[16]...\\wt[16] ...\\wt[16] ... Ta-da!\\se[Battle ball drop]\1"),&block) pbMessage(_INTL("1,\\wt[16] 2, and\\wt[16]...\\wt[16] ...\\wt[16] ... Ta-da!\\se[Battle ball drop]\1"),&block)
@@ -372,7 +372,7 @@ ItemHandlers::UseOnPokemon.add(:POTION,proc { |item,pkmn,scene|
}) })
ItemHandlers::UseOnPokemon.copy(:POTION,:BERRYJUICE,:SWEETHEART) 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| ItemHandlers::UseOnPokemon.add(:SUPERPOTION,proc { |item,pkmn,scene|
next pbHPItem(pkmn,50,scene) next pbHPItem(pkmn,50,scene)
@@ -489,7 +489,7 @@ ItemHandlers::UseOnPokemon.add(:FULLHEAL,proc { |item,pkmn,scene|
ItemHandlers::UseOnPokemon.copy(:FULLHEAL, ItemHandlers::UseOnPokemon.copy(:FULLHEAL,
:LAVACOOKIE,:OLDGATEAU,:CASTELIACONE,:LUMIOSEGALETTE,:SHALOURSABLE, :LAVACOOKIE,:OLDGATEAU,:CASTELIACONE,:LUMIOSEGALETTE,:SHALOURSABLE,
:BIGMALASADA,:LUMBERRY) :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| ItemHandlers::UseOnPokemon.add(:FULLRESTORE,proc { |item,pkmn,scene|
if pkmn.fainted? || (pkmn.hp==pkmn.totalhp && pkmn.status==PBStatuses::NONE) if pkmn.fainted? || (pkmn.hp==pkmn.totalhp && pkmn.status==PBStatuses::NONE)
@@ -66,7 +66,7 @@ ItemHandlers::CanUseInBattle.copy(:POTION,
:SUPERPOTION,:HYPERPOTION,:MAXPOTION,:BERRYJUICE,:SWEETHEART,:FRESHWATER, :SUPERPOTION,:HYPERPOTION,:MAXPOTION,:BERRYJUICE,:SWEETHEART,:FRESHWATER,
:SODAPOP,:LEMONADE,:MOOMOOMILK,:ORANBERRY,:SITRUSBERRY,:ENERGYPOWDER, :SODAPOP,:LEMONADE,:MOOMOOMILK,:ORANBERRY,:SITRUSBERRY,:ENERGYPOWDER,
:ENERGYROOT) :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| ItemHandlers::CanUseInBattle.add(:AWAKENING,proc { |item,pokemon,battler,move,firstAction,battle,scene,showMessages|
next pbBattleItemCanCureStatus?(PBStatuses::SLEEP,pokemon,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, ItemHandlers::CanUseInBattle.copy(:FULLHEAL,
:LAVACOOKIE,:OLDGATEAU,:CASTELIACONE,:LUMIOSEGALETTE,:SHALOURSABLE, :LAVACOOKIE,:OLDGATEAU,:CASTELIACONE,:LUMIOSEGALETTE,:SHALOURSABLE,
:BIGMALASADA,:LUMBERRY,:HEALPOWDER) :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| ItemHandlers::CanUseInBattle.add(:FULLRESTORE,proc { |item,pokemon,battler,move,firstAction,battle,scene,showMessages|
if !pokemon.able? || 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,: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| ItemHandlers::BattleUseOnPokemon.add(:SUPERPOTION,proc { |item,pokemon,battler,choices,scene|
pbBattleHPItem(pokemon,battler,50,scene) pbBattleHPItem(pokemon,battler,50,scene)
@@ -417,7 +417,7 @@ ItemHandlers::BattleUseOnPokemon.add(:FULLHEAL,proc { |item,pokemon,battler,choi
ItemHandlers::BattleUseOnPokemon.copy(:FULLHEAL, ItemHandlers::BattleUseOnPokemon.copy(:FULLHEAL,
:LAVACOOKIE,:OLDGATEAU,:CASTELIACONE,:LUMIOSEGALETTE,:SHALOURSABLE, :LAVACOOKIE,:OLDGATEAU,:CASTELIACONE,:LUMIOSEGALETTE,:SHALOURSABLE,
:BIGMALASADA,:LUMBERRY) :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| ItemHandlers::BattleUseOnPokemon.add(:FULLRESTORE,proc { |item,pokemon,battler,choices,scene|
pokemon.heal_status pokemon.heal_status
@@ -523,7 +523,7 @@ ItemHandlers::BattleUseOnBattler.add(:YELLOWFLUTE,proc { |item,battler,scene|
ItemHandlers::BattleUseOnBattler.copy(:YELLOWFLUTE,:PERSIMBERRY) ItemHandlers::BattleUseOnBattler.copy(:YELLOWFLUTE,:PERSIMBERRY)
ItemHandlers::BattleUseOnBattler.add(:XATTACK,proc { |item,battler,scene| 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") battler.pokemon.changeHappiness("battleitem")
}) })
@@ -543,7 +543,7 @@ ItemHandlers::BattleUseOnBattler.add(:XATTACK6,proc { |item,battler,scene|
}) })
ItemHandlers::BattleUseOnBattler.add(:XDEFENSE,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") battler.pokemon.changeHappiness("battleitem")
}) })
@@ -571,7 +571,7 @@ ItemHandlers::BattleUseOnBattler.add(:XDEFENSE6,proc { |item,battler,scene|
ItemHandlers::BattleUseOnBattler.copy(:XDEFENSE6,:XDEFEND6) ItemHandlers::BattleUseOnBattler.copy(:XDEFENSE6,:XDEFEND6)
ItemHandlers::BattleUseOnBattler.add(:XSPATK,proc { |item,battler,scene| 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") battler.pokemon.changeHappiness("battleitem")
}) })
@@ -599,7 +599,7 @@ ItemHandlers::BattleUseOnBattler.add(:XSPATK6,proc { |item,battler,scene|
ItemHandlers::BattleUseOnBattler.copy(:XSPATK6,:XSPECIAL6) ItemHandlers::BattleUseOnBattler.copy(:XSPATK6,:XSPECIAL6)
ItemHandlers::BattleUseOnBattler.add(:XSPDEF,proc { |item,battler,scene| 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") battler.pokemon.changeHappiness("battleitem")
}) })
@@ -619,7 +619,7 @@ ItemHandlers::BattleUseOnBattler.add(:XSPDEF6,proc { |item,battler,scene|
}) })
ItemHandlers::BattleUseOnBattler.add(:XSPEED,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") battler.pokemon.changeHappiness("battleitem")
}) })
@@ -639,7 +639,7 @@ ItemHandlers::BattleUseOnBattler.add(:XSPEED6,proc { |item,battler,scene|
}) })
ItemHandlers::BattleUseOnBattler.add(:XACCURACY,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") battler.pokemon.changeHappiness("battleitem")
}) })
+10 -10
View File
@@ -76,11 +76,11 @@ def pbPokeRadarHighlightGrass(showmessage=true)
if PBTerrain.isJustGrass?($game_map.terrain_tag(x,y)) if PBTerrain.isJustGrass?($game_map.terrain_tag(x,y))
# Choose a rarity for the grass (0=normal, 1=rare, 2=shiny) # Choose a rarity for the grass (0=normal, 1=rare, 2=shiny)
s = (rand(100) < 25) ? 1 : 0 s = (rand(100) < 25) ? 1 : 0
if $PokemonTemp.pokeradar && $PokemonTemp.pokeradar[2]>0 if $PokemonTemp.pokeradar && $PokemonTemp.pokeradar[2] > 0
v = [(65536/SHINY_POKEMON_CHANCE)-$PokemonTemp.pokeradar[2]*200,200].max v = [(65536 / Settings::SHINY_POKEMON_CHANCE) - $PokemonTemp.pokeradar[2] * 200, 200].max
v = 0xFFFF/v v = 0xFFFF / v
v = rand(65536)/v v = rand(65536) / v
s = 2 if v==0 s = 2 if v == 0
end end
grasses.push([x,y,i,s]) grasses.push([x,y,i,s])
end end
@@ -95,11 +95,11 @@ def pbPokeRadarHighlightGrass(showmessage=true)
for grass in grasses for grass in grasses
case grass[3] case grass[3]
when 0 # Normal rustle 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 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 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
end end
$PokemonTemp.pokeradar[3] = grasses if $PokemonTemp.pokeradar $PokemonTemp.pokeradar[3] = grasses if $PokemonTemp.pokeradar
@@ -127,7 +127,7 @@ def pbPokeRadarGetEncounter(rarity = 0)
# Get all Poké Radar-exclusive encounters for this map # Get all Poké Radar-exclusive encounters for this map
map = $game_map.map_id map = $game_map.map_id
array = [] 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]) array.push(enc) if enc[0] == map && GameData::Species.exists?(enc[2])
end end
# If there are any exclusives, first have a chance of encountering those # If there are any exclusives, first have a chance of encountering those
@@ -137,7 +137,7 @@ def pbPokeRadarGetEncounter(rarity = 0)
array.each do |enc| array.each do |enc|
rnd -= enc[1] rnd -= enc[1]
next if rnd >= 0 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] return [enc[2], level]
end end
end end
+5 -5
View File
@@ -5,7 +5,7 @@ class PokemonBag
attr_accessor :lastpocket attr_accessor :lastpocket
def self.pocketNames def self.pocketNames
return pbPocketNames return Settings.bag_pocket_names
end end
def self.numPockets def self.numPockets
@@ -52,7 +52,7 @@ class PokemonBag
end end
def maxPocketSize(pocket) def maxPocketSize(pocket)
maxsize = BAG_MAX_POCKET_SIZE[pocket] maxsize = Settings::BAG_MAX_POCKET_SIZE[pocket]
return -1 if !maxsize return -1 if !maxsize
return maxsize return maxsize
end end
@@ -103,7 +103,7 @@ class PokemonBag
maxsize = maxPocketSize(pocket) maxsize = maxPocketSize(pocket)
maxsize = @pockets[pocket].length + 1 if maxsize < 0 maxsize = @pockets[pocket].length + 1 if maxsize < 0
return ItemStorageHelper.pbCanStore?( 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 end
def pbStoreItem(item, qty = 1) def pbStoreItem(item, qty = 1)
@@ -112,7 +112,7 @@ class PokemonBag
maxsize = maxPocketSize(pocket) maxsize = maxPocketSize(pocket)
maxsize = @pockets[pocket].length + 1 if maxsize < 0 maxsize = @pockets[pocket].length + 1 if maxsize < 0
return ItemStorageHelper.pbStoreItem( 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 end
def pbStoreAllOrNone(item, qty = 1) def pbStoreAllOrNone(item, qty = 1)
@@ -307,7 +307,7 @@ module ItemStorageHelper
if !itemslot if !itemslot
items[i] = [item, [qty, maxPerSlot].min] items[i] = [item, [qty, maxPerSlot].min]
qty -= items[i][1] 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 } items.sort! { |a, b| GameData::Item.get(a[0]).id_number <=> GameData::Item.get(b[0]).id_number }
end end
return true if qty == 0 return true if qty == 0
@@ -59,11 +59,11 @@ class PokemonStorage
attr_writer :unlockedWallpapers attr_writer :unlockedWallpapers
BASICWALLPAPERQTY = 16 BASICWALLPAPERQTY = 16
def initialize(maxBoxes = NUM_STORAGE_BOXES, maxPokemon = PokemonBox::BOX_SIZE) def initialize(maxBoxes = Settings::NUM_STORAGE_BOXES, maxPokemon = PokemonBox::BOX_SIZE)
@boxes = [] @boxes = []
for i in 0...maxBoxes for i in 0...maxBoxes
@boxes[i] = PokemonBox.new(_INTL("Box {1}",i+1),maxPokemon) @boxes[i] = PokemonBox.new(_INTL("Box {1}",i+1),maxPokemon)
@boxes[i].background = i%BASICWALLPAPERQTY @boxes[i].background = i % BASICWALLPAPERQTY
end end
@currentBox = 0 @currentBox = 0
@boxmode = -1 @boxmode = -1
@@ -131,7 +131,7 @@ class PokemonStorage
def maxPokemon(box) def maxPokemon(box)
return 0 if box >= self.maxBoxes 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 end
def full? def full?
@@ -144,7 +144,7 @@ class PokemonStorage
def pbFirstFreePos(box) def pbFirstFreePos(box)
if box==-1 if box==-1
ret = self.party.length ret = self.party.length
return (ret >= MAX_PARTY_SIZE) ? -1 : ret return (ret >= Settings::MAX_PARTY_SIZE) ? -1 : ret
end end
for i in 0...maxPokemon(box) for i in 0...maxPokemon(box)
return i if !self[box,i] return i if !self[box,i]
+3 -3
View File
@@ -367,7 +367,7 @@ class Pokemon
b = a & 0xFFFF b = a & 0xFFFF
c = (a >> 16) & 0xFFFF c = (a >> 16) & 0xFFFF
d = b ^ c d = b ^ c
@shiny = d < SHINY_POKEMON_CHANCE @shiny = d < Settings::SHINY_POKEMON_CHANCE
end end
return @shiny return @shiny
end end
@@ -734,7 +734,7 @@ class Pokemon
# @param strain [Integer] Pokérus strain to give # @param strain [Integer] Pokérus strain to give
def givePokerus(strain = 0) def givePokerus(strain = 0)
return if self.pokerusStage == 2 # Can't re-infect a cured Pokémon 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) time = 1 + (strain % 4)
@pokerus = time @pokerus = time
@pokerus |= strain << 4 @pokerus |= strain << 4
@@ -1012,7 +1012,7 @@ class Pokemon
@owner = Owner.new(0, '', 2, 2) @owner = Owner.new(0, '', 2, 2)
end end
@obtain_method = 0 # Met @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_map = ($game_map) ? $game_map.map_id : 0
@obtain_text = nil @obtain_text = nil
@obtain_level = level @obtain_level = level
+3 -3
View File
@@ -122,11 +122,11 @@ class PokemonPauseMenu
commands[cmdPokegear = commands.length] = _INTL("Pokégear") if $Trainer.pokegear commands[cmdPokegear = commands.length] = _INTL("Pokégear") if $Trainer.pokegear
commands[cmdTrainer = commands.length] = $Trainer.name commands[cmdTrainer = commands.length] = $Trainer.name
if pbInSafari? if pbInSafari?
if SAFARI_STEPS<=0 if Settings::SAFARI_STEPS <= 0
@scene.pbShowInfo(_INTL("Balls: {1}",pbSafariState.ballcount)) @scene.pbShowInfo(_INTL("Balls: {1}",pbSafariState.ballcount))
else else
@scene.pbShowInfo(_INTL("Steps: {1}/{2}\nBalls: {3}", @scene.pbShowInfo(_INTL("Steps: {1}/{2}\nBalls: {3}",
pbSafariState.steps,SAFARI_STEPS,pbSafariState.ballcount)) pbSafariState.steps, Settings::SAFARI_STEPS, pbSafariState.ballcount))
end end
commands[cmdQuit = commands.length] = _INTL("Quit") commands[cmdQuit = commands.length] = _INTL("Quit")
elsif pbInBugContest? elsif pbInBugContest?
@@ -148,7 +148,7 @@ class PokemonPauseMenu
loop do loop do
command = @scene.pbShowCommands(commands) command = @scene.pbShowCommands(commands)
if cmdPokedex>=0 && command==cmdPokedex if cmdPokedex>=0 && command==cmdPokedex
if USE_CURRENT_REGION_DEX if Settings::USE_CURRENT_REGION_DEX
pbFadeOutIn { pbFadeOutIn {
scene = PokemonPokedex_Scene.new scene = PokemonPokedex_Scene.new
screen = PokemonPokedexScreen.new(scene) screen = PokemonPokedexScreen.new(scene)
@@ -1,8 +1,8 @@
#=============================================================================== #===============================================================================
# Pokédex Regional Dexes list menu screen # Pokédex Regional Dexes list menu screen
# * For choosing which region list to view. Only appears when there is more # * 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 # than one viable region list to choose from, and if
# false. # Settings::USE_CURRENT_REGION_DEX is false.
#=============================================================================== #===============================================================================
class Window_DexesList < Window_CommandPokemon class Window_DexesList < Window_CommandPokemon
def initialize(commands,commands2,width) def initialize(commands,commands2,width)
@@ -93,7 +93,7 @@ class PokemonPokedexMenuScreen
def pbStartScreen def pbStartScreen
commands = [] commands = []
commands2 = [] commands2 = []
dexnames = pbDexNames dexnames = Settings.pokedex_names
for i in 0...$PokemonGlobal.pokedexViable.length for i in 0...$PokemonGlobal.pokedexViable.length
index = $PokemonGlobal.pokedexViable[i] index = $PokemonGlobal.pokedexViable[i]
if dexnames[index]==nil if dexnames[index]==nil
@@ -282,7 +282,7 @@ class PokemonPokedex_Scene
# return value of pbGetCurrentRegion, and thus will change according to the # return value of pbGetCurrentRegion, and thus will change according to the
# current map's MapPosition metadata setting. # current map's MapPosition metadata setting.
def pbGetPokedexRegion def pbGetPokedexRegion
if USE_CURRENT_REGION_DEX if Settings::USE_CURRENT_REGION_DEX
region = pbGetCurrentRegion region = pbGetCurrentRegion
region = -1 if region>=$PokemonGlobal.pokedexUnlocked.length-1 region = -1 if region>=$PokemonGlobal.pokedexUnlocked.length-1
return region return region
@@ -320,7 +320,7 @@ class PokemonPokedex_Scene
regionalSpecies = [] regionalSpecies = []
GameData::Species.each { |s| regionalSpecies.push(s.id) if s.form == 0 } GameData::Species.each { |s| regionalSpecies.push(s.id) if s.form == 0 }
end end
shift = DEXES_WITH_OFFSETS.include?(region) shift = Settings::DEXES_WITH_OFFSETS.include?(region)
ret = [] ret = []
regionalSpecies.each_with_index do |species, i| regionalSpecies.each_with_index do |species, i|
next if !species next if !species
@@ -386,7 +386,7 @@ class PokemonPokedex_Scene
# Write various bits of text # Write various bits of text
dexname = _INTL("Pokédex") dexname = _INTL("Pokédex")
if $PokemonGlobal.pokedexUnlocked.length>1 if $PokemonGlobal.pokedexUnlocked.length>1
thisdex = pbDexNames[pbGetSavePositionIndex] thisdex = Settings.pokedex_names[pbGetSavePositionIndex]
if thisdex!=nil if thisdex!=nil
dexname = (thisdex.is_a?(Array)) ? thisdex[0] : thisdex dexname = (thisdex.is_a?(Array)) ? thisdex[0] : thisdex
end end
@@ -792,8 +792,8 @@ class PokemonPokedex_Scene
def pbDexEntry(index) def pbDexEntry(index)
oldsprites = pbFadeOutAndHide(@sprites) oldsprites = pbFadeOutAndHide(@sprites)
region = -1 region = -1
if !USE_CURRENT_REGION_DEX if !Settings::USE_CURRENT_REGION_DEX
dexnames = pbDexNames dexnames = Settings.pokedex_names
if dexnames[pbGetSavePositionIndex].is_a?(Array) if dexnames[pbGetSavePositionIndex].is_a?(Array)
region = dexnames[pbGetSavePositionIndex][1] region = dexnames[pbGetSavePositionIndex][1]
end end
@@ -26,7 +26,7 @@ class PokemonPokedexInfo_Scene
@sprites["areamap"].setBitmap("Graphics/Pictures/#{@mapdata[@region][1]}") @sprites["areamap"].setBitmap("Graphics/Pictures/#{@mapdata[@region][1]}")
@sprites["areamap"].x += (Graphics.width-@sprites["areamap"].bitmap.width)/2 @sprites["areamap"].x += (Graphics.width-@sprites["areamap"].bitmap.width)/2
@sprites["areamap"].y += (Graphics.height+32-@sprites["areamap"].bitmap.height)/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]] if hidden[0]==@region && hidden[1]>0 && $game_switches[hidden[1]]
pbDrawImagePositions(@sprites["areamap"].bitmap,[ pbDrawImagePositions(@sprites["areamap"].bitmap,[
["Graphics/Pictures/#{hidden[4]}", ["Graphics/Pictures/#{hidden[4]}",
@@ -73,7 +73,7 @@ class PokemonPokedexInfo_Scene
dexnum = species dexnum = species
dexnumshift = false dexnumshift = false
if $PokemonGlobal.pokedexUnlocked[$PokemonGlobal.pokedexUnlocked.length - 1] 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 else
dexnum = 0 dexnum = 0
for i in 0...$PokemonGlobal.pokedexUnlocked.length - 1 # Regional Dexes for i in 0...$PokemonGlobal.pokedexUnlocked.length - 1 # Regional Dexes
@@ -81,7 +81,7 @@ class PokemonPokedexInfo_Scene
num = pbGetRegionalNumber(i,species) num = pbGetRegionalNumber(i,species)
next if num <= 0 next if num <= 0
dexnum = num dexnum = num
dexnumshift = true if DEXES_WITH_OFFSETS.include?(i) dexnumshift = true if Settings::DEXES_WITH_OFFSETS.include?(i)
break break
end end
end end
@@ -153,12 +153,12 @@ class PokemonPokedexInfo_Scene
case sp.gender_rate case sp.gender_rate
when PBGenderRates::AlwaysMale, PBGenderRates::AlwaysFemale, PBGenderRates::Genderless when PBGenderRates::AlwaysMale, PBGenderRates::AlwaysFemale, PBGenderRates::Genderless
real_gender = (sp.gender_rate == PBGenderRates::AlwaysFemale) ? 1 : 0 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 real_gender = 2 if sp.gender_rate == PBGenderRates::Genderless
ret.push([sp.form_name, real_gender, sp.form]) ret.push([sp.form_name, real_gender, sp.form])
else # Both male and female else # Both male and female
for real_gender in 0...2 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]) 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 break if sp.form_name && !sp.form_name.empty? # Only show 1 entry for each non-0 form
end end
@@ -554,14 +554,14 @@ class PokemonPokedexInfoScreen
def pbStartSceneSingle(species) # For use from a Pokémon's summary screen def pbStartSceneSingle(species) # For use from a Pokémon's summary screen
region = -1 region = -1
if USE_CURRENT_REGION_DEX if Settings::USE_CURRENT_REGION_DEX
region = pbGetCurrentRegion region = pbGetCurrentRegion
region = -1 if region>=$PokemonGlobal.pokedexUnlocked.length-1 region = -1 if region>=$PokemonGlobal.pokedexUnlocked.length-1
else else
region = $PokemonGlobal.pokedexDex # National Dex -1, regional dexes 0 etc. region = $PokemonGlobal.pokedexDex # National Dex -1, regional dexes 0 etc.
end end
dexnum = pbGetRegionalNumber(region,species) 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]] dexlist = [[species,GameData::Species.get(species).name,0,0,dexnum,dexnumshift]]
@scene.pbStartScene(dexlist,0,region) @scene.pbStartScene(dexlist,0,region)
@scene.pbScene @scene.pbScene
+26 -26
View File
@@ -448,7 +448,7 @@ class PokemonParty_Scene
pbBottomLeftLines(@sprites["helpwindow"],1) pbBottomLeftLines(@sprites["helpwindow"],1)
pbSetHelpText(starthelptext) pbSetHelpText(starthelptext)
# Add party Pokémon sprites # Add party Pokémon sprites
for i in 0...MAX_PARTY_SIZE for i in 0...Settings::MAX_PARTY_SIZE
if @party[i] if @party[i]
@sprites["pokemon#{i}"] = PokemonPartyPanel.new(@party[i],i,@viewport) @sprites["pokemon#{i}"] = PokemonPartyPanel.new(@party[i],i,@viewport)
else else
@@ -457,10 +457,10 @@ class PokemonParty_Scene
@sprites["pokemon#{i}"].text = annotations[i] if annotations @sprites["pokemon#{i}"].text = annotations[i] if annotations
end end
if @multiselect if @multiselect
@sprites["pokemon#{MAX_PARTY_SIZE}"] = PokemonPartyConfirmSprite.new(@viewport) @sprites["pokemon#{Settings::MAX_PARTY_SIZE}"] = PokemonPartyConfirmSprite.new(@viewport)
@sprites["pokemon#{MAX_PARTY_SIZE + 1}"] = PokemonPartyCancelSprite2.new(@viewport) @sprites["pokemon#{Settings::MAX_PARTY_SIZE + 1}"] = PokemonPartyCancelSprite2.new(@viewport)
else else
@sprites["pokemon#{MAX_PARTY_SIZE}"] = PokemonPartyCancelSprite.new(@viewport) @sprites["pokemon#{Settings::MAX_PARTY_SIZE}"] = PokemonPartyCancelSprite.new(@viewport)
end end
# Select first Pokémon # Select first Pokémon
@activecmd = 0 @activecmd = 0
@@ -573,14 +573,14 @@ class PokemonParty_Scene
end end
def pbAnnotate(annot) 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 @sprites["pokemon#{i}"].text = (annot) ? annot[i] : nil
end end
end end
def pbSelect(item) def pbSelect(item)
@activecmd = item @activecmd = item
numsprites = MAX_PARTY_SIZE + ((@multiselect) ? 2 : 1) numsprites = Settings::MAX_PARTY_SIZE + ((@multiselect) ? 2 : 1)
for i in 0...numsprites for i in 0...numsprites
@sprites["pokemon#{i}"].selected = (i==@activecmd) @sprites["pokemon#{i}"].selected = (i==@activecmd)
end end
@@ -620,7 +620,7 @@ class PokemonParty_Scene
Input.update Input.update
self.update self.update
end end
for i in 0...MAX_PARTY_SIZE for i in 0...Settings::MAX_PARTY_SIZE
@sprites["pokemon#{i}"].preselected = false @sprites["pokemon#{i}"].preselected = false
@sprites["pokemon#{i}"].switching = false @sprites["pokemon#{i}"].switching = false
end end
@@ -628,7 +628,7 @@ class PokemonParty_Scene
end end
def pbClearSwitching 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}"].preselected = false
@sprites["pokemon#{i}"].switching = false @sprites["pokemon#{i}"].switching = false
end end
@@ -674,7 +674,7 @@ class PokemonParty_Scene
end end
def pbChoosePokemon(switching=false,initialsel=-1,canswitch=0) 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}"].preselected = (switching && i==@activecmd)
@sprites["pokemon#{i}"].switching = switching @sprites["pokemon#{i}"].switching = switching
end end
@@ -695,12 +695,12 @@ class PokemonParty_Scene
end end
if @activecmd!=oldsel # Changing selection if @activecmd!=oldsel # Changing selection
pbPlayCursorSE pbPlayCursorSE
numsprites = MAX_PARTY_SIZE + ((@multiselect) ? 2 : 1) numsprites = Settings::MAX_PARTY_SIZE + ((@multiselect) ? 2 : 1)
for i in 0...numsprites for i in 0...numsprites
@sprites["pokemon#{i}"].selected = (i==@activecmd) @sprites["pokemon#{i}"].selected = (i==@activecmd)
end end
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 if Input.trigger?(Input::A) && canswitch==1 && @activecmd!=cancelsprite
pbPlayDecisionSE pbPlayDecisionSE
return [1,@activecmd] return [1,@activecmd]
@@ -722,13 +722,13 @@ class PokemonParty_Scene
end end
def pbChangeSelection(key,currentsel) def pbChangeSelection(key,currentsel)
numsprites = MAX_PARTY_SIZE + ((@multiselect) ? 2 : 1) numsprites = Settings::MAX_PARTY_SIZE + ((@multiselect) ? 2 : 1)
case key case key
when Input::LEFT when Input::LEFT
begin begin
currentsel -= 1 currentsel -= 1
end while currentsel > 0 && currentsel < @party.length && !@party[currentsel] 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 currentsel = @party.length - 1
end end
currentsel = numsprites - 1 if currentsel < 0 currentsel = numsprites - 1 if currentsel < 0
@@ -737,12 +737,12 @@ class PokemonParty_Scene
currentsel += 1 currentsel += 1
end while currentsel < @party.length && !@party[currentsel] end while currentsel < @party.length && !@party[currentsel]
if currentsel == @party.length if currentsel == @party.length
currentsel = MAX_PARTY_SIZE currentsel = Settings::MAX_PARTY_SIZE
elsif currentsel == numsprites elsif currentsel == numsprites
currentsel = 0 currentsel = 0
end end
when Input::UP when Input::UP
if currentsel >= MAX_PARTY_SIZE if currentsel >= Settings::MAX_PARTY_SIZE
begin begin
currentsel -= 1 currentsel -= 1
end while currentsel > 0 && !@party[currentsel] end while currentsel > 0 && !@party[currentsel]
@@ -751,19 +751,19 @@ class PokemonParty_Scene
currentsel -= 2 currentsel -= 2
end while currentsel > 0 && !@party[currentsel] end while currentsel > 0 && !@party[currentsel]
end end
if currentsel >= @party.length && currentsel < MAX_PARTY_SIZE if currentsel >= @party.length && currentsel < Settings::MAX_PARTY_SIZE
currentsel = @party.length-1 currentsel = @party.length-1
end end
currentsel = numsprites - 1 if currentsel < 0 currentsel = numsprites - 1 if currentsel < 0
when Input::DOWN when Input::DOWN
if currentsel >= MAX_PARTY_SIZE - 1 if currentsel >= Settings::MAX_PARTY_SIZE - 1
currentsel += 1 currentsel += 1
else else
currentsel += 2 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 end
if currentsel >= @party.length && currentsel < MAX_PARTY_SIZE if currentsel >= @party.length && currentsel < Settings::MAX_PARTY_SIZE
currentsel = MAX_PARTY_SIZE currentsel = Settings::MAX_PARTY_SIZE
elsif currentsel >= numsprites elsif currentsel >= numsprites
currentsel = 0 currentsel = 0
end end
@@ -774,14 +774,14 @@ class PokemonParty_Scene
def pbHardRefresh def pbHardRefresh
oldtext = [] oldtext = []
lastselected = -1 lastselected = -1
for i in 0...MAX_PARTY_SIZE for i in 0...Settings::MAX_PARTY_SIZE
oldtext.push(@sprites["pokemon#{i}"].text) oldtext.push(@sprites["pokemon#{i}"].text)
lastselected = i if @sprites["pokemon#{i}"].selected lastselected = i if @sprites["pokemon#{i}"].selected
@sprites["pokemon#{i}"].dispose @sprites["pokemon#{i}"].dispose
end end
lastselected = @party.length-1 if lastselected>=@party.length lastselected = @party.length-1 if lastselected>=@party.length
lastselected = 0 if lastselected<0 lastselected = 0 if lastselected<0
for i in 0...MAX_PARTY_SIZE for i in 0...Settings::MAX_PARTY_SIZE
if @party[i] if @party[i]
@sprites["pokemon#{i}"] = PokemonPartyPanel.new(@party[i],i,@viewport) @sprites["pokemon#{i}"] = PokemonPartyPanel.new(@party[i],i,@viewport)
else else
@@ -793,7 +793,7 @@ class PokemonParty_Scene
end end
def pbRefresh def pbRefresh
for i in 0...MAX_PARTY_SIZE for i in 0...Settings::MAX_PARTY_SIZE
sprite = @sprites["pokemon#{i}"] sprite = @sprites["pokemon#{i}"]
if sprite if sprite
if sprite.is_a?(PokemonPartyPanel) if sprite.is_a?(PokemonPartyPanel)
@@ -971,7 +971,7 @@ class PokemonPartyScreen
positions = [_INTL("FIRST"), _INTL("SECOND"), _INTL("THIRD"), _INTL("FOURTH"), positions = [_INTL("FIRST"), _INTL("SECOND"), _INTL("THIRD"), _INTL("FOURTH"),
_INTL("FIFTH"), _INTL("SIXTH"), _INTL("SEVENTH"), _INTL("EIGHTH"), _INTL("FIFTH"), _INTL("SIXTH"), _INTL("SEVENTH"), _INTL("EIGHTH"),
_INTL("NINTH"), _INTL("TENTH"), _INTL("ELEVENTH"), _INTL("TWELFTH")] _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 if i < positions.length
ordinals.push(positions[i]) ordinals.push(positions[i])
else else
@@ -1006,12 +1006,12 @@ class PokemonPartyScreen
end end
@scene.pbAnnotate(annot) @scene.pbAnnotate(annot)
if realorder.length==ruleset.number && addedEntry if realorder.length==ruleset.number && addedEntry
@scene.pbSelect(MAX_PARTY_SIZE) @scene.pbSelect(Settings::MAX_PARTY_SIZE)
end end
@scene.pbSetHelpText(_INTL("Choose Pokémon and confirm.")) @scene.pbSetHelpText(_INTL("Choose Pokémon and confirm."))
pkmnid = @scene.pbChoosePokemon pkmnid = @scene.pbChoosePokemon
addedEntry = false addedEntry = false
if pkmnid == MAX_PARTY_SIZE # Confirm was chosen if pkmnid == Settings::MAX_PARTY_SIZE # Confirm was chosen
ret = [] ret = []
for i in realorder; ret.push(@party[i]); end for i in realorder; ret.push(@party[i]); end
error = [] error = []
+2 -2
View File
@@ -391,7 +391,7 @@ class PokemonSummary_Scene
dexnum = @pokemon.species dexnum = @pokemon.species
dexnumshift = false dexnumshift = false
if $PokemonGlobal.pokedexUnlocked[$PokemonGlobal.pokedexUnlocked.length-1] 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 else
dexnum = 0 dexnum = 0
for i in 0...$PokemonGlobal.pokedexUnlocked.length-1 for i in 0...$PokemonGlobal.pokedexUnlocked.length-1
@@ -399,7 +399,7 @@ class PokemonSummary_Scene
num = pbGetRegionalNumber(i,@pokemon.species) num = pbGetRegionalNumber(i,@pokemon.species)
next if num<=0 next if num<=0
dexnum = num dexnum = num
dexnumshift = true if DEXES_WITH_OFFSETS.include?(i) dexnumshift = true if Settings::DEXES_WITH_OFFSETS.include?(i)
break break
end end
end end
+3 -3
View File
@@ -419,7 +419,7 @@ class PokemonBag_Scene
elsif Input.trigger?(Input::A) # Start switching the selected item elsif Input.trigger?(Input::A) # Start switching the selected item
if !@choosing if !@choosing
if thispocket.length>1 && itemwindow.index<thispocket.length && if thispocket.length>1 && itemwindow.index<thispocket.length &&
!BAG_POCKET_AUTO_SORT[itemwindow.pocket] !Settings::BAG_POCKET_AUTO_SORT[itemwindow.pocket]
itemwindow.sorting = true itemwindow.sorting = true
swapinitialpos = itemwindow.index swapinitialpos = itemwindow.index
pbPlayDecisionSE pbPlayDecisionSE
@@ -544,10 +544,10 @@ class PokemonBagScreen
qty = @bag.pbQuantity(item) qty = @bag.pbQuantity(item)
itemplural = itm.name_plural itemplural = itm.name_plural
params = ChooseNumberParams.new params = ChooseNumberParams.new
params.setRange(0,BAG_MAX_PER_SLOT) params.setRange(0, Settings::BAG_MAX_PER_SLOT)
params.setDefaultValue(qty) params.setDefaultValue(qty)
newqty = pbMessageChooseNumber( newqty = pbMessageChooseNumber(
_INTL("Choose new quantity of {1} (max. #{BAG_MAX_PER_SLOT}).",itemplural),params) { @scene.pbUpdate } _INTL("Choose new quantity of {1} (max. #{Settings::BAG_MAX_PER_SLOT}).",itemplural),params) { @scene.pbUpdate }
if newqty>qty if newqty>qty
@bag.pbStoreItem(item,newqty-qty) @bag.pbStoreItem(item,newqty-qty)
elsif newqty<qty elsif newqty<qty
+1 -1
View File
@@ -119,7 +119,7 @@ class PokemonRegionMap_Scene
@sprites["map"].setBitmap("Graphics/Pictures/#{@map[1]}") @sprites["map"].setBitmap("Graphics/Pictures/#{@map[1]}")
@sprites["map"].x += (Graphics.width-@sprites["map"].bitmap.width)/2 @sprites["map"].x += (Graphics.width-@sprites["map"].bitmap.width)/2
@sprites["map"].y += (Graphics.height-@sprites["map"].bitmap.height)/2 @sprites["map"].y += (Graphics.height-@sprites["map"].bitmap.height)/2
for hidden in REGION_MAP_EXTRAS for hidden in Settings::REGION_MAP_EXTRAS
if hidden[0]==mapindex && ((@wallmap && hidden[5]) || if hidden[0]==mapindex && ((@wallmap && hidden[5]) ||
(!@wallmap && hidden[1]>0 && $game_switches[hidden[1]])) (!@wallmap && hidden[1]>0 && $game_switches[hidden[1]]))
if !@sprites["map2"] if !@sprites["map2"]
+2 -2
View File
@@ -323,7 +323,7 @@ class PokemonLoadScreen
commands[cmdNewGame = commands.length] = _INTL("New Game") commands[cmdNewGame = commands.length] = _INTL("New Game")
end end
commands[cmdOption = commands.length] = _INTL("Options") commands[cmdOption = commands.length] = _INTL("Options")
commands[cmdLanguage = commands.length] = _INTL("Language") if LANGUAGES.length>=2 commands[cmdLanguage = commands.length] = _INTL("Language") if Settings::LANGUAGES.length>=2
commands[cmdDebug = commands.length] = _INTL("Debug") if $DEBUG commands[cmdDebug = commands.length] = _INTL("Debug") if $DEBUG
commands[cmdQuit = commands.length] = _INTL("Quit Game") commands[cmdQuit = commands.length] = _INTL("Quit Game")
@scene.pbStartScene(commands,showContinue,trainer,framecount,mapid) @scene.pbStartScene(commands,showContinue,trainer,framecount,mapid)
@@ -452,7 +452,7 @@ class PokemonLoadScreen
pbPlayDecisionSE pbPlayDecisionSE
@scene.pbEndScene @scene.pbEndScene
$PokemonSystem.language = pbChooseLanguage $PokemonSystem.language = pbChooseLanguage
pbLoadMessages("Data/"+LANGUAGES[$PokemonSystem.language][1]) pbLoadMessages("Data/"+Settings::LANGUAGES[$PokemonSystem.language][1])
savedata = [] savedata = []
if safeExists?(savefile) if safeExists?(savefile)
File.open(savefile,"rb") { |f| File.open(savefile,"rb") { |f|
+10 -10
View File
@@ -19,11 +19,11 @@ class PokemonSystem
@textspeed = 1 # Text speed (0=slow, 1=normal, 2=fast) @textspeed = 1 # Text speed (0=slow, 1=normal, 2=fast)
@battlescene = 0 # Battle effects (animations) (0=on, 1=off) @battlescene = 0 # Battle effects (animations) (0=on, 1=off)
@battlestyle = 0 # Battle style (0=switch, 1=set) @battlestyle = 0 # Battle style (0=switch, 1=set)
@frame = 0 # Default window frame (see also $TextFrames) @frame = 0 # Default window frame (see also Settings::MENU_WINDOWSKINS)
@textskin = 0 # Speech frame @textskin = 0 # Speech frame
@font = 0 # Font (see also $VersionStyles) @font = 0 # Font (see also Settings::FONT_OPTIONS)
@screensize = (SCREEN_SCALE * 2).floor - 1 # 0=half size, 1=full size, 2=full-and-a-half size, 3=double size @screensize = (Settings::SCREEN_SCALE * 2).floor - 1 # 0=half size, 1=full size, 2=full-and-a-half size, 3=double size
@language = 0 # Language (see also LANGUAGES in script PokemonSystem) @language = 0 # Language (see also Settings::LANGUAGES in script PokemonSystem)
@runstyle = 0 # Run key functionality (0=hold to run, 1=toggle auto-run) @runstyle = 0 # Run key functionality (0=hold to run, 1=toggle auto-run)
@bgmvolume = 100 # Volume of background music and ME @bgmvolume = 100 # Volume of background music and ME
@sevolume = 100 # Volume of sound effects @sevolume = 100 # Volume of sound effects
@@ -36,7 +36,7 @@ class PokemonSystem
def bgmvolume; return @bgmvolume || 100; end def bgmvolume; return @bgmvolume || 100; end
def sevolume; return @sevolume || 100; end def sevolume; return @sevolume || 100; end
def textinput; return @textinput || 0; end def textinput; return @textinput || 0; end
def tilemap; return MAP_VIEW_MODE; end def tilemap; return Settings::MAP_VIEW_MODE; end
end end
#=============================================================================== #===============================================================================
@@ -364,25 +364,25 @@ class PokemonOption_Scene
end end
} }
), ),
NumberOption.new(_INTL("Speech Frame"),1,$SpeechFrames.length, NumberOption.new(_INTL("Speech Frame"),1,Settings::SPEECH_WINDOWSKINS.length,
proc { $PokemonSystem.textskin }, proc { $PokemonSystem.textskin },
proc { |value| proc { |value|
$PokemonSystem.textskin = value $PokemonSystem.textskin = value
MessageConfig.pbSetSpeechFrame("Graphics/Windowskins/" + $SpeechFrames[value]) MessageConfig.pbSetSpeechFrame("Graphics/Windowskins/" + Settings::SPEECH_WINDOWSKINS[value])
} }
), ),
NumberOption.new(_INTL("Menu Frame"),1,$TextFrames.length, NumberOption.new(_INTL("Menu Frame"),1,Settings::MENU_WINDOWSKINS.length,
proc { $PokemonSystem.frame }, proc { $PokemonSystem.frame },
proc { |value| proc { |value|
$PokemonSystem.frame = value $PokemonSystem.frame = value
MessageConfig.pbSetSystemFrame("Graphics/Windowskins/" + $TextFrames[value]) MessageConfig.pbSetSystemFrame("Graphics/Windowskins/" + Settings::MENU_WINDOWSKINS[value])
} }
), ),
EnumOption.new(_INTL("Font Style"),[_INTL("Em"),_INTL("R/S"),_INTL("FRLG"),_INTL("DP")], EnumOption.new(_INTL("Font Style"),[_INTL("Em"),_INTL("R/S"),_INTL("FRLG"),_INTL("DP")],
proc { $PokemonSystem.font }, proc { $PokemonSystem.font },
proc { |value| proc { |value|
$PokemonSystem.font = value $PokemonSystem.font = value
MessageConfig.pbSetSystemFontName($VersionStyles[value]) MessageConfig.pbSetSystemFontName(Settings::FONT_OPTIONS[value])
} }
), ),
EnumOption.new(_INTL("Text Entry"),[_INTL("Cursor"),_INTL("Keyboard")], EnumOption.new(_INTL("Text Entry"),[_INTL("Cursor"),_INTL("Keyboard")],
@@ -449,7 +449,7 @@ class PokemonBoxPartySprite < SpriteWrapper
@party = party @party = party
@boxbitmap = AnimatedBitmap.new("Graphics/Pictures/Storage/overlay_party") @boxbitmap = AnimatedBitmap.new("Graphics/Pictures/Storage/overlay_party")
@pokemonsprites = [] @pokemonsprites = []
for i in 0...MAX_PARTY_SIZE for i in 0...Settings::MAX_PARTY_SIZE
@pokemonsprites[i] = nil @pokemonsprites[i] = nil
pokemon = @party[i] pokemon = @party[i]
if pokemon if pokemon
@@ -465,7 +465,7 @@ class PokemonBoxPartySprite < SpriteWrapper
end end
def dispose def dispose
for i in 0...MAX_PARTY_SIZE for i in 0...Settings::MAX_PARTY_SIZE
@pokemonsprites[i].dispose if @pokemonsprites[i] @pokemonsprites[i].dispose if @pokemonsprites[i]
end end
@boxbitmap.dispose @boxbitmap.dispose
@@ -485,7 +485,7 @@ class PokemonBoxPartySprite < SpriteWrapper
def color=(value) def color=(value)
super super
for i in 0...MAX_PARTY_SIZE for i in 0...Settings::MAX_PARTY_SIZE
if @pokemonsprites[i] && !@pokemonsprites[i].disposed? if @pokemonsprites[i] && !@pokemonsprites[i].disposed?
@pokemonsprites[i].color = pbSrcOver(@pokemonsprites[i].color,value) @pokemonsprites[i].color = pbSrcOver(@pokemonsprites[i].color,value)
end end
@@ -494,7 +494,7 @@ class PokemonBoxPartySprite < SpriteWrapper
def visible=(value) def visible=(value)
super super
for i in 0...MAX_PARTY_SIZE for i in 0...Settings::MAX_PARTY_SIZE
if @pokemonsprites[i] && !@pokemonsprites[i].disposed? if @pokemonsprites[i] && !@pokemonsprites[i].disposed?
@pokemonsprites[i].visible = value @pokemonsprites[i].visible = value
end end
@@ -535,15 +535,15 @@ class PokemonBoxPartySprite < SpriteWrapper
]) ])
xvalues = [] # [18, 90, 18, 90, 18, 90] xvalues = [] # [18, 90, 18, 90, 18, 90]
yvalues = [] # [2, 18, 66, 82, 130, 146] yvalues = [] # [2, 18, 66, 82, 130, 146]
for i in 0...MAX_PARTY_SIZE for i in 0...Settings::MAX_PARTY_SIZE
xvalues.push(18 + 72 * (i % 2)) xvalues.push(18 + 72 * (i % 2))
yvalues.push(2 + 16 * (i % 2) + 64 * (i / 2)) yvalues.push(2 + 16 * (i % 2) + 64 * (i / 2))
end end
for j in 0...MAX_PARTY_SIZE for j in 0...Settings::MAX_PARTY_SIZE
@pokemonsprites[j] = nil if @pokemonsprites[j] && @pokemonsprites[j].disposed? @pokemonsprites[j] = nil if @pokemonsprites[j] && @pokemonsprites[j].disposed?
end end
@pokemonsprites.compact! @pokemonsprites.compact!
for j in 0...MAX_PARTY_SIZE for j in 0...Settings::MAX_PARTY_SIZE
sprite = @pokemonsprites[j] sprite = @pokemonsprites[j]
if sprite && !sprite.disposed? if sprite && !sprite.disposed?
sprite.viewport = self.viewport sprite.viewport = self.viewport
@@ -556,7 +556,7 @@ class PokemonBoxPartySprite < SpriteWrapper
def update def update
super super
for i in 0...MAX_PARTY_SIZE for i in 0...Settings::MAX_PARTY_SIZE
@pokemonsprites[i].update if @pokemonsprites[i] && !@pokemonsprites[i].disposed? @pokemonsprites[i].update if @pokemonsprites[i] && !@pokemonsprites[i].disposed?
end end
end end
@@ -773,7 +773,7 @@ class PokemonStorageScene
return if selection < 0 return if selection < 0
xvalues = [] # [200, 272, 200, 272, 200, 272, 236] xvalues = [] # [200, 272, 200, 272, 200, 272, 236]
yvalues = [] # [2, 18, 66, 82, 130, 146, 220] yvalues = [] # [2, 18, 66, 82, 130, 146, 220]
for i in 0...MAX_PARTY_SIZE for i in 0...Settings::MAX_PARTY_SIZE
xvalues.push(200 + 72 * (i % 2)) xvalues.push(200 + 72 * (i % 2))
yvalues.push(2 + 16 * (i % 2) + 64 * (i / 2)) yvalues.push(2 + 16 * (i % 2) + 64 * (i / 2))
end end
@@ -791,23 +791,23 @@ class PokemonStorageScene
case key case key
when Input::LEFT when Input::LEFT
selection -= 1 selection -= 1
selection = MAX_PARTY_SIZE if selection < 0 selection = Settings::MAX_PARTY_SIZE if selection < 0
when Input::RIGHT when Input::RIGHT
selection += 1 selection += 1
selection = 0 if selection > MAX_PARTY_SIZE selection = 0 if selection > Settings::MAX_PARTY_SIZE
when Input::UP when Input::UP
if selection == MAX_PARTY_SIZE if selection == Settings::MAX_PARTY_SIZE
selection = MAX_PARTY_SIZE - 1 selection = Settings::MAX_PARTY_SIZE - 1
else else
selection -= 2 selection -= 2
selection = MAX_PARTY_SIZE if selection < 0 selection = Settings::MAX_PARTY_SIZE if selection < 0
end end
when Input::DOWN when Input::DOWN
if selection == MAX_PARTY_SIZE if selection == Settings::MAX_PARTY_SIZE
selection = 0 selection = 0
else else
selection += 2 selection += 2
selection = MAX_PARTY_SIZE if selection > MAX_PARTY_SIZE selection = Settings::MAX_PARTY_SIZE if selection > Settings::MAX_PARTY_SIZE
end end
end end
return selection return selection
@@ -952,10 +952,10 @@ class PokemonStorageScene
@selection = selection @selection = selection
return -1 return -1
elsif Input.trigger?(Input::C) elsif Input.trigger?(Input::C)
if selection >= 0 && selection < MAX_PARTY_SIZE if selection >= 0 && selection < Settings::MAX_PARTY_SIZE
@selection = selection @selection = selection
return selection return selection
elsif selection == MAX_PARTY_SIZE # Close Box elsif selection == Settings::MAX_PARTY_SIZE # Close Box
@selection = selection @selection = selection
return (depositing) ? -3 : -1 return (depositing) ? -3 : -1
end end
+1 -1
View File
@@ -247,7 +247,7 @@ def pbPokeCenterPC
end end
def pbGetStorageCreator def pbGetStorageCreator
creator = pbStorageCreator creator = Settings.storage_creator_name
creator = _INTL("Bill") if !creator || creator=="" creator = _INTL("Bill") if !creator || creator==""
return creator return creator
end end
+2 -2
View File
@@ -558,8 +558,8 @@ class PokemonMartScreen
end end
quantity=1 quantity=1
else else
maxafford=(price<=0) ? BAG_MAX_PER_SLOT : @adapter.getMoney/price maxafford = (price <= 0) ? Settings::BAG_MAX_PER_SLOT : @adapter.getMoney / price
maxafford=BAG_MAX_PER_SLOT if maxafford>BAG_MAX_PER_SLOT maxafford = Settings::BAG_MAX_PER_SLOT if maxafford > Settings::BAG_MAX_PER_SLOT
quantity=@scene.pbChooseNumber( quantity=@scene.pbChooseNumber(
_INTL("{1}? Certainly. How many would you like?",itemname),item,maxafford) _INTL("{1}? Certainly. How many would you like?",itemname),item,maxafford)
next if quantity==0 next if quantity==0
@@ -93,8 +93,8 @@ class SlotMachineScore < BitmapSprite
end end
def score=(value) def score=(value)
@score=value @score = value
@score=MAX_COINS if @score>MAX_COINS @score = Settings::MAX_COINS if @score > Settings::MAX_COINS
refresh refresh
end end
@@ -212,7 +212,7 @@ class SlotMachineScene
update update
@sprites["payout"].score -= 1 @sprites["payout"].score -= 1
@sprites["credit"].score += 1 @sprites["credit"].score += 1
if Input.trigger?(Input::C) || @sprites["credit"].score==MAX_COINS if Input.trigger?(Input::C) || @sprites["credit"].score == Settings::MAX_COINS
@sprites["credit"].score += @sprites["payout"].score @sprites["credit"].score += @sprites["payout"].score
@sprites["payout"].score = 0 @sprites["payout"].score = 0
end end
@@ -286,8 +286,8 @@ class SlotMachineScene
update update
@sprites["window1"].bitmap.clear if @sprites["window1"].bitmap @sprites["window1"].bitmap.clear if @sprites["window1"].bitmap
@sprites["window2"].bitmap.clear if @sprites["window2"].bitmap @sprites["window2"].bitmap.clear if @sprites["window2"].bitmap
if @sprites["credit"].score==MAX_COINS if @sprites["credit"].score == Settings::MAX_COINS
pbMessage(_INTL("You've got {1} Coins.",MAX_COINS.to_s_formatted)) pbMessage(_INTL("You've got {1} Coins.", Settings::MAX_COINS.to_s_formatted))
break break
elsif $PokemonGlobal.coins==0 elsif $PokemonGlobal.coins==0
pbMessage(_INTL("You've run out of Coins.\nGame over!")) pbMessage(_INTL("You've run out of Coins.\nGame over!"))
@@ -392,7 +392,7 @@ def pbSlotMachine(difficulty=1)
pbMessage(_INTL("It's a Slot Machine.")) pbMessage(_INTL("It's a Slot Machine."))
elsif $PokemonGlobal.coins==0 elsif $PokemonGlobal.coins==0
pbMessage(_INTL("You don't have any Coins to play!")) pbMessage(_INTL("You don't have any Coins to play!"))
elsif $PokemonGlobal.coins==MAX_COINS elsif $PokemonGlobal.coins == Settings::MAX_COINS
pbMessage(_INTL("Your Coin Case is full!")) pbMessage(_INTL("Your Coin Case is full!"))
else else
pbFadeOutIn { pbFadeOutIn {
@@ -108,9 +108,9 @@ class VoltorbFlip
@sprites["curtainL"].visible=false @sprites["curtainL"].visible=false
@sprites["curtainR"].visible=false @sprites["curtainR"].visible=false
@sprites["curtain"].opacity=100 @sprites["curtain"].opacity=100
if $PokemonGlobal.coins>=MAX_COINS if $PokemonGlobal.coins >= Settings::MAX_COINS
pbMessage(_INTL("You've gathered {1} Coins. You cannot gather any more.",MAX_COINS.to_s_formatted)) pbMessage(_INTL("You've gathered {1} Coins. You cannot gather any more.", Settings::MAX_COINS.to_s_formatted))
$PokemonGlobal.coins=MAX_COINS # As a precaution $PokemonGlobal.coins = Settings::MAX_COINS # As a precaution
@quit=true @quit=true
# elsif !pbConfirmMessage(_INTL("Play Voltorb Flip Lv. {1}?",@level)) && $PokemonGlobal.coins<99999 # elsif !pbConfirmMessage(_INTL("Play Voltorb Flip Lv. {1}?",@level)) && $PokemonGlobal.coins<99999
# @quit=true # @quit=true
@@ -616,7 +616,7 @@ end
def pbVoltorbFlip def pbVoltorbFlip
if GameData::Item.exists?(:COINCASE) && !$PokemonBag.pbHasItem?(:COINCASE) if GameData::Item.exists?(:COINCASE) && !$PokemonBag.pbHasItem?(:COINCASE)
pbMessage(_INTL("You can't play unless you have a Coin Case.")) pbMessage(_INTL("You can't play unless you have a Coin Case."))
elsif $PokemonGlobal.coins==MAX_COINS elsif $PokemonGlobal.coins == Settings::MAX_COINS
pbMessage(_INTL("Your Coin Case is full!")) pbMessage(_INTL("Your Coin Case is full!"))
else else
scene=VoltorbFlip.new scene=VoltorbFlip.new
@@ -37,7 +37,7 @@ class SafariState
@start = [$game_map.map_id,$game_player.x,$game_player.y,$game_player.direction] @start = [$game_map.map_id,$game_player.x,$game_player.y,$game_player.direction]
@ballcount = ballcount @ballcount = ballcount
@inProgress = true @inProgress = true
@steps = SAFARI_STEPS @steps = Settings::SAFARI_STEPS
end end
def pbEnd def pbEnd
@@ -76,7 +76,7 @@ end
Events.onStepTakenTransferPossible += proc { |_sender,e| Events.onStepTakenTransferPossible += proc { |_sender,e|
handled = e[0] handled = e[0]
next if handled[0] next if handled[0]
if pbInSafari? && pbSafariState.decision==0 && SAFARI_STEPS>0 if pbInSafari? && pbSafariState.decision==0 && Settings::SAFARI_STEPS > 0
pbSafariState.steps -= 1 pbSafariState.steps -= 1
if pbSafariState.steps<=0 if pbSafariState.steps<=0
pbMessage(_INTL("PA: Ding-dong!\1")) pbMessage(_INTL("PA: Ding-dong!\1"))
@@ -13,7 +13,7 @@ class BugContestState
_INTL("Picnicker Cindy"), _INTL("Picnicker Cindy"),
_INTL("Youngster Samuel") _INTL("Youngster Samuel")
] ]
TimerSeconds = BUG_CONTEST_TIME TimerSeconds = Settings::BUG_CONTEST_TIME
def initialize def initialize
clear clear
@@ -115,7 +115,7 @@ class BugContestState
raise _INTL("No encounters for map {1}, so can't judge contest",@contestMap) raise _INTL("No encounters for map {1}, so can't judge contest",@contestMap)
end end
pokemon=Pokemon.new(enc[0],enc[1]) pokemon=Pokemon.new(enc[0],enc[1])
pokemon.hp = rand(1, pokemon.totalhp - 1) pokemon.hp = rand(1..pokemon.totalhp - 1)
score=pbBugContestScore(pokemon) score=pbBugContestScore(pokemon)
judgearray.push([cont,pokemon.species,score]) judgearray.push([cont,pokemon.species,score])
end end
@@ -868,7 +868,7 @@ def pbBattleFactoryPokemon(rule,numwins,numswaps,_rentals)
party=[] party=[]
loop do loop do
party.clear party.clear
while party.length < MAX_PARTY_SIZE while party.length < Settings::MAX_PARTY_SIZE
rnd=pokemonNumbers[0]+rand(pokemonNumbers[1]-pokemonNumbers[0]+1) rnd=pokemonNumbers[0]+rand(pokemonNumbers[1]-pokemonNumbers[0]+1)
rndpoke=btpokemon[rnd] rndpoke=btpokemon[rnd]
indvalue=(party.length<ivgroups[0]) ? ivs[0] : ivs[1] indvalue=(party.length<ivgroups[0]) ? ivs[0] : ivs[1]
@@ -1000,7 +1000,7 @@ def pbTrainerInfo(pokemonlist,trfile,rules)
end end
end end
numbers|=[] numbers|=[]
if numbers.length < MAX_PARTY_SIZE || if numbers.length < Settings::MAX_PARTY_SIZE ||
!rulesetTeam.hasValidTeam?(numbersPokemon) !rulesetTeam.hasValidTeam?(numbersPokemon)
for index in 0...pokemonlist.length for index in 0...pokemonlist.length
pkmn=pokemonlist[index] pkmn=pokemonlist[index]
@@ -1018,11 +1018,11 @@ def pbTrainerInfo(pokemonlist,trfile,rules)
end end
} }
end end
break if numbers.length >= MAX_PARTY_SIZE && rules.ruleset.hasValidTeam?(numbersPokemon) break if numbers.length >= Settings::MAX_PARTY_SIZE && rules.ruleset.hasValidTeam?(numbersPokemon)
end end
if numbers.length < MAX_PARTY_SIZE || !rules.ruleset.hasValidTeam?(numbersPokemon) if numbers.length < Settings::MAX_PARTY_SIZE || !rules.ruleset.hasValidTeam?(numbersPokemon)
while numbers.length<pokemonlist.length && while numbers.length<pokemonlist.length &&
(numbers.length < MAX_PARTY_SIZE || !rules.ruleset.hasValidTeam?(numbersPokemon)) (numbers.length < Settings::MAX_PARTY_SIZE || !rules.ruleset.hasValidTeam?(numbersPokemon))
index=rand(pokemonlist.length) index=rand(pokemonlist.length)
if !numbers.include?(index) if !numbers.include?(index)
numbers.push(index) numbers.push(index)
@@ -10,7 +10,7 @@ end
def pbChooseLanguage def pbChooseLanguage
commands=[] commands=[]
for lang in LANGUAGES for lang in Settings::LANGUAGES
commands.push(lang[0]) commands.push(lang[0])
end end
return pbShowCommands(nil,commands) return pbShowCommands(nil,commands)
@@ -48,9 +48,9 @@ def pbSetUpSystem
end end
# Load constants # Load constants
GameData.load_all GameData.load_all
if LANGUAGES.length>=2 if Settings::LANGUAGES.length>=2
pokemonSystem.language = pbChooseLanguage if !havedata pokemonSystem.language = pbChooseLanguage if !havedata
pbLoadMessages("Data/"+LANGUAGES[pokemonSystem.language][1]) pbLoadMessages("Data/"+Settings::LANGUAGES[pokemonSystem.language][1])
end end
end end
@@ -139,7 +139,7 @@ end
def pbGenerateEgg(pkmn, text = "") def pbGenerateEgg(pkmn, text = "")
return false if !pkmn || $Trainer.party_full? return false if !pkmn || $Trainer.party_full?
pkmn = Pokemon.new(pkmn, EGG_LEVEL) if !pkmn.is_a?(Pokemon) pkmn = Pokemon.new(pkmn, Settings::EGG_LEVEL) if !pkmn.is_a?(Pokemon)
# Set egg's details # Set egg's details
pkmn.name = _INTL("Egg") pkmn.name = _INTL("Egg")
pkmn.steps_to_hatch = pkmn.species_data.hatch_steps pkmn.steps_to_hatch = pkmn.species_data.hatch_steps
@@ -190,7 +190,7 @@ def pbTimeEventValid(variableNumber)
return retval return retval
end end
def pbExclaim(event,id=EXCLAMATION_ANIMATION_ID,tinting=false) def pbExclaim(event,id=Settings::EXCLAMATION_ANIMATION_ID,tinting=false)
if event.is_a?(Array) if event.is_a?(Array)
sprite = nil sprite = nil
done = [] done = []
@@ -253,7 +253,7 @@ def pbTrainerName(name = nil, outfit = 0)
$Trainer.outfit = outfit $Trainer.outfit = outfit
$Trainer.character_ID = $PokemonGlobal.playerID $Trainer.character_ID = $PokemonGlobal.playerID
if name.nil? if name.nil?
name = pbEnterPlayerName(_INTL("Your name?"), 0, MAX_PLAYER_NAME_SIZE) name = pbEnterPlayerName(_INTL("Your name?"), 0, Settings::MAX_PLAYER_NAME_SIZE)
if name.nil? || name.empty? if name.nil? || name.empty?
gender = pbGetTrainerTypeGender(trainer_type) gender = pbGetTrainerTypeGender(trainer_type)
name = pbSuggestTrainerName(gender) name = pbSuggestTrainerName(gender)
@@ -283,7 +283,7 @@ def pbSuggestTrainerName(gender)
owner[0,1] = owner[0,1].upcase owner[0,1] = owner[0,1].upcase
return owner return owner
end end
return getRandomNameEx(gender,nil,1,MAX_PLAYER_NAME_SIZE) return getRandomNameEx(gender, nil, 1, Settings::MAX_PLAYER_NAME_SIZE)
end end
def pbGetUserName def pbGetUserName
@@ -436,7 +436,7 @@ end
# Here, just used to decide whether to show the Pokédex in the Pause menu. # Here, just used to decide whether to show the Pokédex in the Pause menu.
def pbSetViableDexes def pbSetViableDexes
$PokemonGlobal.pokedexViable = [] $PokemonGlobal.pokedexViable = []
if USE_CURRENT_REGION_DEX if Settings::USE_CURRENT_REGION_DEX
region = pbGetCurrentRegion region = pbGetCurrentRegion
region = -1 if region>=$PokemonGlobal.pokedexUnlocked.length-1 region = -1 if region>=$PokemonGlobal.pokedexUnlocked.length-1
$PokemonGlobal.pokedexViable[0] = region if $Trainer.seen_any?(region) $PokemonGlobal.pokedexViable[0] = region if $Trainer.seen_any?(region)
@@ -449,7 +449,7 @@ DebugMenuCommands.register("additem", {
pbListScreenBlock(_INTL("ADD ITEM"), ItemLister.new) { |button, item| pbListScreenBlock(_INTL("ADD ITEM"), ItemLister.new) { |button, item|
if button == Input::C && item if button == Input::C && item
params = ChooseNumberParams.new params = ChooseNumberParams.new
params.setRange(1, BAG_MAX_PER_SLOT) params.setRange(1, Settings::BAG_MAX_PER_SLOT)
params.setInitialValue(1) params.setInitialValue(1)
params.setCancelValue(0) params.setCancelValue(0)
qty = pbMessageChooseNumber(_INTL("Add how many {1}?", qty = pbMessageChooseNumber(_INTL("Add how many {1}?",
@@ -469,7 +469,7 @@ DebugMenuCommands.register("fillbag", {
"description" => _INTL("Add a certain number of every item to the Bag."), "description" => _INTL("Add a certain number of every item to the Bag."),
"effect" => proc { "effect" => proc {
params = ChooseNumberParams.new params = ChooseNumberParams.new
params.setRange(1, BAG_MAX_PER_SLOT) params.setRange(1, Settings::BAG_MAX_PER_SLOT)
params.setInitialValue(1) params.setInitialValue(1)
params.setCancelValue(0) params.setCancelValue(0)
qty = pbMessageChooseNumber(_INTL("Choose the number of items."), params) qty = pbMessageChooseNumber(_INTL("Choose the number of items."), params)
@@ -613,7 +613,7 @@ DebugMenuCommands.register("fillboxes", {
end end
# Add Pokémon (if form 0) # Add Pokémon (if form 0)
next if f != 0 next if f != 0
if added >= NUM_STORAGE_BOXES * box_qty if added >= Settings::NUM_STORAGE_BOXES * box_qty
completed = false completed = false
next next
end end
@@ -622,7 +622,8 @@ DebugMenuCommands.register("fillboxes", {
end end
pbMessage(_INTL("Storage boxes were filled with one Pokémon of each species.")) pbMessage(_INTL("Storage boxes were filled with one Pokémon of each species."))
if !completed if !completed
pbMessage(_INTL("Note: The number of storage spaces ({1} boxes of {2}) is less than the number of species.", NUM_STORAGE_BOXES, box_qty)) pbMessage(_INTL("Note: The number of storage spaces ({1} boxes of {2}) is less than the number of species.",
Settings::NUM_STORAGE_BOXES, box_qty))
end end
} }
}) })
@@ -695,7 +696,7 @@ DebugMenuCommands.register("setmoney", {
"description" => _INTL("Edit how much money you have."), "description" => _INTL("Edit how much money you have."),
"effect" => proc { "effect" => proc {
params = ChooseNumberParams.new params = ChooseNumberParams.new
params.setRange(0, MAX_MONEY) params.setRange(0, Settings::MAX_MONEY)
params.setDefaultValue($Trainer.money) params.setDefaultValue($Trainer.money)
$Trainer.money = pbMessageChooseNumber(_INTL("Set the player's money."), params) $Trainer.money = pbMessageChooseNumber(_INTL("Set the player's money."), params)
pbMessage(_INTL("You now have ${1}.", $Trainer.money.to_s_formatted)) pbMessage(_INTL("You now have ${1}.", $Trainer.money.to_s_formatted))
@@ -708,7 +709,7 @@ DebugMenuCommands.register("setcoins", {
"description" => _INTL("Edit how many Game Corner Coins you have."), "description" => _INTL("Edit how many Game Corner Coins you have."),
"effect" => proc { "effect" => proc {
params = ChooseNumberParams.new params = ChooseNumberParams.new
params.setRange(0, MAX_COINS) params.setRange(0, Settings::MAX_COINS)
params.setDefaultValue($PokemonGlobal.coins) params.setDefaultValue($PokemonGlobal.coins)
$PokemonGlobal.coins = pbMessageChooseNumber(_INTL("Set the player's Coin amount."), params) $PokemonGlobal.coins = pbMessageChooseNumber(_INTL("Set the player's Coin amount."), params)
pbMessage(_INTL("You now have {1} Coins.", $PokemonGlobal.coins.to_s_formatted)) pbMessage(_INTL("You now have {1} Coins.", $PokemonGlobal.coins.to_s_formatted))
@@ -746,7 +747,7 @@ DebugMenuCommands.register("dexlists", {
loop do loop do
dexescmds = [] dexescmds = []
dexescmds.push(_INTL("Have Pokédex: {1}", $Trainer.pokedex ? "[YES]" : "[NO]")) dexescmds.push(_INTL("Have Pokédex: {1}", $Trainer.pokedex ? "[YES]" : "[NO]"))
d = pbDexNames d = Settings.pokedex_names
for i in 0...d.length for i in 0...d.length
name = d[i] name = d[i]
name = name[0] if name.is_a?(Array) name = name[0] if name.is_a?(Array)
@@ -816,7 +817,7 @@ DebugMenuCommands.register("renameplayer", {
"name" => _INTL("Set Player Name"), "name" => _INTL("Set Player Name"),
"description" => _INTL("Rename the player."), "description" => _INTL("Rename the player."),
"effect" => proc { "effect" => proc {
trname = pbEnterPlayerName("Your name?", 0, MAX_PLAYER_NAME_SIZE, $Trainer.name) trname = pbEnterPlayerName("Your name?", 0, Settings::MAX_PLAYER_NAME_SIZE, $Trainer.name)
if trname == "" && pbConfirmMessage(_INTL("Give yourself a default name?")) if trname == "" && pbConfirmMessage(_INTL("Give yourself a default name?"))
trainertype = $Trainer.trainer_type trainertype = $Trainer.trainer_type
gender = pbGetTrainerTypeGender(trainertype) gender = pbGetTrainerTypeGender(trainertype)
@@ -373,7 +373,7 @@ class SpriteWindow_DebugRoamers < Window_DrawableCommand
end end
def roamerCount def roamerCount
return ROAMING_SPECIES.length return Settings::ROAMING_SPECIES.length
end end
def itemCount def itemCount
@@ -405,7 +405,7 @@ class SpriteWindow_DebugRoamers < Window_DrawableCommand
# Advance roaming # Advance roaming
self.shadowtext(_INTL("[Clear all current roamer locations]"),rect.x,text_y,nameWidth,rect.height) self.shadowtext(_INTL("[Clear all current roamer locations]"),rect.x,text_y,nameWidth,rect.height)
else else
pkmn = ROAMING_SPECIES[index] pkmn = Settings::ROAMING_SPECIES[index]
name = GameData::Species.get(pkmn[0]).name + " (Lv. #{pkmn[1]})" name = GameData::Species.get(pkmn[0]).name + " (Lv. #{pkmn[1]})"
status = "" status = ""
statuscolor = 0 statuscolor = 0
@@ -480,7 +480,7 @@ def pbDebugRoamers
if cmdwindow.index<cmdwindow.roamerCount if cmdwindow.index<cmdwindow.roamerCount
pbPlayDecisionSE pbPlayDecisionSE
# Toggle through roaming, not roaming, defeated # Toggle through roaming, not roaming, defeated
pkmn = ROAMING_SPECIES[cmdwindow.index] pkmn = Settings::ROAMING_SPECIES[cmdwindow.index]
if pkmn[2]>0 && !$game_switches[pkmn[2]] if pkmn[2]>0 && !$game_switches[pkmn[2]]
# not roaming -> roaming # not roaming -> roaming
$game_switches[pkmn[2]] = true $game_switches[pkmn[2]] = true
@@ -500,7 +500,7 @@ def pbDebugRoamers
end end
cmdwindow.refresh cmdwindow.refresh
elsif cmdwindow.index==cmdwindow.itemCount-2 # All roam elsif cmdwindow.index==cmdwindow.itemCount-2 # All roam
if ROAMING_SPECIES.length==0 if Settings::ROAMING_SPECIES.length==0
pbPlayBuzzerSE pbPlayBuzzerSE
else else
pbPlayDecisionSE pbPlayDecisionSE
@@ -509,11 +509,11 @@ def pbDebugRoamers
cmdwindow.refresh cmdwindow.refresh
end end
else # Clear all roaming locations else # Clear all roaming locations
if ROAMING_SPECIES.length==0 if Settings::ROAMING_SPECIES.length==0
pbPlayBuzzerSE pbPlayBuzzerSE
else else
pbPlayDecisionSE pbPlayDecisionSE
for i in 0...ROAMING_SPECIES.length for i in 0...Settings::ROAMING_SPECIES.length
$PokemonGlobal.roamPosition[i] = nil $PokemonGlobal.roamPosition[i] = nil
end end
$PokemonGlobal.roamedAlready = false $PokemonGlobal.roamedAlready = false
@@ -638,7 +638,7 @@ def pbCompileTextUI
begin begin
pbCompileText pbCompileText
pbMessageDisplay(msgwindow,_INTL("Successfully compiled text and saved it to intl.dat.\1")) pbMessageDisplay(msgwindow,_INTL("Successfully compiled text and saved it to intl.dat.\1"))
pbMessageDisplay(msgwindow,_INTL("To use the file in a game, place the file in the Data folder under a different name, and edit the LANGUAGES array in the Settings script.")) pbMessageDisplay(msgwindow,_INTL("To use the file in a game, place the file in the Data folder under a different name, and edit the Settings::LANGUAGES array in the scripts."))
rescue RuntimeError rescue RuntimeError
pbMessageDisplay(msgwindow,_INTL("Failed to compile text: {1}",$!.message)) pbMessageDisplay(msgwindow,_INTL("Failed to compile text: {1}",$!.message))
end end
@@ -918,7 +918,7 @@ PokemonDebugMenuCommands.register("ownership", {
when 0 # Make player's when 0 # Make player's
pkmn.owner = Pokemon::Owner.new_from_trainer($Trainer) pkmn.owner = Pokemon::Owner.new_from_trainer($Trainer)
when 1 # Set OT's name when 1 # Set OT's name
pkmn.owner.name = pbEnterPlayerName(_INTL("{1}'s OT's name?", pkmn.name), 1, MAX_PLAYER_NAME_SIZE) pkmn.owner.name = pbEnterPlayerName(_INTL("{1}'s OT's name?", pkmn.name), 1, Settings::MAX_PLAYER_NAME_SIZE)
when 2 # Set OT's gender when 2 # Set OT's gender
cmd2 = screen.pbShowCommands(_INTL("Set OT's gender."), cmd2 = screen.pbShowCommands(_INTL("Set OT's gender."),
[_INTL("Male"), _INTL("Female"), _INTL("Unknown")], pkmn.owner.gender) [_INTL("Male"), _INTL("Female"), _INTL("Unknown")], pkmn.owner.gender)
@@ -958,7 +958,7 @@ PokemonDebugMenuCommands.register("setegg", {
when 0 # Make egg when 0 # Make egg
if !pkmn.egg? && (pbHasEgg?(pkmn.species) || if !pkmn.egg? && (pbHasEgg?(pkmn.species) ||
screen.pbConfirm(_INTL("{1} cannot legally be an egg. Make egg anyway?", pkmn.speciesName))) screen.pbConfirm(_INTL("{1} cannot legally be an egg. Make egg anyway?", pkmn.speciesName)))
pkmn.level = EGG_LEVEL pkmn.level = Settings::EGG_LEVEL
pkmn.calcStats pkmn.calcStats
pkmn.name = _INTL("Egg") pkmn.name = _INTL("Egg")
pkmn.steps_to_hatch = pkmn.species_data.hatch_steps pkmn.steps_to_hatch = pkmn.species_data.hatch_steps
@@ -967,7 +967,7 @@ end
# Main # Main
################################################################################ ################################################################################
def animationEditorMain(animation) def animationEditorMain(animation)
viewport=Viewport.new(0, 0, SCREEN_WIDTH + 288, SCREEN_HEIGHT + 288) viewport=Viewport.new(0, 0, Settings::SCREEN_WIDTH + 288, Settings::SCREEN_HEIGHT + 288)
viewport.z=99999 viewport.z=99999
# Canvas # Canvas
canvas=AnimationCanvas.new(animation[animation.selected],viewport) canvas=AnimationCanvas.new(animation[animation.selected],viewport)
@@ -1184,10 +1184,10 @@ def pbAnimationEditor
animation=PBAnimations.new animation=PBAnimations.new
animation[0].graphic="" animation[0].graphic=""
end end
Graphics.resize_screen(SCREEN_WIDTH + 288, SCREEN_HEIGHT + 288) Graphics.resize_screen(Settings::SCREEN_WIDTH + 288, Settings::SCREEN_HEIGHT + 288)
pbSetResizeFactor(1) pbSetResizeFactor(1)
animationEditorMain(animation) animationEditorMain(animation)
Graphics.resize_screen(SCREEN_WIDTH, SCREEN_HEIGHT) Graphics.resize_screen(Settings::SCREEN_WIDTH, Settings::SCREEN_HEIGHT)
pbSetResizeFactor($PokemonSystem.screensize) pbSetResizeFactor($PokemonSystem.screensize)
$game_map.autoplay if $game_map $game_map.autoplay if $game_map
end end
+4 -4
View File
@@ -480,7 +480,7 @@ module TrainerBattleProperty
[_INTL("Version"), LimitProperty.new(9999), _INTL("Number used to distinguish Trainers with the same name and trainer type.")], [_INTL("Version"), LimitProperty.new(9999), _INTL("Number used to distinguish Trainers with the same name and trainer type.")],
[_INTL("Lose Text"), StringProperty, _INTL("Message shown in battle when the Trainer is defeated.")] [_INTL("Lose Text"), StringProperty, _INTL("Message shown in battle when the Trainer is defeated.")]
] ]
MAX_PARTY_SIZE.times do |i| Settings::MAX_PARTY_SIZE.times do |i|
properties.push([_INTL("Pokémon {1}", i + 1), TrainerPokemonProperty, _INTL("A Pokémon owned by the Trainer.")]) properties.push([_INTL("Pokémon {1}", i + 1), TrainerPokemonProperty, _INTL("A Pokémon owned by the Trainer.")])
end end
NUM_ITEMS.times do |i| NUM_ITEMS.times do |i|
@@ -524,7 +524,7 @@ def pbTrainerBattleEditor
tr_data.version, tr_data.version,
tr_data.real_lose_text tr_data.real_lose_text
] ]
for i in 0...MAX_PARTY_SIZE for i in 0...Settings::MAX_PARTY_SIZE
data.push(tr_data.pokemon[i]) data.push(tr_data.pokemon[i])
end end
for i in 0...TrainerBattleProperty::NUM_ITEMS for i in 0...TrainerBattleProperty::NUM_ITEMS
@@ -535,11 +535,11 @@ def pbTrainerBattleEditor
break if !data break if !data
party = [] party = []
items = [] items = []
for i in 0...MAX_PARTY_SIZE for i in 0...Settings::MAX_PARTY_SIZE
party.push(data[4 + i]) if data[4 + i] && data[4 + i][:species] party.push(data[4 + i]) if data[4 + i] && data[4 + i][:species]
end end
for i in 0...TrainerBattleProperty::NUM_ITEMS for i in 0...TrainerBattleProperty::NUM_ITEMS
items.push(data[4 + MAX_PARTY_SIZE + i]) if data[4 + MAX_PARTY_SIZE + i] items.push(data[4 + Settings::MAX_PARTY_SIZE + i]) if data[4 + Settings::MAX_PARTY_SIZE + i]
end end
if !data[0] if !data[0]
pbMessage(_INTL("Can't save. No trainer type was chosen.")) pbMessage(_INTL("Can't save. No trainer type was chosen."))
@@ -791,7 +791,7 @@ end
module PocketProperty module PocketProperty
def self.set(_settingname, oldsetting) def self.set(_settingname, oldsetting)
commands = pbPocketNames.clone commands = Settings.bag_pocket_names.clone
commands.shift commands.shift
cmd = pbMessage(_INTL("Choose a pocket for this item."), commands, -1) cmd = pbMessage(_INTL("Choose a pocket for this item."), commands, -1)
return (cmd >= 0) ? cmd + 1 : oldsetting return (cmd >= 0) ? cmd + 1 : oldsetting
@@ -803,7 +803,7 @@ module PocketProperty
def self.format(value) def self.format(value)
return _INTL("No Pocket") if value == 0 return _INTL("No Pocket") if value == 0
return (value) ? pbPocketNames[value] : value.inspect return (value) ? Settings.bag_pocket_names[value] : value.inspect
end end
end end
+1 -1
View File
@@ -677,7 +677,7 @@ module Compiler
#============================================================================= #=============================================================================
def compile_all(mustCompile) def compile_all(mustCompile)
FileLineData.clear FileLineData.clear
if (!$INEDITOR || LANGUAGES.length < 2) && safeExists?("Data/messages.dat") if (!$INEDITOR || Settings::LANGUAGES.length < 2) && safeExists?("Data/messages.dat")
MessageTypes.loadMessageFile("Data/messages.dat") MessageTypes.loadMessageFile("Data/messages.dat")
end end
if mustCompile if mustCompile