difficulty

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: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HitFadeIn      = 400.0
	HitFadeOut     = 240.0
	HittableRange  = 400.0
	ResultFadeIn   = 120.0
	ResultFadeOut  = 600.0
	PostEmpt       = 500.0
	LzSpinBonusGap = 2
)
View Source
const (
	None   = Modifier(iota)
	NoFail = Modifier(1 << (iota - uint(1)))
	Easy
	TouchDevice
	Hidden
	HardRock
	SuddenDeath
	DoubleTime
	Relax
	HalfTime
	Nightcore // Only set along with DoubleTime. i.e: NC only gives 576
	Flashlight
	Autoplay
	SpunOut
	Relax2  // Autopilot
	Perfect // Only set along with SuddenDeath. i.e: PF only gives 16416
	Key4
	Key5
	Key6
	Key7
	Key8
	FadeIn
	Random
	Cinema
	Target
	Key9
	KeyCoop
	Key1
	Key3
	Key2
	ScoreV2
	LastMod
	Daycore
	Lazer
	Classic
	DifficultyAdjust

	// DifficultyAdjustMask is outdated, use GetDiffMaskedMods instead
	DifficultyAdjustMask = HardRock | Easy | DoubleTime | Nightcore | HalfTime | Daycore | Flashlight | Relax
)

Variables

This section is empty.

Functions

func DiffFromRate

func DiffFromRate(rate, min, mid, max float64) float64

func DifficultyRate

func DifficultyRate(diff, min, mid, max float64) float64

func GetModConfig

func GetModConfig[T any](diff *Difficulty) (T, bool)

func SetModConfig

func SetModConfig[T any](diff *Difficulty, config T)

Types

type ClassicSettings

type ClassicSettings struct {
	NoSliderHeadAccuracy bool `json:"no_slider_head_accuracy"`
	ClassicNoteLock      bool `json:"classic_note_lock"`
	AlwaysPlayTailSample bool `json:"always_play_tail_sample"`
	FadeHitCircleEarly   bool `json:"fade_hit_circle_early"`
	ClassicHealth        bool `json:"classic_health"`
}

func NewClassicSettings

func NewClassicSettings() ClassicSettings

type DiffAdjustSettings

type DiffAdjustSettings struct {
	ApproachRate      float64 `json:"approach_rate"`
	CircleSize        float64 `json:"circle_size"`
	DrainRate         float64 `json:"drain_rate"`
	OverallDifficulty float64 `json:"overall_difficulty"`
	ExtendedValues    bool    `json:"-"`
}

func NewDiffAdjustSettings

func NewDiffAdjustSettings(ar, cs, hp, od float64) DiffAdjustSettings

type Difficulty

type Difficulty struct {
	PreemptU      float64
	Preempt       float64
	TimeFadeIn    float64
	CircleRadiusU float64
	CircleRadius  float64
	Mods          Modifier

	Hit50U  float64
	Hit100U float64
	Hit300U float64

	Hit50  int64
	Hit100 int64
	Hit300 int64

	HPMod           float64
	SpinnerRatio    float64
	LzSpinnerMinRPS float64
	LzSpinnerMaxRPS float64
	Speed           float64

	ARReal float64
	ODReal float64

	BaseModSpeed float64
	// contains filtered or unexported fields
}

func NewDifficulty

func NewDifficulty(hp, cs, od, ar float64) *Difficulty

func (*Difficulty) AddMod

func (diff *Difficulty) AddMod(mods Modifier)

func (*Difficulty) AdjustsPitch

func (diff *Difficulty) AdjustsPitch() bool

func (*Difficulty) CheckModActive

func (diff *Difficulty) CheckModActive(mods Modifier) bool

func (*Difficulty) Clone

func (diff *Difficulty) Clone() *Difficulty

func (*Difficulty) Equals

func (diff *Difficulty) Equals(diff2 *Difficulty) bool

func (*Difficulty) ExportMods2

func (diff *Difficulty) ExportMods2() (mods []rplpa.ModInfo)

func (*Difficulty) GetAR

func (diff *Difficulty) GetAR() float64

func (*Difficulty) GetBaseAR

func (diff *Difficulty) GetBaseAR() float64

func (*Difficulty) GetBaseCS

func (diff *Difficulty) GetBaseCS() float64

func (*Difficulty) GetBaseHP

func (diff *Difficulty) GetBaseHP() float64

func (*Difficulty) GetBaseOD

func (diff *Difficulty) GetBaseOD() float64

func (*Difficulty) GetCS

func (diff *Difficulty) GetCS() float64

func (*Difficulty) GetHP

func (diff *Difficulty) GetHP() float64

func (*Difficulty) GetModString

func (diff *Difficulty) GetModString() string

func (*Difficulty) GetModStringFull

func (diff *Difficulty) GetModStringFull() []string

func (*Difficulty) GetModStringMasked

func (diff *Difficulty) GetModStringMasked() string

func (*Difficulty) GetModifiedTime

func (diff *Difficulty) GetModifiedTime(time float64) float64

func (*Difficulty) GetOD

func (diff *Difficulty) GetOD() float64

func (*Difficulty) GetPitch

func (diff *Difficulty) GetPitch() float64

func (*Difficulty) GetScoreMultiplier

func (diff *Difficulty) GetScoreMultiplier() float64

func (*Difficulty) GetSpeed

func (diff *Difficulty) GetSpeed() float64

func (*Difficulty) RemoveMod

func (diff *Difficulty) RemoveMod(mods Modifier)

func (*Difficulty) SetAR

func (diff *Difficulty) SetAR(ar float64)

func (*Difficulty) SetARCustom

func (diff *Difficulty) SetARCustom(ar float64)

func (*Difficulty) SetCS

func (diff *Difficulty) SetCS(cs float64)

func (*Difficulty) SetCSCustom

func (diff *Difficulty) SetCSCustom(cs float64)

func (*Difficulty) SetHP

func (diff *Difficulty) SetHP(hp float64)

func (*Difficulty) SetHPCustom

func (diff *Difficulty) SetHPCustom(hp float64)

func (*Difficulty) SetMods

func (diff *Difficulty) SetMods(mods Modifier)

func (*Difficulty) SetMods2

func (diff *Difficulty) SetMods2(mods []rplpa.ModInfo)

func (*Difficulty) SetOD

func (diff *Difficulty) SetOD(od float64)

func (*Difficulty) SetODCustom

func (diff *Difficulty) SetODCustom(od float64)

type EasySettings

type EasySettings struct {
	Retries int `json:"retries"`
}

func NewEasySettings

func NewEasySettings() EasySettings

type FlashlightSettings

type FlashlightSettings struct {
	FollowDelay    float64 `json:"follow_delay"`
	SizeMultiplier float64 `json:"size_multiplier"`
	ComboBasedSize bool    `json:"combo_based_size"`
}

func NewFlashlightSettings

func NewFlashlightSettings() FlashlightSettings

type Modifier

type Modifier int64

func GetDiffMaskedMods

func GetDiffMaskedMods(mods Modifier) Modifier

GetDiffMaskedMods should be used instead of DifficultyAdjustMask. In 220930 deployment, HDFL is a separate mod difficulty wise

func ParseFromAcronym

func ParseFromAcronym(mod string) (m Modifier)

func ParseMods

func ParseMods(mods string) (m Modifier)

func (Modifier) Active

func (mods Modifier) Active(mod Modifier) bool

func (Modifier) Compatible

func (mods Modifier) Compatible() bool

func (Modifier) ConvertToModInfoList

func (mods Modifier) ConvertToModInfoList() (mi []rplpa.ModInfo)

func (Modifier) GetScoreMultiplier

func (mods Modifier) GetScoreMultiplier() float64

func (Modifier) String

func (mods Modifier) String() (s string)

func (Modifier) StringFull

func (mods Modifier) StringFull() (s []string)

func (Modifier) StringFull2

func (mods Modifier) StringFull2() (s []string)

type SpeedSettings

type SpeedSettings struct {
	SpeedChange float64 `json:"speed_change"`
	AdjustPitch bool    `json:"adjust_pitch"`
}

func NewSpeedSettings

func NewSpeedSettings(rate float64, adjustPitch bool) SpeedSettings

Jump to

Keyboard shortcuts

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