更新
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
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>
|
||||
/// 炽焰斩:对目标造成物理斩击伤害、火焰伤害,并施加灼烧 Buff。
|
||||
/// 两次伤害分别走独立的属性修正通道,卡牌关键词仅作标记用途。
|
||||
/// </summary>
|
||||
public class SearingSlash : CardLogicBase
|
||||
{
|
||||
private const string DAMAGE_PHYSICS = "Damage_Physics";
|
||||
private const string DAMAGE_FIRE = "Damage_Fire";
|
||||
private const string BUFF_BURN_STACK = "Buff_Burn_Stack";
|
||||
|
||||
private AttackContext PhysicsCtx => AttackContext.Default(card)
|
||||
.WithDamageKeywords("Physics")
|
||||
.WithBaseDamageAttribute(DAMAGE_PHYSICS);
|
||||
|
||||
private AttackContext FireCtx => AttackContext.Default(card)
|
||||
.WithDamageKeywords("Fire")
|
||||
.WithBaseDamageAttribute(DAMAGE_FIRE);
|
||||
|
||||
public override void SetUpLogicComponents()
|
||||
{
|
||||
AddLogicComponent<CardLogicComponent_Attack>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 选中目标时更新两种伤害的预览数值。
|
||||
/// </summary>
|
||||
public override void TargetingEffect(CharacterBase target)
|
||||
{
|
||||
card.SetAttribute("Display_Damage_Physics", GetTargetedFinalDamage(target, PhysicsCtx));
|
||||
card.SetAttribute("Display_Damage_Fire", GetTargetedFinalDamage(target, FireCtx));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 取消选中目标时,以无目标模式重新计算预览数值。
|
||||
/// </summary>
|
||||
public override void UntargetingEffect()
|
||||
{
|
||||
card.SetAttribute("Display_Damage_Physics", GetNoTargetFinalDamage(PhysicsCtx));
|
||||
card.SetAttribute("Display_Damage_Fire", GetNoTargetFinalDamage(FireCtx));
|
||||
}
|
||||
|
||||
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
||||
{
|
||||
return ForEachTarget(targetList, target => Cmd.Sequential(
|
||||
new Cmd_PlayAnimation(user.characterView, "Attack"),
|
||||
Cmd.Do(() =>
|
||||
{
|
||||
AttackContext physCtx = PhysicsCtx;
|
||||
AttackTarget(target, GetTargetedFinalDamage(target, physCtx), physCtx);
|
||||
|
||||
AttackContext fireCtx = FireCtx;
|
||||
AttackTarget(target, GetTargetedFinalDamage(target, fireCtx), fireCtx);
|
||||
|
||||
int burnStacks = GetAttribute(BUFF_BURN_STACK);
|
||||
CreateCharacterBuff<Burn>(burnStacks).Apply(target, user);
|
||||
})
|
||||
));
|
||||
}
|
||||
|
||||
public override void ApplyAttributeChangesByCard()
|
||||
{
|
||||
LogicComponent<CardLogicComponent_Attack>().SetDamage_Slash(DAMAGE_PHYSICS);
|
||||
LogicComponent<CardLogicComponent_Attack>().SetDamage_Default(DAMAGE_FIRE);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user