private static string GetEquippableDescription(StatContainer gearStats, EnumGearSlot slot) { int max = gearStats.Next(); int statType = 0; for (int x = 1; x < StatContainer.NumStats; x++) { int check = gearStats.Next(); if (max <= check) { max = check; statType = x; } } return GetSlotText(slot) + gearStats.GetStatName(statType); }
private static Equipable GenerateEquipable() { List<EffectInformation> stats = new List<EffectInformation>(); Equipable gear; EnumGearSlot slot = (EnumGearSlot)rnd.Next((int)EnumGearSlot.Max); int statPool = ((Maze.GetInstance().MazeLevel + 1) * _statPoolPerLevel) + rnd.Next(- _plusOrMinusToPool, _plusOrMinusToPool + 1); StatContainer statContainer = new StatContainer(); while (statPool > 0) { int whatStat = ChooseGearStat(); statContainer.Increment(whatStat); statPool -= 1; } //rarity here int rarity = rnd.Next(1000); double statScale = GetRarity(rarity); statContainer.Scale(statScale); stats.Add(new EffectInformation(StatsType.MaxHp, statContainer.Hp)); stats.Add(new EffectInformation(StatsType.MaxResources, statContainer.Mp)); stats.Add(new EffectInformation(StatsType.Agility, statContainer.Agi)); stats.Add(new EffectInformation(StatsType.Strength, statContainer.Str)); stats.Add(new EffectInformation(StatsType.Intelegence, statContainer.Int)); stats.Add(new EffectInformation(StatsType.Defense, statContainer.Def)); gear = new Equipable(key++, stats, GetRarityInText(rarity) + GetEquippableDescription(statContainer, slot) ); gear.Slot = slot; return gear; }