Beispiel #1
0
 public void NotifyGamePrefsChangedHandlers(EnumGamePrefs _pref)
 {
     if (OnGamePrefsChanged != null)
     {
         OnGamePrefsChanged(_pref);
     }
 }
 private bool prefAccessAllowed(EnumGamePrefs gp)
 {
     string gpName = gp.ToString ().ToLower ();
     foreach (string s in forbiddenPrefs) {
         if (gpName.Contains (s)) {
             return false;
         }
     }
     return true;
 }
        private bool prefAccessAllowed(EnumGamePrefs gp)
        {
            string gpName = gp.ToString().ToLower();

            foreach (string s in forbiddenPrefs)
            {
                if (gpName.Contains(s))
                {
                    return(false);
                }
            }
            return(true);
        }
        public override void Run(string[] _params)
        {
            try {
                EnumGamePrefs enumGamePrefs = EnumGamePrefs.Last;

                if (_params.Length > 0)
                {
                    try {
                        enumGamePrefs = (EnumGamePrefs)((int)Enum.Parse(typeof(EnumGamePrefs), _params [0]));
                    } catch (Exception e) {
                        Log.Out("Error in GetGamePrefs.Run: " + e);
                    }
                }

                if (enumGamePrefs == EnumGamePrefs.Last)
                {
                    SortedList <string, string> sortedList = new SortedList <string, string> ();
                    foreach (EnumGamePrefs gp in Enum.GetValues(typeof(EnumGamePrefs)))
                    {
                        if ((_params.Length == 0) || (gp.ToString().ToLower().Contains(_params [0].ToLower())))
                        {
                            if (prefAccessAllowed(gp))
                            {
                                sortedList.Add(gp.ToString(), string.Format("{0} = {1}", gp.ToString(), GamePrefs.GetObject(gp)));
                            }
                        }
                    }
                    foreach (string s in sortedList.Keys)
                    {
                        m_Console.SendResult(sortedList [s]);
                    }
                }
                else
                {
                    if (prefAccessAllowed(enumGamePrefs))
                    {
                        m_Console.SendResult(string.Format("{0} = {1}", enumGamePrefs, GamePrefs.GetObject(enumGamePrefs)));
                    }
                    else
                    {
                        m_Console.SendResult("Je ne peux communiquer cette information.");
                    }
                }
            } catch (Exception e) {
                Log.Out("Error in GetGamePrefs.Run: " + e);
            }
        }
Beispiel #5
0
            //    Maybe I'll need this someday ;)
            //    FieldInfo fieldInfo = typeof(EntityAlive).GetField("IsFeral", BindingFlags.NonPublic);
            //    FieldInfo fieldInfo2 = typeof(EntityZombie).GetField("moveSpeeds", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance);
            //    Debug.LogWarning("Part 1 done");
            //    bool IsFeral2 = (bool)fieldInfo.GetValue(__instance);
            //    float[] moveSpeeds2 = (float[])fieldInfo2.GetValue(__instance);
            //    Debug.LogWarning("Part 2 done");
            //    EnumGamePrefs eProperty = EnumGamePrefs.ZombieMove;
            static bool Prefix(EntityZombie __instance, ref float __result, ref bool ___IsFeral, ref float[] ___moveSpeeds)
            {
                bool        nullifyrage = false;
                EntityClass entityClass = EntityClass.list[__instance.entityClass];

                bool.TryParse(entityClass.Properties.Values["Ragemode"], out nullifyrage);
                if (nullifyrage || __instance.Buffs.HasBuff("buffRageMode"))
                {
                    return(true);
                }
                EnumGamePrefs eProperty = EnumGamePrefs.ZombieMove;

                if (__instance.IsBloodMoon)
                {
                    eProperty = EnumGamePrefs.ZombieBMMove;
                }
                else if (___IsFeral)
                {
                    eProperty = EnumGamePrefs.ZombieFeralMove;
                }
                else if (__instance.world.IsDark())
                {
                    eProperty = EnumGamePrefs.ZombieMoveNight;
                }
                int   @int = GamePrefs.GetInt(eProperty);
                float num  = ___moveSpeeds[@int];

                if (num < 1f)
                {
                    num = __instance.moveSpeedAggro * (1f - num) + __instance.moveSpeedAggroMax * num;
                }
                else
                {
                    num = __instance.moveSpeedAggroMax * num;
                }
                float speed = EffectManager.GetValue(PassiveEffects.RunSpeed, null, num, __instance, null, default(FastTags), true, true, true, true, 1, true);

                __result = speed;
                return(false);
            }
Beispiel #6
0
 private bool IsViewablePref(EnumGamePrefs pref) => _filterPrefs.All(value => !pref.ToString().ToLower().Contains(value));
 public void OnGamePrefChanged(EnumGamePrefs _enum)
 {
     API.Events.NotifyGamePrefsChangedHandlers(_enum);
 }