卡牌更新

This commit is contained in:
SoulliesOfficial
2026-04-08 04:48:35 -04:00
parent c3b1561375
commit dd2657573a
242 changed files with 1950 additions and 926 deletions

View File

@@ -0,0 +1,20 @@
using System.Collections.Generic;
using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
using Continentis.MainGame.Commands;
using SLSFramework.General;
using UnityEngine;
namespace Continentis.Mods.Basic.Cards
{
public class ActionSurge : CardLogicBase
{
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
{
return Cmd.Sequential(
new Cmd_PlayAnimation(user.characterView, "Skill"),
Cmd.Do(() => user.ModifyStamina(GetAttribute("Stamina_Recover")))
);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 6384a21b043ec0344a37b7ae4c10885e

View File

@@ -0,0 +1,59 @@
using System.Collections.Generic;
using System.Linq;
using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
using Continentis.MainGame.Combat;
using Continentis.MainGame.Commands;
using SLSFramework.General;
using UnityEngine;
namespace Continentis.Mods.Basic.Cards
{
/// <summary>
/// 预判:获得闪避值。
/// 若本回合内没有任何敌人在使用者之前行动,则额外获得 Bonus_Dodge 的闪避值。
/// </summary>
public class Anticipation : CardLogicBase
{
private const string BONUS_DODGE = "Bonus_Dodge";
public override void SetUpLogicComponents()
{
AddLogicComponent<CardLogicComponent_Defense>();
}
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
{
base.PlayEffect(targetList);
int baseDodge = GetAttribute("Dodge");
int finalDodge = IsBeforeAnyEnemy()
? Mathf.RoundToInt(baseDodge + GetAttribute(BONUS_DODGE))
: baseDodge;
return Cmd.Parallel(
new Cmd_PlayAnimation(user.characterView, "Skill"),
Cmd.Do(() => user.AddDodge(finalDodge))
);
}
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Defense>().SetDodge();
}
/// <summary>
/// 判断本回合内是否没有任何敌方角色在使用者之前行动过。
/// </summary>
private bool IsBeforeAnyEnemy()
{
int currentRound = CombatMainManager.Instance.currentRound;
int userActionIndex = user.recordSubmodule.currentAction;
return !CombatMainManager.Instance.characterController.characters
.Any(c => c.fraction == Fraction.Enemy
&& c.recordSubmodule.currentRound == currentRound
&& c.recordSubmodule.currentAction < userActionIndex);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 1ebac59694a161148a829240aa9d8ec2

View File

@@ -0,0 +1,20 @@
using System.Collections.Generic;
using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
using Continentis.MainGame.Commands;
using SLSFramework.General;
using UnityEngine;
namespace Continentis.Mods.Basic.Cards
{
public class ArcaneRecovery : CardLogicBase
{
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
{
return Cmd.Sequential(
new Cmd_PlayAnimation(user.characterView, "Skill"),
Cmd.Do(() => user.ModifyMana(GetAttribute("Mana_Recover")))
);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 5609f31a692c7f847ada725274e17d5d

View File

@@ -11,12 +11,15 @@ using UnityEngine;
namespace Continentis.Mods.Basic.Cards
{
/// <summary>
/// 命令术:对目标执行一次感知检定
/// <para>对敌人:若感知低于{PerceptionThreshold_Remove},随机移除一个意图;若低于{PerceptionThreshold_Change}随机改变一个意图</para>
/// <para>对玩家英雄:若感知检定未通过,将一张"扼制"卡牌放入目标抽牌堆</para>
/// 命令术:根据使用者与目标的等级差产生不同效果
/// <para>对敌人:等级差达到 High 门槛时随机移除一个意图;达到 Low 门槛时随机改变一个意图</para>
/// <para>对玩家英雄:等级差达到 High 门槛时将"扼制"卡牌放入目标抽牌堆;达到 Low 门槛时将"干扰"卡牌放入目标抽牌堆。</para>
/// </summary>
public class Command : CardLogicBase
{
private const string LEVEL_GAP_LOW = "LevelGap_Low";
private const string LEVEL_GAP_HIGH = "LevelGap_High";
private static readonly Color HintGreen = new Color(0.2f, 0.85f, 0.3f);
private static readonly Color HintRed = new Color(0.9f, 0.2f, 0.2f);
@@ -48,7 +51,7 @@ namespace Continentis.Mods.Basic.Cards
}
/// <summary>
/// 检查场上是否存在感知低于阈值的可用目标。
/// 检查场上是否存在等级差达到 Low 门槛的可用目标。
/// 有可用目标时返回绿色,无可用目标时返回红色。
/// </summary>
public override Color? GetHintColor()
@@ -58,36 +61,43 @@ namespace Continentis.Mods.Basic.Cards
card.DetectTargetsValidity(out List<CharacterBase> valid, out _, out _);
if (valid.Count == 0) return HintRed;
int changeThreshold = GetAttribute("Perception_Threshold_High");
int userLevel = user.GetAttribute(CharacterAttributes.Level);
int gapLow = GetAttribute(LEVEL_GAP_LOW);
bool hasEffectiveTarget = valid.Any(t =>
t.GetAttribute(CharacterAttributes.Perception) < changeThreshold);
userLevel - t.GetAttribute(CharacterAttributes.Level) >= gapLow);
return hasEffectiveTarget ? HintGreen : HintRed;
}
/// <summary>对敌方目标:根据感知检定移除或改变意图。</summary>
/// <summary>计算使用者与目标的等级差。</summary>
private int GetLevelGap(CharacterBase target)
{
return user.GetAttribute(CharacterAttributes.Level) - target.GetAttribute(CharacterAttributes.Level);
}
/// <summary>对敌方目标:等级差达到 High 时移除意图,达到 Low 时改变意图。</summary>
private void PlayEffectOnEnemy(CharacterBase target)
{
int removeThreshold = GetAttribute("Perception_Threshold_Low");
int changeThreshold = GetAttribute("Perception_Threshold_High");
int perception = target.GetAttribute(CharacterAttributes.Perception);
int levelGap = GetLevelGap(target);
int gapHigh = GetAttribute(LEVEL_GAP_HIGH);
int gapLow = GetAttribute(LEVEL_GAP_LOW);
if (perception < removeThreshold)
if (levelGap >= gapHigh)
target.intentionSubmodule.RemoveRandomIntendedCard();
else if (perception < changeThreshold)
else if (levelGap >= gapLow)
target.intentionSubmodule.ChangeRandomIntendedCard();
}
/// <summary>对玩家英雄:感知检定未通过时,向目标抽牌堆塞入一张"扼制"卡牌。</summary>
/// <summary>对玩家英雄:等级差达到 High 时塞入扼制,达到 Low 时塞入干扰。</summary>
private void PlayEffectOnPlayer(CharacterBase target)
{
int stifleThreshold = GetAttribute("Perception_Threshold_Low");
int disruptionThreshold = GetAttribute("Perception_Threshold_High");
int perception = target.GetAttribute(CharacterAttributes.Perception);
int levelGap = GetLevelGap(target);
int gapHigh = GetAttribute(LEVEL_GAP_HIGH);
int gapLow = GetAttribute(LEVEL_GAP_LOW);
if (perception < stifleThreshold)
if (levelGap >= gapHigh)
CardInstance.GenerateCardInstance(GetDerivativeCardData(0), target, Piles.Draw);
else if (perception < disruptionThreshold)
else if (levelGap >= gapLow)
CardInstance.GenerateCardInstance(GetDerivativeCardData(1), target, Piles.Draw);
}
}

View File

@@ -0,0 +1,31 @@
using System.Collections.Generic;
using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
using Continentis.MainGame.Commands;
using SLSFramework.General;
namespace Continentis.Mods.Basic.Cards
{
public class Cover : CardLogicBase
{
public override void SetUpLogicComponents()
{
AddLogicComponent<CardLogicComponent_Defense>();
AddLogicComponent<CardLogicComponent_Protect>();
}
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
{
return ForEachTarget(targetList, target => Cmd.Parallel(
new Cmd_PlayAnimation(user.characterView, "Skill"),
Cmd.Do(() => user.AddBlock(GetAttribute("Block"))),
Cmd.Do(() => LogicComponent<CardLogicComponent_Protect>().GenerateProtection(user, target, GetAttribute("Buff_Protecting_Count")))
));
}
public override void ApplyAttributeChangesByCard()
{
LogicComponent<CardLogicComponent_Defense>().SetBlock();
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 0293bb4ed1447d14eb3c8c8d247af139

View File

@@ -0,0 +1,32 @@
using System.Collections.Generic;
using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
using Continentis.MainGame.Commands;
using Continentis.Mods.Basic.Buffs;
using SLSFramework.General;
namespace Continentis.Mods.Basic.Cards
{
/// <summary>
/// 冰封术:对目标施加冻结和虚弱 Buff。
/// </summary>
public class Icebound : CardLogicBase
{
private const string FREEZE_COUNT = "Buff_Freeze_Count";
private const string WEAK_COUNT = "Buff_Weak_Count";
public override void SetUpLogicComponents() { }
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
{
return ForEachTarget(targetList, target => Cmd.Parallel(
new Cmd_PlayAnimation(user.characterView, "Cast"),
Cmd.Do(() =>
{
CreateCharacterBuff<Freeze>(GetAttribute(FREEZE_COUNT)).Apply(target, user, this);
CreateCharacterBuff<Weak>(GetAttribute(WEAK_COUNT)).Apply(target, user, this);
})
));
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: bd886cfe2c8877944b8e749f34849625

View File

@@ -0,0 +1,32 @@
using System.Collections.Generic;
using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
using Continentis.MainGame.Commands;
using SLSFramework.General;
namespace Continentis.Mods.Basic.Cards
{
public class Recollection : CardLogicBase
{
public override void SetUpLogicComponents()
{
var select = AddLogicComponent<CardLogicComponent_SelectCustomCards>();
select.selectEffect = SelectEffect;
}
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
{
CommandGroup mainGroup = Cmd.Sequential(new Cmd_PlayAnimation(user.characterView, "Skill"));
List<CardInstance> discardedCards = user.deckSubmodule.DiscardPile;
LogicComponent<CardLogicComponent_SelectCustomCards>()
.AddSelectionCommands(ref mainGroup, discardedCards,
"Card_Basic_Recollection_SelectCustomCards_Title".Localize(card), GetAttribute("Draw_Card_Count"));
return mainGroup;
}
private void SelectEffect(CardInstance card)
{
CommandQueueManager.Instance.AddCommand(new Cmd_DrawCards(card.deck, new List<CardInstance>() { card }));
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: e9f44054ba6afc243aa3792048dfa04e

View File

@@ -0,0 +1,30 @@
using System.Collections.Generic;
using Continentis.MainGame;
using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
using Continentis.MainGame.Commands;
using SLSFramework.General;
namespace Continentis.Mods.Basic.Cards
{
/// <summary>
/// 庇护所:对目标施加弱驱散,每次使用后法力消耗增加 1。
/// </summary>
public class Sanctuary : CardLogicBase
{
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
{
CommandGroup mainGroup = ForEachTarget(targetList, target => Cmd.Parallel(
new Cmd_PlayAnimation(user.characterView, "Skill"),
Cmd.Do(() => target.combatBuffSubmodule.Dispel(BuffDispelLevel.Basic, user))
));
mainGroup.AddCommand(Cmd.Do(() =>
{
ModifyAttribute(CardAttributes.ManaCost, 1);
}));
return mainGroup;
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: d94d53754b845d94ea7c29956df69924

View File

@@ -0,0 +1,34 @@
using System.Collections.Generic;
using Continentis.MainGame;
using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
using Continentis.MainGame.Commands;
using SLSFramework.General;
namespace Continentis.Mods.Basic.Cards
{
public class Tactic : CardLogicBase
{
public override void SetUpLogicComponents()
{
AddLogicComponent<CardLogicComponent_SelectHandCards>().SetEffect(SelectEffect);
}
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
{
CommandGroup mainGroup = Cmd.Sequential(new Cmd_PlayAnimation(user.characterView, "Skill"));
LogicComponent<CardLogicComponent_SelectHandCards>()
.AddSelectionCommands(ref mainGroup, "Card_Basic_Tactic_SelectHandCards_Title".Localize(), GetAttribute("Discard_Card_Count"), true);
mainGroup.AddCommand(new Cmd_DrawCards(user.deckSubmodule, GetAttribute("Draw_Card_Count")));
return mainGroup;
}
private void SelectEffect(CardInstance card)
{
CommandQueueManager.Instance.AddCommand(user.deckSubmodule.DiscardCard(card, true));
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 71a0c211d23ded94886525ca81a42f85

View File

@@ -0,0 +1,16 @@
using System.Collections.Generic;
using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
using Continentis.MainGame.Commands;
using SLSFramework.General;
namespace Continentis.Mods.Basic.Cards
{
public class ThinkingCountermeasures : CardLogicBase
{
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
{
return user.deckSubmodule.DrawCards(GetAttribute("Draw_Card_Count"));
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 184bd3b742eb0d14faa3ce20231bb5cc

View File

@@ -0,0 +1,53 @@
using System.Collections.Generic;
using Continentis.MainGame.Card;
using Continentis.MainGame.Character;
using Continentis.MainGame.Combat;
using Continentis.MainGame.Commands;
using Continentis.Mods.Basic.Buffs;
using SLSFramework.General;
using UnityEngine;
namespace Continentis.Mods.Basic.Cards
{
/// <summary>
/// 猛毒喷射:对主目标施加腐蚀 Buff
/// 并从剩余敌人中随机选取 Extra_Target_Count 个额外目标(不可重复)同样施加腐蚀 Buff。
/// targetCount = 1玩家手动指定主目标额外目标由 PlayEffect 内部随机决定。
/// </summary>
public class VenomSpray : CardLogicBase
{
private const string BUFF_CORROSION_STACK = "Buff_Corrosion_Stack";
private const string EXTRA_TARGET_COUNT = "Extra_Target_Count";
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
{
CharacterBase mainTarget = targetList[0];
int corrosionStack = GetAttribute(BUFF_CORROSION_STACK);
// 从所有敌人中排除主目标,不放回随机抽取额外目标
List<CharacterBase> pool = CombatMainManager.Instance.characterController.GetAllEnemies(user);
pool.Remove(mainTarget);
int extraCount = Mathf.Min(GetAttribute(EXTRA_TARGET_COUNT), pool.Count);
List<CharacterBase> extraTargets = new List<CharacterBase>();
for (int i = 0; i < extraCount; i++)
{
int index = Random.Range(0, pool.Count);
extraTargets.Add(pool[index]);
pool.RemoveAt(index);
}
return Cmd.Sequential(
new Cmd_PlayAnimation(user.characterView, "Skill"),
Cmd.Do(() =>
{
CreateCharacterBuff<Corrosion>(corrosionStack).Apply(mainTarget, user, this);
foreach (CharacterBase extra in extraTargets)
{
CreateCharacterBuff<Corrosion>(corrosionStack).Apply(extra, user, this);
}
})
);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: a36b331b0e2b358438eed660fcf79847