->'/dps' tracker now shows the largest single hit dealt during tracking

time.
This commit is contained in:
sigonasr2 2016-08-13 21:08:54 -05:00
parent f8efbec088
commit 12ba779d88
2 changed files with 6 additions and 0 deletions

Binary file not shown.

View File

@ -21,6 +21,7 @@ public class DamageLogger {
int totalhits=0; int totalhits=0;
String player; String player;
long recordtime; long recordtime;
double maxhit=0;
public DamageLogger(Player p) { public DamageLogger(Player p) {
this.breakdownlist=new HashMap<String,Double>(); this.breakdownlist=new HashMap<String,Double>();
@ -38,6 +39,7 @@ public class DamageLogger {
this.totalmult=0.0; this.totalmult=0.0;
this.totalhits=0; this.totalhits=0;
this.recordtime=TwosideKeeper.getServerTickTime(); this.recordtime=TwosideKeeper.getServerTickTime();
this.maxhit=0.0;
} }
public void addMultiplierToLogger(String name, double val) { public void addMultiplierToLogger(String name, double val) {
@ -75,6 +77,9 @@ public class DamageLogger {
public void addCalculatedTotalDamage(double val) { public void addCalculatedTotalDamage(double val) {
this.calculatedtotaldmg+=val; this.calculatedtotaldmg+=val;
if (val>maxhit) {
this.maxhit=val;
}
this.lasttotaldmg=val; this.lasttotaldmg=val;
} }
@ -95,6 +100,7 @@ public class DamageLogger {
} }
finalstring.append(ChatColor.GRAY+""+ChatColor.BOLD+" Raw Damage: "+df.format(actualtotaldmg)+"\n"); finalstring.append(ChatColor.GRAY+""+ChatColor.BOLD+" Raw Damage: "+df.format(actualtotaldmg)+"\n");
finalstring.append(ChatColor.GOLD+""+ChatColor.ITALIC+" Final Damage: "+df.format(calculatedtotaldmg)+" (Average "+df.format((1-(this.calculatedtotaldmg/this.actualtotaldmg))*100)+"% Reduction)\n"); finalstring.append(ChatColor.GOLD+""+ChatColor.ITALIC+" Final Damage: "+df.format(calculatedtotaldmg)+" (Average "+df.format((1-(this.calculatedtotaldmg/this.actualtotaldmg))*100)+"% Reduction)\n");
finalstring.append(ChatColor.GREEN+""+ChatColor.BOLD+" Highest Hit: "+ChatColor.RESET+ChatColor.YELLOW+df.format(this.maxhit)+" dmg\n");
double elapsedtime = ((TwosideKeeper.getServerTickTime()-recordtime)/20d); double elapsedtime = ((TwosideKeeper.getServerTickTime()-recordtime)/20d);
double dps = actualtotaldmg/elapsedtime; double dps = actualtotaldmg/elapsedtime;
finalstring.append(ChatColor.YELLOW+" Elapsed Time: "+ChatColor.AQUA+df.format(elapsedtime)+"s "+ChatColor.WHITE+"("+df.format(dps)+" damage/sec)"); finalstring.append(ChatColor.YELLOW+" Elapsed Time: "+ChatColor.AQUA+df.format(elapsedtime)+"s "+ChatColor.WHITE+"("+df.format(dps)+" damage/sec)");