w_chainsaw: move towards the victim you're cutting with that thing. Ala scihunt

This commit is contained in:
Marco Cawthorne 2019-03-06 20:23:31 +01:00
parent 2df5e2884e
commit 5b58351619
5 changed files with 35 additions and 27 deletions

View file

@ -121,12 +121,7 @@ void Game_PutClientInServer(void)
pl.angles = spot.angles;
pl.fixangle = TRUE;
pl.ammo_9mm = 68;
pl.ammo_buckshot = 34;
Weapons_AddItem(pl, WEAPON_CROWBAR);
Weapons_AddItem(pl, WEAPON_GLOCK);
Weapons_AddItem(pl, WEAPON_CANNON);
Weapons_AddItem(pl, WEAPON_CHAINSAW);
SHData_GetItems();
}
}

View file

@ -37,26 +37,6 @@ void Game_Input(void)
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);
Weapons_AddItem(pl, WEAPON_CANNON);
Weapons_AddItem(pl, WEAPON_CHAINSAW);
Weapons_AddItem(pl, WEAPON_HAMMER);
Weapons_AddItem(pl, AMMO_BUCKSHOT);
}
if (self.impulse == 102) {
// Respawn all the entities

View file

@ -6,6 +6,8 @@
*
****/
string g_shItemList;
void SHData_New(void)
{
entity new = spawn();
@ -51,6 +53,32 @@ void SHData_NewAngles(void)
self = oldself;
}
void SHData_GetItems(void)
{
player pl = (player)self;
/* TODO: Parse the config files */
pl.ammo_9mm = 68;
pl.ammo_buckshot = 34;
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);
Weapons_AddItem(pl, WEAPON_CANNON);
Weapons_AddItem(pl, WEAPON_CHAINSAW);
Weapons_AddItem(pl, WEAPON_HAMMER);
}
void SHData_Parse(string map)
{
int c;

View file

@ -84,6 +84,11 @@ void w_chainsaw_primary(void)
Effect_Impact(IMPACT_MELEE, trace_endpos, trace_plane_normal);
if (trace_ent.takedamage) {
if (trace_ent.iBleeds) {
/* Push the player towards the victim */
pl.velocity = normalize(trace_ent.origin - pl.origin) * 240;
}
Damage_Apply(trace_ent, self, 10, trace_endpos, FALSE );
Weapons_PlaySound(pl, CHAN_WEAPON, "sh/chainsaw_cutintoflesh.wav", 1, ATTN_NORM);
} else {

BIN
scihunt/csprogs.dat Normal file

Binary file not shown.