架构大更
This commit is contained in:
@@ -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
|
||||
{
|
||||
@@ -15,36 +14,33 @@ namespace Continentis.Mods.Basic.Cards
|
||||
AddLogicComponent<CardLogicComponent_SelectHandCards>().SetCondition(SelectCondition).SetEffect(SelectEffect);
|
||||
}
|
||||
|
||||
public override List<CommandBase> PlayEffect(List<CharacterBase> targetList)
|
||||
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
||||
{
|
||||
CommandGroup mainGroup = TargetListCommandGroup(targetList,
|
||||
CommandGroup mainGroup = ForEachTarget(targetList, target => Cmd.Parallel(
|
||||
new Cmd_PlayAnimation(user.characterView, "Attack"),
|
||||
new Cmd_PlaySFX("SFX_Basic_GeneralMeleeImpact").SetDelay(0.2f),
|
||||
new Cmd_SpawnVFX("VFX_Basic_DefaultAttack").SetDelay(0.2f),
|
||||
new Cmd_ParamFunction<CharacterBase>(target =>
|
||||
{
|
||||
user.Attack(target, GetTargetedFinalDamage(target));
|
||||
})); //对目标造成伤害
|
||||
|
||||
Cmd.Do(() => user.Attack(target, GetTargetedFinalDamage(target)))
|
||||
));
|
||||
|
||||
LogicComponent<CardLogicComponent_SelectHandCards>().AddSelectionCommands(ref mainGroup);
|
||||
|
||||
return new List<CommandBase> { mainGroup };
|
||||
|
||||
return mainGroup;
|
||||
}
|
||||
|
||||
|
||||
public override void ApplyAttributeChangesByCard()
|
||||
{
|
||||
LogicComponent<CardLogicComponent_Attack>().SetDamage_Slash();
|
||||
}
|
||||
|
||||
|
||||
private bool SelectCondition(CardInstance card)
|
||||
{
|
||||
return card.contentSubmodule.cardType is not CardType.Attack;
|
||||
}
|
||||
|
||||
|
||||
private void SelectEffect(CardInstance card)
|
||||
{
|
||||
CommandQueueManager.Instance.AddCommand(user.deckSubmodule.DiscardCard(card, true, 0f), new CommandContext());
|
||||
CommandQueueManager.Instance.AddCommand(user.deckSubmodule.DiscardCard(card, true, 0f));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user