diff --git a/src/client/ui.h b/src/client/ui.h index cc50e71..712cc9a 100644 --- a/src/client/ui.h +++ b/src/client/ui.h @@ -13,7 +13,6 @@ string sMOTDString[25]; string sMapString[35]; var string sMOTD_total; -var string sMapString_total; // Keep in synch with the ary_UI_Screen array of ui.qc diff --git a/src/client/ui.qc b/src/client/ui.qc index d81c7a8..e3efa60 100644 --- a/src/client/ui.qc +++ b/src/client/ui.qc @@ -143,13 +143,10 @@ UI_ChangeScreen(UI_SCREEN arg_NewScreenID) void UI_Init(void) { - string sTemp; int iMOTDLength; int i; int s; - filestream fmMapDescr; - // First load the MESSAGE OF THE DAY from the sever //sMOTD_total = serverkey("motd_total"); @@ -169,43 +166,8 @@ UI_Init(void) // NOPE! Let this be handled elsewhere in case of a different color choice! //sMOTD_total = strcat("^xFA0", sMOTD_total); - - // Now load the MAP DESCRIPTION - // TAGGG - // Do we have any use for this though? Check original TS, the "Select Team" - // screen does (press enter to close or after closing the MoTD, probably) - - sMapString_total = ""; - - //printfline("MAPNAME READS: %s", mapname); - // TODO! If the mapname ends in .bsp, remove that portion, that causes - // the appended ".txt" to work wrongly, "mymap.bsp.txt" instead of "mymap.txt" - - fmMapDescr = fopen( sprintf( "maps/%s.txt", mapname ), FILE_READ ); - if ( fmMapDescr != -1 ) { - for (i = 0; i < 35; i++ ) { - sTemp = fgets( fmMapDescr ); - if not ( sTemp ) { - break; - } - sMapString[ i ] = sTemp; - - /* - if (sMapString[ i ] == "/" ) { - sMapString_total = strcat(sMOTD_total, "\n" ); - }else{ - sMapString_total = strcat(sMapString_total, sprintf("%s\n", sMapString[ i ]) ); - } - */ - sMapString_total = strcat(sMapString_total, sprintf("%s\n", sMapString[ i ]) ); - - } - fclose( fmMapDescr ); - } - - //printfline("MAP DESCRIPTOR?"); - //printfline("%s", sMapString_total); - + // someVar = loadMapDescription(); + loadMapDescription(); gFun_UI_EventGrabber_Initialize(); diff --git a/src/client/util.h b/src/client/util.h index 820ce6b..c14261e 100644 --- a/src/client/util.h +++ b/src/client/util.h @@ -95,4 +95,4 @@ void Gfx_TextLineWrap( vector vPos, vector vSize, float fAlignFlags, string sTex void Gfx_RotScalePic( string sImage, vector arg_vDrawPos, vector arg_vDrawPivot, vector vSize, float flAngle, vector vScale, vector vRGB, float flOpac ); void Gfx_ScalePicPreserveBounds(string sImage, vector arg_vDrawPos, vector vSize, vector vScale, vector vInset, vector vRGB, float flOpac); string Colors_RGB8_to_HEX(vector color); - +string loadMapDescription(void); diff --git a/src/client/util.qc b/src/client/util.qc index c3bfe1e..6018537 100644 --- a/src/client/util.qc +++ b/src/client/util.qc @@ -214,3 +214,63 @@ Colors_RGB8_to_HEX(vector color) } return out; } + + + + +// Load the map description +// Do we have any use for this though? Check original TS, the "Select Team" +// screen does (press enter to close or after closing the MoTD, probably) +string +loadMapDescription(void) +{ + int i; + filestream fmMapDescr; + string sTemp; + string sMapString_total = ""; + + + // If the mapname ends in .bsp, remove that portion, that causes + // the appended ".txt" to work wrongly, "mymap.bsp.txt" instead of "mymap.txt". + // This check for ending in ".bsp" adjusts for that if so + string mapname_filtered = mapname; + float mapname_len = strlen(mapname); + // name is at least 5 characters (...X.bsp) + if(mapname_len >= 5){ + string lastChars = substring(mapname, mapname_len - 4, 4); + if(lastChars == ".bsp"){ + // change _filtered! + mapname_filtered = substring(mapname, 0, mapname_len - 4); + } + } + + //printfline("loadMapDescription: mapname:%s mapname_filtered: %s", mapname, mapname_filtered); + + fmMapDescr = fopen( sprintf( "maps/%s.txt", mapname_filtered ), FILE_READ ); + if ( fmMapDescr != -1 ) { + for (i = 0; i < 35; i++ ) { + sTemp = fgets( fmMapDescr ); + if not ( sTemp ) { + break; + } + sMapString[ i ] = sTemp; + + /* + if (sMapString[ i ] == "/" ) { + sMapString_total = strcat(sMOTD_total, "\n" ); + }else{ + sMapString_total = strcat(sMapString_total, sprintf("%s\n", sMapString[ i ]) ); + } + */ + sMapString_total = strcat(sMapString_total, sprintf("%s\n", sMapString[ i ]) ); + + } + fclose( fmMapDescr ); + }else{ + // No mapname.txt? Could set sMapString_total to "No description found." + } + + //printfline("map descriptor: %s", sMapString_total); + return sMapString_total; +}//loadMapDescription + diff --git a/src/client/view.qc b/src/client/view.qc index b1aeb97..6f11d95 100644 --- a/src/client/view.qc +++ b/src/client/view.qc @@ -337,9 +337,7 @@ void View_HandleZoom(void){ void View_ShowMuzzleflash(int index) { - // View_SetMuzzleflash pSeat->m_eMuzzleflash.modelindex = (float)index; - // Event_ProcessModel: force it. pSeat->m_eMuzzleflash.alpha = 1.0f; pSeat->m_eMuzzleflash.scale = 0.25; diff --git a/src/shared/ammo.h b/src/shared/ammo.h index a85ffa0..b82f61b 100644 --- a/src/shared/ammo.h +++ b/src/shared/ammo.h @@ -63,11 +63,11 @@ enum SHELLEJECT_ID{ // ammo type. Still using those first in weapons involving those _22, _9MM, - _GENERIC, + GENERIC, - _SHOTGUN, // red - _SHOTGUN_BLUE, - _SHOTGUN_GOLD, + SHOTGUN, // red + SHOTGUN_BLUE, + SHOTGUN_GOLD, LAST_ID }; diff --git a/src/shared/ammo.qc b/src/shared/ammo.qc index 5dcd8a9..23a1ef2 100644 --- a/src/shared/ammo.qc +++ b/src/shared/ammo.qc @@ -22,10 +22,10 @@ DECLARE_SHELLEJECTDATA(_56, "models/56_shell.mdl", "modelevent_shell.land") DECLARE_SHELLEJECTDATA(_556, "models/556_shell.mdl", "modelevent_shell.land") DECLARE_SHELLEJECTDATA(_22, "models/22_shell.mdl", "modelevent_shell.land") DECLARE_SHELLEJECTDATA(_9MM, "models/9mm_shell.mdl", "modelevent_shell.land") -DECLARE_SHELLEJECTDATA(_GENERIC, "models/shell.mdl", "modelevent_shell.land") -DECLARE_SHELLEJECTDATA(_SHOTGUN, "models/shotgun_shell.mdl", "modelevent_shotgunshell.land") -DECLARE_SHELLEJECTDATA(_SHOTGUN_BLUE, "models/shotgun_shell_blue.mdl", "modelevent_shotgunshell.land") -DECLARE_SHELLEJECTDATA(_SHOTGUN_GOLD, "models/shotgun_shell_gold.mdl", "modelevent_shotgunshell.land") +DECLARE_SHELLEJECTDATA(GENERIC, "models/shell.mdl", "modelevent_shell.land") +DECLARE_SHELLEJECTDATA(SHOTGUN, "models/shotgun_shell.mdl", "modelevent_shotgunshell.land") +DECLARE_SHELLEJECTDATA(SHOTGUN_BLUE, "models/shotgun_shell_blue.mdl", "modelevent_shotgunshell.land") +DECLARE_SHELLEJECTDATA(SHOTGUN_GOLD, "models/shotgun_shell_gold.mdl", "modelevent_shotgunshell.land") DECLARE_MUZZLEFLASHDATA(NONE, "") @@ -110,12 +110,11 @@ void setupAmmoData(void){ ASSIGN_SHELLEJECTDATA(_556) ASSIGN_SHELLEJECTDATA(_22) ASSIGN_SHELLEJECTDATA(_9MM) - ASSIGN_SHELLEJECTDATA(_GENERIC) - ASSIGN_SHELLEJECTDATA(_SHOTGUN) - ASSIGN_SHELLEJECTDATA(_SHOTGUN_BLUE) - ASSIGN_SHELLEJECTDATA(_SHOTGUN_GOLD) + ASSIGN_SHELLEJECTDATA(GENERIC) + ASSIGN_SHELLEJECTDATA(SHOTGUN) + ASSIGN_SHELLEJECTDATA(SHOTGUN_BLUE) + ASSIGN_SHELLEJECTDATA(SHOTGUN_GOLD) - printfline("ASSIGNMENT HAPPENED"); ASSIGN_MUZZLEFLASHDATA(NONE) ASSIGN_MUZZLEFLASHDATA(SMALL) ASSIGN_MUZZLEFLASHDATA(RIFLE) diff --git a/src/shared/player.h b/src/shared/player.h index a4a8ff7..8c215d0 100644 --- a/src/shared/player.h +++ b/src/shared/player.h @@ -150,6 +150,8 @@ class player:base_player // equipped. Not that it could ever change while not equipped anyway. int prev_forceBodygroup1Submodel; + // same as below for muzzleflash. + int iMuzzleFlashType; // During a shell-eject event, what member of aryShellEjectData do I use for the model // and hitsound script file to use? Set on setting the event int iShellEjectType; diff --git a/src/shared/weapons.h b/src/shared/weapons.h index 04818ce..b97fd8e 100644 --- a/src/shared/weapons.h +++ b/src/shared/weapons.h @@ -850,8 +850,9 @@ void weapon_gun_onDrawHUD(player pl, weapondata_gun_t* basePRef, weapondynamic_t void weapon_throwable_onDrawHUD(player pl, weapondata_throwable_t* basePRef, weapondynamic_t arg_thisWeapon); void weapon_melee_onDrawHUD(player pl, weapondata_melee_t* basePRef, weapondynamic_t arg_thisWeapon); -void weapon_ShowMuzzleFlash(int arg_muzzleFlashTypeID); +void weapon_ShowMuzzleFlash(int arg_muzzleFlashType); void weapon_EjectShell(int arg_shellEjectType); +void weapon_ClientEffects(int arg_muzzleFlashType, int arg_shellEjectType); void weapon_precache(weapondata_basic_t* basePRef); @@ -952,11 +953,9 @@ int getAmmoTypeOfWeapon(int arg_weaponID); #ifdef CLIENT void viewEv_playShotgunInsertShellSound(void); - -// dummy -void w_ejectshell_pistol(void){}; - +void viewEv_weapon_ShowMuzzleFlash(void); void viewEv_weapon_EjectShell(void); +void viewEv_weapon_ClientEffects(void) void copyWeaponConfig(weaponconfig_weapon_t* arg_dest, weaponconfig_weapon_t* arg_src); void copyConfig(weaponconfig_data_t* arg_dest, weaponconfig_data_t* arg_src); diff --git a/src/shared/weapons.qc b/src/shared/weapons.qc index 6290056..70b8802 100644 --- a/src/shared/weapons.qc +++ b/src/shared/weapons.qc @@ -1827,13 +1827,16 @@ weapon_melee_onDrawHUD(player pl, weapondata_melee_t* basePRef, weapondynamic_t void -weapon_ShowMuzzleFlash(int arg_muzzleFlashTypeID){ +weapon_ShowMuzzleFlash(int arg_muzzleFlashType){ #ifdef CLIENT - if(arg_muzzleFlashTypeID != MUZZLEFLASH_ID::NONE){ - muzzleflashdata_t* tempRef = ary_muzzleFlashData[arg_muzzleFlashTypeID]; - - View_ShowMuzzleflash((*tempRef).iSpritePrecacheID); + if(arg_muzzleFlashType != MUZZLEFLASH_ID::NONE){ + // not yet! + //muzzleflashdata_t* tempRef = ary_muzzleFlashData[arg_muzzleFlashType]; + //View_ShowMuzzleflash((*tempRef).iSpritePrecacheID); + player pl = (player)self; + pl.iMuzzleFlashType = arg_muzzleFlashType; + View_AddEvent(viewEv_weapon_ShowMuzzleFlash, 0.0f); } #else // anything for other players to see, or will this be per animation in clientside rendering @@ -1851,19 +1854,34 @@ weapon_EjectShell(int arg_shellEjectType) { #ifdef CLIENT player pl = (player)self; - pl.iShellEjectType = arg_shellEjectType; - View_AddEvent(viewEv_weapon_EjectShell, 0.0f); + if(arg_shellEjectType != SHELLEJECT_ID::NONE){ + pl.iShellEjectType = arg_shellEjectType; + View_AddEvent(viewEv_weapon_EjectShell, 0.0f); + } #else - // anything for the playermodel? Also only do that for all players except the - // localplayer if using a viewmodel. - // ...and already this is sounding more like a job for predraw, which does handle - // players rendering players other than themselves. And yes, still clientside. + // anything for the playermodel? +#endif +} + +// Both weapon_ShowMuzzleFlash and weapon_EjectShell in one call for scheduling +// one event that calls both, otherwise, only either can happen (one event allowed; +// any more and they just overwrite each other on being set) +void weapon_ClientEffects(int arg_muzzleFlashType, int arg_shellEjectType){ +#ifdef CLIENT + player pl = (player)self; + pl.iMuzzleFlashType = arg_muzzleFlashType; + pl.iShellEjectType = arg_shellEjectType; + View_AddEvent(viewEv_weapon_ClientEffects, 0.0f); +#else + // ? #endif } + + // Precache models and the HUD icon given in FreeTS weapondata. -// Weapon sounds and anything else not in the struct shuold be precached +// Weapon sounds and anything else not in the struct should be precached // in the weapon's own precache method or globally (precache.qc) if reused // between different weapons like shell models/sounds. void @@ -2245,7 +2263,25 @@ viewEv_weapon_EjectShell(void) // Although that might've been needed earlier unless this event-thing works fine for being // a playermodel too. Players other than the local one being rendered and needing to drop // shells, that sounds like a whole other story - CTSShellEject::generateForViewmodel(pl.iShellEjectType); + if(pl.iShellEjectType != SHELLEJECT_ID::NONE){ + CTSShellEject::generateForViewmodel(pl.iShellEjectType); + } +} + +void +viewEv_weapon_ShowMuzzleFlash(void){ + player pl = (player)pSeat->m_ePlayer; + if(pl.iMuzzleFlashType != MUZZLEFLASH_ID::NONE){ + muzzleflashdata_t* tempRef = ary_muzzleFlashData[pl.iMuzzleFlashType]; + View_ShowMuzzleflash((*tempRef).iSpritePrecacheID); + } +} + + +void +viewEv_weapon_ClientEffects(void){ + viewEv_weapon_EjectShell(); + viewEv_weapon_ShowMuzzleFlash(); } diff --git a/src/shared/weapons/weapon_ak47.qc b/src/shared/weapons/weapon_ak47.qc index acb70ce..5be66f1 100644 --- a/src/shared/weapons/weapon_ak47.qc +++ b/src/shared/weapons/weapon_ak47.qc @@ -158,10 +158,7 @@ w_ak47_primary(void) TS_Weapons_ViewAnimation(weaponseq_ak47::shoot2, 31.0f/30.0f); } -#ifdef CLIENT - weapon_ShowMuzzleFlash(MUZZLEFLASH_ID::RIFLE); - weapon_EjectShell(SHELLEJECT_ID::_56); -#endif + weapon_ClientEffects(MUZZLEFLASH_ID::RIFLE, SHELLEJECT_ID::_56); weapon_base_onAttack(pl, ary_weaponData[WEAPON_ID::AK47], arg_thisWeapon, BITS_AKIMBOCHOICE_LEFT); @@ -195,13 +192,12 @@ w_ak47_secondary(void) pl.setZoom(1.00f); break;} case 1:{ - pl.setZoom(0.4f); + pl.setZoom(0.40f); break;} case 2:{ pl.setZoom(0.1625f); break;} - }//END OF switch - + } }else{ // no scope? we use ironsights then. weapon_ironsight_ToggleIronsight(pl, (weapondata_ironsight_t*)ary_weaponData[WEAPON_ID::AK47], arg_thisWeapon); diff --git a/src/shared/weapons/weapon_barrettm82.qc b/src/shared/weapons/weapon_barrettm82.qc index 27991ff..11d49b8 100644 --- a/src/shared/weapons/weapon_barrettm82.qc +++ b/src/shared/weapons/weapon_barrettm82.qc @@ -149,10 +149,7 @@ w_barrettm82_primary(void) TS_Weapons_ViewAnimation(weaponseq_barrettm82::shoot2, 31.0f/30.0f); } -#ifdef CLIENT - View_ShowMuzzleflash(MUZZLE_SMALL); - View_AddEvent(w_ejectshell_pistol, 0.0f); -#endif + weapon_ClientEffects(MUZZLEFLASH_ID::RIFLE, SHELLEJECT_ID::_56); weapon_base_onAttack(pl, ary_weaponData[WEAPON_ID::BARRETTM82], arg_thisWeapon, BITS_AKIMBOCHOICE_LEFT); @@ -182,24 +179,18 @@ w_barrettm82_secondary(void) if(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SCOPE){ // toggle through the zoom. + pl.iZoomLevel = (pl.iZoomLevel + 1) % 3; switch(pl.iZoomLevel){ - case -1:{ - //pl.viewzoom = 32/80; - pl.setZoom(0.4f); - pl.iZoomLevel++; - break;} case 0:{ - //pl.viewzoom = 8/80; - pl.setZoom(0.10f); - pl.iZoomLevel++; + pl.setZoom(1.00f); break;} case 1:{ - //pl.viewzoom = 0; - pl.setZoom(1.00f); - pl.iZoomLevel = -1; + pl.setZoom(0.40f); break;} - }//END OF switch - + case 2:{ + pl.setZoom(0.10f); + break;} + } } } diff --git a/src/shared/weapons/weapon_benellim3.qc b/src/shared/weapons/weapon_benellim3.qc index ccbcfd9..f65215e 100644 --- a/src/shared/weapons/weapon_benellim3.qc +++ b/src/shared/weapons/weapon_benellim3.qc @@ -169,9 +169,7 @@ w_benellim3_primary(void) TS_Weapons_PlaySoundChannelDirect(pl, "weapons/m3/m3-pump.wav", CHAN_AUTO); // these pumps eject shells -#ifdef CLIENT - View_AddEvent(w_ejectshell_pistol, 0.0f); -#endif + weapon_EjectShell(SHELLEJECT_ID::SHOTGUN_BLUE); // float randomChoice = random(); // why the cast to float here? No idea @@ -200,18 +198,12 @@ w_benellim3_primary(void) if(arg_thisWeapon.iFireMode == BITS_FIREMODE_PUMP){ TS_Weapons_ViewAnimation(weaponseq_benellim3::shootpump, (31.0f/35.0f) ); - // no shell! Pumping does that here. + // no shell! Pumping does that. pl.shotgunWaitingForPump = TRUE; -#ifdef CLIENT - View_ShowMuzzleflash(MUZZLE_SMALL); - // no shell, that comes in the pump soon after. -#endif + weapon_ShowMuzzleFlash(MUZZLEFLASH_ID::WEIRD); }else{ TS_Weapons_ViewAnimation(weaponseq_benellim3::shootsemi, (31.0f/35.0f) ); -#ifdef CLIENT - View_ShowMuzzleflash(MUZZLE_SMALL); - View_AddEvent(w_ejectshell_pistol, 0.0f); -#endif + weapon_ClientEffects(MUZZLEFLASH_ID::WEIRD, SHELLEJECT_ID::SHOTGUN_BLUE); } weapon_base_onAttack_multi(pl, ary_weaponData[WEAPON_ID::BENELLIM3], arg_thisWeapon, 8, BITS_AKIMBOCHOICE_LEFT); @@ -254,19 +246,15 @@ w_benellim3_secondary(void) if(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SCOPE){ // toggle through the zoom. + pl.iZoomLevel = (pl.iZoomLevel + 1) % 2; switch(pl.iZoomLevel){ - case -1:{ - //pl.viewzoom = 40/80; - pl.setZoom(0.5f); - pl.iZoomLevel++; - break;} case 0:{ pl.setZoom(1.00f); - pl.iZoomLevel = -1; break;} - - }//END OF switch - + case 1:{ + pl.setZoom(0.5f); + break;} + } }else{ // no ironsight for this } diff --git a/src/shared/weapons/weapon_beretta.qc b/src/shared/weapons/weapon_beretta.qc index 5455f61..5208650 100644 --- a/src/shared/weapons/weapon_beretta.qc +++ b/src/shared/weapons/weapon_beretta.qc @@ -167,12 +167,11 @@ w_beretta_primary(void) TS_Weapons_ViewAnimation(weaponseq_beretta::shootempty, 31.0f/35.0f); } - -#ifdef CLIENT - View_ShowMuzzleflash(MUZZLE_SMALL); - View_AddEvent(w_ejectshell_pistol, 0.0f); -#endif - + if(!(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SILENCER) ){ + weapon_ClientEffects(MUZZLEFLASH_ID::SMALL, SHELLEJECT_ID::_9MM); + } else { + weapon_EjectShell(SHELLEJECT_ID::_9MM); + } weapon_base_onAttack(pl, ary_weaponData[WEAPON_ID::BERETTA], arg_thisWeapon, BITS_AKIMBOCHOICE_LEFT); diff --git a/src/shared/weapons/weapon_contenderg2.qc b/src/shared/weapons/weapon_contenderg2.qc index 914c0c8..b9c2ee6 100644 --- a/src/shared/weapons/weapon_contenderg2.qc +++ b/src/shared/weapons/weapon_contenderg2.qc @@ -150,10 +150,9 @@ w_contenderg2_primary(void) TS_Weapons_ViewAnimation(weaponseq_contenderg2::shoot2, 31.0f/30.0f); } -#ifdef CLIENT - View_ShowMuzzleflash(MUZZLE_SMALL); - View_AddEvent(w_ejectshell_pistol, 0.0f); -#endif + // guessing a shell-eject doesn't happen, could be wrong. + //weapon_ClientEffects(MUZZLEFLASH_ID::RIFLE, SHELLEJECT_ID::_56); + weapon_ShowMuzzleFlash(MUZZLEFLASH_ID::RIFLE); weapon_base_onAttack(pl, ary_weaponData[WEAPON_ID::CONTENDERG2], arg_thisWeapon, BITS_AKIMBOCHOICE_LEFT); @@ -181,21 +180,15 @@ w_contenderg2_secondary(void) if(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SCOPE){ // toggle through the zoom. - + pl.iZoomLevel = (pl.iZoomLevel + 1) % 2; switch(pl.iZoomLevel){ - case -1:{ - //pl.viewzoom = 26/80; - pl.setZoom(0.325f); - pl.iZoomLevel++; - break;} case 0:{ - //pl.viewzoom = 0; pl.setZoom(1.00f); - pl.iZoomLevel = -1; break;} - - }//END OF switch - + case 1:{ + pl.setZoom(0.325f); + break;} + } } } diff --git a/src/shared/weapons/weapon_deserteagle.qc b/src/shared/weapons/weapon_deserteagle.qc index 9c8d6c2..3855f40 100644 --- a/src/shared/weapons/weapon_deserteagle.qc +++ b/src/shared/weapons/weapon_deserteagle.qc @@ -100,8 +100,6 @@ w_deserteagle_precache(void) void w_deserteagle_updateammo(player pl) { - //weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; - //Weapons_UpdateAmmo(pl, arg_thisWeapon.iClipLeft, pl.ary_ammoTotal[AMMO_ID::_9x19mm], -1); } string @@ -193,10 +191,11 @@ w_deserteagle_primary(void) } } -#ifdef CLIENT - View_ShowMuzzleflash(MUZZLE_SMALL); - View_AddEvent(w_ejectshell_pistol, 0.0f); -#endif + if(!(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SILENCER) ){ + weapon_ClientEffects(MUZZLEFLASH_ID::SMALL, SHELLEJECT_ID::GENERIC); + } else { + weapon_EjectShell(SHELLEJECT_ID::GENERIC); + } weapon_base_onAttack(pl, ary_weaponData[WEAPON_ID::DESERTEAGLE], arg_thisWeapon, BITS_AKIMBOCHOICE_LEFT); @@ -226,19 +225,15 @@ w_deserteagle_secondary(void) if(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SCOPE){ // toggle through the zoom. + pl.iZoomLevel = (pl.iZoomLevel + 1) % 2; switch(pl.iZoomLevel){ - case -1:{ - //pl.viewzoom = 60/80; - pl.setZoom(0.75f); - pl.iZoomLevel++; - break;} case 0:{ pl.setZoom(1.00f); - pl.iZoomLevel = -1; break;} - - }//END OF switch - + case 1:{ + pl.setZoom(0.75f); + break;} + } }else{ // no scope? we use ironsights then. weapon_ironsight_ToggleIronsight(pl, (weapondata_ironsight_t*)ary_weaponData[WEAPON_ID::DESERTEAGLE], arg_thisWeapon); diff --git a/src/shared/weapons/weapon_fiveseven.qc b/src/shared/weapons/weapon_fiveseven.qc index 7758712..fd9ba25 100644 --- a/src/shared/weapons/weapon_fiveseven.qc +++ b/src/shared/weapons/weapon_fiveseven.qc @@ -157,11 +157,11 @@ w_fiveseven_primary(void) TS_Weapons_ViewAnimation(weaponseq_fiveseven::shootlast, 31.0f/40.0f); } -#ifdef CLIENT - View_ShowMuzzleflash(MUZZLE_SMALL); - View_AddEvent(w_ejectshell_pistol, 0.0f); -#endif - + if(!(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SILENCER) ){ + weapon_ClientEffects(MUZZLEFLASH_ID::SMALL, SHELLEJECT_ID::_56); + } else { + weapon_EjectShell(SHELLEJECT_ID::_56); + } weapon_base_onAttack(pl, ary_weaponData[WEAPON_ID::FIVESEVEN], arg_thisWeapon, BITS_AKIMBOCHOICE_LEFT); diff --git a/src/shared/weapons/weapon_glock18.qc b/src/shared/weapons/weapon_glock18.qc index 32047f6..91761b7 100644 --- a/src/shared/weapons/weapon_glock18.qc +++ b/src/shared/weapons/weapon_glock18.qc @@ -176,9 +176,24 @@ w_glock18_primary(void) // TODO. // For now using lazy HL defaults for muzzle flashes, I'll leave // TS's own muzzle flashes, whichever ones are even used, for another time - weapon_ShowMuzzleFlash(MUZZLEFLASH_ID::SMALL); - weapon_EjectShell(SHELLEJECT_ID::_9MM); - + //weapon_ShowMuzzleFlash(MUZZLEFLASH_ID::SMALL); + //weapon_EjectShell(SHELLEJECT_ID::_9MM); + // Nope! Doing both in the same event for now, not sure if any other options + // to not have issues with packet delays. + // The old way in ShowMuzzleFlash didn't use the event system, so it being called + // every single frame until a server update (force packet delays) resets the muzzle + // flash to full until the ping-time is reached. It appears to stay solid the whole + // time. But doing two events at the same time is not an option because there is + // only one event at a time that can be stored, see Nuclide's src/cleint/view.qc, + // m_pEventCall. Being set before it is reached, exact same 0.0 time or not, overwrites + // the previous value so only the most recent call has any effect. + // One method, "weapon_ViewModelEffects" that accepts both will do, since NONE are also + // choices for any oddballs out there + if(!(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SILENCER) ){ + weapon_ClientEffects(MUZZLEFLASH_ID::SMALL, SHELLEJECT_ID::_9MM); + } else { + weapon_EjectShell(SHELLEJECT_ID::_9MM); + } weapon_base_onAttack(pl, ary_weaponData[WEAPON_ID::GLOCK18], arg_thisWeapon, BITS_AKIMBOCHOICE_LEFT); diff --git a/src/shared/weapons/weapon_glock20.qc b/src/shared/weapons/weapon_glock20.qc index ea42d3f..7e289b1 100644 --- a/src/shared/weapons/weapon_glock20.qc +++ b/src/shared/weapons/weapon_glock20.qc @@ -156,11 +156,11 @@ w_glock20_primary(void) TS_Weapons_ViewAnimation(weaponseq_glock20::shootempty, 31.0f/30.0f); } - -#ifdef CLIENT - View_ShowMuzzleflash(MUZZLE_SMALL); - View_AddEvent(w_ejectshell_pistol, 0.0f); -#endif + if(!(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SILENCER) ){ + weapon_ClientEffects(MUZZLEFLASH_ID::SMALL, SHELLEJECT_ID::GENERIC); + } else { + weapon_EjectShell(SHELLEJECT_ID::GENERIC); + } weapon_base_onAttack(pl, ary_weaponData[WEAPON_ID::GLOCK20], arg_thisWeapon, BITS_AKIMBOCHOICE_LEFT); diff --git a/src/shared/weapons/weapon_hkpdw.qc b/src/shared/weapons/weapon_hkpdw.qc index 63355d4..76c3132 100644 --- a/src/shared/weapons/weapon_hkpdw.qc +++ b/src/shared/weapons/weapon_hkpdw.qc @@ -157,10 +157,11 @@ w_hkpdw_primary(void) TS_Weapons_ViewAnimation(weaponseq_hkpdw::shoot3, 21.0f/30.0f); } -#ifdef CLIENT - View_ShowMuzzleflash(MUZZLE_SMALL); - View_AddEvent(w_ejectshell_pistol, 0.0f); -#endif + if(!(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SILENCER) ){ + weapon_ClientEffects(MUZZLEFLASH_ID::RIFLE, SHELLEJECT_ID::_56); + } else { + weapon_EjectShell(SHELLEJECT_ID::_56); + } weapon_base_onAttack(pl, ary_weaponData[WEAPON_ID::HKPDW], arg_thisWeapon, BITS_AKIMBOCHOICE_LEFT); @@ -188,21 +189,15 @@ w_hkpdw_secondary(void) if(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SCOPE){ // toggle through the zoom. - + pl.iZoomLevel = (pl.iZoomLevel + 1) % 2; switch(pl.iZoomLevel){ - case -1:{ - //pl.viewzoom = 40/80; - pl.setZoom(0.50f); - pl.iZoomLevel++; - break;} case 0:{ - //pl.viewzoom = 0; pl.setZoom(1.00f); - pl.iZoomLevel = -1; break;} - - }//END OF switch - + case 1:{ + pl.setZoom(0.50f); + break;} + } } } diff --git a/src/shared/weapons/weapon_m16a4.qc b/src/shared/weapons/weapon_m16a4.qc index 81e3e5b..bd24467 100644 --- a/src/shared/weapons/weapon_m16a4.qc +++ b/src/shared/weapons/weapon_m16a4.qc @@ -190,12 +190,7 @@ w_m16a4_primary(void) } } - -#ifdef CLIENT - View_ShowMuzzleflash(MUZZLE_SMALL); - View_AddEvent(w_ejectshell_pistol, 0.0f); -#endif - + weapon_ClientEffects(MUZZLEFLASH_ID::RIFLE, SHELLEJECT_ID::_56); if(arg_thisWeapon.iFireMode == BITS_FIREMODE_BURST) { @@ -240,25 +235,18 @@ w_m16a4_secondary(void) if(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SCOPE){ // toggle through the zoom. - + pl.iZoomLevel = (pl.iZoomLevel + 1) % 3; switch(pl.iZoomLevel){ - case -1:{ - //pl.viewzoom = 32/80; - pl.setZoom(0.4f); - pl.iZoomLevel++; - break;} case 0:{ - //pl.viewzoom = 8/80; - pl.setZoom(0.10f); - pl.iZoomLevel++; + pl.setZoom(1.00f); break;} case 1:{ - //pl.viewzoom = 0; - pl.setZoom(1.00f); - pl.iZoomLevel = -1; + pl.setZoom(0.40f); break;} - }//END OF switch - + case 2:{ + pl.setZoom(0.10f); + break;} + } }else{ // no scope? we use ironsights then. weapon_ironsight_ToggleIronsight(pl , (weapondata_ironsight_t*)ary_weaponData[WEAPON_ID::M16A4], arg_thisWeapon); diff --git a/src/shared/weapons/weapon_m4a1.qc b/src/shared/weapons/weapon_m4a1.qc index 27add6a..394a48c 100644 --- a/src/shared/weapons/weapon_m4a1.qc +++ b/src/shared/weapons/weapon_m4a1.qc @@ -214,10 +214,11 @@ w_m4a1_primary(void) } } -#ifdef CLIENT - View_ShowMuzzleflash(MUZZLE_SMALL); - View_AddEvent(w_ejectshell_pistol, 0.0f); -#endif + if(!(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SILENCER) ){ + weapon_ClientEffects(MUZZLEFLASH_ID::RIFLE, SHELLEJECT_ID::_56); + } else { + weapon_EjectShell(SHELLEJECT_ID::_56); + } weapon_base_onAttack(pl, ary_weaponData[WEAPON_ID::M4A1], arg_thisWeapon, BITS_AKIMBOCHOICE_LEFT); @@ -245,21 +246,15 @@ w_m4a1_secondary(void) if(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SCOPE){ // toggle through the zoom. - + pl.iZoomLevel = (pl.iZoomLevel + 1) % 2; switch(pl.iZoomLevel){ - case -1:{ - //pl.viewzoom = 26/80; - pl.setZoom(0.325f); - pl.iZoomLevel++; - break;} case 0:{ - //pl.viewzoom = 0; pl.setZoom(1.00f); - pl.iZoomLevel = -1; break;} - - }//END OF switch - + case 1:{ + pl.setZoom(0.325f); + break;} + } }else{ // no scope? we use ironsights then. weapon_ironsight_ToggleIronsight(pl, (weapondata_ironsight_t*)ary_weaponData[WEAPON_ID::M4A1], arg_thisWeapon); diff --git a/src/shared/weapons/weapon_m60.qc b/src/shared/weapons/weapon_m60.qc index b987a4b..56a6a37 100644 --- a/src/shared/weapons/weapon_m60.qc +++ b/src/shared/weapons/weapon_m60.qc @@ -139,11 +139,7 @@ w_m60_primary(void) TS_Weapons_ViewAnimation(weaponseq_m60::shoot2, 31.0f/33.0f); } - -#ifdef CLIENT - View_ShowMuzzleflash(MUZZLE_SMALL); - View_AddEvent(w_ejectshell_pistol, 0.0f); -#endif + weapon_ClientEffects(MUZZLEFLASH_ID::RIFLE, SHELLEJECT_ID::_56); weapon_base_onAttack(pl, ary_weaponData[WEAPON_ID::M60], arg_thisWeapon, BITS_AKIMBOCHOICE_LEFT); diff --git a/src/shared/weapons/weapon_mac10.qc b/src/shared/weapons/weapon_mac10.qc index 911e3cd..8a0994a 100644 --- a/src/shared/weapons/weapon_mac10.qc +++ b/src/shared/weapons/weapon_mac10.qc @@ -203,11 +203,11 @@ w_mac10_primary(void) } } - -#ifdef CLIENT - View_ShowMuzzleflash(MUZZLE_SMALL); - View_AddEvent(w_ejectshell_pistol, 0.0f); -#endif + if(!(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SILENCER) ){ + weapon_ClientEffects(MUZZLEFLASH_ID::SMALL, SHELLEJECT_ID::GENERIC); + } else { + weapon_EjectShell(SHELLEJECT_ID::GENERIC); + } weapon_base_onAttack(pl, ary_weaponData[WEAPON_ID::MAC10], arg_thisWeapon, BITS_AKIMBOCHOICE_LEFT); diff --git a/src/shared/weapons/weapon_miniuzi.qc b/src/shared/weapons/weapon_miniuzi.qc index 23e415b..0a10081 100644 --- a/src/shared/weapons/weapon_miniuzi.qc +++ b/src/shared/weapons/weapon_miniuzi.qc @@ -195,10 +195,11 @@ w_miniuzi_primary(void) } } -#ifdef CLIENT - View_ShowMuzzleflash(MUZZLE_SMALL); - View_AddEvent(w_ejectshell_pistol, 0.0f); -#endif + if(!(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SILENCER) ){ + weapon_ClientEffects(MUZZLEFLASH_ID::SMALL, SHELLEJECT_ID::_9MM); + } else { + weapon_EjectShell(SHELLEJECT_ID::_9MM); + } weapon_base_onAttack(pl, ary_weaponData[WEAPON_ID::MINIUZI], arg_thisWeapon, BITS_AKIMBOCHOICE_LEFT); diff --git a/src/shared/weapons/weapon_mossberg500.qc b/src/shared/weapons/weapon_mossberg500.qc index 9f0ca55..b9d6558 100644 --- a/src/shared/weapons/weapon_mossberg500.qc +++ b/src/shared/weapons/weapon_mossberg500.qc @@ -195,9 +195,7 @@ w_mossberg500_primary(void) TS_Weapons_PlaySoundChannelDirect(pl, "weapons/m3/m3-pump.wav", CHAN_AUTO); // these pumps eject shells -#ifdef CLIENT - View_AddEvent(w_ejectshell_pistol, 0.0f); -#endif + weapon_EjectShell(SHELLEJECT_ID::SHOTGUN_GOLD); if(!arg_thisWeapon.iIronSight){ TS_Weapons_ViewAnimation(weaponseq_mossberg500::pump, 31.0f/35.0f); @@ -232,13 +230,9 @@ w_mossberg500_primary(void) TS_Weapons_ViewAnimation(weaponseq_mossberg500::shootb, 31.0f/35.0f); } - // no shell! Pumping does that here. + // no shell! Pumping does that. pl.shotgunWaitingForPump = TRUE; - -#ifdef CLIENT - View_ShowMuzzleflash(MUZZLE_SMALL); - // no shell, that comes in the pump soon after. -#endif + weapon_ShowMuzzleFlash(MUZZLEFLASH_ID::WEIRD); //} weapon_base_onAttack_multi(pl, ary_weaponData[WEAPON_ID::MOSSBERG500], arg_thisWeapon, 8, BITS_AKIMBOCHOICE_LEFT); diff --git a/src/shared/weapons/weapon_mp5k.qc b/src/shared/weapons/weapon_mp5k.qc index e51d2d2..10ff7c0 100644 --- a/src/shared/weapons/weapon_mp5k.qc +++ b/src/shared/weapons/weapon_mp5k.qc @@ -187,10 +187,11 @@ w_mp5k_primary(void) } } -#ifdef CLIENT - View_ShowMuzzleflash(MUZZLE_SMALL); - View_AddEvent(w_ejectshell_pistol, 0.0f); -#endif + if(!(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SILENCER) ){ + weapon_ClientEffects(MUZZLEFLASH_ID::SMALL, SHELLEJECT_ID::_9MM); + } else { + weapon_EjectShell(SHELLEJECT_ID::_9MM); + } if(arg_thisWeapon.iFireMode == BITS_FIREMODE_BURST) { @@ -230,20 +231,15 @@ w_mp5k_secondary(void) if(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SCOPE){ // toggle through the zoom. + pl.iZoomLevel = (pl.iZoomLevel + 1) % 2; switch(pl.iZoomLevel){ - case -1:{ - //pl.viewzoom = 32/80; - pl.setZoom(0.40f); - pl.iZoomLevel++; - break;} case 0:{ - //pl.viewzoom = 0; pl.setZoom(1.00f); - pl.iZoomLevel = -1; break;} - - }//END OF switch - + case 1:{ + pl.setZoom(0.40f); + break;} + } }else{ // no scope? we use ironsights then. weapon_ironsight_ToggleIronsight(pl, (weapondata_ironsight_t*)ary_weaponData[WEAPON_ID::MP5K], arg_thisWeapon); diff --git a/src/shared/weapons/weapon_mp5sd.qc b/src/shared/weapons/weapon_mp5sd.qc index b95eab2..391a8a6 100644 --- a/src/shared/weapons/weapon_mp5sd.qc +++ b/src/shared/weapons/weapon_mp5sd.qc @@ -162,11 +162,8 @@ w_mp5sd_primary(void) TS_Weapons_ViewAnimation(weaponseq_mp5sd::shoot3, 31.0f/30.0f); } -#ifdef CLIENT - View_ShowMuzzleflash(MUZZLE_SMALL); - View_AddEvent(w_ejectshell_pistol, 0.0f); -#endif - + weapon_EjectShell(SHELLEJECT_ID::_9MM); + if(arg_thisWeapon.iFireMode == BITS_FIREMODE_BURST) { weapon_gun_burstFire(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::MP5SD], arg_thisWeapon, BITS_AKIMBOCHOICE_LEFT, 3, 0.02, 0.18); @@ -205,19 +202,15 @@ w_mp5sd_secondary(void) if(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SCOPE){ // toggle through the zoom. + pl.iZoomLevel = (pl.iZoomLevel + 1) % 2; switch(pl.iZoomLevel){ - case -1:{ - //pl.viewzoom = 32/80; - pl.setZoom(0.40f); - pl.iZoomLevel++; - break;} case 0:{ - //pl.viewzoom = 0; pl.setZoom(1.00f); - pl.iZoomLevel = -1; break;} - }//END OF switch - + case 1:{ + pl.setZoom(0.40f); + break;} + } } } diff --git a/src/shared/weapons/weapon_ragingbull.qc b/src/shared/weapons/weapon_ragingbull.qc index 5ec695d..3fe6f7c 100644 --- a/src/shared/weapons/weapon_ragingbull.qc +++ b/src/shared/weapons/weapon_ragingbull.qc @@ -146,10 +146,8 @@ w_ragingbull_primary(void) TS_Weapons_ViewAnimation(weaponseq_ragingbull::shoot2, 31.0f/30.0f); } -#ifdef CLIENT - View_ShowMuzzleflash(MUZZLE_SMALL); - View_AddEvent(w_ejectshell_pistol, 0.0f); -#endif + // no shell eject + weapon_ShowMuzzleFlash(MUZZLEFLASH_ID::RIFLE); weapon_base_onAttack(pl, ary_weaponData[WEAPON_ID::RAGINGBULL], arg_thisWeapon, BITS_AKIMBOCHOICE_LEFT); @@ -177,21 +175,15 @@ w_ragingbull_secondary(void) if(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SCOPE){ // toggle through the zoom. - + pl.iZoomLevel = (pl.iZoomLevel + 1) % 2; switch(pl.iZoomLevel){ - case -1:{ - //pl.viewzoom = 40/80; - pl.setZoom(0.5f); - pl.iZoomLevel++; - break;} case 0:{ - //pl.viewzoom = 0; pl.setZoom(1.00f); - pl.iZoomLevel = -1; break;} - - }//END OF switch - + case 1:{ + pl.setZoom(0.50f); + break;} + } } } diff --git a/src/shared/weapons/weapon_rugermk1.qc b/src/shared/weapons/weapon_rugermk1.qc index 333299e..503757f 100644 --- a/src/shared/weapons/weapon_rugermk1.qc +++ b/src/shared/weapons/weapon_rugermk1.qc @@ -150,10 +150,7 @@ w_rugermk1_primary(void) TS_Weapons_ViewAnimation(weaponseq_rugermk1::shoot2, 31.0f/35.0f); } -#ifdef CLIENT - View_ShowMuzzleflash(MUZZLE_SMALL); - //View_AddEvent(w_ejectshell_pistol, 0.0f); -#endif + weapon_EjectShell(SHELLEJECT_ID::GENERIC); weapon_base_onAttack(pl, ary_weaponData[WEAPON_ID::RUGERMK1], arg_thisWeapon, BITS_AKIMBOCHOICE_LEFT); diff --git a/src/shared/weapons/weapon_sawedoff.qc b/src/shared/weapons/weapon_sawedoff.qc index 8fb6c27..4f7e322 100644 --- a/src/shared/weapons/weapon_sawedoff.qc +++ b/src/shared/weapons/weapon_sawedoff.qc @@ -201,10 +201,8 @@ w_sawedoff_primary(void) } } -#ifdef CLIENT - View_ShowMuzzleflash(MUZZLE_SMALL); - //View_AddEvent(w_ejectshell_pistol, 0.0f); -#endif + // no shell eject + weapon_ShowMuzzleFlash(MUZZLEFLASH_ID::SMALL); weapon_base_onAttack(pl, ary_weaponData[WEAPON_ID::SAWEDOFF], arg_thisWeapon, BITS_AKIMBOCHOICE_LEFT); diff --git a/src/shared/weapons/weapon_skorpion.qc b/src/shared/weapons/weapon_skorpion.qc index 15efded..be1d5d4 100644 --- a/src/shared/weapons/weapon_skorpion.qc +++ b/src/shared/weapons/weapon_skorpion.qc @@ -146,10 +146,7 @@ w_skorpion_primary(void) TS_Weapons_ViewAnimation(weaponseq_skorpion::fire3, 31.0f/30.0f); } -#ifdef CLIENT - View_ShowMuzzleflash(MUZZLE_SMALL); - View_AddEvent(w_ejectshell_pistol, 0.0f); -#endif + weapon_ClientEffects(MUZZLEFLASH_ID::SMALL, SHELLEJECT_ID::GENERIC); weapon_base_onAttack(pl, ary_weaponData[WEAPON_ID::SKORPION], arg_thisWeapon, BITS_AKIMBOCHOICE_LEFT); diff --git a/src/shared/weapons/weapon_socommk23.qc b/src/shared/weapons/weapon_socommk23.qc index e6112c1..53e05fd 100644 --- a/src/shared/weapons/weapon_socommk23.qc +++ b/src/shared/weapons/weapon_socommk23.qc @@ -182,11 +182,11 @@ w_socommk23_primary(void) } } -#ifdef CLIENT - View_ShowMuzzleflash(MUZZLE_SMALL); - View_AddEvent(w_ejectshell_pistol, 0.0f); -#endif - + if(!(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SILENCER) ){ + weapon_ClientEffects(MUZZLEFLASH_ID::SMALL, SHELLEJECT_ID::GENERIC); + } else { + weapon_EjectShell(SHELLEJECT_ID::GENERIC); + } weapon_base_onAttack(pl, ary_weaponData[WEAPON_ID::SOCOMMK23], arg_thisWeapon, BITS_AKIMBOCHOICE_LEFT); diff --git a/src/shared/weapons/weapon_spas12.qc b/src/shared/weapons/weapon_spas12.qc index d24fbdd..3a7c2fd 100644 --- a/src/shared/weapons/weapon_spas12.qc +++ b/src/shared/weapons/weapon_spas12.qc @@ -169,9 +169,7 @@ w_spas12_primary(void) TS_Weapons_PlaySoundChannelDirect(pl, "weapons/spas12/spas12-pump.wav", CHAN_AUTO); // these pumps eject shells -#ifdef CLIENT - View_AddEvent(w_ejectshell_pistol, 0.0f); -#endif + weapon_EjectShell(SHELLEJECT_ID::SHOTGUN); int r = (float)input_sequence % 2; if(r == 0){ @@ -197,18 +195,12 @@ w_spas12_primary(void) if(arg_thisWeapon.iFireMode == BITS_FIREMODE_PUMP){ TS_Weapons_ViewAnimation(weaponseq_spas12::shootpump, (31.0f/35.0f) ); - // no shell! Pumping does that here. + // no shell! Pumping does that. pl.shotgunWaitingForPump = TRUE; -#ifdef CLIENT - View_ShowMuzzleflash(MUZZLE_SMALL); - // no shell, that comes in the pump soon after. -#endif + weapon_ShowMuzzleFlash(MUZZLEFLASH_ID::WEIRD); }else{ TS_Weapons_ViewAnimation(weaponseq_spas12::shootsemi, (31.0f/35.0f) ); -#ifdef CLIENT - View_ShowMuzzleflash(MUZZLE_SMALL); - View_AddEvent(w_ejectshell_pistol, 0.0f); -#endif + weapon_ClientEffects(MUZZLEFLASH_ID::WEIRD, SHELLEJECT_ID::SHOTGUN); } weapon_base_onAttack_multi(pl, ary_weaponData[WEAPON_ID::SPAS12], arg_thisWeapon, 8, BITS_AKIMBOCHOICE_LEFT); diff --git a/src/shared/weapons/weapon_steyraug.qc b/src/shared/weapons/weapon_steyraug.qc index 875a145..829861a 100644 --- a/src/shared/weapons/weapon_steyraug.qc +++ b/src/shared/weapons/weapon_steyraug.qc @@ -146,13 +146,14 @@ w_steyraug_primary(void) } else { SoundPitched_Send(pl, SNDP_STEYRAUG_FIRE_SIL); } - - TS_Weapons_ViewAnimation(weaponseq_steyraug::shoot, 31.0f/30.0f); -#ifdef CLIENT - View_ShowMuzzleflash(MUZZLE_SMALL); - View_AddEvent(w_ejectshell_pistol, 0.0f); -#endif + TS_Weapons_ViewAnimation(weaponseq_steyraug::shoot, 31.0f/30.0f); + + if(!(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SILENCER) ){ + weapon_ClientEffects(MUZZLEFLASH_ID::RIFLE, SHELLEJECT_ID::_56); + } else { + weapon_EjectShell(SHELLEJECT_ID::_56); + } weapon_base_onAttack(pl, ary_weaponData[WEAPON_ID::STEYRAUG], arg_thisWeapon, BITS_AKIMBOCHOICE_LEFT); @@ -180,21 +181,15 @@ w_steyraug_secondary(void) if(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SCOPE){ // toggle through the zoom. - + pl.iZoomLevel = (pl.iZoomLevel + 1) % 2; switch(pl.iZoomLevel){ - case -1:{ - //pl.viewzoom = 40/80; - pl.setZoom(0.5f); - pl.iZoomLevel++; - break;} case 0:{ - //pl.viewzoom = 0; pl.setZoom(1.00f); - pl.iZoomLevel = -1; break;} - - }//END OF switch - + case 1:{ + pl.setZoom(0.50f); + break;} + } } } diff --git a/src/shared/weapons/weapon_steyrtmp.qc b/src/shared/weapons/weapon_steyrtmp.qc index 13e298a..26352ae 100644 --- a/src/shared/weapons/weapon_steyrtmp.qc +++ b/src/shared/weapons/weapon_steyrtmp.qc @@ -180,10 +180,11 @@ w_steyrtmp_primary(void) } } -#ifdef CLIENT - View_ShowMuzzleflash(MUZZLE_SMALL); - View_AddEvent(w_ejectshell_pistol, 0.0f); -#endif + if(!(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SILENCER) ){ + weapon_ClientEffects(MUZZLEFLASH_ID::SMALL, SHELLEJECT_ID::_9MM); + } else { + weapon_EjectShell(SHELLEJECT_ID::_9MM); + } weapon_base_onAttack(pl, ary_weaponData[WEAPON_ID::STEYRTMP], arg_thisWeapon, BITS_AKIMBOCHOICE_LEFT); diff --git a/src/shared/weapons/weapon_ump.qc b/src/shared/weapons/weapon_ump.qc index 4cbde92..3a1651f 100644 --- a/src/shared/weapons/weapon_ump.qc +++ b/src/shared/weapons/weapon_ump.qc @@ -160,10 +160,11 @@ w_ump_primary(void) TS_Weapons_ViewAnimation(weaponseq_ump::shoot3, 19.0f/30.0f); } -#ifdef CLIENT - View_ShowMuzzleflash(MUZZLE_SMALL); - View_AddEvent(w_ejectshell_pistol, 0.0f); -#endif + if(!(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SILENCER) ){ + weapon_ClientEffects(MUZZLEFLASH_ID::SMALL, SHELLEJECT_ID::GENERIC); + } else { + weapon_EjectShell(SHELLEJECT_ID::GENERIC); + } weapon_base_onAttack(pl, ary_weaponData[WEAPON_ID::UMP], arg_thisWeapon, BITS_AKIMBOCHOICE_LEFT); @@ -191,20 +192,15 @@ w_ump_secondary(void) if(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SCOPE){ // toggle through the zoom. + pl.iZoomLevel = (pl.iZoomLevel + 1) % 2; switch(pl.iZoomLevel){ - case -1:{ - //pl.viewzoom = 40/80; - pl.setZoom(0.50f); - pl.iZoomLevel++; - break;} case 0:{ - //pl.viewzoom = 0; pl.setZoom(1.00f); - pl.iZoomLevel = -1; break;} - - }//END OF switch - + case 1:{ + pl.setZoom(0.50f); + break;} + } } } diff --git a/src/shared/weapons/weapon_usas12.qc b/src/shared/weapons/weapon_usas12.qc index 9a2348b..8addaa8 100644 --- a/src/shared/weapons/weapon_usas12.qc +++ b/src/shared/weapons/weapon_usas12.qc @@ -135,11 +135,7 @@ w_usas12_primary(void) TS_Weapons_ViewAnimation(weaponseq_usas12::shootsemi, 31.0f/35.0f); - -#ifdef CLIENT - View_ShowMuzzleflash(MUZZLE_SMALL); - View_AddEvent(w_ejectshell_pistol, 0.0f); -#endif + weapon_ClientEffects(MUZZLEFLASH_ID::WEIRD, SHELLEJECT_ID::SHOTGUN); weapon_base_onAttack_multi(pl, ary_weaponData[WEAPON_ID::USAS12], arg_thisWeapon, 8, BITS_AKIMBOCHOICE_LEFT);