Files
Continentis/Assets/Mods/Basic/Cards/Scripts/Knight/DivineSmite.cs
2025-10-31 10:02:30 -04:00

46 lines
1.8 KiB
C#

using System.Collections.Generic;
using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
using Continentis.MainGame.Combat;
using Continentis.MainGame.Commands;
using Continentis.Mods.Basic.Buffs;
using SLSFramework.General;
using UnityEngine;
namespace Continentis.Mods.Basic.Cards
{
public class DivineSmite : CardLogicBase
{
protected override void SetUpLogicComponents()
{
AddLogicComponent<CardLogicComponent_Attack>();
AddLogicComponent<CardLogicComponent_Protect>();
}
protected override CommandBase PlayEffect(List<CharacterBase> targetList)
{
CommandGroup mainGroup = TargetListCommandGroup(targetList,
new Cmd_PlayAnimation(user.characterView, "Attack"),
new Cmd_PlaySFX("SFX_Basic_SwordStrike"),
new Cmd_SpawnVFX("VFX_Basic_RedImpact"),
new Cmd_ParamFunction<CharacterBase>(target => user.Attack(target, GetFinalDamage(target))));
foreach (CharacterBase protectTarget in CombatMainManager.Instance.characterController.GetAllAllies(user))
{
Cmd_ParamFunction<CharacterBase> protectCommand = new Cmd_ParamFunction<CharacterBase>((target) =>
{
LogicComponent<CardLogicComponent_Protect>().GenerateProtection(user, target, GetAttribute("BuffCount_Protecting"));
});
protectCommand.selfContext.context["Target"] = protectTarget;
mainGroup.AddCommand(protectCommand);
}
return mainGroup;
}
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Attack>().SetDamage_Slash();
}
}
}