osumodcalculator
Version: 
osu! calculator for converting values to DT & HT and other things
163 lines (162 loc) • 3.72 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const stats_1 = require("../stats");
{
    (0, stats_1.ToMsOd)(9);
    // => { 
    // hitwindow_300: 25.5, 
    // hitwindow_100: 67.5, 
    // hitwindow_50: 109.5 
    // }
}
{
    (0, stats_1.ToMsAr)(9); // => 600
}
{
    const hitWindow_300s = 25.5;
    const hitWindow_100s = 67.5;
    const hitWindow_50s = 109.5;
    const first = (0, stats_1.FromMsOd)(hitWindow_300s); // => 9
    const second = (0, stats_1.FromMsOd)(NaN, hitWindow_100s); // => 9
    const third = (0, stats_1.FromMsOd)(NaN, NaN, hitWindow_50s); // => 9
}
{
    (0, stats_1.FromMsAr)(600); // => 9
}
{
    const oldAr = 9;
    const newAr = (0, stats_1.ToDtAr)(oldAr);
    // => {
    // ar: 10.33
    // ms: 400
    // }
}
{
    const oldAr = 9;
    const newAr = (0, stats_1.ToHtAr)(oldAr);
    // => {
    // ar: 7.67
    // ms: 800
    // }
}
{
    const oldOd = 9;
    const newOd = (0, stats_1.ToDtOd)(oldOd);
    // => {
    // hitwindow_300: 17,
    // hitwindow_100: 45,
    // hitwindow_50: 73,
    // od: 10.42,
    // }
}
{
    const oldOd = 9;
    const newOd = (0, stats_1.ToHtOd)(oldOd);
    // => {
    // hitwindow_300: 34,
    // hitwindow_100: 90,
    // hitwindow_50: 146,
    // od: 7.58,
    // }
}
{
    const circleSize = 4;
    const approachRate = 9.8;
    const overallDifficulty = 9.1;
    const health = 5;
    const modded = (0, stats_1.toHR)(circleSize, approachRate, overallDifficulty, health);
    // => { 
    // cs: 5.2
    // ar: 10
    // od: 10
    // hp: 7
    // }
}
{
    const circleSize = 4;
    const approachRate = 9.8;
    const overallDifficulty = 9.1;
    const health = 5;
    const modded = (0, stats_1.toEZ)(circleSize, approachRate, overallDifficulty, health);
    // => { 
    // cs: 2
    // ar: 4.9
    // od: 4.55
    // hp: 2.5
    // }
}
{
    (0, stats_1.csToRadius)(5); // => 32.006
}
{
    const radius = 32.01; // in pixels
    (0, stats_1.csFromRadius)(radius); // => 5
}
{
    // https://osu.ppy.sh/b/ 759056
    const speedRate = 1.15;
    const approachRate = 9.2;
    const overallDifficulty = 8;
    const bpm = 189;
    const songLength = 189;
    const newStats = (0, stats_1.speed)(speedRate, { ar: approachRate, od: overallDifficulty, bpm, songLength });
    // => 
    // {
    //     ar: 9.7,
    //     od: 8.68,
    //     bpm: 217.35,
    //     songLength: 164.34782608695653,      
    //     extra: {
    //         arMs: 495.6521739130436,
    //         odMs: {
    //             hitwindow_300: 27.39130434782609,
    //             hitwindow_100: 65.65217391304348,
    //             hitwindow_50: 103.91304347826087,
    //         },
    //     },
    // }
}
{
    const circleSize = 4;
    const approachRate = 10;
    const overallDifficulty = 5.5;
    const hp = 6;
    const bpm = 215;
    const songLength = 180;
    const mods = [{
            acronym: 'DT',
            settings: {
                speed_change: 1.15
            }
        },
        {
            acronym: 'DA',
            settings: {
                circle_size: 3.5
            }
        }
    ];
    const moddedStats = (0, stats_1.modded)({
        cs: circleSize,
        ar: approachRate,
        od: overallDifficulty,
        hp, bpm, songLength
    }, mods);
    // =>
    // {
    // cs: 3.5,
    // ar: 10.39,
    // od: 6.51,
    // hp: 6,
    // bpm: 247.24999999999997,
    // songLength: 156.52173913043478,
    // extra: {
    //     csRadius: 38.730180610000005,
    //     arMs: 391.304347826087,
    //     odMs: {
    //         hitwindow_300: 40.434782608695656,
    //         hitwindow_100: 83.04347826086958,
    //         hitwindow_50: 125.65217391304348,
    //     },
    // },
}