五张牌!
This commit is contained in:
@@ -72,10 +72,24 @@ namespace Continentis.MainGame
|
||||
current[attributeName] = originalAttribute;
|
||||
}
|
||||
}
|
||||
|
||||
public void ModifyAttribute(string attributeName,
|
||||
|
||||
public void ModifyAttribute(string attributeName,
|
||||
float numericChange, float percentageChangeOfAccumulation, float percentChangeOfMultiplication)
|
||||
{
|
||||
if (!current.ContainsKey(attributeName))
|
||||
{
|
||||
if (attributeName.Contains("Multiplier"))
|
||||
{
|
||||
current[attributeName] = 1f;
|
||||
}
|
||||
else
|
||||
{
|
||||
current[attributeName] = 0f;
|
||||
}
|
||||
|
||||
Debug.Log($"{attributeName} is not found in current attributes, use default value");
|
||||
}
|
||||
|
||||
current[attributeName] += numericChange;
|
||||
current[attributeName] = (1 + percentageChangeOfAccumulation) * current[attributeName];
|
||||
current[attributeName] = percentChangeOfMultiplication * current[attributeName];
|
||||
|
||||
@@ -225,7 +225,7 @@ namespace Continentis.MainGame
|
||||
/// <summary>
|
||||
/// 增加持续时间和剩余时间。
|
||||
/// </summary>
|
||||
public void AddMaxCount(int maxCount)
|
||||
public void AddCount(int maxCount)
|
||||
{
|
||||
if (isInfinite)
|
||||
{
|
||||
|
||||
@@ -258,7 +258,7 @@ namespace Continentis.MainGame.Card
|
||||
/// 注意,此函数依赖ModManager的类型注册功能,请确保在Mod加载时已注册对应Buff类型
|
||||
/// 此函数中的T并不是原型参数,而是获取Mod中注册的类型用的
|
||||
/// </summary>
|
||||
protected T CreateCharacterBuff<T>(params object[] parameters) where T :CharacterCombatBuffBase
|
||||
public T CreateCharacterBuff<T>(params object[] parameters) where T :CharacterCombatBuffBase
|
||||
{
|
||||
string buffTypeID = ModManager.GetTypeID(typeof(T));
|
||||
|
||||
@@ -271,7 +271,7 @@ namespace Continentis.MainGame.Card
|
||||
return ModManager.CreateInstance<T>(buffTypeID, parameters);
|
||||
}
|
||||
|
||||
protected T CreateCharacterBuff<T>(string buffTypeID, params object[] parameters) where T :CharacterCombatBuffBase
|
||||
public T CreateCharacterBuff<T>(string buffTypeID, params object[] parameters) where T :CharacterCombatBuffBase
|
||||
{
|
||||
if (string.IsNullOrEmpty(buffTypeID))
|
||||
{
|
||||
|
||||
@@ -280,6 +280,10 @@ namespace Continentis.MainGame.Card
|
||||
{
|
||||
targetList.AddRange(validTargets);
|
||||
}
|
||||
else if (cardLogic.HasKeyword("TargetSelf") && cardLogic.attributeSubmodule.targetCount == 0)
|
||||
{
|
||||
targetList.Add(cardLogic.user);
|
||||
}
|
||||
|
||||
if (!isInDropZone)
|
||||
{
|
||||
|
||||
@@ -11,8 +11,18 @@ namespace Continentis.MainGame.Character
|
||||
{
|
||||
public CardLogicBase sourceCard;
|
||||
|
||||
/// <summary>
|
||||
/// 行动计数,每次行动开始时计数-1。
|
||||
/// </summary>
|
||||
public CountSubmodule actionCountSubmodule;
|
||||
public CountSubmodule combatRoundTimeSubmodule;
|
||||
/// <summary>
|
||||
/// 回合计数,每回合开始时计数-1。
|
||||
/// </summary>
|
||||
public CountSubmodule roundCountSubmodule;
|
||||
/// <summary>
|
||||
/// 首次行动计数,仅在角色本回合首次行动时计数-1。
|
||||
/// </summary>
|
||||
public CountSubmodule roundFirstActionCountSubmodule;
|
||||
|
||||
public UnitedStackSubmodule unitedStackSubmodule;
|
||||
public IndependentStackSubmodule independentStackSubmodule;
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace Continentis.MainGame.Character
|
||||
{
|
||||
public void RoundStart()
|
||||
{
|
||||
buffList.For(buff => buff.combatRoundTimeSubmodule?.Update());
|
||||
buffList.For(buff => buff.roundCountSubmodule?.Update());
|
||||
buffList.For(buff => buff.eventSubmodule?.onRoundStart?.Invoke());
|
||||
}
|
||||
|
||||
@@ -49,6 +49,11 @@ namespace Continentis.MainGame.Character
|
||||
|
||||
public void ActionStart()
|
||||
{
|
||||
if (owner.actionCountThisRound == 0)
|
||||
{
|
||||
buffList.For(buff => buff.roundFirstActionCountSubmodule?.Update());
|
||||
}
|
||||
|
||||
buffList.For(buff => buff.actionCountSubmodule?.Update());
|
||||
buffList.For(buff => buff.eventSubmodule?.onActionStart?.Invoke());
|
||||
}
|
||||
|
||||
@@ -52,6 +52,19 @@ namespace Continentis.MainGame.Character
|
||||
owner.ModifyAttribute("Mana", owner.GetAttribute("ManaRecoverPerAction"));
|
||||
owner.ClampAttribute("Mana", 0, owner.GetAttribute("MaximumMana"));
|
||||
}, 999));
|
||||
|
||||
onActionStart.InsertByPriority("DefenseReset", new EventUnit(() =>
|
||||
{
|
||||
if (owner.GetAttribute("KeepBlockOnActionStart") <= 0)
|
||||
{
|
||||
owner.SetAttribute("Block", 0);
|
||||
}
|
||||
|
||||
if (owner.GetAttribute("KeepDodgeOnActionStart") <= 0)
|
||||
{
|
||||
owner.SetAttribute("Dodge", 0);
|
||||
}
|
||||
}, 998));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user