Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module STAT_VALUES
- ENDING_ITEMS = 5 # Game Variable for collected Items.
- ENDING_ITEMS_MAX = 100 #Maximum number of Ending Items.
- OPTIONAL_SCENES = 6 # Game Variable for Optional Scenes Viewed.
- OPTIONAL_SCENES_MAX = 30 #Maximum number of Optional Scenes Viewed.
- POINTS = 7 # Game Variable for the number of Points recieved.
- DEATHS = 8 # Game Variable for the number of Game Overs. Stored with Theo.
- # Set this to 0 at the begining or you will get wrong values.
- ENDINGS = 9 # Game Variable to indicate the current Ending. Starts at 0.
- # Neutral Ending, Steak Ending, Gold Ending,
- # Cophat Ending, Forthward Ending, Unkown Ending.
- NUMBER_TIMES_ENCOUNTERED = 20 # Starting Game Variable for number of times
- # ending is encountered. Note: This follows the
- # above list and requires a variable for each.
- # They must be in order, and have no gaps.
- # Furthermore they must each be stored with
- # Theo's Variable Store Script.
- end # STAT_VALUES
- ################################################################################
- ####### DO NOT EDIT BEYOND THIS POINT UNLESS YOU KNOW WHAT YOU ARE DOING #######
- ################################################################################
- class Scene_Gameover < Scene_Base
- def start
- super
- play_gameover_music
- fadeout_frozen_graphics
- create_background
- $game_variables[STAT_VALUES::DEATHS] += 1
- DataManager.save_variables
- end
- end #Scene_Gameover
- class Scene_Statistics < Scene_Base #Waiting until I have the window done.
- def start
- super
- create_statistics_window
- end
- def create_statistics_window
- @stats_window = Window_EndingStatistics.new
- end
- def update
- super
- goto_title if Input.trigger?(:C)
- end
- def goto_title
- fadeout_all
- @stats_window.dispose
- SceneManager.goto(Scene_Title)
- end
- end
- class Window_EndingStatistics < Window_Base
- def initialize()
- x = (Graphics.width - 400) / 2
- y = (Graphics.height - 320) / 2
- super(x, y, 400, 320)
- self.windowskin = Cache.system("Window")
- @opening = @closing = false
- fill_text
- end# initialize
- def update
- super
- dispose if Input.trigger?(:C)
- end# update
- def fill_text
- calculate_rank
- @text = ["Deaths: #{$game_variables[STAT_VALUES::DEATHS]}",
- "Saves: #{$game_system.save_count}",
- "Play Time: #{$game_system.playtime_s}",
- "Ending Items Found: #{$game_variables[STAT_VALUES::ENDING_ITEMS]} of #{STAT_VALUES::ENDING_ITEMS_MAX}.",
- "Optional Scenes Found: #{$game_variables[STAT_VALUES::OPTIONAL_SCENES]} of #{STAT_VALUES::OPTIONAL_SCENES_MAX}.",
- "Steps Taken: #{$game_party.steps}",
- "Current Ending: #{self.endings}",
- "Time Ending Recieved: #{@times_recieved}",
- "Total Different Endings: #{self.total_endings}",
- "Total Points: #{$game_variables[STAT_VALUES::POINTS]} of 100.",
- "Rank: #{@rank_score}"
- ] #Do not remove.
- @line = 10
- @text.each do |text|
- draw_text(10, @line, width, line_height, text)
- @line += 24
- end
- end# fill_text
- def calculate_rank
- @rank = self.pointscore - self.deathscore
- if @rank < 0; @rank = 0; end
- case @rank
- when 500
- @rank_score = "S"
- when 400..499
- @rank_score = "A"
- when 300..399
- @rank_score = "B"
- when 200..299
- @rank_score = "C"
- when 100..199
- @rank_score = "D"
- when 0..99
- @rank_score = "F"
- end
- end# calculate_rank
- def pointscore
- @points_variable = STAT_VALUES::POINTS
- @points = $game_variables[@points_variable]
- @points *= 5
- end# pointscore
- def deathscore
- @deaths_variable = STAT_VALUES::DEATHS
- @deaths = $game_variables[@deaths_variable]
- @deaths *= 5
- end# deathscore
- def endings
- case $game_variables[STAT_VALUES::ENDINGS]
- when 0
- $game_variables[STAT_VALUES::NUMBER_TIMES_ENCOUNTERED] += 1
- @times_recieved = $game_variables[STAT_VALUES::NUMBER_TIMES_ENCOUNTERED]
- "Neutral Ending"
- when 1
- $game_variables[STAT_VALUES::NUMBER_TIMES_ENCOUNTERED+1] += 1
- @times_recieved = $game_variables[STAT_VALUES::NUMBER_TIMES_ENCOUNTERED+1]
- "Steak Ending"
- when 2
- $game_variables[STAT_VALUES::NUMBER_TIMES_ENCOUNTERED+2] += 1
- @times_recieved = $game_variables[STAT_VALUES::NUMBER_TIMES_ENCOUNTERED+2]
- "Gold Ending"
- when 3
- $game_variables[STAT_VALUES::NUMBER_TIMES_ENCOUNTERED+3] += 1
- @times_recieved = $game_variables[STAT_VALUES::NUMBER_TIMES_ENCOUNTERED+3]
- "Cophat Ending"
- when 4
- $game_variables[STAT_VALUES::NUMBER_TIMES_ENCOUNTERED+4] += 1
- @times_recieved = $game_variables[STAT_VALUES::NUMBER_TIMES_ENCOUNTERED+4]
- "Forthward Ending"
- when 5
- $game_variables[STAT_VALUES::NUMBER_TIMES_ENCOUNTERED+5] += 1
- @times_recieved = $game_variables[STAT_VALUES::NUMBER_TIMES_ENCOUNTERED+5]
- "Unkown Ending" #New ending.
- end
- end# endings
- def total_endings
- @total_endings = 0
- if $game_variables[STAT_VALUES::NUMBER_TIMES_ENCOUNTERED] > 0;@total_endings += 1;end
- if $game_variables[STAT_VALUES::NUMBER_TIMES_ENCOUNTERED+1] > 0;@total_endings += 1;end
- if $game_variables[STAT_VALUES::NUMBER_TIMES_ENCOUNTERED+2] > 0;@total_endings += 1;end
- if $game_variables[STAT_VALUES::NUMBER_TIMES_ENCOUNTERED+3] > 0;@total_endings += 1;end
- if $game_variables[STAT_VALUES::NUMBER_TIMES_ENCOUNTERED+4] > 0;@total_endings += 1;end
- if $game_variables[STAT_VALUES::NUMBER_TIMES_ENCOUNTERED+5] > 0;@total_endings += 1;end
- return @total_endings
- end# total endings
- def dispose
- super
- end
- end# Window_EndingStatistics
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement