Class: RPG::State
- Inherits:
-
Object
- Object
- RPG::State
- Defined in:
- lib/rpg/state.rb
Overview
Data class for state.
Instance Attribute Summary collapse
-
#agi_rate ⇒ Object
Agility percentage.
-
#animation_id ⇒ Object
The state’s animation ID.
-
#atk_rate ⇒ Object
Attack percentage.
-
#auto_release_prob ⇒ Object
Percent probability of wearing off after the number of turns in hold_turn have passed.
-
#battle_only ⇒ Object
Truth value of whether the state wears off at battle end.
-
#cant_evade ⇒ Object
Truth value of the [Can’t Evade] option.
-
#cant_get_exp ⇒ Object
Truth value of the [Can’t Get EXP] option.
-
#dex_rate ⇒ Object
Dexterity percentage.
-
#eva ⇒ Object
Evasion correction.
-
#guard_element_set ⇒ Object
Elemental defense.
-
#hit_rate ⇒ Object
Hit percentage.
-
#hold_turn ⇒ Object
Returns the value of attribute hold_turn.
-
#id ⇒ Object
State ID.
-
#int_rate ⇒ Object
Intelligence percentage.
-
#maxhp_rate ⇒ Object
Maximum HP percentage.
-
#maxsp_rate ⇒ Object
Maximum SP percentage.
-
#mdef_rate ⇒ Object
Magic defense percentage.
-
#minus_state_set ⇒ Object
States to cancel.
-
#name ⇒ Object
State name.
-
#nonresistance ⇒ Object
Truth value of the [Nonresistance] option.
-
#pdef_rate ⇒ Object
Physical defense percentage.
-
#plus_state_set ⇒ Object
States to add.
-
#rating ⇒ Object
State rating (0..10).
-
#restriction ⇒ Object
- Sets restrictions: 0
- none 1
- can’t use magic 2
- always attack enemies 3
- always attack allies 4
-
can’t move.
-
#shock_release_prob ⇒ Object
Percent probability of wearing off after receiving physical damage.
-
#slip_damage ⇒ Object
Truth value of the [Slip Damage] option.
-
#str_rate ⇒ Object
Strength percentage.
-
#zero_hp ⇒ Object
Truth value of the [Regard as HP 0] option.
Instance Method Summary collapse
-
#initialize ⇒ State
constructor
A new instance of State.
Constructor Details
#initialize ⇒ State
Returns a new instance of State.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/rpg/state.rb', line 4 def initialize @id = 0 @name = "" @animation_id = 0 @restriction = 0 @nonresistance = false @zero_hp = false @cant_get_exp = false @cant_evade = false @slip_damage = false @rating = 5 @hit_rate = 100 @maxhp_rate = 100 @maxsp_rate = 100 @str_rate = 100 @dex_rate = 100 @agi_rate = 100 @int_rate = 100 @atk_rate = 100 @pdef_rate = 100 @mdef_rate = 100 @eva = 0 @battle_only = true @hold_turn = 0 @auto_release_prob = 0 @shock_release_prob = 0 @guard_element_set = [] @plus_state_set = [] @minus_state_set = [] end |
Instance Attribute Details
#agi_rate ⇒ Object
Agility percentage.
86 87 88 |
# File 'lib/rpg/state.rb', line 86 def agi_rate @agi_rate end |
#animation_id ⇒ Object
The state’s animation ID.
42 43 44 |
# File 'lib/rpg/state.rb', line 42 def animation_id @animation_id end |
#atk_rate ⇒ Object
Attack percentage.
92 93 94 |
# File 'lib/rpg/state.rb', line 92 def atk_rate @atk_rate end |
#auto_release_prob ⇒ Object
Percent probability of wearing off after the number of turns in hold_turn have passed.
110 111 112 |
# File 'lib/rpg/state.rb', line 110 def auto_release_prob @auto_release_prob end |
#battle_only ⇒ Object
Truth value of whether the state wears off at battle end.
104 105 106 |
# File 'lib/rpg/state.rb', line 104 def battle_only @battle_only end |
#cant_evade ⇒ Object
Truth value of the [Can’t Evade] option.
62 63 64 |
# File 'lib/rpg/state.rb', line 62 def cant_evade @cant_evade end |
#cant_get_exp ⇒ Object
Truth value of the [Can’t Get EXP] option.
59 60 61 |
# File 'lib/rpg/state.rb', line 59 def cant_get_exp @cant_get_exp end |
#dex_rate ⇒ Object
Dexterity percentage.
83 84 85 |
# File 'lib/rpg/state.rb', line 83 def dex_rate @dex_rate end |
#eva ⇒ Object
Evasion correction.
101 102 103 |
# File 'lib/rpg/state.rb', line 101 def eva @eva end |
#guard_element_set ⇒ Object
Elemental defense. An Elemental ID array.
116 117 118 |
# File 'lib/rpg/state.rb', line 116 def guard_element_set @guard_element_set end |
#hit_rate ⇒ Object
Hit percentage.
71 72 73 |
# File 'lib/rpg/state.rb', line 71 def hit_rate @hit_rate end |
#hold_turn ⇒ Object
Returns the value of attribute hold_turn.
106 107 108 |
# File 'lib/rpg/state.rb', line 106 def hold_turn @hold_turn end |
#id ⇒ Object
State ID.
36 37 38 |
# File 'lib/rpg/state.rb', line 36 def id @id end |
#int_rate ⇒ Object
Intelligence percentage.
89 90 91 |
# File 'lib/rpg/state.rb', line 89 def int_rate @int_rate end |
#maxhp_rate ⇒ Object
Maximum HP percentage.
74 75 76 |
# File 'lib/rpg/state.rb', line 74 def maxhp_rate @maxhp_rate end |
#maxsp_rate ⇒ Object
Maximum SP percentage.
77 78 79 |
# File 'lib/rpg/state.rb', line 77 def maxsp_rate @maxsp_rate end |
#mdef_rate ⇒ Object
Magic defense percentage.
98 99 100 |
# File 'lib/rpg/state.rb', line 98 def mdef_rate @mdef_rate end |
#minus_state_set ⇒ Object
States to cancel. A State ID array.
122 123 124 |
# File 'lib/rpg/state.rb', line 122 def minus_state_set @minus_state_set end |
#name ⇒ Object
State name.
39 40 41 |
# File 'lib/rpg/state.rb', line 39 def name @name end |
#nonresistance ⇒ Object
Truth value of the [Nonresistance] option.
53 54 55 |
# File 'lib/rpg/state.rb', line 53 def nonresistance @nonresistance end |
#pdef_rate ⇒ Object
Physical defense percentage.
95 96 97 |
# File 'lib/rpg/state.rb', line 95 def pdef_rate @pdef_rate end |
#plus_state_set ⇒ Object
States to add. A State ID array.
119 120 121 |
# File 'lib/rpg/state.rb', line 119 def plus_state_set @plus_state_set end |
#rating ⇒ Object
State rating (0..10).
68 69 70 |
# File 'lib/rpg/state.rb', line 68 def @rating end |
#restriction ⇒ Object
Sets restrictions:
- 0
-
none
- 1
-
can’t use magic
- 2
-
always attack enemies
- 3
-
always attack allies
- 4
-
can’t move
50 51 52 |
# File 'lib/rpg/state.rb', line 50 def restriction @restriction end |
#shock_release_prob ⇒ Object
Percent probability of wearing off after receiving physical damage.
113 114 115 |
# File 'lib/rpg/state.rb', line 113 def shock_release_prob @shock_release_prob end |
#slip_damage ⇒ Object
Truth value of the [Slip Damage] option.
65 66 67 |
# File 'lib/rpg/state.rb', line 65 def slip_damage @slip_damage end |
#str_rate ⇒ Object
Strength percentage.
80 81 82 |
# File 'lib/rpg/state.rb', line 80 def str_rate @str_rate end |
#zero_hp ⇒ Object
Truth value of the [Regard as HP 0] option.
56 57 58 |
# File 'lib/rpg/state.rb', line 56 def zero_hp @zero_hp end |