home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Messiah / data1.cab / Program_Executable_Files / messiahscripts / Enemies / satan.spt < prev    next >
Text File  |  1999-11-29  |  2KB  |  89 lines

  1.  
  2.  
  3. Actor(Satan)
  4. {
  5.         file(SatanHeader);
  6.         rank(_RankGeneral);
  7.  
  8.         startstate(statenormal);
  9.         startaction(SatanIdle);
  10.  
  11. /*        printi("PathDestDist:     ",VPathDestDistance);
  12.         printi("PathDestAngle:    ",VPathDestAngle);
  13.         printi("PickDestAngle:    ",VPickDestAngle);
  14.         printi("TargetDistance:   ",vtargetdistance);
  15.         printi("TargetAngle:      ",vtargetangle);
  16. */
  17.  
  18.         float(_declare,ambR,255);
  19.         float(_declare,ambG,255);
  20.         float(_declare,ambB,255);
  21.  
  22.         call(GlobalAmbient,ambR,ambG,ambB);
  23.  
  24.         if(vkey==key_w)
  25.         {
  26.             float(_add,ambR,1);
  27.             float(_add,ambG,1);
  28.             float(_add,ambB,1);
  29.         }
  30.         elseif(vkey==key_e)
  31.         {
  32.             float(_sub,ambR,1);
  33.             float(_sub,ambG,1);
  34.             float(_sub,ambB,1);
  35.         }
  36.  
  37.  
  38.         if(vtrigger==_DIRdepossesion)
  39.         {
  40.             callsub(Sub_InitDepossesion,SatanWound,SatanWound,SatanWound);
  41.         }
  42.         elseif(vtrigger==_DIRpossesion)
  43.         {
  44.             SpawnAction(SatanWound);
  45.         }
  46.  
  47.         CallSub(BackGroundTriggerChecks);
  48.  
  49.         Direction(_clr,_DIRaiRemoveFlags);
  50. //        call(AIchangeplayertoenemy);
  51.  
  52.         call(AIupdateAIvars);
  53.         if(aivisiontoggle==0)
  54.         {
  55.             call(AIcheckfortarget,10);
  56.         }
  57.  
  58.         if(VAItargetfound==_AIenemy)
  59.         {
  60.             print("Satan found a victim");
  61.             call(AIselecttarget,_AIenemy);
  62.         }
  63.  
  64.         if(VAIhastarget!=0 && VActorFlag!=_AFLAGattached)
  65.         {
  66.             print("Satan has target");
  67.             call(AIPickdest,10);        //follow path
  68.  
  69.             callsub(Sub_AI1WayAlignToTarget);
  70.             if(VTrigger==_DIRleft)
  71.             {
  72.                 print("Turning left");
  73.                 turn(0,-30,0);
  74.             }
  75.             elseif(VTrigger==_DIRright)
  76.             {
  77.                 print("Turning right");
  78.                 turn(0,30,0);
  79.             }
  80.  
  81.             if(VTargetAngle<100 && VTargetAngle>-100)
  82.             {
  83.                 Direction(_or,_DIRforward);
  84.             }
  85.  
  86.         }
  87.  
  88. }
  89.