ew-progs/ew/monsters/scout.qc

595 lines
24 KiB
C++
Raw Normal View History

2011-09-06 00:00:00 +00:00
/*
==============================================================================
Scout
coded by Michael Rogers
some code done by iD software
==============================================================================
*/
$cd /models/enemies
$origin 0 0 24
$base base
$skin base
//===========================================================================
$frame idle101 idle102 idle103 idle104 idle105 idle106 idle107 idle108 idle109 idle110
$frame idle111 idle112 idle113 idle114 idle115 idle116 idle117 idle118 idle119
$frame idle201 idle202 idle203 idle204 idle205 idle206 idle207 idle208 idle209 idle210
$frame idle211 idle212 idle213 idle214 idle215 idle216 idle217 idle218 idle219 idle220
$frame idle221 idle222 idle223 idle224 idle225 idle226 idle227 idle228 idle229 idle230
$frame idle231 idle232 idle233 idle234 idle235 idle236 idle237 idle238 idle239 idle240
$frame idle301 idle302 idle303 idle304 idle305 idle306 idle307 idle308 idle309 idle310
$frame idle311 idle312 idle313
$frame idle401 idle402 idle403 idle404
$frame idle501 idle502 idle503 idle504 idle505 idle506 idle507 idle508 idle509 idle510
$frame idle511 idle512 idle513 idle514 idle515 idle516 idle517 idle518 idle519 idle520
$frame idle601 idle602 idle603 idle604 idle605
$frame run01 run02 run03 run04 run05 run06 run07 run08
$frame walk01 walk02 walk03 walk04 walk05 walk06 walk07 walk08 walk09 walk10
$frame walk11 walk12
$frame attack101 attack102 attack103 attack104 attack105 attack106 attack107
$frame attack201 attack202 attack203 attack204 attack205 attack206 attack207 attack208 attack209 attack210
$frame attack211
$frame attack301 attack302 attack303 attack304 attack305 attack306 attack307
$frame pain101 pain102 pain103 pain104
$frame pain201 pain202 pain203 pain204 pain205
$frame pain301 pain302 pain303 pain304 pain305 pain306 pain307 pain308 pain309 pain310
$frame pain311
$frame pain401 pain402 pain403 pain404 pain405
$frame death101 death102 death103 death104 death105 death106 death107 death108 death109 death110
$frame death111 death112 death113 death114 death115 death116 death117 death118 death119 death120
$frame death121 death122 death123 death124 death125 death126 death127 death128 death129 death130
$frame death201 death202 death203 death204 death205 death206 death207 death208 death209 death210
$frame death301 death302 death303 death304 death305 death306 death307 death308 death309 death310
$frame death311
$frame death401 death402 death403 death404 death405 death406 death407 death408 death409
$frame death5001 death5002 death5003 death5004 death5005 death5006 death5007 death5008 death5009 death5010
$frame death5011 death5012 death5013 death5014 death5015 death5016 death5017 death5018
$frame walkns01 walkns02 walkns03 walkns04 walkns05 walkns06 walkns07 walkns08 walkns09 walkns10
$frame walkns11 walkns12
$frame walkns01 walkns02 walkns03 walkns04 walkns05 walkns06 walkns07 walkns08 walkns09 walkns10
$frame walkns11 walkns12
$frame block101 block102 block103 block104 block105 block106 block107
$frame limp101 limp102 limp103 limp104 limp105 limp106 limp107 limp108 limp109
void() outrider_painsound;
void() outrider_deathsound;
//===========================================================================
void() scout_stand1 =[ $idle101, scout_stand2 ] {ai_stand();};
void() scout_stand2 =[ $idle102, scout_stand3 ] {ai_stand();};
void() scout_stand3 =[ $idle103, scout_stand4 ] {ai_stand();};
void() scout_stand4 =[ $idle104, scout_stand5 ] {ai_stand();};
void() scout_stand5 =[ $idle105, scout_stand6 ] {ai_stand();};
void() scout_stand6 =[ $idle106, scout_stand7 ] {ai_stand();};
void() scout_stand7 =[ $idle107, scout_stand8 ] {ai_stand();};
void() scout_stand8 =[ $idle108, scout_stand9 ] {ai_stand();};
void() scout_stand9 =[ $idle109, scout_stand10 ] {ai_stand();};
void() scout_stand10 =[ $idle110, scout_stand11 ] {ai_stand();};
void() scout_stand11 =[ $idle111, scout_stand12 ] {ai_stand();};
void() scout_stand12 =[ $idle112, scout_stand13 ] {ai_stand();};
void() scout_stand13 =[ $idle113, scout_stand14 ] {ai_stand();};
void() scout_stand14 =[ $idle114, scout_stand15 ] {ai_stand();};
void() scout_stand15 =[ $idle115, scout_stand16 ] {ai_stand();};
void() scout_stand16 =[ $idle116, scout_stand17 ] {ai_stand();};
void() scout_stand17 =[ $idle117, scout_stand18 ] {ai_stand();};
void() scout_stand18 =[ $idle118, scout_stand19 ] {ai_stand();};
void() scout_stand19 =[ $idle119, scout_stand20 ] {ai_stand();};
void() scout_stand20 =[ $idle201, scout_stand21 ] {ai_stand();};
void() scout_stand21 =[ $idle202, scout_stand22 ] {ai_stand();};
void() scout_stand22 =[ $idle203, scout_stand23 ] {ai_stand();};
void() scout_stand23 =[ $idle204, scout_stand24 ] {ai_stand();};
void() scout_stand24 =[ $idle205, scout_stand25 ] {ai_stand();};
void() scout_stand25 =[ $idle206, scout_stand26 ] {ai_stand();};
void() scout_stand26 =[ $idle207, scout_stand27 ] {ai_stand();};
void() scout_stand27 =[ $idle208, scout_stand28 ] {ai_stand();};
void() scout_stand28 =[ $idle209, scout_stand29 ] {ai_stand();};
void() scout_stand29 =[ $idle210, scout_stand30 ] {ai_stand();};
void() scout_stand30 =[ $idle211, scout_stand31 ] {ai_stand();};
void() scout_stand31 =[ $idle212, scout_stand32 ] {ai_stand();};
void() scout_stand32 =[ $idle213, scout_stand33 ] {ai_stand();};
void() scout_stand33 =[ $idle214, scout_stand34 ] {ai_stand();};
void() scout_stand34 =[ $idle215, scout_stand35 ] {ai_stand();};
void() scout_stand35 =[ $idle216, scout_stand36 ] {ai_stand();};
void() scout_stand36 =[ $idle217, scout_stand37 ] {ai_stand();};
void() scout_stand37 =[ $idle218, scout_stand38 ] {ai_stand();};
void() scout_stand38 =[ $idle219, scout_stand39 ] {ai_stand();};
void() scout_stand39 =[ $idle220, scout_stand40 ] {ai_stand();};
void() scout_stand40 =[ $idle221, scout_stand41 ] {ai_stand();};
void() scout_stand41 =[ $idle222, scout_stand42 ] {ai_stand();};
void() scout_stand42 =[ $idle223, scout_stand43 ] {ai_stand();};
void() scout_stand43 =[ $idle224, scout_stand44 ] {ai_stand();};
void() scout_stand44 =[ $idle225, scout_stand45 ] {ai_stand();};
void() scout_stand45 =[ $idle226, scout_stand46 ] {ai_stand();};
void() scout_stand46 =[ $idle227, scout_stand47 ] {ai_stand();};
void() scout_stand47 =[ $idle228, scout_stand48 ] {ai_stand();};
void() scout_stand48 =[ $idle229, scout_stand49 ] {ai_stand();};
void() scout_stand49 =[ $idle230, scout_stand50 ] {ai_stand();};
void() scout_stand50 =[ $idle231, scout_stand51 ] {ai_stand();};
void() scout_stand51 =[ $idle232, scout_stand52 ] {ai_stand();};
void() scout_stand52 =[ $idle233, scout_stand53 ] {ai_stand();};
void() scout_stand53 =[ $idle234, scout_stand54 ] {ai_stand();};
void() scout_stand54 =[ $idle235, scout_stand55 ] {ai_stand();};
void() scout_stand55 =[ $idle236, scout_stand56 ] {ai_stand();};
void() scout_stand56 =[ $idle237, scout_stand57 ] {ai_stand();};
void() scout_stand57 =[ $idle238, scout_stand58 ] {ai_stand();};
void() scout_stand58 =[ $idle239, scout_stand59 ] {ai_stand();};
void() scout_stand59 =[ $idle240, scout_stand60 ] {ai_stand();};
void() scout_stand60 =[ $idle301, scout_stand61 ] {ai_stand();};
void() scout_stand61 =[ $idle302, scout_stand62 ] {ai_stand();};
void() scout_stand62 =[ $idle303, scout_stand63 ] {ai_stand();};
void() scout_stand63 =[ $idle304, scout_stand64 ] {ai_stand();};
void() scout_stand64 =[ $idle305, scout_stand65 ] {ai_stand();};
void() scout_stand65 =[ $idle306, scout_stand66 ] {ai_stand();};
void() scout_stand66 =[ $idle307, scout_stand67 ] {ai_stand();};
void() scout_stand67 =[ $idle308, scout_stand68 ] {ai_stand();};
void() scout_stand68 =[ $idle309, scout_stand69 ] {ai_stand();};
void() scout_stand69 =[ $idle310, scout_stand70 ] {ai_stand();};
void() scout_stand70 =[ $idle311, scout_stand71 ] {ai_stand();};
void() scout_stand71 =[ $idle312, scout_stand72 ] {ai_stand();};
void() scout_stand72 =[ $idle313, scout_stand73 ] {ai_stand();};
void() scout_stand73 =[ $idle401, scout_stand74 ] {ai_stand();};
void() scout_stand74 =[ $idle402, scout_stand75 ] {ai_stand();};
void() scout_stand75 =[ $idle403, scout_stand76 ] {ai_stand();};
void() scout_stand76 =[ $idle404, scout_stand77 ] {ai_stand();};
void() scout_stand77 =[ $idle501, scout_stand78 ] {ai_stand();};
void() scout_stand78 =[ $idle502, scout_stand79 ] {ai_stand();};
void() scout_stand79 =[ $idle503, scout_stand80 ] {ai_stand();};
void() scout_stand80 =[ $idle504, scout_stand81 ] {ai_stand();};
void() scout_stand81 =[ $idle505, scout_stand82 ] {ai_stand();};
void() scout_stand82 =[ $idle506, scout_stand83 ] {ai_stand();};
void() scout_stand83 =[ $idle507, scout_stand84 ] {ai_stand();};
void() scout_stand84 =[ $idle508, scout_stand85 ] {ai_stand();};
void() scout_stand85 =[ $idle509, scout_stand86 ] {ai_stand();};
void() scout_stand86 =[ $idle510, scout_stand87 ] {ai_stand();};
void() scout_stand87 =[ $idle511, scout_stand88 ] {ai_stand();};
void() scout_stand88 =[ $idle512, scout_stand89 ] {ai_stand();};
void() scout_stand89 =[ $idle513, scout_stand90 ] {ai_stand();};
void() scout_stand90 =[ $idle514, scout_stand91 ] {ai_stand();};
void() scout_stand91 =[ $idle515, scout_stand92 ] {ai_stand();};
void() scout_stand92 =[ $idle516, scout_stand93 ] {ai_stand();};
void() scout_stand93 =[ $idle517, scout_stand94 ] {ai_stand();};
void() scout_stand94 =[ $idle518, scout_stand95 ] {ai_stand();};
void() scout_stand95 =[ $idle519, scout_stand96 ] {ai_stand();};
void() scout_stand96 =[ $idle520, scout_stand97 ] {ai_stand();};
void() scout_stand97 =[ $idle601, scout_stand98 ] {ai_stand();};
void() scout_stand98 =[ $idle602, scout_stand99 ] {ai_stand();};
void() scout_stand99 =[ $idle603, scout_stand100 ] {ai_stand();};
void() scout_stand100 =[ $idle604, scout_stand101 ] {ai_stand();};
void() scout_stand101 =[ $idle605, scout_stand1 ] {ai_stand();};
//===========================================================================
void() scout_run1 =[ $run01, scout_run2 ] {ai_run(12);};
void() scout_run2 =[ $run02, scout_run3 ] {ai_run(15);};
void() scout_run3 =[ $run03, scout_run4 ] {ai_run(14);};
void() scout_run4 =[ $run04, scout_run5 ] {ai_run(17);};
void() scout_run5 =[ $run05, scout_run6 ] {ai_run(13);};
void() scout_run6 =[ $run06, scout_run7 ] {ai_run(15);};
void() scout_run7 =[ $run07, scout_run8 ] {ai_run(12);};
void() scout_run8 =[ $run08, scout_run1 ] {ai_run(13);};
//===========================================================================
void() scout_walks1 =[ $walk01, scout_walks2 ] {ai_walk(5);};
void() scout_walks2 =[ $walk02, scout_walks3 ] {ai_walk(6);};
void() scout_walks3 =[ $walk03, scout_walks4 ] {ai_walk(4);};
void() scout_walks4 =[ $walk04, scout_walks5 ] {ai_walk(7);};
void() scout_walks5 =[ $walk05, scout_walks6 ] {ai_walk(5);};
void() scout_walks6 =[ $walk06, scout_walks7 ] {ai_walk(6);};
void() scout_walks7 =[ $walk07, scout_walks8 ] {ai_walk(4);};
void() scout_walks8 =[ $walk08, scout_walks9 ] {ai_walk(7);};
void() scout_walks9 =[ $walk09, scout_walks10 ] {ai_walk(5);};
void() scout_walks10 =[ $walk10, scout_walks11 ] {ai_walk(6);};
void() scout_walks11 =[ $walk11, scout_walks12 ] {ai_walk(4);};
void() scout_walks12 =[ $walk12, scout_walks1 ] {ai_walk(7);};
//===========================================================================
void() scout_atka1 =[ $attack101, scout_atka2 ] {ai_charge(20);};
void() scout_atka2 =[ $attack102, scout_atka3 ] {ai_charge_side();};
void() scout_atka3 =[ $attack103, scout_atka4 ] {ai_charge_side();};
void() scout_atka4 =[ $attack104, scout_atka5 ] {ai_charge_side();};
void() scout_atka5 =[ $attack105, scout_atka6 ] {ai_melee_side();};
void() scout_atka6 =[ $attack106, scout_atka7 ] {ai_melee_side();};
void() scout_atka7 =[ $attack107, scout_run1 ] {ai_charge(20);};
//===========================================================================
void() scout_atkb1 =[ $attack201, scout_atkb2 ] {ai_charge(15);};
void() scout_atkb2 =[ $attack202, scout_atkb3 ] {ai_charge(20);};
void() scout_atkb3 =[ $attack203, scout_atkb4 ] {ai_charge(21);};
void() scout_atkb4 =[ $attack204, scout_atkb5 ] {ai_charge(20);};
void() scout_atkb5 =[ $attack205, scout_atkb6 ] {ai_charge(17);};
void() scout_atkb6 =[ $attack206, scout_atkb7 ] {ai_charge(18);ai_melee();};
void() scout_atkb7 =[ $attack207, scout_atkb8 ] {ai_charge(15);ai_melee();};
void() scout_atkb8 =[ $attack208, scout_atkb9 ] {ai_charge(17);ai_melee();};
void() scout_atkb9 =[ $attack209, scout_atkb10 ] {ai_charge(18);};
void() scout_atkb10 =[ $attack210, scout_atkb11 ] {ai_charge(20);};
void() scout_atkb11 =[ $attack211, scout_run1 ] {ai_charge(21);};
//===========================================================================
void() scout_atkc1 =[ $attack301, scout_atkc2 ] {ai_charge(15);};
void() scout_atkc2 =[ $attack302, scout_atkc3 ] {ai_charge(20);};
void() scout_atkc3 =[ $attack303, scout_atkc4 ] {ai_charge(21);};
void() scout_atkc4 =[ $attack304, scout_atkc5 ] {ai_charge(20);ai_melee();};
void() scout_atkc5 =[ $attack305, scout_atkc6 ] {ai_charge(17);ai_melee();};
void() scout_atkc6 =[ $attack306, scout_atkc7 ] {ai_charge(18);ai_melee();};
void() scout_atkc7 =[ $attack307, scout_run1 ] {ai_charge(15);};
//===========================================================================
void() scout_paina1 =[ $pain101, scout_paina2 ] {};
void() scout_paina2 =[ $pain102, scout_paina3 ] {};
void() scout_paina3 =[ $pain103, scout_paina4 ] {};
void() scout_paina4 =[ $pain104, scout_run1 ] {};
//===========================================================================
void() scout_painb1 =[ $pain201, scout_painb2 ] {};
void() scout_painb2 =[ $pain202, scout_painb3 ] {};
void() scout_painb3 =[ $pain203, scout_painb4 ] {};
void() scout_painb4 =[ $pain204, scout_painb5 ] {};
void() scout_painb5 =[ $pain205, scout_run1 ] {};
//===========================================================================
void() scout_painc1 =[ $pain301, scout_painc2 ] {};
void() scout_painc2 =[ $pain302, scout_painc3 ] {};
void() scout_painc3 =[ $pain303, scout_painc4 ] {};
void() scout_painc4 =[ $pain304, scout_painc5 ] {};
void() scout_painc5 =[ $pain305, scout_painc6 ] {};
void() scout_painc6 =[ $pain306, scout_painc7 ] {};
void() scout_painc7 =[ $pain307, scout_painc8 ] {};
void() scout_painc8 =[ $pain308, scout_painc9 ] {};
void() scout_painc9 =[ $pain309, scout_painc10 ] {};
void() scout_painc10 =[ $pain310, scout_painc11 ] {};
void() scout_painc11 =[ $pain311, scout_run1 ] {};
//===========================================================================
void() scout_paind1 =[ $pain401, scout_paind2 ] {};
void() scout_paind2 =[ $pain402, scout_paind3 ] {};
void() scout_paind3 =[ $pain403, scout_paind4 ] {};
void() scout_paind4 =[ $pain404, scout_paind5 ] {};
void() scout_paind5 =[ $pain405, scout_run1 ] {};
void(entity attacker, float damage) scout_pain =
{
local float r;
if (self.pain_finished > time)
return;
r = random();
//play random pain sound
outrider_painsound();
if (r < 0.25)
scout_paina1 ();
else if(r < 0.50)
scout_painb1 ();
else if(r < 0.75)
scout_painc1 ();
else
scout_paind1 ();
self.pain_finished = time + 1;
};
//===========================================================================
void() scout_diea1 =[ $death101, scout_diea2 ] {};
void() scout_diea2 =[ $death102, scout_diea3 ] {};
void() scout_diea3 =[ $death103, scout_diea4 ] {self.solid = SOLID_NOT;};
void() scout_diea4 =[ $death104, scout_diea5 ] {};
void() scout_diea5 =[ $death105, scout_diea6 ] {};
void() scout_diea6 =[ $death106, scout_diea7 ] {};
void() scout_diea7 =[ $death107, scout_diea8 ] {};
void() scout_diea8 =[ $death108, scout_diea9 ] {};
void() scout_diea9 =[ $death109, scout_diea10 ] {};
void() scout_diea10 =[ $death110, scout_diea11 ] {};
void() scout_diea11 =[ $death111, scout_diea12 ] {};
void() scout_diea12 =[ $death112, scout_diea13 ] {};
void() scout_diea13 =[ $death113, scout_diea14 ] {};
void() scout_diea14 =[ $death114, scout_diea15 ] {};
void() scout_diea15 =[ $death115, scout_diea16 ] {};
void() scout_diea16 =[ $death116, scout_diea17 ] {};
void() scout_diea17 =[ $death117, scout_diea18 ] {};
void() scout_diea18 =[ $death118, scout_diea19 ] {};
void() scout_diea19 =[ $death119, scout_diea20 ] {};
void() scout_diea20 =[ $death120, scout_diea21 ] {};
void() scout_diea21 =[ $death121, scout_diea22 ] {};
void() scout_diea22 =[ $death122, scout_diea23 ] {};
void() scout_diea23 =[ $death123, scout_diea24 ] {};
void() scout_diea24 =[ $death124, scout_diea25 ] {};
void() scout_diea25 =[ $death125, scout_diea26 ] {};
void() scout_diea26 =[ $death126, scout_diea27 ] {};
void() scout_diea27 =[ $death127, scout_diea28 ] {};
void() scout_diea28 =[ $death128, scout_diea29 ] {};
void() scout_diea29 =[ $death129, scout_diea30 ] {};
void() scout_diea30 =[ $death130, scout_diea30 ] {banish_monster();};
//===========================================================================
void() scout_dieb1 =[ $death201, scout_dieb2 ] {};
void() scout_dieb2 =[ $death202, scout_dieb3 ] {};
void() scout_dieb3 =[ $death203, scout_dieb4 ] {self.solid = SOLID_NOT;};
void() scout_dieb4 =[ $death204, scout_dieb5 ] {};
void() scout_dieb5 =[ $death205, scout_dieb6 ] {};
void() scout_dieb6 =[ $death206, scout_dieb7 ] {};
void() scout_dieb7 =[ $death207, scout_dieb8 ] {};
void() scout_dieb8 =[ $death208, scout_dieb9 ] {};
void() scout_dieb9 =[ $death209, scout_dieb10 ] {};
void() scout_dieb10 =[ $death210, scout_dieb10 ] {banish_monster();};
//===========================================================================
void() scout_diec1 =[ $death301, scout_diec2 ] {};
void() scout_diec2 =[ $death302, scout_diec3 ] {};
void() scout_diec3 =[ $death303, scout_diec4 ] {self.solid = SOLID_NOT;};
void() scout_diec4 =[ $death304, scout_diec5 ] {};
void() scout_diec5 =[ $death305, scout_diec6 ] {};
void() scout_diec6 =[ $death306, scout_diec7 ] {};
void() scout_diec7 =[ $death307, scout_diec8 ] {};
void() scout_diec8 =[ $death308, scout_diec9 ] {};
void() scout_diec9 =[ $death309, scout_diec10 ] {};
void() scout_diec10 =[ $death310, scout_diec11 ] {};
void() scout_diec11 =[ $death311, scout_diec11 ] {banish_monster();};
//===========================================================================
void() scout_died1 =[ $death401, scout_died2 ] {};
void() scout_died2 =[ $death402, scout_died3 ] {};
void() scout_died3 =[ $death403, scout_died4 ] {self.solid = SOLID_NOT;};
void() scout_died4 =[ $death404, scout_died5 ] {};
void() scout_died5 =[ $death405, scout_died6 ] {};
void() scout_died6 =[ $death406, scout_died7 ] {};
void() scout_died7 =[ $death407, scout_died8 ] {};
void() scout_died8 =[ $death408, scout_died9 ] {};
void() scout_died9 =[ $death409, scout_died9 ] {banish_monster();};
void() scout_die =
{
local float r;
r = random();
//pick death sound at random
outrider_deathsound();
if (r < 0.25)
scout_diea1 ();
else if (r < 0.50)
scout_dieb1 ();
else if (r < 0.75)
scout_diec1 ();
else
scout_died1 ();
};
//===========================================================================
/*
void() scout_walkns1 =[ $walkns01, scout_walkns2 ] {ai_walk(1);};
void() scout_walkns2 =[ $walkns02, scout_walkns3 ] {ai_walk(1);};
void() scout_walkns3 =[ $walkns03, scout_walkns4 ] {ai_walk(1);};
void() scout_walkns4 =[ $walkns04, scout_walkns5 ] {ai_walk(1);};
void() scout_walkns5 =[ $walkns05, scout_walkns6 ] {ai_walk(2);};
void() scout_walkns6 =[ $walkns06, scout_walkns7 ] {ai_walk(3);};
void() scout_walkns7 =[ $walkns07, scout_walkns8 ] {ai_walk(4);};
void() scout_walkns8 =[ $walkns08, scout_walkns9 ] {ai_walk(4);};
void() scout_walkns9 =[ $walkns09, scout_walkns10 ] {ai_walk(2);};
void() scout_walkns10 =[ $walkns10, scout_walkns11 ] {ai_walk(2);};
void() scout_walkns11 =[ $walkns11, scout_walkns12 ] {ai_walk(1);};
void() scout_walkns12 =[ $walkns12, scout_walkns1 ] {ai_walk(1);};
void() scout_walk =
{
if (random() < 0.5)
scout_walks1 ();
else
scout_walkns1 ();
};
*/
void() scout_melee =
{
local float len;
// decide if now is a good swing time
len = vlen(self.enemy.origin+self.enemy.view_ofs - (self.origin+self.view_ofs));
if (len<80)
{
if (random() < 0.5)
{
sound (self, CHAN_VOICE, "enemy/scout/slash1.wav", 1, ATTN_NORM);
scout_atkb1 ();
}
else
{
sound (self, CHAN_VOICE, "enemy/scout/slash2.wav", 1, ATTN_NORM);
scout_atkc1 ();
}
}
else
{
sound (self, CHAN_VOICE, "enemy/scout/slash1.wav", 1, ATTN_NORM);
scout_atka1 ();
}
};
//===========================================================================
void() scout_precache =
{
//scout graphics
precache_model ("models/enemies/scout.md2");
//scout sounds
precache_sound ("enemy/scout/alert1.wav");
precache_sound ("enemy/scout/alert2.wav");
precache_sound ("enemy/scout/death1.wav");
precache_sound ("enemy/scout/death2.wav");
precache_sound ("enemy/scout/pain1.wav");
precache_sound ("enemy/scout/pain2.wav");
precache_sound ("enemy/scout/pain3.wav");
precache_sound ("enemy/scout/pain4.wav");
precache_sound ("enemy/scout/slash1.wav");
precache_sound ("enemy/scout/slash2.wav");
};
/*EWED monster_scout (1 0 0) (-16 -16 -24) (16 16 40) Ambush
*/
void() monster_scout =
{
local float r;
if (deathmatch)
{
remove(self);
return;
}
//if we are put in the level directly then call scout_precache
if (self.classname != "monster_army")
scout_precache();
self.solid = SOLID_SLIDEBOX;
self.movetype = MOVETYPE_STEP;
setmodel (self, "models/enemies/scout.md2");
setsize (self, '-16 -16 -24', '16 16 40');
// setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX);
self.health = set_health(45);
self.speed = set_speed(500);
self.dtype = 2; //dodge type forward_strafe
self.alpha = 1; //we aren't transparent
self.th_stand = scout_stand1;
self.th_walk = scout_walks1;
self.th_run = scout_run1;
self.th_melee = scout_melee;
self.th_pain = scout_pain;
self.th_die = scout_die;
//pick a random skin
r = random();
if (r <= 0.25)
self.skin = 0;
else if (r <= 0.5)
self.skin = 1;
else if (r <= 0.75)
self.skin = 2;
else
self.skin = 3;
//my new classname is?
self.classname = "monster_scout";
//set up our monflag
self.monflag = "TRUE";
walkmonster_start ();
};
/*
=================
create_scoutbot
Creates a Scout at the specified 'spot'.
This is used by demon portals in Flood Co-op.
=================
*/
void(vector spot) create_scoutbot =
{
local entity bot;
local float r;
// 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/scout.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 = scout_stand1;
bot.th_walk = scout_walks1;
bot.th_run = scout_run1;
bot.th_melee = scout_melee;
bot.th_pain = scout_pain;
bot.th_die = scout_die;
bot.health = set_health(45);
bot.speed = set_speed(500);
bot.dtype = 2; //dodge type forward_strafe
bot.alpha = 1; //we aren't transparent
// polish him up
bot.classname = "monster_scout";
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";
//pick a random skin
r = random();
if (r <= 0.25)
bot.skin = 0;
else if (r <= 0.5)
bot.skin = 1;
else if (r <= 0.75)
bot.skin = 2;
else
bot.skin = 3;
// begin his thinking
bot.nextthink = time + 0.1 + random();
bot.think = th_stuck;
};