1- import { CalculateMods , Mod , ModsLazer , Rulesets } from '@tosu/common' ;
1+ import { Mod , ModsLazer , Rulesets } from '@tosu/common' ;
22import { HitObject } from 'osu-classes' ;
33
44import { Statistics } from '@/states/types' ;
@@ -248,18 +248,23 @@ export const calculatePassedObjects = (
248248
249249export const calculateBeatmapAttributes = ( params : {
250250 isConvert : boolean ;
251+ isLazer : boolean ;
251252
252253 ar : number ;
253254 cs : number ;
254255 od : number ;
255256 hp : number ;
256257
257258 mode : number ;
258- mods : CalculateMods ;
259+ mods : ModsLazer ;
260+
261+ rate : number ;
259262} ) => {
260- const isEz = params . mods . array . some ( ( r ) => r . acronym === 'EZ' ) ;
261- const isHr = params . mods . array . some ( ( r ) => r . acronym === 'HR' ) ;
262- const DA = ( params . mods . array as Mod [ ] ) . find ( ( r ) => r . acronym === 'DA' ) ;
263+ const isEz = params . mods . some ( ( r ) => r . acronym === 'EZ' ) ;
264+ const isHr = params . mods . some ( ( r ) => r . acronym === 'HR' ) ;
265+ // const isV2 = params.mods.some((r) => r.acronym === 'SV2');
266+
267+ const DA = ( params . mods as Mod [ ] ) . find ( ( r ) => r . acronym === 'DA' ) ;
263268 const multiply = isHr ? 1.4 : isEz ? 0.5 : 1 ;
264269
265270 const AR = DA ?. settings ?. approach_rate ?? params . ar ;
@@ -272,34 +277,38 @@ export const calculateBeatmapAttributes = (params: {
272277 const csConverted = isHr ? Math . min ( CS * 1.3 , 10 ) : CS * multiply ;
273278 const hpConverted = isHr ? Math . min ( HP * multiply , 10 ) : HP * multiply ;
274279
275- if ( params . mods . rate !== 1 ) {
280+ if ( params . isLazer && params . mode === Rulesets . mania ) {
281+ // they do some magic shit here
282+ }
283+
284+ if ( params . rate !== 1 ) {
276285 arConverted =
277286 arConverted <= 5
278- ? 15 - ( 15 - arConverted ) / ( 1 * params . mods . rate )
279- : 13 - ( 13 - arConverted ) / ( 1 * params . mods . rate ) ;
287+ ? 15 - ( 15 - arConverted ) / ( 1 * params . rate )
288+ : 13 - ( 13 - arConverted ) / ( 1 * params . rate ) ;
280289
281290 switch ( params . mode ) {
282291 case Rulesets . osu :
283- odConverted =
284- 13.33 - ( 13.33 - odConverted ) / ( 1 * params . mods . rate ) ;
292+ odConverted = 13.33 - ( 13.33 - odConverted ) / ( 1 * params . rate ) ;
285293 break ;
286294
287295 case Rulesets . taiko :
288296 odConverted =
289297 16.66666666666667 -
290- ( 16.66666666666667 - odConverted ) / ( 1 * params . mods . rate ) ;
298+ ( 16.66666666666667 - odConverted ) / ( 1 * params . rate ) ;
291299 break ;
292300
293301 case Rulesets . mania : {
294- // if (commonParams.lazer === true || (commonParams.lazer === false && isV2))
295- // odMs = _OD <= 5 ? 22.4 - 0.6 * _OD : 24.9 - 1.1 * _OD;
296-
297- // else if (this.mode !== currentMode)
298- // odMs = 16;
299-
300- // else
301- // odMs = 16;
302- // odMs = Math.floor(72 - 6 * _OD);
302+ // also some dark magic shit right here
303+ // if (params.isLazer === false && isV2)
304+ // odConverted =
305+ // odConverted <= 5
306+ // ? 37.33 - (37.33 - odConverted)
307+ // : 22.63636363636364 -
308+ // (22.63636363636364 - odConverted);
309+ // else if (params.isConvert)
310+ // odConverted = 16 - (16 - odConverted);
311+ // else odConverted = 16 - (16 - odConverted);
303312 break ;
304313 }
305314 }
0 commit comments