Some AUG improvements, simple crosshair for both AUG and SG552

This commit is contained in:
Marco Cawthorne 2019-01-03 02:23:21 +01:00
parent 07b72429f6
commit 32b6e85d28
4 changed files with 28 additions and 6 deletions

View file

@ -477,7 +477,11 @@ void HUD_Draw(void) {
// I guess viewzoom turns from 0.0-1.0 float into a 0-255 byte
if (getstatf(STAT_VIEWZOOM) < 1.0f) {
HUD_DrawScope();
if (getstatf(STAT_ACTIVEWEAPON) == WEAPON_SG552 || getstatf(STAT_ACTIVEWEAPON) == WEAPON_AUG) {
HUD_DrawSimpleCrosshair();
} else {
HUD_DrawScope();
}
} else {
HUD_DrawCrosshair();
}

View file

@ -98,3 +98,20 @@ void HUD_DrawCrosshair( void ) {
drawfill( vHor1, [ iLineLength, 1 ], vCrossColor, 1, DRAWFLAG_ADDITIVE );
drawfill( vHor2, [ iLineLength, 1 ], vCrossColor, 1, DRAWFLAG_ADDITIVE );
}
/*
=================
HUD_DrawSimpleCrosshair
Draws a simple HL crosshair
=================
*/
void HUD_DrawSimpleCrosshair( void )
{
static vector cross_pos;
// Draw the scope in the middle, seperately from the border
cross_pos = ( vVideoResolution / 2 ) + '-12 -12';
drawsubpic(cross_pos, [24,24], "sprites/crosshairs.spr_0.tga", [0.1875,0], [0.1875, 0.1875], [1,1,1], 1, DRAWFLAG_NORMAL);
}

View file

@ -58,6 +58,7 @@ void CSQC_Init(float apilevel, string enginename, float engineversion) {
precache_model("sprites/640hud3.spr");
precache_model("sprites/640hud5.spr");
precache_model("sprites/640_pain.spr");
precache_model("sprites/crosshairs.spr");
precache_sound("common/wpn_hudon.wav");
precache_sound("common/wpn_hudoff.wav");
@ -95,10 +96,6 @@ void CSQC_Init(float apilevel, string enginename, float engineversion) {
precache_pic( "lambda.bmp");
precache_pic( "logos/doug.bmp");
for ( int i = 0; i < ( CS_WEAPON_COUNT - 1 ); i++ ) {
precache_model( sViewModels[ i ] );
}
PARTICLE_SPARK = particleeffectnum("part_spark");
PARTICLE_PIECES_BLACK = particleeffectnum("part_pieces_black");

View file

@ -76,6 +76,10 @@ void WeaponAUG_PrimaryFire( void ) {
#ifdef SSQC
if ( BaseGun_PrimaryFire() == TRUE ) {
sound( self, CHAN_WEAPON, "weapons/aug-1.wav", 1, ATTN_NORM );
if ( self.viewzoom != 1.0 ) {
self.fAttackFinished = time + (wptAUG.fAttackFinished * 2);
}
}
#else
int iRand = (int)floor( random( 1, 4 ) );
@ -98,7 +102,7 @@ void WeaponAUG_SecondaryFire( void ) {
} else {
self.viewzoom = 0.6;
}
self.fAttackFinished = time + 0.5;
#endif
}