复制牌,保护buff显示调整
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user