Capitalisation of some constants

This commit is contained in:
Maruno17
2020-10-17 01:18:01 +01:00
parent 22c48b98d9
commit 7640736188
3 changed files with 16 additions and 16 deletions

View File

@@ -249,7 +249,7 @@ DEXES_WITH_OFFSETS = []
# - Name of BGM to play for that encounter (optional). # - Name of BGM to play for that encounter (optional).
# - Roaming areas specifically for this Pokémon (optional). # - Roaming areas specifically for this Pokémon (optional).
#=============================================================================== #===============================================================================
RoamingAreas = { ROAMING_AREAS = {
5 => [ 21, 28, 31, 39, 41, 44, 47, 66, 69], 5 => [ 21, 28, 31, 39, 41, 44, 47, 66, 69],
21 => [5, 28, 31, 39, 41, 44, 47, 66, 69], 21 => [5, 28, 31, 39, 41, 44, 47, 66, 69],
28 => [5, 21, 31, 39, 41, 44, 47, 66, 69], 28 => [5, 21, 31, 39, 41, 44, 47, 66, 69],
@@ -261,7 +261,7 @@ RoamingAreas = {
66 => [5, 21, 28, 31, 39, 41, 44, 47, 69], 66 => [5, 21, 28, 31, 39, 41, 44, 47, 69],
69 => [5, 21, 28, 31, 39, 41, 44, 47, 66 ] 69 => [5, 21, 28, 31, 39, 41, 44, 47, 66 ]
} }
RoamingSpecies = [ ROAMING_SPECIES = [
[:LATIAS, 30, 53, 0, "Battle roaming"], [:LATIAS, 30, 53, 0, "Battle roaming"],
[:LATIOS, 30, 53, 0, "Battle roaming"], [:LATIOS, 30, 53, 0, "Battle roaming"],
[:KYOGRE, 40, 54, 2, nil, { [:KYOGRE, 40, 54, 2, nil, {

View File

@@ -27,9 +27,9 @@ end
# Gets the roaming areas for a particular Pokémon. # Gets the roaming areas for a particular Pokémon.
def pbRoamingAreas(idxRoamer) def pbRoamingAreas(idxRoamer)
# [species symbol, level, Game Switch, encounter type, battle BGM, area maps hash] # [species symbol, level, Game Switch, encounter type, battle BGM, area maps hash]
roamData = RoamingSpecies[idxRoamer] roamData = ROAMING_SPECIES[idxRoamer]
return roamData[5] if roamData && roamData[5] return roamData[5] if roamData && roamData[5]
return RoamingAreas return ROAMING_AREAS
end end
# Puts a roamer in a completely random map available to it. # Puts a roamer in a completely random map available to it.
@@ -45,15 +45,15 @@ def pbRoamPokemon
# Start all roamers off in random maps # Start all roamers off in random maps
if !$PokemonGlobal.roamPosition if !$PokemonGlobal.roamPosition
$PokemonGlobal.roamPosition = {} $PokemonGlobal.roamPosition = {}
for i in 0...RoamingSpecies.length for i in 0...ROAMING_SPECIES.length
species = getID(PBSpecies,RoamingSpecies[i][0]) species = getID(PBSpecies,ROAMING_SPECIES[i][0])
next if !species || species<=0 next if !species || species<=0
keys = pbRoamingAreas(i).keys keys = pbRoamingAreas(i).keys
$PokemonGlobal.roamPosition[i] = keys[rand(keys.length)] $PokemonGlobal.roamPosition[i] = keys[rand(keys.length)]
end end
end end
# Roam each Pokémon in turn # Roam each Pokémon in turn
for i in 0...RoamingSpecies.length for i in 0...ROAMING_SPECIES.length
pbRoamPokemonOne(i) pbRoamPokemonOne(i)
end end
end end
@@ -62,7 +62,7 @@ end
# currently possible to encounter it (i.e. its Game Switch is off). # currently possible to encounter it (i.e. its Game Switch is off).
def pbRoamPokemonOne(idxRoamer) def pbRoamPokemonOne(idxRoamer)
# [species symbol, level, Game Switch, encounter type, battle BGM, area maps hash] # [species symbol, level, Game Switch, encounter type, battle BGM, area maps hash]
roamData = RoamingSpecies[idxRoamer] roamData = ROAMING_SPECIES[idxRoamer]
return if roamData[2]>0 && !$game_switches[roamData[2]] # Game Switch is off return if roamData[2]>0 && !$game_switches[roamData[2]] # Game Switch is off
# Ensure species is a number rather than a string/symbol # Ensure species is a number rather than a string/symbol
species = getID(PBSpecies,roamData[0]) species = getID(PBSpecies,roamData[0])
@@ -162,9 +162,9 @@ EncounterModifier.register(proc { |encounter|
# Look at each roaming Pokémon in turn and decide whether it's possible to # Look at each roaming Pokémon in turn and decide whether it's possible to
# encounter it # encounter it
roamerChoices = [] roamerChoices = []
for i in 0...RoamingSpecies.length for i in 0...ROAMING_SPECIES.length
# [species symbol, level, Game Switch, encounter type, battle BGM, area maps hash] # [species symbol, level, Game Switch, encounter type, battle BGM, area maps hash]
roamData = RoamingSpecies[i] roamData = ROAMING_SPECIES[i]
next if roamData[2]>0 && !$game_switches[roamData[2]] # Game Switch is off next if roamData[2]>0 && !$game_switches[roamData[2]] # Game Switch is off
next if $PokemonGlobal.roamPokemon[i]==true # Roaming Pokémon has been caught next if $PokemonGlobal.roamPokemon[i]==true # Roaming Pokémon has been caught
# Ensure species is a number rather than a string/symbol # Ensure species is a number rather than a string/symbol

View File

@@ -361,7 +361,7 @@ class SpriteWindow_DebugRoamers < Window_DrawableCommand
end end
def roamerCount def roamerCount
return RoamingSpecies.length return ROAMING_SPECIES.length
end end
def itemCount def itemCount
@@ -392,7 +392,7 @@ class SpriteWindow_DebugRoamers < Window_DrawableCommand
# Advance roaming # Advance roaming
self.shadowtext(_INTL("[Clear all current roamer locations]"),rect.x,rect.y,nameWidth,rect.height) self.shadowtext(_INTL("[Clear all current roamer locations]"),rect.x,rect.y,nameWidth,rect.height)
else else
pkmn = RoamingSpecies[index] pkmn = ROAMING_SPECIES[index]
name = PBSpecies.getName(getID(PBSpecies,pkmn[0]))+" (Lv. #{pkmn[1]})" name = PBSpecies.getName(getID(PBSpecies,pkmn[0]))+" (Lv. #{pkmn[1]})"
status = "" status = ""
statuscolor = 0 statuscolor = 0
@@ -467,7 +467,7 @@ def pbDebugRoamers
if cmdwindow.index<cmdwindow.roamerCount if cmdwindow.index<cmdwindow.roamerCount
pbPlayDecisionSE pbPlayDecisionSE
# Toggle through roaming, not roaming, defeated # Toggle through roaming, not roaming, defeated
pkmn = RoamingSpecies[cmdwindow.index] pkmn = ROAMING_SPECIES[cmdwindow.index]
if pkmn[2]>0 && !$game_switches[pkmn[2]] if pkmn[2]>0 && !$game_switches[pkmn[2]]
# not roaming -> roaming # not roaming -> roaming
$game_switches[pkmn[2]] = true $game_switches[pkmn[2]] = true
@@ -487,7 +487,7 @@ def pbDebugRoamers
end end
cmdwindow.refresh cmdwindow.refresh
elsif cmdwindow.index==cmdwindow.itemCount-2 # All roam elsif cmdwindow.index==cmdwindow.itemCount-2 # All roam
if RoamingSpecies.length==0 if ROAMING_SPECIES.length==0
pbPlayBuzzerSE pbPlayBuzzerSE
else else
pbPlayDecisionSE pbPlayDecisionSE
@@ -496,11 +496,11 @@ def pbDebugRoamers
cmdwindow.refresh cmdwindow.refresh
end end
else # Clear all roaming locations else # Clear all roaming locations
if RoamingSpecies.length==0 if ROAMING_SPECIES.length==0
pbPlayBuzzerSE pbPlayBuzzerSE
else else
pbPlayDecisionSE pbPlayDecisionSE
for i in 0...RoamingSpecies.length for i in 0...ROAMING_SPECIES.length
$PokemonGlobal.roamPosition[i] = nil $PokemonGlobal.roamPosition[i] = nil
end end
$PokemonGlobal.roamedAlready = false $PokemonGlobal.roamedAlready = false