diff --git a/source/client/defs/custom.qc b/source/client/defs/custom.qc index 1215380..fe4fda0 100644 --- a/source/client/defs/custom.qc +++ b/source/client/defs/custom.qc @@ -83,6 +83,8 @@ float useprint_weapon; float useprint_cost; float useprint_time; +float bettyprompt_time; + string scrolltext; float stext; float scrollopacity; diff --git a/source/client/hud.qc b/source/client/hud.qc index e8b8ea8..8b380da 100644 --- a/source/client/hud.qc +++ b/source/client/hud.qc @@ -1088,6 +1088,39 @@ void(float width, float height) HUD_Weaponstring = drawstring([x - GetUltraWideOffset(), g_height - 49], weaponstring, [12, 12], [1, 1, 1], 1, 0); } +/********************* +* HUD Bouncing Betty * +*********************/ + +void(float width, float height) HUD_BouncingBetty = +{ + float top_x, bot_x, but_x; + string betty_key; + string betty_space; + string activate_string, activate_string2; + + tokenize(findkeysforcommand("impulse 33")); + betty_key = strtoupper(keynumtostring(stof(argv(0)))); + + betty_space = ""; + for(float i = 0; i < strlen(betty_key); i++) { + betty_space = strcat(betty_space, " "); + } + + activate_string = strcat("Press ", betty_space, " to place a"); + activate_string2 = "Bouncing Betty"; + + top_x = (g_width/2) - (stringwidth(activate_string, 0, [12, 12])/2); + bot_x = (g_width/2) - (stringwidth(activate_string2, 0, [12, 12])/2); + + drawstring([top_x, g_height - 303], activate_string, [12, 12], [1, 1, 1], 1, 0); + drawstring([bot_x, g_height - 289], activate_string2, [12, 12], [1, 1, 1], 1, 0); + + // Draw the highlighted button + but_x = top_x + stringwidth("Press ", 0, [12, 12, 0]); + drawstring([but_x, g_height - 303], betty_key, [12, 12], [1, 1, 0], 1, 0); +} + /******************* * HUD Progress Bar * *******************/ @@ -1590,6 +1623,9 @@ void(float width, float height) HUD_Draw = if (vmodel.model == GetWeaponModel(getstatf(STAT_ACTIVEWEAPON), FALSE) && vmodel.model != "") HUD_AmmoString(); + + if (bettyprompt_time > time) + HUD_BouncingBetty(width, height); if (HUD_Change_time > time) { diff --git a/source/client/main.qc b/source/client/main.qc index 0b07a78..2d6ba57 100644 --- a/source/client/main.qc +++ b/source/client/main.qc @@ -1209,6 +1209,9 @@ noref void() CSQC_Parse_Event = case EVENT_GRENADEPULSE: crosshair_pulse_grenade = true; break; + case EVENT_BETTYPROMPT: + bettyprompt_time = time + 4; + break; case EVENT_WEAPONUPDATE: float wepnum = readbyte(); string wepname = readstring(); diff --git a/source/server/clientfuncs.qc b/source/server/clientfuncs.qc index 1471227..9b744e1 100644 --- a/source/server/clientfuncs.qc +++ b/source/server/clientfuncs.qc @@ -333,6 +333,18 @@ void(entity who) grenade_pulse = } #endif // FTE +#ifdef FTE + +void(entity who) nzp_bettyprompt = +{ + WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET); + WriteByte(MSG_MULTICAST, EVENT_BETTYPROMPT); + msg_entity = who; + multicast('0 0 0', MULTICAST_ONE); +} + +#endif // FTE + void(entity who) UpdatePunchangle = { #ifdef FTE diff --git a/source/server/defs/standard.qc b/source/server/defs/standard.qc index 75865cb..8200678 100644 --- a/source/server/defs/standard.qc +++ b/source/server/defs/standard.qc @@ -268,6 +268,7 @@ void (string trackname) void () nzp_maxammo = #501; void (entity who) grenade_pulse = #502; float () nzp_maxai = #503; +void (entity who) nzp_bettyprompt = #504; // // constants diff --git a/source/server/entities/wall_weapon.qc b/source/server/entities/wall_weapon.qc index f6e0427..0a23664 100644 --- a/source/server/entities/wall_weapon.qc +++ b/source/server/entities/wall_weapon.qc @@ -275,6 +275,7 @@ void () WallWeapon_TouchTrigger = addmoney(other, 0 - self.cost2, FALSE); other.grenades = other.grenades | 2; other.secondary_grenades = 2; + nzp_bettyprompt(other); if (self.enemy) { oldent = self; diff --git a/source/shared/defs/custom.qc b/source/shared/defs/custom.qc index fd1c9ad..1056d01 100644 --- a/source/shared/defs/custom.qc +++ b/source/shared/defs/custom.qc @@ -56,6 +56,7 @@ const float EVENT_REVIVECHANGE = 39; const float EVENT_WEAPONRECOIL = 40; const float EVENT_SONGPLAY = 41; const float EVENT_GRENADEPULSE = 42; +const float EVENT_BETTYPROMPT = 43; // Define our FTE platform #ifndef STANDARD