Class: Battle::Actions::Base

Inherits:
Object
  • Object
show all
Defined in:
scripts/01600 Alpha 25 Battle Engine/03000 Actions/00001 Actions.rb

Overview

Base class for all actions

Direct Known Subclasses

Attack, Flee, HighPriorityItem, Item, Mega, PreAttack, Switch

Instance Method Summary collapse

Constructor Details

#initialize(scene) ⇒ Base

Creates a new action

Parameters:



8
9
10
# File 'scripts/01600 Alpha 25 Battle Engine/03000 Actions/00001 Actions.rb', line 8

def initialize(scene)
  @scene = scene
end

Instance Method Details

#<=>(other) ⇒ Integer

Compare this action with another

Parameters:

  • other (Base)

    other action

Returns:



15
16
17
# File 'scripts/01600 Alpha 25 Battle Engine/03000 Actions/00001 Actions.rb', line 15

def <=>(other)
  return 1
end

#execute

Execute the action



26
27
28
# File 'scripts/01600 Alpha 25 Battle Engine/03000 Actions/00001 Actions.rb', line 26

def execute
  return nil
end

#valid?Boolean

Tell if the action is valid

Returns:

  • (Boolean)


21
22
23
# File 'scripts/01600 Alpha 25 Battle Engine/03000 Actions/00001 Actions.rb', line 21

def valid?
  return self.class != Base
end