#==============================================================================
# ■ 連続攻撃 By 貪藻矢射妥←
#
# 一度に複数回攻撃可能な武器を実現させます。
#
#==============================================================================
# 更新っぽいもの
# まだなし
$OuterFlgs = {} if $OuterFlgs == nil
$OuterFlgs["Multi_Atk_Wep"] = true
module Multi_Attack
MltAtt_WD = "連続攻撃"
#--------------------------------------------------------------------------
# ○ 最大攻撃回数取得
# wep_id : 武器 ID
#--------------------------------------------------------------------------
def get_max_attack(wep_id)
max_atk = 0
mlt_flg = false
weapon = $data_weapons[wep_id]
if weapon != nil
for j in weapon.element_set
ele_set = $data_system.elements[j]
if ele_set != nil
if ele_set =~ /^#{MltAtt_WD}([0-9]+)$/
max_atk += $1.to_i
mlt_flg = true
end
end
end
end
# 取得正常ならば最大攻撃回数を返す
if mlt_flg && max_atk > 0
return max_atk
else
return 1
end
end
end
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● セットアップ
# actor_id : アクター ID
#--------------------------------------------------------------------------
def setup(actor_id)
actor = $data_actors[actor_id]
@actor_id = actor_id
@name = actor.name
@final_level = BM::MAX_LV
@character_name = actor.character_name
@character_hue = actor.character_hue
@battler_name = actor.battler_name
@battler_hue = actor.battler_hue
@class_id = actor.class_id
@weapon_id = actor.weapon_id
@armor1_id = actor.armor1_id
@armor2_id = actor.armor2_id
@armor3_id = actor.armor3_id
@armor4_id = actor.armor4_id
# 最大攻撃数 初期値
@max_atk_num = 1
@level = actor.initial_level
@exp_list = Array.new(1001)
make_exp_list
@exp = @exp_list[@level]
@skills = []
@states = []
@states_turn = {}
@hp = maxhp
@sp = maxsp
@maxhp_plus = 0
@maxsp_plus = 0
@str_plus = 0
@dex_plus = 0
@agi_plus = 0
@int_plus = 0
# スキル習得
for i in 1..@level
for j in $data_classes[@class_id].learnings
if j.level == i
learn_skill(j.skill_id)
end
end
end
# オートステートを更新
update_auto_state(nil, $data_armors[@armor1_id])
update_auto_state(nil, $data_armors[@armor2_id])
update_auto_state(nil, $data_armors[@armor3_id])
update_auto_state(nil, $data_armors[@armor4_id])
end
end
class Scene_Battle
#--------------------------------------------------------------------------
# ● フレーム更新 (メインフェーズ ステップ 1 : アクション準備)
#--------------------------------------------------------------------------
def update_phase4_step1
# ヘルプウィンドウを隠す
@help_window.hide
# 勝敗判定
if judge
# 勝利または敗北の場合 : メソッド終了
return
end
# アクションを強制されているバトラーが存在しない場合
if $game_temp.forcing_battler == nil
# バトルイベントをセットアップ
setup_battle_event
# バトルイベント実行中の場合
if $game_system.battle_interpreter.running?
return
end
end
# アクションを強制されているバトラーが存在する場合
if $game_temp.forcing_battler != nil
# 先頭に追加または移動
@action_battlers.delete($game_temp.forcing_battler)
@action_battlers.unshift($game_temp.forcing_battler)
end
# 未行動バトラーが存在しない場合 (全員行動した)
if @action_battlers.size == 0
# パーティコマンドフェーズ開始
start_phase2
return
end
# アニメーション ID およびコモンイベント ID を初期化
@animation1_id = 0
@animation2_id = 0
@common_event_id = 0
# 攻撃側アニメーション実行フラグを寝かせる
@anime1_execute = false
# 攻撃回数カウンタを初期化
# 連続攻撃
@attakked_num = 0
# 連続攻撃
# Rand_Select
@selected_num = 0
# Rand_Select
# 未行動バトラー配列の先頭からシフト
@active_battler = @action_battlers.shift
# すでに戦闘から外されている場合
if @active_battler.index == nil
return
end
# スリップダメージ
if @active_battler.hp > 0 and @active_battler.slip_damage?
@active_battler.slip_damage_effect
@active_battler.damage_pop = true
end
# ステート自然解除
@active_battler.remove_states_auto
# ステータスウィンドウをリフレッシュ
@status_window.refresh
# ステップ 2 に移行
@phase4_step = 2
end
#--------------------------------------------------------------------------
# ● フレーム更新 (メインフェーズ ステップ 5 : ダメージ表示)
#--------------------------------------------------------------------------
def update_phase4_step5
# ヘルプウィンドウを隠す
@help_window.hide
# ステータスウィンドウをリフレッシュ
@status_window.refresh
if $game_temp.counter_mode >= 1
$game_temp.counter_mode -= 1
end
# ダメージ表示
for target in @target_battlers
if target.damage != nil
target.damage_pop = true
end
if $SilfeedArks["Special_Attack"]
# 当身技の発動エフェクト もしくは 反撃スキル準備
if ( target.counter[6] )
target.counter[6] = false
if ( target.counter[0] == 1 or target.counter[0] == 2)
target.animation_id = target.counter[5]
end
if ( target.counter[0] == 3 )
target.current_action.kind = 1
target.current_action.skill_id = target.counter[1]
@action_battlers.unshift(target)
$game_temp.counter_mode += 1
end
if ( target.counter[0] == 4 )
@counter_temp = target.current_action.skill_id
target.current_action.kind = 1
target.current_action.skill_id = @active_battler.current_action.skill_id
@action_battlers.unshift(target)
$game_temp.counter_mode += 1
end
end
end # $SilfeedArks["Special_Attack"]
end
# 連続攻撃
# 通常攻撃の場合、攻撃回数を増やす
if @active_battler.current_action.kind == 0 &&
@active_battler.current_action.basic == 0
@attakked_num += 1
end
if $OuterFlgs["Rand_Select"]
# スキルの場合、攻撃対象インデックスを増やす
if @active_battler.current_action.kind == 1
@selected_num += 1
end
end # $OuterFlgs["Rand_Select"]
# 攻撃した敵が生き残っているか確認
f = false
for target in @target_battlers
if target.exist?
f = true
end
end
# ステップ 6 に移行
@phase4_step = 6
# 攻撃した敵が生き残っていれば
if f
# 「基本動作」で、「攻撃」なら
if @active_battler.current_action.kind == 0 &&
@active_battler.current_action.basic == 0
if $OuterFlgs["Multi_Atk_Wep"]
# 武器に設定された最大攻撃数の取得
@max_atk_num = get_max_attack(@active_battler.weapon_id)
end # $OuterFlgs["Multi_Atk_Wep"]
# 攻撃回数が最大攻撃数を超えていない場合
if @attakked_num < @max_atk_num
# ステップ 2 に移行
@phase4_step = 2
return
end
end
if $OuterFlgs["Rand_Select"]
# スキルの場合
if @active_battler.current_action.kind == 1
# ランダムセレクト数が残っている場合
if @selected_num < $game_system.sel_num
# ステップ 2 に移行
@phase4_step = 2
return
end
end
end # $OuterFlgs["Rand_Select"]
end
end
end
|