引雷标记extender

This commit is contained in:
SoulliesOfficial
2026-07-26 09:42:03 -04:00
parent 39b43680a9
commit b047eb5e6d
22 changed files with 530 additions and 76 deletions

View File

@@ -15,6 +15,20 @@ namespace Cielonos.MainGame.Inventory.Collections
private void FAPF_GenerateLightning(RuntimeFuncAnim rtFuncAnim)
{
CustomFunction.PC_StringString p = rtFuncAnim.GetParams<CustomFunction.PC_StringString>();
if (_hasLightningConcentrator)
{
Enemy target = PrimaryTarget;
if (target == null || !target.gameObject.activeInHierarchy || target.statusSm.isDead)
{
target = RefreshLightningConcentratorTarget(out _);
}
AttackUnit modifiedAttack = ApplyLightningConcentrator(attackData[p.str1]);
Vector3 fallbackPosition = player.transform.position + player.transform.forward * 10f;
GenerateLightning(p.str0, modifiedAttack, target, fallbackPosition);
return;
}
List<Enemy> targets = CombatManager.EnemySm.Query(25f).From(player.transform).Candidates();

View File

@@ -44,6 +44,7 @@ namespace Cielonos.MainGame.Inventory.Collections
NormalArea lightning = vfxData.SpawnVFX(vfxName, player).GetComponentInChildren<NormalArea>();
lightning.Initialize<NormalArea>(player, this, Fraction.Enemy)
.SetTargetFilter<NormalArea>(candidate => candidate == target)
.SetAttackSubmodule<NormalArea>(attackUnit)
.SetTimeSubmodule<NormalArea>(2f, 0.1f, 0.04f)
.SetHitSubmodule<NormalArea>();

View File

@@ -1,4 +1,7 @@
using Cielonos.MainGame.Characters;
using Cielonos.MainGame.Effects.Feedback;
using SLSUtilities.Feedback;
using SLSUtilities.FunctionalAnimation;
namespace Cielonos.MainGame.Inventory.Collections
{
@@ -62,11 +65,25 @@ namespace Cielonos.MainGame.Inventory.Collections
return played;
}
private bool PlayLightning(CharacterBase target)
private bool PlayLightning(CharacterBase target, bool playStartupFeedback = false)
{
bool played = PlayTargetedAnimation("GenerateLightning", target);
if (played)
{
if (_hasLightningConcentrator && playStartupFeedback)
{
float duration = fullBodyFuncAnimSm.collection["GenerateLightning"]
.Interval(IntervalType.Startup).Duration * 2f;
player.feedbackSc.PlayFeedback("DisruptionStartup", runtimeFeedback =>
{
FeedbackClip timeScaleModifierClip = runtimeFeedback.Clip<TimeScaleModifierAction>("Time");
if (timeScaleModifierClip != null)
{
timeScaleModifierClip.duration = duration;
}
});
}
functionSm["Lightning"].Execute();
}
return played;

View File

@@ -14,6 +14,7 @@ namespace Cielonos.MainGame.Inventory.Collections
private bool _hasCubicScatterIndexer;
private bool _hasFusionChargeCore;
private bool _hasSigilBreakWedge;
private bool _hasLightningConcentrator;
private const int StellarRingQuickcasterSpinAreaUpgradeLevel = 1;
private const int FusionChargeCoreExtraFusionStack = 1;
@@ -32,6 +33,23 @@ namespace Cielonos.MainGame.Inventory.Collections
_hasCubicScatterIndexer = HasExtender<CubicScatterIndexer>();
_hasFusionChargeCore = HasExtender<FusionChargeCore>();
_hasSigilBreakWedge = HasExtender<SigilBreakWedge>();
_hasLightningConcentrator = HasExtender<LightningConcentrator>();
functionSm?["Lightning"]?.SetRuntimeTag(
nameof(LightningConcentrator),
FunctionData.FunctionUnit.DisruptionTag,
_hasLightningConcentrator);
}
private AttackUnit ApplyLightningConcentrator(AttackUnit source)
{
if (!_hasLightningConcentrator) return source;
// AttackData 已把基础倍率结算进 startDamageclone 后只修改本次 Lightning。
AttackUnit modified = source.Clone();
modified.startDamage *= 2f;
modified.damageDeviation *= 2f;
modified.breakthroughType = Breakthrough.Type.Disruption;
return modified;
}
private bool PlayStellarRingQuickcasterSpinArea()

View File

@@ -95,7 +95,11 @@ namespace Cielonos.MainGame.Inventory.Collections
{
if (functionSm["Lightning"].IsAvailable() && fullBodyFuncAnimSm.CheckPlayability())
{
PlayLightning(RefreshPrimaryTarget());
bool playStartupFeedback = false;
CharacterBase target = _hasLightningConcentrator
? RefreshLightningConcentratorTarget(out playStartupFeedback)
: RefreshPrimaryTarget();
PlayLightning(target, playStartupFeedback);
}
}
}

View File

@@ -21,6 +21,25 @@ namespace Cielonos.MainGame.Inventory.Collections
return RefreshPrimaryTarget(TargetingScorePreset.MeleeAttack, radius);
}
private Enemy RefreshLightningConcentratorTarget(out bool hasDisruptableTarget,
float radius = DefaultTargetingRadius)
{
_currentTargets.Clear();
Enemy target = CombatManager.EnemySm.Query(radius, TargetingScorePreset.RangedAttack)
.OnlyDisruptable(Breakthrough.Type.Disruption)
.Best();
hasDisruptableTarget = target != null;
target ??= CombatManager.EnemySm.Query(radius, TargetingScorePreset.RangedAttack).LockonFirst();
if (target != null)
{
_currentTargets.Add(target);
}
return target;
}
private Enemy RefreshPrimaryTarget(TargetingScorePreset preset, float radius = DefaultTargetingRadius)
{
RefreshCurrentTargets(1, radius, preset);