#========================================================================================
# Thanks: AcedentProne: for using facesets, and showing location window.
# Thanks: Firewords and Axe Man Deke
# Made by GaveUpTomorrow - May 4th, 2006
# Version 0.80
#========================================================================================
#========================================
#Game_Map
#========================================
class Game_Map
def name
$map_infos[@map_id]
end
end
#========================================
#Window_Title
#========================================
class Scene_Title
$map_infos = load_data("Data/MapInfos.rxdata")
for key in $map_infos.keys
$map_infos[key] = $map_infos[key].name
end
end
#----------------------------------------------------------------
# Window_Base (New Functions)
#----------------------------------------------------------------
class Window_Base < Window
def draw_actor_battler(actor, x, y)
bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
cw = bitmap.width
ch = bitmap.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
end
def draw_actor_face(actor, x, y)
face = RPG::Cache.character("Faces/" + actor.character_name, actor.character_hue)
fw = face.width
fh = face.height
src_rect = Rect.new(0, 0, fw, fh)
self.contents.blt(x - fw / 23, y - fh, face, src_rect)
end
def draw_actor_level2(actor, x, y)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, 32, "Level")
self.contents.font.color = normal_color
self.contents.draw_text(x + 26, y, 24, 32, actor.level.to_s, 2)
end
def draw_actor_hp2(actor, x, y, width = 144)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
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 = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
self.contents.draw_text(hp_x - 15, y, 48, 32, actor.hp.to_s, 2)
if flag
self.contents.font.color = normal_color
self.contents.draw_text(hp_x + 33, y, 12, 32, "/", 1)
self.contents.draw_text(hp_x + 45, y, 48, 32, actor.maxhp.to_s)
end
end
def draw_actor_sp2(actor, x, y, width = 144)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
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 = actor.sp == 0 ? knockout_color :
actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
self.contents.draw_text(sp_x - 15, y, 48, 32, actor.sp.to_s, 2)
if flag
self.contents.font.color = normal_color
self.contents.draw_text(sp_x + 33, y, 12, 32, "/", 1)
self.contents.draw_text(sp_x + 45, y, 48, 32, actor.maxsp.to_s)
end
end
end
#==============================================================================
# Window_Location
#==============================================================================
class Window_Location < Window_Base
def initialize
super(475, 234, 160, 172)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype
self.contents.font.size = 18
refresh
end
def refresh
cx = contents.text_size($game_map.name).width
self.contents.font.color = system_color
self.contents.draw_text(0, 0, 120, 32, "Location:")
self.contents.font.color = normal_color
self.contents.draw_text(0, 25, 140, 32, $game_map.name)
self.contents.font.color = system_color
self.contents.draw_text(0, 50 , 120, 32, "Number of Steps:")
self.contents.font.color = normal_color
self.contents.draw_text(4, 75, 120, 32, $game_party.steps.to_s, 2)
self.contents.draw_text(0, 100, 120, 32, "Shards:")
self.contents.draw_text(116, 100, 120, 32, $game_party.shards.to_s)
end
end
#==============================================================================
# Window_MenuStatus
#==============================================================================
class Window_MenuStatus2 < Window_Selectable
def initialize
super(170, 355, 300, 120)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype
self.contents.font.size = 18
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
actor = $game_party.actors
w = i * 100 + 10
x = 64
y = i * (100)
actor = $game_party.actors[0]
x = 640*i
y = 0
draw_actor_face(actor, 0, 85)
draw_actor_level(actor, x + 85, y)
draw_actor_exp(actor, x + 85, y + 20)
draw_actor_hp(actor, x + 85, y + 40)
draw_actor_sp(actor, x + 85, y + 60)
end
end
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(0, @index * 100 - 4, self.width - 32, 96 + 4)
end
end
end
#==============================================================================
# Window_GameName
#==============================================================================
class Window_GameName < Window_Base
def initialize
super(475, 5, 160, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype
self.contents.font.size = 22
end
#-----------------------------------------------------------------------------
def refresh
#-----------------------------------------------------------------------------
# if $game_variables[0001] == 1
# self.contents.draw_text(0, 0, 120, 32, "Raining", 2)
# end
# if $game_variables[0001] == 2
# self.contents.draw_text(0, 0, 120, 32, "Snowing", 2)
# end
if $game_system.season_change >=9 and $game_system.season_change < 12
self.contents.draw_text(-35, 0, 120, 32, "Spring", 2)
elsif $game_system.season_change >=0 and $game_system.season_change < 3
self.contents.draw_text(-25, 0, 120, 32, "Summer", 2)
elsif $game_system.season_change >=3 and $game_system.season_change < 6
self.contents.draw_text(-45, 0, 120, 32, "Fall", 2)
elsif $game_system.season_change >=6 and $game_system.season_change < 9
self.contents.draw_text(-30, 0, 120, 32, "Winter", 2)
end
end
end
#==============================================================================
# Window_PlayTime2
#==============================================================================
class Window_PlayTime2 < Window_Base
def initialize
super(0, 0, 160, 172)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype
self.contents.font.size = $defaultfontsize
refresh
end
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 120, 32, "Play Time:")
@total_sec = Graphics.frame_count / Graphics.frame_rate
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
text = sprintf("%02d:%02d:%02d", hour, min, sec)
self.contents.font.color = normal_color
self.contents.draw_text(4, 32, 120, 32, text, 2)
@total_sec = Graphics.frame_count / Graphics.frame_rate
@minute=$game_time.get_minute.floor
hour = $game_time.get_hour
pm_flag= hour >=12 ? true : false
hour= hour >= 12 ? hour-12 : hour
day=$game_time.get_day
month=$game_time.get_month
year=$game_time.get_year
if hour.floor==0
text=sprintf("%02d:%02d",12,@minute)
else
text=sprintf("%02d:%02d",hour,@minute)
end
if pm_flag
text += " PM"
else
text += " AM"
end
self.contents.font.color = system_color
self.contents.draw_text(4,64,140,32,"Date and Time:")
self.contents.font.color = normal_color
self.contents.draw_text(4,114,120, 32, text, 2)
text = sprintf("%02d-%02d-%02d", month, day, year)
self.contents.font.color=system_color
self.contents.draw_text(30,94,120,32,text)
end
#--------------------------------------------------------------------------
def update
super
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
end
if $game_time.get_minute.floor != @minute
refresh
end
end
end
#==============================================================================
# Window_Status2
#==============================================================================
class Window_Status2 < Window_Base
def initialize(actor)
super(170, 5, 300, 345)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype
self.contents.font.size = 18
@actor = actor
refresh
end
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_actor_name(@actor, 4, 0)
draw_actor_class(@actor, 178, 0)
draw_actor_state(@actor, 86, 0)
draw_actor_parameter(@actor, 4, 50, 0)
draw_actor_parameter(@actor, 4, 67, 1)
draw_actor_parameter(@actor, 4, 84, 2)
draw_actor_parameter(@actor, 4, 101, 3)
draw_actor_parameter(@actor, 4, 118, 4)
draw_actor_parameter(@actor, 4, 135, 5)
draw_actor_parameter(@actor, 4, 152, 6)
self.contents.font.color = system_color
self.contents.draw_text(4, 25, 80, 32, "Next Level:")
self.contents.font.color = normal_color
self.contents.draw_text(44, 25, 84, 32, @actor.next_rest_exp_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(4, 182, 96, 32, "Equipment:")
self.contents.font.size = 13
draw_item_name($data_weapons[@actor.weapon_id], 4, 212 + 3)
draw_item_name($data_armors[@actor.armor2_id], 4, 247)
draw_item_name($data_armors[@actor.armor4_id], 4, 282 - 3)
draw_item_name($data_armors[@actor.armor1_id], 134 + 15, 212 + 3)
draw_item_name($data_armors[@actor.armor3_id], 134 + 15, 247)
end
end
#==============================================================================
# Window_Battler
#==============================================================================
class Window_Battler < Window_Base
def initialize
super(475, 5, 160, 225)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype
self.contents.font.size = $defaultfontsize
refresh
end
#--------------------------------------------------------------------------
def refresh
self.contents.clear
actor = $game_party.actors[0]
draw_actor_battler(actor, 60, 180)
end
end