Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin
- J-Revamp-Status
- A configuration story.
- Currently [1.0.0] version.
- Kudos to KK20 for being awesome.
- Version History:
- 1.0.0: Created script.
- INSTRUCTIONS:
- This needs to be placed above all scripts you use that are written by me so that
- the proper configuration can take place before the script executes.
- Also, I will make constant references to b/s/x parameters:
- b = base = MHP/ATK/MDF/etc.
- s = secondary(?) = TGR/PHA/MDR/etc.
- x = extra(?) = HIT/CEV/HRG/etc.
- Normally, S and X parameters are not visible to the player in-game, but they
- seriously should be since they can be pretty impactful! Thus the point of this
- whole entire script.
- In addition to displaying normally-invisible parameters, I also wanted to design
- a status screen that was less empty, and fit better to a 16:9 resolution. That
- resolution of choice was 640x360. Horizontally, that is the highest you can
- achieve with no additional scripts/modifications, but vertically that is
- actually shorter than the default. Because of the way this script was designed,
- The resolution for this to be used can be NO SMALLER THAN 640x360.
- Below you will find a series of modules that contain all the setup details for
- the J-Revamp-Status script, including:
- > resolution changing
- > new Vocab for all parameters
- > help text for all parameters
- > and icon assignment for all parameters
- This is all setup to work right out of the box, but feel free to tinker with it
- if you want to tailor it to your game.
- NOTE:
- With this script primarily being designed around the resolution of 640x360,
- the Description of an actor has been omitted. However, if the reoslution is
- increased in the first module from 360 to 480, The actor description will
- show up between the parameters and their corresponding help text.
- =end
- $imported = {} if $imported.nil?
- $imported["J-Revamp-Status"] = true
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- # This tiny module handles the resolution resizing for the game window.
- # The default max is 640x480(WxH), this script requires at LEAST 640x360.
- module J
- module Resize
- W = 640 # Max 640 w/o specialized .dll file+script.
- H = 360 # Max 480 w/o specialized .dll file+script.
- end#Resize
- end#module J
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- # The below is a re-defining of the vocabulary for b/s/x parameters.
- # Feel free to replace the quotes with whatever you want these parameters to be.
- # NOTE: This overwrites by default whatever is in the database.
- module Vocab
- # B-Parameters
- def self.bparam(bparam_id) #0-7
- case bparam_id
- when 0; return "Life"; # MHP Max HP
- when 1; return "Magi"; # MMP Max MP
- when 2; return "Power"; # ATK Phys Attack
- when 3; return "Endure";# DEF Phys Defense
- when 4; return "Force"; # MAT Magic Attack
- when 5; return "Resist";# MDF Magic Defense
- when 6; return "Speed"; # AGI Agility
- when 7; return "Luck"; # LUK Luck
- end
- end#def
- # S-Parameters
- def self.sparam(sparam_id) #0-9
- case sparam_id
- when 0; return "Targeting"; # TGR TarGet Rate
- when 1; return "Guardblock";# GRD GuaRD effect rate
- when 2; return "Recovery"; # REC RECovery effect rate
- when 3; return "Item Amp"; # PHA PHArmacology
- when 4; return "MP Reduce"; # MCR Mp Cost Rate
- when 5; return "TP Charge"; # TCR Tp Charge Rate
- when 6; return "PhysDMG%"; # PDR Physical Damage Rate
- when 7; return "MagiDMG%"; # MDR Magical Damage Rate
- when 8; return "FloorDMG%"; # FDR Floor Damage Rate
- when 9; return "EXPboost%"; # EXR EXperience Rate
- end
- end#def
- # X-Parameters
- def self.xparam(xparam_id) #0-9
- case xparam_id
- when 0; return "Hit%"; # HIT HIT rate
- when 1; return "Evade% "; # EVA EVAsion rate
- when 2; return "Critical% "; # CRI CRItical rate
- when 3; return "Crit Evade"; # CEV Critical EVasion rate
- when 4; return "M-Evade% "; # MEV Magic EVasion rate
- when 5; return "M-Reflect% "; # MRF Magic ReFlection rate
- when 6; return "Counter% "; # CNT CouNTer attack rate
- when 7; return "HP Regen%"; # HRG Hp ReGeneration rate
- when 8; return "MP Regen%"; # MRG Mp ReGeneration rate
- when 9; return "TP Regen%"; # TRG Tp ReGeneration rate
- end
- end#def
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- # This is a case id setup of index vs param_id, for stat descriptions.
- # Feel free to replace the quotes with whatever you want the help text to say.
- # NOTE: It is scripted to be two lines tall as seen below.
- def self.paramInfo(param_id)
- case param_id
- # The help descriptions for the bparams.
- when 0; return "The maximum endurance of a character.
- More HP makes it more difficult for this character to die."; # MaxHP
- when 3; return "The mental fortitude of a character.
- Higher MP allows for more skills to be cast."; # MaxMP
- when 6; return "The raw physical power of this character.
- Factors into basic attacks and physical skills."; # ATK
- when 9; return "The physical toughness of a character.
- This reduces physical damage, raising effective health."; # DEF
- when 12; return "The magical prowess of a character.
- Greater amounts of this increases overall magical potency."; # MAT
- when 15; return "The pure magical tolerance of a character.
- This reduces magical damage, raising effective health."; # MDF
- when 18; return "The agility of a character.
- Enables more and/or faster actions while in battle."; # AGI
- when 21; return "The absolute luck of a character.
- Having more luck can affect many things in and out of battle!"; # LUK
- # when 24; return "THIS IS AN UNUSED INDEX"; # -blank-
- # when 27; return "THIS IS AN UNUSED INDEX"; # -blank-
- # The help descriptions for the sparams. |
- when 1; return "The character's target rate.
- More of this makes them more likely to be targeted in battle."; # TGR
- when 4; return "The guarding rate.
- Higher guard rate makes your \"Defend\" command more defensive."; # GRD
- when 7; return "The recovery ratio.
- This multiplies all incoming healing from skills by this%."; # REC
- when 10; return "The pharmaceutical ratio.
- This amplifies effects of all items used by this character."; # PHA
- when 13; return "The magical cost reduction.
- All skills with Magi(MP) costs will be reduced by this%."; # MCR
- when 16; return "The technique cost reduction.
- All skills with Tech(TP) costs will be reduced by this%."; # TCR
- when 19; return "The physical damage reduction.
- All physical damage will be reduced by this% off the top."; # PDR
- when 22; return "The magical damage reduction.
- All magical damage will be reduced by this% off the top."; # MDR
- when 25; return "The floor damage reduction.
- All floor/environment damage will be reduced by this%."; # FDR
- when 28; return "The experience ratio.
- All earned experience from battle is increased by this%."; # EXR
- # The help descriptions for the xparams.
- when 2; return "The total combined accuracy.
- Effectively, you hit this% of the time lesser enemy evasion."; # HIT
- when 5; return "The total evasion of this character.
- The greater this is, the less effective enemy hit% is."; # EVA
- when 8; return "The chance of landing a mortal blow.
- More of this increases chances of landing said mortal blow."; # CRI
- when 11; return "The total critical evasion of this character.
- The greater this is, the less effective enemy crit% is."; # CEV
- when 14; return "The total magic evasion of this character.
- The greater this is, the more likely spells will be dodged."; # MEV
- when 17; return "The native magic reflection rate.
- This grants a chance of reflecting magic back to the caster."; # MRF
- when 20; return "The native counter-attack chance.
- This grants achance to strike back at attacking foes."; # CNT
- when 23; return "The natural health regeneration rate.
- This% of max health will be restored each turn."; # HRG
- when 26; return "The natural magic regeneration rate.
- This% of max magic will be restored each turn."; # MRG
- when 29; return "The natural tech regeneration rate.
- This% of max tech will be restored each turn."; # TRG
- else
- return "Catch-fail help description; you should never see this."
- end#case
- end#def
- end#Vocab
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- # This is a hash used for assigning words to icons, specifically parameters.
- # The only thing that requires changing here is the icon number.
- # This can be found by using the database > weapons > choose icon.
- module J
- module StatIcons
- ICONS ={
- # bParameters
- Vocab::bparam(0) => 3453, #Max HP
- Vocab::bparam(1) => 3452, #Max MP
- Vocab::bparam(2) => 3448, #Attack
- Vocab::bparam(3) => 3451, #Defense
- Vocab::bparam(4) => 3450, #M-Attack
- Vocab::bparam(5) => 3454, #M-Defense
- Vocab::bparam(6) => 3449, #Speed
- Vocab::bparam(7) => 3455, #Luck
- # sParameters
- Vocab::sparam(0) => 3114, #TarGet Rate
- Vocab::sparam(1) => 3094, #GuaRD rate
- Vocab::sparam(2) => 3100, #RECovery rate
- Vocab::sparam(3) => 3092, #PHArmacy (item boost rate)
- Vocab::sparam(4) => 3089, #Magic Cost Reduction
- Vocab::sparam(5) => 3088, #Technique Cost Reduction
- Vocab::sparam(6) => 3091, #Physical Damage Reduction
- Vocab::sparam(7) => 3113, #Magic Damage Reduction
- Vocab::sparam(8) => 3105, #Floor Damage Reduction
- Vocab::sparam(9) => 3111, #EXperience Rate
- # xParameters
- Vocab::xparam(0) => 3090, #Hit rate
- Vocab::xparam(1) => 3099, #Evasion rate
- Vocab::xparam(2) => 3097, #Crit chance
- Vocab::xparam(3) => 3101, #Critical evasion
- Vocab::xparam(4) => 3102, #Magic Evasion
- Vocab::xparam(5) => 3110, #Magic ReFlection rate
- Vocab::xparam(6) => 3096, #CouNTer-attack Rate
- Vocab::xparam(7) => 3109, #Health ReGeneration
- Vocab::xparam(8) => 3098, #Magic ReGeneration
- Vocab::xparam(9) => 3108, #Tech ReGeneration
- }#
- end#StatIcons
- end#J
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- # Processes the new Graphics Resolution based on input resolution above.
- # Catches it so there isn't a double-resize going on from Yanfly's stuff.
- if $imported["YEA-CoreEngine"]
- else
- Graphics.resize_screen(J::Resize::W, J::Resize::H)
- end#$YEA-CoreEngine
- class Window_Base < Window
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- # NEW! Function(s): draw_actor_bparam, draw_actor_sparam, draw_actor_xparam
- # Overwrites: make_font_bigger, make_font_smaller, draw_actor_hp, draw_actor_mp
- # : Identical to drawing normal parameters, but for s/x params as well.
- # : Also draws icons when available for the various stats.
- # : Also enables fixed digit count for drawing parameters.
- # \\ Draws the base parameters for the given actor.
- def draw_actor_bparam(actor, x, y, param_id)
- name = Vocab::bparam(param_id)
- if J::StatIcons::ICONS.include?(name)
- draw_icon(J::StatIcons::ICONS[name], x-32, y)
- end
- value = sprintf("%04d", actor.param(param_id).to_s)
- change_color(system_color)
- draw_text(x-10, y, 120, line_height, name)
- change_color(normal_color)
- draw_text(x + 50, y, 48, line_height, value, 2)
- end#def
- # \\ Draws the s-parameters for the given actor.
- def draw_actor_sparam(actor, x, y, sparam_id)
- name = Vocab::sparam(sparam_id)
- if J::StatIcons::ICONS.include?(name)
- draw_icon(J::StatIcons::ICONS[name], x-32, y)
- end
- value = ((actor.sparam(sparam_id)*100) - 100).to_i
- change_color(system_color)
- draw_text(x - 10, y, 120, line_height, name)
- change_color(normal_color)
- draw_text(x + 50, y, 48, line_height, value, 2)
- end#def
- # \\ Draws the x-parameters for the given actor.
- def draw_actor_xparam(actor, x, y, xparam_id)
- name = Vocab::xparam(xparam_id)
- if J::StatIcons::ICONS.include?(name)
- draw_icon(J::StatIcons::ICONS[name], x-32, y)
- end
- change_color(system_color)
- draw_text(x - 10, y, 120, line_height, name)
- change_color(normal_color)
- draw_text(x + 50, y, 48, line_height, (actor.xparam(xparam_id)*100).to_i, 2)
- end#def
- # \\ Modified to allow for custom input of size increase.
- def make_font_bigger(size = 8)
- contents.font.size += size if contents.font.size <= 64
- end#def
- # \\ Modified to allow for custom input of size decrease.
- def make_font_smaller(size = 8)
- contents.font.size -= size if contents.font.size >= 16
- end#def
- # \\ Modifies to draw HP with a fixed number of digits(4).
- # \\ Because issues with def group, created a catch for YEA-CoreEngine.
- alias j_catch_yea_draw_actor_hp draw_actor_hp
- def draw_actor_hp(actor, x, y, width = 124)
- if $imported["YEA-CoreEngine"]
- j_catch_yea_draw_actor_hp(actor, x, y)
- else
- c_hp = sprintf("%04d", actor.hp); m_hp = sprintf("%04d", actor.mhp)
- draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
- change_color(system_color)
- draw_text(x, y, 30, line_height, Vocab::hp_a)
- draw_current_and_max_values(x, y, width, c_hp, m_hp,
- hp_color(actor), normal_color)
- end#catch
- end#def
- # \\ Modifies to draw MP with a fixed number of digits(4).
- # \\ Because issues with def group, created a catch for YEA-CoreEngine.
- alias j_catch_yea_draw_actor_mp draw_actor_mp
- def draw_actor_mp(actor, x, y, width = 124)
- if $imported["YEA-CoreEngine"]
- j_catch_yea_draw_actor_mp(actor, x, y)
- else
- c_mp = sprintf("%04d", actor.mp); m_mp = sprintf("%04d", actor.mmp)
- draw_gauge(x, y, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
- change_color(system_color)
- draw_text(x, y, 30, line_height, Vocab::mp_a)
- draw_current_and_max_values(x, y, width, c_mp, m_mp,
- mp_color(actor), normal_color)
- end#catch
- end#def
- end#Window_Base
- class Window_Status < Window_Selectable
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- # Overwrites: Entire status menu.
- # : WARNING! Do not use with other scripts that modify the status menu.
- # \\ Changes the line_height to be 20 instead of 24, to fit all params.
- def item_height; 20; end
- # \\ Draws all the contents of visible text on the status screen.
- def refresh
- contents.clear
- draw_block_header (line_height * 0)
- draw_block_allparams (line_height * 4)
- draw_block_explife (line_height * 0)
- draw_cond_desc (line_height * 14)
- end#def
- # \\ draws the three rows of parameters: base/secondary/xtra, and equips.
- def draw_block_allparams(y = 0)
- draw_b_parameters( 28, y)
- draw_s_parameters(178, y)
- draw_x_parameters(328, y)
- draw_equipments(440, y)
- end#def
- # \\ draws the top section for face/name/class/nickname details.
- def draw_block_header(y)
- draw_actor_face(@actor, 0, y)
- make_font_bigger(4)
- draw_actor_name(@actor, 100, y + line_height * 0)
- make_font_smaller(8)
- draw_actor_class(@actor, 100, y + line_height * 1)
- draw_actor_nickname(@actor, 100, y + line_height * 2)
- make_font_bigger(4)
- draw_actor_level(@actor, 100, y + line_height * 3)
- end#def
- # \\ draws the status-icons/hp-mp/experience details.
- def draw_block_explife(y)
- draw_actor_hp(@actor, 240, y + line_height * 0, 80)
- draw_actor_mp(@actor, 240, y + line_height * 1, 80)
- draw_actor_icons(@actor, 240, y + line_height * 2)
- draw_exp_info(370, y)
- end#def
- def draw_cond_desc(x=12,y)
- if Graphics.height >= 480
- draw_horz_line(y - line_height)
- draw_description(x,y)
- draw_horz_line(y + line_height * 2)
- end#if
- end
- # \\ draws the equipments, may possibly modify in future.
- =begin
- def draw_equipments(x, y)
- @actor.equips.each_with_index do |item, i|
- draw_item_name(item, x, y + line_height * i)
- end#each
- end#def
- =end
- # \\ Overwrites experience drawing to re-adjust and write it cleaner.
- def draw_exp_info(x, y)
- if @actor.max_level?
- s1 = sprintf("%010d", @actor.exp); s2 = "----------";
- else
- s1 = sprintf("%010d", @actor.exp)
- s2 = sprintf("%010d", (@actor.next_level_exp - @actor.exp))
- end
- s_e = sprintf("Exp.: ")#(Vocab::ExpNext, Vocab::level)
- s_n = sprintf("Next: ")#(Vocab::ExpNext, Vocab::ExpTotal)
- change_color(system_color)
- draw_text(x + 0, y + line_height * 0, 180, line_height, s_e)
- draw_text(x + 0, y + line_height * 1, 180, line_height, s_n)
- change_color(normal_color)
- draw_text(x + 64, y + line_height * 0, 180, line_height, s1)
- draw_text(x + 64, y + line_height * 1, 180, line_height, s2)
- end#def
- # \\ Draws a 2px vertical line at the given location.
- def draw_vert_line(x, y)
- # (origin x, origin y, line_width, how tall, color)
- contents.fill_rect(x, y, 2, 200, line_color)
- end#def
- # \\ Draws the base parameters that the database normally modifies.
- def draw_b_parameters(x, y)
- lh = line_height - 4
- make_font_smaller(4)
- 8.times {|i| draw_actor_bparam(@actor, x, y + lh * i, i) }
- make_font_bigger(4)
- end#def
- # \\ Draws the secondary parameters like MCR/PDR/EXR.
- def draw_s_parameters(x, y)
- lh = line_height - 4
- make_font_smaller(4)
- 10.times {|i| draw_actor_sparam(@actor, x, y + lh * i, i) }
- make_font_bigger(4)
- end#def
- # \\ Draws the extra parameters like Hit/crit/evade.
- def draw_x_parameters(x, y)
- lh = line_height - 4
- make_font_smaller(4)
- 10.times {|i| draw_actor_xparam(@actor, x, y + lh * i, i) }
- make_font_bigger(4)
- end#def
- end#Window_Status
- class Window_Parameter_Choice < Window_Selectable
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- # NEW! class used explicity with this script.
- # : Draws the cursor that overlays the 3 columns of parameters.
- # : This grid is what defines what help text is visible in the help window.
- # \\ Handles initialization of the cursor grid for parameters.
- def initialize(x, y)
- super(x, y, 460, 240)
- end#def
- # \\ Defines the grid to be a 30 total cells.
- def item_max; return 30; end
- # \\ Defines the grid to have 3 columns, resulting in 3x10.
- def col_max; return 3; end
- # \\ Defines the height of the cells to be fixed at 20.
- def item_height; 20; end#
- # \\ Draws the rectangles within the grid.
- # \\ Rectangles are fixed at 150 width instead of being dynamically sized.
- def item_rect(index)
- rect = Rect.new
- rect.width = item_width
- rect.height = item_height - 2
- rect.x = index % col_max * 150
- rect.y = index / col_max * item_height + 2
- rect
- end#def
- # \\ Redefines this to prevent scrolling down into the blank space.
- def cursor_down(wrap = false)
- if index == 21
- return
- else
- super(wrap)
- end
- end#def
- # \\ Redefines this to prevent scrolling right into the blank space.
- def cursor_right(wrap = false)
- if index == 26 || index == 23
- select(index == 23 ? 25 : 28)
- else
- super(wrap)
- end
- end#def
- # \\ Redefines this to prevent scrolling left into the blank space.
- def cursor_left(wrap = false)
- if index == 28 || index == 25
- select(index == 25 ? 23 : 26)
- else
- super(wrap)
- end
- end#def
- # \\ Redefines this to assign help text based on the index of the selection.
- def select(index)
- super(index)
- @help_window.set_text(Vocab.paramInfo(@index))
- end#def
- end#Window_Parameter_Choice
- class Scene_Status < Scene_MenuBase
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- # Overwrites: Scene_Status
- # : Modified to handle the new window and methods created/modified above.
- # : Modified to allow for parameter help descriptions.
- # \\ Handles the startup of the status screen when loaded.
- def start
- super
- create_status_window
- create_help_window
- create_select_window
- end#def
- # \\ Handles the handling of input.
- def create_status_window
- @status_window = Window_Status.new(@actor)
- @status_window.actor = @actor
- @status_window.set_handler(:cancel, method(:return_scene))
- @status_window.set_handler(:pagedown, method(:next_actor))
- @status_window.set_handler(:pageup, method(:prev_actor))
- end#def
- # \\ Handles the help window and its contents.
- def create_help_window
- @help_window = Window_Help.new
- @help_window.viewport = @viewport
- @help_window.opacity = 0
- if Graphics.height >= 480
- @help_window.y = Graphics.height - 70
- else
- @help_window.y = Graphics.height - 65
- end#if
- end#def
- # \\ Generates the new window that handles the cursor movement.
- # \\ The cursor index is what defines the help text viewed beneath params.
- def create_select_window
- @select_window = Window_Parameter_Choice.new(0, 96)
- @select_window.opacity = 0
- @select_window.active = true
- @select_window.help_window = @help_window
- @select_window.select(0) # Put cursor to MaxHP and draw help text for it
- end#def
- # \\ Adds in the refresh for the help window text.
- def on_actor_change
- @status_window.actor = @actor
- @status_window.activate
- @help_window.refresh
- end#def
- end#Scene_Status
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement