更新
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using System.Collections.Generic;
|
||||
using Continentis.MainGame.Base;
|
||||
using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Commands;
|
||||
using SLSFramework.General;
|
||||
|
||||
namespace Continentis.Mods.Basic.Cards
|
||||
{
|
||||
/// <summary>
|
||||
/// 初级侦测术:移除目标的 DodgeRemoveAmount 点闪避。
|
||||
/// </summary>
|
||||
public class BasicDetection : CardLogicBase
|
||||
{
|
||||
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
||||
{
|
||||
return ForEachTarget(targetList, target => Cmd.Parallel(
|
||||
new Cmd_PlayAnimation(user.characterView, "Action"),
|
||||
Cmd.Do(() => {
|
||||
int amount = GetAttribute("DodgeRemoveAmount");
|
||||
int currentDodge = target.GetAttribute(CharacterAttributes.Dodge);
|
||||
int removeAmount = UnityEngine.Mathf.Min(amount, currentDodge);
|
||||
|
||||
if (removeAmount > 0)
|
||||
{
|
||||
target.ModifyAttribute(CharacterAttributes.Dodge, -removeAmount);
|
||||
target.characterView.hudContainer.UpdateAllHUD();
|
||||
}
|
||||
})
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3b59594e6393ac740b545a5ccaba4e80
|
||||
@@ -0,0 +1,22 @@
|
||||
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 BasicHealing : CardLogicBase
|
||||
{
|
||||
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
||||
{
|
||||
return ForEachTarget(targetList, target => Cmd.Parallel(
|
||||
new Cmd_PlayAnimation(user.characterView, "Action"),
|
||||
Cmd.Do(() =>
|
||||
{
|
||||
target.Heal(GetAttribute("HealAmount"));
|
||||
})));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5c53a310aa1468e48ab76ab5dc11bfd5
|
||||
@@ -0,0 +1,29 @@
|
||||
using System.Collections.Generic;
|
||||
using Continentis.MainGame;
|
||||
using Continentis.MainGame.Card;
|
||||
using Continentis.MainGame.Character;
|
||||
using Continentis.MainGame.Commands;
|
||||
using SLSFramework.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Continentis.Mods.Basic.Cards
|
||||
{
|
||||
/// <summary>
|
||||
/// 初级净化术:对目标施加弱驱散(Basic),移除所有可被弱驱散驱散的负面Buff。
|
||||
/// 友方目标时驱散负面Buff;敌方目标时驱散正面Buff(由 Dispel 内部判定)。
|
||||
/// </summary>
|
||||
public class BasicPurification : CardLogicBase
|
||||
{
|
||||
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
||||
{
|
||||
return ForEachTarget(targetList, target => Cmd.Parallel(
|
||||
new Cmd_PlayAnimation(user.characterView, "Action"),
|
||||
Cmd.Do(() =>
|
||||
{
|
||||
List<CharacterCombatBuffBase> dispelled = target.combatBuffSubmodule.Dispel(BuffDispelLevel.Basic, user);
|
||||
Debug.Log($"[BasicPurification] 对 {target.data.displayName} 执行弱驱散,移除了 {dispelled.Count} 个Buff。");
|
||||
})
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f3172551bc0b3e044bc1245dd4981a25
|
||||
28
Assets/Mods/Basic/Cards/Scripts/General/Skill/Bless.cs
Normal file
28
Assets/Mods/Basic/Cards/Scripts/General/Skill/Bless.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// 祝福术:目标的下{Buff_Blessing_Stack}张卡牌获得1点通用增益影响,持续{Buff_Blessing_Duration}回合。
|
||||
/// </summary>
|
||||
public class Bless : CardLogicBase
|
||||
{
|
||||
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
||||
{
|
||||
return ForEachTarget(targetList, target => Cmd.Parallel(
|
||||
new Cmd_PlayAnimation(user.characterView, "Action"),
|
||||
Cmd.Do(() =>
|
||||
{
|
||||
int stack = GetAttribute("Buff_Blessing_Stack");
|
||||
int duration = GetAttribute("Buff_Blessing_Duration");
|
||||
CreateCharacterBuff<Buffs.Blessing>(stack, duration).Apply(target, user, this);
|
||||
})
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d33479718f28afc4ab7d0df6616a1562
|
||||
94
Assets/Mods/Basic/Cards/Scripts/General/Skill/Command.cs
Normal file
94
Assets/Mods/Basic/Cards/Scripts/General/Skill/Command.cs
Normal file
@@ -0,0 +1,94 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Continentis.MainGame;
|
||||
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>
|
||||
/// 命令术:对目标执行一次感知检定:
|
||||
/// <para>对敌人:若感知低于{PerceptionThreshold_Remove},随机移除一个意图;若低于{PerceptionThreshold_Change},随机改变一个意图</para>
|
||||
/// <para>对玩家英雄:若感知检定未通过,将一张"扼制"卡牌放入目标的抽牌堆</para>
|
||||
/// </summary>
|
||||
public class Command : CardLogicBase
|
||||
{
|
||||
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);
|
||||
|
||||
public override void Initialize(CardInstance cardInstance)
|
||||
{
|
||||
base.Initialize(cardInstance);
|
||||
|
||||
// 战场角色变化时刷新 hintShadow,托管机制自动取消订阅
|
||||
CombatEventCollection events = CombatMainManager.Instance.eventCollection;
|
||||
SubscribeCombatEvent(events.onCharacterDeath, new PrioritizedAction<CharacterBase>(_ => InvalidateHint()));
|
||||
SubscribeCombatEvent(events.onCharacterJoin, new PrioritizedAction<CharacterBase>(_ => InvalidateHint()));
|
||||
}
|
||||
|
||||
/// <summary>抽到此牌时刷新 hintShadow。</summary>
|
||||
protected override void OnDraw() => InvalidateHint();
|
||||
|
||||
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
||||
{
|
||||
return ForEachTarget(targetList, target => Cmd.Parallel(
|
||||
new Cmd_PlayAnimation(user.characterView, "Action"),
|
||||
Cmd.Do(() =>
|
||||
{
|
||||
if (target is PlayerHero)
|
||||
PlayEffectOnPlayer(target);
|
||||
else
|
||||
PlayEffectOnEnemy(target);
|
||||
})
|
||||
));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 检查场上是否存在感知低于阈值的可用目标。
|
||||
/// 有可用目标时返回绿色,无可用目标时返回红色。
|
||||
/// </summary>
|
||||
public override Color? GetHintColor()
|
||||
{
|
||||
if (user == null || card.handCardView == null) return null;
|
||||
|
||||
card.DetectTargetsValidity(out List<CharacterBase> valid, out _, out _);
|
||||
if (valid.Count == 0) return HintRed;
|
||||
|
||||
int changeThreshold = GetAttribute("Perception_Threshold_High");
|
||||
bool hasEffectiveTarget = valid.Any(t =>
|
||||
t.GetAttribute(CharacterAttributes.Perception) < changeThreshold);
|
||||
|
||||
return hasEffectiveTarget ? HintGreen : HintRed;
|
||||
}
|
||||
|
||||
/// <summary>对敌方目标:根据感知检定移除或改变意图。</summary>
|
||||
private void PlayEffectOnEnemy(CharacterBase target)
|
||||
{
|
||||
int removeThreshold = GetAttribute("Perception_Threshold_Low");
|
||||
int changeThreshold = GetAttribute("Perception_Threshold_High");
|
||||
int perception = target.GetAttribute(CharacterAttributes.Perception);
|
||||
|
||||
if (perception < removeThreshold)
|
||||
target.intentionSubmodule.RemoveRandomIntendedCard();
|
||||
else if (perception < changeThreshold)
|
||||
target.intentionSubmodule.ChangeRandomIntendedCard();
|
||||
}
|
||||
|
||||
/// <summary>对玩家英雄:感知检定未通过时,向目标抽牌堆塞入一张"扼制"卡牌。</summary>
|
||||
private void PlayEffectOnPlayer(CharacterBase target)
|
||||
{
|
||||
int stifleThreshold = GetAttribute("Perception_Threshold_Low");
|
||||
int disruptionThreshold = GetAttribute("Perception_Threshold_High");
|
||||
int perception = target.GetAttribute(CharacterAttributes.Perception);
|
||||
|
||||
if (perception < stifleThreshold)
|
||||
CardInstance.GenerateCardInstance(GetDerivativeCardData(0), target, Piles.Draw);
|
||||
else if (perception < disruptionThreshold)
|
||||
CardInstance.GenerateCardInstance(GetDerivativeCardData(1), target, Piles.Draw);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 50fb290b3c3aa634294239492dbb9f54
|
||||
@@ -0,0 +1,25 @@
|
||||
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,使其物理攻击每段额外造成 {BuffStack} 点伤害。
|
||||
/// </summary>
|
||||
public class MarkOfRadiance : CardLogicBase
|
||||
{
|
||||
public override CommandGroup PlayEffect(List<CharacterBase> targetList)
|
||||
{
|
||||
return ForEachTarget(targetList, target => Cmd.Parallel(
|
||||
new Cmd_PlayAnimation(user.characterView, "Skill"),
|
||||
Cmd.Do(() =>
|
||||
CreateCharacterBuff<Buffs.MarkOfRadiance>(GetAttribute("Buff_MarkOfRadiance_Stack")).Apply(target, user, this)
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d8dc25f4aad95844688111d6de3fd1e4
|
||||
Reference in New Issue
Block a user