add info to file headers and move globals to defs.qc

master
an 2019-09-16 21:43:31 -04:00
parent cee2b4b67a
commit 35e64ea09f
35 changed files with 144 additions and 217 deletions

View File

@ -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

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;

View File

@ -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;

View File

@ -1,4 +1,4 @@
// button and multiple button
// buttons.qc: button and multiple button
void() button_wait = {
self.state = STATE_TOP;

View File

@ -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) {

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;

View File

@ -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

View File

@ -1,10 +1,4 @@
/*
==============================================================================
DEMON
==============================================================================
*/
// demon.qc: Fiend
$cd id1 / models / demon3
$scale 0.8

View File

@ -1,10 +1,5 @@
/*
==============================================================================
// dog.qc: Rottweiler
DOG
==============================================================================
*/
$cd id1 / models / dog
$origin 0 0 24
$base base

View File

@ -1,3 +1,5 @@
// doors.qc: player-triggered moving brush entities
enum {
DOOR_START_OPEN = 1,
DOOR_DONT_LINK = 4,

View File

@ -1,10 +1,4 @@
/*
==============================================================================
SOLDIER / PLAYER
==============================================================================
*/
// enforcer.qc: Enforcer
$cd id1 / models / enforcer
$origin 0 - 6 24

View File

@ -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;

View File

@ -1,3 +1,5 @@
// fish.qc: Rotfish
$cd id1 / models / fish
$origin 0 0 24
$base base

View File

@ -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;

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";
@ -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 = {

View File

@ -1,10 +1,4 @@
/*
==============================================================================
KNIGHT
==============================================================================
*/
// knight.qc: Knight
$cd id1 / models / knight
$origin 0 0 24

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.
@ -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");

View File

@ -1,3 +1,4 @@
// models.qc: model information
/*
===============================================================================

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}

View File

@ -1,10 +1,4 @@
/*
==============================================================================
OGRE
==============================================================================
*/
// ogre.qc: Ogre
$cd id1 / models / ogre_c
$origin 0 0 24

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

View File

@ -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);

View File

@ -1,11 +1,4 @@
/*
==============================================================================
PLAYER
==============================================================================
*/
// player.qc: the player entity
$cd id1 / models / player_4
$origin 0 - 6 24

View File

@ -1,10 +1,5 @@
/*
==============================================================================
// shalrath.qc: Vore
SHAL-RATH
==============================================================================
*/
$cd id1 / models / shalrath
$origin 0 0 24
$base base

View File

@ -1,10 +1,4 @@
/*
==============================================================================
SHAMBLER
==============================================================================
*/
// shambler.qc: Shambler
$cd id1 / models / shams
$origin 0 0 24

View File

@ -1,10 +1,4 @@
/*
==============================================================================
SOLDIER / PLAYER
==============================================================================
*/
// soldier.qc: Grunt
$cd id1 / models / soldier3
$origin 0 - 6 24

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

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.

View File

@ -1,10 +1,4 @@
/*
==============================================================================
BLOB
==============================================================================
*/
// tarbaby.qc: Spawn
$cd id1 / models / tarbaby
$origin 0 0 24

View File

@ -1,3 +1,4 @@
// triggers.qc: triggerable entities
void() trigger_reactivate = {
self.solid = SOLID_TRIGGER;

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
@ -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) {

View File

@ -1,10 +1,4 @@
/*
==============================================================================
WIZARD
==============================================================================
*/
// wizard.qc: Scrag
$cd id1 / models / a_wizard
$origin 0 0 24

View File

@ -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

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();};