Example #1
0
 public static EvadeSpellConfig GetEvadeSpell(string key)
 {
     if (EvadeSpells.Any(i => i.Key == key))
     {
         return(EvadeSpells[key]);
     }
     ConsoleDebug.WriteLineColor("Evade Spell: " + key + " Not Found, Returning: DO NOT USE", ConsoleColor.Red);
     return(new EvadeSpellConfig {
         DangerLevel = SpellDangerLevel.Low, SpellMode = SpellModes.Undodgeable, Use = false
     });
 }
Example #2
0
        private static SpellConfig Randomize(SpellConfig spellConfig)
        {
            if (spellConfig == null)
            {
                return(null);
            }
            if (_randomizer == null)
            {
                _randomizer = new Randomizer.Randomizer();
            }
            if (!KeysExist(ConfigValue.EnableRandomizer, ConfigValue.RandomizerMaxDangerLevel, ConfigValue.RandomizerPercentage, ConfigValue.DrawBlockedRandomizerSpells))
            {
                ConsoleDebug.WriteLine("Config Keys Not Found!", true);
                return(spellConfig);
            }

            if (GetBool(ConfigValue.EnableRandomizer) && GetInt(ConfigValue.RandomizerMaxDangerLevel) > (int)spellConfig.DangerLevel)
            {
                spellConfig.Dodge = _randomizer.IsAbovePercentage(1f - GetInt(ConfigValue.RandomizerPercentage) / 100f);
                spellConfig.Draw  = spellConfig.Draw && GetBool(ConfigValue.DrawBlockedRandomizerSpells);
            }
            return(spellConfig);
        }