更新
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using SLSFramework.General;
|
||||
using SLSUtilities.General;
|
||||
using System.Collections.Generic;
|
||||
using static UnityEngine.GraphicsBuffer;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Character;
|
||||
using SLSFramework.General;
|
||||
using SLSUtilities.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Character;
|
||||
using SLSFramework.General;
|
||||
using SLSUtilities.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using SLSFramework.General;
|
||||
using SLSUtilities.General;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Character;
|
||||
using SLSFramework.General;
|
||||
using SLSUtilities.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using SLSFramework.General;
|
||||
using SLSUtilities.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
|
||||
@@ -5,12 +5,7 @@ namespace Continentis.Mods.Basic.Buffs
|
||||
{
|
||||
public sealed class Blind : CharacterCombatBuffBase
|
||||
{
|
||||
public Blind(int initialCount) : this(initialCount, 25)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Blind(int initialCount, int stack)
|
||||
public Blind(int initialCount, int stack = 25)
|
||||
{
|
||||
Initialize(BuffType.Negative, BuffDispelLevel.Basic);
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using SLSFramework.General;
|
||||
using SLSUtilities.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
|
||||
@@ -6,19 +6,19 @@ namespace Continentis.Mods.Basic.Buffs
|
||||
{
|
||||
public class Consolidate : CharacterCombatBuffBase
|
||||
{
|
||||
public Consolidate(int roundCount)
|
||||
public Consolidate(int count)
|
||||
{
|
||||
Initialize(BuffType.Positive, BuffDispelLevel.Strong);
|
||||
|
||||
this.contentSubmodule = new ContentSubmodule(this)
|
||||
.AddParameterGetter("Count", () => roundCountSubmodule.remainingCount.ToString());
|
||||
.AddParameterGetter("Count", () => roundFirstActionCountSubmodule.remainingCount.ToString());
|
||||
|
||||
this.iconSubmodule = new IconSubmodule(this);
|
||||
|
||||
this.roundCountSubmodule = new CountSubmodule(this, roundCount);
|
||||
this.roundFirstActionCountSubmodule = new CountSubmodule(this, count);
|
||||
|
||||
this.generalAttributeSubmodule = new GeneralAttributeSubmodule(this);
|
||||
this.generalAttributeSubmodule.numericChange.Add("KeepBlockOnActionStart", 1);
|
||||
this.generalAttributeSubmodule.numericChange.Add("KeepBlockOnRoundFirstActionStart", 1);
|
||||
}
|
||||
|
||||
public override bool OnBuffApply(out CharacterCombatBuffBase existingBuff)
|
||||
@@ -27,7 +27,7 @@ namespace Continentis.Mods.Basic.Buffs
|
||||
|
||||
if (FindExistingSameBuff(out existingBuff))
|
||||
{
|
||||
existingBuff.roundCountSubmodule.AddCount(this.roundCountSubmodule.remainingCount);
|
||||
existingBuff.roundFirstActionCountSubmodule.AddCount(this.roundFirstActionCountSubmodule.remainingCount);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Character;
|
||||
using SLSFramework.General;
|
||||
using SLSUtilities.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Character;
|
||||
using SLSFramework.General;
|
||||
using SLSUtilities.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Character;
|
||||
using SLSUtilities.General;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
{
|
||||
/// <summary>
|
||||
/// 地缚(Earth 元素):行动开始时固定减少 1 点体力(不随层数变化),然后层数 -1。
|
||||
/// 层数决定持续时间(多少回合会减少体力),不决定每次削减量。
|
||||
/// </summary>
|
||||
public sealed class Earthbind : CharacterCombatBuffBase
|
||||
{
|
||||
public Earthbind(int stack)
|
||||
{
|
||||
Initialize(BuffType.Negative, BuffDispelLevel.Basic);
|
||||
|
||||
this.contentSubmodule = new ContentSubmodule(this)
|
||||
.AddParameterGetter("Stack", () => unitedStackSubmodule.stackAmount.ToString());
|
||||
|
||||
this.iconSubmodule = new IconSubmodule(this);
|
||||
|
||||
this.unitedStackSubmodule = new UnitedStackSubmodule(this, stack);
|
||||
|
||||
this.eventSubmodule = new EventSubmodule(this);
|
||||
this.eventSubmodule.onActionStart.Add("Earthbind", new PrioritizedAction(OnActionStart));
|
||||
}
|
||||
|
||||
private void OnActionStart()
|
||||
{
|
||||
// 固定减少 1 体力,Clamp 至 0
|
||||
attachedCharacter.ModifyAndClampAttribute(CharacterAttributes.Stamina, -1);
|
||||
|
||||
unitedStackSubmodule.ReduceStack(1);
|
||||
iconSubmodule.Update();
|
||||
}
|
||||
|
||||
public override bool OnBuffApply(out CharacterCombatBuffBase existingBuff)
|
||||
{
|
||||
MainGameManager.Instance.basePrefabs.GenerateInfoText(
|
||||
contentSubmodule.displayName, attachedCharacter.characterView);
|
||||
|
||||
if (FindExistingSameBuff(out existingBuff))
|
||||
{
|
||||
existingBuff.unitedStackSubmodule.AddStack(this.unitedStackSubmodule.stackAmount);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 39fe894c949baba47933441e57340092
|
||||
53
Assets/Mods/Basic/Characters/CombatBuffs/General/Erosion.cs
Normal file
53
Assets/Mods/Basic/Characters/CombatBuffs/General/Erosion.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Character;
|
||||
using SLSUtilities.General;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
{
|
||||
/// <summary>
|
||||
/// 风蚀(Wind 元素):行动开始时移除目标 [层数×2] 点格挡,然后层数 -1。
|
||||
/// 定位:反格挡,与 Firm(格挡积累)形成元素克制。
|
||||
/// </summary>
|
||||
public sealed class Erosion : CharacterCombatBuffBase
|
||||
{
|
||||
public Erosion(int stack)
|
||||
{
|
||||
Initialize(BuffType.Negative, BuffDispelLevel.Basic);
|
||||
|
||||
this.contentSubmodule = new ContentSubmodule(this)
|
||||
.AddParameterGetter("Stack", () => unitedStackSubmodule.stackAmount.ToString())
|
||||
.AddParameterGetter("BlockRemoval", () => (unitedStackSubmodule.stackAmount * 2).ToString());
|
||||
|
||||
this.iconSubmodule = new IconSubmodule(this);
|
||||
|
||||
this.unitedStackSubmodule = new UnitedStackSubmodule(this, stack);
|
||||
|
||||
this.eventSubmodule = new EventSubmodule(this);
|
||||
this.eventSubmodule.onActionStart.Add("Erosion", new PrioritizedAction(OnActionStart));
|
||||
}
|
||||
|
||||
private void OnActionStart()
|
||||
{
|
||||
int blockRemoval = unitedStackSubmodule.stackAmount * 2;
|
||||
// 负值减少格挡,Clamp 至 0
|
||||
attachedCharacter.ModifyAndClampAttribute(CharacterAttributes.Block, -blockRemoval);
|
||||
|
||||
unitedStackSubmodule.ReduceStack(1);
|
||||
iconSubmodule.Update();
|
||||
}
|
||||
|
||||
public override bool OnBuffApply(out CharacterCombatBuffBase existingBuff)
|
||||
{
|
||||
MainGameManager.Instance.basePrefabs.GenerateInfoText(
|
||||
contentSubmodule.displayName, attachedCharacter.characterView);
|
||||
|
||||
if (FindExistingSameBuff(out existingBuff))
|
||||
{
|
||||
existingBuff.unitedStackSubmodule.AddStack(this.unitedStackSubmodule.stackAmount);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7593d9fa99d9ecc409a6b29156cb4229
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Character;
|
||||
using SLSFramework.General;
|
||||
using SLSUtilities.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
|
||||
57
Assets/Mods/Basic/Characters/CombatBuffs/General/Hex.cs
Normal file
57
Assets/Mods/Basic/Characters/CombatBuffs/General/Hex.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Character;
|
||||
using SLSUtilities.General;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
{
|
||||
/// <summary>
|
||||
/// 蛊咒(Darkness 元素):被动削减承载者的治疗效果 33%(固定值,不随层数变化)。
|
||||
/// 每回合结束时层数 -1,层数归零后自动移除,治疗倍率同时恢复正常。
|
||||
/// 层数仅决定持续时间,不影响削减幅度。
|
||||
/// </summary>
|
||||
public sealed class Hex : CharacterCombatBuffBase
|
||||
{
|
||||
private const float HEALING_REDUCTION = -0.33f;
|
||||
|
||||
public Hex(int stack)
|
||||
{
|
||||
Initialize(BuffType.Negative, BuffDispelLevel.Basic);
|
||||
|
||||
this.contentSubmodule = new ContentSubmodule(this)
|
||||
.AddParameterGetter("Stack", () => unitedStackSubmodule.stackAmount.ToString());
|
||||
|
||||
this.iconSubmodule = new IconSubmodule(this);
|
||||
|
||||
this.unitedStackSubmodule = new UnitedStackSubmodule(this, stack);
|
||||
|
||||
// 被动属性:治疗效果 -33%(通过 generalAttributeSubmodule 叠入角色属性系统)
|
||||
this.generalAttributeSubmodule = new GeneralAttributeSubmodule(this);
|
||||
this.generalAttributeSubmodule.numericChange[CharacterAttributes.HealingGainMultiplier]
|
||||
= HEALING_REDUCTION;
|
||||
|
||||
this.eventSubmodule = new EventSubmodule(this);
|
||||
this.eventSubmodule.onRoundEnd.Add("Hex_Decay", new PrioritizedAction(OnRoundEnd));
|
||||
}
|
||||
|
||||
private void OnRoundEnd()
|
||||
{
|
||||
unitedStackSubmodule.ReduceStack(1);
|
||||
iconSubmodule.Update();
|
||||
}
|
||||
|
||||
public override bool OnBuffApply(out CharacterCombatBuffBase existingBuff)
|
||||
{
|
||||
MainGameManager.Instance.basePrefabs.GenerateInfoText(
|
||||
contentSubmodule.displayName, attachedCharacter.characterView);
|
||||
|
||||
// 若已存在:叠加持续时间(治疗削减量不变,仍为固定 33%)
|
||||
if (FindExistingSameBuff(out existingBuff))
|
||||
{
|
||||
existingBuff.unitedStackSubmodule.AddStack(this.unitedStackSubmodule.stackAmount);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3879bdbc9c2c3834d8bd5ff07399a5b7
|
||||
@@ -1,7 +1,7 @@
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using SLSFramework.General;
|
||||
using SLSUtilities.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Character;
|
||||
using SLSUtilities.General;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
{
|
||||
/// <summary>
|
||||
/// 下次行动魔力增减:在下次行动开始时根据层数增减魔力,之后移除。
|
||||
/// </summary>
|
||||
public class NextActionManaModification : CharacterCombatBuffBase, IBuffExtension_IntegerRange
|
||||
{
|
||||
public NextActionManaModification(int stack)
|
||||
{
|
||||
Initialize(BuffType.Positive, BuffDispelLevel.Strong);
|
||||
|
||||
this.contentSubmodule = new ContentSubmodule(this)
|
||||
.AddParameterGetter("Stack", () => unitedStackSubmodule.stackAmount.ToString());
|
||||
|
||||
this.iconSubmodule = new IconSubmodule(this).SetTextFunctions("Stack");
|
||||
this.unitedStackSubmodule = new UnitedStackSubmodule(this, true, -1, stack, true);
|
||||
|
||||
this.eventSubmodule = new EventSubmodule(this);
|
||||
this.eventSubmodule.onActionStart.Add("ManaModification", new PrioritizedAction(OnActionStart));
|
||||
|
||||
(this as IBuffExtension_IntegerRange).Initialize(stack);
|
||||
}
|
||||
|
||||
private void OnActionStart()
|
||||
{
|
||||
int modification = unitedStackSubmodule.stackAmount;
|
||||
attachedCharacter.ModifyMana(modification);
|
||||
|
||||
Remove();
|
||||
}
|
||||
|
||||
public override bool OnBuffApply(out CharacterCombatBuffBase existingBuff)
|
||||
{
|
||||
MainGameManager.Instance.basePrefabs.GenerateInfoText(
|
||||
contentSubmodule.displayName, attachedCharacter.characterView);
|
||||
|
||||
// 若已存在则叠加层数(魔力削减量叠加)
|
||||
if (FindExistingSameBuff(out existingBuff))
|
||||
{
|
||||
existingBuff.unitedStackSubmodule.AddStack(this.unitedStackSubmodule.stackAmount);
|
||||
return false;
|
||||
}
|
||||
|
||||
existingBuff = null;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ba3a3c576933a9143a00a392fb8d0aa3
|
||||
@@ -0,0 +1,50 @@
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Character;
|
||||
using SLSUtilities.General;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
{
|
||||
/// <summary>
|
||||
/// 下次行动体力增减:在下次行动开始时根据层数增减体力,之后移除。
|
||||
/// </summary>
|
||||
public class NextActionStaminaModification : CharacterCombatBuffBase, IBuffExtension_IntegerRange
|
||||
{
|
||||
public NextActionStaminaModification(int stack)
|
||||
{
|
||||
Initialize(BuffType.Positive, BuffDispelLevel.Strong);
|
||||
|
||||
this.contentSubmodule = new ContentSubmodule(this)
|
||||
.AddParameterGetter("Stack", () => unitedStackSubmodule.stackAmount.ToString());
|
||||
|
||||
this.iconSubmodule = new IconSubmodule(this).SetTextFunctions("Stack");
|
||||
this.unitedStackSubmodule = new UnitedStackSubmodule(this, true, -1, stack, true);
|
||||
|
||||
this.eventSubmodule = new EventSubmodule(this);
|
||||
this.eventSubmodule.onActionStart.Add("StaminaModification", new PrioritizedAction(OnActionStart));
|
||||
|
||||
(this as IBuffExtension_IntegerRange).Initialize(stack);
|
||||
}
|
||||
|
||||
private void OnActionStart()
|
||||
{
|
||||
int modification = unitedStackSubmodule.stackAmount;
|
||||
attachedCharacter.ModifyStamina(modification);
|
||||
|
||||
Remove();
|
||||
}
|
||||
|
||||
public override bool OnBuffApply(out CharacterCombatBuffBase existingBuff)
|
||||
{
|
||||
MainGameManager.Instance.basePrefabs.GenerateInfoText(contentSubmodule.displayName, attachedCharacter.characterView);
|
||||
|
||||
// 若已存在则叠加层数(体力削减量叠加)
|
||||
if (FindExistingSameBuff(out existingBuff))
|
||||
{
|
||||
existingBuff.unitedStackSubmodule.AddStack(this.unitedStackSubmodule.stackAmount);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9b1a883a407f5d1498e799441770c4bb
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Character;
|
||||
using SLSFramework.General;
|
||||
using SLSUtilities.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Combat;
|
||||
using SLSFramework.General;
|
||||
using SLSUtilities.General;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Combat;
|
||||
using SLSFramework.General;
|
||||
using SLSUtilities.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Character;
|
||||
using SLSFramework.General;
|
||||
using SLSUtilities.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
|
||||
71
Assets/Mods/Basic/Characters/CombatBuffs/General/Provoked.cs
Normal file
71
Assets/Mods/Basic/Characters/CombatBuffs/General/Provoked.cs
Normal file
@@ -0,0 +1,71 @@
|
||||
using System.Collections.Generic;
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Character;
|
||||
using SLSUtilities.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
{
|
||||
/// <summary>
|
||||
/// 被挑衅:标记该角色正在被一个或多个角色挑衅。
|
||||
/// 具有 Provoked 状态,目标选择系统会检测该状态并限制该角色只能攻击挑衅者。
|
||||
/// </summary>
|
||||
public class Provoked : CharacterCombatBuffBase
|
||||
{
|
||||
public List<Provoking> provokingSources;
|
||||
|
||||
public Provoked()
|
||||
{
|
||||
Initialize(BuffType.Negative, BuffDispelLevel.DeathOnly, 100);
|
||||
|
||||
this.provokingSources = new List<Provoking>();
|
||||
|
||||
this.statusSubmodule = new StatusSubmodule(this, StatusType.Provoked);
|
||||
|
||||
this.contentSubmodule = new ContentSubmodule(this)
|
||||
.AddParameterGetter("Provoker", GetProvokerNames);
|
||||
|
||||
this.iconSubmodule = new IconSubmodule(this).SetTextFunctions();
|
||||
}
|
||||
|
||||
/// <summary>获取所有挑衅者角色(去重)。</summary>
|
||||
public List<CharacterBase> GetProvokers()
|
||||
{
|
||||
List<CharacterBase> provokers = new List<CharacterBase>();
|
||||
foreach (Provoking provoking in provokingSources)
|
||||
{
|
||||
if (!provokers.Contains(provoking.attachedCharacter))
|
||||
{
|
||||
provokers.Add(provoking.attachedCharacter);
|
||||
}
|
||||
}
|
||||
|
||||
return provokers;
|
||||
}
|
||||
|
||||
public override bool OnBuffApply(out CharacterCombatBuffBase existingBuff)
|
||||
{
|
||||
MainGameManager.Instance.basePrefabs.GenerateInfoText(
|
||||
contentSubmodule.displayName, attachedCharacter.characterView);
|
||||
|
||||
if (FindExistingSameBuff(out existingBuff))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
existingBuff = null;
|
||||
return true;
|
||||
}
|
||||
|
||||
private string GetProvokerNames()
|
||||
{
|
||||
List<string> names = new List<string>();
|
||||
foreach (Provoking provoker in provokingSources)
|
||||
{
|
||||
names.Add(provoker.attachedCharacter.data.displayName);
|
||||
}
|
||||
|
||||
return names.Count == 1 ? names[0] : string.Join(", ", names);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: af51ff0fb258d774394b86b89ed68037
|
||||
@@ -0,0 +1,94 @@
|
||||
using System.Collections.Generic;
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Character;
|
||||
using SLSUtilities.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
{
|
||||
/// <summary>
|
||||
/// 挑衅:标记该角色正在挑衅某个敌方目标。
|
||||
/// 关系追踪器,不直接影响目标选择——过滤逻辑通过被挑衅者身上的 Provoked 状态实现。
|
||||
/// 持续行动次数由 roundFirstActionCountSubmodule 决定。
|
||||
/// </summary>
|
||||
public class Provoking : CharacterCombatBuffBase
|
||||
{
|
||||
public CharacterBase target;
|
||||
public Provoked provokedBuff;
|
||||
|
||||
public Provoking(CharacterBase target, int actionCount, Provoked provokedBuff)
|
||||
{
|
||||
Initialize(BuffType.Neutral, BuffDispelLevel.DeathOnly, 100);
|
||||
this.target = target;
|
||||
this.provokedBuff = provokedBuff;
|
||||
|
||||
if (this.provokedBuff == null)
|
||||
{
|
||||
Debug.LogError("Provoking buff requires a Provoked buff on the target.");
|
||||
}
|
||||
|
||||
this.contentSubmodule = new ContentSubmodule(this)
|
||||
.AddParameterGetter("Count", () => roundFirstActionCountSubmodule.remainingCount.ToString())
|
||||
.AddParameterGetter("Target", () => target.data.displayName);
|
||||
|
||||
this.iconSubmodule = new IconSubmodule(this).SetTextFunctions("Count");
|
||||
|
||||
this.roundFirstActionCountSubmodule = new CountSubmodule(this, actionCount);
|
||||
}
|
||||
|
||||
public override bool OnBuffApply(out CharacterCombatBuffBase existingBuff)
|
||||
{
|
||||
MainGameManager.Instance.basePrefabs.GenerateInfoText(
|
||||
contentSubmodule.displayName, attachedCharacter.characterView);
|
||||
|
||||
// 如果已存在对同一目标的挑衅,累加持续时间
|
||||
if (FindExistingSameBuffs(out List<Provoking> existingProvokings))
|
||||
{
|
||||
var sameProvoking = existingProvokings.Find(ep => ep.target == this.target);
|
||||
if (sameProvoking != null)
|
||||
{
|
||||
existingBuff = sameProvoking;
|
||||
sameProvoking.roundFirstActionCountSubmodule.AddCount(
|
||||
this.roundFirstActionCountSubmodule.remainingCount);
|
||||
return false;
|
||||
}
|
||||
|
||||
existingBuff = null;
|
||||
return true; // 对不同目标的挑衅可以共存
|
||||
}
|
||||
|
||||
existingBuff = null;
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void OnAfterFirstApply()
|
||||
{
|
||||
base.OnAfterFirstApply();
|
||||
provokedBuff.provokingSources.Add(this);
|
||||
|
||||
// 同步到 StatusSubmodule,使核心框架可读取挑衅者列表
|
||||
if (!provokedBuff.attachedCharacter.statusSubmodule.provokers.Contains(attachedCharacter))
|
||||
{
|
||||
provokedBuff.attachedCharacter.statusSubmodule.provokers.Add(attachedCharacter);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnBuffRemove()
|
||||
{
|
||||
base.OnBuffRemove();
|
||||
provokedBuff.provokingSources.Remove(this);
|
||||
|
||||
// 检查是否还有其他 Provoking 指向同一挑衅者
|
||||
bool hasOtherFromSameProvoker = provokedBuff.provokingSources.Exists(p => p.attachedCharacter == attachedCharacter);
|
||||
if (!hasOtherFromSameProvoker)
|
||||
{
|
||||
provokedBuff.attachedCharacter.statusSubmodule.provokers.Remove(attachedCharacter);
|
||||
}
|
||||
|
||||
if (provokedBuff.provokingSources.Count == 0)
|
||||
{
|
||||
provokedBuff.Remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 569845d666d02514ea65cd4e892f49af
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Character;
|
||||
using SLSFramework.General;
|
||||
using SLSUtilities.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Character;
|
||||
using SLSFramework.General;
|
||||
using SLSUtilities.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
|
||||
74
Assets/Mods/Basic/Characters/CombatBuffs/General/Shocked.cs
Normal file
74
Assets/Mods/Basic/Characters/CombatBuffs/General/Shocked.cs
Normal file
@@ -0,0 +1,74 @@
|
||||
using System.Collections.Generic;
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Combat;
|
||||
using SLSUtilities.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
{
|
||||
/// <summary>
|
||||
/// 感电(Storm 元素):承载者每次被攻击时,
|
||||
/// 对随机 1 个其他敌方目标造成等同于层数的雷电伤害,然后层数 -1。
|
||||
/// 对单敌战斗退化(无其他目标时无效)。
|
||||
/// 过滤 Reactive/HpRemoval/Reflected 防递归。
|
||||
/// </summary>
|
||||
public sealed class Shocked : CharacterCombatBuffBase
|
||||
{
|
||||
public Shocked(int stack)
|
||||
{
|
||||
Initialize(BuffType.Negative, BuffDispelLevel.Basic);
|
||||
|
||||
this.contentSubmodule = new ContentSubmodule(this)
|
||||
.AddParameterGetter("Stack", () => unitedStackSubmodule.stackAmount.ToString());
|
||||
|
||||
this.iconSubmodule = new IconSubmodule(this);
|
||||
|
||||
this.unitedStackSubmodule = new UnitedStackSubmodule(this, stack);
|
||||
|
||||
this.eventSubmodule = new EventSubmodule(this);
|
||||
this.eventSubmodule.onGetAttacked.Add("Shocked", new PrioritizedAction<AttackResult>(OnGetAttacked));
|
||||
}
|
||||
|
||||
private void OnGetAttacked(AttackResult result)
|
||||
{
|
||||
// 响应式 / 生命移除 / 反弹伤害不触发感电
|
||||
if (result.context.HasAnyTag(AttackTags.Reactive, AttackTags.HpRemoval, AttackTags.Reflected))
|
||||
return;
|
||||
|
||||
// 收集除自身以外的其他同阵营敌方角色
|
||||
List<CharacterBase> others = CombatMainManager.Instance.characterController
|
||||
.GetAllEnemies(attachedCharacter);
|
||||
others.Remove(attachedCharacter);
|
||||
|
||||
if (others.Count == 0) return;
|
||||
|
||||
CharacterBase spreadTarget = others[Random.Range(0, others.Count)];
|
||||
int damage = unitedStackSubmodule.stackAmount;
|
||||
|
||||
var ctx = new AttackContext()
|
||||
.WithTag(AttackTags.Reactive)
|
||||
.WithTag(AttackTags.GuaranteedHit)
|
||||
.WithDamageKeywords("Storm");
|
||||
|
||||
sourceCharacter.Attack(spreadTarget, damage, ctx);
|
||||
|
||||
unitedStackSubmodule.ReduceStack(1);
|
||||
iconSubmodule.Update();
|
||||
}
|
||||
|
||||
public override bool OnBuffApply(out CharacterCombatBuffBase existingBuff)
|
||||
{
|
||||
MainGameManager.Instance.basePrefabs.GenerateInfoText(
|
||||
contentSubmodule.displayName, attachedCharacter.characterView);
|
||||
|
||||
if (FindExistingSameBuff(out existingBuff))
|
||||
{
|
||||
existingBuff.unitedStackSubmodule.AddStack(this.unitedStackSubmodule.stackAmount);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7bb772fdd218ba24c883a73256e051ea
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Character;
|
||||
using SLSFramework.General;
|
||||
using SLSUtilities.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
|
||||
@@ -7,16 +7,16 @@ namespace Continentis.Mods.Basic.Buffs
|
||||
{
|
||||
public sealed class Vulnerable : CharacterCombatBuffBase
|
||||
{
|
||||
public Vulnerable(int duration)
|
||||
public Vulnerable(int count)
|
||||
{
|
||||
Initialize(BuffType.Negative, BuffDispelLevel.Basic);
|
||||
|
||||
this.contentSubmodule = new ContentSubmodule(this)
|
||||
.AddParameterGetter("Count", () => actionCountSubmodule.remainingCount.ToString());
|
||||
.AddParameterGetter("Count", () => roundFirstActionCountSubmodule.remainingCount.ToString());
|
||||
|
||||
this.iconSubmodule = new IconSubmodule(this);
|
||||
|
||||
this.actionCountSubmodule = new CountSubmodule(this, duration);
|
||||
this.roundFirstActionCountSubmodule = new CountSubmodule(this, count);
|
||||
|
||||
this.generalAttributeSubmodule = new GeneralAttributeSubmodule(this);
|
||||
generalAttributeSubmodule.numericChange.Add("PhysicsDamageGainMultiplier", 0.5f);
|
||||
@@ -28,7 +28,7 @@ namespace Continentis.Mods.Basic.Buffs
|
||||
|
||||
if (FindExistingSameBuff(out existingBuff))
|
||||
{
|
||||
existingBuff.actionCountSubmodule.AddCount(this.actionCountSubmodule.remainingCount);
|
||||
existingBuff.roundFirstActionCountSubmodule.AddCount(this.roundFirstActionCountSubmodule.remainingCount);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,16 +6,16 @@ namespace Continentis.Mods.Basic.Buffs
|
||||
{
|
||||
public sealed class Weak : CharacterCombatBuffBase
|
||||
{
|
||||
public Weak(int duration)
|
||||
public Weak(int count)
|
||||
{
|
||||
Initialize(BuffType.Negative, BuffDispelLevel.Basic);
|
||||
|
||||
this.contentSubmodule = new ContentSubmodule(this)
|
||||
.AddParameterGetter("Count", () => actionCountSubmodule.remainingCount.ToString());
|
||||
.AddParameterGetter("Count", () => roundFirstActionCountSubmodule.remainingCount.ToString());
|
||||
|
||||
this.iconSubmodule = new IconSubmodule(this);
|
||||
|
||||
this.actionCountSubmodule = new CountSubmodule(this, duration);
|
||||
this.roundFirstActionCountSubmodule = new CountSubmodule(this, count);
|
||||
|
||||
this.generalAttributeSubmodule = new GeneralAttributeSubmodule(this);
|
||||
generalAttributeSubmodule.numericChange.Add("PhysicsDamageDealtMultiplier", -0.25f);
|
||||
@@ -27,7 +27,7 @@ namespace Continentis.Mods.Basic.Buffs
|
||||
|
||||
if (FindExistingSameBuff(out existingBuff))
|
||||
{
|
||||
existingBuff.actionCountSubmodule.AddCount(this.actionCountSubmodule.maximumCount);
|
||||
existingBuff.roundFirstActionCountSubmodule.AddCount(this.roundFirstActionCountSubmodule.maximumCount);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Character;
|
||||
using SLSFramework.General;
|
||||
using SLSUtilities.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Character;
|
||||
using SLSFramework.General;
|
||||
using SLSUtilities.General;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
{
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Character;
|
||||
using SLSUtilities.General;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
{
|
||||
/// <summary>
|
||||
/// 筑城(Fortification)Buff:
|
||||
/// 每回合首次行动开始时,获得等同于 Firm Buff Stack层数 * Fortification Buff Stack层数的格挡。
|
||||
/// 前后施加层数会合并叠加。
|
||||
/// </summary>
|
||||
public class Fortification : CharacterCombatBuffBase
|
||||
{
|
||||
public Fortification(int stack)
|
||||
{
|
||||
Initialize(BuffType.Positive, BuffDispelLevel.Strong);
|
||||
|
||||
this.contentSubmodule = new ContentSubmodule(this)
|
||||
.AddParameterGetter("Stack", () => unitedStackSubmodule.stackAmount.ToString());
|
||||
|
||||
this.iconSubmodule = new IconSubmodule(this);
|
||||
|
||||
// 无限持续时间 (-1),支持层数叠加
|
||||
this.unitedStackSubmodule = new UnitedStackSubmodule(this, true, -1, stack, false);
|
||||
|
||||
this.eventSubmodule = new EventSubmodule(this);
|
||||
this.eventSubmodule.onActionStart.InsertByPriority("Fortification_Block", new PrioritizedAction(() =>
|
||||
{
|
||||
if (attachedCharacter.actionCountThisRound == 0) // 每个回合首次行动开始时
|
||||
{
|
||||
if (attachedCharacter.combatBuffSubmodule.TryGetBuff<Firm>(out var firmBuff))
|
||||
{
|
||||
int firmStack = firmBuff.unitedStackSubmodule.stackAmount;
|
||||
if (firmStack > 0)
|
||||
{
|
||||
int blockGain = firmStack * this.unitedStackSubmodule.stackAmount;
|
||||
attachedCharacter.AddBlock(blockGain);
|
||||
}
|
||||
}
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
public override bool OnBuffApply(out CharacterCombatBuffBase existingBuff)
|
||||
{
|
||||
MainGameManager.Instance.basePrefabs.GenerateInfoText("Fortification", attachedCharacter.characterView);
|
||||
|
||||
if (FindExistingSameBuff(out existingBuff))
|
||||
{
|
||||
// 新的层数直接叠加到原有的Buff上
|
||||
existingBuff.unitedStackSubmodule.AddStack(this.unitedStackSubmodule.stackAmount);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 76c520de73e71d646a7f0315f5f1055f
|
||||
@@ -1,7 +1,7 @@
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Combat;
|
||||
using SLSFramework.General;
|
||||
using SLSUtilities.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Character;
|
||||
using SLSUtilities.General;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
{
|
||||
/// <summary>
|
||||
/// 圣盾(骑士):免疫下一次受到的伤害(不论伤害量)。
|
||||
/// 每次免疫消耗 1 层;响应式攻击和生命移除不触发免疫。
|
||||
/// </summary>
|
||||
public class HolyShield : CharacterCombatBuffBase
|
||||
{
|
||||
public HolyShield(int stack)
|
||||
{
|
||||
Initialize(BuffType.Positive, BuffDispelLevel.Strong);
|
||||
|
||||
this.contentSubmodule = new ContentSubmodule(this)
|
||||
.AddParameterGetter("Stack", () => unitedStackSubmodule.stackAmount.ToString());
|
||||
|
||||
this.iconSubmodule = new IconSubmodule(this).SetTextFunctions("Stack");
|
||||
|
||||
this.unitedStackSubmodule = new UnitedStackSubmodule(this, stack);
|
||||
|
||||
this.eventSubmodule = new EventSubmodule(this);
|
||||
this.eventSubmodule.onBeforeReceiveDamage.Add("HolyShield",
|
||||
new PrioritizedAction<IncomingDamageModifier>(OnBeforeReceiveDamage));
|
||||
}
|
||||
|
||||
private void OnBeforeReceiveDamage(IncomingDamageModifier modifier)
|
||||
{
|
||||
if (modifier.context.HasAnyTag(AttackTags.Reactive, AttackTags.HpRemoval)) return;
|
||||
if (unitedStackSubmodule.stackAmount <= 0) return;
|
||||
|
||||
modifier.isCancelled = true;
|
||||
MainGameManager.Instance.basePrefabs.GenerateInfoText(
|
||||
contentSubmodule.displayName, attachedCharacter.characterView);
|
||||
|
||||
unitedStackSubmodule.ReduceStack(1);
|
||||
iconSubmodule.Update();
|
||||
}
|
||||
|
||||
public override bool OnBuffApply(out CharacterCombatBuffBase existingBuff)
|
||||
{
|
||||
MainGameManager.Instance.basePrefabs.GenerateInfoText(
|
||||
contentSubmodule.displayName, attachedCharacter.characterView);
|
||||
|
||||
if (FindExistingSameBuff(out existingBuff))
|
||||
{
|
||||
existingBuff.unitedStackSubmodule.AddStack(this.unitedStackSubmodule.stackAmount);
|
||||
return false;
|
||||
}
|
||||
|
||||
existingBuff = null;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 63c25c7a416c9654dac77a6f840ffc15
|
||||
77
Assets/Mods/Basic/Characters/CombatBuffs/Knight/Vengeance.cs
Normal file
77
Assets/Mods/Basic/Characters/CombatBuffs/Knight/Vengeance.cs
Normal file
@@ -0,0 +1,77 @@
|
||||
using System.Collections.Generic;
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using SLSUtilities.General;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
{
|
||||
/// <summary>
|
||||
/// 复仇(骑士):必须先持有此 Buff,之后每次被攻击叠加 1 层。
|
||||
/// 使用攻击类卡牌时,消耗所有层数对所有目标各造成等量的额外物理伤害。
|
||||
/// </summary>
|
||||
public class Vengeance : CharacterCombatBuffBase
|
||||
{
|
||||
public Vengeance()
|
||||
{
|
||||
Initialize(BuffType.Positive, BuffDispelLevel.Strong);
|
||||
|
||||
this.contentSubmodule = new ContentSubmodule(this)
|
||||
.AddParameterGetter("Stack", () => unitedStackSubmodule.stackAmount.ToString());
|
||||
|
||||
this.iconSubmodule = new IconSubmodule(this).SetTextFunctions("Stack");
|
||||
|
||||
// 初始 0 层;层数完全由事件驱动累积
|
||||
this.unitedStackSubmodule = new UnitedStackSubmodule(this, 0);
|
||||
|
||||
this.eventSubmodule = new EventSubmodule(this);
|
||||
|
||||
// 被攻击时叠层(过滤响应式和生命移除,防止递归)
|
||||
this.eventSubmodule.onGetAttacked.Add("Vengeance_Stack", new PrioritizedAction<AttackResult>(result =>
|
||||
{
|
||||
if (result.context.HasAnyTag(AttackTags.Reactive, AttackTags.HpRemoval)) return;
|
||||
unitedStackSubmodule.AddStack(1);
|
||||
iconSubmodule.Update();
|
||||
}));
|
||||
|
||||
// 打出攻击类卡牌时消耗所有层数造成额外伤害
|
||||
this.eventSubmodule.onAfterPlayCard.Add("Vengeance_Consume",
|
||||
new PrioritizedAction<CardInstance, List<CharacterBase>>(OnAfterPlayCard));
|
||||
}
|
||||
|
||||
private void OnAfterPlayCard(CardInstance playedCard, List<CharacterBase> targets)
|
||||
{
|
||||
if (!playedCard.HasKeyword("Attack")) return;
|
||||
if (unitedStackSubmodule.stackAmount <= 0) return;
|
||||
|
||||
int bonus = unitedStackSubmodule.stackAmount;
|
||||
unitedStackSubmodule.ModifyStack(-bonus);
|
||||
iconSubmodule.Update();
|
||||
|
||||
var ctx = new AttackContext()
|
||||
.WithTag(AttackTags.Reactive)
|
||||
.WithTag(AttackTags.GuaranteedHit)
|
||||
.WithDamageKeywords("Physics");
|
||||
|
||||
foreach (CharacterBase target in targets)
|
||||
{
|
||||
EnqueueReaction(Cmd.Do(() => attachedCharacter.Attack(target, bonus, ctx)));
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnBuffApply(out CharacterCombatBuffBase existingBuff)
|
||||
{
|
||||
MainGameManager.Instance.basePrefabs.GenerateInfoText(
|
||||
contentSubmodule.displayName, attachedCharacter.characterView);
|
||||
|
||||
// 若已存在则保留现有实例(不重置层数,不二次叠加)
|
||||
if (FindExistingSameBuff(out existingBuff))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
existingBuff = null;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 93f911942e31e5f4b82ee210884abbd0
|
||||
@@ -0,0 +1,77 @@
|
||||
using System.Collections.Generic;
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using SLSUtilities.General;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
{
|
||||
/// <summary>
|
||||
/// 魔力外溢/奥术充能(法师):必须先持有此 Buff,之后每次打出带 Magic 关键词的卡牌自动叠 1 层。
|
||||
/// 层数可被特定卡牌消耗以触发爆发效果;本 Buff 不自动消耗。
|
||||
/// </summary>
|
||||
public class ArcaneCharge : CharacterCombatBuffBase
|
||||
{
|
||||
public ArcaneCharge()
|
||||
{
|
||||
Initialize(BuffType.Positive, BuffDispelLevel.Strong);
|
||||
|
||||
this.contentSubmodule = new ContentSubmodule(this)
|
||||
.AddParameterGetter("Stack", () => unitedStackSubmodule.stackAmount.ToString());
|
||||
|
||||
this.iconSubmodule = new IconSubmodule(this).SetTextFunctions("Stack");
|
||||
|
||||
// 初始 0 层;层数完全由事件驱动累积
|
||||
this.unitedStackSubmodule = new UnitedStackSubmodule(this, 0);
|
||||
|
||||
this.eventSubmodule = new EventSubmodule(this);
|
||||
|
||||
// 打出 Magic 关键词卡牌后叠 1 层
|
||||
this.eventSubmodule.onAfterPlayCard.Add("ArcaneCharge_Stack",
|
||||
new PrioritizedAction<CardInstance, List<CharacterBase>>(OnAfterPlayCard));
|
||||
}
|
||||
|
||||
private void OnAfterPlayCard(CardInstance playedCard, List<CharacterBase> targets)
|
||||
{
|
||||
if (!playedCard.HasKeyword("Magic")) return;
|
||||
unitedStackSubmodule.AddStack(1);
|
||||
iconSubmodule.Update();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 消耗指定数量的层数。供卡牌逻辑调用。
|
||||
/// 返回实际消耗的层数(受当前层数上限约束)。
|
||||
/// </summary>
|
||||
public int ConsumeStacks(int amount)
|
||||
{
|
||||
int actual = System.Math.Min(amount, unitedStackSubmodule.stackAmount);
|
||||
unitedStackSubmodule.ReduceStack(actual);
|
||||
iconSubmodule.Update();
|
||||
return actual;
|
||||
}
|
||||
|
||||
/// <summary>消耗全部层数并返回消耗量。</summary>
|
||||
public int ConsumeAllStacks()
|
||||
{
|
||||
int amount = unitedStackSubmodule.stackAmount;
|
||||
unitedStackSubmodule.ModifyStack(-amount);
|
||||
iconSubmodule.Update();
|
||||
return amount;
|
||||
}
|
||||
|
||||
public override bool OnBuffApply(out CharacterCombatBuffBase existingBuff)
|
||||
{
|
||||
MainGameManager.Instance.basePrefabs.GenerateInfoText(
|
||||
contentSubmodule.displayName, attachedCharacter.characterView);
|
||||
|
||||
// 若已存在则保留现有实例(不重置层数,不二次叠加)
|
||||
if (FindExistingSameBuff(out existingBuff))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
existingBuff = null;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c4be173f4f6cee14b8402d792bfd141b
|
||||
@@ -3,7 +3,7 @@ using Continentis.MainGame;
|
||||
using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Combat;
|
||||
using SLSFramework.General;
|
||||
using SLSUtilities.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
|
||||
@@ -2,8 +2,8 @@ using Continentis.MainGame;
|
||||
using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Combat;
|
||||
using SLSFramework.General;
|
||||
using SLSFramework.UModAssistance;
|
||||
using SLSUtilities.General;
|
||||
using SLSUtilities.UModAssistance;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Collections.Generic;
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using SLSFramework.General;
|
||||
using SLSUtilities.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Buffs
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user