Class: RPG::Item

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeItem

Returns a new instance of Item.



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
# File 'lib/rpg/item.rb', line 5

def initialize
  @id = 0
  @name = ""
  @icon_name = ""
  @description = ""
  @scope = 0
  @occasion = 0
  @animation1_id = 0
  @animation2_id = 0
  @menu_se = RPG::AudioFile.new("", 80)
  @common_event_id = 0
  @price = 0
  @consumable = true
  @parameter_type = 0
  @parameter_points = 0
  @recover_hp_rate = 0
  @recover_hp = 0
  @recover_sp_rate = 0
  @recover_sp = 0
  @hit = 100
  @pdef_f = 0
  @mdef_f = 0
  @variance = 0
  @element_set = []
  @plus_state_set = []
  @minus_state_set = []
end

Instance Attribute Details

#animation1_idObject

The animation ID when using the item.



64
65
66
# File 'lib/rpg/item.rb', line 64

def animation1_id
  @animation1_id
end

#animation2_idObject

The animation ID when on the receiving end of the item.



67
68
69
# File 'lib/rpg/item.rb', line 67

def animation2_id
  @animation2_id
end

#common_event_idObject

The Common Event ID.



73
74
75
# File 'lib/rpg/item.rb', line 73

def common_event_id
  @common_event_id
end

#consumableObject

Truth value of whether the item disappears when used.



79
80
81
# File 'lib/rpg/item.rb', line 79

def consumable
  @consumable
end

#descriptionObject

The item description.



43
44
45
# File 'lib/rpg/item.rb', line 43

def description
  @description
end

#element_setObject

The item’s element. An Elemental ID array.



119
120
121
# File 'lib/rpg/item.rb', line 119

def element_set
  @element_set
end

#hitObject

The item’s hit probability.



107
108
109
# File 'lib/rpg/item.rb', line 107

def hit
  @hit
end

#icon_nameObject

The item’s icon graphic file name.



40
41
42
# File 'lib/rpg/item.rb', line 40

def icon_name
  @icon_name
end

#idObject

The item ID.



34
35
36
# File 'lib/rpg/item.rb', line 34

def id
  @id
end

#mdef_fObject

The item’s magic defense F rating.



113
114
115
# File 'lib/rpg/item.rb', line 113

def mdef_f
  @mdef_f
end

SE played when item is used on the menu screen (RPG::AudioFile).



70
71
72
# File 'lib/rpg/item.rb', line 70

def menu_se
  @menu_se
end

#minus_state_setObject

States to cancel. A Stae ID array.



125
126
127
# File 'lib/rpg/item.rb', line 125

def minus_state_set
  @minus_state_set
end

#nameObject

The item name.



37
38
39
# File 'lib/rpg/item.rb', line 37

def name
  @name
end

#occasionObject

When the item may be used

0

always

1

only in battle

2

only from the menu

3

never



61
62
63
# File 'lib/rpg/item.rb', line 61

def occasion
  @occasion
end

#parameter_pointsObject

Amount by which parameter increases.



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

def parameter_points
  @parameter_points
end

#parameter_typeObject

Parameter affected

0

none

1

max HP

2

max SP

3

strength

4

dexterity

5

agility

6

intelligence



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

def parameter_type
  @parameter_type
end

#pdef_fObject

The item’s physical defense F rating.



110
111
112
# File 'lib/rpg/item.rb', line 110

def pdef_f
  @pdef_f
end

#plus_state_setObject

States to add. A State ID array.



122
123
124
# File 'lib/rpg/item.rb', line 122

def plus_state_set
  @plus_state_set
end

#priceObject

The item price.



76
77
78
# File 'lib/rpg/item.rb', line 76

def price
  @price
end

#recover_hpObject

HP recovery amount.



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

def recover_hp
  @recover_hp
end

#recover_hp_rateObject

HP recovery rate.



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

def recover_hp_rate
  @recover_hp_rate
end

#recover_spObject

SP recovery amount.



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

def recover_sp
  @recover_sp
end

#recover_sp_rateObject

SP recovery rate.



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

def recover_sp_rate
  @recover_sp_rate
end

#scopeObject

Scope of the item’s effects:

0

none

1

one enemy

2

all enemies

3

one ally

4

all allies

5

1 ally–HP 0

6

all allies–HP 0

7

the user



54
55
56
# File 'lib/rpg/item.rb', line 54

def scope
  @scope
end

#varianceObject

The item’s degree of variance.



116
117
118
# File 'lib/rpg/item.rb', line 116

def variance
  @variance
end