feat: 2.5s lockout before dropped weapons can be re-picked
This commit is contained in:
1 parent
7aee2f5f64
commit
e801c02ef6
4 files changed
+29
-3
No files matched your search
+1
-1
@@ -117,7 +117,7 @@ function collectPickup(k) {
|
||||
if (old) {
|
||||
const a = rand(0, TAU);
|
||||
spawnPickup('weapon', p.x + Math.cos(a) * 34, p.y + Math.sin(a) * 34,
|
||||
{ wid: old.id, ammo: old.ammo, delay: 0.6 });
|
||||
{ wid: old.id, ammo: old.ammo, delay: WEAPON_DROP_LOCKOUT });
|
||||
}
|
||||
p.weapon = { id: w.id, ammo: k.ammo !== undefined ? k.ammo : w.ammo };
|
||||
p.holstered = null;
|
||||
|
||||
@@ -59,6 +59,8 @@ const PERK_POWER_WEIGHT = 0.5;
|
||||
// ammo economy: global dial for drop frequency (refill size is per-weapon)
|
||||
const AMMO_DROP_SCALE = 0.75;
|
||||
const PRESSURE_MIN = 0.60, PRESSURE_MAX = 2.00;
|
||||
// seconds a player-dropped weapon stays un-pickable (prevents instant swap loops)
|
||||
const WEAPON_DROP_LOCKOUT = 2.5;
|
||||
const PRESSURE_UNIT = 0.01; // one "point" on the dial scale
|
||||
const PRESSURE_GAIN = PRESSURE_UNIT; // retained: dial 0 == 1 point
|
||||
const PRESSURE_DROP_BASE = 3; // dial 0 == 0.03 relief base
|
||||
|
||||
Reference in new issue
Block a user