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

#initializeWeapon

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

#agiObject

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_plusObject

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_idObject

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_idObject

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_idObject

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

#atkObject

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_bonusObject

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

#defObject

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

#descriptionObject

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_plusObject

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_attackObject

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_setObject

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_attackObject

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

#hitObject

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_nameObject

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

#idObject

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_plusObject

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

#mdefObject

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_setObject

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

#nameObject

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

#pdefObject

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_setObject

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

#priceObject

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

#spiObject

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_setObject

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_plusObject

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_handedObject

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_idObject

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

#performanceObject



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_sObject



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

def to_s
  @name.to_s
end