mirror of
https://git.code.sf.net/p/quake/game-source
synced 2025-04-13 03:01:14 +00:00
s/self/@self/g in the eventual hope of using Objective-QC features :)
This commit is contained in:
parent
21379455db
commit
dbaac505b3
24 changed files with 2775 additions and 2776 deletions
|
@ -9,26 +9,26 @@ void() button_return;
|
|||
|
||||
void() button_wait =
|
||||
{
|
||||
self.state = STATE_TOP;
|
||||
self.nextthink = self.ltime + self.wait;
|
||||
self.think = button_return;
|
||||
activator = self.enemy;
|
||||
@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
|
||||
@self.frame = 1; // use alternate textures
|
||||
};
|
||||
|
||||
void() button_done =
|
||||
{
|
||||
self.state = STATE_BOTTOM;
|
||||
@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
|
||||
@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
|
||||
};
|
||||
|
||||
|
||||
|
@ -39,19 +39,19 @@ void() button_blocked = // do nothing, just don't come all the way back out
|
|||
|
||||
void() button_fire =
|
||||
{
|
||||
if (self.state == STATE_UP || self.state == STATE_TOP)
|
||||
if (@self.state == STATE_UP || @self.state == STATE_TOP)
|
||||
return;
|
||||
|
||||
sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
|
||||
sound (@self, CHAN_VOICE, @self.noise, 1, ATTN_NORM);
|
||||
|
||||
self.state = STATE_UP;
|
||||
SUB_CalcMove (self.pos2, self.speed, button_wait);
|
||||
@self.state = STATE_UP;
|
||||
SUB_CalcMove (@self.pos2, @self.speed, button_wait);
|
||||
};
|
||||
|
||||
|
||||
void() button_use =
|
||||
{
|
||||
self.enemy = activator;
|
||||
@self.enemy = activator;
|
||||
button_fire ();
|
||||
};
|
||||
|
||||
|
@ -59,15 +59,15 @@ void() button_touch =
|
|||
{
|
||||
if (other.classname != "player")
|
||||
return;
|
||||
self.enemy = other;
|
||||
@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
|
||||
@self.enemy = damage_attacker;
|
||||
@self.health = @self.max_health;
|
||||
@self.takedamage = DAMAGE_NO; // wil be reset upon return
|
||||
button_fire ();
|
||||
};
|
||||
|
||||
|
@ -89,51 +89,51 @@ When a button is touched, it moves some distance in the direction of it's angle,
|
|||
*/
|
||||
void() func_button =
|
||||
{
|
||||
if (self.sounds == 0) {
|
||||
if (@self.sounds == 0) {
|
||||
precache_sound ("buttons/airbut1.wav");
|
||||
self.noise = "buttons/airbut1.wav";
|
||||
@self.noise = "buttons/airbut1.wav";
|
||||
}
|
||||
if (self.sounds == 1) {
|
||||
if (@self.sounds == 1) {
|
||||
precache_sound ("buttons/switch21.wav");
|
||||
self.noise = "buttons/switch21.wav";
|
||||
@self.noise = "buttons/switch21.wav";
|
||||
}
|
||||
if (self.sounds == 2) {
|
||||
if (@self.sounds == 2) {
|
||||
precache_sound ("buttons/switch02.wav");
|
||||
self.noise = "buttons/switch02.wav";
|
||||
@self.noise = "buttons/switch02.wav";
|
||||
}
|
||||
if (self.sounds == 3) {
|
||||
if (@self.sounds == 3) {
|
||||
precache_sound ("buttons/switch04.wav");
|
||||
self.noise = "buttons/switch04.wav";
|
||||
@self.noise = "buttons/switch04.wav";
|
||||
}
|
||||
|
||||
SetMovedir ();
|
||||
|
||||
self.movetype = MOVETYPE_PUSH;
|
||||
self.solid = SOLID_BSP;
|
||||
setmodel (self, self.model);
|
||||
@self.movetype = MOVETYPE_PUSH;
|
||||
@self.solid = SOLID_BSP;
|
||||
setmodel (@self, @self.model);
|
||||
|
||||
self.blocked = button_blocked;
|
||||
self.use = button_use;
|
||||
@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;
|
||||
if (@self.health) {
|
||||
@self.max_health = @self.health;
|
||||
@self.th_die = button_killed;
|
||||
@self.takedamage = DAMAGE_YES;
|
||||
|
||||
self.nobleed = TRUE; // + POX
|
||||
@self.nobleed = TRUE; // + POX
|
||||
} else
|
||||
self.touch = button_touch;
|
||||
@self.touch = button_touch;
|
||||
|
||||
if (!self.speed)
|
||||
self.speed = 40;
|
||||
if (!self.wait)
|
||||
self.wait = 1;
|
||||
if (!self.lip)
|
||||
self.lip = 4;
|
||||
if (!@self.speed)
|
||||
@self.speed = 40;
|
||||
if (!@self.wait)
|
||||
@self.wait = 1;
|
||||
if (!@self.lip)
|
||||
@self.lip = 4;
|
||||
|
||||
self.state = STATE_BOTTOM;
|
||||
@self.state = STATE_BOTTOM;
|
||||
|
||||
self.pos1 = self.origin;
|
||||
self.pos2 = self.pos1 + self.movedir*(fabs(self.movedir*self.size) - self.lip);
|
||||
@self.pos1 = @self.origin;
|
||||
@self.pos2 = @self.pos1 + @self.movedir*(fabs(@self.movedir*@self.size) - @self.lip);
|
||||
};
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -23,7 +23,7 @@ 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);
|
||||
traceline (inflictor.origin, 0.5 * (targ.absmin + targ.absmax), TRUE, @self);
|
||||
|
||||
if (trace_fraction == 1)
|
||||
return TRUE;
|
||||
|
@ -34,24 +34,24 @@ float (entity targ, entity inflictor) CanDamage =
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
traceline (inflictor.origin, targ.origin, TRUE, self);
|
||||
traceline (inflictor.origin, targ.origin, TRUE, @self);
|
||||
|
||||
if (trace_fraction == 1)
|
||||
return TRUE;
|
||||
|
||||
traceline (inflictor.origin, targ.origin + '15 15 0', TRUE, self);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
traceline (inflictor.origin, targ.origin + '15 -15 0', TRUE, @self);
|
||||
if (trace_fraction == 1)
|
||||
return TRUE;
|
||||
|
||||
|
@ -65,38 +65,38 @@ Killed
|
|||
*/
|
||||
void (entity targ, entity attacker) Killed =
|
||||
{
|
||||
local entity oself = self;
|
||||
local entity oself = @self;
|
||||
|
||||
self = targ;
|
||||
@self = targ;
|
||||
|
||||
if (self.health < -99)
|
||||
self.health = -99; // don't let sbar get funky
|
||||
if (@self.health < -99)
|
||||
@self.health = -99; // don't let sbar get funky
|
||||
|
||||
if (self.movetype == MOVETYPE_PUSH || self.movetype == MOVETYPE_NONE) { // doors, triggers, etc
|
||||
self.th_die ();
|
||||
self = oself;
|
||||
if (@self.movetype == MOVETYPE_PUSH || @self.movetype == MOVETYPE_NONE) { // doors, triggers, etc
|
||||
@self.th_die ();
|
||||
@self = oself;
|
||||
return;
|
||||
}
|
||||
|
||||
self.enemy = attacker;
|
||||
@self.enemy = attacker;
|
||||
|
||||
// bump the monster counter
|
||||
if (self.flags & FL_MONSTER) {
|
||||
if (@self.flags & FL_MONSTER) {
|
||||
killed_monsters++;
|
||||
WriteByte (MSG_ALL, SVC_KILLEDMONSTER);
|
||||
}
|
||||
ClientObituary (self, attacker);
|
||||
ClientObituary (@self, attacker);
|
||||
|
||||
self.takedamage = DAMAGE_NO;
|
||||
self.touch = NIL;
|
||||
self.effects = 0;
|
||||
@self.takedamage = DAMAGE_NO;
|
||||
@self.touch = NIL;
|
||||
@self.effects = 0;
|
||||
|
||||
/*SERVER
|
||||
monster_death_use();
|
||||
*/
|
||||
self.th_die ();
|
||||
@self.th_die ();
|
||||
|
||||
self = oself;
|
||||
@self = oself;
|
||||
};
|
||||
|
||||
|
||||
|
@ -131,9 +131,9 @@ void (entity targ, entity inflictor, entity attacker, float damage) T_Damage =
|
|||
if (targ.flags & FL_GODMODE)
|
||||
return;
|
||||
|
||||
if (targ.invincible_finished >= time && self.invincible_sound < time) {
|
||||
if (targ.invincible_finished >= time && @self.invincible_sound < time) {
|
||||
sound (targ, CHAN_ITEM, "items/protect3.wav", 1, ATTN_NORM);
|
||||
self.invincible_sound = time + 2;
|
||||
@self.invincible_sound = time + 2;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -179,7 +179,7 @@ void (entity targ, entity inflictor, entity attacker, float damage) T_Damage =
|
|||
dir = targ.origin - (inflictor.absmin + inflictor.absmax) * 0.5;
|
||||
dir = normalize (dir);
|
||||
|
||||
if ((damage < 60) // player-player damage (not self-inflicted)
|
||||
if ((damage < 60) // player-player damage (not @self-inflicted)
|
||||
&& (attacker.classname == "player")
|
||||
&& (targ.classname == "player")
|
||||
&& (attacker != targ))
|
||||
|
@ -193,7 +193,7 @@ void (entity targ, entity inflictor, entity attacker, float damage) T_Damage =
|
|||
}
|
||||
|
||||
// team play damage avoidance
|
||||
//ZOID 12-13-96: self.team doesn't work in QW. Use keys
|
||||
//ZOID 12-13-96: @self.team doesn't work in QW. Use keys
|
||||
attackerteam = infokey (attacker, "team");
|
||||
targteam = infokey (targ, "team");
|
||||
|
||||
|
@ -211,28 +211,28 @@ void (entity targ, entity inflictor, entity attacker, float damage) T_Damage =
|
|||
}
|
||||
|
||||
// react to the damage
|
||||
oldself = self;
|
||||
self = targ;
|
||||
oldself = @self;
|
||||
@self = targ;
|
||||
|
||||
#if 0
|
||||
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;
|
||||
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;
|
||||
@self.enemy = attacker;
|
||||
FoundTarget ();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (self.th_pain)
|
||||
self.th_pain ();
|
||||
if (@self.th_pain)
|
||||
@self.th_pain ();
|
||||
|
||||
self = oldself;
|
||||
@self = oldself;
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
//
|
||||
// system globals
|
||||
//
|
||||
entity self;
|
||||
entity other;
|
||||
entity world;
|
||||
float time;
|
||||
|
@ -80,7 +79,7 @@ void() SetNewParms; // called when a client first connects to
|
|||
// a server. sets parms so they can be
|
||||
// saved off for restarts
|
||||
|
||||
void() SetChangeParms; // call to set parms for self so they can
|
||||
void() SetChangeParms; // call to set parms for @self so they can
|
||||
// be saved for a level transition
|
||||
|
||||
|
||||
|
@ -538,15 +537,15 @@ float(float yaw, float dist) walkmove = #32; // returns TRUE or FALSE
|
|||
float() droptofloor= #34; // TRUE if landed on floor
|
||||
void(float style, string value) lightstyle = #35;
|
||||
// #39 was removed
|
||||
float(entity e) checkbottom = #40; // true if self is on ground
|
||||
float(entity e) checkbottom = #40; // true if @self is on ground
|
||||
float(vector v) pointcontents = #41; // returns a CONTENT_*
|
||||
// #42 was removed
|
||||
vector(entity e, float speed) aim = #44; // returns the shooting vector
|
||||
void(string s) localcmd = #46; // put string into local que
|
||||
entity(entity e) nextent = #47; // for looping through all ents
|
||||
// #48 was removed
|
||||
void() ChangeYaw = #49; // turn towards self.ideal_yaw
|
||||
// at self.yaw_speed
|
||||
void() ChangeYaw = #49; // turn towards @self.ideal_yaw
|
||||
// at @self.yaw_speed
|
||||
// #50 was removed
|
||||
|
||||
//
|
||||
|
|
|
@ -26,12 +26,12 @@ void() door_go_up;
|
|||
void() door_blocked =
|
||||
{
|
||||
other.deathtype = "squish";
|
||||
T_Damage (other, self, self.goalentity, self.dmg);
|
||||
T_Damage (other, @self, @self.goalentity, @self.dmg);
|
||||
// if a door has a negative wait, it would never come back if blocked,
|
||||
// so let it just squash the object to death real fast
|
||||
if (self.wait >= 0)
|
||||
if (@self.wait >= 0)
|
||||
{
|
||||
if (self.state == STATE_DOWN)
|
||||
if (@self.state == STATE_DOWN)
|
||||
door_go_up ();
|
||||
else
|
||||
door_go_down ();
|
||||
|
@ -39,43 +39,43 @@ void() door_blocked =
|
|||
};
|
||||
void() door_hit_top =
|
||||
{
|
||||
sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self.noise1, 1, ATTN_NORM);
|
||||
self.state = STATE_TOP;
|
||||
if (self.spawnflags & DOOR_TOGGLE)
|
||||
sound (@self, CHAN_NO_PHS_ADD+CHAN_VOICE, @self.noise1, 1, ATTN_NORM);
|
||||
@self.state = STATE_TOP;
|
||||
if (@self.spawnflags & DOOR_TOGGLE)
|
||||
return; // don't come down automatically
|
||||
self.think = door_go_down;
|
||||
self.nextthink = self.ltime + self.wait;
|
||||
@self.think = door_go_down;
|
||||
@self.nextthink = @self.ltime + @self.wait;
|
||||
};
|
||||
void() door_hit_bottom =
|
||||
{
|
||||
sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self.noise1, 1, ATTN_NORM);
|
||||
self.state = STATE_BOTTOM;
|
||||
sound (@self, CHAN_NO_PHS_ADD+CHAN_VOICE, @self.noise1, 1, ATTN_NORM);
|
||||
@self.state = STATE_BOTTOM;
|
||||
};
|
||||
void() door_go_down =
|
||||
{
|
||||
sound (self, CHAN_VOICE, self.noise2, 1, ATTN_NORM);
|
||||
if (self.max_health)
|
||||
sound (@self, CHAN_VOICE, @self.noise2, 1, ATTN_NORM);
|
||||
if (@self.max_health)
|
||||
{
|
||||
self.takedamage = DAMAGE_YES;
|
||||
self.health = self.max_health;
|
||||
@self.takedamage = DAMAGE_YES;
|
||||
@self.health = @self.max_health;
|
||||
}
|
||||
|
||||
self.state = STATE_DOWN;
|
||||
SUB_CalcMove (self.pos1, self.speed, door_hit_bottom);
|
||||
@self.state = STATE_DOWN;
|
||||
SUB_CalcMove (@self.pos1, @self.speed, door_hit_bottom);
|
||||
};
|
||||
void() door_go_up =
|
||||
{
|
||||
if (self.state == STATE_UP)
|
||||
if (@self.state == STATE_UP)
|
||||
return; // allready going up
|
||||
if (self.state == STATE_TOP)
|
||||
if (@self.state == STATE_TOP)
|
||||
{ // reset top wait time
|
||||
self.nextthink = self.ltime + self.wait;
|
||||
@self.nextthink = @self.ltime + @self.wait;
|
||||
return;
|
||||
}
|
||||
|
||||
sound (self, CHAN_VOICE, self.noise2, 1, ATTN_NORM);
|
||||
self.state = STATE_UP;
|
||||
SUB_CalcMove (self.pos2, self.speed, door_hit_top);
|
||||
sound (@self, CHAN_VOICE, @self.noise2, 1, ATTN_NORM);
|
||||
@self.state = STATE_UP;
|
||||
SUB_CalcMove (@self.pos2, @self.speed, door_hit_top);
|
||||
SUB_UseTargets();
|
||||
};
|
||||
/*
|
||||
|
@ -87,71 +87,71 @@ void() door_fire =
|
|||
{
|
||||
local entity oself;
|
||||
local entity starte;
|
||||
if (self.owner != self)
|
||||
objerror ("door_fire: self.owner != self");
|
||||
if (@self.owner != @self)
|
||||
objerror ("door_fire: @self.owner != @self");
|
||||
// play use key sound
|
||||
if (self.items)
|
||||
sound (self, CHAN_VOICE, self.noise4, 1, ATTN_NORM);
|
||||
self.message = string_null; // no more message
|
||||
oself = self;
|
||||
if (self.spawnflags & DOOR_TOGGLE)
|
||||
if (@self.items)
|
||||
sound (@self, CHAN_VOICE, @self.noise4, 1, ATTN_NORM);
|
||||
@self.message = string_null; // no more message
|
||||
oself = @self;
|
||||
if (@self.spawnflags & DOOR_TOGGLE)
|
||||
{
|
||||
if (self.state == STATE_UP || self.state == STATE_TOP)
|
||||
if (@self.state == STATE_UP || @self.state == STATE_TOP)
|
||||
{
|
||||
starte = self;
|
||||
starte = @self;
|
||||
do
|
||||
{
|
||||
door_go_down ();
|
||||
self = self.enemy;
|
||||
} while ( (self != starte) && (self != world) );
|
||||
self = oself;
|
||||
@self = @self.enemy;
|
||||
} while ( (@self != starte) && (@self != world) );
|
||||
@self = oself;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// trigger all paired doors
|
||||
starte = self;
|
||||
starte = @self;
|
||||
|
||||
do
|
||||
{
|
||||
self.goalentity = activator; // Who fired us
|
||||
@self.goalentity = activator; // Who fired us
|
||||
door_go_up ();
|
||||
self = self.enemy;
|
||||
} while ( (self != starte) && (self != world) );
|
||||
self = oself;
|
||||
@self = @self.enemy;
|
||||
} while ( (@self != starte) && (@self != world) );
|
||||
@self = oself;
|
||||
};
|
||||
void() door_use =
|
||||
{
|
||||
local entity oself;
|
||||
self.message = ""; // door message are for touch only
|
||||
self.owner.message = "";
|
||||
self.enemy.message = "";
|
||||
oself = self;
|
||||
self = self.owner;
|
||||
@self.message = ""; // door message are for touch only
|
||||
@self.owner.message = "";
|
||||
@self.enemy.message = "";
|
||||
oself = @self;
|
||||
@self = @self.owner;
|
||||
door_fire ();
|
||||
self = oself;
|
||||
@self = oself;
|
||||
};
|
||||
void() door_trigger_touch =
|
||||
{
|
||||
if (other.health <= 0)
|
||||
return;
|
||||
if (time < self.attack_finished)
|
||||
if (time < @self.attack_finished)
|
||||
return;
|
||||
self.attack_finished = time + 1;
|
||||
@self.attack_finished = time + 1;
|
||||
activator = other;
|
||||
self = self.owner;
|
||||
@self = @self.owner;
|
||||
door_use ();
|
||||
};
|
||||
void() door_killed =
|
||||
{
|
||||
local entity oself;
|
||||
|
||||
oself = self;
|
||||
self = self.owner;
|
||||
self.health = self.max_health;
|
||||
self.takedamage = DAMAGE_NO; // wil be reset upon return
|
||||
oself = @self;
|
||||
@self = @self.owner;
|
||||
@self.health = @self.max_health;
|
||||
@self.takedamage = DAMAGE_NO; // wil be reset upon return
|
||||
door_use ();
|
||||
self = oself;
|
||||
@self = oself;
|
||||
};
|
||||
/*
|
||||
================
|
||||
|
@ -163,40 +163,40 @@ void() door_touch =
|
|||
{
|
||||
if (other.classname != "player")
|
||||
return;
|
||||
if (self.owner.attack_finished > time)
|
||||
if (@self.owner.attack_finished > time)
|
||||
return;
|
||||
self.owner.attack_finished = time + 2;
|
||||
if (self.owner.message != "")
|
||||
@self.owner.attack_finished = time + 2;
|
||||
if (@self.owner.message != "")
|
||||
{
|
||||
self.target_id_finished = time + 4;//POX don't let TargetID override centerprints
|
||||
centerprint (other, self.owner.message);
|
||||
@self.target_id_finished = time + 4;//POX don't let TargetID override centerprints
|
||||
centerprint (other, @self.owner.message);
|
||||
sound (other, CHAN_VOICE, "misc/talk.wav", 1, ATTN_NORM);
|
||||
}
|
||||
|
||||
// key door stuff
|
||||
if (!self.items)
|
||||
if (!@self.items)
|
||||
return;
|
||||
// FIXME: blink key on player's status bar
|
||||
if ( (self.items & other.items) != self.items )
|
||||
if ( (@self.items & other.items) != @self.items )
|
||||
{
|
||||
self.target_id_finished = time + 4;//POX don't let TargetID override centerprints
|
||||
@self.target_id_finished = time + 4;//POX don't let TargetID override centerprints
|
||||
|
||||
if (self.owner.items == IT_KEY1)
|
||||
if (@self.owner.items == IT_KEY1)
|
||||
{
|
||||
if (world.worldtype == 2)
|
||||
{
|
||||
centerprint (other, "You need the silver keycard");
|
||||
sound (self, CHAN_VOICE, self.noise3, 1, ATTN_NORM);
|
||||
sound (@self, CHAN_VOICE, @self.noise3, 1, ATTN_NORM);
|
||||
}
|
||||
else if (world.worldtype == 1)
|
||||
{
|
||||
centerprint (other, "You need the silver runekey");
|
||||
sound (self, CHAN_VOICE, self.noise3, 1, ATTN_NORM);
|
||||
sound (@self, CHAN_VOICE, @self.noise3, 1, ATTN_NORM);
|
||||
}
|
||||
else if (world.worldtype == 0)
|
||||
{
|
||||
centerprint (other, "You need the silver key");
|
||||
sound (self, CHAN_VOICE, self.noise3, 1, ATTN_NORM);
|
||||
sound (@self, CHAN_VOICE, @self.noise3, 1, ATTN_NORM);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -204,25 +204,25 @@ void() door_touch =
|
|||
if (world.worldtype == 2)
|
||||
{
|
||||
centerprint (other, "You need the gold keycard");
|
||||
sound (self, CHAN_VOICE, self.noise3, 1, ATTN_NORM);
|
||||
sound (@self, CHAN_VOICE, @self.noise3, 1, ATTN_NORM);
|
||||
}
|
||||
else if (world.worldtype == 1)
|
||||
{
|
||||
centerprint (other, "You need the gold runekey");
|
||||
sound (self, CHAN_VOICE, self.noise3, 1, ATTN_NORM);
|
||||
sound (@self, CHAN_VOICE, @self.noise3, 1, ATTN_NORM);
|
||||
}
|
||||
else if (world.worldtype == 0)
|
||||
{
|
||||
centerprint (other, "You need the gold key");
|
||||
sound (self, CHAN_VOICE, self.noise3, 1, ATTN_NORM);
|
||||
sound (@self, CHAN_VOICE, @self.noise3, 1, ATTN_NORM);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
other.items = other.items - self.items;
|
||||
self.touch = SUB_Null;
|
||||
if (self.enemy)
|
||||
self.enemy.touch = SUB_Null; // get paired door
|
||||
other.items = other.items - @self.items;
|
||||
@self.touch = SUB_Null;
|
||||
if (@self.enemy)
|
||||
@self.enemy.touch = SUB_Null; // get paired door
|
||||
door_use ();
|
||||
};
|
||||
/*
|
||||
|
@ -237,7 +237,7 @@ entity(vector fmins, vector fmaxs) spawn_field =
|
|||
trigger = spawn();
|
||||
trigger.movetype = MOVETYPE_NONE;
|
||||
trigger.solid = SOLID_TRIGGER;
|
||||
trigger.owner = self;
|
||||
trigger.owner = @self;
|
||||
trigger.touch = door_trigger_touch;
|
||||
t1 = fmins;
|
||||
t2 = fmaxs;
|
||||
|
@ -269,52 +269,52 @@ void() LinkDoors =
|
|||
{
|
||||
local entity t, starte;
|
||||
local vector cmins, cmaxs;
|
||||
if (self.enemy)
|
||||
if (@self.enemy)
|
||||
return; // already linked by another door
|
||||
if (self.spawnflags & 4)
|
||||
if (@self.spawnflags & 4)
|
||||
{
|
||||
self.owner = self.enemy = self;
|
||||
@self.owner = @self.enemy = @self;
|
||||
return; // don't want to link this door
|
||||
}
|
||||
cmins = self.mins;
|
||||
cmaxs = self.maxs;
|
||||
cmins = @self.mins;
|
||||
cmaxs = @self.maxs;
|
||||
|
||||
starte = self;
|
||||
t = self;
|
||||
starte = @self;
|
||||
t = @self;
|
||||
|
||||
do
|
||||
{
|
||||
self.owner = starte; // master door
|
||||
if (self.health)
|
||||
starte.health = self.health;
|
||||
if (self.targetname)
|
||||
starte.targetname = self.targetname;
|
||||
if (self.message != "")
|
||||
starte.message = self.message;
|
||||
t = find (t, classname, self.classname);
|
||||
@self.owner = starte; // master door
|
||||
if (@self.health)
|
||||
starte.health = @self.health;
|
||||
if (@self.targetname)
|
||||
starte.targetname = @self.targetname;
|
||||
if (@self.message != "")
|
||||
starte.message = @self.message;
|
||||
t = find (t, classname, @self.classname);
|
||||
if (!t)
|
||||
{
|
||||
self.enemy = starte; // make the chain a loop
|
||||
@self.enemy = starte; // make the chain a loop
|
||||
// shootable, fired, or key doors just needed the owner/enemy links,
|
||||
// they don't spawn a field
|
||||
|
||||
self = self.owner;
|
||||
if (self.health)
|
||||
@self = @self.owner;
|
||||
if (@self.health)
|
||||
return;
|
||||
if (self.targetname)
|
||||
if (@self.targetname)
|
||||
return;
|
||||
if (self.items)
|
||||
if (@self.items)
|
||||
return;
|
||||
self.owner.trigger_field = spawn_field(cmins, cmaxs);
|
||||
@self.owner.trigger_field = spawn_field(cmins, cmaxs);
|
||||
return;
|
||||
}
|
||||
if (EntitiesTouching(self,t))
|
||||
if (EntitiesTouching(@self,t))
|
||||
{
|
||||
if (t.enemy)
|
||||
objerror ("cross connected doors");
|
||||
|
||||
self.enemy = t;
|
||||
self = t;
|
||||
@self.enemy = t;
|
||||
@self = t;
|
||||
if (t.mins_x < cmins_x)
|
||||
cmins_x = t.mins_x;
|
||||
if (t.mins_y < cmins_y)
|
||||
|
@ -356,110 +356,110 @@ void() func_door =
|
|||
{
|
||||
precache_sound ("doors/medtry.wav");
|
||||
precache_sound ("doors/meduse.wav");
|
||||
self.noise3 = "doors/medtry.wav";
|
||||
self.noise4 = "doors/meduse.wav";
|
||||
@self.noise3 = "doors/medtry.wav";
|
||||
@self.noise4 = "doors/meduse.wav";
|
||||
}
|
||||
else if (world.worldtype == 1)
|
||||
{
|
||||
precache_sound ("doors/runetry.wav");
|
||||
precache_sound ("doors/runeuse.wav");
|
||||
self.noise3 = "doors/runetry.wav";
|
||||
self.noise4 = "doors/runeuse.wav";
|
||||
@self.noise3 = "doors/runetry.wav";
|
||||
@self.noise4 = "doors/runeuse.wav";
|
||||
}
|
||||
else if (world.worldtype == 2)
|
||||
{
|
||||
precache_sound ("doors/basetry.wav");
|
||||
precache_sound ("doors/baseuse.wav");
|
||||
self.noise3 = "doors/basetry.wav";
|
||||
self.noise4 = "doors/baseuse.wav";
|
||||
@self.noise3 = "doors/basetry.wav";
|
||||
@self.noise4 = "doors/baseuse.wav";
|
||||
}
|
||||
else
|
||||
{
|
||||
dprint ("no worldtype set!\n");
|
||||
}
|
||||
if (self.sounds == 0)
|
||||
if (@self.sounds == 0)
|
||||
{
|
||||
precache_sound ("misc/null.wav");
|
||||
precache_sound ("misc/null.wav");
|
||||
self.noise1 = "misc/null.wav";
|
||||
self.noise2 = "misc/null.wav";
|
||||
@self.noise1 = "misc/null.wav";
|
||||
@self.noise2 = "misc/null.wav";
|
||||
}
|
||||
if (self.sounds == 1)
|
||||
if (@self.sounds == 1)
|
||||
{
|
||||
precache_sound ("doors/drclos4.wav");
|
||||
precache_sound ("doors/doormv1.wav");
|
||||
self.noise1 = "doors/drclos4.wav";
|
||||
self.noise2 = "doors/doormv1.wav";
|
||||
@self.noise1 = "doors/drclos4.wav";
|
||||
@self.noise2 = "doors/doormv1.wav";
|
||||
}
|
||||
if (self.sounds == 2)
|
||||
if (@self.sounds == 2)
|
||||
{
|
||||
precache_sound ("doors/hydro1.wav");
|
||||
precache_sound ("doors/hydro2.wav");
|
||||
self.noise2 = "doors/hydro1.wav";
|
||||
self.noise1 = "doors/hydro2.wav";
|
||||
@self.noise2 = "doors/hydro1.wav";
|
||||
@self.noise1 = "doors/hydro2.wav";
|
||||
}
|
||||
if (self.sounds == 3)
|
||||
if (@self.sounds == 3)
|
||||
{
|
||||
precache_sound ("doors/stndr1.wav");
|
||||
precache_sound ("doors/stndr2.wav");
|
||||
self.noise2 = "doors/stndr1.wav";
|
||||
self.noise1 = "doors/stndr2.wav";
|
||||
@self.noise2 = "doors/stndr1.wav";
|
||||
@self.noise1 = "doors/stndr2.wav";
|
||||
}
|
||||
if (self.sounds == 4)
|
||||
if (@self.sounds == 4)
|
||||
{
|
||||
precache_sound ("doors/ddoor1.wav");
|
||||
precache_sound ("doors/ddoor2.wav");
|
||||
self.noise1 = "doors/ddoor2.wav";
|
||||
self.noise2 = "doors/ddoor1.wav";
|
||||
@self.noise1 = "doors/ddoor2.wav";
|
||||
@self.noise2 = "doors/ddoor1.wav";
|
||||
}
|
||||
SetMovedir ();
|
||||
self.max_health = self.health;
|
||||
self.solid = SOLID_BSP;
|
||||
self.movetype = MOVETYPE_PUSH;
|
||||
setorigin (self, self.origin);
|
||||
setmodel (self, self.model);
|
||||
self.classname = "door";
|
||||
self.blocked = door_blocked;
|
||||
self.use = door_use;
|
||||
@self.max_health = @self.health;
|
||||
@self.solid = SOLID_BSP;
|
||||
@self.movetype = MOVETYPE_PUSH;
|
||||
setorigin (@self, @self.origin);
|
||||
setmodel (@self, @self.model);
|
||||
@self.classname = "door";
|
||||
@self.blocked = door_blocked;
|
||||
@self.use = door_use;
|
||||
|
||||
if (self.spawnflags & DOOR_SILVER_KEY)
|
||||
self.items = IT_KEY1;
|
||||
if (self.spawnflags & DOOR_GOLD_KEY)
|
||||
self.items = IT_KEY2;
|
||||
if (@self.spawnflags & DOOR_SILVER_KEY)
|
||||
@self.items = IT_KEY1;
|
||||
if (@self.spawnflags & DOOR_GOLD_KEY)
|
||||
@self.items = IT_KEY2;
|
||||
|
||||
if (!self.speed)
|
||||
self.speed = 100;
|
||||
if (!self.wait)
|
||||
self.wait = 3;
|
||||
if (!self.lip)
|
||||
self.lip = 8;
|
||||
if (!self.dmg)
|
||||
self.dmg = 2;
|
||||
self.pos1 = self.origin;
|
||||
self.pos2 = self.pos1 + self.movedir*(fabs(self.movedir*self.size) - self.lip);
|
||||
if (!@self.speed)
|
||||
@self.speed = 100;
|
||||
if (!@self.wait)
|
||||
@self.wait = 3;
|
||||
if (!@self.lip)
|
||||
@self.lip = 8;
|
||||
if (!@self.dmg)
|
||||
@self.dmg = 2;
|
||||
@self.pos1 = @self.origin;
|
||||
@self.pos2 = @self.pos1 + @self.movedir*(fabs(@self.movedir*@self.size) - @self.lip);
|
||||
// DOOR_START_OPEN is to allow an entity to be lighted in the closed position
|
||||
// but spawn in the open position
|
||||
if (self.spawnflags & DOOR_START_OPEN)
|
||||
if (@self.spawnflags & DOOR_START_OPEN)
|
||||
{
|
||||
setorigin (self, self.pos2);
|
||||
self.pos2 = self.pos1;
|
||||
self.pos1 = self.origin;
|
||||
setorigin (@self, @self.pos2);
|
||||
@self.pos2 = @self.pos1;
|
||||
@self.pos1 = @self.origin;
|
||||
}
|
||||
self.state = STATE_BOTTOM;
|
||||
if (self.health)
|
||||
@self.state = STATE_BOTTOM;
|
||||
if (@self.health)
|
||||
{
|
||||
self.takedamage = DAMAGE_YES;
|
||||
self.th_die = door_killed;
|
||||
@self.takedamage = DAMAGE_YES;
|
||||
@self.th_die = door_killed;
|
||||
}
|
||||
|
||||
if (self.items)
|
||||
self.wait = -1;
|
||||
if (@self.items)
|
||||
@self.wait = -1;
|
||||
|
||||
self.touch = door_touch;
|
||||
@self.touch = door_touch;
|
||||
// LinkDoors can't be done until all of the doors have been spawned, so
|
||||
// the sizes can be detected properly.
|
||||
self.think = LinkDoors;
|
||||
self.nextthink = self.ltime + 0.1;
|
||||
@self.think = LinkDoors;
|
||||
@self.nextthink = @self.ltime + 0.1;
|
||||
};
|
||||
/*
|
||||
=============================================================================
|
||||
|
@ -482,105 +482,105 @@ void () fd_secret_use =
|
|||
{
|
||||
local float temp;
|
||||
|
||||
self.health = 10000;
|
||||
@self.health = 10000;
|
||||
// exit if still moving around...
|
||||
if (self.origin != self.oldorigin)
|
||||
if (@self.origin != @self.oldorigin)
|
||||
return;
|
||||
|
||||
self.message = string_null; // no more message
|
||||
@self.message = string_null; // no more message
|
||||
SUB_UseTargets(); // fire all targets / killtargets
|
||||
|
||||
if (!(self.spawnflags & SECRET_NO_SHOOT))
|
||||
if (!(@self.spawnflags & SECRET_NO_SHOOT))
|
||||
{
|
||||
self.th_pain = SUB_Null;
|
||||
self.takedamage = DAMAGE_NO;
|
||||
@self.th_pain = SUB_Null;
|
||||
@self.takedamage = DAMAGE_NO;
|
||||
}
|
||||
self.velocity = '0 0 0';
|
||||
@self.velocity = '0 0 0';
|
||||
// Make a sound, wait a little...
|
||||
|
||||
sound(self, CHAN_VOICE, self.noise1, 1, ATTN_NORM);
|
||||
self.nextthink = self.ltime + 0.1;
|
||||
temp = 1 - (self.spawnflags & SECRET_1ST_LEFT); // 1 or -1
|
||||
makevectors(self.mangle);
|
||||
sound(@self, CHAN_VOICE, @self.noise1, 1, ATTN_NORM);
|
||||
@self.nextthink = @self.ltime + 0.1;
|
||||
temp = 1 - (@self.spawnflags & SECRET_1ST_LEFT); // 1 or -1
|
||||
makevectors(@self.mangle);
|
||||
|
||||
if (!self.t_width)
|
||||
if (!@self.t_width)
|
||||
{
|
||||
if (self.spawnflags & SECRET_1ST_DOWN)
|
||||
self. t_width = fabs(v_up * self.size);
|
||||
if (@self.spawnflags & SECRET_1ST_DOWN)
|
||||
@self. t_width = fabs(v_up * @self.size);
|
||||
else
|
||||
self. t_width = fabs(v_right * self.size);
|
||||
@self. t_width = fabs(v_right * @self.size);
|
||||
}
|
||||
|
||||
if (!self.t_length)
|
||||
self. t_length = fabs(v_forward * self.size);
|
||||
if (self.spawnflags & SECRET_1ST_DOWN)
|
||||
self.dest1 = self.origin - v_up * self.t_width;
|
||||
if (!@self.t_length)
|
||||
@self. t_length = fabs(v_forward * @self.size);
|
||||
if (@self.spawnflags & SECRET_1ST_DOWN)
|
||||
@self.dest1 = @self.origin - v_up * @self.t_width;
|
||||
else
|
||||
self.dest1 = self.origin + v_right * (self.t_width * temp);
|
||||
@self.dest1 = @self.origin + v_right * (@self.t_width * temp);
|
||||
|
||||
self.dest2 = self.dest1 + v_forward * self.t_length;
|
||||
SUB_CalcMove(self.dest1, self.speed, fd_secret_move1);
|
||||
sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM);
|
||||
@self.dest2 = @self.dest1 + v_forward * @self.t_length;
|
||||
SUB_CalcMove(@self.dest1, @self.speed, fd_secret_move1);
|
||||
sound(@self, CHAN_VOICE, @self.noise2, 1, ATTN_NORM);
|
||||
};
|
||||
// Wait after first movement...
|
||||
void () fd_secret_move1 =
|
||||
{
|
||||
self.nextthink = self.ltime + 1.0;
|
||||
self.think = fd_secret_move2;
|
||||
sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM);
|
||||
@self.nextthink = @self.ltime + 1.0;
|
||||
@self.think = fd_secret_move2;
|
||||
sound(@self, CHAN_VOICE, @self.noise3, 1, ATTN_NORM);
|
||||
};
|
||||
// Start moving sideways w/sound...
|
||||
void () fd_secret_move2 =
|
||||
{
|
||||
sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM);
|
||||
SUB_CalcMove(self.dest2, self.speed, fd_secret_move3);
|
||||
sound(@self, CHAN_VOICE, @self.noise2, 1, ATTN_NORM);
|
||||
SUB_CalcMove(@self.dest2, @self.speed, fd_secret_move3);
|
||||
};
|
||||
// Wait here until time to go back...
|
||||
void () fd_secret_move3 =
|
||||
{
|
||||
sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM);
|
||||
if (!(self.spawnflags & SECRET_OPEN_ONCE))
|
||||
sound(@self, CHAN_VOICE, @self.noise3, 1, ATTN_NORM);
|
||||
if (!(@self.spawnflags & SECRET_OPEN_ONCE))
|
||||
{
|
||||
self.nextthink = self.ltime + self.wait;
|
||||
self.think = fd_secret_move4;
|
||||
@self.nextthink = @self.ltime + @self.wait;
|
||||
@self.think = fd_secret_move4;
|
||||
}
|
||||
};
|
||||
// Move backward...
|
||||
void () fd_secret_move4 =
|
||||
{
|
||||
sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM);
|
||||
SUB_CalcMove(self.dest1, self.speed, fd_secret_move5);
|
||||
sound(@self, CHAN_VOICE, @self.noise2, 1, ATTN_NORM);
|
||||
SUB_CalcMove(@self.dest1, @self.speed, fd_secret_move5);
|
||||
};
|
||||
// Wait 1 second...
|
||||
void () fd_secret_move5 =
|
||||
{
|
||||
self.nextthink = self.ltime + 1.0;
|
||||
self.think = fd_secret_move6;
|
||||
sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM);
|
||||
@self.nextthink = @self.ltime + 1.0;
|
||||
@self.think = fd_secret_move6;
|
||||
sound(@self, CHAN_VOICE, @self.noise3, 1, ATTN_NORM);
|
||||
};
|
||||
void () fd_secret_move6 =
|
||||
{
|
||||
sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM);
|
||||
SUB_CalcMove(self.oldorigin, self.speed, fd_secret_done);
|
||||
sound(@self, CHAN_VOICE, @self.noise2, 1, ATTN_NORM);
|
||||
SUB_CalcMove(@self.oldorigin, @self.speed, fd_secret_done);
|
||||
};
|
||||
void () fd_secret_done =
|
||||
{
|
||||
if (!self.targetname || self.spawnflags&SECRET_YES_SHOOT)
|
||||
if (!@self.targetname || @self.spawnflags&SECRET_YES_SHOOT)
|
||||
{
|
||||
self.health = 10000;
|
||||
self.takedamage = DAMAGE_YES;
|
||||
self.th_pain = fd_secret_use;
|
||||
self.th_die = fd_secret_use;
|
||||
@self.health = 10000;
|
||||
@self.takedamage = DAMAGE_YES;
|
||||
@self.th_pain = fd_secret_use;
|
||||
@self.th_die = fd_secret_use;
|
||||
}
|
||||
sound(self, CHAN_NO_PHS_ADD+CHAN_VOICE, self.noise3, 1, ATTN_NORM);
|
||||
sound(@self, CHAN_NO_PHS_ADD+CHAN_VOICE, @self.noise3, 1, ATTN_NORM);
|
||||
};
|
||||
void () secret_blocked =
|
||||
{
|
||||
if (time < self.attack_finished)
|
||||
if (time < @self.attack_finished)
|
||||
return;
|
||||
self.attack_finished = time + 0.5;
|
||||
@self.attack_finished = time + 0.5;
|
||||
other.deathtype = "squish";
|
||||
T_Damage (other, self, self, self.dmg);
|
||||
T_Damage (other, @self, @self, @self.dmg);
|
||||
};
|
||||
/*
|
||||
================
|
||||
|
@ -592,15 +592,15 @@ void() secret_touch =
|
|||
{
|
||||
if (other.classname != "player")
|
||||
return;
|
||||
if (self.attack_finished > time)
|
||||
if (@self.attack_finished > time)
|
||||
return;
|
||||
self.attack_finished = time + 2;
|
||||
@self.attack_finished = time + 2;
|
||||
|
||||
if (self.message)
|
||||
if (@self.message)
|
||||
{
|
||||
self.target_id_finished = time + 4;//POX don't let TargetID override centerprints
|
||||
@self.target_id_finished = time + 4;//POX don't let TargetID override centerprints
|
||||
|
||||
centerprint (other, self.message);
|
||||
centerprint (other, @self.message);
|
||||
sound (other, CHAN_BODY, "misc/talk.wav", 1, ATTN_NORM);
|
||||
}
|
||||
};
|
||||
|
@ -621,60 +621,60 @@ If a secret door has a targetname, it will only be opened by it's botton or trig
|
|||
*/
|
||||
void () func_door_secret =
|
||||
{
|
||||
if (self.sounds == 0)
|
||||
self.sounds = 3;
|
||||
if (self.sounds == 1)
|
||||
if (@self.sounds == 0)
|
||||
@self.sounds = 3;
|
||||
if (@self.sounds == 1)
|
||||
{
|
||||
precache_sound ("doors/latch2.wav");
|
||||
precache_sound ("doors/winch2.wav");
|
||||
precache_sound ("doors/drclos4.wav");
|
||||
self.noise1 = "doors/latch2.wav";
|
||||
self.noise2 = "doors/winch2.wav";
|
||||
self.noise3 = "doors/drclos4.wav";
|
||||
@self.noise1 = "doors/latch2.wav";
|
||||
@self.noise2 = "doors/winch2.wav";
|
||||
@self.noise3 = "doors/drclos4.wav";
|
||||
}
|
||||
if (self.sounds == 2)
|
||||
if (@self.sounds == 2)
|
||||
{
|
||||
precache_sound ("doors/airdoor1.wav");
|
||||
precache_sound ("doors/airdoor2.wav");
|
||||
self.noise2 = "doors/airdoor1.wav";
|
||||
self.noise1 = "doors/airdoor2.wav";
|
||||
self.noise3 = "doors/airdoor2.wav";
|
||||
@self.noise2 = "doors/airdoor1.wav";
|
||||
@self.noise1 = "doors/airdoor2.wav";
|
||||
@self.noise3 = "doors/airdoor2.wav";
|
||||
}
|
||||
if (self.sounds == 3)
|
||||
if (@self.sounds == 3)
|
||||
{
|
||||
precache_sound ("doors/basesec1.wav");
|
||||
precache_sound ("doors/basesec2.wav");
|
||||
self.noise2 = "doors/basesec1.wav";
|
||||
self.noise1 = "doors/basesec2.wav";
|
||||
self.noise3 = "doors/basesec2.wav";
|
||||
@self.noise2 = "doors/basesec1.wav";
|
||||
@self.noise1 = "doors/basesec2.wav";
|
||||
@self.noise3 = "doors/basesec2.wav";
|
||||
}
|
||||
if (!self.dmg)
|
||||
self.dmg = 2;
|
||||
if (!@self.dmg)
|
||||
@self.dmg = 2;
|
||||
|
||||
// Magic formula...
|
||||
self.mangle = self.angles;
|
||||
self.angles = '0 0 0';
|
||||
self.solid = SOLID_BSP;
|
||||
self.movetype = MOVETYPE_PUSH;
|
||||
self.classname = "door";
|
||||
setmodel (self, self.model);
|
||||
setorigin (self, self.origin);
|
||||
@self.mangle = @self.angles;
|
||||
@self.angles = '0 0 0';
|
||||
@self.solid = SOLID_BSP;
|
||||
@self.movetype = MOVETYPE_PUSH;
|
||||
@self.classname = "door";
|
||||
setmodel (@self, @self.model);
|
||||
setorigin (@self, @self.origin);
|
||||
|
||||
self.touch = secret_touch;
|
||||
self.blocked = secret_blocked;
|
||||
self.speed = 50;
|
||||
self.use = fd_secret_use;
|
||||
if ( !self.targetname || self.spawnflags&SECRET_YES_SHOOT)
|
||||
@self.touch = secret_touch;
|
||||
@self.blocked = secret_blocked;
|
||||
@self.speed = 50;
|
||||
@self.use = fd_secret_use;
|
||||
if ( !@self.targetname || @self.spawnflags&SECRET_YES_SHOOT)
|
||||
{
|
||||
self.health = 10000;
|
||||
self.takedamage = DAMAGE_YES;
|
||||
self.th_pain = fd_secret_use;
|
||||
@self.health = 10000;
|
||||
@self.takedamage = DAMAGE_YES;
|
||||
@self.th_pain = fd_secret_use;
|
||||
|
||||
// + POX
|
||||
self.nobleed = TRUE;
|
||||
@self.nobleed = TRUE;
|
||||
// - POX
|
||||
}
|
||||
self.oldorigin = self.origin;
|
||||
if (!self.wait)
|
||||
self.wait = 5; // 5 seconds before closing
|
||||
@self.oldorigin = @self.origin;
|
||||
if (!@self.wait)
|
||||
@self.wait = 5; // 5 seconds before closing
|
||||
};
|
||||
|
|
|
@ -26,80 +26,80 @@ void() start_dynlight =
|
|||
{
|
||||
//POX v1.1 - changed this for QW support
|
||||
//No EF_BRIGHTFIELD in QW - defaults to EF_DIMLIGHT
|
||||
if (self.dynlight_style == 2)
|
||||
self.effects = self.effects | EF_BRIGHTLIGHT;
|
||||
if (@self.dynlight_style == 2)
|
||||
@self.effects = @self.effects | EF_BRIGHTLIGHT;
|
||||
|
||||
else if (self.dynlight_style == 4)
|
||||
self.effects = self.effects | EF_BLUE;
|
||||
else if (@self.dynlight_style == 4)
|
||||
@self.effects = @self.effects | EF_BLUE;
|
||||
|
||||
else if (self.dynlight_style == 5)
|
||||
self.effects = self.effects | EF_RED;
|
||||
else if (@self.dynlight_style == 5)
|
||||
@self.effects = @self.effects | EF_RED;
|
||||
|
||||
else
|
||||
self.effects = self.effects | EF_DIMLIGHT;
|
||||
@self.effects = @self.effects | EF_DIMLIGHT;
|
||||
|
||||
|
||||
dynlight_next();
|
||||
};
|
||||
void() dynlight_wait =
|
||||
{
|
||||
if (self.wait)
|
||||
self.nextthink = self.ltime + self.wait;
|
||||
if (@self.wait)
|
||||
@self.nextthink = @self.ltime + @self.wait;
|
||||
else
|
||||
self.nextthink = self.ltime + 0.1;
|
||||
@self.nextthink = @self.ltime + 0.1;
|
||||
|
||||
self.think = dynlight_next;
|
||||
@self.think = dynlight_next;
|
||||
};
|
||||
void() dynlight_next =
|
||||
{
|
||||
local entity targ;
|
||||
targ = find (world, targetname, self.target);
|
||||
self.target = targ.target;
|
||||
if (!self.target)
|
||||
targ = find (world, targetname, @self.target);
|
||||
@self.target = targ.target;
|
||||
if (!@self.target)
|
||||
objerror ("dynlight_next: no next target");
|
||||
if (targ.wait)
|
||||
self.wait = targ.wait;
|
||||
@self.wait = targ.wait;
|
||||
else
|
||||
self.wait = 0;
|
||||
SUB_CalcMove (targ.origin - self.mins, self.speed, dynlight_wait);
|
||||
@self.wait = 0;
|
||||
SUB_CalcMove (targ.origin - @self.mins, @self.speed, dynlight_wait);
|
||||
};
|
||||
void() dynlight_find =
|
||||
{
|
||||
local entity targ;
|
||||
targ = find (world, targetname, self.target);
|
||||
self.target = targ.target;
|
||||
setorigin (self, targ.origin - self.mins);
|
||||
if (!self.targetname)
|
||||
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 = start_dynlight;
|
||||
@self.nextthink = @self.ltime + 0.1;
|
||||
@self.think = start_dynlight;
|
||||
}
|
||||
};
|
||||
void() dynlight_use =
|
||||
{
|
||||
if (self.think != dynlight_find)
|
||||
if (@self.think != dynlight_find)
|
||||
return; // already activated
|
||||
start_dynlight();
|
||||
};
|
||||
void() dyn_light =
|
||||
{
|
||||
precache_model ("progs/null.spr");
|
||||
if (!self.speed)
|
||||
self.speed = 100;
|
||||
if (!@self.speed)
|
||||
@self.speed = 100;
|
||||
|
||||
if (!self.target)
|
||||
if (!@self.target)
|
||||
objerror ("dyn_light without a target");
|
||||
|
||||
self.solid = SOLID_NOT;
|
||||
self.movetype = MOVETYPE_PUSH;
|
||||
self.use = dynlight_use;
|
||||
self.classname = "dynlight";
|
||||
@self.solid = SOLID_NOT;
|
||||
@self.movetype = MOVETYPE_PUSH;
|
||||
@self.use = dynlight_use;
|
||||
@self.classname = "dynlight";
|
||||
|
||||
setmodel (self, "progs/null.spr");
|
||||
setsize (self, '0 0 0', '0 0 0');
|
||||
setorigin (self, self.origin);
|
||||
setmodel (@self, "progs/null.spr");
|
||||
setsize (@self, '0 0 0', '0 0 0');
|
||||
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 = dynlight_find;
|
||||
@self.nextthink = @self.ltime + 0.1;
|
||||
@self.think = dynlight_find;
|
||||
};
|
||||
|
|
|
@ -5,24 +5,24 @@
|
|||
/*
|
||||
POX - Flashlight code from the Flashlight Tutorial at the Inside3D website <http://www.inside3d.com>
|
||||
Created by ShockMan eMail: shockman@brutality.com
|
||||
Added an entity attribute to the spawn function for bot support (since self is only the bot at respwan)
|
||||
Added an entity attribute to the spawn function for bot support (since @self is only the bot at respwan)
|
||||
*/
|
||||
void() flash_update =
|
||||
{
|
||||
// The Player is dead so turn the Flashlight off
|
||||
if (self.owner.deadflag != DEAD_NO)
|
||||
self.effects = 0;
|
||||
if (@self.owner.deadflag != DEAD_NO)
|
||||
@self.effects = 0;
|
||||
// The Player is alive so turn On the Flashlight
|
||||
else
|
||||
self.effects = EF_DIMLIGHT;
|
||||
@self.effects = EF_DIMLIGHT;
|
||||
// Find out which direction player facing
|
||||
makevectors (self.owner.v_angle);
|
||||
makevectors (@self.owner.v_angle);
|
||||
// Check if there is any things infront of the flashlight
|
||||
traceline (self.owner.origin , (self.owner.origin+(v_forward * 500)) , FALSE , self);
|
||||
traceline (@self.owner.origin , (@self.owner.origin+(v_forward * 500)) , FALSE , @self);
|
||||
// Set the Flashlight's position
|
||||
setorigin (self, trace_endpos+(v_forward * -5));
|
||||
setorigin (@self, trace_endpos+(v_forward * -5));
|
||||
// Repeat it in 0.02 seconds...
|
||||
self.nextthink = time + 0.02;
|
||||
@self.nextthink = time + 0.02;
|
||||
};
|
||||
void(entity me) flash_on =
|
||||
{
|
||||
|
@ -48,8 +48,8 @@ void(entity me) flash_on =
|
|||
myflash.effects = EF_DIMLIGHT;
|
||||
|
||||
// Set Start Position
|
||||
makevectors (self.v_angle);
|
||||
traceline (self.origin , (self.origin+(v_forward * 500)) , FALSE , self);
|
||||
makevectors (@self.v_angle);
|
||||
traceline (@self.origin , (@self.origin+(v_forward * 500)) , FALSE , @self);
|
||||
setorigin (myflash, trace_endpos);
|
||||
// Start Flashlight Update
|
||||
myflash.think = flash_update;
|
||||
|
@ -61,18 +61,18 @@ void(entity me) flash_on =
|
|||
void () flash_toggle =
|
||||
{
|
||||
// If Off, Turn On
|
||||
if (self.flash_flag == FALSE)
|
||||
if (@self.flash_flag == FALSE)
|
||||
{
|
||||
self.flash_flag = TRUE;
|
||||
@self.flash_flag = TRUE;
|
||||
flash_on();
|
||||
}
|
||||
// If On, Turn Off
|
||||
else
|
||||
{
|
||||
self.flash_flag = FALSE;
|
||||
@self.flash_flag = FALSE;
|
||||
W_SetCurrentAmmo ();
|
||||
self.flash.think = SUB_Remove;
|
||||
self.flash.nextthink = time + 0.1;
|
||||
@self.flash.think = SUB_Remove;
|
||||
@self.flash.nextthink = time + 0.1;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -7,7 +7,7 @@ Used as a positional target for spotlights, etc.
|
|||
*/
|
||||
void() info_null =
|
||||
{
|
||||
remove(self);
|
||||
remove(@self);
|
||||
};
|
||||
/*QUAKED info_notnull (0 0.5 0) (-4 -4 -4) (4 4 4)
|
||||
Used as a positional target for lightning.
|
||||
|
@ -19,15 +19,15 @@ void() info_notnull =
|
|||
float START_OFF = 1;
|
||||
void() light_use =
|
||||
{
|
||||
if (self.spawnflags & START_OFF)
|
||||
if (@self.spawnflags & START_OFF)
|
||||
{
|
||||
lightstyle(self.style, "m");
|
||||
self.spawnflags = self.spawnflags - START_OFF;
|
||||
lightstyle(@self.style, "m");
|
||||
@self.spawnflags = @self.spawnflags - START_OFF;
|
||||
}
|
||||
else
|
||||
{
|
||||
lightstyle(self.style, "a");
|
||||
self.spawnflags = self.spawnflags + START_OFF;
|
||||
lightstyle(@self.style, "a");
|
||||
@self.spawnflags = @self.spawnflags + START_OFF;
|
||||
}
|
||||
};
|
||||
/*QUAKED light (0 1 0) (-8 -8 -8) (8 8 8) START_OFF
|
||||
|
@ -41,22 +41,22 @@ void() light =
|
|||
// + POX - Dark Mode (dim the lights)
|
||||
if (deathmatch & DM_DARK)
|
||||
{
|
||||
lightstyle(self.style, "c");
|
||||
lightstyle(@self.style, "c");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!self.targetname)
|
||||
if (!@self.targetname)
|
||||
{ // inert light
|
||||
remove(self);
|
||||
remove(@self);
|
||||
return;
|
||||
}
|
||||
if (self.style >= 32)
|
||||
if (@self.style >= 32)
|
||||
{
|
||||
self.use = light_use;
|
||||
if (self.spawnflags & START_OFF)
|
||||
lightstyle(self.style, "a");
|
||||
@self.use = light_use;
|
||||
if (@self.spawnflags & START_OFF)
|
||||
lightstyle(@self.style, "a");
|
||||
else
|
||||
lightstyle(self.style, "m");
|
||||
lightstyle(@self.style, "m");
|
||||
}
|
||||
};
|
||||
/*QUAKED light_fluoro (0 1 0) (-8 -8 -8) (8 8 8) START_OFF
|
||||
|
@ -71,21 +71,21 @@ void() light_fluoro =
|
|||
// + POX - Dark Mode (dim the lights)
|
||||
if (deathmatch & DM_DARK)
|
||||
{
|
||||
lightstyle(self.style, "c");
|
||||
lightstyle(@self.style, "c");
|
||||
return;
|
||||
}
|
||||
|
||||
if (self.style >= 32)
|
||||
if (@self.style >= 32)
|
||||
{
|
||||
self.use = light_use;
|
||||
if (self.spawnflags & START_OFF)
|
||||
lightstyle(self.style, "a");
|
||||
@self.use = light_use;
|
||||
if (@self.spawnflags & START_OFF)
|
||||
lightstyle(@self.style, "a");
|
||||
else
|
||||
lightstyle(self.style, "m");
|
||||
lightstyle(@self.style, "m");
|
||||
}
|
||||
|
||||
precache_sound ("ambience/fl_hum1.wav");
|
||||
ambientsound (self.origin, "ambience/fl_hum1.wav", 0.5, ATTN_STATIC);
|
||||
ambientsound (@self.origin, "ambience/fl_hum1.wav", 0.5, ATTN_STATIC);
|
||||
};
|
||||
/*QUAKED light_fluorospark (0 1 0) (-8 -8 -8) (8 8 8)
|
||||
Non-displayed light.
|
||||
|
@ -98,14 +98,14 @@ void() light_fluorospark =
|
|||
// + POX - Dark Mode (dim the lights)
|
||||
if (deathmatch & DM_DARK)
|
||||
{
|
||||
lightstyle(self.style, "c");
|
||||
lightstyle(@self.style, "c");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!self.style)
|
||||
self.style = 10;
|
||||
if (!@self.style)
|
||||
@self.style = 10;
|
||||
precache_sound ("ambience/buzz1.wav");
|
||||
ambientsound (self.origin, "ambience/buzz1.wav", 0.5, ATTN_STATIC);
|
||||
ambientsound (@self.origin, "ambience/buzz1.wav", 0.5, ATTN_STATIC);
|
||||
};
|
||||
/*QUAKED light_globe (0 1 0) (-8 -8 -8) (8 8 8)
|
||||
Sphere globe light.
|
||||
|
@ -117,19 +117,19 @@ void() light_globe =
|
|||
// + POX - Dark Mode (dim the lights)
|
||||
if (deathmatch & DM_DARK)
|
||||
{
|
||||
lightstyle(self.style, "c");
|
||||
lightstyle(@self.style, "c");
|
||||
return;
|
||||
}
|
||||
|
||||
precache_model ("progs/s_light.spr");
|
||||
setmodel (self, "progs/s_light.spr");
|
||||
makestatic (self);
|
||||
setmodel (@self, "progs/s_light.spr");
|
||||
makestatic (@self);
|
||||
};
|
||||
void() FireAmbient =
|
||||
{
|
||||
precache_sound ("ambience/fire1.wav");
|
||||
// attenuate fast
|
||||
ambientsound (self.origin, "ambience/fire1.wav", 0.5, ATTN_STATIC);
|
||||
ambientsound (@self.origin, "ambience/fire1.wav", 0.5, ATTN_STATIC);
|
||||
};
|
||||
/*QUAKED light_torch_small_walltorch (0 .5 0) (-10 -10 -20) (10 10 20)
|
||||
Short wall torch
|
||||
|
@ -141,14 +141,14 @@ void() light_torch_small_walltorch =
|
|||
// + POX - Dark Mode (dim the lights)
|
||||
if (deathmatch & DM_DARK)
|
||||
{
|
||||
lightstyle(self.style, "c");
|
||||
lightstyle(@self.style, "c");
|
||||
return;
|
||||
}
|
||||
|
||||
precache_model ("progs/flame.mdl");
|
||||
setmodel (self, "progs/flame.mdl");
|
||||
setmodel (@self, "progs/flame.mdl");
|
||||
FireAmbient ();
|
||||
makestatic (self);
|
||||
makestatic (@self);
|
||||
};
|
||||
/*QUAKED light_flame_large_yellow (0 1 0) (-10 -10 -12) (12 12 18)
|
||||
Large yellow flame ball
|
||||
|
@ -158,15 +158,15 @@ void() light_flame_large_yellow =
|
|||
// + POX - Dark Mode (dim the lights)
|
||||
if (deathmatch & DM_DARK)
|
||||
{
|
||||
lightstyle(self.style, "c");
|
||||
lightstyle(@self.style, "c");
|
||||
return;
|
||||
}
|
||||
|
||||
precache_model ("progs/flame2.mdl");
|
||||
setmodel (self, "progs/flame2.mdl");
|
||||
self.frame = 1;
|
||||
setmodel (@self, "progs/flame2.mdl");
|
||||
@self.frame = 1;
|
||||
FireAmbient ();
|
||||
makestatic (self);
|
||||
makestatic (@self);
|
||||
};
|
||||
/*QUAKED light_flame_small_yellow (0 1 0) (-8 -8 -8) (8 8 8) START_OFF
|
||||
Small yellow flame ball
|
||||
|
@ -176,14 +176,14 @@ void() light_flame_small_yellow =
|
|||
// + POX - Dark Mode (dim the lights)
|
||||
if (deathmatch & DM_DARK)
|
||||
{
|
||||
lightstyle(self.style, "c");
|
||||
lightstyle(@self.style, "c");
|
||||
return;
|
||||
}
|
||||
|
||||
precache_model ("progs/flame2.mdl");
|
||||
setmodel (self, "progs/flame2.mdl");
|
||||
setmodel (@self, "progs/flame2.mdl");
|
||||
FireAmbient ();
|
||||
makestatic (self);
|
||||
makestatic (@self);
|
||||
};
|
||||
/*QUAKED light_flame_small_white (0 1 0) (-10 -10 -40) (10 10 40) START_OFF
|
||||
Small white flame ball
|
||||
|
@ -193,14 +193,14 @@ void() light_flame_small_white =
|
|||
// + POX - Dark Mode (dim the lights)
|
||||
if (deathmatch & DM_DARK)
|
||||
{
|
||||
lightstyle(self.style, "c");
|
||||
lightstyle(@self.style, "c");
|
||||
return;
|
||||
}
|
||||
|
||||
precache_model ("progs/flame2.mdl");
|
||||
setmodel (self, "progs/flame2.mdl");
|
||||
setmodel (@self, "progs/flame2.mdl");
|
||||
FireAmbient ();
|
||||
makestatic (self);
|
||||
makestatic (@self);
|
||||
};
|
||||
//============================================================================
|
||||
/*QUAKED misc_fireball (0 .5 .8) (-8 -8 -8) (8 8 8)
|
||||
|
@ -212,11 +212,11 @@ void() misc_fireball =
|
|||
{
|
||||
|
||||
precache_model ("progs/lavaball.mdl");
|
||||
self.classname = "fireball";
|
||||
self.nextthink = time + (random() * 5);
|
||||
self.think = fire_fly;
|
||||
if (!self.speed)
|
||||
self.speed = 1000;
|
||||
@self.classname = "fireball";
|
||||
@self.nextthink = time + (random() * 5);
|
||||
@self.think = fire_fly;
|
||||
if (!@self.speed)
|
||||
@self.speed = 1000;
|
||||
};
|
||||
void() fire_fly =
|
||||
{
|
||||
|
@ -227,39 +227,39 @@ local entity fireball;
|
|||
fireball.velocity = '0 0 1000';
|
||||
fireball.velocity_x = (random() * 100) - 50;
|
||||
fireball.velocity_y = (random() * 100) - 50;
|
||||
fireball.velocity_z = self.speed + (random() * 200);
|
||||
fireball.velocity_z = @self.speed + (random() * 200);
|
||||
fireball.classname = "fireball";
|
||||
setmodel (fireball, "progs/lavaball.mdl");
|
||||
setsize (fireball, '0 0 0', '0 0 0');
|
||||
setorigin (fireball, self.origin);
|
||||
setorigin (fireball, @self.origin);
|
||||
fireball.nextthink = time + 5;
|
||||
fireball.think = SUB_Remove;
|
||||
fireball.touch = fire_touch;
|
||||
|
||||
self.nextthink = time + (random() * 5) + 3;
|
||||
self.think = fire_fly;
|
||||
@self.nextthink = time + (random() * 5) + 3;
|
||||
@self.think = fire_fly;
|
||||
};
|
||||
void() fire_touch =
|
||||
{
|
||||
T_Damage (other, self, self, 20);
|
||||
remove(self);
|
||||
T_Damage (other, @self, @self, 20);
|
||||
remove(@self);
|
||||
};
|
||||
//============================================================================
|
||||
void() barrel_explode =
|
||||
{
|
||||
self.takedamage = DAMAGE_NO;
|
||||
self.classname = "explo_box";
|
||||
// did say self.owner
|
||||
T_RadiusDamage (self, self, 160, world, "");
|
||||
sound (self, CHAN_VOICE, "weapons/r_exp3.wav", 1, ATTN_NORM);
|
||||
@self.takedamage = DAMAGE_NO;
|
||||
@self.classname = "explo_box";
|
||||
// did say @self.owner
|
||||
T_RadiusDamage (@self, @self, 160, world, "");
|
||||
sound (@self, CHAN_VOICE, "weapons/r_exp3.wav", 1, ATTN_NORM);
|
||||
|
||||
WriteByte (MSG_MULTICAST, SVC_TEMPENTITY);
|
||||
WriteByte (MSG_MULTICAST, TE_EXPLOSION);
|
||||
WriteCoord (MSG_MULTICAST, self.origin_x);
|
||||
WriteCoord (MSG_MULTICAST, self.origin_y);
|
||||
WriteCoord (MSG_MULTICAST, self.origin_z+32);
|
||||
multicast (self.origin, MULTICAST_PHS);
|
||||
remove (self);
|
||||
WriteCoord (MSG_MULTICAST, @self.origin_x);
|
||||
WriteCoord (MSG_MULTICAST, @self.origin_y);
|
||||
WriteCoord (MSG_MULTICAST, @self.origin_z+32);
|
||||
multicast (@self.origin, MULTICAST_PHS);
|
||||
remove (@self);
|
||||
};
|
||||
/*QUAKED misc_explobox (0 .5 .8) (0 0 0) (32 32 64)
|
||||
TESTING THING
|
||||
|
@ -268,27 +268,27 @@ void() misc_explobox =
|
|||
{
|
||||
local float oldz;
|
||||
|
||||
self.solid = SOLID_BBOX;
|
||||
self.movetype = MOVETYPE_NONE;
|
||||
@self.solid = SOLID_BBOX;
|
||||
@self.movetype = MOVETYPE_NONE;
|
||||
precache_model ("maps/b_explob.bsp");
|
||||
setmodel (self, "maps/b_explob.bsp");
|
||||
setsize (self, '0 0 0', '32 32 64');
|
||||
setmodel (@self, "maps/b_explob.bsp");
|
||||
setsize (@self, '0 0 0', '32 32 64');
|
||||
precache_sound ("weapons/r_exp3.wav");
|
||||
self.health = 20;
|
||||
self.th_die = barrel_explode;
|
||||
self.takedamage = DAMAGE_AIM;
|
||||
self.origin_z = self.origin_z + 2;
|
||||
oldz = self.origin_z;
|
||||
@self.health = 20;
|
||||
@self.th_die = barrel_explode;
|
||||
@self.takedamage = DAMAGE_AIM;
|
||||
@self.origin_z = @self.origin_z + 2;
|
||||
oldz = @self.origin_z;
|
||||
droptofloor();
|
||||
if (oldz - self.origin_z > 250)
|
||||
if (oldz - @self.origin_z > 250)
|
||||
{
|
||||
dprint ("item fell out of level at ");
|
||||
dprint (vtos(self.origin));
|
||||
dprint (vtos(@self.origin));
|
||||
dprint ("\n");
|
||||
remove(self);
|
||||
remove(@self);
|
||||
}
|
||||
|
||||
self.nobleed = TRUE;
|
||||
@self.nobleed = TRUE;
|
||||
};
|
||||
/*QUAKED misc_explobox2 (0 .5 .8) (0 0 0) (32 32 64)
|
||||
Smaller exploding box, REGISTERED ONLY
|
||||
|
@ -297,27 +297,27 @@ void() misc_explobox2 =
|
|||
{
|
||||
local float oldz;
|
||||
|
||||
self.solid = SOLID_BBOX;
|
||||
self.movetype = MOVETYPE_NONE;
|
||||
@self.solid = SOLID_BBOX;
|
||||
@self.movetype = MOVETYPE_NONE;
|
||||
precache_model2 ("maps/b_exbox2.bsp");
|
||||
setmodel (self, "maps/b_exbox2.bsp");
|
||||
setsize (self, '0 0 0', '32 32 32');
|
||||
setmodel (@self, "maps/b_exbox2.bsp");
|
||||
setsize (@self, '0 0 0', '32 32 32');
|
||||
precache_sound ("weapons/r_exp3.wav");
|
||||
self.health = 20;
|
||||
self.th_die = barrel_explode;
|
||||
self.takedamage = DAMAGE_AIM;
|
||||
self.origin_z = self.origin_z + 2;
|
||||
oldz = self.origin_z;
|
||||
@self.health = 20;
|
||||
@self.th_die = barrel_explode;
|
||||
@self.takedamage = DAMAGE_AIM;
|
||||
@self.origin_z = @self.origin_z + 2;
|
||||
oldz = @self.origin_z;
|
||||
droptofloor();
|
||||
if (oldz - self.origin_z > 250)
|
||||
if (oldz - @self.origin_z > 250)
|
||||
{
|
||||
dprint ("item fell out of level at ");
|
||||
dprint (vtos(self.origin));
|
||||
dprint (vtos(@self.origin));
|
||||
dprint ("\n");
|
||||
remove(self);
|
||||
remove(@self);
|
||||
}
|
||||
|
||||
self.nobleed = TRUE;
|
||||
@self.nobleed = TRUE;
|
||||
};
|
||||
//============================================================================
|
||||
float SPAWNFLAG_SUPERSPIKE = 1;
|
||||
|
@ -326,21 +326,21 @@ void() Laser_Touch =
|
|||
{
|
||||
local vector org;
|
||||
|
||||
if (other == self.owner)
|
||||
if (other == @self.owner)
|
||||
return; // don't explode on owner
|
||||
if (pointcontents(self.origin) == CONTENT_SKY)
|
||||
if (pointcontents(@self.origin) == CONTENT_SKY)
|
||||
{
|
||||
remove(self);
|
||||
remove(@self);
|
||||
return;
|
||||
}
|
||||
|
||||
sound (self, CHAN_WEAPON, "enforcer/enfstop.wav", 1, ATTN_STATIC);
|
||||
org = self.origin - 8*normalize(self.velocity);
|
||||
sound (@self, CHAN_WEAPON, "enforcer/enfstop.wav", 1, ATTN_STATIC);
|
||||
org = @self.origin - 8*normalize(@self.velocity);
|
||||
if (other.health)
|
||||
{
|
||||
SpawnBlood (org, 15);
|
||||
other.deathtype = "laser";
|
||||
T_Damage (other, self, self.owner, 15);
|
||||
T_Damage (other, @self, @self.owner, 15);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -353,18 +353,18 @@ void() Laser_Touch =
|
|||
multicast (org, MULTICAST_PVS);
|
||||
}
|
||||
|
||||
remove(self);
|
||||
remove(@self);
|
||||
};
|
||||
void(vector org, vector vec) LaunchLaser =
|
||||
{
|
||||
local vector v;
|
||||
|
||||
if (self.classname == "monster_enforcer")
|
||||
sound (self, CHAN_WEAPON, "enforcer/enfire.wav", 1, ATTN_NORM);
|
||||
if (@self.classname == "monster_enforcer")
|
||||
sound (@self, CHAN_WEAPON, "enforcer/enfire.wav", 1, ATTN_NORM);
|
||||
v = normalize (vec);
|
||||
|
||||
newmis = spawn();
|
||||
newmis.owner = self;
|
||||
newmis.owner = @self;
|
||||
newmis.movetype = MOVETYPE_FLY;
|
||||
newmis.solid = SOLID_BBOX;
|
||||
newmis.effects = EF_DIMLIGHT;
|
||||
|
@ -379,25 +379,25 @@ void(vector org, vector vec) LaunchLaser =
|
|||
};
|
||||
void() spikeshooter_use =
|
||||
{
|
||||
if (self.spawnflags & SPAWNFLAG_LASER)
|
||||
if (@self.spawnflags & SPAWNFLAG_LASER)
|
||||
{
|
||||
sound (self, CHAN_VOICE, "enforcer/enfire.wav", 1, ATTN_NORM);
|
||||
LaunchLaser (self.origin, self.movedir);
|
||||
sound (@self, CHAN_VOICE, "enforcer/enfire.wav", 1, ATTN_NORM);
|
||||
LaunchLaser (@self.origin, @self.movedir);
|
||||
}
|
||||
else
|
||||
{
|
||||
sound (self, CHAN_VOICE, "weapons/spike2.wav", 1, ATTN_NORM);
|
||||
launch_spike (self.origin, self.movedir);
|
||||
newmis.velocity = self.movedir * 500;
|
||||
if (self.spawnflags & SPAWNFLAG_SUPERSPIKE)
|
||||
sound (@self, CHAN_VOICE, "weapons/spike2.wav", 1, ATTN_NORM);
|
||||
launch_spike (@self.origin, @self.movedir);
|
||||
newmis.velocity = @self.movedir * 500;
|
||||
if (@self.spawnflags & SPAWNFLAG_SUPERSPIKE)
|
||||
newmis.touch = superspike_touch;
|
||||
}
|
||||
};
|
||||
void() shooter_think =
|
||||
{
|
||||
spikeshooter_use ();
|
||||
self.nextthink = time + self.wait;
|
||||
newmis.velocity = self.movedir * 500;
|
||||
@self.nextthink = time + @self.wait;
|
||||
newmis.velocity = @self.movedir * 500;
|
||||
};
|
||||
/*QUAKED trap_spikeshooter (0 .5 .8) (-8 -8 -8) (8 8 8) superspike laser
|
||||
When triggered, fires a spike in the direction set in QuakeEd.
|
||||
|
@ -406,8 +406,8 @@ Laser is only for REGISTERED.
|
|||
void() trap_spikeshooter =
|
||||
{
|
||||
SetMovedir ();
|
||||
self.use = spikeshooter_use;
|
||||
if (self.spawnflags & SPAWNFLAG_LASER)
|
||||
@self.use = spikeshooter_use;
|
||||
if (@self.spawnflags & SPAWNFLAG_LASER)
|
||||
{
|
||||
precache_model2 ("progs/laser.mdl");
|
||||
|
||||
|
@ -426,10 +426,10 @@ void() trap_shooter =
|
|||
{
|
||||
trap_spikeshooter ();
|
||||
|
||||
if (self.wait == 0)
|
||||
self.wait = 1;
|
||||
self.nextthink = self.nextthink + self.wait + self.ltime;
|
||||
self.think = shooter_think;
|
||||
if (@self.wait == 0)
|
||||
@self.wait = 1;
|
||||
@self.nextthink = @self.nextthink + @self.wait + @self.ltime;
|
||||
@self.think = shooter_think;
|
||||
};
|
||||
/*
|
||||
===============================================================================
|
||||
|
@ -443,14 +443,14 @@ testing air bubbles
|
|||
*/
|
||||
void() air_bubbles =
|
||||
{
|
||||
remove (self);
|
||||
remove (@self);
|
||||
};
|
||||
void() make_bubbles =
|
||||
{
|
||||
local entity bubble;
|
||||
bubble = spawn();
|
||||
setmodel (bubble, "progs/s_bubble.spr");
|
||||
setorigin (bubble, self.origin);
|
||||
setorigin (bubble, @self.origin);
|
||||
bubble.movetype = MOVETYPE_NOCLIP;
|
||||
bubble.solid = SOLID_NOT;
|
||||
bubble.velocity = '0 0 15';
|
||||
|
@ -461,18 +461,18 @@ local entity bubble;
|
|||
bubble.frame = 0;
|
||||
bubble.cnt = 0;
|
||||
setsize (bubble, '-8 -8 -8', '8 8 8');
|
||||
self.nextthink = time + random() + 0.5;
|
||||
self.think = make_bubbles;
|
||||
@self.nextthink = time + random() + 0.5;
|
||||
@self.think = make_bubbles;
|
||||
};
|
||||
void() bubble_split =
|
||||
{
|
||||
local entity bubble;
|
||||
bubble = spawn();
|
||||
setmodel (bubble, "progs/s_bubble.spr");
|
||||
setorigin (bubble, self.origin);
|
||||
setorigin (bubble, @self.origin);
|
||||
bubble.movetype = MOVETYPE_NOCLIP;
|
||||
bubble.solid = SOLID_NOT;
|
||||
bubble.velocity = self.velocity;
|
||||
bubble.velocity = @self.velocity;
|
||||
bubble.nextthink = time + 0.5;
|
||||
bubble.think = bubble_bob;
|
||||
bubble.touch = bubble_remove;
|
||||
|
@ -480,41 +480,41 @@ local entity bubble;
|
|||
bubble.frame = 1;
|
||||
bubble.cnt = 10;
|
||||
setsize (bubble, '-8 -8 -8', '8 8 8');
|
||||
self.frame = 1;
|
||||
self.cnt = 10;
|
||||
if (self.waterlevel != 3)
|
||||
remove (self);
|
||||
@self.frame = 1;
|
||||
@self.cnt = 10;
|
||||
if (@self.waterlevel != 3)
|
||||
remove (@self);
|
||||
};
|
||||
void() bubble_remove =
|
||||
{
|
||||
if (other.classname == self.classname)
|
||||
if (other.classname == @self.classname)
|
||||
{
|
||||
// dprint ("bump");
|
||||
return;
|
||||
}
|
||||
remove(self);
|
||||
remove(@self);
|
||||
};
|
||||
void() bubble_bob =
|
||||
{
|
||||
local float rnd1, rnd2, rnd3;
|
||||
|
||||
(self.cnt)++;
|
||||
(@self.cnt)++;
|
||||
|
||||
if (self.classname == "bubble") {
|
||||
if (self.cnt == 4)
|
||||
if (@self.classname == "bubble") {
|
||||
if (@self.cnt == 4)
|
||||
bubble_split();
|
||||
|
||||
if (self.cnt == 20)
|
||||
remove(self);
|
||||
if (@self.cnt == 20)
|
||||
remove(@self);
|
||||
} else {
|
||||
if ((self.classname != "player") && (self.classname != "bodyque")
|
||||
&& (self.cnt == 50))
|
||||
remove (self);
|
||||
if ((@self.classname != "player") && (@self.classname != "bodyque")
|
||||
&& (@self.cnt == 50))
|
||||
remove (@self);
|
||||
}
|
||||
|
||||
rnd1 = self.velocity_x + (-10 + (random () * 20));
|
||||
rnd2 = self.velocity_y + (-10 + (random () * 20));
|
||||
rnd3 = self.velocity_z + (10 + (random () * 10));
|
||||
rnd1 = @self.velocity_x + (-10 + (random () * 20));
|
||||
rnd2 = @self.velocity_y + (-10 + (random () * 20));
|
||||
rnd3 = @self.velocity_z + (10 + (random () * 10));
|
||||
|
||||
if (rnd1 > 10)
|
||||
rnd1 = 5;
|
||||
|
@ -531,23 +531,23 @@ void() bubble_bob =
|
|||
if (rnd3 > 30)
|
||||
rnd3 = 25;
|
||||
|
||||
self.velocity_x = rnd1;
|
||||
self.velocity_y = rnd2;
|
||||
self.velocity_z = rnd3;
|
||||
@self.velocity_x = rnd1;
|
||||
@self.velocity_y = rnd2;
|
||||
@self.velocity_z = rnd3;
|
||||
|
||||
self.nextthink = time + 0.5;
|
||||
self.think = bubble_bob;
|
||||
@self.nextthink = time + 0.5;
|
||||
@self.think = bubble_bob;
|
||||
|
||||
// let some objects bob around at the surface
|
||||
if (self.classname != "bubble") { // cut down on the speed
|
||||
if (@self.classname != "bubble") { // cut down on the speed
|
||||
|
||||
self.velocity_x *= 0.5;
|
||||
self.velocity_y *= 0.5;
|
||||
self.velocity_z *= 0.5;
|
||||
@self.velocity_x *= 0.5;
|
||||
@self.velocity_y *= 0.5;
|
||||
@self.velocity_z *= 0.5;
|
||||
|
||||
// send it back down if origin clears the water
|
||||
if (pointcontents (self.origin) != CONTENT_WATER)
|
||||
self.velocity_z = -(self.velocity_z);
|
||||
if (pointcontents (@self.origin) != CONTENT_WATER)
|
||||
@self.velocity_z = -(@self.velocity_z);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -558,10 +558,10 @@ Just for the debugging level. Don't use
|
|||
*/
|
||||
void() viewthing =
|
||||
{
|
||||
self.movetype = MOVETYPE_NONE;
|
||||
self.solid = SOLID_NOT;
|
||||
@self.movetype = MOVETYPE_NONE;
|
||||
@self.solid = SOLID_NOT;
|
||||
precache_model ("progs/player.mdl");
|
||||
setmodel (self, "progs/player.mdl");
|
||||
setmodel (@self, "progs/player.mdl");
|
||||
};
|
||||
/*
|
||||
==============================================================================
|
||||
|
@ -570,42 +570,42 @@ SIMPLE BMODELS
|
|||
*/
|
||||
void() func_wall_use =
|
||||
{ // change to alternate textures
|
||||
self.frame = 1 - self.frame;
|
||||
@self.frame = 1 - @self.frame;
|
||||
};
|
||||
/*QUAKED func_wall (0 .5 .8) ?
|
||||
This is just a solid wall if not inhibitted
|
||||
*/
|
||||
void() func_wall =
|
||||
{
|
||||
self.angles = '0 0 0';
|
||||
self.movetype = MOVETYPE_PUSH; // so it doesn't get pushed by anything
|
||||
self.solid = SOLID_BSP;
|
||||
self.use = func_wall_use;
|
||||
setmodel (self, self.model);
|
||||
@self.angles = '0 0 0';
|
||||
@self.movetype = MOVETYPE_PUSH; // so it doesn't get pushed by anything
|
||||
@self.solid = SOLID_BSP;
|
||||
@self.use = func_wall_use;
|
||||
setmodel (@self, @self.model);
|
||||
};
|
||||
/*QUAKED func_illusionary (0 .5 .8) ?
|
||||
A simple entity that looks solid but lets you walk through it.
|
||||
*/
|
||||
void() func_illusionary =
|
||||
{
|
||||
self.angles = '0 0 0';
|
||||
self.movetype = MOVETYPE_NONE;
|
||||
self.solid = SOLID_NOT;
|
||||
setmodel (self, self.model);
|
||||
makestatic (self);
|
||||
@self.angles = '0 0 0';
|
||||
@self.movetype = MOVETYPE_NONE;
|
||||
@self.solid = SOLID_NOT;
|
||||
setmodel (@self, @self.model);
|
||||
makestatic (@self);
|
||||
};
|
||||
/*QUAKED func_episodegate (0 .5 .8) ? E1 E2 E3 E4
|
||||
This bmodel will appear if the episode has allready been completed, so players can't reenter it.
|
||||
*/
|
||||
void() func_episodegate =
|
||||
{
|
||||
if (!(serverflags & self.spawnflags))
|
||||
if (!(serverflags & @self.spawnflags))
|
||||
return; // can still enter episode
|
||||
self.angles = '0 0 0';
|
||||
self.movetype = MOVETYPE_PUSH; // so it doesn't get pushed by anything
|
||||
self.solid = SOLID_BSP;
|
||||
self.use = func_wall_use;
|
||||
setmodel (self, self.model);
|
||||
@self.angles = '0 0 0';
|
||||
@self.movetype = MOVETYPE_PUSH; // so it doesn't get pushed by anything
|
||||
@self.solid = SOLID_BSP;
|
||||
@self.use = func_wall_use;
|
||||
setmodel (@self, @self.model);
|
||||
};
|
||||
/*QUAKED func_bossgate (0 .5 .8) ?
|
||||
This bmodel appears unless players have all of the episode sigils.
|
||||
|
@ -614,11 +614,11 @@ void() func_bossgate =
|
|||
{
|
||||
if ( (serverflags & 15) == 15)
|
||||
return; // all episodes completed
|
||||
self.angles = '0 0 0';
|
||||
self.movetype = MOVETYPE_PUSH; // so it doesn't get pushed by anything
|
||||
self.solid = SOLID_BSP;
|
||||
self.use = func_wall_use;
|
||||
setmodel (self, self.model);
|
||||
@self.angles = '0 0 0';
|
||||
@self.movetype = MOVETYPE_PUSH; // so it doesn't get pushed by anything
|
||||
@self.solid = SOLID_BSP;
|
||||
@self.use = func_wall_use;
|
||||
setmodel (@self, @self.model);
|
||||
};
|
||||
//============================================================================
|
||||
/*QUAKED ambient_suck_wind (0.3 0.1 0.6) (-10 -10 -8) (10 10 8)
|
||||
|
@ -626,75 +626,75 @@ void() func_bossgate =
|
|||
void() ambient_suck_wind =
|
||||
{
|
||||
precache_sound ("ambience/suck1.wav");
|
||||
ambientsound (self.origin, "ambience/suck1.wav", 1, ATTN_STATIC);
|
||||
ambientsound (@self.origin, "ambience/suck1.wav", 1, ATTN_STATIC);
|
||||
};
|
||||
/*QUAKED ambient_drone (0.3 0.1 0.6) (-10 -10 -8) (10 10 8)
|
||||
*/
|
||||
void() ambient_drone =
|
||||
{
|
||||
precache_sound ("ambience/drone6.wav");
|
||||
ambientsound (self.origin, "ambience/drone6.wav", 0.5, ATTN_STATIC);
|
||||
ambientsound (@self.origin, "ambience/drone6.wav", 0.5, ATTN_STATIC);
|
||||
};
|
||||
/*QUAKED ambient_flouro_buzz (0.3 0.1 0.6) (-10 -10 -8) (10 10 8)
|
||||
*/
|
||||
void() ambient_flouro_buzz =
|
||||
{
|
||||
precache_sound ("ambience/buzz1.wav");
|
||||
ambientsound (self.origin, "ambience/buzz1.wav", 1, ATTN_STATIC);
|
||||
ambientsound (@self.origin, "ambience/buzz1.wav", 1, ATTN_STATIC);
|
||||
};
|
||||
/*QUAKED ambient_drip (0.3 0.1 0.6) (-10 -10 -8) (10 10 8)
|
||||
*/
|
||||
void() ambient_drip =
|
||||
{
|
||||
precache_sound ("ambience/drip1.wav");
|
||||
ambientsound (self.origin, "ambience/drip1.wav", 0.5, ATTN_STATIC);
|
||||
ambientsound (@self.origin, "ambience/drip1.wav", 0.5, ATTN_STATIC);
|
||||
};
|
||||
/*QUAKED ambient_comp_hum (0.3 0.1 0.6) (-10 -10 -8) (10 10 8)
|
||||
*/
|
||||
void() ambient_comp_hum =
|
||||
{
|
||||
precache_sound ("ambience/comp1.wav");
|
||||
ambientsound (self.origin, "ambience/comp1.wav", 1, ATTN_STATIC);
|
||||
ambientsound (@self.origin, "ambience/comp1.wav", 1, ATTN_STATIC);
|
||||
};
|
||||
/*QUAKED ambient_thunder (0.3 0.1 0.6) (-10 -10 -8) (10 10 8)
|
||||
*/
|
||||
void() ambient_thunder =
|
||||
{
|
||||
precache_sound ("ambience/thunder1.wav");
|
||||
ambientsound (self.origin, "ambience/thunder1.wav", 0.5, ATTN_STATIC);
|
||||
ambientsound (@self.origin, "ambience/thunder1.wav", 0.5, ATTN_STATIC);
|
||||
};
|
||||
/*QUAKED ambient_light_buzz (0.3 0.1 0.6) (-10 -10 -8) (10 10 8)
|
||||
*/
|
||||
void() ambient_light_buzz =
|
||||
{
|
||||
precache_sound ("ambience/fl_hum1.wav");
|
||||
ambientsound (self.origin, "ambience/fl_hum1.wav", 0.5, ATTN_STATIC);
|
||||
ambientsound (@self.origin, "ambience/fl_hum1.wav", 0.5, ATTN_STATIC);
|
||||
};
|
||||
/*QUAKED ambient_swamp1 (0.3 0.1 0.6) (-10 -10 -8) (10 10 8)
|
||||
*/
|
||||
void() ambient_swamp1 =
|
||||
{
|
||||
precache_sound ("ambience/swamp1.wav");
|
||||
ambientsound (self.origin, "ambience/swamp1.wav", 0.5, ATTN_STATIC);
|
||||
ambientsound (@self.origin, "ambience/swamp1.wav", 0.5, ATTN_STATIC);
|
||||
};
|
||||
/*QUAKED ambient_swamp2 (0.3 0.1 0.6) (-10 -10 -8) (10 10 8)
|
||||
*/
|
||||
void() ambient_swamp2 =
|
||||
{
|
||||
precache_sound ("ambience/swamp2.wav");
|
||||
ambientsound (self.origin, "ambience/swamp2.wav", 0.5, ATTN_STATIC);
|
||||
ambientsound (@self.origin, "ambience/swamp2.wav", 0.5, ATTN_STATIC);
|
||||
};
|
||||
//============================================================================
|
||||
void() noise_think =
|
||||
{
|
||||
self.nextthink = time + 0.5;
|
||||
sound (self, 1, "enforcer/enfire.wav", 1, ATTN_NORM);
|
||||
sound (self, 2, "enforcer/enfstop.wav", 1, ATTN_NORM);
|
||||
sound (self, 3, "enforcer/sight1.wav", 1, ATTN_NORM);
|
||||
sound (self, 4, "enforcer/sight2.wav", 1, ATTN_NORM);
|
||||
sound (self, 5, "enforcer/sight3.wav", 1, ATTN_NORM);
|
||||
sound (self, 6, "enforcer/sight4.wav", 1, ATTN_NORM);
|
||||
sound (self, 7, "enforcer/pain1.wav", 1, ATTN_NORM);
|
||||
@self.nextthink = time + 0.5;
|
||||
sound (@self, 1, "enforcer/enfire.wav", 1, ATTN_NORM);
|
||||
sound (@self, 2, "enforcer/enfstop.wav", 1, ATTN_NORM);
|
||||
sound (@self, 3, "enforcer/sight1.wav", 1, ATTN_NORM);
|
||||
sound (@self, 4, "enforcer/sight2.wav", 1, ATTN_NORM);
|
||||
sound (@self, 5, "enforcer/sight3.wav", 1, ATTN_NORM);
|
||||
sound (@self, 6, "enforcer/sight4.wav", 1, ATTN_NORM);
|
||||
sound (@self, 7, "enforcer/pain1.wav", 1, ATTN_NORM);
|
||||
};
|
||||
/*QUAKED misc_noisemaker (1 0.5 0) (-10 -10 -10) (10 10 10)
|
||||
For optimzation testing, starts a lot of sounds.
|
||||
|
@ -711,6 +711,6 @@ void() misc_noisemaker =
|
|||
precache_sound2 ("enforcer/pain2.wav");
|
||||
precache_sound2 ("enforcer/death1.wav");
|
||||
precache_sound2 ("enforcer/idle1.wav");
|
||||
self.nextthink = time + 0.1 + random();
|
||||
self.think = noise_think;
|
||||
@self.nextthink = time + 0.1 + random();
|
||||
@self.think = noise_think;
|
||||
};
|
||||
|
|
|
@ -18,11 +18,11 @@ void() SetObserverFOV =
|
|||
{
|
||||
local string ob_fov;
|
||||
|
||||
ob_fov = ftos(self.LMS_observer_fov);
|
||||
ob_fov = ftos(@self.LMS_observer_fov);
|
||||
|
||||
stuffcmd (self, "fov ");
|
||||
stuffcmd (self, ob_fov);
|
||||
stuffcmd (self, "\n");
|
||||
stuffcmd (@self, "fov ");
|
||||
stuffcmd (@self, ob_fov);
|
||||
stuffcmd (@self, "\n");
|
||||
};
|
||||
//POX v1.12 - Allows observers to use teleporters
|
||||
/*------------------
|
||||
|
@ -32,7 +32,7 @@ void (string destination) ObserverTeleportTouch =
|
|||
{
|
||||
local entity t;
|
||||
|
||||
if (self.teleport_time > time)
|
||||
if (@self.teleport_time > time)
|
||||
return;
|
||||
|
||||
t = find (world, targetname, destination);
|
||||
|
@ -40,14 +40,14 @@ void (string destination) ObserverTeleportTouch =
|
|||
if (!t)
|
||||
objerror ("couldn't find target");
|
||||
|
||||
setorigin (self, t.origin);
|
||||
self.angles = t.mangle;
|
||||
self.fixangle = 1; // turn this way immediately
|
||||
self.teleport_time = time + 1.7;//POX v1.2 increased this
|
||||
if (self.flags & FL_ONGROUND)
|
||||
self.flags = self.flags - FL_ONGROUND;
|
||||
self.velocity = v_forward * 300;
|
||||
self.flags = self.flags - self.flags & FL_ONGROUND;
|
||||
setorigin (@self, t.origin);
|
||||
@self.angles = t.mangle;
|
||||
@self.fixangle = 1; // turn this way immediately
|
||||
@self.teleport_time = time + 1.7;//POX v1.2 increased this
|
||||
if (@self.flags & FL_ONGROUND)
|
||||
@self.flags = @self.flags - FL_ONGROUND;
|
||||
@self.velocity = v_forward * 300;
|
||||
@self.flags = @self.flags - @self.flags & FL_ONGROUND;
|
||||
};
|
||||
/*------------------
|
||||
ObserverImpulses
|
||||
|
@ -56,90 +56,90 @@ Handels observer controls
|
|||
void() ObserverImpulses =
|
||||
{
|
||||
//Jump to a dm start point (Fire Button)
|
||||
if (self.button0)
|
||||
if (@self.button0)
|
||||
{
|
||||
self.goalentity = find(self.goalentity, classname, "info_player_deathmatch");
|
||||
@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)
|
||||
@self.goalentity = find(@self.goalentity, classname, "info_player_deathmatch");
|
||||
|
||||
if (self.goalentity != world)
|
||||
if (@self.goalentity != world)
|
||||
{
|
||||
setorigin(self, self.goalentity.origin);
|
||||
self.angles = self.goalentity.angles;
|
||||
self.fixangle = TRUE; // turn this way immediately
|
||||
setorigin(@self, @self.goalentity.origin);
|
||||
@self.angles = @self.goalentity.angles;
|
||||
@self.fixangle = TRUE; // turn this way immediately
|
||||
}
|
||||
}
|
||||
|
||||
//Jump into a player's position (Jump Button)
|
||||
if (self.button2)
|
||||
if (@self.button2)
|
||||
{
|
||||
self.goalentity = find(self.goalentity, classname, "player");
|
||||
@self.goalentity = find(@self.goalentity, classname, "player");
|
||||
|
||||
if (self.goalentity == world)
|
||||
self.goalentity = find(self.goalentity, classname, "player");
|
||||
if (@self.goalentity == world)
|
||||
@self.goalentity = find(@self.goalentity, classname, "player");
|
||||
|
||||
if (self.goalentity != world)
|
||||
if (@self.goalentity != world)
|
||||
{
|
||||
setorigin(self, self.goalentity.origin + '0 0 1');
|
||||
self.angles = self.goalentity.angles;
|
||||
self.fixangle = TRUE; // turn this way immediately
|
||||
setorigin(@self, @self.goalentity.origin + '0 0 1');
|
||||
@self.angles = @self.goalentity.angles;
|
||||
@self.fixangle = TRUE; // turn this way immediately
|
||||
}
|
||||
}
|
||||
|
||||
// POX v1.2 - added auto fov increase/decrease and reset impulses
|
||||
if (self.impulse == 1)
|
||||
if (@self.impulse == 1)
|
||||
{
|
||||
if (self.LMS_zoom == 1)
|
||||
self.LMS_zoom = FALSE;
|
||||
if (@self.LMS_zoom == 1)
|
||||
@self.LMS_zoom = FALSE;
|
||||
else
|
||||
self.LMS_zoom = 1;
|
||||
@self.LMS_zoom = 1;
|
||||
}
|
||||
|
||||
if (self.impulse == 2)
|
||||
if (@self.impulse == 2)
|
||||
{
|
||||
if (self.LMS_zoom == 2)
|
||||
self.LMS_zoom = FALSE;
|
||||
if (@self.LMS_zoom == 2)
|
||||
@self.LMS_zoom = FALSE;
|
||||
else
|
||||
self.LMS_zoom = 2;
|
||||
@self.LMS_zoom = 2;
|
||||
}
|
||||
|
||||
if (self.impulse == 3)
|
||||
if (@self.impulse == 3)
|
||||
{
|
||||
self.LMS_observer_fov = 90;
|
||||
self.LMS_zoom = FALSE;
|
||||
@self.LMS_observer_fov = 90;
|
||||
@self.LMS_zoom = FALSE;
|
||||
SetObserverFOV ();
|
||||
}
|
||||
|
||||
//Allow TargetId to be turned off
|
||||
if (self.impulse == 16)
|
||||
if (@self.impulse == 16)
|
||||
{
|
||||
if (self.target_id_toggle)
|
||||
if (@self.target_id_toggle)
|
||||
{
|
||||
self.target_id_toggle = FALSE;
|
||||
@self.target_id_toggle = FALSE;
|
||||
|
||||
//POX v1.12 - don't centerprint if a message is up
|
||||
if (self.target_id_finished < time)
|
||||
centerprint (self, "Target Identifier OFF\n");
|
||||
if (@self.target_id_finished < time)
|
||||
centerprint (@self, "Target Identifier OFF\n");
|
||||
else
|
||||
sprint (self, PRINT_HIGH, "Target Identifier OFF\n");
|
||||
sprint (@self, PRINT_HIGH, "Target Identifier OFF\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
self.target_id_toggle = TRUE;
|
||||
@self.target_id_toggle = TRUE;
|
||||
//POX v1.12 - don't centerprint if a message is up
|
||||
if (self.target_id_finished < time)
|
||||
centerprint (self, "Target Identifier ON\n");
|
||||
if (@self.target_id_finished < time)
|
||||
centerprint (@self, "Target Identifier ON\n");
|
||||
else
|
||||
sprint (self, PRINT_HIGH, "Target Identifier ON\n");
|
||||
sprint (@self, PRINT_HIGH, "Target Identifier ON\n");
|
||||
|
||||
self.target_id_finished = time + 3;
|
||||
@self.target_id_finished = time + 3;
|
||||
}
|
||||
}
|
||||
|
||||
self.impulse = 0;
|
||||
self.button0 = 0;
|
||||
self.button1 = 0;
|
||||
@self.impulse = 0;
|
||||
@self.button0 = 0;
|
||||
@self.button1 = 0;
|
||||
};
|
||||
/*------------------
|
||||
ObserverThink
|
||||
|
@ -150,22 +150,22 @@ void() ObserverThink =
|
|||
local entity tele; //POX v1.12
|
||||
|
||||
// POX v1.12 - display observer control instructions
|
||||
if (self.LMS_observer_time > time)
|
||||
if (@self.LMS_observer_time > time)
|
||||
{
|
||||
if (self.LMS_observer == 1)
|
||||
centerprint(self, "Last Man Standing game in progress...\n\nObserving till next round.");
|
||||
if (@self.LMS_observer == 1)
|
||||
centerprint(@self, "Last Man Standing game in progress...\n\nObserving till next round.");
|
||||
else //was eliminated
|
||||
centerprint (self, "You have been eliminated!\n\nObserving till next round.");
|
||||
self.target_id_finished = time + 0.1;
|
||||
centerprint (@self, "You have been eliminated!\n\nObserving till next round.");
|
||||
@self.target_id_finished = time + 0.1;
|
||||
}
|
||||
else if (self.LMS_observer_time + 7 > time)
|
||||
else if (@self.LMS_observer_time + 7 > time)
|
||||
{
|
||||
centerprint(self, "[FIRE] cycles through spawn points\n\n[JUMP] cycles through players\n\n[1] [2] zooms in/out, [3] resets zoom.");
|
||||
self.target_id_finished = time + 0.1;
|
||||
centerprint(@self, "[FIRE] cycles through spawn points\n\n[JUMP] cycles through players\n\n[1] [2] zooms in/out, [3] resets zoom.");
|
||||
@self.target_id_finished = time + 0.1;
|
||||
}
|
||||
|
||||
//POX v1.12 if touching a teleporter, go through it...
|
||||
tele = findradius(self.origin, 80);
|
||||
tele = findradius(@self.origin, 80);
|
||||
|
||||
while(tele)
|
||||
{
|
||||
|
@ -176,30 +176,30 @@ void() ObserverThink =
|
|||
}
|
||||
|
||||
//Update target identifier
|
||||
if (self.target_id_toggle && (time > self.target_id_finished))
|
||||
if (@self.target_id_toggle && (time > @self.target_id_finished))
|
||||
ID_CheckTarget ();
|
||||
|
||||
//POX v1.2 - Better fov control - first impulse starts to zoom, second stops it
|
||||
if (self.LMS_zoom == 1)
|
||||
if (@self.LMS_zoom == 1)
|
||||
{
|
||||
self.LMS_observer_fov = self.LMS_observer_fov - 1;
|
||||
@self.LMS_observer_fov = @self.LMS_observer_fov - 1;
|
||||
|
||||
if (self.LMS_observer_fov < 30)
|
||||
if (@self.LMS_observer_fov < 30)
|
||||
{
|
||||
self.LMS_zoom = FALSE;
|
||||
self.LMS_observer_fov = 30;
|
||||
@self.LMS_zoom = FALSE;
|
||||
@self.LMS_observer_fov = 30;
|
||||
}
|
||||
|
||||
SetObserverFOV ();
|
||||
}
|
||||
else if (self.LMS_zoom == 2)
|
||||
else if (@self.LMS_zoom == 2)
|
||||
{
|
||||
self.LMS_observer_fov = self.LMS_observer_fov + 1;
|
||||
@self.LMS_observer_fov = @self.LMS_observer_fov + 1;
|
||||
|
||||
if (self.LMS_observer_fov > 135)
|
||||
if (@self.LMS_observer_fov > 135)
|
||||
{
|
||||
self.LMS_zoom = FALSE;
|
||||
self.LMS_observer_fov = 135;
|
||||
@self.LMS_zoom = FALSE;
|
||||
@self.LMS_observer_fov = 135;
|
||||
}
|
||||
|
||||
SetObserverFOV ();
|
||||
|
@ -214,50 +214,50 @@ void() SpawnObserver =
|
|||
{
|
||||
local entity spot;
|
||||
|
||||
self.classname = "LMSobserver";
|
||||
self.health = 111;
|
||||
@self.classname = "LMSobserver";
|
||||
@self.health = 111;
|
||||
|
||||
self.takedamage = DAMAGE_NO;
|
||||
self.solid = SOLID_NOT;
|
||||
self.movetype = MOVETYPE_NOCLIP; //I think this is cheat protected....
|
||||
//self.flags = FL_CLIENT;
|
||||
self.super_damage_finished = 0;
|
||||
self.radsuit_finished = 0;
|
||||
self.invisible_finished = 0;
|
||||
self.invincible_finished = 0;
|
||||
self.effects = 0;
|
||||
self.invincible_time = 0;
|
||||
self.items = 0;
|
||||
self.ammo_shells = 0;
|
||||
self.ammo_nails = 0;
|
||||
self.ammo_rockets = 0;
|
||||
self.ammo_cells = 0;
|
||||
self.weapon = 0;
|
||||
self.armorvalue = 0;
|
||||
self.armortype = 0;
|
||||
self.deadflag = DEAD_NO;
|
||||
@self.takedamage = DAMAGE_NO;
|
||||
@self.solid = SOLID_NOT;
|
||||
@self.movetype = MOVETYPE_NOCLIP; //I think this is cheat protected....
|
||||
//@self.flags = FL_CLIENT;
|
||||
@self.super_damage_finished = 0;
|
||||
@self.radsuit_finished = 0;
|
||||
@self.invisible_finished = 0;
|
||||
@self.invincible_finished = 0;
|
||||
@self.effects = 0;
|
||||
@self.invincible_time = 0;
|
||||
@self.items = 0;
|
||||
@self.ammo_shells = 0;
|
||||
@self.ammo_nails = 0;
|
||||
@self.ammo_rockets = 0;
|
||||
@self.ammo_cells = 0;
|
||||
@self.weapon = 0;
|
||||
@self.armorvalue = 0;
|
||||
@self.armortype = 0;
|
||||
@self.deadflag = DEAD_NO;
|
||||
spot = SelectSpawnPoint ();
|
||||
self.origin = spot.origin + '0 0 1';
|
||||
self.angles = spot.angles;
|
||||
self.fixangle = TRUE; // turn this way immediately
|
||||
setmodel (self, string_null);
|
||||
self.weaponmodel = string_null;
|
||||
setsize (self, VEC_HULL_MIN, VEC_HULL_MAX);
|
||||
self.view_ofs = '0 0 22';
|
||||
self.velocity = '0 0 0';
|
||||
@self.origin = spot.origin + '0 0 1';
|
||||
@self.angles = spot.angles;
|
||||
@self.fixangle = TRUE; // turn this way immediately
|
||||
setmodel (@self, string_null);
|
||||
@self.weaponmodel = string_null;
|
||||
setsize (@self, VEC_HULL_MIN, VEC_HULL_MAX);
|
||||
@self.view_ofs = '0 0 22';
|
||||
@self.velocity = '0 0 0';
|
||||
|
||||
//POX v1.2 - had this as '==' (worked anyway :P)
|
||||
self.goalentity = world;
|
||||
@self.goalentity = world;
|
||||
|
||||
//POX v1.12
|
||||
if (self.LMS_registered) //This shouldn't happen but...
|
||||
if (@self.LMS_registered) //This shouldn't happen but...
|
||||
{
|
||||
self.LMS_registered = 0;
|
||||
@self.LMS_registered = 0;
|
||||
lms_plrcount = lms_plrcount - 1;
|
||||
}
|
||||
|
||||
self.LMS_observer_time = time + 3;
|
||||
self.LMS_observer_fov = 100;
|
||||
stuffcmd (self, "fov 100\n");
|
||||
self.target_id_toggle = TRUE; //POX v1.12 default to on
|
||||
@self.LMS_observer_time = time + 3;
|
||||
@self.LMS_observer_fov = 100;
|
||||
stuffcmd (@self, "fov 100\n");
|
||||
@self.target_id_toggle = TRUE; //POX v1.12 default to on
|
||||
};
|
||||
|
|
|
@ -20,22 +20,22 @@ void() plat_spawn_inside_trigger =
|
|||
trigger.touch = plat_center_touch;
|
||||
trigger.movetype = MOVETYPE_NONE;
|
||||
trigger.solid = SOLID_TRIGGER;
|
||||
trigger.enemy = self;
|
||||
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)
|
||||
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)
|
||||
if (@self.size_x <= 50)
|
||||
{
|
||||
tmin_x = (self.mins_x + self.maxs_x) / 2;
|
||||
tmin_x = (@self.mins_x + @self.maxs_x) / 2;
|
||||
tmax_x = tmin_x + 1;
|
||||
}
|
||||
if (self.size_y <= 50)
|
||||
if (@self.size_y <= 50)
|
||||
{
|
||||
tmin_y = (self.mins_y + self.maxs_y) / 2;
|
||||
tmin_y = (@self.mins_y + @self.maxs_y) / 2;
|
||||
tmax_y = tmin_y + 1;
|
||||
}
|
||||
|
||||
|
@ -43,27 +43,27 @@ void() plat_spawn_inside_trigger =
|
|||
};
|
||||
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;
|
||||
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;
|
||||
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);
|
||||
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);
|
||||
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 =
|
||||
{
|
||||
|
@ -72,11 +72,11 @@ void() plat_center_touch =
|
|||
|
||||
if (other.health <= 0)
|
||||
return;
|
||||
self = self.enemy;
|
||||
if (self.state == STATE_BOTTOM)
|
||||
@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
|
||||
else if (@self.state == STATE_TOP)
|
||||
@self.nextthink = @self.ltime + 1; // delay going down
|
||||
};
|
||||
void() plat_outside_touch =
|
||||
{
|
||||
|
@ -86,13 +86,13 @@ void() plat_outside_touch =
|
|||
return;
|
||||
|
||||
//dprint ("plat_outside_touch\n");
|
||||
self = self.enemy;
|
||||
if (self.state == STATE_TOP)
|
||||
@self = @self.enemy;
|
||||
if (@self.state == STATE_TOP)
|
||||
plat_go_down ();
|
||||
};
|
||||
void() plat_trigger_use =
|
||||
{
|
||||
if (self.think)
|
||||
if (@self.think)
|
||||
return; // allready activated
|
||||
plat_go_down();
|
||||
};
|
||||
|
@ -100,19 +100,19 @@ void() plat_crush =
|
|||
{
|
||||
//dprint ("plat_crush\n");
|
||||
other.deathtype = "squish";
|
||||
T_Damage (other, self, self, 1);
|
||||
T_Damage (other, @self, @self, 1);
|
||||
|
||||
if (self.state == STATE_UP)
|
||||
if (@self.state == STATE_UP)
|
||||
plat_go_down ();
|
||||
else if (self.state == STATE_DOWN)
|
||||
else if (@self.state == STATE_DOWN)
|
||||
plat_go_up ();
|
||||
else
|
||||
objerror ("plat_crush: bad self.state\n");
|
||||
objerror ("plat_crush: bad @self.state\n");
|
||||
};
|
||||
void() plat_use =
|
||||
{
|
||||
self.use = SUB_Null;
|
||||
if (self.state != STATE_UP)
|
||||
@self.use = SUB_Null;
|
||||
if (@self.state != STATE_UP)
|
||||
objerror ("plat_use: not in up state");
|
||||
plat_go_down();
|
||||
};
|
||||
|
@ -127,79 +127,79 @@ Set "sounds" to one of the following:
|
|||
*/
|
||||
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 = 3;// + POX - changed from 2
|
||||
if (!@self.t_length)
|
||||
@self.t_length = 80;
|
||||
if (!@self.t_width)
|
||||
@self.t_width = 10;
|
||||
if (@self.sounds == 0)
|
||||
@self.sounds = 3;// + POX - changed from 2
|
||||
// FIX THIS TO LOAD A GENERIC PLAT SOUND
|
||||
if (self.sounds == 1)
|
||||
if (@self.sounds == 1)
|
||||
{
|
||||
precache_sound ("plats/plat1.wav");
|
||||
precache_sound ("plats/plat2.wav");
|
||||
self.noise = "plats/plat1.wav";
|
||||
self.noise1 = "plats/plat2.wav";
|
||||
@self.noise = "plats/plat1.wav";
|
||||
@self.noise1 = "plats/plat2.wav";
|
||||
}
|
||||
if (self.sounds == 2)
|
||||
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.noise = "plats/medplat1.wav";
|
||||
@self.noise1 = "plats/medplat2.wav";
|
||||
}
|
||||
// + POX - more sounds
|
||||
if (self.sounds == 3)
|
||||
if (@self.sounds == 3)
|
||||
{
|
||||
precache_sound ("doors/hydro1.wav");
|
||||
precache_sound ("doors/hydro2.wav");
|
||||
self.noise = "doors/hydro1.wav";
|
||||
self.noise1 = "doors/hydro2.wav";
|
||||
@self.noise = "doors/hydro1.wav";
|
||||
@self.noise1 = "doors/hydro2.wav";
|
||||
}
|
||||
if (self.sounds == 4)
|
||||
if (@self.sounds == 4)
|
||||
{
|
||||
precache_sound ("doors/stndr1.wav");
|
||||
precache_sound ("doors/stndr2.wav");
|
||||
self.noise = "doors/stndr1.wav";
|
||||
self.noise1 = "doors/stndr2.wav";
|
||||
@self.noise = "doors/stndr1.wav";
|
||||
@self.noise1 = "doors/stndr2.wav";
|
||||
}
|
||||
if (self.sounds == 5)
|
||||
if (@self.sounds == 5)
|
||||
{
|
||||
precache_sound ("doors/ddoor1.wav");
|
||||
precache_sound ("doors/ddoor2.wav");
|
||||
self.noise = "doors/ddoor2.wav";
|
||||
self.noise1 = "doors/ddoor1.wav";
|
||||
@self.noise = "doors/ddoor2.wav";
|
||||
@self.noise1 = "doors/ddoor1.wav";
|
||||
}
|
||||
// - POX
|
||||
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;
|
||||
@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;
|
||||
@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;
|
||||
@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)
|
||||
if (@self.targetname)
|
||||
{
|
||||
self.state = STATE_UP;
|
||||
self.use = plat_use;
|
||||
@self.state = STATE_UP;
|
||||
@self.use = plat_use;
|
||||
}
|
||||
else
|
||||
{
|
||||
setorigin (self, self.pos2);
|
||||
self.state = STATE_BOTTOM;
|
||||
setorigin (@self, @self.pos2);
|
||||
@self.state = STATE_BOTTOM;
|
||||
}
|
||||
};
|
||||
//============================================================================
|
||||
|
@ -207,54 +207,54 @@ void() train_next;
|
|||
void() func_train_find;
|
||||
void() train_blocked =
|
||||
{
|
||||
if (time < self.attack_finished)
|
||||
if (time < @self.attack_finished)
|
||||
return;
|
||||
self.attack_finished = time + 0.5;
|
||||
@self.attack_finished = time + 0.5;
|
||||
other.deathtype = "squish";
|
||||
T_Damage (other, self, self, self.dmg);
|
||||
T_Damage (other, @self, @self, @self.dmg);
|
||||
};
|
||||
void() train_use =
|
||||
{
|
||||
if (self.think != func_train_find)
|
||||
if (@self.think != func_train_find)
|
||||
return; // already activated
|
||||
train_next();
|
||||
};
|
||||
void() train_wait =
|
||||
{
|
||||
if (self.wait)
|
||||
if (@self.wait)
|
||||
{
|
||||
self.nextthink = self.ltime + self.wait;
|
||||
sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self.noise, 1, ATTN_NORM);
|
||||
@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.nextthink = @self.ltime + 0.1;
|
||||
|
||||
self.think = train_next;
|
||||
@self.think = train_next;
|
||||
};
|
||||
void() train_next =
|
||||
{
|
||||
local entity targ;
|
||||
targ = find (world, targetname, self.target);
|
||||
self.target = targ.target;
|
||||
if (!self.target)
|
||||
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;
|
||||
@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);
|
||||
@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)
|
||||
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;
|
||||
@self.nextthink = @self.ltime + 0.1;
|
||||
@self.think = train_next;
|
||||
}
|
||||
};
|
||||
/*QUAKED func_train (0 .5 .8) ?
|
||||
|
@ -269,65 +269,65 @@ sounds
|
|||
*/
|
||||
void() func_train =
|
||||
{
|
||||
if (!self.speed)
|
||||
self.speed = 100;
|
||||
if (!self.target)
|
||||
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)
|
||||
if (!@self.dmg)
|
||||
@self.dmg = 2;
|
||||
if (@self.sounds == 0)
|
||||
{
|
||||
self.noise = ("misc/null.wav");
|
||||
@self.noise = ("misc/null.wav");
|
||||
precache_sound ("misc/null.wav");
|
||||
self.noise1 = ("misc/null.wav");
|
||||
@self.noise1 = ("misc/null.wav");
|
||||
precache_sound ("misc/null.wav");
|
||||
}
|
||||
if (self.sounds == 1)
|
||||
if (@self.sounds == 1)
|
||||
{
|
||||
self.noise = ("plats/train2.wav");
|
||||
@self.noise = ("plats/train2.wav");
|
||||
precache_sound ("plats/train2.wav");
|
||||
self.noise1 = ("plats/train1.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);
|
||||
@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;
|
||||
@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)
|
||||
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");
|
||||
@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");
|
||||
@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);
|
||||
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;
|
||||
@self.nextthink = @self.ltime + 0.1;
|
||||
@self.think = func_train_find;
|
||||
};
|
||||
|
|
|
@ -78,70 +78,70 @@ PLAYER
|
|||
void() player_run;
|
||||
void() player_stand1 = [$axstnd1, player_stand1]
|
||||
{
|
||||
self.weaponframe = 0;
|
||||
if (self.velocity_x || self.velocity_y) {
|
||||
self.walkframe = 0;
|
||||
@self.weaponframe = 0;
|
||||
if (@self.velocity_x || @self.velocity_y) {
|
||||
@self.walkframe = 0;
|
||||
player_run ();
|
||||
return;
|
||||
}
|
||||
|
||||
if (self.weapon == IT_AXE) {
|
||||
if (self.walkframe >= 12)
|
||||
self.walkframe = 0;
|
||||
self.frame = $axstnd1 + self.walkframe;
|
||||
if (@self.weapon == IT_AXE) {
|
||||
if (@self.walkframe >= 12)
|
||||
@self.walkframe = 0;
|
||||
@self.frame = $axstnd1 + @self.walkframe;
|
||||
} else {
|
||||
if (self.walkframe >= 5)
|
||||
self.walkframe = 0;
|
||||
self.frame = $stand1 + self.walkframe;
|
||||
if (@self.walkframe >= 5)
|
||||
@self.walkframe = 0;
|
||||
@self.frame = $stand1 + @self.walkframe;
|
||||
}
|
||||
self.walkframe++;
|
||||
@self.walkframe++;
|
||||
};
|
||||
|
||||
void() player_run = [$rockrun1, player_run]
|
||||
{
|
||||
self.weaponframe = 0;
|
||||
if (!self.velocity_x && !self.velocity_y) {
|
||||
self.walkframe = 0;
|
||||
@self.weaponframe = 0;
|
||||
if (!@self.velocity_x && !@self.velocity_y) {
|
||||
@self.walkframe = 0;
|
||||
player_stand1 ();
|
||||
return;
|
||||
}
|
||||
|
||||
if (self.weapon == IT_AXE) {
|
||||
if (self.walkframe == 6)
|
||||
self.walkframe = 0;
|
||||
self.frame = $axrun1 + self.walkframe;
|
||||
if (@self.weapon == IT_AXE) {
|
||||
if (@self.walkframe == 6)
|
||||
@self.walkframe = 0;
|
||||
@self.frame = $axrun1 + @self.walkframe;
|
||||
} else {
|
||||
if (self.walkframe == 6)
|
||||
self.walkframe = 0;
|
||||
self.frame = self.frame + self.walkframe;
|
||||
if (@self.walkframe == 6)
|
||||
@self.walkframe = 0;
|
||||
@self.frame = @self.frame + @self.walkframe;
|
||||
}
|
||||
|
||||
// footstep sounds
|
||||
self.spawnsilent += vlen (self.origin - self.old_velocity);
|
||||
self.old_velocity = self.origin;
|
||||
@self.spawnsilent += vlen (@self.origin - @self.old_velocity);
|
||||
@self.old_velocity = @self.origin;
|
||||
|
||||
if (self.waterlevel < 3 && self.classname == "player") { // no footsteps underwater or for observer
|
||||
if (self.spawnsilent > 95) {
|
||||
if (@self.waterlevel < 3 && @self.classname == "player") { // no footsteps underwater or for observer
|
||||
if (@self.spawnsilent > 95) {
|
||||
local float r;
|
||||
|
||||
if (self.spawnsilent > 190)
|
||||
self.spawnsilent = 0;
|
||||
if (@self.spawnsilent > 190)
|
||||
@self.spawnsilent = 0;
|
||||
else
|
||||
self.spawnsilent = 0.5 * (self.spawnsilent - 95);
|
||||
@self.spawnsilent = 0.5 * (@self.spawnsilent - 95);
|
||||
|
||||
r = random ();
|
||||
|
||||
if (self.waterlevel) {
|
||||
if (@self.waterlevel) {
|
||||
if (r < 0.25)
|
||||
sound (self, CHAN_AUTO, "misc/water1.wav", 1, ATTN_NORM);
|
||||
sound (@self, CHAN_AUTO, "misc/water1.wav", 1, ATTN_NORM);
|
||||
else if (r < 0.5)
|
||||
sound (self, CHAN_AUTO, "misc/water2.wav", 1, ATTN_NORM);
|
||||
sound (@self, CHAN_AUTO, "misc/water2.wav", 1, ATTN_NORM);
|
||||
else if (r < 0.75)
|
||||
sound (self, CHAN_AUTO, "misc/owater2.wav", 0.75, ATTN_NORM);
|
||||
} else if (self.flags & FL_ONGROUND) {
|
||||
sound (@self, CHAN_AUTO, "misc/owater2.wav", 0.75, ATTN_NORM);
|
||||
} else if (@self.flags & FL_ONGROUND) {
|
||||
local float speed, vol;
|
||||
|
||||
speed = vlen (self.velocity);
|
||||
speed = vlen (@self.velocity);
|
||||
vol = speed * 0.002; // Scale footstep volume by speed
|
||||
if (vol > 1)
|
||||
vol = 1;
|
||||
|
@ -149,244 +149,244 @@ void() player_run = [$rockrun1, player_run]
|
|||
return; // don't make a sound
|
||||
|
||||
if (r < 0.25)
|
||||
sound (self, CHAN_AUTO, "misc/foot1.wav", vol, ATTN_NORM);
|
||||
sound (@self, CHAN_AUTO, "misc/foot1.wav", vol, ATTN_NORM);
|
||||
else if (r < 0.5)
|
||||
sound (self, CHAN_AUTO, "misc/foot2.wav", vol, ATTN_NORM);
|
||||
sound (@self, CHAN_AUTO, "misc/foot2.wav", vol, ATTN_NORM);
|
||||
else if (r < 0.75)
|
||||
sound (self, CHAN_AUTO, "misc/foot3.wav", vol, ATTN_NORM);
|
||||
sound (@self, CHAN_AUTO, "misc/foot3.wav", vol, ATTN_NORM);
|
||||
else
|
||||
sound (self, CHAN_AUTO, "misc/foot4.wav", vol, ATTN_NORM);
|
||||
sound (@self, CHAN_AUTO, "misc/foot4.wav", vol, ATTN_NORM);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self.walkframe++;
|
||||
@self.walkframe++;
|
||||
};
|
||||
|
||||
void () muzzleflash =
|
||||
{
|
||||
WriteByte (MSG_MULTICAST, SVC_MUZZLEFLASH);
|
||||
WriteEntity (MSG_MULTICAST, self);
|
||||
multicast (self.origin, MULTICAST_PVS);
|
||||
WriteEntity (MSG_MULTICAST, @self);
|
||||
multicast (@self.origin, MULTICAST_PVS);
|
||||
};
|
||||
|
||||
// POX - used for tShot and ComboGun primary triggers
|
||||
void() player_shot1 = [$shotatt1, player_shot2]
|
||||
{
|
||||
self.weaponframe = 1;
|
||||
@self.weaponframe = 1;
|
||||
muzzleflash ();
|
||||
};
|
||||
|
||||
void() player_shot2 = [$shotatt2, player_shot3] {self.weaponframe = 2;};
|
||||
void() player_shot3 = [$shotatt3, player_shot4] {self.weaponframe = 3;};
|
||||
void() player_shot4 = [$shotatt4, player_shot5] {self.weaponframe = 4;};
|
||||
void() player_shot5 = [$shotatt5, player_shot6] {self.weaponframe = 5;};
|
||||
void() player_shot6 = [$shotatt6, player_run] {self.weaponframe = 6;};
|
||||
void() player_shot2 = [$shotatt2, player_shot3] {@self.weaponframe = 2;};
|
||||
void() player_shot3 = [$shotatt3, player_shot4] {@self.weaponframe = 3;};
|
||||
void() player_shot4 = [$shotatt4, player_shot5] {@self.weaponframe = 4;};
|
||||
void() player_shot5 = [$shotatt5, player_shot6] {@self.weaponframe = 5;};
|
||||
void() player_shot6 = [$shotatt6, player_run] {@self.weaponframe = 6;};
|
||||
|
||||
// POX - New Frame Macro For tShot 3 barrel fire
|
||||
void() player_tshot1 = [$shotatt1, player_tshot2] {self.weaponframe = 1; muzzleflash();};
|
||||
void() player_tshot2 = [$shotatt2, player_tshot3] {self.weaponframe = 16;}; // triple flare frame
|
||||
void() player_tshot3 = [$shotatt3, player_tshot4] {self.weaponframe = 3;};
|
||||
void() player_tshot4 = [$shotatt4, player_tshot5] {self.weaponframe = 4;};
|
||||
void() player_tshot5 = [$shotatt5, player_tshot6] {self.weaponframe = 5;};
|
||||
void() player_tshot6 = [$shotatt6, player_run] {self.weaponframe = 6;};
|
||||
void() player_tshot1 = [$shotatt1, player_tshot2] {@self.weaponframe = 1; muzzleflash();};
|
||||
void() player_tshot2 = [$shotatt2, player_tshot3] {@self.weaponframe = 16;}; // triple flare frame
|
||||
void() player_tshot3 = [$shotatt3, player_tshot4] {@self.weaponframe = 3;};
|
||||
void() player_tshot4 = [$shotatt4, player_tshot5] {@self.weaponframe = 4;};
|
||||
void() player_tshot5 = [$shotatt5, player_tshot6] {@self.weaponframe = 5;};
|
||||
void() player_tshot6 = [$shotatt6, player_run] {@self.weaponframe = 6;};
|
||||
|
||||
// POX - New Frame Macro For tShot 3 barrel prime
|
||||
void() player_reshot1 = [$shotatt1, player_reshot2] {self.weaponframe = 7;};
|
||||
void() player_reshot2 = [$shotatt3, player_reshot3] {self.weaponframe = 8;};
|
||||
void() player_reshot3 = [$shotatt4, player_reshot4] {self.weaponframe = 9;};
|
||||
void() player_reshot4 = [$shotatt5, player_reshot5] {self.weaponframe = 10;};
|
||||
void() player_reshot5 = [$shotatt6, player_reshot6] {self.weaponframe = 11;};
|
||||
void() player_reshot6 = [$shotatt5, player_reshot7] {self.weaponframe = 12;};
|
||||
void() player_reshot7 = [$shotatt4, player_reshot8] {self.weaponframe = 13;};
|
||||
void() player_reshot8 = [$shotatt3, player_reshot9] {self.weaponframe = 14;};
|
||||
void() player_reshot9 = [$shotatt1, player_run] {self.weaponframe = 15;};
|
||||
void() player_reshot1 = [$shotatt1, player_reshot2] {@self.weaponframe = 7;};
|
||||
void() player_reshot2 = [$shotatt3, player_reshot3] {@self.weaponframe = 8;};
|
||||
void() player_reshot3 = [$shotatt4, player_reshot4] {@self.weaponframe = 9;};
|
||||
void() player_reshot4 = [$shotatt5, player_reshot5] {@self.weaponframe = 10;};
|
||||
void() player_reshot5 = [$shotatt6, player_reshot6] {@self.weaponframe = 11;};
|
||||
void() player_reshot6 = [$shotatt5, player_reshot7] {@self.weaponframe = 12;};
|
||||
void() player_reshot7 = [$shotatt4, player_reshot8] {@self.weaponframe = 13;};
|
||||
void() player_reshot8 = [$shotatt3, player_reshot9] {@self.weaponframe = 14;};
|
||||
void() player_reshot9 = [$shotatt1, player_run] {@self.weaponframe = 15;};
|
||||
|
||||
// POX - New Frame Macro For ComboGun Second Trigger (Impact Grenades)
|
||||
void() player_gshot1 = [$shotatt1, player_gshot2] {self.weaponframe = 2; muzzleflash();};
|
||||
void() player_gshot2 = [$shotatt2, player_gshot3] {self.weaponframe = 3;};
|
||||
void() player_gshot3 = [$shotatt3, player_gshot4] {self.weaponframe = 4;};
|
||||
void() player_gshot4 = [$shotatt4, player_gshot5] {self.weaponframe = 5;};
|
||||
void() player_gshot5 = [$shotatt5, player_run] {self.weaponframe = 6;};
|
||||
void() player_gshot1 = [$shotatt1, player_gshot2] {@self.weaponframe = 2; muzzleflash();};
|
||||
void() player_gshot2 = [$shotatt2, player_gshot3] {@self.weaponframe = 3;};
|
||||
void() player_gshot3 = [$shotatt3, player_gshot4] {@self.weaponframe = 4;};
|
||||
void() player_gshot4 = [$shotatt4, player_gshot5] {@self.weaponframe = 5;};
|
||||
void() player_gshot5 = [$shotatt5, player_run] {@self.weaponframe = 6;};
|
||||
|
||||
// POX - New Frame Macro For Nailgun Second Trigger (Shrapnel Bomb)
|
||||
void() player_shrap1 = [$nailatt1, player_shrap2] {muzzleflash ();};
|
||||
void() player_shrap2 = [$nailatt2, player_run] {};
|
||||
|
||||
void() player_axe1 = [$axatt1, player_axe2] {self.weaponframe=1;};
|
||||
void() player_axe2 = [$axatt2, player_axe3] {self.weaponframe=2;};
|
||||
void() player_axe3 = [$axatt3, player_axe4] {self.weaponframe=3;W_FireAxe();};
|
||||
void() player_axe4 = [$axatt4, player_run] {self.weaponframe=4;};
|
||||
void() player_axe1 = [$axatt1, player_axe2] {@self.weaponframe=1;};
|
||||
void() player_axe2 = [$axatt2, player_axe3] {@self.weaponframe=2;};
|
||||
void() player_axe3 = [$axatt3, player_axe4] {@self.weaponframe=3;W_FireAxe();};
|
||||
void() player_axe4 = [$axatt4, player_run] {@self.weaponframe=4;};
|
||||
|
||||
void() player_axeb1 = [$axattb1, player_axeb2] {self.weaponframe=5;};
|
||||
void() player_axeb2 = [$axattb2, player_axeb3] {self.weaponframe=6;};
|
||||
void() player_axeb3 = [$axattb3, player_axeb4] {self.weaponframe=7;W_FireAxe();};
|
||||
void() player_axeb4 = [$axattb4, player_run] {self.weaponframe=8;};
|
||||
void() player_axeb1 = [$axattb1, player_axeb2] {@self.weaponframe=5;};
|
||||
void() player_axeb2 = [$axattb2, player_axeb3] {@self.weaponframe=6;};
|
||||
void() player_axeb3 = [$axattb3, player_axeb4] {@self.weaponframe=7;W_FireAxe();};
|
||||
void() player_axeb4 = [$axattb4, player_run] {@self.weaponframe=8;};
|
||||
|
||||
void() player_axec1 = [$axattc1, player_axec2] {self.weaponframe=1;};
|
||||
void() player_axec2 = [$axattc2, player_axec3] {self.weaponframe=2;};
|
||||
void() player_axec3 = [$axattc3, player_axec4] {self.weaponframe=3;W_FireAxe();};
|
||||
void() player_axec4 = [$axattc4, player_run] {self.weaponframe=4;};
|
||||
void() player_axec1 = [$axattc1, player_axec2] {@self.weaponframe=1;};
|
||||
void() player_axec2 = [$axattc2, player_axec3] {@self.weaponframe=2;};
|
||||
void() player_axec3 = [$axattc3, player_axec4] {@self.weaponframe=3;W_FireAxe();};
|
||||
void() player_axec4 = [$axattc4, player_run] {@self.weaponframe=4;};
|
||||
|
||||
void() player_axed1 = [$axattd1, player_axed2] {self.weaponframe=5;};
|
||||
void() player_axed2 = [$axattd2, player_axed3] {self.weaponframe=6;};
|
||||
void() player_axed3 = [$axattd3, player_axed4] {self.weaponframe=7;W_FireAxe();};
|
||||
void() player_axed4 = [$axattd4, player_run] {self.weaponframe=8;};
|
||||
void() player_axed1 = [$axattd1, player_axed2] {@self.weaponframe=5;};
|
||||
void() player_axed2 = [$axattd2, player_axed3] {@self.weaponframe=6;};
|
||||
void() player_axed3 = [$axattd3, player_axed4] {@self.weaponframe=7;W_FireAxe();};
|
||||
void() player_axed4 = [$axattd4, player_run] {@self.weaponframe=8;};
|
||||
|
||||
// NailGun animation
|
||||
void() player_nail1 = [$nailatt1, player_nail2]
|
||||
{
|
||||
if (self.st_nailgun > time)
|
||||
if (@self.st_nailgun > time)
|
||||
return;
|
||||
|
||||
if (self.ammo_nails < 1) {
|
||||
sound (self, CHAN_WEAPON, "weapons/mfire1.wav", 1, ATTN_NORM);
|
||||
self.st_nailgun = time + 0.4;
|
||||
if (@self.ammo_nails < 1) {
|
||||
sound (@self, CHAN_WEAPON, "weapons/mfire1.wav", 1, ATTN_NORM);
|
||||
@self.st_nailgun = time + 0.4;
|
||||
player_run ();
|
||||
return;
|
||||
}
|
||||
|
||||
muzzleflash ();
|
||||
|
||||
if (!self.button0) {
|
||||
if (!@self.button0) {
|
||||
player_run ();
|
||||
return;
|
||||
}
|
||||
|
||||
if (++self.weaponframe == 9)
|
||||
self.weaponframe = 1;
|
||||
if (++@self.weaponframe == 9)
|
||||
@self.weaponframe = 1;
|
||||
|
||||
SuperDamageSound ();
|
||||
W_FireNails (3);
|
||||
|
||||
if (self.flags & FL_ONGROUND)
|
||||
self.velocity += v_forward * -20;
|
||||
if (@self.flags & FL_ONGROUND)
|
||||
@self.velocity += v_forward * -20;
|
||||
|
||||
self.st_nailgun = time + 0.1;
|
||||
@self.st_nailgun = time + 0.1;
|
||||
};
|
||||
|
||||
void() player_nail2 = [$nailatt2, player_nail1]
|
||||
{
|
||||
if (self.st_nailgun > time)
|
||||
if (@self.st_nailgun > time)
|
||||
return;
|
||||
|
||||
if (self.ammo_nails < 1) {
|
||||
sound (self, CHAN_WEAPON, "weapons/mfire1.wav", 1, ATTN_NORM);
|
||||
self.st_nailgun = time + 0.4;
|
||||
if (@self.ammo_nails < 1) {
|
||||
sound (@self, CHAN_WEAPON, "weapons/mfire1.wav", 1, ATTN_NORM);
|
||||
@self.st_nailgun = time + 0.4;
|
||||
player_run ();
|
||||
return;
|
||||
}
|
||||
|
||||
muzzleflash ();
|
||||
if (!self.button0) {
|
||||
if (!@self.button0) {
|
||||
player_run ();
|
||||
return;
|
||||
}
|
||||
|
||||
if (++self.weaponframe == 9)
|
||||
self.weaponframe = 1;
|
||||
if (++@self.weaponframe == 9)
|
||||
@self.weaponframe = 1;
|
||||
|
||||
SuperDamageSound();
|
||||
W_FireNails (-3);
|
||||
|
||||
if (self.flags & FL_ONGROUND)
|
||||
self.velocity += v_forward * -20;
|
||||
if (@self.flags & FL_ONGROUND)
|
||||
@self.velocity += v_forward * -20;
|
||||
|
||||
self.st_nailgun = time + 0.1;
|
||||
@self.st_nailgun = time + 0.1;
|
||||
};
|
||||
|
||||
//============================================================================
|
||||
// POX - PlasmaGun animation - In sync with Paroxysm v1.1
|
||||
void() player_plasma1 =[$nailatt1, player_plasma2 ]
|
||||
{
|
||||
if (self.st_plasma > time)
|
||||
if (@self.st_plasma > time)
|
||||
return;
|
||||
|
||||
if (self.ammo_cells < 1) {
|
||||
sound (self, CHAN_WEAPON, "weapons/mfire2.wav", 1, ATTN_NORM);
|
||||
if (@self.ammo_cells < 1) {
|
||||
sound (@self, CHAN_WEAPON, "weapons/mfire2.wav", 1, ATTN_NORM);
|
||||
player_run ();
|
||||
self.st_plasma = time + 0.4;
|
||||
@self.st_plasma = time + 0.4;
|
||||
return;
|
||||
}
|
||||
|
||||
muzzleflash ();
|
||||
|
||||
if (!self.button0) {
|
||||
if (!@self.button0) {
|
||||
player_run ();
|
||||
return;
|
||||
}
|
||||
|
||||
self.weaponframe = 1;
|
||||
self.LorR = 1;
|
||||
@self.weaponframe = 1;
|
||||
@self.LorR = 1;
|
||||
|
||||
SuperDamageSound ();
|
||||
W_FirePlasma (6);
|
||||
|
||||
if (self.flags & FL_ONGROUND)
|
||||
self.velocity += v_forward * -20;
|
||||
if (@self.flags & FL_ONGROUND)
|
||||
@self.velocity += v_forward * -20;
|
||||
|
||||
self.st_plasma = time + 0.1;
|
||||
@self.st_plasma = time + 0.1;
|
||||
};
|
||||
|
||||
void() player_plasma2 =[$nailatt2, player_plasma1 ]
|
||||
{
|
||||
if (self.st_plasma > time)
|
||||
if (@self.st_plasma > time)
|
||||
return;
|
||||
|
||||
if (self.ammo_cells < 1) {
|
||||
sound (self, CHAN_WEAPON, "weapons/mfire2.wav", 1, ATTN_NORM);
|
||||
if (@self.ammo_cells < 1) {
|
||||
sound (@self, CHAN_WEAPON, "weapons/mfire2.wav", 1, ATTN_NORM);
|
||||
player_run ();
|
||||
self.st_plasma = time + 0.4;
|
||||
@self.st_plasma = time + 0.4;
|
||||
return;
|
||||
}
|
||||
|
||||
muzzleflash ();
|
||||
|
||||
if (!self.button0) {
|
||||
if (!@self.button0) {
|
||||
player_run ();
|
||||
return;
|
||||
}
|
||||
|
||||
self.weaponframe = 2;
|
||||
self.LorR = 0;
|
||||
@self.weaponframe = 2;
|
||||
@self.LorR = 0;
|
||||
|
||||
SuperDamageSound();
|
||||
W_FirePlasma (-7);
|
||||
|
||||
if (self.flags & FL_ONGROUND)
|
||||
self.velocity += v_forward * -20;
|
||||
if (@self.flags & FL_ONGROUND)
|
||||
@self.velocity += v_forward * -20;
|
||||
|
||||
self.st_plasma = time + 0.1;
|
||||
@self.st_plasma = time + 0.1;
|
||||
};
|
||||
|
||||
//============================================================================
|
||||
// POX - MegaPlasma Burst
|
||||
void() player_mplasma1 =[$rockatt1, player_mplasma2 ] {self.weaponframe=0;};
|
||||
void() player_mplasma1 =[$rockatt1, player_mplasma2 ] {@self.weaponframe=0;};
|
||||
void() player_mplasma2 =[$rockatt2, player_mplasma3 ] {};
|
||||
void() player_mplasma3 =[$rockatt3, player_run ] {};
|
||||
|
||||
// POX - Grenadelauncher Animation
|
||||
void() player_grenade1 =[$rockatt1, player_grenade2 ] {self.weaponframe=1;muzzleflash();};
|
||||
void() player_grenade2 =[$rockatt2, player_grenade3 ] {self.weaponframe=2;};
|
||||
void() player_grenade3 =[$rockatt3, player_grenade4 ] {self.weaponframe=3;};
|
||||
void() player_grenade4 =[$rockatt4, player_grenade5 ] {self.weaponframe=4;};
|
||||
void() player_grenade5 =[$rockatt5, player_grenade6 ] {self.weaponframe=5;};
|
||||
void() player_grenade6 =[$rockatt6, player_run ] {self.weaponframe=6;};
|
||||
void() player_grenade1 =[$rockatt1, player_grenade2 ] {@self.weaponframe=1;muzzleflash();};
|
||||
void() player_grenade2 =[$rockatt2, player_grenade3 ] {@self.weaponframe=2;};
|
||||
void() player_grenade3 =[$rockatt3, player_grenade4 ] {@self.weaponframe=3;};
|
||||
void() player_grenade4 =[$rockatt4, player_grenade5 ] {@self.weaponframe=4;};
|
||||
void() player_grenade5 =[$rockatt5, player_grenade6 ] {@self.weaponframe=5;};
|
||||
void() player_grenade6 =[$rockatt6, player_run ] {@self.weaponframe=6;};
|
||||
|
||||
// POX - Annihilator firing sequence
|
||||
void() player_rocket1 = [$rockatt1, player_rocket2]
|
||||
{
|
||||
|
||||
self.weaponframe = 1;
|
||||
@self.weaponframe = 1;
|
||||
W_FireRocket ('0 0 16');
|
||||
|
||||
// sound is timed for double shot (two single shot sounds had inconsistant results)
|
||||
sound (self, CHAN_WEAPON, "weapons/rhino.wav", 1, ATTN_NORM);
|
||||
sound (@self, CHAN_WEAPON, "weapons/rhino.wav", 1, ATTN_NORM);
|
||||
|
||||
if (self.flags & FL_ONGROUND)
|
||||
self.velocity = v_forward * -25;
|
||||
if (@self.flags & FL_ONGROUND)
|
||||
@self.velocity = v_forward * -25;
|
||||
|
||||
msg_entity = self;
|
||||
msg_entity = @self;
|
||||
|
||||
WriteByte (MSG_ONE, SVC_BIGKICK);
|
||||
|
||||
|
@ -395,19 +395,19 @@ void() player_rocket1 = [$rockatt1, player_rocket2]
|
|||
|
||||
void() player_rocket2 = [$rockatt2, player_rocket3]
|
||||
{
|
||||
self.weaponframe = 2;
|
||||
@self.weaponframe = 2;
|
||||
W_FireRocket('0 0 24');
|
||||
};
|
||||
|
||||
void() player_rocket3 = [$rockatt3, player_run ] {self.weaponframe=3;};
|
||||
void() player_rocket3 = [$rockatt3, player_run ] {@self.weaponframe=3;};
|
||||
|
||||
// POX - Annihilator Reload sequence
|
||||
void() player_rocketload1 = [$rockatt1, player_rocketload2] {self.weaponframe = 4;};
|
||||
void() player_rocketload2 = [$rockatt3, player_rocketload3] {self.weaponframe = 5;};
|
||||
void() player_rocketload3 = [$rockatt4, player_rocketload4] {self.weaponframe = 6;};
|
||||
void() player_rocketload4 = [$rockatt5, player_rocketload5] {self.weaponframe = 7;};
|
||||
void() player_rocketload5 = [$rockatt6, player_rocketload6] {self.weaponframe = 8;};
|
||||
void() player_rocketload6 = [$rockatt4, player_run] {self.weaponframe = 9;};
|
||||
void() player_rocketload1 = [$rockatt1, player_rocketload2] {@self.weaponframe = 4;};
|
||||
void() player_rocketload2 = [$rockatt3, player_rocketload3] {@self.weaponframe = 5;};
|
||||
void() player_rocketload3 = [$rockatt4, player_rocketload4] {@self.weaponframe = 6;};
|
||||
void() player_rocketload4 = [$rockatt5, player_rocketload5] {@self.weaponframe = 7;};
|
||||
void() player_rocketload5 = [$rockatt6, player_rocketload6] {@self.weaponframe = 8;};
|
||||
void() player_rocketload6 = [$rockatt4, player_run] {@self.weaponframe = 9;};
|
||||
|
||||
void (float num_bubbles) DeathBubbles;
|
||||
|
||||
|
@ -415,85 +415,85 @@ void() PainSound =
|
|||
{
|
||||
local float rs = random ();
|
||||
|
||||
if (self.health < 0)
|
||||
if (@self.health < 0)
|
||||
return;
|
||||
|
||||
if (damage_attacker.classname == "teledeath") {
|
||||
sound (self, CHAN_VOICE, "player/teledth1.wav", 1, ATTN_NONE);
|
||||
sound (@self, CHAN_VOICE, "player/teledth1.wav", 1, ATTN_NONE);
|
||||
return;
|
||||
}
|
||||
|
||||
// water pain sounds
|
||||
if (self.watertype == CONTENT_WATER && self.waterlevel == 3) {
|
||||
if (@self.watertype == CONTENT_WATER && @self.waterlevel == 3) {
|
||||
DeathBubbles (1);
|
||||
|
||||
if (rs > 0.5)
|
||||
sound (self, CHAN_VOICE, "player/drown1.wav", 1, ATTN_NORM);
|
||||
sound (@self, CHAN_VOICE, "player/drown1.wav", 1, ATTN_NORM);
|
||||
else
|
||||
sound (self, CHAN_VOICE, "player/drown2.wav", 1, ATTN_NORM);
|
||||
sound (@self, CHAN_VOICE, "player/drown2.wav", 1, ATTN_NORM);
|
||||
return;
|
||||
}
|
||||
|
||||
if (self.watertype == CONTENT_SLIME) { // slime pain sounds
|
||||
if (@self.watertype == CONTENT_SLIME) { // slime pain sounds
|
||||
// FIXME: put in some steam here
|
||||
if (rs > 0.5)
|
||||
sound (self, CHAN_VOICE, "player/lburn1.wav", 1, ATTN_NORM);
|
||||
sound (@self, CHAN_VOICE, "player/lburn1.wav", 1, ATTN_NORM);
|
||||
else
|
||||
sound (self, CHAN_VOICE, "player/lburn2.wav", 1, ATTN_NORM);
|
||||
sound (@self, CHAN_VOICE, "player/lburn2.wav", 1, ATTN_NORM);
|
||||
return;
|
||||
}
|
||||
|
||||
if (self.watertype == CONTENT_LAVA) {
|
||||
if (@self.watertype == CONTENT_LAVA) {
|
||||
if (rs > 0.5)
|
||||
sound (self, CHAN_VOICE, "player/lburn1.wav", 1, ATTN_NORM);
|
||||
sound (@self, CHAN_VOICE, "player/lburn1.wav", 1, ATTN_NORM);
|
||||
else
|
||||
sound (self, CHAN_VOICE, "player/lburn2.wav", 1, ATTN_NORM);
|
||||
sound (@self, CHAN_VOICE, "player/lburn2.wav", 1, ATTN_NORM);
|
||||
return;
|
||||
}
|
||||
|
||||
if (self.pain_finished > time) {
|
||||
self.axhitme = 0;
|
||||
if (@self.pain_finished > time) {
|
||||
@self.axhitme = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
self.pain_finished = time + 0.5;
|
||||
@self.pain_finished = time + 0.5;
|
||||
|
||||
// don't make multiple pain sounds right after each other
|
||||
|
||||
if (self.axhitme == 1) { // axe pain sound
|
||||
self.axhitme = 0;
|
||||
sound (self, CHAN_VOICE, "player/axhit1.wav", 1, ATTN_NORM);
|
||||
if (@self.axhitme == 1) { // axe pain sound
|
||||
@self.axhitme = 0;
|
||||
sound (@self, CHAN_VOICE, "player/axhit1.wav", 1, ATTN_NORM);
|
||||
return;
|
||||
}
|
||||
|
||||
rs = rint ((random () * 5) + 1);
|
||||
self.noise = "";
|
||||
@self.noise = "";
|
||||
|
||||
if (rs == 1)
|
||||
self.noise = "player/pain1.wav";
|
||||
@self.noise = "player/pain1.wav";
|
||||
else if (rs == 2)
|
||||
self.noise = "player/pain2.wav";
|
||||
@self.noise = "player/pain2.wav";
|
||||
else if (rs == 3)
|
||||
self.noise = "player/pain3.wav";
|
||||
@self.noise = "player/pain3.wav";
|
||||
else if (rs == 4)
|
||||
self.noise = "player/pain4.wav";
|
||||
@self.noise = "player/pain4.wav";
|
||||
else if (rs == 5)
|
||||
self.noise = "player/pain5.wav";
|
||||
@self.noise = "player/pain5.wav";
|
||||
else
|
||||
self.noise = "player/pain6.wav";
|
||||
@self.noise = "player/pain6.wav";
|
||||
|
||||
sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
|
||||
sound (@self, CHAN_VOICE, @self.noise, 1, ATTN_NORM);
|
||||
return;
|
||||
};
|
||||
|
||||
void() player_pain1 = [$pain1, player_pain2] {PainSound (); self.weaponframe = 0;};
|
||||
void() player_pain1 = [$pain1, player_pain2] {PainSound (); @self.weaponframe = 0;};
|
||||
void() player_pain2 = [$pain2, player_pain3] {};
|
||||
void() player_pain3 = [$pain3, player_pain4] {};
|
||||
void() player_pain4 = [$pain4, player_pain5] {};
|
||||
void() player_pain5 = [$pain5, player_pain6] {};
|
||||
void() player_pain6 = [$pain6, player_run] {};
|
||||
|
||||
void() player_axpain1 = [$axpain1, player_axpain2] {PainSound (); self.weaponframe = 0;};
|
||||
void() player_axpain1 = [$axpain1, player_axpain2] {PainSound (); @self.weaponframe = 0;};
|
||||
void() player_axpain2 = [$axpain2, player_axpain3] {};
|
||||
void() player_axpain3 = [$axpain3, player_axpain4] {};
|
||||
void() player_axpain4 = [$axpain4, player_axpain5] {};
|
||||
|
@ -502,13 +502,13 @@ void() player_axpain6 = [$axpain6, player_run] {};
|
|||
|
||||
void() player_pain =
|
||||
{
|
||||
if (self.weaponframe)
|
||||
if (@self.weaponframe)
|
||||
return;
|
||||
|
||||
if (self.invisible_finished > time)
|
||||
if (@self.invisible_finished > time)
|
||||
return; // eyes don't have pain frames
|
||||
|
||||
if (self.weapon == IT_AXE)
|
||||
if (@self.weapon == IT_AXE)
|
||||
player_axpain1 ();
|
||||
else
|
||||
player_pain1 ();
|
||||
|
@ -525,13 +525,13 @@ void() DeathBubblesSpawn =
|
|||
{
|
||||
local entity bubble;
|
||||
|
||||
if (self.owner.waterlevel != 3)
|
||||
if (@self.owner.waterlevel != 3)
|
||||
return;
|
||||
|
||||
bubble = spawn ();
|
||||
|
||||
setmodel (bubble, "progs/s_bubble.spr");
|
||||
setorigin (bubble, self.owner.origin + '0 0 24');
|
||||
setorigin (bubble, @self.owner.origin + '0 0 24');
|
||||
setsize (bubble, '-8 -8 -8', '8 8 8');
|
||||
|
||||
bubble.movetype = MOVETYPE_NOCLIP;
|
||||
|
@ -545,11 +545,11 @@ void() DeathBubblesSpawn =
|
|||
bubble.nextthink = time + 0.5;
|
||||
bubble.think = bubble_bob;
|
||||
|
||||
self.think = DeathBubblesSpawn;
|
||||
self.nextthink = time + 0.1;
|
||||
@self.think = DeathBubblesSpawn;
|
||||
@self.nextthink = time + 0.1;
|
||||
|
||||
if (++self.air_finished >= self.bubble_count)
|
||||
remove (self);
|
||||
if (++@self.air_finished >= @self.bubble_count)
|
||||
remove (@self);
|
||||
};
|
||||
|
||||
void (float num_bubbles) DeathBubbles =
|
||||
|
@ -557,9 +557,9 @@ void (float num_bubbles) DeathBubbles =
|
|||
local entity bubble_spawner;
|
||||
|
||||
bubble_spawner = spawn ();
|
||||
setorigin (bubble_spawner, self.origin);
|
||||
setorigin (bubble_spawner, @self.origin);
|
||||
|
||||
bubble_spawner.owner = self;
|
||||
bubble_spawner.owner = @self;
|
||||
|
||||
bubble_spawner.air_finished = 0;
|
||||
bubble_spawner.bubble_count = num_bubbles;
|
||||
|
@ -576,31 +576,31 @@ void() DeathSound =
|
|||
{
|
||||
local float rs;
|
||||
|
||||
if (self.waterlevel == 3) { // water death sounds
|
||||
if (@self.waterlevel == 3) { // water death sounds
|
||||
DeathBubbles (5);
|
||||
sound (self, CHAN_VOICE, "player/h2odeath.wav", 1, ATTN_NONE);
|
||||
sound (@self, CHAN_VOICE, "player/h2odeath.wav", 1, ATTN_NONE);
|
||||
return;
|
||||
}
|
||||
|
||||
rs = rint ((random() * 4) + 1);
|
||||
if (rs == 1)
|
||||
self.noise = "player/death1.wav";
|
||||
@self.noise = "player/death1.wav";
|
||||
if (rs == 2)
|
||||
self.noise = "player/death2.wav";
|
||||
@self.noise = "player/death2.wav";
|
||||
if (rs == 3)
|
||||
self.noise = "player/death3.wav";
|
||||
@self.noise = "player/death3.wav";
|
||||
if (rs == 4)
|
||||
self.noise = "player/death4.wav";
|
||||
@self.noise = "player/death4.wav";
|
||||
if (rs == 5)
|
||||
self.noise = "player/death5.wav";
|
||||
sound (self, CHAN_VOICE, self.noise, 1, ATTN_NONE);
|
||||
@self.noise = "player/death5.wav";
|
||||
sound (@self, CHAN_VOICE, @self.noise, 1, ATTN_NONE);
|
||||
return;
|
||||
};
|
||||
|
||||
void() PlayerDead =
|
||||
{
|
||||
self.nextthink = -1; // allow respawn after a certain time
|
||||
self.deadflag = DEAD_DEAD;
|
||||
@self.nextthink = -1; // allow respawn after a certain time
|
||||
@self.deadflag = DEAD_DEAD;
|
||||
};
|
||||
|
||||
vector(float dm) VelocityForDamage =
|
||||
|
@ -609,7 +609,7 @@ vector(float dm) VelocityForDamage =
|
|||
|
||||
if (vlen (damage_inflictor.velocity) > 0) {
|
||||
v = 0.5 * damage_inflictor.velocity;
|
||||
v += 25 * normalize (self.origin - damage_inflictor.origin);
|
||||
v += 25 * normalize (@self.origin - damage_inflictor.origin);
|
||||
v_x += 200 * crandom ();
|
||||
v_y += 200 * crandom ();
|
||||
v_z = 100 + 240 * random();
|
||||
|
@ -643,14 +643,14 @@ void (string gibname, float dm) ThrowGib =
|
|||
local entity new;
|
||||
|
||||
new = spawn ();
|
||||
new.origin = self.origin;
|
||||
new.origin = @self.origin;
|
||||
setmodel (new, gibname);
|
||||
setsize (new, '0 0 0', '0 0 0');
|
||||
|
||||
// wind tunnels
|
||||
new.solid = SOLID_TRIGGER;
|
||||
|
||||
if (self.waterlevel > 0) { // make gibs float in water
|
||||
if (@self.waterlevel > 0) { // make gibs float in water
|
||||
new.classname = "gib";
|
||||
new.movetype = MOVETYPE_FLY;
|
||||
new.velocity = '100 3 15';
|
||||
|
@ -677,63 +677,63 @@ void (string gibname, float dm) ThrowGib =
|
|||
|
||||
void (string gibname, float dm) ThrowHead =
|
||||
{
|
||||
setmodel (self, gibname);
|
||||
self.frame = 0;
|
||||
self.takedamage = DAMAGE_NO;
|
||||
setmodel (@self, gibname);
|
||||
@self.frame = 0;
|
||||
@self.takedamage = DAMAGE_NO;
|
||||
|
||||
// wind tunnels
|
||||
self.solid = SOLID_TRIGGER;
|
||||
@self.solid = SOLID_TRIGGER;
|
||||
|
||||
if (self.waterlevel > 0) { // float 'em
|
||||
self.movetype = MOVETYPE_FLY;
|
||||
if (@self.waterlevel > 0) { // float 'em
|
||||
@self.movetype = MOVETYPE_FLY;
|
||||
|
||||
self.velocity = '100 3 15';
|
||||
@self.velocity = '100 3 15';
|
||||
|
||||
self.think = bubble_bob;
|
||||
self.nextthink = time + 0.5;
|
||||
self.cnt = 0;
|
||||
@self.think = bubble_bob;
|
||||
@self.nextthink = time + 0.5;
|
||||
@self.cnt = 0;
|
||||
} else {
|
||||
self.movetype = MOVETYPE_BOUNCE;
|
||||
@self.movetype = MOVETYPE_BOUNCE;
|
||||
|
||||
self.velocity = VelocityForDamage (dm);
|
||||
self.avelocity = crandom () * '0 600 0';
|
||||
@self.velocity = VelocityForDamage (dm);
|
||||
@self.avelocity = crandom () * '0 600 0';
|
||||
|
||||
self.nextthink = -1;
|
||||
@self.nextthink = -1;
|
||||
}
|
||||
self.view_ofs = '0 0 8';
|
||||
setsize (self, '-16 -16 0', '16 16 56');
|
||||
self.origin_z -= 24;
|
||||
@self.view_ofs = '0 0 8';
|
||||
setsize (@self, '-16 -16 0', '16 16 56');
|
||||
@self.origin_z -= 24;
|
||||
|
||||
self.flags &= ~FL_ONGROUND;
|
||||
@self.flags &= ~FL_ONGROUND;
|
||||
};
|
||||
|
||||
void() GibPlayer =
|
||||
{
|
||||
// make a nice gib in Gib mode
|
||||
if (deathmatch & DM_GIB)
|
||||
self.health -= 40;
|
||||
@self.health -= 40;
|
||||
|
||||
ThrowHead ("progs/h_player.mdl", self.health);
|
||||
ThrowGib ("progs/gib1.mdl", self.health);
|
||||
ThrowGib ("progs/gib2.mdl", self.health);
|
||||
ThrowGib ("progs/gib3.mdl", self.health);
|
||||
ThrowHead ("progs/h_player.mdl", @self.health);
|
||||
ThrowGib ("progs/gib1.mdl", @self.health);
|
||||
ThrowGib ("progs/gib2.mdl", @self.health);
|
||||
ThrowGib ("progs/gib3.mdl", @self.health);
|
||||
|
||||
self.deadflag = DEAD_DEAD;
|
||||
@self.deadflag = DEAD_DEAD;
|
||||
|
||||
if (damage_attacker.classname == "teledeath") {
|
||||
sound (self, CHAN_VOICE, "player/teledth1.wav", 1, ATTN_NONE);
|
||||
sound (@self, CHAN_VOICE, "player/teledth1.wav", 1, ATTN_NONE);
|
||||
return;
|
||||
}
|
||||
|
||||
if (damage_attacker.classname == "teledeath2") {
|
||||
sound (self, CHAN_VOICE, "player/teledth1.wav", 1, ATTN_NONE);
|
||||
sound (@self, CHAN_VOICE, "player/teledth1.wav", 1, ATTN_NONE);
|
||||
return;
|
||||
}
|
||||
|
||||
if (random () < 0.5)
|
||||
sound (self, CHAN_VOICE, "player/gib.wav", 1, ATTN_NONE);
|
||||
sound (@self, CHAN_VOICE, "player/gib.wav", 1, ATTN_NONE);
|
||||
else
|
||||
sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NONE);
|
||||
sound (@self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NONE);
|
||||
};
|
||||
|
||||
void() PlayerDie =
|
||||
|
@ -741,14 +741,14 @@ void() PlayerDie =
|
|||
local float i;
|
||||
local string s;
|
||||
|
||||
self.items &= ~IT_INVISIBILITY;
|
||||
@self.items &= ~IT_INVISIBILITY;
|
||||
|
||||
if (stof (infokey (world, "dq"))) { // drop quad?
|
||||
if (self.super_damage_finished > 0) {
|
||||
DropQuad (self.super_damage_finished - time);
|
||||
s = self.netname
|
||||
if (@self.super_damage_finished > 0) {
|
||||
DropQuad (@self.super_damage_finished - time);
|
||||
s = @self.netname
|
||||
+ " lost a Quad with "
|
||||
+ ftos (rint (self.super_damage_finished - time))
|
||||
+ ftos (rint (@self.super_damage_finished - time))
|
||||
+ " seconds remaining!\n";
|
||||
|
||||
BPRINT (PRINT_MEDIUM, s);
|
||||
|
@ -756,41 +756,41 @@ void() PlayerDie =
|
|||
}
|
||||
|
||||
if (stof (infokey (world, "dc"))) {
|
||||
if (self.invisible_finished > 0) {
|
||||
DropRing (self.invisible_finished - time);
|
||||
s = self.netname
|
||||
if (@self.invisible_finished > 0) {
|
||||
DropRing (@self.invisible_finished - time);
|
||||
s = @self.netname
|
||||
+ " lost a Cloaking Device with "
|
||||
+ ftos (rint (self.invisible_finished - time))
|
||||
+ ftos (rint (@self.invisible_finished - time))
|
||||
+ " seconds remaining!\n";
|
||||
BPRINT (PRINT_LOW, s);
|
||||
}
|
||||
}
|
||||
|
||||
self.invisible_finished = 0; // don't die as eyes
|
||||
self.invincible_finished = 0;
|
||||
self.super_damage_finished = 0;
|
||||
self.radsuit_finished = 0;
|
||||
self.modelindex = modelindex_player; // don't use eyes
|
||||
@self.invisible_finished = 0; // don't die as eyes
|
||||
@self.invincible_finished = 0;
|
||||
@self.super_damage_finished = 0;
|
||||
@self.radsuit_finished = 0;
|
||||
@self.modelindex = modelindex_player; // don't use eyes
|
||||
|
||||
// + POX - moved below gib check (no packs when gibbed!)
|
||||
//DropBackpack();
|
||||
|
||||
// + POX v1.11 - clear the target print so it doesn't obscure the scoreboard
|
||||
if (self.target_id_toggle)
|
||||
centerprint (self, "");
|
||||
if (@self.target_id_toggle)
|
||||
centerprint (@self, "");
|
||||
|
||||
self.weaponmodel = "";
|
||||
self.view_ofs = '0 0 -8';
|
||||
self.deadflag = DEAD_DYING;
|
||||
self.solid = SOLID_NOT;
|
||||
self.flags &= ~FL_ONGROUND;
|
||||
self.movetype = MOVETYPE_TOSS;
|
||||
@self.weaponmodel = "";
|
||||
@self.view_ofs = '0 0 -8';
|
||||
@self.deadflag = DEAD_DYING;
|
||||
@self.solid = SOLID_NOT;
|
||||
@self.flags &= ~FL_ONGROUND;
|
||||
@self.movetype = MOVETYPE_TOSS;
|
||||
|
||||
if (self.velocity_z < 10)
|
||||
self.velocity_z = self.velocity_z + random () * 300;
|
||||
if (@self.velocity_z < 10)
|
||||
@self.velocity_z = @self.velocity_z + random () * 300;
|
||||
|
||||
// + POX check for gib mode as well as regular gib
|
||||
if (self.health < -40 || (deathmatch & DM_GIB)) {
|
||||
if (@self.health < -40 || (deathmatch & DM_GIB)) {
|
||||
GibPlayer ();
|
||||
return;
|
||||
}
|
||||
|
@ -799,10 +799,10 @@ void() PlayerDie =
|
|||
|
||||
DeathSound ();
|
||||
|
||||
self.angles_x = 0;
|
||||
self.angles_z = 0;
|
||||
@self.angles_x = 0;
|
||||
@self.angles_z = 0;
|
||||
|
||||
if (self.weapon == IT_AXE) {
|
||||
if (@self.weapon == IT_AXE) {
|
||||
player_die_ax1 ();
|
||||
return;
|
||||
}
|
||||
|
@ -828,14 +828,14 @@ void() PlayerDie =
|
|||
|
||||
void() set_suicide_frame =
|
||||
{ // used by kill command and diconnect command
|
||||
if (self.model != "progs/player.mdl")
|
||||
if (@self.model != "progs/player.mdl")
|
||||
return; // allready gibbed
|
||||
|
||||
self.frame = $deatha11;
|
||||
self.solid = SOLID_NOT;
|
||||
self.movetype = MOVETYPE_TOSS;
|
||||
self.deadflag = DEAD_DEAD;
|
||||
self.nextthink = -1;
|
||||
@self.frame = $deatha11;
|
||||
@self.solid = SOLID_NOT;
|
||||
@self.movetype = MOVETYPE_TOSS;
|
||||
@self.deadflag = DEAD_DEAD;
|
||||
@self.nextthink = -1;
|
||||
};
|
||||
|
||||
void() player_diea1 = [$deatha1, player_diea2] {};
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
.float spawnsilent;
|
||||
.vector old_velocity;
|
||||
//POX v1.2 REMOVED EARTHQUAKE! (not suitable for DM)
|
||||
void() func_earthquake = {remove(self);};
|
||||
void() func_earthquake = {remove(@self);};
|
||||
//Water Movement
|
||||
.float uwmuffle; //underwater muffle sound timeout
|
||||
.float onwsound; //on water sound timeout
|
||||
|
|
|
@ -47,7 +47,7 @@ vector() wall_velocity =
|
|||
{
|
||||
local vector vel;
|
||||
|
||||
vel = normalize (self.velocity);
|
||||
vel = normalize (@self.velocity);
|
||||
vel = normalize(vel + v_up*(random()- 0.5) + v_right*(random()- 0.5));
|
||||
vel = vel + 2*trace_plane_normal;
|
||||
vel = vel * 200;
|
||||
|
@ -64,17 +64,17 @@ void() W_FireTShot =
|
|||
{
|
||||
local vector dir;
|
||||
|
||||
sound (self ,CHAN_WEAPON, "weapons/ts3fire.wav", 1, ATTN_NORM);
|
||||
sound (@self ,CHAN_WEAPON, "weapons/ts3fire.wav", 1, ATTN_NORM);
|
||||
|
||||
msg_entity = self;
|
||||
msg_entity = @self;
|
||||
WriteByte (MSG_ONE, SVC_BIGKICK);
|
||||
|
||||
//Added weapon kickback (as long as you're not in mid air)
|
||||
if (self.flags & FL_ONGROUND)
|
||||
self.velocity = self.velocity + v_forward* -80;
|
||||
if (@self.flags & FL_ONGROUND)
|
||||
@self.velocity = @self.velocity + v_forward* -80;
|
||||
|
||||
self.currentammo = self.ammo_shells = self.ammo_shells - 3;
|
||||
dir = aim (self, 100000);
|
||||
@self.currentammo = @self.ammo_shells = @self.ammo_shells - 3;
|
||||
dir = aim (@self, 100000);
|
||||
//POX - 1.01b2 - increased spread, reduced amount
|
||||
//POX - 1.1 - made FireBullets2 (twice the damge, half the pellets + 1 :)
|
||||
FireBullets2 (12, dir, '0.16 0.1 0'); //make priming this thing worth while!
|
||||
|
@ -88,33 +88,33 @@ void() T_MplasmaTouch =
|
|||
{
|
||||
local float damg;
|
||||
|
||||
if (other == self.owner)
|
||||
if (other == @self.owner)
|
||||
return; // don't explode on owner
|
||||
|
||||
if (self.voided) {
|
||||
if (@self.voided) {
|
||||
return;
|
||||
}
|
||||
|
||||
self.voided = 1;
|
||||
@self.voided = 1;
|
||||
|
||||
if (pointcontents(self.origin) == CONTENT_SKY) {
|
||||
remove(self);
|
||||
if (pointcontents(@self.origin) == CONTENT_SKY) {
|
||||
remove(@self);
|
||||
return;
|
||||
}
|
||||
damg = 120 + random()*20;
|
||||
|
||||
T_RadiusDamage (self, self.owner, damg, world, "megaplasma");
|
||||
T_RadiusDamage (@self, @self.owner, damg, world, "megaplasma");
|
||||
|
||||
sound (self, CHAN_WEAPON, "weapons/mplasex.wav", 1, ATTN_NORM);
|
||||
self.origin = self.origin - 8*normalize(self.velocity);
|
||||
sound (@self, CHAN_WEAPON, "weapons/mplasex.wav", 1, ATTN_NORM);
|
||||
@self.origin = @self.origin - 8*normalize(@self.velocity);
|
||||
|
||||
WriteByte (MSG_MULTICAST, SVC_TEMPENTITY);
|
||||
WriteByte (MSG_MULTICAST, TE_EXPLOSION);
|
||||
WriteCoord (MSG_MULTICAST, self.origin_x);
|
||||
WriteCoord (MSG_MULTICAST, self.origin_y);
|
||||
WriteCoord (MSG_MULTICAST, self.origin_z);
|
||||
multicast (self.origin, MULTICAST_PHS);
|
||||
remove(self);
|
||||
WriteCoord (MSG_MULTICAST, @self.origin_x);
|
||||
WriteCoord (MSG_MULTICAST, @self.origin_y);
|
||||
WriteCoord (MSG_MULTICAST, @self.origin_z);
|
||||
multicast (@self.origin, MULTICAST_PHS);
|
||||
remove(@self);
|
||||
};
|
||||
|
||||
//launch_megaplasma
|
||||
|
@ -122,26 +122,26 @@ void() launch_megaplasma =
|
|||
{
|
||||
local vector dir;
|
||||
|
||||
self.currentammo = self.ammo_cells = self.ammo_cells - 9;
|
||||
@self.currentammo = @self.ammo_cells = @self.ammo_cells - 9;
|
||||
|
||||
sound (self, CHAN_WEAPON, "weapons/mplasma.wav", 1, ATTN_NORM);
|
||||
msg_entity = self;
|
||||
sound (@self, CHAN_WEAPON, "weapons/mplasma.wav", 1, ATTN_NORM);
|
||||
msg_entity = @self;
|
||||
WriteByte (MSG_ONE, SVC_BIGKICK);
|
||||
|
||||
//Added weapon kickback (as long as you're not in mid air)
|
||||
if (self.flags & FL_ONGROUND)
|
||||
self.velocity = self.velocity + v_forward* -270;
|
||||
if (@self.flags & FL_ONGROUND)
|
||||
@self.velocity = @self.velocity + v_forward* -270;
|
||||
|
||||
newmis = spawn ();
|
||||
newmis.voided = 0;
|
||||
newmis.owner = self;
|
||||
newmis.owner = @self;
|
||||
newmis.movetype = MOVETYPE_FLYMISSILE;
|
||||
newmis.solid = SOLID_BBOX;
|
||||
newmis.classname = "megaplasma";
|
||||
newmis.effects = newmis.effects | EF_BLUE;
|
||||
|
||||
// set speed
|
||||
dir = aim ( self, 1000 );
|
||||
dir = aim ( @self, 1000 );
|
||||
newmis.velocity = dir * 0.01;
|
||||
newmis.avelocity = '300 300 300';
|
||||
newmis.angles = vectoangles(newmis.velocity);
|
||||
|
@ -155,7 +155,7 @@ void() launch_megaplasma =
|
|||
newmis.nextthink = time + 5;
|
||||
setmodel (newmis, "progs/plasma.mdl");
|
||||
setsize (newmis, '0 0 0', '0 0 0');
|
||||
setorigin (newmis, self.origin + v_forward*12 + '0 0 12');
|
||||
setorigin (newmis, @self.origin + v_forward*12 + '0 0 12');
|
||||
};
|
||||
//End MegaPlasmaBurst
|
||||
//=================================================================================
|
||||
|
@ -167,34 +167,34 @@ void() launch_megaplasma =
|
|||
void() T_PballTouch =
|
||||
{
|
||||
local float damg;
|
||||
if (other == self.owner)
|
||||
if (other == @self.owner)
|
||||
return; // don't explode on owner
|
||||
|
||||
if (self.voided) {
|
||||
if (@self.voided) {
|
||||
return;
|
||||
}
|
||||
|
||||
self.voided = 1;
|
||||
@self.voided = 1;
|
||||
|
||||
if (pointcontents(self.origin) == CONTENT_SKY)
|
||||
if (pointcontents(@self.origin) == CONTENT_SKY)
|
||||
{
|
||||
remove(self);
|
||||
remove(@self);
|
||||
return;
|
||||
}
|
||||
|
||||
damg = 100 + random()*20;
|
||||
T_RadiusDamage (self, self.owner, damg, world, "impactgrenade");
|
||||
T_RadiusDamage (@self, @self.owner, damg, world, "impactgrenade");
|
||||
|
||||
// sound (self, CHAN_WEAPON, "weapons/r_exp3.wav", 1, ATTN_NORM);
|
||||
self.origin = self.origin - 8*normalize(self.velocity);
|
||||
// sound (@self, CHAN_WEAPON, "weapons/r_exp3.wav", 1, ATTN_NORM);
|
||||
@self.origin = @self.origin - 8*normalize(@self.velocity);
|
||||
|
||||
WriteByte (MSG_MULTICAST, SVC_TEMPENTITY);
|
||||
WriteByte (MSG_MULTICAST, TE_EXPLOSION);
|
||||
WriteCoord (MSG_MULTICAST, self.origin_x);
|
||||
WriteCoord (MSG_MULTICAST, self.origin_y);
|
||||
WriteCoord (MSG_MULTICAST, self.origin_z);
|
||||
multicast (self.origin, MULTICAST_PHS);
|
||||
remove(self);
|
||||
WriteCoord (MSG_MULTICAST, @self.origin_x);
|
||||
WriteCoord (MSG_MULTICAST, @self.origin_y);
|
||||
WriteCoord (MSG_MULTICAST, @self.origin_z);
|
||||
multicast (@self.origin, MULTICAST_PHS);
|
||||
remove(@self);
|
||||
};
|
||||
/*
|
||||
================
|
||||
|
@ -203,25 +203,25 @@ W_FirePball
|
|||
*/
|
||||
void() W_FirePball =
|
||||
{
|
||||
self.currentammo = self.ammo_rockets = self.ammo_rockets - 1;
|
||||
@self.currentammo = @self.ammo_rockets = @self.ammo_rockets - 1;
|
||||
|
||||
sound (self, CHAN_AUTO, "weapons/gren2.wav", 1, ATTN_NORM);
|
||||
msg_entity = self;
|
||||
sound (@self, CHAN_AUTO, "weapons/gren2.wav", 1, ATTN_NORM);
|
||||
msg_entity = @self;
|
||||
WriteByte (MSG_ONE, SVC_BIGKICK);
|
||||
|
||||
//Added weapon kickback (as long as you're not in mid air)
|
||||
if (self.flags & FL_ONGROUND)
|
||||
self.velocity = self.velocity + v_forward* -150;
|
||||
if (@self.flags & FL_ONGROUND)
|
||||
@self.velocity = @self.velocity + v_forward* -150;
|
||||
|
||||
newmis = spawn ();
|
||||
newmis.voided = 0;
|
||||
newmis.owner = self;
|
||||
newmis.owner = @self;
|
||||
newmis.movetype = MOVETYPE_TOSS;
|
||||
newmis.solid = SOLID_BBOX;
|
||||
newmis.classname = "impactgrenade";
|
||||
|
||||
// set newmis speed
|
||||
makevectors (self.v_angle);
|
||||
makevectors (@self.v_angle);
|
||||
newmis.velocity = v_forward*700 + v_up * 200 + crandom()*v_right*10 + crandom()*v_up*10;
|
||||
newmis.angles = vectoangles(newmis.velocity);
|
||||
|
||||
|
@ -232,7 +232,7 @@ void() W_FirePball =
|
|||
newmis.nextthink = time + 5;
|
||||
setmodel (newmis, "progs/grenade.mdl");
|
||||
setsize (newmis, '0 0 0', '0 0 0');
|
||||
setorigin (newmis, self.origin + v_forward*4);
|
||||
setorigin (newmis, @self.origin + v_forward*4);
|
||||
};
|
||||
// END PumkinBall CODE
|
||||
|
||||
|
@ -248,20 +248,20 @@ void() W_FirePball =
|
|||
//=============================================================================
|
||||
void() M_DamExplode =
|
||||
{
|
||||
if (self.voided)
|
||||
if (@self.voided)
|
||||
return;
|
||||
|
||||
self.voided = 1;
|
||||
@self.voided = 1;
|
||||
|
||||
T_RadiusDamage (self, self.owner, 95, world, "mine");
|
||||
T_RadiusDamage (@self, @self.owner, 95, world, "mine");
|
||||
WriteByte (MSG_MULTICAST, SVC_TEMPENTITY);
|
||||
WriteByte (MSG_MULTICAST, TE_EXPLOSION);
|
||||
WriteCoord (MSG_MULTICAST, self.origin_x);
|
||||
WriteCoord (MSG_MULTICAST, self.origin_y);
|
||||
WriteCoord (MSG_MULTICAST, self.origin_z);
|
||||
multicast (self.origin, MULTICAST_PHS);
|
||||
WriteCoord (MSG_MULTICAST, @self.origin_x);
|
||||
WriteCoord (MSG_MULTICAST, @self.origin_y);
|
||||
WriteCoord (MSG_MULTICAST, @self.origin_z);
|
||||
multicast (@self.origin, MULTICAST_PHS);
|
||||
|
||||
remove (self);
|
||||
remove (@self);
|
||||
};
|
||||
/*
|
||||
================
|
||||
|
@ -271,19 +271,19 @@ MineExplode
|
|||
//explode immediately! (for doors, plats and breakable objects
|
||||
void() MineImExplode =
|
||||
{
|
||||
self.takedamage = DAMAGE_NO;
|
||||
self.deathtype = "mine";
|
||||
self.owner = self.lastowner;
|
||||
@self.takedamage = DAMAGE_NO;
|
||||
@self.deathtype = "mine";
|
||||
@self.owner = @self.lastowner;
|
||||
M_DamExplode();
|
||||
};
|
||||
|
||||
void() MineExplode =
|
||||
{
|
||||
self.takedamage = DAMAGE_NO;
|
||||
self.deathtype = "mine";
|
||||
self.nextthink = time + random()*0.15; //gives a more organic explosion when multiple mines explode at once
|
||||
self.owner = self.lastowner;
|
||||
self.think = M_DamExplode;
|
||||
@self.takedamage = DAMAGE_NO;
|
||||
@self.deathtype = "mine";
|
||||
@self.nextthink = time + random()*0.15; //gives a more organic explosion when multiple mines explode at once
|
||||
@self.owner = @self.lastowner;
|
||||
@self.think = M_DamExplode;
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -293,56 +293,56 @@ MineTouch
|
|||
*/
|
||||
void() MineTouch =
|
||||
{
|
||||
if (other == self)
|
||||
if (other == @self)
|
||||
return;
|
||||
|
||||
if (other.solid == SOLID_TRIGGER) {
|
||||
sound (self, CHAN_AUTO, "weapons/bounce.wav", 1, ATTN_NORM);
|
||||
sound (@self, CHAN_AUTO, "weapons/bounce.wav", 1, ATTN_NORM);
|
||||
return;
|
||||
}
|
||||
|
||||
if (other.classname == "grenade") {
|
||||
sound (self, CHAN_AUTO, "weapons/bounce2.wav", 1, ATTN_NORM);
|
||||
self.nextthink = time + 1;
|
||||
sound (@self, CHAN_AUTO, "weapons/bounce2.wav", 1, ATTN_NORM);
|
||||
@self.nextthink = time + 1;
|
||||
return;
|
||||
}
|
||||
|
||||
if (other.classname == "mine") {
|
||||
sound (self, CHAN_AUTO, "weapons/bounce2.wav", 1, ATTN_NORM);
|
||||
self.nextthink = time + 1;
|
||||
sound (@self, CHAN_AUTO, "weapons/bounce2.wav", 1, ATTN_NORM);
|
||||
@self.nextthink = time + 1;
|
||||
return;
|
||||
}
|
||||
|
||||
if (other.classname == "minearm") {
|
||||
sound (self, CHAN_AUTO, "weapons/bounce2.wav", 1, ATTN_NORM);
|
||||
self.nextthink = time + 1;
|
||||
sound (@self, CHAN_AUTO, "weapons/bounce2.wav", 1, ATTN_NORM);
|
||||
@self.nextthink = time + 1;
|
||||
return;
|
||||
}
|
||||
|
||||
if (other.classname == "minearmed") {
|
||||
sound (self, CHAN_AUTO, "weapons/bounce.wav", 1, ATTN_NORM);
|
||||
self.classname = "minearm";
|
||||
self.nextthink = time + 1;
|
||||
sound (@self, CHAN_AUTO, "weapons/bounce.wav", 1, ATTN_NORM);
|
||||
@self.classname = "minearm";
|
||||
@self.nextthink = time + 1;
|
||||
return;
|
||||
}
|
||||
|
||||
if (other.classname == "player") {
|
||||
sound (self, CHAN_BODY, "weapons/minedet.wav", 1, ATTN_NORM);
|
||||
sound (@self, CHAN_BODY, "weapons/minedet.wav", 1, ATTN_NORM);
|
||||
MineExplode();
|
||||
self.nextthink = time + 0.4;
|
||||
@self.nextthink = time + 0.4;
|
||||
return;
|
||||
}
|
||||
|
||||
if (other.takedamage == DAMAGE_AIM) {
|
||||
MineExplode();
|
||||
self.think();
|
||||
@self.think();
|
||||
return;
|
||||
}
|
||||
|
||||
self.movetype = MOVETYPE_NONE;
|
||||
self.classname = "minearm";
|
||||
self.spawnmaster = other;
|
||||
self.nextthink = time + 0.1;
|
||||
@self.movetype = MOVETYPE_NONE;
|
||||
@self.classname = "minearm";
|
||||
@self.spawnmaster = other;
|
||||
@self.nextthink = time + 0.1;
|
||||
};
|
||||
/*
|
||||
================
|
||||
|
@ -354,26 +354,26 @@ void() MineArm =
|
|||
local entity head;
|
||||
local float detonate;
|
||||
|
||||
if (self.classname == "minearm") {
|
||||
sound (self, CHAN_WEAPON, "weapons/armed.wav", 1, ATTN_NORM);
|
||||
setsize (self, '-3 -3 -3', '3 3 3');
|
||||
self.owner = world;
|
||||
self.takedamage = DAMAGE_YES;
|
||||
self.skin = 1;
|
||||
self.classname = "minearmed";
|
||||
if (@self.classname == "minearm") {
|
||||
sound (@self, CHAN_WEAPON, "weapons/armed.wav", 1, ATTN_NORM);
|
||||
setsize (@self, '-3 -3 -3', '3 3 3');
|
||||
@self.owner = world;
|
||||
@self.takedamage = DAMAGE_YES;
|
||||
@self.skin = 1;
|
||||
@self.classname = "minearmed";
|
||||
muzzleflash(); //Will this work?
|
||||
}
|
||||
if ((time > self.delay) || (self.spawnmaster.no_obj == TRUE))
|
||||
if ((time > @self.delay) || (@self.spawnmaster.no_obj == TRUE))
|
||||
{
|
||||
sound (self, CHAN_BODY, "weapons/minedet.wav", 1, ATTN_NORM);
|
||||
sound (@self, CHAN_BODY, "weapons/minedet.wav", 1, ATTN_NORM);
|
||||
MineImExplode();
|
||||
//self.nextthink = time + 0.4;
|
||||
//@self.nextthink = time + 0.4;
|
||||
return;
|
||||
}
|
||||
|
||||
// No click or delay when velocity triggers mine (so they don't float when doors open)
|
||||
// Although the 'organic' explosion' part in the detonate code might leave it hanging...
|
||||
if (vlen(self.spawnmaster.velocity) > 0)
|
||||
if (vlen(@self.spawnmaster.velocity) > 0)
|
||||
{
|
||||
MineImExplode();
|
||||
return;
|
||||
|
@ -382,29 +382,29 @@ void() MineArm =
|
|||
// Mines explode on touch, but for some reason most monsters don't detonate them (?)
|
||||
// So had to use a findradius function to look for monsters, it's a small radius though
|
||||
// Ogres still don't always detonate mines (?)
|
||||
head = findradius(self.origin, 39);
|
||||
head = findradius(@self.origin, 39);
|
||||
detonate = 0;
|
||||
|
||||
if (self.health < 0)
|
||||
if (@self.health < 0)
|
||||
detonate = 1;
|
||||
|
||||
while (head) {
|
||||
if ((head != self) && (head.health > 0) && ((head.flags & (FL_CLIENT|FL_MONSTER)) || (head.classname == "bot")) && (head.classname!=self.classname))
|
||||
if ((head != @self) && (head.health > 0) && ((head.flags & (FL_CLIENT|FL_MONSTER)) || (head.classname == "bot")) && (head.classname!=@self.classname))
|
||||
detonate = 1;
|
||||
traceline(self.origin, head.origin, TRUE, self);
|
||||
traceline(@self.origin, head.origin, TRUE, @self);
|
||||
if (trace_fraction != 1.0)
|
||||
detonate = 0;
|
||||
|
||||
if (detonate==1) {
|
||||
sound (self, CHAN_BODY, "weapons/minedet.wav", 1, ATTN_NORM);
|
||||
sound (@self, CHAN_BODY, "weapons/minedet.wav", 1, ATTN_NORM);
|
||||
MineExplode();
|
||||
self.nextthink = time + 0.25;
|
||||
@self.nextthink = time + 0.25;
|
||||
return;
|
||||
}
|
||||
head = head.chain;
|
||||
}
|
||||
|
||||
self.nextthink = time + 0.1;
|
||||
@self.nextthink = time + 0.1;
|
||||
};
|
||||
/*
|
||||
================
|
||||
|
@ -413,20 +413,20 @@ W_FireMine
|
|||
*/
|
||||
void() W_FireMine =
|
||||
{
|
||||
self.currentammo = self.ammo_rockets = self.ammo_rockets - 1;
|
||||
sound (self, CHAN_AUTO, "weapons/gren.wav", 1, ATTN_NORM);
|
||||
@self.currentammo = @self.ammo_rockets = @self.ammo_rockets - 1;
|
||||
sound (@self, CHAN_AUTO, "weapons/gren.wav", 1, ATTN_NORM);
|
||||
|
||||
msg_entity = self;
|
||||
msg_entity = @self;
|
||||
WriteByte (MSG_ONE, SVC_SMALLKICK);
|
||||
|
||||
//Added weapon kickback (as long as you're not in mid air)
|
||||
if (self.flags & FL_ONGROUND)
|
||||
self.velocity = self.velocity + v_forward* -100;
|
||||
if (@self.flags & FL_ONGROUND)
|
||||
@self.velocity = @self.velocity + v_forward* -100;
|
||||
|
||||
newmis = spawn ();
|
||||
newmis.voided = 0;
|
||||
newmis.owner = self;
|
||||
newmis.lastowner = self;
|
||||
newmis.owner = @self;
|
||||
newmis.lastowner = @self;
|
||||
newmis.movetype = MOVETYPE_TOSS;
|
||||
newmis.solid = SOLID_BBOX;
|
||||
newmis.classname = "mine";
|
||||
|
@ -437,11 +437,11 @@ void() W_FireMine =
|
|||
newmis.nobleed = TRUE;
|
||||
|
||||
// set missile speed
|
||||
makevectors (self.v_angle);
|
||||
if (self.v_angle_x) {
|
||||
makevectors (@self.v_angle);
|
||||
if (@self.v_angle_x) {
|
||||
newmis.velocity = v_forward*600 + v_up * 200 + crandom()*v_right*10 + crandom()*v_up*10;
|
||||
} else {
|
||||
newmis.velocity = aim(self, 10000);
|
||||
newmis.velocity = aim(@self, 10000);
|
||||
newmis.velocity = newmis.velocity * 600;
|
||||
newmis.velocity_z = 200;
|
||||
}
|
||||
|
@ -457,7 +457,7 @@ void() W_FireMine =
|
|||
newmis.th_die = MineExplode;
|
||||
|
||||
setmodel (newmis, "progs/grenade.mdl");
|
||||
setorigin (newmis, self.origin + v_forward*4);
|
||||
setorigin (newmis, @self.origin + v_forward*4);
|
||||
setsize (newmis, '-1 -1 -1', '0 0 0');
|
||||
};
|
||||
// END MINE CODE
|
||||
|
@ -474,15 +474,15 @@ void() W_FireMine =
|
|||
//These functions launch a single spike in a random direction
|
||||
void() spikenal_touch =
|
||||
{
|
||||
if (pointcontents(self.origin) == CONTENT_SKY) {
|
||||
remove(self);
|
||||
if (pointcontents(@self.origin) == CONTENT_SKY) {
|
||||
remove(@self);
|
||||
return;
|
||||
}
|
||||
|
||||
if (self.voided) {
|
||||
if (@self.voided) {
|
||||
return;
|
||||
}
|
||||
self.voided = 1;
|
||||
@self.voided = 1;
|
||||
|
||||
if (other.solid == SOLID_TRIGGER)
|
||||
return; // trigger field, do nothing
|
||||
|
@ -491,18 +491,18 @@ void() spikenal_touch =
|
|||
if (other.takedamage) {
|
||||
spawn_touchblood (12);
|
||||
other.deathtype = "shrapnel";
|
||||
T_Damage (other, self, self.owner, 12);
|
||||
remove(self);
|
||||
T_Damage (other, @self, @self.owner, 12);
|
||||
remove(@self);
|
||||
}
|
||||
|
||||
else if (random() > 0.9) {
|
||||
WriteByte (MSG_MULTICAST, SVC_TEMPENTITY);
|
||||
WriteByte (MSG_MULTICAST, TE_SPIKE);
|
||||
WriteCoord (MSG_MULTICAST, self.origin_x);
|
||||
WriteCoord (MSG_MULTICAST, self.origin_y);
|
||||
WriteCoord (MSG_MULTICAST, self.origin_z);
|
||||
multicast (self.origin, MULTICAST_PHS);
|
||||
remove(self);
|
||||
WriteCoord (MSG_MULTICAST, @self.origin_x);
|
||||
WriteCoord (MSG_MULTICAST, @self.origin_y);
|
||||
WriteCoord (MSG_MULTICAST, @self.origin_z);
|
||||
multicast (@self.origin, MULTICAST_PHS);
|
||||
remove(@self);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -527,7 +527,7 @@ void(vector org) launch_shrapnel =
|
|||
newmis = spawn ();
|
||||
|
||||
newmis.voided = 0;
|
||||
newmis.owner = self.owner;
|
||||
newmis.owner = @self.owner;
|
||||
newmis.movetype = MOVETYPE_BOUNCE;
|
||||
newmis.solid = SOLID_BBOX;
|
||||
|
||||
|
@ -554,68 +554,68 @@ void() ShrapnelExplode =
|
|||
|
||||
local vector direction;
|
||||
|
||||
if (self.voided) {
|
||||
if (@self.voided) {
|
||||
return;
|
||||
}
|
||||
self.voided = 1;
|
||||
@self.voided = 1;
|
||||
|
||||
// Toss the nails (this function is with the spike stuff since it uses the same touch)
|
||||
for (i = 0; i < 10; i++)
|
||||
launch_shrapnel(self.origin);
|
||||
launch_shrapnel(@self.origin);
|
||||
|
||||
for (i = 0; i < 60; i++) { // Toss some spikes
|
||||
direction_x = (4096 * random ()) - 2048;
|
||||
direction_y = (4096 * random ()) - 2048;
|
||||
direction_z = (4096 * random ()) - 2048;
|
||||
|
||||
launch_spike (self.origin, direction);
|
||||
newmis.owner = self.owner;
|
||||
launch_spike (@self.origin, direction);
|
||||
newmis.owner = @self.owner;
|
||||
};
|
||||
|
||||
T_RadiusDamage (self, self.owner, 160, world, "shrapnel");
|
||||
T_RadiusDamage (@self, @self.owner, 160, world, "shrapnel");
|
||||
|
||||
if (self.owner != world)
|
||||
self.owner.shrap_detonate = FALSE; // Enable next launch
|
||||
if (@self.owner != world)
|
||||
@self.owner.shrap_detonate = FALSE; // Enable next launch
|
||||
|
||||
WriteByte (MSG_MULTICAST, SVC_TEMPENTITY);
|
||||
WriteByte (MSG_MULTICAST, TE_EXPLOSION);
|
||||
WriteCoord (MSG_MULTICAST, self.origin_x);
|
||||
WriteCoord (MSG_MULTICAST, self.origin_y);
|
||||
WriteCoord (MSG_MULTICAST, self.origin_z);
|
||||
multicast (self.origin, MULTICAST_PHS);
|
||||
remove (self);
|
||||
WriteCoord (MSG_MULTICAST, @self.origin_x);
|
||||
WriteCoord (MSG_MULTICAST, @self.origin_y);
|
||||
WriteCoord (MSG_MULTICAST, @self.origin_z);
|
||||
multicast (@self.origin, MULTICAST_PHS);
|
||||
remove (@self);
|
||||
|
||||
};
|
||||
|
||||
void() ShrapnelDetonate =
|
||||
{
|
||||
sound (self, CHAN_BODY, "weapons/minedet.wav", 1, ATTN_NORM);
|
||||
self.think = ShrapnelExplode;
|
||||
self.nextthink = time + 0.1;
|
||||
sound (@self, CHAN_BODY, "weapons/minedet.wav", 1, ATTN_NORM);
|
||||
@self.think = ShrapnelExplode;
|
||||
@self.nextthink = time + 0.1;
|
||||
};
|
||||
|
||||
// Wait for a detonation impulse or time up
|
||||
void() ShrapnelThink =
|
||||
{
|
||||
if (self.shrap_time < time)
|
||||
if (@self.shrap_time < time)
|
||||
ShrapnelDetonate();
|
||||
|
||||
if (self.owner == world)
|
||||
if (@self.owner == world)
|
||||
return;
|
||||
|
||||
// Owner died so change to world and wait for detonate
|
||||
if (self.owner.health <= 0) {
|
||||
self.owner.shrap_detonate = FALSE;//Enable next launch
|
||||
self.owner = world;
|
||||
self.nextthink = self.shrap_time;
|
||||
self.think = ShrapnelDetonate;
|
||||
if (@self.owner.health <= 0) {
|
||||
@self.owner.shrap_detonate = FALSE;//Enable next launch
|
||||
@self.owner = world;
|
||||
@self.nextthink = @self.shrap_time;
|
||||
@self.think = ShrapnelDetonate;
|
||||
return;
|
||||
}
|
||||
|
||||
if (self.owner.shrap_detonate == 2)
|
||||
if (@self.owner.shrap_detonate == 2)
|
||||
ShrapnelDetonate();
|
||||
else
|
||||
self.nextthink = time + 0.1;
|
||||
@self.nextthink = time + 0.1;
|
||||
};
|
||||
|
||||
|
||||
|
@ -625,7 +625,7 @@ void() ShrapnelTouch =
|
|||
|
||||
r = random();
|
||||
|
||||
if (other == self.owner)
|
||||
if (other == @self.owner)
|
||||
return; // don't explode on owner
|
||||
|
||||
if (other.takedamage == DAMAGE_AIM)
|
||||
|
@ -636,12 +636,12 @@ void() ShrapnelTouch =
|
|||
|
||||
//pick a bounce sound
|
||||
if (r < 0.75)
|
||||
sound (self, CHAN_VOICE, "weapons/bounce.wav", 1, ATTN_NORM);
|
||||
sound (@self, CHAN_VOICE, "weapons/bounce.wav", 1, ATTN_NORM);
|
||||
else
|
||||
sound (self, CHAN_VOICE, "weapons/bounce2.wav", 1, ATTN_NORM);
|
||||
sound (@self, CHAN_VOICE, "weapons/bounce2.wav", 1, ATTN_NORM);
|
||||
|
||||
if (self.velocity == '0 0 0')
|
||||
self.avelocity = '0 0 0';
|
||||
if (@self.velocity == '0 0 0')
|
||||
@self.avelocity = '0 0 0';
|
||||
};
|
||||
// End shrapnel bomb
|
||||
|
||||
|
@ -654,19 +654,19 @@ W_FireShrapnel
|
|||
*/
|
||||
void() W_FireShrapnel =
|
||||
{
|
||||
self.ammo_rockets = self.ammo_rockets - 1;
|
||||
self.currentammo = self.ammo_nails = self.ammo_nails - 30;
|
||||
sound (self, CHAN_WEAPON, "weapons/gren2.wav", 1, ATTN_NORM);
|
||||
@self.ammo_rockets = @self.ammo_rockets - 1;
|
||||
@self.currentammo = @self.ammo_nails = @self.ammo_nails - 30;
|
||||
sound (@self, CHAN_WEAPON, "weapons/gren2.wav", 1, ATTN_NORM);
|
||||
|
||||
msg_entity = self;
|
||||
msg_entity = @self;
|
||||
WriteByte (MSG_ONE, SVC_SMALLKICK);
|
||||
|
||||
//Added weapon kickback (as long as you're not in mid air)
|
||||
if (self.flags & FL_ONGROUND)
|
||||
self.velocity = self.velocity + v_forward* -115;
|
||||
if (@self.flags & FL_ONGROUND)
|
||||
@self.velocity = @self.velocity + v_forward* -115;
|
||||
newmis = spawn ();
|
||||
newmis.voided = 0;
|
||||
newmis.owner = self;
|
||||
newmis.owner = @self;
|
||||
newmis.movetype = MOVETYPE_BOUNCE;
|
||||
newmis.solid = SOLID_BBOX;
|
||||
newmis.classname = "shrapnel";
|
||||
|
@ -674,11 +674,11 @@ void() W_FireShrapnel =
|
|||
newmis.shrap_time = time + 120;
|
||||
|
||||
// set newmis speed
|
||||
makevectors (self.v_angle);
|
||||
if (self.v_angle_x) {
|
||||
makevectors (@self.v_angle);
|
||||
if (@self.v_angle_x) {
|
||||
newmis.velocity = v_forward*600 + v_up * 200 + crandom()*v_right*10 + crandom()*v_up*10;
|
||||
} else {
|
||||
newmis.velocity = aim(self, 10000);
|
||||
newmis.velocity = aim(@self, 10000);
|
||||
newmis.velocity = newmis.velocity * 600;
|
||||
newmis.velocity_z = 200;
|
||||
}
|
||||
|
@ -692,7 +692,7 @@ void() W_FireShrapnel =
|
|||
setmodel (newmis, "progs/grenade.mdl");
|
||||
newmis.skin = 2;
|
||||
setsize (newmis, '0 0 0', '0 0 0');
|
||||
setorigin (newmis, self.origin);
|
||||
setorigin (newmis, @self.origin);
|
||||
};
|
||||
/*
|
||||
============
|
||||
|
@ -704,114 +704,114 @@ POX v1.1 - seperated this from weapons.qc - cleaned it up a bit
|
|||
void() W_SecondTrigger =
|
||||
{
|
||||
if (intermission_running) { // Don't fire during intermission
|
||||
self.impulse = 0;
|
||||
@self.impulse = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
switch (self.weapon) {
|
||||
switch (@self.weapon) {
|
||||
case IT_TSHOT: // T-Shot (prime)
|
||||
// do it only if it hasn't already been primed and has 3 or more shells
|
||||
if ((!self.prime_tshot) && (self.ammo_shells >= 3)) {
|
||||
self.st_tshotload = time + 0.9; //give the reload a chance to happen
|
||||
if ((!@self.prime_tshot) && (@self.ammo_shells >= 3)) {
|
||||
@self.st_tshotload = time + 0.9; //give the reload a chance to happen
|
||||
|
||||
// make a reload sound
|
||||
sound (self, CHAN_WEAPON, "weapons/tsload.wav", 1, ATTN_NORM);
|
||||
sound (@self, CHAN_WEAPON, "weapons/tsload.wav", 1, ATTN_NORM);
|
||||
player_reshot1(); // play prime animation
|
||||
|
||||
self.prime_tshot = TRUE; // set the prime bit
|
||||
@self.prime_tshot = TRUE; // set the prime bit
|
||||
}
|
||||
break;
|
||||
|
||||
case IT_COMBOGUN: // impact grenade
|
||||
if (self.ammo_rockets > 0) { // check for rockets
|
||||
if (self.st_pball < time) {
|
||||
self.items &= ~IT_SHELLS;
|
||||
self.items |= IT_ROCKETS;
|
||||
self.currentammo = self.ammo_rockets;
|
||||
self.which_ammo = 1;
|
||||
if (@self.ammo_rockets > 0) { // check for rockets
|
||||
if (@self.st_pball < time) {
|
||||
@self.items &= ~IT_SHELLS;
|
||||
@self.items |= IT_ROCKETS;
|
||||
@self.currentammo = @self.ammo_rockets;
|
||||
@self.which_ammo = 1;
|
||||
player_gshot1();
|
||||
SuperDamageSound();
|
||||
W_FirePball();
|
||||
self.st_pball = time + 0.9;
|
||||
@self.st_pball = time + 0.9;
|
||||
} else { // misfire if it hasn't been long enough
|
||||
sound (self, CHAN_WEAPON, "weapons/mfire1.wav", 1, ATTN_NORM);
|
||||
sound (@self, CHAN_WEAPON, "weapons/mfire1.wav", 1, ATTN_NORM);
|
||||
}
|
||||
} else {
|
||||
self.items &= ~IT_SHELLS;
|
||||
self.items |= IT_ROCKETS;
|
||||
self.currentammo = self.ammo_rockets;
|
||||
self.which_ammo = 1;
|
||||
sound (self, CHAN_WEAPON, "weapons/mfire1.wav", 1, ATTN_NORM);
|
||||
@self.items &= ~IT_SHELLS;
|
||||
@self.items |= IT_ROCKETS;
|
||||
@self.currentammo = @self.ammo_rockets;
|
||||
@self.which_ammo = 1;
|
||||
sound (@self, CHAN_WEAPON, "weapons/mfire1.wav", 1, ATTN_NORM);
|
||||
}
|
||||
break;
|
||||
|
||||
case IT_PLASMAGUN: // plasma burst
|
||||
if (self.ammo_cells >= 9 && self.st_mplasma < time) { // check for cells and time
|
||||
if (self.waterlevel > 1) { // explode under water
|
||||
sound (self, CHAN_WEAPON, "weapons/mplasex.wav", 1, ATTN_NORM);
|
||||
self.ammo_cells = 0;
|
||||
if (@self.ammo_cells >= 9 && @self.st_mplasma < time) { // check for cells and time
|
||||
if (@self.waterlevel > 1) { // explode under water
|
||||
sound (@self, CHAN_WEAPON, "weapons/mplasex.wav", 1, ATTN_NORM);
|
||||
@self.ammo_cells = 0;
|
||||
W_SetCurrentAmmo ();
|
||||
T_RadiusDamage (self, self, 250, world, "waterplasma");
|
||||
T_RadiusDamage (@self, @self, 250, world, "waterplasma");
|
||||
break;
|
||||
}
|
||||
self.weaponframe = 0;
|
||||
@self.weaponframe = 0;
|
||||
SuperDamageSound ();
|
||||
self.st_mplasma = time + 1.9;
|
||||
@self.st_mplasma = time + 1.9;
|
||||
player_mplasma1 ();
|
||||
launch_megaplasma ();
|
||||
break;
|
||||
}
|
||||
sound (self, CHAN_AUTO, "weapons/mfire2.wav", 1, ATTN_NORM);
|
||||
sound (@self, CHAN_AUTO, "weapons/mfire2.wav", 1, ATTN_NORM);
|
||||
break;
|
||||
|
||||
case IT_SUPER_NAILGUN: // shrapnel bomb
|
||||
if (self.shrap_detonate) { // bomb is already set
|
||||
sound (self, CHAN_WEAPON, "weapons/shrapdet.wav", 1, ATTN_NORM);
|
||||
if (@self.shrap_detonate) { // bomb is already set
|
||||
sound (@self, CHAN_WEAPON, "weapons/shrapdet.wav", 1, ATTN_NORM);
|
||||
SuperDamageSound ();
|
||||
self.st_shrapnel = time + 0.7; // Time out before next launch
|
||||
self.shrap_detonate = 2; // Tell the bomb to blow!
|
||||
@self.st_shrapnel = time + 0.7; // Time out before next launch
|
||||
@self.shrap_detonate = 2; // Tell the bomb to blow!
|
||||
break;
|
||||
}
|
||||
|
||||
if (self.ammo_nails >= 30 && self.ammo_rockets > 0) { // toss one
|
||||
self.weaponframe = 0;
|
||||
if (@self.ammo_nails >= 30 && @self.ammo_rockets > 0) { // toss one
|
||||
@self.weaponframe = 0;
|
||||
SuperDamageSound ();
|
||||
self.st_shrapnel = time + 0.1; // Allow a fast detonate
|
||||
@self.st_shrapnel = time + 0.1; // Allow a fast detonate
|
||||
player_shrap1 ();
|
||||
W_FireShrapnel ();
|
||||
|
||||
self.shrap_detonate = TRUE;
|
||||
@self.shrap_detonate = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
sound (self, CHAN_AUTO, "weapons/mfire1.wav", 1, ATTN_NORM);
|
||||
sprint (self, PRINT_HIGH, "Not enough ammo...\n");
|
||||
sound (@self, CHAN_AUTO, "weapons/mfire1.wav", 1, ATTN_NORM);
|
||||
sprint (@self, PRINT_HIGH, "Not enough ammo...\n");
|
||||
break;
|
||||
|
||||
case IT_GRENADE_LAUNCHER: // phase mine
|
||||
if (self.ammo_rockets >= 1 && self.st_mine < time) {
|
||||
if (@self.ammo_rockets >= 1 && @self.st_mine < time) {
|
||||
player_grenade1 ();
|
||||
W_FireMine ();
|
||||
|
||||
// big delay between refires helps keep the # of mines down in a deathmatch game
|
||||
self.st_mine = time + 1.25;
|
||||
@self.st_mine = time + 1.25;
|
||||
break;
|
||||
}
|
||||
|
||||
sound (self, CHAN_WEAPON, "weapons/mfire1.wav", 1, ATTN_NORM);
|
||||
sound (@self, CHAN_WEAPON, "weapons/mfire1.wav", 1, ATTN_NORM);
|
||||
break;
|
||||
|
||||
case IT_ROCKET_LAUNCHER: // reload the rhino
|
||||
if (self.reload_rocket && self.ammo_rockets >= 1) {
|
||||
self.st_rocketload = time + 0.6;
|
||||
sound (self, CHAN_WEAPON, "weapons/rhinore.wav", 1, ATTN_NORM);
|
||||
if (@self.reload_rocket && @self.ammo_rockets >= 1) {
|
||||
@self.st_rocketload = time + 0.6;
|
||||
sound (@self, CHAN_WEAPON, "weapons/rhinore.wav", 1, ATTN_NORM);
|
||||
player_rocketload1 (); // play reload animation
|
||||
self.reload_rocket = FALSE;
|
||||
@self.reload_rocket = FALSE;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
self.impulse = 0;
|
||||
@self.impulse = 0;
|
||||
};
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
|
||||
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);};
|
||||
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
|
||||
|
@ -37,34 +37,34 @@ moving towards it, change the next destination and continue.
|
|||
void() t_movetarget =
|
||||
{
|
||||
local entity temp;
|
||||
if (other.movetarget != self)
|
||||
if (other.movetarget != @self)
|
||||
return;
|
||||
|
||||
if (other.enemy)
|
||||
return; // fighting, not following a path
|
||||
temp = self;
|
||||
self = other;
|
||||
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
|
||||
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.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 ();
|
||||
@self.pausetime = time + 999999;
|
||||
@self.th_stand ();
|
||||
return;
|
||||
}
|
||||
};
|
||||
void() movetarget_f =
|
||||
{
|
||||
if (!self.targetname)
|
||||
if (!@self.targetname)
|
||||
objerror ("monster_movetarget: no targetname");
|
||||
|
||||
self.solid = SOLID_TRIGGER;
|
||||
self.touch = t_movetarget;
|
||||
setsize (self, '-8 -8 -8', '8 8 8');
|
||||
@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)
|
||||
|
|
|
@ -23,7 +23,7 @@ WEB: http://www.planetquake.com/paroxysm/
|
|||
// Regen Station default ambient sound
|
||||
void() regen_ambientsound =
|
||||
{
|
||||
ambientsound (self.origin, "ambience/regen1.wav", 0.5, ATTN_STATIC);
|
||||
ambientsound (@self.origin, "ambience/regen1.wav", 0.5, ATTN_STATIC);
|
||||
};
|
||||
|
||||
// Particle stream replaced by a model with client side animation
|
||||
|
@ -31,9 +31,9 @@ void() regen_ambientsound =
|
|||
// A particle effect for regen stations
|
||||
void (void) regen_make_smoke =
|
||||
{
|
||||
particle (self.origin + '0 0 +6', '1 1 36', self.clr, 12);
|
||||
particle (self.origin + '0 0 +6', '-1 -1 36', self.clr, 12);
|
||||
self.nextthink = time + 0.1;
|
||||
particle (@self.origin + '0 0 +6', '1 1 36', @self.clr, 12);
|
||||
particle (@self.origin + '0 0 +6', '-1 -1 36', @self.clr, 12);
|
||||
@self.nextthink = time + 0.1;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@ -49,7 +49,7 @@ void (float color) regen_streamer =
|
|||
setmodel (streamer, "progs/stream.mdl");
|
||||
setsize (streamer, '-16 -16 0', '16 16 56');
|
||||
streamer.velocity = '0 0 0';
|
||||
setorigin (streamer, self.origin);
|
||||
setorigin (streamer, @self.origin);
|
||||
|
||||
streamer.skin = color;
|
||||
|
||||
|
@ -64,12 +64,12 @@ void () regen_touch =
|
|||
if (other.regen_finished > time) // already touched
|
||||
return;
|
||||
|
||||
if (other.armorvalue >= self.armregen) { // Station can't give more
|
||||
if (other.armorvalue >= @self.armregen) { // Station can't give more
|
||||
other.regen_finished = time;
|
||||
return;
|
||||
}
|
||||
|
||||
other.armregen = self.armregen;
|
||||
other.armregen = @self.armregen;
|
||||
other.regen_finished = time + 0.2;
|
||||
|
||||
};
|
||||
|
@ -77,11 +77,11 @@ void () regen_touch =
|
|||
// Regen triggers for custom maps - can be BIG (whole rooms)
|
||||
void () regen_station =
|
||||
{
|
||||
if (self.armregen <= 0)
|
||||
self.armregen = 50;
|
||||
if (@self.armregen <= 0)
|
||||
@self.armregen = 50;
|
||||
InitTrigger ();
|
||||
self.touch = regen_touch;
|
||||
//self.netname = "regen station";
|
||||
@self.touch = regen_touch;
|
||||
//@self.netname = "regen station";
|
||||
};
|
||||
|
||||
void (float type, float value) item_armor =
|
||||
|
@ -94,19 +94,19 @@ void (float type, float value) item_armor =
|
|||
precache_model ("progs/regen.mdl");
|
||||
precache_model ("progs/stream.mdl");
|
||||
|
||||
self.touch = regen_touch;
|
||||
setmodel (self, "progs/regen.mdl");
|
||||
self.skin = type;
|
||||
setsize (self, '-16 -16 0', '16 16 56');
|
||||
self.solid = SOLID_TRIGGER;
|
||||
@self.touch = regen_touch;
|
||||
setmodel (@self, "progs/regen.mdl");
|
||||
@self.skin = type;
|
||||
setsize (@self, '-16 -16 0', '16 16 56');
|
||||
@self.solid = SOLID_TRIGGER;
|
||||
|
||||
// Some existing DM maps rely on Droptofloor for proper placement
|
||||
self.movetype = MOVETYPE_TOSS;
|
||||
self.velocity = '0 0 0';
|
||||
self.origin_z = self.origin_z + 6;
|
||||
//self.netname = "regen station";
|
||||
@self.movetype = MOVETYPE_TOSS;
|
||||
@self.velocity = '0 0 0';
|
||||
@self.origin_z = @self.origin_z + 6;
|
||||
//@self.netname = "regen station";
|
||||
|
||||
self.armregen = value;
|
||||
@self.armregen = value;
|
||||
|
||||
regen_streamer (type);
|
||||
};
|
||||
|
|
|
@ -15,11 +15,11 @@ Feel free to use this code in anyway.
|
|||
.float spark_freq; // To avoid 'not a feild' server errors
|
||||
void() e_spark =
|
||||
{
|
||||
remove (self);
|
||||
remove (@self);
|
||||
};
|
||||
void() a_drip =
|
||||
{
|
||||
remove (self);
|
||||
remove (@self);
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -64,44 +64,44 @@ void() play_sound;
|
|||
void() sound_wait =
|
||||
{
|
||||
// hang around until next use
|
||||
self.nextthink = time + 60*10;
|
||||
self.think = sound_wait;
|
||||
@self.nextthink = time + 60*10;
|
||||
@self.think = sound_wait;
|
||||
};
|
||||
void() stop_sound =
|
||||
{
|
||||
// if sound is set to toggle, silence it and set use to play
|
||||
if (self.spawnflags & TOGGLE_SND)
|
||||
if (@self.spawnflags & TOGGLE_SND)
|
||||
{
|
||||
sound (self, CHAN_VOICE, "misc/null.wav", 0, self.snd_attn);
|
||||
self.use = play_sound;
|
||||
sound (@self, CHAN_VOICE, "misc/null.wav", 0, @self.snd_attn);
|
||||
@self.use = play_sound;
|
||||
sound_wait();
|
||||
}
|
||||
|
||||
// sound doesn't toggle so kill it
|
||||
else
|
||||
{
|
||||
sound (self, CHAN_VOICE, "misc/null.wav", 0, self.snd_attn);
|
||||
remove (self);
|
||||
sound (@self, CHAN_VOICE, "misc/null.wav", 0, @self.snd_attn);
|
||||
remove (@self);
|
||||
}
|
||||
};
|
||||
void() play_sound =
|
||||
{
|
||||
//infinite repeat
|
||||
if (self.snd_rep == -2)
|
||||
if (@self.snd_rep == -2)
|
||||
{
|
||||
sound (self, CHAN_VOICE, self.the_snd, self.snd_volume, self.snd_attn);
|
||||
sound (@self, CHAN_VOICE, @self.the_snd, @self.snd_volume, @self.snd_attn);
|
||||
sound_think();
|
||||
}
|
||||
|
||||
// sound is done
|
||||
else if (self.snd_rep == 0)
|
||||
remove (self);
|
||||
else if (@self.snd_rep == 0)
|
||||
remove (@self);
|
||||
|
||||
// play the sound and reduce repititions by 1
|
||||
if (self.snd_rep >= 1)
|
||||
if (@self.snd_rep >= 1)
|
||||
{
|
||||
sound (self, CHAN_VOICE, self.the_snd, self.snd_volume, self.snd_attn);
|
||||
self.snd_rep = self.snd_rep - 1;
|
||||
sound (@self, CHAN_VOICE, @self.the_snd, @self.snd_volume, @self.snd_attn);
|
||||
@self.snd_rep = @self.snd_rep - 1;
|
||||
sound_think();
|
||||
}
|
||||
|
||||
|
@ -109,43 +109,43 @@ void() play_sound =
|
|||
void() sound_think =
|
||||
{
|
||||
// if sound is toggled, set next use to stop
|
||||
if (self.spawnflags & TOGGLE_SND)
|
||||
self.use = stop_sound;
|
||||
if (@self.spawnflags & TOGGLE_SND)
|
||||
@self.use = stop_sound;
|
||||
|
||||
// determine user-defined loop time then play the sound
|
||||
self.nextthink = time + (random()*self.snd_rand) + self.snd_loop;
|
||||
self.think = play_sound;
|
||||
@self.nextthink = time + (random()*@self.snd_rand) + @self.snd_loop;
|
||||
@self.think = play_sound;
|
||||
};
|
||||
void() cust_sound =
|
||||
{
|
||||
precache_sound (self.the_snd);
|
||||
precache_sound (@self.the_snd);
|
||||
precache_sound ("misc/null.wav");
|
||||
|
||||
//default attenuation to NORM if not specified
|
||||
if(!self.snd_attn)
|
||||
self.snd_attn = 2;
|
||||
if(!@self.snd_attn)
|
||||
@self.snd_attn = 2;
|
||||
|
||||
self.snd_attn = self.snd_attn - 1;// needed so the default to NORM works (since 0 = NONE)
|
||||
@self.snd_attn = @self.snd_attn - 1;// needed so the default to NORM works (since 0 = NONE)
|
||||
|
||||
//default volume to one if not specified
|
||||
if(self.snd_volume <= 0)
|
||||
self.snd_volume = 1;
|
||||
if(@self.snd_volume <= 0)
|
||||
@self.snd_volume = 1;
|
||||
|
||||
// start sound if not triggered
|
||||
if (!self.targetname)
|
||||
if (!@self.targetname)
|
||||
play_sound();
|
||||
|
||||
// start sound if initially on, set use to stop_sound
|
||||
if (self.strt_onoff == 0)
|
||||
if (@self.strt_onoff == 0)
|
||||
{
|
||||
self.use = stop_sound;
|
||||
@self.use = stop_sound;
|
||||
play_sound();
|
||||
}
|
||||
|
||||
// start sound when triggered
|
||||
if (self.strt_onoff == 1)
|
||||
if (@self.strt_onoff == 1)
|
||||
{
|
||||
self.use = play_sound;
|
||||
@self.use = play_sound;
|
||||
}
|
||||
|
||||
};
|
||||
|
@ -159,33 +159,33 @@ void() cust_sound =
|
|||
//CoolEdit 1.5 (for Windows) is the only editor that can create these looping wavs (to my knowledge)
|
||||
void() ambientsound_go =
|
||||
{
|
||||
ambientsound (self.origin, self.the_snd, self.snd_volume, self.snd_attn);
|
||||
ambientsound (@self.origin, @self.the_snd, @self.snd_volume, @self.snd_attn);
|
||||
};
|
||||
void() ambient_sound =
|
||||
{
|
||||
precache_sound (self.the_snd);
|
||||
precache_sound (@self.the_snd);
|
||||
|
||||
//default volume to one if not specified
|
||||
if(self.snd_volume <= 0)
|
||||
self.snd_volume = 1;
|
||||
if(@self.snd_volume <= 0)
|
||||
@self.snd_volume = 1;
|
||||
|
||||
//default attenuation to NORM if not specified
|
||||
if(!self.snd_attn)
|
||||
self.snd_attn = 2;
|
||||
if(!@self.snd_attn)
|
||||
@self.snd_attn = 2;
|
||||
|
||||
self.snd_attn = self.snd_attn - 1;// needed so the default to NORM works (since 0 = NONE)
|
||||
@self.snd_attn = @self.snd_attn - 1;// needed so the default to NORM works (since 0 = NONE)
|
||||
|
||||
//start right away if not triggered
|
||||
if(!self.targetname)
|
||||
if(!@self.targetname)
|
||||
{
|
||||
//Needs to start on the second frame since that's when entities not called in world_spawn are created
|
||||
self.nextthink = time + 0.1;
|
||||
self.think = ambientsound_go;
|
||||
@self.nextthink = time + 0.1;
|
||||
@self.think = ambientsound_go;
|
||||
}
|
||||
|
||||
//wait for trigger
|
||||
else
|
||||
self.use = ambientsound_go;
|
||||
@self.use = ambientsound_go;
|
||||
};
|
||||
/*
|
||||
colour_light is a small hack to try and simulate coloured lighting.
|
||||
|
@ -214,14 +214,14 @@ void() colourlight_off =
|
|||
|
||||
//turn it off and reset
|
||||
stuffcmd (other, "v_cshift 0 0 0 0\n");
|
||||
self.use = colourlight_wait;
|
||||
self.touch = SUB_Null;
|
||||
@self.use = colourlight_wait;
|
||||
@self.touch = SUB_Null;
|
||||
|
||||
};
|
||||
void() colourlight_toggle =
|
||||
{
|
||||
//called after light is triggered a second time
|
||||
self.touch = colourlight_off;
|
||||
@self.touch = colourlight_off;
|
||||
};
|
||||
|
||||
void() colourlight_use =
|
||||
|
@ -233,21 +233,21 @@ void() colourlight_use =
|
|||
if(other.cshift_finished > time)
|
||||
return;
|
||||
|
||||
stuffcmd (other, self.colourvalue);
|
||||
stuffcmd (other, @self.colourvalue);
|
||||
|
||||
//POX v1.2 - better clearing of v_cshift (in PostThink)
|
||||
other.cshift_off = FALSE;
|
||||
other.cshift_finished = time + 0.1; //check every frame
|
||||
|
||||
//if targetted, alow it to be shut down
|
||||
if(self.targetname)
|
||||
self.use = colourlight_toggle;
|
||||
if(@self.targetname)
|
||||
@self.use = colourlight_toggle;
|
||||
|
||||
};
|
||||
void() colourlight_wait =
|
||||
{
|
||||
//activated by a trigger so wait for touch
|
||||
self.touch = colourlight_use;
|
||||
@self.touch = colourlight_use;
|
||||
};
|
||||
void() colour_light =
|
||||
{
|
||||
|
@ -256,11 +256,11 @@ void() colour_light =
|
|||
//Can be made active by use of a targetname
|
||||
//Must be triggered by touch
|
||||
|
||||
if(!self.targetname || !(self.spawnflags & CLSTART_OFF)) {
|
||||
self.touch = colourlight_use;
|
||||
if(!@self.targetname || !(@self.spawnflags & CLSTART_OFF)) {
|
||||
@self.touch = colourlight_use;
|
||||
} else {
|
||||
self.use = colourlight_wait;
|
||||
self.touch = SUB_Null;
|
||||
@self.use = colourlight_wait;
|
||||
@self.touch = SUB_Null;
|
||||
}
|
||||
};
|
||||
/*
|
||||
|
@ -277,20 +277,20 @@ void() particle_stream =
|
|||
precache_sound("ambience/regen1.wav");
|
||||
precache_model ("progs/stream.mdl");
|
||||
|
||||
self.angles = '0 0 0';
|
||||
self.solid = SOLID_NOT;
|
||||
self.movetype = MOVETYPE_NONE;
|
||||
setmodel(self, "progs/stream.mdl");
|
||||
@self.angles = '0 0 0';
|
||||
@self.solid = SOLID_NOT;
|
||||
@self.movetype = MOVETYPE_NONE;
|
||||
setmodel(@self, "progs/stream.mdl");
|
||||
|
||||
//POX v1.2 - just in case
|
||||
if(self.clr > 2 || self.clr < 0)
|
||||
self.clr = 0;
|
||||
if(@self.clr > 2 || @self.clr < 0)
|
||||
@self.clr = 0;
|
||||
|
||||
self.skin = self.clr;
|
||||
@self.skin = @self.clr;
|
||||
|
||||
//POX v1.2 Fixed sound orign (makestatic messed it up?)
|
||||
regen_ambientsound ();
|
||||
makestatic (self);
|
||||
makestatic (@self);
|
||||
|
||||
};
|
||||
/*
|
||||
|
@ -301,52 +301,52 @@ Try to use rectangular objects, since entites use bounding box collision detecti
|
|||
*/
|
||||
void() bsp_explode =
|
||||
{
|
||||
self.takedamage = DAMAGE_NO;
|
||||
self.trigger_field.classname = "explo_box";
|
||||
@self.takedamage = DAMAGE_NO;
|
||||
@self.trigger_field.classname = "explo_box";
|
||||
|
||||
// did say self.owner
|
||||
T_RadiusDamage (self.trigger_field, self.trigger_field, self.dmg, world, "");
|
||||
sound (self.trigger_field, CHAN_VOICE, "weapons/r_exp3.wav", 1, ATTN_NORM);
|
||||
// did say @self.owner
|
||||
T_RadiusDamage (@self.trigger_field, @self.trigger_field, @self.dmg, world, "");
|
||||
sound (@self.trigger_field, CHAN_VOICE, "weapons/r_exp3.wav", 1, ATTN_NORM);
|
||||
|
||||
WriteByte (MSG_MULTICAST, SVC_TEMPENTITY);
|
||||
WriteByte (MSG_MULTICAST, TE_EXPLOSION);
|
||||
WriteCoord (MSG_MULTICAST, self.trigger_field.origin_x);
|
||||
WriteCoord (MSG_MULTICAST, self.trigger_field.origin_y);
|
||||
WriteCoord (MSG_MULTICAST, self.trigger_field.origin_z);
|
||||
multicast (self.origin, MULTICAST_PHS);
|
||||
WriteCoord (MSG_MULTICAST, @self.trigger_field.origin_x);
|
||||
WriteCoord (MSG_MULTICAST, @self.trigger_field.origin_y);
|
||||
WriteCoord (MSG_MULTICAST, @self.trigger_field.origin_z);
|
||||
multicast (@self.origin, MULTICAST_PHS);
|
||||
|
||||
remove (self);
|
||||
remove (self.trigger_field);
|
||||
remove (@self);
|
||||
remove (@self.trigger_field);
|
||||
};
|
||||
|
||||
void() misc_explobsp =
|
||||
{
|
||||
local entity spot;
|
||||
|
||||
self.solid = SOLID_BBOX;
|
||||
self.movetype = MOVETYPE_NONE;
|
||||
@self.solid = SOLID_BBOX;
|
||||
@self.movetype = MOVETYPE_NONE;
|
||||
|
||||
setmodel (self, self.model);
|
||||
setsize( self, self.mins, self.maxs );
|
||||
setmodel (@self, @self.model);
|
||||
setsize( @self, @self.mins, @self.maxs );
|
||||
precache_sound ("weapons/r_exp3.wav");
|
||||
|
||||
if (!self.health)
|
||||
self.health = 20;
|
||||
if (!@self.health)
|
||||
@self.health = 20;
|
||||
|
||||
if (!self.dmg)
|
||||
self.dmg = 160;
|
||||
if (!@self.dmg)
|
||||
@self.dmg = 160;
|
||||
|
||||
self.th_die = bsp_explode;
|
||||
self.takedamage = DAMAGE_AIM;
|
||||
self.nobleed = TRUE;
|
||||
@self.th_die = bsp_explode;
|
||||
@self.takedamage = DAMAGE_AIM;
|
||||
@self.nobleed = TRUE;
|
||||
|
||||
//POX 1.2 - HACK!
|
||||
//put a null entity at the center of the model to hold the explosion position
|
||||
spot = spawn();
|
||||
setmodel (spot, string_null);
|
||||
spot.origin_x = self.absmin_x + (self.size_x * 0.5);
|
||||
spot.origin_y = self.absmin_y + (self.size_y * 0.5);
|
||||
spot.origin_z = self.absmin_z + (self.size_z * 0.5);
|
||||
spot.origin_x = @self.absmin_x + (@self.size_x * 0.5);
|
||||
spot.origin_y = @self.absmin_y + (@self.size_y * 0.5);
|
||||
spot.origin_z = @self.absmin_z + (@self.size_z * 0.5);
|
||||
setsize (spot, '0 0 0', '0 0 0');
|
||||
self.trigger_field = spot;
|
||||
@self.trigger_field = spot;
|
||||
};
|
||||
|
|
|
@ -21,9 +21,9 @@ called when a spectator connects to a server
|
|||
void() SpectatorConnect =
|
||||
{
|
||||
bprint (PRINT_MEDIUM, "Spectator ");
|
||||
bprint (PRINT_MEDIUM, self.netname);
|
||||
bprint (PRINT_MEDIUM, @self.netname);
|
||||
bprint (PRINT_MEDIUM, " entered the game\n");
|
||||
self.goalentity = world; // used for impulse 1 below
|
||||
@self.goalentity = world; // used for impulse 1 below
|
||||
};
|
||||
/*
|
||||
===========
|
||||
|
@ -34,7 +34,7 @@ called when a spectator disconnects from a server
|
|||
void() SpectatorDisconnect =
|
||||
{
|
||||
bprint (PRINT_MEDIUM, "Spectator ");
|
||||
bprint (PRINT_MEDIUM, self.netname);
|
||||
bprint (PRINT_MEDIUM, @self.netname);
|
||||
bprint (PRINT_MEDIUM, " left the game\n");
|
||||
};
|
||||
/*
|
||||
|
@ -45,20 +45,20 @@ Called by SpectatorThink if the spectator entered an impulse
|
|||
*/
|
||||
void() SpectatorImpulseCommand =
|
||||
{
|
||||
if (self.impulse == 1) {
|
||||
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.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;
|
||||
@self.impulse = 0;
|
||||
};
|
||||
/*
|
||||
================
|
||||
|
@ -68,8 +68,8 @@ Called every frame after physics are run
|
|||
*/
|
||||
void() SpectatorThink =
|
||||
{
|
||||
// self.origin, etc contains spectator position, so you could
|
||||
// @self.origin, etc contains spectator position, so you could
|
||||
// do some neat stuff here
|
||||
if (self.impulse)
|
||||
if (@self.impulse)
|
||||
SpectatorImpulseCommand();
|
||||
};
|
||||
|
|
|
@ -3,24 +3,24 @@
|
|||
#include "paroxysm.rh"
|
||||
|
||||
void() SUB_Null = {};
|
||||
void() SUB_Remove = {remove(self);};
|
||||
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';
|
||||
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;
|
||||
makevectors (@self.angles);
|
||||
@self.movedir = v_forward;
|
||||
}
|
||||
|
||||
self.angles = '0 0 0';
|
||||
@self.angles = '0 0 0';
|
||||
};
|
||||
/*
|
||||
================
|
||||
|
@ -31,28 +31,28 @@ 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')
|
||||
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 = "";
|
||||
@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
|
||||
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;
|
||||
stemp = @self;
|
||||
@self = ent;
|
||||
SUB_CalcMove (tdest, tspeed, func);
|
||||
self = stemp;
|
||||
@self = stemp;
|
||||
};
|
||||
|
||||
void(vector tdest, float tspeed, void() func) SUB_CalcMove =
|
||||
|
@ -61,18 +61,18 @@ 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.think1 = func;
|
||||
@self.finaldest = tdest;
|
||||
@self.think = SUB_CalcMoveDone;
|
||||
if (tdest == @self.origin)
|
||||
{
|
||||
self.velocity = '0 0 0';
|
||||
self.nextthink = self.ltime + 0.1;
|
||||
@self.velocity = '0 0 0';
|
||||
@self.nextthink = @self.ltime + 0.1;
|
||||
return;
|
||||
}
|
||||
|
||||
// set destdelta to the vector needed to move
|
||||
vdestdelta = tdest - self.origin;
|
||||
vdestdelta = tdest - @self.origin;
|
||||
|
||||
// calculate length of vector
|
||||
len = vlen (vdestdelta);
|
||||
|
@ -83,9 +83,9 @@ local float len, traveltime;
|
|||
traveltime = 0.03;
|
||||
|
||||
// set nextthink to trigger a think when dest is reached
|
||||
self.nextthink = self.ltime + traveltime;
|
||||
@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
|
||||
@self.velocity = vdestdelta * (1/traveltime); // qcc won't take vec/float
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -93,28 +93,28 @@ local float len, traveltime;
|
|||
*/
|
||||
void() SUB_CalcMoveDone =
|
||||
{
|
||||
setorigin (self, self.finaldest);
|
||||
self.velocity = '0 0 0';
|
||||
self.nextthink = -1;
|
||||
if (self.think1)
|
||||
self.think1 ();
|
||||
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
|
||||
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;
|
||||
stemp = @self;
|
||||
@self = ent;
|
||||
SUB_CalcAngleMove (destangle, tspeed, func);
|
||||
self = stemp;
|
||||
@self = stemp;
|
||||
};
|
||||
|
||||
void (vector destangle, float tspeed, void() func) SUB_CalcAngleMove =
|
||||
|
@ -126,7 +126,7 @@ void (vector destangle, float tspeed, void() func) SUB_CalcAngleMove =
|
|||
objerror ("No speed is defined!");
|
||||
|
||||
// set destdelta to the vector needed to move
|
||||
destdelta = destangle - self.angles;
|
||||
destdelta = destangle - @self.angles;
|
||||
|
||||
// calculate length of vector
|
||||
len = vlen (destdelta);
|
||||
|
@ -135,14 +135,14 @@ void (vector destangle, float tspeed, void() func) SUB_CalcAngleMove =
|
|||
traveltime = len / tspeed;
|
||||
|
||||
// set nextthink to trigger a think when dest is reached
|
||||
self.nextthink = self.ltime + traveltime;
|
||||
@self.nextthink = @self.ltime + traveltime;
|
||||
|
||||
// scale the destdelta vector by the time spent traveling to get velocity
|
||||
self.avelocity = destdelta * (1 / traveltime);
|
||||
@self.avelocity = destdelta * (1 / traveltime);
|
||||
|
||||
self.think1 = func;
|
||||
self.finalangle = destangle;
|
||||
self.think = SUB_CalcAngleMoveDone;
|
||||
@self.think1 = func;
|
||||
@self.finalangle = destangle;
|
||||
@self.think = SUB_CalcAngleMoveDone;
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -152,30 +152,30 @@ 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();
|
||||
@self.angles = @self.finalangle;
|
||||
@self.avelocity = '0 0 0';
|
||||
@self.nextthink = -1;
|
||||
if (@self.think1)
|
||||
@self.think1();
|
||||
};
|
||||
//=============================================================================
|
||||
void() DelayThink =
|
||||
{
|
||||
activator = self.enemy;
|
||||
activator = @self.enemy;
|
||||
SUB_UseTargets ();
|
||||
remove(self);
|
||||
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
|
||||
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,
|
||||
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
|
||||
match (string)@self.target and call their .use function
|
||||
==============================
|
||||
*/
|
||||
void() SUB_UseTargets =
|
||||
|
@ -186,32 +186,32 @@ void() SUB_UseTargets =
|
|||
/*
|
||||
check for a delay
|
||||
*/
|
||||
if (self.delay) { // create a temp object to fire at a later time
|
||||
if (@self.delay) { // create a temp object to fire at a later time
|
||||
t = spawn();
|
||||
t.classname = "DelayedUse";
|
||||
t.nextthink = time + self.delay;
|
||||
t.nextthink = time + @self.delay;
|
||||
t.think = DelayThink;
|
||||
t.enemy = activator;
|
||||
t.message = self.message;
|
||||
t.killtarget = self.killtarget;
|
||||
t.target = self.target;
|
||||
t.message = @self.message;
|
||||
t.killtarget = @self.killtarget;
|
||||
t.target = @self.target;
|
||||
return;
|
||||
}
|
||||
|
||||
// print the message
|
||||
if ((activator.classname == "player") && (self.message != "")) {
|
||||
self.target_id_finished = time + 4; // don't let TargetID override centerprints
|
||||
if ((activator.classname == "player") && (@self.message != "")) {
|
||||
@self.target_id_finished = time + 4; // don't let TargetID override centerprints
|
||||
|
||||
centerprint (activator, self.message);
|
||||
if (!self.noise)
|
||||
centerprint (activator, @self.message);
|
||||
if (!@self.noise)
|
||||
sound (activator, CHAN_VOICE, "misc/talk.wav", 1, ATTN_NORM);
|
||||
}
|
||||
|
||||
// kill the killtagets
|
||||
if (self.killtarget) {
|
||||
if (@self.killtarget) {
|
||||
t = world;
|
||||
do {
|
||||
if (!(t = find (t, targetname, self.killtarget)))
|
||||
if (!(t = find (t, targetname, @self.killtarget)))
|
||||
return;
|
||||
|
||||
remove (t);
|
||||
|
@ -219,25 +219,25 @@ void() SUB_UseTargets =
|
|||
}
|
||||
|
||||
// fire targets
|
||||
if (self.target) {
|
||||
if (@self.target) {
|
||||
act = activator;
|
||||
t = world;
|
||||
|
||||
do {
|
||||
if (!(t = find (t, targetname, self.target)))
|
||||
if (!(t = find (t, targetname, @self.target)))
|
||||
return;
|
||||
|
||||
stemp = self;
|
||||
stemp = @self;
|
||||
otemp = other;
|
||||
self = t;
|
||||
@self = t;
|
||||
other = stemp;
|
||||
|
||||
if (self.use != SUB_Null) {
|
||||
if (self.use)
|
||||
self.use ();
|
||||
if (@self.use != SUB_Null) {
|
||||
if (@self.use)
|
||||
@self.use ();
|
||||
}
|
||||
|
||||
self = stemp;
|
||||
@self = stemp;
|
||||
other = otemp;
|
||||
activator = act;
|
||||
} while ( 1 );
|
||||
|
|
|
@ -7,16 +7,16 @@
|
|||
/* POX - from original Quake ai.qc
|
||||
=============
|
||||
visible
|
||||
returns 1 if the entity is visible to self, even if not infront ()
|
||||
returns 1 if the entity is visible to @self, even if not infront ()
|
||||
=============
|
||||
*/
|
||||
float (entity targ) visible =
|
||||
{
|
||||
local vector spot1, spot2;
|
||||
|
||||
spot1 = self.origin + self.view_ofs;
|
||||
spot1 = @self.origin + @self.view_ofs;
|
||||
spot2 = targ.origin + targ.view_ofs;
|
||||
traceline (spot1, spot2, TRUE, self); // see through other monsters
|
||||
traceline (spot1, spot2, TRUE, @self); // see through other monsters
|
||||
|
||||
if (trace_inopen && trace_inwater)
|
||||
return FALSE; // sight line crossed contents
|
||||
|
@ -33,10 +33,10 @@ void() ID_CheckTarget =
|
|||
local string idfrags; //POX v1.12
|
||||
|
||||
//Lost target, or target died
|
||||
if (self.target_id_same < time || self.last_target_id.health < 1 || !visible(self.last_target_id))
|
||||
self.last_target_id = world;
|
||||
if (@self.target_id_same < time || @self.last_target_id.health < 1 || !visible(@self.last_target_id))
|
||||
@self.last_target_id = world;
|
||||
|
||||
traceline (self.origin , (self.origin+(v_forward * 800)) , FALSE , self);
|
||||
traceline (@self.origin , (@self.origin+(v_forward * 800)) , FALSE , @self);
|
||||
org = trace_endpos;
|
||||
|
||||
spot = findradius(org, 200);
|
||||
|
@ -45,26 +45,26 @@ void() ID_CheckTarget =
|
|||
if ((spot.classname == "player") && spot.takedamage)
|
||||
{
|
||||
//Same target as last time
|
||||
if (self.target_id_same > time && spot == self.last_target_id)
|
||||
if (@self.target_id_same > time && spot == @self.last_target_id)
|
||||
{
|
||||
self.target_id_finished = time + 1.5;
|
||||
self.target_id_same = time + 3;
|
||||
@self.target_id_finished = time + 1.5;
|
||||
@self.target_id_same = time + 3;
|
||||
return;
|
||||
}
|
||||
else if (spot != self && visible (spot) )//Found new Target
|
||||
else if (spot != @self && visible (spot) )//Found new Target
|
||||
{
|
||||
self.last_target_id = spot;
|
||||
self.target_id_finished = time + 1.5;
|
||||
self.target_id_same = time + 3;
|
||||
@self.last_target_id = spot;
|
||||
@self.target_id_finished = time + 1.5;
|
||||
@self.target_id_same = time + 3;
|
||||
|
||||
//POX v1.12 print the target's frags is observing
|
||||
if (self.classname == "LMSobserver")
|
||||
if (@self.classname == "LMSobserver")
|
||||
{
|
||||
idfrags = ftos (self.last_target_id.frags);
|
||||
centerprint4 (self, self.last_target_id.netname, "\n\n", idfrags, " frags remaining");
|
||||
idfrags = ftos (@self.last_target_id.frags);
|
||||
centerprint4 (@self, @self.last_target_id.netname, "\n\n", idfrags, " frags remaining");
|
||||
}
|
||||
else
|
||||
centerprint (self, self.last_target_id.netname);
|
||||
centerprint (@self, @self.last_target_id.netname);
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
entity stemp, otemp, s, old;
|
||||
void() trigger_reactivate =
|
||||
{
|
||||
self.solid = SOLID_TRIGGER;
|
||||
@self.solid = SOLID_TRIGGER;
|
||||
};
|
||||
//=============================================================================
|
||||
|
||||
|
@ -15,60 +15,60 @@ void() trigger_reactivate =
|
|||
// the wait time has passed, so set back up for another activation
|
||||
void() multi_wait =
|
||||
{
|
||||
if (self.max_health) {
|
||||
self.health = self.max_health;
|
||||
self.takedamage = DAMAGE_YES;
|
||||
self.solid = SOLID_BBOX;
|
||||
if (@self.max_health) {
|
||||
@self.health = @self.max_health;
|
||||
@self.takedamage = DAMAGE_YES;
|
||||
@self.solid = SOLID_BBOX;
|
||||
}
|
||||
};
|
||||
|
||||
// the trigger was just touched/killed/used
|
||||
// self.enemy should be set to the activator so it can be held through a delay
|
||||
// @self.enemy should be set to the activator so it can be held through a delay
|
||||
// so wait for the delay time before firing
|
||||
void() multi_trigger =
|
||||
{
|
||||
if (self.nextthink > time) {
|
||||
if (@self.nextthink > time) {
|
||||
return; // allready been triggered
|
||||
}
|
||||
|
||||
if (self.classname == "trigger_secret") {
|
||||
if (self.enemy.classname != "player")
|
||||
if (@self.classname == "trigger_secret") {
|
||||
if (@self.enemy.classname != "player")
|
||||
return;
|
||||
|
||||
found_secrets++;
|
||||
WriteByte (MSG_ALL, SVC_FOUNDSECRET);
|
||||
}
|
||||
|
||||
if (self.noise)
|
||||
sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
|
||||
if (@self.noise)
|
||||
sound (@self, CHAN_VOICE, @self.noise, 1, ATTN_NORM);
|
||||
|
||||
// don't trigger again until reset
|
||||
self.takedamage = DAMAGE_NO;
|
||||
activator = self.enemy;
|
||||
@self.takedamage = DAMAGE_NO;
|
||||
activator = @self.enemy;
|
||||
|
||||
SUB_UseTargets ();
|
||||
if (self.wait > 0) {
|
||||
self.think = multi_wait;
|
||||
self.nextthink = time + self.wait;
|
||||
if (@self.wait > 0) {
|
||||
@self.think = multi_wait;
|
||||
@self.nextthink = time + @self.wait;
|
||||
} else {
|
||||
// we can't just remove (self) here, because this is a touch function
|
||||
// we can't just remove (@self) here, because this is a touch function
|
||||
// called wheil C code is looping through area links...
|
||||
|
||||
self.touch = NIL;
|
||||
self.nextthink = time + 0.1;
|
||||
self.think = SUB_Remove;
|
||||
@self.touch = NIL;
|
||||
@self.nextthink = time + 0.1;
|
||||
@self.think = SUB_Remove;
|
||||
}
|
||||
};
|
||||
|
||||
void() multi_killed =
|
||||
{
|
||||
self.enemy = damage_attacker;
|
||||
@self.enemy = damage_attacker;
|
||||
multi_trigger ();
|
||||
};
|
||||
|
||||
void() multi_use =
|
||||
{
|
||||
self.enemy = activator;
|
||||
@self.enemy = activator;
|
||||
multi_trigger ();
|
||||
};
|
||||
|
||||
|
@ -78,13 +78,13 @@ void() multi_touch =
|
|||
return;
|
||||
|
||||
// if the trigger has an angles field, check player's facing direction
|
||||
if (self.movedir != '0 0 0') {
|
||||
if (@self.movedir != '0 0 0') {
|
||||
makevectors (other.angles);
|
||||
if (v_forward * self.movedir < 0)
|
||||
if (v_forward * @self.movedir < 0)
|
||||
return; // not facing the right way
|
||||
}
|
||||
|
||||
self.enemy = other;
|
||||
@self.enemy = other;
|
||||
multi_trigger ();
|
||||
};
|
||||
/*QUAKED trigger_multiple (.5 .5 .5) ? notouch
|
||||
|
@ -102,46 +102,46 @@ set "message" to text string
|
|||
*/
|
||||
void() trigger_multiple =
|
||||
{
|
||||
if (self.sounds == 1)
|
||||
if (@self.sounds == 1)
|
||||
{
|
||||
precache_sound ("misc/secret.wav");
|
||||
self.noise = "misc/secret.wav";
|
||||
@self.noise = "misc/secret.wav";
|
||||
}
|
||||
else if (self.sounds == 2)
|
||||
else if (@self.sounds == 2)
|
||||
{
|
||||
precache_sound ("misc/talk.wav");
|
||||
self.noise = "misc/talk.wav";
|
||||
@self.noise = "misc/talk.wav";
|
||||
}
|
||||
else if (self.sounds == 3)
|
||||
else if (@self.sounds == 3)
|
||||
{
|
||||
precache_sound ("misc/trigger1.wav");
|
||||
self.noise = "misc/trigger1.wav";
|
||||
@self.noise = "misc/trigger1.wav";
|
||||
}
|
||||
|
||||
if (!self.wait)
|
||||
self.wait = 0.2;
|
||||
self.use = multi_use;
|
||||
if (!@self.wait)
|
||||
@self.wait = 0.2;
|
||||
@self.use = multi_use;
|
||||
InitTrigger ();
|
||||
if (self.health)
|
||||
if (@self.health)
|
||||
{
|
||||
if (self.spawnflags & SPAWNFLAG_NOTOUCH)
|
||||
if (@self.spawnflags & SPAWNFLAG_NOTOUCH)
|
||||
objerror ("health and notouch don't make sense\n");
|
||||
self.max_health = self.health;
|
||||
self.th_die = multi_killed;
|
||||
self.takedamage = DAMAGE_YES;
|
||||
self.solid = SOLID_BBOX;
|
||||
setorigin (self, self.origin); // make sure it links into the world
|
||||
@self.max_health = @self.health;
|
||||
@self.th_die = multi_killed;
|
||||
@self.takedamage = DAMAGE_YES;
|
||||
@self.solid = SOLID_BBOX;
|
||||
setorigin (@self, @self.origin); // make sure it links into the world
|
||||
|
||||
// + POX
|
||||
self.nobleed = TRUE;
|
||||
@self.nobleed = TRUE;
|
||||
// - POX
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( !(self.spawnflags & SPAWNFLAG_NOTOUCH) )
|
||||
if ( !(@self.spawnflags & SPAWNFLAG_NOTOUCH) )
|
||||
{
|
||||
self.touch = multi_touch;
|
||||
@self.touch = multi_touch;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -160,7 +160,7 @@ set "message" to text string
|
|||
*/
|
||||
void() trigger_once =
|
||||
{
|
||||
self.wait = -1;
|
||||
@self.wait = -1;
|
||||
trigger_multiple();
|
||||
};
|
||||
//=============================================================================
|
||||
|
@ -169,7 +169,7 @@ This fixed size trigger cannot be touched, it can only be fired by other events.
|
|||
*/
|
||||
void() trigger_relay =
|
||||
{
|
||||
self.use = SUB_UseTargets;
|
||||
@self.use = SUB_UseTargets;
|
||||
};
|
||||
//=============================================================================
|
||||
/*QUAKED trigger_secret (.5 .5 .5) ?
|
||||
|
@ -184,21 +184,21 @@ set "message" to text string
|
|||
void() trigger_secret =
|
||||
{
|
||||
total_secrets = total_secrets + 1;
|
||||
self.wait = -1;
|
||||
if (!self.message)
|
||||
self.message = "You found a secret area!";
|
||||
if (!self.sounds)
|
||||
self.sounds = 1;
|
||||
@self.wait = -1;
|
||||
if (!@self.message)
|
||||
@self.message = "You found a secret area!";
|
||||
if (!@self.sounds)
|
||||
@self.sounds = 1;
|
||||
|
||||
if (self.sounds == 1)
|
||||
if (@self.sounds == 1)
|
||||
{
|
||||
precache_sound ("misc/secret.wav");
|
||||
self.noise = "misc/secret.wav";
|
||||
@self.noise = "misc/secret.wav";
|
||||
}
|
||||
else if (self.sounds == 2)
|
||||
else if (@self.sounds == 2)
|
||||
{
|
||||
precache_sound ("misc/talk.wav");
|
||||
self.noise = "misc/talk.wav";
|
||||
@self.noise = "misc/talk.wav";
|
||||
}
|
||||
trigger_multiple ();
|
||||
};
|
||||
|
@ -206,15 +206,15 @@ void() trigger_secret =
|
|||
|
||||
void() counter_use =
|
||||
{
|
||||
(self.count)--;
|
||||
if (self.count < 0)
|
||||
(@self.count)--;
|
||||
if (@self.count < 0)
|
||||
return;
|
||||
|
||||
if (self.count != 0) {
|
||||
if (activator.classname == "player" && !(self.spawnflags & SPAWNFLAG_NOMESSAGE)) {
|
||||
self.target_id_finished = time + 4;//POX v1.12 don't let TargetID override centerprints
|
||||
if (@self.count != 0) {
|
||||
if (activator.classname == "player" && !(@self.spawnflags & SPAWNFLAG_NOMESSAGE)) {
|
||||
@self.target_id_finished = time + 4;//POX v1.12 don't let TargetID override centerprints
|
||||
|
||||
switch (self.count) {
|
||||
switch (@self.count) {
|
||||
case 1:
|
||||
centerprint (activator, "Only 1 more to go...");
|
||||
break;
|
||||
|
@ -232,12 +232,12 @@ void() counter_use =
|
|||
return;
|
||||
}
|
||||
|
||||
if (activator.classname == "player" && !(self.spawnflags & SPAWNFLAG_NOMESSAGE)) {
|
||||
self.target_id_finished = time + 4;//POX don't let TargetID override centerprints
|
||||
if (activator.classname == "player" && !(@self.spawnflags & SPAWNFLAG_NOMESSAGE)) {
|
||||
@self.target_id_finished = time + 4;//POX don't let TargetID override centerprints
|
||||
centerprint (activator, "Sequence completed!");
|
||||
}
|
||||
|
||||
self.enemy = activator;
|
||||
@self.enemy = activator;
|
||||
multi_trigger ();
|
||||
};
|
||||
|
||||
|
@ -248,12 +248,12 @@ After the counter has been triggered "count" times (default 2), it will fire all
|
|||
*/
|
||||
void() trigger_counter =
|
||||
{
|
||||
self.wait = -1;
|
||||
@self.wait = -1;
|
||||
|
||||
if (!self.count)
|
||||
self.count = 2;
|
||||
if (!@self.count)
|
||||
@self.count = 2;
|
||||
|
||||
self.use = counter_use;
|
||||
@self.use = counter_use;
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -275,8 +275,8 @@ void() play_teleport =
|
|||
else
|
||||
tmpstr = "misc/r_tele2.wav";
|
||||
|
||||
sound (self, CHAN_VOICE, tmpstr, 1, ATTN_NORM);
|
||||
remove (self);
|
||||
sound (@self, CHAN_VOICE, tmpstr, 1, ATTN_NORM);
|
||||
remove (@self);
|
||||
};
|
||||
|
||||
void (vector org) spawn_tfog =
|
||||
|
@ -296,33 +296,33 @@ void (vector org) spawn_tfog =
|
|||
void() tdeath_touch =
|
||||
{
|
||||
local entity other2;
|
||||
if (other == self.owner)
|
||||
if (other == @self.owner)
|
||||
return;
|
||||
|
||||
// frag anyone who teleports in on top of an invincible player
|
||||
if (other.classname == "player") {
|
||||
if (other.invincible_finished > time &&
|
||||
self.owner.invincible_finished > time) {
|
||||
self.classname = "teledeath3";
|
||||
@self.owner.invincible_finished > time) {
|
||||
@self.classname = "teledeath3";
|
||||
other.invincible_finished = 0;
|
||||
self.owner.invincible_finished = 0;
|
||||
T_Damage (other, self, self, 50000);
|
||||
other2 = self.owner;
|
||||
self.owner = other;
|
||||
T_Damage (other2, self, self, 50000);
|
||||
@self.owner.invincible_finished = 0;
|
||||
T_Damage (other, @self, @self, 50000);
|
||||
other2 = @self.owner;
|
||||
@self.owner = other;
|
||||
T_Damage (other2, @self, @self, 50000);
|
||||
}
|
||||
|
||||
if (other.invincible_finished > time)
|
||||
{
|
||||
self.classname = "teledeath2";
|
||||
T_Damage (self.owner, self, self, 50000);
|
||||
@self.classname = "teledeath2";
|
||||
T_Damage (@self.owner, @self, @self, 50000);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
if (other.health)
|
||||
{
|
||||
T_Damage (other, self, self, 50000);
|
||||
T_Damage (other, @self, @self, 50000);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -362,13 +362,13 @@ void() teleport_touch =
|
|||
}
|
||||
#endif
|
||||
|
||||
if (self.targetname) {
|
||||
if (self.nextthink < time) {
|
||||
if (@self.targetname) {
|
||||
if (@self.nextthink < time) {
|
||||
return; // not fired yet
|
||||
}
|
||||
}
|
||||
|
||||
if (self.spawnflags & PLAYER_ONLY) {
|
||||
if (@self.spawnflags & PLAYER_ONLY) {
|
||||
if (other.classname != "player")
|
||||
return;
|
||||
}
|
||||
|
@ -383,7 +383,7 @@ void() teleport_touch =
|
|||
|
||||
// put a tfog where the player was
|
||||
spawn_tfog (other.origin);
|
||||
t = find (world, targetname, self.target);
|
||||
t = find (world, targetname, @self.target);
|
||||
if (!t)
|
||||
objerror ("couldn't find target");
|
||||
|
||||
|
@ -428,19 +428,19 @@ This is the destination marker for a teleporter. It should have a "targetname"
|
|||
void() info_teleport_destination =
|
||||
{
|
||||
// this does nothing, just serves as a target spot
|
||||
self.mangle = self.angles;
|
||||
self.angles = '0 0 0';
|
||||
self.model = "";
|
||||
self.origin = self.origin + '0 0 27';
|
||||
if (!self.targetname)
|
||||
@self.mangle = @self.angles;
|
||||
@self.angles = '0 0 0';
|
||||
@self.model = "";
|
||||
@self.origin = @self.origin + '0 0 27';
|
||||
if (!@self.targetname)
|
||||
objerror ("no targetname");
|
||||
};
|
||||
|
||||
void() teleport_use =
|
||||
{
|
||||
self.nextthink = time + 0.2;
|
||||
@self.nextthink = time + 0.2;
|
||||
force_retouch = 2; // make sure even still objects get hit
|
||||
self.think = SUB_Null;
|
||||
@self.think = SUB_Null;
|
||||
};
|
||||
|
||||
/*QUAKED trigger_teleport (.5 .5 .5) ? PLAYER_ONLY SILENT
|
||||
|
@ -456,21 +456,21 @@ void() trigger_teleport =
|
|||
local vector o;
|
||||
|
||||
InitTrigger ();
|
||||
self.touch = teleport_touch;
|
||||
@self.touch = teleport_touch;
|
||||
|
||||
// make the target bigger
|
||||
self.flags |= FL_ITEM;
|
||||
@self.flags |= FL_ITEM;
|
||||
|
||||
// find the destination
|
||||
if (!self.target)
|
||||
if (!@self.target)
|
||||
objerror ("no target");
|
||||
|
||||
self.use = teleport_use;
|
||||
if (self.spawnflags & SILENT)
|
||||
@self.use = teleport_use;
|
||||
if (@self.spawnflags & SILENT)
|
||||
return;
|
||||
|
||||
precache_sound ("ambience/hum1.wav");
|
||||
o = (self.mins + self.maxs) * 0.5;
|
||||
o = (@self.mins + @self.maxs) * 0.5;
|
||||
ambientsound (o, "ambience/hum1.wav", 0.5, ATTN_STATIC);
|
||||
};
|
||||
|
||||
|
@ -485,7 +485,7 @@ Only used on start map.
|
|||
*/
|
||||
void() trigger_setskill =
|
||||
{
|
||||
remove (self);
|
||||
remove (@self);
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -498,20 +498,20 @@ void() trigger_onlyregistered_touch =
|
|||
if (other.classname != "player")
|
||||
return;
|
||||
|
||||
if (self.attack_finished > time)
|
||||
if (@self.attack_finished > time)
|
||||
return;
|
||||
|
||||
self.attack_finished = time + 2;
|
||||
@self.attack_finished = time + 2;
|
||||
|
||||
if (cvar ("registered")) {
|
||||
self.message = "";
|
||||
@self.message = "";
|
||||
SUB_UseTargets ();
|
||||
remove (self);
|
||||
remove (@self);
|
||||
} else {
|
||||
if (self.message != "") {
|
||||
self.target_id_finished = time + 4;//POX don't let TargetID override centerprints
|
||||
if (@self.message != "") {
|
||||
@self.target_id_finished = time + 4;//POX don't let TargetID override centerprints
|
||||
|
||||
centerprint (other, self.message);
|
||||
centerprint (other, @self.message);
|
||||
sound (other, CHAN_BODY, "misc/talk.wav", 1, ATTN_NORM);
|
||||
}
|
||||
}
|
||||
|
@ -524,23 +524,23 @@ void() trigger_onlyregistered =
|
|||
{
|
||||
precache_sound ("misc/talk.wav");
|
||||
InitTrigger ();
|
||||
self.touch = trigger_onlyregistered_touch;
|
||||
@self.touch = trigger_onlyregistered_touch;
|
||||
};
|
||||
|
||||
//============================================================================
|
||||
void() hurt_on =
|
||||
{
|
||||
self.solid = SOLID_TRIGGER;
|
||||
self.nextthink = -1;
|
||||
@self.solid = SOLID_TRIGGER;
|
||||
@self.nextthink = -1;
|
||||
};
|
||||
|
||||
void() hurt_touch =
|
||||
{
|
||||
if (other.takedamage) {
|
||||
self.solid = SOLID_NOT;
|
||||
T_Damage (other, self, self, self.dmg);
|
||||
self.think = hurt_on;
|
||||
self.nextthink = time + 1;
|
||||
@self.solid = SOLID_NOT;
|
||||
T_Damage (other, @self, @self, @self.dmg);
|
||||
@self.think = hurt_on;
|
||||
@self.nextthink = time + 1;
|
||||
}
|
||||
return;
|
||||
};
|
||||
|
@ -553,9 +553,9 @@ defalt dmg = 5
|
|||
void() trigger_hurt =
|
||||
{
|
||||
InitTrigger ();
|
||||
self.touch = hurt_touch;
|
||||
if (!self.dmg)
|
||||
self.dmg = 5;
|
||||
@self.touch = hurt_touch;
|
||||
if (!@self.dmg)
|
||||
@self.dmg = 5;
|
||||
};
|
||||
|
||||
//============================================================================
|
||||
|
@ -564,9 +564,9 @@ void() trigger_hurt =
|
|||
void() trigger_push_touch =
|
||||
{
|
||||
if (other.classname == "grenade")
|
||||
other.velocity = self.speed * self.movedir * 10;
|
||||
other.velocity = @self.speed * @self.movedir * 10;
|
||||
else if (other.health > 0) {
|
||||
other.velocity = self.speed * self.movedir * 10;
|
||||
other.velocity = @self.speed * @self.movedir * 10;
|
||||
if (other.classname == "player") {
|
||||
if (other.fly_sound < time) {
|
||||
other.fly_sound = time + 1.5;
|
||||
|
@ -575,8 +575,8 @@ void() trigger_push_touch =
|
|||
}
|
||||
}
|
||||
|
||||
if (self.spawnflags & PUSH_ONCE)
|
||||
remove (self);
|
||||
if (@self.spawnflags & PUSH_ONCE)
|
||||
remove (@self);
|
||||
};
|
||||
|
||||
/*QUAKED trigger_push (.5 .5 .5) ? PUSH_ONCE
|
||||
|
@ -586,9 +586,9 @@ void() trigger_push =
|
|||
{
|
||||
InitTrigger ();
|
||||
precache_sound ("ambience/windfly.wav");
|
||||
self.touch = trigger_push_touch;
|
||||
if (!self.speed)
|
||||
self.speed = 1000;
|
||||
@self.touch = trigger_push_touch;
|
||||
if (!@self.speed)
|
||||
@self.speed = 1000;
|
||||
};
|
||||
|
||||
.float bounce_time;
|
||||
|
@ -599,7 +599,7 @@ void() trigger_bounce_touch =
|
|||
return;
|
||||
|
||||
if ((other.classname == "player") && (other.health > 0)) {
|
||||
other.velocity = self.angles;
|
||||
other.velocity = @self.angles;
|
||||
other.bounce_time = time + 0.8;
|
||||
|
||||
sound (other, CHAN_AUTO, "misc/menu2.wav", 1, ATTN_NORM);
|
||||
|
@ -613,12 +613,12 @@ x is east, y is north, z is vertical. A value of '0 40 800' is a vertical bounce
|
|||
*/
|
||||
void() trigger_bouncepad =
|
||||
{
|
||||
self.solid = SOLID_TRIGGER;
|
||||
setmodel (self, self.model); // set size and link into world
|
||||
self.movetype = MOVETYPE_NONE;
|
||||
self.modelindex = 0;
|
||||
self.model = "";
|
||||
self.touch = trigger_bounce_touch;
|
||||
@self.solid = SOLID_TRIGGER;
|
||||
setmodel (@self, @self.model); // set size and link into world
|
||||
@self.movetype = MOVETYPE_NONE;
|
||||
@self.modelindex = 0;
|
||||
@self.model = "";
|
||||
@self.touch = trigger_bounce_touch;
|
||||
};
|
||||
|
||||
//============================================================================
|
||||
|
@ -629,14 +629,14 @@ void() trigger_monsterjump_touch =
|
|||
return;
|
||||
|
||||
// set XY even if not on ground, so the jump will clear lips
|
||||
other.velocity_x = self.movedir_x * self.speed;
|
||||
other.velocity_y = self.movedir_y * self.speed;
|
||||
other.velocity_x = @self.movedir_x * @self.speed;
|
||||
other.velocity_y = @self.movedir_y * @self.speed;
|
||||
|
||||
if (!(other.flags & FL_ONGROUND))
|
||||
return;
|
||||
|
||||
other.flags &= ~FL_ONGROUND;
|
||||
other.velocity_z = self.height;
|
||||
other.velocity_z = @self.height;
|
||||
};
|
||||
|
||||
/*QUAKED trigger_monsterjump (.5 .5 .5) ?
|
||||
|
@ -646,16 +646,16 @@ Walking monsters that touch this will jump in the direction of the trigger's ang
|
|||
*/
|
||||
void() trigger_monsterjump =
|
||||
{
|
||||
if (!self.speed)
|
||||
self.speed = 200;
|
||||
if (!@self.speed)
|
||||
@self.speed = 200;
|
||||
|
||||
if (!self.height)
|
||||
self.height = 200;
|
||||
if (!@self.height)
|
||||
@self.height = 200;
|
||||
|
||||
if (self.angles == '0 0 0')
|
||||
self.angles = '0 360 0';
|
||||
if (@self.angles == '0 0 0')
|
||||
@self.angles = '0 360 0';
|
||||
|
||||
InitTrigger ();
|
||||
|
||||
self.touch = trigger_monsterjump_touch;
|
||||
@self.touch = trigger_monsterjump_touch;
|
||||
};
|
||||
|
|
|
@ -40,58 +40,58 @@ void () brik_touch =
|
|||
|
||||
vol = random ();
|
||||
|
||||
if (self.velocity == '0 0 0') {
|
||||
self.avelocity = '0 0 0';
|
||||
self.solid = SOLID_NOT;
|
||||
self.touch = NIL;
|
||||
self.think = SUB_Remove;
|
||||
self.nextthink = time + (2 * random());
|
||||
if (@self.velocity == '0 0 0') {
|
||||
@self.avelocity = '0 0 0';
|
||||
@self.solid = SOLID_NOT;
|
||||
@self.touch = NIL;
|
||||
@self.think = SUB_Remove;
|
||||
@self.nextthink = time + (2 * random());
|
||||
return;
|
||||
}
|
||||
|
||||
if (self.gib_caught > 4) {
|
||||
remove (self);
|
||||
if (@self.gib_caught > 4) {
|
||||
remove (@self);
|
||||
return;
|
||||
}
|
||||
|
||||
// Gib already bounced twice, so remove damage (too easy to get killed)
|
||||
if (self.gib_caught > 1)
|
||||
self.dmg = 0;
|
||||
if (@self.gib_caught > 1)
|
||||
@self.dmg = 0;
|
||||
|
||||
if (self.dmg) { // do damage if set
|
||||
if (@self.dmg) { // do damage if set
|
||||
if (other.takedamage) {
|
||||
T_Damage (other, self, self.owner, self.dmg);
|
||||
remove (self);
|
||||
T_Damage (other, @self, @self.owner, @self.dmg);
|
||||
remove (@self);
|
||||
}
|
||||
}
|
||||
|
||||
self.gib_caught++;
|
||||
@self.gib_caught++;
|
||||
|
||||
if (!(self.cnt))
|
||||
if (!(@self.cnt))
|
||||
return;
|
||||
|
||||
if (vol < 0.3) // mute low volume
|
||||
return;
|
||||
|
||||
if (pointcontents(self.origin) == CONTENT_SOLID) { // bounce sound
|
||||
switch (self.cnt) {
|
||||
if (pointcontents(@self.origin) == CONTENT_SOLID) { // bounce sound
|
||||
switch (@self.cnt) {
|
||||
case 1:
|
||||
sound (self, CHAN_AUTO, "ambience/brik_hit.wav", vol, ATTN_NORM);
|
||||
sound (@self, CHAN_AUTO, "ambience/brik_hit.wav", vol, ATTN_NORM);
|
||||
break;
|
||||
case 2:
|
||||
sound (self, CHAN_AUTO, "ambience/brikhit2.wav", vol, ATTN_NORM);
|
||||
sound (@self, CHAN_AUTO, "ambience/brikhit2.wav", vol, ATTN_NORM);
|
||||
break;
|
||||
case 3:
|
||||
sound (self, CHAN_AUTO, "ambience/methit1.wav", vol, ATTN_NORM);
|
||||
sound (@self, CHAN_AUTO, "ambience/methit1.wav", vol, ATTN_NORM);
|
||||
break;
|
||||
case 4:
|
||||
sound (self, CHAN_AUTO, "ambience/woodhit1.wav", vol, ATTN_NORM);
|
||||
sound (@self, CHAN_AUTO, "ambience/woodhit1.wav", vol, ATTN_NORM);
|
||||
break;
|
||||
case 6:
|
||||
sound (self, CHAN_AUTO, "ambience/methit2.wav", vol, ATTN_NORM);
|
||||
sound (@self, CHAN_AUTO, "ambience/methit2.wav", vol, ATTN_NORM);
|
||||
break;
|
||||
case 8:
|
||||
sound (self, CHAN_AUTO, "ambience/woodhit2.wav", vol, ATTN_NORM);
|
||||
sound (@self, CHAN_AUTO, "ambience/woodhit2.wav", vol, ATTN_NORM);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -105,11 +105,11 @@ void (string gibname, float dm, vector ddir) ThrowRubble =
|
|||
new = spawn ();
|
||||
sndrnd = random ();
|
||||
|
||||
// new.origin = self.origin doesnt work because the origin
|
||||
// new.origin = @self.origin doesnt work because the origin
|
||||
// is at world (0,0,0).
|
||||
new.origin_x = self.absmin_x + (random() * self.size_x);
|
||||
new.origin_y = self.absmin_y + (random() * self.size_y);
|
||||
new.origin_z = self.absmin_z + (random() * self.size_z);
|
||||
new.origin_x = @self.absmin_x + (random() * @self.size_x);
|
||||
new.origin_y = @self.absmin_y + (random() * @self.size_y);
|
||||
new.origin_z = @self.absmin_z + (random() * @self.size_z);
|
||||
|
||||
setmodel (new, gibname);
|
||||
setsize (new, '0 0 0', '0 0 0');
|
||||
|
@ -120,13 +120,13 @@ void (string gibname, float dm, vector ddir) ThrowRubble =
|
|||
new.cnt = 2;
|
||||
|
||||
// No bounce sound for glass since initial sound drags on for a bit
|
||||
if (self.spawnflags & SPAWN_GLASS)
|
||||
if (@self.spawnflags & SPAWN_GLASS)
|
||||
new.cnt = 0;
|
||||
|
||||
if (self.spawnflags & SPAWN_METAL)
|
||||
if (@self.spawnflags & SPAWN_METAL)
|
||||
new.cnt *= 3; // Play metal bounce on 3 & 6
|
||||
|
||||
if (self.spawnflags & SPAWN_WOOD) {
|
||||
if (@self.spawnflags & SPAWN_WOOD) {
|
||||
new.cnt *= 4; // Play wood bounce on 4 & 8
|
||||
new.skin = 1; // Change skin to wood if wood gib
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ void (string gibname, float dm, vector ddir) ThrowRubble =
|
|||
new.think = SUB_Remove;
|
||||
new.ltime = time;
|
||||
new.nextthink = time + 10 + random () * 10;
|
||||
new.dmg = self.dmg;
|
||||
new.dmg = @self.dmg;
|
||||
new.frame = 0;
|
||||
new.flags = 0;
|
||||
};
|
||||
|
@ -159,14 +159,14 @@ void () wall_killed =
|
|||
local string md1, md2, md3, md4;
|
||||
|
||||
sndspot = spawn();
|
||||
sndspot.origin = self.absmin;
|
||||
sndspot.origin = @self.absmin;
|
||||
setorigin (sndspot, sndspot.origin);
|
||||
|
||||
if (self.spawnflags & SPAWN_GLASS)
|
||||
if (@self.spawnflags & SPAWN_GLASS)
|
||||
sound (sndspot, CHAN_AUTO, "ambience/glassbrk.wav", 1, ATTN_NORM);
|
||||
else if (self.spawnflags & SPAWN_METAL)
|
||||
else if (@self.spawnflags & SPAWN_METAL)
|
||||
sound (sndspot, CHAN_AUTO, "ambience/metbrk.wav", 1, ATTN_NORM);
|
||||
else if (self.spawnflags & SPAWN_WOOD)
|
||||
else if (@self.spawnflags & SPAWN_WOOD)
|
||||
sound (sndspot, CHAN_AUTO, "ambience/woodbrk.wav", 1, ATTN_NORM);
|
||||
else // New rubble sound
|
||||
sound (sndspot, CHAN_AUTO, "ambience/wall01.wav", 1, ATTN_NORM);
|
||||
|
@ -174,32 +174,32 @@ void () wall_killed =
|
|||
remove (sndspot);
|
||||
|
||||
// determine volume of destroyed wall and throw rubble accordingly
|
||||
rubble_count = (self.size_x * self.size_y * self.size_z) / 64000;
|
||||
rubble_count = (@self.size_x * @self.size_y * @self.size_z) / 64000;
|
||||
|
||||
if (rubble_count > 5)
|
||||
rubble_count = 6;
|
||||
|
||||
if (self.spawnflags & SPAWN_GLASS) {
|
||||
if (@self.spawnflags & SPAWN_GLASS) {
|
||||
md4 = md3 = md2 = md1 = "progs/glassrub.md";
|
||||
|
||||
while (rubble_count > -1) {
|
||||
self.dest_x = (random () * 100) - 50;
|
||||
self.dest_y = (random () * 100) - 50;
|
||||
self.dest_z = (random () * 100);
|
||||
@self.dest_x = (random () * 100) - 50;
|
||||
@self.dest_y = (random () * 100) - 50;
|
||||
@self.dest_z = (random () * 100);
|
||||
|
||||
// This was cut down by 1/5 to deal with packet overflow errors
|
||||
ThrowRubble (md1, -100, self.dest);
|
||||
ThrowRubble (md2, -100, self.dest);
|
||||
ThrowRubble (md3, -100, self.dest);
|
||||
ThrowRubble (md4, -100, self.dest);
|
||||
ThrowRubble (md1, -100, @self.dest);
|
||||
ThrowRubble (md2, -100, @self.dest);
|
||||
ThrowRubble (md3, -100, @self.dest);
|
||||
ThrowRubble (md4, -100, @self.dest);
|
||||
rubble_count--;
|
||||
}
|
||||
} else {
|
||||
if (self.spawnflags & SPAWN_METAL) {
|
||||
if (@self.spawnflags & SPAWN_METAL) {
|
||||
md1 = "progs/mwrub1.mdl";
|
||||
md2 = "progs/mwrub2.mdl";
|
||||
md4 = md3 = "progs/mwrub3.mdl";
|
||||
} else if (self.spawnflags & SPAWN_WOOD) {
|
||||
} else if (@self.spawnflags & SPAWN_WOOD) {
|
||||
md1 = "progs/mwrub1.mdl";
|
||||
md4 = md2 = "progs/mwrub2.mdl";
|
||||
md3 = "progs/mwrub3.mdl";
|
||||
|
@ -210,37 +210,37 @@ void () wall_killed =
|
|||
}
|
||||
|
||||
while (rubble_count > -1) {
|
||||
self.dest_x = (random () * 100) - 50;
|
||||
self.dest_y = (random () * 100) - 50;
|
||||
self.dest_z = (random () * 100);
|
||||
@self.dest_x = (random () * 100) - 50;
|
||||
@self.dest_y = (random () * 100) - 50;
|
||||
@self.dest_z = (random () * 100);
|
||||
|
||||
ThrowRubble (md1, self.health, self.dest);
|
||||
ThrowRubble (md2, self.health, self.dest);
|
||||
ThrowRubble (md3, self.health, self.dest);
|
||||
ThrowRubble (md4, self.health, self.dest);
|
||||
ThrowRubble (md1, @self.health, @self.dest);
|
||||
ThrowRubble (md2, @self.health, @self.dest);
|
||||
ThrowRubble (md3, @self.health, @self.dest);
|
||||
ThrowRubble (md4, @self.health, @self.dest);
|
||||
rubble_count--;
|
||||
}
|
||||
}
|
||||
activator = self;
|
||||
activator = @self;
|
||||
|
||||
SUB_UseTargets ();
|
||||
|
||||
self.no_obj = TRUE; // mine fix - mines will detonate if spawnmaster.no_obj = TRUE (blown up)
|
||||
remove (self);
|
||||
@self.no_obj = TRUE; // mine fix - mines will detonate if spawnmaster.no_obj = TRUE (blown up)
|
||||
remove (@self);
|
||||
};
|
||||
|
||||
void() wall_pain =
|
||||
{
|
||||
if (self.health > 0)
|
||||
self.health = self.max_health;
|
||||
if (@self.health > 0)
|
||||
@self.health = @self.max_health;
|
||||
};
|
||||
|
||||
void() wall_use =
|
||||
{
|
||||
self.health = -100;
|
||||
self.dest_x = (random () * 10) - 5;
|
||||
self.dest_y = (random () * 10) - 5;
|
||||
self.dest_z = (random () * 10);
|
||||
@self.health = -100;
|
||||
@self.dest_x = (random () * 10) - 5;
|
||||
@self.dest_y = (random () * 10) - 5;
|
||||
@self.dest_z = (random () * 10);
|
||||
wall_killed ();
|
||||
};
|
||||
|
||||
|
@ -269,23 +269,23 @@ wood spawnflag is set.
|
|||
*/
|
||||
void() exploding_wall =
|
||||
{
|
||||
setmodel (self, self.model);
|
||||
setmodel (@self, @self.model);
|
||||
|
||||
// New precache routine
|
||||
|
||||
precache_sound("zombie/z_hit.wav"); // for damage
|
||||
|
||||
if (self.spawnflags & SPAWN_GLASS) {
|
||||
if (@self.spawnflags & SPAWN_GLASS) {
|
||||
precache_model("progs/glassrub.mdl");
|
||||
precache_sound("ambience/glassbrk.wav");
|
||||
} else if (self.spawnflags & SPAWN_METAL) {
|
||||
} else if (@self.spawnflags & SPAWN_METAL) {
|
||||
precache_model("progs/mwrub1.mdl");
|
||||
precache_model("progs/mwrub2.mdl");
|
||||
precache_model("progs/mwrub3.mdl");
|
||||
precache_sound("ambience/metbrk.wav");
|
||||
precache_sound("ambience/methit1.wav");
|
||||
precache_sound("ambience/methit2.wav");
|
||||
} else if (self.spawnflags & SPAWN_WOOD) {
|
||||
} else if (@self.spawnflags & SPAWN_WOOD) {
|
||||
precache_model("progs/mwrub1.mdl");
|
||||
precache_model("progs/mwrub2.mdl");
|
||||
precache_model("progs/mwrub3.mdl");
|
||||
|
@ -301,29 +301,29 @@ void() exploding_wall =
|
|||
precache_sound("ambience/brikhit2.wav");
|
||||
}
|
||||
|
||||
self.solid = SOLID_BBOX;
|
||||
self.movetype = MOVETYPE_NONE;
|
||||
@self.solid = SOLID_BBOX;
|
||||
@self.movetype = MOVETYPE_NONE;
|
||||
|
||||
// POX v1.2 - default gib damage to 1
|
||||
if (!self.dmg)
|
||||
self.dmg = 1;
|
||||
if (!@self.dmg)
|
||||
@self.dmg = 1;
|
||||
|
||||
self.nobleed = TRUE;
|
||||
@self.nobleed = TRUE;
|
||||
|
||||
if (self.health) {
|
||||
self.max_health = self.health;
|
||||
self.th_die = wall_killed;
|
||||
self.takedamage = DAMAGE_YES;
|
||||
if (@self.health) {
|
||||
@self.max_health = @self.health;
|
||||
@self.th_die = wall_killed;
|
||||
@self.takedamage = DAMAGE_YES;
|
||||
} else {
|
||||
self.max_health = 100;
|
||||
self.th_die = wall_killed;
|
||||
self.takedamage = DAMAGE_YES;
|
||||
@self.max_health = 100;
|
||||
@self.th_die = wall_killed;
|
||||
@self.takedamage = DAMAGE_YES;
|
||||
}
|
||||
|
||||
self.th_pain = wall_pain;
|
||||
@self.th_pain = wall_pain;
|
||||
|
||||
if (self.targetname) {
|
||||
self.use = wall_use;
|
||||
self.max_health = 10000;
|
||||
if (@self.targetname) {
|
||||
@self.use = wall_use;
|
||||
@self.max_health = 10000;
|
||||
}
|
||||
};
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -180,7 +180,7 @@ void() worldspawn =
|
|||
#endif
|
||||
|
||||
// custom map attributes
|
||||
if (self.model == "maps/e1m8.bsp")
|
||||
if (@self.model == "maps/e1m8.bsp")
|
||||
cvar_set ("sv_gravity", "100");
|
||||
else
|
||||
cvar_set ("sv_gravity", "790");
|
||||
|
|
Loading…
Reference in a new issue