djcev.com

//

Git Repos / fte_dogmode / qc / monsters / dog.qc

Last update to this file was on 2025-03-30 at 19:29.

Show dog.qc

//==============================================================================
// DOG
//==============================================================================

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

#ifdef SSQC
const float DOG_HEALTH = 25; // id1 25
const float DOG_HEALTH_CORPSE = 20;
#endif

#if defined(CSQC) || defined(SSQC)
const vector DOG_MINS = '-32 -32 -24';
const vector DOG_MAXS = '32 32 40';
const vector DOG_CORPSE_MINS = '-24.51 -16.5 -50.37';
const vector DOG_CORPSE_MAXS = '28.2 13.81 30';
const vector DOG_CORPSE_Z_MINS = '-16 -16 -24'; // thin 32x32 box on ground
const vector DOG_CORPSE_Z_MAXS = '16 16 -8';
#endif

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

// monster_dog
#ifdef CSQC
void(float isnew) monster_dog_netreceive;
#endif
#ifdef SSQC
// float() monster_dog_checkmelee; // attacks, alert sound
float() monster_dog_checkjump;
float() monster_dog_checkattack;
void() monster_dog_sightsound;
void() monster_dog_bite;
// F()
void() dog_stand1; void() dog_stand2; // thinking & animation states
void() dog_stand3; void() dog_stand4; void() dog_stand5; void() dog_stand6;
void() dog_stand7; void() dog_stand8; void() dog_stand9;
void() dog_walk1; void() dog_walk2; void() dog_walk3; void() dog_walk4;
void() dog_walk5; void() dog_walk6; void() dog_walk7; void() dog_walk8;
void() dog_run1; void() dog_run2; void() dog_run3; void() dog_run4;
void() dog_run5; void() dog_run6; void() dog_run7; void() dog_run8;
void() dog_run9; void() dog_run10; void() dog_run11; void() dog_run12;
void() dog_atta1; void() dog_atta2; void() dog_atta3; void() dog_atta4;
void() dog_atta5; void() dog_atta6; void() dog_atta7; void() dog_atta8;
void() dog_leap1; void() dog_leap2; void() dog_leap3; void() dog_leap4;
void() dog_leap5; void() dog_leap6; void() dog_leap7; void() dog_leap8;
void() dog_leap9;
void() dog_pain1; void() dog_pain2; void() dog_pain3; void() dog_pain4;
void() dog_pain5; void() dog_pain6;
void() dog_painb1; void() dog_painb2; void() dog_painb3; void() dog_painb4;
void() dog_painb5; void() dog_painb6; void() dog_painb7; void() dog_painb8;
void() dog_painb9; void() dog_painb10; void() dog_painb11; void() dog_painb12;
void() dog_painb13; void() dog_painb14; void() dog_painb15; void() dog_painb16;
void() dog_die1; void() dog_die2; void() dog_die3; void() dog_die4;
void() dog_die5; void() dog_die6; void() dog_die7; void() dog_die8;
void() dog_die9;
void() dog_dieb1; void() dog_dieb2; void() dog_dieb3; void() dog_dieb4;
void() dog_dieb5; void() dog_dieb6; void() dog_dieb7; void() dog_dieb8;
void() dog_dieb9;
void(entity attacker, float damage) monster_dog_pain; // interaction
void(vector dir) monster_dog_destroy;
void() monster_dog_touch_jump;
entity(vector org, vector ang, float sflags, float yaw)
spawn_monster_dog; // initialization
#endif
#if defined(CSQC) || defined(SSQC)
void(entity e) monster_dog_init;
#endif
#ifdef SSQC
void() monster_dog;
#endif

#ifdef SSQC
// monster_dead_dog
void(entity e) monster_dead_dog_init;
void() monster_dead_dog;
#endif

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

#if defined(CSQC) || defined(SSQC)
$cd id1/models/dog
$origin 0 0 24
$base base
$skin skin

$frame attack1 attack2 attack3 attack4 attack5 attack6 attack7 attack8

$frame death1 death2 death3 death4 death5 death6 death7 death8 death9

$frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8
$frame deathb9

$frame pain1 pain2 pain3 pain4 pain5 pain6

$frame painb1 painb2 painb3 painb4 painb5 painb6 painb7 painb8 painb9 painb10
$frame painb11 painb12 painb13 painb14 painb15 painb16

$frame run1 run2 run3 run4 run5 run6 run7 run8 run9 run10 run11 run12

$frame leap1 leap2 leap3 leap4 leap5 leap6 leap7 leap8 leap9

$frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9

$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8

// MG1 compat -- CEV
const float CORPSEFRAME_DOG_1 = $death9;
const float CORPSEFRAME_DOG_2 = $deathb9;
#endif

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

/*QUAKED monster_dog (1 0 0) (-32 -32 -24) (32 32 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/dog.mdl");
}
Rottweiler.

Default health = 25

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"
snd_idle(string) : "Path to custom idle sound"

mdl_head(string) : "Path to custom head model"
mdl_body(string) : "Path to custom body model"
skin_head(float) : "Skin index of custom head 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_dog: base_monster
// {
#ifdef CSQC
//--------------------------------------------------------------
void(float isnew) monster_dog_netreceive =
{
// creates the newframe and netflags variables -- CEV
BASE_MONSTER_NETRECEIVE (monster_dog_init, DOG_MINS, DOG_MAXS)

if (isnew)
base_entity_que_add (self, QUE_TYPE_ACTOR);

if (self.frame >= $death1 && self.frame <= $death9)
{
if (self.solid != SOLID_NOT)
self.solid = SOLID_NOT;
}
else if (self.frame >= $deathb1 && self.frame <= $deathb9)
{
if (self.solid != SOLID_NOT)
self.solid = SOLID_NOT;
}
};
#endif

#ifdef SSQC
//--------------------------------------------------------------
// CheckDogMelee
// Returns TRUE if a melee attack would hit right now
//--------------------------------------------------------------
/*
float() monster_dog_checkmelee =
{
if (enemy_range == RANGE_MELEE)
{
// FIXME: check canreach
self.attack_state = AS_MELEE;
return TRUE;
}
return FALSE;
};
*/

//--------------------------------------------------------------
// CheckDogJump
//--------------------------------------------------------------
float() monster_dog_checkjump =
{
local vector dist;
local float d;

if (self.origin_z + self.mins_z >
self.enemy.origin_z + self.enemy.mins_z +
0.75 * self.enemy.size_z)
{
return FALSE;
}

if (self.origin_z + self.maxs_z <
self.enemy.origin_z + self.enemy.mins_z +
0.25 * self.enemy.size_z)
{
return FALSE;
}

dist = self.enemy.origin - self.origin;
dist_z = 0;

d = vlen (dist);

if (d < 80)
return FALSE;

if (d > 150)
return FALSE;

return TRUE;
};

//--------------------------------------------------------------
float() monster_dog_checkattack =
{
// if close enough for slashing, go for it
/*
if (monster_dog_checkmelee())
*/
if (enemy_range == RANGE_MELEE)
{
self.attack_state = AS_MELEE;
return TRUE;
}

if (monster_dog_checkjump())
{
self.attack_state = AS_MISSILE;
return TRUE;
}

return FALSE;
};

//--------------------------------------------------------------
void() monster_dog_sightsound =
{
// dumptruck_ds
sound (self, CHAN_VOICE, "dog/dsight.wav",
VOL_HIGH, ATTN_NORM);
};

//--------------------------------------------------------------
// dog_bite
//--------------------------------------------------------------
void() monster_dog_bite =
{
local vector delta;
local float ldmg;

if (!self.enemy)
return;

ai_charge (10);

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

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

if (vlen(delta) > 100)
return;

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

//--------------------------------------------------------------
#define F() \
/* { */ \
if (!(self.SendFlags & NETFLAG_BASE_ENTITY_FRAME)) \
{ \
self.SendFlags |= NETFLAG_BASE_ENTITY_FRAME; \
} \
/* } */

//--------------------------------------------------------------
// Dog standing state
//--------------------------------------------------------------
void() dog_stand1 = [$stand1, dog_stand2] { ai_stand (); F () };
void() dog_stand2 = [$stand2, dog_stand3] { ai_stand (); F () };
void() dog_stand3 = [$stand3, dog_stand4] { ai_stand (); F () };
void() dog_stand4 = [$stand4, dog_stand5] { ai_stand (); F () };
void() dog_stand5 = [$stand5, dog_stand6] { ai_stand (); F () };
void() dog_stand6 = [$stand6, dog_stand7] { ai_stand (); F () };
void() dog_stand7 = [$stand7, dog_stand8] { ai_stand (); F () };
void() dog_stand8 = [$stand8, dog_stand9] { ai_stand (); F () };
void() dog_stand9 = [$stand9, dog_stand1] { ai_stand (); F () };

//--------------------------------------------------------------
// Dog walking state
//--------------------------------------------------------------
void() dog_walk1 = [$walk1, dog_walk2]
{
if (random() < 0.2)
// dumptruck_ds
sound (self, CHAN_VOICE, "dog/idle.wav",
VOL_HIGH, ATTN_IDLE);
ai_walk (8);
F ()
};
void() dog_walk2 = [$walk2, dog_walk3] { ai_walk (8); F () };
void() dog_walk3 = [$walk3, dog_walk4] { ai_walk (8); F () };
void() dog_walk4 = [$walk4, dog_walk5] { ai_walk (8); F () };
void() dog_walk5 = [$walk5, dog_walk6] { ai_walk (8); F () };
void() dog_walk6 = [$walk6, dog_walk7] { ai_walk (8); F () };
void() dog_walk7 = [$walk7, dog_walk8] { ai_walk (8); F () };
void() dog_walk8 = [$walk8, dog_walk1] { ai_walk (8); F () };

//--------------------------------------------------------------
// Dog running state
//--------------------------------------------------------------
void() dog_run1 = [$run1, dog_run2]
{
if (random() < 0.2)
// dumptruck_ds
sound (self, CHAN_VOICE, "dog/idle.wav",
VOL_HIGH, ATTN_IDLE);
ai_run (16);
F ()
};
void() dog_run2 = [$run2, dog_run3] { ai_run (32); F () };
void() dog_run3 = [$run3, dog_run4] { ai_run (32); F () };
void() dog_run4 = [$run4, dog_run5] { ai_run (20); F () };
void() dog_run5 = [$run5, dog_run6] { ai_run (64); F () };
void() dog_run6 = [$run6, dog_run7] { ai_run (32); F () };
void() dog_run7 = [$run7, dog_run8] { ai_run (16); F () };
void() dog_run8 = [$run8, dog_run9] { ai_run (32); F () };
void() dog_run9 = [$run9, dog_run10] { ai_run (32); F () };
void() dog_run10 = [$run10, dog_run11] { ai_run (20); F () };
void() dog_run11 = [$run11, dog_run12] { ai_run (64); F () };
void() dog_run12 = [$run12, dog_run1] { ai_run (32); F () };

//--------------------------------------------------------------
// Dog attack state
//--------------------------------------------------------------
void() dog_atta1 = [$attack1, dog_atta2] { ai_charge (10); F () };
void() dog_atta2 = [$attack2, dog_atta3] { ai_charge (10); F () };
void() dog_atta3 = [$attack3, dog_atta4] { ai_charge (10); F () };
void() dog_atta4 = [$attack4, dog_atta5]
{
// dumptruck_ds
sound (self, CHAN_VOICE, "dog/dattack1.wav",
VOL_HIGH, ATTN_NORM);
monster_dog_bite ();
F ()
};
void() dog_atta5 = [$attack5, dog_atta6] { ai_charge (10); F () };
void() dog_atta6 = [$attack6, dog_atta7] { ai_charge (10); F () };
void() dog_atta7 = [$attack7, dog_atta8] { ai_charge (10); F () };
void() dog_atta8 = [$attack8, dog_run1] { ai_charge (10); F () };

//--------------------------------------------------------------
// Dog jumping (leaping) state
//--------------------------------------------------------------
void() dog_leap1 = [$leap1, dog_leap2] { ai_face (); F () };
void() dog_leap2 = [$leap2, dog_leap3]
{
ai_face ();
// fix for instakill bug -- dumptruck_ds
self.pm_flags &= ~PMF_JUMP_HELD;
self.touch = monster_dog_touch_jump;
makevectors (self.angles);
self.origin_z = self.origin_z + 1;
self.velocity = v_forward * 300 + '0 0 200';
if (self.flags & FL_ONGROUND)
self.flags = self.flags - FL_ONGROUND;
F ()
};
void() dog_leap3 = [$leap3, dog_leap4] { F () };
void() dog_leap4 = [$leap4, dog_leap5] { F () };
void() dog_leap5 = [$leap5, dog_leap6] { F () };
void() dog_leap6 = [$leap6, dog_leap7] { F () };
void() dog_leap7 = [$leap7, dog_leap8] { F () };
void() dog_leap8 = [$leap8, dog_leap9] { F () };
void() dog_leap9 = [$leap9, dog_leap9] { F () };

//--------------------------------------------------------------
// Dog pain state A
//--------------------------------------------------------------
void() dog_pain1 = [$pain1, dog_pain2] { F () };
void() dog_pain2 = [$pain2, dog_pain3] { F () };
void() dog_pain3 = [$pain3, dog_pain4] { F () };
void() dog_pain4 = [$pain4, dog_pain5] { F () };
void() dog_pain5 = [$pain5, dog_pain6] { F () };
void() dog_pain6 = [$pain6, dog_run1] { F () };

//--------------------------------------------------------------
// Dog pain state B
//--------------------------------------------------------------
void() dog_painb1 = [$painb1, dog_painb2] { F () };
void() dog_painb2 = [$painb2, dog_painb3] { F () };
void() dog_painb3 = [$painb3, dog_painb4] { ai_pain (4); F () };
void() dog_painb4 = [$painb4, dog_painb5] { ai_pain (12); F () };
void() dog_painb5 = [$painb5, dog_painb6] { ai_pain (12); F () };
void() dog_painb6 = [$painb6, dog_painb7] { ai_pain (2); F () };
void() dog_painb7 = [$painb7, dog_painb8] { F () };
void() dog_painb8 = [$painb8, dog_painb9] { ai_pain (4); F () };
void() dog_painb9 = [$painb9, dog_painb10] { F () };
void() dog_painb10 = [$painb10, dog_painb11] { ai_pain (10); F () };
void() dog_painb11 = [$painb11, dog_painb12] { F () };
void() dog_painb12 = [$painb12, dog_painb13] { F () };
void() dog_painb13 = [$painb13, dog_painb14] { F () };
void() dog_painb14 = [$painb14, dog_painb15] { F () };
void() dog_painb15 = [$painb15, dog_painb16] { F () };
void() dog_painb16 = [$painb16, dog_run1] { F () };

//--------------------------------------------------------------
// Dog death state A
//--------------------------------------------------------------
void() dog_die1 = [$death1, dog_die2]
{
base_entity_aligntoground (self);
F ()
};
void() dog_die2 = [$death2, dog_die3] { F () };
void() dog_die3 = [$death3, dog_die4] { F () };
void() dog_die4 = [$death4, dog_die5] { F () };
void() dog_die5 = [$death5, dog_die6] { F () };
void() dog_die6 = [$death6, dog_die7] { F () };
void() dog_die7 = [$death7, dog_die8] { F () };
void() dog_die8 = [$death8, dog_die9]
{
become_base_corpse (self, DOG_HEALTH_CORPSE);
setsize (self, DOG_CORPSE_Z_MINS, DOG_CORPSE_Z_MAXS);
F ()
};
void() dog_die9 = [$death9, dog_die9]
{
if (self.origin != self.origin_net)
self.SendFlags |= NETFLAG_BASE_ENTITY_ORIGIN |
NETFLAG_BASE_ENTITY_FRAME;
else if (self.frame_net != self.frame)
self.SendFlags |= NETFLAG_BASE_ENTITY_FRAME;
};

//--------------------------------------------------------------
// Dog death state B
//--------------------------------------------------------------
void() dog_dieb1 = [$deathb1, dog_dieb2]
{
base_entity_aligntoground (self);
F ()
};
void() dog_dieb2 = [$deathb2, dog_dieb3] { F () };
void() dog_dieb3 = [$deathb3, dog_dieb4] { F () };
void() dog_dieb4 = [$deathb4, dog_dieb5] { F () };
void() dog_dieb5 = [$deathb5, dog_dieb6] { F () };
void() dog_dieb6 = [$deathb6, dog_dieb7] { F () };
void() dog_dieb7 = [$deathb7, dog_dieb8] { F () };
void() dog_dieb8 = [$deathb8, dog_dieb9]
{
become_base_corpse (self, DOG_HEALTH_CORPSE);
setsize (self, DOG_CORPSE_Z_MINS, DOG_CORPSE_Z_MAXS);
F ()
};
void() dog_dieb9 = [$deathb9, dog_dieb9]
{
if (self.origin != self.origin_net)
self.SendFlags |= NETFLAG_BASE_ENTITY_ORIGIN |
NETFLAG_BASE_ENTITY_FRAME;
else if (self.frame_net != self.frame)
self.SendFlags |= NETFLAG_BASE_ENTITY_FRAME;
};

#undef F

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

//--------------------------------------------------------------
void(entity attacker, float damage) monster_dog_pain =
{
// dumptruck_ds
sound (self, CHAN_VOICE, "dog/dpain1.wav",
VOL_HIGH, ATTN_NORM);

if (random() > 0.5)
dog_pain1 ();
else
dog_painb1 ();
};

//--------------------------------------------------------------
void(vector dir) monster_dog_destroy =
{
// check for gib
if (self.classgroup & CG_CORPSE || self.health < -35)
{
sound (self, CHAN_VOICE, "player/udeath.wav",
VOL_HIGH, ATTN_NORM);

if (!(self.classgroup & CG_CORPSE))
base_item_drop_stuff (self);

BASE_ITEM_GIB_THROW (dir, self.health, item_gib3_init)
BASE_ITEM_GIB_THROW (dir, self.health, item_gib3_init)
BASE_ITEM_GIB_THROW (dir, self.health, item_gib3_init)
BASE_ITEM_GIB_THROW (dir, self.health,
item_head_dog_init)

base_entity_remove (self);
return;
}

// regular death
// dumptruck_ds
sound (self, CHAN_VOICE, "dog/ddeath.wav", VOL_HIGH, ATTN_NORM);
self.solid = SOLID_NOT;
base_item_drop_stuff (self);

if (random() > 0.5)
dog_die1 ();
else
dog_dieb1 ();
};

//--------------------------------------------------------------
// Dog_JumpTouch
//--------------------------------------------------------------
void() monster_dog_touch_jump =
{
local float ldmg;

if (self.health <= 0)
return;

if (other.takedamage)
{
if (vlen(self.velocity) > 300)
{
if (!(self.pm_flags & PMF_JUMP_HELD))
{
ldmg = 10 + 10 * random();
t_damage2 (other, self, self, ldmg);
// is the player still alive?
// Preach's instakill bug check
// - dumptruck_ds
if (other.health > 0)
self.pm_flags |= PMF_JUMP_HELD;
}
}
}

if (!checkbottom(self))
{
if (self.flags & FL_ONGROUND)
{
// jump randomly to not get hung up
// dprint ("popjump\n");
// 1998-09-16 Sliding/not-jumping on monsters/
// boxes/players fix by Maddes/Kryten start
self.touch = base_monster_touch;
// 1998-09-16 Sliding/not-jumping on monsters/
// boxes/players fix by Maddes/Kryten end
self.think = dog_leap1;
self.nextthink = time + 0.1;

// self.velocity_x = (random() - 0.5) * 600;
// self.velocity_y = (random() - 0.5) * 600;
// self.velocity_z = 200;
// self.flags = self.flags - FL_ONGROUND;
}
// not on ground yet
return;
}

// 1998-09-16 Sliding/not-jumping on monsters/boxes/players
// fix by Maddes/Kryten start
self.touch = base_monster_touch;
// 1998-09-16 Sliding/not-jumping on monsters/boxes/players
// fix by Maddes/Kryten end
self.think = dog_run1;
self.nextthink = time + 0.1;
};

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

//--------------------------------------------------------------
entity(vector org, vector ang, float sflags, float yaw)
spawn_monster_dog =
{
return spawn_base_monster (org, ang, sflags, yaw,
monster_dog_init);
};
#endif

#if defined(CSQC) || defined(SSQC)
//--------------------------------------------------------------
void(entity e) monster_dog_init =
{
#ifdef SSQC
if (deathmatch)
{
remove (e);
return;
}

if (e.spawnflags & SPAWNFLAG_MONSTER_TURRET)
objerror ("monster_dog_init: "
"incompatible spawnflag: TURRET_MODE\n");
#endif

e.classname = "monster_dog";
e.classtype = CT_MONSTER_DOG;
e.pos1 = DOG_MINS;
e.pos2 = DOG_MAXS;

#ifdef CSQC
if (e.modelindex)
{
setmodelindex (e, e.modelindex);
setsize (e, DOG_MINS, DOG_MAXS);
}
#endif

#ifdef SSQC
precache_model ("progs/h_dog.mdl");
precache_model ("progs/dog.mdl");
precache_sound ("dog/dattack1.wav");
precache_sound ("dog/ddeath.wav");
precache_sound ("dog/dpain1.wav");
precache_sound ("dog/dsight.wav");
precache_sound ("dog/idle.wav");

precache_model ("progs/gib1.mdl");
precache_model ("progs/gib2.mdl");
precache_model ("progs/gib3.mdl");

// set up model and size for later -- CEV
e.mdl = "progs/dog.mdl";

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

e.checkattack = monster_dog_checkattack;
e.destroy = monster_dog_destroy;
e.sightsound = monster_dog_sightsound;
e.th_stand = dog_stand1;
e.th_walk = dog_walk1;
e.th_run = dog_run1;
e.th_melee = dog_atta1;
e.th_missile = dog_leap1;

// changed berserk test from field to flag -- CEV
if (self.spawnflags & SPAWNFLAG_MONSTER_BERSERK)
e.th_pain = sub_nullpain;
else
e.th_pain = monster_dog_pain;
#endif

// InitMonster -- runs on both client & server -- CEV
base_monster_init (e);
};
#endif

#ifdef SSQC
//--------------------------------------------------------------
void() monster_dog =
{
// remap spawnflags & fields, inhibit if necessary -- CEV
BASE_MONSTER_PREINIT (base_monster_init_field)

monster_dog_init (self);
};
#endif
// };

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

#ifdef SSQC
/*QUAKED monster_dead_dog (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
{
model ({"path":"progs/dog.mdl","frame":16});
}
*/
//----------------------------------------------------------------------
// class monster_dead_dog: base_corpse
// {
//--------------------------------------------------------------
void(entity e) monster_dead_dog_init =
{
base_corpse_init (e);

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

if (e.spawnflags & 2)
{
// MG1 compat -- CEV
e.frame = $death9;
}
else if (e.spawnflags & 4)
{
// MG1 compat -- CEV
e.frame = $deathb9;
}
else
{
e.frame = $death8;

if (e.solid == SOLID_BBOX)
setsize (e, DOG_CORPSE_MINS, DOG_CORPSE_MAXS);
}
};

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

monster_dead_dog_init (self);
};
// };
#endif

#if defined(CSQC) || defined(SSQC)
$flush
#endif

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

Log dog.qc

Date Commit Message Author + -
2025-03-30 Big commit. Entity networking, etc. cev +250 -241
2024-06-15 Major update, committing as-is, will have bugs cev +104 -37
2024-04-12 Moveable gibs, heads, some bugfixes cev +81 -14
2024-04-05 Player footsteps, shareware monsters, misc? cev +266 -238
2024-02-18 Client/player, projectiles, entrypoints refactor cev +4 -4
2024-01-31 Class based monster refactor & start projectiles cev +477 -381
2024-01-13 Refactored items into classes, fix teleporttrain cev +2 -2
2024-01-09 Continue OO / Class-based refactor cev +3 -3
2023-10-13 New movement code based on SV_RunClientCommand cev +503 -503
2023-10-13 Rename "qc-server" dir to "qc" cev +503  

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