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

@@ -8,22 +8,22 @@ namespace Continentis.MainGame.Character
{
public partial class CombatBuffSubmodule : SubmoduleBase<CharacterBase>
{
public List<CombatBuffBase> buffList;
public List<CharacterCombatBuffBase> buffList;
public CombatBuffSubmodule(CharacterBase character) : base(character)
{
buffList = new List<CombatBuffBase>();
buffList = new List<CharacterCombatBuffBase>();
}
}
public partial class CombatBuffSubmodule
{
public T GetBuff<T>() where T : CombatBuffBase
public T GetBuff<T>() where T : CharacterCombatBuffBase
{
return (T)buffList.Find(x => x.GetType() == typeof(T));
}
public bool HasBuff<T>() where T : CombatBuffBase
public bool HasBuff<T>() where T : CharacterCombatBuffBase
{
return buffList.Exists(x => x.GetType() == typeof(T));
}

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)

View File

@@ -10,6 +10,7 @@ namespace Continentis.MainGame.Character
Silence = 1, //沉默,无法使用魔法牌 (Magic)
Disarm = 2, //缴械,无法使用攻击牌 (Attack)
Inhibition = 3, //抑制,无法使用能力牌 (Ability)
Heavy = 4, //沉重,无法再抽牌
//正面状态
Invincible = 1000, //无敌