Added sprite blood, weapon prediction changes [WIP]
This commit is contained in:
parent
9e403c057f
commit
1b2dd20edb
33 changed files with 628 additions and 106 deletions
|
@ -311,18 +311,12 @@ void CSQC_Input_Frame(void)
|
|||
pSeat->fInputSendNext = time + 0.2;
|
||||
}
|
||||
|
||||
|
||||
if (pSeat->fInputSendNext > time) {
|
||||
input_impulse = 0;
|
||||
input_buttons = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if (input_impulse == 101) {
|
||||
print("This aint Half-Life.\n");
|
||||
input_impulse = 0;
|
||||
}
|
||||
|
||||
if (input_impulse == 201) {
|
||||
sendevent("Spraylogo", "");
|
||||
}
|
||||
|
@ -343,7 +337,6 @@ void CSQC_Input_Frame(void)
|
|||
input_buttons |= INPUT_BUTTON8;
|
||||
}
|
||||
|
||||
input_angles += pSeat->vPunchAngle;
|
||||
Game_Input();
|
||||
}
|
||||
|
||||
|
@ -386,6 +379,20 @@ void CSQC_Parse_Event(void)
|
|||
vSparkAngle_z = readcoord();
|
||||
Effect_CreateSpark(vSparkPos, vSparkAngle);
|
||||
break;
|
||||
case EV_BLOOD:
|
||||
vector vBloodPos;
|
||||
vector vBloodAngle;
|
||||
|
||||
vBloodPos[0] = readcoord();
|
||||
vBloodPos[1] = readcoord();
|
||||
vBloodPos[2] = readcoord();
|
||||
|
||||
vBloodAngle[0] = readcoord();
|
||||
vBloodAngle[1] = readcoord();
|
||||
vBloodAngle[2] = readcoord();
|
||||
|
||||
Effect_CreateBlood(vBloodPos, vBloodAngle);
|
||||
break;
|
||||
case EV_EXPLOSION:
|
||||
vector vExploPos;
|
||||
|
||||
|
|
|
@ -8,18 +8,17 @@
|
|||
|
||||
void Player_ReadEntity(float flIsNew)
|
||||
{
|
||||
player pl = (player)self;
|
||||
|
||||
if ( flIsNew == TRUE ) {
|
||||
spawnfunc_player();
|
||||
|
||||
pl.classname = "player";
|
||||
pl.solid = SOLID_SLIDEBOX;
|
||||
pl.drawmask = MASK_ENGINE;
|
||||
pl.customphysics = Empty;
|
||||
setsize( pl, VEC_HULL_MIN, VEC_HULL_MAX );
|
||||
self.classname = "player";
|
||||
self.solid = SOLID_SLIDEBOX;
|
||||
self.drawmask = MASK_ENGINE;
|
||||
self.customphysics = Empty;
|
||||
setsize( self, VEC_HULL_MIN, VEC_HULL_MAX );
|
||||
}
|
||||
|
||||
player pl = (player)self;
|
||||
pl.modelindex = readshort();
|
||||
pl.origin[0] = readcoord();
|
||||
pl.origin[1] = readcoord();
|
||||
|
|
|
@ -6,6 +6,7 @@ enum {
|
|||
EV_WEAPON_SECONDARYATTACK,
|
||||
EV_WEAPON_RELOAD,
|
||||
EV_IMPACT,
|
||||
EV_BLOOD,
|
||||
EV_EXPLOSION,
|
||||
EV_SPARK,
|
||||
EV_SHAKE,
|
||||
|
|
|
@ -57,6 +57,11 @@ float Math_FixDelta( float fDelta ) {
|
|||
return fDelta;
|
||||
}
|
||||
|
||||
vector Math_Reflect( vector v1, vector v2 )
|
||||
{
|
||||
return v1 - 2 * dotproduct( v1, v2 ) * v2;
|
||||
}
|
||||
|
||||
float Math_CRandom( void ) {
|
||||
return 2 * ( random() - 0.5 );
|
||||
}
|
||||
|
|
6
Source/server/.gwdir
Normal file
6
Source/server/.gwdir
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"fsn_info_type" = <*I0>;
|
||||
iconposition = <*I5>;
|
||||
iconsize = <*I48>;
|
||||
labeltxtsize = <*I12>;
|
||||
}
|
|
@ -190,14 +190,14 @@ void Damage_Apply(entity eTarget, entity eAttacker, float iDamage, vector vHitPo
|
|||
|
||||
entity eOld = self;
|
||||
self = eTarget;
|
||||
|
||||
|
||||
if (self.health <= 0) {
|
||||
self.health = 0;
|
||||
self.vDeath(trace_surface_id);
|
||||
} else {
|
||||
self.vPain(trace_surface_id);
|
||||
}
|
||||
|
||||
|
||||
self = eOld;
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -9,12 +9,10 @@
|
|||
#define CLASSEXPORT(classname,classa) void classname ( void ) { spawnfunc_##classa(); }
|
||||
|
||||
void Effect_Impact( int iType, vector vPos, vector vNormal );
|
||||
|
||||
void Effect_CreateExplosion( vector vPos );
|
||||
void Footsteps_Update( void );
|
||||
|
||||
|
||||
void TraceAttack_FireBullets( int iShots, vector vPos );
|
||||
void TraceAttack_FireBullets( int iShots, vector vPos, int iDamage);
|
||||
void Damage_Radius( vector vOrigin, entity eAttacker, float fDamage, float fRadius, int iCheckClip );
|
||||
void Damage_Apply( entity eTarget, entity eAttacker, float fDamage, vector vHitPos, int iSkipArmor );
|
||||
void Client_TriggerCamera( entity eTarget, vector vPos, vector vEndPos, float fResetTime );
|
||||
|
|
|
@ -15,16 +15,16 @@ TraceAttack_FireSingle
|
|||
Fires a single shot that can penetrate some materials
|
||||
=================
|
||||
*/
|
||||
void TraceAttack_FireSingle(vector vPos, vector vAngle)
|
||||
void TraceAttack_FireSingle(vector vPos, vector vAngle, int iDamage)
|
||||
{
|
||||
static void TraceAttack_Penetrate(vector vPos, vector vAngle ) {
|
||||
/*static void TraceAttack_Penetrate(vector vPos, vector vAngle ) {
|
||||
if (iTotalPenetrations > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
TraceAttack_FireSingle(vPos, vAngle);
|
||||
TraceAttack_FireSingle(vPos, vAngle, iDamage);
|
||||
iTotalPenetrations = 1;
|
||||
}
|
||||
}*/
|
||||
|
||||
#ifdef CSTRIKE
|
||||
traceline(vPos, vPos + (vAngle * wptTable[self.weapon].fRange), MOVE_HITMODEL, self);
|
||||
|
@ -35,12 +35,12 @@ void TraceAttack_FireSingle(vector vPos, vector vAngle)
|
|||
if (trace_fraction != 1.0) {
|
||||
if (trace_ent.takedamage == DAMAGE_YES) {
|
||||
#ifdef CSTRIKE
|
||||
Damage_Apply(trace_ent, self, wptTable[self.weapon].iDamage, trace_endpos, FALSE);
|
||||
Damage_Apply(trace_ent, self, iDamage, trace_endpos, FALSE);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (trace_ent.iBleeds == TRUE) {
|
||||
Effect_Impact(IMPACT_FLESH, trace_endpos, trace_plane_normal);
|
||||
Effect_CreateBlood(trace_endpos, [0,0,0]);
|
||||
} else {
|
||||
string sTexture = getsurfacetexture(trace_ent, getsurfacenearpoint(trace_ent, trace_endpos));
|
||||
|
||||
|
@ -74,15 +74,16 @@ void TraceAttack_FireSingle(vector vPos, vector vAngle)
|
|||
}
|
||||
}
|
||||
|
||||
void TraceAttack_FireSingleLagged(vector vPos, vector vAngle) {
|
||||
static void TraceAttack_Penetrate(vector vPos, vector vAngle ) {
|
||||
void TraceAttack_FireSingleLagged(vector vPos, vector vAngle, int iDamage)
|
||||
{
|
||||
/*static void TraceAttack_Penetrate(vector vPos, vector vAngle ) {
|
||||
if (iTotalPenetrations > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
TraceAttack_FireSingle(vPos, vAngle);
|
||||
TraceAttack_FireSingle(vPos, vAngle, iDamage);
|
||||
iTotalPenetrations = 1;
|
||||
}
|
||||
}*/
|
||||
|
||||
#ifdef CSTRIKE
|
||||
traceline(vPos, vPos + (vAngle * wptTable[self.weapon].fRange), MOVE_LAGGED | MOVE_HITMODEL, self);
|
||||
|
@ -92,13 +93,13 @@ void TraceAttack_FireSingleLagged(vector vPos, vector vAngle) {
|
|||
|
||||
if (trace_fraction != 1.0) {
|
||||
if (trace_ent.takedamage == DAMAGE_YES) {
|
||||
#ifdef CSTRIKE
|
||||
Damage_Apply(trace_ent, self, wptTable[self.weapon].iDamage, trace_endpos, FALSE);
|
||||
#endif
|
||||
|
||||
Damage_Apply(trace_ent, self, iDamage, trace_endpos, FALSE);
|
||||
|
||||
}
|
||||
|
||||
if (trace_ent.iBleeds == TRUE) {
|
||||
Effect_Impact(IMPACT_FLESH, trace_endpos, trace_plane_normal);
|
||||
//Effect_CreateBlood(trace_endpos, [0,0,0]);
|
||||
} else {
|
||||
string sTexture = getsurfacetexture(trace_ent, getsurfacenearpoint(trace_ent, trace_endpos));
|
||||
|
||||
|
@ -106,7 +107,7 @@ void TraceAttack_FireSingleLagged(vector vPos, vector vAngle) {
|
|||
case 'G':
|
||||
case 'V':
|
||||
Effect_Impact(IMPACT_METAL, trace_endpos, trace_plane_normal);
|
||||
TraceAttack_Penetrate(trace_endpos + (v_forward * 2), vAngle);
|
||||
//TraceAttack_Penetrate(trace_endpos + (v_forward * 2), vAngle);
|
||||
break;
|
||||
case 'M':
|
||||
case 'P':
|
||||
|
@ -115,14 +116,14 @@ void TraceAttack_FireSingleLagged(vector vPos, vector vAngle) {
|
|||
case 'D':
|
||||
case 'W':
|
||||
Effect_Impact(IMPACT_WOOD, trace_endpos, trace_plane_normal);
|
||||
TraceAttack_Penetrate(trace_endpos + (v_forward * 2), vAngle);
|
||||
//TraceAttack_Penetrate(trace_endpos + (v_forward * 2), vAngle);
|
||||
break;
|
||||
case 'Y':
|
||||
Effect_Impact(IMPACT_GLASS, trace_endpos, trace_plane_normal);
|
||||
break;
|
||||
case 'N':
|
||||
Effect_Impact(IMPACT_DEFAULT, trace_endpos, trace_plane_normal);
|
||||
TraceAttack_Penetrate(trace_endpos + (v_forward * 2), vAngle);
|
||||
//TraceAttack_Penetrate(trace_endpos + (v_forward * 2), vAngle);
|
||||
break;
|
||||
case 'T':
|
||||
default:
|
||||
|
@ -140,7 +141,7 @@ TraceAttack_FireBullets
|
|||
Fire a given amount of shots
|
||||
=================
|
||||
*/
|
||||
void TraceAttack_FireBullets(int iShots, vector vPos)
|
||||
void TraceAttack_FireBullets(int iShots, vector vPos, int iDamage)
|
||||
{
|
||||
vector vDir;
|
||||
makevectors(self.v_angle);
|
||||
|
@ -152,8 +153,8 @@ void TraceAttack_FireBullets(int iShots, vector vPos)
|
|||
#else
|
||||
vDir = aim(self, 100000);
|
||||
#endif
|
||||
TraceAttack_FireSingle(vPos, vDir);
|
||||
TraceAttack_FireSingleLagged(vPos, vDir);
|
||||
//TraceAttack_FireSingle(vPos, vDir, iDamage);
|
||||
TraceAttack_FireSingleLagged(vPos, vDir, iDamage);
|
||||
iShots--;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@ defs.h
|
|||
|
||||
../gs-entbase/server.src
|
||||
valve/monster_rat.cpp
|
||||
valve/monster_scientist.cpp
|
||||
|
||||
../shared/decals.c
|
||||
../shared/effects.c
|
||||
|
|
|
@ -93,6 +93,7 @@ void Game_PutClientInServer(void)
|
|||
pl.customphysics = Empty;
|
||||
pl.vPain = Player_Pain;
|
||||
pl.vDeath = Player_Death;
|
||||
pl.iBleeds = TRUE;
|
||||
forceinfokey(pl, "*spec", "0");
|
||||
|
||||
if (cvar("sv_playerslots") == 1) {
|
||||
|
|
|
@ -80,6 +80,10 @@ void Damage_Apply(entity eTarget, entity eAttacker, float fDamage, vector vHitPo
|
|||
} else {
|
||||
self.vPain(trace_surface_id);
|
||||
}
|
||||
|
||||
if (self.iBleeds == TRUE) {
|
||||
Effect_CreateBlood(vHitPos, [0,0,0]);
|
||||
}
|
||||
|
||||
self = eOld;
|
||||
}
|
||||
|
|
|
@ -30,6 +30,26 @@ void Input_Handle(void)
|
|||
} else {
|
||||
Player_UseUp();
|
||||
}
|
||||
|
||||
if (cvar("sv_cheats") == 1) {
|
||||
player pl = (player)self;
|
||||
if (self.impulse == 101) {
|
||||
Weapons_AddItem(pl, WEAPON_CROWBAR);
|
||||
Weapons_AddItem(pl, WEAPON_GLOCK);
|
||||
Weapons_AddItem(pl, WEAPON_PYTHON);
|
||||
Weapons_AddItem(pl, WEAPON_MP5);
|
||||
Weapons_AddItem(pl, WEAPON_SHOTGUN);
|
||||
Weapons_AddItem(pl, WEAPON_CROSSBOW);
|
||||
Weapons_AddItem(pl, WEAPON_RPG);
|
||||
Weapons_AddItem(pl, WEAPON_GAUSS);
|
||||
Weapons_AddItem(pl, WEAPON_EGON);
|
||||
Weapons_AddItem(pl, WEAPON_HORNETGUN);
|
||||
Weapons_AddItem(pl, WEAPON_HANDGRENADE);
|
||||
Weapons_AddItem(pl, WEAPON_SATCHEL);
|
||||
Weapons_AddItem(pl, WEAPON_TRIPMINE);
|
||||
Weapons_AddItem(pl, WEAPON_SNARK);
|
||||
}
|
||||
}
|
||||
|
||||
self.impulse = 0;
|
||||
}
|
||||
|
|
349
Source/server/valve/monster_scientist.cpp
Normal file
349
Source/server/valve/monster_scientist.cpp
Normal file
|
@ -0,0 +1,349 @@
|
|||
/***
|
||||
*
|
||||
* Copyright (c) 2016-2019 Marco 'eukara' Hladik. All rights reserved.
|
||||
*
|
||||
* See the file LICENSE attached with the sources for usage details.
|
||||
*
|
||||
****/
|
||||
|
||||
enum {
|
||||
SCI_IDLE,
|
||||
SCI_WALK,
|
||||
SCI_RUN
|
||||
};
|
||||
|
||||
enum {
|
||||
SCIA_WALK,
|
||||
SCIA_WALKSCARED,
|
||||
SCIA_RUN,
|
||||
SCIA_RUNSCARED,
|
||||
SCIA_RUNLOOK,
|
||||
SCIA_180LEFT,
|
||||
SCIA_180RIGHT,
|
||||
SCIA_FLINCH,
|
||||
SCIA_PAIN,
|
||||
SCIA_PAINLEFT,
|
||||
SCIA_PAINRIGHT,
|
||||
SCIA_PAINLEGLEFT,
|
||||
SCIA_PAINLEGRIGHT,
|
||||
SCIA_IDLE1,
|
||||
SCIA_IDLE2,
|
||||
SCIA_IDLE3,
|
||||
SCIA_IDLE4,
|
||||
SCIA_IDLE5,
|
||||
SCIA_IDLE6,
|
||||
SCIA_SCARED_END,
|
||||
SCIA_SCARED1,
|
||||
SCIA_SCARED2,
|
||||
SCIA_SCARED3,
|
||||
SCIA_SCARED4,
|
||||
SCIA_PANIC,
|
||||
SCIA_FEAR1,
|
||||
SCIA_FEAR2,
|
||||
SCIA_CRY,
|
||||
SCIA_SCI1,
|
||||
SCIA_SCI2,
|
||||
SCIA_SCI3,
|
||||
SCIA_DIE_SIMPLE,
|
||||
SCIA_DIE_FORWARD1,
|
||||
SCIA_DIE_FORWARD2,
|
||||
SCIA_DIE_BACKWARD,
|
||||
SCIA_DIE_HEADSHOT,
|
||||
SCIA_DIE_GUTSHOT,
|
||||
SCIA_LYING1,
|
||||
SCIA_LYING2,
|
||||
SCIA_DEADSIT,
|
||||
SCIA_DEADTABLE1,
|
||||
SCIA_DEADTABLE2,
|
||||
SCIA_DEADTABLE3
|
||||
};
|
||||
|
||||
string sci_snddie[] = {
|
||||
"scientist/sci_die1.wav",
|
||||
"scientist/sci_die2.wav",
|
||||
"scientist/sci_die3.wav",
|
||||
"scientist/sci_die4.wav"
|
||||
};
|
||||
|
||||
string sci_sndpain[] = {
|
||||
"scientist/sci_pain1.wav",
|
||||
"scientist/sci_pain2.wav",
|
||||
"scientist/sci_pain3.wav",
|
||||
"scientist/sci_pain4.wav",
|
||||
"scientist/sci_pain5.wav",
|
||||
"scientist/sci_pain6.wav",
|
||||
"scientist/sci_pain7.wav",
|
||||
"scientist/sci_pain8.wav",
|
||||
"scientist/sci_pain9.wav",
|
||||
"scientist/sci_pain10.wav"
|
||||
};
|
||||
|
||||
string sci_sndscream[] = {
|
||||
"scientist/scream1.wav",
|
||||
"scientist/scream2.wav",
|
||||
"scientist/scream3.wav",
|
||||
"scientist/scream4.wav",
|
||||
"scientist/dontwantdie.wav",
|
||||
"scientist/scream5.wav",
|
||||
"scientist/scream6.wav",
|
||||
"scientist/scream7.wav",
|
||||
"scientist/evergetout.wav",
|
||||
"scientist/scream8.wav",
|
||||
"scientist/scream9.wav",
|
||||
"scientist/scream10.wav"
|
||||
"scientist/scream11.wav",
|
||||
"scientist/getoutalive.wav",
|
||||
"scientist/scream12.wav",
|
||||
"scientist/scream13.wav",
|
||||
"scientist/scream14.wav",
|
||||
"scientist/scream15.wav",
|
||||
"scientist/scream16.wav",
|
||||
"scientist/getoutofhere.wav",
|
||||
"scientist/scream17.wav",
|
||||
"scientist/scream18.wav",
|
||||
"scientist/scream19.wav",
|
||||
"scientist/gottogetout.wav",
|
||||
"scientist/scream20.wav",
|
||||
"scientist/scream21.wav",
|
||||
"scientist/scream22.wav",
|
||||
"scientist/youinsane.wav",
|
||||
"scientist/scream23.wav",
|
||||
"scientist/scream24.wav",
|
||||
"scientist/scream25.wav"
|
||||
};
|
||||
|
||||
class monster_scientist:CBaseEntity
|
||||
{
|
||||
vector m_vecLastUserPos;
|
||||
entity m_eUser;
|
||||
entity m_eRescuer;
|
||||
int m_iUsed;
|
||||
int m_iScared;
|
||||
int m_iFear;
|
||||
float m_flScreamTime;
|
||||
void() monster_scientist;
|
||||
|
||||
virtual void() touch;
|
||||
virtual void() Hide;
|
||||
virtual void() Respawn;
|
||||
virtual void() PlayerUse;
|
||||
virtual void(int) vPain;
|
||||
virtual void(int) vDeath;
|
||||
virtual void() Physics;
|
||||
virtual void() Scream;
|
||||
virtual void() Gib;
|
||||
};
|
||||
|
||||
void monster_scientist::Gib(void)
|
||||
{
|
||||
Hide();
|
||||
|
||||
for (int i = 0; i < 5; i++) {
|
||||
entity gib = spawn();
|
||||
//gib.think = Util_Remove;
|
||||
gib.nextthink = 10.0f;
|
||||
}
|
||||
}
|
||||
|
||||
void monster_scientist::Scream(void)
|
||||
{
|
||||
if (m_flScreamTime > time) {
|
||||
return;
|
||||
}
|
||||
|
||||
int rand = floor(random(0,sci_sndscream.length));
|
||||
sound(this, CHAN_VOICE, sci_sndscream[rand], 1.0, ATTN_NORM);
|
||||
m_flScreamTime = time + 5.0f;
|
||||
}
|
||||
|
||||
void monster_scientist::Physics(void)
|
||||
{
|
||||
float spvel;
|
||||
input_movevalues = [0,0,0];
|
||||
input_impulse = 0;
|
||||
input_buttons = 0;
|
||||
|
||||
/* Deal with a hostage being rescued when it's following someone else */
|
||||
if (m_eRescuer.classname == "monster_scientist") {
|
||||
if (m_eRescuer.solid == SOLID_NOT) {
|
||||
m_eRescuer = m_eUser;
|
||||
}
|
||||
}
|
||||
/* Deal with the hostage losing its rescuer (death) */
|
||||
if (m_eUser.health <= 0) {
|
||||
m_eUser = world;
|
||||
}
|
||||
|
||||
if (m_eUser!= world) {
|
||||
v_angle = vectoangles(m_eRescuer.origin - origin);
|
||||
v_angle[0] = 0;
|
||||
v_angle[1] = Math_FixDelta(v_angle[1]);
|
||||
v_angle[2] = 0;
|
||||
|
||||
/* Give up after 1024 units */
|
||||
if (vlen(m_eRescuer.origin - origin) > 1024) {
|
||||
m_eUser = world;
|
||||
} else if (vlen(m_eRescuer.origin - origin) > 64) {
|
||||
input_movevalues[0] = 240;
|
||||
|
||||
other = world;
|
||||
traceline(origin, /*mins, maxs, */m_eRescuer.origin, MOVE_OTHERONLY, this);
|
||||
|
||||
/* Tracing failed, there's world geometry in the way */
|
||||
if (trace_fraction < 1.0f) {
|
||||
v_angle = vectoangles(m_vecLastUserPos - origin);
|
||||
v_angle[0] = 0;
|
||||
v_angle[1] = Math_FixDelta(v_angle[1]);
|
||||
v_angle[2] = 0;
|
||||
} else {
|
||||
m_vecLastUserPos = m_eRescuer.origin;
|
||||
}
|
||||
|
||||
/* Trace again to see if another hostage is in our path and if so
|
||||
* follow them instead, this makes pathing easier */
|
||||
traceline(origin, /*mins, maxs,*/ m_vecLastUserPos, FALSE, this);
|
||||
if (trace_ent.classname == "monster_scientist") {
|
||||
monster_scientist que = (monster_scientist)trace_ent;
|
||||
if (que.m_eRescuer == m_eUser) {
|
||||
if (trace_ent != this) {
|
||||
m_eRescuer = trace_ent;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (m_iFear == TRUE) {
|
||||
Scream();
|
||||
input_movevalues = [240, 0, 0];
|
||||
|
||||
makevectors(v_angle);
|
||||
tracebox(origin, VEC_HULL_MIN, VEC_HULL_MAX, origin + (v_forward * 240), FALSE, this);
|
||||
|
||||
if (trace_fraction < 1) {
|
||||
v_angle[1] -= 180 + (random(-45, 45));
|
||||
v_angle[1] = Math_FixDelta(v_angle[1]);
|
||||
}
|
||||
}
|
||||
|
||||
spvel = vlen(velocity);
|
||||
|
||||
if (spvel < 5) {
|
||||
frame = m_iScared ? SCIA_SCARED1:SCIA_IDLE1;
|
||||
} else if (spvel <= 140) {
|
||||
frame = m_iScared ? SCIA_WALKSCARED:SCIA_WALK;
|
||||
} else if (spvel <= 240) {
|
||||
frame = m_iScared ? SCIA_RUNSCARED:SCIA_RUN;
|
||||
}
|
||||
|
||||
input_angles = angles = v_angle;
|
||||
input_timelength = frametime;
|
||||
movetype = MOVETYPE_WALK;
|
||||
|
||||
runstandardplayerphysics(this);
|
||||
Footsteps_Update();
|
||||
|
||||
movetype = MOVETYPE_NONE;
|
||||
}
|
||||
|
||||
void monster_scientist::touch(void)
|
||||
{
|
||||
if (other.movetype == MOVETYPE_WALK) {
|
||||
velocity = normalize(other.origin - origin) * -128;
|
||||
}
|
||||
}
|
||||
|
||||
void monster_scientist::PlayerUse(void)
|
||||
{
|
||||
if ((m_eUser == world)) {
|
||||
if (m_iUsed == FALSE) {
|
||||
m_iUsed = TRUE;
|
||||
}
|
||||
|
||||
m_eUser = eActivator;
|
||||
m_eRescuer = m_eUser;
|
||||
m_vecLastUserPos = m_eUser.origin;
|
||||
} else {
|
||||
m_eUser = world;
|
||||
}
|
||||
}
|
||||
|
||||
void monster_scientist::vPain(int iHitBody)
|
||||
{
|
||||
int rand = floor(random(0,sci_sndpain.length));
|
||||
sound(this, CHAN_VOICE, sci_sndpain[rand], 1.0, ATTN_NORM);
|
||||
|
||||
frame = SCIA_FLINCH + floor(random(0, 5));
|
||||
m_iFear = TRUE;
|
||||
//m_iScared = TRUE;
|
||||
}
|
||||
|
||||
void monster_scientist::vDeath(int iHitBody)
|
||||
{
|
||||
int rand = floor(random(0,sci_snddie.length));
|
||||
sound(this, CHAN_VOICE, sci_snddie[rand], 1.0, ATTN_NORM);
|
||||
|
||||
m_eUser = world;
|
||||
solid = SOLID_NOT;
|
||||
takedamage = DAMAGE_NO;
|
||||
customphysics = __NULL__;
|
||||
m_iFear = FALSE;
|
||||
frame = SCIA_DIE_SIMPLE + floor(random(0, 6));
|
||||
|
||||
think = Respawn;
|
||||
nextthink = time + 10.0f;
|
||||
}
|
||||
|
||||
void monster_scientist::Hide(void)
|
||||
{
|
||||
setmodel(this, "");
|
||||
m_eUser = world;
|
||||
solid = SOLID_NOT;
|
||||
movetype = MOVETYPE_NONE;
|
||||
customphysics = __NULL__;
|
||||
}
|
||||
|
||||
void monster_scientist::Respawn(void)
|
||||
{
|
||||
v_angle[0] = Math_FixDelta(m_oldAngle[0]);
|
||||
v_angle[1] = Math_FixDelta(m_oldAngle[1]);
|
||||
v_angle[2] = Math_FixDelta(m_oldAngle[2]);
|
||||
|
||||
setorigin(this, m_oldOrigin);
|
||||
angles = v_angle;
|
||||
solid = SOLID_SLIDEBOX;
|
||||
movetype = MOVETYPE_NONE;
|
||||
setmodel(this, m_oldModel);
|
||||
setsize(this, VEC_HULL_MIN + [0,0,36], VEC_HULL_MAX + [0,0,36]);
|
||||
|
||||
m_eUser = world;
|
||||
iBleeds = TRUE;
|
||||
takedamage = DAMAGE_YES;
|
||||
style = SCI_IDLE;
|
||||
customphysics = Physics;
|
||||
|
||||
frame = SCIA_IDLE1;
|
||||
health = 50;
|
||||
velocity = [0,0,0];
|
||||
m_iUsed = m_iScared = FALSE;
|
||||
}
|
||||
|
||||
void monster_scientist::monster_scientist(void)
|
||||
{
|
||||
for (int i = 0; i < sci_sndpain.length; i++) {
|
||||
precache_sound(sci_sndpain[i]);
|
||||
}
|
||||
for (int i = 0; i < sci_snddie.length; i++) {
|
||||
precache_sound(sci_snddie[i]);
|
||||
}
|
||||
for (int i = 0; i < sci_sndscream.length; i++) {
|
||||
precache_sound(sci_sndscream[i]);
|
||||
}
|
||||
precache_model("models/scientist.mdl");
|
||||
|
||||
model = "models/scientist.mdl";
|
||||
|
||||
CBaseEntity::CBaseEntity();
|
||||
|
||||
precache_model(m_oldModel);
|
||||
setmodel(this, m_oldModel);
|
||||
Respawn();
|
||||
}
|
|
@ -15,3 +15,13 @@ void info_player_deathmatch(void)
|
|||
{
|
||||
|
||||
}
|
||||
|
||||
void info_player_team1(void)
|
||||
{
|
||||
self.classname = "info_player_deathmatch";
|
||||
}
|
||||
|
||||
void info_player_team2(void)
|
||||
{
|
||||
self.classname = "info_player_deathmatch";
|
||||
}
|
||||
|
|
|
@ -133,7 +133,7 @@ float BaseGun_PrimaryFire( void ) {
|
|||
|
||||
BaseGun_ShotMultiplierHandle( wptTable[ self.weapon ].iBullets );
|
||||
BaseGun_AccuracyCalc();
|
||||
TraceAttack_FireBullets( wptTable[ self.weapon ].iBullets, ( self.origin + self.view_ofs ) );
|
||||
TraceAttack_FireBullets( wptTable[ self.weapon ].iBullets, ( self.origin + self.view_ofs ), wptTable[self.weapon].iDamage );
|
||||
Animation_ShootWeapon( self );
|
||||
|
||||
self.(wptTable[ self.weapon ].iMagfld) -= 1;
|
||||
|
|
|
@ -86,7 +86,7 @@ void WeaponGLOCK18_PrimaryFire( void ) {
|
|||
if ( self.iMag_GLOCK18 ) {
|
||||
BaseGun_ShotMultiplierHandle( 1 );
|
||||
BaseGun_AccuracyCalc();
|
||||
TraceAttack_FireBullets( 1, ( self.origin + self.view_ofs ) );
|
||||
TraceAttack_FireBullets( 1, ( self.origin + self.view_ofs ), 25 );
|
||||
self.iMag_GLOCK18 -= 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,6 +34,51 @@ void Effect_CreateExplosion( vector vPos ) {
|
|||
#endif
|
||||
}
|
||||
|
||||
void Effect_CreateBlood( vector vPos, vector vAngle ) {
|
||||
#ifdef SSQC
|
||||
WriteByte( MSG_MULTICAST, SVC_CGAMEPACKET );
|
||||
WriteByte( MSG_MULTICAST, EV_BLOOD );
|
||||
WriteCoord( MSG_MULTICAST, vPos[0] );
|
||||
WriteCoord( MSG_MULTICAST, vPos[1] );
|
||||
WriteCoord( MSG_MULTICAST, vPos[2] );
|
||||
WriteCoord( MSG_MULTICAST, vAngle[0] );
|
||||
WriteCoord( MSG_MULTICAST, vAngle[1] );
|
||||
WriteCoord( MSG_MULTICAST, vAngle[2] );
|
||||
msg_entity = self;
|
||||
multicast( vPos, MULTICAST_PVS );
|
||||
#else
|
||||
sprite eBlood = spawn(sprite);
|
||||
setorigin( eBlood, vPos );
|
||||
setmodel( eBlood, "sprites/bloodspray.spr" );
|
||||
|
||||
//eExplosion.think = Effect_CreateExplosion_Animate;
|
||||
//eBlood.effects = EF_ADDITIVE;
|
||||
eBlood.drawmask = MASK_ENGINE;
|
||||
eBlood.maxframe = modelframecount( eBlood.modelindex );
|
||||
eBlood.loops = 0;
|
||||
eBlood.scale = 0.5f;
|
||||
eBlood.colormod = [1,0,0];
|
||||
eBlood.framerate = 20;
|
||||
eBlood.nextthink = time + 0.05f;
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
sprite ePart = spawn(sprite);
|
||||
setorigin(ePart, vPos);
|
||||
setmodel( ePart, "sprites/blood.spr" );
|
||||
ePart.movetype = MOVETYPE_BOUNCE;
|
||||
ePart.gravity = 0.5f;
|
||||
ePart.scale = 0.5f;
|
||||
ePart.drawmask = MASK_ENGINE;
|
||||
ePart.maxframe = modelframecount(ePart.modelindex);
|
||||
ePart.loops = 0;
|
||||
ePart.colormod = [1,0,0];
|
||||
ePart.framerate = 15;
|
||||
ePart.nextthink = time + 0.1f;
|
||||
ePart.velocity = randomvec() * 64;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void Effect_CreateSpark( vector vPos, vector vAngle ) {
|
||||
#ifdef SSQC
|
||||
WriteByte( MSG_MULTICAST, SVC_CGAMEPACKET );
|
||||
|
|
|
@ -669,9 +669,7 @@ PMove_Run
|
|||
*/
|
||||
void PMove_Run(void)
|
||||
{
|
||||
|
||||
#ifdef VALVE
|
||||
|
||||
self.maxspeed = (self.flags & FL_CROUCHING) ? 135 : 270;
|
||||
|
||||
if (input_buttons & INPUT_BUTTON5) {
|
||||
|
|
|
@ -27,8 +27,12 @@ void w_crossbow_precache(void)
|
|||
precache_model("models/v_crossbow.mdl");
|
||||
precache_model("models/w_crossbow.mdl");
|
||||
precache_model("models/p_crossbow.mdl");
|
||||
precache_model("models/crossbow_bolt.mdl");
|
||||
precache_sound("weapons/xbow_reload1.wav");
|
||||
precache_sound("weapons/xbow_fire1.wav");
|
||||
precache_sound("weapons/xbow_hit1.wav");
|
||||
precache_sound("weapons/xbow_hitbod1.wav");
|
||||
precache_sound("weapons/xbow_hitbod2.wav");
|
||||
}
|
||||
string w_crossbow_vmodel(void)
|
||||
{
|
||||
|
@ -67,7 +71,7 @@ void w_crossbow_holster(void)
|
|||
void w_crossbow_primary(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
if (pl.w_attack_next > Math_Time()) {
|
||||
if (pl.w_attack_next > 0.0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -79,14 +83,46 @@ void w_crossbow_primary(void)
|
|||
}
|
||||
|
||||
Weapons_PlaySound(pl, CHAN_WEAPON, "weapons/xbow_fire1.wav", 1, ATTN_NORM);
|
||||
|
||||
#ifdef SSQC
|
||||
static void Crossbolt_Touch(void) {
|
||||
Effect_CreateSpark(self.origin, trace_plane_normal);
|
||||
|
||||
if (other.takedamage == DAMAGE_YES) {
|
||||
Damage_Apply(other, self.owner, 50, trace_endpos, FALSE);
|
||||
if (random() < 0.5) {
|
||||
Weapons_PlaySound(self, CHAN_WEAPON, "weapons/xbow_hitbod1.wav", 1, ATTN_NORM);
|
||||
} else {
|
||||
Weapons_PlaySound(self, CHAN_WEAPON, "weapons/xbow_hitbod2.wav", 1, ATTN_NORM);
|
||||
}
|
||||
} else {
|
||||
Weapons_PlaySound(self, CHAN_WEAPON, "weapons/xbow_hit1.wav", 1, ATTN_NORM);
|
||||
}
|
||||
remove(self);
|
||||
}
|
||||
makevectors(self.v_angle);
|
||||
entity bolt = spawn();
|
||||
setorigin(bolt, self.origin + self.view_ofs + (v_forward * 16));
|
||||
setmodel(bolt, "models/crossbow_bolt.mdl");
|
||||
bolt.owner = self;
|
||||
bolt.velocity = v_forward * 2000;
|
||||
bolt.movetype = MOVETYPE_FLY;
|
||||
bolt.solid = SOLID_BBOX;
|
||||
bolt.gravity = 0.5f;
|
||||
bolt.angles = vectoangles(bolt.velocity);
|
||||
bolt.avelocity[2] = 10;
|
||||
bolt.touch = Crossbolt_Touch;
|
||||
setsize(bolt, [0,0,0], [0,0,0]);
|
||||
#endif
|
||||
|
||||
Weapons_ViewPunchAngle([-2,0,0]);
|
||||
pl.w_attack_next = Math_Time() + 0.75f;
|
||||
pl.w_idle_next = Math_Time() + 10.0f;
|
||||
pl.w_attack_next = 0.75f;
|
||||
pl.w_idle_next = 10.0f;
|
||||
}
|
||||
void w_crossbow_secondary(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
if (pl.w_attack_next > Math_Time()) {
|
||||
if (pl.w_attack_next > 0.0) {
|
||||
return;
|
||||
}
|
||||
/* Simple toggle of fovs */
|
||||
|
@ -95,24 +131,24 @@ void w_crossbow_secondary(void)
|
|||
} else {
|
||||
pl.viewzoom = 1.0f;
|
||||
}
|
||||
pl.w_attack_next = Math_Time() + 0.5f;
|
||||
pl.w_attack_next = 0.5f;
|
||||
}
|
||||
void w_crossbow_reload(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
if (pl.w_attack_next > Math_Time()) {
|
||||
if (pl.w_attack_next > 0.0) {
|
||||
return;
|
||||
}
|
||||
|
||||
Weapons_PlaySound(pl, CHAN_ITEM, "weapons/xbow_reload1.wav", 1, ATTN_NORM);
|
||||
Weapons_ViewAnimation(CROSSBOW_RELOAD);
|
||||
pl.w_attack_next = Math_Time() + 4.5f;
|
||||
pl.w_idle_next = Math_Time() + 10.0f;
|
||||
pl.w_attack_next = 4.5f;
|
||||
pl.w_idle_next = 10.0f;
|
||||
}
|
||||
void w_crossbow_release(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
if (pl.w_idle_next > Math_Time()) {
|
||||
if (pl.w_idle_next > 0.0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -122,14 +158,14 @@ void w_crossbow_release(void)
|
|||
} else {
|
||||
Weapons_ViewAnimation(CROSSBOW_IDLE2);
|
||||
}
|
||||
pl.w_idle_next = Math_Time() + 10.0f;
|
||||
pl.w_idle_next = 10.0f;
|
||||
} else {
|
||||
if (1/* has clip*/) {
|
||||
Weapons_ViewAnimation(CROSSBOW_FIDGET1);
|
||||
} else {
|
||||
Weapons_ViewAnimation(CROSSBOW_FIDGET2);
|
||||
}
|
||||
pl.w_idle_next = Math_Time() + 3.0f;
|
||||
pl.w_idle_next = 3.0f;
|
||||
}
|
||||
}
|
||||
void w_crossbow_crosshair(void)
|
||||
|
|
|
@ -24,6 +24,9 @@ void w_crowbar_precache(void)
|
|||
precache_sound("weapons/cbar_miss1.wav");
|
||||
precache_sound("weapons/cbar_hit1.wav");
|
||||
precache_sound("weapons/cbar_hit2.wav");
|
||||
precache_sound("weapons/cbar_hitbod1.wav");
|
||||
precache_sound("weapons/cbar_hitbod2.wav");
|
||||
precache_sound("weapons/cbar_hitbod3.wav");
|
||||
precache_model("models/v_crowbar.mdl");
|
||||
precache_model("models/w_crowbar.mdl");
|
||||
precache_model("models/p_crowbar.mdl");
|
||||
|
@ -102,13 +105,29 @@ void w_crowbar_primary(void)
|
|||
if (trace_fraction >= 1.0) {
|
||||
pl.w_attack_next = 0.5f;
|
||||
} else {
|
||||
if (random() < 0.5) {
|
||||
Weapons_PlaySound(pl, 8, "weapons/cbar_hit1.wav", 1, ATTN_NORM);
|
||||
} else {
|
||||
Weapons_PlaySound(pl, 8, "weapons/cbar_hit2.wav", 1, ATTN_NORM);
|
||||
}
|
||||
pl.w_attack_next = 0.25f;
|
||||
Effect_Impact(IMPACT_MELEE, trace_endpos, trace_plane_normal);
|
||||
|
||||
if (trace_ent.takedamage) {
|
||||
Damage_Apply(trace_ent, self, 10, trace_endpos, FALSE );
|
||||
|
||||
// TODO: Better way to find if it bleeds?
|
||||
if (trace_ent.iBleeds == 1) {
|
||||
if (random() < 0.33) {
|
||||
Weapons_PlaySound(pl, 8, "weapons/cbar_hitbod1.wav", 1, ATTN_NORM);
|
||||
} else if (random() < 0.66) {
|
||||
Weapons_PlaySound(pl, 8, "weapons/cbar_hitbod2.wav", 1, ATTN_NORM);
|
||||
} else {
|
||||
Weapons_PlaySound(pl, 8, "weapons/cbar_hitbod3.wav", 1, ATTN_NORM);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (random() < 0.5) {
|
||||
Weapons_PlaySound(pl, 8, "weapons/cbar_hit1.wav", 1, ATTN_NORM);
|
||||
} else {
|
||||
Weapons_PlaySound(pl, 8, "weapons/cbar_hit2.wav", 1, ATTN_NORM);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
pl.w_idle_next = 2.5f;
|
||||
|
|
|
@ -54,15 +54,15 @@ void w_gauss_holster(void)
|
|||
void w_gauss_primary(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
if (pl.w_attack_next > Math_Time()) {
|
||||
if (pl.w_attack_next > 0.0) {
|
||||
return;
|
||||
}
|
||||
|
||||
Weapons_ViewAnimation(GAUSS_FIRE2);
|
||||
Weapons_PlaySound(pl, CHAN_WEAPON, "weapons/gauss2.wav", 1, ATTN_NORM);
|
||||
|
||||
pl.w_attack_next = Math_Time() + 0.2f;
|
||||
pl.w_idle_next = Math_Time() + 2.5f;
|
||||
pl.w_attack_next = 0.2f;
|
||||
pl.w_idle_next = 2.5f;
|
||||
}
|
||||
void w_gauss_secondary(void)
|
||||
{
|
||||
|
@ -75,7 +75,7 @@ void w_gauss_reload(void)
|
|||
void w_gauss_release(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
if (pl.w_idle_next > Math_Time()) {
|
||||
if (pl.w_idle_next > 0.0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -84,15 +84,15 @@ void w_gauss_release(void)
|
|||
switch (r) {
|
||||
case 0:
|
||||
Weapons_ViewAnimation(GAUSS_IDLE1);
|
||||
pl.w_idle_next = Math_Time() + 10.0f;
|
||||
pl.w_idle_next = 10.0f;
|
||||
break;
|
||||
case 1:
|
||||
Weapons_ViewAnimation(GAUSS_IDLE2);
|
||||
pl.w_idle_next = Math_Time() + 10.0f;
|
||||
pl.w_idle_next = 10.0f;
|
||||
break;
|
||||
case 2:
|
||||
Weapons_ViewAnimation(GAUSS_FIDGET);
|
||||
pl.w_idle_next = Math_Time() + 3.0f;
|
||||
pl.w_idle_next = 3.0f;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ void w_glock_primary(void)
|
|||
return;
|
||||
}
|
||||
|
||||
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs);
|
||||
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 8);
|
||||
|
||||
pl.glock_mag--;
|
||||
|
||||
|
@ -126,7 +126,7 @@ void w_glock_secondary(void)
|
|||
return;
|
||||
}
|
||||
|
||||
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs);
|
||||
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 8);
|
||||
|
||||
pl.glock_mag--;
|
||||
|
||||
|
@ -188,7 +188,7 @@ void w_glock_release(void)
|
|||
Weapons_ViewAnimation(GLOCK_IDLE3);
|
||||
break;
|
||||
}
|
||||
pl.w_idle_next = Math_Time() + 10.0f;
|
||||
pl.w_idle_next = 10.0f;
|
||||
#endif
|
||||
}
|
||||
void w_glock_hud(void)
|
||||
|
|
|
@ -61,26 +61,26 @@ void w_hornetgun_holster(void)
|
|||
void w_hornetgun_primary(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
if (pl.w_attack_next > Math_Time()) {
|
||||
if (pl.w_attack_next > 0.0) {
|
||||
return;
|
||||
}
|
||||
|
||||
Weapons_PlaySound(pl, CHAN_WEAPON, sprintf("agrunt/ag_fire%d.wav", floor(random(1,4))), 1, ATTN_NORM);
|
||||
Weapons_ViewAnimation(HORNETGUN_SHOOT);
|
||||
pl.w_attack_next = Math_Time() + 0.25;
|
||||
pl.w_idle_next = Math_Time() + 2.5f;
|
||||
pl.w_attack_next = 0.25;
|
||||
pl.w_idle_next = 2.5f;
|
||||
}
|
||||
void w_hornetgun_secondary(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
if (pl.w_attack_next > Math_Time()) {
|
||||
if (pl.w_attack_next > 0.0) {
|
||||
return;
|
||||
}
|
||||
|
||||
Weapons_PlaySound(pl, CHAN_WEAPON, sprintf("agrunt/ag_fire%d.wav", floor(random(1,4))), 1, ATTN_NORM);
|
||||
Weapons_ViewAnimation(HORNETGUN_SHOOT);
|
||||
pl.w_attack_next = Math_Time() + 0.1;
|
||||
pl.w_idle_next = Math_Time() + 2.5f;
|
||||
pl.w_attack_next = 0.1;
|
||||
pl.w_idle_next = 2.5f;
|
||||
}
|
||||
void w_hornetgun_reload(void)
|
||||
{
|
||||
|
@ -90,7 +90,7 @@ void w_hornetgun_release(void)
|
|||
{
|
||||
int r;
|
||||
player pl = (player)self;
|
||||
if (pl.w_idle_next > Math_Time()) {
|
||||
if (pl.w_idle_next > 0.0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -99,15 +99,15 @@ void w_hornetgun_release(void)
|
|||
switch (r) {
|
||||
case 0:
|
||||
Weapons_ViewAnimation(HORNETGUN_IDLE);
|
||||
pl.w_idle_next = Math_Time() + 0.95f;
|
||||
pl.w_idle_next = 0.95f;
|
||||
break;
|
||||
case 1:
|
||||
Weapons_ViewAnimation(HORNETGUN_FIDGET1);
|
||||
pl.w_idle_next = Math_Time() + 2.5f;
|
||||
pl.w_idle_next = 2.5f;
|
||||
break;
|
||||
default:
|
||||
Weapons_ViewAnimation(HORNETGUN_FIDGET2);
|
||||
pl.w_idle_next = Math_Time() + 2.2f;
|
||||
pl.w_idle_next = 2.2f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ void w_mp5_precache(void)
|
|||
precache_model("models/v_9mmar.mdl");
|
||||
precache_model("models/w_9mmar.mdl");
|
||||
precache_model("models/p_9mmar.mdl");
|
||||
precache_model("models/grenade.mdl");
|
||||
precache_sound("weapons/hks1.wav");
|
||||
precache_sound("weapons/hks2.wav");
|
||||
precache_sound("weapons/glauncher.wav");
|
||||
|
@ -62,7 +63,7 @@ void w_mp5_holster(void)
|
|||
void w_mp5_primary(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
if (pl.w_attack_next) {
|
||||
if (pl.w_attack_next > 0.0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -75,7 +76,7 @@ void w_mp5_primary(void)
|
|||
|
||||
Weapons_ViewPunchAngle([random(-2, 2),0,0]);
|
||||
#else
|
||||
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs);
|
||||
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 5);
|
||||
|
||||
if (random() < 0.5) {
|
||||
Weapons_PlaySound(pl, CHAN_WEAPON, "weapons/hks1.wav", 1, ATTN_NORM);
|
||||
|
@ -91,7 +92,7 @@ void w_mp5_secondary(void)
|
|||
{
|
||||
player pl = (player)self;
|
||||
|
||||
if (pl.w_attack_next) {
|
||||
if (pl.w_attack_next > 0.0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -99,6 +100,27 @@ void w_mp5_secondary(void)
|
|||
Weapons_ViewAnimation(MP5_GRENADE);
|
||||
Weapons_ViewPunchAngle([-10,0,0]);
|
||||
#else
|
||||
|
||||
static void Grenade_ExplodeTouch(void) {
|
||||
Effect_CreateExplosion( self.origin );
|
||||
Damage_Radius( self.origin, self, 100, 256, TRUE );
|
||||
sound( self, CHAN_WEAPON, sprintf( "weapons/explode%d.wav", floor( random() * 2 ) + 3 ), 1, ATTN_NORM );
|
||||
remove(self);
|
||||
}
|
||||
makevectors(self.v_angle);
|
||||
entity gren = spawn();
|
||||
setmodel(gren, "models/grenade.mdl");
|
||||
setorigin(gren, self.origin + self.view_ofs + (v_forward * 16));
|
||||
gren.owner = self;
|
||||
gren.velocity = v_forward * 800;
|
||||
gren.angles = vectoangles(gren.velocity);
|
||||
gren.avelocity[0] = random(-100, -500);
|
||||
gren.gravity = 0.5f;
|
||||
gren.movetype = MOVETYPE_BOUNCE;
|
||||
gren.solid = SOLID_BBOX;
|
||||
setsize(gren, [0,0,0], [0,0,0]);
|
||||
gren.touch = Grenade_ExplodeTouch;
|
||||
|
||||
Weapons_PlaySound(pl, CHAN_WEAPON, "weapons/glauncher.wav", 1, ATTN_NORM);
|
||||
#endif
|
||||
|
||||
|
@ -125,7 +147,7 @@ void w_mp5_release(void)
|
|||
{
|
||||
#ifdef CSQC
|
||||
player pl = (player)self;
|
||||
if (pl.w_idle_next) {
|
||||
if (pl.w_idle_next > 0.0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -64,12 +64,12 @@ void w_python_holster(void)
|
|||
void w_python_primary(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
if (pl.w_attack_next > Math_Time()) {
|
||||
if (pl.w_attack_next > 0.0) {
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef SSQC
|
||||
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs);
|
||||
TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 40);
|
||||
#endif
|
||||
|
||||
Weapons_ViewAnimation(PYTHON_FIRE1);
|
||||
|
@ -81,13 +81,13 @@ void w_python_primary(void)
|
|||
Weapons_PlaySound(pl, CHAN_WEAPON, "weapons/357_shot2.wav", 1, ATTN_NORM);
|
||||
}
|
||||
|
||||
pl.w_attack_next = Math_Time() + 0.75f;
|
||||
pl.w_idle_next = Math_Time() + 10.0f;
|
||||
pl.w_attack_next = 0.75f;
|
||||
pl.w_idle_next = 10.0f;
|
||||
}
|
||||
void w_python_secondary(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
if (pl.w_attack_next > Math_Time()) {
|
||||
if (pl.w_attack_next > 0.0) {
|
||||
return;
|
||||
}
|
||||
/* Simple toggle of fovs */
|
||||
|
@ -96,17 +96,17 @@ void w_python_secondary(void)
|
|||
} else {
|
||||
pl.viewzoom = 1.0f;
|
||||
}
|
||||
pl.w_attack_next = Math_Time() + 0.5f;
|
||||
pl.w_attack_next = 0.5f;
|
||||
}
|
||||
void w_python_reload(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
if (pl.w_attack_next > Math_Time()) {
|
||||
if (pl.w_attack_next > 0.0) {
|
||||
return;
|
||||
}
|
||||
Weapons_ViewAnimation(PYTHON_RELOAD);
|
||||
pl.w_attack_next = Math_Time() + 3.25f;
|
||||
pl.w_idle_next = Math_Time() + 10.0f;
|
||||
pl.w_attack_next = 3.25f;
|
||||
pl.w_idle_next = 10.0f;
|
||||
}
|
||||
void w_python_release(void)
|
||||
{
|
||||
|
|
|
@ -57,7 +57,7 @@ void w_shotgun_holster(void)
|
|||
void w_shotgun_primary(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
if (pl.w_attack_next > Math_Time()) {
|
||||
if (pl.w_attack_next > 0.0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -70,15 +70,15 @@ void w_shotgun_primary(void)
|
|||
void w_shotgun_secondary(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
if (pl.w_attack_next > Math_Time()) {
|
||||
if (pl.w_attack_next > 0.0) {
|
||||
return;
|
||||
}
|
||||
|
||||
Weapons_PlaySound(pl, CHAN_WEAPON, "weapons/dbarrel1.wav", 1, ATTN_NORM);
|
||||
Weapons_ViewAnimation(SHOTGUN_FIRE2);
|
||||
Weapons_ViewPunchAngle([-10,0,0]);
|
||||
pl.w_attack_next = Math_Time() + 1.5f;
|
||||
pl.w_idle_next = Math_Time() + 2.5f;
|
||||
pl.w_attack_next = 1.5f;
|
||||
pl.w_idle_next = 2.5f;
|
||||
}
|
||||
void w_shotgun_reload(void)
|
||||
{
|
||||
|
@ -87,7 +87,7 @@ void w_shotgun_reload(void)
|
|||
void w_shotgun_release(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
if (pl.w_idle_next > Math_Time()) {
|
||||
if (pl.w_idle_next > 0.0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -104,7 +104,7 @@ void w_shotgun_release(void)
|
|||
break;
|
||||
}
|
||||
|
||||
pl.w_idle_next = Math_Time() + 15.0f;
|
||||
pl.w_idle_next = 15.0f;
|
||||
}
|
||||
void w_shotgun_crosshair(void)
|
||||
{
|
||||
|
|
|
@ -41,7 +41,7 @@ void w_snark_release(void)
|
|||
{
|
||||
int r;
|
||||
player pl = (player)self;
|
||||
if (pl.w_idle_next > Math_Time()) {
|
||||
if (pl.w_idle_next > 0.0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -50,15 +50,15 @@ void w_snark_release(void)
|
|||
switch (r) {
|
||||
case 0:
|
||||
Weapons_ViewAnimation(SNARK_IDLE);
|
||||
pl.w_idle_next = Math_Time() + 1.875f;
|
||||
pl.w_idle_next = 1.875f;
|
||||
break;
|
||||
case 1:
|
||||
Weapons_ViewAnimation(SNARK_FIDGET1);
|
||||
pl.w_idle_next = Math_Time() + 4.375f;
|
||||
pl.w_idle_next = 4.375f;
|
||||
break;
|
||||
default:
|
||||
Weapons_ViewAnimation(SNARK_FIDGET2);
|
||||
pl.w_idle_next = Math_Time() + 5.0f;
|
||||
pl.w_idle_next = 5.0f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ void w_tripmine_release(void)
|
|||
{
|
||||
int r;
|
||||
player pl = (player)self;
|
||||
if (pl.w_idle_next > Math_Time()) {
|
||||
if (pl.w_idle_next > 0.0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -75,15 +75,15 @@ void w_tripmine_release(void)
|
|||
switch (r) {
|
||||
case 0:
|
||||
Weapons_ViewAnimation(TRIPMINE_IDLE1);
|
||||
pl.w_idle_next = Math_Time() + 3.0f;
|
||||
pl.w_idle_next = 3.0f;
|
||||
break;
|
||||
case 1:
|
||||
Weapons_ViewAnimation(TRIPMINE_IDLE2);
|
||||
pl.w_idle_next = Math_Time() + 2.0f;
|
||||
pl.w_idle_next = 2.0f;
|
||||
break;
|
||||
default:
|
||||
Weapons_ViewAnimation(TRIPMINE_FIDGET);
|
||||
pl.w_idle_next = Math_Time() + 3.333333f;
|
||||
pl.w_idle_next = 3.333333f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
valve/menu.dat
BIN
valve/menu.dat
Binary file not shown.
BIN
valve/progs.dat
BIN
valve/progs.dat
Binary file not shown.
Loading…
Reference in a new issue