Class: RPG::Enemy::Action
- Inherits:
-
Object
- Object
- RPG::Enemy::Action
- Defined in:
- lib/rpg/enemy.rb
Instance Attribute Summary collapse
-
#basic ⇒ Object
- When set to a [Basic] action, defines it further: 0
- attack 1
- defend 2
- escape 3
-
do nothing.
-
#condition_hp ⇒ Object
Percentage specified in the [HP] condition.
-
#condition_level ⇒ Object
Standard level specified in the [Level] condition.
-
#condition_switch_id ⇒ Object
Switch ID specified in the [Switch] condition.
-
#condition_turn_a ⇒ Object
a value specified in the [Turn] condition.
-
#condition_turn_b ⇒ Object
b value specified in the [Turn] condition.
-
#kind ⇒ Object
- Type of action: 0
- basic 1
-
skill.
-
#rating ⇒ Object
The action’s rating (1..10).
-
#skill_id ⇒ Object
When set to a [Skill], the ID of that skill.
Instance Method Summary collapse
-
#initialize ⇒ Action
constructor
A new instance of Action.
Constructor Details
#initialize ⇒ Action
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
#basic ⇒ Object
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_hp ⇒ Object
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_level ⇒ Object
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_id ⇒ Object
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_a ⇒ Object
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_b ⇒ Object
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 |
#kind ⇒ Object
Type of action:
- 0
-
basic
- 1
-
skill
139 140 141 |
# File 'lib/rpg/enemy.rb', line 139 def kind @kind end |
#rating ⇒ Object
The action’s rating (1..10).
181 182 183 |
# File 'lib/rpg/enemy.rb', line 181 def @rating end |
#skill_id ⇒ Object
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 |