These scripts are ATB and its add-on scripts from ParaSite2D6 RPG Manor.
1. Side-view with walking sprite
It uses your-typical-actor-sprite as actor battler, instead of animated ones. Basically, it's for side-view, but you can make it like front, or rear-view. It's not a CBS itself, so you can try it with other CBS scripts. I can tell you it works with RMXP default battle and its author's ATB, but may not work with some CBS.
2. Active Time Battle
http://para.j-mx.com/rgss/script/ctb.html
It's a typical ATB, like SNES FF series. It works with Side-view script above, Side-view battle from RGSS Wiki, and RM2k3 style Side-view by RaiseField.
[spoiler]
[code]
#==============================================================================
# ++ アクティブタイムãƒãƒˆãƒ«ã€€ver. 2.56 ++
#  Script by パラ犬
#  http://para.j-mx.com/
#------------------------------------------------------------------------------
# CTã‚²ãƒ¼ã‚¸ãŒæºœã¾ã£ãŸãƒãƒˆãƒ©ãƒ¼ã‹ã‚‰é †ã«ã‚³ãƒžãƒ³ãƒ‰å…¥åŠ›ã™ã‚‹æˆ¦é—˜å½¢å¼ã€‚
# ãƒãƒˆãƒ«ã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹ç”»é¢ã‚’サイドビューらã—ãã™ã‚‹æ©Ÿèƒ½ã‚‚ã‚りã¾ã™ã€‚
# ãƒãƒˆãƒ©ãƒ¼ã‚’サイドビュータイプã«è¡¨ç¤ºã™ã‚‹ã‚¹ã‚¯ãƒªãƒ—トã¯ã€ãŠå¥½ããªã‚‚ã®ã‚’
# 用æ„ã—ã¦ãã ã•ã„。
#------------------------------------------------------------------------------
#[è¨ç½®ä¸Šã®æ³¨æ„]
# ã§ãã‚‹ã ã‘リストã®ä¸Šã®ã»ã†ã«ç½®ã„ã¦ãã ã•ã„。(Scene_Debugよりã¯ä¸‹)
#------------------------------------------------------------------------------
#[æ“作]
#・逃走
# 味方ãƒãƒˆãƒ©ãƒ¼ã®ä¸€äººä»¥ä¸ŠãŒã‚³ãƒžãƒ³ãƒ‰å…¥åЛ待ã¡ã®ã¨ãã«ã‚ャンセルボタンを押ã™ã“ã¨ã§
# 「逃ã’ã‚‹ã€ã‚³ãƒžãƒ³ãƒ‰ãŒé¸æŠžã§ãã¾ã™ã€‚
#ã€€æ•µã®æ•°ãŒå¤šã‹ã£ãŸã‚Šã€ã‚³ãƒžãƒ³ãƒ‰å…¥åЛ待ã¡ã®ãƒãƒˆãƒ©ãƒ¼ãŒå°‘ãªã„ã¨ã€
# 逃走æˆåŠŸçŽ‡ãŒä½Žããªã‚Šã¾ã™ã€‚
#
#ãƒ»è¡Œå‹•é †ã®å…¥ã‚Œæ›¿ãˆ
# 複数ã®ãƒãƒˆãƒ©ãƒ¼ãŒè¡Œå‹•å¯èƒ½ã®ã¨ãã€
# Rボタン(PageDownã‚ー)ã§æ¬¡ã®ãƒãƒˆãƒ©ãƒ¼ã¨é †ç•ªã‚’入れ替ãˆã€
# Lボタン(PageUpã‚ー)ã§è¡Œå‹•é †ã‚’ã„ã¡ã°ã‚“最後ã«å›žã—ã¾ã™ã€‚
#==============================================================================
module PARA_CTB
# コマンド入力時ã«CTã®ã‚«ã‚¦ãƒ³ãƒˆã‚’æ¢ã‚ã‚‹ã‹(true:æ¢ã‚ã‚‹ / false:æ¢ã‚ãªã„)
COMMAND_WAIT = false
# アイテムã€ã‚¹ã‚ルã€ã‚¿ãƒ¼ã‚²ãƒƒãƒˆé¸æŠžæ™‚ã«CTã®ã‚«ã‚¦ãƒ³ãƒˆã‚’æ¢ã‚ã‚‹ã‹(true:æ¢ã‚ã‚‹ / false:æ¢ã‚ãªã„)
SELECT_WAIT = true
# アニメーション表示時ã«CTã®ã‚«ã‚¦ãƒ³ãƒˆã‚’æ¢ã‚ã‚‹ã‹(true:æ¢ã‚ã‚‹ / false:æ¢ã‚ãªã„)
ANIMATION_WAIT = false
# ãƒãƒˆãƒ«ã‚¹ãƒ”ード(数値ãŒå¤§ãã„ã»ã©CTã®æºœã¾ã‚ŠãŒé€Ÿããªã‚‹)
BATTLE_SPEED = 3
# ãƒãƒˆãƒ«ãƒ¡ãƒ³ãƒãƒ¼ã®æœ€å¤§æ•°(多人数PTスクリプトを導入ã—ã¦ã„る時ã«è¨å®š)
PARTY_SIZE = 4
# 行動終了時ã®CT減少パーセンテージ
ACT_ATTACK_CT = 100 # 通常攻撃
ACT_GUARD_CT = 100 # 防御
ACT_ESCAPE_CT = 100 # 逃走失敗
ACT_SKILL_CT = 100 # スã‚ル
ACT_ITEM_CT = 100 # アイテãƒ
# 逃走失敗時ã®ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸
UNESCAPE_MES = "逃走失敗"
# CT満タン時ã®åŠ¹æžœéŸ³(""ã§éŸ³ã‚’鳴らã•ãªã„)
# 効果音ã¯ã€ŒAudio/SEã€ãƒ•ォルダ内
FULL_CT_SE = "015-Jump01"
# 効果音ã®ãƒœãƒªãƒ¥ãƒ¼ãƒ
FULL_CT_SE_VOL = 80
# CT満タン時ã®ãƒãƒˆãƒ©ãƒ¼ã®è‰²èª¿((0,0,0)ã§å¤‰åŒ–ãªã—)
FULL_CT_COLOR = Tone.new(32,0,0)
# HPゲージã®è‰²(グラデーション左端)
HP_COLOR_LEFT = Color.new(128, 0, 0, 255)
# HPゲージã®è‰²(グラデーションå³ç«¯)
HP_COLOR_RIGHT= Color.new(255, 0, 0, 255)
# SPゲージã®è‰²(グラデーション左端)
SP_COLOR_LEFT = Color.new(0, 0, 128, 255)
# SPゲージã®è‰²(グラデーションå³ç«¯)
SP_COLOR_RIGHT= Color.new(0, 0, 255, 255)
# CTゲージã®è‰²(グラデーション左端)
COLOR_LEFT = Color.new(128, 128, 64, 255)
# CTゲージã®è‰²(グラデーションå³ç«¯)
COLOR_RIGHT= Color.new(255, 255, 128, 255)
# CTãŒæº€ã‚¿ãƒ³ã«ãªã£ãŸã¨ãã®ã‚²ãƒ¼ã‚¸ã®è‰²
COLOR_FULL = Color.new(255, 225, 128, 255)
# ã‚²ãƒ¼ã‚¸æž ã®è‰²
FRAME_COLOR = Color.new(192, 192, 192, 255)
# ã‚²ãƒ¼ã‚¸æž ã®å¤ªã•
FRAME_BORDER = 1
# ゲージã®èƒŒæ™¯è‰²
BACK_COLOR = Color.new(128, 128, 128, 128)
# åå‰ã®ãƒ•ォントサイズ
NAME_FONT_SIZE = 16
# HP/SPã®ãƒ•ォントサイズ
HPSP_FONT_SIZE = 18
# エãƒãƒŸãƒ¼åã®ãƒ•ォントサイズ
ENEMY_FONT_SIZE = 16
# 最大HP/SPã‚’æç”»ã™ã‚‹ã‹( true / false )
MAX_DRAW = false
# エãƒãƒŸãƒ¼åをグループ化( true / false )
# (trueã«ã™ã‚‹ã¨ã€Œã‚´ãƒ¼ã‚¹ãƒˆ 2ã€ã®ã‚ˆã†ã«ã¾ã¨ã‚ã¦è¡¨ç¤ºã—ã¾ã™)
ENEMY_GROUPING = false
# エãƒãƒŸãƒ¼åã®ä¸‹ã«ã‚²ãƒ¼ã‚¸ã‚’表示( 0:ãªã— / 1:HP / 2:CT )
# (エãƒãƒŸãƒ¼åをグループ化ã—ã¦ã„ã‚‹å ´åˆã¯ç„¡åй)
ENEMY_DRAWING_MATER = 0
# アクターã®ãƒ˜ãƒ«ãƒ—ウインドウã«HP/SPゲージを表示( true / false )
HELP_DRAWING_MATER_ACTOR = false
# エãƒãƒŸãƒ¼ã®ãƒ˜ãƒ«ãƒ—ウインドウã«HP/SPゲージを表示( true / false )
HELP_DRAWING_MATER_ENEMY = false
# コマンドウインドウã®ä½ç½®ã‚’強制指定( true / false )
#(ä»–ã®æ–¹ã®ã‚µã‚¤ãƒ‰ãƒ“ュースクリプトを併用ã—ã¦ã„ã¦
# コマンドウインドウã®ä½ç½®ãŒã©ã†ã—ã¦ã‚‚ä¸è‡ªç„¶ã«ãªã‚‹ãªã‚‰trueã«)
# ※trueã«ã—ã¦ã‚‚é©ç”¨ã•れãªã„å ´åˆã€ã“ã®ã‚¹ã‚¯ãƒªãƒ—トを
#  サイドビューよりも下ã«ç½®ã„ã¦ã¿ã¦ãã ã•ã„
WINDOWPOS_CHANGE = false
WINDOWPOS_X = 100 # X座標
WINDOWPOS_Y = 320 # Y座標
# コマンドウインドウã®ä¸é€æ˜Žåº¦
WINDOW_OPACITY = 160
# CTã®ã‚«ã‚¦ãƒ³ãƒˆé–“隔。少ãªã„ã»ã©ã‚²ãƒ¼ã‚¸æç”»ãŒãªã‚らã‹ã«ã€‚(最å°å€¤ã¯0)
# 処ç†ãŒé‡ã„å ´åˆã¯ã€ã“ã®æ•°å€¤ã‚’上ã’ã¦ãã ã•ã„。
CT_SKIP = 2
end
# ↑ è¨å®šé …ç›®ã“ã“ã¾ã§
#------------------------------------------------------------------------------
#==============================================================================
# â– Scene_Battle
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# â—‹ CTã®ã‚«ã‚¦ãƒ³ãƒˆ
#--------------------------------------------------------------------------
def update_ct
# カウントアップãŒè¨±å¯ã•れã¦ã„ã‚‹ã¨ã
if @countup
for actor in $game_party.actors
# 行動ã§ãã‚‹ã‹
if actor.movable? == false and actor.ct_visible and @phase4_step != 5
# ä¸å¯è¦–状態ã§ã‚«ã‚¦ãƒ³ãƒˆã‚¢ãƒƒãƒ—
actor.ct_visible = false
actor.countup = true
actor.full_ct = false
elsif actor.movable? and actor.ct_visible == false
# ä¸å¯è¦–カウントアップを解除
clear_ct(actor)
actor.ct_visible = true
end
# アクターã®å…¥ã‚Œæ›¿ãˆã«å¯¾å¿œ
if actor.max_ct == 0
actor.max_ct = @max_ct
end
# アクターã®ã‚«ã‚¦ãƒ³ãƒˆã‚¢ãƒƒãƒ—
if actor.countup
# CTãŒmaxã«ãªã£ã¦ãŠã‚Šã€ã‚³ãƒžãƒ³ãƒ‰å…¥åЛ待ã¡ã‚¢ã‚¯ã‚¿ãƒ¼ã«å«ã¾ã‚Œãªã„
if actor.now_ct >= @max_ct and !(@pre_action_battlers.include?(actor))
# コマンド入力待ã¡ã‚¢ã‚¯ã‚¿ãƒ¼ã«è¿½åŠ
@pre_action_battlers.push(actor)
@action_count += 1
# 効果音を鳴らã™
if PARA_CTB::FULL_CT_SE != "" and actor.ct_visible
Audio.se_play("Audio/SE/" + PARA_CTB::FULL_CT_SE,PARA_CTB::FULL_CT_SE_VOL)
end
# ãれ以上カウントアップã—ãªã„
actor.countup = false
actor.full_ct = true
else
# カウントアップ
actor.make_action_speed
ct_skip = PARA_CTB::CT_SKIP != 0 ? PARA_CTB::CT_SKIP : 1
actor.now_ct += actor.current_action.speed * PARA_CTB::BATTLE_SPEED * ct_skip
end
end
end
for enemy in $game_troop.enemies
# 行動ã§ãã‚‹ã‹
if enemy.movable? == false and enemy.ct_visible and @phase4_step == 5
# ä¸å¯è¦–状態ã§ã‚«ã‚¦ãƒ³ãƒˆã‚¢ãƒƒãƒ—
enemy.ct_visible = false
enemy.countup = true
enemy.full_ct = false
elsif enemy.movable? and enemy.ct_visible == false
# ä¸å¯è¦–カウントアップを解除
clear_ct(enemy)
enemy.ct_visible = true
end
# エãƒãƒŸãƒ¼ã®ã‚«ã‚¦ãƒ³ãƒˆã‚¢ãƒƒãƒ—
if enemy.countup
# CTãŒmaxã«ãªã£ã¦ãŠã‚Šã€è¡Œå‹•å¾…ã¡ã‚¨ãƒãƒŸãƒ¼ã«å«ã¾ã‚Œãªã„
if enemy.now_ct >= @max_ct and ! @pre_action_battlers.include?(enemy)
# 行動待ã¡ã‚¨ãƒãƒŸãƒ¼ã«è¿½åŠ
@pre_action_battlers.push(enemy)
@action_count += 1
# ãれ以上カウントアップã—ãªã„
enemy.countup = false
enemy.full_ct = true
else
# カウントアップ
enemy.make_action_speed
enemy.now_ct += enemy.current_action.speed * PARA_CTB::BATTLE_SPEED
end
end
end
# CTã‚²ãƒ¼ã‚¸ã‚’å†æç”»
@status_window.refresh_ct
@status_window2.refresh_ct
end
end
#--------------------------------------------------------------------------
# â—‹ ãƒãƒˆãƒ©ãƒ¼ã®CTã‚’0ã«
#--------------------------------------------------------------------------
def clear_ct(battler)
battler.countup = true
battler.now_ct = 0
battler.full_ct = false
end
#--------------------------------------------------------------------------
# â—‹ ãƒãƒˆãƒ©ãƒ¼ã®CTã‚’ä»»æ„ã®ãƒ‘ーセンテージã«
#--------------------------------------------------------------------------
def declease_ct(battler,percent)
battler.countup = true
battler.now_ct = battler.now_ct * percent / 100
battler.full_ct = false
end
#--------------------------------------------------------------------------
# â—‹ CTã®åˆæœŸåŒ–
#--------------------------------------------------------------------------
def initialize_ct
# CTã®åŸºæº–値を決定
max_ct
for battler in $game_party.actors + $game_troop.enemies
if battler.movable?
n = $game_party.actors.size + $game_troop.enemies.size
# 戦闘開始時ã«ã‚る程度ã®CTを溜ã‚ã¦ãŠã
battler.now_ct = battler.agi * 60 * n
battler.ct_visible = true
else
clear_ct(battler)
battler.ct_visible = false
end
battler.countup = true
battler.full_ct = false
battler.max_ct = @max_ct
end
end
#--------------------------------------------------------------------------
# â—‹ ãƒãƒˆãƒ©ãƒ¼å…¨å“¡ã®ç´ æ—©ã•ã‹ã‚‰CTã®åŸºæº–値を決定
#--------------------------------------------------------------------------
def max_ct
for battler in $game_party.actors + $game_troop.enemies
@max_ct += battler.agi
end
@max_ct *= 100
end
#--------------------------------------------------------------------------
# â—‹ ãƒãƒˆãƒ©ãƒ¼ã®è¡Œå‹•é †ã‚’å¤‰æ›´
#--------------------------------------------------------------------------
def shift_activer(shift)
# 一ã¤ã‚·ãƒ•トã™ã‚‹æ™‚ã§å¾Œã‚ã®ã‚¢ã‚¯ã‚¿ãƒ¼ãŒ2人以上
if @pre_action_battlers != nil
if shift == 1 and @pre_action_battlers.size >= @actor_array_index + 3
# ç¾åœ¨ã®ã‚¢ã‚¯ã‚¿ãƒ¼ã‚’å–å¾—
act = @pre_action_battlers[@actor_array_index]
# ç¾åœ¨ã®ã‚¢ã‚¯ã‚¿ãƒ¼ã‚’二ã¤å¾Œã‚ã«æŒ¿å…¥
@pre_action_battlers.insert(@actor_array_index+2, act)
# ç¾åœ¨ä½ç½®ã‚’消去
@pre_action_battlers.delete_at(@actor_array_index)
@actor_array_index -= 1
phase3_next_actor
else
act = @pre_action_battlers[@actor_array_index]
# ç¾åœ¨ã®ã‚¢ã‚¯ã‚¿ãƒ¼ã‚’一番後ã‚ã«è¿½åŠ
@pre_action_battlers.push(act)
# ç¾åœ¨ä½ç½®ã‚’消去
@pre_action_battlers.delete_at(@actor_array_index)
@actor_array_index -= 1
phase3_next_actor
end
end
end
#--------------------------------------------------------------------------
# ◠メイン処ç†
#--------------------------------------------------------------------------
alias main_ctb main
def main
# エãƒãƒŸãƒ¼åウインドウを作æˆ
@status_window2 = Window_BattleStatus_enemy.new
@action_battlers = []
@pre_action_battlers = []
@max_ct = 0
@countup = false
@ct_wait = 0
@action_count = 0
main_ctb
# エãƒãƒŸãƒ¼åã‚¦ã‚¤ãƒ³ãƒ‰ã‚¦ã‚’ç ´æ£„
@status_window2.dispose
end
#--------------------------------------------------------------------------
# ◠フレーム更新
#--------------------------------------------------------------------------
alias ctb_update update
def update
# ãƒãƒˆãƒ«ã‚¤ãƒ™ãƒ³ãƒˆå®Ÿè¡Œä¸ã®å ´åˆ
if $game_system.battle_interpreter.running?
# インタプリタを更新
$game_system.battle_interpreter.update
# アクションを強制ã•れã¦ã„ã‚‹ãƒãƒˆãƒ©ãƒ¼ãŒå˜åœ¨ã—ãªã„å ´åˆ
if $game_temp.forcing_battler == nil
# ãƒãƒˆãƒ«ã‚¤ãƒ™ãƒ³ãƒˆã®å®Ÿè¡ŒãŒçµ‚ã‚ã£ãŸå ´åˆ
unless $game_system.battle_interpreter.running?
# 戦闘継続ã®å ´åˆã€ãƒãƒˆãƒ«ã‚¤ãƒ™ãƒ³ãƒˆã®ã‚»ãƒƒãƒˆã‚¢ãƒƒãƒ—ã‚’å†å®Ÿè¡Œ
unless judge
setup_battle_event
end
end
# アフターãƒãƒˆãƒ«ãƒ•ェーズã§ãªã‘れã°
if @phase != 5
# ステータスウィンドウをリフレッシュ
@status_window.refresh
# エãƒãƒŸãƒ¼åリストを更新
@status_window2.refresh
end
end
else
if PARA_CTB::CT_SKIP == 0
update_ct
else
if @ct_wait > 0
@ct_wait -= 1
else
update_ct
@ct_wait = PARA_CTB::CT_SKIP
end
end
end
ctb_update
end
#--------------------------------------------------------------------------
# ◠プレãƒãƒˆãƒ«ãƒ•ェーズ開始
#--------------------------------------------------------------------------
alias ctb_start_phase1 start_phase1
def start_phase1
# CTã‚’åˆæœŸåŒ–
initialize_ct
# カウントアップ開始
@countup = true
ctb_start_phase1
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (プレãƒãƒˆãƒ«ãƒ•ェーズ)
#--------------------------------------------------------------------------
def update_phase1
# エãƒãƒŸãƒ¼åリストを更新
@status_window2.refresh
# 勿•—判定
if judge
# å‹åˆ©ã¾ãŸã¯æ•—北ã®å ´åˆ : メソッド終了
return
end
# パーティーコマンドフェーズを飛ã°ã—ã¦ã‚¢ã‚¯ã‚¿ãƒ¼ã‚³ãƒžãƒ³ãƒ‰ãƒ•ェーズ開始
start_phase3
end
#--------------------------------------------------------------------------
# ◠パーティコマンドフェーズ開始
#--------------------------------------------------------------------------
def start_phase2
# フェーズ 2 ã«ç§»è¡Œ
@phase = 2
# アクターをéžé¸æŠžçŠ¶æ…‹ã«è¨å®š
@actor_index = -1
@active_battler = nil
# パーティコマンドウィンドウを有効化
@party_command_window.active = true
@party_command_window.visible = true
# アクターコマンドウィンドウを無効化
@actor_command_window.active = false
@actor_command_window.visible = false
# メインフェーズフラグをクリア
$game_temp.battle_main_phase = false
# コマンド入力ä¸å¯èƒ½ãªå ´åˆ
unless $game_party.inputable?
# メインフェーズ開始
start_phase4
end
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (パーティコマンドフェーズ : 逃ã’ã‚‹)
#--------------------------------------------------------------------------
def update_phase2_escape
# エãƒãƒŸãƒ¼ã®ç´ æ—©ã•åˆè¨ˆã‚’計算
enemies_agi = 0
for enemy in $game_troop.enemies
if enemy.exist?
enemies_agi += enemy.agi
end
end
# 行動å¯èƒ½ã‚¢ã‚¯ã‚¿ãƒ¼ã®ç´ æ—©ã•åˆè¨ˆã‚’計算
actors_agi = 0
for actor in @pre_action_battlers
if actor.is_a?(Game_Actor) and actor.exist?
actors_agi += actor.agi
end
end
# 逃走æˆåŠŸåˆ¤å®š
success = rand(100) < 50 * actors_agi / enemies_agi
# 逃走æˆåŠŸã®å ´åˆ
if success
# 逃走 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.escape_se)
# ãƒãƒˆãƒ«é–‹å§‹å‰ã® BGM ã«æˆ»ã™
$game_system.bgm_play($game_temp.map_bgm)
# CTをクリア
for battler in $game_party.actors
clear_ct(battler)
end
# ãƒãƒˆãƒ«çµ‚了
battle_end(1)
# 逃走失敗ã®å ´åˆ
else
# ヘルプウィンドウ㫠"逃走失敗" をセット
@help_window.set_text(PARA_CTB::UNESCAPE_MES, 1)
# アクターã®ã‚¢ã‚¯ã‚·ãƒ§ãƒ³ã¨CTをクリア
pre_action_battlers = @pre_action_battlers.clone
for act in pre_action_battlers
if act.is_a?(Game_Actor)
declease_ct(act, 100-PARA_CTB::ACT_ESCAPE_CT)
act.current_action.clear
@pre_action_battlers.delete(act)
end
end
@party_command_window.visible = false
# ヘルプウィンドウを表示
@help_window.visible = true
@wait_count = 20
# メインフェーズ開始
start_phase4
end
end
#--------------------------------------------------------------------------
# ◠アクターコマンドフェーズ開始
#--------------------------------------------------------------------------
def start_phase3
# フェーズ 3 ã«ç§»è¡Œ
@phase = 3
# アクターをéžé¸æŠžçŠ¶æ…‹ã«è¨å®š
@actor_index = -1
@active_battler = nil
@actor_array_index = -1
# 次ã®ã‚¢ã‚¯ã‚¿ãƒ¼ã®ã‚³ãƒžãƒ³ãƒ‰å…¥åŠ›ã¸
if @pre_action_battlers != []
phase3_next_actor
else
start_phase4
end
end
#--------------------------------------------------------------------------
# ◠次ã®ã‚¢ã‚¯ã‚¿ãƒ¼ã®ã‚³ãƒžãƒ³ãƒ‰å…¥åŠ›ã¸
#--------------------------------------------------------------------------
def phase3_next_actor
# ループ
begin
# ã‚¢ã‚¯ã‚¿ãƒ¼ã®æ˜Žæ»…エフェクト OFF
if @active_battler != nil
@active_battler.blink = false
end
# 最後ã®ã‚¢ã‚¯ã‚¿ãƒ¼ã®å ´åˆ
if @actor_array_index + 1 == @pre_action_battlers.size
# メインフェーズ開始
start_phase4
return
#次ãŒã‚¨ãƒãƒŸãƒ¼ã®å ´åˆ
elsif $game_troop.enemies.include?(@pre_action_battlers[@actor_array_index + 1])
# メインフェーズ開始
start_phase4
return
end
# アクターã®ã‚¤ãƒ³ãƒ‡ãƒƒã‚¯ã‚¹ã‚’進ã‚ã‚‹
@actor_array_index += 1
@actor_index = @pre_action_battlers[@actor_array_index].index
@active_battler = $game_party.actors[@actor_index]
@active_battler.blink = true
@active_battler.current_action.clear
# アクターãŒã‚³ãƒžãƒ³ãƒ‰å…¥åŠ›ã‚’å—ã‘付ã‘ãªã„状態ãªã‚‰ã‚‚ã†ä¸€åº¦
end until @active_battler.inputable?
# アクターコマンドウィンドウをセットアップ
phase3_setup_command_window
end
#--------------------------------------------------------------------------
# â— å‰ã®ã‚¢ã‚¯ã‚¿ãƒ¼ã®ã‚³ãƒžãƒ³ãƒ‰å…¥åŠ›ã¸
#--------------------------------------------------------------------------
def phase3_prior_actor
# ループ
begin
# ã‚¢ã‚¯ã‚¿ãƒ¼ã®æ˜Žæ»…エフェクト OFF
if @active_battler != nil
@active_battler.blink = false
end
# 最åˆã®ã‚¢ã‚¯ã‚¿ãƒ¼ã®å ´åˆ
if @actor_array_index <= 0
# アクターコマンドフェーズ開始
start_phase2
return
end
# アクターã®ã‚¤ãƒ³ãƒ‡ãƒƒã‚¯ã‚¹ã‚’戻ã™
@actor_array_index -= 1
@actor_index = @pre_action_battlers[@actor_array_index].index
@active_battler = $game_party.actors[@actor_index]
@active_battler.blink = true
@active_battler.current_action.clear
# アクターãŒã‚³ãƒžãƒ³ãƒ‰å…¥åŠ›ã‚’å—ã‘付ã‘ãªã„状態ãªã‚‰ã‚‚ã†ä¸€åº¦
end until @active_battler.inputable?
# アクターコマンドウィンドウをセットアップ
phase3_setup_command_window
end
#--------------------------------------------------------------------------
# ◠アクターコマンドウィンドウã®ã‚»ãƒƒãƒˆã‚¢ãƒƒãƒ—
#--------------------------------------------------------------------------
alias phase3_setup_command_window_ctb phase3_setup_command_window
def phase3_setup_command_window
@actor_command_window.back_opacity = PARA_CTB::WINDOW_OPACITY
phase3_setup_command_window_ctb
if PARA_CTB::WINDOWPOS_CHANGE
# アクターコマンドウィンドウã®ä½ç½®ã‚’è¨å®š
@actor_command_window.x = PARA_CTB::WINDOWPOS_X
@actor_command_window.y = PARA_CTB::WINDOWPOS_Y
# ステータスウインドウã«éš れãªã„よã†ã«
@actor_command_window.z = 9999
end
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (アクターコマンドフェーズ)
#--------------------------------------------------------------------------
def update_phase3
# エãƒãƒŸãƒ¼ã‚¢ãƒãƒ¼ãŒæœ‰åйã®å ´åˆ
if @enemy_arrow != nil
@countup = PARA_CTB::SELECT_WAIT ? false : true
update_phase3_enemy_select
# アクターアãƒãƒ¼ãŒæœ‰åйã®å ´åˆ
elsif @actor_arrow != nil
@countup = PARA_CTB::SELECT_WAIT ? false : true
update_phase3_actor_select
# スã‚ãƒ«ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ãŒæœ‰åйã®å ´åˆ
elsif @skill_window != nil
@countup = PARA_CTB::SELECT_WAIT ? false : true
update_phase3_skill_select
# ã‚¢ã‚¤ãƒ†ãƒ ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ãŒæœ‰åйã®å ´åˆ
elsif @item_window != nil
@countup = PARA_CTB::SELECT_WAIT ? false : true
update_phase3_item_select
# ã‚¢ã‚¯ã‚¿ãƒ¼ã‚³ãƒžãƒ³ãƒ‰ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ãŒæœ‰åйã®å ´åˆ
elsif @actor_command_window.active
@countup = PARA_CTB::COMMAND_WAIT ? false : true
update_phase3_basic_command
end
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (アクターコマンドフェーズ : 基本コマンド)
#--------------------------------------------------------------------------
alias ctb_update_phase3_basic_command update_phase3_basic_command
def update_phase3_basic_command
ctb_update_phase3_basic_command
# LRボタンã§è¡Œå‹•é †ã‚’å¤‰æ›´
if Input.trigger?(Input::R)
shift_activer(1)
end
if Input.trigger?(Input::L)
shift_activer(-1)
end
end
#--------------------------------------------------------------------------
# ◠メインフェーズ開始
#--------------------------------------------------------------------------
def start_phase4
# フェーズ 4 ã«ç§»è¡Œ
@phase = 4
battler_count = $game_party.actors.size + $game_troop.enemies.size
if @action_count >= battler_count or $game_temp.battle_turn == 0
# ãƒãƒˆãƒ«ã‚¤ãƒ™ãƒ³ãƒˆã®å…¨ãƒšãƒ¼ã‚¸ã‚’検索
for index in 0...$data_troops[@troop_id].pages.size
# イベントページをå–å¾—
page = $data_troops[@troop_id].pages[index]
# ã“ã®ãƒšãƒ¼ã‚¸ã®ã‚¹ãƒ‘ン㌠[ターン] ã®å ´åˆ
if page.span == 1
# 実行済ã¿ãƒ•ラグをクリア
$game_temp.battle_event_flags[index] = false
end
end
# ターン数カウント
$game_temp.battle_turn += 1
@action_count = 0
end
# アクターをéžé¸æŠžçŠ¶æ…‹ã«è¨å®š
@actor_index = -1
@active_battler = nil
# パーティコマンドウィンドウを有効化
@party_command_window.active = false
@party_command_window.visible = false
# アクターコマンドウィンドウを無効化
@actor_command_window.active = false
@actor_command_window.visible = false
# メインフェーズフラグをセット
$game_temp.battle_main_phase = true
# エãƒãƒŸãƒ¼ã‚¢ã‚¯ã‚·ãƒ§ãƒ³ä½œæˆ
for enemy in $game_troop.enemies
enemy.make_action
end
# è¡Œå‹•é †åºä½œæˆ
make_action_orders
# ステップ 1 ã«ç§»è¡Œ
@phase4_step = 1
end
#--------------------------------------------------------------------------
# â— è¡Œå‹•é †åºä½œæˆ
#--------------------------------------------------------------------------
def make_action_orders
# é…列 @action_battlers ã‚’åˆæœŸåŒ–
@action_battlers = []
if @pre_action_battlers != []
for i in 0..@actor_array_index
# アクターをé…列 @action_battlers ã«è¿½åŠ
@action_battlers.push(@pre_action_battlers[0])
@pre_action_battlers.shift
end
if @pre_action_battlers.size != 0
loop do
if $game_troop.enemies.include?(@pre_action_battlers[0])
# エãƒãƒŸãƒ¼ã‚’é…列 @action_battlers ã«è¿½åŠ
@action_battlers.push(@pre_action_battlers[0])
@pre_action_battlers.shift
else
break
end
end
end
end
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (メインフェーズ ステップ 1 : アクション準備)
#--------------------------------------------------------------------------
alias ctb_update_phase4_step1 update_phase4_step1
def update_phase4_step1
@countup = true
# ãƒ˜ãƒ«ãƒ—ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚’éš ã™
@help_window.visible = false
# 勿•—判定
if judge
# å‹åˆ©ã¾ãŸã¯æ•—北ã®å ´åˆ : メソッド終了
return
end
# 未行動ãƒãƒˆãƒ©ãƒ¼ãŒå˜åœ¨ã—ãªã„å ´åˆ (全員行動ã—ãŸ)
if @action_battlers.size == 0
# アクターコマンドフェーズ開始
start_phase3
return
end
ctb_update_phase4_step1
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (メインフェーズ ステップ 2 : アクション開始)
#--------------------------------------------------------------------------
alias ctb_update_phase4_step2 update_phase4_step2
def update_phase4_step2
# 強制アクションã§ãªã‘れã°
unless @active_battler.current_action.forcing
# 制約㌠[行動ã§ããªã„] ã®å ´åˆ
if @active_battler.restriction == 4
# CTをクリア
clear_ct(@active_battler)
# アクション強制対象ã®ãƒãƒˆãƒ©ãƒ¼ã‚’クリア
$game_temp.forcing_battler = nil
# ステップ 1 ã«ç§»è¡Œ
@phase4_step = 1
return
end
end
# アニメーションå†ç”Ÿä¸ã«CTをカウントã™ã‚‹ã‹
@countup = PARA_CTB::ANIMATION_WAIT ? false : true
ctb_update_phase4_step2
end
#--------------------------------------------------------------------------
# ◠基本アクション çµæžœä½œæˆ
#--------------------------------------------------------------------------
alias make_basic_action_result_ctb make_basic_action_result
def make_basic_action_result
# 何もã—ãªã„ã®å ´åˆ
if @active_battler.current_action.basic == 3
# CTをクリア
clear_ct(@active_battler)
# アクション強制対象ã®ãƒãƒˆãƒ©ãƒ¼ã‚’クリア
$game_temp.forcing_battler = nil
# ステップ 1 ã«ç§»è¡Œ
@phase4_step = 1
return
end
make_basic_action_result_ctb
end
#--------------------------------------------------------------------------
# ◠スã‚ルアクション çµæžœä½œæˆ
#--------------------------------------------------------------------------
def make_skill_action_result
# スã‚ルをå–å¾—
@skill = $data_skills[@active_battler.current_action.skill_id]
# 強制アクションã§ãªã‘れã°
unless @active_battler.current_action.forcing
# SP 切れãªã©ã§ä½¿ç”¨ã§ããªããªã£ãŸå ´åˆ
unless @active_battler.skill_can_use?(@skill.id)
# アクション強制対象ã®ãƒãƒˆãƒ©ãƒ¼ã‚’クリア
$game_temp.forcing_battler = nil
# CTをクリア
declease_ct(@active_battler,100-PARA_CTB::ACT_SKILL_CT)
# ステップ 1 ã«ç§»è¡Œ
@phase4_step = 1
return
end
end
# SP 消費
@active_battler.sp -= @skill.sp_cost
# ステータスウィンドウをリフレッシュ
@status_window.refresh
# ヘルプウィンドウã«ã‚¹ã‚ルåを表示
@help_window.set_text(@skill.name, 1)
# アニメーション ID ã‚’è¨å®š
@animation1_id = @skill.animation1_id
@animation2_id = @skill.animation2_id
# コモンイベント ID ã‚’è¨å®š
@common_event_id = @skill.common_event_id
# 対象å´ãƒãƒˆãƒ©ãƒ¼ã‚’è¨å®š
set_target_battlers(@skill.scope)
# スã‚ルã®åŠ¹æžœã‚’é©ç”¨
for target in @target_battlers
target.skill_effect(@active_battler, @skill)
end
end
#--------------------------------------------------------------------------
# ◠アイテムアクション çµæžœä½œæˆ
#--------------------------------------------------------------------------
alias ctb_make_item_action_result make_item_action_result
def make_item_action_result
# アイテムをå–å¾—
@item = $data_items[@active_battler.current_action.item_id]
# アイテム切れãªã©ã§ä½¿ç”¨ã§ããªããªã£ãŸå ´åˆ
unless $game_party.item_can_use?(@item.id)
# CTをクリア
declease_ct(@active_battler,100-PARA_CTB::ACT_ITEM_CT)
# ステップ 1 ã«ç§»è¡Œ
@phase4_step = 1
return
end
ctb_make_item_action_result
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (メインフェーズ ステップ 5 : ダメージ表示)
#--------------------------------------------------------------------------
alias update_phase4_step5_ctb update_phase4_step5
def update_phase4_step5
# ダメージを記録
for target in @target_battlers
if target.damage != nil
target.damage_backup = target.damage
end
end
update_phase4_step5_ctb
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
#--------------------------------------------------------------------------
alias update_phase4_step6_ctb update_phase4_step6
def update_phase4_step6
@active_battler.countup = true
if @active_battler.current_action.basic == 1
# 防御
declease_ct(@active_battler,100-PARA_CTB::ACT_GUARD_CT)
else
case @active_battler.current_action.kind
# 攻撃
when 0
declease_ct(@active_battler,100-PARA_CTB::ACT_ATTACK_CT)
# スã‚ル
when 1
declease_ct(@active_battler,100-PARA_CTB::ACT_SKILL_CT)
# アイテãƒ
when 2
declease_ct(@active_battler,100-PARA_CTB::ACT_ITEM_CT)
else
clear_ct(@active_battler)
end
end
# ターゲットãŒè¡Œå‹•ä¸èƒ½ã«ãªӖ
1. Side-view with walking sprite
It uses your-typical-actor-sprite as actor battler, instead of animated ones. Basically, it's for side-view, but you can make it like front, or rear-view. It's not a CBS itself, so you can try it with other CBS scripts. I can tell you it works with RMXP default battle and its author's ATB, but may not work with some CBS.
Content Hidden
Spoiler
#==============================================================================
# ++ サイドビューãƒãƒˆãƒ«(æ©è¡Œã‚°ãƒ©ãƒ•ィック版) ver. 1.14 ++
#  Script by パラ犬
#  http://para.j-mx.com/
#------------------------------------------------------------------------------
# ãƒãƒˆãƒ«ãƒ•ã‚£ãƒ¼ãƒ«ãƒ‰ã«æ©è¡Œã‚°ãƒ©ãƒ•ィックを表示ã—ã¾ã™ã€‚
#==============================================================================
module SDVA
X_LINE = 500 # 横ä½ç½®ã®ãƒãƒˆãƒ©ãƒ¼è¡¨ç¤ºåº§æ¨™
Y_LINE = 200 # 縦ä½ç½®ã®ãƒãƒˆãƒ©ãƒ¼è¡¨ç¤ºåº§æ¨™
X_SPACE = 15 # 横ä½ç½®ã®ãƒãƒˆãƒ©ãƒ¼åŒå£«ã®é–“éš”
Y_SPACE = 40 # 縦ä½ç½®ã®ãƒãƒˆãƒ©ãƒ¼åŒå£«ã®é–“éš”
X_POSITION = 25 # 隊列[å‰è¡›ãƒ»ä¸è¡›ãƒ»å¾Œè¡›]ã®æ¨ªé–“éš”
Y_POSITION = 0 # 隊列[å‰è¡›ãƒ»ä¸è¡›ãƒ»å¾Œè¡›]ã®ç¸¦é–“éš”
ATTACK_MOVE = true # 攻撃時ã«å‰ã¸è¸ã¿å‡ºã™ã‹( true / false )
SKILL_MOVE = true # スã‚ル使用時ã«å‰ã¸è¸ã¿å‡ºã™ã‹( true / false )
ITEM_MOVE = false # アイテム使用時ã«å‰ã¸è¸ã¿å‡ºã™ã‹( true / false )
MOVE_STEP = 1 # ç§»å‹•æ©æ•°
MOVE_PIXEL = 10 # 一æ©ã‚ãŸã‚Šã®ãƒ”クセル数
PARTY_POS = 1 # ã‚ャラクターã®å‘ã( 0:下 / 1:å·¦ / 2:å³ / 3:上 )
WINDOWPOS_CHANGE = true # コマンドウインドウをãƒãƒˆãƒ©ãƒ¼ã®æ¨ªã«è¡¨ç¤ºã™ã‚‹ã‹( true / false )
end
#==============================================================================
# â– Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# â— ãƒãƒˆãƒ«ç”»é¢ X 座標ã®å–å¾—
#--------------------------------------------------------------------------
def screen_x
if self.index != nil
# 隊列をå–å¾—
pos = $data_classes[self.class_id].position
x_pos = pos * SDVA::X_POSITION
scr_x = self.index * SDVA::X_SPACE + SDVA::X_LINE + x_pos
# 移動アクションã®ã¨ã
if self.current_action.move_action == true
# 横ã«ç§»å‹•
scr_x += @shift_x
end
return scr_x
else
return 0
end
end
#--------------------------------------------------------------------------
# â— ãƒãƒˆãƒ«ç”»é¢ Y 座標ã®å–å¾—
#--------------------------------------------------------------------------
def screen_y
if self.index != nil
# 隊列をå–å¾—
pos = $data_classes[self.class_id].position
y_pos = pos * SDVA::Y_POSITION
scr_y = self.index * SDVA::Y_SPACE + SDVA::Y_LINE + y_pos
# 移動アクションã®ã¨ã
if self.current_action.move_action == true
# 縦ã«ç§»å‹•
scr_y += @shift_y
end
return scr_y
else
return 0
end
end
#--------------------------------------------------------------------------
# â— ãƒãƒˆãƒ«ç”»é¢ Z 座標ã®å–å¾—
#--------------------------------------------------------------------------
def screen_z
if self.index != nil
return self.index
else
return 0
end
end
end
#==============================================================================
# ■Game_Battler (分割定義 1)
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# ◠公開インスタンス変数
#--------------------------------------------------------------------------
attr_reader :pattern # æ©è¡Œãƒ‘ターン
attr_reader :trans_x # Xæ–¹å‘ã®ç§»å‹•è·é›¢
attr_reader :moving # 移動ä¸ãƒ•ラグ
#--------------------------------------------------------------------------
# â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
#--------------------------------------------------------------------------
alias initialize_sdva initialize
def initialize
initialize_sdva
move_reset
end
#--------------------------------------------------------------------------
# ○ 移動カウント
#--------------------------------------------------------------------------
def move
@moving = 1
if @step < SDVA::MOVE_STEP
# æ©æ•°ã‚’満ãŸã™ã¾ã§ç§»å‹•
@pattern = (@pattern + 1) % 4
@step += 1
move_step
else
# 移動終了
@pattern = 1
@moving = 2
end
end
#--------------------------------------------------------------------------
# â—‹ 移動処ç†
#--------------------------------------------------------------------------
def move_step
# パーティã®å‘ãã«ã‚ˆã£ã¦ç§»å‹•座標を変ãˆã‚‹
case SDVA::PARTY_POS
when 0
@shift_y = @step * SDVA::MOVE_PIXEL
when 1
@shift_x = -(@step * SDVA::MOVE_PIXEL)
when 2
@shift_x = @step * SDVA::MOVE_PIXEL
when 3
@shift_y = -(@step * SDVA::MOVE_PIXEL)
end
end
#--------------------------------------------------------------------------
# â—‹ 移動ã®ãƒªã‚»ãƒƒãƒˆ
#--------------------------------------------------------------------------
def move_reset
@moving = 0
@pattern = 0
@step = 0
@shift_x = 0
@shift_y = 0
end
end
#==============================================================================
# â– Game_BattleAction
#==============================================================================
class Game_BattleAction
#--------------------------------------------------------------------------
# ◠公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :move_action # 移動ã™ã‚‹ã‚¢ã‚¯ã‚·ãƒ§ãƒ³ã‹
#--------------------------------------------------------------------------
# ◠クリア
#--------------------------------------------------------------------------
alias clear_sdva clear
def clear
clear_sdva
@move_action = false
end
end
#==============================================================================
# â– Sprite_Battler
#==============================================================================
class Sprite_Battler < RPG::Sprite
#--------------------------------------------------------------------------
# ◠フレーム更新
#--------------------------------------------------------------------------
alias update_sdva update
def update
# ãƒãƒˆãƒ©ãƒ¼ãŒã‚¢ã‚¯ã‚¿ãƒ¼ã«å«ã¾ã‚Œã‚‹ã¨ã
if @battler.is_a?(Game_Actor)
# ファイルåã‹è‰²ç›¸ãŒç¾åœ¨ã®ã‚‚ã®ã¨ç•°ãªã‚‹å ´åˆ
# 行動ä¸ã®å ´åˆ
if @battler.battler_name != @battler_name or
@battler.battler_hue != @battler_hue or
@battler.current_action.basic == 0 or
@battler.current_action.kind != 3
# ビットマップをå–å¾—ã€è¨å®š
@character_name = @battler.character_name
@character_hue = @battler.character_hue
# æ©è¡Œã‚°ãƒ©ãƒ•ィックをæç”»
self.bitmap = RPG::Cache.character(@character_name, @character_hue)
cw = self.bitmap.width / 4
ch = self.bitmap.height / 4
@width = cw
@height = ch
if @battler.current_action.move_action == true
# æ©ã‹ã›ã‚‹
@battler.move
else
@battler.move_reset
end
# 転é€å…ƒã®çŸ©å½¢ã‚’è¨å®š
sx = @battler.pattern * cw
sy = SDVA::PARTY_POS * ch
self.src_rect.set(sx, sy, cw, ch)
self.ox = @width / 2
self.oy = @height
# éš ã‚ŒçŠ¶æ…‹ãªã‚‰ä¸é€æ˜Žåº¦ã‚’ 0 ã«ã™ã‚‹
if @battler.hidden
self.opacity = 0
end
end
end
update_sdva
end
end
#==============================================================================
# â– Scene_Battle
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# ◠アクターコマンドウィンドウã®ã‚»ãƒƒãƒˆã‚¢ãƒƒãƒ—
#--------------------------------------------------------------------------
alias phase3_setup_command_window_sdva phase3_setup_command_window
def phase3_setup_command_window
phase3_setup_command_window_sdva
if SDVA::WINDOWPOS_CHANGE
# アクターコマンドウィンドウã®ä½ç½®ã‚’è¨å®š
case SDVA::PARTY_POS
when 0
x_pos = @active_battler.screen_x - (@actor_command_window.width/2)
y_pos = @active_battler.screen_y
when 1
x_pos = @active_battler.screen_x - @actor_command_window.width - 16
y_pos = @active_battler.screen_y - @actor_command_window.height
when 2
x_pos = @active_battler.screen_x + 16
y_pos = @active_battler.screen_y - @actor_command_window.height
when 3
x_pos = @active_battler.screen_x - (@actor_command_window.width/2)
y_pos = @active_battler.screen_y - @actor_command_window.height - 48
end
@actor_command_window.x = x_pos >= 0 ? x_pos : 0
@actor_command_window.x = x_pos+@actor_command_window.width <= 640 ? x_pos : 640-@actor_command_window.width
@actor_command_window.y = y_pos >= 0 ? y_pos : 0
@actor_command_window.y = y_pos+@actor_command_window.height <= 480 ? y_pos : 480-@actor_command_window.height
# ステータスウインドウã«éš れãªã„よã†ã«
@actor_command_window.z = 9999
end
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (メインフェーズ ステップ 3 : 行動å´ã‚¢ãƒ‹ãƒ¡ãƒ¼ã‚·ãƒ§ãƒ³)
#--------------------------------------------------------------------------
alias update_phase4_step3_sdva update_phase4_step3
def update_phase4_step3
if SDVA::ATTACK_MOVE
if @active_battler.current_action.basic == 0
@active_battler.current_action.move_action = true
end
end
if SDVA::SKILL_MOVE
if @active_battler.current_action.kind == 1
@active_battler.current_action.move_action = true
end
end
if SDVA::ITEM_MOVE
if @active_battler.current_action.kind == 2
@active_battler.current_action.move_action = true
end
end
# ãƒãƒˆãƒ©ãƒ¼ãŒã‚¢ã‚¯ã‚¿ãƒ¼ã«å«ã¾ã‚Œã€ç§»å‹•アクションä¸
if @active_battler.is_a?(Game_Actor) and
@active_battler.current_action.move_action
# 移動終了時
if @active_battler.moving == 2
update_phase4_step3_sdva
end
elsif @active_battler.moving == 0
update_phase4_step3_sdva
end
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
#--------------------------------------------------------------------------
alias update_phase4_step6_sdva update_phase4_step6
def update_phase4_step6
@active_battler.current_action.move_action = false
@active_battler.move_reset
update_phase4_step6_sdva
end
end
#==============================================================================
# â– Spriteset_Battle
#==============================================================================
class Spriteset_Battle
#--------------------------------------------------------------------------
# â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
#--------------------------------------------------------------------------
alias initialize_sdva initialize
def initialize
initialize_sdva
@viewport2.z = 1
end
end
#==============================================================================
# â– Arrow_Actor
#==============================================================================
class Arrow_Actor < Arrow_Base
#--------------------------------------------------------------------------
# ◠フレーム更新
#--------------------------------------------------------------------------
alias update_sdva update
def update
update_sdva
# カーソル下
if Input.repeat?(Input::DOWN)
$game_system.se_play($data_system.cursor_se)
@index += 1
@index %= $game_party.actors.size
end
# カーソル上
if Input.repeat?(Input::UP)
$game_system.se_play($data_system.cursor_se)
@index += $game_party.actors.size - 1
@index %= $game_party.actors.size
end
end
end
#==============================================================================
# â– Arrow_Enemy
#==============================================================================
class Arrow_Enemy < Arrow_Base
#--------------------------------------------------------------------------
# ◠フレーム更新
#--------------------------------------------------------------------------
alias update_sdva update
def update
update_sdva
# カーソル下
if Input.repeat?(Input::DOWN)
$game_system.se_play($data_system.cursor_se)
$game_troop.enemies.size.times do
@index += 1
@index %= $game_troop.enemies.size
break if self.enemy.exist?
end
end
# カーソル上
if Input.repeat?(Input::UP)
$game_system.se_play($data_system.cursor_se)
$game_troop.enemies.size.times do
@index += $game_troop.enemies.size - 1
@index %= $game_troop.enemies.size
break if self.enemy.exist?
end
end
end
end
# ++ サイドビューãƒãƒˆãƒ«(æ©è¡Œã‚°ãƒ©ãƒ•ィック版) ver. 1.14 ++
#  Script by パラ犬
#  http://para.j-mx.com/
#------------------------------------------------------------------------------
# ãƒãƒˆãƒ«ãƒ•ã‚£ãƒ¼ãƒ«ãƒ‰ã«æ©è¡Œã‚°ãƒ©ãƒ•ィックを表示ã—ã¾ã™ã€‚
#==============================================================================
module SDVA
X_LINE = 500 # 横ä½ç½®ã®ãƒãƒˆãƒ©ãƒ¼è¡¨ç¤ºåº§æ¨™
Y_LINE = 200 # 縦ä½ç½®ã®ãƒãƒˆãƒ©ãƒ¼è¡¨ç¤ºåº§æ¨™
X_SPACE = 15 # 横ä½ç½®ã®ãƒãƒˆãƒ©ãƒ¼åŒå£«ã®é–“éš”
Y_SPACE = 40 # 縦ä½ç½®ã®ãƒãƒˆãƒ©ãƒ¼åŒå£«ã®é–“éš”
X_POSITION = 25 # 隊列[å‰è¡›ãƒ»ä¸è¡›ãƒ»å¾Œè¡›]ã®æ¨ªé–“éš”
Y_POSITION = 0 # 隊列[å‰è¡›ãƒ»ä¸è¡›ãƒ»å¾Œè¡›]ã®ç¸¦é–“éš”
ATTACK_MOVE = true # 攻撃時ã«å‰ã¸è¸ã¿å‡ºã™ã‹( true / false )
SKILL_MOVE = true # スã‚ル使用時ã«å‰ã¸è¸ã¿å‡ºã™ã‹( true / false )
ITEM_MOVE = false # アイテム使用時ã«å‰ã¸è¸ã¿å‡ºã™ã‹( true / false )
MOVE_STEP = 1 # ç§»å‹•æ©æ•°
MOVE_PIXEL = 10 # 一æ©ã‚ãŸã‚Šã®ãƒ”クセル数
PARTY_POS = 1 # ã‚ャラクターã®å‘ã( 0:下 / 1:å·¦ / 2:å³ / 3:上 )
WINDOWPOS_CHANGE = true # コマンドウインドウをãƒãƒˆãƒ©ãƒ¼ã®æ¨ªã«è¡¨ç¤ºã™ã‚‹ã‹( true / false )
end
#==============================================================================
# â– Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# â— ãƒãƒˆãƒ«ç”»é¢ X 座標ã®å–å¾—
#--------------------------------------------------------------------------
def screen_x
if self.index != nil
# 隊列をå–å¾—
pos = $data_classes[self.class_id].position
x_pos = pos * SDVA::X_POSITION
scr_x = self.index * SDVA::X_SPACE + SDVA::X_LINE + x_pos
# 移動アクションã®ã¨ã
if self.current_action.move_action == true
# 横ã«ç§»å‹•
scr_x += @shift_x
end
return scr_x
else
return 0
end
end
#--------------------------------------------------------------------------
# â— ãƒãƒˆãƒ«ç”»é¢ Y 座標ã®å–å¾—
#--------------------------------------------------------------------------
def screen_y
if self.index != nil
# 隊列をå–å¾—
pos = $data_classes[self.class_id].position
y_pos = pos * SDVA::Y_POSITION
scr_y = self.index * SDVA::Y_SPACE + SDVA::Y_LINE + y_pos
# 移動アクションã®ã¨ã
if self.current_action.move_action == true
# 縦ã«ç§»å‹•
scr_y += @shift_y
end
return scr_y
else
return 0
end
end
#--------------------------------------------------------------------------
# â— ãƒãƒˆãƒ«ç”»é¢ Z 座標ã®å–å¾—
#--------------------------------------------------------------------------
def screen_z
if self.index != nil
return self.index
else
return 0
end
end
end
#==============================================================================
# ■Game_Battler (分割定義 1)
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# ◠公開インスタンス変数
#--------------------------------------------------------------------------
attr_reader :pattern # æ©è¡Œãƒ‘ターン
attr_reader :trans_x # Xæ–¹å‘ã®ç§»å‹•è·é›¢
attr_reader :moving # 移動ä¸ãƒ•ラグ
#--------------------------------------------------------------------------
# â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
#--------------------------------------------------------------------------
alias initialize_sdva initialize
def initialize
initialize_sdva
move_reset
end
#--------------------------------------------------------------------------
# ○ 移動カウント
#--------------------------------------------------------------------------
def move
@moving = 1
if @step < SDVA::MOVE_STEP
# æ©æ•°ã‚’満ãŸã™ã¾ã§ç§»å‹•
@pattern = (@pattern + 1) % 4
@step += 1
move_step
else
# 移動終了
@pattern = 1
@moving = 2
end
end
#--------------------------------------------------------------------------
# â—‹ 移動処ç†
#--------------------------------------------------------------------------
def move_step
# パーティã®å‘ãã«ã‚ˆã£ã¦ç§»å‹•座標を変ãˆã‚‹
case SDVA::PARTY_POS
when 0
@shift_y = @step * SDVA::MOVE_PIXEL
when 1
@shift_x = -(@step * SDVA::MOVE_PIXEL)
when 2
@shift_x = @step * SDVA::MOVE_PIXEL
when 3
@shift_y = -(@step * SDVA::MOVE_PIXEL)
end
end
#--------------------------------------------------------------------------
# â—‹ 移動ã®ãƒªã‚»ãƒƒãƒˆ
#--------------------------------------------------------------------------
def move_reset
@moving = 0
@pattern = 0
@step = 0
@shift_x = 0
@shift_y = 0
end
end
#==============================================================================
# â– Game_BattleAction
#==============================================================================
class Game_BattleAction
#--------------------------------------------------------------------------
# ◠公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :move_action # 移動ã™ã‚‹ã‚¢ã‚¯ã‚·ãƒ§ãƒ³ã‹
#--------------------------------------------------------------------------
# ◠クリア
#--------------------------------------------------------------------------
alias clear_sdva clear
def clear
clear_sdva
@move_action = false
end
end
#==============================================================================
# â– Sprite_Battler
#==============================================================================
class Sprite_Battler < RPG::Sprite
#--------------------------------------------------------------------------
# ◠フレーム更新
#--------------------------------------------------------------------------
alias update_sdva update
def update
# ãƒãƒˆãƒ©ãƒ¼ãŒã‚¢ã‚¯ã‚¿ãƒ¼ã«å«ã¾ã‚Œã‚‹ã¨ã
if @battler.is_a?(Game_Actor)
# ファイルåã‹è‰²ç›¸ãŒç¾åœ¨ã®ã‚‚ã®ã¨ç•°ãªã‚‹å ´åˆ
# 行動ä¸ã®å ´åˆ
if @battler.battler_name != @battler_name or
@battler.battler_hue != @battler_hue or
@battler.current_action.basic == 0 or
@battler.current_action.kind != 3
# ビットマップをå–å¾—ã€è¨å®š
@character_name = @battler.character_name
@character_hue = @battler.character_hue
# æ©è¡Œã‚°ãƒ©ãƒ•ィックをæç”»
self.bitmap = RPG::Cache.character(@character_name, @character_hue)
cw = self.bitmap.width / 4
ch = self.bitmap.height / 4
@width = cw
@height = ch
if @battler.current_action.move_action == true
# æ©ã‹ã›ã‚‹
@battler.move
else
@battler.move_reset
end
# 転é€å…ƒã®çŸ©å½¢ã‚’è¨å®š
sx = @battler.pattern * cw
sy = SDVA::PARTY_POS * ch
self.src_rect.set(sx, sy, cw, ch)
self.ox = @width / 2
self.oy = @height
# éš ã‚ŒçŠ¶æ…‹ãªã‚‰ä¸é€æ˜Žåº¦ã‚’ 0 ã«ã™ã‚‹
if @battler.hidden
self.opacity = 0
end
end
end
update_sdva
end
end
#==============================================================================
# â– Scene_Battle
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# ◠アクターコマンドウィンドウã®ã‚»ãƒƒãƒˆã‚¢ãƒƒãƒ—
#--------------------------------------------------------------------------
alias phase3_setup_command_window_sdva phase3_setup_command_window
def phase3_setup_command_window
phase3_setup_command_window_sdva
if SDVA::WINDOWPOS_CHANGE
# アクターコマンドウィンドウã®ä½ç½®ã‚’è¨å®š
case SDVA::PARTY_POS
when 0
x_pos = @active_battler.screen_x - (@actor_command_window.width/2)
y_pos = @active_battler.screen_y
when 1
x_pos = @active_battler.screen_x - @actor_command_window.width - 16
y_pos = @active_battler.screen_y - @actor_command_window.height
when 2
x_pos = @active_battler.screen_x + 16
y_pos = @active_battler.screen_y - @actor_command_window.height
when 3
x_pos = @active_battler.screen_x - (@actor_command_window.width/2)
y_pos = @active_battler.screen_y - @actor_command_window.height - 48
end
@actor_command_window.x = x_pos >= 0 ? x_pos : 0
@actor_command_window.x = x_pos+@actor_command_window.width <= 640 ? x_pos : 640-@actor_command_window.width
@actor_command_window.y = y_pos >= 0 ? y_pos : 0
@actor_command_window.y = y_pos+@actor_command_window.height <= 480 ? y_pos : 480-@actor_command_window.height
# ステータスウインドウã«éš れãªã„よã†ã«
@actor_command_window.z = 9999
end
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (メインフェーズ ステップ 3 : 行動å´ã‚¢ãƒ‹ãƒ¡ãƒ¼ã‚·ãƒ§ãƒ³)
#--------------------------------------------------------------------------
alias update_phase4_step3_sdva update_phase4_step3
def update_phase4_step3
if SDVA::ATTACK_MOVE
if @active_battler.current_action.basic == 0
@active_battler.current_action.move_action = true
end
end
if SDVA::SKILL_MOVE
if @active_battler.current_action.kind == 1
@active_battler.current_action.move_action = true
end
end
if SDVA::ITEM_MOVE
if @active_battler.current_action.kind == 2
@active_battler.current_action.move_action = true
end
end
# ãƒãƒˆãƒ©ãƒ¼ãŒã‚¢ã‚¯ã‚¿ãƒ¼ã«å«ã¾ã‚Œã€ç§»å‹•アクションä¸
if @active_battler.is_a?(Game_Actor) and
@active_battler.current_action.move_action
# 移動終了時
if @active_battler.moving == 2
update_phase4_step3_sdva
end
elsif @active_battler.moving == 0
update_phase4_step3_sdva
end
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
#--------------------------------------------------------------------------
alias update_phase4_step6_sdva update_phase4_step6
def update_phase4_step6
@active_battler.current_action.move_action = false
@active_battler.move_reset
update_phase4_step6_sdva
end
end
#==============================================================================
# â– Spriteset_Battle
#==============================================================================
class Spriteset_Battle
#--------------------------------------------------------------------------
# â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
#--------------------------------------------------------------------------
alias initialize_sdva initialize
def initialize
initialize_sdva
@viewport2.z = 1
end
end
#==============================================================================
# â– Arrow_Actor
#==============================================================================
class Arrow_Actor < Arrow_Base
#--------------------------------------------------------------------------
# ◠フレーム更新
#--------------------------------------------------------------------------
alias update_sdva update
def update
update_sdva
# カーソル下
if Input.repeat?(Input::DOWN)
$game_system.se_play($data_system.cursor_se)
@index += 1
@index %= $game_party.actors.size
end
# カーソル上
if Input.repeat?(Input::UP)
$game_system.se_play($data_system.cursor_se)
@index += $game_party.actors.size - 1
@index %= $game_party.actors.size
end
end
end
#==============================================================================
# â– Arrow_Enemy
#==============================================================================
class Arrow_Enemy < Arrow_Base
#--------------------------------------------------------------------------
# ◠フレーム更新
#--------------------------------------------------------------------------
alias update_sdva update
def update
update_sdva
# カーソル下
if Input.repeat?(Input::DOWN)
$game_system.se_play($data_system.cursor_se)
$game_troop.enemies.size.times do
@index += 1
@index %= $game_troop.enemies.size
break if self.enemy.exist?
end
end
# カーソル上
if Input.repeat?(Input::UP)
$game_system.se_play($data_system.cursor_se)
$game_troop.enemies.size.times do
@index += $game_troop.enemies.size - 1
@index %= $game_troop.enemies.size
break if self.enemy.exist?
end
end
end
end
Expand to see the code.
2. Active Time Battle
http://para.j-mx.com/rgss/script/ctb.html
It's a typical ATB, like SNES FF series. It works with Side-view script above, Side-view battle from RGSS Wiki, and RM2k3 style Side-view by RaiseField.
[spoiler]
[code]
#==============================================================================
# ++ アクティブタイムãƒãƒˆãƒ«ã€€ver. 2.56 ++
#  Script by パラ犬
#  http://para.j-mx.com/
#------------------------------------------------------------------------------
# CTã‚²ãƒ¼ã‚¸ãŒæºœã¾ã£ãŸãƒãƒˆãƒ©ãƒ¼ã‹ã‚‰é †ã«ã‚³ãƒžãƒ³ãƒ‰å…¥åŠ›ã™ã‚‹æˆ¦é—˜å½¢å¼ã€‚
# ãƒãƒˆãƒ«ã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹ç”»é¢ã‚’サイドビューらã—ãã™ã‚‹æ©Ÿèƒ½ã‚‚ã‚りã¾ã™ã€‚
# ãƒãƒˆãƒ©ãƒ¼ã‚’サイドビュータイプã«è¡¨ç¤ºã™ã‚‹ã‚¹ã‚¯ãƒªãƒ—トã¯ã€ãŠå¥½ããªã‚‚ã®ã‚’
# 用æ„ã—ã¦ãã ã•ã„。
#------------------------------------------------------------------------------
#[è¨ç½®ä¸Šã®æ³¨æ„]
# ã§ãã‚‹ã ã‘リストã®ä¸Šã®ã»ã†ã«ç½®ã„ã¦ãã ã•ã„。(Scene_Debugよりã¯ä¸‹)
#------------------------------------------------------------------------------
#[æ“作]
#・逃走
# 味方ãƒãƒˆãƒ©ãƒ¼ã®ä¸€äººä»¥ä¸ŠãŒã‚³ãƒžãƒ³ãƒ‰å…¥åЛ待ã¡ã®ã¨ãã«ã‚ャンセルボタンを押ã™ã“ã¨ã§
# 「逃ã’ã‚‹ã€ã‚³ãƒžãƒ³ãƒ‰ãŒé¸æŠžã§ãã¾ã™ã€‚
#ã€€æ•µã®æ•°ãŒå¤šã‹ã£ãŸã‚Šã€ã‚³ãƒžãƒ³ãƒ‰å…¥åЛ待ã¡ã®ãƒãƒˆãƒ©ãƒ¼ãŒå°‘ãªã„ã¨ã€
# 逃走æˆåŠŸçŽ‡ãŒä½Žããªã‚Šã¾ã™ã€‚
#
#ãƒ»è¡Œå‹•é †ã®å…¥ã‚Œæ›¿ãˆ
# 複数ã®ãƒãƒˆãƒ©ãƒ¼ãŒè¡Œå‹•å¯èƒ½ã®ã¨ãã€
# Rボタン(PageDownã‚ー)ã§æ¬¡ã®ãƒãƒˆãƒ©ãƒ¼ã¨é †ç•ªã‚’入れ替ãˆã€
# Lボタン(PageUpã‚ー)ã§è¡Œå‹•é †ã‚’ã„ã¡ã°ã‚“最後ã«å›žã—ã¾ã™ã€‚
#==============================================================================
module PARA_CTB
# コマンド入力時ã«CTã®ã‚«ã‚¦ãƒ³ãƒˆã‚’æ¢ã‚ã‚‹ã‹(true:æ¢ã‚ã‚‹ / false:æ¢ã‚ãªã„)
COMMAND_WAIT = false
# アイテムã€ã‚¹ã‚ルã€ã‚¿ãƒ¼ã‚²ãƒƒãƒˆé¸æŠžæ™‚ã«CTã®ã‚«ã‚¦ãƒ³ãƒˆã‚’æ¢ã‚ã‚‹ã‹(true:æ¢ã‚ã‚‹ / false:æ¢ã‚ãªã„)
SELECT_WAIT = true
# アニメーション表示時ã«CTã®ã‚«ã‚¦ãƒ³ãƒˆã‚’æ¢ã‚ã‚‹ã‹(true:æ¢ã‚ã‚‹ / false:æ¢ã‚ãªã„)
ANIMATION_WAIT = false
# ãƒãƒˆãƒ«ã‚¹ãƒ”ード(数値ãŒå¤§ãã„ã»ã©CTã®æºœã¾ã‚ŠãŒé€Ÿããªã‚‹)
BATTLE_SPEED = 3
# ãƒãƒˆãƒ«ãƒ¡ãƒ³ãƒãƒ¼ã®æœ€å¤§æ•°(多人数PTスクリプトを導入ã—ã¦ã„る時ã«è¨å®š)
PARTY_SIZE = 4
# 行動終了時ã®CT減少パーセンテージ
ACT_ATTACK_CT = 100 # 通常攻撃
ACT_GUARD_CT = 100 # 防御
ACT_ESCAPE_CT = 100 # 逃走失敗
ACT_SKILL_CT = 100 # スã‚ル
ACT_ITEM_CT = 100 # アイテãƒ
# 逃走失敗時ã®ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸
UNESCAPE_MES = "逃走失敗"
# CT満タン時ã®åŠ¹æžœéŸ³(""ã§éŸ³ã‚’鳴らã•ãªã„)
# 効果音ã¯ã€ŒAudio/SEã€ãƒ•ォルダ内
FULL_CT_SE = "015-Jump01"
# 効果音ã®ãƒœãƒªãƒ¥ãƒ¼ãƒ
FULL_CT_SE_VOL = 80
# CT満タン時ã®ãƒãƒˆãƒ©ãƒ¼ã®è‰²èª¿((0,0,0)ã§å¤‰åŒ–ãªã—)
FULL_CT_COLOR = Tone.new(32,0,0)
# HPゲージã®è‰²(グラデーション左端)
HP_COLOR_LEFT = Color.new(128, 0, 0, 255)
# HPゲージã®è‰²(グラデーションå³ç«¯)
HP_COLOR_RIGHT= Color.new(255, 0, 0, 255)
# SPゲージã®è‰²(グラデーション左端)
SP_COLOR_LEFT = Color.new(0, 0, 128, 255)
# SPゲージã®è‰²(グラデーションå³ç«¯)
SP_COLOR_RIGHT= Color.new(0, 0, 255, 255)
# CTゲージã®è‰²(グラデーション左端)
COLOR_LEFT = Color.new(128, 128, 64, 255)
# CTゲージã®è‰²(グラデーションå³ç«¯)
COLOR_RIGHT= Color.new(255, 255, 128, 255)
# CTãŒæº€ã‚¿ãƒ³ã«ãªã£ãŸã¨ãã®ã‚²ãƒ¼ã‚¸ã®è‰²
COLOR_FULL = Color.new(255, 225, 128, 255)
# ã‚²ãƒ¼ã‚¸æž ã®è‰²
FRAME_COLOR = Color.new(192, 192, 192, 255)
# ã‚²ãƒ¼ã‚¸æž ã®å¤ªã•
FRAME_BORDER = 1
# ゲージã®èƒŒæ™¯è‰²
BACK_COLOR = Color.new(128, 128, 128, 128)
# åå‰ã®ãƒ•ォントサイズ
NAME_FONT_SIZE = 16
# HP/SPã®ãƒ•ォントサイズ
HPSP_FONT_SIZE = 18
# エãƒãƒŸãƒ¼åã®ãƒ•ォントサイズ
ENEMY_FONT_SIZE = 16
# 最大HP/SPã‚’æç”»ã™ã‚‹ã‹( true / false )
MAX_DRAW = false
# エãƒãƒŸãƒ¼åをグループ化( true / false )
# (trueã«ã™ã‚‹ã¨ã€Œã‚´ãƒ¼ã‚¹ãƒˆ 2ã€ã®ã‚ˆã†ã«ã¾ã¨ã‚ã¦è¡¨ç¤ºã—ã¾ã™)
ENEMY_GROUPING = false
# エãƒãƒŸãƒ¼åã®ä¸‹ã«ã‚²ãƒ¼ã‚¸ã‚’表示( 0:ãªã— / 1:HP / 2:CT )
# (エãƒãƒŸãƒ¼åをグループ化ã—ã¦ã„ã‚‹å ´åˆã¯ç„¡åй)
ENEMY_DRAWING_MATER = 0
# アクターã®ãƒ˜ãƒ«ãƒ—ウインドウã«HP/SPゲージを表示( true / false )
HELP_DRAWING_MATER_ACTOR = false
# エãƒãƒŸãƒ¼ã®ãƒ˜ãƒ«ãƒ—ウインドウã«HP/SPゲージを表示( true / false )
HELP_DRAWING_MATER_ENEMY = false
# コマンドウインドウã®ä½ç½®ã‚’強制指定( true / false )
#(ä»–ã®æ–¹ã®ã‚µã‚¤ãƒ‰ãƒ“ュースクリプトを併用ã—ã¦ã„ã¦
# コマンドウインドウã®ä½ç½®ãŒã©ã†ã—ã¦ã‚‚ä¸è‡ªç„¶ã«ãªã‚‹ãªã‚‰trueã«)
# ※trueã«ã—ã¦ã‚‚é©ç”¨ã•れãªã„å ´åˆã€ã“ã®ã‚¹ã‚¯ãƒªãƒ—トを
#  サイドビューよりも下ã«ç½®ã„ã¦ã¿ã¦ãã ã•ã„
WINDOWPOS_CHANGE = false
WINDOWPOS_X = 100 # X座標
WINDOWPOS_Y = 320 # Y座標
# コマンドウインドウã®ä¸é€æ˜Žåº¦
WINDOW_OPACITY = 160
# CTã®ã‚«ã‚¦ãƒ³ãƒˆé–“隔。少ãªã„ã»ã©ã‚²ãƒ¼ã‚¸æç”»ãŒãªã‚らã‹ã«ã€‚(最å°å€¤ã¯0)
# 処ç†ãŒé‡ã„å ´åˆã¯ã€ã“ã®æ•°å€¤ã‚’上ã’ã¦ãã ã•ã„。
CT_SKIP = 2
end
# ↑ è¨å®šé …ç›®ã“ã“ã¾ã§
#------------------------------------------------------------------------------
#==============================================================================
# â– Scene_Battle
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# â—‹ CTã®ã‚«ã‚¦ãƒ³ãƒˆ
#--------------------------------------------------------------------------
def update_ct
# カウントアップãŒè¨±å¯ã•れã¦ã„ã‚‹ã¨ã
if @countup
for actor in $game_party.actors
# 行動ã§ãã‚‹ã‹
if actor.movable? == false and actor.ct_visible and @phase4_step != 5
# ä¸å¯è¦–状態ã§ã‚«ã‚¦ãƒ³ãƒˆã‚¢ãƒƒãƒ—
actor.ct_visible = false
actor.countup = true
actor.full_ct = false
elsif actor.movable? and actor.ct_visible == false
# ä¸å¯è¦–カウントアップを解除
clear_ct(actor)
actor.ct_visible = true
end
# アクターã®å…¥ã‚Œæ›¿ãˆã«å¯¾å¿œ
if actor.max_ct == 0
actor.max_ct = @max_ct
end
# アクターã®ã‚«ã‚¦ãƒ³ãƒˆã‚¢ãƒƒãƒ—
if actor.countup
# CTãŒmaxã«ãªã£ã¦ãŠã‚Šã€ã‚³ãƒžãƒ³ãƒ‰å…¥åЛ待ã¡ã‚¢ã‚¯ã‚¿ãƒ¼ã«å«ã¾ã‚Œãªã„
if actor.now_ct >= @max_ct and !(@pre_action_battlers.include?(actor))
# コマンド入力待ã¡ã‚¢ã‚¯ã‚¿ãƒ¼ã«è¿½åŠ
@pre_action_battlers.push(actor)
@action_count += 1
# 効果音を鳴らã™
if PARA_CTB::FULL_CT_SE != "" and actor.ct_visible
Audio.se_play("Audio/SE/" + PARA_CTB::FULL_CT_SE,PARA_CTB::FULL_CT_SE_VOL)
end
# ãれ以上カウントアップã—ãªã„
actor.countup = false
actor.full_ct = true
else
# カウントアップ
actor.make_action_speed
ct_skip = PARA_CTB::CT_SKIP != 0 ? PARA_CTB::CT_SKIP : 1
actor.now_ct += actor.current_action.speed * PARA_CTB::BATTLE_SPEED * ct_skip
end
end
end
for enemy in $game_troop.enemies
# 行動ã§ãã‚‹ã‹
if enemy.movable? == false and enemy.ct_visible and @phase4_step == 5
# ä¸å¯è¦–状態ã§ã‚«ã‚¦ãƒ³ãƒˆã‚¢ãƒƒãƒ—
enemy.ct_visible = false
enemy.countup = true
enemy.full_ct = false
elsif enemy.movable? and enemy.ct_visible == false
# ä¸å¯è¦–カウントアップを解除
clear_ct(enemy)
enemy.ct_visible = true
end
# エãƒãƒŸãƒ¼ã®ã‚«ã‚¦ãƒ³ãƒˆã‚¢ãƒƒãƒ—
if enemy.countup
# CTãŒmaxã«ãªã£ã¦ãŠã‚Šã€è¡Œå‹•å¾…ã¡ã‚¨ãƒãƒŸãƒ¼ã«å«ã¾ã‚Œãªã„
if enemy.now_ct >= @max_ct and ! @pre_action_battlers.include?(enemy)
# 行動待ã¡ã‚¨ãƒãƒŸãƒ¼ã«è¿½åŠ
@pre_action_battlers.push(enemy)
@action_count += 1
# ãれ以上カウントアップã—ãªã„
enemy.countup = false
enemy.full_ct = true
else
# カウントアップ
enemy.make_action_speed
enemy.now_ct += enemy.current_action.speed * PARA_CTB::BATTLE_SPEED
end
end
end
# CTã‚²ãƒ¼ã‚¸ã‚’å†æç”»
@status_window.refresh_ct
@status_window2.refresh_ct
end
end
#--------------------------------------------------------------------------
# â—‹ ãƒãƒˆãƒ©ãƒ¼ã®CTã‚’0ã«
#--------------------------------------------------------------------------
def clear_ct(battler)
battler.countup = true
battler.now_ct = 0
battler.full_ct = false
end
#--------------------------------------------------------------------------
# â—‹ ãƒãƒˆãƒ©ãƒ¼ã®CTã‚’ä»»æ„ã®ãƒ‘ーセンテージã«
#--------------------------------------------------------------------------
def declease_ct(battler,percent)
battler.countup = true
battler.now_ct = battler.now_ct * percent / 100
battler.full_ct = false
end
#--------------------------------------------------------------------------
# â—‹ CTã®åˆæœŸåŒ–
#--------------------------------------------------------------------------
def initialize_ct
# CTã®åŸºæº–値を決定
max_ct
for battler in $game_party.actors + $game_troop.enemies
if battler.movable?
n = $game_party.actors.size + $game_troop.enemies.size
# 戦闘開始時ã«ã‚る程度ã®CTを溜ã‚ã¦ãŠã
battler.now_ct = battler.agi * 60 * n
battler.ct_visible = true
else
clear_ct(battler)
battler.ct_visible = false
end
battler.countup = true
battler.full_ct = false
battler.max_ct = @max_ct
end
end
#--------------------------------------------------------------------------
# â—‹ ãƒãƒˆãƒ©ãƒ¼å…¨å“¡ã®ç´ æ—©ã•ã‹ã‚‰CTã®åŸºæº–値を決定
#--------------------------------------------------------------------------
def max_ct
for battler in $game_party.actors + $game_troop.enemies
@max_ct += battler.agi
end
@max_ct *= 100
end
#--------------------------------------------------------------------------
# â—‹ ãƒãƒˆãƒ©ãƒ¼ã®è¡Œå‹•é †ã‚’å¤‰æ›´
#--------------------------------------------------------------------------
def shift_activer(shift)
# 一ã¤ã‚·ãƒ•トã™ã‚‹æ™‚ã§å¾Œã‚ã®ã‚¢ã‚¯ã‚¿ãƒ¼ãŒ2人以上
if @pre_action_battlers != nil
if shift == 1 and @pre_action_battlers.size >= @actor_array_index + 3
# ç¾åœ¨ã®ã‚¢ã‚¯ã‚¿ãƒ¼ã‚’å–å¾—
act = @pre_action_battlers[@actor_array_index]
# ç¾åœ¨ã®ã‚¢ã‚¯ã‚¿ãƒ¼ã‚’二ã¤å¾Œã‚ã«æŒ¿å…¥
@pre_action_battlers.insert(@actor_array_index+2, act)
# ç¾åœ¨ä½ç½®ã‚’消去
@pre_action_battlers.delete_at(@actor_array_index)
@actor_array_index -= 1
phase3_next_actor
else
act = @pre_action_battlers[@actor_array_index]
# ç¾åœ¨ã®ã‚¢ã‚¯ã‚¿ãƒ¼ã‚’一番後ã‚ã«è¿½åŠ
@pre_action_battlers.push(act)
# ç¾åœ¨ä½ç½®ã‚’消去
@pre_action_battlers.delete_at(@actor_array_index)
@actor_array_index -= 1
phase3_next_actor
end
end
end
#--------------------------------------------------------------------------
# ◠メイン処ç†
#--------------------------------------------------------------------------
alias main_ctb main
def main
# エãƒãƒŸãƒ¼åウインドウを作æˆ
@status_window2 = Window_BattleStatus_enemy.new
@action_battlers = []
@pre_action_battlers = []
@max_ct = 0
@countup = false
@ct_wait = 0
@action_count = 0
main_ctb
# エãƒãƒŸãƒ¼åã‚¦ã‚¤ãƒ³ãƒ‰ã‚¦ã‚’ç ´æ£„
@status_window2.dispose
end
#--------------------------------------------------------------------------
# ◠フレーム更新
#--------------------------------------------------------------------------
alias ctb_update update
def update
# ãƒãƒˆãƒ«ã‚¤ãƒ™ãƒ³ãƒˆå®Ÿè¡Œä¸ã®å ´åˆ
if $game_system.battle_interpreter.running?
# インタプリタを更新
$game_system.battle_interpreter.update
# アクションを強制ã•れã¦ã„ã‚‹ãƒãƒˆãƒ©ãƒ¼ãŒå˜åœ¨ã—ãªã„å ´åˆ
if $game_temp.forcing_battler == nil
# ãƒãƒˆãƒ«ã‚¤ãƒ™ãƒ³ãƒˆã®å®Ÿè¡ŒãŒçµ‚ã‚ã£ãŸå ´åˆ
unless $game_system.battle_interpreter.running?
# 戦闘継続ã®å ´åˆã€ãƒãƒˆãƒ«ã‚¤ãƒ™ãƒ³ãƒˆã®ã‚»ãƒƒãƒˆã‚¢ãƒƒãƒ—ã‚’å†å®Ÿè¡Œ
unless judge
setup_battle_event
end
end
# アフターãƒãƒˆãƒ«ãƒ•ェーズã§ãªã‘れã°
if @phase != 5
# ステータスウィンドウをリフレッシュ
@status_window.refresh
# エãƒãƒŸãƒ¼åリストを更新
@status_window2.refresh
end
end
else
if PARA_CTB::CT_SKIP == 0
update_ct
else
if @ct_wait > 0
@ct_wait -= 1
else
update_ct
@ct_wait = PARA_CTB::CT_SKIP
end
end
end
ctb_update
end
#--------------------------------------------------------------------------
# ◠プレãƒãƒˆãƒ«ãƒ•ェーズ開始
#--------------------------------------------------------------------------
alias ctb_start_phase1 start_phase1
def start_phase1
# CTã‚’åˆæœŸåŒ–
initialize_ct
# カウントアップ開始
@countup = true
ctb_start_phase1
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (プレãƒãƒˆãƒ«ãƒ•ェーズ)
#--------------------------------------------------------------------------
def update_phase1
# エãƒãƒŸãƒ¼åリストを更新
@status_window2.refresh
# 勿•—判定
if judge
# å‹åˆ©ã¾ãŸã¯æ•—北ã®å ´åˆ : メソッド終了
return
end
# パーティーコマンドフェーズを飛ã°ã—ã¦ã‚¢ã‚¯ã‚¿ãƒ¼ã‚³ãƒžãƒ³ãƒ‰ãƒ•ェーズ開始
start_phase3
end
#--------------------------------------------------------------------------
# ◠パーティコマンドフェーズ開始
#--------------------------------------------------------------------------
def start_phase2
# フェーズ 2 ã«ç§»è¡Œ
@phase = 2
# アクターをéžé¸æŠžçŠ¶æ…‹ã«è¨å®š
@actor_index = -1
@active_battler = nil
# パーティコマンドウィンドウを有効化
@party_command_window.active = true
@party_command_window.visible = true
# アクターコマンドウィンドウを無効化
@actor_command_window.active = false
@actor_command_window.visible = false
# メインフェーズフラグをクリア
$game_temp.battle_main_phase = false
# コマンド入力ä¸å¯èƒ½ãªå ´åˆ
unless $game_party.inputable?
# メインフェーズ開始
start_phase4
end
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (パーティコマンドフェーズ : 逃ã’ã‚‹)
#--------------------------------------------------------------------------
def update_phase2_escape
# エãƒãƒŸãƒ¼ã®ç´ æ—©ã•åˆè¨ˆã‚’計算
enemies_agi = 0
for enemy in $game_troop.enemies
if enemy.exist?
enemies_agi += enemy.agi
end
end
# 行動å¯èƒ½ã‚¢ã‚¯ã‚¿ãƒ¼ã®ç´ æ—©ã•åˆè¨ˆã‚’計算
actors_agi = 0
for actor in @pre_action_battlers
if actor.is_a?(Game_Actor) and actor.exist?
actors_agi += actor.agi
end
end
# 逃走æˆåŠŸåˆ¤å®š
success = rand(100) < 50 * actors_agi / enemies_agi
# 逃走æˆåŠŸã®å ´åˆ
if success
# 逃走 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.escape_se)
# ãƒãƒˆãƒ«é–‹å§‹å‰ã® BGM ã«æˆ»ã™
$game_system.bgm_play($game_temp.map_bgm)
# CTをクリア
for battler in $game_party.actors
clear_ct(battler)
end
# ãƒãƒˆãƒ«çµ‚了
battle_end(1)
# 逃走失敗ã®å ´åˆ
else
# ヘルプウィンドウ㫠"逃走失敗" をセット
@help_window.set_text(PARA_CTB::UNESCAPE_MES, 1)
# アクターã®ã‚¢ã‚¯ã‚·ãƒ§ãƒ³ã¨CTをクリア
pre_action_battlers = @pre_action_battlers.clone
for act in pre_action_battlers
if act.is_a?(Game_Actor)
declease_ct(act, 100-PARA_CTB::ACT_ESCAPE_CT)
act.current_action.clear
@pre_action_battlers.delete(act)
end
end
@party_command_window.visible = false
# ヘルプウィンドウを表示
@help_window.visible = true
@wait_count = 20
# メインフェーズ開始
start_phase4
end
end
#--------------------------------------------------------------------------
# ◠アクターコマンドフェーズ開始
#--------------------------------------------------------------------------
def start_phase3
# フェーズ 3 ã«ç§»è¡Œ
@phase = 3
# アクターをéžé¸æŠžçŠ¶æ…‹ã«è¨å®š
@actor_index = -1
@active_battler = nil
@actor_array_index = -1
# 次ã®ã‚¢ã‚¯ã‚¿ãƒ¼ã®ã‚³ãƒžãƒ³ãƒ‰å…¥åŠ›ã¸
if @pre_action_battlers != []
phase3_next_actor
else
start_phase4
end
end
#--------------------------------------------------------------------------
# ◠次ã®ã‚¢ã‚¯ã‚¿ãƒ¼ã®ã‚³ãƒžãƒ³ãƒ‰å…¥åŠ›ã¸
#--------------------------------------------------------------------------
def phase3_next_actor
# ループ
begin
# ã‚¢ã‚¯ã‚¿ãƒ¼ã®æ˜Žæ»…エフェクト OFF
if @active_battler != nil
@active_battler.blink = false
end
# 最後ã®ã‚¢ã‚¯ã‚¿ãƒ¼ã®å ´åˆ
if @actor_array_index + 1 == @pre_action_battlers.size
# メインフェーズ開始
start_phase4
return
#次ãŒã‚¨ãƒãƒŸãƒ¼ã®å ´åˆ
elsif $game_troop.enemies.include?(@pre_action_battlers[@actor_array_index + 1])
# メインフェーズ開始
start_phase4
return
end
# アクターã®ã‚¤ãƒ³ãƒ‡ãƒƒã‚¯ã‚¹ã‚’進ã‚ã‚‹
@actor_array_index += 1
@actor_index = @pre_action_battlers[@actor_array_index].index
@active_battler = $game_party.actors[@actor_index]
@active_battler.blink = true
@active_battler.current_action.clear
# アクターãŒã‚³ãƒžãƒ³ãƒ‰å…¥åŠ›ã‚’å—ã‘付ã‘ãªã„状態ãªã‚‰ã‚‚ã†ä¸€åº¦
end until @active_battler.inputable?
# アクターコマンドウィンドウをセットアップ
phase3_setup_command_window
end
#--------------------------------------------------------------------------
# â— å‰ã®ã‚¢ã‚¯ã‚¿ãƒ¼ã®ã‚³ãƒžãƒ³ãƒ‰å…¥åŠ›ã¸
#--------------------------------------------------------------------------
def phase3_prior_actor
# ループ
begin
# ã‚¢ã‚¯ã‚¿ãƒ¼ã®æ˜Žæ»…エフェクト OFF
if @active_battler != nil
@active_battler.blink = false
end
# 最åˆã®ã‚¢ã‚¯ã‚¿ãƒ¼ã®å ´åˆ
if @actor_array_index <= 0
# アクターコマンドフェーズ開始
start_phase2
return
end
# アクターã®ã‚¤ãƒ³ãƒ‡ãƒƒã‚¯ã‚¹ã‚’戻ã™
@actor_array_index -= 1
@actor_index = @pre_action_battlers[@actor_array_index].index
@active_battler = $game_party.actors[@actor_index]
@active_battler.blink = true
@active_battler.current_action.clear
# アクターãŒã‚³ãƒžãƒ³ãƒ‰å…¥åŠ›ã‚’å—ã‘付ã‘ãªã„状態ãªã‚‰ã‚‚ã†ä¸€åº¦
end until @active_battler.inputable?
# アクターコマンドウィンドウをセットアップ
phase3_setup_command_window
end
#--------------------------------------------------------------------------
# ◠アクターコマンドウィンドウã®ã‚»ãƒƒãƒˆã‚¢ãƒƒãƒ—
#--------------------------------------------------------------------------
alias phase3_setup_command_window_ctb phase3_setup_command_window
def phase3_setup_command_window
@actor_command_window.back_opacity = PARA_CTB::WINDOW_OPACITY
phase3_setup_command_window_ctb
if PARA_CTB::WINDOWPOS_CHANGE
# アクターコマンドウィンドウã®ä½ç½®ã‚’è¨å®š
@actor_command_window.x = PARA_CTB::WINDOWPOS_X
@actor_command_window.y = PARA_CTB::WINDOWPOS_Y
# ステータスウインドウã«éš れãªã„よã†ã«
@actor_command_window.z = 9999
end
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (アクターコマンドフェーズ)
#--------------------------------------------------------------------------
def update_phase3
# エãƒãƒŸãƒ¼ã‚¢ãƒãƒ¼ãŒæœ‰åйã®å ´åˆ
if @enemy_arrow != nil
@countup = PARA_CTB::SELECT_WAIT ? false : true
update_phase3_enemy_select
# アクターアãƒãƒ¼ãŒæœ‰åйã®å ´åˆ
elsif @actor_arrow != nil
@countup = PARA_CTB::SELECT_WAIT ? false : true
update_phase3_actor_select
# スã‚ãƒ«ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ãŒæœ‰åйã®å ´åˆ
elsif @skill_window != nil
@countup = PARA_CTB::SELECT_WAIT ? false : true
update_phase3_skill_select
# ã‚¢ã‚¤ãƒ†ãƒ ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ãŒæœ‰åйã®å ´åˆ
elsif @item_window != nil
@countup = PARA_CTB::SELECT_WAIT ? false : true
update_phase3_item_select
# ã‚¢ã‚¯ã‚¿ãƒ¼ã‚³ãƒžãƒ³ãƒ‰ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ãŒæœ‰åйã®å ´åˆ
elsif @actor_command_window.active
@countup = PARA_CTB::COMMAND_WAIT ? false : true
update_phase3_basic_command
end
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (アクターコマンドフェーズ : 基本コマンド)
#--------------------------------------------------------------------------
alias ctb_update_phase3_basic_command update_phase3_basic_command
def update_phase3_basic_command
ctb_update_phase3_basic_command
# LRボタンã§è¡Œå‹•é †ã‚’å¤‰æ›´
if Input.trigger?(Input::R)
shift_activer(1)
end
if Input.trigger?(Input::L)
shift_activer(-1)
end
end
#--------------------------------------------------------------------------
# ◠メインフェーズ開始
#--------------------------------------------------------------------------
def start_phase4
# フェーズ 4 ã«ç§»è¡Œ
@phase = 4
battler_count = $game_party.actors.size + $game_troop.enemies.size
if @action_count >= battler_count or $game_temp.battle_turn == 0
# ãƒãƒˆãƒ«ã‚¤ãƒ™ãƒ³ãƒˆã®å…¨ãƒšãƒ¼ã‚¸ã‚’検索
for index in 0...$data_troops[@troop_id].pages.size
# イベントページをå–å¾—
page = $data_troops[@troop_id].pages[index]
# ã“ã®ãƒšãƒ¼ã‚¸ã®ã‚¹ãƒ‘ン㌠[ターン] ã®å ´åˆ
if page.span == 1
# 実行済ã¿ãƒ•ラグをクリア
$game_temp.battle_event_flags[index] = false
end
end
# ターン数カウント
$game_temp.battle_turn += 1
@action_count = 0
end
# アクターをéžé¸æŠžçŠ¶æ…‹ã«è¨å®š
@actor_index = -1
@active_battler = nil
# パーティコマンドウィンドウを有効化
@party_command_window.active = false
@party_command_window.visible = false
# アクターコマンドウィンドウを無効化
@actor_command_window.active = false
@actor_command_window.visible = false
# メインフェーズフラグをセット
$game_temp.battle_main_phase = true
# エãƒãƒŸãƒ¼ã‚¢ã‚¯ã‚·ãƒ§ãƒ³ä½œæˆ
for enemy in $game_troop.enemies
enemy.make_action
end
# è¡Œå‹•é †åºä½œæˆ
make_action_orders
# ステップ 1 ã«ç§»è¡Œ
@phase4_step = 1
end
#--------------------------------------------------------------------------
# â— è¡Œå‹•é †åºä½œæˆ
#--------------------------------------------------------------------------
def make_action_orders
# é…列 @action_battlers ã‚’åˆæœŸåŒ–
@action_battlers = []
if @pre_action_battlers != []
for i in 0..@actor_array_index
# アクターをé…列 @action_battlers ã«è¿½åŠ
@action_battlers.push(@pre_action_battlers[0])
@pre_action_battlers.shift
end
if @pre_action_battlers.size != 0
loop do
if $game_troop.enemies.include?(@pre_action_battlers[0])
# エãƒãƒŸãƒ¼ã‚’é…列 @action_battlers ã«è¿½åŠ
@action_battlers.push(@pre_action_battlers[0])
@pre_action_battlers.shift
else
break
end
end
end
end
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (メインフェーズ ステップ 1 : アクション準備)
#--------------------------------------------------------------------------
alias ctb_update_phase4_step1 update_phase4_step1
def update_phase4_step1
@countup = true
# ãƒ˜ãƒ«ãƒ—ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚’éš ã™
@help_window.visible = false
# 勿•—判定
if judge
# å‹åˆ©ã¾ãŸã¯æ•—北ã®å ´åˆ : メソッド終了
return
end
# 未行動ãƒãƒˆãƒ©ãƒ¼ãŒå˜åœ¨ã—ãªã„å ´åˆ (全員行動ã—ãŸ)
if @action_battlers.size == 0
# アクターコマンドフェーズ開始
start_phase3
return
end
ctb_update_phase4_step1
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (メインフェーズ ステップ 2 : アクション開始)
#--------------------------------------------------------------------------
alias ctb_update_phase4_step2 update_phase4_step2
def update_phase4_step2
# 強制アクションã§ãªã‘れã°
unless @active_battler.current_action.forcing
# 制約㌠[行動ã§ããªã„] ã®å ´åˆ
if @active_battler.restriction == 4
# CTをクリア
clear_ct(@active_battler)
# アクション強制対象ã®ãƒãƒˆãƒ©ãƒ¼ã‚’クリア
$game_temp.forcing_battler = nil
# ステップ 1 ã«ç§»è¡Œ
@phase4_step = 1
return
end
end
# アニメーションå†ç”Ÿä¸ã«CTをカウントã™ã‚‹ã‹
@countup = PARA_CTB::ANIMATION_WAIT ? false : true
ctb_update_phase4_step2
end
#--------------------------------------------------------------------------
# ◠基本アクション çµæžœä½œæˆ
#--------------------------------------------------------------------------
alias make_basic_action_result_ctb make_basic_action_result
def make_basic_action_result
# 何もã—ãªã„ã®å ´åˆ
if @active_battler.current_action.basic == 3
# CTをクリア
clear_ct(@active_battler)
# アクション強制対象ã®ãƒãƒˆãƒ©ãƒ¼ã‚’クリア
$game_temp.forcing_battler = nil
# ステップ 1 ã«ç§»è¡Œ
@phase4_step = 1
return
end
make_basic_action_result_ctb
end
#--------------------------------------------------------------------------
# ◠スã‚ルアクション çµæžœä½œæˆ
#--------------------------------------------------------------------------
def make_skill_action_result
# スã‚ルをå–å¾—
@skill = $data_skills[@active_battler.current_action.skill_id]
# 強制アクションã§ãªã‘れã°
unless @active_battler.current_action.forcing
# SP 切れãªã©ã§ä½¿ç”¨ã§ããªããªã£ãŸå ´åˆ
unless @active_battler.skill_can_use?(@skill.id)
# アクション強制対象ã®ãƒãƒˆãƒ©ãƒ¼ã‚’クリア
$game_temp.forcing_battler = nil
# CTをクリア
declease_ct(@active_battler,100-PARA_CTB::ACT_SKILL_CT)
# ステップ 1 ã«ç§»è¡Œ
@phase4_step = 1
return
end
end
# SP 消費
@active_battler.sp -= @skill.sp_cost
# ステータスウィンドウをリフレッシュ
@status_window.refresh
# ヘルプウィンドウã«ã‚¹ã‚ルåを表示
@help_window.set_text(@skill.name, 1)
# アニメーション ID ã‚’è¨å®š
@animation1_id = @skill.animation1_id
@animation2_id = @skill.animation2_id
# コモンイベント ID ã‚’è¨å®š
@common_event_id = @skill.common_event_id
# 対象å´ãƒãƒˆãƒ©ãƒ¼ã‚’è¨å®š
set_target_battlers(@skill.scope)
# スã‚ルã®åŠ¹æžœã‚’é©ç”¨
for target in @target_battlers
target.skill_effect(@active_battler, @skill)
end
end
#--------------------------------------------------------------------------
# ◠アイテムアクション çµæžœä½œæˆ
#--------------------------------------------------------------------------
alias ctb_make_item_action_result make_item_action_result
def make_item_action_result
# アイテムをå–å¾—
@item = $data_items[@active_battler.current_action.item_id]
# アイテム切れãªã©ã§ä½¿ç”¨ã§ããªããªã£ãŸå ´åˆ
unless $game_party.item_can_use?(@item.id)
# CTをクリア
declease_ct(@active_battler,100-PARA_CTB::ACT_ITEM_CT)
# ステップ 1 ã«ç§»è¡Œ
@phase4_step = 1
return
end
ctb_make_item_action_result
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (メインフェーズ ステップ 5 : ダメージ表示)
#--------------------------------------------------------------------------
alias update_phase4_step5_ctb update_phase4_step5
def update_phase4_step5
# ダメージを記録
for target in @target_battlers
if target.damage != nil
target.damage_backup = target.damage
end
end
update_phase4_step5_ctb
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
#--------------------------------------------------------------------------
alias update_phase4_step6_ctb update_phase4_step6
def update_phase4_step6
@active_battler.countup = true
if @active_battler.current_action.basic == 1
# 防御
declease_ct(@active_battler,100-PARA_CTB::ACT_GUARD_CT)
else
case @active_battler.current_action.kind
# 攻撃
when 0
declease_ct(@active_battler,100-PARA_CTB::ACT_ATTACK_CT)
# スã‚ル
when 1
declease_ct(@active_battler,100-PARA_CTB::ACT_SKILL_CT)
# アイテãƒ
when 2
declease_ct(@active_battler,100-PARA_CTB::ACT_ITEM_CT)
else
clear_ct(@active_battler)
end
end
# ターゲットãŒè¡Œå‹•ä¸èƒ½ã«ãªӖ