class Game_Actor alias pyjy29042016_feature_objects feature_objects def feature_objects pyjy29042016_feature_objects + [piyan] end def piyan @piyan ||= Piyan.new end end class Piyan def features @features ||= [] end def jiaoyi(code = 0, data_id = 0, value = 0) @features.push(RPG::BaseItem::Feature.new(code, data_id, value)) end end
class Game_Actor
alias pyjy29042016_feature_objects feature_objects
def feature_objects
pyjy29042016_feature_objects + [piyan]
end
def piyan
@piyan ||= Piyan.new
end
end
class Piyan
def features
@features ||= []
end
def jiaoyi(code = 0, data_id = 0, value = 0)
@features.push(RPG::BaseItem::Feature.new(code, data_id, value))
end
end
比如這樣
$game_actors[1].piyan.jiaoyi(41,2)
$game_actors[1].piyan.jiaoyi(41,2)
就是給1號角色添加魔法技能類型的特性, 至於添加其他特性的方法…自己揣摩一下吧
|