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

  1.  
  2. //////////////////////////////////////////////////////////////////////////////
  3. // Fairly common section - score a penalty if kill an allied sarge
  4. //////////////////////////////////////////////////////////////////////////////
  5.  
  6. variable killedSelfPenalty -100
  7. variable killedAllyPenalty -50
  8. variable killedByAllyPenalty -50
  9.  
  10. macro killedBySelf 2
  11. {
  12.     if killed @1sarge1 by @1 then
  13.         showmessage "@2 sarge killed by @1 friendly fire",
  14.         trigger friendlyFireDeath,
  15.         addvar @1score killedSelfPenalty
  16. }
  17.  
  18. // @1 = killed color, @2 = Capitalized killed color, @3 = by color
  19. macro killedByAlly 3
  20. {
  21.     if killed @1sarge1 by @3 testvar isAlly @3 @1 = 1 then
  22.         showmessage "@2 sarge killed by @3 friendly fire",
  23.         trigger friendlyFireDeath,
  24.         addvar @3score killedAllyPenalty,
  25.         addvar @1score killedByAllyPenalty
  26. }
  27.  
  28. // @1 = color, @2 = Capitalized color (e.g. "Green"), @3-5 are other colors
  29. macro checkForFriendlyFire 5
  30. {
  31.     expand killedBySelf ( @1 "@2" )
  32.     expand killedByAlly ( @1 "@2" @3 )
  33.     expand killedByAlly ( @1 "@2" @4 )
  34.     expand killedByAlly ( @1 "@2" @5 )
  35. }
  36.  
  37. expand checkForFriendlyFire ( green Green tan blue grey )
  38. expand checkForFriendlyFire ( tan Tan green blue grey )
  39. expand checkForFriendlyFire ( blue Blue green tan grey )
  40. expand checkForFriendlyFire ( grey Grey green tan blue )
  41.  
  42. // sound effects
  43.  
  44. if friendlyFireDeath then
  45.     triggerdelay 500 friendlyFireDeathSound
  46.  
  47. if friendlyFireDeathSound then
  48.     playsound "mp_ffire.wav" (0,0) 2 2
  49.  
  50.