mirror of
https://github.com/nzp-team/quakec.git
synced 2024-11-25 21:31:28 +00:00
HANDHELD/QUAKESPASM: Remove some platform specific stuff, partial merge
of sysdefs.
This commit is contained in:
parent
c3093cd8cf
commit
59a880ce09
27 changed files with 1028 additions and 1321 deletions
|
@ -8,7 +8,7 @@
|
|||
../source/server/defs/custom.qc
|
||||
../source/server/clientfuncs.qc
|
||||
|
||||
../source/server/psp_specifics.qc
|
||||
../source/server/non_fte_specifics.qc
|
||||
|
||||
../source/server/dummies/generic.qc
|
||||
../source/server/rounds.qc
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
../source/server/defs/custom.qc
|
||||
../source/server/clientfuncs.qc
|
||||
|
||||
../source/server/dummies/quakespasm.qc
|
||||
../source/server/non_fte_specifics.qc
|
||||
|
||||
../source/server/dummies/generic.qc
|
||||
../source/server/rounds.qc
|
||||
|
|
|
@ -1107,11 +1107,13 @@ noref void() CSQC_Parse_Event =
|
|||
W_CDUAL[wepnum] = isd;*/
|
||||
break;
|
||||
case EVENT_HUDUPDATE:
|
||||
/*string temps;
|
||||
float tempf;
|
||||
G_HUD = readstring();
|
||||
G_HUDHOR = readbyte();
|
||||
|
||||
if (G_HUD != "")
|
||||
huddir = strcat("gfx/hud/", G_HUD, "/");
|
||||
huddir = strcat("gfx/hud/", G_HUD, "/");*/
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,8 +27,7 @@
|
|||
|
||||
void SetUpdate(entity client, float type, float val1, float val2, float val3)
|
||||
{
|
||||
#ifndef HANDHELD
|
||||
#ifndef QUAKESPASM
|
||||
#ifdef PC
|
||||
|
||||
if (type != 2)
|
||||
{
|
||||
|
@ -51,12 +50,11 @@ void SetUpdate(entity client, float type, float val1, float val2, float val3)
|
|||
WriteByte(MSG_MULTICAST, val3); // misc flags/vars for later if needed
|
||||
multicast('0 0 0', MULTICAST_ALL);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif // PC
|
||||
}
|
||||
|
||||
#ifndef HANDHELD
|
||||
#ifndef QUAKESPASM
|
||||
#ifdef PC
|
||||
void(entity to, float type, float cost, float weapon) useprint = {
|
||||
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
|
||||
WriteByte(MSG_MULTICAST, EVENT_USEPRINT);
|
||||
|
@ -66,42 +64,42 @@ void(entity to, float type, float cost, float weapon) useprint = {
|
|||
msg_entity = to;
|
||||
multicast('0 0 0', MULTICAST_ONE);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // PC
|
||||
|
||||
void(vector org) CallExplosion = {
|
||||
#ifndef PC
|
||||
#ifndef PC
|
||||
|
||||
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
|
||||
WriteByte (MSG_BROADCAST, TE_EXPLOSION);
|
||||
WriteCoord (MSG_BROADCAST, org_x);
|
||||
WriteCoord (MSG_BROADCAST, org_y);
|
||||
WriteCoord (MSG_BROADCAST, org_z);
|
||||
#else
|
||||
|
||||
#else
|
||||
|
||||
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
|
||||
WriteByte(MSG_MULTICAST, EVENT_EXPLOSION);
|
||||
WriteCoord(MSG_MULTICAST, org_x);
|
||||
WriteCoord(MSG_MULTICAST, org_y);
|
||||
WriteCoord(MSG_MULTICAST, org_z);
|
||||
multicast('0 0 0', MULTICAST_ALL);
|
||||
#endif
|
||||
|
||||
#endif // PC
|
||||
}
|
||||
|
||||
void NotifyNewRound(float to) {
|
||||
#ifndef HANDHELD
|
||||
#ifndef QUAKESPASM
|
||||
#ifdef PC
|
||||
|
||||
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
|
||||
WriteByte(MSG_MULTICAST, EVENT_NEWROUND);
|
||||
WriteByte(MSG_MULTICAST, to);
|
||||
multicast('0 0 0', MULTICAST_ALL);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
#endif // PC
|
||||
}
|
||||
|
||||
void SetRound(entity client, float to) {
|
||||
#ifndef HANDHELD
|
||||
#ifndef QUAKESPASM
|
||||
#ifdef PC
|
||||
|
||||
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
|
||||
WriteByte(MSG_MULTICAST, EVENT_SETROUND);
|
||||
|
@ -109,14 +107,12 @@ void SetRound(entity client, float to) {
|
|||
msg_entity = client;
|
||||
multicast('0 0 0', MULTICAST_ONE);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
#endif // PC
|
||||
}
|
||||
|
||||
void SetPerk(entity client, float to)
|
||||
{
|
||||
#ifndef HANDHELD
|
||||
#ifndef QUAKESPASM
|
||||
#ifdef PC
|
||||
|
||||
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
|
||||
WriteByte(MSG_MULTICAST, EVENT_PERK);
|
||||
|
@ -124,14 +120,12 @@ void SetPerk(entity client, float to)
|
|||
msg_entity = client;
|
||||
multicast('0 0 0', MULTICAST_ONE);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
#endif // PC
|
||||
}
|
||||
|
||||
void(float to) SwitchWeapon =
|
||||
{
|
||||
#ifndef HANDHELD
|
||||
#ifndef QUAKESPASM
|
||||
#ifdef PC
|
||||
|
||||
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
|
||||
WriteByte(MSG_MULTICAST, EVENT_WEAPONCHANGE);
|
||||
|
@ -142,14 +136,12 @@ void(float to) SwitchWeapon =
|
|||
// hotfix for weapon2models not reseting
|
||||
self.weapon2model = GetWeapon2Model(to);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
#endif // PC
|
||||
}
|
||||
|
||||
void(string to, float skin) UpdateVmodel =
|
||||
{
|
||||
#ifndef HANDHELD
|
||||
#ifndef QUAKESPASM
|
||||
#ifdef PC
|
||||
|
||||
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
|
||||
WriteByte(MSG_MULTICAST, EVENT_UPDATEVMODEL);
|
||||
|
@ -158,14 +150,12 @@ void(string to, float skin) UpdateVmodel =
|
|||
msg_entity = self;
|
||||
multicast('0 0 0', MULTICAST_ONE);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
#endif // PC
|
||||
}
|
||||
|
||||
void(string to, float skin) UpdateV2model =
|
||||
{
|
||||
#ifndef HANDHELD
|
||||
#ifndef QUAKESPASM
|
||||
#ifdef PC
|
||||
|
||||
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
|
||||
WriteByte(MSG_MULTICAST, EVENT_UPDATEV2MODEL);
|
||||
|
@ -173,27 +163,27 @@ void(string to, float skin) UpdateV2model =
|
|||
WriteByte(MSG_MULTICAST, skin);
|
||||
msg_entity = self;
|
||||
multicast('0 0 0', MULTICAST_ONE);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif // PC
|
||||
}
|
||||
|
||||
void(float index, float state) ChangeReviveIconState =
|
||||
{
|
||||
#ifndef HANDHELD
|
||||
#ifndef QUAKESPASM
|
||||
#ifdef PC
|
||||
|
||||
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
|
||||
WriteByte(MSG_MULTICAST, EVENT_REVIVECHANGE);
|
||||
WriteByte(MSG_MULTICAST, index);
|
||||
WriteByte(MSG_MULTICAST, state);
|
||||
multicast('0 0 0', MULTICAST_ALL);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif // PC
|
||||
}
|
||||
|
||||
void(float index, vector org) EnableReviveIcon =
|
||||
{
|
||||
#ifndef HANDHELD
|
||||
#ifndef QUAKESPASM
|
||||
#ifdef PC
|
||||
|
||||
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
|
||||
WriteByte(MSG_MULTICAST, EVENT_REVIVEON);
|
||||
WriteByte(MSG_MULTICAST, index);
|
||||
|
@ -201,26 +191,26 @@ void(float index, vector org) EnableReviveIcon =
|
|||
WriteCoord(MSG_MULTICAST, org_y);
|
||||
WriteCoord(MSG_MULTICAST, org_z);
|
||||
multicast('0 0 0', MULTICAST_ALL);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif // PC
|
||||
}
|
||||
|
||||
void(float index) DisableReviveIcon =
|
||||
{
|
||||
#ifndef HANDHELD
|
||||
#ifndef QUAKESPASM
|
||||
#ifdef PC
|
||||
|
||||
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
|
||||
WriteByte(MSG_MULTICAST, EVENT_REVIVEOFF);
|
||||
WriteByte(MSG_MULTICAST, index);
|
||||
multicast('0 0 0', MULTICAST_ALL);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif // PC
|
||||
}
|
||||
|
||||
void(entity who, float broadcast_time, float type, string str) BroadcastMessageToClient =
|
||||
{
|
||||
#ifndef HANDHELD
|
||||
#ifndef QUAKESPASM
|
||||
#ifdef PC
|
||||
|
||||
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
|
||||
WriteByte(MSG_MULTICAST, EVENT_BROADCAST);
|
||||
WriteByte(MSG_MULTICAST, broadcast_time);
|
||||
|
@ -228,28 +218,28 @@ void(entity who, float broadcast_time, float type, string str) BroadcastMessageT
|
|||
WriteString(MSG_MULTICAST, str);
|
||||
msg_entity = who;
|
||||
multicast('0 0 0', MULTICAST_ONE);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif // PC
|
||||
}
|
||||
|
||||
void(float broadcast_time, float type, string str) BroadcastMessage =
|
||||
{
|
||||
#ifndef HANDHELD
|
||||
#ifndef QUAKESPASM
|
||||
#ifdef PC
|
||||
|
||||
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
|
||||
WriteByte(MSG_MULTICAST, EVENT_BROADCAST);
|
||||
WriteByte(MSG_MULTICAST, broadcast_time);
|
||||
WriteByte(MSG_MULTICAST, type);
|
||||
WriteString(MSG_MULTICAST, str);
|
||||
multicast('0 0 0', MULTICAST_ALL);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif // PC
|
||||
}
|
||||
|
||||
void(float playernum, float points, float am, float kills, string name, entity person) UpdatePlayerPoints =
|
||||
{
|
||||
#ifndef HANDHELD
|
||||
#ifndef QUAKESPASM
|
||||
#ifdef PC
|
||||
|
||||
if (player_count == 0) {
|
||||
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
|
||||
WriteByte(MSG_MULTICAST, EVENT_POINTUPDATE);
|
||||
|
@ -272,13 +262,11 @@ void(float playernum, float points, float am, float kills, string name, entity p
|
|||
multicast('0 0 0', MULTICAST_ALL);
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
#endif // PC
|
||||
}
|
||||
|
||||
void(float count) UpdatePlayerCount = {
|
||||
#ifndef HANDHELD
|
||||
#ifndef QUAKESPASM
|
||||
#ifdef PC
|
||||
if (count == 0)
|
||||
return;
|
||||
else {
|
||||
|
@ -288,14 +276,12 @@ void(float count) UpdatePlayerCount = {
|
|||
multicast('0 0 0', MULTICAST_ALL);
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
#endif // PC
|
||||
}
|
||||
|
||||
void(float newtime, float newtype, entity change) PromptLevelChange =
|
||||
{
|
||||
#ifndef HANDHELD
|
||||
#ifndef QUAKESPASM
|
||||
#ifdef PC
|
||||
|
||||
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
|
||||
WriteByte(MSG_MULTICAST, EVENT_BLACKOUT);
|
||||
|
@ -304,16 +290,14 @@ void(float newtime, float newtype, entity change) PromptLevelChange =
|
|||
msg_entity = change;
|
||||
multicast('0 0 0', MULTICAST_ONE);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
#endif // PC
|
||||
}
|
||||
|
||||
void(entity who) UpdatePunchangle =
|
||||
{
|
||||
#ifdef PC
|
||||
|
||||
// naievil -- shit logic lol...but result looks clean as fuck...
|
||||
#ifndef HANDHELD
|
||||
#ifndef QUAKESPASM
|
||||
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
|
||||
WriteByte(MSG_MULTICAST, EVENT_PUNCHANGLE);
|
||||
WriteCoord(MSG_MULTICAST, who.punchangle_x);
|
||||
|
@ -354,12 +338,10 @@ void(entity who) UpdatePunchangle =
|
|||
} else
|
||||
who.punchangle_z = 0;
|
||||
|
||||
#endif
|
||||
#endif
|
||||
#endif // PC
|
||||
}
|
||||
|
||||
#ifndef HANDHELD
|
||||
#ifndef QUAKESPASM
|
||||
#ifdef PC
|
||||
void(string h, float h2, entity who) pushHUD = {
|
||||
if (player_count == 0) {
|
||||
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
|
||||
|
@ -448,85 +430,116 @@ void(string chaptertitle, string location, string date, string person, entity wh
|
|||
multicast('0 0 0', MULTICAST_ALL);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // PC
|
||||
|
||||
#ifndef QUAKESPASM
|
||||
void (float achievement_id, optional entity who) GiveAchievement =
|
||||
{
|
||||
#ifndef QUAKESPASM
|
||||
|
||||
#ifndef PC
|
||||
|
||||
// temp
|
||||
if (achievement_id > 4)
|
||||
return;
|
||||
|
||||
#endif // PC
|
||||
|
||||
// this is an achievement specific to an individual
|
||||
if ((who && who != world) || player_count == 0) {
|
||||
if (player_count == 0) who = find(world, classname, "player");
|
||||
|
||||
#ifndef PC
|
||||
|
||||
achievement(who, achievement_id);
|
||||
|
||||
#else
|
||||
|
||||
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
|
||||
WriteByte(MSG_MULTICAST, EVENT_ACHIEVEMENT);
|
||||
WriteByte(MSG_MULTICAST, achievement_id);
|
||||
msg_entity = who;
|
||||
multicast('0 0 0', MULTICAST_ONE);
|
||||
|
||||
#endif // PC
|
||||
|
||||
} else {
|
||||
|
||||
#ifndef PC
|
||||
|
||||
entity players;
|
||||
players = find(world, classname, "player");
|
||||
while(players != world) {
|
||||
achievement(players, achievement_id);
|
||||
players = find(players, classname, "player");
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
|
||||
WriteByte(MSG_MULTICAST, EVENT_ACHIEVEMENT);
|
||||
WriteByte(MSG_MULTICAST, achievement_id);
|
||||
multicast('0 0 0', MULTICAST_ALL);
|
||||
|
||||
#endif // PC
|
||||
}
|
||||
|
||||
#endif // QUAKESPASM
|
||||
}
|
||||
|
||||
void (float achievement_id, float progress_value, optional entity who) UpdateAchievementProgress =
|
||||
{
|
||||
#ifndef QUAKESPASM
|
||||
|
||||
#ifndef PC
|
||||
|
||||
// temp
|
||||
if (achievement_id > 4)
|
||||
return;
|
||||
|
||||
#endif // PC
|
||||
|
||||
// this is a progress update specific to an individual
|
||||
if ((who && who != world) || player_count == 0) {
|
||||
if (player_count == 0) who = find(world, classname, "player");
|
||||
|
||||
#ifndef PC
|
||||
|
||||
//achievement_progress(who, achievement_id, progress_value);
|
||||
|
||||
#else
|
||||
|
||||
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
|
||||
WriteByte(MSG_MULTICAST, EVENT_ACHIEVEMENTPROGRESS);
|
||||
WriteByte(MSG_MULTICAST, achievement_id);
|
||||
WriteFloat(MSG_MULTICAST, progress_value);
|
||||
msg_entity = who;
|
||||
multicast('0 0 0', MULTICAST_ONE);
|
||||
|
||||
#endif // PC
|
||||
|
||||
} else {
|
||||
|
||||
#ifndef PC
|
||||
|
||||
entity players;
|
||||
players = find(world, classname, "player");
|
||||
while(players != world) {
|
||||
//achievement_progress(players, achievement_id, progress_value);
|
||||
players = find(players, classname, "player");
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
|
||||
WriteByte(MSG_MULTICAST, EVENT_ACHIEVEMENTPROGRESS);
|
||||
WriteByte(MSG_MULTICAST, achievement_id);
|
||||
WriteFloat(MSG_MULTICAST, progress_value);
|
||||
multicast('0 0 0', MULTICAST_ALL);
|
||||
|
||||
#endif // PC
|
||||
}
|
||||
}
|
||||
#endif // QUAKESPASM
|
||||
}
|
||||
|
||||
// *****************************************
|
||||
// Unrelated to engine, but custom functions
|
||||
|
|
|
@ -25,10 +25,7 @@
|
|||
Boston, MA 02111-1307, USA
|
||||
|
||||
*/
|
||||
|
||||
#ifndef QUAKESPASM
|
||||
void (float achievement_id, optional entity who) GiveAchievement;
|
||||
#endif // QUAKESPASM
|
||||
|
||||
void() Barrel_Hit;
|
||||
|
||||
|
@ -429,9 +426,7 @@ void(entity victim,entity attacker, float damage, float d_style) DamageHandler =
|
|||
if (victim.crawling != TRUE && !(victim.health <= 0) && crawler_num < 5 && victim.classname != "ai_dog")
|
||||
{
|
||||
makeCrawler(victim);
|
||||
#ifndef QUAKESPASM
|
||||
GiveAchievement(3, attacker);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -38,6 +38,22 @@
|
|||
|
||||
#define STR_NOTENOUGHPOINTS "Not Enough Points\n" // To help aid consistency with these..
|
||||
|
||||
// Quake assumes these are defined.
|
||||
string string_null;
|
||||
.string killtarget;
|
||||
entity activator;
|
||||
float framecount;
|
||||
float deathmatch;
|
||||
float coop;
|
||||
|
||||
#ifndef PC
|
||||
void(string com) SV_ParseClientCommand;
|
||||
.float gravity;
|
||||
.float recoil_delay;
|
||||
.float mapversion;
|
||||
.float ammo;
|
||||
#endif
|
||||
|
||||
// achievement tracking
|
||||
.float ach_tracker_npnp;
|
||||
.float ach_tracker_abst;
|
||||
|
@ -47,9 +63,6 @@ float ach_tracker_barr;
|
|||
float ach_tracker_spin;
|
||||
float ach_tracker_luck;
|
||||
|
||||
float framecount;
|
||||
float deathmatch;
|
||||
float coop;
|
||||
.vector oldvelocity;
|
||||
.float lastsound_time;
|
||||
.float isspec;
|
||||
|
@ -88,7 +101,6 @@ void(entity person, float expamt , float doublepoint) addmoney;
|
|||
#define STATE_DOWN 3
|
||||
.float /*worldtype,*/ delay, wait, lip, /*light_lev,*/ speed, style/*, skill*/;
|
||||
|
||||
entity activator;
|
||||
.float requirespower;
|
||||
|
||||
//player funcs
|
||||
|
@ -345,7 +357,6 @@ float crandom();
|
|||
|
||||
|
||||
// Door
|
||||
.string killtarget;
|
||||
.void() think1;
|
||||
.vector finaldest;
|
||||
.vector pos1, pos2/*, mangle*/;
|
||||
|
@ -373,11 +384,11 @@ entity boxLocations[32];
|
|||
float boxCount;
|
||||
vector boxOrigin;
|
||||
|
||||
#ifndef HANDHELD
|
||||
#ifdef PC
|
||||
//powerups
|
||||
.float x2_icon;
|
||||
.float insta_icon;
|
||||
#endif // HANDHELD
|
||||
#endif // PC
|
||||
.string powerup_vo;
|
||||
float instakill_finished;
|
||||
float insta_blink;
|
||||
|
@ -506,22 +517,22 @@ float sndActivCnt;
|
|||
.entity entities[4];
|
||||
|
||||
// GIBBING
|
||||
#ifdef PC
|
||||
.entity larm;
|
||||
.entity rarm;
|
||||
.entity head;
|
||||
.vector bbmins, bbmaxs;
|
||||
.float currentHitBoxSetup;
|
||||
|
||||
#ifdef QUAKESPASM
|
||||
.float sprintflag;
|
||||
#endif
|
||||
|
||||
// PC Fog force
|
||||
.float PC_fog;
|
||||
|
||||
// hl stuff
|
||||
#ifdef PC
|
||||
.float rendermode;
|
||||
.float renderamt;
|
||||
.vector rendercolor;
|
||||
#endif
|
||||
|
||||
float revive_index;
|
||||
|
|
|
@ -40,7 +40,6 @@ float trace_plane_dist;
|
|||
entity trace_ent;
|
||||
float trace_inopen;
|
||||
float trace_inwater;
|
||||
|
||||
entity msg_entity; // destination of single entity writes
|
||||
void() main; // only for testing
|
||||
void() StartFrame;
|
||||
|
@ -160,128 +159,112 @@ void end_sys_fields; // flag for structure dumping
|
|||
// End. Lines below this MAY be altered, to some extent
|
||||
|
||||
// Built In functions
|
||||
void(vector ang) makevectors = #1; // sets v_forward, etc globals
|
||||
void(entity e, vector o) setorigin = #2;
|
||||
void(entity e, string m) setmodel = #3; // set movetype and solid first
|
||||
void(entity e, vector min, vector max) setsize = #4;
|
||||
void() break = #6;
|
||||
float() random = #7; // returns 0 - 1
|
||||
void(entity e, float chan, string samp, float vol, float atten) sound = #8;
|
||||
vector(vector v) normalize = #9;
|
||||
void(string e) error = #10;
|
||||
void(string e) objerror = #11;
|
||||
float(vector v) vlen = #12;
|
||||
float(vector v) vectoyaw = #13;
|
||||
entity() spawn = #14;
|
||||
void(entity e) remove = #15;
|
||||
void(vector v1, vector v2, float nomonsters, entity forent) traceline = #16;
|
||||
entity() checkclient = #17; // returns a client to look for
|
||||
entity(entity start, .string fld, string match) find = #18;
|
||||
string(string s) precache_sound = #19;
|
||||
string(string s) precache_model = #20;
|
||||
void(entity client, string s)stuffcmd = #21;
|
||||
entity(vector org, float rad) findradius = #22;
|
||||
void(string s) dprint = #25;
|
||||
string(float f) ftos = #26;
|
||||
string(vector v) vtos = #27;
|
||||
void() coredump = #28; // prints all edicts
|
||||
void() traceon = #29; // turns statment trace on
|
||||
void() traceoff = #30;
|
||||
void(entity e) eprint = #31; // prints an entire edict
|
||||
float(float yaw, float dist) walkmove = #32; // returns TRUE or FALSE
|
||||
float(entity zombie, float which, entity limb) updateLimb = #33;
|
||||
float(float yaw, float dist) droptofloor = #34; // TRUE if landed on floor
|
||||
void(float style, string value) lightstyle = #35;
|
||||
float(float v) rint = #36; // round to nearest int
|
||||
float(float v) floor = #37; // largest integer <= v
|
||||
float(float v) ceil = #38; // smallest integer >= v
|
||||
float(entity e) checkbottom = #40; // true if self is on ground
|
||||
float(vector v) pointcontents = #41; // returns a CONTENT_*
|
||||
float(float f) fabs = #43;
|
||||
vector(entity e, float speed) aim = #44; // returns the shooting vector
|
||||
float(string s) cvar = #45; // return cvar.value
|
||||
void(string s) localcmd = #46; // put string into local que
|
||||
entity(entity e) nextent = #47; // for looping through all ents
|
||||
void() ChangeYaw = #49; // turn towards self.ideal_yaw
|
||||
float(string name) getSoundLen = #50;
|
||||
vector(vector v) vectoangles = #51;
|
||||
void(float to, float f) WriteByte = #52;
|
||||
void(float to, float f) WriteChar = #53;
|
||||
void(float to, float f) WriteShort = #54;
|
||||
void(float to, float f) WriteLong = #55;
|
||||
void(float to, float f) WriteCoord = #56;
|
||||
void(float to, float f) WriteAngle = #57;
|
||||
void(float to, string s) WriteString = #58;
|
||||
void(float to, entity s) WriteEntity = #59;
|
||||
string(entity s) etos = #65;
|
||||
void(float step) movetogoal = #67;
|
||||
string(string s) precache_file = #68; // no effect except for -copy
|
||||
void(entity e) makestatic = #69;
|
||||
void(string s) changelevel = #70;
|
||||
void(float step, vector origin) movetoorigin = #71;
|
||||
void(string var, string val) cvar_set = #72; // sets cvar.value
|
||||
void(entity client, string s) centerprint = #73; // sprint, but in middle
|
||||
void(entity client, string s, string s) centerprint2 = #73;
|
||||
void(entity client, string s, string s, string s) centerprint3 = #73;
|
||||
void(entity client, string s, string s, string s, string s) centerprint4 = #73;
|
||||
void(entity client, string s, string s, string s, string s, string s) centerprint5 = #73;
|
||||
void(entity client, string s, string s, string s, string s, string s, string s) centerprint6 = #73;
|
||||
void(entity client, string s, string s, string s, string s, string s, string s, string s) centerprint7 = #73;
|
||||
void(vector pos, string samp, float vol, float atten) ambientsound = #74;
|
||||
string(string s) precache_model2 = #75; // registered version only
|
||||
string(string s) precache_sound2 = #76; // registered version only
|
||||
string(string s) precache_file2 = #77; // registered version only
|
||||
void(entity e) setspawnparms = #78; // set parm1... to the
|
||||
void(vector start, vector min, vector max, vector end, float nomonsters, entity forent) tracebox = #90;
|
||||
float(vector start, vector min, vector max, vector end, float nomonsters, entity forent) tracemove = #99;
|
||||
void (vector ang) makevectors = #1; // sets v_forward, etc globals
|
||||
void (entity e, vector o) setorigin = #2;
|
||||
void (entity e, string m) setmodel = #3; // set movetype and solid first
|
||||
void (entity e, vector min, vector max) setsize = #4;
|
||||
void () break = #6;
|
||||
float () random = #7; // returns 0 - 1
|
||||
void (entity e, float chan, string samp, float vol, float atten) sound = #8;
|
||||
vector (vector v) normalize = #9;
|
||||
void (string e) error = #10;
|
||||
void (string e) objerror = #11;
|
||||
float (vector v) vlen = #12;
|
||||
float (vector v) vectoyaw = #13;
|
||||
entity () spawn = #14;
|
||||
void (entity e) remove = #15;
|
||||
void (vector v1, vector v2, float nomonsters, entity forent) traceline = #16;
|
||||
entity () checkclient = #17; // returns a client to look for
|
||||
entity (entity start, .string fld, string match) find = #18;
|
||||
string (string s) precache_sound = #19;
|
||||
string (string s) precache_model = #20;
|
||||
void (entity client, string s) stuffcmd = #21;
|
||||
entity (vector org, float rad) findradius = #22;
|
||||
void (string s) bprint_psp = #23;
|
||||
void (entity client, string s) sprint_psp = #24;
|
||||
void (string s) dprint = #25;
|
||||
string (float f) ftos = #26;
|
||||
string (vector v) vtos = #27;
|
||||
void () coredump = #28; // prints all edicts
|
||||
void () traceon = #29; // turns statment trace on
|
||||
void () traceoff = #30;
|
||||
void (entity e) eprint = #31; // prints an entire edict
|
||||
float (float yaw, float dist) walkmove = #32; // returns TRUE or FALSE
|
||||
float (entity zombie, float which, entity limb) updateLimb = #33;
|
||||
float (float yaw, float dist) droptofloor = #34; // TRUE if landed on floor
|
||||
void (float style, string value) lightstyle = #35;
|
||||
float (float v) rint = #36; // round to nearest int
|
||||
float (float v) floor = #37; // largest integer <= v
|
||||
float (float v) ceil = #38; // smallest integer >= v
|
||||
float (entity e) checkbottom = #40; // true if self is on ground
|
||||
float (vector v) pointcontents = #41; // returns a CONTENT_*
|
||||
float (float f) fabs = #43;
|
||||
vector (entity e, float speed) aim = #44; // returns the shooting vector
|
||||
float (string s) cvar = #45; // return cvar.value
|
||||
void (string s) localcmd = #46; // put string into local que
|
||||
entity (entity e) nextent = #47; // for looping through all ents
|
||||
void (vector o, vector d, float color, float count) particle = #48; // start a particle effect
|
||||
void () ChangeYaw = #49; // turn towards self.ideal_yaw
|
||||
float (string name) getSoundLen = #50;
|
||||
vector (vector v) vectoangles = #51;
|
||||
void (float to, float f) WriteByte = #52;
|
||||
void (float to, float f) WriteChar = #53;
|
||||
void (float to, float f) WriteShort = #54;
|
||||
void (float to, float f) WriteLong = #55;
|
||||
void (float to, float f) WriteCoord = #56;
|
||||
void (float to, float f) WriteAngle = #57;
|
||||
void (float to, string s) WriteString = #58;
|
||||
void (float to, entity s) WriteEntity = #59;
|
||||
string (entity s) etos = #65;
|
||||
void (float step) movetogoal = #67;
|
||||
string (string s) precache_file = #68; // no effect except for -copy
|
||||
void (entity e) makestatic = #69;
|
||||
void (string s) changelevel = #70;
|
||||
void (float step, vector origin) movetoorigin = #71;
|
||||
void (string var, string val) cvar_set = #72; // sets cvar.value
|
||||
void (entity client, string s) centerprint = #73; // sprint, but in middle
|
||||
void (entity client, string s, string s) centerprint2 = #73;
|
||||
void (entity client, string s, string s, string s) centerprint3 = #73;
|
||||
void (entity client, string s, string s, string s, string s) centerprint4 = #73;
|
||||
void (entity client, string s, string s, string s, string s, string s) centerprint5 = #73;
|
||||
void (entity client, string s, string s, string s, string s, string s, string s) centerprint6 = #73;
|
||||
void (entity client, string s, string s, string s, string s, string s, string s, string s) centerprint7 = #73;
|
||||
void (vector pos, string samp, float vol, float atten) ambientsound = #74;
|
||||
string (string s) precache_model2 = #75; // registered version only
|
||||
string (string s) precache_sound2 = #76; // registered version only
|
||||
string (string s) precache_file2 = #77; // registered version only
|
||||
void (entity e) setspawnparms = #78; // set parm1... to the
|
||||
void (entity plr, float achievement) achievement = #79;
|
||||
float (string s) stof = #81; // 2001-09-20 QuakeC string manipulation by FrikaC
|
||||
vector (entity what) Get_Waypoint_Near = #83;
|
||||
float (entity zombie, entity target) Do_Pathfind_psp = #84;
|
||||
void (string s) Open_Waypoint = #85;
|
||||
vector (entity zombie,vector start,vector min, vector max) Get_Next_Waypoint = #86;
|
||||
void (entity client, float type, float cost, float weapon) useprint = #87;
|
||||
vector (entity zombie,vector start,vector min, vector max) Get_First_Waypoint = #88;
|
||||
void (string s) Close_Waypoint = #89;
|
||||
void (vector start, vector min, vector max, vector end, float nomonsters, entity forent) tracebox = #90;
|
||||
entity (entity start, .float field, float match) findfloat = #98;
|
||||
float(string s) stof = #81; // 2001-09-20 QuakeC string manipulation by FrikaC
|
||||
vector(entity what) Get_Waypoint_Near = #83;
|
||||
float(entity zombie, entity target) Do_Pathfind_psp = #84;
|
||||
void(string s) Open_Waypoint = #85;
|
||||
vector(entity zombie,vector start,vector min, vector max) Get_Next_Waypoint = #86;
|
||||
void(entity client, float type, float cost, float weapon) useprint = #87;
|
||||
vector(entity zombie,vector start,vector min, vector max) Get_First_Waypoint = #88;
|
||||
void(string s) Close_Waypoint = #89;
|
||||
|
||||
void(entity plr, float achievement) achievement = #79;
|
||||
|
||||
void(string trackname) songegg = #500;
|
||||
void() nzp_maxammo = #501;
|
||||
/*
|
||||
type 0 = clear
|
||||
type 1 = buy door
|
||||
type 2 = buy debris
|
||||
type 3 = Buy ammo
|
||||
type 4 = buy weapon
|
||||
type 5 = repair window
|
||||
type 6 = use box
|
||||
type 7 = use trap
|
||||
type 8 = require power
|
||||
*/
|
||||
|
||||
|
||||
float (vector start, vector min, vector max, vector end, float nomonsters, entity forent) tracemove = #99;
|
||||
// 2001-09-20 QuakeC file access by FrikaC start
|
||||
float(string filename, float mode) fopen = #110;
|
||||
void(float fhandle) fclose = #111;
|
||||
string(float fhandle) fgets = #112;
|
||||
void(float fhandle, string s) fputs = #113;
|
||||
float (string filename, float mode) fopen = #110;
|
||||
void (float fhandle) fclose = #111;
|
||||
string (float fhandle) fgets = #112;
|
||||
void (float fhandle, string s) fputs = #113;
|
||||
float (string s) strlen = #114;
|
||||
string (string s1, string s2) strcat = #115;
|
||||
string (string s, float start, float length) substring = #116;
|
||||
vector (string s) stov = #117;
|
||||
string (string s) strzone = #118;
|
||||
string (string s) strunzone = #119;
|
||||
string (string s) strtrim = #120;
|
||||
// 2001-09-20 QuakeC file access by FrikaC end
|
||||
|
||||
// 2001-09-20 QuakeC string manipulation by FrikaC start
|
||||
float(string s) strlen = #114;
|
||||
string(string s1, string s2) strcat = #115;
|
||||
string(string s, float start, float length) substring = #116;
|
||||
vector(string s) stov = #117;
|
||||
string(string s) strzone = #118;
|
||||
string(string s) strunzone = #119;
|
||||
string(string s) strtrim = #120;
|
||||
// 2001-09-20 QuakeC string manipulation by FrikaC end
|
||||
|
||||
// 2001-11-15 DarkPlaces general builtin functions by Lord Havoc start
|
||||
float(string s) tokenize = #441;
|
||||
string(float num) argv = #442;
|
||||
// 2001-11-15 DarkPlaces general builtin functions by Lord Havoc end
|
||||
void (string trackname) songegg = #500;
|
||||
void () nzp_maxammo = #501;
|
||||
|
||||
//
|
||||
// constants
|
||||
|
@ -302,7 +285,6 @@ string(float num) argv = #442;
|
|||
#define FL_ONGROUND 512 // standing on something
|
||||
#define FL_PARTIALGROUND 1024 // not all corners are valid
|
||||
#define FL_WATERJUMP 2048 // player jumping out of water
|
||||
//#define FL_JUMPRELEASED 4096 // for jump debouncing
|
||||
|
||||
// edict.movetype values
|
||||
#define MOVETYPE_NONE 0 // never moves
|
||||
|
@ -319,6 +301,8 @@ string(float num) argv = #442;
|
|||
#define MOVETYPE_BOUNCEMISSILE 11 // bounce with extra size
|
||||
#define MOVETYPE_FOLLOW 12
|
||||
|
||||
#define MOVE_HITMODEL 0
|
||||
|
||||
// edict.solid values
|
||||
#define SOLID_NOT 0 // no interaction with other objects
|
||||
#define SOLID_TRIGGER 1 // touch on edge, but not blocking
|
||||
|
@ -334,29 +318,18 @@ string(float num) argv = #442;
|
|||
#define RANGE_FAR 3
|
||||
|
||||
// deadflag values
|
||||
|
||||
#define DEAD_NO 0
|
||||
#define DEAD_DYING 1
|
||||
#define DEAD_DEAD 2
|
||||
#define DEAD_RESPAWNABLE 3
|
||||
|
||||
// takedamage values
|
||||
|
||||
#define DAMAGE_NO 0
|
||||
#define DAMAGE_YES 1
|
||||
#define DAMAGE_AIM 2
|
||||
#define DAMAGE_NOMARKER 3
|
||||
|
||||
/*.void() th_stand;
|
||||
.void() th_walk;
|
||||
.void() th_run;
|
||||
.void(entity attacker, float damage) th_pain;*/
|
||||
.void() th_die;
|
||||
//.void() th_missile;
|
||||
.void() th_melee;
|
||||
|
||||
// point content values
|
||||
|
||||
#define CONTENT_EMPTY -1
|
||||
#define CONTENT_SOLID -2
|
||||
#define CONTENT_WATER -3
|
||||
|
@ -364,24 +337,17 @@ string(float num) argv = #442;
|
|||
#define CONTENT_LAVA -5
|
||||
#define CONTENT_SKY -6
|
||||
|
||||
//doors
|
||||
#define STATE_TOP 0
|
||||
#define STATE_BOTTOM 1
|
||||
#define STATE_UP 2
|
||||
#define STATE_DOWN 3
|
||||
|
||||
#define VEC_ORIGIN '0 0 0'
|
||||
|
||||
//Standard Quake View Offset
|
||||
//vector VEC_VIEW_OFS = '0 0 22';
|
||||
|
||||
//Half Life View Offset is 64
|
||||
//64 units above ground, for our purposes it's, 64 - (how low bounding box goes)
|
||||
//vector VEC_VIEW_OFS = '0 0 32';
|
||||
|
||||
//Standard Quake Hull
|
||||
//vector VEC_HULL_MIN = '-16 -16 -24';
|
||||
//vector VEC_HULL_MAX = '16 16 32';
|
||||
|
||||
//Half Life 1 Hull Sizes ADDED BY BLUBS, COMMENTED ORIGINAL QUAKE BBOX SIZS OUT
|
||||
#define VEC_HULL_MIN '-16 -16 -32'
|
||||
#define VEC_HULL_MAX '16 16 40'
|
||||
|
||||
#define VEC_HULL2_MIN '-32 -32 -24'
|
||||
#define VEC_HULL2_MAX '32 32 64'
|
||||
|
||||
|
@ -440,12 +406,12 @@ string(float num) argv = #442;
|
|||
// sound channels
|
||||
// channel 0 never willingly overrides
|
||||
// other channels (1-7) allways override a playing sound on that channel
|
||||
// Player uses channel 5 for all weapon reload sfx
|
||||
#define CHAN_AUTO 0
|
||||
#define CHAN_WEAPON 1
|
||||
#define CHAN_VOICE 2
|
||||
#define CHAN_ITEM 3
|
||||
#define CHAN_BODY 4
|
||||
//Player uses channel 5 for all weapon reload sfx
|
||||
|
||||
#define ATTN_NONE 0
|
||||
#define ATTN_NORM 1
|
||||
|
@ -453,14 +419,12 @@ string(float num) argv = #442;
|
|||
#define ATTN_STATIC 3
|
||||
|
||||
// update types
|
||||
|
||||
#define UPDATE_GENERAL 0
|
||||
#define UPDATE_STATIC 1
|
||||
#define UPDATE_BINARY 2
|
||||
#define UPDATE_TEMP 3
|
||||
|
||||
// entity effects
|
||||
|
||||
#define EF_BLUE 1
|
||||
#define EF_MUZZLEFLASH 2
|
||||
#define EF_BRIGHTLIGHT 4
|
||||
|
@ -483,60 +447,20 @@ string(float num) argv = #442;
|
|||
#define MSG_ALL 2 // reliable to all
|
||||
#define MSG_INIT 3 // write to the init string
|
||||
|
||||
// message levels
|
||||
#define PRINT_HIGH 0
|
||||
|
||||
#define AS_STRAIGHT 1
|
||||
#define AS_SLIDING 2
|
||||
#define AS_MELEE 3
|
||||
#define AS_MISSILE 4
|
||||
|
||||
// Quake assumes these are defined.
|
||||
|
||||
//.string wad, map;
|
||||
.float /*worldtype,*/ delay, wait, lip, /*light_lev,*/ speed, style/*, skill*/;
|
||||
.string killtarget;
|
||||
.void() think1;
|
||||
.vector finaldest;
|
||||
.vector pos1, pos2/*, mangle*/;
|
||||
|
||||
void(vector o, vector d, float color, float count) particle = #48;// start a particle effect
|
||||
void(string s) bprint_psp = #23;
|
||||
void(entity client, string s) sprint_psp = #24;
|
||||
// End
|
||||
// file operations
|
||||
#define FILE_READ 0
|
||||
#define FILE_APPEND 1
|
||||
#define FILE_WRITE 2
|
||||
|
||||
void(string s) println = {bprint_psp(s);} //just when brain decided to think this is c
|
||||
void(float ignore, string s) bprint = {bprint_psp(s);};
|
||||
void(entity client, float type, string s) sprint = {sprint_psp(client, s);};
|
||||
void(string s) print = {bprint_psp(s);};
|
||||
|
||||
//doors
|
||||
.float state;
|
||||
#define STATE_TOP 0
|
||||
#define STATE_BOTTOM 1
|
||||
#define STATE_UP 2
|
||||
#define STATE_DOWN 3
|
||||
|
||||
string mappath;
|
||||
#define PRINT_HIGH 0
|
||||
|
||||
.float isspec;
|
||||
|
||||
#define FILE_READ 0
|
||||
#define FILE_APPEND 1
|
||||
#define FILE_WRITE 2
|
||||
|
||||
#define MOVE_HITMODEL 0 // must be different for this engine!
|
||||
|
||||
.float recoil_delay;
|
||||
.float gravity;
|
||||
|
||||
.float renderamt;
|
||||
.float rendermode;
|
||||
.vector rendercolor;
|
||||
.string mapversion;
|
||||
.float ammo;
|
||||
|
||||
void(string com) SV_ParseClientCommand;
|
||||
|
||||
.float currentHitBoxSetup;
|
||||
.vector bbmins, bbmaxs; // Used for zombie hitboxes
|
||||
|
||||
.float achievements;
|
||||
|
|
|
@ -1,58 +1,36 @@
|
|||
/*
|
||||
defs.qc
|
||||
|
||||
global definitions
|
||||
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
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
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
SOURCE FOR GLOBALVARS_T C STRUCTURE
|
||||
|
||||
==============================================================================
|
||||
+----+
|
||||
|Defs|
|
||||
+----+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
|
||||
| Scratch Http://www.admdev.com/scratch |
|
||||
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
|
||||
| This contains necessary definitions from the original V1.06 defs.qc file. |
|
||||
| This includes some basic constants, the built in function definitions, and |
|
||||
| some variable's used by the Quake Engine internally. |
|
||||
| Certain lines in this file are hardcoded into Quake engine, and -must- be |
|
||||
| present and unchanged, in the order they are shown. Otherwise Quake will |
|
||||
| refuse to run. |
|
||||
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
|
||||
*/
|
||||
|
||||
#define QUAKESPASM
|
||||
|
||||
//
|
||||
// system globals
|
||||
//
|
||||
// These lines CANNOT be altered/moved
|
||||
entity self;
|
||||
entity other;
|
||||
entity world;
|
||||
float time;
|
||||
float frametime;
|
||||
float force_retouch;
|
||||
float force_retouch; // force all entities to touch triggers
|
||||
string mapname;
|
||||
float deathmatch;
|
||||
float coop;
|
||||
float teamplay;
|
||||
float serverflags;
|
||||
float serverflags; // propagated from level to level, used to
|
||||
float rounds;
|
||||
float rounds_change;
|
||||
float parm1, parm2, parm3, parm4, parm5, parm6, parm7, parm8, parm9, parm10, parm11, parm12, parm13, parm14, parm15, parm16;
|
||||
vector v_forward, v_up, v_right;
|
||||
vector v_forward, v_up, v_right; // set by makevectors()
|
||||
float trace_allsolid;
|
||||
float trace_startsolid;
|
||||
float trace_fraction;
|
||||
|
@ -70,41 +48,44 @@ void() PlayerPreThink;
|
|||
void() PlayerPostThink;
|
||||
void() ClientKill;
|
||||
void() ClientConnect;
|
||||
void() PutClientInServer;
|
||||
void() PutClientInServer; // call after setting the parm1... parms
|
||||
void() ClientDisconnect;
|
||||
void() SetNewParms;
|
||||
void() SetChangeParms;
|
||||
void end_sys_globals;
|
||||
void() SetNewParms; // called when a client first connects to
|
||||
void() SetChangeParms; // call to set parms for self so they can
|
||||
//void() ParseClientCommand; // special command calls
|
||||
//string CMD_STRING;
|
||||
//void() Soft_Restart;
|
||||
void end_sys_globals; // flag for structure dumping
|
||||
|
||||
|
||||
.float modelindex;
|
||||
.vector absmin, absmax;
|
||||
.float ltime;
|
||||
.float modelindex; // *** model index in the precached list
|
||||
.vector absmin, absmax; // *** origin + mins / maxs
|
||||
.float ltime; // local time for entity
|
||||
.float movetype;
|
||||
.float solid;
|
||||
.vector origin;
|
||||
.vector oldorigin;
|
||||
.vector origin; // ***
|
||||
.vector oldorigin; // ***
|
||||
.vector velocity;
|
||||
.vector angles;
|
||||
.vector avelocity;
|
||||
.vector punchangle;
|
||||
.string classname;
|
||||
.vector punchangle; // temp angle adjust from damage or recoil
|
||||
.string classname; // spawn function
|
||||
.string model;
|
||||
.float frame;
|
||||
.float skin;
|
||||
//.float iframetime;
|
||||
.float effects;
|
||||
.vector mins, maxs;
|
||||
.vector size;
|
||||
.vector mins, maxs; // bounding box extents reletive to origin
|
||||
.vector size; // maxs - mins
|
||||
.void() touch;
|
||||
.void() use;
|
||||
.void() think;
|
||||
.void() blocked;
|
||||
.void() blocked; // for doors or plats, called when can't push other
|
||||
.float nextthink;
|
||||
.entity groundentity;
|
||||
.float health;
|
||||
.float points;
|
||||
.float kills;
|
||||
.float weapon;
|
||||
.float weapon; // one of the W_COLT, etc flags
|
||||
.string weaponmodel;
|
||||
.string weapon2model;
|
||||
.float weaponframe;
|
||||
|
@ -117,56 +98,59 @@ void end_sys_globals;
|
|||
.float primary_grenades;
|
||||
.float secondary_grenades;
|
||||
.float grenades;
|
||||
.float perks;
|
||||
.float perks; // bit flags
|
||||
.float takedamage;
|
||||
.entity chain;
|
||||
.float deadflag;
|
||||
.vector view_ofs;
|
||||
.float button0;
|
||||
.float button1;
|
||||
.float button2;
|
||||
.float button3;
|
||||
.float button4;
|
||||
.float button5;
|
||||
.float button6;
|
||||
.float button7;
|
||||
.float button8;
|
||||
.float impulse;
|
||||
.vector view_ofs; // add to origin to get eye point
|
||||
.float button0; //
|
||||
.float button1; //
|
||||
.float button2; //
|
||||
.float button3; //
|
||||
.float button4; //
|
||||
.float button5; //
|
||||
.float button6; //
|
||||
.float button7; //
|
||||
.float button8; //
|
||||
.float impulse; // weapon changes
|
||||
.float fixangle;
|
||||
.vector v_angle;
|
||||
.float idealpitch; // Naievil -- new
|
||||
.vector v_angle; // view / targeting angle for players
|
||||
.float idealpitch; // calculated pitch angle for lookup up slopes
|
||||
.string netname;
|
||||
.entity enemy;
|
||||
.float flags;
|
||||
.float colormap;
|
||||
.float team;
|
||||
.float max_health;
|
||||
.float teleport_time;
|
||||
.float max_health; // players maximum health is stored here
|
||||
.float teleport_time; // don't back up
|
||||
.float armortype;
|
||||
.float armorvalue;
|
||||
.float waterlevel;
|
||||
.float watertype;
|
||||
.float waterlevel; // 0 = not in, 1 = feet, 2 = wast, 3 = eyes
|
||||
.float watertype; // a contents value
|
||||
.float ideal_yaw;
|
||||
.float yaw_speed;
|
||||
.entity aiment;
|
||||
.entity head;
|
||||
.entity larm;
|
||||
.entity rarm;
|
||||
.entity goalentity;
|
||||
.entity goalentity; // a movetarget or an enemy
|
||||
//.entity goalorigin; // a movetarget location
|
||||
.float spawnflags;
|
||||
.string target;
|
||||
.string targetname;
|
||||
.float dmg_take;
|
||||
.float dmg_save;
|
||||
.float bleed_out;
|
||||
.float progress_bar;
|
||||
.entity dmg_inflictor;
|
||||
.entity owner;
|
||||
.vector movedir;
|
||||
.string message;
|
||||
.float sounds;
|
||||
.string noise, noise1, noise2, noise3;
|
||||
.float x2_icon;
|
||||
.entity owner; // who launched a missile
|
||||
.vector movedir; // mostly for doors, but also used for waterjump
|
||||
.string message; // trigger messages
|
||||
.float sounds; // either a cd track number or sound number
|
||||
.string noise, noise1, noise2, noise3; // contains names of wavs to play
|
||||
.float x2_icon; // double points icon
|
||||
.float insta_icon;
|
||||
//.string Weapon_Name;
|
||||
.string Weapon_Name_Touch;
|
||||
.vector ADS_Offset;
|
||||
.vector Flash_Offset;
|
||||
|
@ -174,110 +158,288 @@ void end_sys_globals;
|
|||
.float currentmag2;
|
||||
.float maxspeed;
|
||||
.float renderGrayscale;
|
||||
void end_sys_fields;
|
||||
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
VARS NOT REFERENCED BY C CODE
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
//.float scale;
|
||||
void end_sys_fields; // flag for structure dumping
|
||||
// End. Lines below this MAY be altered, to some extent
|
||||
|
||||
// Built In functions
|
||||
void (vector ang) makevectors = #1; // sets v_forward, etc globals
|
||||
void (entity e, vector o) setorigin = #2;
|
||||
void (entity e, string m) setmodel = #3; // set movetype and solid first
|
||||
void (entity e, vector min, vector max) setsize = #4;
|
||||
void () break = #6;
|
||||
float () random = #7; // returns 0 - 1
|
||||
void (entity e, float chan, string samp, float vol, float atten) sound = #8;
|
||||
vector (vector v) normalize = #9;
|
||||
void (string e) error = #10;
|
||||
void (string e) objerror = #11;
|
||||
float (vector v) vlen = #12;
|
||||
float (vector v) vectoyaw = #13;
|
||||
entity () spawn = #14;
|
||||
void (entity e) remove = #15;
|
||||
void (vector v1, vector v2, float nomonsters, entity forent) traceline = #16;
|
||||
entity () checkclient = #17; // returns a client to look for
|
||||
entity (entity start, .string fld, string match) find = #18;
|
||||
string (string s) precache_sound = #19;
|
||||
string (string s) precache_model = #20;
|
||||
void (entity client, string s) stuffcmd = #21;
|
||||
entity (vector org, float rad) findradius = #22;
|
||||
void (float level, string s) bprint = #23;
|
||||
void (entity client, float level, string s) sprint = #24;
|
||||
void (string s) dprint = #25;
|
||||
string (float f) ftos = #26;
|
||||
string (vector v) vtos = #27;
|
||||
void () coredump = #28; // prints all edicts
|
||||
void () traceon = #29; // turns statment trace on
|
||||
void () traceoff = #30;
|
||||
void (entity e) eprint = #31; // prints an entire edict
|
||||
float (float yaw, float dist) walkmove = #32; // returns TRUE or FALSE
|
||||
float (entity zombie, float which, entity limb) updateLimb = #33;
|
||||
float (float yaw, float dist) droptofloor = #34; // TRUE if landed on floor
|
||||
void (float style, string value) lightstyle = #35;
|
||||
float (float v) rint = #36; // round to nearest int
|
||||
float (float v) floor = #37; // largest integer <= v
|
||||
float (float v) ceil = #38; // smallest integer >= v
|
||||
float (entity e) checkbottom = #40; // true if self is on ground
|
||||
float (vector v) pointcontents = #41; // returns a CONTENT_*
|
||||
float (float f) fabs = #43;
|
||||
vector (entity e, float speed) aim = #44; // returns the shooting vector
|
||||
float (string s) cvar = #45; // return cvar.value
|
||||
void (string s) localcmd = #46; // put string into local que
|
||||
entity (entity e) nextent = #47; // for looping through all ents
|
||||
//void (vector o, vector d, float color, float count) particle = #48; // start a particle effect
|
||||
void () ChangeYaw = #49; // turn towards self.ideal_yaw
|
||||
//float (string name) getSoundLen = #50;
|
||||
vector (vector v) vectoangles = #51;
|
||||
void (float to, float f) WriteByte = #52;
|
||||
void (float to, float f) WriteChar = #53;
|
||||
void (float to, float f) WriteShort = #54;
|
||||
void (float to, float f) WriteLong = #55;
|
||||
void (float to, float f) WriteCoord = #56;
|
||||
void (float to, float f) WriteAngle = #57;
|
||||
void (float to, string s) WriteString = #58;
|
||||
void (float to, entity s) WriteEntity = #59;
|
||||
//string (entity s) etos = #65;
|
||||
void (float step) movetogoal = #67;
|
||||
string (string s) precache_file = #68; // no effect except for -copy
|
||||
void (entity e) makestatic = #69;
|
||||
void (string s) changelevel = #70;
|
||||
//void (float step, vector origin) movetoorigin = #71;
|
||||
void (string var, string val) cvar_set = #72; // sets cvar.value
|
||||
void (entity client, string s) centerprint = #73; // sprint, but in middle
|
||||
//void (entity client, string s, string s) centerprint2 = #73;
|
||||
//void (entity client, string s, string s, string s) centerprint3 = #73;
|
||||
//void (entity client, string s, string s, string s, string s) centerprint4 = #73;
|
||||
//void (entity client, string s, string s, string s, string s, string s) centerprint5 = #73;
|
||||
//void (entity client, string s, string s, string s, string s, string s, string s) centerprint6 = #73;
|
||||
//void (entity client, string s, string s, string s, string s, string s, string s, string s) centerprint7 = #73;
|
||||
void (vector pos, string samp, float vol, float atten) ambientsound = #74;
|
||||
string (string s) precache_model2 = #75; // registered version only
|
||||
string (string s) precache_sound2 = #76; // registered version only
|
||||
string (string s) precache_file2 = #77; // registered version only
|
||||
void (entity e) setspawnparms = #78; // set parm1... to the
|
||||
//void (entity plr, float achievement) achievement = #79;
|
||||
void (entity killer, entity killee) logfrag = #79; // add to stats
|
||||
float (string s) stof = #81; // 2001-09-20 QuakeC string manipulation by FrikaC
|
||||
void (vector where, float set) multicast = #82;
|
||||
vector (entity what) Get_Waypoint_Near = #83;
|
||||
float (entity zombie, entity target) Do_Pathfind_psp = #84;
|
||||
void (string s) Open_Waypoint = #85;
|
||||
vector (entity zombie,vector start,vector min, vector max) Get_Next_Waypoint = #86;
|
||||
void (entity client, float type, float cost, float weapon) useprint = #87;
|
||||
vector (entity zombie,vector start,vector min, vector max) Get_First_Waypoint = #88;
|
||||
//void (string s) Close_Waypoint = #89;
|
||||
//void (vector start, vector min, vector max, vector end, float nomonsters, entity forent) tracebox = #90;
|
||||
entity (entity start, .float field, float match) findfloat = #98;
|
||||
float (vector start, vector min, vector max, vector end, float nomonsters, entity forent) tracemove = #99;
|
||||
// 2001-09-20 QuakeC file access by FrikaC start
|
||||
float (string filename, float mode) fopen = #110;
|
||||
void (float fhandle) fclose = #111;
|
||||
string (float fhandle) fgets = #112;
|
||||
void (float fhandle, string s) fputs = #113;
|
||||
float (string s) strlen = #114;
|
||||
string (string s1, string s2) strcat = #115;
|
||||
string (string s, float start, float length) substring = #116;
|
||||
vector (string s) stov = #117;
|
||||
string (string s) strzone = #118;
|
||||
string (string s) strunzone = #119;
|
||||
string (string s) strtrim = #120;
|
||||
// 2001-09-20 QuakeC file access by FrikaC end
|
||||
// 2001-11-15 DarkPlaces general builtin functions by Lord Havoc start
|
||||
float(string s) tokenize = #130;
|
||||
string(float num) argv = #131;
|
||||
// 2001-11-15 DarkPlaces general builtin functions by Lord Havoc end
|
||||
//void (string trackname) songegg = #500;
|
||||
//void () nzp_maxammo = #501;
|
||||
|
||||
//
|
||||
// constants
|
||||
//
|
||||
|
||||
float FALSE = 0;
|
||||
float TRUE = 1;
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
|
||||
// edict.flags
|
||||
float FL_FLY = 1;
|
||||
float FL_SWIM = 2;
|
||||
float FL_CLIENT = 8; // set for all client edicts
|
||||
float FL_INWATER = 16; // for enter / leave water splash
|
||||
float FL_MONSTER = 32;
|
||||
float FL_GODMODE = 64; // player cheat
|
||||
float FL_NOTARGET = 128; // player cheat
|
||||
float FL_ITEM = 256; // extra wide size for bonus items
|
||||
float FL_ONGROUND = 512; // standing on something
|
||||
float FL_PARTIALGROUND = 1024; // not all corners are valid
|
||||
float FL_WATERJUMP = 2048; // player jumping out of water
|
||||
float FL_JUMPRELEASED = 4096; // for jump debouncing
|
||||
#define FL_FLY 1
|
||||
#define FL_SWIM 2
|
||||
#define FL_CLIENT 8 // set for all client edicts
|
||||
#define FL_INWATER 16 // for enter / leave water splash
|
||||
#define FL_MONSTER 32
|
||||
#define FL_GODMODE 64 // player cheat
|
||||
#define FL_NOTARGET 128 // player cheat
|
||||
#define FL_ITEM 256 // extra wide size for bonus items
|
||||
#define FL_ONGROUND 512 // standing on something
|
||||
#define FL_PARTIALGROUND 1024 // not all corners are valid
|
||||
#define FL_WATERJUMP 2048 // player jumping out of water
|
||||
|
||||
// edict.movetype values
|
||||
float MOVETYPE_NONE = 0; // never moves
|
||||
//float MOVETYPE_ANGLENOCLIP = 1;
|
||||
//float MOVETYPE_ANGLECLIP = 2;
|
||||
float MOVETYPE_WALK = 3; // players only
|
||||
float MOVETYPE_STEP = 4; // discrete, not real time unless fall
|
||||
float MOVETYPE_FLY = 5;
|
||||
float MOVETYPE_TOSS = 6; // gravity
|
||||
float MOVETYPE_PUSH = 7; // no clip to world, push and crush
|
||||
float MOVETYPE_NOCLIP = 8;
|
||||
float MOVETYPE_FLYMISSILE = 9; // fly with extra size against monsters
|
||||
float MOVETYPE_BOUNCE = 10;
|
||||
float MOVETYPE_BOUNCEMISSILE = 11; // bounce with extra size
|
||||
#define MOVETYPE_NONE 0 // never moves
|
||||
#define MOVETYPE_ANGLENOCLIP 1
|
||||
#define MOVETYPE_ANGLECLIP 2
|
||||
#define MOVETYPE_WALK 3 // players only
|
||||
#define MOVETYPE_STEP 4 // discrete, not real time unless fall
|
||||
#define MOVETYPE_FLY 5
|
||||
#define MOVETYPE_TOSS 6 // gravity
|
||||
#define MOVETYPE_PUSH 7 // no clip to world, push and crush
|
||||
#define MOVETYPE_NOCLIP 8
|
||||
#define MOVETYPE_FLYMISSILE 9 // fly with extra size against monsters
|
||||
#define MOVETYPE_BOUNCE 10
|
||||
#define MOVETYPE_BOUNCEMISSILE 11 // bounce with extra size
|
||||
#define MOVETYPE_FOLLOW 12
|
||||
|
||||
#define MOVE_HITMODEL 0
|
||||
|
||||
// edict.solid values
|
||||
float SOLID_NOT = 0; // no interaction with other objects
|
||||
float SOLID_TRIGGER = 1; // touch on edge, but not blocking
|
||||
float SOLID_BBOX = 2; // touch on edge, block
|
||||
float SOLID_SLIDEBOX = 3; // touch on edge, but not an onground
|
||||
float SOLID_BSP = 4; // bsp clip, touch on edge, block
|
||||
#define SOLID_NOT 0 // no interaction with other objects
|
||||
#define SOLID_TRIGGER 1 // touch on edge, but not blocking
|
||||
#define SOLID_BBOX 2 // touch on edge, block
|
||||
#define SOLID_SLIDEBOX 3 // touch on edge, but not an onground
|
||||
#define SOLID_BSP 4 // bsp clip, touch on edge, block
|
||||
#define SOLID_CORPSE 5 // bsp clip, touch on edge, block
|
||||
|
||||
float DEAD_NO = 0;
|
||||
float DEAD_DYING = 1;
|
||||
float DEAD_DEAD = 2;
|
||||
float DEAD_RESPAWNABLE = 3;
|
||||
// range values
|
||||
#define RANGE_MELEE 0
|
||||
#define RANGE_NEAR 1
|
||||
#define RANGE_MID 2
|
||||
#define RANGE_FAR 3
|
||||
|
||||
// deadflag values
|
||||
#define DEAD_NO 0
|
||||
#define DEAD_DYING 1
|
||||
#define DEAD_DEAD 2
|
||||
#define DEAD_RESPAWNABLE 3
|
||||
|
||||
// takedamage values
|
||||
float DAMAGE_NO = 0;
|
||||
float DAMAGE_YES = 1;
|
||||
float DAMAGE_AIM = 2;
|
||||
#define DAMAGE_NO 0
|
||||
#define DAMAGE_YES 1
|
||||
#define DAMAGE_AIM 2
|
||||
#define DAMAGE_NOMARKER 3
|
||||
|
||||
// point content values
|
||||
float CONTENT_EMPTY = -1;
|
||||
float CONTENT_SOLID = -2;
|
||||
float CONTENT_WATER = -3;
|
||||
float CONTENT_SLIME = -4;
|
||||
float CONTENT_LAVA = -5;
|
||||
float CONTENT_SKY = -6;
|
||||
#define CONTENT_EMPTY -1
|
||||
#define CONTENT_SOLID -2
|
||||
#define CONTENT_WATER -3
|
||||
#define CONTENT_SLIME -4
|
||||
#define CONTENT_LAVA -5
|
||||
#define CONTENT_SKY -6
|
||||
|
||||
float STATE_TOP = 0;
|
||||
float STATE_BOTTOM = 1;
|
||||
float STATE_UP = 2;
|
||||
float STATE_DOWN = 3;
|
||||
//doors
|
||||
#define STATE_TOP 0
|
||||
#define STATE_BOTTOM 1
|
||||
#define STATE_UP 2
|
||||
#define STATE_DOWN 3
|
||||
|
||||
vector VEC_ORIGIN = '0 0 0';
|
||||
#define VEC_ORIGIN '0 0 0'
|
||||
|
||||
//Half Life 1 Hull Sizes ADDED BY BLUBS, COMMENTED ORIGINAL QUAKE BBOX SIZS OUT
|
||||
#define VEC_HULL_MIN '-16 -16 -32'
|
||||
#define VEC_HULL_MAX '16 16 40'
|
||||
#define VEC_HULL2_MIN '-32 -32 -24'
|
||||
#define VEC_HULL2_MAX '32 32 64'
|
||||
|
||||
// protocol bytes
|
||||
float SVC_TEMPENTITY = 23;
|
||||
float SVC_KILLEDMONSTER = 27;
|
||||
float SVC_FOUNDSECRET = 28;
|
||||
float SVC_INTERMISSION = 30;
|
||||
float SVC_FINALE = 31;
|
||||
float SVC_CDTRACK = 32;
|
||||
float SVC_SELLSCREEN = 33;
|
||||
float SVC_SMALLKICK = 34;
|
||||
float SVC_BIGKICK = 35;
|
||||
float SVC_MUZZLEFLASH = 39;
|
||||
#define SVC_BAD 0
|
||||
#define SVC_NOP 1
|
||||
#define SVC_DISCONNECT 2
|
||||
#define SVC_UPDATESTAT 3
|
||||
#define SVC_VERSION 4
|
||||
#define SVC_SETVIEW 5
|
||||
#define SVC_SOUND 6
|
||||
#define SVC_TIME 7
|
||||
#define SVC_PRINT 8
|
||||
#define SVC_STUFFTEXT 9
|
||||
#define SVC_SETANGLE 10
|
||||
#define SVC_SERVERINFO 11
|
||||
#define SVC_LIGHTSTYLE 12
|
||||
#define SVC_UPDATENAME 13
|
||||
#define SVC_UPDATEPOINTS 14
|
||||
#define SVC_CLIENTDATA 15
|
||||
#define SVC_STOPSOUND 16
|
||||
#define SVC_PARTICLE 18
|
||||
#define SVC_DAMAGE 19
|
||||
#define SVC_SPAWNSTATIC 20
|
||||
#define SVC_SPAWNBINARY 21
|
||||
#define SVC_SPAWNBASELINE 22
|
||||
#define SVC_TEMPENTITY 23
|
||||
#define SVC_SETPAUSE 24
|
||||
#define SVC_SIGNONNUM 25
|
||||
#define SVC_CENTERPRINT 26
|
||||
#define SVC_KILLEDMONSTER 27
|
||||
#define SVC_FOUNDSECRET 28
|
||||
#define SVC_SPAWNSTATICSOUND 29 // 1998-08-08 Complete SVC list by Zhenga
|
||||
#define SVC_INTERMISSION 30
|
||||
#define SVC_FINALE 31
|
||||
#define SVC_CDTRACK 32
|
||||
#define SVC_SELLSCREEN 33
|
||||
#define SVC_SMALLKICK 34
|
||||
#define SVC_BIGKICK 35
|
||||
//#define SVC_CUTSCENE 34 // 1998-08-08 Complete SVC list by Zhenga
|
||||
//#define SVC_WEAPONFIRE 35
|
||||
#define SVC_WEAPONFIRE 35
|
||||
#define SVC_HITMARK 36
|
||||
#define SVC_LIMBUPDATE 51 // naievil -- keep me
|
||||
#define SVC_BSPDECAL 50 // naievil -- keep me
|
||||
#define SVC_ACHIEVEMENT 52
|
||||
#define SVC_HITMARK 36
|
||||
#define SVC_USEPRINT 38
|
||||
#define SVC_MUZZLEFLASH 39
|
||||
|
||||
#define TE_SPIKE 0
|
||||
#define TE_SUPERSPIKE 1
|
||||
#define TE_GUNSHOT 2
|
||||
#define TE_EXPLOSION 3
|
||||
#define TE_TAREXPLOSION 4
|
||||
#define TE_LIGHTNING1 5
|
||||
#define TE_LIGHTNING2 6
|
||||
#define TE_WIZSPIKE 7
|
||||
#define TE_KNIGHTSPIKE 8
|
||||
#define TE_LIGHTNING3 9
|
||||
#define TE_LAVASPLASH 10
|
||||
#define TE_TELEPORT 11
|
||||
#define TE_RAYSPLASHGREEN 14
|
||||
#define TE_RAYSPLASHRED 15
|
||||
|
||||
// sound channels
|
||||
// channel 0 never willingly overrides
|
||||
// other channels (1-7) allways override a playing sound on that channel
|
||||
float CHAN_AUTO = 0;
|
||||
float CHAN_WEAPON = 1;
|
||||
float CHAN_VOICE = 2;
|
||||
float CHAN_ITEM = 3;
|
||||
float CHAN_BODY = 4;
|
||||
float CHAN_NO_PHS_ADD = 8; // ie: CHAN_BODY+CHAN_NO_PHS_ADD
|
||||
// Player uses channel 5 for all weapon reload sfx
|
||||
#define CHAN_AUTO 0
|
||||
#define CHAN_WEAPON 1
|
||||
#define CHAN_VOICE 2
|
||||
#define CHAN_ITEM 3
|
||||
#define CHAN_BODY 4
|
||||
#define CHAN_NO_PHS_ADD 8 // ie: CHAN_BODY+CHAN_NO_PHS_ADD
|
||||
|
||||
float ATTN_NONE = 0;
|
||||
float ATTN_NORM = 1;
|
||||
float ATTN_IDLE = 2;
|
||||
float ATTN_STATIC = 3;
|
||||
#define ATTN_NONE 0
|
||||
#define ATTN_NORM 1
|
||||
#define ATTN_IDLE 2
|
||||
#define ATTN_STATIC 3
|
||||
|
||||
// update types
|
||||
#define UPDATE_GENERAL 0
|
||||
#define UPDATE_STATIC 1
|
||||
#define UPDATE_BINARY 2
|
||||
#define UPDATE_TEMP 3
|
||||
|
||||
// entity effects
|
||||
#define EF_BLUE 1
|
||||
|
@ -297,370 +459,36 @@ float ATTN_STATIC = 3;
|
|||
#define EF_RAYGREEN 16384
|
||||
|
||||
// messages
|
||||
float MSG_BROADCAST = 0; // unreliable to all
|
||||
float MSG_ONE = 1; // reliable to one (msg_entity)
|
||||
float MSG_ALL = 2; // reliable to all
|
||||
float MSG_INIT = 3; // write to the init string
|
||||
float MSG_MULTICAST = 4; // for multicast() call
|
||||
#define MSG_BROADCAST 0 // unreliable to all
|
||||
#define MSG_ONE 1 // reliable to one (msg_entity)
|
||||
#define MSG_ALL 2 // reliable to all
|
||||
#define MSG_INIT 3 // write to the init string
|
||||
#define MSG_MULTICASE 4 // for multicast() call
|
||||
|
||||
// message levels
|
||||
float PRINT_LOW = 0; // pickup messages
|
||||
float PRINT_MEDIUM = 1; // death messages
|
||||
float PRINT_HIGH = 2; // critical messages
|
||||
float PRINT_CHAT = 3; // also goes to chat console
|
||||
#define PRINT_LOW 0 // pickup messages
|
||||
#define PRINT_MEDIUM 1 // death messages
|
||||
#define PRINT_HIGH 2 // critical messages
|
||||
#define PRINT_CHAT 3 // also goes to chat console
|
||||
|
||||
#define AS_STRAIGHT 1
|
||||
#define AS_SLIDING 2
|
||||
#define AS_MELEE 3
|
||||
#define AS_MISSILE 4
|
||||
|
||||
// multicast sets
|
||||
float MULTICAST_ALL = 0; // every client
|
||||
float MULTICAST_PHS = 1; // within hearing
|
||||
float MULTICAST_PVS = 2; // within sight
|
||||
float MULTICAST_ALL_R = 3; // every client, reliable
|
||||
float MULTICAST_PHS_R = 4; // within hearing, reliable
|
||||
float MULTICAST_PVS_R = 5; // within sight, reliable
|
||||
|
||||
|
||||
|
||||
|
||||
//================================================
|
||||
|
||||
//
|
||||
// globals
|
||||
//
|
||||
string string_null; // null string, nothing should be held here
|
||||
entity activator; // the entity that activated a trigger or brush
|
||||
float framecount;
|
||||
|
||||
//
|
||||
// cvars checked each frame
|
||||
//
|
||||
float teamplay;
|
||||
float deathmatch;
|
||||
|
||||
//================================================
|
||||
|
||||
//
|
||||
// world fields (FIXME: make globals)
|
||||
//
|
||||
.string wad;
|
||||
.string map;
|
||||
.float worldtype; // 0=medieval 1=metal 2=base
|
||||
|
||||
//================================================
|
||||
|
||||
.string killtarget;
|
||||
|
||||
//
|
||||
// quakeed fields
|
||||
//
|
||||
.float light_lev; // not used by game, but parsed by light util
|
||||
.float style;
|
||||
|
||||
|
||||
//
|
||||
// monster ai
|
||||
//
|
||||
.void() th_stand;
|
||||
.void() th_walk;
|
||||
.void() th_run;
|
||||
.void() th_missile;
|
||||
.void() th_melee;
|
||||
.void(entity attacker, float damage) th_pain;
|
||||
.void() th_die;
|
||||
|
||||
.entity oldenemy; // mad at this player before taking damage
|
||||
|
||||
.float speed;
|
||||
|
||||
.float lefty;
|
||||
|
||||
.float search_time;
|
||||
.float attack_state;
|
||||
|
||||
float AS_STRAIGHT = 1;
|
||||
float AS_SLIDING = 2;
|
||||
float AS_MELEE = 3;
|
||||
float AS_MISSILE = 4;
|
||||
|
||||
//
|
||||
// player only fields
|
||||
//
|
||||
.float voided;
|
||||
.float walkframe;
|
||||
|
||||
// Zoid Additions
|
||||
.float gravity; // Gravity Multiplier (0 to 1.0)
|
||||
|
||||
|
||||
|
||||
.float attack_finished;
|
||||
.float pain_finished;
|
||||
|
||||
.float invincible_finished;
|
||||
.float invisible_finished;
|
||||
.float super_damage_finished;
|
||||
.float radsuit_finished;
|
||||
|
||||
.float invincible_time, invincible_sound;
|
||||
.float invisible_time, invisible_sound;
|
||||
.float super_time, super_sound;
|
||||
.float rad_time;
|
||||
.float fly_sound;
|
||||
|
||||
.float axhitme;
|
||||
|
||||
.float show_hostile; // set to time+0.2 whenever a client fires a
|
||||
// weapon or takes damage. Used to alert
|
||||
// monsters that otherwise would let the player go
|
||||
.float jump_flag; // player jump flag
|
||||
.float swim_flag; // player swimming sound flag
|
||||
.float air_finished; // when time > air_finished, start drowning
|
||||
.float bubble_count; // keeps track of the number of bubbles
|
||||
.string deathtype; // keeps track of how the player died
|
||||
|
||||
//
|
||||
// object stuff
|
||||
//
|
||||
.string mdl;
|
||||
.vector mangle; // angle at start
|
||||
|
||||
.vector oldorigin; // only used by secret door
|
||||
|
||||
.float t_length, t_width;
|
||||
|
||||
|
||||
//
|
||||
// doors, etc
|
||||
//
|
||||
.vector dest, dest1, dest2;
|
||||
.float wait; // time from firing to restarting
|
||||
.float delay; // time from activation to firing
|
||||
.entity trigger_field; // door's trigger entity
|
||||
.string noise4;
|
||||
|
||||
//
|
||||
// monsters
|
||||
//
|
||||
.float pausetime;
|
||||
.entity movetarget;
|
||||
|
||||
|
||||
//
|
||||
// doors
|
||||
//
|
||||
.float aflag;
|
||||
.float dmg; // damage done by door when hit
|
||||
|
||||
//
|
||||
// misc
|
||||
//
|
||||
.float cnt; // misc flag
|
||||
|
||||
//
|
||||
// subs
|
||||
//
|
||||
.void() think1;
|
||||
.vector finaldest, finalangle;
|
||||
|
||||
//
|
||||
// triggers
|
||||
//
|
||||
.float count; // for counting triggers
|
||||
|
||||
|
||||
//
|
||||
// plats / doors / buttons
|
||||
//
|
||||
.float lip;
|
||||
.float state;
|
||||
.vector pos1, pos2; // top and bottom positions
|
||||
.float height;
|
||||
|
||||
//
|
||||
// sounds
|
||||
//
|
||||
.float waitmin, waitmax;
|
||||
.float distance;
|
||||
.float volume;
|
||||
|
||||
.float sprintflag;
|
||||
|
||||
//
|
||||
// builtin functions
|
||||
//
|
||||
|
||||
void(vector ang) makevectors = #1; // sets v_forward, etc globals
|
||||
void(entity e, vector o) setorigin = #2;
|
||||
void(entity e, string m) setmodel = #3; // set movetype and solid first
|
||||
void(entity e, vector min, vector max) setsize = #4;
|
||||
|
||||
void() break = #6;
|
||||
float() random = #7; // returns 0 - 1
|
||||
void(entity e, float chan, string samp, float vol, float atten) sound = #8;
|
||||
vector(vector v) normalize = #9;
|
||||
void(string e) error = #10;
|
||||
void(string e) objerror = #11;
|
||||
float(vector v) vlen = #12;
|
||||
float(vector v) vectoyaw = #13;
|
||||
entity() spawn = #14;
|
||||
void(entity e) remove = #15;
|
||||
void(vector v1, vector v2, float nomonsters, entity forent) traceline = #16;
|
||||
entity() checkclient = #17; // returns a client to look for
|
||||
entity(entity start, .string fld, string match) find = #18;
|
||||
string(string s) precache_sound = #19;
|
||||
string(string s) precache_model = #20;
|
||||
void(entity client, string s)stuffcmd = #21;
|
||||
entity(vector org, float rad) findradius = #22;
|
||||
void(float level, string s) bprint = #23;
|
||||
void(entity client, float level, string s) sprint = #24;
|
||||
void(string s) dprint = #25;
|
||||
string(float f) ftos = #26;
|
||||
string(vector v) vtos = #27;
|
||||
void() coredump = #28; // prints all edicts
|
||||
void() traceon = #29; // turns statment trace on
|
||||
void() traceoff = #30;
|
||||
void(entity e) eprint = #31; // prints an entire edict
|
||||
float(float yaw, float dist) walkmove = #32; // returns TRUE or FALSE
|
||||
float(entity zombie, float which, entity limb) updateLimb = #33;
|
||||
float(float yaw, float dist) droptofloor = #34; // TRUE if landed on floor
|
||||
void(float style, string value) lightstyle = #35;
|
||||
float(float v) rint = #36; // round to nearest int
|
||||
float(float v) floor = #37; // largest integer <= v
|
||||
float(float v) ceil = #38; // smallest integer >= v
|
||||
float(entity e) checkbottom = #40; // true if self is on ground
|
||||
float(vector v) pointcontents = #41; // returns a CONTENT_*
|
||||
float(float f) fabs = #43;
|
||||
vector(entity e, float speed) aim = #44; // returns the shooting vector
|
||||
float(string s) cvar = #45; // return cvar.value
|
||||
void(string s) localcmd = #46; // put string into local que
|
||||
entity(entity e) nextent = #47; // for looping through all ents
|
||||
void() ChangeYaw = #49; // turn towards self.ideal_yaw
|
||||
vector(vector v) vectoangles = #51;
|
||||
void(float to, float f) WriteByte = #52;
|
||||
void(float to, float f) WriteChar = #53;
|
||||
void(float to, float f) WriteShort = #54;
|
||||
void(float to, float f) WriteLong = #55;
|
||||
void(float to, float f) WriteCoord = #56;
|
||||
void(float to, float f) WriteAngle = #57;
|
||||
void(float to, string s) WriteString = #58;
|
||||
void(float to, entity s) WriteEntity = #59;
|
||||
void(float step) movetogoal = #67;
|
||||
string(string s) precache_file = #68; // no effect except for -copy
|
||||
void(entity e) makestatic = #69;
|
||||
void(string s) changelevel = #70;
|
||||
void(string var, string val) cvar_set = #72; // sets cvar.value
|
||||
void(entity client, string s) centerprint = #73; // sprint, but in middle
|
||||
void(vector pos, string samp, float vol, float atten) ambientsound = #74;
|
||||
string(string s) precache_model2 = #75; // registered version only
|
||||
string(string s) precache_sound2 = #76; // registered version only
|
||||
string(string s) precache_file2 = #77; // registered version only
|
||||
void(entity e) setspawnparms = #78; // set parm1... to the
|
||||
void(entity killer, entity killee) logfrag = #79; // add to stats
|
||||
string(entity e, string key) infokey = #80; // get a key value (world = serverinfo)
|
||||
float(string s) stof = #81; // convert string to float
|
||||
void(vector where, float set) multicast = #82;
|
||||
vector(entity what) Get_Waypoint_Near = #83;
|
||||
float(entity zombie, entity target) Do_Pathfind_psp = #84;
|
||||
void(string s) Open_Waypoint = #85;
|
||||
vector(entity zombie,vector start,vector min, vector max) Get_Next_Waypoint = #86;
|
||||
void(entity client, float type, float cost, float weapon) useprint = #87;
|
||||
vector(entity zombie,vector start,vector min, vector max) Get_First_Waypoint = #88;
|
||||
entity (entity start, .float field, float match) findfloat = #98;
|
||||
|
||||
// New NZP custom ones
|
||||
float(string filename, float mode) fopen = #110;
|
||||
void(float fhandle) fclose = #111;
|
||||
string(float fhandle) fgets = #112;
|
||||
void(float fhandle, string s) fputs = #113;
|
||||
float(string s) strlen = #114;
|
||||
string(string s1, string s2) strcat = #115;
|
||||
string(string s, float start, float length) substring = #116;
|
||||
vector(string s) stov = #117;
|
||||
string(string s) strzone = #118;
|
||||
string(string s) strunzone = #119;
|
||||
string(string s) strtrim = #120;
|
||||
float(string s) tokenize = #130; // Was #441
|
||||
string(float num) argv = #131; // Was #442
|
||||
|
||||
float(entity targ, entity inflictor) CanDamage;
|
||||
|
||||
#define MULTICAST_ALL 0 // every client
|
||||
#define MULTICAST_PHS 1 // within hearing
|
||||
#define MULTICAST_PVS 2 // within sight
|
||||
#define MULTICAST_ALL_R 3 // every client, reliable
|
||||
#define MULTICAST_PHS_R 4 // within hearing, reliable
|
||||
#define MULTICAST_PVS_R 5 // within sight, reliable
|
||||
|
||||
// file operations
|
||||
#define FILE_READ 0
|
||||
#define FILE_APPEND 1
|
||||
#define FILE_WRITE 2
|
||||
#define SVC_WEAPONFIRE 35
|
||||
#define SVC_HITMARK 36
|
||||
#define SVC_LIMBUPDATE 51 // naievil -- keep me
|
||||
#define SVC_BSPDECAL 50 // naievil -- keep me
|
||||
#define SVC_ACHIEVEMENT 52
|
||||
|
||||
#define VEC_ORIGIN '0 0 0'
|
||||
|
||||
//Standard Quake View Offset
|
||||
//vector VEC_VIEW_OFS = '0 0 22';
|
||||
|
||||
//Half Life View Offset is 64
|
||||
//64 units above ground, for our purposes it's, 64 - (how low bounding box goes)
|
||||
vector VEC_VIEW_OFS = '0 0 32';
|
||||
|
||||
//Standard Quake Hull
|
||||
//vector VEC_HULL_MIN = '-16 -16 -24';
|
||||
//vector VEC_HULL_MAX = '16 16 32';
|
||||
|
||||
//Half Life 1 Hull Sizes ADDED BY BLUBS, COMMENTED ORIGINAL QUAKE BBOX SIZS OUT
|
||||
#define VEC_HULL_MIN '-16 -16 -32'
|
||||
#define VEC_HULL_MAX '16 16 40'
|
||||
|
||||
#define VEC_HULL2_MIN '-32 -32 -24'
|
||||
#define VEC_HULL2_MAX '32 32 64'
|
||||
|
||||
.string fog;
|
||||
//string world_fog;
|
||||
|
||||
.float button3;
|
||||
.float button4;
|
||||
.float button5;
|
||||
.float button6;
|
||||
.float button7;
|
||||
.float button8;
|
||||
|
||||
.float x2_icon; // double points icon
|
||||
.float insta_icon;
|
||||
.vector Flash_Offset;
|
||||
.float Flash_Size;
|
||||
.string Weapon_Name;
|
||||
|
||||
.float currentHitBoxSetup;
|
||||
.vector bbmins, bbmaxs; // Used for zombie hitboxes
|
||||
|
||||
.entity head;
|
||||
.entity larm;
|
||||
.entity rarm;
|
||||
|
||||
#define SOLID_CORPSE 5 // bsp clip, touch on edge, block
|
||||
#define TE_EXPLOSION 3
|
||||
#define TE_GUNSHOT 2
|
||||
entity windows[32];
|
||||
float wincnt;
|
||||
|
||||
.float recoil_delay;
|
||||
|
||||
float pow(float base, float n) = {
|
||||
float temp = base;
|
||||
if (n == 0) {
|
||||
return 1;
|
||||
} else {
|
||||
while (n > 0) {
|
||||
temp = temp * base;
|
||||
n = n - 1;
|
||||
}
|
||||
return temp;
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
|
||||
void enableGrayscale(void) = {
|
||||
self.renderGrayscale = 1;
|
||||
}
|
||||
|
||||
void disableGrayscale(void) = {
|
||||
self.renderGrayscale = 0;
|
||||
}
|
||||
string CMD_STRING;
|
||||
void (vector o, vector d, float color, float count) particle = {};
|
||||
|
|
|
@ -77,7 +77,7 @@ void() change_frame =
|
|||
self.nextthink = time + 1;
|
||||
}
|
||||
|
||||
#ifdef HANDHELD
|
||||
#ifndef PC
|
||||
void LoadWaypointData() = {};
|
||||
#endif
|
||||
|
||||
|
|
|
@ -26,11 +26,8 @@
|
|||
*/
|
||||
|
||||
// Dummys that should be here
|
||||
void GiveAchievement(float achievement_id, optional entity who) = {};
|
||||
void print(string s) = {};
|
||||
|
||||
float (vector start, vector min, vector max, vector end, float nomonsters, entity forent) tracemove = #99; //sB adding tracemove to quakespasm
|
||||
|
||||
void(vector o, vector d, float color, float count) particle = {};
|
||||
|
||||
#define MOVE_HITMODEL 0
|
||||
|
|
|
@ -44,9 +44,7 @@ float DOOR_SILVER_KEY = 16;
|
|||
float DOOR_TOGGLE = 32;
|
||||
float DOOR_POWER = 64;
|
||||
|
||||
entity activator;
|
||||
.float delay;
|
||||
.string killtarget;
|
||||
.void() think1;
|
||||
.vector finaldest;
|
||||
.float dmg;
|
||||
|
@ -55,7 +53,6 @@ entity activator;
|
|||
.float speed;
|
||||
.vector pos1;
|
||||
.vector pos2;
|
||||
string string_null;
|
||||
.float cost;
|
||||
.float attack_delay;
|
||||
.float lip;
|
||||
|
@ -605,7 +602,7 @@ void() func_door =
|
|||
|
||||
void() func_door_nzp =
|
||||
{
|
||||
#ifdef HANDHELD
|
||||
#ifndef PC
|
||||
if (!self.renderamt)
|
||||
self.renderamt = 255;
|
||||
|
||||
|
|
|
@ -225,10 +225,12 @@ void() place_fire =
|
|||
|
||||
void() place_model =
|
||||
{
|
||||
#ifdef HANDHELD
|
||||
#ifdef HANDHELD
|
||||
|
||||
if (self.spawnflags & 2)
|
||||
remove(self);
|
||||
#endif
|
||||
|
||||
#endif // HANDHELD
|
||||
|
||||
self.model = convert_old_asset_path(self.model);
|
||||
|
||||
|
|
|
@ -220,11 +220,9 @@ void() PU_NukeFinalize =
|
|||
entity players;
|
||||
|
||||
// give 'The F Bomb'
|
||||
#ifndef QUAKESPASM
|
||||
if (self.kills == 1) {
|
||||
GiveAchievement(4);
|
||||
}
|
||||
#endif
|
||||
|
||||
// award points
|
||||
players = find(world,classname,"player");
|
||||
|
|
|
@ -69,7 +69,7 @@ void () ambient_generic =
|
|||
{
|
||||
local string link;
|
||||
|
||||
// moto - FIXME: typically this is set to upper-case but QUAKESPASM and HANDHELD lack strtoupper(); assume lower-case!
|
||||
// moto - FIXME: typically this is set to upper-case but only FTE has strtoupper(); assume lower-case!
|
||||
link = self.message;
|
||||
|
||||
if (link == "nolink") {
|
||||
|
|
|
@ -124,10 +124,13 @@ void zapper_play () {
|
|||
local vector targetorg = zents.origin;
|
||||
|
||||
if (zents) {
|
||||
#ifdef PC
|
||||
|
||||
#ifdef PC
|
||||
|
||||
te_lightning2(self, self.origin, zents.origin);
|
||||
#endif
|
||||
#ifdef HANDHELD
|
||||
|
||||
#else
|
||||
|
||||
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
|
||||
WriteByte (MSG_BROADCAST, TE_LIGHTNING2);
|
||||
WriteEntity (MSG_BROADCAST, self);
|
||||
|
@ -137,7 +140,9 @@ void zapper_play () {
|
|||
WriteCoord (MSG_BROADCAST, targetorg_x);
|
||||
WriteCoord (MSG_BROADCAST, targetorg_y);
|
||||
WriteCoord (MSG_BROADCAST, targetorg_z);
|
||||
#endif
|
||||
|
||||
#endif // PC
|
||||
|
||||
}
|
||||
|
||||
zents.touch = zapper_do_damage;
|
||||
|
|
|
@ -133,7 +133,6 @@ void() InitTrigger =
|
|||
self.model = "";
|
||||
};
|
||||
|
||||
#ifndef HANDHELD
|
||||
entity last_act_trigger;
|
||||
void() trigger_activator_touch =
|
||||
{
|
||||
|
@ -240,7 +239,6 @@ void() trigger_activator =
|
|||
InitTrigger ();
|
||||
self.touch = trigger_activator_touch;
|
||||
}
|
||||
#endif
|
||||
|
||||
void() use_wall_weapon =
|
||||
{
|
||||
|
|
|
@ -50,13 +50,18 @@ void() screen_shake =
|
|||
else
|
||||
zoom_factor = 1;
|
||||
|
||||
#ifdef HANDHELD
|
||||
#ifndef PC
|
||||
|
||||
self.enemy.punchangle_y = r * 8 * zoom_factor;
|
||||
self.enemy.punchangle_x = (4 + (s * 4)) * zoom_factor;
|
||||
#else
|
||||
|
||||
#else
|
||||
|
||||
self.enemy.punchangle_y = r * 4 * zoom_factor;
|
||||
self.enemy.punchangle_x = (4 + (s * 2)) * zoom_factor;
|
||||
#endif
|
||||
|
||||
#endif // PC
|
||||
|
||||
};
|
||||
|
||||
void() Window_repaired =
|
||||
|
|
|
@ -128,12 +128,12 @@ void() precaches =
|
|||
{
|
||||
precache_model ("models/player.mdl");
|
||||
|
||||
#ifndef HANDHELD
|
||||
#ifndef QUAKESPASM
|
||||
#ifdef PC
|
||||
|
||||
if (world.song != "")
|
||||
precache_sound (world.song);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif // PC
|
||||
|
||||
//
|
||||
// Models
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/*
|
||||
server/psp_specifics.qc
|
||||
server/non_fte_specifics.qc
|
||||
|
||||
stuff only for psp, remove later
|
||||
Some of the misc. non-FTE QC functions.
|
||||
|
||||
Copyright (C) 2021 NZ:P Team
|
||||
Copyright (C) 2021-2022 NZ:P Team
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
|
@ -50,10 +50,7 @@ void () CL_SendWeaponFire =
|
|||
self.recoil_delay = 60/return_time + time;
|
||||
}
|
||||
|
||||
void() trigger_activator = {};
|
||||
|
||||
void() ParseClientCommand = {SV_ParseClientCommand(CMD_STRING);}
|
||||
|
||||
void() PutClientInServer;
|
||||
void() InitRounds;
|
||||
|
|
@ -244,135 +244,7 @@ void(string weaponFile) nzd_defineweapon = {
|
|||
fclose(f);
|
||||
}
|
||||
|
||||
//basically copying the waypoint code.. yikes
|
||||
|
||||
void() load_nzd = {
|
||||
|
||||
#ifndef QUAKESPASM
|
||||
float file, point;
|
||||
string h;
|
||||
float loop;
|
||||
float wepdata = 0;
|
||||
|
||||
h = strcat(mappath, ".nzd");
|
||||
file = fopen (h, FILE_READ);
|
||||
|
||||
if (file == -1)
|
||||
{
|
||||
if (cvar("developer"))
|
||||
dprint(".NZD file not found, using default settings..\n");
|
||||
return;
|
||||
}
|
||||
|
||||
point = 0;
|
||||
loop = 1;
|
||||
|
||||
while(loop) {
|
||||
string line;
|
||||
line = fgets(file);
|
||||
if not (line) {
|
||||
bprint(PRINT_HIGH, "End of file\n");
|
||||
loop = 0;
|
||||
break;
|
||||
}
|
||||
h = strtrim(line);
|
||||
|
||||
//print(h, "\n");
|
||||
if (h == "") {
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (point) {
|
||||
case 0:
|
||||
//switch-ception!
|
||||
switch(h) {
|
||||
case "mech": point = 1; break;
|
||||
default: bprint(PRINT_HIGH, strcat("Error: unknown variable ", strcat(h, "\n")));
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (h == "{") {
|
||||
point = 2;
|
||||
} else {
|
||||
bprint(PRINT_HIGH, strcat("Error: unknown variable ", strcat(h, " expected {\n")));
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
tokenize(h);
|
||||
|
||||
string value, variable;
|
||||
variable = strtrim(argv(0));
|
||||
value = strtrim(argv(2));
|
||||
switch (variable) {
|
||||
case "proneperkpoints":
|
||||
G_PRONEPOINTS = stof(value);
|
||||
break;
|
||||
case "spawnpoints":
|
||||
G_STARTPOINTS = stof(value);
|
||||
break;
|
||||
case "round":
|
||||
G_STARTROUND = stof(value);
|
||||
break;
|
||||
case "worldtext":
|
||||
G_WORLDTEXT = stof(value);
|
||||
break;
|
||||
case "perkpower":
|
||||
G_PERKPOWER = stof(value);
|
||||
break;
|
||||
case "includeweapon":
|
||||
nzd_defineweapon(value);
|
||||
break;
|
||||
case "hud":
|
||||
G_HUD = value;
|
||||
break;
|
||||
case "hudhor":
|
||||
G_HUDHOR = stof(value);
|
||||
break;
|
||||
case "wep":
|
||||
point = 3;
|
||||
break;
|
||||
case "perk":
|
||||
point = 5;
|
||||
break;
|
||||
case "}":
|
||||
loop = 0;
|
||||
break;
|
||||
default:
|
||||
bprint(PRINT_HIGH, strcat("Error: unknown variable ", strcat(h, " expected }\n")));
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (h == "[") {
|
||||
point = 4;
|
||||
} else {
|
||||
bprint(PRINT_HIGH, strcat("Error: unknown variable ", strcat(h, " expected [\n")));
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (h == "]") {
|
||||
point = 2;
|
||||
} else {
|
||||
G_STARTWEAPON[wepdata] = stof(h);
|
||||
wepdata++;
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if (h == "[") {
|
||||
point = 6;
|
||||
} else {
|
||||
bprint(PRINT_HIGH, strcat("Error: unknown variable ", strcat(h, " expected [\n")));
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
if (h == "]") {
|
||||
point = 2;
|
||||
} else {
|
||||
G_PERKS = G_PERKS | stof(h);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
fclose(file);
|
||||
#endif
|
||||
}
|
|
@ -429,19 +429,25 @@ void() PlayerPostThink =
|
|||
|
||||
// Perform a traceline to keep track of entities directly
|
||||
// in front of the player.
|
||||
#ifndef QUAKESPASM
|
||||
#ifndef QUAKESPASM
|
||||
|
||||
vector source;
|
||||
|
||||
makevectors (self.v_angle);
|
||||
source = self.origin + self.view_ofs;
|
||||
|
||||
#ifdef PC
|
||||
|
||||
self.dimension_hit = HITBOX_DIM_LIMBS | HITBOX_DIM_ZOMBIES;
|
||||
|
||||
#endif // PC
|
||||
|
||||
traceline (source, source + v_forward*800*1.2, 0, self);
|
||||
|
||||
#ifdef PC
|
||||
self.dimension_hit = HITBOX_DIM_LIMBS | HITBOX_DIM_ZOMBIES;
|
||||
#endif // PC
|
||||
traceline (source, source + v_forward*800*1.2, 0, self);
|
||||
#ifdef PC
|
||||
|
||||
self.dimension_hit = HITBOX_DIM_ZOMBIES;
|
||||
|
||||
#endif // PC
|
||||
|
||||
|
||||
|
@ -456,7 +462,8 @@ void() PlayerPostThink =
|
|||
self.facingenemy = true;
|
||||
else
|
||||
self.facingenemy = false;
|
||||
#endif
|
||||
|
||||
#endif // QUAKESPASM
|
||||
};
|
||||
|
||||
void() ClientKill = {};
|
||||
|
|
|
@ -232,26 +232,28 @@ void() NewRound =
|
|||
roundtype = 1;
|
||||
|
||||
if (world.fog) {
|
||||
#ifdef HANDHELD
|
||||
|
||||
#ifndef PC
|
||||
|
||||
localcmd(strcat("fog ", world.fog));
|
||||
#else
|
||||
#ifdef PC
|
||||
|
||||
#else
|
||||
|
||||
localcmd(strcat("fog ", world_fog));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif // PC
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Remaining_Zombies = Total_Zombies = getZombieTotal();
|
||||
|
||||
#ifndef QUAKESPASM
|
||||
switch(rounds) {
|
||||
case 5: GiveAchievement(0); break;
|
||||
case 10: GiveAchievement(1); break;
|
||||
case 15: GiveAchievement(2); break;
|
||||
default: break;
|
||||
}
|
||||
#endif // QUAKESPASM
|
||||
|
||||
// Set up delay for zombie spawning
|
||||
local float spawndelay;
|
||||
|
|
|
@ -159,23 +159,41 @@ void() W_FireRay =
|
|||
// Prepare trail effects.
|
||||
if (IsPapWeapon(porter.weapon)) {
|
||||
#ifdef HANDHELD
|
||||
|
||||
porter.effects = EF_RAYRED;
|
||||
|
||||
#endif // HANDHELD
|
||||
|
||||
#ifdef QUAKESPASM
|
||||
|
||||
porter.effects = EF_RED;
|
||||
|
||||
#endif // QUAKESPASM
|
||||
|
||||
#ifdef PC
|
||||
|
||||
Light_Custom(porter, false, 75, 2, 0.25, 0.25);
|
||||
|
||||
#endif // PC
|
||||
|
||||
} else {
|
||||
|
||||
#ifdef HANDHELD
|
||||
|
||||
porter.effects = EF_RAYGREEN;
|
||||
|
||||
#endif // HANDHELD
|
||||
|
||||
#ifdef QUAKESPASM
|
||||
|
||||
porter.effects = EF_GREEN;
|
||||
|
||||
#endif // QUAKESPASM
|
||||
|
||||
#ifdef PC
|
||||
|
||||
Light_Custom(porter, false, 75, 0.25, 2, 0.25);
|
||||
|
||||
#endif // PC
|
||||
}
|
||||
|
||||
|
|
|
@ -60,18 +60,24 @@ void() W_AimIn =
|
|||
return;
|
||||
}
|
||||
|
||||
#ifndef PC
|
||||
#ifndef PC
|
||||
self.ADS_Offset = GetWeaponADSOfs_PSP(self.weapon);
|
||||
#endif
|
||||
#endif // PC
|
||||
|
||||
if (self.weapon == W_KAR_SCOPE || self.weapon == W_PTRS ||
|
||||
self.weapon == W_HEADCRACKER || self.weapon == W_PENETRATOR) {
|
||||
SetUpdate(self, UT_ZOOM2, 0, 0, 0);
|
||||
#ifdef QUAKESPASM
|
||||
|
||||
#ifdef QUAKESPASM
|
||||
|
||||
self.zoom = 1;
|
||||
#else
|
||||
|
||||
#else
|
||||
|
||||
self.zoom = 2;
|
||||
#endif
|
||||
|
||||
#endif // QUAKESPASM
|
||||
|
||||
self.scopetime = time + 0.3;
|
||||
} else {
|
||||
self.zoom = 1;
|
||||
|
@ -79,7 +85,6 @@ void() W_AimIn =
|
|||
|
||||
if (!self.downed)
|
||||
playaim();
|
||||
|
||||
}
|
||||
|
||||
void() W_AimOut =
|
||||
|
@ -146,9 +151,11 @@ void W_SprintStart () {
|
|||
self.sprint_duration -= self.sprint_rest_time;
|
||||
|
||||
#ifdef QUAKESPASM
|
||||
|
||||
if (!self.sprintflag) {
|
||||
return;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
if (self.fire_delay > time ||
|
||||
|
@ -726,9 +733,13 @@ void Parse_Damage () = // DO NOT TOUCH
|
|||
|
||||
body_ent.usedent = self;
|
||||
body_ent.bleedingtime = time + 2;
|
||||
#ifdef HANDHELD
|
||||
|
||||
#ifndef PC
|
||||
|
||||
updateLimb (body_ent.head.owner, 0, world);
|
||||
#endif
|
||||
|
||||
#endif // PC
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -750,9 +761,13 @@ void Parse_Damage () = // DO NOT TOUCH
|
|||
body_ent.larm.solid = SOLID_NOT;
|
||||
setmodel(body_ent.larm,"");
|
||||
body_ent.larm.frame = 0;
|
||||
#ifdef HANDHELD
|
||||
|
||||
#ifndef PC
|
||||
|
||||
updateLimb (body_ent.larm.owner, 1, world);
|
||||
#endif
|
||||
|
||||
#endif // PC
|
||||
|
||||
}
|
||||
|
||||
body_ent.larm.washit = 0;
|
||||
|
@ -772,9 +787,13 @@ void Parse_Damage () = // DO NOT TOUCH
|
|||
body_ent.rarm.solid = SOLID_NOT;
|
||||
setmodel(body_ent.rarm,"");
|
||||
body_ent.rarm.frame = 0;
|
||||
#ifdef HANDHELD
|
||||
|
||||
#ifndef PC
|
||||
|
||||
updateLimb (body_ent.rarm.owner, 2, world);
|
||||
#endif
|
||||
|
||||
#endif // PC
|
||||
|
||||
}
|
||||
|
||||
body_ent.rarm.washit = 0;
|
||||
|
@ -1169,18 +1188,26 @@ void() W_FireTesla =
|
|||
source = self.origin + self.view_ofs;
|
||||
|
||||
#ifdef PC
|
||||
|
||||
self.dimension_hit = HITBOX_DIM_LIMBS | HITBOX_DIM_ZOMBIES;
|
||||
|
||||
#endif // PC
|
||||
|
||||
FireTrace(1, 0, 0, 0);
|
||||
|
||||
#ifdef PC
|
||||
|
||||
self.dimension_hit = HITBOX_DIM_ZOMBIES;
|
||||
|
||||
#endif // PC
|
||||
|
||||
|
||||
#ifdef PC
|
||||
#ifdef PC
|
||||
|
||||
te_lightning2(self, source, trace_endpos);
|
||||
#endif
|
||||
#ifdef HANDHELD
|
||||
|
||||
#else
|
||||
|
||||
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
|
||||
WriteByte (MSG_BROADCAST, TE_LIGHTNING2);
|
||||
WriteEntity (MSG_BROADCAST, self);
|
||||
|
@ -1190,7 +1217,8 @@ void() W_FireTesla =
|
|||
WriteCoord (MSG_BROADCAST, trace_endpos_x);
|
||||
WriteCoord (MSG_BROADCAST, trace_endpos_y);
|
||||
WriteCoord (MSG_BROADCAST, trace_endpos_z);
|
||||
#endif
|
||||
|
||||
#endif // PC
|
||||
|
||||
LightningDamage (self.origin, trace_endpos + v_forward*4, self, 30);
|
||||
}
|
||||
|
@ -2057,11 +2085,17 @@ void () Impulse_Functions =
|
|||
W_SprintStop();
|
||||
break;
|
||||
case 25:
|
||||
#ifdef HANDHELD
|
||||
|
||||
#ifdef HANDHELD
|
||||
|
||||
switch_nade();
|
||||
#else
|
||||
|
||||
#else
|
||||
|
||||
W_Betty();
|
||||
#endif
|
||||
|
||||
#endif // HANDHELD
|
||||
|
||||
break;
|
||||
case 26:
|
||||
case 30:
|
||||
|
@ -2070,14 +2104,16 @@ void () Impulse_Functions =
|
|||
else
|
||||
Change_Stance();
|
||||
break;
|
||||
#ifdef QUAKESPASM
|
||||
#ifdef QUAKESPASM
|
||||
|
||||
case 31:
|
||||
self.sprintflag = 0;
|
||||
break;
|
||||
case 32:
|
||||
self.sprintflag = 1;
|
||||
break;
|
||||
#endif
|
||||
|
||||
#endif // QUAKESPASM
|
||||
case 110:
|
||||
case 111:
|
||||
W_PutOut();
|
||||
|
@ -2187,9 +2223,11 @@ void() CheckPlayer =
|
|||
CheckRevive(self);
|
||||
|
||||
#ifdef QUAKESPASM
|
||||
|
||||
if (!self.sprintflag && self.sprinting) {
|
||||
W_SprintStop();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// FIXME - can't do frame independent stance changing.. ofs starts spazzing..
|
||||
|
@ -2310,17 +2348,21 @@ void () Weapon_Logic =
|
|||
W_Frame_Update ();
|
||||
Impulse_Functions();
|
||||
|
||||
#ifndef PC
|
||||
// For HANDHELD only to tell our engine to display the scope
|
||||
#ifndef PC
|
||||
|
||||
// For HANDHELD/QUAKESPASM only to tell our engine to display the scope
|
||||
if ((self.scopetime < time) && self.scopetime) {
|
||||
self.scopetime = 0;
|
||||
self.zoom = 2;
|
||||
self.weapon2model = "";
|
||||
self.weaponmodel = "";
|
||||
}
|
||||
#else
|
||||
|
||||
#else
|
||||
|
||||
UpdatePunchangle(self);
|
||||
#endif
|
||||
|
||||
#endif // PC
|
||||
|
||||
//
|
||||
// Fire Button Logic
|
||||
|
@ -2469,12 +2511,14 @@ void () Weapon_Logic =
|
|||
|
||||
if (self.button6 && !self.semiknife)
|
||||
{
|
||||
#ifdef HANDHELD
|
||||
#ifdef HANDHELD
|
||||
|
||||
if (self.sprinting) {
|
||||
dolphin_dive();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // HANDHELD
|
||||
W_Knife();
|
||||
self.semiknife = true;
|
||||
}
|
||||
|
|
|
@ -230,12 +230,6 @@ float invertfloat(float input) {
|
|||
return (1 - input);
|
||||
}
|
||||
|
||||
//elements
|
||||
#ifndef QUAKESPASM
|
||||
string G_HUD;
|
||||
float G_HUDHOR;
|
||||
#endif
|
||||
|
||||
// custom weapon defs
|
||||
// now 90% slimmed down
|
||||
float currentWeaponTracker;
|
||||
|
|
|
@ -29,8 +29,7 @@
|
|||
#define CHAN_MUSIC 1
|
||||
#define CHAN_SFX 2
|
||||
|
||||
#ifndef HANDHELD
|
||||
#ifndef QUAKESPASM
|
||||
#ifdef PC
|
||||
void(string soundname, optional float channel, optional float volume) localsound_enhanced =
|
||||
{
|
||||
if (!volume)
|
||||
|
@ -48,5 +47,4 @@ void(string soundname, optional float channel, optional float volume) localsound
|
|||
|
||||
localsound(soundname, channel, volume);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // PC
|
||||
|
|
|
@ -4006,21 +4006,21 @@ vector(float wep) GetWeaponRecoil =
|
|||
temp1 = change_1 + change_2;
|
||||
temp2 = change_1 + change_2 + change_3;
|
||||
|
||||
#ifndef HANDHELD
|
||||
#ifdef PC
|
||||
if (r < change_1)
|
||||
final_kick_y = kick_change_x*0.25;
|
||||
else if (r < temp1)
|
||||
final_kick_x = kick_change_y*-1*.25;
|
||||
else if (r < temp2)
|
||||
final_kick_y = kick_change_z*-1*0.25;
|
||||
#else
|
||||
#else
|
||||
if (r < change_1)
|
||||
final_kick_y = kick_change_x;
|
||||
else if (r < temp1)
|
||||
final_kick_x = kick_change_y*-1;
|
||||
else if (r < temp2)
|
||||
final_kick_y = kick_change_z*-1;
|
||||
#endif
|
||||
#endif // PC
|
||||
|
||||
final_kick_y = final_kick_y + guaranteed_x;
|
||||
final_kick_x = final_kick_x - guaranteed_y;
|
||||
|
|
Loading…
Reference in a new issue