除了充盈都做完了
This commit is contained in:
@@ -48,20 +48,20 @@ namespace Continentis.MainGame
|
||||
protected bool FindExistingSameBuff<T1, T2>(out T2 existingBuff, List<T1> buffList) where T1 : BuffBase<T> where T2 : BuffBase<T>
|
||||
{
|
||||
existingBuff = null;
|
||||
Debug.Log($"Searching for existing buff of type: {this.GetType()} in buff list of count: {buffList.Count}");
|
||||
//Debug.Log($"Searching for existing buff of type: {this.GetType()} in buff list of count: {buffList.Count}");
|
||||
foreach (T1 buff in buffList)
|
||||
{
|
||||
Debug.Log($"existing buff type: {buff.GetType().AssemblyQualifiedName}, this buff type: {this.GetType().AssemblyQualifiedName}");
|
||||
//Debug.Log($"existing buff type: {buff.GetType().AssemblyQualifiedName}, this buff type: {this.GetType().AssemblyQualifiedName}");
|
||||
if (buff.GetType() == this.GetType())
|
||||
{
|
||||
Debug.Log("Found existing buff of the same type.");
|
||||
//Debug.Log("Found existing buff of the same type.");
|
||||
existingBuff = buff as T2;
|
||||
Debug.Log(existingBuff == null);
|
||||
//Debug.Log(existingBuff == null);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("Buff types do not match.");
|
||||
//Debug.Log("Buff types do not match.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -117,44 +117,44 @@ namespace Continentis.MainGame
|
||||
|
||||
public class EventSubmodule : BuffSubmodule
|
||||
{
|
||||
public OrderedDictionary<string, EventUnit> onCombatStart; //战斗开始时
|
||||
public OrderedDictionary<string, EventUnit> onCombatEnd; //战斗结束时
|
||||
public OrderedDictionary<string, PrioritizedAction> onCombatStart; //战斗开始时
|
||||
public OrderedDictionary<string, PrioritizedAction> onCombatEnd; //战斗结束时
|
||||
|
||||
public OrderedDictionary<string, EventUnit> onRoundStart; //每回合开始时
|
||||
public OrderedDictionary<string, EventUnit> onRoundEnd; //每回合结束时
|
||||
public OrderedDictionary<string, PrioritizedAction> onRoundStart; //每回合开始时
|
||||
public OrderedDictionary<string, PrioritizedAction> onRoundEnd; //每回合结束时
|
||||
|
||||
public OrderedDictionary<string, EventUnit> onActionStart; //每次行动开始时
|
||||
public OrderedDictionary<string, EventUnit> onActionEnd; //每次行动结束时
|
||||
public OrderedDictionary<string, PrioritizedAction> onActionStart; //每次行动开始时
|
||||
public OrderedDictionary<string, PrioritizedAction> onActionEnd; //每次行动结束时
|
||||
|
||||
public OrderedDictionary<string, EventUnit<CharacterBase, IntendedCard, CharacterBase>> onOpponentDecideAction; //对手AI决定行动时,参数为对手,和原定的目标角色
|
||||
public OrderedDictionary<string, PrioritizedAction<CharacterBase, IntendedCard, CharacterBase>> onOpponentDecideAction; //对手AI决定行动时,参数为对手,和原定的目标角色
|
||||
|
||||
public OrderedDictionary<string, EventUnit<AttackResult>> onGetAttacked; //被攻击后,参数为伤害结果
|
||||
public OrderedDictionary<string, PrioritizedAction<AttackResult>> onGetAttacked; //被攻击后,参数为伤害结果
|
||||
|
||||
public OrderedDictionary<string, EventUnit<CardInstance>> onDrawCard; //抽到卡牌时
|
||||
public OrderedDictionary<string, EventUnit<CardInstance, List<CharacterBase>>> onBeforePlayCard; //使用卡牌前,参数为目标列表
|
||||
public OrderedDictionary<string, EventUnit<CardInstance, List<CharacterBase>>> onAfterPlayCard; //使用卡牌后,参数为目标列表
|
||||
public OrderedDictionary<string, EventUnit<CardInstance>> onDiscardCard; //卡牌被弃牌时
|
||||
public OrderedDictionary<string, EventUnit<CardInstance>> onExhaustCard; //卡牌被消耗时
|
||||
public OrderedDictionary<string, PrioritizedAction<CardInstance>> onDrawCard; //抽到卡牌时
|
||||
public OrderedDictionary<string, PrioritizedAction<CardInstance, List<CharacterBase>>> onBeforePlayCard; //使用卡牌前,参数为目标列表
|
||||
public OrderedDictionary<string, PrioritizedAction<CardInstance, List<CharacterBase>>> onAfterPlayCard; //使用卡牌后,参数为目标列表
|
||||
public OrderedDictionary<string, PrioritizedAction<CardInstance>> onDiscardCard; //卡牌被弃牌时
|
||||
public OrderedDictionary<string, PrioritizedAction<CardInstance>> onExhaustCard; //卡牌被消耗时
|
||||
|
||||
public EventSubmodule(BuffBase<T> buff) : base(buff)
|
||||
{
|
||||
onCombatStart = new OrderedDictionary<string, EventUnit>();
|
||||
onCombatEnd = new OrderedDictionary<string, EventUnit>();
|
||||
onCombatStart = new OrderedDictionary<string, PrioritizedAction>();
|
||||
onCombatEnd = new OrderedDictionary<string, PrioritizedAction>();
|
||||
|
||||
onRoundStart = new OrderedDictionary<string, EventUnit>();
|
||||
onRoundEnd = new OrderedDictionary<string, EventUnit>();
|
||||
onRoundStart = new OrderedDictionary<string, PrioritizedAction>();
|
||||
onRoundEnd = new OrderedDictionary<string, PrioritizedAction>();
|
||||
|
||||
onActionStart = new OrderedDictionary<string, EventUnit>();
|
||||
onActionEnd = new OrderedDictionary<string, EventUnit>();
|
||||
onActionStart = new OrderedDictionary<string, PrioritizedAction>();
|
||||
onActionEnd = new OrderedDictionary<string, PrioritizedAction>();
|
||||
|
||||
onGetAttacked = new OrderedDictionary<string, EventUnit<AttackResult>>();
|
||||
onOpponentDecideAction = new OrderedDictionary<string, EventUnit<CharacterBase, IntendedCard, CharacterBase>>();
|
||||
onGetAttacked = new OrderedDictionary<string, PrioritizedAction<AttackResult>>();
|
||||
onOpponentDecideAction = new OrderedDictionary<string, PrioritizedAction<CharacterBase, IntendedCard, CharacterBase>>();
|
||||
|
||||
onDrawCard = new OrderedDictionary<string, EventUnit<CardInstance>>();
|
||||
onBeforePlayCard = new OrderedDictionary<string, EventUnit<CardInstance, List<CharacterBase>>>();
|
||||
onAfterPlayCard = new OrderedDictionary<string, EventUnit<CardInstance, List<CharacterBase>>>();
|
||||
onDiscardCard = new OrderedDictionary<string, EventUnit<CardInstance>>();
|
||||
onExhaustCard = new OrderedDictionary<string, EventUnit<CardInstance>>();
|
||||
onDrawCard = new OrderedDictionary<string, PrioritizedAction<CardInstance>>();
|
||||
onBeforePlayCard = new OrderedDictionary<string, PrioritizedAction<CardInstance, List<CharacterBase>>>();
|
||||
onAfterPlayCard = new OrderedDictionary<string, PrioritizedAction<CardInstance, List<CharacterBase>>>();
|
||||
onDiscardCard = new OrderedDictionary<string, PrioritizedAction<CardInstance>>();
|
||||
onExhaustCard = new OrderedDictionary<string, PrioritizedAction<CardInstance>>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,6 +252,19 @@ namespace Continentis.MainGame
|
||||
remainingCount = Mathf.Min(remainingCount, maximumCount);
|
||||
onCountChanged?.Invoke(remainingCount);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 选择更高的持续时间和剩余时间。
|
||||
/// </summary>
|
||||
public void PickHigherCount(CountSubmodule other)
|
||||
{
|
||||
if (isInfinite)
|
||||
{
|
||||
return;
|
||||
}
|
||||
maximumCount = Mathf.Max(maximumCount, other.maximumCount);
|
||||
remainingCount = Mathf.Max(remainingCount, other.remainingCount);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -289,9 +302,9 @@ namespace Continentis.MainGame
|
||||
stackUpperLimit = keepMaximal ? Mathf.Max(stackUpperLimit, upperLimit) : upperLimit;
|
||||
}
|
||||
|
||||
public void PickHigherStack(int newAmount)
|
||||
public void PickHigherStack(UnitedStackSubmodule other)
|
||||
{
|
||||
stackAmount = Mathf.Max(stackAmount, newAmount);
|
||||
stackAmount = Mathf.Max(stackAmount, other.stackAmount);
|
||||
if (stackUpperLimit > 0)
|
||||
{
|
||||
stackAmount = Mathf.Min(stackAmount, stackUpperLimit);
|
||||
@@ -339,6 +352,11 @@ namespace Continentis.MainGame
|
||||
IntegerRange.OnBecomeZero();
|
||||
}
|
||||
}
|
||||
|
||||
if(buff is CharacterBuffBase characterBuff)
|
||||
{
|
||||
characterBuff.iconSubmodule?.Update();
|
||||
}
|
||||
}
|
||||
|
||||
public void ClearAllStacks()
|
||||
|
||||
Reference in New Issue
Block a user