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, static: :rate_static, lightning_rod: :rate_static, flash_fire: :rate_flash_fire, storm_drain: :rate_storm_drain, harvest: :rate_harvest}
- DATA_ALTERING_ABILITIES =
Hash describing which method to seek to change the Pokemon data depending on the player's leading Pokemon's talent
{synchronize: :copy_nature_synchronize, compound_eyes: :change_item_compound_eyes, super_luck: :change_item_compound_eyes}
- ENCOUNTER_FREQ_INCREASE =
List of abilities increasing the frequency of encounter
{}
- ENCOUNTER_FREQ_DECREASE =
List of abilities decreasing the frequency of encounter
{}
- ENCOUNTER_FREQ_INCREASE_ITEM =
List of items increasing the frequency of encounter
{}
- ENCOUNTER_FREQ_DECREASE_ITEM =
List of items 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_decrease_item(item_db_symbol, &block)
Register an item that decrease the encounter frequency.
-
.register_frequency_increase_ability(ability_db_symbol, &block)
Register an ability that increase the encounter frequency.
-
.register_frequency_increase_item(item_db_symbol, &block)
Register an item that increase the encounter frequency.
-
.register_frequency_modifier(frequency_hash, db_symbols, &block)
Register a frequency modifier into the given hash.
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.
-
#encounter_amount(group) ⇒ Integer
Tell how many encounters are available depending on the vs_type.
-
#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
333 334 |
# File 'docs/4_Systems_999_Wild.rb', line 333 def register_frequency_decrease_ability(ability_db_symbol, &block) end |
.register_frequency_decrease_item(item_db_symbol, &block)
Register an item that decrease the encounter frequency
343 344 |
# File 'docs/4_Systems_999_Wild.rb', line 343 def register_frequency_decrease_item(item_db_symbol, &block) end |
.register_frequency_increase_ability(ability_db_symbol, &block)
Register an ability that increase the encounter frequency
328 329 |
# File 'docs/4_Systems_999_Wild.rb', line 328 def register_frequency_increase_ability(ability_db_symbol, &block) end |
.register_frequency_increase_item(item_db_symbol, &block)
Register an item that increase the encounter frequency
338 339 |
# File 'docs/4_Systems_999_Wild.rb', line 338 def register_frequency_increase_item(item_db_symbol, &block) end |
.register_frequency_modifier(frequency_hash, db_symbols, &block)
Register a frequency modifier into the given hash
323 324 |
# File 'docs/4_Systems_999_Wild.rb', line 323 def register_frequency_modifier(frequency_hash, db_symbols, &block) end |
Instance Method Details
#add_roaming_pokemon(chance, proc_id, pokemon_hash) ⇒ PFM::Pokemon
Add a roaming Pokemon
108 109 |
# File 'docs/4_Systems_999_Wild.rb', line 108 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
135 136 |
# File 'docs/4_Systems_999_Wild.rb', line 135 def begin_save end |
#check_fishing_chances(type) ⇒ Boolean
Check if a Pokemon can be fished there with a specific fishing rod type
119 120 |
# File 'docs/4_Systems_999_Wild.rb', line 119 def check_fishing_chances(type) end |
#compute_fishing_chain ⇒ Integer
Compute the fishing chain
132 133 |
# File 'docs/4_Systems_999_Wild.rb', line 132 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
289 290 |
# File 'docs/4_Systems_999_Wild.rb', line 289 def detected_group_encounter_indexes end |
#each_roaming_pokemon
yield a block on every available roaming Pokemon
122 123 |
# File 'docs/4_Systems_999_Wild.rb', line 122 def each_roaming_pokemon end |
#encounter_amount(group) ⇒ Integer
Tell how many encounters are available depending on the vs_type
87 88 |
# File 'docs/4_Systems_999_Wild.rb', line 87 def encounter_amount(group) end |
#end_save
Method that end the save state of the Wild_Battle object
138 139 |
# File 'docs/4_Systems_999_Wild.rb', line 138 def end_save end |
#group_encounter_detected? ⇒ Boolean
Detect if a group has encounter
285 286 |
# File 'docs/4_Systems_999_Wild.rb', line 285 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
278 279 |
# File 'docs/4_Systems_999_Wild.rb', line 278 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
125 126 |
# File 'docs/4_Systems_999_Wild.rb', line 125 def on_map_viewed end |
#remove_roaming_pokemon(pokemon)
Remove a roaming Pokemon from the roaming Pokemon array
112 113 |
# File 'docs/4_Systems_999_Wild.rb', line 112 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
128 129 |
# File 'docs/4_Systems_999_Wild.rb', line 128 def reset_encounters_history end |
#roaming?(pokemon) ⇒ Boolean Also known as: is_roaming?
Test if a Pokemon is a roaming Pokemon (Usefull in battle)
100 101 |
# File 'docs/4_Systems_999_Wild.rb', line 100 def roaming?(pokemon) end |
#set(zone_type, tag, delta_level, vs_type, *data)
Define a group of remaining wild battle
95 96 |
# File 'docs/4_Systems_999_Wild.rb', line 95 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
281 282 |
# File 'docs/4_Systems_999_Wild.rb', line 281 def update_encounter_count end |