feat: implement weapon system, loadout manager, and specialized projectile behaviors with associated assets

This commit is contained in:
DottsGit
2026-06-04 18:14:50 -04:00
parent c32f45a8aa
commit e6a2199777
36 changed files with 700 additions and 4 deletions
+49
View File
@@ -384,4 +384,53 @@ for i in range(int(sample_rate * nail_duration)):
nail_samples.append(hit + ring + chunk)
write_wav('assets/sounds/nailgun_fire.wav', nail_samples)
# 17. AWP (Thunderous crack, massive bass, slow echo)
awp_duration = 0.6
awp_samples = []
for i in range(int(sample_rate * awp_duration)):
t = i / sample_rate
noise = random.uniform(-1.0, 1.0)
crack = noise * math.exp(-t * 80.0) * 0.8
boom = math.sin(t * max(30.0, 80.0 - t * 150.0) * 2 * math.pi) * math.exp(-t * 10.0) * 0.9
awp_samples.append(crack + boom)
write_wav('assets/sounds/awp_fire.wav', awp_samples)
# 18. Rocket Launcher (Deep thud, whoosh)
rocket_duration = 0.4
rocket_samples = []
prev_r = 0.0
for i in range(int(sample_rate * rocket_duration)):
t = i / sample_rate
noise = random.uniform(-1.0, 1.0)
thud = math.sin(t * 50.0 * 2 * math.pi) * math.exp(-t * 20.0) * 0.7
alpha = 0.05
filtered = prev_r + alpha * (noise - prev_r)
prev_r = filtered
whoosh = filtered * math.exp(-t * 15.0) * 0.5
rocket_samples.append(thud + whoosh)
write_wav('assets/sounds/rocket_fire.wav', rocket_samples)
# 19. Swarm Launcher (High-pitched whistling zip)
swarm_duration = 0.2
swarm_samples = []
for i in range(int(sample_rate * swarm_duration)):
t = i / sample_rate
noise = random.uniform(-1.0, 1.0)
zip_freq = 600.0 + t * 2000.0
pew = math.sin(t * zip_freq * 2 * math.pi) * math.exp(-t * 25.0) * 0.4
swarm_samples.append(pew + noise * math.exp(-t * 50.0) * 0.2)
write_wav('assets/sounds/swarm_fire.wav', swarm_samples)
# 20. Mortar (Heavy hollow thunk)
mortar_duration = 0.3
mortar_samples = []
for i in range(int(sample_rate * mortar_duration)):
t = i / sample_rate
noise = random.uniform(-1.0, 1.0)
thunk_freq = 60.0
thunk = math.sin(t * thunk_freq * 2 * math.pi) * math.exp(-t * 15.0) * 0.7
ring = math.sin(t * 200.0 * 2 * math.pi) * math.exp(-t * 30.0) * 0.2
mortar_samples.append(thunk + ring)
write_wav('assets/sounds/mortar_fire.wav', mortar_samples)
print("Generated all sounds!")