djcev.com

//

Git Repos / fte_dogmode / qc / monsters / oldone2.qc

Last update to this file was on 2024-06-15 at 19:50.

Show oldone2.qc

//==============================================================================
// OLD ONE 2 - killable variant -- dumptruck_ds
//==============================================================================

//======================================================================
// 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_think_destroy;
void(vector dir) monster_oldone2_destroy_twitch1;
void(vector dir) 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
$skin skin
$scale 1

$frame old1 old2 old3 old4 old5 old6 old7 old8 old9
$frame old10 old11 old12 old13 old14 old15 old16 old17 old18 old19
$frame old20 old21 old22 old23 old24 old25 old26 old27 old28 old29
$frame old30 old31 old32 old33 old34 old35 old36 old37 old38 old39
$frame old40 old41 old42 old43 old44 old45 old46

$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
// {
//--------------------------------------------------------------
void() monster_oldone2_sightsound =
{
sound_sight (self, CHAN_VOICE, "boss2/sight.wav",
VOL_HIGH, ATTN_NORM);
};

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

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

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(self.enemy.origin - org) / 300;
d = self.enemy.velocity;
d_z = 0;
d = self.enemy.origin + t * d;
}
else
{
d = self.enemy.origin;
}

// added this to motivate fireballs dumptruck_ds
spawn_base_explosion (org);

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

sound_attack (self, CHAN_WEAPON, "boss1/throw.wav",
VOL_HIGH, ATTN_NORM);

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

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

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

//--------------------------------------------------------------
// Shub Idle functions
//--------------------------------------------------------------
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!
//--------------------------------------------------------------
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
//--------------------------------------------------------------
void() old2_twitch1 = [$shake1, old2_twitch2]
{
sound_misc (self, CHAN_VOICE, "boss2/pop2.wav",
VOL_HIGH, ATTN_NONE);
};
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_think_destroy] { };

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

//--------------------------------------------------------------
// oldone2_pain
//--------------------------------------------------------------
void(entity attacker, float damage) monster_oldone2_pain =
{
if (self.pain_finished > time)
return;

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

//--------------------------------------------------------------
void() monster_oldone2_think_destroy =
{
monster_oldone2_destroy ('0 0 0');
};

//--------------------------------------------------------------
void(vector dir) monster_oldone2_destroy_twitch1 =
{
old2_twitch1 ();
};

//--------------------------------------------------------------
// oldone2_die
//--------------------------------------------------------------
void(vector dir) monster_oldone2_destroy =
{
// 1998-07-30 Shub kill count fix by Maddes start
// Already done by FL_MONSTER
// killed_monsters = killed_monsters + 1;
// WriteByte (MSG_ALL, SVC_KILLEDMONSTER);
// 1998-07-30 Shub kill count fix by Maddes end
// throw tons of meat chunks
local vector oldo;
local float x, y, z;
local float r;

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

z = 16;
while (z <= 144)
{
x = -64;
while (x <= 64)
{
y = -64;
while (y <= 64)
{
self.origin_x = oldo_x + x;
self.origin_y = oldo_y + y;
self.origin_z = oldo_z + z;

r = random ();
if (r < 0.3)
throw_gib_1 (self, dir, -120);
else if (r < 0.6)
throw_gib_2 (self, dir, -120);
else
throw_gib_3 (self, dir, -120);
y = y + 32;
}
x = x + 32;
}
z = z + 96;
}

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

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

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

if (deathmatch)
{
remove (e);
return;
}

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 (e, "boss2/death.wav");
// precache_sound2_idle ("boss2/idle.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 (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/oldone.mdl");
// setmodel (e, "progs/oldone.mdl");
setsize (e, '-160 -128 -24', '160 128 256');

if (!e.health)
if (skill == 0)
e.health = 1000;
else
e.health = 3000;

e.flags = FL_MONSTER;
e.takedamage = DAMAGE_AIM;
e.sightsound = monster_oldone2_sightsound;
e.th_run = old2_atk1;
e.th_pain = monster_oldone2_pain;
e.destroy = monster_oldone2_destroy_twitch1;
e.think = old2_idle1;
e.nextthink = time + 0.1;

total_monsters = total_monsters + 1;
};

//--------------------------------------------------------------
void() monster_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.

Log oldone2.qc

Date Commit Message Author + -
2024-06-15 Major update, committing as-is, will have bugs cev +9 -7
2024-04-12 Moveable gibs, heads, some bugfixes cev +21 -31
2024-04-08 Registered monsters, projectile bugfixes cev +274 -194
2024-02-18 Client/player, projectiles, entrypoints refactor cev +7 -37
2024-01-31 Class based monster refactor & start projectiles cev +352 -304
2023-10-13 Rename "qc-server" dir to "qc" cev +367  

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