Files
Continentis/Assets/Mods/Basic/Characters/CombatBuffs/General/Burn.cs

52 lines
1.8 KiB
C#
Raw Normal View History

2025-10-23 00:49:44 -04:00
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
{
2025-10-24 09:11:22 -04:00
public sealed class Burn : CharacterCombatBuffBase
2025-10-23 00:49:44 -04:00
{
2025-10-24 09:11:22 -04:00
public Burn(int stack)
2025-10-23 00:49:44 -04:00
{
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);
2025-12-13 23:47:42 -05:00
this.eventSubmodule.onActionEnd.Add("Burn", new PrioritizedAction(OnActionEnd));
2025-10-31 10:02:30 -04:00
this.eventSubmodule.onAfterPlayCard.Add("Burn", new PrioritizedAction<CardInstance, List<CharacterBase>>(OnAfterPlayCard));
2025-10-23 00:49:44 -04:00
}
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("Burn", attachedCharacter.characterView);
if (FindExistingSameBuff(out existingBuff))
{
existingBuff.unitedStackSubmodule.AddStack(this.unitedStackSubmodule.stackAmount);
return false;
}
return true;
}
2025-10-30 04:21:28 -04:00
2025-12-13 23:47:42 -05:00
private void OnActionEnd()
2025-10-30 04:21:28 -04:00
{
unitedStackSubmodule.ReduceStack(1);
iconSubmodule.Update();
}
2025-10-23 00:49:44 -04:00
private void OnAfterPlayCard(CardInstance card, List<CharacterBase> targets)
{
2025-11-08 22:22:43 -05:00
sourceCharacter.Attack(attachedCharacter, unitedStackSubmodule.stackAmount, null, false, true);
2025-10-23 00:49:44 -04:00
}
}
}