mirror of
https://github.com/zkldi/Tachi.git
synced 2026-09-30 02:48:01 +03:00
@@ -159,3 +159,16 @@ export enum SDVXVFClasses {
|
||||
IMPERIAL_III,
|
||||
IMPERIAL_IV,
|
||||
}
|
||||
|
||||
export enum CHUNITHM_COLOURS {
|
||||
BLUE,
|
||||
GREEN,
|
||||
ORANGE,
|
||||
RED,
|
||||
PURPLE,
|
||||
BRONZE,
|
||||
SILVER,
|
||||
GOLD,
|
||||
PLATINUM,
|
||||
RAINBOW,
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Game, Playtypes, integer, ScoreCalculatedDataLookup } from "tachi-common";
|
||||
import { GameClasses } from "tachi-common/js/game-classes";
|
||||
import { GitadoraColours, SDVXVFClasses } from "lib/constants/classes";
|
||||
import { CHUNITHM_COLOURS, GitadoraColours, SDVXVFClasses } from "lib/constants/classes";
|
||||
import { KtLogger } from "lib/logger/logger";
|
||||
|
||||
export function CalculateSDVXClass(
|
||||
@@ -94,6 +94,41 @@ export function GitadoraSkillToColour(sk: number) {
|
||||
return GitadoraColours.WHITE;
|
||||
}
|
||||
|
||||
export function CalculateChunithmColour(
|
||||
game: Game,
|
||||
playtype: Playtypes[Game],
|
||||
userID: integer,
|
||||
ratings: Record<string, number>
|
||||
) {
|
||||
const colour = ChuniRatingToColour(ratings.naiveRating);
|
||||
|
||||
return { colour };
|
||||
}
|
||||
|
||||
function ChuniRatingToColour(rating: number) {
|
||||
if (rating >= 15) {
|
||||
return CHUNITHM_COLOURS.RAINBOW;
|
||||
} else if (rating >= 14.5) {
|
||||
return CHUNITHM_COLOURS.PLATINUM;
|
||||
} else if (rating >= 14) {
|
||||
return CHUNITHM_COLOURS.GOLD;
|
||||
} else if (rating >= 13) {
|
||||
return CHUNITHM_COLOURS.SILVER;
|
||||
} else if (rating >= 12) {
|
||||
return CHUNITHM_COLOURS.BRONZE;
|
||||
} else if (rating >= 10) {
|
||||
return CHUNITHM_COLOURS.PURPLE;
|
||||
} else if (rating >= 7) {
|
||||
return CHUNITHM_COLOURS.RED;
|
||||
} else if (rating >= 4) {
|
||||
return CHUNITHM_COLOURS.ORANGE;
|
||||
} else if (rating >= 2) {
|
||||
return CHUNITHM_COLOURS.GREEN;
|
||||
}
|
||||
|
||||
return CHUNITHM_COLOURS.BLUE;
|
||||
}
|
||||
|
||||
// export function CalculateJubeatColour(
|
||||
// game: Game,
|
||||
// playtype: Playtypes[Game],
|
||||
|
||||
@@ -2,7 +2,11 @@ import { Game, Playtypes, integer, UserGameStats, ClassDelta, IDStrings } from "
|
||||
import { GameClasses } from "tachi-common/js/game-classes";
|
||||
import deepmerge from "deepmerge";
|
||||
import { KtLogger } from "lib/logger/logger";
|
||||
import { CalculateGitadoraColour, CalculateSDVXClass } from "./builtin-class-handlers";
|
||||
import {
|
||||
CalculateChunithmColour,
|
||||
CalculateGitadoraColour,
|
||||
CalculateSDVXClass,
|
||||
} from "./builtin-class-handlers";
|
||||
import { ReturnClassIfGreater } from "utils/class";
|
||||
import { RedisPub } from "external/redis/redis-IPC";
|
||||
import { ClassHandler, ScoreClasses } from "./types";
|
||||
@@ -27,7 +31,9 @@ type ClassHandlerMap = {
|
||||
const STATIC_CLASS_HANDLERS: ClassHandlerMap = {
|
||||
iidx: null,
|
||||
bms: null,
|
||||
chunithm: null,
|
||||
chunithm: {
|
||||
colour: CalculateChunithmColour,
|
||||
},
|
||||
ddr: null,
|
||||
gitadora: {
|
||||
Gita: CalculateGitadoraColour,
|
||||
|
||||
Reference in New Issue
Block a user