]> icculus.org git repositories - divverent/nexuiz.git/blob - qcsrc/gamec/cl_client.c
some default.cfg teamplay things
[divverent/nexuiz.git] / qcsrc / gamec / cl_client.c
1 void info_player_start (void)
2 {
3         self.classname = "info_player_deathmatch";
4 }
5
6 void info_player_deathmatch (void)
7 {
8 }
9
10 float spawn_goodspots, spawn_badspots;
11 entity Spawn_ClassifyPoints(entity firstspot, entity playerlist, float mindist, float goodspotnum, float badspotnum)
12 {
13         local entity spot, player;
14         local float pcount;
15         spawn_goodspots = 0;
16         spawn_badspots = 0;
17         spot = firstspot;
18         while (spot)
19         {
20                 pcount = 0;
21                 player = playerlist;
22                 while (player)
23                 {
24                         if (player != self)
25                         if (vlen(player.origin - spot.origin) < 100)
26                                 pcount = pcount + 1;
27                         player = player.chain;
28                 }
29                 if (pcount)
30                 {
31                         if (spawn_goodspots >= badspotnum)
32                                 return spot;
33                         spawn_badspots = spawn_badspots + 1;
34                 }
35                 else
36                 {
37                         if (spawn_goodspots >= goodspotnum)
38                                 return spot;
39                         spawn_goodspots = spawn_goodspots + 1;
40                 }
41                 spot = find(spot, classname, "info_player_deathmatch");
42         }
43         return firstspot;
44 }
45
46 entity Spawn_FurthestPoint(entity firstspot, entity playerlist)
47 {
48         local entity best, spot, player;
49         local float bestrating, rating;
50         best = world;
51         bestrating = -1000000;
52         spot = firstspot;
53         while (spot)
54         {
55                 rating = 1000000000;
56                 player = playerlist;
57                 while (player)
58                 {
59                         if (player != self)
60                                 rating = min(rating, vlen(player.origin - spot.origin));
61                         player = player.chain;
62                 }
63                 rating = rating + random() * 16;
64                 if (bestrating < rating)
65                 {
66                         best = spot;
67                         bestrating = rating;
68                 }
69                 spot = find(spot, classname, "info_player_deathmatch");
70         }
71         return best;
72 }
73
74 /*
75 =============
76 SelectSpawnPoint
77
78 Finds a point to respawn
79 =============
80 */
81 entity SelectSpawnPoint (float anypoint)
82 {
83         local entity spot, firstspot, playerlist;
84         string spotname;
85
86         spot = find (world, classname, "testplayerstart");
87         if (spot)
88                 return spot;
89
90         spotname = "info_player_deathmatch";
91
92         if(!anypoint && cvar("g_ctf") )
93         {
94                 if(self.team == 5)//4)
95                         spotname = "info_player_team1";
96                 if(self.team == 14)//13)
97                         spotname = "info_player_team2";
98                 if(self.team == 4)//3)
99                         spotname = "info_player_team3";
100                 if(self.team == 13)//12)
101                         spotname = "info_player_team4";
102         }
103
104         playerlist = findchain(classname, "player");
105         firstspot = find(world, classname, spotname);
106         Spawn_ClassifyPoints(firstspot, playerlist, 100, 1000000, 1000000);
107         // first check if there are ANY good spots
108         if (spawn_goodspots > 0)
109         {
110                 // good spots exist, there is 50/50 chance of choosing a random good
111                 // spot or the furthest spot
112                 // (this means that roughly every other spawn will be furthest, so you
113                 // usually won't get fragged at spawn twice in a row)
114                 if (random() > 0.5)
115                         spot = Spawn_ClassifyPoints(firstspot, playerlist, 100, min(floor(random() * spawn_goodspots), spawn_goodspots - 1), 1000000);
116                 else
117                         spot = Spawn_FurthestPoint(firstspot, playerlist);
118         }
119         else
120         {
121                 // no good spots exist, pick a random bad spot
122                 spot = Spawn_ClassifyPoints(firstspot, playerlist, 100, 1000000, min(floor(random() * spawn_badspots), spawn_badspots - 1));
123         }
124
125         if (!spot)
126         {
127                 if(anypoint)
128                         error ("PutClientInServer: no start points on level");
129                 else // try again with deathmatch spots
130                         spot = SelectSpawnPoint(TRUE);
131         }
132
133         return spot;
134 }
135
136 /*
137 =============
138 CheckPlayerModel
139
140 Checks if the argument string can be a valid playermodel.
141 Returns a valid one in doubt.
142 =============
143 */
144 string CheckPlayerModel(string plyermodel) {
145         if( substring(plyermodel,0,14) != "models/player/") plyermodel = "models/player/marine.zym";
146
147         /* Possible Fixme: Check if server can open the model?
148            This would kill custom models, however. */
149
150         return plyermodel;
151 }
152
153
154 /*
155 =============
156 PutClientInServer
157
158 Called when a client spawns in the server
159 =============
160 */
161 void PutClientInServer (void)
162 {
163         entity  spot;
164
165         spot = SelectSpawnPoint (FALSE);
166         
167         RemoveGrapplingHook(self); // Wazat's Grappling Hook
168         
169         self.classname = "player";
170         self.iscreature = TRUE;
171         self.movetype = MOVETYPE_WALK;
172         self.solid = SOLID_SLIDEBOX;
173         self.flags = FL_CLIENT;
174         self.takedamage = DAMAGE_AIM;
175         self.effects = 0;
176         self.health = cvar("g_balance_health_start");
177         self.armorvalue = cvar("g_balance_armor_start");
178         self.pauserotarmor_finished = time + 10;
179         self.pauserothealth_finished = time + 10;
180         self.pauseregen_finished = 0;
181         self.damageforcescale = 2;
182         self.death_time = 0;
183         self.dead_time = 0;
184         self.dead_frame = 0;
185         self.die_frame = 0;
186         self.alpha = 0;
187         self.scale = 0;
188         self.fade_time = 0;
189         self.pain_frame = 0;
190         self.pain_finished = 0;
191         self.strength_finished = 0;
192         self.invincible_finished = 0;
193         self.pushltime = 0;
194         //self.speed_finished = 0;
195         //self.slowmo_finished = 0;
196         // players have no think function
197         self.think = SUB_Null;
198         self.nextthink = 0;
199
200         self.hook_time = 0;
201
202         self.runes = 0;
203
204         self.deadflag = DEAD_NO;
205
206         self.angles = spot.angles;
207
208         self.angles_z = 0; // never spawn tilted even if the spot says to
209         self.fixangle = TRUE; // turn this way immediately
210         self.velocity = '0 0 0';
211         self.avelocity = '0 0 0';
212         self.punchangle = '0 0 0';
213         self.punchvector = '0 0 0';
214         self.oldvelocity = self.velocity;
215
216         self.viewzoom = 0.6;
217
218
219         self.playermodel = CheckPlayerModel(self.playermodel);
220
221         precache_model (self.playermodel);
222         setmodel (self, self.playermodel);
223         self.skin = stof(self.playerskin);
224         self.crouch = FALSE;
225         self.view_ofs = PL_VIEW_OFS;
226         setsize (self, PL_MIN, PL_MAX);
227         setorigin (self, spot.origin + '0 0 1' * (1 - self.mins_z - 24));
228         // don't reset back to last position, even if new position is stuck in solid
229         self.oldorigin = self.origin;
230
231 //      self.items = IT_LASER | IT_UZI| IT_SHOTGUN | IT_GRENADE_LAUNCHER | IT_ELECTRO | IT_CRYLINK | IT_NEX | IT_HAGAR | IT_ROCKET_LAUNCHER;
232 //      self.weapon = IT_UZI;
233
234         if (cvar("g_instagib") == 1)
235         {
236                 self.items = IT_NEX;
237                 self.switchweapon = WEP_NEX;
238                 self.ammo_shells = 0;
239                 self.ammo_nails = 0;
240                 self.ammo_rockets = 0;
241                 self.ammo_cells = 999;
242         }
243         else if (cvar("g_rocketarena") == 1)
244         {
245                 self.items = IT_ROCKET_LAUNCHER;
246                 self.switchweapon = WEP_ROCKET_LAUNCHER;
247                 self.ammo_shells = 0;
248                 self.ammo_nails = 0;
249                 self.ammo_rockets = 999;
250                 self.ammo_cells = 0;
251         }
252         else
253         {
254                 self.items = IT_LASER | IT_SHOTGUN;
255                 self.switchweapon = WEP_SHOTGUN;
256                 self.ammo_shells = 50;
257                 self.ammo_nails = 0;
258                 self.ammo_rockets = 0;
259                 self.ammo_cells = 0;
260         }
261
262         self.event_damage = PlayerDamage;
263
264         self.statdraintime = time + 5;
265         self.button0 = self.button1 = self.button2 = self.button3 = 0;
266
267         /*
268         W_UpdateWeapon();
269         W_UpdateAmmo();
270         */
271         CL_SpawnWeaponentity();
272
273         //stuffcmd(self, "chase_active 0");
274 }
275
276 /*
277 =============
278 SetNewParms
279 =============
280 */
281 void SetNewParms (void)
282 {
283
284 }
285
286 /*
287 =============
288 SetChangeParms
289 =============
290 */
291 void SetChangeParms (void)
292 {
293
294 }
295
296 /*
297 =============
298 ClientKill
299
300 Called when a client types 'kill' in the console
301 =============
302 */
303 void ClientKill (void)
304 {
305         Damage(self, self, self, 100000, DEATH_KILL, self.origin, '0 0 0');
306 }
307
308 /*
309 =============
310 ClientConnect
311
312 Called when a client connects to the server
313 =============
314 */
315 string ColoredTeamName(float t);
316 //void dom_player_join_team(entity pl);
317 void ClientConnect (void)
318 {
319         self.classname = "player_joining";
320
321         //if(cvar("g_domination"))
322         //      dom_player_join_team(self);
323
324         JoinBestTeam(self, FALSE);
325
326         self.classname = "player";
327
328
329
330         bprint ("^4",self.netname);
331         bprint (" connected");
332
333         if(cvar("g_domination") || cvar("g_ctf"))
334         {
335                 bprint(" and joined the ");
336                 bprint(ColoredTeamName(self.team));
337         }
338
339         bprint("\n");
340
341         self.welcomemessage_time = time + cvar("welcome_message_time");
342         self.welcomemessage_time2 = 0;
343
344
345         stuffcmd(self, strcat("exec maps/", mapname, ".cfg\n"));
346         // send prediction settings to the client
347         stuffcmd(self, strcat("cl_movement_maxspeed ", ftos(cvar("sv_maxspeed")), "\n"));
348         stuffcmd(self, strcat("cl_movement_maxairspeed ", ftos(cvar("sv_maxairspeed")), "\n"));
349         stuffcmd(self, strcat("cl_movement_accelerate ", ftos(cvar("sv_accelerate")), "\n"));
350         stuffcmd(self, strcat("cl_movement_friction ", ftos(cvar("sv_friction")), "\n"));
351         stuffcmd(self, strcat("cl_movement_stopspeed ", ftos(cvar("sv_stopspeed")), "\n"));
352         stuffcmd(self, strcat("cl_movement_jumpvelocity ", ftos(cvar("g_balance_jumpheight")), "\n"));
353         stuffcmd(self, strcat("cl_movement_stepheight ", ftos(cvar("sv_stepheight")), "\n"));
354         stuffcmd(self, strcat("cl_movement_edgefriction 0\n"));
355         
356         // Wazat's grappling hook
357         SetGrappleHookBindings();       
358 }
359
360 /*
361 =============
362 ClientDisconnect
363
364 Called when a client disconnects from the server
365 =============
366 */
367 .entity chatbubbleentity;
368 void ClientDisconnect (void)
369 {
370         bprint ("^4",self.netname);
371         bprint (" disconnected\n");
372
373         if (self.chatbubbleentity)
374         {
375                 remove (self.chatbubbleentity);
376                 self.chatbubbleentity = world;
377         }
378         DropAllRunes(self);
379 }
380
381 .float buttonchat;
382 void() ChatBubbleThink =
383 {
384         self.nextthink = time;
385         if (!self.owner.modelindex || self.owner.chatbubbleentity != self)
386         {
387                 remove(self);
388                 return;
389         }
390         setorigin(self, self.owner.origin + '0 0 15' + self.owner.maxs_z * '0 0 1');
391         if (self.owner.buttonchat && !self.owner.deadflag)
392                 self.model = self.mdl;
393         else
394                 self.model = "";
395 };
396
397 void() UpdateChatBubble =
398 {
399         if (!self.modelindex)
400                 return;
401         // spawn a chatbubble entity if needed
402         if (!self.chatbubbleentity)
403         {
404                 self.chatbubbleentity = spawn();
405                 self.chatbubbleentity.owner = self;
406                 self.chatbubbleentity.exteriormodeltoclient = self;
407                 self.chatbubbleentity.think = ChatBubbleThink;
408                 self.chatbubbleentity.nextthink = time;
409                 setmodel(self.chatbubbleentity, "models/misc/chatbubble.spr");
410                 setorigin(self.chatbubbleentity, self.origin + '0 0 15' + self.maxs_z * '0 0 1');
411                 self.chatbubbleentity.mdl = self.chatbubbleentity.model;
412                 self.chatbubbleentity.model = "";
413         }
414 }
415
416 // LordHavoc: this hack will be removed when proper _pants/_shirt layers are
417 // added to the model skins
418 void() UpdateColorModHack =
419 {
420         local float c;
421         c = self.clientcolors & 15;
422         // LordHavoc: only bothering to support white, green, red, yellow, blue
423              if (teamplay == 0) self.colormod = '0 0 0';
424         else if (c ==  0) self.colormod = '1.00 1.00 1.00';
425         else if (c ==  3) self.colormod = '0.10 1.73 0.10';
426         else if (c ==  4) self.colormod = '1.73 0.10 0.10';
427         else if (c == 12) self.colormod = '1.22 1.22 0.10';
428         else if (c == 13) self.colormod = '0.10 0.10 1.73';
429         else self.colormod = '1 1 1';
430 };
431
432 /*
433 =============
434 PlayerJump
435
436 When you press the jump key
437 =============
438 */
439 void PlayerJump (void)
440 {
441         float mjumpheight;
442
443         mjumpheight = cvar("g_balance_jumpheight");
444         if (self.waterlevel >= 2)
445         {
446                 if (self.watertype == CONTENT_WATER)
447                         self.velocity_z = 200;
448                 else if (self.watertype == CONTENT_SLIME)
449                         self.velocity_z = 80;
450                 else
451                         self.velocity_z = 50;
452
453                 return;
454         }
455
456
457         if (!(self.flags & FL_ONGROUND))
458                 return;
459
460         if (!(self.flags & FL_JUMPRELEASED))
461                 return;
462
463         if(cvar("g_runematch"))
464         {
465                 if(self.runes & RUNE_SPEED)
466                 {
467                         if(self.runes & CURSE_SLOW)
468                                 mjumpheight = mjumpheight * cvar("g_balance_rune_speed_combo_jumpheight");
469                         else
470                                 mjumpheight = mjumpheight * cvar("g_balance_rune_speed_jumpheight");
471                 }
472                 else if(self.runes & CURSE_SLOW)
473                 {
474                         mjumpheight = mjumpheight * cvar("g_balance_curse_slow_jumpheight");
475                 }
476         }
477
478         self.velocity_z = self.velocity_z + mjumpheight;
479         self.oldvelocity_z = self.velocity_z;
480
481         self.flags = self.flags - FL_ONGROUND;
482         self.flags = self.flags - FL_JUMPRELEASED;
483 }
484
485 void() CheckWaterJump =
486 {
487         local vector start, end;
488
489 // check for a jump-out-of-water
490         makevectors (self.angles);
491         start = self.origin;
492         start_z = start_z + 8;
493         v_forward_z = 0;
494         normalize(v_forward);
495         end = start + v_forward*24;
496         traceline (start, end, TRUE, self);
497         if (trace_fraction < 1)
498         {       // solid at waist
499                 start_z = start_z + self.maxs_z - 8;
500                 end = start + v_forward*24;
501                 self.movedir = trace_plane_normal * -50;
502                 traceline (start, end, TRUE, self);
503                 if (trace_fraction == 1)
504                 {       // open at eye level
505                         self.flags = self.flags | FL_WATERJUMP;
506                         self.velocity_z = 225;
507                         self.flags = self.flags - (self.flags & FL_JUMPRELEASED);
508                         self.teleport_time = time + 2;  // safety net
509                         return;
510                 }
511         }
512 };
513
514
515 void respawn(void)
516 {
517         CopyBody(1);
518         PutClientInServer();
519 }
520
521 void player_powerups (void)
522 {
523         self.effects = self.effects - (self.effects & (EF_RED | EF_BLUE | EF_ADDITIVE | EF_FULLBRIGHT));
524         if (self.items & IT_STRENGTH)
525         {
526                 self.effects = self.effects | (EF_BLUE | EF_ADDITIVE | EF_FULLBRIGHT);
527                 if (time > self.strength_finished)
528                 {
529                         self.items = self.items - (self.items & IT_STRENGTH);
530                         sprint(self, "^3Strength has worn off\n");
531                 }
532         }
533         else
534         {
535                 if (time < self.strength_finished)
536                 {
537                         self.items = self.items | IT_STRENGTH;
538                         sprint(self, "^3Strength infuses your weapons with devestating power\n");
539                 }
540         }
541         if (self.items & IT_INVINCIBLE)
542         {
543                 self.effects = self.effects | (EF_RED | EF_ADDITIVE | EF_FULLBRIGHT);
544                 if (time > self.invincible_finished)
545                 {
546                         self.items = self.items - (self.items & IT_INVINCIBLE);
547                         sprint(self, "^3Shield has worn off\n");
548                 }
549         }
550         else
551         {
552                 if (time < self.invincible_finished)
553                 {
554                         self.items = self.items | IT_INVINCIBLE;
555                         sprint(self, "^3Shield surrounds you\n");
556                 }
557         }
558         
559         if (cvar("g_fullbrightplayers"))
560                 self.effects = EF_FULLBRIGHT;
561         
562 }
563
564 void player_regen (void)
565 {
566         float maxh, maxa, max_mod, regen_mod, rot_mod;
567         maxh = cvar("g_balance_health_stable");
568         maxa = cvar("g_balance_armor_stable");
569
570         if(cvar("g_runematch"))
571         {
572                 max_mod = regen_mod = rot_mod = 1;
573                 if (self.runes & RUNE_REGEN)
574                 {
575                         if (self.runes & CURSE_VENOM) // do we have both rune/curse?
576                         {
577                                 regen_mod = cvar("g_balance_rune_regen_combo_regenrate");
578                                 max_mod = cvar("g_balance_rune_regen_combo_hpmod");
579                         }
580                         else
581                         {
582                                 regen_mod = cvar("g_balance_rune_regen_regenrate");
583                                 max_mod = cvar("g_balance_rune_regen_hpmod");
584                         }
585                 }
586                 else if (self.runes & CURSE_VENOM)
587                 {
588                         max_mod = cvar("g_balance_curse_venom_hpmod");
589                         if (self.runes & RUNE_REGEN) // do we have both rune/curse?
590                                 rot_mod = cvar("g_balance_rune_regen_combo_rotrate");
591                         else
592                                 rot_mod = cvar("g_balance_curse_venom_rotrate");
593                         //if (!self.runes & RUNE_REGEN)
594                         //      rot_mod = cvar("g_balance_curse_venom_rotrate");
595                 }
596                 maxh = maxh * max_mod;
597                 //maxa = maxa * max_mod;
598
599                 if (time > self.pauserotarmor_finished)
600                 {
601                         if (self.armorvalue > maxa)
602                                 self.armorvalue = bound(0, self.armorvalue + (maxa - self.armorvalue) * cvar("g_balance_armor_rot") * frametime, 1000);
603                 }
604                 if (time > self.pauserothealth_finished)
605                 {
606                         if (self.health > maxh)
607                                 self.health = bound(0, self.health + (maxh - self.health) * rot_mod*cvar("g_balance_health_rot") * frametime, 1000);
608                 }
609                 if (time > self.pauseregen_finished)
610                 {
611                         if (self.health < maxh)
612                                 self.health = bound(0, self.health + (maxh- self.health) * regen_mod*cvar("g_balance_health_regen") * frametime, 1000);
613                         if (self.armorvalue < maxa)
614                                 self.armorvalue = bound(0, self.armorvalue + (maxa - self.armorvalue) * cvar("g_balance_armor_regen") * frametime, 1000);
615                 }
616         }
617         else
618         {
619                 if (time > self.pauserothealth_finished)
620                 if (self.health > maxh)
621                         self.health = bound(0, self.health + (maxh - self.health) * cvar("g_balance_health_rot") * frametime, 1000);
622                 if (time > self.pauserotarmor_finished)
623                 if (self.armorvalue > maxa)
624                         self.armorvalue = bound(0, self.armorvalue + (maxa - self.armorvalue) * cvar("g_balance_armor_rot") * frametime, 1000);
625                 if (time > self.pauseregen_finished)
626                 {
627                         if (self.health < maxh)
628                                 self.health = bound(0, self.health + (maxh- self.health) * cvar("g_balance_health_regen") * frametime, 1000);
629                         if (self.armorvalue < maxa)
630                                 self.armorvalue = bound(0, self.armorvalue + (maxa - self.armorvalue) * cvar("g_balance_armor_regen") * frametime, 1000);
631                 }
632         }
633 }
634
635 /*
636 =============
637 PlayerPreThink
638
639 Called every frame for each client before the physics are run
640 =============
641 */
642 void PlayerPreThink (void)
643 {
644         local vector m1, m2;
645
646 //      MauveBot_AI();
647
648 //      if(self.netname == "Wazat")
649 //              bprint(strcat(self.classname, "\n"));
650
651         CheckRules_Player();
652
653         if (intermission_running)
654         {
655                 IntermissionThink ();   // otherwise a button could be missed between
656                 return;                                 // the think tics
657         }
658
659         if (self.deadflag != DEAD_NO)
660         {
661                 player_anim();
662                 weapon_freeze();
663                 if (self.deadflag == DEAD_DYING)
664                 {
665                         if (time > self.dead_time)
666                                 self.deadflag = DEAD_DEAD;
667                 }
668                 else if (self.deadflag == DEAD_DEAD)
669                 {
670                         if (!self.button0 && !self.button2 && !self.button3)
671                                 self.deadflag = DEAD_RESPAWNABLE;
672                 }
673                 else if (self.deadflag == DEAD_RESPAWNABLE)
674                 {
675                         if (self.button0 || self.button2 || self.button3  || self.button4)
676                                 respawn();
677                 }
678                 return;
679         }
680
681         if (self.button5)
682         {
683                 if (!self.crouch)
684                 {
685                         self.crouch = TRUE;
686                         self.view_ofs = PL_CROUCH_VIEW_OFS;
687                         setsize (self, PL_CROUCH_MIN, PL_CROUCH_MAX);
688                 }
689         }
690         else
691         {
692                 if (self.crouch)
693                 {
694                         tracebox(self.origin, PL_MIN, PL_MAX, self.origin, FALSE, self);
695                         if (!trace_startsolid)
696                         {
697                                 self.crouch = FALSE;
698                                 self.view_ofs = PL_VIEW_OFS;
699                                 setsize (self, PL_MIN, PL_MAX);
700                         }
701                 }
702         }
703
704         if (self.playermodel != self.model)
705         {
706                 self.playermodel = CheckPlayerModel(self.playermodel);
707                 m1 = self.mins;
708                 m2 = self.maxs;
709                 precache_model (self.playermodel);
710                 setmodel (self, self.playermodel);
711                 setsize (self, m1, m2);
712         }
713
714         // Savage: Check for nameless players
715         if (strlen(self.netname) < 1) {
716                 self.netname = "Player";
717                 stuffcmd(self, "name Player\n");
718         }
719
720         if (self.skin != stof(self.playerskin))
721                 self.skin = stof(self.playerskin);
722
723         W_WeaponFrame();
724
725         if (self.button4 || (self.weapon == WEP_NEX && self.button3))
726         {
727                 if (self.viewzoom > 0.4)
728                         self.viewzoom = max (0.4, self.viewzoom - frametime * 2);
729         }
730         else if (self.viewzoom < 1.0)
731                 self.viewzoom = min (1.0, self.viewzoom + frametime);
732
733
734         if (self.button2)
735                 PlayerJump ();
736         else
737                 self.flags = self.flags | FL_JUMPRELEASED;
738
739
740         player_powerups();
741         player_regen();
742         player_anim();
743
744         //self.angles_y=self.v_angle_y + 90;   // temp
745
746         if (self.waterlevel == 2)
747                 CheckWaterJump ();
748
749         //if (TetrisPreFrame()) return;
750 }
751
752 /*
753 =============
754 PlayerPostThink
755
756 Called every frame for each client after the physics are run
757 =============
758 */
759 void PlayerPostThink (void)
760 {
761         CheckRules_Player();
762         UpdateChatBubble();
763         UpdateColorModHack();
764         if (self.deadflag == DEAD_NO)
765         if (self.impulse)
766                 ImpulseCommands ();
767         if (intermission_running)
768                 return;         // intermission or finale
769
770         PrintWelcomeMessage(self);
771         //if (TetrisPostFrame()) return;
772 }