- Code:
-
# Battle Equip v 1.0
# By Mithran at RMVX.net
# Please do not redistribute without asking.
# Enables changing of equipment freely in battle.
# Use the "X" button (Keyboard A) during actor command selection to open the
# window.
# Compatable with some SBS and ATBs.
# Install: Insert in materials above main and below custom battle system scripts.
# To enable battle equip during play, use the Event Advanced > Script command:
# $game_system.enable_battle_equip = true
# To disable during play, use the Event Advanced > Script command:
# $game_system.enable_battle_equip = false
module Mithran
module BattleEquip
ENABLE = true
# If set to false, equip in battle will be enabled.
USE_BUZZ = true
# If set to false, no buzzer sound will be played when trying to use the
# battle equip command if it is disabled. This only applies to the buzzer
# for the intial opening of the equipment window, if the above option is
# set to false.
end
end
$imported ||= {}
$imported["BattleEquip"] = true
class Scene_Battle < Scene_Base
alias update_orig_battlequip update
def update
if @equip_item_window != nil
super
update_equipitem_window
elsif @equip_window != nil
super
update_equip_window
else
update_orig_battlequip
end
end
alias update_basic_battlequip update_basic
def update_basic(main = false)
if defined?(N02)
if @equip_item_window != nil || @equip_window != nil
update_basic_atb_fix(main)
else
update_basic_battlequip(main)
end
else
update_basic_battlequip(main)
end
end
def update_basic_atb_fix(main = false)
Graphics.update unless main # Update game screen
Input.update unless main # Update input information
$game_system.update # Update timer
$game_troop.update # Update enemy group
@spriteset.update # Update sprite set
@message_window.update # Update message window
end
def update_equip_window
update_basic(true)
update_info_viewport
@equip_window.update
@equip_window.active = true if @equip_window.openness == 255
if $game_message.visible
@info_viewport.visible = false
@message_window.visible = true
end
unless $game_message.visible
update_equip_selection
end
end
def update_equipitem_window
update_basic(true)
update_info_viewport
@equip_item_window.update
@equip_item_window.active = true if @equip_item_window.openness == 255
if $game_message.visible
@info_viewport.visible = false
@message_window.visible = true
end
unless $game_message.visible
update_equipitem_selection
end
end
def update_equip_selection
if Input.trigger?(Input::B)
Sound.play_cancel
@equip_window.active = false
@equip_window.dispose
@equip_window = nil
@actor_command_window.active = true
elsif Input.trigger?(Input::C) || Input.trigger?(Input::X)
if @equipper_selected.fix_equipment
Sound.play_buzzer
else
@equip_window.active = false
create_equip_item_window
@equip_item_window.openness = 0
if @equip_item_window.item_max == 0
Sound.play_buzzer
@equip_item_window.dispose
@equip_item_window = nil
else
Sound.play_decision
@equip_item_window.open
@equip_item_window.index = 0
end
end
end
end
def create_equip_item_window
selected = @active_battler
selected = @commander if @commander
type = @equip_window.index
if $imported["EquipExtension"] && @equip_window.index > 0
type = KGC::EquipExtension::EQUIP_TYPE[@equip_window.index - 1] + 1
end
if selected.two_swords_style && type == 1
type = 0
end
@equip_item_window = Window_EquipItem.new(0, 0, Graphics.width, Graphics.height - @actor_command_window.height, selected, type)
end
def update_equipitem_selection
if Input.trigger?(Input::B)
Sound.play_cancel
@equip_window.active = true
@equip_item_window.active = false
@equip_item_window.dispose
@equip_item_window = nil
elsif Input.trigger?(Input::C) || Input.trigger?(Input::X)
Sound.play_equip
@equipper_selected.change_equip(@equip_window.index, @equip_item_window.item)
@equip_window.active = true
@equip_item_window.active = false
@equip_item_window.dispose
@equip_item_window = nil
@equip_window.refresh
end
end
alias update_actor_command_selection_battleequip update_actor_command_selection
def update_actor_command_selection
if Input.trigger?(Input::X)
if $game_system.enable_battle_equip
Sound.play_decision
start_equip_selection
else
Sound.play_buzzer if Mithran::BattleEquip::USE_BUZZ
end
return
end
update_actor_command_selection_battleequip
end
def start_equip_selection
@equipper_selected = @active_battler
@equipper_selected = @commander if @commander
@equip_window = Window_Equip.new(208, 56, @equipper_selected)
@equip_window.height = @actor_command_window.height
@equip_window.y = Graphics.height - @equip_window.height
@equip_window.x = Graphics.width - @equip_window.width - @actor_command_window.width
@equip_window.index = 0
@equip_window.openness = 0
@equip_window.open
@actor_command_window.active = false
end
end
class Game_System
attr_accessor :enable_battle_equip
def enable_battle_equip
@enable_battle_equip ||= Mithran::BattleEquip::ENABLE
return @enable_battle_equip
end
end
Yg ini...
Maaf ngerepotin....
Kedepannya ku ingin scirpt ini bisa:
-Scriptnya bisa nyambung sama KGC Equip Extension, jdi nanti kya bikin Weapon Slot gitu..
(jdi tempat kya kita masukin equipt gitu cuman wktu gnti di battle weaponnya yg ada di slotnya)
-Dan nanti klo di active kan nyambungnya langsung ke Equiptment kitanya gk bwat window lagi, kalo gk juga paling bsa masukin gambar sama kitanya... jdi gk kaku... atau semacamnya...
Thx dah bantu