示例#1
0
            /// <summary>
            /// Applied after AttemptInitialRecovery runs. Sets the variables depending on whether or not the dupe is falling.
            /// </summary>
            /// <param name="__instance">The current FallMonitor.Instance.</param>
            /// <param name="__navigator">The current FallMonitor.Instance.navigator.</param>
            internal static void Postfix(FallMonitor.Instance __instance, Navigator ___navigator)
            {
                //First disable completly if FallDamageDifficulty == None
                if (DangerousWorldOptions.Instance.FallDamageDifficultyOption == FallDamageDifficulty.None)
                {
                    return;
                }

                if (__instance.gameObject.HasTag(GameTags.Minion))
                {
#if DEBUG
                    PUtil.LogDebug(("AttemptRecovery: {0} state: {1}").F(__instance.gameObject.name, __instance.GetCurrentState().name));
#endif
                    if (!dupesDict.ContainsKey(__instance.gameObject))
                    {
                        dupesDict.Add(__instance.gameObject, -1);
                    }
                    if (__instance.GetCurrentState() == __instance.sm.falling_pre)
                    {
#if DEBUG
                        PUtil.LogDebug(("AttemptRecovery: {0} is falling").F(__instance.gameObject.name));
#endif
                        dupesDict[__instance.gameObject] = Grid.PosToCell((KMonoBehaviour)___navigator);
#if DEBUG
                        PUtil.LogDebug(("falling from: {0}").F(dupesDict[__instance.gameObject]));
#endif
                    }
                    else
                    {
#if DEBUG
                        PUtil.LogDebug(("AttemptRecovery: {0} recovered").F(__instance.gameObject.name));
#endif
                        dupesDict[__instance.gameObject] = -1;
                    }
                }
            }