Files
Papay-Shooter/weapons/grenade_projectile.gd
T
Nicholas ButzkeandClaude Fable 5 0155bcdf04 fix: tighten gun audio timing and replace off-character sounds
- Gunshots: strip lead-in silence from every firearm recording (the audible
  delay between trigger and bang) and hard-trim to a single 0.7s crack with
  a fast fade — the outdoor-range echo read as 2-3 extra shots. Big single
  shots (AWP/shotgun/rocket/mortar) keep a 1s tail but still one boom.
- Hit confirm: short fleshy punch thock instead of the bell ("taco bell")
- Dash: clean synthesized air whoosh (bandpassed pink noise swell) instead
  of thruster fire crackle; grapple shoot inherits it
- Jump: push-off foot scuff + faint whoosh instead of the balloon boing
- Wind speed-loop: deep lowpass so it reads as rushing air, not fire
- Grenade: silent in flight — the rocket-engine loop made it sound like it
  was burning; bounces still audible

Verified: reimport + smoke test 0 failures, 11/11 movement tests.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-17 23:29:34 -04:00

67 lines
2.0 KiB
GDScript

extends BouncingProjectile
class_name GrenadeProjectile
func _ready() -> void:
super._ready()
fuse_time = 4.0
bounciness = 0.5
drop_gravity = 15.0
explosion_radius = 5.0
damage = 120.0
func _setup_effects() -> void:
# No flight loop — a lobbed grenade flies silently (the rocket engine
# loop read as "the grenade is on fire"). Bounces still make noise.
# Grenade Body
var body_mesh = MeshInstance3D.new()
var sphere = SphereMesh.new()
sphere.radius = 0.1
sphere.height = 0.2
var b_mat = StandardMaterial3D.new()
b_mat.albedo_color = Color(0.2, 0.4, 0.2) # Dark green
b_mat.roughness = 0.6
b_mat.metallic = 0.5
sphere.material = b_mat
body_mesh.mesh = sphere
add_child(body_mesh)
# Smoke Trail (White translucent tail)
smoke_sys = GPUParticles3D.new()
var smoke_mat = ParticleProcessMaterial.new()
smoke_mat.direction = Vector3(0, 0, 1)
smoke_mat.spread = 5.0
smoke_mat.initial_velocity_min = 0.0
smoke_mat.initial_velocity_max = 0.5
smoke_mat.gravity = Vector3(0, 0.1, 0) # Less floaty
var grad = Gradient.new()
grad.add_point(0.0, Color(1.0, 1.0, 1.0, 0.5))
grad.add_point(1.0, Color(1.0, 1.0, 1.0, 0.0))
var grad_tex = GradientTexture1D.new()
grad_tex.gradient = grad
smoke_mat.color_ramp = grad_tex
var curve = Curve.new()
curve.add_point(Vector2(0.0, 0.5))
curve.add_point(Vector2(1.0, 1.5))
var curve_tex = CurveTexture.new()
curve_tex.curve = curve
smoke_mat.scale_curve = curve_tex
var smoke_mesh = QuadMesh.new()
smoke_mesh.size = Vector2(0.2, 0.2)
var s_mat = StandardMaterial3D.new()
s_mat.transparency = BaseMaterial3D.TRANSPARENCY_ALPHA
s_mat.vertex_color_use_as_albedo = true
s_mat.albedo_texture = get_smoke_texture()
s_mat.billboard_mode = BaseMaterial3D.BILLBOARD_PARTICLES
s_mat.billboard_keep_scale = true
smoke_mesh.material = s_mat
smoke_sys.draw_pass_1 = smoke_mesh
smoke_sys.process_material = smoke_mat
smoke_sys.amount = 32
smoke_sys.lifetime = 1.0
smoke_sys.position = Vector3(0, 0, 0.0)
add_child(smoke_sys)