From ad90681cb3ab6a153d4f697bc73c612ee2f9d188 Mon Sep 17 00:00:00 2001 From: LegendaryGuard Date: Sun, 28 Mar 2021 14:17:01 +0200 Subject: [PATCH] Fixes and improvements for admin users, don't make Karma control too strict when player attacks ally in the round, already ends punished --- gamemodes-server.cfg | 3 ++- qcsrc/common/gamemodes/gamemode/mmm/sv_mmm.qc | 25 ++++++++++--------- qcsrc/common/notifications/all.inc | 1 + 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/gamemodes-server.cfg b/gamemodes-server.cfg index e62de0c1a..f19b435f0 100644 --- a/gamemodes-server.cfg +++ b/gamemodes-server.cfg @@ -574,7 +574,7 @@ set g_mmm 0 "Murder in Megaerebus Manor: A group of space civilians have murdere set g_mmm_not_lms_maps 0 "when this is set, LMS maps will NOT be listed in mmm" set g_mmm_civilian_count 0.625 "number of players who will become civilians, set between 0 and 0.9 to use a multiplier of the current players, or 1 and above to specify an exact number of players" //set g_mmm_murderer_count 0.25 "number of players who will become murderers, set between 0 and 0.9 to use a multiplier of the current players, or 1 and above to specify an exact number of players" -set g_mmm_punish_teamkill 0 "kill the player when they kill an ally" +set g_mmm_punish_teamkill 0 "enable option to kill the player when they kill an ally" set g_mmm_reward_civilian 1 "give a point to all civilian players if the round timelimit is reached, in addition to the points given for kills" set g_mmm_warmup 10 "how long the players will have time to run around the map before the round starts" set g_mmm_round_timelimit 180 "round time limit in seconds" @@ -583,5 +583,6 @@ set g_mmm_min_karma_points 400 "limit where number of karma points can be reache set g_mmm_karma_bankick_tool 0 "tool for strict rules when karma is low: '0' forces player to spec, '1' kicks player, '2' bans player" set g_mmm_karma_bantime 1800 "number of seconds to ban someone with very low karma" set g_mmm_karma_damageactive 1 "enable karma damage rule. If a player's karma is low, they will not do as much damage as a player who has high or full karma" +set g_mmm_karma_damagepunishmentdeal 20 "punishment damage points when player kills an ally" set g_mmm_karma_severity 0.25 "how severe karma is to decrease karma points to the players [0.1 - 1.0]" set g_mmm_reward_sleuth 1 "give a point to all sleuth players if investigated corpses" \ No newline at end of file diff --git a/qcsrc/common/gamemodes/gamemode/mmm/sv_mmm.qc b/qcsrc/common/gamemodes/gamemode/mmm/sv_mmm.qc index 7685e9faf..72936522b 100644 --- a/qcsrc/common/gamemodes/gamemode/mmm/sv_mmm.qc +++ b/qcsrc/common/gamemodes/gamemode/mmm/sv_mmm.qc @@ -15,6 +15,7 @@ int autocvar_g_mmm_karma_bankick_tool = 0; //LegendGuard sets a ban tool for ser float autocvar_g_mmm_karma_bantime = 1800; //karma ban seconds bool autocvar_g_mmm_karma_damageactive = true; //LegendGuard sets Karma damage setting if active 20-03-2021 float autocvar_g_mmm_karma_severity = 0.25; +float autocvar_g_mmm_karma_damagepunishmentdeal = 20; //LegendGuard sets Karma punishment damage setting if player kills an ally 28-03-2021 // Sleuth is a created team, this team is added inside Civilians team @@ -66,7 +67,7 @@ void karma_Control(entity it) void karmaLoseDifference(entity attacker, entity target) { - if (autocvar_g_mmm_karma_severity <= 0.01) + if (autocvar_g_mmm_karma_severity <= 0.09) autocvar_g_mmm_karma_severity = 0.1; else if (autocvar_g_mmm_karma_severity > 1) autocvar_g_mmm_karma_severity = 1; @@ -119,7 +120,6 @@ void mmm_UpdateScores(bool timed_out) { karmaWinDifference(it); //PrintToChatAll(sprintf("^2REWARD ^7it.karmapoints: ^1%f", it.karmapoints)); - karma_Control(it); } //Sleuth reward after investigated a corpse @@ -131,20 +131,17 @@ void mmm_UpdateScores(bool timed_out) karmaWinDifference(it); it.investigated = false; } - karma_Control(it); } if(it.mmm_status == MMM_STATUS_CIVILIAN) { karmaWinDifference(it); //PrintToChatAll(sprintf("^2CIVILIAN ^7it.karmapoints: ^1%f", it.karmapoints)); - karma_Control(it); } else if(it.mmm_status == MMM_STATUS_MURDERER) { karmaWinDifference(it); //PrintToChatAll(sprintf("^1MURDERER ^7it.karmapoints: ^1%f", it.karmapoints)); - karma_Control(it); } } }); @@ -386,7 +383,7 @@ void mmm_RoundStart() GiveWeapon(it, WEP_MINE_LAYER.m_id, OP_PLUS, 1); Send_Notification(NOTIF_ONE_ONLY, it, MSG_CENTER, CENTER_MMM_SLEUTH); Send_Notification(NOTIF_ONE_ONLY, it, MSG_INFO, INFO_MMM_SLEUTH); - PrintToChatAll(sprintf("%s is ^4Sleuth^7!", it.netname)); + Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_MMM_WHOISSLEUTH, it.netname); } mmm_FakeTimeLimit(it, round_handler_GetEndTime()); }); @@ -503,7 +500,6 @@ void ReduceKarmaPointsandFrags(entity frag_attacker, entity frag_target, float f { karmaLoseDifference(frag_attacker, frag_target); GiveFrags(frag_attacker, frag_target, ((autocvar_g_mmm_punish_teamkill) ? -1 : -2), frag_deathtype, wep_ent.weaponentity_fld); - karma_Control(frag_attacker); frag_target.whokilled = frag_attacker.netname; } @@ -838,8 +834,7 @@ MUTATOR_HOOKFUNCTION(mmm, PlayerDies) if (frag_target.mmm_status == MMM_STATUS_CIVILIAN) { //PrintToChatAll("^1DEBUG^7: ^4SLEUTH ^1DAMAGE/DEAD^7 HAS TAKEN!"); - //30 damage points deal - Damage(frag_attacker, frag_attacker, frag_attacker, 30, DEATH_MIRRORDAMAGE.m_id, DMG_NOWEP, frag_attacker.origin, '0 0 0'); + Damage(frag_attacker, frag_attacker, frag_attacker, autocvar_g_mmm_karma_damagepunishmentdeal, DEATH_MIRRORDAMAGE.m_id, DMG_NOWEP, frag_attacker.origin, '0 0 0'); } } if (frag_attacker.mmm_status == MMM_STATUS_CIVILIAN) @@ -847,8 +842,15 @@ MUTATOR_HOOKFUNCTION(mmm, PlayerDies) if (frag_target.mmm_status == MMM_STATUS_SLEUTH) { //PrintToChatAll("^1DEBUG^7: ^2CIVILIAN ^1DAMAGE/DEAD^7 HAS TAKEN!"); - //30 damage points deal - Damage(frag_attacker, frag_attacker, frag_attacker, 30, DEATH_MIRRORDAMAGE.m_id, DMG_NOWEP, frag_attacker.origin, '0 0 0'); + Damage(frag_attacker, frag_attacker, frag_attacker, autocvar_g_mmm_karma_damagepunishmentdeal, DEATH_MIRRORDAMAGE.m_id, DMG_NOWEP, frag_attacker.origin, '0 0 0'); + } + } + if (frag_attacker.mmm_status == MMM_STATUS_MURDERER) + { + if (frag_target.mmm_status == MMM_STATUS_MURDERER) + { + //PrintToChatAll("^1DEBUG^7: ^1MURDERER ^1DAMAGE/DEAD^7 HAS TAKEN!"); + Damage(frag_attacker, frag_attacker, frag_attacker, autocvar_g_mmm_karma_damagepunishmentdeal, DEATH_MIRRORDAMAGE.m_id, DMG_NOWEP, frag_attacker.origin, '0 0 0'); } } return true; @@ -865,7 +867,6 @@ MUTATOR_HOOKFUNCTION(mmm, ClientDisconnect) MUTATOR_HOOKFUNCTION(mmm, MakePlayerObserver) { - // LegendGuard, here is where spectators shouldn't talk to any players to say the hints or who is who 21-10-2021 entity player = M_ARGV(0, entity); if (IS_PLAYER(player) && !IS_DEAD(player)) diff --git a/qcsrc/common/notifications/all.inc b/qcsrc/common/notifications/all.inc index f192e5f11..0d2026a63 100644 --- a/qcsrc/common/notifications/all.inc +++ b/qcsrc/common/notifications/all.inc @@ -450,6 +450,7 @@ string multiteam_info_sprintf(string input, string teamname) { return ((input != //LegendGuard adds N_CHATCON option 20-03-2021 MSG_INFO_NOTIF(MMM_SLEUTH, N_CHATCON, 0, 0, "", "", "", _("^BGYou are ^4Sleuth^BG!"), "") + MSG_INFO_NOTIF(MMM_WHOISSLEUTH, N_CHATCON, 1, 0, "s1", "s1", "", _("^BG%s is ^4Sleuth^BG!"), "") MSG_INFO_NOTIF(VERSION_BETA, N_CONSOLE, 2, 0, "s1 s2", "", "", _("^F4NOTE: ^BGThe server is running ^F1Xonotic %s (beta)^BG, you have ^F2Xonotic %s"), "") MSG_INFO_NOTIF(VERSION_OLD, N_CHATCON, 2, 0, "s1 s2", "", "", _("^F4NOTE: ^BGThe server is running ^F1Xonotic %s^BG, you have ^F2Xonotic %s"), "") -- 2.39.2