engine-c: wreck draw + type variety + clash seed for KKND2 battlefield
Snapshot/live wreck silhouettes (type-aware hulls, scorch/smoke), seed ~22 clash wrecks in place_showcase, reset wreck ring on match setup.
This commit is contained in:
parent
252cfd8175
commit
d54d38e8df
5 changed files with 176 additions and 5 deletions
|
|
@ -121,6 +121,46 @@ static void place_start(Game *g, Faction f) {
|
|||
|
||||
/* KKND2-like showcase: extra human base structures + diverse roster +
|
||||
* enemy raid pack near the camera so fog/snapshot show combat. */
|
||||
/* Seed a battlefield wreck (type-aware hulls drawn in snapshot/live render). */
|
||||
static void spawn_showcase_wreck(Game *g, UnitType type, Faction faction,
|
||||
float x, float y, float rot) {
|
||||
if (g->wreck_count >= MAX_WRECKS) return;
|
||||
Wreck *w = &g->wrecks[g->wreck_next];
|
||||
w->x = x; w->y = y; w->type = type;
|
||||
w->faction = faction; w->rot = rot;
|
||||
g->wreck_next = (g->wreck_next + 1) % MAX_WRECKS;
|
||||
if (g->wreck_count < MAX_WRECKS) g->wreck_count++;
|
||||
}
|
||||
|
||||
/* ~22 charred hulls around primary + secondary clash for KKND2 plate shots. */
|
||||
static void seed_clash_wrecks(Game *g, Faction human, Faction enemy,
|
||||
float rx, float ry, float rx2, float ry2) {
|
||||
/* primary NE clash — mixed sides, varied chassis */
|
||||
spawn_showcase_wreck(g, UT_TANK, human, rx - 22, ry + 8, 0.6f);
|
||||
spawn_showcase_wreck(g, UT_TANK, enemy, rx + 14, ry - 12, 2.4f);
|
||||
spawn_showcase_wreck(g, UT_RAVAGER, enemy, rx + 28, ry + 6, 1.1f);
|
||||
spawn_showcase_wreck(g, UT_BUGGY, human, rx - 8, ry - 18, 3.5f);
|
||||
spawn_showcase_wreck(g, UT_BUGGY, enemy, rx + 6, ry + 20, 0.2f);
|
||||
spawn_showcase_wreck(g, UT_JEEP, human, rx - 30, ry - 4, 4.8f);
|
||||
spawn_showcase_wreck(g, UT_ARTILLERY, human, rx - 40, ry + 16, 5.2f);
|
||||
spawn_showcase_wreck(g, UT_FLAME, enemy, rx + 36, ry - 8, 2.0f);
|
||||
spawn_showcase_wreck(g, UT_MISSILE, enemy, rx + 18, ry + 28, 1.7f);
|
||||
spawn_showcase_wreck(g, UT_INFANTRY, human, rx - 14, ry + 24, 0.9f);
|
||||
spawn_showcase_wreck(g, UT_INFANTRY, enemy, rx + 4, ry - 26, 3.1f);
|
||||
spawn_showcase_wreck(g, UT_MUTANT, enemy, rx + 22, ry + 14, 4.2f);
|
||||
spawn_showcase_wreck(g, UT_BEAST, enemy, rx + 42, ry + 10, 0.4f);
|
||||
spawn_showcase_wreck(g, UT_HARVESTER, human, rx - 48, ry - 10, 5.9f);
|
||||
/* secondary SE clash */
|
||||
spawn_showcase_wreck(g, UT_TANK, human, rx2 - 16, ry2 + 6, 1.3f);
|
||||
spawn_showcase_wreck(g, UT_TANK, enemy, rx2 + 12, ry2 - 8, 3.8f);
|
||||
spawn_showcase_wreck(g, UT_BUGGY, enemy, rx2 + 22, ry2 + 14, 0.7f);
|
||||
spawn_showcase_wreck(g, UT_JEEP, human, rx2 - 24, ry2 - 4, 2.6f);
|
||||
spawn_showcase_wreck(g, UT_FLAME, human, rx2 - 8, ry2 + 18, 4.5f);
|
||||
spawn_showcase_wreck(g, UT_RAVAGER, enemy, rx2 + 30, ry2 + 4, 1.9f);
|
||||
spawn_showcase_wreck(g, UT_INFANTRY, human, rx2 + 4, ry2 - 16, 5.5f);
|
||||
spawn_showcase_wreck(g, UT_MUTANT, enemy, rx2 + 16, ry2 + 22, 0.1f);
|
||||
}
|
||||
|
||||
static void place_showcase(Game *g, Faction human, Faction enemy) {
|
||||
int sx = g->map.spawn_x[human], sy = g->map.spawn_y[human];
|
||||
float wx, wy; map_tile_to_world(sx, sy, &wx, &wy);
|
||||
|
|
@ -672,6 +712,9 @@ static void place_showcase(Game *g, Faction human, Faction enemy) {
|
|||
unit_select_single(g, i, 1);
|
||||
nsel++;
|
||||
}
|
||||
|
||||
/* lasting hulls already on the plate (SHOT_T too short for natural deaths) */
|
||||
seed_clash_wrecks(g, human, enemy, rx, ry, rx2, ry2);
|
||||
}
|
||||
|
||||
void engine_setup_match(Game *g, int mission_id) {
|
||||
|
|
@ -695,6 +738,7 @@ void engine_setup_match(Game *g, int mission_id) {
|
|||
g->unit_count = 0; g->unit_next_id = 1;
|
||||
g->bld_count = 0; g->bld_next_id = 1;
|
||||
g->bullet_count = 0; g->particle_count = 0;
|
||||
g->wreck_count = 0; g->wreck_next = 0;
|
||||
g->sel_count = 0; g->placing = 0;
|
||||
g->time = 0; g->frames = 0; g->winner = 0;
|
||||
g->ai_timer = 5.0f;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue