Initial commit

This commit is contained in:
2026-08-24 22:20:36 +02:00
commit 62f7b1278a
251 changed files with 16670 additions and 0 deletions
+45
View File
@@ -0,0 +1,45 @@
const { MAXIMUM } = require("./constants");
const { MAX_LEVEL_ELITE } = MAXIMUM;
const a = 1;
const b = -1;
const levels = {
pirateLevel(points) {
const c = points * 2 / 250 * -1;
const discriminant = Math.pow(b, 2) - 4 * a * c;
const x1 = (-b + Math.sqrt(discriminant)) / (2 * a);
const currentLevel = Math.floor(x1);
return currentLevel;
},
eliteLevel(points) {
const c = points * 2 / 750 * -1;
const discriminant = Math.pow(b, 2) - 4 * a * c;
const x1 = (-b + Math.sqrt(discriminant)) / (2 * a);
const currentLevel = Math.floor(x1);
return Math.min(currentLevel, MAX_LEVEL_ELITE);
},
fishingLevel(points) {
const c = points * 2 / 525 * -1;
const discriminant = Math.pow(b, 2) - 4 * a * c;
const x1 = (-b + Math.sqrt(discriminant)) / (2 * a);
const currentLevel = Math.floor(x1);
return currentLevel;
},
guildLevel(points) {
const c = points * 2 / 20 * -1;
const discriminant = Math.pow(b, 2) - 4 * a * c;
const x1 = (-b + Math.sqrt(discriminant)) / (2 * a);
const currentLevel = Math.floor(x1);
return currentLevel;
}
};
module.exports = levels;