]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into terencehill/keyhunt
authorterencehill <piuntn@gmail.com>
Sat, 31 Dec 2016 22:00:03 +0000 (23:00 +0100)
committerterencehill <piuntn@gmail.com>
Sat, 31 Dec 2016 22:00:03 +0000 (23:00 +0100)
1  2 
gamemodes.cfg
qcsrc/common/notifications/all.inc
qcsrc/server/mutators/mutator/gamemode_keyhunt.qc

diff --combined gamemodes.cfg
index f306253bc7e712ba2a44222192daa74044cc7a45,630eb7a85d7bfee6e2eee10725c8299d0297f925..53a1583ef715fdb2b0c96601f5165c8b34bd9b4f
@@@ -18,7 -18,7 +18,7 @@@ alias asay_drop "say_team (%l) dropped 
  // =================
  //  gamestart hooks
  // =================
- seta cl_matchcount 0 // incremented by cl_hook_gameend and used by playerstats to know when to 
+ seta cl_matchcount 0 // incremented by cl_hook_gameend and used by playerstats to know when to
  alias _cl_hook_gamestart "set _cl_hook_gametype $1; _cl_hook_gamestart_stage2"
  alias _cl_hook_gamestart_stage2 "cl_hook_gamestart_all; cl_hook_gamestart_${_cl_hook_gametype}"
  alias cl_hook_gamestart_all
@@@ -278,7 -278,7 +278,7 @@@ set g_ctf_dropped_capture_delay 1 "drop
  set g_ctf_dropped_capture_radius 100 "allow dropped flags to be automatically captured by base flags if the dropped flag is within this radius of it"
  set g_ctf_flag_damageforcescale 2
  set g_ctf_portalteleport 0 "allow flag carriers to go through portals made in portal gun without dropping the flag"
- set g_ctf_reverse 0 "if enabled, flags positions are switched: you have to capture the enemy's flag from your own base by bringing it to your own flag in the enemy base"
+ set g_ctf_reverse 0 "if enabled, you score by bringing your own flag to an enemy's flag in their base"
  set g_ctf_flag_collect_delay 1
  set g_ctf_flag_health 0
  set g_ctf_flag_dropped_waypoint 2 "show dropped flag waypointsprite when a flag is lost. 1 = team only, 2 = for all players"
@@@ -418,9 -418,7 +418,9 @@@ set g_keepawayball_respawntime     10      "if n
  //  key hunt
  // ==========
  set g_keyhunt 0 "Key Hunt: collect all keys from the enemies and bring them together to score"
 -set g_balance_keyhunt_delay_return 60
 +set g_balance_keyhunt_return_when_unreachable 1 "automatically destroy a key if it falls into lava/slime/trigger hurt"
 +set g_balance_keyhunt_delay_damage_return 5 "time a key takes to automatically destroy itself if it falls into lava/slime/trigger hurt"
 +set g_balance_keyhunt_delay_return 60 "time a key takes to destroy itself if dropped"
  set g_balance_keyhunt_delay_round 5
  set g_balance_keyhunt_delay_tracking 10
  set g_balance_keyhunt_delay_fadeout 2
index e403baab3c6806951badd92ef8e8b5e05aba5beb,92fd5df1ac37330b1479044e7ef1cb61280d3930..454519e85cadb45c59c68acbcbd64b8db0d44ca4
      MULTITEAM_INFO(KEYHUNT_CAPTURE, 4,                      1,  1, 0, "s1", "",         "",     _("^BG%s^BG captured the keys for the ^TC^TT team"), "", NAME)
      MULTITEAM_INFO(KEYHUNT_DROP, 4,                         1,  1, 0, "s1", "",         "",     _("^BG%s^BG dropped the ^TC^TT Key"), "", KEY)
      MULTITEAM_INFO(KEYHUNT_LOST, 4,                         1,  1, 0, "s1", "",         "",     _("^BG%s^BG lost the ^TC^TT Key"), "", KEY)
 +    MULTITEAM_INFO(KEYHUNT_PUSHED, 4,                       1,  2, 0, "s1 s2", "",      "",     _("^BG%s^BG pushed %s^BG causing the ^TC^TT Key ^BGdestruction"), "", KEY)
 +    MULTITEAM_INFO(KEYHUNT_DESTROYED, 4,                    1,  1, 0, "s1", "",         "",     _("^BG%s^BG destroyed the ^TC^TT Key"), "", KEY)
      MULTITEAM_INFO(KEYHUNT_PICKUP, 4,                       1,  1, 0, "s1", "",         "",     _("^BG%s^BG picked up the ^TC^TT Key"), "", KEY)
  
      MSG_INFO_NOTIF(LMS_FORFEIT,                             1,  1, 0, "s1", "",         "",     _("^BG%s^F3 forfeited"), "")
  
      MSG_CENTER_NOTIF(ASSAULT_ATTACKING,                 1,      0, 0, "",               CPID_ASSAULT_ROLE,      "0 0",  _("^BGYou are attacking!"), "")
      MSG_CENTER_NOTIF(ASSAULT_DEFENDING,                 1,      0, 0, "",               CPID_ASSAULT_ROLE,      "0 0",  _("^BGYou are defending!"), "")
+     MSG_CENTER_NOTIF(ASSAULT_OBJ_DESTROYED,             1,      0, 1, "f1time",         CPID_ASSAULT_ROLE,      "0 0",  _("^BGObjective destroyed in ^F4%s^BG!"), "")
  
      MSG_CENTER_NOTIF(COUNTDOWN_BEGIN,                   1,      0, 0, "",               CPID_ROUND,             "2 0",  _("^F4Begin!"), "")
      MSG_CENTER_NOTIF(COUNTDOWN_GAMESTART,               1,      0, 1, "",               CPID_ROUND,             "1 f1", _("^F4Game starts in ^COUNT"), "")
  
      MSG_CENTER_NOTIF(GENERATOR_UNDERATTACK,             1,      0, 0, "",               CPID_Null,              "0 0",  _("^BGThe generator is under attack!"), "")
  
 +    MULTITEAM_CENTER(ROUND_TEAM_LOSS, 4,                1,      0, 0, "",               CPID_ROUND,             "0 0",  _("^TC^TT^BG team loses the round"), "", NAME)
      MULTITEAM_CENTER(ROUND_TEAM_WIN, 4,                 1,      0, 0, "",               CPID_ROUND,             "0 0",  _("^TC^TT^BG team wins the round"), "", NAME)
      MSG_CENTER_NOTIF(ROUND_PLAYER_WIN,                  1,      1, 0, "s1",             CPID_ROUND,             "0 0",  _("^BG%s^BG wins the round"), "")
  
index d1337482bee352d0d86a7eb8039a8c3131d7c4f2,5bfbe676e6d7566127075915c37f0527e6540d60..d3ec3358e9a62f8ffbe294d42e85b1ce10fac31b
@@@ -2,11 -2,9 +2,11 @@@
  
  float autocvar_g_balance_keyhunt_damageforcescale;
  float autocvar_g_balance_keyhunt_delay_collect;
 +float autocvar_g_balance_keyhunt_delay_damage_return;
  float autocvar_g_balance_keyhunt_delay_return;
  float autocvar_g_balance_keyhunt_delay_round;
  float autocvar_g_balance_keyhunt_delay_tracking;
 +float autocvar_g_balance_keyhunt_return_when_unreachable;
  float autocvar_g_balance_keyhunt_dropvelocity;
  float autocvar_g_balance_keyhunt_maxdist;
  float autocvar_g_balance_keyhunt_protecttime;
@@@ -157,7 -155,7 +157,7 @@@ void kh_Controller_SetThink(float t, kh
  void kh_WaitForPlayers();
  void kh_Controller_Think(entity this)  // called a lot
  {
-       if(intermission_running)
+       if(gameover)
                return;
        if(this.cnt > 0)
        {
  void kh_Scores_Event(entity player, entity key, string what, float frags_player, float frags_owner)  // update the score when a key is captured
  {
        string s;
-       if(intermission_running)
+       if(gameover)
                return;
  
        if(frags_player)
@@@ -279,7 -277,7 +279,7 @@@ void kh_Key_Detach(entity key) // runs 
        }
        // in any case:
        setattachment(key, NULL, "");
-       setorigin(key, key.owner.origin + '0 0 1' * (STAT(PL_MIN, NULL).z - KH_KEY_MIN_z));
+       setorigin(key, key.owner.origin + '0 0 1' * (STAT(PL_MIN, key.owner).z - KH_KEY_MIN_z));
        key.angles = key.owner.angles;
  #else
        setorigin(key, key.owner.origin + key.origin.z * '0 0 1');
@@@ -420,8 -418,10 +420,8 @@@ void kh_Key_Damage(entity this, entity 
                return;
        if(ITEM_DAMAGE_NEEDKILL(deathtype))
        {
 -              // touching lava, or hurt trigger
 -              // what shall we do?
 -              // immediately return is bad
 -              // maybe start a shorter countdown?
 +              this.pain_finished = bound(time, time + autocvar_g_balance_keyhunt_delay_damage_return, this.pain_finished);
 +              return;
        }
        if(force == '0 0 0')
                return;
@@@ -448,7 -448,7 +448,7 @@@ void kh_Key_Collect(entity key, entity 
  
  void kh_Key_Touch(entity this, entity toucher)  // runs many, many times when a key has been dropped and can be picked up
  {
-       if(intermission_running)
+       if(gameover)
                return;
  
        if(this.owner) // already carried
  
        if(ITEM_TOUCH_NEEDKILL())
        {
 -              // touching sky, or nodrop
 -              // what shall we do?
 -              // immediately return is bad
 -              // maybe start a shorter countdown?
 +              this.pain_finished = bound(time, time + autocvar_g_balance_keyhunt_delay_damage_return, this.pain_finished);
 +              return;
        }
  
        if (!IS_PLAYER(toucher))
@@@ -545,7 -547,6 +545,7 @@@ void kh_WinnerTeam(int winner_team)  /
                        first = false;
                }
  
 +      Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, APP_TEAM_NUM(winner_team, CENTER_ROUND_TEAM_WIN));
        Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(winner_team, INFO_KEYHUNT_CAPTURE), keyowner);
  
        first = true;
@@@ -648,11 -649,7 +648,11 @@@ void kh_LoserTeam(int loser_team, entit
        }
  
        int realteam = kh_Team_ByID(lostkey.count);
 -      Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(realteam, INFO_KEYHUNT_LOST), lostkey.kh_previous_owner.netname);
 +      Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, APP_TEAM_NUM(loser_team, CENTER_ROUND_TEAM_LOSS));
 +      if(attacker)
 +              Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(realteam, INFO_KEYHUNT_PUSHED), attacker.netname, lostkey.kh_previous_owner.netname);
 +      else
 +              Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(realteam, INFO_KEYHUNT_DESTROYED), lostkey.kh_previous_owner.netname);
  
        play2all(SND(KH_DESTROY));
        te_tarexplosion(lostkey.origin);
  
  void kh_Key_Think(entity this)  // runs all the time
  {
-       if(intermission_running)
+       if(gameover)
                return;
  
        if(this.owner)
@@@ -733,8 -730,6 +733,8 @@@ void kh_Key_Spawn(entity initial_owner
        key.angles = '0 360 0' * random();
        key.event_damage = kh_Key_Damage;
        key.takedamage = DAMAGE_YES;
 +      key.damagedbytriggers = autocvar_g_balance_keyhunt_return_when_unreachable;
 +      key.damagedbycontents = autocvar_g_balance_keyhunt_return_when_unreachable;
        key.modelindex = kh_key_dropped;
        key.model = "key";
        key.kh_dropperteam = 0;
@@@ -865,16 -860,13 +865,16 @@@ int kh_GetMissingTeams(
  
  void kh_WaitForPlayers()  // delay start of the round until enough players are present
  {
 +      static int prev_missing_teams_mask;
        if(time < game_starttime)
        {
 +              if (prev_missing_teams_mask > 0)
 +                      Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_MISSING_TEAMS);
 +              prev_missing_teams_mask = -1;
                kh_Controller_SetThink(game_starttime - time + 0.1, kh_WaitForPlayers);
                return;
        }
  
 -      static int prev_missing_teams_mask;
        int missing_teams_mask = kh_GetMissingTeams();
        if(!missing_teams_mask)
        {
@@@ -1317,5 -1309,5 +1317,5 @@@ MUTATOR_HOOKFUNCTION(kh, DropSpecialIte
  
  MUTATOR_HOOKFUNCTION(kh, reset_map_global)
  {
 -      kh_Controller_SetThink(autocvar_g_balance_keyhunt_delay_round + (game_starttime - time), kh_StartRound);
 +      kh_WaitForPlayers(); // takes care of killing the "missing teams" message
  }