home *** CD-ROM | disk | FTP | other *** search
/ Eigen PC: CD-ROM 37 / EPC_47.BIN / toyspace / data1.cab / Required_Files / rules / common.txt < prev    next >
Text File  |  1999-10-08  |  4KB  |  163 lines

  1. //////////////////////////////////////////////////////////////////////////////
  2. // Common section
  3. //////////////////////////////////////////////////////////////////////////////
  4.  
  5. // remove all optional objects - game specific code will deploy them if required
  6.  
  7. macro undeploy_color 2
  8. {
  9.     if startup1 then
  10.         undeploy @1flag1,
  11.         undeploy @2flagbase,
  12.         undeploy @1mark1,
  13.         undeploy @1mark2,
  14.         undeploy @1mark3,
  15.         undeploy @1mark4,
  16.         undeploy @1mark5,
  17.         undeploy @1mark6,
  18.         undeploy @1mark7,
  19.         undeploy @1mark8,
  20.         undeploy @1node1,
  21.         undeploy @1node2,
  22.         undeploy @1node3,
  23.         undeploy @1node4,
  24.         undeploy @1node5
  25. }
  26.  
  27. expand undeploy_color ( green g )
  28. expand undeploy_color ( tan t )
  29. expand undeploy_color ( blue b )
  30. expand undeploy_color ( grey gr )
  31.  
  32. if startup1 then
  33.     undeploy blackflag1,
  34.     undeploy bkflagbase,
  35.     undeploy blacknode1,
  36.     undeploy blacknode2,
  37.     undeploy blacknode3,
  38.     undeploy blacknode4,
  39.     undeploy blacknode5
  40.  
  41. // where dead sarges resurrect
  42.  
  43. pad GreenRes1 50    
  44. pad GreenRes2 51    
  45. pad GreenRes3 52
  46. pad GreenRes4 53    
  47. pad GreenRes5 54    
  48. pad GreenRes6 55
  49.     
  50. pad TanRes1 60
  51. pad TanRes2 61
  52. pad TanRes3 62
  53. pad TanRes4 63
  54. pad TanRes5 64
  55. pad TanRes6 65
  56.  
  57. pad BlueRes1 70
  58. pad BlueRes2 71
  59. pad BlueRes3 72
  60. pad BlueRes4 73
  61. pad BlueRes5 74
  62. pad BlueRes6 75
  63.  
  64. pad GreyRes1 80
  65. pad GreyRes2 81
  66. pad GreyRes3 82
  67. pad GreyRes4 83
  68. pad GreyRes5 84
  69. pad GreyRes6 85
  70.  
  71. // resurrect the sarges
  72.  
  73. macro killedsarge 1
  74. {
  75.     if killed @1sarge1 then
  76.         triggerdelay 3000 resurrect@1
  77.  
  78.     if resurrect@1 then random
  79.        resurrect @1sarge1 @1Res1,
  80.        resurrect @1sarge1 @1Res2,
  81.        resurrect @1sarge1 @1Res3,
  82.        resurrect @1sarge1 @1Res4,
  83.        resurrect @1sarge1 @1Res5,
  84.        resurrect @1sarge1 @1Res6
  85. }
  86.  
  87. expand killedsarge ( green )
  88. expand killedsarge ( tan )
  89. expand killedsarge ( blue )
  90. expand killedsarge ( grey )
  91.  
  92. // define the pads around the flag bases (used by CTF and AI in many games)
  93.  
  94. pad greenbase 11 greensarge1
  95. pad tanbase 12 tansarge1
  96. pad bluebase 13 bluesarge1
  97. pad greybase 14 greysarge1
  98.  
  99. // check for a team reaching score limit
  100.  
  101. macro checkcolorwins 1
  102. {
  103.     if check@1wins testvar teamscore @1 >= gamescorelimit then
  104.         trigger endOfGame,
  105.         trigger @1teamwins
  106. }
  107.  
  108. expand checkcolorwins ( green )
  109. expand checkcolorwins ( tan )
  110. expand checkcolorwins ( blue )
  111. expand checkcolorwins ( grey )
  112.  
  113. // sound effects
  114.  
  115. if endOfGame then
  116.     playsound "mp_endgame.wav" (0,0) 1 1
  117.  
  118.  
  119. //////////////////////////////////////////////////////////////////////////////
  120. // Teleport pads
  121. //////////////////////////////////////////////////////////////////////////////
  122.  
  123. // @1 and @2 are physical pad numbers of the two pads that are connected
  124. macro teleportpad 2
  125. {
  126.     if padon teleport@1 testvar teleport@1inUse = 0 and isinvehicle me = 0 then
  127.         addvar teleport@2inUse 1,
  128.         moveitem me teleport@1,
  129.         beam me 1000,
  130.         playsound "mp_rebaseflag.wav" (0,0) 3 1,
  131.         triggerdelay 500 teleportTo@2
  132.  
  133.     if teleportTo@2 then
  134.         moveitem me teleport@2,
  135.         triggerdelay 5000 reenableteleport@2
  136.  
  137.     if reenableteleport@2 then
  138.         addvar teleport@2inUse -1
  139. }
  140.  
  141. // @1 and @2 are physical pad numbers of the two pads that are connected
  142. macro teleporter 2
  143. {
  144.     pad teleport@1    @1 trooper
  145.     pad teleport@2    @2 trooper
  146.  
  147.     variable teleport@1inUse 0
  148.     variable teleport@2inUse 0
  149.  
  150.     expand teleportpad ( @1 @2 )
  151.     expand teleportpad ( @2 @1 )
  152. }
  153.  
  154. expand teleporter ( 100 101 )
  155. expand teleporter ( 102 103 )
  156. expand teleporter ( 104 105 )
  157. expand teleporter ( 106 107 )
  158. expand teleporter ( 108 109 )
  159. expand teleporter ( 110 111 )
  160. expand teleporter ( 112 113 )
  161. expand teleporter ( 114 115 )
  162.  
  163.