47 lines
1.6 KiB
C#
47 lines
1.6 KiB
C#
using System.Collections.Generic;
|
|
using Continentis.MainGame;
|
|
using Continentis.MainGame.Card;
|
|
using Continentis.MainGame.Character;
|
|
using Continentis.MainGame.Commands;
|
|
using SLSFramework.General;
|
|
using UnityEngine;
|
|
|
|
namespace Continentis.Mods.Basic.Cards
|
|
{
|
|
public class WindBlade : CardLogicBase
|
|
{
|
|
public override void SetUpLogicComponents()
|
|
{
|
|
AddLogicComponent<CardLogicComponent_Attack>();
|
|
}
|
|
|
|
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
|
{
|
|
base.PlayEffect(targetList);
|
|
|
|
return ForEachTarget(targetList, target => Cmd.Parallel(
|
|
new Cmd_PlayAnimation(user.characterView, "Attack"),
|
|
Cmd.After(0.2f, () => user.Attack(target, GetTargetedFinalDamage(target)))
|
|
));
|
|
}
|
|
|
|
public override void ApplyAttributeChangesByCard()
|
|
{
|
|
LogicComponent<CardLogicComponent_Attack>().SetDamage_Magic();
|
|
}
|
|
|
|
public override int GetTargetedFinalDamage(CharacterBase target, AttackContext ctx = null)
|
|
{
|
|
float baseDamageFromSuppress = 0;
|
|
|
|
if (target is CombatNPC npc && user.IsOpponent(npc))
|
|
baseDamageFromSuppress = npc.actionCountThisRound == 0 ? 4f : 0f;
|
|
|
|
base.GetFinalDamage(target, ctx, out float baseDamageAfterOffset, out float elementalAmplifier, out float magicAmplifier, out float finalAmplifier);
|
|
|
|
float finalDamage = (baseDamageAfterOffset + baseDamageFromSuppress) * elementalAmplifier * magicAmplifier * finalAmplifier;
|
|
|
|
return Mathf.RoundToInt(finalDamage);
|
|
}
|
|
}
|
|
} |