home *** CD-ROM | disk | FTP | other *** search
/ Revista CD Expert 42 / CDGAMER42.iso / Egoboo / egoboo.exe / egoboo / modules / palshad.mod / objects / trigtile.obj / script.txt < prev    next >
Text File  |  2000-05-30  |  4KB  |  181 lines

  1. // Parent spawner state
  2. IfStateIs0
  3.   IfTimeOut
  4.     tmpargument = 50
  5.     SetTime
  6.  
  7.  
  8.     IfTargetIsSelf
  9.       // First find the nearest chest
  10.       tmpargument = [LOCK]
  11.       tmpdistance = 14 // Items, friends and enemies
  12.       SetTargetToNearestBlahID
  13.     Else
  14.       // Check the chest's state
  15.       GetTargetState
  16.       tmpx = tmpargument
  17.       tmpy = 0
  18.       IfXIsEqualToY
  19.         GetState // NOP
  20.       Else
  21.         tmpx = 0
  22.         tmpy = 0
  23.         tmpargument = passage
  24.         tmpdistance = 185 // Tile to find
  25.         FindTileInPassage
  26.           // Make a child
  27.           tmpargument = 1
  28.           tmpdistance = 0
  29.           tmpturn = 0
  30.           SpawnCharacter
  31.             SetChildState
  32.             tmpargument = ACTIONMC
  33.             ChildDoActionOverride
  34.             // Change the tile image
  35.             tmpargument = 186
  36.             SetTileXY
  37.         Else
  38.           GoPoof  // Out of children...
  39.  
  40.  
  41. // Find an enemy state
  42. IfStateIs1
  43.   IfSpawned
  44.     // Play the spawn sound
  45.     tmpargument = 1
  46.     tmpdistance = 22050
  47.     PlaySound
  48.  
  49.     // Do misc setup
  50.     SetTurnModeToSpin
  51.     tmpargument = 60
  52.     SetTime
  53.   IfTimeOut
  54.     SetTargetToNearestEnemy
  55.       tmpx = targetx - selfx < 3 + targetx
  56.       tmpy = targety - selfy < 3 + targety
  57.       ClearWaypoints
  58.       AddWaypoint
  59.       tmpargument = 2
  60.       SetState
  61.       tmpargument = 20
  62.       SetTime
  63.  
  64.  
  65.  
  66. // Chase an enemy state
  67. IfStateIs2
  68.   IfTimeOut
  69.     SetTargetToSelf
  70.     tmpx = targetspeedx < 6
  71.     tmpy = targetspeedy < 6
  72.     SetTargetToNearestEnemy
  73.       tmpdistance = 600
  74.       tmpturn = targetturnto
  75.       Compass
  76.       tmpx = tmpx + selfx
  77.       tmpy = tmpy + selfy
  78.       ClearWaypoints
  79.       AddWaypoint
  80.       tmpargument = 20
  81.       SetTime
  82.   tmpx = 0
  83.   IfBumped
  84.     SetOldTarget
  85.     SetTargetToWhoeverBumped
  86.     IfTargetIsOnHatedTeam
  87.       IfTargetIsDefending
  88.         // Check incoming direction
  89.         tmpx = targetturnto + 49152 - targetturn & 65535
  90.         tmpy = 32768
  91.         IfXIsLessThanY
  92.           // Hit shield
  93.           tmpx = targetx
  94.           tmpy = targety
  95.           tmpdistance = targetz
  96.           tmpargument = 0
  97.           SpawnExactParticle
  98.           tmpargument = 2
  99.         Else
  100.           // Hit character
  101.           tmpargument = rand & 1023 + 512 // 2 - 6 damage
  102.           DamageTarget
  103.           tmpargument = 1
  104.         tmpx = 1
  105.       Else
  106.         // Damage and break
  107.         tmpargument = rand & 1023 + 512 // 2 - 6 damage
  108.         DamageTarget
  109.         tmpargument = 1
  110.         tmpx = 1
  111.     Else
  112.       SetTargetToOldTarget
  113.       tmpx = rand & 511 - 256 + selfx
  114.       tmpy = rand & 511 - 256 + selfy
  115.       ClearWaypoints
  116.       AddWaypoint
  117.       tmpargument = 10
  118.       SetTime
  119.       tmpx = 0
  120.   IfHealed
  121.     SetTargetToWhoeverHealed
  122.     tmpargument = 0
  123.     tmpx = 1
  124.   tmpy = 0
  125.   IfXIsMoreThanY // It was damaged or bumped
  126.     // Message...  Argument set earlier
  127.     SendMessageNear
  128.  
  129.  
  130.     // Experience as a consolation prize
  131.     tmpargument = 5
  132.     tmpdistance = EXPSECRET
  133.     GiveExperienceToTarget
  134.  
  135.     // Sound effect
  136.     tmpargument = 0
  137.     tmpdistance = rand & 1023 + 8000
  138.     PlaySound
  139.  
  140.     // Death animation and alpha fade
  141.     tmpargument = 0
  142.     SetBumpHeight
  143.     SetBumpSize
  144.     tmpargument = ACTIONKA
  145.     DoActionOverride
  146.     KeepAction
  147.     tmpargument = 3
  148.     SetState
  149.     tmpargument = 8
  150.     SetTime
  151.     tmpargument = 0
  152.     SetContent
  153.     tmpx = 250
  154.     tmpargument = 0
  155.     SetXY
  156.  
  157.  
  158. // Dissolve state
  159. IfStateIs3
  160.   tmpargument = 0
  161.   GetXY
  162.   tmpx = tmpx - 7
  163.   SetXY
  164.   tmpargument = tmpx
  165.   SetAlpha
  166.   IfTimeOut
  167.     GetContent
  168.     tmpargument = tmpargument + 1
  169.     tmpx = tmpargument
  170.     tmpy = 3
  171.     IfXIsMoreThanY
  172.       GoPoof
  173.     Else
  174.       SetContent
  175.       ChangeArmor
  176.       tmpargument = 8
  177.       SetTime
  178.  
  179.  
  180. End                    // Finished with this character
  181.