in rare cases a guy in top 5% and the next guy right outside of it have the same time. in those cases give them the same boost. also for last guy in 1% and first guy in 5%

This commit is contained in:
jenz 2024-01-27 17:43:48 +01:00
parent 50cff40f7c
commit 2d28912e3d

View File

@ -418,8 +418,7 @@ public class Facade {
for (MapBoard mapboard : mapboards) {
//System.out.println("mapName: " + mapboard.getMapName());
List<MapValues> mapvalues = new ArrayList();
for (MapValues mv : mapboard.getMapvalues())
{
for (MapValues mv : mapboard.getMapvalues()) {
mapvalues.add(mv);
}
mapvalues.sort(Comparator.comparing(MapValues::getTime));
@ -440,11 +439,15 @@ public class Facade {
OnePercent = (int) Math.floor(playerCount * 0.01);
}
int position = 1;
//suggested by roko. cause in rare cases a guy in top 1% or 5% has the same time as a guy right behind him not getting the percentage boost.
//if rank 10 and rank 11 both have a time of 10.546 maybe only rank 10 gets the 1% boost but not rank 11. this is meant to give rank 11 the boost too.
float previousTimeOnePercent = 0.0f;
float previousTimeFivePercent = 0.0f;
for (MapValues mapvalue : mapvalues) {
mapvalue.setPosition(position);
int Points = playerCount - position;
if (playerCount <= 250)
{
if (playerCount <= 250) {
//if less than 250 people finished a time i also want to give them each an additional 2500 points.
//that is to make up hard timers that not many people actually finish so they are considered worth more.
//for example race mode in mako and race timers in jump king should be rewarded a lot more due to their difficulties.
@ -452,7 +455,18 @@ public class Facade {
}
if (position <= OnePercent) {
Points *= 4;
previousTimeOnePercent = mapvalue.getTime(); //eventually is set for the last guy getting 1% boost.
} else if (position <= FivePercent) {
previousTimeFivePercent = mapvalue.getTime(); //eventually is set for the last guy getting 5% boost.
if (previousTimeFivePercent == previousTimeOnePercent) {
//if a guy is listed as part of 5% boost but has the exact same time as the last guy getting 1% boost give him the 1% boost benefit too.
Points *= 4;
} else {
Points *= 2;
}
}
else if (previousTimeFivePercent == mapvalue.getTime()) {
//if the last guy getting 5% boost has a time of 10.654 and the next guy also has a time of 10.654 give him the boost too.
Points *= 2;
}
mapvalue.setMapPoints(Points);