技能和物品的超类。
效果范围。
使用场合。
速度修正。
成功几率。
连续次数。
获取特技值。
命中类型。
释放动画编号。
使用效果列表。RPG::UsableItem::Effect 的数组。
判断效果范围是否为敌方。当 scope 的值为 1、2、3、4、5、6 时返回 true。
判断效果范围是否为队友。当 scope 的值为 7、8、9、10、11 时返回 true。
判断效果范围是否为无法战斗的队友。当 scope 的值为 9、10 时返回 true。
判断效果范围是否为使用者。当 scope 的值为 11 时返回 true。
判断效果范围是否为单体。当 scope 的值为 1、3、7、9、11 时返回 true。
判断效果范围是否随机,当 scope 的值为 3、4、5、6 时返回 true。
效果范围为随机时目标的数量。
判断效果范围是否为全体。当 scope 的值为 2、8、10 时返回 true。
判断是否需要选择技能目标。当 scope 的值为 1、7、9 时返回 true。
判断物品是否可以在战斗中使用。当 occasion 的值为 0、1 时返回 true。
判断物品是否可以在菜单中使用。当 occasion 的值为 0、2 时返回 true。
判断命中类型是否为必定命中。当 hit_type 的值为 0 时返回 true。
判断命中类型是否为物理攻击。当 hit_type 的值为 1 时返回 true。
判断命中类型是否为魔法攻击。当 hit_type 的值为 2 时返回 true。
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