01-30-2008, 01:00 PM
(This post was last modified: 05-12-2017, 04:49 AM by DerVVulfman.)
New Status Window
polraudio
Jan 30, 2008
Instructions:
Place code after Scene_Status and above Main thats all
Compatibility:
Everything unless using a CMS
polraudio
Jan 30, 2008
This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.
No support is given. If you are the owner of the thread, please contact administration.
Code:
#================================#
# ¦ Scene_Status #
#----------------------------------------------------------------#
# By:Polraudio #
#================================#
class Scene_Status
def initialize(actor_index = 0, equip_index = 0)
@actor_index = actor_index
end
def main
@actor = $game_party.actors[@actor_index]
@status1_window = Window_Status1.new(@actor)
@status2_window = Window_Status2.new(@actor)
@status2_window.x = 0
@status2_window.y = 210
@status3_window = Window_Status3.new(@actor)
@status3_window.x = 250
@status3_window.y = 64
@status4_window = Window_Status4.new(@actor)
@status4_window.x = 250
@status4_window.y = 180
@help_window = Window_Help1.new
@help_window.set_text("Welcome to the status screen")
@help_window.x =250
@help_window.y = 0
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@status1_window.dispose
@status2_window.dispose
@status3_window.dispose
@status4_window.dispose
@help_window.dispose
end
def update
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Menu.new(3)
return
end
if Input.trigger?(Input::R)
$game_system.se_play($data_system.cursor_se)
@actor_index += 1
@actor_index %= $game_party.actors.size
$scene = Scene_Status.new(@actor_index)
return
end
if Input.trigger?(Input::L)
$game_system.se_play($data_system.cursor_se)
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
$scene = Scene_Status.new(@actor_index)
return
end
end
end
class Window_Status1 < Window_Base
def initialize(actor)
super(0, 0, 250, 210)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype
self.contents.font.size = $defaultfontsize
@actor = actor
refresh
end
def refresh
self.contents.clear
draw_actor_graphic(@actor, 35, 80)
draw_actor_name(@actor, 4, 0)
draw_actor_class(@actor, 4 + 144,50 )
self.contents.font.color = system_color
self.contents.draw_text(90, 50, 80, 32, "Class:")
draw_actor_level(@actor, 90, 75)
draw_actor_state(@actor, 4, 75)
draw_actor_hp(@actor, 4, 112, 172)
draw_actor_sp(@actor, 4, 144, 172)
end
end
class Window_Status2 < Window_Base
def initialize(actor)
super(0, 0, 250, 270)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype
self.contents.font.size = $defaultfontsize
@actor = actor
refresh
end
def refresh
self.contents.clear
draw_actor_parameter(@actor, 4, 0, 0)
draw_actor_parameter(@actor, 4, 32, 1)
draw_actor_parameter(@actor, 4, 64, 2)
draw_actor_parameter(@actor, 4, 96, 3)
draw_actor_parameter(@actor, 4, 128, 4)
draw_actor_parameter(@actor, 4, 160, 5)
draw_actor_parameter(@actor, 4, 192, 6)
end
end
class Window_Status3 < Window_Base
def initialize(actor)
super(0, 0, 390,116 )
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype
self.contents.font.size = $defaultfontsize
@actor = actor
refresh
end
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(0, 20, 80, 32, "Exp")
self.contents.draw_text(0, 52, 80, 32, "Next Level")
self.contents.font.color = normal_color
self.contents.draw_text(50 , 20, 84, 32, @actor.exp_s, 2)
self.contents.draw_text(50 , 52, 84, 32, @actor.next_rest_exp_s, 2)
end
end
class Window_Status4 < Window_Base
def initialize(actor)
super(0, 0, 390, 300)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype
self.contents.font.size = $defaultfontsize
@actor = actor
refresh
end
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(0, 0, 96, 32, "Equipment")
draw_item_name($data_weapons[@actor.weapon_id], 0, 48)
draw_item_name($data_armors[@actor.armor1_id], 0, 96)
draw_item_name($data_armors[@actor.armor2_id], 0, 144)
draw_item_name($data_armors[@actor.armor3_id], 0, 192)
draw_item_name($data_armors[@actor.armor4_id], 0, 240)
end
def dummy
self.contents.font.color = system_color
self.contents.draw_text(0, 48, 96, 32, $data_system.words.weapon)
self.contents.draw_text(0, 96, 96, 32, $data_system.words.armor1)
self.contents.draw_text(0, 144, 96, 32, $data_system.words.armor2)
self.contents.draw_text(0, 192, 96, 32, $data_system.words.armor3)
self.contents.draw_text(0, 240, 96, 32, $data_system.words.armor4)
draw_item_name($data_weapons[@actor.weapon_id], 0, 48)
draw_item_name($data_armors[@actor.armor1_id], 0, 96)
draw_item_name($data_armors[@actor.armor2_id], 0, 144)
draw_item_name($data_armors[@actor.armor3_id], 0, 192)
draw_item_name($data_armors[@actor.armor4_id], 0, 240)
end
end
class Window_Help1 < Window_Base
def initialize
super(0, 0, 390, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype
self.contents.font.size = $defaultfontsize
end
def set_text(text, align = 0)
if text != @text or align != @align
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, self.width - 40, 32, text, align)
@text = text
@align = align
@actor = nil
end
self.visible = true
end
def set_actor(actor)
if actor != @actor
self.contents.clear
draw_actor_name(actor, 4, 0)
draw_actor_state(actor, 140, 0)
draw_actor_hp(actor, 284, 0)
draw_actor_sp(actor, 460, 0)
@actor = actor
@text = nil
self.visible = true
end
end
def set_enemy(enemy)
text = enemy.name
state_text = make_battler_state_text(enemy, 112, false)
if state_text != ""
text += " " + state_text
end
set_text(text, 1)
end
end
class Game_Actor < Game_Battler
def exp_s
return @exp_list[@level+1] > 0 ? @exp.to_s : "MAX"
end
def next_exp_s
return @exp_list[@level+1] > 0 ? @exp_list[@level+1].to_s : "None"
end
def next_rest_exp_s
return @exp_list[@level+1] > 0 ?
(@exp_list[@level+1] - @exp).to_s : "None"
end
end
Instructions:
Place code after Scene_Status and above Main thats all
Compatibility:
Everything unless using a CMS