#===============================================================================
# * Different EncounterType
# * for over-world spawning and original encountering on the same map
# * by TrankerGolD
# * made for Visible Overworld Wild Encounters for PEv19.1 - by derFischae and TrankerGolD (Credits if used please) *
#===============================================================================
GameData::EncounterType.register({
:id => :OverworldLand,
:type => :overworld_land,
:trigger_chance => 21,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldLandDay,
:type => :overworld_land,
:trigger_chance => 21,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldLandNight,
:type => :overworld_land,
:trigger_chance => 21,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldLandMorning,
:type => :overworld_land,
:trigger_chance => 21,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldLandAfternoon,
:type => :overworld_land,
:trigger_chance => 21,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldLandEvening,
:type => :overworld_land,
:trigger_chance => 21,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldCave,
:type => :overworld_cave,
:trigger_chance => 5,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldCaveDay,
:type => :overworld_cave,
:trigger_chance => 5,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldCaveNight,
:type => :overworld_cave,
:trigger_chance => 5,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldCaveMorning,
:type => :overworld_cave,
:trigger_chance => 5,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldCaveAfternoon,
:type => :overworld_cave,
:trigger_chance => 5,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldCaveEvening,
:type => :overworld_cave,
:trigger_chance => 5,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
GameData::EncounterType.register({
:id => :OverworldWater,
:type => :overworld_water,
:trigger_chance => 2,
:old_slots => [60, 30, 5, 4, 1]
})
GameData::EncounterType.register({
:id => :OverworldWaterDay,
:type => :overworld_water,
:trigger_chance => 2,
:old_slots => [60, 30, 5, 4, 1]
})
GameData::EncounterType.register({
:id => :OverworldWaterNight,
:type => :overworld_water,
:trigger_chance => 2,
:old_slots => [60, 30, 5, 4, 1]
})
GameData::EncounterType.register({
:id => :OverworldWaterMorning,
:type => :overworld_water,
:trigger_chance => 2,
:old_slots => [60, 30, 5, 4, 1]
})
GameData::EncounterType.register({
:id => :OverworldWaterAfternoon,
:type => :overworld_water,
:trigger_chance => 2,
:old_slots => [60, 30, 5, 4, 1]
})
GameData::EncounterType.register({
:id => :OverworldWaterEvening,
:type => :overworld_water,
:trigger_chance => 2,
:old_slots => [60, 30, 5, 4, 1]
})
GameData::EncounterType.register({
:id => :OverworldBugContest,
:type => :overworld_contest,
:trigger_chance => 21,
:old_slots => [20, 20, 10, 10, 10, 10, 5, 5, 4, 4, 1, 1]
})
#===============================================================================
# adding new Methods encounter_type_on_tile and encounter_possible_here_on_tile?
# in Class PokemonEncounters
#===============================================================================
class PokemonEncounters
#=============================================================================
# Returns whether land-like encounters have been defined for the current map.
# Applies only to encounters triggered by moving around.
def has_overworld_land_encounters?
GameData::EncounterType.each do |enc_type|
next if ![:overworld_land, :overworld_contest].include?(enc_type.type)
return true if has_encounter_type?(enc_type.id)
end
return false
end
# Returns whether land-like encounters have been defined for the current map
# (ignoring the Bug Catching Contest one).
# Applies only to encounters triggered by moving around.
def has_normal_overworld_land_encounters?
GameData::EncounterType.each do |enc_type|
return true if enc_type.type == :overworld_land && has_encounter_type?(enc_type.id)
end
return false
end
# Returns whether cave-like encounters have been defined for the current map.
# Applies only to encounters triggered by moving around.
def has_overworld_cave_encounters?
GameData::EncounterType.each do |enc_type|
return true if enc_type.type == :overworld_cave && has_encounter_type?(enc_type.id)
end
return false
end
# Returns whether water-like encounters have been defined for the current map.
# Applies only to encounters triggered by moving around (i.e. not fishing).
def has_overworld_water_encounters?
GameData::EncounterType.each do |enc_type|
return true if enc_type.type == :overworld_water && has_encounter_type?(enc_type.id)
end
return false
end
#=============================================================================
def encounter_type_on_tile(x,y)
time = pbGetTimeNow
ret = nil
if has_overworld_water_encounters? && $game_map.terrain_tag(x,y).can_surf_freely
ret = find_valid_encounter_type_for_time(:OverworldWater, time)
else # OverworldLand/OverworldCave (can have both in the same map)
if has_overworld_land_encounters? && $game_map.terrain_tag(x, y).land_wild_encounters
ret = :OverworldBugContest if pbInBugContest? && has_encounter_type?(:OverworldBugContest)
ret = find_valid_encounter_type_for_time(:OverworldLand, time) if !ret
end
if !ret && has_overworld_cave_encounters?
ret = find_valid_encounter_type_for_time(:OverworldCave, time)
end
end
return ret
end
end