Compare commits

...

3 Commits

Author SHA1 Message Date
an f48bed0dc8 remove local and extraneous whitespace 2019-09-17 11:26:44 -04:00
an bd05a9b762 add refactoring info 2019-09-17 11:23:21 -04:00
an 35e64ea09f add info to file headers and move globals to defs.qc 2019-09-16 21:43:31 -04:00
37 changed files with 544 additions and 767 deletions

View File

@ -23,6 +23,8 @@ s = IO.popen 'expand', mode: "r+" do |io| pipe_in_out io, s end
s = IO.popen style_args, mode: "r+" do |io| pipe_in_out io, s end s = IO.popen style_args, mode: "r+" do |io| pipe_in_out io, s end
s = s.gsub /\b(\w+) \(/, '\1(' s = s.gsub /\b(\w+) \(/, '\1('
s = s.gsub /\(\s*(.*)\s*\)/, '(\1)' s = s.gsub /\(\s*(.*)\s*\)/, '(\1)'
s = s.gsub /local /, ''
s = s.gsub /\n\n\n/, "\n\n"
s = IO.popen 'unexpand', mode: "r+" do |io| pipe_in_out io, s end s = IO.popen 'unexpand', mode: "r+" do |io| pipe_in_out io, s end
30.times do s = s.gsub(/ /, ' ') end 30.times do s = s.gsub(/ /, ' ') end
puts s puts s

View File

@ -35,9 +35,9 @@
VARIADIC_ARGS = true VARIADIC_ARGS = true
[warnings] [warnings]
ALL = true ALL = true
ASSIGN_FUNCTION_TYPES = false ASSIGN_FUNCTION_TYPES = false
USED_UNINITIALIZED = false USED_UNINITIALIZED = false
[optimizations] [optimizations]
PEEPHOLE = true PEEPHOLE = true

View File

@ -1,21 +1,23 @@
progs.dat progs.dat
source/defs.qc source/defs.qc
source/subs.qc
source/fight.qc source/fight.qc
source/subs.qc
source/ai.qc source/ai.qc
source/buttons.qc
source/client.qc
source/combat.qc source/combat.qc
source/doors.qc
source/items.qc source/items.qc
source/misc.qc
source/monsters.qc
source/plats.qc
source/player.qc
source/triggers.qc
source/weapons.qc source/weapons.qc
source/world.qc source/world.qc
source/client.qc
source/player.qc
source/monsters.qc
source/doors.qc
source/buttons.qc
source/triggers.qc
source/plats.qc
source/misc.qc
source/ogre.qc source/ogre.qc
source/demon.qc source/demon.qc

View File

@ -1,38 +1,10 @@
/* // ai.qc: monster AI functions
.enemy
Will be world if not currently angry at anyone.
.movetarget
The next path spot to walk toward. If .enemy, ignore .movetarget.
When an enemy is killed, the monster will try to return to it's path.
.huntt_ime
Set to time + something when the player is in sight, but movement straight for
him is blocked. This causes the monster to use wall following code for
movement direction instead of sighting on the player.
.ideal_yaw
A yaw angle of the intended direction, which will be turned towards at up
to 45 deg / state. If the enemy is in view and hunt_time is not active,
this will be the exact line towards the enemy.
.pausetime
A monster will leave it's stand state and head towards it's .movetarget when
time > .pausetime.
walkmove(angle, speed) primitive is all or nothing
*/
// //
// when a monster becomes angry at a player, that monster will be used // when a monster becomes angry at a player, that monster will be used
// as the sight target the next frame so that monsters near that one // as the sight target the next frame so that monsters near that one
// will wake up even if they wouldn't have noticed the player // will wake up even if they wouldn't have noticed the player
// //
entity sight_entity;
float sight_entity_time;
float(float v) anglemod = { float(float v) anglemod = {
while(v >= 360) { while(v >= 360) {
v = v - 360; v = v - 360;
@ -62,7 +34,6 @@ The number of seconds to spend standing or bowing for path_stand or path_bow
============================================================================== ==============================================================================
*/ */
void() movetarget_f = { void() movetarget_f = {
if(!self.targetname) { if(!self.targetname) {
objerror("monster_movetarget: no targetname"); objerror("monster_movetarget: no targetname");
@ -81,7 +52,6 @@ void() path_corner = {
movetarget_f(); movetarget_f();
}; };
/* /*
============= =============
t_movetarget t_movetarget
@ -91,7 +61,7 @@ moving towards it, change the next destination and continue.
============== ==============
*/ */
void() t_movetarget = { void() t_movetarget = {
local entity temp; entity temp;
if(other.movetarget != self) { if(other.movetarget != self) {
return; return;
@ -120,7 +90,6 @@ void() t_movetarget = {
}; };
//============================================================================ //============================================================================
/* /*
@ -135,8 +104,8 @@ returns the range catagorization of an entity reletive to self
============= =============
*/ */
float(entity targ) range = { float(entity targ) range = {
local vector spot1, spot2; vector spot1, spot2;
local float r; float r;
spot1 = self.origin + self.view_ofs; spot1 = self.origin + self.view_ofs;
spot2 = targ.origin + targ.view_ofs; spot2 = targ.origin + targ.view_ofs;
@ -161,7 +130,7 @@ returns 1 if the entity is visible to self, even if not infront()
============= =============
*/ */
float(entity targ) visible = { float(entity targ) visible = {
local vector spot1, spot2; vector spot1, spot2;
spot1 = self.origin + self.view_ofs; spot1 = self.origin + self.view_ofs;
spot2 = targ.origin + targ.view_ofs; spot2 = targ.origin + targ.view_ofs;
@ -177,7 +146,6 @@ float(entity targ) visible = {
return FALSE; return FALSE;
}; };
/* /*
============= =============
infront infront
@ -186,8 +154,8 @@ returns 1 if the entity is in front(in sight) of self
============= =============
*/ */
float(entity targ) infront = { float(entity targ) infront = {
local vector vec; vector vec;
local float dot; float dot;
makevectors(self.angles); makevectors(self.angles);
vec = normalize(targ.origin - self.origin); vec = normalize(targ.origin - self.origin);
@ -199,7 +167,6 @@ float(entity targ) infront = {
return FALSE; return FALSE;
}; };
//============================================================================ //============================================================================
void() HuntTarget = { void() HuntTarget = {
@ -211,7 +178,7 @@ void() HuntTarget = {
}; };
void() SightSound = { void() SightSound = {
local float rsnd; float rsnd;
if(self.classname == "monster_ogre") { if(self.classname == "monster_ogre") {
sound(self, CHAN_VOICE, "ogre/ogwake.wav", 1, ATTN_NORM); sound(self, CHAN_VOICE, "ogre/ogwake.wav", 1, ATTN_NORM);
@ -282,8 +249,8 @@ slower noticing monsters.
============ ============
*/ */
float() FindTarget = { float() FindTarget = {
local entity client; entity client;
local float r; float r;
// if the first spawnflag bit is set, the monster will only wake up on // if the first spawnflag bit is set, the monster will only wake up on
// really seeing the player, not another monster getting angry // really seeing the player, not another monster getting angry
@ -350,7 +317,6 @@ float() FindTarget = {
return TRUE; return TRUE;
}; };
//============================================================================= //=============================================================================
void(float dist) ai_forward = { void(float dist) ai_forward = {
@ -361,7 +327,6 @@ void(float dist) ai_back = {
walkmove((self.angles_y + 180), dist); walkmove((self.angles_y + 180), dist);
}; };
/* /*
============= =============
ai_pain ai_pain
@ -372,7 +337,7 @@ stagger back a bit
void(float dist) ai_pain = { void(float dist) ai_pain = {
ai_back(dist); ai_back(dist);
/* /*
local float away; float away;
away = anglemod(vectoyaw(self.origin - self.enemy.origin) away = anglemod(vectoyaw(self.origin - self.enemy.origin)
+ 180*(random()- 0.5) ); + 180*(random()- 0.5) );
@ -400,7 +365,7 @@ The monster is walking it's beat
============= =============
*/ */
void(float dist) ai_walk = { void(float dist) ai_walk = {
local vector mtemp; vector mtemp;
movedist = dist; movedist = dist;
@ -416,7 +381,6 @@ void(float dist) ai_walk = {
movetogoal(dist); movetogoal(dist);
}; };
/* /*
============= =============
ai_stand ai_stand
@ -461,7 +425,7 @@ ChooseTurn
============= =============
*/ */
void(vector dest3) ChooseTurn = { void(vector dest3) ChooseTurn = {
local vector dir, newdir; vector dir, newdir;
dir = self.origin - dest3; dir = self.origin - dest3;
@ -488,7 +452,7 @@ FacingIdeal
============ ============
*/ */
float() FacingIdeal = { float() FacingIdeal = {
local float delta; float delta;
delta = anglemod(self.angles_y - self.ideal_yaw); delta = anglemod(self.angles_y - self.ideal_yaw);
if(delta > 45 && delta < 315) { if(delta > 45 && delta < 315) {
@ -497,7 +461,6 @@ float() FacingIdeal = {
return TRUE; return TRUE;
}; };
//============================================================================= //=============================================================================
float() CheckAnyAttack = { float() CheckAnyAttack = {
@ -525,7 +488,6 @@ float() CheckAnyAttack = {
return CheckAttack(); return CheckAttack();
}; };
/* /*
============= =============
ai_run_melee ai_run_melee
@ -543,7 +505,6 @@ void() ai_run_melee = {
} }
}; };
/* /*
============= =============
ai_run_missile ai_run_missile
@ -560,7 +521,6 @@ void() ai_run_missile = {
} }
}; };
/* /*
============= =============
ai_run_slide ai_run_slide
@ -569,7 +529,7 @@ Strafe sideways, but stay at aproximately the same range
============= =============
*/ */
void() ai_run_slide = { void() ai_run_slide = {
local float ofs; float ofs;
self.ideal_yaw = enemy_yaw; self.ideal_yaw = enemy_yaw;
ChangeYaw(); ChangeYaw();
@ -588,7 +548,6 @@ void() ai_run_slide = {
walkmove(self.ideal_yaw - ofs, movedist); walkmove(self.ideal_yaw - ofs, movedist);
}; };
/* /*
============= =============
ai_run ai_run
@ -597,9 +556,9 @@ The monster has an enemy it is trying to kill
============= =============
*/ */
void(float dist) ai_run = { void(float dist) ai_run = {
local vector delta; vector delta;
local float axis; float axis;
local float direct, ang_rint, ang_floor, ang_ceil; float direct, ang_rint, ang_floor, ang_ceil;
movedist = dist; movedist = dist;
// see if the enemy is dead // see if the enemy is dead

View File

@ -1,10 +1,5 @@
/* // boss.qc: Chthon, boss of E1
==============================================================================
BOSS-ONE
==============================================================================
*/
$cd id1 / models / boss1 $cd id1 / models / boss1
$origin 0 0 - 15 $origin 0 0 - 15
$base base $base base
@ -34,7 +29,6 @@ $frame shockb1 shockb2 shockb3 shockb4 shockb5 shockb6
$frame shockc1 shockc2 shockc3 shockc4 shockc5 shockc6 shockc7 shockc8 $frame shockc1 shockc2 shockc3 shockc4 shockc5 shockc6 shockc7 shockc8
$frame shockc9 shockc10 $frame shockc9 shockc10
void() boss_face = { void() boss_face = {
// go for another player if multi player // go for another player if multi player
@ -187,9 +181,9 @@ void() boss_death10 = [$death9, boss_death10] {
}; };
void(vector p) boss_missile = { void(vector p) boss_missile = {
local vector offang; vector offang;
local vector org, vec, d; vector org, vec, d;
local float t; float t;
offang = vectoangles(self.enemy.origin - self.origin); offang = vectoangles(self.enemy.origin - self.origin);
makevectors(offang); makevectors(offang);
@ -222,7 +216,6 @@ void(vector p) boss_missile = {
} }
}; };
void() boss_awake = { void() boss_awake = {
self.solid = SOLID_SLIDEBOX; self.solid = SOLID_SLIDEBOX;
self.movetype = MOVETYPE_STEP; self.movetype = MOVETYPE_STEP;
@ -249,7 +242,6 @@ void() boss_awake = {
boss_rise1(); boss_rise1();
}; };
/*QUAKED monster_boss(1 0 0) (-128 -128 -24) (128 128 256) /*QUAKED monster_boss(1 0 0) (-128 -128 -24) (128 128 256)
*/ */
void() monster_boss = { void() monster_boss = {
@ -275,11 +267,8 @@ void() monster_boss = {
//=========================================================================== //===========================================================================
entity le1, le2;
float lightning_end;
void() lightning_fire = { void() lightning_fire = {
local vector p1, p2; vector p1, p2;
if(time >= lightning_end) { if(time >= lightning_end) {
// done here, put the terminals back up // done here, put the terminals back up
@ -326,8 +315,8 @@ void() lightning_use = {
} }
if((le1.state != STATE_TOP && le1.state != STATE_BOTTOM) if((le1.state != STATE_TOP && le1.state != STATE_BOTTOM)
|| (le2.state != STATE_TOP && le2.state != STATE_BOTTOM) || (le2.state != STATE_TOP && le2.state != STATE_BOTTOM)
|| (le1.state != le2.state)) { || (le1.state != le2.state)) {
// dprint("not aligned\n"); // dprint("not aligned\n");
return; return;
} }
@ -359,7 +348,6 @@ void() lightning_use = {
} }
}; };
/*QUAKED event_lightning(0 1 1) (-16 -16 -16) (16 16 16) /*QUAKED event_lightning(0 1 1) (-16 -16 -16) (16 16 16)
Just for boss level. Just for boss level.
*/ */
@ -367,4 +355,3 @@ void() event_lightning = {
self.use = lightning_use; self.use = lightning_use;
}; };

View File

@ -1,4 +1,4 @@
// button and multiple button // buttons.qc: button and multiple button
void() button_wait = { void() button_wait = {
self.state = STATE_TOP; self.state = STATE_TOP;
@ -22,12 +22,10 @@ void() button_return = {
} }
}; };
void() button_blocked = { void() button_blocked = {
// do nothing, just don't ome all the way back out // do nothing, just don't ome all the way back out
}; };
void() button_fire = { void() button_fire = {
if(self.state == STATE_UP || self.state == STATE_TOP) { if(self.state == STATE_UP || self.state == STATE_TOP) {
return; return;
@ -39,7 +37,6 @@ void() button_fire = {
SUB_CalcMove(self.pos2, self.speed, button_wait); SUB_CalcMove(self.pos2, self.speed, button_wait);
}; };
void() button_use = { void() button_use = {
self.enemy = activator; self.enemy = activator;
button_fire(); button_fire();
@ -60,7 +57,6 @@ void() button_killed = {
button_fire(); button_fire();
}; };
/*QUAKED func_button(0 .5 .8) ? /*QUAKED func_button(0 .5 .8) ?
When a button is touched, it moves some distance in the direction of it's angle, triggers all of it's targets, waits some time, then returns to it's original position where it can be triggered again. When a button is touched, it moves some distance in the direction of it's angle, triggers all of it's targets, waits some time, then returns to it's original position where it can be triggered again.
@ -77,7 +73,7 @@ When a button is touched, it moves some distance in the direction of it's angle,
3) in-out 3) in-out
*/ */
void() func_button = { void() func_button = {
local float gtemp, ftemp; float gtemp, ftemp;
if(self.sounds == 0) { if(self.sounds == 0) {
precache_sound("buttons/airbut1.wav"); precache_sound("buttons/airbut1.wav");

View File

@ -1,16 +1,13 @@
float modelindex_eyes, modelindex_player; // client.qc: player-adjacent functions
/* /*
============================================================================= =============================================================================
LEVEL CHANGING / INTERMISSION LEVEL CHANGING / INTERMISSION
============================================================================= =============================================================================
*/ */
float intermission_running;
float intermission_exittime;
/*QUAKED info_intermission(1 0.5 0.5) (-16 -16 -16) (16 16 16) /*QUAKED info_intermission(1 0.5 0.5) (-16 -16 -16) (16 16 16)
This is the camera point for the intermission. This is the camera point for the intermission.
Use mangle instead of angle, so you can set pitch or roll as well as yaw. 'pitch roll yaw' Use mangle instead of angle, so you can set pitch or roll as well as yaw. 'pitch roll yaw'
@ -87,8 +84,8 @@ Returns the entity to view from
============ ============
*/ */
entity() FindIntermission = { entity() FindIntermission = {
local entity spot; entity spot;
local float cyc; float cyc;
// look for info_intermission first // look for info_intermission first
spot = find(world, classname, "info_intermission"); spot = find(world, classname, "info_intermission");
@ -120,8 +117,6 @@ entity() FindIntermission = {
objerror("FindIntermission: no spot"); objerror("FindIntermission: no spot");
}; };
string nextmap;
void() GotoNextMap = { void() GotoNextMap = {
if(cvar("samelevel")) { // if samelevel is set, stay on same level if(cvar("samelevel")) { // if samelevel is set, stay on same level
changelevel(mapname); changelevel(mapname);
@ -130,7 +125,6 @@ void() GotoNextMap = {
} }
}; };
void() ExitIntermission = { void() ExitIntermission = {
// skip any text in deathmatch // skip any text in deathmatch
if(deathmatch) { if(deathmatch) {
@ -218,7 +212,7 @@ void() IntermissionThink = {
}; };
void() execute_changelevel = { void() execute_changelevel = {
local entity pos; entity pos;
intermission_running = 1; intermission_running = 1;
@ -252,9 +246,8 @@ void() execute_changelevel = {
WriteByte(MSG_ALL, SVC_INTERMISSION); WriteByte(MSG_ALL, SVC_INTERMISSION);
}; };
void() changelevel_touch = { void() changelevel_touch = {
local entity pos; entity pos;
if(other.classname != "player") { if(other.classname != "player") {
return; return;
@ -300,7 +293,6 @@ void() trigger_changelevel = {
self.touch = changelevel_touch; self.touch = changelevel_touch;
}; };
/* /*
============================================================================= =============================================================================
@ -331,7 +323,6 @@ void() respawn = {
} }
}; };
/* /*
============ ============
ClientKill ClientKill
@ -360,9 +351,9 @@ Returns the entity to spawn at
============ ============
*/ */
entity() SelectSpawnPoint = { entity() SelectSpawnPoint = {
local entity spot; entity spot;
local entity thing; entity thing;
local float pcount; float pcount;
// testinfo_player_start is only found in regioned levels // testinfo_player_start is only found in regioned levels
spot = find(world, classname, "testplayerstart"); spot = find(world, classname, "testplayerstart");
@ -427,7 +418,7 @@ called each time a player is spawned
============ ============
*/ */
void() PutClientInServer = { void() PutClientInServer = {
local entity spot; entity spot;
spot = SelectSpawnPoint(); spot = SelectSpawnPoint();
@ -487,7 +478,6 @@ void() PutClientInServer = {
spawn_tdeath(self.origin, self); spawn_tdeath(self.origin, self);
}; };
/* /*
============================================================================= =============================================================================
@ -496,21 +486,18 @@ void() PutClientInServer = {
============================================================================= =============================================================================
*/ */
/*QUAKED info_player_start(1 0 0) (-16 -16 -24) (16 16 24) /*QUAKED info_player_start(1 0 0) (-16 -16 -24) (16 16 24)
The normal starting point for a level. The normal starting point for a level.
*/ */
void() info_player_start = { void() info_player_start = {
}; };
/*QUAKED info_player_start2(1 0 0) (-16 -16 -24) (16 16 24) /*QUAKED info_player_start2(1 0 0) (-16 -16 -24) (16 16 24)
Only used on start map for the return point from an episode. Only used on start map for the return point from an episode.
*/ */
void() info_player_start2 = { void() info_player_start2 = {
}; };
/* /*
saved out by quaked in region mode saved out by quaked in region mode
*/ */
@ -542,7 +529,7 @@ go to the next level for deathmatch
only called if a time or frag limit has expired only called if a time or frag limit has expired
*/ */
void() NextLevel = { void() NextLevel = {
local entity o; entity o;
if(mapname == "start") { if(mapname == "start") {
if(!cvar("registered")) { if(!cvar("registered")) {
@ -590,8 +577,8 @@ Exit deathmatch games upon conditions
============ ============
*/ */
void() CheckRules = { void() CheckRules = {
local float timelimit; float timelimit;
local float fraglimit; float fraglimit;
if(gameover) { // someone else quit the game already if(gameover) { // someone else quit the game already
return; return;
@ -614,8 +601,8 @@ void() CheckRules = {
//============================================================================ //============================================================================
void() PlayerDeathThink = { void() PlayerDeathThink = {
local entity old_self; entity old_self;
local float forward; float forward;
if((self.flags & FL_ONGROUND)) { if((self.flags & FL_ONGROUND)) {
forward = vlen(self.velocity); forward = vlen(self.velocity);
@ -647,9 +634,8 @@ void() PlayerDeathThink = {
respawn(); respawn();
}; };
void() PlayerJump = { void() PlayerJump = {
local vector start, end; vector start, end;
if(self.flags & FL_WATERJUMP) { if(self.flags & FL_WATERJUMP) {
return; return;
@ -693,15 +679,12 @@ void() PlayerJump = {
self.velocity_z = self.velocity_z + 270; self.velocity_z = self.velocity_z + 270;
}; };
/* /*
=========== ===========
WaterMove WaterMove
============ ============
*/ */
.float dmgtime;
void() WaterMove = { void() WaterMove = {
//dprint(ftos(self.waterlevel)); //dprint(ftos(self.waterlevel));
if(self.movetype == MOVETYPE_NOCLIP) { if(self.movetype == MOVETYPE_NOCLIP) {
@ -779,7 +762,7 @@ void() WaterMove = {
}; };
void() CheckWaterJump = { void() CheckWaterJump = {
local vector start, end; vector start, end;
// check for a jump-out-of-water // check for a jump-out-of-water
makevectors(self.angles); makevectors(self.angles);
@ -806,7 +789,6 @@ void() CheckWaterJump = {
} }
}; };
/* /*
================ ================
PlayerPreThink PlayerPreThink
@ -815,8 +797,8 @@ Called every frame before physics are run
================ ================
*/ */
void() PlayerPreThink = { void() PlayerPreThink = {
local float mspeed, aspeed; float mspeed, aspeed;
local float r; float r;
if(intermission_running) { if(intermission_running) {
IntermissionThink(); // otherwise a button could be missed between IntermissionThink(); // otherwise a button could be missed between
@ -988,7 +970,6 @@ void() CheckPowerups = {
}; };
/* /*
================ ================
PlayerPostThink PlayerPostThink
@ -997,8 +978,8 @@ Called every frame after physics are run
================ ================
*/ */
void() PlayerPostThink = { void() PlayerPostThink = {
local float mspeed, aspeed; float mspeed, aspeed;
local float r; float r;
if(self.view_ofs == '0 0 0') { if(self.view_ofs == '0 0 0') {
return; // intermission or finale return; // intermission or finale
@ -1032,7 +1013,6 @@ void() PlayerPostThink = {
CheckPowerups(); CheckPowerups();
}; };
/* /*
=========== ===========
ClientConnect ClientConnect
@ -1050,7 +1030,6 @@ void() ClientConnect = {
} }
}; };
/* /*
=========== ===========
ClientDisconnect ClientDisconnect
@ -1082,8 +1061,8 @@ called when a player dies
============ ============
*/ */
void(entity targ, entity attacker) ClientObituary = { void(entity targ, entity attacker) ClientObituary = {
local float rnum; float rnum;
local string deathstring, deathstring2; string deathstring, deathstring2;
rnum = random(); rnum = random();
if(targ.classname == "player") { if(targ.classname == "player") {

View File

@ -1,4 +1,4 @@
//============================================================================ // combat.qc: entity-entity damage functions
float(entity targ, entity attacker) SameTeam = { float(entity targ, entity attacker) SameTeam = {
return targ.team > 0 && targ.team == attacker.team; return targ.team > 0 && targ.team == attacker.team;
@ -53,14 +53,13 @@ float(entity targ, entity inflictor) CanDamage = {
return FALSE; return FALSE;
}; };
/* /*
============ ============
Killed Killed
============ ============
*/ */
void(entity targ, entity attacker) Killed = { void(entity targ, entity attacker) Killed = {
local entity oself; entity oself;
oself = self; oself = self;
self = targ; self = targ;
@ -95,7 +94,6 @@ void(entity targ, entity attacker) Killed = {
self = oself; self = oself;
}; };
/* /*
============ ============
T_Damage T_Damage
@ -105,10 +103,10 @@ This should be the only function that ever reduces health.
============ ============
*/ */
void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = { void(entity targ, entity inflictor, entity attacker, float damage) T_Damage = {
local vector dir; vector dir;
local entity oldself; entity oldself;
local float save; float save;
local float take; float take;
// team play damage avoidance // team play damage avoidance
if(teamplay == 1 && SameTeam(targ, attacker)) { if(teamplay == 1 && SameTeam(targ, attacker)) {
@ -214,9 +212,9 @@ T_RadiusDamage
============ ============
*/ */
void(entity inflictor, entity attacker, float damage, entity ignore) T_RadiusDamage = { void(entity inflictor, entity attacker, float damage, entity ignore) T_RadiusDamage = {
local float points; float points;
local entity head; entity head;
local vector org; vector org;
head = findradius(inflictor.origin, damage + 40); head = findradius(inflictor.origin, damage + 40);
@ -254,8 +252,8 @@ T_BeamDamage
============ ============
*/ */
void(entity attacker, float damage) T_BeamDamage = { void(entity attacker, float damage) T_BeamDamage = {
local float points; float points;
local entity head; entity head;
head = findradius(attacker.origin, damage + 40); head = findradius(attacker.origin, damage + 40);

View File

@ -1,3 +1,5 @@
// defs.qc: global definitions
// system globals ------------------------------------------------------------| // system globals ------------------------------------------------------------|
#pragma noref 1 #pragma noref 1
entity self; entity self;
@ -75,7 +77,7 @@ void end_sys_globals; // flag for structure dumping
.float modelindex; // model index in the precached list .float modelindex; // model index in the precached list
.vector absmin, absmax; // origin + mins / maxs .vector absmin, absmax; // origin + mins / maxs
.float ltime; // local time for entity .float ltime; // time for entity
.float movetype; .float movetype;
.float solid; .float solid;
@ -133,6 +135,7 @@ void end_sys_globals; // flag for structure dumping
.string netname; .string netname;
// Will be world if not currently angry at anyone.
.entity enemy; .entity enemy;
.float flags; .float flags;
@ -150,7 +153,11 @@ void end_sys_globals; // flag for structure dumping
.float waterlevel; // 0 = not in, 1 = feet, 2 = wast, 3 = eyes .float waterlevel; // 0 = not in, 1 = feet, 2 = wast, 3 = eyes
.float watertype; // a contents value .float watertype; // a contents value
// A yaw angle of the intended direction, which will be turned towards at up
// to 45 deg / state. If the enemy is in view and hunt_time is not active,
// this will be the exact line towards the enemy.
.float ideal_yaw; .float ideal_yaw;
.float yaw_speed; .float yaw_speed;
.entity aiment; .entity aiment;
@ -207,7 +214,7 @@ entity() checkclient = #17; // returns a client to look for
entity(entity start, .string fld, string match) find = #18; entity(entity start, .string fld, string match) find = #18;
string(string s) precache_sound = #19; string(string s) precache_sound = #19;
string(string s) precache_model = #20; string(string s) precache_model = #20;
void(entity client, string s)stuffcmd = #21; void(entity client, string s) stuffcmd = #21;
entity(vector org, float rad) findradius = #22; entity(vector org, float rad) findradius = #22;
void(string s) bprint = #23; void(string s) bprint = #23;
void(entity client, string s) sprint = #24; void(entity client, string s) sprint = #24;
@ -229,7 +236,7 @@ float(vector v) pointcontents = #41; // returns a CONTENT_*
float(float f) fabs = #43; float(float f) fabs = #43;
vector(entity e, float speed) aim = #44; // returns the shooting vector vector(entity e, float speed) aim = #44; // returns the shooting vector
float(string s) cvar = #45; // return cvar.value float(string s) cvar = #45; // return cvar.value
void(string s) localcmd = #46; // put string into local que void(string s) localcmd = #46; // put string into que
entity(entity e) nextent = #47; // for looping through all ents entity(entity e) nextent = #47; // for looping through all ents
// start a particle effect // start a particle effect
void(vector o, vector d, float color, float count) particle = #48; void(vector o, vector d, float color, float count) particle = #48;
@ -478,6 +485,33 @@ float framecount;
float skill; float skill;
float enemy_vis, enemy_infront, enemy_range;
float enemy_yaw;
entity lastspawn;
entity multi_ent;
float multi_damage;
entity shub;
entity le1, le2;
float lightning_end;
float hknight_type;
entity bodyque_head;
float modelindex_eyes, modelindex_player;
float intermission_running;
float intermission_exittime;
string nextmap;
entity sight_entity;
float sight_entity_time;
// fields --------------------------------------------------------------------| // fields --------------------------------------------------------------------|
// world fields // world fields
@ -551,8 +585,12 @@ float skill;
.entity trigger_field; // door's trigger entity .entity trigger_field; // door's trigger entity
.string noise4; .string noise4;
// monsters // A monster will leave its stand state and head towards it's .movetarget when
// time > .pausetime.
.float pausetime; .float pausetime;
// The next path spot to walk toward. If .enemy, ignore .movetarget.
// When an enemy is killed, the monster will try to return to it's path.
.entity movetarget; .entity movetarget;
// doors // doors
@ -580,52 +618,79 @@ float skill;
.float distance; .float distance;
.float volume; .float volume;
.float hit_z;
.float dmgtime;
.float inpain;
.float healamount, healtype;
// functions -----------------------------------------------------------------| // functions -----------------------------------------------------------------|
// subs.qc // subs.qc
void(float normal) SUB_AttackFinished;
void(vector tdest, float tspeed, void() func) SUB_CalcMove; void(vector tdest, float tspeed, void() func) SUB_CalcMove;
void(entity ent, vector tdest, float tspeed, void() func) SUB_CalcMoveEnt; void(entity ent, vector tdest, float tspeed, void() func) SUB_CalcMoveEnt;
void(vector destangle, float tspeed, void() func) SUB_CalcAngleMove; void(vector destangle, float tspeed, void() func) SUB_CalcAngleMove;
void() SUB_CalcMoveDone; void() SUB_CalcMoveDone;
void() SUB_CalcAngleMoveDone; void() SUB_CalcAngleMoveDone;
void(void() thinkst) SUB_CheckRefire;
void() SUB_Null; void() SUB_Null;
void() SUB_UseTargets; void() SUB_UseTargets;
void() SUB_Remove; void() SUB_Remove;
// combat.qc // combat.qc
void(entity targ, entity inflictor, entity attacker, float damage) T_Damage;
float(entity e, float healamount, float ignore) T_Heal; // health function float(entity e, float healamount, float ignore) T_Heal; // health function
float(entity targ, entity inflictor) CanDamage; float(entity targ, entity inflictor) CanDamage;
void() T_MissileTouch;
void(entity bomb, entity attacker, float rad, entity ignore) T_RadiusDamage;
void(entity targ, entity inflictor, entity attacker, float damage) T_Damage;
void(entity targ, entity inflictor, entity attacker, float damage) T_Damage;
// weapons.qc
void() W_FireAxe;
void() W_FireShotgun;
void() W_FireSuperShotgun;
void() W_FireRocket;
void() W_FireLightning;
void() W_FireGrenade;
void(float ox) W_FireSpikes;
void() W_FireSuperSpikes;
float() W_BestWeapon;
void() W_SetCurrentAmmo;
void() W_WeaponFrame;
void() army_fire;
float() DemonCheckAttack; float() DemonCheckAttack;
void() Demon_JumpTouch;
void(float side) Demon_Melee;
float() DogCheckAttack; float() DogCheckAttack;
float() W_BestWeapon; void() dog_leap1;
float() WizardCheckAttack; void() dog_run1;
void() ShalHome;
void() ShalMissile;
void() ShalMissileTouch;
float() crandom;
float(entity targ) infront; float(entity targ) infront;
float(entity targ) range; float(entity targ) range;
float(entity targ) visible; float(entity targ) visible;
float(entity targ, entity attacker) SameTeam; float(entity targ, entity attacker) SameTeam;
float(float v) anglemod; float(float v) anglemod;
void() DecodeLevelParms; void() DecodeLevelParms;
void() Demon_JumpTouch; void(entity ent) CopyToBodyQue;
void() InitBodyQue; void() InitBodyQue;
void() PlayerDie;
void() ShalHome;
void() ShalMissile;
void() ShalMissileTouch;
void() SuperDamageSound; void() SuperDamageSound;
void() T_MissileTouch;
void() W_SetCurrentAmmo;
void() W_WeaponFrame;
void() ai_face; void() ai_face;
void() armor_touch; void() armor_touch;
void() army_fire;
void() bubble_bob; void() bubble_bob;
void() bubble_remove; void() bubble_remove;
void() button_return; void() button_return;
void() button_wait; void() button_wait;
void() dog_leap1;
void() dog_run1;
void() door_go_down; void() door_go_down;
void() door_go_up; void() door_go_up;
void() fd_secret_done; void() fd_secret_done;
@ -641,29 +706,50 @@ void() finale_3;
void() finale_4; void() finale_4;
void() fire_fly; void() fire_fly;
void() fire_touch; void() fire_touch;
void() func_train_find;
void() health_touch; void() health_touch;
void() hk_idle_sound;
void() hknight_char_a1;
void() hknight_run1;
void() info_player_start;
void() item_megahealth_rot; void() item_megahealth_rot;
void() knight_atk1;
void() knight_bow1;
void() knight_bow6;
void() knight_runatk1;
void() knight_walk1;
void() make_bubbles; void() make_bubbles;
void() monster_death_use; void() monster_death_use;
void() movetarget_f; void() movetarget_f;
void() powerup_touch;
void() set_suicide_frame;
void(vector org, vector dir) launch_spike;
void() spike_touch;
void() superspike_touch;
void() swimmonster_start;
void() t_movetarget;
void() train_next;
void(entity targ, entity attacker) ClientObituary;
void(float num_bubbles) DeathBubbles;
void(vector dest) ChooseTurn;
void(vector org, vector vec) LaunchLaser;
void(vector org, vector vel, float damage) SpawnBlood;
void() BecomeExplosion;
void() hknight_char_a1;
void() hknight_run1;
void() ogre_smash1; void() ogre_smash1;
void() ogre_swing1; void() ogre_swing1;
void() plat_center_touch; void() plat_center_touch;
void() plat_crush; void() plat_crush;
void() plat_go_down; void() plat_go_down;
void() plat_go_up; void() plat_go_up;
void() plat_outside_touch; void() plat_outside_touch;
void() plat_trigger_use; void() plat_trigger_use;
void() knight_atk1;
void() knight_bow1;
void() knight_bow6;
void() knight_runatk1;
void() knight_walk1;
void() PlayerDie;
void() player_axe1; void() player_axe1;
void() player_axeb1; void() player_axeb1;
void() player_axec1; void() player_axec1;
@ -682,32 +768,26 @@ void() player_run;
void() player_run; void() player_run;
void() player_shot1; void() player_shot1;
void() player_stand1; void() player_stand1;
void() powerup_touch;
void() set_suicide_frame;
void() shalrath_pain;
void() sham_smash1; void() sham_smash1;
void() sham_swingl1; void() sham_swingl1;
void() sham_swingr1; void() sham_swingr1;
void() sham_swingr1; void() sham_swingr1;
void() spike_touch;
void() superspike_touch;
void() swimmonster_start;
void() t_movetarget;
void() tbaby_jump1; void() tbaby_jump1;
void() tbaby_jump5; void() tbaby_jump5;
void() train_next;
float() WizardCheckAttack;
void() wiz_run1; void() wiz_run1;
void() wiz_side1; void() wiz_side1;
void(entity bomb, entity attacker, float rad, entity ignore) T_RadiusDamage;
void(entity targ, entity attacker) ClientObituary;
void(entity targ, entity inflictor, entity attacker, float damage) T_Damage;
void(float num_bubbles) DeathBubbles;
void(float side) Demon_Melee;
void(vector dest) ChooseTurn;
void(vector org) spawn_tfog; void(vector org) spawn_tfog;
void(vector org, entity death_owner) spawn_tdeath; void(vector org, entity death_owner) spawn_tdeath;
void(vector org, vector vec) LaunchLaser;
void(vector org, vector vel, float damage) SpawnBlood; void() info_player_start;
void() func_train_find;
void(vector p) boss_missile; void(vector p) boss_missile;
// EOF // EOF

View File

@ -1,10 +1,4 @@
/* // demon.qc: Fiend
==============================================================================
DEMON
==============================================================================
*/
$cd id1 / models / demon3 $cd id1 / models / demon3
$scale 0.8 $scale 0.8
@ -98,7 +92,6 @@ void() demon1_jump10 = [ $leap10, demon1_jump1 ] {
void() demon1_jump11 = [ $leap11, demon1_jump12 ] {}; void() demon1_jump11 = [ $leap11, demon1_jump12 ] {};
void() demon1_jump12 = [ $leap12, demon1_run1 ] {}; void() demon1_jump12 = [ $leap12, demon1_run1 ] {};
void() demon1_atta1 = [ $attacka1, demon1_atta2 ] {ai_charge(4);}; void() demon1_atta1 = [ $attacka1, demon1_atta2 ] {ai_charge(4);};
void() demon1_atta2 = [ $attacka2, demon1_atta3 ] {ai_charge(0);}; void() demon1_atta2 = [ $attacka2, demon1_atta3 ] {ai_charge(0);};
void() demon1_atta3 = [ $attacka3, demon1_atta4 ] {ai_charge(0);}; void() demon1_atta3 = [ $attacka3, demon1_atta4 ] {ai_charge(0);};
@ -169,12 +162,10 @@ void() demon_die = {
demon1_die1(); demon1_die1();
}; };
void() Demon_MeleeAttack = { void() Demon_MeleeAttack = {
demon1_atta1(); demon1_atta1();
}; };
/*QUAKED monster_demon1(1 0 0) (-32 -32 -24) (32 32 64) Ambush /*QUAKED monster_demon1(1 0 0) (-32 -32 -24) (32 32 64) Ambush
*/ */
@ -212,7 +203,6 @@ void() monster_demon1 = {
walkmonster_start(); walkmonster_start();
}; };
/* /*
============================================================================== ==============================================================================
@ -244,8 +234,8 @@ CheckDemonJump
============== ==============
*/ */
float() CheckDemonJump = { float() CheckDemonJump = {
local vector dist; vector dist;
local float d; float d;
if(self.origin_z + self.mins_z > self.enemy.origin_z + self.enemy.mins_z if(self.origin_z + self.mins_z > self.enemy.origin_z + self.enemy.mins_z
+ 0.75 * self.enemy.size_z) { + 0.75 * self.enemy.size_z) {
@ -276,7 +266,7 @@ float() CheckDemonJump = {
}; };
float() DemonCheckAttack = { float() DemonCheckAttack = {
local vector vec; vector vec;
// if close enough for slashing, go for it // if close enough for slashing, go for it
if(CheckDemonMelee()) { if(CheckDemonMelee()) {
@ -293,12 +283,11 @@ float() DemonCheckAttack = {
return FALSE; return FALSE;
}; };
//=========================================================================== //===========================================================================
void(float side) Demon_Melee = { void(float side) Demon_Melee = {
local float ldmg; float ldmg;
local vector delta; vector delta;
ai_face(); ai_face();
walkmove(self.ideal_yaw, 12); // allow a little closing walkmove(self.ideal_yaw, 12); // allow a little closing
@ -320,9 +309,8 @@ void(float side) Demon_Melee = {
SpawnMeatSpray(self.origin + v_forward * 16, side * v_right); SpawnMeatSpray(self.origin + v_forward * 16, side * v_right);
}; };
void() Demon_JumpTouch = { void() Demon_JumpTouch = {
local float ldmg; float ldmg;
if(self.health <= 0) { if(self.health <= 0) {
return; return;

View File

@ -1,10 +1,5 @@
/* // dog.qc: Rottweiler
==============================================================================
DOG
==============================================================================
*/
$cd id1 / models / dog $cd id1 / models / dog
$origin 0 0 24 $origin 0 0 24
$base base $base base
@ -30,7 +25,6 @@ $frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9
$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 $frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8
/* /*
================ ================
dog_bite dog_bite
@ -38,8 +32,8 @@ dog_bite
================ ================
*/ */
void() dog_bite = { void() dog_bite = {
local vector delta; vector delta;
local float ldmg; float ldmg;
if(!self.enemy) { if(!self.enemy) {
return; return;
@ -62,7 +56,7 @@ void() dog_bite = {
}; };
void() Dog_JumpTouch = { void() Dog_JumpTouch = {
local float ldmg; float ldmg;
if(self.health <= 0) { if(self.health <= 0) {
return; return;
@ -95,7 +89,6 @@ void() Dog_JumpTouch = {
self.nextthink = time + 0.1; self.nextthink = time + 0.1;
}; };
void() dog_stand1 = [ $stand1, dog_stand2 ] {ai_stand();}; void() dog_stand1 = [ $stand1, dog_stand2 ] {ai_stand();};
void() dog_stand2 = [ $stand2, dog_stand3 ] {ai_stand();}; void() dog_stand2 = [ $stand2, dog_stand3 ] {ai_stand();};
void() dog_stand3 = [ $stand3, dog_stand4 ] {ai_stand();}; void() dog_stand3 = [ $stand3, dog_stand4 ] {ai_stand();};
@ -225,7 +218,6 @@ void() dog_dieb7 = [ $deathb7, dog_dieb8 ] {};
void() dog_dieb8 = [ $deathb8, dog_dieb9 ] {}; void() dog_dieb8 = [ $deathb8, dog_dieb9 ] {};
void() dog_dieb9 = [ $deathb9, dog_dieb9 ] {}; void() dog_dieb9 = [ $deathb9, dog_dieb9 ] {};
void() dog_die = { void() dog_die = {
// check for gib // check for gib
if(self.health < -35) { if(self.health < -35) {
@ -273,8 +265,8 @@ CheckDogJump
============== ==============
*/ */
float() CheckDogJump = { float() CheckDogJump = {
local vector dist; vector dist;
local float d; float d;
if(self.origin_z + self.mins_z > self.enemy.origin_z + self.enemy.mins_z if(self.origin_z + self.mins_z > self.enemy.origin_z + self.enemy.mins_z
+ 0.75 * self.enemy.size_z) { + 0.75 * self.enemy.size_z) {
@ -303,7 +295,7 @@ float() CheckDogJump = {
}; };
float() DogCheckAttack = { float() DogCheckAttack = {
local vector vec; vector vec;
// if close enough for slashing, go for it // if close enough for slashing, go for it
if(CheckDogMelee()) { if(CheckDogMelee()) {
@ -319,7 +311,6 @@ float() DogCheckAttack = {
return FALSE; return FALSE;
}; };
//=========================================================================== //===========================================================================
/*QUAKED monster_dog(1 0 0) (-32 -32 -24) (32 32 40) Ambush /*QUAKED monster_dog(1 0 0) (-32 -32 -24) (32 32 40) Ambush

View File

@ -1,3 +1,5 @@
// doors.qc: player-triggered moving brush entities
enum { enum {
DOOR_START_OPEN = 1, DOOR_START_OPEN = 1,
DOOR_DONT_LINK = 4, DOOR_DONT_LINK = 4,
@ -41,7 +43,6 @@ void() door_blocked = {
} }
}; };
void() door_hit_top = { void() door_hit_top = {
sound(self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); sound(self, CHAN_VOICE, self.noise1, 1, ATTN_NORM);
self.state = STATE_TOP; self.state = STATE_TOP;
@ -86,7 +87,6 @@ void() door_go_up = {
SUB_UseTargets(); SUB_UseTargets();
}; };
/* /*
============================================================================= =============================================================================
@ -96,8 +96,8 @@ ACTIVATION FUNCTIONS
*/ */
void() door_fire = { void() door_fire = {
local entity oself; entity oself;
local entity starte; entity starte;
if(self.owner != self) { if(self.owner != self) {
objerror("door_fire: self.owner != self"); objerror("door_fire: self.owner != self");
@ -133,9 +133,8 @@ void() door_fire = {
self = oself; self = oself;
}; };
void() door_use = { void() door_use = {
local entity oself; entity oself;
self.message = ""; // door message are for touch only self.message = ""; // door message are for touch only
self.owner.message = ""; self.owner.message = "";
@ -146,7 +145,6 @@ void() door_use = {
self = oself; self = oself;
}; };
void() door_trigger_touch = { void() door_trigger_touch = {
if(other.health <= 0) { if(other.health <= 0) {
return; return;
@ -163,9 +161,8 @@ void() door_trigger_touch = {
door_use(); door_use();
}; };
void() door_killed = { void() door_killed = {
local entity oself; entity oself;
oself = self; oself = self;
self = self.owner; self = self.owner;
@ -175,7 +172,6 @@ void() door_killed = {
self = oself; self = oself;
}; };
/* /*
================ ================
door_touch door_touch
@ -247,10 +243,9 @@ SPAWNING FUNCTIONS
============================================================================= =============================================================================
*/ */
entity(vector fmins, vector fmaxs) spawn_field = { entity(vector fmins, vector fmaxs) spawn_field = {
local entity trigger; entity trigger;
local vector t1, t2; vector t1, t2;
trigger = spawn(); trigger = spawn();
trigger.movetype = MOVETYPE_NONE; trigger.movetype = MOVETYPE_NONE;
@ -264,7 +259,6 @@ entity(vector fmins, vector fmaxs) spawn_field = {
return(trigger); return(trigger);
}; };
float(entity e1, entity e2) EntitiesTouching = { float(entity e1, entity e2) EntitiesTouching = {
if(e1.mins_x > e2.maxs_x) { if(e1.mins_x > e2.maxs_x) {
return FALSE; return FALSE;
@ -287,17 +281,15 @@ float(entity e1, entity e2) EntitiesTouching = {
return TRUE; return TRUE;
}; };
/* /*
============= =============
LinkDoors LinkDoors
============= =============
*/ */
void() LinkDoors = { void() LinkDoors = {
local entity t, starte; entity t, starte;
local vector cmins, cmaxs; vector cmins, cmaxs;
if(self.enemy) { if(self.enemy) {
return; // already linked by another door return; // already linked by another door
@ -371,7 +363,6 @@ void() LinkDoors = {
}; };
/*QUAKED func_door(0 .5 .8) ? START_OPEN x DOOR_DONT_LINK GOLD_KEY SILVER_KEY TOGGLE /*QUAKED func_door(0 .5 .8) ? START_OPEN x DOOR_DONT_LINK GOLD_KEY SILVER_KEY TOGGLE
if two doors touch, they are assumed to be connected and operate as a unit. if two doors touch, they are assumed to be connected and operate as a unit.
@ -450,7 +441,6 @@ void() func_door =
self.noise2 = "doors/ddoor1.wav"; self.noise2 = "doors/ddoor1.wav";
} }
SetMovedir(); SetMovedir();
self.max_health = self.health; self.max_health = self.health;
@ -529,9 +519,8 @@ enum {
SECRET_YES_SHOOT = 16, // shootable even if targeted SECRET_YES_SHOOT = 16, // shootable even if targeted
}; };
void() fd_secret_use = { void() fd_secret_use = {
local float temp; float temp;
self.health = 10000; self.health = 10000;
@ -661,7 +650,6 @@ void() secret_touch = {
} }
}; };
/*QUAKED func_door_secret(0 .5 .8) ? open_once 1st_left 1st_down no_shoot always_shoot /*QUAKED func_door_secret(0 .5 .8) ? open_once 1st_left 1st_down no_shoot always_shoot
Basic secret door. Slides back, then to the side. Angle determines direction. Basic secret door. Slides back, then to the side. Angle determines direction.
wait = # of seconds before coming back wait = # of seconds before coming back

View File

@ -1,10 +1,4 @@
/* // enforcer.qc: Enforcer
==============================================================================
SOLDIER / PLAYER
==============================================================================
*/
$cd id1 / models / enforcer $cd id1 / models / enforcer
$origin 0 - 6 24 $origin 0 - 6 24
@ -37,9 +31,8 @@ $frame paind1 paind2 paind3 paind4 paind5 paind6 paind7 paind8
$frame paind9 paind10 paind11 paind12 paind13 paind14 paind15 paind16 $frame paind9 paind10 paind11 paind12 paind13 paind14 paind15 paind16
$frame paind17 paind18 paind19 $frame paind17 paind18 paind19
void() Laser_Touch = { void() Laser_Touch = {
local vector org; vector org;
if(other == self.owner) { if(other == self.owner) {
return; // don't explode on owner return; // don't explode on owner
@ -68,7 +61,7 @@ void() Laser_Touch = {
}; };
void(vector org, vector vec) LaunchLaser = { void(vector org, vector vec) LaunchLaser = {
local vector vec; vector vec;
if(self.classname == "monster_enforcer") { if(self.classname == "monster_enforcer") {
sound(self, CHAN_WEAPON, "enforcer/enfire.wav", 1, ATTN_NORM); sound(self, CHAN_WEAPON, "enforcer/enfire.wav", 1, ATTN_NORM);
@ -96,9 +89,8 @@ void(vector org, vector vec) LaunchLaser = {
}; };
void() enforcer_fire = { void() enforcer_fire = {
local vector org; vector org;
self.effects = self.effects | EF_MUZZLEFLASH; self.effects = self.effects | EF_MUZZLEFLASH;
makevectors(self.angles); makevectors(self.angles);
@ -168,8 +160,8 @@ void() enf_atk11 = [ $attack7, enf_atk12 ] {ai_face();};
void() enf_atk12 = [ $attack8, enf_atk13 ] {ai_face();}; void() enf_atk12 = [ $attack8, enf_atk13 ] {ai_face();};
void() enf_atk13 = [ $attack9, enf_atk14 ] {ai_face();}; void() enf_atk13 = [ $attack9, enf_atk14 ] {ai_face();};
void() enf_atk14 = [ $attack10, enf_run1 ] {ai_face(); void() enf_atk14 = [ $attack10, enf_run1 ] {ai_face();
SUB_CheckRefire(enf_atk1); SUB_CheckRefire(enf_atk1);
}; };
void() enf_paina1 = [ $paina1, enf_paina2 ] {}; void() enf_paina1 = [ $paina1, enf_paina2 ] {};
void() enf_paina2 = [ $paina2, enf_paina3 ] {}; void() enf_paina2 = [ $paina2, enf_paina3 ] {};
@ -212,14 +204,13 @@ void() enf_paind18 = [ $paind18, enf_paind19 ] {};
void() enf_paind19 = [ $paind19, enf_run1 ] {}; void() enf_paind19 = [ $paind19, enf_run1 ] {};
void(entity attacker, float damage) enf_pain = { void(entity attacker, float damage) enf_pain = {
local float r; float r;
r = random(); r = random();
if(self.pain_finished > time) { if(self.pain_finished > time) {
return; return;
} }
if(r < 0.5) { if(r < 0.5) {
sound(self, CHAN_VOICE, "enforcer/pain1.wav", 1, ATTN_NORM); sound(self, CHAN_VOICE, "enforcer/pain1.wav", 1, ATTN_NORM);
} else { } else {
@ -245,7 +236,6 @@ void(entity attacker, float damage) enf_pain = {
void() enf_die1 = [ $death1, enf_die2 ] {}; void() enf_die1 = [ $death1, enf_die2 ] {};
void() enf_die2 = [ $death2, enf_die3 ] {}; void() enf_die2 = [ $death2, enf_die3 ] {};
void() enf_die3 = [ $death3, enf_die4 ] void() enf_die3 = [ $death3, enf_die4 ]
@ -277,7 +267,6 @@ void() enf_fdie9 = [ $fdeath9, enf_fdie10 ] {};
void() enf_fdie10 = [ $fdeath10, enf_fdie11 ] {}; void() enf_fdie10 = [ $fdeath10, enf_fdie11 ] {};
void() enf_fdie11 = [ $fdeath11, enf_fdie11 ] {}; void() enf_fdie11 = [ $fdeath11, enf_fdie11 ] {};
void() enf_die = { void() enf_die = {
// check for gib // check for gib
if(self.health < -35) { if(self.health < -35) {
@ -298,7 +287,6 @@ void() enf_die = {
} }
}; };
/*QUAKED monster_enforcer(1 0 0) (-16 -16 -24) (16 16 40) Ambush /*QUAKED monster_enforcer(1 0 0) (-16 -16 -24) (16 16 40) Ambush
*/ */

View File

@ -1,3 +1,4 @@
// fight.qc: monster attack functions
/* /*
@ -8,12 +9,8 @@ When it decides it can't attack, it goes into hunt mode.
*/ */
float enemy_vis, enemy_infront, enemy_range;
float enemy_yaw;
void() knight_attack = { void() knight_attack = {
local float len; float len;
// decide if now is a good swing time // decide if now is a good swing time
len = vlen(self.enemy.origin + self.enemy.view_ofs - (self.origin + self.view_ofs)); len = vlen(self.enemy.origin + self.enemy.view_ofs - (self.origin + self.view_ofs));
@ -36,9 +33,9 @@ Returns FALSE if movement should continue
============ ============
*/ */
float() CheckAttack = { float() CheckAttack = {
local vector spot1, spot2; vector spot1, spot2;
local entity targ; entity targ;
local float chance; float chance;
targ = self.enemy; targ = self.enemy;
@ -109,7 +106,6 @@ float() CheckAttack = {
return FALSE; return FALSE;
}; };
/* /*
============= =============
ai_face ai_face
@ -135,8 +131,8 @@ void(float d) ai_charge = {
}; };
void() ai_charge_side = { void() ai_charge_side = {
local vector dtemp; vector dtemp;
local float heading; float heading;
// aim to the left of the enemy for a flyby // aim to the left of the enemy for a flyby
@ -150,7 +146,6 @@ void() ai_charge_side = {
walkmove(heading, 20); walkmove(heading, 20);
}; };
/* /*
============= =============
ai_melee ai_melee
@ -158,8 +153,8 @@ ai_melee
============= =============
*/ */
void() ai_melee = { void() ai_melee = {
local vector delta; vector delta;
local float ldmg; float ldmg;
if(!self.enemy) { if(!self.enemy) {
return; // removed before stroke return; // removed before stroke
@ -175,10 +170,9 @@ void() ai_melee = {
T_Damage(self.enemy, self, self, ldmg); T_Damage(self.enemy, self, self, ldmg);
}; };
void() ai_melee_side = { void() ai_melee_side = {
local vector delta; vector delta;
local float ldmg; float ldmg;
if(!self.enemy) { if(!self.enemy) {
return; // removed before stroke return; // removed before stroke
@ -198,7 +192,6 @@ void() ai_melee_side = {
T_Damage(self.enemy, self, self, ldmg); T_Damage(self.enemy, self, self, ldmg);
}; };
//============================================================================= //=============================================================================
/* /*
@ -210,9 +203,9 @@ Returns FALSE if movement should continue
============ ============
*/ */
float() SoldierCheckAttack = { float() SoldierCheckAttack = {
local vector spot1, spot2; vector spot1, spot2;
local entity targ; entity targ;
local float chance; float chance;
targ = self.enemy; targ = self.enemy;
@ -230,7 +223,6 @@ float() SoldierCheckAttack = {
return FALSE; // don't have a clear shot return FALSE; // don't have a clear shot
} }
// missile attack // missile attack
if(time < self.attack_finished) { if(time < self.attack_finished) {
return FALSE; return FALSE;
@ -272,10 +264,10 @@ Returns FALSE if movement should continue
============ ============
*/ */
float() ShamCheckAttack = { float() ShamCheckAttack = {
local vector spot1, spot2; vector spot1, spot2;
local entity targ; entity targ;
local float chance; float chance;
local float enemy_yaw; float enemy_yaw;
if(enemy_range == RANGE_MELEE) { if(enemy_range == RANGE_MELEE) {
if(CanDamage(self.enemy, self)) { if(CanDamage(self.enemy, self)) {
@ -333,9 +325,9 @@ Returns FALSE if movement should continue
============ ============
*/ */
float() OgreCheckAttack = { float() OgreCheckAttack = {
local vector spot1, spot2; vector spot1, spot2;
local entity targ; entity targ;
local float chance; float chance;
if(enemy_range == RANGE_MELEE) { if(enemy_range == RANGE_MELEE) {
if(CanDamage(self.enemy, self)) { if(CanDamage(self.enemy, self)) {

View File

@ -1,3 +1,5 @@
// fish.qc: Rotfish
$cd id1 / models / fish $cd id1 / models / fish
$origin 0 0 24 $origin 0 0 24
$base base $base base
@ -60,7 +62,7 @@ void() f_run1 = [ $swim1, f_run2 ] {ai_run(12);
if(random() < 0.5) { if(random() < 0.5) {
sound(self, CHAN_VOICE, "fish/idle.wav", 1, ATTN_NORM); sound(self, CHAN_VOICE, "fish/idle.wav", 1, ATTN_NORM);
} }
}; };
void() f_run2 = [ $swim3, f_run3 ] {ai_run(12);}; void() f_run2 = [ $swim3, f_run3 ] {ai_run(12);};
void() f_run3 = [ $swim5, f_run4 ] {ai_run(12);}; void() f_run3 = [ $swim5, f_run4 ] {ai_run(12);};
void() f_run4 = [ $swim7, f_run5 ] {ai_run(12);}; void() f_run4 = [ $swim7, f_run5 ] {ai_run(12);};
@ -71,8 +73,8 @@ void() f_run8 = [ $swim15, f_run9 ] {ai_run(12);};
void() f_run9 = [ $swim17, f_run1 ] {ai_run(12);}; void() f_run9 = [ $swim17, f_run1 ] {ai_run(12);};
void() fish_melee = { void() fish_melee = {
local vector delta; vector delta;
local float ldmg; float ldmg;
if(!self.enemy) { if(!self.enemy) {
return; // removed before stroke return; // removed before stroke
@ -149,7 +151,6 @@ void(entity attacker, float damage) fish_pain = {
}; };
/*QUAKED monster_fish(1 0 0) (-16 -16 -24) (16 16 24) Ambush /*QUAKED monster_fish(1 0 0) (-16 -16 -24) (16 16 24) Ambush
*/ */
void() monster_fish = { void() monster_fish = {

View File

@ -1,10 +1,4 @@
/* // hknight.qc: Death Knight
==============================================================================
KNIGHT
==============================================================================
*/
$cd id1 / models / knight2 $cd id1 / models / knight2
$origin 0 0 24 $origin 0 0 24
@ -51,10 +45,15 @@ $frame w_attack21 w_attack22
$frame magicc1 magicc2 magicc3 magicc4 magicc5 magicc6 magicc7 magicc8 $frame magicc1 magicc2 magicc3 magicc4 magicc5 magicc6 magicc7 magicc8
$frame magicc9 magicc10 magicc11 $frame magicc9 magicc10 magicc11
void() hknight_idle_sound = {
if(random() < 0.2) {
sound(self, CHAN_VOICE, "hknight/idle.wav", 1, ATTN_NORM);
}
};
void(float offset) hknight_shot = { void(float offset) hknight_shot = {
local vector offang; vector offang;
local vector org, vec; vector org, vec;
offang = vectoangles(self.enemy.origin - self.origin); offang = vectoangles(self.enemy.origin - self.origin);
offang_y = offang_y + offset * 6; offang_y = offang_y + offset * 6;
@ -124,7 +123,7 @@ void() hknight_stand9 = [ $stand9, hknight_stand1 ] {ai_stand();};
//=========================================================================== //===========================================================================
void() hknight_walk1 = [ $walk1, hknight_walk2 ] { void() hknight_walk1 = [ $walk1, hknight_walk2 ] {
hk_idle_sound(); hknight_idle_sound();
ai_walk(2); ai_walk(2);
}; };
void() hknight_walk2 = [ $walk2, hknight_walk3 ] {ai_walk(5);}; void() hknight_walk2 = [ $walk2, hknight_walk3 ] {ai_walk(5);};
@ -150,7 +149,7 @@ void() hknight_walk20 = [ $walk20, hknight_walk1 ] {ai_walk(2);};
//=========================================================================== //===========================================================================
void() hknight_run1 = [ $run1, hknight_run2 ] { void() hknight_run1 = [ $run1, hknight_run2 ] {
hk_idle_sound(); hknight_idle_sound();
ai_run(20); ai_run(20);
CheckForCharge(); CheckForCharge();
}; };
@ -217,7 +216,6 @@ void() hknight_die = {
} }
}; };
//============================================================================ //============================================================================
void() hknight_magica1 = [ $magica1, hknight_magica2 ] {ai_face();}; void() hknight_magica1 = [ $magica1, hknight_magica2 ] {ai_face();};
@ -348,12 +346,6 @@ void() hknight_watk22 = [ $w_attack22, hknight_run1 ] {ai_charge(3);};
//============================================================================ //============================================================================
void() hk_idle_sound = {
if(random() < 0.2) {
sound(self, CHAN_VOICE, "hknight/idle.wav", 1, ATTN_NORM);
}
};
void(entity attacker, float damage) hknight_pain = { void(entity attacker, float damage) hknight_pain = {
if(self.pain_finished > time) { if(self.pain_finished > time) {
return; return;
@ -376,8 +368,6 @@ void(entity attacker, float damage) hknight_pain = {
hknight_pain1(); hknight_pain1();
}; };
float hknight_type;
void() hknight_melee = { void() hknight_melee = {
hknight_type = hknight_type + 1; hknight_type = hknight_type + 1;
@ -403,7 +393,6 @@ void() monster_hell_knight = {
precache_model2("progs/k_spike.mdl"); precache_model2("progs/k_spike.mdl");
precache_model2("progs/h_hellkn.mdl"); precache_model2("progs/h_hellkn.mdl");
precache_sound2("hknight/attack1.wav"); precache_sound2("hknight/attack1.wav");
precache_sound2("hknight/death1.wav"); precache_sound2("hknight/death1.wav");
precache_sound2("hknight/pain1.wav"); precache_sound2("hknight/pain1.wav");

View File

@ -1,3 +1,5 @@
// items.qc: items the player can pick up
const string WEPNAME_AXE = "Axe"; const string WEPNAME_AXE = "Axe";
const string WEPNAME_SHOTGUN = "Shotgun"; const string WEPNAME_SHOTGUN = "Shotgun";
const string WEPNAME_SUPER_SHOTGUN = "Double-barrelled Shotgun"; const string WEPNAME_SUPER_SHOTGUN = "Double-barrelled Shotgun";
@ -9,19 +11,27 @@ const string WEPNAME_LIGHTNING = "Thunderbolt";
string() Key1Name = { string() Key1Name = {
switch(world.worldtype) { switch(world.worldtype) {
case 0: return "silver key"; case 0:
case 1: return "silver runekey"; return "silver key";
case 2: return "silver keycard"; case 1:
default: return string_null; return "silver runekey";
case 2:
return "silver keycard";
default:
return string_null;
} }
}; };
string() Key2Name = { string() Key2Name = {
switch(world.worldtype) { switch(world.worldtype) {
case 0: return "gold key"; case 0:
case 1: return "gold runekey"; return "gold key";
case 2: return "gold keycard"; case 1:
default: return string_null; return "gold runekey";
case 2:
return "gold keycard";
default:
return string_null;
} }
}; };
@ -58,7 +68,7 @@ plants the object on the floor
============ ============
*/ */
void() PlaceItem = { void() PlaceItem = {
local float oldz; float oldz;
self.mdl = self.model; // so it can be restored on respawn self.mdl = self.model; // so it can be restored on respawn
self.flags = FL_ITEM; // make extra wide self.flags = FL_ITEM; // make extra wide
@ -131,7 +141,6 @@ enum {
H_ROTTEN = 1, H_ROTTEN = 1,
H_MEGA = 2, H_MEGA = 2,
}; };
.float healamount, healtype;
void() item_health = { void() item_health = {
self.touch = health_touch; self.touch = health_touch;
@ -164,8 +173,8 @@ void() item_health = {
void() health_touch = { void() health_touch = {
local float amount; float amount;
local string s; string s;
if(other.classname != "player") { if(other.classname != "player") {
return; return;
@ -244,7 +253,7 @@ ARMOR
*/ */
void() armor_touch = { void() armor_touch = {
local float type, value, bit; float type, value, bit;
if(other.health <= 0) { if(other.health <= 0) {
return; return;
@ -380,12 +389,10 @@ float(float w) RankForWeapon = {
Deathmatch_Weapon Deathmatch_Weapon
Deathmatch weapon change rules for picking up a weapon Deathmatch weapon change rules for picking up a weapon
.float ammo_shells, ammo_nails, ammo_rockets, ammo_cells;
============= =============
*/ */
void(float old, float new) Deathmatch_Weapon = { void(float old, float new) Deathmatch_Weapon = {
local float or, nr; float or, nr;
// change self.weapon if desired // change self.weapon if desired
or = RankForWeapon(self.weapon); or = RankForWeapon(self.weapon);
@ -401,9 +408,9 @@ weapon_touch
============= =============
*/ */
void() weapon_touch = { void() weapon_touch = {
local float hadammo, best, new, old; float hadammo, best, new, old;
local entity stemp; entity stemp;
local float leave; float leave;
if(!(other.flags & FL_CLIENT)) { if(!(other.flags & FL_CLIENT)) {
return; return;
@ -599,8 +606,8 @@ AMMO
*/ */
void() ammo_touch = { void() ammo_touch = {
local entity stemp; entity stemp;
local float best; float best;
if(other.classname != "player") { if(other.classname != "player") {
return; return;
@ -847,8 +854,8 @@ KEYS
*/ */
void() key_touch = { void() key_touch = {
local entity stemp; entity stemp;
local float best; float best;
if(other.classname != "player") { if(other.classname != "player") {
return; return;
@ -907,18 +914,18 @@ following:
void() item_key1 = { void() item_key1 = {
self.netname = Key1Name(); self.netname = Key1Name();
switch(world.worldtype) { switch(world.worldtype) {
case 0: case 0:
precache_model("progs/w_s_key.mdl"); precache_model("progs/w_s_key.mdl");
setmodel(self, "progs/w_s_key.mdl"); setmodel(self, "progs/w_s_key.mdl");
break; break;
case 1: case 1:
precache_model("progs/m_s_key.mdl"); precache_model("progs/m_s_key.mdl");
setmodel(self, "progs/m_s_key.mdl"); setmodel(self, "progs/m_s_key.mdl");
break; break;
case 2: case 2:
precache_model2("progs/b_s_key.mdl"); precache_model2("progs/b_s_key.mdl");
setmodel(self, "progs/b_s_key.mdl"); setmodel(self, "progs/b_s_key.mdl");
break; break;
} }
key_setsounds(); key_setsounds();
self.touch = key_touch; self.touch = key_touch;
@ -941,18 +948,18 @@ following:
void() item_key2 = { void() item_key2 = {
self.netname = Key2Name(); self.netname = Key2Name();
switch(world.worldtype) { switch(world.worldtype) {
case 0: case 0:
precache_model("progs/w_g_key.mdl"); precache_model("progs/w_g_key.mdl");
setmodel(self, "progs/w_g_key.mdl"); setmodel(self, "progs/w_g_key.mdl");
break; break;
case 1: case 1:
precache_model("progs/m_g_key.mdl"); precache_model("progs/m_g_key.mdl");
setmodel(self, "progs/m_g_key.mdl"); setmodel(self, "progs/m_g_key.mdl");
break; break;
case 2: case 2:
precache_model2("progs/b_g_key.mdl"); precache_model2("progs/b_g_key.mdl");
setmodel(self, "progs/b_g_key.mdl"); setmodel(self, "progs/b_g_key.mdl");
break; break;
} }
key_setsounds(); key_setsounds();
self.touch = key_touch; self.touch = key_touch;
@ -972,8 +979,8 @@ END OF LEVEL RUNES
*/ */
void() sigil_touch = { void() sigil_touch = {
local entity stemp; entity stemp;
local float best; float best;
if(other.classname != "player") { if(other.classname != "player") {
return; return;
@ -1039,8 +1046,8 @@ POWERUPS
*/ */
void() powerup_touch = { void() powerup_touch = {
local entity stemp; entity stemp;
local float best; float best;
if(other.classname != "player") { if(other.classname != "player") {
return; return;
@ -1181,10 +1188,10 @@ PLAYER BACKPACKS
*/ */
void() BackpackTouch = { void() BackpackTouch = {
local string s; string s;
local float best, old, new; float best, old, new;
local entity stemp; entity stemp;
local float acount; float acount;
if(other.classname != "player" || other.health <= 0) { if(other.classname != "player" || other.health <= 0) {
return; return;
@ -1206,10 +1213,10 @@ void() BackpackTouch = {
self = stemp; self = stemp;
// change weapons // change weapons
other.ammo_shells = other.ammo_shells + self.ammo_shells; other.ammo_shells = other.ammo_shells + self.ammo_shells;
other.ammo_nails = other.ammo_nails + self.ammo_nails; other.ammo_nails = other.ammo_nails + self.ammo_nails;
other.ammo_rockets = other.ammo_rockets + self.ammo_rockets; other.ammo_rockets = other.ammo_rockets + self.ammo_rockets;
other.ammo_cells = other.ammo_cells + self.ammo_cells; other.ammo_cells = other.ammo_cells + self.ammo_cells;
new = self.items; new = self.items;
if(!new) { if(!new) {
@ -1296,7 +1303,7 @@ DropBackpack
=============== ===============
*/ */
entity() DropBackpack = { entity() DropBackpack = {
local entity item; entity item;
item = spawn(); item = spawn();
item.origin = self.origin - '0 0 24'; item.origin = self.origin - '0 0 24';
@ -1304,21 +1311,39 @@ entity() DropBackpack = {
item.weapon = self.weapon; item.weapon = self.weapon;
switch(item.weapon) { switch(item.weapon) {
case IT_AXE: item.netname = WEPNAME_AXE; break; case IT_AXE:
case IT_SHOTGUN: item.netname = WEPNAME_SHOTGUN; break; item.netname = WEPNAME_AXE;
case IT_SUPER_SHOTGUN: item.netname = WEPNAME_SUPER_SHOTGUN; break; break;
case IT_NAILGUN: item.netname = WEPNAME_NAILGUN; break; case IT_SHOTGUN:
case IT_SUPER_NAILGUN: item.netname = WEPNAME_SUPER_NAILGUN; break; item.netname = WEPNAME_SHOTGUN;
case IT_GRENADE_LAUNCHER: item.netname = WEPNAME_GRENADE_LAUNCHER; break; break;
case IT_ROCKET_LAUNCHER: item.netname = WEPNAME_ROCKET_LAUNCHER; break; case IT_SUPER_SHOTGUN:
case IT_LIGHTNING: item.netname = WEPNAME_LIGHTNING; break; item.netname = WEPNAME_SUPER_SHOTGUN;
default: item.netname = ""; break; break;
case IT_NAILGUN:
item.netname = WEPNAME_NAILGUN;
break;
case IT_SUPER_NAILGUN:
item.netname = WEPNAME_SUPER_NAILGUN;
break;
case IT_GRENADE_LAUNCHER:
item.netname = WEPNAME_GRENADE_LAUNCHER;
break;
case IT_ROCKET_LAUNCHER:
item.netname = WEPNAME_ROCKET_LAUNCHER;
break;
case IT_LIGHTNING:
item.netname = WEPNAME_LIGHTNING;
break;
default:
item.netname = "";
break;
} }
item.ammo_shells = self.ammo_shells; item.ammo_shells = self.ammo_shells;
item.ammo_nails = self.ammo_nails; item.ammo_nails = self.ammo_nails;
item.ammo_rockets = self.ammo_rockets; item.ammo_rockets = self.ammo_rockets;
item.ammo_cells = self.ammo_cells; item.ammo_cells = self.ammo_cells;
item.velocity_z = 300; item.velocity_z = 300;
item.velocity_x = -100 + (random() * 200); item.velocity_x = -100 + (random() * 200);

View File

@ -1,10 +1,4 @@
/* // knight.qc: Knight
==============================================================================
KNIGHT
==============================================================================
*/
$cd id1 / models / knight $cd id1 / models / knight
$origin 0 0 24 $origin 0 0 24
@ -75,7 +69,6 @@ void() knight_walk12 = [ $walk12, knight_walk13 ] {ai_walk(3);};
void() knight_walk13 = [ $walk13, knight_walk14 ] {ai_walk(4);}; void() knight_walk13 = [ $walk13, knight_walk14 ] {ai_walk(4);};
void() knight_walk14 = [ $walk14, knight_walk1 ] {ai_walk(3);}; void() knight_walk14 = [ $walk14, knight_walk1 ] {ai_walk(3);};
void() knight_run1 = [ $runb1, knight_run2 ] { void() knight_run1 = [ $runb1, knight_run2 ] {
if(random() < 0.2) { if(random() < 0.2) {
sound(self, CHAN_VOICE, "knight/idle.wav", 1, ATTN_IDLE); sound(self, CHAN_VOICE, "knight/idle.wav", 1, ATTN_IDLE);
@ -90,7 +83,6 @@ void() knight_run6 = [ $runb6, knight_run7 ] {ai_run(20);};
void() knight_run7 = [ $runb7, knight_run8 ] {ai_run(14);}; void() knight_run7 = [ $runb7, knight_run8 ] {ai_run(14);};
void() knight_run8 = [ $runb8, knight_run1 ] {ai_run(6);}; void() knight_run8 = [ $runb8, knight_run1 ] {ai_run(6);};
void() knight_runatk1 = [ $runattack1, knight_runatk2 ] { void() knight_runatk1 = [ $runattack1, knight_runatk2 ] {
if(random() > 0.5) { if(random() > 0.5) {
sound(self, CHAN_WEAPON, "knight/sword2.wav", 1, ATTN_NORM); sound(self, CHAN_WEAPON, "knight/sword2.wav", 1, ATTN_NORM);
@ -121,8 +113,8 @@ void() knight_atk5 = [ $attackb5, knight_atk6 ] {ai_charge(3);};
void() knight_atk6 = [ $attackb6, knight_atk7 ] {ai_charge(4); ai_melee();}; void() knight_atk6 = [ $attackb6, knight_atk7 ] {ai_charge(4); ai_melee();};
void() knight_atk7 = [ $attackb7, knight_atk8 ] {ai_charge(1); ai_melee();}; void() knight_atk7 = [ $attackb7, knight_atk8 ] {ai_charge(1); ai_melee();};
void() knight_atk8 = [ $attackb8, knight_atk9 ] {ai_charge(3); void() knight_atk8 = [ $attackb8, knight_atk9 ] {ai_charge(3);
ai_melee(); ai_melee();
}; };
void() knight_atk9 = [ $attackb9, knight_atk10] {ai_charge(1);}; void() knight_atk9 = [ $attackb9, knight_atk10] {ai_charge(1);};
void() knight_atk10 = [ $attackb10, knight_run1 ] {ai_charge(5);}; void() knight_atk10 = [ $attackb10, knight_run1 ] {ai_charge(5);};
@ -149,7 +141,7 @@ void() knight_painb10 = [ $painb10, knight_painb11 ] {ai_painforward(0);};
void() knight_painb11 = [ $painb11, knight_run1 ] {}; void() knight_painb11 = [ $painb11, knight_run1 ] {};
void(entity attacker, float damage) knight_pain = { void(entity attacker, float damage) knight_pain = {
local float r; float r;
if(self.pain_finished > time) { if(self.pain_finished > time) {
return; return;
@ -184,7 +176,6 @@ void() knight_bow9 = [ $kneel1, knight_bow10 ] {ai_turn();};
void() knight_bow10 = [ $walk1, knight_walk1 ] {ai_turn();}; void() knight_bow10 = [ $walk1, knight_walk1 ] {ai_turn();};
void() knight_die1 = [ $death1, knight_die2 ] {}; void() knight_die1 = [ $death1, knight_die2 ] {};
void() knight_die2 = [ $death2, knight_die3 ] {}; void() knight_die2 = [ $death2, knight_die3 ] {};
void() knight_die3 = [ $death3, knight_die4 ] void() knight_die3 = [ $death3, knight_die4 ]
@ -197,7 +188,6 @@ void() knight_die8 = [ $death8, knight_die9 ] {};
void() knight_die9 = [ $death9, knight_die10] {}; void() knight_die9 = [ $death9, knight_die10] {};
void() knight_die10 = [ $death10, knight_die10] {}; void() knight_die10 = [ $death10, knight_die10] {};
void() knight_dieb1 = [ $deathb1, knight_dieb2 ] {}; void() knight_dieb1 = [ $deathb1, knight_dieb2 ] {};
void() knight_dieb2 = [ $deathb2, knight_dieb3 ] {}; void() knight_dieb2 = [ $deathb2, knight_dieb3 ] {};
void() knight_dieb3 = [ $deathb3, knight_dieb4 ] void() knight_dieb3 = [ $deathb3, knight_dieb4 ]
@ -211,7 +201,6 @@ void() knight_dieb9 = [ $deathb9, knight_dieb10] {};
void() knight_dieb10 = [ $deathb10, knight_dieb11] {}; void() knight_dieb10 = [ $deathb10, knight_dieb11] {};
void() knight_dieb11 = [ $deathb11, knight_dieb11] {}; void() knight_dieb11 = [ $deathb11, knight_dieb11] {};
void() knight_die = { void() knight_die = {
// check for gib // check for gib
if(self.health < -40) { if(self.health < -40) {
@ -232,7 +221,6 @@ void() knight_die = {
} }
}; };
/*QUAKED monster_knight(1 0 0) (-16 -16 -24) (16 16 40) Ambush /*QUAKED monster_knight(1 0 0) (-16 -16 -24) (16 16 40) Ambush
*/ */
void() monster_knight = { void() monster_knight = {

View File

@ -1,3 +1,4 @@
// misc.qc: various useful brushes
/*QUAKED info_null(0 0.5 0) (-4 -4 -4) (4 4 4) /*QUAKED info_null(0 0.5 0) (-4 -4 -4) (4 4 4)
Used as a positional target for spotlights, etc. Used as a positional target for spotlights, etc.
@ -149,7 +150,6 @@ void() light_flame_small_white = {
//============================================================================ //============================================================================
/*QUAKED misc_fireball(0 .5 .8) (-8 -8 -8) (8 8 8) /*QUAKED misc_fireball(0 .5 .8) (-8 -8 -8) (8 8 8)
Lava Balls Lava Balls
*/ */
@ -165,7 +165,7 @@ void() misc_fireball = {
}; };
void() fire_fly = { void() fire_fly = {
local entity fireball; entity fireball;
fireball = spawn(); fireball = spawn();
fireball.solid = SOLID_TRIGGER; fireball.solid = SOLID_TRIGGER;
@ -186,7 +186,6 @@ void() fire_fly = {
self.think = fire_fly; self.think = fire_fly;
}; };
void() fire_touch = { void() fire_touch = {
T_Damage(other, self, self, 20); T_Damage(other, self, self, 20);
remove(self); remove(self);
@ -194,7 +193,6 @@ void() fire_touch = {
//============================================================================ //============================================================================
void() barrel_explode = { void() barrel_explode = {
self.takedamage = DAMAGE_NO; self.takedamage = DAMAGE_NO;
self.classname = "explo_box"; self.classname = "explo_box";
@ -208,13 +206,12 @@ void() barrel_explode = {
}; };
/*QUAKED misc_explobox(0 .5 .8) (0 0 0) (32 32 64) /*QUAKED misc_explobox(0 .5 .8) (0 0 0) (32 32 64)
TESTING THING TESTING THING
*/ */
void() misc_explobox = { void() misc_explobox = {
local float oldz; float oldz;
self.solid = SOLID_BBOX; self.solid = SOLID_BBOX;
self.movetype = MOVETYPE_NONE; self.movetype = MOVETYPE_NONE;
@ -238,13 +235,12 @@ void() misc_explobox = {
/*QUAKED misc_explobox2(0 .5 .8) (0 0 0) (32 32 64) /*QUAKED misc_explobox2(0 .5 .8) (0 0 0) (32 32 64)
Smaller exploding box, REGISTERED ONLY Smaller exploding box, REGISTERED ONLY
*/ */
void() misc_explobox2 = { void() misc_explobox2 = {
local float oldz; float oldz;
self.solid = SOLID_BBOX; self.solid = SOLID_BBOX;
self.movetype = MOVETYPE_NONE; self.movetype = MOVETYPE_NONE;
@ -293,7 +289,6 @@ void() shooter_think = {
newmis.velocity = self.movedir * 500; newmis.velocity = self.movedir * 500;
}; };
/*QUAKED trap_spikeshooter(0 .5 .8) (-8 -8 -8) (8 8 8) superspike laser /*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. When triggered, fires a spike in the direction set in QuakeEd.
Laser is only for REGISTERED. Laser is only for REGISTERED.
@ -311,7 +306,6 @@ void() trap_spikeshooter = {
} }
}; };
/*QUAKED trap_shooter(0 .5 .8) (-8 -8 -8) (8 8 8) superspike laser /*QUAKED trap_shooter(0 .5 .8) (-8 -8 -8) (8 8 8) superspike laser
Continuously fires spikes. Continuously fires spikes.
"wait" time between spike(1.0 default) "wait" time between spike(1.0 default)
@ -328,23 +322,18 @@ void() trap_shooter = {
}; };
/* /*
=============================================================================== ===============================================================================
=============================================================================== ===============================================================================
*/ */
/*QUAKED air_bubbles(0 .5 .8) (-8 -8 -8) (8 8 8) /*QUAKED air_bubbles(0 .5 .8) (-8 -8 -8) (8 8 8)
testing air bubbles testing air bubbles
*/ */
void() air_bubbles = void() air_bubbles = {
{
if(deathmatch) { if(deathmatch) {
remove(self); remove(self);
return; return;
@ -355,7 +344,7 @@ void() air_bubbles =
}; };
void() make_bubbles = { void() make_bubbles = {
local entity bubble; entity bubble;
bubble = spawn(); bubble = spawn();
setmodel(bubble, "progs/s_bubble.spr"); setmodel(bubble, "progs/s_bubble.spr");
@ -375,7 +364,7 @@ void() make_bubbles = {
}; };
void() bubble_split = { void() bubble_split = {
local entity bubble; entity bubble;
bubble = spawn(); bubble = spawn();
setmodel(bubble, "progs/s_bubble.spr"); setmodel(bubble, "progs/s_bubble.spr");
setorigin(bubble, self.origin); setorigin(bubble, self.origin);
@ -405,8 +394,8 @@ void() bubble_remove = {
}; };
void() bubble_bob = { void() bubble_bob = {
local float rnd1, rnd2, rnd3; float rnd1, rnd2, rnd3;
local vector vtmp1, modi; vector vtmp1, modi;
self.cnt = self.cnt + 1; self.cnt = self.cnt + 1;
if(self.cnt == 4) { if(self.cnt == 4) {
@ -466,7 +455,6 @@ void() viewthing =
setmodel(self, "progs/player.mdl"); setmodel(self, "progs/player.mdl");
}; };
/* /*
============================================================================== ==============================================================================
@ -491,7 +479,6 @@ void() func_wall = {
setmodel(self, self.model); setmodel(self, self.model);
}; };
/*QUAKED func_illusionary(0 .5 .8) ? /*QUAKED func_illusionary(0 .5 .8) ?
A simple entity that looks solid but lets you walk through it. A simple entity that looks solid but lets you walk through it.
*/ */
@ -612,9 +599,7 @@ void() noise_think = {
For optimzation testing, starts a lot of sounds. For optimzation testing, starts a lot of sounds.
*/ */
void() misc_noisemaker = void() misc_noisemaker = {
{
precache_sound2("enforcer/enfire.wav"); precache_sound2("enforcer/enfire.wav");
precache_sound2("enforcer/enfstop.wav"); precache_sound2("enforcer/enfstop.wav");
precache_sound2("enforcer/sight1.wav"); precache_sound2("enforcer/sight1.wav");

View File

@ -1,3 +1,4 @@
// models.qc: model information
/* /*
=============================================================================== ===============================================================================
@ -15,7 +16,6 @@ $base base
$skin skin $skin skin
$frame shot1 $frame shot1
$modelname g_nail $modelname g_nail
$cd id1 / models / g_nail $cd id1 / models / g_nail
$flags 8 // client side rotate $flags 8 // client side rotate
@ -24,7 +24,6 @@ $base base
$skin skin $skin skin
$frame shot1 $frame shot1
$modelname g_nail2 $modelname g_nail2
$cd id1 / models / g_nail2 $cd id1 / models / g_nail2
$flags 8 // client side rotate $flags 8 // client side rotate
@ -33,7 +32,6 @@ $base base
$skin skin $skin skin
$frame shot2 $frame shot2
$modelname g_rock $modelname g_rock
$cd id1 / models / g_rock $cd id1 / models / g_rock
$flags 8 // client side rotate $flags 8 // client side rotate
@ -42,7 +40,6 @@ $base base
$skin skin $skin skin
$frame shot1 $frame shot1
$modelname g_rock2 $modelname g_rock2
$cd id1 / models / g_rock2 $cd id1 / models / g_rock2
$flags 8 // client side rotate $flags 8 // client side rotate
@ -74,7 +71,6 @@ $base base
$skin skin $skin skin
$frame frame1 frame2 frame3 frame4 frame5 frame6 frame7 frame8 frame9 $frame frame1 frame2 frame3 frame4 frame5 frame6 frame7 frame8 frame9
$modelname v_shot $modelname v_shot
$cd id1 / models / v_shot $cd id1 / models / v_shot
$origin 0 0 54 $origin 0 0 54
@ -82,7 +78,6 @@ $base base
$skin skin $skin skin
$frame shot1 shot2 shot3 shot4 shot5 shot6 shot7 $frame shot1 shot2 shot3 shot4 shot5 shot6 shot7
$modelname v_shot2 $modelname v_shot2
$cd id1 / models / v_shot2 $cd id1 / models / v_shot2
$origin 0 0 56 $origin 0 0 56
@ -90,7 +85,6 @@ $base base
$skin skin $skin skin
$frame shot1 shot2 shot3 shot4 shot5 shot6 shot7 $frame shot1 shot2 shot3 shot4 shot5 shot6 shot7
$modelname v_rock2 $modelname v_rock2
$cd id1 / models / v_rock2 $cd id1 / models / v_rock2
$origin 0 0 54 $origin 0 0 54
@ -98,7 +92,6 @@ $base base
$skin skin $skin skin
$frame shot1 shot2 shot3 shot4 shot5 shot6 shot6 $frame shot1 shot2 shot3 shot4 shot5 shot6 shot6
$modelname v_rock $modelname v_rock
$cd id1 / models / v_rock $cd id1 / models / v_rock
$origin 0 0 54 $origin 0 0 54
@ -106,7 +99,6 @@ $base base
$skin skin $skin skin
$frame shot1 shot2 shot3 shot4 shot5 shot6 shot7 $frame shot1 shot2 shot3 shot4 shot5 shot6 shot7
$modelname v_nail2 $modelname v_nail2
$cd id1 / models / v_nail2 $cd id1 / models / v_nail2
$origin 0 0 54 $origin 0 0 54
@ -114,7 +106,6 @@ $base base
$skin skin $skin skin
$frame shot1 shot2 shot3 shot4 shot5 shot6 shot7 shot8 shot9 $frame shot1 shot2 shot3 shot4 shot5 shot6 shot7 shot8 shot9
$modelname v_nail $modelname v_nail
$cd id1 / models / v_nail $cd id1 / models / v_nail
$origin 0 0 54 $origin 0 0 54
@ -129,7 +120,6 @@ $base base
$skin skin $skin skin
$frame shot1 shot2 shot3 shot4 shot5 $frame shot1 shot2 shot3 shot4 shot5
/* /*
=============================================================================== ===============================================================================
@ -180,7 +170,6 @@ $base base
$skin skin $skin skin
$frame frame1 $frame frame1
$modelname quaddama $modelname quaddama
$cd id1 / models / quaddama $cd id1 / models / quaddama
$flags 8 // client side rotate $flags 8 // client side rotate
@ -258,7 +247,6 @@ $base base
$skin skin $skin skin
$frame frame1 $frame frame1
/* /*
=============================================================================== ===============================================================================
@ -275,7 +263,6 @@ $base base
$skin skin $skin skin
$frame frame1 $frame frame1
// torso // torso
$modelname gib2 $modelname gib2
$cd id1 / models / gib2 $cd id1 / models / gib2
@ -293,7 +280,6 @@ $base base
$skin skin $skin skin
$frame frame1 $frame frame1
// heads // heads
$modelname h_player $modelname h_player

View File

@ -1,3 +1,5 @@
// monsters.qc: basic monster functions
/* ALL MONSTERS SHOULD BE 1 0 0 IN COLOR */ /* ALL MONSTERS SHOULD BE 1 0 0 IN COLOR */
// name =[framenum, nexttime, nextthink] {code} // name =[framenum, nexttime, nextthink] {code}
@ -10,7 +12,6 @@
// <code> // <code>
// }; // };
/* /*
================ ================
monster_use monster_use
@ -51,7 +52,7 @@ enemy as activator.
================ ================
*/ */
void() monster_death_use = { void() monster_death_use = {
local entity ent, otemp, stemp; entity ent, otemp, stemp;
// fall to ground // fall to ground
if(self.flags & FL_FLY) { if(self.flags & FL_FLY) {
@ -69,12 +70,11 @@ void() monster_death_use = {
SUB_UseTargets(); SUB_UseTargets();
}; };
//============================================================================ //============================================================================
void() walkmonster_start_go = { void() walkmonster_start_go = {
local string stemp; string stemp;
local entity etemp; entity etemp;
self.origin_z = self.origin_z + 1; // raise off floor a bit self.origin_z = self.origin_z + 1; // raise off floor a bit
droptofloor(); droptofloor();
@ -120,7 +120,6 @@ void() walkmonster_start_go = {
self.nextthink = self.nextthink + random() * 0.5; self.nextthink = self.nextthink + random() * 0.5;
}; };
void() walkmonster_start = { void() walkmonster_start = {
// delay drop to floor to make sure all doors have been spawned // delay drop to floor to make sure all doors have been spawned
// spread think times so they don't all happen at same time // spread think times so they don't all happen at same time
@ -130,7 +129,6 @@ void() walkmonster_start = {
}; };
void() flymonster_start_go = { void() flymonster_start_go = {
self.takedamage = DAMAGE_AIM; self.takedamage = DAMAGE_AIM;
@ -177,7 +175,6 @@ void() flymonster_start = {
total_monsters = total_monsters + 1; total_monsters = total_monsters + 1;
}; };
void() swimmonster_start_go = { void() swimmonster_start_go = {
if(deathmatch) { if(deathmatch) {
remove(self); remove(self);
@ -223,4 +220,3 @@ void() swimmonster_start = {
total_monsters = total_monsters + 1; total_monsters = total_monsters + 1;
}; };

View File

@ -1,10 +1,4 @@
/* // ogre.qc: Ogre
==============================================================================
OGRE
==============================================================================
*/
$cd id1 / models / ogre_c $cd id1 / models / ogre_c
$origin 0 0 24 $origin 0 0 24
@ -49,7 +43,6 @@ $frame pull1 pull2 pull3 pull4 pull5 pull6 pull7 pull8 pull9 pull10 pull11
//============================================================================= //=============================================================================
void() OgreGrenadeExplode = { void() OgreGrenadeExplode = {
T_RadiusDamage(self, self.owner, 40, world); T_RadiusDamage(self, self.owner, 40, world);
sound(self, CHAN_VOICE, "weapons/r_exp3.wav", 1, ATTN_NORM); sound(self, CHAN_VOICE, "weapons/r_exp3.wav", 1, ATTN_NORM);
@ -87,7 +80,7 @@ OgreFireGrenade
================ ================
*/ */
void() OgreFireGrenade = { void() OgreFireGrenade = {
local entity missile, mpuff; entity missile, mpuff;
self.effects = self.effects | EF_MUZZLEFLASH; self.effects = self.effects | EF_MUZZLEFLASH;
@ -121,7 +114,6 @@ void() OgreFireGrenade = {
setorigin(missile, self.origin); setorigin(missile, self.origin);
}; };
//============================================================================= //=============================================================================
/* /*
@ -132,8 +124,8 @@ FIXME
================ ================
*/ */
void(float side) chainsaw = { void(float side) chainsaw = {
local vector delta; vector delta;
local float ldmg; float ldmg;
if(!self.enemy) { if(!self.enemy) {
return; return;
@ -163,7 +155,6 @@ void(float side) chainsaw = {
} }
}; };
void() ogre_stand1 = [ $stand1, ogre_stand2 ] {ai_stand();}; void() ogre_stand1 = [ $stand1, ogre_stand2 ] {ai_stand();};
void() ogre_stand2 = [ $stand2, ogre_stand3 ] {ai_stand();}; void() ogre_stand2 = [ $stand2, ogre_stand3 ] {ai_stand();};
void() ogre_stand3 = [ $stand3, ogre_stand4 ] {ai_stand();}; void() ogre_stand3 = [ $stand3, ogre_stand4 ] {ai_stand();};
@ -210,7 +201,7 @@ void() ogre_run1 = [ $run1, ogre_run2 ] {ai_run(9);
if(random() < 0.2) { if(random() < 0.2) {
sound(self, CHAN_VOICE, "ogre/ogidle2.wav", 1, ATTN_IDLE); sound(self, CHAN_VOICE, "ogre/ogidle2.wav", 1, ATTN_IDLE);
} }
}; };
void() ogre_run2 = [ $run2, ogre_run3 ] {ai_run(12);}; void() ogre_run2 = [ $run2, ogre_run3 ] {ai_run(12);};
void() ogre_run3 = [ $run3, ogre_run4 ] {ai_run(8);}; void() ogre_run3 = [ $run3, ogre_run4 ] {ai_run(8);};
void() ogre_run4 = [ $run4, ogre_run5 ] {ai_run(22);}; void() ogre_run4 = [ $run4, ogre_run5 ] {ai_run(22);};
@ -220,8 +211,8 @@ void() ogre_run7 = [ $run7, ogre_run8 ] {ai_run(13);};
void() ogre_run8 = [ $run8, ogre_run1 ] {ai_run(24);}; void() ogre_run8 = [ $run8, ogre_run1 ] {ai_run(24);};
void() ogre_swing1 = [ $swing1, ogre_swing2 ] {ai_charge(11); void() ogre_swing1 = [ $swing1, ogre_swing2 ] {ai_charge(11);
sound(self, CHAN_WEAPON, "ogre/ogsawatk.wav", 1, ATTN_NORM); sound(self, CHAN_WEAPON, "ogre/ogsawatk.wav", 1, ATTN_NORM);
}; };
void() ogre_swing2 = [ $swing2, ogre_swing3 ] {ai_charge(1);}; void() ogre_swing2 = [ $swing2, ogre_swing3 ] {ai_charge(1);};
void() ogre_swing3 = [ $swing3, ogre_swing4 ] {ai_charge(4);}; void() ogre_swing3 = [ $swing3, ogre_swing4 ] {ai_charge(4);};
void() ogre_swing4 = [ $swing4, ogre_swing5 ] {ai_charge(13);}; void() ogre_swing4 = [ $swing4, ogre_swing5 ] {ai_charge(13);};
@ -237,8 +228,8 @@ void() ogre_swing13 = [ $swing13, ogre_swing14 ] {ai_charge(8);};
void() ogre_swing14 = [ $swing14, ogre_run1 ] {ai_charge(9);}; void() ogre_swing14 = [ $swing14, ogre_run1 ] {ai_charge(9);};
void() ogre_smash1 = [ $smash1, ogre_smash2 ] {ai_charge(6); void() ogre_smash1 = [ $smash1, ogre_smash2 ] {ai_charge(6);
sound(self, CHAN_WEAPON, "ogre/ogsawatk.wav", 1, ATTN_NORM); sound(self, CHAN_WEAPON, "ogre/ogsawatk.wav", 1, ATTN_NORM);
}; };
void() ogre_smash2 = [ $smash2, ogre_smash3 ] {ai_charge(0);}; void() ogre_smash2 = [ $smash2, ogre_smash3 ] {ai_charge(0);};
void() ogre_smash3 = [ $smash3, ogre_smash4 ] {ai_charge(0);}; void() ogre_smash3 = [ $smash3, ogre_smash4 ] {ai_charge(0);};
void() ogre_smash4 = [ $smash4, ogre_smash5 ] {ai_charge(1);}; void() ogre_smash4 = [ $smash4, ogre_smash5 ] {ai_charge(1);};
@ -249,9 +240,9 @@ void() ogre_smash8 = [ $smash8, ogre_smash9 ] {ai_charge(10); chainsaw(0);};
void() ogre_smash9 = [ $smash9, ogre_smash10 ] {ai_charge(13); chainsaw(0);}; void() ogre_smash9 = [ $smash9, ogre_smash10 ] {ai_charge(13); chainsaw(0);};
void() ogre_smash10 = [ $smash10, ogre_smash11 ] {chainsaw(1);}; void() ogre_smash10 = [ $smash10, ogre_smash11 ] {chainsaw(1);};
void() ogre_smash11 = [ $smash11, ogre_smash12 ] {ai_charge(2); void() ogre_smash11 = [ $smash11, ogre_smash12 ] {ai_charge(2);
chainsaw(0); chainsaw(0);
self.nextthink = self.nextthink + random() * 0.2; self.nextthink = self.nextthink + random() * 0.2;
}; // slight variation }; // slight variation
void() ogre_smash12 = [ $smash12, ogre_smash13 ] {ai_charge(0);}; void() ogre_smash12 = [ $smash12, ogre_smash13 ] {ai_charge(0);};
void() ogre_smash13 = [ $smash13, ogre_smash14 ] {ai_charge(4);}; void() ogre_smash13 = [ $smash13, ogre_smash14 ] {ai_charge(4);};
void() ogre_smash14 = [ $smash14, ogre_run1 ] {ai_charge(12);}; void() ogre_smash14 = [ $smash14, ogre_run1 ] {ai_charge(12);};
@ -270,12 +261,10 @@ void() ogre_pain3 = [ $pain3, ogre_pain4 ] {};
void() ogre_pain4 = [ $pain4, ogre_pain5 ] {}; void() ogre_pain4 = [ $pain4, ogre_pain5 ] {};
void() ogre_pain5 = [ $pain5, ogre_run1 ] {}; void() ogre_pain5 = [ $pain5, ogre_run1 ] {};
void() ogre_painb1 = [ $painb1, ogre_painb2 ] {}; void() ogre_painb1 = [ $painb1, ogre_painb2 ] {};
void() ogre_painb2 = [ $painb2, ogre_painb3 ] {}; void() ogre_painb2 = [ $painb2, ogre_painb3 ] {};
void() ogre_painb3 = [ $painb3, ogre_run1 ] {}; void() ogre_painb3 = [ $painb3, ogre_run1 ] {};
void() ogre_painc1 = [ $painc1, ogre_painc2 ] {}; void() ogre_painc1 = [ $painc1, ogre_painc2 ] {};
void() ogre_painc2 = [ $painc2, ogre_painc3 ] {}; void() ogre_painc2 = [ $painc2, ogre_painc3 ] {};
void() ogre_painc3 = [ $painc3, ogre_painc4 ] {}; void() ogre_painc3 = [ $painc3, ogre_painc4 ] {};
@ -283,7 +272,6 @@ void() ogre_painc4 = [ $painc4, ogre_painc5 ] {};
void() ogre_painc5 = [ $painc5, ogre_painc6 ] {}; void() ogre_painc5 = [ $painc5, ogre_painc6 ] {};
void() ogre_painc6 = [ $painc6, ogre_run1 ] {}; void() ogre_painc6 = [ $painc6, ogre_run1 ] {};
void() ogre_paind1 = [ $paind1, ogre_paind2 ] {}; void() ogre_paind1 = [ $paind1, ogre_paind2 ] {};
void() ogre_paind2 = [ $paind2, ogre_paind3 ] {ai_pain(10);}; void() ogre_paind2 = [ $paind2, ogre_paind3 ] {ai_pain(10);};
void() ogre_paind3 = [ $paind3, ogre_paind4 ] {ai_pain(9);}; void() ogre_paind3 = [ $paind3, ogre_paind4 ] {ai_pain(9);};
@ -317,9 +305,8 @@ void() ogre_paine13 = [ $paine13, ogre_paine14 ] {};
void() ogre_paine14 = [ $paine14, ogre_paine15 ] {}; void() ogre_paine14 = [ $paine14, ogre_paine15 ] {};
void() ogre_paine15 = [ $paine15, ogre_run1 ] {}; void() ogre_paine15 = [ $paine15, ogre_run1 ] {};
void(entity attacker, float damage) ogre_pain = { void(entity attacker, float damage) ogre_pain = {
local float r; float r;
// don't make multiple pain sounds right after each other // don't make multiple pain sounds right after each other
if(self.pain_finished > time) { if(self.pain_finished > time) {
@ -410,7 +397,6 @@ void() ogre_melee = {
} }
}; };
/*QUAKED monster_ogre(1 0 0) (-32 -32 -24) (32 32 64) Ambush /*QUAKED monster_ogre(1 0 0) (-32 -32 -24) (32 32 64) Ambush
*/ */
@ -454,4 +440,3 @@ void() monster_ogre_marksman = {
monster_ogre(); monster_ogre();
}; };

View File

@ -1,18 +1,11 @@
/* // oldone.qc: Shub-Niggurath
==============================================================================
OLD ONE
==============================================================================
*/
$cd id1 / models / old_one $cd id1 / models / old_one
$origin 0 0 24 $origin 0 0 24
$base base $base base
$skin skin $skin skin
$scale 1 $scale 1
entity shub;
$frame old1 old2 old3 old4 old5 old6 old7 old8 old9 $frame old1 old2 old3 old4 old5 old6 old7 old8 old9
$frame old10 old11 old12 old13 old14 old15 old16 old17 old18 old19 $frame old10 old11 old12 old13 old14 old15 old16 old17 old18 old19
$frame old20 old21 old22 old23 old24 old25 old26 old27 old28 old29 $frame old20 old21 old22 old23 old24 old25 old26 old27 old28 old29
@ -72,7 +65,6 @@ void() old_idle44 = [ $old44, old_idle45 ] {};
void() old_idle45 = [ $old45, old_idle46 ] {}; void() old_idle45 = [ $old45, old_idle46 ] {};
void() old_idle46 = [ $old46, old_idle1 ] {}; void() old_idle46 = [ $old46, old_idle1 ] {};
void() old_thrash1 = [ $shake1, old_thrash2 ] {lightstyle(0, "m");}; void() old_thrash1 = [ $shake1, old_thrash2 ] {lightstyle(0, "m");};
void() old_thrash2 = [ $shake2, old_thrash3 ] {lightstyle(0, "k");}; void() old_thrash2 = [ $shake2, old_thrash3 ] {lightstyle(0, "k");};
void() old_thrash3 = [ $shake3, old_thrash4 ] {lightstyle(0, "k");}; void() old_thrash3 = [ $shake3, old_thrash4 ] {lightstyle(0, "k");};
@ -88,11 +80,11 @@ void() old_thrash12 = [ $shake12, old_thrash13 ] {lightstyle(0, "i");};
void() old_thrash13 = [ $shake13, old_thrash14 ] {lightstyle(0, "k");}; void() old_thrash13 = [ $shake13, old_thrash14 ] {lightstyle(0, "k");};
void() old_thrash14 = [ $shake14, old_thrash15 ] {lightstyle(0, "m");}; void() old_thrash14 = [ $shake14, old_thrash15 ] {lightstyle(0, "m");};
void() old_thrash15 = [ $shake15, old_thrash16 ] {lightstyle(0, "m"); void() old_thrash15 = [ $shake15, old_thrash16 ] {lightstyle(0, "m");
self.cnt = self.cnt + 1; self.cnt = self.cnt + 1;
if(self.cnt != 3) { if(self.cnt != 3) {
self.think = old_thrash1; self.think = old_thrash1;
} }
}; };
void() old_thrash16 = [ $shake16, old_thrash17 ] {lightstyle(0, "g");}; void() old_thrash16 = [ $shake16, old_thrash17 ] {lightstyle(0, "g");};
void() old_thrash17 = [ $shake17, old_thrash18 ] {lightstyle(0, "c");}; void() old_thrash17 = [ $shake17, old_thrash18 ] {lightstyle(0, "c");};
void() old_thrash18 = [ $shake18, old_thrash19 ] {lightstyle(0, "b");}; void() old_thrash18 = [ $shake18, old_thrash19 ] {lightstyle(0, "b");};
@ -102,8 +94,8 @@ void() old_thrash20 = [ $shake20, old_thrash20 ] {finale_4();};
//============================================================================ //============================================================================
void() finale_1 = { void() finale_1 = {
local entity pos, pl; entity pos, pl;
local entity timer; entity timer;
intermission_exittime = time + 10000000; // never allow exit intermission_exittime = time + 10000000; // never allow exit
intermission_running = 1; intermission_running = 1;
@ -147,7 +139,7 @@ void() finale_1 = {
}; };
void() finale_2 = { void() finale_2 = {
local vector o; vector o;
// start a teleport splash inside shub // start a teleport splash inside shub
@ -173,10 +165,10 @@ void() finale_3 = {
void() finale_4 = { void() finale_4 = {
// throw tons of meat chunks // throw tons of meat chunks
local vector oldo; vector oldo;
local float x, y, z; float x, y, z;
local float r; float r;
local entity n; entity n;
sound(self, CHAN_VOICE, "boss2/pop2.wav", 1, ATTN_NORM); sound(self, CHAN_VOICE, "boss2/pop2.wav", 1, ATTN_NORM);
@ -234,7 +226,6 @@ void() nopain = {
//============================================================================ //============================================================================
/*QUAKED monster_oldone(1 0 0) (-16 -16 -24) (16 16 32) /*QUAKED monster_oldone(1 0 0) (-16 -16 -24) (16 16 32)
*/ */
void() monster_oldone = { void() monster_oldone = {

View File

@ -1,10 +1,12 @@
// plats.qc: moving platforms
enum { enum {
PLAT_LOW_TRIGGER = 1, PLAT_LOW_TRIGGER = 1,
}; };
void() plat_spawn_inside_trigger = { void() plat_spawn_inside_trigger = {
local entity trigger; entity trigger;
local vector tmin, tmax; vector tmin, tmax;
// //
// middle trigger // middle trigger
@ -98,7 +100,6 @@ void() plat_trigger_use = {
plat_go_down(); plat_go_down();
}; };
void() plat_crush = { void() plat_crush = {
//dprint("plat_crush\n"); //dprint("plat_crush\n");
@ -121,7 +122,6 @@ void() plat_use = {
plat_go_down(); plat_go_down();
}; };
/*QUAKED func_plat(0 .5 .8) ? PLAT_LOW_TRIGGER /*QUAKED func_plat(0 .5 .8) ? PLAT_LOW_TRIGGER
speed default 150 speed default 150
@ -135,11 +135,8 @@ Set "sounds" to one of the following:
2) chain slow 2) chain slow
*/ */
void() func_plat = {
void() func_plat = entity t;
{
local entity t;
if(!self.t_length) { if(!self.t_length) {
self.t_length = 80; self.t_length = 80;
@ -167,7 +164,6 @@ void() func_plat =
self.noise1 = "plats/medplat2.wav"; self.noise1 = "plats/medplat2.wav";
} }
self.mangle = self.angles; self.mangle = self.angles;
self.angles = '0 0 0'; self.angles = '0 0 0';
@ -233,7 +229,7 @@ void() train_wait = {
}; };
void() train_next = { void() train_next = {
local entity targ; entity targ;
targ = find(world, targetname, self.target); targ = find(world, targetname, self.target);
self.target = targ.target; self.target = targ.target;
@ -249,10 +245,8 @@ void() train_next = {
SUB_CalcMove(targ.origin - self.mins, self.speed, train_wait); SUB_CalcMove(targ.origin - self.mins, self.speed, train_wait);
}; };
void() func_train_find = void() func_train_find = {
entity targ;
{
local entity targ;
targ = find(world, targetname, self.target); targ = find(world, targetname, self.target);
self.target = targ.target; self.target = targ.target;

View File

@ -1,11 +1,4 @@
// player.qc: the player entity
/*
==============================================================================
PLAYER
==============================================================================
*/
$cd id1 / models / player_4 $cd id1 / models / player_4
$origin 0 - 6 24 $origin 0 - 6 24
@ -27,7 +20,6 @@ $frame stand1 stand2 stand3 stand4 stand5
$frame axstnd1 axstnd2 axstnd3 axstnd4 axstnd5 axstnd6 $frame axstnd1 axstnd2 axstnd3 axstnd4 axstnd5 axstnd6
$frame axstnd7 axstnd8 axstnd9 axstnd10 axstnd11 axstnd12 $frame axstnd7 axstnd8 axstnd9 axstnd10 axstnd11 axstnd12
// //
// pain // pain
// //
@ -35,7 +27,6 @@ $frame axpain1 axpain2 axpain3 axpain4 axpain5 axpain6
$frame pain1 pain2 pain3 pain4 pain5 pain6 $frame pain1 pain2 pain3 pain4 pain5 pain6
// //
// death // death
// //
@ -77,7 +68,6 @@ $frame axattc1 axattc2 axattc3 axattc4 axattc5 axattc6
$frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6 $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
/* /*
============================================================================== ==============================================================================
PLAYER PLAYER
@ -128,10 +118,9 @@ void() player_run = [ $rockrun1, player_run ] {
self.walkframe = self.walkframe + 1; self.walkframe = self.walkframe + 1;
}; };
void() player_shot1 = [$shotatt1, player_shot2 ] {self.weaponframe = 1; void() player_shot1 = [$shotatt1, player_shot2 ] {self.weaponframe = 1;
self.effects = self.effects | EF_MUZZLEFLASH; self.effects = self.effects | EF_MUZZLEFLASH;
}; };
void() player_shot2 = [$shotatt2, player_shot3 ] {self.weaponframe = 2;}; void() player_shot2 = [$shotatt2, player_shot3 ] {self.weaponframe = 2;};
void() player_shot3 = [$shotatt3, player_shot4 ] {self.weaponframe = 3;}; void() player_shot3 = [$shotatt3, player_shot4 ] {self.weaponframe = 3;};
void() player_shot4 = [$shotatt4, player_shot5 ] {self.weaponframe = 4;}; void() player_shot4 = [$shotatt4, player_shot5 ] {self.weaponframe = 4;};
@ -158,7 +147,6 @@ void() player_axed2 = [$axattd2, player_axed3 ] {self.weaponframe = 6;};
void() player_axed3 = [$axattd3, player_axed4 ] {self.weaponframe = 7; W_FireAxe();}; void() player_axed3 = [$axattd3, player_axed4 ] {self.weaponframe = 7; W_FireAxe();};
void() player_axed4 = [$axattd4, player_run ] {self.weaponframe = 8;}; void() player_axed4 = [$axattd4, player_run ] {self.weaponframe = 8;};
//============================================================================ //============================================================================
void() player_nail1 = [$nailatt1, player_nail2 ] { void() player_nail1 = [$nailatt1, player_nail2 ] {
@ -227,10 +215,9 @@ void() player_light2 = [$light2, player_light1 ] {
//============================================================================ //============================================================================
void() player_rocket1 = [$rockatt1, player_rocket2 ] {self.weaponframe = 1; void() player_rocket1 = [$rockatt1, player_rocket2 ] {self.weaponframe = 1;
self.effects = self.effects | EF_MUZZLEFLASH; self.effects = self.effects | EF_MUZZLEFLASH;
}; };
void() player_rocket2 = [$rockatt2, player_rocket3 ] {self.weaponframe = 2;}; void() player_rocket2 = [$rockatt2, player_rocket3 ] {self.weaponframe = 2;};
void() player_rocket3 = [$rockatt3, player_rocket4 ] {self.weaponframe = 3;}; void() player_rocket3 = [$rockatt3, player_rocket4 ] {self.weaponframe = 3;};
void() player_rocket4 = [$rockatt4, player_rocket5 ] {self.weaponframe = 4;}; void() player_rocket4 = [$rockatt4, player_rocket5 ] {self.weaponframe = 4;};
@ -238,7 +225,7 @@ void() player_rocket5 = [$rockatt5, player_rocket6 ] {self.weaponframe = 5;};
void() player_rocket6 = [$rockatt6, player_run ] {self.weaponframe = 6;}; void() player_rocket6 = [$rockatt6, player_run ] {self.weaponframe = 6;};
void() PainSound = { void() PainSound = {
local float rs; float rs;
if(self.health < 0) { if(self.health < 0) {
return; return;
@ -295,7 +282,6 @@ void() PainSound = {
return; return;
} }
rs = rint((random() * 5) + 1); rs = rint((random() * 5) + 1);
self.noise = ""; self.noise = "";
@ -348,7 +334,7 @@ void() player_pain = {
}; };
void() DeathBubblesSpawn = { void() DeathBubblesSpawn = {
local entity bubble; entity bubble;
if(self.owner.waterlevel != 3) { if(self.owner.waterlevel != 3) {
return; return;
} }
@ -373,7 +359,7 @@ void() DeathBubblesSpawn = {
}; };
void(float num_bubbles) DeathBubbles = { void(float num_bubbles) DeathBubbles = {
local entity bubble_spawner; entity bubble_spawner;
bubble_spawner = spawn(); bubble_spawner = spawn();
setorigin(bubble_spawner, self.origin); setorigin(bubble_spawner, self.origin);
@ -387,9 +373,8 @@ void(float num_bubbles) DeathBubbles = {
return; return;
}; };
void() DeathSound = { void() DeathSound = {
local float rs; float rs;
// water death sounds // water death sounds
if(self.waterlevel == 3) { if(self.waterlevel == 3) {
@ -419,7 +404,6 @@ void() DeathSound = {
return; return;
}; };
void() PlayerDead = { void() PlayerDead = {
self.nextthink = -1; self.nextthink = -1;
// allow respawn after a certain time // allow respawn after a certain time
@ -427,7 +411,7 @@ void() PlayerDead = {
}; };
vector(float dm) VelocityForDamage = { vector(float dm) VelocityForDamage = {
local vector v; vector v;
v_x = 100 * crandom(); v_x = 100 * crandom();
v_y = 100 * crandom(); v_y = 100 * crandom();
@ -447,7 +431,7 @@ vector(float dm) VelocityForDamage = {
}; };
void(string gibname, float dm) ThrowGib = { void(string gibname, float dm) ThrowGib = {
local entity new; entity new;
new = spawn(); new = spawn();
new.origin = self.origin; new.origin = self.origin;
@ -481,7 +465,6 @@ void(string gibname, float dm) ThrowHead = {
self.avelocity = crandom() * '0 600 0'; self.avelocity = crandom() * '0 600 0';
}; };
void() GibPlayer = { void() GibPlayer = {
ThrowHead("progs/h_player.mdl", self.health); ThrowHead("progs/h_player.mdl", self.health);
ThrowGib("progs/gib1.mdl", self.health); ThrowGib("progs/gib1.mdl", self.health);
@ -508,7 +491,7 @@ void() GibPlayer = {
}; };
void() PlayerDie = { void() PlayerDie = {
local float i; float i;
self.items = self.items - (self.items & IT_INVISIBILITY); self.items = self.items - (self.items & IT_INVISIBILITY);
self.invisible_finished = 0; // don't die as eyes self.invisible_finished = 0; // don't die as eyes
@ -574,7 +557,6 @@ void() set_suicide_frame = {
self.nextthink = -1; self.nextthink = -1;
}; };
void() player_diea1 = [ $deatha1, player_diea2 ] {}; void() player_diea1 = [ $deatha1, player_diea2 ] {};
void() player_diea2 = [ $deatha2, player_diea3 ] {}; void() player_diea2 = [ $deatha2, player_diea3 ] {};
void() player_diea3 = [ $deatha3, player_diea4 ] {}; void() player_diea3 = [ $deatha3, player_diea4 ] {};

View File

@ -1,10 +1,5 @@
/* // shalrath.qc: Vore
==============================================================================
SHAL-RATH
==============================================================================
*/
$cd id1 / models / shalrath $cd id1 / models / shalrath
$origin 0 0 24 $origin 0 0 24
$base base $base base
@ -88,7 +83,6 @@ void() shal_death5 = [ $death5, shal_death6 ] {};
void() shal_death6 = [ $death6, shal_death7 ] {}; void() shal_death6 = [ $death6, shal_death7 ] {};
void() shal_death7 = [ $death7, shal_death7 ] {}; void() shal_death7 = [ $death7, shal_death7 ] {};
void() shalrath_pain = { void() shalrath_pain = {
if(self.pain_finished > time) { if(self.pain_finished > time) {
return; return;
@ -122,9 +116,9 @@ ShalMissile
================ ================
*/ */
void() ShalMissile = { void() ShalMissile = {
local entity missile; entity missile;
local vector dir; vector dir;
local float dist, flytime; float dist, flytime;
dir = normalize((self.enemy.origin + '0 0 10') - self.origin); dir = normalize((self.enemy.origin + '0 0 10') - self.origin);
dist = vlen(self.enemy.origin - self.origin); dist = vlen(self.enemy.origin - self.origin);
@ -155,7 +149,7 @@ void() ShalMissile = {
}; };
void() ShalHome = { void() ShalHome = {
local vector dir, vtemp; vector dir, vtemp;
vtemp = self.enemy.origin + '0 0 10'; vtemp = self.enemy.origin + '0 0 10';
if(self.enemy.health < 1) { if(self.enemy.health < 1) {
remove(self); remove(self);

View File

@ -1,10 +1,4 @@
/* // shambler.qc: Shambler
==============================================================================
SHAMBLER
==============================================================================
*/
$cd id1 / models / shams $cd id1 / models / shams
$origin 0 0 24 $origin 0 0 24
@ -69,7 +63,7 @@ void() sham_walk12 = [ $walk12, sham_walk1 ] {ai_walk(7);
if(random() > 0.8) { if(random() > 0.8) {
sound(self, CHAN_VOICE, "shambler/sidle.wav", 1, ATTN_IDLE); sound(self, CHAN_VOICE, "shambler/sidle.wav", 1, ATTN_IDLE);
} }
}; };
void() sham_run1 = [ $run1, sham_run2 ] {ai_run(20);}; void() sham_run1 = [ $run1, sham_run2 ] {ai_run(20);};
void() sham_run2 = [ $run2, sham_run3 ] {ai_run(24);}; void() sham_run2 = [ $run2, sham_run3 ] {ai_run(24);};
@ -80,7 +74,7 @@ void() sham_run6 = [ $run6, sham_run1 ] {ai_run(20);
if(random() > 0.8) { if(random() > 0.8) {
sound(self, CHAN_VOICE, "shambler/sidle.wav", 1, ATTN_IDLE); sound(self, CHAN_VOICE, "shambler/sidle.wav", 1, ATTN_IDLE);
} }
}; };
void() sham_smash1 = [ $smash1, sham_smash2 ] { void() sham_smash1 = [ $smash1, sham_smash2 ] {
sound(self, CHAN_VOICE, "shambler/melee1.wav", 1, ATTN_NORM); sound(self, CHAN_VOICE, "shambler/melee1.wav", 1, ATTN_NORM);
@ -95,8 +89,8 @@ void() sham_smash7 = [ $smash7, sham_smash8 ] {ai_charge(0);};
void() sham_smash8 = [ $smash8, sham_smash9 ] {ai_charge(0);}; void() sham_smash8 = [ $smash8, sham_smash9 ] {ai_charge(0);};
void() sham_smash9 = [ $smash9, sham_smash10 ] {ai_charge(0);}; void() sham_smash9 = [ $smash9, sham_smash10 ] {ai_charge(0);};
void() sham_smash10 = [ $smash10, sham_smash11 ] { void() sham_smash10 = [ $smash10, sham_smash11 ] {
local vector delta; vector delta;
local float ldmg; float ldmg;
if(!self.enemy) { if(!self.enemy) {
return; return;
@ -123,8 +117,8 @@ void() sham_smash11 = [ $smash11, sham_smash12 ] {ai_charge(5);};
void() sham_smash12 = [ $smash12, sham_run1 ] {ai_charge(4);}; void() sham_smash12 = [ $smash12, sham_run1 ] {ai_charge(4);};
void(float side) ShamClaw = { void(float side) ShamClaw = {
local vector delta; vector delta;
local float ldmg; float ldmg;
if(!self.enemy) { if(!self.enemy) {
return; return;
@ -181,10 +175,10 @@ void() sham_swingr9 = [ $swingr9, sham_run1 ] {ai_charge(1);
if(random() < 0.5) { if(random() < 0.5) {
self.think = sham_swingl1; self.think = sham_swingl1;
} }
}; };
void() sham_melee = { void() sham_melee = {
local float chance; float chance;
chance = random(); chance = random();
if(chance > 0.6 || self.health == 600) { if(chance > 0.6 || self.health == 600) {
@ -196,11 +190,10 @@ void() sham_melee = {
} }
}; };
//============================================================================ //============================================================================
void() CastLightning = { void() CastLightning = {
local vector org, dir; vector org, dir;
self.effects = self.effects | EF_MUZZLEFLASH; self.effects = self.effects | EF_MUZZLEFLASH;
@ -227,23 +220,23 @@ void() CastLightning = {
}; };
void() sham_magic1 = [ $magic1, sham_magic2 ] {ai_face(); void() sham_magic1 = [ $magic1, sham_magic2 ] {ai_face();
sound(self, CHAN_WEAPON, "shambler/sattck1.wav", 1, ATTN_NORM); sound(self, CHAN_WEAPON, "shambler/sattck1.wav", 1, ATTN_NORM);
}; };
void() sham_magic2 = [ $magic2, sham_magic3 ] {ai_face();}; void() sham_magic2 = [ $magic2, sham_magic3 ] {ai_face();};
void() sham_magic3 = [ $magic3, sham_magic4 ] {ai_face(); void() sham_magic3 = [ $magic3, sham_magic4 ] {ai_face();
self.nextthink = self.nextthink + 0.2; self.nextthink = self.nextthink + 0.2;
local entity o; entity o;
self.effects = self.effects | EF_MUZZLEFLASH; self.effects = self.effects | EF_MUZZLEFLASH;
ai_face(); ai_face();
self.owner = spawn(); self.owner = spawn();
o = self.owner; o = self.owner;
setmodel(o, "progs/s_light.mdl"); setmodel(o, "progs/s_light.mdl");
setorigin(o, self.origin); setorigin(o, self.origin);
o.angles = self.angles; o.angles = self.angles;
o.nextthink = time + 0.7; o.nextthink = time + 0.7;
o.think = SUB_Remove; o.think = SUB_Remove;
}; };
void() sham_magic4 = [ $magic4, sham_magic5 ] { void() sham_magic4 = [ $magic4, sham_magic5 ] {
self.effects = self.effects | EF_MUZZLEFLASH; self.effects = self.effects | EF_MUZZLEFLASH;
self.owner.frame = 1; self.owner.frame = 1;
@ -269,7 +262,6 @@ void() sham_magic11 = [ $magic11, sham_magic12 ] {
void() sham_magic12 = [ $magic12, sham_run1 ] {}; void() sham_magic12 = [ $magic12, sham_run1 ] {};
void() sham_pain1 = [ $pain1, sham_pain2 ] {}; void() sham_pain1 = [ $pain1, sham_pain2 ] {};
void() sham_pain2 = [ $pain2, sham_pain3 ] {}; void() sham_pain2 = [ $pain2, sham_pain3 ] {};
void() sham_pain3 = [ $pain3, sham_pain4 ] {}; void() sham_pain3 = [ $pain3, sham_pain4 ] {};
@ -296,7 +288,6 @@ void(entity attacker, float damage) sham_pain = {
sham_pain1(); sham_pain1();
}; };
//============================================================================ //============================================================================
void() sham_death1 = [ $death1, sham_death2 ] {}; void() sham_death1 = [ $death1, sham_death2 ] {};
@ -329,7 +320,6 @@ void() sham_die = {
//============================================================================ //============================================================================
/*QUAKED monster_shambler(1 0 0) (-32 -32 -24) (32 32 64) Ambush /*QUAKED monster_shambler(1 0 0) (-32 -32 -24) (32 32 64) Ambush
*/ */
void() monster_shambler = { void() monster_shambler = {

View File

@ -1,10 +1,4 @@
/* // soldier.qc: Grunt
==============================================================================
SOLDIER / PLAYER
==============================================================================
*/
$cd id1 / models / soldier3 $cd id1 / models / soldier3
$origin 0 - 6 24 $origin 0 - 6 24
@ -101,15 +95,14 @@ void() army_atk2 = [ $shoot2, army_atk3 ] {ai_face();};
void() army_atk3 = [ $shoot3, army_atk4 ] {ai_face();}; void() army_atk3 = [ $shoot3, army_atk4 ] {ai_face();};
void() army_atk4 = [ $shoot4, army_atk5 ] {ai_face();}; void() army_atk4 = [ $shoot4, army_atk5 ] {ai_face();};
void() army_atk5 = [ $shoot5, army_atk6 ] {ai_face(); void() army_atk5 = [ $shoot5, army_atk6 ] {ai_face();
army_fire(); army_fire();
self.effects = self.effects | EF_MUZZLEFLASH; self.effects = self.effects | EF_MUZZLEFLASH;
}; };
void() army_atk6 = [ $shoot6, army_atk7 ] {ai_face();}; void() army_atk6 = [ $shoot6, army_atk7 ] {ai_face();};
void() army_atk7 = [ $shoot7, army_atk8 ] {ai_face(); SUB_CheckRefire(army_atk1);}; void() army_atk7 = [ $shoot7, army_atk8 ] {ai_face(); SUB_CheckRefire(army_atk1);};
void() army_atk8 = [ $shoot8, army_atk9 ] {ai_face();}; void() army_atk8 = [ $shoot8, army_atk9 ] {ai_face();};
void() army_atk9 = [ $shoot9, army_run1 ] {ai_face();}; void() army_atk9 = [ $shoot9, army_run1 ] {ai_face();};
void() army_pain1 = [ $pain1, army_pain2 ] {}; void() army_pain1 = [ $pain1, army_pain2 ] {};
void() army_pain2 = [ $pain2, army_pain3 ] {}; void() army_pain2 = [ $pain2, army_pain3 ] {};
void() army_pain3 = [ $pain3, army_pain4 ] {}; void() army_pain3 = [ $pain3, army_pain4 ] {};
@ -147,7 +140,7 @@ void() army_painc12 = [ $painc12, army_painc13] {ai_painforward(8);};
void() army_painc13 = [ $painc13, army_run1] {}; void() army_painc13 = [ $painc13, army_run1] {};
void(entity attacker, float damage) army_pain = { void(entity attacker, float damage) army_pain = {
local float r; float r;
if(self.pain_finished > time) { if(self.pain_finished > time) {
return; return;
@ -170,10 +163,9 @@ void(entity attacker, float damage) army_pain = {
} }
}; };
void() army_fire = { void() army_fire = {
local vector dir; vector dir;
local entity en; entity en;
ai_face(); ai_face();
@ -189,7 +181,6 @@ void() army_fire = {
}; };
void() army_die1 = [ $death1, army_die2 ] {}; void() army_die1 = [ $death1, army_die2 ] {};
void() army_die2 = [ $death2, army_die3 ] {}; void() army_die2 = [ $death2, army_die3 ] {};
void() army_die3 = [ $death3, army_die4 ] void() army_die3 = [ $death3, army_die4 ]
@ -215,7 +206,6 @@ void() army_cdie9 = [ $deathc9, army_cdie10 ] {};
void() army_cdie10 = [ $deathc10, army_cdie11 ] {}; void() army_cdie10 = [ $deathc10, army_cdie11 ] {};
void() army_cdie11 = [ $deathc11, army_cdie11 ] {}; void() army_cdie11 = [ $deathc11, army_cdie11 ] {};
void() army_die = { void() army_die = {
// check for gib // check for gib
if(self.health < -35) { if(self.health < -35) {
@ -236,7 +226,6 @@ void() army_die = {
} }
}; };
/*QUAKED monster_army(1 0 0) (-16 -16 -24) (16 16 40) Ambush /*QUAKED monster_army(1 0 0) (-16 -16 -24) (16 16 40) Ambush
*/ */
void() monster_army = { void() monster_army = {
@ -259,7 +248,6 @@ void() monster_army = {
precache_sound("player/udeath.wav"); // gib death precache_sound("player/udeath.wav"); // gib death
self.solid = SOLID_SLIDEBOX; self.solid = SOLID_SLIDEBOX;
self.movetype = MOVETYPE_STEP; self.movetype = MOVETYPE_STEP;

View File

@ -1,5 +1,4 @@
// sprites.qc: sprite information
// these are the only sprites still in the game...
$spritename s_explod $spritename s_explod
$type vp_parallel $type vp_parallel
@ -11,14 +10,12 @@ $frame 24 88 56 56
$frame 120 88 56 56 $frame 120 88 56 56
$frame 216 88 56 56 $frame 216 88 56 56
$spritename s_bubble $spritename s_bubble
$type vp_parallel $type vp_parallel
$load id1 / gfx / sprites / bubble.lbm $load id1 / gfx / sprites / bubble.lbm
$frame 16 16 16 16 $frame 16 16 16 16
$frame 40 16 16 16 $frame 40 16 16 16
$spritename s_light $spritename s_light
$type vp_parallel $type vp_parallel
$load id1 / gfx / sprites / light.lbm $load id1 / gfx / sprites / light.lbm

View File

@ -1,10 +1,9 @@
// subs.qc: subroutines for think frames
void() SUB_Null = {}; 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 QuakeEd only writes a single float for angles(bad idea), so up and down are
just constant angles. just constant angles.
@ -49,7 +48,7 @@ self.origin traveling at speed
=============== ===============
*/ */
void(entity ent, vector tdest, float tspeed, void() func) SUB_CalcMoveEnt = { void(entity ent, vector tdest, float tspeed, void() func) SUB_CalcMoveEnt = {
local entity stemp; entity stemp;
stemp = self; stemp = self;
self = ent; self = ent;
@ -58,8 +57,8 @@ void(entity ent, vector tdest, float tspeed, void() func) SUB_CalcMoveEnt = {
}; };
void(vector tdest, float tspeed, void() func) SUB_CalcMove = { void(vector tdest, float tspeed, void() func) SUB_CalcMove = {
local vector vdestdelta; vector vdestdelta;
local float len, traveltime; float len, traveltime;
if(!tspeed) { if(!tspeed) {
objerror("No speed is defined!"); objerror("No speed is defined!");
@ -111,7 +110,6 @@ void() SUB_CalcMoveDone = {
} }
}; };
/* /*
============= =============
SUB_CalcAngleMove SUB_CalcAngleMove
@ -123,7 +121,7 @@ The calling function should make sure self.think is valid
=============== ===============
*/ */
void(entity ent, vector destangle, float tspeed, void() func) SUB_CalcAngleMoveEnt = { void(entity ent, vector destangle, float tspeed, void() func) SUB_CalcAngleMoveEnt = {
local entity stemp; entity stemp;
stemp = self; stemp = self;
self = ent; self = ent;
SUB_CalcAngleMove(destangle, tspeed, func); SUB_CalcAngleMove(destangle, tspeed, func);
@ -131,8 +129,8 @@ void(entity ent, vector destangle, float tspeed, void() func) SUB_CalcAngleMoveE
}; };
void(vector destangle, float tspeed, void() func) SUB_CalcAngleMove = { void(vector destangle, float tspeed, void() func) SUB_CalcAngleMove = {
local vector destdelta; vector destdelta;
local float len, traveltime; float len, traveltime;
if(!tspeed) { if(!tspeed) {
objerror("No speed is defined!"); objerror("No speed is defined!");
@ -172,7 +170,6 @@ void() SUB_CalcAngleMoveDone = {
} }
}; };
//============================================================================= //=============================================================================
void() DelayThink = { void() DelayThink = {
@ -201,7 +198,7 @@ match(string)self.target and call their .use function
============================== ==============================
*/ */
void() SUB_UseTargets = { void() SUB_UseTargets = {
local entity t, stemp, otemp, act; entity t, stemp, otemp, act;
// //
// check for a delay // check for a delay
@ -219,7 +216,6 @@ void() SUB_UseTargets = {
return; return;
} }
// //
// print the message // print the message
// //
@ -270,10 +266,8 @@ void() SUB_UseTargets = {
} while(1); } while(1);
} }
}; };
/* /*
in nightmare mode, all attack_finished times become 0 in nightmare mode, all attack_finished times become 0

View File

@ -1,10 +1,4 @@
/* // tarbaby.qc: Spawn
==============================================================================
BLOB
==============================================================================
*/
$cd id1 / models / tarbaby $cd id1 / models / tarbaby
$origin 0 0 24 $origin 0 0 24
@ -82,12 +76,10 @@ void() tbaby_run23 = [ $run23, tbaby_run24 ] {ai_run(2);};
void() tbaby_run24 = [ $run24, tbaby_run25 ] {ai_run(2);}; void() tbaby_run24 = [ $run24, tbaby_run25 ] {ai_run(2);};
void() tbaby_run25 = [ $run25, tbaby_run1 ] {ai_run(2);}; void() tbaby_run25 = [ $run25, tbaby_run1 ] {ai_run(2);};
//============================================================================ //============================================================================
void() Tar_JumpTouch = { void() Tar_JumpTouch = {
local float ldmg; float ldmg;
if(other.takedamage && other.classname != self.classname) { if(other.takedamage && other.classname != self.classname) {
if(vlen(self.velocity) > 400) { if(vlen(self.velocity) > 400) {
@ -99,7 +91,6 @@ void() Tar_JumpTouch = {
sound(self, CHAN_WEAPON, "blob/land1.wav", 1, ATTN_NORM); sound(self, CHAN_WEAPON, "blob/land1.wav", 1, ATTN_NORM);
} }
if(!checkbottom(self)) { if(!checkbottom(self)) {
if(self.flags & FL_ONGROUND) { if(self.flags & FL_ONGROUND) {
// jump randomly to not get hung up // jump randomly to not get hung up
@ -151,7 +142,6 @@ void() tbaby_jump5 = [ $jump5, tbaby_jump6 ] {
void() tbaby_jump6 = [ $jump6, tbaby_fly1 ] {}; void() tbaby_jump6 = [ $jump6, tbaby_fly1 ] {};
//============================================================================= //=============================================================================
void() tbaby_die1 = [ $exp, tbaby_die2 ] { void() tbaby_die1 = [ $exp, tbaby_die2 ] {
@ -174,7 +164,6 @@ void() tbaby_die2 = [ $exp, tbaby_run1 ] {
//============================================================================= //=============================================================================
/*QUAKED monster_tarbaby(1 0 0) (-16 -16 -24) (16 16 24) Ambush /*QUAKED monster_tarbaby(1 0 0) (-16 -16 -24) (16 16 24) Ambush
*/ */
void() monster_tarbaby = { void() monster_tarbaby = {

View File

@ -1,3 +1,4 @@
// triggers.qc: triggerable entities
void() trigger_reactivate = { void() trigger_reactivate = {
self.solid = SOLID_TRIGGER; self.solid = SOLID_TRIGGER;
@ -22,7 +23,6 @@ void() multi_wait = {
} }
}; };
// the trigger was just touched/killed/used // 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 // so wait for the delay time before firing
@ -137,7 +137,6 @@ void() trigger_multiple = {
} }
}; };
/*QUAKED trigger_once(.5 .5 .5) ? notouch /*QUAKED trigger_once(.5 .5 .5) ? notouch
Variable sized trigger. Triggers once, then removes itself. You must set the key "target" to the name of another object in the level that has a matching Variable sized trigger. Triggers once, then removes itself. You must set the key "target" to the name of another object in the level that has a matching
"targetname". If "health" is set, the trigger must be killed to activate. "targetname". If "health" is set, the trigger must be killed to activate.
@ -165,7 +164,6 @@ void() trigger_relay = {
self.use = SUB_UseTargets; self.use = SUB_UseTargets;
}; };
//============================================================================= //=============================================================================
/*QUAKED trigger_secret(.5 .5 .5) ? /*QUAKED trigger_secret(.5 .5 .5) ?
@ -200,9 +198,8 @@ void() trigger_secret = {
//============================================================================= //=============================================================================
void() counter_use = { void() counter_use = {
local string junk; string junk;
self.count = self.count - 1; self.count = self.count - 1;
if(self.count < 0) { if(self.count < 0) {
@ -249,7 +246,6 @@ void() trigger_counter = {
self.use = counter_use; self.use = counter_use;
}; };
/* /*
============================================================================== ==============================================================================
@ -264,8 +260,8 @@ enum {
}; };
void() play_teleport = { void() play_teleport = {
local float v; float v;
local string tmpstr; string tmpstr;
v = random() * 5; v = random() * 5;
if(v < 1) { if(v < 1) {
@ -285,7 +281,7 @@ void() play_teleport = {
}; };
void(vector org) spawn_tfog = { void(vector org) spawn_tfog = {
local entity s; entity s;
s = spawn(); s = spawn();
s.origin = org; s.origin = org;
@ -299,7 +295,6 @@ void(vector org) spawn_tfog = {
WriteCoord(MSG_BROADCAST, org_z); WriteCoord(MSG_BROADCAST, org_z);
}; };
void() tdeath_touch = { void() tdeath_touch = {
if(other == self.owner) { if(other == self.owner) {
return; return;
@ -322,9 +317,8 @@ void() tdeath_touch = {
} }
}; };
void(vector org, entity death_owner) spawn_tdeath = { void(vector org, entity death_owner) spawn_tdeath = {
local entity death; entity death;
death = spawn(); death = spawn();
death.classname = "teledeath"; death.classname = "teledeath";
@ -342,8 +336,8 @@ void(vector org, entity death_owner) spawn_tdeath = {
}; };
void() teleport_touch = { void() teleport_touch = {
local entity t; entity t;
local vector org; vector org;
if(self.targetname) { if(self.targetname) {
if(self.nextthink < time) { if(self.nextthink < time) {
@ -425,7 +419,7 @@ Any object touching this will be transported to the corresponding info_teleport_
If the trigger_teleport has a targetname, it will only teleport entities when it has been fired. If the trigger_teleport has a targetname, it will only teleport entities when it has been fired.
*/ */
void() trigger_teleport = { void() trigger_teleport = {
local vector o; vector o;
InitTrigger(); InitTrigger();
self.touch = teleport_touch; self.touch = teleport_touch;
@ -467,7 +461,6 @@ void() trigger_setskill = {
self.touch = trigger_skill_touch; self.touch = trigger_skill_touch;
}; };
/* /*
============================================================================== ==============================================================================
@ -560,7 +553,6 @@ void() trigger_push_touch = {
} }
}; };
/*QUAKED trigger_push(.5 .5 .5) ? PUSH_ONCE /*QUAKED trigger_push(.5 .5 .5) ? PUSH_ONCE
Pushes the player Pushes the player
*/ */

View File

@ -1,3 +1,5 @@
// weapons.qc: weapon functions
// called by worldspawn // called by worldspawn
void() W_Precache = { void() W_Precache = {
precache_sound("weapons/r_exp3.wav"); // new rocket explosion precache_sound("weapons/r_exp3.wav"); // new rocket explosion
@ -24,8 +26,8 @@ W_FireAxe
================ ================
*/ */
void() W_FireAxe = { void() W_FireAxe = {
local vector source; vector source;
local vector org; vector org;
makevectors(self.v_angle); makevectors(self.v_angle);
source = self.origin + '0 0 16'; source = self.origin + '0 0 16';
@ -51,12 +53,10 @@ void() W_FireAxe = {
} }
}; };
//============================================================================ //============================================================================
vector() wall_velocity = { vector() wall_velocity = {
local vector vel; vector vel;
vel = normalize(self.velocity); vel = normalize(self.velocity);
vel = normalize(vel + v_up * (random() - 0.5) + v_right * (random() - 0.5)); vel = normalize(vel + v_up * (random() - 0.5) + v_right * (random() - 0.5));
@ -66,15 +66,14 @@ vector() wall_velocity = {
return vel; return vel;
}; };
/* /*
================ ================
SpawnMeatSpray SpawnMeatSpray
================ ================
*/ */
void(vector org, vector vel) SpawnMeatSpray = { void(vector org, vector vel) SpawnMeatSpray = {
local entity missile, mpuff; entity missile, mpuff;
local vector org; vector org;
missile = spawn(); missile = spawn();
missile.owner = self; missile.owner = self;
@ -112,13 +111,12 @@ spawn_touchblood
================ ================
*/ */
void(float damage) spawn_touchblood = { void(float damage) spawn_touchblood = {
local vector vel; vector vel;
vel = wall_velocity() * 0.2; vel = wall_velocity() * 0.2;
SpawnBlood(self.origin + vel * 0.01, vel, damage); SpawnBlood(self.origin + vel * 0.01, vel, damage);
}; };
/* /*
================ ================
SpawnChunk SpawnChunk
@ -138,9 +136,6 @@ Collects multiple small damages into a single damage
============================================================================== ==============================================================================
*/ */
entity multi_ent;
float multi_damage;
void() ClearMultiDamage = { void() ClearMultiDamage = {
multi_ent = world; multi_ent = world;
multi_damage = 0; multi_damage = 0;
@ -181,7 +176,7 @@ TraceAttack
================ ================
*/ */
void(float damage, vector dir) TraceAttack = { void(float damage, vector dir) TraceAttack = {
local vector vel, org; vector vel, org;
vel = normalize(dir + v_up * crandom() + v_right * crandom()); vel = normalize(dir + v_up * crandom() + v_right * crandom());
vel = vel + 2 * trace_plane_normal; vel = vel + 2 * trace_plane_normal;
@ -210,8 +205,8 @@ Go to the trouble of combining multiple pellets into a single damage call.
================ ================
*/ */
void(float shotcount, vector dir, vector spread) FireBullets = { void(float shotcount, vector dir, vector spread) FireBullets = {
local vector direction; vector direction;
local vector src; vector src;
makevectors(self.v_angle); makevectors(self.v_angle);
@ -236,7 +231,7 @@ W_FireShotgun
================ ================
*/ */
void() W_FireShotgun = { void() W_FireShotgun = {
local vector dir; vector dir;
sound(self, CHAN_WEAPON, "weapons/guncock.wav", 1, ATTN_NORM); sound(self, CHAN_WEAPON, "weapons/guncock.wav", 1, ATTN_NORM);
@ -247,14 +242,13 @@ void() W_FireShotgun = {
FireBullets(6, dir, '0.04 0.04 0'); FireBullets(6, dir, '0.04 0.04 0');
}; };
/* /*
================ ================
W_FireSuperShotgun W_FireSuperShotgun
================ ================
*/ */
void() W_FireSuperShotgun = { void() W_FireSuperShotgun = {
local vector dir; vector dir;
if(self.currentammo == 1) { if(self.currentammo == 1) {
W_FireShotgun(); W_FireShotgun();
@ -270,7 +264,6 @@ void() W_FireSuperShotgun = {
FireBullets(14, dir, '0.14 0.08 0'); FireBullets(14, dir, '0.14 0.08 0');
}; };
/* /*
============================================================================== ==============================================================================
@ -296,7 +289,7 @@ void() BecomeExplosion = {
}; };
void() T_MissileTouch = { void() T_MissileTouch = {
local float damg; float damg;
if(other == self.owner) { if(other == self.owner) {
return; // don't explode on owner return; // don't explode on owner
@ -333,14 +326,13 @@ void() T_MissileTouch = {
}; };
/* /*
================ ================
W_FireRocket W_FireRocket
================ ================
*/ */
void() W_FireRocket = { void() W_FireRocket = {
local entity missile, mpuff; entity missile, mpuff;
self.currentammo = self.ammo_rockets = self.ammo_rockets - 1; self.currentammo = self.ammo_rockets = self.ammo_rockets - 1;
@ -386,8 +378,8 @@ LightningDamage
================= =================
*/ */
void(vector p1, vector p2, entity from, float damage) LightningDamage = { void(vector p1, vector p2, entity from, float damage) LightningDamage = {
local entity e1, e2; entity e1, e2;
local vector f; vector f;
f = p2 - p1; f = p2 - p1;
normalize(f); normalize(f);
@ -424,10 +416,9 @@ void(vector p1, vector p2, entity from, float damage) LightningDamage = {
} }
}; };
void() W_FireLightning = { void() W_FireLightning = {
local vector org; vector org;
local float cells; float cells;
if(self.ammo_cells < 1) { if(self.ammo_cells < 1) {
self.weapon = W_BestWeapon(); self.weapon = W_BestWeapon();
@ -469,10 +460,8 @@ void() W_FireLightning = {
LightningDamage(self.origin, trace_endpos + v_forward * 4, self, 30); LightningDamage(self.origin, trace_endpos + v_forward * 4, self, 30);
}; };
//============================================================================= //=============================================================================
void() GrenadeExplode = { void() GrenadeExplode = {
T_RadiusDamage(self, self.owner, 120, world); T_RadiusDamage(self, self.owner, 120, world);
@ -505,7 +494,7 @@ W_FireGrenade
================ ================
*/ */
void() W_FireGrenade = { void() W_FireGrenade = {
local entity missile, mpuff; entity missile, mpuff;
self.currentammo = self.ammo_rockets = self.ammo_rockets - 1; self.currentammo = self.ammo_rockets = self.ammo_rockets - 1;
@ -546,10 +535,8 @@ void() W_FireGrenade = {
setorigin(missile, self.origin); setorigin(missile, self.origin);
}; };
//============================================================================= //=============================================================================
/* /*
=============== ===============
launch_spike launch_spike
@ -577,8 +564,8 @@ void(vector org, vector dir) launch_spike = {
}; };
void() W_FireSuperSpikes = { void() W_FireSuperSpikes = {
local vector dir; vector dir;
local entity old; entity old;
sound(self, CHAN_WEAPON, "weapons/spike2.wav", 1, ATTN_NORM); sound(self, CHAN_WEAPON, "weapons/spike2.wav", 1, ATTN_NORM);
self.attack_finished = time + 0.2; self.attack_finished = time + 0.2;
@ -592,8 +579,8 @@ void() W_FireSuperSpikes = {
}; };
void(float ox) W_FireSpikes = { void(float ox) W_FireSpikes = {
local vector dir; vector dir;
local entity old; entity old;
makevectors(self.v_angle); makevectors(self.v_angle);
@ -617,11 +604,8 @@ void(float ox) W_FireSpikes = {
self.punchangle_x = -2; self.punchangle_x = -2;
}; };
.float hit_z;
void() spike_touch = { void() spike_touch = {
local float rand; float rand;
if(other == self.owner) { if(other == self.owner) {
return; return;
} }
@ -658,7 +642,7 @@ void() spike_touch = {
}; };
void() superspike_touch = { void() superspike_touch = {
local float rand; float rand;
if(other == self.owner) { if(other == self.owner) {
return; return;
} }
@ -688,7 +672,6 @@ void() superspike_touch = {
}; };
/* /*
=============================================================================== ===============================================================================
@ -749,7 +732,7 @@ void() W_SetCurrentAmmo = {
}; };
float() W_BestWeapon = { float() W_BestWeapon = {
local float it; float it;
it = self.items; it = self.items;
@ -796,7 +779,7 @@ An attack impulse can be triggered now
============ ============
*/ */
void() W_Attack = { void() W_Attack = {
local float r; float r;
if(!W_CheckNoAmmo()) { if(!W_CheckNoAmmo()) {
return; return;
@ -852,7 +835,7 @@ W_ChangeWeapon
============ ============
*/ */
void() W_ChangeWeapon = { void() W_ChangeWeapon = {
local float it, am, fl; float it, am, fl;
it = self.items; it = self.items;
am = 0; am = 0;
@ -956,7 +939,7 @@ Go to the next weapon with ammo
============ ============
*/ */
void() CycleWeaponCommand = { void() CycleWeaponCommand = {
local float it, am; float it, am;
it = self.items; it = self.items;
self.impulse = 0; self.impulse = 0;
@ -1017,7 +1000,7 @@ Go to the prev weapon with ammo
============ ============
*/ */
void() CycleWeaponReverseCommand = { void() CycleWeaponReverseCommand = {
local float it, am; float it, am;
it = self.items; it = self.items;
self.impulse = 0; self.impulse = 0;
@ -1160,4 +1143,3 @@ void() SuperDamageSound = {
return; return;
}; };

View File

@ -1,10 +1,4 @@
/* // wizard.qc: Scrag
==============================================================================
WIZARD
==============================================================================
*/
$cd id1 / models / a_wizard $cd id1 / models / a_wizard
$origin 0 0 24 $origin 0 0 24
@ -45,8 +39,8 @@ if self.enemy maintains it's current velocity
============= =============
*/ */
void(entity missile, float mspeed, float accuracy) LaunchMissile = { void(entity missile, float mspeed, float accuracy) LaunchMissile = {
local vector vec, move; vector vec, move;
local float fly; float fly;
makevectors(self.angles); makevectors(self.angles);
@ -76,16 +70,15 @@ void(entity missile, float mspeed, float accuracy) LaunchMissile = {
missile.think = SUB_Remove; missile.think = SUB_Remove;
}; };
/* /*
================= =================
WizardCheckAttack WizardCheckAttack
================= =================
*/ */
float() WizardCheckAttack = { float() WizardCheckAttack = {
local vector spot1, spot2; vector spot1, spot2;
local entity targ; entity targ;
local float chance; float chance;
if(time < self.attack_finished) { if(time < self.attack_finished) {
return FALSE; return FALSE;
@ -173,8 +166,8 @@ FAST ATTACKS
*/ */
void() Wiz_FastFire = { void() Wiz_FastFire = {
local vector vec; vector vec;
local vector dst; vector dst;
if(self.owner.health > 0) { if(self.owner.health > 0) {
self.owner.effects = self.owner.effects | EF_MUZZLEFLASH; self.owner.effects = self.owner.effects | EF_MUZZLEFLASH;
@ -193,9 +186,8 @@ void() Wiz_FastFire = {
remove(self); remove(self);
}; };
void() Wiz_StartFast = { void() Wiz_StartFast = {
local entity missile; entity missile;
sound(self, CHAN_WEAPON, "wizard/wattack.wav", 1, ATTN_NORM); sound(self, CHAN_WEAPON, "wizard/wattack.wav", 1, ATTN_NORM);
self.v_angle = self.angles; self.v_angle = self.angles;
@ -223,9 +215,8 @@ void() Wiz_StartFast = {
}; };
void() Wiz_idlesound = { void() Wiz_idlesound = {
local float wr; float wr;
wr = random() * 5; wr = random() * 5;
if(self.waitmin < time) { if(self.waitmin < time) {
@ -250,8 +241,8 @@ void() wiz_stand7 = [ $hover7, wiz_stand8 ] {ai_stand();};
void() wiz_stand8 = [ $hover8, wiz_stand1 ] {ai_stand();}; void() wiz_stand8 = [ $hover8, wiz_stand1 ] {ai_stand();};
void() wiz_walk1 = [ $hover1, wiz_walk2 ] {ai_walk(8); void() wiz_walk1 = [ $hover1, wiz_walk2 ] {ai_walk(8);
Wiz_idlesound(); Wiz_idlesound();
}; };
void() wiz_walk2 = [ $hover2, wiz_walk3 ] {ai_walk(8);}; void() wiz_walk2 = [ $hover2, wiz_walk3 ] {ai_walk(8);};
void() wiz_walk3 = [ $hover3, wiz_walk4 ] {ai_walk(8);}; void() wiz_walk3 = [ $hover3, wiz_walk4 ] {ai_walk(8);};
void() wiz_walk4 = [ $hover4, wiz_walk5 ] {ai_walk(8);}; void() wiz_walk4 = [ $hover4, wiz_walk5 ] {ai_walk(8);};
@ -261,8 +252,8 @@ void() wiz_walk7 = [ $hover7, wiz_walk8 ] {ai_walk(8);};
void() wiz_walk8 = [ $hover8, wiz_walk1 ] {ai_walk(8);}; void() wiz_walk8 = [ $hover8, wiz_walk1 ] {ai_walk(8);};
void() wiz_side1 = [ $hover1, wiz_side2 ] {ai_run(8); void() wiz_side1 = [ $hover1, wiz_side2 ] {ai_run(8);
Wiz_idlesound(); Wiz_idlesound();
}; };
void() wiz_side2 = [ $hover2, wiz_side3 ] {ai_run(8);}; void() wiz_side2 = [ $hover2, wiz_side3 ] {ai_run(8);};
void() wiz_side3 = [ $hover3, wiz_side4 ] {ai_run(8);}; void() wiz_side3 = [ $hover3, wiz_side4 ] {ai_run(8);};
void() wiz_side4 = [ $hover4, wiz_side5 ] {ai_run(8);}; void() wiz_side4 = [ $hover4, wiz_side5 ] {ai_run(8);};
@ -272,8 +263,8 @@ void() wiz_side7 = [ $hover7, wiz_side8 ] {ai_run(8);};
void() wiz_side8 = [ $hover8, wiz_side1 ] {ai_run(8);}; void() wiz_side8 = [ $hover8, wiz_side1 ] {ai_run(8);};
void() wiz_run1 = [ $fly1, wiz_run2 ] {ai_run(16); void() wiz_run1 = [ $fly1, wiz_run2 ] {ai_run(16);
Wiz_idlesound(); Wiz_idlesound();
}; };
void() wiz_run2 = [ $fly2, wiz_run3 ] {ai_run(16);}; void() wiz_run2 = [ $fly2, wiz_run3 ] {ai_run(16);};
void() wiz_run3 = [ $fly3, wiz_run4 ] {ai_run(16);}; void() wiz_run3 = [ $fly3, wiz_run4 ] {ai_run(16);};
void() wiz_run4 = [ $fly4, wiz_run5 ] {ai_run(16);}; void() wiz_run4 = [ $fly4, wiz_run5 ] {ai_run(16);};
@ -334,7 +325,6 @@ void() wiz_die = {
wiz_death1(); wiz_death1();
}; };
void(entity attacker, float damage) Wiz_Pain = { void(entity attacker, float damage) Wiz_Pain = {
sound(self, CHAN_VOICE, "wizard/wpain.wav", 1, ATTN_NORM); sound(self, CHAN_VOICE, "wizard/wpain.wav", 1, ATTN_NORM);
if(random() * 70 > damage) { if(random() * 70 > damage) {
@ -344,7 +334,6 @@ void(entity attacker, float damage) Wiz_Pain = {
wiz_pain1(); wiz_pain1();
}; };
void() Wiz_Missile = { void() Wiz_Missile = {
wiz_fast1(); wiz_fast1();
}; };

View File

@ -1,3 +1,5 @@
// world.qc: basic entry point functions
void() main = { void() main = {
dprint("main function\n"); dprint("main function\n");
@ -149,9 +151,6 @@ void() main = {
precache_file2("maps/dm6.bsp"); precache_file2("maps/dm6.bsp");
}; };
entity lastspawn;
//======================= //=======================
/*QUAKED worldspawn(0 0 0) ? /*QUAKED worldspawn(0 0 0) ?
Only used for the world entity. Only used for the world entity.
@ -283,7 +282,6 @@ void() worldspawn = {
precache_model("progs/v_light.mdl"); precache_model("progs/v_light.mdl");
// //
// Setup light animation tables. 'a' is total darkness, 'z' is maxbright. // Setup light animation tables. 'a' is total darkness, 'z' is maxbright.
// //
@ -344,15 +342,13 @@ BODY QUE
============================================================================== ==============================================================================
*/ */
entity bodyque_head;
void() bodyque = { void() bodyque = {
// just here so spawn functions don't complain after the world // just here so spawn functions don't complain after the world
// creates bodyques // creates bodyques
}; };
void() InitBodyQue = { void() InitBodyQue = {
local entity e; entity e;
bodyque_head = spawn(); bodyque_head = spawn();
bodyque_head.classname = "bodyque"; bodyque_head.classname = "bodyque";
@ -365,7 +361,6 @@ void() InitBodyQue = {
bodyque_head.owner.owner.owner.owner = bodyque_head; bodyque_head.owner.owner.owner.owner = bodyque_head;
}; };
// make a body que entry for the given ent so the ent can be // make a body que entry for the given ent so the ent can be
// respawned elsewhere // respawned elsewhere
void(entity ent) CopyToBodyQue = { void(entity ent) CopyToBodyQue = {
@ -382,4 +377,3 @@ void(entity ent) CopyToBodyQue = {
bodyque_head = bodyque_head.owner; bodyque_head = bodyque_head.owner;
}; };

View File

@ -1,10 +1,5 @@
/* // zombie.qc: Zombie
==============================================================================
ZOMBIE
==============================================================================
*/
$cd id1 / models / zombie $cd id1 / models / zombie
$origin 0 0 24 $origin 0 0 24
@ -56,8 +51,6 @@ enum {
//============================================================================= //=============================================================================
.float inpain;
void() zombie_stand1 = [ $stand1, zombie_stand2 ] {ai_stand();}; void() zombie_stand1 = [ $stand1, zombie_stand2 ] {ai_stand();};
void() zombie_stand2 = [ $stand2, zombie_stand3 ] {ai_stand();}; void() zombie_stand2 = [ $stand2, zombie_stand3 ] {ai_stand();};
void() zombie_stand3 = [ $stand3, zombie_stand4 ] {ai_stand();}; void() zombie_stand3 = [ $stand3, zombie_stand4 ] {ai_stand();};
@ -167,8 +160,8 @@ ZombieFireGrenade
================ ================
*/ */
void(vector st) ZombieFireGrenade = { void(vector st) ZombieFireGrenade = {
local entity missile, mpuff; entity missile, mpuff;
local vector org; vector org;
sound(self, CHAN_WEAPON, "zombie/z_shot1.wav", 1, ATTN_NORM); sound(self, CHAN_WEAPON, "zombie/z_shot1.wav", 1, ATTN_NORM);
@ -201,7 +194,6 @@ void(vector st) ZombieFireGrenade = {
setorigin(missile, org); setorigin(missile, org);
}; };
void() zombie_atta1 = [ $atta1, zombie_atta2 ] {ai_face();}; void() zombie_atta1 = [ $atta1, zombie_atta2 ] {ai_face();};
void() zombie_atta2 = [ $atta2, zombie_atta3 ] {ai_face();}; void() zombie_atta2 = [ $atta2, zombie_atta3 ] {ai_face();};
void() zombie_atta3 = [ $atta3, zombie_atta4 ] {ai_face();}; void() zombie_atta3 = [ $atta3, zombie_atta4 ] {ai_face();};
@ -245,7 +237,7 @@ void() zombie_attc11 = [ $attc11, zombie_attc12 ] {ai_face();};
void() zombie_attc12 = [ $attc12, zombie_run1 ] {ai_face(); ZombieFireGrenade('-12 -19 29');}; void() zombie_attc12 = [ $attc12, zombie_run1 ] {ai_face(); ZombieFireGrenade('-12 -19 29');};
void() zombie_missile = { void() zombie_missile = {
local float r; float r;
r = random(); r = random();
@ -258,7 +250,6 @@ void() zombie_missile = {
} }
}; };
/* /*
============================================================================= =============================================================================
@ -417,7 +408,7 @@ FIXME: don't use pain_finished because of nightmare hack
================= =================
*/ */
void(entity attacker, float take) zombie_pain = { void(entity attacker, float take) zombie_pain = {
local float r; float r;
self.health = 60; // allways reset health self.health = 60; // allways reset health

5
todo
View File

@ -1,3 +1,8 @@
refactoring:
add expansion pack entities
rename all functions to be lower_underscore
core features: core features:
custom pronouns custom pronouns