From: terencehill Date: Sat, 31 Dec 2016 22:00:03 +0000 (+0100) Subject: Merge branch 'master' into terencehill/keyhunt X-Git-Tag: xonotic-v0.8.2~327^2~1 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=451e02a2857d8c671f6dcf6a0639ea7c609b3ba9;hp=e59649d46b275d7ce98ca1a3003e7929ba20f20d Merge branch 'master' into terencehill/keyhunt --- diff --git a/gamemodes.cfg b/gamemodes.cfg index 630eb7a85d..53a1583ef7 100644 --- a/gamemodes.cfg +++ b/gamemodes.cfg @@ -418,7 +418,9 @@ set g_keepawayball_respawntime 10 "if no one picks up the ball, how long to wait // 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 diff --git a/qcsrc/common/notifications/all.inc b/qcsrc/common/notifications/all.inc index 92fd5df1ac..454519e85c 100644 --- a/qcsrc/common/notifications/all.inc +++ b/qcsrc/common/notifications/all.inc @@ -380,6 +380,8 @@ 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"), "") @@ -649,6 +651,7 @@ 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"), "") diff --git a/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc b/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc index 5bfbe676e6..d3ec3358e9 100644 --- a/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc +++ b/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc @@ -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; @@ -418,10 +420,8 @@ void kh_Key_Damage(entity this, entity inflictor, entity attacker, float damage, 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; @@ -456,10 +456,8 @@ void kh_Key_Touch(entity this, entity toucher) // runs many, many times when a 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)) @@ -547,6 +545,7 @@ void kh_WinnerTeam(int winner_team) // runs when a team wins 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; @@ -649,7 +648,11 @@ void kh_LoserTeam(int loser_team, entity lostkey) // runs when a player pushes } 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); @@ -730,6 +733,8 @@ void kh_Key_Spawn(entity initial_owner, float _angle, float i) // runs every ti 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; @@ -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) { @@ -1309,5 +1317,5 @@ MUTATOR_HOOKFUNCTION(kh, DropSpecialItems) 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 }