Card爆改!

This commit is contained in:
SoulliesOfficial
2025-11-15 12:17:34 -05:00
parent 85bbe2431c
commit 5fe665d0ce
121 changed files with 838 additions and 783 deletions

View File

@@ -80,7 +80,7 @@ namespace Continentis.MainGame.Combat
foreach (CardInstance card in characterController.characters.SelectMany(character => character.deckSubmodule.GetAllCards()))
{
card.cardLogic.eventSubmodule.onCombatStart.Invoke();
card.eventSubmodule.onCombatStart.Invoke();
}
NextRound();
@@ -104,7 +104,7 @@ namespace Continentis.MainGame.Combat
if (character is CombatNPC npc)
{
npc.IntentionBrain();
npc.deckSubmodule.PoolPile.ForEach(card => card.cardLogic.weightSubmodule.RefreshCurrentWeight());
npc.deckSubmodule.PoolPile.ForEach(card => card.weightSubmodule.RefreshCurrentWeight());
npc.intentionSubmodule.getIntendedCards.Invoke();
foreach (IntendedCard intendedCard in npc.intentionSubmodule.intendedCards)
@@ -112,9 +112,9 @@ namespace Continentis.MainGame.Combat
intendedCard.cardInstance.GenerateIntentionCardView();
if (intendedCard.targets.Count > 0)
{
var cardLogic = intendedCard.cardInstance.cardLogic;
cardLogic.eventSubmodule.onTargeting(intendedCard.targets[0]);
cardLogic.contentSubmodule.dirtyMark = true;
CardInstance card = intendedCard.cardInstance;
card.eventSubmodule.onTargeting(intendedCard.targets[0]);
card.contentSubmodule.dirtyMark = true;
//TODO: 现在仅对第一个目标显示指向,后续可以对多目标进行优化
}
}
@@ -190,7 +190,7 @@ namespace Continentis.MainGame.Combat
foreach (IntendedCard intendedCard in currentCharacter.intentionSubmodule.intendedCards)
{
CommandQueueManager.Instance.AddCommand(new Cmd_Function(0.25f, () => intendedCard.cardInstance.DestroyIntentionCardView()));
intendedCard.cardInstance.cardLogic.Play(intendedCard.targets, currentCharacter, false);
intendedCard.cardInstance.Play(intendedCard.targets, currentCharacter, false);
}
CommandQueueManager.Instance.AddCommand(new Cmd_Function(0f, EndAction));
}
@@ -208,7 +208,7 @@ namespace Continentis.MainGame.Combat
CommandQueueManager.Instance.AddCommand(new Cmd_Function(currentCharacter.eventSubmodule.onActionEnd.Invoke));
foreach (var card in currentCharacter.deckSubmodule.GetAllCards())
{
CommandQueueManager.Instance.AddCommand(new Cmd_Function(card.cardLogic.eventSubmodule.onActionEnd.Invoke));
CommandQueueManager.Instance.AddCommand(new Cmd_Function(card.eventSubmodule.onActionEnd.Invoke));
}
CommandQueueManager.Instance.AddCommand(new Cmd_Function(() =>
@@ -220,8 +220,8 @@ namespace Continentis.MainGame.Combat
Debug.Log(currentCharacter.data.className + " 结束行动,整理手牌。");
List<CardInstance> handPile = new List<CardInstance>(playerHero.deckSubmodule.HandPile);
List<CardInstance> cardToRetain = handPile.Where(card => card.cardLogic.HasKeyword("Retain")).ToList(); //含有“保留”关键词的卡牌
List<CardInstance> cardToExhaust = handPile.Where(card => card.cardLogic.HasKeyword("Ethereal")).ToList(); //含有“虚无”关键词的卡牌
List<CardInstance> cardToRetain = handPile.Where(card => card.HasKeyword("Retain")).ToList(); //含有“保留”关键词的卡牌
List<CardInstance> cardToExhaust = handPile.Where(card => card.HasKeyword("Ethereal")).ToList(); //含有“虚无”关键词的卡牌
List<CardInstance> cardsToDiscard = handPile.Except(cardToRetain).Except(cardToExhaust).ToList(); //其他卡牌,默认丢弃
CommandQueueManager.Instance.AddCommand(playerHero.deckSubmodule.ExhaustCards(cardToExhaust));
CommandQueueManager.Instance.AddCommand(playerHero.deckSubmodule.DiscardCards(cardsToDiscard, false));