Files
Continentis/Assets/Mods/Basic/Characters/CombatBuffs/General/Protected.cs
2025-10-30 12:07:59 -04:00

48 lines
1.7 KiB
C#

using System.Collections.Generic;
using Continentis.MainGame;
using Continentis.MainGame.Character;
using Continentis.MainGame.Combat;
using SLSFramework.General;
using UnityEngine;
namespace Continentis.Mods.Basic.Buffs
{
public class Protected : CharacterCombatBuffBase
{
public List<Protecting> protectingSources;
public Protected()
{
Initialize(BuffType.Neutral, BuffDispelLevel.DeathOnly, 100);
this.contentSubmodule = new ContentSubmodule(this);//TODO: 以后增加角色的ContentSubmodule
this.iconSubmodule = new IconSubmodule(this).SetTextFunctions();
this.eventSubmodule = new EventSubmodule(this);
/*
this.eventSubmodule.onOpponentDecideAction.Add("Protected",
new EventUnit<CharacterBase, IntendedCard, CharacterBase>((opponent, intendedCard, originalTarget) =>
{
if (opponent is CombatNPC npc)
{
intendedCard.targets.Remove(originalTarget);
//intendedCard.targets.Add(protector); //TODO: 后续用设计专门的函数决定目标改变
}
}));
*/
}
public override bool OnBuffApply(out CharacterCombatBuffBase existingBuff)
{
MainGameManager.Instance.basePrefabs.GenerateInfoText(contentSubmodule.displayName, attachedCharacter.characterView);
if (FindExistingSameBuff(out existingBuff))
{
return false;
}
return true;
}
}
}