=begin
____________________________
| J::EQUAP bars! |
| Author: Jragyn |
|____________________________|
This script is more like a plug-in for the EQUAP system.
It displays a bar that measures the AP vs. MAXap for any given skill.
Of course...
This script does require TONs to work.
And the Blizzart BARS to be enabled.
And the EQUAP System to be enabled and setup.
Credit to ForeverZer0 for being a Ruby Reference Bible for dummies :)
=end
#v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^
#::Aliased/Overwrite [Window_Skill] ----- draw_item
#v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^
#========================#
# Set the wordage for a #
# learned skill here: #
module J #
LEARNT = '-Master-' #
#=======================================#
# Use a new color scheme #
# for the EQUAP bars? #
NEW_SCHEME = true #
# only need to set if NEW_SCHEME = true #
SCHEME_1 = Color.new( 96, 96, 96,192) # (just a darkish grey)
SCHEME_2 = Color.new(192,192,192,192) # (just a lighter grey)
#=======================================#
# Use a different $bar_style #
# for the EQUAP bars? #
NEW_BARS = true #
# only need to set if NEW_BARS = true #
J_STYLE = 2 # ( 0~6 ) #
#=======================================#
end #
#===#
class Window_Skill
alias j_draw_item_equap_bar draw_item
def draw_item(index, w=148)
#checks to verify both Blizzart BARS and EQUAP are enabled.
if $game_system.BARS && TONS_OF_ADDONS::EQUAP_SKILLS
skill = @data[index]
if @actor.skill_can_use?(skill.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
rate = 0
if BlizzCFG.maxap(skill.id) > 0
rate = @actor.ap(skill.id).to_f / BlizzCFG.maxap(skill.id)
end#if
#uses set colors in J::~~ if set to true, otherwise uses defaults.
if J::NEW_SCHEME
color1 = J::SCHEME_1
color2 = J::SCHEME_2
else
#color determination, based on Blizzard's draw_hp_bar(whatever) colorscheme.
if rate > 0.6
color1 = Color.new(80 - 150 * (rate-0.6), 80, 50 * (rate-0.6), 192)
color2 = Color.new(240 - 450 * (rate-0.6), 240, 150 * (rate-0.6), 192)
elsif rate > 0.2 && rate <= 0.6
color1 = Color.new(80, 200 * (rate-0.2), 0, 192)
color2 = Color.new(240, 600 * (rate-0.2), 0, 192)
elsif rate <= 0.2
color1 = Color.new(400 * rate, 0, 0, 192)
color2 = Color.new(240, 0, 0, 192)
end#if
end#ifJscheme
color3 = Color.new(0, 80, 0, 192)
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(skill.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
#===============================================================================
# The deciding part as to whether or not to draw the bars and/or ap_infos.
if BlizzCFG.maxap(skill.id) > 0 && @actor.ap(skill.id) == BlizzCFG.maxap(skill.id)
self.contents.draw_text(x + 180, y, 60, 32, J::LEARNT, 2)
elsif BlizzCFG.maxap(skill.id) > 0
ap_info = "[#{@actor.ap(skill.id)}/#{BlizzCFG.maxap(skill.id)}]"
if J::NEW_BARS
original_style = $game_system.bar_style
J::J_STYLE > 6 ? $game_system.bar_style = 2 : $game_system.bar_style = J::J_STYLE
self.contents.gradient_bar(x+24, y, w, color1, color2, color3, rate)
$game_system.bar_style = original_style
else
self.contents.gradient_bar(x+24, y, w, color1, color2, color3, rate)
end#if_newbars
self.contents.draw_text(x+180, y, 64, 32, ap_info, 0)
end#if
#===============================================================================
self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
else
j_draw_item_equap_bar(index)
end#bars&equap
end#def
end#class