home *** CD-ROM | disk | FTP | other *** search
/ Revista CD Expert 42 / CDGAMER42.iso / Egoboo / egoboo.exe / egoboo / modules / gnome.mod / objects / captain.obj / script.txt < prev    next >
Text File  |  2000-03-26  |  9KB  |  349 lines

  1. //------------------------------------------------------------------------------
  2. // ZZ> Make owner same as leader...
  3. IfSpawned
  4.   SetTargetToLeader
  5.   SetOwnerToTarget
  6.  
  7.  
  8. //------------------------------------------------------------------------------
  9. // ZZ> Move around...  Start at state 0
  10. IfTimeOut
  11.   // Load more bullets
  12.   IfHoldingRangedWeapon
  13.     GetState  // NOP
  14.   Else
  15.     SetTargetToSelf
  16.     tmpargument = [GONN]
  17.     RestockTargetAmmoIDFirst
  18.       tmpargument = ACTIONMC
  19.       DoAction
  20.       tmpargument = 6
  21.       SendMessageNear
  22.     SetTargetToOldTarget
  23.  
  24.  
  25.   SetTurnModeToVelocity
  26.   IfStateIs6
  27.     // Kill 'em all!
  28.     IfTargetIsAlive
  29.       // Check enemy level
  30.       tmpx = selfz + 50
  31.       tmpy = targetz
  32.       IfXIsLessThanY
  33.         tmpargument = 4
  34.         SetState
  35.       Else
  36.         // Fire away
  37.         SetTurnModeToWatchTarget
  38.         IfFacingTarget
  39.           IfHoldingRangedWeapon
  40.             PressLatchButton
  41.         tmpx = targetx
  42.         tmpy = targety
  43.         ClearWaypoints
  44.         AddWaypoint
  45.         tmpargument = 20
  46.         SetTime
  47.     Else
  48.       tmpargument = 3
  49.       SetState
  50.   IfStateIs5
  51.     // Fire at enemy
  52.     IfTargetIsAlive
  53.       SetTargetToNearestFriend
  54.         IfFacingTarget
  55.           SetTargetToOldTarget
  56.           tmpx = targetdistance
  57.           tmpy = ownerdistance
  58.           IfXIsLessThanY
  59.             // The baddy is in front of the frenny...
  60.             // Check enemy level
  61.             SetTargetToOldTarget
  62.             tmpx = selfz + 50
  63.             tmpy = targetz
  64.             IfXIsLessThanY
  65.               tmpargument = 4
  66.               SetState
  67.             Else
  68.               // Open fire
  69.               SetTurnModeToWatchTarget
  70.               IfFacingTarget
  71.                 IfHoldingRangedWeapon
  72.                   PressLatchButton
  73.                 tmpargument = 20
  74.               Else
  75.                 tmpx = targetx
  76.                 tmpy = targety
  77.                 ClearWaypoints
  78.                 AddWaypoint
  79.                 tmpargument = 10
  80.           Else
  81.             // The shot isn't clear, so close in
  82.             tmpx = targetx
  83.             tmpy = targety
  84.             ClearWaypoints
  85.             AddWaypoint
  86.             tmpargument = 10
  87.         Else
  88.           // Check enemy level
  89.           SetTargetToOldTarget
  90.           tmpx = selfz + 50
  91.           tmpy = targetz
  92.           IfXIsLessThanY
  93.             tmpargument = 4
  94.             SetState
  95.           Else
  96.             // Open fire
  97.             SetTurnModeToWatchTarget
  98.             IfFacingTarget
  99.               IfHoldingRangedWeapon
  100.                 PressLatchButton
  101.               tmpargument = 20
  102.             Else
  103.               tmpx = targetx
  104.               tmpy = targety
  105.               ClearWaypoints
  106.               AddWaypoint
  107.               tmpargument = 10
  108.       Else
  109.         // Check enemy level
  110.         tmpx = selfz + 50
  111.         tmpy = targetz
  112.         IfXIsLessThanY
  113.           tmpargument = 4
  114.           SetState
  115.         Else
  116.           // Open fire
  117.           SetTurnModeToWatchTarget
  118.           IfFacingTarget
  119.             IfHoldingRangedWeapon
  120.               PressLatchButton
  121.             tmpargument = 30
  122.           Else
  123.             tmpx = targetx
  124.             tmpy = targety
  125.             ClearWaypoints
  126.             AddWaypoint
  127.             tmpargument = 10
  128.     Else
  129.       // The target is dead...  Follow leader
  130.       tmpargument = 4
  131.       SetState
  132.   IfStateIs4
  133.     // Check pit
  134.     tmpx = selfz
  135.     tmpy = 50
  136.     IfXIsLessThanY
  137.       // Try to get out of the pit
  138.       tmpargument = 0
  139.       SetState
  140.     Else
  141.       // Check leader height
  142.       SetTargetToLeader
  143.       tmpx = targetz
  144.       tmpy = selfz + 50
  145.       IfXIsMoreThanY
  146.         // Leader is too high, so wait...
  147.         tmpx = selfx
  148.         tmpy = selfy
  149.         ClearWaypoints
  150.         AddWaypoint
  151.         tmpargument = 10
  152.       Else
  153.         // Follow the leader
  154.         tmpdistance = 250000  // Square of distance to check
  155.         SetTargetToDistantEnemy
  156.           // Go get 'em
  157.           tmpargument = 5
  158.           SetState
  159.           tmpargument = 0
  160.         Else
  161.           // Follow
  162.           tmpx = ownerdistance
  163.           tmpy = 150
  164.           IfXIsMoreThanY
  165.             // Run to catch up
  166.             tmpx = ownerx
  167.             tmpy = ownery
  168.             tmpturn = ownerturnto
  169.             tmpdistance = 200
  170.             Compass
  171.           Else
  172.             // Give 'im some room
  173.             tmpx = ownerx
  174.             tmpy = ownery
  175.             tmpturn = ownerturnto + 32768
  176.             tmpdistance = 120
  177.             Compass
  178.           ClearWaypoints
  179.           AddWaypoint
  180.           tmpargument = 20
  181.   IfStateIs3
  182.     // Am I out?
  183.     tmpx = selfz
  184.     tmpy = 50
  185.     IfXIsLessThanY
  186.       // Fell back in...  Try again
  187.       tmpargument = 0
  188.       SetState
  189.     Else
  190.       // Wait for the player to catch up
  191.       SetTargetToOwner
  192.       tmpx = targetdistance
  193.       tmpy = 200
  194.       IfXIsLessThanY
  195.         // "I'll watch your back"
  196.         tmpargument = 6
  197.         tmpdistance = 11025
  198.         PlaySound
  199.         tmpargument = 5
  200.         SendMessageNear
  201.         tmpargument = ACTIONMC
  202.         DoAction
  203.         tmpargument = 4
  204.         SetState
  205.       Else
  206.         // Check for baddies while out
  207.         tmpdistance = 250000  // Square of distance to check
  208.         SetTargetToDistantEnemy
  209.           // Go berserk
  210.           tmpx = targetx
  211.           tmpy = targety
  212.           tmpargument = 6
  213.           SetState
  214.         Else
  215.           tmpx = selfx
  216.           tmpy = 3900
  217.           ClearWaypoints
  218.           AddWaypoint
  219.     tmpargument = 10
  220.   IfStateIs2
  221.     // Jump out of the pit
  222.     tmpx = selfx
  223.     tmpy = 3968
  224.     ClearWaypoints
  225.     AddWaypoint
  226.     // Help a little...
  227.     tmpy = 12
  228.     tmpx = 0
  229.     SetTargetToSelf
  230.     AccelerateTarget
  231.     tmpargument = LATCHJUMP
  232.     PressLatchButton
  233.     tmpargument = 3
  234.     SetState
  235.     tmpargument = 40
  236.   IfStateIs1
  237.     // Jump onto the crate
  238.     tmpargument = [CRAT]
  239.     tmpdistance = 6
  240.     SetTargetToNearestBlahID
  241.       tmpx = targetdistance
  242.       tmpy = 100
  243.       IfXIsLessThanY
  244.         tmpx = targetx
  245.         tmpy = targety
  246.         tmpdistance = 300
  247.         tmpturn = targetturnto
  248.         Compass
  249.         ClearWaypoints
  250.         AddWaypoint
  251.         tmpargument = LATCHJUMP
  252.         PressLatchButton
  253.         tmpargument = 2
  254.         SetState
  255.         tmpargument = 40
  256.       Else
  257.         // Walk to the crate
  258.         tmpx = targetx
  259.         tmpy = targety
  260.         ClearWaypoints
  261.         AddWaypoint
  262.         tmpargument = 5
  263.     Else
  264.       // Walk back to center if there weren't any crates
  265.       tmpx = 2070
  266.       tmpy = 3200
  267.       ClearWaypoints
  268.       AddWaypoint
  269.       tmpargument = 1
  270.       SetState
  271.       tmpargument = 40
  272.   IfStateIs0
  273.     // Check for enemies in the pit
  274.     SetTargetToNearestEnemy
  275.       tmpx = targetz
  276.       tmpy = 50
  277.       IfXIsLessThanY
  278.         // The enemy is in the pit, so go get 'em
  279.         tmpx = targetx
  280.         tmpy = targety
  281.         ClearWaypoints
  282.         AddWaypoint
  283.         tmpargument = 5
  284.         SetState
  285.         tmpargument = 10
  286.       Else
  287.         // Get near the crate
  288.         tmpx = 2304
  289.         tmpy = 3550
  290.         ClearWaypoints
  291.         AddWaypoint
  292.         tmpargument = 1
  293.         SetState
  294.         tmpargument = 150
  295.     Else
  296.       // Get near the crate
  297.       tmpx = 2304
  298.       tmpy = 3550
  299.       ClearWaypoints
  300.       AddWaypoint
  301.       tmpargument = 1
  302.       SetState
  303.       tmpargument = 200
  304.   SetTime
  305.  
  306.  
  307. //------------------------------------------------------------------------------
  308. // ZZ> Handle death by sending a message and other stuff
  309. IfKilled
  310.   tmpargument = 3
  311.   tmpdistance = rand & 1027 + 11000
  312.   PlaySound
  313.   tmpargument = MESSAGEDEATH
  314.   IfTargetIsOnSameTeam
  315.     tmpargument = MESSAGEFRAG
  316.     IfTargetIsSelf
  317.       tmpargument = MESSAGEACCIDENT
  318.   SendMessage
  319.  
  320.   // Drop goodies
  321.   tmpargument = 65535
  322.   DropMoney
  323.  
  324.   // Make the character body
  325.   tmpargument = 45
  326.   SetBumpHeight
  327.  
  328.  
  329. //------------------------------------------------------------------------------
  330. // ZZ> Handle being attacked by blocking or countering or running away
  331. IfAttacked
  332.   SetTargetToWhoeverAttacked
  333.   IfTargetIsOnSameTeam
  334.     tmpargument = 2
  335.     tmpdistance = rand & 1027 + 11000
  336.     PlaySound
  337.     tmpargument = MESSAGEOUCH
  338.     SendMessageNear
  339.   Else
  340.     tmpargument = rand & 1 + 4
  341.     tmpdistance = rand & 1027 + 11000
  342.     PlaySound
  343.  
  344.  
  345.  
  346. //------------------------------------------------------------------------------
  347. End
  348. //------------------------------------------------------------------------------
  349.