Class: RPG::Item

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

Overview

The data class for items.

Instance Attribute Summary collapse

Attributes inherited from UsableItem

#absorb_damage, #animation_id, #atk_f, #base_damage, #damage, #damage_to_mp, #effects, #hit_type, #ignore_defense, #physical_attack, #repeats, #speed, #spi_f, #success_rate, #tp_gain

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

Methods inherited from UsableItem

#battle_ok?, #certain?, #dual?, #for_all?, #for_dead_friend?, #for_friend?, #for_one?, #for_opponent?, #for_random?, #for_three?, #for_two?, #for_user?, #magical?, #menu_ok?, #need_selection?, #number_of_targets, #physical?

Constructor Details

#initializeItem

Returns a new instance of Item.



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

def initialize
  super
  @scope = 7
  @price = 0
  @consumable = true
  @hp_recovery_rate = 0
  @hp_recovery = 0
  @mp_recovery_rate = 0
  @mp_recovery = 0
  @parameter_type = 0
  @parameter_points = 0
end

Instance Attribute Details

#animation1_idObject

Returns the value of attribute animation1_id.



43
44
45
# File 'lib/rgss_db/model/rpg_maker_data/xp/rpg/item.rb', line 43

def animation1_id
  @animation1_id
end

#animation2_idObject

Returns the value of attribute animation2_id.



43
44
45
# File 'lib/rgss_db/model/rpg_maker_data/xp/rpg/item.rb', line 43

def animation2_id
  @animation2_id
end

#common_event_idObject

Returns the value of attribute common_event_id.



43
44
45
# File 'lib/rgss_db/model/rpg_maker_data/xp/rpg/item.rb', line 43

def common_event_id
  @common_event_id
end

#consumableObject

Returns the value of attribute consumable.



24
25
26
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/item.rb', line 24

def consumable
  @consumable
end

#descriptionObject

Returns the value of attribute description.



43
44
45
# File 'lib/rgss_db/model/rpg_maker_data/xp/rpg/item.rb', line 43

def description
  @description
end

#element_setObject

Returns the value of attribute element_set.



43
44
45
# File 'lib/rgss_db/model/rpg_maker_data/xp/rpg/item.rb', line 43

def element_set
  @element_set
end

#hitObject

Returns the value of attribute hit.



43
44
45
# File 'lib/rgss_db/model/rpg_maker_data/xp/rpg/item.rb', line 43

def hit
  @hit
end

#hp_recoveryObject

Returns the value of attribute hp_recovery.



24
25
26
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/item.rb', line 24

def hp_recovery
  @hp_recovery
end

#hp_recovery_rateObject

Returns the value of attribute hp_recovery_rate.



24
25
26
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/item.rb', line 24

def hp_recovery_rate
  @hp_recovery_rate
end

#icon_nameObject

Returns the value of attribute icon_name.



43
44
45
# File 'lib/rgss_db/model/rpg_maker_data/xp/rpg/item.rb', line 43

def icon_name
  @icon_name
end

#idObject

Returns the value of attribute id.



43
44
45
# File 'lib/rgss_db/model/rpg_maker_data/xp/rpg/item.rb', line 43

def id
  @id
end

#itype_idObject

Returns the value of attribute itype_id.



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

def itype_id
  @itype_id
end

#mdef_fObject

Returns the value of attribute mdef_f.



43
44
45
# File 'lib/rgss_db/model/rpg_maker_data/xp/rpg/item.rb', line 43

def mdef_f
  @mdef_f
end

Returns the value of attribute menu_se.



43
44
45
# File 'lib/rgss_db/model/rpg_maker_data/xp/rpg/item.rb', line 43

def menu_se
  @menu_se
end

#minus_state_setObject

Returns the value of attribute minus_state_set.



43
44
45
# File 'lib/rgss_db/model/rpg_maker_data/xp/rpg/item.rb', line 43

def minus_state_set
  @minus_state_set
end

#mp_recoveryObject

Returns the value of attribute mp_recovery.



24
25
26
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/item.rb', line 24

def mp_recovery
  @mp_recovery
end

#mp_recovery_rateObject

Returns the value of attribute mp_recovery_rate.



24
25
26
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/item.rb', line 24

def mp_recovery_rate
  @mp_recovery_rate
end

#nameObject

Returns the value of attribute name.



43
44
45
# File 'lib/rgss_db/model/rpg_maker_data/xp/rpg/item.rb', line 43

def name
  @name
end

#occasionObject

Returns the value of attribute occasion.



43
44
45
# File 'lib/rgss_db/model/rpg_maker_data/xp/rpg/item.rb', line 43

def occasion
  @occasion
end

#parameter_pointsObject

Returns the value of attribute parameter_points.



24
25
26
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/item.rb', line 24

def parameter_points
  @parameter_points
end

#parameter_typeObject

Returns the value of attribute parameter_type.



24
25
26
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/item.rb', line 24

def parameter_type
  @parameter_type
end

#pdef_fObject

Returns the value of attribute pdef_f.



43
44
45
# File 'lib/rgss_db/model/rpg_maker_data/xp/rpg/item.rb', line 43

def pdef_f
  @pdef_f
end

#plus_state_setObject

Returns the value of attribute plus_state_set.



43
44
45
# File 'lib/rgss_db/model/rpg_maker_data/xp/rpg/item.rb', line 43

def plus_state_set
  @plus_state_set
end

#priceObject

Returns the value of attribute price.



24
25
26
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/item.rb', line 24

def price
  @price
end

#recover_hpObject

Returns the value of attribute recover_hp.



43
44
45
# File 'lib/rgss_db/model/rpg_maker_data/xp/rpg/item.rb', line 43

def recover_hp
  @recover_hp
end

#recover_hp_rateObject

Returns the value of attribute recover_hp_rate.



43
44
45
# File 'lib/rgss_db/model/rpg_maker_data/xp/rpg/item.rb', line 43

def recover_hp_rate
  @recover_hp_rate
end

#recover_spObject

Returns the value of attribute recover_sp.



43
44
45
# File 'lib/rgss_db/model/rpg_maker_data/xp/rpg/item.rb', line 43

def recover_sp
  @recover_sp
end

#recover_sp_rateObject

Returns the value of attribute recover_sp_rate.



43
44
45
# File 'lib/rgss_db/model/rpg_maker_data/xp/rpg/item.rb', line 43

def recover_sp_rate
  @recover_sp_rate
end

#scopeObject

Returns the value of attribute scope.



43
44
45
# File 'lib/rgss_db/model/rpg_maker_data/xp/rpg/item.rb', line 43

def scope
  @scope
end

#varianceObject

Returns the value of attribute variance.



43
44
45
# File 'lib/rgss_db/model/rpg_maker_data/xp/rpg/item.rb', line 43

def variance
  @variance
end

Instance Method Details

#key_item?Boolean

Returns:

  • (Boolean)


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

def key_item?
  @itype_id == 2
end

#to_sObject



39
40
41
# File 'lib/rgss_db/model/rpg_maker_data/xp/rpg/item.rb', line 39

def to_s
  @name.to_s
end