#==============================================================================
module PARA_CTB
# コマンド入力時ã«CTã®ã‚«ã‚¦ãƒ³ãƒˆã‚’æ¢ã‚ã‚‹ã‹(true:æ¢ã‚ã‚‹ / false:æ¢ã‚ãªã„)
COMMAND_WAIT = false
# アイテムã€ã‚¹ã‚ルã€ã‚¿ãƒ¼ã‚²ãƒƒãƒˆé¸æŠžæ™‚ã«CTã®ã‚«ã‚¦ãƒ³ãƒˆã‚’æ¢ã‚ã‚‹ã‹(true:æ¢ã‚ã‚‹ / false:æ¢ã‚ãªã„)
SELECT_WAIT = false
# アニメーション表示時ã«CTã®ã‚«ã‚¦ãƒ³ãƒˆã‚’æ¢ã‚ã‚‹ã‹(true:æ¢ã‚ã‚‹ / false:æ¢ã‚ãªã„)
ANIMATION_WAIT = false
# ãƒãƒˆãƒ«ã‚¹ãƒ”ード(数値ãŒå¤§ãã„ã»ã©CTã®æºœã¾ã‚ŠãŒé€Ÿããªã‚‹)
BATTLE_SPEED = 3
# ãƒãƒˆãƒ«ãƒ¡ãƒ³ãƒãƒ¼ã®æœ€å¤§æ•°(多人数PTスクリプトを導入ã—ã¦ã„る時ã«è¨å®š)
PARTY_SIZE = 8
# 行動終了時ã®CT減少パーセンテージ
ACT_ATTACK_CT = 125 # 通常攻撃
ACT_GUARD_CT = 125 # 防御
ACT_ESCAPE_CT = 125 # 逃走失敗
ACT_SKILL_CT = 125 # スã‚ル
ACT_ITEM_CT = 125 # アイテãƒ
# 逃走失敗時ã®ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸
UNESCAPE_MES = "You're Cornered"
# 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(150, 0, 0, 255)
# HPゲージã®è‰²(グラデーションå³ç«¯)
HP_COLOR_RIGHT= Color.new(255, 255, 60, 255)
# SPゲージã®è‰²(グラデーション左端)
SP_COLOR_LEFT = Color.new(0, 0, 155, 255)
# SPゲージã®è‰²(グラデーションå³ç«¯)
SP_COLOR_RIGHT= Color.new(255, 255, 255, 255)
# CTゲージã®è‰²(グラデーション左端)
COLOR_LEFT = Color.new(185, 155, 0, 255)
# CTゲージã®è‰²(グラデーションå³ç«¯)
COLOR_RIGHT= Color.new(0, 0, 200, 255)
# CTãŒæº€ã‚¿ãƒ³ã«ãªã£ãŸã¨ãã®ã‚²ãƒ¼ã‚¸ã®è‰²
COLOR_FULL = Color.new(0, 0, 200, 255)
# ã‚²ãƒ¼ã‚¸æž ã®è‰²
FRAME_COLOR = Color.new(50, 50, 50, 255)
# ã‚²ãƒ¼ã‚¸æž ã®å¤ªã•
FRAME_BORDER = 1
# ゲージã®èƒŒæ™¯è‰²
BACK_COLOR = Color.new(100, 100, 100, 160)
# åå‰ã®ãƒ•ã‚©ãƒ³ãƒˆã‚µã‚¤ã‚º
NAME_FONT_SIZE = 16
# HP/SPã®ãƒ•ã‚©ãƒ³ãƒˆã‚µã‚¤ã‚º
HPSP_FONT_SIZE = 18
# エãƒãƒŸãƒ¼åã®ãƒ•ã‚©ãƒ³ãƒˆã‚µã‚¤ã‚º
ENEMY_FONT_SIZE = 16
# 最大HP/SPã‚’æç”»ã™ã‚‹ã‹( true / false )
MAX_DRAW = true
# エãƒãƒŸãƒ¼åをグループ化( true / false )
# (trueã«ã™ã‚‹ã¨ã€Œã‚´ãƒ¼ã‚¹ãƒˆ 2ã€ã®ã‚ˆã†ã«ã¾ã¨ã‚ã¦è¡¨ç¤ºã—ã¾ã™)
ENEMY_GROUPING = false
# エãƒãƒŸãƒ¼åã®ä¸‹ã«ã‚²ãƒ¼ã‚¸ã‚’表示( 0:ãªã— / 1:HP / 2:CT )
# (エãƒãƒŸãƒ¼åをグループ化ã—ã¦ã„ã‚‹å ´åˆã¯ç„¡åŠ¹)
ENEMY_DRAWING_MATER = 0
# アクターã®ãƒ˜ãƒ«ãƒ—ウインドウã«HP/SPゲージを表示( true / false )
HELP_DRAWING_MATER_ACTOR = true
# エãƒãƒŸãƒ¼ã®ãƒ˜ãƒ«ãƒ—ウインドウã«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 = 1
end
# ↑ è¨å®šé …ç›®ã“ã“ã¾ã§
#------------------------------------------------------------------------------
#--------------------------------------------------------------------------
# * Draw Slant Bar(by SephirothSpawn)
#--------------------------------------------------------------------------
def draw_slant_bar(x, y, min, max, width = 152, height = 7,
bar_color = Color.new(150, 0, 0, 255), end_color = Color.new(255, 255, 60, 255))
# Draw Border
for i in 0..height
self.contents.fill_rect(x + i, y + height - i, width + 1, 1, Color.new(50, 50, 50, 255))
end
# Draw Background
for i in 1..(height - 1)
r = 100 * (height - i) / height + 0 * i / height
g = 100 * (height - i) / height + 0 * i / height
b = 100 * (height - i) / height + 0 * i / height
a = 255 * (height - i) / height + 255 * i / height
self.contents.fill_rect(x + i, y + height - i, width, 1, Color.new(r, b, g, a))
end
# Draws Bar
for i in 1..( (min / max.to_f) * width - 1)
for j in 1..(height - 1)
r = bar_color.red * (width - i) / width + end_color.red * i / width
g = bar_color.green * (width - i) / width + end_color.green * i / width
b = bar_color.blue * (width - i) / width + end_color.blue * i / width
a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width
self.contents.fill_rect(x + i + j, y + height - j, 1, 1, Color.new(r, g, b, a))
end
end
end
#--------------------------------------------------------------------------
# * Draw Slant Bar(by SephirothSpawn)
#--------------------------------------------------------------------------
def draw_meter(x, y, min, max, width = 152, height = 7,
bar_color = Color.new(150, 0, 0, 255), end_color = Color.new(255, 255, 60, 255))
# Draw Border
for i in 0..height
self.contents.fill_rect(x + i, y + height - i, width + 1, 1, Color.new(50, 50, 50, 255))
end
# Draw Background
for i in 1..(height - 1)
r = 100 * (height - i) / height + 0 * i / height
g = 100 * (height - i) / height + 0 * i / height
b = 100 * (height - i) / height + 0 * i / height
a = 255 * (height - i) / height + 255 * i / height
self.contents.fill_rect(x + i, y + height - i, width, 1, Color.new(r, b, g, a))
end
# Draws Bar
for i in 1..( (min / max.to_f) * width - 1)
for j in 1..(height - 1)
r = bar_color.red * (width - i) / width + end_color.red * i / width
g = bar_color.green * (width - i) / width + end_color.green * i / width
b = bar_color.blue * (width - i) / width + end_color.blue * i / width
a = bar_color.alpha * (width - i) / width + end_color.alpha * i / width
self.contents.fill_rect(x + i + j, y + height - j, 1, 1, Color.new(r, g, b, a))
end
end
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 *= 125
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
# ターゲットãŒè¡Œå‹•ä¸èƒ½ã«ãªã£ãŸã‚‰CTã‚’0ã«
for target in @target_battlers
if target.movable? == false and target.damage_backup != "Miss"
clear_ct(target)
@status_window.refresh_ct
end
end
# エãƒãƒŸãƒ¼åリストを更新
@status_window2.refresh
update_phase4_step6_ctb
end
#--------------------------------------------------------------------------
# ◠アフターãƒãƒˆãƒ«ãƒ•ã‚§ãƒ¼ã‚ºé–‹å§‹
#--------------------------------------------------------------------------
alias ctb_start_phase5 start_phase5
def start_phase5
@countup = false
ctb_start_phase5
end
end
#==============================================================================
# â– Window_BattleStatus
#==============================================================================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# ◠オブジェクトåˆæœŸåŒ–
#--------------------------------------------------------------------------
def initialize
super(160, 370, 480, 110)
self.contents = Bitmap.new(width - 32, height - 32)
@level_up_flags = [false, false, false, false]
@before_hp = []
@before_sp = []
@before_states = []
@now_hp = []
@now_sp = []
@now_states = []
refresh
end
#--------------------------------------------------------------------------
# ◠リフレッシュ
#--------------------------------------------------------------------------
def refresh
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
line_height = 120 / PARA_CTB::PARTY_SIZE
actor_y = i * line_height + 4
# ç¾åœ¨ã®ã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹ã‚’é…列ã«
@now_hp[i] = actor.hp
@now_sp[i] = actor.sp
@now_states[i] = actor.states
# レベルアップ
if @level_up_flags[i]
self.contents.fill_rect(344, actor_y+14, 100, 8, Color.new(0, 0, 0, 0))
self.contents.font.color = normal_color
self.contents.draw_text(344, actor_y, 120, 32, "LEVEL UP!")
end
end
# ãƒãƒˆãƒ«ã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹ã®è»½é‡åŒ–処ç†
# ステータスã®é…列ãŒå¤‰åŒ–ã—ãŸã¨ãã®ã¿æ画処ç†
if @before_hp == nil or @before_sp == nil or @before_states == nil or
@before_hp != @now_hp or @before_sp != @now_sp or @before_states != @now_states
self.contents.clear
for i2 in 0...$game_party.actors.size
actor = $game_party.actors[i2]
line_height = 120 / PARA_CTB::PARTY_SIZE
actor_y = i2 * line_height + 4
self.contents.font.size = PARA_CTB::NAME_FONT_SIZE
# åå‰ã‚’æç”»
draw_actor_name(actor, 4, actor_y+16-PARA_CTB::NAME_FONT_SIZE)
# HPã‚’æç”»
draw_actor_hp(actor, 75, actor_y+16-PARA_CTB::HPSP_FONT_SIZE, 100)
# SPã‚’æç”»
draw_actor_sp(actor, 222, actor_y+16-PARA_CTB::HPSP_FONT_SIZE, 100)
# 変化後ã®ã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹ã‚’é…列ã«
@before_hp[i2] = actor.hp
@before_sp[i2] = actor.sp
@before_states[i2] = actor.states
# レベルアップ
if @level_up_flags[i2]
self.contents.fill_rect(344, actor_y, 100, 8, Color.new(0, 0, 0, 0))
self.contents.font.color = normal_color
self.contents.draw_text(344, actor_y, 120, 32, "LEVEL UP!")
end
end
end
refresh_ct
end
#--------------------------------------------------------------------------
# â— CTゲージã®ãƒªãƒ•ãƒ¬ãƒƒã‚·ãƒ¥
#--------------------------------------------------------------------------
def refresh_ct
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
line_height = 120 / PARA_CTB::PARTY_SIZE
actor_y = i * line_height + 4
# CTãŒæº€ã‚¿ãƒ³ã«ãªã£ãŸã¨ãã®ã‚²ãƒ¼ã‚¸ã®è‰²
ct_color_full = PARA_CTB::COLOR_FULL
# CTゲージã®è‰²(左端)
ct_color_start = actor.full_ct ? ct_color_full : PARA_CTB::COLOR_LEFT
# CTゲージã®è‰²(å³ç«¯)
ct_color_end = actor.full_ct ? ct_color_full : PARA_CTB::COLOR_RIGHT
if @level_up_flags[i] != true and actor.ct_visible
draw_meter(actor.now_ct, actor.max_ct, 344, actor_y+14, 100, 7, ct_color_start, ct_color_end)
elsif @level_up_flags[i] != true
draw_meter(0, actor.max_ct, 344, actor_y+14, 100, 7, ct_color_start, ct_color_end)
end
end
end
#--------------------------------------------------------------------------
# ◠フレーム更新
#--------------------------------------------------------------------------
def update
super
end
#--------------------------------------------------------------------------
# â— HP ã®æç”»
# actor : アクター
# x : æ画先 X 座標
# y : æ画先 Y 座標
# width : æ画先ã®å¹…
#--------------------------------------------------------------------------
def draw_actor_hp(actor, x, y, width = 156)
# Calculate if there is draw space for MaxHP
if width - 32 >= 108
hp_x = x + width - 108
flag = true
elsif width - 32 >= 48
hp_x = x + width - 48
flag = false
end
if $game_temp.in_battle
bar_width = hp_x - x + 50
else
bar_width = hp_x - x + 100
end
# Draw HP
draw_slant_bar(x, y + 18, actor.hp, actor.maxhp, bar_width, 6, bar_color = PARA_CTB::HP_COLOR_LEFT, end_color = PARA_CTB::HP_COLOR_RIGHT)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
self.contents.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
self.contents.draw_text(hp_x, y, 48, 32, actor.hp.to_s, 2)
# Draw MaxHP
if flag
self.contents.font.color = normal_color
self.contents.draw_text(hp_x + 48, y, 12, 32, "/", 1)
self.contents.draw_text(hp_x + 60, y, 48, 32, actor.maxhp.to_s)
end
end
#--------------------------------------------------------------------------
# â— SP ã®æç”»
# actor : アクター
# x : æ画先 X 座標
# y : æ画先 Y 座標
# width : æ画先ã®å¹…
#--------------------------------------------------------------------------
def draw_actor_sp(actor, x, y, width = 156)
# Calculate if there is draw space for MaxHP
if width - 32 >= 108
sp_x = x + width - 108
flag = true
elsif width - 32 >= 48
sp_x = x + width - 48
flag = false
end
if $game_temp.in_battle
bar_width = sp_x - x + 50
else
bar_width = sp_x - x + 100
end
# Draw SP
draw_slant_bar(x, y + 18, actor.sp, actor.maxsp, bar_width, 6, bar_color = PARA_CTB::SP_COLOR_LEFT, end_color = PARA_CTB::SP_COLOR_RIGHT)
# Draw "SP" text string
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
self.contents.font.color = actor.sp == 0 ? knockout_color :
actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
self.contents.draw_text(sp_x, y, 48, 32, actor.sp.to_s, 2)
# Draw MaxSP
if flag
self.contents.font.color = normal_color
self.contents.draw_text(sp_x + 48, y, 12, 32, "/", 1)
self.contents.draw_text(sp_x + 60, y, 48, 32, actor.maxsp.to_s)
end
end
end
#==============================================================================
# â–¡ 敵ã®åå‰ã‚’表示ã™ã‚‹ã‚¦ã‚¤ãƒ³ãƒ‰ã‚¦
#==============================================================================
class Window_BattleStatus_enemy < Window_Base
#--------------------------------------------------------------------------
# â—‹ オブジェクトåˆæœŸåŒ–
#--------------------------------------------------------------------------
def initialize
super(0, 370, 160, 110)
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = 160
refresh
end
#--------------------------------------------------------------------------
# ○ リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = normal_color
self.contents.font.size = PARA_CTB::ENEMY_FONT_SIZE
@exist_enemies = []
if $game_troop.enemies != nil
if PARA_CTB::ENEMY_GROUPING
ememy_list = []
ememy_list_index = []
# エãƒãƒŸãƒ¼ã‚’グループ化
for i in 0...$game_troop.enemies.size
enemy = $game_troop.enemies[i]
if enemy.exist?
if ememy_list.include?(enemy.name)
ememy_list_index[ememy_list.index(enemy.name)] += 1
else
# エãƒãƒŸãƒ¼åを記録
ememy_list.push(enemy.name)
ememy_list_index[ememy_list.index(enemy.name)] = 1
end
end
end
# エãƒãƒŸãƒ¼ã®åå‰ã¨æ•°ã‚’æç”»
enemy_index = 0
for enemy_name in ememy_list
enemy_y = enemy_index * (PARA_CTB::ENEMY_FONT_SIZE+6) + 4
if ememy_list_index[enemy_index] > 1
enemy_name = enemy_name + " " + ememy_list_index[enemy_index].to_s
end
self.contents.draw_text(4, enemy_y, 160, 20, enemy_name)
enemy_index += 1
end
else
# エãƒãƒŸãƒ¼ã®åå‰ã‚’æç”»
enemy_index = 0
for i in 0...$game_troop.enemies.size
enemy = $game_troop.enemies[i]
if enemy.exist?
@exist_enemies.push(enemy)
line_height = PARA_CTB::ENEMY_FONT_SIZE + 6
if PARA_CTB::ENEMY_DRAWING_MATER != 0
line_height += 10
end
enemy_y = enemy_index * line_height + 4
self.contents.draw_text(4, enemy_y, 160, 20, enemy.name)
enemy_index += 1
if PARA_CTB::ENEMY_DRAWING_MATER == 1
hp_color1 = PARA_CTB::HP_COLOR_LEFT
hp_color2 = PARA_CTB::HP_COLOR_RIGHT
y = enemy_y + PARA_CTB::ENEMY_FONT_SIZE + 3
draw_meter(enemy.hp, enemy.maxhp, 4, y, 80, 8, hp_color1, hp_color2)
end
end
end
end
end
refresh_ct
end
#--------------------------------------------------------------------------
# â— CTゲージã®ãƒªãƒ•ãƒ¬ãƒƒã‚·ãƒ¥
#--------------------------------------------------------------------------
def refresh_ct
if PARA_CTB::ENEMY_DRAWING_MATER == 2 and @exist_enemies != nil
enemy_index = 0
for enemy in @exist_enemies
line_height = PARA_CTB::ENEMY_FONT_SIZE + 16
enemy_y = enemy_index * line_height + 4
y = enemy_y + PARA_CTB::ENEMY_FONT_SIZE + 3
# CTãŒæº€ã‚¿ãƒ³ã«ãªã£ãŸã¨ãã®ã‚²ãƒ¼ã‚¸ã®è‰²
ct_color_full = PARA_CTB::COLOR_FULL
# CTゲージã®è‰²(左端)
ct_color_start = enemy.full_ct ? ct_color_full : PARA_CTB::COLOR_LEFT
# CTゲージã®è‰²(å³ç«¯)
ct_color_end = enemy.full_ct ? ct_color_full : PARA_CTB::COLOR_RIGHT
if enemy.ct_visible
draw_slant_bar(enemy.now_ct, enemy.max_ct, 4, y, 100, 8, ct_color_start, ct_color_end)
else
draw_slant_bar(0, enemy.max_ct, 4, y, 100, 8, ct_color_start, ct_color_end)
end
enemy_index += 1
end
end
end
end
#==============================================================================
# â– Window_Base
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# â—‹ ゲージをæç”»
#--------------------------------------------------------------------------
def draw_meter(now, max, x, y, width, height, start_color, end_color=start_color )
self.contents.fill_rect(x, y, width, height, PARA_CTB::FRAME_COLOR)
self.contents.fill_rect(x+PARA_CTB::FRAME_BORDER, y+PARA_CTB::FRAME_BORDER, width-
PARA_CTB::FRAME_BORDER*2, height-PARA_CTB::FRAME_BORDER*2, PARA_CTB::BACK_COLOR)
now = now > max ? max : now
percentage = max != 0 ? (width-2) * now / max.to_f : 0
if start_color == end_color
self.contents.fill_rect(x+1, y+1, percentage, height-2, start_color)
else
for i in 1..percentage
r = start_color.red + (end_color.red - start_color.red) / percentage * i
g = start_color.green + (end_color.green - start_color.green) / percentage * i
b = start_color.blue + (end_color.blue - start_color.blue) / percentage * i
a = start_color.alpha + (end_color.alpha - start_color.alpha) / percentage * i
self.contents.fill_rect(x+i, y+1, 1, height-2, Color.new(r, g, b, a))
end
end
end
end
#==============================================================================
# â– Game_Battler
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# ◠公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :max_ct
attr_accessor :now_ct
attr_accessor :full_ct
attr_accessor :countup
attr_accessor :ct_visible
attr_accessor :damage_backup
#--------------------------------------------------------------------------
# ◠オブジェクトåˆæœŸåŒ–
#--------------------------------------------------------------------------
alias ctb_initialize initialize
def initialize
ctb_initialize
@max_ct = 0
@now_ct = 0
@full_ct = false
@countup = true
@ct_visible = true
end
end
#==============================================================================
# â– Sprite_Battler
#==============================================================================
class Sprite_Battler < RPG::Sprite
#--------------------------------------------------------------------------
# ◠フレーム更新
#--------------------------------------------------------------------------
alias ctb_update update
def update
ctb_update
if @battler != nil
if @battler.full_ct and @battler.ct_visible
# CTãŒæºœã¾ã£ãŸãƒãƒˆãƒ©ãƒ¼ã®è‰²èª¿ã‚’変化ã•ã›ã‚‹
fullct_color = PARA_CTB::FULL_CT_COLOR
self.tone = fullct_color
else
fullct_color = Tone.new(0,0,0)
self.tone = fullct_color
end
end
end
end
#==============================================================================
# â– Window_Help
#==============================================================================
class Window_Help < Window_Base
#--------------------------------------------------------------------------
# ◠アクターè¨å®š
# actor : ステータスを表示ã™ã‚‹ã‚¢ã‚¯ã‚¿ãƒ¼
#--------------------------------------------------------------------------
alias set_actor_ctb set_actor
def set_actor(actor)
if PARA_CTB::HELP_DRAWING_MATER_ACTOR
self.contents.clear
draw_actor_name(actor, 4, 0)
draw_actor_state(actor, 140, 0)
hp_color1 = PARA_CTB::HP_COLOR_LEFT
hp_color2 = PARA_CTB::HP_COLOR_RIGHT
draw_meter(actor.hp, actor.maxhp, 316, 18, 112, 8, hp_color1, hp_color2)
draw_actor_hp(actor, 284, 0)
sp_color1 = PARA_CTB::SP_COLOR_LEFT
sp_color2 = PARA_CTB::SP_COLOR_RIGHT
draw_meter(actor.sp, actor.maxsp, 492, 18, 112, 8, sp_color1, sp_color2)
draw_actor_sp(actor, 460, 0)
@actor = actor
@text = nil
self.visible = true
else
set_actor_ctb(actor)
end
end
#--------------------------------------------------------------------------
# ◠エãƒãƒŸãƒ¼è¨å®š
# enemy : åå‰ã¨ã‚¹ãƒ†ãƒ¼ãƒˆã‚’表示ã™ã‚‹ã‚¨ãƒãƒŸãƒ¼
#------------------