class PokemonEncounters
def encounter_type_on_tile(x,y)
time = pbGetTimeNow
ret = nil
if $game_map.terrain_tag(x,y).can_surf_freely
ret = find_valid_encounter_type_for_time(:OverworldWater, time)
ret = find_valid_encounter_type_for_time(:Water, time) if !ret && VisibleEncounterSettings::LET_NORMAL_ENCOUNTERS_SPAWN
else # Land/Cave (can have both in the same map)
if has_land_encounters? && $game_map.terrain_tag(x, y).land_wild_encounters
ret = :OverworldBugContest if pbInBugContest? && has_encounter_type?(:OverworldBugContest)
ret = :BugContest if pbInBugContest? && has_encounter_type?(:BugContest) if !ret && VisibleEncounterSettings::LET_NORMAL_ENCOUNTERS_SPAWN
# Weather encounters are here
if $game_screen.weather_type == :Storm
ret = find_valid_encounter_type_for_time(:OverworldStorm, time) if !ret
ret = find_valid_encounter_type_for_time(:Storm, time) if !ret && VisibleEncounterSettings::LET_NORMAL_ENCOUNTERS_SPAWN
end
if ($game_screen.weather_type == :HeavyRain || $game_screen.weather_type == :Storm)
ret = find_valid_encounter_type_for_time(:OverworldHeavyRain, time) if !ret
ret = find_valid_encounter_type_for_time(:HeavyRain, time) if !ret && VisibleEncounterSettings::LET_NORMAL_ENCOUNTERS_SPAWN
end
if ($game_screen.weather_type == :Rain || $game_screen.weather_type == :HeavyRain || $game_screen.weather_type == :Storm)
ret = find_valid_encounter_type_for_time(:OverworldRain, time) if !ret
ret = find_valid_encounter_type_for_time(:Rain, time) if !ret && VisibleEncounterSettings::LET_NORMAL_ENCOUNTERS_SPAWN
end
if $game_screen.weather_type == :Blizzard
ret = find_valid_encounter_type_for_time(:OverworldBlizzard, time) if !ret
ret = find_valid_encounter_type_for_time(:Blizzard, time) if !ret && VisibleEncounterSettings::LET_NORMAL_ENCOUNTERS_SPAWN
end
if ($game_screen.weather_type == :Snow || $game_screen.weather_type == :Blizzard)
ret = find_valid_encounter_type_for_time(:OverworldSnow, time) if !ret
ret = find_valid_encounter_type_for_time(:Snow, time) if !ret && VisibleEncounterSettings::LET_NORMAL_ENCOUNTERS_SPAWN
end
if $game_screen.weather_type == :Sandstorm
ret = find_valid_encounter_type_for_time(:OverworldSandstorm, time) if !ret
ret = find_valid_encounter_type_for_time(:Sandstorm, time) if !ret && VisibleEncounterSettings::LET_NORMAL_ENCOUNTERS_SPAWN
end
if $game_screen.weather_type == :Sun
ret = find_valid_encounter_type_for_time(:OverworldSun, time) if !ret
ret = find_valid_encounter_type_for_time(:Sun, time) if !ret && VisibleEncounterSettings::LET_NORMAL_ENCOUNTERS_SPAWN
end
if $game_screen.weather_type == :Fog
ret = find_valid_encounter_type_for_time(:OverworldFog, time) if !ret
ret = find_valid_encounter_type_for_time(:Fog, time) if !ret && VisibleEncounterSettings::LET_NORMAL_ENCOUNTERS_SPAWN
end
# Back to normal encounters
ret = find_valid_encounter_type_for_time(:OverworldLand, time) if !ret
ret = find_valid_encounter_type_for_time(:Land, time) if !ret && VisibleEncounterSettings::LET_NORMAL_ENCOUNTERS_SPAWN
end
if !ret && has_cave_encounters?
ret = find_valid_encounter_type_for_time(:OverworldCave, time)
ret = find_valid_encounter_type_for_time(:Cave, time) if !ret && VisibleEncounterSettings::LET_NORMAL_ENCOUNTERS_SPAWN
end
end
return ret
end
end
#===============================================================================
# Registering the encounter types
#===============================================================================
GameData::EncounterType.register({
:id => :OverworldRain,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldRainDay,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldRainNight,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldRainMorning,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldRainAfternoon,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldRainEvening,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldHeavyRain,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldHeavyRainDay,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldHeavyRainNight,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldHeavyRainMorning,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldHeavyRainAfternoon,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldHeavyRainEvening,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldStorm,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldStormDay,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldStormNight,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldStormMorning,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldStormAfternoon,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldStormEvening,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldSnow,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldSnowDay,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldSnowNight,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldSnowMorning,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldSnowAfternoon,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldSnowEvening,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldBlizzard,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldBlizzardDay,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldBlizzardNight,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldBlizzardMorning,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldBlizzardAfternoon,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldBlizzardEvening,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldSandstorm,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldSandstormDay,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldSandstormNight,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldSandstormMorning,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldSandstormAfternoon,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldSandstormEvening,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldSun,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldSunDay,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldSunNight,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldSunMorning,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldSunAfternoon,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldSunEvening,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldFog,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldFogDay,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldFogNight,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldFogMorning,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldFogAfternoon,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldFogEvening,
:type => :land,
:trigger_chance => 41,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})