# 在角色处备注 <add skill x by y> 表示当持有道具y时习得技能x
class RPG::Actor < RPG::BaseItem
def add_skill_item
@add_skill_item ||=
@note.scan(/<add\s*skill\s*(\d+)\s*by\s*(\d+)>/i).map {|(s, i)|
[s.to_i, $data_items[i.to_i]] }
end
end
class Game_Actor < Game_Battler
alias added_skills_without_item added_skills
def added_skills
added_skills_without_item | actor.add_skill_item.select {|(_, item)|
$game_party.has_item?(item) }.map(&:first)
end
end
# 在角色处备注 <add skill x by y> 表示当持有道具y时习得技能x
class RPG::Actor < RPG::BaseItem
def add_skill_item
@add_skill_item ||=
@note.scan(/<add\s*skill\s*(\d+)\s*by\s*(\d+)>/i).map {|(s, i)|
[s.to_i, $data_items[i.to_i]] }
end
end
class Game_Actor < Game_Battler
alias added_skills_without_item added_skills
def added_skills
added_skills_without_item | actor.add_skill_item.select {|(_, item)|
$game_party.has_item?(item) }.map(&:first)
end
end