Skip to content

Commit c215f57

Browse files
authored
Merge pull request #129 from nzp-team/cypress_8p
GLOBAL: Implement 8 player support, custom games, game mode support
2 parents fe4c631 + f24eefe commit c215f57

54 files changed

Lines changed: 2553 additions & 279 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

progs/menu.src

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ menu_aces.qc // Accessibility Menu
2323
menu_cred.qc // Credits Menu
2424
menu_load.qc // Loading Screen
2525
menu_coop.qc // Co-op Menu
26+
menu_gset.qc // Game Settings
27+
menu_loby.qc // Lobby Menu
2628

2729
main.qc
2830
#endlist

progs/ssqc.src

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ ai/zombie_core.qc
7979
ai/crawler_core.qc
8080
ai/dog_core.qc
8181
utilities/map_compatibility.qc
82+
gamemodes/gun_game.qc
83+
gamemodes/hardcore.qc
84+
gamemodes/wild_west.qc
85+
gamemodes/sticks_and_stones.qc
86+
gamemodes/core.qc
8287
#ifdef QUAKEC_TEST
8388
tests/test_math.qc
8489
tests/test_perksacola.qc

source/client/defs/custom.qc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ float useprint_weapon;
4747
float useprint_cost;
4848
float useprint_time;
4949

50+
float active_gamemode;
51+
5052
float bettyprompt_time;
5153

5254
float hud_maxammo_endtime;
@@ -67,11 +69,13 @@ float broadcast_num;
6769

6870
string character_name;
6971

72+
#define MAX_REVIVE_ICONS 16
73+
7074
var struct revive_s {
7175
float draw;
7276
float timer;
7377
float state;
74-
} revive_icons[4]; // MAX_CLIENTS
78+
} revive_icons[MAX_REVIVE_ICONS];
7579

7680
float weaponframetime;
7781
float weapon2frametime;

source/client/hud.qc

Lines changed: 105 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -553,10 +553,10 @@ void() HUD_Rounds =
553553
}
554554
}
555555

556-
Draw_String([3 + GetUltraWideOffset(), g_height/2 + 24], chaptertitle, [12, 12], [1, 1, 1], localpha, 0);
557-
Draw_String([3 + GetUltraWideOffset(), g_height/2 + 36], location, [12, 12], [1, 1, 1], localpha, 0);
558-
Draw_String([3 + GetUltraWideOffset(), g_height/2 + 48], date, [12, 12], [1, 1, 1], localpha, 0);
559-
Draw_String([3 + GetUltraWideOffset(), g_height/2 + 60], person, [12, 12], [1, 1, 1], localpha, 0);
556+
Draw_String([g_width - 3 - GetUltraWideOffset() - getTextWidth(chaptertitle, 12), g_height/2 + 48], chaptertitle, [12, 12], [1, 1, 1], localpha, 0);
557+
Draw_String([g_width - 3 - GetUltraWideOffset() - getTextWidth(location, 12), g_height/2 + 60], location, [12, 12], [1, 1, 1], localpha, 0);
558+
Draw_String([g_width - 3 - GetUltraWideOffset() - getTextWidth(date, 12), g_height/2 + 72], date, [12, 12], [1, 1, 1], localpha, 0);
559+
Draw_String([g_width - 3 - GetUltraWideOffset() - getTextWidth(person, 12), g_height/2 + 84], person, [12, 12], [1, 1, 1], localpha, 0);
560560
}
561561

562562
if (rounds_change == 1)//this is the rounds icon at the middle of the screen
@@ -1095,7 +1095,7 @@ void() HUD_Useprint =
10951095
usestring = "The Power must be Activated first";
10961096
break;
10971097
case 9://perk
1098-
usestring = strcat("Hold ",usespace, " to buy ", GetPerkName(useprint_weapon));
1098+
usestring = strcat("Hold ",usespace, " to buy ", GetItemName(useprint_weapon));
10991099
usecost = strcat("[Cost: ", ftos(useprint_cost), "]");
11001100
break;
11011101
case 10://turn on power
@@ -1135,14 +1135,27 @@ void() HUD_Useprint =
11351135
usestring = strcat("Hold ", usespace, " to End the Game");
11361136
usecost = strcat("[Cost: ", ftos(useprint_cost), "]");
11371137
break;
1138+
case 21: // Magic disabled
1139+
usestring = "...";
1140+
break;
1141+
case 22: // Jugger-Nog (NIGHTMARE)
1142+
usestring = "It doesn't seem to be working..";
1143+
break;
1144+
case 23: // Tactical Nuke (Gun Game)
1145+
usestring = strcat("Hold ", usespace, " to Drop the Nuke");
1146+
break;
11381147
default:
11391148
usestring = "This should not happen you dum fuck"; //yikes
11401149
break;
11411150
}
11421151

11431152
print_width = getTextWidth(usestring, 12);
11441153
x = (g_width - print_width)/2;
1145-
HUD_DrawStringWithBackdrop([x, g_height/2 + 65, 0], usestring, [12, 12, 0], [1, 1, 1], 1, 0);
1154+
1155+
if (useprint_type == 22)
1156+
HUD_DrawStringWithBackdrop([x, g_height/2 + 65, 0], usestring, [12, 12, 0], [1, 0, 0], 1, 0);
1157+
else
1158+
HUD_DrawStringWithBackdrop([x, g_height/2 + 65, 0], usestring, [12, 12, 0], [1, 1, 1], 1, 0);
11461159

11471160
// Draw "Cost" text.
11481161
if (usecost != "") {
@@ -1643,6 +1656,12 @@ void() HUD_Broadcast =
16431656
case CSQC_BROADCAST_REVIVINGPLAYER:
16441657
broadcast_msg = strcat("Reviving ", broadcast_name);
16451658
break;
1659+
case CSQC_BROADCAST_GUNGAMEADVANCEMENT:
1660+
broadcast_msg = strcat(broadcast_name, " reached a new tier!");
1661+
break;
1662+
case CSQC_BROADCAST_GUNGAMEWINNER:
1663+
broadcast_msg = strcat(broadcast_name, " can Activate the Nuke!");
1664+
break;
16461665
case CSQC_BROADCAST_NONE:
16471666
broadcast_msg = "";
16481667
break;
@@ -2044,6 +2063,25 @@ void() HUD_Spectator =
20442063
drawfill([5, 60], [240, 3], [0.3, 0.3, 0.3], 1, 0);
20452064
}
20462065

2066+
void() HUD_GunGame =
2067+
{
2068+
drawfill([g_width/2 - 318, 4], [636, 45], [0, 0, 0], cvar("cl_textopacity"), 0);
2069+
2070+
string weapon_id = "";
2071+
string point_info = "";
2072+
2073+
if (getstatf(STAT_GUNGAME_IDX) >= 100) {
2074+
weapon_id = "You've passed all weapons!";
2075+
point_info = "The Winner can choose to End the Game";
2076+
} else {
2077+
weapon_id = sprintf("%s [%d/32]", GetWeaponName(getstatf(STAT_ACTIVEWEAPON)), getstatf(STAT_GUNGAME_IDX) + 1);
2078+
point_info = sprintf("[%d] Score until next Weapon", getstatf(STAT_GUNGAME_SCOREGOAL) - getstatf(STAT_TOTALSCORE));
2079+
}
2080+
2081+
Draw_String([g_width/2 - getTextWidth(weapon_id, 18)/2, 8], weapon_id, [18, 18], [1, 1, 1], 1, 0);
2082+
Draw_String([g_width/2 - getTextWidth(point_info, 12)/2, 30], point_info, [12, 12], [1, 1, 0], 1, 0);
2083+
}
2084+
20472085
void() HUD_PlayerNames =
20482086
{
20492087
for (float i = 7; i >= 0; i = i - 1) {
@@ -2262,6 +2300,54 @@ void() HUD_DrawElementsForWaypointMode =
22622300
HUD_PlayerDebugInfo();
22632301
};
22642302

2303+
//
2304+
// HUD_DrawElementsForHardcorePlayer()
2305+
// Heads-Up Display draw logic during Hardcore mode.
2306+
//
2307+
void() HUD_DrawElementsForHardcorePlayer =
2308+
{
2309+
// We shouldn't draw anything during the game intro fade.
2310+
if (screenflash_color == SCREENFLASH_COLOR_BLACK && screenflash_duration > time) {
2311+
HUD_Screenflash();
2312+
return;
2313+
}
2314+
2315+
// Blood filter on screen to indicate health.
2316+
HUD_Health();
2317+
2318+
// If the scoreboard is open, only draw it and nothing else.
2319+
if (score_show) {
2320+
HUD_Scores();
2321+
return;
2322+
}
2323+
// Additionally, bail here if cl_cinematic is set.
2324+
else if (cvar("cl_cinematic")) {
2325+
return;
2326+
}
2327+
2328+
// Being scoped-in hides all low-priority elements.
2329+
if (getstatf(STAT_WEAPONZOOM) != 2 || zoom_2_time >= time) {
2330+
// Draws all player's points.
2331+
HUD_Points();
2332+
}
2333+
2334+
// Visual hit Feedback.
2335+
HUD_Hitmark();
2336+
2337+
// Black/White/etc. total screen flashes.
2338+
HUD_Screenflash();
2339+
2340+
//
2341+
// Everything below should always have maximum priority.
2342+
//
2343+
2344+
// Revive indicator for Players in Last Stand.
2345+
HUD_ReviveIcons();
2346+
2347+
// "X" needs to be revived, or other important messages.
2348+
HUD_Broadcast();
2349+
};
2350+
22652351
//
22662352
// HUD_DrawElementsForPlayer()
22672353
// Heads-Up Display draw logic during normal play.
@@ -2329,6 +2415,11 @@ void() HUD_DrawElementsForPlayer =
23292415
// Bouncing Betty tutorial.
23302416
HUD_BouncingBetty();
23312417

2418+
switch(active_gamemode) {
2419+
case GAMEMODE_GUNGAME: HUD_GunGame(); break;
2420+
default: break;
2421+
}
2422+
23322423
// Revive status progress bar.
23332424
HUD_Progressbar();
23342425
}
@@ -2398,6 +2489,14 @@ void() HUD_DrawElements =
23982489
return;
23992490
}
24002491

2492+
//
2493+
// Hardcore Mode has a more limited HUD
2494+
//
2495+
if (active_gamemode == GAMEMODE_HARDCORE) {
2496+
HUD_DrawElementsForHardcorePlayer();
2497+
return;
2498+
}
2499+
24012500
//
24022501
// Standard Play
24032502
//

source/client/main.qc

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
Boston, MA 02111-1307, USA
2525
2626
*/
27-
2827
float need_vid_reload;
2928

3029
void() ToggleMenu =
@@ -461,6 +460,7 @@ noref void(float isnew) CSQC_Ent_Update =
461460
if (isnew == TRUE) {
462461
self.classname = "item_powerup";
463462
self.solid = SOLID_NOT;
463+
self.effects = EF_FULLBRIGHT;
464464
self.predraw = PU_PreDraw;
465465
self.drawmask = MASK_ENGINE;
466466
}
@@ -1074,6 +1074,9 @@ noref void() CSQC_Parse_Event =
10741074
if (cvar("in_rumbleenabled"))
10751075
gp_rumble(last_input_deviceid, low_frequency, high_frequency, duration);
10761076
break;
1077+
case CSQC_EVENT_SETGAMEMODE:
1078+
active_gamemode = readbyte();
1079+
break;
10771080
case EVENT_WEAPONRECOIL:
10781081
local vector rec;
10791082
rec_x = readcoord()/5;
@@ -1161,8 +1164,35 @@ noref void() CSQC_Parse_Event =
11611164
date = readstring();
11621165
person = readstring();
11631166

1164-
if (chaptertitle == "")
1165-
chaptertitle = "'Nazi Zombies'";
1167+
switch(active_gamemode) {
1168+
case GAMEMODE_CLASSIC:
1169+
if (chaptertitle == "")
1170+
chaptertitle = "'Nazi Zombies'";
1171+
break;
1172+
case GAMEMODE_GUNGAME:
1173+
chaptertitle = "GUN GAME";
1174+
location = "Cycle all Weapons to WIN!";
1175+
date = "";
1176+
person = "";
1177+
break;
1178+
case GAMEMODE_HARDCORE:
1179+
chaptertitle = "HARDCORE";
1180+
break;
1181+
case GAMEMODE_STICKSNSTONES:
1182+
chaptertitle = "STICKS & STONES";
1183+
location = "Ballistic Knife FTW!";
1184+
date = "";
1185+
person = "";
1186+
break;
1187+
case GAMEMODE_WILDWEST:
1188+
chaptertitle = "WILD WEST";
1189+
location = "It's a stand-off!";
1190+
date = "";
1191+
person = "";
1192+
break;
1193+
default:
1194+
break;
1195+
}
11661196
break;
11671197
case EVENT_PLAYERUPDATE:
11681198
player_count = readbyte();

source/client/view_model.qc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,11 @@ void(entity viewent) ViewModel_Animate =
176176
// make sure to update the HUD.
177177
if (getmodelindex(GetWeaponModel(getstatf(STAT_ACTIVEWEAPON), false)) == viewent.modelindex)
178178
HUD_Change_time = time + 7;
179-
180-
// Update the skin.
181-
viewent.skin = getstatf(STAT_WEAPONSKIN);
182179
}
183180

181+
// Update the skin.
182+
viewent.skin = getstatf(STAT_WEAPONSKIN);
183+
184184
// Server requested a frame change
185185
if (new_frame != viewent.frame) {
186186
viewent.frame2 = viewent.frame;

source/menu/defs/menu_defs.qc

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ string menu_background;
88
float menu_changetime;
99
float menu_starttime;
1010

11+
string current_selected_bsp;
1112

13+
float last_map_menu;
1214
float current_menu;
1315
float running_platform;
1416

@@ -56,11 +58,14 @@ enum {
5658
MENU_BINDINGS,
5759
MENU_ACCESSIBILITY,
5860
MENU_CREDITS,
59-
MENU_PAUSE
61+
MENU_PAUSE,
62+
MENU_LOBBY,
63+
MENU_GAMESETTINGS
6064
};
6165

6266
#define MENU_SND_NAVIGATE 0
6367
#define MENU_SND_ENTER 1
68+
#define MENU_SND_BEEP 2
6469
void(float type) Menu_PlaySound;
6570

6671
#ifdef MENU
@@ -73,6 +78,8 @@ void() Menu_Coop_Browse;
7378
void() Menu_Coop_Direct;
7479
void() Menu_Coop_Create;
7580
void() Menu_Credits;
81+
void() Menu_Lobby;
82+
void() Menu_GameSettings;
7683

7784
#else
7885

@@ -108,6 +115,12 @@ string(string next_id) Menu_Coop_GetPreviousButton;
108115
string(string prev_id) Menu_Maps_GetNextButton;
109116
string(string next_id) Menu_Maps_GetPreviousButton;
110117

118+
string(string prev_id) Menu_Lobby_GetNextButton;
119+
string(string next_id) Menu_Lobby_GetPreviousButton;
120+
121+
string(string prev_id) Menu_GameSettings_GetNextButton;
122+
string(string next_id) Menu_GameSettings_GetPreviousButton;
123+
111124
#else
112125

113126
string(string prev_id) Menu_Pause_GetNextButton;

0 commit comments

Comments
 (0)