Class: RPG::UsableItem

Inherits:
BaseItem show all
Extended by:
RgssDb::JsonableConstructor
Includes:
RgssDb::Jsonable
Defined in:
lib/rgss_db/model/rpg_maker_data/vx/rpg/usable_item.rb,
lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/usable_item.rb,
lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/usable_item_damage.rb,
lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/usable_item_effect.rb

Overview

The Superclass of Skill and Item.

Direct Known Subclasses

Item, Skill

Defined Under Namespace

Classes: Damage, Effect

Instance Attribute Summary collapse

Attributes inherited from BaseItem

#description, #features, #icon_index, #id, #name, #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 BaseItem

#to_s

Constructor Details

#initializeUsableItem

Returns a new instance of UsableItem.



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

def initialize
  super
  @scope = 0
  @occasion = 0
  @speed = 0
  @animation_id = 0
  @common_event_id = 0
  @base_damage = 0
  @variance = 20
  @atk_f = 0
  @spi_f = 0
  @physical_attack = false
  @damage_to_mp = false
  @absorb_damage = false
  @ignore_defense = false
  @element_set = []
  @plus_state_set = []
  @minus_state_set = []
end

Instance Attribute Details

#absorb_damageObject

Returns the value of attribute absorb_damage.



83
84
85
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/usable_item.rb', line 83

def absorb_damage
  @absorb_damage
end

#animation_idObject

Returns the value of attribute animation_id.



83
84
85
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/usable_item.rb', line 83

def animation_id
  @animation_id
end

#atk_fObject

Returns the value of attribute atk_f.



83
84
85
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/usable_item.rb', line 83

def atk_f
  @atk_f
end

#base_damageObject

Returns the value of attribute base_damage.



83
84
85
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/usable_item.rb', line 83

def base_damage
  @base_damage
end

#common_event_idObject

Returns the value of attribute common_event_id.



83
84
85
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/usable_item.rb', line 83

def common_event_id
  @common_event_id
end

#damageObject

Returns the value of attribute damage.



81
82
83
# File 'lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/usable_item.rb', line 81

def damage
  @damage
end

#damage_to_mpObject

Returns the value of attribute damage_to_mp.



83
84
85
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/usable_item.rb', line 83

def damage_to_mp
  @damage_to_mp
end

#effectsObject

Returns the value of attribute effects.



81
82
83
# File 'lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/usable_item.rb', line 81

def effects
  @effects
end

#element_setObject

Returns the value of attribute element_set.



83
84
85
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/usable_item.rb', line 83

def element_set
  @element_set
end

#hit_typeObject

Returns the value of attribute hit_type.



81
82
83
# File 'lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/usable_item.rb', line 81

def hit_type
  @hit_type
end

#ignore_defenseObject

Returns the value of attribute ignore_defense.



83
84
85
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/usable_item.rb', line 83

def ignore_defense
  @ignore_defense
end

#minus_state_setObject

Returns the value of attribute minus_state_set.



83
84
85
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/usable_item.rb', line 83

def minus_state_set
  @minus_state_set
end

#occasionObject

Returns the value of attribute occasion.



83
84
85
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/usable_item.rb', line 83

def occasion
  @occasion
end

#physical_attackObject

Returns the value of attribute physical_attack.



83
84
85
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/usable_item.rb', line 83

def physical_attack
  @physical_attack
end

#plus_state_setObject

Returns the value of attribute plus_state_set.



83
84
85
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/usable_item.rb', line 83

def plus_state_set
  @plus_state_set
end

#repeatsObject

Returns the value of attribute repeats.



81
82
83
# File 'lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/usable_item.rb', line 81

def repeats
  @repeats
end

#scopeObject

Returns the value of attribute scope.



83
84
85
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/usable_item.rb', line 83

def scope
  @scope
end

#speedObject

Returns the value of attribute speed.



83
84
85
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/usable_item.rb', line 83

def speed
  @speed
end

#spi_fObject

Returns the value of attribute spi_f.



83
84
85
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/usable_item.rb', line 83

def spi_f
  @spi_f
end

#success_rateObject

Returns the value of attribute success_rate.



81
82
83
# File 'lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/usable_item.rb', line 81

def success_rate
  @success_rate
end

#tp_gainObject

Returns the value of attribute tp_gain.



81
82
83
# File 'lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/usable_item.rb', line 81

def tp_gain
  @tp_gain
end

#varianceObject

Returns the value of attribute variance.



83
84
85
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/usable_item.rb', line 83

def variance
  @variance
end

Instance Method Details

#battle_ok?Boolean

Returns:

  • (Boolean)


75
76
77
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/usable_item.rb', line 75

def battle_ok?
  [0, 1].include?(@occasion)
end

#certain?Boolean

Returns:

  • (Boolean)


69
70
71
# File 'lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/usable_item.rb', line 69

def certain?
  @hit_type == 0
end

#dual?Boolean

Returns:

  • (Boolean)


67
68
69
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/usable_item.rb', line 67

def dual?
  [3].include?(@scope)
end

#for_all?Boolean

Returns:

  • (Boolean)


63
64
65
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/usable_item.rb', line 63

def for_all?
  [2, 8, 10].include?(@scope)
end

#for_dead_friend?Boolean

Returns:

  • (Boolean)


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

def for_dead_friend?
  [9, 10].include?(@scope)
end

#for_friend?Boolean

Returns:

  • (Boolean)


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

def for_friend?
  [7, 8, 9, 10, 11].include?(@scope)
end

#for_one?Boolean

Returns:

  • (Boolean)


47
48
49
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/usable_item.rb', line 47

def for_one?
  [1, 3, 4, 7, 9, 11].include?(@scope)
end

#for_opponent?Boolean

Returns:

  • (Boolean)


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

def for_opponent?
  [1, 2, 3, 4, 5, 6].include?(@scope)
end

#for_random?Boolean

Returns:

  • (Boolean)


59
60
61
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/usable_item.rb', line 59

def for_random?
  [4, 5, 6].include?(@scope)
end

#for_three?Boolean

Returns:

  • (Boolean)


55
56
57
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/usable_item.rb', line 55

def for_three?
  [6].include?(@scope)
end

#for_two?Boolean

Returns:

  • (Boolean)


51
52
53
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/usable_item.rb', line 51

def for_two?
  [5].include?(@scope)
end

#for_user?Boolean

Returns:

  • (Boolean)


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

def for_user?
  [11].include?(@scope)
end

#magical?Boolean

Returns:

  • (Boolean)


77
78
79
# File 'lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/usable_item.rb', line 77

def magical?
  @hit_type == 2
end

Returns:

  • (Boolean)


79
80
81
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/usable_item.rb', line 79

def menu_ok?
  [0, 2].include?(@occasion)
end

#need_selection?Boolean

Returns:

  • (Boolean)


71
72
73
# File 'lib/rgss_db/model/rpg_maker_data/vx/rpg/usable_item.rb', line 71

def need_selection?
  [1, 3, 7, 9].include?(@scope)
end

#number_of_targetsObject



49
50
51
# File 'lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/usable_item.rb', line 49

def number_of_targets
  for_random? ? @scope - 2 : 0
end

#physical?Boolean

Returns:

  • (Boolean)


73
74
75
# File 'lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/usable_item.rb', line 73

def physical?
  @hit_type == 1
end