djcev.com

//

Git Repos / fte_dogmode / commit 750c108

Commit: 750c1086ef1928cec621d29d77a13003531f503a
Parent: 99c9cf2068b54f8c0b34f384b4c960f60b4e58c0
Author: Cameron Vanderzanden, 2024-04-08 15:40
Committer: Cameron Vanderzanden, 2024-04-08 15:40

Commit Message

Registered monsters, projectile bugfixes

Cleaned up and re-enabled the registered monsters. I think - I
hope - all work fine now. Testing underway. Oldone (or teleporttrain)
crashes on loading id1's end.bsp, not sure why. That map has given
me trouble before.

Also fixed some issues with the projectile system, namely removing
freed entities and a runaway loop involving one rocket destroying
another in flight. Projectile system will be more robust now, I hope.

Change List

Diff qc/base_entities.qc

diff --git a/qc/base_entities.qc b/qc/base_entities.qc
index 2510aab..2fc1c5d 100644
--- a/qc/base_entities.qc
+++ b/qc/base_entities.qc
@@ -214,7 +214,8 @@ void() noclass;
self.movetype == MOVETYPE_BOUNCE)
{
// doors, triggers, missiles, etc
- self.destroy ();
+ if (self.destroy)
+ self.destroy ();
self = stemp;
return;
}
@@ -236,7 +237,8 @@ void() noclass;
if (self.classgroup & CG_MONSTER)
sub_death_use ();

- self.destroy ();
+ if (self.destroy)
+ self.destroy ();

self = stemp;
};
@@ -443,12 +445,30 @@ void() noclass;
}

// figure momentum add
- if ((inflictor != world) && (targ.movetype == MOVETYPE_WALK))
+ if (inflictor != world && (
+ targ.movetype == MOVETYPE_WALK ||
+ targ.movetype == MOVETYPE_STEP ||
+ targ.movetype == MOVETYPE_FLY))
{
dir = targ.origin -
(inflictor.absmin + inflictor.absmax) * 0.5;
dir = normalize (dir);
- targ.velocity = targ.velocity + (dir * damage * 8);
+
+ if (targ.flags & FL_MONSTER && targ.flags & FL_ONGROUND)
+ targ.flags &= ~FL_ONGROUND;
+
+ if (attacker.classtype == CT_PLAYER && attacker == targ)
+ // standard knockback for self-damage -- CEV
+ targ.velocity += dir * damage * 8;
+ else
+ // decreased knockback otherwise -- CEV
+ targ.velocity += dir * damage * 4;
+
+ /*
+ dprint (sprintf("t_damage2: inflictor %s adds "
+ "momentum in direction %v to target %s\n",
+ inflictor.classname, dir, targ.classname));
+ */
}

// check for godmode or invincibility
@@ -632,9 +652,6 @@ void() noclass;
if (toucher.movetype == MOVETYPE_NOCLIP)
return FALSE;

- // if (toucher.classtype & CG_PROJECTILE)
- // return FALSE;
-
if (self.estate != STATE_ACTIVE)
return FALSE;

Return to the top of this page or return to the overview of this repo.

Diff qc/base_monster.qc

diff --git a/qc/base_monster.qc b/qc/base_monster.qc
index 62ad591..594a2a6 100644
--- a/qc/base_monster.qc
+++ b/qc/base_monster.qc
@@ -1519,6 +1519,7 @@ void(float n) monster_update_total =
e.classgroup |= CG_MONSTER;
e.touch = base_monster_touch;
e.use = base_monster_use_angry;
+ base_mapentity_init (e);
};

//--------------------------------------------------------------

Return to the top of this page or return to the overview of this repo.

Diff qc/base_proj.qc

diff --git a/qc/base_proj.qc b/qc/base_proj.qc
index d25f045..4b9dc92 100644
--- a/qc/base_proj.qc
+++ b/qc/base_proj.qc
@@ -42,7 +42,8 @@ enum

enumflags
{
- PROJECTILE_EXPLOSIVE // .aflag projectile options
+ PROJECTILE_EXPLOSIVE, // .aflag projectile options
+ PROJECTILE_DESTROYED
};

const float BP_BOUNCE_BACKOFF = 1.5; // MOVETYPE_BOUNCE clipvel mult; id1 1.5
@@ -72,6 +73,7 @@ const float BP_BOUNCE_MIN_ZVEL = 60; // MOVETYPE_BOUNCE stop if _z less than
void(vector org) write_explosion;
void(vector org) write_explosion2;
void() base_explosion_think;
+void(entity e) become_base_explosion;
entity(vector org) spawn_base_explosion;
void(entity e) base_explosion_init;
strip void() base_explosion;
@@ -149,6 +151,18 @@ strip void() base_projectile_qcphys;
//--------------------------------------------------------------
// replacement for BecomeExplosion -- CEV
//--------------------------------------------------------------
+ void(entity e) become_base_explosion =
+ {
+ e.customphysics = __NULL__;
+ e.destroy = __NULL__;
+ e.pain = __NULL__;
+ e.takedamage = DAMAGE_NO;
+ base_explosion_init (e);
+ };
+
+ //--------------------------------------------------------------
+ // spawn a brand-spanking new explosion at org -- CEV
+ //--------------------------------------------------------------
entity(vector org) spawn_base_explosion =
{
local entity e = spawn ();
@@ -340,17 +354,18 @@ strip void() base_projectile_qcphys;
// I've removed that here. -- CEV
// damg = direct_damage + random() * 20;

- if (other.health)
- {
- // TODO CEV
- if (other.classname == "monster_shambler")
- // mostly immune
- t_damage2 (other, self, self.owner,
- self.direct_damage * 0.5);
- else
- t_damage2 (other, self, self.owner,
- self.direct_damage);
- }
+ if (other)
+ if (other.health)
+ // TODO CEV
+ if (other.classname == "monster_shambler")
+ // mostly immune
+ t_damage2 (other, self, self.owner,
+ self.direct_damage * 0.5);
+ else
+ t_damage2 (other, self, self.owner,
+ self.direct_damage);
+ else
+ other = world;

// do before radius damage -- CEV
if (self.takedamage)
@@ -366,13 +381,11 @@ strip void() base_projectile_qcphys;

// BecomeExplosion
write_explosion (self.origin);
- spawn_base_explosion (self.origin);
- remove (self);
+ become_base_explosion (self);
};

//--------------------------------------------------------------
- // was spike_touch; override if you need to implement special
- // projectile damage logic -- CEV
+ // was spike_touch -- CEV
//--------------------------------------------------------------
void() base_projectile_touch_normal =
{
@@ -420,6 +433,9 @@ strip void() base_projectile_qcphys;
if (base_projectile_check_touch())
return;

+ if (!self || self == world)
+ return;
+
if (self.aflag & PROJECTILE_EXPLOSIVE)
base_projectile_touch_explosive ();
else
@@ -512,7 +528,8 @@ strip void() base_projectile_qcphys;
if (trace_allsolid || trace_startsolid)
{
dprint (sprintf("base_projectile_qcphys_physics: "
- "in a solid at %v\n", trace_endpos));
+ "classname %s in a solid at %v\n",
+ self.classname, trace_endpos));

if (self.movetype == MOVETYPE_BOUNCE)
{
@@ -563,20 +580,21 @@ strip void() base_projectile_qcphys;

// SV_Impact lookalike -- CEV
local entity oldother = other;
- if (trace_ent)
+ // store trace_ent in case touch functions below perform
+ // a trace -- CEV
+ local entity touched = trace_ent;
+ if (self && touched)
{
// we can make some assumptions and skip a few
// checks here -- CEV
- if (trace_ent)
- other = trace_ent;
- else
- other = world;
+ other = touched;
self.touch ();

// check trace_ent again just in case the call
// to touch above somehow removed it -- CEV
- if (trace_ent && trace_ent.touch &&
- trace_ent.solid != SOLID_NOT)
+ if (touched && touched.touch &&
+ touched.touch != sub_null &&
+ touched.solid != SOLID_NOT)
{
if (self)
other = self;
@@ -584,12 +602,12 @@ strip void() base_projectile_qcphys;
other = world;

local entity stemp = self;
- self = trace_ent;
+ self = touched;
self.touch ();
self = stemp;
}
}
- else if (trace_fraction < 1.0f)
+ else if (self && trace_fraction < 1.0f)
{
// for the bounce sound
other = world;

Return to the top of this page or return to the overview of this repo.

Diff qc/func/door.qc

diff --git a/qc/func/door.qc b/qc/func/door.qc
index 4e4f643..a492a95 100644
--- a/qc/func/door.qc
+++ b/qc/func/door.qc
@@ -68,9 +68,10 @@ void() func_door;
//--------------------------------------------------------------
void() temp_door_trigger_touch =
{
- // don't trigger on projectiles -- CEV
+ // don't trigger on non-explosive projectiles -- CEV
if (other.classgroup & CG_PROJECTILE)
- return;
+ if (!(other.aflag & PROJECTILE_EXPLOSIVE))
+ return;

if (other.health <= 0)
return;

Return to the top of this page or return to the overview of this repo.

Diff qc/func/monster_spawner.qc

diff --git a/qc/func/monster_spawner.qc b/qc/func/monster_spawner.qc
index aa988ef..9dce926 100644
--- a/qc/func/monster_spawner.qc
+++ b/qc/func/monster_spawner.qc
@@ -11,12 +11,21 @@
// Big thanks to ryanscissorhands for helping fix telefragging issues!
// ===================================================================

+//======================================================================
// constants
+//======================================================================
+
const float MOBOT_SPAWNER_RESET = 1;
const float MOBOT_DONT_SPAWN_ANGRY = 2;
const float MOBOT_DONT_ADD_KILL_COUNT = 4;
const float MOBOT_SILENT_SPAWN = 32;

+//======================================================================
+// forward declarations
+//======================================================================
+
+//------------------------------------------------------------------------------
+
/*QUAKED func_monster_spawner (.75 0 .75) (-8 -8 -8) (8 8 8) REUSABLE X X X X X X X NOT_ON_EASY NOT_ON_NORMAL NOT_ON_HARD_OR_NIGHTMARE NOT_IN_DEATHMATCH NOT_IN_COOP NOT_IN_SINGLEPLAYER X NOT_ON_HARD_ONLY NOT_ON_NIGHTMARE_ONLY
Spawns monsters to targeted info_monster_spawnpoint
bot
@@ -30,7 +39,6 @@ Choose Style
• 7 (Shambler)
• 8 (Knight)
• 9 (HellKnight)
-• 10 (Spawn)
• 11 (Zombie)
• 12 (Shalrath)

@@ -42,37 +50,19 @@ Can set Berserk to 1 to skip most pain animations.

Can only use default health, models and sounds.
*/
-class func_monster_spawner: base_func
-{
- float count;
- float style2;
-
- //--------------------------------------------------------------
- virtual void(string fieldname, string fieldvalue) init_field =
- {
- switch (fieldname)
- {
- case "count":
- count = stof (fieldvalue);
- break;
- case "style2":
- style2 = stof (fieldvalue);
- break;
- default:
- super::init_field (fieldname, fieldvalue);
- }
- };
-
+//----------------------------------------------------------------------
+// class func_monster_spawner: base_func
+// {
//--------------------------------------------------------------
// find_spawnpoint -- Returns the entity to spawn at; was named
// MobotSpawnPoint
//--------------------------------------------------------------
- nonvirtual entity() find_spawnpoint =
+ entity() find_spawnpoint =
{
local entity spot;

- // spot = find (world, ::classname, "info_monster_spawnpoint");
- spot = find (world, ::targetname, this.target);
+ // spot = find (world, classname, "info_monster_spawnpoint");
+ spot = find (world, targetname, self.target);

if (!spot)
objerror ("func_monster_spawner::find_spawnpoint: "
@@ -82,28 +72,28 @@ class func_monster_spawner: base_func
};

//--------------------------------------------------------------
- nonvirtual void(base_monster bot) create_mobot_tfrag =
+ void(base_monster bot) create_mobot_tfrag =
{
- if (!(this.spawnflags & MOBOT_SILENT_SPAWN))
+ if (!(self.spawnflags & MOBOT_SILENT_SPAWN))
// SILENT
spawn_tfog (bot.origin);
spawn_tdeath (bot.origin, bot);
};

//--------------------------------------------------------------
- nonvirtual void() create_mobot =
+ void() create_mobot =
{
- // let's not use deathmatch points for this -- dumptruck_ds
+ // let's not use deathmatch points for self -- dumptruck_ds
// spawn_spot = SelectSpawnPoint ();
local entity spawn_spot = find_spawnpoint ();
local float angry;

- if (this.spawnflags & MOBOT_DONT_SPAWN_ANGRY)
+ if (self.spawnflags & MOBOT_DONT_SPAWN_ANGRY)
angry = FALSE;
else
angry = TRUE;

- switch (this.style)
+ switch (self.style)
{
case 1:
// spawn a Doggo
@@ -231,26 +221,24 @@ class func_monster_spawner: base_func
default:
dprint (sprintf("func_monster_spawner::"
"create_mobot: unknown style %g!\n",
- this.style));
+ self.style));
}

- if (!(this.spawnflags & MOBOT_DONT_ADD_KILL_COUNT))
- {
+ if (!(self.spawnflags & MOBOT_DONT_ADD_KILL_COUNT))
// replacement function from iw -- dumptruck_ds
monster_update_total (1);
- }
};

//--------------------------------------------------------------
- virtual void() do_think =
+ void() do_think =
{
dprint ("mobot thinking\n");
- // telefrag check thanks to ryanscissorhands for this code!
+ // telefrag check thanks to ryanscissorhands for self code!
// -- dumptruck_ds
local entity nearby;

// findradius (vector origin, float radius in Quake units)
- nearby = findradius (this.origin, 128);
+ nearby = findradius (self.origin, 128);

while (nearby)
{
@@ -260,28 +248,33 @@ class func_monster_spawner: base_func
// qss crash fix from paavohuhtala
// -- dumptruck_ds
// delay the spawn by some amount;
- this.nextthink = time + 1;
+ self.nextthink = time + 1;
return;
}
nearby = nearby.chain;
}

- this.count = this.count - 1;
+ self.count = self.count - 1;

- if (this.count < 0)
+ if (self.count < 0)
return;

- if (this.count != 0)
+ if (self.count != 0)
{
- if !(this.wait)
- this.nextthink = time + 5;
+ if !(self.wait)
+ self.nextthink = time + 5;
else
- this.nextthink = time + this.wait;
+ self.nextthink = time + self.wait;

- if (this.style2 == 1)
+ if (self.style2 == 1)
{
// random monster!! -- dumptruck_ds
- this.style = floor (random() * 12) + 1;
+ self.style = floor (random() * 12) + 1;
+
+ // re-roll 10s -- CEV
+ while (self.style == 10)
+ self.style = floor (random() * 12) + 1;
+
// thanks whirledtsar for your help on this
// -- dumptruck_ds
create_mobot ();
@@ -293,22 +286,22 @@ class func_monster_spawner: base_func
}
else
{
- if (this.spawnflags & MOBOT_SPAWNER_RESET)
+ if (self.spawnflags & MOBOT_SPAWNER_RESET)
{
- this.count = this.cnt;
- this.interaction_flags |= DISABLE_THINK;
+ self.count = self.cnt;
+ self.interaction_flags |= DISABLE_THINK;
}
}
};

//--------------------------------------------------------------
- virtual void(entity caller) do_use =
+ void(entity caller) do_use =
{
- this.do_think ();
+ self.do_think ();
};

//--------------------------------------------------------------
- virtual void() init_spawned =
+ void() init_spawned =
{
if !(this.target)
{
@@ -333,4 +326,4 @@ class func_monster_spawner: base_func
{
this.classtype = CT_FUNC_MONSTER_SPAWNER;
};
-};
+// };

Return to the top of this page or return to the overview of this repo.

Diff qc/items/runes.qc

diff --git a/qc/items/runes.qc b/qc/items/runes.qc
index ec3409a..9707468 100644
--- a/qc/items/runes.qc
+++ b/qc/items/runes.qc
@@ -59,6 +59,9 @@ Episode 4 - The Elder World - Run of Elder Magic
//--------------------------------------------------------------
void() item_sigil_touch =
{
+ if (sub_checkvalidtouch(other) == FALSE)
+ return;
+
centerprint (other, "You got the rune!");

sound (other, CHAN_ITEM, self.noise, 1, ATTN_NORM);

Return to the top of this page or return to the overview of this repo.

Diff qc/monsters/enforcer.qc

diff --git a/qc/monsters/enforcer.qc b/qc/monsters/enforcer.qc
index 7ef3cf4..c2e8f20 100644
--- a/qc/monsters/enforcer.qc
+++ b/qc/monsters/enforcer.qc
@@ -3,6 +3,75 @@
//==============================================================================

//======================================================================
+// forward declarations
+//======================================================================
+
+// monster_enforcer
+void() monster_enforcer_sightsound; // AI & attacks
+void() monster_enforcer_attack_lightning;
+void() monster_enforcer_attack; // animation & thinking below
+void() enf_stand1; void() enf_stand2; void() enf_stand3; void() enf_stand4;
+void() enf_stand5; void() enf_stand6; void() enf_stand7;
+void() enf_walk1; void() enf_walk2; void() enf_walk3; void() enf_walk4;
+void() enf_walk5; void() enf_walk6; void() enf_walk7; void() enf_walk8;
+void() enf_walk9; void() enf_walk10; void() enf_walk11; void() enf_walk12;
+void() enf_walk13; void() enf_walk14; void() enf_walk15; void() enf_walk16;
+void() enf_run1; void() enf_run2; void() enf_run3; void() enf_run4;
+void() enf_run5; void() enf_run6; void() enf_run7; void() enf_run8;
+void() enf_atk1; void() enf_atk2; void() enf_atk3; void() enf_atk4;
+void() enf_atk5; void() enf_atk6; void() enf_atk7; void() enf_atk8;
+void() enf_atk9; void() enf_atk10; void() enf_atk11; void() enf_atk12;
+void() enf_atk13; void() enf_atk14;
+void() enf_atkb1; void() enf_atkb2; void() enf_atkb3; void() enf_atkb4;
+void() enf_atkb5; void() enf_atkb6; void() enf_atkb7; void() enf_atkb8;
+void() enf_atkb9; void() enf_atkb10;
+void() enf_atkc1; void() enf_atkc2; void() enf_atkc3; void() enf_atkc4;
+void() enf_atkc5; void() enf_atkc6; void() enf_atkc7; void() enf_atkc8;
+void() enf_atkc9; void() enf_atkc10; void() enf_atkc11; void() enf_atkc12;
+void() enf_tur_atk1; void() enf_tur_atk2; void() enf_tur_atk3;
+void() enf_tur_atk4; void() enf_tur_atk5; void() enf_tur_atk6;
+void() enf_tur_atk7; void() enf_tur_atk8; void() enf_tur_atk9;
+void() enf_tur_atk10; void() enf_tur_atk11; void() enf_tur_atk12;
+void() enf_tur_atk13; void() enf_tur_atk14;
+void() enf_seek_stand1; void() enf_seek_stand2; void() enf_seek_stand3;
+void() enf_seek_stand4; void() enf_seek_stand5; void() enf_seek_stand6;
+void() enf_seek_stand7;
+void() enf_tur_atkb1; void() enf_tur_atkb2; void() enf_tur_atkb3;
+void() enf_tur_atkb4; void() enf_tur_atkb5; void() enf_tur_atkb6;
+void() enf_tur_atkb7; void() enf_tur_atkb8; void() enf_tur_atkb9;
+void() enf_tur_atkb10;
+void() enf_tur_atkc1; void() enf_tur_atkc2; void() enf_tur_atkc3;
+void() enf_tur_atkc4; void() enf_tur_atkc5; void() enf_tur_atkc6;
+void() enf_tur_atkc7; void() enf_tur_atkc8; void() enf_tur_atkc9;
+void() enf_tur_atkc10; void() enf_tur_atkc11; void() enf_tur_atkc12;
+void() enf_standb1; void() enf_standb2; void() enf_standb3; void() enf_standb4;
+void() enf_standb5; void() enf_standb6; void() enf_standb7;
+void() enf_paina1; void() enf_paina2; void() enf_paina3; void() enf_paina4;
+void() enf_painb1; void() enf_painb2; void() enf_painb3; void() enf_painb4;
+void() enf_painb5;
+void() enf_painc1; void() enf_painc2; void() enf_painc3; void() enf_painc4;
+void() enf_painc5; void() enf_painc6; void() enf_painc7; void() enf_painc8;
+void() enf_paind1; void() enf_paind2; void() enf_paind3; void() enf_paind4;
+void() enf_paind5; void() enf_paind6; void() enf_paind7; void() enf_paind8;
+void() enf_paind9; void() enf_paind10; void() enf_paind11; void() enf_paind12;
+void() enf_paind13; void() enf_paind14; void() enf_paind15; void() enf_paind16;
+void() enf_paind17; void() enf_paind18; void() enf_paind19;
+void() enf_die1; void() enf_die2; void() enf_die3; void() enf_die4;
+void() enf_die5; void() enf_die6; void() enf_die7; void() enf_die8;
+void() enf_die9; void() enf_die10; void() enf_die11; void() enf_die12;
+void() enf_die13; void() enf_die14;
+void() enf_dief1; void() enf_dief2; void() enf_dief3; void() enf_dief4;
+void() enf_dief5; void() enf_dief6; void() enf_dief7; void() enf_dief8;
+void() enf_dief9; void() enf_dief10; void() enf_dief11;
+void(entity attacker, float damage) monster_enforcer_pain; // interaction
+void() monster_enforcer_destroy;
+void(entity e) monster_enforcer_init; // initialization
+void() monster_enforcer;
+
+// monster_dead_enforcer
+void() monster_dead_enforcer;
+
+//======================================================================
// frame macros
//======================================================================
$cd id1/models/enforcer
@@ -36,6 +105,8 @@ $frame paind1 paind2 paind3 paind4 paind5 paind6 paind7 paind8
$frame paind9 paind10 paind11 paind12 paind13 paind14 paind15 paind16
$frame paind17 paind18 paind19

+//------------------------------------------------------------------------------
+
/*QUAKED monster_enforcer (1 0 0) (-16 -16 -24) (16 16 40) AMBUSH X X TRIGGER_SPAWNED X X X X NOT_ON_EASY NOT_ON_NORMAL NOT_ON_HARD_OR_NIGHTMARE NOT_IN_DEATHMATCH NOT_IN_COOP NOT_IN_SINGLEPLAYER X NOT_ON_HARD_ONLY NOT_ON_NIGHTMARE_ONLY
{
model ("progs/enforcer.mdl");
@@ -108,60 +179,55 @@ obit_name(string) : "When used with obit_method, this will set part of the text
damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by this number (e.g. 4 = Quad damage)"

*/
-class monster_enforcer: base_walkmonster
-{
- float attack_elevation;
-
+//----------------------------------------------------------------------
+// class monster_enforcer: base_walkmonster
+// {
//--------------------------------------------------------------
- virtual void() ai_sightsound =
+ void() monster_enforcer_sightsound =
{
local float rsnd;

rsnd = rint (random() * 3);
if (rsnd == 1)
// dumptruck_ds
- sound_sight (this, CHAN_VOICE, "enforcer/sight1.wav",
+ sound_sight (self, CHAN_VOICE, "enforcer/sight1.wav",
1, ATTN_NORM);
else if (rsnd == 2)
- sound_misc (this, CHAN_VOICE, "enforcer/sight2.wav",
+ sound_misc (self, CHAN_VOICE, "enforcer/sight2.wav",
1, ATTN_NORM);
else if (rsnd == 0)
- sound_misc1 (this, CHAN_VOICE, "enforcer/sight3.wav",
+ sound_misc1 (self, CHAN_VOICE, "enforcer/sight3.wav",
1, ATTN_NORM);
else
- sound_misc2 (this, CHAN_VOICE, "enforcer/sight4.wav",
+ sound_misc2 (self, CHAN_VOICE, "enforcer/sight4.wav",
1, ATTN_NORM);
};

//--------------------------------------------------------------
// enf_lightning -- TODO CEV
//--------------------------------------------------------------
- nonvirtual void() atk_lightning =
+ void() monster_enforcer_attack_lightning =
{
local vector org, dir;

- this.effects = this.effects | EF_MUZZLEFLASH;
- sound_attack (this, CHAN_WEAPON, "weapons/lstart.wav",
+ self.effects = self.effects | EF_MUZZLEFLASH;
+ sound_attack (self, CHAN_WEAPON, "weapons/lstart.wav",
1, ATTN_NORM);
ai_face ();
- makevectors (this.angles);
- org = this.origin + v_forward * 30 + v_right * 8.5 + '0 0 16';
+ makevectors (self.angles);
+ org = self.origin + v_forward * 30 + v_right * 8.5 + '0 0 16';

- dir = this.enemy.origin - this.enemy.velocity * 0.075;
+ dir = self.enemy.origin - self.enemy.velocity * 0.075;
dir = normalize (dir - org + '0 0 16');

- if (this.spawnflags & I_AM_TURRET)
- {
- traceline (org, this.origin + dir * 900, TRUE, this);
- }
+ if (self.spawnflags & I_AM_TURRET)
+ traceline (org, self.origin + dir * 900, TRUE, self);
else
- {
- traceline (org, this.origin + dir * 600, TRUE, this);
- }
+ traceline (org, self.origin + dir * 600, TRUE, self);

WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
WriteByte (MSG_BROADCAST, TE_LIGHTNING2);
- WriteEntity (MSG_BROADCAST, this);
+ WriteEntity (MSG_BROADCAST, self);
WriteCoord (MSG_BROADCAST, org_x);
WriteCoord (MSG_BROADCAST, org_y);
WriteCoord (MSG_BROADCAST, org_z);
@@ -169,206 +235,218 @@ class monster_enforcer: base_walkmonster
WriteCoord (MSG_BROADCAST, trace_endpos_y);
WriteCoord (MSG_BROADCAST, trace_endpos_z);

- weapon_lightning::lightning_damage (org, trace_endpos, this, 4);
+ fire_lightning (org, trace_endpos, self, 4);
};

//--------------------------------------------------------------
- nonvirtual void() atk_laser =
+ void() monster_enforcer_attack =
{
// style stuff -- dumptruck_ds
- if (this.style == 1)
+ if (self.style == 1)
{
- this.effects = this.effects | EF_MUZZLEFLASH;
+ self.effects = self.effects | EF_MUZZLEFLASH;
ai_face ();
- sound_attack (this, CHAN_WEAPON, "enforcer/enfire.wav",
+ sound_attack (self, CHAN_WEAPON, "enforcer/enfire.wav",
1, ATTN_NORM);

- makevectors (this.angles);
+ makevectors (self.angles);
// last number was 16 - dumptruck_ds
- local vector org = this.origin + v_forward * 30 +
+ local vector org = self.origin + v_forward * 30 +
v_right * 8.5 + '0 0 12';

// org, dir, direct_damage, splash_damage, speed
- fire_rocket (org, this.enemy.origin - this.origin,
+ base_monster_fire_rocket (org,
+ self.enemy.origin - self.origin,
30, 40, 900);
return;
}
- else if (this.style == 2)
+ else if (self.style == 2)
{
ai_face ();
// TODO CEV calling makevectors here & then again in
// fire_grenade below is not ideal
- makevectors (this.angles);
+ makevectors (self.angles);
// enforcer grenade offset -- CEV
- local vector org1 = this.origin +
+ local vector org1 = self.origin +
(v_forward * 30 + v_right * 8.5 + '0 0 16');
- if (this.spawnflags & I_AM_TURRET)
- fire_grenade (org1, 40, 40, attack_elevation);
+ if (self.spawnflags & I_AM_TURRET)
+ base_monster_fire_grenade (org1,
+ 40, 40, self.attack_elevation);
else
- fire_grenade (org1, 40, 40, 0);
+ base_monster_fire_grenade (org1, 40, 40, 0);
return;
}
- else if (this.style == 3 || this.style == 5)
+ else if (self.style == 3 || self.style == 5)
{
- sound_attack (this, CHAN_WEAPON, "weapons/spike2.wav",
+ sound_attack (self, CHAN_WEAPON, "weapons/spike2.wav",
1, ATTN_NORM);
- this.effects = this.effects | EF_MUZZLEFLASH;
- makevectors (this.angles);
+ self.effects = self.effects | EF_MUZZLEFLASH;
+ makevectors (self.angles);

- // this is changed from pd3, speed there was 600; I've
+ // self is changed from pd3, speed there was 600; I've
// set it to standard SPIKE_SPEED (1000) here -- CEV
- fire_spike (this.origin +
+ base_monster_fire_spike (self.origin +
(v_forward * 30 + v_right * 8.5 + '0 0 16'),
- this.enemy.origin - this.origin,
+ self.enemy.origin - self.origin,
SPIKE_SUPER_DAMAGE, SPIKE_SPEED);
return;
}
else
{
- makevectors (this.angles);
+ makevectors (self.angles);

- local vector org2 = this.origin +
+ local vector org2 = self.origin +
(v_forward * 30 + v_right * 8.5 + '0 0 16');

- fire_laser (org2, this.enemy.origin - this.origin);
+ base_monster_fire_laser (org2,
+ self.enemy.origin - self.origin);
}
};

//--------------------------------------------------------------
// Enforcer stand functions
//--------------------------------------------------------------
- nonvirtual void() stand1 = [$stand1, stand2] { ai_stand (); };
- nonvirtual void() stand2 = [$stand2, stand3] { ai_stand (); };
- nonvirtual void() stand3 = [$stand3, stand4] { ai_stand (); };
- nonvirtual void() stand4 = [$stand4, stand5] { ai_stand (); };
- nonvirtual void() stand5 = [$stand5, stand6] { ai_stand (); };
- nonvirtual void() stand6 = [$stand6, stand7] { ai_stand (); };
- nonvirtual void() stand7 = [$stand7, stand1] { ai_stand (); };
+ void() enf_stand1 = [$stand1, enf_stand2] { ai_stand (); };
+ void() enf_stand2 = [$stand2, enf_stand3] { ai_stand (); };
+ void() enf_stand3 = [$stand3, enf_stand4] { ai_stand (); };
+ void() enf_stand4 = [$stand4, enf_stand5] { ai_stand (); };
+ void() enf_stand5 = [$stand5, enf_stand6] { ai_stand (); };
+ void() enf_stand6 = [$stand6, enf_stand7] { ai_stand (); };
+ void() enf_stand7 = [$stand7, enf_stand1] { ai_stand (); };

//--------------------------------------------------------------
// Enforcer walk functions
//--------------------------------------------------------------
- nonvirtual void() walk1 = [$walk1, walk2]
+ void() enf_walk1 = [$walk1, enf_walk2]
{
if (random() < 0.2)
// dumptruck_ds
- sound_idle (this, CHAN_VOICE, "enforcer/idle1.wav",
+ sound_idle (self, CHAN_VOICE, "enforcer/idle1.wav",
1, ATTN_IDLE);
ai_walk (2);
};
- nonvirtual void() walk2 = [$walk2, walk3] { ai_walk (4); };
- nonvirtual void() walk3 = [$walk3, walk4] { ai_walk (4); };
- nonvirtual void() walk4 = [$walk4, walk5] { ai_walk (3); };
- nonvirtual void() walk5 = [$walk5, walk6] { ai_walk (1); };
- nonvirtual void() walk6 = [$walk6, walk7] { ai_walk (2); };
- nonvirtual void() walk7 = [$walk7, walk8] { ai_walk (2); };
- nonvirtual void() walk8 = [$walk8, walk9] { ai_walk (1); };
- nonvirtual void() walk9 = [$walk9, walk10] { ai_walk (2); };
- nonvirtual void() walk10 = [$walk10, walk11] { ai_walk (4); };
- nonvirtual void() walk11 = [$walk11, walk12] { ai_walk (4); };
- nonvirtual void() walk12 = [$walk12, walk13] { ai_walk (1); };
- nonvirtual void() walk13 = [$walk13, walk14] { ai_walk (2); };
- nonvirtual void() walk14 = [$walk14, walk15] { ai_walk (3); };
- nonvirtual void() walk15 = [$walk15, walk16] { ai_walk (4); };
- nonvirtual void() walk16 = [$walk16, walk1] { ai_walk (2); };
+ void() enf_walk2 = [$walk2, enf_walk3] { ai_walk (4); };
+ void() enf_walk3 = [$walk3, enf_walk4] { ai_walk (4); };
+ void() enf_walk4 = [$walk4, enf_walk5] { ai_walk (3); };
+ void() enf_walk5 = [$walk5, enf_walk6] { ai_walk (1); };
+ void() enf_walk6 = [$walk6, enf_walk7] { ai_walk (2); };
+ void() enf_walk7 = [$walk7, enf_walk8] { ai_walk (2); };
+ void() enf_walk8 = [$walk8, enf_walk9] { ai_walk (1); };
+ void() enf_walk9 = [$walk9, enf_walk10] { ai_walk (2); };
+ void() enf_walk10 = [$walk10, enf_walk11] { ai_walk (4); };
+ void() enf_walk11 = [$walk11, enf_walk12] { ai_walk (4); };
+ void() enf_walk12 = [$walk12, enf_walk13] { ai_walk (1); };
+ void() enf_walk13 = [$walk13, enf_walk14] { ai_walk (2); };
+ void() enf_walk14 = [$walk14, enf_walk15] { ai_walk (3); };
+ void() enf_walk15 = [$walk15, enf_walk16] { ai_walk (4); };
+ void() enf_walk16 = [$walk16, enf_walk1] { ai_walk (2); };

//--------------------------------------------------------------
// Enforcer run functions
//--------------------------------------------------------------
- nonvirtual void() run1 = [$run1, run2]
+ void() enf_run1 = [$run1, enf_run2]
{
if (random() < 0.2)
// dumptruck_ds
- sound_idle (this, CHAN_VOICE, "enforcer/idle1.wav",
+ sound_idle (self, CHAN_VOICE, "enforcer/idle1.wav",
1, ATTN_IDLE);
ai_run (18);
};
- nonvirtual void() run2 = [$run2, run3] { ai_run (14); };
- nonvirtual void() run3 = [$run3, run4] { ai_run (7); };
- nonvirtual void() run4 = [$run4, run5] { ai_run (12); };
- nonvirtual void() run5 = [$run5, run6] { ai_run (14); };
- nonvirtual void() run6 = [$run6, run7] { ai_run (14); };
- nonvirtual void() run7 = [$run7, run8] { ai_run (7); };
- nonvirtual void() run8 = [$run8, run1] { ai_run (11); };
+ void() enf_run2 = [$run2, enf_run3] { ai_run (14); };
+ void() enf_run3 = [$run3, enf_run4] { ai_run (7); };
+ void() enf_run4 = [$run4, enf_run5] { ai_run (12); };
+ void() enf_run5 = [$run5, enf_run6] { ai_run (14); };
+ void() enf_run6 = [$run6, enf_run7] { ai_run (14); };
+ void() enf_run7 = [$run7, enf_run8] { ai_run (7); };
+ void() enf_run8 = [$run8, enf_run1] { ai_run (11); };

//--------------------------------------------------------------
// Enforcer attack functions
//--------------------------------------------------------------
- nonvirtual void() atk1 = [$attack1, atk2] { ai_face (); };
- nonvirtual void() atk2 = [$attack2, atk3] { ai_face (); };
- nonvirtual void() atk3 = [$attack3, atk4] { ai_face (); };
- nonvirtual void() atk4 = [$attack4, atk5] { ai_face (); };
- nonvirtual void() atk5 = [$attack5, atk6] { ai_face (); };
- nonvirtual void() atk6 = [$attack6, atk7] { atk_laser (); };
- nonvirtual void() atk7 = [$attack7, atk8] { ai_face (); };
- nonvirtual void() atk8 = [$attack8, atk9] { ai_face (); };
- nonvirtual void() atk9 = [$attack5, atk10] { ai_face (); };
- nonvirtual void() atk10 = [$attack6, atk11] { atk_laser (); };
- nonvirtual void() atk11 = [$attack7, atk12] { ai_face (); };
- nonvirtual void() atk12 = [$attack8, atk13] { ai_face (); };
- nonvirtual void() atk13 = [$attack9, atk14] { ai_face (); };
- nonvirtual void() atk14 = [$attack10, run1]
+ void() enf_atk1 = [$attack1, enf_atk2] { ai_face (); };
+ void() enf_atk2 = [$attack2, enf_atk3] { ai_face (); };
+ void() enf_atk3 = [$attack3, enf_atk4] { ai_face (); };
+ void() enf_atk4 = [$attack4, enf_atk5] { ai_face (); };
+ void() enf_atk5 = [$attack5, enf_atk6] { ai_face (); };
+ void() enf_atk6 = [$attack6, enf_atk7] { monster_enforcer_attack (); };
+ void() enf_atk7 = [$attack7, enf_atk8] { ai_face (); };
+ void() enf_atk8 = [$attack8, enf_atk9] { ai_face (); };
+ void() enf_atk9 = [$attack5, enf_atk10] { ai_face (); };
+ void() enf_atk10 = [$attack6, enf_atk11] { monster_enforcer_attack ();};
+ 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 (this.atk1);
+ sub_checkrefire (enf_atk1);
};

//--------------------------------------------------------------
// Enforcer attack functions 2
// modified animation frames for style Enforcers -- dumptruck_ds
//--------------------------------------------------------------
- nonvirtual void() enf2atk1 = [$attack1, enf2atk2]
+ void() enf_atkb1 = [$attack1, enf_atkb2]
{
ai_face ();
- this.count = 0;
- this.t_length = 8 + floor (random() * 6);
- };
- nonvirtual void() enf2atk2 = [$attack2, enf2atk3] { ai_face (); };
- nonvirtual void() enf2atk3 = [$attack3, enf2atk4] { ai_face (); };
- nonvirtual void() enf2atk4 = [$attack4, enf2atk5] { ai_face (); };
- nonvirtual void() enf2atk5 = [$attack5, enf2atk6] { ai_face (); };
- nonvirtual void() enf2atk6 =
- {
- this.frame = $attack6;
- this.nextthink = time + 0.1;
- if (this.style == 5 && this.count < this.t_length)
+ self.count = 0;
+ self.t_length = 8 + floor (random() * 6);
+ };
+ void() enf_atkb2 = [$attack2, enf_atkb3] { ai_face (); };
+ void() enf_atkb3 = [$attack3, enf_atkb4] { ai_face (); };
+ void() enf_atkb4 = [$attack4, enf_atkb5] { ai_face (); };
+ void() enf_atkb5 = [$attack5, enf_atkb6] { ai_face (); };
+ void() enf_atkb6 =
+ {
+ self.frame = $attack6;
+ self.nextthink = time + 0.1;
+ if (self.style == 5 && self.count < self.t_length)
{
- this.count += 1;
+ self.count += 1;
}
else
{
- this.think = this.enf2atk7;
+ self.think = enf_atkb7;
}
ai_face ();
- atk_laser ();
+ monster_enforcer_attack ();
};
- nonvirtual void() enf2atk7 = [$attack7, enf2atk8] { ai_face (); };
- nonvirtual void() enf2atk8 = [$attack8, enf2atk9] { ai_face (); };
- nonvirtual void() enf2atk9 = [$attack9, enf2atk10] { ai_face (); };
- nonvirtual void() enf2atk10 = [$attack10, run1]
+ void() enf_atkb7 = [$attack7, enf_atkb8] { ai_face (); };
+ void() enf_atkb8 = [$attack8, enf_atkb9] { ai_face (); };
+ void() enf_atkb9 = [$attack9, enf_atkb10] { ai_face (); };
+ void() enf_atkb10 = [$attack10, enf_run1]
{
ai_face ();
- sub_checkrefire (this.enf2atk1);
+ sub_checkrefire (enf_atkb1);
};

//--------------------------------------------------------------
// Enforcer attack functions 4
//--------------------------------------------------------------
- nonvirtual void() enf4atk1 = [$attack1, enf4atk2] { ai_face (); };
- nonvirtual void() enf4atk2 = [$attack2, enf4atk3] { ai_face (); };
- nonvirtual void() enf4atk3 = [$attack3, enf4atk4] { ai_face (); };
- nonvirtual void() enf4atk4 = [$attack4, enf4atk5] { ai_face (); };
- nonvirtual void() enf4atk5 = [$attack5, enf4atk6] { ai_face (); };
- nonvirtual void() enf4atk6 = [$attack6, enf4atk7] { atk_lightning (); };
- nonvirtual void() enf4atk7 = [$attack6, enf4atk8] { atk_lightning (); };
- nonvirtual void() enf4atk8 = [$attack6, enf4atk9] { atk_lightning (); };
- nonvirtual void() enf4atk9 = [$attack7, enf4atk10] { ai_face (); };
- nonvirtual void() enf4atk10 = [$attack8, enf4atk11] { ai_face (); };
- nonvirtual void() enf4atk11 = [$attack9, enf4atk12] { ai_face (); };
- nonvirtual void() enf4atk12 = [$attack10, run1]
+ void() enf_atkc1 = [$attack1, enf_atkc2] { ai_face (); };
+ void() enf_atkc2 = [$attack2, enf_atkc3] { ai_face (); };
+ void() enf_atkc3 = [$attack3, enf_atkc4] { ai_face (); };
+ void() enf_atkc4 = [$attack4, enf_atkc5] { ai_face (); };
+ void() enf_atkc5 = [$attack5, enf_atkc6] { ai_face (); };
+ void() enf_atkc6 = [$attack6, enf_atkc7]
+ {
+ monster_enforcer_attack_lightning ();
+ };
+ void() enf_atkc7 = [$attack6, enf_atkc8]
+ {
+ monster_enforcer_attack_lightning ();
+ };
+ void() enf_atkc8 = [$attack6, enf_atkc9]
+ {
+ monster_enforcer_attack_lightning ();
+ };
+ void() enf_atkc9 = [$attack7, enf_atkc10] { ai_face (); };
+ void() enf_atkc10 = [$attack8, enf_atkc11] { ai_face (); };
+ void() enf_atkc11 = [$attack9, enf_atkc12] { ai_face (); };
+ void() enf_atkc12 = [$attack10, enf_run1]
{
ai_face ();
- sub_checkrefire (enf2atk1);
+ sub_checkrefire (enf_atkc1);
};

//////////////////////////////////////
@@ -378,148 +456,146 @@ class monster_enforcer: base_walkmonster
//--------------------------------------------------------------
// Enforcer turret attack 1
//--------------------------------------------------------------
- nonvirtual void() tur_atk1 = [$attack1, tur_atk2] { ai_face (); };
- nonvirtual void() tur_atk2 = [$attack2, tur_atk3] { ai_face (); };
- nonvirtual void() tur_atk3 = [$attack3, tur_atk4]
+ void() enf_tur_atk1 = [$attack1, enf_tur_atk2] { ai_face (); };
+ void() enf_tur_atk2 = [$attack2, enf_tur_atk3] { ai_face (); };
+ void() enf_tur_atk3 = [$attack3, enf_tur_atk4]
{
ai_face ();
- this.attack_elevation = preach_iterate_elevation (
- OGRE_DEFAULT_ELEVATION, this.origin, this.enemy.origin);
+ self.attack_elevation = preach_iterate_elevation (
+ OGRE_DEFAULT_ELEVATION, self.origin, self.enemy.origin);
};
- nonvirtual void() tur_atk4 = [$attack4, tur_atk5]
+ void() enf_tur_atk4 = [$attack4, enf_tur_atk5]
{
ai_face ();
- this.attack_elevation = preach_iterate_elevation (
- this.attack_elevation, this.origin, this.enemy.origin);
+ self.attack_elevation = preach_iterate_elevation (
+ self.attack_elevation, self.origin, self.enemy.origin);
};
- nonvirtual void() tur_atk5 = [$attack5, tur_atk6]
+ void() enf_tur_atk5 = [$attack5, enf_tur_atk6]
{
ai_face ();
- this.attack_elevation = preach_iterate_elevation (
- this.attack_elevation, this.origin, this.enemy.origin);
+ self.attack_elevation = preach_iterate_elevation (
+ self.attack_elevation, self.origin, self.enemy.origin);
};
- nonvirtual void() tur_atk6 = [$attack6, tur_atk7]
+ void() enf_tur_atk6 = [$attack6, enf_tur_atk7]
{
- atk_laser ();
+ monster_enforcer_attack ();
};
- nonvirtual void() tur_atk7 = [$attack7, tur_atk8]
+ void() enf_tur_atk7 = [$attack7, enf_tur_atk8]
{
ai_face ();
- this.attack_elevation = preach_iterate_elevation (
- OGRE_DEFAULT_ELEVATION, this.origin, this.enemy.origin);
+ self.attack_elevation = preach_iterate_elevation (
+ OGRE_DEFAULT_ELEVATION, self.origin, self.enemy.origin);
};
- nonvirtual void() tur_atk8 = [$attack8, tur_atk9]
+ void() enf_tur_atk8 = [$attack8, enf_tur_atk9]
{
ai_face ();
- this.attack_elevation = preach_iterate_elevation (
- this.attack_elevation, this.origin, this.enemy.origin);
+ self.attack_elevation = preach_iterate_elevation (
+ self.attack_elevation, self.origin, self.enemy.origin);
};
- nonvirtual void() tur_atk9 = [$attack5, tur_atk10]
+ void() enf_tur_atk9 = [$attack5, enf_tur_atk10]
{
ai_face ();
- this.attack_elevation = preach_iterate_elevation (
- this.attack_elevation, this.origin, this.enemy.origin);
+ self.attack_elevation = preach_iterate_elevation (
+ self.attack_elevation, self.origin, self.enemy.origin);
};
- nonvirtual void() tur_atk10 = [$attack6, tur_atk11]
+ void() enf_tur_atk10 = [$attack6, enf_tur_atk11]
{
- atk_laser ();
+ monster_enforcer_attack ();
};
- nonvirtual void() tur_atk11 = [$attack7, tur_atk12] { ai_face (); };
- nonvirtual void() tur_atk12 = [$attack8, tur_atk13] { ai_face (); };
- nonvirtual void() tur_atk13 = [$attack9, tur_atk14] { ai_face (); };
- nonvirtual void() tur_atk14 = [$attack10, seek_stand1]
+ void() enf_tur_atk11 = [$attack7, enf_tur_atk12] { ai_face (); };
+ void() enf_tur_atk12 = [$attack8, enf_tur_atk13] { ai_face (); };
+ void() enf_tur_atk13 = [$attack9, enf_tur_atk14] { ai_face (); };
+ void() enf_tur_atk14 = [$attack10, enf_seek_stand1]
{
ai_face ();
- sub_checkrefire (tur_atk1);
+ sub_checkrefire (enf_tur_atk1);
};

//--------------------------------------------------------------
// Enforcer turret seek
//--------------------------------------------------------------
- nonvirtual void() seek_stand1 = [$stand1, seek_stand2] { ai_run (0); };
- nonvirtual void() seek_stand2 = [$stand2, seek_stand3] { ai_run (0); };
- nonvirtual void() seek_stand3 = [$stand3, seek_stand4] { ai_run (0); };
- nonvirtual void() seek_stand4 = [$stand4, seek_stand5] { ai_run (0); };
- nonvirtual void() seek_stand5 = [$stand5, seek_stand6] { ai_run (0); };
- nonvirtual void() seek_stand6 = [$stand6, seek_stand7] { ai_run (0); };
- nonvirtual void() seek_stand7 = [$stand7, seek_stand1] { ai_run (0); };
+ void() enf_seek_stand1 = [$stand1, enf_seek_stand2] { ai_run (0); };
+ void() enf_seek_stand2 = [$stand2, enf_seek_stand3] { ai_run (0); };
+ void() enf_seek_stand3 = [$stand3, enf_seek_stand4] { ai_run (0); };
+ void() enf_seek_stand4 = [$stand4, enf_seek_stand5] { ai_run (0); };
+ void() enf_seek_stand5 = [$stand5, enf_seek_stand6] { ai_run (0); };
+ void() enf_seek_stand6 = [$stand6, enf_seek_stand7] { ai_run (0); };
+ void() enf_seek_stand7 = [$stand7, enf_seek_stand1] { ai_run (0); };

//--------------------------------------------------------------
// Enforcer turret attack 2 (?)
//--------------------------------------------------------------
- nonvirtual void() enf2tur_atk1 = [$attack1, enf2tur_atk2]
+ void() enf_tur_atkb1 = [$attack1, enf_tur_atkb2]
{
ai_face ();
- this.count = 0;
- this.t_length = 4 + floor (random() * 4);
- };
- nonvirtual void() enf2tur_atk2 = [$attack2, enf2tur_atk3] {ai_face ();};
- nonvirtual void() enf2tur_atk3 = [$attack3, enf2tur_atk4] {ai_face ();};
- nonvirtual void() enf2tur_atk4 = [$attack4, enf2tur_atk5] {ai_face ();};
- nonvirtual void() enf2tur_atk5 = [$attack5, enf2tur_atk6] {ai_face ();};
- nonvirtual void() enf2tur_atk6 =
- {
- this.frame = $attack6;
- this.nextthink = time + 0.1;
- if (this.style == 5 && this.count < this.t_length)
- {
- this.count += 1;
- }
+ self.count = 0;
+ self.t_length = 4 + floor (random() * 4);
+ };
+ void() enf_tur_atkb2 = [$attack2, enf_tur_atkb3] { ai_face (); };
+ void() enf_tur_atkb3 = [$attack3, enf_tur_atkb4] { ai_face (); };
+ void() enf_tur_atkb4 = [$attack4, enf_tur_atkb5] { ai_face (); };
+ void() enf_tur_atkb5 = [$attack5, enf_tur_atkb6] { ai_face (); };
+ void() enf_tur_atkb6 =
+ {
+ self.frame = $attack6;
+ self.nextthink = time + 0.1;
+
+ if (self.style == 5 && self.count < self.t_length)
+ self.count += 1;
else
- {
- this.think = this.enf2tur_atk7;
- }
+ self.think = enf_tur_atkb7;
+
ai_face ();
- atk_laser ();
+ monster_enforcer_attack ();
};
- nonvirtual void() enf2tur_atk7 = [$attack7, enf2tur_atk8] {ai_face ();};
- nonvirtual void() enf2tur_atk8 = [$attack8, enf2tur_atk9] {ai_face ();};
- nonvirtual void() enf2tur_atk9 = [$attack9, enf2tur_atk10] {ai_face();};
- nonvirtual void() enf2tur_atk10 = [$attack10, enf2stand1]
+ void() enf_tur_atkb7 = [$attack7, enf_tur_atkb8] { ai_face (); };
+ void() enf_tur_atkb8 = [$attack8, enf_tur_atkb9] { ai_face (); };
+ void() enf_tur_atkb9 = [$attack9, enf_tur_atkb10] { ai_face (); };
+ void() enf_tur_atkb10 = [$attack10, enf_standb1]
{
ai_face ();
- sub_checkrefire (enf2tur_atk1);
+ sub_checkrefire (enf_tur_atkb1);
};

//--------------------------------------------------------------
// Enforcer turret attack 4 (?)
//--------------------------------------------------------------
- nonvirtual void() enf4tur_atk1 = [$attack1, enf4tur_atk2] {ai_face ();};
- nonvirtual void() enf4tur_atk2 = [$attack2, enf4tur_atk3] {ai_face ();};
- nonvirtual void() enf4tur_atk3 = [$attack3, enf4tur_atk4] {ai_face ();};
- nonvirtual void() enf4tur_atk4 = [$attack4, enf4tur_atk5] {ai_face ();};
- nonvirtual void() enf4tur_atk5 = [$attack5, enf4tur_atk6] {ai_face ();};
- nonvirtual void() enf4tur_atk6 = [$attack6, enf4tur_atk7]
+ void() enf_tur_atkc1 = [$attack1, enf_tur_atkc2] { ai_face (); };
+ void() enf_tur_atkc2 = [$attack2, enf_tur_atkc3] { ai_face (); };
+ void() enf_tur_atkc3 = [$attack3, enf_tur_atkc4] { ai_face (); };
+ void() enf_tur_atkc4 = [$attack4, enf_tur_atkc5] { ai_face (); };
+ void() enf_tur_atkc5 = [$attack5, enf_tur_atkc6] { ai_face (); };
+ void() enf_tur_atkc6 = [$attack6, enf_tur_atkc7]
{
- atk_lightning ();
+ monster_enforcer_attack_lightning ();
};
- nonvirtual void() enf4tur_atk7 = [$attack6, enf4tur_atk8]
+ void() enf_tur_atkc7 = [$attack6, enf_tur_atkc8]
{
- atk_lightning ();
+ monster_enforcer_attack_lightning ();
};
- nonvirtual void() enf4tur_atk8 = [$attack6, enf4tur_atk9]
+ void() enf_tur_atkc8 = [$attack6, enf_tur_atkc9]
{
- atk_lightning ();
+ monster_enforcer_attack_lightning ();
};
- nonvirtual void() enf4tur_atk9 = [$attack7, enf4tur_atk10] {ai_face();};
- nonvirtual void() enf4tur_atk10 = [$attack8, enf4tur_atk11]{ai_face();};
- nonvirtual void() enf4tur_atk11 = [$attack9, enf4tur_atk12]{ai_face();};
- nonvirtual void() enf4tur_atk12 = [$attack10, enf2stand1]
+ void() enf_tur_atkc9 = [$attack7, enf_tur_atkc10] { ai_face (); };
+ void() enf_tur_atkc10 = [$attack8, enf_tur_atkc11] { ai_face (); };
+ void() enf_tur_atkc11 = [$attack9, enf_tur_atkc12] { ai_face (); };
+ void() enf_tur_atkc12 = [$attack10, enf_standb1]
{
ai_face ();
- sub_checkrefire (enf2tur_atk1);
+ sub_checkrefire (enf_tur_atkb1);
};

//--------------------------------------------------------------
// Enforcer turret stand 2 (?)
//--------------------------------------------------------------
- nonvirtual void() enf2stand1 = [$stand1, enf2stand2] { ai_run (0); };
- nonvirtual void() enf2stand2 = [$stand2, enf2stand3] { ai_run (0); };
- nonvirtual void() enf2stand3 = [$stand3, enf2stand4] { ai_run (0); };
- nonvirtual void() enf2stand4 = [$stand4, enf2stand5] { ai_run (0); };
- nonvirtual void() enf2stand5 = [$stand5, enf2stand6] { ai_run (0); };
- nonvirtual void() enf2stand6 = [$stand6, enf2stand7] { ai_run (0); };
- nonvirtual void() enf2stand7 = [$stand7, enf2stand1] { ai_run (0); };
+ void() enf_standb1 = [$stand1, enf_standb2] { ai_run (0); };
+ void() enf_standb2 = [$stand2, enf_standb3] { ai_run (0); };
+ void() enf_standb3 = [$stand3, enf_standb4] { ai_run (0); };
+ void() enf_standb4 = [$stand4, enf_standb5] { ai_run (0); };
+ void() enf_standb5 = [$stand5, enf_standb6] { ai_run (0); };
+ void() enf_standb6 = [$stand6, enf_standb7] { ai_run (0); };
+ void() enf_standb7 = [$stand7, enf_standb1] { ai_run (0); };

//////////////////////////////////////
// new frames for turret mode END //
@@ -528,143 +604,131 @@ class monster_enforcer: base_walkmonster
//--------------------------------------------------------------
// Enforcer pain state A
//--------------------------------------------------------------
- nonvirtual void() paina1 = [$paina1, paina2] { };
- nonvirtual void() paina2 = [$paina2, paina3] { };
- nonvirtual void() paina3 = [$paina3, paina4] { };
- nonvirtual void() paina4 = [$paina4, run1] { };
+ void() enf_paina1 = [$paina1, enf_paina2] { };
+ void() enf_paina2 = [$paina2, enf_paina3] { };
+ void() enf_paina3 = [$paina3, enf_paina4] { };
+ void() enf_paina4 = [$paina4, enf_run1] { };

//--------------------------------------------------------------
// Enforcer pain state B
//--------------------------------------------------------------
- nonvirtual void() painb1 = [$painb1, painb2] { };
- nonvirtual void() painb2 = [$painb2, painb3] { };
- nonvirtual void() painb3 = [$painb3, painb4] { };
- nonvirtual void() painb4 = [$painb4, painb5] { };
- nonvirtual void() painb5 = [$painb5, run1] { };
+ void() enf_painb1 = [$painb1, enf_painb2] { };
+ void() enf_painb2 = [$painb2, enf_painb3] { };
+ void() enf_painb3 = [$painb3, enf_painb4] { };
+ void() enf_painb4 = [$painb4, enf_painb5] { };
+ void() enf_painb5 = [$painb5, enf_run1] { };

//--------------------------------------------------------------
// Enforcer pain state C
//--------------------------------------------------------------
- nonvirtual void() painc1 = [$painc1, painc2] { };
- nonvirtual void() painc2 = [$painc2, painc3] { };
- nonvirtual void() painc3 = [$painc3, painc4] { };
- nonvirtual void() painc4 = [$painc4, painc5] { };
- nonvirtual void() painc5 = [$painc5, painc6] { };
- nonvirtual void() painc6 = [$painc6, painc7] { };
- nonvirtual void() painc7 = [$painc7, painc8] { };
- nonvirtual void() painc8 = [$painc8, run1] { };
+ void() enf_painc1 = [$painc1, enf_painc2] { };
+ void() enf_painc2 = [$painc2, enf_painc3] { };
+ void() enf_painc3 = [$painc3, enf_painc4] { };
+ void() enf_painc4 = [$painc4, enf_painc5] { };
+ void() enf_painc5 = [$painc5, enf_painc6] { };
+ void() enf_painc6 = [$painc6, enf_painc7] { };
+ void() enf_painc7 = [$painc7, enf_painc8] { };
+ void() enf_painc8 = [$painc8, enf_run1] { };

//--------------------------------------------------------------
// Enforcer pain state D
//--------------------------------------------------------------
- nonvirtual void() paind1 = [$paind1, paind2] { };
- nonvirtual void() paind2 = [$paind2, paind3] { };
- nonvirtual void() paind3 = [$paind3, paind4] { };
- nonvirtual void() paind4 = [$paind4, paind5] { ai_painforward (2); };
- nonvirtual void() paind5 = [$paind5, paind6] { ai_painforward (1); };
- nonvirtual void() paind6 = [$paind6, paind7] { };
- nonvirtual void() paind7 = [$paind7, paind8] { };
- nonvirtual void() paind8 = [$paind8, paind9] { };
- nonvirtual void() paind9 = [$paind9, paind10] { };
- nonvirtual void() paind10 = [$paind10, paind11] { };
- nonvirtual void() paind11 = [$paind11, paind12] { ai_painforward (1); };
- nonvirtual void() paind12 = [$paind12, paind13] { ai_painforward (1); };
- nonvirtual void() paind13 = [$paind13, paind14] { ai_painforward (1); };
- nonvirtual void() paind14 = [$paind14, paind15] { };
- nonvirtual void() paind15 = [$paind15, paind16] { };
- nonvirtual void() paind16 = [$paind16, paind17] { ai_pain (1); };
- nonvirtual void() paind17 = [$paind17, paind18] { ai_pain (1); };
- nonvirtual void() paind18 = [$paind18, paind19] { };
- nonvirtual void() paind19 = [$paind19, run1] { };
+ void() enf_paind1 = [$paind1, enf_paind2] { };
+ void() enf_paind2 = [$paind2, enf_paind3] { };
+ void() enf_paind3 = [$paind3, enf_paind4] { };
+ void() enf_paind4 = [$paind4, enf_paind5] { ai_painforward (2); };
+ void() enf_paind5 = [$paind5, enf_paind6] { ai_painforward (1); };
+ void() enf_paind6 = [$paind6, enf_paind7] { };
+ void() enf_paind7 = [$paind7, enf_paind8] { };
+ void() enf_paind8 = [$paind8, enf_paind9] { };
+ void() enf_paind9 = [$paind9, enf_paind10] { };
+ void() enf_paind10 = [$paind10, enf_paind11] { };
+ void() enf_paind11 = [$paind11, enf_paind12] { ai_painforward (1); };
+ void() enf_paind12 = [$paind12, enf_paind13] { ai_painforward (1); };
+ void() enf_paind13 = [$paind13, enf_paind14] { ai_painforward (1); };
+ void() enf_paind14 = [$paind14, enf_paind15] { };
+ void() enf_paind15 = [$paind15, enf_paind16] { };
+ void() enf_paind16 = [$paind16, enf_paind17] { ai_pain (1); };
+ void() enf_paind17 = [$paind17, enf_paind18] { ai_pain (1); };
+ void() enf_paind18 = [$paind18, enf_paind19] { };
+ void() enf_paind19 = [$paind19, enf_run1] { };

//--------------------------------------------------------------
// Enforcer death state A
//--------------------------------------------------------------
- nonvirtual void() die1 = [$death1, die2] { };
- nonvirtual void() die2 = [$death2, die3] { };
- nonvirtual void() die3 = [$death3, die4]
+ void() enf_die1 = [$death1, enf_die2] { };
+ void() enf_die2 = [$death2, enf_die3] { };
+ void() enf_die3 = [$death3, enf_die4]
{
- this.solid = SOLID_NOT;
+ self.solid = SOLID_NOT;

// style ammotype check -- dumptruck_ds
- if (this.style == 1)
- {
- this.ammo_rockets = 2;
- }
+ if (self.style == 1)
+ self.ammo_rockets = 2;
+
// style ammotype check -- dumptruck_ds
- if (this.style == 2)
- {
- this.ammo_rockets = 2;
- }
+ if (self.style == 2)
+ self.ammo_rockets = 2;
+
// style ammotype check -- dumptruck_ds
- if (this.style == 3 || this.style == 5)
- {
- this.ammo_nails = 5;
- }
+ if (self.style == 3 || self.style == 5)
+ self.ammo_nails = 5;
+
// style ammotype check -- dumptruck_ds
- if (this.style == 0 || this.style == 4)
- {
- this.ammo_cells = 5;
- }
- if (!this.keep_ammo)
- item_backpack::drop_backpack (this.origin, this.weapon,
- this.ammo_shells, this.ammo_nails,
- this.ammo_rockets, this.ammo_cells);
- };
- nonvirtual void() die4 = [$death4, die5] { ai_forward (14); };
- nonvirtual void() die5 = [$death5, die6] { ai_forward (2); };
- nonvirtual void() die6 = [$death6, die7] { };
- nonvirtual void() die7 = [$death7, die8] { };
- nonvirtual void() die8 = [$death8, die9] { };
- nonvirtual void() die9 = [$death9, die10] { ai_forward (3); };
- nonvirtual void() die10 = [$death10, die11] { ai_forward (5); };
- nonvirtual void() die11 = [$death11, die12] { ai_forward (5); };
- nonvirtual void() die12 = [$death12, die13] { ai_forward (5); };
- nonvirtual void() die13 = [$death13, die14] { };
- nonvirtual void() die14 = [$death14, die14] { };
+ if (self.style == 0 || self.style == 4)
+ self.ammo_cells = 5;
+
+ if (!self.keep_ammo)
+ item_backpack_drop (self);
+ };
+ void() enf_die4 = [$death4, enf_die5] { ai_forward (14); };
+ void() enf_die5 = [$death5, enf_die6] { ai_forward (2); };
+ void() enf_die6 = [$death6, enf_die7] { };
+ void() enf_die7 = [$death7, enf_die8] { };
+ void() enf_die8 = [$death8, enf_die9] { };
+ void() enf_die9 = [$death9, enf_die10] { ai_forward (3); };
+ void() enf_die10 = [$death10, enf_die11] { ai_forward (5); };
+ void() enf_die11 = [$death11, enf_die12] { ai_forward (5); };
+ void() enf_die12 = [$death12, enf_die13] { ai_forward (5); };
+ void() enf_die13 = [$death13, enf_die14] { };
+ void() enf_die14 = [$death14, enf_die14] { };

//--------------------------------------------------------------
// Enforcer death state F
//--------------------------------------------------------------
- nonvirtual void() fdie1 = [$fdeath1, fdie2] { };
- nonvirtual void() fdie2 = [$fdeath2, fdie3] { };
- nonvirtual void() fdie3 = [$fdeath3, fdie4]
+ void() enf_dief1 = [$fdeath1, enf_dief2] { };
+ void() enf_dief2 = [$fdeath2, enf_dief3] { };
+ void() enf_dief3 = [$fdeath3, enf_dief4]
{
- this.solid = SOLID_NOT;
+ self.solid = SOLID_NOT;

// style ammotype check -- dumptruck_ds
- if (this.style == 1)
- {
- this.ammo_rockets = 2;
- }
+ if (self.style == 1)
+ self.ammo_rockets = 2;
+
// style ammotype check -- dumptruck_ds
- if (this.style == 2)
- {
- this.ammo_rockets = 2;
- }
+ if (self.style == 2)
+ self.ammo_rockets = 2;
+
// style ammotype check -- dumptruck_ds
- if (this.style == 3 || this.style == 5)
- {
- this.ammo_nails = 5;
- }
+ if (self.style == 3 || self.style == 5)
+ self.ammo_nails = 5;
+
// style ammotype check -- dumptruck_ds
- if (this.style == 0 || this.style == 4)
- {
- this.ammo_cells = 5;
- }
- if (!this.keep_ammo)
- item_backpack::drop_backpack (this.origin, this.weapon,
- this.ammo_shells, this.ammo_nails,
- this.ammo_rockets, this.ammo_cells);
- };
- nonvirtual void() fdie4 = [$fdeath4, fdie5] { };
- nonvirtual void() fdie5 = [$fdeath5, fdie6] { };
- nonvirtual void() fdie6 = [$fdeath6, fdie7] { };
- nonvirtual void() fdie7 = [$fdeath7, fdie8] { };
- nonvirtual void() fdie8 = [$fdeath8, fdie9] { };
- nonvirtual void() fdie9 = [$fdeath9, fdie10] { };
- nonvirtual void() fdie10 = [$fdeath10, fdie11] { };
- nonvirtual void() fdie11 = [$fdeath11, fdie11] { };
+ if (self.style == 0 || self.style == 4)
+ self.ammo_cells = 5;
+
+ if (!self.keep_ammo)
+ item_backpack_drop (self);
+ };
+ void() enf_dief4 = [$fdeath4, enf_dief5] { };
+ void() enf_dief5 = [$fdeath5, enf_dief6] { };
+ void() enf_dief6 = [$fdeath6, enf_dief7] { };
+ void() enf_dief7 = [$fdeath7, enf_dief8] { };
+ void() enf_dief8 = [$fdeath8, enf_dief9] { };
+ void() enf_dief9 = [$fdeath9, enf_dief10] { };
+ void() enf_dief10 = [$fdeath10, enf_dief11] { };
+ void() enf_dief11 = [$fdeath11, enf_dief11] { };

//==============================================================
// Interaction
@@ -673,120 +737,109 @@ class monster_enforcer: base_walkmonster
//--------------------------------------------------------------
// enf_pain
//--------------------------------------------------------------
- virtual void(entity attacker, float damage) do_damage =
+ void(entity attacker, float damage) monster_enforcer_pain =
{
local float r;

r = random ();

- if (this.pain_finished > time)
+ if (self.pain_finished > time)
return;

if (r < 0.5)
// dumptruck_ds
- sound_pain (this, CHAN_VOICE, "enforcer/pain1.wav",
+ sound_pain (self, CHAN_VOICE, "enforcer/pain1.wav",
1, ATTN_NORM);
else
// dumptruck_ds
- sound_misc3 (this, CHAN_VOICE, "enforcer/pain2.wav",
+ sound_misc3 (self, CHAN_VOICE, "enforcer/pain2.wav",
1, ATTN_NORM);

if (r < 0.2)
{
- this.pain_finished = time + 1;
+ self.pain_finished = time + 1;
// moved these here to avoid spamming pain sounds
// -- dumptruck_ds
- if (this.spawnflags & I_AM_TURRET)
+ if (self.spawnflags & I_AM_TURRET)
return;
else
- this.paina1 ();
+ enf_paina1 ();
}
else if (r < 0.4)
{
- this.pain_finished = time + 1;
- if (this.spawnflags & I_AM_TURRET)
+ self.pain_finished = time + 1;
+ if (self.spawnflags & I_AM_TURRET)
return;
else
- this.painb1 ();
+ enf_painb1 ();
}
else if (r < 0.7)
{
- this.pain_finished = time + 1;
- if (this.spawnflags & I_AM_TURRET)
+ self.pain_finished = time + 1;
+ if (self.spawnflags & I_AM_TURRET)
return;
else
- this.painc1 ();
+ enf_painc1 ();
}
else
{
- this.pain_finished = time + 2;
- if (this.spawnflags & I_AM_TURRET)
+ self.pain_finished = time + 2;
+ if (self.spawnflags & I_AM_TURRET)
return;
else
- this.paind1 ();
+ enf_paind1 ();
}
};

//--------------------------------------------------------------
// enf_die
//--------------------------------------------------------------
- virtual void() do_destroy =
+ void() monster_enforcer_destroy =
{
// check for gib
- if (this.health < -35)
+ if (self.health < -35)
{
- sound (this, CHAN_VOICE, "player/udeath.wav",
+ sound (self, CHAN_VOICE, "player/udeath.wav",
1, ATTN_NORM);
// dumptruck_ds custom_mdls
- if (this.mdl_head != "")
- {
- ThrowHead (this.mdl_head, this.health);
- }
+ if (self.mdl_head != "")
+ throw_head (self.mdl_head, self.health);
else
- {
- ThrowHead ("progs/h_mega.mdl", this.health);
- }
- // ThrowGib ("progs/gib1.mdl", this.health);
- // ThrowGib ("progs/gib2.mdl", this.health);
- // ThrowGib ("progs/gib3.mdl", this.health);
+ throw_head ("progs/h_mega.mdl", self.health);
+
+ // throw_gib ("progs/gib1.mdl", self.health);
+ // throw_gib ("progs/gib2.mdl", self.health);
+ // throw_gib ("progs/gib3.mdl", self.health);
+
// custom models -- dumptruck_ds
- if (this.mdl_gib1 != "")
- {
- ThrowGib (this.mdl_gib1, this.health);
- }
+ if (self.mdl_gib1 != "")
+ throw_gib (self.mdl_gib1, self.health);
else
- {
- ThrowGib ("progs/gib1.mdl", this.health);
- }
- if (this.mdl_gib2 != "")
- {
- ThrowGib (this.mdl_gib2, this.health);
- }
+ throw_gib ("progs/gib1.mdl", self.health);
+
+ if (self.mdl_gib2 != "")
+ throw_gib (self.mdl_gib2, self.health);
else
- {
- ThrowGib ("progs/gib2.mdl", this.health);
- }
- if (this.mdl_gib3 != "")
- {
- ThrowGib (this.mdl_gib3, this.health);
- }
+ throw_gib ("progs/gib2.mdl", self.health);
+
+ if (self.mdl_gib3 != "")
+ throw_gib (self.mdl_gib3, self.health);
else
- {
- ThrowGib ("progs/gib3.mdl", this.health);
- }
- base_item::drop_stuff (this);
+ throw_gib ("progs/gib3.mdl", self.health);
+
+ base_item_drop_stuff (self);
return;
}

// regular death
// dumptruck_ds
- sound_death (this, CHAN_VOICE, "enforcer/death1.wav",
+ sound_death (self, CHAN_VOICE, "enforcer/death1.wav",
1, ATTN_NORM);
- base_item::drop_stuff (this);
+ base_item_drop_stuff (self);
if (random() > 0.5)
- this.die1 ();
+ enf_die1 ();
else
- this.fdie1 ();
+ enf_dief1 ();
};

//==============================================================
@@ -794,125 +847,130 @@ class monster_enforcer: base_walkmonster
//==============================================================

//--------------------------------------------------------------
- virtual void() init_spawned =
+ void(entity e) monster_enforcer_init =
{
if (deathmatch)
{
- remove (this);
+ remove (e);
return;
}

- if (this.style >= 6)
+ if (e.style >= 6)
objerror ("style key set too high\n");

+ e.classname = "monster_enforcer";
+ e.classtype = CT_MONSTER_ENFORCER;
+
// custom_mdls function -- dumptruck_ds
- precache_body_model2 ("progs/enforcer.mdl");
- precache_head_model2 ("progs/h_mega.mdl");
- precache_proj_model2 ("progs/laser.mdl");
- precache_proj_model2 ("progs/s_spike.mdl");
- precache_proj_model2 ("progs/missile.mdl");
+ precache_body_model2 (e, "progs/enforcer.mdl");
+ precache_head_model2 (e, "progs/h_mega.mdl");
+ precache_proj_model2 (e, "progs/laser.mdl");
+ precache_proj_model2 (e, "progs/s_spike.mdl");
+ precache_proj_model2 (e, "progs/missile.mdl");
// dumptruck_ds
- precache_sound2_death ("enforcer/death1.wav");
- precache_sound2_attack ("enforcer/enfire.wav");
- precache_sound2_hit ("enforcer/enfstop.wav");
- precache_sound2_idle ("enforcer/idle1.wav");
- precache_sound2_pain ("enforcer/pain1.wav");
- precache_sound2_misc3 ("enforcer/pain2.wav");
- precache_sound2_sight ("enforcer/sight1.wav");
+ precache_sound2_death (e, "enforcer/death1.wav");
+ precache_sound2_attack (e, "enforcer/enfire.wav");
+ precache_sound2_hit (e, "enforcer/enfstop.wav");
+ precache_sound2_idle (e, "enforcer/idle1.wav");
+ precache_sound2_pain (e, "enforcer/pain1.wav");
+ precache_sound2_misc3 (e, "enforcer/pain2.wav");
+ precache_sound2_sight (e, "enforcer/sight1.wav");
// these will be replaced with custom noise fields eventually
// -- dumptruck_ds
- precache_sound2_misc ("enforcer/sight2.wav");
- precache_sound2_misc1 ("enforcer/sight3.wav");
- precache_sound2_misc2 ("enforcer/sight4.wav");
+ precache_sound2_misc (e, "enforcer/sight2.wav");
+ precache_sound2_misc1 (e, "enforcer/sight3.wav");
+ precache_sound2_misc2 (e, "enforcer/sight4.wav");

- precache_gib1 ("progs/gib1.mdl");
- precache_gib2 ("progs/gib2.mdl");
- precache_gib3 ("progs/gib3.mdl");
+ precache_gib1 (e, "progs/gib1.mdl");
+ precache_gib2 (e, "progs/gib2.mdl");
+ precache_gib3 (e, "progs/gib3.mdl");

- this.solid = SOLID_SLIDEBOX;
- this.movetype = MOVETYPE_STEP;
+ e.solid = SOLID_SLIDEBOX;
+ e.movetype = MOVETYPE_STEP;

// SPIKE to the RESCUE!!!! - got this fixed. -- dumptruck_ds
- body_model ("progs/enforcer.mdl");
+ body_model (e, "progs/enforcer.mdl");
// orginal dumptruck_ds
- // setmodel (this, "progs/enforcer.mdl");
+ // setmodel (e, "progs/enforcer.mdl");

- setsize (this, '-16 -16 -24', '16 16 40');
+ setsize (e, '-16 -16 -24', '16 16 40');

- if (!this.proj_speed_mod)
- this.proj_speed_mod = 1;
+ if (!e.proj_speed_mod)
+ e.proj_speed_mod = 1;

- if (!this.health)
+ if (!e.health)
// thanks RennyC -- dumptruck_ds
- this.health = 80;
+ e.health = 80;

- this.think_stand = this.stand1;
- this.think_walk = this.walk1;
- if (this.spawnflags & I_AM_TURRET)
- this.think_run = this.enf2stand1;
+ e.sightsound = monster_enforcer_sightsound;
+ e.think_stand = enf_stand1;
+ e.think_walk = enf_walk1;
+
+ if (e.spawnflags & I_AM_TURRET)
+ e.think_run = enf_standb1;
else
- this.think_run = this.run1;
+ e.think_run = enf_run1;
// Berserk test from
// http://celephais.net/board/view_thread.php?id=4&start=3465
// -- dumptruck_ds
- if !(this.berserk)
- this.th_pain = this.do_damage;
+ if !(e.berserk)
+ e.pain = monster_enforcer_pain;
else
- this.th_pain = sub_nullpain;
- this.th_die = this.do_destroy;
+ e.pain = sub_nullpain;
+ e.destroy = monster_enforcer_destroy;
// new animation frame check -- dumptruck_ds
- if (this.style == 1 || this.style == 2 || this.style == 5)
+ if (e.style == 1 || e.style == 2 || e.style == 5)
{
- if (this.spawnflags & I_AM_TURRET)
- {
- this.think_turret = this.enf2tur_atk1;
- }
- this.think_missile = this.enf2atk1;
+ if (e.spawnflags & I_AM_TURRET)
+ e.think_turret = enf_tur_atkb1;
+ e.think_missile = enf_atkb1;
}
- else if (this.style == 0 || this.style == 3 )
+ else if (e.style == 0 || e.style == 3 )
{
- if (this.spawnflags & I_AM_TURRET)
- {
- this.think_turret = this.tur_atk1;
- }
- this.think_missile = this.atk1;
+ if (e.spawnflags & I_AM_TURRET)
+ e.think_turret = enf_tur_atk1;
+ e.think_missile = enf_atk1;
}
- else if (this.style == 4)
+ else if (e.style == 4)
{
- if (this.spawnflags & I_AM_TURRET)
- {
- this.think_turret = this.enf4tur_atk1;
- }
- this.think_missile = this.enf4atk1;
+ if (e.spawnflags & I_AM_TURRET)
+ e.think_turret = enf_tur_atkc1;
+ e.think_missile = enf_atkc1;
}

// walkmonster_start
- super::init_spawned ();
+ base_walkmonster_init (e);
};

//--------------------------------------------------------------
void() monster_enforcer =
{
- this.classtype = CT_MONSTER_ENFORCER;
+ // new spawnflags for all entities -- iw
+ if (SUB_Inhibit())
+ return;
+
+ monster_enforcer_init (self);
};
-};
+// };

-//==============================================================================
+//======================================================================
// Scenic Dead Monster Patch stuff here from DeadStuff mod -- dumptruck_ds
-//==============================================================================
+//======================================================================

/*QUAKED monster_dead_enforcer (0 0.5 0.8) (-16 -16 -24) (16 16 32) SOLID FACE_UP X X X X X X NOT_ON_EASY NOT_ON_NORMAL NOT_ON_HARD_OR_NIGHTMARE NOT_IN_DEATHMATCH NOT_IN_COOP NOT_IN_SINGLEPLAYER X NOT_ON_HARD_ONLY NOT_ON_NIGHTMARE_ONLY
{
model ({"path":"progs/enforcer.mdl","frame":54});
}
*/
+//----------------------------------------------------------------------
void() monster_dead_enforcer =
{
- if (SUB_Inhibit ()) // new spawnflags for all entities -- iw
+ // new spawnflags for all entities -- iw
+ if (SUB_Inhibit())
return;

- precache_model("progs/enforcer.mdl");
- setmodel(self, "progs/enforcer.mdl");
+ precache_model ("progs/enforcer.mdl");
+ setmodel (self, "progs/enforcer.mdl");
if (self.spawnflags & 2)
{
self.frame = $fdeath11;
@@ -920,7 +978,7 @@ void() monster_dead_enforcer =
if (self.spawnflags & 1)
{
self.solid = SOLID_BBOX;
- setsize(self,'-41.16 -45.65 -51.95','21.45 25.49 30');
+ setsize (self,'-41.16 -45.65 -51.95','21.45 25.49 30');
}
else
{
@@ -934,7 +992,7 @@ void() monster_dead_enforcer =
if (self.spawnflags & 1)
{
self.solid = SOLID_BBOX;
- setsize(self,'-39.85 -29.35 -49.07','20.52 33.17 30');
+ setsize (self,'-39.85 -29.35 -49.07','20.52 33.17 30');
}
else
{

Return to the top of this page or return to the overview of this repo.

Diff qc/monsters/fish.qc

diff --git a/qc/monsters/fish.qc b/qc/monsters/fish.qc
index 15a8331..3bab151 100644
--- a/qc/monsters/fish.qc
+++ b/qc/monsters/fish.qc
@@ -3,8 +3,49 @@
//==============================================================================

//======================================================================
+// forward declarations
+//======================================================================
+
+// monster_fish
+void() monster_fish_attack_melee; // AI, attacks, animation, thinking
+void() fish_stand1; void() fish_stand2; void() fish_stand3; void() fish_stand4;
+void() fish_stand5; void() fish_stand6; void() fish_stand7; void() fish_stand8;
+void() fish_stand9; void() fish_stand10; void() fish_stand11;
+void() fish_stand12; void() fish_stand13; void() fish_stand14;
+void() fish_stand15; void() fish_stand16; void() fish_stand17;
+void() fish_stand18;
+void() fish_walk1; void() fish_walk2; void() fish_walk3; void() fish_walk4;
+void() fish_walk5; void() fish_walk6; void() fish_walk7; void() fish_walk8;
+void() fish_walk9; void() fish_walk10; void() fish_walk11; void() fish_walk12;
+void() fish_walk13; void() fish_walk14; void() fish_walk15; void() fish_walk16;
+void() fish_walk17; void() fish_walk18;
+void() fish_run1; void() fish_run2; void() fish_run3; void() fish_run4;
+void() fish_run5; void() fish_run6; void() fish_run7; void() fish_run8;
+void() fish_run9;
+void() fish_atk1; void() fish_atk2; void() fish_atk3; void() fish_atk4;
+void() fish_atk5; void() fish_atk6; void() fish_atk7; void() fish_atk8;
+void() fish_atk9; void() fish_atk10; void() fish_atk11; void() fish_atk12;
+void() fish_atk13; void() fish_atk14; void() fish_atk15; void() fish_atk16;
+void() fish_atk17; void() fish_atk18;
+void() fish_pain1; void() fish_pain2; void() fish_pain3; void() fish_pain4;
+void() fish_pain5; void() fish_pain6; void() fish_pain7; void() fish_pain8;
+void() fish_pain9;
+void() fish_death1; void() fish_death2; void() fish_death3; void() fish_death4;
+void() fish_death5; void() fish_death6; void() fish_death7; void() fish_death8;
+void() fish_death9; void() fish_death10; void() fish_death11;
+void() fish_death12; void() fish_death13; void() fish_death14;
+void() fish_death15; void() fish_death16; void() fish_death17;
+void() fish_death18; void() fish_death19; void() fish_death20;
+void() fish_death21;
+void(entity attacker, float damage) monster_fish_pain; // interaction
+void() monster_fish_destroy;
+void(entity e) monster_fish_init; // initialization
+void() monster_fish;
+
+//======================================================================
// frame macros
//======================================================================
+
$cd id1/models/fish
$origin 0 0 24
$base base
@@ -25,6 +66,8 @@ $frame swim18
$frame pain1 pain2 pain3 pain4 pain5 pain6 pain7 pain8
$frame pain9

+//------------------------------------------------------------------------------
+
/*QUAKED monster_fish (1 0 0) (-16 -16 -24) (16 16 24) AMBUSH X X TRIGGER_SPAWNED X X X X NOT_ON_EASY NOT_ON_NORMAL NOT_ON_HARD_OR_NIGHTMARE NOT_IN_DEATHMATCH NOT_IN_COOP NOT_IN_SINGLEPLAYER X NOT_ON_HARD_ONLY NOT_ON_NIGHTMARE_ONLY
{
model ("progs/fish.mdl");
@@ -78,154 +121,164 @@ obit_method(string) : "When used with obit_name, will set part of the text for a
damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by this number (e.g. 4 = Quad damage)"

*/
-class monster_fish: base_swimmonster
-{
+//----------------------------------------------------------------------
+// class monster_fish: base_swimmonster
+// {
//--------------------------------------------------------------
- nonvirtual void() melee =
+ void() monster_fish_attack_melee =
{
local vector delta;
local float ldmg;

- if (!this.enemy)
+ if (!self.enemy)
// removed before stroke
return;

- delta = this.enemy.origin - this.origin;
+ delta = self.enemy.origin - self.origin;

if (vlen(delta) > 60)
return;

- sound_attack (this, CHAN_VOICE, "fish/bite.wav", 1, ATTN_NORM);
+ sound_attack (self, CHAN_VOICE, "fish/bite.wav", 1, ATTN_NORM);
ldmg = (random() + random()) * 3;
- this.t_damage2 (this.enemy, this, this, ldmg);
+ t_damage2 (self.enemy, self, self, ldmg);
};

//--------------------------------------------------------------
// Fish stand (resting?) functions
//--------------------------------------------------------------
- nonvirtual void() stand1 = [$swim1, stand2] { ai_stand (); };
- nonvirtual void() stand2 = [$swim2, stand3] { ai_stand (); };
- nonvirtual void() stand3 = [$swim3, stand4] { ai_stand (); };
- nonvirtual void() stand4 = [$swim4, stand5] { ai_stand (); };
- nonvirtual void() stand5 = [$swim5, stand6] { ai_stand (); };
- nonvirtual void() stand6 = [$swim6, stand7] { ai_stand (); };
- nonvirtual void() stand7 = [$swim7, stand8] { ai_stand (); };
- nonvirtual void() stand8 = [$swim8, stand9] { ai_stand (); };
- nonvirtual void() stand9 = [$swim9, stand10 ] { ai_stand (); };
- nonvirtual void() stand10 = [$swim10, stand11] { ai_stand (); };
- nonvirtual void() stand11 = [$swim11, stand12] { ai_stand (); };
- nonvirtual void() stand12 = [$swim12, stand13] { ai_stand (); };
- nonvirtual void() stand13 = [$swim13, stand14] { ai_stand (); };
- nonvirtual void() stand14 = [$swim14, stand15] { ai_stand (); };
- nonvirtual void() stand15 = [$swim15, stand16] { ai_stand (); };
- nonvirtual void() stand16 = [$swim16, stand17] { ai_stand (); };
- nonvirtual void() stand17 = [$swim17, stand18] { ai_stand (); };
- nonvirtual void() stand18 = [$swim18, stand1] { ai_stand (); };
+ void() fish_stand1 = [$swim1, fish_stand2] { ai_stand (); };
+ void() fish_stand2 = [$swim2, fish_stand3] { ai_stand (); };
+ void() fish_stand3 = [$swim3, fish_stand4] { ai_stand (); };
+ void() fish_stand4 = [$swim4, fish_stand5] { ai_stand (); };
+ void() fish_stand5 = [$swim5, fish_stand6] { ai_stand (); };
+ void() fish_stand6 = [$swim6, fish_stand7] { ai_stand (); };
+ void() fish_stand7 = [$swim7, fish_stand8] { ai_stand (); };
+ void() fish_stand8 = [$swim8, fish_stand9] { ai_stand (); };
+ void() fish_stand9 = [$swim9, fish_stand10 ] { ai_stand (); };
+ void() fish_stand10 = [$swim10, fish_stand11] { ai_stand (); };
+ void() fish_stand11 = [$swim11, fish_stand12] { ai_stand (); };
+ void() fish_stand12 = [$swim12, fish_stand13] { ai_stand (); };
+ void() fish_stand13 = [$swim13, fish_stand14] { ai_stand (); };
+ void() fish_stand14 = [$swim14, fish_stand15] { ai_stand (); };
+ void() fish_stand15 = [$swim15, fish_stand16] { ai_stand (); };
+ void() fish_stand16 = [$swim16, fish_stand17] { ai_stand (); };
+ void() fish_stand17 = [$swim17, fish_stand18] { ai_stand (); };
+ void() fish_stand18 = [$swim18, fish_stand1] { ai_stand (); };

//--------------------------------------------------------------
// Fish walking functions (ever seen a fish walk?)
//--------------------------------------------------------------
- nonvirtual void() walk1 = [$swim1, walk2] { ai_walk (8); };
- nonvirtual void() walk2 = [$swim2, walk3] { ai_walk (8); };
- nonvirtual void() walk3 = [$swim3, walk4] { ai_walk (8); };
- nonvirtual void() walk4 = [$swim4, walk5] { ai_walk (8); };
- nonvirtual void() walk5 = [$swim5, walk6] { ai_walk (8); };
- nonvirtual void() walk6 = [$swim6, walk7] { ai_walk (8); };
- nonvirtual void() walk7 = [$swim7, walk8] { ai_walk (8); };
- nonvirtual void() walk8 = [$swim8, walk9] { ai_walk (8); };
- nonvirtual void() walk9 = [$swim9, walk10] { ai_walk (8); };
- nonvirtual void() walk10 = [$swim10, walk11] { ai_walk (8); };
- nonvirtual void() walk11 = [$swim11, walk12] { ai_walk (8); };
- nonvirtual void() walk12 = [$swim12, walk13] { ai_walk (8); };
- nonvirtual void() walk13 = [$swim13, walk14] { ai_walk (8); };
- nonvirtual void() walk14 = [$swim14, walk15] { ai_walk (8); };
- nonvirtual void() walk15 = [$swim15, walk16] { ai_walk (8); };
- nonvirtual void() walk16 = [$swim16, walk17] { ai_walk (8); };
- nonvirtual void() walk17 = [$swim17, walk18] { ai_walk (8); };
- nonvirtual void() walk18 = [$swim18, walk1] { ai_walk (8); };
+ void() fish_walk1 = [$swim1, fish_walk2] { ai_walk (8); };
+ void() fish_walk2 = [$swim2, fish_walk3] { ai_walk (8); };
+ void() fish_walk3 = [$swim3, fish_walk4] { ai_walk (8); };
+ void() fish_walk4 = [$swim4, fish_walk5] { ai_walk (8); };
+ void() fish_walk5 = [$swim5, fish_walk6] { ai_walk (8); };
+ void() fish_walk6 = [$swim6, fish_walk7] { ai_walk (8); };
+ void() fish_walk7 = [$swim7, fish_walk8] { ai_walk (8); };
+ void() fish_walk8 = [$swim8, fish_walk9] { ai_walk (8); };
+ void() fish_walk9 = [$swim9, fish_walk10] { ai_walk (8); };
+ void() fish_walk10 = [$swim10, fish_walk11] { ai_walk (8); };
+ void() fish_walk11 = [$swim11, fish_walk12] { ai_walk (8); };
+ void() fish_walk12 = [$swim12, fish_walk13] { ai_walk (8); };
+ void() fish_walk13 = [$swim13, fish_walk14] { ai_walk (8); };
+ void() fish_walk14 = [$swim14, fish_walk15] { ai_walk (8); };
+ void() fish_walk15 = [$swim15, fish_walk16] { ai_walk (8); };
+ void() fish_walk16 = [$swim16, fish_walk17] { ai_walk (8); };
+ void() fish_walk17 = [$swim17, fish_walk18] { ai_walk (8); };
+ void() fish_walk18 = [$swim18, fish_walk1] { ai_walk (8); };

//--------------------------------------------------------------
// Fish run functions
//--------------------------------------------------------------
- nonvirtual void() run1 = [$swim1, run2]
+ void() fish_run1 = [$swim1, fish_run2]
{
ai_run (12);
if (random() < 0.5)
- sound_idle (this, CHAN_VOICE, "fish/idle.wav",
+ sound_idle (self, CHAN_VOICE, "fish/idle.wav",
1, ATTN_NORM);
};
- nonvirtual void() run2 = [$swim3, run3] { ai_run (12); };
- nonvirtual void() run3 = [$swim5, run4] { ai_run (12); };
- nonvirtual void() run4 = [$swim7, run5] { ai_run (12); };
- nonvirtual void() run5 = [$swim9, run6] { ai_run (12); };
- nonvirtual void() run6 = [$swim11, run7] { ai_run (12); };
- nonvirtual void() run7 = [$swim13, run8] { ai_run (12); };
- nonvirtual void() run8 = [$swim15, run9] { ai_run (12); };
- nonvirtual void() run9 = [$swim17, run1] { ai_run (12); };
+ void() fish_run2 = [$swim3, fish_run3] { ai_run (12); };
+ void() fish_run3 = [$swim5, fish_run4] { ai_run (12); };
+ void() fish_run4 = [$swim7, fish_run5] { ai_run (12); };
+ void() fish_run5 = [$swim9, fish_run6] { ai_run (12); };
+ void() fish_run6 = [$swim11, fish_run7] { ai_run (12); };
+ void() fish_run7 = [$swim13, fish_run8] { ai_run (12); };
+ void() fish_run8 = [$swim15, fish_run9] { ai_run (12); };
+ void() fish_run9 = [$swim17, fish_run1] { ai_run (12); };

//--------------------------------------------------------------
// Fish attack functions
//--------------------------------------------------------------
- nonvirtual void() attack1 = [$attack1, attack2] { ai_charge (10); };
- nonvirtual void() attack2 = [$attack2, attack3] { ai_charge (10); };
- nonvirtual void() attack3 = [$attack3, attack4] { this.melee (); };
- nonvirtual void() attack4 = [$attack4, attack5] { ai_charge (10); };
- nonvirtual void() attack5 = [$attack5, attack6] { ai_charge (10); };
- nonvirtual void() attack6 = [$attack6, attack7] { ai_charge (10); };
- nonvirtual void() attack7 = [$attack7, attack8] { ai_charge (10); };
- nonvirtual void() attack8 = [$attack8, attack9] { ai_charge (10); };
- nonvirtual void() attack9 = [$attack9, attack10] { this.melee (); };
- nonvirtual void() attack10 = [$attack10, attack11] { ai_charge (10); };
- nonvirtual void() attack11 = [$attack11, attack12] { ai_charge (10); };
- nonvirtual void() attack12 = [$attack12, attack13] { ai_charge (10); };
- nonvirtual void() attack13 = [$attack13, attack14] { ai_charge (10); };
- nonvirtual void() attack14 = [$attack14, attack15] { ai_charge (10); };
- nonvirtual void() attack15 = [$attack15, attack16] { this.melee (); };
- nonvirtual void() attack16 = [$attack16, attack17] { ai_charge (10); };
- nonvirtual void() attack17 = [$attack17, attack18] { ai_charge (10); };
- nonvirtual void() attack18 = [$attack18, run1] { ai_charge (10); };
+ void() fish_atk1 = [$attack1, fish_atk2] { ai_charge (10); };
+ void() fish_atk2 = [$attack2, fish_atk3] { ai_charge (10); };
+ void() fish_atk3 = [$attack3, fish_atk4]
+ {
+ monster_fish_attack_melee ();
+ };
+ void() fish_atk4 = [$attack4, fish_atk5] { ai_charge (10); };
+ void() fish_atk5 = [$attack5, fish_atk6] { ai_charge (10); };
+ void() fish_atk6 = [$attack6, fish_atk7] { ai_charge (10); };
+ void() fish_atk7 = [$attack7, fish_atk8] { ai_charge (10); };
+ void() fish_atk8 = [$attack8, fish_atk9] { ai_charge (10); };
+ void() fish_atk9 = [$attack9, fish_atk10]
+ {
+ monster_fish_attack_melee ();
+ };
+ void() fish_atk10 = [$attack10, fish_atk11] { ai_charge (10); };
+ void() fish_atk11 = [$attack11, fish_atk12] { ai_charge (10); };
+ void() fish_atk12 = [$attack12, fish_atk13] { ai_charge (10); };
+ void() fish_atk13 = [$attack13, fish_atk14] { ai_charge (10); };
+ void() fish_atk14 = [$attack14, fish_atk15] { ai_charge (10); };
+ void() fish_atk15 = [$attack15, fish_atk16]
+ {
+ monster_fish_attack_melee ();
+ };
+ void() fish_atk16 = [$attack16, fish_atk17] { ai_charge (10); };
+ void() fish_atk17 = [$attack17, fish_atk18] { ai_charge (10); };
+ void() fish_atk18 = [$attack18, fish_run1] { ai_charge (10); };

//--------------------------------------------------------------
// Fish pain states (please don't hurt the fish)
//--------------------------------------------------------------
- nonvirtual void() pain1 = [$pain1, pain2] { };
- nonvirtual void() pain2 = [$pain2, pain3] { ai_pain (6); };
- nonvirtual void() pain3 = [$pain3, pain4] { ai_pain (6); };
- nonvirtual void() pain4 = [$pain4, pain5] { ai_pain (6); };
- nonvirtual void() pain5 = [$pain5, pain6] { ai_pain (6); };
- nonvirtual void() pain6 = [$pain6, pain7] { ai_pain (6); };
- nonvirtual void() pain7 = [$pain7, pain8] { ai_pain (6); };
- nonvirtual void() pain8 = [$pain8, pain9] { ai_pain (6); };
- nonvirtual void() pain9 = [$pain9, run1] { ai_pain (6); };
+ void() fish_pain1 = [$pain1, fish_pain2] { };
+ void() fish_pain2 = [$pain2, fish_pain3] { ai_pain (6); };
+ void() fish_pain3 = [$pain3, fish_pain4] { ai_pain (6); };
+ void() fish_pain4 = [$pain4, fish_pain5] { ai_pain (6); };
+ void() fish_pain5 = [$pain5, fish_pain6] { ai_pain (6); };
+ void() fish_pain6 = [$pain6, fish_pain7] { ai_pain (6); };
+ void() fish_pain7 = [$pain7, fish_pain8] { ai_pain (6); };
+ void() fish_pain8 = [$pain8, fish_pain9] { ai_pain (6); };
+ void() fish_pain9 = [$pain9, fish_run1] { ai_pain (6); };

//--------------------------------------------------------------
// Fish death states (RIP fish)
//--------------------------------------------------------------
- nonvirtual void() death1 = [$death1, death2]
+ void() fish_death1 = [$death1, fish_death2]
{
- this.solid = SOLID_NOT;
- sound_death (this, CHAN_VOICE, "fish/death.wav", 1, ATTN_NORM);
+ self.solid = SOLID_NOT;
+ sound_death (self, CHAN_VOICE, "fish/death.wav", 1, ATTN_NORM);
};
- nonvirtual void() death2 = [$death2, death3] { };
- nonvirtual void() death3 = [$death3, death4] { };
- nonvirtual void() death4 = [$death4, death5] { };
- nonvirtual void() death5 = [$death5, death6] { };
- nonvirtual void() death6 = [$death6, death7] { };
- nonvirtual void() death7 = [$death7, death8] { };
- nonvirtual void() death8 = [$death8, death9] { };
- nonvirtual void() death9 = [$death9, death10] { };
- nonvirtual void() death10 = [$death10, death11] { };
- nonvirtual void() death11 = [$death11, death12] { };
- nonvirtual void() death12 = [$death12, death13] { };
- nonvirtual void() death13 = [$death13, death14] { };
- nonvirtual void() death14 = [$death14, death15] { };
- nonvirtual void() death15 = [$death15, death16] { };
- nonvirtual void() death16 = [$death16, death17] { };
- nonvirtual void() death17 = [$death17, death18] { };
- nonvirtual void() death18 = [$death18, death19] { };
- nonvirtual void() death19 = [$death19, death20] { };
- nonvirtual void() death20 = [$death20, death21] { };
- nonvirtual void() death21 = [$death21, death21] { };
+ void() fish_death2 = [$death2, fish_death3] { };
+ void() fish_death3 = [$death3, fish_death4] { };
+ void() fish_death4 = [$death4, fish_death5] { };
+ void() fish_death5 = [$death5, fish_death6] { };
+ void() fish_death6 = [$death6, fish_death7] { };
+ void() fish_death7 = [$death7, fish_death8] { };
+ void() fish_death8 = [$death8, fish_death9] { };
+ void() fish_death9 = [$death9, fish_death10] { };
+ void() fish_death10 = [$death10, fish_death11] { };
+ void() fish_death11 = [$death11, fish_death12] { };
+ void() fish_death12 = [$death12, fish_death13] { };
+ void() fish_death13 = [$death13, fish_death14] { };
+ void() fish_death14 = [$death14, fish_death15] { };
+ void() fish_death15 = [$death15, fish_death16] { };
+ void() fish_death16 = [$death16, fish_death17] { };
+ void() fish_death17 = [$death17, fish_death18] { };
+ void() fish_death18 = [$death18, fish_death19] { };
+ void() fish_death19 = [$death19, fish_death20] { };
+ void() fish_death20 = [$death20, fish_death21] { };
+ void() fish_death21 = [$death21, fish_death21] { };

//==============================================================
// Interaction
@@ -234,66 +287,56 @@ class monster_fish: base_swimmonster
//--------------------------------------------------------------
// fish_pain
//--------------------------------------------------------------
- virtual void(entity attacker, float damage) do_damage =
+ void(entity attacker, float damage) monster_fish_pain =
{
// fish always do pain frames
- this.pain1 ();
+ fish_pain1 ();
};

//--------------------------------------------------------------
// fish_die
//--------------------------------------------------------------
- virtual void() do_destroy =
+ void() monster_fish_destroy =
{
- if (this.health < -35)
+ if (self.health < -35)
{
// fish gibs -- dumptruck_ds
- sound (this, CHAN_VOICE, "player/udeath.wav",
+ sound (self, CHAN_VOICE, "player/udeath.wav",
1, ATTN_NORM);
- // ThrowGib ("progs/gib3.mdl", this.health);
- // ThrowGib ("progs/gib1.mdl", this.health);
- // ThrowGib ("progs/gib3.mdl", this.health);
+
+ // throw_gib ("progs/gib3.mdl", self.health);
+ // throw_gib ("progs/gib1.mdl", self.health);
+ // throw_gib ("progs/gib3.mdl", self.health);
+
// custom models -- dumptruck_ds
- if (this.mdl_gib1 != "")
- {
- ThrowGib (this.mdl_gib1, this.health);
- }
+ if (self.mdl_gib1 != "")
+ throw_gib (self.mdl_gib1, self.health);
else
- {
- ThrowGib ("progs/gib3.mdl", this.health);
- }
- if (this.mdl_gib2 != "")
- {
- ThrowGib (this.mdl_gib2, this.health);
- }
+ throw_gib ("progs/gib3.mdl", self.health);
+
+ if (self.mdl_gib2 != "")
+ throw_gib (self.mdl_gib2, self.health);
else
- {
- ThrowGib ("progs/gib3.mdl", this.health);
- }
- if (this.mdl_gib3 != "")
- {
- ThrowGib (this.mdl_gib3, this.health);
- }
+ throw_gib ("progs/gib3.mdl", self.health);
+
+ if (self.mdl_gib3 != "")
+ throw_gib (self.mdl_gib3, self.health);
else
- {
- ThrowGib ("progs/gib3.mdl", this.health);
- }
- if (this.mdl_head != "")
- {
- ThrowHead (this.mdl_head, this.health);
- }
+ throw_gib ("progs/gib3.mdl", self.health);
+
+ if (self.mdl_head != "")
+ throw_head (self.mdl_head, self.health);
else
- {
- ThrowHead ("progs/h_dog.mdl", this.health);
- }
- base_item::drop_stuff (this);
+ throw_head ("progs/h_dog.mdl", self.health);
+
+ base_item_drop_stuff (self);
sub_remove ();
}
- // regular death
else
{
- base_item::drop_stuff (this);
- this.death1 ();
+ // regular death
+ base_item_drop_stuff (self);
+ fish_death1 ();
}
};

@@ -302,60 +345,67 @@ class monster_fish: base_swimmonster
//==============================================================

//--------------------------------------------------------------
- virtual void() init_spawned =
+ void(entity e) monster_fish_init =
{
- if (this.spawnflags & I_AM_TURRET)
+ if (e.spawnflags & I_AM_TURRET)
objerror ("Incompatible spawnflag: TURRET_MODE\n");

if (deathmatch)
{
- remove (this);
+ remove (e);
return;
}

- precache_body_model2 ("progs/fish.mdl");
+ e.classname = "monster_fish";
+ e.classtype = CT_MONSTER_FISH;
+
+ precache_body_model2 (e, "progs/fish.mdl");
// precache_model2 ("progs/fish.mdl");

- precache_sound2_death ("fish/death.wav");
- precache_sound2_attack ("fish/bite.wav");
- precache_sound2_idle ("fish/idle.wav");
+ precache_sound2_death (e, "fish/death.wav");
+ precache_sound2_attack (e, "fish/bite.wav");
+ precache_sound2_idle (e, "fish/idle.wav");

- precache_gib1 ("progs/gib1.mdl");
- precache_gib2 ("progs/gib2.mdl");
- precache_gib3 ("progs/gib3.mdl");
+ precache_gib1 (e, "progs/gib1.mdl");
+ precache_gib2 (e, "progs/gib2.mdl");
+ precache_gib3 (e, "progs/gib3.mdl");

- this.solid = SOLID_SLIDEBOX;
- this.movetype = MOVETYPE_STEP;
+ e.solid = SOLID_SLIDEBOX;
+ e.movetype = MOVETYPE_STEP;

- body_model ("progs/fish.mdl");
- // setmodel (this, "progs/fish.mdl");
+ body_model (e, "progs/fish.mdl");
+ // setmodel (e, "progs/fish.mdl");

- setsize (this, '-16 -16 -24', '16 16 24');
+ setsize (e, '-16 -16 -24', '16 16 24');

- if (!this.health)
+ if (!e.health)
// thanks RennyC -- dumptruck_ds
- this.health = 25;
+ e.health = 25;

- this.think_stand = this.stand1;
- this.think_walk = this.walk1;
- this.think_run = this.run1;
- this.th_die = this.do_destroy;
+ e.think_stand = fish_stand1;
+ e.think_walk = fish_walk1;
+ e.think_run = fish_run1;
+ e.destroy = monster_fish_destroy;
// Berserk from
// http://celephais.net/board/view_thread.php?id=4&start=3465
// -- dumptruck_ds
- if !(this.berserk)
- this.th_pain = this.do_damage;
+ if !(e.berserk)
+ e.pain = monster_fish_pain;
else
- this.th_pain = sub_nullpain;
- this.think_melee = this.attack1;
+ e.pain = sub_nullpain;
+ e.think_melee = fish_atk1;

// swimmonster_start
- super::init_spawned ();
+ base_swimmonster_init (e);
};

//--------------------------------------------------------------
void() monster_fish =
{
- this.classtype = CT_MONSTER_FISH;
+ // new spawnflags for all entities -- iw
+ if (SUB_Inhibit())
+ return;
+
+ monster_fish_init (self);
};
-};
+// };

Return to the top of this page or return to the overview of this repo.

Diff qc/monsters/hknight.qc

diff --git a/qc/monsters/hknight.qc b/qc/monsters/hknight.qc
index bea364b..84102dd 100644
--- a/qc/monsters/hknight.qc
+++ b/qc/monsters/hknight.qc
@@ -2,9 +2,94 @@
// DEATH KNIGHT / HELL KNIGHT
//==============================================================================

+// hknight_type is now .animtype -- CEV
+
+//======================================================================
+// forward declarations
+//======================================================================
+
+// monster_hell_knight
+void() monster_hell_knight_sightsound; // AI & attacks
+void() monster_hell_knight_checkforcharge;
+void() monster_hell_knight_checkcontinuecharge;
+void() monster_hell_knight_attack_lightning;
+void() monster_hell_knight_attack_melee;
+void(float offset) monster_hell_knight_attack_shot;
+void() monster_hell_knight_idlesound;
+void() hkn_stand1; void() hkn_stand2; void() hkn_stand3; void() hkn_stand4;
+void() hkn_stand5; void() hkn_stand6; void() hkn_stand7; void() hkn_stand8;
+void() hkn_stand9;
+void() hkn_walk1; void() hkn_walk2; void() hkn_walk3; void() hkn_walk4;
+void() hkn_walk5; void() hkn_walk6; void() hkn_walk7; void() hkn_walk8;
+void() hkn_walk9; void() hkn_walk10; void() hkn_walk11; void() hkn_walk12;
+void() hkn_walk13; void() hkn_walk14; void() hkn_walk15; void() hkn_walk16;
+void() hkn_walk17; void() hkn_walk18; void() hkn_walk19; void() hkn_walk20;
+void() hkn_run1; void() hkn_run2; void() hkn_run3; void() hkn_run4;
+void() hkn_run5; void() hkn_run6; void() hkn_run7; void() hkn_run8;
+void() hkn_char_a1; void() hkn_char_a2; void() hkn_char_a3;
+void() hkn_char_a4; void() hkn_char_a5; void() hkn_char_a6;
+void() hkn_char_a7; void() hkn_char_a8; void() hkn_char_a9;
+void() hkn_char_a10; void() hkn_char_a11; void() hkn_char_a12;
+void() hkn_char_a13; void() hkn_char_a14; void() hkn_char_a15;
+void() hkn_char_a16;
+void() hkn_char_b1; void() hkn_char_b2; void() hkn_char_b3;
+void() hkn_char_b4; void() hkn_char_b5; void() hkn_char_b6;
+void() hkn_slice1; void() hkn_slice2; void() hkn_slice3; void() hkn_slice4;
+void() hkn_slice5; void() hkn_slice6; void() hkn_slice7; void() hkn_slice8;
+void() hkn_slice9; void() hkn_slice10;
+void() hkn_smash1; void() hkn_smash2; void() hkn_smash3; void() hkn_smash4;
+void() hkn_smash5; void() hkn_smash6; void() hkn_smash7; void() hkn_smash8;
+void() hkn_smash9; void() hkn_smash10; void() hkn_smash11;
+void() hkn_watk1; void() hkn_watk2; void() hkn_watk3; void() hkn_watk4;
+void() hkn_watk5; void() hkn_watk6; void() hkn_watk7; void() hkn_watk8;
+void() hkn_watk9; void() hkn_watk10; void() hkn_watk11; void() hkn_watk12;
+void() hkn_watk13; void() hkn_watk14; void() hkn_watk15; void() hkn_watk16;
+void() hkn_watk17; void() hkn_watk18; void() hkn_watk19; void() hkn_watk20;
+void() hkn_watk21; void() hkn_watk22;
+void() hkn_magica1; void() hkn_magica2; void() hkn_magica3; void() hkn_magica4;
+void() hkn_magica5; void() hkn_magica6; void() hkn_magica7; void() hkn_magica8;
+void() hkn_magica9; void() hkn_magica10; void() hkn_magica11;
+void() hkn_magica12; void() hkn_magica13; void() hkn_magica14;
+void() hkn_magicb1; void() hkn_magicb2; void() hkn_magicb3; void() hkn_magicb4;
+void() hkn_magicb5; void() hkn_magicb6; void() hkn_magicb7; void() hkn_magicb8;
+void() hkn_magicb9; void() hkn_magicb10; void() hkn_magicb11;
+void() hkn_magicb12; void() hkn_magicb13;
+void() hkn_magicc1; void() hkn_magicc2; void() hkn_magicc3; void() hkn_magicc4;
+void() hkn_magicc5; void() hkn_magicc6; void() hkn_magicc7; void() hkn_magicc8;
+void() hkn_magicc9; void() hkn_magicc10; void() hkn_magicc11;
+void() hkn_seek_stand1; void() hkn_seek_stand2; void() hkn_seek_stand3;
+void() hkn_seek_stand4; void() hkn_seek_stand5; void() hkn_seek_stand6;
+void() hkn_seek_stand7; void() hkn_seek_stand8; void() hkn_seek_stand9;
+void() hkn_tur_magb1; void() hkn_tur_magb2; void() hkn_tur_magb3;
+void() hkn_tur_magb4; void() hkn_tur_magb5; void() hkn_tur_magb6;
+void() hkn_tur_magb7; void() hkn_tur_magb8; void() hkn_tur_magb9;
+void() hkn_tur_magb10; void() hkn_tur_magb11; void() hkn_tur_magb12;
+void() hkn_tur_magb13;
+void() hkn_tur_magc1; void() hkn_tur_magc2; void() hkn_tur_magc3;
+void() hkn_tur_magc4; void() hkn_tur_magc5; void() hkn_tur_magc6;
+void() hkn_tur_magc7; void() hkn_tur_magc8; void() hkn_tur_magc9;
+void() hkn_tur_magc10; void() hkn_tur_magc11; void() hkn_tur_magc12;
+void() hkn_tur_magc13; void() hkn_tur_magc14; void() hkn_tur_magc15;
+void() hkn_pain1; void() hkn_pain2; void() hkn_pain3; void() hkn_pain4;
+void() hkn_pain5;
+void() hkn_die1; void() hkn_die2; void() hkn_die3; void() hkn_die4;
+void() hkn_die5; void() hkn_die6; void() hkn_die7; void() hkn_die8;
+void() hkn_die9; void() hkn_die10; void() hkn_die11; void() hkn_die12;
+void() hkn_dieb1; void() hkn_dieb2; void() hkn_dieb3; void() hkn_dieb4;
+void() hkn_dieb5; void() hkn_dieb6; void() hkn_dieb7; void() hkn_dieb8;
+void() hkn_dieb9;
+void(entity attacker, float damage) monster_hell_knight_pain; // interaction
+void() monster_hell_knight_destroy;
+void(entity e) monster_hell_knight_init;// initialization
+void() monster_hell_knight;
+
+// monster_dead_hell_knight
+void() monster_dead_hell_knight;
+
//======================================================================
// frame macros
//======================================================================
+
$cd id1/models/knight2
$origin 0 0 24
$base base
@@ -50,6 +135,8 @@ $frame w_attack21 w_attack22
$frame magicc1 magicc2 magicc3 magicc4 magicc5 magicc6 magicc7 magicc8
$frame magicc9 magicc10 magicc11

+//------------------------------------------------------------------------------
+
/*QUAKED monster_hell_knight (1 0 0) (-16 -16 -24) (16 16 40) AMBUSH X X TRIGGER_SPAWNED X X X X NOT_ON_EASY NOT_ON_NORMAL NOT_ON_HARD_OR_NIGHTMARE NOT_IN_DEATHMATCH NOT_IN_COOP NOT_IN_SINGLEPLAYER X NOT_ON_HARD_ONLY NOT_ON_NIGHTMARE_ONLY
{
model ("progs/hknight.mdl");
@@ -118,89 +205,84 @@ obit_method(string) : "When used with obit_name, will set part of the text for a
damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by this number (e.g. 4 = Quad damage)"

*/
-class monster_hell_knight: base_walkmonster
-{
- float hknight_type; // this used to be a global -- CEV
-
+//----------------------------------------------------------------------
+// class monster_hell_knight: base_walkmonster
+// {
//--------------------------------------------------------------
- virtual void() ai_sightsound =
+ void() monster_hell_knight_sightsound =
{
- sound_sight (this, CHAN_VOICE, "hknight/sight1.wav",
+ sound_sight (self, CHAN_VOICE, "hknight/sight1.wav",
1, ATTN_NORM);
};

//--------------------------------------------------------------
// CheckForCharge
//--------------------------------------------------------------
- nonvirtual void() check_for_charge =
+ void() monster_hell_knight_checkforcharge =
{
// check for mad charge
if (!enemy_vis)
return;
- if (time < this.attack_finished)
+ if (time < self.attack_finished)
return;
- if (fabs(this.origin_z - this.enemy.origin_z) > 20)
+ if (fabs(self.origin_z - self.enemy.origin_z) > 20)
// too much height change
return;
- if (vlen(this.origin - this.enemy.origin) < 80)
+ if (vlen(self.origin - self.enemy.origin) < 80)
// use regular attack
return;

// charge
sub_attackfinished (2);
- this.char_a1 ();
+ hkn_char_a1 ();
};

//--------------------------------------------------------------
// CheckContinueCharge
//--------------------------------------------------------------
- nonvirtual void() check_continue_charge =
+ void() monster_hell_knight_checkcontinuecharge =
{
- if (time > this.attack_finished)
+ if (time > self.attack_finished)
{
sub_attackfinished (3);
- this.run1 ();
+ hkn_run1 ();
// done charging
return;
}

if (random() > 0.5)
- sound (this, CHAN_WEAPON, "knight/sword2.wav",
+ sound (self, CHAN_WEAPON, "knight/sword2.wav",
1, ATTN_NORM);
else
- sound (this, CHAN_WEAPON, "knight/sword1.wav",
+ sound (self, CHAN_WEAPON, "knight/sword1.wav",
1, ATTN_NORM);
};

//--------------------------------------------------------------
// HellKnightLightning
//--------------------------------------------------------------
- nonvirtual void() attack_lightning =
+ void() monster_hell_knight_attack_lightning =
{
local vector org, dir;

- this.effects = this.effects | EF_MUZZLEFLASH;
- sound_attack(this, CHAN_WEAPON, "weapons/lstart.wav",
+ self.effects = self.effects | EF_MUZZLEFLASH;
+ sound_attack(self, CHAN_WEAPON, "weapons/lstart.wav",
1, ATTN_NORM);
ai_face ();
- makevectors (this.angles);
- org = this.origin + v_forward * 50 + '0 0 20';
+ makevectors (self.angles);
+ org = self.origin + v_forward * 50 + '0 0 20';

- dir = this.enemy.origin - this.enemy.velocity * 0.075;
+ dir = self.enemy.origin - self.enemy.velocity * 0.075;
dir = normalize (dir - org + '0 0 16');

- if (this.spawnflags & I_AM_TURRET)
- {
- traceline (org, this.origin + dir * 900, TRUE, this);
- }
+ if (self.spawnflags & I_AM_TURRET)
+ traceline (org, self.origin + dir * 900, TRUE, self);
else
- {
- traceline (org, this.origin + dir * 600, TRUE, this);
- }
+ traceline (org, self.origin + dir * 600, TRUE, self);

WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
WriteByte (MSG_BROADCAST, TE_LIGHTNING1);
- WriteEntity (MSG_BROADCAST, this);
+ WriteEntity (MSG_BROADCAST, self);
WriteCoord (MSG_BROADCAST, org_x);
WriteCoord (MSG_BROADCAST, org_y);
WriteCoord (MSG_BROADCAST, org_z);
@@ -208,193 +290,193 @@ class monster_hell_knight: base_walkmonster
WriteCoord (MSG_BROADCAST, trace_endpos_y);
WriteCoord (MSG_BROADCAST, trace_endpos_z);

- weapon_lightning::lightning_damage (org, trace_endpos, this, 20);
+ fire_lightning (org, trace_endpos, self, 20);
};

//--------------------------------------------------------------
// hknight_melee
//--------------------------------------------------------------
- nonvirtual void() attack_melee =
+ void() monster_hell_knight_attack_melee =
{
- this.hknight_type = this.hknight_type + 1;
+ self.animtype = self.animtype + 1;

- sound_misc (this, CHAN_WEAPON, "hknight/slash1.wav",
+ sound_misc (self, CHAN_WEAPON, "hknight/slash1.wav",
1, ATTN_NORM);
- if (this.hknight_type == 1)
+ if (self.animtype == 1)
{
- this.slice1 ();
+ hkn_slice1 ();
}
- else if (this.hknight_type == 2)
+ else if (self.animtype == 2)
{
- this.smash1 ();
+ hkn_smash1 ();
}
- else if (this.hknight_type == 3)
+ else if (self.animtype == 3)
{
- this.watk1 ();
- this.hknight_type = 0;
+ hkn_watk1 ();
+ self.animtype = 0;
}
};

//--------------------------------------------------------------
// hknight_shot
//--------------------------------------------------------------
- nonvirtual void(float offset) attack_shot =
+ void(float offset) monster_hell_knight_attack_shot =
{
local vector offang, org;

- offang = vectoangles (this.enemy.origin - this.origin);
+ offang = vectoangles (self.enemy.origin - self.origin);
offang_y = offang_y + offset * 6;

makevectors (offang);

- org = this.origin + this.mins + this.size * 0.5 +
+ org = self.origin + self.mins + self.size * 0.5 +
v_forward * 20;

- fire_hknightspell (org, v_forward, offset);
+ base_monster_fire_hknightspell (org, v_forward, offset);
};

//--------------------------------------------------------------
// hk_idle_sound
//--------------------------------------------------------------
- nonvirtual void() idle_sound =
+ void() monster_hell_knight_idlesound =
{
if (random() < 0.2)
- sound_idle (this, CHAN_VOICE, "hknight/idle.wav",
+ sound_idle (self, CHAN_VOICE, "hknight/idle.wav",
1, ATTN_NORM);
};

//--------------------------------------------------------------
// Death Knight Standing functions
//--------------------------------------------------------------
- nonvirtual void() stand1 = [$stand1, stand2] { ai_stand (); };
- nonvirtual void() stand2 = [$stand2, stand3] { ai_stand (); };
- nonvirtual void() stand3 = [$stand3, stand4] { ai_stand (); };
- nonvirtual void() stand4 = [$stand4, stand5] { ai_stand (); };
- nonvirtual void() stand5 = [$stand5, stand6] { ai_stand (); };
- nonvirtual void() stand6 = [$stand6, stand7] { ai_stand (); };
- nonvirtual void() stand7 = [$stand7, stand8] { ai_stand (); };
- nonvirtual void() stand8 = [$stand8, stand9] { ai_stand (); };
- nonvirtual void() stand9 = [$stand9, stand1] { ai_stand (); };
+ void() hkn_stand1 = [$stand1, hkn_stand2] { ai_stand (); };
+ void() hkn_stand2 = [$stand2, hkn_stand3] { ai_stand (); };
+ void() hkn_stand3 = [$stand3, hkn_stand4] { ai_stand (); };
+ void() hkn_stand4 = [$stand4, hkn_stand5] { ai_stand (); };
+ void() hkn_stand5 = [$stand5, hkn_stand6] { ai_stand (); };
+ void() hkn_stand6 = [$stand6, hkn_stand7] { ai_stand (); };
+ void() hkn_stand7 = [$stand7, hkn_stand8] { ai_stand (); };
+ void() hkn_stand8 = [$stand8, hkn_stand9] { ai_stand (); };
+ void() hkn_stand9 = [$stand9, hkn_stand1] { ai_stand (); };

//--------------------------------------------------------------
// Death Knight Walking functions
//--------------------------------------------------------------
- nonvirtual void() walk1 = [$walk1, walk2]
+ void() hkn_walk1 = [$walk1, hkn_walk2]
{
- this.idle_sound ();
+ monster_hell_knight_idlesound ();
ai_walk (2);
};
- nonvirtual void() walk2 = [$walk2, walk3] { ai_walk (5); };
- nonvirtual void() walk3 = [$walk3, walk4] { ai_walk (5); };
- nonvirtual void() walk4 = [$walk4, walk5] { ai_walk (4); };
- nonvirtual void() walk5 = [$walk5, walk6] { ai_walk (4); };
- nonvirtual void() walk6 = [$walk6, walk7] { ai_walk (2); };
- nonvirtual void() walk7 = [$walk7, walk8] { ai_walk (2); };
- nonvirtual void() walk8 = [$walk8, walk9] { ai_walk (3); };
- nonvirtual void() walk9 = [$walk9, walk10] { ai_walk (3); };
- nonvirtual void() walk10 = [$walk10, walk11] { ai_walk (4); };
- nonvirtual void() walk11 = [$walk11, walk12] { ai_walk (3); };
- nonvirtual void() walk12 = [$walk12, walk13] { ai_walk (4); };
- nonvirtual void() walk13 = [$walk13, walk14] { ai_walk (6); };
- nonvirtual void() walk14 = [$walk14, walk15] { ai_walk (2); };
- nonvirtual void() walk15 = [$walk15, walk16] { ai_walk (2); };
- nonvirtual void() walk16 = [$walk16, walk17] { ai_walk (4); };
- nonvirtual void() walk17 = [$walk17, walk18] { ai_walk (3); };
- nonvirtual void() walk18 = [$walk18, walk19] { ai_walk (3); };
- nonvirtual void() walk19 = [$walk19, walk20] { ai_walk (3); };
- nonvirtual void() walk20 = [$walk20, walk1] { ai_walk (2); };
+ void() hkn_walk2 = [$walk2, hkn_walk3] { ai_walk (5); };
+ void() hkn_walk3 = [$walk3, hkn_walk4] { ai_walk (5); };
+ void() hkn_walk4 = [$walk4, hkn_walk5] { ai_walk (4); };
+ void() hkn_walk5 = [$walk5, hkn_walk6] { ai_walk (4); };
+ void() hkn_walk6 = [$walk6, hkn_walk7] { ai_walk (2); };
+ void() hkn_walk7 = [$walk7, hkn_walk8] { ai_walk (2); };
+ void() hkn_walk8 = [$walk8, hkn_walk9] { ai_walk (3); };
+ void() hkn_walk9 = [$walk9, hkn_walk10] { ai_walk (3); };
+ void() hkn_walk10 = [$walk10, hkn_walk11] { ai_walk (4); };
+ void() hkn_walk11 = [$walk11, hkn_walk12] { ai_walk (3); };
+ void() hkn_walk12 = [$walk12, hkn_walk13] { ai_walk (4); };
+ void() hkn_walk13 = [$walk13, hkn_walk14] { ai_walk (6); };
+ void() hkn_walk14 = [$walk14, hkn_walk15] { ai_walk (2); };
+ void() hkn_walk15 = [$walk15, hkn_walk16] { ai_walk (2); };
+ void() hkn_walk16 = [$walk16, hkn_walk17] { ai_walk (4); };
+ void() hkn_walk17 = [$walk17, hkn_walk18] { ai_walk (3); };
+ void() hkn_walk18 = [$walk18, hkn_walk19] { ai_walk (3); };
+ void() hkn_walk19 = [$walk19, hkn_walk20] { ai_walk (3); };
+ void() hkn_walk20 = [$walk20, hkn_walk1] { ai_walk (2); };

//--------------------------------------------------------------
// Death Knight Running functions
//--------------------------------------------------------------
- nonvirtual void() run1 = [$run1, run2]
+ void() hkn_run1 = [$run1, hkn_run2]
{
- this.idle_sound ();
+ monster_hell_knight_idlesound ();
ai_run (20);
- this.check_for_charge ();
+ monster_hell_knight_checkforcharge ();
};
- nonvirtual void() run2 = [$run2, run3] { ai_run (25); };
- nonvirtual void() run3 = [$run3, run4] { ai_run (18); };
- nonvirtual void() run4 = [$run4, run5] { ai_run (16); };
- nonvirtual void() run5 = [$run5, run6] { ai_run (14); };
- nonvirtual void() run6 = [$run6, run7] { ai_run (25); };
- nonvirtual void() run7 = [$run7, run8] { ai_run (21); };
- nonvirtual void() run8 = [$run8, run1] { ai_run (13); };
+ void() hkn_run2 = [$run2, hkn_run3] { ai_run (25); };
+ void() hkn_run3 = [$run3, hkn_run4] { ai_run (18); };
+ void() hkn_run4 = [$run4, hkn_run5] { ai_run (16); };
+ void() hkn_run5 = [$run5, hkn_run6] { ai_run (14); };
+ void() hkn_run6 = [$run6, hkn_run7] { ai_run (25); };
+ void() hkn_run7 = [$run7, hkn_run8] { ai_run (21); };
+ void() hkn_run8 = [$run8, hkn_run1] { ai_run (13); };

//--------------------------------------------------------------
// Death Knight Charge A
//--------------------------------------------------------------
- nonvirtual void() char_a1 = [$char_a1, char_a2] { ai_charge (20); };
- nonvirtual void() char_a2 = [$char_a2, char_a3] { ai_charge (25); };
- nonvirtual void() char_a3 = [$char_a3, char_a4] { ai_charge (18); };
- nonvirtual void() char_a4 = [$char_a4, char_a5] { ai_charge (16); };
- nonvirtual void() char_a5 = [$char_a5, char_a6] { ai_charge (14); };
- nonvirtual void() char_a6 = [$char_a6, char_a7]
+ void() hkn_char_a1 = [$char_a1, hkn_char_a2] { ai_charge (20); };
+ void() hkn_char_a2 = [$char_a2, hkn_char_a3] { ai_charge (25); };
+ void() hkn_char_a3 = [$char_a3, hkn_char_a4] { ai_charge (18); };
+ void() hkn_char_a4 = [$char_a4, hkn_char_a5] { ai_charge (16); };
+ void() hkn_char_a5 = [$char_a5, hkn_char_a6] { ai_charge (14); };
+ void() hkn_char_a6 = [$char_a6, hkn_char_a7]
{
ai_charge (20);
ai_melee ();
};
- nonvirtual void() char_a7 = [$char_a7, char_a8]
+ void() hkn_char_a7 = [$char_a7, hkn_char_a8]
{
ai_charge (21);
ai_melee ();
};
- nonvirtual void() char_a8 = [$char_a8, char_a9]
+ void() hkn_char_a8 = [$char_a8, hkn_char_a9]
{
ai_charge (13);
ai_melee ();
};
- nonvirtual void() char_a9 = [$char_a9, char_a10]
+ void() hkn_char_a9 = [$char_a9, hkn_char_a10]
{
ai_charge (20);
ai_melee ();
};
- nonvirtual void() char_a10 = [$char_a10, char_a11]
+ void() hkn_char_a10 = [$char_a10, hkn_char_a11]
{
ai_charge (20);
ai_melee ();
};
- nonvirtual void() char_a11 = [$char_a11, char_a12]
+ void() hkn_char_a11 = [$char_a11, hkn_char_a12]
{
ai_charge (18);
ai_melee ();
};
- nonvirtual void() char_a12 = [$char_a12, char_a13] { ai_charge (16); };
- nonvirtual void() char_a13 = [$char_a13, char_a14] { ai_charge (14); };
- nonvirtual void() char_a14 = [$char_a14, char_a15] { ai_charge (25); };
- nonvirtual void() char_a15 = [$char_a15, char_a16] { ai_charge (21); };
- nonvirtual void() char_a16 = [$char_a16, run1] { ai_charge (13); };
+ void() hkn_char_a12 = [$char_a12, hkn_char_a13] { ai_charge (16); };
+ void() hkn_char_a13 = [$char_a13, hkn_char_a14] { ai_charge (14); };
+ void() hkn_char_a14 = [$char_a14, hkn_char_a15] { ai_charge (25); };
+ void() hkn_char_a15 = [$char_a15, hkn_char_a16] { ai_charge (21); };
+ void() hkn_char_a16 = [$char_a16, hkn_run1] { ai_charge (13); };

//--------------------------------------------------------------
// Death Knight Charge B
//--------------------------------------------------------------
- nonvirtual void() char_b1 = [$char_b1, char_b2]
+ void() hkn_char_b1 = [$char_b1, hkn_char_b2]
{
- this.check_continue_charge ();
+ monster_hell_knight_checkcontinuecharge ();
ai_charge (23);
ai_melee ();
};
- nonvirtual void() char_b2 = [$char_b2, char_b3]
+ void() hkn_char_b2 = [$char_b2, hkn_char_b3]
{
ai_charge (17);
ai_melee ();
};
- nonvirtual void() char_b3 = [$char_b3, char_b4]
+ void() hkn_char_b3 = [$char_b3, hkn_char_b4]
{
ai_charge (12);
ai_melee ();
};
- nonvirtual void() char_b4 = [$char_b4, char_b5]
+ void() hkn_char_b4 = [$char_b4, hkn_char_b5]
{
ai_charge (22);
ai_melee ();
};
- nonvirtual void() char_b5 = [$char_b5, char_b6]
+ void() hkn_char_b5 = [$char_b5, hkn_char_b6]
{
ai_charge (18);
ai_melee ();
};
- nonvirtual void() char_b6 = [$char_b6, char_b1]
+ void() hkn_char_b6 = [$char_b6, hkn_char_b1]
{
ai_charge (8);
ai_melee ();
@@ -403,173 +485,209 @@ class monster_hell_knight: base_walkmonster
//--------------------------------------------------------------
// Death Knight Slice Attack
//--------------------------------------------------------------
- nonvirtual void() slice1 = [$slice1, slice2] { ai_charge (9); };
- nonvirtual void() slice2 = [$slice2, slice3] { ai_charge (6); };
- nonvirtual void() slice3 = [$slice3, slice4] { ai_charge (13); };
- nonvirtual void() slice4 = [$slice4, slice5] { ai_charge (4); };
- nonvirtual void() slice5 = [$slice5, slice6]
+ void() hkn_slice1 = [$slice1, hkn_slice2] { ai_charge (9); };
+ void() hkn_slice2 = [$slice2, hkn_slice3] { ai_charge (6); };
+ void() hkn_slice3 = [$slice3, hkn_slice4] { ai_charge (13); };
+ void() hkn_slice4 = [$slice4, hkn_slice5] { ai_charge (4); };
+ void() hkn_slice5 = [$slice5, hkn_slice6]
{
ai_charge (7);
ai_melee ();
};
- nonvirtual void() slice6 = [$slice6, slice7]
+ void() hkn_slice6 = [$slice6, hkn_slice7]
{
ai_charge (15);
ai_melee ();
};
- nonvirtual void() slice7 = [$slice7, slice8]
+ void() hkn_slice7 = [$slice7, hkn_slice8]
{
ai_charge (8);
ai_melee ();
};
- nonvirtual void() slice8 = [$slice8, slice9]
+ void() hkn_slice8 = [$slice8, hkn_slice9]
{
ai_charge (2);
ai_melee ();
};
- nonvirtual void() slice9 = [$slice9, slice10] { ai_melee (); };
- nonvirtual void() slice10 = [$slice10, run1] { ai_charge (3); };
+ void() hkn_slice9 = [$slice9, hkn_slice10] { ai_melee (); };
+ void() hkn_slice10 = [$slice10, hkn_run1] { ai_charge (3); };

//--------------------------------------------------------------
// Death Knight Smash Attack
//--------------------------------------------------------------
- nonvirtual void() smash1 = [$smash1, smash2] { ai_charge (1); };
- nonvirtual void() smash2 = [$smash2, smash3] { ai_charge (13); };
- nonvirtual void() smash3 = [$smash3, smash4] { ai_charge (9); };
- nonvirtual void() smash4 = [$smash4, smash5] { ai_charge (11); };
- nonvirtual void() smash5 = [$smash5, smash6]
+ void() hkn_smash1 = [$smash1, hkn_smash2] { ai_charge (1); };
+ void() hkn_smash2 = [$smash2, hkn_smash3] { ai_charge (13); };
+ void() hkn_smash3 = [$smash3, hkn_smash4] { ai_charge (9); };
+ void() hkn_smash4 = [$smash4, hkn_smash5] { ai_charge (11); };
+ void() hkn_smash5 = [$smash5, hkn_smash6]
{
ai_charge (10);
ai_melee ();
};
- nonvirtual void() smash6 = [$smash6, smash7]
+ void() hkn_smash6 = [$smash6, hkn_smash7]
{
ai_charge (7);
ai_melee ();
};
- nonvirtual void() smash7 = [$smash7, smash8]
+ void() hkn_smash7 = [$smash7, hkn_smash8]
{
ai_charge (12);
ai_melee ();
};
- nonvirtual void() smash8 = [$smash8, smash9]
+ void() hkn_smash8 = [$smash8, hkn_smash9]
{
ai_charge (2);
ai_melee ();
};
- nonvirtual void() smash9 = [$smash9, smash10]
+ void() hkn_smash9 = [$smash9, hkn_smash10]
{
ai_charge (3);
ai_melee ();
};
- nonvirtual void() smash10 = [$smash10, smash11] { ai_charge (0); };
- nonvirtual void() smash11 = [$smash11, run1] { ai_charge (0); };
+ void() hkn_smash10 = [$smash10, hkn_smash11] { ai_charge (0); };
+ void() hkn_smash11 = [$smash11, hkn_run1] { ai_charge (0); };

//--------------------------------------------------------------
// Death Knight W (?) Attack
//--------------------------------------------------------------
- nonvirtual void() watk1 = [$w_attack1, watk2] { ai_charge (2); };
- nonvirtual void() watk2 = [$w_attack2, watk3] { ai_charge (0); };
- nonvirtual void() watk3 = [$w_attack3, watk4] { ai_charge (0); };
- nonvirtual void() watk4 = [$w_attack4, watk5] { ai_melee (); };
- nonvirtual void() watk5 = [$w_attack5, watk6] { ai_melee (); };
- nonvirtual void() watk6 = [$w_attack6, watk7] { ai_melee (); };
- nonvirtual void() watk7 = [$w_attack7, watk8] { ai_charge (1); };
- nonvirtual void() watk8 = [$w_attack8, watk9] { ai_charge (4); };
- nonvirtual void() watk9 = [$w_attack9, watk10] { ai_charge (5); };
- nonvirtual void() watk10 = [$w_attack10, watk11]
+ void() hkn_watk1 = [$w_attack1, hkn_watk2] { ai_charge (2); };
+ void() hkn_watk2 = [$w_attack2, hkn_watk3] { ai_charge (0); };
+ void() hkn_watk3 = [$w_attack3, hkn_watk4] { ai_charge (0); };
+ void() hkn_watk4 = [$w_attack4, hkn_watk5] { ai_melee (); };
+ void() hkn_watk5 = [$w_attack5, hkn_watk6] { ai_melee (); };
+ void() hkn_watk6 = [$w_attack6, hkn_watk7] { ai_melee (); };
+ void() hkn_watk7 = [$w_attack7, hkn_watk8] { ai_charge (1); };
+ void() hkn_watk8 = [$w_attack8, hkn_watk9] { ai_charge (4); };
+ void() hkn_watk9 = [$w_attack9, hkn_watk10] { ai_charge (5); };
+ void() hkn_watk10 = [$w_attack10, hkn_watk11]
{
ai_charge (3);
ai_melee ();
};
- nonvirtual void() watk11 = [$w_attack11, watk12]
+ void() hkn_watk11 = [$w_attack11, hkn_watk12]
{
ai_charge (2);
ai_melee ();
};
- nonvirtual void() watk12 = [$w_attack12, watk13]
+ void() hkn_watk12 = [$w_attack12, hkn_watk13]
{
ai_charge (2);
ai_melee ();
};
- nonvirtual void() watk13 = [$w_attack13, watk14] { ai_charge (0); };
- nonvirtual void() watk14 = [$w_attack14, watk15] { ai_charge (0); };
- nonvirtual void() watk15 = [$w_attack15, watk16] { ai_charge (0); };
- nonvirtual void() watk16 = [$w_attack16, watk17] { ai_charge (1); };
- nonvirtual void() watk17 = [$w_attack17, watk18]
+ void() hkn_watk13 = [$w_attack13, hkn_watk14] { ai_charge (0); };
+ void() hkn_watk14 = [$w_attack14, hkn_watk15] { ai_charge (0); };
+ void() hkn_watk15 = [$w_attack15, hkn_watk16] { ai_charge (0); };
+ void() hkn_watk16 = [$w_attack16, hkn_watk17] { ai_charge (1); };
+ void() hkn_watk17 = [$w_attack17, hkn_watk18]
{
ai_charge (1);
ai_melee ();
};
- nonvirtual void() watk18 = [$w_attack18, watk19]
+ void() hkn_watk18 = [$w_attack18, hkn_watk19]
{
ai_charge (3);
ai_melee ();
};
- nonvirtual void() watk19 = [$w_attack19, watk20]
+ void() hkn_watk19 = [$w_attack19, hkn_watk20]
{
ai_charge (4);
ai_melee ();
};
- nonvirtual void() watk20 = [$w_attack20, watk21] { ai_charge (6); };
- nonvirtual void() watk21 = [$w_attack21, watk22] { ai_charge (7); };
- nonvirtual void() watk22 = [$w_attack22, run1] { ai_charge (3); };
+ void() hkn_watk20 = [$w_attack20, hkn_watk21] { ai_charge (6); };
+ void() hkn_watk21 = [$w_attack21, hkn_watk22] { ai_charge (7); };
+ void() hkn_watk22 = [$w_attack22, hkn_run1] { ai_charge (3); };

//--------------------------------------------------------------
// Death Knight Magic A
//--------------------------------------------------------------
- nonvirtual void() magica1 = [$magica1, magica2] { ai_face (); };
- nonvirtual void() magica2 = [$magica2, magica3] { ai_face (); };
- nonvirtual void() magica3 = [$magica3, magica4] { ai_face (); };
- nonvirtual void() magica4 = [$magica4, magica5] { ai_face (); };
- nonvirtual void() magica5 = [$magica5, magica6] { ai_face (); };
- nonvirtual void() magica6 = [$magica6, magica7] { ai_face (); };
- nonvirtual void() magica7 = [$magica7, magica8] { attack_shot (-2); };
- nonvirtual void() magica8 = [$magica8, magica9] { attack_shot (-1); };
- nonvirtual void() magica9 = [$magica9, magica10] { attack_shot (0); };
- nonvirtual void() magica10 = [$magica10, magica11] { attack_shot(1);};
- nonvirtual void() magica11 = [$magica11, magica12] { attack_shot(2);};
- nonvirtual void() magica12 = [$magica12, magica13] { attack_shot(3);};
- nonvirtual void() magica13 = [$magica13, magica14] { ai_face (); };
- nonvirtual void() magica14 = [$magica14, run1] { ai_face (); };
+ void() hkn_magica1 = [$magica1, hkn_magica2] { ai_face (); };
+ void() hkn_magica2 = [$magica2, hkn_magica3] { ai_face (); };
+ void() hkn_magica3 = [$magica3, hkn_magica4] { ai_face (); };
+ void() hkn_magica4 = [$magica4, hkn_magica5] { ai_face (); };
+ void() hkn_magica5 = [$magica5, hkn_magica6] { ai_face (); };
+ void() hkn_magica6 = [$magica6, hkn_magica7] { ai_face (); };
+ void() hkn_magica7 = [$magica7, hkn_magica8]
+ {
+ monster_hell_knight_attack_shot (-2);
+ };
+ void() hkn_magica8 = [$magica8, hkn_magica9]
+ {
+ monster_hell_knight_attack_shot (-1);
+ };
+ void() hkn_magica9 = [$magica9, hkn_magica10]
+ {
+ monster_hell_knight_attack_shot (0);
+ };
+ void() hkn_magica10 = [$magica10, hkn_magica11]
+ {
+ monster_hell_knight_attack_shot (1);
+ };
+ void() hkn_magica11 = [$magica11, hkn_magica12]
+ {
+ monster_hell_knight_attack_shot (2);
+ };
+ void() hkn_magica12 = [$magica12, hkn_magica13]
+ {
+ monster_hell_knight_attack_shot (3);
+ };
+ void() hkn_magica13 = [$magica13, hkn_magica14] { ai_face (); };
+ void() hkn_magica14 = [$magica14, hkn_run1] { ai_face (); };

//--------------------------------------------------------------
// Death Knight Magic B
//--------------------------------------------------------------
- nonvirtual void() magicb1 = [$magicb1, magicb2] { ai_face (); };
- nonvirtual void() magicb2 = [$magicb2, magicb3] { ai_face (); };
- nonvirtual void() magicb3 = [$magicb3, magicb4] { ai_face (); };
- nonvirtual void() magicb4 = [$magicb4, magicb5] { ai_face (); };
- nonvirtual void() magicb5 = [$magicb5, magicb6] { ai_face (); };
- nonvirtual void() magicb6 = [$magicb6, magicb7] { ai_face (); };
- nonvirtual void() magicb7 = [$magicb7, magicb8] { ai_face (); };
- nonvirtual void() magicb8 = [$magicb8, magicb9] { ai_face (); };
- nonvirtual void() magicb9 = [$magicb9, magicb10] { ai_face (); };
- nonvirtual void() magicb10 = [$magicb10, magicb11]
+ void() hkn_magicb1 = [$magicb1, hkn_magicb2] { ai_face (); };
+ void() hkn_magicb2 = [$magicb2, hkn_magicb3] { ai_face (); };
+ void() hkn_magicb3 = [$magicb3, hkn_magicb4] { ai_face (); };
+ void() hkn_magicb4 = [$magicb4, hkn_magicb5] { ai_face (); };
+ void() hkn_magicb5 = [$magicb5, hkn_magicb6] { ai_face (); };
+ void() hkn_magicb6 = [$magicb6, hkn_magicb7] { ai_face (); };
+ void() hkn_magicb7 = [$magicb7, hkn_magicb8] { ai_face (); };
+ void() hkn_magicb8 = [$magicb8, hkn_magicb9] { ai_face (); };
+ void() hkn_magicb9 = [$magicb9, hkn_magicb10] { ai_face (); };
+ void() hkn_magicb10 = [$magicb10, hkn_magicb11]
{
ai_face ();
- sound_misc2 (this, CHAN_WEAPON, "shambler/sboom.wav",
+ sound_misc2 (self, CHAN_WEAPON, "shambler/sboom.wav",
1, ATTN_NORM);
- this.attack_lightning ();
+ monster_hell_knight_attack_lightning ();
};
- nonvirtual void() magicb11 = [$magicb11, magicb12] { ai_face (); };
- nonvirtual void() magicb12 = [$magicb12, magicb13] { ai_face (); };
- nonvirtual void() magicb13 = [$magicb13, run1] { ai_face (); };
+ void() hkn_magicb11 = [$magicb11, hkn_magicb12] { ai_face (); };
+ void() hkn_magicb12 = [$magicb12, hkn_magicb13] { ai_face (); };
+ void() hkn_magicb13 = [$magicb13, hkn_run1] { ai_face (); };

//--------------------------------------------------------------
// Death Knight Magic C
//--------------------------------------------------------------
- nonvirtual void() magicc1 = [$magicc1, magicc2] { ai_face (); };
- nonvirtual void() magicc2 = [$magicc2, magicc3] { ai_face (); };
- nonvirtual void() magicc3 = [$magicc3, magicc4] { ai_face (); };
- nonvirtual void() magicc4 = [$magicc4, magicc5] { ai_face (); };
- nonvirtual void() magicc5 = [$magicc5, magicc6] { ai_face (); };
- nonvirtual void() magicc6 = [$magicc6, magicc7] { attack_shot (-2); };
- nonvirtual void() magicc7 = [$magicc7, magicc8] { attack_shot (-1); };
- nonvirtual void() magicc8 = [$magicc8, magicc9] { attack_shot (0); };
- nonvirtual void() magicc9 = [$magicc9, magicc10] { attack_shot (1); };
- nonvirtual void() magicc10 = [$magicc10, magicc11] { attack_shot(2); };
- nonvirtual void() magicc11 = [$magicc11, run1] { attack_shot (3); };
+ void() hkn_magicc1 = [$magicc1, hkn_magicc2] { ai_face (); };
+ void() hkn_magicc2 = [$magicc2, hkn_magicc3] { ai_face (); };
+ void() hkn_magicc3 = [$magicc3, hkn_magicc4] { ai_face (); };
+ void() hkn_magicc4 = [$magicc4, hkn_magicc5] { ai_face (); };
+ void() hkn_magicc5 = [$magicc5, hkn_magicc6] { ai_face (); };
+ void() hkn_magicc6 = [$magicc6, hkn_magicc7]
+ {
+ monster_hell_knight_attack_shot (-2);
+ };
+ void() hkn_magicc7 = [$magicc7, hkn_magicc8]
+ {
+ monster_hell_knight_attack_shot (-1);
+ };
+ void() hkn_magicc8 = [$magicc8, hkn_magicc9]
+ {
+ monster_hell_knight_attack_shot (0);
+ };
+ void() hkn_magicc9 = [$magicc9, hkn_magicc10]
+ {
+ monster_hell_knight_attack_shot (1);
+ };
+ void() hkn_magicc10 = [$magicc10, hkn_magicc11]
+ {
+ monster_hell_knight_attack_shot(2);
+ };
+ void() hkn_magicc11 = [$magicc11, hkn_run1]
+ {
+ monster_hell_knight_attack_shot (3);
+ };

/////////////////////////////////////////////
////// turret frames START - revisions //////
@@ -578,57 +696,72 @@ class monster_hell_knight: base_walkmonster
//--------------------------------------------------------------
// Death Knight Seek / Standing Frames
//--------------------------------------------------------------
- nonvirtual void() seek_stand1 = [$stand1, seek_stand2] { ai_run (0); };
- nonvirtual void() seek_stand2 = [$stand2, seek_stand3] { ai_run (0); };
- nonvirtual void() seek_stand3 = [$stand3, seek_stand4] { ai_run (0); };
- nonvirtual void() seek_stand4 = [$stand4, seek_stand5] { ai_run (0); };
- nonvirtual void() seek_stand5 = [$stand5, seek_stand6] { ai_run (0); };
- nonvirtual void() seek_stand6 = [$stand6, seek_stand7] { ai_run (0); };
- nonvirtual void() seek_stand7 = [$stand7, seek_stand8] { ai_run (0); };
- nonvirtual void() seek_stand8 = [$stand8, seek_stand9] { ai_run (0); };
- nonvirtual void() seek_stand9 = [$stand9, seek_stand1] { ai_run (0); };
+ void() hkn_seek_stand1 = [$stand1, hkn_seek_stand2] { ai_run (0); };
+ void() hkn_seek_stand2 = [$stand2, hkn_seek_stand3] { ai_run (0); };
+ void() hkn_seek_stand3 = [$stand3, hkn_seek_stand4] { ai_run (0); };
+ void() hkn_seek_stand4 = [$stand4, hkn_seek_stand5] { ai_run (0); };
+ void() hkn_seek_stand5 = [$stand5, hkn_seek_stand6] { ai_run (0); };
+ void() hkn_seek_stand6 = [$stand6, hkn_seek_stand7] { ai_run (0); };
+ void() hkn_seek_stand7 = [$stand7, hkn_seek_stand8] { ai_run (0); };
+ void() hkn_seek_stand8 = [$stand8, hkn_seek_stand9] { ai_run (0); };
+ void() hkn_seek_stand9 = [$stand9, hkn_seek_stand1] { ai_run (0); };

//--------------------------------------------------------------
// Death Knight Turret Magic B (fnames shortened -- CEV)
//--------------------------------------------------------------
- nonvirtual void() t_magb1 = [$magicb1, t_magb2] { ai_face (); };
- nonvirtual void() t_magb2 = [$magicb2, t_magb3] { ai_face (); };
- nonvirtual void() t_magb3 = [$magicb3, t_magb4] { ai_face (); };
- nonvirtual void() t_magb4 = [$magicb4, t_magb5] { ai_face (); };
- nonvirtual void() t_magb5 = [$magicb5, t_magb6] { ai_face (); };
- nonvirtual void() t_magb6 = [$magicb6, t_magb7] { ai_face (); };
- nonvirtual void() t_magb7 = [$magicb7, t_magb8] { ai_face (); };
- nonvirtual void() t_magb8 = [$magicb8, t_magb9] { ai_face (); };
- nonvirtual void() t_magb9 = [$magicb9, t_magb10] { ai_face (); };
- nonvirtual void() t_magb10 = [$magicb10, t_magb11]
+ void() hkn_tur_magb1 = [$magicb1, hkn_tur_magb2] { ai_face (); };
+ void() hkn_tur_magb2 = [$magicb2, hkn_tur_magb3] { ai_face (); };
+ void() hkn_tur_magb3 = [$magicb3, hkn_tur_magb4] { ai_face (); };
+ void() hkn_tur_magb4 = [$magicb4, hkn_tur_magb5] { ai_face (); };
+ void() hkn_tur_magb5 = [$magicb5, hkn_tur_magb6] { ai_face (); };
+ void() hkn_tur_magb6 = [$magicb6, hkn_tur_magb7] { ai_face (); };
+ void() hkn_tur_magb7 = [$magicb7, hkn_tur_magb8] { ai_face (); };
+ void() hkn_tur_magb8 = [$magicb8, hkn_tur_magb9] { ai_face (); };
+ void() hkn_tur_magb9 = [$magicb9, hkn_tur_magb10] { ai_face (); };
+ void() hkn_tur_magb10 = [$magicb10, hkn_tur_magb11]
{
ai_face ();
- sound_misc2 (this, CHAN_WEAPON, "shambler/sboom.wav",
+ sound_misc2 (self, CHAN_WEAPON, "shambler/sboom.wav",
1, ATTN_NORM);
- this.attack_lightning ();
+ monster_hell_knight_attack_lightning ();
};
- nonvirtual void() t_magb11 = [$magicb11, t_magb12] { ai_face (); };
- nonvirtual void() t_magb12 = [$magicb12, t_magb13] { ai_face (); };
- nonvirtual void() t_magb13 = [$magicb13, seek_stand1] { ai_face (); };
+ void() hkn_tur_magb11 = [$magicb11, hkn_tur_magb12] { ai_face (); };
+ void() hkn_tur_magb12 = [$magicb12, hkn_tur_magb13] { ai_face (); };
+ void() hkn_tur_magb13 = [$magicb13, hkn_seek_stand1] { ai_face (); };

//--------------------------------------------------------------
// Death Knight Turret Magic C (fnames shortened -- CEV)
//--------------------------------------------------------------
- nonvirtual void() t_magc1 = [$magicc1, t_magc2] { ai_face (); };
- nonvirtual void() t_magc2 = [$magicc2, t_magc3] { ai_face (); };
- nonvirtual void() t_magc3 = [$magicc3, t_magc4] { ai_face (); };
- nonvirtual void() t_magc4 = [$magicc4, t_magc5] { ai_face (); };
- nonvirtual void() t_magc5 = [$magicc5, t_magc6] { ai_face (); };
- nonvirtual void() t_magc6 = [$magicc6, t_magc7] { attack_shot (-2); };
- nonvirtual void() t_magc7 = [$magicc7, t_magc8] { attack_shot (-1); };
- nonvirtual void() t_magc8 = [$magicc8, t_magc9] { attack_shot (0); };
- nonvirtual void() t_magc9 = [$magicc9, t_magc10] { attack_shot (1); };
- nonvirtual void() t_magc10 = [$magicc10, t_magc11] { attack_shot (2);};
- nonvirtual void() t_magc11 = [$magicc11, t_magc12] { ai_face (); };
- nonvirtual void() t_magc12 = [$stand1, t_magc13] { ai_face (); };
- nonvirtual void() t_magc13 = [$stand2, t_magc14] { ai_face (); };
- nonvirtual void() t_magc14 = [$stand3, t_magc15] { ai_face (); };
- nonvirtual void() t_magc15 = [$stand4, seek_stand1] { ai_run (0); };
+ void() hkn_tur_magc1 = [$magicc1, hkn_tur_magc2] { ai_face (); };
+ void() hkn_tur_magc2 = [$magicc2, hkn_tur_magc3] { ai_face (); };
+ void() hkn_tur_magc3 = [$magicc3, hkn_tur_magc4] { ai_face (); };
+ void() hkn_tur_magc4 = [$magicc4, hkn_tur_magc5] { ai_face (); };
+ void() hkn_tur_magc5 = [$magicc5, hkn_tur_magc6] { ai_face (); };
+ void() hkn_tur_magc6 = [$magicc6, hkn_tur_magc7]
+ {
+ monster_hell_knight_attack_shot (-2);
+ };
+ void() hkn_tur_magc7 = [$magicc7, hkn_tur_magc8]
+ {
+ monster_hell_knight_attack_shot (-1);
+ };
+ void() hkn_tur_magc8 = [$magicc8, hkn_tur_magc9]
+ {
+ monster_hell_knight_attack_shot (0);
+ };
+ void() hkn_tur_magc9 = [$magicc9, hkn_tur_magc10]
+ {
+ monster_hell_knight_attack_shot (1);
+ };
+ void() hkn_tur_magc10 = [$magicc10, hkn_tur_magc11]
+ {
+ monster_hell_knight_attack_shot (2);
+ };
+ void() hkn_tur_magc11 = [$magicc11, hkn_tur_magc12] { ai_face (); };
+ void() hkn_tur_magc12 = [$stand1, hkn_tur_magc13] { ai_face (); };
+ void() hkn_tur_magc13 = [$stand2, hkn_tur_magc14] { ai_face (); };
+ void() hkn_tur_magc14 = [$stand3, hkn_tur_magc15] { ai_face (); };
+ void() hkn_tur_magc15 = [$stand4, hkn_seek_stand1] { ai_run (0); };

/////////////////////////////////////////////
////// turret frames END //////
@@ -637,48 +770,48 @@ class monster_hell_knight: base_walkmonster
//--------------------------------------------------------------
// Death Knight pain state
//--------------------------------------------------------------
- nonvirtual void() pain1 = [$pain1, pain2]
+ void() hkn_pain1 = [$pain1, hkn_pain2]
{
- sound_pain (this, CHAN_VOICE, "hknight/pain1.wav",
+ sound_pain (self, CHAN_VOICE, "hknight/pain1.wav",
1, ATTN_NORM);
};
- nonvirtual void() pain2 = [$pain2, pain3] { };
- nonvirtual void() pain3 = [$pain3, pain4] { };
- nonvirtual void() pain4 = [$pain4, pain5] { };
- nonvirtual void() pain5 = [$pain5, run1] { };
+ void() hkn_pain2 = [$pain2, hkn_pain3] { };
+ void() hkn_pain3 = [$pain3, hkn_pain4] { };
+ void() hkn_pain4 = [$pain4, hkn_pain5] { };
+ void() hkn_pain5 = [$pain5, hkn_run1] { };

//--------------------------------------------------------------
// Death Knight death state A
//--------------------------------------------------------------
- nonvirtual void() die1 = [$death1, die2] { ai_forward (10); };
- nonvirtual void() die2 = [$death2, die3] { ai_forward (8); };
- nonvirtual void() die3 = [$death3, die4]
+ void() hkn_die1 = [$death1, hkn_die2] { ai_forward (10); };
+ void() hkn_die2 = [$death2, hkn_die3] { ai_forward (8); };
+ void() hkn_die3 = [$death3, hkn_die4]
{
- this.solid = SOLID_NOT;
+ self.solid = SOLID_NOT;
ai_forward (7);
};
- nonvirtual void() die4 = [$death4, die5] { };
- nonvirtual void() die5 = [$death5, die6] { };
- nonvirtual void() die6 = [$death6, die7] { };
- nonvirtual void() die7 = [$death7, die8] { };
- nonvirtual void() die8 = [$death8, die9] { ai_forward (10); };
- nonvirtual void() die9 = [$death9, die10] { ai_forward (11); };
- nonvirtual void() die10 = [$death10, die11] { };
- nonvirtual void() die11 = [$death11, die12] { };
- nonvirtual void() die12 = [$death12, die12] { };
+ void() hkn_die4 = [$death4, hkn_die5] { };
+ void() hkn_die5 = [$death5, hkn_die6] { };
+ void() hkn_die6 = [$death6, hkn_die7] { };
+ void() hkn_die7 = [$death7, hkn_die8] { };
+ void() hkn_die8 = [$death8, hkn_die9] { ai_forward (10); };
+ void() hkn_die9 = [$death9, hkn_die10] { ai_forward (11); };
+ void() hkn_die10 = [$death10, hkn_die11] { };
+ void() hkn_die11 = [$death11, hkn_die12] { };
+ void() hkn_die12 = [$death12, hkn_die12] { };

//--------------------------------------------------------------
// Death Knight death state B
//--------------------------------------------------------------
- nonvirtual void() dieb1 = [$deathb1, dieb2] { };
- nonvirtual void() dieb2 = [$deathb2, dieb3] { };
- nonvirtual void() dieb3 = [$deathb3, dieb4] { this.solid = SOLID_NOT; };
- nonvirtual void() dieb4 = [$deathb4, dieb5] { };
- nonvirtual void() dieb5 = [$deathb5, dieb6] { };
- nonvirtual void() dieb6 = [$deathb6, dieb7] { };
- nonvirtual void() dieb7 = [$deathb7, dieb8] { };
- nonvirtual void() dieb8 = [$deathb8, dieb9] { };
- nonvirtual void() dieb9 = [$deathb9, dieb9] { };
+ void() hkn_dieb1 = [$deathb1, hkn_dieb2] { };
+ void() hkn_dieb2 = [$deathb2, hkn_dieb3] { };
+ void() hkn_dieb3 = [$deathb3, hkn_dieb4] { self.solid = SOLID_NOT; };
+ void() hkn_dieb4 = [$deathb4, hkn_dieb5] { };
+ void() hkn_dieb5 = [$deathb5, hkn_dieb6] { };
+ void() hkn_dieb6 = [$deathb6, hkn_dieb7] { };
+ void() hkn_dieb7 = [$deathb7, hkn_dieb8] { };
+ void() hkn_dieb8 = [$deathb8, hkn_dieb9] { };
+ void() hkn_dieb9 = [$deathb9, hkn_dieb9] { };

//==============================================================
// Interaction
@@ -687,104 +820,93 @@ class monster_hell_knight: base_walkmonster
//--------------------------------------------------------------
// hknight_pain
//--------------------------------------------------------------
- virtual void(entity attacker, float damage) do_damage =
+ void(entity attacker, float damage) monster_hell_knight_pain =
{
local float r;

r = random ();

- if (this.pain_finished > time)
+ if (self.pain_finished > time)
return;

- if (this.spawnflags & I_AM_TURRET)
+ if (self.spawnflags & I_AM_TURRET)
{
if (r < 0.5)
{
- this.pain_finished = time + 1.5;
- sound_pain (this, CHAN_VOICE,
+ self.pain_finished = time + 1.5;
+ sound_pain (self, CHAN_VOICE,
"hknight/pain1.wav", 1, ATTN_NORM);
}
return;
}

- sound_pain (this, CHAN_VOICE, "hknight/pain1.wav",
+ sound_pain (self, CHAN_VOICE, "hknight/pain1.wav",
1, ATTN_NORM);

- if (time - this.pain_finished > 5)
+ if (time - self.pain_finished > 5)
{
// always go into pain frame if it has been a while
- this.pain1 ();
- this.pain_finished = time + 1;
+ hkn_pain1 ();
+ self.pain_finished = time + 1;
return;
}

- if ((random()*30 > damage))
+ if ((random() * 30 > damage))
// didn't flinch
return;

- this.pain_finished = time + 1;
- this.pain1 ();
+ self.pain_finished = time + 1;
+ hkn_pain1 ();
};

//--------------------------------------------------------------
// hknight_die
//--------------------------------------------------------------
- virtual void() do_destroy =
+ void() monster_hell_knight_destroy =
{
// check for gib
- if (this.health < -40)
+ if (self.health < -40)
{
- sound (this, CHAN_VOICE, "player/udeath.wav",
+ sound (self, CHAN_VOICE, "player/udeath.wav",
1, ATTN_NORM);
// dumptruck_ds custom_mdls
- if (this.mdl_head != "")
- {
- ThrowHead (this.mdl_head, this.health);
- }
+ if (self.mdl_head != "")
+ throw_head (self.mdl_head, self.health);
else
- {
- ThrowHead ("progs/h_hellkn.mdl", this.health);
- }
- // ThrowGib ("progs/gib1.mdl", this.health);
- // ThrowGib ("progs/gib2.mdl", this.health);
- // ThrowGib ("progs/gib3.mdl", this.health);
+ throw_head ("progs/h_hellkn.mdl", self.health);
+
+ // throw_gib ("progs/gib1.mdl", self.health);
+ // throw_gib ("progs/gib2.mdl", self.health);
+ // throw_gib ("progs/gib3.mdl", self.health);
+
// custom models -- dumptruck_ds
- if (this.mdl_gib1 != "")
- {
- ThrowGib (this.mdl_gib1, this.health);
- }
+ if (self.mdl_gib1 != "")
+ throw_gib (self.mdl_gib1, self.health);
else
- {
- ThrowGib ("progs/gib1.mdl", this.health);
- }
- if (this.mdl_gib2 != "")
- {
- ThrowGib (this.mdl_gib2, this.health);
- }
+ throw_gib ("progs/gib1.mdl", self.health);
+
+ if (self.mdl_gib2 != "")
+ throw_gib (self.mdl_gib2, self.health);
else
- {
- ThrowGib ("progs/gib2.mdl", this.health);
- }
- if (this.mdl_gib3 != "")
- {
- ThrowGib (this.mdl_gib3, this.health);
- }
+ throw_gib ("progs/gib2.mdl", self.health);
+
+ if (self.mdl_gib3 != "")
+ throw_gib (self.mdl_gib3, self.health);
else
- {
- ThrowGib ("progs/gib3.mdl", this.health);
- }
- base_item::drop_stuff (this);
+ throw_gib ("progs/gib3.mdl", self.health);
+
+ base_item_drop_stuff (self);
return;
}

// regular death
- sound_death (this, CHAN_VOICE, "hknight/death1.wav",
+ sound_death (self, CHAN_VOICE, "hknight/death1.wav",
1, ATTN_NORM);
- base_item::drop_stuff (this);
+ base_item_drop_stuff (self);
if (random() > 0.5)
- this.die1 ();
+ hkn_die1 ();
else
- this.dieb1 ();
+ hkn_dieb1 ();
};

//==============================================================
@@ -792,103 +914,105 @@ class monster_hell_knight: base_walkmonster
//==============================================================

//--------------------------------------------------------------
- virtual void() init_spawned =
+ void(entity e) monster_hell_knight_init =
{
if (deathmatch)
{
- remove (this);
+ remove (e);
return;
}

+ e.classname = "monster_hell_knight";
+ e.classtype = CT_MONSTER_DEATHKNIGHT;
+
precache_model2 ("progs/hknight.mdl");
precache_model2 ("progs/k_spike.mdl");
precache_model2 ("progs/k_spike2.mdl");
precache_model2 ("progs/h_hellkn.mdl");
// dumptruck_ds custom_mdls
- precache_body_model2 ("progs/hknight.mdl");
- precache_head_model2 ("progs/h_hellkn.mdl");
- precache_proj_model2 ("progs/k_spike.mdl");
+ precache_body_model2 (e, "progs/hknight.mdl");
+ precache_head_model2 (e, "progs/h_hellkn.mdl");
+ precache_proj_model2 (e, "progs/k_spike.mdl");
// this needed a unique name defined in custom_mdls.qc
// -- dumptruck_ds
- precache_exproj_model2 ("progs/k_spike2.mdl");
+ precache_exproj_model2 (e, "progs/k_spike2.mdl");
// dumptruck_ds

- precache_sound2_attack ("hknight/attack1.wav");
- precache_sound2_death ("hknight/death1.wav");
- precache_sound2_pain ("hknight/pain1.wav");
- precache_sound2_sight ("hknight/sight1.wav");
+ precache_sound2_attack (e, "hknight/attack1.wav");
+ precache_sound2_death (e, "hknight/death1.wav");
+ precache_sound2_pain (e, "hknight/pain1.wav");
+ precache_sound2_sight (e, "hknight/sight1.wav");
// used by C code, so don't sound2
precache_sound ("hknight/hit.wav");
- precache_sound2_misc ("hknight/slash1.wav");
- precache_sound2_idle ("hknight/idle.wav");
- // what??? never knew about this! -- dumptruck_ds
+ precache_sound2_misc (e, "hknight/slash1.wav");
+ precache_sound2_idle (e, "hknight/idle.wav");
+ // what??? never knew about e! -- dumptruck_ds
precache_sound2 ("hknight/grunt.wav");

precache_sound ("knight/sword1.wav");
precache_sound ("knight/sword2.wav");

- precache_gib1 ("progs/gib1.mdl");
- precache_gib2 ("progs/gib2.mdl");
- precache_gib3 ("progs/gib3.mdl");
+ precache_gib1 (e, "progs/gib1.mdl");
+ precache_gib2 (e, "progs/gib2.mdl");
+ precache_gib3 (e, "progs/gib3.mdl");

- this.solid = SOLID_SLIDEBOX;
- this.movetype = MOVETYPE_STEP;
+ e.solid = SOLID_SLIDEBOX;
+ e.movetype = MOVETYPE_STEP;

// custom_mdls dumptruck_ds
- body_model ("progs/hknight.mdl");
- // setmodel (this, "progs/hknight.mdl");
+ body_model (e, "progs/hknight.mdl");
+ // setmodel (e, "progs/hknight.mdl");

- setsize (this, '-16 -16 -24', '16 16 40');
+ setsize (e, '-16 -16 -24', '16 16 40');

// thanks RennyC -- dumptruck_ds
- if (!this.health)
- this.health = 250;
+ if (!e.health)
+ e.health = 250;

- if (!this.proj_speed_mod)
- {
- this.proj_speed_mod = 1;
- }
+ if (!e.proj_speed_mod)
+ e.proj_speed_mod = 1;

- this.think_stand = this.stand1;
- this.think_walk = this.walk1;
- if (this.spawnflags & I_AM_TURRET)
- {
- this.think_run = this.seek_stand1;
- }
+ e.sightsound = monster_hell_knight_sightsound;
+ e.think_stand = hkn_stand1;
+ e.think_walk = hkn_walk1;
+ if (e.spawnflags & I_AM_TURRET)
+ e.think_run = hkn_seek_stand1;
else
+ e.think_run = hkn_run1;
+ e.think_melee = monster_hell_knight_attack_melee;
+ if (e.style == 1)
{
- this.think_run = this.run1;
- }
- this.think_melee = this.attack_melee;
- if (this.style == 1)
- {
- this.think_missile = this.magicb1;
- this.think_turret = this.t_magb1;
+ e.think_missile = hkn_magicb1;
+ e.think_turret = hkn_tur_magb1;
}
else
{
- this.think_missile = this.magicc1;
- this.think_turret = this.t_magc1;
+ e.think_missile = hkn_magicc1;
+ e.think_turret = hkn_tur_magc1;
}
// Berserk test from
// http://celephais.net/board/view_thread.php?id=4&start=3465
// -- dumptruck_ds
- if !(this.berserk)
- this.th_pain = this.do_damage;
+ if !(e.berserk)
+ e.pain = monster_hell_knight_pain;
else
- this.th_pain = sub_nullpain;
- this.th_die = this.do_destroy;
+ e.pain = sub_nullpain;
+ e.destroy = monster_hell_knight_destroy;

// walkmonster_start
- super::init_spawned ();
+ base_walkmonster_init (e);
};

//--------------------------------------------------------------
void() monster_hell_knight =
{
- this.classtype = CT_MONSTER_DEATHKNIGHT;
+ // new spawnflags for all entities -- iw
+ if (SUB_Inhibit())
+ return;
+
+ monster_hell_knight_init (self);
};
-};
+// };

/* Scenic Dead Monster Patch stuff here from DeadStuff mod -- dumptruck_ds */

@@ -897,13 +1021,15 @@ class monster_hell_knight: base_walkmonster
model ({"path":"progs/hknight.mdl","frame":62});
}
*/
+//----------------------------------------------------------------------
void() monster_dead_hell_knight =
{
- if (SUB_Inhibit ()) // new spawnflags for all entities -- iw
+ // new spawnflags for all entities -- iw
+ if (SUB_Inhibit())
return;

- precache_model("progs/hknight.mdl");
- setmodel(self, "progs/hknight.mdl");
+ precache_model ("progs/hknight.mdl");
+ setmodel (self, "progs/hknight.mdl");
if (self.spawnflags & 2)
{
self.frame = $deathb9;
@@ -911,7 +1037,7 @@ void() monster_dead_hell_knight =
if (self.spawnflags & 1)
{
self.solid = SOLID_BBOX;
- setsize(self,'-68.96 -20.43 -53.98','34.8 21.15 30');
+ setsize (self,'-68.96 -20.43 -53.98','34.8 21.15 30');
}
else
{
@@ -924,7 +1050,7 @@ void() monster_dead_hell_knight =
if (self.spawnflags & 1)
{
self.solid = SOLID_BBOX;
- setsize(self,'-42.05 -31.07 -51.56','46.34 25.02 30');
+ setsize (self,'-42.05 -31.07 -51.56','46.34 25.02 30');
}
else
{

Return to the top of this page or return to the overview of this repo.

Diff qc/monsters/oldone.qc

diff --git a/qc/monsters/oldone.qc b/qc/monsters/oldone.qc
index f4b68b7..2c5a1eb 100644
--- a/qc/monsters/oldone.qc
+++ b/qc/monsters/oldone.qc
@@ -3,13 +3,42 @@
//==============================================================================

//======================================================================
-// globals
+// forward declarations
//======================================================================
-entity shub;
+
+// monster_oldone
+void() monster_oldone_finale1; // endgame
+void() monster_oldone_finale2;
+void() monster_oldone_finale3;
+void() monster_oldone_finale4;
+// void() old_stand; // animation & thinking
+void() old_idle1; void() old_idle2; void() old_idle3; void() old_idle4;
+void() old_idle5; void() old_idle6; void() old_idle7; void() old_idle8;
+void() old_idle9; void() old_idle10; void() old_idle11; void() old_idle12;
+void() old_idle13; void() old_idle14; void() old_idle15; void() old_idle16;
+void() old_idle17; void() old_idle18; void() old_idle19; void() old_idle20;
+void() old_idle21; void() old_idle22; void() old_idle23; void() old_idle24;
+void() old_idle25; void() old_idle26; void() old_idle27; void() old_idle28;
+void() old_idle29; void() old_idle30; void() old_idle31; void() old_idle32;
+void() old_idle33; void() old_idle34; void() old_idle35; void() old_idle36;
+void() old_idle37; void() old_idle38; void() old_idle39; void() old_idle40;
+void() old_idle41; void() old_idle42; void() old_idle43; void() old_idle44;
+void() old_idle45; void() old_idle46;
+void() old_thrash1; void() old_thrash2; void() old_thrash3; void() old_thrash4;
+void() old_thrash5; void() old_thrash6; void() old_thrash7; void() old_thrash8;
+void() old_thrash9; void() old_thrash10; void() old_thrash11;
+void() old_thrash12; void() old_thrash13; void() old_thrash14;
+void() old_thrash15; void() old_thrash16; void() old_thrash17;
+void() old_thrash18; void() old_thrash19; void() old_thrash20;
+void(entity attacker, float damage) monster_oldone_pain; // interaction
+void() monster_oldone_destroy;
+void(entity e) monster_oldone_init;
+void() monster_oldone;

//======================================================================
// frame macros
//======================================================================
+
$cd id1/models/old_one
$origin 0 0 24
$base base
@@ -26,12 +55,15 @@ $frame shake1 shake2 shake3 shake4 shake5 shake6 shake7 shake8
$frame shake9 shake10 shake11 shake12 shake13 shake14
$frame shake15 shake16 shake17 shake18 shake19 shake20

+//------------------------------------------------------------------------------
+
/*QUAKED monster_oldone (1 0 0) (-160 -128 -24) (160 128 256)
*/
-class monster_oldone: base_walkmonster
-{
+//----------------------------------------------------------------------
+// class monster_oldone: base_walkmonster
+// {
//--------------------------------------------------------------
- nonvirtual void() finale_1 =
+ void() monster_oldone_finale1 =
{
local entity pos, pl;
local entity timer;
@@ -44,13 +76,13 @@ class monster_oldone: base_walkmonster

// never allow exit
intermission_exittime = time + 10000000;
- intermission_running = 1;
+ intermission = 1;

// find the intermission spot
- pos = findfloat (world, ::classtype, CT_INFO_INTERMISSION);
+ pos = findfloat (world, classtype, CT_INFO_INTERMISSION);
if (!pos)
error ("no info_intermission");
- pl = findfloat (world, ::classtype, CT_MISC_TELEPORTTRAIN);
+ pl = findfloat (world, classtype, CT_MISC_TELEPORTTRAIN);
if (!pl)
error ("no teleporttrain");
remove (pl);
@@ -58,64 +90,68 @@ class monster_oldone: base_walkmonster
WriteByte (MSG_ALL, SVC_FINALE);
WriteString (MSG_ALL, "");

- pl = findfloat (world, ::classtype, CT_PLAYER);
+ pl = findfloat (world, classtype, CT_PLAYER);
while (pl != world)
{
pl.view_ofs = '0 0 0';
pl.angles = other.v_angle = pos.mangle;
// turn this way immediately
pl.fixangle = TRUE;
- pl.map = this.map;
+ pl.map = self.map;
pl.nextthink = time + 0.5;
pl.takedamage = DAMAGE_NO;
pl.solid = SOLID_NOT;
pl.movetype = MOVETYPE_NONE;
pl.modelindex = 0;
setorigin (pl, pos.origin);
- pl = findfloat (pl, ::classtype, CT_PLAYER);
+ pl = findfloat (pl, classtype, CT_PLAYER);
}

// make fake versions of all players as standins, and
// move the real players to the intermission spot

// wait for 1 second
- // TODO CEV rework into a class outside of moster_oldone
+ // TODO CEV rework into a class outside of moster_oldone?
timer = spawn ();
+ timer.enemy = self;
+ setorigin (timer, self.origin);
+ timer.think = monster_oldone_finale2;
timer.nextthink = time + 1;
- timer.think = finale_2;
};

//--------------------------------------------------------------
- nonvirtual void() finale_2 =
+ void() monster_oldone_finale2 =
{
local vector o;

// start a teleport splash inside shub

- o = shub.origin - '0 100 0';
+ o = self.origin - '0 100 0';
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
WriteByte (MSG_BROADCAST, TE_TELEPORT);
WriteCoord (MSG_BROADCAST, o_x);
WriteCoord (MSG_BROADCAST, o_y);
WriteCoord (MSG_BROADCAST, o_z);

- sound (shub, CHAN_VOICE, "misc/r_tele1.wav", 1, ATTN_NORM);
+ sound (self.enemy, CHAN_VOICE, "misc/r_tele1.wav",
+ 1, ATTN_NORM);

- this.nextthink = time + 2;
- this.think = finale_3;
+ self.nextthink = time + 2;
+ self.think = monster_oldone_finale3;
};

//--------------------------------------------------------------
- nonvirtual void() finale_3 =
+ void() monster_oldone_finale3 =
{
// start shub thrashing wildly
- shub.think = monster_oldone::thrash1;
- sound_death (shub, CHAN_VOICE, "boss2/death.wav", 1, ATTN_NORM);
+ self.enemy.think = old_thrash1;
+ sound_death (self.enemy, CHAN_VOICE, "boss2/death.wav",
+ 1, ATTN_NORM);
lightstyle (0, "abcdefghijklmlkjihgfedcb");
};

//--------------------------------------------------------------
- nonvirtual void() finale_4 =
+ void() monster_oldone_finale4 =
{
// throw tons of meat chunks
local vector oldo;
@@ -123,9 +159,9 @@ class monster_oldone: base_walkmonster
local float r;
local entity n;

- sound_misc (this, CHAN_VOICE, "boss2/pop2.wav", 1, ATTN_NORM);
+ sound_misc (self, CHAN_VOICE, "boss2/pop2.wav", 1, ATTN_NORM);

- oldo = this.origin;
+ oldo = self.origin;

z = 16;
while (z <= 144)
@@ -136,19 +172,19 @@ class monster_oldone: base_walkmonster
y = -64;
while (y <= 64)
{
- this.origin_x = oldo_x + x;
- this.origin_y = oldo_y + y;
- this.origin_z = oldo_z + z;
+ self.origin_x = oldo_x + x;
+ self.origin_y = oldo_y + y;
+ self.origin_z = oldo_z + z;

r = random ();
if (r < 0.3)
- ThrowGib ("progs/gib1.mdl",
+ throw_gib ("progs/gib1.mdl",
-999);
else if (r < 0.6)
- ThrowGib ("progs/gib2.mdl",
+ throw_gib ("progs/gib2.mdl",
-999);
else
- ThrowGib ("progs/gib3.mdl",
+ throw_gib ("progs/gib3.mdl",
-999);
y = y + 32;
}
@@ -180,105 +216,107 @@ class monster_oldone: base_walkmonster
WriteByte (MSG_ALL, 3);
lightstyle (0, "m");

- remove (this);
+ remove (self);
};

//--------------------------------------------------------------
// Shub Stand function
//--------------------------------------------------------------
- // nonvirtual void() stand = [$old1, stand] { };
+ // void() old_stand = [$old1, old_stand] { };

//--------------------------------------------------------------
// Shub Idle functions
//--------------------------------------------------------------
- nonvirtual void() idle1 = [$old1, idle2] { };
- nonvirtual void() idle2 = [$old2, idle3] { };
- nonvirtual void() idle3 = [$old3, idle4] { };
- nonvirtual void() idle4 = [$old4, idle5] { };
- nonvirtual void() idle5 = [$old5, idle6] { };
- nonvirtual void() idle6 = [$old6, idle7] { };
- nonvirtual void() idle7 = [$old7, idle8] { };
- nonvirtual void() idle8 = [$old8, idle9] { };
- nonvirtual void() idle9 = [$old9, idle10] { };
- nonvirtual void() idle10 = [$old10, idle11] { };
- nonvirtual void() idle11 = [$old11, idle12] { };
- nonvirtual void() idle12 = [$old12, idle13] { };
- nonvirtual void() idle13 = [$old13, idle14] { };
- nonvirtual void() idle14 = [$old14, idle15] { };
- nonvirtual void() idle15 = [$old15, idle16] { };
- nonvirtual void() idle16 = [$old16, idle17] { };
- nonvirtual void() idle17 = [$old17, idle18] { };
- nonvirtual void() idle18 = [$old18, idle19] { };
- nonvirtual void() idle19 = [$old19, idle20] { };
- nonvirtual void() idle20 = [$old20, idle21] { };
- nonvirtual void() idle21 = [$old21, idle22] { };
- nonvirtual void() idle22 = [$old22, idle23] { };
- nonvirtual void() idle23 = [$old23, idle24] { };
- nonvirtual void() idle24 = [$old24, idle25] { };
- nonvirtual void() idle25 = [$old25, idle26] { };
- nonvirtual void() idle26 = [$old26, idle27] { };
- nonvirtual void() idle27 = [$old27, idle28] { };
- nonvirtual void() idle28 = [$old28, idle29] { };
- nonvirtual void() idle29 = [$old29, idle30] { };
- nonvirtual void() idle30 = [$old30, idle31] { };
- nonvirtual void() idle31 = [$old31, idle32] { };
- nonvirtual void() idle32 = [$old32, idle33] { };
- nonvirtual void() idle33 = [$old33, idle34] { };
- nonvirtual void() idle34 = [$old34, idle35] { };
- nonvirtual void() idle35 = [$old35, idle36] { };
- nonvirtual void() idle36 = [$old36, idle37] { };
- nonvirtual void() idle37 = [$old37, idle38] { };
- nonvirtual void() idle38 = [$old38, idle39] { };
- nonvirtual void() idle39 = [$old39, idle40] { };
- nonvirtual void() idle40 = [$old40, idle41] { };
- nonvirtual void() idle41 = [$old41, idle42] { };
- nonvirtual void() idle42 = [$old42, idle43] { };
- nonvirtual void() idle43 = [$old43, idle44] { };
- nonvirtual void() idle44 = [$old44, idle45] { };
- nonvirtual void() idle45 = [$old45, idle46] { };
- nonvirtual void() idle46 = [$old46, idle1] { };
+ void() old_idle1 = [$old1, old_idle2] { };
+ void() old_idle2 = [$old2, old_idle3] { };
+ void() old_idle3 = [$old3, old_idle4] { };
+ void() old_idle4 = [$old4, old_idle5] { };
+ void() old_idle5 = [$old5, old_idle6] { };
+ void() old_idle6 = [$old6, old_idle7] { };
+ void() old_idle7 = [$old7, old_idle8] { };
+ void() old_idle8 = [$old8, old_idle9] { };
+ void() old_idle9 = [$old9, old_idle10] { };
+ void() old_idle10 = [$old10, old_idle11] { };
+ void() old_idle11 = [$old11, old_idle12] { };
+ void() old_idle12 = [$old12, old_idle13] { };
+ void() old_idle13 = [$old13, old_idle14] { };
+ void() old_idle14 = [$old14, old_idle15] { };
+ void() old_idle15 = [$old15, old_idle16] { };
+ void() old_idle16 = [$old16, old_idle17] { };
+ void() old_idle17 = [$old17, old_idle18] { };
+ void() old_idle18 = [$old18, old_idle19] { };
+ void() old_idle19 = [$old19, old_idle20] { };
+ void() old_idle20 = [$old20, old_idle21] { };
+ void() old_idle21 = [$old21, old_idle22] { };
+ void() old_idle22 = [$old22, old_idle23] { };
+ void() old_idle23 = [$old23, old_idle24] { };
+ void() old_idle24 = [$old24, old_idle25] { };
+ void() old_idle25 = [$old25, old_idle26] { };
+ void() old_idle26 = [$old26, old_idle27] { };
+ void() old_idle27 = [$old27, old_idle28] { };
+ void() old_idle28 = [$old28, old_idle29] { };
+ void() old_idle29 = [$old29, old_idle30] { };
+ void() old_idle30 = [$old30, old_idle31] { };
+ void() old_idle31 = [$old31, old_idle32] { };
+ void() old_idle32 = [$old32, old_idle33] { };
+ void() old_idle33 = [$old33, old_idle34] { };
+ void() old_idle34 = [$old34, old_idle35] { };
+ void() old_idle35 = [$old35, old_idle36] { };
+ void() old_idle36 = [$old36, old_idle37] { };
+ void() old_idle37 = [$old37, old_idle38] { };
+ void() old_idle38 = [$old38, old_idle39] { };
+ void() old_idle39 = [$old39, old_idle40] { };
+ void() old_idle40 = [$old40, old_idle41] { };
+ void() old_idle41 = [$old41, old_idle42] { };
+ void() old_idle42 = [$old42, old_idle43] { };
+ void() old_idle43 = [$old43, old_idle44] { };
+ void() old_idle44 = [$old44, old_idle45] { };
+ void() old_idle45 = [$old45, old_idle46] { };
+ void() old_idle46 = [$old46, old_idle1] { };

//--------------------------------------------------------------
// Shub Thrashing
//--------------------------------------------------------------
- nonvirtual void() thrash1 = [$shake1, thrash2] { lightstyle (0, "m"); };
- nonvirtual void() thrash2 = [$shake2, thrash3] { lightstyle (0, "k"); };
- nonvirtual void() thrash3 = [$shake3, thrash4] { lightstyle (0, "k"); };
- nonvirtual void() thrash4 = [$shake4, thrash5] { lightstyle (0, "i"); };
- nonvirtual void() thrash5 = [$shake5, thrash6] { lightstyle (0, "g"); };
- nonvirtual void() thrash6 = [$shake6, thrash7] { lightstyle (0, "e"); };
- nonvirtual void() thrash7 = [$shake7, thrash8] { lightstyle (0, "c"); };
- nonvirtual void() thrash8 = [$shake8, thrash9] { lightstyle (0, "a"); };
- nonvirtual void() thrash9 = [$shake9, thrash10] { lightstyle(0, "c"); };
- nonvirtual void() thrash10 = [$shake10, thrash11] {lightstyle(0, "e");};
- nonvirtual void() thrash11 = [$shake11, thrash12] {lightstyle(0, "g");};
- nonvirtual void() thrash12 = [$shake12, thrash13] {lightstyle(0, "i");};
- nonvirtual void() thrash13 = [$shake13, thrash14] {lightstyle(0, "k");};
- nonvirtual void() thrash14 = [$shake14, thrash15] {lightstyle(0, "m");};
- nonvirtual void() thrash15 = [$shake15, thrash16]
+ 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"); };
+ void() old_thrash4 = [$shake4, old_thrash5] { lightstyle (0, "i"); };
+ void() old_thrash5 = [$shake5, old_thrash6] { lightstyle (0, "g"); };
+ void() old_thrash6 = [$shake6, old_thrash7] { lightstyle (0, "e"); };
+ void() old_thrash7 = [$shake7, old_thrash8] { lightstyle (0, "c"); };
+ void() old_thrash8 = [$shake8, old_thrash9] { lightstyle (0, "a"); };
+ void() old_thrash9 = [$shake9, old_thrash10] { lightstyle (0, "c"); };
+ void() old_thrash10 = [$shake10, old_thrash11] { lightstyle (0, "e"); };
+ void() old_thrash11 = [$shake11, old_thrash12] { lightstyle (0, "g"); };
+ 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");
- this.cnt = this.cnt + 1;
- if (this.cnt != 3)
- this.think = this.thrash1;
+ 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"); };
+ void() old_thrash19 = [$shake19, old_thrash20] { lightstyle (0, "a"); };
+ void() old_thrash20 = [$shake20, old_thrash20]
+ {
+ monster_oldone_finale4 ();
};
- nonvirtual void() thrash16 = [$shake16, thrash17] {lightstyle(0, "g");};
- nonvirtual void() thrash17 = [$shake17, thrash18] {lightstyle(0, "c");};
- nonvirtual void() thrash18 = [$shake18, thrash19] {lightstyle(0, "b");};
- nonvirtual void() thrash19 = [$shake19, thrash20] {lightstyle(0, "a");};
- nonvirtual void() thrash20 = [$shake20, thrash20] { finale_4 (); };

//==============================================================
// Interaction
//==============================================================

-
//--------------------------------------------------------------
// nopain
//--------------------------------------------------------------
- virtual void(entity attacker, float damage) do_damage =
+ void(entity attacker, float damage) monster_oldone_pain =
{
- this.health = 40000;
+ self.health = 40000;
};

//--------------------------------------------------------------
@@ -291,16 +329,16 @@ class monster_oldone: base_walkmonster
// Deathmatch Dimension; Customised intermission message is
// handled in client.qc -- comment from DMD's QC source
//--------------------------------------------------------------
- virtual void() do_destroy =
+ void() monster_oldone_destroy =
{
- this.solid = SOLID_NOT;
+ self.solid = SOLID_NOT;
killed_monsters = killed_monsters + 1;
WriteByte (MSG_ALL, SVC_KILLEDMONSTER);

// Remove any teleporttrain in the map (will need one for
// vanilla progs to avoid error)
local entity tt;
- tt = findfloat (world, ::classtype, CT_MISC_TELEPORTTRAIN);
+ tt = findfloat (world, classtype, CT_MISC_TELEPORTTRAIN);
if (tt)
remove (tt);

@@ -310,9 +348,9 @@ class monster_oldone: base_walkmonster
local float r;
local float gibpow;

- sound (this, CHAN_VOICE, "boss2/pop2.wav", 1, ATTN_NORM);
+ sound (self, CHAN_VOICE, "boss2/pop2.wav", 1, ATTN_NORM);

- oldo = this.origin;
+ oldo = self.origin;
gibpow = -160;

z = 16;
@@ -324,19 +362,19 @@ class monster_oldone: base_walkmonster
y = -64;
while (y <= 64)
{
- this.origin_x = oldo_x + x;
- this.origin_y = oldo_y + y;
- this.origin_z = oldo_z + z;
+ self.origin_x = oldo_x + x;
+ self.origin_y = oldo_y + y;
+ self.origin_z = oldo_z + z;

r = random ();
if (r < 0.3)
- ThrowGib ("progs/gib1.mdl",
+ throw_gib ("progs/gib1.mdl",
gibpow);
else if (r < 0.6)
- ThrowGib ("progs/gib2.mdl",
+ throw_gib ("progs/gib2.mdl",
gibpow);
else
- ThrowGib ("progs/gib3.mdl",
+ throw_gib ("progs/gib3.mdl",
gibpow);
y = y + 32;
}
@@ -345,7 +383,7 @@ class monster_oldone: base_walkmonster
z = z + 96;
}

- remove (this);
+ remove (self);
};

//==============================================================
@@ -353,51 +391,62 @@ class monster_oldone: base_walkmonster
//==============================================================

//--------------------------------------------------------------
- virtual void() init_spawned =
+ void(entity e) monster_oldone_init =
{
- if (this.spawnflags & I_AM_TURRET)
+ if (e.spawnflags & I_AM_TURRET)
objerror ("Incompatible spawnflag: TURRET_MODE\n");

if (deathmatch)
{
- remove (this);
+ remove (e);
return;
}

- precache_body_model2 ("progs/oldone.mdl");
+ e.classname = "monster_oldone";
+ e.classtype = CT_MONSTER_BOSS_OLDONE;
+ e.classgroup |= CG_MONSTER;
+ e.touch = base_monster_touch;
+ base_mapentity_init (e);
+
+ precache_body_model2 (e, "progs/oldone.mdl");
// precache_model2 ("progs/oldone.mdl");

- precache_sound2_death ("boss2/death.wav");
+ precache_sound2_death (e, "boss2/death.wav");
// precache_sound2_idle ("boss2/idle.wav");
- precache_sound2_sight ("boss2/sight.wav");
- precache_sound2_misc ("boss2/pop2.wav");
+ precache_sound2_sight (e, "boss2/sight.wav");
+ // next line silences a compiler warning -- CEV
+ precache_sound2 ("boss2/pop2.wav");
+ precache_sound2_misc (e, "boss2/pop2.wav");

- this.solid = SOLID_SLIDEBOX;
- this.movetype = MOVETYPE_STEP;
+ e.solid = SOLID_SLIDEBOX;
+ e.movetype = MOVETYPE_STEP;

// custom_mdls dumptruck_ds
- body_model ("progs/oldone.mdl");
- // setmodel (this, "progs/oldone.mdl");
- setsize (this, '-160 -128 -24', '160 128 256');
+ body_model (e, "progs/oldone.mdl");
+ // setmodel (e, "progs/oldone.mdl");
+ setsize (e, '-160 -128 -24', '160 128 256');

// kill by telefrag
- this.health = 40000;
- this.takedamage = DAMAGE_YES;
- this.th_pain = this.do_damage;
- if (this.spawnflags & 2)
- this.th_die = this.do_destroy;
+ e.health = 40000;
+ e.takedamage = DAMAGE_YES;
+ e.pain = monster_oldone_pain;
+ if (e.spawnflags & 2)
+ e.destroy = monster_oldone_destroy;
else
- this.th_die = finale_1;
- shub = this;
+ e.destroy = monster_oldone_finale1;

total_monsters = total_monsters + 1;
- this.think = this.idle1;
- this.nextthink = time + 0.1;
+ e.think = old_idle1;
+ e.nextthink = time + 0.1;
};

//--------------------------------------------------------------
void() monster_oldone =
{
- this.classtype = CT_MONSTER_BOSS_OLDONE;
+ // new spawnflags for all entities -- iw
+ if (SUB_Inhibit())
+ return;
+
+ monster_oldone_init (self);
};
-};
+// };

Return to the top of this page or return to the overview of this repo.

Diff qc/monsters/oldone2.qc

diff --git a/qc/monsters/oldone2.qc b/qc/monsters/oldone2.qc
index f912547..4ccae12 100644
--- a/qc/monsters/oldone2.qc
+++ b/qc/monsters/oldone2.qc
@@ -3,8 +3,60 @@
//==============================================================================

//======================================================================
+// forward declarations
+//======================================================================
+
+// monster_oldone2
+void() monster_oldone2_sightsound; // AI, attacks, thinking, animation
+void(vector p) monster_oldone2_missile;
+void() monster_oldone2_face;
+// void() monster_oldone2_stand;
+void() old2_idle1; void() old2_idle2; void() old2_idle3; void() old2_idle4;
+void() old2_idle5; void() old2_idle6; void() old2_idle7; void() old2_idle8;
+void() old2_idle9; void() old2_idle10; void() old2_idle11;
+void() old2_idle12; void() old2_idle13; void() old2_idle14;
+void() old2_idle15; void() old2_idle16; void() old2_idle17;
+void() old2_idle18; void() old2_idle19; void() old2_idle20;
+void() old2_idle21; void() old2_idle22; void() old2_idle23;
+void() old2_idle24; void() old2_idle25; void() old2_idle26;
+void() old2_idle27; void() old2_idle28; void() old2_idle29;
+void() old2_idle30; void() old2_idle31; void() old2_idle32;
+void() old2_idle33; void() old2_idle34; void() old2_idle35;
+void() old2_idle36; void() old2_idle37; void() old2_idle38;
+void() old2_idle39; void() old2_idle40; void() old2_idle41;
+void() old2_idle42; void() old2_idle43; void() old2_idle44;
+void() old2_idle45; void() old2_idle46;
+void() old2_atk1; void() old2_atk2; void() old2_atk3; void() old2_atk4;
+void() old2_atk5; void() old2_atk6; void() old2_atk7; void() old2_atk8;
+void() old2_atk9; void() old2_atk10; void() old2_atk11; void() old2_atk12;
+void() old2_atk13; void() old2_atk14; void() old2_atk15; void() old2_atk16;
+void() old2_atk17; void() old2_atk18; void() old2_atk19; void() old2_atk20;
+void() old2_atk21; void() old2_atk22; void() old2_atk23; void() old2_atk24;
+void() old2_atk25; void() old2_atk26; void() old2_atk27; void() old2_atk28;
+void() old2_atk29; void() old2_atk30; void() old2_atk31; void() old2_atk32;
+void() old2_atk33; void() old2_atk34; void() old2_atk35; void() old2_atk36;
+void() old2_atk37; void() old2_atk38; void() old2_atk39; void() old2_atk40;
+void() old2_atk41; void() old2_atk42; void() old2_atk43; void() old2_atk44;
+void() old2_atk45; void() old2_atk46;
+void() old2_twitch1 void() old2_twitch2; void() old2_twitch3;
+void() old2_twitch4; void() old2_twitch5; void() old2_twitch6;
+void() old2_twitch7; void() old2_twitch8; void() old2_twitch9;
+void() old2_twitch10; void() old2_twitch11; void() old2_twitch12;
+void() old2_twitch13; void() old2_twitch14; void() old2_twitch15;
+void() old2_twitch16; void() old2_twitch17; void() old2_twitch18;
+void() old2_twitch19; void() old2_twitch20; void() old2_twitch21;
+void() old2_twitch22; void() old2_twitch23; void() old2_twitch24;
+void() old2_twitch25; void() old2_twitch26; void() old2_twitch27;
+void() old2_twitch28;
+void(entity attacker, float damage) monster_oldone2_pain; // interaction
+void() monster_oldone2_destroy;
+void(entity e) monster_oldone2_init; // initialization
+void() monster_oldone2;
+
+//======================================================================
// frame macros
//======================================================================
+
$cd id1/models/old2_one
$origin 0 0 24
$base base
@@ -21,209 +73,229 @@ $frame shake1 shake2 shake3 shake4 shake5 shake6 shake7 shake8
$frame shake9 shake10 shake11 shake12 shake13 shake14
$frame shake15 shake16 shake17 shake18 shake19 shake20

+//------------------------------------------------------------------------------
+
/*QUAKED monster_oldone2 (1 0 0) (-160 -128 -24) (160 128 256)
*/
-class monster_oldone2: base_walkmonster
-{
+//----------------------------------------------------------------------
+// class monster_oldone2: base_walkmonster
+// {
//--------------------------------------------------------------
- virtual void() ai_sightsound =
+ void() monster_oldone2_sightsound =
{
- sound_sight (this, CHAN_VOICE, "boss2/sight.wav", 1, ATTN_NORM);
+ sound_sight (self, CHAN_VOICE, "boss2/sight.wav", 1, ATTN_NORM);
};

//--------------------------------------------------------------
- nonvirtual void(vector p) shub_missile =
+ void(vector p) monster_oldone2_missile =
{
local vector org, d;
local float t;

- makevectors (vectoangles(this.enemy.origin - this.origin));
+ makevectors (vectoangles(self.enemy.origin - self.origin));

- org = this.origin + p_x * v_forward + p_y * v_right +
+ org = self.origin + p_x * v_forward + p_y * v_right +
p_z * '0 0 1';

// lead the player on hard mode
if (skill > 1)
{
- t = vlen(this.enemy.origin - org) / 300;
- d = this.enemy.velocity;
+ t = vlen(self.enemy.origin - org) / 300;
+ d = self.enemy.velocity;
d_z = 0;
- d = this.enemy.origin + t * d;
+ d = self.enemy.origin + t * d;
}
else
{
- d = this.enemy.origin;
+ d = self.enemy.origin;
}

// added this to motivate fireballs dumptruck_ds
- spawn (base_explosion, origin: org);
+ spawn_base_explosion (org);

// lavaball in your face!
- fire_lavaball (org, d - org, LAVABALL_SPEED);
+ base_monster_fire_lavaball (org, d - org, LAVABALL_SPEED);

- sound_attack (this, CHAN_WEAPON, "boss1/throw.wav",
+ sound_attack (self, CHAN_WEAPON, "boss1/throw.wav",
1, ATTN_NORM);

// check for dead enemy
- if (this.enemy.health <= 0)
- this.idle1 ();
+ if (self.enemy.health <= 0)
+ old2_idle1 ();
};

//--------------------------------------------------------------
- nonvirtual void() shub_face =
+ void() monster_oldone2_face =
{
// go for another player if multi player
- if (this.enemy.health <= 0 || random() < 0.02)
+ if (self.enemy.health <= 0 || random() < 0.02)
{
- this.enemy = findfloat (this.enemy, ::classtype,
+ self.enemy = findfloat (self.enemy, classtype,
CT_PLAYER);
- if (!this.enemy)
- this.enemy = findfloat (this.enemy, ::classtype,
+ if (!self.enemy)
+ self.enemy = findfloat (self.enemy, classtype,
CT_PLAYER);
}
ai_face ();
};

//--------------------------------------------------------------
- nonvirtual void() stand =
+ /*
+ void() monster_oldone2_stand =
{
ai_findtarget ();
};
+ */

//--------------------------------------------------------------
// Shub Idle functions
//--------------------------------------------------------------
- nonvirtual void() idle1 = [$old1, idle2] { stand (); };
- nonvirtual void() idle2 = [$old2, idle3] { stand (); };
- nonvirtual void() idle3 = [$old3, idle4] { stand (); };
- nonvirtual void() idle4 = [$old4, idle5] { stand (); };
- nonvirtual void() idle5 = [$old5, idle6] { stand (); };
- nonvirtual void() idle6 = [$old6, idle7] { stand (); };
- nonvirtual void() idle7 = [$old7, idle8] { stand (); };
- nonvirtual void() idle8 = [$old8, idle9] { stand (); };
- nonvirtual void() idle9 = [$old9, idle10] { stand (); };
- nonvirtual void() idle10 = [$old10, idle11] { stand (); };
- nonvirtual void() idle11 = [$old11, idle12] { stand (); };
- nonvirtual void() idle12 = [$old12, idle13] { stand (); };
- nonvirtual void() idle13 = [$old13, idle14] { stand (); };
- nonvirtual void() idle14 = [$old14, idle15] { stand (); };
- nonvirtual void() idle15 = [$old15, idle16] { stand (); };
- nonvirtual void() idle16 = [$old16, idle17] { stand (); };
- nonvirtual void() idle17 = [$old17, idle18] { stand (); };
- nonvirtual void() idle18 = [$old18, idle19] { stand (); };
- nonvirtual void() idle19 = [$old19, idle20] { stand (); };
- nonvirtual void() idle20 = [$old20, idle21] { stand (); };
- nonvirtual void() idle21 = [$old21, idle22] { stand (); };
- nonvirtual void() idle22 = [$old22, idle23] { stand (); };
- nonvirtual void() idle23 = [$old23, idle24] { stand (); };
- nonvirtual void() idle24 = [$old24, idle25] { stand (); };
- nonvirtual void() idle25 = [$old25, idle26] { stand (); };
- nonvirtual void() idle26 = [$old26, idle27] { stand (); };
- nonvirtual void() idle27 = [$old27, idle28] { stand (); };
- nonvirtual void() idle28 = [$old28, idle29] { stand (); };
- nonvirtual void() idle29 = [$old29, idle30] { stand (); };
- nonvirtual void() idle30 = [$old30, idle31] { stand (); };
- nonvirtual void() idle31 = [$old31, idle32] { stand (); };
- nonvirtual void() idle32 = [$old32, idle33] { stand (); };
- nonvirtual void() idle33 = [$old33, idle34] { stand (); };
- nonvirtual void() idle34 = [$old34, idle35] { stand (); };
- nonvirtual void() idle35 = [$old35, idle36] { stand (); };
- nonvirtual void() idle36 = [$old36, idle37] { stand (); };
- nonvirtual void() idle37 = [$old37, idle38] { stand (); };
- nonvirtual void() idle38 = [$old38, idle39] { stand (); };
- nonvirtual void() idle39 = [$old39, idle40] { stand (); };
- nonvirtual void() idle40 = [$old40, idle41] { stand (); };
- nonvirtual void() idle41 = [$old41, idle42] { stand (); };
- nonvirtual void() idle42 = [$old42, idle43] { stand (); };
- nonvirtual void() idle43 = [$old43, idle44] { stand (); };
- nonvirtual void() idle44 = [$old44, idle45] { stand (); };
- nonvirtual void() idle45 = [$old45, idle46] { stand (); };
- nonvirtual void() idle46 = [$old46, idle1] { stand (); };
+ void() old2_idle1 = [$old1, old2_idle2] { ai_findtarget (); };
+ void() old2_idle2 = [$old2, old2_idle3] { ai_findtarget (); };
+ void() old2_idle3 = [$old3, old2_idle4] { ai_findtarget (); };
+ void() old2_idle4 = [$old4, old2_idle5] { ai_findtarget (); };
+ void() old2_idle5 = [$old5, old2_idle6] { ai_findtarget (); };
+ void() old2_idle6 = [$old6, old2_idle7] { ai_findtarget (); };
+ void() old2_idle7 = [$old7, old2_idle8] { ai_findtarget (); };
+ void() old2_idle8 = [$old8, old2_idle9] { ai_findtarget (); };
+ void() old2_idle9 = [$old9, old2_idle10] { ai_findtarget (); };
+ void() old2_idle10 = [$old10, old2_idle11] { ai_findtarget (); };
+ void() old2_idle11 = [$old11, old2_idle12] { ai_findtarget (); };
+ void() old2_idle12 = [$old12, old2_idle13] { ai_findtarget (); };
+ void() old2_idle13 = [$old13, old2_idle14] { ai_findtarget (); };
+ void() old2_idle14 = [$old14, old2_idle15] { ai_findtarget (); };
+ void() old2_idle15 = [$old15, old2_idle16] { ai_findtarget (); };
+ void() old2_idle16 = [$old16, old2_idle17] { ai_findtarget (); };
+ void() old2_idle17 = [$old17, old2_idle18] { ai_findtarget (); };
+ void() old2_idle18 = [$old18, old2_idle19] { ai_findtarget (); };
+ void() old2_idle19 = [$old19, old2_idle20] { ai_findtarget (); };
+ void() old2_idle20 = [$old20, old2_idle21] { ai_findtarget (); };
+ void() old2_idle21 = [$old21, old2_idle22] { ai_findtarget (); };
+ void() old2_idle22 = [$old22, old2_idle23] { ai_findtarget (); };
+ void() old2_idle23 = [$old23, old2_idle24] { ai_findtarget (); };
+ void() old2_idle24 = [$old24, old2_idle25] { ai_findtarget (); };
+ void() old2_idle25 = [$old25, old2_idle26] { ai_findtarget (); };
+ void() old2_idle26 = [$old26, old2_idle27] { ai_findtarget (); };
+ void() old2_idle27 = [$old27, old2_idle28] { ai_findtarget (); };
+ void() old2_idle28 = [$old28, old2_idle29] { ai_findtarget (); };
+ void() old2_idle29 = [$old29, old2_idle30] { ai_findtarget (); };
+ void() old2_idle30 = [$old30, old2_idle31] { ai_findtarget (); };
+ void() old2_idle31 = [$old31, old2_idle32] { ai_findtarget (); };
+ void() old2_idle32 = [$old32, old2_idle33] { ai_findtarget (); };
+ void() old2_idle33 = [$old33, old2_idle34] { ai_findtarget (); };
+ void() old2_idle34 = [$old34, old2_idle35] { ai_findtarget (); };
+ void() old2_idle35 = [$old35, old2_idle36] { ai_findtarget (); };
+ void() old2_idle36 = [$old36, old2_idle37] { ai_findtarget (); };
+ void() old2_idle37 = [$old37, old2_idle38] { ai_findtarget (); };
+ void() old2_idle38 = [$old38, old2_idle39] { ai_findtarget (); };
+ void() old2_idle39 = [$old39, old2_idle40] { ai_findtarget (); };
+ void() old2_idle40 = [$old40, old2_idle41] { ai_findtarget (); };
+ void() old2_idle41 = [$old41, old2_idle42] { ai_findtarget (); };
+ void() old2_idle42 = [$old42, old2_idle43] { ai_findtarget (); };
+ void() old2_idle43 = [$old43, old2_idle44] { ai_findtarget (); };
+ void() old2_idle44 = [$old44, old2_idle45] { ai_findtarget (); };
+ void() old2_idle45 = [$old45, old2_idle46] { ai_findtarget (); };
+ void() old2_idle46 = [$old46, old2_idle1] { ai_findtarget (); };

//--------------------------------------------------------------
// Shub Attack!
//--------------------------------------------------------------
- nonvirtual void() atk1 = [$old1, atk2] { shub_face (); };
- nonvirtual void() atk2 = [$old2, atk3] { shub_face (); };
- nonvirtual void() atk3 = [$old3, atk4] { shub_face (); };
- nonvirtual void() atk4 = [$old4, atk5] { shub_face (); };
- nonvirtual void() atk5 = [$old5, atk6] { shub_face (); };
- nonvirtual void() atk6 = [$old6, atk7] { shub_face (); };
- nonvirtual void() atk7 = [$old7, atk8] { shub_face (); };
- nonvirtual void() atk8 = [$old8, atk9] { shub_face (); };
- nonvirtual void() atk9 = [$old9, atk10] { shub_missile ('0 -16 416'); };
- nonvirtual void() atk10 = [$old10, atk11] { shub_face (); };
- nonvirtual void() atk11 = [$old11, atk12] { shub_face (); };
- nonvirtual void() atk12 = [$old12, atk13] { shub_face (); };
- nonvirtual void() atk13 = [$old13, atk14] { shub_face (); };
- nonvirtual void() atk14 = [$old14, atk15] { shub_face (); };
- nonvirtual void() atk15 = [$old15, atk16] { shub_face (); };
- nonvirtual void() atk16 = [$old16, atk17] { shub_face (); };
- nonvirtual void() atk17 = [$old17, atk18] { shub_face (); };
- nonvirtual void() atk18 = [$old18, atk19] { shub_missile('0 -16 416');};
- nonvirtual void() atk19 = [$old19, atk20] { shub_face (); };
- nonvirtual void() atk20 = [$old20, atk21] { shub_face (); };
- nonvirtual void() atk21 = [$old21, atk22] { shub_face (); };
- nonvirtual void() atk22 = [$old22, atk23] { shub_face (); };
- nonvirtual void() atk23 = [$old23, atk24] { shub_face (); };
- nonvirtual void() atk24 = [$old24, atk25] { shub_face (); };
- nonvirtual void() atk25 = [$old25, atk26] { shub_face (); };
- nonvirtual void() atk26 = [$old26, atk27] { shub_face (); };
- nonvirtual void() atk27 = [$old27, atk28] { shub_missile('0 -16 416');};
- nonvirtual void() atk28 = [$old28, atk29] { shub_face (); };
- nonvirtual void() atk29 = [$old29, atk30] { shub_face (); };
- nonvirtual void() atk30 = [$old30, atk31] { shub_face (); };
- nonvirtual void() atk31 = [$old31, atk32] { shub_face (); };
- nonvirtual void() atk32 = [$old32, atk33] { shub_face (); };
- nonvirtual void() atk33 = [$old33, atk34] { shub_face (); };
- nonvirtual void() atk34 = [$old34, atk35] { shub_face (); };
- nonvirtual void() atk35 = [$old35, atk36] { shub_face (); };
- nonvirtual void() atk36 = [$old36, atk37] { shub_missile('0 -16 416');};
- nonvirtual void() atk37 = [$old37, atk38] { shub_face (); };
- nonvirtual void() atk38 = [$old38, atk39] { shub_face (); };
- nonvirtual void() atk39 = [$old39, atk40] { shub_face (); };
- nonvirtual void() atk40 = [$old40, atk41] { shub_face (); };
- nonvirtual void() atk41 = [$old41, atk42] { shub_face (); };
- nonvirtual void() atk42 = [$old42, atk43] { shub_face (); };
- nonvirtual void() atk43 = [$old43, atk44] { shub_face (); };
- nonvirtual void() atk44 = [$old44, atk45] { shub_face (); };
- nonvirtual void() atk45 = [$old45, atk46] { shub_missile('0 -16 416');};
- nonvirtual void() atk46 = [$old46, atk1] { shub_face (); };
+ void() old2_atk1 = [$old1, old2_atk2] { monster_oldone2_face (); };
+ void() old2_atk2 = [$old2, old2_atk3] { monster_oldone2_face (); };
+ void() old2_atk3 = [$old3, old2_atk4] { monster_oldone2_face (); };
+ void() old2_atk4 = [$old4, old2_atk5] { monster_oldone2_face (); };
+ void() old2_atk5 = [$old5, old2_atk6] { monster_oldone2_face (); };
+ void() old2_atk6 = [$old6, old2_atk7] { monster_oldone2_face (); };
+ void() old2_atk7 = [$old7, old2_atk8] { monster_oldone2_face (); };
+ void() old2_atk8 = [$old8, old2_atk9] { monster_oldone2_face (); };
+ void() old2_atk9 = [$old9, old2_atk10]
+ {
+ monster_oldone2_missile ('0 -16 416');
+ };
+ void() old2_atk10 = [$old10, old2_atk11] { monster_oldone2_face (); };
+ void() old2_atk11 = [$old11, old2_atk12] { monster_oldone2_face (); };
+ void() old2_atk12 = [$old12, old2_atk13] { monster_oldone2_face (); };
+ void() old2_atk13 = [$old13, old2_atk14] { monster_oldone2_face (); };
+ void() old2_atk14 = [$old14, old2_atk15] { monster_oldone2_face (); };
+ void() old2_atk15 = [$old15, old2_atk16] { monster_oldone2_face (); };
+ void() old2_atk16 = [$old16, old2_atk17] { monster_oldone2_face (); };
+ void() old2_atk17 = [$old17, old2_atk18] { monster_oldone2_face (); };
+ void() old2_atk18 = [$old18, old2_atk19]
+ {
+ monster_oldone2_missile ('0 -16 416');
+ };
+ void() old2_atk19 = [$old19, old2_atk20] { monster_oldone2_face (); };
+ void() old2_atk20 = [$old20, old2_atk21] { monster_oldone2_face (); };
+ void() old2_atk21 = [$old21, old2_atk22] { monster_oldone2_face (); };
+ void() old2_atk22 = [$old22, old2_atk23] { monster_oldone2_face (); };
+ void() old2_atk23 = [$old23, old2_atk24] { monster_oldone2_face (); };
+ void() old2_atk24 = [$old24, old2_atk25] { monster_oldone2_face (); };
+ void() old2_atk25 = [$old25, old2_atk26] { monster_oldone2_face (); };
+ void() old2_atk26 = [$old26, old2_atk27] { monster_oldone2_face (); };
+ void() old2_atk27 = [$old27, old2_atk28]
+ {
+ monster_oldone2_missile ('0 -16 416');
+ };
+ void() old2_atk28 = [$old28, old2_atk29] { monster_oldone2_face (); };
+ void() old2_atk29 = [$old29, old2_atk30] { monster_oldone2_face (); };
+ void() old2_atk30 = [$old30, old2_atk31] { monster_oldone2_face (); };
+ void() old2_atk31 = [$old31, old2_atk32] { monster_oldone2_face (); };
+ void() old2_atk32 = [$old32, old2_atk33] { monster_oldone2_face (); };
+ void() old2_atk33 = [$old33, old2_atk34] { monster_oldone2_face (); };
+ void() old2_atk34 = [$old34, old2_atk35] { monster_oldone2_face (); };
+ void() old2_atk35 = [$old35, old2_atk36] { monster_oldone2_face (); };
+ void() old2_atk36 = [$old36, old2_atk37]
+ {
+ monster_oldone2_missile ('0 -16 416');
+ };
+ void() old2_atk37 = [$old37, old2_atk38] { monster_oldone2_face (); };
+ void() old2_atk38 = [$old38, old2_atk39] { monster_oldone2_face (); };
+ void() old2_atk39 = [$old39, old2_atk40] { monster_oldone2_face (); };
+ void() old2_atk40 = [$old40, old2_atk41] { monster_oldone2_face (); };
+ void() old2_atk41 = [$old41, old2_atk42] { monster_oldone2_face (); };
+ void() old2_atk42 = [$old42, old2_atk43] { monster_oldone2_face (); };
+ void() old2_atk43 = [$old43, old2_atk44] { monster_oldone2_face (); };
+ void() old2_atk44 = [$old44, old2_atk45] { monster_oldone2_face (); };
+ void() old2_atk45 = [$old45, old2_atk46]
+ {
+ monster_oldone2_missile ('0 -16 416');
+ };
+ void() old2_atk46 = [$old46, old2_atk1] { monster_oldone2_face (); };

//--------------------------------------------------------------
// Shub Twitch -- death twitch -- dumptruck_ds
//--------------------------------------------------------------
- nonvirtual void() twitch1 = [$shake1, twitch2]
+ void() old2_twitch1 = [$shake1, old2_twitch2]
{
- sound_misc (this, CHAN_VOICE, "boss2/pop2.wav", 1, ATTN_NONE);
+ sound_misc (self, CHAN_VOICE, "boss2/pop2.wav", 1, ATTN_NONE);
};
- nonvirtual void() twitch2 = [$shake2, twitch3] { };
- nonvirtual void() twitch3 = [$shake3, twitch4] { };
- nonvirtual void() twitch4 = [$shake4, twitch5] { };
- nonvirtual void() twitch5 = [$shake5, twitch6] { };
- nonvirtual void() twitch6 = [$shake6, twitch7] { };
- nonvirtual void() twitch7 = [$shake7, twitch8] { };
- nonvirtual void() twitch8 = [$shake8, twitch9] { };
- nonvirtual void() twitch9 = [$shake9, twitch10] { };
- nonvirtual void() twitch10 = [$shake10, twitch11] { };
- nonvirtual void() twitch11 = [$shake11, twitch12] { };
- nonvirtual void() twitch12 = [$shake12, twitch13] { };
- nonvirtual void() twitch13 = [$shake13, twitch14] { };
- nonvirtual void() twitch14 = [$shake14, twitch15] { };
- nonvirtual void() twitch15 = [$shake15, twitch16] { };
- nonvirtual void() twitch16 = [$shake16, twitch17] { };
- nonvirtual void() twitch17 = [$shake17, twitch18] { };
- nonvirtual void() twitch18 = [$shake18, twitch19] { };
- nonvirtual void() twitch19 = [$shake19, twitch20] { };
- nonvirtual void() twitch20 = [$shake20, twitch21] { };
- nonvirtual void() twitch21 = [$shake17, twitch22] { };
- nonvirtual void() twitch22 = [$shake18, twitch23] { };
- nonvirtual void() twitch23 = [$shake19, twitch24] { };
- nonvirtual void() twitch24 = [$shake20, twitch25] { };
- nonvirtual void() twitch25 = [$shake17, twitch26] { };
- nonvirtual void() twitch26 = [$shake18, twitch27] { };
- nonvirtual void() twitch27 = [$shake19, twitch28] { };
- nonvirtual void() twitch28 = [$shake20, this.do_destroy] { };
+ void() old2_twitch2 = [$shake2, old2_twitch3] { };
+ void() old2_twitch3 = [$shake3, old2_twitch4] { };
+ void() old2_twitch4 = [$shake4, old2_twitch5] { };
+ void() old2_twitch5 = [$shake5, old2_twitch6] { };
+ void() old2_twitch6 = [$shake6, old2_twitch7] { };
+ void() old2_twitch7 = [$shake7, old2_twitch8] { };
+ void() old2_twitch8 = [$shake8, old2_twitch9] { };
+ void() old2_twitch9 = [$shake9, old2_twitch10] { };
+ void() old2_twitch10 = [$shake10, old2_twitch11] { };
+ void() old2_twitch11 = [$shake11, old2_twitch12] { };
+ void() old2_twitch12 = [$shake12, old2_twitch13] { };
+ void() old2_twitch13 = [$shake13, old2_twitch14] { };
+ void() old2_twitch14 = [$shake14, old2_twitch15] { };
+ void() old2_twitch15 = [$shake15, old2_twitch16] { };
+ void() old2_twitch16 = [$shake16, old2_twitch17] { };
+ void() old2_twitch17 = [$shake17, old2_twitch18] { };
+ void() old2_twitch18 = [$shake18, old2_twitch19] { };
+ void() old2_twitch19 = [$shake19, old2_twitch20] { };
+ void() old2_twitch20 = [$shake20, old2_twitch21] { };
+ void() old2_twitch21 = [$shake17, old2_twitch22] { };
+ void() old2_twitch22 = [$shake18, old2_twitch23] { };
+ void() old2_twitch23 = [$shake19, old2_twitch24] { };
+ void() old2_twitch24 = [$shake20, old2_twitch25] { };
+ void() old2_twitch25 = [$shake17, old2_twitch26] { };
+ void() old2_twitch26 = [$shake18, old2_twitch27] { };
+ void() old2_twitch27 = [$shake19, old2_twitch28] { };
+ void() old2_twitch28 = [$shake20, monster_oldone2_destroy] { };

//==============================================================
// Interaction
@@ -232,22 +304,22 @@ class monster_oldone2: base_walkmonster
//--------------------------------------------------------------
// oldone2_pain
//--------------------------------------------------------------
- virtual void(entity attacker, float damage) do_damage =
+ void(entity attacker, float damage) monster_oldone2_pain =
{
- if (this.pain_finished > time)
+ if (self.pain_finished > time)
return;

// new pain sound
- sound_pain (this, CHAN_AUTO, "oldone2/pd_pop2.wav",
+ sound_pain (self, CHAN_AUTO, "oldone2/pd_pop2.wav",
1, ATTN_NORM);
- this.atk1 ();
- this.pain_finished = time + 4;
+ old2_atk1 ();
+ self.pain_finished = time + 4;
};

//--------------------------------------------------------------
// oldone2_die
//--------------------------------------------------------------
- virtual void() do_destroy =
+ void() monster_oldone2_destroy =
{
// 1998-07-30 Shub kill count fix by Maddes start
// Already done by FL_MONSTER
@@ -259,7 +331,7 @@ class monster_oldone2: base_walkmonster
local float x, y, z;
local float r;

- oldo = this.origin + '0 0 112';
+ oldo = self.origin + '0 0 112';

z = 16;
while (z <= 144)
@@ -270,39 +342,39 @@ class monster_oldone2: base_walkmonster
y = -64;
while (y <= 64)
{
- this.origin_x = oldo_x + x;
- this.origin_y = oldo_y + y;
- this.origin_z = oldo_z + z;
+ self.origin_x = oldo_x + x;
+ self.origin_y = oldo_y + y;
+ self.origin_z = oldo_z + z;

r = random ();
if (r < 0.3)
{
// custom models -- dumptruck_ds
- if (this.mdl_gib1 != "")
- ThrowGib (this.mdl_gib1,
+ if (self.mdl_gib1 != "")
+ throw_gib(self.mdl_gib1,
-120);
else
- ThrowGib ("progs/gib1."
+ throw_gib("progs/gib1."
"mdl", -120);
}
else if (r < 0.6)
{
// custom models -- dumptruck_ds
- if (this.mdl_gib2 != "")
- ThrowGib (this.mdl_gib2,
+ if (self.mdl_gib2 != "")
+ throw_gib(self.mdl_gib2,
-120);
else
- ThrowGib ("progs/gib2."
+ throw_gib("progs/gib2."
"mdl", -120);
}
else
{
// custom models -- dumptruck_ds
- if (this.mdl_gib3 != "")
- ThrowGib (this.mdl_gib3,
+ if (self.mdl_gib3 != "")
+ throw_gib(self.mdl_gib3,
-120);
else
- ThrowGib ("progs/gib3."
+ throw_gib("progs/gib3."
"mdl", -120);
}
y = y + 32;
@@ -314,9 +386,9 @@ class monster_oldone2: base_walkmonster

particle (oldo, '0 0 0', 0, 255);
particle (oldo, '128 128 128', 0, 255);
- sound_death (this, CHAN_VOICE, "player/teledth1.wav",
+ sound_death (self, CHAN_VOICE, "player/teledth1.wav",
1, ATTN_NONE);
- remove (this);
+ remove (self);
};

//==============================================================
@@ -324,62 +396,70 @@ class monster_oldone2: base_walkmonster
//==============================================================

//--------------------------------------------------------------
- virtual void() init_spawned =
+ void(entity e) monster_oldone2_init =
{
- if (this.spawnflags & I_AM_TURRET)
+ if (e.spawnflags & I_AM_TURRET)
objerror ("Incompatible spawnflag: TURRET_MODE\n");

if (deathmatch)
{
- remove (this);
+ remove (e);
return;
}

- precache_body_model2 ("progs/oldone.mdl");
+ e.classname = "monster_oldone2";
+ e.classtype = CT_MONSTER_BOSS_OLDONE2;
+ base_monster_init (e);
+
+ precache_body_model2 (e, "progs/oldone.mdl");
// precache_model2 ("progs/oldone.mdl");

- precache_sound2_death ("boss2/death.wav");
+ precache_sound2_death (e, "boss2/death.wav");
// precache_sound2_idle ("boss2/idle.wav");
- precache_sound2_sight ("boss2/sight.wav");
- precache_sound2_misc ("boss2/pop2.wav");
- precache_sound2_pain ("oldone2/pd_pop2.wav");
+ precache_sound2_sight (e, "boss2/sight.wav");
+ precache_sound2_misc (e, "boss2/pop2.wav");
+ precache_sound2_pain (e, "oldone2/pd_pop2.wav");

precache_model ("progs/lavaball.mdl");
precache_sound ("boss1/throw.wav");

- precache_gib1 ("progs/gib1.mdl");
- precache_gib2 ("progs/gib2.mdl");
- precache_gib3 ("progs/gib3.mdl");
+ precache_gib1 (e, "progs/gib1.mdl");
+ precache_gib2 (e, "progs/gib2.mdl");
+ precache_gib3 (e, "progs/gib3.mdl");

- this.solid = SOLID_SLIDEBOX;
- this.movetype = MOVETYPE_STEP;
+ e.solid = SOLID_SLIDEBOX;
+ e.movetype = MOVETYPE_STEP;

// custom_mdls dumptruck_ds
- body_model ("progs/oldone.mdl");
- // setmodel (this, "progs/oldone.mdl");
- setsize (this, '-160 -128 -24', '160 128 256');
+ body_model (e, "progs/oldone.mdl");
+ // setmodel (e, "progs/oldone.mdl");
+ setsize (e, '-160 -128 -24', '160 128 256');

- if (!this.health)
- {
+ if (!e.health)
if (skill == 0)
- this.health = 1000;
+ e.health = 1000;
else
- this.health = 3000;
- }
+ e.health = 3000;
+
+ e.flags = FL_MONSTER;
+ e.takedamage = DAMAGE_AIM;
+ e.sightsound = monster_oldone2_sightsound;
+ e.think_run = old2_atk1;
+ e.pain = monster_oldone2_pain;
+ e.destroy = old2_twitch1;
+ e.think = old2_idle1;
+ e.nextthink = time + 0.1;

- this.flags = FL_MONSTER;
- this.takedamage = DAMAGE_AIM;
- this.think_run = this.atk1;
- this.th_pain = this.do_damage;
- this.th_die = this.do_destroy;
total_monsters = total_monsters + 1;
- this.think = this.idle1;
- this.nextthink = time + 0.1;
};

//--------------------------------------------------------------
void() monster_oldone2 =
{
- this.classtype = CT_MONSTER_BOSS_OLDONE2;
+ // new spawnflags for all entities -- iw
+ if (SUB_Inhibit())
+ return;
+
+ monster_oldone2_init (self);
};
-};
+// };

Return to the top of this page or return to the overview of this repo.

Diff qc/monsters/playerclient.qc

diff --git a/qc/monsters/playerclient.qc b/qc/monsters/playerclient.qc
index 08f9ac4..9c7cbd6 100644
--- a/qc/monsters/playerclient.qc
+++ b/qc/monsters/playerclient.qc
@@ -1166,9 +1166,14 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
//--------------------------------------------------------------
void() player_footsteps =
{
+ // not moving, no steps
if (self.velocity_x == 0 || self.velocity_y == 0)
return;

+ // no steps when submerged at the waist or greater
+ if (self.waterlevel >= WATERLEVEL_WAIST)
+ return;
+
if (self.pmove_flags & PMF_AIRSTEPPED)
{
// the heavy foot

Return to the top of this page or return to the overview of this repo.

Diff qc/monsters/shalrath.qc

diff --git a/qc/monsters/shalrath.qc b/qc/monsters/shalrath.qc
index cac98b2..d980838 100644
--- a/qc/monsters/shalrath.qc
+++ b/qc/monsters/shalrath.qc
@@ -3,8 +3,42 @@
//==============================================================================

//======================================================================
+// forward declarations
+//======================================================================
+
+// monster_shalrath
+void() monster_shalrath_sightsound; // AI, animation, & thinking
+void() shal_walk1; void() shal_walk2; void() shal_walk3; void() shal_walk4;
+void() shal_walk5; void() shal_walk6; void() shal_walk7; void() shal_walk8;
+void() shal_walk9; void() shal_walk10; void() shal_walk11; void() shal_walk12;
+void() shal_run1; void() shal_run2; void() shal_run3; void() shal_run4;
+void() shal_run5; void() shal_run6; void() shal_run7; void() shal_run8;
+void() shal_run9; void() shal_run10; void() shal_run11; void() shal_run12;
+void() shal_atk1; void() shal_atk2; void() shal_atk3; void() shal_atk4;
+void() shal_atk5; void() shal_atk6; void() shal_atk7; void() shal_atk8;
+void() shal_atk9; void() shal_atk10; void() shal_atk11;
+void() shal_tur_atk1; void() shal_tur_atk2; void() shal_tur_atk3;
+void() shal_tur_atk4; void() shal_tur_atk5; void() shal_tur_atk6;
+void() shal_tur_atk7; void() shal_tur_atk8; void() shal_tur_atk9;
+void() shal_tur_atk10; void() shal_tur_atk11; void() shal_tur_atk12;
+void() shal_tur_atk13; void() shal_tur_atk14; void() shal_tur_atk15;
+void() shal_seek_stand1; void() shal_seek_stand2;
+void() shal_pain1; void() shal_pain2; void() shal_pain3; void() shal_pain4;
+void() shal_pain5;
+void() shal_death1; void() shal_death2; void() shal_death3; void() shal_death4;
+void() shal_death5; void() shal_death6; void() shal_death7;
+void(entity attacker, float damage) monster_shalrath_pain; // interaction
+void() monster_shalrath_destroy;
+void(entity e) monster_shalrath_init; // initialization
+void() monster_shalrath;
+
+// monster_dead_shalrath
+void() monster_dead_shalrath;
+
+//======================================================================
// frame macros
//======================================================================
+
$cd id1/models/shalrath
$origin 0 0 24
$base base
@@ -21,6 +55,8 @@ $frame death1 death2 death3 death4 death5 death6 death7
$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 walk10
$frame walk11 walk12

+//------------------------------------------------------------------------------
+
/*QUAKED monster_shalrath (1 0 0) (-32 -32 -24) (32 32 48) AMBUSH X X TRIGGER_SPAWNED X X X X NOT_ON_EASY NOT_ON_NORMAL NOT_ON_HARD_OR_NIGHTMARE NOT_IN_DEATHMATCH NOT_IN_COOP NOT_IN_SINGLEPLAYER X NOT_ON_HARD_ONLY NOT_ON_NIGHTMARE_ONLY
{
model ({ "path" : "progs/shalrath.mdl", "frame": 23 });
@@ -82,87 +118,88 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
homing(float) : "Amount that the projectile should home in target. 1 is default, 0 is none."

*/
-class monster_shalrath: base_walkmonster
-{
+//----------------------------------------------------------------------
+// class monster_shalrath: base_walkmonster
+// {
//--------------------------------------------------------------
- virtual void() ai_sightsound =
+ void() monster_shalrath_sightsound =
{
- sound_sight (this, CHAN_VOICE, "shalrath/sight.wav",
+ sound_sight (self, CHAN_VOICE, "shalrath/sight.wav",
1, ATTN_NORM);
};

//--------------------------------------------------------------
// Shalrath Standing (only one frame)
//--------------------------------------------------------------
- nonvirtual void() stand1 = [$walk1, stand1] { ai_stand (); };
+ void() shal_stand1 = [$walk1, shal_stand1] { ai_stand (); };

//--------------------------------------------------------------
// Shalrath Walking functions
//--------------------------------------------------------------
- nonvirtual void() walk1 = [$walk2, walk2]
+ void() shal_walk1 = [$walk2, shal_walk2]
{
if (random() < 0.2)
- sound_idle (this, CHAN_VOICE, "shalrath/idle.wav",
+ sound_idle (self, CHAN_VOICE, "shalrath/idle.wav",
1, ATTN_IDLE);
ai_walk (6);
};
- nonvirtual void() walk2 = [$walk3, walk3] { ai_walk (4); };
- nonvirtual void() walk3 = [$walk4, walk4] { ai_walk (0); };
- nonvirtual void() walk4 = [$walk5, walk5] { ai_walk (0); };
- nonvirtual void() walk5 = [$walk6, walk6] { ai_walk (0); };
- nonvirtual void() walk6 = [$walk7, walk7] { ai_walk (0); };
- nonvirtual void() walk7 = [$walk8, walk8] { ai_walk (5); };
- nonvirtual void() walk8 = [$walk9, walk9] { ai_walk (6); };
- nonvirtual void() walk9 = [$walk10, walk10] { ai_walk (5); };
- nonvirtual void() walk10 = [$walk11, walk11] { ai_walk (0); };
- nonvirtual void() walk11 = [$walk12, walk12] { ai_walk (4); };
- nonvirtual void() walk12 = [$walk1, walk1] { ai_walk (5); };
+ void() shal_walk2 = [$walk3, shal_walk3] { ai_walk (4); };
+ void() shal_walk3 = [$walk4, shal_walk4] { ai_walk (0); };
+ void() shal_walk4 = [$walk5, shal_walk5] { ai_walk (0); };
+ void() shal_walk5 = [$walk6, shal_walk6] { ai_walk (0); };
+ void() shal_walk6 = [$walk7, shal_walk7] { ai_walk (0); };
+ void() shal_walk7 = [$walk8, shal_walk8] { ai_walk (5); };
+ void() shal_walk8 = [$walk9, shal_walk9] { ai_walk (6); };
+ void() shal_walk9 = [$walk10, shal_walk10] { ai_walk (5); };
+ void() shal_walk10 = [$walk11, shal_walk11] { ai_walk (0); };
+ void() shal_walk11 = [$walk12, shal_walk12] { ai_walk (4); };
+ void() shal_walk12 = [$walk1, shal_walk1] { ai_walk (5); };

//--------------------------------------------------------------
// Shalrath Run functions
//--------------------------------------------------------------
- nonvirtual void() run1 = [$walk2, run2]
+ void() shal_run1 = [$walk2, shal_run2]
{
if (random() < 0.2)
- sound_idle (this, CHAN_VOICE, "shalrath/idle.wav",
+ sound_idle (self, CHAN_VOICE, "shalrath/idle.wav",
1, ATTN_IDLE);
ai_run (6);
};
- nonvirtual void() run2 = [$walk3, run3] { ai_run (4); };
- nonvirtual void() run3 = [$walk4, run4] { ai_run (0); };
- nonvirtual void() run4 = [$walk5, run5] { ai_run (0); };
- nonvirtual void() run5 = [$walk6, run6] { ai_run (0); };
- nonvirtual void() run6 = [$walk7, run7] { ai_run (0); };
- nonvirtual void() run7 = [$walk8, run8] { ai_run (5); };
- nonvirtual void() run8 = [$walk9, run9] { ai_run (6); };
- nonvirtual void() run9 = [$walk10, run10] { ai_run (5); };
- nonvirtual void() run10 = [$walk11, run11] { ai_run (0); };
- nonvirtual void() run11 = [$walk12, run12] { ai_run (4); };
- nonvirtual void() run12 = [$walk1, run1] { ai_run (5); };
+ void() shal_run2 = [$walk3, shal_run3] { ai_run (4); };
+ void() shal_run3 = [$walk4, shal_run4] { ai_run (0); };
+ void() shal_run4 = [$walk5, shal_run5] { ai_run (0); };
+ void() shal_run5 = [$walk6, shal_run6] { ai_run (0); };
+ void() shal_run6 = [$walk7, shal_run7] { ai_run (0); };
+ void() shal_run7 = [$walk8, shal_run8] { ai_run (5); };
+ void() shal_run8 = [$walk9, shal_run9] { ai_run (6); };
+ void() shal_run9 = [$walk10, shal_run10] { ai_run (5); };
+ void() shal_run10 = [$walk11, shal_run11] { ai_run (0); };
+ void() shal_run11 = [$walk12, shal_run12] { ai_run (4); };
+ void() shal_run12 = [$walk1, shal_run1] { ai_run (5); };

//--------------------------------------------------------------
// Shalrath Attack functions
//--------------------------------------------------------------
- nonvirtual void() attack1 = [$attack1, attack2]
+ void() shal_atk1 = [$attack1, shal_atk2]
{
- sound_attack (this, CHAN_VOICE, "shalrath/attack.wav",
+ sound_attack (self, CHAN_VOICE, "shalrath/attack.wav",
1, ATTN_NORM);
ai_face ();
};
- nonvirtual void() attack2 = [$attack2, attack3] { ai_face (); };
- nonvirtual void() attack3 = [$attack3, attack4] { ai_face (); };
- nonvirtual void() attack4 = [$attack4, attack5] { ai_face (); };
- nonvirtual void() attack5 = [$attack5, attack6] { ai_face (); };
- nonvirtual void() attack6 = [$attack6, attack7] { ai_face (); };
- nonvirtual void() attack7 = [$attack7, attack8] { ai_face (); };
- nonvirtual void() attack8 = [$attack8, attack9] { ai_face (); };
- nonvirtual void() attack9 = [$attack9, attack10]
+ void() shal_atk2 = [$attack2, shal_atk3] { ai_face (); };
+ void() shal_atk3 = [$attack3, shal_atk4] { ai_face (); };
+ void() shal_atk4 = [$attack4, shal_atk5] { ai_face (); };
+ void() shal_atk5 = [$attack5, shal_atk6] { ai_face (); };
+ void() shal_atk6 = [$attack6, shal_atk7] { ai_face (); };
+ void() shal_atk7 = [$attack7, shal_atk8] { ai_face (); };
+ void() shal_atk8 = [$attack8, shal_atk9] { ai_face (); };
+ void() shal_atk9 = [$attack9, shal_atk10]
{
- fire_voreball (this.origin + '0 0 10',
- (this.enemy.origin + '0 0 10') - this.origin);
+ base_monster_fire_voreball (self.origin + '0 0 10',
+ (self.enemy.origin + '0 0 10') - self.origin);
};
- nonvirtual void() attack10 = [$attack10, attack11] { ai_face (); };
- nonvirtual void() attack11 = [$attack11, run1] { };
+ void() shal_atk10 = [$attack10, shal_atk11] { ai_face (); };
+ void() shal_atk11 = [$attack11, shal_run1] { };

////////////////////////////////////////
/// new frames for turret mode START ///
@@ -171,36 +208,36 @@ class monster_shalrath: base_walkmonster
//--------------------------------------------------------------
// Shalrath Turret Attack
//--------------------------------------------------------------
- nonvirtual void() tur_atk1 = [$attack1, tur_atk2]
+ void() shal_tur_atk1 = [$attack1, shal_tur_atk2]
{
- sound_attack (this, CHAN_VOICE, "shalrath/attack.wav",
+ sound_attack (self, CHAN_VOICE, "shalrath/attack.wav",
1, ATTN_NORM);
ai_face ();
};
- nonvirtual void() tur_atk2 = [$attack2, tur_atk3] { ai_face (); };
- nonvirtual void() tur_atk3 = [$attack3, tur_atk4] { ai_face (); };
- nonvirtual void() tur_atk4 = [$attack4, tur_atk5] { ai_face (); };
- nonvirtual void() tur_atk5 = [$attack5, tur_atk6] { ai_face (); };
- nonvirtual void() tur_atk6 = [$attack6, tur_atk7] { ai_face (); };
- nonvirtual void() tur_atk7 = [$attack7, tur_atk8] { ai_face (); };
- nonvirtual void() tur_atk8 = [$attack8, tur_atk9] { ai_face (); };
- nonvirtual void() tur_atk9 = [$attack9, tur_atk10]
+ void() shal_tur_atk2 = [$attack2, shal_tur_atk3] { ai_face (); };
+ void() shal_tur_atk3 = [$attack3, shal_tur_atk4] { ai_face (); };
+ void() shal_tur_atk4 = [$attack4, shal_tur_atk5] { ai_face (); };
+ void() shal_tur_atk5 = [$attack5, shal_tur_atk6] { ai_face (); };
+ void() shal_tur_atk6 = [$attack6, shal_tur_atk7] { ai_face (); };
+ void() shal_tur_atk7 = [$attack7, shal_tur_atk8] { ai_face (); };
+ void() shal_tur_atk8 = [$attack8, shal_tur_atk9] { ai_face (); };
+ void() shal_tur_atk9 = [$attack9, shal_tur_atk10]
{
- fire_voreball (this.origin + '0 0 10',
- (this.enemy.origin + '0 0 10') - this.origin);
+ base_monster_fire_voreball (self.origin + '0 0 10',
+ (self.enemy.origin + '0 0 10') - self.origin);
};
- nonvirtual void() tur_atk10 = [$attack10, tur_atk11] {ai_face();};
- nonvirtual void() tur_atk11 = [$attack11, tur_atk12] {ai_face();};
- nonvirtual void() tur_atk12 = [$walk1, tur_atk13] { ai_face (); };
- nonvirtual void() tur_atk13 = [$walk1, tur_atk14] { ai_face (); };
- nonvirtual void() tur_atk14 = [$walk1, tur_atk15] { ai_face (); };
- nonvirtual void() tur_atk15 = [$walk1, seek_stand1] { ai_run (0); };
+ void() shal_tur_atk10 = [$attack10, shal_tur_atk11] { ai_face (); };
+ void() shal_tur_atk11 = [$attack11, shal_tur_atk12] { ai_face (); };
+ void() shal_tur_atk12 = [$walk1, shal_tur_atk13] { ai_face (); };
+ void() shal_tur_atk13 = [$walk1, shal_tur_atk14] { ai_face (); };
+ void() shal_tur_atk14 = [$walk1, shal_tur_atk15] { ai_face (); };
+ void() shal_tur_atk15 = [$walk1, shal_seek_stand1] { ai_run (0); };

//--------------------------------------------------------------
// Shalrath Turret Standing/Seeeking
//--------------------------------------------------------------
- nonvirtual void() seek_stand1 = [$walk1, seek_stand2] { ai_run (0); };
- nonvirtual void() seek_stand2 = [$walk1, seek_stand1] { ai_run (0); };
+ void() shal_seek_stand1 = [$walk1, shal_seek_stand2] { ai_run (0); };
+ void() shal_seek_stand2 = [$walk1, shal_seek_stand1] { ai_run (0); };

////////////////////////////////////////
/// new frames for turret mode END ///
@@ -209,22 +246,22 @@ class monster_shalrath: base_walkmonster
//--------------------------------------------------------------
// Shalrath Pain State
//--------------------------------------------------------------
- nonvirtual void() pain1 = [$pain1, pain2] { };
- nonvirtual void() pain2 = [$pain2, pain3] { };
- nonvirtual void() pain3 = [$pain3, pain4] { };
- nonvirtual void() pain4 = [$pain4, pain5] { };
- nonvirtual void() pain5 = [$pain5, run1] { };
+ void() shal_pain1 = [$pain1, shal_pain2] { };
+ void() shal_pain2 = [$pain2, shal_pain3] { };
+ void() shal_pain3 = [$pain3, shal_pain4] { };
+ void() shal_pain4 = [$pain4, shal_pain5] { };
+ void() shal_pain5 = [$pain5, shal_run1] { };

//--------------------------------------------------------------
// Shalrath Death State
//--------------------------------------------------------------
- nonvirtual void() death1 = [$death1, death2] { };
- nonvirtual void() death2 = [$death2, death3] { };
- nonvirtual void() death3 = [$death3, death4] { };
- nonvirtual void() death4 = [$death4, death5] { };
- nonvirtual void() death5 = [$death5, death6] { };
- nonvirtual void() death6 = [$death6, death7] { };
- nonvirtual void() death7 = [$death7, death7] { };
+ void() shal_death1 = [$death1, shal_death2] { };
+ void() shal_death2 = [$death2, shal_death3] { };
+ void() shal_death3 = [$death3, shal_death4] { };
+ void() shal_death4 = [$death4, shal_death5] { };
+ void() shal_death5 = [$death5, shal_death6] { };
+ void() shal_death6 = [$death6, shal_death7] { };
+ void() shal_death7 = [$death7, shal_death7] { };

//==============================================================
// Interaction
@@ -233,79 +270,69 @@ class monster_shalrath: base_walkmonster
//--------------------------------------------------------------
// shalrath_pain
//--------------------------------------------------------------
- virtual void(entity attacker, float damage) do_damage =
+ void(entity attacker, float damage) monster_shalrath_pain =
{
- if (this.pain_finished > time)
+ if (self.pain_finished > time)
return;

// CHAN_AUTO was voice - dumptruck_ds
- sound_pain (this, CHAN_AUTO, "shalrath/pain.wav",
+ sound_pain (self, CHAN_AUTO, "shalrath/pain.wav",
1, ATTN_NORM);
- this.pain_finished = time + 3;
+ self.pain_finished = time + 3;

- if (this.spawnflags & I_AM_TURRET)
+ if (self.spawnflags & I_AM_TURRET)
return;
else
- this.pain1 ();
+ shal_pain1 ();
};

//--------------------------------------------------------------
// shalrath_die
//--------------------------------------------------------------
- virtual void() do_destroy =
+ void() monster_shalrath_destroy =
{
// check for gib
- if (this.health < -90)
+ if (self.health < -90)
{
- sound (this, CHAN_VOICE, "player/udeath.wav",
+ sound (self, CHAN_VOICE, "player/udeath.wav",
1, ATTN_NORM);

// dumptruck_ds custom_mdls
- if (this.mdl_head != "")
- {
- ThrowHead (this.mdl_head, this.health);
- }
+ if (self.mdl_head != "")
+ throw_head (self.mdl_head, self.health);
else
- {
- ThrowHead ("progs/h_shal.mdl", this.health);
- }
- // ThrowGib ("progs/gib1.mdl", this.health);
- // ThrowGib ("progs/gib2.mdl", this.health);
- // ThrowGib ("progs/gib3.mdl", this.health);
+ throw_head ("progs/h_shal.mdl", self.health);
+
+ // throw_gib ("progs/gib1.mdl", self.health);
+ // throw_gib ("progs/gib2.mdl", self.health);
+ // throw_gib ("progs/gib3.mdl", self.health);
+
// custom models -- dumptruck_ds
- if (this.mdl_gib1 != "")
- {
- ThrowGib (this.mdl_gib1, this.health);
- }
+ if (self.mdl_gib1 != "")
+ throw_gib (self.mdl_gib1, self.health);
else
- {
- ThrowGib ("progs/gib1.mdl", this.health);
- }
- if (this.mdl_gib2 != "")
- {
- ThrowGib (this.mdl_gib2, this.health);
- }
+ throw_gib ("progs/gib1.mdl", self.health);
+
+ if (self.mdl_gib2 != "")
+ throw_gib (self.mdl_gib2, self.health);
else
- {
- ThrowGib ("progs/gib2.mdl", this.health);
- }
- if (this.mdl_gib3 != "")
- {
- ThrowGib (this.mdl_gib3, this.health);
- }
+ throw_gib ("progs/gib2.mdl", self.health);
+
+ if (self.mdl_gib3 != "")
+ throw_gib (self.mdl_gib3, self.health);
else
- {
- ThrowGib ("progs/gib3.mdl", this.health);
- }
- base_item::drop_stuff (this);
+ throw_gib ("progs/gib3.mdl", self.health);
+
+ base_item_drop_stuff (self);
return;
}
+
// insert death sounds here
- sound_death (this, CHAN_VOICE, "shalrath/death.wav",
+ sound_death (self, CHAN_VOICE, "shalrath/death.wav",
1, ATTN_NORM);
- base_item::drop_stuff (this);
- this.death1 ();
- this.solid = SOLID_NOT;
+ base_item_drop_stuff (self);
+ shal_death1 ();
+ self.solid = SOLID_NOT;
};

//==============================================================
@@ -313,84 +340,91 @@ class monster_shalrath: base_walkmonster
//==============================================================

//--------------------------------------------------------------
- virtual void() init_spawned =
+ void(entity e) monster_shalrath_init =
{
if (deathmatch)
{
- remove (this);
+ remove (e);
return;
}

+ e.classname = "monster_shalrath";
+ e.classtype = CT_MONSTER_VORE;
+
// dumptruck_ds custom_mdls
- precache_body_model2 ("progs/shalrath.mdl");
- precache_head_model2 ("progs/h_shal.mdl");
- precache_proj_model2 ("progs/v_spike.mdl");
+ precache_body_model2 (e, "progs/shalrath.mdl");
+ precache_head_model2 (e, "progs/h_shal.mdl");
+ precache_proj_model2 (e, "progs/v_spike.mdl");
// dumptruck_ds
- precache_sound2_attack ("shalrath/attack.wav");
- precache_sound2_misc ("shalrath/attack2.wav");
- precache_sound2_death ("shalrath/death.wav");
- precache_sound2_idle ("shalrath/idle.wav");
- precache_sound2_pain ("shalrath/pain.wav");
- precache_sound2_sight ("shalrath/sight.wav");
+ precache_sound2_attack (e, "shalrath/attack.wav");
+ precache_sound2_misc (e, "shalrath/attack2.wav");
+ precache_sound2_death (e, "shalrath/death.wav");
+ precache_sound2_idle (e, "shalrath/idle.wav");
+ precache_sound2_pain (e, "shalrath/pain.wav");
+ precache_sound2_sight (e, "shalrath/sight.wav");

- precache_gib1 ("progs/gib1.mdl");
- precache_gib2 ("progs/gib2.mdl");
- precache_gib3 ("progs/gib3.mdl");
+ precache_gib1 (e, "progs/gib1.mdl");
+ precache_gib2 (e, "progs/gib2.mdl");
+ precache_gib3 (e, "progs/gib3.mdl");

- this.solid = SOLID_SLIDEBOX;
- this.movetype = MOVETYPE_STEP;
+ e.solid = SOLID_SLIDEBOX;
+ e.movetype = MOVETYPE_STEP;

- body_model ("progs/shalrath.mdl");
- // setmodel (this, "progs/shalrath.mdl");
- setsize (this, VEC_HULL2_MIN, VEC_HULL2_MAX);
+ body_model (e, "progs/shalrath.mdl");
+ // setmodel (e, "progs/shalrath.mdl");
+ setsize (e, VEC_HULL2_MIN, VEC_HULL2_MAX);

- if (!this.health)
+ if (!e.health)
// thanks RennyC -- dumptruck_ds
- this.health = 400;
+ e.health = 400;

- if (!this.proj_speed_mod)
- this.proj_speed_mod = 1;
+ if (!e.proj_speed_mod)
+ e.proj_speed_mod = 1;

- if (!this.homing)
+ if (!e.homing)
// default to normal
- this.homing = 1;
- else if (this.homing < 0)
+ e.homing = 1;
+ else if (e.homing < 0)
// disable with negative
- this.homing = 0;
+ e.homing = 0;

- this.think_stand = this.stand1;
- this.think_walk = this.walk1;
- if (this.spawnflags & I_AM_TURRET)
- this.think_run = this.seek_stand1;
+ e.think_stand = shal_stand1;
+ e.think_walk = shal_walk1;
+ if (e.spawnflags & I_AM_TURRET)
+ e.think_run = shal_seek_stand1;
else
- this.think_run = this.run1;
+ e.think_run = shal_run1;

- this.th_die = this.do_destroy;
+ e.destroy = monster_shalrath_destroy;

// Berserk test from
// http://celephais.net/board/view_thread.php?id=4&start=3465
// -- dumptruck_ds
- if !(this.berserk)
- this.th_pain = this.do_damage;
+ if !(e.berserk)
+ e.pain = monster_shalrath_pain;
else
- this.th_pain = sub_nullpain;
- this.think_missile = this.attack1;
- this.think_turret = this.tur_atk1;
+ e.pain = sub_nullpain;
+ e.think_missile = shal_atk1;
+ e.think_turret = shal_tur_atk1;

- // call walkmonster_start directly -- CEV
- super::init_spawned ();
+ // walkmonster_start
+ base_walkmonster_init (e);
};

//--------------------------------------------------------------
void() monster_shalrath =
{
- this.classtype = CT_MONSTER_VORE;
- };
-};
+ // new spawnflags for all entities -- iw
+ if (SUB_Inhibit())
+ return;

-//==============================================================================
+ monster_shalrath_init (self);
+ };
+// };

-/* Scenic Dead Monster Patch stuff here from DeadStuff mod -- dumptruck_ds */
+//----------------------------------------------------------------------
+// Scenic Dead Monster Patch stuff here from DeadStuff mod -- dumptruck_ds
+//----------------------------------------------------------------------

/*QUAKED monster_dead_shalrath (0 0.5 0.8) (-32 -32 -24) (32 32 64) SOLID X X X X X X X NOT_ON_EASY NOT_ON_NORMAL NOT_ON_HARD_OR_NIGHTMARE NOT_IN_DEATHMATCH NOT_IN_COOP NOT_IN_SINGLEPLAYER X NOT_ON_HARD_ONLY NOT_ON_NIGHTMARE_ONLY
{
@@ -399,21 +433,21 @@ class monster_shalrath: base_walkmonster
*/
void() monster_dead_shalrath =
{
- if (SUB_Inhibit ()) // new spawnflags for all entities -- iw
+ // new spawnflags for all entities -- iw
+ if (SUB_Inhibit())
return;

- precache_model("progs/shalrath.mdl");
- setmodel(self, "progs/shalrath.mdl");
+ precache_model ("progs/shalrath.mdl");
+ setmodel (self, "progs/shalrath.mdl");
self.frame = $death7;

if (self.spawnflags & 1)
{
self.solid = SOLID_BBOX;
- setsize(self,'-41.41 -40.06 -49.38','34.52 24.32 30');
+ setsize (self,'-41.41 -40.06 -49.38','34.52 24.32 30');
}
else
{
self.solid = SOLID_NOT;
}
-
};

Return to the top of this page or return to the overview of this repo.

Diff qc/monsters/soldier.qc

diff --git a/qc/monsters/soldier.qc b/qc/monsters/soldier.qc
index aa334d9..071ee3f 100644
--- a/qc/monsters/soldier.qc
+++ b/qc/monsters/soldier.qc
@@ -375,43 +375,33 @@ damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by
{
sound (self, CHAN_VOICE, "player/udeath.wav",
1, ATTN_NORM);
+
if (self.mdl_head != "")
- {
// dumptruck_ds custom_mdls
throw_head (self.mdl_head, self.health);
- }
else
- {
throw_head ("progs/h_guard.mdl", self.health);
- }
+
// throw_gib ("progs/gib1.mdl", self.health);
// throw_gib ("progs/gib2.mdl", self.health);
// throw_gib ("progs/gib3.mdl", self.health);
+
if (self.mdl_gib1 != "")
- {
// custom models -- dumptruck_ds
throw_gib (self.mdl_gib1, self.health);
- }
else
- {
throw_gib ("progs/gib1.mdl", self.health);
- }
+
if (self.mdl_gib2 != "")
- {
throw_gib (self.mdl_gib2, self.health);
- }
else
- {
throw_gib ("progs/gib2.mdl", self.health);
- }
+
if (self.mdl_gib3 != "")
- {
throw_gib (self.mdl_gib3, self.health);
- }
else
- {
throw_gib ("progs/gib3.mdl", self.health);
- }
+
base_item_drop_stuff (self);
return;
}

Return to the top of this page or return to the overview of this repo.

Diff qc/pmove.qc

diff --git a/qc/pmove.qc b/qc/pmove.qc
index 1764c91..7d499fa 100644
--- a/qc/pmove.qc
+++ b/qc/pmove.qc
@@ -410,7 +410,7 @@ void() PM_DanceMove =
touched_ent = trace_ent;

// don't attempt to step again
- self.pmove_flags &= ~PMF_SLIDE_STEP;
+ // self.pmove_flags &= ~PMF_SLIDE_STEP;
}
else
{

Return to the top of this page or return to the overview of this repo.

Diff qc/projectiles/grenade.qc

diff --git a/qc/projectiles/grenade.qc b/qc/projectiles/grenade.qc
index 2c1d0ab..9adf549 100644
--- a/qc/projectiles/grenade.qc
+++ b/qc/projectiles/grenade.qc
@@ -8,7 +8,7 @@
const float GRENADE_DIRECT_DAMAGE = 100;// direct damage; 100 is id1
const float GRENADE_SPLASH_DAMAGE = 120;// splash damage; 120 is id1
const float GRENADE_SPEED = 600; // id1 grenade speed is 600
-const float GRENADE_HEALTH = 20; // explodes when dead
+const float GRENADE_HEALTH = 50; // explodes when dead

// found using FTE's sv_gameplayfix_setmodelrealbox
// const vector GRENADE_MINS = '-8.57384 -3.71142 -3.94197';
@@ -35,7 +35,13 @@ strip void() projectile_grenade;
//--------------------------------------------------------------
void() projectile_grenade_destroy =
{
- dprint (sprintf("projectile_grenade_destroy: exploding\n"));
+ if (self.aflag & PROJECTILE_DESTROYED)
+ return;
+
+ self.aflag |= PROJECTILE_DESTROYED;
+ self.destroy = sub_null;
+ self.think = sub_null;
+ self.touch = sub_null;
projectile_grenade_think ();
};

@@ -49,8 +55,7 @@ strip void() projectile_grenade;

// BecomeExplosion
write_explosion (self.origin);
- spawn_base_explosion (self.origin);
- remove (self);
+ become_base_explosion (self);
};

//--------------------------------------------------------------

Return to the top of this page or return to the overview of this repo.

Diff qc/projectiles/lavaball.qc

diff --git a/qc/projectiles/lavaball.qc b/qc/projectiles/lavaball.qc
index 7232067..1d5aa87 100644
--- a/qc/projectiles/lavaball.qc
+++ b/qc/projectiles/lavaball.qc
@@ -34,8 +34,14 @@ strip void() projectile_lavaball;
//--------------------------------------------------------------
void() projectile_lavaball_destroy =
{
- // dprint ("projectile_lavaball_destroy: exploding...\n");
- self.touch ();
+ if (self.aflag & PROJECTILE_DESTROYED)
+ return;
+
+ self.aflag |= PROJECTILE_DESTROYED;
+ self.destroy = sub_null;
+ self.think = sub_null;
+ self.touch = sub_null;
+ base_projectile_touch ();
};

//--------------------------------------------------------------

Return to the top of this page or return to the overview of this repo.

Diff qc/projectiles/multigrenade.qc

diff --git a/qc/projectiles/multigrenade.qc b/qc/projectiles/multigrenade.qc
index 947c090..d309b94 100644
--- a/qc/projectiles/multigrenade.qc
+++ b/qc/projectiles/multigrenade.qc
@@ -7,7 +7,7 @@
//======================================================================
const float MININADE_SPLASH_DAMAGE = 35;// PD3 is 90 for player, 60 other
const float MULTINADE_SPLASH_DAMAGE = 35;// 35 is the tribolt from QC
-const float MULTINADE_HEALTH = 5; //
+const float MULTINADE_HEALTH = 50; //

const vector MININADE_MINS = '0 0 0'; // zero size for mininades
const vector MININADE_MAXS = '0 0 0';
@@ -59,8 +59,7 @@ strip void() projectile_multigrenade;
// TODO CEV what are the following two writes doing?
WriteByte (MSG_BROADCAST, 230);
WriteByte (MSG_BROADCAST, 5);
- spawn_base_explosion (self.origin);
- remove (self);
+ become_base_explosion (self);
};
// };

@@ -159,7 +158,13 @@ strip void() projectile_multigrenade;
//--------------------------------------------------------------
void() projectile_multigrenade_destroy =
{
- dprint ("projectile_multigrenade_destroy: exploding...\n");
+ if (self.aflag & PROJECTILE_DESTROYED)
+ return;
+
+ self.aflag |= PROJECTILE_DESTROYED;
+ self.destroy = sub_null;
+ self.think = sub_null;
+ self.touch = sub_null;
projectile_minigrenade_explode ();
};

Return to the top of this page or return to the overview of this repo.

Diff qc/projectiles/rocket.qc

diff --git a/qc/projectiles/rocket.qc b/qc/projectiles/rocket.qc
index 878d32e..609be2b 100644
--- a/qc/projectiles/rocket.qc
+++ b/qc/projectiles/rocket.qc
@@ -8,7 +8,7 @@
const float ROCKET_DIRECT_DAMAGE = 100; // direct damage; 100 is id1
const float ROCKET_SPLASH_DAMAGE = 120; // splash damage; 120 is id1
const float ROCKET_SPEED = 1000; // id1 1000ups
-const float ROCKET_HEALTH = 20; // explodes when dead
+const float ROCKET_HEALTH = 50; // explodes when dead

// found using FTE's sv_gameplayfix_setmodelrealbox
// const vector ROCKET_MINS = '-9.75537 -3.24751 -3.1833';
@@ -35,8 +35,14 @@ strip void() projectile_rocket;
//--------------------------------------------------------------
void() projectile_rocket_destroy =
{
- dprint ("projectile_rocket_destroy: exploding...\n");
- base_projectile_touch_explosive ();
+ if (self.aflag & PROJECTILE_DESTROYED)
+ return;
+
+ self.aflag |= PROJECTILE_DESTROYED;
+ self.destroy = sub_null;
+ self.think = sub_null;
+ self.touch = sub_null;
+ base_projectile_touch ();
};

//--------------------------------------------------------------

Return to the top of this page or return to the overview of this repo.

Diff qc/projectiles/voreball.qc

diff --git a/qc/projectiles/voreball.qc b/qc/projectiles/voreball.qc
index 73e723f..37df959 100644
--- a/qc/projectiles/voreball.qc
+++ b/qc/projectiles/voreball.qc
@@ -8,7 +8,7 @@
const float VOREBALL_DIRECT_DAMAGE = 110;// only for zombies -- CEV
const float VOREBALL_SPLASH_DAMAGE = 40;// splash damage; 120 is id1
const float VOREBALL_SPEED = 400; // id1 400ups
-const float VOREBALL_HEALTH = 50; // slightly more difficult to destroy
+const float VOREBALL_HEALTH = 80; // slightly more difficult to destroy

// found with FTE's sv_gameplayfix_setmodelrealbox
const vector VOREBALL_MINS = '-16 -16 -16';
@@ -34,8 +34,14 @@ strip void() projectile_voreball;
//--------------------------------------------------------------
void() projectile_voreball_destroy =
{
- // dprint ("projectile_lavaball_destroy: exploding...\n");
- self.touch ();
+ if (self.aflag & PROJECTILE_DESTROYED)
+ return;
+
+ self.aflag |= PROJECTILE_DESTROYED;
+ self.destroy = sub_null;
+ self.think = sub_null;
+ self.touch = sub_null;
+ projectile_voreball_touch ();
};

//--------------------------------------------------------------
@@ -46,8 +52,12 @@ strip void() projectile_voreball;
if (base_projectile_check_touch())
return;

- if (other.classtype == CT_MONSTER_ZOMBIE)
- t_damage2 (other, self, self, self.direct_damage);
+ if (other)
+ if (other.classtype == CT_MONSTER_ZOMBIE)
+ t_damage2 (other, self, self,
+ self.direct_damage);
+ else
+ other = world;

if (self.takedamage)
self.takedamage = DAMAGE_NO;
@@ -57,8 +67,7 @@ strip void() projectile_voreball;

// BecomeExplosion
write_explosion (self.origin);
- spawn_base_explosion (self.origin);
- remove (self);
+ become_base_explosion (self);
};

//--------------------------------------------------------------
@@ -71,7 +80,8 @@ strip void() projectile_voreball;
e.origin = org;
e.velocity = vel;
e.avelocity = src.cust_avelocity;
- // speed
+ // homing setup
+ e.homing = src.homing;
e.proj_basespeed = basespeed;
e.proj_speed_mod = src.proj_speed_mod;
// model, skin, & sounds
@@ -92,6 +102,7 @@ strip void() projectile_voreball;
e.classtype = CT_PROJECTILE_VOREBALL;
e.movetype = MOVETYPE_FLYMISSILE;
e.solid = SOLID_BBOX;
+ e.destroy = projectile_voreball_destroy;
e.touch = projectile_voreball_touch;
e.aflag |= PROJECTILE_EXPLOSIVE;
e.health = VOREBALL_HEALTH;

Return to the top of this page or return to the overview of this repo.

Diff qc/projectiles/wizardspell.qc

diff --git a/qc/projectiles/wizardspell.qc b/qc/projectiles/wizardspell.qc
index 5f52e3b..bfd888c 100644
--- a/qc/projectiles/wizardspell.qc
+++ b/qc/projectiles/wizardspell.qc
@@ -12,6 +12,7 @@
//======================================================================
// constants
//======================================================================
+
const float WIZMIS_DIRECT_DAMAGE = 9; // direct damage; 9 is id1
const float WIZMIS_SPLASH_DAMAGE = 9; // splash damage
const float WIZMIS_EXPLOD_DAMAGE = 50; // big damage. explody scrag should

Return to the top of this page or return to the overview of this repo.

Diff qc/sv_progs.src

diff --git a/qc/sv_progs.src b/qc/sv_progs.src
index 11b8353..f44ad46 100644
--- a/qc/sv_progs.src
+++ b/qc/sv_progs.src
@@ -100,14 +100,12 @@ monsters/shambler.qc // id1 Shambler
monsters/soldier.qc // id1 Grunt
monsters/wizard.qc // id1 Scragg / Wizard
monsters/zombie.qc // modified Ace_Dave's zombies from Rubicon2
-/*
monsters/enforcer.qc // id1 Enforcer (registered)
monsters/fish.qc // id1 Fish (registered)
monsters/hknight.qc // id1 Death Knight / Hell Knight (registered)
monsters/oldone.qc // id1 Shub (registered)
monsters/oldone2.qc // pd3 killable Shub
monsters/shalrath.qc // id1 Vore (registered)
-*/

//----------------------------------------------------------------------
// func entities

Return to the top of this page or return to the overview of this repo.

Diff qc/triggers/push.qc

diff --git a/qc/triggers/push.qc b/qc/triggers/push.qc
index 995f4cd..4953d05 100644
--- a/qc/triggers/push.qc
+++ b/qc/triggers/push.qc
@@ -306,7 +306,7 @@ Pushes the player
/*
void() trigger_push_use =
{
- sel.is_waiting = !self.is_waiting;
+ self.is_waiting = !self.is_waiting;
}
*/

Return to the top of this page or return to the overview of this repo.