From bcd1993dbe05334828443c89662c1b878299fcf0 Mon Sep 17 00:00:00 2001 From: BuildTools <18whitechristop@gmail.com> Date: Sat, 10 Jun 2017 00:41:39 -0700 Subject: [PATCH] Edit MVP calculations --- .../java/tc/oc/pgm/highlights/HighlightListener.java | 3 ++- .../java/tc/oc/pgm/playerstats/StatsUserFacet.java | 11 ++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/PGM/src/main/java/tc/oc/pgm/highlights/HighlightListener.java b/PGM/src/main/java/tc/oc/pgm/highlights/HighlightListener.java index 9ad8a6d..aa52214 100644 --- a/PGM/src/main/java/tc/oc/pgm/highlights/HighlightListener.java +++ b/PGM/src/main/java/tc/oc/pgm/highlights/HighlightListener.java @@ -40,6 +40,7 @@ public class HighlightListener implements Listener { double points = 0; points += facet.matchKills(); points -= facet.deaths(); + points -= facet.teammatesKilled(); for (long wool : facet.getWoolCaptureTimes()) { int woolPoints = (int)((wool * 2.25) - 2); points += Math.min(Math.max(woolPoints, 0), 120); @@ -60,7 +61,7 @@ public class HighlightListener implements Listener { points += Math.min(Math.max(flagPoints, 0), 120); } - points += (facet.getBlocksBroken() / 20); + points += (facet.getBlocksBroken() / 30); if (bestPlayerStats == null || points > bestPlayerPoints) { bestPlayerStats = facet; diff --git a/PGM/src/main/java/tc/oc/pgm/playerstats/StatsUserFacet.java b/PGM/src/main/java/tc/oc/pgm/playerstats/StatsUserFacet.java index ad5545f..d68a572 100644 --- a/PGM/src/main/java/tc/oc/pgm/playerstats/StatsUserFacet.java +++ b/PGM/src/main/java/tc/oc/pgm/playerstats/StatsUserFacet.java @@ -28,7 +28,7 @@ import java.util.*; public class StatsUserFacet implements MatchUserFacet, Listener { private final UUID player; - private int lifeKills, teamKills, matchKills, deaths; + private int lifeKills, teamKills, matchKills, teammatesKilled, deaths; private List woolCaptureTimes; private Map coreTouchTimes; private List coreLeakTimes; @@ -69,6 +69,13 @@ public class StatsUserFacet implements MatchUserFacet, Listener { return matchKills; } + /** + * Get the amount of kills this player got in the whole match. + */ + public int teammatesKilled() { + return teammatesKilled; + } + /** * Amount of times this player died. */ @@ -111,6 +118,8 @@ public class StatsUserFacet implements MatchUserFacet, Listener { ++lifeKills; ++teamKills; ++matchKills; + } else if (killer != null && killer.getUniqueId().equals(player) && event.isTeamKill()) { + ++teammatesKilled; } }