复制牌,保护buff显示调整

This commit is contained in:
SoulliesOfficial
2025-10-30 12:07:59 -04:00
parent b68eeda9af
commit 8b72c75128
33 changed files with 433 additions and 104 deletions

View File

@@ -33,22 +33,37 @@ namespace Continentis.Mods.Basic.Buffs
public override bool OnBuffApply(out CharacterCombatBuffBase existingBuff)
{
this.protectedBuff ??= target.combatBuffSubmodule.GetBuff<Protected>(attachedCharacter.elementID.ToString());
this.protectedBuff.protectingBuff = this;
MainGameManager.Instance.basePrefabs.GenerateInfoText(contentSubmodule.displayName, attachedCharacter.characterView);
if (FindExistingSameBuff(out existingBuff))
{
Debug.Log("Existing same buff found.");
Protecting existProtecting = existingBuff as Protecting;
Debug.Log(existProtecting == null ? "Existing buff is not of type Protecting!" : "Existing Protecting buff found.");
if (existProtecting.target == this.target)
{
existProtecting.roundCountSubmodule.AddCount(this.roundCountSubmodule.remainingCount);
return false;
}
this.protectedBuff ??= target.combatBuffSubmodule.GetBuff<Protected>();
this.protectedBuff.protectingSources.Add(this);
return true; //独立处理直接返回true
}
Debug.Log("No existing same buff found.");
return true;
}
public override void OnBuffRemove()
{
base.OnBuffRemove();
protectedBuff?.OnBuffRemove();
protectedBuff.protectingSources.Remove(this);
if (protectedBuff.protectingSources.Count == 0)
{
protectedBuff.Remove();
}
}
}
}