64 lines
2.1 KiB
C#
64 lines
2.1 KiB
C#
|
|
|
|
using System.Collections.Generic;
|
|
using Continentis.MainGame;
|
|
using Continentis.MainGame.Card;
|
|
using Continentis.MainGame.Character;
|
|
using Continentis.MainGame.Commands;
|
|
using SLSFramework.General;
|
|
|
|
namespace Continentis.Mods.Basic
|
|
{
|
|
namespace Cards.Cleric
|
|
{
|
|
public class DivinePunishment : CardLogicBase
|
|
{
|
|
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
|
{
|
|
base.PlayEffect(targetList);
|
|
|
|
CommandGroup mainGroup = ForEachTarget(targetList, target => Cmd.Parallel(
|
|
new Cmd_PlayAnimation(user.characterView, "Attack"),
|
|
Cmd.After(0.2f, () => user.Attack(target, GetTargetedFinalDamage(target)))
|
|
));
|
|
|
|
mainGroup.AddCommand(Cmd.Do(() =>
|
|
{
|
|
CreateCardBuff<Buffs.DivinePunishment>(GetAttribute("DamageStack")).Apply(card, user, this);
|
|
card.contentSubmodule.dirtyMark = true;
|
|
}));
|
|
|
|
return 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;
|
|
}
|
|
}
|
|
}
|
|
}
|