remove local and extraneous whitespace

master
an 2019-09-17 11:26:44 -04:00
parent bd05a9b762
commit f48bed0dc8
34 changed files with 353 additions and 523 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

@ -34,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");
@ -53,7 +52,6 @@ void() path_corner = {
movetarget_f();
};
/*
=============
t_movetarget
@ -63,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;
@ -92,7 +90,6 @@ void() t_movetarget = {
};
//============================================================================
/*
@ -107,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;
@ -133,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;
@ -149,7 +146,6 @@ float(entity targ) visible = {
return FALSE;
};
/*
=============
infront
@ -158,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);
@ -171,7 +167,6 @@ float(entity targ) infront = {
return FALSE;
};
//============================================================================
void() HuntTarget = {
@ -183,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);
@ -254,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
@ -322,7 +317,6 @@ float() FindTarget = {
return TRUE;
};
//=============================================================================
void(float dist) ai_forward = {
@ -333,7 +327,6 @@ void(float dist) ai_back = {
walkmove((self.angles_y + 180), dist);
};
/*
=============
ai_pain
@ -344,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) );
@ -372,7 +365,7 @@ The monster is walking it's beat
=============
*/
void(float dist) ai_walk = {
local vector mtemp;
vector mtemp;
movedist = dist;
@ -388,7 +381,6 @@ void(float dist) ai_walk = {
movetogoal(dist);
};
/*
=============
ai_stand
@ -433,7 +425,7 @@ ChooseTurn
=============
*/
void(vector dest3) ChooseTurn = {
local vector dir, newdir;
vector dir, newdir;
dir = self.origin - dest3;
@ -460,7 +452,7 @@ FacingIdeal
============
*/
float() FacingIdeal = {
local float delta;
float delta;
delta = anglemod(self.angles_y - self.ideal_yaw);
if(delta > 45 && delta < 315) {
@ -469,7 +461,6 @@ float() FacingIdeal = {
return TRUE;
};
//=============================================================================
float() CheckAnyAttack = {
@ -497,7 +488,6 @@ float() CheckAnyAttack = {
return CheckAttack();
};
/*
=============
ai_run_melee
@ -515,7 +505,6 @@ void() ai_run_melee = {
}
};
/*
=============
ai_run_missile
@ -532,7 +521,6 @@ void() ai_run_missile = {
}
};
/*
=============
ai_run_slide
@ -541,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();
@ -560,7 +548,6 @@ void() ai_run_slide = {
walkmove(self.ideal_yaw - ofs, movedist);
};
/*
=============
ai_run
@ -569,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

@ -29,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
@ -182,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);
@ -217,7 +216,6 @@ void(vector p) boss_missile = {
}
};
void() boss_awake = {
self.solid = SOLID_SLIDEBOX;
self.movetype = MOVETYPE_STEP;
@ -244,7 +242,6 @@ void() boss_awake = {
boss_rise1();
};
/*QUAKED monster_boss(1 0 0) (-128 -128 -24) (128 128 256)
*/
void() monster_boss = {
@ -271,7 +268,7 @@ void() monster_boss = {
//===========================================================================
void() lightning_fire = {
local vector p1, p2;
vector p1, p2;
if(time >= lightning_end) {
// done here, put the terminals back up
@ -318,8 +315,8 @@ void() lightning_use = {
}
if((le1.state != STATE_TOP && le1.state != STATE_BOTTOM)
|| (le2.state != STATE_TOP && le2.state != STATE_BOTTOM)
|| (le1.state != le2.state)) {
|| (le2.state != STATE_TOP && le2.state != STATE_BOTTOM)
|| (le1.state != le2.state)) {
// dprint("not aligned\n");
return;
}
@ -351,7 +348,6 @@ void() lightning_use = {
}
};
/*QUAKED event_lightning(0 1 1) (-16 -16 -16) (16 16 16)
Just for boss level.
*/
@ -359,4 +355,3 @@ void() event_lightning = {
self.use = lightning_use;
};

View File

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

@ -84,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");
@ -125,7 +125,6 @@ void() GotoNextMap = {
}
};
void() ExitIntermission = {
// skip any text in deathmatch
if(deathmatch) {
@ -213,7 +212,7 @@ void() IntermissionThink = {
};
void() execute_changelevel = {
local entity pos;
entity pos;
intermission_running = 1;
@ -247,9 +246,8 @@ void() execute_changelevel = {
WriteByte(MSG_ALL, SVC_INTERMISSION);
};
void() changelevel_touch = {
local entity pos;
entity pos;
if(other.classname != "player") {
return;
@ -295,7 +293,6 @@ void() trigger_changelevel = {
self.touch = changelevel_touch;
};
/*
=============================================================================
@ -326,7 +323,6 @@ void() respawn = {
}
};
/*
============
ClientKill
@ -355,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");
@ -422,7 +418,7 @@ called each time a player is spawned
============
*/
void() PutClientInServer = {
local entity spot;
entity spot;
spot = SelectSpawnPoint();
@ -482,7 +478,6 @@ void() PutClientInServer = {
spawn_tdeath(self.origin, self);
};
/*
=============================================================================
@ -491,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
*/
@ -537,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")) {
@ -585,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;
@ -609,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);
@ -642,9 +634,8 @@ void() PlayerDeathThink = {
respawn();
};
void() PlayerJump = {
local vector start, end;
vector start, end;
if(self.flags & FL_WATERJUMP) {
return;
@ -688,7 +679,6 @@ void() PlayerJump = {
self.velocity_z = self.velocity_z + 270;
};
/*
===========
WaterMove
@ -772,7 +762,7 @@ void() WaterMove = {
};
void() CheckWaterJump = {
local vector start, end;
vector start, end;
// check for a jump-out-of-water
makevectors(self.angles);
@ -799,7 +789,6 @@ void() CheckWaterJump = {
}
};
/*
================
PlayerPreThink
@ -808,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
@ -981,7 +970,6 @@ void() CheckPowerups = {
};
/*
================
PlayerPostThink
@ -990,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
@ -1025,7 +1013,6 @@ void() PlayerPostThink = {
CheckPowerups();
};
/*
===========
ClientConnect
@ -1043,7 +1030,6 @@ void() ClientConnect = {
}
};
/*
===========
ClientDisconnect
@ -1075,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

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

@ -77,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;
@ -236,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;

View File

@ -92,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);};
@ -163,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
*/
@ -206,7 +203,6 @@ void() monster_demon1 = {
walkmonster_start();
};
/*
==============================================================================
@ -238,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) {
@ -270,7 +266,7 @@ float() CheckDemonJump = {
};
float() DemonCheckAttack = {
local vector vec;
vector vec;
// if close enough for slashing, go for it
if(CheckDemonMelee()) {
@ -287,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
@ -314,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

@ -25,7 +25,6 @@ $frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9
$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8
/*
================
dog_bite
@ -33,8 +32,8 @@ dog_bite
================
*/
void() dog_bite = {
local vector delta;
local float ldmg;
vector delta;
float ldmg;
if(!self.enemy) {
return;
@ -57,7 +56,7 @@ void() dog_bite = {
};
void() Dog_JumpTouch = {
local float ldmg;
float ldmg;
if(self.health <= 0) {
return;
@ -90,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();};
@ -220,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) {
@ -268,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) {
@ -298,7 +295,7 @@ float() CheckDogJump = {
};
float() DogCheckAttack = {
local vector vec;
vector vec;
// if close enough for slashing, go for it
if(CheckDogMelee()) {
@ -314,7 +311,6 @@ float() DogCheckAttack = {
return FALSE;
};
//===========================================================================
/*QUAKED monster_dog(1 0 0) (-32 -32 -24) (32 32 40) Ambush

View File

@ -43,7 +43,6 @@ void() door_blocked = {
}
};
void() door_hit_top = {
sound(self, CHAN_VOICE, self.noise1, 1, ATTN_NORM);
self.state = STATE_TOP;
@ -88,7 +87,6 @@ void() door_go_up = {
SUB_UseTargets();
};
/*
=============================================================================
@ -98,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");
@ -135,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 = "";
@ -148,7 +145,6 @@ void() door_use = {
self = oself;
};
void() door_trigger_touch = {
if(other.health <= 0) {
return;
@ -165,9 +161,8 @@ void() door_trigger_touch = {
door_use();
};
void() door_killed = {
local entity oself;
entity oself;
oself = self;
self = self.owner;
@ -177,7 +172,6 @@ void() door_killed = {
self = oself;
};
/*
================
door_touch
@ -249,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;
@ -266,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;
@ -289,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
@ -373,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.
@ -452,7 +441,6 @@ void() func_door =
self.noise2 = "doors/ddoor1.wav";
}
SetMovedir();
self.max_health = self.health;
@ -531,9 +519,8 @@ enum {
SECRET_YES_SHOOT = 16, // shootable even if targeted
};
void() fd_secret_use = {
local float temp;
float temp;
self.health = 10000;
@ -663,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

@ -31,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
@ -62,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);
@ -90,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);
@ -162,8 +160,8 @@ void() enf_atk11 = [ $attack7, enf_atk12 ] {ai_face();};
void() enf_atk12 = [ $attack8, enf_atk13 ] {ai_face();};
void() enf_atk13 = [ $attack9, enf_atk14 ] {ai_face();};
void() enf_atk14 = [ $attack10, enf_run1 ] {ai_face();
SUB_CheckRefire(enf_atk1);
};
SUB_CheckRefire(enf_atk1);
};
void() enf_paina1 = [ $paina1, enf_paina2 ] {};
void() enf_paina2 = [ $paina2, enf_paina3 ] {};
@ -206,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 {
@ -239,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 ]
@ -271,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) {
@ -292,7 +287,6 @@ void() enf_die = {
}
};
/*QUAKED monster_enforcer(1 0 0) (-16 -16 -24) (16 16 40) Ambush
*/

View File

@ -10,7 +10,7 @@ When it decides it can't attack, it goes into hunt mode.
*/
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));
@ -33,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;
@ -106,7 +106,6 @@ float() CheckAttack = {
return FALSE;
};
/*
=============
ai_face
@ -132,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
@ -147,7 +146,6 @@ void() ai_charge_side = {
walkmove(heading, 20);
};
/*
=============
ai_melee
@ -155,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
@ -172,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
@ -195,7 +192,6 @@ void() ai_melee_side = {
T_Damage(self.enemy, self, self, ldmg);
};
//=============================================================================
/*
@ -207,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;
@ -227,7 +223,6 @@ float() SoldierCheckAttack = {
return FALSE; // don't have a clear shot
}
// missile attack
if(time < self.attack_finished) {
return FALSE;
@ -269,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)) {
@ -330,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

@ -62,7 +62,7 @@ void() f_run1 = [ $swim1, f_run2 ] {ai_run(12);
if(random() < 0.5) {
sound(self, CHAN_VOICE, "fish/idle.wav", 1, ATTN_NORM);
}
};
};
void() f_run2 = [ $swim3, f_run3 ] {ai_run(12);};
void() f_run3 = [ $swim5, f_run4 ] {ai_run(12);};
void() f_run4 = [ $swim7, f_run5 ] {ai_run(12);};
@ -73,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
@ -151,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

@ -52,8 +52,8 @@ void() hknight_idle_sound = {
};
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;
@ -216,7 +216,6 @@ void() hknight_die = {
}
};
//============================================================================
void() hknight_magica1 = [ $magica1, hknight_magica2 ] {ai_face();};
@ -394,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

@ -11,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;
}
};
@ -60,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
@ -165,8 +173,8 @@ void() item_health = {
void() health_touch = {
local float amount;
local string s;
float amount;
string s;
if(other.classname != "player") {
return;
@ -245,7 +253,7 @@ ARMOR
*/
void() armor_touch = {
local float type, value, bit;
float type, value, bit;
if(other.health <= 0) {
return;
@ -384,7 +392,7 @@ Deathmatch weapon change rules for picking up a weapon
=============
*/
void(float old, float new) Deathmatch_Weapon = {
local float or, nr;
float or, nr;
// change self.weapon if desired
or = RankForWeapon(self.weapon);
@ -400,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;
@ -598,8 +606,8 @@ AMMO
*/
void() ammo_touch = {
local entity stemp;
local float best;
entity stemp;
float best;
if(other.classname != "player") {
return;
@ -846,8 +854,8 @@ KEYS
*/
void() key_touch = {
local entity stemp;
local float best;
entity stemp;
float best;
if(other.classname != "player") {
return;
@ -906,18 +914,18 @@ following:
void() item_key1 = {
self.netname = Key1Name();
switch(world.worldtype) {
case 0:
precache_model("progs/w_s_key.mdl");
setmodel(self, "progs/w_s_key.mdl");
break;
case 1:
precache_model("progs/m_s_key.mdl");
setmodel(self, "progs/m_s_key.mdl");
break;
case 2:
precache_model2("progs/b_s_key.mdl");
setmodel(self, "progs/b_s_key.mdl");
break;
case 0:
precache_model("progs/w_s_key.mdl");
setmodel(self, "progs/w_s_key.mdl");
break;
case 1:
precache_model("progs/m_s_key.mdl");
setmodel(self, "progs/m_s_key.mdl");
break;
case 2:
precache_model2("progs/b_s_key.mdl");
setmodel(self, "progs/b_s_key.mdl");
break;
}
key_setsounds();
self.touch = key_touch;
@ -940,18 +948,18 @@ following:
void() item_key2 = {
self.netname = Key2Name();
switch(world.worldtype) {
case 0:
precache_model("progs/w_g_key.mdl");
setmodel(self, "progs/w_g_key.mdl");
break;
case 1:
precache_model("progs/m_g_key.mdl");
setmodel(self, "progs/m_g_key.mdl");
break;
case 2:
precache_model2("progs/b_g_key.mdl");
setmodel(self, "progs/b_g_key.mdl");
break;
case 0:
precache_model("progs/w_g_key.mdl");
setmodel(self, "progs/w_g_key.mdl");
break;
case 1:
precache_model("progs/m_g_key.mdl");
setmodel(self, "progs/m_g_key.mdl");
break;
case 2:
precache_model2("progs/b_g_key.mdl");
setmodel(self, "progs/b_g_key.mdl");
break;
}
key_setsounds();
self.touch = key_touch;
@ -971,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;
@ -1038,8 +1046,8 @@ POWERUPS
*/
void() powerup_touch = {
local entity stemp;
local float best;
entity stemp;
float best;
if(other.classname != "player") {
return;
@ -1180,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;
@ -1205,10 +1213,10 @@ void() BackpackTouch = {
self = stemp;
// change weapons
other.ammo_shells = other.ammo_shells + self.ammo_shells;
other.ammo_nails = other.ammo_nails + self.ammo_nails;
other.ammo_shells = other.ammo_shells + self.ammo_shells;
other.ammo_nails = other.ammo_nails + self.ammo_nails;
other.ammo_rockets = other.ammo_rockets + self.ammo_rockets;
other.ammo_cells = other.ammo_cells + self.ammo_cells;
other.ammo_cells = other.ammo_cells + self.ammo_cells;
new = self.items;
if(!new) {
@ -1295,7 +1303,7 @@ DropBackpack
===============
*/
entity() DropBackpack = {
local entity item;
entity item;
item = spawn();
item.origin = self.origin - '0 0 24';
@ -1303,21 +1311,39 @@ 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;
item.ammo_nails = self.ammo_nails;
item.ammo_shells = self.ammo_shells;
item.ammo_nails = self.ammo_nails;
item.ammo_rockets = self.ammo_rockets;
item.ammo_cells = self.ammo_cells;
item.ammo_cells = self.ammo_cells;
item.velocity_z = 300;
item.velocity_x = -100 + (random() * 200);

View File

@ -69,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);
@ -84,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);
@ -115,8 +113,8 @@ void() knight_atk5 = [ $attackb5, knight_atk6 ] {ai_charge(3);};
void() knight_atk6 = [ $attackb6, knight_atk7 ] {ai_charge(4); ai_melee();};
void() knight_atk7 = [ $attackb7, knight_atk8 ] {ai_charge(1); ai_melee();};
void() knight_atk8 = [ $attackb8, knight_atk9 ] {ai_charge(3);
ai_melee();
};
ai_melee();
};
void() knight_atk9 = [ $attackb9, knight_atk10] {ai_charge(1);};
void() knight_atk10 = [ $attackb10, knight_run1 ] {ai_charge(5);};
@ -143,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;
@ -178,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 ]
@ -191,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 ]
@ -205,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) {
@ -226,7 +221,6 @@ void() knight_die = {
}
};
/*QUAKED monster_knight(1 0 0) (-16 -16 -24) (16 16 40) Ambush
*/
void() monster_knight = {

View File

@ -150,7 +150,6 @@ void() light_flame_small_white = {
//============================================================================
/*QUAKED misc_fireball(0 .5 .8) (-8 -8 -8) (8 8 8)
Lava Balls
*/
@ -166,7 +165,7 @@ void() misc_fireball = {
};
void() fire_fly = {
local entity fireball;
entity fireball;
fireball = spawn();
fireball.solid = SOLID_TRIGGER;
@ -187,7 +186,6 @@ void() fire_fly = {
self.think = fire_fly;
};
void() fire_touch = {
T_Damage(other, self, self, 20);
remove(self);
@ -195,7 +193,6 @@ void() fire_touch = {
//============================================================================
void() barrel_explode = {
self.takedamage = DAMAGE_NO;
self.classname = "explo_box";
@ -209,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;
@ -239,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;
@ -294,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.
@ -312,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)
@ -329,15 +322,12 @@ void() trap_shooter = {
};
/*
===============================================================================
===============================================================================
*/
/*QUAKED air_bubbles(0 .5 .8) (-8 -8 -8) (8 8 8)
testing air bubbles
@ -354,7 +344,7 @@ void() air_bubbles = {
};
void() make_bubbles = {
local entity bubble;
entity bubble;
bubble = spawn();
setmodel(bubble, "progs/s_bubble.spr");
@ -374,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);
@ -404,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) {
@ -465,7 +455,6 @@ void() viewthing =
setmodel(self, "progs/player.mdl");
};
/*
==============================================================================
@ -490,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.
*/

View File

@ -16,7 +16,6 @@ $base base
$skin skin
$frame shot1
$modelname g_nail
$cd id1 / models / g_nail
$flags 8 // client side rotate
@ -25,7 +24,6 @@ $base base
$skin skin
$frame shot1
$modelname g_nail2
$cd id1 / models / g_nail2
$flags 8 // client side rotate
@ -34,7 +32,6 @@ $base base
$skin skin
$frame shot2
$modelname g_rock
$cd id1 / models / g_rock
$flags 8 // client side rotate
@ -43,7 +40,6 @@ $base base
$skin skin
$frame shot1
$modelname g_rock2
$cd id1 / models / g_rock2
$flags 8 // client side rotate
@ -75,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
@ -83,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
@ -91,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
@ -99,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
@ -107,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
@ -115,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
@ -130,7 +120,6 @@ $base base
$skin skin
$frame shot1 shot2 shot3 shot4 shot5
/*
===============================================================================
@ -181,7 +170,6 @@ $base base
$skin skin
$frame frame1
$modelname quaddama
$cd id1 / models / quaddama
$flags 8 // client side rotate
@ -259,7 +247,6 @@ $base base
$skin skin
$frame frame1
/*
===============================================================================
@ -276,7 +263,6 @@ $base base
$skin skin
$frame frame1
// torso
$modelname gib2
$cd id1 / models / gib2
@ -294,7 +280,6 @@ $base base
$skin skin
$frame frame1
// heads
$modelname h_player

View File

@ -12,7 +12,6 @@
// <code>
// };
/*
================
monster_use
@ -53,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) {
@ -71,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();
@ -122,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
@ -132,7 +129,6 @@ void() walkmonster_start = {
};
void() flymonster_start_go = {
self.takedamage = DAMAGE_AIM;
@ -179,7 +175,6 @@ void() flymonster_start = {
total_monsters = total_monsters + 1;
};
void() swimmonster_start_go = {
if(deathmatch) {
remove(self);
@ -225,4 +220,3 @@ void() swimmonster_start = {
total_monsters = total_monsters + 1;
};

View File

@ -43,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);
@ -81,7 +80,7 @@ OgreFireGrenade
================
*/
void() OgreFireGrenade = {
local entity missile, mpuff;
entity missile, mpuff;
self.effects = self.effects | EF_MUZZLEFLASH;
@ -115,7 +114,6 @@ void() OgreFireGrenade = {
setorigin(missile, self.origin);
};
//=============================================================================
/*
@ -126,8 +124,8 @@ FIXME
================
*/
void(float side) chainsaw = {
local vector delta;
local float ldmg;
vector delta;
float ldmg;
if(!self.enemy) {
return;
@ -157,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();};
@ -204,7 +201,7 @@ void() ogre_run1 = [ $run1, ogre_run2 ] {ai_run(9);
if(random() < 0.2) {
sound(self, CHAN_VOICE, "ogre/ogidle2.wav", 1, ATTN_IDLE);
}
};
};
void() ogre_run2 = [ $run2, ogre_run3 ] {ai_run(12);};
void() ogre_run3 = [ $run3, ogre_run4 ] {ai_run(8);};
void() ogre_run4 = [ $run4, ogre_run5 ] {ai_run(22);};
@ -214,8 +211,8 @@ void() ogre_run7 = [ $run7, ogre_run8 ] {ai_run(13);};
void() ogre_run8 = [ $run8, ogre_run1 ] {ai_run(24);};
void() ogre_swing1 = [ $swing1, ogre_swing2 ] {ai_charge(11);
sound(self, CHAN_WEAPON, "ogre/ogsawatk.wav", 1, ATTN_NORM);
};
sound(self, CHAN_WEAPON, "ogre/ogsawatk.wav", 1, ATTN_NORM);
};
void() ogre_swing2 = [ $swing2, ogre_swing3 ] {ai_charge(1);};
void() ogre_swing3 = [ $swing3, ogre_swing4 ] {ai_charge(4);};
void() ogre_swing4 = [ $swing4, ogre_swing5 ] {ai_charge(13);};
@ -231,8 +228,8 @@ void() ogre_swing13 = [ $swing13, ogre_swing14 ] {ai_charge(8);};
void() ogre_swing14 = [ $swing14, ogre_run1 ] {ai_charge(9);};
void() ogre_smash1 = [ $smash1, ogre_smash2 ] {ai_charge(6);
sound(self, CHAN_WEAPON, "ogre/ogsawatk.wav", 1, ATTN_NORM);
};
sound(self, CHAN_WEAPON, "ogre/ogsawatk.wav", 1, ATTN_NORM);
};
void() ogre_smash2 = [ $smash2, ogre_smash3 ] {ai_charge(0);};
void() ogre_smash3 = [ $smash3, ogre_smash4 ] {ai_charge(0);};
void() ogre_smash4 = [ $smash4, ogre_smash5 ] {ai_charge(1);};
@ -243,9 +240,9 @@ void() ogre_smash8 = [ $smash8, ogre_smash9 ] {ai_charge(10); chainsaw(0);};
void() ogre_smash9 = [ $smash9, ogre_smash10 ] {ai_charge(13); chainsaw(0);};
void() ogre_smash10 = [ $smash10, ogre_smash11 ] {chainsaw(1);};
void() ogre_smash11 = [ $smash11, ogre_smash12 ] {ai_charge(2);
chainsaw(0);
self.nextthink = self.nextthink + random() * 0.2;
}; // slight variation
chainsaw(0);
self.nextthink = self.nextthink + random() * 0.2;
}; // slight variation
void() ogre_smash12 = [ $smash12, ogre_smash13 ] {ai_charge(0);};
void() ogre_smash13 = [ $smash13, ogre_smash14 ] {ai_charge(4);};
void() ogre_smash14 = [ $smash14, ogre_run1 ] {ai_charge(12);};
@ -264,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 ] {};
@ -277,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);};
@ -311,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) {
@ -404,7 +397,6 @@ void() ogre_melee = {
}
};
/*QUAKED monster_ogre(1 0 0) (-32 -32 -24) (32 32 64) Ambush
*/
@ -448,4 +440,3 @@ void() monster_ogre_marksman = {
monster_ogre();
};

View File

@ -65,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");};
@ -81,11 +80,11 @@ void() old_thrash12 = [ $shake12, old_thrash13 ] {lightstyle(0, "i");};
void() old_thrash13 = [ $shake13, old_thrash14 ] {lightstyle(0, "k");};
void() old_thrash14 = [ $shake14, old_thrash15 ] {lightstyle(0, "m");};
void() old_thrash15 = [ $shake15, old_thrash16 ] {lightstyle(0, "m");
self.cnt = self.cnt + 1;
self.cnt = self.cnt + 1;
if(self.cnt != 3) {
self.think = old_thrash1;
}
};
};
void() old_thrash16 = [ $shake16, old_thrash17 ] {lightstyle(0, "g");};
void() old_thrash17 = [ $shake17, old_thrash18 ] {lightstyle(0, "c");};
void() old_thrash18 = [ $shake18, old_thrash19 ] {lightstyle(0, "b");};
@ -95,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;
@ -140,7 +139,7 @@ void() finale_1 = {
};
void() finale_2 = {
local vector o;
vector o;
// start a teleport splash inside shub
@ -166,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);
@ -227,7 +226,6 @@ void() nopain = {
//============================================================================
/*QUAKED monster_oldone(1 0 0) (-16 -16 -24) (16 16 32)
*/
void() monster_oldone = {

View File

@ -5,8 +5,8 @@ enum {
};
void() plat_spawn_inside_trigger = {
local entity trigger;
local vector tmin, tmax;
entity trigger;
vector tmin, tmax;
//
// middle trigger
@ -100,7 +100,6 @@ void() plat_trigger_use = {
plat_go_down();
};
void() plat_crush = {
//dprint("plat_crush\n");
@ -123,7 +122,6 @@ void() plat_use = {
plat_go_down();
};
/*QUAKED func_plat(0 .5 .8) ? PLAT_LOW_TRIGGER
speed default 150
@ -137,9 +135,8 @@ Set "sounds" to one of the following:
2) chain slow
*/
void() func_plat = {
local entity t;
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;
@ -250,7 +246,7 @@ void() train_next = {
};
void() func_train_find = {
local entity targ;
entity targ;
targ = find(world, targetname, self.target);
self.target = targ.target;

View File

@ -20,7 +20,6 @@ $frame stand1 stand2 stand3 stand4 stand5
$frame axstnd1 axstnd2 axstnd3 axstnd4 axstnd5 axstnd6
$frame axstnd7 axstnd8 axstnd9 axstnd10 axstnd11 axstnd12
//
// pain
//
@ -28,7 +27,6 @@ $frame axpain1 axpain2 axpain3 axpain4 axpain5 axpain6
$frame pain1 pain2 pain3 pain4 pain5 pain6
//
// death
//
@ -70,7 +68,6 @@ $frame axattc1 axattc2 axattc3 axattc4 axattc5 axattc6
$frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
/*
==============================================================================
PLAYER
@ -121,10 +118,9 @@ 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;
};
self.effects = self.effects | EF_MUZZLEFLASH;
};
void() player_shot2 = [$shotatt2, player_shot3 ] {self.weaponframe = 2;};
void() player_shot3 = [$shotatt3, player_shot4 ] {self.weaponframe = 3;};
void() player_shot4 = [$shotatt4, player_shot5 ] {self.weaponframe = 4;};
@ -151,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 ] {
@ -220,10 +215,9 @@ void() player_light2 = [$light2, player_light1 ] {
//============================================================================
void() player_rocket1 = [$rockatt1, player_rocket2 ] {self.weaponframe = 1;
self.effects = self.effects | EF_MUZZLEFLASH;
};
self.effects = self.effects | EF_MUZZLEFLASH;
};
void() player_rocket2 = [$rockatt2, player_rocket3 ] {self.weaponframe = 2;};
void() player_rocket3 = [$rockatt3, player_rocket4 ] {self.weaponframe = 3;};
void() player_rocket4 = [$rockatt4, player_rocket5 ] {self.weaponframe = 4;};
@ -231,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;
@ -288,7 +282,6 @@ void() PainSound = {
return;
}
rs = rint((random() * 5) + 1);
self.noise = "";
@ -341,7 +334,7 @@ void() player_pain = {
};
void() DeathBubblesSpawn = {
local entity bubble;
entity bubble;
if(self.owner.waterlevel != 3) {
return;
}
@ -366,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);
@ -380,9 +373,8 @@ void(float num_bubbles) DeathBubbles = {
return;
};
void() DeathSound = {
local float rs;
float rs;
// water death sounds
if(self.waterlevel == 3) {
@ -412,7 +404,6 @@ void() DeathSound = {
return;
};
void() PlayerDead = {
self.nextthink = -1;
// allow respawn after a certain time
@ -420,7 +411,7 @@ void() PlayerDead = {
};
vector(float dm) VelocityForDamage = {
local vector v;
vector v;
v_x = 100 * crandom();
v_y = 100 * crandom();
@ -440,7 +431,7 @@ vector(float dm) VelocityForDamage = {
};
void(string gibname, float dm) ThrowGib = {
local entity new;
entity new;
new = spawn();
new.origin = self.origin;
@ -474,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);
@ -501,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
@ -567,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

@ -83,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;
@ -117,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);
@ -150,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

@ -63,7 +63,7 @@ void() sham_walk12 = [ $walk12, sham_walk1 ] {ai_walk(7);
if(random() > 0.8) {
sound(self, CHAN_VOICE, "shambler/sidle.wav", 1, ATTN_IDLE);
}
};
};
void() sham_run1 = [ $run1, sham_run2 ] {ai_run(20);};
void() sham_run2 = [ $run2, sham_run3 ] {ai_run(24);};
@ -74,7 +74,7 @@ void() sham_run6 = [ $run6, sham_run1 ] {ai_run(20);
if(random() > 0.8) {
sound(self, CHAN_VOICE, "shambler/sidle.wav", 1, ATTN_IDLE);
}
};
};
void() sham_smash1 = [ $smash1, sham_smash2 ] {
sound(self, CHAN_VOICE, "shambler/melee1.wav", 1, ATTN_NORM);
@ -89,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;
@ -117,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;
@ -175,10 +175,10 @@ void() sham_swingr9 = [ $swingr9, sham_run1 ] {ai_charge(1);
if(random() < 0.5) {
self.think = sham_swingl1;
}
};
};
void() sham_melee = {
local float chance;
float chance;
chance = random();
if(chance > 0.6 || self.health == 600) {
@ -190,11 +190,10 @@ void() sham_melee = {
}
};
//============================================================================
void() CastLightning = {
local vector org, dir;
vector org, dir;
self.effects = self.effects | EF_MUZZLEFLASH;
@ -221,23 +220,23 @@ void() CastLightning = {
};
void() sham_magic1 = [ $magic1, sham_magic2 ] {ai_face();
sound(self, CHAN_WEAPON, "shambler/sattck1.wav", 1, ATTN_NORM);
};
sound(self, CHAN_WEAPON, "shambler/sattck1.wav", 1, ATTN_NORM);
};
void() sham_magic2 = [ $magic2, sham_magic3 ] {ai_face();};
void() sham_magic3 = [ $magic3, sham_magic4 ] {ai_face();
self.nextthink = self.nextthink + 0.2;
local entity o;
self.nextthink = self.nextthink + 0.2;
entity o;
self.effects = self.effects | EF_MUZZLEFLASH;
ai_face();
self.owner = spawn();
o = self.owner;
setmodel(o, "progs/s_light.mdl");
setorigin(o, self.origin);
o.angles = self.angles;
o.nextthink = time + 0.7;
o.think = SUB_Remove;
};
self.effects = self.effects | EF_MUZZLEFLASH;
ai_face();
self.owner = spawn();
o = self.owner;
setmodel(o, "progs/s_light.mdl");
setorigin(o, self.origin);
o.angles = self.angles;
o.nextthink = time + 0.7;
o.think = SUB_Remove;
};
void() sham_magic4 = [ $magic4, sham_magic5 ] {
self.effects = self.effects | EF_MUZZLEFLASH;
self.owner.frame = 1;
@ -263,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 ] {};
@ -290,7 +288,6 @@ void(entity attacker, float damage) sham_pain = {
sham_pain1();
};
//============================================================================
void() sham_death1 = [ $death1, sham_death2 ] {};
@ -323,7 +320,6 @@ void() sham_die = {
//============================================================================
/*QUAKED monster_shambler(1 0 0) (-32 -32 -24) (32 32 64) Ambush
*/
void() monster_shambler = {

View File

@ -95,15 +95,14 @@ void() army_atk2 = [ $shoot2, army_atk3 ] {ai_face();};
void() army_atk3 = [ $shoot3, army_atk4 ] {ai_face();};
void() army_atk4 = [ $shoot4, army_atk5 ] {ai_face();};
void() army_atk5 = [ $shoot5, army_atk6 ] {ai_face();
army_fire();
self.effects = self.effects | EF_MUZZLEFLASH;
};
army_fire();
self.effects = self.effects | EF_MUZZLEFLASH;
};
void() army_atk6 = [ $shoot6, army_atk7 ] {ai_face();};
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 ] {};
@ -141,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;
@ -164,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();
@ -183,7 +181,6 @@ void() army_fire = {
};
void() army_die1 = [ $death1, army_die2 ] {};
void() army_die2 = [ $death2, army_die3 ] {};
void() army_die3 = [ $death3, army_die4 ]
@ -209,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) {
@ -230,7 +226,6 @@ void() army_die = {
}
};
/*QUAKED monster_army(1 0 0) (-16 -16 -24) (16 16 40) Ambush
*/
void() monster_army = {
@ -253,7 +248,6 @@ void() monster_army = {
precache_sound("player/udeath.wav"); // gib death
self.solid = SOLID_SLIDEBOX;
self.movetype = MOVETYPE_STEP;

View File

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

@ -48,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;
@ -57,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!");
@ -110,7 +110,6 @@ void() SUB_CalcMoveDone = {
}
};
/*
=============
SUB_CalcAngleMove
@ -122,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);
@ -130,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!");
@ -171,7 +170,6 @@ void() SUB_CalcAngleMoveDone = {
}
};
//=============================================================================
void() DelayThink = {
@ -200,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
@ -218,7 +216,6 @@ void() SUB_UseTargets = {
return;
}
//
// print the message
//
@ -269,10 +266,8 @@ void() SUB_UseTargets = {
} while(1);
}
};
/*
in nightmare mode, all attack_finished times become 0

View File

@ -76,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) {
@ -93,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
@ -145,7 +142,6 @@ void() tbaby_jump5 = [ $jump5, tbaby_jump6 ] {
void() tbaby_jump6 = [ $jump6, tbaby_fly1 ] {};
//=============================================================================
void() tbaby_die1 = [ $exp, tbaby_die2 ] {
@ -168,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

@ -23,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
@ -138,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.
@ -166,7 +164,6 @@ void() trigger_relay = {
self.use = SUB_UseTargets;
};
//=============================================================================
/*QUAKED trigger_secret(.5 .5 .5) ?
@ -201,9 +198,8 @@ void() trigger_secret = {
//=============================================================================
void() counter_use = {
local string junk;
string junk;
self.count = self.count - 1;
if(self.count < 0) {
@ -250,7 +246,6 @@ void() trigger_counter = {
self.use = counter_use;
};
/*
==============================================================================
@ -265,8 +260,8 @@ enum {
};
void() play_teleport = {
local float v;
local string tmpstr;
float v;
string tmpstr;
v = random() * 5;
if(v < 1) {
@ -286,7 +281,7 @@ void() play_teleport = {
};
void(vector org) spawn_tfog = {
local entity s;
entity s;
s = spawn();
s.origin = org;
@ -300,7 +295,6 @@ void(vector org) spawn_tfog = {
WriteCoord(MSG_BROADCAST, org_z);
};
void() tdeath_touch = {
if(other == self.owner) {
return;
@ -323,9 +317,8 @@ void() tdeath_touch = {
}
};
void(vector org, entity death_owner) spawn_tdeath = {
local entity death;
entity death;
death = spawn();
death.classname = "teledeath";
@ -343,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) {
@ -426,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;
@ -468,7 +461,6 @@ void() trigger_setskill = {
self.touch = trigger_skill_touch;
};
/*
==============================================================================
@ -561,7 +553,6 @@ void() trigger_push_touch = {
}
};
/*QUAKED trigger_push(.5 .5 .5) ? PUSH_ONCE
Pushes the player
*/

View File

@ -26,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';
@ -53,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));
@ -68,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;
@ -114,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
@ -180,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;
@ -209,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);
@ -235,7 +231,7 @@ W_FireShotgun
================
*/
void() W_FireShotgun = {
local vector dir;
vector dir;
sound(self, CHAN_WEAPON, "weapons/guncock.wav", 1, ATTN_NORM);
@ -246,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();
@ -269,7 +264,6 @@ void() W_FireSuperShotgun = {
FireBullets(14, dir, '0.14 0.08 0');
};
/*
==============================================================================
@ -295,7 +289,7 @@ void() BecomeExplosion = {
};
void() T_MissileTouch = {
local float damg;
float damg;
if(other == self.owner) {
return; // don't explode on owner
@ -332,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;
@ -385,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);
@ -423,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();
@ -468,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);
@ -504,7 +494,7 @@ W_FireGrenade
================
*/
void() W_FireGrenade = {
local entity missile, mpuff;
entity missile, mpuff;
self.currentammo = self.ammo_rockets = self.ammo_rockets - 1;
@ -545,10 +535,8 @@ void() W_FireGrenade = {
setorigin(missile, self.origin);
};
//=============================================================================
/*
===============
launch_spike
@ -576,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;
@ -591,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,7 +605,7 @@ void(float ox) W_FireSpikes = {
};
void() spike_touch = {
local float rand;
float rand;
if(other == self.owner) {
return;
}
@ -654,7 +642,7 @@ void() spike_touch = {
};
void() superspike_touch = {
local float rand;
float rand;
if(other == self.owner) {
return;
}
@ -684,7 +672,6 @@ void() superspike_touch = {
};
/*
===============================================================================
@ -745,7 +732,7 @@ void() W_SetCurrentAmmo = {
};
float() W_BestWeapon = {
local float it;
float it;
it = self.items;
@ -792,7 +779,7 @@ An attack impulse can be triggered now
============
*/
void() W_Attack = {
local float r;
float r;
if(!W_CheckNoAmmo()) {
return;
@ -848,7 +835,7 @@ W_ChangeWeapon
============
*/
void() W_ChangeWeapon = {
local float it, am, fl;
float it, am, fl;
it = self.items;
am = 0;
@ -952,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;
@ -1013,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;
@ -1156,4 +1143,3 @@ void() SuperDamageSound = {
return;
};

View File

@ -39,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);
@ -70,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;
@ -167,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;
@ -187,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;
@ -217,9 +215,8 @@ void() Wiz_StartFast = {
};
void() Wiz_idlesound = {
local float wr;
float wr;
wr = random() * 5;
if(self.waitmin < time) {
@ -244,8 +241,8 @@ void() wiz_stand7 = [ $hover7, wiz_stand8 ] {ai_stand();};
void() wiz_stand8 = [ $hover8, wiz_stand1 ] {ai_stand();};
void() wiz_walk1 = [ $hover1, wiz_walk2 ] {ai_walk(8);
Wiz_idlesound();
};
Wiz_idlesound();
};
void() wiz_walk2 = [ $hover2, wiz_walk3 ] {ai_walk(8);};
void() wiz_walk3 = [ $hover3, wiz_walk4 ] {ai_walk(8);};
void() wiz_walk4 = [ $hover4, wiz_walk5 ] {ai_walk(8);};
@ -255,8 +252,8 @@ void() wiz_walk7 = [ $hover7, wiz_walk8 ] {ai_walk(8);};
void() wiz_walk8 = [ $hover8, wiz_walk1 ] {ai_walk(8);};
void() wiz_side1 = [ $hover1, wiz_side2 ] {ai_run(8);
Wiz_idlesound();
};
Wiz_idlesound();
};
void() wiz_side2 = [ $hover2, wiz_side3 ] {ai_run(8);};
void() wiz_side3 = [ $hover3, wiz_side4 ] {ai_run(8);};
void() wiz_side4 = [ $hover4, wiz_side5 ] {ai_run(8);};
@ -266,8 +263,8 @@ void() wiz_side7 = [ $hover7, wiz_side8 ] {ai_run(8);};
void() wiz_side8 = [ $hover8, wiz_side1 ] {ai_run(8);};
void() wiz_run1 = [ $fly1, wiz_run2 ] {ai_run(16);
Wiz_idlesound();
};
Wiz_idlesound();
};
void() wiz_run2 = [ $fly2, wiz_run3 ] {ai_run(16);};
void() wiz_run3 = [ $fly3, wiz_run4 ] {ai_run(16);};
void() wiz_run4 = [ $fly4, wiz_run5 ] {ai_run(16);};
@ -328,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) {
@ -338,7 +334,6 @@ void(entity attacker, float damage) Wiz_Pain = {
wiz_pain1();
};
void() Wiz_Missile = {
wiz_fast1();
};

View File

@ -151,7 +151,6 @@ void() main = {
precache_file2("maps/dm6.bsp");
};
//=======================
/*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.
//
@ -350,7 +348,7 @@ void() bodyque = {
};
void() InitBodyQue = {
local entity e;
entity e;
bodyque_head = spawn();
bodyque_head.classname = "bodyque";
@ -363,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 = {
@ -380,4 +377,3 @@ void(entity ent) CopyToBodyQue = {
bodyque_head = bodyque_head.owner;
};

View File

@ -160,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);
@ -194,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();};
@ -238,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();
@ -251,7 +250,6 @@ void() zombie_missile = {
}
};
/*
=============================================================================
@ -410,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