更新
This commit is contained in:
33
Assets/Mods/Basic/Cards/Scripts/General/Attack/Cleave.cs
Normal file
33
Assets/Mods/Basic/Cards/Scripts/General/Attack/Cleave.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System.Collections.Generic;
|
||||
using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Commands;
|
||||
using SLSFramework.General;
|
||||
|
||||
namespace Continentis.Mods.Basic.Cards
|
||||
{
|
||||
/// <summary>
|
||||
/// 顺劈斩:对全体敌人造成物理斩击伤害,数值受到力量和敏捷增减影响。
|
||||
/// AOE范围由卡牌数据的目标配置决定,Logic层无需额外处理。
|
||||
/// </summary>
|
||||
public class Cleave : CardLogicBase
|
||||
{
|
||||
public override void SetUpLogicComponents()
|
||||
{
|
||||
AddLogicComponent<CardLogicComponent_Attack>();
|
||||
}
|
||||
|
||||
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
||||
{
|
||||
return Cmd.Sequential(
|
||||
new Cmd_PlayAnimation(user.characterView, "Attack"),
|
||||
ForEachTarget(targetList, target => Cmd.Do(() => AttackTarget(target, GetTargetedFinalDamage(target))))
|
||||
);
|
||||
}
|
||||
|
||||
public override void ApplyAttributeChangesByCard()
|
||||
{
|
||||
LogicComponent<CardLogicComponent_Attack>().SetDamage_Slash();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 53886cfa8ac7b2f45ab5ca9a15bf4c30
|
||||
84
Assets/Mods/Basic/Cards/Scripts/General/Attack/FireBall.cs
Normal file
84
Assets/Mods/Basic/Cards/Scripts/General/Attack/FireBall.cs
Normal file
@@ -0,0 +1,84 @@
|
||||
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>
|
||||
/// 火球术:对指定目标造成主伤害并附加大量灼烧,对其余所有敌人造成溅射伤害并附加少量灼烧。
|
||||
/// targetList[0] 为主目标,其余为溅射目标(由卡牌数据目标配置决定)。
|
||||
/// </summary>
|
||||
public class FireBall : CardLogicBase
|
||||
{
|
||||
private const string DAMAGE_MAIN = "Damage_Main";
|
||||
private const string DAMAGE_OTHERS = "Damage_Others";
|
||||
private const string BURN_STACK_MAIN = "Buff_Burn_Stack_Main";
|
||||
private const string BURN_STACK_OTHERS = "Buff_Burn_Stack_Others";
|
||||
private const string DISPLAY_DAMAGE_MAIN = "Display_Damage_Main";
|
||||
private const string DISPLAY_DAMAGE_OTHERS = "Display_Damage_Others";
|
||||
|
||||
private AttackContext MainCtx => AttackContext.Default(card)
|
||||
.WithDamageKeywords("Fire")
|
||||
.WithBaseDamageAttribute(DAMAGE_MAIN);
|
||||
|
||||
private AttackContext OthersCtx => AttackContext.Default(card)
|
||||
.WithDamageKeywords("Fire")
|
||||
.WithBaseDamageAttribute(DAMAGE_OTHERS);
|
||||
|
||||
public override void SetUpLogicComponents()
|
||||
{
|
||||
AddLogicComponent<CardLogicComponent_Attack>();
|
||||
}
|
||||
|
||||
/// <summary>选中主目标时,更新主目标与溅射目标的伤害预览。</summary>
|
||||
public override void TargetingEffect(CharacterBase target)
|
||||
{
|
||||
card.SetAttribute(DISPLAY_DAMAGE_MAIN, GetTargetedFinalDamage(target, MainCtx));
|
||||
card.SetAttribute(DISPLAY_DAMAGE_OTHERS, GetNoTargetFinalDamage(OthersCtx));
|
||||
}
|
||||
|
||||
/// <summary>取消选中时,以无目标模式刷新两套伤害预览。</summary>
|
||||
public override void UntargetingEffect()
|
||||
{
|
||||
card.SetAttribute(DISPLAY_DAMAGE_MAIN, GetNoTargetFinalDamage(MainCtx));
|
||||
card.SetAttribute(DISPLAY_DAMAGE_OTHERS, GetNoTargetFinalDamage(OthersCtx));
|
||||
}
|
||||
|
||||
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
||||
{
|
||||
CharacterBase mainTarget = targetList[0];
|
||||
|
||||
return Cmd.Sequential(
|
||||
new Cmd_PlayAnimation(user.characterView, "Attack"),
|
||||
Cmd.Do(() =>
|
||||
{
|
||||
// 主目标:主伤害 + 大量灼烧
|
||||
AttackContext mainCtx = MainCtx;
|
||||
AttackTarget(mainTarget, GetTargetedFinalDamage(mainTarget, mainCtx), mainCtx);
|
||||
CreateCharacterBuff<Burn>(GetAttribute(BURN_STACK_MAIN)).Apply(mainTarget, user, this);
|
||||
|
||||
// 溅射目标:溅射伤害 + 少量灼烧
|
||||
AttackContext othersCtx = OthersCtx;
|
||||
for (int i = 1; i < targetList.Count; i++)
|
||||
{
|
||||
CharacterBase other = targetList[i];
|
||||
AttackTarget(other, GetTargetedFinalDamage(other, othersCtx), othersCtx);
|
||||
CreateCharacterBuff<Burn>(GetAttribute(BURN_STACK_OTHERS)).Apply(other, user, this);
|
||||
}
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
public override void ApplyAttributeChangesByCard()
|
||||
{
|
||||
// 主伤害:奥术加成写入 Damage_Main
|
||||
LogicComponent<CardLogicComponent_Attack>().SetDamage_Arcane(DAMAGE_MAIN);
|
||||
// 溅射伤害:奥术加成写入 Damage_Others(数值由卡牌数据配置)
|
||||
LogicComponent<CardLogicComponent_Attack>().SetDamage_Arcane(DAMAGE_OTHERS);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 69f6031d6d6952b4e90185dbddd38070
|
||||
36
Assets/Mods/Basic/Cards/Scripts/General/Attack/FireBolt.cs
Normal file
36
Assets/Mods/Basic/Cards/Scripts/General/Attack/FireBolt.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
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
|
||||
{
|
||||
public class FireBolt : CardLogicBase
|
||||
{
|
||||
public override void SetUpLogicComponents()
|
||||
{
|
||||
AddLogicComponent<CardLogicComponent_Attack>();
|
||||
}
|
||||
|
||||
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
||||
{
|
||||
return ForEachTarget(targetList, target => Cmd.Parallel(
|
||||
new Cmd_PlayAnimation(user.characterView, "Attack"),
|
||||
Cmd.Do(() =>
|
||||
{
|
||||
AttackContext mainCtx = AttackContext.Default(card).WithDamageKeywords("Fire");
|
||||
AttackTarget(target, GetTargetedFinalDamage(target, mainCtx), mainCtx);
|
||||
CreateCharacterBuff<Burn>(GetAttribute("Buff_Burn_Stack")).Apply(target, user, this);
|
||||
})
|
||||
));
|
||||
}
|
||||
|
||||
public override void ApplyAttributeChangesByCard()
|
||||
{
|
||||
LogicComponent<CardLogicComponent_Attack>().SetDamage_Arcane();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 55e7b0446c18b6b4d93b7fa996668cae
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 15155284a8c7da44f958a40b7eb6846c
|
||||
34
Assets/Mods/Basic/Cards/Scripts/General/Attack/Prick.cs
Normal file
34
Assets/Mods/Basic/Cards/Scripts/General/Attack/Prick.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System.Collections.Generic;
|
||||
using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Commands;
|
||||
using SLSFramework.General;
|
||||
|
||||
namespace Continentis.Mods.Basic.Cards
|
||||
{
|
||||
/// <summary>
|
||||
/// 突刺:造成物理伤害,数值受到敏捷增减影响。
|
||||
/// </summary>
|
||||
public class Prick : CardLogicBase
|
||||
{
|
||||
public override void SetUpLogicComponents()
|
||||
{
|
||||
AddLogicComponent<CardLogicComponent_Attack>();
|
||||
}
|
||||
|
||||
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
||||
{
|
||||
base.PlayEffect(targetList);
|
||||
|
||||
return ForEachTarget(targetList, target => Cmd.Parallel(
|
||||
new Cmd_PlayAnimation(user.characterView, "Attack"),
|
||||
Cmd.After(0.1f, () => AttackTarget(target, GetTargetedFinalDamage(target)))
|
||||
));
|
||||
}
|
||||
|
||||
public override void ApplyAttributeChangesByCard()
|
||||
{
|
||||
LogicComponent<CardLogicComponent_Attack>().SetDamage_Prick();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 88242ad6bd2d2c7408e3c6980672e482
|
||||
61
Assets/Mods/Basic/Cards/Scripts/General/Attack/SandStorm.cs
Normal file
61
Assets/Mods/Basic/Cards/Scripts/General/Attack/SandStorm.cs
Normal file
@@ -0,0 +1,61 @@
|
||||
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。
|
||||
/// AOE 范围由卡牌数据的目标配置决定,动画只播放一次。
|
||||
/// </summary>
|
||||
public class SandStorm : CardLogicBase
|
||||
{
|
||||
private AttackContext EarthCtx => AttackContext.Default(card).WithDamageKeywords("Earth");
|
||||
|
||||
public override void SetUpLogicComponents()
|
||||
{
|
||||
AddLogicComponent<CardLogicComponent_Attack>();
|
||||
}
|
||||
|
||||
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
||||
{
|
||||
int hitCount = GetAttribute("HitCount");
|
||||
|
||||
CommandGroup hitsGroup = Cmd.Sequential();
|
||||
for (int i = 0; i < hitCount; i++)
|
||||
{
|
||||
hitsGroup.AddCommand(Cmd.After(0.5f, () =>
|
||||
{
|
||||
foreach (CharacterBase target in targetList)
|
||||
{
|
||||
AttackTarget(target, GetTargetedFinalDamage(target), EarthCtx);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
int blindCount = GetAttribute("Buff_Blind_Count");
|
||||
CommandGroup debuffGroup = Cmd.Sequential(Cmd.Do(() =>
|
||||
{
|
||||
foreach (CharacterBase target in targetList)
|
||||
{
|
||||
CreateCharacterBuff<Blind>(blindCount).Apply(target, user);
|
||||
}
|
||||
}));
|
||||
|
||||
return Cmd.Sequential(
|
||||
new Cmd_PlayAnimation(user.characterView, "Attack"),
|
||||
hitsGroup,
|
||||
debuffGroup
|
||||
);
|
||||
}
|
||||
|
||||
public override void ApplyAttributeChangesByCard()
|
||||
{
|
||||
LogicComponent<CardLogicComponent_Attack>().SetDamage_Arcane();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7dfda7769fd24c248aaa0e7b015d8610
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 32b57059835baf64b967b999158d863f
|
||||
32
Assets/Mods/Basic/Cards/Scripts/General/Attack/Slash.cs
Normal file
32
Assets/Mods/Basic/Cards/Scripts/General/Attack/Slash.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System.Collections.Generic;
|
||||
using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Commands;
|
||||
using SLSFramework.General;
|
||||
|
||||
namespace Continentis.Mods.Basic.Cards
|
||||
{
|
||||
/// <summary>
|
||||
/// 斩击:造成物理伤害,数值受到力量和敏捷增减影响。
|
||||
/// </summary>
|
||||
public class Slash : CardLogicBase
|
||||
{
|
||||
public override void SetUpLogicComponents()
|
||||
{
|
||||
AddLogicComponent<CardLogicComponent_Attack>();
|
||||
}
|
||||
|
||||
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
||||
{
|
||||
return ForEachTarget(targetList, target => Cmd.Parallel(
|
||||
new Cmd_PlayAnimation(user.characterView, "Attack"),
|
||||
Cmd.Do(() => AttackTarget(target, GetTargetedFinalDamage(target)))
|
||||
));
|
||||
}
|
||||
|
||||
public override void ApplyAttributeChangesByCard()
|
||||
{
|
||||
LogicComponent<CardLogicComponent_Attack>().SetDamage_Slash();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: be6cca88ebf944f40a885d9359cd7d91
|
||||
34
Assets/Mods/Basic/Cards/Scripts/General/Attack/Strike.cs
Normal file
34
Assets/Mods/Basic/Cards/Scripts/General/Attack/Strike.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System.Collections.Generic;
|
||||
using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Commands;
|
||||
using SLSFramework.General;
|
||||
|
||||
namespace Continentis.Mods.Basic.Cards
|
||||
{
|
||||
/// <summary>
|
||||
/// 打击:造成物理伤害,数值受到力量增减影响。
|
||||
/// </summary>
|
||||
public class Strike : CardLogicBase
|
||||
{
|
||||
public override void SetUpLogicComponents()
|
||||
{
|
||||
AddLogicComponent<CardLogicComponent_Attack>();
|
||||
}
|
||||
|
||||
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
||||
{
|
||||
return ForEachTarget(targetList, target => Cmd.Parallel(
|
||||
new Cmd_PlayAnimation(user.characterView, "Attack"),
|
||||
//new Cmd_PlaySFX("SFX_Basic_SwordStrike"),
|
||||
//new Cmd_SpawnVFX("VFX_Basic_RedImpact"),
|
||||
Cmd.Do(() => AttackTarget(target, GetTargetedFinalDamage(target)))
|
||||
));
|
||||
}
|
||||
|
||||
public override void ApplyAttributeChangesByCard()
|
||||
{
|
||||
LogicComponent<CardLogicComponent_Attack>().SetDamage_Strike();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 421bde5f4c6c60a40ad42a7456250b44
|
||||
Reference in New Issue
Block a user