02-10-2006, 01:00 PM
(This post was last modified: 07-23-2017, 04:40 AM by DerVVulfman.)
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.
New and improved version 3!
*Requires SDK v1.3 [included in demo]
Many new features!
* Alter Equip Slot Names (even in-game!)
* Change plus_color, minus_color, process_color, and normal_color of updating stats!
* Use flags to show only the stats you want to!
* Now 4 layouts! (new additions are mirrored versions!)..more to come...
Post the following above main **Requires SDK v1.3 [included in demo]
AES - Advanced Equip Screen
#==============================================================================
# ■ AES - Advanced Equip Screen
#------------------------------------------------------------------------------
# SIBruno
# Version 3
# 2.10.06
#==============================================================================
# Created Entirely by SIBruno
# shaun.bruno@mail.utexas.edu
# Use freely and give credit! :)
#
# Special Thanks:
# Creation Asylum
#==============================================================================
# Supported Layouts:
#
# [Default: PhotonWeapon Inspired] #0
# * Maintained default window sizes
# * Character sprite removed
# * Character hp and sp removed
# * Character lvl included
#
# [SIBruno Custom] #1
# * Altered Window Sizes
# * Left Window Shows Character Sprites
# * HP/SP Displayed
#
# [Mirror of Default Screen] #2
# * Equip Left and Equip Right Screens Switched
#
# [Mirror of SIBruno Custom] #3
# * Equip Left and Equip Right Screens Switched
#
# more to come...
#==============================================================================
#--------------------------------------------------------------------------
# * SDK Log Script
#--------------------------------------------------------------------------
SDK.log("AES", "SIBruno", 3, "2.10.06")
#--------------------------------------------------------------------------
# * Begin SDK Enable Test
#--------------------------------------------------------------------------
if SDK.state("AES") == true
#===================================================
# ▼ CLASS AES Begins
#===================================================
class AES
attr_accessor :data_color
attr_accessor :font_type
attr_accessor :font_size
attr_accessor :screen_layout
attr_accessor :plus_color
attr_accessor :minus_color
attr_accessor :process_color
attr_accessor :normal_color
attr_accessor :name_slot1
attr_accessor :name_slot2
attr_accessor :name_slot3
attr_accessor :name_slot4
attr_accessor :name_slot5
attr_accessor :show_update
attr_accessor :show_hp
attr_accessor :show_sp
attr_accessor :show_lvl
attr_accessor :show_class
attr_accessor :show_atk
attr_accessor :show_pdef
attr_accessor :show_mdef
attr_accessor :show_str
attr_accessor :show_dex
attr_accessor :show_agi
attr_accessor :show_int
def initialize
@data_color = Data_Color.new #CAUTION: DO NOT ALTER
@font_type = "Tahoma" #Choose the Font Style (Case Sensitive)
@font_size = 22 #Choose the Font Size (Default=22)
@screen_layout = 0 #Choose the equip screen layout(Default = 0)
@plus_color = data_color.text_color(3) #Set added value (Default: 3)
@minus_color = data_color.text_color(2) #Set minused value(Default: 2)
@process_color = data_color.text_color(7) #Set processing (Default: 7)
@normal_color = data_color.text_color(0) #Set normal (Default: 0)
#Choose Equip Screen Slot Names - [Syntax: @name_slot# = "your text"]
@name_slot1 = $data_system.words.weapon #Dflt: $data_system.words.weapon
@name_slot2 = $data_system.words.armor1 #Dflt: $data_system.words.armor1
@name_slot3 = $data_system.words.armor2 #Dflt: $data_system.words.armor2
@name_slot4 = $data_system.words.armor3 #Dflt: $data_system.words.armor3
@name_slot5 = $data_system.words.armor4 #Dflt: $data_system.words.armor4
#Flags - When Applicable: true = show; false = hide
@show_update = true #Choose Show AES advanced stat updating
@show_hp = true #Choose Show Actor HP
@show_sp = true #Choose Show Actor SP
@show_lvl = true #Choose Show Actor Level
@show_class = true #Choose Show Class Name
@show_atk = true #Choose Show Actor Attack
@show_pdef = true #Choose Show Actor Phys Defense
@show_mdef = true #Choose Show Actor Mag Defense
@show_str = true #Choose Show Actor Strength
@show_dex = true #Choose Show Actor Dexterity
@show_agi = true #Choose Show Actor Agility
@show_int = true #Choose Show Actor Intellect
end
#===================================================
def set_layout(num)
#Verify within range
if(num > -1 && num < 4)
@screen_layout = num
end
end
#===================================================
#Valid Slot Range is [1-5]
def slot(slot, name)
if (name != nil)
case slot
when 1
@name_slot1 = name
when 2
@name_slot2 = name
when 3
@name_slot3 = name
when 4
@name_slot4 = name
when 5
@name_slot5 = name
end
end
end
#===================================================
end
#===================================================
# ▲ CLASS AES Ends
#===================================================
#===================================================
# ▼ CLASS Data_Color Begins
#===================================================
class Data_Color
# Mimics Window_Base's Text_color Method
def text_color(n)
case n
when 0 # White
return Color.new(255, 255, 255, 255)
when 1 # Blue
return Color.new(128, 128, 255, 255)
when 2 # Red
return Color.new(255, 128, 128, 255)
when 3 # Green
return Color.new(128, 255, 128, 255)
when 4 # Teal
return Color.new(128, 255, 255, 255)
when 5 # Magenta
return Color.new(255, 128, 255, 255)
when 6 # Yellow
return Color.new(255, 255, 128, 255)
when 7 # Gray
return Color.new(192, 192, 192, 255)
else # White
return Color.new(255, 255, 255, 255)
end
end
end
#===================================================
# ▲ CLASS Data_Color Ends
#===================================================
#===================================================
# ▼ Class Window_Base Begins
#===================================================
class Window_Base < Window
#Draw Actor Parameter With Specified Color
def draw_sib_parameter(actor, x, y, type, value, color)
parameter_value = value
case type
when 0
parameter_name = $data_system.words.atk
when 1
parameter_name = $data_system.words.pdef
when 2
parameter_name = $data_system.words.mdef
when 3
parameter_name = $data_system.words.str
when 4
parameter_name = $data_system.words.dex
when 5
parameter_name = $data_system.words.agi
when 6
parameter_name = $data_system.words.int
end
self.contents.font.color = system_color
self.contents.draw_text(x, y, 120, 32, parameter_name)
self.contents.font.color = color
self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s, 2)
end
end
#===================================================
# ▲ CLASS Window_Base Ends
#===================================================
#===================================================
# ▼ Class Window_EquipLeft Begins
#===================================================
class Window_EquipLeft < Window_Base
#------------------------------------------------------------------------------
# Begin initialize Edit
#------------------------------------------------------------------------------
def initialize(actor)
case $aes.screen_layout
when 0
super(0, 64, 272, 192)
when 1
super(0, 64, 302, 416)
when 2
super(368, 64, 272, 192)
when 3
super(338, 64, 302, 416)
end
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $aes.font_type
self.contents.font.size = $aes.font_size
@actor = actor
refresh
end
#------------------------------------------------------------------------------
# End initialize Edit
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# Begin refresh Edit
#------------------------------------------------------------------------------
def refresh
self.contents.clear
draw_actor_name(@actor, 4, 0)
xPos = 50
xVar = 180
yAtk = 124
yPDef = 156
yMDef = 188
yStr = 252
yDex = 284
yAgi = 316
yInt = 348
if($aes.screen_layout == 0 || $aes.screen_layout == 2)
if($aes.show_lvl)
draw_actor_level(@actor, 180, 0)
end
xPos = 4
xVar = 180
yAtk = 32
yPDef = 48
yMDef = 64
yStr = 84
yDex = 100
yAgi = 116
yInt = 132
elsif($aes.screen_layout == 1 || $aes.screen_layout == 3)
draw_actor_graphic(@actor, 40, 112)
if($aes.show_class)
draw_actor_class(@actor, 4 + 144, 0)
end
if($aes.show_hp)
draw_actor_hp(@actor, 96, 32, 172)
end
if($aes.show_sp)
draw_actor_sp(@actor, 96, 64, 172)
end
end
# Attack Value Processing
if($aes.show_atk)
if @new_atk != nil && $aes.show_update
if @actor.atk < @new_atk
draw_sib_parameter(@actor, xPos, yAtk, 0, @new_atk, $aes.process_color)
self.contents.font.color = $aes.plus_color
elsif @actor.atk > @new_atk
draw_sib_parameter(@actor, xPos, yAtk, 0, @new_atk, $aes.process_color)
self.contents.font.color = $aes.minus_color
else
draw_sib_parameter(@actor, xPos, yAtk, 0, @new_atk, $aes.normal_color)
end
atk_var = @new_atk - @actor.atk
if atk_var != 0
atktxt = ''
if atk_var > 0
atktxt = '+' + atk_var.to_s
else
atktxt = atk_var.to_s
end
self.contents.draw_text(xPos + xVar, yAtk, 36, 32, atktxt, 2)
end
else
draw_actor_parameter(@actor, xPos, yAtk, 0)
end
end
# Physical Defense Value Processing
if($aes.show_pdef)
if @new_pdef != nil && $aes.show_update
if @actor.pdef < @new_pdef
draw_sib_parameter(@actor, xPos, yPDef, 1, @new_pdef, $aes.process_color)
self.contents.font.color = $aes.plus_color
elsif @actor.pdef > @new_pdef
draw_sib_parameter(@actor, xPos, yPDef, 1, @new_pdef, $aes.process_color)
self.contents.font.color = $aes.minus_color
else
draw_sib_parameter(@actor, xPos, yPDef, 1, @new_pdef, $aes.normal_color)
end
pdef_var = @new_pdef - @actor.pdef
if pdef_var != 0
pdeftxt = ''
if pdef_var > 0
pdeftxt = '+' + pdef_var.to_s
else
pdeftxt = pdef_var.to_s
end
self.contents.draw_text(xPos + xVar, yPDef, 36, 32, pdeftxt, 2)
end
else
draw_actor_parameter(@actor, xPos, yPDef, 1)
end
end
# Magical Defense Value Processing
if($aes.show_mdef)
if @new_mdef != nil && $aes.show_update
if @actor.mdef < @new_mdef
draw_sib_parameter(@actor, xPos, yMDef, 2, @new_mdef, $aes.process_color)
self.contents.font.color = $aes.plus_color
elsif @actor.mdef > @new_mdef
draw_sib_parameter(@actor, xPos, yMDef, 2, @new_mdef, $aes.process_color)
self.contents.font.color = $aes.minus_color
else
draw_sib_parameter(@actor, xPos, yMDef, 2, @new_mdef, $aes.normal_color)
end
mdef_var = @new_mdef - @actor.mdef
if mdef_var != 0
mdeftxt = ''
if mdef_var > 0
mdeftxt = '+' + mdef_var.to_s
else
mdeftxt = mdef_var.to_s
end
self.contents.draw_text(xPos + xVar, yMDef, 36, 32, mdeftxt, 2)
end
else
draw_actor_parameter(@actor, xPos, yMDef, 2)
end
end
# Strength Value Processing
if($aes.show_str)
if @new_str != nil && $aes.show_update
if @actor.str < @new_str
draw_sib_parameter(@actor, xPos, yStr, 3, @new_str, $aes.process_color)
self.contents.font.color = $aes.plus_color
elsif @actor.str > @new_str
draw_sib_parameter(@actor, xPos, yStr, 3, @new_str, $aes.process_color)
self.contents.font.color = $aes.minus_color
else
draw_sib_parameter(@actor, xPos, yStr, 3, @new_str, $aes.normal_color)
end
str_var = @new_str - @actor.str
if str_var != 0
strtxt = ''
if str_var > 0
strtxt = '+' + str_var.to_s
else
strtxt = str_var.to_s
end
self.contents.draw_text(xPos + xVar, yStr, 36, 32, strtxt, 2)
end
else
draw_actor_parameter(@actor, xPos, yStr, 3)
end
end
# Dexterity Value Processing
if($aes.show_dex)
if @new_dex != nil && $aes.show_update
if @actor.dex < @new_dex
draw_sib_parameter(@actor, xPos, yDex, 4, @new_dex, $aes.process_color)
self.contents.font.color = $aes.plus_color
elsif @actor.dex > @new_dex
draw_sib_parameter(@actor, xPos, yDex, 4, @new_dex, $aes.process_color)
self.contents.font.color = $aes.minus_color
else
draw_sib_parameter(@actor, xPos, yDex, 4, @new_dex, $aes.normal_color)
end
dex_var = @new_dex - @actor.dex
if dex_var != 0
dextxt = ''
if dex_var > 0
dextxt = '+' + dex_var.to_s
else
dextxt = dex_var.to_s
end
self.contents.draw_text(xPos + xVar, yDex, 36, 32, dextxt, 2)
end
else
draw_actor_parameter(@actor, xPos, yDex, 4)
end
end
# Agility Value Processing
if($aes.show_agi)
if @new_agi != nil && $aes.show_update
if @actor.agi < @new_agi
draw_sib_parameter(@actor, xPos, yAgi, 5, @new_agi, $aes.process_color)
self.contents.font.color = $aes.plus_color
elsif @actor.agi > @new_agi
draw_sib_parameter(@actor, xPos, yAgi, 5, @new_agi, $aes.process_color)
self.contents.font.color = $aes.minus_color
else
draw_sib_parameter(@actor, xPos, yAgi, 5, @new_agi, $aes.normal_color)
end
agi_var = @new_agi - @actor.agi
if agi_var != 0
agitxt = ''
if agi_var > 0
agitxt = '+' + agi_var.to_s
else
agitxt = agi_var.to_s
end
self.contents.draw_text(xPos + xVar, yAgi, 36, 32, agitxt, 2)
end
else
draw_actor_parameter(@actor, xPos, yAgi, 5)
end
end
# Intellect Value Processing
if($aes.show_int)
if @new_int != nil && $aes.show_update
if @actor.int < @new_int
draw_sib_parameter(@actor, xPos, yInt, 6, @new_int, $aes.process_color)
self.contents.font.color = $aes.plus_color
elsif @actor.int > @new_int
draw_sib_parameter(@actor, xPos, yInt, 6, @new_int, $aes.process_color)
self.contents.font.color = $aes.minus_color
else
draw_sib_parameter(@actor, xPos, yInt, 6, @new_int, $aes.normal_color)
end
int_var = @new_int - @actor.int
if int_var != 0
inttxt = ''
if int_var > 0
inttxt = '+' + int_var.to_s
else
inttxt = int_var.to_s
end
self.contents.draw_text(xPos + xVar, yInt, 36, 32, inttxt, 2)
end
else
draw_actor_parameter(@actor, xPos, yInt, 6)
end
end
end
#------------------------------------------------------------------------------
# End refresh Edit
#------------------------------------------------------------------------------
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
#===================================================
# ▲ CLASS Window_EquipLeft Ends
#===================================================
#===================================================
# ▼ Class Window_EquipRight Begins
#===================================================
class Window_EquipRight < Window_Selectable
#------------------------------------------------------------------------------
# Begin initialize Edit
#------------------------------------------------------------------------------
def initialize(actor)
case $aes.screen_layout
when 0
super(272, 64, 368, 192)
when 1
super(302, 64, 338, 192)
when 2
super(0, 64, 368, 192)
when 3
super(0, 64, 338, 192)
end
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $aes.font_type
self.contents.font.size = $aes.font_size
@actor = actor
refresh
self.index = -1
end
#------------------------------------------------------------------------------
# End initialize Edit
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# Begin refresh Edit
#------------------------------------------------------------------------------
def refresh
self.contents.clear
@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 = system_color
self.contents.draw_text(4, 32 * 0, 92, 32, $aes.name_slot1)
self.contents.draw_text(4, 32 * 1, 92, 32, $aes.name_slot2)
self.contents.draw_text(4, 32 * 2, 92, 32, $aes.name_slot3)
self.contents.draw_text(4, 32 * 3, 92, 32, $aes.name_slot4)
self.contents.draw_text(5, 32 * 4, 92, 32, $aes.name_slot5)
draw_item_name(@data[0], 92, 32 * 0)
draw_item_name(@data[1], 92, 32 * 1)
draw_item_name(@data[2], 92, 32 * 2)
draw_item_name(@data[3], 92, 32 * 3)
draw_item_name(@data[4], 92, 32 * 4)
end
#------------------------------------------------------------------------------
# End refresh Edit
#------------------------------------------------------------------------------
end
#===================================================
# ▲ CLASS Window_EquipRight Ends
#===================================================
#===================================================
# ▼ Class Window_EquipItem Begins
#===================================================
class Window_EquipItem < Window_Selectable
#------------------------------------------------------------------------------
# Begin initialize Edit
#------------------------------------------------------------------------------
def initialize(actor, equip_type)
case $aes.screen_layout
when 0
super(0, 256, 640, 224)
@column_max = 2
when 1
super(302, 256, 338, 224)
@column_max = 1
when 2
super(0, 256, 640, 224)
@column_max = 2
when 3
super(0, 256, 338, 224)
@column_max = 1
end
@actor = actor
@equip_type = equip_type
refresh
self.active = false
self.index = -1
end
#------------------------------------------------------------------------------
# End initialize Edit
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# Begin refresh Edit
#------------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
# Add equippable weapons
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
# Add equippable armor
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
# Add blank page
@data.push(nil)
# Make a bit map and draw all items
@item_max = @data.size
self.contents = Bitmap.new(width - 32, row_max * 32)
self.contents.font.name = $aes.font_type
self.contents.font.size = $aes.font_size
for i in 0...@item_max-1
draw_item(i)
end
end
#------------------------------------------------------------------------------
# End refresh Edit
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# Begin draw_item Edit
#------------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
if($aes.screen_layout == 0 || $aes.screen_layout == 2)
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
elsif($aes.screen_layout == 1 || $aes.screen_layout == 3)
x = index
y = index * 32
end
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.draw_text(x + 28, y, 212, 32, item.name, 0)
self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
end
#------------------------------------------------------------------------------
# End draw_item Edit
#------------------------------------------------------------------------------
end
#===================================================
# ▲ CLASS Window_EquipItem Ends
#===================================================
#===================================================
# ▼ Class Scene_Equip Begins
#===================================================
class Scene_Equip
#------------------------------------------------------------------------------
# Begin refresh Edit
#------------------------------------------------------------------------------
def refresh
# Set item window to visible
@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)
# Get currently equipped item
item1 = @right_window.item
# Set current item window to @item_window
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 is active
if @right_window.active
# Erase parameters for after equipment change
@left_window.set_new_parameters(nil, nil, nil, nil, nil, nil, nil)
end
# If item window is active
if @item_window.active
# Get currently selected item
item2 = @item_window.item
# Change equipment
last_hp = @actor.hp
last_sp = @actor.sp
@actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
# Get parameters for after equipment change
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
# Return equipment
@actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
@actor.hp = last_hp
@actor.sp = last_sp
# Draw in left window
@left_window.set_new_parameters(new_atk, new_pdef, new_mdef, new_str,
new_dex, new_agi, new_int)
end
end
#------------------------------------------------------------------------------
# End refresh Edit
#------------------------------------------------------------------------------
end
#=========================================
# ▲ CLASS Scene_Equip Ends
#=========================================
#=========================================
# ▼ CLASS Scene_Title Additional Code Begins
#=========================================
class Scene_Title
alias sibruno_aes_scene_title_main main
def main
sibruno_aes_scene_title_main
$aes = AES.new #SIBruno AES Variable
end
end
#=========================================
# ▲ CLASS Scene_Title Additional Code Ends
#=========================================
#===================================================
# ▼ CLASS Scene_Save Additional Code Begins
#===================================================
class Scene_Save < Scene_File
alias aes_sibruno_write_save_data write_save_data
def write_save_data(file)
aes_sibruno_write_save_data(file)
Marshal.dump($aes, file)
end
end
#===================================================
# ▲ CLASS Scene_Save Additional Code Ends
#===================================================
#===================================================
# ▼ CLASS Scene_Load Additional Code Begins
#===================================================
class Scene_Load < Scene_File
alias aes_sibruno_read_save_data read_save_data
def read_save_data(file)
aes_sibruno_read_save_data(file)
$aes = Marshal.load(file)
end
end
#===================================================
# ▲ CLASS Scene_Load Additional Code Ends
#===================================================
#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end
# ■ AES - Advanced Equip Screen
#------------------------------------------------------------------------------
# SIBruno
# Version 3
# 2.10.06
#==============================================================================
# Created Entirely by SIBruno
# shaun.bruno@mail.utexas.edu
# Use freely and give credit! :)
#
# Special Thanks:
# Creation Asylum
#==============================================================================
# Supported Layouts:
#
# [Default: PhotonWeapon Inspired] #0
# * Maintained default window sizes
# * Character sprite removed
# * Character hp and sp removed
# * Character lvl included
#
# [SIBruno Custom] #1
# * Altered Window Sizes
# * Left Window Shows Character Sprites
# * HP/SP Displayed
#
# [Mirror of Default Screen] #2
# * Equip Left and Equip Right Screens Switched
#
# [Mirror of SIBruno Custom] #3
# * Equip Left and Equip Right Screens Switched
#
# more to come...
#==============================================================================
#--------------------------------------------------------------------------
# * SDK Log Script
#--------------------------------------------------------------------------
SDK.log("AES", "SIBruno", 3, "2.10.06")
#--------------------------------------------------------------------------
# * Begin SDK Enable Test
#--------------------------------------------------------------------------
if SDK.state("AES") == true
#===================================================
# ▼ CLASS AES Begins
#===================================================
class AES
attr_accessor :data_color
attr_accessor :font_type
attr_accessor :font_size
attr_accessor :screen_layout
attr_accessor :plus_color
attr_accessor :minus_color
attr_accessor :process_color
attr_accessor :normal_color
attr_accessor :name_slot1
attr_accessor :name_slot2
attr_accessor :name_slot3
attr_accessor :name_slot4
attr_accessor :name_slot5
attr_accessor :show_update
attr_accessor :show_hp
attr_accessor :show_sp
attr_accessor :show_lvl
attr_accessor :show_class
attr_accessor :show_atk
attr_accessor :show_pdef
attr_accessor :show_mdef
attr_accessor :show_str
attr_accessor :show_dex
attr_accessor :show_agi
attr_accessor :show_int
def initialize
@data_color = Data_Color.new #CAUTION: DO NOT ALTER
@font_type = "Tahoma" #Choose the Font Style (Case Sensitive)
@font_size = 22 #Choose the Font Size (Default=22)
@screen_layout = 0 #Choose the equip screen layout(Default = 0)
@plus_color = data_color.text_color(3) #Set added value (Default: 3)
@minus_color = data_color.text_color(2) #Set minused value(Default: 2)
@process_color = data_color.text_color(7) #Set processing (Default: 7)
@normal_color = data_color.text_color(0) #Set normal (Default: 0)
#Choose Equip Screen Slot Names - [Syntax: @name_slot# = "your text"]
@name_slot1 = $data_system.words.weapon #Dflt: $data_system.words.weapon
@name_slot2 = $data_system.words.armor1 #Dflt: $data_system.words.armor1
@name_slot3 = $data_system.words.armor2 #Dflt: $data_system.words.armor2
@name_slot4 = $data_system.words.armor3 #Dflt: $data_system.words.armor3
@name_slot5 = $data_system.words.armor4 #Dflt: $data_system.words.armor4
#Flags - When Applicable: true = show; false = hide
@show_update = true #Choose Show AES advanced stat updating
@show_hp = true #Choose Show Actor HP
@show_sp = true #Choose Show Actor SP
@show_lvl = true #Choose Show Actor Level
@show_class = true #Choose Show Class Name
@show_atk = true #Choose Show Actor Attack
@show_pdef = true #Choose Show Actor Phys Defense
@show_mdef = true #Choose Show Actor Mag Defense
@show_str = true #Choose Show Actor Strength
@show_dex = true #Choose Show Actor Dexterity
@show_agi = true #Choose Show Actor Agility
@show_int = true #Choose Show Actor Intellect
end
#===================================================
def set_layout(num)
#Verify within range
if(num > -1 && num < 4)
@screen_layout = num
end
end
#===================================================
#Valid Slot Range is [1-5]
def slot(slot, name)
if (name != nil)
case slot
when 1
@name_slot1 = name
when 2
@name_slot2 = name
when 3
@name_slot3 = name
when 4
@name_slot4 = name
when 5
@name_slot5 = name
end
end
end
#===================================================
end
#===================================================
# ▲ CLASS AES Ends
#===================================================
#===================================================
# ▼ CLASS Data_Color Begins
#===================================================
class Data_Color
# Mimics Window_Base's Text_color Method
def text_color(n)
case n
when 0 # White
return Color.new(255, 255, 255, 255)
when 1 # Blue
return Color.new(128, 128, 255, 255)
when 2 # Red
return Color.new(255, 128, 128, 255)
when 3 # Green
return Color.new(128, 255, 128, 255)
when 4 # Teal
return Color.new(128, 255, 255, 255)
when 5 # Magenta
return Color.new(255, 128, 255, 255)
when 6 # Yellow
return Color.new(255, 255, 128, 255)
when 7 # Gray
return Color.new(192, 192, 192, 255)
else # White
return Color.new(255, 255, 255, 255)
end
end
end
#===================================================
# ▲ CLASS Data_Color Ends
#===================================================
#===================================================
# ▼ Class Window_Base Begins
#===================================================
class Window_Base < Window
#Draw Actor Parameter With Specified Color
def draw_sib_parameter(actor, x, y, type, value, color)
parameter_value = value
case type
when 0
parameter_name = $data_system.words.atk
when 1
parameter_name = $data_system.words.pdef
when 2
parameter_name = $data_system.words.mdef
when 3
parameter_name = $data_system.words.str
when 4
parameter_name = $data_system.words.dex
when 5
parameter_name = $data_system.words.agi
when 6
parameter_name = $data_system.words.int
end
self.contents.font.color = system_color
self.contents.draw_text(x, y, 120, 32, parameter_name)
self.contents.font.color = color
self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s, 2)
end
end
#===================================================
# ▲ CLASS Window_Base Ends
#===================================================
#===================================================
# ▼ Class Window_EquipLeft Begins
#===================================================
class Window_EquipLeft < Window_Base
#------------------------------------------------------------------------------
# Begin initialize Edit
#------------------------------------------------------------------------------
def initialize(actor)
case $aes.screen_layout
when 0
super(0, 64, 272, 192)
when 1
super(0, 64, 302, 416)
when 2
super(368, 64, 272, 192)
when 3
super(338, 64, 302, 416)
end
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $aes.font_type
self.contents.font.size = $aes.font_size
@actor = actor
refresh
end
#------------------------------------------------------------------------------
# End initialize Edit
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# Begin refresh Edit
#------------------------------------------------------------------------------
def refresh
self.contents.clear
draw_actor_name(@actor, 4, 0)
xPos = 50
xVar = 180
yAtk = 124
yPDef = 156
yMDef = 188
yStr = 252
yDex = 284
yAgi = 316
yInt = 348
if($aes.screen_layout == 0 || $aes.screen_layout == 2)
if($aes.show_lvl)
draw_actor_level(@actor, 180, 0)
end
xPos = 4
xVar = 180
yAtk = 32
yPDef = 48
yMDef = 64
yStr = 84
yDex = 100
yAgi = 116
yInt = 132
elsif($aes.screen_layout == 1 || $aes.screen_layout == 3)
draw_actor_graphic(@actor, 40, 112)
if($aes.show_class)
draw_actor_class(@actor, 4 + 144, 0)
end
if($aes.show_hp)
draw_actor_hp(@actor, 96, 32, 172)
end
if($aes.show_sp)
draw_actor_sp(@actor, 96, 64, 172)
end
end
# Attack Value Processing
if($aes.show_atk)
if @new_atk != nil && $aes.show_update
if @actor.atk < @new_atk
draw_sib_parameter(@actor, xPos, yAtk, 0, @new_atk, $aes.process_color)
self.contents.font.color = $aes.plus_color
elsif @actor.atk > @new_atk
draw_sib_parameter(@actor, xPos, yAtk, 0, @new_atk, $aes.process_color)
self.contents.font.color = $aes.minus_color
else
draw_sib_parameter(@actor, xPos, yAtk, 0, @new_atk, $aes.normal_color)
end
atk_var = @new_atk - @actor.atk
if atk_var != 0
atktxt = ''
if atk_var > 0
atktxt = '+' + atk_var.to_s
else
atktxt = atk_var.to_s
end
self.contents.draw_text(xPos + xVar, yAtk, 36, 32, atktxt, 2)
end
else
draw_actor_parameter(@actor, xPos, yAtk, 0)
end
end
# Physical Defense Value Processing
if($aes.show_pdef)
if @new_pdef != nil && $aes.show_update
if @actor.pdef < @new_pdef
draw_sib_parameter(@actor, xPos, yPDef, 1, @new_pdef, $aes.process_color)
self.contents.font.color = $aes.plus_color
elsif @actor.pdef > @new_pdef
draw_sib_parameter(@actor, xPos, yPDef, 1, @new_pdef, $aes.process_color)
self.contents.font.color = $aes.minus_color
else
draw_sib_parameter(@actor, xPos, yPDef, 1, @new_pdef, $aes.normal_color)
end
pdef_var = @new_pdef - @actor.pdef
if pdef_var != 0
pdeftxt = ''
if pdef_var > 0
pdeftxt = '+' + pdef_var.to_s
else
pdeftxt = pdef_var.to_s
end
self.contents.draw_text(xPos + xVar, yPDef, 36, 32, pdeftxt, 2)
end
else
draw_actor_parameter(@actor, xPos, yPDef, 1)
end
end
# Magical Defense Value Processing
if($aes.show_mdef)
if @new_mdef != nil && $aes.show_update
if @actor.mdef < @new_mdef
draw_sib_parameter(@actor, xPos, yMDef, 2, @new_mdef, $aes.process_color)
self.contents.font.color = $aes.plus_color
elsif @actor.mdef > @new_mdef
draw_sib_parameter(@actor, xPos, yMDef, 2, @new_mdef, $aes.process_color)
self.contents.font.color = $aes.minus_color
else
draw_sib_parameter(@actor, xPos, yMDef, 2, @new_mdef, $aes.normal_color)
end
mdef_var = @new_mdef - @actor.mdef
if mdef_var != 0
mdeftxt = ''
if mdef_var > 0
mdeftxt = '+' + mdef_var.to_s
else
mdeftxt = mdef_var.to_s
end
self.contents.draw_text(xPos + xVar, yMDef, 36, 32, mdeftxt, 2)
end
else
draw_actor_parameter(@actor, xPos, yMDef, 2)
end
end
# Strength Value Processing
if($aes.show_str)
if @new_str != nil && $aes.show_update
if @actor.str < @new_str
draw_sib_parameter(@actor, xPos, yStr, 3, @new_str, $aes.process_color)
self.contents.font.color = $aes.plus_color
elsif @actor.str > @new_str
draw_sib_parameter(@actor, xPos, yStr, 3, @new_str, $aes.process_color)
self.contents.font.color = $aes.minus_color
else
draw_sib_parameter(@actor, xPos, yStr, 3, @new_str, $aes.normal_color)
end
str_var = @new_str - @actor.str
if str_var != 0
strtxt = ''
if str_var > 0
strtxt = '+' + str_var.to_s
else
strtxt = str_var.to_s
end
self.contents.draw_text(xPos + xVar, yStr, 36, 32, strtxt, 2)
end
else
draw_actor_parameter(@actor, xPos, yStr, 3)
end
end
# Dexterity Value Processing
if($aes.show_dex)
if @new_dex != nil && $aes.show_update
if @actor.dex < @new_dex
draw_sib_parameter(@actor, xPos, yDex, 4, @new_dex, $aes.process_color)
self.contents.font.color = $aes.plus_color
elsif @actor.dex > @new_dex
draw_sib_parameter(@actor, xPos, yDex, 4, @new_dex, $aes.process_color)
self.contents.font.color = $aes.minus_color
else
draw_sib_parameter(@actor, xPos, yDex, 4, @new_dex, $aes.normal_color)
end
dex_var = @new_dex - @actor.dex
if dex_var != 0
dextxt = ''
if dex_var > 0
dextxt = '+' + dex_var.to_s
else
dextxt = dex_var.to_s
end
self.contents.draw_text(xPos + xVar, yDex, 36, 32, dextxt, 2)
end
else
draw_actor_parameter(@actor, xPos, yDex, 4)
end
end
# Agility Value Processing
if($aes.show_agi)
if @new_agi != nil && $aes.show_update
if @actor.agi < @new_agi
draw_sib_parameter(@actor, xPos, yAgi, 5, @new_agi, $aes.process_color)
self.contents.font.color = $aes.plus_color
elsif @actor.agi > @new_agi
draw_sib_parameter(@actor, xPos, yAgi, 5, @new_agi, $aes.process_color)
self.contents.font.color = $aes.minus_color
else
draw_sib_parameter(@actor, xPos, yAgi, 5, @new_agi, $aes.normal_color)
end
agi_var = @new_agi - @actor.agi
if agi_var != 0
agitxt = ''
if agi_var > 0
agitxt = '+' + agi_var.to_s
else
agitxt = agi_var.to_s
end
self.contents.draw_text(xPos + xVar, yAgi, 36, 32, agitxt, 2)
end
else
draw_actor_parameter(@actor, xPos, yAgi, 5)
end
end
# Intellect Value Processing
if($aes.show_int)
if @new_int != nil && $aes.show_update
if @actor.int < @new_int
draw_sib_parameter(@actor, xPos, yInt, 6, @new_int, $aes.process_color)
self.contents.font.color = $aes.plus_color
elsif @actor.int > @new_int
draw_sib_parameter(@actor, xPos, yInt, 6, @new_int, $aes.process_color)
self.contents.font.color = $aes.minus_color
else
draw_sib_parameter(@actor, xPos, yInt, 6, @new_int, $aes.normal_color)
end
int_var = @new_int - @actor.int
if int_var != 0
inttxt = ''
if int_var > 0
inttxt = '+' + int_var.to_s
else
inttxt = int_var.to_s
end
self.contents.draw_text(xPos + xVar, yInt, 36, 32, inttxt, 2)
end
else
draw_actor_parameter(@actor, xPos, yInt, 6)
end
end
end
#------------------------------------------------------------------------------
# End refresh Edit
#------------------------------------------------------------------------------
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
#===================================================
# ▲ CLASS Window_EquipLeft Ends
#===================================================
#===================================================
# ▼ Class Window_EquipRight Begins
#===================================================
class Window_EquipRight < Window_Selectable
#------------------------------------------------------------------------------
# Begin initialize Edit
#------------------------------------------------------------------------------
def initialize(actor)
case $aes.screen_layout
when 0
super(272, 64, 368, 192)
when 1
super(302, 64, 338, 192)
when 2
super(0, 64, 368, 192)
when 3
super(0, 64, 338, 192)
end
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $aes.font_type
self.contents.font.size = $aes.font_size
@actor = actor
refresh
self.index = -1
end
#------------------------------------------------------------------------------
# End initialize Edit
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# Begin refresh Edit
#------------------------------------------------------------------------------
def refresh
self.contents.clear
@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 = system_color
self.contents.draw_text(4, 32 * 0, 92, 32, $aes.name_slot1)
self.contents.draw_text(4, 32 * 1, 92, 32, $aes.name_slot2)
self.contents.draw_text(4, 32 * 2, 92, 32, $aes.name_slot3)
self.contents.draw_text(4, 32 * 3, 92, 32, $aes.name_slot4)
self.contents.draw_text(5, 32 * 4, 92, 32, $aes.name_slot5)
draw_item_name(@data[0], 92, 32 * 0)
draw_item_name(@data[1], 92, 32 * 1)
draw_item_name(@data[2], 92, 32 * 2)
draw_item_name(@data[3], 92, 32 * 3)
draw_item_name(@data[4], 92, 32 * 4)
end
#------------------------------------------------------------------------------
# End refresh Edit
#------------------------------------------------------------------------------
end
#===================================================
# ▲ CLASS Window_EquipRight Ends
#===================================================
#===================================================
# ▼ Class Window_EquipItem Begins
#===================================================
class Window_EquipItem < Window_Selectable
#------------------------------------------------------------------------------
# Begin initialize Edit
#------------------------------------------------------------------------------
def initialize(actor, equip_type)
case $aes.screen_layout
when 0
super(0, 256, 640, 224)
@column_max = 2
when 1
super(302, 256, 338, 224)
@column_max = 1
when 2
super(0, 256, 640, 224)
@column_max = 2
when 3
super(0, 256, 338, 224)
@column_max = 1
end
@actor = actor
@equip_type = equip_type
refresh
self.active = false
self.index = -1
end
#------------------------------------------------------------------------------
# End initialize Edit
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# Begin refresh Edit
#------------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
# Add equippable weapons
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
# Add equippable armor
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
# Add blank page
@data.push(nil)
# Make a bit map and draw all items
@item_max = @data.size
self.contents = Bitmap.new(width - 32, row_max * 32)
self.contents.font.name = $aes.font_type
self.contents.font.size = $aes.font_size
for i in 0...@item_max-1
draw_item(i)
end
end
#------------------------------------------------------------------------------
# End refresh Edit
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# Begin draw_item Edit
#------------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
if($aes.screen_layout == 0 || $aes.screen_layout == 2)
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
elsif($aes.screen_layout == 1 || $aes.screen_layout == 3)
x = index
y = index * 32
end
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.draw_text(x + 28, y, 212, 32, item.name, 0)
self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
end
#------------------------------------------------------------------------------
# End draw_item Edit
#------------------------------------------------------------------------------
end
#===================================================
# ▲ CLASS Window_EquipItem Ends
#===================================================
#===================================================
# ▼ Class Scene_Equip Begins
#===================================================
class Scene_Equip
#------------------------------------------------------------------------------
# Begin refresh Edit
#------------------------------------------------------------------------------
def refresh
# Set item window to visible
@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)
# Get currently equipped item
item1 = @right_window.item
# Set current item window to @item_window
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 is active
if @right_window.active
# Erase parameters for after equipment change
@left_window.set_new_parameters(nil, nil, nil, nil, nil, nil, nil)
end
# If item window is active
if @item_window.active
# Get currently selected item
item2 = @item_window.item
# Change equipment
last_hp = @actor.hp
last_sp = @actor.sp
@actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
# Get parameters for after equipment change
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
# Return equipment
@actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
@actor.hp = last_hp
@actor.sp = last_sp
# Draw in left window
@left_window.set_new_parameters(new_atk, new_pdef, new_mdef, new_str,
new_dex, new_agi, new_int)
end
end
#------------------------------------------------------------------------------
# End refresh Edit
#------------------------------------------------------------------------------
end
#=========================================
# ▲ CLASS Scene_Equip Ends
#=========================================
#=========================================
# ▼ CLASS Scene_Title Additional Code Begins
#=========================================
class Scene_Title
alias sibruno_aes_scene_title_main main
def main
sibruno_aes_scene_title_main
$aes = AES.new #SIBruno AES Variable
end
end
#=========================================
# ▲ CLASS Scene_Title Additional Code Ends
#=========================================
#===================================================
# ▼ CLASS Scene_Save Additional Code Begins
#===================================================
class Scene_Save < Scene_File
alias aes_sibruno_write_save_data write_save_data
def write_save_data(file)
aes_sibruno_write_save_data(file)
Marshal.dump($aes, file)
end
end
#===================================================
# ▲ CLASS Scene_Save Additional Code Ends
#===================================================
#===================================================
# ▼ CLASS Scene_Load Additional Code Begins
#===================================================
class Scene_Load < Scene_File
alias aes_sibruno_read_save_data read_save_data
def read_save_data(file)
aes_sibruno_read_save_data(file)
$aes = Marshal.load(file)
end
end
#===================================================
# ▲ CLASS Scene_Load Additional Code Ends
#===================================================
#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end
Download the Demo Below:
AES.zip (Size: 238.09 KB / Downloads: 3)