mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 14:14:59 +00:00
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:
@@ -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]
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user