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

64 lines
2.1 KiB
C#
Raw Normal View History

2026-03-20 11:56:50 -04:00
using System.Collections.Generic;
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;
2026-04-17 12:01:50 -04:00
using SLSUtilities.General;
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
{
2026-03-20 11:56:50 -04:00
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
2025-11-12 23:44:20 -06:00
{
base.PlayEffect(targetList);
2026-03-20 11:56:50 -04:00
CommandGroup mainGroup = ForEachTarget(targetList, target => Cmd.Parallel(
2025-11-12 23:44:20 -06:00
new Cmd_PlayAnimation(user.characterView, "Attack"),
2026-04-01 12:23:27 -04:00
Cmd.After(0.2f, () => AttackTarget(target, GetTargetedFinalDamage(target)))
2026-03-20 11:56:50 -04:00
));
2025-11-12 01:20:19 -06:00
2026-03-20 11:56:50 -04:00
mainGroup.AddCommand(Cmd.Do(() =>
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
}));
2026-03-20 11:56:50 -04:00
return mainGroup;
2025-11-12 23:44:20 -06:00
}
}
}
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;
}
}
}
}