Renamed some constants

This commit is contained in:
infinitefusion
2022-04-30 17:22:44 -04:00
parent 9d73e88afd
commit 2a76ee27e9
18 changed files with 120 additions and 107 deletions

View File

@@ -56,7 +56,7 @@ class Game_Player < Game_Character
self.move_speed = 4 # Sliding on ice self.move_speed = 4 # Sliding on ice
elsif !moving? && !@move_route_forcing && $PokemonGlobal elsif !moving? && !@move_route_forcing && $PokemonGlobal
if $PokemonGlobal.bicycle if $PokemonGlobal.bicycle
self.move_speed = $game_switches[RACE_BIKE] ? 5.5 : 5 # Cycling self.move_speed = $game_switches[SWITCH_RACE_BIKE] ? 5.5 : 5 # Cycling
elsif pbCanRun? || $PokemonGlobal.surfing elsif pbCanRun? || $PokemonGlobal.surfing
self.move_speed = 4 # Running, surfing self.move_speed = 4 # Running, surfing
else else

View File

@@ -421,7 +421,7 @@ def pbDisplayGoldWindow(msgwindow)
end end
def pbDisplayBattleFactoryPointsWindow(msgwindow) def pbDisplayBattleFactoryPointsWindow(msgwindow)
pbDisplayVariableWindow(msgwindow,"Tokens",BATTLE_FACTORY_TOKENS) pbDisplayVariableWindow(msgwindow, "Tokens", VAR_BATTLE_FACTORY_TOKENS)
end end
@@ -728,7 +728,7 @@ def pbMessageDisplay(msgwindow, message, letterbyletter = true, commandProc = ni
head = getBasePokemonID(param.to_i, false) head = getBasePokemonID(param.to_i, false)
body = getBasePokemonID(param.to_i, true) body = getBasePokemonID(param.to_i, true)
facewindow.dispose if facewindow facewindow.dispose if facewindow
path = obtainPokemonSpritePath(body, head, $game_variables[CUSTOM_SPRITES_ENABLED] == 0) path = obtainPokemonSpritePath(body, head, $game_variables[VAR_CUSTOM_SPRITES_ENABLED] == 0)
facewindow = isFusion ? PictureWindow.new(path) : PictureWindow.new("Graphics/Battlers/#{head}/#{head}.png") facewindow = isFusion ? PictureWindow.new(path) : PictureWindow.new("Graphics/Battlers/#{head}/#{head}.png")
pbPositionNearMsgWindow(facewindow, msgwindow, :left) pbPositionNearMsgWindow(facewindow, msgwindow, :left)
facewindow.viewport = msgwindow.viewport facewindow.viewport = msgwindow.viewport
@@ -885,8 +885,8 @@ end
def pbShowCommands(msgwindow, commands = nil, cmdIfCancel = 0, defaultCmd = 0) def pbShowCommands(msgwindow, commands = nil, cmdIfCancel = 0, defaultCmd = 0)
return 0 if !commands return 0 if !commands
if defaultCmd == 0 && $game_variables[COMMAND_WINDOW_INDEX] != 0 if defaultCmd == 0 && $game_variables[VAR_COMMAND_WINDOW_INDEX] != 0
defaultCmd = $game_variables[COMMAND_WINDOW_INDEX] defaultCmd = $game_variables[VAR_COMMAND_WINDOW_INDEX]
end end
cmdwindow = Window_CommandPokemonEx.new(commands) cmdwindow = Window_CommandPokemonEx.new(commands)
cmdwindow.z = 99999 cmdwindow.z = 99999

View File

@@ -112,12 +112,12 @@ module GameData
def replaceSingleSpeciesModeIfApplicable(species) def replaceSingleSpeciesModeIfApplicable(species)
if $game_switches[SINGLE_POKEMON_MODE_SWITCH] if $game_switches[SWITCH_SINGLE_POKEMON_MODE]
if $game_switches[SINGLE_POKEMON_MODE_HEAD_SWITCH] if $game_switches[SWITCH_SINGLE_POKEMON_MODE_HEAD]
return replaceFusionsHeadWithSpecies(species) return replaceFusionsHeadWithSpecies(species)
elsif $game_switches[SINGLE_POKEMON_MODE_BODY_SWITCH] elsif $game_switches[SWITCH_SINGLE_POKEMON_MODE_BODY]
return replaceFusionsBodyWithSpecies(species) return replaceFusionsBodyWithSpecies(species)
elsif $game_switches[SINGLE_POKEMON_MODE_RANDOM_SWITCH] elsif $game_switches[SWITCH_SINGLE_POKEMON_MODE_RANDOM]
if(rand(2) == 0) if(rand(2) == 0)
return replaceFusionsHeadWithSpecies(species) return replaceFusionsHeadWithSpecies(species)
else else
@@ -132,7 +132,7 @@ module GameData
speciesId = getDexNumberForSpecies(species) speciesId = getDexNumberForSpecies(species)
if speciesId > NB_POKEMON if speciesId > NB_POKEMON
bodyPoke = getBodyID(speciesId) bodyPoke = getBodyID(speciesId)
headPoke = pbGet(SINGLE_POKEMON_MODE_VAR) headPoke = pbGet(VAR_SINGLE_POKEMON_MODE)
newSpecies = bodyPoke*NB_POKEMON+headPoke newSpecies = bodyPoke*NB_POKEMON+headPoke
return getPokemon(newSpecies) return getPokemon(newSpecies)
end end
@@ -142,7 +142,7 @@ module GameData
def replaceFusionsBodyWithSpecies(species) def replaceFusionsBodyWithSpecies(species)
speciesId = getDexNumberForSpecies(species) speciesId = getDexNumberForSpecies(species)
if speciesId > NB_POKEMON if speciesId > NB_POKEMON
bodyPoke = pbGet(SINGLE_POKEMON_MODE_VAR) bodyPoke = pbGet(VAR_SINGLE_POKEMON_MODE)
headPoke = getHeadID(species) headPoke = getHeadID(species)
newSpecies = bodyPoke*NB_POKEMON+headPoke newSpecies = bodyPoke*NB_POKEMON+headPoke
return getPokemon(newSpecies) return getPokemon(newSpecies)
@@ -168,7 +168,7 @@ module GameData
trainer.items = @items.clone trainer.items = @items.clone
trainer.lose_text = self.lose_text trainer.lose_text = self.lose_text
isRematch = $game_switches[IS_REMATCH_SWITCH] isRematch = $game_switches[SWITCH_IS_REMATCH]
rematchId = getRematchId(trainer.name, trainer.trainer_type) rematchId = getRematchId(trainer.name, trainer.trainer_type)
# Create each Pokémon owned by the trainer # Create each Pokémon owned by the trainer
@@ -179,11 +179,11 @@ module GameData
species = replace_species_with_placeholder(species) species = replace_species_with_placeholder(species)
end end
species = replaceSingleSpeciesModeIfApplicable(species) species = replaceSingleSpeciesModeIfApplicable(species)
if $game_switches[REVERSED_MODE] if $game_switches[SWITCH_REVERSED_MODE]
species = reverseFusionSpecies(species) species = reverseFusionSpecies(species)
end end
level = pkmn_data[:level] level = pkmn_data[:level]
if $game_switches[GAME_DIFFICULTY_HARD] if $game_switches[SWITCH_GAME_DIFFICULTY_HARD]
level = (level * Settings::HARD_MODE_LEVEL_MODIFIER).ceil level = (level * Settings::HARD_MODE_LEVEL_MODIFIER).ceil
if level > Settings::MAXIMUM_LEVEL if level > Settings::MAXIMUM_LEVEL
level = Settings::MAXIMUM_LEVEL level = Settings::MAXIMUM_LEVEL

View File

@@ -83,9 +83,9 @@ class PokeBattle_Battler
def updateSpirits() def updateSpirits()
if $PokemonBag.pbQuantity(:ODDKEYSTONE)>=1 && @pokemon.hasType?(:GHOST) if $PokemonBag.pbQuantity(:ODDKEYSTONE)>=1 && @pokemon.hasType?(:GHOST)
nbSpirits = pbGet(ODDKEYSTONE_NB_VARIABLE) nbSpirits = pbGet(VAR_ODDKEYSTONE_NB)
if nbSpirits < 108 if nbSpirits < 108
pbSet(ODDKEYSTONE_NB_VARIABLE,nbSpirits+1) pbSet(VAR_ODDKEYSTONE_NB, nbSpirits+1)
end end
end end
end end

View File

@@ -337,7 +337,7 @@ class PokeBattle_Battle
# End of battle # End of battle
#============================================================================= #=============================================================================
def pbGainMoney def pbGainMoney
return if $game_switches[IS_REMATCH_SWITCH] #is rematch return if $game_switches[SWITCH_IS_REMATCH] #is rematch
return if !@internalBattle || !@moneyGain return if !@internalBattle || !@moneyGain
# Money rewarded from opposing trainers # Money rewarded from opposing trainers
if trainerBattle? if trainerBattle?
@@ -455,7 +455,7 @@ class PokeBattle_Battle
# Register captured Pokémon in the Pokédex, and store them # Register captured Pokémon in the Pokédex, and store them
pbRecordAndStoreCaughtPokemon pbRecordAndStoreCaughtPokemon
isRematch = $game_switches[IS_REMATCH_SWITCH] isRematch = $game_switches[SWITCH_IS_REMATCH]
begin begin
if isRematch if isRematch
if @opponent.is_a?(Array) if @opponent.is_a?(Array)
@@ -469,7 +469,7 @@ class PokeBattle_Battle
end end
end end
rescue rescue
$game_switches[IS_REMATCH_SWITCH]=false $game_switches[SWITCH_IS_REMATCH]=false
end end

View File

@@ -8,7 +8,7 @@ class PokeBattle_Battle
return if !@internalBattle || !@expGain return if !@internalBattle || !@expGain
# Go through each battler in turn to find the Pokémon that participated in # Go through each battler in turn to find the Pokémon that participated in
# battle against it, and award those Pokémon Exp/EVs # battle against it, and award those Pokémon Exp/EVs
expAll = (GameData::Item.exists?(:EXPALL) && $PokemonBag.pbHasItem?(:EXPALL)) || $game_switches[GAME_DIFFICULTY_EASY] expAll = (GameData::Item.exists?(:EXPALL) && $PokemonBag.pbHasItem?(:EXPALL)) || $game_switches[SWITCH_GAME_DIFFICULTY_EASY]
p1 = pbParty(0) p1 = pbParty(0)
@battlers.each do |b| @battlers.each do |b|
next unless b && b.opposes? # Can only gain Exp from fainted foes next unless b && b.opposes? # Can only gain Exp from fainted foes

View File

@@ -174,7 +174,7 @@ class PokeBattle_Battle
end end
switchMessageHard = _INTL("{1} is about to send in a new Pokémon. Will you switch your Pokémon?", opponent.fullname) switchMessageHard = _INTL("{1} is about to send in a new Pokémon. Will you switch your Pokémon?", opponent.fullname)
switchMessageNormal = _INTL("{1} is about to send in {2}. Will you switch your Pokémon?", opponent.full_name, enemyParty[idxPartyForName].name) switchMessageNormal = _INTL("{1} is about to send in {2}. Will you switch your Pokémon?", opponent.full_name, enemyParty[idxPartyForName].name)
switchMessage = $game_switches[GAME_DIFFICULTY_HARD] ? switchMessageHard : switchMessageNormal switchMessage = $game_switches[SWITCH_GAME_DIFFICULTY_HARD] ? switchMessageHard : switchMessageNormal
if pbDisplayConfirm(switchMessage) if pbDisplayConfirm(switchMessage)
idxPlayerPartyNew = pbSwitchInBetween(0, false, true) idxPlayerPartyNew = pbSwitchInBetween(0, false, true)
if idxPlayerPartyNew >= 0 if idxPlayerPartyNew >= 0

View File

@@ -161,7 +161,7 @@ Events.onStepTakenFieldMovement += proc { |_sender, e|
} }
def isRepelActive() def isRepelActive()
return false if $game_switches[USED_AN_INCENSE_SWITCH] return false if $game_switches[SWITCH_USED_AN_INCENSE]
return ($PokemonGlobal.repel > 0) || $PokemonTemp.pokeradar return ($PokemonGlobal.repel > 0) || $PokemonTemp.pokeradar
end end
@@ -191,15 +191,15 @@ Events.onChangeDirection += proc {
} }
def isFusionForced? def isFusionForced?
return false if $game_switches[RANDOMIZED_WILD_POKEMON_SWITCH] return false if $game_switches[SWITCH_RANDOMIZED_WILD_POKEMON]
return $game_switches[FORCE_FUSE_NEXT_POKEMON_SWITCH] || $game_switches[FORCE_ALL_WILD_FUSIONS_SWITCH] return $game_switches[SWITCH_FORCE_FUSE_NEXT_POKEMON] || $game_switches[SWITCH_FORCE_ALL_WILD_FUSIONS]
end end
def isFusedEncounter def isFusedEncounter
return false if !FUSED_WILD_POKEMON_SWITCH[35] return false if !SWITCH_FUSED_WILD_POKEMON[35]
return false if $game_switches[RANDOMIZED_WILD_POKEMON_SWITCH] return false if $game_switches[SWITCH_RANDOMIZED_WILD_POKEMON]
return true if isFusionForced?() return true if isFusionForced?()
chance = pbGet(WILD_FUSION_RATE_VAR) == 0 ? 5 : pbGet(WILD_FUSION_RATE_VAR) chance = pbGet(VAR_WILD_FUSION_RATE) == 0 ? 5 : pbGet(VAR_WILD_FUSION_RATE)
return (rand(chance) == 0) return (rand(chance) == 0)
end end
@@ -217,7 +217,7 @@ def pbBattleOnStepTaken(repel_active)
encounter[0] = getFusionSpecies(encounter[0], encounter_fusedWith[0]) encounter[0] = getFusionSpecies(encounter[0], encounter_fusedWith[0])
end end
end end
$game_switches[FORCE_FUSE_NEXT_POKEMON_SWITCH] = false $game_switches[SWITCH_FORCE_FUSE_NEXT_POKEMON] = false
encounter = EncounterModifier.trigger(encounter) encounter = EncounterModifier.trigger(encounter)
if $PokemonEncounters.allow_encounter?(encounter, repel_active) if $PokemonEncounters.allow_encounter?(encounter, repel_active)

View File

@@ -120,7 +120,7 @@ end
def pbPrepareBattle(battle) def pbPrepareBattle(battle)
battleRules = $PokemonTemp.battleRules battleRules = $PokemonTemp.battleRules
# The size of the battle, i.e. how many Pokémon on each side (default: "single") # The size of the battle, i.e. how many Pokémon on each side (default: "single")
battle.setBattleMode(battleRules["size"]) if !battleRules["size"].nil? || $game_switches[NEW_GAME_PLUS] battle.setBattleMode(battleRules["size"]) if !battleRules["size"].nil? || $game_switches[SWITCH_NEW_GAME_PLUS]
# Whether the game won't black out even if the player loses (default: false) # Whether the game won't black out even if the player loses (default: false)
battle.canLose = battleRules["canLose"] if !battleRules["canLose"].nil? battle.canLose = battleRules["canLose"] if !battleRules["canLose"].nil?
# Whether the player can choose to run from the battle (default: true) # Whether the player can choose to run from the battle (default: true)

View File

@@ -42,7 +42,7 @@ def pbFishingEnd
end end
def pbFishing(hasEncounter,rodType=1) def pbFishing(hasEncounter,rodType=1)
autohook= Settings::FISHING_AUTO_HOOK || $game_switches[FISHING_AUTOHOOK_SWITCH] autohook= Settings::FISHING_AUTO_HOOK || $game_switches[SWITCH_FISHING_AUTOHOOK]
speedup = ($Trainer.first_pokemon && [:STICKYHOLD, :SUCTIONCUPS].include?($Trainer.first_pokemon.ability_id)) speedup = ($Trainer.first_pokemon && [:STICKYHOLD, :SUCTIONCUPS].include?($Trainer.first_pokemon.ability_id))
biteChance = 20+(25*rodType) # 45, 70, 95 biteChance = 20+(25*rodType) # 45, 70, 95
biteChance *= 1.5 if speedup # 67.5, 100, 100 biteChance *= 1.5 if speedup # 67.5, 100, 100
@@ -133,7 +133,7 @@ end
# A Pokémon is biting, reflex test to reel it in # A Pokémon is biting, reflex test to reel it in
def pbWaitForInput(msgWindow,message,frames) def pbWaitForInput(msgWindow,message,frames)
autohook= Settings::FISHING_AUTO_HOOK || $game_switches[FISHING_AUTOHOOK_SWITCH] autohook= Settings::FISHING_AUTO_HOOK || $game_switches[SWITCH_FISHING_AUTOHOOK]
pbMessageDisplay(msgWindow,message,false) pbMessageDisplay(msgWindow,message,false)
numFrame = 0 numFrame = 0
twitchFrame = 0 twitchFrame = 0

View File

@@ -87,7 +87,7 @@ ItemHandlers::ConfirmUseInField.add(:ESCAPEROPE, proc { |item|
#=============================================================================== #===============================================================================
def pbRepel(item, steps) def pbRepel(item, steps)
message = $game_switches[USED_AN_INCENSE_SWITCH] ? "But an incense's effect still lingers from earlier." : "But a repellent's effect still lingers from earlier." message = $game_switches[SWITCH_USED_AN_INCENSE] ? "But an incense's effect still lingers from earlier." : "But a repellent's effect still lingers from earlier."
if $PokemonGlobal.repel > 0 if $PokemonGlobal.repel > 0
pbMessage(_INTL(message)) pbMessage(_INTL(message))
return 0 return 0
@@ -99,8 +99,8 @@ end
ItemHandlers::UseInField.add(:FUSIONREPEL, proc { |item| ItemHandlers::UseInField.add(:FUSIONREPEL, proc { |item|
$game_switches[FORCE_ALL_WILD_FUSIONS_SWITCH] = true $game_switches[SWITCH_FORCE_ALL_WILD_FUSIONS] = true
$game_switches[USED_AN_INCENSE_SWITCH] = true $game_switches[SWITCH_USED_AN_INCENSE] = true
next pbRepel(item, 50) next pbRepel(item, 50)
}) })
@@ -120,9 +120,9 @@ Events.onStepTaken += proc {
if $PokemonGlobal.repel > 0 && !$game_player.terrain_tag.ice # Shouldn't count down if on ice if $PokemonGlobal.repel > 0 && !$game_player.terrain_tag.ice # Shouldn't count down if on ice
$PokemonGlobal.repel -= 1 $PokemonGlobal.repel -= 1
if $PokemonGlobal.repel <= 0 if $PokemonGlobal.repel <= 0
isIncense = $game_switches[USED_AN_INCENSE_SWITCH] isIncense = $game_switches[SWITCH_USED_AN_INCENSE]
$game_switches[FORCE_ALL_WILD_FUSIONS_SWITCH] = false $game_switches[SWITCH_FORCE_ALL_WILD_FUSIONS] = false
$game_switches[USED_AN_INCENSE_SWITCH] = false $game_switches[SWITCH_USED_AN_INCENSE] = false
itemName= isIncense ? "incense" : "repellent" itemName= isIncense ? "incense" : "repellent"
if $PokemonBag.pbHasItem?(:REPEL) || if $PokemonBag.pbHasItem?(:REPEL) ||
$PokemonBag.pbHasItem?(:SUPERREPEL) || $PokemonBag.pbHasItem?(:SUPERREPEL) ||

View File

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

View File

@@ -277,9 +277,9 @@ class HallOfFame_Scene
end end
def getDifficulty def getDifficulty
if $game_switches[GAME_DIFFICULTY_EASY] if $game_switches[SWITCH_GAME_DIFFICULTY_EASY]
return "Easy" return "Easy"
elsif $game_switches[GAME_DIFFICULTY_HARD] elsif $game_switches[SWITCH_GAME_DIFFICULTY_HARD]
return "Hard" return "Hard"
else else
return "Normal" return "Normal"

View File

@@ -18,7 +18,7 @@ class PokemonTrainerCard_Scene
end end
cardexists = pbResolveBitmap(sprintf("Graphics/Pictures/Trainer Card/card_f")) cardexists = pbResolveBitmap(sprintf("Graphics/Pictures/Trainer Card/card_f"))
@sprites["card"] = IconSprite.new(0,0,@viewport) @sprites["card"] = IconSprite.new(0,0,@viewport)
is_postgame = $game_switches[BEAT_THE_LEAGUE] is_postgame = $game_switches[SWITCH_BEAT_THE_LEAGUE]
if $Trainer.female? && cardexists if $Trainer.female? && cardexists
path = "Graphics/Pictures/Trainer Card/card_f" path = "Graphics/Pictures/Trainer Card/card_f"
if is_postgame if is_postgame
@@ -74,7 +74,7 @@ class PokemonTrainerCard_Scene
pbDrawTextPositions(overlay,textPositions) pbDrawTextPositions(overlay,textPositions)
x = 72 x = 72
imagePositions = [] imagePositions = []
postgame = $game_switches[BEAT_THE_LEAGUE] postgame = $game_switches[SWITCH_BEAT_THE_LEAGUE]
numberOfBadgesDisplayed = postgame ? 16 : 8 numberOfBadgesDisplayed = postgame ? 16 : 8
for i in 0...numberOfBadgesDisplayed for i in 0...numberOfBadgesDisplayed
badgeRow= i<8 ? 0 : 1 badgeRow= i<8 ? 0 : 1

View File

@@ -413,19 +413,19 @@ class PokemonOption_Scene
] ]
if $game_switches && ($game_switches[NEW_GAME_PLUS] || $game_switches[BEAT_THE_LEAGUE]) #beat the league if $game_switches && ($game_switches[SWITCH_NEW_GAME_PLUS] || $game_switches[SWITCH_BEAT_THE_LEAGUE]) #beat the league
options << options <<
EnumOption.new(_INTL("Battle type"), [_INTL("1v1"), _INTL("2v2"), _INTL("3v3")], EnumOption.new(_INTL("Battle type"), [_INTL("1v1"), _INTL("2v2"), _INTL("3v3")],
proc { $PokemonSystem.battle_type }, proc { $PokemonSystem.battle_type },
proc { |value| proc { |value|
if value == 0 if value == 0
$game_variables[DEFAULT_BATTLE_TYPE] = [1, 1] $game_variables[VAR_DEFAULT_BATTLE_TYPE] = [1, 1]
elsif value == 1 elsif value == 1
$game_variables[DEFAULT_BATTLE_TYPE] = [2, 2] $game_variables[VAR_DEFAULT_BATTLE_TYPE] = [2, 2]
elsif value == 2 elsif value == 2
$game_variables[DEFAULT_BATTLE_TYPE] = [3, 3] $game_variables[VAR_DEFAULT_BATTLE_TYPE] = [3, 3]
else else
$game_variables[DEFAULT_BATTLE_TYPE] = [1, 1] $game_variables[VAR_DEFAULT_BATTLE_TYPE] = [1, 1]
end end
$PokemonSystem.battle_type=value $PokemonSystem.battle_type=value
} }

View File

@@ -1,39 +1,6 @@
#Switches #############
NEW_GAME_PLUS = 972 # SETTINGS #
BEAT_MT_SILVER = 918 #############
REVERSED_MODE = 47
GAME_DIFFICULTY_EASY = 665
GAME_DIFFICULTY_HARD = 666
GOT_BADGE_1 = 4
GOT_BADGE_2 = 5
GOT_BADGE_3 = 6
GOT_BADGE_4 = 7
GOT_BADGE_5 = 8
GOT_BADGE_6 = 9
GOT_BADGE_7 = 10
GOT_BADGE_8 = 11
BEAT_THE_LEAGUE = 12
GOT_BADGE_9 = 38
GOT_BADGE_10 = 39
GOT_BADGE_11 = 40
GOT_BADGE_12 = 41
GOT_BADGE_13 = 43
GOT_BADGE_14 = 44
GOT_BADGE_15 = 45
GOT_BADGE_16 = 50
#Variables
DEFAULT_BATTLE_TYPE = 242
BATTLE_FACTORY_TOKENS = 243
NB_GYM_REMATCHES = 162
CUSTOM_SPRITES_ENABLED= 196
COMMAND_WINDOW_INDEX=249
STANDARD_WONDERTRADE_LEFT=248
PREMIUM_WONDERTRADE_LEFT=111
#Settings
# This is for settings that are used in scripts since it's a chore to change them everywhere to include the module name # This is for settings that are used in scripts since it's a chore to change them everywhere to include the module name
NUM_BADGES = Settings::NB_BADGES NUM_BADGES = Settings::NB_BADGES
EGGINITIALLEVEL = Settings::EGG_LEVEL EGGINITIALLEVEL = Settings::EGG_LEVEL
@@ -42,25 +9,71 @@ EGGINITIALLEVEL = Settings::EGG_LEVEL
FALSE = false FALSE = false
TRUE = true TRUE = true
#############
# SWITCHES #
#############
#Game mode switches
SWITCH_NEW_GAME_PLUS = 972
SWITCH_BEAT_MT_SILVER = 918
SWITCH_REVERSED_MODE = 47
SWITCH_GAME_DIFFICULTY_EASY = 665
SWITCH_GAME_DIFFICULTY_HARD = 666
#Game progression switches
SWITCH_GOT_BADGE_1 = 4
SWITCH_GOT_BADGE_2 = 5
SWITCH_GOT_BADGE_3 = 6
SWITCH_GOT_BADGE_4 = 7
SWITCH_GOT_BADGE_5 = 8
SWITCH_GOT_BADGE_6 = 9
SWITCH_GOT_BADGE_7 = 10
SWITCH_GOT_BADGE_8 = 11
SWITCH_BEAT_THE_LEAGUE = 12
SWITCH_GOT_BADGE_9 = 38
SWITCH_GOT_BADGE_10 = 39
SWITCH_GOT_BADGE_11 = 40
SWITCH_GOT_BADGE_12 = 41
SWITCH_GOT_BADGE_13 = 43
SWITCH_GOT_BADGE_14 = 44
SWITCH_GOT_BADGE_15 = 45
SWITCH_GOT_BADGE_16 = 50
#Randomizer Switches
SWITCH_RANDOMIZED_WILD_POKEMON=953
SWITCH_FUSED_WILD_POKEMON=35
SWITCH_FORCE_FUSE_NEXT_POKEMON=37
SWITCH_FORCE_ALL_WILD_FUSIONS=828
SWITCH_USED_AN_INCENSE=798
SWITCH_RANDOMIZED_AT_LEAST_ONCE = 855
#Random switches
SWITCH_RACE_BIKE = 984
SWITCH_IS_REMATCH=200
SWITCH_SINGLE_POKEMON_MODE=790
SWITCH_SINGLE_POKEMON_MODE_HEAD=791
SWITCH_SINGLE_POKEMON_MODE_BODY=792
SWITCH_SINGLE_POKEMON_MODE_RANDOM=793
SWITCH_FISHING_AUTOHOOK = 916
#############
# VARIABLES #
#############
VAR_SINGLE_POKEMON_MODE=251
VAR_WILD_FUSION_RATE=210
VAR_ODDKEYSTONE_NB=252
VAR_DEFAULT_BATTLE_TYPE = 242
VAR_BATTLE_FACTORY_TOKENS = 243
VAR_NB_GYM_REMATCHES = 162
VAR_CUSTOM_SPRITES_ENABLED= 196
VAR_COMMAND_WINDOW_INDEX=249
VAR_STANDARD_WONDERTRADE_LEFT=248
VAR_PREMIUM_WONDERTRADE_LEFT=111
#OTHERS
DIRECTION_LEFT = 4 DIRECTION_LEFT = 4
DIRECTION_RIGHT = 6 DIRECTION_RIGHT = 6
DIRECTION_DOWN = 2 DIRECTION_DOWN = 2
DIRECTION_UP = 8 DIRECTION_UP = 8
RACE_BIKE = 984
IS_REMATCH_SWITCH=200
SINGLE_POKEMON_MODE_SWITCH=790
SINGLE_POKEMON_MODE_VAR=251
SINGLE_POKEMON_MODE_HEAD_SWITCH=791
SINGLE_POKEMON_MODE_BODY_SWITCH=792
SINGLE_POKEMON_MODE_RANDOM_SWITCH=793
FISHING_AUTOHOOK_SWITCH = 916
ODDKEYSTONE_NB_VARIABLE=252
RANDOMIZED_WILD_POKEMON_SWITCH=953
FUSED_WILD_POKEMON_SWITCH=35
FORCE_FUSE_NEXT_POKEMON_SWITCH=37
FORCE_ALL_WILD_FUSIONS_SWITCH=828
USED_AN_INCENSE_SWITCH=798
WILD_FUSION_RATE_VAR=210

View File

@@ -376,7 +376,7 @@ ItemHandlers::UseFromBag.add(:DEBUGGER, proc { |item|
ItemHandlers::UseFromBag.add(:ODDKEYSTONE, proc { |item| ItemHandlers::UseFromBag.add(:ODDKEYSTONE, proc { |item|
TOTAL_SPIRITS_NEEDED = 108 TOTAL_SPIRITS_NEEDED = 108
nbSpirits = pbGet(ODDKEYSTONE_NB_VARIABLE) nbSpirits = pbGet(VAR_ODDKEYSTONE_NB)
if nbSpirits == 107 if nbSpirits == 107
Kernel.pbMessage(_INTL("The Odd Keystone appears to be moving on its own.")) Kernel.pbMessage(_INTL("The Odd Keystone appears to be moving on its own."))
Kernel.pbMessage(_INTL("Voices can be heard whispering from it...")) Kernel.pbMessage(_INTL("Voices can be heard whispering from it..."))
@@ -390,7 +390,7 @@ ItemHandlers::UseFromBag.add(:ODDKEYSTONE, proc { |item|
Kernel.pbMessage(_INTL("It seems as if some poweful energy is trying to escape from it.")) Kernel.pbMessage(_INTL("It seems as if some poweful energy is trying to escape from it."))
if (Kernel.pbMessage("Let it out?", ["No","Yes"], 0)) == 1 if (Kernel.pbMessage("Let it out?", ["No","Yes"], 0)) == 1
pbWildBattle(:SPIRITOMB,27) pbWildBattle(:SPIRITOMB,27)
pbSet(ODDKEYSTONE_NB_VARIABLE,0) pbSet(VAR_ODDKEYSTONE_NB, 0)
end end
next 1 next 1
end end

View File

@@ -94,7 +94,7 @@ def pbWonderTrade(lvl, except = [], except2 = [], premiumWonderTrade = true)
end end
if species > 0 if species > 0
skipLegendaryCheck = premiumWonderTrade && rand(100) < luck skipLegendaryCheck = premiumWonderTrade && rand(100) < luck
species = 0 if pokemonIsPartLegendary(species) && !$game_switches[BEAT_THE_LEAGUE] && !skipLegendaryCheck species = 0 if pokemonIsPartLegendary(species) && !$game_switches[SWITCH_BEAT_THE_LEAGUE] && !skipLegendaryCheck
end end
#Redo loop if below BST - 200 #Redo loop if below BST - 200
species = 0 if bst < (chosenBST - 200) species = 0 if bst < (chosenBST - 200)
@@ -117,9 +117,9 @@ def pbWonderTrade(lvl, except = [], except2 = [], premiumWonderTrade = true)
#num of Wondertrade - 1 #num of Wondertrade - 1
if premiumWonderTrade if premiumWonderTrade
$game_variables[PREMIUM_WONDERTRADE_LEFT] -= 1 $game_variables[VAR_PREMIUM_WONDERTRADE_LEFT] -= 1
else else
$game_variables[STANDARD_WONDERTRADE_LEFT] -= 1 $game_variables[VAR_STANDARD_WONDERTRADE_LEFT] -= 1
end end
newpoke = pbStartTrade(pbGet(1), species, pname, tname, 0, true) # Starts the trade newpoke = pbStartTrade(pbGet(1), species, pname, tname, 0, true) # Starts the trade