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

@@ -38,6 +38,7 @@ namespace Continentis.Mods.Basic.Buffs
private void OnActionStart()
{
Debug.Log($"Corrosion deals damage to {attachedCharacter.data.displayName}");
sourceCharacter.Attack(attachedCharacter, unitedStackSubmodule.stackAmount, null, false, true);
unitedStackSubmodule.ReduceStack(1);
iconSubmodule.Update();

View File

@@ -23,8 +23,6 @@ namespace Continentis.Mods.Basic.Buffs
.AddParameterGetter("Protector", GetProtectorNames);
this.iconSubmodule = new IconSubmodule(this).SetTextFunctions();
this.eventSubmodule = new EventSubmodule(this);
}
public override bool OnBuffApply(out CharacterCombatBuffBase existingBuff)

View File

@@ -1,3 +1,4 @@
using System.Collections.Generic;
using Continentis.MainGame;
using Continentis.MainGame.Character;
using SLSFramework.General;
@@ -22,42 +23,43 @@ namespace Continentis.Mods.Basic.Buffs
}
this.contentSubmodule = new ContentSubmodule(this)
.AddParameterGetter("Count", () => roundCountSubmodule.remainingCount.ToString())
.AddParameterGetter("Count", () => roundFirstActionCountSubmodule.remainingCount.ToString())
.AddParameterGetter("Target", () => target.data.displayName);//TODO: 以后增加角色的ContentSubmodule
this.iconSubmodule = new IconSubmodule(this).SetTextFunctions("Count");
this.roundCountSubmodule = new CountSubmodule(this, actionCount);
this.eventSubmodule = new EventSubmodule(this);
this.roundFirstActionCountSubmodule = new CountSubmodule(this, actionCount);
}
public override bool OnBuffApply(out CharacterCombatBuffBase existingBuff)
{
MainGameManager.Instance.basePrefabs.GenerateInfoText(contentSubmodule.displayName, attachedCharacter.characterView);
MainGameManager.Instance.basePrefabs.GenerateInfoText(contentSubmodule.displayName,
attachedCharacter.characterView);
if (attachedCharacter.combatBuffSubmodule.TryGetBuff(out Protected conflictProtected))
{
//如果目标已经有Protected Buff则应当将其移除以防止冲突.
//使用移除所有保护者的方式来移除。
Debug.Log($"Conflicted Protected buff found, with {conflictProtected.protectingSources.Count} protecting sources. Removing all.");
Debug.Log(
$"Conflicted Protected buff found, with {conflictProtected.protectingSources.Count} protecting sources. Removing all.");
conflictProtected.protectingSources.For(ps => ps.Remove());
}
if (FindExistingSameBuff(out existingBuff))
if (FindExistingSameBuffs(out List<Protecting> existingProtecting))
{
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)
var sameProtecting = existingProtecting.Find(ep => ep.target == this.target);
if (sameProtecting != null)
{
existProtecting.roundCountSubmodule.AddCount(this.roundCountSubmodule.remainingCount);
existingBuff = sameProtecting;
sameProtecting.roundFirstActionCountSubmodule.AddCount(this.roundFirstActionCountSubmodule.remainingCount);
return false;
}
existingBuff = null;
return true; //独立处理直接返回true
}
existingBuff = null;
return true;
}
@@ -71,6 +73,7 @@ namespace Continentis.Mods.Basic.Buffs
{
base.OnBuffRemove();
protectedBuff.protectingSources.Remove(this);
Debug.Log($"Protecting buff removed. Remaining protecting sources: {protectedBuff.protectingSources.Count}");
if (protectedBuff.protectingSources.Count == 0)
{
protectedBuff.Remove();

View File

@@ -1,6 +1,7 @@
using Continentis.MainGame;
using Continentis.MainGame.Character;
using SLSFramework.General;
using UnityEngine;
namespace Continentis.Mods.Basic.Buffs
{
@@ -35,16 +36,17 @@ namespace Continentis.Mods.Basic.Buffs
public override bool OnBuffApply(out CharacterCombatBuffBase existingBuff)
{
MainGameManager.Instance.basePrefabs.GenerateInfoText("Sharpness", attachedCharacter.characterView);
if (FindExistingSameBuff(out existingBuff))
{
existingBuff.unitedStackSubmodule.ModifyStack(this.unitedStackSubmodule.stackAmount);
int newStack = existingBuff.unitedStackSubmodule.stackAmount;
existingBuff.coreAttributeSubmodule.numericChange["PhysicsDamageDealtOffset"] = newStack;
Debug.Log($"[Sharpness] New Stack: {newStack}");
existingBuff.generalAttributeSubmodule.numericChange["PhysicsDamageDealtOffset"] = newStack;
return false;
}
return true;
}
}

View File

@@ -28,7 +28,7 @@ namespace Continentis.Mods.Basic.Buffs
if (FindExistingSameBuff(out existingBuff))
{
existingBuff.actionCountSubmodule.AddCount(this.roundCountSubmodule.maximumCount);
existingBuff.actionCountSubmodule.AddCount(this.actionCountSubmodule.remainingCount);
return false;
}