mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Rearranged settings
This commit is contained in:
@@ -1,90 +1,61 @@
|
||||
#==============================================================================#
|
||||
# Pokémon Essentials #
|
||||
# Version 18.1.dev #
|
||||
# https://github.com/Maruno17/pokemon-essentials #
|
||||
#==============================================================================#
|
||||
|
||||
# The generation that the battle system follows. Used throughout the battle
|
||||
# scripts, and also by some other settings which are used in and out of battle
|
||||
# (you can of course change those settings to suit your game).
|
||||
# Note that this isn't perfect. Essentials doesn't accurately replicate every
|
||||
# single generation's mechanics. It's considered to be good enough. Only
|
||||
# generations 5 and later are reasonably supported.
|
||||
MECHANICS_GENERATION = 7
|
||||
|
||||
#===============================================================================
|
||||
# * The default screen width (at a scale of 1.0).
|
||||
# * The default screen height (at a scale of 1.0).
|
||||
# * The default screen scale factor. Possible values are 0.5, 1.0, 1.5 and 2.0.
|
||||
# * Map view mode (0=original, 1=custom, 2=perspective).
|
||||
#===============================================================================
|
||||
|
||||
# The default screen width (at a scale of 1.0).
|
||||
SCREEN_WIDTH = 512
|
||||
# The default screen height (at a scale of 1.0).
|
||||
SCREEN_HEIGHT = 384
|
||||
# The default screen scale factor. Possible values are 0.5, 1.0, 1.5 and 2.0.
|
||||
SCREEN_SCALE = 1.0
|
||||
# Map view mode (0=original, 1=custom, 2=perspective).
|
||||
MAP_VIEW_MODE = 1
|
||||
# To forbid the player from changing the screen size themselves, quote out or
|
||||
# delete the relevant bit of code in the PScreen_Options script section.
|
||||
|
||||
#===============================================================================
|
||||
# * The maximum level Pokémon can reach.
|
||||
# * The level of newly hatched Pokémon.
|
||||
# * The odds of a newly generated Pokémon being shiny (out of 65536).
|
||||
# * The odds of a wild Pokémon/bred egg having Pokérus (out of 65536).
|
||||
#===============================================================================
|
||||
|
||||
# The maximum level Pokémon can reach.
|
||||
MAXIMUM_LEVEL = 100
|
||||
# The level of newly hatched Pokémon.
|
||||
EGG_LEVEL = 1
|
||||
SHINY_POKEMON_CHANCE = 8
|
||||
# The odds of a newly generated Pokémon being shiny (out of 65536).
|
||||
SHINY_POKEMON_CHANCE = (MECHANICS_GENERATION >= 6) ? 16 : 8
|
||||
# The odds of a wild Pokémon/bred egg having Pokérus (out of 65536).
|
||||
POKERUS_CHANCE = 3
|
||||
# Whether a bred baby Pokémon can inherit any TM/HM moves from its father. It
|
||||
# can never inherit TM/HM moves from its mother.
|
||||
BREEDING_CAN_INHERIT_MACHINE_MOVES = (MECHANICS_GENERATION <= 5)
|
||||
# Whether a bred baby Pokémon can inherit egg moves from its mother. It can
|
||||
# always inherit egg moves from its father.
|
||||
BREEDING_CAN_INHERIT_EGG_MOVES_FROM_MOTHER = (MECHANICS_GENERATION >= 6)
|
||||
|
||||
#===============================================================================
|
||||
# * Whether outdoor maps should be shaded according to the time of day.
|
||||
#===============================================================================
|
||||
TIME_SHADING = true
|
||||
|
||||
#===============================================================================
|
||||
# * Whether poisoned Pokémon will lose HP while walking around in the field.
|
||||
# * Whether poisoned Pokémon will faint while walking around in the field
|
||||
# (true), or survive the poisoning with 1HP (false).
|
||||
# * Whether fishing automatically hooks the Pokémon (if false, there is a
|
||||
# reaction test first).
|
||||
# * Whether the player can surface from anywhere while diving (true), or only in
|
||||
# spots where they could dive down from above (false).
|
||||
# * Whether planted berries grow according to Gen 4 mechanics (true) or Gen 3
|
||||
# mechanics (false).
|
||||
# * Whether TMs can be used infinitely as in Gen 5 (true), or are one-use-only
|
||||
# as in older Gens (false).
|
||||
#===============================================================================
|
||||
POISON_IN_FIELD = true
|
||||
POISON_FAINT_IN_FIELD = false
|
||||
FISHING_AUTO_HOOK = false
|
||||
DIVING_SURFACE_ANYWHERE = false
|
||||
NEW_BERRY_PLANTS = true
|
||||
INFINITE_TMS = true
|
||||
|
||||
#===============================================================================
|
||||
# * The number of steps allowed before a Safari Zone game is over (0=infinite).
|
||||
# * The number of seconds a Bug Catching Contest lasts for (0=infinite).
|
||||
#===============================================================================
|
||||
SAFARI_STEPS = 600
|
||||
BUG_CONTEST_TIME = 1200
|
||||
|
||||
#===============================================================================
|
||||
# * Pairs of map IDs, where the location signpost isn't shown when moving from
|
||||
# one of the maps in a pair to the other (and vice versa). Useful for
|
||||
# single long routes/towns that are spread over multiple maps.
|
||||
# e.g. [4,5,16,17,42,43] will be map pairs 4,5 and 16,17 and 42,43.
|
||||
# Moving between two maps that have the exact same name won't show the
|
||||
# location signpost anyway, so you don't need to list those maps here.
|
||||
#===============================================================================
|
||||
NO_SIGNPOSTS = []
|
||||
|
||||
#===============================================================================
|
||||
# * The amount of money the player starts the game with.
|
||||
# * The maximum amount of money the player can have.
|
||||
# * The maximum number of Game Corner coins the player can have.
|
||||
# * The maximum length, in characters, that the player's name can be.
|
||||
#===============================================================================
|
||||
# The amount of money the player starts the game with.
|
||||
INITIAL_MONEY = 3000
|
||||
# The maximum amount of money the player can have.
|
||||
MAX_MONEY = 999_999
|
||||
# The maximum number of Game Corner coins the player can have.
|
||||
MAX_COINS = 99_999
|
||||
# The maximum length, in characters, that the player's name can be.
|
||||
MAX_PLAYER_NAME_SIZE = 10
|
||||
|
||||
#===============================================================================
|
||||
# * A set of arrays each containing a trainer type followed by a Global Variable
|
||||
# number. If the variable isn't set to 0, then all trainers with the
|
||||
# associated trainer type will be named as whatever is in that variable.
|
||||
#===============================================================================
|
||||
|
||||
# A set of arrays each containing a trainer type followed by a Global Variable
|
||||
# number. If the variable isn't set to 0, then all trainers with the associated
|
||||
# trainer type will be named as whatever is in that variable.
|
||||
RIVAL_NAMES = [
|
||||
[:RIVAL1, 12],
|
||||
[:RIVAL2, 12],
|
||||
@@ -92,68 +63,93 @@ RIVAL_NAMES = [
|
||||
]
|
||||
|
||||
#===============================================================================
|
||||
# * The minimum number of badges required to boost each stat of a player's
|
||||
# Pokémon by 1.1x, while using moves in battle only.
|
||||
# * Whether the badge restriction on using certain hidden moves is either owning
|
||||
# at least a certain number of badges (true), or owning a particular badge
|
||||
# (false).
|
||||
# * Depending on FIELD_MOVES_COUNT_BADGES, either the number of badges required
|
||||
# to use each hidden move, or the specific badge number required to use
|
||||
# each move. Remember that badge 0 is the first badge, badge 1 is the
|
||||
# second badge, etc.
|
||||
# e.g. To require the second badge, put false and 1.
|
||||
# To require at least 2 badges, put true and 2.
|
||||
|
||||
# Whether outdoor maps should be shaded according to the time of day.
|
||||
TIME_SHADING = true
|
||||
|
||||
#===============================================================================
|
||||
NUM_BADGES_BOOST_ATTACK = 1
|
||||
NUM_BADGES_BOOST_DEFENSE = 5
|
||||
NUM_BADGES_BOOST_SPATK = 7
|
||||
NUM_BADGES_BOOST_SPDEF = 7
|
||||
NUM_BADGES_BOOST_SPEED = 3
|
||||
|
||||
# Whether poisoned Pokémon will lose HP while walking around in the field.
|
||||
POISON_IN_FIELD = (MECHANICS_GENERATION <= 4)
|
||||
# Whether poisoned Pokémon will faint while walking around in the field (true),
|
||||
# or survive the poisoning with 1 HP (false).
|
||||
POISON_FAINT_IN_FIELD = (MECHANICS_GENERATION <= 3)
|
||||
# Whether planted berries grow according to Gen 4 mechanics (true) or Gen 3
|
||||
# mechanics (false).
|
||||
NEW_BERRY_PLANTS = (MECHANICS_GENERATION >= 4)
|
||||
# Whether fishing automatically hooks the Pokémon (if false, there is a reaction
|
||||
# test first).
|
||||
FISHING_AUTO_HOOK = false
|
||||
# The ID of the common event that runs when the player starts fishing (runs
|
||||
# instead of showing the casting animation).
|
||||
FISHING_BEGIN_COMMON_EVENT = -1
|
||||
# The ID of the common event that runs when the player stops fishing (runs
|
||||
# instead of showing the reeling in animation).
|
||||
FISHING_END_COMMON_EVENT = -1
|
||||
|
||||
#===============================================================================
|
||||
|
||||
# The number of steps allowed before a Safari Zone game is over (0=infinite).
|
||||
SAFARI_STEPS = 600
|
||||
# The number of seconds a Bug Catching Contest lasts for (0=infinite).
|
||||
BUG_CONTEST_TIME = 1200
|
||||
|
||||
#===============================================================================
|
||||
|
||||
# Pairs of map IDs, where the location signpost isn't shown when moving from one
|
||||
# of the maps in a pair to the other (and vice versa). Useful for single long
|
||||
# routes/towns that are spread over multiple maps.
|
||||
# e.g. [4,5,16,17,42,43] will be map pairs 4,5 and 16,17 and 42,43.
|
||||
# Moving between two maps that have the exact same name won't show the location
|
||||
# signpost anyway, so you don't need to list those maps here.
|
||||
NO_SIGNPOSTS = []
|
||||
|
||||
#===============================================================================
|
||||
|
||||
# Whether the badge restriction on using certain hidden moves is owning at least
|
||||
# a certain number of badges (true), or owning a particular badge (false).
|
||||
FIELD_MOVES_COUNT_BADGES = true
|
||||
BADGE_FOR_CUT = 1
|
||||
BADGE_FOR_FLASH = 2
|
||||
BADGE_FOR_ROCKSMASH = 3
|
||||
BADGE_FOR_SURF = 4
|
||||
BADGE_FOR_FLY = 5
|
||||
BADGE_FOR_STRENGTH = 6
|
||||
BADGE_FOR_DIVE = 7
|
||||
BADGE_FOR_WATERFALL = 8
|
||||
# Depending on FIELD_MOVES_COUNT_BADGES, either the number of badges required to
|
||||
# use each hidden move, or the specific badge number required to use each move.
|
||||
# Remember that badge 0 is the first badge, badge 1 is the second badge, etc.
|
||||
# e.g. To require the second badge, put false and 1.
|
||||
# To require at least 2 badges, put true and 2.
|
||||
BADGE_FOR_CUT = 1
|
||||
BADGE_FOR_FLASH = 2
|
||||
BADGE_FOR_ROCKSMASH = 3
|
||||
BADGE_FOR_SURF = 4
|
||||
BADGE_FOR_FLY = 5
|
||||
BADGE_FOR_STRENGTH = 6
|
||||
BADGE_FOR_DIVE = 7
|
||||
BADGE_FOR_WATERFALL = 8
|
||||
|
||||
#===============================================================================
|
||||
# * Whether a move's physical/special category depends on the move itself as in
|
||||
# newer Gens (true), or on its type as in older Gens (false).
|
||||
# * Whether the battle mechanics mimic Gen 5 (false) or Gen 7 (true).
|
||||
# * Whether the Exp gained from beating a Pokémon should be scaled depending on
|
||||
# the gainer's level as in Gens 5/7 (true) or not as in other Gens (false).
|
||||
# * Whether the Exp gained from beating a Pokémon should be divided equally
|
||||
# between each participant (true), or whether each participant should gain
|
||||
# that much Exp (false). This also applies to Exp gained via the Exp Share
|
||||
# (held item version) being distributed to all Exp Share holders. This is
|
||||
# true in Gen 6 and false otherwise.
|
||||
# * Whether the critical capture mechanic applies (true) or not (false). Note
|
||||
# that it is based on a total of 600+ species (i.e. that many species need
|
||||
# to be caught to provide the greatest critical capture chance of 2.5x),
|
||||
# and there may be fewer species in your game.
|
||||
# * Whether Pokémon gain Exp for capturing a Pokémon (true) or not (false).
|
||||
# * 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).
|
||||
#===============================================================================
|
||||
MOVE_CATEGORY_PER_MOVE = true
|
||||
NEWEST_BATTLE_MECHANICS = true
|
||||
SCALED_EXP_FORMULA = true
|
||||
SPLIT_EXP_BETWEEN_GAINERS = false
|
||||
ENABLE_CRITICAL_CAPTURES = false
|
||||
GAIN_EXP_FOR_CAPTURE = true
|
||||
MEGA_RINGS = [:MEGARING, :MEGABRACELET, :MEGACUFF, :MEGACHARM]
|
||||
|
||||
# If a move taught by a TM/HM/TR replaces another move, this setting is whether
|
||||
# the machine's move retains the replaced move's PP (true) or whether the
|
||||
# machine's move has full PP (false).
|
||||
TAUGHT_MACHINES_KEEP_OLD_PP = (MECHANICS_GENERATION == 5)
|
||||
# Whether Black/White Flute raise/lower the levels of wild Pokémon respectively
|
||||
# (true) or lower/raise the wild encounter rate respectively (false).
|
||||
FLUTES_CHANGE_WILD_ENCOUNTER_LEVELS = (MECHANICS_GENERATION >= 6)
|
||||
# Whether Repel uses the level of the first Pokémon in the party regardless of
|
||||
# its HP (true) or uses the level of the first unfainted Pokémon (false)
|
||||
REPEL_COUNTS_FAINTED_POKEMON = (MECHANICS_GENERATION >= 6)
|
||||
# Whether Rage Candy Bar acts as a Full Heal (true) or a Potion (false).
|
||||
RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS = (MECHANICS_GENERATION >= 7)
|
||||
|
||||
#===============================================================================
|
||||
# * The names of each pocket of the Bag. Leave the first entry blank.
|
||||
# * The maximum number of slots per pocket (-1 means infinite number). Ignore
|
||||
# the first number (0).
|
||||
# * 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
|
||||
# first entry (the 0).
|
||||
|
||||
# The name of the person who created the Pokémon storage system.
|
||||
def pbStorageCreator
|
||||
return _INTL("Bill")
|
||||
end
|
||||
# The number of boxes in Pokémon storage.
|
||||
NUM_STORAGE_BOXES = 30
|
||||
|
||||
#===============================================================================
|
||||
|
||||
# The names of each pocket of the Bag. Leave the first entry blank.
|
||||
def pbPocketNames; return ["",
|
||||
_INTL("Items"),
|
||||
_INTL("Medicine"),
|
||||
@@ -163,81 +159,66 @@ def pbPocketNames; return ["",
|
||||
_INTL("Mail"),
|
||||
_INTL("Battle Items"),
|
||||
_INTL("Key Items")
|
||||
]; end
|
||||
]; end
|
||||
# The maximum number of slots per pocket (-1 means infinite number). Ignore the
|
||||
# first number (0).
|
||||
BAG_MAX_POCKET_SIZE = [0, -1, -1, -1, -1, -1, -1, -1, -1]
|
||||
# The maximum number of items each slot in the Bag can hold.
|
||||
BAG_MAX_PER_SLOT = 999
|
||||
# Whether each pocket in turn auto-sorts itself by item ID number. Ignore the
|
||||
# first entry (the 0).
|
||||
BAG_POCKET_AUTO_SORT = [0, false, false, false, true, true, false, false, false]
|
||||
|
||||
#===============================================================================
|
||||
# * A set of arrays each containing details of a graphic to be shown on the
|
||||
# region map if appropriate. The values for each array are as follows:
|
||||
# - Region number.
|
||||
# - Global Switch; the graphic is shown if this is ON (non-wall maps only).
|
||||
# - X coordinate of the graphic on the map, in squares.
|
||||
# - Y coordinate of the graphic on the map, in squares.
|
||||
# - Name of the graphic, found in the Graphics/Pictures folder.
|
||||
# - The graphic will always (true) or never (false) be shown on a wall map.
|
||||
|
||||
# Whether the Pokédex list shown is the one for the player's current region
|
||||
# (true), or whether a menu pops up for the player to manually choose which Dex
|
||||
# list to view if more than one is available (false).
|
||||
USE_CURRENT_REGION_DEX = false
|
||||
# The names of each Dex list in the game, in order and with National Dex at the
|
||||
# end. This is also the order that $PokemonGlobal.pokedexUnlocked is in, which
|
||||
# records which Dexes have been unlocked (first is unlocked by default).
|
||||
# You can define which region a particular Dex list is linked to. This means the
|
||||
# area map shown while viewing that Dex list will ALWAYS be that of the defined
|
||||
# region, rather than whichever region the player is currently in. To define
|
||||
# this, put the Dex name and the region number in an array, like the Kanto and
|
||||
# Johto Dexes are. The National Dex isn't in an array with a region number,
|
||||
# therefore its area map is whichever region the player is currently in.
|
||||
def pbDexNames; return [
|
||||
[_INTL("Kanto Pokédex"), 0],
|
||||
[_INTL("Johto Pokédex"), 1],
|
||||
_INTL("National Pokédex")
|
||||
]; end
|
||||
# Whether all forms of a given species will be immediately available to view in
|
||||
# the Pokédex so long as that species has been seen at all (true), or whether
|
||||
# each form needs to be seen specifically before that form appears in the
|
||||
# Pokédex (false).
|
||||
DEX_SHOWS_ALL_FORMS = false
|
||||
# An array of numbers, where each number is that of a Dex list (National Dex is
|
||||
# -1). All Dex lists included here have the species numbers in them reduced by
|
||||
# 1, thus making the first listed species have a species number of 0 (e.g.
|
||||
# Victini in Unova's Dex).
|
||||
DEXES_WITH_OFFSETS = []
|
||||
|
||||
#===============================================================================
|
||||
|
||||
# A set of arrays each containing details of a graphic to be shown on the region
|
||||
# map if appropriate. The values for each array are as follows:
|
||||
# - Region number.
|
||||
# - Global Switch; the graphic is shown if this is ON (non-wall maps only).
|
||||
# - X coordinate of the graphic on the map, in squares.
|
||||
# - Y coordinate of the graphic on the map, in squares.
|
||||
# - Name of the graphic, found in the Graphics/Pictures folder.
|
||||
# - The graphic will always (true) or never (false) be shown on a wall map.
|
||||
REGION_MAP_EXTRAS = [
|
||||
[0, 51, 16, 15, "mapHiddenBerth", false],
|
||||
[0, 52, 20, 14, "mapHiddenFaraday", false]
|
||||
]
|
||||
|
||||
#===============================================================================
|
||||
# * The name of the person who created the Pokémon storage system.
|
||||
# * The number of boxes in Pokémon storage.
|
||||
#===============================================================================
|
||||
def pbStorageCreator
|
||||
return _INTL("Bill")
|
||||
end
|
||||
NUM_STORAGE_BOXES = 30
|
||||
|
||||
#===============================================================================
|
||||
# * Whether the Pokédex list shown is the one for the player's current region
|
||||
# (true), or whether a menu pops up for the player to manually choose which
|
||||
# Dex list to view if more than one is available (false).
|
||||
# * The names of each Dex list in the game, in order and with National Dex at
|
||||
# the end. This is also the order that $PokemonGlobal.pokedexUnlocked is
|
||||
# in, which records which Dexes have been unlocked (first is unlocked by
|
||||
# default).
|
||||
# You can define which region a particular Dex list is linked to. This
|
||||
# means the area map shown while viewing that Dex list will ALWAYS be that
|
||||
# of the defined region, rather than whichever region the player is
|
||||
# currently in. To define this, put the Dex name and the region number in
|
||||
# an array, like the Kanto and Johto Dexes are. The National Dex isn't in
|
||||
# an array with a region number, therefore its area map is whichever region
|
||||
# the player is currently in.
|
||||
# * Whether all forms of a given species will be immediately available to view
|
||||
# in the Pokédex so long as that species has been seen at all (true), or
|
||||
# whether each form needs to be seen specifically before that form appears
|
||||
# in the Pokédex (false).
|
||||
# * An array of numbers, where each number is that of a Dex list (National Dex
|
||||
# is -1). All Dex lists included here have the species numbers in them
|
||||
# reduced by 1, thus making the first listed species have a species number
|
||||
# of 0 (e.g. Victini in Unova's Dex).
|
||||
#===============================================================================
|
||||
USE_CURRENT_REGION_DEX = false
|
||||
def pbDexNames; return [
|
||||
[_INTL("Kanto Pokédex"), 0],
|
||||
[_INTL("Johto Pokédex"), 1],
|
||||
_INTL("National Pokédex")
|
||||
]; end
|
||||
DEX_SHOWS_ALL_FORMS = false
|
||||
DEXES_WITH_OFFSETS = []
|
||||
|
||||
#===============================================================================
|
||||
# * A list of maps used by roaming Pokémon. Each map has an array of other maps
|
||||
# it can lead to.
|
||||
# * A set of arrays each containing the details of a roaming Pokémon. The
|
||||
# information within is as follows:
|
||||
# - Species.
|
||||
# - Level.
|
||||
# - Global Switch; the Pokémon roams while this is ON.
|
||||
# - Encounter type (0=any, 1=grass/walking in cave, 2=surfing, 3=fishing,
|
||||
# 4=surfing/fishing). See bottom of PField_RoamingPokemon for lists.
|
||||
# - Name of BGM to play for that encounter (optional).
|
||||
# - Roaming areas specifically for this Pokémon (optional).
|
||||
#===============================================================================
|
||||
# A list of maps used by roaming Pokémon. Each map has an array of other maps it
|
||||
# can lead to.
|
||||
ROAMING_AREAS = {
|
||||
5 => [ 21, 28, 31, 39, 41, 44, 47, 66, 69],
|
||||
21 => [5, 28, 31, 39, 41, 44, 47, 66, 69],
|
||||
@@ -250,6 +231,15 @@ ROAMING_AREAS = {
|
||||
66 => [5, 21, 28, 31, 39, 41, 44, 47, 69],
|
||||
69 => [5, 21, 28, 31, 39, 41, 44, 47, 66 ]
|
||||
}
|
||||
# A set of arrays each containing the details of a roaming Pokémon. The
|
||||
# information within is as follows:
|
||||
# - Species.
|
||||
# - Level.
|
||||
# - Global Switch; the Pokémon roams while this is ON.
|
||||
# - Encounter type (0=any, 1=grass/walking in cave, 2=surfing, 3=fishing,
|
||||
# 4=surfing/fishing). See bottom of PField_RoamingPokemon for lists.
|
||||
# - Name of BGM to play for that encounter (optional).
|
||||
# - Roaming areas specifically for this Pokémon (optional).
|
||||
ROAMING_SPECIES = [
|
||||
[:LATIAS, 30, 53, 0, "Battle roaming"],
|
||||
[:LATIOS, 30, 53, 0, "Battle roaming"],
|
||||
@@ -263,14 +253,14 @@ ROAMING_SPECIES = [
|
||||
]
|
||||
|
||||
#===============================================================================
|
||||
# * A set of arrays each containing details of a wild encounter that can only
|
||||
# occur via using the Poké Radar. The information within is as follows:
|
||||
# - Map ID on which this encounter can occur.
|
||||
# - Probability that this encounter will occur (as a percentage).
|
||||
# - Species.
|
||||
# - Minimum possible level.
|
||||
# - Maximum possible level (optional).
|
||||
#===============================================================================
|
||||
|
||||
# A set of arrays each containing details of a wild encounter that can only
|
||||
# occur via using the Poké Radar. The information within is as follows:
|
||||
# - Map ID on which this encounter can occur.
|
||||
# - Probability that this encounter will occur (as a percentage).
|
||||
# - Species.
|
||||
# - Minimum possible level.
|
||||
# - Maximum possible level (optional).
|
||||
POKE_RADAR_ENCOUNTERS = [
|
||||
[5, 20, :STARLY, 12, 15],
|
||||
[21, 10, :STANTLER, 14],
|
||||
@@ -279,64 +269,114 @@ POKE_RADAR_ENCOUNTERS = [
|
||||
]
|
||||
|
||||
#===============================================================================
|
||||
# * The Global Switch that is set to ON when the player whites out.
|
||||
# * The Global 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.
|
||||
# * The Global Switch which, while ON, makes all wild Pokémon created be
|
||||
# shiny.
|
||||
# * The Global Switch which, while ON, makes all Pokémon created considered to
|
||||
# be met via a fateful encounter.
|
||||
# * The Global Switch which determines whether the player will lose money if
|
||||
# they lose a battle (they can still gain money from trainers for winning).
|
||||
# * The Global Switch which, while ON, prevents all Pokémon in battle from Mega
|
||||
# Evolving even if they otherwise could.
|
||||
#===============================================================================
|
||||
|
||||
# The Game Switch that is set to ON when the player blacks out.
|
||||
STARTING_OVER_SWITCH = 1
|
||||
# The Game Switch that is set to ON when the player has seen Pokérus in the Poké
|
||||
# Center, and doesn't need to be told about it again.
|
||||
SEEN_POKERUS_SWITCH = 2
|
||||
# The Game Switch which, while ON, makes all wild Pokémon created be shiny.
|
||||
SHINY_WILD_POKEMON_SWITCH = 31
|
||||
# The Game Switch which, while ON, makes all Pokémon created considered to be
|
||||
# met via a fateful encounter.
|
||||
FATEFUL_ENCOUNTER_SWITCH = 32
|
||||
NO_MONEY_LOSS = 33
|
||||
NO_MEGA_EVOLUTION = 34
|
||||
|
||||
#===============================================================================
|
||||
# * The ID of the common event that runs when the player starts fishing (runs
|
||||
# instead of showing the casting animation).
|
||||
# * The ID of the common event that runs when the player stops fishing (runs
|
||||
# instead of showing the reeling in animation).
|
||||
#===============================================================================
|
||||
FISHING_BEGIN_COMMON_EVENT = -1
|
||||
FISHING_END_COMMON_EVENT = -1
|
||||
|
||||
#===============================================================================
|
||||
# * The ID of the animation played when the player steps on grass (shows grass
|
||||
# rustling).
|
||||
# * The ID of the animation played when the player lands on the ground after
|
||||
# hopping over a ledge (shows a dust impact).
|
||||
# * The ID of the animation played when a trainer notices the player (an
|
||||
# exclamation bubble).
|
||||
# * The ID of the animation played when a patch of grass rustles due to using
|
||||
# the Poké Radar.
|
||||
# * The ID of the animation played when a patch of grass rustles vigorously due
|
||||
# to using the Poké Radar. (Rarer species)
|
||||
# * The ID of the animation played when a patch of grass rustles and shines due
|
||||
# to using the Poké Radar. (Shiny encounter)
|
||||
# * The 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).
|
||||
#===============================================================================
|
||||
# ID of the animation played when the player steps on grass (grass rustling).
|
||||
GRASS_ANIMATION_ID = 1
|
||||
# ID of the animation played when the player lands on the ground after hopping
|
||||
# over a ledge (shows a dust impact).
|
||||
DUST_ANIMATION_ID = 2
|
||||
# ID of the animation played when a trainer notices the player (an exclamation
|
||||
# bubble).
|
||||
EXCLAMATION_ANIMATION_ID = 3
|
||||
# ID of the animation played when a patch of grass rustles due to using the Poké
|
||||
# Radar.
|
||||
RUSTLE_NORMAL_ANIMATION_ID = 1
|
||||
# ID of the animation played when a patch of grass rustles vigorously due to
|
||||
# using the Poké Radar. (Rarer species)
|
||||
RUSTLE_VIGOROUS_ANIMATION_ID = 5
|
||||
# ID of the animation played when a patch of grass rustles and shines due to
|
||||
# using the Poké Radar. (Shiny encounter)
|
||||
RUSTLE_SHINY_ANIMATION_ID = 6
|
||||
# ID of the animation played when a berry tree grows a stage while the player is
|
||||
# on the map (for new plant growth mechanics only).
|
||||
PLANT_SPARKLE_ANIMATION_ID = 7
|
||||
|
||||
#===============================================================================
|
||||
# * An array of available languages in the game, and their corresponding
|
||||
# message file in the Data folder. Edit only if you have 2 or more
|
||||
# languages to choose from.
|
||||
#===============================================================================
|
||||
|
||||
# An array of available languages in the game, and their corresponding message
|
||||
# file in the Data folder. Edit only if you have 2 or more languages to choose
|
||||
# from.
|
||||
LANGUAGES = [
|
||||
# ["English", "english.dat"],
|
||||
# ["Deutsch", "deutsch.dat"]
|
||||
]
|
||||
|
||||
#===============================================================================
|
||||
|
||||
# Available speech frames. These are graphic files in "Graphics/Windowskins/".
|
||||
$SpeechFrames = [
|
||||
"speech hgss 1",
|
||||
"speech hgss 2",
|
||||
"speech hgss 3",
|
||||
"speech hgss 4",
|
||||
"speech hgss 5",
|
||||
"speech hgss 6",
|
||||
"speech hgss 7",
|
||||
"speech hgss 8",
|
||||
"speech hgss 9",
|
||||
"speech hgss 10",
|
||||
"speech hgss 11",
|
||||
"speech hgss 12",
|
||||
"speech hgss 13",
|
||||
"speech hgss 14",
|
||||
"speech hgss 15",
|
||||
"speech hgss 16",
|
||||
"speech hgss 17",
|
||||
"speech hgss 18",
|
||||
"speech hgss 19",
|
||||
"speech hgss 20",
|
||||
"speech pl 18"
|
||||
]
|
||||
|
||||
# Available menu frames. These are graphic files in "Graphics/Windowskins/".
|
||||
$TextFrames = [
|
||||
"choice 1",
|
||||
"choice 2",
|
||||
"choice 3",
|
||||
"choice 4",
|
||||
"choice 5",
|
||||
"choice 6",
|
||||
"choice 7",
|
||||
"choice 8",
|
||||
"choice 9",
|
||||
"choice 10",
|
||||
"choice 11",
|
||||
"choice 12",
|
||||
"choice 13",
|
||||
"choice 14",
|
||||
"choice 15",
|
||||
"choice 16",
|
||||
"choice 17",
|
||||
"choice 18",
|
||||
"choice 19",
|
||||
"choice 20",
|
||||
"choice 21",
|
||||
"choice 22",
|
||||
"choice 23",
|
||||
"choice 24",
|
||||
"choice 25",
|
||||
"choice 26",
|
||||
"choice 27",
|
||||
"choice 28"
|
||||
]
|
||||
|
||||
# Available fonts. Each one needs to be in its own array.
|
||||
$VersionStyles = [
|
||||
["Power Green"],
|
||||
["Power Red and Blue"],
|
||||
["Power Red and Green"],
|
||||
["Power Clear"]
|
||||
]
|
||||
|
||||
76
Data/Scripts/002_Battle settings.rb
Normal file
76
Data/Scripts/002_Battle settings.rb
Normal file
@@ -0,0 +1,76 @@
|
||||
# Whether a move's physical/special category depends on the move itself as in
|
||||
# newer Gens (true), or on its type as in older Gens (false).
|
||||
MOVE_CATEGORY_PER_MOVE = (MECHANICS_GENERATION >= 4)
|
||||
# Whether turn order is recalculated after a Pokémon Mega Evolves.
|
||||
RECALCULATE_TURN_ORDER_AFTER_MEGA_EVOLUTION = (MECHANICS_GENERATION >= 7)
|
||||
# Whether turn order is recalculated after a Pokémon's Speed stat changes.
|
||||
RECALCULATE_TURN_ORDER_AFTER_SPEED_CHANGES = (MECHANICS_GENERATION >= 8)
|
||||
# Whether critical hits do 1.5x damage and have 4 stages (true), or they do 2x
|
||||
# damage and have 5 stages as in Gen 5 (false). Also determines whether critical
|
||||
# hit rate can be copied by Transform/Psych Up.
|
||||
NEW_CRITICAL_HIT_RATE_MECHANICS = (MECHANICS_GENERATION >= 6)
|
||||
# Whether several effects apply relating to a Pokémon's type:
|
||||
# * Electric-type immunity to paralysis
|
||||
# * Ghost-type immunity to being trapped
|
||||
# * Grass-type immunity to powder moves and Effect Spore
|
||||
# * Poison-type Pokémon can't miss when using Toxic
|
||||
MORE_TYPE_EFFECTS = (MECHANICS_GENERATION >= 6)
|
||||
# Whether weather caused by an ability lasts 5 rounds (true) or forever (false).
|
||||
FIXED_DURATION_WEATHER_FROM_ABILITY = (MECHANICS_GENERATION >= 6)
|
||||
|
||||
#===============================================================================
|
||||
|
||||
# Whether X items (X Attack, etc.) raise their stat by 2 stages (true) or 1
|
||||
# (false).
|
||||
X_STAT_ITEMS_RAISE_BY_TWO_STAGES = (MECHANICS_GENERATION >= 7)
|
||||
# Whether some Poké Balls have catch rate multipliers from Gen 7 (true) or from
|
||||
# earlier generations (false).
|
||||
NEW_POKE_BALL_CATCH_RATES = (MECHANICS_GENERATION >= 7)
|
||||
# Whether Soul Dew powers up Psychic and Dragon-type moves by 20% (true) or
|
||||
# raises the holder's Special Attack and Special Defense by 50% (false).
|
||||
SOUL_DEW_POWERS_UP_TYPES = (MECHANICS_GENERATION >= 7)
|
||||
|
||||
#===============================================================================
|
||||
|
||||
# The minimum number of badges required to boost each stat of a player's
|
||||
# Pokémon by 1.1x, in battle only.
|
||||
NUM_BADGES_BOOST_ATTACK = (MECHANICS_GENERATION >= 4) ? 999 : 1
|
||||
NUM_BADGES_BOOST_DEFENSE = (MECHANICS_GENERATION >= 4) ? 999 : 5
|
||||
NUM_BADGES_BOOST_SPATK = (MECHANICS_GENERATION >= 4) ? 999 : 7
|
||||
NUM_BADGES_BOOST_SPDEF = (MECHANICS_GENERATION >= 4) ? 999 : 7
|
||||
NUM_BADGES_BOOST_SPEED = (MECHANICS_GENERATION >= 4) ? 999 : 3
|
||||
|
||||
#===============================================================================
|
||||
|
||||
# An array of items which act as Mega Rings for the player (NPCs don't need a
|
||||
# Mega Ring item, just a Mega Stone held by their Pokémon).
|
||||
MEGA_RINGS = [:MEGARING, :MEGABRACELET, :MEGACUFF, :MEGACHARM]
|
||||
# The Game Switch which, while ON, prevents all Pokémon in battle from Mega
|
||||
# Evolving even if they otherwise could.
|
||||
NO_MEGA_EVOLUTION = 34
|
||||
|
||||
#===============================================================================
|
||||
|
||||
# Whether the Exp gained from beating a Pokémon should be scaled depending on
|
||||
# the gainer's level.
|
||||
SCALED_EXP_FORMULA = (MECHANICS_GENERATION >= 5 && MECHANICS_GENERATION != 6)
|
||||
# Whether the Exp gained from beating a Pokémon should be divided equally
|
||||
# between each participant (true), or whether each participant should gain that
|
||||
# much Exp (false). This also applies to Exp gained via the Exp Share (held item
|
||||
# version) being distributed to all Exp Share holders.
|
||||
SPLIT_EXP_BETWEEN_GAINERS = (MECHANICS_GENERATION <= 5)
|
||||
# Whether the critical capture mechanic applies. Note that it is based on a
|
||||
# total of 600+ species (i.e. that many species need to be caught to provide the
|
||||
# greatest critical capture chance of 2.5x), and there may be fewer species in
|
||||
# your game.
|
||||
ENABLE_CRITICAL_CAPTURES = (MECHANICS_GENERATION >= 5)
|
||||
# Whether Pokémon gain Exp for capturing a Pokémon.
|
||||
GAIN_EXP_FOR_CAPTURE = (MECHANICS_GENERATION >= 6)
|
||||
# The Game Switch which determines whether the player will lose money if they
|
||||
# lose a battle (they can still gain money from trainers for winning).
|
||||
NO_MONEY_LOSS = 33
|
||||
# Whether party Pokémon check whether they can evolve after all battles
|
||||
# regardless of the outcome (true) or only after battles the player won (false).
|
||||
CHECK_EVOLUTION_AFTER_ALL_BATTLES = (MECHANICS_GENERATION >= 6)
|
||||
# Whether fainted Pokémon can try to evolve after a battle.
|
||||
CHECK_EVOLUTION_FOR_FAINTED_POKEMON = (MECHANICS_GENERATION >= 6)
|
||||
@@ -1,19 +1,15 @@
|
||||
module MessageConfig
|
||||
FontName = "Power Green"
|
||||
# in Graphics/Windowskins/ (specify empty string to use the default windowskin)
|
||||
TextSkinName = "speech hgss 1"
|
||||
ChoiceSkinName = "choice 1"
|
||||
WindowOpacity = 255
|
||||
TextSpeed = nil # can be positive to wait frames or negative to
|
||||
# show multiple characters in a single frame
|
||||
LIGHTTEXTBASE = Color.new(248,248,248)
|
||||
LIGHTTEXTSHADOW = Color.new(72,80,88)
|
||||
DARKTEXTBASE = Color.new(80,80,88)
|
||||
DARKTEXTSHADOW = Color.new(160,160,168)
|
||||
# 0 = Pause cursor is displayed at end of text
|
||||
# 1 = Pause cursor is displayed at bottom right
|
||||
# 2 = Pause cursor is displayed at lower middle side
|
||||
CURSORMODE = 1
|
||||
LIGHTTEXTBASE = Color.new(248,248,248)
|
||||
LIGHTTEXTSHADOW = Color.new(72,80,88)
|
||||
DARKTEXTBASE = Color.new(80,80,88)
|
||||
DARKTEXTSHADOW = Color.new(160,160,168)
|
||||
FontSubstitutes = {
|
||||
"Power Red and Blue" => "Pokemon RS",
|
||||
"Power Red and Green" => "Pokemon FireLeaf",
|
||||
@@ -44,21 +40,40 @@ module MessageConfig
|
||||
end
|
||||
|
||||
def self.pbDefaultSystemFrame
|
||||
return "" if !MessageConfig::ChoiceSkinName
|
||||
return pbResolveBitmap("Graphics/Windowskins/"+MessageConfig::ChoiceSkinName) || ""
|
||||
begin
|
||||
return pbResolveBitmap("Graphics/Windowskins/" + $TextFrames[$PokemonSystem.frame]) || ""
|
||||
rescue
|
||||
return pbResolveBitmap("Graphics/Windowskins/" + $TextFrames[0]) || ""
|
||||
end
|
||||
end
|
||||
|
||||
def self.pbDefaultSpeechFrame
|
||||
return "" if !MessageConfig::TextSkinName
|
||||
return pbResolveBitmap("Graphics/Windowskins/"+MessageConfig::TextSkinName) || ""
|
||||
begin
|
||||
return pbResolveBitmap("Graphics/Windowskins/" + $SpeechFrames[$PokemonSystem.textskin]) || ""
|
||||
rescue
|
||||
return pbResolveBitmap("Graphics/Windowskins/" + $SpeechFrames[0]) || ""
|
||||
end
|
||||
end
|
||||
|
||||
def self.pbDefaultSystemFontName
|
||||
return MessageConfig.pbTryFonts(MessageConfig::FontName,"Arial Narrow","Arial")
|
||||
begin
|
||||
return MessageConfig.pbTryFonts($VersionStyles[$PokemonSystem.font][0], "Arial Narrow", "Arial")
|
||||
rescue
|
||||
return MessageConfig.pbTryFonts($VersionStyles[0], "Arial Narrow", "Arial")
|
||||
end
|
||||
end
|
||||
|
||||
def self.pbDefaultTextSpeed
|
||||
return (TextSpeed) ? TextSpeed : (Graphics.width>400) ? -2 : 1
|
||||
return pbSettingToTextSpeed(($PokemonSystem.textspeed rescue nil))
|
||||
end
|
||||
|
||||
def self.pbSettingToTextSpeed(speed)
|
||||
case speed
|
||||
when 0 then return 2
|
||||
when 1 then return 1
|
||||
when 2 then return -2
|
||||
end
|
||||
return TextSpeed || 1
|
||||
end
|
||||
|
||||
def self.pbDefaultWindowskin
|
||||
|
||||
@@ -92,7 +92,8 @@ module GameData
|
||||
|
||||
def is_TM?; return @field_use == 3; end
|
||||
def is_HM?; return @field_use == 4; end
|
||||
def is_machine?; return is_TM? || is_HM?; end
|
||||
def is_TR?; return @field_use == 6; end
|
||||
def is_machine?; return is_TM? || is_HM? || is_TR?; end
|
||||
def is_mail?; return @type == 1 || @type == 2; end
|
||||
def is_icon_mail?; return @type == 2; end
|
||||
def is_poke_ball?; return @type == 3 || @type == 4; end
|
||||
@@ -107,8 +108,7 @@ module GameData
|
||||
def is_mega_stone?; return @type == 12; end # Does NOT include Red Orb/Blue Orb
|
||||
|
||||
def is_important?
|
||||
return true if is_key_item? || is_HM?
|
||||
return true if is_TM? && INFINITE_TMS
|
||||
return true if is_key_item? || is_HM? || is_TM?
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
@@ -255,7 +255,7 @@ class PokeBattle_Battler
|
||||
speedMult /= 2 if pbOwnSide.effects[PBEffects::Swamp]>0
|
||||
# Paralysis
|
||||
if status==PBStatuses::PARALYSIS && !hasActiveAbility?(:QUICKFEET)
|
||||
speedMult /= (NEWEST_BATTLE_MECHANICS) ? 2 : 4
|
||||
speedMult /= (MECHANICS_GENERATION >= 7) ? 2 : 4
|
||||
end
|
||||
# Badge multiplier
|
||||
if @battle.internalBattle && pbOwnedByPlayer? &&
|
||||
@@ -524,28 +524,29 @@ class PokeBattle_Battler
|
||||
|
||||
def affectedByPowder?(showMsg=false)
|
||||
return false if fainted?
|
||||
return true if !NEWEST_BATTLE_MECHANICS
|
||||
if pbHasType?(:GRASS)
|
||||
if pbHasType?(:GRASS) && MORE_TYPE_EFFECTS
|
||||
@battle.pbDisplay(_INTL("{1} is unaffected!",pbThis)) if showMsg
|
||||
return false
|
||||
end
|
||||
if hasActiveAbility?(:OVERCOAT) && !@battle.moldBreaker
|
||||
if showMsg
|
||||
@battle.pbShowAbilitySplash(self)
|
||||
if PokeBattle_SceneConstants::USE_ABILITY_SPLASH
|
||||
@battle.pbDisplay(_INTL("{1} is unaffected!",pbThis))
|
||||
else
|
||||
@battle.pbDisplay(_INTL("{1} is unaffected because of its {2}!",pbThis,abilityName))
|
||||
if MECHANICS_GENERATION >= 6
|
||||
if hasActiveAbility?(:OVERCOAT) && !@battle.moldBreaker
|
||||
if showMsg
|
||||
@battle.pbShowAbilitySplash(self)
|
||||
if PokeBattle_SceneConstants::USE_ABILITY_SPLASH
|
||||
@battle.pbDisplay(_INTL("{1} is unaffected!",pbThis))
|
||||
else
|
||||
@battle.pbDisplay(_INTL("{1} is unaffected because of its {2}!",pbThis,abilityName))
|
||||
end
|
||||
@battle.pbHideAbilitySplash(self)
|
||||
end
|
||||
@battle.pbHideAbilitySplash(self)
|
||||
return false
|
||||
end
|
||||
return false
|
||||
end
|
||||
if hasActiveItem?(:SAFETYGOGGLES)
|
||||
if showMsg
|
||||
@battle.pbDisplay(_INTL("{1} is unaffected because of its {2}!",pbThis,itemName))
|
||||
if hasActiveItem?(:SAFETYGOGGLES)
|
||||
if showMsg
|
||||
@battle.pbDisplay(_INTL("{1} is unaffected because of its {2}!",pbThis,itemName))
|
||||
end
|
||||
return false
|
||||
end
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
@@ -137,7 +137,7 @@ class PokeBattle_Battler
|
||||
self.form = newForm
|
||||
pbUpdate(true)
|
||||
@hp = @totalhp-oldDmg
|
||||
@effects[PBEffects::WeightChange] = 0 if NEWEST_BATTLE_MECHANICS
|
||||
@effects[PBEffects::WeightChange] = 0 if MECHANICS_GENERATION >= 6
|
||||
@battle.scene.pbChangePokemon(self,@pokemon)
|
||||
@battle.scene.pbRefreshOne(@index)
|
||||
@battle.pbDisplay(msg) if msg && msg!=""
|
||||
@@ -275,7 +275,7 @@ class PokeBattle_Battler
|
||||
@spdef = target.spdef
|
||||
@speed = target.speed
|
||||
PBStats.eachBattleStat { |s| @stages[s] = target.stages[s] }
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
if NEW_CRITICAL_HIT_RATE_MECHANICS
|
||||
@effects[PBEffects::FocusEnergy] = target.effects[PBEffects::FocusEnergy]
|
||||
@effects[PBEffects::LaserFocus] = target.effects[PBEffects::LaserFocus]
|
||||
end
|
||||
|
||||
@@ -93,7 +93,7 @@ class PokeBattle_Battler
|
||||
when PBStatuses::BURN
|
||||
hasImmuneType |= pbHasType?(:FIRE)
|
||||
when PBStatuses::PARALYSIS
|
||||
hasImmuneType |= pbHasType?(:ELECTRIC) && NEWEST_BATTLE_MECHANICS
|
||||
hasImmuneType |= pbHasType?(:ELECTRIC) && MORE_TYPE_EFFECTS
|
||||
when PBStatuses::FROZEN
|
||||
hasImmuneType |= pbHasType?(:ICE)
|
||||
end
|
||||
@@ -189,7 +189,7 @@ class PokeBattle_Battler
|
||||
when PBStatuses::BURN
|
||||
hasImmuneType |= pbHasType?(:FIRE)
|
||||
when PBStatuses::PARALYSIS
|
||||
hasImmuneType |= pbHasType?(:ELECTRIC) && NEWEST_BATTLE_MECHANICS
|
||||
hasImmuneType |= pbHasType?(:ELECTRIC) && MORE_TYPE_EFFECTS
|
||||
end
|
||||
return false if hasImmuneType
|
||||
# Ability immunity
|
||||
|
||||
@@ -124,12 +124,10 @@ class PokeBattle_Battler
|
||||
#=============================================================================
|
||||
# Held item consuming/removing
|
||||
#=============================================================================
|
||||
def pbCanConsumeBerry?(_item,alwaysCheckGluttony=true)
|
||||
return false if @battle.pbCheckOpposingAbility(:UNNERVE,@index)
|
||||
return true if @hp<=@totalhp/4
|
||||
if alwaysCheckGluttony || NEWEST_BATTLE_MECHANICS
|
||||
return true if @hp<=@totalhp/2 && hasActiveAbility?(:GLUTTONY)
|
||||
end
|
||||
def pbCanConsumeBerry?(_item, check_gluttony = true)
|
||||
return false if @battle.pbCheckOpposingAbility(:UNNERVE, @index)
|
||||
return true if @hp <= @totalhp / 4
|
||||
return true if @hp <= @totalhp / 2 && (!check_gluttony || hasActiveAbility?(:GLUTTONY))
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ class PokeBattle_Battler
|
||||
}
|
||||
@battle.pbJudge
|
||||
# Update priority order
|
||||
# @battle.pbCalculatePriority if NEWEST_BATTLE_MECHANICS
|
||||
@battle.pbCalculatePriority if RECALCULATE_TURN_ORDER_AFTER_SPEED_CHANGES
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
@@ -253,7 +253,7 @@ class PokeBattle_Battler
|
||||
else
|
||||
@battle.pbCommonAnimation("Confusion",self)
|
||||
@battle.pbDisplay(_INTL("{1} is confused!",pbThis))
|
||||
threshold = (NEWEST_BATTLE_MECHANICS) ? 33 : 50 # % chance
|
||||
threshold = (MECHANICS_GENERATION >= 7) ? 33 : 50 # % chance
|
||||
if @battle.pbRandom(100)<threshold
|
||||
pbConfusionDamage(_INTL("It hurt itself in its confusion!"))
|
||||
@lastMoveFailed = true
|
||||
@@ -313,7 +313,7 @@ class PokeBattle_Battler
|
||||
# Wide Guard
|
||||
if target.pbOwnSide.effects[PBEffects::WideGuard] && user.index!=target.index &&
|
||||
PBTargets.multipleTargets?(move.pbTarget(user)) &&
|
||||
(NEWEST_BATTLE_MECHANICS || move.damagingMove?)
|
||||
(MECHANICS_GENERATION >= 7 || move.damagingMove?)
|
||||
@battle.pbCommonAnimation("WideGuard",target)
|
||||
@battle.pbDisplay(_INTL("Wide Guard protected {1}!",target.pbThis(true)))
|
||||
target.damageState.protected = true
|
||||
@@ -408,7 +408,7 @@ class PokeBattle_Battler
|
||||
return false
|
||||
end
|
||||
# Dark-type immunity to moves made faster by Prankster
|
||||
if NEWEST_BATTLE_MECHANICS && user.effects[PBEffects::Prankster] &&
|
||||
if MECHANICS_GENERATION >= 7 && user.effects[PBEffects::Prankster] &&
|
||||
target.pbHasType?(:DARK) && target.opposes?(user)
|
||||
PBDebug.log("[Target immune] #{target.pbThis} is Dark-type and immune to Prankster-boosted moves")
|
||||
@battle.pbDisplay(_INTL("It doesn't affect {1}...",target.pbThis(true)))
|
||||
@@ -441,26 +441,28 @@ class PokeBattle_Battler
|
||||
end
|
||||
end
|
||||
# Immunity to powder-based moves
|
||||
if NEWEST_BATTLE_MECHANICS && move.powderMove?
|
||||
if target.pbHasType?(:GRASS)
|
||||
if move.powderMove?
|
||||
if target.pbHasType?(:GRASS) && MORE_TYPE_EFFECTS
|
||||
PBDebug.log("[Target immune] #{target.pbThis} is Grass-type and immune to powder-based moves")
|
||||
@battle.pbDisplay(_INTL("It doesn't affect {1}...",target.pbThis(true)))
|
||||
return false
|
||||
end
|
||||
if target.hasActiveAbility?(:OVERCOAT) && !@battle.moldBreaker
|
||||
@battle.pbShowAbilitySplash(target)
|
||||
if PokeBattle_SceneConstants::USE_ABILITY_SPLASH
|
||||
@battle.pbDisplay(_INTL("It doesn't affect {1}...",target.pbThis(true)))
|
||||
else
|
||||
@battle.pbDisplay(_INTL("It doesn't affect {1} because of its {2}.",target.pbThis(true),target.abilityName))
|
||||
if MECHANICS_GENERATION >= 6
|
||||
if target.hasActiveAbility?(:OVERCOAT) && !@battle.moldBreaker
|
||||
@battle.pbShowAbilitySplash(target)
|
||||
if PokeBattle_SceneConstants::USE_ABILITY_SPLASH
|
||||
@battle.pbDisplay(_INTL("It doesn't affect {1}...",target.pbThis(true)))
|
||||
else
|
||||
@battle.pbDisplay(_INTL("It doesn't affect {1} because of its {2}.",target.pbThis(true),target.abilityName))
|
||||
end
|
||||
@battle.pbHideAbilitySplash(target)
|
||||
return false
|
||||
end
|
||||
if target.hasActiveItem?(:SAFETYGOGGLES)
|
||||
PBDebug.log("[Item triggered] #{target.pbThis} has Safety Goggles and is immune to powder-based moves")
|
||||
@battle.pbDisplay(_INTL("It doesn't affect {1}...",target.pbThis(true)))
|
||||
return false
|
||||
end
|
||||
@battle.pbHideAbilitySplash(target)
|
||||
return false
|
||||
end
|
||||
if target.hasActiveItem?(:SAFETYGOGGLES)
|
||||
PBDebug.log("[Item triggered] #{target.pbThis} has Safety Goggles and is immune to powder-based moves")
|
||||
@battle.pbDisplay(_INTL("It doesn't affect {1}...",target.pbThis(true)))
|
||||
return false
|
||||
end
|
||||
end
|
||||
# Substitute
|
||||
|
||||
@@ -72,7 +72,7 @@ class PokeBattle_Battler
|
||||
next if b.status!=PBStatuses::FROZEN
|
||||
# NOTE: Non-Fire-type moves that thaw the user will also thaw the
|
||||
# target (in Gen 6+).
|
||||
if move.calcType == :FIRE || (NEWEST_BATTLE_MECHANICS && move.thawsUser?)
|
||||
if move.calcType == :FIRE || (MECHANICS_GENERATION >= 6 && move.thawsUser?)
|
||||
b.pbCureStatus
|
||||
end
|
||||
end
|
||||
|
||||
@@ -132,7 +132,7 @@ class PokeBattle_Move
|
||||
def nonLethal?(_user,_target); return false; end # For False Swipe
|
||||
|
||||
def ignoresSubstitute?(user) # user is the Pokémon using this move
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
if MECHANICS_GENERATION >= 6
|
||||
return true if soundMove?
|
||||
return true if user && user.hasActiveAbility?(:INFILTRATOR)
|
||||
end
|
||||
|
||||
@@ -160,7 +160,7 @@ class PokeBattle_Move
|
||||
def pbIsCritical?(user,target)
|
||||
return false if target.pbOwnSide.effects[PBEffects::LuckyChant]>0
|
||||
# Set up the critical hit ratios
|
||||
ratios = (NEWEST_BATTLE_MECHANICS) ? [24,8,2,1] : [16,8,4,3,2]
|
||||
ratios = (NEW_CRITICAL_HIT_RATE_MECHANICS) ? [24,8,2,1] : [16,8,4,3,2]
|
||||
c = 0
|
||||
# Ability effects that alter critical hit rate
|
||||
if c>=0 && user.abilityActive?
|
||||
@@ -390,7 +390,7 @@ class PokeBattle_Move
|
||||
end
|
||||
# Critical hits
|
||||
if target.damageState.critical
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
if NEW_CRITICAL_HIT_RATE_MECHANICS
|
||||
multipliers[FINAL_DMG_MULT] *= 1.5
|
||||
else
|
||||
multipliers[FINAL_DMG_MULT] *= 2
|
||||
@@ -455,7 +455,7 @@ class PokeBattle_Move
|
||||
def pbAdditionalEffectChance(user,target,effectChance=0)
|
||||
return 0 if target.hasActiveAbility?(:SHIELDDUST) && !@battle.moldBreaker
|
||||
ret = (effectChance>0) ? effectChance : @addlEffect
|
||||
if NEWEST_BATTLE_MECHANICS || @function!="0A4" # Secret Power
|
||||
if MECHANICS_GENERATION >= 6 || @function != "0A4" # Secret Power
|
||||
ret *= 2 if user.hasActiveAbility?(:SERENEGRACE) ||
|
||||
user.pbOwnSide.effects[PBEffects::Rainbow]>0
|
||||
end
|
||||
|
||||
@@ -555,7 +555,7 @@ class PokeBattle_ProtectMove < PokeBattle_Move
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
if !(@sidedEffect && NEWEST_BATTLE_MECHANICS) &&
|
||||
if (!@sidedEffect || MECHANICS_GENERATION <= 5) &&
|
||||
user.effects[PBEffects::ProtectRate]>1 &&
|
||||
@battle.pbRandom(user.effects[PBEffects::ProtectRate])!=0
|
||||
user.effects[PBEffects::ProtectRate] = 1
|
||||
@@ -575,7 +575,7 @@ class PokeBattle_ProtectMove < PokeBattle_Move
|
||||
else
|
||||
user.effects[@effect] = true
|
||||
end
|
||||
user.effects[PBEffects::ProtectRate] *= (NEWEST_BATTLE_MECHANICS) ? 3 : 2
|
||||
user.effects[PBEffects::ProtectRate] *= (MECHANICS_GENERATION >= 6) ? 3 : 2
|
||||
pbProtectMessage(user)
|
||||
end
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_003 < PokeBattle_SleepMove
|
||||
def pbMoveFailed?(user,targets)
|
||||
if NEWEST_BATTLE_MECHANICS && @id == :DARKVOID
|
||||
if MECHANICS_GENERATION >= 7 && @id == :DARKVOID
|
||||
if !user.isSpecies?(:DARKRAI) && user.effects[PBEffects::TransformSpecies] != :DARKRAI
|
||||
@battle.pbDisplay(_INTL("But {1} can't use the move!",user.pbThis))
|
||||
return true
|
||||
@@ -93,7 +93,7 @@ class PokeBattle_Move_006 < PokeBattle_PoisonMove
|
||||
end
|
||||
|
||||
def pbOverrideSuccessCheckPerHit(user,target)
|
||||
return (NEWEST_BATTLE_MECHANICS && statusMove? && user.pbHasType?(:POISON))
|
||||
return (MORE_TYPE_EFFECTS && statusMove? && user.pbHasType?(:POISON))
|
||||
end
|
||||
end
|
||||
|
||||
@@ -107,7 +107,7 @@ end
|
||||
class PokeBattle_Move_007 < PokeBattle_ParalysisMove
|
||||
def tramplesMinimize?(param=1)
|
||||
# Perfect accuracy and double damage (for Body Slam only)
|
||||
return NEWEST_BATTLE_MECHANICS if @id == :BODYSLAM
|
||||
return MECHANICS_GENERATION >= 6 if @id == :BODYSLAM
|
||||
return super
|
||||
end
|
||||
|
||||
@@ -241,8 +241,8 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_010 < PokeBattle_FlinchMove
|
||||
def tramplesMinimize?(param=1)
|
||||
return super if @id == :DRAGONRUSH && !NEWEST_BATTLE_MECHANICS
|
||||
return true if param==1 && NEWEST_BATTLE_MECHANICS # Perfect accuracy
|
||||
return super if @id == :DRAGONRUSH && MECHANICS_GENERATION <= 5
|
||||
return true if param==1 && MECHANICS_GENERATION >= 6 # Perfect accuracy
|
||||
return true if param==2 # Double damage
|
||||
return super
|
||||
end
|
||||
@@ -305,7 +305,7 @@ class PokeBattle_Move_014 < PokeBattle_ConfuseMove
|
||||
end
|
||||
|
||||
def addlEffect
|
||||
return @chatterChance if !NEWEST_BATTLE_MECHANICS
|
||||
return @chatterChance if MECHANICS_GENERATION <= 5
|
||||
return super
|
||||
end
|
||||
end
|
||||
@@ -1267,7 +1267,7 @@ end
|
||||
class PokeBattle_Move_048 < PokeBattle_TargetStatDownMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
@statDown = [PBStats::EVASION,(NEWEST_BATTLE_MECHANICS) ? 2 : 1]
|
||||
@statDown = [PBStats::EVASION,(MECHANICS_GENERATION >= 6) ? 2 : 1]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1297,11 +1297,13 @@ class PokeBattle_Move_049 < PokeBattle_TargetStatDownMove
|
||||
targetSide.effects[PBEffects::Spikes]>0 ||
|
||||
targetSide.effects[PBEffects::ToxicSpikes]>0 ||
|
||||
targetSide.effects[PBEffects::StickyWeb]
|
||||
return false if NEWEST_BATTLE_MECHANICS &&
|
||||
return false if MECHANICS_GENERATION >= 6 &&
|
||||
(targetOpposingSide.effects[PBEffects::StealthRock] ||
|
||||
targetOpposingSide.effects[PBEffects::Spikes]>0 ||
|
||||
targetOpposingSide.effects[PBEffects::ToxicSpikes]>0 ||
|
||||
targetOpposingSide.effects[PBEffects::StickyWeb])
|
||||
return false if MECHANICS_GENERATION >= 8 &&
|
||||
@battle.field.terrain != PBBattleTerrains::None
|
||||
return super
|
||||
end
|
||||
|
||||
@@ -1330,33 +1332,46 @@ class PokeBattle_Move_049 < PokeBattle_TargetStatDownMove
|
||||
@battle.pbDisplay(_INTL("{1} is no longer protected by Safeguard!!",target.pbTeam))
|
||||
end
|
||||
if target.pbOwnSide.effects[PBEffects::StealthRock] ||
|
||||
(NEWEST_BATTLE_MECHANICS &&
|
||||
(MECHANICS_GENERATION >= 6 &&
|
||||
target.pbOpposingSide.effects[PBEffects::StealthRock])
|
||||
target.pbOwnSide.effects[PBEffects::StealthRock] = false
|
||||
target.pbOpposingSide.effects[PBEffects::StealthRock] = false if NEWEST_BATTLE_MECHANICS
|
||||
target.pbOpposingSide.effects[PBEffects::StealthRock] = false if MECHANICS_GENERATION >= 6
|
||||
@battle.pbDisplay(_INTL("{1} blew away stealth rocks!",user.pbThis))
|
||||
end
|
||||
if target.pbOwnSide.effects[PBEffects::Spikes]>0 ||
|
||||
(NEWEST_BATTLE_MECHANICS &&
|
||||
(MECHANICS_GENERATION >= 6 &&
|
||||
target.pbOpposingSide.effects[PBEffects::Spikes]>0)
|
||||
target.pbOwnSide.effects[PBEffects::Spikes] = 0
|
||||
target.pbOpposingSide.effects[PBEffects::Spikes] = 0 if NEWEST_BATTLE_MECHANICS
|
||||
target.pbOpposingSide.effects[PBEffects::Spikes] = 0 if MECHANICS_GENERATION >= 6
|
||||
@battle.pbDisplay(_INTL("{1} blew away spikes!",user.pbThis))
|
||||
end
|
||||
if target.pbOwnSide.effects[PBEffects::ToxicSpikes]>0 ||
|
||||
(NEWEST_BATTLE_MECHANICS &&
|
||||
(MECHANICS_GENERATION >= 6 &&
|
||||
target.pbOpposingSide.effects[PBEffects::ToxicSpikes]>0)
|
||||
target.pbOwnSide.effects[PBEffects::ToxicSpikes] = 0
|
||||
target.pbOpposingSide.effects[PBEffects::ToxicSpikes] = 0 if NEWEST_BATTLE_MECHANICS
|
||||
target.pbOpposingSide.effects[PBEffects::ToxicSpikes] = 0 if MECHANICS_GENERATION >= 6
|
||||
@battle.pbDisplay(_INTL("{1} blew away poison spikes!",user.pbThis))
|
||||
end
|
||||
if target.pbOwnSide.effects[PBEffects::StickyWeb] ||
|
||||
(NEWEST_BATTLE_MECHANICS &&
|
||||
(MECHANICS_GENERATION >= 6 &&
|
||||
target.pbOpposingSide.effects[PBEffects::StickyWeb])
|
||||
target.pbOwnSide.effects[PBEffects::StickyWeb] = false
|
||||
target.pbOpposingSide.effects[PBEffects::StickyWeb] = false if NEWEST_BATTLE_MECHANICS
|
||||
target.pbOpposingSide.effects[PBEffects::StickyWeb] = false if MECHANICS_GENERATION >= 6
|
||||
@battle.pbDisplay(_INTL("{1} blew away sticky webs!",user.pbThis))
|
||||
end
|
||||
if MECHANICS_GENERATION >= 8 && @battle.field.terrain != PBBattleTerrains::None
|
||||
case @battle.field.terrain
|
||||
when PBBattleTerrains::Electric
|
||||
@battle.pbDisplay(_INTL("The electricity disappeared from the battlefield."))
|
||||
when PBBattleTerrains::Grassy
|
||||
@battle.pbDisplay(_INTL("The grass disappeared from the battlefield."))
|
||||
when PBBattleTerrains::Misty
|
||||
@battle.pbDisplay(_INTL("The mist disappeared from the battlefield."))
|
||||
when PBBattleTerrains::Psychic
|
||||
@battle.pbDisplay(_INTL("The weirdness disappeared from the battlefield."))
|
||||
end
|
||||
@battle.field.terrain = PBBattleTerrains::None
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1405,7 +1420,7 @@ class PokeBattle_Move_04D < PokeBattle_TargetStatDownMove
|
||||
def initialize(battle,move)
|
||||
super
|
||||
inc = 2
|
||||
inc = 1 if @id == :STRINGSHOT && !NEWEST_BATTLE_MECHANICS
|
||||
inc = 1 if @id == :STRINGSHOT && MECHANICS_GENERATION <= 5
|
||||
@statDown = [PBStats::SPEED,inc]
|
||||
end
|
||||
end
|
||||
@@ -1559,7 +1574,7 @@ class PokeBattle_Move_055 < PokeBattle_Move
|
||||
|
||||
def pbEffectAgainstTarget(user,target)
|
||||
PBStats.eachBattleStat { |s| user.stages[s] = target.stages[s] }
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
if NEW_CRITICAL_HIT_RATE_MECHANICS
|
||||
user.effects[PBEffects::FocusEnergy] = target.effects[PBEffects::FocusEnergy]
|
||||
user.effects[PBEffects::LaserFocus] = target.effects[PBEffects::LaserFocus]
|
||||
end
|
||||
@@ -1794,7 +1809,7 @@ class PokeBattle_Move_05E < PokeBattle_Move
|
||||
userTypes = user.pbTypes(true)
|
||||
@newTypes = []
|
||||
user.eachMoveWithIndex do |m,i|
|
||||
break if NEWEST_BATTLE_MECHANICS && i>0
|
||||
break if MECHANICS_GENERATION >= 6 && i>0
|
||||
next if PBTypes.isPseudoType?(m.type)
|
||||
next if userTypes.include?(m.type)
|
||||
@newTypes.push(m.type) if !@newTypes.include?(m.type)
|
||||
@@ -2167,7 +2182,7 @@ class PokeBattle_Move_067 < PokeBattle_Move
|
||||
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
if !target.ability ||
|
||||
(user.ability==target.ability && !NEWEST_BATTLE_MECHANICS)
|
||||
(user.ability == target.ability && MECHANICS_GENERATION <= 5)
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
@@ -2369,7 +2384,7 @@ class PokeBattle_Move_070 < PokeBattle_FixedDamageMove
|
||||
@battle.pbHideAbilitySplash(target)
|
||||
return true
|
||||
end
|
||||
if NEWEST_BATTLE_MECHANICS && @id == :SHEERCOLD && target.pbHasType?(:ICE)
|
||||
if MECHANICS_GENERATION >= 7 && @id == :SHEERCOLD && target.pbHasType?(:ICE)
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
@@ -2378,7 +2393,7 @@ class PokeBattle_Move_070 < PokeBattle_FixedDamageMove
|
||||
|
||||
def pbAccuracyCheck(user,target)
|
||||
acc = @accuracy+user.level-target.level
|
||||
acc -= 10 if NEWEST_BATTLE_MECHANICS && @id == :SHEERCOLD && !user.pbHasType?(:ICE)
|
||||
acc -= 10 if MECHANICS_GENERATION >= 7 && @id == :SHEERCOLD && !user.pbHasType?(:ICE)
|
||||
return @battle.pbRandom(100)<acc
|
||||
end
|
||||
|
||||
@@ -2697,7 +2712,7 @@ end
|
||||
# Burn's halving of Attack is negated (new mechanics).
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_07E < PokeBattle_Move
|
||||
def damageReducedByBurn?; return !NEWEST_BATTLE_MECHANICS; end
|
||||
def damageReducedByBurn?; return MECHANICS_GENERATION <= 5; end
|
||||
|
||||
def pbBaseDamage(baseDmg,user,target)
|
||||
baseDmg *= 2 if user.poisoned? || user.burned? || user.paralyzed?
|
||||
|
||||
@@ -248,7 +248,7 @@ class PokeBattle_Move_090 < PokeBattle_Move
|
||||
end
|
||||
|
||||
def pbBaseDamage(baseDmg,user,target)
|
||||
return super if NEWEST_BATTLE_MECHANICS
|
||||
return super if MECHANICS_GENERATION >= 6
|
||||
hp = pbHiddenPower(user)
|
||||
return hp[1]
|
||||
end
|
||||
@@ -272,7 +272,7 @@ def pbHiddenPower(pkmn)
|
||||
idxType |= (iv[PBStats::SPDEF]&1)<<5
|
||||
idxType = (types.length-1)*idxType/63
|
||||
type = types[idxType]
|
||||
if !NEWEST_BATTLE_MECHANICS
|
||||
if MECHANICS_GENERATION <= 5
|
||||
powerMin = 30
|
||||
powerMax = 70
|
||||
power |= (iv[PBStats::HP]&2)>>1
|
||||
@@ -503,7 +503,7 @@ class PokeBattle_Move_096 < PokeBattle_Move
|
||||
@damageArray.each do |dmg, items|
|
||||
next if !items.include?(heldItem)
|
||||
ret = dmg
|
||||
ret += 20 if NEWEST_BATTLE_MECHANICS
|
||||
ret += 20 if MECHANICS_GENERATION >= 6
|
||||
break
|
||||
end
|
||||
return ret
|
||||
@@ -600,7 +600,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_09B < PokeBattle_Move
|
||||
def tramplesMinimize?(param=1)
|
||||
return true if NEWEST_BATTLE_MECHANICS # Perfect accuracy and double damage
|
||||
return true if MECHANICS_GENERATION >= 7 # Perfect accuracy and double damage
|
||||
return super
|
||||
end
|
||||
|
||||
@@ -646,7 +646,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_09D < PokeBattle_Move
|
||||
def pbMoveFailed?(user,targets)
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
if MECHANICS_GENERATION >= 6
|
||||
if @battle.field.effects[PBEffects::MudSportField]>0
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
@@ -662,7 +662,7 @@ class PokeBattle_Move_09D < PokeBattle_Move
|
||||
end
|
||||
|
||||
def pbEffectGeneral(user)
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
if MECHANICS_GENERATION >= 6
|
||||
@battle.field.effects[PBEffects::MudSportField] = 5
|
||||
else
|
||||
user.effects[PBEffects::MudSport] = true
|
||||
@@ -678,7 +678,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_09E < PokeBattle_Move
|
||||
def pbMoveFailed?(user,targets)
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
if MECHANICS_GENERATION >= 6
|
||||
if @battle.field.effects[PBEffects::WaterSportField]>0
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
@@ -694,7 +694,7 @@ class PokeBattle_Move_09E < PokeBattle_Move
|
||||
end
|
||||
|
||||
def pbEffectGeneral(user)
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
if MECHANICS_GENERATION >= 6
|
||||
@battle.field.effects[PBEffects::WaterSportField] = 5
|
||||
else
|
||||
user.effects[PBEffects::WaterSport] = true
|
||||
@@ -1193,7 +1193,7 @@ class PokeBattle_Move_0AF < PokeBattle_Move
|
||||
"133", # Hold Hands
|
||||
"134" # Celebrate
|
||||
]
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
if MECHANICS_GENERATION >= 6
|
||||
@moveBlacklist += [
|
||||
# Target-switching moves
|
||||
"0EB", # Roar, Whirlwind
|
||||
@@ -1320,7 +1320,7 @@ class PokeBattle_Move_0B3 < PokeBattle_Move
|
||||
case @battle.environment
|
||||
when PBEnvironment::Grass, PBEnvironment::TallGrass,
|
||||
PBEnvironment::Forest, PBEnvironment::ForestGrass
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
if MECHANICS_GENERATION >= 6
|
||||
@npMove = :ENERGYBALL if GameData::Move.exists?(:ENERGYBALL)
|
||||
else
|
||||
@npMove = :SEEDBOMB if GameData::Move.exists?(:SEEDBOMB)
|
||||
@@ -1330,30 +1330,31 @@ class PokeBattle_Move_0B3 < PokeBattle_Move
|
||||
when PBEnvironment::Puddle
|
||||
@npMove = :MUDBOMB if GameData::Move.exists?(:MUDBOMB)
|
||||
when PBEnvironment::Cave
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
if MECHANICS_GENERATION >= 6
|
||||
@npMove = :POWERGEM if GameData::Move.exists?(:POWERGEM)
|
||||
else
|
||||
@npMove = :ROCKSLIDE if GameData::Move.exists?(:ROCKSLIDE)
|
||||
end
|
||||
when PBEnvironment::Rock
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
if MECHANICS_GENERATION >= 6
|
||||
@npMove = :EARTHPOWER if GameData::Move.exists?(:EARTHPOWER)
|
||||
else
|
||||
@npMove = :ROCKSLIDE if GameData::Move.exists?(:ROCKSLIDE)
|
||||
end
|
||||
when PBEnvironment::Sand
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
if MECHANICS_GENERATION >= 6
|
||||
@npMove = :EARTHPOWER if GameData::Move.exists?(:EARTHPOWER)
|
||||
else
|
||||
@npMove = :EARTHQUAKE if GameData::Move.exists?(:EARTHQUAKE)
|
||||
end
|
||||
# Ice tiles in Gen 6 should be Ice Beam
|
||||
when PBEnvironment::Snow, PBEnvironment::Ice
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
when PBEnvironment::Snow
|
||||
if MECHANICS_GENERATION >= 6
|
||||
@npMove = :FROSTBREATH if GameData::Move.exists?(:FROSTBREATH)
|
||||
else
|
||||
@npMove = :ICEBEAM if GameData::Move.exists?(:ICEBEAM)
|
||||
@npMove = :BLIZZARD if GameData::Move.exists?(:BLIZZARD)
|
||||
end
|
||||
when PBEnvironment::Ice
|
||||
@npMove = :ICEBEAM if GameData::Move.exists?(:ICEBEAM)
|
||||
when PBEnvironment::Volcano
|
||||
@npMove = :LAVAPLUME if GameData::Move.exists?(:LAVAPLUME)
|
||||
when PBEnvironment::Graveyard
|
||||
@@ -1513,7 +1514,7 @@ class PokeBattle_Move_0B5 < PokeBattle_Move
|
||||
"133", # Hold Hands
|
||||
"134" # Celebrate
|
||||
]
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
if MECHANICS_GENERATION >= 6
|
||||
@moveBlacklist += [
|
||||
# Moves that call other moves
|
||||
"0B3", # Nature Power
|
||||
@@ -1544,7 +1545,7 @@ class PokeBattle_Move_0B5 < PokeBattle_Move
|
||||
# NOTE: This includes the Pokémon of ally trainers in multi battles.
|
||||
@battle.pbParty(user.index).each_with_index do |pkmn,i|
|
||||
next if !pkmn || i==user.pokemonIndex
|
||||
next if NEWEST_BATTLE_MECHANICS && pkmn.egg?
|
||||
next if MECHANICS_GENERATION >= 6 && pkmn.egg?
|
||||
pkmn.moves.each do |move|
|
||||
next if @moveBlacklist.include?(move.function_code)
|
||||
next if move.type == :SHADOW
|
||||
@@ -1777,7 +1778,7 @@ class PokeBattle_Move_0BA < PokeBattle_Move
|
||||
return true
|
||||
end
|
||||
return true if pbMoveFailedAromaVeil?(user,target)
|
||||
if NEWEST_BATTLE_MECHANICS && target.hasActiveAbility?(:OBLIVIOUS) &&
|
||||
if MECHANICS_GENERATION >= 6 && target.hasActiveAbility?(:OBLIVIOUS) &&
|
||||
!@battle.moldBreaker
|
||||
@battle.pbShowAbilitySplash(target)
|
||||
if PokeBattle_SceneConstants::USE_ABILITY_SPLASH
|
||||
@@ -1842,7 +1843,7 @@ class PokeBattle_Move_0BC < PokeBattle_Move
|
||||
# Moves that call other moves (see also below)
|
||||
"0AE" # Mirror Move
|
||||
]
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
if MECHANICS_GENERATION >= 7
|
||||
@moveBlacklist += [
|
||||
# Moves that call other moves
|
||||
# "0AE", # Mirror Move # See above
|
||||
@@ -2235,7 +2236,7 @@ class PokeBattle_Move_0CE < PokeBattle_TwoTurnMove
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
if NEWEST_BATTLE_MECHANICS && target.pbWeight>=2000 # 200.0kg
|
||||
if MECHANICS_GENERATION >= 6 && target.pbWeight>=2000 # 200.0kg
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
@@ -2285,7 +2286,7 @@ class PokeBattle_Move_0CF < PokeBattle_Move
|
||||
return if target.effects[PBEffects::Trapping]>0
|
||||
# Set trapping effect duration and info
|
||||
if user.hasActiveItem?(:GRIPCLAW)
|
||||
target.effects[PBEffects::Trapping] = (NEWEST_BATTLE_MECHANICS) ? 8 : 6
|
||||
target.effects[PBEffects::Trapping] = (MECHANICS_GENERATION >= 5) ? 8 : 6
|
||||
else
|
||||
target.effects[PBEffects::Trapping] = 5+@battle.pbRandom(2)
|
||||
end
|
||||
@@ -2648,7 +2649,7 @@ end
|
||||
# User gains half the HP it inflicts as damage.
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_0DD < PokeBattle_Move
|
||||
def healingMove?; return NEWEST_BATTLE_MECHANICS; end
|
||||
def healingMove?; return MECHANICS_GENERATION >= 6; end
|
||||
|
||||
def pbEffectAgainstTarget(user,target)
|
||||
return if target.damageState.hpLost<=0
|
||||
@@ -2664,7 +2665,7 @@ end
|
||||
# (Dream Eater)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_0DE < PokeBattle_Move
|
||||
def healingMove?; return NEWEST_BATTLE_MECHANICS; end
|
||||
def healingMove?; return MECHANICS_GENERATION >= 6; end
|
||||
|
||||
def pbFailsAgainstTarget?(user,target)
|
||||
if !target.asleep?
|
||||
@@ -2899,7 +2900,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_0E7 < PokeBattle_Move
|
||||
def pbMoveFailed?(user,targets)
|
||||
if NEWEST_BATTLE_MECHANICS && user.effects[PBEffects::DestinyBondPrevious]
|
||||
if MECHANICS_GENERATION >= 7 && user.effects[PBEffects::DestinyBondPrevious]
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
@@ -3144,7 +3145,7 @@ class PokeBattle_Move_0EF < PokeBattle_Move
|
||||
@battle.pbDisplay(_INTL("But it failed!"))
|
||||
return true
|
||||
end
|
||||
if NEWEST_BATTLE_MECHANICS && target.pbHasType?(:GHOST)
|
||||
if MORE_TYPE_EFFECTS && target.pbHasType?(:GHOST)
|
||||
@battle.pbDisplay(_INTL("It doesn't affect {1}...",target.pbThis(true)))
|
||||
return true
|
||||
end
|
||||
@@ -3160,7 +3161,7 @@ class PokeBattle_Move_0EF < PokeBattle_Move
|
||||
def pbAdditionalEffect(user,target)
|
||||
return if target.fainted? || target.damageState.substitute
|
||||
return if target.effects[PBEffects::MeanLook]>=0
|
||||
return if NEWEST_BATTLE_MECHANICS && target.pbHasType?(:GHOST)
|
||||
return if MORE_TYPE_EFFECTS && target.pbHasType?(:GHOST)
|
||||
target.effects[PBEffects::MeanLook] = user.index
|
||||
@battle.pbDisplay(_INTL("{1} can no longer escape!",target.pbThis))
|
||||
end
|
||||
@@ -3174,7 +3175,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_0F0 < PokeBattle_Move
|
||||
def pbBaseDamage(baseDmg,user,target)
|
||||
if NEWEST_BATTLE_MECHANICS &&
|
||||
if MECHANICS_GENERATION >= 6 &&
|
||||
target.item && !target.unlosableItem?(target.item)
|
||||
# NOTE: Damage is still boosted even if target has Sticky Hold or a
|
||||
# substitute.
|
||||
@@ -3300,7 +3301,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_0F3 < PokeBattle_Move
|
||||
def ignoresSubstitute?(user)
|
||||
return true if NEWEST_BATTLE_MECHANICS
|
||||
return true if MECHANICS_GENERATION >= 6
|
||||
return super
|
||||
end
|
||||
|
||||
@@ -3364,7 +3365,7 @@ class PokeBattle_Move_0F5 < PokeBattle_Move
|
||||
def pbEffectWhenDealingDamage(user,target)
|
||||
return if target.damageState.substitute || target.damageState.berryWeakened
|
||||
return if !target.item || (!target.item.is_berry? &&
|
||||
!(NEWEST_BATTLE_MECHANICS && target.item.is_gem?))
|
||||
!(MECHANICS_GENERATION >= 6 && target.item.is_gem?))
|
||||
target.pbRemoveItem
|
||||
@battle.pbDisplay(_INTL("{1}'s {2} was incinerated!",target.pbThis,target.itemName))
|
||||
end
|
||||
|
||||
@@ -1445,7 +1445,7 @@ end
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_144 < PokeBattle_Move
|
||||
def tramplesMinimize?(param=1)
|
||||
return true if param==1 && NEWEST_BATTLE_MECHANICS # Perfect accuracy
|
||||
return true if param==1 && MECHANICS_GENERATION >= 6 # Perfect accuracy
|
||||
return true if param==2 # Double damage
|
||||
return super
|
||||
end
|
||||
@@ -1666,7 +1666,7 @@ end
|
||||
# User gains 3/4 the HP it inflicts as damage. (Draining Kiss, Oblivion Wing)
|
||||
#===============================================================================
|
||||
class PokeBattle_Move_14F < PokeBattle_Move
|
||||
def healingMove?; return NEWEST_BATTLE_MECHANICS; end
|
||||
def healingMove?; return MECHANICS_GENERATION >= 6; end
|
||||
|
||||
def pbEffectAgainstTarget(user,target)
|
||||
return if target.damageState.hpLost<=0
|
||||
|
||||
@@ -231,9 +231,6 @@ class PokeBattle_Battle
|
||||
end
|
||||
end
|
||||
|
||||
# NOTE: In Gen 8, battler speeds stored in priority are recalculated far more
|
||||
# frequently than they used to be. There are several quoted-out calls to
|
||||
# pbCalculatePriority in these scripts which do this; just unquote them.
|
||||
def pbPriority(onlySpeedSort=false)
|
||||
ret = []
|
||||
if onlySpeedSort
|
||||
|
||||
@@ -64,7 +64,7 @@ class PokeBattle_Battle
|
||||
end
|
||||
end
|
||||
# Other certain switching effects
|
||||
return true if NEWEST_BATTLE_MECHANICS && battler.pbHasType?(:GHOST)
|
||||
return true if MORE_TYPE_EFFECTS && battler.pbHasType?(:GHOST)
|
||||
# Other certain trapping effects
|
||||
if battler.effects[PBEffects::Trapping]>0 ||
|
||||
battler.effects[PBEffects::MeanLook]>=0 ||
|
||||
@@ -286,7 +286,7 @@ class PokeBattle_Battle
|
||||
partyOrder[idxParty],partyOrder[idxPartyOld] = partyOrder[idxPartyOld],partyOrder[idxParty]
|
||||
# Send out the new Pokémon
|
||||
pbSendOut([[idxBattler,party[idxParty]]])
|
||||
# pbCalculatePriority(false,[idxBattler]) if NEWEST_BATTLE_MECHANICS
|
||||
pbCalculatePriority(false,[idxBattler]) if RECALCULATE_TURN_ORDER_AFTER_SPEED_CHANGES
|
||||
end
|
||||
|
||||
# Called from def pbReplace above and at the start of battle.
|
||||
|
||||
@@ -6,7 +6,7 @@ class PokeBattle_Battle
|
||||
return false if trainerBattle?
|
||||
battler = @battlers[idxBattler]
|
||||
return false if !@canRun && !battler.opposes?
|
||||
return true if battler.pbHasType?(:GHOST) && NEWEST_BATTLE_MECHANICS
|
||||
return true if battler.pbHasType?(:GHOST) && MORE_TYPE_EFFECTS
|
||||
return true if battler.abilityActive? &&
|
||||
BattleHandlers.triggerRunFromBattleAbility(battler.ability,battler)
|
||||
return true if battler.itemActive? &&
|
||||
@@ -71,7 +71,7 @@ class PokeBattle_Battle
|
||||
return 0
|
||||
end
|
||||
if !duringBattle
|
||||
if battler.pbHasType?(:GHOST) && NEWEST_BATTLE_MECHANICS
|
||||
if battler.pbHasType?(:GHOST) && MORE_TYPE_EFFECTS
|
||||
pbSEPlay("Battle flee")
|
||||
pbDisplayPaused(_INTL("You got away safely!"))
|
||||
@decision = 3
|
||||
|
||||
@@ -157,7 +157,7 @@ class PokeBattle_Battle
|
||||
if battler.isSpecies?(:GENGAR) && battler.mega?
|
||||
battler.effects[PBEffects::Telekinesis] = 0
|
||||
end
|
||||
pbCalculatePriority(false,[idxBattler]) if NEWEST_BATTLE_MECHANICS
|
||||
pbCalculatePriority(false,[idxBattler]) if RECALCULATE_TURN_ORDER_AFTER_MEGA_EVOLUTION
|
||||
# Trigger ability
|
||||
battler.pbEffectsOnSwitchIn
|
||||
end
|
||||
|
||||
@@ -84,7 +84,7 @@ class PokeBattle_Battle
|
||||
end
|
||||
return if @decision > 0
|
||||
end
|
||||
# pbCalculatePriority if NEWEST_BATTLE_MECHANICS
|
||||
pbCalculatePriority if RECALCULATE_TURN_ORDER_AFTER_SPEED_CHANGES
|
||||
end
|
||||
|
||||
def pbAttackPhaseMegaEvolution
|
||||
|
||||
@@ -331,7 +331,7 @@ class PokeBattle_Battle
|
||||
# Damage from Hyper Mode (Shadow Pokémon)
|
||||
priority.each do |b|
|
||||
next if !b.inHyperMode? || @choices[b.index][0]!=:UseMove
|
||||
hpLoss = (NEWEST_BATTLE_MECHANICS) ? b.totalhp/16 : b.totalhp/8
|
||||
hpLoss = b.totalhp/24
|
||||
@scene.pbDamageAnimation(b)
|
||||
b.pbReduceHP(hpLoss,false)
|
||||
pbDisplay(_INTL("The Hyper Mode attack hurts {1}!",b.pbThis(true)))
|
||||
@@ -370,7 +370,7 @@ class PokeBattle_Battle
|
||||
priority.each do |b|
|
||||
next if b.status!=PBStatuses::BURN || !b.takesIndirectDamage?
|
||||
oldHP = b.hp
|
||||
dmg = (NEWEST_BATTLE_MECHANICS) ? b.totalhp/16 : b.totalhp/8
|
||||
dmg = (MECHANICS_GENERATION >= 7) ? b.totalhp/16 : b.totalhp/8
|
||||
dmg = (dmg/2.0).round if b.hasActiveAbility?(:HEATPROOF)
|
||||
b.pbContinueStatus { b.pbReduceHP(dmg,false) }
|
||||
b.pbItemHPHealCheck
|
||||
@@ -417,9 +417,9 @@ class PokeBattle_Battle
|
||||
else pbCommonAnimation("Wrap", b)
|
||||
end
|
||||
if b.takesIndirectDamage?
|
||||
hpLoss = (NEWEST_BATTLE_MECHANICS) ? b.totalhp/8 : b.totalhp/16
|
||||
hpLoss = (MECHANICS_GENERATION >= 6) ? b.totalhp/8 : b.totalhp/16
|
||||
if @battlers[b.effects[PBEffects::TrappingUser]].hasActiveItem?(:BINDINGBAND)
|
||||
hpLoss = (NEWEST_BATTLE_MECHANICS) ? b.totalhp/6 : b.totalhp/8
|
||||
hpLoss = (MECHANICS_GENERATION >= 6) ? b.totalhp/6 : b.totalhp/8
|
||||
end
|
||||
@scene.pbDamageAnimation(b)
|
||||
b.pbReduceHP(hpLoss,false)
|
||||
|
||||
@@ -44,7 +44,7 @@ class PokeBattle_AI
|
||||
:ENERGYPOWDER => 50,
|
||||
:ENERGYROOT => 200
|
||||
}
|
||||
hpItems[:RAGECANDYBAR] = 20 if !NEWEST_BATTLE_MECHANICS
|
||||
hpItems[:RAGECANDYBAR] = 20 if !RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS
|
||||
fullRestoreItems = [
|
||||
:FULLRESTORE
|
||||
]
|
||||
@@ -59,37 +59,37 @@ class PokeBattle_AI
|
||||
:FULLHEAL, :LAVACOOKIE, :OLDGATEAU, :CASTELIACONE, :LUMIOSEGALETTE,
|
||||
:SHALOURSABLE, :BIGMALASADA, :LUMBERRY, :HEALPOWDER
|
||||
]
|
||||
allStatusItems.push(:RAGECANDYBAR) if NEWEST_BATTLE_MECHANICS
|
||||
allStatusItems.push(:RAGECANDYBAR) if RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS
|
||||
xItems = {
|
||||
:XATTACK => [PBStats::ATTACK, (NEWEST_BATTLE_MECHANICS) ? 2 : 1],
|
||||
:XATTACK => [PBStats::ATTACK, (X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XATTACK2 => [PBStats::ATTACK, 2],
|
||||
:XATTACK3 => [PBStats::ATTACK, 3],
|
||||
:XATTACK6 => [PBStats::ATTACK, 6],
|
||||
:XDEFENSE => [PBStats::DEFENSE, (NEWEST_BATTLE_MECHANICS) ? 2 : 1],
|
||||
:XDEFENSE => [PBStats::DEFENSE, (X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XDEFENSE2 => [PBStats::DEFENSE, 2],
|
||||
:XDEFENSE3 => [PBStats::DEFENSE, 3],
|
||||
:XDEFENSE6 => [PBStats::DEFENSE, 6],
|
||||
:XDEFEND => [PBStats::DEFENSE, (NEWEST_BATTLE_MECHANICS) ? 2 : 1],
|
||||
:XDEFEND => [PBStats::DEFENSE, (X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XDEFEND2 => [PBStats::DEFENSE, 2],
|
||||
:XDEFEND3 => [PBStats::DEFENSE, 3],
|
||||
:XDEFEND6 => [PBStats::DEFENSE, 6],
|
||||
:XSPATK => [PBStats::SPATK, (NEWEST_BATTLE_MECHANICS) ? 2 : 1],
|
||||
:XSPATK => [PBStats::SPATK, (X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XSPATK2 => [PBStats::SPATK, 2],
|
||||
:XSPATK3 => [PBStats::SPATK, 3],
|
||||
:XSPATK6 => [PBStats::SPATK, 6],
|
||||
:XSPECIAL => [PBStats::SPATK, (NEWEST_BATTLE_MECHANICS) ? 2 : 1],
|
||||
:XSPECIAL => [PBStats::SPATK, (X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XSPECIAL2 => [PBStats::SPATK, 2],
|
||||
:XSPECIAL3 => [PBStats::SPATK, 3],
|
||||
:XSPECIAL6 => [PBStats::SPATK, 6],
|
||||
:XSPDEF => [PBStats::SPDEF, (NEWEST_BATTLE_MECHANICS) ? 2 : 1],
|
||||
:XSPDEF => [PBStats::SPDEF, (X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XSPDEF2 => [PBStats::SPDEF, 2],
|
||||
:XSPDEF3 => [PBStats::SPDEF, 3],
|
||||
:XSPDEF6 => [PBStats::SPDEF, 6],
|
||||
:XSPEED => [PBStats::SPEED, (NEWEST_BATTLE_MECHANICS) ? 2 : 1],
|
||||
:XSPEED => [PBStats::SPEED, (X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XSPEED2 => [PBStats::SPEED, 2],
|
||||
:XSPEED3 => [PBStats::SPEED, 3],
|
||||
:XSPEED6 => [PBStats::SPEED, 6],
|
||||
:XACCURACY => [PBStats::ACCURACY, (NEWEST_BATTLE_MECHANICS) ? 2 : 1],
|
||||
:XACCURACY => [PBStats::ACCURACY, (X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1],
|
||||
:XACCURACY2 => [PBStats::ACCURACY, 2],
|
||||
:XACCURACY3 => [PBStats::ACCURACY, 3],
|
||||
:XACCURACY6 => [PBStats::ACCURACY, 6]
|
||||
|
||||
@@ -120,7 +120,7 @@ class PokeBattle_AI
|
||||
end
|
||||
return true if target.effects[PBEffects::Substitute]>0 && move.statusMove? &&
|
||||
!move.ignoresSubstitute?(user) && user.index!=target.index
|
||||
return true if NEWEST_BATTLE_MECHANICS && user.hasActiveAbility?(:PRANKSTER) &&
|
||||
return true if MECHANICS_GENERATION >= 7 && user.hasActiveAbility?(:PRANKSTER) &&
|
||||
target.pbHasType?(:DARK) && target.opposes?(user)
|
||||
return true if move.priority>0 && @battle.field.terrain==PBBattleTerrains::Psychic &&
|
||||
target.affectedByTerrain? && target.opposes?(user)
|
||||
@@ -200,7 +200,7 @@ class PokeBattle_AI
|
||||
baseDmg = move.pbNaturalGiftBaseDamage(user.item_id)
|
||||
when "09B" # Heavy Slam
|
||||
baseDmg = move.pbBaseDamage(baseDmg,user,target)
|
||||
baseDmg *= 2 if NEWEST_BATTLE_MECHANICS && skill>=PBTrainerAI.mediumSkill &&
|
||||
baseDmg *= 2 if MECHANICS_GENERATION >= 7 && skill>=PBTrainerAI.mediumSkill &&
|
||||
target.effects[PBEffects::Minimize]
|
||||
when "0A0", "0BD", "0BE" # Frost Breath, Double Kick, Twineedle
|
||||
baseDmg *= 2
|
||||
@@ -469,7 +469,7 @@ class PokeBattle_AI
|
||||
if skill>=PBTrainerAI.highSkill
|
||||
if user.status==PBStatuses::BURN && move.physicalMove?(type) &&
|
||||
!user.hasActiveAbility?(:GUTS) &&
|
||||
!(NEWEST_BATTLE_MECHANICS && move.function=="07E") # Facade
|
||||
!(MECHANICS_GENERATION >= 6 && move.function == "07E") # Facade
|
||||
multipliers[FINAL_DMG_MULT] /= 2
|
||||
end
|
||||
end
|
||||
@@ -646,7 +646,7 @@ class PokeBattle_AI
|
||||
end
|
||||
if skill>=PBTrainerAI.highSkill
|
||||
if move.function=="006" # Toxic
|
||||
modifiers[BASE_ACC] = 0 if NEWEST_BATTLE_MECHANICS && move.statusMove? &&
|
||||
modifiers[BASE_ACC] = 0 if MORE_TYPE_EFFECTS && move.statusMove? &&
|
||||
user.pbHasType?(:POISON)
|
||||
end
|
||||
if move.function=="070" # OHKO moves
|
||||
|
||||
@@ -491,10 +491,14 @@ FINAL_DMG_MULT = 3
|
||||
|
||||
def pbBattleConfusionBerry(battler,battle,item,forced,flavor,confuseMsg)
|
||||
return false if !forced && !battler.canHeal?
|
||||
return false if !forced && !battler.pbCanConsumeBerry?(item,false)
|
||||
return false if !forced && !battler.pbCanConsumeBerry?(item, (MECHANICS_GENERATION >= 7))
|
||||
itemName = GameData::Item.get(item).name
|
||||
battle.pbCommonAnimation("EatBerry",battler) if !forced
|
||||
amt = (NEWEST_BATTLE_MECHANICS) ? battler.pbRecoverHP(battler.totalhp/2) : battler.pbRecoverHP(battler.totalhp/8)
|
||||
fraction_to_heal = 8 # Gens 6 and lower
|
||||
if MECHANICS_GENERATION == 7; fraction_to_heal = 2
|
||||
elsif MECHANICS_GENERATION >= 8; fraction_to_heal = 3
|
||||
end
|
||||
amt = battler.pbRecoverHP(battler.totalhp / fraction_to_heal)
|
||||
if amt>0
|
||||
if forced
|
||||
PBDebug.log("[Item triggered] Forced consuming of #{itemName}")
|
||||
@@ -577,7 +581,7 @@ def pbBattleGem(user,type,move,mults,moveType)
|
||||
return if move.is_a?(PokeBattle_PledgeMove)
|
||||
return if moveType != type
|
||||
user.effects[PBEffects::GemConsumed] = user.item_id
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
if MECHANICS_GENERATION >= 6
|
||||
mults[BASE_DMG_MULT] *= 1.3
|
||||
else
|
||||
mults[BASE_DMG_MULT] *= 1.5
|
||||
@@ -603,10 +607,10 @@ def pbBattleWeatherAbility(weather,battler,battle,ignorePrimal=false)
|
||||
battle.pbDisplay(_INTL("{1}'s {2} activated!",battler.pbThis,battler.abilityName))
|
||||
end
|
||||
fixedDuration = false
|
||||
fixedDuration = true if NEWEST_BATTLE_MECHANICS &&
|
||||
weather!=PBWeather::HarshSun &&
|
||||
weather!=PBWeather::HeavyRain &&
|
||||
weather!=PBWeather::StrongWinds
|
||||
fixedDuration = true if FIXED_DURATION_WEATHER_FROM_ABILITY &&
|
||||
weather != PBWeather::HarshSun &&
|
||||
weather != PBWeather::HeavyRain &&
|
||||
weather != PBWeather::StrongWinds
|
||||
battle.pbStartWeather(battler,weather,fixedDuration)
|
||||
# NOTE: The ability splash is hidden again in def pbStartWeather.
|
||||
end
|
||||
|
||||
@@ -308,7 +308,7 @@ BattleHandlers::StatusCureAbility.add(:MAGMAARMOR,
|
||||
BattleHandlers::StatusCureAbility.add(:OBLIVIOUS,
|
||||
proc { |ability,battler|
|
||||
next if battler.effects[PBEffects::Attract]<0 &&
|
||||
(battler.effects[PBEffects::Taunt]==0 || !NEWEST_BATTLE_MECHANICS)
|
||||
(battler.effects[PBEffects::Taunt]==0 || MECHANICS_GENERATION <= 5)
|
||||
battler.battle.pbShowAbilitySplash(battler)
|
||||
if battler.effects[PBEffects::Attract]>=0
|
||||
battler.pbCureAttract
|
||||
@@ -319,7 +319,7 @@ BattleHandlers::StatusCureAbility.add(:OBLIVIOUS,
|
||||
battler.pbThis,battler.abilityName))
|
||||
end
|
||||
end
|
||||
if battler.effects[PBEffects::Taunt]>0 && NEWEST_BATTLE_MECHANICS
|
||||
if battler.effects[PBEffects::Taunt]>0 && MECHANICS_GENERATION >= 6
|
||||
battler.effects[PBEffects::Taunt] = 0
|
||||
if PokeBattle_SceneConstants::USE_ABILITY_SPLASH
|
||||
battler.battle.pbDisplay(_INTL("{1}'s Taunt wore off!",battler.pbThis))
|
||||
@@ -741,7 +741,7 @@ BattleHandlers::MoveBaseTypeModifierAbility.add(:LIQUIDVOICE,
|
||||
BattleHandlers::MoveBaseTypeModifierAbility.add(:NORMALIZE,
|
||||
proc { |ability,user,move,type|
|
||||
next if !GameData::Type.exists?(:NORMAL)
|
||||
move.powerBoost = true if NEWEST_BATTLE_MECHANICS
|
||||
move.powerBoost = true if MECHANICS_GENERATION >= 7
|
||||
next :NORMAL
|
||||
}
|
||||
)
|
||||
@@ -780,7 +780,7 @@ BattleHandlers::AccuracyCalcUserAbility.add(:HUSTLE,
|
||||
|
||||
BattleHandlers::AccuracyCalcUserAbility.add(:KEENEYE,
|
||||
proc { |ability,mods,user,target,move,type|
|
||||
mods[EVA_STAGE] = 0 if mods[EVA_STAGE]>0 && NEWEST_BATTLE_MECHANICS
|
||||
mods[EVA_STAGE] = 0 if mods[EVA_STAGE]>0 && MECHANICS_GENERATION >= 6
|
||||
}
|
||||
)
|
||||
|
||||
@@ -1601,12 +1601,12 @@ BattleHandlers::TargetAbilityOnHit.add(:WATERCOMPACTION,
|
||||
BattleHandlers::TargetAbilityOnHit.add(:WEAKARMOR,
|
||||
proc { |ability,user,target,move,battle|
|
||||
next if !move.physicalMove?
|
||||
next if !target.pbCanLowerStatStage?(PBStats::DEFENSE,target) &&
|
||||
!target.pbCanRaiseStatStage?(PBStats::SPEED,target)
|
||||
next if !target.pbCanLowerStatStage?(PBStats::DEFENSE, target) &&
|
||||
!target.pbCanRaiseStatStage?(PBStats::SPEED, target)
|
||||
battle.pbShowAbilitySplash(target)
|
||||
target.pbLowerStatStageByAbility(PBStats::DEFENSE,1,target,false)
|
||||
target.pbLowerStatStageByAbility(PBStats::DEFENSE, 1, target, false)
|
||||
target.pbRaiseStatStageByAbility(PBStats::SPEED,
|
||||
(NEWEST_BATTLE_MECHANICS) ? 2 : 1,target,false)
|
||||
(MECHANICS_GENERATION >= 7) ? 2 : 1, target, false)
|
||||
battle.pbHideAbilitySplash(target)
|
||||
}
|
||||
)
|
||||
@@ -2089,7 +2089,7 @@ BattleHandlers::AbilityOnSwitchIn.add(:ANTICIPATION,
|
||||
next if m.statusMove?
|
||||
if type1
|
||||
moveType = m.type
|
||||
if NEWEST_BATTLE_MECHANICS && m.function == "090" # Hidden Power
|
||||
if MECHANICS_GENERATION >= 6 && m.function == "090" # Hidden Power
|
||||
moveType = pbHiddenPower(b.pokemon)[0]
|
||||
end
|
||||
eff = PBTypes.getCombinedEffectiveness(moveType,type1,type2,type3)
|
||||
@@ -2236,7 +2236,7 @@ BattleHandlers::AbilityOnSwitchIn.add(:FRISK,
|
||||
end
|
||||
if foes.length>0
|
||||
battle.pbShowAbilitySplash(battler)
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
if MECHANICS_GENERATION >= 6
|
||||
foes.each do |b|
|
||||
battle.pbDisplay(_INTL("{1} frisked {2} and found its {3}!",
|
||||
battler.pbThis,b.pbThis(true),b.itemName))
|
||||
|
||||
@@ -748,7 +748,7 @@ BattleHandlers::DamageCalcUserItem.copy(:SOFTSAND,:EARTHPLATE)
|
||||
BattleHandlers::DamageCalcUserItem.add(:SOULDEW,
|
||||
proc { |item,user,target,move,mults,baseDmg,type|
|
||||
next if !user.isSpecies?(:LATIAS) && !user.isSpecies?(:LATIOS)
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
if SOUL_DEW_POWERS_UP_TYPES
|
||||
mults[FINAL_DMG_MULT] *= 1.2 if type == :PSYCHIC || type == :DRAGON
|
||||
else
|
||||
if move.specialMove? && !user.battle.rules["souldewclause"]
|
||||
@@ -934,7 +934,7 @@ BattleHandlers::DamageCalcTargetItem.add(:SHUCABERRY,
|
||||
|
||||
BattleHandlers::DamageCalcTargetItem.add(:SOULDEW,
|
||||
proc { |item,user,target,move,mults,baseDmg,type|
|
||||
next if NEWEST_BATTLE_MECHANICS
|
||||
next if SOUL_DEW_POWERS_UP_TYPES
|
||||
next if !target.isSpecies?(:LATIAS) && !target.isSpecies?(:LATIOS)
|
||||
if move.specialMove? && !user.battle.rules["souldewclause"]
|
||||
mults[DEF_MULT] *= 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|
|
||||
multiplier = (NEWEST_BATTLE_MECHANICS) ? 3.5 : 3
|
||||
multiplier = (NEW_POKE_BALL_CATCH_RATES) ? 3.5 : 3
|
||||
catchRate *= multiplier if battler.pbHasType?(:BUG) || battler.pbHasType?(:WATER)
|
||||
next catchRate
|
||||
})
|
||||
@@ -112,14 +112,14 @@ BallHandlers::ModifyCatchRate.add(:DIVEBALL,proc { |ball,catchRate,battle,battle
|
||||
})
|
||||
|
||||
BallHandlers::ModifyCatchRate.add(:NESTBALL,proc { |ball,catchRate,battle,battler,ultraBeast|
|
||||
if battler.level<=((NEWEST_BATTLE_MECHANICS) ? 29 : 30)
|
||||
catchRate *= [(41-battler.level)/10.0,1].max
|
||||
if battler.level <= 30
|
||||
catchRate *= [(41 - battler.level) / 10.0, 1].max
|
||||
end
|
||||
next catchRate
|
||||
})
|
||||
|
||||
BallHandlers::ModifyCatchRate.add(:REPEATBALL,proc { |ball,catchRate,battle,battler,ultraBeast|
|
||||
multiplier = (NEWEST_BATTLE_MECHANICS) ? 3.5 : 3
|
||||
multiplier = (NEW_POKE_BALL_CATCH_RATES) ? 3.5 : 3
|
||||
catchRate *= multiplier if battle.pbPlayer.owned[battler.species]
|
||||
next catchRate
|
||||
})
|
||||
@@ -131,14 +131,13 @@ BallHandlers::ModifyCatchRate.add(:TIMERBALL,proc { |ball,catchRate,battle,battl
|
||||
})
|
||||
|
||||
BallHandlers::ModifyCatchRate.add(:DUSKBALL,proc { |ball,catchRate,battle,battler,ultraBeast|
|
||||
multiplier = (NEWEST_BATTLE_MECHANICS) ? 3 : 3.5
|
||||
multiplier = (NEW_POKE_BALL_CATCH_RATES) ? 3 : 3.5
|
||||
catchRate *= multiplier if battle.time==2
|
||||
next catchRate
|
||||
})
|
||||
|
||||
BallHandlers::ModifyCatchRate.add(:QUICKBALL,proc { |ball,catchRate,battle,battler,ultraBeast|
|
||||
multiplier = (NEWEST_BATTLE_MECHANICS) ? 4 : 5
|
||||
catchRate *= multiplier if battle.turnCount==0
|
||||
catchRate *= 5 if battle.turnCount==0
|
||||
next catchRate
|
||||
})
|
||||
|
||||
@@ -162,7 +161,7 @@ BallHandlers::ModifyCatchRate.add(:LEVELBALL,proc { |ball,catchRate,battle,battl
|
||||
})
|
||||
|
||||
BallHandlers::ModifyCatchRate.add(:LUREBALL,proc { |ball,catchRate,battle,battler,ultraBeast|
|
||||
multiplier = (NEWEST_BATTLE_MECHANICS) ? 5 : 3
|
||||
multiplier = (NEW_POKE_BALL_CATCH_RATES) ? 5 : 3
|
||||
catchRate *= multiplier if $PokemonTemp.encounterType==EncounterTypes::OldRod ||
|
||||
$PokemonTemp.encounterType==EncounterTypes::GoodRod ||
|
||||
$PokemonTemp.encounterType==EncounterTypes::SuperRod
|
||||
@@ -172,7 +171,7 @@ BallHandlers::ModifyCatchRate.add(:LUREBALL,proc { |ball,catchRate,battle,battle
|
||||
BallHandlers::ModifyCatchRate.add(:HEAVYBALL,proc { |ball,catchRate,battle,battler,ultraBeast|
|
||||
next 0 if catchRate==0
|
||||
weight = battler.pbWeight
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
if NEW_POKE_BALL_CATCH_RATES
|
||||
if weight>=3000; catchRate += 30
|
||||
elsif weight>=2000; catchRate += 20
|
||||
elsif weight<1000; catchRate -= 20
|
||||
|
||||
@@ -578,7 +578,7 @@ end
|
||||
Events.onEndBattle += proc { |_sender,e|
|
||||
decision = e[0]
|
||||
canLose = e[1]
|
||||
if NEWEST_BATTLE_MECHANICS || (decision!=2 && decision!=5) # not a loss or a draw
|
||||
if CHECK_EVOLUTION_AFTER_ALL_BATTLES || (decision!=2 && decision!=5) # not a loss or a draw
|
||||
if $PokemonTemp.evolutionLevels
|
||||
pbEvolutionCheck($PokemonTemp.evolutionLevels)
|
||||
$PokemonTemp.evolutionLevels = nil
|
||||
@@ -602,7 +602,7 @@ Events.onEndBattle += proc { |_sender,e|
|
||||
def pbEvolutionCheck(currentLevels)
|
||||
for i in 0...currentLevels.length
|
||||
pkmn = $Trainer.party[i]
|
||||
next if !pkmn || (pkmn.hp==0 && !NEWEST_BATTLE_MECHANICS)
|
||||
next if !pkmn || (pkmn.hp==0 && !CHECK_EVOLUTION_FOR_FAINTED_POKEMON)
|
||||
next if currentLevels[i] && pkmn.level==currentLevels[i]
|
||||
newSpecies = pbCheckEvolution(pkmn)
|
||||
next if !newSpecies
|
||||
|
||||
@@ -297,11 +297,11 @@ class PokemonEncounters
|
||||
end
|
||||
end
|
||||
# Black Flute and White Flute alter the level of the wild Pokémon
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
if FLUTES_CHANGE_WILD_ENCOUNTER_LEVELS
|
||||
if $PokemonMap.blackFluteUsed
|
||||
level = [level+1+rand(3),PBExperience.maxLevel].min
|
||||
level = [level + 1 + rand(4), PBExperience.maxLevel].min
|
||||
elsif $PokemonMap.whiteFluteUsed
|
||||
level = [level-1-rand(3),1].max
|
||||
level = [level - 1 - rand(4), 1].max
|
||||
end
|
||||
end
|
||||
# Return [species, level]
|
||||
@@ -329,7 +329,7 @@ class PokemonEncounters
|
||||
# increase precision).
|
||||
encount = @density[enctype]*16
|
||||
encount *= 0.8 if $PokemonGlobal.bicycle
|
||||
if !NEWEST_BATTLE_MECHANICS
|
||||
if !FLUTES_CHANGE_WILD_ENCOUNTER_LEVELS
|
||||
if $PokemonMap.blackFluteUsed
|
||||
encount /= 2
|
||||
elsif $PokemonMap.whiteFluteUsed
|
||||
@@ -382,7 +382,7 @@ class PokemonEncounters
|
||||
return false if $DEBUG && Input.press?(Input::CTRL)
|
||||
if !pbPokeRadarOnShakingGrass
|
||||
if $PokemonGlobal.repel>0 || repel
|
||||
firstPkmn = (NEWEST_BATTLE_MECHANICS) ? $Trainer.firstPokemon : $Trainer.firstAblePokemon
|
||||
firstPkmn = (REPEL_COUNTS_FAINTED_POKEMON) ? $Trainer.firstPokemon : $Trainer.firstAblePokemon
|
||||
return false if firstPkmn && encounter[1]<firstPkmn.level
|
||||
end
|
||||
end
|
||||
|
||||
@@ -374,19 +374,15 @@ end
|
||||
|
||||
Events.onAction += proc { |_sender, _e|
|
||||
if $PokemonGlobal.diving
|
||||
if DIVING_SURFACE_ANYWHERE
|
||||
surface_map_id = nil
|
||||
GameData::MapMetadata.each do |map_data|
|
||||
next if !map_data.dive_map_id || map_data.dive_map_id != $game_map.map_id
|
||||
surface_map_id = map_data.id
|
||||
break
|
||||
end
|
||||
if surface_map_id &&
|
||||
PBTerrain.isDeepWater?($MapFactory.getTerrainTag(surface_map_id, $game_player.x, $game_player.y))
|
||||
pbSurfacing
|
||||
else
|
||||
surface_map_id = nil
|
||||
GameData::MapMetadata.each do |map_data|
|
||||
next if !map_data.dive_map_id || map_data.dive_map_id != $game_map.map_id
|
||||
surface_map_id = map_data.id
|
||||
break
|
||||
end
|
||||
if surface_map_id &&
|
||||
PBTerrain.isDeepWater?($MapFactory.getTerrainTag(surface_map_id, $game_player.x, $game_player.y))
|
||||
pbSurfacing
|
||||
end
|
||||
end
|
||||
else
|
||||
pbDive if PBTerrain.isDeepWater?($game_player.terrain_tag)
|
||||
@@ -396,7 +392,6 @@ Events.onAction += proc { |_sender, _e|
|
||||
HiddenMoveHandlers::CanUseMove.add(:DIVE,proc { |move,pkmn,showmsg|
|
||||
next false if !pbCheckHiddenMoveBadge(BADGE_FOR_DIVE,showmsg)
|
||||
if $PokemonGlobal.diving
|
||||
next true if DIVING_SURFACE_ANYWHERE
|
||||
surface_map_id = nil
|
||||
GameData::MapMetadata.each do |map_data|
|
||||
next if !map_data.dive_map_id || map_data.dive_map_id != $game_map.map_id
|
||||
|
||||
@@ -228,7 +228,7 @@ def pbDayCareGenerateEgg
|
||||
moves.push(move)
|
||||
end
|
||||
# Inheriting Machine Moves
|
||||
if !NEWEST_BATTLE_MECHANICS
|
||||
if BREEDING_CAN_INHERIT_MACHINE_MOVES
|
||||
GameData::Item.each do |i|
|
||||
atk = i.move
|
||||
next if !atk
|
||||
@@ -242,7 +242,7 @@ def pbDayCareGenerateEgg
|
||||
if movefather.male?
|
||||
babyEggMoves.each { |m| moves.push(m) if movefather.hasMove?(m) }
|
||||
end
|
||||
if NEWEST_BATTLE_MECHANICS
|
||||
if BREEDING_CAN_INHERIT_EGG_MOVES_FROM_MOTHER
|
||||
babyEggMoves.each { |m| moves.push(m) if movemother.hasMove?(m) }
|
||||
end
|
||||
# Volt Tackle
|
||||
@@ -293,8 +293,7 @@ def pbDayCareGenerateEgg
|
||||
end
|
||||
r = (r+1)%2
|
||||
end
|
||||
limit = (NEWEST_BATTLE_MECHANICS && (mother.hasItem?(:DESTINYKNOT) ||
|
||||
father.hasItem?(:DESTINYKNOT))) ? 5 : 3
|
||||
limit = (mother.hasItem?(:DESTINYKNOT) || father.hasItem?(:DESTINYKNOT)) ? 5 : 3
|
||||
loop do
|
||||
freestats = []
|
||||
PBStats.eachStat { |s| freestats.push(s) if !ivinherit.include?(s) }
|
||||
@@ -307,11 +306,12 @@ def pbDayCareGenerateEgg
|
||||
break if num>=limit
|
||||
end
|
||||
# Inheriting nature
|
||||
newnatures = []
|
||||
newnatures.push(mother.nature) if mother.hasItem?(:EVERSTONE)
|
||||
newnatures.push(father.nature) if father.hasItem?(:EVERSTONE)
|
||||
if newnatures.length>0
|
||||
egg.setNature(newnatures[rand(newnatures.length)])
|
||||
new_natures = []
|
||||
new_natures.push(mother.nature) if mother.hasItem?(:EVERSTONE)
|
||||
new_natures.push(father.nature) if father.hasItem?(:EVERSTONE)
|
||||
if new_natures.length > 0
|
||||
new_nature = (new_natures.length == 1) ? new_natures[0] : new_natures[rand(new_natures.length)]
|
||||
egg.setNature(new_nature)
|
||||
end
|
||||
# Masuda method and Shiny Charm
|
||||
shinyretries = 0
|
||||
@@ -324,26 +324,34 @@ def pbDayCareGenerateEgg
|
||||
end
|
||||
end
|
||||
# Inheriting ability from the mother
|
||||
if !ditto0 && !ditto1
|
||||
if mother.hasHiddenAbility?
|
||||
egg.setAbility(mother.abilityIndex) if rand(10)<6
|
||||
else
|
||||
if rand(10)<8
|
||||
if !ditto0 || !ditto1
|
||||
parent = (ditto0) ? father : mother # The non-Ditto
|
||||
if parent.hasHiddenAbility?
|
||||
egg.setAbility(parent.abilityIndex) if rand(100) < 60
|
||||
elsif !ditto0 && !ditto1
|
||||
if rand(100) < 80
|
||||
egg.setAbility(mother.abilityIndex)
|
||||
else
|
||||
egg.setAbility((mother.abilityIndex+1)%2)
|
||||
egg.setAbility((mother.abilityIndex + 1) % 2)
|
||||
end
|
||||
end
|
||||
elsif !(ditto0 && ditto1) && NEWEST_BATTLE_MECHANICS
|
||||
parent = (!ditto0) ? mother : father
|
||||
if parent.hasHiddenAbility?
|
||||
egg.setAbility(parent.abilityIndex) if rand(10)<6
|
||||
end
|
||||
end
|
||||
# Inheriting Poké Ball from the mother
|
||||
if mother.female? &&
|
||||
![:MASTERBALL, :CHERISHBALL].include?(pbBallTypeToItem(mother.ballused).id)
|
||||
egg.ballused = mother.ballused
|
||||
# Inheriting Poké Ball from the mother (or father if it's same species as mother)
|
||||
if !ditto0 || !ditto1
|
||||
possible_balls = []
|
||||
if mother.species == father.species
|
||||
possible_balls.push(mother.ballused)
|
||||
possible_balls.push(father.ballused)
|
||||
else
|
||||
possible_balls.push(pkmn0.ballused) if pkmn0.female? || ditto1
|
||||
possible_balls.push(pkmn1.ballused) if pkmn1.female? || ditto0
|
||||
end
|
||||
possible_balls.delete(pbGetBallType(:MASTERBALL)) # Can't inherit this Ball
|
||||
possible_balls.delete(pbGetBallType(:CHERISHBALL)) # Can't inherit this Ball
|
||||
if possible_balls.length > 0
|
||||
egg.ballused = possible_balls[0]
|
||||
egg.ballused = possible_balls[rand(possible_balls.length)] if possible_balls.length > 1
|
||||
end
|
||||
end
|
||||
# Set all stats
|
||||
egg.happiness = 120
|
||||
|
||||
@@ -433,7 +433,7 @@ def pbLearnMove(pkmn,move,ignoreifknown=false,bymachine=false,&block)
|
||||
oldmovename = pkmn.moves[forgetmove].name
|
||||
oldmovepp = pkmn.moves[forgetmove].pp
|
||||
pkmn.moves[forgetmove] = PBMove.new(move) # Replaces current/total PP
|
||||
if bymachine && !NEWEST_BATTLE_MECHANICS
|
||||
if bymachine && TAUGHT_MACHINES_KEEP_OLD_PP
|
||||
pkmn.moves[forgetmove].pp = [oldmovepp,pkmn.moves[forgetmove].total_pp].min
|
||||
end
|
||||
pbMessage(_INTL("1,\\wt[16] 2, and\\wt[16]...\\wt[16] ...\\wt[16] ... Ta-da!\\se[Battle ball drop]\1"),&block)
|
||||
@@ -477,7 +477,7 @@ def pbUseItem(bag,item,bagscene=nil)
|
||||
if !pbConfirmMessage(_INTL("Do you want to teach {1} to a Pokémon?",movename))
|
||||
return 0
|
||||
elsif pbMoveTutorChoose(machine,nil,true)
|
||||
bag.pbDeleteItem(item) if itm.is_TM? && !INFINITE_TMS
|
||||
bag.pbDeleteItem(item) if itm.is_TR?
|
||||
return 1
|
||||
end
|
||||
return 0
|
||||
@@ -522,7 +522,7 @@ def pbUseItem(bag,item,bagscene=nil)
|
||||
bagscene.pbRefresh if bagscene
|
||||
}
|
||||
return (ret) ? 1 : 0
|
||||
elsif useType==2 # Item is usable from bag
|
||||
elsif useType==2 # Item is usable from Bag
|
||||
intret = ItemHandlers.triggerUseFromBag(item)
|
||||
case intret
|
||||
when 0 then return 0
|
||||
@@ -559,7 +559,7 @@ def pbUseItemOnPokemon(item,pkmn,scene)
|
||||
pbMessage(_INTL("\\se[PC access]You booted up {1}.\1",itm.name)) { scene.pbUpdate }
|
||||
if pbConfirmMessage(_INTL("Do you want to teach {1} to {2}?",movename,pkmn.name)) { scene.pbUpdate }
|
||||
if pbLearnMove(pkmn,machine,false,true) { scene.pbUpdate }
|
||||
$PokemonBag.pbDeleteItem(item) if itm.is_TM? && !INFINITE_TMS
|
||||
$PokemonBag.pbDeleteItem(item) if itm.is_TR?
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
@@ -372,7 +372,7 @@ ItemHandlers::UseOnPokemon.add(:POTION,proc { |item,pkmn,scene|
|
||||
})
|
||||
|
||||
ItemHandlers::UseOnPokemon.copy(:POTION,:BERRYJUICE,:SWEETHEART)
|
||||
ItemHandlers::UseOnPokemon.copy(:POTION,:RAGECANDYBAR) if !NEWEST_BATTLE_MECHANICS
|
||||
ItemHandlers::UseOnPokemon.copy(:POTION,:RAGECANDYBAR) if !RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS
|
||||
|
||||
ItemHandlers::UseOnPokemon.add(:SUPERPOTION,proc { |item,pkmn,scene|
|
||||
next pbHPItem(pkmn,50,scene)
|
||||
@@ -489,7 +489,7 @@ ItemHandlers::UseOnPokemon.add(:FULLHEAL,proc { |item,pkmn,scene|
|
||||
ItemHandlers::UseOnPokemon.copy(:FULLHEAL,
|
||||
:LAVACOOKIE,:OLDGATEAU,:CASTELIACONE,:LUMIOSEGALETTE,:SHALOURSABLE,
|
||||
:BIGMALASADA,:LUMBERRY)
|
||||
ItemHandlers::UseOnPokemon.copy(:FULLHEAL,:RAGECANDYBAR) if NEWEST_BATTLE_MECHANICS
|
||||
ItemHandlers::UseOnPokemon.copy(:FULLHEAL,:RAGECANDYBAR) if RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS
|
||||
|
||||
ItemHandlers::UseOnPokemon.add(:FULLRESTORE,proc { |item,pkmn,scene|
|
||||
if pkmn.fainted? || (pkmn.hp==pkmn.totalhp && pkmn.status==PBStatuses::NONE)
|
||||
|
||||
@@ -66,7 +66,7 @@ ItemHandlers::CanUseInBattle.copy(:POTION,
|
||||
:SUPERPOTION,:HYPERPOTION,:MAXPOTION,:BERRYJUICE,:SWEETHEART,:FRESHWATER,
|
||||
:SODAPOP,:LEMONADE,:MOOMOOMILK,:ORANBERRY,:SITRUSBERRY,:ENERGYPOWDER,
|
||||
:ENERGYROOT)
|
||||
ItemHandlers::CanUseInBattle.copy(:POTION,:RAGECANDYBAR) if !NEWEST_BATTLE_MECHANICS
|
||||
ItemHandlers::CanUseInBattle.copy(:POTION,:RAGECANDYBAR) if !RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS
|
||||
|
||||
ItemHandlers::CanUseInBattle.add(:AWAKENING,proc { |item,pokemon,battler,move,firstAction,battle,scene,showMessages|
|
||||
next pbBattleItemCanCureStatus?(PBStatuses::SLEEP,pokemon,scene,showMessages)
|
||||
@@ -119,7 +119,7 @@ ItemHandlers::CanUseInBattle.add(:FULLHEAL,proc { |item,pokemon,battler,move,fir
|
||||
ItemHandlers::CanUseInBattle.copy(:FULLHEAL,
|
||||
:LAVACOOKIE,:OLDGATEAU,:CASTELIACONE,:LUMIOSEGALETTE,:SHALOURSABLE,
|
||||
:BIGMALASADA,:LUMBERRY,:HEALPOWDER)
|
||||
ItemHandlers::CanUseInBattle.copy(:FULLHEAL,:RAGECANDYBAR) if NEWEST_BATTLE_MECHANICS
|
||||
ItemHandlers::CanUseInBattle.copy(:FULLHEAL,:RAGECANDYBAR) if RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS
|
||||
|
||||
ItemHandlers::CanUseInBattle.add(:FULLRESTORE,proc { |item,pokemon,battler,move,firstAction,battle,scene,showMessages|
|
||||
if !pokemon.able? ||
|
||||
@@ -317,7 +317,7 @@ ItemHandlers::BattleUseOnPokemon.add(:POTION,proc { |item,pokemon,battler,choice
|
||||
})
|
||||
|
||||
ItemHandlers::BattleUseOnPokemon.copy(:POTION,:BERRYJUICE,:SWEETHEART)
|
||||
ItemHandlers::BattleUseOnPokemon.copy(:POTION,:RAGECANDYBAR) if !NEWEST_BATTLE_MECHANICS
|
||||
ItemHandlers::BattleUseOnPokemon.copy(:POTION,:RAGECANDYBAR) if !RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS
|
||||
|
||||
ItemHandlers::BattleUseOnPokemon.add(:SUPERPOTION,proc { |item,pokemon,battler,choices,scene|
|
||||
pbBattleHPItem(pokemon,battler,50,scene)
|
||||
@@ -417,7 +417,7 @@ ItemHandlers::BattleUseOnPokemon.add(:FULLHEAL,proc { |item,pokemon,battler,choi
|
||||
ItemHandlers::BattleUseOnPokemon.copy(:FULLHEAL,
|
||||
:LAVACOOKIE,:OLDGATEAU,:CASTELIACONE,:LUMIOSEGALETTE,:SHALOURSABLE,
|
||||
:BIGMALASADA,:LUMBERRY)
|
||||
ItemHandlers::BattleUseOnPokemon.copy(:FULLHEAL,:RAGECANDYBAR) if NEWEST_BATTLE_MECHANICS
|
||||
ItemHandlers::BattleUseOnPokemon.copy(:FULLHEAL,:RAGECANDYBAR) if RAGE_CANDY_BAR_CURES_STATUS_PROBLEMS
|
||||
|
||||
ItemHandlers::BattleUseOnPokemon.add(:FULLRESTORE,proc { |item,pokemon,battler,choices,scene|
|
||||
pokemon.healStatus
|
||||
@@ -523,7 +523,7 @@ ItemHandlers::BattleUseOnBattler.add(:YELLOWFLUTE,proc { |item,battler,scene|
|
||||
ItemHandlers::BattleUseOnBattler.copy(:YELLOWFLUTE,:PERSIMBERRY)
|
||||
|
||||
ItemHandlers::BattleUseOnBattler.add(:XATTACK,proc { |item,battler,scene|
|
||||
battler.pbRaiseStatStage(PBStats::ATTACK,(NEWEST_BATTLE_MECHANICS) ? 2 : 1,battler)
|
||||
battler.pbRaiseStatStage(PBStats::ATTACK,(X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1,battler)
|
||||
battler.pokemon.changeHappiness("battleitem")
|
||||
})
|
||||
|
||||
@@ -543,7 +543,7 @@ ItemHandlers::BattleUseOnBattler.add(:XATTACK6,proc { |item,battler,scene|
|
||||
})
|
||||
|
||||
ItemHandlers::BattleUseOnBattler.add(:XDEFENSE,proc { |item,battler,scene|
|
||||
battler.pbRaiseStatStage(PBStats::DEFENSE,(NEWEST_BATTLE_MECHANICS) ? 2 : 1,battler)
|
||||
battler.pbRaiseStatStage(PBStats::DEFENSE,(X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1,battler)
|
||||
battler.pokemon.changeHappiness("battleitem")
|
||||
})
|
||||
|
||||
@@ -571,7 +571,7 @@ ItemHandlers::BattleUseOnBattler.add(:XDEFENSE6,proc { |item,battler,scene|
|
||||
ItemHandlers::BattleUseOnBattler.copy(:XDEFENSE6,:XDEFEND6)
|
||||
|
||||
ItemHandlers::BattleUseOnBattler.add(:XSPATK,proc { |item,battler,scene|
|
||||
battler.pbRaiseStatStage(PBStats::SPATK,(NEWEST_BATTLE_MECHANICS) ? 2 : 1,battler)
|
||||
battler.pbRaiseStatStage(PBStats::SPATK,(X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1,battler)
|
||||
battler.pokemon.changeHappiness("battleitem")
|
||||
})
|
||||
|
||||
@@ -599,7 +599,7 @@ ItemHandlers::BattleUseOnBattler.add(:XSPATK6,proc { |item,battler,scene|
|
||||
ItemHandlers::BattleUseOnBattler.copy(:XSPATK6,:XSPECIAL6)
|
||||
|
||||
ItemHandlers::BattleUseOnBattler.add(:XSPDEF,proc { |item,battler,scene|
|
||||
battler.pbRaiseStatStage(PBStats::SPDEF,(NEWEST_BATTLE_MECHANICS) ? 2 : 1,battler)
|
||||
battler.pbRaiseStatStage(PBStats::SPDEF,(X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1,battler)
|
||||
battler.pokemon.changeHappiness("battleitem")
|
||||
})
|
||||
|
||||
@@ -619,7 +619,7 @@ ItemHandlers::BattleUseOnBattler.add(:XSPDEF6,proc { |item,battler,scene|
|
||||
})
|
||||
|
||||
ItemHandlers::BattleUseOnBattler.add(:XSPEED,proc { |item,battler,scene|
|
||||
battler.pbRaiseStatStage(PBStats::SPEED,(NEWEST_BATTLE_MECHANICS) ? 2 : 1,battler)
|
||||
battler.pbRaiseStatStage(PBStats::SPEED,(X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1,battler)
|
||||
battler.pokemon.changeHappiness("battleitem")
|
||||
})
|
||||
|
||||
@@ -639,7 +639,7 @@ ItemHandlers::BattleUseOnBattler.add(:XSPEED6,proc { |item,battler,scene|
|
||||
})
|
||||
|
||||
ItemHandlers::BattleUseOnBattler.add(:XACCURACY,proc { |item,battler,scene|
|
||||
battler.pbRaiseStatStage(PBStats::ACCURACY,(NEWEST_BATTLE_MECHANICS) ? 2 : 1,battler)
|
||||
battler.pbRaiseStatStage(PBStats::ACCURACY,(X_STAT_ITEMS_RAISE_BY_TWO_STAGES) ? 2 : 1,battler)
|
||||
battler.pokemon.changeHappiness("battleitem")
|
||||
})
|
||||
|
||||
|
||||
@@ -39,122 +39,6 @@ class PokemonSystem
|
||||
def tilemap; return MAP_VIEW_MODE; end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Stores game options
|
||||
# Default options are at the top of script section SpriteWindow.
|
||||
#===============================================================================
|
||||
$SpeechFrames = [
|
||||
MessageConfig::TextSkinName, # Default: speech hgss 1
|
||||
"speech hgss 2",
|
||||
"speech hgss 3",
|
||||
"speech hgss 4",
|
||||
"speech hgss 5",
|
||||
"speech hgss 6",
|
||||
"speech hgss 7",
|
||||
"speech hgss 8",
|
||||
"speech hgss 9",
|
||||
"speech hgss 10",
|
||||
"speech hgss 11",
|
||||
"speech hgss 12",
|
||||
"speech hgss 13",
|
||||
"speech hgss 14",
|
||||
"speech hgss 15",
|
||||
"speech hgss 16",
|
||||
"speech hgss 17",
|
||||
"speech hgss 18",
|
||||
"speech hgss 19",
|
||||
"speech hgss 20",
|
||||
"speech pl 18"
|
||||
]
|
||||
|
||||
$TextFrames = [
|
||||
"Graphics/Windowskins/"+MessageConfig::ChoiceSkinName, # Default: choice 1
|
||||
"Graphics/Windowskins/choice 2",
|
||||
"Graphics/Windowskins/choice 3",
|
||||
"Graphics/Windowskins/choice 4",
|
||||
"Graphics/Windowskins/choice 5",
|
||||
"Graphics/Windowskins/choice 6",
|
||||
"Graphics/Windowskins/choice 7",
|
||||
"Graphics/Windowskins/choice 8",
|
||||
"Graphics/Windowskins/choice 9",
|
||||
"Graphics/Windowskins/choice 10",
|
||||
"Graphics/Windowskins/choice 11",
|
||||
"Graphics/Windowskins/choice 12",
|
||||
"Graphics/Windowskins/choice 13",
|
||||
"Graphics/Windowskins/choice 14",
|
||||
"Graphics/Windowskins/choice 15",
|
||||
"Graphics/Windowskins/choice 16",
|
||||
"Graphics/Windowskins/choice 17",
|
||||
"Graphics/Windowskins/choice 18",
|
||||
"Graphics/Windowskins/choice 19",
|
||||
"Graphics/Windowskins/choice 20",
|
||||
"Graphics/Windowskins/choice 21",
|
||||
"Graphics/Windowskins/choice 22",
|
||||
"Graphics/Windowskins/choice 23",
|
||||
"Graphics/Windowskins/choice 24",
|
||||
"Graphics/Windowskins/choice 25",
|
||||
"Graphics/Windowskins/choice 26",
|
||||
"Graphics/Windowskins/choice 27",
|
||||
"Graphics/Windowskins/choice 28"
|
||||
]
|
||||
|
||||
$VersionStyles = [
|
||||
[MessageConfig::FontName], # Default font style - Power Green/"Pokemon Emerald"
|
||||
["Power Red and Blue"],
|
||||
["Power Red and Green"],
|
||||
["Power Clear"]
|
||||
]
|
||||
|
||||
def pbSettingToTextSpeed(speed)
|
||||
case speed
|
||||
when 0 then return 2
|
||||
when 1 then return 1
|
||||
when 2 then return -2
|
||||
end
|
||||
return MessageConfig::TextSpeed || 1
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
#
|
||||
#===============================================================================
|
||||
module MessageConfig
|
||||
def self.pbDefaultSystemFrame
|
||||
begin
|
||||
return pbResolveBitmap($TextFrames[$PokemonSystem.frame]) || ""
|
||||
rescue
|
||||
return pbResolveBitmap("Graphics/Windowskins/"+MessageConfig::ChoiceSkinName) || ""
|
||||
end
|
||||
end
|
||||
|
||||
def self.pbDefaultSpeechFrame
|
||||
begin
|
||||
return pbResolveBitmap("Graphics/Windowskins/"+$SpeechFrames[$PokemonSystem.textskin]) || ""
|
||||
rescue
|
||||
return pbResolveBitmap("Graphics/Windowskins/"+MessageConfig::TextSkinName) || ""
|
||||
end
|
||||
end
|
||||
|
||||
def self.pbDefaultSystemFontName
|
||||
begin
|
||||
return MessageConfig.pbTryFonts($VersionStyles[$PokemonSystem.font][0],"Arial Narrow","Arial")
|
||||
rescue
|
||||
return MessageConfig.pbTryFonts(MessageConfig::FontName,"Arial Narrow","Arial")
|
||||
end
|
||||
end
|
||||
|
||||
def self.pbDefaultTextSpeed
|
||||
return pbSettingToTextSpeed(($PokemonSystem.textspeed rescue nil))
|
||||
end
|
||||
|
||||
def pbGetSystemTextSpeed
|
||||
begin
|
||||
return $PokemonSystem.textspeed
|
||||
rescue
|
||||
return (Graphics.frame_rate>40) ? 2 : 3
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
#
|
||||
#===============================================================================
|
||||
@@ -460,7 +344,7 @@ class PokemonOption_Scene
|
||||
proc { $PokemonSystem.textspeed },
|
||||
proc { |value|
|
||||
$PokemonSystem.textspeed = value
|
||||
MessageConfig.pbSetTextSpeed(pbSettingToTextSpeed(value))
|
||||
MessageConfig.pbSetTextSpeed(MessageConfig.pbSettingToTextSpeed(value))
|
||||
}
|
||||
),
|
||||
EnumOption.new(_INTL("Battle Effects"),[_INTL("On"),_INTL("Off")],
|
||||
|
||||
@@ -646,22 +646,20 @@ def pbItemEditor
|
||||
[_INTL("Description"), StringProperty, _INTL("Description of the item")],
|
||||
[_INTL("Use Out of Battle"), EnumProperty.new([
|
||||
_INTL("Can't Use"), _INTL("On a Pokémon"), _INTL("Use directly"),
|
||||
_INTL("TM"), _INTL("HM"), _INTL("On a Pokémon reusable")]),
|
||||
_INTL("Specifies how this item can be used outside of battle.")],
|
||||
_INTL("TM"), _INTL("HM"), _INTL("On a Pokémon reusable"),
|
||||
_INTL("TR")]), _INTL("Specifies how this item can be used outside of battle.")],
|
||||
[_INTL("Use In Battle"), EnumProperty.new([
|
||||
_INTL("Can't Use"), _INTL("On a Pokémon"), _INTL("On Pokémon's move"),
|
||||
_INTL("On battler"), _INTL("On foe battler"), _INTL("Use directly"),
|
||||
_INTL("On a Pokémon reusable"), _INTL("On Pokémon's move reusable"),
|
||||
_INTL("On battler reusable"), _INTL("On foe battler reusable"),
|
||||
_INTL("Use directly reusable")]),
|
||||
_INTL("Specifies how this item can be used within a battle.")],
|
||||
_INTL("Use directly reusable")]), _INTL("Specifies how this item can be used within a battle.")],
|
||||
[_INTL("Special Items"), EnumProperty.new([
|
||||
_INTL("None of below"), _INTL("Mail"), _INTL("Mail with Pictures"),
|
||||
_INTL("Snag Ball"), _INTL("Poké Ball"), _INTL("Plantable Berry"),
|
||||
_INTL("Key Item"), _INTL("Evolution Stone"), _INTL("Fossil"),
|
||||
_INTL("Apricorn"), _INTL("Type-boosting Gem"), _INTL("Mulch"),
|
||||
_INTL("Mega Stone")]),
|
||||
_INTL("For special kinds of items.")],
|
||||
_INTL("Mega Stone")]), _INTL("For special kinds of items.")],
|
||||
[_INTL("Machine"), MoveProperty, _INTL("Move taught by this TM or HM.")]
|
||||
]
|
||||
pbListScreenBlock(_INTL("Items"), ItemLister.new(selection, true)) { |button, item|
|
||||
|
||||
Reference in New Issue
Block a user