home *** CD-ROM | disk | FTP | other *** search
/ Classic Fond 54 / ClassicFond54.iso / games / stars.rar / multiplayer / DM_Requiem_for_Gen_Lanz.cs < prev    next >
Text File  |  1999-02-19  |  6KB  |  266 lines

  1. // FILENAME:    DM_Requiem_for_General_Lanz.cs
  2. //
  3. // AUTHORS:      Chupie Doll & Youth in Asia
  4. //------------------------------------------------------------------------------
  5.  
  6. $missionName = "DM_Requiem_for_Gen_Lanz";
  7.  
  8. exec("multiplayerStdLib.cs");
  9. exec("DMstdLib.cs");
  10.  
  11. function setDefaultMissionOptions()
  12. {
  13.     $server::TeamPlay = false;
  14.     $server::AllowDeathmatch = true;
  15.     $server::AllowTeamPlay = true;    
  16.     
  17.     $server::AllowTeamRed = true;
  18.     $server::AllowTeamBlue = true;
  19.     $server::AllowTeamYellow = true;
  20.     $server::AllowTeamPurple = true;
  21.  
  22. }
  23.  
  24. function onMissionStart()
  25. {
  26.      
  27.        $blastRadius = 100;   // for ammo boxes
  28.     $blastDamage = 4000;   
  29.  
  30.     iceSounds();    
  31.  
  32. }
  33.  
  34. function onMissionLoad(){
  35.    cdAudioCycle("Purge", "Newtech", "SS4", "SS3"); 
  36.    // custom rules for this mission ( teleporter )
  37.    %rules = "<tIDMULT_TDM_GAMETYPE>"   @        
  38.             "<tIDMULT_TDM_MAPNAME>"    @ 
  39.             $missionName               @
  40.             "<tIDMULT_TDM_OBJECTIVES>" @
  41.             "<tIDMULT_TDM_SCORING_1>"  @
  42.             "<tIDMULT_TDM_SCORING_2>"  @
  43.             $killPoints                @
  44.             "<tIDMULT_TDM_SCORING_3>"  @
  45.             "<tIDMULT_TDM_SCORING_4>"  @
  46.             $deathPoints               @
  47.             "<tIDMULT_TDM_SCORING_5>"  @
  48.             "<tIDMULT_TDM_SCORING_6>"  @
  49.             "<tIDMULT_STD_ITEMS>"      @
  50.             "<tIDMULT_STD_TELEPORTER>" @
  51.             "<tIDMULT_STD_HEAL>"       @
  52.             "<tIDMULT_STD_RELOAD>";
  53.  
  54.    setGameInfo(%rules);
  55. }
  56.  
  57. function turret::onAdd(%this)
  58. {
  59.     if($server::TeamPlay == false)
  60.     {
  61.         setTeam(%this, *IDSTR_TEAM_NEUTRAL);
  62.     }
  63. }
  64.  
  65. // Transporter Functionality
  66. // --------------------------------------------------------------------------
  67. function deathmatchTransport(%this, %vehicleId){
  68.     %teamName = getTeam(%vehicleId);
  69.    
  70.     %huh = randomInt(1, 5);
  71.     if(%huh == 1){
  72.         transportToYellowBase(%vehicleId);
  73.     }
  74.     else if(%huh == 2){
  75.         transportToBlueBase(%vehicleId);
  76.     }
  77.     else if(%huh == 3){
  78.         transportToRedBase(%vehicleId);
  79.     }
  80.     else if(%huh == 4){
  81.         transportToPurpleBase(%vehicleId);
  82.     }
  83.     else{
  84.         transportToMountain(%vehicleId);
  85.     }
  86. }
  87. function YellowTransporter::trigger::onEnter(%this, %vehicleId){
  88.     if($server::TeamPlay == false){
  89.         deathmatchTransport(%this, %vehicleId);
  90.         return;
  91.     }
  92.  
  93.     %teamName = getTeam(%vehicleId);
  94.    
  95.        if(%teamName == *IDSTR_TEAM_YELLOW){
  96.         %huh = randomInt(1, 4);
  97.         if(%huh == 1){
  98.             transportToBlueBase(%vehicleId);
  99.         }
  100.         else if(%huh == 2){
  101.             transportToRedBase(%vehicleId);
  102.         }
  103.         else if(%huh == 3){
  104.             transportToPurpleBase(%vehicleId);
  105.         }
  106.         else{
  107.             transportToMountain(%vehicleId);
  108.         }
  109.     }
  110.     else{
  111.         transportToHomeBase(%vehicleId);
  112.     }
  113. }
  114. function BlueTransporter::trigger::onEnter(%this, %vehicleId){
  115.     if($server::TeamPlay == false){
  116.         deathmatchTransport(%this, %vehicleId);
  117.         return;
  118.     }
  119.  
  120.     %teamName = getTeam(%vehicleId);
  121.    
  122.        if(%teamName == *IDSTR_TEAM_BLUE){
  123.         %huh = randomInt(1, 4);
  124.         if(%huh == 1){
  125.             transportToYellowBase(%vehicleId);
  126.         }
  127.         else if(%huh == 2){
  128.             transportToRedBase(%vehicleId);
  129.         }
  130.         else if(%huh == 3){
  131.             transportToPurpleBase(%vehicleId);
  132.         }
  133.         else{
  134.             transportToMountain(%vehicleId);
  135.         }
  136.     }
  137.     else{
  138.         transportToHomeBase(%vehicleId);
  139.     }
  140. }
  141. function RedTransporter::trigger::onEnter(%this, %vehicleId){
  142.     if($server::TeamPlay == false){
  143.         deathmatchTransport(%this, %vehicleId);
  144.         return;
  145.     }
  146.     %teamName = getTeam(%vehicleId);
  147.    
  148.        if(%teamName == *IDSTR_TEAM_RED){
  149.         %huh = randomInt(1, 4);
  150.         if(%huh == 1){
  151.             transportToBlueBase(%vehicleId);
  152.         }
  153.         else if(%huh == 2){
  154.             transportToYellowBase(%vehicleId);
  155.         }
  156.         else if(%huh == 3){
  157.             transportToPurpleBase(%vehicleId);
  158.         }
  159.         else{
  160.             transportToMountain(%vehicleId);
  161.         }
  162.     }
  163.     else{
  164.         transportToHomeBase(%vehicleId);
  165.     }
  166. }
  167. function PurpleTransporter::trigger::onEnter(%this, %vehicleId){
  168.     if($server::TeamPlay == false){
  169.         deathmatchTransport(%this, %vehicleId);
  170.         return;
  171.     }
  172.     %teamName = getTeam(%vehicleId);
  173.  
  174.        if(%teamName == *IDSTR_TEAM_PURPLE){
  175.         %huh = randomInt(1, 4);
  176.         if(%huh == 1){
  177.             transportToBlueBase(%vehicleId);
  178.         }
  179.         else if(%huh == 2){
  180.             transportToRedBase(%vehicleId);
  181.         }
  182.         else if(%huh == 3){
  183.             transportToYellowBase(%vehicleId);
  184.         }
  185.         else{
  186.             transportToMountain(%vehicleId);
  187.         }
  188.     }
  189.     else{
  190.         transportToHomeBase(%vehicleId);
  191.     }
  192. }
  193.  
  194. function transportToBlueBase(%vehicleId)
  195. {
  196.     echo("Transporting to Blue Base");
  197.     randomTransport(%vehicleId, 2151, 1078, 2185, 802);
  198. }
  199. function transportToYellowBase(%vehicleId)
  200. {
  201.     echo("Transporting to Yellow Base");
  202.     randomTransport(%vehicleId, 582, -2016, 715, -1968);
  203. }
  204. function transportToRedBase(%vehicleId)
  205. {
  206.     echo("Transporting to Red Base");
  207.     randomTransport(%vehicleId, 669, 3201, 746, 3046);
  208. }
  209. function transportToPurpleBase(%vehicleId)
  210. {
  211.     echo("Transporting to Purple Base");
  212.     randomTransport(%vehicleId, -2948, 66, -3041, -117);
  213. }
  214. function transportToMountain(%vehicleId)
  215. {
  216.       randomTransport(%vehicleId, 56, 667, 60, 675);
  217. }
  218.  
  219. function transportToHomeBase(%vehicleId)
  220. {
  221.     // What colour is this person?
  222.    %teamName = getTeam(%vehicleId);
  223.    
  224.     // Call the appropriate transport function (above) and get them home
  225.    if(%teamName == *IDSTR_TEAM_YELLOW)
  226.    {
  227.       transportToYellowBase(%vehicleId);
  228.    }
  229.    else if(%teamName == *IDSTR_TEAM_RED)
  230.    {
  231.       transportToRedBase(%vehicleId);
  232.    }
  233.    else if(%teamName == *IDSTR_TEAM_BLUE)
  234.    {
  235.       transportToBlueBase(%vehicleId);
  236.    }
  237.    else
  238.    {
  239.       transportToPurpleBase(%vehicleId);
  240.    }   
  241. }
  242.  
  243. // The following code is necessary for everything on the mountain
  244. // ------------------------------------------------------------------------------
  245.  
  246. function ZenTransporter::trigger::onContact(%this, %object)
  247. {
  248.     Zen::work(%this, %object, 100000, 100, 0, false);
  249.     setPosition(%object, -183, 573, 1500);
  250. }
  251. function ball1::structure::onAttacked(%this, %attacker){
  252.     transportToYellowBase(%attacker);
  253. }
  254. function ball2::structure::onAttacked(%this, %attacker){
  255.     transportToBlueBase(%attacker);
  256. }
  257. function ball3::structure::onAttacked(%this, %attacker){
  258.     transportToRedBase(%attacker);
  259. }
  260. function ball4::structure::onAttacked(%this, %attacker){
  261.     transportToPurpleBase(%attacker);
  262. }
  263.  
  264.  
  265.  
  266.