public static bool ActiveProbeSequence_CompleteOrders_Prefix(ActiveProbeSequence __instance, AbstractActor ___owningActor, ParticleSystem ___probeParticles) { Mod.Log.Trace?.Write("SLS:CO entered, aborting invocation"); //Mod.Log.Trace?.Write($" oa:{___owningActor.DisplayName}_{___owningActor.GetPilot().Name} hasFired:{___owningActor.HasFiredThisRound} hasMoved:{___owningActor.HasMovedThisRound} hasActivated:{___owningActor.HasActivatedThisRound}"); // Force the ability to be on cooldown if (ActorHasFreeSensorLock(___owningActor)) { CombatGameState ___Combat = Traverse.Create(__instance).Property("Combat").GetValue <CombatGameState>(); if (___probeParticles != null) { ___probeParticles.Stop(true); ___Combat.DataManager.PoolGameObject(___Combat.Constants.VFXNames.active_probe_effect, ___probeParticles.gameObject); } WwiseManager.PostEvent(AudioEventList_activeProbe.activeProbe_stop, WwiseManager.GlobalAudioObject, null, null); Mod.Log.Debug?.Write($" Clearing all sequences"); if (ModState.SelectionStateActiveProbe != null) { Mod.Log.Debug?.Write($" Calling clearTargetedActor"); Traverse traverse = Traverse.Create(ModState.SelectionStateActiveProbe).Method("RefreshPossibleTargets"); traverse.GetValue(); //State.SelectionStateSensorLock.BackOut(); ModState.SelectionStateActiveProbe = null; } return(false); } return(true); }
public static bool Prefix(ActiveProbeSequence __instance, AbstractActor Target, ref int ___numWavesFired, ref float ___timeSinceLastWave) { if (Target.StatCollection.GetValue <float>("SensorLockDefense") > 0) { __instance.SetCamera(CameraControl.Instance.ShowSensorLockCam(Target, 2f), __instance.MessageIndex); CameraControl.Instance.ClearTargets(); __instance.GetCombat().MessageCenter.PublishMessage(new FloatieMessage(__instance.owningActor.GUID, Target.GUID, "Sensor Lock blocked by ECM", FloatieMessage.MessageNature.Buff)); ___numWavesFired++; ___timeSinceLastWave = 0; return(false); } return(true); }