Class: BattleUI::SkillChoice::MoveInfo
- Inherits:
-
UI::SpriteStack
- Object
- UI::SpriteStack
- BattleUI::SkillChoice::MoveInfo
- Defined in:
- scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00300 SkillChoice.rb
Overview
Element showing the information of the current move
Constant Summary
Constants inherited from UI::SpriteStack
UI::SpriteStack::NO_INITIAL_IMAGE
Instance Attribute Summary
Attributes inherited from UI::SpriteStack
#animated, #data, #moving, #stack, #viewport, #x, #y
Instance Method Summary collapse
-
#data=(pokemon)
Set the move shown by the UI.
-
#initialize(viewport, move_choice) ⇒ MoveInfo
constructor
Create a new MoveInfo.
Methods inherited from UI::SpriteStack
#[], #add_background, #add_line, #add_text, #anime, #anime_delta_set, #dispose, #each, #execute_anime, #move, #move_to, #opacity, #opacity=, #push, #push_sprite, #set_origin, #set_position, #simple_mouse_in?, #size, #stop_animation, #translate_mouse_coords, #update, #update_animation, #update_position, #visible, #visible=, #with_cache, #with_font, #with_surface, #z, #z=
Constructor Details
#initialize(viewport, move_choice) ⇒ MoveInfo
Create a new MoveInfo
141 142 143 144 145 |
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00300 SkillChoice.rb', line 141 def initialize(, move_choice) super() @move_choice = move_choice create_sprites end |
Instance Method Details
#data=(pokemon)
Set the move shown by the UI
149 150 151 152 153 154 155 156 157 158 159 |
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00300 SkillChoice.rb', line 149 def data=(pokemon) super(move = pokemon.moveset[@move_choice.index]) return unless move if move.pp == 0 @pp_background.sy = 0 elsif move.pp <= move.ppmax / 2 @pp_background.sy = 1 else @pp_background.sy = 2 end end |