lunariafantasia/Scripts/_.127.rb
2024-01-12 03:12:38 -06:00

105 lines
4.5 KiB
Ruby

module FAKEREAL
#--------------------------------------------------------------------------
# ○ 定数
#--------------------------------------------------------------------------
MIKO_SKILL = 410 # コマンドスキルID
end
#==============================================================================
# ■ Game_Action
#------------------------------------------------------------------------------
#  戦闘行動を扱うクラスです。このクラスは Game_Battler クラスの内部で使用され
# ます。
#==============================================================================
class Game_Action
#--------------------------------------------------------------------------
# ○ 集中コマンドを設定
#--------------------------------------------------------------------------
def set_concentration
set_skill(subject.concentration_skill_id)
self
end
end
#==============================================================================
# ■ Game_BattlerBase
#------------------------------------------------------------------------------
#  バトラーを扱う基本のクラスです。主に能力値計算のメソッドを含んでいます。こ
# のクラスは Game_Battler クラスのスーパークラスとして使用されます。
#==============================================================================
class Game_BattlerBase
#--------------------------------------------------------------------------
# ○ 集中コマンドを設定
#--------------------------------------------------------------------------
def concentration_skill_id
return FAKEREAL::MIKO_SKILL
end
end
#==============================================================================
# ■ Window_ActorCommand
#------------------------------------------------------------------------------
#  バトル画面で、アクターの行動を選択するウィンドウです。
#==============================================================================
class Window_ActorCommand < Window_Command
#--------------------------------------------------------------------------
# ● コマンドリストの作成 ※再定義
#--------------------------------------------------------------------------
def make_command_list
return unless @actor
add_attack_command
add_skill_commands
add_guard_command
add_extra_command
add_item_command
end
#--------------------------------------------------------------------------
# ○ 個別コマンドをリストに追加
#--------------------------------------------------------------------------
def add_extra_command
add_command($data_skills[FAKEREAL::MIKO_SKILL].name, :concentration) if @actor.id == 3
add_command("武器変更", :equip, @actor.action_input_index == 0) if !@actor.summon_type?
#@actor.action_input_index == 0 #武器変更をリストに入れる場合のenable判定
end
end
#==============================================================================
# ■ Scene_Battle
#------------------------------------------------------------------------------
#  バトル画面の処理を行うクラスです。
#==============================================================================
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# ● アクターコマンドウィンドウの作成 ※エイリアス
#--------------------------------------------------------------------------
alias concentration_create_actor_command_window create_actor_command_window
def create_actor_command_window
concentration_create_actor_command_window
@actor_command_window.set_handler(:concentration, method(:command_concentration))
end
#--------------------------------------------------------------------------
# ○ コマンド[集中]
#--------------------------------------------------------------------------
def command_concentration
BattleManager.actor.input.set_concentration
select_actor_selection
end
#--------------------------------------------------------------------------
# ● [エイリアス]アクター[キャンセル]
#--------------------------------------------------------------------------
alias concentration_on_actor_cancel on_actor_cancel
def on_actor_cancel
# 元のメソッドを呼ぶ
concentration_on_actor_cancel
# 退場の場合
case @actor_command_window.current_symbol
when :concentration
@actor_command_window.activate
end
end
end