Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin
- ==============================================================================
- Extra Stats Script
- Version : 3.1.6.0
- Platform : RMVX
- Author : Companion Wulf
- Release Date : 30 April 2013
- Last Update : 10 October 2013
- Website : http://rpgmakertimes.info
- Blog : http://blog.rpgmakertimes.info
- Contact Email: companionwulf@rpgmakertimes.info
- Known Compatability Issues:
- There may only be compatability issues for other scripts that overwrite
- or modify the Scene_Menu class.
- Required Modules:
- ● Universal Colors Module
- ● Universal Configuration Settings
- COMING SOON
- ● Downloadable demo
- ● Demo video to showcase its features
- The Extra Stats Guide is now available in DOC or PDF formats, downloadable
- from RPG Maker Times Companion.
- ==============================================================================
- =end
- #==============================================================================
- # ** Configuration Settings Module - Extra Stats VX Configuration Settings
- #------------------------------------------------------------------------------
- # The configuration settings for the Extra Stats script has now been integrated
- # into the Universal Configuration Settings module. Please install the module
- # and place it at the top of the scripts list.
- #==============================================================================
- =begin
- ==============================================================================
- VERSION HISTORY
- ==============================================================================
- The version history tracking will be changing to the following format:
- Release.Updates.Developmental.Manual
- Release numbers indicate public release versions.
- Updates refers to new scripts/scriptlets and new methods that have been
- added. This includes major and minor updates.
- Developmental updates are for tweaks or bug fixes.
- Manual indicates major updates to the AMCE manual.
- ------------------------------------------------------------------------------
- Updates Version History
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- I didn't keep accurate version updates with this script, so I've based this
- on the information I have. After Version 2.0.0.0, I kept more regular
- records as I added things to it and made additional tweaks. I also realised
- that I've never released a proper manual for this script (not that it
- necessarily needs one, since it's mostly plug-and-play).
- ------------------------------------------------------------------------------
- #~ ● Add: Total Damage Inflicted } Not implemented yet
- #~ ● Add: Total Damage Sustained } but looking into it
- #~ ● Add: Total Potions Used } for future versions
- v3.1.6.0 (10-Oct-2013)
- ● Bug Fix: Incorrect gold increase for items sold in shop
- v3.1.5.0 (30-Sep-2013)
- ● Bug Fix: Total gold spent updating twice
- ● Add: Total gold update when gained through Change Gold event command
- v3.1.3.0 (28-Sep-2013)
- ● Stat Added: Number of shops visited
- ● Separated variables into single class (rather than into Game_System)
- ● Add: Universal Configuration Settings checker
- ● Integrated old config settings into Universal Configuration Settings
- v3.0.0.0 (30-Apr-2013)
- ● Release: Version 3.0
- v2.2.12.1 (23-Apr-2013)
- ● Manual: Full manual written
- ● Add: Exp gain from Change EXP event command
- v2.2.11.0 (21-Apr-2013)
- ● Add: Money Spent (in shops) counter
- v2.2.10.0 (20-Apr-2013)
- ● Demo: Began working demo
- ● Bug Fix: Save Menu command index corrected
- ● Bug Fix: Menu commands not pushing properly
- ● Add: Dispose Extra Stats with Keypress alongside default cancel button
- v2.1.7.0 (23-Mar-2013)
- ● Tweak: Extra Stats Window closed with cancel/assigned key (on map)
- v2.1.6.0 (22-Mar-2013)
- ● Bug Fix: Keypress function malfunction
- v2.1.5.0 (18-Mar-2013)
- ● Add: Encounter Ratio value
- v2.1.4.0 (15-Mar-2013)
- ● Add: Number of Party Members
- v2.1.3.0 (28-Jan-2013)
- ● Add: Player Coordinates
- v2.1.2.0 (27-Jan-2013)
- ● Add: Keypress function to display Extra Stats on map
- ● Bug Fix: Total Gold counter
- ● Bug Fix: Total Exp counter
- v2.0.0.0 (20-Jan-2013)
- ● Release Version 2.0
- v1.2.16.0 (06-Sep-2012)
- ● Integrated with Q-Engine
- v1.1.16.0 (??-???-2012)
- ● Bug Fix: Total Gold counter not updating correctly
- ● Bug Fix: Total Exp counter not updating correctly
- v1.1.14.0 (07-Feb-2011)
- ● Stats Added:
- o Total Experience Gained
- o Total Gold Obtained (Battles Only)
- o Number of Chests Opened
- o Number of Keys Found
- o Number of Secrets Found
- o Number of Towns Visited
- o Total Number of Battles
- ● Changed layout and tidied code
- v1.0.7.0 (15-Aug-2010)
- ● Remove: Game Title/Author options in Extra Stats Window
- v1.0.6.0 (??-???-2010)
- ● Add: Map Location
- v1.0.5.0 (07-Jul-2010)
- ● Add: Game Progress Counter
- ● Add: Total Quests/Completed
- v1.0.2.0 (29-Jun-2010)
- ● Add: Total Chests Opened and Total Achievements
- v1.0.1.0 (??-???-2010)
- ● Add: Total Battles
- v1.0.0.0 (18-Jun-2010)
- ● Release: Version 1.0
- ● Stats Added:
- o Number of Saves
- o Number of Inn Stays
- o Number of Steps
- o Total Victories
- o Total Kills
- o Total Escapes
- v0.1.0.0 (15-Jun-2010)
- ● Began the Extra Stats script (ported from RMXP version)
- ==============================================================================
- ==============================================================================
- COPYRIGHT NOTICE
- ==============================================================================
- This script is copyrighted to Companion Wulf under the provisions of the
- Digital Millennium Copyright Act (DMCA).
- However, permission is granted to use the script in non-commercial projects
- only, provided that credit (to Companion Wulf) is given somewhere in the game.
- Beginning or end credits are fine (or even in the game itself!).
- The script cannot be distributed without my express written permission. It is
- only allowed for distribution (at present) on the following websites:
- RPG Maker Times - http://rpgmakertimes.blogspot.com
- RPG Maker Times Companion - http://blog.rpgmakertimes.info
- If you would like to share the script on a website or other forum, write to me
- for permission via RPG Maker Times Companion and the likelihood is I'll grant
- it and add to the list of approved distribution sites.
- Not understanding the above conditions, or not understanding English, will not
- exempt you in any way, shape or form.
- *For use in commercial projects*, I ask that a nominal fee of $3 for non-
- exclusive rights be paid. This will then go towards domain costs and
- additional scripts.
- Please do NOT use that email address for anything other than asking permission
- or, of course, letting me know about your project. ~Wulf
- ==============================================================================
- =end
- #==============================================================================
- # Extra Stats VX Core Engine
- #==============================================================================
- $imported = {} if $imported == nil
- $imported["CWExtraStatsVX"] = true
- #==============================================================================
- # ** Game_System
- #==============================================================================
- class Game_Stats
- #--------------------------------------------------------------------------
- # * Public Instance Variables |--ADDED--|
- #--------------------------------------------------------------------------
- attr_accessor :victory_count # Number of battles won
- attr_accessor :inn_count # Number of stays at an inn
- attr_accessor :kill_count # Number of monsters defeated
- attr_accessor :escape_count # Number of escapes from battle
- attr_accessor :game_progress # Game progress percentage
- attr_accessor :chest_count # Number of chests opened
- attr_accessor :door_count # Number of doors opened
- attr_accessor :secrets_count # Number of secrets unlocked
- attr_accessor :town_count # Number of towns visited
- attr_accessor :battle_count # Total number of battles won
- attr_accessor :total_exp_count # Total experience gained
- attr_accessor :total_gold_count # Total gold obtained
- attr_accessor :total_gold_spent # Total gold spent (in shops)
- attr_accessor :shop_count # Number of times shop visited
- #--------------------------------------------------------------------------
- # * Object Initialization |--ALIASED--|
- #--------------------------------------------------------------------------
- def start
- if not $imported["CWUniConfig"]
- p("The Universal Configuration Settings Module is not installed. " +
- "Please make sure it is installed or enabled before the game is run.")
- exit
- end
- # Set up variables
- @victory_count = 0
- @inn_count = 0
- @kill_count = 0
- @escape_count = 0
- @game_progress = 0
- @chest_count = 0
- @door_count = 0
- @secrets_count = 0
- @town_count = 0
- @battle_count = 0
- @total_exp_count = 0
- @total_gold_count = 0
- @total_gold_spent = 0
- @shop_count = 0
- end
- end
- #==============================================================================
- # ** Scene_Title
- #------------------------------------------------------------------------------
- # This class performs the title screen processing.
- #==============================================================================
- class Scene_Title < Scene_Base
- #--------------------------------------------------------------------------
- # * Start processing
- #--------------------------------------------------------------------------
- alias cwxstat_start start
- def start
- cwxstat_start
- $game_stats.start
- end
- #--------------------------------------------------------------------------
- # * Create Game Objects
- #--------------------------------------------------------------------------
- alias cwxstat_create_objects create_game_objects
- def create_game_objects
- $game_stats = Game_Stats.new
- cwxstat_create_objects
- end
- end
- #==============================================================================
- # ** Game_Map
- #==============================================================================
- class Game_Map
- #--------------------------------------------------------------------------
- # * Public Instance Variables |--ADDED--|
- #--------------------------------------------------------------------------
- attr_accessor :from_map # Set game map flag
- #--------------------------------------------------------------------------
- # * Object Initialization |--ALIASED--|
- #--------------------------------------------------------------------------
- alias cwexs_gmap_initialize initialize
- def initialize
- cwexs_gmap_initialize
- @from_map = false
- end
- #--------------------------------------------------------------------------
- # * Map Name |--ADDED--|
- #--------------------------------------------------------------------------
- def name
- map_data = load_data("Data/MapInfos.rvdata")
- return map_data[$game_map.map_id].name
- end
- end
- #==============================================================================
- # ** Game_Enemy
- #==============================================================================
- class Game_Enemy < Game_Battler
- #--------------------------------------------------------------------------
- # This adds the "Kill Counter" for each monster defeated |--ALIASED--|
- #--------------------------------------------------------------------------
- alias cwexs_perform_collapse perform_collapse
- def perform_collapse
- cwexs_perform_collapse
- # Check number of enemies
- $game_stats.kill_count = {} if $game_stats.kill_count == nil
- if $game_stats.kill_count == nil
- $game_stats.kill_count = 0
- end
- # Add to "Kill Count" per monster
- $game_stats.kill_count += 1
- end
- end
- #==============================================================================
- # ** Game_Interpreter
- #==============================================================================
- class Game_Interpreter
- include CW_UNIVERSAL_CONFIG if $imported["CWUniConfig"]
- #--------------------------------------------------------------------------
- # * Change EXP |--OVERWRITTEN--|
- #--------------------------------------------------------------------------
- def command_315
- value = operate_value(@params[1], @params[2], @params[3])
- iterate_actor_id(@params[0]) do |actor|
- actor.change_exp(actor.exp + value, @params[4])
- $game_stats.total_exp_count += value if $imported["CWExtraStatsVX"] && EXTRA_STATS
- end
- return true
- end
- #--------------------------------------------------------------------------
- # * Change Gold
- #--------------------------------------------------------------------------
- def command_125
- value = operate_value(@params[0], @params[1], @params[2])
- $game_party.gain_gold(value)
- $game_stats.total_gold_count += value
- return true
- end
- end
- #==============================================================================
- # ** Window_Base
- #==============================================================================
- class Window_Base < Window
- #--------------------------------------------------------------------------
- # * Draw Player Coordinates
- # x : Draw x-coordinate
- # y : Draw y-coordinate
- # w : Content width
- # h : Content height
- # a : Text alignment
- #--------------------------------------------------------------------------
- def draw_player_coords(x, y, w, h, a = 1)
- @player_x, @player_y = $game_player.x, $game_player.y
- text = "X: "+@player_x.to_s+", Y: "+@player_y.to_s
- self.contents.draw_text(x, y, w, h, text, a)
- end
- end
- #==============================================================================
- # ** Window_Stats |--ADDED--|
- #------------------------------------------------------------------------------
- # This is the window for displaying the stats.
- #==============================================================================
- class Window_Stats < Window_Base
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize(x, y)
- super(0, 0, 544, 416)
- self.contents.font.size = 16
- define_variables
- refresh
- end
- #--------------------------------------------------------------------------
- # * Define Variables
- #--------------------------------------------------------------------------
- def define_variables
- @dy = y + WLH
- @saves = $game_system.save_count
- @rests = $game_stats.inn_count
- @steps = $game_party.steps
- @battles = $game_stats.battle_count
- @escapes = $game_stats.escape_count
- @kills = $game_stats.kill_count
- @victories = $game_stats.victory_count
- @chests = $game_stats.chest_count
- @doors = $game_stats.door_count
- @secrets = $game_stats.secrets_count
- @towns = $game_stats.town_count
- @progress = $game_stats.game_progress
- @total_exp = $game_stats.total_exp_count
- @total_gold = $game_stats.total_gold_count
- @total_spent= $game_stats.total_gold_spent
- @party = $game_party.members.size
- @encounters = $game_player.encounter_count
- @shops = $game_stats.shop_count
- end
- #--------------------------------------------------------------------------
- # * Refresh
- #--------------------------------------------------------------------------
- def refresh
- return if Graphics.frame_count % 10 != 0
- self.contents.clear
- draw_block1; draw_block2; draw_block3
- draw_block4; draw_block5; draw_block6
- end
- #--------------------------------------------------------------------------
- # * Draw Block: System Stats
- #--------------------------------------------------------------------------
- def draw_block1
- x = 0
- self.contents.draw_title(x, @dy * 0, "System Stats", 260, WLH, 1)
- self.contents.font.color = normal_color
- self.contents.draw_text(x, @dy * 1, 180, WLH, "Number of Saves:")
- self.contents.draw_text(x, @dy * 2, 180, WLH, "Number of Rests:")
- self.contents.draw_text(x, @dy * 3, 180, WLH, "Number of Steps:")
- self.contents.draw_text(x, @dy * 4, 180, WLH, "Number of Shop Visits:")
- self.contents.draw_text(x, @dy * 5, 180, WLH, "Number of Party Members:")
- x += 4; self.contents.font.color = system_color
- self.contents.draw_text(x, @dy * 1, 230, WLH, @saves.to_s, 2)
- self.contents.draw_text(x, @dy * 2, 230, WLH, @rests.to_s, 2)
- self.contents.draw_text(x, @dy * 3, 230, WLH, @steps.to_s, 2)
- self.contents.draw_text(x, @dy * 4, 230, WLH, @shops.to_s, 2)
- self.contents.draw_text(x, @dy * 5, 230, WLH, @party.to_s, 2)
- end
- #--------------------------------------------------------------------------
- # * Draw Block: Battle Stats
- #--------------------------------------------------------------------------
- def draw_block2
- x = 268
- self.contents.draw_title(x, @dy * 0, "Battle Stats", 260, WLH, 1)
- self.contents.draw_text(x, @dy * 1, 180, WLH, "Battles Won:")
- self.contents.draw_text(x, @dy * 2, 180, WLH, "Battles Escaped:")
- self.contents.draw_text(x, @dy * 3, 180, WLH, "Total Kill Count:")
- self.contents.draw_text(x, @dy * 4, 180, WLH, "Total Battles:")
- self.contents.draw_text(x, @dy * 5, 180, WLH, "Encounter Ratio:")
- x += 4; self.contents.font.color = system_color
- self.contents.draw_text(x, @dy * 1, 230, WLH, @victories.to_s, 2)
- self.contents.draw_text(x, @dy * 2, 230, WLH, @escapes.to_s, 2)
- self.contents.draw_text(x, @dy * 3, 230, WLH, @kills.to_s, 2)
- self.contents.draw_text(x, @dy * 4, 230, WLH, @battles.to_s, 2)
- self.contents.draw_text(x, @dy * 5, 230, WLH, @encounters.to_s, 2)
- end
- #--------------------------------------------------------------------------
- # * Draw Block: Parameter Stats
- #--------------------------------------------------------------------------
- def draw_block3
- x = 0
- self.contents.draw_title(x, @dy * 6, "Parameter Stats", 260, WLH, 1)
- self.contents.draw_text(x, @dy * 7, 180, WLH, "Total Exp Gained:")
- self.contents.draw_text(x, @dy * 8, 180, WLH, "Total Gold Gained:")
- self.contents.draw_text(x, @dy * 9, 180, WLH, "Total Gold Spent:")
- x += 4; self.contents.font.color = system_color
- self.contents.draw_text(x, @dy * 7, 230, WLH, @total_exp.to_s, 2)
- self.contents.draw_text(x, @dy * 8, 230, WLH, @total_gold.to_s, 2)
- self.contents.draw_text(x, @dy * 9, 230, WLH, @total_spent.to_s, 2)
- end
- #--------------------------------------------------------------------------
- # * Draw Block: Game Stats
- #--------------------------------------------------------------------------
- def draw_block4
- x = 268
- self.contents.draw_title(x, @dy * 6, "Game Stats", 260, WLH, 1)
- self.contents.draw_text(x, @dy * 7, 180, WLH, "Chests Opened:")
- self.contents.draw_text(x, @dy * 8, 180, WLH, "Doors Opened:")
- self.contents.draw_text(x, @dy * 9, 180, WLH, "Secrets Found:")
- self.contents.draw_text(x, @dy * 10, 180, WLH, "Game Progress:")
- x += 4; self.contents.font.color = system_color
- self.contents.draw_text(x, @dy * 7, 230, WLH, @chests.to_s, 2)
- self.contents.draw_text(x, @dy * 8, 230, WLH, @doors.to_s, 2)
- self.contents.draw_text(x, @dy * 9, 230, WLH, @secrets.to_s, 2)
- self.contents.draw_text(x, @dy * 10, 230, WLH, @progress.to_s, 2)
- end
- #--------------------------------------------------------------------------
- # * Draw Block: Time/Date Stats
- #--------------------------------------------------------------------------
- def draw_block5
- x = 0
- self.contents.draw_title(x, @dy * 12, "Time/Date Stats", 260, WLH, 1)
- self.contents.draw_text(x, @dy * 13, 180, WLH, "Time Played:")
- self.contents.draw_text(x, @dy * 14, 180, WLH, "Current Date:")
- self.contents.draw_text(x, @dy * 15, 180, WLH, "Current Time:")
- get_time_date
- x += 4; self.contents.font.color = system_color
- self.contents.draw_text(x, @dy * 13, 230, WLH, @timeplayed.to_s, 2)
- self.contents.draw_text(x, @dy * 14, 230, WLH, @cdate, 2)
- self.contents.draw_text(x, @dy * 15, 230, WLH, @ctime, 2)
- end
- #--------------------------------------------------------------------------
- # * Draw Block: Map Stats
- #--------------------------------------------------------------------------
- def draw_block6
- x = 268
- self.contents.draw_title(x, @dy * 12, "Map Stats", 260, WLH, 1)
- self.contents.draw_text(x, @dy * 13, 180, WLH, "Map Location:")
- self.contents.draw_text(x, @dy * 14, 180, WLH, "Player Coordinates:")
- self.contents.draw_text(x, @dy * 15, 180, WLH, "Towns Visited:")
- x += 4; self.contents.font.color = system_color
- self.contents.draw_text(x, @dy * 13, 230, WLH, $game_map.name, 2)
- draw_player_coords(x, @dy * 14, 230, WLH, 2)
- self.contents.draw_text(x, @dy * 15, 230, WLH, @towns.to_s, 2)
- end
- #--------------------------------------------------------------------------
- # * Get System Time and Date
- #--------------------------------------------------------------------------
- def get_time_date
- t = Time.new
- @total_sec = Graphics.frame_count / Graphics.frame_rate
- hour = @total_sec / 60 / 60
- min = @total_sec / 60 % 60
- sec = @total_sec % 60
- @timeplayed = sprintf("%02d:%02d:%02d", hour, min, sec)
- @cdate = t.strftime("%a, %d %b, %Y")
- @ctime = t.strftime("%I:%M:%S %p")
- end
- #--------------------------------------------------------------------------
- # * Frame Update
- #--------------------------------------------------------------------------
- def update
- super
- refresh
- end
- end
- #==============================================================================
- # ** Scene_Menu
- #==============================================================================
- class Scene_Menu < Scene_Base
- include CW_UNIVERSAL_CONFIG
- #--------------------------------------------------------------------------
- # * Create Command Window |--OVERWRITTEN--|
- #--------------------------------------------------------------------------
- def create_command_window
- command_list = [Vocab::item, Vocab::skill, Vocab::equip, Vocab::status,
- Vocab::save, Vocab::game_end]
- if EXTRA_STATS
- commands = command_list.first(4)
- commands.push STATS_MENU_TEXT
- 2.times do |cmd| commands.push command_list.last(2)[cmd] end
- else
- commands = command_list
- end
- @command_window = Window_Command.new(160, commands)
- @command_window.index = @menu_index
- if $game_party.members.size == 0 # If number of party members is 0
- @command_window.draw_item(0, false) # Disable item
- @command_window.draw_item(1, false) # Disable skill
- @command_window.draw_item(2, false) # Disable equipment
- @command_window.draw_item(3, false) # Disable status
- end
- if $game_system.save_disabled # If save is forbidden
- @command_window.draw_item(4, false) # Disable save
- end
- end
- #--------------------------------------------------------------------------
- # * Update Command Selection |--OVERWRITTEN--|
- #--------------------------------------------------------------------------
- def update_command_selection
- if Input.trigger?(Input::B)
- Sound.play_cancel
- $scene = Scene_Map.new
- elsif Input.trigger?(Input::C)
- if $game_party.members.size == 0 and @command_window.index < 4
- Sound.play_buzzer
- return
- elsif $game_system.save_disabled and @command_window.index == 4
- Sound.play_buzzer
- return
- end
- Sound.play_decision
- case @command_window.index
- when 0 # Item
- $scene = Scene_Item.new
- when 1,2,3 # Skill, equipment, status
- start_actor_selection
- when 4 # Extra Stats/Save
- if EXTRA_STATS; $scene = Scene_Stats.new
- else $scene = Scene_File.new(true, false, false)
- end
- when 5 # Save/End Game
- if EXTRA_STATS; $scene = Scene_File.new(true, false, false)
- else $scene = Scene_End.new
- end
- when 6
- if EXTRA_STATS; $scene = Scene_End.new; end
- end
- end
- end
- end
- #==============================================================================
- # ** Scene_Battle
- #==============================================================================
- class Scene_Battle
- #--------------------------------------------------------------------------
- # * Process Start Battle |--ALIASED--|
- #--------------------------------------------------------------------------
- alias cwexsbai_scnbtl_procbtlstrt process_battle_start
- def process_battle_start(*args)
- # Add to battle counter
- $game_stats.battle_count += 1
- # Run Original Method
- cwexsbai_scnbtl_procbtlstrt(*args)
- end
- #--------------------------------------------------------------------------
- # This adds to the "Escape Counter" for each successful escape|--ALIASED--|
- #--------------------------------------------------------------------------
- alias cw_process_escape process_escape
- def process_escape
- cw_process_escape
- if $game_troop.preemptive
- success = true
- else
- success = (rand(100) < @escape_ratio)
- end
- Sound.play_escape
- if success
- wait_for_message
- battle_end(1)
- $game_stats.escape_count += 1
- else
- @escape_ratio += 10
- $game_message.texts.push('\.' + Vocab::EscapeFailure)
- wait_for_message
- $game_party.clear_actions
- start_main
- end
- end
- #--------------------------------------------------------------------------
- # This adds to the "Victory Counter" for each combat won |--ALIASED--|
- #--------------------------------------------------------------------------
- alias cw_process_victory process_victory
- def process_victory
- cw_process_victory
- $game_stats.victory_count += 1
- end
- #--------------------------------------------------------------------------
- # * Display Gained Experience and Gold |--OVERWRITTEN--|
- #--------------------------------------------------------------------------
- def display_exp_and_gold
- exp = $game_troop.exp_total
- gold = $game_troop.gold_total
- $game_party.gain_gold(gold)
- $game_stats.total_gold_count += gold
- $game_stats.total_exp_count += exp
- text = sprintf(Vocab::Victory, $game_party.name)
- $game_message.texts.push('\|' + text)
- if exp > 0
- text = sprintf(Vocab::ObtainExp, exp)
- $game_message.texts.push('\.' + text)
- end
- if gold > 0
- text = sprintf(Vocab::ObtainGold, gold, Vocab::gold)
- $game_message.texts.push('\.' + text)
- end
- wait_for_message
- end
- end
- #==============================================================================
- # ** Scene_Shop
- #------------------------------------------------------------------------------
- # This class performs shop screen processing.
- #==============================================================================
- class Scene_Shop < Scene_Base
- #--------------------------------------------------------------------------
- # * Confirm Number Input
- #--------------------------------------------------------------------------
- alias cwexs_scnshop_decide_number decide_number_input
- def decide_number_input
- cwexs_scnshop_decide_number
- case @command_window.index
- when 0
- $game_stats.total_gold_spent += (@number_window.number * @item.price)
- when 1
- $game_stats.total_gold_count += (@number_window.number * (@item.price / 2))
- end
- end
- #--------------------------------------------------------------------------
- # * Dispose of Command Window
- #--------------------------------------------------------------------------
- alias cwexs_scnshop_dispose_cmd dispose_command_window
- def dispose_command_window
- cwexs_scnshop_dispose_cmd
- $game_stats.shop_count += 1
- #~ @command_window.dispose
- end
- end
- #==============================================================================
- # ** Scene_Map
- #==============================================================================
- class Scene_Map < Scene_Base
- include CW_UNIVERSAL_CONFIG
- #--------------------------------------------------------------------------
- # * Frame Update |--ALIASED--|
- #--------------------------------------------------------------------------
- alias cwexs_scnmap_update update
- def update
- cwexs_scnmap_update
- if EXTRA_STATS_KEYPRESS
- if Input.press?(EXTRA_STATS_KEY)
- $game_map.from_map = true
- $scene = Scene_Stats.new
- end
- end
- end
- end
- #==============================================================================
- # ** Scene_File
- #------------------------------------------------------------------------------
- # This class performs the save and load screen processing.
- #==============================================================================
- class Scene_File < Scene_Base
- include CW_UNIVERSAL_CONFIG
- #--------------------------------------------------------------------------
- # * Return to Original Screen
- #--------------------------------------------------------------------------
- def return_scene
- if @from_title
- $scene = Scene_Title.new
- elsif @from_event
- $scene = Scene_Map.new
- else
- if EXTRA_STATS; return_code = 5 else return_code = 4; end
- $scene = Scene_Menu.new(return_code)
- end
- end
- #--------------------------------------------------------------------------
- end
- #==============================================================================
- # ** Scene_Stats |--ADDED--|
- #------------------------------------------------------------------------------
- # This class handles the stat window, where all of the stat variables are
- # displayed.
- #==============================================================================
- class Scene_Stats < Scene_Base
- include CW_UNIVERSAL_CONFIG
- #--------------------------------------------------------------------------
- # * Start
- #--------------------------------------------------------------------------
- def start
- super
- @stat_window = Window_Stats.new(50, 100)
- end
- #--------------------------------------------------------------------------
- # * Terminate
- #--------------------------------------------------------------------------
- def terminate
- super
- @stat_window.dispose
- end
- #--------------------------------------------------------------------------
- # * Return Scene
- #--------------------------------------------------------------------------
- def return_scene
- if $game_map.from_map == true
- $game_map.from_map = false
- $scene = Scene_Map.new
- else
- $scene = Scene_Menu.new(4)
- end
- end
- #--------------------------------------------------------------------------
- # * Update
- #--------------------------------------------------------------------------
- def update
- @stat_window.update
- if Input.trigger?(Input::B) ||
- if EXTRA_STATS_KEYPRESS; Input.trigger?(EXTRA_STATS_KEY); end
- Sound.play_cancel
- return_scene
- end
- end
- end
- #==============================================================================
- # ** Bitmap Addons VX v0.5
- #------------------------------------------------------------------------------
- # This adds additional functions to the Bitmap class, including various text
- # options and shapes.
- #==============================================================================
- unless $imported["CWBitmap"]; class Bitmap
- include CW_UNIVERSAL_CONFIG
- #--------------------------------------------------------------------------
- # * Reset Font Settings |--NEW METHOD--|
- #--------------------------------------------------------------------------
- def reset_font_settings
- self.font.bold = false
- self.font.italic = false
- self.font.name = DEFAULT_FONT
- self.font.size = DEFAULT_SIZE
- self.font.color = DEFAULT_TEXT_COLOR
- end
- #--------------------------------------------------------------------------
- # * Draw Horizontal Line |--ADDED--|
- # x : x-coordinate
- # y : y-coordinate
- # lw : line width
- # lc : line colour
- # ls : line size (proportionate height)
- # lh : line height (textual)
- #--------------------------------------------------------------------------
- def draw_horz_line(x, y, lw = self.width, lc = LINE_COLOR, ls = 1, lh = 24)
- line_y = y + lh / 2 + 10
- self.fill_rect(x, line_y, lw, ls, lc)
- end
- #--------------------------------------------------------------------------
- # * Draw Title |--ADDED--|
- # x : window x-coordinate
- # y : window y-coordinate
- # w : window width
- # h : window height
- # text : text to display
- # a : text align
- #--------------------------------------------------------------------------
- def draw_title(x, y, title, w = self.width, h = 24, a = 0)
- self.font.bold = true
- self.font.shadow = true
- self.font.name = DEFAULT_TITLE_FONT
- self.font.color = DEFAULT_TITLE_COLOR
- self.font.size = DEFAULT_TITLE_SIZE
- self.font.size = 20
- self.draw_text(x, y, w, h, title, a)
- self.draw_horz_line(x, y + h * 0, w)
- reset_font_settings
- end
- end; end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement