Added Debug function to edit Repel steps, Flash/Strength usage and Black/White Flute effects; split old and new Black/White Flute effects

This commit is contained in:
Maruno17
2023-05-05 20:17:07 +01:00
parent 48fb8dae73
commit 72469bbf79
6 changed files with 146 additions and 41 deletions

View File

@@ -120,11 +120,12 @@ class PokemonEncounters
encounter_chance += @chance_accumulator / 200
encounter_chance *= 0.8 if $PokemonGlobal.bicycle
end
if !Settings::FLUTES_CHANGE_WILD_ENCOUNTER_LEVELS
encounter_chance /= 2 if $PokemonMap.blackFluteUsed
min_steps_needed *= 2 if $PokemonMap.blackFluteUsed
encounter_chance *= 1.5 if $PokemonMap.whiteFluteUsed
min_steps_needed /= 2 if $PokemonMap.whiteFluteUsed
if $PokemonMap.lower_encounter_rate
encounter_chance /= 2
min_steps_needed *= 2
elsif $PokemonMap.higher_encounter_rate
encounter_chance *= 1.5
min_steps_needed /= 2
end
first_pkmn = $player.first_pokemon
if first_pkmn
@@ -333,12 +334,10 @@ class PokemonEncounters
end
end
# Black Flute and White Flute alter the level of the wild Pokémon
if Settings::FLUTES_CHANGE_WILD_ENCOUNTER_LEVELS
if $PokemonMap.blackFluteUsed
level = [level + rand(1..4), GameData::GrowthRate.max_level].min
elsif $PokemonMap.whiteFluteUsed
level = [level - rand(1..4), 1].max
end
if $PokemonMap.lower_level_wild_pokemon
level = [level - rand(1..4), 1].max
elsif $PokemonMap.higher_level_wild_pokemon
level = [level + rand(1..4), GameData::GrowthRate.max_level].min
end
# Return [species, level]
return [encounter[1], level]

View File

@@ -121,22 +121,26 @@ end
# variables that should remain valid only for the current map.
#===============================================================================
class PokemonMapMetadata
attr_reader :erasedEvents
attr_reader :movedEvents
attr_reader :erasedEvents
attr_reader :movedEvents
attr_accessor :strengthUsed
attr_accessor :blackFluteUsed
attr_accessor :whiteFluteUsed
attr_accessor :lower_encounter_rate # Black Flute's old effect
attr_accessor :higher_encounter_rate # White Flute's old effect
attr_accessor :lower_level_wild_pokemon # White Flute's new effect
attr_accessor :higher_level_wild_pokemon # Black Flute's new effect
def initialize
clear
end
def clear
@erasedEvents = {}
@movedEvents = {}
@strengthUsed = false
@blackFluteUsed = false
@whiteFluteUsed = false
@erasedEvents = {}
@movedEvents = {}
@strengthUsed = false
@lower_encounter_rate = false # Takes priority over @higher_encounter_rate
@higher_encounter_rate = false
@lower_level_wild_pokemon = false # Takes priority over @higher_level_wild_pokemon
@higher_level_wild_pokemon = false
end
def addErasedEvent(eventID)
@@ -145,8 +149,8 @@ class PokemonMapMetadata
end
def addMovedEvent(eventID)
key = [$game_map.map_id, eventID]
event = $game_map.events[eventID] if eventID.is_a?(Integer)
key = [$game_map.map_id, eventID]
event = $game_map.events[eventID] if eventID.is_a?(Integer)
@movedEvents[key] = [event.x, event.y, event.direction, event.through] if event
end