Cstrike: Lots more documentation, stubs and some working new entities.
Added crosshair alternatives for AUG and SG552. Made running/crouching/jumping affect gun accuracy calculations.
This commit is contained in:
parent
af95dd8124
commit
27cfaba85f
42 changed files with 1019 additions and 64 deletions
|
@ -15,3 +15,4 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void Cstrike_DrawCrosshair(void);
|
void Cstrike_DrawCrosshair(void);
|
||||||
|
void Cstrike_DrawSimpleCrosshair();
|
||||||
|
|
|
@ -37,7 +37,7 @@ void trigger_camera::Trigger(void)
|
||||||
entity e = find(world, CBaseTrigger::m_strTargetName, m_strTarget);
|
entity e = find(world, CBaseTrigger::m_strTargetName, m_strTarget);
|
||||||
if (e) {
|
if (e) {
|
||||||
angles = vectoangles(e.origin - origin);
|
angles = vectoangles(e.origin - origin);
|
||||||
angles[0] *= -1;
|
//angles[0] *= -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2016-2019 Marco Hladik <marco@icculus.org>
|
* Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and distribute this software for any
|
* Permission to use, copy, modify, and distribute this software for any
|
||||||
* purpose with or without fee is hereby granted, provided that the above
|
* purpose with or without fee is hereby granted, provided that the above
|
||||||
|
@ -14,9 +14,46 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*QUAKED armoury_entity (0 0 0.8) (-16 -16 0) (16 16 16)
|
||||||
|
"targetname" Name
|
||||||
|
"target" Target when triggered.
|
||||||
|
"killtarget" Target to kill when triggered.
|
||||||
|
"item" Which weapon/equipment this item will contain
|
||||||
|
"count" How many of said item will players be able to pick up from this
|
||||||
|
|
||||||
|
COUNTER-STRIKE (1999) ENTITY
|
||||||
|
|
||||||
|
Items in the armoury.
|
||||||
|
|
||||||
|
An item oriented entity that contains one or more weapon/equipment item
|
||||||
|
for players to pick up. It's limited to early Counter-Strike weapons, as
|
||||||
|
it was never updated in newer versions to add support for newly added ones.
|
||||||
|
|
||||||
|
List of available items:
|
||||||
|
0 = H&K MP5-Navy
|
||||||
|
1 = Steyr Tactical (TMP)
|
||||||
|
2 = FN P90
|
||||||
|
3 = Ingram MAC-10
|
||||||
|
4 = AK-47
|
||||||
|
5 = Sig SG-552 Commando
|
||||||
|
6 = Colt M4A1 Carbine
|
||||||
|
7 = Steyr AUG
|
||||||
|
8 = Steyr Scout
|
||||||
|
9 = H&K G3/SG-1
|
||||||
|
10 = AI Arctic Warfare/Magnum
|
||||||
|
11 = Benneli M3 Super90
|
||||||
|
12 = Benneli XM1014
|
||||||
|
13 = FN M249 Para
|
||||||
|
14 = Flashbang Grenade
|
||||||
|
15 = HE Grenade
|
||||||
|
16 = Kevlar
|
||||||
|
17 = Kevlar + Helmet
|
||||||
|
18 = Smoke Grenade
|
||||||
|
*/
|
||||||
|
|
||||||
var int autocvar_fcs_nopickups = FALSE;
|
var int autocvar_fcs_nopickups = FALSE;
|
||||||
|
|
||||||
int iArmouryItems[19] = {
|
int g_cstrike_armouryitems[19] = {
|
||||||
WEAPON_MP5,
|
WEAPON_MP5,
|
||||||
WEAPON_TMP,
|
WEAPON_TMP,
|
||||||
WEAPON_P90,
|
WEAPON_P90,
|
||||||
|
@ -33,8 +70,8 @@ int iArmouryItems[19] = {
|
||||||
WEAPON_PARA,
|
WEAPON_PARA,
|
||||||
WEAPON_FLASHBANG,
|
WEAPON_FLASHBANG,
|
||||||
WEAPON_HEGRENADE,
|
WEAPON_HEGRENADE,
|
||||||
EQUIPMENT_KEVLAR,
|
0,/*EQUIPMENT_KEVLAR,*/
|
||||||
EQUIPMENT_HELMET,
|
0,/*EQUIPMENT_HELMET,*/
|
||||||
WEAPON_SMOKEGRENADE
|
WEAPON_SMOKEGRENADE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -71,12 +108,6 @@ class armoury_entity:CBaseEntity
|
||||||
virtual void() Respawn;
|
virtual void() Respawn;
|
||||||
};
|
};
|
||||||
|
|
||||||
int
|
|
||||||
amoury_entity_pickup(armoury_entity item, entity player)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
armoury_entity::touch(void)
|
armoury_entity::touch(void)
|
||||||
{
|
{
|
||||||
|
@ -84,13 +115,18 @@ armoury_entity::touch(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (amoury_entity_pickup(this, other)) {
|
if (Weapons_AddItem((player)other, m_iItem) == FALSE) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Logging_Pickup(other, this, __NULL__);
|
||||||
|
sound(other, CHAN_ITEM, "items/gunpickup2.wav", 1, ATTN_NORM);
|
||||||
|
|
||||||
m_iLeft--;
|
m_iLeft--;
|
||||||
if (m_iLeft <= 0) {
|
if (m_iLeft <= 0) {
|
||||||
Hide();
|
Hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
armoury_entity::Respawn(void)
|
armoury_entity::Respawn(void)
|
||||||
|
@ -110,13 +146,15 @@ armoury_entity::armoury_entity(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_iCount = 1;
|
||||||
|
|
||||||
for (int i = 1; i < (tokenize(__fullspawndata) - 1); i += 2) {
|
for (int i = 1; i < (tokenize(__fullspawndata) - 1); i += 2) {
|
||||||
switch (argv(i)) {
|
switch (argv(i)) {
|
||||||
case "count":
|
case "count":
|
||||||
m_iCount = stoi(argv(i + 1));
|
m_iCount = stoi(argv(i + 1));
|
||||||
break;
|
break;
|
||||||
case "item":
|
case "item":
|
||||||
m_iItem = iArmouryItems[stoi(argv(i + 1))];
|
m_iItem = g_cstrike_armouryitems[stoi(argv(i + 1))];
|
||||||
model = sArmouryModels[m_iItem];
|
model = sArmouryModels[m_iItem];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -124,7 +162,5 @@ armoury_entity::armoury_entity(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
precache_model(model);
|
|
||||||
CBaseEntity::CBaseEntity();
|
CBaseEntity::CBaseEntity();
|
||||||
armoury_entity::Respawn();
|
|
||||||
}
|
}
|
||||||
|
|
18
src/server/cstrike/defs.h
Normal file
18
src/server/cstrike/defs.h
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2016-2020 Marco Hladik <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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var int g_cstrike_buying = 0;
|
||||||
|
var float g_cstrike_bombradius = 500;
|
33
src/server/cstrike/func_bomb_target.cpp
Normal file
33
src/server/cstrike/func_bomb_target.cpp
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2016-2020 Marco Hladik <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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*QUAKED func_bomb_target (0 .5 .8) ?
|
||||||
|
"targetname" Name
|
||||||
|
"target" Target when bomb blows up.
|
||||||
|
"killtarget" Target to kill when triggered.
|
||||||
|
|
||||||
|
COUNTER-STRIKE (1999) ENTITY
|
||||||
|
|
||||||
|
Bomb target zone.
|
||||||
|
|
||||||
|
Used in the bomb defusal mode (de_* maps).
|
||||||
|
Once the bomb explodes inside this volume, it'll trigger its targets.
|
||||||
|
*/
|
||||||
|
|
||||||
|
class func_bomb_target:CBaseTrigger
|
||||||
|
{
|
||||||
|
|
||||||
|
};
|
46
src/server/cstrike/func_buyzone.cpp
Normal file
46
src/server/cstrike/func_buyzone.cpp
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2016-2020 Marco Hladik <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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*QUAKED func_buyzone (0 .5 .8) ?
|
||||||
|
"targetname" Name
|
||||||
|
"target" Target when triggered.
|
||||||
|
"killtarget" Target to kill when triggered.
|
||||||
|
"team" Limits the buyzone to be used by set team.
|
||||||
|
|
||||||
|
COUNTER-STRIKE (1999) ENTITY
|
||||||
|
|
||||||
|
Buy zone.
|
||||||
|
|
||||||
|
The buyzone is a brush volume that upon creation forces players of set team
|
||||||
|
to buy weapons in its designated area.
|
||||||
|
If this entity is not present, the game will automatically spawn buyzones
|
||||||
|
around each player spawn, unless prevented using a setting inside the
|
||||||
|
info_map_parameters entity.
|
||||||
|
|
||||||
|
Info about automatically generated buyzones:
|
||||||
|
If no func_buyzone exists, the game will create one buyzone volume with a total
|
||||||
|
width of 256 units (radius thus being 128 units) on every player spawn point.
|
||||||
|
|
||||||
|
Choices for 'team' include:
|
||||||
|
0 = All teams
|
||||||
|
1 = Terrorist
|
||||||
|
2 = Counter-Terrorist
|
||||||
|
*/
|
||||||
|
|
||||||
|
class func_buyzone:CBaseTrigger
|
||||||
|
{
|
||||||
|
|
||||||
|
};
|
32
src/server/cstrike/func_escapezone.cpp
Normal file
32
src/server/cstrike/func_escapezone.cpp
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2016-2020 Marco Hladik <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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*QUAKED func_escapezone (0 .5 .8) ?
|
||||||
|
"targetname" Name
|
||||||
|
"target" Target when triggered.
|
||||||
|
"killtarget" Target to kill when triggered.
|
||||||
|
|
||||||
|
COUNTER-STRIKE (1999) ENTITY
|
||||||
|
|
||||||
|
Terrorist escape zone.
|
||||||
|
|
||||||
|
Used in the Escape mode (es_* maps).
|
||||||
|
*/
|
||||||
|
|
||||||
|
class func_escapezone:CBaseTrigger
|
||||||
|
{
|
||||||
|
|
||||||
|
};
|
34
src/server/cstrike/func_hostage_rescue.cpp
Normal file
34
src/server/cstrike/func_hostage_rescue.cpp
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2016-2020 Marco Hladik <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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*QUAKED func_hostage_rescue (0 .5 .8) ?
|
||||||
|
"targetname" Name
|
||||||
|
"target" Target when triggered.
|
||||||
|
"killtarget" Target to kill when triggered.
|
||||||
|
|
||||||
|
COUNTER-STRIKE (1999) ENTITY
|
||||||
|
|
||||||
|
Hostage rescue zone.
|
||||||
|
|
||||||
|
Used in the Hostage Rescue mode (cs_* maps).
|
||||||
|
If neither a func_hostage_rescue or a info_hostage_rescue is placed,
|
||||||
|
zones will be placed in Counter-Terrorist player spawn nodes automatically.
|
||||||
|
*/
|
||||||
|
|
||||||
|
class func_hostage_rescue:CBaseTrigger
|
||||||
|
{
|
||||||
|
|
||||||
|
};
|
32
src/server/cstrike/func_vip_safetyzone.cpp
Normal file
32
src/server/cstrike/func_vip_safetyzone.cpp
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2016-2020 Marco Hladik <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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*QUAKED func_vip_safetyzone (0 .5 .8) ?
|
||||||
|
"targetname" Name
|
||||||
|
"target" Target when triggered.
|
||||||
|
"killtarget" Target to kill when triggered.
|
||||||
|
|
||||||
|
COUNTER-STRIKE (1999) ENTITY
|
||||||
|
|
||||||
|
VIP safety zone.
|
||||||
|
|
||||||
|
Used in the assassination mode (as_* maps).
|
||||||
|
*/
|
||||||
|
|
||||||
|
class func_vip_safetyzone:CBaseTrigger
|
||||||
|
{
|
||||||
|
|
||||||
|
};
|
193
src/server/cstrike/hostage_entity.cpp
Normal file
193
src/server/cstrike/hostage_entity.cpp
Normal file
|
@ -0,0 +1,193 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2016-2020 Marco Hladik <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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*QUAKED hostage_entity (0 1 0) (-16 -16 0) (16 16 72)
|
||||||
|
"targetname" Name
|
||||||
|
"target" Target when triggered.
|
||||||
|
"killtarget" Target to kill when triggered.
|
||||||
|
"model" "models/hostage.mdl"
|
||||||
|
"skin" "0"
|
||||||
|
|
||||||
|
COUNTER-STRIKE (1999) ENTITY
|
||||||
|
|
||||||
|
Hostage NPC.
|
||||||
|
|
||||||
|
Used in the Hostage Rescue mode (cs_* maps).
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
enum {
|
||||||
|
HOSA_WALK,
|
||||||
|
HOSA_WALKSCARED,
|
||||||
|
HOSA_RUN,
|
||||||
|
HOSA_RUNSCARED,
|
||||||
|
HOSA_RUNLOOK,
|
||||||
|
HOSA_180LEFT,
|
||||||
|
HOSA_180RIGHT,
|
||||||
|
HOSA_FLINCH,
|
||||||
|
HOSA_PAIN,
|
||||||
|
HOSA_PAINLEFT,
|
||||||
|
HOSA_PAINRIGHT,
|
||||||
|
HOSA_PAINLEGLEFT,
|
||||||
|
HOSA_PAINLEGRIGHT,
|
||||||
|
HOSA_IDLE1,
|
||||||
|
HOSA_IDLE2,
|
||||||
|
HOSA_IDLE3,
|
||||||
|
HOSA_IDLE4,
|
||||||
|
HOSA_IDLE5,
|
||||||
|
HOSA_IDLE6,
|
||||||
|
HOSA_SCARED_END,
|
||||||
|
HOSA_SCARED1,
|
||||||
|
HOSA_SCARED2,
|
||||||
|
HOSA_SCARED3,
|
||||||
|
HOSA_SCARED4,
|
||||||
|
HOSA_PANIC,
|
||||||
|
HOSA_FEAR1,
|
||||||
|
HOSA_FEAR2,
|
||||||
|
HOSA_CRY,
|
||||||
|
HOSA_SCI1,
|
||||||
|
HOSA_SCI2,
|
||||||
|
HOSA_SCI3,
|
||||||
|
HOSA_DIE_SIMPLE,
|
||||||
|
HOSA_DIE_FORWARD1,
|
||||||
|
HOSA_DIE_FORWARD2,
|
||||||
|
HOSA_DIE_BACKWARD,
|
||||||
|
HOSA_DIE_HEADSHOT,
|
||||||
|
HOSA_DIE_GUTSHOT,
|
||||||
|
HOSA_LYING1,
|
||||||
|
HOSA_LYING2,
|
||||||
|
HOSA_DEADSIT,
|
||||||
|
HOSA_DEADTABLE1,
|
||||||
|
HOSA_DEADTABLE2,
|
||||||
|
HOSA_DEADTABLE3
|
||||||
|
};
|
||||||
|
|
||||||
|
class hostage_entity:CBaseNPC
|
||||||
|
{
|
||||||
|
void() hostage_entity;
|
||||||
|
|
||||||
|
virtual void() Respawn;
|
||||||
|
virtual void() PlayerUse;
|
||||||
|
virtual void(int) Pain;
|
||||||
|
virtual void(int) Death;
|
||||||
|
virtual int() AnimIdle;
|
||||||
|
virtual int() AnimWalk;
|
||||||
|
virtual int() AnimRun;
|
||||||
|
};
|
||||||
|
|
||||||
|
int
|
||||||
|
hostage_entity::AnimIdle(void)
|
||||||
|
{
|
||||||
|
return HOSA_IDLE1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
hostage_entity::AnimWalk(void)
|
||||||
|
{
|
||||||
|
return HOSA_WALK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
hostage_entity::AnimRun(void)
|
||||||
|
{
|
||||||
|
return HOSA_RUN;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
hostage_entity::PlayerUse(void)
|
||||||
|
{
|
||||||
|
if (team == 1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_eFollowing == world)
|
||||||
|
Sound_Speak(this, "hostage_entity.follow");
|
||||||
|
|
||||||
|
CBaseNPC::PlayerUse();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
hostage_entity::Pain(int iHitBody)
|
||||||
|
{
|
||||||
|
WarnAllies();
|
||||||
|
|
||||||
|
if (m_flAnimTime > time) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (random() < 0.25f) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
frame = HOSA_FLINCH;
|
||||||
|
m_iFlags |= MONSTER_FEAR;
|
||||||
|
m_flAnimTime = time + 0.25f;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
hostage_entity::Death(int iHitBody)
|
||||||
|
{
|
||||||
|
WarnAllies();
|
||||||
|
|
||||||
|
if (style != MONSTER_DEAD) {
|
||||||
|
frame = HOSA_DIE_SIMPLE + floor(random(0, 6));
|
||||||
|
style = MONSTER_DEAD;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* now mark our state as 'dead' */
|
||||||
|
CBaseNPC::Death(iHitBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
hostage_entity::Respawn(void)
|
||||||
|
{
|
||||||
|
CBaseNPC::Respawn();
|
||||||
|
m_iFlags |= MONSTER_CANFOLLOW;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
hostage_entity::hostage_entity(void)
|
||||||
|
{
|
||||||
|
Sound_Precache("hostage_entity.follow");
|
||||||
|
|
||||||
|
m_talkAnswer = "";
|
||||||
|
m_talkAsk = "";
|
||||||
|
m_talkAllyShot = "";
|
||||||
|
m_talkGreet = "";
|
||||||
|
m_talkIdle = "";
|
||||||
|
m_talkHearing = "";
|
||||||
|
m_talkSmelling = "";
|
||||||
|
m_talkStare = "";
|
||||||
|
m_talkSurvived = "";
|
||||||
|
m_talkWounded = "";
|
||||||
|
|
||||||
|
m_talkPlayerAsk = "";
|
||||||
|
m_talkPlayerGreet = "";
|
||||||
|
m_talkPlayerIdle = "";
|
||||||
|
m_talkPlayerWounded1 = "";
|
||||||
|
m_talkPlayerWounded2 = "";
|
||||||
|
m_talkPlayerWounded3 = "";
|
||||||
|
m_talkUnfollow = "";
|
||||||
|
m_talkFollow = "";
|
||||||
|
m_talkStopFollow = "";
|
||||||
|
|
||||||
|
model = "models/hostage.mdl";
|
||||||
|
netname = "Hostage";
|
||||||
|
base_health = 100;
|
||||||
|
base_mins = [-16,-16,0];
|
||||||
|
base_maxs = [16,16,72];
|
||||||
|
CBaseNPC::CBaseNPC();
|
||||||
|
}
|
41
src/server/cstrike/info_hostage_rescue.cpp
Normal file
41
src/server/cstrike/info_hostage_rescue.cpp
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2016-2020 Marco Hladik <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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*QUAKED info_hostage_rescue (0 0 0.8) (-16 -16 0) (16 16 16)
|
||||||
|
"targetname" Name
|
||||||
|
"target" Target when triggered.
|
||||||
|
"killtarget" Target to kill when triggered.
|
||||||
|
|
||||||
|
COUNTER-STRIKE (1999) ENTITY
|
||||||
|
|
||||||
|
Hostage rescue point.
|
||||||
|
|
||||||
|
Used in the Hostage Rescue mode (cs_* maps).
|
||||||
|
Creates a volume around itself with a radius of 128 units.
|
||||||
|
If neither a info_hostage_rescue or a func_hostage_rescue is placed,
|
||||||
|
zones will be placed in Counter-Terrorist player spawn nodes automatically.
|
||||||
|
*/
|
||||||
|
|
||||||
|
class info_hostage_rescue
|
||||||
|
{
|
||||||
|
void() info_hostage_rescue;
|
||||||
|
};
|
||||||
|
|
||||||
|
void
|
||||||
|
info_hostage_rescue::info_hostage_rescue(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
55
src/server/cstrike/info_map_parameters.cpp
Normal file
55
src/server/cstrike/info_map_parameters.cpp
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2016-2020 Marco Hladik <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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*QUAKED info_map_parameters (0 0 0.8) (-16 -16 0) (16 16 16)
|
||||||
|
"targetname" Name
|
||||||
|
"target" Target when triggered.
|
||||||
|
"killtarget" Target to kill when triggered.
|
||||||
|
"buying" Override for buy-behaviour.
|
||||||
|
"bombradius" Overrides the default bomb radius.
|
||||||
|
|
||||||
|
COUNTER-STRIKE (1999) ENTITY
|
||||||
|
|
||||||
|
Miscellaneous mapping parameters.
|
||||||
|
|
||||||
|
Choices for 'buying':
|
||||||
|
0 = Both teams can buy items
|
||||||
|
1 = Only Counter-Terrorists can buy items
|
||||||
|
2 = Only Terrorists can buy items
|
||||||
|
3 = Neither Counter-Terrorists nor Terrorists can buy items
|
||||||
|
*/
|
||||||
|
|
||||||
|
class info_map_parameters
|
||||||
|
{
|
||||||
|
void() info_map_parameters;
|
||||||
|
};
|
||||||
|
|
||||||
|
void
|
||||||
|
info_map_parameters::info_map_parameters(void)
|
||||||
|
{
|
||||||
|
for (int i = 1; i < (tokenize(__fullspawndata) - 1); i += 2) {
|
||||||
|
switch (argv(i)) {
|
||||||
|
case "buying":
|
||||||
|
g_cstrike_buying = stoi(argv(i + 1));
|
||||||
|
break;
|
||||||
|
case "bombradius":
|
||||||
|
g_cstrike_bombradius = stof(argv(i + 1));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -15,6 +15,7 @@
|
||||||
../../shared/sound.c
|
../../shared/sound.c
|
||||||
../../shared/valve/animations.h
|
../../shared/valve/animations.h
|
||||||
../defs.h
|
../defs.h
|
||||||
|
../cstrike/defs.h
|
||||||
../plugins.c
|
../plugins.c
|
||||||
../logging.c
|
../logging.c
|
||||||
../nodes.c
|
../nodes.c
|
||||||
|
@ -66,6 +67,15 @@
|
||||||
../valve/items.cpp
|
../valve/items.cpp
|
||||||
../../shared/valve/weapon_common.c
|
../../shared/valve/weapon_common.c
|
||||||
|
|
||||||
|
../cstrike/armoury_entity.cpp
|
||||||
|
../cstrike/func_bomb_target.cpp
|
||||||
|
../cstrike/func_buyzone.cpp
|
||||||
|
../cstrike/func_escapezone.cpp
|
||||||
|
../cstrike/func_hostage_rescue.cpp
|
||||||
|
../cstrike/func_vip_safetyzone.cpp
|
||||||
|
../cstrike/hostage_entity.cpp
|
||||||
|
../cstrike/info_hostage_rescue.cpp
|
||||||
|
../cstrike/info_map_parameters.cpp
|
||||||
../cstrike/item_suit.cpp
|
../cstrike/item_suit.cpp
|
||||||
|
|
||||||
../spawn.c
|
../spawn.c
|
||||||
|
|
|
@ -60,5 +60,6 @@ enumflags
|
||||||
GF_USE_RELEASED,
|
GF_USE_RELEASED,
|
||||||
GF_IN_VEHICLE,
|
GF_IN_VEHICLE,
|
||||||
GF_FROZEN,
|
GF_FROZEN,
|
||||||
GF_SEMI_TOGGLED
|
GF_SEMI_TOGGLED,
|
||||||
|
GF_GAMESTARTS
|
||||||
};
|
};
|
||||||
|
|
|
@ -14,6 +14,19 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*QUAKED weapon_ak47 (0 0 1) (-16 -16 0) (16 16 32)
|
||||||
|
"model" "models/w_ak47.mdl"
|
||||||
|
|
||||||
|
COUNTER-STRIKE (1999) ENTITY
|
||||||
|
|
||||||
|
AK-47 Weapon
|
||||||
|
|
||||||
|
- Buy Menu -
|
||||||
|
Price: $2500
|
||||||
|
Terrorists only weapon
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
AK47_IDLE,
|
AK47_IDLE,
|
||||||
AK47_RELOAD,
|
AK47_RELOAD,
|
||||||
|
|
|
@ -14,6 +14,19 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*QUAKED weapon_aug (0 0 1) (-16 -16 0) (16 16 32)
|
||||||
|
"model" "models/w_aug.mdl"
|
||||||
|
|
||||||
|
COUNTER-STRIKE (1999) ENTITY
|
||||||
|
|
||||||
|
Steyr AUG Weapon
|
||||||
|
|
||||||
|
- Buy Menu -
|
||||||
|
Price: $3500
|
||||||
|
Counter-Terrorists only weapon
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
AUG_IDLE,
|
AUG_IDLE,
|
||||||
AUG_RELOAD,
|
AUG_RELOAD,
|
||||||
|
@ -144,10 +157,30 @@ w_aug_primary(void)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pl.viewzoom == 1.0f) {
|
||||||
pl.w_attack_next = 0.0825f;
|
pl.w_attack_next = 0.0825f;
|
||||||
|
} else {
|
||||||
|
pl.w_attack_next = 0.15f;
|
||||||
|
}
|
||||||
pl.w_idle_next = pl.w_attack_next;
|
pl.w_idle_next = pl.w_attack_next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
w_aug_secondary(void)
|
||||||
|
{
|
||||||
|
player pl = (player)self;
|
||||||
|
if (pl.w_attack_next) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
/* Simple toggle of fovs */
|
||||||
|
if (pl.viewzoom == 1.0f) {
|
||||||
|
pl.viewzoom = 0.2f;
|
||||||
|
} else {
|
||||||
|
pl.viewzoom = 1.0f;
|
||||||
|
}
|
||||||
|
pl.w_attack_next = 0.5f;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
w_aug_reload(void)
|
w_aug_reload(void)
|
||||||
{
|
{
|
||||||
|
@ -191,7 +224,12 @@ void
|
||||||
w_aug_hud(void)
|
w_aug_hud(void)
|
||||||
{
|
{
|
||||||
#ifdef CSQC
|
#ifdef CSQC
|
||||||
|
player pl = (player)self;
|
||||||
|
if (pl.viewzoom == 1.0f) {
|
||||||
Cstrike_DrawCrosshair();
|
Cstrike_DrawCrosshair();
|
||||||
|
} else {
|
||||||
|
Cstrike_DrawSimpleCrosshair();
|
||||||
|
}
|
||||||
HUD_DrawAmmo1();
|
HUD_DrawAmmo1();
|
||||||
HUD_DrawAmmo2();
|
HUD_DrawAmmo2();
|
||||||
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
|
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
|
||||||
|
@ -240,7 +278,7 @@ weapon_t w_aug =
|
||||||
w_aug_draw,
|
w_aug_draw,
|
||||||
__NULL__,
|
__NULL__,
|
||||||
w_aug_primary,
|
w_aug_primary,
|
||||||
__NULL__,
|
w_aug_secondary,
|
||||||
w_aug_reload,
|
w_aug_reload,
|
||||||
w_cstrike_weaponrelease,
|
w_cstrike_weaponrelease,
|
||||||
w_aug_hud,
|
w_aug_hud,
|
||||||
|
|
|
@ -14,6 +14,18 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*QUAKED weapon_awp (0 0 1) (-16 -16 0) (16 16 32)
|
||||||
|
"model" "models/w_awp.mdl"
|
||||||
|
|
||||||
|
COUNTER-STRIKE (1999) ENTITY
|
||||||
|
|
||||||
|
AWP (AI Arctic Warfare/Magnum) Weapon
|
||||||
|
|
||||||
|
- Buy Menu -
|
||||||
|
Price: $4750
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
AWP_IDLE,
|
AWP_IDLE,
|
||||||
AWP_SHOOT1,
|
AWP_SHOOT1,
|
||||||
|
|
|
@ -14,13 +14,32 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*QUAKED weapon_c4bomb (0 0 1) (-16 -16 0) (16 16 32)
|
||||||
|
"model" "models/w_c4bomb.mdl"
|
||||||
|
|
||||||
|
COUNTER-STRIKE (1999) ENTITY
|
||||||
|
|
||||||
|
C4 Bomb Weapon, Bomb Defusal Gamemode Entity
|
||||||
|
|
||||||
|
Default arsenal for Terrorists
|
||||||
|
|
||||||
|
Can only be picked up by Terrorists and planted in
|
||||||
|
func_bombtarget brush entities.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
C4BOMB_IDLE,
|
C4_IDLE,
|
||||||
C4BOMB_RELOAD,
|
C4_DRAW,
|
||||||
C4BOMB_DRAW,
|
C4_DROP,
|
||||||
C4BOMB_SHOOT1,
|
C4_ENTERCODE
|
||||||
C4BOMB_SHOOT2,
|
};
|
||||||
C4BOMB_SHOOT3
|
|
||||||
|
enum {
|
||||||
|
C4S_NONE,
|
||||||
|
C4S_ENTERINGCODE,
|
||||||
|
C4S_DROPPING,
|
||||||
|
C4S_DONE
|
||||||
};
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -32,29 +51,29 @@ w_c4bomb_precache(void)
|
||||||
Sound_Precache("weapon_c4bomb.explode");
|
Sound_Precache("weapon_c4bomb.explode");
|
||||||
Sound_Precache("weapon_c4bomb.plant");
|
Sound_Precache("weapon_c4bomb.plant");
|
||||||
#endif
|
#endif
|
||||||
precache_model("models/v_c4bomb.mdl");
|
precache_model("models/v_c4.mdl");
|
||||||
precache_model("models/w_c4bomb.mdl");
|
precache_model("models/w_c4.mdl");
|
||||||
precache_model("models/p_c4bomb.mdl");
|
precache_model("models/p_c4.mdl");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
w_c4bomb_updateammo(player pl)
|
w_c4bomb_updateammo(player pl)
|
||||||
{
|
{
|
||||||
#ifdef SSQC
|
#ifdef SSQC
|
||||||
Weapons_UpdateAmmo(pl, -1, -1, -1);
|
Weapons_UpdateAmmo(pl, pl.a_ammo1, pl.a_ammo2, pl.a_ammo3);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
string
|
string
|
||||||
w_c4bomb_wmodel(void)
|
w_c4bomb_wmodel(void)
|
||||||
{
|
{
|
||||||
return "models/w_c4bomb.mdl";
|
return "models/w_c4.mdl";
|
||||||
}
|
}
|
||||||
|
|
||||||
string
|
string
|
||||||
w_c4bomb_pmodel(void)
|
w_c4bomb_pmodel(void)
|
||||||
{
|
{
|
||||||
return "models/p_c4bomb.mdl";
|
return "models/p_c4.mdl";
|
||||||
}
|
}
|
||||||
|
|
||||||
string
|
string
|
||||||
|
@ -65,42 +84,63 @@ w_c4bomb_deathmsg(void)
|
||||||
|
|
||||||
void
|
void
|
||||||
w_c4bomb_draw(void)
|
w_c4bomb_draw(void)
|
||||||
|
{
|
||||||
|
Weapons_SetModel("models/v_c4.mdl");
|
||||||
|
Weapons_ViewAnimation(C4_DRAW);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
w_c4bomb_release(void)
|
||||||
{
|
{
|
||||||
player pl = (player)self;
|
player pl = (player)self;
|
||||||
#ifdef CSQC
|
|
||||||
Weapons_SetModel("models/v_c4bomb.mdl");
|
if (pl.a_ammo1 == C4S_DROPPING) {
|
||||||
Weapons_ViewAnimation(C4BOMB_DRAW);
|
if (pl.w_idle_next <= 0.0f) {
|
||||||
|
pl.a_ammo1 = C4S_DONE;
|
||||||
|
#ifdef SSQC
|
||||||
|
Weapons_RemoveItem(pl, WEAPON_C4BOMB);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* reset animation */
|
||||||
|
if (pl.a_ammo1 != C4S_NONE) {
|
||||||
|
Weapons_ViewAnimation(C4_IDLE);
|
||||||
|
}
|
||||||
|
pl.a_ammo1 = C4S_NONE;
|
||||||
|
pl.w_idle_next = 0.0f;
|
||||||
|
pl.flags &= ~FL_FROZEN;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
w_c4bomb_primary(void)
|
w_c4bomb_primary(void)
|
||||||
{
|
{
|
||||||
player pl = (player)self;
|
player pl = (player)self;
|
||||||
|
|
||||||
if (pl.w_attack_next > 0.0) {
|
pl.flags |= FL_FROZEN;
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef CSQC
|
switch (pl.a_ammo1) {
|
||||||
View_SetMuzzleflash(MUZZLE_RIFLE);
|
case C4S_NONE:
|
||||||
Weapons_ViewPunchAngle([-2,0,0]);
|
pl.a_ammo1 = C4S_ENTERINGCODE;
|
||||||
|
Weapons_ViewAnimation(C4_ENTERCODE);
|
||||||
int r = (float)input_sequence % 3;
|
pl.w_idle_next = 3.0f;
|
||||||
switch (r) {
|
|
||||||
case 0:
|
|
||||||
Weapons_ViewAnimation(C4BOMB_SHOOT1);
|
|
||||||
break;
|
break;
|
||||||
case 1:
|
case C4S_ENTERINGCODE:
|
||||||
Weapons_ViewAnimation(C4BOMB_SHOOT2);
|
if (pl.w_idle_next <= 0.0f) {
|
||||||
|
pl.a_ammo1 = C4S_DROPPING;
|
||||||
|
Weapons_ViewAnimation(C4_DROP);
|
||||||
|
pl.w_idle_next = 1.0f;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case C4S_DROPPING:
|
||||||
|
w_c4bomb_release();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Weapons_ViewAnimation(C4BOMB_SHOOT3);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
pl.w_attack_next = 0.0955f;
|
pl.w_attack_next = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
float
|
float
|
||||||
|
@ -113,7 +153,6 @@ void
|
||||||
w_c4bomb_hud(void)
|
w_c4bomb_hud(void)
|
||||||
{
|
{
|
||||||
#ifdef CSQC
|
#ifdef CSQC
|
||||||
Cstrike_DrawCrosshair();
|
|
||||||
HUD_DrawAmmo2();
|
HUD_DrawAmmo2();
|
||||||
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
|
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
|
||||||
drawsubpic(aicon_pos, [24,24], "sprites/640hud7.spr_0.tga", [96/256,96/256], [24/256, 24/256], g_hud_color, pSeat->ammo2_alpha, DRAWFLAG_ADDITIVE);
|
drawsubpic(aicon_pos, [24,24], "sprites/640hud7.spr_0.tga", [96/256,96/256], [24/256, 24/256], g_hud_color, pSeat->ammo2_alpha, DRAWFLAG_ADDITIVE);
|
||||||
|
@ -163,7 +202,7 @@ weapon_t w_c4bomb =
|
||||||
w_c4bomb_primary,
|
w_c4bomb_primary,
|
||||||
__NULL__,
|
__NULL__,
|
||||||
__NULL__,
|
__NULL__,
|
||||||
__NULL__,
|
w_c4bomb_release,
|
||||||
w_c4bomb_hud,
|
w_c4bomb_hud,
|
||||||
w_c4bomb_precache,
|
w_c4bomb_precache,
|
||||||
__NULL__,
|
__NULL__,
|
||||||
|
|
|
@ -14,6 +14,18 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*QUAKED weapon_deagle (0 0 1) (-16 -16 0) (16 16 32)
|
||||||
|
"model" "models/w_deagle.mdl"
|
||||||
|
|
||||||
|
COUNTER-STRIKE (1999) ENTITY
|
||||||
|
|
||||||
|
Desert Eagle .50 AE Weapon
|
||||||
|
|
||||||
|
- Buy Menu -
|
||||||
|
Price: $650
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
DEAGLE_IDLE,
|
DEAGLE_IDLE,
|
||||||
DEAGLE_SHOOT1,
|
DEAGLE_SHOOT1,
|
||||||
|
|
|
@ -14,6 +14,18 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*QUAKED weapon_elites (0 0 1) (-16 -16 0) (16 16 32)
|
||||||
|
"model" "models/w_elite.mdl"
|
||||||
|
|
||||||
|
COUNTER-STRIKE (1999) ENTITY
|
||||||
|
|
||||||
|
Dual Beretta 96G (Elites) Weapon
|
||||||
|
|
||||||
|
- Buy Menu -
|
||||||
|
Price: $1000
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
ELITES_IDLE,
|
ELITES_IDLE,
|
||||||
ELITES_IDLE_LEFTEMPTY,
|
ELITES_IDLE_LEFTEMPTY,
|
||||||
|
|
|
@ -14,6 +14,18 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*QUAKED weapon_fiveseven (0 0 1) (-16 -16 0) (16 16 32)
|
||||||
|
"model" "models/w_fiveseven.mdl"
|
||||||
|
|
||||||
|
COUNTER-STRIKE (1999) ENTITY
|
||||||
|
|
||||||
|
Five-SeveN Weapon
|
||||||
|
|
||||||
|
- Buy Menu -
|
||||||
|
Price: $750
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
FIVESEVEN_IDLE,
|
FIVESEVEN_IDLE,
|
||||||
FIVESEVEN_SHOOT1,
|
FIVESEVEN_SHOOT1,
|
||||||
|
|
|
@ -14,6 +14,20 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*QUAKED weapon_flashbang (0 0 1) (-16 -16 0) (16 16 32)
|
||||||
|
"model" "models/w_flashbang.mdl"
|
||||||
|
|
||||||
|
COUNTER-STRIKE (1999) ENTITY
|
||||||
|
|
||||||
|
Concussion (Flashbang) Grenade Weapon
|
||||||
|
|
||||||
|
When thrown, nearby players become blinded temporarily from the blast.
|
||||||
|
|
||||||
|
- Buy Menu -
|
||||||
|
Price: $200
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
FLASHBANG_IDLE,
|
FLASHBANG_IDLE,
|
||||||
FLASHBANG_RELOAD,
|
FLASHBANG_RELOAD,
|
||||||
|
|
|
@ -14,6 +14,18 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*QUAKED weapon_g3sg1 (0 0 1) (-16 -16 0) (16 16 32)
|
||||||
|
"model" "models/w_g3sg1.mdl"
|
||||||
|
|
||||||
|
COUNTER-STRIKE (1999) ENTITY
|
||||||
|
|
||||||
|
Heckler & Koch G3/SG-1 Weapon
|
||||||
|
|
||||||
|
- Buy Menu -
|
||||||
|
Price: $5000
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
G3SG1_IDLE,
|
G3SG1_IDLE,
|
||||||
G3SG1_SHOOT1,
|
G3SG1_SHOOT1,
|
||||||
|
|
|
@ -14,6 +14,20 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*QUAKED weapon_glock18 (0 0 1) (-16 -16 0) (16 16 32)
|
||||||
|
"model" "models/w_glock18.mdl"
|
||||||
|
|
||||||
|
COUNTER-STRIKE (1999) ENTITY
|
||||||
|
|
||||||
|
Glock 18 Select Fire Weapon
|
||||||
|
|
||||||
|
Default arsenal for Terrorists
|
||||||
|
|
||||||
|
- Buy Menu -
|
||||||
|
Price: $400
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
GLOCK_IDLE1,
|
GLOCK_IDLE1,
|
||||||
GLOCK_IDLE2,
|
GLOCK_IDLE2,
|
||||||
|
|
|
@ -14,6 +14,20 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*QUAKED weapon_hegrenade (0 0 1) (-16 -16 0) (16 16 32)
|
||||||
|
"model" "models/w_hegrenade.mdl"
|
||||||
|
|
||||||
|
COUNTER-STRIKE (1999) ENTITY
|
||||||
|
|
||||||
|
HE (High Explosive) Grenade Weapon
|
||||||
|
|
||||||
|
When thrown, explodes with a fairly deadly blast radius to players.
|
||||||
|
|
||||||
|
- Buy Menu -
|
||||||
|
Price: $300
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
HEGRENADE_IDLE,
|
HEGRENADE_IDLE,
|
||||||
HEGRENADE_RELOAD,
|
HEGRENADE_RELOAD,
|
||||||
|
|
|
@ -14,6 +14,17 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*QUAKED weapon_knife (0 0 1) (-16 -16 0) (16 16 32)
|
||||||
|
"model" "models/w_knife.mdl"
|
||||||
|
|
||||||
|
COUNTER-STRIKE (1999) ENTITY
|
||||||
|
|
||||||
|
Knife Weapon
|
||||||
|
|
||||||
|
Default arsenal on both teams
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
KNIFE_IDLE,
|
KNIFE_IDLE,
|
||||||
KNIFE_RELOAD,
|
KNIFE_RELOAD,
|
||||||
|
|
|
@ -14,6 +14,18 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*QUAKED weapon_m3 (0 0 1) (-16 -16 0) (16 16 32)
|
||||||
|
"model" "models/w_m3.mdl"
|
||||||
|
|
||||||
|
COUNTER-STRIKE (1999) ENTITY
|
||||||
|
|
||||||
|
Benneli M3 Super90 Weapon
|
||||||
|
|
||||||
|
- Buy Menu -
|
||||||
|
Price: $1700
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
M3_IDLE,
|
M3_IDLE,
|
||||||
M3_SHOOT1,
|
M3_SHOOT1,
|
||||||
|
|
|
@ -14,6 +14,19 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*QUAKED weapon_m4a1 (0 0 1) (-16 -16 0) (16 16 32)
|
||||||
|
"model" "models/w_m4a1.mdl"
|
||||||
|
|
||||||
|
COUNTER-STRIKE (1999) ENTITY
|
||||||
|
|
||||||
|
Colt M4A1 Carbine Weapon
|
||||||
|
|
||||||
|
- Buy Menu -
|
||||||
|
Price: $3100
|
||||||
|
Counter-Terrorists only weapon
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
M4A1_IDLE,
|
M4A1_IDLE,
|
||||||
M4A1_SHOOT1,
|
M4A1_SHOOT1,
|
||||||
|
|
|
@ -14,6 +14,18 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*QUAKED weapon_mac10 (0 0 1) (-16 -16 0) (16 16 32)
|
||||||
|
"model" "models/w_mac10.mdl"
|
||||||
|
|
||||||
|
COUNTER-STRIKE (1999) ENTITY
|
||||||
|
|
||||||
|
Ingram MAC-10 Weapon
|
||||||
|
|
||||||
|
- Buy Menu -
|
||||||
|
Price: $1400
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
MAC10_IDLE,
|
MAC10_IDLE,
|
||||||
MAC10_RELOAD,
|
MAC10_RELOAD,
|
||||||
|
|
|
@ -14,6 +14,18 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*QUAKED weapon_mp5 (0 0 1) (-16 -16 0) (16 16 32)
|
||||||
|
"model" "models/w_mp5.mdl"
|
||||||
|
|
||||||
|
COUNTER-STRIKE (1999) ENTITY
|
||||||
|
|
||||||
|
Heckler & Koch MP5-Navy Weapon
|
||||||
|
|
||||||
|
- Buy Menu -
|
||||||
|
Price: $1500
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
MP5_IDLE,
|
MP5_IDLE,
|
||||||
MP5_RELOAD,
|
MP5_RELOAD,
|
||||||
|
|
|
@ -14,6 +14,18 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*QUAKED weapon_ (0 0 1) (-16 -16 0) (16 16 32)
|
||||||
|
"model" "models/w_p228.mdl"
|
||||||
|
|
||||||
|
COUNTER-STRIKE (1999) ENTITY
|
||||||
|
|
||||||
|
SIG P228 Weapon
|
||||||
|
|
||||||
|
- Buy Menu -
|
||||||
|
Price: $600
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
P228_IDLE,
|
P228_IDLE,
|
||||||
P228_SHOOT1,
|
P228_SHOOT1,
|
||||||
|
|
|
@ -14,6 +14,18 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*QUAKED weapon_p90 (0 0 1) (-16 -16 0) (16 16 32)
|
||||||
|
"model" "models/w_p90.mdl"
|
||||||
|
|
||||||
|
COUNTER-STRIKE (1999) ENTITY
|
||||||
|
|
||||||
|
FN P90 Weapon
|
||||||
|
|
||||||
|
- Buy Menu -
|
||||||
|
Price: $2350
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
P90_IDLE,
|
P90_IDLE,
|
||||||
P90_RELOAD,
|
P90_RELOAD,
|
||||||
|
|
|
@ -14,6 +14,18 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*QUAKED weapon_m249 (0 0 1) (-16 -16 0) (16 16 32)
|
||||||
|
"model" "models/w_m249.mdl"
|
||||||
|
|
||||||
|
COUNTER-STRIKE (1999) ENTITY
|
||||||
|
|
||||||
|
FN M249 Para Weapon
|
||||||
|
|
||||||
|
- Buy Menu -
|
||||||
|
Price: $5750
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
PARA_IDLE,
|
PARA_IDLE,
|
||||||
PARA_SHOOT1,
|
PARA_SHOOT1,
|
||||||
|
|
|
@ -14,6 +14,18 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*QUAKED weapon_scout (0 0 1) (-16 -16 0) (16 16 32)
|
||||||
|
"model" "models/w_scout.mdl"
|
||||||
|
|
||||||
|
COUNTER-STRIKE (1999) ENTITY
|
||||||
|
|
||||||
|
Steyr Scout Weapon
|
||||||
|
|
||||||
|
- Buy Menu -
|
||||||
|
Price: $1250
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
SCOUT_IDLE,
|
SCOUT_IDLE,
|
||||||
SCOUT_SHOOT1,
|
SCOUT_SHOOT1,
|
||||||
|
|
|
@ -14,6 +14,18 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*QUAKED weapon_sg550 (0 0 1) (-16 -16 0) (16 16 32)
|
||||||
|
"model" "models/w_sg550.mdl"
|
||||||
|
|
||||||
|
COUNTER-STRIKE (1999) ENTITY
|
||||||
|
|
||||||
|
SIG SG 550 Weapon
|
||||||
|
|
||||||
|
- Buy Menu -
|
||||||
|
Price: $4200
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
SG550_IDLE,
|
SG550_IDLE,
|
||||||
SG550_SHOOT1,
|
SG550_SHOOT1,
|
||||||
|
|
|
@ -14,6 +14,18 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*QUAKED weapon_sg552 (0 0 1) (-16 -16 0) (16 16 32)
|
||||||
|
"model" "models/w_sg552.mdl"
|
||||||
|
|
||||||
|
COUNTER-STRIKE (1999) ENTITY
|
||||||
|
|
||||||
|
SIG SG 552 Commando Weapon
|
||||||
|
|
||||||
|
- Buy Menu -
|
||||||
|
Price: $3500
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
SG552_IDLE,
|
SG552_IDLE,
|
||||||
SG552_RELOAD,
|
SG552_RELOAD,
|
||||||
|
@ -145,10 +157,30 @@ w_sg552_primary(void)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pl.viewzoom == 1.0f) {
|
||||||
pl.w_attack_next = 0.0825f;
|
pl.w_attack_next = 0.0825f;
|
||||||
|
} else {
|
||||||
|
pl.w_attack_next = 0.15f;
|
||||||
|
}
|
||||||
pl.w_idle_next = pl.w_attack_next;
|
pl.w_idle_next = pl.w_attack_next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
w_sg552_secondary(void)
|
||||||
|
{
|
||||||
|
player pl = (player)self;
|
||||||
|
if (pl.w_attack_next) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
/* Simple toggle of fovs */
|
||||||
|
if (pl.viewzoom == 1.0f) {
|
||||||
|
pl.viewzoom = 0.2f;
|
||||||
|
} else {
|
||||||
|
pl.viewzoom = 1.0f;
|
||||||
|
}
|
||||||
|
pl.w_attack_next = 0.5f;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
w_sg552_reload(void)
|
w_sg552_reload(void)
|
||||||
{
|
{
|
||||||
|
@ -192,7 +224,12 @@ void
|
||||||
w_sg552_hud(void)
|
w_sg552_hud(void)
|
||||||
{
|
{
|
||||||
#ifdef CSQC
|
#ifdef CSQC
|
||||||
|
player pl = (player)self;
|
||||||
|
if (pl.viewzoom == 1.0f) {
|
||||||
Cstrike_DrawCrosshair();
|
Cstrike_DrawCrosshair();
|
||||||
|
} else {
|
||||||
|
Cstrike_DrawSimpleCrosshair();
|
||||||
|
}
|
||||||
HUD_DrawAmmo1();
|
HUD_DrawAmmo1();
|
||||||
HUD_DrawAmmo2();
|
HUD_DrawAmmo2();
|
||||||
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
|
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
|
||||||
|
@ -241,7 +278,7 @@ weapon_t w_sg552 =
|
||||||
w_sg552_draw,
|
w_sg552_draw,
|
||||||
__NULL__,
|
__NULL__,
|
||||||
w_sg552_primary,
|
w_sg552_primary,
|
||||||
__NULL__,
|
w_sg552_secondary,
|
||||||
w_sg552_reload,
|
w_sg552_reload,
|
||||||
w_cstrike_weaponrelease,
|
w_cstrike_weaponrelease,
|
||||||
w_sg552_hud,
|
w_sg552_hud,
|
||||||
|
|
|
@ -14,6 +14,20 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*QUAKED weapon_smokegrenade (0 0 1) (-16 -16 0) (16 16 32)
|
||||||
|
"model" "models/w_smokegrenade.mdl"
|
||||||
|
|
||||||
|
COUNTER-STRIKE (1999) ENTITY
|
||||||
|
|
||||||
|
Smoke Grenade Weapon
|
||||||
|
|
||||||
|
When thrown, the explosion casts view-blocking smoke in that radius.
|
||||||
|
|
||||||
|
- Buy Menu -
|
||||||
|
Price: $300
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
SMOKEGRENADE_IDLE,
|
SMOKEGRENADE_IDLE,
|
||||||
SMOKEGRENADE_RELOAD,
|
SMOKEGRENADE_RELOAD,
|
||||||
|
|
|
@ -14,6 +14,18 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*QUAKED weapon_tmp (0 0 1) (-16 -16 0) (16 16 32)
|
||||||
|
"model" "models/w_tmp.mdl"
|
||||||
|
|
||||||
|
COUNTER-STRIKE (1999) ENTITY
|
||||||
|
|
||||||
|
Steyr Tactical Weapon
|
||||||
|
|
||||||
|
- Buy Menu -
|
||||||
|
Price: $1250
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
TMP_IDLE,
|
TMP_IDLE,
|
||||||
TMP_RELOAD,
|
TMP_RELOAD,
|
||||||
|
|
|
@ -14,6 +14,18 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*QUAKED weapon_ump45 (0 0 1) (-16 -16 0) (16 16 32)
|
||||||
|
"model" "models/w_ump45.mdl"
|
||||||
|
|
||||||
|
COUNTER-STRIKE (1999) ENTITY
|
||||||
|
|
||||||
|
Heckler & Koch UMP .45 ACP Weapon
|
||||||
|
|
||||||
|
- Buy Menu -
|
||||||
|
Price: $1700
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
UMP45_IDLE,
|
UMP45_IDLE,
|
||||||
UMP45_RELOAD,
|
UMP45_RELOAD,
|
||||||
|
|
|
@ -14,6 +14,20 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*QUAKED weapon_usp45 (0 0 1) (-16 -16 0) (16 16 32)
|
||||||
|
"model" "models/w_usp45.mdl"
|
||||||
|
|
||||||
|
COUNTER-STRIKE (1999) ENTITY
|
||||||
|
|
||||||
|
Heckler & Koch USP .45 Tactical Weapon
|
||||||
|
|
||||||
|
Default arsenal for Counter-Terrorists
|
||||||
|
|
||||||
|
- Buy Menu -
|
||||||
|
Price: $500
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
USP45_IDLE,
|
USP45_IDLE,
|
||||||
USP45_SHOOT1,
|
USP45_SHOOT1,
|
||||||
|
|
|
@ -14,6 +14,18 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*QUAKED weapon_xm1014 (0 0 1) (-16 -16 0) (16 16 32)
|
||||||
|
"model" "models/w_xm1014.mdl"
|
||||||
|
|
||||||
|
COUNTER-STRIKE (1999) ENTITY
|
||||||
|
|
||||||
|
Benneli XM1014 Weapon
|
||||||
|
|
||||||
|
- Buy Menu -
|
||||||
|
Price: $3000
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
XM1014_IDLE,
|
XM1014_IDLE,
|
||||||
XM1014_SHOOT1,
|
XM1014_SHOOT1,
|
||||||
|
|
|
@ -44,11 +44,21 @@ Cstrike_ShotMultiplierAdd(player pl, int shots)
|
||||||
float
|
float
|
||||||
Cstrike_CalculateAccuracy(player pl, float divisor)
|
Cstrike_CalculateAccuracy(player pl, float divisor)
|
||||||
{
|
{
|
||||||
|
float m = 1.0f;
|
||||||
|
|
||||||
|
if (!(pl.flags & FL_ONGROUND)) {
|
||||||
|
m = 2.0f;
|
||||||
|
} else if (pl.flags & FL_CROUCHING) {
|
||||||
|
m = 0.5f;
|
||||||
|
} else if (vlen(pl.velocity) > 120) {
|
||||||
|
m = 1.5f;
|
||||||
|
}
|
||||||
|
|
||||||
if (divisor == -1) {
|
if (divisor == -1) {
|
||||||
/* snipers shoot way less accurate overall. */
|
/* snipers shoot way less accurate overall. */
|
||||||
return (pl.viewzoom < 1.0f) ? 0.0f : 0.05;
|
return (pl.viewzoom < 1.0f) ? (0.0f) : (0.05 * m);
|
||||||
} else {
|
} else {
|
||||||
return (pl.cs_shotmultiplier / divisor);
|
return (pl.cs_shotmultiplier / divisor) * m;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue