Class: RPG::Enemy::Action

Inherits:
Object
  • Object
show all
Defined in:
lib/rpg/enemy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeAction

Returns a new instance of Action


124
125
126
127
128
129
130
131
132
133
134
# File 'lib/rpg/enemy.rb', line 124

def initialize
  @kind = 0
  @basic = 0
  @skill_id = 1
  @condition_turn_a = 0
  @condition_turn_b = 1
  @condition_hp = 100
  @condition_level = 1
  @condition_switch_id = 0
  @rating = 5
end

Instance Attribute Details

#basicObject

When set to a [Basic] action, defines it further:

0

attack

1

defend

2

escape

3

do nothing


146
147
148
# File 'lib/rpg/enemy.rb', line 146

def basic
  @basic
end

#condition_hpObject

Percentage specified in the [HP] condition.

When HP is not specified as a condition, this value is set to 100.


166
167
168
# File 'lib/rpg/enemy.rb', line 166

def condition_hp
  @condition_hp
end

#condition_levelObject

Standard level specified in the [Level] condition.

When the level is not specified as a condition, this value is set to 1.


171
172
173
# File 'lib/rpg/enemy.rb', line 171

def condition_level
  @condition_level
end

#condition_switch_idObject

Switch ID specified in the [Switch] condition.

When the switch ID is not specified as a condition, this value is set to 0. Consequently, it is essential to check whether this value is 0.


178
179
180
# File 'lib/rpg/enemy.rb', line 178

def condition_switch_id
  @condition_switch_id
end

#condition_turn_aObject

a value specified in the [Turn] condition. To be input in the form a + bx.

When the turn is not specified as a condition, a = 0 and b = 1.


155
156
157
# File 'lib/rpg/enemy.rb', line 155

def condition_turn_a
  @condition_turn_a
end

#condition_turn_bObject

b value specified in the [Turn] condition. To be input in the form a + bx.

When the turn is not specified as a condition, a = 0 and b = 1.


161
162
163
# File 'lib/rpg/enemy.rb', line 161

def condition_turn_b
  @condition_turn_b
end

#kindObject

Type of action:

0

basic

1

skill


139
140
141
# File 'lib/rpg/enemy.rb', line 139

def kind
  @kind
end

#ratingObject

The action's rating (1..10).


181
182
183
# File 'lib/rpg/enemy.rb', line 181

def rating
  @rating
end

#skill_idObject

When set to a [Skill], the ID of that skill.


149
150
151
# File 'lib/rpg/enemy.rb', line 149

def skill_id
  @skill_id
end