Rip out more now-unused stuff. Start fixing up the buy system, make weapons fire again

This commit is contained in:
Marco Cawthorne 2024-07-24 18:51:27 -07:00
parent 949f3c39bc
commit dc0c57397b
Signed by: eukara
GPG key ID: CE2032F0A2882A22
37 changed files with 872 additions and 506 deletions

View file

@ -73,99 +73,99 @@ ClientGame_ConsoleCommand(void)
sendevent("DropWeapon", "");
break;
case "glock":
sendevent("BuyWeapon", "f", WEAPON_GLOCK18);
sendevent("CSBuy", "f", BUY_GLOCK18);
break;
case "usp":
sendevent("BuyWeapon", "f", WEAPON_USP45);
sendevent("CSBuy", "f", BUY_USP45);
break;
case "p228":
sendevent("BuyWeapon", "f", WEAPON_P228);
sendevent("CSBuy", "f", BUY_P228);
break;
case "deagle":
sendevent("BuyWeapon", "f", WEAPON_DEAGLE);
sendevent("CSBuy", "f", BUY_DEAGLE);
break;
case "fn57":
sendevent("BuyWeapon", "f", WEAPON_FIVESEVEN);
sendevent("CSBuy", "f", BUY_FIVESEVEN);
break;
case "elites":
sendevent("BuyWeapon", "f", WEAPON_ELITES);
sendevent("CSBuy", "f", BUY_ELITES);
break;
case "m3":
sendevent("BuyWeapon", "f", WEAPON_M3);
sendevent("CSBuy", "f", BUY_M3);
break;
case "xm1014":
sendevent("BuyWeapon", "f", WEAPON_XM1014);
sendevent("CSBuy", "f", BUY_XM1014);
break;
case "tmp":
sendevent("BuyWeapon", "f", WEAPON_TMP);
sendevent("CSBuy", "f", BUY_TMP);
break;
case "mac10":
sendevent("BuyWeapon", "f", WEAPON_MAC10);
sendevent("CSBuy", "f", BUY_MAC10);
break;
case "mp5":
sendevent("BuyWeapon", "f", WEAPON_MP5);
sendevent("CSBuy", "f", BUY_MP5);
break;
case "ump45":
sendevent("BuyWeapon", "f", WEAPON_UMP45);
sendevent("CSBuy", "f", BUY_UMP45);
break;
case "p90":
sendevent("BuyWeapon", "f", WEAPON_P90);
sendevent("CSBuy", "f", BUY_P90);
break;
case "ak47":
sendevent("BuyWeapon", "f", WEAPON_AK47);
sendevent("CSBuy", "f", BUY_AK47);
break;
case "m4a1":
sendevent("BuyWeapon", "f", WEAPON_M4A1);
sendevent("CSBuy", "f", BUY_M4A1);
break;
case "sg552":
sendevent("BuyWeapon", "f", WEAPON_SG552);
sendevent("CSBuy", "f", BUY_SG552);
break;
case "aug":
sendevent("BuyWeapon", "f", WEAPON_AUG);
sendevent("CSBuy", "f", BUY_AUG);
break;
case "scout":
sendevent("BuyWeapon", "f", WEAPON_SCOUT);
sendevent("CSBuy", "f", BUY_SCOUT);
break;
case "sg550":
sendevent("BuyWeapon", "f", WEAPON_SG550);
sendevent("CSBuy", "f", BUY_SG550);
break;
case "awp":
sendevent("BuyWeapon", "f", WEAPON_AWP);
sendevent("CSBuy", "f", BUY_AWP);
break;
case "g3sg1":
sendevent("BuyWeapon", "f", WEAPON_G3SG1);
sendevent("CSBuy", "f", BUY_G3SG1);
break;
case "m249":
sendevent("BuyWeapon", "f", WEAPON_PARA);
sendevent("CSBuy", "f", BUY_PARA);
break;
case "buyammo1":
case "primammo":
sendevent("AmmoBuyPrimary", "");
sendevent("CSBuy", "f", BUY_PRIMARYAMMO);
break;
case "buyammo2":
case "secammo":
sendevent("AmmoBuySecondary", "");
sendevent("CSBuy", "f", BUY_SECONDARYAMMO);
break;
case "vest":
sendevent("BuyEquipment", "f", 0);
sendevent("CSBuy", "f", BUY_VEST);
break;
case "vesthelm":
sendevent("BuyEquipment", "f", 1);
sendevent("CSBuy", "f", BUY_VESTHELMET);
break;
case "flash":
sendevent("BuyEquipment", "f", 2);
sendevent("CSBuy", "f", BUY_FLASHBANG);
break;
case "hegren":
sendevent("BuyEquipment", "f", 3);
sendevent("CSBuy", "f", BUY_HEGRENADE);
break;
case "vsgren":
sendevent("BuyEquipment", "f", 4);
sendevent("CSBuy", "f", BUY_SMOKEGRENADE);
break;
case "defuser":
sendevent("BuyEquipment", "f", 5);
sendevent("CSBuy", "f", BUY_DEFUSALKIT);
break;
case "nvg":
sendevent("BuyEquipment", "f", 6);
sendevent("CSBuy", "f", BUY_NIGHTVISION);
break;
case "coverme":
sendevent("Radio", "f", RADIO_CT_COVERME);

View file

@ -24,6 +24,9 @@ ClientGame_EntityUpdate(float id, float new)
case ENT_PLAYER:
NSENTITY_READENTITY(CSPlayer, new)
break;
case ENT_ENTITYPROJECTILE:
NSENTITY_READENTITY(CSProjectile, new)
break;
case ENT_WEAPON:
NSENTITY_READENTITY(CSWeapon, new)
break;

0
src/client/radio.qc Executable file → Normal file
View file

View file

@ -106,11 +106,11 @@ BUY(int n)
Textmenu_Call(inteam == TEAM_T ? "BUYMACHINEGUN" : "BUYMACHINEGUN");
break;
case 6:
sendevent("AmmoBuyPrimary", "");
sendevent("CSBuy", "f", BUY_PRIMARYAMMO);
Textmenu_Call("");
break;
case 7:
sendevent("AmmoBuySecondary", "");
sendevent("CSBuy", "f", BUY_SECONDARYAMMO);
Textmenu_Call("");
break;
case 8:
@ -128,22 +128,22 @@ DT_BUYITEM(int n)
{
switch (n) {
case 1:
sendevent("BuyEquipment", "f", 0);
sendevent("CSBuy", "f", BUY_VEST);
break;
case 2:
sendevent("BuyEquipment", "f", 1);
sendevent("CSBuy", "f", BUY_VESTHELMET);
break;
case 3:
sendevent("BuyEquipment", "f", 2);
sendevent("CSBuy", "f", BUY_FLASHBANG);
break;
case 4:
sendevent("BuyEquipment", "f", 3);
sendevent("CSBuy", "f", BUY_HEGRENADE);
break;
case 5:
sendevent("BuyEquipment", "f", 4);
sendevent("CSBuy", "f", BUY_SMOKEGRENADE);
break;
case 7:
sendevent("BuyEquipment", "f", 6);
sendevent("CSBuy", "f", BUY_NIGHTVISION);
break;
case 10:
Textmenu_Call("");
@ -159,25 +159,25 @@ DCT_BUYITEM(int n)
{
switch (n) {
case 1:
sendevent("BuyEquipment", "f", 0);
sendevent("CSBuy", "f", BUY_VEST);
break;
case 2:
sendevent("BuyEquipment", "f", 1);
sendevent("CSBuy", "f", BUY_VESTHELMET);
break;
case 3:
sendevent("BuyEquipment", "f", 2);
sendevent("CSBuy", "f", BUY_FLASHBANG);
break;
case 4:
sendevent("BuyEquipment", "f", 3);
sendevent("CSBuy", "f", BUY_HEGRENADE);
break;
case 5:
sendevent("BuyEquipment", "f", 4);
sendevent("CSBuy", "f", BUY_SMOKEGRENADE);
break;
case 6:
sendevent("BuyEquipment", "f", 5);
sendevent("CSBuy", "f", BUY_DEFUSALKIT);
break;
case 7:
sendevent("BuyEquipment", "f", 6);
sendevent("CSBuy", "f", BUY_NIGHTVISION);
break;
case 10:
Textmenu_Call("");
@ -195,19 +195,19 @@ T_BUYPISTOL(int n)
{
switch (n) {
case 1:
sendevent("BuyWeapon", "f", WEAPON_USP45);
sendevent("CSBuy", "f", BUY_USP45);
break;
case 2:
sendevent("BuyWeapon", "f", WEAPON_GLOCK18);
sendevent("CSBuy", "f", BUY_GLOCK18);
break;
case 3:
sendevent("BuyWeapon", "f", WEAPON_DEAGLE);
sendevent("CSBuy", "f", BUY_DEAGLE);
break;
case 4:
sendevent("BuyWeapon", "f", WEAPON_P228);
sendevent("CSBuy", "f", BUY_P228);
break;
case 5:
sendevent("BuyWeapon", "f", WEAPON_ELITES);
sendevent("CSBuy", "f", BUY_ELITES);
break;
case 10:
Textmenu_Call("");
@ -223,19 +223,19 @@ CT_BUYPISTOL(int n)
{
switch (n) {
case 1:
sendevent("BuyWeapon", "f", WEAPON_USP45);
sendevent("CSBuy", "f", BUY_USP45);
break;
case 2:
sendevent("BuyWeapon", "f", WEAPON_GLOCK18);
sendevent("CSBuy", "f", BUY_GLOCK18);
break;
case 3:
sendevent("BuyWeapon", "f", WEAPON_DEAGLE);
sendevent("CSBuy", "f", BUY_DEAGLE);
break;
case 4:
sendevent("BuyWeapon", "f", WEAPON_P228);
sendevent("CSBuy", "f", BUY_P228);
break;
case 6:
sendevent("BuyWeapon", "f", WEAPON_FIVESEVEN);
sendevent("CSBuy", "f", BUY_FIVESEVEN);
break;
case 10:
Textmenu_Call("");
@ -253,10 +253,10 @@ BUYSHOTGUN(int n)
{
switch (n) {
case 1:
sendevent("BuyWeapon", "f", WEAPON_M3);
sendevent("CSBuy", "f", BUY_M3);
break;
case 2:
sendevent("BuyWeapon", "f", WEAPON_XM1014);
sendevent("CSBuy", "f", BUY_XM1014);
break;
case 10:
Textmenu_Call("");
@ -274,19 +274,19 @@ T_BUYRIFLE(int n)
{
switch (n) {
case 1:
sendevent("BuyWeapon", "f", WEAPON_AK47);
sendevent("CSBuy", "f", BUY_AK47);
break;
case 2:
sendevent("BuyWeapon", "f", WEAPON_SG552);
sendevent("CSBuy", "f", BUY_SG552);
break;
case 5:
sendevent("BuyWeapon", "f", WEAPON_SCOUT);
sendevent("CSBuy", "f", BUY_SCOUT);
break;
case 6:
sendevent("BuyWeapon", "f", WEAPON_AWP);
sendevent("CSBuy", "f", BUY_AWP);
break;
case 7:
sendevent("BuyWeapon", "f", WEAPON_G3SG1);
sendevent("CSBuy", "f", BUY_G3SG1);
break;
case 10:
Textmenu_Call("");
@ -302,22 +302,22 @@ CT_BUYRIFLE(int n)
{
switch (n) {
case 3:
sendevent("BuyWeapon", "f", WEAPON_M4A1);
sendevent("CSBuy", "f", BUY_M4A1);
break;
case 4:
sendevent("BuyWeapon", "f", WEAPON_AUG);
sendevent("CSBuy", "f", BUY_AUG);
break;
case 5:
sendevent("BuyWeapon", "f", WEAPON_SCOUT);
sendevent("CSBuy", "f", BUY_SCOUT);
break;
case 6:
sendevent("BuyWeapon", "f", WEAPON_AWP);
sendevent("CSBuy", "f", BUY_AWP);
break;
case 7:
sendevent("BuyWeapon", "f", WEAPON_G3SG1);
sendevent("CSBuy", "f", BUY_G3SG1);
break;
case 8:
sendevent("BuyWeapon", "f", WEAPON_SG550);
sendevent("CSBuy", "f", BUY_SG550);
break;
case 10:
Textmenu_Call("");
@ -335,16 +335,16 @@ T_BUYSUBMACHINEGUN(int n)
{
switch (n) {
case 1:
sendevent("BuyWeapon", "f", WEAPON_MP5);
sendevent("CSBuy", "f", BUY_MP5);
break;
case 3:
sendevent("BuyWeapon", "f", WEAPON_P90);
sendevent("CSBuy", "f", BUY_P90);
break;
case 4:
sendevent("BuyWeapon", "f", WEAPON_MAC10);
sendevent("CSBuy", "f", BUY_MAC10);
break;
case 5:
sendevent("BuyWeapon", "f", WEAPON_UMP45);
sendevent("CSBuy", "f", BUY_UMP45);
break;
case 10:
Textmenu_Call("");
@ -360,16 +360,16 @@ CT_BUYSUBMACHINEGUN(int n)
{
switch (n) {
case 1:
sendevent("BuyWeapon", "f", WEAPON_MP5);
sendevent("CSBuy", "f", BUY_MP5);
break;
case 2:
sendevent("BuyWeapon", "f", WEAPON_TMP);
sendevent("CSBuy", "f", BUY_TMP);
break;
case 3:
sendevent("BuyWeapon", "f", WEAPON_P90);
sendevent("CSBuy", "f", BUY_P90);
break;
case 5:
sendevent("BuyWeapon", "f", WEAPON_UMP45);
sendevent("CSBuy", "f", BUY_UMP45);
break;
case 10:
Textmenu_Call("");
@ -387,7 +387,7 @@ BUYMACHINEGUN(int n)
{
switch (n) {
case 1:
sendevent("BuyWeapon", "f", WEAPON_PARA);
sendevent("CSBuy", "f", BUY_PARA);
break;
case 10:
Textmenu_Call("");

View file

@ -67,39 +67,39 @@ typedef struct
} buyItems_t;
const buyItems_t g_buyItemList [] = {
{ "BuyWeapon", WEAPON_USP45, "classes/usp.txt", "gfx/vgui/640_usp", "USP45" },
{ "BuyWeapon", WEAPON_GLOCK18, "classes/glock18.txt", "gfx/vgui/640_glock18", "Glock18" },
{ "BuyWeapon", WEAPON_DEAGLE, "classes/deagle.txt", "gfx/vgui/640_deagle", "DesertEagle" },
{ "BuyWeapon", WEAPON_P228, "classes/p228.txt", "gfx/vgui/640_p228", "P228" },
{ "BuyWeapon", WEAPON_ELITES, "classes/elite.txt", "gfx/vgui/640_elite", "Beretta96G" },
{ "BuyWeapon", WEAPON_FIVESEVEN, "classes/fiveseven.txt", "gfx/vgui/640_fiveseven", "FiveSeven" },
{ "BuyWeapon", WEAPON_M3, "classes/m3.txt", "gfx/vgui/640_m3", "Super90" },
{ "BuyWeapon", WEAPON_XM1014, "classes/xm1014.txt", "gfx/vgui/640_xm1014", "XM1014" },
{ "CSBuy", BUY_USP45, "classes/usp.txt", "gfx/vgui/640_usp", "USP45" },
{ "CSBuy", BUY_GLOCK18, "classes/glock18.txt", "gfx/vgui/640_glock18", "Glock18" },
{ "CSBuy", BUY_DEAGLE, "classes/deagle.txt", "gfx/vgui/640_deagle", "DesertEagle" },
{ "CSBuy", BUY_P228, "classes/p228.txt", "gfx/vgui/640_p228", "P228" },
{ "CSBuy", BUY_ELITES, "classes/elite.txt", "gfx/vgui/640_elite", "Beretta96G" },
{ "CSBuy", BUY_FIVESEVEN, "classes/fiveseven.txt", "gfx/vgui/640_fiveseven", "FiveSeven" },
{ "CSBuy", BUY_M3, "classes/m3.txt", "gfx/vgui/640_m3", "Super90" },
{ "CSBuy", BUY_XM1014, "classes/xm1014.txt", "gfx/vgui/640_xm1014", "XM1014" },
#if defined(CZERO) || defined(CSSOURCE)
{ "BuyWeapon", WEAPON_FAMAS, "classes/famas.txt", "gfx/vgui/640_famas", "Famas" },
{ "BuyWeapon", WEAPON_GALIL, "classes/galil.txt", "gfx/vgui/640_galil", "Galil" },
{ "CSBuy", BUY_FAMAS, "classes/famas.txt", "gfx/vgui/640_famas", "Famas" },
{ "CSBuy", BUY_GALIL, "classes/galil.txt", "gfx/vgui/640_galil", "Galil" },
#endif
{ "BuyWeapon", WEAPON_AK47, "classes/ak47.txt", "gfx/vgui/640_ak47", "AK47" },
{ "BuyWeapon", WEAPON_SG552, "classes/sg552.txt", "gfx/vgui/640_sg552", "SG552" },
{ "BuyWeapon", WEAPON_M4A1, "classes/m4a1.txt", "gfx/vgui/640_m4a1", "M4A1" },
{ "BuyWeapon", WEAPON_AUG, "classes/aug.txt", "gfx/vgui/640_aug", "Aug" },
{ "BuyWeapon", WEAPON_SCOUT, "classes/scout.txt", "gfx/vgui/640_scout", "Scout" },
{ "BuyWeapon", WEAPON_AWP, "classes/awp.txt", "gfx/vgui/640_awp", "ArcticWarfareMagnum" },
{ "BuyWeapon", WEAPON_G3SG1, "classes/g3sg1.txt", "gfx/vgui/640_g3sg1", "G3SG1" },
{ "BuyWeapon", WEAPON_SG550, "classes/sg550.txt", "gfx/vgui/640_sg550", "SG550" },
{ "BuyWeapon", WEAPON_MP5, "classes/mp5.txt", "gfx/vgui/640_mp5", "mp5navy" },
{ "BuyWeapon", WEAPON_TMP, "classes/tmp.txt", "gfx/vgui/640_tmp", "tmp" },
{ "BuyWeapon", WEAPON_P90, "classes/p90.txt", "gfx/vgui/640_p90", "FNP90" },
{ "BuyWeapon", WEAPON_MAC10, "classes/mac10.txt", "gfx/vgui/640_mac10", "Mac10" },
{ "BuyWeapon", WEAPON_UMP45, "classes/ump45.txt", "gfx/vgui/640_ump45", "UMP45" },
{ "BuyWeapon", WEAPON_PARA, "classes/m249.txt", "gfx/vgui/640_m249", "M249" },
{ "BuyEquipment", 0, "classes/kevlar.txt", "", "Kevlar_Vest" },
{ "BuyEquipment", 1, "classes/kevlar_helmet.txt", "", "Kevlar_Vest_Ballistic_Helmet" },
{ "BuyEquipment", 2, "classes/flashbang.txt", "gfx/vgui/640_flashbang", "Flashbang" },
{ "BuyEquipment", 3, "classes/hegrenade.txt", "gfx/vgui/640_hegrenade", "High_Explosive_Grenade" },
{ "BuyEquipment", 4, "classes/smokegrenade.txt", "gfx/vgui/640_smokegrenade", "Smoke_Grenade" },
{ "BuyEquipment", 5, "classes/defuse.txt", "", "Defusal_Kit" },
{ "BuyEquipment", 6, "classes/nightvision.txt", "", "Nightvision_Goggles" },
{ "CSBuy", BUY_AK47, "classes/ak47.txt", "gfx/vgui/640_ak47", "AK47" },
{ "CSBuy", BUY_SG552, "classes/sg552.txt", "gfx/vgui/640_sg552", "SG552" },
{ "CSBuy", BUY_M4A1, "classes/m4a1.txt", "gfx/vgui/640_m4a1", "M4A1" },
{ "CSBuy", BUY_AUG, "classes/aug.txt", "gfx/vgui/640_aug", "Aug" },
{ "CSBuy", BUY_SCOUT, "classes/scout.txt", "gfx/vgui/640_scout", "Scout" },
{ "CSBuy", BUY_AWP, "classes/awp.txt", "gfx/vgui/640_awp", "ArcticWarfareMagnum" },
{ "CSBuy", BUY_G3SG1, "classes/g3sg1.txt", "gfx/vgui/640_g3sg1", "G3SG1" },
{ "CSBuy", BUY_SG550, "classes/sg550.txt", "gfx/vgui/640_sg550", "SG550" },
{ "CSBuy", BUY_MP5, "classes/mp5.txt", "gfx/vgui/640_mp5", "mp5navy" },
{ "CSBuy", BUY_TMP, "classes/tmp.txt", "gfx/vgui/640_tmp", "tmp" },
{ "CSBuy", BUY_P90, "classes/p90.txt", "gfx/vgui/640_p90", "FNP90" },
{ "CSBuy", BUY_MAC10, "classes/mac10.txt", "gfx/vgui/640_mac10", "Mac10" },
{ "CSBuy", BUY_UMP45, "classes/ump45.txt", "gfx/vgui/640_ump45", "UMP45" },
{ "CSBuy", BUY_PARA, "classes/m249.txt", "gfx/vgui/640_m249", "M249" },
{ "CSBuy", BUY_VEST, "classes/kevlar.txt", "", "Kevlar_Vest" },
{ "CSBuy", BUY_VESTHELMET, "classes/kevlar_helmet.txt", "", "Kevlar_Vest_Ballistic_Helmet" },
{ "CSBuy", BUY_FLASHBANG, "classes/flashbang.txt", "gfx/vgui/640_flashbang", "Flashbang" },
{ "CSBuy", BUY_HEGRENADE, "classes/hegrenade.txt", "gfx/vgui/640_hegrenade", "High_Explosive_Grenade" },
{ "CSBuy", BUY_SMOKEGRENADE, "classes/smokegrenade.txt", "gfx/vgui/640_smokegrenade", "Smoke_Grenade" },
{ "CSBuy", BUY_DEFUSALKIT, "classes/defuse.txt", "", "Defusal_Kit" },
{ "CSBuy", BUY_NIGHTVISION, "classes/nightvision.txt", "", "Nightvision_Goggles" },
};
string g_butItemDescr[29];

View file

@ -38,6 +38,7 @@ typedef struct
int price;
} ammoinfo_t;
#if 0
ammoinfo_t cs_ammoinfo[11] = {
/* CALIBER_NONE */
{
@ -106,6 +107,7 @@ ammoinfo_t cs_ammoinfo[11] = {
.price = 50
}
};
#endif
int
Ammo_BuyCaliber(CSPlayer pl, int cal, int free)
@ -324,7 +326,7 @@ CSEv_AmmoBuyPrimary(void)
return;
}
Ammo_BuyPrimary(pl, FALSE);
//Ammo_BuyPrimary(pl, FALSE);
}
void
@ -336,8 +338,8 @@ Ammo_AutoFill(NSClientPlayer pp)
return;
}
Ammo_BuyPrimary(pl, true);
Ammo_BuySecondary(pl, true);
//Ammo_BuyPrimary(pl, true);
//Ammo_BuySecondary(pl, true);
}
void

View file

@ -243,9 +243,9 @@ csbot::CreateObjective(void)
/* We carry the bomb */
if (m_gflagsBackup & GF_BOMBZONE) {
/* We are at a bombsite and ready to plant the bomb */
if (activeweapon != WEAPON_C4BOMB) {
if (GetCurrentWeapon() != "weapon_c4") {
/* TODO: REPLACE THIS WITH NSNAVAI METHOD */
activeweapon = WEAPON_C4BOMB;
SwitchToWeapon("weapon_c4");
//Weapons_Draw((CSPlayer)self);
}
@ -351,7 +351,7 @@ csbot::PostFrame(void)
void
csbot::WeaponThink(void)
{
if (activeweapon == WEAPON_KNIFE)
if (GetCurrentWeapon() == "weapon_knife")
return;
#if FIXME
@ -473,21 +473,21 @@ CSBot_BuyStart_Shop(void)
int r = floor(random(1,17));
if (pl.team == TEAM_T) {
if (r == WEAPON_M4A1) { continue; }
if (r == WEAPON_AUG) { continue; }
if (r == WEAPON_SG550) { continue; }
if (r == WEAPON_FIVESEVEN) { continue; }
if (r == WEAPON_TMP) { continue; }
if (r == BUY_M4A1) { continue; }
if (r == BUY_AUG) { continue; }
if (r == BUY_SG550) { continue; }
if (r == BUY_FIVESEVEN) { continue; }
if (r == BUY_TMP) { continue; }
} else if (pl.team == TEAM_CT) {
if (r == WEAPON_AK47) { continue; }
if (r == WEAPON_SG552) { continue; }
if (r == WEAPON_G3SG1) { continue; }
if (r == WEAPON_ELITES) { continue; }
if (r == WEAPON_MAC10) { continue; }
if (r == BUY_AK47) { continue; }
if (r == BUY_SG552) { continue; }
if (r == BUY_G3SG1) { continue; }
if (r == BUY_ELITES) { continue; }
if (r == BUY_MAC10) { continue; }
}
if (g_cstrikeWeaponPrice[r] <= pl.money) {
CSEv_BuyWeapon_f((float)r);
if (cs_buyprices[r] <= pl.money) {
CSEv_CSBuy_f((float)r);
done = 1;
}
count++;
@ -499,21 +499,21 @@ CSBot_BuyStart_Shop(void)
/* CT: Random buy bomb defuse kit when enough money left */
if (pl.team == TEAM_CT && g_cs_bombzones > 0 &&
g_cstrikeUtilPrice[(float)5] <= pl.money &&
cs_buyprices[BUY_DEFUSALKIT] <= pl.money &&
random() < 0.5)
{
CSEv_BuyEquipment_f((float)5); // ITEM_DEFUSAL
CSEv_CSBuy_f(BUY_DEFUSALKIT); // ITEM_DEFUSAL
}
/* need armor */
if (pl.armor < 100) {
if (pl.money >= g_cstrikeUtilPrice[1]) /* kevlar and helmet */
CSEv_BuyEquipment_f(1);
else if (pl.money >= g_cstrikeUtilPrice[0]) /* just kevlar */
CSEv_BuyEquipment_f(0);
if (pl.money >= cs_buyprices[1]) /* kevlar and helmet */
CSEv_CSBuy_f(BUY_VESTHELMET);
else if (pl.money >= cs_buyprices[0]) /* just kevlar */
CSEv_CSBuy_f(BUY_VEST);
} else if (!(pl.g_items & ITEM_HELMET)) { /* we need helmet */
if (pl.money >= 350) /* kevlar and helmet */
CSEv_BuyEquipment_f(1);
CSEv_CSBuy_f(BUY_VESTHELMET);
}
#if FIXME
@ -527,8 +527,8 @@ CSBot_BuyStart_Shop(void)
#endif
/* force buy right now */
CSEv_AmmoBuyPrimary();
CSEv_AmmoBuySecondary();
CSEv_CSBuy_f(BUY_PRIMARYAMMO);
CSEv_CSBuy_f(BUY_SECONDARYAMMO);
}
void

View file

@ -15,7 +15,7 @@
*/
/* values courtesy of https://wiki.alliedmods.net/Cs_weapons_information */
int g_cstrikeWeaponPrice[] =
int cs_buyprices[] =
{
0, /* WEAPON_NONE */
1700, /* WEAPON_M3 */
@ -40,25 +40,17 @@ int g_cstrikeWeaponPrice[] =
600, /* WEAPON_P228 */
800, /* WEAPON_ELITES */
750, /* WEAPON_FIVESEVEN */
0, /* WEAPON_KNIFE */
0, /* WEAPON_KNIFE */
300, /* WEAPON_HEGRENADE */
200, /* WEAPON_FLASHBANG */
300, /* WEAPON_SMOKEGRENADE */
0 /* WEAPON_C4BOMB */
};
int g_cstrikeUtilPrice[] =
{
0, /* WEAPON_C4BOMB */
0, /* padding */
0, /* padding */
650, /* Kevlar Vest */
1000, /* Kevlar Vest & Helmet */
200, /* Flashbang */
300, /* HE Grenade */
300, /* Smoke Grenade */
200, /* Defuse Kit */
1250 /* NightVision Goggles */
};
void CSEv_BuyWeapon_f(float fWeapon);
void CSEv_BuyEquipment_f(float fWeapon);
void CSEv_AmmoBuyPrimary(void);
void CSEv_AmmoBuySecondary(void);
void CSEv_CSBuy_f(float itemID);

View file

@ -15,7 +15,7 @@
*/
void
CSEv_BuyWeapon_f(float fWeapon)
CSEv_CSBuy_f(float fWeapon)
{
#if 0
CSGameRules rules = (CSGameRules)g_grMode;

View file

@ -228,14 +228,16 @@ CSDeathmatchRules::PlayerSpawn(NSClientPlayer pp)
LevelNewParms();
LevelDecodeParms(pl);
pl.g_items = ITEM_KNIFE | ITEM_SUIT;
pl.activeweapon = WEAPON_KNIFE;
pl.GiveItem("item_suit");
pl.GiveItem("weapon_knife");
#if 0
int randomGun = (int)rint(random(WEAPON_USP45, WEAPON_FIVESEVEN));
//Weapons_AddItem(pl, randomGun, -1);
randomGun = (int)rint(random(WEAPON_M3, WEAPON_PARA));
//Weapons_AddItem(pl, randomGun, -1);
pl.activeweapon = randomGun;
#endif
Ammo_BuyPrimary(pl, TRUE);
Ammo_BuySecondary(pl, TRUE);

View file

@ -1,78 +0,0 @@
/*
* Copyright (c) 2016-2020 Marco Cawthorne <marco@icculus.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
class item_suit:NSRenderableEntity
{
void(void) item_suit;
virtual void(entity) Touch;
virtual void(void) Respawn;
virtual void(void) Spawned;
};
void
item_suit::item_suit(void)
{
/* a custom map may choose to override this */
model = "models/w_kevlar.mdl";
}
void
item_suit::Spawned(void)
{
super::Spawned();
precache_model(model);
precache_sound("items/tr_kevlar.wav");
}
void
item_suit::Respawn(void)
{
super::Respawn();
SetSolid(SOLID_TRIGGER);
SetMovetype(MOVETYPE_TOSS);
SetSize(VEC_HULL_MIN, VEC_HULL_MAX);
ReleaseThink();
}
void
item_suit::Touch(entity eToucher)
{
CSPlayer pl = (CSPlayer)eToucher;
if (pl.classname != "player") {
return;
}
if (pl.g_items & ITEM_SUIT) {
return;
}
sound(eToucher, CHAN_ITEM, "items/tr_kevlar.wav", 1, ATTN_NORM);
pl.g_items |= ITEM_SUIT;
UseTargets(eToucher, TRIG_TOGGLE, m_flDelay);
if (cvar("sv_playerslots") == 1) {
Destroy();
} else {
Disappear();
ScheduleThink(Respawn, 30.0f);
}
}
CLASSEXPORT(item_kevlar, item_suit)

View file

@ -17,12 +17,8 @@
../../../src/gs-entbase/server.src
../../../src/gs-entbase/shared.src
../shared/defs.h
defs.h
../shared/include.src
player.qc
hostage_entity.qc
armoury_entity.qc
func_bomb_target.qc
@ -33,25 +29,18 @@ func_hostage_rescue.qc
info_hostage_rescue.qc
func_vip_safetyzone.qc
info_map_parameters.qc
item_suit.qc
../../../src/botlib/include.src
bot.qc
game_money.qc
gamerules.qc
gamerules_singleplayer.qc
gamerules_deathmatch.qc
gamerules_multiplayer.qc
radio.qc
ammo.qc
buy.qc
server.qc
../../../valve/src/server/flashlight.qc
spawn.qc
../../../src/server/include.src
../../../src/shared/include.src
#endlist

View file

@ -1,74 +0,0 @@
/*
* Copyright (c) 2016-2019 Marco Cawthorne <marco@icculus.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/*
=================
info_player_start
Counter-Terrorist Spawnpoints
=================
*/
void
info_player_start(void)
{
if (autocvar_fcs_swapteams == TRUE) {
self.classname = "info_player_deathmatch";
}
self.botinfo = BOTINFO_SPAWNPOINT;
}
/*
=================
info_player_deathmatch
Terrorist Spawnpoints
=================
*/
void
info_player_deathmatch(void)
{
if (autocvar_fcs_swapteams == TRUE) {
self.classname = "info_player_start";
}
self.botinfo = BOTINFO_SPAWNPOINT;
}
/* Counter-Strike: Source compat */
void
info_player_counterterrorist(void)
{
setorigin(self, self.origin + [0,0,32]);
self.classname = "info_player_start";
info_player_start();
}
void
info_player_terrorist(void)
{
setorigin(self, self.origin + [0,0,32]);
self.classname = "info_player_deathmatch";
info_player_deathmatch();
}
/*
=================
info_vip_start
=================
*/
void
info_vip_start(void)
{
}

View file

@ -1,8 +1,34 @@
/*
* Copyright (c) 2024 Vera Visions LLC.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
class
CSProjectile:NSProjectile
{
float m_flRangeModifier;
int m_iTotalPenetrations;
float m_flMaxThickness;
void CSProjectile(void);
};
#ifdef SERVER
nonvirtual void SetRangeModifier(float);
nonvirtual void SetPenetrationMaxThickness(float);
nonvirtual void SetPenetrationPower(int);
virtual void _FireSingle(vector,vector,float,float);
virtual void _LaunchHitscan(vector, vector, float);
#endif
};

View file

@ -1,5 +1,234 @@
/*
* Copyright (c) 2024 Vera Visions LLC.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
void
CSProjectile::CSProjectile(void)
{
}
void
CSProjectile::SetRangeModifier(float rangeModifier)
{
m_flRangeModifier = rangeModifier;
}
void
CSProjectile::SetPenetrationMaxThickness(float maxThickness)
{
m_flMaxThickness = maxThickness;
}
void
CSProjectile::SetPenetrationPower(int powerLevel)
{
m_iTotalPenetrations = powerLevel;
}
#ifdef SERVER
void
CSProjectile::_LaunchHitscan(vector startPos, vector launchDir, float dmgMultiplier)
{
vector vecDir;
vector ownerAngle;
vector ownerDir;
m_eMultiTarget = __NULL__;
m_iMultiValue = 0;
ownerAngle = anglesToForward(launchDir);
ownerDir = aim(owner, 100000);
while (m_iShots > 0) {
/* use cached value */
v_forward = ownerAngle;
if (owner.flags & FL_CLIENT) {
vecDir = ownerDir;
} else {
vecDir = v_forward;
}
/* FOR NOW Monsters will not be able to do spread like players if patterns are enabled */
if (!(owner.flags & FL_CLIENT)) {
vecDir += random(-1,1) * m_vecSpread[0] * anglesToRight(launchDir);
vecDir += random(-1,1) * m_vecSpread[1] * anglesToUp(launchDir);
} else {
CSPlayer pl = (CSPlayer)owner;
/* weapons have already applied their multiplier... so attempt this */
int multiplier = pl.cs_shotmultiplier - m_iShots;
float frand = (multiplier / 6);
/* shoddy attempt at spray patterns */
if (frand < 1)
frand = frand;
else if (frand <= 2)
frand = 2 - (frand * 1.5);
vecDir += frand * m_vecSpread[0] * anglesToRight(launchDir);
vecDir += (m_vecSpread[1] * anglesToUp(launchDir)) * 2;
}
_FireSingle(startPos, vecDir, m_flDamage, m_flRange);
m_iShots--;
}
if (m_eMultiTarget) {
_ApplyDamage();
}
}
void
CSProjectile::_FireSingle(vector vecPos, vector vecAngles, float flDamage, float flRange)
{
vector range;
vector planeNormal;
vector endPos;
if (flRange <= 0)
return;
if (flDamage < 1)
return;
range = (vecAngles * 8196);
owner.dimension_solid = 255;
owner.dimension_hit = 255;
/* make sure we can gib corpses */
int oldhitcontents = owner.hitcontentsmaski;
owner.hitcontentsmaski = CONTENTBITS_POINTSOLID | CONTENTBIT_CORPSE | CONTENTBIT_WATER | CONTENTBIT_SLIME | CONTENTBIT_LAVA | CONTENTBIT_PROJECTILE;
traceline(vecPos, vecPos + range, MOVE_LAGGED | MOVE_HITMODEL, owner);
owner.hitcontentsmaski = oldhitcontents;
planeNormal = trace_plane_normal;
endPos = trace_endpos;
flRange -= trace_plane_dist;
owner.dimension_solid = 254;
owner.dimension_hit = 254;
m_iMultiBody |= trace_surface_id;
if (trace_fraction >= 1.0f)
return;
/* water impact */
if (trace_endcontentsi & CONTENTBIT_WATER) {
SurfData_ImpactOfNamedType("water", endPos, planeNormal);
_FireSingle(endPos + (v_forward * 2), vecAngles, flDamage / 2, flRange);
} else if (trace_endcontentsi & CONTENTBIT_SLIME) {
SurfData_ImpactOfNamedType("slime", endPos, planeNormal);
_FireSingle(endPos + (v_forward * 2), vecAngles, flDamage / 2, flRange);
} else if (trace_endcontentsi & CONTENTBIT_LAVA) {
SurfData_ImpactOfNamedType("lama", endPos, planeNormal);
_FireSingle(endPos + (v_forward * 2), vecAngles, flDamage / 2, flRange);
}
if (trace_ent.takedamage != DAMAGE_NO && trace_ent.iBleeds) {
Sound_Play(trace_ent, CHAN_BODY, "damage_bullet.hit");
NSClientPlayer pl = (NSClientPlayer)trace_ent;
/* modify the damage based on the location */
switch (trace_surface_id) {
case BODY_HEAD:
/* the helmet is one power house */
if (pl.HasItem("item_kevlar_helmet") == true) {
flDamage = 0;
Sound_Play(trace_ent, CHAN_BODY, "player.headshotarmor");
pl.RemoveItem("item_kevlar_helmet");
return;
} else {
flDamage *= 4;
Sound_Play(trace_ent, CHAN_BODY, "player.headshot");
}
break;
case BODY_STOMACH:
flDamage *= 0.9;
if (pl.armor > 0)
Sound_Play(trace_ent, CHAN_BODY, "player.hitarmor");
break;
case BODY_LEGLEFT:
case BODY_LEGRIGHT:
flDamage *= 0.4;
break;
}
}
/* impact per bullet */
if (m_bDetonateOnWorld == true && trace_ent.iBleeds == 0) {
if (m_strDecalGroup)
DecalGroups_Place(m_strDecalGroup, endPos + (vecAngles * -2));
SurfData_Impact(trace_ent, endPos, planeNormal);
}
/* combine them into one single Damage_Apply call later */
if (trace_ent.takedamage != DAMAGE_NO) {
if (trace_ent != m_eMultiTarget) {
trace_endpos = endPos;
_ApplyDamage();
m_eMultiTarget = (NSSurfacePropEntity)trace_ent;
m_iMultiValue = flDamage;
} else {
m_iMultiValue += flDamage;
}
}
if (m_iTotalPenetrations > 0) {
float cont;
#if 0
if (!(trace_surfaceflagsi & SURF_PENETRATE))
m_iTotalPenetrations -= 1;
#endif
/* check if this wall is 6 units thick... */
if (m_iTotalPenetrations > 0) {
cont = pointcontents(endPos + v_forward * 5);
if (cont == CONTENT_SOLID)
m_iTotalPenetrations -= 1; /* deduct 1 penetration power */
}
cont = pointcontents(endPos + v_forward * m_flMaxThickness);
if (cont == CONTENT_EMPTY)
_FireSingle(endPos + (v_forward * 2), vecAngles, flDamage / 2, flRange);
}
}
CSProjectile
CSProjectile_SpawnDef(string entityDef, NSEntity theOwner, float rangeMod, int power, vector spread)
{
entity oldself = self;
CSProjectile rocket = spawn(CSProjectile);
rocket.owner = theOwner;
self = rocket;
EntityDef_SpawnClassname(entityDef);
self = oldself;
rocket.m_vecSpread = spread;
rocket.SetRangeModifier(rangeMod);
rocket.SetPenetrationPower(power);
rocket.SetPenetrationMaxThickness((8 * power) * rangeMod);
rocket.Launch(theOwner.GetEyePos(), theOwner.GetViewAngle(), 0.0f, 0.0f, 0.0f);
return rocket;
}
#endif

View file

@ -1,3 +1,18 @@
/*
* Copyright (c) 2024 Marco Cawthorne <marco@icculus.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef CLIENT
void Cstrike_DrawCrosshair(CSPlayer);
@ -23,7 +38,7 @@ CSWeapon:NSWeapon
virtual void PrimaryAttack(void);
virtual void SecondaryAttack(void);
virtual void Release(void);
virtual void HitscanAttack(string);
virtual void FiredWeapon(string);
virtual void SwitchedToWeapon(void);
};
@ -87,11 +102,11 @@ CSWeapon::SecondaryAttack(void)
}
void
CSWeapon::HitscanAttack(string defName)
CSWeapon::FiredWeapon(string defName)
{
CSPlayer ourOwner = (CSPlayer)owner;
int numProjectiles = GetSubDefInt(defName, "numProjectiles");
string traceInfo = GetSubDefString(defName, "def_projectile");
string traceInfo = GetSubDefString(defName, "def_onFire");
float flAccuracyDivisor = GetSubDefFloat(defName,"accuracyDivisor");
float flAccuracyMovementPenalty = GetSubDefFloat(defName,"accuracyMovementPenalty");
float flAccuracyMultiplier = GetSubDefFloat(defName,"accuracyMultiplier");
@ -119,15 +134,12 @@ CSWeapon::HitscanAttack(string defName)
float traceDamage = GetSubDefFloat(traceInfo, "damage");
/* don't bother with shotguns */
if (numProjectiles <= 3i) {
//TraceAttack_SetRangeModifier(flRangeModifier);
//TraceAttack_SetPenetrationPower(flPenetrationPower);
} else {
if (numProjectiles > 3i) {
bulletSpread = [random(-1,1) * 0.1,random(-1,1) * 0.05];
}
for (int i = 0i; i < numProjectiles; i++) {
// TraceAttack_FireBulletsWithDecal(1, ourOwner.GetEyePos(), traceDamage, bulletSpread, 0, "Impact.BigShot", ourOwner);
CSProjectile_SpawnDef(traceInfo, owner, flRangeModifier, flPenetrationPower, bulletSpread);
}
#endif
@ -137,7 +149,7 @@ CSWeapon::HitscanAttack(string defName)
/* don't bother with shotguns */
if (numProjectiles <= 3i) {
Cstrike_ShotMultiplierAdd(ourOwner, flMultiplierShots, flMultiplierStrength,accuracy* flMultiplierInaccuracy);
Cstrike_ShotMultiplierAdd(ourOwner, flMultiplierShots, flMultiplierStrength, accuracy * flMultiplierInaccuracy);
}
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2021 Marco Cawthorne <marco@icculus.org>
* Copyright (c) 2016-2020 Marco Cawthorne <marco@icculus.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@ -14,14 +14,45 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
void
Player_Precache(void)
/* Weapon Indices for the weapon table */
typedef enum
{
searchhandle pm;
pm = search_begin("models/player/*/*.mdl", TRUE, TRUE);
for (int i = 0; i < search_getsize(pm); i++) {
precache_model(search_getfilename(pm, i));
}
search_end(pm);
}
BUY_NONE,
BUY_M3,
BUY_XM1014,
BUY_MP5,
BUY_P90,
BUY_UMP45,
BUY_MAC10,
BUY_TMP,
#if defined(CZERO) || defined(CSSOURCE)
BUY_FAMAS,
BUY_GALIL,
#endif
BUY_AK47,
BUY_SG552,
BUY_M4A1,
BUY_AUG,
BUY_SCOUT,
BUY_AWP,
BUY_G3SG1,
BUY_SG550,
BUY_PARA,
BUY_USP45,
BUY_GLOCK18,
BUY_DEAGLE,
BUY_P228,
BUY_ELITES,
BUY_FIVESEVEN,
BUY_KNIFE,
BUY_HEGRENADE,
BUY_FLASHBANG,
BUY_SMOKEGRENADE,
BUY_C4BOMB,
BUY_PRIMARYAMMO,
BUY_SECONDARYAMMO,
BUY_VEST,
BUY_VESTHELMET,
BUY_DEFUSALKIT,
BUY_NIGHTVISION
} cs_buyindex;

View file

@ -16,10 +16,11 @@
#include "animations.h"
#include "radio.h"
#include "weapons.h"
#include "buying.h"
#include "items.h"
#include "entities.h"
#include "events.h"
#include "CSProjectile.h"
#define TEAM_SPECTATOR 0
#define TEAM_T 1

View file

@ -12,6 +12,7 @@ fx_flashbang.qc
fx_smokenade.qc
item_c4bomb.qc
weapons_cstrike.qc
CSProjectile.qc
CSWeapon.qc
pmove.qc
#endlist

View file

@ -121,7 +121,6 @@ class CSPlayer:NSClientPlayer
PREDICTED_FLOAT(anim_bottom)
PREDICTED_FLOAT(anim_bottom_time)
virtual float(void) Physics_MaxSpeed;
virtual void(float) Physics_Fall;
virtual void(void) Physics_Jump;

View file

@ -39,101 +39,6 @@
.float waterlevel;
.float watertype;
/* values courtesy of https://wiki.alliedmods.net/Cs_weapons_information */
float
CSPlayer::Physics_MaxSpeed(void)
{
float spd = super::Physics_MaxSpeed();
switch (activeweapon)
{
case WEAPON_M3:
spd *= 230/250;
break;
case WEAPON_XM1014:
spd *= 240/250;
break;
case WEAPON_MP5:
spd *= 250/250;
break;
case WEAPON_P90:
spd *= 245/250;
break;
case WEAPON_UMP45:
spd *= 250/250;
break;
case WEAPON_MAC10:
spd *= 250/250;
break;
case WEAPON_TMP:
spd *= 250/250;
break;
case WEAPON_AK47:
spd *= 221/250;
break;
case WEAPON_SG552:
spd *= 235/250;
break;
case WEAPON_M4A1:
spd *= 230/250;
break;
case WEAPON_AUG:
spd *= 240/250;
break;
case WEAPON_SCOUT:
spd *= 260/250;
break;
case WEAPON_AWP:
spd *= 210/250;
break;
case WEAPON_G3SG1:
spd *= 210/250;
break;
case WEAPON_SG550:
spd *= 210/250;
break;
case WEAPON_PARA:
spd *= 220/250;
break;
case WEAPON_USP45:
spd *= 250/250;
break;
case WEAPON_GLOCK18:
spd *= 250/250;
break;
case WEAPON_DEAGLE:
spd *= 250/250;
break;
case WEAPON_P228:
spd *= 250/250;
break;
case WEAPON_ELITES:
spd *= 250/250;
break;
case WEAPON_FIVESEVEN:
spd *= 250/250;
break;
case WEAPON_KNIFE:
spd *= 250/250;
break;
case WEAPON_HEGRENADE:
spd *= 250/250;
break;
case WEAPON_FLASHBANG:
spd *= 250/250;
break;
case WEAPON_SMOKEGRENADE:
spd *= 250/250;
break;
case WEAPON_C4BOMB:
spd *= 250/250;
break;
default:
}
return spd;
}
void
CSPlayer::Physics_Fall(float impactspeed)
{

View file

@ -1,66 +0,0 @@
/*
* Copyright (c) 2016-2020 Marco Cawthorne <marco@icculus.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* Weapon Indices for the weapon table */
enum
{
WEAPON_NONE,
WEAPON_M3,
WEAPON_XM1014,
WEAPON_MP5,
WEAPON_P90,
WEAPON_UMP45,
WEAPON_MAC10,
WEAPON_TMP,
#if defined(CZERO) || defined(CSSOURCE)
WEAPON_FAMAS,
WEAPON_GALIL,
#endif
WEAPON_AK47,
WEAPON_SG552,
WEAPON_M4A1,
WEAPON_AUG,
WEAPON_SCOUT,
WEAPON_AWP,
WEAPON_G3SG1,
WEAPON_SG550,
WEAPON_PARA,
WEAPON_USP45,
WEAPON_GLOCK18,
WEAPON_DEAGLE,
WEAPON_P228,
WEAPON_ELITES,
WEAPON_FIVESEVEN,
WEAPON_KNIFE,
WEAPON_HEGRENADE,
WEAPON_FLASHBANG,
WEAPON_SMOKEGRENADE,
WEAPON_C4BOMB
};
#define AMMO_MAX_50AE 35
#define AMMO_MAX_762MM 90
#define AMMO_MAX_556MM 90
#define AMMO_MAX_556MMBOX 200
#define AMMO_MAX_338MAG 30
#define AMMO_MAX_9MM 120
#define AMMO_MAX_BUCKSHOT 32
#define AMMO_MAX_45ACP 100
#define AMMO_MAX_357SIG 52
#define AMMO_MAX_57MM 100
#define AMMO_MAX_FLASHBANG 2
#define AMMO_MAX_SMOKE 1
#define AMMO_MAX_HENADE 1

View file

@ -0,0 +1,6 @@
#include "items/c4.def"
#include "items/suit.def"
#include "items/kevlar_helmet.def"
#include "items/nightvision.def"
#include "items/defuse.def"
#include "items/kevlar.def"

View file

@ -0,0 +1,10 @@
entityDef item_defuse
{
"spawnclass" "NSItem"
"model" "models/w_thighpack.mdl"
"mins" "-16 -16 0"
"maxs" "16 16 16"
"snd_acquire" "buy.weapon"
"snd_respawn" "item.respawn"
"inv_carry" "1"
}

View file

@ -0,0 +1,11 @@
// actually armor
entityDef item_kevlar
{
"spawnclass" "NSItem"
"model" "models/w_kevlar.mdl"
"mins" "-16 -16 0"
"maxs" "16 16 16"
"snd_acquire" "buy.kevlar"
"snd_respawn" "item.respawn"
"inv_armor" "100"
}

View file

@ -0,0 +1,11 @@
// other equipment
entityDef item_kevlar_helmet
{
"spawnclass" "NSItem"
"model" "models/w_kevlar.mdl"
"mins" "-16 -16 0"
"maxs" "16 16 16"
"snd_acquire" "buy.kevlar"
"snd_respawn" "item.respawn"
"inv_carry" "1"
}

View file

@ -0,0 +1,10 @@
entityDef item_nightvision
{
"spawnclass" "NSItem"
"model" "models/w_backpack.mdl"
"mins" "-16 -16 0"
"maxs" "16 16 16"
"snd_acquire" "buy.weapon"
"snd_respawn" "item.respawn"
"inv_carry" "1"
}

View file

@ -0,0 +1,11 @@
// used in the training mission, HUD etc.
entityDef item_suit
{
"spawnclass" "NSItem"
"model" "models/w_kevlar.mdl"
"mins" "-16 -16 0"
"maxs" "16 16 16"
"snd_acquire" "buy.kevlar"
"snd_respawn" "item.respawn"
"inv_carry" "1"
}

View file

@ -0,0 +1,15 @@
entityDef projectile_bullet_base
{
"spawnclass" "CSProjectile"
"is_bullet" "1"
"decal_impact" "Impact.BigShot"
"detonate_on_world" "1"
}
entityDef projectile_bullet_shotgun
{
"spawnclass" "NSProjectile"
"is_bullet" "1"
"decal_impact" "Impact.BigShot"
"detonate_on_world" "1"
}

View file

@ -0,0 +1,56 @@
entityDef weapon_famas
{
"inherit" "CSBaseRifle"
"editor_usage" "FAMAS Weapon - Uses ammo_762nato"
"model" "models/w_famas.mdl"
"model_view" "models/v_famas.mdl"
"inv_name" "FAMAS Weapon"
"def_fireInfo" "fireInfo_famas"
"clipSize" ""
"actFire" ""
"actAltFire" ""
"actHolster" ""
"actReload" ""
"actDraw" ""
"actIdle" ""
"snd_fire" "Weapon_FAMAS.Single"
"speed_mod" ""
"price" ""
"crossMinDist" ""
"crossDeltaDist" ""
"accuracyDivisor" ""
"accuracyMovementPenalty" ""
"accuracyMultiplier" ""
"rangeModifier" ""
"penetrationPower" ""
"bulletStrength" ""
"multiplierShots" ""
"multiplierStrength" ""
"multiplierInaccuracy" ""
"hudSlot" "0"
"hudSlotPos" "7"
"weight" "25"
}
entityDef projectile_famas
{
"inherit" "projectile_bullet_base"
"damage" "skill:plr_famas_dmg"
}
entityDef fireInfo_famas
{
"def_onFire" "projectile_famas"
"ammoType" "ammo_762nato"
"ammoRequired" "1"
"ammoPerShot" "1"
"fireRate" ""
"model_flash" "sprites/muzzleflash2.spr"
}

View file

@ -0,0 +1,27 @@
entityDef weapon_galil
{
"inherit" "CSBaseRifle"
"editor_usage" "galil"
"model" "models/w_galil.mdl"
"model_view" "models/v_galil.mdl"
"def_onFire" "projectile_csbullet"
"inv_name" "galil"
"clipSize" "50"
"clipSizeDefault" "25"
"ammoType" "ammo_762nato"
"actFire" "5,6,7"
"actAltFire" "2"
"actHolster" "4"
"actReload" "3"
"actDraw" "4"
"actIdle" "0,1"
"snd_fire" "Weapon_Galil.Single"
"hudSlot" "0"
"hudSlotPos" "7"
"weight" "25"
}

View file

@ -40,13 +40,13 @@ entityDef weapon_m3
entityDef projectile_m3
{
"inherit" "projectile_bullet_base"
"inherit" "projectile_bullet_shotgun"
"damage" "skill:plr_m3_dmg"
}
entityDef fireInfo_m3
{
"def_onFire" "projectile_m3"
"def_onFire" "projectile_m3"
"ammoType" "ammo_buckshot"
"ammoRequired" "1"
"ammoPerShot" "1"

View file

@ -42,7 +42,7 @@ entityDef weapon_xm1014
entityDef projectile_xm1014
{
"inherit" "projectile_bullet_base"
"inherit" "projectile_bullet_shotgun"
"damage" "skill:plr_xm1014_dmg"
}

Binary file not shown.

View file

@ -0,0 +1,235 @@
// entity 0
{
"classname" "worldspawn"
"defaultteam" "0"
"newunit" "0"
"gametitle" "0"
"startdark" "0"
"MaxRange" "4096"
"sounds" "1"
"mapversion" "220"
"wad" "/Internal/WAD3/decals.wad;/Internal/WAD3/halflife.wad;/Internal/WAD3/liquids.wad;/Internal/WAD3/xeno.wad;/Internal/WAD3/cstrike.wad;/Internal/WAD3/cs_office.wad"
// brush 0
{
( 288 256 160 ) ( 288 256 0 ) ( 288 -256 160 ) Core_Urban_028 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 256 -256 160 ) ( 256 -256 0 ) ( 256 256 160 ) Core_Urban_028 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 288 -256 160 ) ( 288 -256 0 ) ( 256 -256 160 ) Core_Urban_028 [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 256 256 160 ) ( 256 256 0 ) ( 288 256 160 ) Core_Urban_028 [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 288 -256 160 ) ( 256 -256 160 ) ( 288 256 160 ) Core_Urban_028 [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
( 256 256 0 ) ( 256 -256 0 ) ( 288 256 0 ) Core_Urban_028 [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
}
// brush 1
{
( -256 256 160 ) ( -256 256 0 ) ( -256 -256 160 ) Core_Urban_028 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( -288 -256 160 ) ( -288 -256 0 ) ( -288 256 160 ) Core_Urban_028 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( -256 -256 160 ) ( -256 -256 0 ) ( -288 -256 160 ) Core_Urban_028 [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( -288 256 160 ) ( -288 256 0 ) ( -256 256 160 ) Core_Urban_028 [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( -256 -256 160 ) ( -288 -256 160 ) ( -256 256 160 ) Core_Urban_028 [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
( -288 256 0 ) ( -288 -256 0 ) ( -256 256 0 ) Core_Urban_028 [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
}
// brush 2
{
( 256 288 160 ) ( 256 288 0 ) ( 256 256 160 ) Core_Urban_028 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( -256 256 160 ) ( -256 256 0 ) ( -256 288 160 ) Core_Urban_028 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 256 256 160 ) ( 256 256 0 ) ( -256 256 160 ) Core_Urban_028 [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( -256 288 160 ) ( -256 288 0 ) ( 256 288 160 ) Core_Urban_028 [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 256 256 160 ) ( -256 256 160 ) ( 256 288 160 ) Core_Urban_028 [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
( -256 288 0 ) ( -256 256 0 ) ( 256 288 0 ) Core_Urban_028 [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
}
// brush 3
{
( 256 -256 160 ) ( 256 -256 0 ) ( 256 -288 160 ) Core_Urban_028 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( -256 -288 160 ) ( -256 -288 0 ) ( -256 -256 160 ) Core_Urban_028 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 256 -288 160 ) ( 256 -288 0 ) ( -256 -288 160 ) Core_Urban_028 [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( -256 -256 160 ) ( -256 -256 0 ) ( 256 -256 160 ) Core_Urban_028 [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 256 -288 160 ) ( -256 -288 160 ) ( 256 -256 160 ) Core_Urban_028 [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
( -256 -256 0 ) ( -256 -288 0 ) ( 256 -256 0 ) Core_Urban_028 [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
}
// brush 4
{
( 256 256 192 ) ( 256 256 160 ) ( 256 -256 192 ) CSTRIKE_CH3TILE [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( -256 -256 192 ) ( -256 -256 160 ) ( -256 256 192 ) CSTRIKE_CH3TILE [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 256 -256 192 ) ( 256 -256 160 ) ( -256 -256 192 ) CSTRIKE_CH3TILE [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( -256 256 192 ) ( -256 256 160 ) ( 256 256 192 ) CSTRIKE_CH3TILE [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 256 -256 192 ) ( -256 -256 192 ) ( 256 256 192 ) CSTRIKE_CH3TILE [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
( -256 256 160 ) ( -256 -256 160 ) ( 256 256 160 ) CSTRIKE_CH3TILE [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
}
// brush 5
{
( 256 256 0 ) ( 256 256 -32 ) ( 256 -256 0 ) Core_Urban_066 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( -256 -256 0 ) ( -256 -256 -32 ) ( -256 256 0 ) Core_Urban_066 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 256 -256 0 ) ( 256 -256 -32 ) ( -256 -256 0 ) Core_Urban_066 [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( -256 256 0 ) ( -256 256 -32 ) ( 256 256 0 ) Core_Urban_066 [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 256 -256 0 ) ( -256 -256 0 ) ( 256 256 0 ) Core_Urban_066 [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
( -256 256 -32 ) ( -256 -256 -32 ) ( 256 256 -32 ) Core_Urban_066 [ 1 0 0 0 ] [ 0 -1 0 0 ] 0 1 1
}
// brush 6
{
( 32 16 160 ) ( 32 -16 160 ) ( -32 16 160 ) -0CSTRIKE_WE4AL [ 0 1 0 0 ] [ 1 0 0 0 ] -0 1 1
( 32 16 160 ) ( -32 16 160 ) ( 32 16 128 ) -0CSTRIKE_WE4AL [ -1 -0 -0 0 ] [ 0 0 -1 0 ] -0 1 1
( 32 16 160 ) ( 32 16 128 ) ( 32 -16 160 ) -0CSTRIKE_WE4AL [ 0 1 0 0 ] [ 0 0 -1 0 ] -0 1 1
( -32 -16 154 ) ( 32 -16 154 ) ( -32 16 154 ) +0CSTRIKE_IE1LT [ 0 1 0 -32 ] [ -1 0 0 0 ] -0 1 1
( -32 -16 128 ) ( -32 -16 160 ) ( 32 -16 128 ) -0CSTRIKE_WE4AL [ 1 0 0 0 ] [ 0 0 -1 0 ] -0 1 1
( -32 -16 128 ) ( -32 16 128 ) ( -32 -16 160 ) -0CSTRIKE_WE4AL [ 0 -1 0 0 ] [ 0 0 -1 0 ] -0 1 1
}
}
// entity 1
{
"classname" "info_player_start"
"angles" "0 0 0"
"origin" "-192 0 37"
}
// entity 2
{
"classname" "light"
"_falloff" "0"
"_fade" "1.0"
"style" "0"
"_light" "255 255 128 200"
"origin" "0 0 128"
}
// entity 3
{
"classname" "weapon_ak47"
"origin" "128 192 16"
}
// entity 4
{
"classname" "weapon_aug"
"origin" "128 128 16"
}
// entity 5
{
"classname" "weapon_awp"
"origin" "128 64 16"
}
// entity 6
{
"classname" "weapon_c4bomb"
"origin" "128 0 16"
}
// entity 7
{
"classname" "weapon_deagle"
"origin" "128 -64 16"
}
// entity 8
{
"classname" "weapon_elites"
"origin" "128 -128 16"
}
// entity 9
{
"classname" "weapon_famas"
"origin" "128 -192 16"
}
// entity 10
{
"classname" "weapon_fiveseven"
"origin" "0 192 16"
}
// entity 11
{
"classname" "weapon_flashbang"
"origin" "0 128 16"
}
// entity 12
{
"classname" "weapon_g3sg1"
"origin" "0 64 16"
}
// entity 13
{
"classname" "weapon_galil"
"origin" "0 0 16"
}
// entity 14
{
"classname" "weapon_glock18"
"origin" "0 -64 16"
}
// entity 15
{
"classname" "weapon_hegrenade"
"origin" "0 -128 16"
}
// entity 16
{
"classname" "weapon_knife"
"origin" "0 -192 16"
}
// entity 17
{
"classname" "weapon_m249"
"origin" "-64 192 16"
}
// entity 18
{
"classname" "weapon_m3"
"origin" "-64 128 16"
}
// entity 19
{
"classname" "weapon_m4a1"
"origin" "-64 64 16"
}
// entity 20
{
"classname" "weapon_mac10"
"origin" "-64 0 16"
}
// entity 21
{
"classname" "weapon_mp5navy"
"origin" "-64 -64 16"
}
// entity 22
{
"classname" "weapon_p228"
"origin" "-64 -128 16"
}
// entity 23
{
"classname" "weapon_p90"
"origin" "-64 -192 16"
}
// entity 24
{
"classname" "weapon_scout"
"origin" "64 192 16"
}
// entity 25
{
"classname" "weapon_sg550"
"origin" "64 128 16"
}
// entity 26
{
"classname" "weapon_sg552"
"origin" "64 64 16"
}
// entity 27
{
"classname" "weapon_smokegrenade"
"origin" "64 0 16"
}
// entity 28
{
"classname" "weapon_tmp"
"origin" "64 -64 16"
}
// entity 29
{
"classname" "weapon_ump45"
"origin" "64 -128 16"
}
// entity 30
{
"classname" "weapon_usp"
"origin" "64 -192 16"
}
// entity 31
{
"classname" "weapon_xm1014"
"origin" "-128 0 16"
}

View file

@ -36,12 +36,12 @@ Player.Death
Player.GaspLight
{
sample misc/null.wav
sample common/null.wav
}
Player.GaspHeavy
{
sample misc/null.wav
sample common/null.wav
}
Player.WaterExit