public static bool SensorLockSequence_CompleteOrders_Prefix(SensorLockSequence __instance, AbstractActor ___owningActor) { 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 (PilotHasFreeSensorLockAbility(___owningActor)) { Pilot pilot = ___owningActor.GetPilot(); Ability ability = pilot.GetActiveAbility(ActiveAbilityID.SensorLock); Mod.Log.Debug?.Write($" On sensor lock complete, cooldown is:{ability.CurrentCooldown}"); if (ability.CurrentCooldown < 1) { ability.ActivateCooldown(); } Mod.Log.Debug?.Write($" Clearing all sequences"); if (ModState.SelectionStateSensorLock != null) { Mod.Log.Debug?.Write($" Calling clearTargetedActor"); Traverse traverse = Traverse.Create(ModState.SelectionStateSensorLock).Method("ClearTargetedActor"); traverse.GetValue(); //State.SelectionStateSensorLock.BackOut(); ModState.SelectionStateSensorLock = null; } } return(false); }
static void Postfix(ref SensorLockSequence __instance) { Mech mech = __instance.owningActor as Mech; if (mech != null) { __instance.owningActor.ForceUnitOnePhaseUp(mech.GUID, __instance.RootSequenceGUID, true); } }
public static bool Prefix(SensorLockSequence __instance, ref int ___numWavesFired, ref float ___timeSinceLastWave) { if (__instance.Target.StatCollection.GetValue <float>("SensorLockDefense") > 0) { __instance.GetCombat().MessageCenter.PublishMessage(new FloatieMessage(__instance.owningActor.GUID, __instance.Target.GUID, "Sensor Lock blocked by ECM", FloatieMessage.MessageNature.Buff)); ___numWavesFired++; ___timeSinceLastWave = 0; return(false); } return(true); }
public static void Postfix(SensorLockSequence __instance) { try { //if (__instance.owningActor.team.IsLocalPlayer) if (__instance.owningActor.team.LocalPlayerControlsTeam) { return; } Logger.Debug($"[SensorLockSequence_OnAdded_POSTFIX] Focus on sensor lock target..."); CameraControl.Instance.SetMovingToGroundPos(__instance.Target.CurrentPosition, 0.95f); } catch (Exception e) { Logger.Error(e); } }