Class: RPG::Item
- Inherits:
-
Object
- Object
- RPG::Item
- Defined in:
- lib/rpg/item.rb
Instance Attribute Summary collapse
-
#animation1_id ⇒ Object
The animation ID when using the item.
-
#animation2_id ⇒ Object
The animation ID when on the receiving end of the item.
-
#common_event_id ⇒ Object
The Common Event ID.
-
#consumable ⇒ Object
Truth value of whether the item disappears when used.
-
#description ⇒ Object
The item description.
-
#element_set ⇒ Object
The item’s element.
-
#hit ⇒ Object
The item’s hit probability.
-
#icon_name ⇒ Object
The item’s icon graphic file name.
-
#id ⇒ Object
The item ID.
-
#mdef_f ⇒ Object
The item’s magic defense F rating.
-
#menu_se ⇒ Object
SE played when item is used on the menu screen (RPG::AudioFile).
-
#minus_state_set ⇒ Object
States to cancel.
-
#name ⇒ Object
The item name.
-
#occasion ⇒ Object
- When the item may be used 0
- always 1
- only in battle 2
- only from the menu 3
-
never.
-
#parameter_points ⇒ Object
Amount by which parameter increases.
-
#parameter_type ⇒ Object
- Parameter affected 0
- none 1
- max HP 2
- max SP 3
- strength 4
- dexterity 5
- agility 6
-
intelligence.
-
#pdef_f ⇒ Object
The item’s physical defense F rating.
-
#plus_state_set ⇒ Object
States to add.
-
#price ⇒ Object
The item price.
-
#recover_hp ⇒ Object
HP recovery amount.
-
#recover_hp_rate ⇒ Object
HP recovery rate.
-
#recover_sp ⇒ Object
SP recovery amount.
-
#recover_sp_rate ⇒ Object
SP recovery rate.
-
#scope ⇒ Object
- 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.
-
#variance ⇒ Object
The item’s degree of variance.
Instance Method Summary collapse
-
#initialize ⇒ Item
constructor
A new instance of Item.
Constructor Details
#initialize ⇒ Item
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_id ⇒ Object
The animation ID when using the item.
64 65 66 |
# File 'lib/rpg/item.rb', line 64 def animation1_id @animation1_id end |
#animation2_id ⇒ Object
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_id ⇒ Object
The Common Event ID.
73 74 75 |
# File 'lib/rpg/item.rb', line 73 def common_event_id @common_event_id end |
#consumable ⇒ Object
Truth value of whether the item disappears when used.
79 80 81 |
# File 'lib/rpg/item.rb', line 79 def consumable @consumable end |
#description ⇒ Object
The item description.
43 44 45 |
# File 'lib/rpg/item.rb', line 43 def description @description end |
#element_set ⇒ Object
The item’s element. An Elemental ID array.
119 120 121 |
# File 'lib/rpg/item.rb', line 119 def element_set @element_set end |
#hit ⇒ Object
The item’s hit probability.
107 108 109 |
# File 'lib/rpg/item.rb', line 107 def hit @hit end |
#icon_name ⇒ Object
The item’s icon graphic file name.
40 41 42 |
# File 'lib/rpg/item.rb', line 40 def icon_name @icon_name end |
#id ⇒ Object
The item ID.
34 35 36 |
# File 'lib/rpg/item.rb', line 34 def id @id end |
#mdef_f ⇒ Object
The item’s magic defense F rating.
113 114 115 |
# File 'lib/rpg/item.rb', line 113 def mdef_f @mdef_f end |
#menu_se ⇒ Object
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 end |
#minus_state_set ⇒ Object
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 |
#name ⇒ Object
The item name.
37 38 39 |
# File 'lib/rpg/item.rb', line 37 def name @name end |
#occasion ⇒ Object
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_points ⇒ Object
Amount by which parameter increases.
92 93 94 |
# File 'lib/rpg/item.rb', line 92 def parameter_points @parameter_points end |
#parameter_type ⇒ Object
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_f ⇒ Object
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_set ⇒ Object
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 |
#price ⇒ Object
The item price.
76 77 78 |
# File 'lib/rpg/item.rb', line 76 def price @price end |
#recover_hp ⇒ Object
HP recovery amount.
98 99 100 |
# File 'lib/rpg/item.rb', line 98 def recover_hp @recover_hp end |
#recover_hp_rate ⇒ Object
HP recovery rate.
95 96 97 |
# File 'lib/rpg/item.rb', line 95 def recover_hp_rate @recover_hp_rate end |
#recover_sp ⇒ Object
SP recovery amount.
104 105 106 |
# File 'lib/rpg/item.rb', line 104 def recover_sp @recover_sp end |
#recover_sp_rate ⇒ Object
SP recovery rate.
101 102 103 |
# File 'lib/rpg/item.rb', line 101 def recover_sp_rate @recover_sp_rate end |
#scope ⇒ Object
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 |
#variance ⇒ Object
The item’s degree of variance.
116 117 118 |
# File 'lib/rpg/item.rb', line 116 def variance @variance end |