Hard mode

This commit is contained in:
infinitefusion
2021-12-26 16:03:01 -05:00
parent 56c13d0907
commit 7240e76ed0
6 changed files with 259 additions and 242 deletions

View File

@@ -13,8 +13,8 @@ module Settings
#Infinite fusion settings #Infinite fusion settings
NB_POKEMON = 420 NB_POKEMON = 420
CUSTOM_BATTLERS_FOLDER="Graphics/CustomBattlers/" CUSTOM_BATTLERS_FOLDER = "Graphics/CustomBattlers/"
BATTLERS_FOLDER="Graphics/Battlers/" BATTLERS_FOLDER = "Graphics/Battlers/"
FRONTSPRITE_POSITION_OFFSET = 15 FRONTSPRITE_POSITION_OFFSET = 15
FRONTSPRITE_SCALE = 0.6666666 FRONTSPRITE_SCALE = 0.6666666
BACKRPSPRITE_SCALE = 1 BACKRPSPRITE_SCALE = 1
@@ -29,7 +29,8 @@ module Settings
RIVAL_STARTER_PLACEHOLDER_VARIABLE = 250 RIVAL_STARTER_PLACEHOLDER_VARIABLE = 250
OVERRIDE_BATTLE_LEVEL_SWITCH = 785 OVERRIDE_BATTLE_LEVEL_SWITCH = 785
OVERRIDE_BATTLE_LEVEL_VALUE_VAR =240 OVERRIDE_BATTLE_LEVEL_VALUE_VAR = 240
HARD_MODE_LEVEL_MODIFIER = 1.1
ZAPMOLCUNO_NB = 176821 ZAPMOLCUNO_NB = 176821
@@ -44,27 +45,27 @@ module Settings
#============================================================================= #=============================================================================
# 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
#============================================================================= #=============================================================================
# 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
# Number of badges in the game # Number of badges in the game
NB_BADGES = 16 NB_BADGES = 16
# 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)
@@ -72,19 +73,19 @@ module Settings
#============================================================================= #=============================================================================
# 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 number of Battle Points the player can have. # The maximum number of Battle Points the player can have.
MAX_BATTLE_POINTS = 9_999 MAX_BATTLE_POINTS = 9_999
# The maximum amount of soot the player can have. # The maximum amount of soot the player can have.
MAX_SOOT = 9_999 MAX_SOOT = 9_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
#============================================================================= #=============================================================================
@@ -92,8 +93,8 @@ module Settings
# number. If the variable isn't set to 0, then all trainers with the # 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. # associated 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]
] ]
@@ -105,29 +106,29 @@ module Settings
#============================================================================= #=============================================================================
# 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 = true#(MECHANICS_GENERATION <= 4) POISON_IN_FIELD = true #(MECHANICS_GENERATION <= 4)
# Whether poisoned Pokémon will faint while walking around in the field # Whether poisoned Pokémon will faint while walking around in the field
# (true), or survive the poisoning with 1 HP (false). # (true), 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 (true), or whether there is # Whether fishing automatically hooks the Pokémon (true), or whether there is
# a reaction test first (false). # a reaction test first (false).
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 = 20 * 60 # 20 minutes BUG_CONTEST_TIME = 20 * 60 # 20 minutes
#============================================================================= #=============================================================================
@@ -151,30 +152,30 @@ module Settings
# second badge, etc. # 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 = 0 BADGE_FOR_ROCKSMASH = 0
BADGE_FOR_SURF = 5 BADGE_FOR_SURF = 5
BADGE_FOR_FLY = 3 BADGE_FOR_FLY = 3
BADGE_FOR_STRENGTH = 5 BADGE_FOR_STRENGTH = 5
BADGE_FOR_DIVE = 9 BADGE_FOR_DIVE = 9
BADGE_FOR_WATERFALL = 8 BADGE_FOR_WATERFALL = 8
BADGE_FOR_TELEPORT = 3 BADGE_FOR_TELEPORT = 3
BADGE_FOR_BOUNCE = 8 BADGE_FOR_BOUNCE = 8
BADGE_FOR_ROCKCLIMB = 16 BADGE_FOR_ROCKCLIMB = 16
#============================================================================= #=============================================================================
# If a move taught by a TM/HM/TR replaces another move, this setting is # 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 # whether the machine's move retains the replaced move's PP (true), or whether
# the machine's move has full PP (false). # the machine's move has full PP (false).
TAUGHT_MACHINES_KEEP_OLD_PP = (MECHANICS_GENERATION == 5) TAUGHT_MACHINES_KEEP_OLD_PP = (MECHANICS_GENERATION == 5)
# Whether the Black/White Flutes will raise/lower the levels of wild Pokémon # Whether the Black/White Flutes will raise/lower the levels of wild Pokémon
# respectively (true), or will lower/raise the wild encounter rate # respectively (true), or will lower/raise the wild encounter rate
# respectively (false). # 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 it uses the level of the first unfainted Pokémon (false). # its HP (true), or it 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)
@@ -184,6 +185,7 @@ module Settings
def self.storage_creator_name 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
@@ -192,21 +194,22 @@ module Settings
# The names of each pocket of the Bag. Ignore the first entry (""). # The names of each pocket of the Bag. Ignore the first entry ("").
def self.bag_pocket_names def self.bag_pocket_names
return ["", return ["",
_INTL("Items"), _INTL("Items"),
_INTL("Medicine"), _INTL("Medicine"),
_INTL("Poké Balls"), _INTL("Poké Balls"),
_INTL("TMs & HMs"), _INTL("TMs & HMs"),
_INTL("Berries"), _INTL("Berries"),
_INTL("Mail"), _INTL("Mail"),
_INTL("Battle Items"), _INTL("Battle Items"),
_INTL("Key Items") _INTL("Key Items")
] ]
end end
# The maximum number of slots per pocket (-1 means infinite number). Ignore # The maximum number of slots per pocket (-1 means infinite number). Ignore
# the first number (0). # the first number (0).
BAG_MAX_POCKET_SIZE = [0, -1, -1, -1, -1, -1, -1, -1, -1] BAG_MAX_POCKET_SIZE = [0, -1, -1, -1, -1, -1, -1, -1, -1]
# The maximum number of items each slot in the Bag can hold. # The maximum number of items each slot in the Bag can hold.
BAG_MAX_PER_SLOT = 999 BAG_MAX_PER_SLOT = 999
# Whether each pocket in turn auto-sorts itself by item ID number. Ignore the # Whether each pocket in turn auto-sorts itself by item ID number. Ignore the
# first entry (the 0). # first entry (the 0).
BAG_POCKET_AUTO_SORT = [0, false, false, false, true, true, false, false, false] BAG_POCKET_AUTO_SORT = [0, false, false, false, true, true, false, false, false]
@@ -233,6 +236,7 @@ module Settings
[_INTL("Kanto Pokédex"), 0] [_INTL("Kanto Pokédex"), 0]
] ]
end end
# Whether all forms of a given species will be immediately available to view # Whether all forms of a given species will be immediately available to view
# in the Pokédex so long as that species has been seen at all (true), or # in the Pokédex so long as that species has been seen at all (true), or
# whether each form needs to be seen specifically before that form appears in # whether each form needs to be seen specifically before that form appears in
@@ -241,7 +245,7 @@ module Settings
# An array of numbers, where each number is that of a Dex list (in the same # An array of numbers, where each number is that of a Dex list (in the same
# order as above, except the National Dex is -1). All Dex lists included here # order as above, except the National Dex is -1). All Dex lists included here
# will begin their numbering at 0 rather than 1 (e.g. Victini in Unova's Dex). # will begin their numbering at 0 rather than 1 (e.g. Victini in Unova's Dex).
DEXES_WITH_OFFSETS = [] DEXES_WITH_OFFSETS = []
#============================================================================= #=============================================================================
@@ -263,16 +267,16 @@ module Settings
# A list of maps used by roaming Pokémon. Each map has an array of other maps # A list of maps used by roaming Pokémon. Each map has an array of other maps
# it can lead to. # it 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],
31 => [5, 21, 28, 39, 41, 44, 47, 66, 69], 31 => [5, 21, 28, 39, 41, 44, 47, 66, 69],
39 => [5, 21, 28, 31, 41, 44, 47, 66, 69], 39 => [5, 21, 28, 31, 41, 44, 47, 66, 69],
41 => [5, 21, 28, 31, 39, 44, 47, 66, 69], 41 => [5, 21, 28, 31, 39, 44, 47, 66, 69],
44 => [5, 21, 28, 31, 39, 41, 47, 66, 69], 44 => [5, 21, 28, 31, 39, 41, 47, 66, 69],
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 each array is as follows: # information within each array is as follows:
@@ -287,10 +291,10 @@ module Settings
[: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, {
2 => [ 21, 31 ], 2 => [21, 31],
21 => [2, 31, 69], 21 => [2, 31, 69],
31 => [2, 21, 69], 31 => [2, 21, 69],
69 => [ 21, 31 ] 69 => [21, 31]
}], }],
[:ENTEI, 40, 55, 1, nil] [:ENTEI, 40, 55, 1, nil]
] ]
@@ -306,50 +310,50 @@ module Settings
# * 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 # 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). # Poké 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 # ID of the animation played when a patch of grass rustles due to using the
# Poké Radar. # Poké 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 # 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). # is on the map (for new plant growth mechanics only).
PLANT_SPARKLE_ANIMATION_ID = 7 PLANT_SPARKLE_ANIMATION_ID = 7
CUT_TREE_ANIMATION_ID =19 CUT_TREE_ANIMATION_ID = 19
ROCK_SMASH_ANIMATION_ID =20 ROCK_SMASH_ANIMATION_ID = 20
#============================================================================= #=============================================================================
@@ -357,8 +361,8 @@ module Settings
# 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"]
] ]
#============================================================================= #=============================================================================

View File

@@ -13,24 +13,24 @@ module GameData
DATA_FILENAME = "trainers.dat" DATA_FILENAME = "trainers.dat"
SCHEMA = { SCHEMA = {
"Items" => [:items, "*e", :Item], "Items" => [:items, "*e", :Item],
"LoseText" => [:lose_text, "s"], "LoseText" => [:lose_text, "s"],
"Pokemon" => [:pokemon, "ev", :Species], # Species, level "Pokemon" => [:pokemon, "ev", :Species], # Species, level
"Form" => [:form, "u"], "Form" => [:form, "u"],
"Name" => [:name, "s"], "Name" => [:name, "s"],
"Moves" => [:moves, "*e", :Move], "Moves" => [:moves, "*e", :Move],
"Ability" => [:ability, "s"], "Ability" => [:ability, "s"],
"AbilityIndex" => [:ability_index, "u"], "AbilityIndex" => [:ability_index, "u"],
"Item" => [:item, "e", :Item], "Item" => [:item, "e", :Item],
"Gender" => [:gender, "e", { "M" => 0, "m" => 0, "Male" => 0, "male" => 0, "0" => 0, "Gender" => [:gender, "e", { "M" => 0, "m" => 0, "Male" => 0, "male" => 0, "0" => 0,
"F" => 1, "f" => 1, "Female" => 1, "female" => 1, "1" => 1 }], "F" => 1, "f" => 1, "Female" => 1, "female" => 1, "1" => 1 }],
"Nature" => [:nature, "e", :Nature], "Nature" => [:nature, "e", :Nature],
"IV" => [:iv, "uUUUUU"], "IV" => [:iv, "uUUUUU"],
"EV" => [:ev, "uUUUUU"], "EV" => [:ev, "uUUUUU"],
"Happiness" => [:happiness, "u"], "Happiness" => [:happiness, "u"],
"Shiny" => [:shininess, "b"], "Shiny" => [:shininess, "b"],
"Shadow" => [:shadowness, "b"], "Shadow" => [:shadowness, "b"],
"Ball" => [:poke_ball, "s"], "Ball" => [:poke_ball, "s"],
} }
extend ClassMethods extend ClassMethods
@@ -71,14 +71,14 @@ module GameData
end end
def initialize(hash) def initialize(hash)
@id = hash[:id] @id = hash[:id]
@id_number = hash[:id_number] @id_number = hash[:id_number]
@trainer_type = hash[:trainer_type] @trainer_type = hash[:trainer_type]
@real_name = hash[:name] || "Unnamed" @real_name = hash[:name] || "Unnamed"
@version = hash[:version] || 0 @version = hash[:version] || 0
@items = hash[:items] || [] @items = hash[:items] || []
@real_lose_text = hash[:lose_text] || "..." @real_lose_text = hash[:lose_text] || "..."
@pokemon = hash[:pokemon] || [] @pokemon = hash[:pokemon] || []
@pokemon.each do |pkmn| @pokemon.each do |pkmn|
GameData::Stat.each_main do |s| GameData::Stat.each_main do |s|
pkmn[:iv][s.id] ||= 0 if pkmn[:iv] pkmn[:iv][s.id] ||= 0 if pkmn[:iv]
@@ -126,12 +126,12 @@ module GameData
end end
# Create trainer object # Create trainer object
trainer = NPCTrainer.new(tr_name, @trainer_type) trainer = NPCTrainer.new(tr_name, @trainer_type)
trainer.id = $Trainer.make_foreign_ID trainer.id = $Trainer.make_foreign_ID
trainer.items = @items.clone trainer.items = @items.clone
trainer.lose_text = self.lose_text trainer.lose_text = self.lose_text
isRematch = $game_switches[200] isRematch = $game_switches[200]
rematchId = getRematchId(trainer.name,trainer.trainer_type) rematchId = getRematchId(trainer.name, trainer.trainer_type)
# Create each Pokémon owned by the trainer # Create each Pokémon owned by the trainer
@pokemon.each do |pkmn_data| @pokemon.each do |pkmn_data|
@@ -143,11 +143,18 @@ module GameData
if $game_switches[REVERSED_MODE] if $game_switches[REVERSED_MODE]
species = reverseFusionSpecies(species) species = reverseFusionSpecies(species)
end end
level =pkmn_data[:level] level = pkmn_data[:level]
if $game_switches[GAME_DIFFICULTY_HARD]
level *= Settings::HARD_MODE_LEVEL_MODIFIER.ceil
if level > Settings::MAXIMUM_LEVEL
level = Settings::MAXIMUM_LEVEL
end
end
if $game_switches[Settings::OVERRIDE_BATTLE_LEVEL_SWITCH] if $game_switches[Settings::OVERRIDE_BATTLE_LEVEL_SWITCH]
override_level = $game_variables[Settings::OVERRIDE_BATTLE_LEVEL_VALUE_VAR] override_level = $game_variables[Settings::OVERRIDE_BATTLE_LEVEL_VALUE_VAR]
if override_level.is_a?(Integer) if override_level.is_a?(Integer)
level =override_level level = override_level
end end
end end
#### ####
@@ -155,8 +162,8 @@ module GameData
#trainer rematch infinite fusion edit #trainer rematch infinite fusion edit
if isRematch if isRematch
nbRematch = getNumberRematch(rematchId) nbRematch = getNumberRematch(rematchId)
level = getRematchLevel(level,nbRematch) level = getRematchLevel(level, nbRematch)
species = evolveRematchPokemon(nbRematch,species) species = evolveRematchPokemon(nbRematch, species)
end end
# #
pkmn = Pokemon.new(species, level, trainer, false) pkmn = Pokemon.new(species, level, trainer, false)

View File

@@ -6,29 +6,29 @@ class PokeBattle_Battle
# battle. # battle.
# NOTE: Messages are only shown while in the party screen when choosing a # NOTE: Messages are only shown while in the party screen when choosing a
# command for the next round. # command for the next round.
def pbCanSwitchLax?(idxBattler,idxParty,partyScene=nil) def pbCanSwitchLax?(idxBattler, idxParty, partyScene = nil)
return true if idxParty<0 return true if idxParty < 0
party = pbParty(idxBattler) party = pbParty(idxBattler)
return false if idxParty>=party.length return false if idxParty >= party.length
return false if !party[idxParty] return false if !party[idxParty]
if party[idxParty].egg? if party[idxParty].egg?
partyScene.pbDisplay(_INTL("An Egg can't battle!")) if partyScene partyScene.pbDisplay(_INTL("An Egg can't battle!")) if partyScene
return false return false
end end
if !pbIsOwner?(idxBattler,idxParty) if !pbIsOwner?(idxBattler, idxParty)
owner = pbGetOwnerFromPartyIndex(idxBattler,idxParty) owner = pbGetOwnerFromPartyIndex(idxBattler, idxParty)
partyScene.pbDisplay(_INTL("You can't switch {1}'s Pokémon with one of yours!", partyScene.pbDisplay(_INTL("You can't switch {1}'s Pokémon with one of yours!",
owner.name)) if partyScene owner.name)) if partyScene
return false return false
end end
if party[idxParty].fainted? if party[idxParty].fainted?
partyScene.pbDisplay(_INTL("{1} has no energy left to battle!", partyScene.pbDisplay(_INTL("{1} has no energy left to battle!",
party[idxParty].name)) if partyScene party[idxParty].name)) if partyScene
return false return false
end end
if pbFindBattler(idxParty,idxBattler) if pbFindBattler(idxParty, idxBattler)
partyScene.pbDisplay(_INTL("{1} is already in battle!", partyScene.pbDisplay(_INTL("{1} is already in battle!",
party[idxParty].name)) if partyScene party[idxParty].name)) if partyScene
return false return false
end end
return true return true
@@ -38,15 +38,15 @@ class PokeBattle_Battle
# switch out (and that its replacement at party index idxParty can switch in). # switch out (and that its replacement at party index idxParty can switch in).
# NOTE: Messages are only shown while in the party screen when choosing a # NOTE: Messages are only shown while in the party screen when choosing a
# command for the next round. # command for the next round.
def pbCanSwitch?(idxBattler,idxParty=-1,partyScene=nil) def pbCanSwitch?(idxBattler, idxParty = -1, partyScene = nil)
# Check whether party Pokémon can switch in # Check whether party Pokémon can switch in
return false if !pbCanSwitchLax?(idxBattler,idxParty,partyScene) return false if !pbCanSwitchLax?(idxBattler, idxParty, partyScene)
# Make sure another battler isn't already choosing to switch to the party # Make sure another battler isn't already choosing to switch to the party
# Pokémon # Pokémon
eachSameSideBattler(idxBattler) do |b| eachSameSideBattler(idxBattler) do |b|
next if choices[b.index][0]!=:SwitchOut || choices[b.index][1]!=idxParty next if choices[b.index][0] != :SwitchOut || choices[b.index][1] != idxParty
partyScene.pbDisplay(_INTL("{1} has already been selected.", partyScene.pbDisplay(_INTL("{1} has already been selected.",
pbParty(idxBattler)[idxParty].name)) if partyScene pbParty(idxBattler)[idxParty].name)) if partyScene
return false return false
end end
# Check whether battler can switch out # Check whether battler can switch out
@@ -54,39 +54,39 @@ class PokeBattle_Battle
return true if battler.fainted? return true if battler.fainted?
# Ability/item effects that allow switching no matter what # Ability/item effects that allow switching no matter what
if battler.abilityActive? if battler.abilityActive?
if BattleHandlers.triggerCertainSwitchingUserAbility(battler.ability,battler,self) if BattleHandlers.triggerCertainSwitchingUserAbility(battler.ability, battler, self)
return true return true
end end
end end
if battler.itemActive? if battler.itemActive?
if BattleHandlers.triggerCertainSwitchingUserItem(battler.item,battler,self) if BattleHandlers.triggerCertainSwitchingUserItem(battler.item, battler, self)
return true return true
end end
end end
# Other certain switching effects # Other certain switching effects
return true if Settings::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 ||
battler.effects[PBEffects::Ingrain] || battler.effects[PBEffects::Ingrain] ||
@field.effects[PBEffects::FairyLock]>0 @field.effects[PBEffects::FairyLock] > 0
partyScene.pbDisplay(_INTL("{1} can't be switched out!",battler.pbThis)) if partyScene partyScene.pbDisplay(_INTL("{1} can't be switched out!", battler.pbThis)) if partyScene
return false return false
end end
# Trapping abilities/items # Trapping abilities/items
eachOtherSideBattler(idxBattler) do |b| eachOtherSideBattler(idxBattler) do |b|
next if !b.abilityActive? next if !b.abilityActive?
if BattleHandlers.triggerTrappingTargetAbility(b.ability,battler,b,self) if BattleHandlers.triggerTrappingTargetAbility(b.ability, battler, b, self)
partyScene.pbDisplay(_INTL("{1}'s {2} prevents switching!", partyScene.pbDisplay(_INTL("{1}'s {2} prevents switching!",
b.pbThis,b.abilityName)) if partyScene b.pbThis, b.abilityName)) if partyScene
return false return false
end end
end end
eachOtherSideBattler(idxBattler) do |b| eachOtherSideBattler(idxBattler) do |b|
next if !b.itemActive? next if !b.itemActive?
if BattleHandlers.triggerTrappingTargetItem(b.item,battler,b,self) if BattleHandlers.triggerTrappingTargetItem(b.item, battler, b, self)
partyScene.pbDisplay(_INTL("{1}'s {2} prevents switching!", partyScene.pbDisplay(_INTL("{1}'s {2} prevents switching!",
b.pbThis,b.itemName)) if partyScene b.pbThis, b.itemName)) if partyScene
return false return false
end end
end end
@@ -94,16 +94,16 @@ class PokeBattle_Battle
end end
def pbCanChooseNonActive?(idxBattler) def pbCanChooseNonActive?(idxBattler)
pbParty(idxBattler).each_with_index do |_pkmn,i| pbParty(idxBattler).each_with_index do |_pkmn, i|
return true if pbCanSwitchLax?(idxBattler,i) return true if pbCanSwitchLax?(idxBattler, i)
end end
return false return false
end end
def pbRegisterSwitch(idxBattler,idxParty) def pbRegisterSwitch(idxBattler, idxParty)
return false if !pbCanSwitch?(idxBattler,idxParty) return false if !pbCanSwitch?(idxBattler, idxParty)
@choices[idxBattler][0] = :SwitchOut @choices[idxBattler][0] = :SwitchOut
@choices[idxBattler][1] = idxParty # Party index of Pokémon to switch in @choices[idxBattler][1] = idxParty # Party index of Pokémon to switch in
@choices[idxBattler][2] = nil @choices[idxBattler][2] = nil
return true return true
end end
@@ -114,16 +114,16 @@ class PokeBattle_Battle
#============================================================================= #=============================================================================
# Open party screen and potentially choose a Pokémon to switch with. Used in # Open party screen and potentially choose a Pokémon to switch with. Used in
# all instances where the party screen is opened. # all instances where the party screen is opened.
def pbPartyScreen(idxBattler,checkLaxOnly=false,canCancel=false,shouldRegister=false) def pbPartyScreen(idxBattler, checkLaxOnly = false, canCancel = false, shouldRegister = false)
ret = -1 ret = -1
@scene.pbPartyScreen(idxBattler,canCancel) { |idxParty,partyScene| @scene.pbPartyScreen(idxBattler, canCancel) { |idxParty, partyScene|
if checkLaxOnly if checkLaxOnly
next false if !pbCanSwitchLax?(idxBattler,idxParty,partyScene) next false if !pbCanSwitchLax?(idxBattler, idxParty, partyScene)
else else
next false if !pbCanSwitch?(idxBattler,idxParty,partyScene) next false if !pbCanSwitch?(idxBattler, idxParty, partyScene)
end end
if shouldRegister if shouldRegister
next false if idxParty<0 || !pbRegisterSwitch(idxBattler,idxParty) next false if idxParty < 0 || !pbRegisterSwitch(idxBattler, idxParty)
end end
ret = idxParty ret = idxParty
next true next true
@@ -133,9 +133,9 @@ class PokeBattle_Battle
# For choosing a replacement Pokémon when prompted in the middle of other # For choosing a replacement Pokémon when prompted in the middle of other
# things happening (U-turn, Baton Pass, in def pbSwitch). # things happening (U-turn, Baton Pass, in def pbSwitch).
def pbSwitchInBetween(idxBattler,checkLaxOnly=false,canCancel=false) def pbSwitchInBetween(idxBattler, checkLaxOnly = false, canCancel = false)
return pbPartyScreen(idxBattler,checkLaxOnly,canCancel) if pbOwnedByPlayer?(idxBattler) return pbPartyScreen(idxBattler, checkLaxOnly, canCancel) if pbOwnedByPlayer?(idxBattler)
return @battleAI.pbDefaultChooseNewEnemy(idxBattler,pbParty(idxBattler)) return @battleAI.pbDefaultChooseNewEnemy(idxBattler, pbParty(idxBattler))
end end
#============================================================================= #=============================================================================
@@ -143,11 +143,11 @@ class PokeBattle_Battle
#============================================================================= #=============================================================================
# General switching method that checks if any Pokémon need to be sent out and, # General switching method that checks if any Pokémon need to be sent out and,
# if so, does. Called at the end of each round. # if so, does. Called at the end of each round.
def pbEORSwitch(favorDraws=false) def pbEORSwitch(favorDraws = false)
return if @decision>0 && !favorDraws return if @decision > 0 && !favorDraws
return if @decision==5 && favorDraws return if @decision == 5 && favorDraws
pbJudge pbJudge
return if @decision>0 return if @decision > 0
# Check through each fainted battler to see if that spot can be filled. # Check through each fainted battler to see if that spot can be filled.
switched = [] switched = []
loop do loop do
@@ -156,103 +156,106 @@ class PokeBattle_Battle
next if !b || !b.fainted? next if !b || !b.fainted?
idxBattler = b.index idxBattler = b.index
next if !pbCanChooseNonActive?(idxBattler) next if !pbCanChooseNonActive?(idxBattler)
if !pbOwnedByPlayer?(idxBattler) # Opponent/ally is switching in if !pbOwnedByPlayer?(idxBattler) # Opponent/ally is switching in
next if wildBattle? && opposes?(idxBattler) # Wild Pokémon can't switch next if wildBattle? && opposes?(idxBattler) # Wild Pokémon can't switch
idxPartyNew = pbSwitchInBetween(idxBattler) idxPartyNew = pbSwitchInBetween(idxBattler)
opponent = pbGetOwnerFromBattlerIndex(idxBattler) opponent = pbGetOwnerFromBattlerIndex(idxBattler)
# NOTE: The player is only offered the chance to switch their own # NOTE: The player is only offered the chance to switch their own
# Pokémon when an opponent replaces a fainted Pokémon in single # Pokémon when an opponent replaces a fainted Pokémon in single
# battles. In double battles, etc. there is no such offer. # battles. In double battles, etc. there is no such offer.
if @internalBattle && @switchStyle && trainerBattle? && pbSideSize(0)==1 && if @internalBattle && @switchStyle && trainerBattle? && pbSideSize(0) == 1 &&
opposes?(idxBattler) && !@battlers[0].fainted? && !switched.include?(0) && opposes?(idxBattler) && !@battlers[0].fainted? && !switched.include?(0) &&
pbCanChooseNonActive?(0) && @battlers[0].effects[PBEffects::Outrage]==0 pbCanChooseNonActive?(0) && @battlers[0].effects[PBEffects::Outrage] == 0
idxPartyForName = idxPartyNew idxPartyForName = idxPartyNew
enemyParty = pbParty(idxBattler) enemyParty = pbParty(idxBattler)
if enemyParty[idxPartyNew].ability == :ILLUSION if enemyParty[idxPartyNew].ability == :ILLUSION
new_index = pbLastInTeam(idxBattler) new_index = pbLastInTeam(idxBattler)
idxPartyForName = new_index if new_index >= 0 && new_index != idxPartyNew idxPartyForName = new_index if new_index >= 0 && new_index != idxPartyNew
end end
if pbDisplayConfirm(_INTL("{1} is about to send in {2}. Will you switch your Pokémon?", switchMessageHard = _INTL("{1} is about to send in a new Pokémon. Will you switch your Pokémon?", opponent.fullname)
opponent.full_name, enemyParty[idxPartyForName].name)) switchMessageNormal = _INTL("{1} is about to send in {2}. Will you switch your Pokémon?", opponent.full_name, enemyParty[idxPartyForName].name)
idxPlayerPartyNew = pbSwitchInBetween(0,false,true) switchMessage = $game_switches[GAME_DIFFICULTY_HARD] ? switchMessageHard : switchMessageNormal
if idxPlayerPartyNew>=0 if pbDisplayConfirm(switchMessage)
idxPlayerPartyNew = pbSwitchInBetween(0, false, true)
if idxPlayerPartyNew >= 0
pbMessageOnRecall(@battlers[0]) pbMessageOnRecall(@battlers[0])
pbRecallAndReplace(0,idxPlayerPartyNew) pbRecallAndReplace(0, idxPlayerPartyNew)
switched.push(0) switched.push(0)
end end
end end
end end
pbRecallAndReplace(idxBattler,idxPartyNew) pbRecallAndReplace(idxBattler, idxPartyNew)
switched.push(idxBattler) switched.push(idxBattler)
elsif trainerBattle? # Player switches in in a trainer battle elsif trainerBattle? # Player switches in in a trainer battle
idxPlayerPartyNew = pbGetReplacementPokemonIndex(idxBattler) # Owner chooses idxPlayerPartyNew = pbGetReplacementPokemonIndex(idxBattler) # Owner chooses
pbRecallAndReplace(idxBattler,idxPlayerPartyNew) pbRecallAndReplace(idxBattler, idxPlayerPartyNew)
switched.push(idxBattler) switched.push(idxBattler)
else # Player's Pokémon has fainted in a wild battle else
# Player's Pokémon has fainted in a wild battle
switch = false switch = false
if !pbDisplayConfirm(_INTL("Use next Pokémon?")) if !pbDisplayConfirm(_INTL("Use next Pokémon?"))
switch = (pbRun(idxBattler,true)<=0) switch = (pbRun(idxBattler, true) <= 0)
else else
switch = true switch = true
end end
if switch if switch
idxPlayerPartyNew = pbGetReplacementPokemonIndex(idxBattler) # Owner chooses idxPlayerPartyNew = pbGetReplacementPokemonIndex(idxBattler) # Owner chooses
pbRecallAndReplace(idxBattler,idxPlayerPartyNew) pbRecallAndReplace(idxBattler, idxPlayerPartyNew)
switched.push(idxBattler) switched.push(idxBattler)
end end
end end
end end
break if switched.length==0 break if switched.length == 0
pbPriority(true).each do |b| pbPriority(true).each do |b|
b.pbEffectsOnSwitchIn(true) if switched.include?(b.index) b.pbEffectsOnSwitchIn(true) if switched.include?(b.index)
end end
end end
end end
def pbGetReplacementPokemonIndex(idxBattler,random=false) def pbGetReplacementPokemonIndex(idxBattler, random = false)
if random if random
return -1 if !pbCanSwitch?(idxBattler) # Can battler switch out? return -1 if !pbCanSwitch?(idxBattler) # Can battler switch out?
choices = [] # Find all Pokémon that can switch in choices = [] # Find all Pokémon that can switch in
eachInTeamFromBattlerIndex(idxBattler) do |_pkmn,i| eachInTeamFromBattlerIndex(idxBattler) do |_pkmn, i|
choices.push(i) if pbCanSwitchLax?(idxBattler,i) choices.push(i) if pbCanSwitchLax?(idxBattler, i)
end end
return -1 if choices.length==0 return -1 if choices.length == 0
return choices[pbRandom(choices.length)] return choices[pbRandom(choices.length)]
else else
return pbSwitchInBetween(idxBattler,true) return pbSwitchInBetween(idxBattler, true)
end end
end end
# Actually performs the recalling and sending out in all situations. # Actually performs the recalling and sending out in all situations.
def pbRecallAndReplace(idxBattler,idxParty,randomReplacement=false,batonPass=false) def pbRecallAndReplace(idxBattler, idxParty, randomReplacement = false, batonPass = false)
@scene.pbRecall(idxBattler) if !@battlers[idxBattler].fainted? @scene.pbRecall(idxBattler) if !@battlers[idxBattler].fainted?
@battlers[idxBattler].pbAbilitiesOnSwitchOut # Inc. primordial weather check @battlers[idxBattler].pbAbilitiesOnSwitchOut # Inc. primordial weather check
@scene.pbShowPartyLineup(idxBattler&1) if pbSideSize(idxBattler)==1 @scene.pbShowPartyLineup(idxBattler & 1) if pbSideSize(idxBattler) == 1
pbMessagesOnReplace(idxBattler,idxParty) if !randomReplacement pbMessagesOnReplace(idxBattler, idxParty) if !randomReplacement
pbReplace(idxBattler,idxParty,batonPass) pbReplace(idxBattler, idxParty, batonPass)
end end
def pbMessageOnRecall(battler) def pbMessageOnRecall(battler)
if battler.pbOwnedByPlayer? if battler.pbOwnedByPlayer?
if battler.hp<=battler.totalhp/4 if battler.hp <= battler.totalhp / 4
pbDisplayBrief(_INTL("Good job, {1}! Come back!",battler.name)) pbDisplayBrief(_INTL("Good job, {1}! Come back!", battler.name))
elsif battler.hp<=battler.totalhp/2 elsif battler.hp <= battler.totalhp / 2
pbDisplayBrief(_INTL("OK, {1}! Come back!",battler.name)) pbDisplayBrief(_INTL("OK, {1}! Come back!", battler.name))
elsif battler.turnCount>=5 elsif battler.turnCount >= 5
pbDisplayBrief(_INTL("{1}, that's enough! Come back!",battler.name)) pbDisplayBrief(_INTL("{1}, that's enough! Come back!", battler.name))
elsif battler.turnCount>=2 elsif battler.turnCount >= 2
pbDisplayBrief(_INTL("{1}, come back!",battler.name)) pbDisplayBrief(_INTL("{1}, come back!", battler.name))
else else
pbDisplayBrief(_INTL("{1}, switch out! Come back!",battler.name)) pbDisplayBrief(_INTL("{1}, switch out! Come back!", battler.name))
end end
else else
owner = pbGetOwnerName(battler.index) owner = pbGetOwnerName(battler.index)
pbDisplayBrief(_INTL("{1} withdrew {2}!",owner,battler.name)) pbDisplayBrief(_INTL("{1} withdrew {2}!", owner, battler.name))
end end
end end
# Only called from def pbRecallAndReplace and Battle Arena's def pbSwitch. # Only called from def pbRecallAndReplace and Battle Arena's def pbSwitch.
def pbMessagesOnReplace(idxBattler,idxParty) def pbMessagesOnReplace(idxBattler, idxParty)
party = pbParty(idxBattler) party = pbParty(idxBattler)
newPkmnName = party[idxParty].name newPkmnName = party[idxParty].name
if party[idxParty].ability == :ILLUSION if party[idxParty].ability == :ILLUSION
@@ -261,45 +264,45 @@ class PokeBattle_Battle
end end
if pbOwnedByPlayer?(idxBattler) if pbOwnedByPlayer?(idxBattler)
opposing = @battlers[idxBattler].pbDirectOpposing opposing = @battlers[idxBattler].pbDirectOpposing
if opposing.fainted? || opposing.hp==opposing.totalhp if opposing.fainted? || opposing.hp == opposing.totalhp
pbDisplayBrief(_INTL("You're in charge, {1}!",newPkmnName)) pbDisplayBrief(_INTL("You're in charge, {1}!", newPkmnName))
elsif opposing.hp>=opposing.totalhp/2 elsif opposing.hp >= opposing.totalhp / 2
pbDisplayBrief(_INTL("Go for it, {1}!",newPkmnName)) pbDisplayBrief(_INTL("Go for it, {1}!", newPkmnName))
elsif opposing.hp>=opposing.totalhp/4 elsif opposing.hp >= opposing.totalhp / 4
pbDisplayBrief(_INTL("Just a little more! Hang in there, {1}!",newPkmnName)) pbDisplayBrief(_INTL("Just a little more! Hang in there, {1}!", newPkmnName))
else else
pbDisplayBrief(_INTL("Your opponent's weak! Get 'em, {1}!",newPkmnName)) pbDisplayBrief(_INTL("Your opponent's weak! Get 'em, {1}!", newPkmnName))
end end
else else
owner = pbGetOwnerFromBattlerIndex(idxBattler) owner = pbGetOwnerFromBattlerIndex(idxBattler)
pbDisplayBrief(_INTL("{1} sent out {2}!",owner.full_name,newPkmnName)) pbDisplayBrief(_INTL("{1} sent out {2}!", owner.full_name, newPkmnName))
end end
end end
# Only called from def pbRecallAndReplace above and Battle Arena's def # Only called from def pbRecallAndReplace above and Battle Arena's def
# pbSwitch. # pbSwitch.
def pbReplace(idxBattler,idxParty,batonPass=false) def pbReplace(idxBattler, idxParty, batonPass = false)
party = pbParty(idxBattler) party = pbParty(idxBattler)
idxPartyOld = @battlers[idxBattler].pokemonIndex idxPartyOld = @battlers[idxBattler].pokemonIndex
# Initialise the new Pokémon # Initialise the new Pokémon
@battlers[idxBattler].pbInitialize(party[idxParty],idxParty,batonPass) @battlers[idxBattler].pbInitialize(party[idxParty], idxParty, batonPass)
# Reorder the party for this battle # Reorder the party for this battle
partyOrder = pbPartyOrder(idxBattler) partyOrder = pbPartyOrder(idxBattler)
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 Settings::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.
# sendOuts is an array; each element is itself an array: [idxBattler,pkmn] # sendOuts is an array; each element is itself an array: [idxBattler,pkmn]
def pbSendOut(sendOuts,startBattle=false) def pbSendOut(sendOuts, startBattle = false)
sendOuts.each { |b| @peer.pbOnEnteringBattle(self,b[1]) } sendOuts.each { |b| @peer.pbOnEnteringBattle(self, b[1]) }
@scene.pbSendOutBattlers(sendOuts,startBattle) @scene.pbSendOutBattlers(sendOuts, startBattle)
sendOuts.each do |b| sendOuts.each do |b|
@scene.pbResetMoveIndex(b[0]) @scene.pbResetMoveIndex(b[0])
#pbSetSeen(@battlers[b[0]]) #pbSetSeen(@battlers[b[0]])
@usedInBattle[b[0]&1][b[0]/2] = true @usedInBattle[b[0] & 1][b[0] / 2] = true
end end
end end
@@ -321,7 +324,7 @@ class PokeBattle_Battle
return false if battler.fainted? return false if battler.fainted?
# Introduce Shadow Pokémon # Introduce Shadow Pokémon
if battler.opposes? && battler.shadowPokemon? if battler.opposes? && battler.shadowPokemon?
pbCommonAnimation("Shadow",battler) pbCommonAnimation("Shadow", battler)
pbDisplay(_INTL("Oh!\nA Shadow Pokémon!")) pbDisplay(_INTL("Oh!\nA Shadow Pokémon!"))
end end
# Record money-doubling effect of Amulet Coin/Luck Incense # Record money-doubling effect of Amulet Coin/Luck Incense
@@ -332,16 +335,16 @@ class PokeBattle_Battle
eachBattler { |b| b.pbUpdateParticipants } eachBattler { |b| b.pbUpdateParticipants }
# Healing Wish # Healing Wish
if @positions[battler.index].effects[PBEffects::HealingWish] if @positions[battler.index].effects[PBEffects::HealingWish]
pbCommonAnimation("HealingWish",battler) pbCommonAnimation("HealingWish", battler)
pbDisplay(_INTL("The healing wish came true for {1}!",battler.pbThis(true))) pbDisplay(_INTL("The healing wish came true for {1}!", battler.pbThis(true)))
battler.pbRecoverHP(battler.totalhp) battler.pbRecoverHP(battler.totalhp)
battler.pbCureStatus(false) battler.pbCureStatus(false)
@positions[battler.index].effects[PBEffects::HealingWish] = false @positions[battler.index].effects[PBEffects::HealingWish] = false
end end
# Lunar Dance # Lunar Dance
if @positions[battler.index].effects[PBEffects::LunarDance] if @positions[battler.index].effects[PBEffects::LunarDance]
pbCommonAnimation("LunarDance",battler) pbCommonAnimation("LunarDance", battler)
pbDisplay(_INTL("{1} became cloaked in mystical moonlight!",battler.pbThis)) pbDisplay(_INTL("{1} became cloaked in mystical moonlight!", battler.pbThis))
battler.pbRecoverHP(battler.totalhp) battler.pbRecoverHP(battler.totalhp)
battler.pbCureStatus(false) battler.pbCureStatus(false)
battler.eachMove { |m| m.pp = m.total_pp } battler.eachMove { |m| m.pp = m.total_pp }
@@ -350,52 +353,52 @@ class PokeBattle_Battle
# Entry hazards # Entry hazards
# Stealth Rock # Stealth Rock
if battler.pbOwnSide.effects[PBEffects::StealthRock] && battler.takesIndirectDamage? && if battler.pbOwnSide.effects[PBEffects::StealthRock] && battler.takesIndirectDamage? &&
GameData::Type.exists?(:ROCK) GameData::Type.exists?(:ROCK)
bTypes = battler.pbTypes(true) bTypes = battler.pbTypes(true)
eff = Effectiveness.calculate(:ROCK, bTypes[0], bTypes[1], bTypes[2]) eff = Effectiveness.calculate(:ROCK, bTypes[0], bTypes[1], bTypes[2])
if !Effectiveness.ineffective?(eff) if !Effectiveness.ineffective?(eff)
eff = eff.to_f / Effectiveness::NORMAL_EFFECTIVE eff = eff.to_f / Effectiveness::NORMAL_EFFECTIVE
oldHP = battler.hp oldHP = battler.hp
battler.pbReduceHP(battler.totalhp*eff/8,false) battler.pbReduceHP(battler.totalhp * eff / 8, false)
pbDisplay(_INTL("Pointed stones dug into {1}!",battler.pbThis)) pbDisplay(_INTL("Pointed stones dug into {1}!", battler.pbThis))
battler.pbItemHPHealCheck battler.pbItemHPHealCheck
if battler.pbAbilitiesOnDamageTaken(oldHP) # Switched out if battler.pbAbilitiesOnDamageTaken(oldHP) # Switched out
return pbOnActiveOne(battler) # For replacement battler return pbOnActiveOne(battler) # For replacement battler
end end
end end
end end
# Spikes # Spikes
if battler.pbOwnSide.effects[PBEffects::Spikes]>0 && battler.takesIndirectDamage? && if battler.pbOwnSide.effects[PBEffects::Spikes] > 0 && battler.takesIndirectDamage? &&
!battler.airborne? !battler.airborne?
spikesDiv = [8,6,4][battler.pbOwnSide.effects[PBEffects::Spikes]-1] spikesDiv = [8, 6, 4][battler.pbOwnSide.effects[PBEffects::Spikes] - 1]
oldHP = battler.hp oldHP = battler.hp
battler.pbReduceHP(battler.totalhp/spikesDiv,false) battler.pbReduceHP(battler.totalhp / spikesDiv, false)
pbDisplay(_INTL("{1} is hurt by the spikes!",battler.pbThis)) pbDisplay(_INTL("{1} is hurt by the spikes!", battler.pbThis))
battler.pbItemHPHealCheck battler.pbItemHPHealCheck
if battler.pbAbilitiesOnDamageTaken(oldHP) # Switched out if battler.pbAbilitiesOnDamageTaken(oldHP) # Switched out
return pbOnActiveOne(battler) # For replacement battler return pbOnActiveOne(battler) # For replacement battler
end end
end end
# Toxic Spikes # Toxic Spikes
if battler.pbOwnSide.effects[PBEffects::ToxicSpikes]>0 && !battler.fainted? && if battler.pbOwnSide.effects[PBEffects::ToxicSpikes] > 0 && !battler.fainted? &&
!battler.airborne? !battler.airborne?
if battler.pbHasType?(:POISON) if battler.pbHasType?(:POISON)
battler.pbOwnSide.effects[PBEffects::ToxicSpikes] = 0 battler.pbOwnSide.effects[PBEffects::ToxicSpikes] = 0
pbDisplay(_INTL("{1} absorbed the poison spikes!",battler.pbThis)) pbDisplay(_INTL("{1} absorbed the poison spikes!", battler.pbThis))
elsif battler.pbCanPoison?(nil,false) elsif battler.pbCanPoison?(nil, false)
if battler.pbOwnSide.effects[PBEffects::ToxicSpikes]==2 if battler.pbOwnSide.effects[PBEffects::ToxicSpikes] == 2
battler.pbPoison(nil,_INTL("{1} was badly poisoned by the poison spikes!",battler.pbThis),true) battler.pbPoison(nil, _INTL("{1} was badly poisoned by the poison spikes!", battler.pbThis), true)
else else
battler.pbPoison(nil,_INTL("{1} was poisoned by the poison spikes!",battler.pbThis)) battler.pbPoison(nil, _INTL("{1} was poisoned by the poison spikes!", battler.pbThis))
end end
end end
end end
# Sticky Web # Sticky Web
if battler.pbOwnSide.effects[PBEffects::StickyWeb] && !battler.fainted? && if battler.pbOwnSide.effects[PBEffects::StickyWeb] && !battler.fainted? &&
!battler.airborne? !battler.airborne?
pbDisplay(_INTL("{1} was caught in a sticky web!",battler.pbThis)) pbDisplay(_INTL("{1} was caught in a sticky web!", battler.pbThis))
if battler.pbCanLowerStatStage?(:SPEED) if battler.pbCanLowerStatStage?(:SPEED)
battler.pbLowerStatStage(:SPEED,1,nil) battler.pbLowerStatStage(:SPEED, 1, nil)
battler.pbItemStatRestoreCheck battler.pbItemStatRestoreCheck
end end
end end

View File

@@ -64,6 +64,9 @@ class Trainer
end end
def skill_level def skill_level
if $game_switches[GAME_DIFFICULTY_HARD]
return 100
end
return GameData::TrainerType.get(@trainer_type).skill_level; return GameData::TrainerType.get(@trainer_type).skill_level;
end end

View File

@@ -396,13 +396,13 @@ class PokemonOption_Scene
end end
if $game_switches && $game_switches[GOT_BADGE_5] #badge for Surf # if $game_switches && $game_switches[GOT_BADGE_5] #badge for Surf
@PokemonOptions << @PokemonOptions <<
EnumOption.new(_INTL("Quick Surf"), [_INTL("Off"), _INTL("On")], EnumOption.new(_INTL("Quick Surf"), [_INTL("Off"), _INTL("On")],
proc { $PokemonSystem.quicksurf }, proc { $PokemonSystem.quicksurf },
proc { |value| $PokemonSystem.quicksurf = value } proc { |value| $PokemonSystem.quicksurf = value }
) )
end # end
@PokemonOptions = pbAddOnOptions(@PokemonOptions) @PokemonOptions = pbAddOnOptions(@PokemonOptions)
@sprites["option"] = Window_PokemonOption.new(@PokemonOptions, 0, @sprites["option"] = Window_PokemonOption.new(@PokemonOptions, 0,

Binary file not shown.