This commit is contained in:
SoulliesOfficial
2025-12-13 23:28:23 -05:00
parent 40660b41e0
commit 467e385991
49 changed files with 238 additions and 161 deletions

View File

@@ -45,9 +45,9 @@ namespace Continentis.MainGame
public partial class BuffBase<T>
{
protected bool FindExistingSameBuff<T1, T2>(out T2 existingBuff, List<T1> buffList) where T1 : BuffBase<T> where T2 : BuffBase<T>
protected bool FindExistingSameBuffs<T1, T2>(out List<T2> existingBuffs, List<T1> buffList) where T1 : BuffBase<T> where T2 : BuffBase<T>
{
existingBuff = null;
existingBuffs = new List<T2>();
//Debug.Log($"Searching for existing buff of type: {this.GetType()} in buff list of count: {buffList.Count}");
foreach (T1 buff in buffList)
{
@@ -55,9 +55,8 @@ namespace Continentis.MainGame
if (buff.GetType() == this.GetType())
{
//Debug.Log("Found existing buff of the same type.");
existingBuff = buff as T2;
existingBuffs.Add(buff as T2);
//Debug.Log(existingBuff == null);
return true;
}
else
{
@@ -65,7 +64,7 @@ namespace Continentis.MainGame
}
}
return false;
return existingBuffs.Count > 0;
}
public abstract void Apply(T attached);