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

Instance Method Summary collapse

Instance Attribute Details

#indexInteger (readonly)

Get the index

Returns:



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_enabledBoolean

Tell if the mega evolution is enabled

Returns:

  • (Boolean)


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

#pokemonPFM::PokemonBattler (readonly)

The pokemon the player choosed a move

Returns:



11
12
13
# File 'scripts/01600 Alpha 25 Battle Engine/00001 Battle_Scene/00001 BattleUI/00050 SkillChoiceAbstraction.rb', line 11

def pokemon
  @pokemon
end

#resultBattle::Move, :cancel (readonly)

The selected move

Returns:



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

Parameters:



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)
  update_button_opacity
  super() if @super_reset
end

#validated?Boolean

If the player made a choice

Returns:

  • (Boolean)


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