fixed spot calculation, reduced droprates
This commit is contained in:
parent
2df2125da9
commit
830333b758
1 changed files with 4 additions and 7 deletions
|
@ -62,7 +62,6 @@ public sealed class FishService(FishConfigService fcs, IBotCache cache, DbServic
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (item.Spot is not null && item.Spot != loc)
|
if (item.Spot is not null && item.Spot != loc)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -73,14 +72,12 @@ public sealed class FishService(FishConfigService fcs, IBotCache cache, DbServic
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
filteredItems.Add(item);
|
filteredItems.Add(item);
|
||||||
Log.Information("Added {FishName} to filtered items", item.Name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var maxSum = filteredItems.Sum(x => x.Chance * 100);
|
var maxSum = filteredItems.Sum(x => x.Chance * 100);
|
||||||
|
|
||||||
|
|
||||||
var roll = _rng.NextDouble() * maxSum;
|
var roll = _rng.NextDouble() * maxSum;
|
||||||
Log.Information("Roll: {Roll}, MaxSum: {MaxSum}", roll, maxSum);
|
|
||||||
|
|
||||||
FishResult? caught = null;
|
FishResult? caught = null;
|
||||||
|
|
||||||
|
@ -136,7 +133,7 @@ public sealed class FishService(FishConfigService fcs, IBotCache cache, DbServic
|
||||||
|
|
||||||
public FishingSpot GetSpot(ulong channelId)
|
public FishingSpot GetSpot(ulong channelId)
|
||||||
{
|
{
|
||||||
var cid = (channelId >> 22 >> 8) & 1;
|
var cid = (channelId >> 22 >> 8) % 10;
|
||||||
|
|
||||||
return cid switch
|
return cid switch
|
||||||
{
|
{
|
||||||
|
@ -248,7 +245,7 @@ public sealed class FishService(FishConfigService fcs, IBotCache cache, DbServic
|
||||||
if (maxStars == 2)
|
if (maxStars == 2)
|
||||||
{
|
{
|
||||||
// 66% chance of 1 star, 33% chance of 2 stars
|
// 66% chance of 1 star, 33% chance of 2 stars
|
||||||
return _rng.NextDouble() < 0.66 ? 1 : 2;
|
return _rng.NextDouble() < 0.8 ? 1 : 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (maxStars == 3)
|
if (maxStars == 3)
|
||||||
|
@ -269,9 +266,9 @@ public sealed class FishService(FishConfigService fcs, IBotCache cache, DbServic
|
||||||
var r = _rng.NextDouble();
|
var r = _rng.NextDouble();
|
||||||
if (r < 0.5)
|
if (r < 0.5)
|
||||||
return 1;
|
return 1;
|
||||||
if (r < 0.7)
|
if (r < 0.75)
|
||||||
return 2;
|
return 2;
|
||||||
if (r < 0.85)
|
if (r < 0.95)
|
||||||
return 3;
|
return 3;
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue