架构大更
This commit is contained in:
@@ -4,27 +4,23 @@ using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Combat;
|
||||
using Continentis.MainGame.Commands;
|
||||
using SLSFramework.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Cards
|
||||
{
|
||||
public class ArmyOfTheDead : CardLogicBase
|
||||
{
|
||||
public override List<CommandBase> PlayEffect(List<CharacterBase> targetList)
|
||||
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
||||
{
|
||||
base.PlayEffect(targetList);
|
||||
|
||||
CommandGroup mainGroup = new CommandGroup(new Cmd_Function(() =>
|
||||
return Cmd.Sequential(Cmd.Do(() =>
|
||||
{
|
||||
CharacterData minion = cardData.GetDerivativeCharacterData(0);
|
||||
|
||||
for (int i = 0; i < GetAttribute("SummonCount"); i++)
|
||||
{
|
||||
CombatMainManager.Instance.characterController.AddCombatNPC((minion, Fraction.Enemy));
|
||||
}
|
||||
}));
|
||||
|
||||
return new List<CommandBase> { mainGroup };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Commands;
|
||||
using SLSFramework.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Cards
|
||||
{
|
||||
@@ -14,18 +13,18 @@ namespace Continentis.Mods.Basic.Cards
|
||||
AddLogicComponent<CardLogicComponent_Attack>();
|
||||
}
|
||||
|
||||
public override List<CommandBase> PlayEffect(List<CharacterBase> targetList)
|
||||
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
||||
{
|
||||
CommandGroup mainGroup = new CommandGroup(new Cmd_PlayAnimation(user.characterView, "Attack"));
|
||||
// 动画先播,随后对所有目标同时发起攻击
|
||||
CommandGroup attackAllTargets = ForEachTarget(
|
||||
targetList,
|
||||
target => Cmd.Sequential(Cmd.Do(() => user.Attack(target, GetTargetedFinalDamage(target)))),
|
||||
ExecutionMode.Parallel);
|
||||
|
||||
mainGroup.AddCommand(TargetListCommandGroup(targetList,
|
||||
ExecutionMode.Parallel, ExecutionMode.Sequential,
|
||||
new Cmd_ParamFunction<CharacterBase>(target =>
|
||||
{
|
||||
user.Attack(target, GetTargetedFinalDamage(target));
|
||||
})));
|
||||
|
||||
return new List<CommandBase> { mainGroup };
|
||||
return Cmd.Sequential(
|
||||
new Cmd_PlayAnimation(user.characterView, "Attack"),
|
||||
attackAllTargets
|
||||
);
|
||||
}
|
||||
|
||||
public override void ApplyAttributeChangesByCard()
|
||||
|
||||
@@ -4,7 +4,6 @@ using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Commands;
|
||||
using Continentis.Mods.Basic.Buffs;
|
||||
using SLSFramework.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Cards
|
||||
{
|
||||
@@ -15,16 +14,15 @@ namespace Continentis.Mods.Basic.Cards
|
||||
AddLogicComponent<CardLogicComponent_Attack>();
|
||||
}
|
||||
|
||||
public override List<CommandBase> PlayEffect(List<CharacterBase> targetList)
|
||||
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
||||
{
|
||||
CommandGroup mainGroup = TargetListCommandGroup(targetList,
|
||||
new Cmd_ParamFunction<CharacterBase>(0.2f, target =>
|
||||
return ForEachTarget(targetList, target =>
|
||||
Cmd.After(0.2f, () =>
|
||||
{
|
||||
user.Attack(target, GetTargetedFinalDamage(target));
|
||||
CreateCharacterBuff<Burn>(GetAttribute("BuffStack_Burn")).Apply(target, user, this);
|
||||
}));
|
||||
|
||||
return new List<CommandBase> { mainGroup };
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
public override void ApplyAttributeChangesByCard()
|
||||
|
||||
@@ -4,26 +4,22 @@ using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Commands;
|
||||
using Continentis.Mods.Basic.Buffs;
|
||||
using SLSFramework.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Cards
|
||||
{
|
||||
public class NecromanticInfusion : CardLogicBase
|
||||
{
|
||||
public override List<CommandBase> PlayEffect(List<CharacterBase> targetList)
|
||||
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
||||
{
|
||||
CommandGroup main = new CommandGroup(new Cmd_Function(() =>
|
||||
{
|
||||
CreateCharacterBuff<Prowess>(2).Apply(user, user, this);
|
||||
}));
|
||||
|
||||
CommandGroup weak = TargetListCommandGroup(targetList,
|
||||
new Cmd_ParamFunction<CharacterBase>(0.2f, target =>
|
||||
{
|
||||
CreateCharacterBuff<Weak>(2).Apply(target, user, this);
|
||||
}));
|
||||
CommandGroup applyProwess = Cmd.Sequential(
|
||||
Cmd.Do(() => CreateCharacterBuff<Prowess>(2).Apply(user, user, this))
|
||||
);
|
||||
|
||||
return new List<CommandBase> { main, weak };
|
||||
CommandGroup applyWeak = ForEachTarget(targetList, target =>
|
||||
Cmd.After(0.2f, () => CreateCharacterBuff<Weak>(2).Apply(target, user, this))
|
||||
);
|
||||
|
||||
return Cmd.Sequential(applyProwess, applyWeak);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,8 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
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
|
||||
{
|
||||
@@ -16,22 +13,28 @@ namespace Continentis.Mods.Basic.Cards
|
||||
AddLogicComponent<CardLogicComponent_Attack>();
|
||||
}
|
||||
|
||||
public override List<CommandBase> PlayEffect(List<CharacterBase> targetList)
|
||||
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
||||
{
|
||||
List<CommandBase> templates = new List<CommandBase>();
|
||||
templates.Add(new Cmd_PlayAnimation(user.characterView, "Attack"));
|
||||
for (int i = 0; i < GetAttribute("AttackCount"); i++)
|
||||
{
|
||||
templates.Add(new Cmd_ParamFunction<CharacterBase>(0.4f, target =>
|
||||
int attackCount = GetAttribute("AttackCount");
|
||||
|
||||
// 对每个目标并行执行多段攻击序列
|
||||
return ForEachTarget(
|
||||
targetList,
|
||||
target =>
|
||||
{
|
||||
user.Attack(target, GetTargetedFinalDamage(target));
|
||||
}));
|
||||
}
|
||||
CommandGroup mainGroup = TargetListCommandGroup(targetList, ExecutionMode.Parallel, ExecutionMode.Sequential, templates.ToArray());
|
||||
|
||||
return new List<CommandBase> { mainGroup };
|
||||
CommandGroup perTargetGroup = Cmd.Sequential(
|
||||
new Cmd_PlayAnimation(user.characterView, "Attack"));
|
||||
for (int i = 0; i < attackCount; i++)
|
||||
{
|
||||
perTargetGroup.AddCommand(Cmd.After(0.4f, () =>
|
||||
user.Attack(target, GetTargetedFinalDamage(target))
|
||||
));
|
||||
}
|
||||
return perTargetGroup;
|
||||
},
|
||||
ExecutionMode.Parallel);
|
||||
}
|
||||
|
||||
|
||||
public override void ApplyAttributeChangesByCard()
|
||||
{
|
||||
LogicComponent<CardLogicComponent_Attack>().SetDamage_Sorcery();
|
||||
|
||||
Reference in New Issue
Block a user