/* * $Header: /HexenWorld/Siege/pstboar.hc 3 5/25/98 1:39p Mgummelt $ */ /* ============================================================================== Q:\art\models\monsters\RdrPest\BOAR\final\Hpest.hc ============================================================================== */ // For building the model $cd Q:\art\models\monsters\RdrPest\BOAR\final $origin 0 0 0 $base base skin $skin skin $flags 0 // Boar frames $frame Bcharg1 Bcharg2 Bcharg3 Bcharg4 Bcharg5 $frame Bcharg6 Bcharg7 Bcharg8 // $frame BtranA1 BtranA2 BtranA3 BtranA4 BtranA5 $frame BtranA6 BtranA7 BtranA8 BtranA9 BtranA10 $frame BtranA11 BtranA12 BtranA13 // $frame BtranB1 BtranB2 BtranB3 BtranB4 BtranB5 $frame BtranB6 BtranB7 BtranB8 BtranB9 BtranB10 $frame BtranB11 BtranB12 // $frame BtranC1 BtranC2 BtranC3 BtranC4 BtranC5 $frame BtranC6 BtranC7 BtranC8 // $frame BtranD1 BtranD2 BtranD3 BtranD4 BtranD5 $frame BtranD6 BtranD7 BtranD8 // $frame Btrot1 Btrot2 Btrot3 Btrot4 Btrot5 $frame Btrot6 Btrot7 Btrot8 Btrot9 Btrot10 $frame Btrot11 Btrot12 $framevalue 0 // Rider Frames $frame Parrow1 Parrow2 Parrow3 Parrow4 Parrow5 $frame Parrow6 // $frame Pcharg1 Pcharg2 Pcharg3 Pcharg4 Pcharg5 $frame Pcharg6 Pcharg7 Pcharg8 // $frame Phive1 Phive2 Phive3 Phive4 Phive5 $frame Phive6 Phive7 Phive8 Phive9 Phive10 $frame Phive11 Phive12 Phive13 Phive14 Phive15 $frame Phive16 Phive17 Phive18 Phive19 Phive20 $frame Phive21 Phive22 Phive23 Phive24 Phive25 $frame Phive26 Phive27 Phive28 Phive29 Phive30 $frame Phive31 Phive32 Phive33 Phive34 Phive35 $frame Phive36 Phive37 Phive38 // $frame PtranA1 PtranA2 PtranA3 PtranA4 PtranA5 $frame PtranA6 PtranA7 PtranA8 PtranA9 PtranA10 $frame PtranA11 PtranA12 PtranA13 // $frame PtranB1 PtranB2 PtranB3 PtranB4 PtranB5 $frame PtranB6 PtranB7 PtranB8 PtranB9 PtranB10 $frame PtranB11 PtranB12 // $frame PtranC1 PtranC2 PtranC3 PtranC4 PtranC5 $frame PtranC6 PtranC7 PtranC8 // $frame PtranD1 PtranD2 PtranD3 PtranD4 PtranD5 $frame PtranD6 PtranD7 PtranD8 // $frame Ptrot1 Ptrot2 Ptrot3 Ptrot4 Ptrot5 $frame Ptrot6 Ptrot7 Ptrot8 Ptrot9 Ptrot10 $frame Ptrot11 Ptrot12 float pst_start[8] = { $Btrot1, $Btrot1, $Btrot1, $Bcharg1, $BtranC1, $BtranD1, $BtranB1, $Btrot1 }; float pst_end[8] = { $Btrot12, $Btrot12, $Btrot12, $Bcharg8, $BtranC8, $BtranD8, $BtranB1, $Btrot12 }; float pst_speed[8] = { 7, 7, 7, 20, 15, 15, 7, 7 }; // Array to align frames float PstRiderFrames[8] = { $Ptrot1, // Animation for trot $Parrow1, // Animation for trot $Phive1, // Animation for trot $Pcharg1, // Animation for trot $PtranC1, // Animation for trot $PtranD1, // Animation for trot $PtranB1, // Animation for trot $Ptrot1 // Animation for trot }; float PB_STAGE_NORMAL = 0; float PB_STAGE_ATTACK = 1; float PB_STAGE_ATTACK2 = 2; float PB_STAGE_CHARGE = 3; float PB_STAGE_CHARGE_ST = 4; float PB_STAGE_CHARGE_END = 5; float PB_STAGE_STAND = 6; float PB_STAGE_BACKUP = 7; void rider_death(); void hive_trail () { if(self.lifetime=PB_STAGE_CHARGE&&self.monster_stage=PB_STAGE_CHARGE&&self.monster_stagetime) { if(!walkmove(self.angles_y,self.speed,TRUE)) { if (trace_ent!=world&&trace_ent.takedamage&&self.torchtime30) { self.monster_stage=PB_STAGE_BACKUP; self.aflag=0; self.turn_time=time+3;//Back up for 3 secs } if(self.aflag) { makevectors(self.angles); tracearea(self.origin,self.origin+v_forward*200,'-48 -48 0','48 48 100',TRUE,self); if(trace_plane_normal!='0 0 0') self.ideal_yaw=vectoyaw((trace_plane_normal+v_forward)*0.5); navigate(fabs(self.speed)); } ChangeYaw(); } if ((!self.enemy) || (self.enemy.health <= 0)) { if(self.enemy) sound(self,CHAN_VOICE,"pest/laugh.wav",1,ATTN_NONE); if (!FindTarget(TRUE)) { self.enemy = world; if(!self.monster_awake) self.monster_stage = self.rider_gallop_mode = PB_STAGE_STAND; } else sound(self,CHAN_VOICE,"pest/sight.wav",1,ATTN_NONE); self.goalentity = self.enemy; } else self.monster_awake=TRUE; enemy_vis=visible(self.enemy); if(enemy_vis) self.search_time=time+5-coop*2; if(self.rider_gallop_modeself.angles_y+89&&self.movechain.ideal_yawself.angles_y - 180) self.movechain.ideal_yaw=self.angles_y - 89; } else self.movechain.ideal_yaw=self.angles_y; oself=self; self=self.movechain; ChangeYaw(); self=oself; if(self.rider_gallop_mode==PB_STAGE_ATTACK||self.rider_gallop_mode==PB_STAGE_ATTACK2) self.movechain.frame+=1; else if(self.rider_gallop_mode= $Parrow6) if(self.monster_stage==PB_STAGE_BACKUP) self.rider_gallop_mode=PB_STAGE_NORMAL; else self.rider_gallop_mode=self.monster_stage; } else if(self.rider_gallop_mode == PB_STAGE_ATTACK2) { if (self.movechain.frame == $Phive33) throw_hive(); if (self.movechain.frame >= $Phive38) if(self.monster_stage==PB_STAGE_BACKUP) self.rider_gallop_mode=PB_STAGE_NORMAL; else self.rider_gallop_mode=self.monster_stage; } if(self.monster_stage >= PB_STAGE_CHARGE&&self.monster_stage=random(20,40)) { self.movechain.frame=$PtranD1; self.monster_stage=self.rider_gallop_mode=PB_STAGE_CHARGE_END; } } if(self.frame==$BtranD8) { self.lifespan=time + 5; self.monster_stage = self.rider_gallop_mode=PB_STAGE_NORMAL; self.yaw_speed=4; } if(self.rider_gallop_mode==PB_STAGE_CHARGE) { if(random(1000)<=5) { enemy_infront=infront_of_ent(self.enemy,self.movechain); if(enemy_vis&&(enemy_infront||random()<0.2)) if (random()<0.1&&self.cnt<=0) // Shoot { self.rider_gallop_mode = PB_STAGE_ATTACK2; self.movechain.frame = $Phive1; } else { self.rider_gallop_mode = PB_STAGE_ATTACK; self.movechain.frame = $Parrow1; } } } } if (fabs(pst_speed[self.monster_stage] - fabs(self.speed)) < 0.2) self.speed = pst_speed[self.monster_stage]; else if (pst_speed[self.monster_stage] > fabs(self.speed)) self.speed = fabs(self.speed)+0.2; else self.speed=fabs(self.speed) - 0.2; if(self.monster_stage==PB_STAGE_BACKUP) if(self.turn_timetime) chance/=3; if(random(100)<3) sound(self,CHAN_VOICE,"pest/laugh.wav",1,ATTN_NONE); if (chance < 3&&self.cnt<=0) // Shoot { self.rider_gallop_mode = PB_STAGE_ATTACK2; self.movechain.frame = $Phive1; } else if(chance < 5) // Shoot { self.rider_gallop_mode = PB_STAGE_ATTACK; self.movechain.frame = $Parrow1; } else if(chance < 8&&self.monster_stage