This commit is contained in:
SoulliesOfficial
2025-12-13 23:28:23 -05:00
parent 40660b41e0
commit 467e385991
49 changed files with 238 additions and 161 deletions

View File

@@ -57,7 +57,15 @@ namespace Continentis.MainGame.Character
{
protected bool FindExistingSameBuff<T>(out T existingBuff) where T : CharacterBuffBase
{
return FindExistingSameBuff(out existingBuff, attachedCharacter.combatBuffSubmodule.buffList);
bool result = FindExistingSameBuffs(out List<T> existingBuffs, attachedCharacter.combatBuffSubmodule.buffList);
existingBuff = result ? existingBuffs[0] : null;
return result;
}
protected bool FindExistingSameBuffs<T>(out List<T> existingBuffs) where T : CharacterBuffBase
{
bool result = FindExistingSameBuffs(out existingBuffs, attachedCharacter.combatBuffSubmodule.buffList);
return result;
}
public override void Apply(CharacterBase attachedCharacter, CharacterBase sourceCharacter = null)

View File

@@ -313,26 +313,6 @@ namespace Continentis.MainGame.Character
public virtual void GetIntendedCards()
{
bool CanAfford(CardInstance card, int stamina, int mana)
{
return card.GetAttribute("StaminaCost") <= stamina &&
card.GetAttribute("ManaCost") <= mana;
}
bool CheckAvailabilityAndSetTargets(CardInstance card, out List<CharacterBase> targets)
{
card.DetectTargetsValidity(out List<CharacterBase> valid, out _, out _);
if (valid.Count == 0)
{
targets = null;
return false; // 无有效目标或无法使用则跳过
}
targets = card.SetRandomTargets(valid);
return true;
}
IntentionBase currentIntention = intentionSubmodule.currentIntention;
List<CardInstance> availableCards = deckSubmodule.PoolPile;
List<IntendedCard> intended = new List<IntendedCard>();
@@ -425,5 +405,25 @@ namespace Continentis.MainGame.Character
intentionSubmodule.intendedCards.AddRange(intended);
}
bool CanAfford(CardInstance card, int stamina, int mana)
{
return card.GetAttribute("StaminaCost") <= stamina &&
card.GetAttribute("ManaCost") <= mana;
}
public bool CheckAvailabilityAndSetTargets(CardInstance card, out List<CharacterBase> targets)
{
card.DetectTargetsValidity(out List<CharacterBase> valid, out _, out _);
if (valid.Count == 0)
{
targets = null;
return false; // 无有效目标或无法使用则跳过
}
targets = card.SetRandomTargets(valid);
return true;
}
}
}

View File

@@ -73,9 +73,15 @@ namespace Continentis.MainGame.Character
public void ActionStart()
{
Debug.Log($"{owner.data.displayName} is starting an action. Current action count this round: {owner.actionCountThisRound}");
if (owner.actionCountThisRound == 0)
{
buffList.For(buff => buff.roundFirstActionCountSubmodule?.Update());
Debug.Log($"{owner.data.displayName} is starting their first action this round. Buff count of {buffList.Count} will update their round first action counts.");
buffList.For(buff =>
{
Debug.Log($"Updating round first action count for buff: {buff.contentSubmodule.displayName}");
buff.roundFirstActionCountSubmodule?.Update();
});
}
buffList.For(buff => buff.actionCountSubmodule?.Update());