#==============================================================================
# Breath of Fire Enemy window
# By Noobitron
# Slanted Bars by Sephiroth Spawn.
#
# Edited by: Night_Runner
# Date: 17/Sept/09
#
# Script for: Bigace
# Designed to: Edited to be compatable with Enu and Atoa's Sideview Battle
# System Version 2.1xp, import this scrips at the end of the Additional
# Scripts seciton.
# The window can be moved around using the module just below.
#==============================================================================
module Night_Runner
Window_X = 500
Window_Y = 0
end
class Window_Base
# define enemy name
def draw_enemy_name(enemy, x, y)
self.contents.font.color = normal_color
self.contents.font.name = "Verdana"
self.contents.font.size = 16
self.contents.draw_text(x, y, 120, 25, enemy.name)
end
#--------------------------------------------------------------------------
# * Draw Slant Bar(by SephirothSpawn)
#--------------------------------------------------------------------------
def draw_slant_bar(x, y, min, max, width = 152, height = 4,
bar_color = Color.new(150, 0, 0, 255), end_color = Color.new(255, 255, 60, 255))
# Draw Border
for i in 0..height
self.contents.fill_rect(x + i, y + height - i, width + 1, 1, Color.new(50, 50, 50, 255))
end
# Draw Background
for i in 1..(height - 1)
r = 100 * (height - i) / height + 0 * i / height
g = 100 * (height - i) / height + 0 * i / height
b = 100 * (height - i) / height + 0 * i / height
a = 255 * (height - i) / height + 255 * i / height
self.contents.fill_rect(x + i, y + height - i, width, 1, Color.new(r, b, g, a))
end
# Draws Bar
for i in 1..( (min / max.to_f) * width - 1)
for j in 1..(height - 1)
r = bar_color.red * (width - i) / width + end_color.red * i / width
g = bar_color.green * (width - i) / width + end_color.green * i / width
b = bar_color.blue * (width - i) / width + end_color.blue * i / width
a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width
self.contents.fill_rect(x + i + j, y + height - j, 1, 1, Color.new(r, g, b, a))
end
end
end
end
#ENEMY HP WINDOW
class Window_EnemyHP < Window_Base
def initialize
super(Night_Runner::Window_X, Night_Runner::Window_Y, 140, 240)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 100
refresh
end
#REFRESH
def refresh
self.contents.clear
for i in 0...$game_troop.enemies.size
enemy = $game_troop.enemies[ i]
x = 0
y = i * 25
draw_slant_bar(x, y + 19, enemy.hp, enemy.maxhp, width = 100, height = 6, bar_color = Color.new(150, 0, 0, 255), end_color = Color.new(255, 255, 60, 255))
draw_slant_bar(x, y + 24, enemy.sp, enemy.maxsp, width = 100, height = 6, bar_color = Color.new(150, 0, 150, 255), end_color = Color.new(0, 0, 255, 255))
draw_enemy_name(enemy, x, y)
end
end
end
class Scene_Battle
alias nr_start start
alias nr_terminate terminate
alias queed_update update
alias queed_update_phase5 update_phase5
alias queed_update_phase4_step1 update_phase4_step1
alias queed_update_phase4_step5 update_phase4_step5
alias queed_start_skill_select start_skill_select
alias queed_end_skill_select end_skill_select
alias queed_start_item_select start_item_select
alias queed_end_item_select end_item_select
def start
@enemy_window = Window_EnemyHP.new
@enemy_window.z = 255
nr_start
end
def terminate
@enemy_window.dispose
nr_terminate
end
def update
@enemy_window.update
queed_update
end
def start_skill_select
queed_start_skill_select
@enemy_window.visible = false
end
def end_skill_select
queed_end_skill_select
@enemy_window.visible = true
end
def start_item_select
queed_start_item_select
@enemy_window.visible = false
end
def end_item_select
queed_end_item_select
@enemy_window.visible = true
end
def update_phase5
# If wait count is larger than 0
if @phase5_wait_count > 0
# Decrease wait count
@phase5_wait_count -= 1
# If wait count reaches 0
if @phase5_wait_count == 0
@enemy_window.visible = false
# Show result window
@result_window.visible = true
# Clear main phase flag
$game_temp.battle_main_phase = false
# Refresh status window
@status_window.refresh
@enemy_window.refresh
end
return
end
queed_update_phase5
end
def update_phase4_step1
queed_update_phase4_step1
@enemy_window.refresh
end
def update_phase4_step5
# Hide help window
@help_window.visible = false
# Refresh status window
@status_window.refresh
@enemy_window.refresh
queed_update_phase4_step5
end
end