94 lines
3.5 KiB
C#
94 lines
3.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using Continentis.MainGame.Card;
|
|
using SLSUtilities.General;
|
|
using SoftCircuits.Collections;
|
|
using UnityEngine;
|
|
using UnityEngine.Events;
|
|
|
|
namespace Continentis.MainGame.Character
|
|
{
|
|
public partial class IntentionSubmodule : SubmoduleBase<CharacterBase>
|
|
{
|
|
public List<IntentionBase> allIntentions;
|
|
public IntentionBase currentIntention;
|
|
public UnityAction getIntendedCards;
|
|
|
|
public List<IntendedCard> intendedCards;
|
|
|
|
/// <summary>意图卡被移除后触发,参数为被移除的 IntendedCard 和它原来所在的索引。</summary>
|
|
public OrderedDictionary<string, PrioritizedAction<IntendedCard, int>> onIntendedCardRemoved;
|
|
|
|
/// <summary>意图卡被替换后触发,参数为旧 IntendedCard、新 IntendedCard 和所在的索引。</summary>
|
|
public OrderedDictionary<string, PrioritizedAction<IntendedCard, IntendedCard, int>> onIntendedCardReplaced;
|
|
|
|
/// <summary>意图卡被插入后触发,参数为新 IntendedCard 和插入的索引。</summary>
|
|
public OrderedDictionary<string, PrioritizedAction<IntendedCard, int>> onIntendedCardInserted;
|
|
|
|
public IntentionSubmodule(CharacterBase owner) : base(owner)
|
|
{
|
|
allIntentions = new List<IntentionBase>();
|
|
currentIntention = new IntentionBase(this);
|
|
getIntendedCards = owner.GetIntendedCards;
|
|
intendedCards = new List<IntendedCard>();
|
|
|
|
onIntendedCardRemoved = new OrderedDictionary<string, PrioritizedAction<IntendedCard, int>>();
|
|
onIntendedCardReplaced = new OrderedDictionary<string, PrioritizedAction<IntendedCard, IntendedCard, int>>();
|
|
onIntendedCardInserted = new OrderedDictionary<string, PrioritizedAction<IntendedCard, int>>();
|
|
}
|
|
}
|
|
|
|
public class IntendedCard
|
|
{
|
|
public CardInstance cardInstance;
|
|
public List<CharacterBase> targets;
|
|
|
|
public IntendedCard(CardInstance cardInstance, List<CharacterBase> targets)
|
|
{
|
|
this.cardInstance = cardInstance;
|
|
this.targets = targets;
|
|
}
|
|
}
|
|
|
|
public class IntentionBase : IPrioritized
|
|
{
|
|
public IntentionSubmodule intentionSubmodule;
|
|
public CharacterBase character => intentionSubmodule.owner;
|
|
public DeckSubmodule characterDeck => character.deckSubmodule;
|
|
public RecordSubmodule characterRecord => character.recordSubmodule;
|
|
public int Priority { get; protected set; }
|
|
public int guaranteedStamina;
|
|
public int guaranteedMana;
|
|
public int maxCardCount;
|
|
|
|
public IntentionBase(IntentionSubmodule intentionSubmodule)
|
|
{
|
|
this.intentionSubmodule = intentionSubmodule;
|
|
this.Priority = 0;
|
|
this.guaranteedStamina = 0;
|
|
this.guaranteedMana = 0;
|
|
this.maxCardCount = 999;
|
|
}
|
|
|
|
public virtual bool Condition()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public virtual void RefreshCardWeights()
|
|
{
|
|
|
|
}
|
|
|
|
public virtual void RefreshTargets()
|
|
{
|
|
|
|
}
|
|
|
|
/// <summary>NPC 本回合出牌前调用,可用于播放蓄力台词、切换动画状态等。</summary>
|
|
public virtual void PreAction() { }
|
|
|
|
/// <summary>NPC 本回合全部卡牌出完后调用,可用于播放结束台词、重置状态等。</summary>
|
|
public virtual void PostAction() { }
|
|
}
|
|
} |