Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Verifica o total de eventos num mapa. Chame: $game_temp.totally_event(id)
- # id do mapa. Caso não especificar o id, dará o total de eventos do jogo inteiro.
- class Game_Temp
- def totally_event(id=nil)
- totally = 0
- glob = Dir.glob("./Data/Map*").collect! { |i| i.split("/").last.match(/Map(\d+)/).to_s << ".rvdata2" rescue next }.select(&:to_s)
- glob.delete_at(glob.size.pred)
- if id.nil?
- glob.each { |i| totally += load_data(sprintf("./Data/#{i}")).events.size }
- else
- totally += load_data(sprintf("./Data/Map%03d.rvdata2", id)).events.size rescue 0
- end
- return totally
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement