#==============================================================================
# ADD-ON - LAYOUT
#==============================================================================
# By Moghunter
#==============================================================================
class React < Window_Base
attr_reader :index
attr_reader :help_window
def initialize(x, y, width, height)
super(x, y, width, height)
@item_max = 1
@row_max = 1
@index = -1
end
def index=(index)
@index = index
refresh
if self.active and @help_window != nil
update_help
end
update_cursor_rect
end
def row_max
return (@item_max + @column_max - 1) / @column_max
end
def top_row
return self.oy / 32
end
def top_row=(row)
if row < 0
row = 0
end
if row > row_max - 1
row = row_max - 1
end
self.oy = row * 32
end
def page_row_max
return (self.height - 32) / 32
end
def page_item_max
return page_row_max * @column_max
end
def help_window=(help_window)
@help_window = help_window
if self.active and @help_window != nil
update_help
end
end
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
return
end
row = @index / @column_max
if row < self.top_row
self.top_row = row
end
if row > self.top_row + (self.page_row_max - 1)
self.top_row = row - (self.page_row_max - 1)
end
cursor_width = 0
x = @index / @column_max * 48 - self.oy
y = 110 + @index % @column_max * (cursor_width + 100)
self.cursor_rect.set(x, y, cursor_width, 32)
t = @index / @column_max * 28 - self.oy
end
def update
super
if self.active and @item_max > 0 and @index >= 0
if Input.repeat?(Input::C) or Input.repeat?(Input::B)
refresh
end
if Input.repeat?(Input::RIGHT)
if (@column_max == 1 and Input.trigger?(Input::RIGHT)) or
@index < @item_max - @row_max
$game_system.se_play($data_system.cursor_se)
@index = (@index + @row_max) % @item_max
refresh
end
end
if Input.repeat?(Input::LEFT)
if (@column_max == 1 and Input.trigger?(Input::LEFT)) or
@index >= @row_max
$game_system.se_play($data_system.cursor_se)
@index = (@index - @row_max + @item_max) % @item_max
refresh
end
end
if Input.repeat?(Input::RIGHT)
if @column_max >= 2 and @index < @item_max - 1
$game_system.se_play($data_system.cursor_se)
@index += 1
refresh
end
end
if Input.repeat?(Input::LEFT)
if @column_max >= 2 and @index > 0
$game_system.se_play($data_system.cursor_se)
@index -= 1
refresh
end
end
if Input.repeat?(Input::R)
if self.top_row + (self.page_row_max - 1) < (self.row_max - 1)
$game_system.se_play($data_system.cursor_se)
@index = [@index + self.page_item_max, @item_max - 1].min
refresh
self.top_row += self.page_row_max
end
end
if Input.repeat?(Input::L)
if self.top_row > 0
$game_system.se_play($data_system.cursor_se)
@index = [@index - self.page_item_max, 0].max
refresh
self.top_row -= self.page_row_max
end
end
end
if self.active and @help_window != nil
update_help
end
update_cursor_rect
end
end
class Window_Base < Window
def draw_face(actor,x,y)
face = RPG::Cache.picture(actor.name + "_face")
cw = face.width
ch = face.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y - ch, face, src_rect)
end
def draw_face2(actor,x,y)
face = RPG::Cache.picture(actor.name + "_face2")
cw = face.width
ch = face.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y - ch, face, src_rect)
end
def draw_lay(actor,x,y)
layout = RPG::Cache.picture(actor.name + "_lay")
cw = layout.width
ch = layout.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y - ch, layout, src_rect)
end
def draw_hp(actor, x, y, width = 144)
back = RPG::Cache.picture("BAR0")
cw = back.width
ch = back.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65, y - ch + 30, back, src_rect)
meter = RPG::Cache.picture("HP_BAR")
cw = meter.width * actor.hp / actor.maxhp
ch = meter.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65, y - ch + 30, meter, src_rect)
text = RPG::Cache.picture("HP_T")
cw = text.width
ch = text.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 60, y - ch + 15, text, src_rect)
self.contents.font.color = system_color
if width - 32 >= 108
hp_x = x + width - 108
flag = true
elsif width - 32 >= 48
hp_x = x + width - 48
flag = false
end
self.contents.font.color = Color.new(250,255,255,255)
self.contents.draw_text(hp_x + 20, y - 8, 48, 32, actor.hp.to_s, 2)
end
def draw_hp2(actor, x, y, width = 144)
back = RPG::Cache.picture("BAR0")
cw = back.width
ch = back.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65, y - ch + 25, back, src_rect)
meter = RPG::Cache.picture("HP_BAR")
cw = meter.width * actor.hp / actor.maxhp
ch = meter.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65, y - ch + 25, meter, src_rect)
text = RPG::Cache.picture("HP_T")
cw = text.width
ch = text.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 33, y - ch + 20, text, src_rect)
self.contents.font.color = system_color
if width - 32 >= 108
hp_x = x + width - 108
flag = true
elsif width - 32 >= 48
hp_x = x + width - 48
flag = false
end
self.contents.font.color = Color.new(250,255,255,255)
self.contents.sfont = SFont.new("Arial_Battle")
self.contents.draw_text(hp_x - 21, y - 4, 12, 32, "HP", 1)
self.contents.draw_text(hp_x - 33, y - 4, 48, 32, actor.hp.to_s, 2)
self.contents.font.color = normal_color
self.contents.sfont = SFont.new("Arial_Battle")
self.contents.draw_text(hp_x + 15, y - 4, 12, 32, "/", 1)
self.contents.draw_text(hp_x + 27, y - 4, 48, 32, actor.maxhp.to_s)
end
def draw_sp(actor, x, y, width = 144)
back = RPG::Cache.picture("BAR0")
cw = back.width
ch = back.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65, y - ch + 30, back, src_rect)
meter = RPG::Cache.picture("SP_BAR")
cw = meter.width * actor.sp / actor.maxsp
ch = meter.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65, y - ch + 30, meter, src_rect)
text = RPG::Cache.picture("SP_T")
cw = text.width
ch = text.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 60, y - ch + 15, text, src_rect)
self.contents.font.color = system_color
if width - 32 >= 108
sp_x = x + width - 108
flag = true
elsif width - 32 >= 48
sp_x = x + width - 48
flag = false
end
self.contents.font.color = Color.new(250,255,255,255)
self.contents.draw_text(sp_x + 20, y - 8, 48, 32, actor.sp.to_s, 2)
end
def draw_sp2(actor, x, y, width = 144)
back = RPG::Cache.picture("BAR0")
cw = back.width
ch = back.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65, y - ch + 25, back, src_rect)
meter = RPG::Cache.picture("SP_BAR")
cw = meter.width * actor.sp / actor.maxsp
ch = meter.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65, y - ch + 25, meter, src_rect)
text = RPG::Cache.picture("SP_T")
cw = text.width
ch = text.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 33, y - ch + 20, text, src_rect)
self.contents.font.color = system_color
if width - 32 >= 108
sp_x = x + width - 108
flag = true
elsif width - 32 >= 48
sp_x = x + width - 48
flag = false
end
self.contents.font.color = Color.new(250,255,255,255)
self.contents.sfont = SFont.new("Arial_Battle")
self.contents.draw_text(sp_x - 48, y - 4, 12, 32, "EP", 1)
self.contents.draw_text(sp_x - 60, y - 4, 48, 32, actor.sp.to_s, 2)
self.contents.font.color = normal_color
self.contents.sfont = SFont.new("Arial_Battle")
self.contents.draw_text(sp_x - 12, y - 4, 12, 32, "/", 1)
self.contents.draw_text(sp_x, y - 4, 48, 32, actor.maxsp.to_s)
end
def draw_name(actor, x, y)
self.contents.font.color = Color.new(238,46,218,255)
self.contents.sfont = SFont.new("Arial_Battle")
self.contents.draw_text(x , y, 100, 40, actor.name,15) #self.contents.draw_text(x , y, 70, 40, actor.name,1)
end
def draw_commando(x,y)
com = RPG::Cache.picture("commando")
cw = com.width
ch = com.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y - ch, com, src_rect)
end
def draw_level(actor, x, y)
self.contents.font.color = Color.new(238,46,218,255)
self.contents.draw_text(x + 32, y, 20, 20, actor.level.to_s, 1)
end
def draw_com(actor, x, y)
action = RPG::Cache.picture(actor.name + "_com")
cw = action.width
ch = action.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y - ch, action, src_rect)
end
end
def draw_select(x,y)
com = RPG::Cache.picture("select")
cw = com.width
ch = com.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y - ch, com, src_rect)
endreturn if actor.nil?#==============================================================================
# ADD-ON - LAYOUT
#==============================================================================
# By Moghunter
#==============================================================================
class Window_BattleStatus < Window_Base
def initialize
super(-20, 330, 680, 180)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Georgia"
self.contents.font.size = 18
self.contents.font.bold = true
self.opacity = 0
@level_up_flags = [false, false, false, false]
refresh
end
def dispose
super
end
def level_up(actor_index)
@level_up_flags[actor_index] = true
end
def refresh
self.contents.clear
self.contents.font.size = 18
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
if $game_switches[5] == true
actor = $game_party.actors[i]
actor_x = i * 160 + 12
actor_y = i * 32
draw_face2(actor,355 ,actor_y + 38)
draw_hp2(actor, 360 , actor_y + 5, 120)
draw_sp2(actor, 480, actor_y + 5, 120)
if @level_up_flags[i]
self.contents.font.color = normal_color
self.contents.draw_text(actor, actor_x + 65, 80, 32, "LEVEL UP!")
else
self.contents.font.size = 12
draw_actor_state(actor, 410, actor_y + 15)
self.contents.font.size = 18
end
else
actor = $game_party.actors[i]
actor_x = i * 160 + 12
draw_lay(actor,actor_x - 5,110)
draw_face(actor,actor_x,100)
draw_name(actor, actor_x, 0)
draw_hp(actor, actor_x, 32, 120)
draw_sp(actor, actor_x, 64, 120)
if @level_up_flags[i]
self.contents.font.color = normal_color
self.contents.draw_text(actor, actor_x + 65, 80, 32, "LEVEL UP!")
else
self.contents.font.size = 12
draw_actor_state(actor, actor_x + 70, 80)
self.contents.font.size = 18
end
end
end
end
def update
super
end
end#==============================================================================
# ADD-ON - LAYOUT
#==============================================================================
# By Moghunter
#==============================================================================
class Window_BattleStatus < Window_Base
def initialize
super(-40, 310, 700, 200)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Georgia"
self.contents.font.size = 18
self.contents.font.bold = true
self.opacity = 0
@level_up_flags = [false, false, false, false]
refresh
end
def dispose
super
end
def level_up(actor_index)
@level_up_flags[actor_index] = true
end
def refresh
self.contents.clear
self.contents.font.size = 18
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
if $game_switches[5] == true
actor = $game_party.actors[i]
actor_x = i * 180 + 52
actor_y = i * 28
draw_face2($game_party.actors[0],59 ,48) #imposta la grafica dei dettagli personaggi in battaglia
draw_face2($game_party.actors[1],281 ,48) #281
draw_face2($game_party.actors[2],502 ,48) #502
draw_face2($game_party.actors[3],177 ,104)
draw_face2($game_party.actors[4],405 ,104)
draw_hp2($game_party.actors[0], 64 , 20, 120)
draw_sp2($game_party.actors[0], 91, 32, 120)
draw_hp2($game_party.actors[1], 286 , 20, 120)
draw_sp2($game_party.actors[1], 313, 32, 120)
draw_hp2($game_party.actors[2], 507 , 20, 120)
draw_sp2($game_party.actors[2], 534, 32, 120)
draw_hp2($game_party.actors[3], 182 , 76, 120)
draw_sp2($game_party.actors[3], 209, 88, 120)
draw_hp2($game_party.actors[4], 410 , 76, 120)
draw_sp2($game_party.actors[4], 437, 88, 120)
if @level_up_flags[i]
self.contents.font.color = normal_color
self.contents.draw_text(actor, actor_x + 65, 80, 32, "LEVEL UP!")
else
self.contents.font.size = 18
#draw_actor_state(actor, 410, actor_y + 8)
draw_actor_state($game_party.actors[0], 114, 40)
draw_actor_state($game_party.actors[1], 336, 40)
draw_actor_state($game_party.actors[2], 557, 40)
draw_actor_state($game_party.actors[3], 232, 96)
draw_actor_state($game_party.actors[4], 460, 96)
self.contents.font.size = 18
end
else
actor = $game_party.actors[i]
actor_x = i * 160 + 12
draw_lay(actor,actor_x - 5,110)
draw_face(actor,actor_x,100)
draw_name(actor, actor_x, 0)
draw_hp(actor, actor_x, 32, 120)
draw_sp(actor, actor_x, 64, 120)
if @level_up_flags[i]
self.contents.font.color = normal_color
self.contents.draw_text(actor, actor_x + 65, 80, 32, "LEVEL UP!")
else
self.contents.font.size = 12
draw_actor_state(actor, actor_x + 80, 80)
self.contents.font.size = 18
end
end
end
end
def update
super
end
end#==============================================================================
# ADD-ON - LAYOUT
#==============================================================================
# By Moghunter
#==============================================================================
class Window_BattleStatus < Window_Base
def initialize
super(-40, 310, 700, 200)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Georgia"
self.contents.font.size = 18
self.contents.font.bold = true
self.opacity = 0
@level_up_flags = [false, false, false, false]
refresh
end
def dispose
super
end
def level_up(actor_index)
@level_up_flags[actor_index] = true
end
def refresh
self.contents.clear
self.contents.font.size = 18
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
if $game_switches[5] == true
actor = $game_party.actors[i]
actor_x = i * 180 + 52
actor_y = i * 28
if i == 0
draw_face2(actor, 59 ,48)
draw_hp2(actor, 64 , 20, 120)
draw_sp2(actor, 91, 32, 120)
end
if i == 1
draw_face2(actor, 281 ,48)
draw_hp2(actor, 286 , 20, 120)
draw_sp2(actor, 313, 32, 120)
end
if i == 2
draw_face2(actor, 502 ,48)
draw_hp2(actor, 507 , 20, 120)
draw_sp2(actor, 534, 32, 120)
end
if i == 3
draw_face2(actor, 177 ,104)
draw_hp2(actor, 182 , 76, 120)
draw_sp2(actor, 209, 88, 120)
end
if i == 4
draw_face2(actor, 405 ,104)
draw_hp2(actor, 410 , 76, 120)
draw_sp2(actor, 437, 88, 120)
end
if @level_up_flags[i]
self.contents.font.color = normal_color
self.contents.draw_text(actor, actor_x + 65, 80, 32, "LEVEL UP!")
else
self.contents.font.size = 18
if i == 0
draw_actor_state(actor, 114, 40)
end
if i == 1
draw_actor_state(actor, 336, 40)
end
if i == 2
draw_actor_state(actor, 557, 40)
end
if i == 3
draw_actor_state(actor, 232, 96)
end
if i == 4
draw_actor_state(actor, 460, 96)
end
self.contents.font.size = 18
end
else
actor = $game_party.actors[i]
actor_x = i * 160 + 12
draw_lay(actor,actor_x - 5,110)
draw_face(actor,actor_x,100)
draw_name(actor, actor_x, 0)
draw_hp(actor, actor_x, 32, 120)
draw_sp(actor, actor_x, 64, 120)
if @level_up_flags[i]
self.contents.font.color = normal_color
self.contents.draw_text(actor, actor_x + 65, 80, 32, "LEVEL UP!")
else
self.contents.font.size = 12
draw_actor_state(actor, actor_x + 80, 80)
self.contents.font.size = 18
end
end
end
end
def update
super
end
end
if i == 0
...
if i == 1
case i
when 0
...
when 1
...
end
face_coords = [[59, 48], [281, 48], ...]
hp_coords = [[64, 20], [286,20], ...]
sp_coords = [[91,32], [313, 32], ...]
for i in 0...$game_party.actors.size
...
draw_face2(actor, face_coords[i][0], face_coords[i][1])
draw_hp2(actor, hp_coords[i][0], hp_coords[i][1])
draw_sp2(actor, sp_coords[i][0], sp_coords[i][1])