Class: PFM::Wild_Battle
Overview
The wild battle management
The main object is stored in $wild_battle and PFM.game_state.wild_battle
Constant Summary collapse
- WEAK_POKEMON_ABILITY =
List of ability that force strong Pokemon to battle (Intimidation / Regard vif)
%i[intimidate keen_eye]
- FISHING_BATTLES =
List of special wild battle that are actually fishing
%i[normal super mega]
- FISHING_TOOLS =
List of Rod
%i[old_rod good_rod super_rod]
- MAX_POKEMON_LEVEL_ABILITY =
List of ability giving the max level of the pokemon we can encounter
%i[hustle pressure vital_spirit]
- TOOL_MAPPING =
Mapping allowing to get the correct tool based on the input
{normal: :old_rod, super: :good_rod, mega: :super_rod, rock: :rock_smash, headbutt: :headbutt}
- FishIncRate =
Ability that increase the rate of any fishing rod # Glue / Ventouse
%i[sticky_hold suction_cups]
- CHANGE_POKEMON_CHANCE =
Hash describing which method to seek to change the Pokemon chances depending on the player’s leading Pokemon’s talent
{keen_eye: :rate_intimidate_keen_eye, intimidate: :rate_intimidate_keen_eye, cute_charm: :rate_cute_charm, magnet_pull: :rate_magnet_pull, compound_eyes: :rate_compound_eyes, super_luck: :rate_compound_eyes, static: :rate_static, lightning_rod: :rate_static, flash_fire: :rate_flash_fire, synchronize: :rate_synchronize, storm_drain: :rate_storm_drain, harvest: :rate_harvest}
- ENCOUNTER_FREQ_INCREASE =
List of abilities increasing the frequency of encounter
{}
- ENCOUNTER_FREQ_DECREASE =
List of abilities decreasing the frequency of encounter
{}
Instance Attribute Summary collapse
-
#encounters_history ⇒ Array<Hash>
readonly
Get the history of the encounters wild Pokémon.
-
#game_state ⇒ PFM::GameState
Get the game state responsive of the whole game state.
-
#groups ⇒ Array<Studio::Group>
readonly
List of Remaining creature groups.
-
#roaming_pokemons ⇒ Array<PFM::Wild_RoamingInfo>
readonly
List of Roaming Pokemon.
Class Method Summary collapse
-
.register_frequency_decrease_ability(ability_db_symbol, &block)
Register an ability that decrease the encounter frequency.
-
.register_frequency_increase_ability(ability_db_symbol, &block)
Register an ability that increase the encounter frequency.
Instance Method Summary collapse
-
#add_roaming_pokemon(chance, proc_id, pokemon_hash) ⇒ PFM::Pokemon
Add a roaming Pokemon.
-
#any_fish?(rod = :normal, start = false) ⇒ Boolean?
Test if there’s any fish battle available and start it if asked.
-
#any_hidden_pokemon?(rod = :rock, start = false) ⇒ Boolean?
Test if there’s any hidden battle available and start it if asked.
-
#available? ⇒ Boolean
Is a wild battle available ?.
-
#begin_save
Method that prevent non wanted data save of the Wild_Battle object.
-
#check_fishing_chances(type) ⇒ Boolean
Check if a Pokemon can be fished there with a specific fishing rod type.
-
#compute_fishing_chain ⇒ Integer
Compute the fishing chain.
-
#detected_group_encounter_indexes ⇒ Array<Integer>
Get the index of the groups that might trigger a battle due to encounter steps depleted.
-
#each_roaming_pokemon
yield a block on every available roaming Pokemon.
-
#end_save
Method that end the save state of the Wild_Battle object.
-
#group_encounter_detected? ⇒ Boolean
Detect if a group has encounter.
-
#init_battle(id, level = 70, *others)
Init a wild battle.
-
#initialize(game_state) ⇒ Wild_Battle
constructor
Create a new Wild_Battle manager.
-
#load_groups
Load the groups of Wild Pokemon (map change/ time change).
-
#make_encounter_count(only_less_than_one = false)
Make the encounter count for each groups.
-
#on_map_viewed
Tell the roaming pokemon that the playe has look at their position.
-
#remove_roaming_pokemon(pokemon)
Remove a roaming Pokemon from the roaming Pokemon array.
-
#reset
Reset the wild battle.
-
#reset_encounters_history
Reset the history of the encounters wild Pokémon.
-
#roaming?(pokemon) ⇒ Boolean
(also: #is_roaming?)
Test if a Pokemon is a roaming Pokemon (Usefull in battle).
-
#set(zone_type, tag, delta_level, vs_type, *data)
Define a group of remaining wild battle.
-
#setup(battle_id = 1) ⇒ Battle::Logic::BattleInfo?
Set the Battle::Info with the right information.
-
#start_battle(id, level = 70, *others, battle_id: 1)
Start a wild battle.
-
#update_encounter_count
Update encounter count for each groups.
Constructor Details
#initialize(game_state) ⇒ Wild_Battle
Create a new Wild_Battle manager
30 31 |
# File 'docs/4_Systems_999_Wild.rb', line 30 def initialize(game_state) end |
Instance Attribute Details
#encounters_history ⇒ Array<Hash> (readonly)
Get the history of the encounters wild Pokémon
27 28 29 |
# File 'docs/4_Systems_999_Wild.rb', line 27 def encounters_history @encounters_history end |
#game_state ⇒ PFM::GameState
Get the game state responsive of the whole game state
24 25 26 |
# File 'docs/4_Systems_999_Wild.rb', line 24 def game_state @game_state end |
#groups ⇒ Array<Studio::Group> (readonly)
List of Remaining creature groups
21 22 23 |
# File 'docs/4_Systems_999_Wild.rb', line 21 def groups @groups end |
#roaming_pokemons ⇒ Array<PFM::Wild_RoamingInfo> (readonly)
List of Roaming Pokemon
18 19 20 |
# File 'docs/4_Systems_999_Wild.rb', line 18 def roaming_pokemons @roaming_pokemons end |
Class Method Details
.register_frequency_decrease_ability(ability_db_symbol, &block)
Register an ability that decrease the encounter frequency
286 287 |
# File 'docs/4_Systems_999_Wild.rb', line 286 def register_frequency_decrease_ability(ability_db_symbol, &block) end |
.register_frequency_increase_ability(ability_db_symbol, &block)
Register an ability that increase the encounter frequency
281 282 |
# File 'docs/4_Systems_999_Wild.rb', line 281 def register_frequency_increase_ability(ability_db_symbol, &block) end |
Instance Method Details
#add_roaming_pokemon(chance, proc_id, pokemon_hash) ⇒ PFM::Pokemon
Add a roaming Pokemon
103 104 |
# File 'docs/4_Systems_999_Wild.rb', line 103 def add_roaming_pokemon(chance, proc_id, pokemon_hash) end |
#any_fish?(rod = :normal, start = false) ⇒ Boolean?
Test if there’s any fish battle available and start it if asked.
46 47 |
# File 'docs/4_Systems_999_Wild.rb', line 46 def any_fish?(rod = :normal, start = false) end |
#any_hidden_pokemon?(rod = :rock, start = false) ⇒ Boolean?
Test if there’s any hidden battle available and start it if asked.
52 53 |
# File 'docs/4_Systems_999_Wild.rb', line 52 def any_hidden_pokemon?(rod = :rock, start = false) end |
#available? ⇒ Boolean
Is a wild battle available ?
40 41 |
# File 'docs/4_Systems_999_Wild.rb', line 40 def available? end |
#begin_save
Method that prevent non wanted data save of the Wild_Battle object
130 131 |
# File 'docs/4_Systems_999_Wild.rb', line 130 def begin_save end |
#check_fishing_chances(type) ⇒ Boolean
Check if a Pokemon can be fished there with a specific fishing rod type
114 115 |
# File 'docs/4_Systems_999_Wild.rb', line 114 def check_fishing_chances(type) end |
#compute_fishing_chain ⇒ Integer
Compute the fishing chain
127 128 |
# File 'docs/4_Systems_999_Wild.rb', line 127 def compute_fishing_chain end |
#detected_group_encounter_indexes ⇒ Array<Integer>
Get the index of the groups that might trigger a battle due to encounter steps depleted
267 268 |
# File 'docs/4_Systems_999_Wild.rb', line 267 def detected_group_encounter_indexes end |
#each_roaming_pokemon
yield a block on every available roaming Pokemon
117 118 |
# File 'docs/4_Systems_999_Wild.rb', line 117 def each_roaming_pokemon end |
#end_save
Method that end the save state of the Wild_Battle object
133 134 |
# File 'docs/4_Systems_999_Wild.rb', line 133 def end_save end |
#group_encounter_detected? ⇒ Boolean
Detect if a group has encounter
263 264 |
# File 'docs/4_Systems_999_Wild.rb', line 263 def group_encounter_detected? end |
#init_battle(id, level, *args) #init_battle(id, level, *args)
Does not start the battle
Init a wild battle
77 78 |
# File 'docs/4_Systems_999_Wild.rb', line 77 def init_battle(id, level = 70, *others) end |
#load_groups
Load the groups of Wild Pokemon (map change/ time change)
36 37 |
# File 'docs/4_Systems_999_Wild.rb', line 36 def load_groups end |
#make_encounter_count(only_less_than_one = false)
Make the encounter count for each groups
256 257 |
# File 'docs/4_Systems_999_Wild.rb', line 256 def make_encounter_count(only_less_than_one = false) end |
#on_map_viewed
Tell the roaming pokemon that the playe has look at their position
120 121 |
# File 'docs/4_Systems_999_Wild.rb', line 120 def on_map_viewed end |
#remove_roaming_pokemon(pokemon)
Remove a roaming Pokemon from the roaming Pokemon array
107 108 |
# File 'docs/4_Systems_999_Wild.rb', line 107 def remove_roaming_pokemon(pokemon) end |
#reset
Reset the wild battle
33 34 |
# File 'docs/4_Systems_999_Wild.rb', line 33 def reset end |
#reset_encounters_history
Reset the history of the encounters wild Pokémon
123 124 |
# File 'docs/4_Systems_999_Wild.rb', line 123 def reset_encounters_history end |
#roaming?(pokemon) ⇒ Boolean Also known as: is_roaming?
Test if a Pokemon is a roaming Pokemon (Usefull in battle)
95 96 |
# File 'docs/4_Systems_999_Wild.rb', line 95 def roaming?(pokemon) end |
#set(zone_type, tag, delta_level, vs_type, *data)
Define a group of remaining wild battle
90 91 |
# File 'docs/4_Systems_999_Wild.rb', line 90 def set(zone_type, tag, delta_level, vs_type, *data) end |
#setup(battle_id = 1) ⇒ Battle::Logic::BattleInfo?
Set the Battle::Info with the right information
82 83 |
# File 'docs/4_Systems_999_Wild.rb', line 82 def setup(battle_id = 1) end |
#start_battle(id, level, *args) #start_battle(id, level, *args)
Start a wild battle
65 66 |
# File 'docs/4_Systems_999_Wild.rb', line 65 def start_battle(id, level = 70, *others, battle_id: 1) end |
#update_encounter_count
Update encounter count for each groups
259 260 |
# File 'docs/4_Systems_999_Wild.rb', line 259 def update_encounter_count end |