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
Instance Attribute Summary collapse
-
#animations ⇒ Array
readonly
List of the animation.
-
#background ⇒ ShaderedSprite
The background sprite.
-
#camera_positionner
Not used in Visual (avoid crash when using MoveAnimation).
-
#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_hash ⇒ Hash{ Integer => Symbol }
Return the transition resource type hash.
-
.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.
-
#dark_tone_animation
Not used in classic Visual, feel free to implement it by monkey-patching this function or through a MR.
-
#dispose
Dispose the visuals.
-
#heal_status_remove_tone(target)
remove the tone animation.
-
#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).
-
#reset_tone_animation
Not used in classic Visual, feel free to implement it by monkey-patching this function or through a MR.
-
#scene_update_proc { ... }
Display animation & stuff like that by updating the scene.
-
#set_info_state(state, pokemon = nil)
Set the state info.
-
#shift_battler_sprite(who, with)
Shift two battler sprites.
-
#show_ability(target, no_go_out = false)
Show the ability animation.
-
#show_bait_mud_animation(target_pokemon, bait_mud)
Show the bait or mud throw animation if Safari Battle.
-
#show_catch_animation(target_pokemon, ball, nb_bounce, caught)
Show the catching animation.
-
#show_catch_blocked_animation(target_pokemon, ball)
Show the catch blocked animation (ball thrown then bounces back).
-
#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_mega_animation(target)
Show the pokemon mega evolution animation.
-
#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, cannot_switch_index: nil) ⇒ 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_stat_animation(target, amount)
Show an animation for stat change.
-
#show_status_animation(target, status)
Show an animation for a status.
-
#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 enemy sprite transition during the battle end scene.
-
#show_weather_animation(weather)
Show an animation for a weather.
-
#snap_to_bitmaps ⇒ Array<Texture>
Snap all viewports to bitmap.
-
#spc_show_message(pokemon_index)
Show the message "What will X do".
-
#start_center_animation
Define the translation to the center of the Screen.
-
#start_weather_animation(weather)
Start an animation for a weather.
-
#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
31 32 |
# File 'docs/5_Battle_02_Visual.rb', line 31 def initialize(scene) end |
Instance Attribute Details
#animations ⇒ Array (readonly)
Returns List of the animation.
18 19 20 |
# File 'docs/5_Battle_02_Visual.rb', line 18 def animations @animations end |
#background ⇒ ShaderedSprite
Returns the background sprite.
26 27 28 |
# File 'docs/5_Battle_02_Visual.rb', line 26 def background @background end |
#camera_positionner
Not used in Visual (avoid crash when using MoveAnimation)
28 29 30 |
# File 'docs/5_Battle_02_Visual.rb', line 28 def camera_positionner @camera_positionner end |
#parallel_animations ⇒ Hash (readonly)
Returns List of the parallel animation.
16 17 18 |
# File 'docs/5_Battle_02_Visual.rb', line 16 def parallel_animations @parallel_animations end |
#to_dispose ⇒ Array (readonly)
Returns the element to dispose on #dispose.
24 25 26 |
# File 'docs/5_Battle_02_Visual.rb', line 24 def to_dispose @to_dispose end |
#viewport ⇒ Viewport (readonly)
Returns the viewport used to show the sprites.
20 21 22 |
# File 'docs/5_Battle_02_Visual.rb', line 20 def @viewport end |
#viewport_sub ⇒ Viewport (readonly)
Returns the viewport used to show some UI part.
22 23 24 |
# File 'docs/5_Battle_02_Visual.rb', line 22 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
188 189 |
# File 'docs/5_Battle_02_Visual.rb', line 188 def register_transition_resource(id, resource_type) end |
.transition_resource_hash ⇒ Hash{ Integer => Symbol }
Return the transition resource type hash
182 183 |
# File 'docs/5_Battle_02_Visual.rb', line 182 def transition_resource_hash end |
.transition_resource_type_for(id) ⇒ Symbol
Return the transition resource type for a given transition ID
193 194 |
# File 'docs/5_Battle_02_Visual.rb', line 193 def transition_resource_type_for(id) end |
Instance Method Details
#battler_sprite(bank, position) ⇒ BattleUI::PokemonSprite?
Retrieve the sprite of a battler
172 173 |
# File 'docs/5_Battle_02_Visual.rb', line 172 def battler_sprite(bank, position) end |
#dark_tone_animation
Not used in classic Visual, feel free to implement it by monkey-patching this function or through a MR
649 650 |
# File 'docs/5_Battle_02_Visual.rb', line 649 def dark_tone_animation end |
#dispose
Dispose the visuals
41 42 |
# File 'docs/5_Battle_02_Visual.rb', line 41 def dispose end |
#heal_status_remove_tone(target)
remove the tone animation
398 399 |
# File 'docs/5_Battle_02_Visual.rb', line 398 def heal_status_remove_tone(target) end |
#hide_ability(target)
Hide the ability animation (no effect if no_go_out = false)
411 412 |
# File 'docs/5_Battle_02_Visual.rb', line 411 def hide_ability(target) end |
#hide_info_bar(pokemon)
Show a specific bar
353 354 |
# File 'docs/5_Battle_02_Visual.rb', line 353 def (pokemon) end |
#hide_info_bars(no_animation = false, bank: nil)
Hide all the bars
341 342 |
# File 'docs/5_Battle_02_Visual.rb', line 341 def (no_animation = false, bank: nil) end |
#hide_team_info
Hide team info
368 369 |
# File 'docs/5_Battle_02_Visual.rb', line 368 def hide_team_info end |
#lock
Lock the battle scene
50 51 |
# File 'docs/5_Battle_02_Visual.rb', line 50 def lock end |
#locking? ⇒ Boolean
Tell if the visual are locking the battle update (for transition purpose)
44 45 |
# File 'docs/5_Battle_02_Visual.rb', line 44 def locking? end |
#refresh_info_bar(pokemon)
Refresh a specific bar (when Pokemon loses HP or change state)
357 358 |
# File 'docs/5_Battle_02_Visual.rb', line 357 def (pokemon) end |
#reset_tone_animation
Not used in classic Visual, feel free to implement it by monkey-patching this function or through a MR
652 653 |
# File 'docs/5_Battle_02_Visual.rb', line 652 def reset_tone_animation end |
#scene_update_proc { ... }
this function raise if the visual are not locked
Display animation & stuff like that by updating the scene
55 56 |
# File 'docs/5_Battle_02_Visual.rb', line 55 def scene_update_proc end |
#set_info_state(state, pokemon = nil)
Set the state info
362 363 |
# File 'docs/5_Battle_02_Visual.rb', line 362 def set_info_state(state, pokemon = nil) end |
#shift_battler_sprite(who, with)
Shift two battler sprites
177 178 |
# File 'docs/5_Battle_02_Visual.rb', line 177 def shift_battler_sprite(who, with) end |
#show_ability(target, no_go_out = false)
Show the ability animation
407 408 |
# File 'docs/5_Battle_02_Visual.rb', line 407 def show_ability(target, no_go_out = false) end |
#show_bait_mud_animation(target_pokemon, bait_mud)
Show the bait or mud throw animation if Safari Battle
549 550 |
# File 'docs/5_Battle_02_Visual.rb', line 549 def show_bait_mud_animation(target_pokemon, bait_mud) end |
#show_catch_animation(target_pokemon, ball, nb_bounce, caught)
Show the catching animation
445 446 |
# File 'docs/5_Battle_02_Visual.rb', line 445 def show_catch_animation(target_pokemon, ball, nb_bounce, caught) end |
#show_catch_blocked_animation(target_pokemon, ball)
Show the catch blocked animation (ball thrown then bounces back)
450 451 |
# File 'docs/5_Battle_02_Visual.rb', line 450 def show_catch_blocked_animation(target_pokemon, ball) end |
#show_exp_distribution(exp_data)
Show the exp distribution
438 439 |
# File 'docs/5_Battle_02_Visual.rb', line 438 def show_exp_distribution(exp_data) end |
#show_hp_animations(targets, hps, effectiveness = [], &messages)
Show HP animations
376 377 |
# File 'docs/5_Battle_02_Visual.rb', line 376 def show_hp_animations(targets, hps, effectiveness = [], &) end |
#show_info_bar(pokemon)
Show a specific bar
349 350 |
# File 'docs/5_Battle_02_Visual.rb', line 349 def (pokemon) end |
#show_info_bars(bank: nil)
Show all the bars
345 346 |
# File 'docs/5_Battle_02_Visual.rb', line 345 def (bank: nil) end |
#show_item(target)
Show the item user animation
415 416 |
# File 'docs/5_Battle_02_Visual.rb', line 415 def show_item(target) end |
#show_item_choice ⇒ PFM::ItemDescriptor::Wrapper?
Method that show the item choice
324 325 |
# File 'docs/5_Battle_02_Visual.rb', line 324 def show_item_choice end |
#show_kos(targets)
Show KO animations
402 403 |
# File 'docs/5_Battle_02_Visual.rb', line 402 def show_kos(targets) end |
#show_mega_animation(target)
Show the pokemon mega evolution animation
423 424 |
# File 'docs/5_Battle_02_Visual.rb', line 423 def show_mega_animation(target) end |
#show_move_animation(user, targets, move)
Make a move animation
429 430 |
# File 'docs/5_Battle_02_Visual.rb', line 429 def show_move_animation(user, targets, move) end |
#show_player_choice(pokemon_index) ⇒ Symbol, ...
Method that shows the trainer choice
231 232 |
# File 'docs/5_Battle_02_Visual.rb', line 231 def show_player_choice(pokemon_index) end |
#show_pokemon_choice(forced = false, cannot_switch_index: nil) ⇒ PFM::PokemonBattler?
Method that show the pokemon choice
330 331 |
# File 'docs/5_Battle_02_Visual.rb', line 330 def show_pokemon_choice(forced = false, cannot_switch_index: nil) end |
#show_pre_transition
Method that show the pre_transition of the battle
154 155 |
# File 'docs/5_Battle_02_Visual.rb', line 154 def show_pre_transition end |
#show_rmxp_animation(target, id)
Show a dedicated animation
434 435 |
# File 'docs/5_Battle_02_Visual.rb', line 434 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
261 262 |
# File 'docs/5_Battle_02_Visual.rb', line 261 def show_skill_choice(pokemon_index) end |
#show_stat_animation(target, amount)
Show an animation for stat change
381 382 |
# File 'docs/5_Battle_02_Visual.rb', line 381 def show_stat_animation(target, amount) end |
#show_status_animation(target, status)
Show an animation for a status
386 387 |
# File 'docs/5_Battle_02_Visual.rb', line 386 def show_status_animation(target, status) end |
#show_switch_form_animation(target)
Show the pokemon switch form animation
419 420 |
# File 'docs/5_Battle_02_Visual.rb', line 419 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
265 266 |
# File 'docs/5_Battle_02_Visual.rb', line 265 def show_target_choice end |
#show_team_info
Show team info
365 366 |
# File 'docs/5_Battle_02_Visual.rb', line 365 def show_team_info end |
#show_transition
Method that show the trainer transition of the battle
157 158 |
# File 'docs/5_Battle_02_Visual.rb', line 157 def show_transition end |
#show_transition_battle_end
Method that show the enemy sprite transition during the battle end scene
160 161 |
# File 'docs/5_Battle_02_Visual.rb', line 160 def show_transition_battle_end end |
#show_weather_animation(weather)
Show an animation for a weather
390 391 |
# File 'docs/5_Battle_02_Visual.rb', line 390 def show_weather_animation(weather) end |
#snap_to_bitmaps ⇒ Array<Texture>
Snap all viewports to bitmap
62 63 |
# File 'docs/5_Battle_02_Visual.rb', line 62 def snap_to_bitmaps end |
#spc_show_message(pokemon_index)
Show the message "What will X do"
235 236 |
# File 'docs/5_Battle_02_Visual.rb', line 235 def (pokemon_index) end |
#start_center_animation
This method is used only in Visual3D
Define the translation to the center of the Screen
454 455 |
# File 'docs/5_Battle_02_Visual.rb', line 454 def start_center_animation end |
#start_weather_animation(weather)
Start an animation for a weather
394 395 |
# File 'docs/5_Battle_02_Visual.rb', line 394 def start_weather_animation(weather) end |
#store_battler_sprite(bank, position, sprite)
Function storing a battler sprite in the battler Hash
166 167 |
# File 'docs/5_Battle_02_Visual.rb', line 166 def store_battler_sprite(bank, position, sprite) end |
#to_s Also known as: inspect
Safe to_s & inspect
34 35 |
# File 'docs/5_Battle_02_Visual.rb', line 34 def to_s end |
#unlock
Unlock the battle scene
47 48 |
# File 'docs/5_Battle_02_Visual.rb', line 47 def unlock end |
#update
Update the visuals
38 39 |
# File 'docs/5_Battle_02_Visual.rb', line 38 def update end |
#wait_for_animation
Wait for all animation to end (non parallel one)
58 59 |
# File 'docs/5_Battle_02_Visual.rb', line 58 def wait_for_animation end |