This commit is contained in:
SoulliesOfficial
2025-10-24 09:11:22 -04:00
parent 61a397dd4c
commit 76157e3cb1
329 changed files with 8609 additions and 4549 deletions

View File

@@ -0,0 +1,41 @@
using System.Collections.Generic;
using Continentis.MainGame;
using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
using SLSFramework.General;
using UnityEngine;
namespace Continentis.Mods.Basic.Buffs
{
public sealed class Bleed : CharacterCombatBuffBase
{
public Bleed(int stack)
{
Initialize(BuffType.Negative, BuffDispelLevel.Basic);
this.contentSubmodule = new ContentSubmodule(this)
.AddParameterGetter("Stack", () => unitedStackSubmodule.stackAmount.ToString());
this.iconSubmodule = new IconSubmodule(this);
this.unitedStackSubmodule = new UnitedStackSubmodule(this, stack);
this.eventSubmodule = new EventSubmodule(this);
this.eventSubmodule.onActionStart.Add("Bleed", new EventUnit(OnActionStart));
this.eventSubmodule.onGetAttacked.Add("Bleed", new EventUnit<AttackResult>(OnGetAttacked));
}
private void OnGetAttacked(AttackResult result)
{
int stackAmount = unitedStackSubmodule.stackAmount;
result.attacker.Attack(attachedCharacter, stackAmount, true);
}
private void OnActionStart()
{
int reducedStack = Mathf.Max(1, Mathf.FloorToInt(unitedStackSubmodule.stackAmount * 0.5f));
unitedStackSubmodule.ReduceStack(reducedStack);
iconSubmodule.Update();
}
}
}