2025-10-23 00:49:44 -04:00
|
|
|
using Continentis.MainGame;
|
|
|
|
|
using Continentis.MainGame.Character;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
namespace Continentis.Mods.Basic.Buffs
|
|
|
|
|
{
|
2025-10-24 09:11:22 -04:00
|
|
|
public sealed class Blind : CharacterCombatBuffBase
|
2025-10-23 00:49:44 -04:00
|
|
|
{
|
2025-10-24 09:11:22 -04:00
|
|
|
public Blind(int initialCount, int stack = 25)
|
2025-10-23 00:49:44 -04:00
|
|
|
{
|
|
|
|
|
Initialize(BuffType.Negative, BuffDispelLevel.Basic);
|
|
|
|
|
|
|
|
|
|
this.contentSubmodule = new ContentSubmodule(this)
|
|
|
|
|
.AddParameterGetter("Count", () => actionCountSubmodule.remainingCount.ToString())
|
|
|
|
|
.AddParameterGetter("Stack", () => unitedStackSubmodule.stackAmount.ToString());
|
|
|
|
|
|
|
|
|
|
this.iconSubmodule = new IconSubmodule(this);
|
|
|
|
|
|
|
|
|
|
actionCountSubmodule = new CountSubmodule(this, initialCount);
|
|
|
|
|
|
|
|
|
|
generalAttributeSubmodule = new GeneralAttributeSubmodule(this);
|
|
|
|
|
generalAttributeSubmodule.numericChange.Add("DodgeCheckStartDamageMultiplier", -0.01f * stack);
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-24 09:11:22 -04:00
|
|
|
public override bool OnBuffApply(out CharacterCombatBuffBase existingBuff)
|
2025-10-23 00:49:44 -04:00
|
|
|
{
|
|
|
|
|
MainGameManager.Instance.basePrefabs.GenerateInfoText("Blind", attachedCharacter.characterView);
|
|
|
|
|
|
|
|
|
|
if (FindExistingSameBuff(out existingBuff))
|
|
|
|
|
{
|
2025-10-31 10:02:30 -04:00
|
|
|
existingBuff.unitedStackSubmodule.PickHigherStack(this.unitedStackSubmodule);
|
2025-10-23 00:49:44 -04:00
|
|
|
existingBuff.actionCountSubmodule.AddRemainingCount(this.actionCountSubmodule.remainingCount);
|
|
|
|
|
|
|
|
|
|
int remainingCount = existingBuff.actionCountSubmodule.remainingCount;
|
|
|
|
|
int stackAmount = existingBuff.unitedStackSubmodule.stackAmount;
|
|
|
|
|
existingBuff.generalAttributeSubmodule.numericChange["DodgeCheckStartDamageMultiplier"] = -0.01f * stackAmount;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|