34 lines
1.2 KiB
C#
34 lines
1.2 KiB
C#
using System.Collections.Generic;
|
|
using Continentis.MainGame.Base;
|
|
using Continentis.MainGame.Card;
|
|
using Continentis.MainGame.Character;
|
|
using Continentis.MainGame.Commands;
|
|
using SLSUtilities.General;
|
|
|
|
namespace Continentis.Mods.Basic.Cards
|
|
{
|
|
/// <summary>
|
|
/// 初级侦测术:移除目标的 DodgeRemoveAmount 点闪避。
|
|
/// </summary>
|
|
public class BasicDetection : CardLogicBase
|
|
{
|
|
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
|
{
|
|
return ForEachTarget(targetList, target => Cmd.Parallel(
|
|
new Cmd_PlayAnimation(user.characterView, "Action"),
|
|
Cmd.Do(() => {
|
|
int amount = GetAttribute("DodgeRemoveAmount");
|
|
int currentDodge = target.GetAttribute(CharacterAttributes.Dodge);
|
|
int removeAmount = UnityEngine.Mathf.Min(amount, currentDodge);
|
|
|
|
if (removeAmount > 0)
|
|
{
|
|
target.ModifyAttribute(CharacterAttributes.Dodge, -removeAmount);
|
|
target.characterView.hudContainer.UpdateAllHUD();
|
|
}
|
|
})
|
|
));
|
|
}
|
|
}
|
|
}
|