Class: RPG::State

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

Overview

Data class for state.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeState


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_rateObject

Agility percentage.


86
87
88
# File 'lib/rpg/state.rb', line 86

def agi_rate
  @agi_rate
end

#animation_idObject

The state's animation ID.


42
43
44
# File 'lib/rpg/state.rb', line 42

def animation_id
  @animation_id
end

#atk_rateObject

Attack percentage.


92
93
94
# File 'lib/rpg/state.rb', line 92

def atk_rate
  @atk_rate
end

#auto_release_probObject

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_onlyObject

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_evadeObject

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_expObject

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_rateObject

Dexterity percentage.


83
84
85
# File 'lib/rpg/state.rb', line 83

def dex_rate
  @dex_rate
end

#evaObject

Evasion correction.


101
102
103
# File 'lib/rpg/state.rb', line 101

def eva
  @eva
end

#guard_element_setObject

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_rateObject

Hit percentage.


71
72
73
# File 'lib/rpg/state.rb', line 71

def hit_rate
  @hit_rate
end

#hold_turnObject

Returns the value of attribute hold_turn


106
107
108
# File 'lib/rpg/state.rb', line 106

def hold_turn
  @hold_turn
end

#idObject

State ID.


36
37
38
# File 'lib/rpg/state.rb', line 36

def id
  @id
end

#int_rateObject

Intelligence percentage.


89
90
91
# File 'lib/rpg/state.rb', line 89

def int_rate
  @int_rate
end

#maxhp_rateObject

Maximum HP percentage.


74
75
76
# File 'lib/rpg/state.rb', line 74

def maxhp_rate
  @maxhp_rate
end

#maxsp_rateObject

Maximum SP percentage.


77
78
79
# File 'lib/rpg/state.rb', line 77

def maxsp_rate
  @maxsp_rate
end

#mdef_rateObject

Magic defense percentage.


98
99
100
# File 'lib/rpg/state.rb', line 98

def mdef_rate
  @mdef_rate
end

#minus_state_setObject

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

#nameObject

State name.


39
40
41
# File 'lib/rpg/state.rb', line 39

def name
  @name
end

#nonresistanceObject

Truth value of the [Nonresistance] option.


53
54
55
# File 'lib/rpg/state.rb', line 53

def nonresistance
  @nonresistance
end

#pdef_rateObject

Physical defense percentage.


95
96
97
# File 'lib/rpg/state.rb', line 95

def pdef_rate
  @pdef_rate
end

#plus_state_setObject

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

#ratingObject

State rating (0..10).


68
69
70
# File 'lib/rpg/state.rb', line 68

def rating
  @rating
end

#restrictionObject

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_probObject

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_damageObject

Truth value of the [Slip Damage] option.


65
66
67
# File 'lib/rpg/state.rb', line 65

def slip_damage
  @slip_damage
end

#str_rateObject

Strength percentage.


80
81
82
# File 'lib/rpg/state.rb', line 80

def str_rate
  @str_rate
end

#zero_hpObject

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