Static variables

staticSONG:SwagSong

SONG METADATA

@:value(0)staticcampaignScore:Int = 0

Score for the current week.

@:value(false)staticcoopMode:Bool = false

// * Whenever the song has been started with co-op mode on.

@:value(6)staticdaPixelZoom:Float = 6

Zoom for the pixel assets.

@:value("normal")staticdifficulty:String = "normal"

The selected difficulty name

@:value(false)staticfromMods:Bool = false

Whenever the week is coming from the mods folder or not.

@:value(null)staticinstance:PlayState = null

Current PlayState instance.

@:value(false)staticisStoryMode:Bool = false

Whenever the song is being played in Story Mode.

@:value(false)staticopponentMode:Bool = false

Whenever the song has been started with opponent mode on.

@:value([])staticstoryPlaylist:Array<String> = []

The remaining songs in the Story Mode playlist.

@:value(null)staticstoryWeek:WeekData = null

The week data of the current week

Constructor

new(?scriptsAllowed:Bool, ?scriptName:String)

Variables

@:value(new FlxTextFormat(0xFF888888, false, false, 0))accFormat:FlxTextFormat = new FlxTextFormat(0xFF888888, false, false, 0)

Format for the accuracy rating.

accuracy:Float

The player's accuracy (shortcut to accuracyPressedNotes / totalAccuracyAmount).

@:value(0)accuracyPressedNotes:Float = 0

The number of pressed notes.

accuracyTxt:FunkinText

FunkinText that shows your accuracy.

boyfriend:Character

Boyfriend character

camFollow:FlxObject

Object defining the camera follow target.

camGame:FlxCamera

Camera for the game (stages, characters)

camHUD:HudCamera

Camera for the HUD (notes, misses).

@:value(false)camZooming:Bool = false

Whenever cam zooming is enabled, enables on a note hit if not cancelled.

@:value(4)camZoomingInterval:Int = 4

Interval of cam zooming (beats). For example: if set to 4, the camera will zoom every 4 beats.

@:value(1)camZoomingStrength:Float = 1

How strong the cam zooms should be (defaults to 1)

@:value(true)canAccessDebugMenus:Bool = true

Whenever the player can press 7, 8 or 9 to access the debug menus.

@:value(opponentMode && !coopMode)canDadDie:Bool = opponentMode && !coopMode

Whenever the opponent can die.

@:value(!opponentMode && !coopMode)canDie:Bool = !opponentMode && !coopMode

Whenever the player can die.

@:value(true)canPause:Bool = true

Whenever the game can be paused or not.

@:value(0)combo:Int = 0

Current combo.

@:value(!Options.ghostTapping)comboBreaks:Bool = !Options.ghostTapping

Whenever the misses should show "Combo Breaks" instead of "Misses"

comboGroup:FlxSpriteGroup

Group containing all of the combo sprites.

@:value([new ComboRating(0, "F", 0xFFFF4444), new ComboRating(0.5, "E", 0xFFFF8844), new ComboRating(0.7, "D", 0xFFFFAA44), new ComboRating(0.8, "C", 0xFFFFFF44), new ComboRating(0.85, "B", 0xFFAAFF44), new ComboRating(0.9, "A", 0xFF88FF44), new ComboRating(0.95, "S", 0xFF44FFFF), new ComboRating(1, "S++", 0xFF44FFFF)])comboRatings:Array<ComboRating> = [new ComboRating(0, "F", 0xFFFF4444), new ComboRating(0.5, "E", 0xFFFF8844), new ComboRating(0.7, "D", 0xFFFFAA44), new ComboRating(0.8, "C", 0xFFFFFF44), new ComboRating(0.85, "B", 0xFFAAFF44), new ComboRating(0.9, "A", 0xFF88FF44), new ComboRating(0.95, "S", 0xFF44FFFF), new ComboRating(1, "S++", 0xFF44FFFF)]

All combo ratings.

cpu:StrumLine

Shortcut to cpuStrums.

cpuStrums:StrumLine

CPU strums.

curRating:ComboRating

Last rating (may be null)

read onlycurSection:SwagSection

Current section (can be null when using YoshiCrafter Engine charts).

@:value("")curSong:String = ""

Current song name (lowercase)

@:value("")curStage:String = ""

Current stage name

@:value(null)cutscene:String = null

Cutscene script path.

dad:Character

Dad character

@:value(1.05)defaultCamZoom:Float = 1.05

Camera zoom at which the game lerps to.

@:value("")detailsPausedText:String = ""

@:value("")detailsText:String = ""

downscroll:Bool

Whenever the game is in downscroll or not. (Can be set)

@:value(null)endCutscene:String = null

End cutscene script path.

@:value(false)endingSong:Bool = false

Whenever the song is ending or not.

@:value("gameOver")gameOverSong:String = "gameOver"

Game Over Song. (assets/music/gameOver.ogg)

@:value(false)generatedMusic:Bool = false

Whenever the music has been generated.

gf:Character

Girlfriend character

@:value(1)gfSpeed:Int = 1

Interval at which Girlfriend dances.

@:value(Options.ghostTapping)ghostTapping:Bool = Options.ghostTapping

Whenever Ghost Tapping is enabled.

@:value(1)health:Float = 1

Current health. Goes from 0 to maxHealth (defaults to 2)

healthBar:FlxBar

Health bar.

healthBarBG:FlxSprite

Health bar background.

@:value(Options.hitWindow)hitWindow:Float = Options.hitWindow

Hit window, in milliseconds. Defaults to 250ms unless changed in options. Base game hit window is 175ms.

iconP1:HealthIcon

Player's icon

iconP2:HealthIcon

Opponent's icon

@:value(false)inCutscene:Bool = false

Whenever the game is currently in a cutscene or not.

inst:FlxSound

Instrumental sound (Inst.ogg).

@:value(5)introLength:Int = 5

Length of the intro countdown.

@:value(["intro3", "intro2", "intro1", "introGo"])introSounds:Array<String> = ["intro3", "intro2", "intro1", "introGo"]

Array of sounds for the intro.

@:value([null, "game/ready", "game/set", "game/go"])introSprites:Array<String> = [null, "game/ready", "game/set", "game/go"]

Array of sprites for the intro.

@:value("gameOverSFX")lossSFX:String = "gameOverSFX"

Game Over Song. (assets/sounds/gameOverSFX.ogg)

@:value(1.35)maxCamZoom:Float = 1.35

Maximum amount of zoom for the camera.

@:value(2)@:isVarmaxHealth:Float = 2

Maximum health the player can have. Defaults to 2.

@:value(0)misses:Int = 0

The player's amount of misses.

missesTxt:FunkinText

FunkinText that shows your amount of misses.

@:value(true)muteVocalsOnMiss:Bool = true

Whenever the vocals should be muted when a note is missed.

@:value([null])noteTypesArray:Array<String> = [null]

Array containing all of the note types names.

notes:NoteGroup

Group of all of the notes. Using forEach on this group will only loop through the first notes.

@:value(false)paused:Bool = false

Whenever the game is paused or not.

@:value(isStoryMode)playCutscenes:Bool = isStoryMode

Whenever the game should play the cutscenes. Defaults to whenever the game is currently in Story Mode or not.

player:StrumLine

Shortcut to playerStrums.

playerStrums:StrumLine

Player strums.

@:value([])players:Array<StrumLine> = []

Array of all the players in the stage.

@:value(0)ratingNum:Int = 0

Number of ratings.

@:value("gameOverEnd")retrySFX:String = "gameOverEnd"

Game Over End SFX, used when retrying. (assets/sounds/gameOverEnd.ogg)

scoreTxt:FunkinText

FunkinText that shows your score.

scripts:ScriptPack

Script Pack of all the scripts being ran.

@:value(0)scrollSpeed:Float = 0

Current scroll speed for all strums. To set a scroll speed for a specific strum, use strum.scrollSpeed.

@:value(0)songScore:Int = 0

The player's current score.

splashHandler:SplashHandler

Note splashes container

stage:Stage

Current Stage.

startTimer:FlxTimer

Timer for the start countdown

@:value(false)startedCountdown:Bool = false

Whenever the countdown has started or not.

@:value(false)startingSong:Bool = false

Whenever the song is currently being started.

strumLine:FlxObject

Strum line position

strumLineNotes:FlxTypedGroup<Strum>

All of the strum line notes.

@:value(0)totalAccuracyAmount:Float = 0

The total accuracy amount.

vocals:FlxSound

Vocals sound (Vocals.ogg).

Methods

@:value({ addAsDefaultIfUnknown : false })addNoteType(name:String, addAsDefaultIfUnknown:Bool = false):Int

countdown(swagCounter:Int):Void

Creates a fake countdown.

deleteNote(note:Note):Void

Deletes a note.

Parameters:

note

Note to delete

endSong():Void

Ends the song.

gameOver(?character:Character, ?deathCharID:String, ?gameOverSong:String, ?lossSFX:String, ?retrySFX:String):Void

Forces a game over.

Parameters:

character

Character which died. Default to boyfriend.

deathCharID

Character ID (name) for game over. Default to whatever is specified in the character's XML.

gameOverSong

Song for the game over screen. Default to this.gameOverSong (gameOver)

lossSFX

SFX at the beginning of the game over (Mic drop). Default to this.lossSFX (gameOverSFX)

retrySFX

SFX played whenever the player retries. Defaults to retrySFX (gameOverEnd)

generateNotes(songData:SwagSong):Void

inlinegetIconRPC():String

Returns the Discord RPC icon.

goodNoteHit(note:Note):Void

Hits a note

Parameters:

note

Note to hit.

nextSong():Void

Immediately switches to the next song, or goes back to the Story/Freeplay menu.

noteMiss(note:Note, ?direction:Int, ?player:Int):Void

Misses a note

Parameters:

note

Note to miss.

direction

Specify a custom direction in case note is null.

player

Specify a custom player in case note is null.

pauseGame():Void

Pauses the game.

@:value({ prefix : "" })startCutscene(prefix:String = "", ?cutsceneScriptPath:String, ?callback:() ‑> Void):Void

Starts a cutscene.

Parameters:

prefix

Custom prefix. Using midsong- will require you to for example rename your video cutscene to songs/song/midsong-cutscene.mp4 instead of songs/song/cutscene.mp4

cutsceneScriptPath

Optional: Custom script path.

callback

Callback called after the cutscene ended. If equals to null, startCountdown will be called.

dynamicupdateDiscordPresence():Void

Function used to update Discord Presence. This function is dynamic, which means you can do updateDiscordPresence = function() {} in scripts.

updateRating():Void

Updates the rating.

Inherited Variables

Defined by MusicBeatState

@:value(false)cancelConductorUpdate:Bool = false

Whenever the Conductor auto update should be enabled or not.

read onlycontrols:Controls

Game Controls. (All players / Solo)

read onlycontrolsP1:Controls

Game Controls (Player 1 only)

read onlycontrolsP2:Controls

Game Controls (Player 2 only)

read onlycurBeat:Int

Current beat

read onlycurBeatFloat:Float

Current beat, as a Float (ex: 1.24, instead of 1)

read onlycurMeasure:Int

Current beat

read onlycurMeasureFloat:Float

Current beat, as a Float (ex: 1.24, instead of 1)

read onlycurStep:Int

Current step

read onlycurStepFloat:Float

Current step, as a Float (ex: 4.94, instead of 4)

@:value(null)scriptName:String = null

@:value(true)scriptsAllowed:Bool = true

read onlysongPos:Float

Current song position (in milliseconds).

stateScript:Script

Current injected script attached to the state. To add one, create a file at path "data/states/stateName" (ex: data/states/FreeplayState)

Inherited Methods

Defined by MusicBeatState

call(name:String, ?args:Array<Dynamic>, ?defaultVal:Dynamic):Dynamic

event<T>(name:String, event:T):T

@:value({ fpsSensitive : false })lerp(v1:Float, v2:Float, ratio:Float, fpsSensitive:Bool = false):Float

Shortcut to FlxMath.lerp or CoolUtil.lerp, depending on fpsSensitive

Parameters:

v1

Value 1

v2

Value 2

ratio

Ratio

fpsSensitive

Whenever the ratio should not be adjusted to run at the same speed independent of framerate.

openSubState(subState:FlxSubState):Void

SCRIPTING STUFF