]> icculus.org git repositories - divverent/nexuiz.git/blob - data/qcsrc/server/gamec/cl_impulse.c
add g_navnodeedit
[divverent/nexuiz.git] / data / qcsrc / server / gamec / cl_impulse.c
1 void CopyBody(float keepvelocity);
2
3 // changes by LordHavoc on 03/30/04
4 // cleaned up dummy code
5 // dummies are now removed eventually after being gibbed (norespawn = TRUE)
6 // dummy impulse now checks sv_cheats to prevent players from overwhelming server with dummies
7 // dummies now use player code where possible
8
9 void player_anim (void);
10 void DummyThink(void)
11 {
12         self.think = DummyThink;
13         self.nextthink = time;
14         SV_PlayerPhysics();
15         PlayerPreThink();
16         //player_anim();
17         PlayerPostThink();
18 }
19
20 void ImpulseCommands (void)
21 {
22         if (self.impulse >= 1 && self.impulse <= 9 && !cvar("g_minstagib"))
23                 W_SwitchWeapon (self.impulse);
24         else if (self.impulse == 10 && !cvar("g_minstagib"))
25                 W_NextWeapon ();
26         else if (self.impulse == 12 && !cvar("g_minstagib"))
27                 W_PreviousWeapon ();
28         else if (self.impulse == 13 && cvar("sv_cheats"))
29         {
30                 makevectors (self.v_angle);
31                 self.velocity = self.velocity + v_forward * 300;
32                 CopyBody(1);
33                 self.velocity = self.velocity - v_forward * 300;
34         }
35         else if (self.impulse == 14 && cvar("sv_cheats"))
36                 CopyBody(0);
37         else if (self.impulse == 15 && cvar("sv_cheats"))
38         {
39                 sprint(self, strcat("origin = ", vtos(self.origin), "\n"));
40         }
41         else if (self.impulse == 16 && cvar("sv_cheats"))
42         {
43                 float i;
44                 string s;
45                 i=1;
46                 while(i <= 10)
47                 {
48                         s = ftos(i);
49                         sprint(self, strcat(s, ": ^", s, "color\n"));
50                         i = i + 1;
51                 }
52                 sprint(self, strcat("origin = ", vtos(self.origin), "\n"));
53         }
54         // throw weapon
55         else if (self.impulse == 17 && self.weapon != WEP_LASER 
56                         && !cvar("g_minstagib") && !cvar("g_instagib") 
57                         && !cvar("g_rocketarena") && !cvar("g_lms") && cvar("g_pickup_items"))
58         {
59                 W_ThrowWeapon();
60         }
61         else if(self.impulse == 18)
62         {
63                 PrintWelcomeMessage(self);
64         }
65         else if (self.impulse == 99 && cvar("sv_cheats"))
66         {
67                 self.items = IT_LASER | IT_UZI | IT_SHOTGUN | IT_GRENADE_LAUNCHER | IT_ELECTRO | IT_CRYLINK | IT_NEX | IT_HAGAR | IT_ROCKET_LAUNCHER;
68                 self.ammo_shells = 999;
69                 self.ammo_nails = 999;
70                 self.ammo_rockets = 999;
71                 self.ammo_cells = 999;
72         }
73         //TetrisImpulses();
74         self.impulse = 0;
75 }