engine-c: HQ→clash corridor scrap/rock fill + thicker unit silhouettes

This commit is contained in:
local-model/engine-L2-grok-4.5 2026-09-19 14:33:58 +02:00
parent 05a457bf21
commit e032b8cbfa
No known key found for this signature in database
3 changed files with 390 additions and 137 deletions

View file

@ -376,6 +376,46 @@ static void place_showcase(Game *g, Faction human, Faction enemy) {
}
}
}
/* denser corridor fill HQ → primary clash: scrap mounds, rubble, rock outcrops
* so arid yellow plate is broken up (KKND2 wasteland read). */
{
int hx_t = sx, hy_t = sy;
int minx = hx_t < ctx ? hx_t : ctx;
int maxx = hx_t > ctx ? hx_t : ctx;
int miny = hy_t < cty ? hy_t : cty;
int maxy = hy_t > cty ? hy_t : cty;
minx -= 4; maxx += 6; miny -= 5; maxy += 4;
for (int ty = miny; ty <= maxy; ty++) {
for (int tx = minx; tx <= maxx; tx++) {
if (!map_in_bounds(&g->map, tx, ty)) continue;
Tile *t = map_tile(&g->map, tx, ty);
if (!t || t->occupied || !t->walkable) continue;
if (t->terrain == T_ROAD) continue;
/* keep clash-core scars already set */
if (t->terrain == T_RUBBLE || t->terrain == T_SCRAP) continue;
int dx = tx - hx_t, dy = ty - hy_t;
int h = (tx * 17 + ty * 13) & 15;
int along = abs((ty - hy_t) * (ctx - hx_t) - (tx - hx_t) * (cty - hy_t));
int span = abs(ctx - hx_t) + abs(cty - hy_t);
if (span < 1) span = 1;
/* band around approach road */
if (along > span * 3) continue;
if (h == 0 || h == 7) {
t->terrain = T_SCRAP;
t->scrap = (uint8_t)(95 + ((dx * 19 + dy * 11) & 127));
} else if (h == 2 || h == 9) {
t->terrain = T_RUBBLE;
t->scrap = 0;
} else if (h == 4 && ((tx + ty) & 3) == 0) {
/* sparse rock outcrops — non-walkable */
t->terrain = T_ROCK;
t->walkable = 0;
t->scrap = 0;
}
}
}
}
}
/* secondary clash front SE of HQ (second fight plate in crop) */
@ -417,6 +457,41 @@ static void place_showcase(Game *g, Faction human, Faction enemy) {
t->scrap = 0;
}
}
/* denser corridor fill HQ → secondary SE clash */
{
int hx_t = sx, hy_t = sy;
int minx = hx_t < ctx2 ? hx_t : ctx2;
int maxx = hx_t > ctx2 ? hx_t : ctx2;
int miny = hy_t < cty2 ? hy_t : cty2;
int maxy = hy_t > cty2 ? hy_t : cty2;
minx -= 3; maxx += 5; miny -= 3; maxy += 5;
for (int ty = miny; ty <= maxy; ty++) {
for (int tx = minx; tx <= maxx; tx++) {
if (!map_in_bounds(&g->map, tx, ty)) continue;
Tile *t = map_tile(&g->map, tx, ty);
if (!t || t->occupied || !t->walkable) continue;
if (t->terrain == T_ROAD || t->terrain == T_RUBBLE || t->terrain == T_SCRAP)
continue;
int dx = tx - hx_t, dy = ty - hy_t;
int h = (tx * 19 + ty * 11) & 15;
int along = abs((ty - hy_t) * (ctx2 - hx_t) - (tx - hx_t) * (cty2 - hy_t));
int span = abs(ctx2 - hx_t) + abs(cty2 - hy_t);
if (span < 1) span = 1;
if (along > span * 3) continue;
if (h == 1 || h == 8) {
t->terrain = T_SCRAP;
t->scrap = (uint8_t)(90 + ((dx * 23 + dy * 7) & 127));
} else if (h == 3 || h == 10) {
t->terrain = T_RUBBLE;
t->scrap = 0;
} else if (h == 5 && ((tx + ty) & 3) == 1) {
t->terrain = T_ROCK;
t->walkable = 0;
t->scrap = 0;
}
}
}
}
bld_spawn(g, BT_TURRET, human, ctx2 - 2, cty2);
bld_spawn(g, BT_TURRET, human, ctx2 + 1, cty2 + 1);
bld_spawn(g, BT_WALL, human, ctx2 - 3, cty2);