determining weight
This commit is contained in:
Lan
2020-05-03 19:36:55 +03:00
parent 43df999b02
commit 7adcb813c4

View File

@@ -235,7 +235,7 @@ namespace Kehyeedra3.Commands
if (lastfish < time) if (lastfish < time)
{ {
int rari = (SRandom.Next(0, 2001)); int rari = (SRandom.Next(0, 2001));
int weight = SRandom.Next(10 + Convert.ToInt32(level * 5), 1501); int weight = SRandom.Next(Convert.ToInt32(level * 5), 1501);
ulong rarity; ulong rarity;
if (level < 100) if (level < 100)
@@ -375,22 +375,23 @@ namespace Kehyeedra3.Commands
weight = 1000; weight = 1000;
} }
if (weight >= (1000 - Convert.ToInt32(level * 2)))
{
weight = SRandom.Next(100, 2001) + Convert.ToInt32(level * 5);
}
if (weight >= 1000) if (weight >= 1000)
{ {
size = FishSize.Medium; size = FishSize.Medium;
if (weight >= (1000 - Convert.ToInt32(level * 2)))
{
weight = SRandom.Next(10, 2001) + Convert.ToInt32(level * 5);
}
if (fish.Rarity == FishRarity.Legendary || fish.Rarity == FishRarity.T2Legendary || fish.Rarity == FishRarity.T3Legendary || fish.Rarity == FishRarity.T4Legendary) if (fish.Rarity == FishRarity.Legendary || fish.Rarity == FishRarity.T2Legendary || fish.Rarity == FishRarity.T3Legendary || fish.Rarity == FishRarity.T4Legendary)
{ {
weight = SRandom.Next(2000 + Convert.ToInt32(level * 20), 40001); weight = SRandom.Next(2000 + Convert.ToInt32(level * 20), 40001);
} }
double w = Convert.ToDouble(weight); double w = Convert.ToDouble(weight);
if (weight >= 1000)
{
xp = Convert.ToUInt64(Math.Round((xp * w / 1000), 0, MidpointRounding.ToEven)); xp = Convert.ToUInt64(Math.Round((xp * w / 1000), 0, MidpointRounding.ToEven));
if (fish.Rarity == FishRarity.Legendary || fish.Rarity == FishRarity.T2Legendary || fish.Rarity == FishRarity.T3Legendary || fish.Rarity == FishRarity.T4Legendary) if (fish.Rarity == FishRarity.Legendary || fish.Rarity == FishRarity.T2Legendary || fish.Rarity == FishRarity.T3Legendary || fish.Rarity == FishRarity.T4Legendary)
{ {
if (xp < 100) if (xp < 100)
@@ -399,7 +400,6 @@ namespace Kehyeedra3.Commands
} }
} }
} }
}
else else
{ {
size = FishSize.Small; size = FishSize.Small;