gameplay所有基本功能都装了,加入了全局警告。加入飘字等各种东西。
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user