mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 06:04:59 +00:00
Added class GameData::EncounterType
This commit is contained in:
@@ -242,9 +242,9 @@ ItemHandlers::UseInField.add(:OLDROD,proc { |item|
|
||||
pbMessage(_INTL("Can't use that here."))
|
||||
next 0
|
||||
end
|
||||
encounter = $PokemonEncounters.has_encounter_type?(EncounterTypes::OldRod)
|
||||
encounter = $PokemonEncounters.has_encounter_type?(:OldRod)
|
||||
if pbFishing(encounter,1)
|
||||
pbEncounter(EncounterTypes::OldRod)
|
||||
pbEncounter(:OldRod)
|
||||
end
|
||||
next 1
|
||||
})
|
||||
@@ -256,9 +256,9 @@ ItemHandlers::UseInField.add(:GOODROD,proc { |item|
|
||||
pbMessage(_INTL("Can't use that here."))
|
||||
next 0
|
||||
end
|
||||
encounter = $PokemonEncounters.has_encounter_type?(EncounterTypes::GoodRod)
|
||||
encounter = $PokemonEncounters.has_encounter_type?(:GoodRod)
|
||||
if pbFishing(encounter,2)
|
||||
pbEncounter(EncounterTypes::GoodRod)
|
||||
pbEncounter(:GoodRod)
|
||||
end
|
||||
next 1
|
||||
})
|
||||
@@ -270,9 +270,9 @@ ItemHandlers::UseInField.add(:SUPERROD,proc { |item|
|
||||
pbMessage(_INTL("Can't use that here."))
|
||||
next 0
|
||||
end
|
||||
encounter = $PokemonEncounters.has_encounter_type?(EncounterTypes::SuperRod)
|
||||
encounter = $PokemonEncounters.has_encounter_type?(:SuperRod)
|
||||
if pbFishing(encounter,3)
|
||||
pbEncounter(EncounterTypes::SuperRod)
|
||||
pbEncounter(:SuperRod)
|
||||
end
|
||||
next 1
|
||||
})
|
||||
|
||||
@@ -254,20 +254,11 @@ def pbEncounterSpecies(phonenum)
|
||||
encounter_data = GameData::Encounter.get(phonenum[6], $PokemonGlobal.encounter_version)
|
||||
return "" if !encounter_data
|
||||
enc_tables = encounter_data.types
|
||||
species = pbRandomEncounterSpecies(enc_tables[EncounterTypes::Land])
|
||||
species = pbRandomEncounterSpecies(enc_tables[:Land])
|
||||
if !species
|
||||
species = pbRandomEncounterSpecies(enc_tables[EncounterTypes::Cave])
|
||||
species = pbRandomEncounterSpecies(enc_tables[:Cave])
|
||||
if !species
|
||||
species = pbRandomEncounterSpecies(enc_tables[EncounterTypes::LandDay])
|
||||
if !species
|
||||
species = pbRandomEncounterSpecies(enc_tables[EncounterTypes::LandMorning])
|
||||
if !species
|
||||
species = pbRandomEncounterSpecies(enc_tables[EncounterTypes::LandNight])
|
||||
if !species
|
||||
species = pbRandomEncounterSpecies(enc_tables[EncounterTypes::Water])
|
||||
end
|
||||
end
|
||||
end
|
||||
species = pbRandomEncounterSpecies(enc_tables[:Water])
|
||||
end
|
||||
end
|
||||
return "" if !species
|
||||
|
||||
@@ -150,7 +150,7 @@ end
|
||||
# Event handlers
|
||||
################################################################################
|
||||
EncounterModifier.register(proc { |encounter|
|
||||
if !EncounterTypes.is_normal_land_type?($PokemonTemp.encounterType) ||
|
||||
if GameData::EncounterType.get($PokemonTemp.encounterType).type != :land ||
|
||||
$PokemonGlobal.bicycle || $PokemonGlobal.partner
|
||||
pbPokeRadarCancel
|
||||
next encounter
|
||||
|
||||
Reference in New Issue
Block a user