Made the example wild encounter modifier that scales Pokémon levels to match the player's party depend on a map metadata flag instead of a map number

This commit is contained in:
Maruno17
2022-07-07 20:49:49 +01:00
parent b50ce948f6
commit 3314477f08
2 changed files with 2 additions and 2 deletions

View File

@@ -18,7 +18,7 @@ EventHandlers.add(:on_wild_pokemon_created, :make_shiny_switch,
# and other such details. Of course, you don't HAVE to use this code. # and other such details. Of course, you don't HAVE to use this code.
EventHandlers.add(:on_wild_pokemon_created, :level_depends_on_party, EventHandlers.add(:on_wild_pokemon_created, :level_depends_on_party,
proc { |pkmn| proc { |pkmn|
next if $game_map.map_id != 51 next if !$game_map.metadata&.has_flag?("ScaleWildEncounterLevels")
new_level = pbBalancedLevel($player.party) - 4 + rand(5) # For variety new_level = pbBalancedLevel($player.party) - 4 + rand(5) # For variety
new_level = new_level.clamp(1, GameData::GrowthRate.max_level) new_level = new_level.clamp(1, GameData::GrowthRate.max_level)
pkmn.level = new_level pkmn.level = new_level

View File

@@ -258,7 +258,7 @@ MapPosition = 0,16,10
Dungeon = true Dungeon = true
BattleBack = cave2 BattleBack = cave2
Environment = Cave Environment = Cave
Flags = Magnetic,DistortionWorld Flags = Magnetic,DistortionWorld,ScaleWildEncounterLevels
#------------------------------- #-------------------------------
[052] # Battle Frontier [052] # Battle Frontier
Name = Battle Frontier Name = Battle Frontier