Skip to content

Commit

Permalink
Added resources to repository (instagib model and sound, fancy spawnp…
Browse files Browse the repository at this point in the history
…oint model, VWEP models).

Added k_custom_spawn to display the fancy spawnpoint model instead of gold rune key.
Added k_vweapons_models to have player models with actual weapons displayed.
  • Loading branch information
deurk committed Sep 7, 2007
1 parent 4f7f481 commit f7b1e10
Show file tree
Hide file tree
Showing 20 changed files with 615 additions and 138 deletions.
Binary file added resources/progs/player_ax.mdl
Binary file not shown.
Binary file added resources/progs/player_gl.mdl
Binary file not shown.
Binary file added resources/progs/player_lg.mdl
Binary file not shown.
Binary file added resources/progs/player_ng.mdl
Binary file not shown.
Binary file added resources/progs/player_rl.mdl
Binary file not shown.
Binary file added resources/progs/player_sg.mdl
Binary file not shown.
Binary file added resources/progs/player_sn.mdl
Binary file not shown.
Binary file added resources/progs/player_ss.mdl
Binary file not shown.
Binary file added resources/progs/spawn.mdl
Binary file not shown.
Binary file added resources/progs/v_coil.mdl
Binary file not shown.
Binary file added resources/sound/weapons/coilgun.wav
Binary file not shown.
10 changes: 10 additions & 0 deletions src/!changes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
2007-09-06
deurk
271. Added cvar k_custom_spawn to have a n00b friendly arrow for spawn points
if cvar is 1. If cvar is 0, gold rune key used instead.

272. Added client independant VWEP! \o/
cvar is k_weapons_models and models are needed on server but no code
changes is needed for clients. Models have been included in SVN
repository and should be installed in mvdsv/id1/progs directory.

2007-09-01
deurk
270. k_666 in instagib mode is just 1 second instead of 2 in other modes.
Expand Down
74 changes: 68 additions & 6 deletions src/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1254,7 +1254,10 @@ void PutClientInServer()
setmodel( self, "progs/eyes.mdl" );
modelindex_eyes = self->s.v.modelindex;

setmodel( self, "progs/player.mdl" );
if ( cvar("k_vweapons_models") )
setmodel( self, "progs/player_ax.mdl" );
else
setmodel( self, "progs/player.mdl" );
modelindex_player = self->s.v.modelindex;

setsize( self, PASSVEC3( VEC_HULL_MIN ), PASSVEC3( VEC_HULL_MAX ) );
Expand Down Expand Up @@ -2399,13 +2402,25 @@ void PlayerPreThink()
// invoked on death for some reason (couldn't figure out why). This leads to a
// state when the player stands still after dying and can't respawn or even
// suicide and has to reconnect. This is checked and fixed here
if( g_globalvars.time > (self->dead_time + 0.1)
&& ( self->s.v.frame < 41 || self->s.v.frame > 102 ) // FIXME: hardcoded range of dead frames
) {
StartDie();
if ( cvar("k_vweapons_models") )
{
if( g_globalvars.time > (self->dead_time + 0.1)
&& ( self->s.v.frame < 24 || self->s.v.frame > 85 ) // FIXME: hardcoded range of dead frames
) {
StartDie();
}
}

else
{
if( g_globalvars.time > (self->dead_time + 0.1)
&& ( self->s.v.frame < 41 || self->s.v.frame > 102 ) // FIXME: hardcoded range of dead frames
) {
StartDie();
}
}

return; // dying, so do nothing

}

// brokenankle included here
Expand Down Expand Up @@ -2459,6 +2474,52 @@ void PlayerPreThink()
}

/////////////////////////////////////////////////////////////////
/*
================
CheckModel
Check for player model used
================
*/

void CheckModel()
{
char *vwepmodel = "";

switch ( ( int )self->s.v.weapon ) {
case IT_AXE:
vwepmodel = "progs/player_ax.mdl";
break;
case IT_SHOTGUN:
vwepmodel = "progs/player_sg.mdl";
break;
case IT_SUPER_SHOTGUN:
vwepmodel = "progs/player_ss.mdl";
break;
case IT_NAILGUN:
vwepmodel = "progs/player_ng.mdl";
break;
case IT_SUPER_NAILGUN:
vwepmodel = "progs/player_sn.mdl";
break;
case IT_GRENADE_LAUNCHER:
vwepmodel = "progs/player_gl.mdl";
break;
case IT_ROCKET_LAUNCHER:
vwepmodel = "progs/player_rl.mdl";
break;
case IT_LIGHTNING:
vwepmodel = "progs/player_lg.mdl";
break;
default:
vwepmodel = "progs/player_ax.mdl";
}
if ( (self->s.v.modelindex != modelindex_eyes) && cvar("k_vweapons_models") )
setmodel( self, vwepmodel );

}


/*
================
CheckPowerups
Expand Down Expand Up @@ -2784,6 +2845,7 @@ void PlayerPostThink()
self->jump_flag = self->s.v.velocity[2];

CheckPowerups();
CheckModel();
CheckStuffRune();

mv_record();
Expand Down
6 changes: 4 additions & 2 deletions src/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -2751,7 +2751,6 @@ const char common_um_init[] =
"k_spec_info 1\n" // allow spectators receive took info during game
"k_rocketarena 0\n" // rocket arena
"k_midair 0\n" // midair off
"k_sspawn 1\n" // Show spawnpoints
// "localinfo k_new_spw 0\n" // ktpro feature

"fraglimit 0\n" // fraglimit %)
Expand Down Expand Up @@ -5193,7 +5192,10 @@ void mv_cmd_playback ()

self->pb_ent = spawn ();
self->pb_ent->s.v.classname = "pb_ent";
setmodel (self->pb_ent, "progs/player.mdl");
if ( cvar("k_vweapons_models") )
setmodel (self->pb_ent, "progs/player_ax.mdl");
else
setmodel (self->pb_ent, "progs/player.mdl");

self->pb_time = 0;
self->pb_old_time = g_globalvars.time;
Expand Down
5 changes: 4 additions & 1 deletion src/items.c
Original file line number Diff line number Diff line change
Expand Up @@ -1810,7 +1810,10 @@ void ShowSpawnPoints()
p->s.v.flags = FL_ITEM;
p->s.v.solid = SOLID_NOT;
p->s.v.movetype = MOVETYPE_NONE;
setmodel( p, "progs/w_g_key.mdl" );
if ( cvar("k_custom_spawn") )
setmodel( p, "progs/spawn.mdl" );
else
setmodel( p, "progs/w_g_key.mdl" );
p->s.v.netname = "Spawn Point";
p->s.v.classname = "spawnpoint";
p->s.v.effects = ( int ) p->s.v.effects | EF_GREEN | EF_RED;
Expand Down
5 changes: 4 additions & 1 deletion src/match.c
Original file line number Diff line number Diff line change
Expand Up @@ -2060,7 +2060,10 @@ void StopTimer ( int removeDemo )
p->s.v.takedamage = 2;
p->s.v.solid = 3;
p->s.v.movetype = 3;
setmodel (p, "progs/player.mdl");
if ( cvar("k_vweapons_models") )
setmodel (p, "progs/player_ax.mdl");
else
setmodel (p, "progs/player.mdl");
}
}

Expand Down
10 changes: 8 additions & 2 deletions src/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -611,8 +611,14 @@ void viewthing()
{
self->s.v.movetype = MOVETYPE_NONE;
self->s.v.solid = SOLID_NOT;
trap_precache_model( "progs/player.mdl" );
setmodel( self, "progs/player.mdl" );
if ( cvar("k_vweapons_models") )
{
trap_precache_model( "progs/player_ax.mdl" );
setmodel( self, "progs/player_ax.mdl" );
} else {
trap_precache_model( "progs/player.mdl" );
setmodel( self, "progs/player.mdl" );
}
}


Expand Down
Loading

0 comments on commit f7b1e10

Please sign in to comment.