更新
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
using System.Collections.Generic;
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Commands;
|
||||
using SLSUtilities.General;
|
||||
|
||||
namespace Continentis.Mods.Basic.Cards
|
||||
{
|
||||
/// <summary>
|
||||
/// 挑衅打击:对单体敌人造成物理伤害并挑衅目标。
|
||||
/// 挑衅使自身获得嘲讽状态,迫使非全体攻击的敌方只能选择自己作为目标。
|
||||
/// </summary>
|
||||
public class ProvokeStrike : CardLogicBase
|
||||
{
|
||||
private const string BUFF_PROVOKING_COUNT = "Buff_Provoking_Count";
|
||||
|
||||
private AttackContext PhysicsCtx => AttackContext.Default(card).WithDamageKeywords(CardKeywords.Physics);
|
||||
|
||||
public override void SetUpLogicComponents()
|
||||
{
|
||||
AddLogicComponent<CardLogicComponent_Attack>();
|
||||
AddLogicComponent<CardLogicComponent_Provoke>();
|
||||
}
|
||||
|
||||
/// <summary>选中目标时更新伤害预览。</summary>
|
||||
public override void TargetingEffect(CharacterBase target)
|
||||
{
|
||||
card.SetAttribute("Display_Damage", GetTargetedFinalDamage(target, PhysicsCtx));
|
||||
}
|
||||
|
||||
/// <summary>取消选中时以无目标模式刷新预览。</summary>
|
||||
public override void UntargetingEffect()
|
||||
{
|
||||
card.SetAttribute("Display_Damage", GetNoTargetFinalDamage(PhysicsCtx));
|
||||
}
|
||||
|
||||
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
||||
{
|
||||
return ForEachTarget(targetList, target => Cmd.Sequential(
|
||||
new Cmd_PlayAnimation(user.characterView, "Attack"),
|
||||
Cmd.Do(() =>
|
||||
{
|
||||
AttackContext ctx = PhysicsCtx;
|
||||
AttackTarget(target, GetTargetedFinalDamage(target, ctx), ctx);
|
||||
|
||||
LogicComponent<CardLogicComponent_Provoke>().GenerateProvocation(user, target, GetAttribute(BUFF_PROVOKING_COUNT));
|
||||
})
|
||||
));
|
||||
}
|
||||
|
||||
public override void ApplyAttributeChangesByCard()
|
||||
{
|
||||
LogicComponent<CardLogicComponent_Attack>().SetDamage_Physics();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user