Class: RPG::Weapon
- Inherits:
-
Object
- Object
- RPG::Weapon
- Defined in:
- lib/rpg/weapon.rb
Overview
Data class for weapons.
Instance Attribute Summary collapse
-
#agi_plus ⇒ Object
The weapon’s agility bonus.
-
#animation1_id ⇒ Object
The animation ID when using the weapon.
-
#animation2_id ⇒ Object
The animation ID when on the receiving end of the weapon.
-
#atk ⇒ Object
The weapon’s attack power.
-
#description ⇒ Object
The weapon description.
-
#dex_plus ⇒ Object
The weapon’s dexterity bonus.
-
#element_set ⇒ Object
The weapon’s element.
-
#icon_name ⇒ Object
The weapon’s icon graphic file name.
-
#id ⇒ Object
The weapon ID.
-
#int_plus ⇒ Object
The weapon’s intelligence bonus.
-
#mdef ⇒ Object
The weapon’s magic defense rating.
-
#minus_state_set ⇒ Object
States to cancel.
-
#name ⇒ Object
The weapon name.
-
#pdef ⇒ Object
The weapon’s physical defense rating.
-
#plus_state_set ⇒ Object
States to add.
-
#price ⇒ Object
The weapon’s price.
-
#str_plus ⇒ Object
The weapon’s strength bonus.
Instance Method Summary collapse
-
#initialize ⇒ Weapon
constructor
A new instance of Weapon.
Constructor Details
#initialize ⇒ Weapon
Returns a new instance of Weapon.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/rpg/weapon.rb', line 4 def initialize @id = 0 @name = "" @icon_name = "" @description = "" @animation1_id = 0 @animation2_id = 0 @price = 0 @atk = 0 @pdef = 0 @mdef = 0 @str_plus = 0 @dex_plus = 0 @agi_plus = 0 @int_plus = 0 @element_set = [] @plus_state_set = [] @minus_state_set = [] end |
Instance Attribute Details
#agi_plus ⇒ Object
The weapon’s agility bonus.
61 62 63 |
# File 'lib/rpg/weapon.rb', line 61 def agi_plus @agi_plus end |
#animation1_id ⇒ Object
The animation ID when using the weapon.
37 38 39 |
# File 'lib/rpg/weapon.rb', line 37 def animation1_id @animation1_id end |
#animation2_id ⇒ Object
The animation ID when on the receiving end of the weapon.
40 41 42 |
# File 'lib/rpg/weapon.rb', line 40 def animation2_id @animation2_id end |
#atk ⇒ Object
The weapon’s attack power.
46 47 48 |
# File 'lib/rpg/weapon.rb', line 46 def atk @atk end |
#description ⇒ Object
The weapon description.
34 35 36 |
# File 'lib/rpg/weapon.rb', line 34 def description @description end |
#dex_plus ⇒ Object
The weapon’s dexterity bonus.
58 59 60 |
# File 'lib/rpg/weapon.rb', line 58 def dex_plus @dex_plus end |
#element_set ⇒ Object
The weapon’s element. An Elemental ID array.
67 68 69 |
# File 'lib/rpg/weapon.rb', line 67 def element_set @element_set end |
#icon_name ⇒ Object
The weapon’s icon graphic file name.
31 32 33 |
# File 'lib/rpg/weapon.rb', line 31 def icon_name @icon_name end |
#id ⇒ Object
The weapon ID.
25 26 27 |
# File 'lib/rpg/weapon.rb', line 25 def id @id end |
#int_plus ⇒ Object
The weapon’s intelligence bonus.
64 65 66 |
# File 'lib/rpg/weapon.rb', line 64 def int_plus @int_plus end |
#mdef ⇒ Object
The weapon’s magic defense rating.
52 53 54 |
# File 'lib/rpg/weapon.rb', line 52 def mdef @mdef end |
#minus_state_set ⇒ Object
States to cancel. A State ID array.
73 74 75 |
# File 'lib/rpg/weapon.rb', line 73 def minus_state_set @minus_state_set end |
#name ⇒ Object
The weapon name.
28 29 30 |
# File 'lib/rpg/weapon.rb', line 28 def name @name end |
#pdef ⇒ Object
The weapon’s physical defense rating.
49 50 51 |
# File 'lib/rpg/weapon.rb', line 49 def pdef @pdef end |
#plus_state_set ⇒ Object
States to add. A State ID array.
70 71 72 |
# File 'lib/rpg/weapon.rb', line 70 def plus_state_set @plus_state_set end |
#price ⇒ Object
The weapon’s price.
43 44 45 |
# File 'lib/rpg/weapon.rb', line 43 def price @price end |
#str_plus ⇒ Object
The weapon’s strength bonus.
55 56 57 |
# File 'lib/rpg/weapon.rb', line 55 def str_plus @str_plus end |