Added missing escape-zone, vip-zone and defusal-kit HUD icons

This commit is contained in:
Marco Cawthorne 2019-01-05 20:28:31 +01:00
parent 7f45e566ed
commit 09667d161c
8 changed files with 57 additions and 21 deletions

View file

@ -168,16 +168,38 @@ Draw icons such as hostage, bomb and buyzones
=================
*/
void HUD_DrawIcons(void) {
vector iconpos;
iconpos = vVideoMins + [16, (vVideoResolution[1] / 2) - 24];
// Defusal Kit Icon (64, 148)
if (getstatf(STAT_EQUIPMENT) & EQUIPMENT_DEFUSALKIT) {
drawsubpic(iconpos, [32,32], HUD_NUMFILE_LAYER, [0.25, 0.578125], [0.125, 0.125], [0,1,0], 1, DRAWFLAG_ADDITIVE);
iconpos[1] += 32;
}
// BuyZone Icon
if(getstatf(STAT_BUYZONE) == TRUE) {
vector vBuyIconPos = vVideoMins + [16, (vVideoResolution[1] / 2) - 12];
drawsubpic(vBuyIconPos, [32,32], HUD_NUMFILE_LAYER, [0.125 * 3, 0.125 * 5 - 0.046875], [0.125, 0.125], [0,1,0], 1, DRAWFLAG_ADDITIVE);
if (getstatf(STAT_BUYZONE) == TRUE) {
drawsubpic(iconpos, [32,32], HUD_NUMFILE_LAYER, [0.125 * 3, 0.125 * 5 - 0.046875], [0.125, 0.125], [0,1,0], 1, DRAWFLAG_ADDITIVE);
iconpos[1] += 32;
}
// Hostage-Rescue Area Icon
if(getstatf(STAT_HOSTAGEZONE) == TRUE) {
vector vRIconPos = vVideoMins + [16, (vVideoResolution[1] / 2) + 24];
drawsubpic(vRIconPos, [32,32], HUD_NUMFILE_LAYER, [0.125 * 2, 0.125 * 5 - 0.046875], [0.125, 0.125], [0,1,0], 1, DRAWFLAG_ADDITIVE);
if (getstatf(STAT_HOSTAGEZONE) == TRUE) {
drawsubpic(iconpos, [32,32], HUD_NUMFILE_LAYER, [0.125 * 2, 0.125 * 5 - 0.046875], [0.125, 0.125], [0,1,0], 1, DRAWFLAG_ADDITIVE);
iconpos[1] += 32;
}
// Escape Zone Icon (128, 148)
if (getstatf(STAT_ESCAPEZONE) == TRUE) {
drawsubpic(iconpos, [32,32], HUD_NUMFILE_LAYER, [0.5, 0.578125], [0.125, 0.125], [0,1,0], 1, DRAWFLAG_ADDITIVE);
iconpos[1] += 32;
}
// VIP Zone Icon (160, 148)
if (getstatf(STAT_VIPZONE) == TRUE) {
drawsubpic(iconpos, [32,32], HUD_NUMFILE_LAYER, [0.625, 0.578125], [0.125, 0.125], [0,1,0], 1, DRAWFLAG_ADDITIVE);
iconpos[1] += 32;
}
// Bomb-Area
@ -185,11 +207,12 @@ void HUD_DrawIcons(void) {
if (getstatf(STAT_SLOT_GRENADE) == WEAPON_C4BOMB) {
if (getstatf(STAT_BOMBZONE) == TRUE) {
float fAlpha = fabs(sin(time * 20));
drawsubpic(vBIconPos, [32,32], HUD_NUMFILE_LAYER, [0, 0.125 * 5 - 0.046875], [0.125, 0.125], [1,0,0], fAlpha, DRAWFLAG_ADDITIVE);
drawsubpic(vBIconPos, [32,32], HUD_NUMFILE_LAYER, [0, 0.125 * 5 - 0.046875], [0.125, 0.125], [0,1,0], 1 - fAlpha, DRAWFLAG_ADDITIVE);
drawsubpic(iconpos, [32,32], HUD_NUMFILE_LAYER, [0, 0.125 * 5 - 0.046875], [0.125, 0.125], [1,0,0], fAlpha, DRAWFLAG_ADDITIVE);
drawsubpic(iconpos, [32,32], HUD_NUMFILE_LAYER, [0, 0.125 * 5 - 0.046875], [0.125, 0.125], [0,1,0], 1 - fAlpha, DRAWFLAG_ADDITIVE);
} else {
drawsubpic(vBIconPos, [32,32], HUD_NUMFILE_LAYER, [0, 0.125 * 5 - 0.046875], [0.125, 0.125], [0,1,0], 1, DRAWFLAG_ADDITIVE);
drawsubpic(iconpos, [32,32], HUD_NUMFILE_LAYER, [0, 0.125 * 5 - 0.046875], [0.125, 0.125], [0,1,0], 1, DRAWFLAG_ADDITIVE);
}
iconpos[1] += 32;
}
}

View file

@ -61,6 +61,8 @@ enum {
enum {
STAT_BUYZONE = 34,
STAT_ESCAPEZONE,
STAT_VIPZONE,
STAT_HOSTAGEZONE,
STAT_BOMBZONE,
STAT_MONEY,

View file

@ -204,6 +204,8 @@ void SV_RunClientCommand( void ) {
self.fInBombZone = FALSE;
self.fInBuyZone = FALSE;
self.fInHostageZone = FALSE;
self.fInEscapeZone = FALSE;
self.fInVIPZone = FALSE;
QPhysics_Run( self );

View file

@ -51,6 +51,8 @@
.float fInBuyZone;
.float fInHostageZone;
.float fInBombZone;
.float fInEscapeZone;
.float fInVIPZone;
.float fMoney;
.float fStepTime;
.int iInGame;

View file

@ -624,17 +624,18 @@ void worldspawn( void ) {
lightstyle( 10, "mmamammmmammamamaaamammma" );
lightstyle( 11, "abcdefghijklmnopqrrqponmlkjihgfedcba" );
// TODO: Merge these into a single field?
clientstat( 0, EV_FLOAT, health );
clientstat( 10, EV_FLOAT, weapon );
clientstat( 16, EV_FLOAT, view_ofs_z );
clientstat( 21, EV_FLOAT, viewzoom );
// clientstat( STAT_BOMBZONE, EV_FLOAT, fInBombZone );
/* FIXME: Turn those into bitflags */
clientstat( STAT_BUYZONE, EV_FLOAT, fInBuyZone );
clientstat( STAT_HOSTAGEZONE, EV_FLOAT, fInHostageZone );
clientstat( STAT_BOMBZONE, EV_FLOAT, fInBombZone );
clientstat( STAT_ESCAPEZONE, EV_FLOAT, fInEscapeZone );
clientstat( STAT_VIPZONE, EV_FLOAT, fInVIPZone );
clientstat( 4, EV_FLOAT, armor );
clientstat( STAT_MONEY, EV_FLOAT, fMoney );
clientstat( STAT_SLOT_MELEE, EV_FLOAT, fSlotMelee );

View file

@ -37,12 +37,15 @@ func_escapezone_touch
*/
void func_escapezone::touch(void)
{
if ((other.classname == "player") && (other.team == TEAM_T)) {
Escape_Touch(other);
if (other.classname == "player") {
if (other.team == TEAM_T) {
Escape_Touch(other);
if (iAlivePlayers_T == 0) {
Rules_RoundOver(TEAM_T, 2500, FALSE);
if (iAlivePlayers_T == 0) {
Rules_RoundOver(TEAM_T, 2500, FALSE);
}
}
other.fInEscapeZone = TRUE;
}
}

View file

@ -27,9 +27,12 @@ void VIP_Rescue(entity targ)
void func_vip_safetyzone::touch(void)
{
if ((other.classname == "player") && (other.team == TEAM_VIP)) {
Rules_RoundOver(TEAM_CT, 2500, FALSE);
VIP_Rescue(other);
if (other.classname == "player") {
if (other.team == TEAM_VIP) {
Rules_RoundOver(TEAM_CT, 2500, FALSE);
VIP_Rescue(other);
}
other.fInVIPZone = TRUE;
}
}

View file

@ -25,7 +25,7 @@ Notes
Given the way this entity behaves, there is little practical use for this entity beyond viewing animations (for which there are programs that are far more convenient).
*/
class cycler:CBaseEntity
class cycler:CBaseTrigger
{
void() cycler;
virtual void(entity, int, int) vPain;