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

  1. // FILENAME:    CTF_Stab_n_Grab.cs
  2. //
  3. // AUTHORS:      Chupie Doll & Youth in Asia
  4. //------------------------------------------------------------------------------
  5.  
  6. ///////////////////////////////////////////////////////////////////////////////////////////////////
  7. // Cybrids vs Humans      
  8. //
  9. // Any vehicle on the wrong side will get a message and be automatically set to the
  10. // correct team. -- TSL
  11. ///////////////////////////////////////////////////////////////////////////////////////////////////
  12.  
  13. $missionName = "CTF_Stab_n_Grab";
  14.  
  15. $maxFlagCount  = 8;       
  16. $flagValue     = 5;       
  17. $carrierValue  = 2;       
  18. $killPoints    = 1;
  19. $deathPoints   = 1;
  20. $flagTime = 300;
  21.  
  22. exec("multiplayerStdLib.cs");
  23. exec("CTFstdLib.cs");
  24.  
  25. function setDefaultMissionOptions()
  26. {
  27.     $server::TeamPlay = true;
  28.     $server::AllowDeathmatch = false;
  29.     $server::AllowTeamPlay = true;    
  30.  
  31.     $server::AllowTeamRed = false;
  32.     $server::AllowTeamBlue = true;
  33.     $server::AllowTeamYellow = false;
  34.     $server::AllowTeamPurple = true;
  35.  
  36.    // what can the server admin choose for available teams
  37.    $server::disableTeamRed = true;
  38.    $server::disableTeamBlue = false;
  39.    $server::disableTeamYellow = true;
  40.    $server::disableTeamPurple = false;
  41. }
  42.  
  43. function onMissionLoad()
  44. {
  45.     initGlobalVars();
  46.      cdAudioCycle("Cloudburst", "Mechsoul", "SS3"); 
  47.  
  48.    %rules = "<tIDMULT_CTF_GAMETYPE>"      @        
  49.             "<tIDMULT_STD_CYBRID_VS_HUMAN_1>"  @
  50.             "<tIDMULT_CTF_MAPNAME>"       @ 
  51.             $missionName                  @  
  52.             "<tIDMULT_CTF_OBJECTIVES>"    @
  53.             "<tIDMULT_CTF_OBJECTIVES_2>"  @
  54.             timeDifference($flagTime,0)   @
  55.             "<tIDMULT_CTF_OBJECTIVES_3>"  @
  56.             "<tIDMULT_CTF_SCORING_1>"     @
  57.             "<tIDMULT_CTF_SCORING_2>"     @
  58.             $flagValue                    @
  59.             "<tIDMULT_CTF_SCORING_3>"     @
  60.             "<tIDMULT_CTF_SCORING_4>"     @
  61.             $carrierValue                 @
  62.             "<tIDMULT_CTF_SCORING_5>"     @
  63.             "<tIDMULT_CTF_SCORING_6>"     @
  64.             $deathPoints                  @
  65.             "<tIDMULT_CTF_SCORING_7>"     @
  66.             "<tIDMULT_CTF_SCORING_8>"     @
  67.             $killPoints                   @
  68.             "<tIDMULT_CTF_SCORING_9>"     @
  69.             "<tIDMULT_CTF_SCORING_10>"    @ 
  70.             $maxFlagCount                 @
  71.             "<tIDMULT_CTF_SCORING_11>"    @
  72.             "<tIDMULT_STD_ITEMS>"         @
  73.             "<tIDMULT_CTF_FLAGS>"         @
  74.             "<tIDMULT_CTF_GLOW>"          @
  75.             "<tIDMULT_STD_HEAL>"          @
  76.             "<tIDMULT_STD_RELOAD_1>"      @
  77.             $PadWaitTime                  @
  78.             "<tIDMULT_STD_RELOAD_2>"      @
  79.             "<tIDMULT_STD_ZEN_1>"         @
  80.             $ZenWaitTime                  @
  81.             "<tIDMULT_STD_ZEN_2>";
  82.    
  83.    setGameInfo(%rules);
  84. }
  85.  
  86. function onMissionStart()
  87. {
  88.     temperateSounds();
  89.     say(0, 0, "", IDSFX_AMBIENT_RAIN);
  90. }
  91.  
  92. function vehicle::onAdd(%this)
  93. {
  94.    // Cybrid vs Humans ... Cybrids must be red, Humans must be yellow
  95.   
  96.    if(getVehicleTechBase(%this) == "H" && getTeam(%this) != *IDSTR_TEAM_BLUE)
  97.    {
  98.       setTeam(%this, *IDSTR_TEAM_BLUE);
  99.       say(PlayerManager::vehicleIdToPlayerNum(%this), 1234, *IDMULT_CHANGING_TEAM_BLUE);
  100.       redrop(%this);
  101.    }
  102.    else if(getVehicleTechBase(%this) == "C" && getTeam(%this) != *IDSTR_TEAM_PURPLE)
  103.    {
  104.       setTeam(%this, *IDSTR_TEAM_PURPLE);
  105.       say(PlayerManager::vehicleIdToPlayerNum(%this), 1234, *IDMULT_CHANGING_TEAM_PURPLE);
  106.       redrop(%this);
  107.    }
  108.  
  109.    %team = getTeam(playerManager::vehicleIdToPlayerNum(%this));
  110.    %color = teamToColor(%team);
  111.    %flagKey = strcat(%color, "FlagCount");
  112.  
  113.     adjTeamCount(%team, 1);
  114.  
  115.    //if the flag isn't at the base, but no one has it, correct situation
  116.    if(dataRetrieve(0, %flagKey) && !dataRetrieve(0, strcat(%color, "FlagCarried")))
  117.    {
  118.        setFlag(%team, true);
  119.    }
  120. }
  121.