Compare commits

..

3 Commits

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 = s.gsub /\b(\w+) \(/, '\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
30.times do s = s.gsub(/ /, ' ') end
puts s

View File

@ -1,21 +1,23 @@
progs.dat
source/defs.qc
source/subs.qc
source/fight.qc
source/subs.qc
source/ai.qc
source/buttons.qc
source/client.qc
source/combat.qc
source/doors.qc
source/items.qc
source/misc.qc
source/monsters.qc
source/plats.qc
source/player.qc
source/triggers.qc
source/weapons.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/demon.qc

View File

@ -1,38 +1,10 @@
/*
.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
*/
// ai.qc: monster AI functions
//
// 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
// will wake up even if they wouldn't have noticed the player
//
entity sight_entity;
float sight_entity_time;
float(float v) anglemod = {
while(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 = {
if(!self.targetname) {
objerror("monster_movetarget: no targetname");
@ -81,7 +52,6 @@ void() path_corner = {
movetarget_f();
};
/*
=============
t_movetarget
@ -91,7 +61,7 @@ moving towards it, change the next destination and continue.
==============
*/
void() t_movetarget = {
local entity temp;
entity temp;
if(other.movetarget != self) {
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 = {
local vector spot1, spot2;
local float r;
vector spot1, spot2;
float r;
spot1 = self.origin + self.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 = {
local vector spot1, spot2;
vector spot1, spot2;
spot1 = self.origin + self.view_ofs;
spot2 = targ.origin + targ.view_ofs;
@ -177,7 +146,6 @@ float(entity targ) visible = {
return FALSE;
};
/*
=============
infront
@ -186,8 +154,8 @@ returns 1 if the entity is in front(in sight) of self
=============
*/
float(entity targ) infront = {
local vector vec;
local float dot;
vector vec;
float dot;
makevectors(self.angles);
vec = normalize(targ.origin - self.origin);
@ -199,7 +167,6 @@ float(entity targ) infront = {
return FALSE;
};
//============================================================================
void() HuntTarget = {
@ -211,7 +178,7 @@ void() HuntTarget = {
};
void() SightSound = {
local float rsnd;
float rsnd;
if(self.classname == "monster_ogre") {
sound(self, CHAN_VOICE, "ogre/ogwake.wav", 1, ATTN_NORM);
@ -282,8 +249,8 @@ slower noticing monsters.
============
*/
float() FindTarget = {
local entity client;
local float r;
entity client;
float r;
// if the first spawnflag bit is set, the monster will only wake up on
// really seeing the player, not another monster getting angry
@ -350,7 +317,6 @@ float() FindTarget = {
return TRUE;
};
//=============================================================================
void(float dist) ai_forward = {
@ -361,7 +327,6 @@ void(float dist) ai_back = {
walkmove((self.angles_y + 180), dist);
};
/*
=============
ai_pain
@ -372,7 +337,7 @@ stagger back a bit
void(float dist) ai_pain = {
ai_back(dist);
/*
local float away;
float away;
away = anglemod(vectoyaw(self.origin - self.enemy.origin)
+ 180*(random()- 0.5) );
@ -400,7 +365,7 @@ The monster is walking it's beat
=============
*/
void(float dist) ai_walk = {
local vector mtemp;
vector mtemp;
movedist = dist;
@ -416,7 +381,6 @@ void(float dist) ai_walk = {
movetogoal(dist);
};
/*
=============
ai_stand
@ -461,7 +425,7 @@ ChooseTurn
=============
*/
void(vector dest3) ChooseTurn = {
local vector dir, newdir;
vector dir, newdir;
dir = self.origin - dest3;
@ -488,7 +452,7 @@ FacingIdeal
============
*/
float() FacingIdeal = {
local float delta;
float delta;
delta = anglemod(self.angles_y - self.ideal_yaw);
if(delta > 45 && delta < 315) {
@ -497,7 +461,6 @@ float() FacingIdeal = {
return TRUE;
};
//=============================================================================
float() CheckAnyAttack = {
@ -525,7 +488,6 @@ float() CheckAnyAttack = {
return CheckAttack();
};
/*
=============
ai_run_melee
@ -543,7 +505,6 @@ void() ai_run_melee = {
}
};
/*
=============
ai_run_missile
@ -560,7 +521,6 @@ void() ai_run_missile = {
}
};
/*
=============
ai_run_slide
@ -569,7 +529,7 @@ Strafe sideways, but stay at aproximately the same range
=============
*/
void() ai_run_slide = {
local float ofs;
float ofs;
self.ideal_yaw = enemy_yaw;
ChangeYaw();
@ -588,7 +548,6 @@ void() ai_run_slide = {
walkmove(self.ideal_yaw - ofs, movedist);
};
/*
=============
ai_run
@ -597,9 +556,9 @@ The monster has an enemy it is trying to kill
=============
*/
void(float dist) ai_run = {
local vector delta;
local float axis;
local float direct, ang_rint, ang_floor, ang_ceil;
vector delta;
float axis;
float direct, ang_rint, ang_floor, ang_ceil;
movedist = dist;
// see if the enemy is dead

View File

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

View File

@ -1,4 +1,4 @@
// button and multiple button
// buttons.qc: button and multiple button
void() button_wait = {
self.state = STATE_TOP;
@ -22,12 +22,10 @@ void() button_return = {
}
};
void() button_blocked = {
// do nothing, just don't ome all the way back out
};
void() button_fire = {
if(self.state == STATE_UP || self.state == STATE_TOP) {
return;
@ -39,7 +37,6 @@ void() button_fire = {
SUB_CalcMove(self.pos2, self.speed, button_wait);
};
void() button_use = {
self.enemy = activator;
button_fire();
@ -60,7 +57,6 @@ void() button_killed = {
button_fire();
};
/*QUAKED func_button(0 .5 .8) ?
When a button is touched, it moves some distance in the direction of it's angle, triggers all of it's targets, waits some time, then returns to it's original position where it can be triggered again.
@ -77,7 +73,7 @@ When a button is touched, it moves some distance in the direction of it's angle,
3) in-out
*/
void() func_button = {
local float gtemp, ftemp;
float gtemp, ftemp;
if(self.sounds == 0) {
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)
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'
@ -87,8 +84,8 @@ Returns the entity to view from
============
*/
entity() FindIntermission = {
local entity spot;
local float cyc;
entity spot;
float cyc;
// look for info_intermission first
spot = find(world, classname, "info_intermission");
@ -120,8 +117,6 @@ entity() FindIntermission = {
objerror("FindIntermission: no spot");
};
string nextmap;
void() GotoNextMap = {
if(cvar("samelevel")) { // if samelevel is set, stay on same level
changelevel(mapname);
@ -130,7 +125,6 @@ void() GotoNextMap = {
}
};
void() ExitIntermission = {
// skip any text in deathmatch
if(deathmatch) {
@ -218,7 +212,7 @@ void() IntermissionThink = {
};
void() execute_changelevel = {
local entity pos;
entity pos;
intermission_running = 1;
@ -252,9 +246,8 @@ void() execute_changelevel = {
WriteByte(MSG_ALL, SVC_INTERMISSION);
};
void() changelevel_touch = {
local entity pos;
entity pos;
if(other.classname != "player") {
return;
@ -300,7 +293,6 @@ void() trigger_changelevel = {
self.touch = changelevel_touch;
};
/*
=============================================================================
@ -331,7 +323,6 @@ void() respawn = {
}
};
/*
============
ClientKill
@ -360,9 +351,9 @@ Returns the entity to spawn at
============
*/
entity() SelectSpawnPoint = {
local entity spot;
local entity thing;
local float pcount;
entity spot;
entity thing;
float pcount;
// testinfo_player_start is only found in regioned levels
spot = find(world, classname, "testplayerstart");
@ -427,7 +418,7 @@ called each time a player is spawned
============
*/
void() PutClientInServer = {
local entity spot;
entity spot;
spot = SelectSpawnPoint();
@ -487,7 +478,6 @@ void() PutClientInServer = {
spawn_tdeath(self.origin, self);
};
/*
=============================================================================
@ -496,21 +486,18 @@ void() PutClientInServer = {
=============================================================================
*/
/*QUAKED info_player_start(1 0 0) (-16 -16 -24) (16 16 24)
The normal starting point for a level.
*/
void() info_player_start = {
};
/*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.
*/
void() info_player_start2 = {
};
/*
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
*/
void() NextLevel = {
local entity o;
entity o;
if(mapname == "start") {
if(!cvar("registered")) {
@ -590,8 +577,8 @@ Exit deathmatch games upon conditions
============
*/
void() CheckRules = {
local float timelimit;
local float fraglimit;
float timelimit;
float fraglimit;
if(gameover) { // someone else quit the game already
return;
@ -614,8 +601,8 @@ void() CheckRules = {
//============================================================================
void() PlayerDeathThink = {
local entity old_self;
local float forward;
entity old_self;
float forward;
if((self.flags & FL_ONGROUND)) {
forward = vlen(self.velocity);
@ -647,9 +634,8 @@ void() PlayerDeathThink = {
respawn();
};
void() PlayerJump = {
local vector start, end;
vector start, end;
if(self.flags & FL_WATERJUMP) {
return;
@ -693,15 +679,12 @@ void() PlayerJump = {
self.velocity_z = self.velocity_z + 270;
};
/*
===========
WaterMove
============
*/
.float dmgtime;
void() WaterMove = {
//dprint(ftos(self.waterlevel));
if(self.movetype == MOVETYPE_NOCLIP) {
@ -779,7 +762,7 @@ void() WaterMove = {
};
void() CheckWaterJump = {
local vector start, end;
vector start, end;
// check for a jump-out-of-water
makevectors(self.angles);
@ -806,7 +789,6 @@ void() CheckWaterJump = {
}
};
/*
================
PlayerPreThink
@ -815,8 +797,8 @@ Called every frame before physics are run
================
*/
void() PlayerPreThink = {
local float mspeed, aspeed;
local float r;
float mspeed, aspeed;
float r;
if(intermission_running) {
IntermissionThink(); // otherwise a button could be missed between
@ -988,7 +970,6 @@ void() CheckPowerups = {
};
/*
================
PlayerPostThink
@ -997,8 +978,8 @@ Called every frame after physics are run
================
*/
void() PlayerPostThink = {
local float mspeed, aspeed;
local float r;
float mspeed, aspeed;
float r;
if(self.view_ofs == '0 0 0') {
return; // intermission or finale
@ -1032,7 +1013,6 @@ void() PlayerPostThink = {
CheckPowerups();
};
/*
===========
ClientConnect
@ -1050,7 +1030,6 @@ void() ClientConnect = {
}
};
/*
===========
ClientDisconnect
@ -1082,8 +1061,8 @@ called when a player dies
============
*/
void(entity targ, entity attacker) ClientObituary = {
local float rnum;
local string deathstring, deathstring2;
float rnum;
string deathstring, deathstring2;
rnum = random();
if(targ.classname == "player") {

View File

@ -1,4 +1,4 @@
//============================================================================
// combat.qc: entity-entity damage functions
float(entity targ, entity attacker) SameTeam = {
return targ.team > 0 && targ.team == attacker.team;
@ -53,14 +53,13 @@ float(entity targ, entity inflictor) CanDamage = {
return FALSE;
};
/*
============
Killed
============
*/
void(entity targ, entity attacker) Killed = {
local entity oself;
entity oself;
oself = self;
self = targ;
@ -95,7 +94,6 @@ void(entity targ, entity attacker) Killed = {
self = oself;
};
/*
============
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 = {
local vector dir;
local entity oldself;
local float save;
local float take;
vector dir;
entity oldself;
float save;
float take;
// team play damage avoidance
if(teamplay == 1 && SameTeam(targ, attacker)) {
@ -214,9 +212,9 @@ T_RadiusDamage
============
*/
void(entity inflictor, entity attacker, float damage, entity ignore) T_RadiusDamage = {
local float points;
local entity head;
local vector org;
float points;
entity head;
vector org;
head = findradius(inflictor.origin, damage + 40);
@ -254,8 +252,8 @@ T_BeamDamage
============
*/
void(entity attacker, float damage) T_BeamDamage = {
local float points;
local entity head;
float points;
entity head;
head = findradius(attacker.origin, damage + 40);

View File

@ -1,3 +1,5 @@
// defs.qc: global definitions
// system globals ------------------------------------------------------------|
#pragma noref 1
entity self;
@ -75,7 +77,7 @@ void end_sys_globals; // flag for structure dumping
.float modelindex; // model index in the precached list
.vector absmin, absmax; // origin + mins / maxs
.float ltime; // local time for entity
.float ltime; // time for entity
.float movetype;
.float solid;
@ -133,6 +135,7 @@ void end_sys_globals; // flag for structure dumping
.string netname;
// Will be world if not currently angry at anyone.
.entity enemy;
.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 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 yaw_speed;
.entity aiment;
@ -207,7 +214,7 @@ entity() checkclient = #17; // returns a client to look for
entity(entity start, .string fld, string match) find = #18;
string(string s) precache_sound = #19;
string(string s) precache_model = #20;
void(entity client, string s)stuffcmd = #21;
void(entity client, string s) stuffcmd = #21;
entity(vector org, float rad) findradius = #22;
void(string s) bprint = #23;
void(entity client, string s) sprint = #24;
@ -229,7 +236,7 @@ float(vector v) pointcontents = #41; // returns a CONTENT_*
float(float f) fabs = #43;
vector(entity e, float speed) aim = #44; // returns the shooting vector
float(string s) cvar = #45; // return cvar.value
void(string s) localcmd = #46; // put string into local que
void(string s) localcmd = #46; // put string into que
entity(entity e) nextent = #47; // for looping through all ents
// start a particle effect
void(vector o, vector d, float color, float count) particle = #48;
@ -478,6 +485,33 @@ float framecount;
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 --------------------------------------------------------------------|
// world fields
@ -551,8 +585,12 @@ float skill;
.entity trigger_field; // door's trigger entity
.string noise4;
// monsters
// A monster will leave its stand state and head towards it's .movetarget when
// time > .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;
// doors
@ -580,52 +618,79 @@ float skill;
.float distance;
.float volume;
.float hit_z;
.float dmgtime;
.float inpain;
.float healamount, healtype;
// functions -----------------------------------------------------------------|
// subs.qc
void(float normal) SUB_AttackFinished;
void(vector tdest, float tspeed, void() func) SUB_CalcMove;
void(entity ent, vector tdest, float tspeed, void() func) SUB_CalcMoveEnt;
void(vector destangle, float tspeed, void() func) SUB_CalcAngleMove;
void() SUB_CalcMoveDone;
void() SUB_CalcAngleMoveDone;
void(void() thinkst) SUB_CheckRefire;
void() SUB_Null;
void() SUB_UseTargets;
void() SUB_Remove;
// 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 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;
void() Demon_JumpTouch;
void(float side) Demon_Melee;
float() DogCheckAttack;
float() W_BestWeapon;
float() WizardCheckAttack;
void() dog_leap1;
void() dog_run1;
void() ShalHome;
void() ShalMissile;
void() ShalMissileTouch;
float() crandom;
float(entity targ) infront;
float(entity targ) range;
float(entity targ) visible;
float(entity targ, entity attacker) SameTeam;
float(float v) anglemod;
void() DecodeLevelParms;
void() Demon_JumpTouch;
void(entity ent) CopyToBodyQue;
void() InitBodyQue;
void() PlayerDie;
void() ShalHome;
void() ShalMissile;
void() ShalMissileTouch;
void() SuperDamageSound;
void() T_MissileTouch;
void() W_SetCurrentAmmo;
void() W_WeaponFrame;
void() ai_face;
void() armor_touch;
void() army_fire;
void() bubble_bob;
void() bubble_remove;
void() button_return;
void() button_wait;
void() dog_leap1;
void() dog_run1;
void() door_go_down;
void() door_go_up;
void() fd_secret_done;
@ -641,29 +706,50 @@ void() finale_3;
void() finale_4;
void() fire_fly;
void() fire_touch;
void() func_train_find;
void() health_touch;
void() hk_idle_sound;
void() hknight_char_a1;
void() hknight_run1;
void() info_player_start;
void() item_megahealth_rot;
void() knight_atk1;
void() knight_bow1;
void() knight_bow6;
void() knight_runatk1;
void() knight_walk1;
void() make_bubbles;
void() monster_death_use;
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_swing1;
void() plat_center_touch;
void() plat_crush;
void() plat_go_down;
void() plat_go_up;
void() plat_outside_touch;
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_axeb1;
void() player_axec1;
@ -682,32 +768,26 @@ void() player_run;
void() player_run;
void() player_shot1;
void() player_stand1;
void() powerup_touch;
void() set_suicide_frame;
void() shalrath_pain;
void() sham_smash1;
void() sham_swingl1;
void() sham_swingr1;
void() sham_swingr1;
void() spike_touch;
void() superspike_touch;
void() swimmonster_start;
void() t_movetarget;
void() tbaby_jump1;
void() tbaby_jump5;
void() train_next;
float() WizardCheckAttack;
void() wiz_run1;
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, 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;
// EOF

View File

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

View File

@ -1,10 +1,5 @@
/*
==============================================================================
// dog.qc: Rottweiler
DOG
==============================================================================
*/
$cd id1 / models / dog
$origin 0 0 24
$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
/*
================
dog_bite
@ -38,8 +32,8 @@ dog_bite
================
*/
void() dog_bite = {
local vector delta;
local float ldmg;
vector delta;
float ldmg;
if(!self.enemy) {
return;
@ -62,7 +56,7 @@ void() dog_bite = {
};
void() Dog_JumpTouch = {
local float ldmg;
float ldmg;
if(self.health <= 0) {
return;
@ -95,7 +89,6 @@ void() Dog_JumpTouch = {
self.nextthink = time + 0.1;
};
void() dog_stand1 = [ $stand1, dog_stand2 ] {ai_stand();};
void() dog_stand2 = [ $stand2, dog_stand3 ] {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_dieb9 = [ $deathb9, dog_dieb9 ] {};
void() dog_die = {
// check for gib
if(self.health < -35) {
@ -273,8 +265,8 @@ CheckDogJump
==============
*/
float() CheckDogJump = {
local vector dist;
local float d;
vector dist;
float d;
if(self.origin_z + self.mins_z > self.enemy.origin_z + self.enemy.mins_z
+ 0.75 * self.enemy.size_z) {
@ -303,7 +295,7 @@ float() CheckDogJump = {
};
float() DogCheckAttack = {
local vector vec;
vector vec;
// if close enough for slashing, go for it
if(CheckDogMelee()) {
@ -319,7 +311,6 @@ float() DogCheckAttack = {
return FALSE;
};
//===========================================================================
/*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 {
DOOR_START_OPEN = 1,
DOOR_DONT_LINK = 4,
@ -41,7 +43,6 @@ void() door_blocked = {
}
};
void() door_hit_top = {
sound(self, CHAN_VOICE, self.noise1, 1, ATTN_NORM);
self.state = STATE_TOP;
@ -86,7 +87,6 @@ void() door_go_up = {
SUB_UseTargets();
};
/*
=============================================================================
@ -96,8 +96,8 @@ ACTIVATION FUNCTIONS
*/
void() door_fire = {
local entity oself;
local entity starte;
entity oself;
entity starte;
if(self.owner != self) {
objerror("door_fire: self.owner != self");
@ -133,9 +133,8 @@ void() door_fire = {
self = oself;
};
void() door_use = {
local entity oself;
entity oself;
self.message = ""; // door message are for touch only
self.owner.message = "";
@ -146,7 +145,6 @@ void() door_use = {
self = oself;
};
void() door_trigger_touch = {
if(other.health <= 0) {
return;
@ -163,9 +161,8 @@ void() door_trigger_touch = {
door_use();
};
void() door_killed = {
local entity oself;
entity oself;
oself = self;
self = self.owner;
@ -175,7 +172,6 @@ void() door_killed = {
self = oself;
};
/*
================
door_touch
@ -247,10 +243,9 @@ SPAWNING FUNCTIONS
=============================================================================
*/
entity(vector fmins, vector fmaxs) spawn_field = {
local entity trigger;
local vector t1, t2;
entity trigger;
vector t1, t2;
trigger = spawn();
trigger.movetype = MOVETYPE_NONE;
@ -264,7 +259,6 @@ entity(vector fmins, vector fmaxs) spawn_field = {
return(trigger);
};
float(entity e1, entity e2) EntitiesTouching = {
if(e1.mins_x > e2.maxs_x) {
return FALSE;
@ -287,17 +281,15 @@ float(entity e1, entity e2) EntitiesTouching = {
return TRUE;
};
/*
=============
LinkDoors
=============
*/
void() LinkDoors = {
local entity t, starte;
local vector cmins, cmaxs;
entity t, starte;
vector cmins, cmaxs;
if(self.enemy) {
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
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";
}
SetMovedir();
self.max_health = self.health;
@ -529,9 +519,8 @@ enum {
SECRET_YES_SHOOT = 16, // shootable even if targeted
};
void() fd_secret_use = {
local float temp;
float temp;
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
Basic secret door. Slides back, then to the side. Angle determines direction.
wait = # of seconds before coming back

View File

@ -1,10 +1,4 @@
/*
==============================================================================
SOLDIER / PLAYER
==============================================================================
*/
// enforcer.qc: Enforcer
$cd id1 / models / enforcer
$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 paind17 paind18 paind19
void() Laser_Touch = {
local vector org;
vector org;
if(other == self.owner) {
return; // don't explode on owner
@ -68,7 +61,7 @@ void() Laser_Touch = {
};
void(vector org, vector vec) LaunchLaser = {
local vector vec;
vector vec;
if(self.classname == "monster_enforcer") {
sound(self, CHAN_WEAPON, "enforcer/enfire.wav", 1, ATTN_NORM);
@ -96,9 +89,8 @@ void(vector org, vector vec) LaunchLaser = {
};
void() enforcer_fire = {
local vector org;
vector org;
self.effects = self.effects | EF_MUZZLEFLASH;
makevectors(self.angles);
@ -212,14 +204,13 @@ void() enf_paind18 = [ $paind18, enf_paind19 ] {};
void() enf_paind19 = [ $paind19, enf_run1 ] {};
void(entity attacker, float damage) enf_pain = {
local float r;
float r;
r = random();
if(self.pain_finished > time) {
return;
}
if(r < 0.5) {
sound(self, CHAN_VOICE, "enforcer/pain1.wav", 1, ATTN_NORM);
} else {
@ -245,7 +236,6 @@ void(entity attacker, float damage) enf_pain = {
void() enf_die1 = [ $death1, enf_die2 ] {};
void() enf_die2 = [ $death2, enf_die3 ] {};
void() enf_die3 = [ $death3, enf_die4 ]
@ -277,7 +267,6 @@ void() enf_fdie9 = [ $fdeath9, enf_fdie10 ] {};
void() enf_fdie10 = [ $fdeath10, enf_fdie11 ] {};
void() enf_fdie11 = [ $fdeath11, enf_fdie11 ] {};
void() enf_die = {
// check for gib
if(self.health < -35) {
@ -298,7 +287,6 @@ void() enf_die = {
}
};
/*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 = {
local float len;
float len;
// decide if now is a good swing time
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 = {
local vector spot1, spot2;
local entity targ;
local float chance;
vector spot1, spot2;
entity targ;
float chance;
targ = self.enemy;
@ -109,7 +106,6 @@ float() CheckAttack = {
return FALSE;
};
/*
=============
ai_face
@ -135,8 +131,8 @@ void(float d) ai_charge = {
};
void() ai_charge_side = {
local vector dtemp;
local float heading;
vector dtemp;
float heading;
// aim to the left of the enemy for a flyby
@ -150,7 +146,6 @@ void() ai_charge_side = {
walkmove(heading, 20);
};
/*
=============
ai_melee
@ -158,8 +153,8 @@ ai_melee
=============
*/
void() ai_melee = {
local vector delta;
local float ldmg;
vector delta;
float ldmg;
if(!self.enemy) {
return; // removed before stroke
@ -175,10 +170,9 @@ void() ai_melee = {
T_Damage(self.enemy, self, self, ldmg);
};
void() ai_melee_side = {
local vector delta;
local float ldmg;
vector delta;
float ldmg;
if(!self.enemy) {
return; // removed before stroke
@ -198,7 +192,6 @@ void() ai_melee_side = {
T_Damage(self.enemy, self, self, ldmg);
};
//=============================================================================
/*
@ -210,9 +203,9 @@ Returns FALSE if movement should continue
============
*/
float() SoldierCheckAttack = {
local vector spot1, spot2;
local entity targ;
local float chance;
vector spot1, spot2;
entity targ;
float chance;
targ = self.enemy;
@ -230,7 +223,6 @@ float() SoldierCheckAttack = {
return FALSE; // don't have a clear shot
}
// missile attack
if(time < self.attack_finished) {
return FALSE;
@ -272,10 +264,10 @@ Returns FALSE if movement should continue
============
*/
float() ShamCheckAttack = {
local vector spot1, spot2;
local entity targ;
local float chance;
local float enemy_yaw;
vector spot1, spot2;
entity targ;
float chance;
float enemy_yaw;
if(enemy_range == RANGE_MELEE) {
if(CanDamage(self.enemy, self)) {
@ -333,9 +325,9 @@ Returns FALSE if movement should continue
============
*/
float() OgreCheckAttack = {
local vector spot1, spot2;
local entity targ;
local float chance;
vector spot1, spot2;
entity targ;
float chance;
if(enemy_range == RANGE_MELEE) {
if(CanDamage(self.enemy, self)) {

View File

@ -1,3 +1,5 @@
// fish.qc: Rotfish
$cd id1 / models / fish
$origin 0 0 24
$base base
@ -71,8 +73,8 @@ void() f_run8 = [ $swim15, f_run9 ] {ai_run(12);};
void() f_run9 = [ $swim17, f_run1 ] {ai_run(12);};
void() fish_melee = {
local vector delta;
local float ldmg;
vector delta;
float ldmg;
if(!self.enemy) {
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
*/
void() monster_fish = {

View File

@ -1,10 +1,4 @@
/*
==============================================================================
KNIGHT
==============================================================================
*/
// hknight.qc: Death Knight
$cd id1 / models / knight2
$origin 0 0 24
@ -51,10 +45,15 @@ $frame w_attack21 w_attack22
$frame magicc1 magicc2 magicc3 magicc4 magicc5 magicc6 magicc7 magicc8
$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 = {
local vector offang;
local vector org, vec;
vector offang;
vector org, vec;
offang = vectoangles(self.enemy.origin - self.origin);
offang_y = offang_y + offset * 6;
@ -124,7 +123,7 @@ void() hknight_stand9 = [ $stand9, hknight_stand1 ] {ai_stand();};
//===========================================================================
void() hknight_walk1 = [ $walk1, hknight_walk2 ] {
hk_idle_sound();
hknight_idle_sound();
ai_walk(2);
};
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 ] {
hk_idle_sound();
hknight_idle_sound();
ai_run(20);
CheckForCharge();
};
@ -217,7 +216,6 @@ void() hknight_die = {
}
};
//============================================================================
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 = {
if(self.pain_finished > time) {
return;
@ -376,8 +368,6 @@ void(entity attacker, float damage) hknight_pain = {
hknight_pain1();
};
float hknight_type;
void() hknight_melee = {
hknight_type = hknight_type + 1;
@ -403,7 +393,6 @@ void() monster_hell_knight = {
precache_model2("progs/k_spike.mdl");
precache_model2("progs/h_hellkn.mdl");
precache_sound2("hknight/attack1.wav");
precache_sound2("hknight/death1.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_SHOTGUN = "Shotgun";
const string WEPNAME_SUPER_SHOTGUN = "Double-barrelled Shotgun";
@ -9,19 +11,27 @@ const string WEPNAME_LIGHTNING = "Thunderbolt";
string() Key1Name = {
switch(world.worldtype) {
case 0: return "silver key";
case 1: return "silver runekey";
case 2: return "silver keycard";
default: return string_null;
case 0:
return "silver key";
case 1:
return "silver runekey";
case 2:
return "silver keycard";
default:
return string_null;
}
};
string() Key2Name = {
switch(world.worldtype) {
case 0: return "gold key";
case 1: return "gold runekey";
case 2: return "gold keycard";
default: return string_null;
case 0:
return "gold key";
case 1:
return "gold runekey";
case 2:
return "gold keycard";
default:
return string_null;
}
};
@ -58,7 +68,7 @@ plants the object on the floor
============
*/
void() PlaceItem = {
local float oldz;
float oldz;
self.mdl = self.model; // so it can be restored on respawn
self.flags = FL_ITEM; // make extra wide
@ -131,7 +141,6 @@ enum {
H_ROTTEN = 1,
H_MEGA = 2,
};
.float healamount, healtype;
void() item_health = {
self.touch = health_touch;
@ -164,8 +173,8 @@ void() item_health = {
void() health_touch = {
local float amount;
local string s;
float amount;
string s;
if(other.classname != "player") {
return;
@ -244,7 +253,7 @@ ARMOR
*/
void() armor_touch = {
local float type, value, bit;
float type, value, bit;
if(other.health <= 0) {
return;
@ -380,12 +389,10 @@ float(float w) RankForWeapon = {
Deathmatch_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 = {
local float or, nr;
float or, nr;
// change self.weapon if desired
or = RankForWeapon(self.weapon);
@ -401,9 +408,9 @@ weapon_touch
=============
*/
void() weapon_touch = {
local float hadammo, best, new, old;
local entity stemp;
local float leave;
float hadammo, best, new, old;
entity stemp;
float leave;
if(!(other.flags & FL_CLIENT)) {
return;
@ -599,8 +606,8 @@ AMMO
*/
void() ammo_touch = {
local entity stemp;
local float best;
entity stemp;
float best;
if(other.classname != "player") {
return;
@ -847,8 +854,8 @@ KEYS
*/
void() key_touch = {
local entity stemp;
local float best;
entity stemp;
float best;
if(other.classname != "player") {
return;
@ -972,8 +979,8 @@ END OF LEVEL RUNES
*/
void() sigil_touch = {
local entity stemp;
local float best;
entity stemp;
float best;
if(other.classname != "player") {
return;
@ -1039,8 +1046,8 @@ POWERUPS
*/
void() powerup_touch = {
local entity stemp;
local float best;
entity stemp;
float best;
if(other.classname != "player") {
return;
@ -1181,10 +1188,10 @@ PLAYER BACKPACKS
*/
void() BackpackTouch = {
local string s;
local float best, old, new;
local entity stemp;
local float acount;
string s;
float best, old, new;
entity stemp;
float acount;
if(other.classname != "player" || other.health <= 0) {
return;
@ -1296,7 +1303,7 @@ DropBackpack
===============
*/
entity() DropBackpack = {
local entity item;
entity item;
item = spawn();
item.origin = self.origin - '0 0 24';
@ -1304,15 +1311,33 @@ entity() DropBackpack = {
item.weapon = self.weapon;
switch(item.weapon) {
case IT_AXE: item.netname = WEPNAME_AXE; break;
case IT_SHOTGUN: item.netname = WEPNAME_SHOTGUN; break;
case IT_SUPER_SHOTGUN: item.netname = WEPNAME_SUPER_SHOTGUN; 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;
case IT_AXE:
item.netname = WEPNAME_AXE;
break;
case IT_SHOTGUN:
item.netname = WEPNAME_SHOTGUN;
break;
case IT_SUPER_SHOTGUN:
item.netname = WEPNAME_SUPER_SHOTGUN;
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;

View File

@ -1,10 +1,4 @@
/*
==============================================================================
KNIGHT
==============================================================================
*/
// knight.qc: Knight
$cd id1 / models / knight
$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_walk14 = [ $walk14, knight_walk1 ] {ai_walk(3);};
void() knight_run1 = [ $runb1, knight_run2 ] {
if(random() < 0.2) {
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_run8 = [ $runb8, knight_run1 ] {ai_run(6);};
void() knight_runatk1 = [ $runattack1, knight_runatk2 ] {
if(random() > 0.5) {
sound(self, CHAN_WEAPON, "knight/sword2.wav", 1, ATTN_NORM);
@ -149,7 +141,7 @@ void() knight_painb10 = [ $painb10, knight_painb11 ] {ai_painforward(0);};
void() knight_painb11 = [ $painb11, knight_run1 ] {};
void(entity attacker, float damage) knight_pain = {
local float r;
float r;
if(self.pain_finished > time) {
return;
@ -184,7 +176,6 @@ void() knight_bow9 = [ $kneel1, knight_bow10 ] {ai_turn();};
void() knight_bow10 = [ $walk1, knight_walk1 ] {ai_turn();};
void() knight_die1 = [ $death1, knight_die2 ] {};
void() knight_die2 = [ $death2, knight_die3 ] {};
void() knight_die3 = [ $death3, knight_die4 ]
@ -197,7 +188,6 @@ void() knight_die8 = [ $death8, knight_die9 ] {};
void() knight_die9 = [ $death9, knight_die10] {};
void() knight_die10 = [ $death10, knight_die10] {};
void() knight_dieb1 = [ $deathb1, knight_dieb2 ] {};
void() knight_dieb2 = [ $deathb2, knight_dieb3 ] {};
void() knight_dieb3 = [ $deathb3, knight_dieb4 ]
@ -211,7 +201,6 @@ void() knight_dieb9 = [ $deathb9, knight_dieb10] {};
void() knight_dieb10 = [ $deathb10, knight_dieb11] {};
void() knight_dieb11 = [ $deathb11, knight_dieb11] {};
void() knight_die = {
// check for gib
if(self.health < -40) {
@ -232,7 +221,6 @@ void() knight_die = {
}
};
/*QUAKED monster_knight(1 0 0) (-16 -16 -24) (16 16 40) Ambush
*/
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)
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)
Lava Balls
*/
@ -165,7 +165,7 @@ void() misc_fireball = {
};
void() fire_fly = {
local entity fireball;
entity fireball;
fireball = spawn();
fireball.solid = SOLID_TRIGGER;
@ -186,7 +186,6 @@ void() fire_fly = {
self.think = fire_fly;
};
void() fire_touch = {
T_Damage(other, self, self, 20);
remove(self);
@ -194,7 +193,6 @@ void() fire_touch = {
//============================================================================
void() barrel_explode = {
self.takedamage = DAMAGE_NO;
self.classname = "explo_box";
@ -208,13 +206,12 @@ void() barrel_explode = {
};
/*QUAKED misc_explobox(0 .5 .8) (0 0 0) (32 32 64)
TESTING THING
*/
void() misc_explobox = {
local float oldz;
float oldz;
self.solid = SOLID_BBOX;
self.movetype = MOVETYPE_NONE;
@ -238,13 +235,12 @@ void() misc_explobox = {
/*QUAKED misc_explobox2(0 .5 .8) (0 0 0) (32 32 64)
Smaller exploding box, REGISTERED ONLY
*/
void() misc_explobox2 = {
local float oldz;
float oldz;
self.solid = SOLID_BBOX;
self.movetype = MOVETYPE_NONE;
@ -293,7 +289,6 @@ void() shooter_think = {
newmis.velocity = self.movedir * 500;
};
/*QUAKED trap_spikeshooter(0 .5 .8) (-8 -8 -8) (8 8 8) superspike laser
When triggered, fires a spike in the direction set in QuakeEd.
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
Continuously fires spikes.
"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)
testing air bubbles
*/
void() air_bubbles =
{
void() air_bubbles = {
if(deathmatch) {
remove(self);
return;
@ -355,7 +344,7 @@ void() air_bubbles =
};
void() make_bubbles = {
local entity bubble;
entity bubble;
bubble = spawn();
setmodel(bubble, "progs/s_bubble.spr");
@ -375,7 +364,7 @@ void() make_bubbles = {
};
void() bubble_split = {
local entity bubble;
entity bubble;
bubble = spawn();
setmodel(bubble, "progs/s_bubble.spr");
setorigin(bubble, self.origin);
@ -405,8 +394,8 @@ void() bubble_remove = {
};
void() bubble_bob = {
local float rnd1, rnd2, rnd3;
local vector vtmp1, modi;
float rnd1, rnd2, rnd3;
vector vtmp1, modi;
self.cnt = self.cnt + 1;
if(self.cnt == 4) {
@ -466,7 +455,6 @@ void() viewthing =
setmodel(self, "progs/player.mdl");
};
/*
==============================================================================
@ -491,7 +479,6 @@ void() func_wall = {
setmodel(self, self.model);
};
/*QUAKED func_illusionary(0 .5 .8) ?
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.
*/
void() misc_noisemaker =
{
void() misc_noisemaker = {
precache_sound2("enforcer/enfire.wav");
precache_sound2("enforcer/enfstop.wav");
precache_sound2("enforcer/sight1.wav");

View File

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

View File

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

View File

@ -1,10 +1,4 @@
/*
==============================================================================
OGRE
==============================================================================
*/
// ogre.qc: Ogre
$cd id1 / models / ogre_c
$origin 0 0 24
@ -49,7 +43,6 @@ $frame pull1 pull2 pull3 pull4 pull5 pull6 pull7 pull8 pull9 pull10 pull11
//=============================================================================
void() OgreGrenadeExplode = {
T_RadiusDamage(self, self.owner, 40, world);
sound(self, CHAN_VOICE, "weapons/r_exp3.wav", 1, ATTN_NORM);
@ -87,7 +80,7 @@ OgreFireGrenade
================
*/
void() OgreFireGrenade = {
local entity missile, mpuff;
entity missile, mpuff;
self.effects = self.effects | EF_MUZZLEFLASH;
@ -121,7 +114,6 @@ void() OgreFireGrenade = {
setorigin(missile, self.origin);
};
//=============================================================================
/*
@ -132,8 +124,8 @@ FIXME
================
*/
void(float side) chainsaw = {
local vector delta;
local float ldmg;
vector delta;
float ldmg;
if(!self.enemy) {
return;
@ -163,7 +155,6 @@ void(float side) chainsaw = {
}
};
void() ogre_stand1 = [ $stand1, ogre_stand2 ] {ai_stand();};
void() ogre_stand2 = [ $stand2, ogre_stand3 ] {ai_stand();};
void() ogre_stand3 = [ $stand3, ogre_stand4 ] {ai_stand();};
@ -270,12 +261,10 @@ void() ogre_pain3 = [ $pain3, ogre_pain4 ] {};
void() ogre_pain4 = [ $pain4, ogre_pain5 ] {};
void() ogre_pain5 = [ $pain5, ogre_run1 ] {};
void() ogre_painb1 = [ $painb1, ogre_painb2 ] {};
void() ogre_painb2 = [ $painb2, ogre_painb3 ] {};
void() ogre_painb3 = [ $painb3, ogre_run1 ] {};
void() ogre_painc1 = [ $painc1, ogre_painc2 ] {};
void() ogre_painc2 = [ $painc2, ogre_painc3 ] {};
void() ogre_painc3 = [ $painc3, ogre_painc4 ] {};
@ -283,7 +272,6 @@ void() ogre_painc4 = [ $painc4, ogre_painc5 ] {};
void() ogre_painc5 = [ $painc5, ogre_painc6 ] {};
void() ogre_painc6 = [ $painc6, ogre_run1 ] {};
void() ogre_paind1 = [ $paind1, ogre_paind2 ] {};
void() ogre_paind2 = [ $paind2, ogre_paind3 ] {ai_pain(10);};
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_paine15 = [ $paine15, ogre_run1 ] {};
void(entity attacker, float damage) ogre_pain = {
local float r;
float r;
// don't make multiple pain sounds right after each other
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
*/
@ -454,4 +440,3 @@ void() monster_ogre_marksman = {
monster_ogre();
};

View File

@ -1,18 +1,11 @@
/*
==============================================================================
// oldone.qc: Shub-Niggurath
OLD ONE
==============================================================================
*/
$cd id1 / models / old_one
$origin 0 0 24
$base base
$skin skin
$scale 1
entity shub;
$frame old1 old2 old3 old4 old5 old6 old7 old8 old9
$frame old10 old11 old12 old13 old14 old15 old16 old17 old18 old19
$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_idle46 = [ $old46, old_idle1 ] {};
void() old_thrash1 = [ $shake1, old_thrash2 ] {lightstyle(0, "m");};
void() old_thrash2 = [ $shake2, old_thrash3 ] {lightstyle(0, "k");};
void() old_thrash3 = [ $shake3, old_thrash4 ] {lightstyle(0, "k");};
@ -102,8 +94,8 @@ void() old_thrash20 = [ $shake20, old_thrash20 ] {finale_4();};
//============================================================================
void() finale_1 = {
local entity pos, pl;
local entity timer;
entity pos, pl;
entity timer;
intermission_exittime = time + 10000000; // never allow exit
intermission_running = 1;
@ -147,7 +139,7 @@ void() finale_1 = {
};
void() finale_2 = {
local vector o;
vector o;
// start a teleport splash inside shub
@ -173,10 +165,10 @@ void() finale_3 = {
void() finale_4 = {
// throw tons of meat chunks
local vector oldo;
local float x, y, z;
local float r;
local entity n;
vector oldo;
float x, y, z;
float r;
entity n;
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)
*/
void() monster_oldone = {

View File

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

View File

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

View File

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

View File

@ -1,10 +1,4 @@
/*
==============================================================================
SHAMBLER
==============================================================================
*/
// shambler.qc: Shambler
$cd id1 / models / shams
$origin 0 0 24
@ -95,8 +89,8 @@ void() sham_smash7 = [ $smash7, sham_smash8 ] {ai_charge(0);};
void() sham_smash8 = [ $smash8, sham_smash9 ] {ai_charge(0);};
void() sham_smash9 = [ $smash9, sham_smash10 ] {ai_charge(0);};
void() sham_smash10 = [ $smash10, sham_smash11 ] {
local vector delta;
local float ldmg;
vector delta;
float ldmg;
if(!self.enemy) {
return;
@ -123,8 +117,8 @@ void() sham_smash11 = [ $smash11, sham_smash12 ] {ai_charge(5);};
void() sham_smash12 = [ $smash12, sham_run1 ] {ai_charge(4);};
void(float side) ShamClaw = {
local vector delta;
local float ldmg;
vector delta;
float ldmg;
if(!self.enemy) {
return;
@ -184,7 +178,7 @@ self.think = sham_swingl1;
};
void() sham_melee = {
local float chance;
float chance;
chance = random();
if(chance > 0.6 || self.health == 600) {
@ -196,11 +190,10 @@ void() sham_melee = {
}
};
//============================================================================
void() CastLightning = {
local vector org, dir;
vector org, dir;
self.effects = self.effects | EF_MUZZLEFLASH;
@ -232,7 +225,7 @@ void() sham_magic1 = [ $magic1, sham_magic2 ] {ai_face();
void() sham_magic2 = [ $magic2, sham_magic3 ] {ai_face();};
void() sham_magic3 = [ $magic3, sham_magic4 ] {ai_face();
self.nextthink = self.nextthink + 0.2;
local entity o;
entity o;
self.effects = self.effects | EF_MUZZLEFLASH;
ai_face();
@ -269,7 +262,6 @@ void() sham_magic11 = [ $magic11, sham_magic12 ] {
void() sham_magic12 = [ $magic12, sham_run1 ] {};
void() sham_pain1 = [ $pain1, sham_pain2 ] {};
void() sham_pain2 = [ $pain2, sham_pain3 ] {};
void() sham_pain3 = [ $pain3, sham_pain4 ] {};
@ -296,7 +288,6 @@ void(entity attacker, float damage) sham_pain = {
sham_pain1();
};
//============================================================================
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
*/
void() monster_shambler = {

View File

@ -1,10 +1,4 @@
/*
==============================================================================
SOLDIER / PLAYER
==============================================================================
*/
// soldier.qc: Grunt
$cd id1 / models / soldier3
$origin 0 - 6 24
@ -109,7 +103,6 @@ void() army_atk7 = [ $shoot7, army_atk8 ] {ai_face(); SUB_CheckRefire(army_atk1)
void() army_atk8 = [ $shoot8, army_atk9 ] {ai_face();};
void() army_atk9 = [ $shoot9, army_run1 ] {ai_face();};
void() army_pain1 = [ $pain1, army_pain2 ] {};
void() army_pain2 = [ $pain2, army_pain3 ] {};
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(entity attacker, float damage) army_pain = {
local float r;
float r;
if(self.pain_finished > time) {
return;
@ -170,10 +163,9 @@ void(entity attacker, float damage) army_pain = {
}
};
void() army_fire = {
local vector dir;
local entity en;
vector dir;
entity en;
ai_face();
@ -189,7 +181,6 @@ void() army_fire = {
};
void() army_die1 = [ $death1, army_die2 ] {};
void() army_die2 = [ $death2, army_die3 ] {};
void() army_die3 = [ $death3, army_die4 ]
@ -215,7 +206,6 @@ void() army_cdie9 = [ $deathc9, army_cdie10 ] {};
void() army_cdie10 = [ $deathc10, army_cdie11 ] {};
void() army_cdie11 = [ $deathc11, army_cdie11 ] {};
void() army_die = {
// check for gib
if(self.health < -35) {
@ -236,7 +226,6 @@ void() army_die = {
}
};
/*QUAKED monster_army(1 0 0) (-16 -16 -24) (16 16 40) Ambush
*/
void() monster_army = {
@ -259,7 +248,6 @@ void() monster_army = {
precache_sound("player/udeath.wav"); // gib death
self.solid = SOLID_SLIDEBOX;
self.movetype = MOVETYPE_STEP;

View File

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

View File

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

View File

@ -1,10 +1,4 @@
/*
==============================================================================
BLOB
==============================================================================
*/
// tarbaby.qc: Spawn
$cd id1 / models / tarbaby
$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_run25 = [ $run25, tbaby_run1 ] {ai_run(2);};
//============================================================================
void() Tar_JumpTouch = {
local float ldmg;
float ldmg;
if(other.takedamage && other.classname != self.classname) {
if(vlen(self.velocity) > 400) {
@ -99,7 +91,6 @@ void() Tar_JumpTouch = {
sound(self, CHAN_WEAPON, "blob/land1.wav", 1, ATTN_NORM);
}
if(!checkbottom(self)) {
if(self.flags & FL_ONGROUND) {
// 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_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
*/
void() monster_tarbaby = {

View File

@ -1,3 +1,4 @@
// triggers.qc: triggerable entities
void() trigger_reactivate = {
self.solid = SOLID_TRIGGER;
@ -22,7 +23,6 @@ void() multi_wait = {
}
};
// the trigger was just touched/killed/used
// self.enemy should be set to the activator so it can be held through a delay
// so wait for the delay time before firing
@ -137,7 +137,6 @@ void() trigger_multiple = {
}
};
/*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
"targetname". If "health" is set, the trigger must be killed to activate.
@ -165,7 +164,6 @@ void() trigger_relay = {
self.use = SUB_UseTargets;
};
//=============================================================================
/*QUAKED trigger_secret(.5 .5 .5) ?
@ -200,9 +198,8 @@ void() trigger_secret = {
//=============================================================================
void() counter_use = {
local string junk;
string junk;
self.count = self.count - 1;
if(self.count < 0) {
@ -249,7 +246,6 @@ void() trigger_counter = {
self.use = counter_use;
};
/*
==============================================================================
@ -264,8 +260,8 @@ enum {
};
void() play_teleport = {
local float v;
local string tmpstr;
float v;
string tmpstr;
v = random() * 5;
if(v < 1) {
@ -285,7 +281,7 @@ void() play_teleport = {
};
void(vector org) spawn_tfog = {
local entity s;
entity s;
s = spawn();
s.origin = org;
@ -299,7 +295,6 @@ void(vector org) spawn_tfog = {
WriteCoord(MSG_BROADCAST, org_z);
};
void() tdeath_touch = {
if(other == self.owner) {
return;
@ -322,9 +317,8 @@ void() tdeath_touch = {
}
};
void(vector org, entity death_owner) spawn_tdeath = {
local entity death;
entity death;
death = spawn();
death.classname = "teledeath";
@ -342,8 +336,8 @@ void(vector org, entity death_owner) spawn_tdeath = {
};
void() teleport_touch = {
local entity t;
local vector org;
entity t;
vector org;
if(self.targetname) {
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.
*/
void() trigger_teleport = {
local vector o;
vector o;
InitTrigger();
self.touch = teleport_touch;
@ -467,7 +461,6 @@ void() trigger_setskill = {
self.touch = trigger_skill_touch;
};
/*
==============================================================================
@ -560,7 +553,6 @@ void() trigger_push_touch = {
}
};
/*QUAKED trigger_push(.5 .5 .5) ? PUSH_ONCE
Pushes the player
*/

View File

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

View File

@ -1,10 +1,4 @@
/*
==============================================================================
WIZARD
==============================================================================
*/
// wizard.qc: Scrag
$cd id1 / models / a_wizard
$origin 0 0 24
@ -45,8 +39,8 @@ if self.enemy maintains it's current velocity
=============
*/
void(entity missile, float mspeed, float accuracy) LaunchMissile = {
local vector vec, move;
local float fly;
vector vec, move;
float fly;
makevectors(self.angles);
@ -76,16 +70,15 @@ void(entity missile, float mspeed, float accuracy) LaunchMissile = {
missile.think = SUB_Remove;
};
/*
=================
WizardCheckAttack
=================
*/
float() WizardCheckAttack = {
local vector spot1, spot2;
local entity targ;
local float chance;
vector spot1, spot2;
entity targ;
float chance;
if(time < self.attack_finished) {
return FALSE;
@ -173,8 +166,8 @@ FAST ATTACKS
*/
void() Wiz_FastFire = {
local vector vec;
local vector dst;
vector vec;
vector dst;
if(self.owner.health > 0) {
self.owner.effects = self.owner.effects | EF_MUZZLEFLASH;
@ -193,9 +186,8 @@ void() Wiz_FastFire = {
remove(self);
};
void() Wiz_StartFast = {
local entity missile;
entity missile;
sound(self, CHAN_WEAPON, "wizard/wattack.wav", 1, ATTN_NORM);
self.v_angle = self.angles;
@ -223,9 +215,8 @@ void() Wiz_StartFast = {
};
void() Wiz_idlesound = {
local float wr;
float wr;
wr = random() * 5;
if(self.waitmin < time) {
@ -334,7 +325,6 @@ void() wiz_die = {
wiz_death1();
};
void(entity attacker, float damage) Wiz_Pain = {
sound(self, CHAN_VOICE, "wizard/wpain.wav", 1, ATTN_NORM);
if(random() * 70 > damage) {
@ -344,7 +334,6 @@ void(entity attacker, float damage) Wiz_Pain = {
wiz_pain1();
};
void() Wiz_Missile = {
wiz_fast1();
};

View File

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

View File

@ -1,10 +1,5 @@
/*
==============================================================================
// zombie.qc: Zombie
ZOMBIE
==============================================================================
*/
$cd id1 / models / zombie
$origin 0 0 24
@ -56,8 +51,6 @@ enum {
//=============================================================================
.float inpain;
void() zombie_stand1 = [ $stand1, zombie_stand2 ] {ai_stand();};
void() zombie_stand2 = [ $stand2, zombie_stand3 ] {ai_stand();};
void() zombie_stand3 = [ $stand3, zombie_stand4 ] {ai_stand();};
@ -167,8 +160,8 @@ ZombieFireGrenade
================
*/
void(vector st) ZombieFireGrenade = {
local entity missile, mpuff;
local vector org;
entity missile, mpuff;
vector org;
sound(self, CHAN_WEAPON, "zombie/z_shot1.wav", 1, ATTN_NORM);
@ -201,7 +194,6 @@ void(vector st) ZombieFireGrenade = {
setorigin(missile, org);
};
void() zombie_atta1 = [ $atta1, zombie_atta2 ] {ai_face();};
void() zombie_atta2 = [ $atta2, zombie_atta3 ] {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_missile = {
local float r;
float r;
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 = {
local float r;
float r;
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:
custom pronouns