Module: BattleUI::SkillChoiceAbstraction
- Includes:
- GenericChoice
- Included in:
- SkillChoice
- Defined in:
- scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00050 SkillChoiceAbstraction.rb
Overview
Abstraction helping to design skill choice a way that complies to what Visual expect to handle
Instance Attribute Summary collapse
-
#index ⇒ Integer
readonly
Get the index.
-
#mega_enabled ⇒ Boolean
Tell if the mega evolution is enabled.
-
#pokemon ⇒ PFM::PokemonBattler
readonly
The pokemon the player choosed a move.
-
#result ⇒ Battle::Move, :cancel
readonly
The selected move.
Instance Method Summary collapse
-
#reset(pokemon)
Reset the Skill choice.
-
#validated? ⇒ Boolean
If the player made a choice.
Instance Attribute Details
#index ⇒ Integer (readonly)
Get the index
17 18 19 |
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00050 SkillChoiceAbstraction.rb', line 17 def index @index end |
#mega_enabled ⇒ Boolean
Tell if the mega evolution is enabled
14 15 16 |
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00050 SkillChoiceAbstraction.rb', line 14 def mega_enabled @mega_enabled end |
#pokemon ⇒ PFM::PokemonBattler (readonly)
The pokemon the player choosed a move
11 12 13 |
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00050 SkillChoiceAbstraction.rb', line 11 def pokemon @pokemon end |
#result ⇒ Battle::Move, :cancel (readonly)
The selected move
8 9 10 |
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00050 SkillChoiceAbstraction.rb', line 8 def result @result end |
Instance Method Details
#reset(pokemon)
Reset the Skill choice
21 22 23 24 25 26 27 28 |
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00050 SkillChoiceAbstraction.rb', line 21 def reset(pokemon) @pokemon = pokemon @mega_enabled = false self.data = pokemon if respond_to?(:data=, true) @index = @last_indexes[pokemon].to_i.clamp(0, max_index) super() if @super_reset end |
#validated? ⇒ Boolean
If the player made a choice
32 33 34 |
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00050 SkillChoiceAbstraction.rb', line 32 def validated? !@result.nil? && (respond_to?(:done?, true) ? done? : true) end |