本帖最后由 KurozawaRuby 于 2017-12-31 21:54 编辑
def absorb(element_id) result = @note.scan(/@absorb\[(\d+),(.*?+)\]/) return 0.0 if result.nil? or result.empty? result.each do |n| next if n[0].to_i != element_id temp = n[1].strip return $game_variables[temp[1..-1].to_i] / 100.0 if temp.start_with?('$') return (temp.to_i/100.00) end return 0.0 end
def absorb(element_id)
result = @note.scan(/@absorb\[(\d+),(.*?+)\]/)
return 0.0 if result.nil? or result.empty?
result.each do |n|
next if n[0].to_i != element_id
temp = n[1].strip
return $game_variables[temp[1..-1].to_i] / 100.0 if temp.start_with?('$')
return (temp.to_i/100.00)
end
return 0.0
end
试试看,替换脚本里的absorb方法,然后使用备注
@absorb[1,$4]
使用4号变量 |