RTAB BattleStatus Blizz-Art Hack
Authors: Blizzard
Version: 1.4b
Type: RTAB plugin
Key Term: Battle Add-on
IntroductionThis script will hack into RTAB's code and mod the battle status display and make it lag MUCH less.
This work is protected by the following license:
Creative Commons - Attribution-NonCommercial-ShareAlike 3.0 Unported
( http://creativecommons.org/licenses/by-nc-sa/3.0/ )
You are free:
to Share - to copy, distribute and transmit the work
to Remix - to adapt the work
Under the following conditions:
Attribution. You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).
Noncommercial. You may not use this work for commercial purposes.
Share alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.
- For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to this web page.
- Any of the above conditions can be waived if you get permission from the copyright holder.
- Nothing in this license impairs or restricts the author's moral rights.
Features- uses "Super Lagless Bar" code
- overrides SephirothSpawn's slant bars and DerVVulfman's BattleStatus mod
- possiblity to use original bar style from "Gradient Bar Styler"
- can mod the text in the status window without affecting the rest of the game
- fixes the command window position, size and opacity
- the currently selected actor has his AT Bar color changed to red instead of yellow
- AT Bar is blinking when at 100%
- overrides the stupid refresh interruption when somebody is attacking so the bars keep blinking no matter what
- adds HP/SP/EXP bars as well
- supports any number of party members
v1.1b- blinking bars now optional
- highly optimized
v1.2b- displays now a red bar for the selected actor even if using non-blinking bars
v1.3b- fixed glitch where bar would not refresh upon actor action and would stay full in some cases
v1.4b- now supporting any number of party members
Screenshots
DemoN/A
ScriptJust make a new script above main and paste this code into it.
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# RTAB BattleStatus Blizz-Art Hack by Blizzard
# Version: 1.4b
# Date: 4.7.2007
# Date v1.1b: 17.3.2008
# Date v1.2b: 17.3.2008
# Date v1.3b: 19.3.2008
# Date v1.4b: 13.7.2008
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# This work is protected by the following license:
# #----------------------------------------------------------------------------
# #
# # Creative Commons - Attribution-NonCommercial-ShareAlike 3.0 Unported
# # ( http://creativecommons.org/licenses/by-nc-sa/3.0/ )
# #
# # You are free:
# #
# # to Share - to copy, distribute and transmit the work
# # to Remix - to adapt the work
# #
# # Under the following conditions:
# #
# # Attribution. You must attribute the work in the manner specified by the
# # author or licensor (but not in any way that suggests that they endorse you
# # or your use of the work).
# #
# # Noncommercial. You may not use this work for commercial purposes.
# #
# # Share alike. If you alter, transform, or build upon this work, you may
# # distribute the resulting work only under the same or similar license to
# # this one.
# #
# # - For any reuse or distribution, you must make clear to others the license
# # terms of this work. The best way to do this is with a link to this web
# # page.
# #
# # - Any of the above conditions can be waived if you get permission from the
# # copyright holder.
# #
# # - Nothing in this license impairs or restricts the author's moral rights.
# #
# #----------------------------------------------------------------------------
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# Explanation:
#
# This script will hack into RTAB's code and mod the battle status display
# and make it lag MUCH less.
#
#
# Features:
#
# - uses "Super Lagless Bar" code
# - overrides SephirothSpawn's slant bars and DerVVulfman's BattleStatus mod
# - possiblity to use original bar style from "Gradient Bar Styler"
# - can mod the text in the status window without affecting the rest of the
# game
# - fixes the command window position, size and opacity
# - the currently selected actor has his AT Bar color changed to red instead
# of yellow
# - AT Bar is blinking when at 100%
# - overrides the stupid refresh interruption when somebody is attacking so
# the bars keep blinking no matter what
# - adds HP/SP/EXP bars as well
# - supports any number of party members
#
# new in 1.1b:
# - blinking bars now optional
# - highly optimized
#
# new in 1.2b:
# - displays now a red bar for the selected actor even if using non-blinking
# bars
#
# new in 1.3b:
# - fixed glitch where bar would not refresh upon actor action and would stay
# full in some cases
#
# new in 1.4b:
# - now supporting any number of party members
#
#
# Instructions:
#
# To apply this code, put it UNDER ALL of the RTAB codes.
#
#
# If you have any problems, please report them here:
# http://www.chaosproject.co.nr
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# 0 - normal, 1 - shadowed, 2 - outlined
# Tons of Add-ons will automatically shadow it if you are using the Shaded text
# add-on, so set it to 0 in that case
TEXTTYPE = 1
# how many party members you have
MAX_PARTY = 4
# color of shadow/outline
BACK_COLOR = Color.new(0, 0, 0, 192)
# true changes the bar display to the original gradient style
ORIGINAL = false
# AT Bar text (note that too long strings WILL cause lag)
ATB_TEXT = 'ATB'
# AT Bar should blink when at 100%
BLINKING_ATB = false
#==============================================================================
# Bitmap
#==============================================================================
class Bitmap
# RTAB updates the AT bar constantly. Without an extremely optimized code
# imense lag would occur. The code has a complexity of just n (instead of n^2
# like usual bar scripts) and instead of coloring each pixel, it treats the
# slant bar like a normal gradient bar but creates an optical illusion of a
# totally slanted bar.
def super_lagless_bar(x, y, w, color1, color2, color3, rate)
offset = 8
height = 16
x += offset
y += height
(0...offset+3).each {|i| fill_rect(x-i, y+i-2, w+3, 1, Color.new(0, 0, 0))}
if ORIGINAL
(0...offset+1).each {|i| fill_rect(x-i, y+i-1, w+1, 1, Color.new(255, 255, 255))}
end
(0...offset).each {|i|
red = color3.red * i / offset
green = color3.green * i / offset
blue = color3.blue * i / offset
fill_rect(x-i+1, y+i-1, w, 1, Color.new(red, green, blue))}
if (w*rate).to_i >= offset
(0...(w*rate).to_i+offset).each {|i|
red = color1.red + (color2.red-color1.red)*i / ((w+offset)*rate)
green = color1.green + (color2.green-color1.green)*i / ((w+offset)*rate)
blue = color1.blue + (color2.blue-color1.blue)*i / ((w+offset)*rate)
oy = i < offset ? offset-i : 0
off = i < offset ? i : i > w*rate ? (w*rate).to_i+offset-i : offset
fill_rect(x+i-offset+1, y+oy-1, 1, off, Color.new(red, green, blue))}
else
(0...(w * rate).to_i).each {|i| (0...offset).each {|j|
red = color1.red + (color2.red-color1.red)*i / (w*rate)
green = color1.green + (color2.green-color1.green)*i / (w*rate)
blue = color1.blue + (color2.blue-color1.blue)*i / (w*rate)
set_pixel(x+i-j+1, y+j-1, Color.new(red, green, blue))}}
end
end
end
#==============================================================================
# Window_Base
#==============================================================================
class Window_Base
# byebye, Seph's slutty slant bars 
def draw_slant_bar(a, b, c, d, e = 0, f = 0, g = nil, h = nil)
end
# adds bar wherever HP are displayed
alias draw_actor_hp_blizzart_gradient_later draw_actor_hp
def draw_actor_hp(actor, x, y, w = 148)
w -= 12
rate = actor.hp.to_f / actor.maxhp
if rate > 0.6
color1 = Color.new(80 - 150 * (rate-0.6), 80, 50 * (rate-0.6))
color2 = Color.new(240 - 450 * (rate-0.6), 240, 150 * (rate-0.6))
elsif rate > 0.2 and rate <= 0.6
color1 = Color.new(80, 200 * (rate-0.2), 0)
color2 = Color.new(240, 600 * (rate-0.2), 0)
elsif rate <= 0.2
color1 = Color.new(400 * rate, 0, 0)
color2 = Color.new(240, 0, 0)
end
color3 = Color.new(0, 80, 0)
self.contents.super_lagless_bar(x, y, w, color1, color2, color3, rate)
draw_actor_hp_blizzart_gradient_later(actor, x, y)
end
# adds bar wherever SP are displayed
alias draw_actor_sp_blizzart_gradient_later draw_actor_sp
def draw_actor_sp(actor, x, y, w = 148)
w -= 12
rate = (actor.maxsp > 0 ? actor.sp.to_f / actor.maxsp : 0)
if rate > 0.4
color1 = Color.new(60 - 66 * (rate-0.4), 20, 80)
color2 = Color.new(180 - 200 * (rate-0.4), 60, 240)
elsif rate <= 0.4
color1 = Color.new(20 + 100 * rate, 50 * rate, 26 + 166 * rate)
color2 = Color.new(60 + 300 * rate, 150 * rate, 80 + 400 * rate)
end
color3 = Color.new(0, 0, 80, 192)
self.contents.super_lagless_bar(x, y, w, color1, color2, color3, rate)
draw_actor_sp_blizzart_gradient_later(actor, x, y)
end
# adds bar wherever EXP are displayed
alias draw_actor_exp_blizzart_gradient_later draw_actor_exp
def draw_actor_exp(actor, x, y, w = 180)
rate = (actor.next_exp != 0 ? actor.now_exp.to_f / actor.next_exp : 1)
if rate < 0.5
color1 = Color.new(20 * rate, 60, 80)
color2 = Color.new(60 * rate, 180, 240)
elsif rate >= 0.5
color1 = Color.new(20 + 120 * (rate-0.5), 60 + 40 * (rate-0.5), 80)
color2 = Color.new(60 + 360 * (rate-0.5), 180 + 120 * (rate-0.5), 240)
end
color3 = Color.new(80, 80, 80)
self.contents.super_lagless_bar(x, y, w, color1, color2, color3, rate)
draw_actor_exp_blizzart_gradient_later(actor, x, y)
end
end
#==============================================================================
# Window_BattleStatus
#==============================================================================
class Window_BattleStatus
# initialization
def initialize
h = MAX_PARTY * 32 + 32
super(160, 480-h, 480, h)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.bold = true
self.contents.font.name = "Arial"
self.contents.font.size = 22
@level_up_flags, @glow_flags = [], []
MAX_PARTY.times {@level_up_flags.push(false); @glow_flags.push(false)}
@name, @hp, @sp, @atp, @actors = [], [], [], [], []
(0...$game_party.actors.size).each {|i| norm_refresh(i)}
end
# necessary to override RTAB method.
def refresh(num = 0)
norm_refresh(num-1) if num != 0
end
# necessary to override RTAB method.
def at_refresh(num = 0)
xat_refresh(num-1) if num != 0
end
# refreshes the whole status for actor with index i
def norm_refresh(i)
draw_name($game_party.actors[i], i) if @name[i] != $game_party.actors[i].name
draw_hp($game_party.actors[i], i) if @hp[i] != $game_party.actors[i].hp
draw_sp($game_party.actors[i], i) if @sp[i] != $game_party.actors[i].sp
@name[i] = $game_party.actors[i].name
@hp[i] = $game_party.actors[i].hp
@sp[i] = $game_party.actors[i].sp
xat_refresh(i)
end
# refreshes the AT Bar for actor with index i
def xat_refresh(i)
if BLINKING_ATB
if @atp[i] == $game_party.actors[i].atp &&
$game_party.actors[i].atp != 100
return
end
elsif (@atp[i] == $game_party.actors[i].atp ||
$game_party.actors[i].atp == 100) &&
@actors[i] == ($game_party.actors[i] == $scene.active_actor)
return
end
self.contents.font.size -= 4
self.contents.font.italic = true
self.contents.fill_rect(349, i*32, 98, 32, Color.new(0, 0, 0, 0))
draw_actor_atb($game_party.actors[i], 349, i*32, 84)
draw_text_special(358, -1+i*32, 96, 32, ATB_TEXT)
self.contents.font.size += 4
self.contents.font.italic = false
@atp[i] = $game_party.actors[i].atp
@actors[i] = ($game_party.actors[i] == $scene.active_actor)
end
# draws name
def draw_name(actor, i)
self.contents.fill_rect(0, i*32, 90, 40, Color.new(0, 0, 0, 0))
draw_text_special(4, i*32, 84, 32, actor.name)
end
# draws HP and bar
def draw_hp(actor, i)
self.contents.fill_rect(90, i*32, 140, 40, Color.new(0, 0, 0, 0))
rate = actor.hp.to_f / actor.maxhp
if rate > 0.6
color1 = Color.new(80 - 150 * (rate-0.6), 80, 50 * (rate-0.6))
color2 = Color.new(240 - 450 * (rate-0.6), 240, 150 * (rate-0.6))
elsif rate > 0.2 && rate <= 0.6
color1 = Color.new(80, 200 * (rate-0.2), 0)
color2 = Color.new(240, 600 * (rate-0.2), 0)
elsif rate <= 0.2
color1 = Color.new(400 * rate, 0, 0)
color2 = Color.new(240, 0, 0)
end
color3 = Color.new(0, 80, 0)
self.contents.super_lagless_bar(124, i*32, 86, color1, color2, color3, rate)
self.contents.font.italic = true
self.contents.font.color = system_color
draw_text_special(94, i*32, 100, 32, $data_system.words.hp)
self.contents.font.italic = false
self.contents.font.size -= 4
self.contents.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
draw_text_special(86, i*32, 80, 32, actor.hp.to_s, 2)
self.contents.font.color = normal_color
draw_text_special(74, i*32, 100, 32, "/", 2)
draw_text_special(178, i*32, 80, 32, actor.maxhp.to_s)
self.contents.font.size += 4
end
# draws SP and bar
def draw_sp(actor, i)
self.contents.fill_rect(230, i*32, 129, 40, Color.new(0, 0, 0, 0))
rate = (actor.maxsp > 0 ? actor.sp.to_f / actor.maxsp : 0)
if rate > 0.4
color1 = Color.new(60 - 66 * (rate-0.4), 20, 80)
color2 = Color.new(180 - 200 * (rate-0.4), 60, 240)
elsif rate <= 0.4
color1 = Color.new(20 + 100 * rate, 50 * rate, 26 + 166 * rate)
color2 = Color.new(60 + 300 * rate, 150 * rate, 80 + 400 * rate)
end
color3 = Color.new(0, 0, 80, 192)
self.contents.super_lagless_bar(260, i*32, 72, color1, color2, color3, rate)
self.contents.font.italic = true
self.contents.font.color = system_color
draw_text_special(230, i*32, 100, 32, $data_system.words.sp)
self.contents.font.italic = false
self.contents.font.size -= 4
self.contents.font.color = actor.sp == 0 ? knockout_color :
actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
draw_text_special(216, i*32, 80, 32, actor.sp.to_s, 2)
self.contents.font.color = normal_color
draw_text_special(204, i*32, 100, 32, "/", 2)
draw_text_special(308, i*32, 80, 32, actor.maxsp.to_s)
self.contents.font.size += 4
end
# draws the AT bar
def draw_actor_atb(actor, x, y, w = 120)
if actor.rtp != 0
rate = 1 - actor.rt.to_f / actor.rtp
color1 = Color.new(0, 48, 64)
color2 = Color.new(0, 192, 255)
else
rate = actor.atp.to_f / 100
if BLINKING_ATB
frame = Graphics.frame_count % Graphics.frame_rate
glow = (frame < 6 ? frame / 5.0 : frame < 12 ? (11-frame) / 5.0 : 0)
if rate == 1
@glow_flags[actor.index] = false if glow == 0
else
@glow_flags[actor.index] = (glow != 0)
end
glow = 0 if @glow_flags[actor.index]
if actor == $scene.active_actor
color1 = Color.new(64 + glow*191, glow*255, glow*255)
color2 = Color.new(255, glow*255, glow*255)
else
color1 = Color.new(64 + glow*191, 64 + glow*191, glow*255)
color2 = Color.new(255, 255, glow*255)
end
elsif actor == $scene.active_actor
color1 = Color.new(64, 0, 0)
color2 = Color.new(255, 0, 0)
else
color1 = Color.new(64, 64, 0)
color2 = Color.new(255, 255, 0)
end
end
color3 = Color.new(80, 80, 80)
self.contents.super_lagless_bar(x, y, w, color1, color2, color3, rate)
end
# mods the status window text
def draw_text_special(x2, y2, w2 = 0, h2 = 0, text2 = "", a2 = 0)
if x2.is_a?(Rect)
x, y, w, h, text, a = x2.x, x2.y, x2.width, x2.height, y2, w2
else
x, y, w, h, text, a = x2, y2, w2, h2, text2, a2
end
save_color = self.contents.font.color.clone
self.contents.font.color = BACK_COLOR
if TEXTTYPE > 0
self.contents.draw_text(x+1, y+1, w, h, text, a)
if TEXTTYPE == 2
self.contents.draw_text(x-1, y+1, w, h, text, a)
self.contents.draw_text(x+1, y-1, w, h, text, a)
self.contents.draw_text(x-1, y-1, w, h, text, a)
end
end
self.contents.font.color = save_color
self.contents.draw_text(x, y, w, h, text, a)
end
# pointless, but necessary to override RTAB method
def update
super
end
# pointless, but necessary to override RTAB method
def dispose
super
end
end
#==============================================================================
# Scene_Battle
#==============================================================================
class Scene_Battle
attr_reader :active_actor
# fixes the command window position, size and opacity
alias ph3_scw_rtab_battlestatus_hack_later phase3_setup_command_window
def phase3_setup_command_window
ph3_scw_rtab_battlestatus_hack_later
@actor_command_window.height = @status_window.height
@actor_command_window.x = 0
@actor_command_window.y = 480 - @actor_command_window.height
@actor_command_window.back_opacity = @actor_command_window.opacity = 255
end
# overrides the stupid refresh interruption when somebody is attacking
alias upd_ph0_rtab_battlestatus_hack_later update_phase0
def update_phase0
(0...$game_party.actors.size).each {|i| @status_window.xat_refresh(i)}
upd_ph0_rtab_battlestatus_hack_later
end
end
InstructionsInside the script in the first comment.
CompatibilityRequires RTAB to work.
Credits and Thanks
Author's NotesTo apply this code, put it UNDER ALL of the RTAB codes. This script was done on request long time ago and is not fully supported by me as my other scripts are.
If you find any bugs, please report them here:
http://forum.chaos-project.comThat's it! N-Joy! =D