-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
574 additions
and
500 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 7 additions & 1 deletion
8
packages/osu-base/src/beatmap/hitobjects/sliderObjects/SliderRepeat.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
import { EmptyHitWindow } from "../../../utils/EmptyHitWindow"; | ||
import { HitWindow } from "../../../utils/HitWindow"; | ||
import { SliderNestedHitObject } from "./SliderNestedHitObject"; | ||
|
||
/** | ||
* Represents a slider repeat. | ||
*/ | ||
export class SliderRepeat extends SliderNestedHitObject {} | ||
export class SliderRepeat extends SliderNestedHitObject { | ||
protected override createHitWindow(): HitWindow | null { | ||
return new EmptyHitWindow(); | ||
} | ||
} |
8 changes: 7 additions & 1 deletion
8
packages/osu-base/src/beatmap/hitobjects/sliderObjects/SliderTail.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
import { EmptyHitWindow } from "../../../utils/EmptyHitWindow"; | ||
import { HitWindow } from "../../../utils/HitWindow"; | ||
import { SliderNestedHitObject } from "./SliderNestedHitObject"; | ||
|
||
/** | ||
* Represents the tail of a slider. | ||
*/ | ||
export class SliderTail extends SliderNestedHitObject {} | ||
export class SliderTail extends SliderNestedHitObject { | ||
protected override createHitWindow(): HitWindow | null { | ||
return new EmptyHitWindow(); | ||
} | ||
} |
8 changes: 7 additions & 1 deletion
8
packages/osu-base/src/beatmap/hitobjects/sliderObjects/SliderTick.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
import { EmptyHitWindow } from "../../../utils/EmptyHitWindow"; | ||
import { HitWindow } from "../../../utils/HitWindow"; | ||
import { SliderNestedHitObject } from "./SliderNestedHitObject"; | ||
|
||
/** | ||
* Represents a slider tick in a slider. | ||
*/ | ||
export class SliderTick extends SliderNestedHitObject {} | ||
export class SliderTick extends SliderNestedHitObject { | ||
protected override createHitWindow(): HitWindow | null { | ||
return new EmptyHitWindow(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,36 @@ | ||
import { HitObject } from "../beatmap/hitobjects/HitObject"; | ||
import { Slider } from "../beatmap/hitobjects/Slider"; | ||
import { Modes } from "../constants/Modes"; | ||
import { PreciseDroidHitWindow } from "../utils/PreciseDroidHitWindow"; | ||
import { IModApplicableToDroid } from "./IModApplicableToDroid"; | ||
import { IModApplicableToHitObject } from "./IModApplicableToHitObject"; | ||
import { Mod } from "./Mod"; | ||
|
||
/** | ||
* Represents the Precise mod. | ||
*/ | ||
export class ModPrecise extends Mod implements IModApplicableToDroid { | ||
export class ModPrecise | ||
extends Mod | ||
implements IModApplicableToDroid, IModApplicableToHitObject | ||
{ | ||
override readonly acronym = "PR"; | ||
override readonly name = "Precise"; | ||
|
||
readonly droidRanked = true; | ||
readonly droidScoreMultiplier = 1.06; | ||
readonly droidString = "s"; | ||
readonly isDroidLegacyMod = false; | ||
|
||
applyToHitObject(_: Modes, hitObject: HitObject): void { | ||
if (hitObject instanceof Slider) { | ||
// For sliders, the hit window is enforced in the head - everything else is an instant hit or miss. | ||
hitObject.head.hitWindow = new PreciseDroidHitWindow( | ||
hitObject.head.hitWindow?.overallDifficulty, | ||
); | ||
} else { | ||
hitObject.hitWindow = new PreciseDroidHitWindow( | ||
hitObject.hitWindow?.overallDifficulty, | ||
); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { HitWindow } from "./HitWindow"; | ||
|
||
/** | ||
* Represents the hit window of osu!droid _without_ the Precise mod. | ||
*/ | ||
export class DroidHitWindow extends HitWindow { | ||
/** | ||
* Calculates the overall difficulty value of a great (300) hit window. | ||
* | ||
* @param value The value of the hit window, in milliseconds. | ||
* @returns The overall difficulty value. | ||
*/ | ||
static greatWindowToOD(value: number): number { | ||
return 5 - (value - 75) / 5; | ||
} | ||
|
||
/** | ||
* Calculates the overall difficulty value of a good (100) hit window. | ||
* | ||
* @param value The value of the hit window, in milliseconds. | ||
* @returns The overall difficulty value. | ||
*/ | ||
static okWindowToOD(value: number): number { | ||
return 5 - (value - 150) / 10; | ||
} | ||
|
||
/** | ||
* Calculates the overall difficulty value of a meh (50) hit window. | ||
* | ||
* @param value The value of the hit window, in milliseconds. | ||
* @returns The overall difficulty value. | ||
*/ | ||
static mehWindowToOD(value: number): number { | ||
return 5 - (value - 250) / 10; | ||
} | ||
|
||
override get greatWindow(): number { | ||
return 75 + 5 * (5 - this.overallDifficulty); | ||
} | ||
|
||
override get okWindow(): number { | ||
return 150 + 10 * (5 - this.overallDifficulty); | ||
} | ||
|
||
override get mehWindow(): number { | ||
return 250 + 10 * (5 - this.overallDifficulty); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { HitWindow } from "./HitWindow"; | ||
|
||
/** | ||
* An empty `HitWindow` that does not have any hit windows. | ||
* | ||
* No time values are provided (meaning instantaneous hit or miss). | ||
*/ | ||
export class EmptyHitWindow extends HitWindow { | ||
constructor() { | ||
super(0); | ||
} | ||
|
||
override get greatWindow(): number { | ||
return 0; | ||
} | ||
|
||
override get okWindow(): number { | ||
return 0; | ||
} | ||
|
||
override get mehWindow(): number { | ||
return 0; | ||
} | ||
} |
Oops, something went wrong.