public static void RandomizeOrb(string orbTypeName, OrbDamageOdds orbOdds, Random random) { EInventoryOrbType orbType = (EInventoryOrbType)Enum.Parse(typeof(EInventoryOrbType), orbTypeName); var options = GetOrbDamageOptions(orbType); int newDamage; switch (orbOdds.GetModifier(random)) { case OrbDamageOdds.OrbDamageModifier.Minus: newDamage = options.MinValue; OverrideOrbNames(orbType, "(-)"); break; case OrbDamageOdds.OrbDamageModifier.Plus: newDamage = options.MaxValue; OverrideOrbNames(orbType, "(+)"); break; default: newDamage = options.MidValue; break; } if (!OrbDamageLookup.ContainsKey((int)orbType)) { OrbDamageLookup.Add((int)orbType, newDamage); } }
private static Dictionary <string, OrbDamageOdds> GetPresetOdds(OrbDamageOdds preset) { Dictionary <string, OrbDamageOdds> defaultOdds = new Dictionary <string, OrbDamageOdds>(); foreach (EInventoryOrbType orbType in Enum.GetValues(typeof(EInventoryOrbType))) { if (orbType != EInventoryOrbType.Monske && orbType != EInventoryOrbType.None) { defaultOdds.Add(orbType.ToString(), preset); } } return(defaultOdds); }