2007-09-02 22:00:00 +02:00
|
|
|
/*
|
|
|
|
+----+
|
|
|
|
|Main|
|
|
|
|
+----+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
|
|
|
|
| Scratch Http://www.admdev.com/scratch |
|
|
|
|
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
|
|
|
|
| Contains some 'base' subroutines. As a general rule nothing in this file |
|
|
|
|
| does much, except to setup basic variables and entities. |
|
|
|
|
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
|
|
|
|
*/
|
|
|
|
|
|
|
|
//INCLUDES;
|
|
|
|
|
|
|
|
void() LightStyles_setup; // Entities/Lights.QC
|
|
|
|
void() precaches;
|
|
|
|
|
|
|
|
//END INCLUDES;
|
|
|
|
|
|
|
|
void() main = {};
|
|
|
|
|
|
|
|
/*
|
|
|
|
================
|
|
|
|
|SETNEWPARMS():|
|
|
|
|
=================================================================================
|
|
|
|
Description:
|
|
|
|
This function is called to set up new player info.
|
|
|
|
=================================================================================
|
|
|
|
*/
|
|
|
|
|
|
|
|
void() SetNewParms = //Sets up start game parms
|
|
|
|
{
|
2007-09-16 22:00:00 +02:00
|
|
|
pev->items = 10;
|
|
|
|
pev->health = 100;
|
2007-09-02 22:00:00 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
==================
|
|
|
|
|SETCHANGEPARMS():|
|
|
|
|
=================================================================================
|
|
|
|
Description:
|
|
|
|
|
|
|
|
This function is called when the player hits a change level. Stores player info for
|
|
|
|
loading upon next level.
|
|
|
|
=================================================================================
|
|
|
|
*/
|
|
|
|
|
|
|
|
void() SetChangeParms = //called on changelevel; command
|
|
|
|
{
|
2007-09-16 22:00:00 +02:00
|
|
|
if (pev->health <= 0)
|
2007-09-02 22:00:00 +02:00
|
|
|
{
|
|
|
|
SetNewParms();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
==================
|
|
|
|
|GETLEVELPARMS():|
|
|
|
|
=================================================================================
|
|
|
|
Description:
|
|
|
|
|
|
|
|
This function is called by 'PUTCLIENTINSERVER(); in (CLIENT.QC)' and carries over
|
|
|
|
information in between level loads, or sets new parms at start map.
|
|
|
|
|
|
|
|
Information stored in .parms which are the ONLY floats to be stored in memory in
|
|
|
|
between level loads.
|
|
|
|
=================================================================================
|
|
|
|
*/
|
|
|
|
|
|
|
|
void() GetLevelParms =
|
|
|
|
{
|
|
|
|
if (world.model == "maps/start.bsp")
|
|
|
|
SetNewParms (); // take away all stuff on starting new episode
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
void() StartFrame = {};
|
|
|
|
void() EndFrame = {};
|
|
|
|
|
2007-09-05 22:00:00 +02:00
|
|
|
// hud program string
|
|
|
|
string single_statusbar =
|
2007-11-06 22:00:00 +01:00
|
|
|
"yb -24 xv 0 hnum xv 50 x 0 y 0 pic STAT_HEALTH_ICON \
|
|
|
|
if 2 { xv 100 anum xv 150 pic STAT_AMMO_ICON } \
|
2007-09-05 22:00:00 +02:00
|
|
|
if 4 { xv 200 rnum xv 250 pic 4 } \
|
|
|
|
if 6 { xv 296 pic 6 } yb -50 \
|
|
|
|
if 7 { xv 0 pic 7 xv 26 yb -42 stat_string 8 yb -50 } \
|
|
|
|
if 9 { xv 230 num 4 10 xv 296 pic 9 } \
|
|
|
|
if 11 { xv 148 pic 11 } \
|
|
|
|
if 22 { yb -90 xv 128 pic 22 } \
|
|
|
|
if 23 { yv 0 xv 0 pic 23 }";
|
|
|
|
|
2007-09-02 22:00:00 +02:00
|
|
|
/*
|
|
|
|
===============
|
|
|
|
|WORLDSPAWN():|
|
|
|
|
=================================================================================
|
|
|
|
Description:
|
|
|
|
This function is called when the world spawns.
|
|
|
|
=================================================================================
|
|
|
|
*/
|
|
|
|
|
2007-09-05 22:00:00 +02:00
|
|
|
void worldspawn( void )
|
2007-09-02 22:00:00 +02:00
|
|
|
{
|
2007-09-29 22:00:00 +02:00
|
|
|
MsgWarn("world spawned\n");
|
2007-09-02 22:00:00 +02:00
|
|
|
precaches();
|
|
|
|
LightStyles_setup();
|
2007-09-17 22:00:00 +02:00
|
|
|
|
|
|
|
// CS_MAXCLIENTS already sended by engine
|
2007-11-06 22:00:00 +01:00
|
|
|
configstring (CS_STATUSBAR, "Hud_Single" );
|
2007-09-17 22:00:00 +02:00
|
|
|
configstring (CS_SKY, "sky" );
|
2007-11-06 22:00:00 +01:00
|
|
|
configstring (CS_SKYROTATE, ftoa( pev->speed )); // rotate speed
|
2007-09-29 22:00:00 +02:00
|
|
|
configstring (CS_SKYAXIS, vtoa( pev->angles )); // rotate axis
|
2007-09-05 22:00:00 +02:00
|
|
|
}
|
2007-09-02 22:00:00 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
==============
|
|
|
|
|PRECACHES():|
|
|
|
|
=================================================================================
|
|
|
|
Description:
|
|
|
|
Precaches for the game.
|
|
|
|
=================================================================================
|
|
|
|
*/
|
|
|
|
|
|
|
|
void() precaches =
|
|
|
|
{
|
2007-10-19 22:00:00 +02:00
|
|
|
precache_model ("models/player.mdl");
|
|
|
|
precache_model("models/supp1.mdl");
|
2007-09-02 22:00:00 +02:00
|
|
|
|
2007-09-22 22:00:00 +02:00
|
|
|
// pain sounds
|
|
|
|
precache_sound ("player/drown1.wav"); // drowning pain
|
2007-10-19 22:00:00 +02:00
|
|
|
precache_sound ("player/drown2.wav"); // drowning pain
|
2007-09-02 22:00:00 +02:00
|
|
|
precache_sound ("player/lburn1.wav"); // slime/lava burn
|
|
|
|
precache_sound ("player/lburn2.wav"); // slime/lava burn
|
|
|
|
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");
|
|
|
|
|
|
|
|
// death sounds
|
|
|
|
precache_sound ("player/h2odeath.wav"); // drowning death
|
|
|
|
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");
|
|
|
|
};
|