Class: RPG::Troop::Page::Condition

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

Overview

A database of battle event [Conditions].

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCondition

Returns a new instance of Condition.



76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/rpg/troop.rb', line 76

def initialize
  @turn_valid = false
  @enemy_valid = false
  @actor_valid = false
  @switch_valid = false
  @turn_a = 0
  @turn_b = 0
  @enemy_index = 0
  @enemy_hp = 50
  @actor_id = 1
  @actor_hp = 50
  @switch_id = 1
end

Instance Attribute Details

#actor_hpObject

HP percentage specified in the [Actor] condition.



120
121
122
# File 'lib/rpg/troop.rb', line 120

def actor_hp
  @actor_hp
end

#actor_idObject

Actor ID specified in the [Actor] condition.



117
118
119
# File 'lib/rpg/troop.rb', line 117

def actor_id
  @actor_id
end

#actor_validObject

Truth value for whether the [Actor] condition is valid.



97
98
99
# File 'lib/rpg/troop.rb', line 97

def actor_valid
  @actor_valid
end

#enemy_hpObject

HP percentage specified in the [Enemy] condition.



114
115
116
# File 'lib/rpg/troop.rb', line 114

def enemy_hp
  @enemy_hp
end

#enemy_indexObject

Troop member index specified in the [Enemy] condition (0..7).



111
112
113
# File 'lib/rpg/troop.rb', line 111

def enemy_index
  @enemy_index
end

#enemy_validObject

Truth value for whether the [Enemy] condition is valid.



94
95
96
# File 'lib/rpg/troop.rb', line 94

def enemy_valid
  @enemy_valid
end

#switch_idObject

Switch ID specified in the [Switch] condition.



123
124
125
# File 'lib/rpg/troop.rb', line 123

def switch_id
  @switch_id
end

#switch_validObject

Truth value for whether the [Switch] condition is valid.



100
101
102
# File 'lib/rpg/troop.rb', line 100

def switch_valid
  @switch_valid
end

#turn_aObject

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



104
105
106
# File 'lib/rpg/troop.rb', line 104

def turn_a
  @turn_a
end

#turn_bObject

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



108
109
110
# File 'lib/rpg/troop.rb', line 108

def turn_b
  @turn_b
end

#turn_validObject

Truth value for whether the [Turn] condition is valid.



91
92
93
# File 'lib/rpg/troop.rb', line 91

def turn_valid
  @turn_valid
end