继续
This commit is contained in:
48
Assets/Mods/Basic/Cards/Scripts/General/WindBlade.cs
Normal file
48
Assets/Mods/Basic/Cards/Scripts/General/WindBlade.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System.Collections.Generic;
|
||||
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
|
||||
{
|
||||
protected override void SetUpLogicComponents()
|
||||
{
|
||||
AddLogicComponent<CardLogicComponent_Attack>();
|
||||
}
|
||||
|
||||
protected override 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, GetFinalDamage(target))));
|
||||
|
||||
return mainGroup;
|
||||
}
|
||||
|
||||
public override void ApplyAttributeChangesByCard()
|
||||
{
|
||||
LogicComponent<CardLogicComponent_Attack>().SetDamage_Arcane();
|
||||
}
|
||||
|
||||
public override int GetFinalDamage(CharacterBase target, List<string> elementalTags = null)
|
||||
{
|
||||
float baseDamageFromSuppress = 0;
|
||||
|
||||
if (target is CombatNPC npc && user.IsOpponent(npc))
|
||||
{
|
||||
baseDamageFromSuppress = npc.actionCountThisRound == 0 ? 4f : 0f;
|
||||
}
|
||||
|
||||
base.GetFinalDamage(target, elementalTags, out float baseDamageAfterOffset, out float elementalAmplifier, out float magicAmplifier, out float finalAmplifier);
|
||||
|
||||
float finalDamage = (baseDamageAfterOffset + baseDamageFromSuppress) * elementalAmplifier * magicAmplifier * finalAmplifier;
|
||||
|
||||
return Mathf.RoundToInt(finalDamage);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user