Compare commits
No commits in common. "6857946b1a860f0cc98a3e15d673fc97012cb79c" and "8a8b6c6cc1ca2c0cb5ac3497a5154d1d917e1cbe" have entirely different histories.
6857946b1a
...
8a8b6c6cc1
|
@ -22,7 +22,7 @@ void() SetChangeParms = {
|
|||
}
|
||||
|
||||
// remove items
|
||||
self.items &= ~(IT_KEY1 | IT_KEY2 | IT_INVISIBILITY | IT_INVULNERABILITY | IT_SUIT | IT_QUAD);
|
||||
self.items = self.items - (self.items & (IT_KEY1 | IT_KEY2 | IT_INVISIBILITY | IT_INVULNERABILITY | IT_SUIT | IT_QUAD));
|
||||
|
||||
// cap super health
|
||||
if(self.health > 100) {
|
||||
|
@ -55,7 +55,7 @@ void() SetNewParms = {
|
|||
parm5 = 0;
|
||||
parm6 = 0;
|
||||
parm7 = 0;
|
||||
parm8 = IT_SHOTGUN;
|
||||
parm8 = 1;
|
||||
parm9 = 0;
|
||||
};
|
||||
|
||||
|
@ -93,11 +93,13 @@ entity() FindIntermission = {
|
|||
spot = find(world, classname, "info_intermission");
|
||||
if(spot) {
|
||||
// pick a random one
|
||||
for(cyc = random() * 4; cyc > 1; cyc--) {
|
||||
cyc = random() * 4;
|
||||
while(cyc > 1) {
|
||||
spot = find(spot, classname, "info_intermission");
|
||||
if(!spot) {
|
||||
spot = find(spot, classname, "info_intermission");
|
||||
}
|
||||
cyc = cyc - 1;
|
||||
}
|
||||
return spot;
|
||||
}
|
||||
|
@ -231,7 +233,7 @@ void() execute_changelevel = {
|
|||
|
||||
other = find(world, classname, "player");
|
||||
while(other != world) {
|
||||
other.view_ofs = VEC_ORIGIN;
|
||||
other.view_ofs = '0 0 0';
|
||||
other.angles = other.v_angle = pos.mangle;
|
||||
other.fixangle = TRUE; // turn this way immediately
|
||||
other.nextthink = time + 0.5;
|
||||
|
@ -281,7 +283,7 @@ void() changelevel_touch = {
|
|||
};
|
||||
|
||||
/*QUAKED trigger_changelevel(0.5 0.5 0.5) ? NO_INTERMISSION
|
||||
When the player touches this, they get sent to the map listed in the "map" variable. Unless the NO_INTERMISSION flag is set, the view will go to the info_intermission spot and display stats.
|
||||
When the player touches this, he gets sent to the map listed in the "map" variable. Unless the NO_INTERMISSION flag is set, the view will go to the info_intermission spot and display stats.
|
||||
*/
|
||||
void() trigger_changelevel = {
|
||||
if(!self.map) {
|
||||
|
@ -447,7 +449,7 @@ void() PutClientInServer = {
|
|||
setmodel(self, "progs/player.mdl");
|
||||
modelindex_player = self.modelindex;
|
||||
|
||||
setsize(self, '-16 -16 -24', '16 16 32');
|
||||
setsize(self, VEC_HULL_MIN, VEC_HULL_MAX);
|
||||
|
||||
self.view_ofs = '0 0 22';
|
||||
|
||||
|
@ -591,7 +593,7 @@ void() PlayerDeathThink = {
|
|||
forward = vlen(self.velocity);
|
||||
forward = forward - 20;
|
||||
if(forward <= 0) {
|
||||
self.velocity = VEC_ORIGIN;
|
||||
self.velocity = '0 0 0';
|
||||
} else {
|
||||
self.velocity = forward * normalize(self.velocity);
|
||||
}
|
||||
|
@ -780,12 +782,15 @@ Called every frame before physics are run
|
|||
================
|
||||
*/
|
||||
void() PlayerPreThink = {
|
||||
float mspeed, aspeed;
|
||||
float r;
|
||||
|
||||
if(intermission_running) {
|
||||
IntermissionThink(); // otherwise a button could be missed between
|
||||
return; // the think tics
|
||||
}
|
||||
|
||||
if(self.view_ofs == VEC_ORIGIN) {
|
||||
if(self.view_ofs == '0 0 0') {
|
||||
return; // intermission or finale
|
||||
}
|
||||
|
||||
|
@ -815,7 +820,7 @@ void() PlayerPreThink = {
|
|||
|
||||
// teleporters can force a non-moving pause time
|
||||
if(time < self.pausetime) {
|
||||
self.velocity = VEC_ORIGIN;
|
||||
self.velocity = '0 0 0';
|
||||
}
|
||||
|
||||
if(time > self.attack_finished && self.currentammo == 0 && self.weapon != IT_AXE) {
|
||||
|
@ -947,6 +952,7 @@ void() CheckPowerups = {
|
|||
self.radsuit_finished = 0;
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -957,8 +963,11 @@ Called every frame after physics are run
|
|||
================
|
||||
*/
|
||||
void() PlayerPostThink = {
|
||||
if(self.view_ofs == VEC_ORIGIN) {
|
||||
return; // intermission, finale or spectating
|
||||
float mspeed, aspeed;
|
||||
float r;
|
||||
|
||||
if(self.view_ofs == '0 0 0') {
|
||||
return; // intermission or finale
|
||||
}
|
||||
if(self.deadflag) {
|
||||
return;
|
||||
|
|
|
@ -53,7 +53,10 @@ float(entity targ) visible = {
|
|||
return FALSE; // sight line crossed contents
|
||||
}
|
||||
|
||||
return trace_fraction == 1;
|
||||
if(trace_fraction == 1) {
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
};
|
||||
|
||||
// returns 1 if the entity is in front(in sight) of self
|
||||
|
@ -65,7 +68,10 @@ float(entity targ) infront = {
|
|||
vec = normalize(targ.origin - self.origin);
|
||||
dot = vec * v_forward;
|
||||
|
||||
return dot > 0.3;
|
||||
if(dot > 0.3) {
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
};
|
||||
|
||||
// EOF
|
||||
|
|
|
@ -20,8 +20,8 @@ float deathmatch;
|
|||
float coop;
|
||||
float teamplay;
|
||||
|
||||
// propagated from level to level, used to keep track of completed episodes
|
||||
float serverflags;
|
||||
float serverflags; // propagated from level to level, used to
|
||||
// keep track of completed episodes
|
||||
|
||||
float total_secrets;
|
||||
float total_monsters;
|
||||
|
@ -272,15 +272,11 @@ void(entity e) setspawnparms = #78;
|
|||
// constants -----------------------------------------------------------------|
|
||||
|
||||
const vector VEC_ORIGIN = '0 0 0';
|
||||
const vector VEC_HULL_MIN = '-16 -16 -24';
|
||||
const vector VEC_HULL_MAX = '16 16 32';
|
||||
|
||||
const string WEPNAME_AXE = "Axe";
|
||||
const string WEPNAME_SHOTGUN = "Shotgun";
|
||||
const string WEPNAME_SUPER_SHOTGUN = "Double-barrelled Shotgun";
|
||||
const string WEPNAME_NAILGUN = "Nailgun";
|
||||
const string WEPNAME_SUPER_NAILGUN = "Super Nailgun";
|
||||
const string WEPNAME_GRENADE_LAUNCHER = "Grenade Launcher";
|
||||
const string WEPNAME_ROCKET_LAUNCHER = "Rocket Launcher";
|
||||
const string WEPNAME_LIGHTNING = "Thunderbolt";
|
||||
const vector VEC_HULL2_MIN = '-32 -32 -24';
|
||||
const vector VEC_HULL2_MAX = '32 32 64';
|
||||
|
||||
enum {
|
||||
FALSE,
|
||||
|
@ -306,6 +302,8 @@ enum {
|
|||
// edict.movetype values
|
||||
enum {
|
||||
MOVETYPE_NONE, // never moves
|
||||
//MOVETYPE_ANGLENOCLIP,
|
||||
//MOVETYPE_ANGLECLIP,
|
||||
MOVETYPE_WALK = 3, // players only
|
||||
MOVETYPE_STEP, // discrete, not real time unless fall
|
||||
MOVETYPE_FLY,
|
||||
|
@ -491,72 +489,6 @@ enum {
|
|||
|
||||
PRO_MAX,
|
||||
};
|
||||
|
||||
enum {
|
||||
DOOR_START_OPEN = 1,
|
||||
DOOR_DONT_LINK = 4,
|
||||
DOOR_GOLD_KEY = 8,
|
||||
DOOR_SILVER_KEY = 16,
|
||||
DOOR_TOGGLE = 32,
|
||||
};
|
||||
|
||||
enum {
|
||||
SECRET_OPEN_ONCE = 1, // stays open
|
||||
SECRET_1ST_LEFT = 2, // 1st move is left of arrow
|
||||
SECRET_1ST_DOWN = 4, // 1st move is down from arrow
|
||||
SECRET_NO_SHOOT = 8, // only opened by trigger
|
||||
SECRET_YES_SHOOT = 16, // shootable even if targeted
|
||||
};
|
||||
|
||||
enum {
|
||||
COUNTER_NOMESSAGE = 1,
|
||||
};
|
||||
|
||||
enum {
|
||||
MULTIPLE_NOTOUCH = 1,
|
||||
};
|
||||
|
||||
enum {
|
||||
TELE_PLAYER_ONLY = 1,
|
||||
TELE_SILENT = 2,
|
||||
};
|
||||
|
||||
enum {
|
||||
PUSH_ONCE = 1,
|
||||
};
|
||||
|
||||
enum {
|
||||
ZOMBIE_SPAWN_CRUCIFIED = 1,
|
||||
};
|
||||
|
||||
enum {
|
||||
PLAT_LOW_TRIGGER = 1,
|
||||
};
|
||||
|
||||
enum {
|
||||
LIGHT_START_OFF = 1,
|
||||
};
|
||||
|
||||
enum {
|
||||
SPIKESHOOTER_SUPER = 1,
|
||||
SPIKESHOOTER_LASER = 2,
|
||||
};
|
||||
|
||||
enum {
|
||||
HEALTH_ROTTEN = 1,
|
||||
HEALTH_MEGA = 2,
|
||||
};
|
||||
|
||||
enum {
|
||||
AMMO_BIG = 1,
|
||||
};
|
||||
|
||||
enum {
|
||||
WEAPON_SHOTGUN = 1,
|
||||
WEAPON_ROCKET = 2,
|
||||
WEAPON_SPIKES = 4,
|
||||
WEAPON_BIG = 8,
|
||||
};
|
||||
#pragma noref 0
|
||||
|
||||
// globals -------------------------------------------------------------------|
|
||||
|
|
|
@ -189,7 +189,7 @@ void() monster_demon1 = {
|
|||
|
||||
setmodel(self, "progs/demon.mdl");
|
||||
|
||||
setsize(self, '-32 -32 -24', '32 32 64');
|
||||
setsize(self, VEC_HULL2_MIN, VEC_HULL2_MAX);
|
||||
self.health = 300;
|
||||
|
||||
self.th_stand = demon1_stand1;
|
||||
|
|
|
@ -1,5 +1,13 @@
|
|||
// doors.qc: player-triggered moving brush entities
|
||||
|
||||
enum {
|
||||
DOOR_START_OPEN = 1,
|
||||
DOOR_DONT_LINK = 4,
|
||||
DOOR_GOLD_KEY = 8,
|
||||
DOOR_SILVER_KEY = 16,
|
||||
DOOR_TOGGLE = 32,
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
Doors are similar to buttons, but can spawn a fat trigger field around them
|
||||
|
@ -484,6 +492,14 @@ SECRET DOORS
|
|||
=============================================================================
|
||||
*/
|
||||
|
||||
enum {
|
||||
SECRET_OPEN_ONCE = 1, // stays open
|
||||
SECRET_1ST_LEFT = 2, // 1st move is left of arrow
|
||||
SECRET_1ST_DOWN = 4, // 1st move is down from arrow
|
||||
SECRET_NO_SHOOT = 8, // only opened by trigger
|
||||
SECRET_YES_SHOOT = 16, // shootable even if targeted
|
||||
};
|
||||
|
||||
void() fd_secret_use = {
|
||||
float temp;
|
||||
|
||||
|
@ -502,7 +518,7 @@ void() fd_secret_use = {
|
|||
self.th_pain = SUB_PainNull;
|
||||
self.takedamage = DAMAGE_NO;
|
||||
}
|
||||
self.velocity = VEC_ORIGIN;
|
||||
self.velocity = '0 0 0';
|
||||
|
||||
// Make a sound, wait a little...
|
||||
|
||||
|
@ -666,7 +682,7 @@ void() func_door_secret = {
|
|||
|
||||
// Magic formula...
|
||||
self.mangle = self.angles;
|
||||
self.angles = VEC_ORIGIN;
|
||||
self.angles = '0 0 0';
|
||||
self.solid = SOLID_BSP;
|
||||
self.movetype = MOVETYPE_PUSH;
|
||||
self.classname = "door";
|
||||
|
|
|
@ -76,7 +76,7 @@ void(vector org, vector vec) LaunchLaser = {
|
|||
newmis.effects = EF_DIMLIGHT;
|
||||
|
||||
setmodel(newmis, "progs/laser.mdl");
|
||||
setsize(newmis, VEC_ORIGIN, VEC_ORIGIN);
|
||||
setsize(newmis, '0 0 0', '0 0 0');
|
||||
|
||||
setorigin(newmis, org);
|
||||
|
||||
|
|
109
source/items.qc
109
source/items.qc
|
@ -1,5 +1,14 @@
|
|||
// items.qc: items the player can pick up
|
||||
|
||||
const string WEPNAME_AXE = "Axe";
|
||||
const string WEPNAME_SHOTGUN = "Shotgun";
|
||||
const string WEPNAME_SUPER_SHOTGUN = "Double-barrelled Shotgun";
|
||||
const string WEPNAME_NAILGUN = "Nailgun";
|
||||
const string WEPNAME_SUPER_NAILGUN = "Super Nailgun";
|
||||
const string WEPNAME_GRENADE_LAUNCHER = "Grenade Launcher";
|
||||
const string WEPNAME_ROCKET_LAUNCHER = "Rocket Launcher";
|
||||
const string WEPNAME_LIGHTNING = "Thunderbolt";
|
||||
|
||||
string() Key1Name = {
|
||||
switch(world.worldtype) {
|
||||
case WORLD_MEDIEVAL:
|
||||
|
@ -63,7 +72,7 @@ void() PlaceItem = {
|
|||
self.flags = FL_ITEM; // make extra wide
|
||||
self.solid = SOLID_TRIGGER;
|
||||
self.movetype = MOVETYPE_TOSS;
|
||||
self.velocity = VEC_ORIGIN;
|
||||
self.velocity = '0 0 0';
|
||||
self.origin_z = self.origin_z + 6;
|
||||
oldz = self.origin_z;
|
||||
if(!droptofloor()) {
|
||||
|
@ -124,17 +133,22 @@ rot you down to your maximum health limit,
|
|||
one point per second.
|
||||
*/
|
||||
|
||||
enum {
|
||||
H_ROTTEN = 1,
|
||||
H_MEGA = 2,
|
||||
};
|
||||
|
||||
void() item_health = {
|
||||
self.touch = health_touch;
|
||||
|
||||
if(self.spawnflags & HEALTH_ROTTEN) {
|
||||
if(self.spawnflags & H_ROTTEN) {
|
||||
precache_model("maps/b_bh10.bsp");
|
||||
precache_sound("items/r_item1.wav");
|
||||
setmodel(self, "maps/b_bh10.bsp");
|
||||
self.noise = "items/r_item1.wav";
|
||||
self.healamount = 15;
|
||||
self.healtype = 0;
|
||||
} else if(self.spawnflags & HEALTH_MEGA) {
|
||||
} else if(self.spawnflags & H_MEGA) {
|
||||
precache_model("maps/b_bh100.bsp");
|
||||
precache_sound("items/r_item2.wav");
|
||||
setmodel(self, "maps/b_bh100.bsp");
|
||||
|
@ -149,7 +163,7 @@ void() item_health = {
|
|||
self.healamount = 25;
|
||||
self.healtype = 1;
|
||||
}
|
||||
setsize(self, VEC_ORIGIN, '32 32 56');
|
||||
setsize(self, '0 0 0', '32 32 56');
|
||||
StartItem();
|
||||
};
|
||||
|
||||
|
@ -666,12 +680,20 @@ void() ammo_touch = {
|
|||
SUB_UseTargets(); // fire all targets / killtargets
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
enum {
|
||||
WEAPON_BIG2 = 1,
|
||||
};
|
||||
|
||||
/*QUAKED item_shells(0 .5 .8) (0 0 0) (32 32 32) big
|
||||
*/
|
||||
|
||||
void() item_shells = {
|
||||
self.touch = ammo_touch;
|
||||
|
||||
if(self.spawnflags & AMMO_BIG) {
|
||||
if(self.spawnflags & WEAPON_BIG2) {
|
||||
precache_model("maps/b_shell1.bsp");
|
||||
setmodel(self, "maps/b_shell1.bsp");
|
||||
self.aflag = 40;
|
||||
|
@ -682,16 +704,17 @@ void() item_shells = {
|
|||
}
|
||||
self.weapon = 1;
|
||||
self.netname = "shells";
|
||||
setsize(self, VEC_ORIGIN, '32 32 56');
|
||||
setsize(self, '0 0 0', '32 32 56');
|
||||
StartItem();
|
||||
};
|
||||
|
||||
/*QUAKED item_spikes(0 .5 .8) (0 0 0) (32 32 32) big
|
||||
*/
|
||||
|
||||
void() item_spikes = {
|
||||
self.touch = ammo_touch;
|
||||
|
||||
if(self.spawnflags & AMMO_BIG) {
|
||||
if(self.spawnflags & WEAPON_BIG2) {
|
||||
precache_model("maps/b_nail1.bsp");
|
||||
setmodel(self, "maps/b_nail1.bsp");
|
||||
self.aflag = 50;
|
||||
|
@ -702,16 +725,17 @@ void() item_spikes = {
|
|||
}
|
||||
self.weapon = 2;
|
||||
self.netname = "nails";
|
||||
setsize(self, VEC_ORIGIN, '32 32 56');
|
||||
setsize(self, '0 0 0', '32 32 56');
|
||||
StartItem();
|
||||
};
|
||||
|
||||
/*QUAKED item_rockets(0 .5 .8) (0 0 0) (32 32 32) big
|
||||
*/
|
||||
|
||||
void() item_rockets = {
|
||||
self.touch = ammo_touch;
|
||||
|
||||
if(self.spawnflags & AMMO_BIG) {
|
||||
if(self.spawnflags & WEAPON_BIG2) {
|
||||
precache_model("maps/b_rock1.bsp");
|
||||
setmodel(self, "maps/b_rock1.bsp");
|
||||
self.aflag = 10;
|
||||
|
@ -722,7 +746,7 @@ void() item_rockets = {
|
|||
}
|
||||
self.weapon = 3;
|
||||
self.netname = "rockets";
|
||||
setsize(self, VEC_ORIGIN, '32 32 56');
|
||||
setsize(self, '0 0 0', '32 32 56');
|
||||
StartItem();
|
||||
};
|
||||
|
||||
|
@ -733,7 +757,7 @@ void() item_rockets = {
|
|||
void() item_cells = {
|
||||
self.touch = ammo_touch;
|
||||
|
||||
if(self.spawnflags & AMMO_BIG) {
|
||||
if(self.spawnflags & WEAPON_BIG2) {
|
||||
precache_model("maps/b_batt1.bsp");
|
||||
setmodel(self, "maps/b_batt1.bsp");
|
||||
self.aflag = 12;
|
||||
|
@ -744,10 +768,71 @@ void() item_cells = {
|
|||
}
|
||||
self.weapon = 4;
|
||||
self.netname = "cells";
|
||||
setsize(self, VEC_ORIGIN, '32 32 56');
|
||||
setsize(self, '0 0 0', '32 32 56');
|
||||
StartItem();
|
||||
};
|
||||
|
||||
|
||||
/*QUAKED item_weapon(0 .5 .8) (0 0 0) (32 32 32) shotgun rocket spikes big
|
||||
DO NOT USE THIS!!!! IT WILL BE REMOVED!
|
||||
*/
|
||||
|
||||
enum {
|
||||
WEAPON_SHOTGUN = 1,
|
||||
WEAPON_ROCKET = 2,
|
||||
WEAPON_SPIKES = 4,
|
||||
WEAPON_BIG = 8,
|
||||
};
|
||||
void() item_weapon = {
|
||||
self.touch = ammo_touch;
|
||||
|
||||
if(self.spawnflags & WEAPON_SHOTGUN) {
|
||||
if(self.spawnflags & WEAPON_BIG) {
|
||||
precache_model("maps/b_shell1.bsp");
|
||||
setmodel(self, "maps/b_shell1.bsp");
|
||||
self.aflag = 40;
|
||||
} else {
|
||||
precache_model("maps/b_shell0.bsp");
|
||||
setmodel(self, "maps/b_shell0.bsp");
|
||||
self.aflag = 20;
|
||||
}
|
||||
self.weapon = 1;
|
||||
self.netname = "shells";
|
||||
}
|
||||
|
||||
if(self.spawnflags & WEAPON_SPIKES) {
|
||||
if(self.spawnflags & WEAPON_BIG) {
|
||||
precache_model("maps/b_nail1.bsp");
|
||||
setmodel(self, "maps/b_nail1.bsp");
|
||||
self.aflag = 40;
|
||||
} else {
|
||||
precache_model("maps/b_nail0.bsp");
|
||||
setmodel(self, "maps/b_nail0.bsp");
|
||||
self.aflag = 20;
|
||||
}
|
||||
self.weapon = 2;
|
||||
self.netname = "spikes";
|
||||
}
|
||||
|
||||
if(self.spawnflags & WEAPON_ROCKET) {
|
||||
if(self.spawnflags & WEAPON_BIG) {
|
||||
precache_model("maps/b_rock1.bsp");
|
||||
setmodel(self, "maps/b_rock1.bsp");
|
||||
self.aflag = 10;
|
||||
} else {
|
||||
precache_model("maps/b_rock0.bsp");
|
||||
setmodel(self, "maps/b_rock0.bsp");
|
||||
self.aflag = 5;
|
||||
}
|
||||
self.weapon = 3;
|
||||
self.netname = "rockets";
|
||||
}
|
||||
|
||||
setsize(self, '0 0 0', '32 32 56');
|
||||
StartItem();
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
===============================================================================
|
||||
|
||||
|
|
|
@ -15,13 +15,17 @@ void() info_notnull = {
|
|||
|
||||
//============================================================================
|
||||
|
||||
enum {
|
||||
START_OFF = 1,
|
||||
};
|
||||
|
||||
void() light_use = {
|
||||
if(self.spawnflags & LIGHT_START_OFF) {
|
||||
if(self.spawnflags & START_OFF) {
|
||||
lightstyle(self.style, "m");
|
||||
self.spawnflags = self.spawnflags - LIGHT_START_OFF;
|
||||
self.spawnflags = self.spawnflags - START_OFF;
|
||||
} else {
|
||||
lightstyle(self.style, "a");
|
||||
self.spawnflags = self.spawnflags + LIGHT_START_OFF;
|
||||
self.spawnflags = self.spawnflags + START_OFF;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -40,7 +44,7 @@ void() light = {
|
|||
|
||||
if(self.style >= 32) {
|
||||
self.use = light_use;
|
||||
if(self.spawnflags & LIGHT_START_OFF) {
|
||||
if(self.spawnflags & START_OFF) {
|
||||
lightstyle(self.style, "a");
|
||||
} else {
|
||||
lightstyle(self.style, "m");
|
||||
|
@ -58,7 +62,7 @@ Makes steady fluorescent humming sound
|
|||
void() light_fluoro = {
|
||||
if(self.style >= 32) {
|
||||
self.use = light_use;
|
||||
if(self.spawnflags & LIGHT_START_OFF) {
|
||||
if(self.spawnflags & START_OFF) {
|
||||
lightstyle(self.style, "a");
|
||||
} else {
|
||||
lightstyle(self.style, "m");
|
||||
|
@ -172,7 +176,7 @@ void() fire_fly = {
|
|||
fireball.velocity_z = self.speed + (random() * 200);
|
||||
fireball.classname = "fireball";
|
||||
setmodel(fireball, "progs/lavaball.mdl");
|
||||
setsize(fireball, VEC_ORIGIN, VEC_ORIGIN);
|
||||
setsize(fireball, '0 0 0', '0 0 0');
|
||||
setorigin(fireball, self.origin);
|
||||
fireball.nextthink = time + 5;
|
||||
fireball.think = SUB_Remove;
|
||||
|
@ -195,7 +199,7 @@ void() barrel_explode = {
|
|||
// did say self.owner
|
||||
T_RadiusDamage(self, self, 160, world);
|
||||
sound(self, CHAN_VOICE, "weapons/r_exp3.wav", 1, ATTN_NORM);
|
||||
particle(self.origin, VEC_ORIGIN, 75, 255);
|
||||
particle(self.origin, '0 0 0', 75, 255);
|
||||
|
||||
self.origin_z = self.origin_z + 32;
|
||||
BecomeExplosion();
|
||||
|
@ -256,15 +260,20 @@ void() misc_explobox2 = {
|
|||
|
||||
//============================================================================
|
||||
|
||||
enum {
|
||||
SPAWNFLAG_SUPERSPIKE = 1,
|
||||
SPAWNFLAG_LASER = 2,
|
||||
};
|
||||
|
||||
void() spikeshooter_use = {
|
||||
if(self.spawnflags & SPIKESHOOTER_LASER) {
|
||||
if(self.spawnflags & SPAWNFLAG_LASER) {
|
||||
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 & SPIKESHOOTER_SUPER) {
|
||||
if(self.spawnflags & SPAWNFLAG_SUPERSPIKE) {
|
||||
newmis.touch = superspike_touch;
|
||||
}
|
||||
}
|
||||
|
@ -284,7 +293,7 @@ Laser is only for REGISTERED.
|
|||
void() trap_spikeshooter = {
|
||||
SetMovedir();
|
||||
self.use = spikeshooter_use;
|
||||
if(self.spawnflags & SPIKESHOOTER_LASER) {
|
||||
if(self.spawnflags & SPAWNFLAG_LASER) {
|
||||
precache_model2("progs/laser.mdl");
|
||||
precache_sound2("enforcer/enfire.wav");
|
||||
precache_sound2("enforcer/enfstop.wav");
|
||||
|
@ -433,7 +442,9 @@ void() bubble_bob = {
|
|||
Just for the debugging level. Don't use
|
||||
*/
|
||||
|
||||
void() viewthing = {
|
||||
void() viewthing =
|
||||
|
||||
{
|
||||
self.movetype = MOVETYPE_NONE;
|
||||
self.solid = SOLID_NOT;
|
||||
precache_model("progs/player.mdl");
|
||||
|
@ -457,7 +468,7 @@ void() func_wall_use = {
|
|||
This is just a solid wall if not inhibitted
|
||||
*/
|
||||
void() func_wall = {
|
||||
self.angles = VEC_ORIGIN;
|
||||
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;
|
||||
|
@ -468,7 +479,7 @@ void() func_wall = {
|
|||
A simple entity that looks solid but lets you walk through it.
|
||||
*/
|
||||
void() func_illusionary = {
|
||||
self.angles = VEC_ORIGIN;
|
||||
self.angles = '0 0 0';
|
||||
self.movetype = MOVETYPE_NONE;
|
||||
self.solid = SOLID_NOT;
|
||||
setmodel(self, self.model);
|
||||
|
@ -478,12 +489,14 @@ void() func_illusionary = {
|
|||
/*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 = {
|
||||
void() func_episodegate =
|
||||
|
||||
{
|
||||
if(!(serverflags & self.spawnflags)) {
|
||||
return; // can still enter episode
|
||||
}
|
||||
|
||||
self.angles = VEC_ORIGIN;
|
||||
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;
|
||||
|
@ -493,11 +506,13 @@ void() func_episodegate = {
|
|||
/*QUAKED func_bossgate(0 .5 .8) ?
|
||||
This bmodel appears unless players have all of the episode sigils.
|
||||
*/
|
||||
void() func_bossgate = {
|
||||
void() func_bossgate =
|
||||
|
||||
{
|
||||
if((serverflags & 15) == 15) {
|
||||
return; // all episodes completed
|
||||
}
|
||||
self.angles = VEC_ORIGIN;
|
||||
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;
|
||||
|
|
|
@ -53,7 +53,7 @@ void() OgreGrenadeExplode = {
|
|||
WriteCoord(MSG_BROADCAST, self.origin_y);
|
||||
WriteCoord(MSG_BROADCAST, self.origin_z);
|
||||
|
||||
self.velocity = VEC_ORIGIN;
|
||||
self.velocity = '0 0 0';
|
||||
self.touch = SUB_Null;
|
||||
setmodel(self, "progs/s_explod.spr");
|
||||
self.solid = SOLID_NOT;
|
||||
|
@ -69,8 +69,8 @@ void() OgreGrenadeTouch = {
|
|||
return;
|
||||
}
|
||||
sound(self, CHAN_VOICE, "weapons/bounce.wav", 1, ATTN_NORM); // bounce sound
|
||||
if(self.velocity == VEC_ORIGIN) {
|
||||
self.avelocity = VEC_ORIGIN;
|
||||
if(self.velocity == '0 0 0') {
|
||||
self.avelocity = '0 0 0';
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -110,7 +110,7 @@ void() OgreFireGrenade = {
|
|||
missile.think = OgreGrenadeExplode;
|
||||
|
||||
setmodel(missile, "progs/grenade.mdl");
|
||||
setsize(missile, VEC_ORIGIN, VEC_ORIGIN);
|
||||
setsize(missile, '0 0 0', '0 0 0');
|
||||
setorigin(missile, self.origin);
|
||||
};
|
||||
|
||||
|
@ -422,7 +422,7 @@ void() monster_ogre = {
|
|||
|
||||
setmodel(self, "progs/ogre.mdl");
|
||||
|
||||
setsize(self, '-32 -32 -24', '32 32 64');
|
||||
setsize(self, VEC_HULL2_MIN, VEC_HULL2_MAX);
|
||||
self.health = 200;
|
||||
|
||||
self.th_stand = ogre_stand1;
|
||||
|
|
|
@ -116,7 +116,7 @@ void() finale_1 = {
|
|||
|
||||
pl = find(world, classname, "player");
|
||||
while(pl != world) {
|
||||
pl.view_ofs = VEC_ORIGIN;
|
||||
pl.view_ofs = '0 0 0';
|
||||
pl.angles = other.v_angle = pos.mangle;
|
||||
pl.fixangle = TRUE; // turn this way immediately
|
||||
pl.map = self.map;
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
// plats.qc: moving platforms
|
||||
|
||||
enum {
|
||||
PLAT_LOW_TRIGGER = 1,
|
||||
};
|
||||
|
||||
void() plat_spawn_inside_trigger = {
|
||||
entity trigger;
|
||||
vector tmin, tmax;
|
||||
|
@ -161,7 +165,7 @@ void() func_plat = {
|
|||
}
|
||||
|
||||
self.mangle = self.angles;
|
||||
self.angles = VEC_ORIGIN;
|
||||
self.angles = '0 0 0';
|
||||
|
||||
self.classname = "plat";
|
||||
self.solid = SOLID_BSP;
|
||||
|
|
|
@ -436,7 +436,7 @@ void(string gibname, float dm) ThrowGib = {
|
|||
new = spawn();
|
||||
new.origin = self.origin;
|
||||
setmodel(new, gibname);
|
||||
setsize(new, VEC_ORIGIN, VEC_ORIGIN);
|
||||
setsize(new, '0 0 0', '0 0 0');
|
||||
new.velocity = VelocityForDamage(dm);
|
||||
new.movetype = MOVETYPE_BOUNCE;
|
||||
new.solid = SOLID_NOT;
|
||||
|
|
|
@ -137,7 +137,7 @@ void() ShalMissile = {
|
|||
missile.movetype = MOVETYPE_FLYMISSILE;
|
||||
setmodel(missile, "progs/v_spike.mdl");
|
||||
|
||||
setsize(missile, VEC_ORIGIN, VEC_ORIGIN);
|
||||
setsize(missile, '0 0 0', '0 0 0');
|
||||
|
||||
missile.origin = self.origin + '0 0 10';
|
||||
missile.velocity = dir * 400;
|
||||
|
@ -182,7 +182,7 @@ void() ShalMissileTouch = {
|
|||
WriteCoord(MSG_BROADCAST, self.origin_y);
|
||||
WriteCoord(MSG_BROADCAST, self.origin_z);
|
||||
|
||||
self.velocity = VEC_ORIGIN;
|
||||
self.velocity = '0 0 0';
|
||||
self.touch = SUB_Null;
|
||||
setmodel(self, "progs/s_explod.spr");
|
||||
self.solid = SOLID_NOT;
|
||||
|
@ -213,7 +213,7 @@ void() monster_shalrath = {
|
|||
self.movetype = MOVETYPE_STEP;
|
||||
|
||||
setmodel(self, "progs/shalrath.mdl");
|
||||
setsize(self, '-32 -32 -24', '32 32 64');
|
||||
setsize(self, VEC_HULL2_MIN, VEC_HULL2_MAX);
|
||||
self.health = 400;
|
||||
|
||||
self.th_stand = shal_stand;
|
||||
|
|
|
@ -346,7 +346,7 @@ void() monster_shambler = {
|
|||
self.movetype = MOVETYPE_STEP;
|
||||
setmodel(self, "progs/shambler.mdl");
|
||||
|
||||
setsize(self, '-32 -32 -24', '32 32 64');
|
||||
setsize(self, VEC_HULL2_MIN, VEC_HULL2_MAX);
|
||||
self.health = 600;
|
||||
|
||||
self.th_stand = sham_stand1;
|
||||
|
|
|
@ -18,7 +18,7 @@ void() SetMovedir = {
|
|||
self.movedir = v_forward;
|
||||
}
|
||||
|
||||
self.angles = VEC_ORIGIN;
|
||||
self.angles = '0 0 0';
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -29,7 +29,7 @@ InitTrigger
|
|||
void() InitTrigger = {
|
||||
// trigger angles are used for one-way touches. An angle of 0 is assumed
|
||||
// to mean no restrictions, so use a yaw of 360 instead.
|
||||
if(self.angles != VEC_ORIGIN) {
|
||||
if(self.angles != '0 0 0') {
|
||||
SetMovedir();
|
||||
}
|
||||
self.solid = SOLID_TRIGGER;
|
||||
|
@ -69,7 +69,7 @@ void(vector tdest, float tspeed, void() func) SUB_CalcMove = {
|
|||
self.think = SUB_CalcMoveDone;
|
||||
|
||||
if(tdest == self.origin) {
|
||||
self.velocity = VEC_ORIGIN;
|
||||
self.velocity = '0 0 0';
|
||||
self.nextthink = self.ltime + 0.1;
|
||||
return;
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ void(vector tdest, float tspeed, void() func) SUB_CalcMove = {
|
|||
traveltime = len / tspeed;
|
||||
|
||||
if(traveltime < 0.1) {
|
||||
self.velocity = VEC_ORIGIN;
|
||||
self.velocity = '0 0 0';
|
||||
self.nextthink = self.ltime + 0.1;
|
||||
return;
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ After moving, set origin to exact final destination
|
|||
*/
|
||||
void() SUB_CalcMoveDone = {
|
||||
setorigin(self, self.finaldest);
|
||||
self.velocity = VEC_ORIGIN;
|
||||
self.velocity = '0 0 0';
|
||||
self.nextthink = -1;
|
||||
if(self.think1) {
|
||||
self.think1();
|
||||
|
@ -163,7 +163,7 @@ After rotating, set angle to exact final angle
|
|||
*/
|
||||
void() SUB_CalcAngleMoveDone = {
|
||||
self.angles = self.finalangle;
|
||||
self.avelocity = VEC_ORIGIN;
|
||||
self.avelocity = '0 0 0';
|
||||
self.nextthink = -1;
|
||||
if(self.think1) {
|
||||
self.think1();
|
||||
|
|
|
@ -6,6 +6,14 @@ void() trigger_reactivate = {
|
|||
|
||||
//=============================================================================
|
||||
|
||||
enum {
|
||||
SPAWNFLAG_NOMESSAGE = 1,
|
||||
};
|
||||
|
||||
enum {
|
||||
SPAWNFLAG_NOTOUCH = 1,
|
||||
};
|
||||
|
||||
// the wait time has passed, so set back up for another activation
|
||||
void() multi_wait = {
|
||||
if(self.max_health) {
|
||||
|
@ -70,7 +78,7 @@ void() multi_touch = {
|
|||
}
|
||||
|
||||
// if the trigger has an angles field, check player's facing direction
|
||||
if(self.movedir != VEC_ORIGIN) {
|
||||
if(self.movedir != '0 0 0') {
|
||||
makevectors(other.angles);
|
||||
if(v_forward * self.movedir < 0) {
|
||||
return; // not facing the right way
|
||||
|
@ -114,7 +122,7 @@ void() trigger_multiple = {
|
|||
InitTrigger();
|
||||
|
||||
if(self.health) {
|
||||
if(self.spawnflags & MULTIPLE_NOTOUCH) {
|
||||
if(self.spawnflags & SPAWNFLAG_NOTOUCH) {
|
||||
objerror("health and notouch don't make sense\n");
|
||||
}
|
||||
self.max_health = self.health;
|
||||
|
@ -123,7 +131,7 @@ void() trigger_multiple = {
|
|||
self.solid = SOLID_BBOX;
|
||||
setorigin(self, self.origin); // make sure it links into the world
|
||||
} else {
|
||||
if(!(self.spawnflags & MULTIPLE_NOTOUCH)) {
|
||||
if(!(self.spawnflags & SPAWNFLAG_NOTOUCH)) {
|
||||
self.touch = multi_touch;
|
||||
}
|
||||
}
|
||||
|
@ -191,6 +199,8 @@ void() trigger_secret = {
|
|||
//=============================================================================
|
||||
|
||||
void() counter_use = {
|
||||
string junk;
|
||||
|
||||
self.count = self.count - 1;
|
||||
if(self.count < 0) {
|
||||
return;
|
||||
|
@ -198,7 +208,7 @@ void() counter_use = {
|
|||
|
||||
if(self.count != 0) {
|
||||
if(activator.classname == "player"
|
||||
&& (self.spawnflags & COUNTER_NOMESSAGE) == 0) {
|
||||
&& (self.spawnflags & SPAWNFLAG_NOMESSAGE) == 0) {
|
||||
if(self.count >= 4) {
|
||||
centerprint(activator, "There are more to go...");
|
||||
} else if(self.count == 3) {
|
||||
|
@ -212,7 +222,8 @@ void() counter_use = {
|
|||
return;
|
||||
}
|
||||
|
||||
if(activator.classname == "player" && (self.spawnflags & COUNTER_NOMESSAGE) == 0) {
|
||||
if(activator.classname == "player"
|
||||
&& (self.spawnflags & SPAWNFLAG_NOMESSAGE) == 0) {
|
||||
centerprint(activator, "Sequence completed!");
|
||||
}
|
||||
self.enemy = activator;
|
||||
|
@ -243,6 +254,11 @@ TELEPORT TRIGGERS
|
|||
==============================================================================
|
||||
*/
|
||||
|
||||
enum {
|
||||
PLAYER_ONLY = 1,
|
||||
SILENT = 2,
|
||||
};
|
||||
|
||||
void() play_teleport = {
|
||||
float v;
|
||||
string tmpstr;
|
||||
|
@ -308,7 +324,7 @@ void(vector org, entity death_owner) spawn_tdeath = {
|
|||
death.classname = "teledeath";
|
||||
death.movetype = MOVETYPE_NONE;
|
||||
death.solid = SOLID_TRIGGER;
|
||||
death.angles = VEC_ORIGIN;
|
||||
death.angles = '0 0 0';
|
||||
setsize(death, death_owner.mins - '1 1 1', death_owner.maxs + '1 1 1');
|
||||
setorigin(death, org);
|
||||
death.touch = tdeath_touch;
|
||||
|
@ -329,7 +345,7 @@ void() teleport_touch = {
|
|||
}
|
||||
}
|
||||
|
||||
if(self.spawnflags & TELE_PLAYER_ONLY) {
|
||||
if(self.spawnflags & PLAYER_ONLY) {
|
||||
if(other.classname != "player") {
|
||||
return;
|
||||
}
|
||||
|
@ -357,7 +373,7 @@ void() teleport_touch = {
|
|||
spawn_tfog(org);
|
||||
spawn_tdeath(t.origin, other);
|
||||
|
||||
// move the player and lock them down for a little while
|
||||
// move the player and lock him down for a little while
|
||||
if(!other.health) {
|
||||
other.origin = t.origin;
|
||||
other.velocity = (v_forward * other.velocity_x) + (v_forward * other.velocity_y);
|
||||
|
@ -383,7 +399,7 @@ This is the destination marker for a teleporter. It should have a "targetname" f
|
|||
void() info_teleport_destination = {
|
||||
// this does nothing, just serves as a target spot
|
||||
self.mangle = self.angles;
|
||||
self.angles = VEC_ORIGIN;
|
||||
self.angles = '0 0 0';
|
||||
self.model = "";
|
||||
self.origin = self.origin + '0 0 27';
|
||||
if(!self.targetname) {
|
||||
|
@ -413,7 +429,7 @@ void() trigger_teleport = {
|
|||
}
|
||||
self.use = teleport_use;
|
||||
|
||||
if(!(self.spawnflags & TELE_SILENT)) {
|
||||
if(!(self.spawnflags & SILENT)) {
|
||||
precache_sound("ambience/hum1.wav");
|
||||
o = (self.mins + self.maxs) * 0.5;
|
||||
ambientsound(o, "ambience/hum1.wav", 0.5, ATTN_STATIC);
|
||||
|
@ -516,6 +532,10 @@ void() trigger_hurt = {
|
|||
|
||||
//============================================================================
|
||||
|
||||
enum {
|
||||
PUSH_ONCE = 1,
|
||||
};
|
||||
|
||||
void() trigger_push_touch = {
|
||||
if(other.classname == "grenade") {
|
||||
other.velocity = self.speed * self.movedir * 10;
|
||||
|
@ -577,7 +597,7 @@ void() trigger_monsterjump = {
|
|||
if(!self.height) {
|
||||
self.height = 200;
|
||||
}
|
||||
if(self.angles == VEC_ORIGIN) {
|
||||
if(self.angles == '0 0 0') {
|
||||
self.angles = '0 360 0';
|
||||
}
|
||||
InitTrigger();
|
||||
|
|
|
@ -36,7 +36,7 @@ void() W_FireAxe = {
|
|||
|
||||
if(trace_ent.takedamage) {
|
||||
trace_ent.axhitme = 1;
|
||||
SpawnBlood(org, VEC_ORIGIN, 20);
|
||||
SpawnBlood(org, '0 0 0', 20);
|
||||
T_Damage(trace_ent, self, self, 20);
|
||||
} else {
|
||||
// hit wall
|
||||
|
@ -88,7 +88,7 @@ void(vector org, vector vel) SpawnMeatSpray = {
|
|||
missile.think = SUB_Remove;
|
||||
|
||||
setmodel(missile, "progs/zom_gib.mdl");
|
||||
setsize(missile, VEC_ORIGIN, VEC_ORIGIN);
|
||||
setsize(missile, '0 0 0', '0 0 0');
|
||||
setorigin(missile, org);
|
||||
};
|
||||
|
||||
|
@ -277,7 +277,7 @@ void() s_explode6 = [5, SUB_Remove] {};
|
|||
|
||||
void() BecomeExplosion = {
|
||||
self.movetype = MOVETYPE_NONE;
|
||||
self.velocity = VEC_ORIGIN;
|
||||
self.velocity = '0 0 0';
|
||||
self.touch = SUB_Null;
|
||||
setmodel(self, "progs/s_explod.spr");
|
||||
self.solid = SOLID_NOT;
|
||||
|
@ -356,7 +356,7 @@ void() W_FireRocket = {
|
|||
missile.think = SUB_Remove;
|
||||
|
||||
setmodel(missile, "progs/missile.mdl");
|
||||
setsize(missile, VEC_ORIGIN, VEC_ORIGIN);
|
||||
setsize(missile, '0 0 0', '0 0 0');
|
||||
setorigin(missile, self.origin + v_forward * 8 + '0 0 16');
|
||||
};
|
||||
|
||||
|
@ -479,8 +479,8 @@ void() GrenadeTouch = {
|
|||
return;
|
||||
}
|
||||
sound(self, CHAN_WEAPON, "weapons/bounce.wav", 1, ATTN_NORM); // bounce sound
|
||||
if(self.velocity == VEC_ORIGIN) {
|
||||
self.avelocity = VEC_ORIGIN;
|
||||
if(self.velocity == '0 0 0') {
|
||||
self.avelocity = '0 0 0';
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -527,7 +527,7 @@ void() W_FireGrenade = {
|
|||
missile.think = GrenadeExplode;
|
||||
|
||||
setmodel(missile, "progs/grenade.mdl");
|
||||
setsize(missile, VEC_ORIGIN, VEC_ORIGIN);
|
||||
setsize(missile, '0 0 0', '0 0 0');
|
||||
setorigin(missile, self.origin);
|
||||
};
|
||||
|
||||
|
@ -679,61 +679,51 @@ PLAYER WEAPON USE
|
|||
void() W_SetCurrentAmmo = {
|
||||
player_run(); // get out of any weapon firing states
|
||||
|
||||
self.items &= ~(IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS);
|
||||
self.items = self.items - (self.items & (IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS));
|
||||
|
||||
switch(self.weapon) {
|
||||
case IT_AXE:
|
||||
if(self.weapon == IT_AXE) {
|
||||
self.currentammo = 0;
|
||||
self.weaponmodel = "progs/v_axe.mdl";
|
||||
self.weaponframe = 0;
|
||||
break;
|
||||
case IT_SHOTGUN:
|
||||
} else if(self.weapon == IT_SHOTGUN) {
|
||||
self.currentammo = self.ammo_shells;
|
||||
self.weaponmodel = "progs/v_shot.mdl";
|
||||
self.weaponframe = 0;
|
||||
self.items |= IT_SHELLS;
|
||||
break;
|
||||
case IT_SUPER_SHOTGUN:
|
||||
self.items = self.items | IT_SHELLS;
|
||||
} else if(self.weapon == IT_SUPER_SHOTGUN) {
|
||||
self.currentammo = self.ammo_shells;
|
||||
self.weaponmodel = "progs/v_shot2.mdl";
|
||||
self.weaponframe = 0;
|
||||
self.items |= IT_SHELLS;
|
||||
break;
|
||||
case IT_NAILGUN:
|
||||
self.items = self.items | IT_SHELLS;
|
||||
} else if(self.weapon == IT_NAILGUN) {
|
||||
self.currentammo = self.ammo_nails;
|
||||
self.weaponmodel = "progs/v_nail.mdl";
|
||||
self.weaponframe = 0;
|
||||
self.items |= IT_NAILS;
|
||||
break;
|
||||
case IT_SUPER_NAILGUN:
|
||||
self.items = self.items | IT_NAILS;
|
||||
} else if(self.weapon == IT_SUPER_NAILGUN) {
|
||||
self.currentammo = self.ammo_nails;
|
||||
self.weaponmodel = "progs/v_nail2.mdl";
|
||||
self.weaponframe = 0;
|
||||
self.items |= IT_NAILS;
|
||||
break;
|
||||
case IT_GRENADE_LAUNCHER:
|
||||
self.items = self.items | IT_NAILS;
|
||||
} else if(self.weapon == IT_GRENADE_LAUNCHER) {
|
||||
self.currentammo = self.ammo_rockets;
|
||||
self.weaponmodel = "progs/v_rock.mdl";
|
||||
self.weaponframe = 0;
|
||||
self.items |= IT_ROCKETS;
|
||||
break;
|
||||
case IT_ROCKET_LAUNCHER:
|
||||
self.items = self.items | IT_ROCKETS;
|
||||
} else if(self.weapon == IT_ROCKET_LAUNCHER) {
|
||||
self.currentammo = self.ammo_rockets;
|
||||
self.weaponmodel = "progs/v_rock2.mdl";
|
||||
self.weaponframe = 0;
|
||||
self.items |= IT_ROCKETS;
|
||||
break;
|
||||
case IT_LIGHTNING:
|
||||
self.items = self.items | IT_ROCKETS;
|
||||
} else if(self.weapon == IT_LIGHTNING) {
|
||||
self.currentammo = self.ammo_cells;
|
||||
self.weaponmodel = "progs/v_light.mdl";
|
||||
self.weaponframe = 0;
|
||||
self.items |= IT_CELLS;
|
||||
break;
|
||||
default:
|
||||
self.items = self.items | IT_CELLS;
|
||||
} else {
|
||||
self.currentammo = 0;
|
||||
self.weaponmodel = "";
|
||||
self.weaponframe = 0;
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -760,6 +750,23 @@ float() W_BestWeapon = {
|
|||
return IT_AXE;
|
||||
};
|
||||
|
||||
float() W_CheckNoAmmo = {
|
||||
if(self.currentammo > 0) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if(self.weapon == IT_AXE) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
self.weapon = W_BestWeapon();
|
||||
|
||||
W_SetCurrentAmmo();
|
||||
|
||||
// drop the weapon down
|
||||
return FALSE;
|
||||
};
|
||||
|
||||
/*
|
||||
============
|
||||
W_Attack
|
||||
|
@ -770,17 +777,14 @@ An attack impulse can be triggered now
|
|||
void() W_Attack = {
|
||||
float r;
|
||||
|
||||
if(self.currentammo <= 0 && self.weapon != IT_AXE) {
|
||||
self.weapon = W_BestWeapon();
|
||||
W_SetCurrentAmmo();
|
||||
if(!W_CheckNoAmmo()) {
|
||||
return;
|
||||
}
|
||||
|
||||
makevectors(self.v_angle); // calculate forward angle for velocity
|
||||
self.show_hostile = time + 1; // wake monsters up
|
||||
|
||||
switch(self.weapon) {
|
||||
case IT_AXE:
|
||||
if(self.weapon == IT_AXE) {
|
||||
sound(self, CHAN_WEAPON, "weapons/ax1.wav", 1, ATTN_NORM);
|
||||
r = random();
|
||||
if(r < 0.25) {
|
||||
|
@ -793,36 +797,30 @@ void() W_Attack = {
|
|||
player_axed1();
|
||||
}
|
||||
self.attack_finished = time + 0.5;
|
||||
break;
|
||||
case IT_SHOTGUN:
|
||||
} else if(self.weapon == IT_SHOTGUN) {
|
||||
player_shot1();
|
||||
W_FireShotgun();
|
||||
self.attack_finished = time + 0.5;
|
||||
break;
|
||||
case IT_SUPER_SHOTGUN:
|
||||
} else if(self.weapon == IT_SUPER_SHOTGUN) {
|
||||
player_shot1();
|
||||
W_FireSuperShotgun();
|
||||
self.attack_finished = time + 0.7;
|
||||
break;
|
||||
case IT_NAILGUN:
|
||||
case IT_SUPER_NAILGUN:
|
||||
} else if(self.weapon == IT_NAILGUN) {
|
||||
player_nail1();
|
||||
break;
|
||||
case IT_GRENADE_LAUNCHER:
|
||||
} else if(self.weapon == IT_SUPER_NAILGUN) {
|
||||
player_nail1();
|
||||
} else if(self.weapon == IT_GRENADE_LAUNCHER) {
|
||||
player_rocket1();
|
||||
W_FireGrenade();
|
||||
self.attack_finished = time + 0.6;
|
||||
break;
|
||||
case IT_ROCKET_LAUNCHER:
|
||||
} else if(self.weapon == IT_ROCKET_LAUNCHER) {
|
||||
player_rocket1();
|
||||
W_FireRocket();
|
||||
self.attack_finished = time + 0.8;
|
||||
break;
|
||||
case IT_LIGHTNING:
|
||||
} else if(self.weapon == IT_LIGHTNING) {
|
||||
player_light1();
|
||||
self.attack_finished = time + 0.1;
|
||||
sound(self, CHAN_AUTO, "weapons/lstart.wav", 1, ATTN_NORM);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -963,14 +961,13 @@ void() W_CycleWeapon = {
|
|||
am = 1;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
if((it & self.weapon) && am == 0) {
|
||||
W_SetCurrentAmmo();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -1033,14 +1030,13 @@ void() W_CycleWeaponReverse = {
|
|||
am = 1;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
if((it & self.weapon) && am == 0) {
|
||||
W_SetCurrentAmmo();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
@ -62,7 +62,7 @@ void(entity missile, float mspeed, float accuracy) LaunchMissile = {
|
|||
|
||||
missile.velocity = vec * mspeed;
|
||||
|
||||
missile.angles = VEC_ORIGIN;
|
||||
missile.angles = '0 0 0';
|
||||
missile.angles_y = vectoyaw(missile.velocity);
|
||||
|
||||
// set missile duration
|
||||
|
@ -196,7 +196,7 @@ void() Wiz_StartFast = {
|
|||
missile = spawn();
|
||||
missile.owner = self;
|
||||
missile.nextthink = time + 0.6;
|
||||
setsize(missile, VEC_ORIGIN, VEC_ORIGIN);
|
||||
setsize(missile, '0 0 0', '0 0 0');
|
||||
setorigin(missile, self.origin + '0 0 30' + v_forward * 14 + v_right * 14);
|
||||
missile.enemy = self.enemy;
|
||||
missile.nextthink = time + 0.8;
|
||||
|
@ -206,7 +206,7 @@ void() Wiz_StartFast = {
|
|||
missile = spawn();
|
||||
missile.owner = self;
|
||||
missile.nextthink = time + 1;
|
||||
setsize(missile, VEC_ORIGIN, VEC_ORIGIN);
|
||||
setsize(missile, '0 0 0', '0 0 0');
|
||||
setorigin(missile, self.origin + '0 0 30' + v_forward * 14 + v_right * -14);
|
||||
missile.enemy = self.enemy;
|
||||
missile.nextthink = time + 0.3;
|
||||
|
|
|
@ -45,6 +45,10 @@ $frame paine29 paine30
|
|||
|
||||
$frame cruc_1 cruc_2 cruc_3 cruc_4 cruc_5 cruc_6
|
||||
|
||||
enum {
|
||||
SPAWN_CRUCIFIED = 1,
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
|
||||
void() zombie_stand1 = [ $stand1, zombie_stand2 ] {ai_stand();};
|
||||
|
@ -145,8 +149,8 @@ void() ZombieGrenadeTouch = {
|
|||
return;
|
||||
}
|
||||
sound(self, CHAN_WEAPON, "zombie/z_miss.wav", 1, ATTN_NORM); // bounce sound
|
||||
self.velocity = VEC_ORIGIN;
|
||||
self.avelocity = VEC_ORIGIN;
|
||||
self.velocity = '0 0 0';
|
||||
self.avelocity = '0 0 0';
|
||||
self.touch = SUB_Remove;
|
||||
};
|
||||
|
||||
|
@ -186,7 +190,7 @@ void(vector st) ZombieFireGrenade = {
|
|||
missile.think = SUB_Remove;
|
||||
|
||||
setmodel(missile, "progs/zom_gib.mdl");
|
||||
setsize(missile, VEC_ORIGIN, VEC_ORIGIN);
|
||||
setsize(missile, '0 0 0', '0 0 0');
|
||||
setorigin(missile, org);
|
||||
};
|
||||
|
||||
|
@ -493,7 +497,7 @@ void() monster_zombie = {
|
|||
self.th_die = zombie_die;
|
||||
self.th_missile = zombie_missile;
|
||||
|
||||
if(self.spawnflags & ZOMBIE_SPAWN_CRUCIFIED) {
|
||||
if(self.spawnflags & SPAWN_CRUCIFIED) {
|
||||
self.movetype = MOVETYPE_NONE;
|
||||
zombie_cruc1();
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue
Block a user