bosuheya chouseimae
This commit is contained in:
@@ -216,10 +216,11 @@ public class SpiderJumpToCeilingState : SpiderStateBase
|
||||
}
|
||||
}
|
||||
|
||||
// ==========================================
|
||||
// ■ STATE: CEILING ATTACK (インスペクター無段階調整版)
|
||||
// ==========================================
|
||||
public class SpiderCeilingAttackState : SpiderStateBase
|
||||
{
|
||||
private float stateDuration = 7.0f;
|
||||
private float shotInterval = 0.4f;
|
||||
private float timer = 0f;
|
||||
private float shotTimer = 0f;
|
||||
|
||||
@@ -227,11 +228,13 @@ public class SpiderCeilingAttackState : SpiderStateBase
|
||||
|
||||
public override void EnterState()
|
||||
{
|
||||
timer = stateDuration;
|
||||
// ★リファクタリング:インスペクターで設定した必殺技の長さを適用
|
||||
timer = boss.CeilingAttackDuration;
|
||||
shotTimer = 0f;
|
||||
|
||||
boss.Anim.SetBool("IsOnCeiling", true);
|
||||
boss.PendingUltimate = false;
|
||||
Debug.Log("🕸️ 蜘蛛ボス:天井から無数の糸を乱射中!");
|
||||
Debug.Log($"🕸️ 蜘蛛ボス:天井からの乱射開始! 持続時間: {timer}秒 / 発射間隔: {boss.CeilingShotInterval}秒");
|
||||
}
|
||||
|
||||
public override void ExitState()
|
||||
@@ -247,10 +250,13 @@ public class SpiderCeilingAttackState : SpiderStateBase
|
||||
timer -= Time.deltaTime;
|
||||
shotTimer -= Time.deltaTime;
|
||||
|
||||
// タイマーがゼロになったら発射
|
||||
if (shotTimer <= 0f)
|
||||
{
|
||||
ExecuteRandomWebAttack();
|
||||
shotTimer = shotInterval;
|
||||
|
||||
// ★リファクタリング:インスペクターで設定した間隔(秒)でリセットして弾数を制御
|
||||
shotTimer = boss.CeilingShotInterval;
|
||||
}
|
||||
|
||||
if (timer <= 0f)
|
||||
@@ -261,6 +267,7 @@ public class SpiderCeilingAttackState : SpiderStateBase
|
||||
|
||||
private void ExecuteRandomWebAttack()
|
||||
{
|
||||
// インスペクターで設定された半径(AttackRadius)を基準にランダム座標を計算
|
||||
Vector2 randomCircle = Random.insideUnitCircle * boss.AttackRadius;
|
||||
Vector3 targetGroundPos = new Vector3(
|
||||
boss.groundAnchor.position.x + randomCircle.x,
|
||||
@@ -268,10 +275,10 @@ public class SpiderCeilingAttackState : SpiderStateBase
|
||||
boss.groundAnchor.position.z + randomCircle.y
|
||||
);
|
||||
|
||||
boss.SpawnWarningAndWeb(targetGroundPos, 1.0f, 2.5f);
|
||||
// ★リファクタリング:予兆マークのディレイや糸の生存時間もインスペクターと完全連動
|
||||
boss.SpawnWarningAndWeb(targetGroundPos, boss.WebWarningDelay, boss.WebDuration);
|
||||
}
|
||||
}
|
||||
|
||||
public class SpiderStunState : SpiderStateBase
|
||||
{
|
||||
private float stunTimer;
|
||||
|
||||
Reference in New Issue
Block a user