本帖最后由 余烬之中 于 2014-6-13 12:27 编辑
条件分歧-脚本$game_party.members.any?{|a| a.skill_learn?($data_skills[技能ID])}
$game_party.members.any?{|a| a.skill_learn?($data_skills[技能ID])}
==========================
To @moy
skill_learn?和learn_skill确实很蛋疼
class Game_Actor #-------------------------------------------------------------------------- # * Learn Skill #-------------------------------------------------------------------------- def learn_skill(skill_id) unless skill_learn?($data_skills[skill_id]) @skills.push(skill_id) @skills.sort! end end #-------------------------------------------------------------------------- # * Determine if Skill Is Already Learned #-------------------------------------------------------------------------- def skill_learn?(skill) skill.is_a?(RPG::Skill) && @skills.include?(skill.id) end end
class Game_Actor
#--------------------------------------------------------------------------
# * Learn Skill
#--------------------------------------------------------------------------
def learn_skill(skill_id)
unless skill_learn?($data_skills[skill_id])
@skills.push(skill_id)
@skills.sort!
end
end
#--------------------------------------------------------------------------
# * Determine if Skill Is Already Learned
#--------------------------------------------------------------------------
def skill_learn?(skill)
skill.is_a?(RPG::Skill) && @skills.include?(skill.id)
end
end
|