Audio (all CC0 — Kenney packs + OpenGameArt, see assets/sounds/SOURCES.md): - Replace every procedural synth WAV with forged sounds (ffmpeg pitch/layer mixes): distinct fire sounds per weapon with 2-3 variations, explosions, footsteps x5, land/jump/dash/vault, knife swing, hit/kill confirms, bullet impacts, reload, flight loops, UI hover/click/confirm/error, match jingles, menu music - AudioManager.stream_for(): AudioStreamRandomizer per sound id — every weapon now gets variation + pitch randomization on each shot - Explosions and bullet impacts play positional audio; landing has its own sound instead of a pitched footstep; ambient wind bed on every map Visuals: - ExplosionVFX: shared cel-shaded burst (white-hot stepped core, ink shockwave ring, star spikes, flat smoke puffs) replaces the orange sphere in both local and remote-replay paths - Comic star muzzle flashes on all weapons; unified cel tracer bolts with ink outlines across hitscan/shotgun/remote paths - Impact decals: hard-stepped ink-splat gradients instead of soft airbrush - Toon shading on first-person view models + arms, third-person weapons, and the procedural humanoid fallback (no hull outlines on FBX weapons — their hard normals tear the inverted hull) - Fix: giant soft "blob" highlight on floors — toon rim/specular disabled on level-geometry materials (pre-existing artifact since the cel commit) - Fix: own third-person weapon rendered into the first-person camera (shadows-only now covers first_person_mode) UI: - UITheme: comic theme on the root window — Bangers display font (OFL), paper panels with thick ink borders + hard drop shadows, papaya accent, themed buttons/inputs/popups; hover/click sounds on all menu buttons - Main menu: tilted comic wordmark, sunset toon diorama, looping menu music - Match HUD: themed scoreboard/killfeed/kill counter Viewports: - 4x MSAA project-wide + viewmodel/diorama viewports (crisp ink lines) - Viewmodel camera near plane 0.01; third-person camera FOV syncs settings - debug/visual_capture.gd: dev tool to screenshot menu + level for review Verified: 11/11 movement tests, spawn smoke test 0 failures, before/after screenshot comparison of menu and level. Co-Authored-By: Claude Fable 5 <[email protected]>
109 lines
3.4 KiB
GDScript
109 lines
3.4 KiB
GDScript
extends Node
|
|
class_name ImpactSpawner
|
|
|
|
static var bullet_hole_mat: StandardMaterial3D = null
|
|
static var crater_mat: StandardMaterial3D = null
|
|
static var plasma_mat: StandardMaterial3D = null
|
|
static var slash_mat: StandardMaterial3D = null
|
|
|
|
static func _ensure_mats():
|
|
if bullet_hole_mat != null:
|
|
return
|
|
|
|
var make_tex = func(colors: Array, offsets: Array, size: int) -> Texture2D:
|
|
var g = Gradient.new()
|
|
# For Godot 4 Gradient, we set offsets and colors directly
|
|
var p_offsets = PackedFloat32Array()
|
|
var p_colors = PackedColorArray()
|
|
for o in offsets: p_offsets.append(o)
|
|
for c in colors: p_colors.append(c)
|
|
g.offsets = p_offsets
|
|
g.colors = p_colors
|
|
# Hard color steps: reads as inked cel splats instead of soft airbrush
|
|
g.interpolation_mode = Gradient.GRADIENT_INTERPOLATE_CONSTANT
|
|
|
|
var t = GradientTexture2D.new()
|
|
t.gradient = g
|
|
t.fill = GradientTexture2D.FILL_RADIAL
|
|
t.fill_from = Vector2(0.5, 0.5)
|
|
t.fill_to = Vector2(0.5, 0.0)
|
|
t.width = size
|
|
t.height = size
|
|
return t
|
|
|
|
var tex_b = make_tex.call(
|
|
[Color(0.01, 0.01, 0.01, 1.0), Color(0.1, 0.1, 0.1, 0.8), Color(0.1, 0.1, 0.1, 0.0)],
|
|
[0.0, 0.3, 1.0], 32)
|
|
bullet_hole_mat = StandardMaterial3D.new()
|
|
bullet_hole_mat.albedo_texture = tex_b
|
|
bullet_hole_mat.transparency = BaseMaterial3D.TRANSPARENCY_ALPHA
|
|
|
|
var tex_c = make_tex.call(
|
|
[Color(0.05, 0.05, 0.05, 0.9), Color(0.1, 0.1, 0.1, 0.6), Color(0.1, 0.1, 0.1, 0.0)],
|
|
[0.0, 0.5, 1.0], 128)
|
|
crater_mat = StandardMaterial3D.new()
|
|
crater_mat.albedo_texture = tex_c
|
|
crater_mat.transparency = BaseMaterial3D.TRANSPARENCY_ALPHA
|
|
|
|
var tex_p = make_tex.call(
|
|
[Color(0.8, 0.9, 1.0, 1.0), Color(0.2, 0.6, 1.0, 0.8), Color(0.1, 0.3, 0.8, 0.0)],
|
|
[0.0, 0.2, 1.0], 64)
|
|
plasma_mat = StandardMaterial3D.new()
|
|
plasma_mat.albedo_texture = tex_p
|
|
plasma_mat.transparency = BaseMaterial3D.TRANSPARENCY_ALPHA
|
|
plasma_mat.emission_enabled = true
|
|
plasma_mat.emission_texture = tex_p
|
|
plasma_mat.emission_energy_multiplier = 2.0
|
|
|
|
var tex_s = make_tex.call(
|
|
[Color(0.9, 0.9, 0.9, 1.0), Color(0.8, 0.8, 0.8, 0.8), Color(0.8, 0.8, 0.8, 0.0)],
|
|
[0.0, 0.5, 1.0], 64)
|
|
slash_mat = StandardMaterial3D.new()
|
|
slash_mat.albedo_texture = tex_s
|
|
slash_mat.transparency = BaseMaterial3D.TRANSPARENCY_ALPHA
|
|
|
|
static func spawn(scene_tree: SceneTree, type: String, pos: Vector3, normal: Vector3, size: float = 0.2):
|
|
_ensure_mats()
|
|
|
|
# Positional impact tick (pooled; safe at fire-rate frequency)
|
|
if type == "bullet":
|
|
var am = scene_tree.root.get_node_or_null("AudioManager")
|
|
if am and am.has_sound("bullet_impact"):
|
|
am.play_3d("bullet_impact", pos, -6.0)
|
|
|
|
var mi = MeshInstance3D.new()
|
|
var qm = QuadMesh.new()
|
|
|
|
if type == "slash":
|
|
qm.size = Vector2(size * 4.0, size * 0.4)
|
|
else:
|
|
qm.size = Vector2(size, size)
|
|
|
|
var mat: StandardMaterial3D
|
|
if type == "bullet":
|
|
mat = bullet_hole_mat.duplicate()
|
|
elif type == "crater":
|
|
mat = crater_mat.duplicate()
|
|
elif type == "plasma":
|
|
mat = plasma_mat.duplicate()
|
|
elif type == "slash":
|
|
mat = slash_mat.duplicate()
|
|
|
|
qm.material = mat
|
|
mi.mesh = qm
|
|
|
|
scene_tree.current_scene.add_child(mi)
|
|
|
|
mi.global_position = pos + normal * 0.01
|
|
|
|
if abs(normal.dot(Vector3.UP)) < 0.999:
|
|
mi.look_at(mi.global_position - normal, Vector3.UP)
|
|
else:
|
|
mi.look_at(mi.global_position - normal, Vector3.RIGHT)
|
|
|
|
var duration = 5.0 if type == "crater" else 3.0
|
|
var tween = mi.create_tween()
|
|
tween.tween_interval(duration)
|
|
tween.tween_property(mat, "albedo_color:a", 0.0, 1.0)
|
|
tween.tween_callback(mi.queue_free)
|