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

  1. //////////////////////////////////////////////////////////////////////////////
  2. // Section common to all game types
  3. //////////////////////////////////////////////////////////////////////////////
  4. include common.txt
  5.  
  6. //////////////////////////////////////////////////////////////////////////////
  7. // It specific section
  8. //////////////////////////////////////////////////////////////////////////////
  9.  
  10. variable notItBonus 10
  11.  
  12. // 0 = no one is it, 1 = green, 2 = tan, 3 = blue, 4 = grey
  13. variable itplayer 0
  14.  
  15. variable greenIsOnItTeam    0
  16. variable tanIsOnItTeam        0
  17. variable blueIsOnItTeam        0
  18. variable greyIsOnItTeam        0
  19.  
  20. if startup1 then
  21.     triggerdelay 3000 updateScores
  22.  
  23. if updateScores then
  24.     trigger greenUpdateScore,
  25.     trigger tanUpdateScore,
  26.     trigger blueUpdateScore,
  27.     trigger greyUpdateScore,
  28.     triggerdelay 3000 updateScores
  29.  
  30. // @1 = color killed, @2 = Capitalized color (e.g. "Green"), @3 = color of killer
  31. macro killed_sarge 3
  32. {
  33.     if killed @1sarge1 by @3 testvar isAlly @3 @1 = 0 and @1IsOnItTeam = 0  then
  34.         showmessage "@2 sarge killed by enemy @3 and becomes it",
  35.         playsound "mp_death.wav" (0,0) 1 2,
  36.         trigger @1SargeBecomesIt
  37.  
  38.     if killed @1sarge1 by @3 testvar isAlly @3 @1 = 1 and @1IsOnItTeam = 0 then
  39.         showmessage "@2 sarge killed by ally @3 and becomes it",
  40.         playsound "mp_ffire.wav" (0,0) 2 2,
  41.         trigger @1SargeBecomesIt
  42. }
  43.  
  44. // @1 = color of it player, @2 is color of player to set flag of
  45. macro set_it_flag 2
  46. {
  47.     if @1SetupTeamFlags testvar isAlly @1 @2 = 1 then
  48.         setvar @2IsOnItTeam 1,
  49.         setitemflag @2sarge1 stratsquare 1
  50.  
  51.     if @1SetupTeamFlags testvar isAlly @1 @2 = 0 then
  52.         setvar @2IsOnItTeam 0,
  53.         setitemflag @2sarge1 stratsquare 0
  54. }
  55.  
  56. // @1 = color, @2 = Capitalized color (e.g. "Green"), @3 = itplayer value,
  57. // @4-6 are other colors
  58. macro it_macro 6
  59. {
  60.     // in it the enemy sarges should be shown on the stratmap
  61.     if startup1 testvar iscoloringame @1 > 0 then
  62.         setitemflag @1sarge1 strategic 1
  63.  
  64.     // check for the @1 sarge being killed and who killed them
  65.     expand killed_sarge ( @1 "@2" @4 )
  66.     expand killed_sarge ( @1 "@2" @5 )
  67.     expand killed_sarge ( @1 "@2" @6 )
  68.  
  69.     // killer scoring events
  70.  
  71.     if @1SargeBecomesIt then
  72.         setvar itplayer @3,
  73.         clearscoresymbols @1,
  74.         clearscoresymbols @4,
  75.         clearscoresymbols @5,
  76.         clearscoresymbols @6,
  77.         addscoresymbol @1 it,
  78.         playsound "mp_it@1.wav" (0,0) 3 1,
  79.         trigger @1SetupTeamFlags,
  80.         trigger itHasChanged                    // for AI players
  81.  
  82.     expand set_it_flag ( @1 @1 )
  83.     expand set_it_flag ( @1 @4 )
  84.     expand set_it_flag ( @1 @5 )
  85.     expand set_it_flag ( @1 @6 )
  86.  
  87.     if @1UpdateScore testvar iscoloringame @1 > 0 and @1IsOnItTeam = 0 and itplayer <> 0 then
  88.         addvar @1score notItBonus,
  89.         playsound "mp_tick.wav" (0,0) 2 3,
  90.         trigger check@1wins        
  91. }
  92.  
  93. expand it_macro ( green "Green" 1 tan   blue  grey  )
  94. expand it_macro ( tan   "Tan"   2 green blue  grey  )
  95. expand it_macro ( blue  "Blue"  3 green tan   grey  )
  96. expand it_macro ( grey  "Grey"  4 green tan   blue  )
  97.