UNPKG

osu-catch-stable

Version:

osu!stable version of osu!catch ruleset based on osu!lazer source code.

423 lines (358 loc) 12.9 kB
import { HitObject, IHasComboInformation, IHasX, ControlPointInfo, BeatmapDifficultySection, ISpinnableObject, ISlidableObject, SliderPath, HitSample, EventGenerator, ModCombination, IMod, RulesetBeatmap, BeatmapConverter, IBeatmap, BeatmapProcessor, DifficultyAttributes, Autoplay, Cinema, DoubleTime, Easy, Flashlight, HalfTime, HardRock, Hidden, Nightcore, NoFail, NoMod, Perfect, Relax, SuddenDeath, PerformanceAttributes, DifficultyHitObject, IHitObject, StrainDecaySkill, DifficultyCalculator, Skill, PerformanceCalculator, IRuleset, IScoreInfo, ReplayFrame, IConvertibleReplayFrame, LegacyReplayFrame, ReplayConverter, IReplayFrame, Ruleset } from 'osu-classes'; /** * An osu!catch hit object. */ declare abstract class CatchHitObject extends HitObject implements IHasComboInformation, IHasX { /** * The radius of hit objects. */ static OBJECT_RADIUS: number; currentComboIndex: number; comboIndex: number; comboIndexWithOffsets: number; comboOffset: number; lastInCombo: boolean; isNewCombo: boolean; timePreempt: number; scale: number; /** * X-offset of the hit object. */ offsetX: number; private _originalX; /** * The starting X-position of the hit object. */ get startX(): number; set startX(value: number); /** * The ending X-position of the hit object. */ get endX(): number; /** * Original start X-position of the hit object before any changes. */ get originalX(): number; /** * Start X-position with applied offset. */ get effectiveX(): number; get randomSeed(): number; applyDefaultsToSelf(controlPoints: ControlPointInfo, difficulty: BeatmapDifficultySection): void; clone(): this; } declare abstract class PalpableHitObject extends CatchHitObject { hyperDashTarget: CatchHitObject | null; distanceToHyperDash: number; get hasHyperDash(): boolean; clone(): this; } declare class Banana extends PalpableHitObject { /** * The index of the current banana in the shower. */ index: number; clone(): this; } declare class BananaShower extends CatchHitObject implements ISpinnableObject { /** * The time at which this hit object ends. */ endTime: number; get duration(): number; set duration(value: number); createNestedHitObjects(): void; clone(): this; } declare class JuiceStream extends CatchHitObject implements ISlidableObject { static BASE_DISTANCE: number; tickDistance: number; velocity: number; legacyLastTickOffset?: number; path: SliderPath; nodeSamples: HitSample[][]; repeats: number; get distance(): number; set distance(value: number); get spans(): number; get spanDuration(): number; get duration(): number; set duration(value: number); get endTime(): number; get endX(): number; applyDefaultsToSelf(controlPoints: ControlPointInfo, difficulty: BeatmapDifficultySection): void; createNestedHitObjects(): void; clone(): this; } declare class CatchEventGenerator extends EventGenerator { static generateDroplets(stream: JuiceStream): Generator<CatchHitObject>; static generateBananas(shower: BananaShower): Generator<CatchHitObject>; } declare class Fruit extends PalpableHitObject { } declare class JuiceDroplet extends PalpableHitObject { } declare class JuiceTinyDroplet extends JuiceDroplet { } declare class JuiceFruit extends Fruit { } declare class CatchModCombination extends ModCombination { get mode(): number; protected get _availableMods(): IMod[]; } declare class CatchBeatmap extends RulesetBeatmap { mods: CatchModCombination; hitObjects: CatchHitObject[]; get mode(): number; get maxCombo(): number; get fruits(): Fruit[]; get juiceStreams(): JuiceStream[]; get bananaShowers(): BananaShower[]; } declare class CatchBeatmapConverter extends BeatmapConverter { canConvert(beatmap: IBeatmap): boolean; convertHitObjects(beatmap: IBeatmap): Generator<CatchHitObject>; private _convertHitObject; private _convertSlidableObject; private _convertSpinnableObject; private _convertHittableObject; private _copyBaseProperties; createBeatmap(): CatchBeatmap; } declare class CatchBeatmapProcessor extends BeatmapProcessor { static RNG_SEED: number; static BASE_SPEED: number; private _lastX; private _lastStartTime; private _rng; postProcess(beatmap: CatchBeatmap): CatchBeatmap; private _applyXOffsets; private _applyHardRockOffset; /** * Applies a random offset in a random direction to a position, ensuring * that the final position remains within the boundary of the playfield. * @param position The position which the offset should be applied to. * @param maxOffset The maximum offset, cannot exceed 20px. * @param rng The random number generator. */ private _applyRandomOffset; /** * Applies an offset to a position, ensuring that the * final position remains within the boundary of the playfield. * @param position The position which the offset should be applied to. * @param amount The amount to offset by. */ private _applyOffset; private _initialiseHyperDash; } declare class CatchDifficultyAttributes extends DifficultyAttributes { /** * The perceived approach rate inclusive of rate-adjusting mods (DT/HT/etc). * Rate-adjusting mods don't directly affect the approach rate difficulty value, * but have a perceived effect as a result of adjusting audio timing. */ approachRate: number; } declare class CatchAutoplay extends Autoplay { } declare class CatchCinema extends Cinema { } declare class CatchDoubleTime extends DoubleTime { multiplier: number; } declare class CatchEasy extends Easy { } declare class CatchFlashlight extends Flashlight { } declare class CatchHalfTime extends HalfTime { } declare class CatchHardRock extends HardRock { multiplier: number; } declare class CatchHidden extends Hidden { } declare class CatchNightcore extends Nightcore { } declare class CatchNoFail extends NoFail { } declare class CatchNoMod extends NoMod { } declare class CatchPerfect extends Perfect { } declare class CatchRelax extends Relax { } declare class CatchSuddenDeath extends SuddenDeath { } /** * Describes the performance of a score, as output by a performance calculator. */ declare class CatchPerformanceAttributes extends PerformanceAttributes { /** * The mods which were applied to the beatmap. */ mods: CatchModCombination; /** * Creates new difficulty attributes. * @param mods The mods which were applied to the beatmap. * @param totalPerformance The total performance of a score. */ constructor(mods: CatchModCombination, totalPerformance: number); } declare class CatchDifficultyHitObject extends DifficultyHitObject { private static _NORMALIZED_HITOBJECT_RADIUS; /** * The hit object wrapped by this difficulty hit object. */ baseObject: PalpableHitObject; /** * The last hit object which occurs before base object. */ lastObject: PalpableHitObject; readonly normalizedPosition: number; readonly lastNormalizedPosition: number; /** * Milliseconds elapsed since the start time * of the previous difficulty hit object, with a minimum of 40ms. */ readonly strainTime: number; constructor(hitObject: IHitObject, lastObject: IHitObject, clockRate: number, halfCatcherWidth: number, objects: DifficultyHitObject[], index: number); } declare class Movement extends StrainDecaySkill { private static _ABSOLUTE_PLAYER_POSITIONING_ERROR; private static _NORMALIZED_HITOBJECT_RADIUS; private static _DIRECTION_CHANGE_BONUS; protected _skillMultiplier: number; protected _strainDecayBase: number; protected _decayWeight: number; protected _sectionLength: number; protected readonly _halfCatcherWidth: number; private _lastPlayerPosition?; private _lastDistanceMoved; private _lastStrainTime; /** * The speed multiplier applied to the player's catcher. */ private readonly _catcherSpeedMultiplier; constructor(mods: ModCombination, halfCatcherWidth: number, clockRate: number); protected _strainValueOf(current: DifficultyHitObject): number; } declare class CatchDifficultyCalculator extends DifficultyCalculator<CatchDifficultyAttributes> { private static _STAR_SCALING_FACTOR; private _halfCatcherWidth; protected _createDifficultyAttributes(beatmap: IBeatmap, mods: CatchModCombination, skills: Skill[], clockRate: number): CatchDifficultyAttributes; protected _createDifficultyHitObjects(beatmap: IBeatmap, clockRate: number): CatchDifficultyHitObject[]; protected _createSkills(beatmap: IBeatmap, mods: ModCombination, clockRate: number): Skill[]; get difficultyMods(): IMod[]; } declare class CatchPerformanceCalculator extends PerformanceCalculator { attributes: CatchDifficultyAttributes; private _scoreMaxCombo; private _mods; private _fruitsHit; private _ticksHit; private _tinyTicksHit; private _tinyTicksMissed; private _misses; constructor(ruleset: IRuleset, attributes?: DifficultyAttributes, score?: IScoreInfo); calculateAttributes(attributes?: DifficultyAttributes, score?: IScoreInfo): CatchPerformanceAttributes; private _addParams; private get _accuracy(); private get _totalHits(); private get _totalSuccessfulHits(); private get _totalComboHits(); } declare enum CatchAction { /** * Move left. */ MoveLeft = 0, /** * Move right. */ MoveRight = 1, /** * Engage dash. */ Dash = 2, } declare class CatchReplayFrame extends ReplayFrame implements IConvertibleReplayFrame { /** * Player position of this replay frame. */ position: number; /** * Whether the player is in dashing state or not. */ isDashing: boolean; /** * Button actions of this replay frame. */ actions: Set<CatchAction>; fromLegacy(currentFrame: LegacyReplayFrame, lastFrame: CatchReplayFrame | null): this; toLegacy(): LegacyReplayFrame; } /** * osu!catch replay converter. */ declare class CatchReplayConverter extends ReplayConverter { protected _createConvertibleReplayFrame(): CatchReplayFrame; protected _isConvertedReplayFrame(frame: IReplayFrame): boolean; } /** * osu!catch ruleset. */ declare class CatchRuleset extends Ruleset { /** * osu!catch ruleset ID. */ get id(): number; /** * Applies osu!catch ruleset to a beatmap. * @param beatmap The beatmap. * @returns A new osu!catch beatmap with applied ruleset. */ applyToBeatmap(beatmap: IBeatmap): CatchBeatmap; /** * Applies osu!catch ruleset and mods to a beatmap. * @param beatmap The beatmap. * @param mods osu!catch mod combination. * @returns A new osu!catch beatmap with applied mods. */ applyToBeatmapWithMods(beatmap: IBeatmap, mods?: CatchModCombination): CatchBeatmap; /** * Resets a mod combination from a beatmap. * @param beatmap The beatmap. * @returns A new beatmap with no mods. */ resetMods(beatmap: IBeatmap): CatchBeatmap; /** * Creates a new mod combination by converting legacy mod bitwise. * @param input Mod bitwise or acronyms. * @returns A new mod combination. */ createModCombination(input?: number | string): CatchModCombination; /** * @returns A new osu!catch beatmap processor. */ protected _createBeatmapProcessor(): CatchBeatmapProcessor; /** * @returns A new osu!catch beatmap converter. */ protected _createBeatmapConverter(): CatchBeatmapConverter; /** * @returns A new osu!catch replay converter. */ protected _createReplayConverter(): CatchReplayConverter; /** * @param beatmap The beatmap for which the calculation will be done. * @returns A new osu!catch difficulty calculator. */ createDifficultyCalculator(beatmap: IBeatmap): CatchDifficultyCalculator; /** * @param attributes The difficulty attributes. * @param score Score information. * @returns A new osu!catch performance calculator. */ createPerformanceCalculator(attributes?: CatchDifficultyAttributes, score?: IScoreInfo): CatchPerformanceCalculator; } export { Banana, BananaShower, CatchAction, CatchAutoplay, CatchBeatmap, CatchBeatmapConverter, CatchBeatmapProcessor, CatchCinema, CatchDifficultyAttributes, CatchDifficultyCalculator, CatchDifficultyHitObject, CatchDoubleTime, CatchEasy, CatchEventGenerator, CatchFlashlight, CatchHalfTime, CatchHardRock, CatchHidden, CatchHitObject, CatchModCombination, CatchNightcore, CatchNoFail, CatchNoMod, CatchPerfect, CatchPerformanceAttributes, CatchPerformanceCalculator, CatchRelax, CatchReplayConverter, CatchReplayFrame, CatchRuleset, CatchSuddenDeath, Fruit, JuiceDroplet, JuiceFruit, JuiceStream, JuiceTinyDroplet, Movement, PalpableHitObject };