From: terencehill Date: Mon, 13 Sep 2021 21:58:36 +0000 (+0200) Subject: Merge branch 'master' into terencehill/lms_updates X-Git-Tag: xonotic-v0.8.6~426^2~12 X-Git-Url: http://de.git.xonotic.org/?a=commitdiff_plain;h=d0723d5dc8d2e92262cfe895b9dbfb4241c68d9c;p=xonotic%2Fxonotic-data.pk3dir.git Merge branch 'master' into terencehill/lms_updates # Conflicts: # qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc --- d0723d5dc8d2e92262cfe895b9dbfb4241c68d9c diff --cc gamemodes-server.cfg index e97ae1a01,17b90c624..d89511ab1 --- a/gamemodes-server.cfg +++ b/gamemodes-server.cfg @@@ -446,21 -446,9 +446,21 @@@ set g_lms 0 "Last Man Standing: everyon set g_lms_lives_override -1 set g_lms_extra_lives 0 set g_lms_regenerate 0 - set g_lms_last_join 3 "if g_lms_join_anytime is false, new players can only join if the worst active player has more than (fraglimit - g_lms_last_join) lives" - set g_lms_join_anytime 1 "if true, new players can join, but get same amount of lives as the worst player" + set g_lms_last_join 3 "if g_lms_join_anytime is 0, new players can only join if the worst active player has (fraglimit - g_lms_last_join) or more lives; in other words, new players can no longer join once the worst player loses more than g_lms_last_join lives" + set g_lms_join_anytime 1 "1: new players can join, but get same amount of lives as the worst player; 0: new players can only join if the worst active player has (fraglimit - g_lms_last_join) or more lives" set g_lms_weaponarena "most_available" "starting weapons - takes the same options as g_weaponarena" +set g_lms_leader_wp_lives 2 "show waypoints for players leading by this number of lives" +set g_lms_leader_wp_max_relative 0.5 "show waypoints for leaders only if they are max this fraction of total players" +set g_lms_leader_wp_time 5 "show waypoints for leaders only for this amount of time" +set g_lms_leader_wp_time_repeat 30 "periodically show again waypoints for leaders after this amount of time" +set g_lms_dynamic_respawn_delay 1 "increase player respawn delay based on the number of lives less than the leader (NOTE: delay doesn't increase when only 2 players are left alive)" +set g_lms_dynamic_respawn_delay_base 2 "base player respawn delay" +set g_lms_dynamic_respawn_delay_increase 3 "increase base player respawn delay by this amount of time for each life less than the leader" +set g_lms_dynamic_vampire 1 "attackers receive a fraction of health removed from enemies based on the number of lives less than the enemy" +set g_lms_dynamic_vampire_factor_base 0.1 "base vampire factor" +set g_lms_dynamic_vampire_factor_increase 0.1 "increase vampire factor by this fraction for each life less than the enemy" +set g_lms_dynamic_vampire_factor_max 0.5 "max vampire factor" +set g_lms_dynamic_vampire_min_lives_diff 2 "number of lives the attacker must have less than the enemy to receive the base fraction of health" // ========= diff --cc qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc index 41673a7d7,e9ddb4e81..018f75e36 --- a/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc +++ b/qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc @@@ -137,12 -123,26 +137,28 @@@ MUTATOR_HOOKFUNCTION(lms, reset_map_glo MUTATOR_HOOKFUNCTION(lms, reset_map_players) { FOREACH_CLIENT(true, { + if (it.frags == FRAGS_PLAYER_OUT_OF_GAME) + { + // players who forfeited (rank >= 256) become spectators + if (it.lms_spectate_warning == 2) + it.frags = FRAGS_SPECTATOR; + else + it.frags = FRAGS_PLAYER; + } + + CS(it).killcount = 0; + it.lmsplayer = 0; + it.lms_spectate_warning = 0; + GameRules_scoring_add(it, LMS_RANK, -GameRules_scoring_add(it, LMS_RANK, 0)); + GameRules_scoring_add(it, LMS_LIVES, -GameRules_scoring_add(it, LMS_LIVES, 0)); + + if (it.frags != FRAGS_PLAYER) + continue; + TRANSMUTE(Player, it); - it.frags = FRAGS_PLAYER; - GameRules_scoring_add(it, LMS_LIVES, LMS_NewPlayerLives()); PutClientInServer(it); + if (it.waypointsprite_attachedforcarrier) + WaypointSprite_Kill(it.waypointsprite_attachedforcarrier); }); } @@@ -180,23 -228,31 +244,17 @@@ MUTATOR_HOOKFUNCTION(lms, ForbidSpawn { entity player = M_ARGV(0, entity); - if(warmup_stage) + if (warmup_stage || lms_AddPlayer(player)) return false; - if(player.frags == FRAGS_SPECTATOR || GameRules_scoring_add(player, LMS_LIVES, 0) <= 0) - { - Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_LMS_NOLIVES); - return true; - } - return false; - } - MUTATOR_HOOKFUNCTION(lms, PlayerDies) - { + return true; } -MUTATOR_HOOKFUNCTION(lms, PlayerDies) -{ - entity frag_target = M_ARGV(2, entity); - - float tl = GameRules_scoring_add(frag_target, LMS_LIVES, 0); - if (tl <= 0) - { - frag_target.respawn_flags = RESPAWN_SILENT; - // prevent unwanted sudden rejoin as spectator and movement of spectator camera - frag_target.respawn_time = time + 2; - } - frag_target.respawn_flags |= RESPAWN_FORCE; -} - void lms_RemovePlayer(entity player) { - static int quitters = 0; + if (warmup_stage || time < game_starttime) + return; + float player_rank = GameRules_scoring_add(player, LMS_RANK, 0); if (!player_rank) {