The Superclass of Skill and Item.
The scope of effects.
When the item/skill may be used.
The speed correction.
The success rate.
The number of repeats.
The number of TP gained.
The type of hit.
The animation ID.
Damage (RPG::UsableItem::Damage).
A list of use effects. An RPG::UsableItem::Effect array.
Determines whether the area of effect is enemies. Returns true if the value of scope is 1, 2, 3, 4, 5, or 6.
Determines whether the area of effect is allies. Returns true if the value of scope is 7, 8, 9, 10, or 11.
Determines whether the area of effect is downed allies. Returns true if the value of scope is 9 or 10.
Determines whether the area of effect is the user. Returns true if the value of scope is 11.
Determines whether the area of effect is one character. Returns true if the value of scope is 1, 3, 7, 9, or 11.
Determines whether the area of effect is random. Returns true if the value of scope is 3, 4, 5, or 6.
The number of targets if the area of effect is random.
Determines whether the area of effect is everyone. Returns true if the value of scope is 2, 9, or 10.
Determines whether selection of the target is required. Returns true if the value of scope is 1, 7, or 9.
Determines whether it may be used on the battle screen. Returns true if the value of occasion is 0 or 1.
Determines whether it may be used on the menu screen. Returns true if the value of occasion is 0 or 2.
Determines whether the hit type is a certain hit. Returns true if the value of hit_type is 0.
Determines whether the hit type is a physical attack. Returns true if the value of hit_type is 1.
Determines whether the hit type is a magical attack. Returns true if the value of hit_type is 2.
class RPG::UsableItem < RPG::BaseItem
def initialize
super
@scope = 0
@occasion = 0
@speed = 0
@success_rate = 100
@repeats = 1
@tp_gain = 0
@hit_type = 0
@animation_id = 0
@damage = RPG::UsableItem::Damage.new
@effects = []
end
def for_opponent?
[1, 2, 3, 4, 5, 6].include?(@scope)
end
def for_friend?
[7, 8, 9, 10, 11].include?(@scope)
end
def for_dead_friend?
[9, 10].include?(@scope)
end
def for_user?
@scope == 11
end
def for_one?
[1, 3, 7, 9, 11].include?(@scope)
end
def for_random?
[3, 4, 5, 6].include?(@scope)
end
def number_of_targets
for_random? ? @scope - 2 : 0
end
def for_all?
[2, 8, 10].include?(@scope)
end
def need_selection?
[1, 7, 9].include?(@scope)
end
def battle_ok?
[0, 1].include?(@occasion)
end
def menu_ok?
[0, 2].include?(@occasion)
end
def certain?
@hit_type == 0
end
def physical?
@hit_type == 1
end
def magical?
@hit_type == 2
end
attr_accessor :scope
attr_accessor :occasion
attr_accessor :speed
attr_accessor :animation_id
attr_accessor :success_rate
attr_accessor :repeats
attr_accessor :tp_gain
attr_accessor :hit_type
attr_accessor :damage
attr_accessor :effects
end