engine-c: lasting death RUBBLE/SCRAP scars + denser scorch

This commit is contained in:
local-model/engine-L2-grok-4.5 2026-09-19 11:50:41 +02:00
parent 3fb17411dc
commit bab388723f
No known key found for this signature in database
4 changed files with 96 additions and 9 deletions

View file

@ -66,15 +66,19 @@ void unit_apply_damage(Game *g, Unit *u, float dmg) {
if (u->hp <= 0 && !u->dead) {
u->dead = 1;
u->state = STATE_DEAD;
/* denser KKND2-like death: fire core + debris ring + smoke */
particle_burst(g, u->x, u->y, 18, 1, 255, 140, 40);
particle_burst(g, u->x, u->y, 10, 3, 90, 80, 70);
particle_burst(g, u->x + 6, u->y - 4, 8, 0, 110, 100, 90);
particle_burst(g, u->x - 5, u->y + 5, 6, 2, 255, 220, 90);
/* denser KKND2-like death: fire core + debris ring + smoke + scorch */
particle_burst(g, u->x, u->y, 22, 1, 255, 140, 40);
particle_burst(g, u->x, u->y, 14, 3, 90, 80, 70);
particle_burst(g, u->x + 6, u->y - 4, 10, 0, 110, 100, 90);
particle_burst(g, u->x - 5, u->y + 5, 8, 2, 255, 220, 90);
particle_burst(g, u->x + 3, u->y + 7, 8, 1, 60, 50, 45); /* scorch soot */
particle_burst(g, u->x - 4, u->y - 6, 6, 0, 70, 55, 40);
audio_sfx(2);
if (g->cam.shake < 7) g->cam.shake = 7;
if (u->faction == g->human)
game_log(g, "Unit lost: %s", unit_def(u->type, u->faction)->name);
/* lasting terrain scar under corpse (RUBBLE/SCRAP, soft/walkable) */
map_scar_unit_death(&g->map, u->x, u->y, u->type);
/* leave a wreck decal on the battlefield */
if (g->wreck_count < MAX_WRECKS) {
Wreck *w = &g->wrecks[g->wreck_next];