Class: Battle::Actions::PreAttack
- Defined in:
- scripts/01600 Alpha 25 Battle Engine/03000 Actions/00002 PreAttack.rb
Overview
Class describing the Pre Attacks Action
Instance Method Summary collapse
-
#<=>(other) ⇒ Integer
Compare this action with another.
-
#execute
Execute the action.
-
#initialize(scene, attack_actions) ⇒ PreAttack
constructor
Create a new attack action.
Methods inherited from Base
Constructor Details
#initialize(scene, attack_actions) ⇒ PreAttack
Create a new attack action
7 8 9 10 |
# File 'scripts/01600 Alpha 25 Battle Engine/03000 Actions/00002 PreAttack.rb', line 7 def initialize(scene, attack_actions) super(scene) @attack_actions = attack_actions end |
Instance Method Details
#<=>(other) ⇒ Integer
Compare this action with another
15 16 17 18 19 |
# File 'scripts/01600 Alpha 25 Battle Engine/03000 Actions/00002 PreAttack.rb', line 15 def <=>(other) return 1 if other.is_a?(Attack) return -1 end |
#execute
Execute the action
22 23 24 |
# File 'scripts/01600 Alpha 25 Battle Engine/03000 Actions/00002 PreAttack.rb', line 22 def execute @attack_actions.each { |action| action.move.proceed_pre_attack(action.launcher) } end |