Files
Continentis/Assets/Mods/Basic/Cards/Scripts/Cleric/DivinePunishment.cs

67 lines
2.3 KiB
C#
Raw Normal View History


2025-11-12 23:44:20 -06:00
using Continentis.MainGame;
using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
2025-11-12 01:20:19 -06:00
using Continentis.MainGame.Commands;
using SLSFramework.General;
using System.Collections.Generic;
2025-11-12 01:20:19 -06:00
using Unity.VisualScripting;
2025-11-12 23:44:20 -06:00
namespace Continentis.Mods.Basic
{
2025-11-12 23:44:20 -06:00
namespace Cards.Cleric
{
2025-11-12 23:44:20 -06:00
public class DivinePunishment : CardLogicBase
{
2025-11-15 12:17:34 -05:00
public override List<CommandBase> PlayEffect(List<CharacterBase> targetList)
2025-11-12 23:44:20 -06:00
{
base.PlayEffect(targetList);
CommandGroup mainGroup = TargetListCommandGroup(targetList,
new Cmd_PlayAnimation(user.characterView, "Attack"),
new Cmd_ParamFunction<CharacterBase>(0.2f, target =>
{
2025-11-15 12:17:34 -05:00
user.Attack(target, GetTargetedFinalDamage(target));
2025-11-12 23:44:20 -06:00
}));
2025-11-12 01:20:19 -06:00
2025-11-12 23:44:20 -06:00
mainGroup.AddCommand(new Cmd_Function(() =>
2025-11-12 01:20:19 -06:00
{
2025-11-15 12:17:34 -05:00
CreateCardBuff<Buffs.DivinePunishment>(GetAttribute("DamageStack")).Apply(card, user, this);
card.contentSubmodule.dirtyMark = true;
2025-11-12 01:20:19 -06:00
}));
2025-11-12 23:44:20 -06:00
return new List<CommandBase> { mainGroup };
}
}
}
namespace Buffs
{
public class DivinePunishment : CardCombatBuffBase
{
public DivinePunishment(int stack)
2025-11-12 01:20:19 -06:00
{
2025-11-12 23:44:20 -06:00
Initialize(BuffType.Positive, BuffDispelLevel.Strong);
this.contentSubmodule = new ContentSubmodule(this);
this.unitedStackSubmodule = new UnitedStackSubmodule(this, true, -1, stack);
this.attributeSubmodule = new AttributeSubmodule(this);
this.attributeSubmodule.numericChange.Add("Damage", stack);
}
public override bool OnBuffApply(out CardCombatBuffBase existingBuff)
{
if (FindExistingSameBuff(out existingBuff))
{
existingBuff.unitedStackSubmodule.ModifyStack(this.unitedStackSubmodule.stackAmount);
int newStack = existingBuff.unitedStackSubmodule.stackAmount;
existingBuff.attributeSubmodule.numericChange["Damage"] = newStack;
return false;
}
2025-11-12 01:20:19 -06:00
2025-11-12 23:44:20 -06:00
return true;
}
}
}
}