Update 6.8

This commit is contained in:
chardub
2026-07-10 15:42:06 -04:00
parent 5b85e72cb2
commit 6a6f126a18
7871 changed files with 493194 additions and 224826 deletions
@@ -4,25 +4,26 @@ class PokemonEncounters
WEATHER_ENCOUNTER_BASE_CHANCE = 8 #/100 (for weather intensity of 0)
alias pokemonEssentials_PokemonEncounter_choose_wild_pokemon choose_wild_pokemon
ANIMATION_WEATHER_ENCOUNTER = 3
def choose_wild_pokemon(enc_type, *args)
return pokemonEssentials_PokemonEncounter_choose_wild_pokemon(enc_type, *args) if !$game_weather
current_weather_type = $game_weather.get_map_weather_type($game_map.map_id)
current_weather_intensity = $game_weather.get_map_weather_intensity($game_map.map_id)
if can_substitute_for_weather_encounter(enc_type, current_weather_type)
#Chance to replace the chosen by one in from the weather pool
# Chance to replace the chosen by one in from the weather pool
if roll_for_weather_encounter(current_weather_intensity)
weather_encounter_type = get_weather_encounter_type(enc_type,current_weather_type)
weather_encounter_type = get_weather_encounter_type(enc_type, current_weather_type)
echoln "weather encounter!"
echoln weather_encounter_type
return pokemonEssentials_PokemonEncounter_choose_wild_pokemon(weather_encounter_type) if(weather_encounter_type)
$PokemonTemp.pokemon_is_weather_encounter = true
return pokemonEssentials_PokemonEncounter_choose_wild_pokemon(weather_encounter_type) if (weather_encounter_type)
end
end
return pokemonEssentials_PokemonEncounter_choose_wild_pokemon(enc_type, *args)
end
SUBSTITUTABLE_ENCOUNTER_TYPES = [:LandDay, :LandNight, :LandMorning, :Land, :Land1, :Land2, :Land3, :TallGrass, :Water]
SUBSTITUTABLE_ENCOUNTER_TYPES = [:Land, :Land1, :Land2, :Land3, :Water]
def can_substitute_for_weather_encounter(encounter_type,current_weather)
def can_substitute_for_weather_encounter(encounter_type, current_weather)
return false if Settings::GAME_ID != :IF_HOENN
return false if !SUBSTITUTABLE_ENCOUNTER_TYPES.include?(encounter_type)
return false if current_weather.nil? || current_weather == :None
@@ -30,13 +31,21 @@ class PokemonEncounters
end
def get_weather_encounter_type(normal_encounter_type, current_weather_type)
base_encounter_type = normal_encounter_type == :Water ? :Water : :Land
surf_encounters = [:Water, :WaterNight, :WaterMorning, :WaterDay]
base_encounter_type = surf_encounters.include?(normal_encounter_type) ? :Water : :Land
weather_encounter_type = "#{base_encounter_type}#{current_weather_type}".to_sym
return weather_encounter_type if GameData::EncounterType.exists?(weather_encounter_type)
return nil
end
#out of 100
def weather_encounter_chance(weather_intensity)
return (WEATHER_ENCOUNTER_BASE_CHANCE * weather_intensity) + WEATHER_ENCOUNTER_BASE_CHANCE
end
def roll_for_weather_encounter(weather_intensity)
weather_encounter_chance = (WEATHER_ENCOUNTER_BASE_CHANCE * weather_intensity)+WEATHER_ENCOUNTER_BASE_CHANCE
weather_encounter_chance = weather_encounter_chance(weather_intensity)
return rand(100) < weather_encounter_chance
end