]> icculus.org git repositories - divverent/nexuiz.git/blob - data/qcsrc/server/gamec/cl_impulse.c
- return flag when it's in trigger_hurt
[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         local float imp;
23         imp = self.impulse;
24         if (!imp)
25                 return;
26         self.impulse = 0;
27         if (imp >= 1 && imp <= 12)
28         {
29                 // weapon switching impulses
30                 if (imp <= 9)
31                         W_SwitchWeapon (imp);
32                 else if (imp == 10)
33                         W_NextWeapon ();
34                 else if (imp == 12)
35                         W_PreviousWeapon ();
36                 else if (imp == 11) // last weapon
37                         W_SwitchWeapon (self.cnt);
38         }
39         else if (imp >= 13 && imp <= 16)
40         {
41                 if (cvar("sv_cheats"))
42                 {
43                         if (imp == 13)
44                         {
45                                 makevectors (self.v_angle);
46                                 self.velocity = self.velocity + v_forward * 300;
47                                 CopyBody(1);
48                                 self.velocity = self.velocity - v_forward * 300;
49                         }
50                         else if (imp == 14)
51                                 CopyBody(0);
52                         else if (imp == 15)
53                         {
54                                 sprint(self, strcat("origin = ", vtos(self.origin), "\n"));
55                                 sprint(self, strcat("angles = ", vtos(self.angles), "\n"));
56                         }
57                         else if (imp == 16)
58                         {
59                                 float i;
60                                 string s;
61                                 i=1;
62                                 while(i <= 10)
63                                 {
64                                         s = ftos(i);
65                                         sprint(self, strcat(s, ": ^", s, "color\n"));
66                                         i = i + 1;
67                                 }
68                                 sprint(self, strcat("origin = ", vtos(self.origin), "\n"));
69                         }
70                 }
71         }
72         // throw weapon
73         else if (imp == 17)
74         {
75                 if (self.weapon != WEP_LASER
76                         && !cvar("g_minstagib") && !cvar("g_instagib")
77                         && !cvar("g_rocketarena") && !cvar("g_lms") && cvar("g_pickup_items"))
78                         W_ThrowWeapon();
79         }
80         else if(imp == 18)
81                 PrintWelcomeMessage(self);
82         else if (imp == 99)
83         {
84                 if (cvar("sv_cheats"))
85                 {
86                         self.items = IT_LASER | IT_UZI | IT_SHOTGUN | IT_GRENADE_LAUNCHER | IT_ELECTRO | IT_CRYLINK | IT_NEX | IT_HAGAR | IT_ROCKET_LAUNCHER;
87                         self.ammo_shells = 999;
88                         self.ammo_nails = 999;
89                         self.ammo_rockets = 999;
90                         self.ammo_cells = 999;
91                 }
92         }
93         //TetrisImpulses();
94 }