game-source/ctf/qwsrc/world.qc

270 lines
7.9 KiB
C++
Raw Normal View History

/*
2003-03-03 19:17:04 +00:00
world.qc
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to:
Free Software Foundation, Inc.
59 Temple Place - Suite 330
Boston, MA 02111-1307, USA
$Id$
*/
2003-03-03 19:17:04 +00:00
void() InitBodyQueue;
entity lastspawn;
/*QUAKED worldspawn (0 0 0) ?
Only used for the world entity.
Set message to the level name.
Set sounds to the cd track to play.
World Types:
0: medieval
1: metal
2: base
*/
2003-03-03 19:17:04 +00:00
void ()
worldspawn =
{
lastspawn = world;
runespawn = world;
runespawned = 0;
2003-03-03 19:17:04 +00:00
InitBodyQueue ();
2003-03-03 19:17:04 +00:00
// custom map attributes
2003-03-03 19:17:04 +00:00
// can't change gravity in QuakeWorld
/*
if (self.model == "maps/e1m8.bsp")
cvar_set ("sv_gravity", "100");
else
cvar_set ("sv_gravity", "800");
*/
if (self.model == "maps/ctfstart.bsp" || self.model == "maps/start.bsp")
gamestart = 1;
else
gamestart = 0;
2003-03-03 19:17:04 +00:00
// the area based ambient sounds MUST be the first precache_sounds
2003-03-03 19:17:04 +00:00
// player precaches
W_Precache (); // get weapon precaches
2003-03-03 19:17:04 +00:00
// sounds used from C physics code
precache_sound ("demon/dland2.wav"); // landing thud
precache_sound ("misc/h2ohit1.wav"); // landing splash
2003-03-03 19:17:04 +00:00
// setup precaches allways needed
precache_sound ("items/itembk2.wav"); // item respawn sound
precache_sound ("player/plyrjmp8.wav"); // player jump
precache_sound ("player/land.wav"); // player landing
precache_sound ("player/land2.wav"); // player hurt landing
precache_sound ("player/drown1.wav"); // drowning pain
precache_sound ("player/drown2.wav"); // drowning pain
precache_sound ("player/gasp1.wav"); // gasping for air
precache_sound ("player/gasp2.wav"); // taking breath
precache_sound ("player/h2odeath.wav"); // drowning death
precache_sound ("misc/talk.wav"); // talk
precache_sound ("player/teledth1.wav"); // telefrag
precache_sound ("misc/r_tele1.wav"); // teleport sounds
precache_sound ("misc/r_tele2.wav");
precache_sound ("misc/r_tele3.wav");
precache_sound ("misc/r_tele4.wav");
precache_sound ("misc/r_tele5.wav");
precache_sound ("weapons/lock4.wav"); // ammo pick up
precache_sound ("weapons/pkup.wav"); // weapon up
precache_sound ("items/armor1.wav"); // armor up
2003-03-03 19:17:04 +00:00
precache_sound ("weapons/lhit.wav"); // lightning
precache_sound ("weapons/lstart.wav"); // lightning start
precache_sound ("items/damage3.wav");
2003-03-03 19:17:04 +00:00
precache_sound ("misc/power.wav"); // lightning for boss
2003-03-03 19:17:04 +00:00
// player gib sounds
precache_sound ("player/gib.wav"); // player gib sound
precache_sound ("player/udeath.wav"); // player gib sound
precache_sound ("player/tornoff2.wav"); // gib sound
2003-03-03 19:17:04 +00:00
// player pain sounds
precache_sound ("player/pain1.wav");
precache_sound ("player/pain2.wav");
precache_sound ("player/pain3.wav");
precache_sound ("player/pain4.wav");
precache_sound ("player/pain5.wav");
precache_sound ("player/pain6.wav");
2003-03-03 19:17:04 +00:00
// player death sounds
precache_sound ("player/death1.wav");
precache_sound ("player/death2.wav");
precache_sound ("player/death3.wav");
precache_sound ("player/death4.wav");
precache_sound ("player/death5.wav");
2003-03-03 19:17:04 +00:00
// ax sounds
precache_sound ("weapons/ax1.wav"); // ax swoosh
precache_sound ("player/axhit1.wav"); // ax hit meat
precache_sound ("player/axhit2.wav"); // ax hit world
precache_sound ("hknight/hit.wav"); // ZOID: hook launch
precache_sound ("player/h2ojump.wav"); // player jumping into water
precache_sound ("player/slimbrn2.wav"); // player enter slime
precache_sound ("player/inh2o.wav"); // player enter water
precache_sound ("player/inlava.wav"); // player enter lava
precache_sound ("misc/outwater.wav"); // leaving water sound
precache_sound ("player/lburn1.wav"); // lava burn
precache_sound ("player/lburn2.wav"); // lava burn
precache_sound ("misc/water1.wav"); // swimming
precache_sound ("misc/water2.wav"); // swimming
precache_model ("progs/player.mdl");
precache_model ("progs/h_player.mdl");
precache_model ("progs/eyes.mdl");
precache_model ("progs/gib1.mdl");
precache_model ("progs/gib2.mdl");
precache_model ("progs/gib3.mdl");
precache_model ("progs/s_bubble.spr"); // drowning bubbles
precache_model ("progs/s_explod.spr"); // sprite explosion
precache_model ("progs/v_axe.mdl");
precache_model ("progs/v_shot.mdl");
precache_model ("progs/v_nail.mdl");
precache_model ("progs/v_rock.mdl");
precache_model ("progs/v_shot2.mdl");
precache_model ("progs/v_nail2.mdl");
2003-03-03 19:17:04 +00:00
precache_model ("progs/v_rock2.mdl");
precache_model ("progs/v_star.mdl"); // precache grapple (Wedge)
precache_model ("progs/bit.mdl"); // precache grapple (Wedge)
precache_model ("progs/star.mdl"); // precache grapple (Wedge)
2003-03-03 19:17:04 +00:00
precache_model ("progs/bolt.mdl"); // for lightning gun
precache_model ("progs/bolt2.mdl"); // for lightning gun
precache_model ("progs/bolt3.mdl"); // for boss shock
precache_model ("progs/lavaball.mdl"); // for testing
2003-08-27 23:43:13 +00:00
precache_model ("progs/missile.mdl");
precache_model ("progs/grenade.mdl");
precache_model ("progs/spike.mdl");
precache_model ("progs/s_spike.mdl");
precache_model ("progs/backpack.mdl");
precache_model ("progs/zom_gib.mdl");
precache_model ("progs/v_light.mdl");
2003-03-03 19:17:04 +00:00
// Setup light animation tables. 'a' is total darkness, 'z' is maxbright.
// 0 normal
2003-03-03 19:17:04 +00:00
lightstyle (0, "m");
2003-08-27 23:43:13 +00:00
// 1 FLICKER (first variety)
2003-03-03 19:17:04 +00:00
lightstyle (1, "mmnmmommommnonmmonqnmmo");
2003-08-27 23:43:13 +00:00
// 2 SLOW STRONG PULSE
2003-03-03 19:17:04 +00:00
lightstyle (2, "abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba");
2003-08-27 23:43:13 +00:00
// 3 CANDLE (first variety)
2003-03-03 19:17:04 +00:00
lightstyle (3, "mmmmmaaaaammmmmaaaaaabcdefgabcdefg");
2003-08-27 23:43:13 +00:00
// 4 FAST STROBE
2003-03-03 19:17:04 +00:00
lightstyle (4, "mamamamamama");
2003-08-27 23:43:13 +00:00
// 5 GENTLE PULSE 1
2003-03-03 19:17:04 +00:00
lightstyle (5,"jklmnopqrstuvwxyzyxwvutsrqponmlkj");
2003-08-27 23:43:13 +00:00
// 6 FLICKER (second variety)
2003-03-03 19:17:04 +00:00
lightstyle (6, "nmonqnmomnmomomno");
2003-08-27 23:43:13 +00:00
// 7 CANDLE (second variety)
2003-03-03 19:17:04 +00:00
lightstyle (7, "mmmaaaabcdefgmmmmaaaammmaamm");
2003-08-27 23:43:13 +00:00
// 8 CANDLE (third variety)
2003-03-03 19:17:04 +00:00
lightstyle (8, "mmmaaammmaaammmabcdefaaaammmmabcdefmmmaaaa");
2003-08-27 23:43:13 +00:00
// 9 SLOW STROBE (fourth variety)
2003-03-03 19:17:04 +00:00
lightstyle (9, "aaaaaaaazzzzzzzz");
2003-08-27 23:43:13 +00:00
// 10 FLUORESCENT FLICKER
2003-03-03 19:17:04 +00:00
lightstyle (10, "mmamammmmammamamaaamammma");
// 11 SLOW PULSE NOT FADE TO BLACK
2003-03-03 19:17:04 +00:00
lightstyle (11, "abcdefghijklmnopqrrqponmlkjihgfedcba");
2003-08-27 23:43:13 +00:00
// styles 32-62 are assigned by the light program for switchable lights
// 63 testing
2003-03-03 19:17:04 +00:00
lightstyle (63, "a");
};
2003-03-03 19:17:04 +00:00
void ()
StartFrame =
{
timelimit = cvar("timelimit") * 60;
fraglimit = cvar("fraglimit");
teamplay = cvar("teamplay");
deathmatch = cvar("deathmatch");
2003-08-27 23:43:13 +00:00
framecount = framecount + 1;
};
2003-03-03 19:17:04 +00:00
// BODY QUEUE =================================================================
2003-03-03 19:17:04 +00:00
entity bodyqueue_head;
2003-03-03 19:17:04 +00:00
void ()
bodyqeuue =
{
// here so spawn functions don't complain after the world creates bodyqueues
};
2003-03-03 19:17:04 +00:00
void ()
InitBodyQueue =
{
2003-03-03 19:17:04 +00:00
bodyqueue_head = spawn ();
bodyqueue_head.classname = "bodyqueue";
bodyqueue_head.owner = spawn ();
bodyqueue_head.owner.classname = "bodyqueue";
bodyqueue_head.owner.owner = spawn ();
bodyqueue_head.owner.owner.classname = "bodyqueue";
bodyqueue_head.owner.owner.owner = spawn ();
bodyqueue_head.owner.owner.owner.classname = "bodyqueue";
bodyqueue_head.owner.owner.owner.owner = bodyqueue_head;
};
// make a body que entry for the given ent so the ent can be
// respawned elsewhere
2003-03-03 19:17:04 +00:00
void (entity ent)
CopyToBodyQueue =
{
2003-03-03 19:17:04 +00:00
bodyqueue_head.skin = ent.skin;
bodyqueue_head.angles = ent.angles;
bodyqueue_head.model = ent.model;
bodyqueue_head.modelindex = ent.modelindex;
bodyqueue_head.frame = ent.frame;
bodyqueue_head.colormap = ent.colormap;
bodyqueue_head.movetype = ent.movetype;
bodyqueue_head.velocity = ent.velocity;
bodyqueue_head.flags = 0;
setorigin (bodyqueue_head, ent.origin);
setsize (bodyqueue_head, ent.mins, ent.maxs);
bodyqueue_head = bodyqueue_head.owner;
};