Class: Battle::Actions::Mega
- Defined in:
- scripts/01600 Alpha 25 Battle Engine/03000 Actions/00003 Mega.rb
Overview
Class describing the Mega Evolution action
Instance Attribute Summary collapse
-
#user ⇒ PFM::PokemonBattler
readonly
Get the user of this action.
Instance Method Summary collapse
-
#<=>(other) ⇒ Integer
Compare this action with another.
-
#execute
Execute the action.
-
#initialize(scene, user) ⇒ Mega
constructor
Create a new mega evolution action.
Methods inherited from Base
Constructor Details
#initialize(scene, user) ⇒ Mega
Create a new mega evolution action
11 12 13 14 |
# File 'scripts/01600 Alpha 25 Battle Engine/03000 Actions/00003 Mega.rb', line 11 def initialize(scene, user) super(scene) @user = user end |
Instance Attribute Details
#user ⇒ PFM::PokemonBattler (readonly)
Get the user of this action
7 8 9 |
# File 'scripts/01600 Alpha 25 Battle Engine/03000 Actions/00003 Mega.rb', line 7 def user @user end |
Instance Method Details
#<=>(other) ⇒ Integer
Compare this action with another
19 20 21 22 23 24 25 26 27 |
# File 'scripts/01600 Alpha 25 Battle Engine/03000 Actions/00003 Mega.rb', line 19 def <=>(other) return 1 if other.is_a?(HighPriorityItem) return 1 if other.is_a?(Attack) && Attack.from(other).pursuit_enabled return 1 if other.is_a?(Item) return 1 if other.is_a?(Switch) return Mega.from(other).user.spd <=> @user.spd if other.is_a?(Mega) return -1 end |
#execute
Execute the action
30 31 32 33 34 35 36 37 |
# File 'scripts/01600 Alpha 25 Battle Engine/03000 Actions/00003 Mega.rb', line 30 def execute @scene.logic.mega_evolve.mark_as_mega_evolved(@user) @scene.() @user.mega_evolve @scene.visual.show_switch_form_animation(@user) @user.ability_effect.on_switch_event(@scene.logic.switch_handler, @user, @user) # TODO! end |