gameplay所有基本功能都装了,加入了全局警告。加入飘字等各种东西。

This commit is contained in:
2026-02-21 00:20:03 +08:00
parent 9f7c1c57b7
commit 14fb281d6f
254 changed files with 102927 additions and 9427 deletions
+18 -1
View File
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using UnityEngine;
@@ -64,6 +64,8 @@ public class EnemyCombatant : MonoBehaviour, ICombatant
currentMana = 0;
isDead = false;
iBudeffPrefabController.Instance?.RegisterEnemyBaseline(this);
// notify listeners (UI/manager) that enemy revived
OnEnemyRevived?.Invoke(this);
@@ -158,9 +160,11 @@ public class EnemyCombatant : MonoBehaviour, ICombatant
public void ApplyBuff(Buff buff, GameObject source)
{
if (buff == null) return;
Debug.LogWarning($"[EnemyCombatant] ApplyBuff: {buff.description} (id={buff.buffId}) to {name}. AtkMult={buff.attackMultiplier}, HealMult={buff.healReceivedMultiplier}, ScoreMult={buff.scoreMultiplier}");
activeBuffs.Add(buff);
// Apply reversible multipliers. attackMultiplier is applied via baseline+recalc to ensure it can be reverted.
if (buff.attackMultiplier != 1f) RecalculateAttackFromBuffs();
iBudeffPrefabController.Instance?.NotifyEnemyBuffApplied(this, buff);
}
public void RemoveBuff(string buffId)
@@ -170,9 +174,22 @@ public class EnemyCombatant : MonoBehaviour, ICombatant
{
activeBuffs.Remove(b);
if (b.attackMultiplier != 1f) RecalculateAttackFromBuffs();
iBudeffPrefabController.Instance?.NotifyEnemyBuffRemoved(this, b);
}
}
public float GetHealReceivedMultiplierForUI()
{
float mult = 1f;
for (int i = 0; i < activeBuffs.Count; i++)
{
var b = activeBuffs[i];
if (b == null) continue;
mult *= b.healReceivedMultiplier;
}
return mult;
}
private void EnsureAttackBaseInitialized()
{
if (_attackBaseInitialized) return;