mirror of
https://git.code.sf.net/p/quake/game-source
synced 2025-04-02 05:41:00 +00:00
dos -> unix line endings
This commit is contained in:
parent
e758608902
commit
a46b5eb518
19 changed files with 10722 additions and 10722 deletions
278
nqw/buttons.qc
278
nqw/buttons.qc
|
@ -1,139 +1,139 @@
|
|||
// button and multiple button
|
||||
|
||||
void() button_wait;
|
||||
void() button_return;
|
||||
|
||||
void() button_wait =
|
||||
{
|
||||
self.state = STATE_TOP;
|
||||
self.nextthink = self.ltime + self.wait;
|
||||
self.think = button_return;
|
||||
activator = self.enemy;
|
||||
SUB_UseTargets();
|
||||
self.frame = 1; // use alternate textures
|
||||
};
|
||||
|
||||
void() button_done =
|
||||
{
|
||||
self.state = STATE_BOTTOM;
|
||||
};
|
||||
|
||||
void() button_return =
|
||||
{
|
||||
self.state = STATE_DOWN;
|
||||
SUB_CalcMove (self.pos1, self.speed, button_done);
|
||||
self.frame = 0; // use normal textures
|
||||
if (self.health)
|
||||
self.takedamage = DAMAGE_YES; // can be shot again
|
||||
};
|
||||
|
||||
|
||||
void() button_blocked =
|
||||
{ // do nothing, just don't ome all the way back out
|
||||
};
|
||||
|
||||
|
||||
void() button_fire =
|
||||
{
|
||||
if (self.state == STATE_UP || self.state == STATE_TOP)
|
||||
return;
|
||||
|
||||
sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
|
||||
|
||||
self.state = STATE_UP;
|
||||
SUB_CalcMove (self.pos2, self.speed, button_wait);
|
||||
};
|
||||
|
||||
|
||||
void() button_use =
|
||||
{
|
||||
self.enemy = activator;
|
||||
button_fire ();
|
||||
};
|
||||
|
||||
void() button_touch =
|
||||
{
|
||||
if (other.classname != "player")
|
||||
return;
|
||||
self.enemy = other;
|
||||
button_fire ();
|
||||
};
|
||||
|
||||
void() button_killed =
|
||||
{
|
||||
self.enemy = damage_attacker;
|
||||
self.health = self.max_health;
|
||||
self.takedamage = DAMAGE_NO; // wil be reset upon return
|
||||
button_fire ();
|
||||
};
|
||||
|
||||
|
||||
/*QUAKED func_button (0 .5 .8) ?
|
||||
When a button is touched, it moves some distance in the direction of it's angle, triggers all of it's targets, waits some time, then returns to it's original position where it can be triggered again.
|
||||
|
||||
"angle" determines the opening direction
|
||||
"target" all entities with a matching targetname will be used
|
||||
"speed" override the default 40 speed
|
||||
"wait" override the default 1 second wait (-1 = never return)
|
||||
"lip" override the default 4 pixel lip remaining at end of move
|
||||
"health" if set, the button must be killed instead of touched
|
||||
"sounds"
|
||||
0) steam metal
|
||||
1) wooden clunk
|
||||
2) metallic click
|
||||
3) in-out
|
||||
*/
|
||||
void() func_button =
|
||||
{
|
||||
if (self.sounds == 0)
|
||||
{
|
||||
precache_sound ("buttons/airbut1.wav");
|
||||
self.noise = "buttons/airbut1.wav";
|
||||
}
|
||||
if (self.sounds == 1)
|
||||
{
|
||||
precache_sound ("buttons/switch21.wav");
|
||||
self.noise = "buttons/switch21.wav";
|
||||
}
|
||||
if (self.sounds == 2)
|
||||
{
|
||||
precache_sound ("buttons/switch02.wav");
|
||||
self.noise = "buttons/switch02.wav";
|
||||
}
|
||||
if (self.sounds == 3)
|
||||
{
|
||||
precache_sound ("buttons/switch04.wav");
|
||||
self.noise = "buttons/switch04.wav";
|
||||
}
|
||||
|
||||
SetMovedir ();
|
||||
|
||||
self.movetype = MOVETYPE_PUSH;
|
||||
self.solid = SOLID_BSP;
|
||||
setmodel (self, self.model);
|
||||
|
||||
self.blocked = button_blocked;
|
||||
self.use = button_use;
|
||||
|
||||
if (self.health)
|
||||
{
|
||||
self.max_health = self.health;
|
||||
self.th_die = button_killed;
|
||||
self.takedamage = DAMAGE_YES;
|
||||
}
|
||||
else
|
||||
self.touch = button_touch;
|
||||
|
||||
if (!self.speed)
|
||||
self.speed = 40;
|
||||
if (!self.wait)
|
||||
self.wait = 1;
|
||||
if (!self.lip)
|
||||
self.lip = 4;
|
||||
|
||||
self.state = STATE_BOTTOM;
|
||||
|
||||
self.pos1 = self.origin;
|
||||
self.pos2 = self.pos1 + self.movedir*(fabs(self.movedir*self.size) - self.lip);
|
||||
};
|
||||
|
||||
// button and multiple button
|
||||
|
||||
void() button_wait;
|
||||
void() button_return;
|
||||
|
||||
void() button_wait =
|
||||
{
|
||||
self.state = STATE_TOP;
|
||||
self.nextthink = self.ltime + self.wait;
|
||||
self.think = button_return;
|
||||
activator = self.enemy;
|
||||
SUB_UseTargets();
|
||||
self.frame = 1; // use alternate textures
|
||||
};
|
||||
|
||||
void() button_done =
|
||||
{
|
||||
self.state = STATE_BOTTOM;
|
||||
};
|
||||
|
||||
void() button_return =
|
||||
{
|
||||
self.state = STATE_DOWN;
|
||||
SUB_CalcMove (self.pos1, self.speed, button_done);
|
||||
self.frame = 0; // use normal textures
|
||||
if (self.health)
|
||||
self.takedamage = DAMAGE_YES; // can be shot again
|
||||
};
|
||||
|
||||
|
||||
void() button_blocked =
|
||||
{ // do nothing, just don't ome all the way back out
|
||||
};
|
||||
|
||||
|
||||
void() button_fire =
|
||||
{
|
||||
if (self.state == STATE_UP || self.state == STATE_TOP)
|
||||
return;
|
||||
|
||||
sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
|
||||
|
||||
self.state = STATE_UP;
|
||||
SUB_CalcMove (self.pos2, self.speed, button_wait);
|
||||
};
|
||||
|
||||
|
||||
void() button_use =
|
||||
{
|
||||
self.enemy = activator;
|
||||
button_fire ();
|
||||
};
|
||||
|
||||
void() button_touch =
|
||||
{
|
||||
if (other.classname != "player")
|
||||
return;
|
||||
self.enemy = other;
|
||||
button_fire ();
|
||||
};
|
||||
|
||||
void() button_killed =
|
||||
{
|
||||
self.enemy = damage_attacker;
|
||||
self.health = self.max_health;
|
||||
self.takedamage = DAMAGE_NO; // wil be reset upon return
|
||||
button_fire ();
|
||||
};
|
||||
|
||||
|
||||
/*QUAKED func_button (0 .5 .8) ?
|
||||
When a button is touched, it moves some distance in the direction of it's angle, triggers all of it's targets, waits some time, then returns to it's original position where it can be triggered again.
|
||||
|
||||
"angle" determines the opening direction
|
||||
"target" all entities with a matching targetname will be used
|
||||
"speed" override the default 40 speed
|
||||
"wait" override the default 1 second wait (-1 = never return)
|
||||
"lip" override the default 4 pixel lip remaining at end of move
|
||||
"health" if set, the button must be killed instead of touched
|
||||
"sounds"
|
||||
0) steam metal
|
||||
1) wooden clunk
|
||||
2) metallic click
|
||||
3) in-out
|
||||
*/
|
||||
void() func_button =
|
||||
{
|
||||
if (self.sounds == 0)
|
||||
{
|
||||
precache_sound ("buttons/airbut1.wav");
|
||||
self.noise = "buttons/airbut1.wav";
|
||||
}
|
||||
if (self.sounds == 1)
|
||||
{
|
||||
precache_sound ("buttons/switch21.wav");
|
||||
self.noise = "buttons/switch21.wav";
|
||||
}
|
||||
if (self.sounds == 2)
|
||||
{
|
||||
precache_sound ("buttons/switch02.wav");
|
||||
self.noise = "buttons/switch02.wav";
|
||||
}
|
||||
if (self.sounds == 3)
|
||||
{
|
||||
precache_sound ("buttons/switch04.wav");
|
||||
self.noise = "buttons/switch04.wav";
|
||||
}
|
||||
|
||||
SetMovedir ();
|
||||
|
||||
self.movetype = MOVETYPE_PUSH;
|
||||
self.solid = SOLID_BSP;
|
||||
setmodel (self, self.model);
|
||||
|
||||
self.blocked = button_blocked;
|
||||
self.use = button_use;
|
||||
|
||||
if (self.health)
|
||||
{
|
||||
self.max_health = self.health;
|
||||
self.th_die = button_killed;
|
||||
self.takedamage = DAMAGE_YES;
|
||||
}
|
||||
else
|
||||
self.touch = button_touch;
|
||||
|
||||
if (!self.speed)
|
||||
self.speed = 40;
|
||||
if (!self.wait)
|
||||
self.wait = 1;
|
||||
if (!self.lip)
|
||||
self.lip = 4;
|
||||
|
||||
self.state = STATE_BOTTOM;
|
||||
|
||||
self.pos1 = self.origin;
|
||||
self.pos2 = self.pos1 + self.movedir*(fabs(self.movedir*self.size) - self.lip);
|
||||
};
|
||||
|
||||
|
|
3396
nqw/client.qc
3396
nqw/client.qc
File diff suppressed because it is too large
Load diff
662
nqw/combat.qc
662
nqw/combat.qc
|
@ -1,331 +1,331 @@
|
|||
|
||||
void() T_MissileTouch;
|
||||
void() info_player_start;
|
||||
void(entity targ, entity attacker) ClientObituary;
|
||||
void(entity inflictor, entity attacker, float damage, entity ignore, string dtype) T_RadiusDamage;
|
||||
|
||||
void() monster_death_use;
|
||||
|
||||
//============================================================================
|
||||
|
||||
/*
|
||||
============
|
||||
CanDamage
|
||||
|
||||
Returns true if the inflictor can directly damage the target. Used for
|
||||
explosions and melee attacks.
|
||||
============
|
||||
*/
|
||||
float(entity targ, entity inflictor) CanDamage =
|
||||
{
|
||||
// bmodels need special checking because their origin is 0,0,0
|
||||
if (targ.movetype == MOVETYPE_PUSH)
|
||||
{
|
||||
traceline(inflictor.origin, 0.5 * (targ.absmin + targ.absmax), TRUE, self);
|
||||
if (trace_fraction == 1)
|
||||
return TRUE;
|
||||
if (trace_ent == targ)
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
traceline(inflictor.origin, targ.origin, TRUE, self);
|
||||
if (trace_fraction == 1)
|
||||
return TRUE;
|
||||
traceline(inflictor.origin, targ.origin + '15 15 0', TRUE, self);
|
||||
if (trace_fraction == 1)
|
||||
return TRUE;
|
||||
traceline(inflictor.origin, targ.origin + '-15 -15 0', TRUE, self);
|
||||
if (trace_fraction == 1)
|
||||
return TRUE;
|
||||
traceline(inflictor.origin, targ.origin + '-15 15 0', TRUE, self);
|
||||
if (trace_fraction == 1)
|
||||
return TRUE;
|
||||
traceline(inflictor.origin, targ.origin + '15 -15 0', TRUE, self);
|
||||
if (trace_fraction == 1)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
============
|
||||
Killed
|
||||
============
|
||||
*/
|
||||
void(entity targ, entity attacker) Killed =
|
||||
{
|
||||
local entity oself;
|
||||
|
||||
oself = self;
|
||||
self = targ;
|
||||
|
||||
if (self.health < -99)
|
||||
self.health = -99; // don't let sbar look bad if a player
|
||||
|
||||
if (self.movetype == MOVETYPE_PUSH || self.movetype == MOVETYPE_NONE)
|
||||
{ // doors, triggers, etc
|
||||
self.th_die ();
|
||||
self = oself;
|
||||
return;
|
||||
}
|
||||
|
||||
self.enemy = attacker;
|
||||
|
||||
// bump the monster counter
|
||||
if (self.flags & FL_MONSTER)
|
||||
{
|
||||
killed_monsters = killed_monsters + 1;
|
||||
WriteByte (MSG_ALL, SVC_KILLEDMONSTER);
|
||||
}
|
||||
|
||||
ClientObituary(self, attacker);
|
||||
|
||||
self.takedamage = DAMAGE_NO;
|
||||
self.touch = SUB_Null;
|
||||
self.effects = 0;
|
||||
|
||||
monster_death_use();
|
||||
self.th_die ();
|
||||
|
||||
self = oself;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
============
|
||||
T_Damage
|
||||
|
||||
The damage is coming from inflictor, but get mad at attacker
|
||||
This should be the only function that ever reduces health.
|
||||
============
|
||||
*/
|
||||
void(entity targ, entity inflictor, entity attacker, float damage) T_Damage=
|
||||
{
|
||||
local vector dir;
|
||||
local entity oldself;
|
||||
local float save;
|
||||
local float take;
|
||||
local string attackerteam, targteam;
|
||||
|
||||
|
||||
if (!targ.takedamage)
|
||||
return;
|
||||
|
||||
// used by buttons and triggers to set activator for target firing
|
||||
damage_attacker = attacker;
|
||||
|
||||
|
||||
// check for quad damage powerup on the attacker
|
||||
if (attacker.super_damage_finished > time && inflictor.classname != "door")
|
||||
if (deathmatch == 4)
|
||||
damage = damage * 8;
|
||||
else
|
||||
damage = damage * 4;
|
||||
|
||||
// save damage based on the target's armor level
|
||||
|
||||
save = ceil(targ.armortype*damage);
|
||||
if (save >= targ.armorvalue)
|
||||
{
|
||||
save = targ.armorvalue;
|
||||
targ.armortype = 0; // lost all armor
|
||||
targ.items = targ.items - (targ.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3));
|
||||
}
|
||||
|
||||
targ.armorvalue = targ.armorvalue - save;
|
||||
take = ceil(damage-save);
|
||||
|
||||
// add to the damage total for clients, which will be sent as a single
|
||||
// message at the end of the frame
|
||||
// FIXME: remove after combining shotgun blasts?
|
||||
if (targ.flags & FL_CLIENT)
|
||||
{
|
||||
targ.dmg_take = targ.dmg_take + take;
|
||||
targ.dmg_save = targ.dmg_save + save;
|
||||
targ.dmg_inflictor = inflictor;
|
||||
}
|
||||
|
||||
damage_inflictor = inflictor;
|
||||
|
||||
|
||||
// figure momentum add
|
||||
if ( (inflictor != world) && (targ.movetype == MOVETYPE_WALK) )
|
||||
{
|
||||
dir = targ.origin - (inflictor.absmin + inflictor.absmax) * 0.5;
|
||||
dir = normalize(dir);
|
||||
// Set kickback for smaller weapons
|
||||
//Zoid -- use normal NQ kickback
|
||||
// // Read: only if it's not yourself doing the damage
|
||||
// if ( (damage < 60) & ((attacker.classname == "player") & (targ.classname == "player")) & ( attacker.netname != targ.netname))
|
||||
// targ.velocity = targ.velocity + dir * damage * 11;
|
||||
// else
|
||||
// Otherwise, these rules apply to rockets and grenades
|
||||
// for blast velocity
|
||||
targ.velocity = targ.velocity + dir * damage * 8;
|
||||
|
||||
// Rocket Jump modifiers
|
||||
if ( (rj > 1) & ((attacker.classname == "player") & (targ.classname == "player")) & ( attacker.netname == targ.netname))
|
||||
targ.velocity = targ.velocity + dir * damage * rj;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// check for godmode or invincibility
|
||||
if (targ.flags & FL_GODMODE)
|
||||
return;
|
||||
if (targ.invincible_finished >= time)
|
||||
{
|
||||
if (self.invincible_sound < time)
|
||||
{
|
||||
sound (targ, CHAN_ITEM, "items/protect3.wav", 1, ATTN_NORM);
|
||||
self.invincible_sound = time + 2;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// team play damage avoidance
|
||||
//ZOID 12-13-96: self.team doesn't work in QW. Use keys
|
||||
attackerteam = infokey(attacker, "team");
|
||||
targteam = infokey(targ, "team");
|
||||
|
||||
if ((teamplay == 1) && (targteam == attackerteam) &&
|
||||
(attacker.classname == "player") && (attackerteam != "") &&
|
||||
inflictor.classname !="door")
|
||||
return;
|
||||
|
||||
if ((teamplay == 3) && (targteam == attackerteam) &&
|
||||
(attacker.classname == "player") && (attackerteam != "") &&
|
||||
(targ != attacker)&& inflictor.classname !="door")
|
||||
return;
|
||||
|
||||
// do the damage
|
||||
targ.health = targ.health - take;
|
||||
|
||||
if (targ.health <= 0)
|
||||
{
|
||||
Killed (targ, attacker);
|
||||
return;
|
||||
}
|
||||
|
||||
// react to the damage
|
||||
oldself = self;
|
||||
self = targ;
|
||||
|
||||
if ( (self.flags & FL_MONSTER) && attacker != world)
|
||||
{
|
||||
// get mad unless of the same class (except for soldiers)
|
||||
if (self != attacker && attacker != self.enemy)
|
||||
{
|
||||
if ( (self.classname != attacker.classname)
|
||||
|| (self.classname == "monster_army" ) )
|
||||
{
|
||||
if (self.enemy.classname == "player")
|
||||
self.oldenemy = self.enemy;
|
||||
self.enemy = attacker;
|
||||
FoundTarget ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (self.th_pain)
|
||||
{
|
||||
self.th_pain (attacker, take);
|
||||
// nightmare mode monsters don't go into pain frames often
|
||||
if (skill == 3)
|
||||
self.pain_finished = time + 5;
|
||||
}
|
||||
|
||||
self = oldself;
|
||||
};
|
||||
|
||||
/*
|
||||
============
|
||||
T_RadiusDamage
|
||||
============
|
||||
*/
|
||||
void(entity inflictor, entity attacker, float damage, entity ignore, string dtype) T_RadiusDamage =
|
||||
{
|
||||
local float points;
|
||||
local entity head;
|
||||
local vector org;
|
||||
|
||||
head = findradius(inflictor.origin, damage+40);
|
||||
|
||||
while (head)
|
||||
{
|
||||
//bprint (PRINT_HIGH, head.classname);
|
||||
//bprint (PRINT_HIGH, " | ");
|
||||
//bprint (PRINT_HIGH, head.netname);
|
||||
//bprint (PRINT_HIGH, "\n");
|
||||
|
||||
if (head != ignore)
|
||||
{
|
||||
if (head.takedamage)
|
||||
{
|
||||
org = head.origin + (head.mins + head.maxs)*0.5;
|
||||
points = 0.5*vlen (inflictor.origin - org);
|
||||
if (points < 0)
|
||||
points = 0;
|
||||
points = damage - points;
|
||||
|
||||
if (head == attacker)
|
||||
points = points * 0.5;
|
||||
if (points > 0)
|
||||
{
|
||||
if (CanDamage (head, inflictor))
|
||||
{
|
||||
head.deathtype = dtype;
|
||||
// shambler takes half damage from all explosions
|
||||
if (head.classname == "monster_shambler")
|
||||
T_Damage (head, inflictor, attacker, points*0.5);
|
||||
else
|
||||
T_Damage (head, inflictor, attacker, points);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
head = head.chain;
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
============
|
||||
T_BeamDamage
|
||||
============
|
||||
*/
|
||||
void(entity attacker, float damage) T_BeamDamage =
|
||||
{
|
||||
local float points;
|
||||
local entity head;
|
||||
|
||||
head = findradius(attacker.origin, damage+40);
|
||||
|
||||
while (head)
|
||||
{
|
||||
if (head.takedamage)
|
||||
{
|
||||
points = 0.5*vlen (attacker.origin - head.origin);
|
||||
if (points < 0)
|
||||
points = 0;
|
||||
points = damage - points;
|
||||
if (head == attacker)
|
||||
points = points * 0.5;
|
||||
if (points > 0)
|
||||
{
|
||||
if (CanDamage (head, attacker))
|
||||
{
|
||||
if (head.classname == "monster_shambler")
|
||||
T_Damage (head, attacker, attacker, points*0.5);
|
||||
else
|
||||
T_Damage (head, attacker, attacker, points);
|
||||
}
|
||||
}
|
||||
}
|
||||
head = head.chain;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
void() T_MissileTouch;
|
||||
void() info_player_start;
|
||||
void(entity targ, entity attacker) ClientObituary;
|
||||
void(entity inflictor, entity attacker, float damage, entity ignore, string dtype) T_RadiusDamage;
|
||||
|
||||
void() monster_death_use;
|
||||
|
||||
//============================================================================
|
||||
|
||||
/*
|
||||
============
|
||||
CanDamage
|
||||
|
||||
Returns true if the inflictor can directly damage the target. Used for
|
||||
explosions and melee attacks.
|
||||
============
|
||||
*/
|
||||
float(entity targ, entity inflictor) CanDamage =
|
||||
{
|
||||
// bmodels need special checking because their origin is 0,0,0
|
||||
if (targ.movetype == MOVETYPE_PUSH)
|
||||
{
|
||||
traceline(inflictor.origin, 0.5 * (targ.absmin + targ.absmax), TRUE, self);
|
||||
if (trace_fraction == 1)
|
||||
return TRUE;
|
||||
if (trace_ent == targ)
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
traceline(inflictor.origin, targ.origin, TRUE, self);
|
||||
if (trace_fraction == 1)
|
||||
return TRUE;
|
||||
traceline(inflictor.origin, targ.origin + '15 15 0', TRUE, self);
|
||||
if (trace_fraction == 1)
|
||||
return TRUE;
|
||||
traceline(inflictor.origin, targ.origin + '-15 -15 0', TRUE, self);
|
||||
if (trace_fraction == 1)
|
||||
return TRUE;
|
||||
traceline(inflictor.origin, targ.origin + '-15 15 0', TRUE, self);
|
||||
if (trace_fraction == 1)
|
||||
return TRUE;
|
||||
traceline(inflictor.origin, targ.origin + '15 -15 0', TRUE, self);
|
||||
if (trace_fraction == 1)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
============
|
||||
Killed
|
||||
============
|
||||
*/
|
||||
void(entity targ, entity attacker) Killed =
|
||||
{
|
||||
local entity oself;
|
||||
|
||||
oself = self;
|
||||
self = targ;
|
||||
|
||||
if (self.health < -99)
|
||||
self.health = -99; // don't let sbar look bad if a player
|
||||
|
||||
if (self.movetype == MOVETYPE_PUSH || self.movetype == MOVETYPE_NONE)
|
||||
{ // doors, triggers, etc
|
||||
self.th_die ();
|
||||
self = oself;
|
||||
return;
|
||||
}
|
||||
|
||||
self.enemy = attacker;
|
||||
|
||||
// bump the monster counter
|
||||
if (self.flags & FL_MONSTER)
|
||||
{
|
||||
killed_monsters = killed_monsters + 1;
|
||||
WriteByte (MSG_ALL, SVC_KILLEDMONSTER);
|
||||
}
|
||||
|
||||
ClientObituary(self, attacker);
|
||||
|
||||
self.takedamage = DAMAGE_NO;
|
||||
self.touch = SUB_Null;
|
||||
self.effects = 0;
|
||||
|
||||
monster_death_use();
|
||||
self.th_die ();
|
||||
|
||||
self = oself;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
============
|
||||
T_Damage
|
||||
|
||||
The damage is coming from inflictor, but get mad at attacker
|
||||
This should be the only function that ever reduces health.
|
||||
============
|
||||
*/
|
||||
void(entity targ, entity inflictor, entity attacker, float damage) T_Damage=
|
||||
{
|
||||
local vector dir;
|
||||
local entity oldself;
|
||||
local float save;
|
||||
local float take;
|
||||
local string attackerteam, targteam;
|
||||
|
||||
|
||||
if (!targ.takedamage)
|
||||
return;
|
||||
|
||||
// used by buttons and triggers to set activator for target firing
|
||||
damage_attacker = attacker;
|
||||
|
||||
|
||||
// check for quad damage powerup on the attacker
|
||||
if (attacker.super_damage_finished > time && inflictor.classname != "door")
|
||||
if (deathmatch == 4)
|
||||
damage = damage * 8;
|
||||
else
|
||||
damage = damage * 4;
|
||||
|
||||
// save damage based on the target's armor level
|
||||
|
||||
save = ceil(targ.armortype*damage);
|
||||
if (save >= targ.armorvalue)
|
||||
{
|
||||
save = targ.armorvalue;
|
||||
targ.armortype = 0; // lost all armor
|
||||
targ.items = targ.items - (targ.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3));
|
||||
}
|
||||
|
||||
targ.armorvalue = targ.armorvalue - save;
|
||||
take = ceil(damage-save);
|
||||
|
||||
// add to the damage total for clients, which will be sent as a single
|
||||
// message at the end of the frame
|
||||
// FIXME: remove after combining shotgun blasts?
|
||||
if (targ.flags & FL_CLIENT)
|
||||
{
|
||||
targ.dmg_take = targ.dmg_take + take;
|
||||
targ.dmg_save = targ.dmg_save + save;
|
||||
targ.dmg_inflictor = inflictor;
|
||||
}
|
||||
|
||||
damage_inflictor = inflictor;
|
||||
|
||||
|
||||
// figure momentum add
|
||||
if ( (inflictor != world) && (targ.movetype == MOVETYPE_WALK) )
|
||||
{
|
||||
dir = targ.origin - (inflictor.absmin + inflictor.absmax) * 0.5;
|
||||
dir = normalize(dir);
|
||||
// Set kickback for smaller weapons
|
||||
//Zoid -- use normal NQ kickback
|
||||
// // Read: only if it's not yourself doing the damage
|
||||
// if ( (damage < 60) & ((attacker.classname == "player") & (targ.classname == "player")) & ( attacker.netname != targ.netname))
|
||||
// targ.velocity = targ.velocity + dir * damage * 11;
|
||||
// else
|
||||
// Otherwise, these rules apply to rockets and grenades
|
||||
// for blast velocity
|
||||
targ.velocity = targ.velocity + dir * damage * 8;
|
||||
|
||||
// Rocket Jump modifiers
|
||||
if ( (rj > 1) & ((attacker.classname == "player") & (targ.classname == "player")) & ( attacker.netname == targ.netname))
|
||||
targ.velocity = targ.velocity + dir * damage * rj;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// check for godmode or invincibility
|
||||
if (targ.flags & FL_GODMODE)
|
||||
return;
|
||||
if (targ.invincible_finished >= time)
|
||||
{
|
||||
if (self.invincible_sound < time)
|
||||
{
|
||||
sound (targ, CHAN_ITEM, "items/protect3.wav", 1, ATTN_NORM);
|
||||
self.invincible_sound = time + 2;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// team play damage avoidance
|
||||
//ZOID 12-13-96: self.team doesn't work in QW. Use keys
|
||||
attackerteam = infokey(attacker, "team");
|
||||
targteam = infokey(targ, "team");
|
||||
|
||||
if ((teamplay == 1) && (targteam == attackerteam) &&
|
||||
(attacker.classname == "player") && (attackerteam != "") &&
|
||||
inflictor.classname !="door")
|
||||
return;
|
||||
|
||||
if ((teamplay == 3) && (targteam == attackerteam) &&
|
||||
(attacker.classname == "player") && (attackerteam != "") &&
|
||||
(targ != attacker)&& inflictor.classname !="door")
|
||||
return;
|
||||
|
||||
// do the damage
|
||||
targ.health = targ.health - take;
|
||||
|
||||
if (targ.health <= 0)
|
||||
{
|
||||
Killed (targ, attacker);
|
||||
return;
|
||||
}
|
||||
|
||||
// react to the damage
|
||||
oldself = self;
|
||||
self = targ;
|
||||
|
||||
if ( (self.flags & FL_MONSTER) && attacker != world)
|
||||
{
|
||||
// get mad unless of the same class (except for soldiers)
|
||||
if (self != attacker && attacker != self.enemy)
|
||||
{
|
||||
if ( (self.classname != attacker.classname)
|
||||
|| (self.classname == "monster_army" ) )
|
||||
{
|
||||
if (self.enemy.classname == "player")
|
||||
self.oldenemy = self.enemy;
|
||||
self.enemy = attacker;
|
||||
FoundTarget ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (self.th_pain)
|
||||
{
|
||||
self.th_pain (attacker, take);
|
||||
// nightmare mode monsters don't go into pain frames often
|
||||
if (skill == 3)
|
||||
self.pain_finished = time + 5;
|
||||
}
|
||||
|
||||
self = oldself;
|
||||
};
|
||||
|
||||
/*
|
||||
============
|
||||
T_RadiusDamage
|
||||
============
|
||||
*/
|
||||
void(entity inflictor, entity attacker, float damage, entity ignore, string dtype) T_RadiusDamage =
|
||||
{
|
||||
local float points;
|
||||
local entity head;
|
||||
local vector org;
|
||||
|
||||
head = findradius(inflictor.origin, damage+40);
|
||||
|
||||
while (head)
|
||||
{
|
||||
//bprint (PRINT_HIGH, head.classname);
|
||||
//bprint (PRINT_HIGH, " | ");
|
||||
//bprint (PRINT_HIGH, head.netname);
|
||||
//bprint (PRINT_HIGH, "\n");
|
||||
|
||||
if (head != ignore)
|
||||
{
|
||||
if (head.takedamage)
|
||||
{
|
||||
org = head.origin + (head.mins + head.maxs)*0.5;
|
||||
points = 0.5*vlen (inflictor.origin - org);
|
||||
if (points < 0)
|
||||
points = 0;
|
||||
points = damage - points;
|
||||
|
||||
if (head == attacker)
|
||||
points = points * 0.5;
|
||||
if (points > 0)
|
||||
{
|
||||
if (CanDamage (head, inflictor))
|
||||
{
|
||||
head.deathtype = dtype;
|
||||
// shambler takes half damage from all explosions
|
||||
if (head.classname == "monster_shambler")
|
||||
T_Damage (head, inflictor, attacker, points*0.5);
|
||||
else
|
||||
T_Damage (head, inflictor, attacker, points);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
head = head.chain;
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
============
|
||||
T_BeamDamage
|
||||
============
|
||||
*/
|
||||
void(entity attacker, float damage) T_BeamDamage =
|
||||
{
|
||||
local float points;
|
||||
local entity head;
|
||||
|
||||
head = findradius(attacker.origin, damage+40);
|
||||
|
||||
while (head)
|
||||
{
|
||||
if (head.takedamage)
|
||||
{
|
||||
points = 0.5*vlen (attacker.origin - head.origin);
|
||||
if (points < 0)
|
||||
points = 0;
|
||||
points = damage - points;
|
||||
if (head == attacker)
|
||||
points = points * 0.5;
|
||||
if (points > 0)
|
||||
{
|
||||
if (CanDamage (head, attacker))
|
||||
{
|
||||
if (head.classname == "monster_shambler")
|
||||
T_Damage (head, attacker, attacker, points*0.5);
|
||||
else
|
||||
T_Damage (head, attacker, attacker, points);
|
||||
}
|
||||
}
|
||||
}
|
||||
head = head.chain;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
1462
nqw/defs.qc
1462
nqw/defs.qc
File diff suppressed because it is too large
Load diff
1576
nqw/doors.qc
1576
nqw/doors.qc
File diff suppressed because it is too large
Load diff
3320
nqw/items.qc
3320
nqw/items.qc
File diff suppressed because it is too large
Load diff
1454
nqw/misc.qc
1454
nqw/misc.qc
File diff suppressed because it is too large
Load diff
1170
nqw/models.qc
1170
nqw/models.qc
File diff suppressed because it is too large
Load diff
730
nqw/plats.qc
730
nqw/plats.qc
|
@ -1,365 +1,365 @@
|
|||
|
||||
|
||||
void() plat_center_touch;
|
||||
void() plat_outside_touch;
|
||||
void() plat_trigger_use;
|
||||
void() plat_go_up;
|
||||
void() plat_go_down;
|
||||
void() plat_crush;
|
||||
float PLAT_LOW_TRIGGER = 1;
|
||||
|
||||
void() plat_spawn_inside_trigger =
|
||||
{
|
||||
local entity trigger;
|
||||
local vector tmin, tmax;
|
||||
|
||||
//
|
||||
// middle trigger
|
||||
//
|
||||
trigger = spawn();
|
||||
trigger.touch = plat_center_touch;
|
||||
trigger.movetype = MOVETYPE_NONE;
|
||||
trigger.solid = SOLID_TRIGGER;
|
||||
trigger.enemy = self;
|
||||
|
||||
tmin = self.mins + '25 25 0';
|
||||
tmax = self.maxs - '25 25 -8';
|
||||
tmin_z = tmax_z - (self.pos1_z - self.pos2_z + 8);
|
||||
if (self.spawnflags & PLAT_LOW_TRIGGER)
|
||||
tmax_z = tmin_z + 8;
|
||||
|
||||
if (self.size_x <= 50)
|
||||
{
|
||||
tmin_x = (self.mins_x + self.maxs_x) / 2;
|
||||
tmax_x = tmin_x + 1;
|
||||
}
|
||||
if (self.size_y <= 50)
|
||||
{
|
||||
tmin_y = (self.mins_y + self.maxs_y) / 2;
|
||||
tmax_y = tmin_y + 1;
|
||||
}
|
||||
|
||||
setsize (trigger, tmin, tmax);
|
||||
};
|
||||
|
||||
void() plat_hit_top =
|
||||
{
|
||||
sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self.noise1, 1, ATTN_NORM);
|
||||
self.state = STATE_TOP;
|
||||
self.think = plat_go_down;
|
||||
self.nextthink = self.ltime + 3;
|
||||
};
|
||||
|
||||
void() plat_hit_bottom =
|
||||
{
|
||||
sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self.noise1, 1, ATTN_NORM);
|
||||
self.state = STATE_BOTTOM;
|
||||
};
|
||||
|
||||
void() plat_go_down =
|
||||
{
|
||||
sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
|
||||
self.state = STATE_DOWN;
|
||||
SUB_CalcMove (self.pos2, self.speed, plat_hit_bottom);
|
||||
};
|
||||
|
||||
void() plat_go_up =
|
||||
{
|
||||
sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
|
||||
self.state = STATE_UP;
|
||||
SUB_CalcMove (self.pos1, self.speed, plat_hit_top);
|
||||
};
|
||||
|
||||
void() plat_center_touch =
|
||||
{
|
||||
if (other.classname != "player")
|
||||
return;
|
||||
|
||||
if (other.health <= 0)
|
||||
return;
|
||||
|
||||
self = self.enemy;
|
||||
if (self.state == STATE_BOTTOM)
|
||||
plat_go_up ();
|
||||
else if (self.state == STATE_TOP)
|
||||
self.nextthink = self.ltime + 1; // delay going down
|
||||
};
|
||||
|
||||
void() plat_outside_touch =
|
||||
{
|
||||
if (other.classname != "player")
|
||||
return;
|
||||
|
||||
if (other.health <= 0)
|
||||
return;
|
||||
|
||||
//dprint ("plat_outside_touch\n");
|
||||
self = self.enemy;
|
||||
if (self.state == STATE_TOP)
|
||||
plat_go_down ();
|
||||
};
|
||||
|
||||
void() plat_trigger_use =
|
||||
{
|
||||
if (self.think)
|
||||
return; // allready activated
|
||||
plat_go_down();
|
||||
};
|
||||
|
||||
|
||||
void() plat_crush =
|
||||
{
|
||||
//dprint ("plat_crush\n");
|
||||
|
||||
other.deathtype = "squish";
|
||||
T_Damage (other, self, self, 1);
|
||||
|
||||
if (self.state == STATE_UP)
|
||||
plat_go_down ();
|
||||
else if (self.state == STATE_DOWN)
|
||||
plat_go_up ();
|
||||
else
|
||||
objerror ("plat_crush: bad self.state\n");
|
||||
};
|
||||
|
||||
void() plat_use =
|
||||
{
|
||||
self.use = SUB_Null;
|
||||
if (self.state != STATE_UP)
|
||||
objerror ("plat_use: not in up state");
|
||||
plat_go_down();
|
||||
};
|
||||
|
||||
|
||||
/*QUAKED func_plat (0 .5 .8) ? PLAT_LOW_TRIGGER
|
||||
speed default 150
|
||||
|
||||
Plats are always drawn in the extended position, so they will light correctly.
|
||||
|
||||
If the plat is the target of another trigger or button, it will start out disabled in the extended position until it is trigger, when it will lower and become a normal plat.
|
||||
|
||||
If the "height" key is set, that will determine the amount the plat moves, instead of being implicitly determined by the model's height.
|
||||
Set "sounds" to one of the following:
|
||||
1) base fast
|
||||
2) chain slow
|
||||
*/
|
||||
|
||||
|
||||
void() func_plat =
|
||||
|
||||
{
|
||||
if (!self.t_length)
|
||||
self.t_length = 80;
|
||||
if (!self.t_width)
|
||||
self.t_width = 10;
|
||||
|
||||
if (self.sounds == 0)
|
||||
self.sounds = 2;
|
||||
// FIX THIS TO LOAD A GENERIC PLAT SOUND
|
||||
|
||||
if (self.sounds == 1)
|
||||
{
|
||||
precache_sound ("plats/plat1.wav");
|
||||
precache_sound ("plats/plat2.wav");
|
||||
self.noise = "plats/plat1.wav";
|
||||
self.noise1 = "plats/plat2.wav";
|
||||
}
|
||||
|
||||
if (self.sounds == 2)
|
||||
{
|
||||
precache_sound ("plats/medplat1.wav");
|
||||
precache_sound ("plats/medplat2.wav");
|
||||
self.noise = "plats/medplat1.wav";
|
||||
self.noise1 = "plats/medplat2.wav";
|
||||
}
|
||||
|
||||
|
||||
self.mangle = self.angles;
|
||||
self.angles = '0 0 0';
|
||||
|
||||
self.classname = "plat";
|
||||
self.solid = SOLID_BSP;
|
||||
self.movetype = MOVETYPE_PUSH;
|
||||
setorigin (self, self.origin);
|
||||
setmodel (self, self.model);
|
||||
setsize (self, self.mins , self.maxs);
|
||||
|
||||
self.blocked = plat_crush;
|
||||
if (!self.speed)
|
||||
self.speed = 150;
|
||||
|
||||
// pos1 is the top position, pos2 is the bottom
|
||||
self.pos1 = self.origin;
|
||||
self.pos2 = self.origin;
|
||||
if (self.height)
|
||||
self.pos2_z = self.origin_z - self.height;
|
||||
else
|
||||
self.pos2_z = self.origin_z - self.size_z + 8;
|
||||
|
||||
self.use = plat_trigger_use;
|
||||
|
||||
plat_spawn_inside_trigger (); // the "start moving" trigger
|
||||
|
||||
if (self.targetname)
|
||||
{
|
||||
self.state = STATE_UP;
|
||||
self.use = plat_use;
|
||||
}
|
||||
else
|
||||
{
|
||||
setorigin (self, self.pos2);
|
||||
self.state = STATE_BOTTOM;
|
||||
}
|
||||
};
|
||||
|
||||
//============================================================================
|
||||
|
||||
void() train_next;
|
||||
void() func_train_find;
|
||||
|
||||
void() train_blocked =
|
||||
{
|
||||
if (time < self.attack_finished)
|
||||
return;
|
||||
self.attack_finished = time + 0.5;
|
||||
other.deathtype = "squish";
|
||||
T_Damage (other, self, self, self.dmg);
|
||||
};
|
||||
|
||||
void() train_use =
|
||||
{
|
||||
if (self.think != func_train_find)
|
||||
return; // already activated
|
||||
train_next();
|
||||
};
|
||||
|
||||
void() train_wait =
|
||||
{
|
||||
if (self.wait)
|
||||
{
|
||||
self.nextthink = self.ltime + self.wait;
|
||||
sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self.noise, 1, ATTN_NORM);
|
||||
}
|
||||
else
|
||||
self.nextthink = self.ltime + 0.1;
|
||||
|
||||
self.think = train_next;
|
||||
};
|
||||
|
||||
void() train_next =
|
||||
{
|
||||
local entity targ;
|
||||
|
||||
targ = find (world, targetname, self.target);
|
||||
self.target = targ.target;
|
||||
if (!self.target)
|
||||
objerror ("train_next: no next target");
|
||||
if (targ.wait)
|
||||
self.wait = targ.wait;
|
||||
else
|
||||
self.wait = 0;
|
||||
sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM);
|
||||
SUB_CalcMove (targ.origin - self.mins, self.speed, train_wait);
|
||||
};
|
||||
|
||||
void() func_train_find =
|
||||
|
||||
{
|
||||
local entity targ;
|
||||
|
||||
targ = find (world, targetname, self.target);
|
||||
self.target = targ.target;
|
||||
setorigin (self, targ.origin - self.mins);
|
||||
if (!self.targetname)
|
||||
{ // not triggered, so start immediately
|
||||
self.nextthink = self.ltime + 0.1;
|
||||
self.think = train_next;
|
||||
}
|
||||
};
|
||||
|
||||
/*QUAKED func_train (0 .5 .8) ?
|
||||
Trains are moving platforms that players can ride.
|
||||
The targets origin specifies the min point of the train at each corner.
|
||||
The train spawns at the first target it is pointing at.
|
||||
If the train is the target of a button or trigger, it will not begin moving until activated.
|
||||
speed default 100
|
||||
dmg default 2
|
||||
sounds
|
||||
1) ratchet metal
|
||||
|
||||
*/
|
||||
void() func_train =
|
||||
{
|
||||
if (!self.speed)
|
||||
self.speed = 100;
|
||||
if (!self.target)
|
||||
objerror ("func_train without a target");
|
||||
if (!self.dmg)
|
||||
self.dmg = 2;
|
||||
|
||||
if (self.sounds == 0)
|
||||
{
|
||||
self.noise = ("misc/null.wav");
|
||||
precache_sound ("misc/null.wav");
|
||||
self.noise1 = ("misc/null.wav");
|
||||
precache_sound ("misc/null.wav");
|
||||
}
|
||||
|
||||
if (self.sounds == 1)
|
||||
{
|
||||
self.noise = ("plats/train2.wav");
|
||||
precache_sound ("plats/train2.wav");
|
||||
self.noise1 = ("plats/train1.wav");
|
||||
precache_sound ("plats/train1.wav");
|
||||
}
|
||||
|
||||
self.cnt = 1;
|
||||
self.solid = SOLID_BSP;
|
||||
self.movetype = MOVETYPE_PUSH;
|
||||
self.blocked = train_blocked;
|
||||
self.use = train_use;
|
||||
self.classname = "train";
|
||||
|
||||
setmodel (self, self.model);
|
||||
setsize (self, self.mins , self.maxs);
|
||||
setorigin (self, self.origin);
|
||||
|
||||
// start trains on the second frame, to make sure their targets have had
|
||||
// a chance to spawn
|
||||
self.nextthink = self.ltime + 0.1;
|
||||
self.think = func_train_find;
|
||||
};
|
||||
|
||||
/*QUAKED misc_teleporttrain (0 .5 .8) (-8 -8 -8) (8 8 8)
|
||||
This is used for the final bos
|
||||
*/
|
||||
void() misc_teleporttrain =
|
||||
{
|
||||
if (!self.speed)
|
||||
self.speed = 100;
|
||||
if (!self.target)
|
||||
objerror ("func_train without a target");
|
||||
|
||||
self.cnt = 1;
|
||||
self.solid = SOLID_NOT;
|
||||
self.movetype = MOVETYPE_PUSH;
|
||||
self.blocked = train_blocked;
|
||||
self.use = train_use;
|
||||
self.avelocity = '100 200 300';
|
||||
|
||||
self.noise = ("misc/null.wav");
|
||||
precache_sound ("misc/null.wav");
|
||||
self.noise1 = ("misc/null.wav");
|
||||
precache_sound ("misc/null.wav");
|
||||
|
||||
precache_model2 ("progs/teleport.mdl");
|
||||
setmodel (self, "progs/teleport.mdl");
|
||||
setsize (self, self.mins , self.maxs);
|
||||
setorigin (self, self.origin);
|
||||
|
||||
// start trains on the second frame, to make sure their targets have had
|
||||
// a chance to spawn
|
||||
self.nextthink = self.ltime + 0.1;
|
||||
self.think = func_train_find;
|
||||
};
|
||||
|
||||
|
||||
|
||||
void() plat_center_touch;
|
||||
void() plat_outside_touch;
|
||||
void() plat_trigger_use;
|
||||
void() plat_go_up;
|
||||
void() plat_go_down;
|
||||
void() plat_crush;
|
||||
float PLAT_LOW_TRIGGER = 1;
|
||||
|
||||
void() plat_spawn_inside_trigger =
|
||||
{
|
||||
local entity trigger;
|
||||
local vector tmin, tmax;
|
||||
|
||||
//
|
||||
// middle trigger
|
||||
//
|
||||
trigger = spawn();
|
||||
trigger.touch = plat_center_touch;
|
||||
trigger.movetype = MOVETYPE_NONE;
|
||||
trigger.solid = SOLID_TRIGGER;
|
||||
trigger.enemy = self;
|
||||
|
||||
tmin = self.mins + '25 25 0';
|
||||
tmax = self.maxs - '25 25 -8';
|
||||
tmin_z = tmax_z - (self.pos1_z - self.pos2_z + 8);
|
||||
if (self.spawnflags & PLAT_LOW_TRIGGER)
|
||||
tmax_z = tmin_z + 8;
|
||||
|
||||
if (self.size_x <= 50)
|
||||
{
|
||||
tmin_x = (self.mins_x + self.maxs_x) / 2;
|
||||
tmax_x = tmin_x + 1;
|
||||
}
|
||||
if (self.size_y <= 50)
|
||||
{
|
||||
tmin_y = (self.mins_y + self.maxs_y) / 2;
|
||||
tmax_y = tmin_y + 1;
|
||||
}
|
||||
|
||||
setsize (trigger, tmin, tmax);
|
||||
};
|
||||
|
||||
void() plat_hit_top =
|
||||
{
|
||||
sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self.noise1, 1, ATTN_NORM);
|
||||
self.state = STATE_TOP;
|
||||
self.think = plat_go_down;
|
||||
self.nextthink = self.ltime + 3;
|
||||
};
|
||||
|
||||
void() plat_hit_bottom =
|
||||
{
|
||||
sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self.noise1, 1, ATTN_NORM);
|
||||
self.state = STATE_BOTTOM;
|
||||
};
|
||||
|
||||
void() plat_go_down =
|
||||
{
|
||||
sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
|
||||
self.state = STATE_DOWN;
|
||||
SUB_CalcMove (self.pos2, self.speed, plat_hit_bottom);
|
||||
};
|
||||
|
||||
void() plat_go_up =
|
||||
{
|
||||
sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
|
||||
self.state = STATE_UP;
|
||||
SUB_CalcMove (self.pos1, self.speed, plat_hit_top);
|
||||
};
|
||||
|
||||
void() plat_center_touch =
|
||||
{
|
||||
if (other.classname != "player")
|
||||
return;
|
||||
|
||||
if (other.health <= 0)
|
||||
return;
|
||||
|
||||
self = self.enemy;
|
||||
if (self.state == STATE_BOTTOM)
|
||||
plat_go_up ();
|
||||
else if (self.state == STATE_TOP)
|
||||
self.nextthink = self.ltime + 1; // delay going down
|
||||
};
|
||||
|
||||
void() plat_outside_touch =
|
||||
{
|
||||
if (other.classname != "player")
|
||||
return;
|
||||
|
||||
if (other.health <= 0)
|
||||
return;
|
||||
|
||||
//dprint ("plat_outside_touch\n");
|
||||
self = self.enemy;
|
||||
if (self.state == STATE_TOP)
|
||||
plat_go_down ();
|
||||
};
|
||||
|
||||
void() plat_trigger_use =
|
||||
{
|
||||
if (self.think)
|
||||
return; // allready activated
|
||||
plat_go_down();
|
||||
};
|
||||
|
||||
|
||||
void() plat_crush =
|
||||
{
|
||||
//dprint ("plat_crush\n");
|
||||
|
||||
other.deathtype = "squish";
|
||||
T_Damage (other, self, self, 1);
|
||||
|
||||
if (self.state == STATE_UP)
|
||||
plat_go_down ();
|
||||
else if (self.state == STATE_DOWN)
|
||||
plat_go_up ();
|
||||
else
|
||||
objerror ("plat_crush: bad self.state\n");
|
||||
};
|
||||
|
||||
void() plat_use =
|
||||
{
|
||||
self.use = SUB_Null;
|
||||
if (self.state != STATE_UP)
|
||||
objerror ("plat_use: not in up state");
|
||||
plat_go_down();
|
||||
};
|
||||
|
||||
|
||||
/*QUAKED func_plat (0 .5 .8) ? PLAT_LOW_TRIGGER
|
||||
speed default 150
|
||||
|
||||
Plats are always drawn in the extended position, so they will light correctly.
|
||||
|
||||
If the plat is the target of another trigger or button, it will start out disabled in the extended position until it is trigger, when it will lower and become a normal plat.
|
||||
|
||||
If the "height" key is set, that will determine the amount the plat moves, instead of being implicitly determined by the model's height.
|
||||
Set "sounds" to one of the following:
|
||||
1) base fast
|
||||
2) chain slow
|
||||
*/
|
||||
|
||||
|
||||
void() func_plat =
|
||||
|
||||
{
|
||||
if (!self.t_length)
|
||||
self.t_length = 80;
|
||||
if (!self.t_width)
|
||||
self.t_width = 10;
|
||||
|
||||
if (self.sounds == 0)
|
||||
self.sounds = 2;
|
||||
// FIX THIS TO LOAD A GENERIC PLAT SOUND
|
||||
|
||||
if (self.sounds == 1)
|
||||
{
|
||||
precache_sound ("plats/plat1.wav");
|
||||
precache_sound ("plats/plat2.wav");
|
||||
self.noise = "plats/plat1.wav";
|
||||
self.noise1 = "plats/plat2.wav";
|
||||
}
|
||||
|
||||
if (self.sounds == 2)
|
||||
{
|
||||
precache_sound ("plats/medplat1.wav");
|
||||
precache_sound ("plats/medplat2.wav");
|
||||
self.noise = "plats/medplat1.wav";
|
||||
self.noise1 = "plats/medplat2.wav";
|
||||
}
|
||||
|
||||
|
||||
self.mangle = self.angles;
|
||||
self.angles = '0 0 0';
|
||||
|
||||
self.classname = "plat";
|
||||
self.solid = SOLID_BSP;
|
||||
self.movetype = MOVETYPE_PUSH;
|
||||
setorigin (self, self.origin);
|
||||
setmodel (self, self.model);
|
||||
setsize (self, self.mins , self.maxs);
|
||||
|
||||
self.blocked = plat_crush;
|
||||
if (!self.speed)
|
||||
self.speed = 150;
|
||||
|
||||
// pos1 is the top position, pos2 is the bottom
|
||||
self.pos1 = self.origin;
|
||||
self.pos2 = self.origin;
|
||||
if (self.height)
|
||||
self.pos2_z = self.origin_z - self.height;
|
||||
else
|
||||
self.pos2_z = self.origin_z - self.size_z + 8;
|
||||
|
||||
self.use = plat_trigger_use;
|
||||
|
||||
plat_spawn_inside_trigger (); // the "start moving" trigger
|
||||
|
||||
if (self.targetname)
|
||||
{
|
||||
self.state = STATE_UP;
|
||||
self.use = plat_use;
|
||||
}
|
||||
else
|
||||
{
|
||||
setorigin (self, self.pos2);
|
||||
self.state = STATE_BOTTOM;
|
||||
}
|
||||
};
|
||||
|
||||
//============================================================================
|
||||
|
||||
void() train_next;
|
||||
void() func_train_find;
|
||||
|
||||
void() train_blocked =
|
||||
{
|
||||
if (time < self.attack_finished)
|
||||
return;
|
||||
self.attack_finished = time + 0.5;
|
||||
other.deathtype = "squish";
|
||||
T_Damage (other, self, self, self.dmg);
|
||||
};
|
||||
|
||||
void() train_use =
|
||||
{
|
||||
if (self.think != func_train_find)
|
||||
return; // already activated
|
||||
train_next();
|
||||
};
|
||||
|
||||
void() train_wait =
|
||||
{
|
||||
if (self.wait)
|
||||
{
|
||||
self.nextthink = self.ltime + self.wait;
|
||||
sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self.noise, 1, ATTN_NORM);
|
||||
}
|
||||
else
|
||||
self.nextthink = self.ltime + 0.1;
|
||||
|
||||
self.think = train_next;
|
||||
};
|
||||
|
||||
void() train_next =
|
||||
{
|
||||
local entity targ;
|
||||
|
||||
targ = find (world, targetname, self.target);
|
||||
self.target = targ.target;
|
||||
if (!self.target)
|
||||
objerror ("train_next: no next target");
|
||||
if (targ.wait)
|
||||
self.wait = targ.wait;
|
||||
else
|
||||
self.wait = 0;
|
||||
sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM);
|
||||
SUB_CalcMove (targ.origin - self.mins, self.speed, train_wait);
|
||||
};
|
||||
|
||||
void() func_train_find =
|
||||
|
||||
{
|
||||
local entity targ;
|
||||
|
||||
targ = find (world, targetname, self.target);
|
||||
self.target = targ.target;
|
||||
setorigin (self, targ.origin - self.mins);
|
||||
if (!self.targetname)
|
||||
{ // not triggered, so start immediately
|
||||
self.nextthink = self.ltime + 0.1;
|
||||
self.think = train_next;
|
||||
}
|
||||
};
|
||||
|
||||
/*QUAKED func_train (0 .5 .8) ?
|
||||
Trains are moving platforms that players can ride.
|
||||
The targets origin specifies the min point of the train at each corner.
|
||||
The train spawns at the first target it is pointing at.
|
||||
If the train is the target of a button or trigger, it will not begin moving until activated.
|
||||
speed default 100
|
||||
dmg default 2
|
||||
sounds
|
||||
1) ratchet metal
|
||||
|
||||
*/
|
||||
void() func_train =
|
||||
{
|
||||
if (!self.speed)
|
||||
self.speed = 100;
|
||||
if (!self.target)
|
||||
objerror ("func_train without a target");
|
||||
if (!self.dmg)
|
||||
self.dmg = 2;
|
||||
|
||||
if (self.sounds == 0)
|
||||
{
|
||||
self.noise = ("misc/null.wav");
|
||||
precache_sound ("misc/null.wav");
|
||||
self.noise1 = ("misc/null.wav");
|
||||
precache_sound ("misc/null.wav");
|
||||
}
|
||||
|
||||
if (self.sounds == 1)
|
||||
{
|
||||
self.noise = ("plats/train2.wav");
|
||||
precache_sound ("plats/train2.wav");
|
||||
self.noise1 = ("plats/train1.wav");
|
||||
precache_sound ("plats/train1.wav");
|
||||
}
|
||||
|
||||
self.cnt = 1;
|
||||
self.solid = SOLID_BSP;
|
||||
self.movetype = MOVETYPE_PUSH;
|
||||
self.blocked = train_blocked;
|
||||
self.use = train_use;
|
||||
self.classname = "train";
|
||||
|
||||
setmodel (self, self.model);
|
||||
setsize (self, self.mins , self.maxs);
|
||||
setorigin (self, self.origin);
|
||||
|
||||
// start trains on the second frame, to make sure their targets have had
|
||||
// a chance to spawn
|
||||
self.nextthink = self.ltime + 0.1;
|
||||
self.think = func_train_find;
|
||||
};
|
||||
|
||||
/*QUAKED misc_teleporttrain (0 .5 .8) (-8 -8 -8) (8 8 8)
|
||||
This is used for the final bos
|
||||
*/
|
||||
void() misc_teleporttrain =
|
||||
{
|
||||
if (!self.speed)
|
||||
self.speed = 100;
|
||||
if (!self.target)
|
||||
objerror ("func_train without a target");
|
||||
|
||||
self.cnt = 1;
|
||||
self.solid = SOLID_NOT;
|
||||
self.movetype = MOVETYPE_PUSH;
|
||||
self.blocked = train_blocked;
|
||||
self.use = train_use;
|
||||
self.avelocity = '100 200 300';
|
||||
|
||||
self.noise = ("misc/null.wav");
|
||||
precache_sound ("misc/null.wav");
|
||||
self.noise1 = ("misc/null.wav");
|
||||
precache_sound ("misc/null.wav");
|
||||
|
||||
precache_model2 ("progs/teleport.mdl");
|
||||
setmodel (self, "progs/teleport.mdl");
|
||||
setsize (self, self.mins , self.maxs);
|
||||
setorigin (self, self.origin);
|
||||
|
||||
// start trains on the second frame, to make sure their targets have had
|
||||
// a chance to spawn
|
||||
self.nextthink = self.ltime + 0.1;
|
||||
self.think = func_train_find;
|
||||
};
|
||||
|
||||
|
|
1420
nqw/player.qc
1420
nqw/player.qc
File diff suppressed because it is too large
Load diff
|
@ -1,2 +1,2 @@
|
|||
//float skill;
|
||||
//float coop;
|
||||
//float skill;
|
||||
//float coop;
|
||||
|
|
|
@ -1,27 +1,27 @@
|
|||
/*
|
||||
|
||||
in nightmare mode, all attack_finished times become 0
|
||||
some monsters refire twice automatically
|
||||
|
||||
*/
|
||||
|
||||
void(float normal) SUB_AttackFinished =
|
||||
{
|
||||
self.cnt = 0; // refire count for nightmare
|
||||
if (skill != 3)
|
||||
self.attack_finished = time + normal;
|
||||
};
|
||||
|
||||
float (entity targ) visible;
|
||||
|
||||
void (void() thinkst) SUB_CheckRefire =
|
||||
{
|
||||
if (skill != 3)
|
||||
return;
|
||||
if (self.cnt == 1)
|
||||
return;
|
||||
if (!visible (self.enemy))
|
||||
return;
|
||||
self.cnt = 1;
|
||||
self.think = thinkst;
|
||||
};
|
||||
/*
|
||||
|
||||
in nightmare mode, all attack_finished times become 0
|
||||
some monsters refire twice automatically
|
||||
|
||||
*/
|
||||
|
||||
void(float normal) SUB_AttackFinished =
|
||||
{
|
||||
self.cnt = 0; // refire count for nightmare
|
||||
if (skill != 3)
|
||||
self.attack_finished = time + normal;
|
||||
};
|
||||
|
||||
float (entity targ) visible;
|
||||
|
||||
void (void() thinkst) SUB_CheckRefire =
|
||||
{
|
||||
if (skill != 3)
|
||||
return;
|
||||
if (self.cnt == 1)
|
||||
return;
|
||||
if (!visible (self.enemy))
|
||||
return;
|
||||
self.cnt = 1;
|
||||
self.think = thinkst;
|
||||
};
|
||||
|
|
196
nqw/server.qc
196
nqw/server.qc
|
@ -1,98 +1,98 @@
|
|||
void() monster_death_use;
|
||||
|
||||
|
||||
void() monster_ogre = {remove(self);};
|
||||
void() monster_demon1 = {remove(self);};
|
||||
void() monster_shambler = {remove(self);};
|
||||
void() monster_knight = {remove(self);};
|
||||
void() monster_army = {remove(self);};
|
||||
void() monster_wizard = {remove(self);};
|
||||
void() monster_dog = {remove(self);};
|
||||
void() monster_zombie = {remove(self);};
|
||||
void() monster_boss = {remove(self);};
|
||||
void() monster_tarbaby = {remove(self);};
|
||||
void() monster_hell_knight = {remove(self);};
|
||||
void() monster_fish = {remove(self);};
|
||||
void() monster_shalrath = {remove(self);};
|
||||
void() monster_enforcer = {remove(self);};
|
||||
void() monster_oldone = {remove(self);};
|
||||
void() event_lightning = {remove(self);};
|
||||
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
MOVETARGET CODE
|
||||
|
||||
The angle of the movetarget effects standing and bowing direction, but has no effect on movement, which allways heads to the next target.
|
||||
|
||||
targetname
|
||||
must be present. The name of this movetarget.
|
||||
|
||||
target
|
||||
the next spot to move to. If not present, stop here for good.
|
||||
|
||||
pausetime
|
||||
The number of seconds to spend standing or bowing for path_stand or path_bow
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
/*
|
||||
=============
|
||||
t_movetarget
|
||||
|
||||
Something has bumped into a movetarget. If it is a monster
|
||||
moving towards it, change the next destination and continue.
|
||||
==============
|
||||
*/
|
||||
void() t_movetarget =
|
||||
{
|
||||
local entity temp;
|
||||
|
||||
if (other.movetarget != self)
|
||||
return;
|
||||
|
||||
if (other.enemy)
|
||||
return; // fighting, not following a path
|
||||
|
||||
temp = self;
|
||||
self = other;
|
||||
other = temp;
|
||||
|
||||
if (self.classname == "monster_ogre")
|
||||
sound (self, CHAN_VOICE, "ogre/ogdrag.wav", 1, ATTN_IDLE);// play chainsaw drag sound
|
||||
|
||||
//dprint ("t_movetarget\n");
|
||||
self.goalentity = self.movetarget = find (world, targetname, other.target);
|
||||
self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin);
|
||||
if (!self.movetarget)
|
||||
{
|
||||
self.pausetime = time + 999999;
|
||||
self.th_stand ();
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
void() movetarget_f =
|
||||
{
|
||||
if (!self.targetname)
|
||||
objerror ("monster_movetarget: no targetname");
|
||||
|
||||
self.solid = SOLID_TRIGGER;
|
||||
self.touch = t_movetarget;
|
||||
setsize (self, '-8 -8 -8', '8 8 8');
|
||||
|
||||
};
|
||||
|
||||
/*QUAKED path_corner (0.5 0.3 0) (-8 -8 -8) (8 8 8)
|
||||
Monsters will continue walking towards the next target corner.
|
||||
*/
|
||||
void() path_corner =
|
||||
{
|
||||
movetarget_f ();
|
||||
};
|
||||
|
||||
|
||||
//============================================================================
|
||||
void() monster_death_use;
|
||||
|
||||
|
||||
void() monster_ogre = {remove(self);};
|
||||
void() monster_demon1 = {remove(self);};
|
||||
void() monster_shambler = {remove(self);};
|
||||
void() monster_knight = {remove(self);};
|
||||
void() monster_army = {remove(self);};
|
||||
void() monster_wizard = {remove(self);};
|
||||
void() monster_dog = {remove(self);};
|
||||
void() monster_zombie = {remove(self);};
|
||||
void() monster_boss = {remove(self);};
|
||||
void() monster_tarbaby = {remove(self);};
|
||||
void() monster_hell_knight = {remove(self);};
|
||||
void() monster_fish = {remove(self);};
|
||||
void() monster_shalrath = {remove(self);};
|
||||
void() monster_enforcer = {remove(self);};
|
||||
void() monster_oldone = {remove(self);};
|
||||
void() event_lightning = {remove(self);};
|
||||
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
MOVETARGET CODE
|
||||
|
||||
The angle of the movetarget effects standing and bowing direction, but has no effect on movement, which allways heads to the next target.
|
||||
|
||||
targetname
|
||||
must be present. The name of this movetarget.
|
||||
|
||||
target
|
||||
the next spot to move to. If not present, stop here for good.
|
||||
|
||||
pausetime
|
||||
The number of seconds to spend standing or bowing for path_stand or path_bow
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
/*
|
||||
=============
|
||||
t_movetarget
|
||||
|
||||
Something has bumped into a movetarget. If it is a monster
|
||||
moving towards it, change the next destination and continue.
|
||||
==============
|
||||
*/
|
||||
void() t_movetarget =
|
||||
{
|
||||
local entity temp;
|
||||
|
||||
if (other.movetarget != self)
|
||||
return;
|
||||
|
||||
if (other.enemy)
|
||||
return; // fighting, not following a path
|
||||
|
||||
temp = self;
|
||||
self = other;
|
||||
other = temp;
|
||||
|
||||
if (self.classname == "monster_ogre")
|
||||
sound (self, CHAN_VOICE, "ogre/ogdrag.wav", 1, ATTN_IDLE);// play chainsaw drag sound
|
||||
|
||||
//dprint ("t_movetarget\n");
|
||||
self.goalentity = self.movetarget = find (world, targetname, other.target);
|
||||
self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin);
|
||||
if (!self.movetarget)
|
||||
{
|
||||
self.pausetime = time + 999999;
|
||||
self.th_stand ();
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
void() movetarget_f =
|
||||
{
|
||||
if (!self.targetname)
|
||||
objerror ("monster_movetarget: no targetname");
|
||||
|
||||
self.solid = SOLID_TRIGGER;
|
||||
self.touch = t_movetarget;
|
||||
setsize (self, '-8 -8 -8', '8 8 8');
|
||||
|
||||
};
|
||||
|
||||
/*QUAKED path_corner (0.5 0.3 0) (-8 -8 -8) (8 8 8)
|
||||
Monsters will continue walking towards the next target corner.
|
||||
*/
|
||||
void() path_corner =
|
||||
{
|
||||
movetarget_f ();
|
||||
};
|
||||
|
||||
|
||||
//============================================================================
|
||||
|
|
168
nqw/spectate.qc
168
nqw/spectate.qc
|
@ -1,84 +1,84 @@
|
|||
// Spectator functions
|
||||
// Added Aug11'97 by Zoid <zoid@idsoftware.com>
|
||||
//
|
||||
// These functions are called from the server if they exist.
|
||||
// Note that Spectators only have one think since they movement code doesn't
|
||||
// track them much. Impulse commands work as usual, but don't call
|
||||
// the regular ImpulseCommand handler in weapons.qc since Spectators don't
|
||||
// have any weapons and things can explode.
|
||||
//
|
||||
// --- Zoid.
|
||||
|
||||
/*
|
||||
===========
|
||||
SpectatorConnect
|
||||
|
||||
called when a spectator connects to a server
|
||||
============
|
||||
*/
|
||||
void() SpectatorConnect =
|
||||
{
|
||||
bprint (PRINT_MEDIUM, "Spectator ");
|
||||
bprint (PRINT_MEDIUM, self.netname);
|
||||
bprint (PRINT_MEDIUM, " entered the game\n");
|
||||
|
||||
self.goalentity = world; // used for impulse 1 below
|
||||
};
|
||||
|
||||
/*
|
||||
===========
|
||||
SpectatorDisconnect
|
||||
|
||||
called when a spectator disconnects from a server
|
||||
============
|
||||
*/
|
||||
void() SpectatorDisconnect =
|
||||
{
|
||||
bprint (PRINT_MEDIUM, "Spectator ");
|
||||
bprint (PRINT_MEDIUM, self.netname);
|
||||
bprint (PRINT_MEDIUM, " left the game\n");
|
||||
};
|
||||
|
||||
/*
|
||||
================
|
||||
SpectatorImpulseCommand
|
||||
|
||||
Called by SpectatorThink if the spectator entered an impulse
|
||||
================
|
||||
*/
|
||||
void() SpectatorImpulseCommand =
|
||||
{
|
||||
if (self.impulse == 1) {
|
||||
// teleport the spectator to the next spawn point
|
||||
// note that if the spectator is tracking, this doesn't do
|
||||
// much
|
||||
self.goalentity = find(self.goalentity, classname, "info_player_deathmatch");
|
||||
if (self.goalentity == world)
|
||||
self.goalentity = find(self.goalentity, classname, "info_player_deathmatch");
|
||||
if (self.goalentity != world) {
|
||||
setorigin(self, self.goalentity.origin);
|
||||
self.angles = self.goalentity.angles;
|
||||
self.fixangle = TRUE; // turn this way immediately
|
||||
}
|
||||
}
|
||||
|
||||
self.impulse = 0;
|
||||
};
|
||||
|
||||
/*
|
||||
================
|
||||
SpectatorThink
|
||||
|
||||
Called every frame after physics are run
|
||||
================
|
||||
*/
|
||||
void() SpectatorThink =
|
||||
{
|
||||
// self.origin, etc contains spectator position, so you could
|
||||
// do some neat stuff here
|
||||
|
||||
if (self.impulse)
|
||||
SpectatorImpulseCommand();
|
||||
};
|
||||
|
||||
|
||||
// Spectator functions
|
||||
// Added Aug11'97 by Zoid <zoid@idsoftware.com>
|
||||
//
|
||||
// These functions are called from the server if they exist.
|
||||
// Note that Spectators only have one think since they movement code doesn't
|
||||
// track them much. Impulse commands work as usual, but don't call
|
||||
// the regular ImpulseCommand handler in weapons.qc since Spectators don't
|
||||
// have any weapons and things can explode.
|
||||
//
|
||||
// --- Zoid.
|
||||
|
||||
/*
|
||||
===========
|
||||
SpectatorConnect
|
||||
|
||||
called when a spectator connects to a server
|
||||
============
|
||||
*/
|
||||
void() SpectatorConnect =
|
||||
{
|
||||
bprint (PRINT_MEDIUM, "Spectator ");
|
||||
bprint (PRINT_MEDIUM, self.netname);
|
||||
bprint (PRINT_MEDIUM, " entered the game\n");
|
||||
|
||||
self.goalentity = world; // used for impulse 1 below
|
||||
};
|
||||
|
||||
/*
|
||||
===========
|
||||
SpectatorDisconnect
|
||||
|
||||
called when a spectator disconnects from a server
|
||||
============
|
||||
*/
|
||||
void() SpectatorDisconnect =
|
||||
{
|
||||
bprint (PRINT_MEDIUM, "Spectator ");
|
||||
bprint (PRINT_MEDIUM, self.netname);
|
||||
bprint (PRINT_MEDIUM, " left the game\n");
|
||||
};
|
||||
|
||||
/*
|
||||
================
|
||||
SpectatorImpulseCommand
|
||||
|
||||
Called by SpectatorThink if the spectator entered an impulse
|
||||
================
|
||||
*/
|
||||
void() SpectatorImpulseCommand =
|
||||
{
|
||||
if (self.impulse == 1) {
|
||||
// teleport the spectator to the next spawn point
|
||||
// note that if the spectator is tracking, this doesn't do
|
||||
// much
|
||||
self.goalentity = find(self.goalentity, classname, "info_player_deathmatch");
|
||||
if (self.goalentity == world)
|
||||
self.goalentity = find(self.goalentity, classname, "info_player_deathmatch");
|
||||
if (self.goalentity != world) {
|
||||
setorigin(self, self.goalentity.origin);
|
||||
self.angles = self.goalentity.angles;
|
||||
self.fixangle = TRUE; // turn this way immediately
|
||||
}
|
||||
}
|
||||
|
||||
self.impulse = 0;
|
||||
};
|
||||
|
||||
/*
|
||||
================
|
||||
SpectatorThink
|
||||
|
||||
Called every frame after physics are run
|
||||
================
|
||||
*/
|
||||
void() SpectatorThink =
|
||||
{
|
||||
// self.origin, etc contains spectator position, so you could
|
||||
// do some neat stuff here
|
||||
|
||||
if (self.impulse)
|
||||
SpectatorImpulseCommand();
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -1,26 +1,26 @@
|
|||
|
||||
// these are the only sprites still in the game...
|
||||
|
||||
$spritename s_explod
|
||||
$type vp_parallel
|
||||
$load /raid/quake/id1/gfx/sprites/explod03.lbm
|
||||
$frame 24 24 56 56
|
||||
$frame 120 24 56 56
|
||||
$frame 216 24 56 56
|
||||
$frame 24 88 56 56
|
||||
$frame 120 88 56 56
|
||||
$frame 216 88 56 56
|
||||
|
||||
|
||||
$spritename s_bubble
|
||||
$type vp_parallel
|
||||
$load /raid/quake/id1/gfx/sprites/bubble.lbm
|
||||
$frame 16 16 16 16
|
||||
$frame 40 16 16 16
|
||||
|
||||
|
||||
$spritename s_light
|
||||
$type vp_parallel
|
||||
$load /raid/quake/id1/gfx/sprites/light.lbm
|
||||
$frame 104 32 32 32
|
||||
|
||||
|
||||
// these are the only sprites still in the game...
|
||||
|
||||
$spritename s_explod
|
||||
$type vp_parallel
|
||||
$load /raid/quake/id1/gfx/sprites/explod03.lbm
|
||||
$frame 24 24 56 56
|
||||
$frame 120 24 56 56
|
||||
$frame 216 24 56 56
|
||||
$frame 24 88 56 56
|
||||
$frame 120 88 56 56
|
||||
$frame 216 88 56 56
|
||||
|
||||
|
||||
$spritename s_bubble
|
||||
$type vp_parallel
|
||||
$load /raid/quake/id1/gfx/sprites/bubble.lbm
|
||||
$frame 16 16 16 16
|
||||
$frame 40 16 16 16
|
||||
|
||||
|
||||
$spritename s_light
|
||||
$type vp_parallel
|
||||
$load /raid/quake/id1/gfx/sprites/light.lbm
|
||||
$frame 104 32 32 32
|
||||
|
||||
|
|
568
nqw/subs.qc
568
nqw/subs.qc
|
@ -1,284 +1,284 @@
|
|||
|
||||
|
||||
void() SUB_Null = {};
|
||||
|
||||
void() SUB_Remove = {remove(self);};
|
||||
|
||||
|
||||
/*
|
||||
QuakeEd only writes a single float for angles (bad idea), so up and down are
|
||||
just constant angles.
|
||||
*/
|
||||
vector() SetMovedir =
|
||||
{
|
||||
if (self.angles == '0 -1 0')
|
||||
self.movedir = '0 0 1';
|
||||
else if (self.angles == '0 -2 0')
|
||||
self.movedir = '0 0 -1';
|
||||
else
|
||||
{
|
||||
makevectors (self.angles);
|
||||
self.movedir = v_forward;
|
||||
}
|
||||
|
||||
self.angles = '0 0 0';
|
||||
};
|
||||
|
||||
/*
|
||||
================
|
||||
InitTrigger
|
||||
================
|
||||
*/
|
||||
void() InitTrigger =
|
||||
{
|
||||
// trigger angles are used for one-way touches. An angle of 0 is assumed
|
||||
// to mean no restrictions, so use a yaw of 360 instead.
|
||||
if (self.angles != '0 0 0')
|
||||
SetMovedir ();
|
||||
self.solid = SOLID_TRIGGER;
|
||||
setmodel (self, self.model); // set size and link into world
|
||||
self.movetype = MOVETYPE_NONE;
|
||||
self.modelindex = 0;
|
||||
self.model = "";
|
||||
};
|
||||
|
||||
/*
|
||||
=============
|
||||
SUB_CalcMove
|
||||
|
||||
calculate self.velocity and self.nextthink to reach dest from
|
||||
self.origin traveling at speed
|
||||
===============
|
||||
*/
|
||||
void(entity ent, vector tdest, float tspeed, void() func) SUB_CalcMoveEnt =
|
||||
{
|
||||
local entity stemp;
|
||||
stemp = self;
|
||||
self = ent;
|
||||
|
||||
SUB_CalcMove (tdest, tspeed, func);
|
||||
self = stemp;
|
||||
};
|
||||
|
||||
void(vector tdest, float tspeed, void() func) SUB_CalcMove =
|
||||
{
|
||||
local vector vdestdelta;
|
||||
local float len, traveltime;
|
||||
|
||||
if (!tspeed)
|
||||
objerror("No speed is defined!");
|
||||
|
||||
self.think1 = func;
|
||||
self.finaldest = tdest;
|
||||
self.think = SUB_CalcMoveDone;
|
||||
|
||||
if (tdest == self.origin)
|
||||
{
|
||||
self.velocity = '0 0 0';
|
||||
self.nextthink = self.ltime + 0.1;
|
||||
return;
|
||||
}
|
||||
|
||||
// set destdelta to the vector needed to move
|
||||
vdestdelta = tdest - self.origin;
|
||||
|
||||
// calculate length of vector
|
||||
len = vlen (vdestdelta);
|
||||
|
||||
// divide by speed to get time to reach dest
|
||||
traveltime = len / tspeed;
|
||||
|
||||
if (traveltime < 0.03)
|
||||
traveltime = 0.03;
|
||||
|
||||
// set nextthink to trigger a think when dest is reached
|
||||
self.nextthink = self.ltime + traveltime;
|
||||
|
||||
// scale the destdelta vector by the time spent traveling to get velocity
|
||||
self.velocity = vdestdelta * (1/traveltime); // qcc won't take vec/float
|
||||
};
|
||||
|
||||
/*
|
||||
============
|
||||
After moving, set origin to exact final destination
|
||||
============
|
||||
*/
|
||||
void() SUB_CalcMoveDone =
|
||||
{
|
||||
setorigin(self, self.finaldest);
|
||||
self.velocity = '0 0 0';
|
||||
self.nextthink = -1;
|
||||
if (self.think1)
|
||||
self.think1();
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
=============
|
||||
SUB_CalcAngleMove
|
||||
|
||||
calculate self.avelocity and self.nextthink to reach destangle from
|
||||
self.angles rotating
|
||||
|
||||
The calling function should make sure self.think is valid
|
||||
===============
|
||||
*/
|
||||
void(entity ent, vector destangle, float tspeed, void() func) SUB_CalcAngleMoveEnt =
|
||||
{
|
||||
local entity stemp;
|
||||
stemp = self;
|
||||
self = ent;
|
||||
SUB_CalcAngleMove (destangle, tspeed, func);
|
||||
self = stemp;
|
||||
};
|
||||
|
||||
void(vector destangle, float tspeed, void() func) SUB_CalcAngleMove =
|
||||
{
|
||||
local vector destdelta;
|
||||
local float len, traveltime;
|
||||
|
||||
if (!tspeed)
|
||||
objerror("No speed is defined!");
|
||||
|
||||
// set destdelta to the vector needed to move
|
||||
destdelta = destangle - self.angles;
|
||||
|
||||
// calculate length of vector
|
||||
len = vlen (destdelta);
|
||||
|
||||
// divide by speed to get time to reach dest
|
||||
traveltime = len / tspeed;
|
||||
|
||||
// set nextthink to trigger a think when dest is reached
|
||||
self.nextthink = self.ltime + traveltime;
|
||||
|
||||
// scale the destdelta vector by the time spent traveling to get velocity
|
||||
self.avelocity = destdelta * (1 / traveltime);
|
||||
|
||||
self.think1 = func;
|
||||
self.finalangle = destangle;
|
||||
self.think = SUB_CalcAngleMoveDone;
|
||||
};
|
||||
|
||||
/*
|
||||
============
|
||||
After rotating, set angle to exact final angle
|
||||
============
|
||||
*/
|
||||
void() SUB_CalcAngleMoveDone =
|
||||
{
|
||||
self.angles = self.finalangle;
|
||||
self.avelocity = '0 0 0';
|
||||
self.nextthink = -1;
|
||||
if (self.think1)
|
||||
self.think1();
|
||||
};
|
||||
|
||||
|
||||
//=============================================================================
|
||||
|
||||
void() DelayThink =
|
||||
{
|
||||
activator = self.enemy;
|
||||
SUB_UseTargets ();
|
||||
remove(self);
|
||||
};
|
||||
|
||||
/*
|
||||
==============================
|
||||
SUB_UseTargets
|
||||
|
||||
the global "activator" should be set to the entity that initiated the firing.
|
||||
|
||||
If self.delay is set, a DelayedUse entity will be created that will actually
|
||||
do the SUB_UseTargets after that many seconds have passed.
|
||||
|
||||
Centerprints any self.message to the activator.
|
||||
|
||||
Removes all entities with a targetname that match self.killtarget,
|
||||
and removes them, so some events can remove other triggers.
|
||||
|
||||
Search for (string)targetname in all entities that
|
||||
match (string)self.target and call their .use function
|
||||
|
||||
==============================
|
||||
*/
|
||||
void() SUB_UseTargets =
|
||||
{
|
||||
local entity t, stemp, otemp, act;
|
||||
|
||||
//
|
||||
// check for a delay
|
||||
//
|
||||
if (self.delay)
|
||||
{
|
||||
// create a temp object to fire at a later time
|
||||
t = spawn();
|
||||
t.classname = "DelayedUse";
|
||||
t.nextthink = time + self.delay;
|
||||
t.think = DelayThink;
|
||||
t.enemy = activator;
|
||||
t.message = self.message;
|
||||
t.killtarget = self.killtarget;
|
||||
t.target = self.target;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// print the message
|
||||
//
|
||||
if (activator.classname == "player" && self.message != "")
|
||||
{
|
||||
centerprint (activator, self.message);
|
||||
if (!self.noise)
|
||||
sound (activator, CHAN_VOICE, "misc/talk.wav", 1, ATTN_NORM);
|
||||
}
|
||||
|
||||
//
|
||||
// kill the killtagets
|
||||
//
|
||||
if (self.killtarget)
|
||||
{
|
||||
t = world;
|
||||
do
|
||||
{
|
||||
t = find (t, targetname, self.killtarget);
|
||||
if (!t)
|
||||
return;
|
||||
remove (t);
|
||||
} while ( 1 );
|
||||
}
|
||||
|
||||
//
|
||||
// fire targets
|
||||
//
|
||||
if (self.target)
|
||||
{
|
||||
act = activator;
|
||||
t = world;
|
||||
do
|
||||
{
|
||||
t = find (t, targetname, self.target);
|
||||
if (!t)
|
||||
{
|
||||
return;
|
||||
}
|
||||
stemp = self;
|
||||
otemp = other;
|
||||
self = t;
|
||||
other = stemp;
|
||||
if (self.use != SUB_Null)
|
||||
{
|
||||
if (self.use)
|
||||
self.use ();
|
||||
}
|
||||
self = stemp;
|
||||
other = otemp;
|
||||
activator = act;
|
||||
} while ( 1 );
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
void() SUB_Null = {};
|
||||
|
||||
void() SUB_Remove = {remove(self);};
|
||||
|
||||
|
||||
/*
|
||||
QuakeEd only writes a single float for angles (bad idea), so up and down are
|
||||
just constant angles.
|
||||
*/
|
||||
vector() SetMovedir =
|
||||
{
|
||||
if (self.angles == '0 -1 0')
|
||||
self.movedir = '0 0 1';
|
||||
else if (self.angles == '0 -2 0')
|
||||
self.movedir = '0 0 -1';
|
||||
else
|
||||
{
|
||||
makevectors (self.angles);
|
||||
self.movedir = v_forward;
|
||||
}
|
||||
|
||||
self.angles = '0 0 0';
|
||||
};
|
||||
|
||||
/*
|
||||
================
|
||||
InitTrigger
|
||||
================
|
||||
*/
|
||||
void() InitTrigger =
|
||||
{
|
||||
// trigger angles are used for one-way touches. An angle of 0 is assumed
|
||||
// to mean no restrictions, so use a yaw of 360 instead.
|
||||
if (self.angles != '0 0 0')
|
||||
SetMovedir ();
|
||||
self.solid = SOLID_TRIGGER;
|
||||
setmodel (self, self.model); // set size and link into world
|
||||
self.movetype = MOVETYPE_NONE;
|
||||
self.modelindex = 0;
|
||||
self.model = "";
|
||||
};
|
||||
|
||||
/*
|
||||
=============
|
||||
SUB_CalcMove
|
||||
|
||||
calculate self.velocity and self.nextthink to reach dest from
|
||||
self.origin traveling at speed
|
||||
===============
|
||||
*/
|
||||
void(entity ent, vector tdest, float tspeed, void() func) SUB_CalcMoveEnt =
|
||||
{
|
||||
local entity stemp;
|
||||
stemp = self;
|
||||
self = ent;
|
||||
|
||||
SUB_CalcMove (tdest, tspeed, func);
|
||||
self = stemp;
|
||||
};
|
||||
|
||||
void(vector tdest, float tspeed, void() func) SUB_CalcMove =
|
||||
{
|
||||
local vector vdestdelta;
|
||||
local float len, traveltime;
|
||||
|
||||
if (!tspeed)
|
||||
objerror("No speed is defined!");
|
||||
|
||||
self.think1 = func;
|
||||
self.finaldest = tdest;
|
||||
self.think = SUB_CalcMoveDone;
|
||||
|
||||
if (tdest == self.origin)
|
||||
{
|
||||
self.velocity = '0 0 0';
|
||||
self.nextthink = self.ltime + 0.1;
|
||||
return;
|
||||
}
|
||||
|
||||
// set destdelta to the vector needed to move
|
||||
vdestdelta = tdest - self.origin;
|
||||
|
||||
// calculate length of vector
|
||||
len = vlen (vdestdelta);
|
||||
|
||||
// divide by speed to get time to reach dest
|
||||
traveltime = len / tspeed;
|
||||
|
||||
if (traveltime < 0.03)
|
||||
traveltime = 0.03;
|
||||
|
||||
// set nextthink to trigger a think when dest is reached
|
||||
self.nextthink = self.ltime + traveltime;
|
||||
|
||||
// scale the destdelta vector by the time spent traveling to get velocity
|
||||
self.velocity = vdestdelta * (1/traveltime); // qcc won't take vec/float
|
||||
};
|
||||
|
||||
/*
|
||||
============
|
||||
After moving, set origin to exact final destination
|
||||
============
|
||||
*/
|
||||
void() SUB_CalcMoveDone =
|
||||
{
|
||||
setorigin(self, self.finaldest);
|
||||
self.velocity = '0 0 0';
|
||||
self.nextthink = -1;
|
||||
if (self.think1)
|
||||
self.think1();
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
=============
|
||||
SUB_CalcAngleMove
|
||||
|
||||
calculate self.avelocity and self.nextthink to reach destangle from
|
||||
self.angles rotating
|
||||
|
||||
The calling function should make sure self.think is valid
|
||||
===============
|
||||
*/
|
||||
void(entity ent, vector destangle, float tspeed, void() func) SUB_CalcAngleMoveEnt =
|
||||
{
|
||||
local entity stemp;
|
||||
stemp = self;
|
||||
self = ent;
|
||||
SUB_CalcAngleMove (destangle, tspeed, func);
|
||||
self = stemp;
|
||||
};
|
||||
|
||||
void(vector destangle, float tspeed, void() func) SUB_CalcAngleMove =
|
||||
{
|
||||
local vector destdelta;
|
||||
local float len, traveltime;
|
||||
|
||||
if (!tspeed)
|
||||
objerror("No speed is defined!");
|
||||
|
||||
// set destdelta to the vector needed to move
|
||||
destdelta = destangle - self.angles;
|
||||
|
||||
// calculate length of vector
|
||||
len = vlen (destdelta);
|
||||
|
||||
// divide by speed to get time to reach dest
|
||||
traveltime = len / tspeed;
|
||||
|
||||
// set nextthink to trigger a think when dest is reached
|
||||
self.nextthink = self.ltime + traveltime;
|
||||
|
||||
// scale the destdelta vector by the time spent traveling to get velocity
|
||||
self.avelocity = destdelta * (1 / traveltime);
|
||||
|
||||
self.think1 = func;
|
||||
self.finalangle = destangle;
|
||||
self.think = SUB_CalcAngleMoveDone;
|
||||
};
|
||||
|
||||
/*
|
||||
============
|
||||
After rotating, set angle to exact final angle
|
||||
============
|
||||
*/
|
||||
void() SUB_CalcAngleMoveDone =
|
||||
{
|
||||
self.angles = self.finalangle;
|
||||
self.avelocity = '0 0 0';
|
||||
self.nextthink = -1;
|
||||
if (self.think1)
|
||||
self.think1();
|
||||
};
|
||||
|
||||
|
||||
//=============================================================================
|
||||
|
||||
void() DelayThink =
|
||||
{
|
||||
activator = self.enemy;
|
||||
SUB_UseTargets ();
|
||||
remove(self);
|
||||
};
|
||||
|
||||
/*
|
||||
==============================
|
||||
SUB_UseTargets
|
||||
|
||||
the global "activator" should be set to the entity that initiated the firing.
|
||||
|
||||
If self.delay is set, a DelayedUse entity will be created that will actually
|
||||
do the SUB_UseTargets after that many seconds have passed.
|
||||
|
||||
Centerprints any self.message to the activator.
|
||||
|
||||
Removes all entities with a targetname that match self.killtarget,
|
||||
and removes them, so some events can remove other triggers.
|
||||
|
||||
Search for (string)targetname in all entities that
|
||||
match (string)self.target and call their .use function
|
||||
|
||||
==============================
|
||||
*/
|
||||
void() SUB_UseTargets =
|
||||
{
|
||||
local entity t, stemp, otemp, act;
|
||||
|
||||
//
|
||||
// check for a delay
|
||||
//
|
||||
if (self.delay)
|
||||
{
|
||||
// create a temp object to fire at a later time
|
||||
t = spawn();
|
||||
t.classname = "DelayedUse";
|
||||
t.nextthink = time + self.delay;
|
||||
t.think = DelayThink;
|
||||
t.enemy = activator;
|
||||
t.message = self.message;
|
||||
t.killtarget = self.killtarget;
|
||||
t.target = self.target;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// print the message
|
||||
//
|
||||
if (activator.classname == "player" && self.message != "")
|
||||
{
|
||||
centerprint (activator, self.message);
|
||||
if (!self.noise)
|
||||
sound (activator, CHAN_VOICE, "misc/talk.wav", 1, ATTN_NORM);
|
||||
}
|
||||
|
||||
//
|
||||
// kill the killtagets
|
||||
//
|
||||
if (self.killtarget)
|
||||
{
|
||||
t = world;
|
||||
do
|
||||
{
|
||||
t = find (t, targetname, self.killtarget);
|
||||
if (!t)
|
||||
return;
|
||||
remove (t);
|
||||
} while ( 1 );
|
||||
}
|
||||
|
||||
//
|
||||
// fire targets
|
||||
//
|
||||
if (self.target)
|
||||
{
|
||||
act = activator;
|
||||
t = world;
|
||||
do
|
||||
{
|
||||
t = find (t, targetname, self.target);
|
||||
if (!t)
|
||||
{
|
||||
return;
|
||||
}
|
||||
stemp = self;
|
||||
otemp = other;
|
||||
self = t;
|
||||
other = stemp;
|
||||
if (self.use != SUB_Null)
|
||||
{
|
||||
if (self.use)
|
||||
self.use ();
|
||||
}
|
||||
self = stemp;
|
||||
other = otemp;
|
||||
activator = act;
|
||||
} while ( 1 );
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
|
1326
nqw/triggers.qc
1326
nqw/triggers.qc
File diff suppressed because it is too large
Load diff
2794
nqw/weapons.qc
2794
nqw/weapons.qc
File diff suppressed because it is too large
Load diff
814
nqw/world.qc
814
nqw/world.qc
|
@ -1,407 +1,407 @@
|
|||
|
||||
void() InitBodyQue;
|
||||
|
||||
|
||||
void() main =
|
||||
{
|
||||
dprint ("main function\n");
|
||||
|
||||
// these are just commands the the prog compiler to copy these files
|
||||
|
||||
precache_file ("progs.dat");
|
||||
precache_file ("gfx.wad");
|
||||
precache_file ("quake.rc");
|
||||
precache_file ("default.cfg");
|
||||
|
||||
precache_file ("end1.bin");
|
||||
precache_file2 ("end2.bin");
|
||||
|
||||
precache_file ("demo1.dem");
|
||||
precache_file ("demo2.dem");
|
||||
precache_file ("demo3.dem");
|
||||
|
||||
//
|
||||
// these are all of the lumps from the cached.ls files
|
||||
//
|
||||
precache_file ("gfx/palette.lmp");
|
||||
precache_file ("gfx/colormap.lmp");
|
||||
|
||||
precache_file2 ("gfx/pop.lmp");
|
||||
|
||||
precache_file ("gfx/complete.lmp");
|
||||
precache_file ("gfx/inter.lmp");
|
||||
|
||||
precache_file ("gfx/ranking.lmp");
|
||||
precache_file ("gfx/vidmodes.lmp");
|
||||
precache_file ("gfx/finale.lmp");
|
||||
precache_file ("gfx/conback.lmp");
|
||||
precache_file ("gfx/qplaque.lmp");
|
||||
|
||||
precache_file ("gfx/menudot1.lmp");
|
||||
precache_file ("gfx/menudot2.lmp");
|
||||
precache_file ("gfx/menudot3.lmp");
|
||||
precache_file ("gfx/menudot4.lmp");
|
||||
precache_file ("gfx/menudot5.lmp");
|
||||
precache_file ("gfx/menudot6.lmp");
|
||||
|
||||
precache_file ("gfx/menuplyr.lmp");
|
||||
precache_file ("gfx/bigbox.lmp");
|
||||
precache_file ("gfx/dim_modm.lmp");
|
||||
precache_file ("gfx/dim_drct.lmp");
|
||||
precache_file ("gfx/dim_ipx.lmp");
|
||||
precache_file ("gfx/dim_tcp.lmp");
|
||||
precache_file ("gfx/dim_mult.lmp");
|
||||
precache_file ("gfx/mainmenu.lmp");
|
||||
|
||||
precache_file ("gfx/box_tl.lmp");
|
||||
precache_file ("gfx/box_tm.lmp");
|
||||
precache_file ("gfx/box_tr.lmp");
|
||||
|
||||
precache_file ("gfx/box_ml.lmp");
|
||||
precache_file ("gfx/box_mm.lmp");
|
||||
precache_file ("gfx/box_mm2.lmp");
|
||||
precache_file ("gfx/box_mr.lmp");
|
||||
|
||||
precache_file ("gfx/box_bl.lmp");
|
||||
precache_file ("gfx/box_bm.lmp");
|
||||
precache_file ("gfx/box_br.lmp");
|
||||
|
||||
precache_file ("gfx/sp_menu.lmp");
|
||||
precache_file ("gfx/ttl_sgl.lmp");
|
||||
precache_file ("gfx/ttl_main.lmp");
|
||||
precache_file ("gfx/ttl_cstm.lmp");
|
||||
|
||||
precache_file ("gfx/mp_menu.lmp");
|
||||
|
||||
precache_file ("gfx/netmen1.lmp");
|
||||
precache_file ("gfx/netmen2.lmp");
|
||||
precache_file ("gfx/netmen3.lmp");
|
||||
precache_file ("gfx/netmen4.lmp");
|
||||
precache_file ("gfx/netmen5.lmp");
|
||||
|
||||
precache_file ("gfx/sell.lmp");
|
||||
|
||||
precache_file ("gfx/help0.lmp");
|
||||
precache_file ("gfx/help1.lmp");
|
||||
precache_file ("gfx/help2.lmp");
|
||||
precache_file ("gfx/help3.lmp");
|
||||
precache_file ("gfx/help4.lmp");
|
||||
precache_file ("gfx/help5.lmp");
|
||||
|
||||
precache_file ("gfx/pause.lmp");
|
||||
precache_file ("gfx/loading.lmp");
|
||||
|
||||
precache_file ("gfx/p_option.lmp");
|
||||
precache_file ("gfx/p_load.lmp");
|
||||
precache_file ("gfx/p_save.lmp");
|
||||
precache_file ("gfx/p_multi.lmp");
|
||||
|
||||
// sounds loaded by C code
|
||||
precache_sound ("misc/menu1.wav");
|
||||
precache_sound ("misc/menu2.wav");
|
||||
precache_sound ("misc/menu3.wav");
|
||||
|
||||
precache_sound ("ambience/water1.wav");
|
||||
precache_sound ("ambience/wind2.wav");
|
||||
|
||||
// shareware
|
||||
precache_file ("maps/start.bsp");
|
||||
|
||||
precache_file ("maps/e1m1.bsp");
|
||||
precache_file ("maps/e1m2.bsp");
|
||||
precache_file ("maps/e1m3.bsp");
|
||||
precache_file ("maps/e1m4.bsp");
|
||||
precache_file ("maps/e1m5.bsp");
|
||||
precache_file ("maps/e1m6.bsp");
|
||||
precache_file ("maps/e1m7.bsp");
|
||||
precache_file ("maps/e1m8.bsp");
|
||||
|
||||
// registered
|
||||
precache_file2 ("gfx/pop.lmp");
|
||||
|
||||
precache_file2 ("maps/e2m1.bsp");
|
||||
precache_file2 ("maps/e2m2.bsp");
|
||||
precache_file2 ("maps/e2m3.bsp");
|
||||
precache_file2 ("maps/e2m4.bsp");
|
||||
precache_file2 ("maps/e2m5.bsp");
|
||||
precache_file2 ("maps/e2m6.bsp");
|
||||
precache_file2 ("maps/e2m7.bsp");
|
||||
|
||||
precache_file2 ("maps/e3m1.bsp");
|
||||
precache_file2 ("maps/e3m2.bsp");
|
||||
precache_file2 ("maps/e3m3.bsp");
|
||||
precache_file2 ("maps/e3m4.bsp");
|
||||
precache_file2 ("maps/e3m5.bsp");
|
||||
precache_file2 ("maps/e3m6.bsp");
|
||||
precache_file2 ("maps/e3m7.bsp");
|
||||
|
||||
precache_file2 ("maps/e4m1.bsp");
|
||||
precache_file2 ("maps/e4m2.bsp");
|
||||
precache_file2 ("maps/e4m3.bsp");
|
||||
precache_file2 ("maps/e4m4.bsp");
|
||||
precache_file2 ("maps/e4m5.bsp");
|
||||
precache_file2 ("maps/e4m6.bsp");
|
||||
precache_file2 ("maps/e4m7.bsp");
|
||||
precache_file2 ("maps/e4m8.bsp");
|
||||
|
||||
precache_file2 ("maps/end.bsp");
|
||||
|
||||
precache_file2 ("maps/dm1.bsp");
|
||||
precache_file2 ("maps/dm2.bsp");
|
||||
precache_file2 ("maps/dm3.bsp");
|
||||
precache_file2 ("maps/dm4.bsp");
|
||||
precache_file2 ("maps/dm5.bsp");
|
||||
precache_file2 ("maps/dm6.bsp");
|
||||
};
|
||||
|
||||
|
||||
entity lastspawn;
|
||||
|
||||
//=======================
|
||||
/*QUAKED worldspawn (0 0 0) ?
|
||||
Only used for the world entity.
|
||||
Set message to the level name.
|
||||
Set sounds to the cd track to play.
|
||||
|
||||
World Types:
|
||||
0: medieval
|
||||
1: metal
|
||||
2: base
|
||||
*/
|
||||
//=======================
|
||||
void() worldspawn =
|
||||
{
|
||||
lastspawn = world;
|
||||
InitBodyQue ();
|
||||
|
||||
// custom map attributes
|
||||
|
||||
if (self.model == "maps/e1m8.bsp")
|
||||
cvar_set ("sv_gravity", "100");
|
||||
else
|
||||
cvar_set ("sv_gravity", "800");
|
||||
|
||||
|
||||
// the area based ambient sounds MUST be the first precache_sounds
|
||||
|
||||
// player precaches
|
||||
W_Precache (); // get weapon precaches
|
||||
|
||||
// sounds used from C physics code
|
||||
precache_sound ("demon/dland2.wav"); // landing thud
|
||||
precache_sound ("misc/h2ohit1.wav"); // landing splash
|
||||
|
||||
// setup precaches allways needed
|
||||
precache_sound ("items/itembk2.wav"); // item respawn sound
|
||||
precache_sound ("player/plyrjmp8.wav"); // player jump
|
||||
precache_sound ("player/land.wav"); // player landing
|
||||
precache_sound ("player/land2.wav"); // player hurt landing
|
||||
precache_sound ("player/drown1.wav"); // drowning pain
|
||||
precache_sound ("player/drown2.wav"); // drowning pain
|
||||
precache_sound ("player/gasp1.wav"); // gasping for air
|
||||
precache_sound ("player/gasp2.wav"); // taking breath
|
||||
precache_sound ("player/h2odeath.wav"); // drowning death
|
||||
|
||||
precache_sound ("misc/talk.wav"); // talk
|
||||
precache_sound ("player/teledth1.wav"); // telefrag
|
||||
precache_sound ("misc/r_tele1.wav"); // teleport sounds
|
||||
precache_sound ("misc/r_tele2.wav");
|
||||
precache_sound ("misc/r_tele3.wav");
|
||||
precache_sound ("misc/r_tele4.wav");
|
||||
precache_sound ("misc/r_tele5.wav");
|
||||
precache_sound ("weapons/lock4.wav"); // ammo pick up
|
||||
precache_sound ("weapons/pkup.wav"); // weapon up
|
||||
precache_sound ("items/armor1.wav"); // armor up
|
||||
precache_sound ("weapons/lhit.wav"); //lightning
|
||||
precache_sound ("weapons/lstart.wav"); //lightning start
|
||||
precache_sound ("items/damage3.wav");
|
||||
|
||||
precache_sound ("misc/power.wav"); //lightning for boss
|
||||
|
||||
// player gib sounds
|
||||
precache_sound ("player/gib.wav"); // player gib sound
|
||||
precache_sound ("player/udeath.wav"); // player gib sound
|
||||
precache_sound ("player/tornoff2.wav"); // gib sound
|
||||
|
||||
// player pain sounds
|
||||
|
||||
precache_sound ("player/pain1.wav");
|
||||
precache_sound ("player/pain2.wav");
|
||||
precache_sound ("player/pain3.wav");
|
||||
precache_sound ("player/pain4.wav");
|
||||
precache_sound ("player/pain5.wav");
|
||||
precache_sound ("player/pain6.wav");
|
||||
|
||||
// player death sounds
|
||||
precache_sound ("player/death1.wav");
|
||||
precache_sound ("player/death2.wav");
|
||||
precache_sound ("player/death3.wav");
|
||||
precache_sound ("player/death4.wav");
|
||||
precache_sound ("player/death5.wav");
|
||||
|
||||
precache_sound ("boss1/sight1.wav");
|
||||
|
||||
// ax sounds
|
||||
precache_sound ("weapons/ax1.wav"); // ax swoosh
|
||||
precache_sound ("player/axhit1.wav"); // ax hit meat
|
||||
precache_sound ("player/axhit2.wav"); // ax hit world
|
||||
|
||||
precache_sound ("player/h2ojump.wav"); // player jumping into water
|
||||
precache_sound ("player/slimbrn2.wav"); // player enter slime
|
||||
precache_sound ("player/inh2o.wav"); // player enter water
|
||||
precache_sound ("player/inlava.wav"); // player enter lava
|
||||
precache_sound ("misc/outwater.wav"); // leaving water sound
|
||||
|
||||
precache_sound ("player/lburn1.wav"); // lava burn
|
||||
precache_sound ("player/lburn2.wav"); // lava burn
|
||||
|
||||
precache_sound ("misc/water1.wav"); // swimming
|
||||
precache_sound ("misc/water2.wav"); // swimming
|
||||
|
||||
// Invulnerability sounds
|
||||
precache_sound ("items/protect.wav");
|
||||
precache_sound ("items/protect2.wav");
|
||||
precache_sound ("items/protect3.wav");
|
||||
|
||||
|
||||
precache_model ("progs/player.mdl");
|
||||
precache_model ("progs/eyes.mdl");
|
||||
precache_model ("progs/h_player.mdl");
|
||||
precache_model ("progs/gib1.mdl");
|
||||
precache_model ("progs/gib2.mdl");
|
||||
precache_model ("progs/gib3.mdl");
|
||||
|
||||
precache_model ("progs/s_bubble.spr"); // drowning bubbles
|
||||
precache_model ("progs/s_explod.spr"); // sprite explosion
|
||||
|
||||
precache_model ("progs/v_axe.mdl");
|
||||
precache_model ("progs/v_shot.mdl");
|
||||
precache_model ("progs/v_nail.mdl");
|
||||
precache_model ("progs/v_rock.mdl");
|
||||
precache_model ("progs/v_shot2.mdl");
|
||||
precache_model ("progs/v_nail2.mdl");
|
||||
precache_model ("progs/v_rock2.mdl");
|
||||
|
||||
precache_model ("progs/bolt.mdl"); // for lightning gun
|
||||
precache_model ("progs/bolt2.mdl"); // for lightning gun
|
||||
precache_model ("progs/bolt3.mdl"); // for boss shock
|
||||
precache_model ("progs/lavaball.mdl"); // for testing
|
||||
|
||||
precache_model ("progs/missile.mdl");
|
||||
precache_model ("progs/grenade.mdl");
|
||||
precache_model ("progs/spike.mdl");
|
||||
precache_model ("progs/s_spike.mdl");
|
||||
|
||||
precache_model ("progs/backpack.mdl");
|
||||
|
||||
precache_model ("progs/zom_gib.mdl");
|
||||
|
||||
precache_model ("progs/v_light.mdl");
|
||||
|
||||
|
||||
//
|
||||
// Setup light animation tables. 'a' is total darkness, 'z' is maxbright.
|
||||
//
|
||||
|
||||
// 0 normal
|
||||
lightstyle(0, "m");
|
||||
|
||||
// 1 FLICKER (first variety)
|
||||
lightstyle(1, "mmnmmommommnonmmonqnmmo");
|
||||
|
||||
// 2 SLOW STRONG PULSE
|
||||
lightstyle(2, "abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba");
|
||||
|
||||
// 3 CANDLE (first variety)
|
||||
lightstyle(3, "mmmmmaaaaammmmmaaaaaabcdefgabcdefg");
|
||||
|
||||
// 4 FAST STROBE
|
||||
lightstyle(4, "mamamamamama");
|
||||
|
||||
// 5 GENTLE PULSE 1
|
||||
lightstyle(5,"jklmnopqrstuvwxyzyxwvutsrqponmlkj");
|
||||
|
||||
// 6 FLICKER (second variety)
|
||||
lightstyle(6, "nmonqnmomnmomomno");
|
||||
|
||||
// 7 CANDLE (second variety)
|
||||
lightstyle(7, "mmmaaaabcdefgmmmmaaaammmaamm");
|
||||
|
||||
// 8 CANDLE (third variety)
|
||||
lightstyle(8, "mmmaaammmaaammmabcdefaaaammmmabcdefmmmaaaa");
|
||||
|
||||
// 9 SLOW STROBE (fourth variety)
|
||||
lightstyle(9, "aaaaaaaazzzzzzzz");
|
||||
|
||||
// 10 FLUORESCENT FLICKER
|
||||
lightstyle(10, "mmamammmmammamamaaamammma");
|
||||
|
||||
// 11 SLOW PULSE NOT FADE TO BLACK
|
||||
lightstyle(11, "abcdefghijklmnopqrrqponmlkjihgfedcba");
|
||||
|
||||
// styles 32-62 are assigned by the light program for switchable lights
|
||||
|
||||
// 63 testing
|
||||
lightstyle(63, "a");
|
||||
|
||||
coop = cvar("coop");
|
||||
skill = cvar("skill");
|
||||
};
|
||||
|
||||
void() StartFrame =
|
||||
{
|
||||
timelimit = cvar("timelimit") * 60;
|
||||
fraglimit = cvar("fraglimit");
|
||||
teamplay = cvar("teamplay");
|
||||
deathmatch = cvar("deathmatch");
|
||||
|
||||
framecount = framecount + 1;
|
||||
};
|
||||
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
BODY QUE
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
entity bodyque_head;
|
||||
|
||||
void() bodyque =
|
||||
{ // just here so spawn functions don't complain after the world
|
||||
// creates bodyques
|
||||
};
|
||||
|
||||
void() InitBodyQue =
|
||||
{
|
||||
bodyque_head = spawn();
|
||||
bodyque_head.classname = "bodyque";
|
||||
bodyque_head.owner = spawn();
|
||||
bodyque_head.owner.classname = "bodyque";
|
||||
bodyque_head.owner.owner = spawn();
|
||||
bodyque_head.owner.owner.classname = "bodyque";
|
||||
bodyque_head.owner.owner.owner = spawn();
|
||||
bodyque_head.owner.owner.owner.classname = "bodyque";
|
||||
bodyque_head.owner.owner.owner.owner = bodyque_head;
|
||||
};
|
||||
|
||||
|
||||
// make a body que entry for the given ent so the ent can be
|
||||
// respawned elsewhere
|
||||
void(entity ent) CopyToBodyQue =
|
||||
{
|
||||
bodyque_head.angles = ent.angles;
|
||||
bodyque_head.model = ent.model;
|
||||
bodyque_head.modelindex = ent.modelindex;
|
||||
bodyque_head.frame = ent.frame;
|
||||
bodyque_head.colormap = ent.colormap;
|
||||
bodyque_head.movetype = ent.movetype;
|
||||
bodyque_head.velocity = ent.velocity;
|
||||
bodyque_head.flags = 0;
|
||||
setorigin (bodyque_head, ent.origin);
|
||||
setsize (bodyque_head, ent.mins, ent.maxs);
|
||||
bodyque_head = bodyque_head.owner;
|
||||
};
|
||||
|
||||
|
||||
|
||||
void() InitBodyQue;
|
||||
|
||||
|
||||
void() main =
|
||||
{
|
||||
dprint ("main function\n");
|
||||
|
||||
// these are just commands the the prog compiler to copy these files
|
||||
|
||||
precache_file ("progs.dat");
|
||||
precache_file ("gfx.wad");
|
||||
precache_file ("quake.rc");
|
||||
precache_file ("default.cfg");
|
||||
|
||||
precache_file ("end1.bin");
|
||||
precache_file2 ("end2.bin");
|
||||
|
||||
precache_file ("demo1.dem");
|
||||
precache_file ("demo2.dem");
|
||||
precache_file ("demo3.dem");
|
||||
|
||||
//
|
||||
// these are all of the lumps from the cached.ls files
|
||||
//
|
||||
precache_file ("gfx/palette.lmp");
|
||||
precache_file ("gfx/colormap.lmp");
|
||||
|
||||
precache_file2 ("gfx/pop.lmp");
|
||||
|
||||
precache_file ("gfx/complete.lmp");
|
||||
precache_file ("gfx/inter.lmp");
|
||||
|
||||
precache_file ("gfx/ranking.lmp");
|
||||
precache_file ("gfx/vidmodes.lmp");
|
||||
precache_file ("gfx/finale.lmp");
|
||||
precache_file ("gfx/conback.lmp");
|
||||
precache_file ("gfx/qplaque.lmp");
|
||||
|
||||
precache_file ("gfx/menudot1.lmp");
|
||||
precache_file ("gfx/menudot2.lmp");
|
||||
precache_file ("gfx/menudot3.lmp");
|
||||
precache_file ("gfx/menudot4.lmp");
|
||||
precache_file ("gfx/menudot5.lmp");
|
||||
precache_file ("gfx/menudot6.lmp");
|
||||
|
||||
precache_file ("gfx/menuplyr.lmp");
|
||||
precache_file ("gfx/bigbox.lmp");
|
||||
precache_file ("gfx/dim_modm.lmp");
|
||||
precache_file ("gfx/dim_drct.lmp");
|
||||
precache_file ("gfx/dim_ipx.lmp");
|
||||
precache_file ("gfx/dim_tcp.lmp");
|
||||
precache_file ("gfx/dim_mult.lmp");
|
||||
precache_file ("gfx/mainmenu.lmp");
|
||||
|
||||
precache_file ("gfx/box_tl.lmp");
|
||||
precache_file ("gfx/box_tm.lmp");
|
||||
precache_file ("gfx/box_tr.lmp");
|
||||
|
||||
precache_file ("gfx/box_ml.lmp");
|
||||
precache_file ("gfx/box_mm.lmp");
|
||||
precache_file ("gfx/box_mm2.lmp");
|
||||
precache_file ("gfx/box_mr.lmp");
|
||||
|
||||
precache_file ("gfx/box_bl.lmp");
|
||||
precache_file ("gfx/box_bm.lmp");
|
||||
precache_file ("gfx/box_br.lmp");
|
||||
|
||||
precache_file ("gfx/sp_menu.lmp");
|
||||
precache_file ("gfx/ttl_sgl.lmp");
|
||||
precache_file ("gfx/ttl_main.lmp");
|
||||
precache_file ("gfx/ttl_cstm.lmp");
|
||||
|
||||
precache_file ("gfx/mp_menu.lmp");
|
||||
|
||||
precache_file ("gfx/netmen1.lmp");
|
||||
precache_file ("gfx/netmen2.lmp");
|
||||
precache_file ("gfx/netmen3.lmp");
|
||||
precache_file ("gfx/netmen4.lmp");
|
||||
precache_file ("gfx/netmen5.lmp");
|
||||
|
||||
precache_file ("gfx/sell.lmp");
|
||||
|
||||
precache_file ("gfx/help0.lmp");
|
||||
precache_file ("gfx/help1.lmp");
|
||||
precache_file ("gfx/help2.lmp");
|
||||
precache_file ("gfx/help3.lmp");
|
||||
precache_file ("gfx/help4.lmp");
|
||||
precache_file ("gfx/help5.lmp");
|
||||
|
||||
precache_file ("gfx/pause.lmp");
|
||||
precache_file ("gfx/loading.lmp");
|
||||
|
||||
precache_file ("gfx/p_option.lmp");
|
||||
precache_file ("gfx/p_load.lmp");
|
||||
precache_file ("gfx/p_save.lmp");
|
||||
precache_file ("gfx/p_multi.lmp");
|
||||
|
||||
// sounds loaded by C code
|
||||
precache_sound ("misc/menu1.wav");
|
||||
precache_sound ("misc/menu2.wav");
|
||||
precache_sound ("misc/menu3.wav");
|
||||
|
||||
precache_sound ("ambience/water1.wav");
|
||||
precache_sound ("ambience/wind2.wav");
|
||||
|
||||
// shareware
|
||||
precache_file ("maps/start.bsp");
|
||||
|
||||
precache_file ("maps/e1m1.bsp");
|
||||
precache_file ("maps/e1m2.bsp");
|
||||
precache_file ("maps/e1m3.bsp");
|
||||
precache_file ("maps/e1m4.bsp");
|
||||
precache_file ("maps/e1m5.bsp");
|
||||
precache_file ("maps/e1m6.bsp");
|
||||
precache_file ("maps/e1m7.bsp");
|
||||
precache_file ("maps/e1m8.bsp");
|
||||
|
||||
// registered
|
||||
precache_file2 ("gfx/pop.lmp");
|
||||
|
||||
precache_file2 ("maps/e2m1.bsp");
|
||||
precache_file2 ("maps/e2m2.bsp");
|
||||
precache_file2 ("maps/e2m3.bsp");
|
||||
precache_file2 ("maps/e2m4.bsp");
|
||||
precache_file2 ("maps/e2m5.bsp");
|
||||
precache_file2 ("maps/e2m6.bsp");
|
||||
precache_file2 ("maps/e2m7.bsp");
|
||||
|
||||
precache_file2 ("maps/e3m1.bsp");
|
||||
precache_file2 ("maps/e3m2.bsp");
|
||||
precache_file2 ("maps/e3m3.bsp");
|
||||
precache_file2 ("maps/e3m4.bsp");
|
||||
precache_file2 ("maps/e3m5.bsp");
|
||||
precache_file2 ("maps/e3m6.bsp");
|
||||
precache_file2 ("maps/e3m7.bsp");
|
||||
|
||||
precache_file2 ("maps/e4m1.bsp");
|
||||
precache_file2 ("maps/e4m2.bsp");
|
||||
precache_file2 ("maps/e4m3.bsp");
|
||||
precache_file2 ("maps/e4m4.bsp");
|
||||
precache_file2 ("maps/e4m5.bsp");
|
||||
precache_file2 ("maps/e4m6.bsp");
|
||||
precache_file2 ("maps/e4m7.bsp");
|
||||
precache_file2 ("maps/e4m8.bsp");
|
||||
|
||||
precache_file2 ("maps/end.bsp");
|
||||
|
||||
precache_file2 ("maps/dm1.bsp");
|
||||
precache_file2 ("maps/dm2.bsp");
|
||||
precache_file2 ("maps/dm3.bsp");
|
||||
precache_file2 ("maps/dm4.bsp");
|
||||
precache_file2 ("maps/dm5.bsp");
|
||||
precache_file2 ("maps/dm6.bsp");
|
||||
};
|
||||
|
||||
|
||||
entity lastspawn;
|
||||
|
||||
//=======================
|
||||
/*QUAKED worldspawn (0 0 0) ?
|
||||
Only used for the world entity.
|
||||
Set message to the level name.
|
||||
Set sounds to the cd track to play.
|
||||
|
||||
World Types:
|
||||
0: medieval
|
||||
1: metal
|
||||
2: base
|
||||
*/
|
||||
//=======================
|
||||
void() worldspawn =
|
||||
{
|
||||
lastspawn = world;
|
||||
InitBodyQue ();
|
||||
|
||||
// custom map attributes
|
||||
|
||||
if (self.model == "maps/e1m8.bsp")
|
||||
cvar_set ("sv_gravity", "100");
|
||||
else
|
||||
cvar_set ("sv_gravity", "800");
|
||||
|
||||
|
||||
// the area based ambient sounds MUST be the first precache_sounds
|
||||
|
||||
// player precaches
|
||||
W_Precache (); // get weapon precaches
|
||||
|
||||
// sounds used from C physics code
|
||||
precache_sound ("demon/dland2.wav"); // landing thud
|
||||
precache_sound ("misc/h2ohit1.wav"); // landing splash
|
||||
|
||||
// setup precaches allways needed
|
||||
precache_sound ("items/itembk2.wav"); // item respawn sound
|
||||
precache_sound ("player/plyrjmp8.wav"); // player jump
|
||||
precache_sound ("player/land.wav"); // player landing
|
||||
precache_sound ("player/land2.wav"); // player hurt landing
|
||||
precache_sound ("player/drown1.wav"); // drowning pain
|
||||
precache_sound ("player/drown2.wav"); // drowning pain
|
||||
precache_sound ("player/gasp1.wav"); // gasping for air
|
||||
precache_sound ("player/gasp2.wav"); // taking breath
|
||||
precache_sound ("player/h2odeath.wav"); // drowning death
|
||||
|
||||
precache_sound ("misc/talk.wav"); // talk
|
||||
precache_sound ("player/teledth1.wav"); // telefrag
|
||||
precache_sound ("misc/r_tele1.wav"); // teleport sounds
|
||||
precache_sound ("misc/r_tele2.wav");
|
||||
precache_sound ("misc/r_tele3.wav");
|
||||
precache_sound ("misc/r_tele4.wav");
|
||||
precache_sound ("misc/r_tele5.wav");
|
||||
precache_sound ("weapons/lock4.wav"); // ammo pick up
|
||||
precache_sound ("weapons/pkup.wav"); // weapon up
|
||||
precache_sound ("items/armor1.wav"); // armor up
|
||||
precache_sound ("weapons/lhit.wav"); //lightning
|
||||
precache_sound ("weapons/lstart.wav"); //lightning start
|
||||
precache_sound ("items/damage3.wav");
|
||||
|
||||
precache_sound ("misc/power.wav"); //lightning for boss
|
||||
|
||||
// player gib sounds
|
||||
precache_sound ("player/gib.wav"); // player gib sound
|
||||
precache_sound ("player/udeath.wav"); // player gib sound
|
||||
precache_sound ("player/tornoff2.wav"); // gib sound
|
||||
|
||||
// player pain sounds
|
||||
|
||||
precache_sound ("player/pain1.wav");
|
||||
precache_sound ("player/pain2.wav");
|
||||
precache_sound ("player/pain3.wav");
|
||||
precache_sound ("player/pain4.wav");
|
||||
precache_sound ("player/pain5.wav");
|
||||
precache_sound ("player/pain6.wav");
|
||||
|
||||
// player death sounds
|
||||
precache_sound ("player/death1.wav");
|
||||
precache_sound ("player/death2.wav");
|
||||
precache_sound ("player/death3.wav");
|
||||
precache_sound ("player/death4.wav");
|
||||
precache_sound ("player/death5.wav");
|
||||
|
||||
precache_sound ("boss1/sight1.wav");
|
||||
|
||||
// ax sounds
|
||||
precache_sound ("weapons/ax1.wav"); // ax swoosh
|
||||
precache_sound ("player/axhit1.wav"); // ax hit meat
|
||||
precache_sound ("player/axhit2.wav"); // ax hit world
|
||||
|
||||
precache_sound ("player/h2ojump.wav"); // player jumping into water
|
||||
precache_sound ("player/slimbrn2.wav"); // player enter slime
|
||||
precache_sound ("player/inh2o.wav"); // player enter water
|
||||
precache_sound ("player/inlava.wav"); // player enter lava
|
||||
precache_sound ("misc/outwater.wav"); // leaving water sound
|
||||
|
||||
precache_sound ("player/lburn1.wav"); // lava burn
|
||||
precache_sound ("player/lburn2.wav"); // lava burn
|
||||
|
||||
precache_sound ("misc/water1.wav"); // swimming
|
||||
precache_sound ("misc/water2.wav"); // swimming
|
||||
|
||||
// Invulnerability sounds
|
||||
precache_sound ("items/protect.wav");
|
||||
precache_sound ("items/protect2.wav");
|
||||
precache_sound ("items/protect3.wav");
|
||||
|
||||
|
||||
precache_model ("progs/player.mdl");
|
||||
precache_model ("progs/eyes.mdl");
|
||||
precache_model ("progs/h_player.mdl");
|
||||
precache_model ("progs/gib1.mdl");
|
||||
precache_model ("progs/gib2.mdl");
|
||||
precache_model ("progs/gib3.mdl");
|
||||
|
||||
precache_model ("progs/s_bubble.spr"); // drowning bubbles
|
||||
precache_model ("progs/s_explod.spr"); // sprite explosion
|
||||
|
||||
precache_model ("progs/v_axe.mdl");
|
||||
precache_model ("progs/v_shot.mdl");
|
||||
precache_model ("progs/v_nail.mdl");
|
||||
precache_model ("progs/v_rock.mdl");
|
||||
precache_model ("progs/v_shot2.mdl");
|
||||
precache_model ("progs/v_nail2.mdl");
|
||||
precache_model ("progs/v_rock2.mdl");
|
||||
|
||||
precache_model ("progs/bolt.mdl"); // for lightning gun
|
||||
precache_model ("progs/bolt2.mdl"); // for lightning gun
|
||||
precache_model ("progs/bolt3.mdl"); // for boss shock
|
||||
precache_model ("progs/lavaball.mdl"); // for testing
|
||||
|
||||
precache_model ("progs/missile.mdl");
|
||||
precache_model ("progs/grenade.mdl");
|
||||
precache_model ("progs/spike.mdl");
|
||||
precache_model ("progs/s_spike.mdl");
|
||||
|
||||
precache_model ("progs/backpack.mdl");
|
||||
|
||||
precache_model ("progs/zom_gib.mdl");
|
||||
|
||||
precache_model ("progs/v_light.mdl");
|
||||
|
||||
|
||||
//
|
||||
// Setup light animation tables. 'a' is total darkness, 'z' is maxbright.
|
||||
//
|
||||
|
||||
// 0 normal
|
||||
lightstyle(0, "m");
|
||||
|
||||
// 1 FLICKER (first variety)
|
||||
lightstyle(1, "mmnmmommommnonmmonqnmmo");
|
||||
|
||||
// 2 SLOW STRONG PULSE
|
||||
lightstyle(2, "abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba");
|
||||
|
||||
// 3 CANDLE (first variety)
|
||||
lightstyle(3, "mmmmmaaaaammmmmaaaaaabcdefgabcdefg");
|
||||
|
||||
// 4 FAST STROBE
|
||||
lightstyle(4, "mamamamamama");
|
||||
|
||||
// 5 GENTLE PULSE 1
|
||||
lightstyle(5,"jklmnopqrstuvwxyzyxwvutsrqponmlkj");
|
||||
|
||||
// 6 FLICKER (second variety)
|
||||
lightstyle(6, "nmonqnmomnmomomno");
|
||||
|
||||
// 7 CANDLE (second variety)
|
||||
lightstyle(7, "mmmaaaabcdefgmmmmaaaammmaamm");
|
||||
|
||||
// 8 CANDLE (third variety)
|
||||
lightstyle(8, "mmmaaammmaaammmabcdefaaaammmmabcdefmmmaaaa");
|
||||
|
||||
// 9 SLOW STROBE (fourth variety)
|
||||
lightstyle(9, "aaaaaaaazzzzzzzz");
|
||||
|
||||
// 10 FLUORESCENT FLICKER
|
||||
lightstyle(10, "mmamammmmammamamaaamammma");
|
||||
|
||||
// 11 SLOW PULSE NOT FADE TO BLACK
|
||||
lightstyle(11, "abcdefghijklmnopqrrqponmlkjihgfedcba");
|
||||
|
||||
// styles 32-62 are assigned by the light program for switchable lights
|
||||
|
||||
// 63 testing
|
||||
lightstyle(63, "a");
|
||||
|
||||
coop = cvar("coop");
|
||||
skill = cvar("skill");
|
||||
};
|
||||
|
||||
void() StartFrame =
|
||||
{
|
||||
timelimit = cvar("timelimit") * 60;
|
||||
fraglimit = cvar("fraglimit");
|
||||
teamplay = cvar("teamplay");
|
||||
deathmatch = cvar("deathmatch");
|
||||
|
||||
framecount = framecount + 1;
|
||||
};
|
||||
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
BODY QUE
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
entity bodyque_head;
|
||||
|
||||
void() bodyque =
|
||||
{ // just here so spawn functions don't complain after the world
|
||||
// creates bodyques
|
||||
};
|
||||
|
||||
void() InitBodyQue =
|
||||
{
|
||||
bodyque_head = spawn();
|
||||
bodyque_head.classname = "bodyque";
|
||||
bodyque_head.owner = spawn();
|
||||
bodyque_head.owner.classname = "bodyque";
|
||||
bodyque_head.owner.owner = spawn();
|
||||
bodyque_head.owner.owner.classname = "bodyque";
|
||||
bodyque_head.owner.owner.owner = spawn();
|
||||
bodyque_head.owner.owner.owner.classname = "bodyque";
|
||||
bodyque_head.owner.owner.owner.owner = bodyque_head;
|
||||
};
|
||||
|
||||
|
||||
// make a body que entry for the given ent so the ent can be
|
||||
// respawned elsewhere
|
||||
void(entity ent) CopyToBodyQue =
|
||||
{
|
||||
bodyque_head.angles = ent.angles;
|
||||
bodyque_head.model = ent.model;
|
||||
bodyque_head.modelindex = ent.modelindex;
|
||||
bodyque_head.frame = ent.frame;
|
||||
bodyque_head.colormap = ent.colormap;
|
||||
bodyque_head.movetype = ent.movetype;
|
||||
bodyque_head.velocity = ent.velocity;
|
||||
bodyque_head.flags = 0;
|
||||
setorigin (bodyque_head, ent.origin);
|
||||
setsize (bodyque_head, ent.mins, ent.maxs);
|
||||
bodyque_head = bodyque_head.owner;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue