Project1
标题:
VA数据库物品/技能目标类型和目标数量的关系
[打印本页]
作者:
chd114
时间:
2017-11-30 15:13
标题:
VA数据库物品/技能目标类型和目标数量的关系
在实际运行时是根据scope判断
number_of_targets、for_one?、for_random?还是反之?直接p一个物品或者技能并没有看到技能的目标数
作者:
KurozawaRuby
时间:
2017-12-2 18:38
根据scope判断,在RPG::UsableItem中定义。
以下摘自F1:
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
复制代码
作者:
chd114
时间:
2017-12-2 20:13
本帖最后由 chd114 于 2017-12-2 20:15 编辑
KurozawaRuby 发表于 2017-12-2 18:38
根据scope判断,在RPG::UsableItem中定义。
以下摘自F1:
谢了,那要追加新的范围(比如敌我全体、任意单体)在这边也修改就是了对吧?
这部分设定应该也作用技能?
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1