Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void () player_pain;
- void () player_stand1;
- float pregameover;
- void () CheckDimLight =
- {
- local float flag;
- flag = 0;
- if ((self.invincible_finished > time))
- {
- flag = 1;
- }
- if ((self.super_damage_finished > time))
- {
- flag = 2;
- }
- if ((flag == 1))
- {
- self.effects = (self.effects | EF_DIMLIGHT);
- }
- if ((flag == 2))
- {
- self.effects = (self.effects | EF_MUZZLEFLASH);
- }
- if (!flag)
- {
- self.effects = ((self.effects - (self.effects & DO_VOID)) - (self.effects & 2));
- }
- };
- void () info_intermission =
- {
- INTERMISSIONS = INTERMISSIONS + 1;
- };
- void () SetChangeParms =
- {
- bprint ("setchgparms \n");
- parm15 = self.accesslvl;
- parm14 = self.observer;
- parm13 = self.best_wep;
- if ((self.health <= 0))
- {
- SetNewParms ();
- parm10 = self.lastteam;
- parm11 = self.motd_count;
- parm14 = self.observer;
- parm13 = self.best_wep;
- parm12 = self.sex;
- parm16 = self.player_flag;
- return;
- }
- self.items = (self.items - (((((IT_KEY1 | IT_KEY2) | IT_INVISIBILITY) | IT_INVULNERABILITY) | IT_SUIT) | IT_QUAD));
- if ((self.health > 100))
- {
- self.health = 100;
- }
- if ((self.health < 50))
- {
- self.health = 50;
- }
- parm14 = self.observer;
- parm11 = self.motd_count;
- parm12 = self.sex;
- parm13 = self.best_wep;
- SetNewParms ();
- if (((deathmatch & DM_START_SMALL) || (deathmatch & DM_START_BIG)))
- {
- SetNewParms ();
- }
- if ((gamestart || self.observer))
- {
- parm10 = -1;
- }
- else
- {
- parm10 = self.lastteam;
- }
- if (clienttype(self) == CLIENTTYPE_REAL)
- parm15 = self.accesslvl;
- parm16 = self.player_flag;
- Dump_parms ();
- };
- void () SetNewParms =
- {
- bprint ("pre-setnewparms \n");
- Dump_parms ();
- if ((gamestart && !pregameover))
- {
- parm1 = (IT_SHOTGUN | IT_AXE);
- parm2 = 100;
- parm4 = 15;
- parm8 = IT_AXE;
- parm10 = 1;
- }
- else
- {
- parm1 = (IT_SHOTGUN | IT_AXE); // | IT_HOOK
- parm2 = 100;
- parm3 = 50;
- parm1 = (parm1 + IT_ARMOR1);
- parm4 = 40;
- parm8 = IT_SHOTGUN;
- parm10 = -1;
- }
- parm5 = 0;
- parm6 = 0;
- parm7 = 0;
- if ((deathmatch & DM_START_SMALL))
- {
- parm1 = (((IT_HOOK | IT_SUPER_SHOTGUN) | IT_NAILGUN) | IT_ARMOR1);
- parm2 = 100;
- parm3 = 100;
- parm4 = 69;
- parm5 = 40;
- parm6 = 0;
- parm7 = 0;
- parm8 = IT_NAILGUN;
- }
- if ((deathmatch & DM_START_BIG))
- {
- parm1 = ((((IT_HOOK | IT_SUPER_SHOTGUN) | IT_SUPER_NAILGUN) | IT_ROCKET_LAUNCHER) | IT_ARMOR1);
- parm2 = 100;
- parm3 = 100;
- parm4 = 69;
- parm5 = 60;
- parm6 = 5;
- parm7 = 0;
- parm8 = IT_SUPER_NAILGUN;
- }
- if ((deathmatch & DM_INFINITE_AMMO))
- {
- parm4 = 69;
- parm5 = 69;
- parm6 = 69;
- parm7 = 69;
- }
- parm11 = self.motd_count;
- parm12 = self.sex;
- parm13 = self.best_wep;
- if (self.classname == "player")
- {
- parm9 = self.statstate; // status bar size
- parm14 = self.observer;
- parm15 = self.accesslvl;
- }
- //if (clienttype(self) == CLIENTTYPE_BOT)
- //set_player_main_index ();
- parm16 = 0;
- bprint ("post-setnewparms \n");
- Dump_parms ();
- };
- void () DecodeLevelParms =
- {
- if (clienttype(self) == CLIENTTYPE_BOT)
- {
- parm14 = self.games;
- parm15 = self.playtime;
- ReParseBotTalkname ();
- dprint ("Talkname is: ");
- dprint (self.talkname);
- dprint ("\n");
- }
- else
- {
- self.statstate = parm9; // status bar size
- self.player_flag = (self.player_flag | parm16);
- self.player_flag = (self.player_flag - (self.player_flag & ITEM_RUNE_MASK));
- self.player_flag = (self.player_flag - (self.player_flag & ITEM_ENEMY_FLAG));
- self.skin = ((self.player_flag & 65280) / DM_INFINITE_AMMO);
- self.accesslvl = parm15;
- self.observer = parm14;
- }
- self.sex = parm12;
- if (((parm13 > 0) && (parm13 < DO_VOID)))
- {
- self.best_wep = parm13;
- }
- else
- {
- self.best_wep = 1;
- }
- if ((parm11 != 0))
- {
- self.motd_count = parm11;
- }
- else
- {
- self.motd_count = 1;
- }
- SetNewParms ();
- self.items = parm1;
- self.health = parm2;
- self.armorvalue = parm3;
- self.ammo_shells = parm4;
- self.ammo_nails = parm5;
- self.ammo_rockets = parm6;
- self.ammo_cells = parm7;
- self.weapon = parm8;
- self.last_returned_flag = -10;
- self.last_fragged_carrier = -10;
- self.flag_since = -10;
- self.last_hurt_carrier = -10;
- if (TeamColorIsLegal (parm10))
- {
- self.lastteam = parm10;
- }
- // free up parm9
- if (self.items & IT_ARMOR1)
- self.armortype = 0.3;
- else if (self.items & IT_ARMOR2)
- self.armortype = 0.6;
- else if (self.items & IT_ARMOR3)
- self.armortype = 0.8;
- else
- self.armortype = 0;
- bprint ("decodelevelparms\n");
- Dump_parms ();
- };
- entity () FindIntermission =
- {
- local entity spot;
- local float cyc;
- spot = find (world, classname, "info_intermission");
- if (spot)
- {
- cyc = (random () * 4);
- while ((cyc > 1))
- {
- spot = find (spot, classname, "info_intermission");
- if (!spot)
- {
- spot = find (spot, classname, "info_intermission");
- }
- cyc = (cyc - 1);
- }
- return (spot);
- }
- spot = find (world, classname, "info_player_start");
- if (spot)
- {
- return (spot);
- }
- spot = find (world, classname, "testplayerstart");
- if (spot)
- {
- return (spot);
- }
- else
- {
- objerror ("Client.qc: No View Spot For Intermission");
- }
- return (world);
- };
- void () GotoNextMap =
- {
- if ((cvar ("samelevel") == 1))
- {
- changelevel (mapname);
- }
- else
- {
- if (FindNextCTFBotMap ())
- {
- changelevel (nextmap);
- }
- else
- {
- if (((nextmap == "start") && (teamplay & TEAM_CAPTURE_CUSTOM)))
- {
- nextmap = "ctfstart";
- }
- else
- {
- if ((nextmap == "ctf9"))
- {
- nextmap = "ctf2m1";
- }
- else
- {
- if (((nextmap == "end") && (mapname == "start")))
- {
- nextmap = "dm1";
- }
- else
- {
- if (((nextmap == "rand") && (mapname == "start")))
- {
- localcmd ("samelevel -1\n");
- nextmap = "e1m1";
- }
- }
- }
- }
- }
- changelevel (nextmap);
- }
- };
- void () ExitIntermission =
- {
- if ((self.health < 1))
- stuffcmd (self, "v_cshift \n");
- WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
- WriteByte (MSG_BROADCAST, TE_TELEPORT);
- WriteCoord (MSG_BROADCAST, self.origin_x);
- WriteCoord (MSG_BROADCAST, self.origin_y);
- WriteCoord (MSG_BROADCAST, self.origin_z);
- if (deathmatch)
- {
- GotoNextMap ();
- return;
- }
- intermission_exittime = (time + 1);
- intermission_running = (intermission_running + 1);
- GotoNextMap ();
- };
- void () IntermissionThink =
- {
- if ((time < intermission_exittime))
- return;
- if (((!self.button0 && !self.button1) && !self.button2))
- return;
- ExitIntermission ();
- };
- void () execute_changelevel =
- {
- local entity pos;
- local float cd;
- cd = ((random () * 3)) + 97;
- intermission_running = 1;
- intermission_exittime = (time + 15);
- pos = FindIntermission ();
- other = find (world, classname, "player");
- while ((other != world))
- {
- other.view_ofs = VEC_ORIGIN;
- other.v_angle = pos.mangle;
- other.angles = pos.mangle;
- other.fixangle = TRUE;
- other.nextthink = (time + 0.5);
- other.takedamage = DAMAGE_NO;
- other.solid = SOLID_NOT;
- other.movetype = MOVETYPE_NONE;
- other.modelindex = 0;
- setorigin (other, pos.origin);
- other = find (other, classname, "player");
- }
- WriteByte (MSG_ALL, SVC_CDTRACK);
- WriteByte (MSG_ALL, cd);
- WriteByte (MSG_ALL, cd);
- if (random () > 0.5 && (pointcontents (self.origin) == -1))
- lightstyle(0, "abcdefghijklmlkjihgfedcb");
- //pointsound (pos.origin, "test.wav", 1, 0);
- WriteByte (MSG_ALL, 30);
- };
- void () changelevel_touch =
- {
- local entity pos;
- local float noexit;
- if ((other.classname != "player"))
- {
- return;
- }
- noexit = cvar ("noexit");
- if (((noexit == 1) || ((noexit == 2) && !gamestart)))
- {
- return;
- }
- if ((cvar ("temp1") < 65535))
- {
- bprint (other.netname);
- bprint (" exited the level\n");
- }
- nextmap = self.map;
- SUB_UseTargets ();
- if (((self.spawnflags & 1) && (deathmatch == 0)))
- {
- GotoNextMap ();
- return;
- }
- self.touch = SUB_Null;
- self.think = execute_changelevel;
- self.nextthink = (time + 0.1);
- };
- void () trigger_changelevel =
- {
- if ((gamestart && !(teamplay & TEAM_CAPTURE_CUSTOM)))
- {
- if ((self.map == "e1m1"))
- {
- self.message = "E1 Dimension of the Doomed";
- }
- else
- {
- if ((self.map == "e2m1"))
- {
- self.message = "E2 The Realm of Black Magic";
- }
- else
- {
- if ((self.map == "e3m1"))
- {
- self.message = "E3 The Netherworld";
- }
- else
- {
- if ((self.map == "e4m1"))
- {
- self.message = "E4 The Elder World";
- }
- else
- {
- if ((self.map == "end"))
- {
- self.message = "The Deathmatch Arenas";
- }
- else
- {
- if ((self.map == "rand"))
- {
- self.message = "TEKBOT_CTF+ Best ID Levels";
- }
- else
- {
- self.message = "Unknown";
- }
- }
- }
- }
- }
- }
- self.classname = "trigger_voteexit";
- trigger_voteexit ();
- return;
- }
- if (!self.map)
- {
- objerror ("changelevel trigger doesn't have map");
- }
- InitTrigger ();
- self.touch = changelevel_touch;
- };
- void () set_suicide_frame;
- void () respawn =
- {
- SetNewParms ();
- PutClientInServer ();
- self.sFloating = string_null;
- stuffcmd (self, "v_cshift \n");
- };
- void () ClientKill =
- {
- if ((self.observer || intermission_running)) return;
- if ((self.suicide_count > 3))
- {
- sprint (self, "You have suicided too much already.\n");
- return;
- }
- if (((self.sex == 2) && (temp1 & TEMP1_PLAYER2SOUNDS)))
- sound (self, CHAN_BODY, "player_f/death3.wav", 1, ATTN_IDLE);
- else
- sound (self, CHAN_BODY, "enforcer/death1.wav", 1, ATTN_IDLE);
- bprint (self.netname);
- bprint (" suicides\n");
- self.skin = self.skin + 1;
- DropRune ();
- TeamCaptureDropFlagOfPlayer (self);
- self.teleport_time = time + 1.5;
- set_suicide_frame ();
- set_player_main_index ();
- UpdateClientFrags (self, CONTENT_SOLID);
- self.suicide_count = (self.suicide_count + 1);
- self.num_suicides = (self.num_suicides + 1);
- respawn ();
- };
- void () SilentKill =
- {
- set_suicide_frame ();
- set_player_main_index ();
- respawn ();
- };
- entity () SelectSpawnPoint =
- {
- local entity ssp;
- ssp= lastspawn;
- return (ssp);
- };
- void () PlayerDie;
- void () PutClientInServer =
- {
- local entity spot;
- local string type;
- self.fChasing = 0;
- bprint ("team ");
- bprint (ftos(self.team));
- if (clienttype(self) == CLIENTTYPE_REAL)
- {
- if (gamestart )
- {
- if (!(deathmatch & DM_SPAWN_RANDOM))
- spot = TeamCaptureSpawn();
- if ((deathmatch & DM_SPAWN_RANDOM))
- spot = MultiSelectSpawnPoint ();
- }
- if (parm10 == -1 || self.team == -1)
- {
- if (lastspawn != world)
- spot = lastspawn;
- if (runespawn != world)
- spot = runespawn;
- if (spot == world)
- {
- if (random () < 0.5)
- spot = MultiSelectSpawnPoint ();
- else
- spot = HeadSelectSpawnPoint ();
- }}
- if (! gamestart && self.team > 1)
- {
- if (time < qtr_1)
- spot = TeamCaptureSpawn();
- else
- spot = MultiSelectSpawnPoint ();
- }
- if (spot.origin == self.origin)
- {
- bprint (self.netname);
- spot = HeadSelectSpawnPoint ();
- bprint (" tried to respawn at same location !\n");
- }
- if (spot.origin == world.origin)
- {
- spot = HeadSelectSpawnPoint ();
- bprint (self.netname);
- bprint ("tried to respawn at world origin !\n");
- }
- self.classname = "player";
- self.health = 100;
- self.takedamage = DAMAGE_AIM;
- self.solid = SOLID_SLIDEBOX;
- self.movetype = MOVETYPE_WALK;
- self.show_hostile = 0;
- self.max_health = 100;
- self.flags = FL_CLIENT;
- self.air_finished = (time + 12);
- self.sprint_finished = time;
- self.dmg = 2;
- self.super_damage_finished = 0;
- self.radsuit_finished = 0;
- self.invisible_finished = 0;
- self.invincible_finished = 0;
- self.effects = 0;
- self.invincible_time = 0;
- self.staydeadtime = 0;
- self.regen_time = 0;
- self.rune_notice_time = 0;
- self.hook_out = FALSE;
- self.observer_flags = 0;
- self.escort_time = (time - 999);
- self.last_hurt_carrier = -10;
- self.altweap = -1;
- self.onfire = FALSE;
- DecodeLevelParms ();
- W_SetCurrentAmmo ();
- if (self.aflag)
- YCamChasePlayer ();
- self.attack_finished = time;
- self.th_pain = player_pain;
- self.th_die = PlayerDie;
- self.deadflag = DEAD_NO;
- self.pausetime = 0;
- self.fixangle = TRUE;
- self.punchangle = ' 0 0 0';
- self.velocity = '0 0 0';
- self.oldskin = self.skin;
- //setmodel (self, "progs/eyes.mdl");
- //modelindex_eyes = self.modelindex;
- if ((self.sex == 0))
- {
- self.sex = 1;
- }
- if ((temp1 & TEMP1_SUPPORT_PLAYER2))
- {
- setmodel (self, "progs/player_f.mdl");
- modelindex_playerf = self.modelindex;
- }
- if ((temp1 & TEMP1_SUPPORT_PLAYER3))
- {
- setmodel (self, "progs/player3.mdl");
- modelindex_player3 = self.modelindex;
- }
- if ((temp1 & TEMP1_SUPPORT_PLAYER4))
- {
- setmodel (self, "progs/player4.mdl");
- modelindex_player4 = self.modelindex;
- }
- setmodel (self, "progs/player.mdl");
- modelindex_player = self.modelindex;
- if ((temp1 & TEMP1_MULTI))
- {
- set_player_modelindexes ();
- }
- setsize (self, VEC_HULL_MIN, VEC_HULL_MAX);
- self.view_ofs = '0 0 22';
- self.spawntime = time + rint ((random () * 4));
- spot.spawn_time = spot.spawn_time + 5;
- self.origin = (spot.origin + '0 0 1');
- if (spot.classname == "info_teleport_destination")
- self.angles = spot.mangle;
- else
- self.angles = spot.angles;
- //self.angles = self.v_angle = spot.angles; //
- player_stand1 ();
- if (self.do_observer || parm14 == 1)
- {
- BecomeObserver (self);
- return;
- }
- if ((deathmatch || coop))
- {
- makevectors (self.angles);
- spawn_tfog ((self.origin + (v_forward * 20)));
- }
- spawn_tdeath (self.origin, self);
- }
- if (clienttype(self) == CLIENTTYPE_BOT)
- {
- DecodeLevelParms ();
- self.punchangle = ' 0 0 0';
- BotRespawn ();
- }
- };
- void () info_player_start =
- {
- };
- void () info_player_start2 =
- {
- };
- void () testplayerstart =
- {
- setorigin (self, self.origin);
- };
- void () info_player_deathmatch =
- {
- };
- void () info_player_team1 =
- {
- };
- void () info_player_team2 =
- {
- };
- void () info_player_coop =
- {
- };
- void () NextLevel =
- {
- local entity o;
- if ((cvar ("samelevel") == -1))
- {
- if ((mapname == "e1m1"))
- {
- nextmap = "dm4";
- }
- else
- {
- if ((mapname == "dm4"))
- {
- nextmap = "e1m2";
- }
- else
- {
- if ((mapname == "e1m2"))
- {
- if ((random () < 0.5))
- {
- nextmap = "e1m5";
- }
- else
- {
- nextmap = "e2m7";
- }
- }
- else
- {
- if (((mapname == "e2m7") || (mapname == "e1m5")))
- {
- nextmap = "e3m6";
- }
- else
- {
- if ((mapname == "e3m6"))
- {
- nextmap = "e3m3";
- }
- else
- {
- if ((mapname == "e3m3"))
- {
- nextmap = "e4m2";
- }
- else
- {
- if ((mapname == "e4m2"))
- {
- nextmap = "end";
- }
- else
- {
- if ((mapname == "end"))
- {
- if ((random () < 0.5))
- {
- nextmap = "e2m1";
- }
- else
- {
- nextmap = "e1m7";
- }
- }
- else
- {
- nextmap = "start";
- localcmd ("samelevel 0\n");
- }
- }
- }
- }
- }
- }
- }
- }
- o = spawn ();
- o.map = nextmap;
- o.think = execute_changelevel;
- o.nextthink = (time + 0.1);
- return;
- }
- if ((mapname == "start"))
- {
- nextmap = "start";
- }
- if ((mapname == "e1m1"))
- {
- nextmap = "e1m2";
- }
- else
- {
- if ((mapname == "e1m2"))
- {
- nextmap = "e1m3";
- }
- else
- {
- if ((mapname == "e1m3"))
- {
- nextmap = "e1m4";
- }
- else
- {
- if ((mapname == "e1m4"))
- {
- nextmap = "e1m5";
- }
- else
- {
- if ((mapname == "e1m5"))
- {
- nextmap = "e1m6";
- }
- else
- {
- if ((mapname == "e1m6"))
- {
- nextmap = "e1m7";
- }
- else
- {
- if ((mapname == "e1m7"))
- {
- nextmap = "e1m8";
- }
- else
- {
- if ((mapname == "e1m8"))
- {
- nextmap = "start";
- }
- else
- {
- if ((mapname == "e2m1"))
- {
- nextmap = "e2m2";
- }
- else
- {
- if ((mapname == "e2m2"))
- {
- nextmap = "e2m3";
- }
- else
- {
- if ((mapname == "e2m3"))
- {
- nextmap = "e2m4";
- }
- else
- {
- if ((mapname == "e2m4"))
- {
- nextmap = "e2m5";
- }
- else
- {
- if ((mapname == "e2m5"))
- {
- nextmap = "e2m6";
- }
- else
- {
- if ((mapname == "e2m6"))
- {
- nextmap = "e2m7";
- }
- else
- {
- if ((mapname == "e2m7"))
- {
- nextmap = "start";
- }
- else
- {
- if ((mapname == "e3m1"))
- {
- nextmap = "e3m2";
- }
- else
- {
- if ((mapname == "e3m2"))
- {
- nextmap = "e3m3";
- }
- else
- {
- if ((mapname == "e3m3"))
- {
- nextmap = "e3m4";
- }
- else
- {
- if ((mapname == "e3m4"))
- {
- nextmap = "e3m5";
- }
- else
- {
- if ((mapname == "e3m5"))
- {
- nextmap = "e3m6";
- }
- else
- {
- if ((mapname == "e3m6"))
- {
- nextmap = "e3m7";
- }
- else
- {
- if ((mapname == "e3m7"))
- {
- nextmap = "start";
- }
- else
- {
- if ((mapname == "e4m1"))
- {
- nextmap = "e4m2";
- }
- else
- {
- if ((mapname == "e4m2"))
- {
- nextmap = "e4m3";
- }
- else
- {
- if ((mapname == "e4m3"))
- {
- nextmap = "e4m4";
- }
- else
- {
- if ((mapname == "e4m4"))
- {
- nextmap = "e4m5";
- }
- else
- {
- if ((mapname == "e4m5"))
- {
- nextmap = "e4m6";
- }
- else
- {
- if ((mapname == "e4m6"))
- {
- nextmap = "e4m7";
- }
- else
- {
- if ((mapname == "e4m7"))
- {
- nextmap = "e4m8";
- }
- else
- {
- if ((mapname == "e4m8"))
- {
- nextmap = "start";
- }
- else
- {
- if ((mapname == "dm1"))
- {
- nextmap = "dm2";
- }
- else
- {
- if ((mapname == "dm2"))
- {
- nextmap = "dm3";
- }
- else
- {
- if ((mapname == "dm3"))
- {
- nextmap = "dm4";
- }
- else
- {
- if ((mapname == "dm4"))
- {
- nextmap = "dm5";
- }
- else
- {
- if ((mapname == "dm5"))
- {
- nextmap = "dm6";
- }
- else
- {
- if ((mapname == "dm6"))
- {
- nextmap = "end";
- }
- else
- {
- if ((mapname == "end"))
- {
- nextmap = "start";
- }
- else
- {
- if ((mapname == "babel"))
- {
- nextmap = "titan2";
- }
- else
- {
- if ((mapname == "titan2"))
- {
- nextmap = "ericctf1";
- }
- else
- {
- if ((mapname == "ericctf1"))
- {
- nextmap = "efdm11";
- }
- else
- {
- if ((mapname == "efdm11"))
- {
- nextmap = "efdm12";
- }
- else
- {
- if ((mapname == "efdm12"))
- {
- nextmap = "mayhem";
- }
- else
- {
- if ((mapname == "mayhem"))
- {
- nextmap = "argonaut";
- }
- else
- {
- if ((mapname == "argonaut"))
- {
- nextmap = "rc2";
- }
- else
- {
- if ((mapname == "rc2"))
- {
- nextmap = "start";
- }
- else
- {
- if ((mapname == "ctf1"))
- {
- nextmap = "ctf2";
- }
- else
- {
- if ((mapname == "ctf2"))
- {
- nextmap = "ctf3";
- }
- else
- {
- if ((mapname == "ctf3"))
- {
- nextmap = "ctf4";
- }
- else
- {
- if ((mapname == "ctf4"))
- {
- nextmap = "ctf5";
- }
- else
- {
- if ((mapname == "ctf5"))
- {
- nextmap = "ctf6";
- }
- else
- {
- if ((mapname == "ctf6"))
- {
- nextmap = "ctf7";
- }
- else
- {
- if ((mapname == "ctf7"))
- {
- nextmap = "ctf8";
- }
- else
- {
- if ((mapname == "ctf8"))
- {
- nextmap = "ctfstart";
- }
- else
- {
- if ((mapname == "ctf2m1"))
- {
- nextmap = "ctf2m2";
- }
- else
- {
- if ((mapname == "ctf2m2"))
- {
- nextmap = "ctf2m3";
- }
- else
- {
- if ((mapname == "ctf2m3"))
- {
- nextmap = "ctf2m4";
- }
- else
- {
- if ((mapname == "ctf2m4"))
- {
- nextmap = "ctf2m5";
- }
- else
- {
- if ((mapname == "ctf2m5"))
- {
- nextmap = "ctf2m6";
- }
- else
- {
- if ((mapname == "ctf2m6"))
- {
- nextmap = "ctf2m7";
- }
- else
- {
- if ((mapname == "ctf2m7"))
- {
- nextmap = "ctf2m8";
- }
- else
- {
- if ((mapname == "ctf2m8"))
- {
- nextmap = "ctfstart";
- }
- else
- {
- if ((mapname == "ctf3m1"))
- {
- nextmap = "ctf3m2";
- }
- else
- {
- if ((mapname == "ctf3m2"))
- {
- nextmap = "ctf3m3";
- }
- else
- {
- if ((mapname == "ctf3m3"))
- {
- nextmap = "ctf3m4";
- }
- else
- {
- if ((mapname == "ctf3m4"))
- {
- nextmap = "ctf3m5";
- }
- else
- {
- if ((mapname == "ctf3m5"))
- {
- nextmap = "ctf3m6";
- }
- else
- {
- if ((mapname == "ctf3m6"))
- {
- nextmap = "ctf3m7";
- }
- else
- {
- if ((mapname == "ctf3m7"))
- {
- nextmap = "ctf3m8";
- }
- else
- {
- if ((mapname == "ctf3m8"))
- {
- nextmap = "ctf3m9";
- }
- else
- {
- if ((mapname == "ctf3m9"))
- {
- nextmap = "ctf3m1";
- }
- else
- {
- if ((mapname == "xeno1"))
- {
- nextmap = "xeno2";
- }
- else
- {
- if ((mapname == "xeno2"))
- {
- nextmap = "xeno3";
- }
- else
- {
- if ((mapname == "xeno3"))
- {
- nextmap = "xeno4";
- }
- else
- {
- if ((mapname == "xeno4"))
- {
- nextmap = "xeno6";
- }
- else
- {
- if ((mapname == "xeno6"))
- {
- nextmap = "xeno7";
- }
- else
- {
- if ((mapname == "xeno7"))
- {
- nextmap = "xeno8";
- }
- else
- {
- if ((mapname == "xeno8"))
- {
- nextmap = "expctf1";
- }
- else
- {
- if ((mapname == "expctf1"))
- {
- nextmap = "expctf2";
- }
- else
- {
- if ((mapname == "expctf2"))
- {
- nextmap = "xeno1";
- }
- else
- {
- if ((mapname == "ctf1bsp0"))
- {
- nextmap = "ctf1bsp1";
- }
- else
- {
- if ((mapname == "ctf1bsp1"))
- {
- nextmap = "ctf1bsp2";
- }
- else
- {
- if ((mapname == "ctf1bsp2"))
- {
- nextmap = "ctf1bsp3";
- }
- else
- {
- if ((mapname == "ctf1bsp3"))
- {
- nextmap = "ctf1bsp4";
- }
- else
- {
- if ((mapname == "ctf1bsp4"))
- {
- nextmap = "ctf1bsp5";
- }
- else
- {
- if ((mapname == "ctf1bsp5"))
- {
- nextmap = "ctf1bsp6";
- }
- else
- {
- if ((mapname == "ctf1bsp6"))
- {
- nextmap = "ctf1bsp7";
- }
- else
- {
- if ((mapname == "ctf1bsp7"))
- {
- nextmap = "ctf1bsp8";
- }
- else
- {
- if ((mapname == "ctf1bsp8"))
- {
- nextmap = "ctf1bsp9";
- }
- else
- {
- if ((mapname == "ctf1bsp9"))
- {
- nextmap = "ctf1bspx";
- }
- else
- {
- if ((mapname == "ctf1bspx"))
- {
- nextmap = "ctf1bsp0";
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- o = spawn ();
- o.map = nextmap;
- o.think = execute_changelevel;
- o.nextthink = (time + 0.1);
- return;
- };
- void (float timer_f) DoTimerMessage =
- {
- local entity p;
- local string st;
- p = find (world, classname, "player");
- while ((p != world))
- {
- sound (self, CHAN_VOICE, "misc/talk.wav", 1, ATTN_NONE);
- p = find (p, classname, "player");
- }
- if ((timer_f == 1))
- {
- bprint ("\n\n\n ² ÍÉÎÕÔÅÓ òåíáéîéîç\n");
- }
- else
- {
- if ((timer_f == 2))
- {
- bprint ("\n\n\n ± ÍÉÎÕÔÅ òåíáéîéîç\n");
- }
- else
- {
- if ((timer_f == 3))
- {
- bprint ("\n\n\n ±° ÓÅÃÏÎÄÓ òåíáéîéîç\n");
- }
- else
- {
- return;
- }
- }
- }
- bprint (" òåä: ");
- st = ftos (teamscr1);
- bprint (st);
- bprint (" âìõå: ");
- st = ftos (teamscr2);
- bprint (st);
- bprint ("\n");
- };
- void () CheckRules =
- {
- local float timelimit;
- local float fraglimit;
- local entity o;
- if ((gameover || pregameover)) return;
- if (gamestart)
- {
- if ((((vote_leader != world) && voteexit_time) && (time > voteexit_time)))
- {
- pregameover = 1;
- o = spawn ();
- nextmap = vote_leader.map;
- o.map = nextmap;
- o.think = execute_changelevel;
- o.nextthink = (time + 0.1);
- return;
- }
- return;
- }
- timelimit = (cvar ("timelimit") * 60);
- fraglimit = cvar ("fraglimit");
- if ((timelimit > 120))
- {
- if (((time >= (timelimit - 120)) && (timer_flag == 0)))
- {
- timer_flag = 1;
- DoTimerMessage (timer_flag);
- return;
- }
- if (((time >= (timelimit - 60)) && (timer_flag == 1)))
- {
- timer_flag = 2;
- DoTimerMessage (timer_flag);
- return;
- }
- if (((time >= (timelimit - 10)) && (timer_flag == 2)))
- {
- timer_flag = 3;
- DoTimerMessage (timer_flag);
- return;
- }
- }
- if ((temp1 & TEMP1_FRAGASCAPTURE))
- {
- if ((fraglimit && ((captures_red >= fraglimit) || (captures_blue >= fraglimit))))
- {
- pregameover = 1;
- level_over_time = time;
- TeamEndScore ();
- NextLevel ();
- return;
- }
- if ((timelimit && (time >= timelimit)))
- {
- pregameover = 1;
- level_over_time = time;
- TeamEndScore ();
- NextLevel ();
- return;
- }
- }
- else
- {
- if (((timelimit && (time >= timelimit)) || (fraglimit && (self.frags >= fraglimit))))
- {
- pregameover = 1;
- level_over_time = time;
- TeamEndScore ();
- NextLevel ();
- return;
- }
- }
- };
- void () PlayerDeathThink =
- {
- local entity old_self;
- local float forward;
- if (self.flags & FL_ONGROUND)
- {
- forward = vlen (self.velocity);
- forward = (forward - 20);
- if ((forward <= 0))
- self.velocity = VEC_ORIGIN;
- else
- self.velocity = (forward * normalize (self.velocity));
- }
- if ((self.model == "progs/flame2.mdl"))
- {
- if (((self.watertype == CONTENT_WATER) || (self.flags == FL_INWATER)))
- {
- sound (self, CHAN_AUTO, "player/slimbrn2.wav", TRUE, ATTN_NONE);
- particle ((self.origin + '0 0 5'), VEC_ORIGIN, 110, 400);
- DeathBubbles (2);
- setmodel (self, "progs/zom_gib.mdl");
- }
- else
- {
- self.touch = torch_touch;
- }
- }
- if ((self.deadflag == DEAD_DEAD))
- {
- if (((self.button2 || self.button1) || self.button0))
- {
- stuffcmd (self, "v_cshift 0 0 0 245\n");
- return;
- }
- self.deadflag = DEAD_RESPAWNABLE;
- return;
- }
- if (((!self.button2 && !self.button1) && !self.button0))
- return;
- self.button0 = 0;
- self.button1 = 0;
- self.button2 = 0;
- respawn ();
- };
- void () PlayerJump =
- {
- local vector start;
- local vector end;
- if (self.movetype == MOVETYPE_NONE) return;
- if (((self.classname == "bot") && (self.weapon != IT_HOOK)))
- {
- self.nextjump = (self.nextjump + 1);
- if ((self.nextjump > 4))
- return;
- }
- if ((self.flags & FL_WATERJUMP)) return;
- if ((self.waterlevel >= 2))
- {
- if ((self.watertype == CONTENT_WATER))
- {
- self.velocity_z = 75;
- }
- if ((self.watertype == CONTENT_SLIME))
- {
- self.velocity_z = 50;
- }
- if ((self.watertype == CONTENT_LAVA))
- {
- self.velocity_z = 25;
- }
- else
- {
- self.velocity_z = 100;
- }
- if ((self.swim_flag < time))
- {
- self.swim_flag = (time + 1);
- if ((random () < 0.5))
- {
- sound (self, CHAN_BODY, "misc/water1.wav", 1, ATTN_NORM);
- }
- else
- {
- sound (self, CHAN_BODY, "misc/water2.wav", 1, ATTN_NORM);
- }
- }
- drip(self.origin,WATERCOLOR);
- return;
- }
- if (!(self.flags & FL_ONGROUND)) return;
- if (!(self.flags & FL_JUMPRELEASED)) return;// don't pogo stick
- self.flags = (self.flags - (self.flags & FL_JUMPRELEASED));
- self.flags = (self.flags - FL_ONGROUND);
- self.button2 = 0;
- if (((self.sex == 2) && (temp1 & TEMP1_PLAYER2SOUNDS)))
- {
- sound (self, CHAN_BODY, "player_f/plyrjmp8.wav", 1, ATTN_IDLE);
- }
- else
- {
- if (((self.sex == 3) && (temp1 & TEMP1_PLAYER3SOUNDS)))
- {
- sound (self, CHAN_BODY, "player3/plyrjmp8.wav", 1, ATTN_IDLE);
- }
- else
- {
- if (((self.sex == 4) && (temp1 & TEMP1_PLAYER4SOUNDS)))
- {
- sound (self, CHAN_BODY, "player4/plyrjmp8.wav", 1, ATTN_IDLE);
- }
- else
- {
- sound (self, CHAN_BODY, "player/plyrjmp8.wav", 1, ATTN_IDLE);
- }
- }
- }
- self.velocity_z = (self.velocity_z + 270);
- };
- .float dmgtime;
- void () WaterMove =
- {
- if (self.items & IT_INVULNERABILITY)
- {
- self.air_finished = self.invincible_finished + 5;
- return;
- }
- if ((self.movetype == MOVETYPE_NOCLIP))
- return;
- if ((self.health < 0))
- {
- return;
- }
- if ((time < self.watermove_time))
- {
- return;
- }
- self.watermove_time = (time + 0.3);
- if ( self.waterlevel != 3 )
- {
- if ((self.air_finished < time))
- {
- if (((self.sex == 2) && (temp1 & TEMP1_PLAYER2SOUNDS)))
- {
- sound (self, CHAN_VOICE, "player_f/gasp2.wav", 1, ATTN_NORM);
- }
- else
- {
- if (((self.sex == 3) && (temp1 & TEMP1_PLAYER3SOUNDS)))
- {
- sound (self, CHAN_VOICE, "player3/gasp2.wav", 1, ATTN_NORM);
- }
- else
- {
- if (((self.sex == 4) && (temp1 & TEMP1_PLAYER4SOUNDS)))
- {
- sound (self, CHAN_VOICE, "player4/gasp2.wav", 1, ATTN_NORM);
- }
- else
- {
- sound (self, CHAN_VOICE, "player/gasp2.wav", 1, ATTN_NORM);
- }
- }
- }
- }
- else
- {
- if ((self.air_finished < (time + TE_LIGHTNING3)))
- {
- if (((self.sex == 2) && (temp1 & TEMP1_PLAYER2SOUNDS)))
- {
- sound (self, CHAN_VOICE, "player_f/gasp1.wav", 1, ATTN_NORM);
- }
- else
- {
- if (((self.sex == 3) && (temp1 & TEMP1_PLAYER3SOUNDS)))
- {
- sound (self, CHAN_VOICE, "player3/gasp1.wav", 1, ATTN_NORM);
- }
- else
- {
- if (((self.sex == 4) && (temp1 & TEMP1_PLAYER4SOUNDS)))
- {
- sound (self, CHAN_VOICE, "player4/gasp1.wav", 1, ATTN_NORM);
- }
- else
- {
- sound (self, CHAN_VOICE, "player/gasp1.wav", 1, ATTN_NORM);
- }
- }
- }
- }
- }
- self.air_finished = (time + 12);
- self.dmg = 2;
- }
- else
- {
- if ((self.air_finished < time))
- {
- if ((self.pain_finished < time))
- {
- self.dmg = (self.dmg + 2);
- if ((self.dmg > 5))
- {
- self.dmg = 10;
- }
- if (((pointcontents (self.origin) != CONTENT_SLIME)) || ((pointcontents (self.origin) != CONTENT_LAVA)))
- self.deathtype = "drowning";
- T_Damage (self, world, world, self.dmg);
- self.pain_finished = (time + 1);
- }
- }
- }
- if (!self.waterlevel)
- {
- if ((self.flags & FL_INWATER))
- {
- sound (self, CHAN_BODY, "misc/outwater.wav", 1, ATTN_NORM);
- self.flags = (self.flags - FL_INWATER);
- }
- return;
- }
- if ((self.watertype == CONTENT_LAVA))
- {
- if ((self.dmgtime < time))
- {
- if ((self.radsuit_finished > time))
- {
- self.dmgtime = (time + 1);
- }
- else
- {
- self.dmgtime = (time + 0.2);
- }
- T_Damage (self, world, world, (10 * self.waterlevel));
- }
- }
- else
- {
- if ((self.watertype == CONTENT_SLIME))
- {
- if (((self.dmgtime < time) && (self.radsuit_finished < time)))
- {
- self.dmgtime = (time + 1);
- T_Damage (self, world, world, (4 * self.waterlevel));
- }
- }
- }
- if (!(self.flags & FL_INWATER))
- {
- if ((self.watertype == CONTENT_LAVA))
- {
- drip(self.origin,254);
- if (((self.sex == 2) && (temp1 & TEMP1_PLAYER2SOUNDS)))
- {
- sound (self, CHAN_BODY, "player_f/inlava.wav", 1, ATTN_NORM);
- }
- else
- {
- if (((self.sex == 3) && (temp1 & TEMP1_PLAYER3SOUNDS)))
- {
- sound (self, CHAN_BODY, "player3/inlava.wav", 1, ATTN_NORM);
- }
- else
- {
- if (((self.sex == 4) && (temp1 & TEMP1_PLAYER4SOUNDS)))
- {
- sound (self, CHAN_BODY, "player4/inlava.wav", 1, ATTN_NORM);
- }
- else
- {
- sound (self, CHAN_BODY, "player/inlava.wav", 1, ATTN_NORM);
- }
- }
- }
- }
- if ((self.watertype == CONTENT_WATER))
- {
- drip(self.origin,WATERCOLOR);
- if (((self.sex == 2) && (temp1 & TEMP1_PLAYER2SOUNDS)))
- {
- sound (self, CHAN_BODY, "player_f/inh2o.wav", 1, ATTN_NORM);
- }
- else
- {
- if (((self.sex == 3) && (temp1 & TEMP1_PLAYER3SOUNDS)))
- {
- sound (self, CHAN_BODY, "player3/inh2o.wav", 1, ATTN_NORM);
- }
- else
- {
- if (((self.sex == 4) && (temp1 & TEMP1_PLAYER4SOUNDS)))
- {
- sound (self, CHAN_BODY, "player4/inh2o.wav", 1, ATTN_NORM);
- }
- else
- {
- sound (self, CHAN_BODY, "player/inh2o.wav", 1, ATTN_NORM);
- }
- }
- }
- }
- if ((self.watertype == CONTENT_SLIME))
- {
- drip(self.origin,186);
- if (((self.sex == 2) && (temp1 & TEMP1_PLAYER2SOUNDS)))
- {
- sound (self, CHAN_BODY, "player_f/slimbrn2.wav", 1, ATTN_NORM);
- }
- else
- {
- if (((self.sex == 3) && (temp1 & TEMP1_PLAYER3SOUNDS)))
- {
- sound (self, CHAN_BODY, "player3/slimbrn2.wav", 1, ATTN_NORM);
- }
- else
- {
- if (((self.sex == 4) && (temp1 & TEMP1_PLAYER4SOUNDS)))
- {
- sound (self, CHAN_BODY, "player4/slimbrn2.wav", 1, ATTN_NORM);
- }
- else
- {
- sound (self, CHAN_BODY, "player/slimbrn2.wav", 1, ATTN_NORM);
- }
- }
- }
- }
- self.flags = (self.flags + FL_INWATER);
- self.dmgtime = 0;
- }
- if (!(self.flags & FL_WATERJUMP))
- self.velocity = (self.velocity - (((0.01 * self.waterlevel) * frametime) * self.velocity));
- };
- void () CheckWaterJump =
- {
- local vector start;
- local vector end;
- makevectors (self.angles);
- start = self.origin;
- start_z = (start_z + DO_VOID);
- v_forward_z = 0;
- normalize (v_forward);
- end = (start + (v_forward * 24));
- traceline (start, end, TRUE, self);
- if ((trace_fraction < 1))
- {
- start_z = ((start_z + self.maxs_z) - DO_VOID);
- end = (start + (v_forward * 24));
- self.movedir = (trace_plane_normal * -50);
- traceline (start, end, TRUE, self);
- if ((trace_fraction == 1))
- {
- self.flags = (self.flags | FL_WATERJUMP);
- self.velocity_z = 225;
- //bprint ("|WATERJUMP|");
- //bprint ("\n");
- self.flags = (self.flags - (self.flags & FL_JUMPRELEASED));
- self.teleport_time = (time + 2);
- if ((self.deadflag != DEAD_DEAD))
- drip(self.origin,WATERCOLOR);
- return;
- }
- }
- };
- void () updatebreath =
- {
- local string cal;
- if (self.velocity != '0 0 0')
- if (time < self.sprint_finished)
- {
- if ((time > (self.sprint_finished - 15)))
- {
- cal = " ‹‹‹‹‹‹‹‹‹‹‹‹ ";
- }
- if ((time > (self.sprint_finished - 14)))
- {
- cal = " ‹‹‹‹‹‹‹‹‹‹‹ ";
- }
- if ((time > (self.sprint_finished - 13)))
- {
- cal = " ‹‹‹‹‹‹‹‹‹‹ ";
- }
- if ((time > (self.sprint_finished - 12)))
- {
- cal = " ‹‹‹‹‹‹‹‹‹ ";
- }
- if ((time > (self.sprint_finished - 11)))
- {
- cal = " ‹‹‹‹‹‹‹‹ ";
- }
- if ((time > (self.sprint_finished - 10)))
- {
- cal = " ‹‹‹‹‹‹‹ ";
- }
- if ((time > (self.sprint_finished - 9)))
- {
- cal = " ‹‹‹‹‹‹ ";
- }
- if ((time > (self.sprint_finished - 8)))
- {
- cal = " ‹‹‹‹‹ ";
- }
- if ((time > (self.sprint_finished - 6)))
- {
- cal = " ‹‹‹‹ ";
- }
- if ((time > (self.sprint_finished - 4)))
- {
- cal = " ‹‹‹ ";
- }
- if ((time > (self.sprint_finished - 3)))
- {
- cal = " ‹‹ ";
- }
- if ((time > (self.sprint_finished - 1)))
- {
- if (self.walkvalue < 161)
- sound(self, CHAN_AUTO, "breath3.wav", 0.5, ATTN_IDLE);
- cal = " ";
- }
- if (((time == self.sprint_finished)) || ((pointcontents (self.origin) == CONTENT_LAVA)))
- {
- cal = "0";
- bprint ("cal: ");
- bprint (cal);
- bprint ("\n");
- if (!self.waterlevel & self.stamina < time)
- sound(self, CHAN_AUTO, "breath3f.wav", 0.5, ATTN_IDLE);
- self.walktime = -1;
- self.stamina = time;
- }
- if ((cal != "0"))
- {
- centerprintcat (self, "STAMINAü\n", cal);
- }
- }
- /*
- if (self.velocity != '0 0 0')
- {
- local float x;
- bprint ("Walkvalue ");
- bprint (ftos (self.walkvalue));
- bprint (" :: ");
- bprint ("Runvalue ");
- bprint (ftos (self.runvalue));
- bprint (" :: ");
- x = self.runvalue - self.walkvalue;
- bprint ("DIFFERENCE >> ");
- bprint (ftos (x));
- bprint ("\n");
- }
- */
- };
- void () PlayerPreThink =
- {
- local float mspeed;
- local float aspeed;
- local float r;
- local string s;
- if (clienttype(self) == CLIENTTYPE_BOT )
- {
- if (intermission_running && self.takedamage != DAMAGE_NO)
- {
- self.message = "Playerprethink:";
- BotSayGoodGame ();
- }
- }
- else
- {
- //bprint ("self.waterlevel ");
- //bprint (ftos (self.waterlevel));
- //bprint ("\n");
- floaterPreThink ();
- if (intermission_running)
- {
- IntermissionThink ();
- return;
- }
- if (self.movetype == MOVETYPE_NONE && self.nextfootstep < time)
- {
- self.view_ofs = '0 0 22';
- self.movetype = MOVETYPE_WALK;
- sound(self, CHAN_DEV, "breath3.wav", 0.5, ATTN_IDLE);
- }
- if ((self.staydeadtime && (self.staydeadtime > time)))
- {
- self.jump_flag = 0;
- if (random() < 0.1)
- sound (self, 0, "soldier/idle.wav", 1, (rint(random())+ 1));
- return;
- }
- if ((coop && TEAM_STRICT_COOP))
- {
- return;
- }
- if (((time > qtr_1) && (time < (qtr_1 + 3))))
- {
- centerprint (self, "1st Quarter has ended.");
- }
- if (((time > qtr_3) && (time < (qtr_3 + 3))))
- {
- centerprint (self, "3rd Quarter has ended.");
- }
- TeamCapturePlayerUpdate ();
- if (self.CamState)
- {
- if ((self.CamState > 2))
- {
- CamPreThink ();
- }
- return;
- }
- if ((self.view_ofs == VEC_ORIGIN)) return;
- if (self.aflag)
- {
- YCamChasePlayer ();
- }
- makevectors (self.v_angle);
- CheckRules ();
- WaterMove ();
- SpawnFollowEntity ();
- PrintCloseWaypoint ();
- TeamCheckLock ();
- if ((self.waterlevel == 2))
- {
- CheckWaterJump ();
- }
- if ((self.deadflag >= DEAD_DEAD))
- {
- PlayerDeathThink ();
- return;
- }
- if (self.observer)
- {
- if ((self.CamState <= 2))
- {
- ObserverThink ();
- }
- return;
- }
- if ((self.deadflag == DEAD_DYING))
- {
- return;
- }
- if (self.button2)
- PlayerJump ();
- else
- {
- self.flags = (self.flags | FL_JUMPRELEASED);
- }
- if ((time < self.pausetime))
- {
- self.velocity = VEC_ORIGIN;
- }
- if (((((time > self.attack_finished) && (self.currentammo == 0)) && (self.weapon != IT_AXE)) && (self.weapon != IT_HOOK)))
- {
- self.weapon = W_BestWeapon ();
- W_SetCurrentAmmo ();
- }
- }
- };
- void () CheckPowerups =
- {
- local float m;
- local float v;
- if (((self.health <= 0) || self.observer)) return;
- if ((self.player_flag & ITEM_RUNE1_FLAG))
- {
- if ((self.attacked - 1.5) > time)
- BlinkRune(32);
- else self.items2 = 32;
- }
- if (self.player_flag & ITEM_RUNE2_FLAG)
- {
- if (time < self.attack_finished)
- BlinkRune(64);
- else self.items2 = 64;
- }
- if ((self.player_flag & ITEM_RUNE3_FLAG))
- {
- if (time < self.attack_finished)
- BlinkRune(128);
- else self.items2 = 128;
- }
- if ((self.player_flag & ITEM_RUNE4_FLAG))
- {
- if ((self.regen_time < time))
- {
- BlinkRune(256);
- if ((self.velocity != VEC_ORIGIN))
- m = 2;
- else
- m = 5;
- if ((self.classname == "bot"))
- m = (m * 1.125);
- if ((self.attack_finished > time))
- m = (m * 0.5);
- self.regen_time = time;
- if ((self.health < 150))
- {
- self.health = (self.health + m);
- if ((self.health > 150))
- self.health = 150;
- self.regen_time = (self.regen_time + 0.5);
- RegenerationSound ();
- }
- if ((self.armortype < 0.6))
- v = 100;
- else
- v = (self.armortype * 250);
- if (((self.armorvalue < v) && (self.armortype != 0)))
- {
- self.armorvalue = (self.armorvalue + m);
- if (self.armorvalue >= v)
- sound (self, CHAN_AUTO, "items/armor1.wav", 1, ATTN_STATIC);
- else if (time > self.attack_finished)
- sound (self, CHAN_AUTO, "items/itembk2.wav", 1, ATTN_STATIC);
- if ((self.armorvalue > v))
- self.armorvalue = v;
- if ((v == 100))
- self.regen_time = (self.regen_time + 0.35);
- else
- {
- self.regen_time = (self.regen_time + (v * 0.0055));
- //RegenerationSound ();
- }
- }
- }
- else self.items2 = 256;
- }
- if (self.invisible_finished)
- {
- if ((self.invisible_sound < time))
- {
- if (random () < 0.5)
- sound (self, CHAN_AUTO, "items/inv3.wav", 0.5, SUB_Db());
- else
- sound (self, CHAN_AUTO, "newring.wav", 0.5, SUB_Db());
- self.invisible_sound = (time + ((random () * 2) + 7));
- }
- if ((self.invisible_finished < (time + 3)))
- {
- if ((self.invisible_time == 1))
- {
- if ((self.classname == "player"))
- sprint (self, "Ring of Shadows magic is fading\n");
- if ((self.classname == "player"))
- stuffcmd (self, "bf\n");
- sound (self, CHAN_AUTO, "items/inv2.wav", 1, SUB_Db());
- self.invisible_time = (time + 1);
- }
- if ((self.invisible_time < time))
- {
- self.invisible_time = (time + 1);
- if ((self.classname == "player"))
- {
- stuffcmd (self, "bf\n");
- }
- }
- }
- if ((self.invisible_finished < time))
- {
- self.items = (self.items - IT_INVISIBILITY);
- self.invisible_finished = 0;
- self.invisible_time = 0;
- self.skin = self.oldskin;
- }
- }
- else if ((temp1 & TEMP1_MULTI))
- self.modelindex = self.modelindex_thisplayer;
- else
- set_player_main_index ();
- if (self.invincible_finished)
- {
- if ((self.invincible_finished < (time + 3)))
- {
- if ((self.invincible_time == 1))
- {
- if ((self.classname == "player"))
- {
- sprint (self, "Protection is almost burned out\n");
- }
- if ((self.classname == "player"))
- {
- stuffcmd (self, "bf\n");
- }
- sound (self, CHAN_AUTO, "items/protect2.wav", 1, ATTN_NORM);
- self.invincible_time = (time + 1);
- }
- if ((self.invincible_time < time))
- {
- self.invincible_time = (time + 1);
- if ((self.classname == "player"))
- {
- stuffcmd (self, "bf\n");
- }
- }
- }
- if ((self.invincible_finished < time))
- {
- self.items = (self.items - IT_INVULNERABILITY);
- self.invincible_time = 0;
- self.invincible_finished = 0;
- }
- }
- if (self.super_damage_finished)
- {
- if ((self.super_damage_finished < (time + 3)))
- {
- if ((self.super_time == 1))
- {
- if ((self.classname == "player"))
- {
- sprint (self, "Quad Damage is wearing off\n");
- }
- if ((self.classname == "player"))
- {
- stuffcmd (self, "bf\n");
- }
- sound (self, CHAN_AUTO, "items/damage2.wav", 1, ATTN_NORM);
- self.super_time = (time + 1);
- }
- if ((self.super_time < time))
- {
- self.super_time = (time + 1);
- if ((self.classname == "player"))
- {
- stuffcmd (self, "bf\n");
- }
- }
- }
- if ((self.super_damage_finished < time))
- {
- self.items = (self.items - IT_QUAD);
- self.super_damage_finished = 0;
- self.super_time = 0;
- }
- }
- if (self.radsuit_finished)
- {
- self.air_finished = (time + 12);
- if ((self.radsuit_finished < (time + 3)))
- {
- if ((self.rad_time == 1))
- {
- if ((self.classname == "player"))
- {
- sprint (self, "Air supply in Biosuit expiring\n");
- }
- if ((self.classname == "player"))
- {
- stuffcmd (self, "bf\n");
- }
- sound (self, CHAN_AUTO, "items/suit2.wav", 1, ATTN_IDLE);
- self.rad_time = (time + 1);
- }
- if ((self.rad_time < time))
- {
- self.rad_time = (time + 1);
- if ((self.classname == "player"))
- {
- stuffcmd (self, "bf\n");
- }
- }
- }
- if ((self.radsuit_finished < time))
- {
- self.items = (self.items - IT_SUIT);
- self.rad_time = 0;
- self.radsuit_finished = 0;
- }
- }
- CheckDimLight ();
- };
- //FOOTSTEPS!!
- void() playerfootstep =
- {
- local float amp;
- if (self.deadflag || self.classname != "player")
- return;
- if (!(self.flags & FL_ONGROUND))
- return;
- if (time < self.nextfootstep || time < self.attack_finished)
- return;
- local float s;
- //local float walk;
- //local float run;
- if (!self.waterlevel && (checkbottom (self)) && self.velocity != '0 0 0')
- {
- if (vlen(self.velocity) < 300)
- {
- amp = 3;
- self.nextfootstep = time + 0.3;
- if (self.runtime > self.sprint_finished && self.walktime == -1)
- {
- self.sprint_finished = time + (self.runtime - self.sprint_finished) - 1;
- if (self.runtime - self.sprint_finished >= 15)
- {
- self.sprint_finished = 15;
- }
- }
- self.walkvalue = (vlen(self.velocity));
- if (vlen(self.velocity) < 13 && self.velocity != '0 0 0')
- {
- if (vlen(self.velocity) < 5)
- self.nextfootstep = time + 0.6;
- else
- self.nextfootstep = time + ((vlen(self.velocity) / 9.5));
- s = -1;
- }
- }
- if (vlen(self.velocity) > 300)
- {
- amp = 4;
- if (self.runvalue == 0 && self.walktime != -1) // From standing still and didnt just finish sprinting
- {
- self.sprint_finished = time + 15;
- self.runtime = self.sprint_finished + 15;
- }
- else if (self.walktime == -1)
- {
- if (!self.velocity)
- {
- self.sprint_finished = time +2;
- if (self.sprint_finished > self.stamina + 15)
- {
- self.sprint_finished = self.stamina + 15;
- self.walktime = 0;
- }
- }
- else if (self.velocity)
- {
- self.sprint_finished = time +1;
- if (self.sprint_finished > self.stamina + 15)
- {
- self.sprint_finished = self.stamina + 15;
- self.walktime = 0;
- }
- }
- }
- //else we are already running
- self.nextfootstep = time + 0.15;
- self.runvalue = (vlen(self.velocity));
- updatebreath();
- }
- /*
- .float stamina;
- .float walkvalue;
- .float runvalue;
- .float sprint_finished;
- .float walktime;
- .float runtime;
- */
- if (s != -1)
- {
- s = random() * 4;
- // ATTN_IDLE to make them short range
- if (s < 1) sound(self, CHAN_BODY, "boot1.wav", 0.5, amp);
- else if (s < 2) sound(self, CHAN_DEV, "boot2.wav", 0.5, amp);
- else if (s < 3) sound(self, CHAN_DEV, "boot3.wav", 0.5, amp);
- else sound(self, CHAN_DEV, "boot4.wav", 0.5, amp);
- }
- else
- sound(self, CHAN_AUTO, "slip.wav", 0.5, amp);
- }
- else if (!self.waterlevel && (checkbottom (self)) && self.velocity == '0 0 0')
- {
- if (self.runvalue || self.walkvalue)
- sound(self, CHAN_AUTO, "breath2f.wav", 1, ATTN_IDLE);
- self.walkvalue = 0;
- self.runvalue = 0;
- //self.walktime = -1;
- //self.runtime = -1;
- }
- };
- void () PlayerPostThink =
- {
- local float mspeed;
- local float aspeed;
- local float r;
- local string num;
- local string n;
- local string l;
- if (clienttype(self) == CLIENTTYPE_BOT && !self.deadflag)
- {
- /*
- bprint (self.netname);
- bprint (" - ");
- if (self.bot_action == BOT_MOVING)
- bprint (" MOVING ");
- if (self.bot_action == BOT_FIGHTING)
- bprint (" FIGHTING ");
- bprint (self.goalentity.classname);
- bprint (" - ");
- bprint (ftos (self.yaw_speed));
- bprint (" - ");
- bprint (ftos (self.angles_y));
- bprint ("\n");
- */
- }
- else
- {
- if (self.netname == "")
- {
- msg_entity = self;
- stuffcmd (self,"echo !NETNAME\n");
- WriteByte(MSG_ONE, -2);
- WriteByte(MSG_ONE, 0);
- }
- if (time < self.cshift && self.cshift_num == -255)
- stuffcmd (self, "v_cshift \n");
- if ((time < (self.attack_finished + 4.5)))
- {
- if (self.crosshair)
- {
- stuffcmd (self, "crosshair ");
- stuffcmd (self, ftos(self.crosshairtype));
- stuffcmd (self, "\n");
- }
- }
- else if (self.crosshair)
- {
- stuffcmd (self, "crosshair 0\n");
- }
- if ((self.CamState > 2))
- {
- CamThink ();
- return;
- }
- if ((self.CamState == 2))
- {
- InitCamClient ();
- return;
- }
- if ((self.view_ofs == VEC_ORIGIN))
- {
- return;
- }
- if (self.deadflag)
- {
- return;
- }
- if (self.aflag)
- {
- YCamChasePlayer ();
- }
- if ((self.team > 0)) W_WeaponFrame ();
- if ((((self.jump_flag < -300) && (self.flags & FL_ONGROUND)) && (self.health > 0)))
- {
- if ((self.watertype == CONTENT_WATER))
- {
- if (((self.sex == 2) && (temp1 & TEMP1_PLAYER2SOUNDS)))
- {
- sound (self, CHAN_BODY, "player_f/h2ojump.wav", 1, ATTN_NORM);
- }
- else
- {
- if (((self.sex == 3) && (temp1 & TEMP1_PLAYER3SOUNDS)))
- {
- sound (self, CHAN_BODY, "player3/h2ojump.wav", 1, ATTN_NORM);
- }
- else
- {
- if (((self.sex == 4) && (temp1 & TEMP1_PLAYER4SOUNDS)))
- {
- sound (self, CHAN_BODY, "player4/h2ojump.wav", 1, ATTN_NORM);
- }
- else
- {
- sound (self, CHAN_BODY, "player/h2ojump.wav", 1, ATTN_NORM);
- }
- }
- }
- }
- else
- {
- if (((self.jump_flag < -650) && !(deathmatch & DM_NO_FALLING)))
- {
- local float d;
- local float m
- if (self.jump_flag < -650 && self.jump_flag > -700)
- m = -0.01;
- else if (self.jump_flag < -700 && self.jump_flag > -825)
- m = -0.02;
- else if (self.jump_flag < -825 && self.jump_flag > -900)
- m = -0.035;
- else if (self.jump_flag < -900)
- m = -0.1;
- d = floor(self.jump_flag * m);
- self.deathtype = "falling";
- T_Damage (self, world, world, d);
- if (self.classname == "player")
- {
- self.punchangle = vectoangles(self.velocity) * m;
- self.punchangle_z = d * -0.44;
- sound (self, CHAN_BODY, "zombie/z_miss.wav", TRUE, ATTN_NORM);
- self.view_ofs = '0 0 8';
- self.frame = 60;
- self.movetype = MOVETYPE_NONE;
- self.nextthink = time + (m * -100);
- self.nextfootstep = self.nextthink;
- }
- WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
- WriteByte (MSG_BROADCAST, TE_KNIGHTSPIKE);
- WriteCoord (MSG_BROADCAST, self.origin_x);
- WriteCoord (MSG_BROADCAST, self.origin_y);
- WriteCoord (MSG_BROADCAST, self.origin_z);
- if (((self.sex == 2) && (temp1 & TEMP1_PLAYER2SOUNDS)))
- {
- sound (self, CHAN_VOICE, "player_f/land2.wav", 1, ATTN_NORM);
- }
- else
- {
- if (((self.sex == 3) && (temp1 & TEMP1_PLAYER3SOUNDS)))
- {
- sound (self, CHAN_VOICE, "player3/land2.wav", 1, ATTN_NORM);
- }
- else
- {
- if (((self.sex == 4) && (temp1 & TEMP1_PLAYER4SOUNDS)))
- {
- sound (self, CHAN_VOICE, "player4/land2.wav", 1, ATTN_NORM);
- }
- else
- {
- sound (self, CHAN_VOICE, "player/land2.wav", 1, ATTN_NORM);
- }
- }
- }
- self.deathtype = "falling";
- }
- else
- {
- if (((self.sex == 2) && (temp1 & TEMP1_PLAYER2SOUNDS)))
- {
- sound (self, CHAN_VOICE, "player_f/land.wav", 1, ATTN_NORM);
- }
- else
- {
- if (((self.sex == 3) && (temp1 & TEMP1_PLAYER3SOUNDS)))
- {
- sound (self, CHAN_VOICE, "player3/land.wav", 1, ATTN_NORM);
- }
- else
- {
- if (((self.sex == 4) && (temp1 & TEMP1_PLAYER4SOUNDS)))
- {
- sound (self, CHAN_VOICE, "player4/land.wav", 1, ATTN_NORM);
- }
- else
- {
- sound (self, CHAN_VOICE, "player/land.wav", 1, ATTN_NORM);
- }
- }
- }
- }
- }
- self.jump_flag = 0;
- }
- if (!(self.flags & FL_ONGROUND))
- {
- self.jump_flag = self.velocity_z;
- }
- if ((deathmatch & DM_FIXED_FOV))
- {
- stuffcmd (self, "fov 90\n");
- }
- CheckPowerups ();
- playerfootstep();
- if ((time > teamScorePrintTime))
- {
- TeamCaptureCheckUpdate ();
- PrintCTFScore ();
- teamScorePrintTime = (time + 45);
- }
- if (((!self.observer && (self.velocity == VEC_ORIGIN)) && !self.button0))
- {
- makevectors (self.v_angle);
- traceline ((self.origin + '0 0 16'), ((self.origin + '0 0 16') + (v_forward * TEAM_CAPTURE_CTFBOT_ADMIN)), FALSE, self);
- if ((trace_ent.flags & FL_CLIENT || clienttype(trace_ent) == CLIENTTYPE_BOT))
- {
- if (!trace_ent.invisible_finished)
- {
- if ((trace_ent.waterlevel <= 2))
- {
- if ((trace_ent.team == self.team))
- {
- l = "TEAM-MATE‘……";
- }
- else
- {
- l = "……ÅÎÅÍÙ¡¡œœ ";
- }
- centerprint2 (self, l, trace_ent.netname);
- }
- }
- }
- }
- }
- };
- void () ClientConnect =
- {
- /*
- if (total_clients == fMaxClients )
- {
- local entity bot;
- local float sp;
- bot = find (world, classname, "bot");
- sp = bot.fClientNo;
- localcmd ("echo ");
- localcmd (bot.netname);
- botInvalidClientNo (sp);
- localcmd (" invalid Clientno: ");
- localcmd (ftos(sp));
- localcmd ("Called...\n");
- }
- */
- self.fClientNo = (self.colormap - 1);
- botInvalidClientNo (self.fClientNo);
- localcmd ("echo ClientConnect() \n");
- localcmd ("echo ");
- localcmd (self.netname);
- localcmd (" Assigned fClientNo: ");
- localcmd (ftos(self.fClientNo));
- localcmd ("\n\n");
- clientSetUsed (self.fClientNo);
- localcmd ("echo ClientConnect() \n");
- localcmd ("echo Total Active clients: ");
- localcmd (ftos(total_clients));
- localcmd ("\n\n");
- if (clienttype(self) == CLIENTTYPE_REAL)
- {
- self.cshift = time + 126; // Fade to blk
- //msg_entity = self;
- //WriteByte (MSG_ONE, SVC_FINALE);
- self.gtimer = 2;
- self.crosshairtype =1;
- self.crosshair = 1;
- self.reserve = 2;
- self.nextjump = 0;
- self.timing = (time + 5);
- self.repeat = 0;
- LogMsg (self, "CONNECT");
- sound (self, CHAN_BODY, "wizard/wsight.wav", 1, ATTN_NONE);
- self.motd_count = 1;
- stuffcmd (self, "chase_active 0\n");
- stuffcmd (self, "rate 65536\n");
- stuffcmd (self, "+speed\n");
- localcmd ("status\n");
- self.suicide_count = 0;
- self.killed = 0;
- self.frags = 0;
- self.statstate = 0;
- self.aflag = 0;
- self.num_kills = 0;
- self.num_deaths = 0;
- self.num_suicides = 0;
- self.num_captures = 0;
- self.num_pickups = 0;
- self.num_recovery = 0;
- self.num_assists = 0;
- self.num_bonus = 0;
- /*
- bot = find (world, classname, "bot");
- while (bot)
- {
- msgUpdateNameToPlayer (self, bot.fClientNo, bot.netname);
- msgUpdateColorsToPlayer (self, bot.fClientNo, bot.fShirt, bot.fPants);
- msgUpdateFragsToPlayer (self, bot.fClientNo, bot.frags);
- bot = find (bot, classname, "bot");
- }
- */
- // lastteam and motdvount
- if ((((parm10 < 0) && (teamplay > 0)) && (parm11 != -1)))
- {
- self.lastteam = -50;
- self.team = -1;
- if ((teamplay & TEAM_CAPTURE_SELECT_TEAM))
- self.do_observer = 1;
- else
- {
- if (!self.do_observer)
- {
- TeamCheckLock ();
- self.player_flag = (self.player_flag | 32);
- if ((teamplay & TEAM_CAPTURE_CUSTOM))
- {
- if ((self.lastteam == TEAM_COLOR1))
- self.skin = 1;
- else
- self.skin = 3;
- if ((random () < 0.5))
- self.skin = (self.skin + 1);
- self.player_flag = (self.player_flag - (self.player_flag & 65280));
- self.player_flag = (self.player_flag | (self.skin * DM_INFINITE_AMMO));
- }
- }
- }
- }
- /*
- WriteByte(MSG_ALL, 8);
- WriteByte(MSG_ALL, 1);
- WriteString(MSG_ALL, self.netname);
- WriteByte(MSG_ALL, 8);
- WriteByte(MSG_ALL, 2);
- WriteString(MSG_ALL, " entered the game\n");
- */
- bprint (self.netname);
- bprint (" entered the game\n");
- if (intermission_running)
- {
- preMOTD ();
- ExitIntermission ();
- }
- }
- if (clienttype(self) == CLIENTTYPE_BOT)
- sound (world, CHAN_BODY, "doors/baseuse.wav", 1, ATTN_NORM);
- };
- void () ClientDisconnect =
- {
- if (gameover)
- return;
- if (self.aflag)
- {
- YCam ();
- }
- if ((self.classname == "player"))
- {
- set_suicide_frame ();
- clientSetFree (self.fClientNo);
- stuffcmd (self, "v_cshift 0 0 0 \n");
- }
- bprint (self.netname);
- bprint (" left the game with ");
- bprint (ftos (self.frags));
- bprint (" frags\n");
- self.health = 0;
- if (((self.sex == 2) && (temp1 & TEMP1_PLAYER2SOUNDS)))
- {
- sound (self, CHAN_BODY, "player_f/tornoff2.wav", 1, ATTN_NONE);
- }
- else
- {
- if (((self.sex == 3) && (temp1 & TEMP1_PLAYER3SOUNDS)))
- {
- sound (self, CHAN_BODY, "player3/tornoff2.wav", 1, ATTN_NONE);
- }
- else
- {
- if (((self.sex == 4) && (temp1 & TEMP1_PLAYER4SOUNDS)))
- {
- sound (self, CHAN_BODY, "player4/tornoff2.wav", 1, ATTN_NONE);
- }
- else
- {
- sound (self, CHAN_BODY, "player/tornoff2.wav", 1, ATTN_NONE);
- }
- }
- }
- DropRune ();
- TeamCaptureDropFlagOfPlayer (self);
- self.reserve = 0;
- self.lastteam = -50;
- self.team = -50;
- self.frags = 0;
- self.effects = 0;
- self.statstate = 0;
- CamPlayerDisconnect ();
- if ((self.classname == "bot" && self.fClientNo != -1))
- {
- self.nextthink = -1;
- msgUpdateNameToAll (self.fClientNo, string_null);
- msgUpdateColorsToAll (self.fClientNo, 0, 0);
- msgUpdateFragsToAll (self.fClientNo, 0);
- self.fClientNo = -1;
- //self.flags = self.flags - FL_CLIENT;
- }
- LogMsg (self, "DISCONNECT");
- /*
- if (((temp1 & TEMP1_AUTO_EVEN_TEAMS) && (self.CamState == 0)))
- {
- BotKeepTeamsEven ();
- }
- */
- };
- void (entity targ, entity attacker) ClientObituary =
- {
- local entity head;
- local float flag_radius;
- local float flag_carrier_radius;
- local string st;
- local float rnum;
- local string deathstring;
- local string deathstring2;
- local string what;
- local string s;
- local string rn;
- if (intermission_running)
- {
- return;
- }
- rnum = random ();
- if (((targ.classname == "player") || (targ.classname == "bot")))
- {
- if ((targ.player_flag & ITEM_ENEMY_FLAG))
- {
- head = find (world, classname, "player");
- while ((head != world))
- {
- if ((head.team != targ.team))
- {
- head.last_hurt_carrier = -10;
- }
- head = FindNextPlayerOrBot (head);
- }
- }
- if ((((attacker.classname == "player") && (targ.health < -40)) || (attacker.health < 0)))
- {
- if ((attacker.health < 0))
- {
- centerprint (attacker, "Whoops....\n");
- }
- else
- {
- centerprint (attacker, "DECIMATION!");
- }
- }
- if ((attacker.classname == "mine"))
- {
- if ((targ == attacker.owner))
- {
- bprint (attacker.owner.netname);
- if (attacker.owner.sex == 2)
- bprint (" detonates herself.\n ");
- else
- bprint (" detonates himself.\n ");
- UpdateClientFrags (attacker.owner, -1);
- return;
- }
- bprint (targ.netname);
- bprint (" Gets too close to ");
- bprint (attacker.owner.netname);
- bprint ("'s Proximity mine.\n");
- if ((targ.team == attacker.owner.team))
- {
- return;
- }
- UpdateClientFrags (attacker.owner, 1);
- targ.num_deaths = (targ.num_deaths + 1);
- return;
- }
- if ((attacker.classname == "teledeath"))
- {
- bprint (targ.netname);
- bprint (" was telefragged by ");
- bprint (attacker.owner.netname);
- bprint ("\n");
- if ((targ.team != attacker.owner.team))
- {
- UpdateClientFrags (attacker.owner, 1);
- }
- LogPlayerDMDeath (targ, attacker.owner, "telefrag");
- targ.num_deaths = (targ.num_deaths + 1);
- attacker.owner.num_kills = (attacker.owner.num_kills + 1);
- return;
- }
- if ((attacker.classname == "teledeath2"))
- {
- bprint ("Satan's power deflects ");
- bprint (targ.netname);
- bprint ("'s telefrag\n");
- UpdateClientFrags (targ, -1);
- LogPlayerDeath (targ, "telefrag");
- targ.num_deaths = (targ.num_deaths + 1);
- attacker.owner.num_kills = (attacker.owner.num_kills + 1);
- return;
- }
- if (((attacker.classname == "player") || (attacker.classname == "bot")))
- {
- if ((targ == attacker))
- {
- UpdateClientFrags (attacker, -1);
- bprint (targ.netname);
- if (((targ.weapon == TEAM_STATIC_TEAMS) && (targ.waterlevel > 1)))
- {
- targ.deathtype = "discharge";
- bprint (" discharges into the water.\n");
- LogPlayerDeath (targ, "discharge");
- if (targ.classname == "player")
- {
- targ.punchangle = targ.velocity - targ.angles;
- targ.staydeadtime = ((time + 3) + (random () * 9));
- ThrowGib ("progs/v_light.mdl", (self.health * -2.5));
- }
- return;
- }
- if ((targ.weapon == IT_GRENADE_LAUNCHER))
- {
- bprint (" tries to put the pin back in\n");
- LogPlayerDeath (targ, "grenade");
- }
- else
- {
- if ((targ.team != targ.lastteam))
- {
- if ((teamplay & TEAM_STATIC_TEAMS))
- {
- bprint (" tried to change teams\n");
- }
- else
- {
- bprint (" changed teams\n");
- }
- LogPlayerDeath (targ, "teamchange");
- }
- else
- {
- bprint (" becomes bored with life\n");
- LogPlayerDeath (targ, "rocket");
- }
- }
- targ.num_deaths = (targ.num_deaths + 1);
- targ.num_suicides = (targ.num_suicides + 1);
- return;
- }
- else
- {
- if (((targ.team > 0) && (targ.team == attacker.team)))
- {
- if ((rnum < 0.25))
- {
- deathstring = " mows down a teammate\n";
- }
- else
- {
- if ((rnum < 0.5))
- {
- deathstring = " checks his glasses\n";
- }
- else
- {
- if ((rnum < 0.75))
- {
- deathstring = " gets a frag for the other team\n";
- }
- else
- {
- deathstring = " loses another friend\n";
- }
- }
- }
- bprint (attacker.netname);
- bprint (deathstring);
- UpdateClientFrags (attacker, -1);
- targ.num_deaths = (targ.num_deaths + 1);
- return;
- }
- else
- {
- if (!TeamFragPenalty (targ, attacker))
- {
- UpdateClientFrags (attacker, 1);
- if (((targ.player_flag & ITEM_ENEMY_FLAG) && (targ.team != attacker.team)))
- {
- attacker.last_fragged_carrier = time;
- if ((TEAM_CAPTURE_FRAG_CARRIER_BONUS > 0))
- {
- if (((targ.flag_since + TEAM_CAPTURE_CARRIER_FLAG_SINCE_TIMEOUT) > time))
- {
- if ((attacker.classname == "player"))
- {
- sprint (attacker, "Flag carrier killed, no bonus\n");
- }
- }
- else
- {
- UpdateClientFrags (attacker, TEAM_CAPTURE_FRAG_CARRIER_BONUS);
- if ((attacker.classname == "player"))
- {
- sprint (attacker, "Flag carrier killed: ");
- }
- s = ftos (TEAM_CAPTURE_FRAG_CARRIER_BONUS);
- if ((attacker.classname == "player"))
- {
- sprint (attacker, s);
- }
- if ((attacker.classname == "player"))
- {
- sprint (attacker, " bonus frags\n");
- }
- attacker.num_bonus = (attacker.num_bonus + 1);
- }
- }
- }
- flag_radius = 0;
- flag_carrier_radius = 0;
- s = GetTeamName (attacker.team);
- if ((((targ.last_hurt_carrier + TEAM_CAPTURE_CARRIER_DANGER_PROTECT_TIMEOUT) > time) && !(attacker.player_flag & ITEM_ENEMY_FLAG)))
- {
- UpdateClientFrags (attacker, TEAM_CAPTURE_CARRIER_DANGER_PROTECT_BONUS);
- flag_carrier_radius = 1;
- bprint (attacker.netname);
- bprint (" defends ");
- bprint (s);
- bprint ("'s flag carrier against an agressive enemy\n");
- attacker.num_bonus = (attacker.num_bonus + 1);
- }
- head = findradius (attacker.origin, TEAM_CAPTURE_ATTACKER_PROTECT_RADIUS);
- while (head)
- {
- if ((head.classname == "player"))
- {
- if (((((head.team == attacker.team) && (head.player_flag & ITEM_ENEMY_FLAG)) && (head != attacker)) && !flag_carrier_radius))
- {
- UpdateClientFrags (attacker, TEAM_CAPTURE_CARRIER_PROTECT_BONUS);
- flag_carrier_radius = 1;
- bprint (attacker.netname);
- bprint (" defends ");
- bprint (s);
- bprint ("'s flag carrier\n");
- attacker.num_bonus = (attacker.num_bonus + 1);
- }
- }
- if (((head.classname == "item_flag_team1") || (head.classname == "item_flag_team2")))
- {
- if ((((attacker.team == TEAM_COLOR1) && (head.classname == "item_flag_team1")) || ((attacker.team == TEAM_COLOR2) && (head.classname == "item_flag_team2"))))
- {
- UpdateClientFrags (attacker, TEAM_CAPTURE_FLAG_DEFENSE_BONUS);
- flag_radius = 1;
- bprint (attacker.netname);
- bprint (" defends the ");
- bprint (s);
- bprint (" flag\n");
- sound (self, CHAN_AUTO, "misc/basekey.wav", 1, ATTN_IDLE);
- attacker.num_bonus = (attacker.num_bonus + 1);
- }
- }
- head = head.chain;
- }
- head = findradius (targ.origin, TEAM_CAPTURE_TARGET_PROTECT_RADIUS);
- while (head)
- {
- if ((head.classname == "player"))
- {
- if (((((head.team == attacker.team) && (head.player_flag & ITEM_ENEMY_FLAG)) && (head != attacker)) && !flag_carrier_radius))
- {
- UpdateClientFrags (attacker, TEAM_CAPTURE_CARRIER_PROTECT_BONUS);
- flag_carrier_radius = 1;
- bprint (attacker.netname);
- bprint (" defends ");
- bprint (s);
- bprint ("'s flag carrier\n");
- attacker.num_bonus = (attacker.num_bonus + 1);
- }
- }
- if (((((attacker.team == TEAM_COLOR1) && (head.classname == "item_flag_team1")) || ((attacker.team == TEAM_COLOR2) && (head.classname == "item_flag_team2"))) && !flag_radius))
- {
- UpdateClientFrags (attacker, TEAM_CAPTURE_FLAG_DEFENSE_BONUS);
- flag_radius = 1;
- bprint (attacker.netname);
- bprint (" defends the ");
- bprint (s);
- bprint (" flag\n");
- attacker.num_bonus = (attacker.num_bonus + 1);
- }
- head = head.chain;
- }
- }
- TeamDeathPenalty (targ, attacker);
- rn = targ.deathtype;
- if (((rn == "blaze") || (rn == "burnt")))
- {
- if (rn == "blaze")
- {
- deathstring = " was Torched by ";
- deathstring2 = "'s Blaze Gun\n";
- }
- if (rn == "burnt")
- {
- deathstring = " Was Roasted with ";
- deathstring2 = "'s Blaze Gun\n";
- }
- what = "lightning";
- }
- if (((rn == "lightning") || (rn == "discharge")))
- {
- if ((attacker.items & IT_QUAD))
- {
- deathstring = " was touched by ";
- deathstring2 = "'s Quad lightning\n";
- }
- else
- {
- deathstring = " accepts ";
- if ((rn == "discharge"))
- {
- deathstring2 = "'s discharge\n";
- }
- else
- {
- deathstring2 = "'s shaft\n";
- }
- }
- what = "lightning";
- }
- if ((rn == "ax"))
- {
- deathstring = " was ax-murdered by ";
- deathstring2 = "\n";
- what = "axe";
- }
- if ((rn == "grapple"))
- {
- if ((random () < 0.5))
- {
- deathstring = " was disembowled by ";
- }
- else
- {
- deathstring = " was hooked by ";
- }
- deathstring2 = "\n";
- what = "hook";
- }
- if ((rn == "shotgun"))
- {
- deathstring = " chewed on ";
- deathstring2 = "'s boomstick\n";
- what = "shotgun";
- }
- if ((rn == "sshotgun"))
- {
- deathstring = " ate 2 loads of ";
- if ((targ.health < -40))
- {
- deathstring = " ate a box of ";
- }
- deathstring2 = "'s buckshot\n";
- what = "supershotgun";
- }
- if ((rn == "spike"))
- {
- deathstring = " was nailed by ";
- deathstring2 = "\n";
- what = "nailgun";
- }
- if ((rn == "sspike"))
- {
- deathstring = " was punctured by ";
- deathstring2 = "\n";
- what = "supernailgun";
- }
- if ((rn == "grenade"))
- {
- deathstring = " eats ";
- deathstring2 = "'s pineapple\n";
- if ((targ.health < -40))
- {
- deathstring = " was gibbed by ";
- deathstring2 = "'s grenade\n";
- }
- what = "grenade";
- }
- if ((rn == "rocket"))
- {
- if ((attacker.items & IT_QUAD))
- {
- deathstring = " was destroyed by ";
- deathstring2 = "'s Quad rocket\n";
- }
- else
- {
- deathstring = " rides ";
- deathstring2 = "'s rocket\n";
- if ((targ.health < -40))
- {
- deathstring = " inhales ";
- deathstring2 = "'s rocket\n";
- }
- }
- what = "rocket";
- }
- bprint (targ.netname);
- if (((targ.classname == "bot") && !bots_have_normal_names))
- {
- st = ftos (targ.bot_skill);
- bprint (" [skill ");
- bprint (st);
- bprint ("]");
- }
- bprint (deathstring);
- bprint (attacker.netname);
- if (((attacker.classname == "bot") && !bots_have_normal_names))
- {
- st = ftos (attacker.bot_skill);
- bprint (" [skill ");
- bprint (st);
- bprint ("]");
- }
- bprint (deathstring2);
- LogPlayerDMDeath (targ, attacker, what);
- targ.num_deaths = (targ.num_deaths + 1);
- attacker.num_kills = (attacker.num_kills + 1);
- if ((((targ.classname == "player") || (targ.classname == "bot")) && (attacker.classname == "bot")))
- {
- attacker.last_kill_time = time;
- attacker.last_kill_ent = targ;
- }
- if (((targ.classname == "bot") && (attacker.classname == "player")))
- {
- targ.last_die_time = time;
- targ.last_die_ent = attacker;
- }
- }
- }
- return;
- }
- else
- {
- UpdateClientFrags (targ, -1);
- targ.num_deaths = (targ.num_deaths + 1);
- bprint (targ.netname);
- if ((attacker.flags & FL_MONSTER))
- {
- return;
- }
- if ((attacker.classname == "electro"))
- {
- if ((self.weapon == IT_HOOK))
- {
- bprint (" Provided a path to Ground.\n");
- }
- else
- {
- bprint (" Got fried in an Electrical field..\n");
- }
- LogPlayerDeath (targ, "melted");
- return;
- }
- if ((attacker.classname == "light_torch_small_walltorch"))
- {
- if (targ.sex == 2)
- bprint (" ignited herself\n ");
- else
- bprint (" ignited himself\n ");
- LogPlayerDeath (targ, "melted");
- return;
- }
- if ((attacker.classname == "explo_box"))
- {
- bprint (" blew up\n");
- LogPlayerDeath (targ, "explosion");
- return;
- }
- if (((attacker.solid == SOLID_BSP) && (attacker != world)))
- {
- bprint (" was squished\n");
- LogPlayerDeath (targ, "squished");
- return;
- }
- if (((attacker.classname == "trap_shooter") || (attacker.classname == "trap_spikeshooter")))
- {
- if ((attacker.spawnflags & 2))
- {
- bprint (" got zapped\n");
- }
- else
- {
- bprint (" was spiked\n");
- }
- LogPlayerDeath (targ, "spiked");
- return;
- }
- if ((attacker.classname == "fireball"))
- {
- bprint (" ate a lavaball\n");
- LogPlayerDeath (targ, "fireball");
- return;
- }
- if ((attacker.classname == "trigger_changelevel"))
- {
- bprint (" tried to leave\n");
- LogPlayerDeath (targ, "noexit");
- return;
- }
- rnum = targ.watertype;
- if ((rnum == CONTENT_WATER))
- {
- if ((random () < 0.5))
- {
- bprint (" sleeps with the fishes\n");
- }
- else
- {
- bprint (" sucks it down\n");
- }
- LogPlayerDeath (targ, "drowned");
- return;
- }
- else
- {
- if ((rnum == CONTENT_SLIME))
- {
- if ((random () < 0.5))
- {
- bprint (" Suffocated on his own vomit\n");
- }
- else
- {
- bprint (" can't exist on slime alone\n");
- }
- LogPlayerDeath (targ, "slimed");
- return;
- }
- else
- {
- if ((rnum == CONTENT_LAVA))
- {
- if ((targ.health < -15))
- {
- bprint (" burst into flames\n");
- LogPlayerDeath (targ, "melted");
- return;
- }
- if ((random () < 0.5))
- {
- bprint (" turned into hot slag\n");
- }
- else
- {
- bprint (" visits the Volcano God\n");
- }
- LogPlayerDeath (targ, "melted");
- return;
- }
- }
- }
- if ((targ.deathtype == "falling"))
- {
- targ.deathtype = "";
- bprint (" fell and couldnt get up\n");
- LogPlayerDeath (targ, "falling");
- return;
- }
- LogPlayerDeath (targ, " died");
- bprint (" died\n");
- }
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement