Note: This script is posted to RGSS Wiki(http://tkool.web-ghost.net/wiki/wiki.cgi) by anonymous Japanese scipter. So do not credit me.
Original Script Page Link: http://tkool.web-ghost.net/wiki/wik...%EF%C6%AE%C3%E6%A4%CB%C1%F5%C8%F7%CA%D1%B9%B9
There are two scripts posted on above page.
1. You can equip your equipments to select any equipment in battle command 'Item' menu.
2. Add 'Equip' command on battle command window.
Compatability Issue?: While you use either of these scripts and any of 'Equip-Extend script', the game will crash when you select 'extended-equipment'. To prevent this, you have to edit above script to ignore extended equipments, or make them to work with your equipments...
Original Script Page Link: http://tkool.web-ghost.net/wiki/wik...%EF%C6%AE%C3%E6%A4%CB%C1%F5%C8%F7%CA%D1%B9%B9
There are two scripts posted on above page.
1. You can equip your equipments to select any equipment in battle command 'Item' menu.
Code:
=begin
戦闘ä¸ã«è£…備を変更ã§ãるよã†ã«ã™ã‚‹ã‚¹ã‚¯ãƒªãƒ—ト
戦闘ä¸ã«è£…備を変ãˆã‚‹ã“ã¨ãŒã§ãるよã†ã«ãªã‚Šã¾ã™ã€‚
ãã‚Œãžã‚Œã®æ•µã«åˆã£ãŸå±žæ€§ã‚’æŒã£ãŸæ¦å™¨ã§æ”»æ’ƒã—ãŸã„å ´åˆãªã©ã«ä½¿ãˆã¾ã™ã€‚
â– Window_BattleItem ページを作æˆ(Window_Itemページよりも後ã‚ã«)
★ページã®ä¸èº«
=end
class Window_BattleItem < Window_Item
#--------------------------------------------------------------------------
# ◠オブジェクトåˆæœŸåŒ–
#--------------------------------------------------------------------------
def initialize
super
@column_max = 2
@actor = nil
refresh
end
#--------------------------------------------------------------------------
# ◠アクティブã®ã‚¢ã‚¯ã‚¿ãƒ¼ã‚’å–å¾—
#--------------------------------------------------------------------------
def actor
return @actor
end
#--------------------------------------------------------------------------
# ◠アクティブã®ã‚¢ã‚¯ã‚¿ãƒ¼ã‚’è¨å®š
#--------------------------------------------------------------------------
def actor=(actor)
@actor = actor
refresh
end
#--------------------------------------------------------------------------
# ◠アイテム・装備å“ãŒä½¿ç”¨(装備)å¯èƒ½ã‹ã©ã†ã‹
#--------------------------------------------------------------------------
def usable?(item)
return false if @actor == nil
item_usable = item.is_a?(RPG::Item) && $game_party.item_can_use?(item.id)
weapon_usable = item.is_a?(RPG::Weapon) && !@actor.equip_fix?(0) && @actor.equippable?(item)
armor_usable = item.is_a?(RPG::Armor) && !@actor.equip_fix?(item.kind + 1) && @actor.equippable?(item)
return item_usable || weapon_usable || armor_usable
end
#--------------------------------------------------------------------------
# ◠リフレッシュ
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
# アイテムを追åŠ
for i in 1...$data_items.size
if $game_party.item_number(i) > 0
@data.push($data_items[i])
end
end
if @actor != nil
for i in 1...$data_weapons.size
if $game_party.weapon_number(i) > 0 and @actor.equippable?($data_weapons[i])
@data.push($data_weapons[i])
end
end
for i in 1...$data_armors.size
if $game_party.armor_number(i) > 0 and @actor.equippable?($data_armors[i])
@data.push($data_armors[i])
end
end
end
# é …ç›®æ•°ãŒ 0 ã§ãªã‘ã‚Œã°ãƒ“ットマップを作æˆã—ã€å…¨é …目をæç”»
@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
#--------------------------------------------------------------------------
# â— é …ç›®ã®æç”»
# index : é …ç›®ç•ªå·
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
case item
when RPG::Item
number = $game_party.item_number(item.id)
when RPG::Weapon
number = $game_party.weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
end
if usable?(item)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
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(item.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, 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
#â– Window_BattleEquip ページを作æˆ(Window_EquipLeftページよりも後ã‚ã«)
#★ページã®ä¸èº«
class Window_BattleEquip < Window_EquipLeft
#--------------------------------------------------------------------------
# ◠オブジェクトåˆæœŸåŒ–
#--------------------------------------------------------------------------
def initialize(actor)
super(actor)
self.y = 480 - self.height
self.z = 110
end
#--------------------------------------------------------------------------
# ◠リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_item_name(@item, 4, 0)
draw_actor_level(@actor, 4, 32)
draw_actor_parameter(@actor, 4, 64, 0)
draw_actor_parameter(@actor, 4, 96, 1)
draw_actor_parameter(@actor, 4, 128, 2)
draw_actor_parameter(@actor, 124, 32, 3)
draw_actor_parameter(@actor, 124, 64, 4)
draw_actor_parameter(@actor, 124, 96, 5)
draw_actor_parameter(@actor, 124, 128, 6)
end
#--------------------------------------------------------------------------
# ◠ウィンドウをé©åˆ‡ãªä½ç½®ã«ç§»å‹•
#--------------------------------------------------------------------------
def move_auto(item_window, min_y)
self.x = item_window.index % 2 == 0 ? 640 - self.width : 0
self.y = item_window.cursor_rect.y + item_window.y > 480 / 2 ? min_y : 480 - self.height
end
#--------------------------------------------------------------------------
# ◠指定ã—ãŸã‚¢ã‚¤ãƒ†ãƒ ã¨åŒã˜éƒ¨ä½ã«ã‚¢ã‚¯ã‚¿ãƒ¼ãŒè£…å‚™ã—ã¦ã„るアイテムをå–å¾—
#--------------------------------------------------------------------------
def set_same_kind(item)
if item.is_a?(RPG::Weapon)
@item = $data_weapons[@actor.weapon_id]
elsif item.is_a?(RPG::Armor)
armor_ids = [@actor.armor1_id, @actor.armor2_id, @actor.armor3_id, @actor.armor4_id]
@item = $data_armors[armor_ids[item.kind]]
else
@item = nil
end
refresh
end
#--------------------------------------------------------------------------
# ◠装備変更後ã®ãƒ‘ラメータè¨å®š(ステータス全部表示ã§ãる版)
#--------------------------------------------------------------------------
def set_new_parameters(new_atk, new_pdef, new_mdef, new_str = nil, new_dex = nil, new_agi = nil, new_int = nil)
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
#--------------------------------------------------------------------------
# ◠表示パラメータã®æ•°ã‚’増やã™ãŸã‚ã«ã‚ªãƒ¼ãƒãƒ¼ãƒ©ã‚¤ãƒ‰
#--------------------------------------------------------------------------
def draw_actor_parameter(actor, x, y, type)
case type
when 0
parameter_name = $data_system.words.atk
parameter_value = @new_atk == nil ? actor.atk : @new_atk
color = get_color(actor.atk, @new_atk)
when 1
parameter_name = $data_system.words.pdef
parameter_value = @new_pdef == nil ? actor.pdef : @new_pdef
color = get_color(actor.pdef, @new_pdef)
when 2
parameter_name = $data_system.words.mdef
parameter_value = @new_mdef == nil ? actor.mdef : @new_mdef
color = get_color(actor.mdef, @new_mdef)
when 3
parameter_name = $data_system.words.str
parameter_value = @new_str == nil ? actor.str : @new_str
color = get_color(actor.str, @new_str)
when 4
parameter_name = $data_system.words.dex
parameter_value = @new_dex == nil ? actor.dex : @new_dex
color = get_color(actor.dex, @new_dex)
when 5
parameter_name = $data_system.words.agi
parameter_value = @new_agi == nil ? actor.agi : @new_agi
color = get_color(actor.agi, @new_agi)
when 6
parameter_name = $data_system.words.int
parameter_value = @new_int == nil ? actor.int : @new_int
color = get_color(actor.int, @new_int)
end
self.contents.font.color = system_color
self.contents.draw_text(x, y, 72, 32, parameter_name)
self.contents.font.color = color
self.contents.draw_text(x + 72, y, 36, 32, parameter_value.to_s, 2)
self.contents.font.color = normal_color
end
#--------------------------------------------------------------------------
# ◠装備後ã®ãƒ‘ラメータã®å¢—減を表ã™è‰²ã‚’å–å¾—
#--------------------------------------------------------------------------
def get_color(param, new_param)
if param == nil or new_param == nil
return normal_color
elsif param > new_param
# 装備後ã«ãƒ‘ラメータãŒæ¸›ã‚‹å ´åˆ
return Color.new(192, 192, 192, 255)
elsif param < new_param
# 装備後ã«ãƒ‘ラメータãŒå¢—ãˆã‚‹å ´åˆ
return Color.new(255, 255, 0, 255)
else
# 装備後ã«ãƒ‘ラメータãŒå¤‰ã‚らãªã„å ´åˆ
return normal_color
end
end
end
#â– Scene_Battle 3
#★以下ã®ãƒ¡ã‚½ãƒƒãƒ‰ã‚’変更
#--------------------------------------------------------------------------
# ◠フレーム更新 (アクターコマンドフェーズ : アイテムé¸æŠž)
#--------------------------------------------------------------------------
def update_phase3_item_select
# アイテムウィンドウをå¯è¦–状態ã«ã™ã‚‹
@item_window.visible = true
# アイテムウィンドウを更新
@item_window.update
# --- ã“ã“ã‹ã‚‰å¤‰æ›´éƒ¨åˆ† ---
@equip_window.update
# é¸æŠžã‚¢ã‚¤ãƒ†ãƒ ãŒå¤‰ã‚ã£ã¦ã„ã‚‹å ´åˆ
if @item != @item_window.item
# é¸æŠžã‚¢ã‚¤ãƒ†ãƒ ã®æ›´æ–°
@item = @item_window.item
# 装備ウィンドウã®å¯è¦–状態・ä½ç½®å¤‰æ›´
@equip_window.visible = equip_window_button == nil && (@item.is_a?(RPG::Weapon) || @item.is_a?(RPG::Armor))
@equip_window.move_auto(@item_window, @help_window.height)
@equip_window.set_same_kind(@item)
if @item.is_a?(RPG::Weapon) or @item.is_a?(RPG::Armor)
# ç¾åœ¨é¸æŠžä¸ã®ã‚¢ã‚¤ãƒ†ãƒ ã‚’å–å¾—
# 装備を変更
last_hp = @active_battler.hp
last_sp = @active_battler.sp
equips = [@active_battler.weapon_id, @active_battler.armor1_id, @active_battler.armor2_id, @active_battler.armor3_id, @active_battler.armor4_id]
equip_type = @item.is_a?(RPG::Weapon) ? 0 : @item.kind + 1
@active_battler.equip(equip_type, @item == nil ? 0 : @item.id)
# 装備変更後ã®ãƒ‘ラメータをå–å¾—
new_atk = @active_battler.atk
new_pdef = @active_battler.pdef
new_mdef = @active_battler.mdef
new_str = @active_battler.str
new_dex = @active_battler.dex
new_agi = @active_battler.agi
new_int = @active_battler.int
# 装備を戻ã™
for i in 0...equips.size
@active_battler.equip(i, equips[i])
end
@active_battler.hp = last_hp
@active_battler.sp = last_sp
# 装備ウィンドウã«æç”»
@equip_window.set_new_parameters(new_atk, new_pdef, new_mdef, new_str, new_dex, new_agi, new_int)
end
return
end
# 装備ウィンドウ表示ボタンãŒæŠ¼ã•ã‚ŒãŸå ´åˆ(use_a_button? ãŒtrueã‚’è¿”ã™å ´åˆã®ã¿ä½¿ç”¨)
if equip_window_button != nil
if Input.trigger?(equip_window_button) and (@item.is_a?(RPG::Weapon) or @item.is_a?(RPG::Armor))
# è£…å‚™ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚’éš ã™ãƒ»è¡¨ç¤ºã™ã‚‹
@equip_window.visible = !@equip_window.visible
end
end
# --- 変更部分終ã‚ã‚Š ---
# B ボタンãŒæŠ¼ã•ã‚ŒãŸå ´åˆ
if Input.trigger?(Input::B)
# ã‚ャンセル SE ã‚’æ¼”å¥
$game_system.se_play($data_system.cancel_se)
# アイテムã®é¸æŠžã‚’終了
end_item_select
return
end
# C ボタンãŒæŠ¼ã•ã‚ŒãŸå ´åˆ
if Input.trigger?(Input::C)
# アイテムウィンドウã§ç¾åœ¨é¸æŠžã•ã‚Œã¦ã„るデータをå–å¾—
@item = @item_window.item
# --- ã“ã“ã‹ã‚‰å¤‰æ›´éƒ¨åˆ† ---
# 使用ã§ããªã„å ´åˆ
unless @item_window.usable?(@item)
# ブザー SE ã‚’æ¼”å¥
$game_system.se_play($data_system.buzzer_se)
return
end
# 使用ã—ãŸã®ãŒã‚¢ã‚¤ãƒ†ãƒ ã®å ´åˆ
if @item.is_a?(RPG::Item)
# 決定 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.decision_se)
# アクションをè¨å®š
@active_battler.current_action.item_id = @item.id
# アイテムウィンドウをä¸å¯è¦–状態ã«ã™ã‚‹
@item_window.visible = false
# 効果範囲ãŒæ•µå˜ä½“ã®å ´åˆ
if @item.scope == 1
# エãƒãƒŸãƒ¼ã®é¸æŠžã‚’開始
start_enemy_select
# 効果範囲ãŒå‘³æ–¹å˜ä½“ã®å ´åˆ
elsif @item.scope == 3 or @item.scope == 5
# アクターã®é¸æŠžã‚’開始
start_actor_select
# 効果範囲ãŒå˜ä½“ã§ã¯ãªã„å ´åˆ
else
# アイテムã®é¸æŠžã‚’終了
end_item_select
# 次ã®ã‚¢ã‚¯ã‚¿ãƒ¼ã®ã‚³ãƒžãƒ³ãƒ‰å…¥åŠ›ã¸
phase3_next_actor
end
# 使用ã—ãŸã®ãŒè£…å‚™å“ã®å ´åˆ
else
# 装備 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.equip_se)
# 装備ã™ã‚‹
equip_type = @item.is_a?(RPG::Weapon) ? 0 : @item.kind + 1
@active_battler.equip(equip_type, @item.id)
@item_window.refresh
@equip_window.refresh
end
# --- 変更部分終ã‚ã‚Š ---
return
end
end
#--------------------------------------------------------------------------
# ◠アイテムé¸æŠžé–‹å§‹
#--------------------------------------------------------------------------
def start_item_select
# --- ã“ã“ã‹ã‚‰å¤‰æ›´éƒ¨åˆ† ---
# アイテムウィンドウを作æˆ
@item_window = Window_BattleItem.new
@item_window.actor = @active_battler
# 装備用ã®ãƒ‘ラメータウィンドウを作æˆ
@equip_window = Window_BattleEquip.new(@active_battler)
@equip_window.active = false
@equip_window.visible = false
# é¸æŠžã‚¢ã‚¤ãƒ†ãƒ ã®åˆæœŸåŒ–
@item = nil
# --- 変更部分終ã‚ã‚Š ---
# ヘルプウィンドウを関連付ã‘
@item_window.help_window = @help_window
# アクターコマンドウィンドウを無効化
@actor_command_window.active = false
@actor_command_window.visible = false
end
#--------------------------------------------------------------------------
# ◠アイテムé¸æŠžçµ‚了
#--------------------------------------------------------------------------
def end_item_select
# アイテムウィンドウを解放
@item_window.dispose
@item_window = nil
# --- ã“ã“ã‹ã‚‰å¤‰æ›´éƒ¨åˆ† ---
@equip_window.dispose
@equip_window = nil
# --- 変更部分終ã‚ã‚Š ---
# ãƒ˜ãƒ«ãƒ—ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚’éš ã™
@help_window.visible = false
# アクターコマンドウィンドウを有効化
@actor_command_window.active = true
@actor_command_window.visible = true
end
#★以下ã®ãƒ¡ã‚½ãƒƒãƒ‰ã‚’追åŠ
#--------------------------------------------------------------------------
# ◠装備ウィンドウを表示ã™ã‚‹ãŸã‚ã®ãƒœã‚¿ãƒ³
#  (return nil ã«ã™ã‚‹ã¨ãƒœã‚¿ãƒ³ã‚’押ã•ãªãã¦ã‚‚常ã«è¡¨ç¤º)
#--------------------------------------------------------------------------
def equip_window_button
# 「return Input::Aã€ã«ã™ã‚‹ã¨ A ボタンを押ã—ãŸæ™‚ã«ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦è¡¨ç¤º
return nil
end
end
=begin
以上
Scene_Battle 3 ã®ä¸ã«è¿½åŠ ã—㟠equip_window_button メソッドã®ä¸ã‚’変ãˆã‚‹ã¨
特定ã®ãƒœã‚¿ãƒ³ã‚’押ã—ãŸã¨ãã«è£…å‚™&ステータスウィンドウを表示ã™ã‚‹ã‚ˆã†ã«ãªã‚Šã¾ã™ã€‚
Window_BattleItem 㨠Window_BattleEquip ã‚’ã„ã˜ã‚‹ã¨
アイテムウィンドウや装備ウィンドウã®è¦‹æ „ãˆã‚’変ãˆã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚
ãŠå¥½ã¿ã®è¡¨ç¤ºæ–¹æ³•ã«æ”¹é€ ã—ã¦ãã ã•ã„。
既㫠Window_EquipLeft ã‚’æ”¹é€ ã—ã¦ã„ã¦ã€ãã®è¡¨ç¤ºã‚’使ã„ãŸã„æ–¹ã¯
Window_BattleEquip ã‹ã‚‰ã€ã“ã®ã‚¹ã‚¯ãƒªãƒ—トã«å¿…é ˆã®ãƒ¡ã‚½ãƒƒãƒ‰ã§ã‚ã‚‹
initializeã€move_autoã€set_same_kindã€set_new_parameters
以外ã®ãƒ¡ã‚½ãƒƒãƒ‰ã‚’削除ã™ã‚‹ã¨ã†ã¾ãã„ãå¯èƒ½æ€§ãŒé«˜ã„ã§ã™ã€‚
=end
2. Add 'Equip' command on battle command window.
Code:
# 「戦闘ä¸ã«è£…å‚™ã€ã‚¹ã‚¯ãƒªãƒ—ト Ver1.00
#
#
#戦闘ä¸ã«è£…å‚™ãŒå‡ºæ¥ã‚‹ã‚ˆã†ã«ãªã‚Šã¾ã™ã€‚以下ã®ã‚¹ã‚¯ãƒªãƒ—トをmainã®ä¸Šã«ã§ã‚‚挿入
#ã—ã¦ä¸‹ã•ã„。アクターコマンドã®ä¸€ç•ªä¸‹ã«è£…備コマンドãŒå‡ºã‚‹ã¨æ€ã„ã¾ã™ã€‚
#
#ãªãŠã€ã“ã®ã‚¹ã‚¯ãƒªãƒ—トã¯é€šå¸¸æ™‚ã®è£…備画é¢ã‚’直接呼ã³å‡ºã—ã¦ãŠã‚Šã¾ã™ã®ã§ã€
#ç”»é¢ã®ãƒ‡ã‚¶ã‚¤ãƒ³ã¯è€ƒæ…®ã—ã¦ãŠã‚Šã¾ã›ã‚“。レイアウトã®å¤‰æ›´ã¯å„自ã§ãŠé¡˜ã„致ã—ã¾ã™ã€‚
#ã¤ã¾ã‚Šã€è£…備画é¢ã®å¤‰æ›´ãŒå¤§å‰æã¨ãªã‚Šã¾ã™ã€‚一応ã€ãã®ã¾ã¾ã§ã‚‚動作ã¯å•é¡Œã‚ã‚Š
#ã¾ã›ã‚“ãŒãƒ»ãƒ»ãƒ»ã€‚
#ãªãŠã€å‘¼ã³å‡ºã—ã¦ã„ã‚‹ç”»é¢ã¯ã€Œè£…å‚™ä¸ã®ã‚¢ã‚¤ãƒ†ãƒ 欄ã€ã¨
#「装備ã§ãるアイテム欄ã€ã§ã™ã€‚
#
#
#ç”»é¢ãƒ¬ã‚¤ã‚¢ã‚¦ãƒˆã®å¤‰æ›´ã¯RGSSã®åˆæ©ã®æŠ€è¡“ã§ã™ã®ã§ã€
#ãã‚ŒãŒå‡ºæ¥ãªã„æ–¹ã¯ã€è¦ªåˆ‡ãªæ–¹ã«æ•™ãˆã¦é ‚ãã‹è«¦ã‚ã¦ä¸‹ã•ã„(ã‡
#勉強ã¨æ€ã£ã¦ãŒã‚“ã°ã‚Šã¾ã—ょã†(^^;)
#※ヒント
#â—Window_EquipLeft
#â—Window_EquipRight
#â—Window_EquipItem
#ãŒå¤‰æ›´å ´æ‰€ã§ã™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ã€‚
#==============================================================================
# ■Scene_Battle (分割定義 3)
#------------------------------------------------------------------------------
#  ãƒãƒˆãƒ«ç”»é¢ã®å‡¦ç†ã‚’è¡Œã†ã‚¯ãƒ©ã‚¹ã§ã™ã€‚
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# ◠メイン処ç†
#--------------------------------------------------------------------------
def main
# 戦闘用ã®å„種一時データをåˆæœŸåŒ–
$game_temp.in_battle = true
$game_temp.battle_turn = 0
$game_temp.battle_event_flags.clear
$game_temp.battle_abort = false
$game_temp.battle_main_phase = false
$game_temp.battleback_name = $game_map.battleback_name
$game_temp.forcing_battler = nil
# ãƒãƒˆãƒ«ã‚¤ãƒ™ãƒ³ãƒˆç”¨ã‚¤ãƒ³ã‚¿ãƒ—リタをåˆæœŸåŒ–
$game_system.battle_interpreter.setup(nil, 0)
# トループを準備
@troop_id = $game_temp.battle_troop_id
$game_troop.setup(@troop_id)
# アクターコマンドウィンドウを作æˆ
s1 = $data_system.words.attack
s2 = $data_system.words.skill
s3 = $data_system.words.guard
s4 = $data_system.words.item
s5 = $data_system.words.equip #ーーーâ—â—装備
@actor_command_window = Window_Command.new(128, [s1, s2, s3, s4, s5])
#@actor_command_window = Window_Command.new(160, [s1, s2, s3, s4])
@actor_command_window.y = 128 #160
@actor_command_window.back_opacity = 160
@actor_command_window.active = false
@actor_command_window.visible = false
# ãã®ä»–ã®ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚’作æˆ
@party_command_window = Window_PartyCommand.new
@help_window = Window_Help.new
@help_window.back_opacity = 160
@help_window.visible = false
@status_window = Window_BattleStatus.new
@message_window = Window_Message.new
# スプライトセットを作æˆ
@spriteset = Spriteset_Battle.new
# ウェイトカウントをåˆæœŸåŒ–
@wait_count = 0
# トランジション実行
if $data_system.battle_transition == ""
Graphics.transition(20)
else
Graphics.transition(40, "Graphics/Transitions/" +
$data_system.battle_transition)
end
# プレãƒãƒˆãƒ«ãƒ•ã‚§ãƒ¼ã‚ºé–‹å§‹
start_phase1
# メインループ
loop do
# ゲーム画é¢ã‚’æ›´æ–°
Graphics.update
# å…¥åŠ›æƒ…å ±ã‚’æ›´æ–°
Input.update
# フレーム更新
update
# ç”»é¢ãŒåˆ‡ã‚Šæ›¿ã‚ã£ãŸã‚‰ãƒ«ãƒ¼ãƒ—ã‚’ä¸æ–
if $scene != self
break
end
end
# マップをリフレッシュ
$game_map.refresh
# トランジション準備
Graphics.freeze
# ウィンドウを解放
@actor_command_window.dispose
@party_command_window.dispose
@help_window.dispose
@status_window.dispose
@message_window.dispose
if @skill_window != nil
@skill_window.dispose
end
if @item_window != nil
@item_window.dispose
end
if @result_window != nil
@result_window.dispose
end
# スプライトセットを解放
@spriteset.dispose
# タイトル画é¢ã«åˆ‡ã‚Šæ›¿ãˆä¸ã®å ´åˆ
if $scene.is_a?(Scene_Title)
# ç”»é¢ã‚’フェードアウト
Graphics.transition
Graphics.freeze
end
# 戦闘テストã‹ã‚‰ã‚²ãƒ¼ãƒ オーãƒãƒ¼ç”»é¢ä»¥å¤–ã«åˆ‡ã‚Šæ›¿ãˆä¸ã®å ´åˆ
if $BTEST and not $scene.is_a?(Scene_Gameover)
$scene = nil
end
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (アクターコマンドフェーズ)
#--------------------------------------------------------------------------
def update_phase3
# エãƒãƒŸãƒ¼ã‚¢ãƒãƒ¼ãŒæœ‰åŠ¹ã®å ´åˆ
if @enemy_arrow != nil
update_phase3_enemy_select
# アクターアãƒãƒ¼ãŒæœ‰åŠ¹ã®å ´åˆ
elsif @actor_arrow != nil
update_phase3_actor_select
# スã‚ルウィンドウãŒæœ‰åŠ¹ã®å ´åˆ
elsif @skill_window != nil
update_phase3_skill_select
# アイテムウィンドウãŒæœ‰åŠ¹ã®å ´åˆ
elsif @item_window != nil
update_phase3_item_select
# â˜…è¿½åŠ ã€€è£…å‚™å¤‰æ›´ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ãŒæœ‰åŠ¹ã®å ´åˆ
elsif @right_window != nil
update_phase3_equip_select
# アクターコマンドウィンドウãŒæœ‰åŠ¹ã®å ´åˆ
elsif @actor_command_window.active
update_phase3_basic_command
end
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (アクターコマンドフェーズ : 基本コマンド)
#--------------------------------------------------------------------------
def update_phase3_basic_command
# B ボタンãŒæŠ¼ã•ã‚ŒãŸå ´åˆ
if Input.trigger?(Input::B)
# ã‚ャンセル SE ã‚’æ¼”å¥
$game_system.se_play($data_system.cancel_se)
# å‰ã®ã‚¢ã‚¯ã‚¿ãƒ¼ã®ã‚³ãƒžãƒ³ãƒ‰å…¥åŠ›ã¸
phase3_prior_actor
return
end
# C ボタンãŒæŠ¼ã•ã‚ŒãŸå ´åˆ
if Input.trigger?(Input::C)
# アクターコマンドウィンドウã®ã‚«ãƒ¼ã‚½ãƒ«ä½ç½®ã§åˆ†å²
case @actor_command_window.index
when 0 # 攻撃
# 決定 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.decision_se)
# アクションをè¨å®š
@active_battler.current_action.kind = 0
@active_battler.current_action.basic = 0
# エãƒãƒŸãƒ¼ã®é¸æŠžã‚’開始
start_enemy_select
when 1 # スã‚ル
# 決定 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.decision_se)
# アクションをè¨å®š
@active_battler.current_action.kind = 1
# スã‚ルã®é¸æŠžã‚’開始
start_skill_select
when 2 # 防御
# 決定 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.decision_se)
# アクションをè¨å®š
@active_battler.current_action.kind = 0
@active_battler.current_action.basic = 1
# 次ã®ã‚¢ã‚¯ã‚¿ãƒ¼ã®ã‚³ãƒžãƒ³ãƒ‰å…¥åŠ›ã¸
phase3_next_actor
when 3 # アイテãƒ
# 決定 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.decision_se)
# アクションをè¨å®š
@active_battler.current_action.kind = 2
# アイテムã®é¸æŠžã‚’開始
start_item_select
when 4 # 装備
# 決定 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.decision_se)
# アクションをè¨å®š
#@active_battler.current_action.kind = 0
# アイテムã®é¸æŠžã‚’開始
start_equip_select
end
return
end
end
#--------------------------------------------------------------------------
# â˜…â— è¿½åŠ ã€€ãƒ•ãƒ¬ãƒ¼ãƒ æ›´æ–° (アクターコマンドフェーズ : 変更装備é¸æŠž)
#--------------------------------------------------------------------------
def update_phase3_equip_select
# スã‚ルウィンドウをå¯è¦–状態ã«ã™ã‚‹
@right_window.visible = true
# ウィンドウを更新
@right_window.update
if @right_window.index != @now_right_window
@now_right_window =@right_window.index
if @equip_item_window.index == -1
@equip_item_window.index = 0
@equip_item_window.refresh
@equip_item_window.index = -1
end
end
# ウィンドウを更新
@equip_item_window.update
equip_item_window_select
# アイテムウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ
if @equip_item_window.active
update_phase3_equip_i_select
return
end
# B ボタンãŒæŠ¼ã•ã‚ŒãŸå ´åˆ
if Input.trigger?(Input::B)
# ã‚ャンセル SE ã‚’æ¼”å¥
$game_system.se_play($data_system.cancel_se)
# 装備é¸æŠžã‚’終了
end_equip_select
return
end
# C ボタンãŒæŠ¼ã•ã‚ŒãŸå ´åˆ
if Input.trigger?(Input::C)
# 装備固定ã®å ´åˆ
if @active_battler.equip_fix?(@right_window.index)
# ブザー SE ã‚’æ¼”å¥
$game_system.se_play($data_system.buzzer_se)
return
end
# 決定 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.decision_se)
# アイテムウィンドウをアクティブ化
@right_window.active = false
@equip_item_window.active = true
@equip_item_window.index = 0
@now_right_window = -1
return
end
end
#--------------------------------------------------------------------------
# â˜…â— è¿½åŠ ã€€ãƒ•ãƒ¬ãƒ¼ãƒ æ›´æ–° (アクターコマンドフェーズ : 装備アイテムé¸æŠž)
#--------------------------------------------------------------------------
def update_phase3_equip_i_select
# B ボタンãŒæŠ¼ã•ã‚ŒãŸå ´åˆ
if Input.trigger?(Input::B)
# ã‚ャンセル SE ã‚’æ¼”å¥
$game_system.se_play($data_system.cancel_se)
# 装備アイテムé¸æŠžã‚’終了
@now_item_window = -1
@right_window.active = true
@equip_item_window.active = false
@equip_item_window.index = -1
return
end
# C ボタンãŒæŠ¼ã•ã‚ŒãŸå ´åˆ
if Input.trigger?(Input::C)
$game_system.se_play($data_system.equip_se)
# アイテムウィンドウã§ç¾åœ¨é¸æŠžã•ã‚Œã¦ã„るデータをå–å¾—
item = @equip_item_window.item
# 装備を変更
@active_battler.equip(@right_window.index, item == nil ? 0 : item.id)
# ライトウィンドウをアクティブ化
@right_window.active = true
@equip_item_window.active = false
@equip_item_window.index = -1
# ライトウィンドウã€ã‚¢ã‚¤ãƒ†ãƒ ウィンドウã®å†…容をå†ä½œæˆ
@right_window.refresh
@equip_item_window.refresh
return
end
end
#--------------------------------------------------------------------------
# â˜…â— è¿½åŠ ã€€è£…å‚™é¸æŠžé–‹å§‹
#--------------------------------------------------------------------------
def start_equip_select
# 装備ウィンドウを作æˆ
#パラメータを呼ã³å‡ºã—ãŸã„時ã¯æ³¨é‡ˆæ¶ˆã™
#@left_window = Window_EquipLeft.new(@active_battler)
@right_window = Window_EquipRight.new(@active_battler)
@item_window1 = Window_EquipItem.new(@active_battler, 0)
@item_window2 = Window_EquipItem.new(@active_battler, 1)
@item_window3 = Window_EquipItem.new(@active_battler, 2)
@item_window4 = Window_EquipItem.new(@active_battler, 3)
@item_window5 = Window_EquipItem.new(@active_battler, 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
@now_right_window = -1
@right_window.index = 0
equip_item_window_select
# アクターコマンドウィンドウを無効化
@actor_command_window.active = false
@actor_command_window.visible = false
end
#--------------------------------------------------------------------------
# â˜…â— è¿½åŠ ã€€è£…å‚™é¸æŠžçµ‚了
#--------------------------------------------------------------------------
def end_equip_select
# アイテムウィンドウを解放
#パラメータを呼ã³å‡ºã—ãŸã„時ã¯æ³¨é‡ˆæ¶ˆã™
#@left_window.dispose
@right_window.dispose
@item_window1.dispose
@item_window2.dispose
@item_window3.dispose
@item_window4.dispose
@item_window5.dispose
@right_window= nil
@item_window1= nil
@item_window2= nil
@item_window3= nil
@item_window4= nil
@item_window5= nil
# ãƒ˜ãƒ«ãƒ—ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚’éš ã™
@help_window.visible = false
# アクターコマンドウィンドウを有効化
@actor_command_window.active = true
@actor_command_window.visible = true
end
#--------------------------------------------------------------------------
# â˜…â— è¿½åŠ ã€€è£…å‚™ã‚¢ã‚¤ãƒ†ãƒ ã‚¦ã‚¤ãƒ³ãƒ‰ã‚¦ã®ãƒã‚§ãƒƒã‚¯
#--------------------------------------------------------------------------
def equip_item_window_select
# アイテムウィンドウã®å¯è¦–状態è¨å®š
@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)
#ã€€ãƒ¼ãƒ¼ãƒ¼â˜…è¿½åŠ (注釈消ã™ã¨ã‚¢ã‚¯ã‚»ã‚µãƒª1ã¤å¢—åŠ )
#@item_window5.visible = (@right_window.index == 4) || (@right_window.index == 5)
# ーーー終ã‚ã‚Š
# ç¾åœ¨ã®ã‚¢ã‚¤ãƒ†ãƒ ウィンドウを @item_window ã«è¨å®š
case @right_window.index
when 0
@equip_item_window = @item_window1
when 1
@equip_item_window = @item_window2
when 2
@equip_item_window = @item_window3
when 3
@equip_item_window = @item_window4
when 4
@equip_item_window = @item_window5
#ã€€ãƒ¼ãƒ¼ãƒ¼â˜…è¿½åŠ (注釈消ã™ã¨ã‚¢ã‚¯ã‚»ã‚µãƒª1ã¤å¢—åŠ )
#when 5
# @equip_item_window = @item_window5
end
end
end
Compatability Issue?: While you use either of these scripts and any of 'Equip-Extend script', the game will crash when you select 'extended-equipment'. To prevent this, you have to edit above script to ignore extended equipments, or make them to work with your equipments...