This commit is contained in:
ohgushiyuga
2026-08-27 12:51:15 +09:00
parent 1441c96f74
commit 52341100ed
32 changed files with 840 additions and 1076 deletions

View File

@@ -3,24 +3,25 @@ using UnityEngine;
public class SlowWebArea : MonoBehaviour
{
[SerializeField] private float damagePerSecond = 5f;
private float damageTimer = 0f;
private float damageTimer;
private void OnTriggerStay(Collider other)
{
if (other.CompareTag("Player"))
{
// ★鈍足効果の適用演出
// プレイヤーの移動スクリプトに対し、一時的な速度デバフ(例: Speed * 0.3f)を掛けます
// ここでは設計の切り離しのため、ログ出力のみとしています
Debug.LogWarning("🕸️ プレイヤーが蜘蛛の糸に囚われている! 【鈍足化デバフ発動中】");
// スリップダメージ(1秒ごとに継続ダメージ)
damageTimer += Time.deltaTime;
if (damageTimer >= 1.0f)
{
// プレイヤーのHealthコンポーネントにダメージを通知
// other.GetComponent<PlayerHealth>()?.TakeDamage(damagePerSecond);
Debug.Log($"🕸️ 糸によるスリップダメージ: {damagePerSecond}");
IDamageable damageable = other.GetComponentInParent<IDamageable>();
if (damageable != null)
{
DamageInfo info = new DamageInfo
{
amount = damagePerSecond,
hitPosition = other.transform.position
};
damageable.TakeDamage(info);
}
damageTimer = 0f;
}
}
@@ -30,7 +31,7 @@ public class SlowWebArea : MonoBehaviour
{
if (other.CompareTag("Player"))
{
Debug.Log("🏃 プレイヤーが糸の範囲から脱出。 鈍足効果解除。");
damageTimer = 0f;
}
}
}