67 lines
2.3 KiB
C#
67 lines
2.3 KiB
C#
|
|
|
|
using Continentis.MainGame;
|
|
using Continentis.MainGame.Card;
|
|
using Continentis.MainGame.Character;
|
|
using Continentis.MainGame.Commands;
|
|
using SLSFramework.General;
|
|
using System.Collections.Generic;
|
|
using Unity.VisualScripting;
|
|
|
|
namespace Continentis.Mods.Basic
|
|
{
|
|
namespace Cards.Cleric
|
|
{
|
|
public class DivinePunishment : CardLogicBase
|
|
{
|
|
public override List<CommandBase> PlayEffect(List<CharacterBase> targetList)
|
|
{
|
|
base.PlayEffect(targetList);
|
|
|
|
CommandGroup mainGroup = TargetListCommandGroup(targetList,
|
|
new Cmd_PlayAnimation(user.characterView, "Attack"),
|
|
new Cmd_ParamFunction<CharacterBase>(0.2f, target =>
|
|
{
|
|
user.Attack(target, GetTargetedFinalDamage(target));
|
|
}));
|
|
|
|
mainGroup.AddCommand(new Cmd_Function(() =>
|
|
{
|
|
CreateCardBuff<Buffs.DivinePunishment>(GetAttribute("DamageStack")).Apply(card, user, this);
|
|
card.contentSubmodule.dirtyMark = true;
|
|
}));
|
|
|
|
return new List<CommandBase> { mainGroup };
|
|
}
|
|
}
|
|
}
|
|
|
|
namespace Buffs
|
|
{
|
|
public class DivinePunishment : CardCombatBuffBase
|
|
{
|
|
public DivinePunishment(int stack)
|
|
{
|
|
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;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
}
|