engine-c: denser melee roster + building damage FX at clash
Raid packs grow (raid[96]); Evolved MUTANT/BEAST wedges + Survivor INFANTRY screens; stronger battle-wear + scorch/crack/ember draw in snapshot/live.
This commit is contained in:
parent
125dcf837a
commit
c551b85912
3 changed files with 76 additions and 12 deletions
|
|
@ -128,23 +128,37 @@ void render_buildings(Game *g) {
|
|||
} else {
|
||||
SDL_RenderCopy(g->ren, tex, NULL, &r);
|
||||
}
|
||||
/* battle wear: scorch + crack lines when damaged */
|
||||
/* battle wear: scorch + cracks + rubble + ember (parity w/ snapshot) */
|
||||
if (b->build >= 1.0f && b->max_hp > 0 && b->hp < b->max_hp * 0.95f) {
|
||||
float dmg = 1.0f - (b->hp / b->max_hp);
|
||||
int pw = W / 4; if (pw < 4) pw = 4;
|
||||
int ph = H / 5; if (ph < 3) ph = 3;
|
||||
SDL_SetRenderDrawColor(g->ren, 42, 32, 22, (Uint8)(90 + (int)(dmg * 110)));
|
||||
SDL_RenderFillRect(g->ren, &(SDL_Rect){ sx + W / 4, sy + H / 3, pw, ph });
|
||||
if (dmg > 0.3f)
|
||||
if (dmg > 0.25f)
|
||||
SDL_RenderFillRect(g->ren, &(SDL_Rect){ sx + W / 2, sy + H / 2, pw, ph });
|
||||
if (dmg > 0.45f)
|
||||
SDL_RenderFillRect(g->ren, &(SDL_Rect){ sx + W / 6, sy + (H * 2) / 3, pw - 1, ph - 1 });
|
||||
SDL_SetRenderDrawColor(g->ren, 25, 22, 18, 255);
|
||||
SDL_RenderDrawLine(g->ren, sx + 4, sy + H / 4, sx + W / 2, sy + (H * 2) / 3);
|
||||
SDL_RenderDrawLine(g->ren, sx + W / 2, sy + (H * 2) / 3, sx + W - 4, sy + H / 3);
|
||||
SDL_RenderDrawLine(g->ren, sx + W / 5, sy + 4, sx + (W * 3) / 5, sy + H / 2);
|
||||
if (dmg > 0.5f) {
|
||||
SDL_RenderDrawLine(g->ren, sx + W / 3, sy + 2, sx + W / 3 + 4, sy + H - 2);
|
||||
SDL_RenderDrawLine(g->ren, sx + (W * 2) / 3, sy + H / 5, sx + W / 4, sy + H - 3);
|
||||
SDL_SetRenderDrawColor(g->ren, 90, 75, 55, 255);
|
||||
SDL_RenderFillRect(g->ren, &(SDL_Rect){ sx + 2, sy + H - 4, 6, 4 });
|
||||
SDL_RenderFillRect(g->ren, &(SDL_Rect){ sx + W - 10, sy + H - 5, 8, 5 });
|
||||
SDL_RenderFillRect(g->ren, &(SDL_Rect){ sx + W / 2 - 2, sy + H - 3, 6, 3 });
|
||||
}
|
||||
if (dmg > 0.65f) {
|
||||
SDL_SetRenderDrawColor(g->ren, 220, 110, 40, 220);
|
||||
SDL_RenderFillRect(g->ren, &(SDL_Rect){ sx + W / 2 - 1, sy + H / 2 - 1, 3, 3 });
|
||||
SDL_SetRenderDrawColor(g->ren, 255, 160, 60, 200);
|
||||
SDL_RenderFillRect(g->ren, &(SDL_Rect){ sx + W / 3 + 1, sy + (H * 2) / 3, 2, 2 });
|
||||
SDL_SetRenderDrawColor(g->ren, 40, 32, 24, 255);
|
||||
SDL_RenderFillRect(g->ren, &(SDL_Rect){ sx + 4, sy + 3, 3, 2 });
|
||||
SDL_RenderFillRect(g->ren, &(SDL_Rect){ sx + W - 8, sy + 4, 4, 3 });
|
||||
}
|
||||
}
|
||||
/* outlined HP strip (green→red) when damaged or selected */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue