djcev.com

//

Git Repos / fte_dogmode / qc / monsters / ogre.qc

Last update to this file was on 2024-09-17 at 12:58.

Show ogre.qc

//==============================================================================
// OGRE
//==============================================================================

//======================================================================
// constants
//======================================================================

const float MONSTER_FLAK_OGRE = 4;
const float FL_NOSELECT = 8192; // ignored by entity selector
const float OGRE_DEFAULT_ELEVATION = 30;// angle to fire at if enemy too far

const float OGRE_HEALTH = 200; // id1 200
const float OGRE_HEALTH_CORPSE = 80;

const vector OGRE_HEAD_MINS = '-12.35 -15.7 -0.17';
const vector OGRE_HEAD_MAXS = '10.67 13.88 30';
const vector OGRE_CORPSE_MINS = '-40.64 -54.06 -54.1';
const vector OGRE_CORPSE_MAXS = '29.42 54.63 30';
const vector OGRE_CORPSE_B_MINS = '-45.64 -29.46 -54.52';
const vector OGRE_CORPSE_B_MAXS = '33.87 39.18 30';
const vector OGRE_CORPSE_Z_MINS = '-20 -20 -24';
const vector OGRE_CORPSE_Z_MAXS = '20 20 -8';

//======================================================================
// forward declarations
//======================================================================

// monster_ogre
void() monster_ogre_sightsound; // AI & attacks
float() monster_ogre_checkattack;
void() monster_ogre_fire_spike;
void() monster_ogre_fire_lavaball;
void() monster_ogre_attack_ranged;
void(float side) monster_ogre_attack_chainsaw;
void() monster_ogre_attack_melee;
void() ogre_stand1; void() ogre_stand2; void() ogre_stand3; void() ogre_stand4;
void() ogre_stand5; void() ogre_stand6; void() ogre_stand7; void() ogre_stand8;
void() ogre_stand9;
void() ogre_walk1; void() ogre_walk2; void() ogre_walk3; void() ogre_walk4;
void() ogre_walk5; void() ogre_walk6; void() ogre_walk7; void() ogre_walk8;
void() ogre_walk9; void() ogre_walk10; void() ogre_walk11; void() ogre_walk12;
void() ogre_walk13; void() ogre_walk14; void() ogre_walk15; void() ogre_walk16;
void() ogre_run1; void() ogre_run2; void() ogre_run3; void() ogre_run4;
void() ogre_run5; void() ogre_run6; void() ogre_run7; void() ogre_run8;
void() ogre_smash1; void() ogre_smash2; void() ogre_smash3; void() ogre_smash4;
void() ogre_smash5; void() ogre_smash6; void() ogre_smash7; void() ogre_smash8;
void() ogre_smash9; void() ogre_smash10; void() ogre_smash11;
void() ogre_smash12; void() ogre_smash13; void() ogre_smash14;
void() ogre_swing1; void() ogre_swing2; void() ogre_swing3; void() ogre_swing4;
void() ogre_swing5; void() ogre_swing6; void() ogre_swing7; void() ogre_swing8;
void() ogre_swing9; void() ogre_swing10; void() ogre_swing11;
void() ogre_swing12; void() ogre_swing13; void() ogre_swing14;
void() ogre_nail1; void() ogre_nail2; void() ogre_nail3; void() ogre_nail4;
void() ogre_nail5; void() ogre_nail6; void() ogre_nail7;
void() ogre_tur_atk1; void() ogre_tur_atk2; void() ogre_tur_atk3;
void() ogre_tur_atk4; void() ogre_tur_atk5; void() ogre_tur_atk6;
void() ogre_tur_atk7; void() ogre_tur_atk8; void() ogre_tur_atk9;
void() ogre_tur_seek1; void() ogre_tur_seek2; void() ogre_tur_seek3;
void() ogre_tur_seek4; void() ogre_tur_seek5; void() ogre_tur_seek6;
void() ogre_tur_seek7; void() ogre_tur_seek8; void() ogre_tur_seek9;
void() ogre_pain1; void() ogre_pain2; void() ogre_pain3; void() ogre_pain4;
void() ogre_pain5;
void() ogre_painb1; void() ogre_painb2; void() ogre_painb3;
void() ogre_painc1; void() ogre_painc2; void() ogre_painc3; void() ogre_painc4;
void() ogre_painc5; void() ogre_painc6;
void() ogre_paind1; void() ogre_paind2; void() ogre_paind3; void() ogre_paind4;
void() ogre_paind5; void() ogre_paind6; void() ogre_paind7; void() ogre_paind8;
void() ogre_paind9; void() ogre_paind10; void() ogre_paind11;
void() ogre_paind12; void() ogre_paind13; void() ogre_paind14;
void() ogre_paind15; void() ogre_paind16;
void() ogre_paine1; void() ogre_paine2; void() ogre_paine3; void() ogre_paine4;
void() ogre_paine5; void() ogre_paine6; void() ogre_paine7; void() ogre_paine8;
void() ogre_paine9; void() ogre_paine10; void() ogre_paine11;
void() ogre_paine12; void() ogre_paine13; void() ogre_paine14;
void() ogre_paine15;
void() ogre_die1; void() ogre_die2; void() ogre_die3; void() ogre_die4;
void() ogre_die5; void() ogre_die6; void() ogre_die7; void() ogre_die8;
void() ogre_die9; void() ogre_die10; void() ogre_die11;
void() ogre_die12; void() ogre_die13; void() ogre_die14;
void() ogre_bdie1; void() ogre_bdie2; void() ogre_bdie3; void() ogre_bdie4;
void() ogre_bdie5; void() ogre_bdie6; void() ogre_bdie7; void() ogre_bdie8;
void() ogre_bdie9; void() ogre_bdie10;
void(entity attacker, float damage) monster_ogre_pain; // interaction
void(vector dir) monster_ogre_destroy;
entity(vector org, vector ang, float sflags, float yaw, float angry)
spawn_monster_ogre; // initialization
void(entity e) monster_ogre_init;
void() monster_ogre;

// monster_ogre_marksman
void() ogre_mm_nail1; void() ogre_mm_nail2; void() ogre_mm_nail3;
void() ogre_mm_nail4;
void() ogre_mm_t_atk1; void() ogre_mm_t_atk2; void() ogre_mm_t_atk3;
void() ogre_mm_t_atk4; void() ogre_mm_t_atk5; void() ogre_mm_t_atk6;
void() ogre_mm_t_atk7; void() ogre_mm_t_atk8; void() ogre_mm_t_atk9;
void() ogre_mm_t_seek1; void() ogre_mm_t_seek2; void() ogre_mm_t_seek3;
void() ogre_mm_t_seek4; void() ogre_mm_t_seek5; void() ogre_mm_t_seek6;
void() ogre_mm_t_seek7; void() ogre_mm_t_seek8; void() ogre_mm_t_seek9;
void(entity e) monster_ogre_marksman_init;// initialization
void() monster_ogre_marksman;

// gib_head_ogre
void(entity act, vector dir, float dmg) throw_gib_head_ogre;
void(entity e) gib_head_ogre_init;
void() gib_head_ogre;

// monster_dead_ogre
void(entity e) monster_dead_ogre_init;
void() monster_dead_ogre;

//======================================================================
// frame macros
//======================================================================

$cd id1/models/ogre_c
$origin 0 0 24
$base base
$skin base

$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9

$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7
$frame walk8 walk9 walk10 walk11 walk12 walk13 walk14 walk15 walk16

$frame run1 run2 run3 run4 run5 run6 run7 run8

$frame swing1 swing2 swing3 swing4 swing5 swing6 swing7
$frame swing8 swing9 swing10 swing11 swing12 swing13 swing14

$frame smash1 smash2 smash3 smash4 smash5 smash6 smash7
$frame smash8 smash9 smash10 smash11 smash12 smash13 smash14

$frame shoot1 shoot2 shoot3 shoot4 shoot5 shoot6

$frame pain1 pain2 pain3 pain4 pain5

$frame painb1 painb2 painb3

$frame painc1 painc2 painc3 painc4 painc5 painc6

$frame paind1 paind2 paind3 paind4 paind5 paind6 paind7 paind8 paind9 paind10
$frame paind11 paind12 paind13 paind14 paind15 paind16

$frame paine1 paine2 paine3 paine4 paine5 paine6 paine7 paine8 paine9 paine10
$frame paine11 paine12 paine13 paine14 paine15

$frame death1 death2 death3 death4 death5 death6
$frame death7 death8 death9 death10 death11 death12
$frame death13 death14

$frame bdeath1 bdeath2 bdeath3 bdeath4 bdeath5 bdeath6
$frame bdeath7 bdeath8 bdeath9 bdeath10

$frame pull1 pull2 pull3 pull4 pull5 pull6 pull7 pull8 pull9 pull10 pull11

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

/*QUAKED monster_ogre (1 0 0) (-32 -32 -24) (32 32 64) 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/ogre.mdl");
}
Ogre.

Default health = 200"

style(Choices) : "Attack type" =
0 : "Default (grenade)"
1 : "Flak Ogre (Marcher, Quoth)"
2 : "sniper (shoots single, deadly lava round)"
3 : "multi-grenade (Mission Pack 2)"

keep_ammo(integer) : "1 = Don't drop backpack upon death"
snd_death(string) : "Path to custom death sound"
snd_pain(string) : "Path to custom pain sound"
snd_sight(string) : "Path to custom sight sound"
snd_attack(string) : "Path to custom attack sound (CHAINSAW)"
snd_idle(string) : "Path to custom idle sound (IDLE)"
snd_misc(string) : "Path to custom sound (IDLE CHAINSAW DRAG)"
snd_misc1(string) : "Path to custom sound (ATTACK GRUNT)"

mdl_head(string) : "Path to custom head model"
mdl_body(string) : "Path to custom body model"
mdl_proj(string) : "Path to custom projectile model"
skin_head(float) : "Skin index of custom head model"
skin_proj(float) : "Skin index of custom projectile model"
mdl_gib1(string) : "Path to custom 1st gib model"
mdl_gib2(string) : "Path to custom 2nd gib model"
mdl_gib3(string) : "Path to custom 3rd gib model"

effects(choices) : "Add a visual effect to an entity"
0 : "None (Default)"
1 : "Brightfield (yellow particles)"
4 : "Bright light"
8 : "Dim light"

berserk(choices) "Skips certain pain animations similar to skill 3 (Makes a semi-nightmare monster!)"
0 : "Off (Default)"
1 : "Berserk (skip pain animations)"

delay(float) : "Delay spawn in for this amount of time"

wait(choices) : "Play an effect when trigger spawned?"
0 : "Teleport Effects (Default)"
1 : "Spawn Silently"

spawn_angry(Choices)
0 : "Only when trigger spawned, default behavior - not angry"
1 : "Only when trigger spawned, set to 1 to spawn angry at player"

infight_mode(Choices)
0 : "Default behavior, only with different classnames"
1 : "Infight with monsters with the same classname but a different mdl_body"
2 : "Infight with monsters with the same classname and model but a different skin"
3 : "Infight no matter what"

health(integer) : "Set this to a custom health amount"
pain_target(string) : "Fire this target when pain_threshold is reached"
pain_threshold(integer) : "Fire pain_target when health drops below this amount"
sight_trigger(integer) : "1 = Fire target upon seeing the player instead of death"
skin(integer) : "Skin index (default 0) Use this when your custom model has more than one skin to select"
obit_name(string) : "When used with obit_method, this will set part of the text for a custom obituary. e.g. a Super Soldier! Using the examples here, the obituary would read: Player was eviscerated by a Super Solider!"
obit_method(string) : "When used with obit_name, will set part of the text for a custom obituary. e.g. eviscerated - If empty, defaults to killed."
damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by this number (e.g. 4 = Quad damage)"

*/
//----------------------------------------------------------------------
// class monster_ogre: base_walkmonster
// {
//--------------------------------------------------------------
void() monster_ogre_sightsound =
{
sound_sight (self, CHAN_VOICE, "ogre/ogwake.wav",
VOL_HIGH, ATTN_NORM);
};

//--------------------------------------------------------------
// OgreCheckAttack
// The player is in view, so decide to move or launch an attack
// Returns FALSE if movement should continue
//--------------------------------------------------------------
float() monster_ogre_checkattack =
{
local vector spot1, spot2;
local entity targ;
local float chance;

// dprint("OgreCheckAttack\n");
// dumptruck_ds
if (self.spawnflags & I_AM_TURRET)
{
self.attack_state = AS_MISSILE;
sub_attackfinished (2 + 2 * random());
return TRUE;
}

enemy_range = ai_range (self.enemy);

if (enemy_range == RANGE_MELEE)
{
if (can_damage(self, self.enemy))
{
self.attack_state = AS_MELEE;
return TRUE;
}
}

if (time < self.attack_finished)
return FALSE;

if (!enemy_vis)
return FALSE;

targ = self.enemy;

// see if any entities are in the way of the shot
spot1 = self.origin + self.view_ofs;
spot2 = targ.origin + targ.view_ofs;

traceline (spot1, spot2, FALSE, self);

if (trace_inopen && trace_inwater)
// sight line crossed contents
return FALSE;

if ((self.spawnflags & I_AM_TURRET) && (trace_ent != targ))
{
// dprint("trace_ent...\n");
self.attack_state = AS_TURRET;
return FALSE;
}

if (trace_ent != targ)
// don't have a clear shot
return FALSE;

// missile attack
if (time < self.attack_finished)
return FALSE;

if (enemy_range == RANGE_FAR)
return FALSE;
else if (enemy_range == RANGE_NEAR)
chance = 0.10;
else if (enemy_range == RANGE_MID)
chance = 0.05;
else
chance = 0;

self.attack_state = AS_MISSILE;
sub_attackfinished (1 + 2 * random());
return TRUE;
};

//--------------------------------------------------------------
// OgreFireSpike from insideqc tutorial here:
// http://www.insideqc.com/qctut/lesson-33.shtml
//--------------------------------------------------------------
void() monster_ogre_fire_spike =
{
sound (self, CHAN_WEAPON, "weapons/spike2.wav",
VOL_HIGH, ATTN_NORM);
self.effects = self.effects | EF_MUZZLEFLASH;

self.attack_finished = time + 0.7;
// self.attack_finished = time + 0.2;
// -- dumptruck_ds

// when was makevectors last called? -- CEV
makevectors (self.angles);
base_monster_fire_spike (
self.origin + v_right * 4 + '0 0 16',
self.enemy.origin - self.origin,
SPIKE_DUPER_DAMAGE,
SPIKE_SPEED);
};

//--------------------------------------------------------------
// OgreFireLavaBall by jaycie erysdren 2021-09-14
//--------------------------------------------------------------
void() monster_ogre_fire_lavaball =
{
makevectors (vectoangles(self.enemy.origin - self.origin));

self.effects = self.effects | EF_MUZZLEFLASH;
sound_attack (self, CHAN_AUTO, "boss1/throw.wav",
VOL_HIGH, ATTN_NORM);

// damage should be 40, 40 -- TODO CEV
// custom lavaball speed -- CEV
base_monster_fire_lavaball (
self.origin + v_right * 4 + '0 0 16',
self.enemy.origin - self.origin, 600);
};

//--------------------------------------------------------------
void() monster_ogre_attack_ranged =
{
switch (self.style)
{
case 0:
// default ogre firing behavior -- CEV
if (enemy_range < RANGE_MID)
base_monster_fire_flak (
self.origin + '0 0 16', 800);
else
base_monster_fire_tribolt ();
break;
case 1:
base_monster_fire_flak (
self.origin + '0 0 16', 800);
break;
case 2:
monster_ogre_fire_spike ();
break;
case 3:
base_monster_fire_multigrenade ();
break;
case 4:
monster_ogre_fire_lavaball ();
// used for initial attack sound dumptruck_ds
sound_misc2 (self, CHAN_WEAPON,
"shalrath/attack2.wav",
VOL_HIGH, ATTN_NORM);
break;
}
};

//--------------------------------------------------------------
// chainsaw -- FIXME
//--------------------------------------------------------------
void(float side) monster_ogre_attack_chainsaw =
{
local vector delta;
local float ldmg;

if (!self.enemy)
return;
if (!can_damage(self, self.enemy))
return;

ai_charge (10);

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

if (vlen(delta) > 100)
return;

ldmg = (random() + random() + random()) * 4;
t_damage2 (self.enemy, self, self, ldmg);

if (side)
{
makevectors (self.angles);
if (side == 1)
spawn_meatspray (self.origin + v_forward * 16,
crandom() * 100 * v_right);
else
spawn_meatspray (self.origin + v_forward * 16,
side * v_right);
}
};

//--------------------------------------------------------------
// ogre_melee
//--------------------------------------------------------------
void() monster_ogre_attack_melee =
{
if (random() > 0.5)
ogre_smash1 ();
else
ogre_swing1 ();
};

//--------------------------------------------------------------
// Ogre Standing functions
//--------------------------------------------------------------
void() ogre_stand1 = [$stand1, ogre_stand2] { ai_stand (); };
void() ogre_stand2 = [$stand2, ogre_stand3] { ai_stand (); };
void() ogre_stand3 = [$stand3, ogre_stand4] { ai_stand (); };
void() ogre_stand4 = [$stand4, ogre_stand5] { ai_stand (); };
void() ogre_stand5 = [$stand5, ogre_stand6]
{
if (random() < 0.2)
sound_idle (self, CHAN_VOICE, "ogre/ogidle.wav",
VOL_HIGH, ATTN_IDLE);
ai_stand ();
};
void() ogre_stand6 = [$stand6, ogre_stand7] { ai_stand (); };
void() ogre_stand7 = [$stand7, ogre_stand8] { ai_stand (); };
void() ogre_stand8 = [$stand8, ogre_stand9] { ai_stand (); };
void() ogre_stand9 = [$stand9, ogre_stand1] { ai_stand (); };

//--------------------------------------------------------------
// Ogre Walking functions
//--------------------------------------------------------------
void() ogre_walk1 = [$walk1, ogre_walk2] { ai_walk (3); };
void() ogre_walk2 = [$walk2, ogre_walk3] { ai_walk (2); };
void() ogre_walk3 = [$walk3, ogre_walk4]
{
ai_walk (2);
if (random() < 0.2)
sound_idle (self, CHAN_VOICE, "ogre/ogidle.wav",
VOL_HIGH, ATTN_IDLE);
};
void() ogre_walk4 = [$walk4, ogre_walk5] { ai_walk (2); };
void() ogre_walk5 = [$walk5, ogre_walk6] { ai_walk (2); };
void() ogre_walk6 = [$walk6, ogre_walk7]
{
ai_walk (5);
if (random() < 0.1)
sound_misc (self, CHAN_VOICE, "ogre/ogdrag.wav",
VOL_HIGH, ATTN_IDLE);
};
void() ogre_walk7 = [$walk7, ogre_walk8] { ai_walk (3); };
void() ogre_walk8 = [$walk8, ogre_walk9] { ai_walk (2); };
void() ogre_walk9 = [$walk9, ogre_walk10] { ai_walk (3); };
void() ogre_walk10 = [$walk10, ogre_walk11] { ai_walk (1); };
void() ogre_walk11 = [$walk11, ogre_walk12] { ai_walk (2); };
void() ogre_walk12 = [$walk12, ogre_walk13] { ai_walk (3); };
void() ogre_walk13 = [$walk13, ogre_walk14] { ai_walk (3); };
void() ogre_walk14 = [$walk14, ogre_walk15] { ai_walk (3); };
void() ogre_walk15 = [$walk15, ogre_walk16] { ai_walk (3); };
void() ogre_walk16 = [$walk16, ogre_walk1] { ai_walk (4); };

//--------------------------------------------------------------
// Ogre Running functions
//--------------------------------------------------------------
void() ogre_run1 = [$run1, ogre_run2]
{
ai_run (9);
if (random() < 0.2)
sound_misc1 (self, CHAN_VOICE, "ogre/ogidle2.wav",
VOL_HIGH, ATTN_IDLE);
};
void() ogre_run2 = [$run2, ogre_run3] { ai_run (12); };
void() ogre_run3 = [$run3, ogre_run4] { ai_run (8); };
void() ogre_run4 = [$run4, ogre_run5] { ai_run (22); };
void() ogre_run5 = [$run5, ogre_run6] { ai_run (16); };
void() ogre_run6 = [$run6, ogre_run7] { ai_run (4); };
void() ogre_run7 = [$run7, ogre_run8] { ai_run (13); };
void() ogre_run8 = [$run8, ogre_run1] { ai_run (24); };

//--------------------------------------------------------------
// Ogre Smash Attack
//--------------------------------------------------------------
void() ogre_smash1 = [$smash1, ogre_smash2]
{
ai_charge (6);
sound_attack (self, CHAN_WEAPON, "ogre/ogsawatk.wav",
VOL_HIGH, ATTN_NORM);
};
void() ogre_smash2 = [$smash2, ogre_smash3] { ai_charge (0); };
void() ogre_smash3 = [$smash3, ogre_smash4] { ai_charge (0); };
void() ogre_smash4 = [$smash4, ogre_smash5] { ai_charge (1); };
void() ogre_smash5 = [$smash5, ogre_smash6] { ai_charge (4); };
void() ogre_smash6 = [$smash6, ogre_smash7]
{
ai_charge (4);
monster_ogre_attack_chainsaw (0);
};
void() ogre_smash7 = [$smash7, ogre_smash8]
{
ai_charge (4);
monster_ogre_attack_chainsaw (0);
};
void() ogre_smash8 = [$smash8, ogre_smash9]
{
ai_charge (10);
monster_ogre_attack_chainsaw (0);
};
void() ogre_smash9 = [$smash9, ogre_smash10]
{
ai_charge (13);
monster_ogre_attack_chainsaw (0);
};
void() ogre_smash10 = [$smash10, ogre_smash11]
{
monster_ogre_attack_chainsaw(1);
};
void() ogre_smash11 = [$smash11, ogre_smash12]
{
ai_charge (2);
monster_ogre_attack_chainsaw (0);
// slight variation
// self.nextthink = self.nextthink + random()*0.2;};
// 1998-08-14 Incorrect setting of nextthink fix
// by Maddes/Lord Sméagol
self.nextthink = time + 0.1 + random() * 0.2;
};
void() ogre_smash12 = [$smash12, ogre_smash13] { ai_charge (0); };
void() ogre_smash13 = [$smash13, ogre_smash14] { ai_charge (4); };
void() ogre_smash14 = [$smash14, ogre_run1] { ai_charge (12); };

//--------------------------------------------------------------
// Ogre Swing Attack
//--------------------------------------------------------------
void() ogre_swing1 = [$swing1, ogre_swing2]
{
ai_charge (11);
sound_attack (self, CHAN_WEAPON, "ogre/ogsawatk.wav",
VOL_HIGH, ATTN_NORM);
};
void() ogre_swing2 = [$swing2, ogre_swing3] { ai_charge (1); };
void() ogre_swing3 = [$swing3, ogre_swing4] { ai_charge (4); };
void() ogre_swing4 = [$swing4, ogre_swing5] { ai_charge (13); };
void() ogre_swing5 = [$swing5, ogre_swing6]
{
ai_charge (9);
monster_ogre_attack_chainsaw (0);
self.angles_y = self.angles_y + random() * 25;
};
void() ogre_swing6 = [$swing6, ogre_swing7]
{
monster_ogre_attack_chainsaw (200);
self.angles_y = self.angles_y + random() * 25;
};
void() ogre_swing7 = [$swing7, ogre_swing8]
{
monster_ogre_attack_chainsaw (0);
self.angles_y = self.angles_y + random() * 25;
};
void() ogre_swing8 = [$swing8, ogre_swing9]
{
monster_ogre_attack_chainsaw (0);
self.angles_y = self.angles_y + random() * 25;
};
void() ogre_swing9 = [$swing9, ogre_swing10]
{
monster_ogre_attack_chainsaw (0);
self.angles_y = self.angles_y + random() * 25;
};
void() ogre_swing10 = [$swing10, ogre_swing11]
{
monster_ogre_attack_chainsaw (-200);
self.angles_y = self.angles_y + random() * 25;
};
void() ogre_swing11 = [$swing11, ogre_swing12]
{
monster_ogre_attack_chainsaw (0);
self.angles_y = self.angles_y + random() * 25;
};
void() ogre_swing12 = [$swing12, ogre_swing13] { ai_charge (3); };
void() ogre_swing13 = [$swing13, ogre_swing14] { ai_charge (8); };
void() ogre_swing14 = [$swing14, ogre_run1] { ai_charge (9); };

//--------------------------------------------------------------
// Ogre Projectile Attack
//--------------------------------------------------------------
void() ogre_nail1 = [$shoot1, ogre_nail2]
{
ai_face ();
self.attack_elevation = preach_iterate_elevation (
OGRE_DEFAULT_ELEVATION, BOLT_SPEED,
self.origin, self.enemy.origin);
};
void() ogre_nail2 = [$shoot2, ogre_nail3]
{
ai_face ();
self.attack_elevation = preach_iterate_elevation (
self.attack_elevation, BOLT_SPEED,
self.origin, self.enemy.origin);
};
void() ogre_nail3 = [$shoot2, ogre_nail4]
{
ai_face ();
self.attack_elevation = preach_iterate_elevation (
self.attack_elevation, BOLT_SPEED,
self.origin, self.enemy.origin);
};
void() ogre_nail4 = [$shoot3, ogre_nail5]
{
ai_face ();
monster_ogre_attack_ranged ();
};
void() ogre_nail5 = [$shoot4, ogre_nail6] { ai_face (); };
void() ogre_nail6 = [$shoot5, ogre_nail7] { ai_face (); };
void() ogre_nail7 = [$shoot6, ogre_run1] { ai_face (); };

/////////////////////////
// turret frames START //
/////////////////////////

//--------------------------------------------------------------
// Ogre Turret Attack
//--------------------------------------------------------------
void() ogre_tur_atk1 = [$shoot1, ogre_tur_atk2]
{
ai_face ();
self.attack_elevation = preach_iterate_elevation (
OGRE_DEFAULT_ELEVATION, BOLT_SPEED,
self.origin, self.enemy.origin);
};
void() ogre_tur_atk2 = [$shoot2, ogre_tur_atk3]
{
ai_face ();
self.attack_elevation = preach_iterate_elevation (
self.attack_elevation, BOLT_SPEED,
self.origin, self.enemy.origin);
};
void() ogre_tur_atk3 = [$shoot2, ogre_tur_atk4]
{
ai_face ();
self.attack_elevation = preach_iterate_elevation (
self.attack_elevation, BOLT_SPEED,
self.origin, self.enemy.origin);
};
void() ogre_tur_atk4 = [$shoot3, ogre_tur_atk5]
{
ai_face ();
monster_ogre_attack_ranged ();
};
void() ogre_tur_atk5 = [$shoot4, ogre_tur_atk6] { ai_face (); };
void() ogre_tur_atk6 = [$shoot5, ogre_tur_atk7] { ai_face (); };
void() ogre_tur_atk7 = [$shoot5, ogre_tur_atk8] { ai_face (); };
void() ogre_tur_atk8 = [$shoot6, ogre_tur_atk9] { ai_face (); };
void() ogre_tur_atk9 = [$shoot6, ogre_tur_seek1] { ai_face (); };

//--------------------------------------------------------------
// Ogre Turret Seek / Stand
//--------------------------------------------------------------
void() ogre_tur_seek1 = [$stand1, ogre_tur_seek2] { ai_run (0); };
void() ogre_tur_seek2 = [$stand2, ogre_tur_seek3] { ai_run (0); };
void() ogre_tur_seek3 = [$stand3, ogre_tur_seek4] { ai_run (0); };
void() ogre_tur_seek4 = [$stand4, ogre_tur_seek5] { ai_run (0); };
void() ogre_tur_seek5 = [$stand5, ogre_tur_seek6]
{
if (random() < 0.2)
sound_idle (self, CHAN_VOICE, "ogre/ogidle.wav",
VOL_HIGH, ATTN_IDLE);
ai_run (0);
};
void() ogre_tur_seek6 = [$stand6, ogre_tur_seek7] { ai_run (0); };
void() ogre_tur_seek7 = [$stand7, ogre_tur_seek8] { ai_run (0); };
void() ogre_tur_seek8 = [$stand8, ogre_tur_seek9] { ai_run (0); };
void() ogre_tur_seek9 = [$stand9, ogre_tur_seek1] { ai_run (0); };

/////////////////////////
// turret frames END //
/////////////////////////

//--------------------------------------------------------------
// Ogre Pain state A
//--------------------------------------------------------------
void() ogre_pain1 = [$pain1, ogre_pain2] { };
void() ogre_pain2 = [$pain2, ogre_pain3] { };
void() ogre_pain3 = [$pain3, ogre_pain4] { };
void() ogre_pain4 = [$pain4, ogre_pain5] { };
void() ogre_pain5 = [$pain5, ogre_run1] { };

//--------------------------------------------------------------
// Ogre Pain state B
//--------------------------------------------------------------
void() ogre_painb1 = [$painb1, ogre_painb2] { };
void() ogre_painb2 = [$painb2, ogre_painb3] { };
void() ogre_painb3 = [$painb3, ogre_run1] { };

//--------------------------------------------------------------
// Ogre Pain state C
//--------------------------------------------------------------
void() ogre_painc1 = [$painc1, ogre_painc2] { };
void() ogre_painc2 = [$painc2, ogre_painc3] { };
void() ogre_painc3 = [$painc3, ogre_painc4] { };
void() ogre_painc4 = [$painc4, ogre_painc5] { };
void() ogre_painc5 = [$painc5, ogre_painc6] { };
void() ogre_painc6 = [$painc6, ogre_run1] { };

//--------------------------------------------------------------
// Ogre Pain state D
//--------------------------------------------------------------
void() ogre_paind1 = [$paind1, ogre_paind2] { };
void() ogre_paind2 = [$paind2, ogre_paind3] { ai_pain (10); };
void() ogre_paind3 = [$paind3, ogre_paind4] { ai_pain (9); };
void() ogre_paind4 = [$paind4, ogre_paind5] { ai_pain (4); };
void() ogre_paind5 = [$paind5, ogre_paind6] { };
void() ogre_paind6 = [$paind6, ogre_paind7] { };
void() ogre_paind7 = [$paind7, ogre_paind8] { };
void() ogre_paind8 = [$paind8, ogre_paind9] { };
void() ogre_paind9 = [$paind9, ogre_paind10] { };
void() ogre_paind10 = [$paind10, ogre_paind11] { };
void() ogre_paind11 = [$paind11, ogre_paind12] { };
void() ogre_paind12 = [$paind12, ogre_paind13] { };
void() ogre_paind13 = [$paind13, ogre_paind14] { };
void() ogre_paind14 = [$paind14, ogre_paind15] { };
void() ogre_paind15 = [$paind15, ogre_paind16] { };
void() ogre_paind16 = [$paind16, ogre_run1] { };

//--------------------------------------------------------------
// Ogre Pain state E
//--------------------------------------------------------------
void() ogre_paine1 = [$paine1, ogre_paine2] { };
void() ogre_paine2 = [$paine2, ogre_paine3] { ai_pain (10); };
void() ogre_paine3 = [$paine3, ogre_paine4] { ai_pain (9); };
void() ogre_paine4 = [$paine4, ogre_paine5] { ai_pain (4); };
void() ogre_paine5 = [$paine5, ogre_paine6] { };
void() ogre_paine6 = [$paine6, ogre_paine7] { };
void() ogre_paine7 = [$paine7, ogre_paine8] { };
void() ogre_paine8 = [$paine8, ogre_paine9] { };
void() ogre_paine9 = [$paine9, ogre_paine10] { };
void() ogre_paine10 = [$paine10, ogre_paine11] { };
void() ogre_paine11 = [$paine11, ogre_paine12] { };
void() ogre_paine12 = [$paine12, ogre_paine13] { };
void() ogre_paine13 = [$paine13, ogre_paine14] { };
void() ogre_paine14 = [$paine14, ogre_paine15] { };
void() ogre_paine15 = [$paine15, ogre_run1] { };

//--------------------------------------------------------------
// Ogre Death state A
//--------------------------------------------------------------
void() ogre_die1 = [$death1, ogre_die2]
{
base_entity_aligntoground (self);
};
void() ogre_die2 = [$death2, ogre_die3] { };
void() ogre_die3 = [$death3, ogre_die4]
{
self.solid = SOLID_NOT;

// style ammotype check -- dumptruck_ds
if (self.style == 1)
{
// flak style
self.ammo_nails = 5;
}
if (self.style == 2)
{
// super nail style
self.ammo_nails = 5;
}
if (self.style == 3)
{
// DOE multi-grenade
self.ammo_rockets = 2;
}
else if (self.style == 0)
{
// default Ogre
self.ammo_rockets = 2;
}
if (!self.keep_ammo)
item_backpack_drop (self);
};
void() ogre_die4 = [$death4, ogre_die5] { };
void() ogre_die5 = [$death5, ogre_die6] { };
void() ogre_die6 = [$death6, ogre_die7] { };
void() ogre_die7 = [$death7, ogre_die8] { };
void() ogre_die8 = [$death8, ogre_die9] { };
void() ogre_die9 = [$death9, ogre_die10] { };
void() ogre_die10 = [$death10, ogre_die11] { };
void() ogre_die11 = [$death11, ogre_die12] { };
void() ogre_die12 = [$death12, ogre_die13] { };
void() ogre_die13 = [$death13, ogre_die14]
{
become_base_corpse (self, OGRE_HEALTH_CORPSE);
setsize (self, OGRE_CORPSE_Z_MINS, OGRE_CORPSE_Z_MAXS);
};
void() ogre_die14 = [$death14, ogre_die14] { };

//--------------------------------------------------------------
// Ogre Death state B
//--------------------------------------------------------------
void() ogre_bdie1 = [$bdeath1, ogre_bdie2]
{
base_entity_aligntoground (self);
};
void() ogre_bdie2 = [$bdeath2, ogre_bdie3] { ai_forward (5); };
void() ogre_bdie3 = [$bdeath3, ogre_bdie4]
{
self.solid = SOLID_NOT;

// style ammotype check -- dumptruck_ds
if (self.style == 1)
{
self.ammo_nails = 5;
}
if (self.style == 2)
{
self.ammo_nails = 5;
}
if (self.style == 3)
{
// DOE multi-grenade
self.ammo_rockets = 2;
}
if (self.style == 4)
{
// lavaball ogre jaycie erysdren 2021-09-14
self.ammo_rockets = 2;
}
else if (self.style == 0)
{
self.ammo_rockets = 2;
}
if(!self.keep_ammo)
item_backpack_drop (self);
};
void() ogre_bdie4 = [$bdeath4, ogre_bdie5] { ai_forward (1); };
void() ogre_bdie5 = [$bdeath5, ogre_bdie6] { ai_forward (3); };
void() ogre_bdie6 = [$bdeath6, ogre_bdie7] { ai_forward (7); };
void() ogre_bdie7 = [$bdeath7, ogre_bdie8] { ai_forward (25); };
void() ogre_bdie8 = [$bdeath8, ogre_bdie9] { };
void() ogre_bdie9 = [$bdeath9, ogre_bdie10]
{
become_base_corpse (self, OGRE_HEALTH_CORPSE);
setsize (self, OGRE_CORPSE_Z_MINS, OGRE_CORPSE_Z_MAXS);
};
void() ogre_bdie10 = [$bdeath10, ogre_bdie10] { };

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

//--------------------------------------------------------------
// ogre_pain
//--------------------------------------------------------------
void(entity attacker, float damage) monster_ogre_pain =
{
local float r;

// don't make multiple pain sounds right after each other
if (self.pain_finished > time)
return;

if (self.spawnflags & I_AM_TURRET)
return;

sound_pain (self, CHAN_VOICE, "ogre/ogpain1.wav",
VOL_HIGH, ATTN_NORM);

r = random();

if (r < 0.25)
{
ogre_pain1 ();
self.pain_finished = time + 1;
}
else if (r < 0.5)
{
ogre_painb1 ();
self.pain_finished = time + 1;
}
else if (r < 0.75)
{
ogre_painc1 ();
self.pain_finished = time + 1;
}
else if (r < 0.88)
{
ogre_paind1 ();
self.pain_finished = time + 2;
}
else
{
ogre_paine1 ();
self.pain_finished = time + 2;
}
};

//--------------------------------------------------------------
// ogre_die
//--------------------------------------------------------------
void(vector dir) monster_ogre_destroy =
{
// check if we're dead already
if (self.classgroup & CG_CORPSE)
{
sound (self, CHAN_VOICE, "player/udeath.wav",
VOL_HIGH, ATTN_NORM);

throw_gib_head_ogre (self, dir, self.health);

// custom models -- dumptruck_ds
if (self.mdl_gib1 != "")
throw_gib_1 (self, dir, self.health);
else
throw_gib_3 (self, dir, self.health);

if (self.mdl_gib2 != "")
throw_gib_2 (self, dir, self.health);
else
throw_gib_3 (self, dir, self.health);

if (self.mdl_gib3 != "")
throw_gib_3 (self, dir, self.health);
else
throw_gib_3 (self, dir, self.health);

return;
}

// check for gib
if (self.health < -80)
{
sound (self, CHAN_VOICE, "player/udeath.wav",
VOL_HIGH, ATTN_NORM);

throw_gib_head_ogre (self, dir, self.health);

// custom models -- dumptruck_ds
if (self.mdl_gib1 != "")
throw_gib_1 (self, dir, self.health);
else
throw_gib_3 (self, dir, self.health);

if (self.mdl_gib2 != "")
throw_gib_2 (self, dir, self.health);
else
throw_gib_3 (self, dir, self.health);

if (self.mdl_gib3 != "")
throw_gib_3 (self, dir, self.health);
else
throw_gib_3 (self, dir, self.health);

base_item_drop_stuff (self);
return;
}

sound_death (self, CHAN_VOICE, "ogre/ogdth.wav",
VOL_HIGH, ATTN_NORM);

base_item_drop_stuff (self);
if (random() < 0.5)
ogre_die1 ();
else
ogre_bdie1 ();
};

//==============================================================
// Initialization
//==============================================================

//--------------------------------------------------------------
entity(vector org, vector ang, float sflags, float yaw, float angry)
spawn_monster_ogre =
{
return spawn_base_monster (org, ang, sflags, yaw, angry,
monster_ogre_init);
};

//--------------------------------------------------------------
void(entity e) monster_ogre_init =
{
if (deathmatch)
{
remove (e);
return;
}

// let subclasses override classtype -- CEV
e.classname = "monster_ogre";
e.classtype = CT_MONSTER_OGRE;

// custom_mdls dumptruck_ds
precache_body_model (e, "progs/ogre.mdl");
precache_head_model (e, "progs/h_ogre.mdl");
precache_proj_model (e, "progs/grenade.mdl");

// custom_mdls dumptruck_ds
// for style 3 Orge dumptruck_ds
precache_model ("progs/mervup.mdl");
// for style 2 Ogre dumptruck_ds
precache_model ("progs/lspike.mdl");
precache_sound_misc (e, "ogre/ogdrag.wav");
precache_sound_death (e, "ogre/ogdth.wav");
precache_sound_idle (e, "ogre/ogidle.wav");
precache_sound_misc1 (e, "ogre/ogidle2.wav");
precache_sound_pain (e, "ogre/ogpain1.wav");
precache_sound_attack (e, "ogre/ogsawatk.wav");
precache_sound_sight (e, "ogre/ogwake.wav");
precache_sound_misc2 (e, "shalrath/attack2.wav");
precache_sound ("fish/bite.wav");
// jaycie erysdren 2021-09-14
precache_sound ("boss1/throw.wav");

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

e.solid = SOLID_SLIDEBOX;
e.movetype = MOVETYPE_STEP;

// custom_mdls dumptruck_ds
body_model (e, "progs/ogre.mdl");
// setmodel (e, "progs/ogre.mdl");

setsize (e, VEC_HULL2_MIN, VEC_HULL2_MAX);

if (!e.proj_speed_mod)
e.proj_speed_mod = 1;

// thanks RennyC -- dumptruck_ds
if (!e.health)
e.health = OGRE_HEALTH;

e.checkattack = monster_ogre_checkattack;
e.sightsound = monster_ogre_sightsound;
e.th_stand = ogre_stand1;
e.th_walk = ogre_walk1;
if (e.spawnflags & I_AM_TURRET)
e.th_run = ogre_tur_seek1;
else
e.th_run = ogre_run1;
e.destroy = monster_ogre_destroy;
e.th_melee = monster_ogre_attack_melee;
e.th_missile = ogre_nail1;
// dumptruck_ds
e.th_turret = ogre_tur_atk1;
// Berserk test from
// http://celephais.net/board/view_thread.php?id=4&start=3465
// -- dumptruck_ds
if !(e.berserk)
e.th_pain = monster_ogre_pain;
else
e.th_pain = sub_nullpain;

// walkmonster_start
base_walkmonster_init (e);
};

//--------------------------------------------------------------
void() monster_ogre =
{
// new spawnflags for all entities -- iw
if (SUB_Inhibit())
return;

monster_ogre_init (self);
};
// };

//----------------------------------------------------------------------
// OGRE MARKSMAN
//----------------------------------------------------------------------

/*QUAKED monster_ogre_marksman (1 0 0) (-32 -32 -24) (32 32 64) 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/ogre.mdl", "frame": 63 });
}
Ogre Marksman.
Unlike vanilla Quake, this is a slightly more accurate Orge.

keep_ammo(integer) : "1 = Don't drop backpack upon death"
snd_death(string) : "Path to custom death sound"
snd_pain(string) : "Path to custom pain sound"
snd_sight(string) : "Path to custom sight sound"
snd_attack(string) : "Path to custom attack sound (CHAINSAW)"
snd_idle(string) : "Path to custom idle sound (IDLE)"
snd_misc(string) : "Path to custom sound (IDLE CHAINSAW DRAG)"
snd_misc1(string) : "Path to custom sound (ATTACK GRUNT)"

mdl_head(string) : "Path to custom head model"
mdl_body(string) : "Path to custom body model"
mdl_proj(string) : "Path to custom projectile model"
skin_head(float) : "Skin index of custom head model"
skin_proj(float) : "Skin index of custom projectile model"
mdl_gib1(string) : "Path to custom 1st gib model"
mdl_gib2(string) : "Path to custom 2nd gib model"
mdl_gib3(string) : "Path to custom 3rd gib model"

effects(choices) : "Add a visual effect to an entity"
0 : "None (Default)"
1 : "Brightfield (yellow particles)"
4 : "Bright light"
8 : "Dim light"

berserk(choices) "Skips certain pain animations similar to skill 3 (Makes a semi-nightmare monster!)"
0 : "Off (Default)"
1 : "Berserk (skip pain animations)"

delay(float) : "Delay spawn in for this amount of time"

wait(choices) : "Play an effect when trigger spawned?"
0 : "Teleport Effects (Default)"
1 : "Spawn Silently"

spawn_angry(Choices)
0 : "Only when trigger spawned, default behavior - not angry"
1 : "Only when trigger spawned, set to 1 to spawn angry at player"

infight_mode(Choices)
0 : "Default behavior, only with different classnames"
1 : "Infight with monsters with the same classname but a different mdl_body"
2 : "Infight with monsters with the same classname and model but a different skin"
3 : "Infight no matter what"

health(integer) : "Set this to a custom health amount"
pain_target(string) : "Fire this target when pain_threshold is reached"
pain_threshold(integer) : "Fire pain_target when health drops below this amount"
sight_trigger(integer) : "1 = Fire target upon seeing the player instead of death"
skin(integer) : "Skin index (default 0) Use this when your custom model has more than one skin to select"
obit_name(string) : "When used with obit_method, this will set part of the text for a custom obituary. e.g. a Super Soldier! Using the examples here, the obituary would read: Player was eviscerated by a Super Solider!"
obit_method(string) : "When used with obit_name, will set part of the text for a custom obituary. e.g. eviscerated - If empty, defaults to killed."
damage_mod(float) : "USE WITH CAUTION! Multiply all damage from this monster by this number (e.g. 4 = Quad damage)"

*/
//----------------------------------------------------------------------
// class monster_ogre_marksman: monster_ogre
// {
// Preach tutorial alternate animation frames for
// monster_ogre_marksman -- dumptruck_ds

//--------------------------------------------------------------
// Ogre2 Nail frames
//--------------------------------------------------------------
void() ogre_mm_nail1 = [$shoot1, ogre_mm_nail2]
{
ai_face ();
self.attack_elevation = preach_iterate_elevation (
OGRE_DEFAULT_ELEVATION, GRENADE_SPEED,
self.origin, self.enemy.origin);
};
void() ogre_mm_nail2 = [$shoot2, ogre_mm_nail3]
{
ai_face ();
self.attack_elevation = preach_iterate_elevation (
self.attack_elevation, GRENADE_SPEED,
self.origin, self.enemy.origin);
};
void() ogre_mm_nail3 = [$shoot2, ogre_mm_nail4]
{
ai_face ();
self.attack_elevation = preach_iterate_elevation (
self.attack_elevation, GRENADE_SPEED,
self.origin, self.enemy.origin);
};
void() ogre_mm_nail4 = [$shoot3, ogre_nail5]
{
ai_face ();
base_monster_fire_grenade (
self.origin, 40, 40, self.attack_elevation);
};

// these are for the turret version of monster_ogre_marksman

//--------------------------------------------------------------
// Ogre2 Turret Attack
//--------------------------------------------------------------
void() ogre_mm_t_atk1 = [$shoot1, ogre_mm_t_atk2]
{
ai_face ();
self.attack_elevation = preach_iterate_elevation (
OGRE_DEFAULT_ELEVATION, GRENADE_SPEED,
self.origin, self.enemy.origin);
};
void() ogre_mm_t_atk2 = [$shoot2, ogre_mm_t_atk3]
{
ai_face ();
self.attack_elevation = preach_iterate_elevation (
self.attack_elevation, GRENADE_SPEED,
self.origin, self.enemy.origin);
};
void() ogre_mm_t_atk3 = [$shoot2, ogre_mm_t_atk4]
{
ai_face ();
self.attack_elevation = preach_iterate_elevation (
self.attack_elevation, GRENADE_SPEED,
self.origin, self.enemy.origin);
};
void() ogre_mm_t_atk4 = [$shoot3, ogre_mm_t_atk5]
{
ai_face ();
base_monster_fire_grenade (
self.origin, 40, 40, self.attack_elevation);
};
void() ogre_mm_t_atk5 = [$shoot4, ogre_mm_t_atk6] { ai_face (); };
void() ogre_mm_t_atk6 = [$shoot5, ogre_mm_t_atk7] { ai_face (); };
void() ogre_mm_t_atk7 = [$shoot5, ogre_mm_t_atk8] { ai_face (); };
void() ogre_mm_t_atk8 = [$shoot6, ogre_mm_t_atk9] { ai_face (); };
void() ogre_mm_t_atk9 = [$shoot6, ogre_mm_t_seek1] { ai_face (); };

//--------------------------------------------------------------
// Ogre2 Turret Seek / Stand
//--------------------------------------------------------------
void() ogre_mm_t_seek1 = [$stand1, ogre_mm_t_seek2] { ai_run (0); };
void() ogre_mm_t_seek2 = [$stand2, ogre_mm_t_seek3] { ai_run (0); };
void() ogre_mm_t_seek3 = [$stand3, ogre_mm_t_seek4] { ai_run (0); };
void() ogre_mm_t_seek4 = [$stand4, ogre_mm_t_seek5] { ai_run (0); };
void() ogre_mm_t_seek5 = [$stand5, ogre_mm_t_seek6]
{
if (random() < 0.2)
sound_idle (self, CHAN_VOICE, "ogre/ogidle.wav",
VOL_HIGH, ATTN_IDLE);
ai_run (0);
};
void() ogre_mm_t_seek6 = [$stand6, ogre_mm_t_seek7] { ai_run (0); };
void() ogre_mm_t_seek7 = [$stand7, ogre_mm_t_seek8] { ai_run (0); };
void() ogre_mm_t_seek8 = [$stand8, ogre_mm_t_seek9] { ai_run (0); };
void() ogre_mm_t_seek9 = [$stand9, ogre_mm_t_seek1] { ai_run (0); };

// end Preach -- dumptruck_ds

//==============================================================
// Initialization
//==============================================================

//--------------------------------------------------------------
void(entity e) monster_ogre_marksman_init =
{
if (deathmatch)
{
remove (e);
return;
}

e.classname = "monster_ogre_marksman";
e.classtype = CT_MONSTER_OGRE_MARKSMAN;

// custom_mdls dumptruck_ds
precache_body_model (e, "progs/ogre.mdl");
precache_head_model (e, "progs/h_ogre.mdl");
precache_proj_model (e, "progs/grenade.mdl");

precache_sound_misc (e, "ogre/ogdrag.wav");
precache_sound_death (e, "ogre/ogdth.wav");
precache_sound_idle (e, "ogre/ogidle.wav");
precache_sound_misc1 (e, "ogre/ogidle2.wav");
precache_sound_pain (e, "ogre/ogpain1.wav");
precache_sound_attack (e, "ogre/ogsawatk.wav");
precache_sound_sight (e, "ogre/ogwake.wav");

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

e.solid = SOLID_SLIDEBOX;
e.movetype = MOVETYPE_STEP;

// custom_mdls dumptruck_ds
body_model (e, "progs/ogre.mdl");
// setmodel (e, "progs/ogre.mdl");

setsize (e, VEC_HULL2_MIN, VEC_HULL2_MAX);
if (!e.proj_speed_mod)
e.proj_speed_mod = 1;

// thanks RennyC -- dumptruck_ds
if (!e.health)
e.health = 200;

e.checkattack = monster_ogre_checkattack;
e.sightsound = monster_ogre_sightsound;
e.th_stand = ogre_stand1;
e.th_walk = ogre_walk1;
if (e.spawnflags & I_AM_TURRET)
e.th_run = ogre_mm_t_seek1;
else
e.th_run = ogre_run1;
e.destroy = monster_ogre_destroy;
e.th_melee = monster_ogre_attack_melee;
e.th_missile = ogre_mm_nail1;
// dumptruck_ds
e.th_turret = ogre_mm_t_atk1;
// Berserk test from
// http://celephais.net/board/view_thread.php?id=4&start=3465
// -- dumptruck_ds
if !(e.berserk)
e.th_pain = monster_ogre_pain;
else
e.th_pain = sub_nullpain;

// could be a call to monster_ogre_init but let's go
// straight to walkmonster instead -- CEV
base_walkmonster_init (e);
};

//--------------------------------------------------------------
void() monster_ogre_marksman =
{
// new spawnflags for all entities -- iw
if (SUB_Inhibit())
return;

monster_ogre_marksman_init (self);
};
// };

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

/*QUAKED gib_head_ogre (0 0.5 0.8) (-16 -16 0) (16 16 56) 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
{
model ("progs/h_ogre.mdl");
}*/
//----------------------------------------------------------------------
// class gib_head_ogre: base_gib_head
// {
//--------------------------------------------------------------
// ThrowHead
//--------------------------------------------------------------
void(entity act, vector dir, float dmg) throw_gib_head_ogre =
{
base_gib_head_throw (act, dir, dmg, gib_head_ogre_init);
};

//--------------------------------------------------------------
void(entity e) gib_head_ogre_init =
{
e.classname = "gib_head_ogre";
e.classtype = CT_GORE_HEAD_OGRE;

// gib_init interprets spawnflags and will set .solid -- CEV
base_gib_head_init (e);

if (e.mdl_head != "")
{
precache_model (e.mdl_head);
setmodel (e, e.mdl_head);
}
else
{
precache_model ("progs/h_ogre.mdl");
setmodel (e, "progs/h_ogre.mdl");
if (e.solid == SOLID_BBOX)
setsize (e, OGRE_HEAD_MINS, OGRE_HEAD_MAXS);
else if (e.solid == SOLID_TRIGGER)
setsize (e, '-16 -16 0', '16 16 56');
}

e.frame = 0;
};

//--------------------------------------------------------------
void() gib_head_ogre =
{
// new spawnflags for all entities -- iw
if (SUB_Inhibit())
return;

gib_head_ogre_init (self);
};
// };

/*QUAKED monster_dead_ogre (0 0.5 0.8) (-32 -32 -24) (32 32 64) SOLID ON_SIDE 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/ogre.mdl","frame":135});
}
*/
//----------------------------------------------------------------------
// class monster_dead_ogre: base_corpse
// {
//--------------------------------------------------------------
void(entity e) monster_dead_ogre_init =
{
base_corpse_init (e);

precache_model ("progs/ogre.mdl");
setmodel (e, "progs/ogre.mdl");

if (e.spawnflags & 2)
{
e.frame = $death14;

if (e.solid == SOLID_BBOX)
setsize (e, OGRE_CORPSE_MINS,
OGRE_CORPSE_MAXS);
}
else
{
e.frame = $bdeath10;

if (e.solid == SOLID_BBOX)
setsize (e, OGRE_CORPSE_B_MINS,
OGRE_CORPSE_B_MAXS);
}
};

//--------------------------------------------------------------
void() monster_dead_ogre =
{
// new spawnflags for all entities -- iw
if (SUB_Inhibit())
return;

monster_dead_ogre_init (self);
};
// };

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

Log ogre.qc

Date Commit Message Author + -
2024-09-17 Ice, improved stairs, other movement changes cev +2  
2024-06-26 pmove fixes, GL now a faux tribolt, wall climbing cev +60 -14
2024-06-15 Major update, committing as-is, will have bugs cev +134 -66
2024-04-12 Moveable gibs, heads, some bugfixes cev +76 -19
2024-04-05 Player footsteps, shareware monsters, misc? cev +543 -456
2024-02-18 Client/player, projectiles, entrypoints refactor cev +71 -687
2024-01-31 Class based monster refactor & start projectiles cev +1413 -1196
2024-01-13 Refactored items into classes, fix teleporttrain cev +10 -4
2024-01-09 Continue OO / Class-based refactor cev +6 -6
2023-10-13 New movement code based on SV_RunClientCommand cev +1571 -1571
2023-10-13 Rename "qc-server" dir to "qc" cev +1571  

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