Compare commits
5 Commits
82e31a6538
...
a483cad84c
Author | SHA1 | Date |
---|---|---|
Marco Cawthorne | a483cad84c | |
Marco Cawthorne | 63a407bb71 | |
Marco Cawthorne | 1be1c6bf47 | |
Marco Cawthorne | 436dbe4641 | |
Marco Cawthorne | fa22d59818 |
|
@ -145,7 +145,9 @@ HLMultiplayerRules::PlayerDeath(NSClientPlayer pl)
|
|||
Sound_Play(pl, CHAN_AUTO, "player.die");
|
||||
|
||||
/* force respawn */
|
||||
pl.ScheduleThink(PutClientInServer, 4.0f);
|
||||
if (cvar("mp_forcerespawn") == 1) {
|
||||
pl.ScheduleThink(PutClientInServer, 4.0f);
|
||||
}
|
||||
|
||||
/* have we gone over the fraglimit? */
|
||||
CheckRules();
|
||||
|
|
|
@ -14,89 +14,6 @@
|
|||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
====================
|
||||
UseWorkaround
|
||||
====================
|
||||
*/
|
||||
void
|
||||
UseWorkaround(entity eTarget)
|
||||
{
|
||||
eActivator = self;
|
||||
entity eOldSelf = self;
|
||||
self = eTarget;
|
||||
self.PlayerUse();
|
||||
self = eOldSelf;
|
||||
}
|
||||
|
||||
void
|
||||
UnUseWorkaround(entity eTarget)
|
||||
{
|
||||
eActivator = self;
|
||||
entity eOldSelf = self;
|
||||
self = eTarget;
|
||||
if (self.PlayerUseUnpressed)
|
||||
self.PlayerUseUnpressed();
|
||||
self = eOldSelf;
|
||||
}
|
||||
|
||||
/*
|
||||
====================
|
||||
Player_UseDown
|
||||
====================
|
||||
*/
|
||||
void
|
||||
Player_UseDown(void)
|
||||
{
|
||||
vector vecSrc;
|
||||
player pl = (player)self;
|
||||
|
||||
if (self.health <= 0) {
|
||||
return;
|
||||
} else if (!(self.flags & FL_USE_RELEASED)) {
|
||||
return;
|
||||
}
|
||||
|
||||
makevectors(self.v_angle);
|
||||
vecSrc = self.origin + self.view_ofs;
|
||||
|
||||
int oldmask = self.hitcontentsmaski;
|
||||
self.hitcontentsmaski = CONTENTBITS_POINTSOLID;
|
||||
traceline(vecSrc, vecSrc + (v_forward * 64), MOVE_HITMODEL, self);
|
||||
self.hitcontentsmaski = oldmask;
|
||||
|
||||
|
||||
if (trace_ent.PlayerUse) {
|
||||
self.flags &= ~FL_USE_RELEASED;
|
||||
|
||||
UseWorkaround(trace_ent);
|
||||
pl.last_used = trace_ent;
|
||||
|
||||
/* Some entities want to support Use spamming */
|
||||
if (!(self.flags & FL_USE_RELEASED)) {
|
||||
sound(self, CHAN_ITEM, "common/wpn_select.wav", 0.25, ATTN_IDLE);
|
||||
}
|
||||
} else {
|
||||
sound(self, CHAN_ITEM, "common/wpn_denyselect.wav", 0.25, ATTN_IDLE);
|
||||
self.flags &= ~FL_USE_RELEASED;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
====================
|
||||
Player_UseUp
|
||||
====================
|
||||
*/
|
||||
void
|
||||
Player_UseUp(void) {
|
||||
player pl = (player)self;
|
||||
if (!(self.flags & FL_USE_RELEASED)) {
|
||||
UnUseWorkaround(pl.last_used);
|
||||
pl.last_used = world;
|
||||
self.flags |= FL_USE_RELEASED;
|
||||
}
|
||||
}
|
||||
|
||||
void Weapons_Draw(player pl);
|
||||
|
||||
void
|
||||
|
|
|
@ -85,6 +85,38 @@ class player:NSClientPlayer
|
|||
#endif
|
||||
};
|
||||
|
||||
void
|
||||
player::player(void)
|
||||
{
|
||||
anim_top = 0;
|
||||
anim_top_time = 0;
|
||||
anim_top_delay = 0;
|
||||
anim_bottom = 0;
|
||||
anim_bottom_time = 0;
|
||||
glock_mag = 0;
|
||||
mp5_mag = 0;
|
||||
python_mag = 0;
|
||||
shotgun_mag = 0;
|
||||
crossbow_mag = 0;
|
||||
rpg_mag = 0;
|
||||
satchel_chg = 0;
|
||||
ammo_9mm = 0;
|
||||
ammo_357 = 0;
|
||||
ammo_buckshot = 0;
|
||||
ammo_bolt = 0;
|
||||
ammo_rocket = 0;
|
||||
ammo_uranium = 0;
|
||||
ammo_handgrenade = 0;
|
||||
ammo_satchel = 0;
|
||||
ammo_tripmine = 0;
|
||||
ammo_snark = 0;
|
||||
ammo_hornet = 0;
|
||||
ammo_m203_grenade = 0;
|
||||
ammo_gauss_volume = 0;
|
||||
ammo_rpg_state = 0;
|
||||
mode_tempstate = 0;
|
||||
}
|
||||
|
||||
void Animation_PlayerUpdate(player);
|
||||
void Animation_TimerUpdate(player, float);
|
||||
|
||||
|
@ -598,35 +630,3 @@ player::SendEntity(entity ePEnt, float flChanged)
|
|||
return (1);
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
player::player(void)
|
||||
{
|
||||
anim_top = 0;
|
||||
anim_top_time = 0;
|
||||
anim_top_delay = 0;
|
||||
anim_bottom = 0;
|
||||
anim_bottom_time = 0;
|
||||
glock_mag = 0;
|
||||
mp5_mag = 0;
|
||||
python_mag = 0;
|
||||
shotgun_mag = 0;
|
||||
crossbow_mag = 0;
|
||||
rpg_mag = 0;
|
||||
satchel_chg = 0;
|
||||
ammo_9mm = 0;
|
||||
ammo_357 = 0;
|
||||
ammo_buckshot = 0;
|
||||
ammo_bolt = 0;
|
||||
ammo_rocket = 0;
|
||||
ammo_uranium = 0;
|
||||
ammo_handgrenade = 0;
|
||||
ammo_satchel = 0;
|
||||
ammo_tripmine = 0;
|
||||
ammo_snark = 0;
|
||||
ammo_hornet = 0;
|
||||
ammo_m203_grenade = 0;
|
||||
ammo_gauss_volume = 0;
|
||||
ammo_rpg_state = 0;
|
||||
mode_tempstate = 0;
|
||||
}
|
||||
|
|
|
@ -130,8 +130,6 @@ w_crowbar_primary(player pl)
|
|||
/* don't bother with decals, we got squibs */
|
||||
if (trace_ent.iBleeds) {
|
||||
FX_Blood(trace_endpos, [1,0,0]);
|
||||
} else {
|
||||
SurfData_Impact(trace_ent, trace_endpos, trace_plane_normal);
|
||||
}
|
||||
|
||||
if (trace_ent.takedamage) {
|
||||
|
|
|
@ -136,7 +136,7 @@ void w_egon_primary(player pl)
|
|||
vector src = Weapons_GetCameraPos(pl);
|
||||
vector endpos = src + v_forward * 1024;
|
||||
traceline(src, endpos, FALSE, pl);
|
||||
Damage_Radius(trace_endpos, pl, 14, 64, TRUE, DMG_ELECTRO);
|
||||
Damage_Radius(trace_endpos, pl, 14, 64, TRUE, WEAPON_EGON);
|
||||
Client_ShakeOnce(trace_endpos, 128, 0.2, 1.0, 1.0f);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -47,6 +47,7 @@ void w_shotgun_ejectshell(void)
|
|||
if (other == world)
|
||||
Sound_Play(self, CHAN_BODY, "modelevent_shotgunshell.land");
|
||||
}
|
||||
|
||||
entity eShell = spawn();
|
||||
setmodel(eShell, "models/shotgunshell.mdl");
|
||||
eShell.solid = SOLID_BBOX;
|
||||
|
@ -181,7 +182,7 @@ w_shotgun_primary(player pl)
|
|||
return;
|
||||
}
|
||||
|
||||
if (pl.w_attack_next) {
|
||||
if (pl.w_attack_next > 0.0f) {
|
||||
w_shotgun_release(pl);
|
||||
return;
|
||||
}
|
||||
|
@ -247,7 +248,7 @@ w_shotgun_secondary(player pl)
|
|||
return;
|
||||
}
|
||||
|
||||
if (pl.w_attack_next) {
|
||||
if (pl.w_attack_next > 0.0f) {
|
||||
w_shotgun_release(pl);
|
||||
return;
|
||||
}
|
||||
|
@ -310,7 +311,44 @@ w_shotgun_release(player pl)
|
|||
return;
|
||||
}
|
||||
|
||||
if (pl.mode_tempstate == SHOTTY_IDLE) {
|
||||
switch (pl.mode_tempstate) {
|
||||
case SHOTTY_RELOAD_START:
|
||||
Weapons_ViewAnimation(pl, SHOTGUN_START_RELOAD);
|
||||
pl.mode_tempstate = SHOTTY_RELOAD;
|
||||
pl.w_idle_next = 0.65f;
|
||||
break;
|
||||
case SHOTTY_RELOAD:
|
||||
Weapons_ViewAnimation(pl, SHOTGUN_RELOAD);
|
||||
pl.shotgun_mag++;
|
||||
pl.ammo_buckshot--;
|
||||
#ifdef SERVER
|
||||
Sound_Play(pl, CHAN_WEAPON, "weapon_shotgun.reload");
|
||||
#endif
|
||||
if (pl.ammo_buckshot <= 0 || pl.shotgun_mag >= 8) {
|
||||
pl.mode_tempstate = SHOTTY_RELOAD_END;
|
||||
}
|
||||
Weapons_UpdateAmmo(pl, pl.shotgun_mag, pl.ammo_buckshot, pl.mode_tempstate);
|
||||
pl.w_idle_next = 0.5f;
|
||||
break;
|
||||
case SHOTTY_RELOAD_END:
|
||||
Weapons_ViewAnimation(pl, SHOTGUN_PUMP);
|
||||
#ifdef SERVER
|
||||
Sound_Play(pl, CHAN_WEAPON, "weapon_shotgun.cock");
|
||||
#endif
|
||||
pl.mode_tempstate = SHOTTY_IDLE;
|
||||
pl.w_idle_next = 10.0f;
|
||||
pl.w_attack_next = 0.5f;
|
||||
break;
|
||||
case SHOTTY_COCKSOUND:
|
||||
#ifdef SERVER
|
||||
Sound_Play(pl, CHAN_AUTO, "weapon_shotgun.cock");
|
||||
#endif
|
||||
pl.mode_tempstate = SHOTTY_IDLE;
|
||||
pl.w_idle_next = 10.0f;
|
||||
pl.w_attack_next = 0.5f;
|
||||
break;
|
||||
case SHOTTY_IDLE:
|
||||
default:
|
||||
int r = floor(pseudorandom() * 3.0f);
|
||||
switch (r) {
|
||||
case 1:
|
||||
|
@ -326,39 +364,7 @@ w_shotgun_release(player pl)
|
|||
pl.w_idle_next = 2.222222f;
|
||||
break;
|
||||
}
|
||||
} else if (pl.mode_tempstate == SHOTTY_RELOAD_START) {
|
||||
Weapons_ViewAnimation(pl, SHOTGUN_START_RELOAD);
|
||||
pl.mode_tempstate = SHOTTY_RELOAD;
|
||||
pl.w_idle_next = 0.65f;
|
||||
} else if (pl.mode_tempstate == SHOTTY_RELOAD) {
|
||||
Weapons_ViewAnimation(pl, SHOTGUN_RELOAD);
|
||||
pl.shotgun_mag++;
|
||||
pl.ammo_buckshot--;
|
||||
#ifdef SERVER
|
||||
Sound_Play(pl, CHAN_WEAPON, "weapon_shotgun.reload");
|
||||
#endif
|
||||
if (pl.ammo_buckshot <= 0 || pl.shotgun_mag >= 8) {
|
||||
pl.mode_tempstate = SHOTTY_RELOAD_END;
|
||||
}
|
||||
Weapons_UpdateAmmo(pl, pl.shotgun_mag, pl.ammo_buckshot, pl.mode_tempstate);
|
||||
pl.w_idle_next = 0.5f;
|
||||
} else if (pl.mode_tempstate == SHOTTY_RELOAD_END) {
|
||||
Weapons_ViewAnimation(pl, SHOTGUN_PUMP);
|
||||
#ifdef SERVER
|
||||
Sound_Play(pl, CHAN_WEAPON, "weapon_shotgun.cock");
|
||||
#endif
|
||||
pl.mode_tempstate = SHOTTY_IDLE;
|
||||
pl.w_idle_next = 10.0f;
|
||||
pl.w_attack_next = 0.5f;
|
||||
} else if (pl.mode_tempstate == SHOTTY_COCKSOUND) {
|
||||
#ifdef CLIENT
|
||||
|
||||
#else
|
||||
Sound_Play(pl, CHAN_AUTO, "weapon_shotgun.cock");
|
||||
#endif
|
||||
pl.mode_tempstate = SHOTTY_IDLE;
|
||||
pl.w_idle_next = 10.0f;
|
||||
pl.w_attack_next = 0.5f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
After Width: | Height: | Size: 298 KiB |
After Width: | Height: | Size: 421 KiB |
After Width: | Height: | Size: 230 KiB |
After Width: | Height: | Size: 217 KiB |
After Width: | Height: | Size: 250 KiB |
After Width: | Height: | Size: 294 KiB |
After Width: | Height: | Size: 236 KiB |
After Width: | Height: | Size: 337 KiB |
After Width: | Height: | Size: 332 KiB |
After Width: | Height: | Size: 334 KiB |
After Width: | Height: | Size: 209 KiB |