diff --git a/gmqcc.ini b/gmqcc.ini index 85d9c71..fa08bce 100644 --- a/gmqcc.ini +++ b/gmqcc.ini @@ -35,9 +35,9 @@ VARIADIC_ARGS = true [warnings] - ALL = true + ALL = true ASSIGN_FUNCTION_TYPES = false - USED_UNINITIALIZED = false + USED_UNINITIALIZED = false [optimizations] PEEPHOLE = true diff --git a/progs.src b/progs.src index 9b70b73..f01dbf9 100644 --- a/progs.src +++ b/progs.src @@ -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 diff --git a/source/ai.qc b/source/ai.qc index 592fb31..62015ce 100644 --- a/source/ai.qc +++ b/source/ai.qc @@ -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; diff --git a/source/boss.qc b/source/boss.qc index 75d3f7c..ad25daf 100644 --- a/source/boss.qc +++ b/source/boss.qc @@ -1,10 +1,5 @@ -/* -============================================================================== +// boss.qc: Chthon, boss of E1 -BOSS-ONE - -============================================================================== -*/ $cd id1 / models / boss1 $origin 0 0 - 15 $base base @@ -275,9 +270,6 @@ void() monster_boss = { //=========================================================================== -entity le1, le2; -float lightning_end; - void() lightning_fire = { local vector p1, p2; diff --git a/source/buttons.qc b/source/buttons.qc index da78473..ce0d40e 100644 --- a/source/buttons.qc +++ b/source/buttons.qc @@ -1,4 +1,4 @@ -// button and multiple button +// buttons.qc: button and multiple button void() button_wait = { self.state = STATE_TOP; diff --git a/source/client.qc b/source/client.qc index a0a4c2f..69e730a 100644 --- a/source/client.qc +++ b/source/client.qc @@ -1,16 +1,32 @@ -float modelindex_eyes, modelindex_player; +// client.qc: player-adjacent functions + +void() player_axe1; +void() player_axeb1; +void() player_axec1; +void() player_axed1; +void() player_die_ax1; +void() player_diea1; +void() player_dieb1; +void() player_diec1; +void() player_died1; +void() player_diee1; +void() player_light1; +void() player_nail1; +void() player_pain; +void() player_rocket1; +void() player_run; +void() player_run; +void() player_shot1; +void() player_stand1; /* ============================================================================= - 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' @@ -120,8 +136,6 @@ entity() FindIntermission = { objerror("FindIntermission: no spot"); }; - -string nextmap; void() GotoNextMap = { if(cvar("samelevel")) { // if samelevel is set, stay on same level changelevel(mapname); @@ -700,8 +714,6 @@ WaterMove ============ */ -.float dmgtime; - void() WaterMove = { //dprint(ftos(self.waterlevel)); if(self.movetype == MOVETYPE_NOCLIP) { diff --git a/source/combat.qc b/source/combat.qc index aac5c69..15893be 100644 --- a/source/combat.qc +++ b/source/combat.qc @@ -1,4 +1,4 @@ -//============================================================================ +// combat.qc: entity-entity damage functions float(entity targ, entity attacker) SameTeam = { return targ.team > 0 && targ.team == attacker.team; diff --git a/source/defs.qc b/source/defs.qc index a025a36..529cd02 100644 --- a/source/defs.qc +++ b/source/defs.qc @@ -1,3 +1,5 @@ +// defs.qc: global definitions + // system globals ------------------------------------------------------------| #pragma noref 1 entity self; @@ -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; @@ -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,14 +618,24 @@ 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; @@ -597,9 +645,20 @@ 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; +// 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; + +float() crandom; float() DemonCheckAttack; float() DogCheckAttack; -float() W_BestWeapon; float() WizardCheckAttack; float(entity targ) infront; float(entity targ) range; @@ -607,6 +666,7 @@ float(entity targ) visible; float(entity targ, entity attacker) SameTeam; float(float v) anglemod; void() DecodeLevelParms; +void(entity ent) CopyToBodyQue; void() Demon_JumpTouch; void() InitBodyQue; void() PlayerDie; @@ -664,28 +724,10 @@ void() plat_go_down; void() plat_go_up; void() plat_outside_touch; void() plat_trigger_use; -void() player_axe1; -void() player_axeb1; -void() player_axec1; -void() player_axed1; -void() player_die_ax1; -void() player_diea1; -void() player_dieb1; -void() player_diec1; -void() player_died1; -void() player_diee1; -void() player_light1; -void() player_nail1; -void() player_pain; -void() player_rocket1; -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(vector org, vector dir) launch_spike; void() sham_swingl1; void() sham_swingr1; void() sham_swingr1; @@ -704,10 +746,13 @@ 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() BecomeExplosion; + +void(vector org) spawn_tfog; +void(vector org, entity death_owner) spawn_tdeath; + void(vector p) boss_missile; // EOF diff --git a/source/demon.qc b/source/demon.qc index ee2be8c..b0ee3ca 100644 --- a/source/demon.qc +++ b/source/demon.qc @@ -1,10 +1,4 @@ -/* -============================================================================== - -DEMON - -============================================================================== -*/ +// demon.qc: Fiend $cd id1 / models / demon3 $scale 0.8 diff --git a/source/dog.qc b/source/dog.qc index ad03cd4..4f8128c 100644 --- a/source/dog.qc +++ b/source/dog.qc @@ -1,10 +1,5 @@ -/* -============================================================================== +// dog.qc: Rottweiler -DOG - -============================================================================== -*/ $cd id1 / models / dog $origin 0 0 24 $base base diff --git a/source/doors.qc b/source/doors.qc index 0c3c617..d822807 100644 --- a/source/doors.qc +++ b/source/doors.qc @@ -1,3 +1,5 @@ +// doors.qc: player-triggered moving brush entities + enum { DOOR_START_OPEN = 1, DOOR_DONT_LINK = 4, diff --git a/source/enforcer.qc b/source/enforcer.qc index a445fe1..8c1e1c0 100644 --- a/source/enforcer.qc +++ b/source/enforcer.qc @@ -1,10 +1,4 @@ -/* -============================================================================== - -SOLDIER / PLAYER - -============================================================================== -*/ +// enforcer.qc: Enforcer $cd id1 / models / enforcer $origin 0 - 6 24 diff --git a/source/fight.qc b/source/fight.qc index 57ae503..3fd61f6 100644 --- a/source/fight.qc +++ b/source/fight.qc @@ -1,3 +1,4 @@ +// fight.qc: monster attack functions /* @@ -8,10 +9,6 @@ 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; diff --git a/source/fish.qc b/source/fish.qc index cbc9895..2abb6b0 100644 --- a/source/fish.qc +++ b/source/fish.qc @@ -1,3 +1,5 @@ +// fish.qc: Rotfish + $cd id1 / models / fish $origin 0 0 24 $base base diff --git a/source/hknight.qc b/source/hknight.qc index 59eda7a..e6ec918 100644 --- a/source/hknight.qc +++ b/source/hknight.qc @@ -1,10 +1,4 @@ -/* -============================================================================== - -KNIGHT - -============================================================================== -*/ +// hknight.qc: Death Knight $cd id1 / models / knight2 $origin 0 0 24 @@ -376,8 +370,6 @@ void(entity attacker, float damage) hknight_pain = { hknight_pain1(); }; -float hknight_type; - void() hknight_melee = { hknight_type = hknight_type + 1; diff --git a/source/items.qc b/source/items.qc index 90616d5..1766dec 100644 --- a/source/items.qc +++ b/source/items.qc @@ -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"; @@ -131,7 +133,6 @@ enum { H_ROTTEN = 1, H_MEGA = 2, }; -.float healamount, healtype; void() item_health = { self.touch = health_touch; @@ -380,8 +381,6 @@ 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 = { diff --git a/source/knight.qc b/source/knight.qc index 6588fd1..153f3c8 100644 --- a/source/knight.qc +++ b/source/knight.qc @@ -1,10 +1,4 @@ -/* -============================================================================== - -KNIGHT - -============================================================================== -*/ +// knight.qc: Knight $cd id1 / models / knight $origin 0 0 24 diff --git a/source/misc.qc b/source/misc.qc index 7e91e05..3c26730 100644 --- a/source/misc.qc +++ b/source/misc.qc @@ -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. @@ -342,9 +343,7 @@ void() trap_shooter = { testing air bubbles */ -void() air_bubbles = - -{ +void() air_bubbles = { if(deathmatch) { remove(self); return; @@ -612,9 +611,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"); diff --git a/source/models.qc b/source/models.qc index b246358..53bd7b8 100644 --- a/source/models.qc +++ b/source/models.qc @@ -1,3 +1,4 @@ +// models.qc: model information /* =============================================================================== diff --git a/source/monsters.qc b/source/monsters.qc index 5f53dae..f8833af 100644 --- a/source/monsters.qc +++ b/source/monsters.qc @@ -1,3 +1,5 @@ +// monsters.qc: basic monster functions + /* ALL MONSTERS SHOULD BE 1 0 0 IN COLOR */ // name =[framenum, nexttime, nextthink] {code} diff --git a/source/ogre.qc b/source/ogre.qc index 9fe993c..f269e01 100644 --- a/source/ogre.qc +++ b/source/ogre.qc @@ -1,10 +1,4 @@ -/* -============================================================================== - -OGRE - -============================================================================== -*/ +// ogre.qc: Ogre $cd id1 / models / ogre_c $origin 0 0 24 diff --git a/source/oldone.qc b/source/oldone.qc index 9f9fd7c..0ed94a9 100644 --- a/source/oldone.qc +++ b/source/oldone.qc @@ -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 diff --git a/source/plats.qc b/source/plats.qc index 27a3718..321373c 100644 --- a/source/plats.qc +++ b/source/plats.qc @@ -1,3 +1,5 @@ +// plats.qc: moving platforms + enum { PLAT_LOW_TRIGGER = 1, }; @@ -136,9 +138,7 @@ Set "sounds" to one of the following: */ -void() func_plat = - -{ +void() func_plat = { local entity t; if(!self.t_length) { @@ -249,9 +249,7 @@ void() train_next = { SUB_CalcMove(targ.origin - self.mins, self.speed, train_wait); }; -void() func_train_find = - -{ +void() func_train_find = { local entity targ; targ = find(world, targetname, self.target); diff --git a/source/player.qc b/source/player.qc index 12fa187..4a1434c 100644 --- a/source/player.qc +++ b/source/player.qc @@ -1,11 +1,4 @@ - -/* -============================================================================== - -PLAYER - -============================================================================== -*/ +// player.qc: the player entity $cd id1 / models / player_4 $origin 0 - 6 24 diff --git a/source/shalrath.qc b/source/shalrath.qc index 190e955..b633e22 100644 --- a/source/shalrath.qc +++ b/source/shalrath.qc @@ -1,10 +1,5 @@ -/* -============================================================================== +// shalrath.qc: Vore -SHAL-RATH - -============================================================================== -*/ $cd id1 / models / shalrath $origin 0 0 24 $base base diff --git a/source/shambler.qc b/source/shambler.qc index 064d596..3de245d 100644 --- a/source/shambler.qc +++ b/source/shambler.qc @@ -1,10 +1,4 @@ -/* -============================================================================== - -SHAMBLER - -============================================================================== -*/ +// shambler.qc: Shambler $cd id1 / models / shams $origin 0 0 24 diff --git a/source/soldier.qc b/source/soldier.qc index 29f4f6f..5004202 100644 --- a/source/soldier.qc +++ b/source/soldier.qc @@ -1,10 +1,4 @@ -/* -============================================================================== - -SOLDIER / PLAYER - -============================================================================== -*/ +// soldier.qc: Grunt $cd id1 / models / soldier3 $origin 0 - 6 24 diff --git a/source/sprites.qc b/source/sprites.qc index eb26780..e0415cf 100644 --- a/source/sprites.qc +++ b/source/sprites.qc @@ -1,5 +1,4 @@ - -// these are the only sprites still in the game... +// sprites.qc: sprite information $spritename s_explod $type vp_parallel diff --git a/source/subs.qc b/source/subs.qc index 10096ae..5e67f7a 100644 --- a/source/subs.qc +++ b/source/subs.qc @@ -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. diff --git a/source/tarbaby.qc b/source/tarbaby.qc index 5cb61d2..7ff6082 100644 --- a/source/tarbaby.qc +++ b/source/tarbaby.qc @@ -1,10 +1,4 @@ -/* -============================================================================== - -BLOB - -============================================================================== -*/ +// tarbaby.qc: Spawn $cd id1 / models / tarbaby $origin 0 0 24 diff --git a/source/triggers.qc b/source/triggers.qc index 57e7d20..01a9041 100644 --- a/source/triggers.qc +++ b/source/triggers.qc @@ -1,3 +1,4 @@ +// triggers.qc: triggerable entities void() trigger_reactivate = { self.solid = SOLID_TRIGGER; diff --git a/source/weapons.qc b/source/weapons.qc index 662edd6..b665272 100644 --- a/source/weapons.qc +++ b/source/weapons.qc @@ -1,3 +1,5 @@ +// weapons.qc: weapon functions + // called by worldspawn void() W_Precache = { precache_sound("weapons/r_exp3.wav"); // new rocket explosion @@ -138,9 +140,6 @@ Collects multiple small damages into a single damage ============================================================================== */ -entity multi_ent; -float multi_damage; - void() ClearMultiDamage = { multi_ent = world; multi_damage = 0; @@ -617,9 +616,6 @@ void(float ox) W_FireSpikes = { self.punchangle_x = -2; }; - - -.float hit_z; void() spike_touch = { local float rand; if(other == self.owner) { diff --git a/source/wizard.qc b/source/wizard.qc index 627df84..15809d1 100644 --- a/source/wizard.qc +++ b/source/wizard.qc @@ -1,10 +1,4 @@ -/* -============================================================================== - -WIZARD - -============================================================================== -*/ +// wizard.qc: Scrag $cd id1 / models / a_wizard $origin 0 0 24 diff --git a/source/world.qc b/source/world.qc index 5849cc1..b740e80 100644 --- a/source/world.qc +++ b/source/world.qc @@ -1,3 +1,5 @@ +// world.qc: basic entry point functions + void() main = { dprint("main function\n"); @@ -150,8 +152,6 @@ void() main = { }; -entity lastspawn; - //======================= /*QUAKED worldspawn(0 0 0) ? Only used for the world entity. @@ -344,8 +344,6 @@ BODY QUE ============================================================================== */ -entity bodyque_head; - void() bodyque = { // just here so spawn functions don't complain after the world // creates bodyques diff --git a/source/zombie.qc b/source/zombie.qc index ddebe47..c34cbde 100644 --- a/source/zombie.qc +++ b/source/zombie.qc @@ -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();};