ew-progs/ew/monsters/bossform2.qc
2011-09-06 00:00:00 +00:00

846 lines
26 KiB
C++

/*
==============================================================================
Boss Form 2
coded by Michael Rogers a.k.a Xsniper
http://xsniper.virtualave.net/
==============================================================================
*/
$cd /models/enemies
$origin 0 0 32
$base base
$skin base
$frame ataka01 ataka02 ataka03 ataka04 ataka05 ataka06 ataka07 ataka08 ataka09 ataka10
$frame ataka11 ataka12
$frame atakb01 atakb02 atakb03 atakb04 atakb05 atakb06 atakb07 atakb08 atakb09 atakb10
$frame atakb11 atakb12
$frame jatak01 jatak02 jatak03 jatak04 jatak05 jatak06 jatak07 jatak08 jatak09 jatak10
$frame jatak11 jatak12 jatak13 jatak14 jatak15 jatak16 jatak17
$frame jump
$frame land
$frame pain
$frame painl
$frame roar01 roar02 roar03 roar04 roar05 roar06 roar07 roar08 roar09 roar10
$frame roar11 roar12 roar13 roar14 roar15
$frame run01 run02 run03 run04 run05 run06 run07 run08 run09 run10
$frame stand01 stand02 stand03 stand04 stand05 stand06 stand07 stand08 stand09 stand10
$frame stand11 stand12
$frame walk01 walk02 walk03 walk04 walk05 walk06 walk07 walk08 walk09 walk10
$frame walk11 walk12
$frame wataka01 wataka02 wataka03 wataka04 wataka05 wataka06 wataka07 wataka08 wataka09 wataka10
$frame wataka11 wataka12
$frame watakb01 watakb02 watakb03 watakb04 watakb05 watakb06 watakb07 watakb08 watakb09 watakb10
$frame watakb11 watakb12
void() bossf2_painsound;
void() bossf2_tauntsound;
void() bossf2_run1;
void() bossf2_change_gravity;
void() bossf2_create_hole;
//=================================================================================================
/*
==========================
Abilities Code
==========================
*/
void() bossf2_JumpTouch =
{
local float ldmg;
if (self.health <= 0)
return;
if (other.takedamage)
{
if ( vlen(self.velocity) > 300 )
{
ldmg = 30 + 10*random();
T_Damage (other, self, self, ldmg);
}
}
if (!checkbottom(self))
{
if (self.flags & FL_ONGROUND)
{ // jump randomly to not get hung up
//dprint ("popjump\n");
self.touch = SUB_Null;
self.think = hhound_leap1;
self.nextthink = time + 0.1;
}
return; // not on ground yet
}
self.touch = SUB_Null;
self.think = bossf2_run1;
self.nextthink = time + 0.1;
};
//=================================================================================================
/*
==========================
Animation Frames
==========================
*/
void() bossf2_stand1 =[ $stand01, bossf2_stand2 ] {ai_stand();};
void() bossf2_stand2 =[ $stand02, bossf2_stand3 ] {ai_stand();};
void() bossf2_stand3 =[ $stand03, bossf2_stand4 ] {ai_stand();};
void() bossf2_stand4 =[ $stand04, bossf2_stand5 ] {ai_stand();};
void() bossf2_stand5 =[ $stand05, bossf2_stand6 ] {ai_stand();};
void() bossf2_stand6 =[ $stand06, bossf2_stand7 ] {ai_stand();};
void() bossf2_stand7 =[ $stand07, bossf2_stand8 ] {ai_stand();};
void() bossf2_stand8 =[ $stand08, bossf2_stand9 ] {ai_stand();};
void() bossf2_stand9 =[ $stand09, bossf2_stand10 ] {ai_stand();};
void() bossf2_stand10 =[ $stand10, bossf2_stand11 ] {ai_stand();};
void() bossf2_stand11 =[ $stand11, bossf2_stand12 ] {ai_stand();};
void() bossf2_stand12 =[ $stand12, bossf2_stand1 ] {ai_stand();};
//=================================================================================================
void() bossf2_walk1 =[ $walk01, bossf2_walk2 ] {ai_walk(10);};
void() bossf2_walk2 =[ $walk02, bossf2_walk3 ] {ai_walk(8);};
void() bossf2_walk3 =[ $walk03, bossf2_walk4 ] {ai_walk(6);};
void() bossf2_walk4 =[ $walk04, bossf2_walk5 ] {ai_walk(5);};
void() bossf2_walk5 =[ $walk05, bossf2_walk6 ] {ai_walk(10);};
void() bossf2_walk6 =[ $walk06, bossf2_walk7 ] {ai_walk(8);};
void() bossf2_walk7 =[ $walk07, bossf2_walk8 ] {ai_walk(6);};
void() bossf2_walk8 =[ $walk08, bossf2_walk9 ] {ai_walk(5);};
void() bossf2_walk9 =[ $walk09, bossf2_walk10 ] {ai_walk(10);};
void() bossf2_walk10 =[ $walk10, bossf2_walk11 ] {ai_walk(8);};
void() bossf2_walk11 =[ $walk11, bossf2_walk12 ] {ai_walk(6);};
void() bossf2_walk12 =[ $walk12, bossf2_walk1 ] {ai_walk(5);};
//=================================================================================================
void() bossf2_run1 =[ $run01, bossf2_run2 ]
{
ai_face();
ai_run(20);
bossf2_tauntsound();
//if we can't see our enemy then teleport to center arena
// if (!visible(self.enemy))
// boss_teleport(1);
//change the gravity
bossf2_change_gravity();
};
void() bossf2_run2 =[ $run02, bossf2_run3 ] {ai_run(16);};
void() bossf2_run3 =[ $run03, bossf2_run4 ] {ai_run(12);};
void() bossf2_run4 =[ $run04, bossf2_run5 ] {ai_run(10);};
void() bossf2_run5 =[ $run05, bossf2_run6 ] {ai_run(20);};
void() bossf2_run6 =[ $run06, bossf2_run7 ] {ai_run(16);};
void() bossf2_run7 =[ $run07, bossf2_run8 ] {ai_run(12);};
void() bossf2_run8 =[ $run08, bossf2_run9 ] {ai_run(10);};
void() bossf2_run9 =[ $run09, bossf2_run10 ] {ai_run(20);};
void() bossf2_run10 =[ $run10, bossf2_run1 ] {ai_run(16);};
//=================================================================================================
/*
==========================
Missile Attacks
==========================
*/
//carniv's fireball attack
void() bossf2_ataka1 =[ $ataka01, bossf2_ataka2 ] {ai_face();};
void() bossf2_ataka2 =[ $ataka02, bossf2_ataka3 ] {ai_face();CreateFireball((v_right * 30) - '0 0 20');};
void() bossf2_ataka3 =[ $ataka03, bossf2_ataka4 ] {ai_face();};
void() bossf2_ataka4 =[ $ataka04, bossf2_ataka5 ] {ai_face();};
void() bossf2_ataka5 =[ $ataka05, bossf2_ataka6 ] {ai_face();};
void() bossf2_ataka6 =[ $ataka06, bossf2_ataka7 ] {ai_face();};
void() bossf2_ataka7 =[ $ataka07, bossf2_ataka8 ] {ai_face();};
void() bossf2_ataka8 =[ $ataka08, bossf2_ataka9 ] {ai_face();};
void() bossf2_ataka9 =[ $ataka09, bossf2_ataka10 ] {ai_face();};
void() bossf2_ataka10 =[ $ataka10, bossf2_ataka11 ] {ai_face();};
void() bossf2_ataka11 =[ $ataka11, bossf2_ataka12 ] {ai_face();};
void() bossf2_ataka12 =[ $ataka12, bossf2_run1 ] {ai_face();};
//=================================================================================================
//torment's hell staff attack
void() bossf2_atakb1 =[ $atakb01, bossf2_atakb2 ] {ai_face();HellStaff();};
void() bossf2_atakb2 =[ $atakb02, bossf2_atakb3 ] {ai_face();HellStaff();};
void() bossf2_atakb3 =[ $atakb03, bossf2_atakb4 ] {ai_face();HellStaff();};
void() bossf2_atakb4 =[ $atakb04, bossf2_atakb5 ] {ai_face();HellStaff();};
void() bossf2_atakb5 =[ $atakb05, bossf2_atakb6 ] {ai_face();HellStaff();};
void() bossf2_atakb6 =[ $atakb06, bossf2_atakb7 ] {ai_face();HellStaff();};
void() bossf2_atakb7 =[ $atakb07, bossf2_atakb8 ] {ai_face();HellStaff();};
void() bossf2_atakb8 =[ $atakb08, bossf2_atakb9 ] {ai_face();HellStaff();};
void() bossf2_atakb9 =[ $atakb09, bossf2_atakb10 ] {ai_face();HellStaff();};
void() bossf2_atakb10 =[ $atakb10, bossf2_atakb11 ] {ai_face();HellStaff();};
void() bossf2_atakb11 =[ $atakb11, bossf2_atakb12 ] {ai_face();HellStaff();};
void() bossf2_atakb12 =[ $atakb12, bossf2_run1 ] {ai_face();HellStaff();};
//=================================================================================================
//jump attack
void() bossf2_jatak1 =[ $jatak01, bossf2_jatak2 ] {ai_face();};
void() bossf2_jatak2 =[ $jatak02, bossf2_jatak3 ]
{
ai_face();
self.touch = bossf2_JumpTouch;
makevectors (self.angles);
self.origin_z = self.origin_z + 1;
self.velocity = v_forward * 600 + '0 0 300';
if (self.flags & FL_ONGROUND)
self.flags = self.flags - FL_ONGROUND;
};
void() bossf2_jatak3 =[ $jatak03, bossf2_jatak4 ] {};
void() bossf2_jatak4 =[ $jatak04, bossf2_jatak5 ] {};
void() bossf2_jatak5 =[ $jatak05, bossf2_jatak6 ] {};
void() bossf2_jatak6 =[ $jatak06, bossf2_jatak7 ] {};
void() bossf2_jatak7 =[ $jatak07, bossf2_jatak8 ] {};
void() bossf2_jatak8 =[ $jatak08, bossf2_jatak9 ] {};
void() bossf2_jatak9 =[ $jatak09, bossf2_jatak10 ] {};
void() bossf2_jatak10 =[ $jatak10, bossf2_jatak11 ] {};
void() bossf2_jatak11 =[ $jatak11, bossf2_jatak12 ] {};
void() bossf2_jatak12 =[ $jatak12, bossf2_jatak13 ] {};
void() bossf2_jatak13 =[ $jatak13, bossf2_jatak14 ] {};
void() bossf2_jatak14 =[ $jatak14, bossf2_jatak15 ] {};
void() bossf2_jatak15 =[ $jatak15, bossf2_jatak16 ] {};
void() bossf2_jatak16 =[ $jatak16, bossf2_jatak17 ] {};
void() bossf2_jatak17 =[ $jatak17, bossf2_jatak17 ] {};
//=================================================================================================
/*
==========================
Melee Attacks
==========================
*/
void() bossf2_atakc1 =[ $ataka01, bossf2_atakc2 ] {ai_face();ai_charge(30);};
void() bossf2_atakc2 =[ $ataka02, bossf2_atakc3 ] {ai_charge(26);ai_melee();};
void() bossf2_atakc3 =[ $ataka03, bossf2_atakc4 ] {ai_charge(22);ai_melee();};
void() bossf2_atakc4 =[ $ataka04, bossf2_atakc5 ] {ai_charge(20);ai_melee();};
void() bossf2_atakc5 =[ $ataka05, bossf2_atakc6 ] {ai_charge(30);ai_melee();};
void() bossf2_atakc6 =[ $ataka06, bossf2_atakc7 ] {ai_charge(26);ai_melee();};
void() bossf2_atakc7 =[ $ataka07, bossf2_atakc8 ] {};
void() bossf2_atakc8 =[ $ataka08, bossf2_atakc9 ] {};
void() bossf2_atakc9 =[ $ataka09, bossf2_atakc10 ] {};
void() bossf2_atakc10 =[ $ataka10, bossf2_atakc11 ] {};
void() bossf2_atakc11 =[ $ataka11, bossf2_atakc12 ] {};
void() bossf2_atakc12 =[ $ataka12, bossf2_run1 ] {};
//=================================================================================================
void() bossf2_atakd1 =[ $atakb01, bossf2_atakd2 ] {ai_face();ai_charge(30);};
void() bossf2_atakd2 =[ $atakb02, bossf2_atakd3 ] {ai_charge(26);ai_melee();};
void() bossf2_atakd3 =[ $atakb03, bossf2_atakd4 ] {ai_charge(22);ai_melee();};
void() bossf2_atakd4 =[ $atakb04, bossf2_atakd5 ] {ai_charge(20);ai_melee();};
void() bossf2_atakd5 =[ $atakb05, bossf2_atakd6 ] {ai_charge(30);ai_melee();};
void() bossf2_atakd6 =[ $atakb06, bossf2_atakd7 ] {ai_charge(26);ai_melee();};
void() bossf2_atakd7 =[ $atakb07, bossf2_atakd8 ] {};
void() bossf2_atakd8 =[ $atakb08, bossf2_atakd9 ] {};
void() bossf2_atakd9 =[ $atakb09, bossf2_atakd10 ] {};
void() bossf2_atakd10 =[ $atakb10, bossf2_atakd11 ] {};
void() bossf2_atakd11 =[ $atakb11, bossf2_atakd12 ] {};
void() bossf2_atakd12 =[ $atakb12, bossf2_run1 ] {};
//=================================================================================================
void(vector spot, float continue, float x, float antix) create_fire_column
/*
==========================
Our Grand Entrance!
==========================
*/
void(float fdist) bossf2_create_fire =
{
local float firecount, anticount, firetime;
local vector start, plus;
//set up angles stuff
makevectors (self.angles);
self.v_angle = self.angles;
//set the starting height
start = '0 0 -10';
//set the increment amount
plus = '0 0 20';
//initialize firecount and anticount
firecount = 7;
anticount = 0;
//create fire columns
while(firecount > 0)
{
//to his left
create_fire_column(((self.origin - (v_right * fdist)) + start),0,firecount,anticount);
//to his right
create_fire_column(((self.origin + (v_right * fdist)) + start),0,firecount,anticount);
start = start + plus;
firecount = firecount - 1;
}
};
void(float fdist) bossf2_create_fire2 =
{
local float firecount, anticount, firetime;
local vector start, plus;
//set up angles stuff
makevectors (self.angles);
self.v_angle = self.angles;
//set the starting height
start = '0 0 -10';
//set the increment amount
plus = '0 0 20';
//initialize firecount and anticount
firecount = 7;
anticount = 0;
//create fire columns
while(firecount > 0)
{
//infront
create_fire_column(((self.origin - (v_forward * fdist)) + start),0,firecount,anticount);
//behind
create_fire_column(((self.origin + (v_forward * fdist)) + start),0,firecount,anticount);
start = start + plus;
firecount = firecount - 1;
}
};
void() bossf2_roara1 =[ $roar01, bossf2_roara2 ]
{
//lets become untouchable ^_-
self.solid = SOLID_NOT;
//face the player
ai_face_player();
//lets go slow motion for this!
adjust_speed(3,0);
//make some noise
sound (self, CHAN_VOICE, "boss2/bf2sightslow.wav", 1, ATTN_NORM);
//lets create some fire
bossf2_create_fire(80);
};
void() bossf2_roara2 =[ $roar02, bossf2_roara3 ] {};
void() bossf2_roara3 =[ $roar03, bossf2_roara4 ] {};
void() bossf2_roara4 =[ $roar04, bossf2_roara5 ] {};
void() bossf2_roara5 =[ $roar05, bossf2_roara6 ] {};
void() bossf2_roara6 =[ $roar06, bossf2_roara7 ] {};
void() bossf2_roara7 =[ $roar07, bossf2_roara8 ] {};
void() bossf2_roara8 =[ $roar08, bossf2_roara9 ] {};
void() bossf2_roara9 =[ $roar09, bossf2_roara10 ] {};
void() bossf2_roara10 =[ $roar10, bossf2_roara11 ] {};
void() bossf2_roara11 =[ $roar11, bossf2_roara12 ] {};
void() bossf2_roara12 =[ $roar12, bossf2_roara13 ] {};
void() bossf2_roara13 =[ $roar13, bossf2_roara14 ] {};
void() bossf2_roara14 =[ $roar14, bossf2_roara15 ] {};
void() bossf2_roara15 =[ $roar15, bossf2_run1 ]
{
//lets become solid again
self.solid = SOLID_SLIDEBOX;
//set game speed back to normal
adjust_speed(0,0);
//grand entrance is done
entered = 1;
//create a black hole in the center of the arena
bossf2_create_hole();
};
//=================================================================================================
/*
void() bossf2_cataka1 =[ $cataka01, bossf2_cataka2 ] {ai_face();ai_charge(30);};
void() bossf2_cataka2 =[ $cataka02, bossf2_cataka3 ] {ai_charge(26);ai_melee();};
void() bossf2_cataka3 =[ $cataka03, bossf2_cataka4 ] {ai_charge(22);ai_melee();};
void() bossf2_cataka4 =[ $cataka04, bossf2_cataka5 ] {ai_charge(20);ai_melee();};
void() bossf2_cataka5 =[ $cataka05, bossf2_cataka6 ] {ai_charge(30);ai_melee();};
void() bossf2_cataka6 =[ $cataka06, bossf2_cataka7 ] {ai_charge(26);ai_melee();};
void() bossf2_cataka7 =[ $cataka07, bossf2_cataka8 ] {};
void() bossf2_cataka8 =[ $cataka08, bossf2_cataka9 ] {};
void() bossf2_cataka9 =[ $cataka09, bossf2_cataka10 ] {};
void() bossf2_cataka10 =[ $cataka10, bossf2_cataka11 ] {};
void() bossf2_cataka11 =[ $cataka11, bossf2_cataka12 ] {};
void() bossf2_cataka12 =[ $cataka12, bossf2_run ] {};
//=================================================================================================
void() bossf2_catakb1 =[ $catakb01, bossf2_catakb2 ] {ai_face();ai_charge(30);};
void() bossf2_catakb2 =[ $catakb02, bossf2_catakb3 ] {ai_charge(26);};
void() bossf2_catakb3 =[ $catakb03, bossf2_catakb4 ] {ai_charge(22);ai_melee();};
void() bossf2_catakb4 =[ $catakb04, bossf2_catakb5 ] {ai_charge(20);ai_melee();};
void() bossf2_catakb5 =[ $catakb05, bossf2_catakb6 ] {ai_charge(30);ai_melee();};
void() bossf2_catakb6 =[ $catakb06, bossf2_catakb7 ] {ai_charge(26);ai_melee();};
void() bossf2_catakb7 =[ $catakb07, bossf2_catakb8 ] {};
void() bossf2_catakb8 =[ $catakb08, bossf2_catakb9 ] {};
void() bossf2_catakb9 =[ $catakb09, bossf2_catakb10 ] {};
void() bossf2_catakb10 =[ $catakb10, bossf2_run ] {};
*/
//=================================================================================================
void() bossf2_paina1 =[ $pain, bossf2_run1 ] {};
void() bossf2_painb1 =[ $painl, bossf2_run1 ] {};
void(entity attacker, float damage) bossf2_pain =
{
if (self.pain_finished > time)
return;
if (entered == 0)
return;
self.pain_finished = time + 0.1;
//make some noise
bossf2_painsound();
//select pain frame at random
if (random() <= 0.5)
bossf2_paina1();
else
bossf2_painb1();
};
//=================================================================================================
void() bossf2_timer_think =
{
IncrementDifficulty();
//put us back in sp mode
set_deathmatch(0);
changelevel("ending");
remove(self);
}
void() bossf2_timer =
{
local entity bf2timer
bf2timer = spawn();
bf2timer.nextthink = time + 2;
bf2timer.think = bossf2_timer_think;
}
void() bossf2_blowup =
{
T_RadiusDamage (self, self, 120, world);
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
WriteByte (MSG_BROADCAST, TE_TAREXPLOSION);
WriteCoord (MSG_BROADCAST, self.origin_x);
WriteCoord (MSG_BROADCAST, self.origin_y);
WriteCoord (MSG_BROADCAST, self.origin_z);
bossf2_timer();
BecomeExplosion ();
};
void() bossf2_delay_blowup =
{
//time to die
if (time > self.ltime)
{
self.nextthink = time + 0.1;
self.think = bossf2_blowup;
}
else
{
bossf2_create_fire(60 * (random() * 10));
bossf2_create_fire2(60 * (random() * 10));
self.nextthink = time + 1;
self.think = bossf2_delay_blowup;
}
};
void() bossf2_die1 =[ $roar01, bossf2_die2 ] {};
void() bossf2_die2 =[ $roar02, bossf2_die3 ] {};
void() bossf2_die3 =[ $roar03, bossf2_die4 ] {};
void() bossf2_die4 =[ $roar04, bossf2_die5 ] {};
void() bossf2_die5 =[ $roar05, bossf2_die6 ] {};
void() bossf2_die6 =[ $roar06, bossf2_die7 ] {};
void() bossf2_die7 =[ $roar07, bossf2_die8 ] {};
void() bossf2_die8 =[ $roar08, bossf2_die9 ] {};
void() bossf2_die9 =[ $roar09, bossf2_die10 ] {};
void() bossf2_die10 =[ $roar09, bossf2_die11 ] {};
void() bossf2_die11 =[ $roar09, bossf2_die12 ] {};
void() bossf2_die12 =[ $roar09, bossf2_die13 ] {};
void() bossf2_die13 =[ $roar09, bossf2_die14 ] {};
void() bossf2_die14 =[ $roar09, bossf2_die15 ] {};
void() bossf2_die15 =[ $roar09, bossf2_die15 ]
{
//set up angles stuff
makevectors(self.angles);
//create some explosions
create_explosion((self.origin - (v_right * 20)),0.5,0,40);
create_explosion((self.origin - (v_right * 40)),1,0,40);
create_explosion((self.origin - (v_right * 25) + '0 0 10'),1.5,0,40);
create_explosion((self.origin - (v_right * 35) + '0 0 5'),2,0,40);
create_explosion((self.origin + (v_right * 20)),0.5,0,40);
create_explosion((self.origin + (v_right * 40)),1,0,40);
create_explosion((self.origin + (v_right * 25) + '0 0 10'),1.5,0,40);
create_explosion((self.origin + (v_right * 35) + '0 0 5'),2,0,40);
create_explosion((self.origin - (v_right * 20)),2.5,0,40);
create_explosion((self.origin + (v_right * 20)),3,0,40);
create_explosion((self.origin - (v_right * 20) - '0 0 10'),3,1,40); //this is the big one
create_explosion((self.origin - (v_right * 20)),3.5,0,40);
create_explosion((self.origin - (v_right * 40)),4,0,40);
create_explosion((self.origin - (v_right * 25) + '0 0 10'),4.5,0,40);
create_explosion((self.origin - (v_right * 35) + '0 0 5'),5,0,40);
create_explosion((self.origin + (v_right * 20)),3.5,0,40);
create_explosion((self.origin + (v_right * 40)),4,0,40);
create_explosion((self.origin + (v_right * 25) + '0 0 10'),4.5,0,40);
create_explosion((self.origin + (v_right * 35) + '0 0 5'),5,0,40);
create_explosion((self.origin - (v_right * 20)),5.5,0,40);
create_explosion((self.origin + (v_right * 20)),6,0,40);
create_explosion((self.origin + (v_right * 20) - '0 0 10'),6,1,40); //this is the big one
create_explosion((self.origin - (v_right * 20)),6.5,0,40);
create_explosion((self.origin - (v_right * 40)),7,0,40);
create_explosion((self.origin - (v_right * 25) + '0 0 10'),7.5,0,40);
create_explosion((self.origin - (v_right * 35) + '0 0 5'),8,0,40);
create_explosion((self.origin + (v_right * 20)),6.5,0,40);
create_explosion((self.origin + (v_right * 40)),7,0,40);
create_explosion((self.origin + (v_right * 25) + '0 0 10'),7.5,0,40);
create_explosion((self.origin + (v_right * 35) + '0 0 5'),8,0,40);
create_explosion((self.origin - (v_right * 20)),8.5,0,40);
create_explosion((self.origin + (v_right * 20)),9,0,40);
create_explosion((self.origin - '0 0 10'),9,1,40); //this is the big one
//make firecolumns
bossf2_create_fire(160);
bossf2_create_fire2(160);
//now its time for us to blow up!
self.ltime = time + 10;
self.nextthink = time + 1;
self.think = bossf2_delay_blowup;
};
void() bossf2_die =
{
//teleport player to death area
boss_teleport(2);
//set up angles stuff
makevectors(self.angles);
//set game speed back to normal
adjust_speed(0,0);
//set gravity back to normal
adjust_gravity(0,0);
//lets teleport to center arena
boss_teleport(1);
//face the player
ai_face_player();
//this seemed important
self.solid = SOLID_NOT;
//make some noise
sound (self, CHAN_VOICE, "boss2/bf2death3.wav", 1, ATTN_NORM);
//i'm dead now
bf2_dead = 1;
//make firecolumns
bossf2_create_fire(80);
bossf2_create_fire2(80);
//go into death animation
bossf2_die1();
};
//=================================================================================================
void() bossf2_painsound =
{
if (random() <= 0.5)
sound (self, CHAN_VOICE, "boss2/bf2pain2.wav", 1, ATTN_NORM);
else
sound (self, CHAN_VOICE, "boss2/bf2pain.wav", 1, ATTN_NORM);
};
void() bossf2_attacksound =
{
if (random() <= 0.5)
sound (self, CHAN_VOICE, "boss2/bf2claw2.wav", 1, ATTN_NORM);
else
sound (self, CHAN_VOICE, "boss2/bf2claw.wav", 1, ATTN_NORM);
};
void() bossf2_tauntsound =
{
//don't always want to make this sound
if (random() <= 0.3)
sound (self, CHAN_VOICE, "boss2/bf2walk.wav", 1, ATTN_NORM);
};
void() bossf2_melee =
{
//make some noise
bossf2_attacksound();
if (random() <= 0.5)
bossf2_atakc1();
else
bossf2_atakd1();
};
void() bossf2_missile =
{
local float r;
r = random();
if (r <= 0.33)
{
sound (self, CHAN_VOICE, "boss2/bf2sight.wav", 1, ATTN_NORM);
bossf2_ataka1(); //carniv's fireball
}
else if (r <= 0.66)
bossf2_atakb1(); //torment's hellstaff
else
bossf2_jatak1(); //jump attack
};
float gravity_toggle;
void() bossf2_change_gravity =
{
local float gtime;
local entity holecheck;
//check to see if we can change gravity
if (world_gravity == 1)
return;
//set up gravity toggle
gravity_toggle = gravity_toggle + 1;
//set up gtime
gtime = 5;
//set game gravity by gravity toggle
if (gravity_toggle == 1) //normal gravity
adjust_gravity(0,gtime);
else if (gravity_toggle == 2) //almost no gravity
adjust_gravity(1,gtime);
else //super gravity
{
adjust_gravity(2,gtime);
gravity_toggle = 0;
}
//see if we need to create another black hole
holecheck = find(world, classname, "blackhole");
if (holecheck == world) //couldnt find a black hole so lets make one
{
//make sure we've waited atleast 5 seconds
if ((time - bhtime) > 5)
bossf2_create_hole();
}
};
void() bossf2_create_hole =
{
local entity telespot;
//find the center of the arena
telespot = find(world, targetname, "centerarena");
//create the black hole here, but up in the air some
create_black_hole(telespot.origin + '0 0 224');
};
//=================================================================================================
/*EWED monster_bossf2 (1 0 0) (-16 -16 -24) (16 16 40) Ambush
*/
void() monster_bossf2 =
{
if (deathmatch)
{
remove(self);
return;
}
//boss form2 precaches
precache_model ("models/enemies/bossform2.md2");
precache_model ("models/enemies/demonorb.md2");
precache_model ("models/weapons/gfx/fireball.mdl");
precache_model ("progs/flame2.mdl");
//boss form2 sound precaches
precache_sound ("weapons/demon/firehit.wav");
precache_sound ("weapons/demon/hellstafffire.wav");
precache_sound ("weapons/lock4.wav"); //used for missile touch function
precache_sound ("boss2/bf2claw2.wav");
precache_sound ("boss2/bf2claw.wav");
precache_sound ("boss2/bf2death3.wav");
precache_sound ("boss2/bf2pain2.wav");
precache_sound ("boss2/bf2pain.wav");
precache_sound ("boss2/bf2roar.wav");
precache_sound ("boss2/bf2sight.wav");
precache_sound ("boss2/bf2sightslow.wav");
precache_sound ("boss2/bf2walk.wav");
precache_sound ("weapons/lstart.wav");
self.solid = SOLID_SLIDEBOX;
self.movetype = MOVETYPE_STEP;
setmodel (self, "models/enemies/bossform2.md2");
setsize (self, '-16 -16 -24', '16 16 40');
// setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX);
self.health = set_health(2000);
self.speed = set_speed(500);
self.dtype = 0; //sidestep baby!
entered = 0; //we haven't entered yet
bf2_dead = 0; //not dead yet
self.th_stand = bossf2_stand1;
self.th_walk = bossf2_walk1;
self.th_run = bossf2_run1;
self.th_melee = bossf2_melee;
self.th_missile = bossf2_missile;
self.th_pain = bossf2_pain;
self.th_die = bossf2_die;
//my new classname is?
self.classname = "monster_bossf2";
//set up our monflag
self.monflag = "TRUE";
walkmonster_start ();
};
/*
=================
create_bossf2bot
Creates a monster_bossf2 at the specified spot.
This is used for bringing in boss form 2 after boss form 1 dies.
=================
*/
void() create_bossf2bot =
{
local entity bot;
// start entity and place it in world
bot = spawn();
bot.angles = self.angles;
setorigin (bot, self.origin);
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/bossform2.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 = bossf2_stand1;
bot.th_walk = bossf2_walk1;
bot.th_run = bossf2_run1;
bot.th_die = bossf2_die;
bot.th_melee = bossf2_melee;
bot.th_missile = bossf2_missile;
bot.th_pain = bossf2_pain;
bot.health = set_health(2000);
bot.speed = set_speed(500);
bot.dtype = 0; //sidestep baby!
entered = 0; //we havent made our grand entrance yet!
bf2_dead = 0; //not dead yet
// polish him up
bot.classname = "monster_bossf2";
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 = bossf2_roara1;
// get rid of the placeholder
remove(self);
};
/*
=================
delay_bossf2bot
Creates a monster_bossf2 at the specified spot after a certain amount of time has passed.
vector spot: spot to create bossf2bot at
float x: amount of time in seconds to wait before creating bot
=================
*/
void(vector spot, float x) delay_bossf2bot =
{
local entity placeholder;
// start entity and place it in world
placeholder = spawn();
setorigin (placeholder, spot);
// set size and shape
placeholder.solid = SOLID_SLIDEBOX;
setmodel (placeholder, "");
setsize (placeholder, '-8 -8 -12', '8 8 20');
placeholder.nextthink = time + x;
placeholder.think = create_bossf2bot;
};