osu

package
v0.0.0-...-491ee29 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2024 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NONE = Grade(iota)
	D
	C
	B
	A
	S
	SH
	SS
	SSH
)
View Source
const (
	HpMu   = 6.0
	HpKatu = 10.0
	HpGeki = 14.0

	Hp50  = 0.4
	Hp100 = 2.2
	Hp300 = 6.0

	HpSliderTick   = 3.0
	HpSliderRepeat = 4.0

	HpSpinnerSpin  = 1.7
	HpSpinnerBonus = 2.0

	MaxHp = 200.0
)
View Source
const (
	Ignore     = HitResult(0)
	SliderMiss = HitResult(1 << iota)
	Miss
	Hit50
	Hit100
	Hit300
	SliderStart
	SliderPoint
	SliderRepeat
	LegacySliderEnd
	SliderEnd
	SliderFinish // For lazer health processor
	SpinnerSpin
	SpinnerPoints
	SpinnerBonus
	MuAddition
	KatuAddition
	GekiAddition
	PositionalMiss
	Additions   = MuAddition | KatuAddition | GekiAddition
	Hit50m      = Hit50 | MuAddition
	Hit100m     = Hit100 | MuAddition
	Hit300m     = Hit300 | MuAddition
	Hit100k     = Hit100 | KatuAddition
	Hit300k     = Hit300 | KatuAddition
	Hit300g     = Hit300 | GekiAddition
	BaseHits    = Hit50 | Hit100 | Hit300
	BaseHitsM   = BaseHits | Miss
	HitValues   = Hit50 | Hit100 | Hit300 | GekiAddition | KatuAddition
	SliderHits  = SliderStart | SliderPoint | SliderRepeat | LegacySliderEnd | SliderEnd
	SpinnerHits = SpinnerSpin | SpinnerPoints | SpinnerBonus
	RawHits     = SliderHits | SpinnerHits
)
View Source
const (
	Reset = ComboResult(iota)
	Hold
	Increase
)
View Source
const (
	Ignored = ClickAction(iota)
	Shake
	Click
)
View Source
const FrameTime = 1000.0 / 60
View Source
const Left = Buttons(1)
View Source
const Right = Buttons(2)
View Source
const Tolerance2B = 3

Variables

This section is empty.

Functions

This section is empty.

Types

type Buttons

type Buttons int64

type Circle

type Circle struct {
	// contains filtered or unexported fields
}

func (*Circle) GetFadeTime

func (circle *Circle) GetFadeTime() int64

func (*Circle) GetNumber

func (circle *Circle) GetNumber() int64

func (*Circle) GetObject

func (circle *Circle) GetObject() objects.IHitObject

func (*Circle) Init

func (circle *Circle) Init(ruleSet *OsuRuleSet, object objects.IHitObject, players []*difficultyPlayer)

func (*Circle) IsHit

func (circle *Circle) IsHit(player *difficultyPlayer) bool

func (*Circle) MissForcefully

func (circle *Circle) MissForcefully(player *difficultyPlayer, time int64)

func (*Circle) UpdateClickFor

func (circle *Circle) UpdateClickFor(player *difficultyPlayer, time int64) bool

func (*Circle) UpdateFor

func (circle *Circle) UpdateFor(_ *difficultyPlayer, _ int64, _ bool) bool

func (*Circle) UpdatePost

func (circle *Circle) UpdatePost(_ int64) bool

func (*Circle) UpdatePostFor

func (circle *Circle) UpdatePostFor(player *difficultyPlayer, time int64, _ bool) bool

type ClickAction

type ClickAction uint8

type ComboResult

type ComboResult uint8

type FailListener

type FailListener func()

type Grade

type Grade uint8

func (Grade) String

func (grade Grade) String() string

func (Grade) TextureName

func (grade Grade) TextureName() string

type HealthProcessor

type HealthProcessor struct {
	PassiveDrain         float64
	HpMultiplierNormal   float64
	HpMultiplierComboEnd float64
	// contains filtered or unexported fields
}

func NewHealthProcessor

func NewHealthProcessor(beatMap *beatmap.BeatMap, player *difficultyPlayer, lowerSpinnerDrain bool) *HealthProcessor

func (*HealthProcessor) AddFailListener

func (hp *HealthProcessor) AddFailListener(listener FailListener)

func (*HealthProcessor) AddResult

func (hp *HealthProcessor) AddResult(result JudgementResult)

func (*HealthProcessor) CalculateRate

func (hp *HealthProcessor) CalculateRate()

func (*HealthProcessor) GetDrainRate

func (hp *HealthProcessor) GetDrainRate() float64

func (*HealthProcessor) GetHealth

func (hp *HealthProcessor) GetHealth() float64

func (*HealthProcessor) Increase

func (hp *HealthProcessor) Increase(amount float64, fromHitObject bool)

func (*HealthProcessor) IncreaseRelative

func (hp *HealthProcessor) IncreaseRelative(amount float64, fromHitObject bool)

func (*HealthProcessor) ResetHp

func (hp *HealthProcessor) ResetHp()

func (*HealthProcessor) Update

func (hp *HealthProcessor) Update(time int64)

type HealthProcessorV2

type HealthProcessorV2 struct {
	// contains filtered or unexported fields
}

func NewHealthProcessorV2

func NewHealthProcessorV2(beatMap *beatmap.BeatMap, player *difficultyPlayer) *HealthProcessorV2

func (*HealthProcessorV2) AddFailListener

func (hp *HealthProcessorV2) AddFailListener(listener FailListener)

func (*HealthProcessorV2) AddResult

func (hp *HealthProcessorV2) AddResult(result JudgementResult)

func (*HealthProcessorV2) CalculateRate

func (hp *HealthProcessorV2) CalculateRate()

func (*HealthProcessorV2) GetDrainRate

func (hp *HealthProcessorV2) GetDrainRate() float64

func (*HealthProcessorV2) GetHealth

func (hp *HealthProcessorV2) GetHealth() float64

func (*HealthProcessorV2) Increase

func (hp *HealthProcessorV2) Increase(amount float64, fromHitObject bool)

func (*HealthProcessorV2) IncreaseRelative

func (hp *HealthProcessorV2) IncreaseRelative(amount float64, fromHitObject bool)

func (*HealthProcessorV2) ResetHp

func (hp *HealthProcessorV2) ResetHp()

func (*HealthProcessorV2) Update

func (hp *HealthProcessorV2) Update(time int64)

type HitObject

type HitObject interface {
	Init(ruleset *OsuRuleSet, object objects.IHitObject, players []*difficultyPlayer)
	UpdateFor(player *difficultyPlayer, time int64, processSliderEndsAhead bool) bool
	UpdateClickFor(player *difficultyPlayer, time int64) bool
	UpdatePostFor(player *difficultyPlayer, time int64, processSliderEndsAhead bool) bool
	UpdatePost(time int64) bool
	MissForcefully(player *difficultyPlayer, time int64)
	IsHit(player *difficultyPlayer) bool
	GetFadeTime() int64
	GetNumber() int64
	GetObject() objects.IHitObject
}

type HitResult

type HitResult int64

func (HitResult) AffectsAccLZ

func (r HitResult) AffectsAccLZ() bool

func (HitResult) AffectsAccV1

func (r HitResult) AffectsAccV1() bool

func (HitResult) IsBonus

func (r HitResult) IsBonus() bool

func (HitResult) ScoreValue

func (r HitResult) ScoreValue() int64

func (HitResult) ScoreValueLazer

func (r HitResult) ScoreValueLazer() int64

func (HitResult) ScoreValueMod

func (r HitResult) ScoreValueMod(mod difficulty.Modifier) int64

func (HitResult) ScoreValueV2

func (r HitResult) ScoreValueV2() int64

type IHealthProcessor

type IHealthProcessor interface {
	CalculateRate()

	ResetHp()

	AddResult(result JudgementResult)

	Increase(amount float64, fromHitObject bool)

	IncreaseRelative(amount float64, fromHitObject bool)

	Update(time int64)

	AddFailListener(listener FailListener)

	GetHealth() float64

	GetDrainRate() float64
}

type JudgementResult

type JudgementResult struct {
	HitResult HitResult
	MaxResult HitResult

	ComboResult ComboResult

	Time     int64
	Position vector.Vector2f

	Number int64
	// contains filtered or unexported fields
}

type OsuRuleSet

type OsuRuleSet struct {
	// contains filtered or unexported fields
}

func NewOsuRuleset

func NewOsuRuleset(beatMap *beatmap.BeatMap, cursors []*graphics.Cursor, diffs []*difficulty.Difficulty) *OsuRuleSet

func (*OsuRuleSet) CanBeHit

func (set *OsuRuleSet) CanBeHit(time int64, object HitObject, player *difficultyPlayer) ClickAction

func (*OsuRuleSet) CanBeHitLazer

func (set *OsuRuleSet) CanBeHitLazer(time int64, object HitObject, player *difficultyPlayer) ClickAction

func (*OsuRuleSet) CanBeHitStable

func (set *OsuRuleSet) CanBeHitStable(time int64, object HitObject, player *difficultyPlayer) ClickAction

func (*OsuRuleSet) GetBeatMap

func (set *OsuRuleSet) GetBeatMap() *beatmap.BeatMap

func (*OsuRuleSet) GetHP

func (set *OsuRuleSet) GetHP(cursor *graphics.Cursor) float64

func (*OsuRuleSet) GetPlayer

func (set *OsuRuleSet) GetPlayer(cursor *graphics.Cursor) *difficultyPlayer

func (*OsuRuleSet) GetPlayerDifficulty

func (set *OsuRuleSet) GetPlayerDifficulty(cursor *graphics.Cursor) *difficulty.Difficulty

func (*OsuRuleSet) GetProcessed

func (set *OsuRuleSet) GetProcessed() []HitObject

func (*OsuRuleSet) GetResultForDelta

func (set *OsuRuleSet) GetResultForDelta(player *difficultyPlayer, delta float64) HitResult

func (*OsuRuleSet) GetScore

func (set *OsuRuleSet) GetScore(cursor *graphics.Cursor) Score

func (*OsuRuleSet) PlayerStopped

func (set *OsuRuleSet) PlayerStopped(cursor *graphics.Cursor, time int64)

func (*OsuRuleSet) PostHit

func (set *OsuRuleSet) PostHit(time int64, object HitObject, player *difficultyPlayer)

func (*OsuRuleSet) SendResult

func (set *OsuRuleSet) SendResult(cursor *graphics.Cursor, judgementResult JudgementResult)

func (*OsuRuleSet) SetEndListener

func (set *OsuRuleSet) SetEndListener(listener endListener)

func (*OsuRuleSet) SetFailListener

func (set *OsuRuleSet) SetFailListener(listener failListener)

func (*OsuRuleSet) SetListener

func (set *OsuRuleSet) SetListener(listener hitListener)

func (*OsuRuleSet) Update

func (set *OsuRuleSet) Update(time int64)

func (*OsuRuleSet) UpdateClickFor

func (set *OsuRuleSet) UpdateClickFor(cursor *graphics.Cursor, time int64)

func (*OsuRuleSet) UpdateNormalFor

func (set *OsuRuleSet) UpdateNormalFor(cursor *graphics.Cursor, time int64, processSliderEndsAhead bool)

func (*OsuRuleSet) UpdatePostFor

func (set *OsuRuleSet) UpdatePostFor(cursor *graphics.Cursor, time int64, processSliderEndsAhead bool)

type Score

type Score struct {
	Score        int64
	Accuracy     float64
	Grade        Grade
	Combo        uint
	PerfectCombo bool
	Count300     uint
	CountGeki    uint
	Count100     uint
	CountKatu    uint
	Count50      uint
	CountMiss    uint
	CountSB      uint
	MaxTicks     uint
	SliderEnd    uint
	MaxSliderEnd uint
	PP           api.PPv2Results
	// contains filtered or unexported fields
}

func (*Score) AddResult

func (s *Score) AddResult(result JudgementResult)

func (*Score) CalculateGrade

func (s *Score) CalculateGrade(mods difficulty.Modifier)

func (*Score) ToPerfScore

func (s *Score) ToPerfScore() api.PerfScore

type Slider

type Slider struct {
	// contains filtered or unexported fields
}

func (*Slider) GetFadeTime

func (slider *Slider) GetFadeTime() int64

func (*Slider) GetNumber

func (slider *Slider) GetNumber() int64

func (*Slider) GetObject

func (slider *Slider) GetObject() objects.IHitObject

func (*Slider) GetStartResult

func (slider *Slider) GetStartResult(pl *difficultyPlayer) HitResult

func (*Slider) Init

func (slider *Slider) Init(ruleSet *OsuRuleSet, object objects.IHitObject, players []*difficultyPlayer)

func (*Slider) IsHit

func (slider *Slider) IsHit(pl *difficultyPlayer) bool

func (*Slider) IsSliding

func (slider *Slider) IsSliding(player *difficultyPlayer) bool

func (*Slider) IsStartHit

func (slider *Slider) IsStartHit(pl *difficultyPlayer) bool

func (*Slider) MissForcefully

func (slider *Slider) MissForcefully(player *difficultyPlayer, time int64)

func (*Slider) UpdateClickFor

func (slider *Slider) UpdateClickFor(player *difficultyPlayer, time int64) bool

func (*Slider) UpdateFor

func (slider *Slider) UpdateFor(player *difficultyPlayer, time int64, processSliderEndsAhead bool) bool

func (*Slider) UpdatePost

func (slider *Slider) UpdatePost(_ int64) bool

func (*Slider) UpdatePostFor

func (slider *Slider) UpdatePostFor(player *difficultyPlayer, time int64, processSliderEndsAhead bool) bool

type Spinner

type Spinner struct {
	// contains filtered or unexported fields
}

func (*Spinner) GetFadeTime

func (spinner *Spinner) GetFadeTime() int64

func (*Spinner) GetNumber

func (spinner *Spinner) GetNumber() int64

func (*Spinner) GetObject

func (spinner *Spinner) GetObject() objects.IHitObject

func (*Spinner) Init

func (spinner *Spinner) Init(ruleSet *OsuRuleSet, object objects.IHitObject, players []*difficultyPlayer)

func (*Spinner) IsHit

func (spinner *Spinner) IsHit(pl *difficultyPlayer) bool

func (*Spinner) MissForcefully

func (spinner *Spinner) MissForcefully(_ *difficultyPlayer, _ int64)

func (*Spinner) UpdateClickFor

func (spinner *Spinner) UpdateClickFor(*difficultyPlayer, int64) bool

func (*Spinner) UpdateFor

func (spinner *Spinner) UpdateFor(player *difficultyPlayer, time int64, _ bool) bool

func (*Spinner) UpdatePost

func (spinner *Spinner) UpdatePost(_ int64) bool

func (*Spinner) UpdatePostFor

func (spinner *Spinner) UpdatePostFor(player *difficultyPlayer, time int64, _ bool) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL