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

  1. //////////////////////////////////////////////////////////////////////////////
  2. // Section common to all game types
  3. //////////////////////////////////////////////////////////////////////////////
  4. include common.txt
  5. include ffire.txt
  6.  
  7. //////////////////////////////////////////////////////////////////////////////
  8. // King of the hill specific section
  9. //////////////////////////////////////////////////////////////////////////////
  10.  
  11. variable ownHillBonus 10
  12.  
  13. // 0 = no owner, 1 = green, 2 = tan, 3 = blue, 4 = grey
  14. variable hillowner 0
  15. variable oldhillowner 0
  16.  
  17. // @1 = color, @2 = Capitalized color (e.g. "Green"), @3 is value for hillowner,
  18. // @4-6 are other colors
  19. macro koth_macro 6
  20. {
  21.     variable @1onhill 0
  22.  
  23.     // these pairs of variables are used to prevent sarge leaving and returning to the hill within
  24.     // 1 second and scoring at a double rate
  25.     variable @1GainsHillCount 0
  26.     variable @1KeepsHillCheck 0
  27.  
  28.     pad @1hill 20 @1sarge1
  29.  
  30.     // for colors in game set the markers to be squares on stratmap
  31.     if startup1 testvar iscoloringame @1 > 0 then
  32.         setitemflag @1mark1 stratsquare 1,
  33.         setitemflag @1mark2 stratsquare 1,
  34.         setitemflag @1mark3 stratsquare 1,
  35.         setitemflag @1mark4 stratsquare 1,
  36.         setitemflag @1mark5 stratsquare 1,
  37.         setitemflag @1mark6 stratsquare 1,
  38.         setitemflag @1mark7 stratsquare 1,
  39.         setitemflag @1mark8 stratsquare 1
  40.  
  41.     // check for @1 sarge owning the hill
  42.  
  43.     if padon @1hill then
  44.         setvar @1onhill 1,
  45.         trigger check@1ownshill
  46.  
  47.     if padoff @1hill then
  48.         setvar @1onhill 0,
  49.         trigger @1offhill
  50.  
  51.     if killed @1sarge1 then
  52.         setvar @1onhill 0,
  53.         trigger @1offhill
  54.  
  55.     if @1offhill testvar hillowner = @3 then
  56.         removescoresymbol @1 king,
  57.         setvar hillowner 0,
  58.         trigger hillOwnerChanged,
  59.         trigger check@4ownshill,
  60.         trigger check@5ownshill,
  61.         trigger check@6ownshill
  62.  
  63.     if check@1ownshill testvar @1onhill = 1 and hillowner = 0 then
  64.         setvar hillowner @3,
  65.         trigger hillOwnerChanged,
  66.         showmessage "@2 is king of the hill",
  67.         addscoresymbol @1 king,
  68.         addvar @1GainsHillCount 1,
  69.         triggerdelay 3000 check@1scoresinitial
  70.  
  71.     if check@1scoresinitial then
  72.         addvar @1KeepsHillCheck 1
  73.  
  74.     if check@1scoresinitial testvar hillowner = @3 then
  75.         trigger check@1scores
  76.  
  77.     if check@1scores testvar hillowner = @3 and @1KeepsHillCheck = @1GainsHillCount then
  78.         addvar @1score ownHillBonus,
  79.         playsound "mp_tick.wav" (0,0) 2 3,
  80.         trigger check@1wins,
  81.         triggerdelay 3000 check@1scores
  82.  
  83.  
  84.     // update the flags to display the owner of the hill
  85.  
  86.     if hillOwnerChanged testvar oldhillowner = @3 then
  87.         undeploy @1mark1,
  88.         undeploy @1mark2,
  89.         undeploy @1mark3,
  90.         undeploy @1mark4,
  91.         undeploy @1mark5,
  92.         undeploy @1mark6,
  93.         undeploy @1mark7,
  94.         undeploy @1mark8,
  95.         setitemflag @1mark1 strategic 0,
  96.         setitemflag @1mark2 strategic 0,
  97.         setitemflag @1mark3 strategic 0,
  98.         setitemflag @1mark4 strategic 0,
  99.         setitemflag @1mark5 strategic 0,
  100.         setitemflag @1mark6 strategic 0,
  101.         setitemflag @1mark7 strategic 0,
  102.         setitemflag @1mark8 strategic 0,
  103.         setvar oldhillowner hillowner,
  104.         trigger showNewHillOwner
  105.  
  106.     if showNewHillOwner testvar hillowner = @3 then
  107.         deploy @1mark1,
  108.         deploy @1mark2,
  109.         deploy @1mark3,
  110.         deploy @1mark4,
  111.         deploy @1mark5,
  112.         deploy @1mark6,
  113.         deploy @1mark7,
  114.         deploy @1mark8,
  115.         setitemflag @1mark1 strategic 1,
  116.         setitemflag @1mark2 strategic 1,
  117.         setitemflag @1mark3 strategic 1,
  118.         setitemflag @1mark4 strategic 1,
  119.         setitemflag @1mark5 strategic 1,
  120.         setitemflag @1mark6 strategic 1,
  121.         setitemflag @1mark7 strategic 1,
  122.         setitemflag @1mark8 strategic 1
  123. }
  124.  
  125. expand koth_macro ( green "Green" 1 tan   blue  grey )
  126. expand koth_macro ( tan   "Tan"   2 blue  grey  green )
  127. expand koth_macro ( blue  "Blue"  3 grey  green tan )
  128. expand koth_macro ( grey  "Grey"  4 green tan   blue )
  129.  
  130. if hillOwnerChanged testvar oldhillowner = 0 then
  131.     setvar oldhillowner hillowner,
  132.     trigger showNewHillOwner
  133.  
  134. // whenever hillowner changes create explosions to make flags appear/dissapper in a
  135. // puf of smoke
  136. if hillOwnerChanged then
  137.     createexplosion greenmark1 128 0 green,    
  138.     createexplosion greenmark2 128 0 green,    
  139.     createexplosion greenmark3 128 0 green,    
  140.     createexplosion greenmark4 128 0 green,    
  141.     createexplosion greenmark5 128 0 green,    
  142.     createexplosion greenmark6 128 0 green,    
  143.     createexplosion greenmark7 128 0 green,    
  144.     createexplosion greenmark8 128 0 green
  145.  
  146. // if there is a new hill owner then play one sound
  147. if showNewHillOwner testvar hillowner <> 0 then
  148.     playsound "mp_own.wav" (0,0) 1 2
  149.  
  150. // if the hill is now empty play a different sound
  151. //if showNewHillOwner testvar hillowner = 0 then
  152. //    playsound "mp_koth2.wav" 0 1
  153.