Class: RPG::Weapon

Inherits:
EquipItem show all
Extended by:
RgssDb::JsonableConstructor
Includes:
RgssDb::Jsonable
Defined in:
lib/rgss_db/model/rpg_maker_data/vx/rpg/weapon.rb,
lib/rgss_db/model/rpg_maker_data/xp/rpg/weapon.rb,
lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/weapon.rb

Overview

The data class for weapons.

Instance Attribute Summary collapse

Attributes inherited from EquipItem

#etype_id, #params

Attributes inherited from BaseItem

#features, #icon_index, #note

Instance Method Summary collapse

Methods included from RgssDb::JsonableConstructor

json_create, json_new

Methods included from RgssDb::Jsonable

#as_json, #to_json

Constructor Details

#initialize ⇒ Weapon

Returns a new instance of Weapon.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/weapon.rb', line 11

def initialize
  super
  @animation_id = 0
  @price = 0
  @hit = 95
  @atk = 0
  @def = 0
  @spi = 0
  @agi = 0
  @two_handed = false
  @fast_attack = false
  @dual_attack = false
  @critical_bonus = false
  @element_set = []
  @state_set = []
end

Instance Attribute Details

#agi ⇒ Object

Returns the value of attribute agi.



28
29
30
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/weapon.rb', line 28

def agi
  @agi
end

#agi_plus ⇒ Object

Returns the value of attribute agi_plus.



35
36
37
# File 'lib/rgss_db/model/rpg_maker_data/xp/rpg/weapon.rb', line 35

def agi_plus
  @agi_plus
end

#animation1_id ⇒ Object

Returns the value of attribute animation1_id.



35
36
37
# File 'lib/rgss_db/model/rpg_maker_data/xp/rpg/weapon.rb', line 35

def animation1_id
  @animation1_id
end

#animation2_id ⇒ Object

Returns the value of attribute animation2_id.



35
36
37
# File 'lib/rgss_db/model/rpg_maker_data/xp/rpg/weapon.rb', line 35

def animation2_id
  @animation2_id
end

#animation_id ⇒ Object

Returns the value of attribute animation_id.



28
29
30
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/weapon.rb', line 28

def animation_id
  @animation_id
end

#atk ⇒ Object

Returns the value of attribute atk.



28
29
30
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/weapon.rb', line 28

def atk
  @atk
end

#critical_bonus ⇒ Object

Returns the value of attribute critical_bonus.



28
29
30
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/weapon.rb', line 28

def critical_bonus
  @critical_bonus
end

#def ⇒ Object

Returns the value of attribute def.



28
29
30
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/weapon.rb', line 28

def def
  @def
end

#description ⇒ Object

Returns the value of attribute description.



35
36
37
# File 'lib/rgss_db/model/rpg_maker_data/xp/rpg/weapon.rb', line 35

def description
  @description
end

#dex_plus ⇒ Object

Returns the value of attribute dex_plus.



35
36
37
# File 'lib/rgss_db/model/rpg_maker_data/xp/rpg/weapon.rb', line 35

def dex_plus
  @dex_plus
end

#dual_attack ⇒ Object

Returns the value of attribute dual_attack.



28
29
30
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/weapon.rb', line 28

def dual_attack
  @dual_attack
end

#element_set ⇒ Object

Returns the value of attribute element_set.



28
29
30
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/weapon.rb', line 28

def element_set
  @element_set
end

#fast_attack ⇒ Object

Returns the value of attribute fast_attack.



28
29
30
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/weapon.rb', line 28

def fast_attack
  @fast_attack
end

#hit ⇒ Object

Returns the value of attribute hit.



28
29
30
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/weapon.rb', line 28

def hit
  @hit
end

#icon_name ⇒ Object

Returns the value of attribute icon_name.



35
36
37
# File 'lib/rgss_db/model/rpg_maker_data/xp/rpg/weapon.rb', line 35

def icon_name
  @icon_name
end

#id ⇒ Object

Returns the value of attribute id.



35
36
37
# File 'lib/rgss_db/model/rpg_maker_data/xp/rpg/weapon.rb', line 35

def id
  @id
end

#int_plus ⇒ Object

Returns the value of attribute int_plus.



35
36
37
# File 'lib/rgss_db/model/rpg_maker_data/xp/rpg/weapon.rb', line 35

def int_plus
  @int_plus
end

#mdef ⇒ Object

Returns the value of attribute mdef.



35
36
37
# File 'lib/rgss_db/model/rpg_maker_data/xp/rpg/weapon.rb', line 35

def mdef
  @mdef
end

#minus_state_set ⇒ Object

Returns the value of attribute minus_state_set.



35
36
37
# File 'lib/rgss_db/model/rpg_maker_data/xp/rpg/weapon.rb', line 35

def minus_state_set
  @minus_state_set
end

#name ⇒ Object

Returns the value of attribute name.



35
36
37
# File 'lib/rgss_db/model/rpg_maker_data/xp/rpg/weapon.rb', line 35

def name
  @name
end

#pdef ⇒ Object

Returns the value of attribute pdef.



35
36
37
# File 'lib/rgss_db/model/rpg_maker_data/xp/rpg/weapon.rb', line 35

def pdef
  @pdef
end

#plus_state_set ⇒ Object

Returns the value of attribute plus_state_set.



35
36
37
# File 'lib/rgss_db/model/rpg_maker_data/xp/rpg/weapon.rb', line 35

def plus_state_set
  @plus_state_set
end

#price ⇒ Object

Returns the value of attribute price.



28
29
30
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/weapon.rb', line 28

def price
  @price
end

#spi ⇒ Object

Returns the value of attribute spi.



28
29
30
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/weapon.rb', line 28

def spi
  @spi
end

#state_set ⇒ Object

Returns the value of attribute state_set.



28
29
30
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/weapon.rb', line 28

def state_set
  @state_set
end

#str_plus ⇒ Object

Returns the value of attribute str_plus.



35
36
37
# File 'lib/rgss_db/model/rpg_maker_data/xp/rpg/weapon.rb', line 35

def str_plus
  @str_plus
end

#two_handed ⇒ Object

Returns the value of attribute two_handed.



28
29
30
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/weapon.rb', line 28

def two_handed
  @two_handed
end

#wtype_id ⇒ Object

Returns the value of attribute wtype_id.



23
24
25
# File 'lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/weapon.rb', line 23

def wtype_id
  @wtype_id
end

Instance Method Details

#performance ⇒ Object



19
20
21
# File 'lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/weapon.rb', line 19

def performance
  params[2] + params[4] + params.inject(0) { |r, v| r += v }
end

#to_s ⇒ Object



31
32
33
# File 'lib/rgss_db/model/rpg_maker_data/xp/rpg/weapon.rb', line 31

def to_s
  @name.to_s
end