From: LegendaryGuard Date: Fri, 26 Mar 2021 23:54:10 +0000 (+0100) Subject: Added karma severity cvar to adjust how severe can be to decrease player karma points... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=649fdbf23d7257060a2fa7871c2c473f2f25087c;p=xonotic%2Fxonotic-data.pk3dir.git Added karma severity cvar to adjust how severe can be to decrease player karma points (added for admin management) --- diff --git a/qcsrc/common/gamemodes/gamemode/mmm/sv_mmm.qc b/qcsrc/common/gamemodes/gamemode/mmm/sv_mmm.qc index eb4fd3ad9..525fc21a1 100644 --- a/qcsrc/common/gamemodes/gamemode/mmm/sv_mmm.qc +++ b/qcsrc/common/gamemodes/gamemode/mmm/sv_mmm.qc @@ -14,6 +14,7 @@ float autocvar_g_mmm_min_karma_points = 400; int autocvar_g_mmm_karma_bankick_tool = 0; //LegendGuard sets a ban tool for server admins 11-03-2021 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; // Sleuth is a created team, this team is added inside Civilians team @@ -65,22 +66,27 @@ void karma_Control(entity it) void karmaLoseDifference(entity attacker, entity target) { + if (autocvar_g_mmm_karma_severity <= 0) + autocvar_g_mmm_karma_severity = 0.1; + else if (autocvar_g_mmm_karma_severity > 1) + autocvar_g_mmm_karma_severity = 1; + //BASIC MATH THEORY: example: 1000 * 0.3 * (0.1 + 0.4) * 0.25 // karma points reduce when player attacked to other player if (target.karmapoints < attacker.karmapoints) { - float decreasekarma = - ( target.karmapoints * random() * ( 0.1 + random() ) * 0.25 ); + float decreasekarma = - ( target.karmapoints * random() * ( 0.1 + random() ) * autocvar_g_mmm_karma_severity ); GameRules_scoring_add(attacker, MMM_KARMA, decreasekarma); attacker.karmapoints = attacker.karmapoints + decreasekarma; } else if (target.karmapoints > attacker.karmapoints) { - float decreasekarma = - ( target.karmapoints * random() * ( 0.1 + random() ) * 0.25 ); + float decreasekarma = - ( target.karmapoints * random() * ( 0.1 + random() ) * autocvar_g_mmm_karma_severity ); GameRules_scoring_add(attacker, MMM_KARMA, decreasekarma); attacker.karmapoints = attacker.karmapoints + decreasekarma; } else { - float decreasekarma = - ( target.karmapoints * random() * ( 0.1 + random() ) * 0.25 ); + float decreasekarma = - ( target.karmapoints * random() * ( 0.1 + random() ) * autocvar_g_mmm_karma_severity ); GameRules_scoring_add(attacker, MMM_KARMA, decreasekarma); attacker.karmapoints = attacker.karmapoints + decreasekarma; }