卡牌更新
This commit is contained in:
69
Assets/Mods/Basic/Cards/Scripts/General/Attack/FlameSpear.cs
Normal file
69
Assets/Mods/Basic/Cards/Scripts/General/Attack/FlameSpear.cs
Normal file
@@ -0,0 +1,69 @@
|
||||
using System.Collections.Generic;
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Commands;
|
||||
using Continentis.Mods.Basic.Buffs;
|
||||
using SLSFramework.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Cards
|
||||
{
|
||||
/// <summary>
|
||||
/// 炎枪术:先削减目标的格挡值,再对目标造成大量火焰伤害并施加灼烧 Buff。
|
||||
/// 格挡削减不受伤害加成影响,直接扣减固定值。
|
||||
/// </summary>
|
||||
public class FlameSpear : CardLogicBase
|
||||
{
|
||||
private const string BLOCK_REDUCTION = "Block_Reduction";
|
||||
private const string BUFF_BURN_STACK = "Buff_Burn_Stack";
|
||||
|
||||
private AttackContext FireCtx => AttackContext.Default(card)
|
||||
.WithDamageKeywords("Fire");
|
||||
|
||||
public override void SetUpLogicComponents()
|
||||
{
|
||||
AddLogicComponent<CardLogicComponent_Attack>();
|
||||
}
|
||||
|
||||
/// <summary>选中目标时更新伤害预览。</summary>
|
||||
public override void TargetingEffect(CharacterBase target)
|
||||
{
|
||||
card.SetAttribute("Display_Damage", GetTargetedFinalDamage(target, FireCtx));
|
||||
}
|
||||
|
||||
/// <summary>取消选中时以无目标模式刷新预览。</summary>
|
||||
public override void UntargetingEffect()
|
||||
{
|
||||
card.SetAttribute("Display_Damage", GetNoTargetFinalDamage(FireCtx));
|
||||
}
|
||||
|
||||
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
||||
{
|
||||
return ForEachTarget(targetList, target => Cmd.Sequential(
|
||||
new Cmd_PlayAnimation(user.characterView, "Attack"),
|
||||
Cmd.Do(() =>
|
||||
{
|
||||
// 削减格挡(直接扣减,不受任何加成影响)
|
||||
int blockReduce = GetAttribute(BLOCK_REDUCTION);
|
||||
int actualReduce = target.ModifyAndClampAttribute("Block", -blockReduce);
|
||||
target.characterView.hudContainer.UpdateAllHUD();
|
||||
//Debug.Log($"[FlameSpear] 削减 {target.data.displayName} 的格挡 {actualReduce} 点。");
|
||||
|
||||
// 火焰伤害
|
||||
AttackContext ctx = FireCtx;
|
||||
AttackTarget(target, GetTargetedFinalDamage(target, ctx), ctx);
|
||||
|
||||
// 灼烧
|
||||
int burnStacks = GetAttribute(BUFF_BURN_STACK);
|
||||
CreateCharacterBuff<Burn>(burnStacks).Apply(target, user, this);
|
||||
})
|
||||
));
|
||||
}
|
||||
|
||||
public override void ApplyAttributeChangesByCard()
|
||||
{
|
||||
LogicComponent<CardLogicComponent_Attack>().SetDamage_Magic();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user