From adaaea29510c95663c4ea06e8c89a712bfee420b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 21 May 2020 00:23:55 +0200 Subject: [PATCH] - displayflamethrower --- source/games/duke/src/hudweapon_d.cpp | 41 +++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/source/games/duke/src/hudweapon_d.cpp b/source/games/duke/src/hudweapon_d.cpp index 885b89ebd..aac548bc7 100644 --- a/source/games/duke/src/hudweapon_d.cpp +++ b/source/games/duke/src/hudweapon_d.cpp @@ -1345,6 +1345,43 @@ void displayweapon_d(int snum) // //--------------------------------------------------------------------------- + auto displayflamethrower = [&]() + { + if (sprite[p->i].pal == 1) + pal = 1; + else + { + if (p->cursectnum < 0) + pal = 0; + else + pal = sector[p->cursectnum].floorpal; + } + + if (*kb < 1 || sector[p->cursectnum].lotag == 2) + { + hud_drawpal(weapon_xoffset + 210 - (p->look_ang >> 1), looking_arc + 261 - gun_pos, FLAMETHROWER, gs, o, pal); + hud_drawpal(weapon_xoffset + 210 - (p->look_ang >> 1), looking_arc + 261 - gun_pos, FLAMETHROWERPILOT, gs, o, pal); + } + else + { + static const uint8_t cat_frames[] = { 0, 0, 1, 1, 2, 2 }; + if (sprite[p->i].pal != 1) + { + weapon_xoffset += krand() & 1; + looking_arc += krand() & 1; + } + gun_pos -= 16; + hud_drawpal(weapon_xoffset + 210 - (p->look_ang >> 1), looking_arc + 261 - gun_pos, FLAMETHROWER + 1, 32, o, pal); + hud_drawpal(weapon_xoffset + 210 - (p->look_ang >> 1), looking_arc + 235 - gun_pos, FLAMETHROWER + 2 + cat_frames[*kb % 6], -32, o, pal); + } + }; + + //--------------------------------------------------------------------------- + // + // + // + //--------------------------------------------------------------------------- + switch (cw) { @@ -1400,6 +1437,10 @@ void displayweapon_d(int snum) if (isWW2GI()) displaygrower_ww(); else displayshrinker(); break; + + case FLAMETHROWER_WEAPON: + displayflamethrower(); + break; } }