Skip to content
Wizard edited this page Jan 13, 2023 · 11 revisions

i have an idea don't mind this tab, this won't be finished for a while

TitleState

MainMenuState

StoryMenuState

PlayState

Functions

set_downscroll(v:Bool) {return camHUD.downscroll = v;}
function get_downscroll():Bool  {return camHUD.downscroll;}
Variable Type Description
instance ??? Current PlayState instance.
SONG SwagSong Song Metadata
isStoryMode bool Whenever the song is being played in Story Mode.
storyWeek WeekData The week data of the current week.
storyPlaylist array The remaining songs in the Story Mode playlist.
difficulty string The selected difficulty name, default value is "normal".
fromMods bool Whenever the week is coming from the mods folder or not.
scripts ScriptPack Script Pack of all the scripts being ran.
gameOverSong string Game Over Song at assets/music/gameOver.ogg, default value is "gameOver"
lossSFX string Game Over Song at assets/sounds/gameOverSFX.ogg, default value is "gameOverSFX"
retrySFX string Game Over End SFX, used when retrying. assets/sounds/gameOverEnd.ogg, default value is "gameOverEnd"
stage Stage Current Stage.
canDie bool Whenever the player can die, default value is true.
scrollSpeed float Current scroll speed for all strums. To set a scroll speed for a specific strum, use strum.scrollSpeed.
downscroll bool Whenever the game is in downscroll or not. (Can be set)
inst FlxSound Instrumental sound (Inst.ogg).
vocals FlxSound Vocals sound (Vocals.ogg).
dad Character Dad character
gf Character Girlfriend character
boyfriend Character Boyfriend character
notes NoteGroup Group of all of the notes. Using forEach on this group will only loop through the first notes.
strumLine FlxObject Strum line position.
ratingNum int Number of ratings.
camFollow FlxObject Object defining the camera follow target.
ratingNum int Number of ratings.
prevCamFollow FlxObject Previous cam follow.
strumLineNotes FlxTypedGroup All of the strum line notes.
playerStrums FlxTypedGroup Player strums.
cpuStrums FlxTypedGroup CPU strums.
splashHandler SplashHandler Note splashes container.
splashHandler SplashHandler Note splashes container.
muteVocalsOnMiss bool Whenever the vocals should be muted when a note is missed, default value is true.
canAccessDebugMenus bool Whenever the player can press 7, 8 or 9 to access the debug menus, default value is true.
camZooming bool Whenever cam zooming is enabled, enables on a note hit if not cancelled.
camZoomingInterval int Interval of cam zooming (beats). For example: if set to 4, the camera will zoom every 4 beats.
camZoomingStrength float How strong the cam zooms should be, default value is 1.
maxCamZoom float Maximum amount of zoom for the camera, default value is 1.35.
curSong string Current song name (lowercase)
gfSpeed int Interval at which Girlfriend dances, default value is 1.
health float Current health. Goes from 0 to maxHealth.
maxhealth float Maximum health the player can have. Defaults to 2.
combo int Current combo.
comboBreaks bool Whenever the misses should show "Combo Breaks" instead of "Misses", default value is false.
healthBarBG FlxSprite Health bar background.
/**
 * Health bar.
 */
public var healthBar:FlxBar;

/**
 * Whenever the music has been generated.
 */
public var generatedMusic:Bool = false;
/**
 * Whenever the song is currently being started.
 */
public var startingSong:Bool = false;

/**
 * Player's icon
 */
public var iconP1:HealthIcon;
/**
 * Opponent's icon
 */
public var iconP2:HealthIcon;
/**
 * Camera for the HUD (notes, misses).
 */
public var camHUD:HudCamera;
/**
 * Camera for the game (stages, characters)
 */
public var camGame:FlxCamera;

/**
 * The player's current score.
 */
public var songScore:Int = 0;
/**
 * The player's amount of misses.
 */
public var misses:Int = 0;
/**
 * The player's accuracy (shortcut to `accuracyPressedNotes / totalAccuracyAmount`).
 */
public var accuracy(get, set):Float;
/**
 * The number of pressed notes.
 */
public var accuracyPressedNotes:Float = 0;
/**
 * The total accuracy amount.
 */
public var totalAccuracyAmount:Float = 0;

/**
 * FunkinText that shows your score.
 */
public var scoreTxt:FunkinText;
/**
 * FunkinText that shows your amount of misses.
 */
public var missesTxt:FunkinText;
/**
 * FunkinText that shows your accuracy.
 */
public var accuracyTxt:FunkinText;

/**
 * Score for the current week.
 */
public static var campaignScore:Int = 0;

/**
 * Camera zoom at which the game lerps to.
 */
public var defaultCamZoom:Float = 1.05;

/**
 * Zoom for the pixel assets.
 */
public static var daPixelZoom:Float = 6;

/**
 * Whenever the game is currently in a cutscene or not.
 */
public var inCutscene:Bool = false;

/**
 * Whenever the game should play the cutscenes. Defaults to whenever the game is currently in Story Mode or not.
 */
public var playCutscenes:Bool = isStoryMode;
/**
 * Cutscene script path.
 */
public var cutscene:String = null;
/**
 * End cutscene script path.
 */
public var endCutscene:String = null;

/**
 * Last rating (may be null)
 */
public var curRating:ComboRating;

/**
 * Timer for the start countdown
 */
public var startTimer:FlxTimer;

/**
 * Length of the intro countdown.
 */
public var introLength:Int = 5;
/**
 * Array of sprites for the intro.
 */
public var introSprites:Array<String> = [null, 'game/ready', "game/set", "game/go"];
/**
 * Array of sounds for the intro.
 */
public var introSounds:Array<String> = ['intro3', 'intro2', "intro1", "introGo"];

/**
 * Whenever the game is paused or not.
 */
public var paused:Bool = false;
/**
 * Whenever the countdown has started or not.
 */
public var startedCountdown:Bool = false;
/**
 * Whenever the game can be paused or not.
 */
public var canPause:Bool = true;

/**
 * Current section (can be `null` when using YoshiCrafter Engine charts).
 */
public var curSection(get, null):SwagSection;
/**
 * Format for the accuracy rating.
 */
public var accFormat:FlxTextFormat = new FlxTextFormat(0xFF888888, false, false, 0);
/**
 * Whenever the song is ending or not.
 */
public var endingSong:Bool = false;

/**
 * Group containing all of the combo sprites.
 */
public var comboGroup:FlxSpriteGroup;
/**
 * Array containing all of the note types names.
 */
public var noteTypesArray:Array<String> = [null];

/**
 * Hit window, in milliseconds. Defaults to 250ms unless changed in options.
 * Base game hit window is 175ms.
 */
public var hitWindow:Float = Options.hitWindow; // is calculated in create(), is safeFrames in milliseconds

@:dox(hide)
var __vocalOffsetViolation:Float = 0;

private function get_accuracy():Float {
	if (accuracyPressedNotes <= 0) return -1;
	return totalAccuracyAmount / accuracyPressedNotes;
}
private function set_accuracy(v:Float):Float {
	if (accuracyPressedNotes <= 0)
		accuracyPressedNotes = 1;
	return totalAccuracyAmount = v * accuracyPressedNotes;
}
/**
 * All combo ratings.
 */
public var 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),
];

public var detailsText:String = "";
public var detailsPausedText:String = "";

public function updateRating() {
	var rating = null;
	var acc = get_accuracy();

	for(e in comboRatings) {
		if (e.percent <= acc && (rating == null || rating.percent < e.percent))
			rating = e;
	}

	var event = scripts.event("onRatingUpdate", EventManager.get(RatingUpdateEvent).recycle(rating, curRating));
	if (!event.cancelled)
		curRating = event.rating;
}

private inline function get_maxHealth()
	return this.maxHealth;
private function set_maxHealth(v:Float) {
	if (healthBar != null && healthBar.max == this.maxHealth) {
		healthBar.setRange(healthBar.min, v);
	}
	return this.maxHealth = v;
}

FreeplayState

uhh others idk

Clone this wiki locally