class RPG::State < RPG::BaseItem def vampire @vampire ||= @note =~ /<吸血:\s*(\d+)%>/i ? $1.to_i : 0 end end class Game_Actor # 对所有状态求和。但是事实上我建议对 feature_objects 求和 def vampire states.inject(0) {|a, e| a + e.vampire } end end
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |