Ejemplo n.º 1
0
 public void OnAfterDeserialize()
 {
     foreach ((FieldInfo fi, Type type) in _fields)
     {
         if (fi.FieldType == typeof(bool))
         {
             if (BoolValues.TryGetValue($"{type.Name}:{fi.Name}", out bool val))
             {
                 fi.SetValue(null, val);
             }
         }
         else if (fi.FieldType == typeof(float))
         {
             if (FloatValues.TryGetValue($"{type.Name}:{fi.Name}", out float val))
             {
                 fi.SetValue(null, val);
             }
         }
         else if (fi.FieldType == typeof(int))
         {
             if (IntValues.TryGetValue($"{type.Name}:{fi.Name}", out int val))
             {
                 fi.SetValue(null, val);
             }
         }
     }
 }
        public void Reset()
        {
            BoolValues.Clear();
            IntValues.Clear();
            FloatValues.Clear();
            StringValues.Clear();

            infiniteGrimmIntegration = true;
            ghostBalls = true;

            maxAttackSpeedMult = 2.5f;
            maxRangeMult       = 2.0f;
            maxBallMoveSpeed   = 1.5f;
            maxBallSize        = 2.0f;

            maxDamage   = 1000;
            notchesCost = 2;
            maxSoulAdd  = 200;

            volumeMultiplier = 0.6f;

            colorAlpha = 1.0f;
            colorBlue  = 1.0f;
            colorRed   = 1.0f;
            colorGreen = 1.0f;

            SettingsVersion = VersionInfo.SettingsVer;
        }
Ejemplo n.º 3
0
 public void Reset()
 {
     BoolValues.Clear();
     StringValues.Clear();
     IntValues.Clear();
     FloatValues.Clear();
 }
Ejemplo n.º 4
0
        private void AccelY_doAppendLoop(double[] dataMean, double[] dataVar)
        {
            int len = dataMean.Length;

            IntegerValues XValues      = new IntegerValues(len);
            FloatValues   YValues_mean = new FloatValues(len);
            FloatValues   YValues_var  = new FloatValues(len);

            using (g_accelY_Surface.SuspendUpdates())
            {
                g_accelY_XValue++;

                XValues.Clear();
                YValues_mean.Clear();
                YValues_var.Clear();

                for (var i = 0; i < dataMean.Length; i++)
                {
                    XValues.Add(g_accelY_XValue);
                    YValues_mean.Add((float)dataMean[i]);
                    YValues_var.Add((float)dataVar[i]);
                }

                g_accelY_MeanSeries.Append(XValues, YValues_mean);
                g_accelY_VarSeries.Append(XValues, YValues_var);
            }
        }
Ejemplo n.º 5
0
        public void OnAfterDeserialize()
        {
            foreach (KeyValuePair <FieldInfo, Type> pair in _fields)
            {
                FieldInfo fi = pair.Key;

                if (fi.FieldType == typeof(bool))
                {
                    if (BoolValues.TryGetValue($"{pair.Value.Name}:{fi.Name}", out bool val))
                    {
                        fi.SetValue(null, val);
                    }
                }
                else if (fi.FieldType == typeof(float))
                {
                    if (FloatValues.TryGetValue($"{pair.Value.Name}:{fi.Name}", out float val))
                    {
                        fi.SetValue(null, val);
                    }
                }
                else if (fi.FieldType == typeof(int))
                {
                    if (IntValues.TryGetValue($"{pair.Value.Name}:{fi.Name}", out int val))
                    {
                        fi.SetValue(null, val);
                    }
                }
            }
        }
Ejemplo n.º 6
0
        public void Reset()
        {
            BoolValues.Clear();
            IntValues.Clear();
            FloatValues.Clear();
            HardMode = false;
            ReduceLagInGrimmFight = false;
            EvenMoreLagReduction  = false;
            NightmareGodGrimm     = false;
            NightmareGodGrimmDies = false;

            TimeAttackMode = false;
            OneHitMode     = false;


            StartingDanceSpeedMultiplier     = 0.8f;
            MaximumDanceSpeed                = 3.0f;
            DamageToIncreaseDanceSpeedByOne  = 5000.0f;
            DamageToIncreaseStaggerHitsByOne = 300;
            StartingHitsToStagger            = 8;

            modernHardRandomSpikesDmg = 1500;
            modernHardNGGSpikesDmg    = 7000;
            modernHardDeathWallDmg    = 4000;
            modernHardSanicDmg        = 9000;
            // Six minutes, slim shady.
            TimeAttackTime = 60 * 6;

            settingsVersion = version_info.SETTINGS_VER;
        }
Ejemplo n.º 7
0
        public void reset()
        {
            BoolValues.Clear();
            IntValues.Clear();
            FloatValues.Clear();
            StringValues.Clear();

            settingsVersion = globals.SETTINGS_VER;

            onlyEnableInGodmaster    = false;
            comboAffectsPlayerDamage = true;
            comboLossOnHit           = true;

            comboDrainRate = 1.0f;
            damageModifier = 0.4f;

            comboIncrementHits     = 8;
            tenXcomboIncrementHits = 35;

            doNotModifyAnyStringValues = globals.DO_NOT_MODIFY;
            string unset = char.ToString((char)globals.gm1_bestclear.None) +
                           char.ToString((char)globals.gm1_numbindings.None);

            unset     = char.ToString(cheat_detect.checksumString(unset)) + unset;
            soulless1 = unset;
            soulless2 = unset;
            soulless3 = unset;
            soulless4 = unset;
            soulless5 = unset;
        }
Ejemplo n.º 8
0
 static void ClearWithoutEvent()
 {
     IntValues.Clear();
     FloatValues.Clear();
     StringValues.Clear();
     Vector3Values.Clear();
     ColorValues.Clear();
 }
 /// <summary>
 /// Handles fetching of a value in the FloatValues Dictionary
 /// </summary>
 /// <param name="defaultValue">Default Value to use if value is not found in the Settings Dictionary</param>
 /// <param name="name">Compiler Generated Name of Property</param>
 /// <returns>Float Value for the dictionary</returns>
 public float GetFloat(float?defaultValue = null, [CallerMemberName] string name = null)
 {
     if (name == null)
     {
         return(0f);
     }
     return(FloatValues.ContainsKey(name) ? FloatValues[name] : defaultValue ?? 0f);
 }
Ejemplo n.º 10
0
        public void reset()
        {
            BoolValues.Clear();
            IntValues.Clear();
            FloatValues.Clear();
            StringValues.Clear();

            settingsVersion = version_info.SETTINGS_VER;
        }
Ejemplo n.º 11
0
        public static bool CheckIfZero(FloatValues f1)
        {
            bool currentARes = EqualWithDelta(f1.ia, 0f, ConfigClass.delta.zeroDeltaCurrent);
            bool currentBRes = EqualWithDelta(f1.ib, 0f, ConfigClass.delta.zeroDeltaCurrent);
            bool currentCRes = EqualWithDelta(f1.ic, 0f, ConfigClass.delta.zeroDeltaCurrent);

            bool vabRes = EqualWithDelta(f1.vab, 0f, ConfigClass.delta.zeroDeltaVoltage);
            bool vbcRes = EqualWithDelta(f1.vbc, 0f, ConfigClass.delta.zeroDeltaVoltage);
            bool vcaRes = EqualWithDelta(f1.vca, 0f, ConfigClass.delta.zeroDeltaVoltage);

            return(currentARes && currentBRes && currentCRes && vabRes && vbcRes && vcaRes); // If all are the same, its zero value
        }
        public void Reset()
        {
            BoolValues.Clear();
            StringValues.Clear();
            IntValues.Clear();
            FloatValues.Clear();

            //foreach(string s in EnemyRandomizerDatabase.enemyTypeNames )
            //{
            //    StringValues.Add( s, s );
            //    BoolValues.Add( s, true );
            //}
        }
 /// <summary>
 /// Handles setting of a value in the FloatValues Dictionary
 /// </summary>
 /// <param name="value">Value to Set</param>
 /// <param name="name">Compiler Generated Name of the Property</param>
 public void SetFloat(float value, [CallerMemberName] string name = null)
 {
     if (name == null)
     {
         return;
     }
     if (FloatValues.ContainsKey(name))
     {
         FloatValues[name] = value;
     }
     else
     {
         FloatValues.Add(name, value);
     }
 }
Ejemplo n.º 14
0
        public static bool CompareDuplicateValues(FloatValues f1, FloatValues f2)
        {
            bool currentARes = EqualWithDelta(f1.ia, f2.ia, ConfigClass.delta.deltaCurrent);
            bool currentBRes = EqualWithDelta(f1.ib, f2.ib, ConfigClass.delta.deltaCurrent);
            bool currentCRes = EqualWithDelta(f1.ic, f2.ic, ConfigClass.delta.deltaCurrent);

            bool vabRes = EqualWithDelta(f1.vab, f2.vab, ConfigClass.delta.deltaVoltage);
            bool vbcRes = EqualWithDelta(f1.vbc, f2.vbc, ConfigClass.delta.deltaVoltage);
            bool vcaRes = EqualWithDelta(f1.vca, f2.vca, ConfigClass.delta.deltaVoltage);

            //if (currentARes && currentBRes && currentCRes && vabRes && vbcRes && vcaRes)
            //{
            //    Console.WriteLine("Debug Line");
            //}
            return(currentARes && currentBRes && currentCRes && vabRes && vbcRes && vcaRes); // If all are the same, its duplicate value
        }
Ejemplo n.º 15
0
        public void reset()
        {
            BoolValues.Clear();
            IntValues.Clear();
            FloatValues.Clear();
            StringValues.Clear();

            soulDreamFails  = 0;
            falseDreamFails = 0;
            kinDreamFails   = 0;

            soulDreamLevel  = 1;
            falseDreamLevel = 1;
            kinDreamLevel   = 1;

            settingsVersion = version_info.SAVE_VER;
        }
Ejemplo n.º 16
0
        public void Reset()
        {
            BoolValues.Clear();
            IntValues.Clear();
            FloatValues.Clear();
            StringValues.Clear();

            //infiniteGrimmIntegration = true;
            // just kidding...


            // floor color in json. defaults to invisible and black.
            rainbowFloor = false;
            // update every x frames
            rainbowUpdateDelay = 6;
            floorColorRed      = 0.0f;
            floorColorGreen    = 0.0f;
            floorColorBlue     = 0.0f;
            floorColorAlpha    = 0.0f;

            SettingsVersion = VersionInfo.SettingsVer;
        }
Ejemplo n.º 17
0
        private void ConvertDataToFloats(bool useModiconFormat, string[] hexValuesSplit, int startByte)
        {
            for (int i = startByte; (i - startByte < ByteCount) && (i < hexValuesSplit.Length - 3); i += 4)
            {
                MdbusFloat mdbusFloat = new MdbusFloat();
                mdbusFloat.RawString = hexValuesSplit[i] + ' ' + hexValuesSplit[i + 1] + ' ' + hexValuesSplit[i + 2] + ' ' + hexValuesSplit[i + 3];
                if (useModiconFormat)
                {
                    mdbusFloat.FloatString = (hexValuesSplit[i + 2] + hexValuesSplit[i + 3] + hexValuesSplit[i + 0] + hexValuesSplit[i + 1]);
                }
                else
                {
                    mdbusFloat.FloatString = (hexValuesSplit[i + 0] + hexValuesSplit[i + 1] + hexValuesSplit[i + 2] + hexValuesSplit[i + 3]);
                }
                // Convert hex string to float value
                uint num = uint.Parse(mdbusFloat.FloatString, System.Globalization.NumberStyles.AllowHexSpecifier);

                byte[] floatVals = BitConverter.GetBytes(num);
                mdbusFloat.Value = BitConverter.ToSingle(floatVals, 0);

                FloatValues.Add(mdbusFloat);
            }
        }
Ejemplo n.º 18
0
            public MonitorOption(string valueText)
            {
                if (!String.IsNullOrEmpty(valueText))
                {
                    StrValue = valueText;
                    int iv; if (int.TryParse(valueText, out iv))
                    {
                        IntValue = iv;
                    }
                    float fv; if (float.TryParse(valueText, out fv))
                    {
                        FloatValue = fv;
                    }
                    Color cv; if (TryParseColor(valueText, out cv))
                    {
                        ColorValue = cv;
                    }

                    foreach (var str in valueText.Split('|'))
                    {
                        StrValues.Add(str);
                        if (int.TryParse(str, out iv))
                        {
                            IntValues.Add(iv);
                        }
                        if (float.TryParse(str, out fv))
                        {
                            FloatValues.Add(fv);
                        }
                        if (TryParseColor(str, out cv))
                        {
                            ColorValues.Add(cv);
                        }
                    }
                }
            }
Ejemplo n.º 19
0
        public void reset()
        {
            BoolValues.Clear();
            IntValues.Clear();
            FloatValues.Clear();
            StringValues.Clear();

            useGreymothDashWhenBlackmothMissing = true;

            overrideBlackmothNailDamage = true;
            overrideBlackmothLore       = true;
            overrideBlackmothCloak      = true;

            handicapAllNonFireAttacks = false;

            nailmasterGloryCost           = 3;
            fireballSoulAddOnHit          = 11;
            fireballDamageBase            = 8;
            fireballDamagePerNailLvl      = 3;
            fireballMagmaDamageBase       = 3;
            fireballMagmaDamagePerNailLvl = 2;
            laserDamageBase           = 15;
            laserDamagePerNailLvl     = 3;
            pillarDamageBase          = 10;
            pillarDamagePerNailLvl    = 6;
            pillarSecondaryDamageBase = 5;
            pillarSecondaryAttacks    = 4;
            trailDamageBase           = 5;
            trailDamagePerNailLvl     = 8;

            // not actually implemented
            //trailSecondaryDamageBase = 2;
            //trailSecondaryDamagePerNailLvl = 1;

            // Causes lasers to only fire when damage taken
            lasersWhenShieldBlocksAllDmg = false;

            useEnglishLoreWhenLanguageMissing        = false;
            useEnglishWarningInfoWhenLanguageMissing = true;

            applyBindingsToRedwingAttacks = true;

            applyCharmBindingToGreymoth      = true;
            applyHealthBindingToShield       = true;
            applyNailBindingToRedwingAttacks = true;
            applySoulBindingToNapalm         = true;

            redwingFirstLaunch = true;



            fireballCooldownBase = 7f;
            laserCooldownBase    = 10f;
            shieldCooldownBase   = 30f;
            shieldCooldownReductionPerNailHit = 0.5f;

            napalmDamageMultiplier = 0.6f;
            napalmDamageExponent   = 0.7f;

            settingsVersion = version_info.SETTINGS_VER;
        }
Ejemplo n.º 20
0
 public float GetFloat(string key, float defaultValue)
 {
     return(FloatValues.ContainsKey(key) ? GetFloat(key) : defaultValue);
 }
Ejemplo n.º 21
0
    public static void Load(string profileName)
    {
        ClearWithoutEvent();

        items = Decrypt(PlayerPrefs.GetString(profileName + "_IntData", "")).Split('\n');
        for (int i = 0; i < items.Length; i++)
        {
            if (items[i].Length == 0)
            {
                continue;
            }
            string key      = "";
            int    intValue = 0;
            if (DeserializeInt(items[i], out key, out intValue))
            {
                IntValues.Set(key, intValue);
            }
        }

        items = Decrypt(PlayerPrefs.GetString(profileName + "_FloatData", "")).Split('\n');
        for (int i = 0; i < items.Length; i++)
        {
            if (items[i].Length == 0)
            {
                continue;
            }
            string key        = "";
            float  floatValue = 0;
            if (DeserializeFloat(items[i], out key, out floatValue))
            {
                FloatValues.Set(key, floatValue);
            }
        }

        items = Decrypt(PlayerPrefs.GetString(profileName + "_StringData", "")).Split('\n');
        for (int i = 0; i < items.Length; i++)
        {
            if (items[i].Length == 0)
            {
                continue;
            }
            string key         = "";
            string stringValue = "";
            if (DeserializeString(items[i], out key, out stringValue))
            {
                StringValues.Set(key, stringValue);
            }
        }

        items = Decrypt(PlayerPrefs.GetString(profileName + "_Vector3Data", "")).Split('\n');
        for (int i = 0; i < items.Length; i++)
        {
            if (items[i].Length == 0)
            {
                continue;
            }
            string  key          = "";
            Vector3 Vector3Value = Vector3.zero;
            if (DeserializeVector3(items[i], out key, out Vector3Value))
            {
                Vector3Values.Set(key, Vector3Value);
            }
        }

        items = Decrypt(PlayerPrefs.GetString(profileName + "_ColorData", "")).Split('\n');
        for (int i = 0; i < items.Length; i++)
        {
            if (items[i].Length == 0)
            {
                continue;
            }
            string key        = "";
            Color  ColorValue = Color.white;
            if (DeserializeColor(items[i], out key, out ColorValue))
            {
                ColorValues.Set(key, ColorValue);
            }
        }

        CurrentProfile = profileName;

        if (OnLoad != null)
        {
            OnLoad();
        }
    }