home *** CD-ROM | disk | FTP | other *** search
/ Revista CD Expert 42 / CDGAMER42.iso / Egoboo / egoboo.exe / egoboo / modules / advent.mod / objects / grubbug.obj / script.txt < prev    next >
Text File  |  2000-01-26  |  2KB  |  61 lines

  1. // ZZ> This function makes the character wanders around its enemy
  2. IfSpawned                // Make it able to be crushed
  3.   MakeCrushValid              //
  4. IfCrushed
  5.   tmpx = selfx
  6.   tmpy = selfy
  7.   tmpdistance = selfz
  8.   tmpargument = 4
  9.   SpawnExactParticle
  10.   SpawnExactParticle
  11.   SpawnExactParticle
  12.   SpawnExactParticle
  13.   GoPoof
  14.   tmpargument = 1
  15.   SendMessageNear
  16. IfCleanedUp                // Respawn
  17.   IfTargetIsAlive              // Make sure killer is away
  18.     tmpx = 1100                    //
  19.     tmpy = targetdistance            //
  20.     IfXIsLessThanY                //
  21.       RespawnCharacter                  //
  22.   Else                      // Killer is far away
  23.     RespawnCharacter                //
  24. IfKilled                // This reduces the height of the char
  25.   IfTargetIsOnHatedTeam              // Final words
  26.     tmpargument = 0                //
  27.     SendMessageNear                //
  28.   tmpargument = 30              // Dead height
  29.   SetBumpHeight                  //
  30.   tmpargument = 1              // Sound
  31.   tmpdistance = rand & 4095 + 11000      //
  32.   PlaySound                  //
  33. IfAttacked                // Don't take kindly to attackers
  34.   SetTargetToWhoeverAttacked          //
  35.     tmpargument = 0                // Sound
  36.     tmpdistance = rand & 4095 + 11000        //
  37.     PlaySound                    //
  38. IfBumped                // Attack whoever it bumped
  39.   SetTargetToWhoeverBumped          //
  40.   IfTargetIsOnHatedTeam              // Make sure it's an enemy
  41.     tmpargument = LATCHLEFT            // Bite 'em
  42.     PressLatchButton                //
  43.   Else                      // Scooch around friendly
  44.     tmpx = rand & 1023 + targetx - 512      //
  45.     tmpy = rand & 1023 + targety - 512      //
  46.     ClearWaypoints                //
  47.     AddWaypoint                    //
  48.     SetTargetToOldTarget            //
  49. IfTimeOut                // This is done every so often
  50.   SetTargetToNearbyEnemy          // Look for enemies
  51.     tmpx = rand & 511 - 256 + targetx        //
  52.     tmpy = rand & 511 - 256 + targety        //
  53.   Else                      // Wander around home position
  54.     tmpx = rand & 1023 - 512 + selfspawnx   //
  55.     tmpy = rand & 1023 - 512 + selfspawny   //
  56.   ClearWaypoints              //
  57.   AddWaypoint                  //
  58.   tmpargument = rand & 63 + 20          // Wait a while and try again
  59.   SetTime                  //
  60. End                    // Finished with this character
  61.