bosuheya chouseimae

This commit is contained in:
ohgushiyuga
2026-07-14 14:14:48 +09:00
parent 568ed162fb
commit 1ab733c127
9 changed files with 161 additions and 42 deletions

View File

@@ -21,7 +21,16 @@ public class BossController : MonoBehaviour, IDamageble
[SerializeField] public Transform groundAnchor;
[field: SerializeField] public float AttackRadius { get; private set; } = 10f;
[field: SerializeField] public float JumpRoarDuration { get; private set; } = 5f;
[field: SerializeField] public float CeilingAttackDuration { get; private set; } = 8.0f;
[Tooltip("★新設:糸を降らせる時間間隔(秒)。数値を小さくする(例: 0.1)ほど弾数が激増して密度が上がります")]
[field: SerializeField] public float CeilingShotInterval { get; private set; } = 0.2f;
[Tooltip("★新設:地面に赤マーク(予兆)が出てから、本物の糸が降ってくるまでのタイムラグ(秒)")]
[field: SerializeField] public float WebWarningDelay { get; private set; } = 0.8f;
[Tooltip("★新設:地面に生成された糸が消えずに残り続ける時間(秒)")]
[field: SerializeField] public float WebDuration { get; private set; } = 3.0f;
[SerializeField] private GameObject warningMarkerPrefab;
[SerializeField] private GameObject webPrefab;
@@ -38,7 +47,7 @@ public class BossController : MonoBehaviour, IDamageble
// フェーズトリガー
private bool triggered50 = false;
private bool triggered25 = false;
public bool PendingUltimate { get; set; } = false;
public bool PendingUltimate { get; set; } = false;
private void Awake()
{
@@ -102,11 +111,11 @@ public class BossController : MonoBehaviour, IDamageble
public void TakeDamage(DamageInfo damageInfo)
{
currentHp -= damageInfo.amount;
currentHp -= damageInfo.amount;
currentHp = Mathf.Clamp(currentHp, 0, maxHp);
float hpPercentage = (currentHp / maxHp) * 100f;
Debug.Log($"💥 ボスに { damageInfo.amount} ダメージ。残りHP: {hpPercentage:F1}%");
Debug.Log($"💥 ボスに {damageInfo.amount} ダメージ。残りHP: {hpPercentage:F1}%");
if (hpPercentage <= 25f && !triggered25)
{
@@ -165,8 +174,11 @@ public class BossController : MonoBehaviour, IDamageble
if (webPrefab != null)
{
GameObject web = Instantiate(webPrefab, pos, Quaternion.identity);
Destroy(web, duration);
Quaternion webRotation = Quaternion.Euler(270f, 0f, 0f);
GameObject web = Instantiate(webPrefab, pos + new Vector3(0, 0.5f, 0), webRotation);
Destroy(web, duration);
}
}
@@ -180,13 +192,34 @@ public class BossController : MonoBehaviour, IDamageble
Anim.ResetTrigger("Land");
Anim.ResetTrigger("StunStart");
}
#region
/// <summary>
/// Unityインスペクターの右上メニューから実行できるデバッグ用コマンドです
/// </summary>
[ContextMenu("🛠️ デバッグ:強制必殺技(天井ジャンプ)")]
public void DebugTriggerUltimate()
{
if (!Application.isPlaying)
{
Debug.LogWarning("⚠️ ゲームが再生中Playモードの時のみ実行可能です。");
return;
}
Debug.Log("🛠️ 【デバッグ操作】必殺技の予約券を発行し、強制的に天井ジャンプステートへ遷移します。");
// 必殺技の発動権をONにし、現在の行動をキャンセルして天井ジャンプへ移行
PendingUltimate = true;
ChangeState<SpiderJumpToCeilingState>();
}
#endregion
}
/// 共通データboss参照を自動保持し、各子ステートの無駄なコードを極限まで削ります。
public abstract class SpiderStateBase : ISpiderState
{
protected readonly BossController boss;
protected SpiderStateBase(BossController owner)
{
boss = owner;