diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..991ab64 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ + +*.ini diff --git a/ins2_changelog.txt b/ins2_changelog.txt index a693806..cf89449 100644 --- a/ins2_changelog.txt +++ b/ins2_changelog.txt @@ -85,4 +85,38 @@ Update 1.5: *Tweaked animations on the Glock 17 viewmodel *Revised credits for the SVD Dragunov *Model mags.mdl has been updated to add the M1A1 Carbine magazine bodygroup (model will receive no further updates from now on) -*Very minor update for the test map: fixed position of some items and tweaked clip brushes at the top \ No newline at end of file +*Very minor update for the test map: fixed position of some items and tweaked clip brushes at the top + +Update 1.6: +*New Weapons Added: + *H&K VP-70M + *H&K MP5SD2 + *H&K G36C + *XM21 + *PKM + *MG-34 + *FN SCAR-H + *SVT-40 + *M3 Grease Gun + *RGO Grenade + *M16A1 + M203 GL + *OTs-14 Groza 4 + GP-30 GL + *AN-94 +*Added a map script for the following series: Under the Black Moon, Royals +*Changed weapon names and prices in the Buy Menu +*Disposable Launchers now have their own category in the Equipment Menu +*Fixed the BuyMenu taking away your money after attempting to buy a weapon you dropped +*Fixed macro abuse on the M16A4 (Thanks SV BOY) +*Added category for the Equipment Menu: + *Time-Fused Grenades + *Impact Grenades + *Disposable Launchers + *High Explosives +*Removed 'gp25.mdl' in favor of the new grenade model 'vog25.mdl' +*Updated AKM viewmodel to support new grenade model +*Updated FGD file: + *Displays the new AKM grenade model + *Rearranged the list of weapons per category, much like the buy menu + *New weapons and their ammo entities are listed separately, for easier identification +*Test map updated with a sligthly new layout (the weapon room will tank your FPS, sorry in advance!) +*Removed unused skybox files and its lines inside the map's .res file \ No newline at end of file diff --git a/ins2_credits_1st_release.txt b/ins2_credits.txt similarity index 99% rename from ins2_credits_1st_release.txt rename to ins2_credits.txt index 1f7bb2d..092dfe1 100644 --- a/ins2_credits_1st_release.txt +++ b/ins2_credits.txt @@ -64,6 +64,9 @@ Testers: ·Zode ·Tayklor ·Garompa +·AleKK +·SV BOY +·Outerbeast ·H2Whoa ·Michael "Mikee" Tsarouhas /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ @@ -735,4 +738,6 @@ Special Thanks to: ·Sniper ·The303 ·AleKK + ·SV BOY + ·Outerbeast ______________________________________________________________________________________________________________________________________________ \ No newline at end of file diff --git a/maps/sc_insurgency.bsp b/maps/sc_insurgency.bsp index 3f938d3..a459246 100644 Binary files a/maps/sc_insurgency.bsp and b/maps/sc_insurgency.bsp differ diff --git a/maps/sc_insurgency.res b/maps/sc_insurgency.res new file mode 100644 index 0000000..c992b63 --- /dev/null +++ b/maps/sc_insurgency.res @@ -0,0 +1,6 @@ +gfx/env/doi_sky10abk.tga +gfx/env/doi_sky10adn.tga +gfx/env/doi_sky10aft.tga +gfx/env/doi_sky10alf.tga +gfx/env/doi_sky10art.tga +gfx/env/doi_sky10aup.tga \ No newline at end of file diff --git a/models/ins2/ammo/mags2.mdl b/models/ins2/ammo/mags2.mdl new file mode 100644 index 0000000..806261b Binary files /dev/null and b/models/ins2/ammo/mags2.mdl differ diff --git a/models/ins2/wpn/akm/v_akm.mdl b/models/ins2/wpn/akm/v_akm.mdl index 5f2e31a..d092961 100644 Binary files a/models/ins2/wpn/akm/v_akm.mdl and b/models/ins2/wpn/akm/v_akm.mdl differ diff --git a/models/ins2/wpn/akm/vog25.mdl b/models/ins2/wpn/akm/vog25.mdl new file mode 100644 index 0000000..e4d4f44 Binary files /dev/null and b/models/ins2/wpn/akm/vog25.mdl differ diff --git a/models/ins2/wpn/an94/p_an94.mdl b/models/ins2/wpn/an94/p_an94.mdl new file mode 100644 index 0000000..ff5ccbf Binary files /dev/null and b/models/ins2/wpn/an94/p_an94.mdl differ diff --git a/models/ins2/wpn/an94/v_an94.mdl b/models/ins2/wpn/an94/v_an94.mdl new file mode 100644 index 0000000..7d9acb9 Binary files /dev/null and b/models/ins2/wpn/an94/v_an94.mdl differ diff --git a/models/ins2/wpn/an94/w_an94.mdl b/models/ins2/wpn/an94/w_an94.mdl new file mode 100644 index 0000000..0f19ba2 Binary files /dev/null and b/models/ins2/wpn/an94/w_an94.mdl differ diff --git a/models/ins2/wpn/g36c/p_g36c.mdl b/models/ins2/wpn/g36c/p_g36c.mdl new file mode 100644 index 0000000..41d9eaa Binary files /dev/null and b/models/ins2/wpn/g36c/p_g36c.mdl differ diff --git a/models/ins2/wpn/g36c/v_g36c.mdl b/models/ins2/wpn/g36c/v_g36c.mdl new file mode 100644 index 0000000..f9f4f0a Binary files /dev/null and b/models/ins2/wpn/g36c/v_g36c.mdl differ diff --git a/models/ins2/wpn/g36c/w_g36c.mdl b/models/ins2/wpn/g36c/w_g36c.mdl new file mode 100644 index 0000000..e690cf7 Binary files /dev/null and b/models/ins2/wpn/g36c/w_g36c.mdl differ diff --git a/models/ins2/wpn/grease/p_grease.mdl b/models/ins2/wpn/grease/p_grease.mdl new file mode 100644 index 0000000..bdeeb06 Binary files /dev/null and b/models/ins2/wpn/grease/p_grease.mdl differ diff --git a/models/ins2/wpn/grease/v_grease.mdl b/models/ins2/wpn/grease/v_grease.mdl new file mode 100644 index 0000000..41be6d6 Binary files /dev/null and b/models/ins2/wpn/grease/v_grease.mdl differ diff --git a/models/ins2/wpn/grease/w_grease.mdl b/models/ins2/wpn/grease/w_grease.mdl new file mode 100644 index 0000000..ec05893 Binary files /dev/null and b/models/ins2/wpn/grease/w_grease.mdl differ diff --git a/models/ins2/wpn/groza/p_groza.mdl b/models/ins2/wpn/groza/p_groza.mdl new file mode 100644 index 0000000..07c1cd5 Binary files /dev/null and b/models/ins2/wpn/groza/p_groza.mdl differ diff --git a/models/ins2/wpn/groza/v_groza.mdl b/models/ins2/wpn/groza/v_groza.mdl new file mode 100644 index 0000000..35e46ec Binary files /dev/null and b/models/ins2/wpn/groza/v_groza.mdl differ diff --git a/models/ins2/wpn/groza/w_groza.mdl b/models/ins2/wpn/groza/w_groza.mdl new file mode 100644 index 0000000..05b5cef Binary files /dev/null and b/models/ins2/wpn/groza/w_groza.mdl differ diff --git a/models/ins2/wpn/m16a1/p_m16a1.mdl b/models/ins2/wpn/m16a1/p_m16a1.mdl new file mode 100644 index 0000000..4ef7d3d Binary files /dev/null and b/models/ins2/wpn/m16a1/p_m16a1.mdl differ diff --git a/models/ins2/wpn/m16a1/v_m16a1.mdl b/models/ins2/wpn/m16a1/v_m16a1.mdl new file mode 100644 index 0000000..67ebf20 Binary files /dev/null and b/models/ins2/wpn/m16a1/v_m16a1.mdl differ diff --git a/models/ins2/wpn/m16a1/w_m16a1.mdl b/models/ins2/wpn/m16a1/w_m16a1.mdl new file mode 100644 index 0000000..8d1018d Binary files /dev/null and b/models/ins2/wpn/m16a1/w_m16a1.mdl differ diff --git a/models/ins2/wpn/m21/p_m21.mdl b/models/ins2/wpn/m21/p_m21.mdl new file mode 100644 index 0000000..03c7a0a Binary files /dev/null and b/models/ins2/wpn/m21/p_m21.mdl differ diff --git a/models/ins2/wpn/m21/v_m21.mdl b/models/ins2/wpn/m21/v_m21.mdl new file mode 100644 index 0000000..25a82ba Binary files /dev/null and b/models/ins2/wpn/m21/v_m21.mdl differ diff --git a/models/ins2/wpn/m21/w_m21.mdl b/models/ins2/wpn/m21/w_m21.mdl new file mode 100644 index 0000000..8fa0ec7 Binary files /dev/null and b/models/ins2/wpn/m21/w_m21.mdl differ diff --git a/models/ins2/wpn/m92fs/v_m92fs.mdl b/models/ins2/wpn/m92fs/v_m92fs.mdl index 76bcded..e3af8dc 100644 Binary files a/models/ins2/wpn/m92fs/v_m92fs.mdl and b/models/ins2/wpn/m92fs/v_m92fs.mdl differ diff --git a/models/ins2/wpn/mg34/p_mg34.mdl b/models/ins2/wpn/mg34/p_mg34.mdl new file mode 100644 index 0000000..4af41a4 Binary files /dev/null and b/models/ins2/wpn/mg34/p_mg34.mdl differ diff --git a/models/ins2/wpn/mg34/v_mg34.mdl b/models/ins2/wpn/mg34/v_mg34.mdl new file mode 100644 index 0000000..c9ec29c Binary files /dev/null and b/models/ins2/wpn/mg34/v_mg34.mdl differ diff --git a/models/ins2/wpn/mg34/w_mg34.mdl b/models/ins2/wpn/mg34/w_mg34.mdl new file mode 100644 index 0000000..62b4ee0 Binary files /dev/null and b/models/ins2/wpn/mg34/w_mg34.mdl differ diff --git a/models/ins2/wpn/mp5sd/p_mp5sd.mdl b/models/ins2/wpn/mp5sd/p_mp5sd.mdl new file mode 100644 index 0000000..dd6b93e Binary files /dev/null and b/models/ins2/wpn/mp5sd/p_mp5sd.mdl differ diff --git a/models/ins2/wpn/mp5sd/v_mp5sd.mdl b/models/ins2/wpn/mp5sd/v_mp5sd.mdl new file mode 100644 index 0000000..0343cc0 Binary files /dev/null and b/models/ins2/wpn/mp5sd/v_mp5sd.mdl differ diff --git a/models/ins2/wpn/mp5sd/w_mp5sd.mdl b/models/ins2/wpn/mp5sd/w_mp5sd.mdl new file mode 100644 index 0000000..41a3098 Binary files /dev/null and b/models/ins2/wpn/mp5sd/w_mp5sd.mdl differ diff --git a/models/ins2/wpn/pkm/p_pkm.mdl b/models/ins2/wpn/pkm/p_pkm.mdl new file mode 100644 index 0000000..630752e Binary files /dev/null and b/models/ins2/wpn/pkm/p_pkm.mdl differ diff --git a/models/ins2/wpn/pkm/v_pkm.mdl b/models/ins2/wpn/pkm/v_pkm.mdl new file mode 100644 index 0000000..d30052a Binary files /dev/null and b/models/ins2/wpn/pkm/v_pkm.mdl differ diff --git a/models/ins2/wpn/pkm/w_pkm.mdl b/models/ins2/wpn/pkm/w_pkm.mdl new file mode 100644 index 0000000..c91367d Binary files /dev/null and b/models/ins2/wpn/pkm/w_pkm.mdl differ diff --git a/models/ins2/wpn/rgo/p_rgo.mdl b/models/ins2/wpn/rgo/p_rgo.mdl new file mode 100644 index 0000000..da03328 Binary files /dev/null and b/models/ins2/wpn/rgo/p_rgo.mdl differ diff --git a/models/ins2/wpn/rgo/v_rgo.mdl b/models/ins2/wpn/rgo/v_rgo.mdl new file mode 100644 index 0000000..0978c69 Binary files /dev/null and b/models/ins2/wpn/rgo/v_rgo.mdl differ diff --git a/models/ins2/wpn/rgo/w_rgo.mdl b/models/ins2/wpn/rgo/w_rgo.mdl new file mode 100644 index 0000000..65fd2e2 Binary files /dev/null and b/models/ins2/wpn/rgo/w_rgo.mdl differ diff --git a/models/ins2/wpn/scar/p_scar.mdl b/models/ins2/wpn/scar/p_scar.mdl new file mode 100644 index 0000000..6082a50 Binary files /dev/null and b/models/ins2/wpn/scar/p_scar.mdl differ diff --git a/models/ins2/wpn/scar/v_scar.mdl b/models/ins2/wpn/scar/v_scar.mdl new file mode 100644 index 0000000..a0eeb03 Binary files /dev/null and b/models/ins2/wpn/scar/v_scar.mdl differ diff --git a/models/ins2/wpn/scar/w_scar.mdl b/models/ins2/wpn/scar/w_scar.mdl new file mode 100644 index 0000000..80bdd5f Binary files /dev/null and b/models/ins2/wpn/scar/w_scar.mdl differ diff --git a/models/ins2/wpn/scopes/xm21.mdl b/models/ins2/wpn/scopes/xm21.mdl new file mode 100644 index 0000000..2d534a1 Binary files /dev/null and b/models/ins2/wpn/scopes/xm21.mdl differ diff --git a/models/ins2/wpn/svt40/p_svt40.mdl b/models/ins2/wpn/svt40/p_svt40.mdl new file mode 100644 index 0000000..a6d1897 Binary files /dev/null and b/models/ins2/wpn/svt40/p_svt40.mdl differ diff --git a/models/ins2/wpn/svt40/v_svt40.mdl b/models/ins2/wpn/svt40/v_svt40.mdl new file mode 100644 index 0000000..f30a377 Binary files /dev/null and b/models/ins2/wpn/svt40/v_svt40.mdl differ diff --git a/models/ins2/wpn/svt40/w_svt40.mdl b/models/ins2/wpn/svt40/w_svt40.mdl new file mode 100644 index 0000000..a64ecf1 Binary files /dev/null and b/models/ins2/wpn/svt40/w_svt40.mdl differ diff --git a/models/ins2/wpn/vp70/p_vp70.mdl b/models/ins2/wpn/vp70/p_vp70.mdl new file mode 100644 index 0000000..e57f9e9 Binary files /dev/null and b/models/ins2/wpn/vp70/p_vp70.mdl differ diff --git a/models/ins2/wpn/vp70/v_vp70.mdl b/models/ins2/wpn/vp70/v_vp70.mdl new file mode 100644 index 0000000..aa0c275 Binary files /dev/null and b/models/ins2/wpn/vp70/v_vp70.mdl differ diff --git a/models/ins2/wpn/vp70/w_vp70.mdl b/models/ins2/wpn/vp70/w_vp70.mdl new file mode 100644 index 0000000..321efd5 Binary files /dev/null and b/models/ins2/wpn/vp70/w_vp70.mdl differ diff --git a/scripts/maps/ins2/BuyMenu.as b/scripts/maps/ins2/BuyMenu.as index 3236818..c823a76 100644 --- a/scripts/maps/ins2/BuyMenu.as +++ b/scripts/maps/ins2/BuyMenu.as @@ -4,10 +4,10 @@ DISCLAIMER: The original Buy Menu script was built back in 2016 by Solokiller, and released by him for free for everyone on the Sven Co-op Forums. -This script contains code integrates the Insurgency Project ONLY and if you paid money to access it, you have been scammed. +This script contains code integrates the Insurgency Pack ONLY and if you paid money to access it, you have been scammed. Do not remove or change comments made by contributors in any way, shape, or form. -Do not sell or make money in any way, shape or form from this script, be it old versions or newest releases, or any other assets from this project. +Do not sell or make money in any way, shape or form from this script, or any other assets from this pack. Doing so is in breach of New World Interactive's EULAs. New World Interactive's EULAs can be found in the project's GITHUB page. @@ -21,25 +21,35 @@ namespace BuyMenu dictionary BuyPoints; // Save the player's current money dictionary OldScore; // Save the player's score (frags) -const string MoneySignSpr = "ins2/moneysign.spr"; +string MoneySignSpr = "ins2/moneysign.spr"; //plugin cvars CCVar@ g_MaxMoney; CCVar@ g_MoneyPerScore; CCVar@ g_StartMoney; //fall back for map_script -const int MaxMoney = 16000; -const int MoneyPerScore = 10; -const int StartMoney = 0; +int MaxMoney = 16000; +int MoneyPerScore = 10; +int StartMoney = 0; +// KernCore: Stop using comprar/shop in my buymenus, typing 'buy' is way better than typing 7/4 letters bool FirstArgChecker( const CCommand@ args ) { - return args.Arg(0).ToLowercase() == "buy" - || args.Arg(0).ToLowercase() == "/buy" - || args.Arg(0).ToLowercase() == "!buy" - || args.Arg(0).ToLowercase() == ".buy" - || args.Arg(0).ToLowercase() == "\\buy" - || args.Arg(0).ToLowercase() == "#buy"; + array FirstArg = { + "buy", "/buy", "!buy", ".buy", "\\buy", "#buy" + }; + + string szSave; + for( uint i = 0; i < FirstArg.length(); i++ ) + { + if( args.Arg(0) == FirstArg[i] ) + { + szSave = FirstArg[i]; + break; + } + } + + return args.Arg(0).ToLowercase() == szSave; } string PlayerID( CBasePlayer@ pPlayer ) @@ -62,6 +72,7 @@ void MoneyInit() { BuyPoints.deleteAll(); OldScore.deleteAll(); + g_Game.PrecacheModel( "sprites/" + BuyMenu::MoneySignSpr ); g_Hooks.RegisterHook( Hooks::Player::ClientPutInServer, @INS2_ClientPutInServer ); g_Hooks.RegisterHook( Hooks::Player::PlayerPostThink, @INS2_PlayerPostThink ); @@ -204,6 +215,7 @@ void INS2_Buy( const CCommand@ args ) { BuyMenu::BuyPoints[BuyMenu::PlayerID( pPlayer )] = uint(BuyMenu::BuyPoints[BuyMenu::PlayerID( pPlayer )]) - uiCost; BuyMenu::ShowPointsSprite( pPlayer ); + pPlayer.SetItemPickupTimes( 0.0 ); pPlayer.GiveNamedItem( szItemName ); } else @@ -391,6 +403,7 @@ HookReturnCode INS2_ClientSay( SayParameters@ pParams ) { BuyMenu::BuyPoints[BuyMenu::PlayerID( pPlayer )] = uint(BuyMenu::BuyPoints[BuyMenu::PlayerID( pPlayer )]) - uiCost; BuyMenu::ShowPointsSprite( pPlayer ); + pPlayer.SetItemPickupTimes( 0.0 ); pPlayer.GiveNamedItem( szItemName ); } else @@ -526,18 +539,18 @@ void ShowPointsSprite( CBasePlayer@ pPlayer ) { // Numeric Display HUDNumDisplayParams NumDisplayParams; - NumDisplayParams.channel = 0; - NumDisplayParams.flags = HUD_ELEM_ABSOLUTE_X | HUD_ELEM_ABSOLUTE_Y | HUD_ELEM_DYNAMIC_ALPHA | HUD_ELEM_EFFECT_ONCE; - NumDisplayParams.x = 5; - NumDisplayParams.y = -35; + NumDisplayParams.channel = 0; + NumDisplayParams.flags = HUD_ELEM_ABSOLUTE_X | HUD_ELEM_ABSOLUTE_Y | HUD_ELEM_DYNAMIC_ALPHA | HUD_ELEM_EFFECT_ONCE; + NumDisplayParams.x = 5; // HUD_ELEM_ABSOLUTE_X affects this + NumDisplayParams.y = -35; // HUD_ELEM_ABSOLUTE_Y affects this NumDisplayParams.spritename = MoneySignSpr; - NumDisplayParams.defdigits = 0; - NumDisplayParams.maxdigits = 5; - NumDisplayParams.left = 0; // Offset - NumDisplayParams.top = 0; // Offset - NumDisplayParams.width = 16; // 0: auto; use total width of the sprite - NumDisplayParams.height = 24; // 0: auto; use total height of the sprite - NumDisplayParams.color1 = (int(BuyPoints[PlayerID( pPlayer )]) <= 0) ? RGBA_RED : RGBA_SVENCOOP; // Default Sven HUD colors + NumDisplayParams.defdigits = 0; + NumDisplayParams.maxdigits = 5; + NumDisplayParams.left = 0; // Offset + NumDisplayParams.top = 0; // Offset + NumDisplayParams.width = 16; // 0: auto; use total width of the sprite + NumDisplayParams.height = 24; // 0: auto; use total height of the sprite + NumDisplayParams.color1 = (int(BuyPoints[PlayerID( pPlayer )]) <= 0) ? RGBA_RED : RGBA_SVENCOOP; // Default Sven HUD colors if( int(OldScore[PlayerID( pPlayer )]) == int(pPlayer.pev.frags) ) NumDisplayParams.color2 = RGBA_SVENCOOP; // Default Sven HUD colors @@ -546,14 +559,14 @@ void ShowPointsSprite( CBasePlayer@ pPlayer ) else if( int(OldScore[PlayerID( pPlayer )]) > int(pPlayer.pev.frags) ) NumDisplayParams.color2 = RGBA_RED; // Default Sven HUD colors - NumDisplayParams.fxTime = 0.5; + NumDisplayParams.fxTime = 0.5; if( g_MoneyPerScore is null ) NumDisplayParams.effect = (int(BuyPoints[PlayerID( pPlayer )]) <= 0 || int(BuyPoints[PlayerID( pPlayer )]) >= MaxMoney) ? HUD_EFFECT_NONE : HUD_EFFECT_RAMP_DOWN; else NumDisplayParams.effect = (int(BuyPoints[PlayerID( pPlayer )]) <= 0 || int(BuyPoints[PlayerID( pPlayer )]) >= g_MoneyPerScore.GetInt()) ? HUD_EFFECT_NONE : HUD_EFFECT_RAMP_DOWN; - NumDisplayParams.value = uint(BuyPoints[PlayerID( pPlayer )]); + NumDisplayParams.value = uint(BuyPoints[PlayerID( pPlayer )]); g_PlayerFuncs.HudNumDisplay( pPlayer, NumDisplayParams ); } @@ -655,6 +668,8 @@ final class BuyableItem BuyPoints[PlayerID( pPlayer )] = p - m_uiCost; ShowPointsSprite( pPlayer ); + pPlayer.SetItemPickupTimes( 0.0 ); + pPlayer.GiveNamedItem( m_szEntityName ); pPlayer.SelectItem( m_szEntityName ); } @@ -667,53 +682,62 @@ final class BuyableItem } //Primary -const string sSmg = "Sub Machine Guns"; -const string sCbn = "Carbines"; -const string sShg = "Shotguns"; -const string sAsr = "Assault Rifles"; -const string sRfl = "Rifles"; -const string sLmg = "Light Machine Guns"; -const string sLcr = "Launchers"; +string sSmg = "Sub Machine Guns"; +string sCbn = "Carbines"; +string sShg = "Shotguns"; +string sAsr = "Assault Rifles"; +string sRfl = "Rifles/Battle Rifles/Snipers"; +string sLmg = "Light Machine Guns"; +string sLcr = "Launchers"; //Secondary -const string sMle = "Melees"; -const string sPtl = "Pistols"; -const string sRvl = "Revolvers"; +string sMle = "Melees"; +string sPtl = "Pistols"; +string sRvl = "Revolvers"; +//Equipment +string sTgr = "Time-fused Grenades"; +string sIgr = "Impact Grenades"; +string sDlc = "Disposable Launchers"; +//string sHex = "High Explosives"; //Text -const string sChoose = "Choose"; -const string sAmmo = "Ammo"; +string sChoose = "Choose"; +string sAmmo = "Ammo"; final class BuyMenu { array m_Items; - private CTextMenu@ m_pMenu = null; + private CTextMenu@ m_pMenu = null; //Primary Menu - private CTextMenu@ m_pPrimaryMenu = null; - private CTextMenu@ m_pSMGMenu = null; - private CTextMenu@ m_pCARBINEMenu = null; - private CTextMenu@ m_pSHOTGUNMenu = null; - private CTextMenu@ m_pASSAULTMenu = null; - private CTextMenu@ m_pRIFLEMenu = null; - private CTextMenu@ m_pLMGMenu = null; - private CTextMenu@ m_pLAUNCHERMenu = null; + private CTextMenu@ m_pPrimaryMenu = null; + private CTextMenu@ m_pSMGMenu = null; + private CTextMenu@ m_pCARBINEMenu = null; + private CTextMenu@ m_pSHOTGUNMenu = null; + private CTextMenu@ m_pASSAULTMenu = null; + private CTextMenu@ m_pRIFLEMenu = null; + private CTextMenu@ m_pLMGMenu = null; + private CTextMenu@ m_pLAUNCHERMenu = null; //Secondary Menu - private CTextMenu@ m_pSecondaryMenu = null; - private CTextMenu@ m_pPISTOLMenu = null; - private CTextMenu@ m_pREVOLVERMenu = null; - private CTextMenu@ m_pMELEEMenu = null; + private CTextMenu@ m_pSecondaryMenu = null; + private CTextMenu@ m_pPISTOLMenu = null; + private CTextMenu@ m_pREVOLVERMenu = null; + private CTextMenu@ m_pMELEEMenu = null; //Equipment Menu - private CTextMenu@ m_pEquipmentMenu = null; + private CTextMenu@ m_pEquipmentMenu = null; + private CTextMenu@ m_pTIMEDMenu = null; + private CTextMenu@ m_pIMPACTMenu = null; + private CTextMenu@ m_pDISPOSABLEMenu = null; + //private CTextMenu@ m_pEXPLOSIVEMenu = null; //Ammo Menu - private CTextMenu@ m_pAmmoMenu = null; - private CTextMenu@ m_pAmPISTOL = null; - private CTextMenu@ m_pAmREVOLVER = null; - private CTextMenu@ m_pAmSMG = null; - private CTextMenu@ m_pAmCARBINE = null; - private CTextMenu@ m_pAmSHOTGUN = null; - private CTextMenu@ m_pAmASSAULT = null; - private CTextMenu@ m_pAmRIFLE = null; - private CTextMenu@ m_pAmLMG = null; - private CTextMenu@ m_pAmLAUNCHER = null; + private CTextMenu@ m_pAmmoMenu = null; + private CTextMenu@ m_pAmPISTOL = null; + private CTextMenu@ m_pAmREVOLVER = null; + private CTextMenu@ m_pAmSMG = null; + private CTextMenu@ m_pAmCARBINE = null; + private CTextMenu@ m_pAmSHOTGUN = null; + private CTextMenu@ m_pAmASSAULT = null; + private CTextMenu@ m_pAmRIFLE = null; + private CTextMenu@ m_pAmLMG = null; + private CTextMenu@ m_pAmLAUNCHER = null; void RemoveItems() { @@ -723,6 +747,22 @@ final class BuyMenu } } + void RemoveItem( BuyableItem@ pItem ) + { + if( pItem is null ) + return; + + if( m_Items.findByRef( @pItem ) != -1 ) + { + return; + } + + //m_Items.insertLast( pItem ); + + //if( m_pMenu !is null ) + // @m_pMenu = null; + } + void AddItem( BuyableItem@ pItem ) { if( pItem is null ) @@ -756,7 +796,8 @@ final class BuyMenu m_pMenu.AddItem( "Buy ammo" ); m_pMenu.Register(); - @m_pPrimaryMenu = CTextMenu( TextMenuPlayerSlotCallback( this.PrimaryCallback ) ); + //Primary + @m_pPrimaryMenu = CTextMenu( TextMenuPlayerSlotCallback( this.PrimaryCatCallback ) ); m_pPrimaryMenu.SetTitle( sChoose + " primary weapon category: " ); m_pPrimaryMenu.AddItem( sSmg, null ); m_pPrimaryMenu.AddItem( sCbn, null ); @@ -767,7 +808,8 @@ final class BuyMenu m_pPrimaryMenu.AddItem( sLcr, null ); m_pPrimaryMenu.Register(); - @m_pSecondaryMenu = CTextMenu( TextMenuPlayerSlotCallback( this.SecondaryCallback ) ); + //Secondary + @m_pSecondaryMenu = CTextMenu( TextMenuPlayerSlotCallback( this.SecondaryCatCallback ) ); m_pSecondaryMenu.SetTitle( sChoose + " secondary weapon category: " ); m_pSecondaryMenu.AddItem( sMle, null ); m_pSecondaryMenu.AddItem( sPtl, null ); @@ -775,8 +817,14 @@ final class BuyMenu m_pSecondaryMenu.Register(); // Equipment - @m_pEquipmentMenu = CTextMenu( TextMenuPlayerSlotCallback( this.WeaponCallback ) ); - m_pEquipmentMenu.SetTitle( sChoose + " equipment: " ); + @m_pEquipmentMenu = CTextMenu( TextMenuPlayerSlotCallback( this.EquipmentCatCallback ) ); + m_pEquipmentMenu.SetTitle( sChoose + " equipment category: " ); + m_pEquipmentMenu.AddItem( sTgr, null ); + m_pEquipmentMenu.AddItem( sIgr, null ); + m_pEquipmentMenu.AddItem( sDlc, null ); + //m_pEquipmentMenu.AddItem( sHex, null ); + m_pEquipmentMenu.Register(); + // Ammo @m_pAmmoMenu = CTextMenu( TextMenuPlayerSlotCallback( this.AmmoCatCallBack ) ); m_pAmmoMenu.SetTitle( sChoose + " Ammo: " ); @@ -789,6 +837,8 @@ final class BuyMenu m_pAmmoMenu.AddItem( sRfl ); m_pAmmoMenu.AddItem( sLmg ); m_pAmmoMenu.AddItem( sLcr ); + m_pAmmoMenu.Register(); + //Primary Menu // SMG @m_pSMGMenu = CTextMenu( TextMenuPlayerSlotCallback( this.WeaponCallback ) ); @@ -825,6 +875,7 @@ final class BuyMenu m_pLAUNCHERMenu.SetTitle( sChoose + " " + sLcr + ": " ); @m_pAmLAUNCHER = CTextMenu( TextMenuPlayerSlotCallback( this.AmmoCallBack ) ); m_pAmLAUNCHER.SetTitle( sChoose + " " + sLcr + " " + sAmmo + ": " ); + //Secondary menu // Melee @m_pMELEEMenu = CTextMenu( TextMenuPlayerSlotCallback( this.WeaponCallback ) ); @@ -840,6 +891,20 @@ final class BuyMenu @m_pAmREVOLVER = CTextMenu( TextMenuPlayerSlotCallback( this.AmmoCallBack ) ); m_pAmREVOLVER.SetTitle( sChoose + " " + sRvl + " " + sAmmo + ": " ); + //Equipment menu + //Timed Grenades + @m_pTIMEDMenu = CTextMenu( TextMenuPlayerSlotCallback( this.EquipCallBack ) ); + m_pTIMEDMenu.SetTitle( sChoose + " " + sTgr + ": " ); + //Impact Grenades + @m_pIMPACTMenu = CTextMenu( TextMenuPlayerSlotCallback( this.EquipCallBack ) ); + m_pIMPACTMenu.SetTitle( sChoose + " " + sIgr + ": " ); + //Disposable Launchers + @m_pDISPOSABLEMenu = CTextMenu( TextMenuPlayerSlotCallback( this.EquipCallBack ) ); + m_pDISPOSABLEMenu.SetTitle( sChoose + " " + sDlc + ": " ); + //High Explosive + //@m_pEXPLOSIVEMenu = CTextMenu( TextMenuPlayerSlotCallback( this.EquipCallBack ) ); + //m_pEXPLOSIVEMenu.SetTitle( sChoose + " " + sHex + ": " ); + for( uint i = 0; i < m_Items.length(); i++ ) { BuyableItem@ pItem = m_Items[i]; @@ -870,7 +935,17 @@ final class BuyMenu m_pREVOLVERMenu.AddItem( pItem.Description, any(@pItem) ); } else if( pItem.Category == "equipment" ) - m_pEquipmentMenu.AddItem( pItem.Description, any(@pItem) ); + { + //m_pEquipmentMenu.AddItem( pItem.Description, any(@pItem) ); + if( pItem.SubCategory == "timed" ) + m_pTIMEDMenu.AddItem( pItem.Description, any(@pItem) ); + else if( pItem.SubCategory == "impact" ) + m_pIMPACTMenu.AddItem( pItem.Description, any(@pItem) ); + else if( pItem.SubCategory == "disposable" ) + m_pDISPOSABLEMenu.AddItem( pItem.Description, any(@pItem) ); + //else if( pItem.SubCategory == "explosive" ) + // m_pEXPLOSIVEMenu.AddItem( pItem.Description, any(@pItem) ); + } else if( pItem.Category == "ammo" ) { if( pItem.SubCategory == "pistol" ) @@ -894,9 +969,7 @@ final class BuyMenu } } - m_pEquipmentMenu.Register(); - m_pAmmoMenu.Register(); - //Primary + //Primary categories m_pSMGMenu.Register(); m_pCARBINEMenu.Register(); m_pSHOTGUNMenu.Register(); @@ -904,10 +977,15 @@ final class BuyMenu m_pRIFLEMenu.Register(); m_pLMGMenu.Register(); m_pLAUNCHERMenu.Register(); - //Secondary + //Secondary categories m_pMELEEMenu.Register(); m_pPISTOLMenu.Register(); m_pREVOLVERMenu.Register(); + //Equipment categories + m_pTIMEDMenu.Register(); + m_pIMPACTMenu.Register(); + m_pDISPOSABLEMenu.Register(); + //m_pEXPLOSIVEMenu.Register(); //Ammo categories m_pAmPISTOL.Register(); m_pAmREVOLVER.Register(); @@ -936,7 +1014,7 @@ final class BuyMenu } } - private void PrimaryCallback( CTextMenu@ menu, CBasePlayer@ pPlayer, int iSlot, const CTextMenuItem@ pItem ) + private void PrimaryCatCallback( CTextMenu@ menu, CBasePlayer@ pPlayer, int iSlot, const CTextMenuItem@ pItem ) { if( pItem !is null ) { @@ -958,7 +1036,7 @@ final class BuyMenu } } - private void SecondaryCallback( CTextMenu@ menu, CBasePlayer@ pPlayer, int iSlot, const CTextMenuItem@ pItem ) + private void SecondaryCatCallback( CTextMenu@ menu, CBasePlayer@ pPlayer, int iSlot, const CTextMenuItem@ pItem ) { if( pItem !is null ) { @@ -972,6 +1050,22 @@ final class BuyMenu } } + private void EquipmentCatCallback( CTextMenu@ menu, CBasePlayer@ pPlayer, int iSlot, const CTextMenuItem@ pItem ) + { + if( pItem !is null ) + { + string sChoice = pItem.m_szName; + if( sChoice == sTgr ) + m_pTIMEDMenu.Open( 0, 0, pPlayer ); + else if( sChoice == sIgr ) + m_pIMPACTMenu.Open( 0, 0, pPlayer ); + else if( sChoice == sDlc ) + m_pDISPOSABLEMenu.Open( 0, 0, pPlayer ); + //else if( sChoice == sHex ) + // m_pEXPLOSIVEMenu.Open( 0, 0, pPlayer ); + } + } + private void AmmoCatCallBack( CTextMenu@ menu, CBasePlayer@ pPlayer, int iSlot, const CTextMenuItem@ pItem ) { if( pItem !is null ) @@ -1015,6 +1109,23 @@ final class BuyMenu } } + private void EquipCallBack( CTextMenu@ menu, CBasePlayer@ pPlayer, int iSlot, const CTextMenuItem@ pItem ) + { + if( pItem !is null ) + { + BuyableItem@ pBuyItem = null; + + pItem.m_pUserData.retrieve( @pBuyItem ); + + if( pBuyItem !is null ) + { + pBuyItem.Buy( pPlayer ); + if( pPlayer.m_rgAmmo( pPlayer.HasNamedPlayerItem( pBuyItem.EntityName ).GetWeaponPtr().m_iPrimaryAmmoType ) != pPlayer.GetMaxAmmo( pBuyItem.EntityName ) ) + menu.Open( 0, 0, pPlayer); + } + } + } + private void WeaponCallback( CTextMenu@ menu, CBasePlayer@ pPlayer, int iSlot, const CTextMenuItem@ pItem ) { if( pItem !is null ) @@ -1032,4 +1143,4 @@ final class BuyMenu } } -} +} \ No newline at end of file diff --git a/scripts/maps/ins2/arifl/weapon_ins2ak12.as b/scripts/maps/ins2/arifl/weapon_ins2ak12.as index ce27c6d..e79118e 100644 --- a/scripts/maps/ins2/arifl/weapon_ins2ak12.as +++ b/scripts/maps/ins2/arifl/weapon_ins2ak12.as @@ -53,11 +53,12 @@ int WEIGHT = 101; int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY; uint DAMAGE = 25; uint SLOT = 5; -uint POSITION = 12; +uint POSITION = 7; float RPM_AIR = 680; //Rounds per minute in air float RPM_WTR = 600; //Rounds per minute in water float RPM_BURST_AIR = 800; //Burst fire rate in air float RPM_BURST_WTR = 695; //Burst fire rate in water +uint AIM_FOV = 40; // Below 50 hides crosshair string AMMO_TYPE = "ins2_5.45x39mm"; class weapon_ins2ak12 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase @@ -235,7 +236,7 @@ class weapon_ins2ak12 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase case INS2BASE::IRON_OUT: { self.SendWeaponAnim( IRON_TO, 0, GetBodygroup() ); - EffectsFOVON( 40 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/arifl/weapon_ins2ak74.as b/scripts/maps/ins2/arifl/weapon_ins2ak74.as index 1a339e4..de8816f 100644 --- a/scripts/maps/ins2/arifl/weapon_ins2ak74.as +++ b/scripts/maps/ins2/arifl/weapon_ins2ak74.as @@ -53,9 +53,10 @@ int WEIGHT = 20; int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY; uint DAMAGE = 25; uint SLOT = 5; -uint POSITION = 13; +uint POSITION = 8; float RPM_AIR = 650; //Rounds per minute in air float RPM_WTR = 500; //Rounds per minute in water +uint AIM_FOV = 40; // Below 50 hides crosshair string AMMO_TYPE = "ins2_5.45x39mm"; class weapon_ins2ak74 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase @@ -211,7 +212,7 @@ class weapon_ins2ak74 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase case INS2BASE::IRON_OUT: { self.SendWeaponAnim( IRON_TO, 0, GetBodygroup() ); - EffectsFOVON( 40 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/arifl/weapon_ins2akm.as b/scripts/maps/ins2/arifl/weapon_ins2akm.as index 105557e..3e59d38 100644 --- a/scripts/maps/ins2/arifl/weapon_ins2akm.as +++ b/scripts/maps/ins2/arifl/weapon_ins2akm.as @@ -54,9 +54,9 @@ enum INS2_AKM_Animations string W_MODEL = "models/ins2/wpn/akm/w_akm.mdl"; string V_MODEL = "models/ins2/wpn/akm/v_akm.mdl"; string P_MODEL = "models/ins2/wpn/akm/p_akm.mdl"; +string G_MODEL = "models/ins2/wpn/akm/vog25.mdl"; string A_MODEL = "models/ins2/ammo/mags.mdl"; int MAG_BDYGRP = 0; -string G_MODEL = "models/ins2/wpn/akm/gp25.mdl"; // Sprites string SPR_CAT = "ins2/arf/"; //Weapon category used to get the sprite's location // Sounds @@ -77,9 +77,10 @@ uint DAMAGE = 27; uint DAMAGE_GL = 130; float SPEED = 1325; uint SLOT = 5; -uint POSITION = 19; +uint POSITION = 15; float RPM_AIR = 600; //Rounds per minute in air float RPM_WTR = 400; //Rounds per minute in water +uint AIM_FOV = 40; // Below 50 hides crosshair string AMMO_TYPE = "ins2_7.62x39mm"; string AMMO_TYPE2 = "ins2_40x53mm"; string PROJ_NAME = "proj_ins2akm"; @@ -291,7 +292,7 @@ class weapon_ins2akm : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, INS2B case INS2BASE::IRON_OUT: { self.SendWeaponAnim( (WeaponGLMode == INS2BASE::GL_AIMED) ? GL_IRON_TO : IRON_TO, 0, GetBodygroup() ); - EffectsFOVON( 40 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/arifl/weapon_ins2an94.as b/scripts/maps/ins2/arifl/weapon_ins2an94.as new file mode 100644 index 0000000..1f95694 --- /dev/null +++ b/scripts/maps/ins2/arifl/weapon_ins2an94.as @@ -0,0 +1,429 @@ +// Insurgency's AN-94N +/* Model Credits +/ Model: Contract Wars, Norman The Loli Pirate (Heavy Edits, PK-AS Side Rail Mount) +/ Textures: Contract Wars, Norman The Loli Pirate (Edits, PK-AS Side Rail Mount edits) +/ Animations: D.N.I.O. 071 +/ Sounds: New World Interactive, Infinity Ward (COD Modern Warfare 2019, ported by Viper) +/ Sprites: D.N.I.O. 071 (Model Render), R4to0 (Vector), KernCore (.spr Compile) +/ Misc: Norman The Loli Pirate (World Model), D.N.I.O. 071 (World Model UVs, Compile), KernCore (World Model UVs) +/ Script: KernCore +*/ + +#include "../base" + +namespace INS2_AN94 +{ + +// Animations +enum INS2_AN94_Animations +{ + IDLE = 0, + DRAW_FIRST, + DRAW, + HOLSTER, + FIRE_BURST_START1, + FIRE_BURST_START2, + FIRE_BURST_START3, + FIRE_BURST_END1, + FIRE_BURST_END2, + FIRE_BURST_END3, + FIRE1, + FIRE2, + FIRE3, + DRYFIRE, + FIRESELECT, + RELOAD, + RELOAD_EMPTY, + IRON_IDLE, + IRON_FIRE_BURST_START1, + IRON_FIRE_BURST_START2, + IRON_FIRE_BURST_START3, + IRON_FIRE_BURST_END1, + IRON_FIRE_BURST_END2, + IRON_FIRE_BURST_END3, + IRON_FIRE1, + IRON_FIRE2, + IRON_FIRE3, + IRON_DRYFIRE, + IRON_FIRESELECT, + IRON_TO, + IRON_FROM +}; + +// Models +string W_MODEL = "models/ins2/wpn/an94/w_an94.mdl"; +string V_MODEL = "models/ins2/wpn/an94/v_an94.mdl"; +string P_MODEL = "models/ins2/wpn/an94/p_an94.mdl"; +string A_MODEL = "models/ins2/ammo/mags2.mdl"; +int MAG_BDYGRP = 2; +// Sprites +string SPR_CAT = "ins2/arf/"; //Weapon category used to get the sprite's location +// Sounds +string SHOOT_S = "ins2/wpn/an94/shoot.ogg"; +string EMPTY_S = "ins2/wpn/ak74/empty.ogg"; +// Information +int MAX_CARRY = 1000; +int MAX_CLIP = 30; +int DEFAULT_GIVE = MAX_CLIP * 4; +int WEIGHT = 20; +int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY; +uint DAMAGE = 25; +uint SLOT = 5; +uint POSITION = 10; +float RPM_AIR = 600; //Rounds per minute in air +float RPM_WTR = 500; //Rounds per minute in water +float RPM_BURST_AIR = 1600; //Burst fire rate in air +float RPM_BURST_WTR = 1000; //Burst fire rate in water +uint AIM_FOV = 34; // Below 50 hides crosshair +string AMMO_TYPE = "ins2_5.45x39mm"; + +class weapon_ins2an94 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase +{ + private CBasePlayer@ m_pPlayer + { + get const { return cast( self.m_hPlayer.GetEntity() ); } + set { self.m_hPlayer = EHandle( @value ); } + } + private int m_iBurstCount = 0, m_iBurstLeft = 0; + private float m_flNextBurstFireTime = 0; + private int m_iShell; + private bool m_WasDrawn; + private int GetBodygroup() + { + return 0; + } + private array Sounds = { + "ins2/wpn/an94/bltbk.ogg", + "ins2/wpn/an94/bltrel.ogg", + "ins2/wpn/an94/magin.ogg", + "ins2/wpn/an94/magout.ogg", + "ins2/wpn/an94/magrtl.ogg", + "ins2/wpn/an94/rof.ogg", + "ins2/wpn/ak74/magrel.ogg", + EMPTY_S, + SHOOT_S + }; + + void Spawn() + { + Precache(); + WeaponSelectFireMode = INS2BASE::SELECTFIRE_AUTO; + m_WasDrawn = false; + CommonSpawn( W_MODEL, DEFAULT_GIVE ); + } + + void Precache() + { + self.PrecacheCustomModels(); + g_Game.PrecacheModel( W_MODEL ); + g_Game.PrecacheModel( V_MODEL ); + g_Game.PrecacheModel( P_MODEL ); + g_Game.PrecacheModel( A_MODEL ); + m_iShell = g_Game.PrecacheModel( INS2BASE::BULLET_545x39 ); + + g_Game.PrecacheOther( GetAmmoName() ); + + INS2BASE::PrecacheSound( Sounds ); + INS2BASE::PrecacheSound( INS2BASE::DeployFirearmSounds ); + + g_Game.PrecacheGeneric( "sprites/" + SPR_CAT + self.pev.classname + ".txt" ); + g_Game.PrecacheGeneric( "events/" + "muzzle_SAW.txt" ); + CommonPrecache(); + } + + bool GetItemInfo( ItemInfo& out info ) + { + info.iMaxAmmo1 = (INS2BASE::ShouldUseCustomAmmo) ? MAX_CARRY : INS2BASE::DF_MAX_CARRY_556; + info.iAmmo1Drop = MAX_CLIP; + info.iMaxAmmo2 = -1; + info.iAmmo2Drop = -1; + info.iMaxClip = MAX_CLIP; + info.iSlot = SLOT; + info.iPosition = POSITION; + info.iId = g_ItemRegistry.GetIdForName( self.pev.classname ); + info.iFlags = FLAGS; + info.iWeight = WEIGHT; + + return true; + } + + bool AddToPlayer( CBasePlayer@ pPlayer ) + { + return CommonAddToPlayer( pPlayer ); + } + + bool PlayEmptySound() + { + return CommonPlayEmptySound( EMPTY_S ); + } + + bool Deploy() + { + PlayDeploySound( 3 ); + DisplayFiremodeSprite(); + if( m_WasDrawn == false ) + { + m_WasDrawn = true; + return Deploy( V_MODEL, P_MODEL, DRAW_FIRST, "m16", GetBodygroup(), (60.0/30.0) ); + } + else + return Deploy( V_MODEL, P_MODEL, DRAW, "m16", GetBodygroup(), (25.0/32.0) ); + } + + void Holster( int skipLocal = 0 ) + { + m_iBurstLeft = 0; + CommonHolster(); + + BaseClass.Holster( skipLocal ); + } + + private void FirstAttackCommon() + { + ShootWeapon( SHOOT_S, 1, VecModAcc( VECTOR_CONE_1DEGREES, 4.0f, 0.8f, 1.0f ), (m_pPlayer.pev.waterlevel == WATERLEVEL_HEAD) ? 1024 : 8192, DAMAGE, true ); + + m_pPlayer.m_iWeaponVolume = NORMAL_GUN_VOLUME; + m_pPlayer.m_iWeaponFlash = BRIGHT_GUN_FLASH; + + if( WeaponADSMode != INS2BASE::IRON_IN ) + { + if( m_iBurstLeft <= 1 && m_flNextBurstFireTime < WeaponTimeBase() ) + { + if( !( m_pPlayer.pev.flags & FL_ONGROUND != 0 ) ) + KickBack( 1.30, 0.30, 0.35, 0.03, 4.75, 2.75, 5 ); + else if( m_pPlayer.pev.velocity.Length2D() > 0 ) + KickBack( 1.00, 0.30, 0.3, 0.03, 4.75, 2.6, 7 ); + else if( m_pPlayer.pev.flags & FL_DUCKING != 0 ) + KickBack( 0.50, 0.20, 0.15, 0.02, 3.5, 1.25, 10 ); + else + KickBack( 0.70, 0.225, 0.175, 0.0225, 3.6, 1.65, 8 ); + } + } + else + { + if( m_iBurstLeft <= 1 && m_flNextBurstFireTime < WeaponTimeBase() ) + { + PunchAngle( Vector( Math.RandomFloat( -2.325, -1.875 ), (Math.RandomLong( 0, 1 ) < 0.5) ? -0.75f : 0.55f, Math.RandomFloat( -0.5, 0.5 ) ) ); + } + } + + if( m_iBurstLeft == 1 && m_flNextBurstFireTime < WeaponTimeBase() ) + { + if( WeaponADSMode == INS2BASE::IRON_IN ) + self.SendWeaponAnim( Math.RandomLong( IRON_FIRE_BURST_END1, IRON_FIRE_BURST_END3 ), 0, GetBodygroup() ); + else + self.SendWeaponAnim( Math.RandomLong( FIRE_BURST_END1, FIRE_BURST_END3 ), 0, GetBodygroup() ); + } + else + { + if( WeaponADSMode == INS2BASE::IRON_IN ) + self.SendWeaponAnim( Math.RandomLong( IRON_FIRE1, IRON_FIRE3 ), 0, GetBodygroup() ); + else + self.SendWeaponAnim( Math.RandomLong( FIRE1, FIRE3 ), 0, GetBodygroup() ); + } + + ShellEject( m_pPlayer, m_iShell, (WeaponADSMode != INS2BASE::IRON_IN) ? Vector( 20, 5.5, -8.5 ) : Vector( 20, 1.6, -4.5 ) ); + } + + void BurstCount() + { + //Fire at most 2 bullets. + m_iBurstCount = Math.min( 2, self.m_iClip ); + m_iBurstLeft = m_iBurstCount - 1; + m_flNextBurstFireTime = (m_pPlayer.pev.waterlevel == WATERLEVEL_HEAD) ? WeaponTimeBase() + GetFireRate( RPM_BURST_WTR ) : WeaponTimeBase() + GetFireRate( RPM_BURST_AIR ); + + if( WeaponADSMode == INS2BASE::IRON_IN ) + self.SendWeaponAnim( Math.RandomLong( IRON_FIRE_BURST_START1, IRON_FIRE_BURST_START3 ), 0, GetBodygroup() ); + else + self.SendWeaponAnim( Math.RandomLong( FIRE_BURST_START1, FIRE_BURST_START3 ), 0, GetBodygroup() ); + } + + void PrimaryAttack() + { + if( self.m_iClip <= 0 ) + { + self.PlayEmptySound(); + self.SendWeaponAnim( (WeaponADSMode == INS2BASE::IRON_IN) ? IRON_DRYFIRE : DRYFIRE, 0, GetBodygroup() ); + self.m_flNextPrimaryAttack = WeaponTimeBase() + 0.3f; + return; + } + + if( WeaponSelectFireMode == INS2BASE::SELECTFIRE_AUTO ) + { + if( (m_pPlayer.m_afButtonPressed & IN_ATTACK == 1) && self.m_iClip != 1 ) + { + BurstCount(); + + //Prevent primary attack before burst finishes. Might need to be finetuned. + self.m_flNextPrimaryAttack = self.m_flNextSecondaryAttack = WeaponTimeBase() + GetFireRate( RPM_AIR ) + (1.5 * GetFireRate( RPM_BURST_AIR )); + } + else + { + if( m_pPlayer.pev.waterlevel == WATERLEVEL_HEAD ) + self.m_flNextPrimaryAttack = self.m_flNextSecondaryAttack = WeaponTimeBase() + GetFireRate( RPM_WTR ); + else + self.m_flNextPrimaryAttack = self.m_flNextSecondaryAttack = WeaponTimeBase() + GetFireRate( RPM_AIR ); + } + } + else if( WeaponSelectFireMode == INS2BASE::SELECTFIRE_2XBURST ) + { + if( m_pPlayer.m_afButtonPressed & IN_ATTACK == 0 ) + return; + + BurstCount(); + + //Prevent primary attack before burst finishes. Might need to be finetuned. + self.m_flNextPrimaryAttack = self.m_flNextSecondaryAttack = WeaponTimeBase() + 0.175f; + } + + self.m_flTimeWeaponIdle = WeaponTimeBase() + 1.0f; + FirstAttackCommon(); + } + + void ItemPostFrame() + { + if( WeaponSelectFireMode == INS2BASE::SELECTFIRE_2XBURST || (WeaponSelectFireMode == INS2BASE::SELECTFIRE_AUTO && m_pPlayer.m_afButtonPressed & IN_ATTACK == 0) /*!SpecialFireRate*/ ) + { + if( m_iBurstLeft > 0 ) + { + if( m_flNextBurstFireTime < WeaponTimeBase() ) + { + if( self.m_iClip <= 0 ) + { + m_iBurstLeft = 0; + return; + } + + FirstAttackCommon(); + --m_iBurstLeft; + + + if( m_iBurstLeft > 0 ) + m_flNextBurstFireTime = (m_pPlayer.pev.waterlevel == WATERLEVEL_HEAD) ? WeaponTimeBase() + GetFireRate( RPM_BURST_WTR ) : WeaponTimeBase() + GetFireRate( RPM_BURST_AIR ); + else + m_flNextBurstFireTime = 0; + } + + //While firing a burst, don't allow reload or any other weapon actions. Might be best to let some things run though. + return; + } + } + + BaseClass.ItemPostFrame(); + } + + void SecondaryAttack() + { + self.m_flTimeWeaponIdle = self.m_flNextSecondaryAttack = WeaponTimeBase() + 0.2; + self.m_flNextPrimaryAttack = WeaponTimeBase() + 0.13; + + switch( WeaponADSMode ) + { + case INS2BASE::IRON_OUT: + { + self.SendWeaponAnim( IRON_TO, 0, GetBodygroup() ); + EffectsFOVON( AIM_FOV ); + break; + } + case INS2BASE::IRON_IN: + { + self.SendWeaponAnim( IRON_FROM, 0, GetBodygroup() ); + EffectsFOVOFF(); + break; + } + } + } + + void ItemPreFrame() + { + if( m_reloadTimer < g_Engine.time && canReload ) + self.Reload(); + + BaseClass.ItemPreFrame(); + } + + void Reload() + { + ChangeFireMode( (WeaponADSMode == INS2BASE::IRON_IN) ? IRON_FIRESELECT : FIRESELECT, GetBodygroup(), INS2BASE::SELECTFIRE_AUTO, INS2BASE::SELECTFIRE_2XBURST, (30.0/32.0) ); + + if( self.m_iClip == MAX_CLIP || m_pPlayer.m_rgAmmo( self.m_iPrimaryAmmoType ) <= 0 || m_pPlayer.pev.button & IN_USE != 0 ) + return; + + if( WeaponADSMode == INS2BASE::IRON_IN ) + { + self.SendWeaponAnim( IRON_FROM, 0, GetBodygroup() ); + m_reloadTimer = g_Engine.time + 0.16; + m_pPlayer.m_flNextAttack = 0.16; + canReload = true; + EffectsFOVOFF(); + } + + if( m_reloadTimer < g_Engine.time ) + { + (self.m_iClip == 0) ? Reload( MAX_CLIP, RELOAD_EMPTY, (170.0/37.0), GetBodygroup() ) : Reload( MAX_CLIP, RELOAD, (135.0/37.0), GetBodygroup() ); + canReload = false; + } + + BaseClass.Reload(); + } + + void WeaponIdle() + { + if( self.m_flNextPrimaryAttack + 0.1 < g_Engine.time ) + m_iShotsFired = 0; + + self.ResetEmptySound(); + m_pPlayer.GetAutoaimVector( AUTOAIM_10DEGREES ); + + if( self.m_flTimeWeaponIdle > WeaponTimeBase() ) + return; + + if( WeaponADSMode == INS2BASE::IRON_IN ) + self.SendWeaponAnim( IRON_IDLE, 0, GetBodygroup() ); + else + self.SendWeaponAnim( IDLE, 0, GetBodygroup() ); + + self.m_flTimeWeaponIdle = WeaponTimeBase() + g_PlayerFuncs.SharedRandomFloat( m_pPlayer.random_seed, 5, 7 ); + } +} + +class AN94_MAG : ScriptBasePlayerAmmoEntity, INS2BASE::AmmoBase +{ + void Spawn() + { + Precache(); + g_EntityFuncs.SetModel( self, A_MODEL ); + self.pev.body = MAG_BDYGRP; + BaseClass.Spawn(); + } + + void Precache() + { + g_Game.PrecacheModel( A_MODEL ); + CommonPrecache(); + } + + bool AddAmmo( CBaseEntity@ pOther ) + { + return CommonAddAmmo( pOther, MAX_CLIP, (INS2BASE::ShouldUseCustomAmmo) ? MAX_CARRY : INS2BASE::DF_MAX_CARRY_556, (INS2BASE::ShouldUseCustomAmmo) ? AMMO_TYPE : INS2BASE::DF_AMMO_556 ); + } +} + +string GetAmmoName() +{ + return "ammo_ins2an94"; +} + +string GetName() +{ + return "weapon_ins2an94"; +} + +void Register() +{ + g_CustomEntityFuncs.RegisterCustomEntity( "INS2_AN94::weapon_ins2an94", GetName() ); // Register the weapon entity + g_CustomEntityFuncs.RegisterCustomEntity( "INS2_AN94::AN94_MAG", GetAmmoName() ); // Register the ammo entity + g_ItemRegistry.RegisterWeapon( GetName(), SPR_CAT, (INS2BASE::ShouldUseCustomAmmo) ? AMMO_TYPE : INS2BASE::DF_AMMO_556, "", GetAmmoName() ); // Register the weapon +} + +} \ No newline at end of file diff --git a/scripts/maps/ins2/arifl/weapon_ins2asval.as b/scripts/maps/ins2/arifl/weapon_ins2asval.as index d79c406..d02ff35 100644 --- a/scripts/maps/ins2/arifl/weapon_ins2asval.as +++ b/scripts/maps/ins2/arifl/weapon_ins2asval.as @@ -53,9 +53,10 @@ int WEIGHT = 20; int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY; uint DAMAGE = 17; uint SLOT = 5; -uint POSITION = 5; +uint POSITION = 4; float RPM_AIR = 900; //Rounds per minute in air float RPM_WTR = 750; //Rounds per minute in water +uint AIM_FOV = 40; // Below 50 hides crosshair string AMMO_TYPE = "ins2_9x39mm"; class weapon_ins2asval : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase @@ -210,7 +211,7 @@ class weapon_ins2asval : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase case INS2BASE::IRON_OUT: { self.SendWeaponAnim( IRON_TO, 0, GetBodygroup() ); - EffectsFOVON( 40 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/arifl/weapon_ins2f2000.as b/scripts/maps/ins2/arifl/weapon_ins2f2000.as index 3884e10..bc42685 100644 --- a/scripts/maps/ins2/arifl/weapon_ins2f2000.as +++ b/scripts/maps/ins2/arifl/weapon_ins2f2000.as @@ -53,9 +53,10 @@ int WEIGHT = 20; int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY; uint DAMAGE = 24; uint SLOT = 5; -uint POSITION = 11; +uint POSITION = 6; float RPM_AIR = 850; //Rounds per minute in air float RPM_WTR = 600; //Rounds per minute in water +uint AIM_FOV = 30; // Below 50 hides crosshair string AMMO_TYPE = "ins2_5.56x45mm"; class weapon_ins2f2000 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase @@ -213,7 +214,7 @@ class weapon_ins2f2000 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase case INS2BASE::IRON_OUT: { self.SendWeaponAnim( IRON_TO, 0, GetBodygroup() ); - EffectsFOVON( 30 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/arifl/weapon_ins2galil.as b/scripts/maps/ins2/arifl/weapon_ins2galil.as index efa013f..b3248fc 100644 --- a/scripts/maps/ins2/arifl/weapon_ins2galil.as +++ b/scripts/maps/ins2/arifl/weapon_ins2galil.as @@ -69,9 +69,10 @@ int WEIGHT = 25; int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY; uint DAMAGE = 23; uint SLOT = 5; -uint POSITION = 7; +uint POSITION = 9; float RPM_AIR = 650; //Rounds per minute in air float RPM_WTR = 500; //Rounds per minute in water +uint AIM_FOV = 40; // Below 50 hides crosshair string AMMO_TYPE = "ins2_5.56x45mm"; class weapon_ins2galil : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, INS2BASE::BipodWeaponBase @@ -257,7 +258,7 @@ class weapon_ins2galil : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, INS case INS2BASE::IRON_OUT: { self.SendWeaponAnim( (WeaponBipodMode == INS2BASE::BIPOD_UNDEPLOYED) ? IRON_TO : BIPOD_IRON_TO, 0, GetBodygroup() ); - EffectsFOVON( 40 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/arifl/weapon_ins2groza.as b/scripts/maps/ins2/arifl/weapon_ins2groza.as new file mode 100644 index 0000000..002a71d --- /dev/null +++ b/scripts/maps/ins2/arifl/weapon_ins2groza.as @@ -0,0 +1,473 @@ +// Insurgency's OTs-14-4A-04 9/40 +/* Model Credits +/ Model: 1ns1debeast, Norman The Loli Pirate +/ Textures: 1ns1debeast, Norman The Loli Pirate +/ Animations: D.N.I.O. 071 +/ Sounds: New World Interactive, Navaro, Magmacow, S.T.A.L.K.E.R. Anomaly Team +/ Sprites: D.N.I.O. 071 (Model Render), R4to0 (Vector), KernCore (.spr Compile) +/ Misc: Norman The Loli Pirate (World Model), D.N.I.O. 071 (World Model UVs, Compile), KernCore (World Model UVs) +/ Script: KernCore +*/ + +#include "../base" +#include "../proj/proj_ins2gl" + +namespace INS2_GROZA +{ + +// Animations +enum INS2_GROZA_Animations +{ + IDLE = 0, + DRAW_FIRST, + DRAW, + HOLSTER, + FIRE1, + FIRE2, + FIRE3, + DRYFIRE, + FIRESELECT, + RELOAD, + RELOAD_EMPTY, + IRON_IDLE, + IRON_FIRE1, + IRON_FIRE2, + IRON_FIRE3, + IRON_DRYFIRE, + IRON_FIRESELECT, + IRON_TO, + IRON_FROM, + GL_IN, + GL_OUT, + GL_IDLE, + GL_DRAW, + GL_HOLSTER, + GL_FIRE, + GL_DRYFIRE, + GL_RELOAD, + GL_IRON_IDLE, + GL_IRON_FIRE, + GL_IRON_DRYFIRE, + GL_IRON_TO, + GL_IRON_FROM, + GL_IRON_IN, + GL_IRON_OUT +}; + +// Models +string W_MODEL = "models/ins2/wpn/groza/w_groza.mdl"; +string V_MODEL = "models/ins2/wpn/groza/v_groza.mdl"; +string P_MODEL = "models/ins2/wpn/groza/p_groza.mdl"; +string G_MODEL = "models/ins2/wpn/akm/vog25.mdl"; +string A_MODEL = "models/ins2/ammo/mags2.mdl"; +int MAG_BDYGRP = 5; +// Sprites +string SPR_CAT = "ins2/arf/"; //Weapon category used to get the sprite's location +// Sounds +string SHOOT_S = "ins2/wpn/groza/shoot.ogg"; +string EMPTY_S = "ins2/wpn/ak74/empty.ogg"; +string SHOOTGL = "ins2/wpn/gp30/shoot.ogg"; +string EMPTYGL = "ins2/wpn/gp30/empty.ogg"; +// Information +int MAX_CARRY = 1000; +int MAX_CLIP = 20; +int MAX_CARRY2 = 1000; +int MAX_CLIP2 = 1; +int DEFAULT_GIVE = MAX_CLIP * 4; +int DEFAULT_GIVE2 = MAX_CLIP2 * 2; +int WEIGHT = 20; +int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY; +uint DAMAGE = 18; +uint DAMAGE_GL = 130; +float SPEED = 1325; +uint SLOT = 5; +uint POSITION = 12; +float RPM_AIR = 650; //Rounds per minute in air +float RPM_WTR = 550; //Rounds per minute in water +uint AIM_FOV = 40; // Below 50 hides crosshair +string AMMO_TYPE = "ins2_9x39mm"; +string AMMO_TYPE2 = "ins2_40x53mm"; +string PROJ_NAME = "proj_ins2groza"; + +class weapon_ins2groza : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, INS2BASE::ExplosiveBase +{ + private CBasePlayer@ m_pPlayer + { + get const { return cast( self.m_hPlayer.GetEntity() ); } + set { self.m_hPlayer = EHandle( @value ); } + } + private int m_iShell; + private bool m_WasDrawn; + private int GetBodygroup() + { + return 0; + } + private array Sounds = { + "ins2/wpn/groza/bltbk.ogg", + "ins2/wpn/groza/bltfd.ogg", + "ins2/wpn/groza/clik.ogg", + "ins2/wpn/groza/desel.ogg", + "ins2/wpn/groza/magin.ogg", + "ins2/wpn/groza/magout.ogg", + "ins2/wpn/groza/magrel.ogg", + "ins2/wpn/groza/rof.ogg", + "ins2/wpn/groza/sel.ogg", + "ins2/wpn/groza/swtch.ogg", + SHOOTGL, + EMPTYGL, + EMPTY_S, + SHOOT_S + }; + + void Spawn() + { + Precache(); + m_WasDrawn = false; + WeaponADSMode = INS2BASE::IRON_OUT; + WeaponSelectFireMode = INS2BASE::SELECTFIRE_AUTO; + WeaponGLMode = INS2BASE::GL_NOTAIMED; + self.m_iClip2 = MAX_CLIP2; + CommonSpawn( W_MODEL, DEFAULT_GIVE ); + self.m_iDefaultSecAmmo = DEFAULT_GIVE2; + } + + void Precache() + { + self.PrecacheCustomModels(); + g_Game.PrecacheModel( W_MODEL ); + g_Game.PrecacheModel( V_MODEL ); + g_Game.PrecacheModel( P_MODEL ); + g_Game.PrecacheModel( A_MODEL ); + g_Game.PrecacheModel( G_MODEL ); + m_iShell = g_Game.PrecacheModel( INS2BASE::BULLET_9x39 ); + + g_Game.PrecacheOther( PROJ_NAME ); + g_Game.PrecacheOther( GetAmmoName() ); + + INS2BASE::PrecacheSound( GrenadeExplode ); + INS2BASE::PrecacheSound( GrenadeWaterExplode ); + INS2BASE::PrecacheSound( Sounds ); + INS2BASE::PrecacheSound( INS2BASE::DeployFirearmSounds ); + + g_Game.PrecacheGeneric( "sprites/" + SPR_CAT + self.pev.classname + ".txt" ); + g_Game.PrecacheGeneric( "events/" + "muzzle_ins2_MGs_big.txt" ); + CommonPrecache(); + } + + bool GetItemInfo( ItemInfo& out info ) + { + info.iMaxAmmo1 = (INS2BASE::ShouldUseCustomAmmo) ? MAX_CARRY : INS2BASE::DF_MAX_CARRY_9MM; + info.iAmmo1Drop = MAX_CLIP; + info.iMaxAmmo2 = (INS2BASE::ShouldUseCustomAmmo) ? MAX_CARRY2 : INS2BASE::DF_MAX_CARRY_ARGR; + info.iAmmo2Drop = MAX_CLIP2; + info.iMaxClip = MAX_CLIP; + info.iSlot = SLOT; + info.iPosition = POSITION; + info.iId = g_ItemRegistry.GetIdForName( self.pev.classname ); + info.iFlags = FLAGS; + info.iWeight = WEIGHT; + + return true; + } + + bool AddToPlayer( CBasePlayer@ pPlayer ) + { + return CommonAddToPlayer( pPlayer ); + } + + bool PlayEmptySound() + { + return CommonPlayEmptySound( EMPTY_S ); + } + + bool Deploy() + { + PlayDeploySound( 3 ); + DisplayFiremodeSprite(); + if( m_WasDrawn == false ) + { + m_WasDrawn = true; + return Deploy( V_MODEL, P_MODEL, DRAW_FIRST, "m16", GetBodygroup(), (75.0/30.0) ); + } + else + return Deploy( V_MODEL, P_MODEL, (WeaponGLMode == INS2BASE::GL_AIMED) ? GL_DRAW : DRAW, "m16", GetBodygroup(), (25.0/31.0) ); + } + + void Holster( int skipLocal = 0 ) + { + CommonHolster(); + + BaseClass.Holster( skipLocal ); + } + + void PrimaryAttack() + { + if( WeaponGLMode == INS2BASE::GL_AIMED ) + { + if( self.m_iClip2 <= 0 ) + { + self.PlayEmptySound(); + self.SendWeaponAnim( (WeaponADSMode == INS2BASE::IRON_IN) ? GL_IRON_DRYFIRE : GL_DRYFIRE, 0, GetBodygroup() ); + self.m_flNextPrimaryAttack = WeaponTimeBase() + 0.3f; + return; + } + + Vector ang_Aim = m_pPlayer.pev.v_angle + m_pPlayer.pev.punchangle; + Math.MakeVectors( ang_Aim ); + --self.m_iClip2; + + Vector vecStart; + if( WeaponADSMode != INS2BASE::IRON_IN ) + { + vecStart = (m_pPlayer.pev.button & IN_DUCK == 0) ? m_pPlayer.GetGunPosition() + g_Engine.v_forward * 16 + g_Engine.v_right * 4 + g_Engine.v_up * -4 : + m_pPlayer.GetGunPosition() + g_Engine.v_forward * 16 + g_Engine.v_right * 4 + g_Engine.v_up * -4 + m_pPlayer.pev.view_ofs * 0.25; + } + else + { + vecStart = (m_pPlayer.pev.button & IN_DUCK == 0) ? m_pPlayer.GetGunPosition() + g_Engine.v_forward * 16 + g_Engine.v_up * -2 : + m_pPlayer.GetGunPosition() + g_Engine.v_forward * 16 + g_Engine.v_up * -2 + m_pPlayer.pev.view_ofs * 0.01; + } + + Vector vecVeloc = g_Engine.v_forward * SPEED + g_Engine.v_up * 8; + g_SoundSystem.EmitSoundDyn( m_pPlayer.edict(), CHAN_WEAPON, SHOOTGL, Math.RandomFloat( 0.95, 1.0 ), 0.7, 0, 95 + Math.RandomLong( 0, 0x9 ) ); + INS2GLPROJECTILE::CIns2GL@ pGL = INS2GLPROJECTILE::ShootGrenade( m_pPlayer.pev, vecStart, vecVeloc, DAMAGE_GL, G_MODEL, false, PROJ_NAME ); + + self.SendWeaponAnim( (WeaponADSMode == INS2BASE::IRON_IN) ? GL_IRON_FIRE : GL_FIRE, 0, GetBodygroup() ); + self.m_flNextPrimaryAttack = self.m_flNextSecondaryAttack = self.m_flNextTertiaryAttack = WeaponTimeBase() + 0.75; + self.m_flTimeWeaponIdle = WeaponTimeBase() + 1.0; + PunchAngle( Vector( Math.RandomFloat( -3.0, -4.6 ), (Math.RandomLong( 0, 1 ) < 0.5) ? -1.5f : 1.5f, Math.RandomFloat( -1.5, 1.5 ) ) ); + + //Manually set M203 Shoot animation on the player + m_pPlayer.m_Activity = ACT_RELOAD; + m_pPlayer.pev.frame = 0; + m_pPlayer.pev.sequence = 148; + m_pPlayer.ResetSequenceInfo(); + } + else + { + if( self.m_iClip <= 0 ) + { + self.PlayEmptySound(); + self.SendWeaponAnim( (WeaponADSMode == INS2BASE::IRON_IN) ? IRON_DRYFIRE : DRYFIRE, 0, GetBodygroup() ); + self.m_flNextPrimaryAttack = WeaponTimeBase() + 0.3f; + return; + } + + if( WeaponSelectFireMode == INS2BASE::SELECTFIRE_SEMI && m_pPlayer.m_afButtonPressed & IN_ATTACK == 0 ) + return; + + if( m_pPlayer.pev.waterlevel == WATERLEVEL_HEAD ) + self.m_flNextPrimaryAttack = self.m_flNextSecondaryAttack = WeaponTimeBase() + GetFireRate( RPM_WTR ); + else + self.m_flNextPrimaryAttack = self.m_flNextSecondaryAttack = WeaponTimeBase() + GetFireRate( RPM_AIR ); + + self.m_flTimeWeaponIdle = WeaponTimeBase() + 1.5f; + + ShootWeapon( SHOOT_S, 1, VecModAcc( VECTOR_CONE_1DEGREES, 1.4f, 0.7f, 1.8f ), (m_pPlayer.pev.waterlevel == WATERLEVEL_HEAD) ? 1024 : 8192, DAMAGE, true, DMG_NEVERGIB ); + + m_pPlayer.m_iWeaponVolume = NORMAL_GUN_VOLUME; + m_pPlayer.m_iWeaponFlash = NORMAL_GUN_FLASH; + + if( WeaponADSMode != INS2BASE::IRON_IN ) + { + if( !( m_pPlayer.pev.flags & FL_ONGROUND != 0 ) ) + KickBack( 1.0 , 0.3 , 0.45 , 0.04 , 5.5 , 2.75 , 8 ); + else if( m_pPlayer.pev.velocity.Length2D() > 0 ) + KickBack( 0.9 , 0.3 , 0.25 , 0.03 , 5.0 , 2.5 , 7 ); + else if( m_pPlayer.pev.flags & FL_DUCKING != 0 ) + KickBack( 0.45 , 0.175, 0.125, 0.02 , 2.2 , 1.25 , 5 ); + else + KickBack( 0.75 , 0.25 , 0.10 , 0.025, 2.6 , 1.65 , 5 ); + } + else + PunchAngle( Vector( Math.RandomFloat( -2.775, -3.225 ), (Math.RandomLong( 0, 1 ) < 0.5) ? -0.75 : 1.0, Math.RandomFloat( -0.5, 0.5 ) ) ); + + self.SendWeaponAnim( (WeaponADSMode == INS2BASE::IRON_IN) ? Math.RandomLong( IRON_FIRE1, IRON_FIRE3 ) : Math.RandomLong( FIRE1, FIRE3 ), 0, GetBodygroup() ); + ShellEject( m_pPlayer, m_iShell, (WeaponADSMode != INS2BASE::IRON_IN) ? Vector( 10, 6, -9 ) : Vector( 9, 0.75, -5 ) ); + } + } + + void SecondaryAttack() + { + self.m_flTimeWeaponIdle = self.m_flNextSecondaryAttack = WeaponTimeBase() + 0.2; + self.m_flNextPrimaryAttack = WeaponTimeBase() + 0.13; + + switch( WeaponADSMode ) + { + case INS2BASE::IRON_OUT: + { + self.SendWeaponAnim( (WeaponGLMode == INS2BASE::GL_AIMED) ? GL_IRON_TO : IRON_TO, 0, GetBodygroup() ); + EffectsFOVON( AIM_FOV ); + break; + } + case INS2BASE::IRON_IN: + { + self.SendWeaponAnim( (WeaponGLMode == INS2BASE::GL_AIMED) ? GL_IRON_FROM : IRON_FROM, 0, GetBodygroup() ); + EffectsFOVOFF(); + break; + } + } + } + + void TertiaryAttack() + { + if( WeaponADSMode == INS2BASE::IRON_IN ) + GrenadeLauncherSwitch( GL_IRON_IN, GL_IRON_OUT, GetBodygroup(), (60.0/35.0), (60.0/32.0) ); + else + GrenadeLauncherSwitch( GL_IN, GL_OUT, GetBodygroup(), (60.0/35.0), (60.0/32.0) ); + } + + void ItemPreFrame() + { + if( m_reloadTimer < g_Engine.time && canReload ) + self.Reload(); + + BaseClass.ItemPreFrame(); + } + + void Reload() + { + if( WeaponGLMode == INS2BASE::GL_AIMED ) + { + if( self.m_iClip2 == MAX_CLIP2 || m_pPlayer.m_rgAmmo( self.m_iSecondaryAmmoType ) <= 0 ) + return; + + if( WeaponADSMode == INS2BASE::IRON_IN ) + { + self.SendWeaponAnim( GL_IRON_FROM, 0, GetBodygroup() ); + m_reloadTimer = g_Engine.time + 0.16; + m_pPlayer.m_flNextAttack = 0.16; + canReload = true; + EffectsFOVOFF(); + } + + if( m_reloadTimer < g_Engine.time ) + { + ReloadSecondary( MAX_CLIP2, GL_RELOAD, (85.0/32.0), GetBodygroup() ); + //Manually set M203 Reload animation on the player + m_pPlayer.m_Activity = ACT_RELOAD; + m_pPlayer.pev.frame = 0; + m_pPlayer.pev.sequence = 150; + m_pPlayer.ResetSequenceInfo(); + canReload = false; + } + } + else + { + ChangeFireMode( (WeaponADSMode == INS2BASE::IRON_IN) ? IRON_FIRESELECT : FIRESELECT, GetBodygroup(), INS2BASE::SELECTFIRE_AUTO, INS2BASE::SELECTFIRE_SEMI, (37.0/35.0) ); + + if( self.m_iClip == MAX_CLIP || m_pPlayer.m_rgAmmo( self.m_iPrimaryAmmoType ) <= 0 || m_pPlayer.pev.button & IN_USE != 0 ) + return; + + if( WeaponADSMode == INS2BASE::IRON_IN ) + { + self.SendWeaponAnim( IRON_FROM, 0, GetBodygroup() ); + m_reloadTimer = g_Engine.time + 0.16; + m_pPlayer.m_flNextAttack = 0.16; + canReload = true; + EffectsFOVOFF(); + } + + if( m_reloadTimer < g_Engine.time ) + { + if( self.m_iClip <= 0 ) + Reload( MAX_CLIP, RELOAD_EMPTY, (175.0/37.0), GetBodygroup() ); + else + Reload( MAX_CLIP, RELOAD, (126.0/37.0), GetBodygroup() ); + + canReload = false; + } + + BaseClass.Reload(); + } + } + + void WeaponIdle() + { + if( self.m_flNextPrimaryAttack < g_Engine.time ) + m_iShotsFired = 0; + + self.ResetEmptySound(); + m_pPlayer.GetAutoaimVector( AUTOAIM_10DEGREES ); + + if( self.m_flTimeWeaponIdle > WeaponTimeBase() ) + return; + + if( WeaponADSMode == INS2BASE::IRON_IN ) + self.SendWeaponAnim( (WeaponGLMode == INS2BASE::GL_AIMED) ? GL_IRON_IDLE : IRON_IDLE, 0, GetBodygroup() ); + else + self.SendWeaponAnim( (WeaponGLMode == INS2BASE::GL_AIMED) ? GL_IDLE : IDLE, 0, GetBodygroup() ); + + self.m_flTimeWeaponIdle = WeaponTimeBase() + g_PlayerFuncs.SharedRandomFloat( m_pPlayer.random_seed, 5, 7 ); + } +} + +class GROZA_MAG : ScriptBasePlayerAmmoEntity, INS2BASE::AmmoBase +{ + void Spawn() + { + Precache(); + g_EntityFuncs.SetModel( self, A_MODEL ); + self.pev.body = MAG_BDYGRP; + BaseClass.Spawn(); + } + + void Precache() + { + g_Game.PrecacheModel( A_MODEL ); + CommonPrecache(); + } + + bool AddAmmo( CBaseEntity@ pOther ) + { + return CommonAddAmmo( pOther, MAX_CLIP, (INS2BASE::ShouldUseCustomAmmo) ? MAX_CARRY : INS2BASE::DF_MAX_CARRY_9MM, (INS2BASE::ShouldUseCustomAmmo) ? AMMO_TYPE : INS2BASE::DF_AMMO_9MM ); + } +} + +class GP30_MAG : ScriptBasePlayerAmmoEntity, INS2BASE::AmmoBase +{ + void Spawn() + { + Precache(); + g_EntityFuncs.SetModel( self, G_MODEL ); + BaseClass.Spawn(); + } + + void Precache() + { + g_Game.PrecacheModel( G_MODEL ); + CommonPrecache(); + } + + bool AddAmmo( CBaseEntity@ pOther ) + { + return CommonAddAmmo( pOther, MAX_CLIP2, (INS2BASE::ShouldUseCustomAmmo) ? MAX_CARRY2 : INS2BASE::DF_MAX_CARRY_ARGR, (INS2BASE::ShouldUseCustomAmmo) ? AMMO_TYPE2 : INS2BASE::DF_AMMO_ARGR ); + } +} + +string GetAmmoName() +{ + return "ammo_ins2groza"; +} + +string GetGLName() +{ + return "ammo_ins2grozagl"; +} + +string GetName() +{ + return "weapon_ins2groza"; +} + +void Register() +{ + INS2GLPROJECTILE::Register( PROJ_NAME ); + + g_CustomEntityFuncs.RegisterCustomEntity( "INS2_GROZA::weapon_ins2groza", GetName() ); // Register the weapon entity + g_CustomEntityFuncs.RegisterCustomEntity( "INS2_GROZA::GP30_MAG", GetGLName() ); // Register the ammo entity + g_CustomEntityFuncs.RegisterCustomEntity( "INS2_GROZA::GROZA_MAG", GetAmmoName() ); // Register the ammo entity + g_ItemRegistry.RegisterWeapon( GetName(), SPR_CAT, (INS2BASE::ShouldUseCustomAmmo) ? AMMO_TYPE : INS2BASE::DF_AMMO_556, (INS2BASE::ShouldUseCustomAmmo) ? AMMO_TYPE2 : INS2BASE::DF_AMMO_ARGR, GetAmmoName(), GetGLName() ); // Register the weapon +} + +} \ No newline at end of file diff --git a/scripts/maps/ins2/arifl/weapon_ins2l85a2.as b/scripts/maps/ins2/arifl/weapon_ins2l85a2.as index 56ef726..82d5fe4 100644 --- a/scripts/maps/ins2/arifl/weapon_ins2l85a2.as +++ b/scripts/maps/ins2/arifl/weapon_ins2l85a2.as @@ -80,9 +80,10 @@ uint DAMAGE = 24; uint DAMAGE_GL = 145; float SPEED = 1450; uint SLOT = 5; -uint POSITION = 18; +uint POSITION = 14; float RPM_AIR = 652; float RPM_WTR = 525; +uint AIM_FOV = 30; // Below 50 hides crosshair string AMMO_TYPE = "ins2_5.56x45mm"; string AMMO_TYPE2 = "ins2_40x46mm"; string PROJ_NAME = "proj_ins2l85a2"; @@ -297,7 +298,7 @@ class weapon_ins2l85a2 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, INS case INS2BASE::IRON_OUT: { self.SendWeaponAnim( (WeaponGLMode == INS2BASE::GL_AIMED) ? GL_IRON_TO : IRON_TO, 0, GetBodygroup() ); - EffectsFOVON( 30 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/arifl/weapon_ins2m16a1.as b/scripts/maps/ins2/arifl/weapon_ins2m16a1.as new file mode 100644 index 0000000..8a1da59 --- /dev/null +++ b/scripts/maps/ins2/arifl/weapon_ins2m16a1.as @@ -0,0 +1,481 @@ +// Insurgency's M16A1 +/* Model Credits +/ Model: Hav0c (M16A1), Twinke Masta (Heatshield/M203), Norman The Loli Pirate +/ Textures: Millenia, Norman The Loli Pirate +/ Animations: MyZombieKillerz, D.N.I.O. 071 (Heavy Edits) +/ Sounds: New World Interactive, D.N.I.O. 071 (Conversion to .ogg format) +/ Sprites: D.N.I.O. 071 (Model Render), R4to0 (Vector), KernCore (.spr Compile) +/ Misc: Norman The Loli Pirate (World Model), D.N.I.O. 071 (World Model UVs, Compile), KernCore (World Model UVs) +/ Script: KernCore +*/ + +#include "../base" +#include "../proj/proj_ins2gl" + +namespace INS2_M16A1 +{ + +// Animations +enum INS2_M16A1_Animations +{ + IDLE = 0, + DRAW_FIRST, + DRAW, + HOLSTER, + FIRE1, + FIRE2, + DRYFIRE, + FIRESELECT, + RELOAD, + RELOAD_EMPTY1, + RELOAD_EMPTY2, + IRON_IDLE, + IRON_FIRE1, + IRON_FIRE2, + IRON_FIRE3, + IRON_DRYFIRE, + IRON_FIRESELECT, + IRON_TO, + IRON_FROM, + GL_IN, + GL_OUT, + GL_IDLE, + GL_DRAW, + GL_HOLSTER, + GL_FIRE, + GL_DRYFIRE, + GL_RELOAD, + GL_IRON_IDLE, + GL_IRON_FIRE, + GL_IRON_DRYFIRE, + GL_IRON_TO, + GL_IRON_FROM, + GL_IRON_IN, + GL_IRON_OUT +}; + +// Models +string W_MODEL = "models/ins2/wpn/m16a1/w_m16a1.mdl"; +string V_MODEL = "models/ins2/wpn/m16a1/v_m16a1.mdl"; +string P_MODEL = "models/ins2/wpn/m16a1/p_m16a1.mdl"; +string A_MODEL = "models/ins2/ammo/mags2.mdl"; +int MAG_BDYGRP = 4; +string G_MODEL = "models/ins2/wpn/m16a4/m203.mdl"; +// Sprites +string SPR_CAT = "ins2/arf/"; //Weapon category used to get the sprite's location +// Sounds +string SHOOT_S = "ins2/wpn/m16a4/shoot.ogg"; +string EMPTY_S = "ins2/wpn/m4a1/empty.ogg"; +string SHOOTGL = "ins2/wpn/m203/shoot.ogg"; +string EMPTYGL = "ins2/wpn/m203/empty.ogg"; +// Information +int MAX_CARRY = 1000; +int MAX_CLIP = 20; +int MAX_CARRY2 = 1000; +int MAX_CLIP2 = 1; +int DEFAULT_GIVE = MAX_CLIP * 4; +int DEFAULT_GIVE2 = MAX_CLIP2 * 2; +int WEIGHT = 35; +int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY; +uint DAMAGE = 23; +uint DAMAGE_GL = 145; +float SPEED = 1400; +uint SLOT = 5; +uint POSITION = 11; +float RPM_AIR = 700; //Rounds per minute in air +float RPM_WTR = 550; //Rounds per minute in water +uint AIM_FOV = 40; // Below 50 hides crosshair +string AMMO_TYPE = "ins2_5.56x45mm"; +string AMMO_TYPE2 = "ins2_40x46mm"; +string PROJ_NAME = "proj_ins2m16a1"; + +class weapon_ins2m16a1 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase +{ + private CBasePlayer@ m_pPlayer + { + get const { return cast( self.m_hPlayer.GetEntity() ); } + set { self.m_hPlayer = EHandle( @value ); } + } + private int m_iShell; + private bool m_WasDrawn; + private int GetBodygroup() + { + return 0; + } + private array Sounds = { + "ins2/wpn/uni/bretract.ogg", + "ins2/wpn/uni/bdeploye.ogg", + "ins2/wpn/m4a1/bltbk.ogg", + "ins2/wpn/m4a1/bltrel.ogg", + "ins2/wpn/m4a1/hit.ogg", + "ins2/wpn/m4a1/magrel.ogg", + "ins2/wpn/m4a1/magout.ogg", + "ins2/wpn/m4a1/magin.ogg", + "ins2/wpn/m4a1/rof.ogg", + "ins2/wpn/m203/close.ogg", + "ins2/wpn/m203/desel.ogg", + "ins2/wpn/m203/drop.ogg", + "ins2/wpn/m203/ins.ogg", + "ins2/wpn/m203/open.ogg", + "ins2/wpn/m203/sel.ogg", + EMPTY_S, + SHOOT_S, + SHOOTGL, + EMPTYGL + }; + + void Spawn() + { + Precache(); + m_WasDrawn = false; + WeaponADSMode = INS2BASE::IRON_OUT; + WeaponSelectFireMode = INS2BASE::SELECTFIRE_AUTO; + WeaponGLMode = INS2BASE::GL_NOTAIMED; + self.m_iClip2 = MAX_CLIP2; + CommonSpawn( W_MODEL, DEFAULT_GIVE ); + self.m_iDefaultSecAmmo = DEFAULT_GIVE2; + } + + void Precache() + { + self.PrecacheCustomModels(); + g_Game.PrecacheModel( W_MODEL ); + g_Game.PrecacheModel( V_MODEL ); + g_Game.PrecacheModel( P_MODEL ); + g_Game.PrecacheModel( A_MODEL ); + g_Game.PrecacheModel( G_MODEL ); + m_iShell = g_Game.PrecacheModel( INS2BASE::BULLET_556x45 ); + + g_Game.PrecacheOther( PROJ_NAME ); + g_Game.PrecacheOther( GetAmmoName() ); + + INS2BASE::PrecacheSound( Sounds ); + INS2BASE::PrecacheSound( INS2BASE::DeployFirearmSounds ); + + g_Game.PrecacheGeneric( "sprites/" + SPR_CAT + self.pev.classname + ".txt" ); + g_Game.PrecacheGeneric( "events/" + "muzzle_ins2_MGs.txt" ); + CommonPrecache(); + } + + bool GetItemInfo( ItemInfo& out info ) + { + info.iMaxAmmo1 = (INS2BASE::ShouldUseCustomAmmo) ? MAX_CARRY : INS2BASE::DF_MAX_CARRY_556; + info.iAmmo1Drop = MAX_CLIP; + info.iMaxAmmo2 = (INS2BASE::ShouldUseCustomAmmo) ? MAX_CARRY2 : INS2BASE::DF_MAX_CARRY_ARGR; + info.iAmmo2Drop = MAX_CLIP2; + info.iMaxClip = MAX_CLIP; + info.iSlot = SLOT; + info.iPosition = POSITION; + info.iId = g_ItemRegistry.GetIdForName( self.pev.classname ); + info.iFlags = FLAGS; + info.iWeight = WEIGHT; + + return true; + } + + bool AddToPlayer( CBasePlayer@ pPlayer ) + { + return CommonAddToPlayer( pPlayer ); + } + + bool PlayEmptySound() + { + return CommonPlayEmptySound( (WeaponGLMode == INS2BASE::GL_AIMED) ? EMPTYGL : EMPTY_S ); + } + + bool Deploy() + { + PlayDeploySound( 3 ); + DisplayFiremodeSprite(); + if( m_WasDrawn == false ) + { + m_WasDrawn = true; + return Deploy( V_MODEL, P_MODEL, DRAW_FIRST, "m16", GetBodygroup(), (82.0/30.0) ); + } + else + { + if( WeaponGLMode == INS2BASE::GL_AIMED ) + return Deploy( V_MODEL, P_MODEL, GL_DRAW, "m16", GetBodygroup(), (28.0/31.0) ); + else + return Deploy( V_MODEL, P_MODEL, DRAW, "m16", GetBodygroup(), (19.0/30.0) ); + } + } + + void Holster( int skipLocal = 0 ) + { + CommonHolster(); + + BaseClass.Holster( skipLocal ); + } + + void PrimaryAttack( void ) + { + if( WeaponGLMode == INS2BASE::GL_AIMED ) + { + if( self.m_iClip2 <= 0 ) + { + self.PlayEmptySound(); + self.SendWeaponAnim( (WeaponADSMode == INS2BASE::IRON_IN) ? GL_IRON_DRYFIRE : GL_DRYFIRE, 0, GetBodygroup() ); + self.m_flNextPrimaryAttack = WeaponTimeBase() + 0.3f; + return; + } + + Vector ang_Aim = m_pPlayer.pev.v_angle + m_pPlayer.pev.punchangle; + Math.MakeVectors( ang_Aim ); + --self.m_iClip2; + + Vector vecStart; + if( WeaponADSMode != INS2BASE::IRON_IN ) + vecStart = (m_pPlayer.pev.button & IN_DUCK == 0) ? m_pPlayer.GetGunPosition() + g_Engine.v_forward * 16 + g_Engine.v_right * 5 + g_Engine.v_up * -10 : + m_pPlayer.GetGunPosition() + g_Engine.v_forward * 16 + g_Engine.v_right * 5 + g_Engine.v_up * -10 + m_pPlayer.pev.view_ofs * 0.25; + else + vecStart = (m_pPlayer.pev.button & IN_DUCK == 0) ? m_pPlayer.GetGunPosition() + g_Engine.v_forward * 16 + g_Engine.v_up * -2 : + m_pPlayer.GetGunPosition() + g_Engine.v_forward * 16 + g_Engine.v_up * -2 + m_pPlayer.pev.view_ofs * 0.01; + + Vector vecVeloc = g_Engine.v_forward * SPEED + g_Engine.v_up * 12; + g_SoundSystem.EmitSoundDyn( m_pPlayer.edict(), CHAN_WEAPON, SHOOTGL, Math.RandomFloat( 0.95, 1.0 ), 0.7, 0, 95 + Math.RandomLong( 0, 0x9 ) ); + INS2GLPROJECTILE::CIns2GL@ pGL = INS2GLPROJECTILE::ShootGrenade( m_pPlayer.pev, vecStart, vecVeloc, DAMAGE_GL, G_MODEL, false, PROJ_NAME ); + pGL.pev.body = 1; + + self.SendWeaponAnim( (WeaponADSMode == INS2BASE::IRON_IN) ? GL_IRON_FIRE : GL_FIRE, 0, GetBodygroup() ); + self.m_flNextPrimaryAttack = self.m_flNextSecondaryAttack = self.m_flNextTertiaryAttack = WeaponTimeBase() + 0.5; + self.m_flTimeWeaponIdle = WeaponTimeBase() + 1.0; + PunchAngle( Vector( Math.RandomFloat( -2.55, -3.6 ), (Math.RandomLong( 0, 1 ) < 0.5) ? -1.15 : 1.45, Math.RandomFloat( -0.5, 0.5 ) ) ); + + //Manually set M203 Shoot animation on the player + m_pPlayer.m_Activity = ACT_RELOAD; + m_pPlayer.pev.frame = 0; + m_pPlayer.pev.sequence = 148; + m_pPlayer.ResetSequenceInfo(); + } + else + { + if( self.m_iClip <= 0 ) + { + self.PlayEmptySound(); + self.SendWeaponAnim( (WeaponADSMode == INS2BASE::IRON_IN) ? IRON_DRYFIRE : DRYFIRE, 0, GetBodygroup() ); + self.m_flNextPrimaryAttack = WeaponTimeBase() + 0.3f; + return; + } + + if( WeaponSelectFireMode == INS2BASE::SELECTFIRE_SEMI && m_pPlayer.m_afButtonPressed & IN_ATTACK == 0 ) + return; + + self.m_flNextPrimaryAttack = self.m_flNextSecondaryAttack = (m_pPlayer.pev.waterlevel == WATERLEVEL_HEAD) ? WeaponTimeBase() + GetFireRate( RPM_WTR ) : WeaponTimeBase() + GetFireRate( RPM_AIR ); + self.m_flTimeWeaponIdle = WeaponTimeBase() + 1.0f; + + ShootWeapon( SHOOT_S, 1, VecModAcc( VECTOR_CONE_1DEGREES, 1.25f, 0.5f, 1.25f ), (m_pPlayer.pev.waterlevel == WATERLEVEL_HEAD) ? 1024 : 8192, DAMAGE, true ); + + m_pPlayer.m_iWeaponVolume = NORMAL_GUN_VOLUME; + m_pPlayer.m_iWeaponFlash = BRIGHT_GUN_FLASH; + + if( WeaponADSMode != INS2BASE::IRON_IN ) + { + if( !( m_pPlayer.pev.flags & FL_ONGROUND != 0 ) ) + KickBack( 1.3, 0.6, 0.26, 0.18, 6.0, 3.5, 7 ); + else if( m_pPlayer.pev.velocity.Length2D() > 0 ) + KickBack( 1.1, 0.55, 0.31, 0.048, 4.0, 3.0, 8 ); + else if( m_pPlayer.pev.flags & FL_DUCKING != 0 ) + KickBack( 0.7, 0.4, 0.23, 0.013, 3.5, 2.0, 5 ); + else + KickBack( 0.75, 0.45, 0.28, 0.018, 3.75, 2.25, 6 ); + } + else + { + PunchAngle( Vector( Math.RandomFloat( -2.55, -2.25 ), (Math.RandomLong( 0, 1 ) < 0.5) ? -0.5f : 0.7f, Math.RandomFloat( -0.5, 0.5 ) ) ); + } + + if( WeaponADSMode == INS2BASE::IRON_IN ) + self.SendWeaponAnim( Math.RandomLong( IRON_FIRE1, IRON_FIRE3 ), 0, GetBodygroup() ); + else + self.SendWeaponAnim( Math.RandomLong( FIRE1, FIRE2 ), 0, GetBodygroup() ); + + ShellEject( m_pPlayer, m_iShell, (WeaponADSMode != INS2BASE::IRON_IN) ? Vector( 17, 6.5, -6.5 ) : Vector( 17, 1.5, -6.5 ) ); + } + } + + void SecondaryAttack() + { + self.m_flTimeWeaponIdle = self.m_flNextSecondaryAttack = WeaponTimeBase() + 0.2; + self.m_flNextPrimaryAttack = WeaponTimeBase() + 0.13; + + switch( WeaponADSMode ) + { + case INS2BASE::IRON_OUT: + { + self.SendWeaponAnim( (WeaponGLMode == INS2BASE::GL_AIMED) ? GL_IRON_TO : IRON_TO, 0, GetBodygroup() ); + EffectsFOVON( AIM_FOV ); + break; + } + case INS2BASE::IRON_IN: + { + self.SendWeaponAnim( (WeaponGLMode == INS2BASE::GL_AIMED) ? GL_IRON_FROM : IRON_FROM, 0, GetBodygroup() ); + EffectsFOVOFF(); + break; + } + } + } + + void TertiaryAttack() + { + if( WeaponADSMode == INS2BASE::IRON_IN ) + GrenadeLauncherSwitch( GL_IRON_IN, GL_IRON_OUT, GetBodygroup(), (45.0/34.0), (45.0/34.0) ); + else + GrenadeLauncherSwitch( GL_IN, GL_OUT, GetBodygroup(), (45.0/34.0), (45.0/34.0) ); + } + + void ItemPreFrame() + { + if( m_reloadTimer < g_Engine.time && canReload ) + self.Reload(); + + BaseClass.ItemPreFrame(); + } + + void Reload() + { + if( WeaponGLMode == INS2BASE::GL_AIMED ) + { + if( self.m_iClip2 == MAX_CLIP2 || m_pPlayer.m_rgAmmo( self.m_iSecondaryAmmoType ) <= 0 ) + return; + + if( WeaponADSMode == INS2BASE::IRON_IN ) + { + self.SendWeaponAnim( GL_IRON_FROM, 0, GetBodygroup() ); + m_reloadTimer = g_Engine.time + 0.16; + m_pPlayer.m_flNextAttack = 0.16; + canReload = true; + EffectsFOVOFF(); + } + + if( m_reloadTimer < g_Engine.time ) + { + ReloadSecondary( MAX_CLIP2, GL_RELOAD, (133.0/34.0), GetBodygroup() ); + //Manually set M203 Reload animation on the player + m_pPlayer.m_Activity = ACT_RELOAD; + m_pPlayer.pev.frame = 0; + m_pPlayer.pev.sequence = 150; + m_pPlayer.ResetSequenceInfo(); + canReload = false; + } + } + else + { + ChangeFireMode( (WeaponADSMode == INS2BASE::IRON_IN) ? IRON_FIRESELECT : FIRESELECT, GetBodygroup(), INS2BASE::SELECTFIRE_AUTO, INS2BASE::SELECTFIRE_SEMI, (25.0/30.0) ); + + if( self.m_iClip == MAX_CLIP || m_pPlayer.m_rgAmmo( self.m_iPrimaryAmmoType ) <= 0 || m_pPlayer.pev.button & IN_USE != 0 ) + return; + + if( WeaponADSMode == INS2BASE::IRON_IN ) + { + self.SendWeaponAnim( IRON_FROM, 0, GetBodygroup() ); + m_reloadTimer = g_Engine.time + 0.16; + m_pPlayer.m_flNextAttack = 0.16; + canReload = true; + EffectsFOVOFF(); + } + + if( m_reloadTimer < g_Engine.time ) + { + if( self.m_iClip == 0 ) + Reload( MAX_CLIP, (Math.RandomLong( 0, 1 ) < 0.5) ? RELOAD_EMPTY1 : RELOAD_EMPTY2, (146.0/34.0), GetBodygroup() ); + else + Reload( MAX_CLIP, RELOAD, (127.0/34.0), GetBodygroup() ); + + canReload = false; + } + + BaseClass.Reload(); + } + } + + void WeaponIdle() + { + if( self.m_flNextPrimaryAttack < g_Engine.time ) + m_iShotsFired = 0; + + self.ResetEmptySound(); + m_pPlayer.GetAutoaimVector( AUTOAIM_10DEGREES ); + + if( self.m_flTimeWeaponIdle > WeaponTimeBase() ) + return; + + if( WeaponADSMode != INS2BASE::IRON_IN ) + self.SendWeaponAnim( (WeaponGLMode == INS2BASE::GL_AIMED) ? GL_IDLE : IDLE, 0, GetBodygroup() ); + else + self.SendWeaponAnim( (WeaponGLMode == INS2BASE::GL_AIMED) ? GL_IRON_IDLE : IRON_IDLE, 0, GetBodygroup() ); + + self.m_flTimeWeaponIdle = WeaponTimeBase() + g_PlayerFuncs.SharedRandomFloat( m_pPlayer.random_seed, 5, 7 ); + } +} + +class M16A1_MAG : ScriptBasePlayerAmmoEntity, INS2BASE::AmmoBase +{ + void Spawn() + { + Precache(); + g_EntityFuncs.SetModel( self, A_MODEL ); + self.pev.body = MAG_BDYGRP; + BaseClass.Spawn(); + } + + void Precache() + { + g_Game.PrecacheModel( A_MODEL ); + CommonPrecache(); + } + + bool AddAmmo( CBaseEntity@ pOther ) + { + return CommonAddAmmo( pOther, MAX_CLIP, (INS2BASE::ShouldUseCustomAmmo) ? MAX_CARRY : INS2BASE::DF_MAX_CARRY_556, (INS2BASE::ShouldUseCustomAmmo) ? AMMO_TYPE : INS2BASE::DF_AMMO_556 ); + } +} + +class M203_MAG : ScriptBasePlayerAmmoEntity, INS2BASE::AmmoBase +{ + void Spawn() + { + Precache(); + g_EntityFuncs.SetModel( self, G_MODEL ); + BaseClass.Spawn(); + } + + void Precache() + { + g_Game.PrecacheModel( G_MODEL ); + CommonPrecache(); + } + + bool AddAmmo( CBaseEntity@ pOther ) + { + return CommonAddAmmo( pOther, MAX_CLIP2, (INS2BASE::ShouldUseCustomAmmo) ? MAX_CARRY2 : INS2BASE::DF_MAX_CARRY_ARGR, (INS2BASE::ShouldUseCustomAmmo) ? AMMO_TYPE2 : INS2BASE::DF_AMMO_ARGR ); + } +} + +string GetAmmoName() +{ + return "ammo_ins2m16a1"; +} + +string GetGLName() +{ + return "ammo_ins2m16a1gl"; +} + +string GetName() +{ + return "weapon_ins2m16a1"; +} + +void Register() +{ + INS2GLPROJECTILE::Register( PROJ_NAME ); + g_CustomEntityFuncs.RegisterCustomEntity( "INS2_M16A1::weapon_ins2m16a1", GetName() ); // Register the weapon entity + g_CustomEntityFuncs.RegisterCustomEntity( "INS2_M16A1::M16A1_MAG", GetAmmoName() ); // Register the ammo entity + g_CustomEntityFuncs.RegisterCustomEntity( "INS2_M16A1::M203_MAG", INS2_M16A1::GetGLName() ); // Register the ammo entity + + // Since the weapon uses basically the same grenade ammo as the m16/m79, no new entities will be registered unless they're not being registered anywhere else + g_ItemRegistry.RegisterWeapon( GetName(), SPR_CAT, AMMO_TYPE, AMMO_TYPE2, GetAmmoName(), INS2_M16A1::GetGLName() ); // Register the weapon +} + +} \ No newline at end of file diff --git a/scripts/maps/ins2/arifl/weapon_ins2m16a4.as b/scripts/maps/ins2/arifl/weapon_ins2m16a4.as index 2d17bb2..9abc2ad 100644 --- a/scripts/maps/ins2/arifl/weapon_ins2m16a4.as +++ b/scripts/maps/ins2/arifl/weapon_ins2m16a4.as @@ -77,9 +77,10 @@ uint DAMAGE = 23; uint DAMAGE_GL = 145; float SPEED = 1400; uint SLOT = 5; -uint POSITION = 17; +uint POSITION = 13; float RPM_AIR = 950; float RPM_WTR = 700; +uint AIM_FOV = 40; // Below 50 hides crosshair string AMMO_TYPE = "ins2_5.56x45mm"; string AMMO_TYPE2 = "ins2_40x46mm"; string PROJ_NAME = "proj_ins2m16a4"; @@ -282,6 +283,8 @@ class weapon_ins2m16a4 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, INS return; } + self.m_flNextPrimaryAttack = self.m_flNextSecondaryAttack = WeaponTimeBase() + 0.1; + if( WeaponSelectFireMode == INS2BASE::SELECTFIRE_SEMI && m_pPlayer.m_afButtonPressed & IN_ATTACK == 0 ) return; else if( WeaponSelectFireMode == INS2BASE::SELECTFIRE_3XBURST ) @@ -309,7 +312,7 @@ class weapon_ins2m16a4 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, INS case INS2BASE::IRON_OUT: { self.SendWeaponAnim( (WeaponGLMode == INS2BASE::GL_AIMED) ? GL_IRON_TO : IRON_TO, 0, GetBodygroup() ); - EffectsFOVON( 40 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/arifl/weapon_ins2stg44.as b/scripts/maps/ins2/arifl/weapon_ins2stg44.as index 4dc4f40..b9f6883 100644 --- a/scripts/maps/ins2/arifl/weapon_ins2stg44.as +++ b/scripts/maps/ins2/arifl/weapon_ins2stg44.as @@ -53,9 +53,10 @@ int WEIGHT = 20; int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY; uint DAMAGE = 26; uint SLOT = 5; -uint POSITION = 14; +uint POSITION = 5; float RPM_AIR = 575; //Rounds per minute in air float RPM_WTR = 500; //Rounds per minute in water +uint AIM_FOV = 40; // Below 50 hides crosshair string AMMO_TYPE = "ins2_7.92x33mm"; class weapon_ins2stg44 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase @@ -210,7 +211,7 @@ class weapon_ins2stg44 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase case INS2BASE::IRON_OUT: { self.SendWeaponAnim( IRON_TO, 0, GetBodygroup() ); - EffectsFOVON( 40 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/base.as b/scripts/maps/ins2/base.as index db93d3f..8fce429 100644 --- a/scripts/maps/ins2/base.as +++ b/scripts/maps/ins2/base.as @@ -69,7 +69,7 @@ const string AMMO_PICKUP_S = "ins2/wpn/ammo.ogg"; //Default ammo pickup sound const string FIREMODE_SPRT = "ins2/firemodes.spr"; //Default firemodes sprite for weapons that support it const string BIPODMOD_SPRT = "ins2/bipod.spr"; const string WEAP_SPRT_S01 = "ins2/wpn1024.spr"; //Sprite file that the weapon will precache -//const string WEAP_SPRT_S02 = "ins2/wpn05.spr"; //Sprite file that the weapon will precache +const string WEAP_SPRT_S02 = "ins2/wpn06.spr"; //Sprite file that the weapon will precache //Bullet types //Pistols @@ -246,7 +246,7 @@ mixin class WeaponBase g_Game.PrecacheModel( "sprites/" + FIREMODE_SPRT ); g_Game.PrecacheModel( "sprites/" + BIPODMOD_SPRT ); g_Game.PrecacheModel( "sprites/" + WEAP_SPRT_S01 ); - //g_Game.PrecacheModel( "sprites/" + WEAP_SPRT_S02 ); + g_Game.PrecacheModel( "sprites/" + WEAP_SPRT_S02 ); // Strings g_SoundSystem.PrecacheSound( EMPTY_SHOOT_S ); diff --git a/scripts/maps/ins2/brifl/weapon_ins2fg42.as b/scripts/maps/ins2/brifl/weapon_ins2fg42.as index 91d1b09..e31e44f 100644 --- a/scripts/maps/ins2/brifl/weapon_ins2fg42.as +++ b/scripts/maps/ins2/brifl/weapon_ins2fg42.as @@ -96,9 +96,10 @@ int WEIGHT = 40; int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY | ITEM_FLAG_ESSENTIAL; uint DAMAGE = 42; uint SLOT = 6; -uint POSITION = 13; +uint POSITION = 14; float RPM_AIR = 850; //Rounds per minute in air float RPM_WTR = 675; //Rounds per minute in water +uint AIM_FOV = 40; // Below 50 hides crosshair string AMMO_TYPE = "ins2_7.92x57mm"; class weapon_ins2fg42 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, INS2BASE::BipodWeaponBase @@ -289,7 +290,7 @@ class weapon_ins2fg42 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, INS2 else self.SendWeaponAnim( (self.m_iClip > 0) ? BIPOD_IRON_TO : BIPOD_IRON_TO_EMPTY, GetBodygroup() ); - EffectsFOVON( 40 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/brifl/weapon_ins2fnfal.as b/scripts/maps/ins2/brifl/weapon_ins2fnfal.as index cba5777..bf13977 100644 --- a/scripts/maps/ins2/brifl/weapon_ins2fnfal.as +++ b/scripts/maps/ins2/brifl/weapon_ins2fnfal.as @@ -53,9 +53,10 @@ int WEIGHT = 20; int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY; uint DAMAGE = 37; uint SLOT = 6; -uint POSITION = 8; +uint POSITION = 9; float RPM_AIR = 650; //Rounds per minute in air float RPM_WTR = 550; //Rounds per minute in water +uint AIM_FOV = 40; // Below 50 hides crosshair string AMMO_TYPE = "ins2_7.62x51mm"; class weapon_ins2fnfal : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase @@ -211,7 +212,7 @@ class weapon_ins2fnfal : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase case INS2BASE::IRON_OUT: { self.SendWeaponAnim( IRON_TO, 0, GetBodygroup() ); - EffectsFOVON( 40 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/brifl/weapon_ins2g3a3.as b/scripts/maps/ins2/brifl/weapon_ins2g3a3.as index cf676b1..5a3d7fd 100644 --- a/scripts/maps/ins2/brifl/weapon_ins2g3a3.as +++ b/scripts/maps/ins2/brifl/weapon_ins2g3a3.as @@ -52,9 +52,10 @@ int WEIGHT = 20; int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY; uint DAMAGE = 37; uint SLOT = 6; -uint POSITION = 9; +uint POSITION = 10; float RPM_AIR = 550; //Rounds per minute in air float RPM_WTR = 475; //Rounds per minute in water +uint AIM_FOV = 40; // Below 50 hides crosshair string AMMO_TYPE = "ins2_7.62x51mm"; class weapon_ins2g3a3 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase @@ -210,7 +211,7 @@ class weapon_ins2g3a3 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase case INS2BASE::IRON_OUT: { self.SendWeaponAnim( IRON_TO, 0, GetBodygroup() ); - EffectsFOVON( 40 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/brifl/weapon_ins2m14ebr.as b/scripts/maps/ins2/brifl/weapon_ins2m14ebr.as index 4cbc848..242f046 100644 --- a/scripts/maps/ins2/brifl/weapon_ins2m14ebr.as +++ b/scripts/maps/ins2/brifl/weapon_ins2m14ebr.as @@ -63,9 +63,10 @@ int WEIGHT = 20; int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY; uint DAMAGE = 40; uint SLOT = 6; -uint POSITION = 11; +uint POSITION = 12; float RPM_AIR = 710; //Rounds per minute in air float RPM_WTR = 550; //Rounds per minute in water +uint AIM_FOV = 30; // Below 50 hides crosshair string AMMO_TYPE = "ins2_7.62x51mm"; class weapon_ins2m14ebr : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase @@ -221,7 +222,7 @@ class weapon_ins2m14ebr : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase { m_pPlayer.m_szAnimExtension = "sniperscope"; self.SendWeaponAnim( (self.m_iClip > 0) ? IRON_TO : IRON_TO_EMPTY, 0, GetBodygroup() ); - EffectsFOVON( 30 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/brifl/weapon_ins2scarh.as b/scripts/maps/ins2/brifl/weapon_ins2scarh.as new file mode 100644 index 0000000..f033fc9 --- /dev/null +++ b/scripts/maps/ins2/brifl/weapon_ins2scarh.as @@ -0,0 +1,331 @@ +// Insurgency's FN SCAR-H +/* Model Credits +/ Model: End of Days, ImBrokeRu (Magazine), Norman The Loli Pirate (Edits) +/ Textures: Racer445, Bull5hit (Magazine), Norman The Loli Pirate (Edits) +/ Animations: Mr. Brightside, D.N.I.O. 071 (Heavy Edits) +/ Sounds: KernCore (Mix of Navaro, Tripwire Interactive, D.I.C.E.), D.N.I.O. 071 (Conversion to .ogg format) +/ Sprites: D.N.I.O. 071 (Model Render), R4to0 (Vector), KernCore (.spr Compile) +/ Misc: Norman The Loli Pirate (World Model), KernCore (World Model UVs), D.N.I.O. 071 (World Model UVs, Compile) +/ Script: KernCore +*/ + +#include "../base" + +namespace INS2_SCARH +{ + +// Animations +enum INS2_SCARH_Animations +{ + IDLE = 0, + IDLE_EMPTY, + DRAW_FIRST, + DRAW, + DRAW_EMPTY, + HOLSTER, + HOLSTER_EMPTY, + FIRE, + FIRE_LAST, + DRYFIRE, + FIRESELECT, + FIRESELECT_EMPTY, + RELOAD, + RELOAD_EMPTY, + IRON_IDLE, + IRON_IDLE_EMPTY, + IRON_FIRE, + IRON_FIRE_LAST, + IRON_DRYFIRE, + IRON_FIRESELECT, + IRON_FIRESELECT_EMPTY, + IRON_TO, + IRON_TO_EMPTY, + IRON_FROM, + IRON_FROM_EMPTY +}; + +// Models +string W_MODEL = "models/ins2/wpn/scar/w_scar.mdl"; +string V_MODEL = "models/ins2/wpn/scar/v_scar.mdl"; +string P_MODEL = "models/ins2/wpn/scar/p_scar.mdl"; +string A_MODEL = "models/ins2/ammo/mags2.mdl"; +int MAG_BDYGRP = 6; +// Sprites +string SPR_CAT = "ins2/brf/"; //Weapon category used to get the sprite's location +// Sounds +string SHOOT_S = "ins2/wpn/scar/shoot.ogg"; +string EMPTY_S = "ins2/wpn/scar/empty.ogg"; +// Information +int MAX_CARRY = 1000; +int MAX_CLIP = 20; +int DEFAULT_GIVE = MAX_CLIP * 4; +int WEIGHT = 20; +int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY; +uint DAMAGE = 40; +uint SLOT = 6; +uint POSITION = 13; +float RPM_AIR = 600; //Rounds per minute in air +float RPM_WTR = 500; //Rounds per minute in water +uint AIM_FOV = 40; // Below 50 hides crosshair +string AMMO_TYPE = "ins2_7.62x51mm"; + +class weapon_ins2scarh : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase +{ + private CBasePlayer@ m_pPlayer + { + get const { return cast( self.m_hPlayer.GetEntity() ); } + set { self.m_hPlayer = EHandle( @value ); } + } + private int m_iShell; + private bool m_WasDrawn; + private int GetBodygroup() + { + return 0; + } + private array Sounds = { + "ins2/wpn/scar/bltbk.ogg", + "ins2/wpn/scar/bltrel.ogg", + "ins2/wpn/scar/rof.ogg", + "ins2/wpn/scar/magin.ogg", + "ins2/wpn/scar/magout.ogg", + "ins2/wpn/scar/magrel.ogg", + EMPTY_S, + SHOOT_S + }; + + void Spawn() + { + Precache(); + WeaponSelectFireMode = INS2BASE::SELECTFIRE_SEMI; + m_WasDrawn = false; + CommonSpawn( W_MODEL, DEFAULT_GIVE ); + } + + void Precache() + { + self.PrecacheCustomModels(); + g_Game.PrecacheModel( W_MODEL ); + g_Game.PrecacheModel( V_MODEL ); + g_Game.PrecacheModel( P_MODEL ); + g_Game.PrecacheModel( A_MODEL ); + m_iShell = g_Game.PrecacheModel( INS2BASE::BULLET_762x51 ); + + g_Game.PrecacheOther( GetAmmoName() ); + + INS2BASE::PrecacheSound( Sounds ); + INS2BASE::PrecacheSound( INS2BASE::DeployFirearmSounds ); + + g_Game.PrecacheGeneric( "sprites/" + SPR_CAT + self.pev.classname + ".txt" ); + g_Game.PrecacheGeneric( "events/" + "muzzle_ins2_MGs.txt" ); + CommonPrecache(); + } + + bool GetItemInfo( ItemInfo& out info ) + { + info.iMaxAmmo1 = (INS2BASE::ShouldUseCustomAmmo) ? MAX_CARRY : INS2BASE::DF_MAX_CARRY_556; + info.iAmmo1Drop = MAX_CLIP; + info.iMaxAmmo2 = -1; + info.iAmmo2Drop = -1; + info.iMaxClip = MAX_CLIP; + info.iSlot = SLOT; + info.iPosition = POSITION; + info.iId = g_ItemRegistry.GetIdForName( self.pev.classname ); + info.iFlags = FLAGS; + info.iWeight = WEIGHT; + + return true; + } + + bool AddToPlayer( CBasePlayer@ pPlayer ) + { + return CommonAddToPlayer( pPlayer ); + } + + bool PlayEmptySound() + { + return CommonPlayEmptySound( EMPTY_S ); + } + + bool Deploy() + { + PlayDeploySound( 3 ); + DisplayFiremodeSprite(); + if( m_WasDrawn == false ) + { + m_WasDrawn = true; + return Deploy( V_MODEL, P_MODEL, DRAW_FIRST, "m16", GetBodygroup(), (72.0/35.0) ); + } + else + return Deploy( V_MODEL, P_MODEL, (self.m_iClip == 0) ? DRAW_EMPTY : DRAW, "m16", GetBodygroup(), (22.0/30.0) ); + } + + void Holster( int skipLocal = 0 ) + { + CommonHolster(); + + BaseClass.Holster( skipLocal ); + } + + void PrimaryAttack() + { + if( self.m_iClip <= 0 ) + { + self.PlayEmptySound(); + self.SendWeaponAnim( (WeaponADSMode == INS2BASE::IRON_IN) ? IRON_DRYFIRE : DRYFIRE, 0, GetBodygroup() ); + self.m_flNextPrimaryAttack = WeaponTimeBase() + 0.3f; + return; + } + + if( WeaponSelectFireMode == INS2BASE::SELECTFIRE_SEMI && m_pPlayer.m_afButtonPressed & IN_ATTACK == 0 ) + return; + + self.m_flNextPrimaryAttack = self.m_flNextSecondaryAttack = (m_pPlayer.pev.waterlevel == WATERLEVEL_HEAD) ? WeaponTimeBase() + GetFireRate( RPM_WTR ) : WeaponTimeBase() + GetFireRate( RPM_AIR ); + self.m_flTimeWeaponIdle = WeaponTimeBase() + 1.0f; + + ShootWeapon( SHOOT_S, 1, VecModAcc( VECTOR_CONE_1DEGREES, 2.25f, 0.65f, 1.95f ), (m_pPlayer.pev.waterlevel == WATERLEVEL_HEAD) ? 1024 : 10240, DAMAGE, true ); + + m_pPlayer.m_iWeaponVolume = NORMAL_GUN_VOLUME; + m_pPlayer.m_iWeaponFlash = BRIGHT_GUN_FLASH; + + if( WeaponADSMode != INS2BASE::IRON_IN ) + { + if( m_pPlayer.pev.velocity.Length2D() > 0 ) + KickBack( 1.55, 0.25, 0.225, 0.05, 6.0, 1.5, 7 ); + else if( !( m_pPlayer.pev.flags & FL_ONGROUND != 0 ) ) + KickBack( 2.0, 0.8, 0.5, 0.35, 9.0, 6.0, 5 ); + else if( m_pPlayer.pev.flags & FL_DUCKING != 0 ) + KickBack( 0.95, 0.2, 0.15, 0.025, 4.0, 0.95, 9 ); + else + KickBack( 1.05, 0.235, 0.175, 0.0375, 5.0, 1.25, 8 ); + } + else + { + PunchAngle( Vector( Math.RandomFloat( -2.6, -2.4 ), (Math.RandomLong( 0, 1 ) < 0.5) ? -0.3f : 0.3f, Math.RandomFloat( -0.5, 0.5 ) ) ); + } + + if( WeaponADSMode == INS2BASE::IRON_IN ) + self.SendWeaponAnim( (self.m_iClip == 0) ? IRON_FIRE_LAST : IRON_FIRE, 0, GetBodygroup() ); + else + self.SendWeaponAnim( (self.m_iClip == 0) ? FIRE_LAST : FIRE, 0, GetBodygroup() ); + + ShellEject( m_pPlayer, m_iShell, (WeaponADSMode != INS2BASE::IRON_IN) ? Vector( 19, 6.5, -8 ) : Vector( 19, 2, -4 ) ); + } + + void SecondaryAttack() + { + self.m_flTimeWeaponIdle = self.m_flNextSecondaryAttack = WeaponTimeBase() + 0.2; + self.m_flNextPrimaryAttack = WeaponTimeBase() + 0.13; + + switch( WeaponADSMode ) + { + case INS2BASE::IRON_OUT: + { + self.SendWeaponAnim( (self.m_iClip > 0) ? IRON_TO : IRON_TO_EMPTY, 0, GetBodygroup() ); + EffectsFOVON( AIM_FOV ); + break; + } + case INS2BASE::IRON_IN: + { + self.SendWeaponAnim( (self.m_iClip > 0) ? IRON_FROM : IRON_FROM_EMPTY, 0, GetBodygroup() ); + EffectsFOVOFF(); + break; + } + } + } + + void ItemPreFrame() + { + if( m_reloadTimer < g_Engine.time && canReload ) + self.Reload(); + + BaseClass.ItemPreFrame(); + } + + void Reload() + { + if( self.m_iClip > 0 ) + ChangeFireMode( (WeaponADSMode == INS2BASE::IRON_IN) ? IRON_FIRESELECT : FIRESELECT, GetBodygroup(), INS2BASE::SELECTFIRE_AUTO, INS2BASE::SELECTFIRE_SEMI, (25.0/30.0) ); + else + ChangeFireMode( (WeaponADSMode == INS2BASE::IRON_IN) ? IRON_FIRESELECT_EMPTY : FIRESELECT_EMPTY, GetBodygroup(), INS2BASE::SELECTFIRE_AUTO, INS2BASE::SELECTFIRE_SEMI, (25.0/30.0) ); + + if( self.m_iClip == MAX_CLIP || m_pPlayer.m_rgAmmo( self.m_iPrimaryAmmoType ) <= 0 || m_pPlayer.pev.button & IN_USE != 0 ) + return; + + if( WeaponADSMode == INS2BASE::IRON_IN ) + { + self.SendWeaponAnim( (self.m_iClip > 0) ? IRON_FROM : IRON_FROM_EMPTY, 0, GetBodygroup() ); + m_reloadTimer = g_Engine.time + 0.16; + m_pPlayer.m_flNextAttack = 0.16; + canReload = true; + EffectsFOVOFF(); + } + + if( m_reloadTimer < g_Engine.time ) + { + (self.m_iClip == 0) ? Reload( MAX_CLIP, RELOAD_EMPTY, (150.0/30.0), GetBodygroup() ) : Reload( MAX_CLIP, RELOAD, (105.0/30.0), GetBodygroup() ); + canReload = false; + } + + BaseClass.Reload(); + } + + void WeaponIdle() + { + if( self.m_flNextPrimaryAttack < g_Engine.time ) + m_iShotsFired = 0; + + self.ResetEmptySound(); + m_pPlayer.GetAutoaimVector( AUTOAIM_10DEGREES ); + + if( self.m_flTimeWeaponIdle > WeaponTimeBase() ) + return; + + if( WeaponADSMode == INS2BASE::IRON_IN ) + self.SendWeaponAnim( (self.m_iClip == 0) ? IRON_IDLE_EMPTY : IRON_IDLE, 0, GetBodygroup() ); + else + self.SendWeaponAnim( (self.m_iClip == 0) ? IDLE_EMPTY : IDLE, 0, GetBodygroup() ); + + self.m_flTimeWeaponIdle = WeaponTimeBase() + g_PlayerFuncs.SharedRandomFloat( m_pPlayer.random_seed, 5, 7 ); + } +} + +class SCARH_MAG : ScriptBasePlayerAmmoEntity, INS2BASE::AmmoBase +{ + void Spawn() + { + Precache(); + g_EntityFuncs.SetModel( self, A_MODEL ); + self.pev.body = MAG_BDYGRP; + BaseClass.Spawn(); + } + + void Precache() + { + g_Game.PrecacheModel( A_MODEL ); + CommonPrecache(); + } + + bool AddAmmo( CBaseEntity@ pOther ) + { + return CommonAddAmmo( pOther, MAX_CLIP, (INS2BASE::ShouldUseCustomAmmo) ? MAX_CARRY : INS2BASE::DF_MAX_CARRY_556, (INS2BASE::ShouldUseCustomAmmo) ? AMMO_TYPE : INS2BASE::DF_AMMO_556 ); + } +} + +string GetAmmoName() +{ + return "ammo_ins2scarh"; +} + +string GetName() +{ + return "weapon_ins2scarh"; +} + +void Register() +{ + g_CustomEntityFuncs.RegisterCustomEntity( "INS2_SCARH::weapon_ins2scarh", GetName() ); // Register the weapon entity + g_CustomEntityFuncs.RegisterCustomEntity( "INS2_SCARH::SCARH_MAG", GetAmmoName() ); // Register the ammo entity + g_ItemRegistry.RegisterWeapon( GetName(), SPR_CAT, (INS2BASE::ShouldUseCustomAmmo) ? AMMO_TYPE : INS2BASE::DF_AMMO_556, "", GetAmmoName() ); // Register the weapon +} + +} \ No newline at end of file diff --git a/scripts/maps/ins2/carbn/weapon_ins2aks74u.as b/scripts/maps/ins2/carbn/weapon_ins2aks74u.as index 26b22f9..e20f0a3 100644 --- a/scripts/maps/ins2/carbn/weapon_ins2aks74u.as +++ b/scripts/maps/ins2/carbn/weapon_ins2aks74u.as @@ -53,9 +53,10 @@ int WEIGHT = 20; int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY; uint DAMAGE = 22; uint SLOT = 3; -uint POSITION = 7; +uint POSITION = 6; float RPM_AIR = 675; //Rounds per minute in air float RPM_WTR = 550; //Rounds per minute in water +uint AIM_FOV = 40; // Below 50 hides crosshair string AMMO_TYPE = "ins2_5.45x39mm"; class weapon_ins2aks74u : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase @@ -211,7 +212,7 @@ class weapon_ins2aks74u : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase case INS2BASE::IRON_OUT: { self.SendWeaponAnim( IRON_TO, 0, GetBodygroup() ); - EffectsFOVON( 40 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/carbn/weapon_ins2c96carb.as b/scripts/maps/ins2/carbn/weapon_ins2c96carb.as index 2a9702b..1f23323 100644 --- a/scripts/maps/ins2/carbn/weapon_ins2c96carb.as +++ b/scripts/maps/ins2/carbn/weapon_ins2c96carb.as @@ -70,6 +70,7 @@ uint SLOT = 3; uint POSITION = 4; float RPM_AIR = 1000; //Rounds per minute in air float RPM_WTR = 700; //Rounds per minute in water +uint AIM_FOV = 40; // Below 50 hides crosshair string AMMO_TYPE = "ins2_7.63x25mm"; class weapon_ins2c96carb : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase @@ -223,7 +224,7 @@ class weapon_ins2c96carb : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase case INS2BASE::IRON_OUT: { self.SendWeaponAnim( (self.m_iClip > 0) ? IRON_TO : IRON_TO_EMPTY, 0, GetBodygroup() ); - EffectsFOVON( 40 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/carbn/weapon_ins2g36c.as b/scripts/maps/ins2/carbn/weapon_ins2g36c.as new file mode 100644 index 0000000..487b9c1 --- /dev/null +++ b/scripts/maps/ins2/carbn/weapon_ins2g36c.as @@ -0,0 +1,348 @@ +// Insurgency's H&K G36C +/* Model Credits +/ Model: TheLama, Norman The Loli Pirate +/ Textures: Thanez, Norman The Loli Pirate +/ Animations: New World Interactive, MyZombieKillerz, D.N.I.O. 071 (Heavy Edits) +/ Sounds: New World Interactive, Magmacow, KernCore, D.N.I.O. 071 +/ Sprites: D.N.I.O. 071 (Model Render), R4to0 (Vector), KernCore (.spr Compile) +/ Misc: Norman The Loli Pirate (World Model), KernCore (World Model UVs), D.N.I.O. 071 (World Model UVs, Compile) +/ Script: KernCore +*/ + +#include "../base" + +namespace INS2_G36C +{ + +// Animations +enum INS2_G36C_Animations +{ + IDLE = 0, + IDLE_EMPTY, + DRAW_FIRST, + DRAW, + DRAW_EMPTY, + HOLSTER, + HOLSTER_EMPTY, + FIRE1, + FIRE2, + FIRE3, + FIRE_LAST, + DRYFIRE, + FIRESELECT, + FIRESELECT_EMPTY, + RELOAD, + RELOAD_EMPTY, + IRON_IDLE, + IRON_IDLE_EMPTY, + IRON_FIRE1, + IRON_FIRE2, + IRON_FIRE3, + IRON_FIRE_LAST, + IRON_DRYFIRE, + IRON_FIRESELECT, + IRON_FIRESELECT_EMPTY, + IRON_TO, + IRON_TO_EMPTY, + IRON_FROM, + IRON_FROM_EMPTY +}; + +// Models +string W_MODEL = "models/ins2/wpn/g36c/w_g36c.mdl"; +string V_MODEL = "models/ins2/wpn/g36c/v_g36c.mdl"; +string P_MODEL = "models/ins2/wpn/g36c/p_g36c.mdl"; +string A_MODEL = "models/ins2/ammo/mags2.mdl"; +int MAG_BDYGRP = 0; +int TOS_BDYGRP = 12; +// Sprites +string SPR_CAT = "ins2/cbn/"; //Weapon category used to get the sprite's location +// Sounds +string SHOOT_S = "ins2/wpn/g36c/shoot.ogg"; +string EMPTY_S = "ins2/wpn/mk18/empty.ogg"; +// Information +int MAX_CARRY = 1000; +int MAX_CLIP = 30; +int DEFAULT_GIVE = MAX_CLIP * 4; +int WEIGHT = 20; +int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY; +uint DAMAGE = 20; +uint SLOT = 3; +uint POSITION = 8; +float RPM_AIR = 741; //Rounds per minute in air +float RPM_WTR = 600; //Rounds per minute in water +uint AIM_FOV = 40; // Below 50 hides crosshair +string AMMO_TYPE = "ins2_5.56x45mm"; + +class weapon_ins2g36c : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase +{ + private CBasePlayer@ m_pPlayer + { + get const { return cast( self.m_hPlayer.GetEntity() ); } + set { self.m_hPlayer = EHandle( @value ); } + } + private int m_iShell; + private bool m_WasDrawn; + private int GetBodygroup() + { + return 0; + } + private array Sounds = { + "ins2/wpn/g36c/bltbk.ogg", + "ins2/wpn/g36c/bltrel.ogg", + "ins2/wpn/g36c/hit.ogg", + "ins2/wpn/g36c/magin.ogg", + "ins2/wpn/g36c/magout.ogg", + "ins2/wpn/g36c/magrel.ogg", + "ins2/wpn/g36c/rof.ogg", + SHOOT_S, + EMPTY_S + }; + + void Spawn() + { + Precache(); + WeaponSelectFireMode = INS2BASE::SELECTFIRE_AUTO; + m_WasDrawn = false; + CommonSpawn( W_MODEL, DEFAULT_GIVE ); + } + + void Precache() + { + self.PrecacheCustomModels(); + g_Game.PrecacheModel( W_MODEL ); + g_Game.PrecacheModel( V_MODEL ); + g_Game.PrecacheModel( P_MODEL ); + g_Game.PrecacheModel( A_MODEL ); + m_iShell = g_Game.PrecacheModel( INS2BASE::BULLET_556x45 ); + + g_Game.PrecacheOther( GetAmmoName() ); + + INS2BASE::PrecacheSound( Sounds ); + INS2BASE::PrecacheSound( INS2BASE::DeployFirearmSounds ); + + g_Game.PrecacheGeneric( "sprites/" + SPR_CAT + self.pev.classname + ".txt" ); + g_Game.PrecacheGeneric( "events/" + "muzzle_ins2_MGs.txt" ); + CommonPrecache(); + } + + bool GetItemInfo( ItemInfo& out info ) + { + info.iMaxAmmo1 = (INS2BASE::ShouldUseCustomAmmo) ? MAX_CARRY : INS2BASE::DF_MAX_CARRY_556; + info.iAmmo1Drop = MAX_CLIP; + info.iMaxAmmo2 = -1; + info.iAmmo2Drop = -1; + info.iMaxClip = MAX_CLIP; + info.iSlot = SLOT; + info.iPosition = POSITION; + info.iId = g_ItemRegistry.GetIdForName( self.pev.classname ); + info.iFlags = FLAGS; + info.iWeight = WEIGHT; + + return true; + } + + bool AddToPlayer( CBasePlayer@ pPlayer ) + { + return CommonAddToPlayer( pPlayer ); + } + + bool PlayEmptySound() + { + return CommonPlayEmptySound( EMPTY_S ); + } + + bool Deploy() + { + PlayDeploySound( 3 ); + DisplayFiremodeSprite(); + if( m_WasDrawn == false ) + { + m_WasDrawn = true; + return Deploy( V_MODEL, P_MODEL, DRAW_FIRST, "m16", GetBodygroup(), (85.0/36.0) ); + } + else + return Deploy( V_MODEL, P_MODEL, (self.m_iClip > 0) ? DRAW : DRAW_EMPTY, "m16", GetBodygroup(), (19.0/30.0) ); + } + + void Holster( int skipLocal = 0 ) + { + CommonHolster(); + + BaseClass.Holster( skipLocal ); + } + + void PrimaryAttack() + { + if( self.m_iClip <= 0 ) + { + self.PlayEmptySound(); + self.SendWeaponAnim( (WeaponADSMode == INS2BASE::IRON_IN) ? IRON_DRYFIRE : DRYFIRE, 0, GetBodygroup() ); + self.m_flNextPrimaryAttack = WeaponTimeBase() + 0.3f; + return; + } + + if( WeaponSelectFireMode == INS2BASE::SELECTFIRE_SEMI && m_pPlayer.m_afButtonPressed & IN_ATTACK == 0 ) + return; + + self.m_flNextPrimaryAttack = self.m_flNextSecondaryAttack = (m_pPlayer.pev.waterlevel == WATERLEVEL_HEAD) ? WeaponTimeBase() + GetFireRate( RPM_WTR ) : WeaponTimeBase() + GetFireRate( RPM_AIR ); + self.m_flTimeWeaponIdle = WeaponTimeBase() + 1.33f; + + //m_pPlayer.m_iHideHUD = 1 << 3 | 1 << 5; + + ShootWeapon( SHOOT_S, 1, VecModAcc( VECTOR_CONE_1DEGREES, 3.5f, 0.85f, 1.0f ), (m_pPlayer.pev.waterlevel == WATERLEVEL_HEAD) ? 1024 : 8192, DAMAGE, true ); + + m_pPlayer.m_iWeaponVolume = NORMAL_GUN_VOLUME; + m_pPlayer.m_iWeaponFlash = BRIGHT_GUN_FLASH; + + if( WeaponADSMode != INS2BASE::IRON_IN ) + { + if( !( m_pPlayer.pev.flags & FL_ONGROUND != 0 ) ) + KickBack( 1.0, 0.3, 0.35, 0.03, 4.5, 2.6, 5 ); + else if( m_pPlayer.pev.velocity.Length2D() > 0 ) + KickBack( 0.9, 0.3, 0.3, 0.03, 4.5, 2.5, 7 ); + else if( m_pPlayer.pev.flags & FL_DUCKING != 0 ) + KickBack( 0.4, 0.2, 0.15, 0.02, 3.25, 1.1, 10 ); + else + KickBack( 0.7, 0.225, 0.175, 0.0225, 3.6, 1.5, 8 ); + } + else + { + PunchAngle( Vector( Math.RandomFloat( -2, -1.9 ), (Math.RandomLong( 0, 1 ) < 0.5) ? -0.4f : 0.4f, Math.RandomFloat( -0.8, 0.8 ) ) ); + } + + if( WeaponADSMode == INS2BASE::IRON_IN ) + self.SendWeaponAnim( (self.m_iClip > 0) ? Math.RandomLong( IRON_FIRE1, IRON_FIRE3 ) : IRON_FIRE_LAST, 0, GetBodygroup() ); + else + self.SendWeaponAnim( (self.m_iClip > 0) ? Math.RandomLong( FIRE1, FIRE3 ) : FIRE_LAST, 0, GetBodygroup() ); + + ShellEject( m_pPlayer, m_iShell, (WeaponADSMode != INS2BASE::IRON_IN) ? Vector( 22, 6.5, -11 ) : Vector( 22, 2, -6 ) ); + } + + void SecondaryAttack() + { + self.m_flTimeWeaponIdle = self.m_flNextSecondaryAttack = WeaponTimeBase() + 0.2; + self.m_flNextPrimaryAttack = WeaponTimeBase() + 0.13; + + switch( WeaponADSMode ) + { + case INS2BASE::IRON_OUT: + { + self.SendWeaponAnim( (self.m_iClip > 0) ? IRON_TO : IRON_TO_EMPTY, 0, GetBodygroup() ); + EffectsFOVON( AIM_FOV ); + break; + } + case INS2BASE::IRON_IN: + { + self.SendWeaponAnim( (self.m_iClip > 0) ? IRON_FROM : IRON_FROM_EMPTY, 0, GetBodygroup() ); + EffectsFOVOFF(); + break; + } + } + } + + void ItemPreFrame() + { + if( m_reloadTimer < g_Engine.time && canReload ) + self.Reload(); + + BaseClass.ItemPreFrame(); + } + + void Reload() + { + if( self.m_iClip > 0 ) + ChangeFireMode( (WeaponADSMode == INS2BASE::IRON_IN) ? IRON_FIRESELECT : FIRESELECT, GetBodygroup(), INS2BASE::SELECTFIRE_AUTO, INS2BASE::SELECTFIRE_SEMI, (30.0/35.0) ); + else + ChangeFireMode( (WeaponADSMode == INS2BASE::IRON_IN) ? IRON_FIRESELECT_EMPTY : FIRESELECT_EMPTY, GetBodygroup(), INS2BASE::SELECTFIRE_AUTO, INS2BASE::SELECTFIRE_SEMI, (30.0/35.0) ); + + if( self.m_iClip == MAX_CLIP || m_pPlayer.m_rgAmmo( self.m_iPrimaryAmmoType ) <= 0 || m_pPlayer.pev.button & IN_USE != 0 ) + return; + + if( WeaponADSMode == INS2BASE::IRON_IN ) + { + self.SendWeaponAnim( (self.m_iClip > 0) ? IRON_FROM : IRON_FROM_EMPTY, 0, GetBodygroup() ); + m_reloadTimer = g_Engine.time + 0.16; + m_pPlayer.m_flNextAttack = 0.16; + canReload = true; + EffectsFOVOFF(); + } + + if( m_reloadTimer < g_Engine.time ) + { + if( self.m_iClip <= 0 ) + { + Reload( MAX_CLIP, RELOAD_EMPTY, (153.0/36.0), GetBodygroup() ); + } + else + { + Reload( MAX_CLIP, RELOAD, (140.0/36.0), GetBodygroup() ); + } + + canReload = false; + } + + BaseClass.Reload(); + } + + void WeaponIdle() + { + if( self.m_flNextPrimaryAttack < g_Engine.time ) + m_iShotsFired = 0; + + self.ResetEmptySound(); + m_pPlayer.GetAutoaimVector( AUTOAIM_10DEGREES ); + + if( self.m_flTimeWeaponIdle > WeaponTimeBase() ) + return; + + if( WeaponADSMode == INS2BASE::IRON_IN ) + self.SendWeaponAnim( (self.m_iClip > 0) ? IRON_IDLE : IRON_IDLE_EMPTY, 0, GetBodygroup() ); + else + self.SendWeaponAnim( (self.m_iClip > 0) ? IDLE : IDLE_EMPTY, 0, GetBodygroup() ); + + self.m_flTimeWeaponIdle = WeaponTimeBase() + g_PlayerFuncs.SharedRandomFloat( m_pPlayer.random_seed, 5, 7 ); + } +} + +class G36C_MAG : ScriptBasePlayerAmmoEntity, INS2BASE::AmmoBase +{ + void Spawn() + { + Precache(); + g_EntityFuncs.SetModel( self, A_MODEL ); + self.pev.body = MAG_BDYGRP; + BaseClass.Spawn(); + } + + void Precache() + { + g_Game.PrecacheModel( A_MODEL ); + CommonPrecache(); + } + + bool AddAmmo( CBaseEntity@ pOther ) + { + return CommonAddAmmo( pOther, MAX_CLIP, (INS2BASE::ShouldUseCustomAmmo) ? MAX_CARRY : INS2BASE::DF_MAX_CARRY_556, (INS2BASE::ShouldUseCustomAmmo) ? AMMO_TYPE : INS2BASE::DF_AMMO_556 ); + } +} + +string GetAmmoName() +{ + return "ammo_ins2g36c"; +} + +string GetName() +{ + return "weapon_ins2g36c"; +} + +void Register() +{ + INS2PROP::Register(); + g_CustomEntityFuncs.RegisterCustomEntity( "INS2_G36C::weapon_ins2g36c", GetName() ); // Register the weapon entity + g_CustomEntityFuncs.RegisterCustomEntity( "INS2_G36C::G36C_MAG", GetAmmoName() ); // Register the ammo entity + g_ItemRegistry.RegisterWeapon( GetName(), SPR_CAT, (INS2BASE::ShouldUseCustomAmmo) ? AMMO_TYPE : INS2BASE::DF_AMMO_556, "", GetAmmoName() ); // Register the weapon +} + +} \ No newline at end of file diff --git a/scripts/maps/ins2/carbn/weapon_ins2m1a1para.as b/scripts/maps/ins2/carbn/weapon_ins2m1a1para.as index 169bf55..e31d168 100644 --- a/scripts/maps/ins2/carbn/weapon_ins2m1a1para.as +++ b/scripts/maps/ins2/carbn/weapon_ins2m1a1para.as @@ -56,6 +56,7 @@ uint SLOT = 3; uint POSITION = 9; float RPM_AIR = 0.12f; //Rounds per minute in air float RPM_WTR = 0.22f; //Rounds per minute in water +uint AIM_FOV = 40; // Below 50 hides crosshair string AMMO_TYPE = "ins2_7.62x33mm"; class weapon_ins2m1a1para : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, INS2BASE::MeleeWeaponBase @@ -200,7 +201,7 @@ class weapon_ins2m1a1para : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, case INS2BASE::IRON_OUT: { self.SendWeaponAnim( IRON_TO, 0, GetBodygroup() ); - EffectsFOVON( 40 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/carbn/weapon_ins2m4a1.as b/scripts/maps/ins2/carbn/weapon_ins2m4a1.as index aebf709..bdabc7f 100644 --- a/scripts/maps/ins2/carbn/weapon_ins2m4a1.as +++ b/scripts/maps/ins2/carbn/weapon_ins2m4a1.as @@ -53,9 +53,10 @@ int WEIGHT = 20; int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY; uint DAMAGE = 22; uint SLOT = 3; -uint POSITION = 8; +uint POSITION = 7; float RPM_AIR = 750; //Rounds per minute in air float RPM_WTR = 600; //Rounds per minute in water +uint AIM_FOV = 40; // Below 50 hides crosshair string AMMO_TYPE = "ins2_5.56x45mm"; class weapon_ins2m4a1 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase @@ -211,7 +212,7 @@ class weapon_ins2m4a1 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase case INS2BASE::IRON_OUT: { self.SendWeaponAnim( IRON_TO, 0, GetBodygroup() ); - EffectsFOVON( 40 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/carbn/weapon_ins2mk18.as b/scripts/maps/ins2/carbn/weapon_ins2mk18.as index 3738832..f440e8b 100644 --- a/scripts/maps/ins2/carbn/weapon_ins2mk18.as +++ b/scripts/maps/ins2/carbn/weapon_ins2mk18.as @@ -69,6 +69,7 @@ uint SLOT = 3; uint POSITION = 5; float RPM_AIR = 775; //Rounds per minute in air float RPM_WTR = 700; //Rounds per minute in water +uint AIM_FOV = 37; // Below 50 hides crosshair string AMMO_TYPE = "ins2_5.56x45mm"; class weapon_ins2mk18 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase @@ -246,7 +247,7 @@ class weapon_ins2mk18 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase case INS2BASE::IRON_OUT: { self.SendWeaponAnim( IRON_TO, 0, GetBodygroup() ); - EffectsFOVON( 35 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/carbn/weapon_ins2sks.as b/scripts/maps/ins2/carbn/weapon_ins2sks.as index 06248a2..da0a2a7 100644 --- a/scripts/maps/ins2/carbn/weapon_ins2sks.as +++ b/scripts/maps/ins2/carbn/weapon_ins2sks.as @@ -62,6 +62,7 @@ uint SLOT = 3; uint POSITION = 10; float RPM_AIR = 0.135f; //Rounds per minute in air float RPM_WTR = 0.275f; //Rounds per minute in water +uint AIM_FOV = 40; // Below 50 hides crosshair string AMMO_TYPE = "ins2_7.62x39mm"; class weapon_ins2sks : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase @@ -200,7 +201,7 @@ class weapon_ins2sks : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase case INS2BASE::IRON_OUT: { self.SendWeaponAnim( (self.m_iClip > 0) ? IRON_TO : IRON_TO_EMPTY, 0, GetBodygroup() ); - EffectsFOVON( 40 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/explo/weapon_ins2at4.as b/scripts/maps/ins2/explo/weapon_ins2at4.as index 71b83e4..6bbdd94 100644 --- a/scripts/maps/ins2/explo/weapon_ins2at4.as +++ b/scripts/maps/ins2/explo/weapon_ins2at4.as @@ -52,7 +52,8 @@ int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_LIMITINWORLD | ITEM_FLAG_E uint DAMAGE = 230; float SPEED = 2000; uint SLOT = 4; -uint POSITION = 11; +uint POSITION = 10; +uint AIM_FOV = 35; // Below 50 hides crosshair string AMMO_TYPE = GetName(); string PROJ_NAME = "proj_ins2at4"; @@ -145,7 +146,7 @@ class weapon_ins2at4 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, INS2B if( m_WasDrawn == false ) { m_WasDrawn = true; - return Deploy( V_MODEL, P_MODEL, DRAW_FIRST, "rpg", GetBodygroup(), (104.0/31.0) ); + return Deploy( V_MODEL, P_MODEL, DRAW_FIRST, "rpg", GetBodygroup(), (105.0/31.0) ); } else return Deploy( V_MODEL, P_MODEL, DRAW, "rpg", GetBodygroup(), (29.0/30.0) ); @@ -205,7 +206,7 @@ class weapon_ins2at4 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, INS2B m_pPlayer.m_iWeaponVolume = NORMAL_GUN_VOLUME; m_pPlayer.m_iWeaponFlash = BRIGHT_GUN_FLASH; - INS2ROCKETPROJECTILE::CIns2Rocket@ pRocket = INS2ROCKETPROJECTILE::ShootRocket( m_pPlayer.pev, vecStart, vecVeloc, R_MODEL, DAMAGE, PROJ_NAME ); + auto pRocket = INS2ROCKETPROJECTILE::ShootRocket( m_pPlayer.pev, vecStart, vecVeloc, R_MODEL, DAMAGE, PROJ_NAME ); Math.MakeVectors( m_pPlayer.pev.v_angle ); pRocket.pev.angles = ang_Aim; @@ -219,14 +220,14 @@ class weapon_ins2at4 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, INS2B { self.PlayEmptySound(); self.SendWeaponAnim( (WeaponADSMode == INS2BASE::IRON_IN) ? IRON_DRYFIRE : DRYFIRE, 0, GetBodygroup() ); - self.m_flNextPrimaryAttack = WeaponTimeBase() + 0.7f; + self.m_flNextPrimaryAttack = WeaponTimeBase() + 0.7f; return; } self.m_flNextPrimaryAttack = self.m_flNextSecondaryAttack = WeaponTimeBase() + (30.0/30.0); self.m_flTimeWeaponIdle = WeaponTimeBase() + 1.0f; - SetThink( ThinkFunction( ShootThink ) ); + SetThink( ThinkFunction( this.ShootThink ) ); self.pev.nextthink = g_Engine.time + 0.25; if( WeaponADSMode == INS2BASE::IRON_IN ) @@ -245,7 +246,7 @@ class weapon_ins2at4 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, INS2B case INS2BASE::IRON_OUT: { self.SendWeaponAnim( IRON_TO, 0, GetBodygroup() ); - EffectsFOVON( 35 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: @@ -257,16 +258,6 @@ class weapon_ins2at4 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, INS2B } } - /*void InactiveItemPreFrame() - { - if( m_pPlayer.m_rgAmmo( self.m_iPrimaryAmmoType ) == 0 && self.m_iClip == 0 ) - { - - } - - BaseClass.InactiveItemPreFrame(); - }*/ - void ItemPreFrame() { if( m_reloadTimer < g_Engine.time && canReload ) @@ -292,7 +283,7 @@ class weapon_ins2at4 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, INS2B if( m_reloadTimer < g_Engine.time ) { Reload( MAX_CLIP, RELOAD, (146.0/30.0), GetBodygroup() ); - SetThink( ThinkFunction( EjectClipThink ) ); + SetThink( ThinkFunction( this.EjectClipThink ) ); self.pev.nextthink = g_Engine.time + (40.0/30.0); canReload = false; } @@ -334,4 +325,4 @@ void Register() g_ItemRegistry.RegisterWeapon( GetName(), SPR_CAT, AMMO_TYPE, "", AMMO_TYPE ); // Register the weapon } -} +} \ No newline at end of file diff --git a/scripts/maps/ins2/explo/weapon_ins2law.as b/scripts/maps/ins2/explo/weapon_ins2law.as index 403f28f..7173ec3 100644 --- a/scripts/maps/ins2/explo/weapon_ins2law.as +++ b/scripts/maps/ins2/explo/weapon_ins2law.as @@ -52,7 +52,8 @@ int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_LIMITINWORLD | ITEM_FLAG_E uint DAMAGE = 215; float SPEED = 2200; uint SLOT = 4; -uint POSITION = 10; +uint POSITION = 9; +uint AIM_FOV = 35; // Below 50 hides crosshair string AMMO_TYPE = GetName(); string PROJ_NAME = "proj_ins2law"; @@ -247,7 +248,7 @@ class weapon_ins2law : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, INS2B case INS2BASE::IRON_OUT: { self.SendWeaponAnim( IRON_TO, 0, GetBodygroup() ); - EffectsFOVON( 35 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: @@ -259,16 +260,6 @@ class weapon_ins2law : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, INS2B } } - /*void InactiveItemPreFrame() - { - if( m_pPlayer.m_rgAmmo( self.m_iPrimaryAmmoType ) == 0 && self.m_iClip == 0 ) - { - - } - - BaseClass.InactiveItemPreFrame(); - }*/ - void ItemPreFrame() { if( m_reloadTimer < g_Engine.time && canReload ) @@ -295,7 +286,7 @@ class weapon_ins2law : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, INS2B { Reload( MAX_CLIP, RELOAD, (153.0/35.0), GetBodygroup() ); SetThink( ThinkFunction( this.EjectClipThink ) ); - self.pev.nextthink = g_Engine.time + (27.0/35.0); + self.pev.nextthink = g_Engine.time + (26.0/35.0); canReload = false; } diff --git a/scripts/maps/ins2/explo/weapon_ins2m79.as b/scripts/maps/ins2/explo/weapon_ins2m79.as index 5d9bfd4..2854f14 100644 --- a/scripts/maps/ins2/explo/weapon_ins2m79.as +++ b/scripts/maps/ins2/explo/weapon_ins2m79.as @@ -82,6 +82,7 @@ uint DAMAGE = 175; uint DAMAGE_BS = 10; uint SLOT = 4; uint POSITION = 7; +uint AIM_FOV = 45; // Below 50 hides crosshair string AMMO_TYPE = "ins2_40x46mm"; string AMMO_TYPE2 = "ins2_40x46mmBS"; uint PELLETCOUNT = 27; //Yup @@ -287,7 +288,7 @@ class weapon_ins2m79 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, INS2B case INS2BASE::IRON_OUT: { self.SendWeaponAnim( (m_iAmmoMode == HIGH_EXPLOSIVE) ? IRON_TO : IRON_TO_BUCK, 0, GetBodygroup() ); - EffectsFOVON( 45 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/explo/weapon_ins2mk2.as b/scripts/maps/ins2/explo/weapon_ins2mk2.as index 29d9617..d550b38 100644 --- a/scripts/maps/ins2/explo/weapon_ins2mk2.as +++ b/scripts/maps/ins2/explo/weapon_ins2mk2.as @@ -43,7 +43,7 @@ int WEIGHT = 20; int FLAGS = ITEM_FLAG_LIMITINWORLD | ITEM_FLAG_EXHAUSTIBLE; uint DAMAGE = 160; uint SLOT = 4; -uint POSITION = 4; +uint POSITION = 5; string AMMO_TYPE = GetName(); float TIMER = 4.0; string PROJ_NAME = "proj_ins2mk2"; diff --git a/scripts/maps/ins2/explo/weapon_ins2pzfaust.as b/scripts/maps/ins2/explo/weapon_ins2pzfaust.as index d5687f8..46b32ec 100644 --- a/scripts/maps/ins2/explo/weapon_ins2pzfaust.as +++ b/scripts/maps/ins2/explo/weapon_ins2pzfaust.as @@ -58,7 +58,8 @@ int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_LIMITINWORLD | ITEM_FLAG_E uint DAMAGE = 200; float SPEED = 1700; uint SLOT = 4; -uint POSITION = 9; +uint POSITION = 8; +uint AIM_FOV = 35; // Below 50 hides crosshair string AMMO_TYPE = GetName(); string PROJ_NAME = "proj_ins2pzfaust"; @@ -247,7 +248,7 @@ class weapon_ins2pzfaust : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, I case INS2BASE::IRON_OUT: { self.SendWeaponAnim( (self.m_iClip > 0) ? IRON_TO : IRON_TO_EMPTY, 0, GetBodygroup() ); - EffectsFOVON( 35 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: @@ -284,8 +285,8 @@ class weapon_ins2pzfaust : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, I if( m_reloadTimer < g_Engine.time ) { Reload( MAX_CLIP, RELOAD, (130.0/35.0), GetBodygroup() ); - SetThink( ThinkFunction( EjectClipThink ) ); - self.pev.nextthink = g_Engine.time + 0.571; + SetThink( ThinkFunction( this.EjectClipThink ) ); + self.pev.nextthink = g_Engine.time + (20.0/35.0); canReload = false; } diff --git a/scripts/maps/ins2/explo/weapon_ins2pzschreck.as b/scripts/maps/ins2/explo/weapon_ins2pzschreck.as index d6690c6..e5fabfe 100644 --- a/scripts/maps/ins2/explo/weapon_ins2pzschreck.as +++ b/scripts/maps/ins2/explo/weapon_ins2pzschreck.as @@ -60,7 +60,8 @@ int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY; uint DAMAGE = 285; float SPEED = 1550; uint SLOT = 4; -uint POSITION = 15; +uint POSITION = 12; +uint AIM_FOV = 45; // Below 50 hides crosshair string AMMO_TYPE = "ins2_88mm_rocket"; string PROJ_NAME = "proj_ins2pzschreck"; @@ -208,7 +209,7 @@ class weapon_ins2pzschreck : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, case INS2BASE::IRON_OUT: { self.SendWeaponAnim( (self.m_iClip > 0) ? IRON_TO : IRON_TO_EMPTY, 0, GetBodygroup() ); - EffectsFOVON( 45 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/explo/weapon_ins2rgo.as b/scripts/maps/ins2/explo/weapon_ins2rgo.as new file mode 100644 index 0000000..9c446e2 --- /dev/null +++ b/scripts/maps/ins2/explo/weapon_ins2rgo.as @@ -0,0 +1,396 @@ +// Insurgency's RGO Grenade +/* Model Credits +/ Model: SAM61 +/ Textures: Norman The Loli Pirate +/ Animations: New World Interactive, D.N.I.O. 071 (Heavy Edits) +/ Sounds: New World Interactive +/ Sprites: D.N.I.O. 071 (Model Render), R4to0 (Vector), KernCore (.spr Compile) +/ Misc: Norman The Loli Pirate (World Model), D.N.I.O. 071 (Compile) +/ Script: KernCore +*/ + +#include "../base" +#include "../proj/proj_ins2grenade" + +namespace INS2_RGOGRENADE +{ + +// Animations +enum INS2_RGO_Animations +{ + IDLE = 0, + DRAW, + HOLSTER, + HIGH_PINPULL, + HIGH_THROW, + HIGH_PINPULL_BAKE, + HIGH_THROW_BAKE, + LOW_PINPULL, + LOW_THROW +}; + +// Models +string W_MODEL = "models/ins2/wpn/rgo/w_rgo.mdl"; +string V_MODEL = "models/ins2/wpn/rgo/v_rgo.mdl"; +string P_MODEL = "models/ins2/wpn/rgo/p_rgo.mdl"; +// Sprites +string SPR_CAT = "ins2/exp/"; //Weapon category used to get the sprite's location +// Information +int MAX_CARRY = 1000; +int MAX_CLIP = WEAPON_NOCLIP; +int DEFAULT_GIVE = 1; +int WEIGHT = 20; +int FLAGS = ITEM_FLAG_LIMITINWORLD | ITEM_FLAG_EXHAUSTIBLE; +uint DAMAGE = 150; +uint SLOT = 4; +uint POSITION = 6; +string AMMO_TYPE = GetName(); +float TIMER = 3.8; +float IMPACT_TIMER = 1.5; +string PROJ_NAME = "proj_ins2rgo"; + +class weapon_ins2rgo : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, INS2BASE::ExplosiveBase +{ + private CBasePlayer@ m_pPlayer + { + get const { return cast( self.m_hPlayer.GetEntity() ); } + set { self.m_hPlayer = EHandle( @value ); } + } + private int throwtype; + private bool m_bInAttack, m_bThrown; + private float m_fAttackStart = 0, m_fExplode = 0, m_flStartThrow = 0, m_flStartImpactTimer = 0; + private int GetBodygroup() + { + return 0; + } + private int GetThrowAnimation() + { + if( throwtype == 0 ) + return HIGH_THROW_BAKE; + else if( throwtype == 1 ) + return HIGH_THROW; + else + return LOW_THROW; + } + private array Sounds = { + "ins2/wpn/gren/pin.ogg", + "ins2/wpn/gren/spoon2.ogg", + "ins2/wpn/gren/throw.ogg" + }; + + void Spawn() + { + Precache(); + //self.KeyValue( "m_flCustomRespawnTime", 0.1 ); //fgsfds + self.pev.dmg = DAMAGE; + CommonSpawn( W_MODEL, DEFAULT_GIVE ); + } + + void Precache() + { + self.PrecacheCustomModels(); + g_Game.PrecacheModel( W_MODEL ); + g_Game.PrecacheModel( V_MODEL ); + g_Game.PrecacheModel( P_MODEL ); + + g_Game.PrecacheOther( PROJ_NAME ); + + INS2BASE::PrecacheSound( Sounds ); + INS2BASE::PrecacheSound( INS2BASE::DeployGrenadeSounds ); + INS2BASE::PrecacheSound( GrenadeExplode ); + INS2BASE::PrecacheSound( GrenadeWaterExplode ); + + g_Game.PrecacheGeneric( "sprites/" + SPR_CAT + "ammo_rgo.spr" ); + g_Game.PrecacheGeneric( "sprites/" + SPR_CAT + self.pev.classname + ".txt" ); + CommonPrecache(); + } + + bool GetItemInfo( ItemInfo& out info ) + { + info.iMaxAmmo1 = (INS2BASE::ShouldUseCustomAmmo) ? MAX_CARRY : INS2BASE::DF_MAX_CARRY_RKT2; + info.iAmmo1Drop = DEFAULT_GIVE; + info.iMaxAmmo2 = -1; + info.iAmmo2Drop = -1; + info.iMaxClip = MAX_CLIP; + info.iSlot = SLOT; + info.iPosition = POSITION; + info.iId = g_ItemRegistry.GetIdForName( self.pev.classname ); + info.iFlags = FLAGS; + info.iWeight = WEIGHT; + + return true; + } + + void Materialize() + { + BaseClass.Materialize(); + } + + // Better ammo extraction --- Anggara_nothing + bool CanHaveDuplicates() + { + return true; + } + + bool AddToPlayer( CBasePlayer@ pPlayer ) + { + //SetThink( null ); + return CommonAddToPlayer( pPlayer ); + } + + private int m_iAmmoSave; + bool Deploy() + { + PlayDeploySound( 1 ); + m_iAmmoSave = 0; // Zero out the ammo save + m_flStartImpactTimer = 0; + + return Deploy( V_MODEL, P_MODEL, DRAW, "gren", GetBodygroup(), (19.0/30.0) ); + } + + bool CanHolster() + { + if( m_fAttackStart != 0 ) + return false; + + return true; + } + + bool CanDeploy() + { + if( m_pPlayer.m_rgAmmo( self.m_iPrimaryAmmoType) == 0 ) + return false; + + return true; + } + + private CBasePlayerItem@ DropItem() + { + m_iAmmoSave = m_pPlayer.AmmoInventory( self.m_iPrimaryAmmoType ); //Save the player's ammo pool in case it has any in DropItem + + if( m_fExplode > 0 ) //just in case + m_fExplode = 0; + + return self; + } + + void Holster( int skipLocal = 0 ) + { + m_bThrown = false; + m_bInAttack = false; + m_fAttackStart = 0; + m_flStartImpactTimer = 0; + m_flStartThrow = 0; + + if( m_fExplode > 0 ) //player dies with the grenade cooked, ignores DropItem() + m_fExplode = 0; + + CommonHolster(); + + if( m_pPlayer.m_rgAmmo( self.m_iPrimaryAmmoType ) > 0 ) //Save the player's ammo pool in case it has any in Holster + { + m_iAmmoSave = m_pPlayer.m_rgAmmo( self.m_iPrimaryAmmoType ); + } + + if( m_iAmmoSave <= 0 ) + { + SetThink( ThinkFunction( DestroyThink ) ); + self.pev.nextthink = g_Engine.time + 0.1; + } + + BaseClass.Holster( skipLocal ); + } + + void PrimaryAttack() + { + if( m_pPlayer.m_rgAmmo( self.m_iPrimaryAmmoType ) <= 0 ) + return; + + if( m_fAttackStart > 0 ) + return; + + self.m_flNextPrimaryAttack = self.m_flNextTertiaryAttack = self.m_flNextSecondaryAttack = WeaponTimeBase() + (50.0/33.0); + throwtype = 0; + self.SendWeaponAnim( HIGH_PINPULL_BAKE, 0, GetBodygroup() ); + + m_bInAttack = true; + m_fAttackStart = g_Engine.time + (50.0/33.0); + m_flStartImpactTimer = g_Engine.time + (23.0/33.0); + m_fExplode = g_Engine.time + TIMER; + m_flStartThrow = g_Engine.time; + + self.m_flTimeWeaponIdle = g_Engine.time + (50.0/33.0) + (22.0/30.0); + } + + void SecondaryAttack() + { + if( m_pPlayer.m_rgAmmo( self.m_iPrimaryAmmoType ) <= 0 ) + return; + + if( m_fAttackStart > 0 ) + return; + + self.m_flNextSecondaryAttack = self.m_flNextTertiaryAttack = self.m_flNextPrimaryAttack = WeaponTimeBase() + (40.0/33.0); + throwtype = 1; + self.SendWeaponAnim( HIGH_PINPULL, 0, GetBodygroup() ); + + m_bInAttack = true; + m_fAttackStart = g_Engine.time + (40.0/33.0); + m_fExplode = 0; + + self.m_flTimeWeaponIdle = g_Engine.time + (40.0/33.0) + (22.0/30.0); + } + + void TertiaryAttack() + { + if( m_pPlayer.m_rgAmmo( self.m_iPrimaryAmmoType ) <= 0 ) + return; + + if( m_fAttackStart > 0 ) + return; + + self.m_flNextTertiaryAttack = self.m_flNextPrimaryAttack = self.m_flNextSecondaryAttack = WeaponTimeBase() + (40.0/33.0); + throwtype = 2; + self.SendWeaponAnim( LOW_PINPULL, 0, GetBodygroup() ); + + m_bInAttack = true; + m_fAttackStart = g_Engine.time + (40.0/33.0); + m_fExplode = 0; + + self.m_flTimeWeaponIdle = g_Engine.time + (40.0/33.0) + (25.0/30.0); + } + + void LaunchThink() + { + Vector angThrow = m_pPlayer.pev.v_angle + m_pPlayer.pev.punchangle; + + if ( angThrow.x < 0 ) + angThrow.x = -10 + angThrow.x * ( (90 - 10) / 90.0 ); + else + angThrow.x = -10 + angThrow.x * ( (90 + 10) / 90.0 ); + + float flVel = (90.0f - angThrow.x) * 6; + + if ( flVel > 750.0f ) + flVel = 750.0f; + + Math.MakeVectors( angThrow ); + float time = 0, time2 = 0; + + time = m_flStartThrow - g_Engine.time + TIMER; + time2 = m_flStartImpactTimer - g_Engine.time + IMPACT_TIMER; // This particular calculation is to account for the animation delay once the spoon leaves the grenade + + //g_Game.AlertMessage( at_console, "Impact Time: " + abs(time2) + "\n" ); + + if( time < 0 ) + time = 0; + + if( time2 <= 0 ) + { + //g_Game.AlertMessage( at_console, "Impact Time: " + abs(time2) + "\n" ); + time2 = 0; + } + + Vector vecSrc = (throwtype != 2) ? m_pPlayer.pev.origin + m_pPlayer.pev.view_ofs + g_Engine.v_forward * 16 : m_pPlayer.pev.origin + (m_pPlayer.pev.view_ofs * 0.65) + g_Engine.v_forward * 16; + Vector vecThrow = (throwtype != 2) ? g_Engine.v_forward * flVel + m_pPlayer.pev.velocity : (g_Engine.v_forward * flVel) * 0.70 + m_pPlayer.pev.velocity * 0.5; + INS2GRENADEPROJECTILE::TossTimedImpactGrenade( m_pPlayer.pev, vecSrc, vecThrow, (throwtype == 0) ? time : TIMER, (throwtype == 0) ? time2 : IMPACT_TIMER, DAMAGE, W_MODEL, PROJ_NAME ); + + m_pPlayer.m_rgAmmo( self.m_iPrimaryAmmoType, m_pPlayer.m_rgAmmo( self.m_iPrimaryAmmoType ) - 1 ); + m_fAttackStart = 0; + m_flStartImpactTimer = 0; + } + + void ItemPreFrame() + { + if( m_fAttackStart == 0 && m_bThrown == true && m_bInAttack == false && self.m_flTimeWeaponIdle - 0.1 < g_Engine.time ) + { + if( m_pPlayer.m_rgAmmo( self.m_iPrimaryAmmoType ) == 0 ) + { + self.Holster(); + } + else + { + self.Deploy(); + m_bThrown = false; + m_bInAttack = false; + m_fAttackStart = 0; + m_flStartThrow = 0; + } + } + + if( m_fExplode > 0 && g_Engine.time > m_fExplode ) + { + m_fExplode = 0; + Explode(); + } + + //g_Game.AlertMessage( at_console, "Impact Time: " + abs(m_flStartImpactTimer - g_Engine.time + IMPACT_TIMER) + "\n" ); + + if( !m_bInAttack || CheckButton() || g_Engine.time < m_fAttackStart ) + return; + + if( throwtype == 2 ) + self.m_flTimeWeaponIdle = self.m_flNextPrimaryAttack = self.m_flNextSecondaryAttack = self.m_flNextTertiaryAttack = WeaponTimeBase() + (25.0/32.0); + else + self.m_flTimeWeaponIdle = self.m_flNextPrimaryAttack = self.m_flNextSecondaryAttack = self.m_flNextTertiaryAttack = WeaponTimeBase() + (22.0/32.0); + + + + self.SendWeaponAnim( GetThrowAnimation(), 0, GetBodygroup() ); + m_bThrown = true; + m_bInAttack = false; + m_pPlayer.SetAnimation( PLAYER_ATTACK1 ); + m_fExplode = 0; + + SetThink( ThinkFunction( this.LaunchThink ) ); + self.pev.nextthink = g_Engine.time + 0.19; + + BaseClass.ItemPreFrame(); + } + + void Explode() + { + //if( (m_pPlayer.pev.button & IN_ATTACK) == 0 ) + // return; + + SelfExplode( m_pPlayer ); + SetThink( null ); + + m_bThrown = false; + m_bInAttack = false; + m_fAttackStart = 0; + m_flStartImpactTimer = 0; + m_flStartThrow = 0; + m_fExplode = 0; + + m_pPlayer.m_rgAmmo( self.m_iPrimaryAmmoType, m_pPlayer.m_rgAmmo( self.m_iPrimaryAmmoType ) - 1 ); + + if( m_pPlayer.m_rgAmmo( self.m_iPrimaryAmmoType ) == 0 ) + self.Holster(); + else + self.Deploy(); + } + + void WeaponIdle() + { + if( self.m_flTimeWeaponIdle > WeaponTimeBase() ) + return; + + self.SendWeaponAnim( IDLE, 0, GetBodygroup() ); + self.m_flTimeWeaponIdle = WeaponTimeBase() + g_PlayerFuncs.SharedRandomFloat( m_pPlayer.random_seed, 10, 15 ); + } +} + +string GetName() +{ + return "weapon_ins2rgo"; +} + +void Register() +{ + INS2GRENADEPROJECTILE::Register( PROJ_NAME ); + g_CustomEntityFuncs.RegisterCustomEntity( "INS2_RGOGRENADE::weapon_ins2rgo", GetName() ); // Register the weapon entity + g_ItemRegistry.RegisterWeapon( GetName(), SPR_CAT, AMMO_TYPE, "", AMMO_TYPE ); // Register the weapon +} + +} \ No newline at end of file diff --git a/scripts/maps/ins2/explo/weapon_ins2rpg7.as b/scripts/maps/ins2/explo/weapon_ins2rpg7.as index fbf1c56..7fc50c9 100644 --- a/scripts/maps/ins2/explo/weapon_ins2rpg7.as +++ b/scripts/maps/ins2/explo/weapon_ins2rpg7.as @@ -56,7 +56,8 @@ int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY; uint DAMAGE = 250; float SPEED = 1700; uint SLOT = 4; -uint POSITION = 13; +uint POSITION = 11; +uint AIM_FOV = 45; // Below 50 hides crosshair string AMMO_TYPE = "ins2_40mm_rocket"; string PROJ_NAME = "proj_ins2rpg7"; @@ -209,7 +210,7 @@ class weapon_ins2rpg7 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, INS2 case INS2BASE::IRON_OUT: { self.SendWeaponAnim( (self.m_iClip > 0) ? IRON_TO : IRON_TO_EMPTY, 0, GetBodygroup() ); - EffectsFOVON( 45 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/explo/weapon_ins2stick.as b/scripts/maps/ins2/explo/weapon_ins2stick.as index 7a18a78..2443aa7 100644 --- a/scripts/maps/ins2/explo/weapon_ins2stick.as +++ b/scripts/maps/ins2/explo/weapon_ins2stick.as @@ -43,7 +43,7 @@ int WEIGHT = 20; int FLAGS = ITEM_FLAG_LIMITINWORLD | ITEM_FLAG_EXHAUSTIBLE; uint DAMAGE = 162; uint SLOT = 4; -uint POSITION = 5; +uint POSITION = 4; string AMMO_TYPE = GetName(); float TIMER = 4.5; string PROJ_NAME = "proj_ins2stick"; diff --git a/scripts/maps/ins2/handg/weapon_ins2beretta.as b/scripts/maps/ins2/handg/weapon_ins2beretta.as index 3c49028..6776114 100644 --- a/scripts/maps/ins2/handg/weapon_ins2beretta.as +++ b/scripts/maps/ins2/handg/weapon_ins2beretta.as @@ -63,9 +63,10 @@ int WEIGHT = 20; int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY; uint DAMAGE = 17; uint SLOT = 1; -uint POSITION = 7; +uint POSITION = 6; float RPM_AIR = 0.135f; //Rounds per minute in air float RPM_WTR = 0.25f; //Rounds per minute in water +uint AIM_FOV = 49; // Below 50 hides crosshair string AMMO_TYPE = "ins2_9x19mm"; class weapon_ins2beretta : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase @@ -203,7 +204,7 @@ class weapon_ins2beretta : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase case INS2BASE::IRON_OUT: { self.SendWeaponAnim( (self.m_iClip > 0) ? IRON_TO : IRON_TO_EMPTY, 0, GetBodygroup() ); - EffectsFOVON( 49 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/handg/weapon_ins2c96.as b/scripts/maps/ins2/handg/weapon_ins2c96.as index 19fd986..8bb9876 100644 --- a/scripts/maps/ins2/handg/weapon_ins2c96.as +++ b/scripts/maps/ins2/handg/weapon_ins2c96.as @@ -68,9 +68,10 @@ int WEIGHT = 20; int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY; uint DAMAGE = 30; uint SLOT = 1; -uint POSITION = 11; +uint POSITION = 9; float RPM_AIR = 0.135f; //Rounds per minute in air float RPM_WTR = 0.3f; //Rounds per minute in water +uint AIM_FOV = 49; // Below 50 hides crosshair string AMMO_TYPE = "ins2_7.63x25mm"; class weapon_ins2c96 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase @@ -242,7 +243,7 @@ class weapon_ins2c96 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase case INS2BASE::IRON_OUT: { self.SendWeaponAnim( (self.m_iClip > 0) ? IRON_TO : IRON_TO_EMPTY, 0, GetBodygroup() ); - EffectsFOVON( 49 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/handg/weapon_ins2deagle.as b/scripts/maps/ins2/handg/weapon_ins2deagle.as index 7f7485e..e94acfd 100644 --- a/scripts/maps/ins2/handg/weapon_ins2deagle.as +++ b/scripts/maps/ins2/handg/weapon_ins2deagle.as @@ -59,9 +59,10 @@ int WEIGHT = 20; int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY; uint DAMAGE = 45; uint SLOT = 1; -uint POSITION = 12; +uint POSITION = 10; float RPM_AIR = 0.155f; //Rounds per minute in air float RPM_WTR = 0.255f; //Rounds per minute in water +uint AIM_FOV = 49; // Below 50 hides crosshair string AMMO_TYPE = "ins2_50ae"; class weapon_ins2deagle : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase @@ -199,7 +200,7 @@ class weapon_ins2deagle : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase case INS2BASE::IRON_OUT: { self.SendWeaponAnim( (self.m_iClip > 0) ? IRON_TO : IRON_TO_EMPTY, 0, GetBodygroup() ); - EffectsFOVON( 49 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/handg/weapon_ins2glock17.as b/scripts/maps/ins2/handg/weapon_ins2glock17.as index 6bb494d..7603790 100644 --- a/scripts/maps/ins2/handg/weapon_ins2glock17.as +++ b/scripts/maps/ins2/handg/weapon_ins2glock17.as @@ -65,9 +65,10 @@ int WEIGHT = 20; int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY; uint DAMAGE = 17; uint SLOT = 1; -uint POSITION = 9; +uint POSITION = 8; float RPM_AIR = 0.125f; //Rounds per minute in air float RPM_WTR = 0.20f; //Rounds per minute in water +uint AIM_FOV = 49; // Below 50 hides crosshair string AMMO_TYPE = "ins2_9x19mm"; class weapon_ins2glock17 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase @@ -204,7 +205,7 @@ class weapon_ins2glock17 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase case INS2BASE::IRON_OUT: { self.SendWeaponAnim( (self.m_iClip > 0) ? IRON_TO : IRON_TO_EMPTY, 0, GetBodygroup() ); - EffectsFOVON( 49 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/handg/weapon_ins2m1911.as b/scripts/maps/ins2/handg/weapon_ins2m1911.as index 6d6bb2d..7a7daa5 100644 --- a/scripts/maps/ins2/handg/weapon_ins2m1911.as +++ b/scripts/maps/ins2/handg/weapon_ins2m1911.as @@ -64,9 +64,10 @@ int WEIGHT = 20; int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY; uint DAMAGE = 22; uint SLOT = 1; -uint POSITION = 6; +uint POSITION = 5; float RPM_AIR = 0.165f; //Rounds per minute in air float RPM_WTR = 0.265f; //Rounds per minute in water +uint AIM_FOV = 49; // Below 50 hides crosshair string AMMO_TYPE = "ins2_45acp"; class weapon_ins2m1911 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase @@ -203,7 +204,7 @@ class weapon_ins2m1911 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase case INS2BASE::IRON_OUT: { self.SendWeaponAnim( (self.m_iClip > 0) ? IRON_TO : IRON_TO_EMPTY, 0, GetBodygroup() ); - EffectsFOVON( 49 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/handg/weapon_ins2m29.as b/scripts/maps/ins2/handg/weapon_ins2m29.as index ddae65e..6d2e3be 100644 --- a/scripts/maps/ins2/handg/weapon_ins2m29.as +++ b/scripts/maps/ins2/handg/weapon_ins2m29.as @@ -83,10 +83,11 @@ int WEIGHT = 20; int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY; uint DAMAGE = 55; uint SLOT = 1; -uint POSITION = 15; +uint POSITION = 14; float RPM_AIR = 1.0f; //Rounds per minute in air float SHOOT_DELAY = 0.028; //Shooting delay float EMPTY_DELAY = 0.1; //Shooting delay for dryfire +uint AIM_FOV = 49; // Below 50 hides crosshair string AMMO_TYPE = "ins2_44magnum"; class weapon_ins2m29 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase @@ -290,7 +291,7 @@ class weapon_ins2m29 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase case INS2BASE::IRON_OUT: { self.SendWeaponAnim( (self.m_iClip > 0) ? IRON_TO : IRON_TO_EMPTY, 0, GetBodygroup() ); - EffectsFOVON( 49 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/handg/weapon_ins2makarov.as b/scripts/maps/ins2/handg/weapon_ins2makarov.as index 5080464..5e2f7b5 100644 --- a/scripts/maps/ins2/handg/weapon_ins2makarov.as +++ b/scripts/maps/ins2/handg/weapon_ins2makarov.as @@ -76,6 +76,7 @@ uint SLOT = 1; uint POSITION = 4; float RPM_AIR = 0.1f; //Rounds per minute in air float RPM_WTR = 0.2f; //Rounds per minute in water +uint AIM_FOV = 49; // Below 50 hides crosshair string AMMO_TYPE = "ins2_9x18mm"; class weapon_ins2makarov : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase @@ -253,7 +254,7 @@ class weapon_ins2makarov : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase case INS2BASE::IRON_OUT: { self.SendWeaponAnim( (self.m_iClip > 0) ? IRON_TO : IRON_TO_EMPTY, 0, GetBodygroup() ); - EffectsFOVON( 49 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/handg/weapon_ins2python.as b/scripts/maps/ins2/handg/weapon_ins2python.as index 95ec7b0..6437ba9 100644 --- a/scripts/maps/ins2/handg/weapon_ins2python.as +++ b/scripts/maps/ins2/handg/weapon_ins2python.as @@ -63,11 +63,12 @@ int WEIGHT = 20; int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY; uint DAMAGE = 45; uint SLOT = 1; -uint POSITION = 14; +uint POSITION = 13; float RPM_AIR = 0.15f; //Rounds per minute in air float RPM_WTR = 0.22f; //Rounds per minute in water float SHOOT_DELAY = 0.1; //Shooting delay float EMPTY_DELAY = 0.13; //Shooting delay for dryfire +uint AIM_FOV = 49; // Below 50 hides crosshair string AMMO_TYPE = "ins2_357magnum"; class weapon_ins2python : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase @@ -250,7 +251,7 @@ class weapon_ins2python : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase case INS2BASE::IRON_OUT: { self.SendWeaponAnim( IRON_TO, 0, GetBodygroup() ); - EffectsFOVON( 49 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/handg/weapon_ins2usp.as b/scripts/maps/ins2/handg/weapon_ins2usp.as index 59538f2..d0261a9 100644 --- a/scripts/maps/ins2/handg/weapon_ins2usp.as +++ b/scripts/maps/ins2/handg/weapon_ins2usp.as @@ -60,9 +60,10 @@ int WEIGHT = 20; int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY; uint DAMAGE = 22; uint SLOT = 1; -uint POSITION = 8; +uint POSITION = 7; float RPM_AIR = 0.135f; //Rounds per minute in air float RPM_WTR = 0.25f; //Rounds per minute in water +uint AIM_FOV = 49; // Below 50 hides crosshair string AMMO_TYPE = "ins2_45acp"; class weapon_ins2usp : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase @@ -199,7 +200,7 @@ class weapon_ins2usp : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase case INS2BASE::IRON_OUT: { self.SendWeaponAnim( (self.m_iClip > 0) ? IRON_TO : IRON_TO_EMPTY, 0, GetBodygroup() ); - EffectsFOVON( 49 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/handg/weapon_ins2vp70.as b/scripts/maps/ins2/handg/weapon_ins2vp70.as new file mode 100644 index 0000000..fb12b71 --- /dev/null +++ b/scripts/maps/ins2/handg/weapon_ins2vp70.as @@ -0,0 +1,375 @@ +// Insurgency's H&K VP-70M +/* Model Credits +/ Model: fallschirmjager, the_tub +/ Textures: the_tub +/ Animations: D.N.I.O. 071 +/ Sounds: Magmacow, Navaro, D.N.I.O. 071 (Conversion to .ogg format) +/ Sprites: D.N.I.O. 071 (Model Render, Vector), KernCore (.spr Compile) +/ Misc: Norman The Loli Pirate (World Model), D.N.I.O. 071 (World Model UVs, Compile), KernCore (World Model UVs) +/ Script: KernCore +*/ + +#include "../base" + +namespace INS2_VP70 +{ + +// Animations +enum INS2_VP70_Animations +{ + IDLE = 0, + DRAW_FIRST, + DRAW, + HOLSTER, + FIRE1, + FIRE2, + FIRE3, + DRYFIRE, + FIRESELECT, + RELOAD, + RELOAD_EMPTY, + IRON_IDLE, + IRON_FIRE1, + IRON_FIRE2, + IRON_FIRE3, + IRON_DRYFIRE, + IRON_FIRESELECT, + IRON_TO, + IRON_FROM +}; + +// Models +string W_MODEL = "models/ins2/wpn/vp70/w_vp70.mdl"; +string V_MODEL = "models/ins2/wpn/vp70/v_vp70.mdl"; +string P_MODEL = "models/ins2/wpn/vp70/p_vp70.mdl"; +string A_MODEL = "models/ins2/ammo/mags2.mdl"; +int MAG_BDYGRP = 3; +// Sprites +string SPR_CAT = "ins2/hdg/"; //Weapon category used to get the sprite's location +// Sounds +string SHOOT_S = "ins2/wpn/vp70/shoot.ogg"; +// Information +int MAX_CARRY = 1000; +int MAX_CLIP = 18; +int DEFAULT_GIVE = MAX_CLIP * 4; +int WEIGHT = 20; +int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY; +uint DAMAGE = 17; +uint SLOT = 1; +uint POSITION = 11; +float RPM_AIR = 1400; //Rounds per minute in air +float RPM_WTR = 1150; //Rounds per minute in water +uint AIM_FOV = 49; // Below 50 hides crosshair +string AMMO_TYPE = "ins2_9x19mm"; + +class weapon_ins2vp70 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase +{ + private CBasePlayer@ m_pPlayer + { + get const { return cast( self.m_hPlayer.GetEntity() ); } + set { self.m_hPlayer = EHandle( @value ); } + } + private int m_iShell; + private bool m_WasDrawn; + private int m_iBurstCount = 0, m_iBurstLeft = 0; + private float m_flNextBurstFireTime = 0; + private int GetBodygroup() + { + return 0; + } + private array Sounds = { + "ins2/wpn/vp70/magin.ogg", + "ins2/wpn/vp70/magout.ogg", + "ins2/wpn/vp70/sldbk.ogg", + "ins2/wpn/vp70/sldrel.ogg", + "ins2/wpn/vp70/rof.ogg", + SHOOT_S + }; + + void Spawn() + { + Precache(); + WeaponSelectFireMode = INS2BASE::SELECTFIRE_3XBURST; + m_WasDrawn = false; + CommonSpawn( W_MODEL, DEFAULT_GIVE ); + } + + void Precache() + { + self.PrecacheCustomModels(); + g_Game.PrecacheModel( W_MODEL ); + g_Game.PrecacheModel( V_MODEL ); + g_Game.PrecacheModel( P_MODEL ); + g_Game.PrecacheModel( A_MODEL ); + m_iShell = g_Game.PrecacheModel( INS2BASE::BULLET_9x19 ); + + g_Game.PrecacheOther( GetAmmoName() ); + + INS2BASE::PrecacheSound( Sounds ); + INS2BASE::PrecacheSound( INS2BASE::DeployPistolSounds ); + + g_Game.PrecacheGeneric( "sprites/" + SPR_CAT + self.pev.classname + ".txt" ); + CommonPrecache(); + } + + bool GetItemInfo( ItemInfo& out info ) + { + info.iMaxAmmo1 = (INS2BASE::ShouldUseCustomAmmo) ? MAX_CARRY : INS2BASE::DF_MAX_CARRY_9MM; + info.iAmmo1Drop = MAX_CLIP; + info.iMaxAmmo2 = -1; + info.iAmmo2Drop = -1; + info.iMaxClip = MAX_CLIP; + info.iSlot = SLOT; + info.iPosition = POSITION; + info.iId = g_ItemRegistry.GetIdForName( self.pev.classname ); + info.iFlags = FLAGS; + info.iWeight = WEIGHT; + + return true; + } + + bool AddToPlayer( CBasePlayer@ pPlayer ) + { + return CommonAddToPlayer( pPlayer ); + } + + bool PlayEmptySound() + { + return CommonPlayEmptySound(); + } + + bool Deploy() + { + PlayDeploySound( 2 ); + DisplayFiremodeSprite(); + if( m_WasDrawn == false ) + { + m_WasDrawn = true; + return Deploy( V_MODEL, P_MODEL, DRAW_FIRST, "onehanded", GetBodygroup(), (70.0/30.0) ); + } + else + return Deploy( V_MODEL, P_MODEL, DRAW, "onehanded", GetBodygroup(), (30.0/36.0) ); + } + + void Holster( int skipLocal = 0 ) + { + m_iBurstLeft = 0; + CommonHolster(); + + BaseClass.Holster( skipLocal ); + } + + private void FirstAttackCommon() + { + ShootWeapon( SHOOT_S, 1, VecModAcc( VECTOR_CONE_1DEGREES, 2.0f, 0.7f, 1.5f ), (m_pPlayer.pev.waterlevel == WATERLEVEL_HEAD) ? 1024 : 8192, DAMAGE ); + + m_pPlayer.m_iWeaponVolume = NORMAL_GUN_VOLUME; + m_pPlayer.m_iWeaponFlash = BRIGHT_GUN_FLASH; + + if( WeaponADSMode != INS2BASE::IRON_IN ) + { + if( !( m_pPlayer.pev.flags & FL_ONGROUND != 0 ) ) + KickBack( 0.95, 0.5, 0.25, 0.03, 3.5, 2.5, 5 ); + else if( m_pPlayer.pev.velocity.Length2D() > 0 ) + KickBack( 0.75, 0.35, 0.225, 0.03, 3.5, 2.5, 7 ); + else if( m_pPlayer.pev.flags & FL_DUCKING != 0 ) + KickBack( 0.55, 0.2, 0.15, 0.02, 2.25, 1.25, 10 ); + else + KickBack( 0.6, 0.3, 0.2, 0.0225, 2.5, 1.5, 8 ); + } + else + { + PunchAngle( Vector( Math.RandomFloat( -1.875, -2.475 ), (Math.RandomLong( 0, 1 ) < 0.5) ? -0.75f : 0.6f, Math.RandomFloat( -0.5, 0.5 ) ) ); + } + + if( WeaponADSMode == INS2BASE::IRON_IN ) + self.SendWeaponAnim( Math.RandomLong( IRON_FIRE1, IRON_FIRE3 ), 0, GetBodygroup() ); + else + self.SendWeaponAnim( Math.RandomLong( FIRE1, FIRE3 ), 0, GetBodygroup() ); + + ShellEject( m_pPlayer, m_iShell, (WeaponADSMode != INS2BASE::IRON_IN) ? Vector( 22, 7, -7.5 ) : Vector( 22, 1.1, -2 ) ); + } + + void PrimaryAttack() + { + if( self.m_iClip <= 0 ) + { + self.PlayEmptySound(); + self.SendWeaponAnim( (WeaponADSMode == INS2BASE::IRON_IN) ? IRON_DRYFIRE : DRYFIRE, 0, GetBodygroup() ); + self.m_flNextPrimaryAttack = WeaponTimeBase() + 0.3f; + return; + } + + self.m_flNextPrimaryAttack = self.m_flNextSecondaryAttack = WeaponTimeBase() + 0.1f; + + if( WeaponSelectFireMode == INS2BASE::SELECTFIRE_SEMI && m_pPlayer.m_afButtonPressed & IN_ATTACK == 0 ) + { + if( m_pPlayer.pev.waterlevel == WATERLEVEL_HEAD ) + self.m_flNextPrimaryAttack = self.m_flNextSecondaryAttack = WeaponTimeBase() + 0.2f; + else + self.m_flNextPrimaryAttack = self.m_flNextSecondaryAttack = WeaponTimeBase() + 0.125f; + + return; + } + else if( WeaponSelectFireMode == INS2BASE::SELECTFIRE_3XBURST ) + { + //Fire at most 3 bullets. + m_iBurstCount = Math.min( 3, self.m_iClip ); + m_iBurstLeft = m_iBurstCount - 1; + + m_flNextBurstFireTime = (m_pPlayer.pev.waterlevel == WATERLEVEL_HEAD) ? WeaponTimeBase() + GetFireRate( RPM_WTR ) : WeaponTimeBase() + GetFireRate( RPM_AIR ); + //Prevent primary attack before burst finishes. Might need to be finetuned. + self.m_flNextPrimaryAttack = self.m_flNextSecondaryAttack = WeaponTimeBase() + 0.425; + } + + self.m_flTimeWeaponIdle = WeaponTimeBase() + 1.0f; + FirstAttackCommon(); + } + + void ItemPostFrame() + { + if( WeaponSelectFireMode == INS2BASE::SELECTFIRE_3XBURST ) + { + if( m_iBurstLeft > 0 ) + { + if( m_flNextBurstFireTime < WeaponTimeBase() ) + { + if( self.m_iClip <= 0 ) + { + m_iBurstLeft = 0; + return; + } + else + --m_iBurstLeft; + + FirstAttackCommon(); + + if( m_iBurstLeft > 0 ) + m_flNextBurstFireTime = (m_pPlayer.pev.waterlevel == WATERLEVEL_HEAD) ? WeaponTimeBase() + GetFireRate( RPM_WTR ) : WeaponTimeBase() + GetFireRate( RPM_AIR ); + else + m_flNextBurstFireTime = 0; + } + + //While firing a burst, don't allow reload or any other weapon actions. Might be best to let some things run though. + return; + } + } + + BaseClass.ItemPostFrame(); + } + + void SecondaryAttack() + { + self.m_flTimeWeaponIdle = self.m_flNextSecondaryAttack = WeaponTimeBase() + 0.2; + self.m_flNextPrimaryAttack = WeaponTimeBase() + 0.13; + + switch( WeaponADSMode ) + { + case INS2BASE::IRON_OUT: + { + self.SendWeaponAnim( IRON_TO, 0, GetBodygroup() ); + EffectsFOVON( AIM_FOV ); + break; + } + case INS2BASE::IRON_IN: + { + self.SendWeaponAnim( IRON_FROM, 0, GetBodygroup() ); + EffectsFOVOFF(); + break; + } + } + } + + void ItemPreFrame() + { + if( m_reloadTimer < g_Engine.time && canReload ) + self.Reload(); + + BaseClass.ItemPreFrame(); + } + + void Reload() + { + ChangeFireMode( (WeaponADSMode == INS2BASE::IRON_IN) ? IRON_FIRESELECT : FIRESELECT, GetBodygroup(), INS2BASE::SELECTFIRE_SEMI, INS2BASE::SELECTFIRE_3XBURST, (40.0/35.0) ); + + if( self.m_iClip == MAX_CLIP || m_pPlayer.m_rgAmmo( self.m_iPrimaryAmmoType ) <= 0 || m_pPlayer.pev.button & IN_USE != 0 ) + return; + + if( WeaponADSMode == INS2BASE::IRON_IN ) + { + self.SendWeaponAnim( IRON_FROM, 0, GetBodygroup() ); + m_reloadTimer = g_Engine.time + 0.16; + m_pPlayer.m_flNextAttack = 0.16; + canReload = true; + EffectsFOVOFF(); + } + + if( m_reloadTimer < g_Engine.time ) + { + (self.m_iClip == 0) ? Reload( MAX_CLIP, RELOAD_EMPTY, (140.0/31.0), GetBodygroup() ) : Reload( MAX_CLIP, RELOAD, (92.0/31.0), GetBodygroup() ); + canReload = false; + } + + BaseClass.Reload(); + } + + void WeaponIdle() + { + if( self.m_flNextPrimaryAttack < g_Engine.time ) + m_iShotsFired = 0; + + self.ResetEmptySound(); + m_pPlayer.GetAutoaimVector( AUTOAIM_10DEGREES ); + + if( self.m_flTimeWeaponIdle > WeaponTimeBase() ) + return; + + if( WeaponADSMode == INS2BASE::IRON_IN ) + self.SendWeaponAnim( IRON_IDLE, 0, GetBodygroup() ); + else + self.SendWeaponAnim( IDLE, 0, GetBodygroup() ); + + self.m_flTimeWeaponIdle = WeaponTimeBase() + g_PlayerFuncs.SharedRandomFloat( m_pPlayer.random_seed, 5, 7 ); + } +} + +class VP70_MAG : ScriptBasePlayerAmmoEntity, INS2BASE::AmmoBase +{ + void Spawn() + { + Precache(); + g_EntityFuncs.SetModel( self, A_MODEL ); + self.pev.body = MAG_BDYGRP; + BaseClass.Spawn(); + } + + void Precache() + { + g_Game.PrecacheModel( A_MODEL ); + CommonPrecache(); + } + + bool AddAmmo( CBaseEntity@ pOther ) + { + return CommonAddAmmo( pOther, MAX_CLIP, (INS2BASE::ShouldUseCustomAmmo) ? MAX_CARRY : INS2BASE::DF_MAX_CARRY_9MM, (INS2BASE::ShouldUseCustomAmmo) ? AMMO_TYPE : INS2BASE::DF_AMMO_9MM ); + } +} + +string GetAmmoName() +{ + return "ammo_ins2vp70"; +} + +string GetName() +{ + return "weapon_ins2vp70"; +} + +void Register() +{ + g_CustomEntityFuncs.RegisterCustomEntity( "INS2_VP70::weapon_ins2vp70", GetName() ); // Register the weapon entity + g_CustomEntityFuncs.RegisterCustomEntity( "INS2_VP70::VP70_MAG", GetAmmoName() ); // Register the ammo entity + g_ItemRegistry.RegisterWeapon( GetName(), SPR_CAT, (INS2BASE::ShouldUseCustomAmmo) ? AMMO_TYPE : INS2BASE::DF_AMMO_9MM, "", GetAmmoName() ); // Register the weapon +} + +} \ No newline at end of file diff --git a/scripts/maps/ins2/handg/weapon_ins2webley.as b/scripts/maps/ins2/handg/weapon_ins2webley.as index 7ca1807..1606725 100644 --- a/scripts/maps/ins2/handg/weapon_ins2webley.as +++ b/scripts/maps/ins2/handg/weapon_ins2webley.as @@ -62,11 +62,12 @@ int WEIGHT = 20; int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY; uint DAMAGE = 38; uint SLOT = 1; -uint POSITION = 13; +uint POSITION = 12; float RPM_AIR = 0.16f; //Rounds per minute in air float RPM_WTR = 0.19f; //Rounds per minute in water float SHOOT_DELAY = 0.06; //Shooting delay float EMPTY_DELAY = 0.1; //Shooting delay for dryfire +uint AIM_FOV = 49; // Below 50 hides crosshair string AMMO_TYPE = "ins2_455brit"; class weapon_ins2webley : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase @@ -251,7 +252,7 @@ class weapon_ins2webley : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase case INS2BASE::IRON_OUT: { self.SendWeaponAnim( IRON_TO, 0, GetBodygroup() ); - EffectsFOVON( 49 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/ins2_register.as b/scripts/maps/ins2/ins2_register.as index fc277b7..01c06d4 100644 --- a/scripts/maps/ins2/ins2_register.as +++ b/scripts/maps/ins2/ins2_register.as @@ -10,6 +10,12 @@ void PluginInit() g_Module.ScriptInfo.SetAuthor( "D.N.I.O. 071/Norman The Loli Pirate/R4to0/D.G.F./KernCore" ); g_Module.ScriptInfo.SetContactInfo( "https://discord.gg/0wtJ6aAd7XOGI6vI" ); + /** + * This section below is reserved for when you register the addon as a plugin + * Changing weapons positions in the hud so they don't interfere with + * Map script weapons (which should be using positions 4 to 8). + */ + //First slot (slot 0) - Melees & Utility INS2_KNUCKLES::POSITION = 9; INS2_KABAR::POSITION = 10; @@ -27,11 +33,11 @@ void PluginInit() INS2_GLOCK17::POSITION = 13; INS2_C96::POSITION = 14; INS2_DEAGLE::POSITION = 15; - INS2_WEBLEY::POSITION = 16; - INS2_PYTHON::POSITION = 17; - INS2_M29::POSITION = 18; + INS2_VP70::POSITION = 16; + INS2_WEBLEY::POSITION = 17; + INS2_PYTHON::POSITION = 18; + INS2_M29::POSITION = 19; /* - H&K VP70 19 Stechkin APS 20 Luger P08 21 Mateba Model 6 Unica 22 @@ -40,37 +46,37 @@ void PluginInit() */ //Third slot (slot 2) - Submachine Guns INS2_UMP45::POSITION = 9; - INS2_MP5K::POSITION = 10; - INS2_MP18::POSITION = 11; - INS2_MP40::POSITION = 12; - INS2_STERLING::POSITION = 13; - INS2_PPSH41::POSITION = 14; - INS2_M1928::POSITION = 15; - INS2_MP7::POSITION = 16; + INS2_GREASEGUN::POSITION = 10; + INS2_MP5K::POSITION = 11; + INS2_MP18::POSITION = 12; + INS2_MP40::POSITION = 13; + INS2_MP5SD::POSITION = 14; + INS2_STERLING::POSITION = 15; + INS2_M1928::POSITION = 16; + INS2_PPSH41::POSITION = 17; + INS2_MP7::POSITION = 18; /* - M3 Greasegun 17 Mac10 18 Uzi 19 FMG-9 20 PP-Bizon 21 Kriss Vector 22 Sten Mk. IIS 23 - MP5SD 24 */ //Fourth slot (slot 3) - Carbines & Shotguns INS2_C96CARBINE::POSITION = 9; INS2_MK18::POSITION = 10; INS2_AKS74U::POSITION = 11; INS2_M4A1::POSITION = 12; - INS2_M1A1PARA::POSITION = 13; - INS2_SKS::POSITION = 14; - INS2_ITHACA::POSITION = 15; - INS2_M590::POSITION = 16; - INS2_COACH::POSITION = 17; - INS2_M1014::POSITION = 18; - INS2_SAIGA12::POSITION = 19; + INS2_G36C::POSITION = 13; + INS2_M1A1PARA::POSITION = 14; + INS2_SKS::POSITION = 15; + INS2_ITHACA::POSITION = 16; + INS2_M590::POSITION = 17; + INS2_COACH::POSITION = 18; + INS2_M1014::POSITION = 19; + INS2_SAIGA12::POSITION = 20; /* - G36C 20 Winchester M1897 21 Winchester M1887 22 MTs-255 Revolver Shotgun 23 @@ -79,17 +85,17 @@ void PluginInit() //Fifth slot (slot 4) - Explosives & Launchers INS2_M24GRENADE::POSITION = 9; INS2_MK2GRENADE::POSITION = 10; - INS2_M79::POSITION = 11; - INS2_PZFAUST::POSITION = 12; - INS2_LAW::POSITION = 13; - INS2_AT4::POSITION = 14; - INS2_RPG7::POSITION = 15; - INS2_PZSCHRECK::POSITION = 16; + INS2_RGOGRENADE::POSITION = 11; + INS2_M79::POSITION = 12; + INS2_PZFAUST::POSITION = 13; + INS2_LAW::POSITION = 14; + INS2_AT4::POSITION = 15; + INS2_RPG7::POSITION = 16; + INS2_PZSCHRECK::POSITION = 17; /* C4 Explosive Device 17 China Lake 18 No. 69 Grenade 19 - RGO Grenade 20 TNT Charge 21 PIAT 22 M1A1 Bazooka 23 @@ -102,57 +108,58 @@ void PluginInit() INS2_AK12::POSITION = 12; INS2_AK74::POSITION = 13; INS2_GALIL::POSITION = 14; - INS2_M16A4::POSITION = 15; - INS2_L85A2::POSITION = 16; - INS2_AKM::POSITION = 17; + INS2_AN94::POSITION = 15; + INS2_M16A1::POSITION = 16; + INS2_GROZA::POSITION = 17; + INS2_M16A4::POSITION = 18; + INS2_L85A2::POSITION = 19; + INS2_AKM::POSITION = 20; /* Steyr AUG A1 18 FAMAS F1 19 - AN-94 20 OTs-14 Groza 4 21 Vz. 58 22 - M16A1 23 H&K G11 24 */ //Seventh slot (slot 6) - Rifles & Battle Rifles INS2_K98K::POSITION = 9; INS2_M1GARAND::POSITION = 10; INS2_ENFIELD::POSITION = 11; - INS2_FNFAL::POSITION = 12; - INS2_G3A3::POSITION = 13; - INS2_M14EBR::POSITION = 14; - INS2_FG42::POSITION = 15; + INS2_SVT40::POSITION = 12; + INS2_FNFAL::POSITION = 13; + INS2_G3A3::POSITION = 14; + INS2_M14EBR::POSITION = 15; + INS2_SCARH::POSITION = 16; + INS2_FG42::POSITION = 17; /* M1918 BAR 16 - SCAR-H 17 SIG SG-751 18 SVU-AS 19 - SVT-40 20 Gewehr 98 21 */ //Eight slot (slot 7) - LMGs & Sniper Rifles INS2_M40A1::POSITION = 9; INS2_MOSIN::POSITION = 10; INS2_G43::POSITION = 11; - INS2_SVD::POSITION = 12; - INS2_LEWIS::POSITION = 13; - INS2_RPK::POSITION = 14; - INS2_M60::POSITION = 15; - INS2_M249::POSITION = 16; - INS2_MG42::POSITION = 17; + INS2_XM21::POSITION = 12; + INS2_SVD::POSITION = 13; + INS2_LEWIS::POSITION = 14; + INS2_MG34::POSITION = 15; + INS2_RPK::POSITION = 16; + INS2_M60::POSITION = 17; + INS2_M249::POSITION = 18; + INS2_PKM::POSITION = 19; + INS2_MG42::POSITION = 20; /* WA2000 18 - M21 19 AWSM 20 VSSK 21 Bren MK. 2 22 - MG-34 23 - PKM 24 */ //Ninth slot (slot 8) - Special Purpose Weapons INS2_M2FLAMETHROWER::POSITION = 9; /* - Barret M82A1 10 + Barrett M82A1 10 */ BuyMenu::RegisterBuyMenuCCVars(); } @@ -170,210 +177,265 @@ void MapInit() //Pistols //Makarov - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Makarov PM", INS2_MAKAROV::GetName(), 80, "secondary", "pistol" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Makarov PM 9x18mm", INS2_MAKAROV::GetName(), 100, "secondary", "pistol" ) ); g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Makarov 9x18mm Ammo", INS2_MAKAROV::GetAmmoName(), 5, "ammo", "pistol" ) ); //M1911 - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Colt M1911", INS2_M1911::GetName(), 100, "secondary", "pistol" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Colt M1911 .45ACP", INS2_M1911::GetName(), 110, "secondary", "pistol" ) ); g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M1911 .45ACP Ammo", INS2_M1911::GetAmmoName(), 10, "ammo", "pistol" ) ); //Beretta - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Beretta M92F", INS2_M9BERETTA::GetName(), 115, "secondary", "pistol" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Beretta M92F 9x19mm", INS2_M9BERETTA::GetName(), 130, "secondary", "pistol" ) ); g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Beretta 9x19mm Ammo", INS2_M9BERETTA::GetAmmoName(), 15, "ammo", "pistol" ) ); //USP Match - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "H&K USP Match", INS2_USP::GetName(), 130, "secondary", "pistol" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "H&K USP Match .45ACP", INS2_USP::GetName(), 145, "secondary", "pistol" ) ); g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "USP .45ACP Ammo", INS2_USP::GetAmmoName(), 10, "ammo", "pistol" ) ); //Glock 17 - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Glock 17", INS2_GLOCK17::GetName(), 140, "secondary", "pistol" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Glock 17 9x19mm", INS2_GLOCK17::GetName(), 155, "secondary", "pistol" ) ); g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Glock 17 9x19mm Ammo", INS2_GLOCK17::GetAmmoName(), 20, "ammo", "pistol" ) ); //C96 - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Mauser C96", INS2_C96::GetName(), 175, "secondary", "pistol" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Mauser C96 7.63x25mm", INS2_C96::GetName(), 175, "secondary", "pistol" ) ); g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "C96 7.63x25mm Ammo", INS2_C96::GetAmmoName(), 15, "ammo", "pistol" ) ); //Desert Eagle - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "IMI Desert Eagle", INS2_DEAGLE::GetName(), 200, "secondary", "pistol" ) ); - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Desert Eagle .50AE Ammo", INS2_DEAGLE::GetAmmoName(), 20, "ammo", "pistol" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "IMI Desert Eagle .50AE", INS2_DEAGLE::GetName(), 200, "secondary", "pistol" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Desert Eagle .50AE Ammo", INS2_DEAGLE::GetAmmoName(), 25, "ammo", "pistol" ) ); + //H&K VP-70 + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "H&K VP-70M 9x19mm", INS2_VP70::GetName(), 170, "secondary", "pistol" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "VP-70M 9x19mm Ammo", INS2_VP70::GetAmmoName(), 20, "ammo", "pistol" ) ); //Revolvers //Webley - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Webley Mk.VI", INS2_WEBLEY::GetName(), 170, "secondary", "revolver" ) ); - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Webley .455 Ammo", INS2_WEBLEY::GetAmmoName(), 10, "ammo", "revolver" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Webley Mk.VI .455 WMk.II", INS2_WEBLEY::GetName(), 160, "secondary", "revolver" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Webley .455 WMk.II Ammo", INS2_WEBLEY::GetAmmoName(), 10, "ammo", "revolver" ) ); //Colt Python - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Colt Python", INS2_PYTHON::GetName(), 185, "secondary", "revolver" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Colt Python .357 Magnum", INS2_PYTHON::GetName(), 180, "secondary", "revolver" ) ); g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Python .357 Magnum Ammo", INS2_PYTHON::GetAmmoName(), 15, "ammo", "revolver" ) ); //Model M29 - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "S&W Model 29", INS2_M29::GetName(), 200, "secondary", "revolver" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "S&W Model 29 .44 Magnum", INS2_M29::GetName(), 190, "secondary", "revolver" ) ); g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Model 29 .44 Magnum Ammo", INS2_M29::GetAmmoName(), 20, "ammo", "revolver" ) ); + //Submachine Guns + //UMP45 + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "H&K UMP-45 .45ACP", INS2_UMP45::GetName(), 165, "primary", "smg" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "UMP-45 .45ACP Ammo", INS2_UMP45::GetAmmoName(), 20, "ammo", "smg" ) ); + //M3 Greasegun + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M3 Greasegun .45ACP", INS2_GREASEGUN::GetName(), 170, "primary", "smg" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M3 Greasegun .45ACP Ammo", INS2_GREASEGUN::GetAmmoName(), 25, "ammo", "smg" ) ); + //MP5K + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "H&K MP5K 9x19mm", INS2_MP5K::GetName(), 175, "primary", "smg" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "MP5K 9x19mm Ammo", INS2_MP5K::GetAmmoName(), 20, "ammo", "smg" ) ); + //MP-18 + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Bergmann MP-18,I 9x19mm", INS2_MP18::GetName(), 180, "primary", "smg" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "MP-18 9x19mm Ammo", INS2_MP18::GetAmmoName(), 25, "ammo", "smg" ) ); + //MP40 + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "MP-40 9x19mm", INS2_MP40::GetName(), 185, "primary", "smg" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "MP-40 9x19mm Ammo", INS2_MP40::GetAmmoName(), 25, "ammo", "smg" ) ); + //MP5SD + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "H&K MP5SD 9x19mm", INS2_MP5SD::GetName(), 190, "primary", "smg" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "MP5SD 9x19mm Ammo", INS2_MP5SD::GetAmmoName(), 20, "ammo", "smg" ) ); + //Sterling L2A3 + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Sterling L2A3 9x19mm", INS2_STERLING::GetName(), 195, "primary", "smg" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Sterling 9x19mm Ammo", INS2_STERLING::GetAmmoName(), 30, "ammo", "smg" ) ); + //Thompson M1928 + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Thompson M1928 .45ACP", INS2_M1928::GetName(), 225, "primary", "smg" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Thompson M1928 .45ACP Ammo", INS2_M1928::GetAmmoName(), 50, "ammo", "smg" ) ); + //PPSh41 + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "PPSh-41 7.62x25mm", INS2_PPSH41::GetName(), 235, "primary", "smg" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "PPSh-41 7.62x25mm Ammo", INS2_PPSH41::GetAmmoName(), 50, "ammo", "smg" ) ); + //MP7 + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "H&K MP7 4.6x30mm", INS2_MP7::GetName(), 315, "primary", "smg" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "MP7 4.6x30mm Ammo", INS2_MP7::GetAmmoName(), 45, "ammo", "smg" ) ); + + //Carbines + //C96 M1932 Schnellfeuer + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "C96 M1932 Schnellfeuer 7.63x25mm", INS2_C96CARBINE::GetName(), 185, "primary", "carbine" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "C96 M1932 7.63x25mm Ammo", INS2_C96CARBINE::GetAmmoName(), 30, "ammo", "carbine" ) ); + //MK. 18 + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Mk. 18 MOD 1 5.56x45mm + EOTech Sight", INS2_MK18::GetName(), 220, "primary", "carbine" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Mk. 18 5.56x45mm Ammo", INS2_MK18::GetAmmoName(), 30, "ammo", "carbine" ) ); + //AKS-74U + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "AKS-74U 5.45x39mm", INS2_AKS74U::GetName(), 235, "primary", "carbine" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "AKS-74U 5.45x39mm Ammo", INS2_AKS74U::GetAmmoName(), 30, "ammo", "carbine" ) ); + //M4A1 + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Colt M4A1 5.56x45mm + Foregrip", INS2_M4A1::GetName(), 245, "primary", "carbine" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M4A1 5.56x45mm Ammo", INS2_M4A1::GetAmmoName(), 30, "ammo", "carbine" ) ); + //G36C + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "H&K G36C 5.56x45mm", INS2_G36C::GetName(), 250, "primary", "carbine" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "G36C 5.56x45mm Ammo", INS2_G36C::GetAmmoName(), 30, "ammo", "carbine" ) ); + //M1A1 Paratrooper + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M1A1 Paratrooper 7.62x33mm + Bayonet", INS2_M1A1PARA::GetName(), 260, "primary", "carbine" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M1A1 Paratrooper 7.62x33mm Ammo", INS2_M1A1PARA::GetAmmoName(), 20, "ammo", "carbine" ) ); + //SKS + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "SKS Simonov 7.62x39mm", INS2_SKS::GetName(), 270, "primary", "carbine" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "SKS 7.62x39mm Ammo", INS2_SKS::GetAmmoName(), 25, "ammo", "carbine" ) ); + + //Shotguns + //Ithaca M37 + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Ithaca M37 12 Gauge + Bayonet", INS2_ITHACA::GetName(), 275, "primary", "shotgun" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Ithaca M37 12 Gauge Ammo", INS2_ITHACA::GetAmmoName(), 40, "ammo", "shotgun" ) ); + //M590 + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Mossberg M590 12 Gauge", INS2_M590::GetName(), 285, "primary", "shotgun" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M590 12 Gauge Ammo", INS2_M590::GetAmmoName(), 50, "ammo", "shotgun" ) ); + //Coach Gun + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Coach Gun Buck & Ball", INS2_COACH::GetName(), 295, "primary", "shotgun" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Coach Gun Buck & Ball Ammo", INS2_COACH::GetAmmoName(), 20, "ammo", "shotgun" ) ); + //M1014 + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Benelli M1014 12 Gauge", INS2_M1014::GetName(), 330, "primary", "shotgun" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M1014 12 Gauge Ammo", INS2_M1014::GetAmmoName(), 45, "ammo", "shotgun" ) ); + //Saiga 12 + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Saiga 12K 12 Gauge", INS2_SAIGA12::GetName(), 725, "primary", "shotgun" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Saiga 12K 12 Gauge Ammo", INS2_SAIGA12::GetAmmoName(), 80, "ammo", "shotgun" ) ); + //Assault Rifles & Battle Rifles //AS VAL - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "AS VAL", INS2_ASVAL::GetName(), 245, "primary", "assault" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "AS VAL 9x39mm", INS2_ASVAL::GetName(), 230, "primary", "assault" ) ); g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "AS VAL 9x39mm Ammo", INS2_ASVAL::GetAmmoName(), 20, "ammo", "assault" ) ); - //StG-44 - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "StG-44", INS2_STG44::GetName(), 260, "primary", "assault" ) ); - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "StG-44 7.92x33mm Ammo", INS2_STG44::GetAmmoName(), 30, "ammo", "assault" ) ); + //GALIL + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "IMI GALIL ARM 5.56x45mm + Bipod", INS2_GALIL::GetName(), 260, "primary", "assault" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "GALIL 5.56x45mm Ammo", INS2_GALIL::GetAmmoName(), 35, "ammo", "assault" ) ); //F2000 - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "FN F2000", INS2_F2000::GetName(), 270, "primary", "assault" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "FN F2000 5.56x45mm", INS2_F2000::GetName(), 265, "primary", "assault" ) ); g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "F2000 5.56x45mm Ammo", INS2_F2000::GetAmmoName(), 30, "ammo", "assault" ) ); //AK-12 - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "AK-12", INS2_AK12::GetName(), 280, "primary", "assault" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "AK-12 5.45x39mm", INS2_AK12::GetName(), 275, "primary", "assault" ) ); g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "AK-12 5.45x39mm Ammo", INS2_AK12::GetAmmoName(), 30, "ammo", "assault" ) ); //AK-74 - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "AKS-74 + Foregrip", INS2_AK74::GetName(), 290, "primary", "assault" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "AKS-74 + Foregrip 5.45x39mm", INS2_AK74::GetName(), 285, "primary", "assault" ) ); g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "AKS-74 5.45x39mm Ammo", INS2_AK74::GetAmmoName(), 30, "ammo", "assault" ) ); - //GALIL - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "IMI GALIL ARM + Bipod", INS2_GALIL::GetName(), 300, "primary", "assault" ) ); - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "GALIL 5.56x45mm Ammo", INS2_GALIL::GetAmmoName(), 35, "ammo", "assault" ) ); + //StG-44 + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "StG-44 7.92x33mm", INS2_STG44::GetName(), 290, "primary", "assault" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "StG-44 7.92x33mm Ammo", INS2_STG44::GetAmmoName(), 30, "ammo", "assault" ) ); + //AN-94 + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "AN-94N + PK-AS 5.45x39mm", INS2_AN94::GetName(), 300, "primary", "assault" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "AN-94N 5.45x39mm Ammo", INS2_AN94::GetAmmoName(), 30, "ammo", "assault" ) ); + //M16A1 + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M16A1 5.56x45mm + M203 40mm M406", INS2_M16A1::GetName(), 310, "primary", "assault" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M16A1 5.56x45mm Ammo", INS2_M16A1::GetAmmoName(), 20, "ammo", "assault" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M203 40mm M406 grenade Ammo", INS2_M16A1::GetGLName(), 30, "ammo", "launcher" ) ); + //OTs-14 Groza 4 9/40 + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "OTs-14 Groza 4 9x39mm + GP-30 40mm VOG-25", INS2_GROZA::GetName(), 320, "primary", "assault" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "OTs-14 9x39mm Ammo", INS2_GROZA::GetAmmoName(), 20, "ammo", "assault" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "GP-30 40mm VOG-25 grenade Ammo", INS2_GROZA::GetGLName(), 30, "ammo", "launcher" ) ); //M16A4 - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M16A4 + M203", INS2_M16A4::GetName(), 310, "primary", "assault" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M16A4 5.56x45mm + M203 40mm M406", INS2_M16A4::GetName(), 325, "primary", "assault" ) ); g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M16A4 5.56x45mm Ammo", INS2_M16A4::GetAmmoName(), 30, "ammo", "assault" ) ); - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M203 40mm grenade Ammo", INS2_M16A4::GetGLName(), 30, "ammo", "launcher" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M203 40mm M406 grenade Ammo", INS2_M16A4::GetGLName(), 30, "ammo", "launcher" ) ); //L85A2 - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "L85A2 + AG-36", INS2_L85A2::GetName(), 320, "primary", "assault" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "L85A2 5.56x45mm + AG-36 40mm M406", INS2_L85A2::GetName(), 335, "primary", "assault" ) ); g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "L85A2 5.56x45mm Ammo", INS2_L85A2::GetAmmoName(), 30, "ammo", "assault" ) ); - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "AG-36 40mm grenade Ammo", INS2_L85A2::GetGLName(), 30, "ammo", "launcher" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "AG-36 40mm M406 grenade Ammo", INS2_L85A2::GetGLName(), 30, "ammo", "launcher" ) ); //AKM - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "AKM + GP-25", INS2_AKM::GetName(), 330, "primary", "assault" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "AKM 7.62x39mm + GP-25 40mm VOG-25P", INS2_AKM::GetName(), 350, "primary", "assault" ) ); g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "AKM 7.62x39mm Ammo", INS2_AKM::GetAmmoName(), 30, "ammo", "assault" ) ); - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "GP-25 40mm grenade Ammo", INS2_AKM::GetGLName(), 30, "ammo", "launcher" ) ); - //FN FAL - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "FN FAL", INS2_FNFAL::GetName(), 310, "primary", "assault" ) ); - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "FN FAL 7.62x51mm Ammo", INS2_FNFAL::GetAmmoName(), 20, "ammo", "assault" ) ); - //G3A3 - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "H&K G3A3", INS2_G3A3::GetName(), 315, "primary", "assault" ) ); - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "G3A3 7.62x51mm Ammo", INS2_G3A3::GetAmmoName(), 20, "ammo", "assault" ) ); - //FG-42 - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "FG-42 + Bipod", INS2_FG42::GetName(), 330, "primary", "assault" ) ); - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "FG-42 7.92x57mm Ammo", INS2_FG42::GetAmmoName(), 40, "ammo", "assault" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "GP-25 40mm VOG-25P grenade Ammo", INS2_AKM::GetGLName(), 30, "ammo", "launcher" ) ); //Rifles & Sniper Rifles //Kar98K - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Karabiner 98K + Schiessbecher", INS2_K98K::GetName(), 220, "primary", "rifle" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Karabiner 98K 7.92x57mm + Schiessbecher 30x250mm", INS2_K98K::GetName(), 240, "primary", "rifle" ) ); g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Karabiner 98K 7.92x57mm Ammo", INS2_K98K::GetAmmoName(), 10, "ammo", "rifle" ) ); - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Schiessbecher Ammo", INS2_K98K::GetGLName(), 30, "ammo", "launcher" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Schiessbecher 30x250mm Ammo", INS2_K98K::GetGLName(), 30, "ammo", "launcher" ) ); //Garand - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M1 Garand + Bayonet", INS2_M1GARAND::GetName(), 235, "primary", "rifle" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M1 Garand 7.62x63mm + Bayonet", INS2_M1GARAND::GetName(), 255, "primary", "rifle" ) ); g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M1 Garand 7.62x63mm Ammo", INS2_M1GARAND::GetAmmoName(), 15, "ammo", "rifle" ) ); //Enfield - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Lee-Enfield No.IV Mk.I", INS2_ENFIELD::GetName(), 250, "primary", "rifle" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Lee-Enfield No.IV Mk.I .303", INS2_ENFIELD::GetName(), 270, "primary", "rifle" ) ); g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Lee-Enfield .303 Ammo", INS2_ENFIELD::GetAmmoName(), 20, "ammo", "rifle" ) ); + //SVT-40 + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "SVT-40 7.62x54mmR", INS2_SVT40::GetName(), 290, "primary", "rifle" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "SVT-40 7.62x54mmR Ammo", INS2_SVT40::GetAmmoName(), 30, "ammo", "rifle" ) ); + //FN FAL + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "FN FAL 7.62x51mm", INS2_FNFAL::GetName(), 330, "primary", "rifle" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "FN FAL 7.62x51mm Ammo", INS2_FNFAL::GetAmmoName(), 20, "ammo", "rifle" ) ); + //G3A3 + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "H&K G3A3 7.62x51mm", INS2_G3A3::GetName(), 335, "primary", "rifle" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "G3A3 7.62x51mm Ammo", INS2_G3A3::GetAmmoName(), 20, "ammo", "rifle" ) ); //M14 EBR - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M14 EBR Red Dot Sight", INS2_M14EBR::GetName(), 320, "primary", "rifle" ) ); - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M14 EBR 7.62x51mm Ammo", INS2_M14EBR::GetAmmoName(), 30, "ammo", "rifle" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M14 EBR 7.62x51mm + Red Dot Sight", INS2_M14EBR::GetName(), 345, "primary", "rifle" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M14 EBR 7.62x51mm Ammo", INS2_M14EBR::GetAmmoName(), 20, "ammo", "rifle" ) ); + //SCARH + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "FN SCAR-H 7.62x51mm", INS2_SCARH::GetName(), 350, "primary", "rifle" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "SCAR-H 7.62x51mm Ammo", INS2_SCARH::GetAmmoName(), 20, "ammo", "rifle" ) ); + //FG-42 + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "FG-42 7.92x57mm + Bipod", INS2_FG42::GetName(), 360, "primary", "rifle" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "FG-42 7.92x57mm Ammo", INS2_FG42::GetAmmoName(), 35, "ammo", "rifle" ) ); //M40A1 - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M40A1 Leupold Scope", INS2_M40A1::GetName(), 305, "primary", "rifle" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M40A1 7.62x51mm + Leupold Scope", INS2_M40A1::GetName(), 305, "primary", "rifle" ) ); g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M40A1 7.62x51mm Ammo", INS2_M40A1::GetAmmoName(), 10, "ammo", "rifle" ) ); //Mosin Nagant - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Mosin Nagant M91/30 PU Scope", INS2_MOSIN::GetName(), 320, "primary", "rifle" ) ); - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Mosin Nagant 7.62x54mm Ammo", INS2_MOSIN::GetAmmoName(), 15, "ammo", "rifle" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Mosin Nagant M91/30 7.62x54mmR + PU Scope", INS2_MOSIN::GetName(), 320, "primary", "rifle" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Mosin Nagant 7.62x54mmR Ammo", INS2_MOSIN::GetAmmoName(), 15, "ammo", "rifle" ) ); //G43 - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Gewehr 43 ZF4 Scope", INS2_G43::GetName(), 335, "primary", "rifle" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Gewehr 43 7.92x57mm + ZF4 Scope", INS2_G43::GetName(), 340, "primary", "rifle" ) ); g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Gewehr 43 7.92x57mm Ammo", INS2_G43::GetAmmoName(), 20, "ammo", "rifle" ) ); + //XM21 + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "XM21 7.62x51mm + Redfield ART 1 Scope", INS2_XM21::GetName(), 350, "primary", "rifle" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "XM21 7.62x51mm Ammo", INS2_XM21::GetAmmoName(), 20, "ammo", "rifle" ) ); //Dragunov - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "SVD Dragunov PSO-1 Scope", INS2_SVD::GetName(), 345, "primary", "rifle" ) ); - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "SVD Dragunov 7.62x54mm Ammo", INS2_SVD::GetAmmoName(), 30, "ammo", "rifle" ) ); - - //Shotguns - //Ithaca M37 - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Ithaca M37", INS2_ITHACA::GetName(), 260, "primary", "shotgun" ) ); - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Ithaca M37 12 Gauge Ammo", INS2_ITHACA::GetAmmoName(), 40, "ammo", "shotgun" ) ); - //M590 - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Mossberg M590", INS2_M590::GetName(), 275, "primary", "shotgun" ) ); - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M590 12 Gauge Ammo", INS2_M590::GetAmmoName(), 50, "ammo", "shotgun" ) ); - //Coach Gun - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Coach Gun", INS2_COACH::GetName(), 290, "primary", "shotgun" ) ); - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Coach Gun Buckshot Ammo", INS2_COACH::GetAmmoName(), 20, "ammo", "shotgun" ) ); - //M1014 - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Benelli M1014", INS2_M1014::GetName(), 325, "primary", "shotgun" ) ); - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M1014 12 Gauge Ammo", INS2_M1014::GetAmmoName(), 45, "ammo", "shotgun" ) ); - //Saiga 12 - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Saiga 12K", INS2_SAIGA12::GetName(), 700, "primary", "shotgun" ) ); - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Saiga 12K Gauge Ammo", INS2_SAIGA12::GetAmmoName(), 80, "ammo", "shotgun" ) ); - - //Submachine Guns - //UMP45 - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "H&K UMP-45", INS2_UMP45::GetName(), 155, "primary", "smg" ) ); - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "UMP-45 .45ACP Ammo", INS2_UMP45::GetAmmoName(), 20, "ammo", "smg" ) ); - //MP5K - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "H&K MP5K", INS2_MP5K::GetName(), 165, "primary", "smg" ) ); - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "MP5K 9x19mm Ammo", INS2_MP5K::GetAmmoName(), 20, "ammo", "smg" ) ); - //MP-18 - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Bergmann MP-18,I", INS2_MP18::GetName(), 170, "primary", "smg" ) ); - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "MP-18 9x19mm Ammo", INS2_MP18::GetAmmoName(), 25, "ammo", "smg" ) ); - //MP40 - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "MP-40", INS2_MP40::GetName(), 175, "primary", "smg" ) ); - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "MP-40 9x19mm Ammo", INS2_MP40::GetAmmoName(), 25, "ammo", "smg" ) ); - //Sterling L2A3 - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Sterling L2A3", INS2_STERLING::GetName(), 185, "primary", "smg" ) ); - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Sterling 9x19mm Ammo", INS2_STERLING::GetAmmoName(), 30, "ammo", "smg" ) ); - //PPSh41 - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "PPSh-41", INS2_PPSH41::GetName(), 195, "primary", "smg" ) ); - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "PPSh-41 7.62x25mm Ammo", INS2_PPSH41::GetAmmoName(), 50, "ammo", "smg" ) ); - //Thompson M1928 - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Thompson M1928", INS2_M1928::GetName(), 200, "primary", "smg" ) ); - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Thompson M1928 .45ACP Ammo", INS2_M1928::GetAmmoName(), 50, "ammo", "smg" ) ); - //MP7 - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "H&K MP7", INS2_MP7::GetName(), 210, "primary", "smg" ) ); - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "MP7 4.6x30mm Ammo", INS2_MP7::GetAmmoName(), 30, "ammo", "smg" ) ); - - //Carbines - //C96 M1932 Schnellfeuer - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "C96 M1932 Schnellfeuer", INS2_C96CARBINE::GetName(), 215, "primary", "carbine" ) ); - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "C96 M1932 7.63x25mm Ammo", INS2_C96CARBINE::GetAmmoName(), 30, "ammo", "carbine" ) ); - //MK. 18 - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Mk. 18 MOD 1", INS2_MK18::GetName(), 225, "primary", "carbine" ) ); - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Mk. 18 5.56x45mm Ammo", INS2_MK18::GetAmmoName(), 30, "ammo", "carbine" ) ); - //AKS-74U - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "AKS-74U", INS2_AKS74U::GetName(), 235, "primary", "carbine" ) ); - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "AKS-74U 5.45x39mm Ammo", INS2_AKS74U::GetAmmoName(), 30, "ammo", "carbine" ) ); - //M4A1 - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Colt M4A1", INS2_M4A1::GetName(), 245, "primary", "carbine" ) ); - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M4A1 5.56x45mm Ammo", INS2_M4A1::GetAmmoName(), 30, "ammo", "carbine" ) ); - //M1A1 Paratrooper - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M1A1 Paratrooper", INS2_M1A1PARA::GetName(), 260, "primary", "carbine" ) ); - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M1A1 Paratrooper 7.62x33mm Ammo", INS2_M1A1PARA::GetAmmoName(), 20, "ammo", "carbine" ) ); - //SKS - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "SKS Simonov", INS2_SKS::GetName(), 275, "primary", "carbine" ) ); - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "SKS 7.62x39mm Ammo", INS2_SKS::GetAmmoName(), 25, "ammo", "carbine" ) ); - - //Launchers & Explosives - //M79 - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M79 Grenade Launcher", INS2_M79::GetName(), 375, "primary", "launcher" ) ); - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M79 40mm grenade Ammo", INS2_M79::GetAmmoName(), 30, "ammo", "launcher" ) ); - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M79 40mm buckshot Ammo", INS2_M79::GetGLName(), 25, "ammo", "launcher" ) ); - //Panzerfaust - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Panzerfaust 60M", INS2_PZFAUST::GetName(), 425, "primary", "launcher" ) ); - //M72 LAW - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M72 LAW", INS2_LAW::GetName(), 450, "primary", "launcher" ) ); - //AT4 - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M136 AT4", INS2_AT4::GetName(), 500, "primary", "launcher" ) ); - //RPG7 - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "RPG-7", INS2_RPG7::GetName(), 700, "primary", "launcher" ) ); - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "RPG-7 Rocket Ammo", INS2_RPG7::GetAmmoName(), 100, "ammo", "launcher" ) ); - //Panzerschreck - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Panzerschreck", INS2_PZSCHRECK::GetName(), 750, "primary", "launcher" ) ); - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Panzerschreck Rocket Ammo", INS2_PZSCHRECK::GetAmmoName(), 125, "ammo", "launcher" ) ); - //M2 Flamethrower - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M2 Flamethrower", INS2_M2FLAMETHROWER::GetName(), 800, "primary", "launcher" ) ); - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M2 Napalm Ammo", INS2_M2FLAMETHROWER::GetAmmoName(), 60, "ammo", "launcher" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "SVD Dragunov 7.62x54mmR + PSO-1 Scope", INS2_SVD::GetName(), 360, "primary", "rifle" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Dragunov 7.62x54mmR Ammo", INS2_SVD::GetAmmoName(), 30, "ammo", "rifle" ) ); //Light Machine Guns //Lewis - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Lewis Model 1915 MK.I + Bipod", INS2_LEWIS::GetName(), 360, "primary", "lmg" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Lewis Model 1915 MK.I .303 + Bipod", INS2_LEWIS::GetName(), 400, "primary", "lmg" ) ); g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Lewis .303 Ammo", INS2_LEWIS::GetAmmoName(), 55, "ammo", "lmg" ) ); + //MG-34 + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "MG-34 7.92x57mm + Bipod", INS2_MG34::GetName(), 445, "primary", "lmg" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "MG-34 7.92x57mm Ammo", INS2_MG34::GetAmmoName(), 40, "ammo", "lmg" ) ); //RPK - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "RPK + Bipod", INS2_RPK::GetName(), 400, "primary", "lmg" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "RPK 7.62x39mm + Bipod", INS2_RPK::GetName(), 485, "primary", "lmg" ) ); g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "RPK 7.62x39mm Ammo", INS2_RPK::GetAmmoName(), 75, "ammo", "lmg" ) ); //M60 - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M60 + Bipod", INS2_M60::GetName(), 475, "primary", "lmg" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M60 7.62x51mm + Bipod", INS2_M60::GetName(), 540, "primary", "lmg" ) ); g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M60 7.62x51mm Ammo", INS2_M60::GetAmmoName(), 100, "ammo", "lmg" ) ); //M249 - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "FN M249 + Bipod", INS2_M249::GetName(), 575, "primary", "lmg" ) ); - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M249 5.56x45mm AP Ammo", INS2_M249::GetAmmoName(), 150, "ammo", "lmg" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "FN M249 5.56x45mm AP + Bipod", INS2_M249::GetName(), 700, "primary", "lmg" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M249 5.56x45mm AP Ammo", INS2_M249::GetAmmoName(), 130, "ammo", "lmg" ) ); + //PKM + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "PKM 7.62x54mmR + Bipod", INS2_PKM::GetName(), 950, "primary", "lmg" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "PKM 7.62x54mmR Ammo", INS2_PKM::GetAmmoName(), 200, "ammo", "lmg" ) ); //MG-42 - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "MG-42 + Bipod", INS2_MG42::GetName(), 900, "primary", "lmg" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "MG-42 7.92x57mm + Bipod", INS2_MG42::GetName(), 1000, "primary", "lmg" ) ); g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "MG-42 7.92x57mm Ammo", INS2_MG42::GetAmmoName(), 200, "ammo", "lmg" ) ); - //Equipment - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Stielhandgranate M24", INS2_M24GRENADE::GetName(), 45, "equipment", "" ) ); - g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Mk. 2 \"Pineapple\" Grenade", INS2_MK2GRENADE::GetName(), 50, "equipment", "" ) ); + //Launchers & Explosives + //M79 + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M79 Grenade Launcher", INS2_M79::GetName(), 450, "primary", "launcher" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M79 40mm Grenade M406 Ammo", INS2_M79::GetAmmoName(), 30, "ammo", "launcher" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M79 40mm Buckshot M576 Ammo", INS2_M79::GetGLName(), 35, "ammo", "launcher" ) ); + //RPG7 + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "RPG-7", INS2_RPG7::GetName(), 600, "primary", "launcher" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "RPG-7 40mm Rocket Ammo", INS2_RPG7::GetAmmoName(), 100, "ammo", "launcher" ) ); + //Panzerschreck + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Panzerschreck", INS2_PZSCHRECK::GetName(), 700, "primary", "launcher" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Panzerschreck 88mm Rocket Ammo", INS2_PZSCHRECK::GetAmmoName(), 125, "ammo", "launcher" ) ); + //M2 Flamethrower + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M2 Flamethrower", INS2_M2FLAMETHROWER::GetName(), 800, "primary", "launcher" ) ); + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M2 Napalm Ammo", INS2_M2FLAMETHROWER::GetAmmoName(), 60, "ammo", "launcher" ) ); + + //Time-Fuse Grenades + //Stielhandgranate M24 + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Stielhandgranate M24", INS2_M24GRENADE::GetName(), 45, "equipment", "timed" ) ); + //Mk. 2 Grenade + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Mk. 2 \"Pineapple\" Grenade", INS2_MK2GRENADE::GetName(), 50, "equipment", "timed" ) ); + + //Impact-Fuse Grenades + //RGO Grenade + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "RGO Grenade", INS2_RGOGRENADE::GetName(), 65, "equipment", "impact" ) ); + //NO. 69 + //g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "NO. 69 Grenade", INS2_NO69GRENADE::GetName(), 75, "equipment", "impact" ) ); + + //Disposable Launchers + //Panzerfaust + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Panzerfaust 60M", INS2_PZFAUST::GetName(), 400, "equipment", "disposable" ) ); + //M72 LAW + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M72 LAW", INS2_LAW::GetName(), 425, "equipment", "disposable" ) ); + //AT4 + g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "M136 AT4", INS2_AT4::GetName(), 450, "equipment", "disposable" ) ); + + //High Explosives + //TNT + //g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "TNT (10 Seconds Fuse)", INS2_TNT::GetName(), 400, "equipment", "explosive" ) ); + //Remote Controlled C4 + //g_Ins2Menu.AddItem( BuyMenu::BuyableItem( "Remote Controlled C4", INS2_C4::GetName(), 500, "equipment", "explosive" ) ); + BuyMenu::MoneyInit(); } \ No newline at end of file diff --git a/scripts/maps/ins2/lmg/weapon_ins2lewis.as b/scripts/maps/ins2/lmg/weapon_ins2lewis.as index 785f3dd..5935644 100644 --- a/scripts/maps/ins2/lmg/weapon_ins2lewis.as +++ b/scripts/maps/ins2/lmg/weapon_ins2lewis.as @@ -87,9 +87,10 @@ int WEIGHT = 40; int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY | ITEM_FLAG_ESSENTIAL; uint DAMAGE = 28; uint SLOT = 7; -uint POSITION = 10; +uint POSITION = 9; float RPM_AIR = 600; //Rounds per minute in air float RPM_WTR = 500; //Rounds per minute in water +uint AIM_FOV = 40; // Below 50 hides crosshair string AMMO_TYPE = "ins2_303brit"; class weapon_ins2lewis : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, INS2BASE::BipodWeaponBase @@ -277,7 +278,7 @@ class weapon_ins2lewis : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, INS else self.SendWeaponAnim( (self.m_iClip > 0) ? BIPOD_IRON_TO : BIPOD_IRON_TO_EMPTY, GetBodygroup() ); - EffectsFOVON( 40 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/lmg/weapon_ins2m249.as b/scripts/maps/ins2/lmg/weapon_ins2m249.as index a93aa4a..638239b 100644 --- a/scripts/maps/ins2/lmg/weapon_ins2m249.as +++ b/scripts/maps/ins2/lmg/weapon_ins2m249.as @@ -77,9 +77,10 @@ int WEIGHT = 55; int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY | ITEM_FLAG_ESSENTIAL; uint DAMAGE = 18; uint SLOT = 7; -uint POSITION = 14; +uint POSITION = 13; float RPM_AIR = 775; //Rounds per minute in air float RPM_WTR = 600; //Rounds per minute in water +uint AIM_FOV = 40; // Below 50 hides crosshair string AMMO_TYPE = "ins2_5.56x45mm"; class weapon_ins2m249 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, INS2BASE::BipodWeaponBase @@ -294,7 +295,7 @@ class weapon_ins2m249 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, INS2 case INS2BASE::IRON_OUT: { self.SendWeaponAnim( (WeaponBipodMode == INS2BASE::BIPOD_UNDEPLOYED) ? IRON_TO : BIPOD_IRON_TO, 0, GetBodygroup() ); - EffectsFOVON( 40 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/lmg/weapon_ins2m60.as b/scripts/maps/ins2/lmg/weapon_ins2m60.as index a52bfec..3301413 100644 --- a/scripts/maps/ins2/lmg/weapon_ins2m60.as +++ b/scripts/maps/ins2/lmg/weapon_ins2m60.as @@ -77,9 +77,10 @@ int WEIGHT = 55; int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY | ITEM_FLAG_ESSENTIAL; uint DAMAGE = 25; uint SLOT = 7; -uint POSITION = 13; +uint POSITION = 12; float RPM_AIR = 600; //Rounds per minute in air float RPM_WTR = 500; //Rounds per minute in water +uint AIM_FOV = 40; // Below 50 hides crosshair string AMMO_TYPE = "ins2_7.62x51mm"; class weapon_ins2m60 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, INS2BASE::BipodWeaponBase @@ -296,7 +297,7 @@ class weapon_ins2m60 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, INS2B case INS2BASE::IRON_OUT: { self.SendWeaponAnim( (WeaponBipodMode == INS2BASE::BIPOD_UNDEPLOYED) ? IRON_TO : BIPOD_IRON_TO, 0, GetBodygroup() ); - EffectsFOVON( 40 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/lmg/weapon_ins2mg34.as b/scripts/maps/ins2/lmg/weapon_ins2mg34.as new file mode 100644 index 0000000..67df3ac --- /dev/null +++ b/scripts/maps/ins2/lmg/weapon_ins2mg34.as @@ -0,0 +1,425 @@ +// Insurgency's MG-34 +/* Model Credits +/ Model: Master Minder (Forgotten Hope 2), Norman The Loli Pirate +/ Textures: Subbo (Forgotten Hope 2), Razor (Forgotten Hope 2), Norman The Loli Pirate +/ Animations: New World Interactive +/ Sounds: New World Interactive, D.N.I.O. 071 (Conversion to .ogg format) +/ Sprites: D.N.I.O. 071 (Model Render), R4to0 (Vector), KernCore (.spr Compile) +/ Misc: Norman The Loli Pirate (World Model), KernCore (World Model UVs), D.N.I.O. 071 (World Model UVs, Compile) +/ Script: KernCore +*/ + +#include "../base" + +namespace INS2_MG34 +{ + +// Animations +enum INS2_MG34_Animations +{ + IDLE = 0, + FIDGET, + DRAW_FIRST, + DRAW, + HOLSTER, + FIRE1, + FIRE2, + DRYFIRE, + FIRESELECT, + RELOAD, + RELOAD_EMPTY, + IRON_IDLE, + IRON_FIDGET, + IRON_FIRE1, + IRON_FIRE2, + IRON_DRYFIRE, + IRON_FIRESELECT, + IRON_TO, + IRON_FROM, + BIPOD_IN, + BIPOD_OUT, + BIPOD_IDLE, + BIPOD_FIRE1, + BIPOD_FIRE2, + BIPOD_DRYFIRE, + BIPOD_FIRESELECT, + BIPOD_RELOAD, + BIPOD_RELOAD_EMPTY, + BIPOD_IRON_IDLE, + BIPOD_IRON_FIRE1, + BIPOD_IRON_FIRE2, + BIPOD_IRON_DRYFIRE, + BIPOD_IRON_FIRESELECT, + BIPOD_IRON_TO, + BIPOD_IRON_FROM, + BIPOD_IRON_IN, + BIPOD_IRON_OUT +}; + +enum MG34_Bodygroups +{ + ARMS = 0, + MG34_STUDIO0, + MG34_STUDIO1, + MAIN_BULLETS, + HELPER_BULLETS +}; + +// Models +string W_MODEL = "models/ins2/wpn/mg34/w_mg34.mdl"; +string V_MODEL = "models/ins2/wpn/mg34/v_mg34.mdl"; +string P_MODEL = "models/ins2/wpn/mg34/p_mg34.mdl"; +string A_MODEL = "models/ins2/ammo/mags2.mdl"; +int MAG_BDYGRP = 1; +// Sprites +string SPR_CAT = "ins2/lmg/"; //Weapon category used to get the sprite's location +// Sounds +string SHOOT_S = "ins2/wpn/mg34/shoot.ogg"; +string EMPTY_S = "ins2/wpn/mg34/empty.ogg"; +// Information +int MAX_CARRY = 1000; +int MAX_CLIP = 50; +int DEFAULT_GIVE = MAX_CLIP * 4; +int WEIGHT = 60; +int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY | ITEM_FLAG_ESSENTIAL; +uint DAMAGE = 26; +uint SLOT = 7; +uint POSITION = 10; +float RPM_AIR = 820; //Rounds per minute in air +float RPM_WTR = 620; //Rounds per minute in water +uint AIM_FOV = 40; // Below 50 hides crosshair +string AMMO_TYPE = "ins2_7.92x57mm"; + +class weapon_ins2mg34 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, INS2BASE::BipodWeaponBase +{ + private CBasePlayer@ m_pPlayer + { + get const { return cast( self.m_hPlayer.GetEntity() ); } + set { self.m_hPlayer = EHandle( @value ); } + } + private int m_iShell; + private bool m_WasDrawn; + private int GetBodygroup() + { + if( self.m_iClip >= 4 ) + m_iCurBodyConfig = g_ModelFuncs.SetBodygroup( g_ModelFuncs.ModelIndex( V_MODEL ), m_iCurBodyConfig, MAIN_BULLETS, 4 ); + else if( self.m_iClip <= 0 ) + m_iCurBodyConfig = g_ModelFuncs.SetBodygroup( g_ModelFuncs.ModelIndex( V_MODEL ), m_iCurBodyConfig, MAIN_BULLETS, 0 ); + else + m_iCurBodyConfig = g_ModelFuncs.SetBodygroup( g_ModelFuncs.ModelIndex( V_MODEL ), m_iCurBodyConfig, MAIN_BULLETS, self.m_iClip ); + + return m_iCurBodyConfig; + } + private int SetBodygroup() + { + if( m_pPlayer.m_rgAmmo( self.m_iPrimaryAmmoType ) > 0 ) + { + if( m_pPlayer.m_rgAmmo( self.m_iPrimaryAmmoType ) >= 4 || (m_pPlayer.m_rgAmmo( self.m_iPrimaryAmmoType ) + self.m_iClip) >= 4 ) + m_iCurBodyConfig = g_ModelFuncs.SetBodygroup( g_ModelFuncs.ModelIndex( V_MODEL ), m_iCurBodyConfig, HELPER_BULLETS, 4 ); + else if( m_pPlayer.m_rgAmmo( self.m_iPrimaryAmmoType ) < 4 && (m_pPlayer.m_rgAmmo( self.m_iPrimaryAmmoType ) + self.m_iClip) < 4 ) + m_iCurBodyConfig = g_ModelFuncs.SetBodygroup( g_ModelFuncs.ModelIndex( V_MODEL ), m_iCurBodyConfig, HELPER_BULLETS, m_pPlayer.m_rgAmmo( self.m_iPrimaryAmmoType ) + (self.m_iClip) ); + } + + return m_iCurBodyConfig; + } + + private array Sounds = { + "ins2/wpn/mg34/bltbk.ogg", + "ins2/wpn/mg34/bltrel.ogg", + "ins2/wpn/mg34/close.ogg", + "ins2/wpn/mg34/open.ogg", + "ins2/wpn/mg34/hit.ogg", + "ins2/wpn/mg34/magin.ogg", + "ins2/wpn/mg34/magout.ogg", + "ins2/wpn/mg34/rof.ogg", + "ins2/wpn/uni/align.ogg", + "ins2/wpn/uni/bground.ogg", + "ins2/wpn/uni/foley.ogg", + SHOOT_S, + EMPTY_S + }; + + void Spawn() + { + Precache(); + m_WasDrawn = false; + WeaponSelectFireMode = INS2BASE::SELECTFIRE_AUTO; + WeaponBipodMode = INS2BASE::BIPOD_UNDEPLOYED; + CommonSpawn( W_MODEL, DEFAULT_GIVE ); + } + + void Precache() + { + self.PrecacheCustomModels(); + g_Game.PrecacheModel( W_MODEL ); + g_Game.PrecacheModel( V_MODEL ); + g_Game.PrecacheModel( P_MODEL ); + g_Game.PrecacheModel( A_MODEL ); + m_iShell = g_Game.PrecacheModel( INS2BASE::BULLET_792x57 ); + + g_Game.PrecacheOther( GetAmmoName() ); + + INS2BASE::PrecacheSound( Sounds ); + INS2BASE::PrecacheSound( INS2BASE::DeployFirearmSounds ); + + g_Game.PrecacheGeneric( "sprites/" + SPR_CAT + self.pev.classname + ".txt" ); + g_Game.PrecacheGeneric( "events/" + "muzzle_ins2_MGs.txt" ); + CommonPrecache(); + } + + bool GetItemInfo( ItemInfo& out info ) + { + info.iMaxAmmo1 = (INS2BASE::ShouldUseCustomAmmo) ? MAX_CARRY : INS2BASE::DF_MAX_CARRY_556; + info.iAmmo1Drop = MAX_CLIP; + info.iMaxAmmo2 = -1; + info.iAmmo2Drop = -1; + info.iMaxClip = MAX_CLIP; + info.iSlot = SLOT; + info.iPosition = POSITION; + info.iId = g_ItemRegistry.GetIdForName( self.pev.classname ); + info.iFlags = FLAGS; + info.iWeight = WEIGHT; + + return true; + } + + bool AddToPlayer( CBasePlayer@ pPlayer ) + { + return CommonAddToPlayer( pPlayer ); + } + + bool PlayEmptySound() + { + return CommonPlayEmptySound( EMPTY_S ); + } + + bool Deploy() + { + PlayDeploySound( 3 ); + DisplayFiremodeSprite(); + + SetThink( ThinkFunction( ShowBipodSpriteThink ) ); + self.pev.nextthink = g_Engine.time + 0.2; + + if( m_WasDrawn == false ) + { + m_WasDrawn = true; + return Deploy( V_MODEL, P_MODEL, DRAW_FIRST, "saw", GetBodygroup(), (86.0/37.00) ); + } + else + return Deploy( V_MODEL, P_MODEL, DRAW, "saw", GetBodygroup(), (30.0/34.0) ); + } + + void Holster( int skipLocal = 0 ) + { + WeaponBipodMode = INS2BASE::BIPOD_UNDEPLOYED; + CommonHolster(); + + BaseClass.Holster( skipLocal ); + } + + void PrimaryAttack() + { + if( self.m_iClip <= 0 ) + { + self.PlayEmptySound(); + if( WeaponBipodMode == INS2BASE::BIPOD_UNDEPLOYED ) + self.SendWeaponAnim( (WeaponADSMode == INS2BASE::IRON_IN) ? IRON_DRYFIRE : DRYFIRE, 0, GetBodygroup() ); + else if( WeaponBipodMode == INS2BASE::BIPOD_DEPLOYED ) + self.SendWeaponAnim( (WeaponADSMode == INS2BASE::IRON_IN) ? BIPOD_IRON_DRYFIRE : BIPOD_DRYFIRE, 0, GetBodygroup() ); + + self.m_flNextPrimaryAttack = WeaponTimeBase() + 0.3f; + return; + } + + if( WeaponSelectFireMode == INS2BASE::SELECTFIRE_SEMI && m_pPlayer.m_afButtonPressed & IN_ATTACK == 0 ) + return; + + self.m_flNextPrimaryAttack = self.m_flNextSecondaryAttack = (m_pPlayer.pev.waterlevel == WATERLEVEL_HEAD) ? WeaponTimeBase() + GetFireRate( RPM_WTR ) : WeaponTimeBase() + GetFireRate( RPM_AIR ); + self.m_flTimeWeaponIdle = WeaponTimeBase() + 1.5f; + + ShootWeapon( SHOOT_S, 1, VecModAcc( VECTOR_CONE_2DEGREES, 1.6f, 0.65f, 1.125f ), (m_pPlayer.pev.waterlevel == WATERLEVEL_HEAD) ? 1024 : 8192, DAMAGE, true ); + + m_pPlayer.m_iWeaponVolume = LOUD_GUN_VOLUME; + m_pPlayer.m_iWeaponFlash = BRIGHT_GUN_FLASH; + + if( WeaponADSMode != INS2BASE::IRON_IN && WeaponBipodMode == INS2BASE::BIPOD_UNDEPLOYED ) + { + if( !( m_pPlayer.pev.flags & FL_ONGROUND != 0 ) ) + { + KickBack( 1.8, 0.65, 0.45, 0.125, 5.0, 3.5, 8 ); + } + else if( m_pPlayer.pev.velocity.Length2D() > 0 ) + { + KickBack( 1.1, 0.5, 0.3, 0.06, 4.0, 3.0, 8 ); + } + else if( m_pPlayer.pev.flags & FL_DUCKING != 0 ) + { + KickBack( 0.75, 0.325, 0.25, 0.025, 3.5, 2.5, 9 ); + } + else + { + KickBack( 0.8, 0.35, 0.3, 0.03, 3.75, 3.0, 9 ); + } + } + else + { + PunchAngle( Vector( Math.RandomFloat( -1.875, -2.475 ), (Math.RandomLong( 0, 1 ) < 0.5) ? -0.6f : 1.0f, Math.RandomFloat( -0.5, 0.5 ) ) ); + } + + if( WeaponBipodMode == INS2BASE::BIPOD_UNDEPLOYED ) + { + if( WeaponADSMode == INS2BASE::IRON_IN ) + self.SendWeaponAnim( Math.RandomLong( IRON_FIRE1, IRON_FIRE2 ), 0, GetBodygroup() ); + else + self.SendWeaponAnim( Math.RandomLong( FIRE1, FIRE2 ), 0, GetBodygroup() ); + } + else if( WeaponBipodMode == INS2BASE::BIPOD_DEPLOYED ) + { + if( WeaponADSMode == INS2BASE::IRON_IN ) + self.SendWeaponAnim( Math.RandomLong( BIPOD_IRON_FIRE1, BIPOD_IRON_FIRE2 ), 0, GetBodygroup() ); + else + self.SendWeaponAnim( Math.RandomLong( BIPOD_FIRE1, BIPOD_FIRE2 ), 0, GetBodygroup() ); + } + + ShellEject( m_pPlayer, m_iShell, (WeaponADSMode != INS2BASE::IRON_IN) ? Vector( 17.5, 6, -6.5 ) : Vector( 16.5, 1.5, -3.75 ), false, true ); + } + + void SecondaryAttack() + { + self.m_flTimeWeaponIdle = self.m_flNextSecondaryAttack = WeaponTimeBase() + 0.2; + self.m_flNextPrimaryAttack = WeaponTimeBase() + 0.13; + + switch( WeaponADSMode ) + { + case INS2BASE::IRON_OUT: + { + self.SendWeaponAnim( (WeaponBipodMode == INS2BASE::BIPOD_UNDEPLOYED) ? IRON_TO : BIPOD_IRON_TO, 0, GetBodygroup() ); + EffectsFOVON( AIM_FOV ); + break; + } + case INS2BASE::IRON_IN: + { + self.SendWeaponAnim( (WeaponBipodMode == INS2BASE::BIPOD_UNDEPLOYED) ? IRON_FROM : BIPOD_IRON_FROM, 0, GetBodygroup() ); + EffectsFOVOFF(); + break; + } + } + } + + void TertiaryAttack() + { + if( WeaponADSMode == INS2BASE::IRON_IN ) + DeployBipod( BIPOD_IRON_IN, BIPOD_IRON_OUT, GetBodygroup(), (70.0/36.0), (56.0/36.0) ); + else + DeployBipod( BIPOD_IN, BIPOD_OUT, GetBodygroup(), (70.0/36.0), (56.0/36.0) ); + } + + void ItemPostFrame() + { + BaseClass.ItemPostFrame(); + } + + void ItemPreFrame() + { + if( m_reloadTimer < g_Engine.time && canReload ) + self.Reload(); + + BaseClass.ItemPreFrame(); + } + + void Reload() + { + if( WeaponBipodMode == INS2BASE::BIPOD_UNDEPLOYED ) + ChangeFireMode( (WeaponADSMode == INS2BASE::IRON_IN) ? IRON_FIRESELECT : FIRESELECT, GetBodygroup(), INS2BASE::SELECTFIRE_AUTO, INS2BASE::SELECTFIRE_SEMI, (16.0/40.0) ); + else if( WeaponBipodMode == INS2BASE::BIPOD_DEPLOYED ) + ChangeFireMode( (WeaponADSMode == INS2BASE::IRON_IN) ? BIPOD_IRON_FIRESELECT : BIPOD_FIRESELECT, GetBodygroup(), INS2BASE::SELECTFIRE_AUTO, INS2BASE::SELECTFIRE_SEMI, (16.0/40.0) ); + + if( self.m_iClip == MAX_CLIP || m_pPlayer.m_rgAmmo( self.m_iPrimaryAmmoType ) <= 0 || m_pPlayer.pev.button & IN_USE != 0 ) + return; + + if( WeaponADSMode == INS2BASE::IRON_IN ) + { + self.SendWeaponAnim( (WeaponBipodMode == INS2BASE::BIPOD_UNDEPLOYED) ? IRON_FROM : BIPOD_IRON_FROM, 0, GetBodygroup() ); + m_reloadTimer = g_Engine.time + 0.16; + m_pPlayer.m_flNextAttack = 0.16; + canReload = true; + EffectsFOVOFF(); + } + + if( m_reloadTimer < g_Engine.time ) + { + if( WeaponBipodMode == INS2BASE::BIPOD_UNDEPLOYED ) + (self.m_iClip == 0) ? Reload( MAX_CLIP, RELOAD_EMPTY, (174.0/20.0), SetBodygroup() ) : Reload( MAX_CLIP, RELOAD, (147.0/20.0), SetBodygroup() ); + else if( WeaponBipodMode == INS2BASE::BIPOD_DEPLOYED ) + (self.m_iClip == 0) ? Reload( MAX_CLIP, BIPOD_RELOAD_EMPTY, (170.0/20.0), SetBodygroup() ) : Reload( MAX_CLIP, BIPOD_RELOAD, (143.0/20.0), SetBodygroup() ); + canReload = false; + } + + BaseClass.Reload(); + } + + void WeaponIdle() + { + if( self.m_flNextPrimaryAttack < g_Engine.time ) + m_iShotsFired = 0; + + self.ResetEmptySound(); + m_pPlayer.GetAutoaimVector( AUTOAIM_10DEGREES ); + + if( self.m_flTimeWeaponIdle > WeaponTimeBase() ) + return; + + if( WeaponBipodMode == INS2BASE::BIPOD_UNDEPLOYED ) + { + self.SendWeaponAnim( (WeaponADSMode == INS2BASE::IRON_IN) ? Math.RandomLong( IRON_IDLE, IRON_FIDGET ) : Math.RandomLong( IDLE, FIDGET ), 0, GetBodygroup() ); + } + else if( WeaponBipodMode == INS2BASE::BIPOD_DEPLOYED ) + { + self.SendWeaponAnim( (WeaponADSMode == INS2BASE::IRON_IN) ? BIPOD_IRON_IDLE : BIPOD_IDLE, 0, GetBodygroup() ); + } + + self.m_flTimeWeaponIdle = WeaponTimeBase() + g_PlayerFuncs.SharedRandomFloat( m_pPlayer.random_seed, 5, 7 ); + } +} + +class MG34_MAG : ScriptBasePlayerAmmoEntity, INS2BASE::AmmoBase +{ + void Spawn() + { + Precache(); + g_EntityFuncs.SetModel( self, A_MODEL ); + self.pev.body = MAG_BDYGRP; + BaseClass.Spawn(); + } + + void Precache() + { + g_Game.PrecacheModel( A_MODEL ); + CommonPrecache(); + } + + bool AddAmmo( CBaseEntity@ pOther ) + { + return CommonAddAmmo( pOther, MAX_CLIP, (INS2BASE::ShouldUseCustomAmmo) ? MAX_CARRY : INS2BASE::DF_MAX_CARRY_556, (INS2BASE::ShouldUseCustomAmmo) ? AMMO_TYPE : INS2BASE::DF_AMMO_556 ); + } +} + +string GetAmmoName() +{ + return "ammo_ins2mg34"; +} + +string GetName() +{ + return "weapon_ins2mg34"; +} + +void Register() +{ + g_CustomEntityFuncs.RegisterCustomEntity( "INS2_MG34::weapon_ins2mg34", GetName() ); // Register the weapon entity + g_CustomEntityFuncs.RegisterCustomEntity( "INS2_MG34::MG34_MAG", GetAmmoName() ); // Register the ammo entity + g_ItemRegistry.RegisterWeapon( GetName(), SPR_CAT, (INS2BASE::ShouldUseCustomAmmo) ? AMMO_TYPE : INS2BASE::DF_AMMO_556, "", GetAmmoName() ); // Register the weapon +} + +} \ No newline at end of file diff --git a/scripts/maps/ins2/lmg/weapon_ins2mg42.as b/scripts/maps/ins2/lmg/weapon_ins2mg42.as index fcb5e2d..ba657b4 100644 --- a/scripts/maps/ins2/lmg/weapon_ins2mg42.as +++ b/scripts/maps/ins2/lmg/weapon_ins2mg42.as @@ -84,6 +84,7 @@ uint SLOT = 7; uint POSITION = 15; float RPM_AIR = 1200; //Rounds per minute in air float RPM_WTR = 900; //Rounds per minute in water +uint AIM_FOV = 40; // Below 50 hides crosshair string AMMO_TYPE = "ins2_7.92x57mm"; class weapon_ins2mg42 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, INS2BASE::BipodWeaponBase @@ -293,7 +294,7 @@ class weapon_ins2mg42 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, INS2 case INS2BASE::IRON_OUT: { self.SendWeaponAnim( (WeaponBipodMode == INS2BASE::BIPOD_UNDEPLOYED) ? IRON_TO : BIPOD_IRON_TO, 0, GetBodygroup() ); - EffectsFOVON( 40 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/lmg/weapon_ins2pkm.as b/scripts/maps/ins2/lmg/weapon_ins2pkm.as new file mode 100644 index 0000000..916f97c --- /dev/null +++ b/scripts/maps/ins2/lmg/weapon_ins2pkm.as @@ -0,0 +1,437 @@ +// Insurgency's PKM +/* Model Credits +/ Model: Sasha, Ohnomelon, Chuc, Pharoahe Zephyrus, Norman The Loli Pirate (Edits, Belt, Bullets) +/ Textures: Sasha, Ohnomelon, Chuc, Pharoahe Zephyrus, Norman The Loli Pirate (Edits) +/ Animations: New World Interactive, D.N.I.O. 071 (Major Edits) +/ Sounds: New World Interactive +/ Sprites: D.N.I.O. 071 (Model Render), R4to0 (Vector), KernCore (.spr Compile) +/ Misc: Norman The Loli Pirate (World Model), D.N.I.O. 071 (Compile) +/ Script: KernCore, D.N.I.O. 071 +*/ + +#include "../base" + +namespace INS2_PKM +{ + +// Animations +enum INS2_PKM_Animations +{ + IDLE = 0, + DRAW_FIRST, + DRAW, + HOLSTER, + FIRE1, + FIRE2, + FIRE3, + DRYFIRE, + RELOAD, + RELOAD_EMPTY, + IRON_IDLE, + IRON_FIRE1, + IRON_FIRE2, + IRON_FIRE3, + IRON_DRYFIRE, + IRON_TO, + IRON_FROM, + BIPOD_IN, + BIPOD_OUT, + BIPOD_IDLE, + BIPOD_FIRE1, + BIPOD_FIRE2, + BIPOD_FIRE3, + BIPOD_DRYFIRE, + BIPOD_RELOAD, + BIPOD_RELOAD_EMPTY, + BIPOD_IRON_IDLE, + BIPOD_IRON_FIRE1, + BIPOD_IRON_FIRE2, + BIPOD_IRON_FIRE3, + BIPOD_IRON_DRYFIRE, + BIPOD_IRON_TO, + BIPOD_IRON_FROM, + BIPOD_IRON_IN, + BIPOD_IRON_OUT +}; + +enum PKM_Bodygroups +{ + ARMS = 0, + PKM_STUDIO0, + PKM_STUDIO1, + PKM_STUDIO2, + MAIN_BULLETS, + HELPER_BULLETS +}; + +// Models +string W_MODEL = "models/ins2/wpn/pkm/w_pkm.mdl"; +string V_MODEL = "models/ins2/wpn/pkm/v_pkm.mdl"; +string P_MODEL = "models/ins2/wpn/pkm/p_pkm.mdl"; +string A_MODEL = "models/ins2/ammo/mags2.mdl"; +int MAG_BDYGRP = 11; +// Sprites +string SPR_CAT = "ins2/lmg/"; //Weapon category used to get the sprite's location +// Sounds +string SHOOT_S = "ins2/wpn/pkm/shoot.ogg"; +string EMPTY_S = "ins2/wpn/pkm/empty.ogg"; +// Information +int MAX_CARRY = 1000; +int MAX_CLIP = 100; +int DEFAULT_GIVE = MAX_CLIP * 3; +int WEIGHT = 55; +int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY | ITEM_FLAG_ESSENTIAL; +uint DAMAGE = 30; +uint SLOT = 7; +uint POSITION = 14; +float RPM_AIR = 652; //Rounds per minute in air +float RPM_WTR = 522; //Rounds per minute in water +uint AIM_FOV = 40; // Below 50 hides crosshair +string AMMO_TYPE = "ins2_7.62x54mm"; + +class weapon_ins2pkm : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, INS2BASE::BipodWeaponBase +{ + private CBasePlayer@ m_pPlayer + { + get const { return cast( self.m_hPlayer.GetEntity() ); } + set { self.m_hPlayer = EHandle( @value ); } + } + private int m_iShell; + private bool m_WasDrawn, m_bInReload; + private int GetBodygroup() + { + if( self.m_iClip >= 13 ) + m_iCurBodyConfig = g_ModelFuncs.SetBodygroup( g_ModelFuncs.ModelIndex( V_MODEL ), m_iCurBodyConfig, MAIN_BULLETS, 13 ); + else if( self.m_iClip <= 0 ) + m_iCurBodyConfig = g_ModelFuncs.SetBodygroup( g_ModelFuncs.ModelIndex( V_MODEL ), m_iCurBodyConfig, MAIN_BULLETS, 0 ); + else + m_iCurBodyConfig = g_ModelFuncs.SetBodygroup( g_ModelFuncs.ModelIndex( V_MODEL ), m_iCurBodyConfig, MAIN_BULLETS, self.m_iClip ); + + return m_iCurBodyConfig; + } + private int SetBodygroup() + { + if( m_pPlayer.m_rgAmmo( self.m_iPrimaryAmmoType ) > 0 ) + { + if( m_pPlayer.m_rgAmmo( self.m_iPrimaryAmmoType ) >= 13 || (m_pPlayer.m_rgAmmo( self.m_iPrimaryAmmoType ) + self.m_iClip) >= 13 ) + m_iCurBodyConfig = g_ModelFuncs.SetBodygroup( g_ModelFuncs.ModelIndex( V_MODEL ), m_iCurBodyConfig, HELPER_BULLETS, 13 ); + else if( m_pPlayer.m_rgAmmo( self.m_iPrimaryAmmoType ) < 13 && (m_pPlayer.m_rgAmmo( self.m_iPrimaryAmmoType ) + self.m_iClip) < 13 ) + m_iCurBodyConfig = g_ModelFuncs.SetBodygroup( g_ModelFuncs.ModelIndex( V_MODEL ), m_iCurBodyConfig, HELPER_BULLETS, m_pPlayer.m_rgAmmo( self.m_iPrimaryAmmoType ) + self.m_iClip ); + } + + return m_iCurBodyConfig; + } + private array Sounds = { + "ins2/wpn/pkm/bdply.ogg", + "ins2/wpn/pkm/belt.ogg", + "ins2/wpn/pkm/bltbk.ogg", + "ins2/wpn/pkm/bltfd.ogg", + "ins2/wpn/pkm/brtrct.ogg", + "ins2/wpn/pkm/liddn.ogg", + "ins2/wpn/pkm/lidup.ogg", + "ins2/wpn/pkm/magin.ogg", + "ins2/wpn/pkm/magout.ogg", + "ins2/wpn/sks/magrel.ogg", + "ins2/wpn/uni/bground.ogg", + SHOOT_S, + EMPTY_S + }; + + void Spawn() + { + Precache(); + m_WasDrawn = false; + m_bInReload = false; + WeaponBipodMode = INS2BASE::BIPOD_UNDEPLOYED; + CommonSpawn( W_MODEL, DEFAULT_GIVE ); + } + + void Precache() + { + self.PrecacheCustomModels(); + g_Game.PrecacheModel( W_MODEL ); + g_Game.PrecacheModel( V_MODEL ); + g_Game.PrecacheModel( P_MODEL ); + g_Game.PrecacheModel( A_MODEL ); + m_iShell = g_Game.PrecacheModel( INS2BASE::BULLET_762x54 ); + + g_Game.PrecacheOther( GetAmmoName() ); + + INS2BASE::PrecacheSound( Sounds ); + INS2BASE::PrecacheSound( INS2BASE::DeployFirearmSounds ); + + g_Game.PrecacheGeneric( "sprites/" + SPR_CAT + self.pev.classname + ".txt" ); + g_Game.PrecacheGeneric( "events/" + "muzzle_ins2_MGs_big.txt" ); + CommonPrecache(); + } + + bool GetItemInfo( ItemInfo& out info ) + { + info.iMaxAmmo1 = (INS2BASE::ShouldUseCustomAmmo) ? MAX_CARRY : INS2BASE::DF_MAX_CARRY_556; + info.iAmmo1Drop = MAX_CLIP; + info.iMaxAmmo2 = -1; + info.iAmmo2Drop = -1; + info.iMaxClip = MAX_CLIP; + info.iSlot = SLOT; + info.iPosition = POSITION; + info.iId = g_ItemRegistry.GetIdForName( self.pev.classname ); + info.iFlags = FLAGS; + info.iWeight = WEIGHT; + + return true; + } + + bool AddToPlayer( CBasePlayer@ pPlayer ) + { + return CommonAddToPlayer( pPlayer ); + } + + bool PlayEmptySound() + { + return CommonPlayEmptySound( EMPTY_S ); + } + + bool Deploy() + { + PlayDeploySound( 3 ); + m_bInReload = false; + + SetThink( ThinkFunction( ShowBipodSpriteThink ) ); + self.pev.nextthink = g_Engine.time + 0.2; + + if( m_WasDrawn == false ) + { + m_WasDrawn = true; + return Deploy( V_MODEL, P_MODEL, DRAW_FIRST, "saw", GetBodygroup(), (119.0/37.0) ); + } + else + return Deploy( V_MODEL, P_MODEL, DRAW, "saw", GetBodygroup(), (42.0/37.0) ); + } + + void Holster( int skipLocal = 0 ) + { + m_bInReload = false; + WeaponBipodMode = INS2BASE::BIPOD_UNDEPLOYED; + CommonHolster(); + + BaseClass.Holster( skipLocal ); + } + + void PrimaryAttack() + { + if( self.m_iClip <= 0 ) + { + self.PlayEmptySound(); + if( WeaponBipodMode == INS2BASE::BIPOD_UNDEPLOYED ) + self.SendWeaponAnim( (WeaponADSMode == INS2BASE::IRON_IN) ? IRON_DRYFIRE : DRYFIRE, 0, GetBodygroup() ); + else if( WeaponBipodMode == INS2BASE::BIPOD_DEPLOYED ) + self.SendWeaponAnim( (WeaponADSMode == INS2BASE::IRON_IN) ? BIPOD_IRON_DRYFIRE : BIPOD_DRYFIRE, 0, GetBodygroup() ); + + self.m_flNextPrimaryAttack = WeaponTimeBase() + 0.3f; + return; + } + + self.m_flNextPrimaryAttack = self.m_flNextSecondaryAttack = (m_pPlayer.pev.waterlevel == WATERLEVEL_HEAD) ? WeaponTimeBase() + GetFireRate( RPM_WTR ) : WeaponTimeBase() + GetFireRate( RPM_AIR ); + self.m_flTimeWeaponIdle = WeaponTimeBase() + 1.5f; + + ShootWeapon( SHOOT_S, 1, VecModAcc( VECTOR_CONE_2DEGREES, 1.4f, 0.5f, 1.05f ), (m_pPlayer.pev.waterlevel == WATERLEVEL_HEAD) ? 1024 : 8192, DAMAGE, true ); + + m_pPlayer.m_iWeaponVolume = LOUD_GUN_VOLUME; + m_pPlayer.m_iWeaponFlash = BRIGHT_GUN_FLASH; + + if( WeaponADSMode != INS2BASE::IRON_IN && WeaponBipodMode == INS2BASE::BIPOD_UNDEPLOYED ) + { + if( !( m_pPlayer.pev.flags & FL_ONGROUND != 0 ) ) + { + KickBack( 2.0, 0.65, 0.45, 0.125, 9.0, 3.5, 8 ); + } + else if( m_pPlayer.pev.velocity.Length2D() > 0 ) + { + KickBack( 1.2, 0.5, 0.3, 0.06, 8.0, 3.0, 8 ); + } + else if( m_pPlayer.pev.flags & FL_DUCKING != 0 ) + { + KickBack( 0.95, 0.325, 0.25, 0.025, 4.5, 2.5, 9 ); + } + else + { + KickBack( 1.05, 0.35, 0.3, 0.03, 5.75, 3.0, 9 ); + } + } + else + { + PunchAngle( Vector( Math.RandomFloat( -2.15f, -2.85f ), (Math.RandomLong( 0, 1 ) < 0.5) ? -0.6f : 0.9f, Math.RandomFloat( -0.5, 0.5 ) ) ); + } + + if( WeaponBipodMode == INS2BASE::BIPOD_UNDEPLOYED ) + { + if( WeaponADSMode == INS2BASE::IRON_IN ) + self.SendWeaponAnim( Math.RandomLong( IRON_FIRE1, IRON_FIRE3 ), 0, GetBodygroup() ); + else + self.SendWeaponAnim( Math.RandomLong( FIRE1, FIRE3 ), 0, GetBodygroup() ); + + ShellEject( m_pPlayer, m_iShell, (WeaponADSMode != INS2BASE::IRON_IN) ? Vector( 18, 4.3, -10 ) : Vector( 26, -5, -7 ), true ); + } + else if( WeaponBipodMode == INS2BASE::BIPOD_DEPLOYED ) + { + if( WeaponADSMode == INS2BASE::IRON_IN ) + self.SendWeaponAnim( Math.RandomLong( BIPOD_IRON_FIRE1, BIPOD_IRON_FIRE3 ), 0, GetBodygroup() ); + else + self.SendWeaponAnim( Math.RandomLong( BIPOD_FIRE1, BIPOD_FIRE3 ), 0, GetBodygroup() ); + + ShellEject( m_pPlayer, m_iShell, (WeaponADSMode != INS2BASE::IRON_IN) ? Vector( 20, 4.2, -10 ) : Vector( 26, -5, -7 ), true ); + } + } + + void SecondaryAttack() + { + self.m_flTimeWeaponIdle = self.m_flNextSecondaryAttack = WeaponTimeBase() + 0.2; + self.m_flNextPrimaryAttack = WeaponTimeBase() + 0.13; + + switch( WeaponADSMode ) + { + case INS2BASE::IRON_OUT: + { + self.SendWeaponAnim( (WeaponBipodMode == INS2BASE::BIPOD_UNDEPLOYED) ? IRON_TO : BIPOD_IRON_TO, 0, GetBodygroup() ); + EffectsFOVON( AIM_FOV ); + break; + } + case INS2BASE::IRON_IN: + { + self.SendWeaponAnim( (WeaponBipodMode == INS2BASE::BIPOD_UNDEPLOYED) ? IRON_FROM : BIPOD_IRON_FROM, 0, GetBodygroup() ); + EffectsFOVOFF(); + break; + } + } + } + + void TertiaryAttack() + { + if( WeaponADSMode == INS2BASE::IRON_IN ) + DeployBipod( BIPOD_IRON_IN, BIPOD_IRON_OUT, GetBodygroup(), (68.0/36.0), (80.0/36.0) ); + else + DeployBipod( BIPOD_IN, BIPOD_OUT, GetBodygroup(), (68.0/36.0), (80.0/36.0) ); + } + + void ItemPostFrame() + { + BaseClass.ItemPostFrame(); + } + + void ItemPreFrame() + { + if( m_reloadTimer < g_Engine.time && canReload ) + self.Reload(); + + if( m_bInReload ) + m_bInReload = false; + + BaseClass.ItemPreFrame(); + } + + void Reload() + { + if( self.m_iClip == MAX_CLIP || m_pPlayer.m_rgAmmo( self.m_iPrimaryAmmoType ) <= 0 ) + return; + + if( WeaponADSMode == INS2BASE::IRON_IN ) + { + self.SendWeaponAnim( (WeaponBipodMode == INS2BASE::BIPOD_UNDEPLOYED) ? IRON_FROM : BIPOD_IRON_FROM, 0, GetBodygroup() ); + m_reloadTimer = g_Engine.time + 0.16; + m_pPlayer.m_flNextAttack = 0.16; + canReload = true; + EffectsFOVOFF(); + } + + if( m_reloadTimer < g_Engine.time ) + { + m_bInReload = true; + if( WeaponBipodMode == INS2BASE::BIPOD_UNDEPLOYED ) + { + if( self.m_iClip == 0 ) + { + Reload( MAX_CLIP, RELOAD_EMPTY, (201.0/18.75), SetBodygroup() ); + + } + else + { + Reload( MAX_CLIP, RELOAD, (169.0/18.75), SetBodygroup() ); + } + } + else if( WeaponBipodMode == INS2BASE::BIPOD_DEPLOYED ) + { + if( self.m_iClip == 0 ) + Reload( MAX_CLIP, BIPOD_RELOAD_EMPTY, (201.0/18.75), SetBodygroup() ); + else + Reload( MAX_CLIP, BIPOD_RELOAD, (169.0/18.75), SetBodygroup() ); + } + canReload = false; + } + + BaseClass.Reload(); + } + + void WeaponIdle() + { + if( self.m_flNextPrimaryAttack < g_Engine.time ) + m_iShotsFired = 0; + + self.ResetEmptySound(); + m_pPlayer.GetAutoaimVector( AUTOAIM_10DEGREES ); + + if( self.m_flTimeWeaponIdle > WeaponTimeBase() ) + return; + + if( WeaponBipodMode == INS2BASE::BIPOD_UNDEPLOYED ) + { + self.SendWeaponAnim( (WeaponADSMode == INS2BASE::IRON_IN) ? IRON_IDLE : IDLE, 0, GetBodygroup() ); + } + else if( WeaponBipodMode == INS2BASE::BIPOD_DEPLOYED ) + { + self.SendWeaponAnim( (WeaponADSMode == INS2BASE::IRON_IN) ? BIPOD_IRON_IDLE : BIPOD_IDLE, 0, GetBodygroup() ); + } + + self.m_flTimeWeaponIdle = WeaponTimeBase() + g_PlayerFuncs.SharedRandomFloat( m_pPlayer.random_seed, 5, 7 ); + } +} + +class PKM_MAG : ScriptBasePlayerAmmoEntity, INS2BASE::AmmoBase +{ + void Spawn() + { + Precache(); + g_EntityFuncs.SetModel( self, A_MODEL ); + self.pev.body = MAG_BDYGRP; + BaseClass.Spawn(); + } + + void Precache() + { + g_Game.PrecacheModel( A_MODEL ); + CommonPrecache(); + } + + bool AddAmmo( CBaseEntity@ pOther ) + { + return CommonAddAmmo( pOther, MAX_CLIP, (INS2BASE::ShouldUseCustomAmmo) ? MAX_CARRY : INS2BASE::DF_MAX_CARRY_556, (INS2BASE::ShouldUseCustomAmmo) ? AMMO_TYPE : INS2BASE::DF_AMMO_556 ); + } +} + +string GetAmmoName() +{ + return "ammo_ins2pkm"; +} + +string GetName() +{ + return "weapon_ins2pkm"; +} + +void Register() +{ + g_CustomEntityFuncs.RegisterCustomEntity( "INS2_PKM::weapon_ins2pkm", GetName() ); // Register the weapon entity + g_CustomEntityFuncs.RegisterCustomEntity( "INS2_PKM::PKM_MAG", GetAmmoName() ); // Register the ammo entity + g_ItemRegistry.RegisterWeapon( GetName(), SPR_CAT, (INS2BASE::ShouldUseCustomAmmo) ? AMMO_TYPE : INS2BASE::DF_AMMO_556, "", GetAmmoName() ); // Register the weapon +} + +} \ No newline at end of file diff --git a/scripts/maps/ins2/lmg/weapon_ins2rpk.as b/scripts/maps/ins2/lmg/weapon_ins2rpk.as index faf7b9b..57b5716 100644 --- a/scripts/maps/ins2/lmg/weapon_ins2rpk.as +++ b/scripts/maps/ins2/lmg/weapon_ins2rpk.as @@ -73,9 +73,10 @@ int WEIGHT = 50; int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY | ITEM_FLAG_ESSENTIAL; uint DAMAGE = 26; uint SLOT = 7; -uint POSITION = 12; +uint POSITION = 11; float RPM_AIR = 600; //Rounds per minute in air float RPM_WTR = 450; //Rounds per minute in water +uint AIM_FOV = 40; // Below 50 hides crosshair string AMMO_TYPE = "ins2_7.62x39mm"; class weapon_ins2rpk : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, INS2BASE::BipodWeaponBase @@ -262,7 +263,7 @@ class weapon_ins2rpk : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, INS2B case INS2BASE::IRON_OUT: { self.SendWeaponAnim( (WeaponBipodMode == INS2BASE::BIPOD_UNDEPLOYED) ? IRON_TO : BIPOD_IRON_TO, 0, GetBodygroup() ); - EffectsFOVON( 40 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/maps/of_utbm.as b/scripts/maps/ins2/maps/of_utbm.as new file mode 100644 index 0000000..5a8f3b7 --- /dev/null +++ b/scripts/maps/ins2/maps/of_utbm.as @@ -0,0 +1,359 @@ +// Replacement Script with Insurgency Weapons +// Replace the original map script with this one in each map .cfg that belongs to the UTBM series: map_script ins2/maps/of_utbm +// Author: KernCore, logic from Nero + +#include "../../point_checkpoint" +#include "../../opfor/nvision" +#include "../../opfor/weapon_knife" + +//Ins2 weapons +#include "../weapons" + +/* +ammo_357 +ammo_556 +ammo_556clip +ammo_762 +ammo_9mmAR +ammo_9mmbox +ammo_9mmclip +ammo_ARgrenades +ammo_buckshot +ammo_gaussclip +ammo_rpgclip +ammo_spore +weapon_357 +weapon_9mmAR +weapon_9mmhandgun +weapon_displacer +weapon_eagle +weapon_gauss +weapon_glock +weapon_grapple +weapon_handgrenade +weapon_knife +weapon_m16 +weapon_m249 +weapon_medkit +weapon_minigun +weapon_mp5 +weapon_pipewrench +weapon_rpg +weapon_satchel +weapon_saw +weapon_shockrifle +weapon_shotgun +weapon_snark +weapon_sniperrifle +weapon_sporelauncher +weapon_tripmine +weapon_uziakimbo +*/ + +namespace UNDERTHEBLACKMOON +{ + +array g_CrowbarCandidates = { + INS2_KABAR::GetName(), + INS2_KNUCKLES::GetName() +}; +const int iCrowbChooser = Math.RandomLong( 0, g_CrowbarCandidates.length() - 1 ); + +array> g_9mmHandGunCandidates = { + { INS2_M9BERETTA::GetName(), INS2_M9BERETTA::GetAmmoName() }, + { INS2_GLOCK17::GetName(), INS2_GLOCK17::GetAmmoName() } +}; +const int i9mmChooser = Math.RandomLong( 0, g_9mmHandGunCandidates.length() - 1 ); + +array> g_RevolverCandidates = { + { INS2_PYTHON::GetName(), INS2_PYTHON::GetAmmoName() }, + { INS2_M29::GetName(), INS2_M29::GetAmmoName() } +}; +const int iRevChooser = Math.RandomLong( 0, g_RevolverCandidates.length() - 1 ); + +array> g_DeagleCandidates = { + { INS2_DEAGLE::GetName(), INS2_DEAGLE::GetAmmoName() }, + { INS2_USP::GetName(), INS2_USP::GetAmmoName() } +}; +const int iDeagChooser = Math.RandomLong( 0, g_DeagleCandidates.length() - 1 ); + +array g_UziAkimboCandidates = { + INS2_MP7::GetName() +}; +const int iUziAkimboChooser = Math.RandomLong( 0, g_UziAkimboCandidates.length() - 1 ); + +array> g_9mmARCandidates = { + { INS2_UMP45::GetName(), INS2_UMP45::GetAmmoName() }, + { INS2_MP5K::GetName(), INS2_MP5K::GetAmmoName() } +}; +const int iARChooser = Math.RandomLong( 0, g_9mmARCandidates.length() - 1 ); + +array> g_ShotgunCandidates = { + { INS2_M590::GetName(), INS2_M590::GetAmmoName() }, + { INS2_M1014::GetName(), INS2_M1014::GetAmmoName() } +}; +const int iShotChooser = Math.RandomLong( 0, g_ShotgunCandidates.length() - 1 ); + +array> g_M16Candidates = { + { INS2_M16A4::GetName(), INS2_M16A4::GetAmmoName(), INS2_M16A4::GetGLName() }, + { INS2_L85A2::GetName(), INS2_L85A2::GetAmmoName(), INS2_L85A2::GetGLName() } +}; +const int iM16Chooser = Math.RandomLong( 0, g_M16Candidates.length() - 1 ); + +array> g_RpgCandidates = { + { INS2_AT4::GetName(), INS2_AT4::GetName() } +}; +const int iRpgChooser = Math.RandomLong( 0, g_RpgCandidates.length() - 1 ); + +array g_GrenadeCandidates = { + INS2_MK2GRENADE::GetName() +}; +const int iGrenChooser = Math.RandomLong( 0, g_GrenadeCandidates.length() - 1 ); + +array g_SatchelCandidates = { + INS2_LAW::GetName() +}; +const int iSatchChooser = Math.RandomLong( 0, g_SatchelCandidates.length() - 1 ); + +array> g_SniperCandidates = { + { INS2_M40A1::GetName(), INS2_M40A1::GetAmmoName() } +}; +const int iSnipChooser = Math.RandomLong( 0, g_SniperCandidates.length() - 1 ); + +array> g_M249Candidates = { + { INS2_M60::GetName(), INS2_M60::GetAmmoName() } +}; +const int iM249Chooser = Math.RandomLong( 0, g_M249Candidates.length() - 1 ); + +array> g_SporeLauncherCandidates = { + { INS2_M79::GetName(), INS2_M79::GetAmmoName() } +}; +const int iSporeChooser = Math.RandomLong( 0, g_SporeLauncherCandidates.length() - 1 ); + +array> g_ShockRifleCandidates = { + { INS2_M4A1::GetName(), INS2_M4A1::GetAmmoName() }, + { INS2_MK18::GetName(), INS2_MK18::GetAmmoName() }, + { INS2_F2000::GetName(), INS2_F2000::GetAmmoName() } +}; +const int iShockChooser = Math.RandomLong( 0, g_ShockRifleCandidates.length() - 1 ); + +array g_MinigunCandidates = { + INS2_M249::GetName() +}; +const int iMinigunChooser = Math.RandomLong( 0, g_MinigunCandidates.length() - 1 ); + +array g_Ins2ItemMappings = { + //knife + ItemMapping( "weapon_knife", g_CrowbarCandidates[iCrowbChooser] ), + //crowbar + ItemMapping( "weapon_crowbar", g_CrowbarCandidates[iCrowbChooser] ), + //pipewrench + ItemMapping( "weapon_pipewrench", INS2_KUKRI::GetName() ), + //glock + ItemMapping( "weapon_9mmhandgun", g_9mmHandGunCandidates[i9mmChooser][0] ), ItemMapping( "weapon_glock", g_9mmHandGunCandidates[i9mmChooser][0] ), + ItemMapping( "ammo_9mmclip", g_9mmHandGunCandidates[i9mmChooser][1] ), ItemMapping( "ammo_glockclip", g_9mmHandGunCandidates[i9mmChooser][1] ), + //357 + ItemMapping( "weapon_357", g_RevolverCandidates[iRevChooser][0] ), ItemMapping( "weapon_python", g_RevolverCandidates[iRevChooser][0] ), + //eagle + ItemMapping( "weapon_eagle", g_DeagleCandidates[iDeagChooser][0] ), //The deagle doesn't have a ammo entity ¯\_(ツ)_/¯ + ItemMapping( "ammo_357", g_DeagleCandidates[iDeagChooser][1] ), + //uziakimbo + ItemMapping( "weapon_uziakimbo", g_UziAkimboCandidates[iUziAkimboChooser] ), + //mp5 + ItemMapping( "weapon_9mmAR", g_9mmARCandidates[iARChooser][0] ), ItemMapping( "weapon_9mmar", g_9mmARCandidates[iARChooser][0] ), ItemMapping( "weapon_mp5", g_9mmARCandidates[iARChooser][0] ), + ItemMapping( "ammo_9mmAR", g_9mmARCandidates[iARChooser][1] ), ItemMapping( "ammo_mp5clip", g_9mmARCandidates[iARChooser][1] ), ItemMapping( "ammo_9mmbox", g_9mmARCandidates[iARChooser][1] ), + //shotgun + ItemMapping( "weapon_shotgun", g_ShotgunCandidates[iShotChooser][0] ), + ItemMapping( "ammo_buckshot", g_ShotgunCandidates[iShotChooser][1] ), + //m16 + ItemMapping( "weapon_m16", g_M16Candidates[iM16Chooser][0] ), + ItemMapping( "ammo_556clip", g_M16Candidates[iM16Chooser][1] ), + ItemMapping( "ammo_ARgrenades", g_M16Candidates[iM16Chooser][2] ), ItemMapping( "ammo_mp5grenades", g_M16Candidates[iM16Chooser][2] ), + //rpg + ItemMapping( "weapon_rpg", g_RpgCandidates[iRpgChooser][0] ), + ItemMapping( "ammo_rpgclip", g_RpgCandidates[iRpgChooser][1] ), + //gauss + //handgrenade + ItemMapping( "weapon_handgrenade", g_GrenadeCandidates[iGrenChooser] ), + //satchel + ItemMapping( "weapon_satchel", g_SatchelCandidates[iSatchChooser] ), + //tripmine + ItemMapping( "weapon_tripmine", g_SatchelCandidates[iSatchChooser] ), + //snark + //sniperrifle + ItemMapping( "weapon_sniperrifle", g_SniperCandidates[iSnipChooser][0] ), + ItemMapping( "ammo_762", g_SniperCandidates[iSnipChooser][1] ), + //m249 + ItemMapping( "weapon_m249", g_M249Candidates[iM249Chooser][0] ), ItemMapping( "weapon_saw", g_M249Candidates[iM249Chooser][0] ), + ItemMapping( "ammo_556", g_M249Candidates[iM249Chooser][1] ), + //sporelauncher + ItemMapping( "weapon_sporelauncher", g_SporeLauncherCandidates[iSporeChooser][0] ), + ItemMapping( "ammo_spore", g_SporeLauncherCandidates[iSporeChooser][1] ), ItemMapping( "ammo_sporeclip", g_SporeLauncherCandidates[iSporeChooser][1] ), + //displacer + //shockrifle + ItemMapping( "weapon_shockrifle", g_ShockRifleCandidates[iShockChooser][0] ), + ItemMapping( "monster_shockroach", g_ShockRifleCandidates[iShockChooser][1] ), + //minigun + ItemMapping( "weapon_minigun", g_MinigunCandidates[iMinigunChooser] ) +}; + +//Using Materialize hook for that one guy that thought it would be a good idea to spawn entities using squadmaker +HookReturnCode PickupObjectMaterialize( CBaseEntity@ pEntity ) +{ + Vector origin, angles; + string targetname, target, netname; + + for( uint j = 0; j < g_Ins2ItemMappings.length(); ++j ) + { + if( pEntity.pev.ClassNameIs( g_Ins2ItemMappings[j].get_From() ) ) + { + origin = pEntity.pev.origin; + angles = pEntity.pev.angles; + targetname = pEntity.pev.targetname; + target = pEntity.pev.target; + netname = pEntity.pev.netname; + + g_EntityFuncs.Remove( pEntity ); + CBaseEntity@ pNewEnt = g_EntityFuncs.Create( g_Ins2ItemMappings[j].get_To(), origin, angles, true ); + + if( targetname != "" ) + g_EntityFuncs.DispatchKeyValue( pNewEnt.edict(), "targetname", targetname ); + + if( target != "" ) + g_EntityFuncs.DispatchKeyValue( pNewEnt.edict(), "target", target ); + + if( netname != "" ) + g_EntityFuncs.DispatchKeyValue( pNewEnt.edict(), "netname", netname ); + + g_EntityFuncs.DispatchSpawn( pNewEnt.edict() ); + } + } + return HOOK_HANDLED; +} + +} + +void MapInit() +{ + // Enable SC CheckPoint Support for Survival Mode + RegisterPointCheckPointEntity(); + // Register original Opposing Force knife weapon + RegisterKnife(); + // Enable Nightvision Support + NightVision::Enable(); + // Global CVars + g_EngineFuncs.CVarSetFloat( "mp_hevsuit_voice", 0 ); + + if( g_Engine.mapname == "of_utbm_7" || g_Engine.mapname == "of_utbm_8" || g_Engine.mapname == "of_utbm_9" ) + Precache(); + + INS2_KABAR::POSITION = 22; + INS2_KABAR::Register(); + INS2_KNUCKLES::POSITION = 21; + INS2_KNUCKLES::Register(); + INS2_KUKRI::POSITION = 23; + INS2_KUKRI::Register(); + INS2_M9BERETTA::Register(); + INS2_GLOCK17::Register(); + INS2_PYTHON::Register(); + INS2_M29::Register(); + INS2_DEAGLE::Register(); + INS2_USP::Register(); + INS2_MP7::Register(); + INS2_UMP45::Register(); + INS2_MP5K::Register(); + INS2_M590::Register(); + INS2_M1014::Register(); + INS2_M16A4::Register(); + INS2_L85A2::Register(); + INS2_AT4::Register(); + INS2_MK2GRENADE::Register(); + INS2_LAW::Register(); + INS2_M40A1::Register(); + INS2_M60::Register(); + INS2_M249::Register(); + INS2_M79::Register(); + INS2_M4A1::Register(); + INS2_MK18::Register(); + INS2_F2000::Register(); + + + // Initialize classic mode (item mapping only) + g_ClassicMode.SetItemMappings( @UNDERTHEBLACKMOON::g_Ins2ItemMappings ); + g_ClassicMode.ForceItemRemap( true ); + + g_Hooks.RegisterHook( Hooks::PickupObject::Materialize, @UNDERTHEBLACKMOON::PickupObjectMaterialize ); +} + +void MapStart() +{ + //KernCore: Removing that pesky ammo_spore entity + CBaseEntity@ pEntity = null; + Vector origin, angles; + string targetname; + + for( int i = 0; ( @pEntity = @g_EntityFuncs.FindEntityByClassname( pEntity, "ammo_spore" ) ) != null; i++ ) + { + origin = pEntity.pev.origin; + targetname = pEntity.pev.targetname; + angles = pEntity.pev.angles; + + g_EntityFuncs.Remove( pEntity ); + CBaseEntity@ pNewEnt1 = g_EntityFuncs.Create( UNDERTHEBLACKMOON::g_SporeLauncherCandidates[UNDERTHEBLACKMOON::iSporeChooser][1], origin, angles, true ); + if( targetname != "" ) + g_EntityFuncs.DispatchKeyValue( pNewEnt1.edict(), "targetname", targetname ); + + g_EntityFuncs.DispatchSpawn( pNewEnt1.edict() ); + } + //KernCore: End + + g_EngineFuncs.ServerPrint( "Opposing Force: Under the Black Moon Version 1.6 - Download this campaign at scmapdb.com\n" ); + + if( g_Engine.mapname == "of_utbm_7" || g_Engine.mapname == "of_utbm_8" || g_Engine.mapname == "of_utbm_9" ) + InitXenReturn(); +} + +void Precache() +{ + g_Game.PrecacheModel( "sprites/exit1.spr" ); + g_Game.PrecacheGeneric( "sprites/exit1.spr" ); + g_SoundSystem.PrecacheSound( "weapons/displacer_self.wav" ); +} + +void InitXenReturn() +{ + CBaseEntity@ pXenReturnDest; + + dictionary xenfx = + { + { "targetname", "xen_return_spawnfx" }, + { "m_iszScriptFunctionName", "XenReturnFx" }, + { "m_iMode", "1" } + }; + g_EntityFuncs.CreateEntity( "trigger_script", xenfx, true ); + + while( ( @pXenReturnDest = g_EntityFuncs.FindEntityByTargetname( pXenReturnDest, "xen_return_dest*") ) !is null ) + { + if( pXenReturnDest.GetClassname() != "info_teleport_destination" ) + continue; + + if( pXenReturnDest.pev.SpawnFlagBitSet( 32 ) ) + continue; + + pXenReturnDest.pev.spawnflags |= 32; + pXenReturnDest.pev.target = "xen_return_spawnfx"; + } +} + +void XenReturnFx(CBaseEntity@ pActivator, CBaseEntity@ pCaller, USE_TYPE useType, float flValue) +{ + if( pActivator is null ) + return; + + CSprite@ pSprite = g_EntityFuncs.CreateSprite( "sprites/exit1.spr", pActivator.GetOrigin(), true, 0.0f ); + pSprite.SetScale( 1 ); + pSprite.SetTransparency( kRenderTransAdd, 0, 0, 0, 200, kRenderFxNoDissipation ); + pSprite.AnimateAndDie( 18 ); + + g_SoundSystem.EmitSound( pActivator.edict(), CHAN_ITEM, "weapons/displacer_self.wav", 1.0f, ATTN_NORM ); +} \ No newline at end of file diff --git a/scripts/maps/ins2/maps/sc_royals.as b/scripts/maps/ins2/maps/sc_royals.as new file mode 100644 index 0000000..4a3b4bd --- /dev/null +++ b/scripts/maps/ins2/maps/sc_royals.as @@ -0,0 +1,372 @@ +// Replacement Script with Insurgency Weapons +// Put this in the map's .cfg file: map_script ins2/maps/sc_royals +// Author: KernCore, original replacement logic from Nero + +//Insurgency weapons +#include "../weapons" + +/* +ammo_357 +ammo_556 +ammo_9mmAR +ammo_9mmbox +ammo_ARgrenades +ammo_buckshot +ammo_crossbow +ammo_gaussclip +ammo_rpgclip +ammo_spore +weapon_crossbow * +weapon_crowbar * +weapon_eagle * +weapon_gauss +weapon_glock * +weapon_grapple +weapon_handgrenade * +weapon_m16 * +weapon_m249 * +weapon_rpg * +weapon_satchel * +weapon_shotgun * +weapon_snark * +weapon_sporelauncher * +weapon_tripmine * +weapon_uziakimbo * +*/ + +namespace SC_ROYALS +{ + +array g_CrowbarCandidates = { + INS2_KABAR::GetName(), + INS2_KNUCKLES::GetName() +}; +const int iCrowbChooser = Math.RandomLong( 0, g_CrowbarCandidates.length() - 1 ); + +array> g_9mmHandGunCandidates = { + { INS2_M1911::GetName(), INS2_M1911::GetAmmoName() }, + { INS2_MAKAROV::GetName(), INS2_MAKAROV::GetAmmoName() }, + { INS2_C96::GetName(), INS2_C96::GetAmmoName() } +}; +const int i9mmChooser = Math.RandomLong( 0, g_9mmHandGunCandidates.length() - 1 ); + +array> g_DeagleCandidates = { + { INS2_M29::GetName(), INS2_M29::GetAmmoName() }, + { INS2_PYTHON::GetName(), INS2_PYTHON::GetAmmoName() }, + { INS2_WEBLEY::GetName(), INS2_WEBLEY::GetAmmoName() } +}; +const int iDeagChooser = Math.RandomLong( 0, g_DeagleCandidates.length() - 1 ); + +array> g_UziAkimboCandidates = { + { INS2_MP40::GetName(), INS2_MP40::GetAmmoName() }, + { INS2_MP18::GetName(), INS2_MP18::GetAmmoName() }, + { INS2_STERLING::GetName(), INS2_STERLING::GetAmmoName() } +}; +const int iUziAkimboChooser = Math.RandomLong( 0, g_UziAkimboCandidates.length() - 1 ); + +array> g_ShotgunCandidates = { + { INS2_M590::GetName(), INS2_M590::GetAmmoName() }, + { INS2_COACH::GetName(), INS2_COACH::GetAmmoName() }, + { INS2_ITHACA::GetName(), INS2_ITHACA::GetAmmoName() } +}; +const int iShotChooser = Math.RandomLong( 0, g_ShotgunCandidates.length() - 1 ); + +array> g_M16Candidates = { + { INS2_AKM::GetName(), INS2_AKM::GetAmmoName(), INS2_AKM::GetGLName() }, + { INS2_L85A2::GetName(), INS2_L85A2::GetAmmoName(), INS2_L85A2::GetGLName() } +}; +const int iM16Chooser = Math.RandomLong( 0, g_M16Candidates.length() - 1 ); + +array> g_CrossBowCandidates = { + { INS2_M1GARAND::GetName(), INS2_M1GARAND::GetAmmoName() }, + { INS2_K98K::GetName(), INS2_K98K::GetAmmoName() }, + { INS2_ENFIELD::GetName(), INS2_ENFIELD::GetAmmoName() } +}; +const int iCrossChooser = Math.RandomLong( 0, g_CrossBowCandidates.length() - 1 ); + +array> g_RpgCandidates = { + { INS2_RPG7::GetName(), INS2_RPG7::GetAmmoName() }, + { INS2_PZSCHRECK::GetName(), INS2_PZSCHRECK::GetAmmoName() } +}; +const int iRpgChooser = Math.RandomLong( 0, g_RpgCandidates.length() - 1 ); + +array> g_GaussCandidates = { + { INS2_FNFAL::GetName(), INS2_FNFAL::GetAmmoName() }, + { INS2_G3A3::GetName(), INS2_G3A3::GetAmmoName() }, + { INS2_FG42::GetName(), INS2_FG42::GetAmmoName() } +}; +const int iGaussChooser = Math.RandomLong( 0, g_GaussCandidates.length() - 1 ); + +array g_GrenadeCandidates = { + INS2_MK2GRENADE::GetName(), + INS2_M24GRENADE::GetName() +}; +const int iGrenChooser = Math.RandomLong( 0, g_GrenadeCandidates.length() - 1 ); + +array g_SatchelCandidates = { + INS2_LAW::GetName() +}; +const int iSatChooser = Math.RandomLong( 0, g_SatchelCandidates.length() - 1 ); + +array g_SnarkCandidates = { + INS2_AKS74U::GetName(), + INS2_AK74::GetName(), + INS2_M4A1::GetName(), + INS2_GALIL::GetName(), + INS2_STG44::GetName(), +}; +const int iSnarkChooser = Math.RandomLong( 0, g_SnarkCandidates.length() - 1 ); + +array> g_M249Candidates = { + { INS2_LEWIS::GetName(), INS2_LEWIS::GetAmmoName() }, + { INS2_M60::GetName(), INS2_M60::GetAmmoName() }, + { INS2_RPK::GetName(), INS2_RPK::GetAmmoName() } +}; +const int iM249Chooser = Math.RandomLong( 0, g_M249Candidates.length() - 1 ); + +array> g_SporeLauncherCandidates = { + { INS2_SKS::GetName(), INS2_SKS::GetAmmoName() }, + { INS2_M1A1PARA::GetName(), INS2_M1A1PARA::GetAmmoName() }, + { INS2_C96CARBINE::GetName(), INS2_C96CARBINE::GetAmmoName() } +}; +const int iSporeChooser = Math.RandomLong( 0, g_SporeLauncherCandidates.length() - 1 ); + +array> g_ShockRifleCandidates = { + { INS2_SVD::GetName(), INS2_SVD::GetAmmoName() }, + { INS2_G43::GetName(), INS2_G43::GetAmmoName() }, + { INS2_MOSIN::GetName(), INS2_MOSIN::GetAmmoName() } +}; +const int iShockChooser = Math.RandomLong( 0, g_ShockRifleCandidates.length() - 1 ); + +array g_MinigunCandidates = { + INS2_MG42::GetName() +}; +const int iMinigunChooser = Math.RandomLong( 0, g_MinigunCandidates.length() - 1 ); + +array g_Ins2ItemMappings = { + //crowbar + ItemMapping( "weapon_crowbar", g_CrowbarCandidates[iCrowbChooser] ), + //glock + ItemMapping( "weapon_9mmhandgun", g_9mmHandGunCandidates[i9mmChooser][0] ), ItemMapping( "weapon_glock", g_9mmHandGunCandidates[i9mmChooser][0] ), + ItemMapping( "ammo_9mmAR", g_9mmHandGunCandidates[i9mmChooser][1] ), ItemMapping( "ammo_9mmbox", g_9mmHandGunCandidates[i9mmChooser][1] ), + //eagle + ItemMapping( "weapon_eagle", g_DeagleCandidates[iDeagChooser][0] ), //The deagle doesn't have a ammo entity ¯\_(ツ)_/¯ + ItemMapping( "ammo_357", g_DeagleCandidates[iDeagChooser][1] ), + //uziakimbo + ItemMapping( "weapon_uziakimbo", g_UziAkimboCandidates[iUziAkimboChooser][0] ), ItemMapping( "weapon_uzi", g_UziAkimboCandidates[iUziAkimboChooser][0] ), + ItemMapping( "ammo_uziclip", g_UziAkimboCandidates[iUziAkimboChooser][1] ), + //shotgun + ItemMapping( "weapon_shotgun", g_ShotgunCandidates[iShotChooser][0] ), + ItemMapping( "ammo_buckshot", g_ShotgunCandidates[iShotChooser][1] ), + //m16 + ItemMapping( "weapon_m16", g_M16Candidates[iM16Chooser][0] ), + ItemMapping( "ammo_556clip", g_M16Candidates[iM16Chooser][1] ), + ItemMapping( "ammo_ARgrenades", g_M16Candidates[iM16Chooser][2] ), ItemMapping( "ammo_mp5grenades", g_M16Candidates[iM16Chooser][2] ), + //crossbow + ItemMapping( "weapon_crossbow", g_CrossBowCandidates[iCrossChooser][0] ), + ItemMapping( "ammo_crossbow", g_CrossBowCandidates[iCrossChooser][1] ), + //rpg + ItemMapping( "weapon_rpg", g_RpgCandidates[iRpgChooser][0] ), + ItemMapping( "ammo_rpgclip", g_RpgCandidates[iRpgChooser][1] ), + //gauss + ItemMapping( "weapon_gauss", g_GaussCandidates[iGaussChooser][0] ), + ItemMapping( "ammo_gaussclip", g_GaussCandidates[iGaussChooser][1] ), + //handgrenade + ItemMapping( "weapon_handgrenade", g_GrenadeCandidates[iGrenChooser] ), + //satchel + ItemMapping( "weapon_satchel", g_SatchelCandidates[iSatChooser] ), + //tripmine + ItemMapping( "weapon_tripmine", g_SatchelCandidates[iSatChooser] ), + //snark + ItemMapping( "weapon_snark", g_SnarkCandidates[iSnarkChooser] ), + //m249 + ItemMapping( "weapon_m249", g_M249Candidates[iM249Chooser][0] ), ItemMapping( "weapon_saw", g_M249Candidates[iM249Chooser][0] ), + ItemMapping( "ammo_556", g_M249Candidates[iM249Chooser][1] ), + //sporelauncher + ItemMapping( "weapon_sporelauncher", g_SporeLauncherCandidates[iSporeChooser][0] ), + ItemMapping( "ammo_spore", g_SporeLauncherCandidates[iSporeChooser][1] ), ItemMapping( "ammo_sporeclip", g_SporeLauncherCandidates[iSporeChooser][1] ), + //shockrifle + ItemMapping( "weapon_shockrifle", g_ShockRifleCandidates[iShockChooser][0] ), + ItemMapping( "monster_shockroach", g_ShockRifleCandidates[iShockChooser][1] ), + //minigun + ItemMapping( "weapon_minigun", g_MinigunCandidates[iMinigunChooser] ) +}; + +//Using Materialize hook for that one guy that thought it would be a good idea to spawn entities using squadmaker +HookReturnCode PickupObjectMaterialize( CBaseEntity@ pEntity ) +{ + Vector origin, angles; + string targetname, target, netname; + + for( uint j = 0; j < g_Ins2ItemMappings.length(); ++j ) + { + if( pEntity.pev.ClassNameIs( g_Ins2ItemMappings[j].get_From() ) ) + { + origin = pEntity.pev.origin; + angles = pEntity.pev.angles; + targetname = pEntity.pev.targetname; + target = pEntity.pev.target; + netname = pEntity.pev.netname; + + g_EntityFuncs.Remove( pEntity ); + CBaseEntity@ pNewEnt = g_EntityFuncs.Create( g_Ins2ItemMappings[j].get_To(), origin, angles, true ); + + if( targetname != "" ) + g_EntityFuncs.DispatchKeyValue( pNewEnt.edict(), "targetname", targetname ); + + if( target != "" ) + g_EntityFuncs.DispatchKeyValue( pNewEnt.edict(), "target", target ); + + if( netname != "" ) + g_EntityFuncs.DispatchKeyValue( pNewEnt.edict(), "netname", netname ); + + g_EntityFuncs.DispatchSpawn( pNewEnt.edict() ); + } + } + return HOOK_HANDLED; +} + +} + +void MapInit() +{ + INS2_KABAR::Register(); + INS2_KNUCKLES::Register(); + INS2_M1911::Register(); + INS2_MAKAROV::Register(); + INS2_C96::Register(); + INS2_M29::Register(); + INS2_PYTHON::Register(); + INS2_WEBLEY::Register(); + INS2_MP40::Register(); + INS2_MP18::Register(); + INS2_STERLING::Register(); + INS2_M590::Register(); + INS2_COACH::Register(); + INS2_ITHACA::Register(); + INS2_AKM::Register(); + INS2_L85A2::Register(); + INS2_M1GARAND::Register(); + INS2_K98K::Register(); + INS2_ENFIELD::Register(); + INS2_SVD::Register(); + INS2_G43::Register(); + INS2_MOSIN::Register(); + INS2_RPG7::Register(); + INS2_PZSCHRECK::Register(); + INS2_FNFAL::Register(); + INS2_G3A3::Register(); + INS2_FG42::Register(); + INS2_MK2GRENADE::Register(); + INS2_M24GRENADE::Register(); + INS2_LAW::DEFAULT_GIVE = INS2_LAW::MAX_CLIP; + INS2_LAW::Register(); + INS2_AKS74U::Register(); + INS2_AK74::Register(); + INS2_M4A1::Register(); + INS2_GALIL::Register(); + INS2_STG44::Register(); + INS2_LEWIS::Register(); + INS2_M60::Register(); + INS2_RPK::Register(); + INS2_SKS::Register(); + INS2_M1A1PARA::Register(); + INS2_C96CARBINE::Register(); + + // Initialize classic mode (item mapping only) + g_ClassicMode.SetItemMappings( @SC_ROYALS::g_Ins2ItemMappings ); + g_ClassicMode.ForceItemRemap( true ); + g_Hooks.RegisterHook( Hooks::PickupObject::Materialize, @SC_ROYALS::PickupObjectMaterialize ); +} + +void MapActivate() +{ + //KernCore: Create a few entities to help with ammo pickups + + array Sc_Royals_Coords1 = { + Vector( 680, -585, -140 ), + Vector( 680, -560, -140 ), + Vector( 680, -535, -140 ) + }; + + array Sc_Royals_Coords2 = { + Vector( -240, -280, -140 ), + Vector( -220, -280, -140 ), + Vector( -200, -280, -140 ) + }; + + array Sc_Royals_Coords3 = { + Vector( -270, -1040, -140 ), + Vector( -270, -1020, -140 ), + Vector( -270, -1000, -140 ) + }; + + // this map has different origins for the spawn area + if( string(g_Engine.mapname) == "sc_royals4" ) + { + Sc_Royals_Coords1 = { + Vector( 465, -1050, 724 ), // 465, -1050, 724 + Vector( 465, -1025, 724 ), // 465, -1025, 724 + Vector( 465, -1000, 724 ) // 465, -1000, 724 + }; + + Sc_Royals_Coords2 = { + Vector( -390, -744, 724 ), // -390, -744, 724 + Vector( -410, -744, 724 ), // -410, -744, 724 + Vector( -430, -744, 724 ) // -430, -744, 724 + }; + + Sc_Royals_Coords3 = { + Vector( -462, -1450, 724 ), // -462, -1450, 724 + Vector( -462, -1470, 724 ), // -462, -1470, 724 + Vector( -462, -1490, 724 ) // -462, -1490, 724 + }; + } + + for( uint i = 0; i < Sc_Royals_Coords1.length(); i++ ) + { + g_EntityFuncs.Create( "ammo_9mmAR", Sc_Royals_Coords1[i], g_vecZero, false ); + } + + for( uint i = 0; i < Sc_Royals_Coords2.length(); i++ ) + { + g_EntityFuncs.Create( "ammo_uziclip", Sc_Royals_Coords2[i], g_vecZero, false ); + } + + for( uint i = 0; i < Sc_Royals_Coords3.length(); i++ ) + { + g_EntityFuncs.Create( "ammo_556clip", Sc_Royals_Coords3[i], g_vecZero, false ); + } + + //KernCore end +} + +void MapStart() +{ + //KernCore: Removing that pesky ammo_spore entity + CBaseEntity@ pEntity = null; + Vector origin, angles; + string targetname; + + for( int i = 0; ( @pEntity = @g_EntityFuncs.FindEntityByClassname( pEntity, "ammo_spore" ) ) != null; i++ ) + { + origin = pEntity.pev.origin; + targetname = pEntity.pev.targetname; + angles = pEntity.pev.angles; + + g_EntityFuncs.Remove( pEntity ); + CBaseEntity@ pNewEnt1 = g_EntityFuncs.Create( SC_ROYALS::g_SporeLauncherCandidates[SC_ROYALS::iSporeChooser][1], origin, angles, true ); + if( targetname != "" ) + g_EntityFuncs.DispatchKeyValue( pNewEnt1.edict(), "targetname", targetname ); + + g_EntityFuncs.DispatchSpawn( pNewEnt1.edict() ); + } + //KernCore: End + + // Outerbeast + CBaseEntity@ pChangeLevel; + while( ( @pChangeLevel = g_EntityFuncs.FindEntityByClassname( pChangeLevel, "trigger_changelevel" ) ) !is null ) + { + g_EntityFuncs.DispatchKeyValue( pChangeLevel.edict(), "keep_inventory", 1.0f ); + } +} \ No newline at end of file diff --git a/scripts/maps/ins2/proj/proj_ins2flame.as b/scripts/maps/ins2/proj/proj_ins2flame.as index 2f94473..4a907ce 100644 --- a/scripts/maps/ins2/proj/proj_ins2flame.as +++ b/scripts/maps/ins2/proj/proj_ins2flame.as @@ -58,17 +58,17 @@ class CIns2Flame : ScriptBaseEntity, INS2BASE::ExplosiveBase void FlameTouch( CBaseEntity@ pOther ) { - // don't hit the guy that launched this flame or itself - if( @pOther.edict() == @self.pev.owner ) - return; + TraceResult tr = g_Utility.GetGlobalTrace(); - if( pOther.pev.ClassNameIs( self.pev.classname ) || @pOther.edict() == @self.edict() ) + // OP4's Pit worm hack so it doesn't hit itself + if( pOther.pev.modelindex == self.pev.modelindex && tr.pHit !is null && self.pev.modelindex != tr.pHit.vars.modelindex ) { - g_EntityFuncs.SetSize( self.pev, g_vecZero, g_vecZero ); return; } - SetTouch( null ); + // don't hit the guy that launched this flame + if( pOther.edict() is self.pev.owner ) + return; entvars_t@ pevOwner; if( self.pev.owner !is null ) @@ -76,7 +76,6 @@ class CIns2Flame : ScriptBaseEntity, INS2BASE::ExplosiveBase else @pevOwner = self.pev; - TraceResult tr = g_Utility.GetGlobalTrace(); if( pOther.pev.takedamage != DAMAGE_NO && pOther.IsAlive() ) { g_WeaponFuncs.ClearMultiDamage(); @@ -101,6 +100,8 @@ class CIns2Flame : ScriptBaseEntity, INS2BASE::ExplosiveBase if( pOther is null || pOther.IsBSPModel() ) g_Utility.DecalTrace( tr, DECAL_SMALLSCORCH1 + Math.RandomLong( 1, 2 ) ); + SetTouch( null ); + self.pev.solid = SOLID_NOT; self.pev.movetype = MOVETYPE_NONE; } diff --git a/scripts/maps/ins2/proj/proj_ins2grenade.as b/scripts/maps/ins2/proj/proj_ins2grenade.as index d0d098a..f515a70 100644 --- a/scripts/maps/ins2/proj/proj_ins2grenade.as +++ b/scripts/maps/ins2/proj/proj_ins2grenade.as @@ -13,6 +13,7 @@ class CIns2Grenade : ScriptBaseMonsterEntity, INS2BASE::ExplosiveBase private Vector m_vecPrev; private bool m_bRegisteredSound; bool m_bImpactGrenade; + float m_flImpactFuseTime = 0; void Spawn() { @@ -26,9 +27,6 @@ class CIns2Grenade : ScriptBaseMonsterEntity, INS2BASE::ExplosiveBase m_vecPrev = g_vecZero; m_bRegisteredSound = false; - SetThink( ThinkFunction( this.TumbleThink ) ); - self.pev.nextthink = g_Engine.time + 0.1; - g_EntityFuncs.SetSize( self.pev, Vector( -0.2, -0.2, -0.2 ), Vector( 0.2, 0.2, 0.2 ) ); } @@ -38,6 +36,7 @@ class CIns2Grenade : ScriptBaseMonsterEntity, INS2BASE::ExplosiveBase g_Game.PrecacheModel( "sprites/zerogxplode.spr" ); g_Game.PrecacheModel( SPR_EXPLOSION ); g_Game.PrecacheModel( "sprites/WXplo1.spr" ); + //g_Game.PrecacheModel( "sprites/ins2/napalm.spr" ); g_Game.PrecacheModel( "sprites/steam1.spr" ); //g_Game.PrecacheModel( "models/concrete_gibs.mdl" ); INS2BASE::PrecacheSound( GrenadeExplode ); @@ -46,6 +45,74 @@ class CIns2Grenade : ScriptBaseMonsterEntity, INS2BASE::ExplosiveBase BaseClass.Precache(); } + void TimedImpactTouch( CBaseEntity@ pOther ) + { + // don't hit the guy that launched this grenade + if( @pOther.edict() == @self.pev.owner ) + return; + + // Only do damage if we're moving fairly fast + if( m_flNextAttack < g_Engine.time && self.pev.velocity.Length() > 100 ) + { + entvars_t@ pevOwner = @self.pev.owner.vars; + if( pevOwner !is null ) + { + TraceResult tr = g_Utility.GetGlobalTrace(); + g_WeaponFuncs.ClearMultiDamage(); + pOther.TraceAttack( pevOwner, 1, g_Engine.v_forward, tr, DMG_CLUB ); + g_WeaponFuncs.ApplyMultiDamage( self.pev, pevOwner ); + } + m_flNextAttack = g_Engine.time + 1.0; // debounce + } + + if( m_flImpactFuseTime > g_Engine.time && m_bImpactGrenade ) + { + //g_Game.AlertMessage( at_console, "Impact Fuse Time: " + (m_flImpactFuseTime - g_Engine.time) + "\n" ); + m_bImpactGrenade = false; //Deactivate the impact detonation + } + else if( m_flImpactFuseTime < g_Engine.time && m_bImpactGrenade ) + { + //g_Game.AlertMessage( at_console, "Impact Fuse Time: " + (m_flImpactFuseTime - g_Engine.time) + "\n" ); + SetThink( ThinkFunction( this.Detonate ) ); + self.pev.nextthink = g_Engine.time; + } + + Vector vecTestVelocity; + // this is my heuristic for modulating the grenade velocity because grenades dropped purely vertical + // or thrown very far tend to slow down too quickly for me to always catch just by testing velocity. + // trimming the Z velocity a bit seems to help quite a bit. + vecTestVelocity = self.pev.velocity; + vecTestVelocity.z *= 0.45; + + if( m_bRegisteredSound == false && vecTestVelocity.Length() <= 33 ) + { + // grenade is moving really slow. It's probably very close to where it will ultimately stop moving. + // go ahead and emit the danger sound. + // register a radius louder than the explosion, so we make sure everyone gets out of the way + GetSoundEntInstance().InsertSound( bits_SOUND_DANGER, self.pev.origin, int(self.pev.dmg / 0.5), 0.3, self ); + //CSoundEnt::InsertSound ( bits_SOUND_DANGER, pev->origin, pev->dmg / 0.5, 0.3, this ); + m_bRegisteredSound = true; + } + + if( pOther.IsBSPModel() ) + self.pev.flags |= FL_ONGROUND; + + if( self.pev.flags & FL_ONGROUND != 0 && m_flNextSlideUpdate <= g_Engine.time ) + { + // add a bit of static friction + self.pev.velocity = self.pev.velocity * 0.9; + self.pev.sequence = 1; + m_flNextSlideUpdate = g_Engine.time + 0.1; + } + + BounceSounds(); + + self.pev.flags |= EF_NOINTERP; + float flVelocity = (self.pev.origin - m_vecPrev).Length(); + self.pev.framerate = Math.min( 16.0, Math.max( 0.0, flVelocity * 8 ) ); + m_vecPrev = self.pev.origin; + } + void ImpactTouch( CBaseEntity@ pOther ) { // don't hit the guy that launched this grenade @@ -198,17 +265,28 @@ class CIns2Grenade : ScriptBaseMonsterEntity, INS2BASE::ExplosiveBase self.pev.framerate = 1; } + if( self.pev.waterlevel != WATERLEVEL_DRY ) + { + self.pev.velocity = self.pev.velocity * 0.5; + self.pev.framerate = 0.2; + } + if( !m_bImpactGrenade ) { if( self.pev.dmgtime <= g_Engine.time ) { SetThink( ThinkFunction( this.Detonate ) ); } - - if( self.pev.waterlevel != WATERLEVEL_DRY ) + } + else if( m_bImpactGrenade && m_flImpactFuseTime != 0 ) + { + if( self.pev.flags & FL_ONGROUND != 0 && m_flImpactFuseTime <= g_Engine.time ) + { + SetThink( ThinkFunction( this.Detonate ) ); + } + else if( m_flImpactFuseTime <= g_Engine.time && self.pev.dmgtime <= g_Engine.time ) { - self.pev.velocity = self.pev.velocity * 0.5; - self.pev.framerate = 0.2; + SetThink( ThinkFunction( this.Detonate ) ); } } } @@ -227,6 +305,7 @@ class CIns2Grenade : ScriptBaseMonsterEntity, INS2BASE::ExplosiveBase @pevOwner = self.pev; g_PlayerFuncs.ScreenShake( self.pev.origin, 15.0, 50.0, 1.0, self.pev.dmg * 2.5 ); + //MsgTraceTexResult( self.GetOrigin() ); // Pull out of the wall a bit if( pTrace.flFraction != 1.0 ) @@ -282,7 +361,7 @@ class CIns2Grenade : ScriptBaseMonsterEntity, INS2BASE::ExplosiveBase } } -CIns2Grenade@ TossGrenade( entvars_t@ pevOwner, Vector vecStart, Vector vecVelocity, float flTime, float flDmg, string sModel, const string& in szName = "proj_ins2grenade", bool bIsImpactGrenade = false ) +CIns2Grenade@ TossGrenade( entvars_t@ pevOwner, Vector vecStart, Vector vecVelocity, float flTime, float flDmg, string sModel, const string& in szName = "proj_ins2grenade" ) { CBaseEntity@ cbeIns2Grenade = g_EntityFuncs.CreateEntity( szName ); CIns2Grenade@ ins2Grenade = cast( CastToScriptClass( cbeIns2Grenade ) ); @@ -299,23 +378,91 @@ CIns2Grenade@ TossGrenade( entvars_t@ pevOwner, Vector vecStart, Vector vecVeloc ins2Grenade.pev.gravity = 0.7; ins2Grenade.pev.friction = 0.65; ins2Grenade.pev.dmg = flDmg; - ins2Grenade.m_bImpactGrenade = bIsImpactGrenade; - if( ins2Grenade.m_bImpactGrenade != true ) - { - ins2Grenade.SetTouch( TouchFunction( ins2Grenade.BounceTouch ) ); + ins2Grenade.SetTouch( TouchFunction( ins2Grenade.BounceTouch ) ); - if( flTime < 0.1 ) - { - ins2Grenade.pev.nextthink = g_Engine.time; - ins2Grenade.pev.velocity = g_vecZero; - } - ins2Grenade.pev.dmgtime = g_Engine.time + flTime; + ins2Grenade.SetThink( ThinkFunction( ins2Grenade.TumbleThink ) ); + ins2Grenade.pev.nextthink = g_Engine.time + 0.1; + + if( flTime < 0.1 ) + { + ins2Grenade.pev.nextthink = g_Engine.time; + ins2Grenade.pev.velocity = g_vecZero; } - else + ins2Grenade.pev.dmgtime = g_Engine.time + flTime; + + // any traces will go straight through the grenade, so this doesn't work + /*ins2Grenade.pev.takedamage = DAMAGE_YES; + ins2Grenade.self.m_bloodColor = DONT_BLEED; + ins2Grenade.pev.health = 1; + Vector vecMin, vecMax; + ins2Grenade.self.ExtractBbox( ins2Grenade.pev.sequence, vecMin, vecMax ); + g_EntityFuncs.SetSize( ins2Grenade.pev, vecMin, vecMax ); + ins2Grenade.pev.size = vecMax - vecMin;*/ + + return ins2Grenade; +} + +CIns2Grenade@ TossImpactGrenade( entvars_t@ pevOwner, Vector vecStart, Vector vecVelocity, float flDmg, string sModel, const string& in szName = "proj_ins2grenade" ) +{ + CBaseEntity@ cbeIns2Grenade = g_EntityFuncs.CreateEntity( szName ); + CIns2Grenade@ ins2Grenade = cast( CastToScriptClass( cbeIns2Grenade ) ); + + //g_Game.AlertMessage( at_console, "Projectile Name: " + ins2Grenade.pev.classname + "\n" ); + + g_EntityFuncs.SetOrigin( ins2Grenade.self, vecStart ); + g_EntityFuncs.SetModel( ins2Grenade.self, sModel ); + g_EntityFuncs.DispatchSpawn( ins2Grenade.self.edict() ); + + ins2Grenade.pev.velocity = vecVelocity; + ins2Grenade.pev.angles = Math.VecToAngles( ins2Grenade.pev.velocity ); + @ins2Grenade.pev.owner = INS2BASE::ENT( pevOwner ); + ins2Grenade.pev.gravity = 0.7; + ins2Grenade.pev.friction = 0.65; + ins2Grenade.pev.dmg = flDmg; + + ins2Grenade.SetThink( ThinkFunction( ins2Grenade.TumbleThink ) ); + ins2Grenade.pev.nextthink = g_Engine.time + 0.1; + + ins2Grenade.m_bImpactGrenade = true; + ins2Grenade.SetTouch( TouchFunction( ins2Grenade.ImpactTouch ) ); + + return ins2Grenade; +} + +CIns2Grenade@ TossTimedImpactGrenade( entvars_t@ pevOwner, Vector vecStart, Vector vecVelocity, float flTime, float flImpactTime, float flDmg, string sModel, + const string& in szName = "proj_ins2grenade" ) +{ + CBaseEntity@ cbeIns2Grenade = g_EntityFuncs.CreateEntity( szName ); + CIns2Grenade@ ins2Grenade = cast( CastToScriptClass( cbeIns2Grenade ) ); + + //g_Game.AlertMessage( at_console, "Projectile Name: " + ins2Grenade.pev.classname + "\n" ); + + g_EntityFuncs.SetOrigin( ins2Grenade.self, vecStart ); + g_EntityFuncs.SetModel( ins2Grenade.self, sModel ); + g_EntityFuncs.DispatchSpawn( ins2Grenade.self.edict() ); + + ins2Grenade.pev.velocity = vecVelocity; + ins2Grenade.pev.angles = Math.VecToAngles( ins2Grenade.pev.velocity ); + @ins2Grenade.pev.owner = INS2BASE::ENT( pevOwner ); + ins2Grenade.pev.gravity = 0.7; + ins2Grenade.pev.friction = 0.65; + ins2Grenade.pev.dmg = flDmg; + + ins2Grenade.m_bImpactGrenade = true; + ins2Grenade.SetTouch( TouchFunction( ins2Grenade.TimedImpactTouch ) ); + + ins2Grenade.SetThink( ThinkFunction( ins2Grenade.TumbleThink ) ); + ins2Grenade.pev.nextthink = g_Engine.time + 0.1; + + if( flTime < 0.1 ) { - ins2Grenade.SetTouch( TouchFunction( ins2Grenade.ImpactTouch ) ); + ins2Grenade.pev.nextthink = g_Engine.time; + ins2Grenade.pev.velocity = g_vecZero; } + ins2Grenade.pev.dmgtime = g_Engine.time + flTime; + + ins2Grenade.m_flImpactFuseTime = (flImpactTime < 0.1) ? g_Engine.time : g_Engine.time + flImpactTime; return ins2Grenade; } diff --git a/scripts/maps/ins2/proj/proj_ins2prop.as b/scripts/maps/ins2/proj/proj_ins2prop.as new file mode 100644 index 0000000..0193039 --- /dev/null +++ b/scripts/maps/ins2/proj/proj_ins2prop.as @@ -0,0 +1,243 @@ +// Ins2 Generic Prop Entity +// Author: KernCore + +#include "../base" + +namespace INS2PROP +{ + +class CIns2Prop : ScriptBaseAnimating +{ + private float m_flNextSlideUpdate, m_flBounceTime; + float m_flVelFriction, m_flAVelFriction; + array m_szBounceSounds = {}; + + void Spawn() + { + BaseClass.Spawn(); + Precache(); + + self.pev.movetype = MOVETYPE_BOUNCE; + self.pev.solid = SOLID_TRIGGER; + self.pev.gravity = 1; + + m_flNextSlideUpdate = 0; + m_flBounceTime = 0; + + SetTouch( TouchFunction( this.Slide ) ); + SetThink( ThinkFunction( this.PropThink ) ); + self.pev.nextthink = g_Engine.time + 0.1; + + g_EntityFuncs.SetSize( self.pev, Vector( -3, -2, -1 ), Vector( 3, 2, 1 ) ); + } + + void Precache() + { + if( m_szBounceSounds.length() > 0 ) + { + for( uint i = 0; i < m_szBounceSounds.length(); i++ ) + { + g_SoundSystem.PrecacheSound( m_szBounceSounds[i] ); + g_Game.PrecacheGeneric( "sound/" + m_szBounceSounds[i] ); + //g_Game.AlertMessage( at_console, "Precached: sound/" + m_szBounceSounds[i] + "\n" ); + } + } + BaseClass.Precache(); + } + + void BounceSound() + { + if( g_Engine.time < m_flBounceTime ) + return; + + m_flBounceTime = g_Engine.time + Math.RandomFloat( 0.1f, 0.3f ); + + if( g_Utility.GetGlobalTrace().flFraction < 1.0 ) + { + if( g_Utility.GetGlobalTrace().pHit !is null ) + { + CBaseEntity@ pHit = g_EntityFuncs.Instance( g_Utility.GetGlobalTrace().pHit ); + if( pHit.IsBSPModel() ) + { + g_SoundSystem.EmitSoundDyn( self.edict(), CHAN_AUTO, m_szBounceSounds[ Math.RandomLong( 0, m_szBounceSounds.length() - 1 ) ], VOL_NORM, ATTN_NORM, 0, PITCH_NORM ); + } + } + } + } + + void Slide( CBaseEntity@ pOther ) + { + // don't hit the owner + if( @pOther.edict() == @self.pev.owner ) + return; + + BounceSound(); + + // add a bit of static friction + self.pev.velocity = self.pev.velocity * m_flVelFriction; + self.pev.avelocity = self.pev.avelocity * m_flAVelFriction; + + if( pOther.IsBSPModel() ) + self.pev.flags |= FL_ONGROUND; + + if( self.pev.flags & FL_ONGROUND != 0 ) + { + AlignToGroundStatic( self, 190.0f ); + } + } + + void PropThink() + { + if( !self.IsInWorld() ) + { + g_EntityFuncs.Remove( self ); + return; + } + + self.pev.nextthink = g_Engine.time + 0.1; + + if( self.pev.flags & FL_ONGROUND == 0 ) + { + AlignToGroundStatic( self, 110.0f ); + } + + if( self.pev.waterlevel != WATERLEVEL_DRY ) + { + self.pev.velocity = self.pev.velocity * 0.5; + self.pev.avelocity = self.pev.avelocity * 0.9; + } + + if( self.pev.dmgtime <= g_Engine.time ) + { + SetThink( null ); + self.SUB_StartFadeOut(); + self.pev.nextthink = g_Engine.time + 0.1; + } + } + + void AlignToGroundStatic( CBaseEntity@ pObject, float flSpeed ) + { + //If we're set to float in the air, don't bother aligning + if( pObject is null || pObject.pev.movetype == MOVETYPE_FLY ) + return; + + //"Unstick" code (for slopes) + if( pObject.m_vecLastOrigin == pObject.pev.origin && pObject.pev.velocity.z < 0 ) + { + if( pObject.pev.groundentity is null ) + { + pObject.pev.velocity.z++; + pObject.pev.origin.z++; + } + } + + pObject.m_vecLastOrigin = pObject.pev.origin; + + bool fLarge = false; + + //Geckon: Get the size from the model + CBaseAnimating@ pAnimating = cast( pObject ); + if( pAnimating !is null ) + { + Vector vecMin, vecMax, vecSize; + pAnimating.ExtractBbox( 0, vecMin, vecMax ); + vecSize = vecMax - vecMin; + fLarge = (vecSize.x + vecSize.y + vecSize.z) >= 60; + } + + Vector m_vecAngles = pObject.pev.angles; + + //We want the direction we are facing, only, if we're a small object + if( !(pObject.pev.groundentity !is null || pObject.pev.flags & FL_ONGROUND != 0) && !fLarge ) + { + m_vecAngles.z = 0; + m_vecAngles.x = 0; + } + + Math.MakeVectors( m_vecAngles ); + + //Origin trace + TraceResult trOrigin; + g_Utility.TraceLine( pObject.pev.origin + Vector( 0, 0, 8 ), pObject.pev.origin - Vector( 0, 0, 32 ), ignore_monsters, pObject.edict(), trOrigin ); + + //Don't bother if we're already on flat ground + if( trOrigin.vecPlaneNormal == Vector( 0, 0, 1 ) ) + { + pObject.pev.angles.x = Math.ApproachAngle( 0, pObject.pev.angles.x, 50); + pObject.pev.angles.z = Math.ApproachAngle( 0, pObject.pev.angles.z, 50); + return; + } + + //This is here so that we don't go up too high, in case we're under a shelf or such + TraceResult trCheck; + g_Utility.TraceLine( pObject.pev.origin + Vector( 0, 0, 1 ), pObject.pev.origin - Vector( 0, 0, 24 ), ignore_monsters, pObject.edict(), trCheck ); + float checkdis = trCheck.vecEndPos.z - pObject.pev.origin.z; + + //Z + TraceResult trZ; + Vector m_vecTracePosZ = pObject.pev.origin + g_Engine.v_forward * 8 + Vector( 0, 0, checkdis ); //g_Engine.v_up * 16; + g_Utility.TraceLine( m_vecTracePosZ, (m_vecTracePosZ - Vector( 0, 0, 48 )), ignore_monsters, dont_ignore_glass, pObject.edict(), trZ ); + + //X + TraceResult trX; + Vector m_vecTracePosX = pObject.pev.origin + g_Engine.v_right * 8 + Vector( 0, 0, checkdis ); + g_Utility.TraceLine( m_vecTracePosX, (m_vecTracePosX - Vector( 0, 0, 48 )), ignore_monsters, dont_ignore_glass, pObject.edict(), trX ); + + CBaseEntity@ pHitZ = g_EntityFuncs.Instance( trZ.pHit ); + CBaseEntity@ pHitX = g_EntityFuncs.Instance( trX.pHit ); + + if( !(pObject.pev.groundentity !is null || pObject.pev.flags & FL_ONGROUND == 0) || trZ.flFraction != 1.0 && trX.flFraction != 1.0 ) + { + Vector appVec = Vector( Math.VecToAngles( trZ.vecEndPos - trOrigin.vecEndPos ).x, 0, -Math.VecToAngles( trX.vecEndPos - trOrigin.vecEndPos ).x ); + + if( pHitX !is null && pHitX.IsBSPModel() ) + pObject.pev.angles.x = Math.ApproachAngle( appVec.x, pObject.pev.angles.x, flSpeed ); + + if( pHitZ !is null && pHitZ.IsBSPModel() ) + pObject.pev.angles.z = Math.ApproachAngle( appVec.z, pObject.pev.angles.z, flSpeed ); + } + } +} + +CIns2Prop@ ShootProp( entvars_t@ pevOwner, Vector& in vecOrigin, Vector& in vecVelocity, Vector& in vecDropAngle, Vector& in vecAngVelocity, string szModel, + array BounceSounds, float flVelFriction = 0.4f, float flAVelFriction = 0.7f, int iBodygroup = 0, int iSkingroup = 0, float flStartFadeOutTime = 5.0f ) +{ + CBaseEntity@ cbeIns2Prop = g_EntityFuncs.CreateEntity( "proj_ins2prop" ); + CIns2Prop@ ins2Prop = cast( CastToScriptClass( cbeIns2Prop ) ); + + g_EntityFuncs.SetOrigin( ins2Prop.self, vecOrigin ); + g_EntityFuncs.SetModel( ins2Prop.self, szModel ); + g_EntityFuncs.DispatchSpawn( ins2Prop.self.edict() ); + + @ins2Prop.pev.owner = INS2BASE::ENT( pevOwner ); + ins2Prop.pev.velocity = vecVelocity; + ins2Prop.pev.avelocity = vecAngVelocity; + + ins2Prop.m_flVelFriction = flVelFriction; + ins2Prop.m_flAVelFriction = flAVelFriction; + + ins2Prop.pev.angles = vecDropAngle; + ins2Prop.pev.body = iBodygroup; + ins2Prop.pev.skin = iSkingroup; + ins2Prop.m_szBounceSounds = BounceSounds; + + if( flStartFadeOutTime < 0.1 ) + { + ins2Prop.pev.nextthink = g_Engine.time; + ins2Prop.pev.velocity = g_vecZero; + } + ins2Prop.pev.dmgtime = g_Engine.time + flStartFadeOutTime; + + return ins2Prop; +} + +void Register() +{ + if( g_CustomEntityFuncs.IsCustomEntity( "proj_ins2prop" ) ) + return; + + g_CustomEntityFuncs.RegisterCustomEntity( "INS2PROP::CIns2Prop", "proj_ins2prop" ); + g_Game.PrecacheOther( "proj_ins2prop" ); +} + +} \ No newline at end of file diff --git a/scripts/maps/ins2/proj/proj_ins2rocket.as b/scripts/maps/ins2/proj/proj_ins2rocket.as index bb99809..c7091fc 100644 --- a/scripts/maps/ins2/proj/proj_ins2rocket.as +++ b/scripts/maps/ins2/proj/proj_ins2rocket.as @@ -11,8 +11,6 @@ const string ROCKET_LOOP = "ins2/wpn/rckt/loop.ogg"; class CIns2Rocket : ScriptBaseEntity, INS2BASE::ExplosiveBase { private Vector vecSize( 0.2, 0.2, 0.2 ); - private string m_szSprSmoke = "sprites/smoke.spr"; - private string m_szSprBlackSmoke3 = "sprites/black_smoke3.spr"; void Spawn() { @@ -27,13 +25,13 @@ class CIns2Rocket : ScriptBaseEntity, INS2BASE::ExplosiveBase void Precache() { - g_Game.PrecacheModel( m_szSprSmoke ); + g_Game.PrecacheModel( "sprites/smoke.spr" ); g_Game.PrecacheModel( "sprites/zerogxplode.spr" ); g_Game.PrecacheModel( SPR_EXPLOSION ); g_Game.PrecacheModel( "sprites/WXplo1.spr" ); g_Game.PrecacheModel( "sprites/steam1.spr" ); - g_Game.PrecacheModel( m_szSprBlackSmoke3 ); - //g_Game.PrecacheModel( "sprites/laserbeam.spr" ); + g_Game.PrecacheModel( "sprites/laserbeam.spr" ); + g_Game.PrecacheModel( "sprites/black_smoke3.spr" ); g_SoundSystem.PrecacheSound( ROCKET_LOOP ); g_Game.PrecacheGeneric( "sound/" + ROCKET_LOOP ); @@ -46,14 +44,11 @@ class CIns2Rocket : ScriptBaseEntity, INS2BASE::ExplosiveBase BaseClass.Precache(); } - Vector saveVelocity; - void EntThink() { self.pev.nextthink = g_Engine.time + 0.1; self.pev.angles = Math.VecToAngles( self.pev.velocity ); - int iContents = g_EngineFuncs.PointContents( self.GetOrigin() ); if( iContents == CONTENTS_WATER || iContents == CONTENTS_SLIME || iContents == CONTENTS_LAVA ) { @@ -66,7 +61,7 @@ class CIns2Rocket : ScriptBaseEntity, INS2BASE::ExplosiveBase smk_msg.WriteCoord( self.pev.origin.x ); //pos smk_msg.WriteCoord( self.pev.origin.y ); //pos smk_msg.WriteCoord( self.pev.origin.z - 24 ); //pos - smk_msg.WriteShort( g_Game.PrecacheModel( m_szSprBlackSmoke3 ) ); + smk_msg.WriteShort( g_Game.PrecacheModel( "sprites/black_smoke3.spr" ) ); smk_msg.WriteByte( Math.RandomLong( 23, 29 ) ); //scale smk_msg.WriteByte( Math.RandomLong( 19, 21 ) ); //framerate smk_msg.End(); @@ -211,7 +206,7 @@ class CIns2Rocket : ScriptBaseEntity, INS2BASE::ExplosiveBase NetworkMessage trail_msg( MSG_BROADCAST, NetworkMessages::SVC_TEMPENTITY, null ); trail_msg.WriteByte( TE_BEAMFOLLOW ); trail_msg.WriteShort( self.entindex() ); //entity - trail_msg.WriteShort( g_Game.PrecacheModel( m_szSprSmoke ) ); //model + trail_msg.WriteShort( g_Game.PrecacheModel( "sprites/smoke.spr" ) ); //model trail_msg.WriteByte( 5 ); //life trail_msg.WriteByte( 4 ); //width trail_msg.WriteByte( 224 ); //r diff --git a/scripts/maps/ins2/rifle/weapon_ins2enfield.as b/scripts/maps/ins2/rifle/weapon_ins2enfield.as index 302ef01..ebb8245 100644 --- a/scripts/maps/ins2/rifle/weapon_ins2enfield.as +++ b/scripts/maps/ins2/rifle/weapon_ins2enfield.as @@ -74,6 +74,7 @@ uint DAMAGE = 55; uint SLOT = 6; uint POSITION = 7; float RPM_AIR = 1.26f; //Rounds per minute in air +uint AIM_FOV = 37; // Below 50 hides crosshair string AMMO_TYPE = "ins2_303brit"; class weapon_ins2enfield : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase @@ -185,7 +186,7 @@ class weapon_ins2enfield : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase SetThink( ThinkFunction( this.BoltBackThink ) ); self.pev.nextthink = g_Engine.time + (22.0/31.0); } - return Deploy( V_MODEL, P_MODEL, (self.m_iClip <= 0 || m_bCanBolt) ? DRAW_EMPTY : DRAW, "sniper", GetBodygroup(), (23.0/31.0) ); + return Deploy( V_MODEL, P_MODEL, (self.m_iClip <= 0 || m_bCanBolt) ? DRAW_EMPTY : DRAW , "sniper", GetBodygroup(), (23.0/31.0) ); } } @@ -211,12 +212,6 @@ class weapon_ins2enfield : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase m_fRifleReload = false; CommonHolster(); - if( CSRemoveBullet !is null ) - { - g_Scheduler.RemoveTimer( CSRemoveBullet ); - @CSRemoveBullet = @null; - } - BaseClass.Holster( skipLocal ); } @@ -275,7 +270,7 @@ class weapon_ins2enfield : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase case INS2BASE::IRON_OUT: { self.SendWeaponAnim( (self.m_iClip > 0) ? IRON_TO : IRON_TO_EMPTY, 0, GetBodygroup() ); - EffectsFOVON( 37 ); + EffectsFOVON( AIM_FOV ); m_pPlayer.m_szAnimExtension = "sniperscope"; break; } @@ -304,14 +299,7 @@ class weapon_ins2enfield : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase { if( (CheckButton() || (self.m_iClip >= MAX_CLIP && m_pPlayer.pev.button & IN_RELOAD != 0)) && m_flNextReload <= g_Engine.time ) { - if( self.m_iClip == 0 ) - { - self.Reload(); // Continue reloading until there's 1 bullet in the cylinder - BaseClass.ItemPostFrame(); - return; - } - else - self.SendWeaponAnim( RELOAD_END, 0, GetBodygroup() ); + self.SendWeaponAnim( RELOAD_END, 0, GetBodygroup() ); self.m_flTimeWeaponIdle = g_Engine.time + (48.0/38.50); self.m_flNextPrimaryAttack = self.m_flNextSecondaryAttack = g_Engine.time + (48.0/38.50); @@ -324,11 +312,8 @@ class weapon_ins2enfield : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase void RemovePrimAmmo() { - if( CSRemoveBullet !is null ) - { - g_Scheduler.RemoveTimer( CSRemoveBullet ); - @CSRemoveBullet = @null; - } + g_Scheduler.RemoveTimer( CSRemoveBullet ); + @CSRemoveBullet = @null; if( self.m_iClip > 0 ) { diff --git a/scripts/maps/ins2/rifle/weapon_ins2garand.as b/scripts/maps/ins2/rifle/weapon_ins2garand.as index c24cabe..e257764 100644 --- a/scripts/maps/ins2/rifle/weapon_ins2garand.as +++ b/scripts/maps/ins2/rifle/weapon_ins2garand.as @@ -10,6 +10,7 @@ */ #include "../base" +#include "../proj/proj_ins2prop" namespace INS2_M1GARAND { @@ -78,6 +79,7 @@ uint SLOT = 6; uint POSITION = 5; float RPM_AIR = 0.2f; //Rounds per minute in air float RPM_WTR = 0.35f; //Rounds per minute in water +uint AIM_FOV = 37; // Below 50 hides crosshair string AMMO_TYPE = "ins2_7.62x63mm"; class weapon_ins2garand : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, INS2BASE::MeleeWeaponBase @@ -132,32 +134,21 @@ class weapon_ins2garand : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, IN "ins2/wpn/garand/magin.ogg", //5 "ins2/wpn/garand/magout.ogg", //6 "ins2/wpn/garand/magrel.ogg", //7 - "ins2/wpn/garand/ping1.ogg", //8 - "ins2/wpn/garand/ping2.ogg", //9 - "ins2/wpn/garand/ping3.ogg", //10 - "ins2/wpn/garand/ping4.ogg", //11 - "ins2/wpn/garand/ping5.ogg", //12 SHOOT_S, EMPTY_S }; - private string PingSounds() - { - string Snd; - switch( Math.RandomLong( 0, 4 ) ) - { - case 0: Snd = Sounds[8]; - break; - case 1: Snd = Sounds[9]; - break; - case 2: Snd = Sounds[10]; - break; - case 3: Snd = Sounds[11]; - break; - case 4: Snd = Sounds[12]; - break; - } - return Snd; - } + private array PingSounds = { + "ins2/wpn/garand/ping1.ogg", //0 + "ins2/wpn/garand/ping2.ogg", //1 + "ins2/wpn/garand/ping3.ogg", //2 + "ins2/wpn/garand/ping4.ogg", //3 + "ins2/wpn/garand/ping5.ogg" //4 + }; + private array BounceSounds = { + "ins2/wpn/phys/gclip1.ogg", + "ins2/wpn/phys/gclip2.ogg", + "ins2/wpn/phys/gclip3.ogg" + }; void Spawn() { @@ -177,8 +168,11 @@ class weapon_ins2garand : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, IN m_iMagDrop = g_Game.PrecacheModel( T_MODEL ); g_Game.PrecacheOther( GetAmmoName() ); + g_Game.PrecacheOther( "proj_ins2prop" ); INS2BASE::PrecacheSound( Sounds ); + INS2BASE::PrecacheSound( PingSounds ); + INS2BASE::PrecacheSound( BounceSounds ); INS2BASE::PrecacheSound( INS2BASE::DeployFirearmSounds ); INS2BASE::PrecacheSound( BayoHitFlesh ); INS2BASE::PrecacheSound( BayoHitWorld ); @@ -260,7 +254,7 @@ class weapon_ins2garand : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, IN { SetThink( ThinkFunction( EjectClipThink ) ); self.pev.nextthink = g_Engine.time + 0.2; - g_SoundSystem.EmitSoundDyn( m_pPlayer.edict(), CHAN_AUTO, PingSounds(), 1.0, ATTN_NORM, 0, PITCH_NORM ); + g_SoundSystem.EmitSoundDyn( m_pPlayer.edict(), CHAN_STREAM, PingSounds[ Math.RandomLong( 0, PingSounds.length() - 1 ) ], 1.0, ATTN_NORM, 0, PITCH_NORM ); } m_pPlayer.m_iWeaponVolume = NORMAL_GUN_VOLUME; @@ -286,7 +280,7 @@ class weapon_ins2garand : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, IN case INS2BASE::IRON_OUT: { self.SendWeaponAnim( (self.m_iClip > 0) ? IRON_TO : IRON_TO_EMPTY, 0, GetBodygroup() ); - EffectsFOVON( 37 ); + EffectsFOVON( AIM_FOV ); m_pPlayer.m_szAnimExtension = "sniperscope"; break; } @@ -302,7 +296,13 @@ class weapon_ins2garand : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase, IN void EjectClipThink() { - ClipCasting( m_pPlayer.pev.origin, m_pPlayer.pev.view_ofs + (g_Engine.v_right*42) + (g_Engine.v_up*16) + (g_Engine.v_forward*8), m_iMagDrop, false, 0 ); + Vector vecAngles = m_pPlayer.pev.v_angle + m_pPlayer.pev.punchangle; + Math.MakeVectors( vecAngles ); + + Vector vecVelocity = m_pPlayer.pev.view_ofs + (g_Engine.v_forward * 8) + (g_Engine.v_up * 16) + (g_Engine.v_right * 42); + Vector vecOrigin = m_pPlayer.pev.origin + g_Engine.v_right * 2 + g_Engine.v_up * 12; + + auto pProp = INS2PROP::ShootProp( m_pPlayer.pev, vecOrigin, vecVelocity, Vector( 0, vecAngles.y, 0 ), Vector( 0, -10, 200 ), T_MODEL, BounceSounds, 0.5f, 0.2f ); } void ItemPreFrame() @@ -434,6 +434,7 @@ string GetName() void Register() { + INS2PROP::Register(); g_CustomEntityFuncs.RegisterCustomEntity( "INS2_M1GARAND::weapon_ins2garand", GetName() ); // Register the weapon entity g_CustomEntityFuncs.RegisterCustomEntity( "INS2_M1GARAND::GARAND_CLIP", GetAmmoName() ); // Register the ammo entity g_ItemRegistry.RegisterWeapon( GetName(), SPR_CAT, (INS2BASE::ShouldUseCustomAmmo) ? AMMO_TYPE : INS2BASE::DF_AMMO_357, "", GetAmmoName() ); // Register the weapon diff --git a/scripts/maps/ins2/rifle/weapon_ins2kar98k.as b/scripts/maps/ins2/rifle/weapon_ins2kar98k.as index 509c4e7..d998cb8 100644 --- a/scripts/maps/ins2/rifle/weapon_ins2kar98k.as +++ b/scripts/maps/ins2/rifle/weapon_ins2kar98k.as @@ -103,6 +103,7 @@ uint DAMAGE_GL = 155; uint SLOT = 6; uint POSITION = 4; float RPM_AIR = 1.3; //Rounds per minute in air +uint AIM_FOV = 37; // Below 50 hides crosshair string AMMO_TYPE = "ins2_7.92x57mm"; string AMMO_TYPE2 = "ins2_30x250mm"; string PROJ_NAME = "proj_ins2kar98k"; @@ -380,7 +381,7 @@ class weapon_ins2kar98k : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase self.SendWeaponAnim( (WeaponGLMode == INS2BASE::GL_AIMED) ? GL_IRON_TO_EMPTY : IRON_TO_EMPTY, 0, GetBodygroup() ); m_pPlayer.m_szAnimExtension = "sniperscope"; - EffectsFOVON( 37 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/rifle/weapon_ins2svt40.as b/scripts/maps/ins2/rifle/weapon_ins2svt40.as new file mode 100644 index 0000000..1882f3c --- /dev/null +++ b/scripts/maps/ins2/rifle/weapon_ins2svt40.as @@ -0,0 +1,317 @@ +// Insurgency's Tokarev SVT-40 +/* Model Credits +/ Model: Seth Soldier (Forgotten Hope 2), Norman The Loli Pirate (Edits) +/ Textures: Seth Soldier (Forgotten Hope 2), Norman The Loli Pirate (Edits) +/ Animations: MyZombieKillerz, D.N.I.O. 071 (Edits) +/ Sounds: Solarint, Falcre, Navaro +/ Sprites: D.N.I.O. 071 (Model Render), R4to0 (Vector), KernCore (.spr Compile) +/ Misc: Norman The Loli Pirate (World Model), KernCore (World Model UVs), D.N.I.O. 071 (World Model UVs, Compile) +/ Script: KernCore +*/ + +#include "../base" + +namespace INS2_SVT40 +{ + +// Animations +enum INS2_SVT40_Animations +{ + IDLE = 0, + IDLE_EMPTY, + DRAW_FIRST, + DRAW, + DRAW_EMPTY, + HOLSTER, + HOLSTER_EMPTY, + FIRE, + FIRE_LAST, + DRYFIRE, + RELOAD, + RELOAD_EMPTY, + IRON_IDLE, + IRON_IDLE_EMPTY, + IRON_FIRE, + IRON_FIRE_LAST, + IRON_DRYFIRE, + IRON_TO, + IRON_TO_EMPTY, + IRON_FROM, + IRON_FROM_EMPTY +}; + +// Models +string W_MODEL = "models/ins2/wpn/svt40/w_svt40.mdl"; +string V_MODEL = "models/ins2/wpn/svt40/v_svt40.mdl"; +string P_MODEL = "models/ins2/wpn/svt40/p_svt40.mdl"; +string A_MODEL = "models/ins2/ammo/mags2.mdl"; +int MAG_BDYGRP = 7; +// Sprites +string SPR_CAT = "ins2/rfl/"; //Weapon category used to get the sprite's location +// Sounds +string SHOOT_S = "ins2/wpn/svt40/shoot.ogg"; +string EMPTY_S = "ins2/wpn/svt40/empty.ogg"; +// Information +int MAX_CARRY = 1000; +int MAX_CLIP = 10; +int DEFAULT_GIVE = MAX_CLIP * 4; +int WEIGHT = 20; +int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY; +uint DAMAGE = 45; +uint SLOT = 6; +uint POSITION = 8; +float RPM_AIR = 0.135f; //Rounds per minute in air +float RPM_WTR = 0.275f; //Rounds per minute in water +uint AIM_FOV = 37; // Below 50 hides crosshair +string AMMO_TYPE = "ins2_7.62x54mm"; + +class weapon_ins2svt40 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase +{ + private CBasePlayer@ m_pPlayer + { + get const { return cast( self.m_hPlayer.GetEntity() ); } + set { self.m_hPlayer = EHandle( @value ); } + } + private int m_iShell; + private bool m_WasDrawn; + private int GetBodygroup() + { + return 0; + } + private array Sounds = { + "ins2/wpn/svt40/bltbk.ogg", + "ins2/wpn/svt40/bltrel.ogg", + "ins2/wpn/svt40/magin.ogg", + "ins2/wpn/svt40/magout.ogg", + "ins2/wpn/svt40/maghit.ogg", + "ins2/wpn/svt40/magrel.ogg", + SHOOT_S, + EMPTY_S + }; + + void Spawn() + { + Precache(); + m_WasDrawn = false; + CommonSpawn( W_MODEL, DEFAULT_GIVE ); + } + + void Precache() + { + self.PrecacheCustomModels(); + g_Game.PrecacheModel( W_MODEL ); + g_Game.PrecacheModel( V_MODEL ); + g_Game.PrecacheModel( P_MODEL ); + g_Game.PrecacheModel( A_MODEL ); + m_iShell = g_Game.PrecacheModel( INS2BASE::BULLET_762x54 ); + + g_Game.PrecacheOther( GetAmmoName() ); + + INS2BASE::PrecacheSound( Sounds ); + INS2BASE::PrecacheSound( INS2BASE::DeployFirearmSounds ); + + g_Game.PrecacheGeneric( "sprites/" + SPR_CAT + self.pev.classname + ".txt" ); + g_Game.PrecacheGeneric( "events/" + "muzzle_ins2_MGs.txt" ); + CommonPrecache(); + } + + bool GetItemInfo( ItemInfo& out info ) + { + info.iMaxAmmo1 = (INS2BASE::ShouldUseCustomAmmo) ? MAX_CARRY : INS2BASE::DF_MAX_CARRY_357; + info.iAmmo1Drop = MAX_CLIP; + info.iMaxAmmo2 = -1; + info.iAmmo2Drop = -1; + info.iMaxClip = MAX_CLIP; + info.iSlot = SLOT; + info.iPosition = POSITION; + info.iId = g_ItemRegistry.GetIdForName( self.pev.classname ); + info.iFlags = FLAGS; + info.iWeight = WEIGHT; + + return true; + } + + bool AddToPlayer( CBasePlayer@ pPlayer ) + { + return CommonAddToPlayer( pPlayer ); + } + + bool PlayEmptySound() + { + return CommonPlayEmptySound( EMPTY_S ); + } + + bool Deploy() + { + PlayDeploySound( 3 ); + if( m_WasDrawn == false ) + { + m_WasDrawn = true; + return Deploy( V_MODEL, P_MODEL, DRAW_FIRST, "sniper", GetBodygroup(), (45.0/25.0) ); + } + else + return Deploy( V_MODEL, P_MODEL, (self.m_iClip > 0) ? DRAW : DRAW_EMPTY, "sniper", GetBodygroup(), (21.0/28.0) ); + } + + void Holster( int skipLocal = 0 ) + { + CommonHolster(); + m_pPlayer.m_szAnimExtension = "sniper"; + + BaseClass.Holster( skipLocal ); + } + + void PrimaryAttack() + { + if( self.m_iClip <= 0 ) + { + self.PlayEmptySound(); + self.SendWeaponAnim( (WeaponADSMode == INS2BASE::IRON_IN) ? IRON_DRYFIRE : DRYFIRE, 0, GetBodygroup() ); + self.m_flNextPrimaryAttack = WeaponTimeBase() + 0.3f; + return; + } + + if( ( m_pPlayer.m_afButtonPressed & IN_ATTACK == 0 ) ) + return; + + self.m_flNextPrimaryAttack = self.m_flNextSecondaryAttack = (m_pPlayer.pev.waterlevel == WATERLEVEL_HEAD) ? WeaponTimeBase() + RPM_WTR : WeaponTimeBase() + RPM_AIR; + self.m_flTimeWeaponIdle = WeaponTimeBase() + 1.0f; + + ShootWeapon( SHOOT_S, 1, VecModAcc( VECTOR_CONE_1DEGREES, 4.25f, 0.475f, 1.85f ), (m_pPlayer.pev.waterlevel == WATERLEVEL_HEAD) ? 1024 : 8192, DAMAGE, true, DMG_SNIPER | DMG_NEVERGIB ); + + m_pPlayer.m_iWeaponVolume = NORMAL_GUN_VOLUME; + m_pPlayer.m_iWeaponFlash = BRIGHT_GUN_FLASH; + + PunchAngle( Vector( Math.RandomFloat( -4.5, -3.5 ), (Math.RandomLong( 0, 1 ) < 0.5) ? -0.75f : 0.75f, Math.RandomFloat( -1.5, 1.5 ) ) ); + + if( WeaponADSMode == INS2BASE::IRON_IN ) + self.SendWeaponAnim( (self.m_iClip > 0) ? IRON_FIRE : IRON_FIRE_LAST, 0, GetBodygroup() ); + else + self.SendWeaponAnim( (self.m_iClip > 0) ? FIRE : FIRE_LAST, 0, GetBodygroup() ); + + ShellEject( m_pPlayer, m_iShell, (WeaponADSMode != INS2BASE::IRON_IN) ? Vector( 19, 4.5, -6.5 ) : Vector( 20, 0, -1.5 ) ); + } + + void SecondaryAttack() + { + self.m_flTimeWeaponIdle = self.m_flNextSecondaryAttack = WeaponTimeBase() + 0.2; + self.m_flNextPrimaryAttack = WeaponTimeBase() + 0.13; + + switch( WeaponADSMode ) + { + case INS2BASE::IRON_OUT: + { + self.SendWeaponAnim( (self.m_iClip > 0) ? IRON_TO : IRON_TO_EMPTY, 0, GetBodygroup() ); + EffectsFOVON( AIM_FOV ); + m_pPlayer.m_szAnimExtension = "sniperscope"; + break; + } + case INS2BASE::IRON_IN: + { + self.SendWeaponAnim( (self.m_iClip > 0) ? IRON_FROM : IRON_FROM_EMPTY, 0, GetBodygroup() ); + EffectsFOVOFF(); + m_pPlayer.m_szAnimExtension = "sniper"; + break; + } + } + } + + void ItemPreFrame() + { + if( m_reloadTimer < g_Engine.time && canReload ) + self.Reload(); + + BaseClass.ItemPreFrame(); + } + + void Reload() + { + if( self.m_iClip == MAX_CLIP || m_pPlayer.m_rgAmmo( self.m_iPrimaryAmmoType ) <= 0 ) + return; + + m_pPlayer.m_szAnimExtension = "sniper"; + if( WeaponADSMode == INS2BASE::IRON_IN ) + { + self.SendWeaponAnim( (self.m_iClip > 0) ? IRON_FROM : IRON_FROM_EMPTY, 0, GetBodygroup() ); + m_reloadTimer = g_Engine.time + 0.16; + m_pPlayer.m_flNextAttack = 0.16; + canReload = true; + EffectsFOVOFF(); + } + + if( m_reloadTimer < g_Engine.time ) + { + (self.m_iClip == 0) ? Reload( MAX_CLIP, RELOAD_EMPTY, (139.0/30.0), GetBodygroup() ) : Reload( MAX_CLIP, RELOAD, (99.0/30.0), GetBodygroup() ); + canReload = false; + } + + BaseClass.Reload(); + } + + void WeaponIdle() + { + if( self.m_flNextPrimaryAttack < g_Engine.time ) + m_iShotsFired = 0; + + self.ResetEmptySound(); + m_pPlayer.GetAutoaimVector( AUTOAIM_10DEGREES ); + + if( self.m_flTimeWeaponIdle > WeaponTimeBase() ) + return; + + if( WeaponADSMode == INS2BASE::IRON_IN ) + self.SendWeaponAnim( (self.m_iClip > 0) ? IRON_IDLE : IRON_IDLE_EMPTY, 0, GetBodygroup() ); + else + self.SendWeaponAnim( (self.m_iClip > 0) ? IDLE : IDLE_EMPTY, 0, GetBodygroup() ); + + self.m_flTimeWeaponIdle = WeaponTimeBase() + g_PlayerFuncs.SharedRandomFloat( m_pPlayer.random_seed, 5, 7 ); + } +} + +class SVT40_MAG : ScriptBasePlayerAmmoEntity, INS2BASE::AmmoBase +{ + void Spawn() + { + Precache(); + g_EntityFuncs.SetModel( self, A_MODEL ); + self.pev.body = MAG_BDYGRP; + BaseClass.Spawn(); + } + + void Precache() + { + g_Game.PrecacheModel( A_MODEL ); + CommonPrecache(); + } + + bool AddAmmo( CBaseEntity@ pOther ) + { + return CommonAddAmmo( pOther, MAX_CLIP, (INS2BASE::ShouldUseCustomAmmo) ? MAX_CARRY : INS2BASE::DF_MAX_CARRY_357, (INS2BASE::ShouldUseCustomAmmo) ? AMMO_TYPE : INS2BASE::DF_AMMO_357 ); + } +} + +string GetAmmoName() +{ + return "ammo_ins2svt40"; +} + +string GetName() +{ + return "weapon_ins2svt40"; +} + +void Register() +{ + if( !g_CustomEntityFuncs.IsCustomEntity( GetAmmoName() ) ) + { + g_CustomEntityFuncs.RegisterCustomEntity( "INS2_SVT40::SVT40_MAG", GetAmmoName() ); // Register the ammo entity + } + + if( !g_CustomEntityFuncs.IsCustomEntity( GetName() ) ) + { + g_CustomEntityFuncs.RegisterCustomEntity( "INS2_SVT40::weapon_ins2svt40", GetName() ); // Register the weapon entity + g_ItemRegistry.RegisterWeapon( GetName(), SPR_CAT, (INS2BASE::ShouldUseCustomAmmo) ? AMMO_TYPE : INS2BASE::DF_AMMO_357, "", GetAmmoName() ); // Register the weapon + } +} + +} \ No newline at end of file diff --git a/scripts/maps/ins2/shotg/weapon_ins2coach.as b/scripts/maps/ins2/shotg/weapon_ins2coach.as index b1014f0..196f30e 100644 --- a/scripts/maps/ins2/shotg/weapon_ins2coach.as +++ b/scripts/maps/ins2/shotg/weapon_ins2coach.as @@ -61,6 +61,7 @@ uint DAMAGESLUG = 50; uint SLOT = 3; uint POSITION = 13; float RPM_AIR = 0.115f; //Rounds per minute in air +uint AIM_FOV = 40; // Below 50 hides crosshair string AMMO_TYPE = "ins2_12x70buckball"; uint PELLETCOUNT = 6; Vector VECTOR_CONE( 0.03490, 0.03490, 0.0 ); //4x4 DEGREES @@ -202,7 +203,7 @@ class weapon_ins2coach : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase case INS2BASE::IRON_OUT: { self.SendWeaponAnim( IRON_TO, 0, GetBodygroup() ); - EffectsFOVON( 40 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/shotg/weapon_ins2ithaca.as b/scripts/maps/ins2/shotg/weapon_ins2ithaca.as index f08e72f..00b124a 100644 --- a/scripts/maps/ins2/shotg/weapon_ins2ithaca.as +++ b/scripts/maps/ins2/shotg/weapon_ins2ithaca.as @@ -64,6 +64,7 @@ uint DAMAGE_MELEE = 20; uint SLOT = 3; uint POSITION = 11; float RPM_AIR = 0.745f; //Rounds per minute in air +uint AIM_FOV = 45; // Below 50 hides crosshair string AMMO_TYPE = "ins2_12x70buckshot"; uint PELLETCOUNT = 8; Vector VECTOR_CONE( 0.04062, 0.04062, 0.0 ); //4 DEGREES? diff --git a/scripts/maps/ins2/shotg/weapon_ins2m1014.as b/scripts/maps/ins2/shotg/weapon_ins2m1014.as index 22b489c..efa68f0 100644 --- a/scripts/maps/ins2/shotg/weapon_ins2m1014.as +++ b/scripts/maps/ins2/shotg/weapon_ins2m1014.as @@ -59,6 +59,7 @@ uint SLOT = 3; uint POSITION = 14; float RPM_AIR = 0.115f; //Rounds per minute in air float RPM_WTR = 0.215f; //Rounds per minute in water +uint AIM_FOV = 45; // Below 50 hides crosshair string AMMO_TYPE = "ins2_12x70buckshot"; uint PELLETCOUNT = 8; Vector VECTOR_CONE( 0.03490, 0.04362, 0.0 ); //4x5 DEGREES @@ -201,7 +202,7 @@ class weapon_ins2m1014 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase case INS2BASE::IRON_OUT: { self.SendWeaponAnim( IRON_TO, 0, GetBodygroup() ); - EffectsFOVON( 45 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/shotg/weapon_ins2m590.as b/scripts/maps/ins2/shotg/weapon_ins2m590.as index 16d45bd..129759b 100644 --- a/scripts/maps/ins2/shotg/weapon_ins2m590.as +++ b/scripts/maps/ins2/shotg/weapon_ins2m590.as @@ -62,6 +62,7 @@ uint DAMAGE = 10; uint SLOT = 3; uint POSITION = 12; float RPM_AIR = 0.77f; //Rounds per minute in air +uint AIM_FOV = 45; // Below 50 hides crosshair string AMMO_TYPE = "ins2_12x70buckshot"; uint PELLETCOUNT = 8; Vector VECTOR_CONE( 0.04362, 0.04362, 0.0 ); //5 DEGREES @@ -238,7 +239,7 @@ class weapon_ins2m590 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase case INS2BASE::IRON_OUT: { self.SendWeaponAnim( IRON_TO, 0, GetBodygroup() ); - EffectsFOVON( 45 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/shotg/weapon_ins2saiga12.as b/scripts/maps/ins2/shotg/weapon_ins2saiga12.as index 0018e69..7fd7786 100644 --- a/scripts/maps/ins2/shotg/weapon_ins2saiga12.as +++ b/scripts/maps/ins2/shotg/weapon_ins2saiga12.as @@ -53,9 +53,10 @@ int WEIGHT = 100; int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY; uint DAMAGE = 9; uint SLOT = 3; -uint POSITION = 17; +uint POSITION = 15; float RPM_AIR = 350; //Rounds per minute in air float RPM_WTR = 250; //Rounds per minute in water +uint AIM_FOV = 45; // Below 50 hides crosshair string AMMO_TYPE = "ins2_12x70buckshot"; uint PELLETCOUNT = 8; Vector VECTOR_CONE( 0.06105, 0.06105, 0.0 ); //7 DEGREES @@ -198,7 +199,7 @@ class weapon_ins2saiga12 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase case INS2BASE::IRON_OUT: { self.SendWeaponAnim( IRON_TO, 0, GetBodygroup() ); - EffectsFOVON( 45 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/smg/weapon_ins2greasegun.as b/scripts/maps/ins2/smg/weapon_ins2greasegun.as new file mode 100644 index 0000000..24e906c --- /dev/null +++ b/scripts/maps/ins2/smg/weapon_ins2greasegun.as @@ -0,0 +1,321 @@ +// Insurgency's M3 Grease Gun +/* Model Credits +/ Model: Seth Soldier (Forgotten Hope 2), Norman The Loli Pirate (Edits, interior) +/ Textures: Seth Soldier (Forgotten Hope 2), Norman The Loli Pirate (Edits, interior) +/ Animations: New World Interactive +/ Sounds: New World Interactive, D.N.I.O. 071 (Conversion to .ogg format) +/ Sprites: D.N.I.O. 071 (Model Render), R4to0 (Vector), KernCore (.spr Compile) +/ Misc: Norman The Loli Pirate (World Model), KernCore (World Model UVs), D.N.I.O. 071 (World Model UVs, Compile) +/ Script: KernCore +*/ + +#include "../base" + +namespace INS2_GREASEGUN +{ + +// Animations +enum INS2_GREASEGUN_Animations +{ + IDLE = 0, + IDLE_EMPTY, + DRAW_FIRST, + DRAW, + DRAW_EMPTY, + HOLSTER, + HOLSTER_EMPTY, + FIRE1, + FIRE2, + FIRE3, + FIRE_LAST, + DRYFIRE, + RELOAD, + RELOAD_EMPTY, + IRON_IDLE, + IRON_IDLE_EMPTY, + IRON_FIRE1, + IRON_FIRE2, + IRON_FIRE3, + IRON_FIRE_LAST, + IRON_DRYFIRE, + IRON_TO, + IRON_TO_EMPTY, + IRON_FROM, + IRON_FROM_EMPTY +}; + +// Models +string W_MODEL = "models/ins2/wpn/grease/w_grease.mdl"; +string V_MODEL = "models/ins2/wpn/grease/v_grease.mdl"; +string P_MODEL = "models/ins2/wpn/grease/p_grease.mdl"; +string A_MODEL = "models/ins2/ammo/mags2.mdl"; +int MAG_BDYGRP = 8; +// Sprites +string SPR_CAT = "ins2/smg/"; //Weapon category used to get the sprite's location +// Sounds +string SHOOT_S = "ins2/wpn/grease/shoot.ogg"; +string EMPTY_S = "ins2/wpn/grease/empty.ogg"; +// Information +int MAX_CARRY = 1000; +int MAX_CLIP = 30; +int DEFAULT_GIVE = MAX_CLIP * 4; +int WEIGHT = 20; +int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY; +uint DAMAGE = 18; +uint SLOT = 2; +uint POSITION = 5; +float RPM_AIR = 450; //Rounds per minute in air +float RPM_WTR = 425; //Rounds per minute in water +uint AIM_FOV = 45; // Below 50 hides crosshair +string AMMO_TYPE = "ins2_45acp"; + +class weapon_ins2greasegun : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase +{ + private CBasePlayer@ m_pPlayer + { + get const { return cast( self.m_hPlayer.GetEntity() ); } + set { self.m_hPlayer = EHandle( @value ); } + } + private int m_iShell; + private bool m_WasDrawn; + private int GetBodygroup() + { + return 0; + } + private array Sounds = { + "ins2/wpn/grease/bltbk.ogg", + "ins2/wpn/grease/bltfd.ogg", + "ins2/wpn/grease/hit.ogg", + "ins2/wpn/grease/magin.ogg", + "ins2/wpn/grease/magout.ogg", + "ins2/wpn/grease/magrel.ogg", + SHOOT_S, + EMPTY_S + }; + + void Spawn() + { + Precache(); + m_WasDrawn = false; + CommonSpawn( W_MODEL, DEFAULT_GIVE ); + } + + void Precache() + { + self.PrecacheCustomModels(); + g_Game.PrecacheModel( W_MODEL ); + g_Game.PrecacheModel( V_MODEL ); + g_Game.PrecacheModel( P_MODEL ); + g_Game.PrecacheModel( A_MODEL ); + m_iShell = g_Game.PrecacheModel( INS2BASE::BULLET_45ACP ); + + g_Game.PrecacheOther( GetAmmoName() ); + + INS2BASE::PrecacheSound( Sounds ); + INS2BASE::PrecacheSound( INS2BASE::DeployFirearmSounds ); + + g_Game.PrecacheGeneric( "sprites/" + SPR_CAT + self.pev.classname + ".txt" ); + g_Game.PrecacheGeneric( "events/" + "muzzle_ins2_SMGs_big.txt" ); + CommonPrecache(); + } + + bool GetItemInfo( ItemInfo& out info ) + { + info.iMaxAmmo1 = (INS2BASE::ShouldUseCustomAmmo) ? MAX_CARRY : INS2BASE::DF_MAX_CARRY_9MM; + info.iAmmo1Drop = MAX_CLIP; + info.iMaxAmmo2 = -1; + info.iAmmo2Drop = -1; + info.iMaxClip = MAX_CLIP; + info.iSlot = SLOT; + info.iPosition = POSITION; + info.iId = g_ItemRegistry.GetIdForName( self.pev.classname ); + info.iFlags = FLAGS; + info.iWeight = WEIGHT; + + return true; + } + + bool AddToPlayer( CBasePlayer@ pPlayer ) + { + return CommonAddToPlayer( pPlayer ); + } + + bool PlayEmptySound() + { + return CommonPlayEmptySound( EMPTY_S ); + } + + bool Deploy() + { + PlayDeploySound( 3 ); + if( m_WasDrawn == false ) + { + m_WasDrawn = true; + return Deploy( V_MODEL, P_MODEL, DRAW_FIRST, "mp5", GetBodygroup(), (74.0/32.0) ); + } + else + return Deploy( V_MODEL, P_MODEL, (self.m_iClip > 0) ? DRAW : DRAW_EMPTY, "mp5", GetBodygroup(), (25.0/32.0) ); + } + + void Holster( int skipLocal = 0 ) + { + CommonHolster(); + + BaseClass.Holster( skipLocal ); + } + + void PrimaryAttack() + { + if( self.m_iClip <= 0 ) + { + self.PlayEmptySound(); + self.SendWeaponAnim( (WeaponADSMode == INS2BASE::IRON_IN) ? IRON_DRYFIRE : DRYFIRE, 0, GetBodygroup() ); + self.m_flNextPrimaryAttack = WeaponTimeBase() + 0.3f; + return; + } + + self.m_flNextPrimaryAttack = self.m_flNextSecondaryAttack = (m_pPlayer.pev.waterlevel == WATERLEVEL_HEAD) ? WeaponTimeBase() + GetFireRate( RPM_WTR ) : WeaponTimeBase() + GetFireRate( RPM_AIR ); + self.m_flTimeWeaponIdle = WeaponTimeBase() + 1.0f; + + ShootWeapon( SHOOT_S, 1, VecModAcc( VECTOR_CONE_1DEGREES, 2.3f, 0.9f, 1.9f ), (m_pPlayer.pev.waterlevel == WATERLEVEL_HEAD) ? 1024 : 8192, DAMAGE ); + + m_pPlayer.m_iWeaponVolume = NORMAL_GUN_VOLUME; + m_pPlayer.m_iWeaponFlash = BRIGHT_GUN_FLASH; + + if( WeaponADSMode != INS2BASE::IRON_IN ) + { + if( !( m_pPlayer.pev.flags & FL_ONGROUND != 0 ) ) + KickBack( 1.25f, 0.50f, 0.4, 0.045, 5.0, 3.0, 6 ); + else if( m_pPlayer.pev.velocity.Length2D() > 0 ) + KickBack( 1.20f, 0.23f, 0.25, 0.04, 3.0, 2.0, 10 ); + else if( m_pPlayer.pev.flags & FL_DUCKING != 0 ) + KickBack( 0.50f, 0.25f, 0.15, 0.02, 2.0, 1.0, 10 ); + else + KickBack( 0.70f, 0.25f, 0.15, 0.025, 2.5, 1.5, 10 ); + } + else + { + PunchAngle( Vector( Math.RandomFloat( -1.875, -2.475 ), (Math.RandomLong( 0, 1 ) < 0.5) ? -0.7f : 0.5f, Math.RandomFloat( -0.5, 0.5 ) ) ); + } + + if( WeaponADSMode == INS2BASE::IRON_IN ) + self.SendWeaponAnim( (self.m_iClip > 0) ? Math.RandomLong( IRON_FIRE1, IRON_FIRE3 ) : IRON_FIRE_LAST, 0, GetBodygroup() ); + else + self.SendWeaponAnim( (self.m_iClip > 0) ? Math.RandomLong( FIRE1, FIRE3 ) : FIRE_LAST, 0, GetBodygroup() ); + + ShellEject( m_pPlayer, m_iShell, (WeaponADSMode != INS2BASE::IRON_IN) ? Vector( 29, 8.5, -7 ) : Vector( 29, 1, -2 ) ); + } + + void SecondaryAttack() + { + self.m_flTimeWeaponIdle = self.m_flNextSecondaryAttack = WeaponTimeBase() + 0.2; + self.m_flNextPrimaryAttack = WeaponTimeBase() + 0.13; + + switch( WeaponADSMode ) + { + case INS2BASE::IRON_OUT: + { + self.SendWeaponAnim( (self.m_iClip > 0) ? IRON_TO : IRON_TO_EMPTY, 0, GetBodygroup() ); + EffectsFOVON( AIM_FOV ); + break; + } + case INS2BASE::IRON_IN: + { + self.SendWeaponAnim( (self.m_iClip > 0) ? IRON_FROM : IRON_FROM_EMPTY, 0, GetBodygroup() ); + EffectsFOVOFF(); + break; + } + } + } + + void ItemPreFrame() + { + if( m_reloadTimer < g_Engine.time && canReload ) + self.Reload(); + + BaseClass.ItemPreFrame(); + } + + void Reload() + { + if( self.m_iClip == MAX_CLIP || m_pPlayer.m_rgAmmo( self.m_iPrimaryAmmoType ) <= 0 ) + return; + + if( WeaponADSMode == INS2BASE::IRON_IN ) + { + self.SendWeaponAnim( (self.m_iClip > 0) ? IRON_FROM : IRON_FROM_EMPTY, 0, GetBodygroup() ); + m_reloadTimer = g_Engine.time + 0.16; + m_pPlayer.m_flNextAttack = 0.16; + canReload = true; + EffectsFOVOFF(); + } + + if( m_reloadTimer < g_Engine.time ) + { + (self.m_iClip == 0) ? Reload( MAX_CLIP, RELOAD_EMPTY, (155.0/35.0), GetBodygroup() ) : Reload( MAX_CLIP, RELOAD, (109.0/35.0), GetBodygroup() ); + canReload = false; + } + + BaseClass.Reload(); + } + + void WeaponIdle() + { + if( self.m_flNextPrimaryAttack < g_Engine.time ) + m_iShotsFired = 0; + + self.ResetEmptySound(); + m_pPlayer.GetAutoaimVector( AUTOAIM_10DEGREES ); + + if( self.m_flTimeWeaponIdle > WeaponTimeBase() ) + return; + + if( WeaponADSMode == INS2BASE::IRON_IN ) + self.SendWeaponAnim( (self.m_iClip > 0) ? IRON_IDLE : IRON_IDLE_EMPTY, 0, GetBodygroup() ); + else + self.SendWeaponAnim( (self.m_iClip > 0) ? IDLE : IDLE_EMPTY, 0, GetBodygroup() ); + + self.m_flTimeWeaponIdle = WeaponTimeBase() + g_PlayerFuncs.SharedRandomFloat( m_pPlayer.random_seed, 5, 7 ); + } +} + +class GREASEGUN_MAG : ScriptBasePlayerAmmoEntity, INS2BASE::AmmoBase +{ + void Spawn() + { + Precache(); + g_EntityFuncs.SetModel( self, A_MODEL ); + self.pev.body = MAG_BDYGRP; + BaseClass.Spawn(); + } + + void Precache() + { + g_Game.PrecacheModel( A_MODEL ); + CommonPrecache(); + } + + bool AddAmmo( CBaseEntity@ pOther ) + { + return CommonAddAmmo( pOther, MAX_CLIP, (INS2BASE::ShouldUseCustomAmmo) ? MAX_CARRY : INS2BASE::DF_MAX_CARRY_9MM, (INS2BASE::ShouldUseCustomAmmo) ? AMMO_TYPE : INS2BASE::DF_AMMO_9MM ); + } +} + +string GetAmmoName() +{ + return "ammo_ins2greasegun"; +} + +string GetName() +{ + return "weapon_ins2greasegun"; +} + +void Register() +{ + g_CustomEntityFuncs.RegisterCustomEntity( "INS2_GREASEGUN::weapon_ins2greasegun", GetName() ); // Register the weapon entity + g_CustomEntityFuncs.RegisterCustomEntity( "INS2_GREASEGUN::GREASEGUN_MAG", GetAmmoName() ); // Register the ammo entity + g_ItemRegistry.RegisterWeapon( GetName(), SPR_CAT, (INS2BASE::ShouldUseCustomAmmo) ? AMMO_TYPE : INS2BASE::DF_AMMO_9MM, "", GetAmmoName() ); // Register the weapon +} + +} \ No newline at end of file diff --git a/scripts/maps/ins2/smg/weapon_ins2l2a3.as b/scripts/maps/ins2/smg/weapon_ins2l2a3.as index a0ed397..2db7e7d 100644 --- a/scripts/maps/ins2/smg/weapon_ins2l2a3.as +++ b/scripts/maps/ins2/smg/weapon_ins2l2a3.as @@ -62,6 +62,7 @@ uint SLOT = 2; uint POSITION = 10; float RPM_AIR = 600; //Rounds per minute in air float RPM_WTR = 475; //Rounds per minute in water +uint AIM_FOV = 45; // Below 50 hides crosshair string AMMO_TYPE = "ins2_9x19mm"; class weapon_ins2l2a3 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase @@ -212,7 +213,7 @@ class weapon_ins2l2a3 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase case INS2BASE::IRON_OUT: { self.SendWeaponAnim( (self.m_iClip > 0) ? IRON_TO : IRON_TO_EMPTY, 0, GetBodygroup() ); - EffectsFOVON( 45 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/smg/weapon_ins2m1928.as b/scripts/maps/ins2/smg/weapon_ins2m1928.as index 2ca103b..3c3c7e3 100644 --- a/scripts/maps/ins2/smg/weapon_ins2m1928.as +++ b/scripts/maps/ins2/smg/weapon_ins2m1928.as @@ -67,9 +67,10 @@ int WEIGHT = 20; int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY; uint DAMAGE = 19; uint SLOT = 2; -uint POSITION = 13; +uint POSITION = 11; float RPM_AIR = 700; //Rounds per minute in air float RPM_WTR = 550; //Rounds per minute in water +uint AIM_FOV = 45; // Below 50 hides crosshair string AMMO_TYPE = "ins2_45acp"; class weapon_ins2m1928 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase @@ -227,7 +228,7 @@ class weapon_ins2m1928 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase case INS2BASE::IRON_OUT: { self.SendWeaponAnim( (self.m_iClip > 0) ? IRON_TO : IRON_TO_EMPTY, 0, GetBodygroup() ); - EffectsFOVON( 45 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/smg/weapon_ins2mp18.as b/scripts/maps/ins2/smg/weapon_ins2mp18.as index 680e46a..5713ff0 100644 --- a/scripts/maps/ins2/smg/weapon_ins2mp18.as +++ b/scripts/maps/ins2/smg/weapon_ins2mp18.as @@ -70,9 +70,10 @@ int WEIGHT = 20; int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY; uint DAMAGE = 18; uint SLOT = 2; -uint POSITION = 5; +uint POSITION = 7; float RPM_AIR = 450; //Rounds per minute in air float RPM_WTR = 325; //Rounds per minute in water +uint AIM_FOV = 45; // Below 50 hides crosshair string AMMO_TYPE = "ins2_9x19mm"; class weapon_ins2mp18 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase @@ -241,7 +242,7 @@ class weapon_ins2mp18 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase case INS2BASE::IRON_OUT: { self.SendWeaponAnim( (self.m_iClip > 0) ? IRON_TO : IRON_TO_EMPTY, 0, GetBodygroup() ); - EffectsFOVON( 45 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/smg/weapon_ins2mp40.as b/scripts/maps/ins2/smg/weapon_ins2mp40.as index 86731b3..b7d00c1 100644 --- a/scripts/maps/ins2/smg/weapon_ins2mp40.as +++ b/scripts/maps/ins2/smg/weapon_ins2mp40.as @@ -59,9 +59,10 @@ int WEIGHT = 20; int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY; uint DAMAGE = 18; uint SLOT = 2; -uint POSITION = 9; +uint POSITION = 8; float RPM_AIR = 550; //Rounds per minute in air float RPM_WTR = 450; //Rounds per minute in water +uint AIM_FOV = 45; // Below 50 hides crosshair string AMMO_TYPE = "ins2_9x19mm"; class weapon_ins2mp40 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase @@ -212,7 +213,7 @@ class weapon_ins2mp40 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase case INS2BASE::IRON_OUT: { self.SendWeaponAnim( (self.m_iClip > 0) ? IRON_TO : IRON_TO_EMPTY, 0, GetBodygroup() ); - EffectsFOVON( 45 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/smg/weapon_ins2mp5k.as b/scripts/maps/ins2/smg/weapon_ins2mp5k.as index 943ad3b..c6afcaa 100644 --- a/scripts/maps/ins2/smg/weapon_ins2mp5k.as +++ b/scripts/maps/ins2/smg/weapon_ins2mp5k.as @@ -52,9 +52,10 @@ int WEIGHT = 20; int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY; uint DAMAGE = 18; uint SLOT = 2; -uint POSITION = 7; +uint POSITION = 6; float RPM_AIR = 900; //Rounds per minute in air float RPM_WTR = 700; //Rounds per minute in water +uint AIM_FOV = 45; // Below 50 hides crosshair string AMMO_TYPE = "ins2_9x19mm"; class weapon_ins2mp5k : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase @@ -209,7 +210,7 @@ class weapon_ins2mp5k : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase case INS2BASE::IRON_OUT: { self.SendWeaponAnim( IRON_TO, 0, GetBodygroup() ); - EffectsFOVON( 45 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/smg/weapon_ins2mp5sd.as b/scripts/maps/ins2/smg/weapon_ins2mp5sd.as new file mode 100644 index 0000000..690000d --- /dev/null +++ b/scripts/maps/ins2/smg/weapon_ins2mp5sd.as @@ -0,0 +1,327 @@ +// Insurgency's H&K MP5SD3 +/* Model Credits +/ Model: Twinke Masta, New World Interactive (Magazine), D.N.I.O. 071 (Edits) +/ Textures: Geno, Norman The Loli Pirate (Magazine heavy edits), D.N.I.O. 071 (Edits) +/ Animations: D.N.I.O. 071 +/ Sounds: New World Interactive, D.N.I.O. 071 (Conversion to .ogg format) +/ Sprites: D.N.I.O. 071 (Model Render), R4to0 (Vector), KernCore (.spr Compile) +/ Misc: Norman The Loli Pirate (World Model), KernCore (World Model UVs), D.N.I.O. 071 (World Model UVs, Compile) +/ Script: KernCore +*/ + +#include "../base" + +namespace INS2_MP5SD +{ + +// Animations +enum INS2_MP5SD_Animations +{ + IDLE = 0, + DRAW_FIRST, + DRAW, + HOLSTER, + FIRE1, + FIRE2, + FIRE3, + DRYFIRE, + FIRESELECT, + RELOAD, + RELOAD_EMPTY_SLAP, + RELOAD_EMPTY_PULL, + RELOAD_EMPTY_PUNCH, + IRON_IDLE, + IRON_FIRE1, + IRON_FIRE2, + IRON_FIRE3, + IRON_DRYFIRE, + IRON_FIRESELECT, + IRON_TO, + IRON_FROM +}; + +// Models +string W_MODEL = "models/ins2/wpn/mp5sd/w_mp5sd.mdl"; +string V_MODEL = "models/ins2/wpn/mp5sd/v_mp5sd.mdl"; +string P_MODEL = "models/ins2/wpn/mp5sd/p_mp5sd.mdl"; +string A_MODEL = "models/ins2/ammo/mags2.mdl"; +int MAG_BDYGRP = 10; +// Sprites +string SPR_CAT = "ins2/smg/"; //Weapon category used to get the sprite's location +// Sounds +string SHOOT_S = "ins2/wpn/mp5sd/shoot.ogg"; +string EMPTY_S = "ins2/wpn/mp5sd/empty.ogg"; +// Information +int MAX_CARRY = 1000; +int MAX_CLIP = 30; +int DEFAULT_GIVE = MAX_CLIP * 4; +int WEIGHT = 20; +int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY; +uint DAMAGE = 14; +uint SLOT = 2; +uint POSITION = 9; +float RPM_AIR = 800; //Rounds per minute in air +float RPM_WTR = 600; //Rounds per minute in water +uint AIM_FOV = 45; // Below 50 hides crosshair +string AMMO_TYPE = "ins2_9x19mm"; + +class weapon_ins2mp5sd : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase +{ + private CBasePlayer@ m_pPlayer + { + get const { return cast( self.m_hPlayer.GetEntity() ); } + set { self.m_hPlayer = EHandle( @value ); } + } + private int m_iShell; + private bool m_WasDrawn; + private int GetBodygroup() + { + return 0; + } + private array Sounds = { + "ins2/wpn/mp5sd/bltbk.ogg", + "ins2/wpn/mp5sd/bltlck.ogg", + "ins2/wpn/mp5sd/bltrel.ogg", + "ins2/wpn/mp5sd/magin.ogg", + "ins2/wpn/mp5sd/magout.ogg", + "ins2/wpn/mp5sd/magrel.ogg", + "ins2/wpn/mp5sd/stock.ogg", + "ins2/wpn/mp5k/rof.ogg", + EMPTY_S, + SHOOT_S + }; + + void Spawn() + { + Precache(); + WeaponSelectFireMode = INS2BASE::SELECTFIRE_AUTO; + m_WasDrawn = false; + CommonSpawn( W_MODEL, DEFAULT_GIVE ); + } + + void Precache() + { + self.PrecacheCustomModels(); + g_Game.PrecacheModel( W_MODEL ); + g_Game.PrecacheModel( V_MODEL ); + g_Game.PrecacheModel( P_MODEL ); + g_Game.PrecacheModel( A_MODEL ); + m_iShell = g_Game.PrecacheModel( INS2BASE::BULLET_9x19 ); + + g_Game.PrecacheOther( GetAmmoName() ); + + INS2BASE::PrecacheSound( Sounds ); + INS2BASE::PrecacheSound( INS2BASE::DeployFirearmSounds ); + + g_Game.PrecacheGeneric( "sprites/" + SPR_CAT + self.pev.classname + ".txt" ); + CommonPrecache(); + } + + bool GetItemInfo( ItemInfo& out info ) + { + info.iMaxAmmo1 = (INS2BASE::ShouldUseCustomAmmo) ? MAX_CARRY : INS2BASE::DF_MAX_CARRY_9MM; + info.iAmmo1Drop = MAX_CLIP; + info.iMaxAmmo2 = -1; + info.iAmmo2Drop = -1; + info.iMaxClip = MAX_CLIP; + info.iSlot = SLOT; + info.iPosition = POSITION; + info.iId = g_ItemRegistry.GetIdForName( self.pev.classname ); + info.iFlags = FLAGS; + info.iWeight = WEIGHT; + + return true; + } + + bool AddToPlayer( CBasePlayer@ pPlayer ) + { + return CommonAddToPlayer( pPlayer ); + } + + bool PlayEmptySound() + { + return CommonPlayEmptySound( EMPTY_S ); + } + + bool Deploy() + { + PlayDeploySound( 3 ); + DisplayFiremodeSprite(); + if( m_WasDrawn == false ) + { + m_WasDrawn = true; + return Deploy( V_MODEL, P_MODEL, DRAW_FIRST, "bow", GetBodygroup(), (90.0/33.0) ); + } + else + return Deploy( V_MODEL, P_MODEL, DRAW, "bow", GetBodygroup(), (25.0/31.0) ); + } + + void Holster( int skipLocal = 0 ) + { + CommonHolster(); + + BaseClass.Holster( skipLocal ); + } + + void PrimaryAttack() + { + if( self.m_iClip <= 0 ) + { + self.PlayEmptySound(); + self.SendWeaponAnim( (WeaponADSMode == INS2BASE::IRON_IN) ? IRON_DRYFIRE : DRYFIRE, 0, GetBodygroup() ); + self.m_flNextPrimaryAttack = WeaponTimeBase() + 0.3f; + return; + } + + if( WeaponSelectFireMode == INS2BASE::SELECTFIRE_SEMI && m_pPlayer.m_afButtonPressed & IN_ATTACK == 0 ) + return; + + self.m_flNextPrimaryAttack = self.m_flNextSecondaryAttack = (m_pPlayer.pev.waterlevel == WATERLEVEL_HEAD) ? WeaponTimeBase() + GetFireRate( RPM_WTR ) : WeaponTimeBase() + GetFireRate( RPM_AIR ); + self.m_flTimeWeaponIdle = WeaponTimeBase() + 1.0f; + + ShootWeapon( SHOOT_S, 1, VecModAcc( VECTOR_CONE_1DEGREES, 1.9f, 0.75f, 1.6f ), (m_pPlayer.pev.waterlevel == WATERLEVEL_HEAD) ? 1024 : 8192, DAMAGE, false, DMG_BULLET | DMG_NEVERGIB ); + + m_pPlayer.m_iWeaponVolume = 0; + m_pPlayer.m_iWeaponFlash = 0; + + if( WeaponADSMode != INS2BASE::IRON_IN ) + { + if( !( m_pPlayer.pev.flags & FL_ONGROUND != 0 ) ) + KickBack( 0.9, 0.475, 0.35, 0.0425, 5.0, 3.0, 6 ); + else if( m_pPlayer.pev.velocity.Length2D() > 0 ) + KickBack( 0.5, 0.275, 0.2, 0.03, 3.0, 2.0, 10 ); + else if( m_pPlayer.pev.flags & FL_DUCKING != 0 ) + KickBack( 0.225, 0.15, 0.1, 0.015, 2.0, 1.0, 10 ); + else + KickBack( 0.35, 0.175, 0.125, 0.02, 2.5, 1.5, 10 ); + } + else + { + PunchAngle( Vector( Math.RandomFloat( -1.875, -2.475 ), (Math.RandomLong( 0, 1 ) < 0.5) ? -0.7f : 0.6f, Math.RandomFloat( -0.5, 0.5 ) ) ); + } + + if( WeaponADSMode == INS2BASE::IRON_IN ) + self.SendWeaponAnim( Math.RandomLong( IRON_FIRE1, IRON_FIRE3 ), 0, GetBodygroup() ); + else + self.SendWeaponAnim( Math.RandomLong( FIRE1, FIRE3 ), 0, GetBodygroup() ); + + // Old ejection vectors + // ShellEject( m_pPlayer, m_iShell, (WeaponADSMode != INS2BASE::IRON_IN) ? Vector( 18.5, 6.5, -7.1 ) : Vector( 18.5, 1.6, -3.55 ) ); + ShellEject( m_pPlayer, m_iShell, (WeaponADSMode != INS2BASE::IRON_IN) ? Vector( 18.5, 6, -6.7 ) : Vector( 18.5, 1.6, -4 ) ); + } + + void SecondaryAttack() + { + self.m_flTimeWeaponIdle = self.m_flNextSecondaryAttack = WeaponTimeBase() + 0.2; + self.m_flNextPrimaryAttack = WeaponTimeBase() + 0.13; + + switch( WeaponADSMode ) + { + case INS2BASE::IRON_OUT: + { + self.SendWeaponAnim( IRON_TO, 0, GetBodygroup() ); + EffectsFOVON( AIM_FOV ); + break; + } + case INS2BASE::IRON_IN: + { + self.SendWeaponAnim( IRON_FROM, 0, GetBodygroup() ); + EffectsFOVOFF(); + break; + } + } + } + + void ItemPreFrame() + { + if( m_reloadTimer < g_Engine.time && canReload ) + self.Reload(); + + BaseClass.ItemPreFrame(); + } + + void Reload() + { + ChangeFireMode( (WeaponADSMode == INS2BASE::IRON_IN) ? IRON_FIRESELECT : FIRESELECT, GetBodygroup(), INS2BASE::SELECTFIRE_AUTO, INS2BASE::SELECTFIRE_SEMI, (30.0/33.0) ); + + if( self.m_iClip == MAX_CLIP || m_pPlayer.m_rgAmmo( self.m_iPrimaryAmmoType ) <= 0 || m_pPlayer.pev.button & IN_USE != 0 ) + return; + + if( WeaponADSMode == INS2BASE::IRON_IN ) + { + self.SendWeaponAnim( IRON_FROM, 0, GetBodygroup() ); + m_reloadTimer = g_Engine.time + 0.16; + m_pPlayer.m_flNextAttack = 0.16; + canReload = true; + EffectsFOVOFF(); + } + + if( m_reloadTimer < g_Engine.time ) + { + (self.m_iClip == 0) ? Reload( MAX_CLIP, Math.RandomLong( RELOAD_EMPTY_SLAP, RELOAD_EMPTY_PUNCH ), (150.0/35.0), GetBodygroup() ) : Reload( MAX_CLIP, RELOAD, (100.0/35.0), GetBodygroup() ); + canReload = false; + } + + BaseClass.Reload(); + } + + void WeaponIdle() + { + if( self.m_flNextPrimaryAttack < g_Engine.time ) + m_iShotsFired = 0; + + self.ResetEmptySound(); + m_pPlayer.GetAutoaimVector( AUTOAIM_10DEGREES ); + + if( self.m_flTimeWeaponIdle > WeaponTimeBase() ) + return; + + if( WeaponADSMode == INS2BASE::IRON_IN ) + self.SendWeaponAnim( IRON_IDLE, 0, GetBodygroup() ); + else + self.SendWeaponAnim( IDLE, 0, GetBodygroup() ); + + self.m_flTimeWeaponIdle = WeaponTimeBase() + g_PlayerFuncs.SharedRandomFloat( m_pPlayer.random_seed, 5, 7 ); + } +} + +class MP5SD_MAG : ScriptBasePlayerAmmoEntity, INS2BASE::AmmoBase +{ + void Spawn() + { + Precache(); + g_EntityFuncs.SetModel( self, A_MODEL ); + self.pev.body = MAG_BDYGRP; + BaseClass.Spawn(); + } + + void Precache() + { + g_Game.PrecacheModel( A_MODEL ); + CommonPrecache(); + } + + bool AddAmmo( CBaseEntity@ pOther ) + { + return CommonAddAmmo( pOther, MAX_CLIP, (INS2BASE::ShouldUseCustomAmmo) ? MAX_CARRY : INS2BASE::DF_MAX_CARRY_9MM, (INS2BASE::ShouldUseCustomAmmo) ? AMMO_TYPE : INS2BASE::DF_AMMO_9MM ); + } +} + +string GetAmmoName() +{ + return "ammo_ins2mp5sd"; +} + +string GetName() +{ + return "weapon_ins2mp5sd"; +} + +void Register() +{ + g_CustomEntityFuncs.RegisterCustomEntity( "INS2_MP5SD::weapon_ins2mp5sd", GetName() ); // Register the weapon entity + g_CustomEntityFuncs.RegisterCustomEntity( "INS2_MP5SD::MP5SD_MAG", GetAmmoName() ); // Register the ammo entity + g_ItemRegistry.RegisterWeapon( GetName(), SPR_CAT, (INS2BASE::ShouldUseCustomAmmo) ? AMMO_TYPE : INS2BASE::DF_AMMO_9MM, "", GetAmmoName() ); // Register the weapon +} + +} \ No newline at end of file diff --git a/scripts/maps/ins2/smg/weapon_ins2mp7.as b/scripts/maps/ins2/smg/weapon_ins2mp7.as index be96701..2d9d377 100644 --- a/scripts/maps/ins2/smg/weapon_ins2mp7.as +++ b/scripts/maps/ins2/smg/weapon_ins2mp7.as @@ -53,9 +53,10 @@ int WEIGHT = 20; int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY; uint DAMAGE = 17; uint SLOT = 2; -uint POSITION = 14; +uint POSITION = 13; float RPM_AIR = 950; //Rounds per minute in air float RPM_WTR = 700; //Rounds per minute in water +uint AIM_FOV = 45; // Below 50 hides crosshair string AMMO_TYPE = "ins2_4.6x30mm"; class weapon_ins2mp7 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase @@ -210,7 +211,7 @@ class weapon_ins2mp7 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase case INS2BASE::IRON_OUT: { self.SendWeaponAnim( IRON_TO, 0, GetBodygroup() ); - EffectsFOVON( 45 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/smg/weapon_ins2ppsh41.as b/scripts/maps/ins2/smg/weapon_ins2ppsh41.as index 05fbc3d..07e3e80 100644 --- a/scripts/maps/ins2/smg/weapon_ins2ppsh41.as +++ b/scripts/maps/ins2/smg/weapon_ins2ppsh41.as @@ -63,9 +63,10 @@ int WEIGHT = 20; int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY; uint DAMAGE = 15; uint SLOT = 2; -uint POSITION = 15; +uint POSITION = 12; float RPM_AIR = 900; //Rounds per minute in air float RPM_WTR = 775; //Rounds per minute in water +uint AIM_FOV = 45; // Below 50 hides crosshair string AMMO_TYPE = "ins2_7.62x25mm"; class weapon_ins2ppsh41 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase @@ -220,7 +221,7 @@ class weapon_ins2ppsh41 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase case INS2BASE::IRON_OUT: { self.SendWeaponAnim( (self.m_iClip > 0) ? IRON_TO : IRON_TO_EMPTY, 0, GetBodygroup() ); - EffectsFOVON( 45 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/smg/weapon_ins2ump45.as b/scripts/maps/ins2/smg/weapon_ins2ump45.as index e3e1d55..0d9c95e 100644 --- a/scripts/maps/ins2/smg/weapon_ins2ump45.as +++ b/scripts/maps/ins2/smg/weapon_ins2ump45.as @@ -58,6 +58,7 @@ float RPM_AIR = 600; //Rounds per minute in air float RPM_WTR = 500; //Rounds per minute in water float RPM_BURST_AIR = 850; //Burst fire rate in air float RPM_BURST_WTR = 600; //Burst fire rate in water +uint AIM_FOV = 45; // Below 50 hides crosshair string AMMO_TYPE = "ins2_45acp"; class weapon_ins2ump45 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase @@ -234,7 +235,7 @@ class weapon_ins2ump45 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase case INS2BASE::IRON_OUT: { self.SendWeaponAnim( IRON_TO, 0, GetBodygroup() ); - EffectsFOVON( 45 ); + EffectsFOVON( AIM_FOV ); break; } case INS2BASE::IRON_IN: diff --git a/scripts/maps/ins2/srifl/weapon_ins2dragunov.as b/scripts/maps/ins2/srifl/weapon_ins2dragunov.as index 4a2c569..824f09e 100644 --- a/scripts/maps/ins2/srifl/weapon_ins2dragunov.as +++ b/scripts/maps/ins2/srifl/weapon_ins2dragunov.as @@ -62,9 +62,10 @@ int WEIGHT = 20; int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY; uint DAMAGE = 65; uint SLOT = 7; -uint POSITION = 7; +uint POSITION = 8; float RPM_AIR = 0.215f; //Rounds per minute in air float RPM_WTR = 0.375f; //Rounds per minute in water +uint AIM_FOV = 16; // Below 50 hides crosshair string AMMO_TYPE = "ins2_7.62x54mm"; class weapon_ins2dragunov : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase @@ -201,7 +202,7 @@ class weapon_ins2dragunov : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase void SightThink() { - ToggleZoom( 16 ); + ToggleZoom( AIM_FOV ); WeaponADSMode = INS2BASE::IRON_IN; SetPlayerSpeed(); m_pPlayer.m_szAnimExtension = "sniperscope"; @@ -223,7 +224,7 @@ class weapon_ins2dragunov : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase self.SendWeaponAnim( (self.m_iClip == 0) ? SCOPE_TO_EMPTY : SCOPE_TO, 0, GetBodygroup() ); g_PlayerFuncs.ScreenFade( m_pPlayer, Vector( 0, 0, 0 ), 0.47, 0, 255, FFADE_OUT ); - SetThink( ThinkFunction( SightThink ) ); + SetThink( ThinkFunction( this.SightThink ) ); self.pev.nextthink = WeaponTimeBase() + 0.46; break; } diff --git a/scripts/maps/ins2/srifl/weapon_ins2g43.as b/scripts/maps/ins2/srifl/weapon_ins2g43.as index 594d41a..978e7d1 100644 --- a/scripts/maps/ins2/srifl/weapon_ins2g43.as +++ b/scripts/maps/ins2/srifl/weapon_ins2g43.as @@ -61,6 +61,7 @@ uint SLOT = 7; uint POSITION = 6; float RPM_AIR = 0.22f; //Rounds per minute in air float RPM_WTR = 0.4f; //Rounds per minute in water +uint AIM_FOV = 20; // Below 50 hides crosshair string AMMO_TYPE = "ins2_7.92x57mm"; class weapon_ins2g43 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase @@ -194,7 +195,7 @@ class weapon_ins2g43 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase void SightThink() { - ToggleZoom( 20 ); + ToggleZoom( AIM_FOV ); WeaponADSMode = INS2BASE::IRON_IN; SetPlayerSpeed(); m_pPlayer.m_szAnimExtension = "sniperscope"; @@ -215,7 +216,7 @@ class weapon_ins2g43 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase { self.SendWeaponAnim( SCOPE_TO, 0, GetBodygroup() ); g_PlayerFuncs.ScreenFade( m_pPlayer, Vector( 0, 0, 0 ), 0.47, 0, 255, FFADE_OUT ); - SetThink( ThinkFunction( SightThink ) ); + SetThink( ThinkFunction( this.SightThink ) ); self.pev.nextthink = WeaponTimeBase() + 0.46; break; } diff --git a/scripts/maps/ins2/srifl/weapon_ins2m21.as b/scripts/maps/ins2/srifl/weapon_ins2m21.as new file mode 100644 index 0000000..a134f30 --- /dev/null +++ b/scripts/maps/ins2/srifl/weapon_ins2m21.as @@ -0,0 +1,331 @@ +// Insurgency's M21 + Redfield ART 1 +/* Model Credits +/ Model: Spezz (Base M14), Norman The Loli Pirate (XM21 parts, Scope) +/ Textures: Thanez (base M14), Norman The Loli Pirate (XM21 parts, Scope, Stock) +/ Animations: New World Interactive, MyZombieKillerz, D.N.I.O. 071 (Edits) +/ Sounds: New World Interactive, Magmacow, Solarint, D.N.I.O. 071 (Conversion to .ogg format) +/ Sprites: D.N.I.O. 071 (Model Render), R4to0 (Vector), KernCore (.spr Compile) +/ Misc: D.N.I.O. 071 (World Model UVs, Compile), Norman The Loli Pirate (World Model) +/ Script: KernCore +*/ + +#include "../base" + +namespace INS2_XM21 +{ + +// Animations +enum INS2_M21_Animations +{ + IDLE = 0, + IDLE_EMPTY, + DRAW_FIRST, + DRAW, + DRAW_EMPTY, + HOLSTER, + HOLSTER_EMPTY, + FIRE1, + FIRE2, + FIRE3, + FIRE_LAST, + DRYFIRE, + RELOAD, + RELOAD_EMPTY, + SCOPE_TO, + SCOPE_TO_EMPTY, + SCOPE_FROM, + SCOPE_FROM_EMPTY +}; + +enum SCOPE_Animations +{ + SCP_IDLE_FOV20 = 0, + SCP_FIRE_FOV20, + SCP_DRYFIRE_FOV20 +}; + +// Models +string W_MODEL = "models/ins2/wpn/m21/w_m21.mdl"; +string V_MODEL = "models/ins2/wpn/m21/v_m21.mdl"; +string P_MODEL = "models/ins2/wpn/m21/p_m21.mdl"; +string S_MODEL = "models/ins2/wpn/scopes/xm21.mdl"; +string A_MODEL = "models/ins2/ammo/mags2.mdl"; +int MAG_BDYGRP = 9; +// Sprites +string SPR_CAT = "ins2/srf/"; //Weapon category used to get the sprite's location +// Sounds +string SHOOT_S = "ins2/wpn/m21/shoot.ogg"; +string EMPTY_S = "ins2/wpn/m21/empty.ogg"; +// Information +int MAX_CARRY = 1000; +int MAX_CLIP = 10; +int DEFAULT_GIVE = MAX_CLIP * 4; +int WEIGHT = 20; +int FLAGS = ITEM_FLAG_NOAUTORELOAD | ITEM_FLAG_NOAUTOSWITCHEMPTY; +uint DAMAGE = 60; +uint SLOT = 7; +uint POSITION = 7; +float RPM_AIR = 0.185f; //Rounds per minute in air +float RPM_WTR = 0.4f; //Rounds per minute in water +uint AIM_FOV = 16; // Below 50 hides crosshair +string AMMO_TYPE = "ins2_7.62x51mm"; + +class weapon_ins2m21 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase +{ + private CBasePlayer@ m_pPlayer + { + get const { return cast( self.m_hPlayer.GetEntity() ); } + set { self.m_hPlayer = EHandle( @value ); } + } + private int m_iShell; + private bool m_WasDrawn; + private int GetBodygroup() + { + return 0; + } + private array Sounds = { + "ins2/wpn/m14ebr/bltbk.ogg", + "ins2/wpn/m14ebr/bltrel.ogg", + "ins2/wpn/m14ebr/magrel.ogg", + "ins2/wpn/m21/magin.ogg", + "ins2/wpn/m21/magout.ogg", + EMPTY_S, + SHOOT_S + }; + + void Spawn() + { + Precache(); + m_WasDrawn = false; + CommonSpawn( W_MODEL, DEFAULT_GIVE ); + } + + void Precache() + { + self.PrecacheCustomModels(); + g_Game.PrecacheModel( W_MODEL ); + g_Game.PrecacheModel( V_MODEL ); + g_Game.PrecacheModel( P_MODEL ); + g_Game.PrecacheModel( A_MODEL ); + g_Game.PrecacheModel( S_MODEL ); + m_iShell = g_Game.PrecacheModel( INS2BASE::BULLET_762x51 ); + + g_Game.PrecacheOther( GetAmmoName() ); + + INS2BASE::PrecacheSound( Sounds ); + INS2BASE::PrecacheSound( INS2BASE::DeployFirearmSounds ); + + g_Game.PrecacheGeneric( "sprites/" + SPR_CAT + self.pev.classname + ".txt" ); + CommonPrecache(); + } + + bool GetItemInfo( ItemInfo& out info ) + { + info.iMaxAmmo1 = (INS2BASE::ShouldUseCustomAmmo) ? MAX_CARRY : INS2BASE::DF_MAX_CARRY_M40A1; + info.iAmmo1Drop = MAX_CLIP; + info.iMaxAmmo2 = -1; + info.iAmmo2Drop = -1; + info.iMaxClip = MAX_CLIP; + info.iSlot = SLOT; + info.iPosition = POSITION; + info.iId = g_ItemRegistry.GetIdForName( self.pev.classname ); + info.iFlags = FLAGS; + info.iWeight = WEIGHT; + + return true; + } + + bool AddToPlayer( CBasePlayer@ pPlayer ) + { + return CommonAddToPlayer( pPlayer ); + } + + bool PlayEmptySound() + { + return CommonPlayEmptySound( EMPTY_S ); + } + + bool Deploy() + { + PlayDeploySound( 3 ); + if( m_WasDrawn == false ) + { + m_WasDrawn = true; + return Deploy( V_MODEL, P_MODEL, DRAW_FIRST, "sniper", GetBodygroup(), (94.0/36.0) ); + } + else + return Deploy( V_MODEL, P_MODEL, (self.m_iClip == 0) ? DRAW_EMPTY : DRAW, "sniper", GetBodygroup(), (22.0/31.0) ); + } + + void Holster( int skipLocal = 0 ) + { + CommonHolster(); + + BaseClass.Holster( skipLocal ); + } + + void PrimaryAttack() + { + if( self.m_iClip <= 0 ) + { + self.PlayEmptySound(); + if( WeaponADSMode == INS2BASE::IRON_IN ) + self.SendWeaponAnim( SCP_DRYFIRE_FOV20, 0, GetBodygroup() ); + else + self.SendWeaponAnim( DRYFIRE, 0, GetBodygroup() ); + + self.m_flNextPrimaryAttack = WeaponTimeBase() + 0.3f; + return; + } + + if( m_pPlayer.m_afButtonPressed & IN_ATTACK == 0 ) + return; + + self.m_flNextPrimaryAttack = self.m_flNextSecondaryAttack = (m_pPlayer.pev.waterlevel == WATERLEVEL_HEAD) ? WeaponTimeBase() + RPM_WTR : WeaponTimeBase() + RPM_AIR; + self.m_flTimeWeaponIdle = WeaponTimeBase() + 1.0f; + + ShootWeapon( SHOOT_S, 1, VecModAcc( VECTOR_CONE_1DEGREES, 1.27f, 0.27f, 1.27f ), (m_pPlayer.pev.waterlevel == WATERLEVEL_HEAD) ? 1024 : 16384, DAMAGE, true, DMG_SNIPER ); + + m_pPlayer.m_iWeaponVolume = NORMAL_GUN_VOLUME; + m_pPlayer.m_iWeaponFlash = BRIGHT_GUN_FLASH; + + PunchAngle( Vector( Math.RandomFloat( -6.0, -5.0 ), (Math.RandomLong( 0, 1 ) < 0.5) ? -0.75f : 0.75f, Math.RandomFloat( -0.95, 0.95 ) ) ); + + if( WeaponADSMode == INS2BASE::IRON_IN ) + self.SendWeaponAnim( SCP_FIRE_FOV20, 0, GetBodygroup() ); + else + self.SendWeaponAnim( (self.m_iClip > 0) ? Math.RandomLong( FIRE1, FIRE3 ) : FIRE_LAST, 0, GetBodygroup() ); + + ShellEject( m_pPlayer, m_iShell, (WeaponADSMode != INS2BASE::IRON_IN) ? Vector( 18.5, 6.5, -7.1 ) : Vector( 18.5, 1.6, -3.55 ) ); + } + + void SightThink() + { + ToggleZoom( AIM_FOV ); + WeaponADSMode = INS2BASE::IRON_IN; + SetPlayerSpeed(); + m_pPlayer.m_szAnimExtension = "sniperscope"; + m_pPlayer.SetVModelPos( Vector( 0, 0, 0 ) ); + m_pPlayer.pev.viewmodel = S_MODEL; + self.SendWeaponAnim( SCP_IDLE_FOV20, 0, GetBodygroup() ); + } + + void SecondaryAttack() + { + self.m_flTimeWeaponIdle = self.m_flNextSecondaryAttack = WeaponTimeBase() + 0.47; + self.m_flNextPrimaryAttack = WeaponTimeBase() + 0.47; + g_SoundSystem.EmitSoundDyn( m_pPlayer.edict(), CHAN_VOICE, INS2BASE::AimDownSights_in[ Math.RandomLong( 0, INS2BASE::AimDownSights_in.length() - 1 )], VOL_NORM, ATTN_NORM, 0, PITCH_NORM ); + + switch( WeaponADSMode ) + { + case INS2BASE::IRON_OUT: + { + self.SendWeaponAnim( (self.m_iClip == 0) ? SCOPE_TO_EMPTY : SCOPE_TO, 0, GetBodygroup() ); + g_PlayerFuncs.ScreenFade( m_pPlayer, Vector( 0, 0, 0 ), 0.47, 0, 255, FFADE_OUT ); + + SetThink( ThinkFunction( this.SightThink ) ); + self.pev.nextthink = WeaponTimeBase() + 0.46; + break; + } + case INS2BASE::IRON_IN: + { + self.SendWeaponAnim( (self.m_iClip == 0) ? SCOPE_FROM_EMPTY : SCOPE_FROM, 0, GetBodygroup() ); + m_pPlayer.ResetVModelPos(); + m_pPlayer.pev.viewmodel = V_MODEL; + m_pPlayer.m_szAnimExtension = "sniper"; + EffectsFOVOFF(); + break; + } + } + } + + void ItemPreFrame() + { + if( m_reloadTimer < g_Engine.time && canReload ) + self.Reload(); + + BaseClass.ItemPreFrame(); + } + + void Reload() + { + if( self.m_iClip == MAX_CLIP || m_pPlayer.m_rgAmmo( self.m_iPrimaryAmmoType ) <= 0 ) + return; + + if( WeaponADSMode == INS2BASE::IRON_IN ) + { + m_pPlayer.m_szAnimExtension = "sniper"; + m_pPlayer.pev.viewmodel = V_MODEL; + self.SendWeaponAnim( (self.m_iClip == 0) ? SCOPE_FROM_EMPTY : SCOPE_FROM, 0, GetBodygroup() ); + m_reloadTimer = g_Engine.time + 0.46; + m_pPlayer.m_flNextAttack = 0.46; + canReload = true; + EffectsFOVOFF(); + } + + if( m_reloadTimer < g_Engine.time ) + { + (self.m_iClip == 0) ? Reload( MAX_CLIP, RELOAD_EMPTY, (182.0/37.0), GetBodygroup() ) : Reload( MAX_CLIP, RELOAD, (135.0/37.0), GetBodygroup() ); + canReload = false; + } + + BaseClass.Reload(); + } + + void WeaponIdle() + { + self.ResetEmptySound(); + m_pPlayer.GetAutoaimVector( AUTOAIM_10DEGREES ); + + if( self.m_flTimeWeaponIdle > WeaponTimeBase() ) + return; + + if( WeaponADSMode == INS2BASE::IRON_IN ) + self.SendWeaponAnim( SCP_IDLE_FOV20, 0, GetBodygroup() ); + else + self.SendWeaponAnim( (self.m_iClip == 0) ? IDLE_EMPTY : IDLE, 0, GetBodygroup() ); + + self.m_flTimeWeaponIdle = WeaponTimeBase() + g_PlayerFuncs.SharedRandomFloat( m_pPlayer.random_seed, 5, 7 ); + } +} + +class M21_MAG : ScriptBasePlayerAmmoEntity, INS2BASE::AmmoBase +{ + void Spawn() + { + Precache(); + g_EntityFuncs.SetModel( self, A_MODEL ); + self.pev.body = MAG_BDYGRP; + BaseClass.Spawn(); + } + + void Precache() + { + g_Game.PrecacheModel( A_MODEL ); + CommonPrecache(); + } + + bool AddAmmo( CBaseEntity@ pOther ) + { + return CommonAddAmmo( pOther, MAX_CLIP, (INS2BASE::ShouldUseCustomAmmo) ? MAX_CARRY : INS2BASE::DF_MAX_CARRY_M40A1, (INS2BASE::ShouldUseCustomAmmo) ? AMMO_TYPE : INS2BASE::DF_AMMO_M40A1 ); + } +} + +string GetAmmoName() +{ + return "ammo_ins2m21"; +} + +string GetName() +{ + return "weapon_ins2m21"; +} + +void Register() +{ + g_CustomEntityFuncs.RegisterCustomEntity( "INS2_XM21::weapon_ins2m21", GetName() ); // Register the weapon entity + g_CustomEntityFuncs.RegisterCustomEntity( "INS2_XM21::M21_MAG", GetAmmoName() ); // Register the ammo entity + g_ItemRegistry.RegisterWeapon( GetName(), SPR_CAT, (INS2BASE::ShouldUseCustomAmmo) ? AMMO_TYPE : INS2BASE::DF_AMMO_M40A1, "", GetAmmoName() ); // Register the weapon +} + +} \ No newline at end of file diff --git a/scripts/maps/ins2/srifl/weapon_ins2m40a1.as b/scripts/maps/ins2/srifl/weapon_ins2m40a1.as index b1518be..1241e26 100644 --- a/scripts/maps/ins2/srifl/weapon_ins2m40a1.as +++ b/scripts/maps/ins2/srifl/weapon_ins2m40a1.as @@ -69,6 +69,7 @@ uint DAMAGE = 100; uint SLOT = 7; uint POSITION = 4; float RPM = 1.50f; //Rounds per minute in air +uint AIM_FOV = 15; // Below 50 hides crosshair string AMMO_TYPE = "ins2_7.62x51mm"; class weapon_ins2m40a1 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase @@ -248,7 +249,7 @@ class weapon_ins2m40a1 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase void SightThink() { - ToggleZoom( 15 ); + ToggleZoom( AIM_FOV ); WeaponADSMode = INS2BASE::IRON_IN; SetPlayerSpeed(); m_pPlayer.m_szAnimExtension = "sniperscope"; @@ -269,7 +270,7 @@ class weapon_ins2m40a1 : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase { self.SendWeaponAnim( (self.m_iClip > 0) ? SCOPE_TO : SCOPE_TO_EMPTY, 0, GetBodygroup() ); g_PlayerFuncs.ScreenFade( m_pPlayer, Vector( 0, 0, 0 ), 0.47, 0, 255, FFADE_OUT ); - SetThink( ThinkFunction( SightThink ) ); + SetThink( ThinkFunction( this.SightThink ) ); self.pev.nextthink = WeaponTimeBase() + 0.46; break; } diff --git a/scripts/maps/ins2/srifl/weapon_ins2mosin.as b/scripts/maps/ins2/srifl/weapon_ins2mosin.as index 788cc30..1f48dba 100644 --- a/scripts/maps/ins2/srifl/weapon_ins2mosin.as +++ b/scripts/maps/ins2/srifl/weapon_ins2mosin.as @@ -70,6 +70,7 @@ uint DAMAGE = 110; uint SLOT = 7; uint POSITION = 5; float RPM = 1.65f; //Rounds per minute in air +uint AIM_FOV = 20; // Below 50 hides crosshair string AMMO_TYPE = "ins2_7.62x54mm"; class weapon_ins2mosin : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase @@ -245,7 +246,7 @@ class weapon_ins2mosin : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase void SightThink() { - ToggleZoom( 20 ); + ToggleZoom( AIM_FOV ); WeaponADSMode = INS2BASE::IRON_IN; SetPlayerSpeed(); m_pPlayer.m_szAnimExtension = "sniperscope"; @@ -266,7 +267,7 @@ class weapon_ins2mosin : ScriptBasePlayerWeaponEntity, INS2BASE::WeaponBase { self.SendWeaponAnim( (self.m_iClip > 0) ? SCOPE_TO : SCOPE_TO_EMPTY, 0, GetBodygroup() ); g_PlayerFuncs.ScreenFade( m_pPlayer, Vector( 0, 0, 0 ), 0.47, 0, 255, FFADE_OUT ); - SetThink( ThinkFunction( SightThink ) ); + SetThink( ThinkFunction( this.SightThink ) ); self.pev.nextthink = WeaponTimeBase() + 0.46; break; } diff --git a/scripts/maps/ins2/weapons.as b/scripts/maps/ins2/weapons.as index b1da471..6d59261 100644 --- a/scripts/maps/ins2/weapons.as +++ b/scripts/maps/ins2/weapons.as @@ -8,15 +8,20 @@ #include "arifl/weapon_ins2f2000" #include "arifl/weapon_ins2l85a2" #include "arifl/weapon_ins2ak74" +#include "arifl/weapon_ins2an94" +#include "arifl/weapon_ins2groza" +#include "arifl/weapon_ins2m16a1" //battle rifles #include "brifl/weapon_ins2fnfal" #include "brifl/weapon_ins2g3a3" #include "brifl/weapon_ins2m14ebr" #include "brifl/weapon_ins2fg42" +#include "brifl/weapon_ins2scarh" //rifles #include "rifle/weapon_ins2garand" #include "rifle/weapon_ins2kar98k" #include "rifle/weapon_ins2enfield" +#include "rifle/weapon_ins2svt40" //handguns #include "handg/weapon_ins2usp" #include "handg/weapon_ins2beretta" @@ -28,12 +33,15 @@ #include "handg/weapon_ins2makarov" #include "handg/weapon_ins2webley" #include "handg/weapon_ins2python" +#include "handg/weapon_ins2vp70" //lmgs #include "lmg/weapon_ins2rpk" #include "lmg/weapon_ins2m249" #include "lmg/weapon_ins2mg42" #include "lmg/weapon_ins2lewis" #include "lmg/weapon_ins2m60" +#include "lmg/weapon_ins2pkm" +#include "lmg/weapon_ins2mg34" //explosives/launchers #include "explo/weapon_ins2mk2" #include "explo/weapon_ins2rpg7" @@ -44,6 +52,7 @@ #include "explo/weapon_ins2m79" #include "explo/weapon_ins2pzschreck" #include "explo/weapon_ins2at4" +#include "explo/weapon_ins2rgo" //shotguns #include "shotg/weapon_ins2m590" #include "shotg/weapon_ins2m1014" @@ -59,6 +68,8 @@ #include "smg/weapon_ins2m1928" #include "smg/weapon_ins2mp7" #include "smg/weapon_ins2mp18" +#include "smg/weapon_ins2greasegun" +#include "smg/weapon_ins2mp5sd" //carbines #include "carbn/weapon_ins2sks" #include "carbn/weapon_ins2m4a1" @@ -66,6 +77,7 @@ #include "carbn/weapon_ins2aks74u" #include "carbn/weapon_ins2c96carb" #include "carbn/weapon_ins2m1a1para" +#include "carbn/weapon_ins2g36c" //melees #include "melee/weapon_ins2kabar" #include "melee/weapon_ins2knuckles" @@ -75,6 +87,7 @@ #include "srifl/weapon_ins2mosin" #include "srifl/weapon_ins2m40a1" #include "srifl/weapon_ins2g43" +#include "srifl/weapon_ins2m21" void RegisterAll() { @@ -88,15 +101,20 @@ void RegisterAll() INS2_F2000::Register(); INS2_L85A2::Register(); INS2_AK74::Register(); + INS2_AN94::Register(); + INS2_GROZA::Register(); + INS2_M16A1::Register(); //battle rifles INS2_FNFAL::Register(); INS2_G3A3::Register(); INS2_M14EBR::Register(); INS2_FG42::Register(); + INS2_SCARH::Register(); //rifles INS2_M1GARAND::Register(); INS2_K98K::Register(); INS2_ENFIELD::Register(); + INS2_SVT40::Register(); //handguns INS2_USP::Register(); INS2_M9BERETTA::Register(); @@ -108,12 +126,15 @@ void RegisterAll() INS2_MAKAROV::Register(); INS2_WEBLEY::Register(); INS2_PYTHON::Register(); + INS2_VP70::Register(); //lmgs INS2_RPK::Register(); INS2_M249::Register(); INS2_MG42::Register(); INS2_LEWIS::Register(); INS2_M60::Register(); + INS2_PKM::Register(); + INS2_MG34::Register(); //explosives/launchers INS2_MK2GRENADE::Register(); INS2_RPG7::Register(); @@ -124,6 +145,7 @@ void RegisterAll() INS2_M79::Register(); INS2_PZSCHRECK::Register(); INS2_AT4::Register(); + INS2_RGOGRENADE::Register(); //shotguns INS2_M590::Register(); INS2_M1014::Register(); @@ -139,6 +161,8 @@ void RegisterAll() INS2_MP7::Register(); INS2_M1928::Register(); INS2_MP18::Register(); + INS2_GREASEGUN::Register(); + INS2_MP5SD::Register(); //carbines INS2_C96CARBINE::Register(); INS2_SKS::Register(); @@ -146,6 +170,7 @@ void RegisterAll() INS2_MK18::Register(); INS2_AKS74U::Register(); INS2_M1A1PARA::Register(); + INS2_G36C::Register(); //melees INS2_KABAR::Register(); INS2_KNUCKLES::Register(); @@ -155,4 +180,5 @@ void RegisterAll() INS2_MOSIN::Register(); INS2_M40A1::Register(); INS2_G43::Register(); + INS2_XM21::Register(); } \ No newline at end of file diff --git a/sound/ins2/wpn/an94/bltbk.ogg b/sound/ins2/wpn/an94/bltbk.ogg new file mode 100644 index 0000000..c0d213d Binary files /dev/null and b/sound/ins2/wpn/an94/bltbk.ogg differ diff --git a/sound/ins2/wpn/an94/bltrel.ogg b/sound/ins2/wpn/an94/bltrel.ogg new file mode 100644 index 0000000..c66c86e Binary files /dev/null and b/sound/ins2/wpn/an94/bltrel.ogg differ diff --git a/sound/ins2/wpn/an94/magin.ogg b/sound/ins2/wpn/an94/magin.ogg new file mode 100644 index 0000000..b722cbc Binary files /dev/null and b/sound/ins2/wpn/an94/magin.ogg differ diff --git a/sound/ins2/wpn/an94/magout.ogg b/sound/ins2/wpn/an94/magout.ogg new file mode 100644 index 0000000..768bfe7 Binary files /dev/null and b/sound/ins2/wpn/an94/magout.ogg differ diff --git a/sound/ins2/wpn/an94/magrtl.ogg b/sound/ins2/wpn/an94/magrtl.ogg new file mode 100644 index 0000000..522b9e9 Binary files /dev/null and b/sound/ins2/wpn/an94/magrtl.ogg differ diff --git a/sound/ins2/wpn/an94/rof.ogg b/sound/ins2/wpn/an94/rof.ogg new file mode 100644 index 0000000..04196c9 Binary files /dev/null and b/sound/ins2/wpn/an94/rof.ogg differ diff --git a/sound/ins2/wpn/an94/shoot.ogg b/sound/ins2/wpn/an94/shoot.ogg new file mode 100644 index 0000000..e5223f3 Binary files /dev/null and b/sound/ins2/wpn/an94/shoot.ogg differ diff --git a/sound/ins2/wpn/g36c/bltbk.ogg b/sound/ins2/wpn/g36c/bltbk.ogg new file mode 100644 index 0000000..f682857 Binary files /dev/null and b/sound/ins2/wpn/g36c/bltbk.ogg differ diff --git a/sound/ins2/wpn/g36c/bltrel.ogg b/sound/ins2/wpn/g36c/bltrel.ogg new file mode 100644 index 0000000..7e79f12 Binary files /dev/null and b/sound/ins2/wpn/g36c/bltrel.ogg differ diff --git a/sound/ins2/wpn/g36c/hit.ogg b/sound/ins2/wpn/g36c/hit.ogg new file mode 100644 index 0000000..77d6bfa Binary files /dev/null and b/sound/ins2/wpn/g36c/hit.ogg differ diff --git a/sound/ins2/wpn/g36c/magin.ogg b/sound/ins2/wpn/g36c/magin.ogg new file mode 100644 index 0000000..4d908b4 Binary files /dev/null and b/sound/ins2/wpn/g36c/magin.ogg differ diff --git a/sound/ins2/wpn/g36c/magout.ogg b/sound/ins2/wpn/g36c/magout.ogg new file mode 100644 index 0000000..ba9d6db Binary files /dev/null and b/sound/ins2/wpn/g36c/magout.ogg differ diff --git a/sound/ins2/wpn/g36c/magrel.ogg b/sound/ins2/wpn/g36c/magrel.ogg new file mode 100644 index 0000000..c62e57e Binary files /dev/null and b/sound/ins2/wpn/g36c/magrel.ogg differ diff --git a/sound/ins2/wpn/g36c/rof.ogg b/sound/ins2/wpn/g36c/rof.ogg new file mode 100644 index 0000000..a9da232 Binary files /dev/null and b/sound/ins2/wpn/g36c/rof.ogg differ diff --git a/sound/ins2/wpn/g36c/shoot.ogg b/sound/ins2/wpn/g36c/shoot.ogg new file mode 100644 index 0000000..c57d777 Binary files /dev/null and b/sound/ins2/wpn/g36c/shoot.ogg differ diff --git a/sound/ins2/wpn/grease/bltbk.ogg b/sound/ins2/wpn/grease/bltbk.ogg new file mode 100644 index 0000000..372fe58 Binary files /dev/null and b/sound/ins2/wpn/grease/bltbk.ogg differ diff --git a/sound/ins2/wpn/grease/bltfd.ogg b/sound/ins2/wpn/grease/bltfd.ogg new file mode 100644 index 0000000..48a6090 Binary files /dev/null and b/sound/ins2/wpn/grease/bltfd.ogg differ diff --git a/sound/ins2/wpn/grease/empty.ogg b/sound/ins2/wpn/grease/empty.ogg new file mode 100644 index 0000000..87131ff Binary files /dev/null and b/sound/ins2/wpn/grease/empty.ogg differ diff --git a/sound/ins2/wpn/grease/hit.ogg b/sound/ins2/wpn/grease/hit.ogg new file mode 100644 index 0000000..b6115e9 Binary files /dev/null and b/sound/ins2/wpn/grease/hit.ogg differ diff --git a/sound/ins2/wpn/grease/magin.ogg b/sound/ins2/wpn/grease/magin.ogg new file mode 100644 index 0000000..d09c42a Binary files /dev/null and b/sound/ins2/wpn/grease/magin.ogg differ diff --git a/sound/ins2/wpn/grease/magout.ogg b/sound/ins2/wpn/grease/magout.ogg new file mode 100644 index 0000000..418c2bb Binary files /dev/null and b/sound/ins2/wpn/grease/magout.ogg differ diff --git a/sound/ins2/wpn/grease/magrel.ogg b/sound/ins2/wpn/grease/magrel.ogg new file mode 100644 index 0000000..da06f22 Binary files /dev/null and b/sound/ins2/wpn/grease/magrel.ogg differ diff --git a/sound/ins2/wpn/grease/shoot.ogg b/sound/ins2/wpn/grease/shoot.ogg new file mode 100644 index 0000000..599c892 Binary files /dev/null and b/sound/ins2/wpn/grease/shoot.ogg differ diff --git a/sound/ins2/wpn/gren/spoon2.ogg b/sound/ins2/wpn/gren/spoon2.ogg new file mode 100644 index 0000000..d2de264 Binary files /dev/null and b/sound/ins2/wpn/gren/spoon2.ogg differ diff --git a/sound/ins2/wpn/groza/bltbk.ogg b/sound/ins2/wpn/groza/bltbk.ogg new file mode 100644 index 0000000..320ffd0 Binary files /dev/null and b/sound/ins2/wpn/groza/bltbk.ogg differ diff --git a/sound/ins2/wpn/groza/bltfd.ogg b/sound/ins2/wpn/groza/bltfd.ogg new file mode 100644 index 0000000..84f27ac Binary files /dev/null and b/sound/ins2/wpn/groza/bltfd.ogg differ diff --git a/sound/ins2/wpn/groza/clik.ogg b/sound/ins2/wpn/groza/clik.ogg new file mode 100644 index 0000000..2b0d390 Binary files /dev/null and b/sound/ins2/wpn/groza/clik.ogg differ diff --git a/sound/ins2/wpn/groza/desel.ogg b/sound/ins2/wpn/groza/desel.ogg new file mode 100644 index 0000000..a6027ef Binary files /dev/null and b/sound/ins2/wpn/groza/desel.ogg differ diff --git a/sound/ins2/wpn/groza/magin.ogg b/sound/ins2/wpn/groza/magin.ogg new file mode 100644 index 0000000..f20d960 Binary files /dev/null and b/sound/ins2/wpn/groza/magin.ogg differ diff --git a/sound/ins2/wpn/groza/magout.ogg b/sound/ins2/wpn/groza/magout.ogg new file mode 100644 index 0000000..3bc3a5d Binary files /dev/null and b/sound/ins2/wpn/groza/magout.ogg differ diff --git a/sound/ins2/wpn/groza/magrel.ogg b/sound/ins2/wpn/groza/magrel.ogg new file mode 100644 index 0000000..d50743e Binary files /dev/null and b/sound/ins2/wpn/groza/magrel.ogg differ diff --git a/sound/ins2/wpn/groza/rof.ogg b/sound/ins2/wpn/groza/rof.ogg new file mode 100644 index 0000000..afc9401 Binary files /dev/null and b/sound/ins2/wpn/groza/rof.ogg differ diff --git a/sound/ins2/wpn/groza/sel.ogg b/sound/ins2/wpn/groza/sel.ogg new file mode 100644 index 0000000..915cf31 Binary files /dev/null and b/sound/ins2/wpn/groza/sel.ogg differ diff --git a/sound/ins2/wpn/groza/shoot.ogg b/sound/ins2/wpn/groza/shoot.ogg new file mode 100644 index 0000000..97e4994 Binary files /dev/null and b/sound/ins2/wpn/groza/shoot.ogg differ diff --git a/sound/ins2/wpn/groza/swtch.ogg b/sound/ins2/wpn/groza/swtch.ogg new file mode 100644 index 0000000..1e84cca Binary files /dev/null and b/sound/ins2/wpn/groza/swtch.ogg differ diff --git a/sound/ins2/wpn/m21/empty.ogg b/sound/ins2/wpn/m21/empty.ogg new file mode 100644 index 0000000..4ebf95f Binary files /dev/null and b/sound/ins2/wpn/m21/empty.ogg differ diff --git a/sound/ins2/wpn/m21/magin.ogg b/sound/ins2/wpn/m21/magin.ogg new file mode 100644 index 0000000..56e1c07 Binary files /dev/null and b/sound/ins2/wpn/m21/magin.ogg differ diff --git a/sound/ins2/wpn/m21/magout.ogg b/sound/ins2/wpn/m21/magout.ogg new file mode 100644 index 0000000..086471e Binary files /dev/null and b/sound/ins2/wpn/m21/magout.ogg differ diff --git a/sound/ins2/wpn/m21/shoot.ogg b/sound/ins2/wpn/m21/shoot.ogg new file mode 100644 index 0000000..501e477 Binary files /dev/null and b/sound/ins2/wpn/m21/shoot.ogg differ diff --git a/sound/ins2/wpn/mg34/bltbk.ogg b/sound/ins2/wpn/mg34/bltbk.ogg new file mode 100644 index 0000000..e310e4f Binary files /dev/null and b/sound/ins2/wpn/mg34/bltbk.ogg differ diff --git a/sound/ins2/wpn/mg34/bltrel.ogg b/sound/ins2/wpn/mg34/bltrel.ogg new file mode 100644 index 0000000..a67fedc Binary files /dev/null and b/sound/ins2/wpn/mg34/bltrel.ogg differ diff --git a/sound/ins2/wpn/mg34/close.ogg b/sound/ins2/wpn/mg34/close.ogg new file mode 100644 index 0000000..f112deb Binary files /dev/null and b/sound/ins2/wpn/mg34/close.ogg differ diff --git a/sound/ins2/wpn/mg34/empty.ogg b/sound/ins2/wpn/mg34/empty.ogg new file mode 100644 index 0000000..0892bb7 Binary files /dev/null and b/sound/ins2/wpn/mg34/empty.ogg differ diff --git a/sound/ins2/wpn/mg34/hit.ogg b/sound/ins2/wpn/mg34/hit.ogg new file mode 100644 index 0000000..c993f1b Binary files /dev/null and b/sound/ins2/wpn/mg34/hit.ogg differ diff --git a/sound/ins2/wpn/mg34/magin.ogg b/sound/ins2/wpn/mg34/magin.ogg new file mode 100644 index 0000000..ae6017d Binary files /dev/null and b/sound/ins2/wpn/mg34/magin.ogg differ diff --git a/sound/ins2/wpn/mg34/magout.ogg b/sound/ins2/wpn/mg34/magout.ogg new file mode 100644 index 0000000..f6a27c5 Binary files /dev/null and b/sound/ins2/wpn/mg34/magout.ogg differ diff --git a/sound/ins2/wpn/mg34/open.ogg b/sound/ins2/wpn/mg34/open.ogg new file mode 100644 index 0000000..f7ca69c Binary files /dev/null and b/sound/ins2/wpn/mg34/open.ogg differ diff --git a/sound/ins2/wpn/mg34/rof.ogg b/sound/ins2/wpn/mg34/rof.ogg new file mode 100644 index 0000000..5a74483 Binary files /dev/null and b/sound/ins2/wpn/mg34/rof.ogg differ diff --git a/sound/ins2/wpn/mg34/shoot.ogg b/sound/ins2/wpn/mg34/shoot.ogg new file mode 100644 index 0000000..b2565b4 Binary files /dev/null and b/sound/ins2/wpn/mg34/shoot.ogg differ diff --git a/sound/ins2/wpn/mp5sd/bltbk.ogg b/sound/ins2/wpn/mp5sd/bltbk.ogg new file mode 100644 index 0000000..f219361 Binary files /dev/null and b/sound/ins2/wpn/mp5sd/bltbk.ogg differ diff --git a/sound/ins2/wpn/mp5sd/bltlck.ogg b/sound/ins2/wpn/mp5sd/bltlck.ogg new file mode 100644 index 0000000..691461f Binary files /dev/null and b/sound/ins2/wpn/mp5sd/bltlck.ogg differ diff --git a/sound/ins2/wpn/mp5sd/bltrel.ogg b/sound/ins2/wpn/mp5sd/bltrel.ogg new file mode 100644 index 0000000..53f82cc Binary files /dev/null and b/sound/ins2/wpn/mp5sd/bltrel.ogg differ diff --git a/sound/ins2/wpn/mp5sd/empty.ogg b/sound/ins2/wpn/mp5sd/empty.ogg new file mode 100644 index 0000000..8e23375 Binary files /dev/null and b/sound/ins2/wpn/mp5sd/empty.ogg differ diff --git a/sound/ins2/wpn/mp5sd/magin.ogg b/sound/ins2/wpn/mp5sd/magin.ogg new file mode 100644 index 0000000..6c45b95 Binary files /dev/null and b/sound/ins2/wpn/mp5sd/magin.ogg differ diff --git a/sound/ins2/wpn/mp5sd/magout.ogg b/sound/ins2/wpn/mp5sd/magout.ogg new file mode 100644 index 0000000..50c5710 Binary files /dev/null and b/sound/ins2/wpn/mp5sd/magout.ogg differ diff --git a/sound/ins2/wpn/mp5sd/magrel.ogg b/sound/ins2/wpn/mp5sd/magrel.ogg new file mode 100644 index 0000000..717109b Binary files /dev/null and b/sound/ins2/wpn/mp5sd/magrel.ogg differ diff --git a/sound/ins2/wpn/mp5sd/shoot.ogg b/sound/ins2/wpn/mp5sd/shoot.ogg new file mode 100644 index 0000000..fcdccb9 Binary files /dev/null and b/sound/ins2/wpn/mp5sd/shoot.ogg differ diff --git a/sound/ins2/wpn/mp5sd/stock.ogg b/sound/ins2/wpn/mp5sd/stock.ogg new file mode 100644 index 0000000..2b839e4 Binary files /dev/null and b/sound/ins2/wpn/mp5sd/stock.ogg differ diff --git a/sound/ins2/wpn/phys/gclip1.ogg b/sound/ins2/wpn/phys/gclip1.ogg new file mode 100644 index 0000000..3125a47 Binary files /dev/null and b/sound/ins2/wpn/phys/gclip1.ogg differ diff --git a/sound/ins2/wpn/phys/gclip2.ogg b/sound/ins2/wpn/phys/gclip2.ogg new file mode 100644 index 0000000..f31dbca Binary files /dev/null and b/sound/ins2/wpn/phys/gclip2.ogg differ diff --git a/sound/ins2/wpn/phys/gclip3.ogg b/sound/ins2/wpn/phys/gclip3.ogg new file mode 100644 index 0000000..1b469a6 Binary files /dev/null and b/sound/ins2/wpn/phys/gclip3.ogg differ diff --git a/sound/ins2/wpn/pkm/bdply.ogg b/sound/ins2/wpn/pkm/bdply.ogg new file mode 100644 index 0000000..04d54a5 Binary files /dev/null and b/sound/ins2/wpn/pkm/bdply.ogg differ diff --git a/sound/ins2/wpn/pkm/belt.ogg b/sound/ins2/wpn/pkm/belt.ogg new file mode 100644 index 0000000..56ea7ff Binary files /dev/null and b/sound/ins2/wpn/pkm/belt.ogg differ diff --git a/sound/ins2/wpn/pkm/bltbk.ogg b/sound/ins2/wpn/pkm/bltbk.ogg new file mode 100644 index 0000000..50e5095 Binary files /dev/null and b/sound/ins2/wpn/pkm/bltbk.ogg differ diff --git a/sound/ins2/wpn/pkm/bltfd.ogg b/sound/ins2/wpn/pkm/bltfd.ogg new file mode 100644 index 0000000..67af071 Binary files /dev/null and b/sound/ins2/wpn/pkm/bltfd.ogg differ diff --git a/sound/ins2/wpn/pkm/brtrct.ogg b/sound/ins2/wpn/pkm/brtrct.ogg new file mode 100644 index 0000000..35c2223 Binary files /dev/null and b/sound/ins2/wpn/pkm/brtrct.ogg differ diff --git a/sound/ins2/wpn/pkm/empty.ogg b/sound/ins2/wpn/pkm/empty.ogg new file mode 100644 index 0000000..d0794c6 Binary files /dev/null and b/sound/ins2/wpn/pkm/empty.ogg differ diff --git a/sound/ins2/wpn/pkm/hit.ogg b/sound/ins2/wpn/pkm/hit.ogg new file mode 100644 index 0000000..ba3fec2 Binary files /dev/null and b/sound/ins2/wpn/pkm/hit.ogg differ diff --git a/sound/ins2/wpn/pkm/lidbtn.ogg b/sound/ins2/wpn/pkm/lidbtn.ogg new file mode 100644 index 0000000..3d954cb Binary files /dev/null and b/sound/ins2/wpn/pkm/lidbtn.ogg differ diff --git a/sound/ins2/wpn/pkm/liddn.ogg b/sound/ins2/wpn/pkm/liddn.ogg new file mode 100644 index 0000000..d677d26 Binary files /dev/null and b/sound/ins2/wpn/pkm/liddn.ogg differ diff --git a/sound/ins2/wpn/pkm/lidup.ogg b/sound/ins2/wpn/pkm/lidup.ogg new file mode 100644 index 0000000..b7ceefc Binary files /dev/null and b/sound/ins2/wpn/pkm/lidup.ogg differ diff --git a/sound/ins2/wpn/pkm/lift.ogg b/sound/ins2/wpn/pkm/lift.ogg new file mode 100644 index 0000000..662ced4 Binary files /dev/null and b/sound/ins2/wpn/pkm/lift.ogg differ diff --git a/sound/ins2/wpn/pkm/magin.ogg b/sound/ins2/wpn/pkm/magin.ogg new file mode 100644 index 0000000..9563f27 Binary files /dev/null and b/sound/ins2/wpn/pkm/magin.ogg differ diff --git a/sound/ins2/wpn/pkm/magout.ogg b/sound/ins2/wpn/pkm/magout.ogg new file mode 100644 index 0000000..28fcb33 Binary files /dev/null and b/sound/ins2/wpn/pkm/magout.ogg differ diff --git a/sound/ins2/wpn/pkm/shoot.ogg b/sound/ins2/wpn/pkm/shoot.ogg new file mode 100644 index 0000000..5ebfa89 Binary files /dev/null and b/sound/ins2/wpn/pkm/shoot.ogg differ diff --git a/sound/ins2/wpn/scar/bltbk.ogg b/sound/ins2/wpn/scar/bltbk.ogg new file mode 100644 index 0000000..b7e9a0a Binary files /dev/null and b/sound/ins2/wpn/scar/bltbk.ogg differ diff --git a/sound/ins2/wpn/scar/bltrel.ogg b/sound/ins2/wpn/scar/bltrel.ogg new file mode 100644 index 0000000..c299eae Binary files /dev/null and b/sound/ins2/wpn/scar/bltrel.ogg differ diff --git a/sound/ins2/wpn/scar/empty.ogg b/sound/ins2/wpn/scar/empty.ogg new file mode 100644 index 0000000..4119590 Binary files /dev/null and b/sound/ins2/wpn/scar/empty.ogg differ diff --git a/sound/ins2/wpn/scar/magin.ogg b/sound/ins2/wpn/scar/magin.ogg new file mode 100644 index 0000000..e58220f Binary files /dev/null and b/sound/ins2/wpn/scar/magin.ogg differ diff --git a/sound/ins2/wpn/scar/magout.ogg b/sound/ins2/wpn/scar/magout.ogg new file mode 100644 index 0000000..7ab4bd7 Binary files /dev/null and b/sound/ins2/wpn/scar/magout.ogg differ diff --git a/sound/ins2/wpn/scar/magrel.ogg b/sound/ins2/wpn/scar/magrel.ogg new file mode 100644 index 0000000..0716c2c Binary files /dev/null and b/sound/ins2/wpn/scar/magrel.ogg differ diff --git a/sound/ins2/wpn/scar/rof.ogg b/sound/ins2/wpn/scar/rof.ogg new file mode 100644 index 0000000..58c8a08 Binary files /dev/null and b/sound/ins2/wpn/scar/rof.ogg differ diff --git a/sound/ins2/wpn/scar/shoot.ogg b/sound/ins2/wpn/scar/shoot.ogg new file mode 100644 index 0000000..7f27872 Binary files /dev/null and b/sound/ins2/wpn/scar/shoot.ogg differ diff --git a/sound/ins2/wpn/svt40/bltbk.ogg b/sound/ins2/wpn/svt40/bltbk.ogg new file mode 100644 index 0000000..d3d4e0c Binary files /dev/null and b/sound/ins2/wpn/svt40/bltbk.ogg differ diff --git a/sound/ins2/wpn/svt40/bltrel.ogg b/sound/ins2/wpn/svt40/bltrel.ogg new file mode 100644 index 0000000..01e3b9c Binary files /dev/null and b/sound/ins2/wpn/svt40/bltrel.ogg differ diff --git a/sound/ins2/wpn/svt40/empty.ogg b/sound/ins2/wpn/svt40/empty.ogg new file mode 100644 index 0000000..4a78ac9 Binary files /dev/null and b/sound/ins2/wpn/svt40/empty.ogg differ diff --git a/sound/ins2/wpn/svt40/maghit.ogg b/sound/ins2/wpn/svt40/maghit.ogg new file mode 100644 index 0000000..fc55b4e Binary files /dev/null and b/sound/ins2/wpn/svt40/maghit.ogg differ diff --git a/sound/ins2/wpn/svt40/magin.ogg b/sound/ins2/wpn/svt40/magin.ogg new file mode 100644 index 0000000..269284b Binary files /dev/null and b/sound/ins2/wpn/svt40/magin.ogg differ diff --git a/sound/ins2/wpn/svt40/magout.ogg b/sound/ins2/wpn/svt40/magout.ogg new file mode 100644 index 0000000..5294545 Binary files /dev/null and b/sound/ins2/wpn/svt40/magout.ogg differ diff --git a/sound/ins2/wpn/svt40/magrel.ogg b/sound/ins2/wpn/svt40/magrel.ogg new file mode 100644 index 0000000..731507a Binary files /dev/null and b/sound/ins2/wpn/svt40/magrel.ogg differ diff --git a/sound/ins2/wpn/svt40/shoot.ogg b/sound/ins2/wpn/svt40/shoot.ogg new file mode 100644 index 0000000..3fdef74 Binary files /dev/null and b/sound/ins2/wpn/svt40/shoot.ogg differ diff --git a/sound/ins2/wpn/vp70/magin.ogg b/sound/ins2/wpn/vp70/magin.ogg new file mode 100644 index 0000000..5e646fd Binary files /dev/null and b/sound/ins2/wpn/vp70/magin.ogg differ diff --git a/sound/ins2/wpn/vp70/magout.ogg b/sound/ins2/wpn/vp70/magout.ogg new file mode 100644 index 0000000..63713df Binary files /dev/null and b/sound/ins2/wpn/vp70/magout.ogg differ diff --git a/sound/ins2/wpn/vp70/rof.ogg b/sound/ins2/wpn/vp70/rof.ogg new file mode 100644 index 0000000..3c14b0f Binary files /dev/null and b/sound/ins2/wpn/vp70/rof.ogg differ diff --git a/sound/ins2/wpn/vp70/shoot.ogg b/sound/ins2/wpn/vp70/shoot.ogg new file mode 100644 index 0000000..bd67092 Binary files /dev/null and b/sound/ins2/wpn/vp70/shoot.ogg differ diff --git a/sound/ins2/wpn/vp70/sldbk.ogg b/sound/ins2/wpn/vp70/sldbk.ogg new file mode 100644 index 0000000..070bfe8 Binary files /dev/null and b/sound/ins2/wpn/vp70/sldbk.ogg differ diff --git a/sound/ins2/wpn/vp70/sldrel.ogg b/sound/ins2/wpn/vp70/sldrel.ogg new file mode 100644 index 0000000..7e029a4 Binary files /dev/null and b/sound/ins2/wpn/vp70/sldrel.ogg differ diff --git a/sprites/ins2/arf/weapon_ins2an94.txt b/sprites/ins2/arf/weapon_ins2an94.txt new file mode 100644 index 0000000..e3380ca --- /dev/null +++ b/sprites/ins2/arf/weapon_ins2an94.txt @@ -0,0 +1,7 @@ +6 +weapon 640 ins2/wpn06 340 90 170 45 +weapon_s 640 ins2/wpn06 510 90 170 45 +ammo 640 hunger/weapons/weapon_m16a1 61 104 24 24 +crosshair 640 ofch1 0 48 24 24 +autoaim 640 crosshairs 0 72 24 24 +zoom 640 crosshairs 0 0 1 1 diff --git a/sprites/ins2/arf/weapon_ins2groza.txt b/sprites/ins2/arf/weapon_ins2groza.txt new file mode 100644 index 0000000..dc71b8e --- /dev/null +++ b/sprites/ins2/arf/weapon_ins2groza.txt @@ -0,0 +1,8 @@ +7 +weapon 640 ins2/wpn06 340 180 170 45 +weapon_s 640 ins2/wpn06 510 180 170 45 +ammo 640 hunger/weapons/weapon_greasegun 61 104 24 24 +ammo2 640 640hud7 48 60 24 24 +crosshair 640 ofch1 0 48 24 24 +autoaim 640 crosshairs 0 72 24 24 +zoom 640 crosshairs 0 0 1 1 diff --git a/sprites/ins2/arf/weapon_ins2m16a1.txt b/sprites/ins2/arf/weapon_ins2m16a1.txt new file mode 100644 index 0000000..012301d --- /dev/null +++ b/sprites/ins2/arf/weapon_ins2m16a1.txt @@ -0,0 +1,8 @@ +7 +weapon 640 ins2/wpn06 0 315 170 45 +weapon_s 640 ins2/wpn06 170 315 170 45 +ammo 640 hunger/weapons/weapon_m16a1 61 104 24 24 +ammo2 640 640hud7 48 60 24 24 +crosshair 640 ofch1 0 48 24 24 +autoaim 640 crosshairs 0 72 24 24 +zoom 640 crosshairs 0 0 1 1 diff --git a/sprites/ins2/brf/weapon_ins2scarh.txt b/sprites/ins2/brf/weapon_ins2scarh.txt new file mode 100644 index 0000000..fd9d6c9 --- /dev/null +++ b/sprites/ins2/brf/weapon_ins2scarh.txt @@ -0,0 +1,7 @@ +6 +weapon 640 ins2/wpn06 0 0 170 45 +weapon_s 640 ins2/wpn06 170 0 170 45 +ammo 640 hunger/weapons/weapon_m14 61 104 24 24 +crosshair 640 ofch1 0 48 24 24 +autoaim 640 crosshairs 0 72 24 24 +zoom 640 crosshairs 0 0 1 1 diff --git a/sprites/ins2/cbn/weapon_ins2g36c.txt b/sprites/ins2/cbn/weapon_ins2g36c.txt new file mode 100644 index 0000000..0fbd4f6 --- /dev/null +++ b/sprites/ins2/cbn/weapon_ins2g36c.txt @@ -0,0 +1,7 @@ +6 +weapon 640 ins2/wpn06 340 0 170 45 +weapon_s 640 ins2/wpn06 510 0 170 45 +ammo 640 hunger/weapons/weapon_m16a1 61 104 24 24 +crosshair 640 ofch1 0 48 24 24 +autoaim 640 crosshairs 0 72 24 24 +zoom 640 crosshairs 0 0 1 1 diff --git a/sprites/ins2/exp/ammo_rgo.spr b/sprites/ins2/exp/ammo_rgo.spr new file mode 100644 index 0000000..b9240f9 Binary files /dev/null and b/sprites/ins2/exp/ammo_rgo.spr differ diff --git a/sprites/ins2/exp/weapon_ins2rgo.txt b/sprites/ins2/exp/weapon_ins2rgo.txt new file mode 100644 index 0000000..ace08a6 --- /dev/null +++ b/sprites/ins2/exp/weapon_ins2rgo.txt @@ -0,0 +1,4 @@ +3 +weapon 640 ins2/wpn06 340 45 170 45 +weapon_s 640 ins2/wpn06 510 45 170 45 +ammo 640 ins2/exp/ammo_rgo 0 0 24 24 diff --git a/sprites/ins2/hdg/weapon_ins2vp70.txt b/sprites/ins2/hdg/weapon_ins2vp70.txt new file mode 100644 index 0000000..4a57c57 --- /dev/null +++ b/sprites/ins2/hdg/weapon_ins2vp70.txt @@ -0,0 +1,7 @@ +6 +weapon 640 ins2/wpn06 0 630 170 45 +weapon_s 640 ins2/wpn06 170 630 170 45 +ammo 640 hunger/weapons/weapon_greasegun 61 104 24 24 +crosshair 640 ofch1 0 48 24 24 +autoaim 640 crosshairs 0 72 24 24 +zoom 640 crosshairs 0 0 1 1 diff --git a/sprites/ins2/lmg/weapon_ins2mg34.txt b/sprites/ins2/lmg/weapon_ins2mg34.txt new file mode 100644 index 0000000..f892687 --- /dev/null +++ b/sprites/ins2/lmg/weapon_ins2mg34.txt @@ -0,0 +1,7 @@ +6 +weapon 640 ins2/wpn06 0 810 170 45 +weapon_s 640 ins2/wpn06 170 810 170 45 +ammo 640 hunger/weapons/weapon_m14 61 104 24 24 +crosshair 640 ofch1 0 48 24 24 +autoaim 640 crosshairs 0 72 24 24 +zoom 640 crosshairs 0 0 1 1 diff --git a/sprites/ins2/lmg/weapon_ins2pkm.txt b/sprites/ins2/lmg/weapon_ins2pkm.txt new file mode 100644 index 0000000..b5e365a --- /dev/null +++ b/sprites/ins2/lmg/weapon_ins2pkm.txt @@ -0,0 +1,7 @@ +6 +weapon 640 ins2/wpn06 0 720 170 45 +weapon_s 640 ins2/wpn06 170 720 170 45 +ammo 640 hunger/weapons/weapon_m14 61 104 24 24 +crosshair 640 ofch1 0 48 24 24 +autoaim 640 crosshairs 0 72 24 24 +zoom 640 crosshairs 0 0 1 1 diff --git a/sprites/ins2/rfl/weapon_ins2svt40.txt b/sprites/ins2/rfl/weapon_ins2svt40.txt new file mode 100644 index 0000000..d7933bf --- /dev/null +++ b/sprites/ins2/rfl/weapon_ins2svt40.txt @@ -0,0 +1,7 @@ +6 +weapon 640 ins2/wpn06 0 45 170 45 +weapon_s 640 ins2/wpn06 170 45 170 45 +ammo 640 hunger/weapons/weapon_m14 61 104 24 24 +crosshair 640 ofch1 0 48 24 24 +autoaim 640 crosshairs 0 72 24 24 +zoom 640 crosshairs 0 0 1 1 diff --git a/sprites/ins2/smg/weapon_ins2greasegun.txt b/sprites/ins2/smg/weapon_ins2greasegun.txt new file mode 100644 index 0000000..894e537 --- /dev/null +++ b/sprites/ins2/smg/weapon_ins2greasegun.txt @@ -0,0 +1,7 @@ +6 +weapon 640 ins2/wpn06 0 450 170 45 +weapon_s 640 ins2/wpn06 170 450 170 45 +ammo 640 hunger/weapons/weapon_greasegun 61 104 24 24 +crosshair 640 ofch1 0 48 24 24 +autoaim 640 crosshairs 0 72 24 24 +zoom 640 crosshairs 0 0 1 1 diff --git a/sprites/ins2/smg/weapon_ins2mp5sd.txt b/sprites/ins2/smg/weapon_ins2mp5sd.txt new file mode 100644 index 0000000..35beaf4 --- /dev/null +++ b/sprites/ins2/smg/weapon_ins2mp5sd.txt @@ -0,0 +1,7 @@ +6 +weapon 640 ins2/wpn06 0 675 170 45 +weapon_s 640 ins2/wpn06 170 675 170 45 +ammo 640 hunger/weapons/weapon_greasegun 61 104 24 24 +crosshair 640 ofch1 0 48 24 24 +autoaim 640 crosshairs 0 72 24 24 +zoom 640 crosshairs 0 0 1 1 diff --git a/sprites/ins2/srf/weapon_ins2m21.txt b/sprites/ins2/srf/weapon_ins2m21.txt new file mode 100644 index 0000000..5fbe425 --- /dev/null +++ b/sprites/ins2/srf/weapon_ins2m21.txt @@ -0,0 +1,7 @@ +6 +weapon 640 ins2/wpn06 340 225 170 45 +weapon_s 640 ins2/wpn06 510 225 170 45 +ammo 640 hunger/weapons/weapon_m14 61 104 24 24 +crosshair 640 ofch1 0 48 24 24 +autoaim 640 crosshairs 0 72 24 24 +zoom 640 crosshairs 0 0 1 1 diff --git a/sprites/ins2/wpn06.spr b/sprites/ins2/wpn06.spr new file mode 100644 index 0000000..c42bdfa Binary files /dev/null and b/sprites/ins2/wpn06.spr differ