Files
Continentis/Assets/Mods/Basic/Characters/CombatBuffs/General/Burn.cs
SoulliesOfficial 1bca620966 AttackResult修改
2025-11-08 22:22:43 -05:00

52 lines
1.8 KiB
C#

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 Burn : CharacterCombatBuffBase
{
public Burn(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("Burn", new PrioritizedAction(OnActionStart));
this.eventSubmodule.onAfterPlayCard.Add("Burn", new PrioritizedAction<CardInstance, List<CharacterBase>>(OnAfterPlayCard));
}
public override bool OnBuffApply(out CharacterCombatBuffBase existingBuff)
{
MainGameManager.Instance.basePrefabs.GenerateInfoText("Burn", attachedCharacter.characterView);
if (FindExistingSameBuff(out existingBuff))
{
existingBuff.unitedStackSubmodule.AddStack(this.unitedStackSubmodule.stackAmount);
return false;
}
return true;
}
private void OnActionStart()
{
unitedStackSubmodule.ReduceStack(1);
iconSubmodule.Update();
}
private void OnAfterPlayCard(CardInstance card, List<CharacterBase> targets)
{
sourceCharacter.Attack(attachedCharacter, unitedStackSubmodule.stackAmount, null, false, true);
}
}
}