Class: Battle::Visual
Overview
Class that manage all the thing that are visually seen on the screen
Direct Known Subclasses
Defined Under Namespace
Modules: Transition Classes: FakeHPAnimation, HPAnimation, IdlePokemonAnimation
Constant Summary collapse
- BAG_PARTY_POSITIONS =
Variable giving the position of the battlers to show from bank 0 in bag UI
0..5
- ABILITY_SOUND_EFFECT =
['Audio/SE/In-Battle_Ability_Activate', 100, 100]
- ITEM_SOUND_EFFECT =
ABILITY_SOUND_EFFECT
Instance Attribute Summary collapse
-
#animations ⇒ Array
readonly
List of the animation.
-
#parallel_animations ⇒ Hash
readonly
List of the parallel animation.
-
#to_dispose ⇒ Array
readonly
The element to dispose on #dispose.
-
#viewport ⇒ Viewport
readonly
The viewport used to show the sprites.
-
#viewport_sub ⇒ Viewport
readonly
The viewport used to show some UI part.
Class Method Summary collapse
-
.register_transition_resource(id, resource_type)
Register the transition resource type for a specific transition.
-
.transition_resource_type_for(id) ⇒ Symbol
Return the transition resource type for a given transition ID.
Instance Method Summary collapse
-
#battler_sprite(bank, position) ⇒ BattleUI::PokemonSprite?
Retrieve the sprite of a battler.
-
#dispose
Dispose the visuals.
-
#hide_ability(target)
Hide the ability animation (no effect if no_go_out = false).
-
#hide_info_bar(pokemon)
Show a specific bar.
-
#hide_info_bars(no_animation = false, bank: nil)
Hide all the bars.
-
#hide_team_info
Hide team info.
-
#initialize(scene) ⇒ Visual
constructor
Create a new visual instance.
-
#lock
Lock the battle scene.
-
#locking? ⇒ Boolean
Tell if the visual are locking the battle update (for transition purpose).
-
#refresh_info_bar(pokemon)
Refresh a specific bar (when Pokemon loses HP or change state).
-
#scene_update_proc { ... }
Display animation & stuff like that by updating the scene.
-
#set_info_state(state, pokemon = nil)
Set the state info.
-
#show_ability(target, no_go_out = false)
Show the ability animation.
-
#show_catch_animation(target_pokemon, ball, nb_bounce, caught)
Show the catching animation.
-
#show_exp_distribution(exp_data)
Show the exp distribution.
-
#show_hp_animations(targets, hps, effectiveness = [], &messages)
Show HP animations.
-
#show_info_bar(pokemon)
Show a specific bar.
-
#show_info_bars(bank: nil)
Show all the bars.
-
#show_item(target)
Show the item user animation.
-
#show_item_choice ⇒ PFM::ItemDescriptor::Wrapper?
Method that show the item choice.
-
#show_kos(targets)
Show KO animations.
-
#show_move_animation(user, targets, move)
Make a move animation.
-
#show_player_choice(pokemon_index) ⇒ Symbol, ...
Method that shows the trainer choice.
-
#show_pokemon_choice(forced = false) ⇒ PFM::PokemonBattler?
Method that show the pokemon choice.
-
#show_pre_transition
Method that show the pre_transition of the battle.
-
#show_rmxp_animation(target, id)
Show a dedicated animation.
-
#show_skill_choice(pokemon_index) ⇒ Boolean
Method that show the skill choice and store it inside an instance variable.
-
#show_switch_form_animation(target)
Show the pokemon switch form animation.
-
#show_target_choice ⇒ Array<PFM::PokemonBattler, Battle::Move, Integer(bank), Integer(position), Boolean(mega)>?
Method that show the target choice once the skill was choosen.
-
#show_team_info
Show team info.
-
#show_transition
Method that show the trainer transition of the battle.
-
#show_transition_battle_end
Method that show the ennemy sprite transition during the battle end scene.
-
#snap_to_bitmaps ⇒ Array<Texture>
Snap all viewports to bitmap.
-
#spc_show_message(pokemon_index)
Show the message “What will X do”.
-
#store_battler_sprite(bank, position, sprite)
Function storing a battler sprite in the battler Hash.
-
#to_s
(also: #inspect)
Safe to_s & inspect.
-
#unlock
Unlock the battle scene.
-
#update
Update the visuals.
-
#wait_for_animation
Wait for all animation to end (non parallel one).
Constructor Details
#initialize(scene) ⇒ Visual
Create a new visual instance
16 17 |
# File 'docs/5_Battle_02_Visual.rb', line 16 def initialize(scene) end |
Instance Attribute Details
#animations ⇒ Array (readonly)
Returns List of the animation.
7 8 9 |
# File 'docs/5_Battle_02_Visual.rb', line 7 def animations @animations end |
#parallel_animations ⇒ Hash (readonly)
Returns List of the parallel animation.
5 6 7 |
# File 'docs/5_Battle_02_Visual.rb', line 5 def parallel_animations @parallel_animations end |
#to_dispose ⇒ Array (readonly)
Returns the element to dispose on #dispose.
13 14 15 |
# File 'docs/5_Battle_02_Visual.rb', line 13 def to_dispose @to_dispose end |
#viewport ⇒ Viewport (readonly)
Returns the viewport used to show the sprites.
9 10 11 |
# File 'docs/5_Battle_02_Visual.rb', line 9 def @viewport end |
#viewport_sub ⇒ Viewport (readonly)
Returns the viewport used to show some UI part.
11 12 13 |
# File 'docs/5_Battle_02_Visual.rb', line 11 def @viewport_sub end |
Class Method Details
.register_transition_resource(id, resource_type)
If no resource type was registered, will send the default sprite one
Register the transition resource type for a specific transition
140 141 |
# File 'docs/5_Battle_02_Visual.rb', line 140 def register_transition_resource(id, resource_type) end |
.transition_resource_type_for(id) ⇒ Symbol
Return the transition resource type for a given transition ID
145 146 |
# File 'docs/5_Battle_02_Visual.rb', line 145 def transition_resource_type_for(id) end |
Instance Method Details
#battler_sprite(bank, position) ⇒ BattleUI::PokemonSprite?
Retrieve the sprite of a battler
133 134 |
# File 'docs/5_Battle_02_Visual.rb', line 133 def battler_sprite(bank, position) end |
#dispose
Dispose the visuals
26 27 |
# File 'docs/5_Battle_02_Visual.rb', line 26 def dispose end |
#hide_ability(target)
Hide the ability animation (no effect if no_go_out = false)
310 311 |
# File 'docs/5_Battle_02_Visual.rb', line 310 def hide_ability(target) end |
#hide_info_bar(pokemon)
Show a specific bar
272 273 |
# File 'docs/5_Battle_02_Visual.rb', line 272 def (pokemon) end |
#hide_info_bars(no_animation = false, bank: nil)
Hide all the bars
260 261 |
# File 'docs/5_Battle_02_Visual.rb', line 260 def (no_animation = false, bank: nil) end |
#hide_team_info
Hide team info
287 288 |
# File 'docs/5_Battle_02_Visual.rb', line 287 def hide_team_info end |
#lock
Lock the battle scene
35 36 |
# File 'docs/5_Battle_02_Visual.rb', line 35 def lock end |
#locking? ⇒ Boolean
Tell if the visual are locking the battle update (for transition purpose)
29 30 |
# File 'docs/5_Battle_02_Visual.rb', line 29 def locking? end |
#refresh_info_bar(pokemon)
Refresh a specific bar (when Pokemon loses HP or change state)
276 277 |
# File 'docs/5_Battle_02_Visual.rb', line 276 def (pokemon) end |
#scene_update_proc { ... }
this function raise if the visual are not locked
Display animation & stuff like that by updating the scene
40 41 |
# File 'docs/5_Battle_02_Visual.rb', line 40 def scene_update_proc end |
#set_info_state(state, pokemon = nil)
Set the state info
281 282 |
# File 'docs/5_Battle_02_Visual.rb', line 281 def set_info_state(state, pokemon = nil) end |
#show_ability(target, no_go_out = false)
Show the ability animation
306 307 |
# File 'docs/5_Battle_02_Visual.rb', line 306 def show_ability(target, no_go_out = false) end |
#show_catch_animation(target_pokemon, ball, nb_bounce, caught)
Show the catching animation
340 341 |
# File 'docs/5_Battle_02_Visual.rb', line 340 def show_catch_animation(target_pokemon, ball, nb_bounce, caught) end |
#show_exp_distribution(exp_data)
Show the exp distribution
333 334 |
# File 'docs/5_Battle_02_Visual.rb', line 333 def show_exp_distribution(exp_data) end |
#show_hp_animations(targets, hps, effectiveness = [], &messages)
Show HP animations
297 298 |
# File 'docs/5_Battle_02_Visual.rb', line 297 def show_hp_animations(targets, hps, effectiveness = [], &) end |
#show_info_bar(pokemon)
Show a specific bar
268 269 |
# File 'docs/5_Battle_02_Visual.rb', line 268 def (pokemon) end |
#show_info_bars(bank: nil)
Show all the bars
264 265 |
# File 'docs/5_Battle_02_Visual.rb', line 264 def (bank: nil) end |
#show_item(target)
Show the item user animation
314 315 |
# File 'docs/5_Battle_02_Visual.rb', line 314 def show_item(target) end |
#show_item_choice ⇒ PFM::ItemDescriptor::Wrapper?
Method that show the item choice
244 245 |
# File 'docs/5_Battle_02_Visual.rb', line 244 def show_item_choice end |
#show_kos(targets)
Show KO animations
301 302 |
# File 'docs/5_Battle_02_Visual.rb', line 301 def show_kos(targets) end |
#show_move_animation(user, targets, move)
Make a move animation
324 325 |
# File 'docs/5_Battle_02_Visual.rb', line 324 def show_move_animation(user, targets, move) end |
#show_player_choice(pokemon_index) ⇒ Symbol, ...
Method that shows the trainer choice
170 171 |
# File 'docs/5_Battle_02_Visual.rb', line 170 def show_player_choice(pokemon_index) end |
#show_pokemon_choice(forced = false) ⇒ PFM::PokemonBattler?
Method that show the pokemon choice
249 250 |
# File 'docs/5_Battle_02_Visual.rb', line 249 def show_pokemon_choice(forced = false) end |
#show_pre_transition
Method that show the pre_transition of the battle
115 116 |
# File 'docs/5_Battle_02_Visual.rb', line 115 def show_pre_transition end |
#show_rmxp_animation(target, id)
Show a dedicated animation
329 330 |
# File 'docs/5_Battle_02_Visual.rb', line 329 def show_rmxp_animation(target, id) end |
#show_skill_choice(pokemon_index) ⇒ Boolean
Method that show the skill choice and store it inside an instance variable
200 201 |
# File 'docs/5_Battle_02_Visual.rb', line 200 def show_skill_choice(pokemon_index) end |
#show_switch_form_animation(target)
Show the pokemon switch form animation
318 319 |
# File 'docs/5_Battle_02_Visual.rb', line 318 def show_switch_form_animation(target) end |
#show_target_choice ⇒ Array<PFM::PokemonBattler, Battle::Move, Integer(bank), Integer(position), Boolean(mega)>?
Method that show the target choice once the skill was choosen
204 205 |
# File 'docs/5_Battle_02_Visual.rb', line 204 def show_target_choice end |
#show_team_info
Show team info
284 285 |
# File 'docs/5_Battle_02_Visual.rb', line 284 def show_team_info end |
#show_transition
Method that show the trainer transition of the battle
118 119 |
# File 'docs/5_Battle_02_Visual.rb', line 118 def show_transition end |
#show_transition_battle_end
Method that show the ennemy sprite transition during the battle end scene
121 122 |
# File 'docs/5_Battle_02_Visual.rb', line 121 def show_transition_battle_end end |
#snap_to_bitmaps ⇒ Array<Texture>
Snap all viewports to bitmap
47 48 |
# File 'docs/5_Battle_02_Visual.rb', line 47 def snap_to_bitmaps end |
#spc_show_message(pokemon_index)
Show the message “What will X do”
174 175 |
# File 'docs/5_Battle_02_Visual.rb', line 174 def (pokemon_index) end |
#store_battler_sprite(bank, position, sprite)
Function storing a battler sprite in the battler Hash
127 128 |
# File 'docs/5_Battle_02_Visual.rb', line 127 def store_battler_sprite(bank, position, sprite) end |
#to_s Also known as: inspect
Safe to_s & inspect
19 20 |
# File 'docs/5_Battle_02_Visual.rb', line 19 def to_s end |
#unlock
Unlock the battle scene
32 33 |
# File 'docs/5_Battle_02_Visual.rb', line 32 def unlock end |
#update
Update the visuals
23 24 |
# File 'docs/5_Battle_02_Visual.rb', line 23 def update end |
#wait_for_animation
Wait for all animation to end (non parallel one)
43 44 |
# File 'docs/5_Battle_02_Visual.rb', line 43 def wait_for_animation end |