Esempio n. 1
0
        public static void Postfix(AITeam __instance, ref InvocationMessage __result)
        {
            if (__result == null || _injectedThisCall)
            {
                _injectedThisCall = false;
                return;
            }

            // the ai has decided to do something, if we're pausing the AI,
            // we want to skip this invocation and inject it on the next think
            // after we hit the key shortcut
            var skipThisInvocation = AIPause.OnAIInvocation(__instance, __result);

            if (skipThisInvocation)
            {
                __result = null;
            }
        }
Esempio n. 2
0
        public static bool Prefix(AITeam __instance, ref InvocationMessage __result, ref float ___planningStartTime)
        {
            // if shouldPauseAI is on at all, we should never fail to get invocation because of time
            if (Main.Settings.ShouldPauseAI)
            {
                ___planningStartTime = __instance.Combat.BattleTechGame.Time;
            }

            var inject = AIPause.TryGetMessageInject();

            if (inject == null)
            {
                return(true);
            }

            // abort the call and force the return to be the previously skipped
            // invocation message that we got in the postfix
            __result          = inject;
            _injectedThisCall = true;
            return(false);
        }
Esempio n. 3
0
 public static bool Prefix(AITeam __instance)
 {
     return(!AIPause.OnAIThink(__instance));
 }
Esempio n. 4
0
 internal static void OnCombatInit()
 {
     ReloadResources();
     AIPause.DestroyUI();
 }