赞 | 0 |
VIP | 0 |
好人卡 | 1 |
积分 | 1 |
经验 | 38919 |
最后登录 | 2017-5-27 |
在线时间 | 341 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 341 小时
- 注册时间
- 2013-6-15
- 帖子
- 45
|
雖然已經過期了,但是我還是回答一下吧,用這個腳本就可以了
#==============================================================================
#
# ▼ Yanfly Engine Ace - Command Equip v1.01
# -- Last Updated: 2012.01.10
# -- Level: Easy, Normal
# -- Requires: n/a
#
#==============================================================================
$imported = {} if $imported.nil?
$imported["YEA-CommandEquip"] = true
#==============================================================================
# ▼ Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2012.01.10 - Compatibility Update: Ace Battle Engine v1.15+
# 2011.12.13 - Started Script and Finished.
#
#==============================================================================
# ▼ Introduction
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This command allows your actors to be able to change equipment in the middle
# of battle by directly accessing the equip scene in the middle of battle, and
# returning back to the battle scene exactly as it was. Furthermore, you can
# limit how frequently your player can switch equipment for each of the actors.
#
#==============================================================================
# ▼ Instructions
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
#
#==============================================================================
# ▼ Compatibility
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
# it will run with RPG Maker VX without adjusting.
#
#==============================================================================
module YEA
module COMMAND_EQUIP
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - Battle Equip Settings -
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# This is just how the text appears visually in battle for your actors and
# how often they can change equips in battle.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
COMMAND_TEXT = "装备" # Text used for the command.
EQUIP_COOLDOWN = 2 # Turns to wait before re-equipping.
end # COMMAND_EQUIP
end # YEA
#==============================================================================
# ▼ Editting anything past this point may potentially result in causing
# computer damage, incontinence, explosion of user's head, coma, death, and/or
# halitosis so edit at your own risk.
#==============================================================================
#==============================================================================
# ■ SceneManager
#==============================================================================
module SceneManager
#--------------------------------------------------------------------------
# new method: self.force_recall
#--------------------------------------------------------------------------
def self.force_recall(scene_class)
@Scene = scene_class
end
end # SceneManager
#==============================================================================
# ■ Game_Battler
#==============================================================================
class Game_Battler < Game_BattlerBase
#--------------------------------------------------------------------------
# alias method: on_battle_start
#--------------------------------------------------------------------------
alias game_battler_on_battle_start_ceq on_battle_start
def on_battle_start
game_battler_on_battle_start_ceq
reset_equip_cooldown
end
#--------------------------------------------------------------------------
# new method: reset_equip_cooldown
#--------------------------------------------------------------------------
def reset_equip_cooldown
@equip_cooldown = 0
end
#--------------------------------------------------------------------------
# alias method: on_turn_end
#--------------------------------------------------------------------------
alias game_battler_on_turn_end_ceq on_turn_end
def on_turn_end
game_battler_on_turn_end_ceq
update_equip_cooldown
end
#--------------------------------------------------------------------------
# new method: update_equip_cooldown
#--------------------------------------------------------------------------
def update_equip_cooldown
reset_equip_cooldown if @equip_cooldown.nil?
@equip_cooldown = [@equip_cooldown - 1, 0].max
end
#--------------------------------------------------------------------------
# new method: battle_equippable?
#--------------------------------------------------------------------------
def battle_equippable?
reset_equip_cooldown if @equip_cooldown.nil?
return @equip_cooldown <= 0
end
#--------------------------------------------------------------------------
# new method: set_equip_cooldown
#--------------------------------------------------------------------------
def set_equip_cooldown
@equip_cooldown = YEA::COMMAND_EQUIP::EQUIP_COOLDOWN
end
#--------------------------------------------------------------------------
# alias method: on_battle_end
#--------------------------------------------------------------------------
alias game_battler_on_battle_end_ceq on_battle_end
def on_battle_end
game_battler_on_battle_end_ceq
reset_equip_cooldown
end
end # Game_Battler
#==============================================================================
# ■ Window_EquipCommand
#==============================================================================
class Window_EquipCommand < Window_HorzCommand
#--------------------------------------------------------------------------
# overwrite method: handle?
#--------------------------------------------------------------------------
def handle?(symbol)
if [:pageup, :pagedown].include?(symbol) && $game_party.in_battle
return false
end
return super(symbol)
end
end # Window_EquipCommand
#==============================================================================
# ■ Window_ActorCommand
#==============================================================================
class Window_ActorCommand < Window_Command
#--------------------------------------------------------------------------
# alias method: make_command_list
#--------------------------------------------------------------------------
alias window_actorcommand_make_command_list_ceq make_command_list
def make_command_list
window_actorcommand_make_command_list_ceq
return unless @actor
return if $imported["YEA-BattleCommandList"]
add_equip_command
end
#--------------------------------------------------------------------------
# new method: add_equip_command
#--------------------------------------------------------------------------
def add_equip_command
text = YEA::COMMAND_EQUIP::COMMAND_TEXT
add_command(text, :equip, @actor.battle_equippable?)
end
end # Window_ActorCommand
#==============================================================================
# ■ Scene_Battle
#==============================================================================
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# alias method: create_actor_command_window
#--------------------------------------------------------------------------
alias create_actor_command_window_ceq create_actor_command_window
def create_actor_command_window
create_actor_command_window_ceq
@actor_command_window.set_handler(:equip, method(:command_equip))
end
#--------------------------------------------------------------------------
# new method: command_equip
#--------------------------------------------------------------------------
def command_equip
Graphics.freeze
@info_viewport.visible = false
hide_extra_gauges if $imported["YEA-BattleEngine"]
SceneManager.snapshot_for_background
actor = $game_party.battle_members[@status_window.index]
$game_party.menu_actor = actor
previous_equips = actor.equips.clone
index = @actor_command_window.index
oy = @actor_command_window.oy
#---
SceneManager.call(Scene_Equip)
SceneManager.scene.main
SceneManager.force_recall(self)
#---
show_extra_gauges if $imported["YEA-BattleEngine"]
actor.set_equip_cooldown if previous_equips != actor.equips
@info_viewport.visible = true
@status_window.refresh
@actor_command_window.setup(actor)
@actor_command_window.select(index)
@actor_command_window.oy = oy
perform_transition
$game_system.battle_bgm.play
end
end # Scene_Battle
#==============================================================================
#
# ▼ End of File
#
#============================================================================== |
评分
-
查看全部评分
|