Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # Tweaks & Add-Ons (TWAXP) v1.0
- # Version : 1.10.11.0
- # Platform : RMXP
- # Author : Companion Wulf
- # Release Date : 23 July 2014
- # Last Update : 20 January 2015
- # Websites : RPG Maker Times - http://blog.rpgmakertimes.info
- # : Companion Blog - http://rpgmakertimes.blogspot.com
- # : Twitter - https://twitter.com/CompanionWulf
- #
- #------------------------------------------------------------------------------
- # * DESCRIPTION *
- #------------------------------------------------------------------------------
- # This script adds several tweaks to RMXP, including layout. It also adds
- # some unavailable features and functions.
- #
- #------------------------------------------------------------------------------
- # * KNOWN COMPATABILITY ISSUES *
- #------------------------------------------------------------------------------
- # A number of classes and class methods have been overwritten or modified,
- # which may cause compatibility issues. These are:
- #
- # ● Scene_Title - rewritten with sections put into separate blocks
- # ● Window_Base - draw_actor_parameter, draw_actor_level
- # ● Window_Status - separated into blocks for the various sections
- #
- #------------------------------------------------------------------------------
- # * REQUIRED SCRIPTS *
- #------------------------------------------------------------------------------
- # A number of classes and class methods have been overwritten or modified,
- # No other scripts are required. However, the following modules/add-ons
- # are recommended for additional effects (in order of installation):
- #
- # ● Global Colors Module (GCM) – A module containing most of the standard
- # colour codes, including variations (converted to RGB format), con-
- # veniently named for easier reference. There are presently 128
- # colours to choose from, but you can add your own colours as well.
- # ● Tweaks & Add-Ons Script (TWAXP) – The main script and its settings
- # for the TWAXP, and toggle options for its add-ons.
- # ● Bitmap Add-Ons (BMA) – An addendum to the Bitmap class, providing
- # additional methods to enhance it, including drawing titles and
- # shapes, such as circles and triangles.
- #
- #------------------------------------------------------------------------------
- # * TWEAKS & ADD-ONS 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 (major and minor updates).
- #
- # Developmental updates are for tweaks or bug fixes, and new added methods.
- #
- # Manual indicates major updates to the Tweaks & Add-Ons manual.
- #
- #------------------------------------------------------------------------------
- # * Updates Version History *
- #------------------------------------------------------------------------------
- # VERSION 2.0+ - Future Updates
- # * Actor enhancements
- # * Battle tweaks and add-ons
- # * Confirm exit
- # * Equipment screen expansion
- # * Menu tweaks
- # * Status add-ons
- #------------------------------------------------------------------------------
- # * Bugs To Fix *
- #------------------------------------------------------------------------------
- # * Errors in displaying shadow and outline methods in Bitmap
- #------------------------------------------------------------------------------
- #
- # v1.10.11.0 (20-Jan-2015)
- # ● Bug Fix: Incorrect Eva colour on Equip screen when stats change
- # v1.10.10.0 (03-Dec-2014)
- # ● Add: New method to Window_Base - change_color (see Additional Notes below)
- # ● Bug Fix: Skip Title not skipping (not perfect but functioning)
- # v1.9.9.0 (03-Oct-2014)
- # ● Tweak: Currency alignment
- # v1.9.8.0 (28-Aug-2014)
- # ● Tweak: XY offset coordinates for font shadow
- # v1.9.7.0 (18-Aug-2014)
- # ● Bug Fix: Extra params incongruity on Equip screen
- # ● Add: Comma delimiters for large gold amounts
- # ● Add: Skip Title option
- # v1.7.6.0 (17-Aug-2014)
- # ● Tweak: Change default windowskin
- # v1.7.5.0 (14-Aug-2014)
- # ● Tweak: Colours for parameters increased/decreased with equip/unequip
- # v1.7.4.0 (11-Aug-2014)
- # ● Bug Fix: Major error in Equip extra parameters tweak
- # ● Tweak: Move extra font options to Bitmap Addons module
- # ● Add: Bitmap Addons module (ported from RMVX) ¶ See Additional Notes below
- # v1.6.3.0 (10-Aug-2014)
- # ● Add: Extra font options (shadow and outline)
- # ● Add: Default font settings
- # v1.4.3.0 (04-Aug-2014)
- # ● Add: Extra parameters to Equip screen
- # v1.3.3.0 (03-Aug-2014)
- # ● Add: Class icons
- # v1.2.3.0 (28-Jul-2014)
- # ● Add: States as icons
- # ● Bug Fix: Error when health state actor.hp < 0 or negative
- # ● Tweak: Health states colours
- # ● Tweak: Status layout for items to fit more snugly
- # v1.1.0.0 (26-Jul-2014)
- # ● Add: Health states
- # v1.0.0.0 (23-Jul-2014)
- # ● Release: Version 1.0
- # v0.12.0.0 (22-Jul-2014)
- # ● Add: Equipment parts
- # ● Add: Hidden paremeters HIT and EVA to Status screen
- # v0.10.1.0 (21-Jul-2014)
- # ● Add: Alternative parameter terms
- # ● Add: Labels for Name and Class
- # ● Began Status screen alternative layout
- # v0.7.0.0 (19-Jul-2014)
- # ● Revamp Scene_Title for easier updates
- # v0.6.0.0 (17-Jul-2014)
- # ● Add: Steps icon in Steps window
- # ● Add: Play Time icon in Play Time window
- # ● Add: Gold icon in Gold window
- # ● Add: New method to Window_Base - draw_icon (see Additional Notes below)
- # ● Add: Version number displayed on the Title screen
- # ● Began working on tweaks and scripts
- #
- #------------------------------------------------------------------------------
- # Demo Version History
- #------------------------------------------------------------------------------
- # v0.0 (Pending 2014) - Demo Public Release Version 1
- #==============================================================================
- $imported = {} if $imported == nil; $imported["CW-TWAXP"] = true
- #===============================================================================
- # ** Tweaks & Add-Ons Settings **
- #===============================================================================
- module TWAXP_SETTINGS
- include CW_GLOBAL_COLORS if $imported["CWColors"]
- #============================================================================
- # ** CONFIGURATION **
- #----------------------------------------------------------------------------
- # All of the options below are configurable. There shouldn't be any need to
- # modify anything else, as they're all plug-and-play. Most of the settings are
- # set to "true" by default.
- #
- # "true" toggles the setting on; "false" toggles it off.
- #
- # Note: Options remarked with #~ are not yet available but may be in a future
- # version.
- #
- #============================================================================
- #============================================================================
- # ** COLOUR SETTINGS **
- #----------------------------------------------------------------------------
- # These predefine several colours. If the Global Colors Module (GCM) is
- # installed these will override the colours in the GCM. To use the GCM
- # instead of these colours, remark each colour out with a #.
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- BLACK = Color.new( 0, 0, 0)
- BLUE = Color.new( 0, 0,255)
- GREEN = Color.new( 0,255, 0)
- RED = Color.new(255, 0, 0)
- WHITE = Color.new(255,255,255)
- YELLOW = Color.new(255,255, 0)
- #============================================================================
- # ** FONT SETTINGS **
- # These options define fonts, font size, etc. Colour constants are
- # predefined in the Global Colours Module (if installed) or under the
- # COLORS section at the top of the settings. Add your own using the same
- # format or define the colours manually.
- #
- # Note: At present the shadow and outline don't work. This will be fixed
- # properly in a later version.
- #----------------------------------------------------------------------------
- # * Fonts
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- DEFAULT_FONT = "Arial" # Display default font
- DEFAULT_SIZE = 14 # Display default font size
- DEFAULT_COLOR = WHITE # Display default font colour
- #----------------------------------------------------------------------------
- # * Titles
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- DEFAULT_TITLE_FONT = "Verdana" # Display default title font
- DEFAULT_TITLE_COLOR = YELLOW # Display default title size
- DEFAULT_TITLE_SIZE = 22 # Display default title colour
- #----------------------------------------------------------------------------
- # * Font Properties
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- DEFAULT_BOLD = false # Display bold font by default
- DEFAULT_ITALIC = false # Display italic font by default
- #----------------------------------------------------------------------------
- # * Font Effects: Text Shadow
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- DEFAULT_SHADOW = true # Display font shadow
- DEFAULT_SHADOW_COLOR = WHITE # Default font shadow colour
- SHADOW_X_OFFSET = 1 # Shadow X offset
- SHADOW_Y_OFFSET = 4 # Shadow Y offset
- #----------------------------------------------------------------------------
- # * Font Effects: Text Outline
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- DEFAULT_OUTLINE = true # Display font outline
- DEFAULT_OUTLINE_COLOR = BLACK # Display font outline colour
- #----------------------------------------------------------------------------
- # * Windowskins
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- DEFAULT_WINDOWSKIN = "001-Blue01" # Change default windowskin
- #----------------------------------------------------------------------------
- # * Line Settings
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- LINE_COLOR = WHITE # Line color for horizontal/vertical lines
- #============================================================================
- #============================================================================
- # ** TITLE SCREEN OPTIONS **
- #----------------------------------------------------------------------------
- # These options are mainly for the Title screen, including menu options.
- #----------------------------------------------------------------------------
- # * Version Number
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- SHOW_VERSION = true # Display version number on Title screen
- VERSION_ID = "1.9.9.0" # Current version number of the game
- VERSION_WINDOW_X = 500 # X-position of the Version window
- VERSION_WINDOW_Y = 0 # Y-position of the Version window
- VERSION_WINDOW_OPACITY = 0 # Opacity of the Version window
- SKIP_TITLE = true # Skip the Title screen
- #============================================================================
- #============================================================================
- # ** GOLD WINDOW OPTIONS **
- #----------------------------------------------------------------------------
- # The Gold Window Options tweak the gold display window.
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- SHOW_GOLD_ICON = true # Show icons next to gold text
- GOLD_ICON = "032-Item01" # Name of gold icon to display
- GOLD_COMMAS = true # Add commas to larger numbers in gold
- CURRENCY_ALIGN = "Left" # Align currency symbol left/right
- #============================================================================
- #============================================================================
- # ** PLAY TIME WINDOW OPTIONS **
- #----------------------------------------------------------------------------
- # The Play Time Window Options tweak the play time display window.
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- SHOW_TIME_ICON = true # Show icons next to play time text
- TIME_ICON = "033-Item02" # Name of time icon to display
- #============================================================================
- #============================================================================
- # ** STEPS WINDOW OPTIONS **
- #----------------------------------------------------------------------------
- # The Steps Window Options tweak the steps display window.
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- SHOW_STEPS_ICON = true # Show icons next to steps text
- STEPS_ICON = "020-Accessory05" # Name of steps icon to display
- #============================================================================
- #============================================================================
- # ** ALTERNATIVE STATUS ADD-ON OPTIONS **
- #----------------------------------------------------------------------------
- # This changes the default Status screen layout to something much more
- # aesthetic. Each section has different styles and options.
- #----------------------------------------------------------------------------
- # * Toggle Layout Style *
- #----------------------------------------------------------------------------
- # Options are "true" for an alternative aesthetic Status layout or "false"
- # to keep the default layout.
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- TOGGLE_STYLE = true # Toggle layout style
- TOGGLE_LABELS = true # Add labels to Name/Class
- #----------------------------------------------------------------------------
- # * Experience Text *
- #----------------------------------------------------------------------------
- # Set the text for the Experience section. Set the strings to "*" to keep
- # the default values defined in the Database.
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- LVL = "Level" # Text for level
- EXP = "Experience" # Text for exp
- EXP_NEXT = "To Next Level" # Text for next level exp
- #----------------------------------------------------------------------------
- # * Parameters Text *
- #----------------------------------------------------------------------------
- # Set the text for the Parameters section. This overrides the defaults set
- # in the Database. Set the parameter strings to "*" to keep the default
- # values defined in the Database. Note: The last two in the array for HIT
- # and EVA are "hidden" parameters, so are not set in the Database. If
- # these are set to "*" the string in the array will be used instead.
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- # Atk, Pdef, Mdef, Str, Dex, Agi, Int, Hit, Eva
- PARAMS = ["Attack", "Phys. Def.", "Mag. Def.", "Strength", "Dexterity",
- "Agility", "Intelligence", "Evasion", "Hit Rate"]
- SHOW_EXTRA_PARAMS = true # Show/hide extra parameters (HIT and EVA)
- #----------------------------------------------------------------------------
- # * Equipment Text *
- #----------------------------------------------------------------------------
- # Set the text for the Equipment section.
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- EQUIP = "Equipment" # Text for equipment section
- SHOW_EQUIP_PARTS = true # Show/hide equipment parts
- # Equipment parts array list
- EQUIP_PARTS = ["Weapon", "Offhand", "Head", "Body"]
- #----------------------------------------------------------------------------
- # * Health Conditions Text *
- #----------------------------------------------------------------------------
- # Provides a description of characters' health states. This is based on
- # a percentage range of their HP.
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- SHOW_HEALTH_STATES = true # Enable/disable health states
- HEALTH_STATES = [ # Text for health states
- "Dead", # When HP is 0%
- "Full Health", # When HP is at 100%
- "Healthy", # When HP is 75%-99%
- "Injured", # When HP is 50%-74%
- "Heavily Injured", # When HP is 25%-49%
- "Critical", # When HP is 1%-24%
- "Barely Conscious", # When HP is 1 after knockout
- ]
- #----------------------------------------------------------------------------
- # * States As Icons *
- #----------------------------------------------------------------------------
- # Displays states as icons instead of the default text. Note: Icons for
- # each state must exist in Graphics/Icons, named the same as the state in
- # the Database.
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- SHOW_STATES_ICONS = true # Show/hide states as icons
- MAX_STATES = 16 # Maximum number of states displayed
- #----------------------------------------------------------------------------
- # * Class Icons *
- #----------------------------------------------------------------------------
- # This array defines the icons used for each class, based on the class IDs
- # defined in the database. These are the icon filenames located in the
- # Graphics/Icons folder. Change/add as necessary for each class.
- #
- # The CLASS_ICONS represent the same classes in the order they appear in
- # the Database.
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- SHOW_CLASS_ICONS = true
- CLASS_ICONS = ["001-Weapon01", "002-Weapon02", "003-Weapon03",
- "004-Weapon04", "005-Weapon05", "006-Weapon06",
- "007-Weapon07", "008-Weapon08"]
- #----------------------------------------------------------------------------
- # * Status Screen Options **
- #----------------------------------------------------------------------------
- # This section offers additional features to the Status Screen, including
- # an alternative layout.
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- TOGGLE_SECTION_TITLES = true # Toggle section titles
- #============================================================================
- #============================================================================
- # ** EQUIP SCREEN ADD-ON OPTIONS **
- #----------------------------------------------------------------------------
- # This add-on enhances the Equip screen, including additional features.
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- TOGGLE_EXTRA_EQUIP = true # Toggle Equip screen extras
- # TOGGLE_LABELS = true # Add labels to Name/Class
- #============================================================================
- #============================================================================
- # ** COMBAT ADD-ON OPTIONS **
- #----------------------------------------------------------------------------
- # This add-on tweaks or enhances the battle scenes, including adding or
- # disabling options.
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- #============================================================================
- # ** ADDITIONAL NOTES **
- # These are some notes on the various scripts/scriptlets and add-ons in
- # the Tweaks & Add-Ons script. Some are instructions of use for certain
- # new methods or additions.
- #----------------------------------------------------------------------------
- # * Icons *
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- # All icons are imported into the Graphics/Icons folder.
- #
- #----------------------------------------------------------------------------
- # * New Method: Draw Icon *
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- # A new method - draw_icon - has been added to Window_Base. This enables
- # icons to be drawn easily in windows.
- #
- # The formula is:
- #
- # draw_icon(icon, x, y)
- #
- # where "icon" is the name of the icon (filename without the extension);
- # "x" and "y" are the x- and y-coordinates of the icon.
- #
- #----------------------------------------------------------------------------
- # * New Method: Change Color *
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- # The new change_color method has been added to Window_Base, which allows
- # for an easier, much better method of changing colours than the default
- # self.contents.font.color.
- #
- # The formula is:
- #
- # change_color(color, alpha)
- #
- # where "color" is a colour in any format (variable, constant, Color.new,
- # etc.) and "alpha" sets the colour's transparency ("true" by default).
- #
- #----------------------------------------------------------------------------
- # * Bitmap Addons *
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- # In the Bitmap Addons module included in this script, which has been
- # ported over from the RMVX version I did, are several additional
- # features and functions.
- #
- # The following only outlines the added functions and their formulae, but
- # not how to use them. In the manual, these will be explained in greater
- # details, along with examples of use.
- #
- # ● Reset Fonts - Resets font settings to default
- # ● Draw Horizontal Line - Draw a horizontal separator line
- # ● Draw Vertical Line - Draw a vertical separator line
- # ● Draw Title - Emphasize text as a title (with underline)
- # ● Draw Shadow Effect - Enhancement on default shadow setting
- # ● Draw Outline Effect - Draw text outline
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- #
- #============================================================================
- end
- #==============================================================================
- # ** CW's Bitmap Addons for TWAXP
- # Version : 1.3
- # Platform : RMXP
- # Author : Companion Wulf
- # Release Date: 18 June 2010
- # Last Update : 20 November 2013
- # Websites : RPG Maker Times - http://rpgmakertimes.blogspot.com
- # : RMT Companion Blog - http://blog.rpgmakertimes.info
- # : RPG Maker Times Facebook - http://facebook.com/RPGMakerTimes
- #------------------------------------------------------------------------------
- # This adds additional functions to the Bitmap class, including various text
- # options and shapes.
- #
- #------------------------------------------------------------------------------
- # * Features
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- # ● Reset Fonts - Resets font settings to default
- # ● Draw Horizontal Line - Draw a horizontal separator line
- # ● Draw Vertical Line - Draw a vertical separator line
- # ● Draw Title - Emphasize text as a title (with underline)
- # ● Draw Labels - Emboldened text for text labels
- #
- # The following don't work properly, but will be full integrated into the
- # Bitmap at some point in the future.
- # ● Draw Shadow Effect - Enhancement on default shadow setting
- # ● Draw Outline Effect - Draw text outline
- #
- #------------------------------------------------------------------------------
- # * Version History
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- # The version history tracking will be changing to the following format:
- #
- # Release.Updates
- #
- # Release numbers indicate public release versions.
- #
- # Updates refers to new methods that have been added.
- #
- #------------------------------------------------------------------------------
- # Updates Version History
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- # Prior to Version 1.0, dates for updates were not implemented.
- #
- # v1.3 (29-Nov-2013)
- # ● Reset Fonts
- # v1.1 (13-Nov-2013)
- # ● Draw Vertical Line
- # v1.0 (18-Jun-2010)
- # ● Release: Version 1.0
- # v0.5
- # ● Add: Draw Labels (draw_label)*
- # v0.4
- # ● Add: Draw Horizontal Line (draw_horz_line)*
- # v0.3
- # ● Add: Draw Font Shadow (draw_font_shadow)
- # v0.2
- # ● Add: Draw Font Outline (draw_font_outline)
- # v0.1
- # ● Add: Draw Title (draw_title)*
- #
- # * Originally created specifically for Extra Stats script for RMVX, but some
- # features have been ported over to RMXP.
- #==============================================================================
- $imported = {} if $imported == nil; $imported["CWBitmapAddons"] = true
- class Bitmap
- include TWAXP_SETTINGS
- #--------------------------------------------------------------------------
- # * Reset Fonts To Defaults |--ADDED--|
- #--------------------------------------------------------------------------
- def reset_fonts
- self.font.default_name = DEFAULT_FONT
- self.font.default_size = DEFAULT_SIZE
- self.font.default_bold = false
- self.font.default_italic = false
- self.font.default_color = DEFAULT_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-22, ls, lc)
- end
- #--------------------------------------------------------------------------
- # * Draw Vertical Line |--ADDED--|
- # x : x-coordinate
- # y : y-coordinate
- # lw : line width
- # lh : line height
- # lc : line colour
- #--------------------------------------------------------------------------
- def draw_vert_line(x, y, lw = 2, lh = self.height, lc = LINE_COLOR)
- line_y = y + 24 / 2 - 1
- line_x = x + 24 / 2 - 1
- fill_rect(x, y, lw, lh, 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/2, h = 24, a = 0)
- self.font.bold = 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 + 9, w)
- self.font.bold = false
- end
- #--------------------------------------------------------------------------
- # * Draw Shadow |--ADDED--|
- # x : draw spot x-coordinate
- # y : draw spot y-coordinate
- # w : width
- # h : height
- # text : text to display
- #--------------------------------------------------------------------------
- def draw_font_shadow(x=0, y=0, text="", w=120, h=32)
- # Display shadow/shadow color
- self.font.color = DEFAULT_SHADOW_COLOR
- self.draw_text(x + SHADOW_X_OFFSET, y + SHADOW_Y_OFFSET, w, h, text, 1)
- # Display normal color text
- self.font.color = DEFAULT_COLOR
- self.draw_text(x, y, w, h, text)
- end
- #--------------------------------------------------------------------------
- # * Draw Outline |--ADDED--|
- # x : draw spot x-coordinate
- # y : draw spot y-coordinate
- # w : width
- # h : height
- # text : text to display
- #--------------------------------------------------------------------------
- def draw_font_outline(x=0, y=0, text="", w=120, h=32, a = 255)
- self.font.color = DEFAULT_OUTLINE_COLOR
- self.draw_text(x + 3, y * 32 + 3, w, h, text, 1)
- self.draw_text(x - 3, y * 32 + 3, w, h, text, 1)
- self.draw_text(x + 3, y * 32 - 3, w, h, text, 1)
- self.draw_text(x - 3, y * 32 - 3, w, h, text, 1)
- self.font.color = DEFAULT_COLOR
- self.draw_text(x, y * 32, w, h, text, a)
- end
- end
- #==============================================================================
- # ** Window_Base
- #------------------------------------------------------------------------------
- # Added Methods
- # * draw_icon
- # Aliased Methods
- # * draw_actor_name
- # * draw_actor_class
- # Overwritten Methods
- # * draw_actorl_level
- # * draw_actor_parameter
- #==============================================================================
- class Window_Base < Window
- include TWAXP_SETTINGS
- WLH = 32 # Line height constant
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- alias :cwtwaxp_winbs_initialize :initialize
- def initialize(x, y, width, height)
- cwtwaxp_winbs_initialize(x, y, width, height)
- Font.default_name = DEFAULT_FONT
- Font.default_size = DEFAULT_SIZE
- Font.default_color = DEFAULT_COLOR
- Font.default_bold = DEFAULT_BOLD
- Font.default_italic = DEFAULT_ITALIC
- self.contents = Bitmap.new(width - 32, height - 32)
- $game_system.windowskin_name = DEFAULT_WINDOWSKIN
- self.contents.draw_font_shadow if DEFAULT_SHADOW
- self.contents.draw_font_outline if DEFAULT_OUTLINE
- end
- #--------------------------------------------------------------------------
- # * Change Text Drawing Color
- # enabled : Enabled flag. When false, draw semi-transparently.
- #--------------------------------------------------------------------------
- def change_color(color, enabled = true)
- contents.font.color = color
- contents.font.color.alpha = translucent_alpha unless enabled
- end
- #--------------------------------------------------------------------------
- # * Draw Icon
- # icon : Name of icon
- # x : Icon x-coordinate
- # y : Icon y-coordinate
- #--------------------------------------------------------------------------
- def draw_icon(icon, x, y)
- bitmap = RPG::Cache.icon(icon)
- sw = bitmap.width
- sh = bitmap.height
- src_rect = Rect.new(0, 0, sw, sh)
- self.contents.blt(x, y, bitmap, src_rect)
- end
- #--------------------------------------------------------------------------
- # * Draw Name
- #--------------------------------------------------------------------------
- alias :cwtwaxp_winbs_draw_name :draw_actor_name
- def draw_actor_name(actor, x, y)
- if TOGGLE_LABELS
- self.contents.font.color = system_color
- self.contents.draw_text(x, y, 60, WLH, "Name:")
- x += 60
- end
- cwtwaxp_winbs_draw_name(actor, x, y)
- end
- #--------------------------------------------------------------------------
- # * Draw Class
- #--------------------------------------------------------------------------
- alias :cwtwaxp_winbs_draw_class :draw_actor_class
- def draw_actor_class(actor, x, y)
- if TOGGLE_LABELS
- self.contents.font.color = system_color
- self.contents.draw_text(x + 80, y, 60, WLH, "Class:")
- x += 60
- end
- if SHOW_CLASS_ICONS
- class_icon = actor.class_id - 1
- draw_icon(CLASS_ICONS[class_icon], x + 72, y)
- x += 32
- end
- cwtwaxp_winbs_draw_class(actor, x + 80, y)
- end
- #--------------------------------------------------------------------------
- # * Draw Level
- #--------------------------------------------------------------------------
- def draw_actor_level(actor, x, y)
- LVL == "*" ? lvl = "Lv" : lvl = LVL
- self.contents.font.color = system_color
- self.contents.draw_text(x, y, 60, WLH, lvl)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 55, y, 24, WLH, actor.level.to_s, 2)
- end
- #--------------------------------------------------------------------------
- # * Draw Parameter
- #--------------------------------------------------------------------------
- def draw_actor_parameter(actor, x, y, type)
- case type
- when 0
- PARAMS[0] == "*" ? pname = $data_system.words.atk : pname = PARAMS[0]
- parameter_value = actor.atk
- when 1
- PARAMS[1] == "*" ? pname = $data_system.words.pdef : pname = PARAMS[1]
- parameter_value = actor.pdef
- when 2
- PARAMS[2] == "*" ? pname = $data_system.words.mdef : pname = PARAMS[2]
- parameter_value = actor.mdef
- when 3
- PARAMS[3] == "*" ? pname = $data_system.words.str : pname = PARAMS[3]
- parameter_value = actor.str
- when 4
- PARAMS[4] == "*" ? pname = $data_system.words.dex : pname = PARAMS[4]
- parameter_value = actor.dex
- when 5
- PARAMS[5] == "*" ? pname = $data_system.words.agi : pname = PARAMS[5]
- parameter_value = actor.agi
- when 6
- PARAMS[6] == "*" ? pname = $data_system.words.int : pname = PARAMS[6]
- parameter_value = actor.int
- when 7
- pname = PARAMS[7]
- parameter_value = actor.eva
- when 8
- pname = PARAMS[8]
- parameter_value = actor.hit
- end
- self.contents.font.color = system_color
- self.contents.draw_text(x, y, 120, WLH, pname)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 120, y, 36, WLH, parameter_value.to_s, 2)
- end
- #--------------------------------------------------------------------------
- # * Draw HP
- # actor : actor
- # x : draw spot x-coordinate
- # y : draw spot y-coordinate
- # width : draw spot width
- #--------------------------------------------------------------------------
- alias :cwtwaxp_winbs_draw_hp :draw_actor_hp
- def draw_actor_hp(actor, x, y, width = 144)
- cwtwaxp_winbs_draw_hp(actor, x, y, width)
- if SHOW_HEALTH_STATES
- color = normal_color
- if actor.hp == 0 || actor.hp < 0
- health = HEALTH_STATES[0]; color = knockout_color
- elsif actor.hp == actor.maxhp
- health = HEALTH_STATES[1]
- elsif actor.hp >= (0.75*actor.maxhp) && actor.hp <= (0.99*actor.maxhp)
- health = HEALTH_STATES[2]
- elsif actor.hp >= (0.50*actor.maxhp) && actor.hp <= (0.74*actor.maxhp)
- health = HEALTH_STATES[3]
- elsif actor.hp >= (0.25*actor.maxhp) && actor.hp <= (0.49*actor.maxhp)
- health = HEALTH_STATES[4]
- elsif actor.hp >= (0.01*actor.maxhp) && actor.hp <= (0.24*actor.maxhp)
- health = HEALTH_STATES[5]
- else
- health = HEALTH_STATES[6]; color = knockout_color
- end
- color = crisis_color if health == HEALTH_STATES[5]
- self.contents.font.color = color
- self.contents.draw_text(x + 260, y + WLH * 4, 220, WLH, health, 0)
- end
- end
- #--------------------------------------------------------------------------
- # * Draw State
- # actor : actor
- # x : draw spot x-coordinate
- # y : draw spot y-coordinate
- # width : draw spot width
- #--------------------------------------------------------------------------
- alias :cwtwaxp_draw_state :draw_actor_state
- def draw_actor_state(actor, x, y, width = 120)
- if SHOW_STATES_ICONS
- for i in 0...actor.states.length
- if i < MAX_STATES
- ix = 24 * i
- draw_icon($data_states[actor.states[i]].name, x + ix, y + 8)
- end
- end
- else
- cwtwaxp_draw_state(actor, x, y, width)
- end
- end
- end
- #==============================================================================
- # ** Scene_Title
- #------------------------------------------------------------------------------
- # # Added Methods
- # * load_database
- # * create_game_objects
- # * create_title_graphic
- # * create_commands
- # * check_continue
- # * play_title_music
- # * terminate
- # * create_version_window
- # Aliased Methods
- # *
- # Overwritten Methods
- # * main
- #==============================================================================
- class Scene_Title
- include TWAXP_SETTINGS
- #--------------------------------------------------------------------------
- # * Main Processing
- # The Main method has been rewritten to make it easier to reference and
- # alias.
- #--------------------------------------------------------------------------
- def main
- # If battle test
- if $BTEST
- battle_test
- return
- end
- # Start Processing
- load_database
- create_game_objects
- skip_title_check
- create_title_graphic
- create_commands
- play_title_music
- # Version Window
- create_version_window if SHOW_VERSION
- # Execute transition
- Graphics.transition
- # Main loop
- loop do
- # Update game screen
- Graphics.update
- # Update input information
- Input.update
- # Frame update
- update
- # Abort loop if screen is changed
- if $scene != self
- break
- end
- end
- terminate
- end
- #--------------------------------------------------------------------------
- # * Load Database
- #--------------------------------------------------------------------------
- def load_database
- # Load database
- $data_actors = load_data("Data/Actors.rxdata")
- $data_classes = load_data("Data/Classes.rxdata")
- $data_skills = load_data("Data/Skills.rxdata")
- $data_items = load_data("Data/Items.rxdata")
- $data_weapons = load_data("Data/Weapons.rxdata")
- $data_armors = load_data("Data/Armors.rxdata")
- $data_enemies = load_data("Data/Enemies.rxdata")
- $data_troops = load_data("Data/Troops.rxdata")
- $data_states = load_data("Data/States.rxdata")
- $data_animations = load_data("Data/Animations.rxdata")
- $data_tilesets = load_data("Data/Tilesets.rxdata")
- $data_common_events = load_data("Data/CommonEvents.rxdata")
- $data_system = load_data("Data/System.rxdata")
- end
- #--------------------------------------------------------------------------
- # * Create Game Objects
- #--------------------------------------------------------------------------
- def create_game_objects
- $game_temp = Game_Temp.new
- $game_system = Game_System.new
- $game_switches = Game_Switches.new
- $game_variables = Game_Variables.new
- $game_self_switches = Game_SelfSwitches.new
- $game_screen = Game_Screen.new
- $game_actors = Game_Actors.new
- $game_party = Game_Party.new
- $game_troop = Game_Troop.new
- $game_map = Game_Map.new
- $game_player = Game_Player.new
- $game_system = Game_System.new
- end
- #--------------------------------------------------------------------------
- # * Create Title Graphic
- #--------------------------------------------------------------------------
- def create_title_graphic
- # Make title graphic
- @sprite = Sprite.new
- @sprite.bitmap = RPG::Cache.title($data_system.title_name)
- end
- #--------------------------------------------------------------------------
- # * Create Command Window
- #--------------------------------------------------------------------------
- def create_commands
- # Make command window
- s1 = "New Game"
- s2 = "Continue"
- s3 = "Shutdown"
- @command_window = Window_Command.new(192, [s1, s2, s3])
- @command_window.back_opacity = 160
- @command_window.x = 320 - @command_window.width / 2
- @command_window.y = 288
- # Continue enabled determinant
- check_continue unless SKIP_TITLE
- end
- #--------------------------------------------------------------------------
- # * Check Continue
- #--------------------------------------------------------------------------
- def check_continue
- # Check if at least one save file exists
- # If enabled, make @continue_enabled true; if disabled, make it false
- @continue_enabled = false
- for i in 0..3
- if FileTest.exist?("Save#{i+1}.rxdata")
- @continue_enabled = true
- end
- end
- # If continue is enabled, move cursor to "Continue"
- # If disabled, display "Continue" text in gray
- if @continue_enabled
- @command_window.index = 1
- else
- @command_window.disable_item(1)
- end
- end
- #--------------------------------------------------------------------------
- # * Play Title Music
- #--------------------------------------------------------------------------
- def play_title_music
- # Play title BGM
- $game_system.bgm_play($data_system.title_bgm)
- # Stop playing ME and BGS
- Audio.me_stop
- Audio.bgs_stop
- end
- #--------------------------------------------------------------------------
- # * Terminate Processing
- #--------------------------------------------------------------------------
- def terminate
- # Prepare for transition
- Graphics.freeze
- # Dispose of command window
- @command_window.dispose
- # Dispose of title graphic
- @sprite.bitmap.dispose
- @sprite.dispose
- @version_window.dispose
- end
- #--------------------------------------------------------------------------
- # * Create Version Window
- #--------------------------------------------------------------------------
- def create_version_window
- if SHOW_VERSION
- @version_window = Window_Version.new
- @version_window.x = VERSION_WINDOW_X
- @version_window.y = VERSION_WINDOW_Y
- end
- end
- def skip_title_check
- if SKIP_TITLE
- load_database
- create_game_objects
- command_new_game
- end
- end
- end
- #==============================================================================
- # ** Window_Version
- #------------------------------------------------------------------------------
- # This window displays the current version of the game.
- #==============================================================================
- class Window_Version < Window_Base
- include TWAXP_SETTINGS
- #--------------------------------------------------------------------------
- # * Object Initialization
- # x : window X coordinate
- # y : window Y coordinate
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0, 160, WLH + 32)
- self.contents = Bitmap.new(width - 32, height - 32)
- self.opacity = VERSION_WINDOW_OPACITY
- refresh
- end
- #--------------------------------------------------------------------------
- # * Refresh
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- self.contents.font.size = DEFAULT_SIZE
- self.contents.draw_text(0, 0, 160, WLH, "Version: " + VERSION_ID)
- end
- end
- #==============================================================================
- # ** Window_Gold
- #------------------------------------------------------------------------------
- # This window displays amount of gold.
- #------------------------------------------------------------------------------
- # Overwritten Methods
- # * refresh
- #==============================================================================
- class Window_Gold < Window_Base
- include TWAXP_SETTINGS
- #--------------------------------------------------------------------------
- # * Refresh
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- draw_icon(GOLD_ICON, 0, 0) if SHOW_GOLD_ICON
- cx = contents.text_size($data_system.words.gold).width
- GOLD_COMMAS ? gold = $game_party.gold.to_s.reverse.gsub(/(\d{3})(?=\d)/, '\\1,').reverse :
- gold = $game_party.gold.to_s
- self.contents.font.color = normal_color
- self.contents.draw_text(4, 0, 120-cx-2, 32, gold.to_s, 2)
- self.contents.font.color = system_color
- if CURRENCY_ALIGN.upcase == "LEFT"; x, align = 28, 0
- else x, align = 124-cx, 2; end
- self.contents.draw_text(x, 0, cx, 32, $data_system.words.gold, align)
- end
- end
- #==============================================================================
- # ** Window_PlayTime
- #------------------------------------------------------------------------------
- # This window displays play time on the menu screen.
- #------------------------------------------------------------------------------
- # Overwritten Methods
- # * refresh
- #==============================================================================
- class Window_PlayTime < Window_Base
- include TWAXP_SETTINGS
- #--------------------------------------------------------------------------
- # * Refresh
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- x, ptx = 4, 4
- if SHOW_TIME_ICON; draw_icon(TIME_ICON, 0, 0); x += 26; end
- self.contents.font.color = system_color
- self.contents.draw_text(x, 0, 120, 32, "Play Time")
- @total_sec = Graphics.frame_count / Graphics.frame_rate
- hour = @total_sec / 60 / 60
- min = @total_sec / 60 % 60
- sec = @total_sec % 60
- text = sprintf("%02d:%02d:%02d", hour, min, sec)
- self.contents.font.color = normal_color
- self.contents.draw_text(ptx, 32, 120, 32, text, 2) if SHOW_TIME_ICON
- end
- end
- #==============================================================================
- # ** Window_Steps
- #------------------------------------------------------------------------------
- # This window displays step count on the menu screen.
- # Overwritten Methods
- # * refresh
- #==============================================================================
- class Window_Steps < Window_Base
- include TWAXP_SETTINGS
- #--------------------------------------------------------------------------
- # * Refresh
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- x, stx = 4, 4
- if SHOW_STEPS_ICON; draw_icon(STEPS_ICON, 0, 0); x += 26; end
- self.contents.font.color = system_color
- self.contents.draw_text(x, 0, 120, 32, "Step Count")
- self.contents.font.color = normal_color
- self.contents.draw_text(stx, 32, 120, 32, $game_party.steps.to_s, 2)
- end
- end
- #==============================================================================
- # ** Window_Status
- #------------------------------------------------------------------------------
- # This window displays full status specs on the status screen.
- #------------------------------------------------------------------------------
- # Added Methods
- # * draw_block1
- # * draw_block2
- # * draw_block3
- # * draw_block4
- # * draw_block5
- # Aliased Methods
- # * refresh
- # Overwritten Methods
- # *
- #==============================================================================
- class Window_Status < Window_Base
- include TWAXP_SETTINGS
- #--------------------------------------------------------------------------
- # * Refresh
- #--------------------------------------------------------------------------
- alias :cwtwaxp_winsts_refresh :refresh
- def refresh
- if TOGGLE_STYLE
- self.contents.clear
- self.contents.font.size = 18
- draw_block1(4, 0) # Draw actor info
- draw_block2(320, 0) # Draw exp info
- draw_block3(26) # Draw parameters
- draw_block4 # Draw states
- draw_block5 # Draw equipment
- else
- cwtwaxp_winsts_refresh
- end
- end
- #--------------------------------------------------------------------------
- # * Block 1: Actor Info
- #--------------------------------------------------------------------------
- def draw_block1(x, y)
- draw_actor_graphic(@actor, 30, 112)
- draw_actor_name(@actor, 4, WLH * 0)
- draw_actor_class(@actor, 4 + 144, WLH * 0)
- end
- #--------------------------------------------------------------------------
- # * Block 2: Experience Info
- #--------------------------------------------------------------------------
- def draw_block2(x, y)
- if TOGGLE_SECTION_TITLES
- self.contents.draw_title(x, y + WLH * 1, "Experience")
- y += WLH
- end
- EXP == "*" ? exp = "EXP" : exp = EXP
- EXP_NEXT == "*" ? exp_next = "NEXT" : exp_next = EXP_NEXT
- draw_actor_level(@actor, x, y + WLH * 1)
- self.contents.font.color = system_color
- self.contents.draw_text(x, y + WLH * 2, self.width, WLH, exp)
- self.contents.draw_text(x, y + WLH * 3, self.width, WLH, exp_next)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 180, y + WLH * 2, 84, WLH, @actor.exp_s, 2)
- self.contents.draw_text(x + 180, y + WLH * 3, 84, WLH, @actor.next_rest_exp_s, 2)
- end
- #--------------------------------------------------------------------------
- # * Block 3: Parameters
- #--------------------------------------------------------------------------
- def draw_block3(x, y = 0)
- draw_actor_hp(@actor, x + 34, WLH * 1 + 14, 172)
- draw_actor_sp(@actor, x + 34, WLH * 2 + 14, 172)
- if TOGGLE_SECTION_TITLES
- self.contents.draw_title(x, y + WLH * 4, "Parameters")
- y += WLH
- end
- draw_actor_parameter(@actor, x, y + WLH * 4, 0)
- draw_actor_parameter(@actor, x, y + WLH * 5, 1)
- draw_actor_parameter(@actor, x, y + WLH * 6, 2)
- draw_actor_parameter(@actor, x, y + WLH * 7, 3)
- draw_actor_parameter(@actor, x, y + WLH * 8, 4)
- draw_actor_parameter(@actor, x, y + WLH * 9, 5)
- draw_actor_parameter(@actor, x, y + WLH * 10, 6)
- if SHOW_EXTRA_PARAMS
- draw_actor_parameter(@actor, x, y + WLH * 11, 7)
- draw_actor_parameter(@actor, x, y + WLH * 12, 8)
- end
- end
- #--------------------------------------------------------------------------
- # * Block 4: States
- #--------------------------------------------------------------------------
- def draw_block4
- draw_actor_state(@actor, 320, WLH * 5)
- end
- #--------------------------------------------------------------------------
- # * Block 5: Equipment
- #--------------------------------------------------------------------------
- def draw_block5
- EQUIP == "*" ? equip = "EQUIPMENT" : equip = EQUIP
- self.contents.font.color = system_color
- self.contents.draw_text(320, WLH * 7, self.width, 32, equip)
- x = 340
- if SHOW_EQUIP_PARTS
- for i in 0...EQUIP_PARTS.size
- y = i + 8
- self.contents.draw_text(x, WLH * y, 80, WLH, EQUIP_PARTS[i])
- end
- x += 80
- end
- draw_item_name($data_weapons[@actor.weapon_id], x + 16, WLH * 8)
- draw_item_name($data_armors[@actor.armor1_id], x + 16, WLH * 9)
- draw_item_name($data_armors[@actor.armor2_id], x + 16, WLH * 10)
- draw_item_name($data_armors[@actor.armor3_id], x + 16, WLH * 11)
- draw_item_name($data_armors[@actor.armor4_id], x + 16, WLH * 12)
- end
- end
- #==============================================================================
- # ** Scene_Equip
- #------------------------------------------------------------------------------
- # This class performs equipment screen processing.
- #==============================================================================
- class Scene_Equip
- include TWAXP_SETTINGS
- #--------------------------------------------------------------------------
- # * Refresh
- #--------------------------------------------------------------------------
- def refresh
- # Set item window to visible
- @item_window1.visible = (@right_window.index == 0)
- @item_window2.visible = (@right_window.index == 1)
- @item_window3.visible = (@right_window.index == 2)
- @item_window4.visible = (@right_window.index == 3)
- @item_window5.visible = (@right_window.index == 4)
- # Get currently equipped item
- item1 = @right_window.item
- # Set current item window to @item_window
- case @right_window.index
- when 0
- @item_window = @item_window1
- when 1
- @item_window = @item_window2
- when 2
- @item_window = @item_window3
- when 3
- @item_window = @item_window4
- when 4
- @item_window = @item_window5
- end
- # If right window is active
- if @right_window.active
- # Erase parameters for after equipment change
- TOGGLE_EXTRA_EQUIP ?
- @left_window.set_new_parameters(nil, nil, nil, nil, nil, nil, nil, nil) :
- @left_window.set_new_parameters(nil, nil, nil)
- end
- # If item window is active
- if @item_window.active
- # Get currently selected item
- item2 = @item_window.item
- # Change equipment
- last_hp = @actor.hp
- last_sp = @actor.sp
- @actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
- # Get parameters for after equipment change
- new_atk = @actor.atk
- new_pdef = @actor.pdef
- new_mdef = @actor.mdef
- if TOGGLE_EXTRA_EQUIP
- new_str = @actor.str
- new_dex = @actor.dex
- new_agi = @actor.agi
- new_int = @actor.int
- new_eva = @actor.eva
- end
- # Return equipment
- @actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
- @actor.hp = last_hp
- @actor.sp = last_sp
- # Draw in left window
- TOGGLE_EXTRA_EQUIP ?
- @left_window.set_new_parameters(new_atk, new_pdef, new_mdef, new_str, new_dex, new_agi, new_int, new_eva) :
- @left_window.set_new_parameters(new_atk, new_pdef, new_mdef)
- end
- end
- end
- #==============================================================================
- # ** Window_EquipLeft
- #==============================================================================
- class Window_EquipLeft < Window_Base
- include TWAXP_SETTINGS
- #--------------------------------------------------------------------------
- # * Object Initialization
- # actor : actor
- #--------------------------------------------------------------------------
- def initialize(actor)
- if TOGGLE_EXTRA_EQUIP; h = 419 else h = 192; end
- super(0, 64, 272, h)
- self.contents = Bitmap.new(width - 32, height - 32)
- @actor = actor
- refresh
- end
- #--------------------------------------------------------------------------
- # * Refresh
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- draw_actor_name(@actor, 4, 0)
- draw_actor_parameter(@actor, 4, 32, 0) #ATK
- draw_actor_parameter(@actor, 4, 64, 1) #PDEF
- draw_actor_parameter(@actor, 4, 96, 2) #MDEF
- if TOGGLE_EXTRA_EQUIP
- draw_actor_parameter(@actor, 4, 128, 3) #STR
- draw_actor_parameter(@actor, 4, 160, 4) #DEX
- draw_actor_parameter(@actor, 4, 192, 5) #AGI
- draw_actor_parameter(@actor, 4, 224, 6) #INT
- draw_actor_parameter(@actor, 4, 256, 7) #EVA
- end
- if @new_atk != nil
- self.contents.font.color = system_color
- self.contents.draw_text(160, 32, 40, 32, "->", 1)
- self.contents.font.color = normal_color
- self.contents.font.color = param_color(@actor.atk, @new_atk)
- self.contents.draw_text(200, 32, 36, 32, @new_atk.to_s, 2)
- end
- if @new_pdef != nil
- self.contents.font.color = system_color
- self.contents.draw_text(160, 64, 40, 32, "->", 1)
- self.contents.font.color = normal_color
- self.contents.font.color = param_color(@actor.pdef, @new_pdef)
- self.contents.draw_text(200, 64, 36, 32, @new_pdef.to_s, 2)
- end
- if @new_mdef != nil
- self.contents.font.color = system_color
- self.contents.draw_text(160, 96, 40, 32, "->", 1)
- self.contents.font.color = normal_color
- self.contents.font.color = param_color(@actor.mdef, @new_mdef)
- self.contents.draw_text(200, 96, 36, 32, @new_mdef.to_s, 2)
- end
- if TOGGLE_EXTRA_EQUIP
- if @new_str != nil
- self.contents.font.color = system_color
- self.contents.draw_text(160, 128, 40, 32, "->", 1)
- self.contents.font.color = normal_color
- self.contents.font.color = param_color(@actor.str, @new_str)
- self.contents.draw_text(200, 128, 36, 32, @new_str.to_s, 2)
- end
- if @new_dex != nil
- self.contents.font.color = system_color
- self.contents.draw_text(160, 160, 40, 32, "->", 1)
- self.contents.font.color = normal_color
- self.contents.font.color = param_color(@actor.dex, @new_dex)
- self.contents.draw_text(200, 160, 36, 32, @new_dex.to_s, 2)
- end
- if @new_agi != nil
- self.contents.font.color = system_color
- self.contents.draw_text(160, 192, 40, 32, "->", 1)
- self.contents.font.color = normal_color
- self.contents.font.color = param_color(@actor.agi, @new_agi)
- self.contents.draw_text(200, 192, 36, 32, @new_agi.to_s, 2)
- end
- if @new_int != nil
- self.contents.font.color = system_color
- self.contents.draw_text(160, 224, 40, 32, "->", 1)
- self.contents.font.color = normal_color
- self.contents.font.color = param_color(@actor.int, @new_int)
- self.contents.draw_text(200, 224, 36, 32, @new_int.to_s, 2)
- end
- if @new_eva != nil
- self.contents.font.color = system_color
- self.contents.draw_text(160, 256, 40, 32, "->", 1)
- self.contents.font.color = normal_color
- self.contents.font.color = param_color(@actor.eva, @new_eva)
- self.contents.draw_text(200, 256, 36, 32, @new_eva.to_s, 2)
- end
- end
- end
- #--------------------------------------------------------------------------
- # * Set parameters after changing equipment
- # new_atk : attack power after changing equipment
- # new_pdef : physical defense after changing equipment
- # new_mdef : magic defense after changing equipment
- # new_etc : I think you get the picture
- #--------------------------------------------------------------------------
- if TOGGLE_EXTRA_EQUIP
- def set_new_parameters(new_atk, new_pdef, new_mdef, new_str, new_dex, \
- new_agi, new_int, new_eva)
- if @new_atk != new_atk or @new_pdef != new_pdef or @new_mdef != new_mdef or
- @new_str != new_str or @new_dex != new_dex or @new_agi != new_agi or
- @new_int != new_int or @new_eva != new_eva
- @new_atk = new_atk
- @new_pdef = new_pdef
- @new_mdef = new_mdef
- @new_str = new_str
- @new_dex = new_dex
- @new_agi = new_agi
- @new_int = new_int
- @new_eva = new_eva
- refresh
- end
- end
- end
- #------------------------------------------------------------------------------
- # * Parameter Colour
- # Choose text colour based on parameter increase/decrease
- #------------------------------------------------------------------------------
- def param_color(old_param, new_param)
- compare = (old_param <=> new_param)
- case compare
- when -1 # New eq >
- return GREEN
- when 0 # Old = New
- normal_color
- when 1 # Old eq >
- return RED
- end
- end
- end
- class Window_EquipItem < Window_Selectable
- #--------------------------------------------------------------------------
- # * Object Initialization
- # actor : actor
- # equip_type : equip region (0-3)
- #--------------------------------------------------------------------------
- def initialize(actor, equip_type)
- super(272, 256, 368, 224)
- @actor = actor
- @equip_type = equip_type
- @column_max = 1
- refresh
- self.active = false
- self.index = -1
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement