Advanced Menu Screen - Kanon - 11-21-2008
Advanced Menu Screen
by Kanon
Version 1.9
Nov 21, 2008
This is a locked, two-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.
Introduction
This script was designed to modify entire of the menu screen.
This is my first script so any comments are welcomes here...
I'm sorry, I still learning how to use WYSIWYG editor.
Part 1 (Part 2 in 2nd post)
Code: #==============================================================================
# Custom Menu Screen
#------------------------------------------------------------------------------
# By Kanon
# Version 1.9
# Date 15/10/2008
# Last Update 12/11/2008
#------------------------------------------------------------------------------
#
# * INSTRUCTION:
#
# If you want to add icons in the Command Window:
# 1. You need to create a new folder inside the Icon folder named Command_Icon.
# 2. Then, you need to add the icons and named them:
# command0, command1, command2, command3 and command4
# 3. If you don't want to add icons, you can set [Command_Icon = false]
#
# If you want to add icons in the Stats Window:
# 1. You need to create a new folder inside the Icon folder named Stats_Icon.
# 2. Then, you need to add the icons and named them:
# location, playtime, encounter, gold and step
# 3. If you don't want to add icons, you can set [Stats_Icon = false]
#
# Finally, place all of this scripts above main and it should be done.
#
#
# * COMPATIBILITY:
#
# This script should be 100% compatibly with everything except other CMS.
# Already compatible with SDK.
#
#
# * FEATURES:
#
# ~ Slide-in windows, which still 85%.
# ~ HP/SP/EXP with bars included.
# ~ Parameter with bars included.
# ~ Command window and Player Stats window with Icons.
# ~ Custom Sprite's movement by Constance.
#
#
# * VERSION HISTORY:
#
# Ver 1.0 -------------------------------------------------------- (15/10/2008)
# ~ The script was first made.
#
# Ver 1.5 -------------------------------------------------------- (26/10/2008)
# ~ Added HP/SP/EXP bar in the menu status.
# ~ Added custom sprite's movement.
# ~ Added parameter bars in the status window.
#
# ver 1.7 -------------------------------------------------------- (1/11/2008)
# ~ Re-edit the menu status window.
# ~ Equip Window is finished.
# ~ Status Window is already completed.
# ~ Fixed Custom sprite's movement bug.
# ~ HP/SP/EXP bars are fixed and improved.
# ~ Decreased lag.
#
# Ver 1.8 -------------------------------------------------------- (2/11/2008)
# ~ Skill Window is finished.
# ~ Fixed HP/SP/EXP bars' position.
# ~ Fixed Slide-in movement.
# ~ Fixed Skill Target window bug.
# ~ Re-model exit window.
# ~ Decreased lag slightly.
#
# ver 1.9 -------------------------------------------------------- (12/11/2008)
# ~ Compatibly for SDK.
# ~ Fixed Slide-in windows' movement bugs and glitches.
# ~ Re-model entire menu status window.
# ~ Fixed skill target window's slide-in movement.
#
#
# * CUSTOMIZATION:
#
# Font_Name
# Customize the font name which will be used for all-in script.
# Font Name list which suitable for this CMS:
# ~ Tahoma
# ~ Verdana
# ~ Comic Sans MS
# ~ Baldessare
# ~ UmePlus Gothic
#
# Font_Size
# Customize the font size which will be used for all-in script.
# The default is 20.
#
# Command_Icon
# Set to true if you want to add icon in the command window or set to false
# if you want the normal command window.
#
# Stats_Icon
# Set to true if you want to add icon in the stats window or set to false
# if you want the normal stats window.
#
# Transition
# Customize the scene transition model.
# e.g = Graphics/Transitions/001-Blind01
#
# Transition_Wait
# Customize the scene transition time. Set to 0 if you don't want to wait
# for the transition.
#
#
# * REPORT:
#
# kanon_gate@yahoo.com
# Visit RMXP Ultimate for more scripts.
#
# NOTE: RMXP Ultimate are looking for new member, join it now. ^^
#==============================================================================
#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log('Custom Menu Screen', 'Kanon', 1.9, '12-11-2008')
#------------------------------------------------------------------------------
# * Begin SDK Enabled Check
#------------------------------------------------------------------------------
if SDK.state('Custom Menu Screen') == true
#----- C O N F I G U R A T I O N -----#
module CMS
##-----------------------------------##
Font_Name = "UmePlus Gothic"
##-----------------------------------##
Font_Size = 20
##-----------------------------------##
Command_Icon = true
##-----------------------------------##
Stats_Icon = true
##-----------------------------------##
Transition = ""
##-----------------------------------##
Transition_Wait = 20
##-----------------------------------##
end
#----- E N D -----#
#==============================================================================
# ** Game_System
#==============================================================================
class Game_System
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :battle_count
#--------------------------------------------------------------------------
# * Alias Listing
#--------------------------------------------------------------------------
alias custom_menu_screen_initialize initialize
#--------------------------------------------------------------------------
# * Initialization
#--------------------------------------------------------------------------
def initialize
custom_menu_screen_initialize
@battle_count = 0
end
end
#==============================================================================
# ** Scene_Battle
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# * Alias Listing
#--------------------------------------------------------------------------
alias custom_menu_screen_main main
#--------------------------------------------------------------------------
# * Initialization
#--------------------------------------------------------------------------
def main
$game_system.battle_count += 1
custom_menu_screen_main
end
end
#==============================================================================
# ** Game_Map
#==============================================================================
class Game_Map
#--------------------------------------------------------------------------
# * Load Map Name
#--------------------------------------------------------------------------
def name
load_data('Data/MapInfos.rxdata')[@map_id].name
end
end
#==============================================================================
# ** Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# * Get Current Experience Points
#--------------------------------------------------------------------------
def now_exp
return @exp - @exp_list[@level]
end
#--------------------------------------------------------------------------
# * Get Needed Experience Points
#--------------------------------------------------------------------------
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end
#--------------------------------------------------------------------------
# * Get EXP String
#--------------------------------------------------------------------------
def exp_s
return @exp_list[@level+1] > 0 ? @exp.to_s : "---"
end
#--------------------------------------------------------------------------
# * Get Next Level EXP String
#--------------------------------------------------------------------------
def next_exp_s
return @exp_list[@level+1] > 0 ? @exp_list[@level+1].to_s : "---"
end
#--------------------------------------------------------------------------
# * Get Until Next Level EXP String
#--------------------------------------------------------------------------
def next_rest_exp_s
return @exp_list[@level+1] > 0 ? (@exp_list[@level+1] - @exp).to_s : "---"
end
end
#==============================================================================
# ** Window_Base
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# * Get special Text Color
#--------------------------------------------------------------------------
def special_color
return Color.new(0, 230, 240, 255)
end
#--------------------------------------------------------------------------
# * Get Plus Text Color
#--------------------------------------------------------------------------
def plus_color
return Color.new(0, 230, 255, 255)
end
#--------------------------------------------------------------------------
# * Get Minus Text Color
#--------------------------------------------------------------------------
def minus_color
return Color.new(255, 0, 0, 255)
end
#--------------------------------------------------------------------------
# * Draw Kanon Bar (based on Slant Bar by SephirothSpawn)
#--------------------------------------------------------------------------
def draw_kanon_bar(x, y, min, max, width = 152, height = 8, 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.5, Color.new(50, 50, 50, 255))
end
#------------------------------------------------------------------------
# Draw Background
#------------------------------------------------------------------------
for i in 1..(height - 1)
r = 96 * (height - i) / height + 64 * i / height + 32
g = 96 * (height - i) / height + 64 * i / height + 32
b = 96 * (height - i) / height + 64 * i / height + 32
a = 255 * (height - i) / height + 255 * i / height + 32
self.contents.fill_rect(x + i, y + height + i, width + 1, 1.5, Color.new(r, b, g, a))
end
#------------------------------------------------------------------------
# Draw Bar Gauge
#------------------------------------------------------------------------
for i in 1..( (min.to_f / 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 - 1, y + height + j, 1 + 2, 1, Color.new(r, g, b, a))
end
end
end
#--------------------------------------------------------------------------
# * Draw HP with Bar
#--------------------------------------------------------------------------
def draw_actor_hp_bar(actor, x, y, width = 160)
#------------------------------------------------------------------------
# Calculate if there is draw space for Max HP
#------------------------------------------------------------------------
if width - 32 >= 108
hp_x = x + width - 108
flag = true
elsif width - 32 >= 48
hp_x = x + width - 48
flag = false
end
#------------------------------------------------------------------------
# Battle Processing
#------------------------------------------------------------------------
if $game_temp.in_battle
bar_width = hp_x - x + 50
else
bar_width = hp_x - x + 100
end
#------------------------------------------------------------------------
# Draw Kanon Bar
#------------------------------------------------------------------------
draw_kanon_bar(x + 6, y + 10, actor.hp, actor.maxhp, bar_width, 7, bar_color = Color.new(0, 150, 0, 255), end_color = Color.new(60, 255, 120, 255))
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
self.contents.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
self.contents.draw_text(hp_x, y, 48, 32, actor.hp.to_s, 1)
#------------------------------------------------------------------------
# Draw Max HP
#------------------------------------------------------------------------
if flag
self.contents.font.color = normal_color
self.contents.draw_text(hp_x + 48, y, 12, 32, "/", 2)
self.contents.draw_text(hp_x + 64, y, 48, 32, actor.maxhp.to_s)
end
end
#--------------------------------------------------------------------------
# * Draw SP with Bar
#--------------------------------------------------------------------------
def draw_actor_sp_bar(actor, x, y, width = 160)
#------------------------------------------------------------------------
# Calculate if there is draw space for Max SP
#------------------------------------------------------------------------
if width - 32 >= 108
sp_x = x + width - 108
flag = true
elsif width - 32 >= 48
sp_x = x + width - 48
flag = false
end
#------------------------------------------------------------------------
# Battle Processing
#------------------------------------------------------------------------
if $game_temp.in_battle
bar_width = sp_x - x + 50
else
bar_width = sp_x - x + 100
end
#------------------------------------------------------------------------
# Draw Kanon Bar
#------------------------------------------------------------------------
draw_kanon_bar(x + 6, y + 10, actor.sp, actor.maxsp, bar_width, 7, bar_color = Color.new(0, 0, 150, 255), end_color = Color.new(60, 120, 255, 255))
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
self.contents.font.color = actor.sp == 0 ? knockout_color :
actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
self.contents.draw_text(sp_x, y, 48, 32, actor.sp.to_s, 1)
#------------------------------------------------------------------------
# Draw Max SP
#------------------------------------------------------------------------
if flag
self.contents.font.color = normal_color
self.contents.draw_text(sp_x + 48, y, 12, 32, "/", 2)
self.contents.draw_text(sp_x + 64, y, 48, 32, actor.maxsp.to_s)
end
end
#--------------------------------------------------------------------------
# * Draw EXP with Bar
#--------------------------------------------------------------------------
def draw_actor_exp_bar(actor, x, y)
if actor.level == 99
draw_kanon_bar(x + 6, y + 10, 1, 1, 160, 7, bar_color = Color.new(150, 150, 0, 255), end_color = Color.new(255, 255, 60, 255))
else
draw_kanon_bar(x + 6, y + 10, actor.now_exp, actor.next_exp, 160, 7, bar_color = Color.new(120, 120, 0, 255), end_color = Color.new(255, 255, 60, 255))
end
self.contents.font.color = system_color
self.contents.draw_text(x, y, 640, 32, "Next")
self.contents.font.color = normal_color
self.contents.draw_text(x + 96, y, 96, 32, actor.next_rest_exp_s, 1)
end
#--------------------------------------------------------------------------
# * Draw Current EXP
#--------------------------------------------------------------------------
def draw_actor_current_exp(actor, x, y)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 320, 32, "Exp")
self.contents.font.color = normal_color
self.contents.draw_text(x + 96, y, 96, 32, actor.exp_s, 1)
end
#--------------------------------------------------------------------------
# * Draw Level
#--------------------------------------------------------------------------
def draw_actor_level(actor, x, y)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, 32, "Lv")
self.contents.font.color = normal_color
self.contents.draw_text(x + 96, y, 96, 32, actor.level.to_s, 1)
end
#--------------------------------------------------------------------------
# * Draw Parameter
#--------------------------------------------------------------------------
def draw_actor_parameter(actor, x, y, type)
case type
when 0
para_name = $data_system.words.atk
para_color1 = Color.new(125, 75, 0, 255)
para_color2 = Color.new(255, 150, 0, 255)
para_stat = actor.atk
when 1
para_name = $data_system.words.pdef
para_color1 = Color.new(0, 125, 125, 255)
para_color2 = Color.new(0, 255, 255, 255)
para_stat = actor.pdef
when 2
para_name = $data_system.words.mdef
para_color1 = Color.new(125, 125, 0, 255)
para_color2 = Color.new(255, 255, 0, 255)
para_stat = actor.mdef
when 3
para_name = $data_system.words.str
para_color1 = Color.new(125, 0, 25, 255)
para_color2 = Color.new(255, 0, 75, 255)
para_stat = actor.str
when 4
para_name = $data_system.words.dex
para_color1 = Color.new(0, 125, 25, 255)
para_color2 = Color.new(0, 255, 75, 255)
para_stat = actor.dex
when 5
para_name = $data_system.words.agi
para_color1 = Color.new(125, 0, 125, 255)
para_color2 = Color.new(255, 0, 255, 255)
para_stat = actor.agi
when 6
para_name = $data_system.words.int
para_color1 = Color.new(0, 25, 125, 255)
para_color2 = Color.new(0, 150, 255, 255)
para_stat = actor.int
end
draw_kanon_bar(x + 6, y + 10, para_stat, 999, 150, 6.5, bar_color = para_color1, end_color = para_color2)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 120, 32, para_name)
self.contents.font.color = normal_color
self.contents.draw_text(x + 120, y, 36, 32, para_stat.to_s, 2)
end
#--------------------------------------------------------------------------
# * Draw Sprite
#--------------------------------------------------------------------------
def draw_sprite(x, y, name, hue, pose, frame)
bitmap = RPG::Cache.character(name, hue)
cw = bitmap.width / 4
ch = bitmap.height / 4
case pose
when 0;a = 0
when 1;a = ch
when 2;a = ch * 3
when 3;a = ch * 2
end
case frame
when 0;b = 0
when 1;b = cw
when 2;b = cw * 2
when 3;b = cw * 3
end
src_rect = Rect.new(b, a, cw, ch)
self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
end
#--------------------------------------------------------------------------
# * Draw Item Name
#--------------------------------------------------------------------------
def draw_item_name(item, x, y)
if item == nil
self.contents.font.color = normal_color
self.contents.draw_text(0, y, 320, 32, "Nothing Equipped", 0)
return
end
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
self.contents.font.color = normal_color
self.contents.draw_text(x + 28, y, 212, 32, item.name)
end
end
#==============================================================================
# ** Window_New_Command
#==============================================================================
class Window_New_Command < Window_Command
#--------------------------------------------------------------------------
# * Initialization
#--------------------------------------------------------------------------
def initialize(index)
commands = [$data_system.words.item, $data_system.words.skill, $data_system.words.equip, "Status", "Exit"]
super(160, commands)
self.index = index
self.x = 480
self.y = 0
self.height = 7 * 32 + 32
self.opacity = 255
end
#--------------------------------------------------------------------------
# * Draw Item
#--------------------------------------------------------------------------
if CMS::Command_Icon
def draw_item(index, color)
self.contents.font.color = color
rect = Rect.new(4, 32 * index, self.contents.width - 8, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.blt(4, 4 + index * 32, RPG::Cache.icon("Command_Icon/command#{index}"), Rect.new(0, 0, 24, 24))
self.contents.font.name = CMS::Font_Name
self.contents.font.size = CMS::Font_Size
self.contents.draw_text(32, index * 32, 148, 32, @commands[index])
end
else
def draw_item(index, color)
self.contents.font.color = color
self.contents.font.name = CMS::Font_Name
self.contents.font.size = CMS::Font_Size
self.contents.draw_text(4, index * 32, 148, 32, @commands[index])
end
end
end
#==============================================================================
# ** Window_New_Command_Exit
#==============================================================================
class Window_New_Command_Exit < Window_Command
#--------------------------------------------------------------------------
# * Initialization
#--------------------------------------------------------------------------
def initialize(index)
commands = ["To Title", "Continue", "Quit Game"]
super(160, commands)
self.index = index
self.x = 640
self.y = 256
self.height = 3 * 32 + 32
self.opacity = 255
self.active = false
end
#--------------------------------------------------------------------------
# * Draw Item
#--------------------------------------------------------------------------
def draw_item(index, color)
self.contents.font.color = color
self.contents.font.name = CMS::Font_Name
self.contents.font.size = CMS::Font_Size
self.contents.draw_text(4, index * 32, 148, 32, @commands[index])
end
end
#==============================================================================
# ** Window_Player_Status
#==============================================================================
class Window_Player_Status < Window_Base
#--------------------------------------------------------------------------
# * Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 384, 640, 96)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = CMS::Font_Name
self.contents.font.size = CMS::Font_Size
self.opacity = 255
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
if CMS::Stats_Icon
#----------------------------------------------------------------------
# * Playtime
#----------------------------------------------------------------------
bitmap = RPG::Cache.icon("Stats_Icon/playtime")
self.contents.blt(0, 36, bitmap, Rect.new(0, 0, 24, 24))
self.contents.font.color = system_color
self.contents.draw_text(35, 32, 100, 32, "Playtime")
@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(140, 32, 100, 32, text, 0)
#----------------------------------------------------------------------
# * Gold
#----------------------------------------------------------------------
bitmap = RPG::Cache.icon("Stats_Icon/gold")
self.contents.blt(435, 6, bitmap, Rect.new(0, 0, 24, 24))
cx = contents.text_size($data_system.words.gold).width
self.contents.font.color = system_color
self.contents.draw_text(470, 0, cx, 32, $data_system.words.gold, 2)
self.contents.font.color = normal_color
self.contents.draw_text(480, 0, 120, 32, $game_party.gold.to_s, 2)
#----------------------------------------------------------------------
# * Steps
#----------------------------------------------------------------------
bitmap = RPG::Cache.icon("Stats_Icon/step")
self.contents.blt(435, 36, bitmap, Rect.new(0, 0, 24, 24))
self.contents.font.color = system_color
self.contents.draw_text(470, 32, 100, 32, "Steps")
self.contents.font.color = normal_color
self.contents.draw_text(480, 32, 120, 32, $game_party.steps.to_s, 2)
#----------------------------------------------------------------------
# * Location
#----------------------------------------------------------------------
bitmap = RPG::Cache.icon("Stats_Icon/location")
self.contents.blt(0, 4, bitmap, Rect.new(0, 0, 24, 24))
self.contents.font.color = system_color
self.contents.draw_text(35, 0, 100, 32, "Location")
self.contents.font.color = normal_color
self.contents.draw_text(140, 0, 320, 32, $game_map.name.to_s, 0)
#----------------------------------------------------------------------
# * Encounters
#----------------------------------------------------------------------
bitmap = RPG::Cache.icon("Stats_Icon/encounter")
self.contents.blt(245, 36, bitmap, Rect.new(0, 0, 24, 24))
self.contents.font.color = system_color
self.contents.draw_text(280, 32, 100, 32, "Encounters")
self.contents.font.color = normal_color
self.contents.draw_text(310, 32, 120, 32, $game_system.battle_count.to_s, 2)
else
#----------------------------------------------------------------------
# * Playtime
#----------------------------------------------------------------------
self.contents.font.color = system_color
self.contents.draw_text(0, 32, 100, 32, "Playtime")
@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(105, 32, 100, 32, text, 0)
#----------------------------------------------------------------------
# * Gold
#----------------------------------------------------------------------
cx = contents.text_size($data_system.words.gold).width
self.contents.font.color = system_color
self.contents.draw_text(470, 0, cx, 32, $data_system.words.gold, 2)
self.contents.font.color = normal_color
self.contents.draw_text(480, 0, 120, 32, $game_party.gold.to_s, 2)
#----------------------------------------------------------------------
# * Steps
#----------------------------------------------------------------------
self.contents.font.color = system_color
self.contents.draw_text(470, 32, 100, 32, "Steps")
self.contents.font.color = normal_color
self.contents.draw_text(480, 32, 120, 32, $game_party.steps.to_s, 2)
#----------------------------------------------------------------------
# * Location
#----------------------------------------------------------------------
self.contents.font.color = system_color
self.contents.draw_text(0, 0, 100, 32, "Location")
self.contents.font.color = normal_color
self.contents.draw_text(105, 0, 320, 32, $game_map.name.to_s, 0)
#----------------------------------------------------------------------
# * Encounters
#----------------------------------------------------------------------
self.contents.font.color = system_color
self.contents.draw_text(245, 32, 100, 32, "Encounters")
self.contents.font.color = normal_color
self.contents.draw_text(275, 32, 120, 32, $game_system.battle_count.to_s, 2)
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
end
end
end
#==============================================================================
# ** Window_MenuStatus
#==============================================================================
class Window_Menu_Status < Window_Selectable
#--------------------------------------------------------------------------
# * Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 480, 384)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = CMS::Font_Name
self.contents.font.size = CMS::Font_Size
self.opacity = 255
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
x = 64
y = i * 96
draw_actor_name(actor, x + 8, y - 6)
draw_actor_level(actor, x + 8, y + 14)
draw_actor_hp_bar(actor, x + 192, y -6)
draw_actor_sp_bar(actor, x + 192, y + 14)
draw_actor_exp_bar(actor, x + 192, y + 34)
draw_actor_current_exp(actor, x + 8, y + 34)
end
end
#--------------------------------------------------------------------------
# * Update Cursor Rect
#--------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(2, 0 + @index * 96, self.width / 8, 62)
end
end
end
#==============================================================================
# * Window_Sprite1
#==============================================================================
class Window_Sprite1 < Window_Base
#--------------------------------------------------------------------------
# * Initialization
#--------------------------------------------------------------------------
def initialize
super(-480, 0, 480, 96)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
@pose = 0
@frame = 0
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
actor = $game_party.actors[0]
draw_sprite(32, 52, actor.character_name, actor.character_hue , @pose, @frame)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def frame_update
@frame == 3 ? @frame = 0 : @frame += 1
refresh
end
#--------------------------------------------------------------------------
# * Pose Update
#--------------------------------------------------------------------------
def update_pose(direction)
if direction == 0
@pose == 0 ? @pose = 3 : @pose -= 1
else
@pose == 3 ? @pose = 0 : @pose += 1
end
refresh
end
end
#==============================================================================
# * Window_Sprite2
#==============================================================================
class Window_Sprite2 < Window_Base
#--------------------------------------------------------------------------
# * Initialization
#--------------------------------------------------------------------------
def initialize
super(-480, 96, 480, 96)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
@pose = 0
@frame = 0
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
actor = $game_party.actors[1]
draw_sprite(32, 52, actor.character_name, actor.character_hue , @pose, @frame)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def frame_update
@frame == 3 ? @frame = 0 : @frame += 1
refresh
end
#--------------------------------------------------------------------------
# * Pose Update
#--------------------------------------------------------------------------
def update_pose(direction)
if direction == 0
@pose == 0 ? @pose = 3 : @pose -= 1
else
@pose == 3 ? @pose = 0 : @pose += 1
end
refresh
end
end
#==============================================================================
# * Window_Sprite3
#==============================================================================
class Window_Sprite3 < Window_Base
#--------------------------------------------------------------------------
# * Initialization
#--------------------------------------------------------------------------
def initialize
super(-480, 192, 480, 96)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
@pose = 0
@frame = 0
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
actor = $game_party.actors[2]
draw_sprite(32, 52, actor.character_name, actor.character_hue , @pose, @frame)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def frame_update
@frame == 3 ? @frame = 0 : @frame += 1
refresh
end
#--------------------------------------------------------------------------
# * Pose Update
#--------------------------------------------------------------------------
def update_pose(direction)
if direction == 0
@pose == 0 ? @pose = 3 : @pose -= 1
else
@pose == 3 ? @pose = 0 : @pose += 1
end
refresh
end
end
#==============================================================================
# * Window_Sprite4
#==============================================================================
class Window_Sprite4 < Window_Base
#--------------------------------------------------------------------------
# * Initialization
#--------------------------------------------------------------------------
def initialize
super(-480, 288, 480, 96)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
@pose = 0
@frame = 0
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
actor = $game_party.actors[3]
draw_sprite(32, 52, actor.character_name, actor.character_hue , @pose, @frame)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def frame_update
@frame == 3 ? @frame = 0 : @frame += 1
refresh
end
#--------------------------------------------------------------------------
# * Pose Update
#--------------------------------------------------------------------------
def update_pose(direction)
if direction == 0
@pose == 0 ? @pose = 3 : @pose -= 1
else
@pose == 3 ? @pose = 0 : @pose += 1
end
refresh
end
end
#==============================================================================
# ** Window_Skill_Status
#==============================================================================
class Window_Skill_Status < Window_Base
#--------------------------------------------------------------------------
# * Initialization
#--------------------------------------------------------------------------
def initialize(actor)
super(640, 64, 320, 416)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = CMS::Font_Name
self.contents.font.size = CMS::Font_Size
self.opacity = 255
@actor = actor
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_actor_name(@actor, 0, 0)
self.contents.font.color = system_color
self.contents.draw_text(0, 32, 160, 32, "State:")
draw_actor_state(@actor, 192, 32)
draw_actor_hp_bar(@actor, 0, 64)
draw_actor_sp_bar(@actor, 0, 96)
draw_actor_level(@actor, 128, 0)
draw_actor_current_exp(@actor, 0, 128)
draw_actor_exp_bar(@actor, 0, 160)
end
end
#==============================================================================
# ** Window_SkillHelp
#==============================================================================
class Window_SkillHelp < Window_Base
#--------------------------------------------------------------------------
# * Initialization
#--------------------------------------------------------------------------
def initialize
super(640, 0, 640, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = CMS::Font_Name
self.contents.font.size = CMS::Font_Size
self.opacity = 255
end
#--------------------------------------------------------------------------
# * Set Text
#--------------------------------------------------------------------------
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(0, 0, self.width - 40, 32, text, align)
@text = text
@align = align
@actor = nil
end
self.visible = true
end
end
#==============================================================================
# ** Window_Skill
#==============================================================================
class Window_Skill < Window_Selectable
#--------------------------------------------------------------------------
# * Initialization
#--------------------------------------------------------------------------
def initialize(actor)
super(960, 64, 320, 416)
@actor = actor
@column_max = 1
refresh
self.index = 0
self.opacity = 255
if $game_temp.in_battle
self.x = 0
self.y = 64
self.height = 256
self.back_opacity = 160
end
end
#--------------------------------------------------------------------------
# * Acquiring Skill
#--------------------------------------------------------------------------
def skill
return @data[self.index]
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
for i in 0...@actor.skills.size
skill = $data_skills[@actor.skills[i]]
if skill != nil
@data.push(skill)
end
end
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max
draw_item(i)
end
end
end
#--------------------------------------------------------------------------
# * Draw Item
#--------------------------------------------------------------------------
def draw_item(index)
skill = @data[index]
if @actor.skill_can_use?(skill.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = 4 + index % 1 * (288 + 32)
y = index / 1 * 32
self.contents.font.name = CMS::Font_Name
self.contents.font.size = CMS::Font_Size
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)
self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
self.contents.draw_text(x + 224, y, 48, 32, skill.sp_cost.to_s, 2)
end
#--------------------------------------------------------------------------
# * Help Text Update
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(self.skill == nil ? "" : self.skill.description)
end
end
#==============================================================================
# ** Window_Skill_Detail
#==============================================================================
class Window_Skill_Detail < Window_Base
#--------------------------------------------------------------------------
# * Initialization
#--------------------------------------------------------------------------
def initialize(skill)
super(640, 288, 320, 192)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = CMS::Font_Name
self.contents.font.size = CMS::Font_Size
self.opacity = 0
refresh(skill)
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh(skill)
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(0, -6, 640, 32, "Element")
self.contents.font.color = system_color
self.contents.draw_text(160, -6, 640, 32, "Status Effect")
elements = []
skill.element_set.each do |i|
elements << $data_system.elements[i]
end
for i in 0...elements.size
self.contents.font.color = normal_color
self.contents.draw_text(0, 14 + (i * 20), 640, 32, elements[i])
end
minus_status_data = []
for i in 1...$data_states.size
if skill.minus_state_set.include?(i)
minus_status_data.push($data_states[i].name)
end
end
for i in 0...minus_status_data.size
self.contents.font.color = normal_color
self.contents.draw_text(160, 14 + (i * 20), 640, 32, minus_status_data[i])
end
plus_status_data = []
for i in 1...$data_states.size
if skill.plus_state_set.include?(i)
plus_status_data.push($data_states[i].name)
end
end
for i in 0...plus_status_data.size
self.contents.font.color = normal_color
self.contents.draw_text(160, 14 + (i * 20), 120, 32, plus_status_data[i])
end
end
end
#==============================================================================
# ** Window_Skill_Target
#==============================================================================
class Window_Skill_Target < Window_Selectable
#--------------------------------------------------------------------------
# * Initialization
#--------------------------------------------------------------------------
def initialize
super(320, 64, 320, 416)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = CMS::Font_Name
self.contents.font.size = CMS::Font_Size
self.opacity = 255
self.z += 10
@item_max = $game_party.actors.size
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...$game_party.actors.size
x = 4
y = i * 96
actor = $game_party.actors[i]
draw_actor_name(actor, x, y)
draw_actor_hp_bar(actor, x, y + 22)
draw_actor_sp_bar(actor, x, y + 44)
draw_actor_level(actor, x + 128, y)
self.contents.font.color = system_color
self.contents.draw_text(x, y + 66, 160, 32, "State:", 0)
draw_actor_state(actor, x + 192, y + 66)
end
end
#--------------------------------------------------------------------------
# * Cursor Rectangle Update
#--------------------------------------------------------------------------
def update_cursor_rect
if @index <= -2
self.cursor_rect.set(0, (@index + 10) * 96, self.width - 32, 96)
elsif @index == -1
self.cursor_rect.set(0, 0, self.width - 32, @item_max * 96)
else
self.cursor_rect.set(0, @index * 96, self.width - 32, 96)
end
end
end
RE: Advanced Menu Screen - Kanon - 11-21-2008
Part 2
Code: #==============================================================================
# ** Window_Equip_Parameter
#==============================================================================
class Window_Equip_Parameter < Window_Base
#--------------------------------------------------------------------------
# * Initialization
#--------------------------------------------------------------------------
def initialize(actor)
super(640, 192, 320, 288)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = CMS::Font_Name
self.contents.font.size = CMS::Font_Size
self.opacity = 255
@actor = actor
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_actor_parameter(@actor, 0, 0, 0)
draw_actor_parameter(@actor, 0, 32, 1)
draw_actor_parameter(@actor, 0, 64, 2)
draw_actor_parameter(@actor, 0, 96, 3)
draw_actor_parameter(@actor, 0, 128, 4)
draw_actor_parameter(@actor, 0, 160, 5)
draw_actor_parameter(@actor, 0, 192, 6)
if @new_atk != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 0, 36, 32, ">>", 2)
if @new_atk > @actor.atk
color = plus_color
elsif @new_atk < @actor.atk
color = minus_color
else
color = normal_color
end
self.contents.font.color = color
self.contents.draw_text(206, 0, 36, 32, @new_atk.to_s, 2)
end
if @new_pdef != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 32, 36, 32, ">>", 2)
if @new_pdef > @actor.pdef
color = plus_color
elsif @new_pdef < @actor.pdef
color = minus_color
else
color = normal_color
end
self.contents.font.color = color
self.contents.draw_text(206, 32, 36, 32, @new_pdef.to_s, 2)
end
if @new_mdef != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 64, 36, 32, ">>", 2)
if @new_mdef > @actor.mdef
color = plus_color
elsif @new_mdef < @actor.mdef
color = minus_color
else
color = normal_color
end
self.contents.font.color = color
self.contents.draw_text(206, 64, 36, 32, @new_mdef.to_s, 2)
end
if @new_str != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 96, 36, 32, ">>", 2)
if @new_str > @actor.str
color = plus_color
elsif @new_str < @actor.str
color = minus_color
else
color = normal_color
end
self.contents.font.color = color
self.contents.draw_text(206, 96, 36, 32, @new_str.to_s, 2)
end
if @new_dex != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 128, 36, 32, ">>", 2)
if @new_dex > @actor.dex
color = plus_color
elsif @new_dex < @actor.dex
color = minus_color
else
color = normal_color
end
self.contents.font.color = color
self.contents.draw_text(206, 128, 36, 32, @new_dex.to_s, 2)
end
if @new_agi != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 160, 36, 32, ">>", 2)
if @new_agi > @actor.agi
color = plus_color
elsif @new_agi < @actor.agi
color = minus_color
else
color = normal_color
end
self.contents.font.color = color
self.contents.draw_text(206, 160, 36, 32, @new_agi.to_s, 2)
end
if @new_int != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 192, 36, 32, ">>", 2)
if @new_int > @actor.int
color = plus_color
elsif @new_int < @actor.int
color = minus_color
else
color = normal_color
end
self.contents.font.color = color
self.contents.draw_text(206, 192, 36, 32, @new_int.to_s, 2)
end
end
#--------------------------------------------------------------------------
# * Set parameters after changing equipment
#--------------------------------------------------------------------------
def set_new_parameters(new_atk, new_pdef, new_mdef, new_str, new_dex, new_agi, new_int)
if @new_atk != new_atk or @new_pdef != new_pdef or @new_mdef != new_mdef or @new_str != new_str or @new_dex != new_dex or @new_agi != new_agi or @new_int != new_int
@new_atk = new_atk
@new_pdef = new_pdef
@new_mdef = new_mdef
@new_str = new_str
@new_dex = new_dex
@new_agi = new_agi
@new_int = new_int
refresh
end
end
end
#==============================================================================
# ** Window_Equipment
#==============================================================================
class Window_Equipment < Window_Selectable
#--------------------------------------------------------------------------
# * Initialization
#--------------------------------------------------------------------------
def initialize(actor)
super(640, 192, 320, 288)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 255
@actor = actor
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# * Item Acquisition
#--------------------------------------------------------------------------
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.name = CMS::Font_Name
self.contents.font.size = CMS::Font_Size
@data = []
@data.push($data_weapons[@actor.weapon_id])
@data.push($data_armors[@actor.armor1_id])
@data.push($data_armors[@actor.armor2_id])
@data.push($data_armors[@actor.armor3_id])
@data.push($data_armors[@actor.armor4_id])
@item_max = @data.size
self.contents.font.color = special_color
self.contents.draw_text(0, 0, 160, 32, $data_system.words.weapon)
self.contents.draw_text(0, 48, 160, 32, $data_system.words.armor1)
self.contents.draw_text(0, 96, 160, 32, $data_system.words.armor2)
self.contents.draw_text(0, 144, 160, 32, $data_system.words.armor3)
self.contents.draw_text(0, 192, 160, 32, $data_system.words.armor4)
draw_item_name(@data[0], 0, 24)
draw_item_name(@data[1], 0, 72)
draw_item_name(@data[2], 0, 120)
draw_item_name(@data[3], 0, 168)
draw_item_name(@data[4], 0, 216)
end
#--------------------------------------------------------------------------
# * Help Text Update
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
end
#--------------------------------------------------------------------------
# * Cursor Rectangle Update
#--------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(-4, 24 + @index * 48, self.width - 96, 30)
end
end
end
#==============================================================================
# ** Window_Equipment_Status
#==============================================================================
class Window_Equipment_Status < Window_Base
#--------------------------------------------------------------------------
# * Initialization
#--------------------------------------------------------------------------
def initialize(actor)
super(640, 64, 320, 128)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = CMS::Font_Name
self.contents.font.size = CMS::Font_Size
self.opacity = 255
@actor = actor
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_actor_name(@actor, 0, 0)
draw_actor_hp_bar(@actor, 0, 32)
draw_actor_sp_bar(@actor, 0, 64)
draw_actor_level(@actor, 160, 0)
end
end
#==============================================================================
# ** Window_EquipItem
#==============================================================================
class Window_EquipItem < Window_Selectable
#--------------------------------------------------------------------------
# * Initialization
#--------------------------------------------------------------------------
def initialize(actor, equip_type)
super(960, 64, 320, 416)
self.opacity = 255
@actor = actor
@equip_type = equip_type
@column_max = 1
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# * Item Acquisition
#--------------------------------------------------------------------------
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
if @equip_type == 0
weapon_set = $data_classes[@actor.class_id].weapon_set
for i in 1...$data_weapons.size
if $game_party.weapon_number(i) > 0 and weapon_set.include?(i)
@data.push($data_weapons[i])
end
end
end
if @equip_type != 0
armor_set = $data_classes[@actor.class_id].armor_set
for i in 1...$data_armors.size
if $game_party.armor_number(i) > 0 and armor_set.include?(i)
if $data_armors[i].kind == @equip_type-1
@data.push($data_armors[i])
end
end
end
end
@data.push(nil)
@item_max = @data.size
self.contents = Bitmap.new(width - 32, row_max * 32)
(0...@item_max-1).each {|i| draw_item(i)}
self.contents.font.color = system_color
self.contents.font.name = CMS::Font_Name
self.contents.font.size = CMS::Font_Size
self.contents.draw_text(4, (@item_max - 1) * 32, 100, 32, "Unequip")
end
#--------------------------------------------------------------------------
# * Draw Item
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
x = 4 + index % 1 * (288 + 32)
y = index / 1 * 32
case item
when RPG::Weapon
number = $game_party.weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
end
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
self.contents.font.color = normal_color
self.contents.font.name = CMS::Font_Name
self.contents.font.size = CMS::Font_Size
self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
end
#--------------------------------------------------------------------------
# * Help Text Update
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
end
#--------------------------------------------------------------------------
# * Item Max
#--------------------------------------------------------------------------
def item_max
return @item_max
end
end
#==============================================================================
# ** Window_EquipHelp
#==============================================================================
class Window_EquipHelp < Window_Base
#--------------------------------------------------------------------------
# * Initialization
#--------------------------------------------------------------------------
def initialize
super(640, 0, 640, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = CMS::Font_Name
self.contents.font.size = CMS::Font_Size
self.opacity = 255
end
#--------------------------------------------------------------------------
# * Set Text
#--------------------------------------------------------------------------
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(0, 0, self.width - 40, 32, text, align)
@text = text
@align = align
@actor = nil
end
self.visible = true
end
end
#==============================================================================
# ** Window_Status_Parameter
#==============================================================================
class Window_Status_Parameter < Window_Base
#--------------------------------------------------------------------------
# * Initialization
#--------------------------------------------------------------------------
def initialize(actor)
super(640, 64, 320, 416)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = CMS::Font_Name
self.contents.font.size = CMS::Font_Size
self.opacity = 255
@actor = actor
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_actor_graphic(@actor, 156, 64)
draw_actor_name(@actor, 0, 0)
draw_actor_class(@actor, 0, 32)
draw_actor_level(@actor, 0, 64)
draw_actor_hp_bar(@actor, 0, 96, 172)
draw_actor_sp_bar(@actor, 0, 128, 172)
draw_actor_parameter(@actor, 0, 160, 0)
draw_actor_parameter(@actor, 0, 192, 1)
draw_actor_parameter(@actor, 0, 224, 2)
draw_actor_parameter(@actor, 0, 256, 3)
draw_actor_parameter(@actor, 0, 288, 4)
draw_actor_parameter(@actor, 0, 320, 5)
draw_actor_parameter(@actor, 0, 352, 6)
end
end
#==============================================================================
# ** Window_Status_Equipment
#==============================================================================
class Window_Status_Equipment < Window_Base
#--------------------------------------------------------------------------
# * Initialization
#--------------------------------------------------------------------------
def initialize(actor)
super(960, 192, 320, 288)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = CMS::Font_Name
self.contents.font.size = CMS::Font_Size
self.opacity = 255
@actor = actor
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.font.color = special_color
self.contents.draw_text(0, 0, 160, 34, $data_system.words.weapon)
self.contents.draw_text(0, 48, 160, 32, $data_system.words.armor1)
self.contents.draw_text(0, 96, 160, 32, $data_system.words.armor2)
self.contents.draw_text(0, 144, 160, 32, $data_system.words.armor3)
self.contents.draw_text(0, 192, 160, 32, $data_system.words.armor4)
self.contents.font.color = normal_color
draw_item_name($data_weapons[@actor.weapon_id], 0, 24)
draw_item_name($data_armors[@actor.armor1_id], 0, 72)
draw_item_name($data_armors[@actor.armor2_id], 0, 120)
draw_item_name($data_armors[@actor.armor3_id], 0, 168)
draw_item_name($data_armors[@actor.armor4_id], 0, 216)
end
end
#==============================================================================
# ** Window_Status_Exp
#==============================================================================
class Window_Status_Exp < Window_Base
#--------------------------------------------------------------------------
# * Initialization
#--------------------------------------------------------------------------
def initialize(actor)
super(960, 64, 320, 128)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = CMS::Font_Name
self.contents.font.size = CMS::Font_Size
self.opacity = 255
@actor = actor
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.font.color = system_color
self.contents.draw_text(0, 0, 128, 32, "State:")
draw_actor_state(@actor, 192, 0)
draw_actor_current_exp(@actor, 0, 32)
draw_actor_exp_bar(@actor, 0, 64)
end
end
#==============================================================================
# ** Window_Status_Help
#==============================================================================
class Window_Status_Help < Window_Base
#--------------------------------------------------------------------------
# * Initialization
#--------------------------------------------------------------------------
def initialize(actor)
super(640, 0, 640, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = CMS::Font_Name
self.contents.font.size = CMS::Font_Size
self.opacity = 255
@actor = actor
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
if @actor.id == 1
self.contents.font.color = system_color
self.contents.draw_text(0, 0, 640, 32, "Aluxes' Status Overview.")
end
if @actor.id == 2
self.contents.font.color = system_color
self.contents.draw_text(0, 0, 640, 32, "Basil's Status Overview.")
end
if @actor.id == 3
self.contents.font.color = system_color
self.contents.draw_text(0, 0, 640, 32, "Cyrus' Status Overview.")
end
if @actor.id == 4
self.contents.font.color = system_color
self.contents.draw_text(0, 0, 640, 32, "Dorothy's Status Overview.")
end
if @actor.id == 5
self.contents.font.color = system_color
self.contents.draw_text(0, 0, 640, 32, "Esttele's Status Overview.")
end
if @actor.id == 6
self.contents.font.color = system_color
self.contents.draw_text(0, 0, 640, 32, "Felix's Status Overview.")
end
if @actor.id == 7
self.contents.font.color = system_color
self.contents.draw_text(0, 0, 640, 32, "Gloria's Status Overview.")
end
if @actor.id == 8
self.contents.font.color = system_color
self.contents.draw_text(0, 0, 640, 32, "Hilda's Status Overview.")
end
end
end
#==============================================================================
# ** Scene_Menu
#==============================================================================
class Scene_Menu
#--------------------------------------------------------------------------
# * Initialization
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
@update_frame = 0
@spriteset = Spriteset_Map.new
@viewport = Viewport.new(0, 0, 640, 480)
@viewport.tone = Tone.new(0, 0, 0,166)
@command_window = Window_New_Command.new(@menu_index)
@command_window.index = @menu_index
@command_window.x = 640
@command_window.y = 0
if $game_party.actors.size == 0
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
if $game_system.save_disabled
@command_window.disable_item(4)
end
@status_window = Window_Menu_Status.new
@status_window.x = -480
@status_window.y = 0
@player_stats_window = Window_Player_Status.new
@player_stats_window.x = 0
@player_stats_window.y = 480
if $game_party.actors.size == 1
@window_sprite1 = Window_Sprite1.new
@window_sprite1.frame_update
elsif $game_party.actors.size == 2
@window_sprite1 = Window_Sprite1.new
@window_sprite1.frame_update
@window_sprite2 = Window_Sprite2.new
@window_sprite2.frame_update
elsif $game_party.actors.size == 3
@window_sprite1 = Window_Sprite1.new
@window_sprite1.frame_update
@window_sprite2 = Window_Sprite2.new
@window_sprite2.frame_update
@window_sprite3 = Window_Sprite3.new
@window_sprite3.frame_update
elsif $game_party.actors.size == 4
@window_sprite1 = Window_Sprite1.new
@window_sprite1.frame_update
@window_sprite2 = Window_Sprite2.new
@window_sprite2.frame_update
@window_sprite3 = Window_Sprite3.new
@window_sprite3.frame_update
@window_sprite4 = Window_Sprite4.new
@window_sprite4.frame_update
end
@command_exit_window = Window_New_Command_Exit.new(@menu_index)
@command_exit_window.index = @menu_index
Graphics.transition(CMS::Transition_Wait, CMS::Transition)
loop do
Graphics.update
Input.update
@update_frame += 1
if @update_frame == 10
@update_frame = 0
if $game_party.actors.size == 1
@window_sprite1.frame_update
elsif $game_party.actors.size == 2
@window_sprite1.frame_update
@window_sprite2.frame_update
elsif $game_party.actors.size == 3
@window_sprite1.frame_update
@window_sprite2.frame_update
@window_sprite3.frame_update
elsif $game_party.actors.size == 4
@window_sprite1.frame_update
@window_sprite2.frame_update
@window_sprite3.frame_update
@window_sprite4.frame_update
end
end
update
if $scene != self
break
end
end
Graphics.freeze
@spriteset.dispose
@viewport.dispose
@command_window.dispose
@status_window.dispose
@player_stats_window.dispose
@command_exit_window.dispose
if $game_party.actors.size == 1
@window_sprite1.dispose
elsif $game_party.actors.size == 2
@window_sprite1.dispose
@window_sprite2.dispose
elsif $game_party.actors.size == 3
@window_sprite1.dispose
@window_sprite2.dispose
@window_sprite3.dispose
elsif $game_party.actors.size == 4
@window_sprite1.dispose
@window_sprite2.dispose
@window_sprite3.dispose
@window_sprite4.dispose
end
end
#--------------------------------------------------------------------------
# * Defining the delay
#--------------------------------------------------------------------------
def delay(seconds)
for i in 0...(seconds * 1)
sleep 0.01
Graphics.update
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
@command_window.update
@status_window.update
@player_stats_window.update
@command_exit_window.update
if @command_window.x > 480
@command_window.x -= 40
end
if @player_stats_window.y > 384
@player_stats_window.y -= 32
end
if @status_window.x < 0
@status_window.x += 40
end
if $game_party.actors.size == 1
if @window_sprite1.x < 0
@window_sprite1.x += 40
end
elsif $game_party.actors.size == 2
if @window_sprite1.x < 0
@window_sprite1.x += 40
end
if @window_sprite2.x < 0
@window_sprite2.x += 40
end
elsif $game_party.actors.size == 3
if @window_sprite1.x < 0
@window_sprite1.x += 40
end
if @window_sprite2.x < 0
@window_sprite2.x += 40
end
if @window_sprite3.x < 0
@window_sprite3.x += 40
end
elsif $game_party.actors.size == 4
if @window_sprite1.x < 0
@window_sprite1.x += 40
end
if @window_sprite2.x < 0
@window_sprite2.x += 40
end
if @window_sprite3.x < 0
@window_sprite3.x += 40
end
if @window_sprite4.x < 0
@window_sprite4.x += 40
end
end
#------------------------------------------------------------------------
# If command window is active: call update_command
#------------------------------------------------------------------------
if @command_window.active
update_command
return
end
#------------------------------------------------------------------------
# If exit command window is active: call update_command
#------------------------------------------------------------------------
if @command_exit_window.active
if @command_exit_window.x > 480
@command_exit_window.x -= 40
end
update_exit
return
end
#------------------------------------------------------------------------
# If status window is active: call update_status
#------------------------------------------------------------------------
if @status_window.active
update_status
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when command window is active)
#--------------------------------------------------------------------------
def update_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
loop do
if @command_window.x < 640
@command_window.x += 40
end
if @player_stats_window.y < 480
@player_stats_window.y += 32
end
if @status_window.x > -480
@status_window.x -= 60
end
if $game_party.actors.size == 1
if @window_sprite1.x > -480
@window_sprite1.x -= 60
end
elsif $game_party.actors.size == 2
if @window_sprite1.x > -480
@window_sprite1.x -= 60
end
if @window_sprite2.x > -480
@window_sprite2.x -= 60
end
elsif $game_party.actors.size == 3
if @window_sprite1.x > -480
@window_sprite1.x -= 60
end
if @window_sprite2.x > -480
@window_sprite2.x -= 60
end
if @window_sprite3.x > -480
@window_sprite3.x -= 60
end
elsif $game_party.actors.size == 4
if @window_sprite1.x > -480
@window_sprite1.x -= 60
end
if @window_sprite2.x > -480
@window_sprite2.x -= 60
end
if @window_sprite3.x > -480
@window_sprite3.x -= 60
end
if @window_sprite4.x > -480
@window_sprite4.x -= 60
end
end
delay(0.01)
if @command_window.x >= 640
if @status_window.x <= -480
break
end
end
end
$scene = Scene_Map.new
return
end
if Input.trigger?(Input::C)
if $game_party.actors.size == 0 and @command_window.index < 4
$game_system.se_play($data_system.buzzer_se)
return
end
case @command_window.index
when 0
$game_system.se_play($data_system.decision_se)
$scene = Scene_Item.new
when 1
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 2
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 3
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 4
$game_system.se_play($data_system.decision_se)
@command_exit_window.visible = true
@command_exit_window.active = true
@command_exit_window.index = 0
@command_window.active = false
end
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when status window is active)
#--------------------------------------------------------------------------
def update_status
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
@status_window.active = false
@status_window.index = -1
return
end
if Input.trigger?(Input::C)
case @command_window.index
when 1
if $game_party.actors[@status_window.index].restriction >= 2
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
loop do
if @command_window.x < 640
@command_window.x += 40
end
if @player_stats_window.y < 480
@player_stats_window.y += 32
end
if @status_window.x > -480
@status_window.x -= 60
end
if $game_party.actors.size == 1
if @window_sprite1.x > -480
@window_sprite1.x -= 60
end
elsif $game_party.actors.size == 2
if @window_sprite1.x > -480
@window_sprite1.x -= 60
end
if @window_sprite2.x > -480
@window_sprite2.x -= 60
end
elsif $game_party.actors.size == 3
if @window_sprite1.x > -480
@window_sprite1.x -= 60
end
if @window_sprite2.x > -480
@window_sprite2.x -= 60
end
if @window_sprite3.x > -480
@window_sprite3.x -= 60
end
elsif $game_party.actors.size == 4
if @window_sprite1.x > -480
@window_sprite1.x -= 60
end
if @window_sprite2.x > -480
@window_sprite2.x -= 60
end
if @window_sprite3.x > -480
@window_sprite3.x -= 60
end
if @window_sprite4.x > -480
@window_sprite4.x -= 60
end
end
delay(0.01)
if @command_window.x >= 640
if @status_window.x <= -480
break
end
end
end
$scene = Scene_New_Skill.new(@status_window.index)
when 2
$game_system.se_play($data_system.decision_se)
loop do
if @command_window.x < 640
@command_window.x += 40
end
if @player_stats_window.y < 480
@player_stats_window.y += 32
end
if @status_window.x > -480
@status_window.x -= 60
end
if $game_party.actors.size == 1
if @window_sprite1.x > -480
@window_sprite1.x -= 60
end
elsif $game_party.actors.size == 2
if @window_sprite1.x > -480
@window_sprite1.x -= 60
end
if @window_sprite2.x > -480
@window_sprite2.x -= 60
end
elsif $game_party.actors.size == 3
if @window_sprite1.x > -480
@window_sprite1.x -= 60
end
if @window_sprite2.x > -480
@window_sprite2.x -= 60
end
if @window_sprite3.x > -480
@window_sprite3.x -= 60
end
elsif $game_party.actors.size == 4
if @window_sprite1.x > -480
@window_sprite1.x -= 60
end
if @window_sprite2.x > -480
@window_sprite2.x -= 60
end
if @window_sprite3.x > -480
@window_sprite3.x -= 60
end
if @window_sprite4.x > -480
@window_sprite4.x -= 60
end
end
delay(0.01)
if @command_window.x >= 640
if @status_window.x <= -480
break
end
end
end
$scene = Scene_New_Equip.new(@status_window.index)
when 3
$game_system.se_play($data_system.decision_se)
loop do
if @command_window.x < 640
@command_window.x += 40
end
if @player_stats_window.y < 480
@player_stats_window.y += 32
end
if @status_window.x > -480
@status_window.x -= 60
end
if $game_party.actors.size == 1
if @window_sprite1.x > -480
@window_sprite1.x -= 60
end
elsif $game_party.actors.size == 2
if @window_sprite1.x > -480
@window_sprite1.x -= 60
end
if @window_sprite2.x > -480
@window_sprite2.x -= 60
end
elsif $game_party.actors.size == 3
if @window_sprite1.x > -480
@window_sprite1.x -= 60
end
if @window_sprite2.x > -480
@window_sprite2.x -= 60
end
if @window_sprite3.x > -480
@window_sprite3.x -= 60
end
elsif $game_party.actors.size == 4
if @window_sprite1.x > -480
@window_sprite1.x -= 60
end
if @window_sprite2.x > -480
@window_sprite2.x -= 60
end
if @window_sprite3.x > -480
@window_sprite3.x -= 60
end
if @window_sprite4.x > -480
@window_sprite4.x -= 60
end
end
delay(0.01)
if @command_window.x >= 640
if @status_window.x <= -480
break
end
end
end
$scene = Scene_New_Status.new(@status_window.index)
end
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when exit window is active)
#--------------------------------------------------------------------------
def update_exit
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
loop do
if @command_exit_window.x < 640
@command_exit_window.x += 40
end
delay(0.01)
if @command_exit_window.x >= 640
break
end
end
@command_window.active = true
@command_exit_window.active = false
return
end
if Input.trigger?(Input::C)
case @command_exit_window.index
when 0
command_to_title
when 1
command_cancel
when 2
command_shutdown
end
return
end
end
def command_to_title
$game_system.se_play($data_system.decision_se)
Audio.bgm_fade(800)
Audio.bgs_fade(800)
Audio.me_fade(800)
$scene = Scene_Title.new
end
def command_cancel
$game_system.se_play($data_system.decision_se)
loop do
if @command_window.x < 640
@command_window.x += 60
end
if @player_stats_window.y < 480
@player_stats_window.y += 32
end
if @status_window.x > -480
@status_window.x -= 60
end
if $game_party.actors.size == 1
if @window_sprite1.x > -480
@window_sprite1.x -= 60
end
elsif $game_party.actors.size == 2
if @window_sprite1.x > -480
@window_sprite1.x -= 60
end
if @window_sprite2.x > -480
@window_sprite2.x -= 60
end
elsif $game_party.actors.size == 3
if @window_sprite1.x > -480
@window_sprite1.x -= 60
end
if @window_sprite2.x > -480
@window_sprite2.x -= 60
end
if @window_sprite3.x > -480
@window_sprite3.x -= 60
end
elsif $game_party.actors.size == 4
if @window_sprite1.x > -480
@window_sprite1.x -= 60
end
if @window_sprite2.x > -480
@window_sprite2.x -= 60
end
if @window_sprite3.x > -480
@window_sprite3.x -= 60
end
if @window_sprite4.x > -480
@window_sprite4.x -= 60
end
end
if @command_exit_window.x < 640
@command_exit_window.x += 40
end
delay(0.01)
if @command_window.x >= 640
if @status_window.x <= -480
if @command_exit_window.x >= 640
break
end
end
end
end
$scene = Scene_Map.new
end
def command_shutdown
$game_system.se_play($data_system.decision_se)
Audio.bgm_fade(800)
Audio.bgs_fade(800)
Audio.me_fade(800)
$scene = nil
end
end
#==============================================================================
# ** Scene_New_Skill
#==============================================================================
class Scene_New_Skill
#--------------------------------------------------------------------------
# * Initialization
#--------------------------------------------------------------------------
def initialize(actor_index = 0, equip_index = 0)
@actor_index = actor_index
end
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
@spriteset = Spriteset_Map.new
@viewport = Viewport.new(0, 0, 640, 480)
@viewport.tone = Tone.new(0, 0, 0,166)
@actor = $game_party.actors[@actor_index]
@help_window = Window_SkillHelp.new
@status_window = Window_Skill_Status.new(@actor)
@skill_window = Window_Skill.new(@actor)
@skill_window.help_window = @help_window
@detail_window = Window_Skill_Detail.new(@skill_window.skill)
@target_window = Window_Skill_Target.new
@target_window.x = 640
@target_window.active = false
Graphics.transition(CMS::Transition_Wait, CMS::Transition)
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@spriteset.dispose
@viewport.dispose
@help_window.dispose
@status_window.dispose
@skill_window.dispose
@target_window.dispose
@detail_window.dispose
end
#--------------------------------------------------------------------------
# * Defining the delay
#--------------------------------------------------------------------------
def delay(seconds)
for i in 0...(seconds * 1)
sleep 0.01
Graphics.update
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
@help_window.update
@status_window.update
@skill_window.update
@target_window.update
@detail_window.update
if @help_window.x > 0
@help_window.x -= 40
end
if @status_window.x > 0
@status_window.x -= 40
end
if @skill_window.x > 320
@skill_window.x -= 40
end
if @detail_window.x > 0
@detail_window.x -= 40
end
#------------------------------------------------------------------------
# If skill window is active: call update_skill
#------------------------------------------------------------------------
if @skill_window.active
update_skill
return
end
#------------------------------------------------------------------------
# If skill target is active: call update_target
#------------------------------------------------------------------------
if @target_window.active
if @target_window.x > 320
@target_window.x -= 40
end
update_target
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (if skill window is active)
#--------------------------------------------------------------------------
def update_skill
if Input.trigger?(Input::UP) or Input.trigger?(Input::DOWN)
@detail_window.refresh(@skill_window.skill)
end
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
loop do
if @help_window.x < 640
@help_window.x += 60
end
if @status_window.x < 640
@status_window.x += 60
end
if @skill_window.x < 640
@skill_window.x += 60
end
if @detail_window.x < 640
@detail_window.x += 60
end
delay(0.01)
if @help_window.x >= 640
if @status_window.x >= 640
if @skill_window.x >= 640
if @detail_window.x >= 640
break
end
end
end
end
end
$scene = Scene_Menu.new(1)
return
end
if Input.trigger?(Input::C)
@skill = @skill_window.skill
if @skill == nil or not @actor.skill_can_use?(@skill.id)
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
if @skill.scope >= 3
@skill_window.active = false
@target_window.active = true
if @skill.scope == 4 || @skill.scope == 6
@target_window.index = -1
elsif @skill.scope == 7
@target_window.index = @actor_index - 10
else
@target_window.index = 0
end
else
if @skill.common_event_id > 0
$game_temp.common_event_id = @skill.common_event_id
$game_system.se_play(@skill.menu_se)
@actor.sp -= @skill.sp_cost
@status_window.refresh
@skill_window.refresh
@target_window.refresh
$scene = Scene_Map.new
return
end
end
return
end
if Input.trigger?(Input::R)
if $game_party.actors.size == 1
$game_system.se_play($data_system.buzzer_se)
else
$game_system.se_play($data_system.decision_se)
@actor_index += 1
@actor_index %= $game_party.actors.size
$scene = Scene_New_Skill.new(@actor_index)
end
return
end
if Input.trigger?(Input::L)
if $game_party.actors.size == 1
$game_system.se_play($data_system.buzzer_se)
else
$game_system.se_play($data_system.cursor_se)
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
$scene = Scene_New_Skill.new(@actor_index)
end
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when target window is active)
#--------------------------------------------------------------------------
def update_target
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
loop do
if @target_window.x < 640
@target_window.x += 40
end
delay(0.01)
if @target_window.x >= 640
break
end
end
@skill_window.active = true
@target_window.active = false
return
end
if Input.trigger?(Input::C)
unless @actor.skill_can_use?(@skill.id)
$game_system.se_play($data_system.buzzer_se)
return
end
if @target_window.index == -1
used = false
for i in $game_party.actors
used |= i.skill_effect(@actor, @skill)
end
end
if @target_window.index <= -2
target = $game_party.actors[@target_window.index + 10]
used = target.skill_effect(@actor, @skill)
end
if @target_window.index >= 0
target = $game_party.actors[@target_window.index]
used = target.skill_effect(@actor, @skill)
end
if used
$game_system.se_play(@skill.menu_se)
@actor.sp -= @skill.sp_cost
@status_window.refresh
@skill_window.refresh
@target_window.refresh
if $game_party.all_dead?
$scene = Scene_Gameover.new
return
end
if @skill.common_event_id > 0
$game_temp.common_event_id = @skill.common_event_id
$scene = Scene_Map.new
return
end
end
unless used
$game_system.se_play($data_system.buzzer_se)
end
return
end
end
end
#==============================================================================
# ** Scene_New_Equip
#==============================================================================
class Scene_New_Equip
#--------------------------------------------------------------------------
# * Initialization
#--------------------------------------------------------------------------
def initialize(actor_index = 0, equip_index = 0)
@actor_index = actor_index
@equip_index = equip_index
end
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
@spriteset = Spriteset_Map.new
@viewport = Viewport.new(0, 0, 640, 480)
@viewport.tone = Tone.new(0, 0, 0,166)
@actor = $game_party.actors[@actor_index]
@help_window = Window_EquipHelp.new
@left_window = Window_Equip_Parameter.new(@actor)
@left_window.visible = false
@stats_window = Window_Equipment_Status.new(@actor)
@right_window = Window_Equipment.new(@actor)
@item_window1 = Window_EquipItem.new(@actor, 0)
@item_window2 = Window_EquipItem.new(@actor, 1)
@item_window3 = Window_EquipItem.new(@actor, 2)
@item_window4 = Window_EquipItem.new(@actor, 3)
@item_window5 = Window_EquipItem.new(@actor, 4)
@right_window.help_window = @help_window
@item_window1.help_window = @help_window
@item_window2.help_window = @help_window
@item_window3.help_window = @help_window
@item_window4.help_window = @help_window
@item_window5.help_window = @help_window
@right_window.index = @equip_index
refresh
Graphics.transition(CMS::Transition_Wait, CMS::Transition)
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@spriteset.dispose
@viewport.dispose
@help_window.dispose
@left_window.dispose
@right_window.dispose
@item_window1.dispose
@item_window2.dispose
@item_window3.dispose
@item_window4.dispose
@item_window5.dispose
@stats_window.dispose
end
#--------------------------------------------------------------------------
# * Defining the delay
#--------------------------------------------------------------------------
def delay(seconds)
for i in 0...(seconds * 1)
sleep 0.01
Graphics.update
end
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
@item_window1.visible = (@right_window.index == 0)
@item_window2.visible = (@right_window.index == 1)
@item_window3.visible = (@right_window.index == 2)
@item_window4.visible = (@right_window.index == 3)
@item_window5.visible = (@right_window.index == 4)
item1 = @right_window.item
case @right_window.index
when 0
@item_window = @item_window1
when 1
@item_window = @item_window2
when 2
@item_window = @item_window3
when 3
@item_window = @item_window4
when 4
@item_window = @item_window5
end
if @right_window.active
@left_window.set_new_parameters(nil, nil, nil, nil, nil, nil, nil)
end
if @item_window.active
item2 = @item_window.item
last_hp = @actor.hp
last_sp = @actor.sp
@actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
new_atk = @actor.atk
new_pdef = @actor.pdef
new_mdef = @actor.mdef
new_str = @actor.str
new_dex = @actor.dex
new_agi = @actor.agi
new_int = @actor.int
@actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
@actor.hp = last_hp
@actor.sp = last_sp
@left_window.set_new_parameters(new_atk, new_pdef, new_mdef, new_str, new_dex, new_agi, new_int)
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
@left_window.update
@right_window.update
@item_window.update
@stats_window.update
if @stats_window.x > 0
@stats_window.x -= 40
end
if @help_window.x > 0
@help_window.x -= 40
end
if @left_window.x > 0
@left_window.x -= 40
end
if @right_window.x > 0
@right_window.x -= 40
end
if @item_window1.x > 320
@item_window1.x -= 40
end
if @item_window2.x > 320
@item_window2.x -= 40
end
if @item_window3.x > 320
@item_window3.x -= 40
end
if @item_window4.x > 320
@item_window4.x -= 40
end
if @item_window5.x > 320
@item_window5.x -= 40
end
refresh
#------------------------------------------------------------------------
# If right window is active: call update_right
#------------------------------------------------------------------------
if @right_window.active
update_right
return
end
#------------------------------------------------------------------------
# If item window is active: call update_item
#------------------------------------------------------------------------
if @item_window.active
update_item
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when right window is active)
#--------------------------------------------------------------------------
def update_right
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
loop do
if @stats_window.x < 640
@stats_window.x += 60
end
if @help_window.x < 640
@help_window.x += 60
end
if @left_window.x < 640
@left_window.x += 60
end
if @right_window.x < 640
@right_window.x += 60
end
if @item_window1.x < 640
@item_window1.x += 60
end
if @item_window2.x < 640
@item_window2.x += 60
end
if @item_window3.x < 640
@item_window3.x += 60
end
if @item_window4.x < 640
@item_window4.x += 60
end
if @item_window5.x < 640
@item_window5.x += 60
end
delay(0.01)
if @stats_window.x >= 640
if @help_window.x >= 640
if @left_window.x >= 640
if @right_window.x >= 640
if @item_window1.x >= 640
if @item_window2.x >= 640
if @item_window3.x >= 640
if @item_window4.x >= 640
if @item_window5.x >= 640
break
end
end
end
end
end
end
end
end
end
end
@left_window.visible = false
$scene = Scene_Menu.new(2)
return
end
if Input.trigger?(Input::C)
if @actor.equip_fix?(@right_window.index)
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
@right_window.active = false
@right_window.visible = false
@item_window.active = true
@item_window.index = 0
@left_window.visible = true
return
end
if Input.trigger?(Input::R)
if $game_party.actors.size == 1
$game_system.se_play($data_system.buzzer_se)
else
$game_system.se_play($data_system.decision_se)
@actor_index += 1
@actor_index %= $game_party.actors.size
$scene = Scene_New_Equip.new(@actor_index, @right_window.index)
end
return
end
if Input.trigger?(Input::L)
if $game_party.actors.size == 1
$game_system.se_play($data_system.buzzer_se)
else
$game_system.se_play($data_system.cursor_se)
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
$scene = Scene_New_Equip.new(@actor_index, @right_window.index)
end
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when item window is active)
#--------------------------------------------------------------------------
def update_item
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@right_window.active = true
@right_window.visible = true
@item_window.active = false
@item_window.index = -1
@left_window.visible = false
return
end
if Input.trigger?(Input::C)
$game_system.se_play($data_system.equip_se)
item = @item_window.item
@actor.equip(@right_window.index, item == nil ? 0 : item.id)
@right_window.active = true
@right_window.visible = true
@left_window.visible = false
@item_window.active = false
@item_window.index = -1
@right_window.refresh
@item_window.refresh
return
end
end
end
#==============================================================================
# ** Scene_New_Status
#==============================================================================
class Scene_New_Status
#--------------------------------------------------------------------------
# * Initialization
#--------------------------------------------------------------------------
def initialize(actor_index = 0, equip_index = 0)
@actor_index = actor_index
end
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
@spriteset = Spriteset_Map.new
@viewport = Viewport.new(0, 0, 640, 480)
@viewport.tone = Tone.new(0, 0, 0,166)
@actor = $game_party.actors[@actor_index]
@status_para_window = Window_Status_Parameter.new(@actor)
@status_equipment_window = Window_Status_Equipment.new(@actor)
@status_help_window = Window_Status_Help.new(@actor)
@status_exp_window = Window_Status_Exp.new(@actor)
Graphics.transition(CMS::Transition_Wait, CMS::Transition)
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@spriteset.dispose
@viewport.dispose
@status_para_window.dispose
@status_equipment_window.dispose
@status_help_window.dispose
@status_exp_window.dispose
end
#--------------------------------------------------------------------------
# * Defining the delay
#--------------------------------------------------------------------------
def delay(seconds)
for i in 0...(seconds * 1)
sleep 0.01
Graphics.update
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
if @status_para_window.x > 0
@status_para_window.x -= 40
end
if @status_help_window.x > 0
@status_help_window.x -= 40
end
if @status_equipment_window.x > 320
@status_equipment_window.x -= 40
end
if @status_exp_window.x > 320
@status_exp_window.x -= 40
end
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
loop do
if @status_para_window.x < 640
@status_para_window.x += 60
end
if @status_help_window.x < 640
@status_help_window.x += 60
end
if @status_equipment_window.x < 640
@status_equipment_window.x += 60
end
if @status_exp_window.x < 640
@status_exp_window.x += 60
end
delay(0.01)
if @status_para_window.x >= 640
if @status_help_window.x >= 640
if @status_equipment_window.x >= 640
if @status_exp_window.x >= 640
break
end
end
end
end
end
$scene = Scene_Menu.new(3)
return
end
if Input.trigger?(Input::R)
if $game_party.actors.size == 1
$game_system.se_play($data_system.buzzer_se)
else
$game_system.se_play($data_system.decision_se)
@actor_index += 1
@actor_index %= $game_party.actors.size
$scene = Scene_New_Status.new(@actor_index)
end
return
end
if Input.trigger?(Input::L)
if $game_party.actors.size == 1
$game_system.se_play($data_system.buzzer_se)
else
$game_system.se_play($data_system.cursor_se)
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
$scene = Scene_New_Status.new(@actor_index)
end
return
end
end
end
#------------------------------------------------------------------------------
# * End SDK Enable Test
#------------------------------------------------------------------------------
end
|