Longer bounties (#18053)
This commit is contained in:
@@ -27,21 +27,14 @@ public sealed class StationCargoBountyDatabaseComponent : Component
|
||||
public int TotalBounties;
|
||||
|
||||
/// <summary>
|
||||
/// A poor-man's weighted list of the durations for how long
|
||||
/// each bounty will last.
|
||||
/// The minimum amount of time the bounty lasts before being removed.
|
||||
/// </summary>
|
||||
[DataField("bountyDurations")]
|
||||
public List<TimeSpan> BountyDurations = new()
|
||||
{
|
||||
TimeSpan.FromMinutes(5),
|
||||
TimeSpan.FromMinutes(7.5f),
|
||||
TimeSpan.FromMinutes(7.5f),
|
||||
TimeSpan.FromMinutes(7.5f),
|
||||
TimeSpan.FromMinutes(10),
|
||||
TimeSpan.FromMinutes(10),
|
||||
TimeSpan.FromMinutes(10),
|
||||
TimeSpan.FromMinutes(10),
|
||||
TimeSpan.FromMinutes(10),
|
||||
TimeSpan.FromMinutes(15)
|
||||
};
|
||||
[DataField("minBountyTime"), ViewVariables(VVAccess.ReadWrite)]
|
||||
public float MinBountyTime = 600f;
|
||||
|
||||
/// <summary>
|
||||
/// The maxmium amount of time the bounty lasts before being removed.
|
||||
/// </summary>
|
||||
[DataField("maxBountyTime"), ViewVariables(VVAccess.ReadWrite)]
|
||||
public float MaxBountyTime = 905f;
|
||||
}
|
||||
|
||||
@@ -256,7 +256,9 @@ public sealed partial class CargoSystem
|
||||
if (component.Bounties.Count >= component.MaxBounties)
|
||||
return false;
|
||||
|
||||
var endTime = _timing.CurTime + _random.Pick(component.BountyDurations) + TimeSpan.FromSeconds(_random.Next(-10, 10));
|
||||
var duration = MathF.Round(_random.NextFloat(component.MinBountyTime, component.MaxBountyTime) / 15) * 15;
|
||||
var endTime = _timing.CurTime + TimeSpan.FromSeconds(duration);
|
||||
|
||||
component.Bounties.Add(new CargoBountyData(component.TotalBounties, bounty.ID, endTime));
|
||||
_adminLogger.Add(LogType.Action, LogImpact.Low, $"Added bounty \"{bounty.ID}\" (id:{component.TotalBounties}) to station {ToPrettyString(uid)}");
|
||||
component.TotalBounties++;
|
||||
|
||||
Reference in New Issue
Block a user