Class: Battle::Actions::HighPriorityItem
- Defined in:
- scripts/01600 Alpha 25 Battle Engine/03000 Actions/00007 HighPriorityItem.rb
Overview
Class describing the activation message of item granting priority
Instance Method Summary collapse
-
#<=>(other) ⇒ Integer
Compare this action with another.
-
#execute
Execute the action.
-
#initialize(scene, holder) ⇒ HighPriorityItem
constructor
Create a new high priority item action.
Methods inherited from Base
Constructor Details
#initialize(scene, holder) ⇒ HighPriorityItem
Create a new high priority item action
8 9 10 11 |
# File 'scripts/01600 Alpha 25 Battle Engine/03000 Actions/00007 HighPriorityItem.rb', line 8 def initialize(scene, holder) super(scene) @holder = holder end |
Instance Method Details
#<=>(other) ⇒ Integer
Compare this action with another
16 17 18 19 20 |
# File 'scripts/01600 Alpha 25 Battle Engine/03000 Actions/00007 HighPriorityItem.rb', line 16 def <=>(other) return -1 if other.is_a?(Flee) return 1 end |
#execute
Execute the action
23 24 25 26 27 |
# File 'scripts/01600 Alpha 25 Battle Engine/03000 Actions/00007 HighPriorityItem.rb', line 23 def execute item_name = @holder.item_name @holder.send(:consume_berry, @holder) if @holder.item_effect.is_a?(Effects::Item::Berry) @scene.(parse_text_with_pokemon(19, 1031, @holder, PFM::Text::ITEM2[1] => item_name)) end |