Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================#
- # ■■ ■■ Warrior of Light Menu ■■ ■■ #
- #==============================================================================#
- # Author: Archer Banish
- # Version: 1.0.1
- # Last Update: 25/11/2014
- #==============================================================================#
- # ■ Update History #
- #==============================================================================#
- # 25/11/2014 (V1.0.1) Small upgrade to the code, added note regarding the map
- # Display Name
- # 13/11/2014 (V1.0) Initial Launch
- #==============================================================================#
- # ■ Introduction #
- #==============================================================================#
- # A simple main menu script to atempt to emulate the menu from the game
- # Final Fantasy I.
- # This menu adds a shared Gold/Time Window, a Location window and a new feature
- # present in the Final Fantasy I menu which is the Cystal Window, these "Crystals
- # can be turned on or off by a switch.
- #==============================================================================#
- # ■ Instructions #
- #==============================================================================#
- # To Install this script just place it under "▼ Materials" and above "Main" in
- # your RPG Maker VX Ace Script Editor
- # You are also required to have the images in your "Graphics/System" folder.
- #==============================================================================#
- # ■ Compatibility #
- #==============================================================================#
- # This script is made for RPG Maker VX Ace and will most likely no work correctly
- # in RPG Maker VX.
- # Any script that changes the Main Menu, Actor Status Display and (slightly) with
- # scripts that change the Gauge display.
- #==============================================================================#
- module ARCHER
- module FFIM
- #==========================================================================
- # ■ Script Settings ■
- #==========================================================================
- # Edit these variables to edit the script at your liking,
- #==========================================================================
- SHOWGAUGE = false # This variable toggles if the HP/MP Gauges are shown
- # DEFAULT SETTING: false
- COMMANDSIZE = 160 # This variable defines the size of the non-status
- #windows (Command, Gold/Time, Location, Crystal
- # Default: 160
- # Default(For Yanfly Engine Ace): 200
- #==========================================================================
- # ■ Crystal Settings ■
- #==========================================================================
- # The variables are used to select the images that are displayed on the
- # Crystal Window.
- # NOTE: These Images must be located in your "Graphics/System/" folder.
- # INPORTANT: Currently there is no check on the images size, any too large
- # image might have problems with the presentation on the window. I recomend
- # images not larger than 60x30 (height x width) for the best results
- # currently there is also an issue regarding the amount of images that
- # can be displayed correclty, with this size at 7+ there is already an
- # overlay of images. I do not recomend more than 6 images however, if you
- # don't mind some overlay I would recomend a max of 8.
- #==========================================================================
- EMPTYFILENAME = "Empty" #The image name that will be shown if the switch for
- #the "Crystal" is not set as ON.
- #--------------------#
- # CRYSTALFILES Array |
- #--------------------#
- # This array takes 2 values per line.
- # Switch: This is the switch that will toggle the Crystal On causing it to be
- # drawn as such.
- # Filename: The name of the image that will be shown if the designated switch
- # is on.
- #
- # Default:
- # CRYSTALFILES = [
- # #Switch #Filename
- # [1, "Fire"],
- # [2, "Earth"],
- # [3, "Wind"],
- # [4, "Water"]
- # ]
- CRYSTALFILES = [
- #Switch #Filename
- [1, "Fire"],
- [2, "Earth"],
- [3, "Wind"],
- [4, "Water"]
- ]
- #--------------#
- # Mapname Note #
- #--------------#
- # To have the menu display the map name you will have to set the
- # Display Name proprieties in the Map Proprieties of every map.
- # Any map without this propriety will apear as Unknown.
- #============================================================================#
- # ■ ■ Customization Ends Here ■ ■ #
- #============================================================================#
- end #FFIM
- end #ARCHER
- #==============================================================================#
- # ■ ■ ■ Menu Scenes ■ ■ ■ #
- #==============================================================================#
- class Scene_Menu < Scene_MenuBase
- def start
- super
- create_status_window
- create_command_window
- create_crystal_window
- create_location_window
- create_time_gold_window
- end
- #--------------------------------------------------------------------------
- # ■ Create Command Window
- #--------------------------------------------------------------------------
- alias kab_sm_ccw create_command_window
- def create_command_window
- kab_sm_ccw
- @command_window.x = Graphics.width - @command_window.width - 5
- @command_window.y = 5
- end
- #--------------------------------------------------------------------------
- # ■ Create TimeGold Window
- #--------------------------------------------------------------------------
- def create_time_gold_window
- @time_gold_window = Window_Time_Gold.new
- @time_gold_window.x = Graphics.width - @time_gold_window.window_width - 5
- @time_gold_window.y = Graphics.height - @time_gold_window.window_height - 5
- end
- #--------------------------------------------------------------------------
- # ■ Create Lacation Window
- #--------------------------------------------------------------------------
- def create_location_window
- @location_window = Window_Location.new
- @location_window.x = Graphics.width - @location_window.window_width - 5
- @location_window.y = Graphics.height - line_height*3 - @location_window.window_height - 5
- end
- #--------------------------------------------------------------------------
- # ■ Create Crystal Window
- #--------------------------------------------------------------------------
- def create_crystal_window
- @crystal_window = Window_Crystal.new
- @crystal_window.x = Graphics.width - @crystal_window.window_width - 5
- @crystal_window.y = Graphics.height - line_height*5 - @crystal_window.window_height - 5
- end
- #--------------------------------------------------------------------------
- # ■ Create Status Window
- #--------------------------------------------------------------------------
- def create_status_window
- @status_window = Window_MenuStatus.new(5, 5)
- end
- #--------------------------------------------------------------------------
- # ■ Get Line Height
- #--------------------------------------------------------------------------
- def line_height
- return 24
- end
- end
- #==============================================================================#
- # ■ ■ ■ Menu Windows ■ ■ ■ #
- #==============================================================================#
- class Window_MenuCommand < Window_Command
- def window_width
- return ARCHER::FFIM::COMMANDSIZE
- end
- end
- #========================================
- # ■ Window_Base ■
- #=======================================
- class Window_Base < Window
- #--------------------------------------------------------------------------
- # ■ Draw Actor Simple Status - Override
- # > Edited the location where the data is displayed slightly
- #--------------------------------------------------------------------------
- def draw_actor_simple_status(actor, x, y)
- draw_actor_name(actor, x, y)
- draw_actor_level(actor, x, y + line_height * 1)
- draw_actor_icons(actor, x + 120, y)
- draw_actor_class(actor, x + 120, y + line_height * 1)
- draw_actor_hp(actor, x, y + line_height * 2)
- draw_actor_mp(actor, x + 120, y + line_height * 2)
- end
- #--------------------------------------------------------------------------
- # ■ Draw Gauge Status - Override
- # > Added a little border to the gauges
- #--------------------------------------------------------------------------
- def draw_gauge(x, y, width, rate, color1, color2)
- width = width-10
- fill_w = (width * rate).to_i
- gauge_y = y + line_height - 8
- contents.fill_rect(x, gauge_y, width, 6, gauge_back_color)
- contents.gradient_fill_rect(x, gauge_y, fill_w, 6, color1, color2)
- border = Bitmap.new(width, 6)
- border.fill_rect(border.rect, Color.new(255, 255, 255, 255))
- border.clear_rect(1, 1, width-2, 4)
- contents.blt(x, gauge_y, border, border.rect, 255)
- border.dispose
- end
- #--------------------------------------------------------------------------
- # ■ Draw HP - Override
- # > added check to hide gauge or not
- #--------------------------------------------------------------------------
- def draw_actor_hp(actor, x, y, width = 124)
- if ARCHER::FFIM::SHOWGAUGE
- draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
- end
- change_color(system_color)
- draw_text(x, y, 30, line_height, Vocab::hp_a)
- draw_current_and_max_values(x, y, width - 5, actor.hp, actor.mhp,
- hp_color(actor), normal_color)
- end
- #--------------------------------------------------------------------------
- # ■ Draw MP
- # > added check to hide gauge or not
- #--------------------------------------------------------------------------
- def draw_actor_mp(actor, x, y, width = 124)
- if ARCHER::FFIM::SHOWGAUGE
- draw_gauge(x, y, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
- end
- change_color(system_color)
- draw_text(x, y, 30, line_height, Vocab::mp_a)
- draw_current_and_max_values(x, y, width-5, actor.mp, actor.mmp,
- mp_color(actor), normal_color)
- end
- end
- #========================================
- # ■ Window_Gold ■
- #=======================================
- class Window_Gold < Window_Base
- #--------------------------------------------------------------------------
- # ■ Object Initialization
- #--------------------------------------------------------------------------
- def initialize
- super(Graphics.width-window_width, Graphics.height-fitting_height(1), window_width, fitting_height(1))
- refresh
- end
- #--------------------------------------------------------------------------
- # ■ Get Window Width
- #--------------------------------------------------------------------------
- def window_width
- return ARCHER::FFIM::COMMANDSIZE
- end
- end
- #========================================
- # ■ Window_MenuStatus ■
- #=======================================
- class Window_MenuStatus < Window_Selectable
- #--------------------------------------------------------------------------
- # ■ Get Window Width
- #--------------------------------------------------------------------------
- def window_width
- x = Graphics.width - 10
- x
- end
- #--------------------------------------------------------------------------
- # ■ Get Window Height
- #--------------------------------------------------------------------------
- def window_height
- x = Graphics.height - 10
- x
- end
- end
- #==============================================================================
- # ■ Window_Location ■
- #------------------------------------------------------------------------------
- # This window displays the party's location.
- #==============================================================================
- class Window_Location < Window_Base
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0, window_width, window_height)
- refresh
- end
- #--------------------------------------------------------------------------
- # ■ Get Window Width
- #--------------------------------------------------------------------------
- def window_width
- return ARCHER::FFIM::COMMANDSIZE
- end
- #--------------------------------------------------------------------------
- # ■ Get Window Height
- #--------------------------------------------------------------------------
- def window_height
- return line_height*2
- end
- #--------------------------------------------------------------------------
- # * Refresh
- #--------------------------------------------------------------------------
- def refresh
- contents.clear
- draw_location(0, 0, contents.width)
- end
- #--------------------------------------------------------------------------
- # ■ Draw Location
- #--------------------------------------------------------------------------
- def draw_location(x, y, width)
- change_color(normal_color)
- unless $game_map.display_name.empty?
- draw_text(x, y, width - 2, line_height, $game_map.display_name, 1)
- else
- draw_text(x, y, width - 2, line_height, "Unknown", 1)
- end
- end
- #--------------------------------------------------------------------------
- # * Open Window
- #--------------------------------------------------------------------------
- def open
- refresh
- super
- end
- end
- #==============================================================================
- # ■ Window_Time_Gold ■
- #------------------------------------------------------------------------------
- # This window displays the total game time so far as well as the amount of gold.
- #==============================================================================
- class Window_Time_Gold < Window_Base
- #--------------------------------------------------------------------------
- # ■ Object Initialization
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0, window_width, window_height)
- refresh
- end
- #--------------------------------------------------------------------------
- # ■ Get Window Width
- #--------------------------------------------------------------------------
- def window_width
- return ARCHER::FFIM::COMMANDSIZE
- end
- #--------------------------------------------------------------------------
- # ■ Get Window Height
- #--------------------------------------------------------------------------
- def window_height
- return line_height*3
- end
- #--------------------------------------------------------------------------
- # ■ Refresh
- #--------------------------------------------------------------------------
- def refresh
- contents.clear
- draw_playtime(0, 0, contents.width)
- draw_currency_value(value, currency_unit, 4, line_height, contents.width)
- end
- #--------------------------------------------------------------------------
- # ■ Open Window
- #--------------------------------------------------------------------------
- def open
- refresh
- super
- end
- #--------------------------------------------------------------------------
- # ■ Draw Playtime
- #--------------------------------------------------------------------------
- def draw_playtime(x, y, width)
- change_color(normal_color)
- draw_text(x, y, width - 2, line_height, $game_system.playtime_s, 2)
- change_color(system_color)
- draw_text(x, y, width, line_height, "Time", 0)
- end
- #--------------------------------------------------------------------------
- # ■ Draw Number (Gold Etc.) with Currency Unit
- #--------------------------------------------------------------------------
- def draw_currency_value(value, unit, x, y, width)
- change_color(normal_color)
- draw_text(x, y, width - 2, line_height, value, 2)
- change_color(system_color)
- draw_text(x, y, width, line_height, unit, 0)
- end
- #--------------------------------------------------------------------------
- # ■ Get Party Gold
- #--------------------------------------------------------------------------
- def value
- $game_party.gold
- end
- #--------------------------------------------------------------------------
- # ■ Get Currency Unit
- #--------------------------------------------------------------------------
- def currency_unit
- Vocab::currency_unit
- end
- end
- #==============================================================================
- # ■ Window_Crystal ■
- #------------------------------------------------------------------------------
- # This window displays the crystals
- #==============================================================================
- class Window_Crystal < Window_Base
- #--------------------------------------------------------------------------
- # ■ Object Initialization
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0, window_width, window_height)
- refresh
- end
- #--------------------------------------------------------------------------
- # ■ Get Window Width
- #--------------------------------------------------------------------------
- def window_width
- return ARCHER::FFIM::COMMANDSIZE
- end
- #--------------------------------------------------------------------------
- # ■ Get Window Height
- #--------------------------------------------------------------------------
- def window_height
- return line_height*4
- end
- #--------------------------------------------------------------------------
- # ■ Refresh
- #--------------------------------------------------------------------------
- def refresh
- contents.clear
- x = Graphics.width - self.window_width - 5
- y = Graphics.height - line_height*5 - self.window_height - 5
- draw_crystals(x, y, contents.width)
- end
- def draw_crystals(x, y, width)
- x_align = x
- y_align = y + self.window_height/ 2
- z_level = 100
- jump = self.window_width / (ARCHER::FFIM::CRYSTALFILES.length + 1)
- @spritegroup = []
- vector = []
- i = 0
- while (i < ARCHER::FFIM::CRYSTALFILES.length)
- vector[i] = jump*i + jump/2
- i = i + 1
- end
- i = 0
- while (i < ARCHER::FFIM::CRYSTALFILES.length)
- @spritegroup[i] = Sprite.new
- if($game_switches[ARCHER::FFIM::CRYSTALFILES[i][0]])
- @spritegroup[i].bitmap = Cache.system(ARCHER::FFIM::CRYSTALFILES[i][1])
- else
- @spritegroup[i].bitmap = Cache.system(ARCHER::FFIM::EMPTYFILENAME)
- end
- @spritegroup[i].x = x_align + vector[i]
- @spritegroup[i].y = y_align - @spritegroup[i].bitmap.height / 2
- @spritegroup[i].z = z_level
- i = i+1
- end
- end
- #--------------------------------------------------------------------------
- # ■ Open Window
- #--------------------------------------------------------------------------
- def open
- refresh
- super
- end
- #--------------------------------------------------------------------------
- # ■ Object Dispose
- #--------------------------------------------------------------------------
- def dispose
- i = 0
- while(i < @spritegroup.length)
- @spritegroup[i].dispose
- @spritegroup[i].bitmap.dispose
- i = i + 1
- end
- super
- end
- end
RAW Paste Data