better randomisation for DamageTime
All checks were successful
Build / build (22) (push) Successful in 36s
Build / build (20) (push) Successful in 54s
Build / build (18) (push) Successful in 1m1s

This commit is contained in:
Sainan 2025-03-03 09:56:50 +01:00
parent 89309aae19
commit bdc882b886

View File

@ -52,7 +52,7 @@ export const dronesController: RequestHandler = async (req, res) => {
if (Math.random() < system.damageChance) { if (Math.random() < system.damageChance) {
drone.DamageTime = config.instantResourceExtractorDrones drone.DamageTime = config.instantResourceExtractorDrones
? new Date() ? new Date()
: new Date(Date.now() + getRandomInt(3, 4) * 3600_000); : new Date(Date.now() + getRandomInt(3 * 3600 * 1000, 4 * 3600 * 1000));
drone.PendingDamage = getRandomInt(system.droneDamage.minValue, system.droneDamage.maxValue); drone.PendingDamage = getRandomInt(system.droneDamage.minValue, system.droneDamage.maxValue);
} }
const resource = getRandomWeightedReward3(system.resources, droneMeta.probabilities)!; const resource = getRandomWeightedReward3(system.resources, droneMeta.probabilities)!;