更新
This commit is contained in:
60
Assets/Mods/Basic/Cards/Scripts/General/Attack/FireRays.cs
Normal file
60
Assets/Mods/Basic/Cards/Scripts/General/Attack/FireRays.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
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;
|
||||
|
||||
namespace Continentis.Mods.Basic.Cards
|
||||
{
|
||||
/// <summary>
|
||||
/// 火焰射线:选择 3 次目标(可重复),对每个选中的目标造成火焰伤害并施加灼烧 Buff。
|
||||
/// 卡牌数据需配置 targetCount = 3,关键词需包含 AllowDuplicateTargets 和 TargetEnemies。
|
||||
/// </summary>
|
||||
public class FireRays : CardLogicBase
|
||||
{
|
||||
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("DisplayDamage", GetTargetedFinalDamage(target, FireCtx));
|
||||
}
|
||||
|
||||
/// <summary>取消选中时以无目标模式刷新预览。</summary>
|
||||
public override void UntargetingEffect()
|
||||
{
|
||||
card.SetAttribute("DisplayDamage", GetNoTargetFinalDamage(FireCtx));
|
||||
}
|
||||
|
||||
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
||||
{
|
||||
// targetList 可包含重复目标(由多目标选择系统传入)
|
||||
return Cmd.Sequential(
|
||||
new Cmd_PlayAnimation(user.characterView, "Attack"),
|
||||
ForEachTarget(targetList, target => Cmd.Do(() =>
|
||||
{
|
||||
AttackContext ctx = FireCtx;
|
||||
AttackTarget(target, GetTargetedFinalDamage(target, ctx), ctx);
|
||||
|
||||
int burnStacks = GetAttribute(BUFF_BURN_STACK);
|
||||
CreateCharacterBuff<Burn>(burnStacks).Apply(target, user);
|
||||
}))
|
||||
);
|
||||
}
|
||||
|
||||
public override void ApplyAttributeChangesByCard()
|
||||
{
|
||||
LogicComponent<CardLogicComponent_Attack>().SetDamage_Arcane();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user