From 8d2159ab709c57409605b796aacae52872545267 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Sat, 30 Nov 2019 06:10:33 +0000 Subject: [PATCH] SW: Implement Darts option, including bloody frames git-svn-id: https://svn.eduke32.com/eduke32@8338 1a8010ca-5511-0410-912e-c29ae57300e0 # Conflicts: # source/sw/src/menus.cpp # source/sw/src/panel.cpp # source/sw/src/sprite.cpp # source/sw/src/swconfig.cpp --- source/sw/src/draw.cpp | 6 +++--- source/sw/src/game.cpp | 3 ++- source/sw/src/game.h | 2 +- source/sw/src/menus.cpp | 5 +++++ source/sw/src/menus.h | 1 + source/sw/src/panel.cpp | 6 +++--- source/sw/src/settings.h | 1 + source/sw/src/sprite.cpp | 3 +-- source/sw/src/weapon.cpp | 2 +- 9 files changed, 18 insertions(+), 11 deletions(-) diff --git a/source/sw/src/draw.cpp b/source/sw/src/draw.cpp index 9d138852b..84934cff7 100644 --- a/source/sw/src/draw.cpp +++ b/source/sw/src/draw.cpp @@ -765,7 +765,7 @@ analyzesprites(int viewx, int viewy, int viewz, SWBOOL mirror) //#define DART_REPEAT 6 //#define DART_PIC 2233 - if (useDarts) + if (gs.Darts) if (tu->ID == 1793 || tsp->picnum == 1793) { tsp->picnum = 2519; @@ -777,7 +777,7 @@ analyzesprites(int viewx, int viewy, int viewz, SWBOOL mirror) #define DART_REPEAT 16 if (tu->ID == STAR1) { - if (useDarts) + if (gs.Darts) { tsp->picnum = DART_PIC; tsp->ang = NORM_ANGLE(tsp->ang - 512 - 24); @@ -841,7 +841,7 @@ analyzesprites(int viewx, int viewy, int viewz, SWBOOL mirror) } } - if (useDarts) + if (gs.Darts) if (tsp->statnum == STAT_STAR_QUEUE) { tsp->picnum = DART_PIC; diff --git a/source/sw/src/game.cpp b/source/sw/src/game.cpp index a3a3bb6c6..5c5a489d9 100644 --- a/source/sw/src/game.cpp +++ b/source/sw/src/game.cpp @@ -208,6 +208,7 @@ const GAME_SET gs_defaults = 0, // Color TRUE, // nuke "Track??", // waveform track name + FALSE, }; GAME_SET gs; @@ -3014,7 +3015,7 @@ Nuke -> 0=Off 1=On commit -map grenade -autonet 0,0,1,1,1,0,3,2,1,1 -name frank #endif -char isShareware = FALSE, useDarts = FALSE; +char isShareware = FALSE; int DetectShareware(void) { diff --git a/source/sw/src/game.h b/source/sw/src/game.h index 5aa48874b..da5d2ad94 100644 --- a/source/sw/src/game.h +++ b/source/sw/src/game.h @@ -50,7 +50,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms BEGIN_SW_NS //#define SW_SHAREWARE 1 // This determines whether game is shareware compile or not! -extern char isShareware, useDarts; +extern char isShareware; #define SW_SHAREWARE (isShareware) // Turn warning off for unreferenced variables. diff --git a/source/sw/src/menus.cpp b/source/sw/src/menus.cpp index 88aa9973d..73ca09cb1 100644 --- a/source/sw/src/menus.cpp +++ b/source/sw/src/menus.cpp @@ -397,6 +397,7 @@ MenuItem options_i[] = {DefButton(btn_auto_aim, 0, "Auto-Aiming"), OPT_XS, OPT_LINE(9), 1, m_defshade, 0, NULL, NULL, NULL}, {DefButton(btn_voxels, 0, "Voxel Sprites"), OPT_XS, OPT_LINE(10), 1, m_defshade, 0, NULL, NULL, NULL}, {DefButton(btn_stats, 0, "Level Stats"), OPT_XS, OPT_LINE(11), 1, m_defshade, 0, NULL, MNU_StatCheck, NULL}, + {DefButton(btn_darts, 0, "Use Darts"), OPT_XS, OPT_LINE(12), 1, m_defshade, 0, NULL, NULL, NULL}, {DefNone} }; @@ -1864,6 +1865,7 @@ MNU_InitMenus(void) buttonsettings[btn_playcd] = true;// gs.PlayCD; buttonsettings[btn_flipstereo] = snd_reversestereo; buttonsettings[btn_stats] = hud_stats; + buttonsettings[btn_darts] = gs.Darts; slidersettings[sldr_gametype] = gs.NetGameType; slidersettings[sldr_netlevel] = gs.NetLevel; @@ -2920,6 +2922,9 @@ void MNU_DoButton(MenuItem_p item, SWBOOL draw) case btn_stats: hud_stats = state = buttonsettings[item->button]; break; + case btn_darts: + gs.Darts = state = buttonsettings[item->button]; + break; case btn_markers: gs.NetSpawnMarkers = state = buttonsettings[item->button]; break; diff --git a/source/sw/src/menus.h b/source/sw/src/menus.h index 358935699..f05b5f4fb 100644 --- a/source/sw/src/menus.h +++ b/source/sw/src/menus.h @@ -212,6 +212,7 @@ typedef enum btn_markers, btn_teamplay, btn_friendlyfire,btn_parental,btn_nuke, btn_voxels, btn_stats, btn_playcd, btn_videofs, + btn_darts, btn_max } BTNType; diff --git a/source/sw/src/panel.cpp b/source/sw/src/panel.cpp index 823147ce3..21b0defb9 100644 --- a/source/sw/src/panel.cpp +++ b/source/sw/src/panel.cpp @@ -1822,7 +1822,7 @@ InitWeaponStar(PLAYERp pp) PlaySound(DIGI_PULL, &pp->posx, &pp->posy, &pp->posz, v3df_follow|v3df_dontpan); if (STD_RANDOM_RANGE(1000) > 900 && pp == Player+myconnectindex) { - if (!useDarts) + if (!gs.Darts) PlayerSound(DIGI_ILIKESHURIKEN,&pp->posx,&pp->posy,&pp->posz,v3df_follow|v3df_dontpan,pp); } @@ -7389,7 +7389,7 @@ pDisplaySprites(PLAYERp pp) picnum = psp->picndx; // UK panzies have to have darts instead of shurikens. - if (useDarts) + if (gs.Darts) switch (picnum) { case STAR_REST: @@ -7453,7 +7453,7 @@ pDisplaySprites(PLAYERp pp) case STAR_REST: case 2510: - if (!useDarts) + if (!gs.Darts) picnum = 2138; else picnum = 2518; // Bloody Dart Hand diff --git a/source/sw/src/settings.h b/source/sw/src/settings.h index c63f880d8..579743cf7 100644 --- a/source/sw/src/settings.h +++ b/source/sw/src/settings.h @@ -46,6 +46,7 @@ typedef struct SWBOOL NetNuke; //SWBOOL PlayCD; // Not implemented and no idea how to support it without the music assets. char WaveformTrackName[MAXWAVEFORMTRACKLENGTH]; + SWBOOL Darts; } GAME_SET, *GAME_SETp; extern const GAME_SET gs_defaults; diff --git a/source/sw/src/sprite.cpp b/source/sw/src/sprite.cpp index 3a7940bdf..a5d6da53a 100644 --- a/source/sw/src/sprite.cpp +++ b/source/sw/src/sprite.cpp @@ -5959,8 +5959,7 @@ KeyMain: if (pp->WpnAmmo[WPN_STAR] >= DamageData[WPN_STAR].max_ammo) break; - //if (useDarts) sprintf(ds,"Darts"); - //else sprintf(ds,"Shurikens"); + sprintf(ds, gs.Darts ? "Darts" : "Shurikens"); PutStringInfo(Player+pnum, DamageData[WPN_STAR].weapon_name); PlayerUpdateAmmo(pp, WPN_STAR, DamageData[WPN_STAR].weapon_pickup); SetFadeAmt(pp,ITEMFLASHAMT,ITEMFLASHCLR); // Flash blue on item pickup diff --git a/source/sw/src/weapon.cpp b/source/sw/src/weapon.cpp index e92139b8a..fdfcd7b56 100644 --- a/source/sw/src/weapon.cpp +++ b/source/sw/src/weapon.cpp @@ -7492,7 +7492,7 @@ const char *DeathString(short SpriteNum) case 5011: return "blade"; case STAR1: - if (useDarts) return "dart"; + if (gs.Darts) return "dart"; else return "shuriken"; case CROSSBOLT: return "crossbow bolt";