This commit is contained in:
SoulliesOfficial
2025-10-24 09:11:22 -04:00
parent 61a397dd4c
commit 76157e3cb1
329 changed files with 8609 additions and 4549 deletions

View File

@@ -41,8 +41,17 @@ namespace Continentis.MainGame.Character
ExhaustPile.ForEach(c=>c.GenerateHandCardView(CombatUIManager.Instance.combatMainPage.exhaustPile));
}
public void DrawCards(int cardCount, float interval)
/// <summary>
/// 抽取指定数量的卡牌,返回一个包含抽牌指令的指令组。
/// </summary>
public CommandGroup DrawCards(int cardCount, float interval = 0.1f)
{
if (owner.statusSubmodule.HasStatus(StatusType.Heavy)) //沉重状态无法抽牌
{
MainGameManager.GenerateInfoText("Heavy: Can not draw cards", owner.characterView);
return new CommandGroup(ExecutionMode.Sequential);
}
if (cardCount > DrawPile.Count && DiscardPile.Count > 0)
{
Debug.Log("抽牌堆牌数不足,且弃牌堆有牌,正在洗牌...");
@@ -52,12 +61,23 @@ namespace Continentis.MainGame.Character
Debug.Log($"准备抽取 {cardCount} 张卡牌。");
CommandContext context = new CommandContext();
CommandQueueManager.Instance.AddCommand(new Cmd_DrawCards(this, cardCount, interval), context);
CommandQueueManager.Instance.AddCommand(new Cmd_Function(0, () =>
{
//Debug.Log((context.sharedInfo["DrawnCards"] as List<CardInstance>).Count); //TODO: 抽牌后的处理
}));
//return context.sharedInfo["DrawnCards"] as List<CardBase>;
CommandGroup drawCardsGroup = new CommandGroup(ExecutionMode.Sequential, context,
new Cmd_DrawCards(this, cardCount, interval),
new Cmd_Function(0, () =>
{
//Debug.Log((context.sharedInfo["DrawnCards"] as List<CardInstance>).Count); //TODO: 抽牌后的处理
}));
return drawCardsGroup;
}
/// <summary>
/// 从指令组的上下文中获取抽到的卡牌列表。
/// </summary>
public List<CardInstance> GetDrawnCards(CommandGroup drawCardsGroup)
{
CommandContext context = drawCardsGroup.groupContext;
return context.GetInfo<List<CardInstance>>("DrawnCards");
}
public void PlayCard(CardInstance card, List<CharacterBase> targetList)