663 lines
22 KiB
C++
663 lines
22 KiB
C++
/*
|
|
==============================================================================
|
|
|
|
Wraith
|
|
coded by Michael Rogers
|
|
some code done by iD software
|
|
|
|
==============================================================================
|
|
*/
|
|
|
|
$cd /models/enemies
|
|
$origin 0 0 24
|
|
$base base
|
|
$skin base
|
|
|
|
$frame idle1001 idle1002 idle1003 idle1004 idle1005 idle1006 idle1007 idle1008 idle1009 idle1010
|
|
$frame idle1011 idle1012 idle1013 idle1014 idle1015 idle1016 idle1017 idle1018 idle1019 idle1020
|
|
$frame idle1021 idle1022 idle1023 idle1024 idle1025 idle1026 idle1027 idle1028 idle1029 idle1030
|
|
$frame idle1031 idle1032 idle1033 idle1034 idle1035 idle1036 idle1037 idle1038 idle1039 idle1040
|
|
|
|
$frame idle2001 idle2002 idle2003 idle2004 idle2005 idle2006 idle2007 idle2008 idle2009 idle2010
|
|
$frame idle2011 idle2012 idle2013 idle2014 idle2015 idle2016 idle2017 idle2018 idle2019 idle2020
|
|
$frame idle2021 idle2022 idle2023 idle2024 idle2025 idle2026 idle2027 idle2028 idle2029 idle2030
|
|
$frame idle2031 idle2032 idle2033 idle2034 idle2035 idle2036 idle2037 idle2038 idle2039 idle2040
|
|
|
|
$frame walk001 walk002 walk003 walk004 walk005 walk006 walk007 walk008 walk009 walk010
|
|
$frame walk011
|
|
|
|
$frame run001 run002 run003 run004 run005
|
|
|
|
$frame attack1001 attack1002 attack1003 attack1004 attack1005 attack1006
|
|
|
|
$frame attack2001 attack2002 attack2003 attack2004 attack2005 attack2006 attack2007 attack2008 attack2009
|
|
|
|
$frame attack3001 attack3002 attack3003 attack3004 attack3005 attack3006 attack3007 attack3008
|
|
|
|
$frame pain1001 pain1002 pain1003 pain1004
|
|
|
|
$frame pain2001 pain2002 pain2003 pain2004
|
|
|
|
$frame death001 death002 death003 death004 death005 death006 death007 death008 death009
|
|
|
|
void() wraith_pain;
|
|
void() wraith_idlesound;
|
|
void() wraith_painsound;
|
|
void() wraith_goinvisible;
|
|
void() wraith_govisible;
|
|
void() wraith_invisible;
|
|
void() wraith_teleport;
|
|
|
|
//=============================================================================
|
|
|
|
void() BoneTouch =
|
|
{
|
|
if (other == self.owner)
|
|
return; // don't explode on owner
|
|
|
|
T_Damage(self.enemy,self,self.owner,(30 + (random() * 10)));
|
|
sound (self, CHAN_WEAPON, "weapons/lock4.wav", 1, ATTN_NORM);
|
|
|
|
BecomeExplosion();
|
|
};
|
|
|
|
/*
|
|
================
|
|
CreateBoneShard
|
|
================
|
|
*/
|
|
void() CreateBoneShard =
|
|
{
|
|
local entity missile;
|
|
|
|
missile = spawn ();
|
|
missile.owner = self;
|
|
missile.movetype = MOVETYPE_FLYMISSILE;
|
|
missile.solid = SOLID_BBOX;
|
|
missile.classname = "boneshard";
|
|
|
|
// set missile duration
|
|
missile.nextthink = time + 5;
|
|
missile.think = BoneTouch;
|
|
|
|
|
|
makevectors (self.angles);
|
|
setorigin (missile, self.origin + (v_right * 28) + '0 0 10'); //28 units to his right
|
|
setmodel (missile, "models/weapons/gfx/bone.mdl");
|
|
setsize (missile, '0 0 0', '0 0 0');
|
|
|
|
//Tomaz special effects
|
|
missile.glow_size = 150;
|
|
missile.glow_red = 0;
|
|
missile.glow_green = 0;
|
|
missile.glow_blue = 0.5;
|
|
|
|
// set missile speed
|
|
|
|
missile.velocity = normalize(self.enemy.origin - missile.origin);
|
|
missile.velocity = missile.velocity * 800;
|
|
missile.angles = vectoangles(missile.velocity);
|
|
|
|
missile.touch = BoneTouch;
|
|
|
|
};
|
|
|
|
void() FireBlastTouch =
|
|
{
|
|
if (other == self.owner)
|
|
return; // don't explode on owner
|
|
|
|
//set everything but the world on fire
|
|
if (other != world && random() <= 0.2)
|
|
{
|
|
other.onfire = 1;
|
|
other.burningtime = time + 2 + random() * 2;
|
|
other.burninflictor = self.owner;
|
|
}
|
|
|
|
//damage them some
|
|
T_RadiusDamage (self, self.owner, (20 + (random() * 10)), world);
|
|
|
|
//make some noise
|
|
sound (self, CHAN_WEAPON, "weapons/lock4.wav", 1, ATTN_NORM);
|
|
|
|
//BecomeExplosion();
|
|
remove(self);
|
|
};
|
|
|
|
void() FireBlast_CheckStatus =
|
|
{
|
|
local float p;
|
|
|
|
//remove us if we are in water
|
|
//check for water, slime, or lava
|
|
|
|
makevectors(self.angles);
|
|
p = pointcontents(self.origin + v_forward*16);
|
|
if (p == CONTENT_WATER || p == CONTENT_SLIME || p == CONTENT_LAVA)
|
|
remove(self);
|
|
|
|
//if we've sat around too long
|
|
if (time > self.ltime)
|
|
{
|
|
//do appropriate action based on classname
|
|
if (self.classname == "fireblastp")
|
|
{
|
|
//lets do a little homing missile effect
|
|
self.nextthink = time + 0.1;
|
|
self.think = trinitystart;
|
|
|
|
//do something tricky ^_-
|
|
self.ltime = time + 5;
|
|
self.classname = "fireblastm";
|
|
}
|
|
else
|
|
{
|
|
self.nextthink = time + 0.1;
|
|
self.think = FireBlastTouch;
|
|
}
|
|
}
|
|
};
|
|
|
|
/*
|
|
================
|
|
FireBlast
|
|
float r: a set number of units to change the origin of the fire
|
|
================
|
|
*/
|
|
void(float r, float vmod) FireBlast =
|
|
{
|
|
local entity missile;
|
|
local vector dir;
|
|
|
|
missile = spawn ();
|
|
missile.owner = self;
|
|
missile.movetype = MOVETYPE_FLYMISSILE;
|
|
missile.solid = SOLID_BBOX;
|
|
|
|
//modified so the player can use this for secondary attack of ice shards
|
|
if (self.classname == "player" || self.classname == "xsniperbot")
|
|
{
|
|
makevectors (self.v_angle); // calculate forward angle for velocity
|
|
setorigin(missile, self.origin - v_right*r + '0 0 16' + v_forward*20);
|
|
|
|
missile.classname = "fireblastp";
|
|
missile.ltime = time + 1;
|
|
}
|
|
else
|
|
{
|
|
makevectors (self.angles);
|
|
setorigin (missile, self.origin - (v_right * r) + (v_forward * 20) + '0 0 5'); //r units to his left
|
|
|
|
missile.classname = "fireblastm";
|
|
missile.ltime = time + 5;
|
|
}
|
|
//check for water
|
|
missile.nextthink = time + 0.1;
|
|
missile.think = FireBlast_CheckStatus;
|
|
|
|
setmodel (missile, "progs/flame2.mdl");
|
|
setsize (missile, '0 0 0', '0 0 0');
|
|
|
|
//Tomaz special effects
|
|
missile.frame = 1;
|
|
missile.glow_size = 150;
|
|
missile.glow_red = 1;
|
|
missile.glow_green = 0.5;
|
|
missile.glow_blue = 0;
|
|
|
|
// set missile speed
|
|
|
|
//modified so the player can use this for secondary attack of ice shards
|
|
if (self.classname == "player" || self.classname == "xsniperbot")
|
|
{
|
|
//player aiming
|
|
if (self.classname == "player")
|
|
dir = aim (self, 1000);
|
|
else
|
|
dir = xsn_aim_at_enemy();
|
|
missile.velocity = dir;
|
|
}
|
|
else
|
|
missile.velocity = normalize(self.enemy.origin - missile.origin);
|
|
missile.velocity = missile.velocity * vmod;
|
|
|
|
//modified so the player can use this for secondary attack of ice shards
|
|
if (self.classname == "player" || self.classname == "xsniperbot")
|
|
missile.angles = vectoangles(dir);
|
|
else
|
|
missile.angles = vectoangles(missile.velocity);
|
|
|
|
missile.touch = FireBlastTouch;
|
|
|
|
};
|
|
|
|
//=============================================================================
|
|
|
|
void() wraith_standa1 =[ $idle1001, wraith_standa2 ] {ai_stand();wraith_idlesound();};
|
|
void() wraith_standa2 =[ $idle1002, wraith_standa3 ] {ai_stand();};
|
|
void() wraith_standa3 =[ $idle1003, wraith_standa4 ] {ai_stand();};
|
|
void() wraith_standa4 =[ $idle1004, wraith_standa5 ] {ai_stand();};
|
|
void() wraith_standa5 =[ $idle1005, wraith_standa6 ] {ai_stand();};
|
|
void() wraith_standa6 =[ $idle1006, wraith_standa7 ] {ai_stand();};
|
|
void() wraith_standa7 =[ $idle1007, wraith_standa8 ] {ai_stand();};
|
|
void() wraith_standa8 =[ $idle1008, wraith_standa9 ] {ai_stand();};
|
|
void() wraith_standa9 =[ $idle1009, wraith_standa10 ] {ai_stand();};
|
|
void() wraith_standa10 =[ $idle1010, wraith_standa11 ] {ai_stand();};
|
|
void() wraith_standa11 =[ $idle1011, wraith_standa12 ] {ai_stand();};
|
|
void() wraith_standa12 =[ $idle1012, wraith_standa13 ] {ai_stand();};
|
|
void() wraith_standa13 =[ $idle1013, wraith_standa14 ] {ai_stand();};
|
|
void() wraith_standa14 =[ $idle1014, wraith_standa15 ] {ai_stand();};
|
|
void() wraith_standa15 =[ $idle1015, wraith_standa16 ] {ai_stand();};
|
|
void() wraith_standa16 =[ $idle1016, wraith_standa17 ] {ai_stand();};
|
|
void() wraith_standa17 =[ $idle1017, wraith_standa18 ] {ai_stand();};
|
|
void() wraith_standa18 =[ $idle1018, wraith_standa19 ] {ai_stand();};
|
|
void() wraith_standa19 =[ $idle1019, wraith_standa20 ] {ai_stand();};
|
|
void() wraith_standa20 =[ $idle1020, wraith_standa21 ] {ai_stand();};
|
|
void() wraith_standa21 =[ $idle1021, wraith_standa22 ] {ai_stand();};
|
|
void() wraith_standa22 =[ $idle1022, wraith_standa23 ] {ai_stand();};
|
|
void() wraith_standa23 =[ $idle1023, wraith_standa24 ] {ai_stand();};
|
|
void() wraith_standa24 =[ $idle1024, wraith_standa25 ] {ai_stand();};
|
|
void() wraith_standa25 =[ $idle1025, wraith_standa26 ] {ai_stand();};
|
|
void() wraith_standa26 =[ $idle1026, wraith_standa27 ] {ai_stand();};
|
|
void() wraith_standa27 =[ $idle1027, wraith_standa28 ] {ai_stand();};
|
|
void() wraith_standa28 =[ $idle1028, wraith_standa29 ] {ai_stand();};
|
|
void() wraith_standa29 =[ $idle1029, wraith_standa30 ] {ai_stand();};
|
|
void() wraith_standa30 =[ $idle1030, wraith_standa31 ] {ai_stand();};
|
|
void() wraith_standa31 =[ $idle1031, wraith_standa32 ] {ai_stand();};
|
|
void() wraith_standa32 =[ $idle1032, wraith_standa33 ] {ai_stand();};
|
|
void() wraith_standa33 =[ $idle1033, wraith_standa34 ] {ai_stand();};
|
|
void() wraith_standa34 =[ $idle1034, wraith_standa35 ] {ai_stand();};
|
|
void() wraith_standa35 =[ $idle1035, wraith_standa36 ] {ai_stand();};
|
|
void() wraith_standa36 =[ $idle1036, wraith_standa37 ] {ai_stand();};
|
|
void() wraith_standa37 =[ $idle1037, wraith_standa38 ] {ai_stand();};
|
|
void() wraith_standa38 =[ $idle1038, wraith_standa39 ] {ai_stand();};
|
|
void() wraith_standa39 =[ $idle1039, wraith_standa40 ] {ai_stand();};
|
|
void() wraith_standa40 =[ $idle1040, wraith_standb1 ] {ai_stand();};
|
|
void() wraith_standb1 =[ $idle2001, wraith_standb2 ] {ai_stand();wraith_idlesound();};
|
|
void() wraith_standb2 =[ $idle2002, wraith_standb3 ] {ai_stand();};
|
|
void() wraith_standb3 =[ $idle2003, wraith_standb4 ] {ai_stand();};
|
|
void() wraith_standb4 =[ $idle2004, wraith_standb5 ] {ai_stand();};
|
|
void() wraith_standb5 =[ $idle2005, wraith_standb6 ] {ai_stand();};
|
|
void() wraith_standb6 =[ $idle2006, wraith_standb7 ] {ai_stand();};
|
|
void() wraith_standb7 =[ $idle2007, wraith_standb8 ] {ai_stand();};
|
|
void() wraith_standb8 =[ $idle2008, wraith_standb9 ] {ai_stand();};
|
|
void() wraith_standb9 =[ $idle2009, wraith_standb10 ] {ai_stand();};
|
|
void() wraith_standb10 =[ $idle2010, wraith_standb11 ] {ai_stand();};
|
|
void() wraith_standb11 =[ $idle2011, wraith_standb12 ] {ai_stand();};
|
|
void() wraith_standb12 =[ $idle2012, wraith_standb13 ] {ai_stand();};
|
|
void() wraith_standb13 =[ $idle2013, wraith_standb14 ] {ai_stand();};
|
|
void() wraith_standb14 =[ $idle2014, wraith_standb15 ] {ai_stand();};
|
|
void() wraith_standb15 =[ $idle2015, wraith_standb16 ] {ai_stand();};
|
|
void() wraith_standb16 =[ $idle2016, wraith_standb17 ] {ai_stand();};
|
|
void() wraith_standb17 =[ $idle2017, wraith_standb18 ] {ai_stand();};
|
|
void() wraith_standb18 =[ $idle2018, wraith_standb19 ] {ai_stand();};
|
|
void() wraith_standb19 =[ $idle2019, wraith_standb20 ] {ai_stand();};
|
|
void() wraith_standb20 =[ $idle2020, wraith_standb21 ] {ai_stand();};
|
|
void() wraith_standb21 =[ $idle2021, wraith_standb22 ] {ai_stand();};
|
|
void() wraith_standb22 =[ $idle2022, wraith_standb23 ] {ai_stand();};
|
|
void() wraith_standb23 =[ $idle2023, wraith_standb24 ] {ai_stand();};
|
|
void() wraith_standb24 =[ $idle2024, wraith_standb25 ] {ai_stand();};
|
|
void() wraith_standb25 =[ $idle2025, wraith_standb26 ] {ai_stand();};
|
|
void() wraith_standb26 =[ $idle2026, wraith_standb27 ] {ai_stand();};
|
|
void() wraith_standb27 =[ $idle2027, wraith_standb28 ] {ai_stand();};
|
|
void() wraith_standb28 =[ $idle2028, wraith_standb29 ] {ai_stand();};
|
|
void() wraith_standb29 =[ $idle2029, wraith_standb30 ] {ai_stand();};
|
|
void() wraith_standb30 =[ $idle2030, wraith_standb31 ] {ai_stand();};
|
|
void() wraith_standb31 =[ $idle2031, wraith_standb32 ] {ai_stand();};
|
|
void() wraith_standb32 =[ $idle2032, wraith_standb33 ] {ai_stand();};
|
|
void() wraith_standb33 =[ $idle2033, wraith_standb34 ] {ai_stand();};
|
|
void() wraith_standb34 =[ $idle2034, wraith_standb35 ] {ai_stand();};
|
|
void() wraith_standb35 =[ $idle2035, wraith_standb36 ] {ai_stand();};
|
|
void() wraith_standb36 =[ $idle2036, wraith_standb37 ] {ai_stand();};
|
|
void() wraith_standb37 =[ $idle2037, wraith_standb38 ] {ai_stand();};
|
|
void() wraith_standb38 =[ $idle2038, wraith_standb39 ] {ai_stand();};
|
|
void() wraith_standb39 =[ $idle2039, wraith_standb40 ] {ai_stand();};
|
|
void() wraith_standb40 =[ $idle2040, wraith_standa1 ] {ai_stand();};
|
|
|
|
//=============================================================================
|
|
|
|
void() wraith_walk1 =[ $walk001, wraith_walk2 ] {ai_walk(6);wraith_idlesound();};
|
|
void() wraith_walk2 =[ $walk002, wraith_walk3 ] {ai_walk(4);};
|
|
void() wraith_walk3 =[ $walk003, wraith_walk4 ] {ai_walk(0);};
|
|
void() wraith_walk4 =[ $walk004, wraith_walk5 ] {ai_walk(0);};
|
|
void() wraith_walk5 =[ $walk005, wraith_walk6 ] {ai_walk(0);};
|
|
void() wraith_walk6 =[ $walk006, wraith_walk7 ] {ai_walk(0);};
|
|
void() wraith_walk7 =[ $walk007, wraith_walk8 ] {ai_walk(5);};
|
|
void() wraith_walk8 =[ $walk008, wraith_walk9 ] {ai_walk(6);};
|
|
void() wraith_walk9 =[ $walk009, wraith_walk10 ] {ai_walk(5);};
|
|
void() wraith_walk10 =[ $walk010, wraith_walk11 ] {ai_walk(0);};
|
|
void() wraith_walk11 =[ $walk011, wraith_walk1 ] {ai_walk(5);};
|
|
|
|
//=============================================================================
|
|
|
|
void() wraith_run1 =[ $run001, wraith_run2 ] {ai_run(6);wraith_idlesound();};
|
|
void() wraith_run2 =[ $run002, wraith_run3 ] {ai_run(4);wraith_invisible();};
|
|
void() wraith_run3 =[ $run003, wraith_run4 ] {ai_run(4);wraith_teleport();};
|
|
void() wraith_run4 =[ $run004, wraith_run5 ] {ai_run(5);};
|
|
void() wraith_run5 =[ $run005, wraith_run1 ] {ai_run(5);};
|
|
|
|
//=============================================================================
|
|
|
|
void() wraith_attacka1 =[ $attack2001, wraith_attacka2 ] {ai_face();};
|
|
void() wraith_attacka2 =[ $attack2002, wraith_attacka3 ] {ai_face();};
|
|
void() wraith_attacka3 =[ $attack2003, wraith_attacka4 ] {ai_face();};
|
|
void() wraith_attacka4 =[ $attack2004, wraith_attacka5 ] {ai_face();};
|
|
void() wraith_attacka5 =[ $attack2005, wraith_attacka6 ] {ai_face();};
|
|
void() wraith_attacka6 =[ $attack2006, wraith_attacka7 ] {ai_face();};
|
|
void() wraith_attacka7 =[ $attack2007, wraith_attacka8 ] {CreateBoneShard();};
|
|
void() wraith_attacka8 =[ $attack2008, wraith_attacka9 ] {ai_face();};
|
|
void() wraith_attacka9 =[ $attack2009, wraith_run1 ] {};
|
|
|
|
//=============================================================================
|
|
|
|
void() wraith_attackb1 =[ $attack3001, wraith_attackb2 ] {ai_face();};
|
|
void() wraith_attackb2 =[ $attack3002, wraith_attackb3 ] {ai_face();};
|
|
void() wraith_attackb3 =[ $attack3003, wraith_attackb4 ] {ai_face();FireBlast(2,600);};
|
|
void() wraith_attackb4 =[ $attack3004, wraith_attackb5 ] {ai_face();FireBlast(4,600);};
|
|
void() wraith_attackb5 =[ $attack3003, wraith_attackb6 ] {ai_face();FireBlast(6,600);};
|
|
void() wraith_attackb6 =[ $attack3004, wraith_attackb7 ] {ai_face();FireBlast(2,600);};
|
|
void() wraith_attackb7 =[ $attack3003, wraith_attackb8 ] {ai_face();FireBlast(4,600);};
|
|
void() wraith_attackb8 =[ $attack3004, wraith_attackb9 ] {ai_face();FireBlast(6,600);};
|
|
void() wraith_attackb9 =[ $attack3005, wraith_attackb10 ] {ai_face();};
|
|
void() wraith_attackb10 =[ $attack3006, wraith_attackb11 ] {ai_face();};
|
|
void() wraith_attackb11 =[ $attack3007, wraith_attackb12 ] {ai_face();};
|
|
void() wraith_attackb12 =[ $attack3008, wraith_run1 ] {ai_face();};
|
|
|
|
//=============================================================================
|
|
|
|
void() wraith_attackc1 =[ $attack1001, wraith_attackc2 ] {ai_face();ai_charge(15);};
|
|
void() wraith_attackc2 =[ $attack1002, wraith_attackc3 ] {ai_charge(16);ai_melee();};
|
|
void() wraith_attackc3 =[ $attack1003, wraith_attackc4 ] {ai_charge(14);ai_melee();};
|
|
void() wraith_attackc4 =[ $attack1004, wraith_attackc5 ] {ai_charge(15);ai_melee();};
|
|
void() wraith_attackc5 =[ $attack1005, wraith_attackc6 ] {ai_charge(16);};
|
|
void() wraith_attackc6 =[ $attack1006, wraith_run1 ] {ai_charge(14);};
|
|
|
|
//=============================================================================
|
|
|
|
void() wraith_paina1 =[ $pain1001, wraith_paina2 ] {};
|
|
void() wraith_paina2 =[ $pain1002, wraith_paina3 ] {};
|
|
void() wraith_paina3 =[ $pain1003, wraith_paina4 ] {};
|
|
void() wraith_paina4 =[ $pain1004, wraith_run1 ] {};
|
|
|
|
//=============================================================================
|
|
|
|
void() wraith_painb1 =[ $pain2001, wraith_painb2 ] {};
|
|
void() wraith_painb2 =[ $pain2002, wraith_painb3 ] {};
|
|
void() wraith_painb3 =[ $pain2003, wraith_painb4 ] {};
|
|
void() wraith_painb4 =[ $pain2004, wraith_run1 ] {};
|
|
|
|
void() wraith_pain =
|
|
{
|
|
if (self.pain_finished > time)
|
|
return;
|
|
|
|
//play a random pain sound
|
|
wraith_painsound();
|
|
|
|
if (random() <= 0.5)
|
|
wraith_paina1 ();
|
|
else
|
|
wraith_painb1 ();
|
|
self.pain_finished = time + 3;
|
|
};
|
|
|
|
//=============================================================================
|
|
|
|
void() wraith_deathfinish =
|
|
{
|
|
spawn_tfog (self.origin);
|
|
spawn_tdeath (self.origin, self);
|
|
remove(self);
|
|
return;
|
|
};
|
|
|
|
void() wraith_death1 =[ $death001, wraith_death2 ] {};
|
|
void() wraith_death2 =[ $death002, wraith_death3 ] {};
|
|
void() wraith_death3 =[ $death003, wraith_death4 ] {};
|
|
void() wraith_death4 =[ $death004, wraith_death5 ] {};
|
|
void() wraith_death5 =[ $death005, wraith_death6 ] {};
|
|
void() wraith_death6 =[ $death006, wraith_death7 ] {};
|
|
void() wraith_death7 =[ $death007, wraith_death8 ] {};
|
|
void() wraith_death8 =[ $death008, wraith_death9 ] {};
|
|
void() wraith_death9 =[ $death009, wraith_death9 ] {wraith_deathfinish();};
|
|
|
|
void() wraith_die =
|
|
{
|
|
//gotta let people see me die
|
|
wraith_govisible();
|
|
|
|
sound (self, CHAN_VOICE, "enemy/wraith/death.wav", 1, ATTN_NORM);
|
|
wraith_death1();
|
|
self.solid = SOLID_NOT;
|
|
};
|
|
|
|
//=============================================================================
|
|
|
|
void() wraith_alertsound =
|
|
{
|
|
local float r;
|
|
|
|
//pick one of 3 alert sounds
|
|
r = random();
|
|
if (r <= 0.33)
|
|
sound (self, CHAN_VOICE, "enemy/wraith/alert1.wav", 1, ATTN_NORM);
|
|
else if (r <= 0.66)
|
|
sound (self, CHAN_VOICE, "enemy/wraith/alert2.wav", 1, ATTN_NORM);
|
|
else
|
|
sound (self, CHAN_VOICE, "enemy/wraith/alert3.wav", 1, ATTN_NORM);
|
|
};
|
|
|
|
void() wraith_attacksound =
|
|
{
|
|
local float r;
|
|
|
|
//pick one of 3 attack sounds
|
|
r = random();
|
|
if (r <= 0.33)
|
|
sound (self, CHAN_VOICE, "enemy/wraith/pain1.wav", 1, ATTN_NORM);
|
|
else if (r <= 0.66)
|
|
sound (self, CHAN_VOICE, "enemy/wraith/pain2.wav", 1, ATTN_NORM);
|
|
else
|
|
sound (self, CHAN_VOICE, "enemy/wraith/pain3.wav", 1, ATTN_NORM);
|
|
};
|
|
|
|
void() wraith_idlesound =
|
|
{
|
|
//don't always play idlesound
|
|
if (random() < 0.3)
|
|
sound (self, CHAN_VOICE, "enemy/wraith/dance.wav", 1, ATTN_IDLE);
|
|
};
|
|
|
|
void() wraith_painsound =
|
|
{
|
|
local float r;
|
|
|
|
//pick one of 2 pain sounds
|
|
r = random();
|
|
if (r <= 0.5)
|
|
sound (self, CHAN_VOICE, "enemy/wraith/pain4.wav", 1, ATTN_NORM);
|
|
else
|
|
sound (self, CHAN_VOICE, "enemy/wraith/pain5.wav", 1, ATTN_NORM);
|
|
};
|
|
|
|
void() wraith_goinvisible =
|
|
{
|
|
// setmodel (self, "");
|
|
// setsize (self, '-16 -16 -24', '16 16 40');
|
|
self.alpha = set_fade(0.2);
|
|
};
|
|
|
|
void() wraith_govisible =
|
|
{
|
|
// setmodel (self, "models/enemies/wraith.md2");
|
|
// setsize (self, '-16 -16 -24', '16 16 40');
|
|
self.alpha = 1;
|
|
};
|
|
|
|
float wraith_invis;
|
|
|
|
void() wraith_invisible =
|
|
{
|
|
//random chance of turning invisible or not
|
|
if (random () <= 0.3)
|
|
{
|
|
//if wraith_invis is set to 1 then turn invisible, otherwise turn visible
|
|
wraith_invis = wraith_invis + 1;
|
|
if (wraith_invis == 1)
|
|
wraith_goinvisible();
|
|
else
|
|
{
|
|
wraith_invis = 0;
|
|
wraith_govisible();
|
|
}
|
|
}
|
|
};
|
|
|
|
void() wraith_teleport =
|
|
{
|
|
//random chance of teleporting
|
|
if (random() <= 0.3)
|
|
monster_teleport(2); //teleport behind self.enemy
|
|
};
|
|
|
|
void() wraith_missileAttack =
|
|
{
|
|
//play a random attack sound
|
|
wraith_attacksound();
|
|
|
|
if (random() <= 0.5)
|
|
wraith_attacka1(); //Bone Shard Attack
|
|
else
|
|
wraith_attackb1(); //Fire Blast Attack
|
|
};
|
|
|
|
void() wraith_melee =
|
|
{
|
|
//wraith shouldnt rely on melee attack too much
|
|
if (random() <= 0.5)
|
|
{
|
|
wraith_attacksound(); //play a random attack sound
|
|
wraith_attackc1();
|
|
}
|
|
else
|
|
wraith_missileAttack();
|
|
};
|
|
|
|
//=================================================================
|
|
|
|
/*QUAKED monster_wraith (1 0 0) (-32 -32 -24) (32 32 48) Ambush
|
|
*/
|
|
void() monster_wraith =
|
|
{
|
|
if (deathmatch)
|
|
{
|
|
remove(self);
|
|
return;
|
|
}
|
|
|
|
precache_model ("models/enemies/wraith.md2");
|
|
precache_model ("models/weapons/gfx/bone.mdl");
|
|
precache_model ("progs/flame2.mdl");
|
|
|
|
precache_sound ("enemy/wraith/alert1.wav");
|
|
precache_sound ("enemy/wraith/alert2.wav");
|
|
precache_sound ("enemy/wraith/alert3.wav");
|
|
precache_sound ("enemy/wraith/dance.wav");
|
|
precache_sound ("enemy/wraith/death.wav");
|
|
precache_sound ("enemy/wraith/pain1.wav");
|
|
precache_sound ("enemy/wraith/pain2.wav");
|
|
precache_sound ("enemy/wraith/pain3.wav");
|
|
precache_sound ("enemy/wraith/pain4.wav");
|
|
precache_sound ("enemy/wraith/pain5.wav");
|
|
precache_sound ("enemy/wraith/spawn.wav");
|
|
precache_sound ("weapons/lock4.wav"); //used for missile touch function
|
|
|
|
self.solid = SOLID_SLIDEBOX;
|
|
self.movetype = MOVETYPE_STEP;
|
|
|
|
setmodel (self, "models/enemies/wraith.md2");
|
|
|
|
setsize (self, '-16 -16 -24', '16 16 40');
|
|
// setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX);
|
|
self.health = set_health(400);
|
|
self.speed = set_speed(300);
|
|
self.dtype = 3; //dodge type teleport
|
|
|
|
self.th_stand = wraith_standa1;
|
|
self.th_walk = wraith_walk1;
|
|
self.th_run = wraith_run1;
|
|
self.th_die = wraith_die;
|
|
self.th_pain = wraith_pain;
|
|
self.th_melee = wraith_melee;
|
|
self.th_missile = wraith_missileAttack;
|
|
|
|
//my new classname is?
|
|
self.classname = "monster_wraith";
|
|
|
|
//set up our monflag
|
|
self.monflag = "TRUE";
|
|
|
|
//difficulty optimization
|
|
remove_monster();
|
|
|
|
walkmonster_start ();
|
|
|
|
};
|
|
|
|
/*
|
|
=================
|
|
create_wraithbot
|
|
|
|
Creates a Wraith at the specified 'spot'.
|
|
This is used by demon portals in Flood Co-op.
|
|
=================
|
|
*/
|
|
void(vector spot) create_wraithbot =
|
|
{
|
|
local entity bot;
|
|
|
|
// start entity and place it in world
|
|
bot = spawn();
|
|
bot.angles = self.angles;
|
|
setorigin (bot, spot);
|
|
bot.fixangle = TRUE;
|
|
spawn_tfog (bot.origin);
|
|
spawn_tdeath (bot.origin, bot);
|
|
|
|
// set size and shape
|
|
bot.solid = SOLID_SLIDEBOX;
|
|
bot.movetype = MOVETYPE_STEP;
|
|
setmodel (bot, "models/enemies/wraith.md2");
|
|
setsize (bot, '-16 -16 -24', '16 16 40');
|
|
bot.flags = bot.flags | FL_MONSTER;
|
|
bot.takedamage = DAMAGE_AIM;
|
|
|
|
// define his animation
|
|
bot.th_stand = wraith_standa1;
|
|
bot.th_walk = wraith_walk1;
|
|
bot.th_run = wraith_run1;
|
|
bot.th_die = wraith_die;
|
|
bot.th_pain = wraith_pain;
|
|
bot.th_melee = wraith_melee;
|
|
bot.th_missile = wraith_missileAttack;
|
|
bot.health = set_health(400);
|
|
bot.speed = set_speed(300);
|
|
bot.dtype = 3; //dodge type teleport
|
|
bot.alpha = 1; //we aren't transparent
|
|
|
|
// polish him up
|
|
bot.classname = "monster_wraith";
|
|
bot.ideal_yaw = bot.angles * '0 1 0';
|
|
bot.yaw_speed = 120;
|
|
bot.view_ofs = '0 0 22';
|
|
|
|
//set up our monflag
|
|
bot.monflag = "TRUE";
|
|
|
|
// begin his thinking
|
|
bot.nextthink = time + 0.1 + random();
|
|
bot.think = th_stuck;
|
|
|
|
};
|
|
|