From 492c135b460ea03fb8b881dabd26c249911ad532 Mon Sep 17 00:00:00 2001 From: JordanSantiagoYT Date: Sun, 31 Mar 2024 21:51:59 -0400 Subject: [PATCH] A lot of stuff Moved stage code out of PlayState Health Bar tween now disables in Story Mode You can now customize the style of every HUD element separately All options in ClientPrefs were sorted PS: The HUD Elements and stages weren't completely tested, so if you find any issues please let me know --- Project.xml | 1 + hmm.json | 7 + source/BaseStage.hx | 183 ++ source/Character.hx | 2 +- source/ClientPrefs.hx | 802 ++++----- source/FunkinLua.hx | 4 +- source/MusicBeatState.hx | 30 + source/Paths.hx | 83 + source/PlayState.hx | 1665 ++----------------- source/import.hx | 30 +- source/options/VisualsUISubState.hx | 42 +- source/stages/Limo.hx | 279 ++++ source/stages/Mall.hx | 103 ++ source/stages/MallEvil.hx | 69 + source/stages/Philly.hx | 215 +++ source/stages/School.hx | 155 ++ source/stages/SchoolEvil.hx | 160 ++ source/stages/Spooky.hx | 116 ++ source/stages/StageWeek1.hx | 97 ++ source/stages/Tank.hx | 389 +++++ source/stages/Template.hx | 123 ++ source/stages/objects/BackgroundDancer.hx | 29 + source/stages/objects/BackgroundGirls.hx | 44 + source/stages/objects/BackgroundTank.hx | 26 + source/stages/objects/DadBattleFog.hx | 30 + source/stages/objects/MallCrowd.hx | 31 + source/stages/objects/PhillyGlowGradient.hx | 46 + source/stages/objects/PhillyGlowParticle.hx | 45 + source/stages/objects/PhillyTrain.hx | 95 ++ source/stages/objects/TankmenBG.hx | 71 + 30 files changed, 3085 insertions(+), 1887 deletions(-) create mode 100644 source/BaseStage.hx create mode 100644 source/stages/Limo.hx create mode 100644 source/stages/Mall.hx create mode 100644 source/stages/MallEvil.hx create mode 100644 source/stages/Philly.hx create mode 100644 source/stages/School.hx create mode 100644 source/stages/SchoolEvil.hx create mode 100644 source/stages/Spooky.hx create mode 100644 source/stages/StageWeek1.hx create mode 100644 source/stages/Tank.hx create mode 100644 source/stages/Template.hx create mode 100644 source/stages/objects/BackgroundDancer.hx create mode 100644 source/stages/objects/BackgroundGirls.hx create mode 100644 source/stages/objects/BackgroundTank.hx create mode 100644 source/stages/objects/DadBattleFog.hx create mode 100644 source/stages/objects/MallCrowd.hx create mode 100644 source/stages/objects/PhillyGlowGradient.hx create mode 100644 source/stages/objects/PhillyGlowParticle.hx create mode 100644 source/stages/objects/PhillyTrain.hx create mode 100644 source/stages/objects/TankmenBG.hx diff --git a/Project.xml b/Project.xml index e5cd6d87a38..8a9e20a2279 100644 --- a/Project.xml +++ b/Project.xml @@ -140,6 +140,7 @@ + diff --git a/hmm.json b/hmm.json index 2e8703dc196..da71fb364b7 100644 --- a/hmm.json +++ b/hmm.json @@ -50,6 +50,13 @@ "type": "haxelib", "version": null }, + { + "name": "flxanimate", + "type": "git", + "dir": null, + "ref": "dev", + "url": "https://github.com/ShadowMario/flxanimate" + }, { "name": "hxdiscord_rpc", "type": "git", diff --git a/source/BaseStage.hx b/source/BaseStage.hx new file mode 100644 index 00000000000..97eb8f7ebb7 --- /dev/null +++ b/source/BaseStage.hx @@ -0,0 +1,183 @@ +package; + +import flixel.FlxBasic; +import flixel.FlxObject; +import flixel.FlxSubState; +import MusicBeatState; + +import Note.EventNote; +import Character; + +enum Countdown +{ + THREE; + TWO; + ONE; + GO; + START; +} + +class BaseStage extends FlxBasic +{ + private var game(default, set):Dynamic = PlayState.instance; + public var onPlayState:Bool = false; + + // some variables for convenience + public var paused(get, never):Bool; + public var songName(get, never):String; + public var isStoryMode(get, never):Bool; + public var seenCutscene(get, never):Bool; + public var inCutscene(get, set):Bool; + public var canPause(get, set):Bool; + public var members(get, never):Dynamic; + + public var boyfriend(get, never):Character; + public var dad(get, never):Character; + public var gf(get, never):Character; + public var boyfriendGroup(get, never):FlxSpriteGroup; + public var dadGroup(get, never):FlxSpriteGroup; + public var gfGroup(get, never):FlxSpriteGroup; + + public var camGame(get, never):FlxCamera; + public var camHUD(get, never):FlxCamera; + public var camOther(get, never):FlxCamera; + + public var defaultCamZoom(get, set):Float; + public var camFollow(get, never):FlxPoint; + + public function new() + { + this.game = MusicBeatState.getState(); + if(this.game == null) + { + FlxG.log.warn('Invalid state for the stage added!'); + destroy(); + } + else + { + this.game.stages.push(this); + super(); + create(); + } + } + + //main callbacks + public function create() {} + public function createPost() {} + //public function update(elapsed:Float) {} + public function countdownTick(count:Countdown, num:Int) {} + + // FNF steps, beats and sections + public var curBeat:Int = 0; + public var curDecBeat:Float = 0; + public var curStep:Int = 0; + public var curDecStep:Float = 0; + public var curSection:Int = 0; + public function beatHit() {} + public function stepHit() {} + public function sectionHit() {} + + // Substate close/open, for pausing Tweens/Timers + public function closeSubState() {} + public function openSubState(SubState:FlxSubState) {} + + // Events + public function eventCalled(eventName:String, value1:String, value2:String, flValue1:Null, flValue2:Null, strumTime:Float) {} + public function eventPushed(event:EventNote) {} + public function eventPushedUnique(event:EventNote) {} + + // Things to replace FlxGroup stuff and inject sprites directly into the state + function add(object:FlxBasic) game.add(object); + function remove(object:FlxBasic) game.remove(object); + function insert(position:Int, object:FlxBasic) game.insert(position, object); + + public function addBehindGF(obj:FlxBasic) insert(members.indexOf(game.gfGroup), obj); + public function addBehindBF(obj:FlxBasic) insert(members.indexOf(game.boyfriendGroup), obj); + public function addBehindDad(obj:FlxBasic) insert(members.indexOf(game.dadGroup), obj); + public function setDefaultGF(name:String) //Fix for the Chart Editor on Base Game stages + { + var gfVersion:String = PlayState.SONG.gfVersion; + if(gfVersion == null || gfVersion.length < 1) + { + gfVersion = name; + PlayState.SONG.gfVersion = gfVersion; + } + } + + //start/end callback functions + public function setStartCallback(myfn:Void->Void) + { + if(!onPlayState) return; + PlayState.instance.startCallback = myfn; + } + public function setEndCallback(myfn:Void->Void) + { + if(!onPlayState) return; + PlayState.instance.endCallback = myfn; + } + + // overrides + function startCountdown() + { + if(onPlayState) + { + PlayState.instance.startCountdown(); + return true; + } + else return false; + } + function endSong() + { + if(onPlayState) + { + PlayState.instance.endSong(); + return true; + } + else return false; + } + function moveCameraSection() if(onPlayState) moveCameraSection(); + function moveCamera(isDad:Bool) if(onPlayState) moveCamera(isDad); + inline private function get_paused() return game.paused; + inline private function get_songName() return game.songName; + inline private function get_isStoryMode() return PlayState.isStoryMode; + inline private function get_seenCutscene() return PlayState.seenCutscene; + inline private function get_inCutscene() return game.inCutscene; + inline private function set_inCutscene(value:Bool) + { + game.inCutscene = value; + return value; + } + inline private function get_canPause() return game.canPause; + inline private function set_canPause(value:Bool) + { + game.canPause = value; + return value; + } + inline private function get_members() return game.members; + inline private function set_game(value:MusicBeatState) + { + onPlayState = (Std.isOfType(value, PlayState)); + game = value; + return value; + } + + inline private function get_boyfriend():Character return game.boyfriend; + inline private function get_dad():Character return game.dad; + inline private function get_gf():Character return game.gf; + + inline private function get_boyfriendGroup():FlxSpriteGroup return game.boyfriendGroup; + inline private function get_dadGroup():FlxSpriteGroup return game.dadGroup; + inline private function get_gfGroup():FlxSpriteGroup return game.gfGroup; + + inline private function get_camGame():FlxCamera return game.camGame; + inline private function get_camHUD():FlxCamera return game.camHUD; + inline private function get_camOther():FlxCamera return game.camOther; + + inline private function get_defaultCamZoom():Float return game.defaultCamZoom; + inline private function set_defaultCamZoom(value:Float):Float + { + game.defaultCamZoom = value; + return game.defaultCamZoom; + } + inline private function get_camFollow():FlxPoint return game.camFollow; +} \ No newline at end of file diff --git a/source/Character.hx b/source/Character.hx index a03cb106988..7acbff08c6d 100644 --- a/source/Character.hx +++ b/source/Character.hx @@ -441,7 +441,7 @@ class Character extends FlxSprite animationNotes.push(songNotes); } } - TankmenBG.animationNotes = animationNotes; + stages.objects.TankmenBG.animationNotes = animationNotes; animationNotes.sort(sortAnims); } diff --git a/source/ClientPrefs.hx b/source/ClientPrefs.hx index e50c881816d..02f8c1be014 100644 --- a/source/ClientPrefs.hx +++ b/source/ClientPrefs.hx @@ -43,110 +43,117 @@ class ClientPrefs { //default settings if it can't find a save file containing y public static var trollMaxSpeed:String = 'Medium'; public static var minCGBMS:Int = 5; public static var maxCGBMS:Int = 5; + public static var missSoundShit:Bool = false; - public static var showFPS:Bool = true; - public static var flashing:Bool = true; - public static var globalAntialiasing:Bool = true; - public static var dynamicColors:Bool = true; - public static var healthDisplay:Bool = false; - public static var noBopLimit:Bool = false; - public static var cameraPanning:Bool = true; - public static var colorQuants:Bool = false; - public static var panIntensity:Float = 1; + //Visuals & UI public static var noteSplashes:Bool = true; - public static var enableColorShader:Bool = true; - public static var cacheOnGPU:Bool = false; - public static var playerLightStrum:Bool = true; - public static var progAudioLoad:Bool = false; - public static var missRating:Bool = false; public static var oppNoteSplashes:Bool = true; - public static var charsAndBG:Bool = true; - public static var enableGC:Bool = false; - public static var lowQuality:Bool = false; - public static var smoothHPBug:Bool = false; - public static var shaders:Bool = true; - public static var framerate:Int = 60; - public static var cursing:Bool = true; + public static var showNPS:Bool = false; public static var maxSplashLimit:Int = 16; - public static var showMaxScore:Bool = true; - public static var longHPBar:Bool = false; - public static var tauntOnGo:Bool = true; - public static var noteColorStyle:String = 'Normal'; - public static var autosaveCharts:Bool = true; - public static var discordRPC:Bool = true; - public static var tipTexts:Bool = true; - public static var showRamUsage:Bool = true; - public static var showMaxRamUsage:Bool = true; - public static var rainbowFPS:Bool = false; - public static var widescreenSweep:Bool = false; - public static var bfIconStyle:String = 'Default'; - public static var strumLitStyle:String = 'Full Anim'; - public static var noteStyleThing:String = 'Default'; - public static var daMenuMusic:String = 'Default'; - public static var randomBotplayText:Bool = true; - public static var opponentLightStrum:Bool = true; - public static var iconBopWhen:String = 'Every Beat'; - public static var scoreTxtSize:Int = 0; - public static var botLightStrum:Bool = true; - public static var violence:Bool = true; - public static var camZooms:Bool = true; - public static var showNotes:Bool = true; - public static var doubleGhost:Bool = false; - public static var songLoading:Bool = true; - public static var resultsScreen:Bool = true; - public static var botTxtFade:Bool = true; + public static var oppNoteAlpha:Float = 0.65; public static var hideHud:Bool = false; - public static var debugInfo:Bool = false; public static var hideScore:Bool = false; - public static var compactNumbers:Bool = false; - public static var longFCName:Bool = false; - public static var noGunsRNG:Bool = false; - public static var resolution:String = '1280x720'; - public static var crossFadeData:Array = ['Default', 'Healthbar', [255, 255, 255], 0.3, 0.35]; - public static var wrongCameras:Bool = false; - public static var pbRControls:Bool = false; - public static var timebarShowSpeed:Bool = false; - public static var noteSpawnTime:Float = 1; - public static var dynamicSpawnTime:Bool = false; - public static var evenLessBotLag:Bool = false; + public static var tauntOnGo:Bool = true; + public static var showRendered:Bool = false; public static var showcaseMode:Bool = false; - public static var oppNoteAlpha:Float = 0.65; - public static var lessBotLag:Bool = false; - public static var ratesAndCombo:Bool = false; - public static var showNPS:Bool = false; - public static var showMS:Bool = false; - public static var comboPopup:Bool = false; - public static var ratingCounter:Bool = false; - public static var memLeaks:Bool = false; - public static var noPausing:Bool = false; - public static var doubleGhostZoom:Bool = true; - public static var npsWithSpeed:Bool = true; + public static var showMaxScore:Bool = true; + public static var timeBounce:Bool = true; public static var lengthIntro:Bool = true; - public static var opponentRateCount:Bool = true; - public static var skipResultsScreen:Bool = false; + public static var timebarShowSpeed:Bool = false; + public static var missRating:Bool = false; + public static var resultsScreen:Bool = true; + public static var compactNumbers:Bool = false; + public static var scoreTxtSize:Int = 0; + public static var noteColorStyle:String = 'Normal'; + public static var enableColorShader:Bool = true; + public static var iconBopWhen:String = 'Every Beat'; + public static var cameraPanning:Bool = true; + public static var panIntensity:Float = 1; + public static var rateNameStuff:String = 'Quotes'; + public static var goldSickSFC:Bool = true; + public static var colorRatingHit:Bool = true; + public static var colorRatingFC:Bool = false; + public static var marvRateColor:String = 'Golden'; + public static var smoothHealth:Bool = true; + public static var smoothHPBug:Bool = false; + public static var noBopLimit:Bool = false; public static var denpaDrainBug:Bool = false; public static var ogHPColor:Bool = false; - public static var hudType:String = 'Kade Engine'; - public static var smoothHealth:Bool = true; - public static var rateNameStuff:String = 'Quotes'; - public static var timeBounce:Bool = true; - public static var splashType:String = 'Psych Engine'; - public static var iconBounceType:String = 'Golden Apple'; - public static var ratingType:String = 'Base FNF'; + public static var doubleGhost:Bool = false; + public static var doubleGhostZoom:Bool = true; public static var timeBarType:String = 'Time Left'; - public static var marvRateColor:String = 'Golden'; + public static var scoreStyle:String = 'Psych Engine'; + public static var timeBarStyle:String = 'Vanilla'; + public static var healthBarStyle:String = 'Vanilla'; + public static var watermarkStyle:String = 'Vanilla'; + public static var botTxtStyle:String = 'Vanilla'; + public static var strumLitStyle:String = 'Full Anim'; + public static var noteStyleThing:String = 'Default'; + public static var bfIconStyle:String = 'Default'; + public static var ratingType:String = 'Base FNF'; + public static var iconBounceType:String = 'Golden Apple'; + public static var splashType:String = 'Psych Engine'; + public static var longHPBar:Bool = false; + public static var longFCName:Bool = false; + public static var healthDisplay:Bool = false; + public static var opponentRateCount:Bool = true; + public static var showMS:Bool = false; + public static var wrongCameras:Bool = false; + public static var flashing:Bool = true; + public static var camZooms:Bool = true; + public static var ratingCounter:Bool = false; + public static var showNotes:Bool = true; public static var scoreZoom:Bool = true; - public static var goldSickSFC:Bool = true; - public static var colorRatingFC:Bool = false; - public static var colorRatingHit:Bool = true; - public static var missSoundShit:Bool = false; public static var healthBarAlpha:Float = 1; - public static var laneUnderlayAlpha:Float = 1; public static var laneUnderlay:Bool = false; + public static var laneUnderlayAlpha:Float = 1; + public static var showFPS:Bool = true; + public static var randomBotplayText:Bool = true; + public static var botTxtFade:Bool = true; public static var pauseMusic:String = 'Tea Time'; + public static var daMenuMusic:String = 'Default'; public static var checkForUpdates:Bool = true; - public static var showRendered:Bool = false; public static var comboStacking = true; + public static var showRamUsage:Bool = true; + public static var showMaxRamUsage:Bool = true; + public static var debugInfo:Bool = false; + public static var npsWithSpeed:Bool = true; + public static var tipTexts:Bool = true; + public static var discordRPC:Bool = true; + + //Graphics + public static var lowQuality:Bool = false; + public static var globalAntialiasing:Bool = true; + public static var shaders:Bool = true; + public static var cacheOnGPU:Bool = false; + public static var progAudioLoad:Bool = false; + public static var dynamicSpawnTime:Bool = false; + public static var noteSpawnTime:Float = 1; + public static var resolution:String = '1280x720'; + public static var framerate:Int = 60; + + //Optimization + public static var charsAndBG:Bool = true; + public static var enableGC:Bool = false; + public static var opponentLightStrum:Bool = true; + public static var botLightStrum:Bool = true; + public static var playerLightStrum:Bool = true; + public static var ratesAndCombo:Bool = false; + public static var comboPopup:Bool = false; + public static var songLoading:Bool = true; + public static var lessBotLag:Bool = false; + + //Secret Debug + public static var noGunsRNG:Bool = false; + public static var pbRControls:Bool = false; + public static var rainbowFPS:Bool = false; + + //Unused + public static var cursing:Bool = true; + public static var autosaveCharts:Bool = true; + public static var violence:Bool = true; + public static var crossFadeData:Array = ['Default', 'Healthbar', [255, 255, 255], 0.3, 0.35]; + public static var noPausing:Bool = false; //Note HSV public static var arrowHSV:Array> = [[0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0]]; @@ -165,6 +172,7 @@ class ClientPrefs { //default settings if it can't find a save file containing y public static var JSEngineRecharts:Bool = false; public static var alwaysTriggerCutscene:Bool = false; + //Gameplay Modifiers public static var gameplaySettings:Map = [ 'scrollspeed' => 1.0, 'scrolltype' => 'multiplicative', @@ -280,109 +288,122 @@ class ClientPrefs { //default settings if it can't find a save file containing y FlxG.save.data.voiidTrollMode = voiidTrollMode; FlxG.save.data.trollMaxSpeed = trollMaxSpeed; - FlxG.save.data.showFPS = showFPS; - FlxG.save.data.flashing = flashing; - FlxG.save.data.globalAntialiasing = globalAntialiasing; + //Visuals & UI FlxG.save.data.noteSplashes = noteSplashes; FlxG.save.data.oppNoteSplashes = oppNoteSplashes; - FlxG.save.data.songLoading = songLoading; - FlxG.save.data.debugInfo = debugInfo; - FlxG.save.data.scoreTxtSize = scoreTxtSize; - FlxG.save.data.lowQuality = lowQuality; - FlxG.save.data.smoothHPBug = smoothHPBug; - FlxG.save.data.shaders = shaders; - FlxG.save.data.evenLessBotLag = evenLessBotLag; - FlxG.save.data.missRating = missRating; - FlxG.save.data.framerate = framerate; - //FlxG.save.data.cursing = cursing; - //FlxG.save.data.violence = violence; - FlxG.save.data.progAudioLoad = progAudioLoad; - FlxG.save.data.tipTexts = tipTexts; - FlxG.save.data.noGunsRNG = noGunsRNG; - FlxG.save.data.camZooms = camZooms; - FlxG.save.data.daMenuMusic = daMenuMusic; + FlxG.save.data.showNPS = showNPS; FlxG.save.data.maxSplashLimit = maxSplashLimit; + FlxG.save.data.oppNoteAlpha = oppNoteAlpha; + FlxG.save.data.hideHud = hideHud; + FlxG.save.data.hideScore = hideScore; + FlxG.save.data.tauntOnGo = tauntOnGo; + FlxG.save.data.showRendered = showRendered; + FlxG.save.data.showcaseMode = showcaseMode; FlxG.save.data.showMaxScore = showMaxScore; - FlxG.save.data.autosaveCharts = autosaveCharts; - FlxG.save.data.discordRPC = discordRPC; - FlxG.save.data.rateNameStuff = rateNameStuff; - FlxG.save.data.longFCName = longFCName; - FlxG.save.data.botTxtFade = botTxtFade; - FlxG.save.data.noteColorStyle = noteColorStyle; - FlxG.save.data.showNotes = showNotes; - FlxG.save.data.skipResultsScreen = skipResultsScreen; - FlxG.save.data.enableGC = enableGC; FlxG.save.data.timeBounce = timeBounce; - FlxG.save.data.showRamUsage = showRamUsage; - FlxG.save.data.showMaxRamUsage = showMaxRamUsage; - FlxG.save.data.playerLightStrum = playerLightStrum; - FlxG.save.data.healthDisplay = healthDisplay; + FlxG.save.data.lengthIntro = lengthIntro; + FlxG.save.data.timebarShowSpeed = timebarShowSpeed; + FlxG.save.data.missRating = missRating; + FlxG.save.data.resultsScreen = resultsScreen; + FlxG.save.data.compactNumbers = compactNumbers; + FlxG.save.data.scoreTxtSize = scoreTxtSize; + FlxG.save.data.noteColorStyle = noteColorStyle; + FlxG.save.data.enableColorShader = enableColorShader; + FlxG.save.data.iconBopWhen = iconBopWhen; + FlxG.save.data.cameraPanning = cameraPanning; + FlxG.save.data.panIntensity = panIntensity; + FlxG.save.data.rateNameStuff = rateNameStuff; + FlxG.save.data.goldSickSFC = goldSickSFC; + FlxG.save.data.colorRatingHit = colorRatingHit; + FlxG.save.data.colorRatingFC = colorRatingFC; + FlxG.save.data.marvRateColor = marvRateColor; + FlxG.save.data.smoothHealth = smoothHealth; + FlxG.save.data.smoothHPBug = smoothHPBug; FlxG.save.data.noBopLimit = noBopLimit; - FlxG.save.data.wrongCameras = wrongCameras; FlxG.save.data.denpaDrainBug = denpaDrainBug; FlxG.save.data.ogHPColor = ogHPColor; - FlxG.save.data.charsAndBG = charsAndBG; - FlxG.save.data.pbRControls = pbRControls; FlxG.save.data.doubleGhost = doubleGhost; - FlxG.save.data.bfIconStyle = bfIconStyle; - FlxG.save.data.resolution = resolution; + FlxG.save.data.doubleGhostZoom = doubleGhostZoom; + FlxG.save.data.timeBarType = timeBarType; + FlxG.save.data.scoreStyle = scoreStyle; + FlxG.save.data.timeBarStyle = timeBarStyle; + FlxG.save.data.healthBarStyle = healthBarStyle; + FlxG.save.data.watermarkStyle = watermarkStyle; + FlxG.save.data.botTxtStyle = botTxtStyle; FlxG.save.data.strumLitStyle = strumLitStyle; FlxG.save.data.noteStyleThing = noteStyleThing; - FlxG.save.data.randomBotplayText = randomBotplayText; - FlxG.save.data.showNPS = showNPS; - FlxG.save.data.resultsScreen = resultsScreen; + FlxG.save.data.bfIconStyle = bfIconStyle; + FlxG.save.data.ratingType = ratingType; FlxG.save.data.iconBounceType = iconBounceType; - FlxG.save.data.cameraPanning = cameraPanning; - FlxG.save.data.panIntensity = panIntensity; - FlxG.save.data.iconBopWhen = iconBopWhen; - FlxG.save.data.compactNumbers = compactNumbers; - FlxG.save.data.colorQuants = colorQuants; - FlxG.save.data.noteSpawnTime = noteSpawnTime; - FlxG.save.data.cacheOnGPU = cacheOnGPU; - FlxG.save.data.hideScore = hideScore; - FlxG.save.data.doubleGhostZoom = doubleGhostZoom; - FlxG.save.data.memLeaks = memLeaks; - FlxG.save.data.dynamicSpawnTime = dynamicSpawnTime; - FlxG.save.data.botLightStrum = botLightStrum; - FlxG.save.data.opponentLightStrum = opponentLightStrum; + FlxG.save.data.splashType = splashType; + FlxG.save.data.longHPBar = longHPBar; + FlxG.save.data.longFCName = longFCName; + FlxG.save.data.healthDisplay = healthDisplay; FlxG.save.data.opponentRateCount = opponentRateCount; - FlxG.save.data.hudType = hudType; - FlxG.save.data.ratingCounter = ratingCounter; - FlxG.save.data.colorRatingHit = colorRatingHit; - FlxG.save.data.rainbowFPS = rainbowFPS; - FlxG.save.data.oppNoteAlpha = oppNoteAlpha; - FlxG.save.data.enableColorShader = enableColorShader; - FlxG.save.data.noPausing = noPausing; - FlxG.save.data.ratesAndCombo = ratesAndCombo; - FlxG.save.data.ratingType = ratingType; + FlxG.save.data.wrongCameras = wrongCameras; FlxG.save.data.showMS = showMS; - FlxG.save.data.comboPopup = comboPopup; - FlxG.save.data.hideHud = hideHud; - FlxG.save.data.lengthIntro = lengthIntro; - FlxG.save.data.crossFadeData = crossFadeData; - FlxG.save.data.longHPBar = longHPBar; - FlxG.save.data.npsWithSpeed = npsWithSpeed; - FlxG.save.data.timebarShowSpeed = timebarShowSpeed; - FlxG.save.data.smoothHealth = smoothHealth; - FlxG.save.data.lessBotLag = lessBotLag; - FlxG.save.data.tauntOnGo = tauntOnGo; - FlxG.save.data.timeBarType = timeBarType; - FlxG.save.data.marvRateColor = marvRateColor; - FlxG.save.data.goldSickSFC = goldSickSFC; - FlxG.save.data.colorRatingFC = colorRatingFC; - FlxG.save.data.splashType = splashType; + FlxG.save.data.flashing = flashing; + FlxG.save.data.camZooms = camZooms; + FlxG.save.data.ratingCounter = ratingCounter; + FlxG.save.data.showNotes = showNotes; FlxG.save.data.scoreZoom = scoreZoom; FlxG.save.data.healthBarAlpha = healthBarAlpha; - FlxG.save.data.laneUnderlayAlpha = laneUnderlayAlpha; FlxG.save.data.laneUnderlay = laneUnderlay; - FlxG.save.data.achievementsMap = Achievements.achievementsMap; - FlxG.save.data.henchmenDeath = Achievements.henchmenDeath; - FlxG.save.data.showcaseMode = showcaseMode; - FlxG.save.data.gameplaySettings = gameplaySettings; + FlxG.save.data.laneUnderlayAlpha = laneUnderlayAlpha; + FlxG.save.data.showFPS = showFPS; + FlxG.save.data.randomBotplayText = randomBotplayText; + FlxG.save.data.botTxtFade = botTxtFade; FlxG.save.data.pauseMusic = pauseMusic; + FlxG.save.data.daMenuMusic = daMenuMusic; FlxG.save.data.checkForUpdates = checkForUpdates; - FlxG.save.data.showRendered = showRendered; FlxG.save.data.comboStacking = comboStacking; + FlxG.save.data.showRamUsage = showRamUsage; + FlxG.save.data.showMaxRamUsage = showMaxRamUsage; + FlxG.save.data.debugInfo = debugInfo; + FlxG.save.data.npsWithSpeed = npsWithSpeed; + FlxG.save.data.tipTexts = tipTexts; + FlxG.save.data.discordRPC = discordRPC; + + //Graphics + FlxG.save.data.lowQuality = lowQuality; + FlxG.save.data.globalAntialiasing = globalAntialiasing; + FlxG.save.data.shaders = shaders; + FlxG.save.data.cacheOnGPU = cacheOnGPU; + FlxG.save.data.progAudioLoad = progAudioLoad; + FlxG.save.data.dynamicSpawnTime = dynamicSpawnTime; + FlxG.save.data.noteSpawnTime = noteSpawnTime; + FlxG.save.data.resolution = resolution; + FlxG.save.data.framerate = framerate; + + //Optimization + FlxG.save.data.charsAndBG = charsAndBG; + FlxG.save.data.enableGC = enableGC; + FlxG.save.data.opponentLightStrum = opponentLightStrum; + FlxG.save.data.botLightStrum = botLightStrum; + FlxG.save.data.playerLightStrum = playerLightStrum; + FlxG.save.data.ratesAndCombo = ratesAndCombo; + FlxG.save.data.comboPopup = comboPopup; + FlxG.save.data.songLoading = songLoading; + FlxG.save.data.lessBotLag = lessBotLag; + + //Secret Debug + FlxG.save.data.noGunsRNG = noGunsRNG; + FlxG.save.data.pbRControls = pbRControls; + FlxG.save.data.rainbowFPS = rainbowFPS; + + //Unused + //FlxG.save.data.cursing = cursing; + //FlxG.save.data.violence = violence; + FlxG.save.data.autosaveCharts = autosaveCharts; + FlxG.save.data.noPausing = noPausing; + FlxG.save.data.crossFadeData = crossFadeData; + + //Achievements + FlxG.save.data.achievementsMap = Achievements.achievementsMap; + FlxG.save.data.henchmenDeath = Achievements.henchmenDeath; + + //Gameplay Modifiers + FlxG.save.data.gameplaySettings = gameplaySettings; //Offset and Window stuff FlxG.save.data.ratingOffset = ratingOffset; @@ -421,6 +442,7 @@ class ClientPrefs { //default settings if it can't find a save file containing y } public static function loadPrefs() { //loads settings if it finds a save file containing the settings + //Gameplay if(FlxG.save.data.controllerMode != null) { controllerMode = FlxG.save.data.controllerMode; } @@ -530,153 +552,129 @@ class ClientPrefs { //default settings if it can't find a save file containing y trollMaxSpeed = FlxG.save.data.trollMaxSpeed; } - if(FlxG.save.data.showFPS != null) { - showFPS = FlxG.save.data.showFPS; - if(Main.fpsVar != null) { - Main.fpsVar.visible = showFPS; - } + //Visuals & UI + if(FlxG.save.data.noteSplashes != null) { + noteSplashes = FlxG.save.data.noteSplashes; } - if(FlxG.save.data.flashing != null) { - flashing = FlxG.save.data.flashing; + if(FlxG.save.data.oppNoteSplashes != null) { + oppNoteSplashes = FlxG.save.data.oppNoteSplashes; } - if(FlxG.save.data.debugInfo != null) { - debugInfo = FlxG.save.data.debugInfo; + if(FlxG.save.data.showNPS != null) { + showNPS = FlxG.save.data.showNPS; } - if(FlxG.save.data.scoreTxtSize != null) { - scoreTxtSize = FlxG.save.data.scoreTxtSize; + if(FlxG.save.data.maxSplashLimit != null) { + maxSplashLimit = FlxG.save.data.maxSplashLimit; } - if(FlxG.save.data.missRating != null) { - missRating = FlxG.save.data.missRating; + if(FlxG.save.data.oppNoteAlpha != null) { + oppNoteAlpha = FlxG.save.data.oppNoteAlpha; } - if(FlxG.save.data.progAudioLoad != null) { - progAudioLoad = FlxG.save.data.progAudioLoad; + if(FlxG.save.data.hideHud != null) { + hideHud = FlxG.save.data.hideHud; } - if(FlxG.save.data.noteColorStyle != null) { - noteColorStyle = FlxG.save.data.noteColorStyle; + if(FlxG.save.data.hideScore != null) { + hideScore = FlxG.save.data.hideScore; } - if(FlxG.save.data.rateNameStuff != null) { - rateNameStuff = FlxG.save.data.rateNameStuff; + if(FlxG.save.data.tauntOnGo != null) { + tauntOnGo = FlxG.save.data.tauntOnGo; + } + if(FlxG.save.data.showRendered != null) { + showRendered = FlxG.save.data.showRendered; + } + if(FlxG.save.data.showcaseMode != null) { + showcaseMode = FlxG.save.data.showcaseMode; } if(FlxG.save.data.showMaxScore != null) { showMaxScore = FlxG.save.data.showMaxScore; } - if(FlxG.save.data.maxSplashLimit != null) { - maxSplashLimit = FlxG.save.data.maxSplashLimit; + if(FlxG.save.data.timeBounce != null) { + timeBounce = FlxG.save.data.timeBounce; } - if(FlxG.save.data.noGunsRNG != null) { - noGunsRNG = FlxG.save.data.noGunsRNG; + if(FlxG.save.data.lengthIntro != null) { + lengthIntro = FlxG.save.data.lengthIntro; } - if(FlxG.save.data.iconBopWhen != null) { - iconBopWhen = FlxG.save.data.iconBopWhen; + if(FlxG.save.data.timebarShowSpeed != null) { + timebarShowSpeed = FlxG.save.data.timebarShowSpeed; } - if(FlxG.save.data.denpaDrainBug != null) { - denpaDrainBug = FlxG.save.data.denpaDrainBug; + if(FlxG.save.data.missRating != null) { + missRating = FlxG.save.data.missRating; } - if(FlxG.save.data.ogHPColor != null) { - ogHPColor = FlxG.save.data.ogHPColor; + if(FlxG.save.data.resultsScreen != null) { + resultsScreen = FlxG.save.data.resultsScreen; } - if(FlxG.save.data.showRamUsage != null) { - showRamUsage = FlxG.save.data.showRamUsage; + if(FlxG.save.data.compactNumbers != null) { + compactNumbers = FlxG.save.data.compactNumbers; } - if(FlxG.save.data.showMaxRamUsage != null) { - showMaxRamUsage = FlxG.save.data.showMaxRamUsage; + if(FlxG.save.data.scoreTxtSize != null) { + scoreTxtSize = FlxG.save.data.scoreTxtSize; } - if(FlxG.save.data.colorQuants != null) { - colorQuants = FlxG.save.data.colorQuants; + if(FlxG.save.data.noteColorStyle != null) { + noteColorStyle = FlxG.save.data.noteColorStyle; } - if (FlxG.save.data.resolution != null) { - resolution = FlxG.save.data.resolution; - #if desktop - var resolutionValue = cast(ClientPrefs.resolution, String); - - if (resolutionValue != null) { - var parts = resolutionValue.split('x'); - - if (parts.length == 2) { - var width = Std.parseInt(parts[0]); - var height = Std.parseInt(parts[1]); - - if (width != null && height != null) { - CoolUtil.resetResScale(width, height); - FlxG.resizeGame(width, height); - lime.app.Application.current.window.width = width; - lime.app.Application.current.window.height = height; - } - } - } - #end + if(FlxG.save.data.enableColorShader != null) { + enableColorShader = FlxG.save.data.enableColorShader; } - if(FlxG.save.data.pbRControls != null) { - pbRControls = FlxG.save.data.pbRControls; + if(FlxG.save.data.iconBopWhen != null) { + iconBopWhen = FlxG.save.data.iconBopWhen; } if(FlxG.save.data.cameraPanning != null) { cameraPanning = FlxG.save.data.cameraPanning; } - if(FlxG.save.data.tipTexts != null) { - tipTexts = FlxG.save.data.tipTexts; - } - if(FlxG.save.data.botTxtFade != null) { - botTxtFade = FlxG.save.data.botTxtFade; - } - if(FlxG.save.data.enableGC != null) { - enableGC = FlxG.save.data.enableGC; - } - if(FlxG.save.data.songLoading != null) { - songLoading = FlxG.save.data.songLoading; - } if(FlxG.save.data.panIntensity != null) { panIntensity = FlxG.save.data.panIntensity; } - if(FlxG.save.data.playerLightStrum != null) { - playerLightStrum = FlxG.save.data.playerLightStrum; + if(FlxG.save.data.rateNameStuff != null) { + rateNameStuff = FlxG.save.data.rateNameStuff; } - if(FlxG.save.data.rainbowFPS != null) { - rainbowFPS = FlxG.save.data.rainbowFPS; + if(FlxG.save.data.goldSickSFC != null) { + goldSickSFC = FlxG.save.data.goldSickSFC; } - if(FlxG.save.data.enableColorShader != null) { - enableColorShader = FlxG.save.data.enableColorShader; + if(FlxG.save.data.colorRatingHit != null) { + colorRatingHit = FlxG.save.data.colorRatingHit; } - if(FlxG.save.data.showNPS != null) { - showNPS = FlxG.save.data.showNPS; + if(FlxG.save.data.colorRatingFC != null) { + colorRatingFC = FlxG.save.data.colorRatingFC; } - if(FlxG.save.data.resultsScreen != null) { - resultsScreen = FlxG.save.data.resultsScreen; + if(FlxG.save.data.marvRateColor != null) { + marvRateColor = FlxG.save.data.marvRateColor; } - if(FlxG.save.data.globalAntialiasing != null) { - globalAntialiasing = FlxG.save.data.globalAntialiasing; + if(FlxG.save.data.smoothHealth != null) { + smoothHealth = FlxG.save.data.smoothHealth; } - if(FlxG.save.data.ratingType != null) { - ratingType = FlxG.save.data.ratingType; + if(FlxG.save.data.smoothHPBug != null) { + smoothHPBug = FlxG.save.data.smoothHPBug; } - if(FlxG.save.data.charsAndBG != null) { - charsAndBG = FlxG.save.data.charsAndBG; + if(FlxG.save.data.noBopLimit != null) { + noBopLimit = FlxG.save.data.noBopLimit; } - if(FlxG.save.data.showcaseMode != null) { - showcaseMode = FlxG.save.data.showcaseMode; + if(FlxG.save.data.denpaDrainBug != null) { + denpaDrainBug = FlxG.save.data.denpaDrainBug; } - if(FlxG.save.data.compactNumbers != null) { - compactNumbers = FlxG.save.data.compactNumbers; + if(FlxG.save.data.ogHPColor != null) { + ogHPColor = FlxG.save.data.ogHPColor; } - if(FlxG.save.data.npsWithSpeed != null) { - npsWithSpeed = FlxG.save.data.npsWithSpeed; + if(FlxG.save.data.doubleGhost != null) { + doubleGhost = FlxG.save.data.doubleGhost; + } + if(FlxG.save.data.doubleGhostZoom != null) { + doubleGhostZoom = FlxG.save.data.doubleGhostZoom; } - if(FlxG.save.data.skipResultsScreen != null) { - skipResultsScreen = FlxG.save.data.skipResultsScreen; + if(FlxG.save.data.timeBarType != null) { + timeBarType = FlxG.save.data.timeBarType; } - if(FlxG.save.data.cacheOnGPU != null) { - cacheOnGPU = FlxG.save.data.cacheOnGPU; + if(FlxG.save.data.scoreStyle != null) { + scoreStyle = FlxG.save.data.scoreStyle; } - if(FlxG.save.data.bfIconStyle != null) { - bfIconStyle = FlxG.save.data.bfIconStyle; + if(FlxG.save.data.timeBarStyle != null) { + timeBarStyle = FlxG.save.data.timeBarStyle; } - if(FlxG.save.data.autosaveCharts != null) { - autosaveCharts = FlxG.save.data.autosaveCharts; + if(FlxG.save.data.healthBarStyle != null) { + healthBarStyle = FlxG.save.data.healthBarStyle; } - if(FlxG.save.data.discordRPC != null) { - discordRPC = FlxG.save.data.discordRPC; + if(FlxG.save.data.watermarkStyle != null) { + watermarkStyle = FlxG.save.data.watermarkStyle; } - if(FlxG.save.data.daMenuMusic != null) { - daMenuMusic = FlxG.save.data.daMenuMusic; + if(FlxG.save.data.botTxtStyle != null) { + botTxtStyle = FlxG.save.data.botTxtStyle; } if(FlxG.save.data.strumLitStyle != null) { strumLitStyle = FlxG.save.data.strumLitStyle; @@ -684,104 +682,147 @@ class ClientPrefs { //default settings if it can't find a save file containing y if(FlxG.save.data.noteStyleThing != null) { noteStyleThing = FlxG.save.data.noteStyleThing; } - if(FlxG.save.data.timeBounce != null) { - timeBounce = FlxG.save.data.timeBounce; - } - if(FlxG.save.data.lengthIntro != null) { - lengthIntro = FlxG.save.data.lengthIntro; - } - if(FlxG.save.data.wrongCameras != null) { - wrongCameras = FlxG.save.data.wrongCameras; + if(FlxG.save.data.bfIconStyle != null) { + bfIconStyle = FlxG.save.data.bfIconStyle; } - if(FlxG.save.data.dynamicSpawnTime != null) { - dynamicSpawnTime = FlxG.save.data.dynamicSpawnTime; + if(FlxG.save.data.ratingType != null) { + ratingType = FlxG.save.data.ratingType; } - if(FlxG.save.data.evenLessBotLag != null) { - evenLessBotLag = FlxG.save.data.evenLessBotLag; + if(FlxG.save.data.iconBounceType != null) { + iconBounceType = FlxG.save.data.iconBounceType; } - if(FlxG.save.data.doubleGhostZoom != null) { - doubleGhostZoom = FlxG.save.data.doubleGhostZoom; + if(FlxG.save.data.splashType != null) { + splashType = FlxG.save.data.splashType; } - if(FlxG.save.data.memLeaks != null) { - memLeaks = FlxG.save.data.memLeaks; + if(FlxG.save.data.longHPBar != null) { + longHPBar = FlxG.save.data.longHPBar; } if(FlxG.save.data.longFCName != null) { longFCName = FlxG.save.data.longFCName; } - if(FlxG.save.data.oppNoteAlpha != null) { - oppNoteAlpha = FlxG.save.data.oppNoteAlpha; + if(FlxG.save.data.healthDisplay != null) { + healthDisplay = FlxG.save.data.healthDisplay; } - if(FlxG.save.data.noPausing != null) { - noPausing = FlxG.save.data.noPausing; + if(FlxG.save.data.opponentRateCount != null) { + opponentRateCount = FlxG.save.data.opponentRateCount; } - if(FlxG.save.data.marvRateColor != null) { - marvRateColor = FlxG.save.data.marvRateColor; + if(FlxG.save.data.showMS != null) { + showMS = FlxG.save.data.showMS; } - if(FlxG.save.data.noteSplashes != null) { - noteSplashes = FlxG.save.data.noteSplashes; + if(FlxG.save.data.wrongCameras != null) { + wrongCameras = FlxG.save.data.wrongCameras; } - if(FlxG.save.data.oppNoteSplashes != null) { - oppNoteSplashes = FlxG.save.data.oppNoteSplashes; + if(FlxG.save.data.flashing != null) { + flashing = FlxG.save.data.flashing; } - if(FlxG.save.data.colorRatingHit != null) { - colorRatingHit = FlxG.save.data.colorRatingHit; + if(FlxG.save.data.camZooms != null) { + camZooms = FlxG.save.data.camZooms; + } + if(FlxG.save.data.ratingCounter != null) { + ratingCounter = FlxG.save.data.ratingCounter; + } + if(FlxG.save.data.showNotes != null) { + showNotes = FlxG.save.data.showNotes; + } + if(FlxG.save.data.scoreZoom != null) { + scoreZoom = FlxG.save.data.scoreZoom; + } + if(FlxG.save.data.healthBarAlpha != null) { + healthBarAlpha = FlxG.save.data.healthBarAlpha; + } + if(FlxG.save.data.laneUnderlay != null) { + laneUnderlay = FlxG.save.data.laneUnderlay; + } + if(FlxG.save.data.laneUnderlayAlpha != null) { + laneUnderlayAlpha = FlxG.save.data.laneUnderlayAlpha; + } + if(FlxG.save.data.showFPS != null) { + showFPS = FlxG.save.data.showFPS; + if(Main.fpsVar != null) { + Main.fpsVar.visible = showFPS; + } } if(FlxG.save.data.randomBotplayText != null) { randomBotplayText = FlxG.save.data.randomBotplayText; } - if(FlxG.save.data.splashType != null) { - splashType = FlxG.save.data.splashType; + if(FlxG.save.data.botTxtFade != null) { + botTxtFade = FlxG.save.data.botTxtFade; } - if(FlxG.save.data.tauntOnGo != null) { - tauntOnGo = FlxG.save.data.tauntOnGo; + if(FlxG.save.data.pauseMusic != null) { + pauseMusic = FlxG.save.data.pauseMusic; } - if(FlxG.save.data.noteSpawnTime != null) { - noteSpawnTime = FlxG.save.data.noteSpawnTime; + if(FlxG.save.data.daMenuMusic != null) { + daMenuMusic = FlxG.save.data.daMenuMusic; } - if(FlxG.save.data.timebarShowSpeed != null) { - timebarShowSpeed = FlxG.save.data.timebarShowSpeed; + if (FlxG.save.data.checkForUpdates != null) + { + checkForUpdates = FlxG.save.data.checkForUpdates; } - if(FlxG.save.data.opponentRateCount != null) { - opponentRateCount = FlxG.save.data.opponentRateCount; + if (FlxG.save.data.comboStacking != null) + comboStacking = FlxG.save.data.comboStacking; + + if(FlxG.save.data.showRamUsage != null) { + showRamUsage = FlxG.save.data.showRamUsage; } - if(FlxG.save.data.healthDisplay != null) { - healthDisplay = FlxG.save.data.healthDisplay; + if(FlxG.save.data.showMaxRamUsage != null) { + showMaxRamUsage = FlxG.save.data.showMaxRamUsage; } - if(FlxG.save.data.noBopLimit != null) { - noBopLimit = FlxG.save.data.noBopLimit; + if(FlxG.save.data.debugInfo != null) { + debugInfo = FlxG.save.data.debugInfo; } - if(FlxG.save.data.lowQuality != null) { - lowQuality = FlxG.save.data.lowQuality; + if(FlxG.save.data.npsWithSpeed != null) { + npsWithSpeed = FlxG.save.data.npsWithSpeed; } - if(FlxG.save.data.smoothHPBug != null) { - smoothHPBug = FlxG.save.data.smoothHPBug; + if(FlxG.save.data.tipTexts != null) { + tipTexts = FlxG.save.data.tipTexts; } - if(FlxG.save.data.ratingCounter != null) { - ratingCounter = FlxG.save.data.ratingCounter; + if(FlxG.save.data.discordRPC != null) { + discordRPC = FlxG.save.data.discordRPC; } - if(FlxG.save.data.longHPBar != null) { - longHPBar = FlxG.save.data.longHPBar; + + //Graphics + if(FlxG.save.data.lowQuality != null) { + lowQuality = FlxG.save.data.lowQuality; + } + if(FlxG.save.data.globalAntialiasing != null) { + globalAntialiasing = FlxG.save.data.globalAntialiasing; } if(FlxG.save.data.shaders != null) { shaders = FlxG.save.data.shaders; } - if(FlxG.save.data.goldSickSFC != null) { - goldSickSFC = FlxG.save.data.goldSickSFC; - } - if(FlxG.save.data.botLightStrum != null) { - botLightStrum = FlxG.save.data.botLightStrum; + if(FlxG.save.data.cacheOnGPU != null) { + cacheOnGPU = FlxG.save.data.cacheOnGPU; } - if(FlxG.save.data.comboPopup != null) { - comboPopup = FlxG.save.data.comboPopup; + if(FlxG.save.data.progAudioLoad != null) { + progAudioLoad = FlxG.save.data.progAudioLoad; } - if(FlxG.save.data.showMS != null) { - showMS = FlxG.save.data.showMS; + if(FlxG.save.data.dynamicSpawnTime != null) { + dynamicSpawnTime = FlxG.save.data.dynamicSpawnTime; } - if(FlxG.save.data.ratesAndCombo != null) { - ratesAndCombo = FlxG.save.data.ratesAndCombo; + if(FlxG.save.data.noteSpawnTime != null) { + noteSpawnTime = FlxG.save.data.noteSpawnTime; } - if(FlxG.save.data.opponentLightStrum != null) { - opponentLightStrum = FlxG.save.data.opponentLightStrum; + if (FlxG.save.data.resolution != null) { + resolution = FlxG.save.data.resolution; + #if desktop + var resolutionValue = cast(ClientPrefs.resolution, String); + + if (resolutionValue != null) { + var parts = resolutionValue.split('x'); + + if (parts.length == 2) { + var width = Std.parseInt(parts[0]); + var height = Std.parseInt(parts[1]); + + if (width != null && height != null) { + CoolUtil.resetResScale(width, height); + FlxG.resizeGame(width, height); + lime.app.Application.current.window.width = width; + lime.app.Application.current.window.height = height; + } + } + } + #end } if(FlxG.save.data.framerate != null) { framerate = FlxG.save.data.framerate; @@ -793,59 +834,56 @@ class ClientPrefs { //default settings if it can't find a save file containing y FlxG.updateFramerate = framerate; } } - /*if(FlxG.save.data.cursing != null) { - cursing = FlxG.save.data.cursing; + + //Optimization + if(FlxG.save.data.charsAndBG != null) { + charsAndBG = FlxG.save.data.charsAndBG; } - if(FlxG.save.data.violence != null) { - violence = FlxG.save.data.violence; - }*/ - if(FlxG.save.data.camZooms != null) { - camZooms = FlxG.save.data.camZooms; + if(FlxG.save.data.enableGC != null) { + enableGC = FlxG.save.data.enableGC; } - if(FlxG.save.data.showNotes != null) { - showNotes = FlxG.save.data.showNotes; + if(FlxG.save.data.opponentLightStrum != null) { + opponentLightStrum = FlxG.save.data.opponentLightStrum; } - if(FlxG.save.data.doubleGhost != null) { - doubleGhost = FlxG.save.data.doubleGhost; + if(FlxG.save.data.botLightStrum != null) { + botLightStrum = FlxG.save.data.botLightStrum; } - if(FlxG.save.data.hideHud != null) { - hideHud = FlxG.save.data.hideHud; + if(FlxG.save.data.playerLightStrum != null) { + playerLightStrum = FlxG.save.data.playerLightStrum; } - if(FlxG.save.data.hideScore != null) { - hideScore = FlxG.save.data.hideScore; + if(FlxG.save.data.ratesAndCombo != null) { + ratesAndCombo = FlxG.save.data.ratesAndCombo; } - if(FlxG.save.data.crossFadeData != null) { - crossFadeData = FlxG.save.data.crossFadeData; + if(FlxG.save.data.comboPopup != null) { + comboPopup = FlxG.save.data.comboPopup; + } + if(FlxG.save.data.songLoading != null) { + songLoading = FlxG.save.data.songLoading; } if(FlxG.save.data.lessBotLag != null) { lessBotLag = FlxG.save.data.lessBotLag; } - if(FlxG.save.data.smoothHealth != null) { - smoothHealth = FlxG.save.data.smoothHealth; - } - if(FlxG.save.data.timeBarType != null) { - timeBarType = FlxG.save.data.timeBarType; - } - if(FlxG.save.data.hudType != null) { - hudType = FlxG.save.data.hudType; - } - if(FlxG.save.data.iconBounceType != null) { - iconBounceType = FlxG.save.data.iconBounceType; - } - if(FlxG.save.data.scoreZoom != null) { - scoreZoom = FlxG.save.data.scoreZoom; + + //Secret Debug + if(FlxG.save.data.noGunsRNG != null) { + noGunsRNG = FlxG.save.data.noGunsRNG; } - if(FlxG.save.data.healthBarAlpha != null) { - healthBarAlpha = FlxG.save.data.healthBarAlpha; + if(FlxG.save.data.pbRControls != null) { + pbRControls = FlxG.save.data.pbRControls; } - if(FlxG.save.data.laneUnderlay != null) { - laneUnderlay = FlxG.save.data.laneUnderlay; + if(FlxG.save.data.rainbowFPS != null) { + rainbowFPS = FlxG.save.data.rainbowFPS; } - if(FlxG.save.data.laneUnderlayAlpha != null) { - laneUnderlayAlpha = FlxG.save.data.laneUnderlayAlpha; + + //Unused + /*if(FlxG.save.data.cursing != null) { + cursing = FlxG.save.data.cursing; } - if(FlxG.save.data.colorRatingFC != null) { - colorRatingFC = FlxG.save.data.colorRatingFC; + if(FlxG.save.data.violence != null) { + violence = FlxG.save.data.violence; + }*/ + if(FlxG.save.data.crossFadeData != null) { + crossFadeData = FlxG.save.data.crossFadeData; } //Offset and Window stuff @@ -882,9 +920,6 @@ class ClientPrefs { //default settings if it can't find a save file containing y arrowHSV = FlxG.save.data.arrowHSV; } - if(FlxG.save.data.pauseMusic != null) { - pauseMusic = FlxG.save.data.pauseMusic; - } if(FlxG.save.data.gameplaySettings != null) { var savedMap:Map = FlxG.save.data.gameplaySettings; @@ -903,15 +938,6 @@ class ClientPrefs { //default settings if it can't find a save file containing y { FlxG.sound.muted = FlxG.save.data.mute; } - if (FlxG.save.data.checkForUpdates != null) - { - checkForUpdates = FlxG.save.data.checkForUpdates; - } - if(FlxG.save.data.showRendered != null) { - showRendered = FlxG.save.data.showRendered; - } - if (FlxG.save.data.comboStacking != null) - comboStacking = FlxG.save.data.comboStacking; //Game Renderer if(FlxG.save.data.ffmpegMode != null) { diff --git a/source/FunkinLua.hx b/source/FunkinLua.hx index bb34ed34894..90fa1be6450 100644 --- a/source/FunkinLua.hx +++ b/source/FunkinLua.hx @@ -1575,10 +1575,10 @@ class FunkinLua { Lua_helper.add_callback(lua, "precacheMusic", function(name:String) { CoolUtil.precacheMusic(name); }); - Lua_helper.add_callback(lua, "triggerEvent", function(name:String, arg1:Dynamic, arg2:Dynamic) { + Lua_helper.add_callback(lua, "triggerEvent", function(name:String, arg1:Dynamic, arg2:Dynamic, strumTime:Float) { var value1:String = arg1; var value2:String = arg2; - PlayState.instance.triggerEventNote(name, value1, value2); + PlayState.instance.triggerEventNote(name, value1, value2, strumTime); //trace('Triggered event: ' + name + ', ' + value1 + ', ' + value2); return true; }); diff --git a/source/MusicBeatState.hx b/source/MusicBeatState.hx index 79581e0a927..1e4514aebd2 100644 --- a/source/MusicBeatState.hx +++ b/source/MusicBeatState.hx @@ -81,6 +81,10 @@ class MusicBeatState extends FlxUIState FlxG.autoPause = ClientPrefs.autoPause; + stagesFunc(function(stage:BaseStage) { + stage.update(elapsed); + }); + super.update(elapsed); Application.current.window.title = windowNamePrefix + windowNameSuffix + windowNameSuffix2; } @@ -150,22 +154,48 @@ class MusicBeatState extends FlxUIState onOutroComplete(); } + public var stages:Array = []; //runs whenever the game hits a step public function stepHit():Void { //trace('Step: ' + curStep); + stagesFunc(function(stage:BaseStage) { + stage.curStep = curStep; + stage.curDecStep = curDecStep; + stage.stepHit(); + }); } //runs whenever the game hits a beat public function beatHit():Void { //trace('Beat: ' + curBeat); + stagesFunc(function(stage:BaseStage) { + stage.curBeat = curBeat; + stage.curDecBeat = curDecBeat; + stage.beatHit(); + }); } //runs whenever the game hits a section public function sectionHit():Void { //trace('Section: ' + curSection + ', Beat: ' + curBeat + ', Step: ' + curStep); + stagesFunc(function(stage:BaseStage) { + stage.curSection = curSection; + stage.sectionHit(); + }); + } + + public static function getState():MusicBeatState { + return cast (FlxG.state, MusicBeatState); + } + + function stagesFunc(func:BaseStage->Void) + { + for (stage in stages) + if(stage != null && stage.exists && stage.active) + func(stage); } function getBeatsOnSection() diff --git a/source/Paths.hx b/source/Paths.hx index f4b5fdbb9b7..15da14ca487 100644 --- a/source/Paths.hx +++ b/source/Paths.hx @@ -822,4 +822,87 @@ class Paths return list; } #end + + #if flxanimate + public static function loadAnimateAtlas(spr:FlxAnimate, folderOrImg:Dynamic, spriteJson:Dynamic = null, animationJson:Dynamic = null) + { + var changedAnimJson = false; + var changedAtlasJson = false; + var changedImage = false; + + if(spriteJson != null) + { + changedAtlasJson = true; + spriteJson = File.getContent(spriteJson); + } + + if(animationJson != null) + { + changedAnimJson = true; + animationJson = File.getContent(animationJson); + } + + // is folder or image path + if(Std.isOfType(folderOrImg, String)) + { + var originalPath:String = folderOrImg; + for (i in 0...10) + { + var st:String = '$i'; + if(i == 0) st = ''; + + if(!changedAtlasJson) + { + spriteJson = getTextFromFile('images/$originalPath/spritemap$st.json'); + if(spriteJson != null) + { + //trace('found Sprite Json'); + changedImage = true; + changedAtlasJson = true; + folderOrImg = Paths.image('$originalPath/spritemap$st'); + break; + } + } + else if(Paths.fileExists('images/$originalPath/spritemap$st.png', IMAGE)) + { + //trace('found Sprite PNG'); + changedImage = true; + folderOrImg = Paths.image('$originalPath/spritemap$st'); + break; + } + } + + if(!changedImage) + { + //trace('Changing folderOrImg to FlxGraphic'); + changedImage = true; + folderOrImg = Paths.image(originalPath); + } + + if(!changedAnimJson) + { + //trace('found Animation Json'); + changedAnimJson = true; + animationJson = getTextFromFile('images/$originalPath/Animation.json'); + } + } + + //trace(folderOrImg); + //trace(spriteJson); + //trace(animationJson); + spr.loadAtlasEx(folderOrImg, spriteJson, animationJson); + } + + /*private static function getContentFromFile(path:String):String + { + var onAssets:Bool = false; + var path:String = Paths.getPath(path, TEXT, true); + if(FileSystem.exists(path) || (onAssets = true && Assets.exists(path, TEXT))) + { + //trace('Found text: $path'); + return !onAssets ? File.getContent(path) : Assets.getText(path); + } + return null; + }*/ + #end } diff --git a/source/PlayState.hx b/source/PlayState.hx index 1dd23f8bcd1..ce676d3b24c 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -398,20 +398,7 @@ class PlayState extends MusicBeatState var dialogueJson:DialogueFile = null; var EngineWatermark:FlxText; - var dadbattleBlack:BGSprite; - var dadbattleLight:BGSprite; - var dadbattleSmokes:FlxSpriteGroup; - - var halloweenBG:BGSprite; - var halloweenWhite:BGSprite; - - final phillyLightsColors:Array = [0xFF31A2FD, 0xFF31FD8C, 0xFFFB33F5, 0xFFFD4531, 0xFFFBA633]; - var phillyWindow:BGSprite; - var phillyStreet:BGSprite; - var phillyTrain:BGSprite; - var blammedLightsBlack:FlxSprite; - var phillyWindowEvent:BGSprite; - var trainSound:FlxSound; + public var compactCombo:String; public var compactScore:String; public var compactMisses:String; @@ -419,41 +406,18 @@ class PlayState extends MusicBeatState public var compactMaxCombo:String; public var compactTotalPlays:String; - var phillyGlowGradient:PhillyGlow.PhillyGlowGradient; - var phillyGlowParticles:FlxTypedGroup; - - var limoKillingState:Int = 0; - var limo:BGSprite; - var limoMetalPole:BGSprite; - var limoLight:BGSprite; - var limoCorpse:BGSprite; - var limoCorpseTwo:BGSprite; - var bgLimo:BGSprite; - var grpLimoParticles:FlxTypedGroup; - var grpLimoDancers:FlxTypedGroup; - var fastCar:BGSprite; - public static var screenshader:Shaders.PulseEffectAlt = new PulseEffectAlt(); var disableTheTripper:Bool = false; var disableTheTripperAt:Int; - var upperBoppers:BGSprite; - var bottomBoppers:BGSprite; - var santa:BGSprite; var heyTimer:Float; - var bgGirls:BackgroundGirls; - var wiggleShit:WiggleEffect = new WiggleEffect(); - var bgGhouls:BGSprite; public var singDurMult:Int = 1; - public var disableCoolHealthTween:Bool = false; + public static var disableCoolHealthTween:Bool = false; public var iconsShouldGoUp:Bool = false; - var tankWatchtower:BGSprite; - var tankGround:BGSprite; - var tankmanRun:FlxTypedGroup; var foregroundSprites:FlxTypedGroup; //ms timing popup shit @@ -538,6 +502,8 @@ class PlayState extends MusicBeatState private var keysArray:Array; private var controlArray:Array; + public var songName:String; + var precacheList:Map = new Map(); // stores the last judgement object @@ -583,6 +549,10 @@ class PlayState extends MusicBeatState var noCapture = ClientPrefs.noCapture; static var capture:Screenshot = new Screenshot(); + // Callbacks for stages + public var startCallback:Void->Void = null; + public var endCallback:Void->Void = null; + override public function create() { //Stops playing on a height that isn't divisible by 2 @@ -795,7 +765,7 @@ class PlayState extends MusicBeatState judgeCountStrings = map.get(ClientPrefs.ratingType).judgeCount; GameOverSubstate.resetVariables(); - var songName:String = Paths.formatToSongPath(SONG.song); + songName = Paths.formatToSongPath(SONG.song); curStage = (!ClientPrefs.charsAndBG ? "" : SONG.stage); //trace('stage is: ' + curStage); if(SONG.stage == null || SONG.stage.length < 1) { @@ -870,325 +840,20 @@ class PlayState extends MusicBeatState dadGroup = new FlxSpriteGroup(DAD_X, DAD_Y); gfGroup = new FlxSpriteGroup(GF_X, GF_Y); + startCallback = startCountdown; + endCallback = endSong; + switch (curStage) { - case 'stage': //Week 1 - var bg:BGSprite = new BGSprite('stageback', -600, -200, 0.9, 0.9); - add(bg); - - var stageFront:BGSprite = new BGSprite('stagefront', -650, 600, 0.9, 0.9); - stageFront.setGraphicSize(Std.int(stageFront.width * 1.1)); - stageFront.updateHitbox(); - add(stageFront); - if(!ClientPrefs.lowQuality) { - var stageLight:BGSprite = new BGSprite('stage_light', -125, -100, 0.9, 0.9); - stageLight.setGraphicSize(Std.int(stageLight.width * 1.1)); - stageLight.updateHitbox(); - add(stageLight); - var stageLight:BGSprite = new BGSprite('stage_light', 1225, -100, 0.9, 0.9); - stageLight.setGraphicSize(Std.int(stageLight.width * 1.1)); - stageLight.updateHitbox(); - stageLight.flipX = true; - add(stageLight); - - var stageCurtains:BGSprite = new BGSprite('stagecurtains', -500, -300, 1.3, 1.3); - stageCurtains.setGraphicSize(Std.int(stageCurtains.width * 0.9)); - stageCurtains.updateHitbox(); - add(stageCurtains); - } - dadbattleSmokes = new FlxSpriteGroup(); //troll'd - - case 'spooky': //Week 2 - if(!ClientPrefs.lowQuality) { - halloweenBG = new BGSprite('halloween_bg', -200, -100, ['halloweem bg0', 'halloweem bg lightning strike']); - } else { - halloweenBG = new BGSprite('halloween_bg_low', -200, -100); - } - add(halloweenBG); - - halloweenWhite = new BGSprite(null, -800, -400, 0, 0); - halloweenWhite.makeGraphic(Std.int(FlxG.width * 2), Std.int(FlxG.height * 2), FlxColor.WHITE); - halloweenWhite.alpha = 0; - halloweenWhite.blend = ADD; - - //PRECACHE SOUNDS - precacheList.set('thunder_1', 'sound'); - precacheList.set('thunder_2', 'sound'); - - case 'philly': //Week 3 - if(!ClientPrefs.lowQuality) { - var bg:BGSprite = new BGSprite('philly/sky', -100, 0, 0.1, 0.1); - add(bg); - } - - var city:BGSprite = new BGSprite('philly/city', -10, 0, 0.3, 0.3); - city.setGraphicSize(Std.int(city.width * 0.85)); - city.updateHitbox(); - add(city); - - phillyWindow = new BGSprite('philly/window', city.x, city.y, 0.3, 0.3); - phillyWindow.setGraphicSize(Std.int(phillyWindow.width * 0.85)); - phillyWindow.updateHitbox(); - add(phillyWindow); - phillyWindow.alpha = 0; - - if(!ClientPrefs.lowQuality) { - var streetBehind:BGSprite = new BGSprite('philly/behindTrain', -40, 50); - add(streetBehind); - } - - phillyTrain = new BGSprite('philly/train', 2000, 360); - add(phillyTrain); - - trainSound = new FlxSound().loadEmbedded(Paths.sound('train_passes')); - FlxG.sound.list.add(trainSound); - - phillyStreet = new BGSprite('philly/street', -40, 50); - add(phillyStreet); - - case 'limo': //Week 4 - var skyBG:BGSprite = new BGSprite('limo/limoSunset', -120, -50, 0.1, 0.1); - add(skyBG); - - if(!ClientPrefs.lowQuality) { - limoMetalPole = new BGSprite('gore/metalPole', -500, 220, 0.4, 0.4); - add(limoMetalPole); - - bgLimo = new BGSprite('limo/bgLimo', -150, 480, 0.4, 0.4, ['background limo pink'], true); - add(bgLimo); - - limoCorpse = new BGSprite('gore/noooooo', -500, limoMetalPole.y - 130, 0.4, 0.4, ['Henchmen on rail'], true); - add(limoCorpse); - - limoCorpseTwo = new BGSprite('gore/noooooo', -500, limoMetalPole.y, 0.4, 0.4, ['henchmen death'], true); - add(limoCorpseTwo); - - grpLimoDancers = new FlxTypedGroup(); - add(grpLimoDancers); - - for (i in 0...5) - { - var dancer:BackgroundDancer = new BackgroundDancer((370 * i) + 170, bgLimo.y - 400); - dancer.scrollFactor.set(0.4, 0.4); - grpLimoDancers.add(dancer); - } - - limoLight = new BGSprite('gore/coldHeartKiller', limoMetalPole.x - 180, limoMetalPole.y - 80, 0.4, 0.4); - add(limoLight); - - grpLimoParticles = new FlxTypedGroup(); - add(grpLimoParticles); - - //PRECACHE BLOOD - var particle:BGSprite = new BGSprite('gore/stupidBlood', -400, -400, 0.4, 0.4, ['blood'], false); - particle.alpha = 0.01; - grpLimoParticles.add(particle); - resetLimoKill(); - - //PRECACHE SOUND - precacheList.set('dancerdeath', 'sound'); - } - - limo = new BGSprite('limo/limoDrive', -120, 550, 1, 1, ['Limo stage'], true); - - fastCar = new BGSprite('limo/fastCarLol', -300, 160); - fastCar.active = true; - limoKillingState = 0; - - case 'mall': //Week 5 - Cocoa, Eggnog - var bg:BGSprite = new BGSprite('christmas/bgWalls', -1000, -500, 0.2, 0.2); - bg.setGraphicSize(Std.int(bg.width * 0.8)); - bg.updateHitbox(); - add(bg); - - if(!ClientPrefs.lowQuality) { - upperBoppers = new BGSprite('christmas/upperBop', -240, -90, 0.33, 0.33, ['Upper Crowd Bob']); - upperBoppers.setGraphicSize(Std.int(upperBoppers.width * 0.85)); - upperBoppers.updateHitbox(); - add(upperBoppers); - - var bgEscalator:BGSprite = new BGSprite('christmas/bgEscalator', -1100, -600, 0.3, 0.3); - bgEscalator.setGraphicSize(Std.int(bgEscalator.width * 0.9)); - bgEscalator.updateHitbox(); - add(bgEscalator); - } - - var tree:BGSprite = new BGSprite('christmas/christmasTree', 370, -250, 0.40, 0.40); - add(tree); - - bottomBoppers = new BGSprite('christmas/bottomBop', -300, 140, 0.9, 0.9, ['Bottom Level Boppers Idle']); - bottomBoppers.animation.addByPrefix('hey', 'Bottom Level Boppers HEY', 24, false); - bottomBoppers.setGraphicSize(Std.int(bottomBoppers.width * 1)); - bottomBoppers.updateHitbox(); - add(bottomBoppers); - - var fgSnow:BGSprite = new BGSprite('christmas/fgSnow', -600, 700); - add(fgSnow); - - santa = new BGSprite('christmas/santa', -840, 150, 1, 1, ['santa idle in fear']); - add(santa); - precacheList.set('Lights_Shut_off', 'sound'); - - case 'mallEvil': //Week 5 - Winter Horrorland - var bg:BGSprite = new BGSprite('christmas/evilBG', -400, -500, 0.2, 0.2); - bg.setGraphicSize(Std.int(bg.width * 0.8)); - bg.updateHitbox(); - add(bg); - - var evilTree:BGSprite = new BGSprite('christmas/evilTree', 300, -300, 0.2, 0.2); - add(evilTree); - - var evilSnow:BGSprite = new BGSprite('christmas/evilSnow', -200, 700); - add(evilSnow); - - case 'school': //Week 6 - Senpai, Roses - GameOverSubstate.deathSoundName = 'fnf_loss_sfx-pixel'; - GameOverSubstate.loopSoundName = 'gameOver-pixel'; - GameOverSubstate.endSoundName = 'gameOverEnd-pixel'; - GameOverSubstate.characterName = 'bf-pixel-dead'; - - var bgSky:BGSprite = new BGSprite('weeb/weebSky', 0, 0, 0.1, 0.1); - add(bgSky); - bgSky.antialiasing = false; - - var repositionShit = -200; - - var bgSchool:BGSprite = new BGSprite('weeb/weebSchool', repositionShit, 0, 0.6, 0.90); - add(bgSchool); - bgSchool.antialiasing = false; - - var bgStreet:BGSprite = new BGSprite('weeb/weebStreet', repositionShit, 0, 0.95, 0.95); - add(bgStreet); - bgStreet.antialiasing = false; - - var widShit = Std.int(bgSky.width * 6); - if(!ClientPrefs.lowQuality) { - var fgTrees:BGSprite = new BGSprite('weeb/weebTreesBack', repositionShit + 170, 130, 0.9, 0.9); - fgTrees.setGraphicSize(Std.int(widShit * 0.8)); - fgTrees.updateHitbox(); - add(fgTrees); - fgTrees.antialiasing = false; - } - - var bgTrees:FlxSprite = new FlxSprite(repositionShit - 380, -800); - bgTrees.frames = Paths.getPackerAtlas('weeb/weebTrees'); - bgTrees.animation.add('treeLoop', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18], 12); - bgTrees.animation.play('treeLoop'); - bgTrees.scrollFactor.set(0.85, 0.85); - add(bgTrees); - bgTrees.antialiasing = false; - - if(!ClientPrefs.lowQuality) { - var treeLeaves:BGSprite = new BGSprite('weeb/petals', repositionShit, -40, 0.85, 0.85, ['PETALS ALL'], true); - treeLeaves.setGraphicSize(widShit); - treeLeaves.updateHitbox(); - add(treeLeaves); - treeLeaves.antialiasing = false; - } - - bgSky.setGraphicSize(widShit); - bgSchool.setGraphicSize(widShit); - bgStreet.setGraphicSize(widShit); - bgTrees.setGraphicSize(Std.int(widShit * 1.4)); - - bgSky.updateHitbox(); - bgSchool.updateHitbox(); - bgStreet.updateHitbox(); - bgTrees.updateHitbox(); - - if(!ClientPrefs.lowQuality) { - bgGirls = new BackgroundGirls(-100, 190); - bgGirls.scrollFactor.set(0.9, 0.9); - - bgGirls.setGraphicSize(Std.int(bgGirls.width * daPixelZoom)); - bgGirls.updateHitbox(); - add(bgGirls); - } - - case 'schoolEvil': //Week 6 - Thorns - GameOverSubstate.deathSoundName = 'fnf_loss_sfx-pixel'; - GameOverSubstate.loopSoundName = 'gameOver-pixel'; - GameOverSubstate.endSoundName = 'gameOverEnd-pixel'; - GameOverSubstate.characterName = 'bf-pixel-dead'; - - var posX = 400; - var posY = 200; - if(!ClientPrefs.lowQuality) { - var bg:BGSprite = new BGSprite('weeb/animatedEvilSchool', posX, posY, 0.8, 0.9, ['background 2'], true); - bg.scale.set(6, 6); - bg.antialiasing = false; - add(bg); - - bgGhouls = new BGSprite('weeb/bgGhouls', -100, 190, 0.9, 0.9, ['BG freaks glitch instance'], false); - bgGhouls.setGraphicSize(Std.int(bgGhouls.width * daPixelZoom)); - bgGhouls.updateHitbox(); - bgGhouls.visible = false; - bgGhouls.antialiasing = false; - add(bgGhouls); - } else { - var bg:BGSprite = new BGSprite('weeb/animatedEvilSchool_low', posX, posY, 0.8, 0.9); - bg.scale.set(6, 6); - bg.antialiasing = false; - add(bg); - } - - case 'tank': //Week 7 - Ugh, Guns, Stress - var sky:BGSprite = new BGSprite('tankSky', -400, -400, 0, 0); - add(sky); - - if(!ClientPrefs.lowQuality) - { - var clouds:BGSprite = new BGSprite('tankClouds', FlxG.random.int(-700, -100), FlxG.random.int(-20, 20), 0.1, 0.1); - clouds.active = true; - clouds.velocity.x = FlxG.random.float(5, 15); - add(clouds); - - var mountains:BGSprite = new BGSprite('tankMountains', -300, -20, 0.2, 0.2); - mountains.setGraphicSize(Std.int(1.2 * mountains.width)); - mountains.updateHitbox(); - add(mountains); - - var buildings:BGSprite = new BGSprite('tankBuildings', -200, 0, 0.3, 0.3); - buildings.setGraphicSize(Std.int(1.1 * buildings.width)); - buildings.updateHitbox(); - add(buildings); - } - - var ruins:BGSprite = new BGSprite('tankRuins',-200,0,.35,.35); - ruins.setGraphicSize(Std.int(1.1 * ruins.width)); - ruins.updateHitbox(); - add(ruins); - - if(!ClientPrefs.lowQuality) - { - var smokeLeft:BGSprite = new BGSprite('smokeLeft', -200, -100, 0.4, 0.4, ['SmokeBlurLeft'], true); - add(smokeLeft); - var smokeRight:BGSprite = new BGSprite('smokeRight', 1100, -100, 0.4, 0.4, ['SmokeRight'], true); - add(smokeRight); - - tankWatchtower = new BGSprite('tankWatchtower', 100, 50, 0.5, 0.5, ['watchtower gradient color']); - add(tankWatchtower); - } - - tankGround = new BGSprite('tankRolling', 300, 300, 0.5, 0.5,['BG tank w lighting'], true); - add(tankGround); - - tankmanRun = new FlxTypedGroup(); - add(tankmanRun); - - var ground:BGSprite = new BGSprite('tankGround', -420, -150); - ground.setGraphicSize(Std.int(1.15 * ground.width)); - ground.updateHitbox(); - add(ground); - moveTank(); - - foregroundSprites = new FlxTypedGroup(); - foregroundSprites.add(new BGSprite('tank0', -500, 650, 1.7, 1.5, ['fg'])); - if(!ClientPrefs.lowQuality) foregroundSprites.add(new BGSprite('tank1', -300, 750, 2, 0.2, ['fg'])); - foregroundSprites.add(new BGSprite('tank2', 450, 940, 1.5, 1.5, ['foreground'])); - if(!ClientPrefs.lowQuality) foregroundSprites.add(new BGSprite('tank4', 1300, 900, 1.5, 1.5, ['fg'])); - foregroundSprites.add(new BGSprite('tank5', 1620, 700, 1.5, 1.5, ['fg'])); - if(!ClientPrefs.lowQuality) foregroundSprites.add(new BGSprite('tank3', 1300, 1200, 3.5, 2.5, ['fg'])); + case 'stage': new stages.StageWeek1(); //Week 1 + case 'spooky': new stages.Spooky(); //Week 2 + case 'philly': new stages.Philly(); //Week 3 + case 'limo': new stages.Limo(); //Week 4 + case 'mall': new stages.Mall(); //Week 5 - Cocoa, Eggnog + case 'mallEvil': new stages.MallEvil(); //Week 5 - Winter Horrorland + case 'school': new stages.School(); //Week 6 - Senpai, Roses + case 'schoolEvil': new stages.SchoolEvil(); //Week 6 - Thorns + case 'tank': new stages.Tank(); //Week 7 - Ugh, Guns, Stress } switch(Paths.formatToSongPath(SONG.song)) @@ -1212,21 +877,9 @@ class PlayState extends MusicBeatState add(dadGhost); } - // Shitty layering but whatev it works LOL - if (curStage == 'limo') - add(limo); - add(dadGroup); add(boyfriendGroup); - switch(curStage) - { - case 'spooky': - add(halloweenWhite); - case 'tank': - add(foregroundSprites); - } - #if LUA_ALLOWED luaDebugGroup = new FlxTypedGroup(); luaDebugGroup.cameras = [camOther]; @@ -1340,27 +993,6 @@ class PlayState extends MusicBeatState gf.scrollFactor.set(0.95, 0.95); gfGroup.add(gf); startCharacterLua(gf.curCharacter); - - if(gfVersion == 'pico-speaker') - { - if(!ClientPrefs.lowQuality) - { - var firstTank:TankmenBG = new TankmenBG(20, 500, true); - firstTank.resetShit(20, 600, true); - firstTank.strumTime = 10; - tankmanRun.add(firstTank); - - for (i in 0...TankmenBG.animationNotes.length) - { - if(FlxG.random.bool(16)) { - var tankBih = tankmanRun.recycle(TankmenBG); - tankBih.strumTime = TankmenBG.animationNotes[i][0]; - tankBih.resetShit(500, 200 + FlxG.random.int(50, 100), TankmenBG.animationNotes[i][1] < 2); - tankmanRun.add(tankBih); - } - } - } - } } var ratingQuoteStuff:Array = CoolUtil.coolTextFile(Paths.txt('ratingQuotes/' + ClientPrefs.rateNameStuff)); @@ -1436,20 +1068,10 @@ class PlayState extends MusicBeatState if(gf != null) gf.visible = false; } + stagesFunc(function(stage:BaseStage) stage.createPost()); callOnLuas('onCreate', []); - switch(curStage) - { - case 'limo': - resetFastCar(); - addBehindGF(fastCar); - - case 'schoolEvil': - var evilTrail = new FlxTrail(dad, null, 4, 24, 0.3, 0.069); //nice - addBehindDad(evilTrail); - } - var file:String = Paths.json(songName + '/dialogue'); //Checks for json/Psych Engine dialogue if (OpenFlAssets.exists(file)) { dialogueJson = DialogueBoxPsych.parseDialogue(file); @@ -1459,13 +1081,6 @@ class PlayState extends MusicBeatState if (OpenFlAssets.exists(file)) { dialogue = CoolUtil.coolTextFile(file); } - var doof:DialogueBox = new DialogueBox(false, dialogue); - // doof.x += 70; - // doof.y = FlxG.height * 0.5; - doof.scrollFactor.set(); - doof.finishThing = startCountdown; - doof.nextDialogueThing = startNextDialogue; - doof.skipDialogueThing = skipDialogue; Conductor.songPosition = -5000 / Conductor.songPosition; @@ -1497,9 +1112,9 @@ class PlayState extends MusicBeatState timeTxt.borderSize = 2; timeTxt.visible = showTime; if(ClientPrefs.downScroll) timeTxt.y = FlxG.height - 44; - switch (ClientPrefs.hudType) + switch (ClientPrefs.timeBarStyle) { - case 'Psych Engine': + case 'Vanilla': timeTxt.setFormat(Paths.font("vcr.ttf"), 32, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); timeTxt.borderSize = 2; @@ -1543,7 +1158,7 @@ class PlayState extends MusicBeatState timeBarBG = new AttachedSprite('timeBar'); timeBarBG.x = timeTxt.x; - timeBarBG.y = timeTxt.y + (timeTxt.height / 4); // Adjust y position if needed for specific hudTypes + timeBarBG.y = timeTxt.y + (timeTxt.height / 4); // Adjust y position if needed for specific timeBarTypes timeBarBG.scrollFactor.set(); timeBarBG.alpha = 0; timeBarBG.visible = showTime && !ClientPrefs.timeBarType.contains('(No Bar)'); @@ -1557,17 +1172,17 @@ class PlayState extends MusicBeatState timeBar.numDivisions = 800; // Adjust numDivisions if needed for performance timeBar.alpha = 0; timeBar.visible = showTime && !ClientPrefs.timeBarType.contains('(No Bar)'); - if (ClientPrefs.hudType != 'Dave and Bambi') add(timeBar); + if (ClientPrefs.timeBarStyle != 'Dave Engine') add(timeBar); timeBarBG.sprTracker = timeBar; - switch (ClientPrefs.hudType) { + switch (ClientPrefs.timeBarStyle) { case 'VS Impostor': timeBarBG.loadGraphic(Paths.image('impostorTimeBar')); timeBar.createFilledBar(0xFF2e412e, 0xFF44d844); timeTxt.x += 10; timeTxt.y += 4; - case 'Psych Engine', 'Tails Gets Trolled V4': + case 'Vanilla', 'Tails Gets Trolled V4': timeBarBG.loadGraphic(Paths.image('timeBar')); timeBar.createFilledBar(FlxColor.BLACK, FlxColor.WHITE); timeBarBG.color = FlxColor.BLACK; @@ -1626,7 +1241,7 @@ class PlayState extends MusicBeatState add(timeBar); timeBarBG.sprTracker = timeBar; - case 'Dave and Bambi': + case 'Dave Engine': if (timeBarBG != null && timeBar != null){ timeBarBG.destroy(); timeBar.destroy(); @@ -1686,6 +1301,8 @@ class PlayState extends MusicBeatState } add(timeTxt); + timeBarBG.visible = showTime && !ClientPrefs.timeBarType.contains('(No Bar)'); + sustainNotes = new NoteGroup(); add(sustainNotes); @@ -1699,7 +1316,7 @@ class PlayState extends MusicBeatState add(grpNoteSplashes); - if(ClientPrefs.timeBarType == 'Song Name' && ClientPrefs.hudType == 'VS Impostor') + if(ClientPrefs.timeBarType == 'Song Name' && ClientPrefs.timeBarStyle == 'VS Impostor') { timeTxt.size = 14; } @@ -1733,8 +1350,10 @@ class PlayState extends MusicBeatState camFollow = FlxPoint.get(); camFollowPos = new FlxObject(0, 0, 1, 1); + camFollowPos.setPosition(camPos.x, camPos.y); snapCamFollowToPos(camPos.x, camPos.y); + camPos.put(); if (prevCamFollow != null) { camFollow = prevCamFollow; @@ -1751,7 +1370,7 @@ class PlayState extends MusicBeatState { FlxG.camera.follow(camFollowPos, LOCKON, 1); FlxG.camera.zoom = defaultCamZoom; - FlxG.camera.focusOn(camFollow); + FlxG.camera.snapToTarget(); FlxG.worldBounds.set(0, 0, FlxG.width, FlxG.height); } @@ -1762,9 +1381,9 @@ class PlayState extends MusicBeatState msTxt.cameras = (ClientPrefs.wrongCameras ? [camGame] : [camHUD]); msTxt.scrollFactor.set(); msTxt.setFormat("vcr.ttf", 20, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); - if (ClientPrefs.hudType == 'Tails Gets Trolled V4') msTxt.setFormat("calibri.ttf", 20, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); - if (ClientPrefs.hudType == 'Dave and Bambi') msTxt.setFormat("comic.ttf", 20, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); - if (ClientPrefs.hudType == 'Doki Doki+') msTxt.setFormat("Aller_rg.ttf", 20, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); + if (ClientPrefs.scoreStyle == 'Tails Gets Trolled V4') msTxt.setFormat("calibri.ttf", 20, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); + if (ClientPrefs.scoreStyle == 'TGT V4') msTxt.setFormat("comic.ttf", 20, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); + if (ClientPrefs.scoreStyle == 'Doki Doki+') msTxt.setFormat("Aller_rg.ttf", 20, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); msTxt.x = 408 + 250; msTxt.y = 290 - 25; if (PlayState.isPixelStage) { @@ -1781,14 +1400,14 @@ class PlayState extends MusicBeatState judgeTxt.cameras = (ClientPrefs.wrongCameras ? [camGame] : [camHUD]); judgeTxt.scrollFactor.set(); judgeTxt.setFormat("vcr.ttf", 20, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); - if (ClientPrefs.hudType == 'Tails Gets Trolled V4') judgeTxt.setFormat("calibri.ttf", 20, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); - if (ClientPrefs.hudType == 'Dave and Bambi') judgeTxt.setFormat("comic.ttf", 20, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); - if (ClientPrefs.hudType == 'Doki Doki+') judgeTxt.setFormat("Aller_rg.ttf", 20, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); + if (ClientPrefs.scoreStyle == 'Tails Gets Trolled V4') judgeTxt.setFormat("calibri.ttf", 20, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); + if (ClientPrefs.scoreStyle == 'Dave and Bambi') judgeTxt.setFormat("comic.ttf", 20, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); + if (ClientPrefs.scoreStyle == 'Doki Doki+') judgeTxt.setFormat("Aller_rg.ttf", 20, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); judgeTxt.active = false; judgeTxt.size = 32; judgeTxt.visible = false; add(judgeTxt); - if (ClientPrefs.hudType == 'Dave and Bambi') + if (ClientPrefs.healthBarStyle == 'Dave Engine') { if (ClientPrefs.longHPBar) { @@ -1798,7 +1417,7 @@ class PlayState extends MusicBeatState healthBarBG = new AttachedSprite('DnBHealthBar'); } } - if (ClientPrefs.hudType == 'Doki Doki+') + if (ClientPrefs.healthBarStyle == 'Doki Doki+') { if (ClientPrefs.longHPBar) { @@ -1807,7 +1426,7 @@ class PlayState extends MusicBeatState { healthBarBG = new AttachedSprite('dokiHealthBar'); } - } else if (ClientPrefs.hudType != 'Dave and Bambi' && ClientPrefs.hudType != 'Doki Doki+') { + } else if (ClientPrefs.healthBarStyle == 'Vanilla') { if (ClientPrefs.longHPBar) { healthBarBG = new AttachedSprite('longHealthBar'); @@ -1848,7 +1467,7 @@ class PlayState extends MusicBeatState if (ClientPrefs.smoothHealth) healthBar.numDivisions = Std.int(healthBar.width); - if (SONG.player1 == 'bf' || SONG.player1 == 'boyfriend') { + if (SONG.player1.startsWith('bf') || SONG.player1.startsWith('boyfriend')) { final iconToChange:String = switch (ClientPrefs.bfIconStyle){ case 'VS Nonsense V2': 'bfnonsense'; case 'Doki Doki+': 'bfdoki'; @@ -1869,14 +1488,22 @@ class PlayState extends MusicBeatState timeBar.destroy(); } - if (ClientPrefs.hudType == 'Kade Engine') { + if (ClientPrefs.watermarkStyle == 'Vanilla') { EngineWatermark = new FlxText(4,FlxG.height * 0.9 + 50,0,"", 16); EngineWatermark.setFormat(Paths.font("vcr.ttf"), 16, FlxColor.WHITE, RIGHT, FlxTextBorderStyle.OUTLINE,FlxColor.BLACK); EngineWatermark.scrollFactor.set(); add(EngineWatermark); EngineWatermark.text = SONG.song + " " + CoolUtil.difficultyString() + " | JSE " + MainMenuState.psychEngineJSVersion; } - if (ClientPrefs.hudType == 'JS Engine') { + if (ClientPrefs.watermarkStyle == 'Forever Engine') { + EngineWatermark = new FlxText(0, FlxG.height - 30, 0, "JS Engine v" + MainMenuState.psychEngineJSVersion, 16); + EngineWatermark.setFormat(Paths.font("vcr.ttf"), 16, FlxColor.WHITE, RIGHT, FlxTextBorderStyle.OUTLINE,FlxColor.BLACK); + EngineWatermark.updateHitbox(); + EngineWatermark.x = FlxG.width - EngineWatermark.width - 5; + EngineWatermark.scrollFactor.set(); + add(EngineWatermark); + } + if (ClientPrefs.watermarkStyle == 'JS Engine') { EngineWatermark = new FlxText(4,FlxG.height * 0.1 - 70,0,"", 15); EngineWatermark.setFormat(Paths.font("vcr.ttf"), 18, FlxColor.WHITE, RIGHT, FlxTextBorderStyle.OUTLINE,FlxColor.BLACK); EngineWatermark.scrollFactor.set(); @@ -1884,7 +1511,7 @@ class PlayState extends MusicBeatState add(EngineWatermark); EngineWatermark.text = "You are now playing " + SONG.song + " on " + CoolUtil.difficultyString() + "! (JSE v" + MainMenuState.psychEngineJSVersion + ")"; } - if (ClientPrefs.hudType == 'Dave and Bambi') { + if (ClientPrefs.watermarkStyle == 'Dave Engine') { EngineWatermark = new FlxText(4,FlxG.height * 0.9 + 50,0,"", 16); EngineWatermark.setFormat(Paths.font("comic.ttf"), 16, FlxColor.WHITE, RIGHT, FlxTextBorderStyle.OUTLINE,FlxColor.BLACK); EngineWatermark.scrollFactor.set(); @@ -1910,7 +1537,7 @@ class PlayState extends MusicBeatState add(chromaScreen); } - if (ClientPrefs.hudType == 'Kade Engine') + if (ClientPrefs.scoreStyle == 'Kade Engine') { scoreTxt = new FlxText(0, healthBarBG.y + 50, FlxG.width, "", 20); scoreTxt.setFormat(Paths.font("vcr.ttf"), 16, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE,FlxColor.BLACK); @@ -1919,16 +1546,16 @@ class PlayState extends MusicBeatState scoreTxt.visible = !ClientPrefs.hideHud || !ClientPrefs.showcaseMode; add(scoreTxt); } - if (ClientPrefs.hudType == 'JS Engine') + if (ClientPrefs.scoreStyle == 'JS Engine') { - scoreTxt = new FlxText(0, healthBarBG.y + 50, FlxG.width, "", 20); + scoreTxt = new FlxText(0, healthBarBG.y + 50, FlxG.width, "", 18); scoreTxt.setFormat(Paths.font("vcr.ttf"), 18, FlxColor.fromRGB(dad.healthColorArray[0], dad.healthColorArray[1], dad.healthColorArray[2]), CENTER, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); scoreTxt.scrollFactor.set(); scoreTxt.borderSize = 2; scoreTxt.visible = !ClientPrefs.hideHud || !ClientPrefs.showcaseMode; add(scoreTxt); } - if (ClientPrefs.hudType == 'Leather Engine') + if (ClientPrefs.scoreStyle == 'Leather Engine') { scoreTxt = new FlxText(0, healthBarBG.y + 50, FlxG.width, "", 20); scoreTxt.setFormat(Paths.font("vcr.ttf"), 16, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE,FlxColor.BLACK); @@ -1937,7 +1564,7 @@ class PlayState extends MusicBeatState scoreTxt.visible = !ClientPrefs.hideHud || !ClientPrefs.showcaseMode; add(scoreTxt); } - if (ClientPrefs.hudType == 'Dave and Bambi') + if (ClientPrefs.scoreStyle == 'Dave and Bambi') { scoreTxt = new FlxText(0, healthBarBG.y + 40, FlxG.width, "", 20); scoreTxt.setFormat(Paths.font("comic.ttf"), 20, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); @@ -1946,7 +1573,7 @@ class PlayState extends MusicBeatState scoreTxt.visible = !ClientPrefs.hideHud || !ClientPrefs.showcaseMode; add(scoreTxt); } - if (ClientPrefs.hudType == 'Psych Engine') + if (ClientPrefs.scoreStyle == 'Psych Engine') { scoreTxt = new FlxText(0, healthBarBG.y + 36, FlxG.width, "", 20); scoreTxt.setFormat(Paths.font("vcr.ttf"), 20, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); @@ -1955,7 +1582,7 @@ class PlayState extends MusicBeatState scoreTxt.visible = !ClientPrefs.hideHud || !ClientPrefs.showcaseMode; add(scoreTxt); } - if (ClientPrefs.hudType == 'Doki Doki+') + if (ClientPrefs.scoreStyle == 'Doki Doki+') { scoreTxt = new FlxText(0, healthBarBG.y + 48, FlxG.width, "", 20); scoreTxt.setFormat(Paths.font("Aller_rg.ttf"), 20, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); @@ -1964,7 +1591,7 @@ class PlayState extends MusicBeatState scoreTxt.visible = !ClientPrefs.hideHud || !ClientPrefs.showcaseMode; add(scoreTxt); } - if (ClientPrefs.hudType == 'Tails Gets Trolled V4') + if (ClientPrefs.scoreStyle == 'Tails Gets Trolled V4') { scoreTxt = new FlxText(0, healthBarBG.y + 48, FlxG.width, "", 20); scoreTxt.setFormat(Paths.font("calibri.ttf"), 20, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); @@ -1973,7 +1600,7 @@ class PlayState extends MusicBeatState scoreTxt.visible = !ClientPrefs.hideHud || !ClientPrefs.showcaseMode; add(scoreTxt); } - if (ClientPrefs.hudType == 'VS Impostor') + if (ClientPrefs.scoreStyle == 'VS Impostor') { scoreTxt = new FlxText(0, healthBarBG.y + 36, FlxG.width, "", 20); scoreTxt.scrollFactor.set(); @@ -1983,6 +1610,15 @@ class PlayState extends MusicBeatState scoreTxt.visible = !ClientPrefs.hideHud || !ClientPrefs.showcaseMode; add(scoreTxt); } + if (ClientPrefs.scoreStyle == 'Forever Engine') + { + scoreTxt = new FlxText(0, healthBarBG.y + 40, FlxG.width, "", 18); + scoreTxt.setFormat(Paths.font("vcr.ttf"), 18, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); + scoreTxt.borderSize = 1.25; + updateScore(); + scoreTxt.scrollFactor.set(); + add(scoreTxt); + } if (ClientPrefs.hideScore || ClientPrefs.showcaseMode) { scoreTxt.destroy(); healthBarBG.visible = false; @@ -2016,7 +1652,7 @@ class PlayState extends MusicBeatState renderedTxt.visible = ClientPrefs.showRendered; if (ClientPrefs.downScroll) renderedTxt.y = healthBar.y + 50; - if (ClientPrefs.hudType == 'VS Impostor') renderedTxt.y = healthBar.y + (ClientPrefs.downScroll ? 100 : -100); + if (ClientPrefs.scoreStyle == 'VS Impostor') renderedTxt.y = healthBar.y + (ClientPrefs.downScroll ? 100 : -100); add(renderedTxt); judgementCounter = new FlxText(0, FlxG.height / 2 - 80, 0, "", 20); @@ -2029,7 +1665,7 @@ class PlayState extends MusicBeatState // just because, people keep making issues about it try{ - if (ClientPrefs.hudType == 'Psych Engine') + if (ClientPrefs.botTxtStyle == 'Vanilla') { botplayTxt = new FlxText(400, timeBarBG.y + 55, FlxG.width - 800, "BOTPLAY", 32); botplayTxt.setFormat(Paths.font("vcr.ttf"), 32, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); @@ -2040,7 +1676,7 @@ class PlayState extends MusicBeatState if (ClientPrefs.downScroll) botplayTxt.y = timeBarBG.y - 78; } - if (ClientPrefs.hudType == 'JS Engine') + if (ClientPrefs.botTxtStyle == 'JS Engine') { botplayTxt = new FlxText(400, timeBarBG.y + 55, FlxG.width - 800, "Botplay Mode", 30); botplayTxt.setFormat(Paths.font("vcr.ttf"), 30, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); @@ -2051,18 +1687,7 @@ class PlayState extends MusicBeatState if (ClientPrefs.downScroll) botplayTxt.y = timeBarBG.y - 78; } - if (ClientPrefs.hudType == 'Kade Engine') - { - botplayTxt = new FlxText(400, timeBarBG.y + 55, FlxG.width - 800, "BOTPLAY", 32); - botplayTxt.setFormat(Paths.font("vcr.ttf"), 32, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); - botplayTxt.scrollFactor.set(); - botplayTxt.borderSize = 1.25; - botplayTxt.visible = cpuControlled && !ClientPrefs.showcaseMode; - add(botplayTxt); - if (ClientPrefs.downScroll) - botplayTxt.y = timeBarBG.y - 78; - } - if (ClientPrefs.hudType == 'Doki Doki+') + if (ClientPrefs.botTxtStyle == 'Doki Doki+') { botplayTxt = new FlxText(400, timeBarBG.y + 55, FlxG.width - 800, "BOTPLAY", 32); botplayTxt.setFormat(Paths.font("Aller_rg.ttf"), 32, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); @@ -2073,7 +1698,7 @@ class PlayState extends MusicBeatState if (ClientPrefs.downScroll) botplayTxt.y = timeBarBG.y - 78; } - if (ClientPrefs.hudType == 'Tails Gets Trolled V4') + if (ClientPrefs.botTxtStyle == 'TGT V4') { botplayTxt = new FlxText(400, timeBarBG.y + (ClientPrefs.downScroll ? -78 : 55), FlxG.width - 800, "[BUTTPLUG]", 32); botplayTxt.setFormat(Paths.font("calibri.ttf"), 32, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); @@ -2084,7 +1709,7 @@ class PlayState extends MusicBeatState if (ClientPrefs.downScroll) botplayTxt.y = timeBarBG.y - 78; } - if (ClientPrefs.hudType == 'Dave and Bambi') + if (ClientPrefs.botTxtStyle == 'Dave Engine') { botplayTxt = new FlxText(400, timeBarBG.y + 55, FlxG.width - 800, "BOTPLAY", 32); botplayTxt.setFormat(Paths.font("comic.ttf"), 32, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); @@ -2095,7 +1720,7 @@ class PlayState extends MusicBeatState if (ClientPrefs.downScroll) botplayTxt.y = timeBarBG.y - 78; } - if (ClientPrefs.hudType == 'VS Impostor') + if (ClientPrefs.botTxtStyle == 'VS Impostor') { botplayTxt = new FlxText(400, healthBarBG.y - 55, FlxG.width - 800, "BOTPLAY", 32); botplayTxt.setFormat(Paths.font("vcr.ttf"), 32, FlxColor.fromRGB(dad.healthColorArray[0], dad.healthColorArray[1], dad.healthColorArray[2]), CENTER, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK); @@ -2154,7 +1779,6 @@ class PlayState extends MusicBeatState timeBar.cameras = [camHUD]; timeBarBG.cameras = [camHUD]; timeTxt.cameras = [camHUD]; - doof.cameras = [camHUD]; startingSong = true; MusicBeatState.windowNameSuffix = " - " + SONG.song + " " + (isStoryMode ? "(Story Mode)" : "(Freeplay)"); @@ -2210,80 +1834,7 @@ class PlayState extends MusicBeatState } #end - var daSong:String = Paths.formatToSongPath(curSong); - if (isStoryMode && !seenCutscene) - { - switch (daSong) - { - case "monster": - var whiteScreen:FlxSprite = new FlxSprite(0, 0).makeGraphic(Std.int(FlxG.width * 2), Std.int(FlxG.height * 2), FlxColor.WHITE); - add(whiteScreen); - whiteScreen.scrollFactor.set(); - whiteScreen.blend = ADD; - camHUD.visible = false; - snapCamFollowToPos(dad.getMidpoint().x + 150, dad.getMidpoint().y - 100); - inCutscene = true; - - FlxTween.tween(whiteScreen, {alpha: 0}, 1, { - startDelay: 0.1, - ease: FlxEase.linear, - onComplete: function(twn:FlxTween) - { - camHUD.visible = true; - remove(whiteScreen); - startCountdown(); - } - }); - FlxG.sound.play(Paths.soundRandom('thunder_', 1, 2)); - if(gf != null) gf.playAnim('scared', true); - boyfriend.playAnim('scared', true); - - case "winter-horrorland": - var blackScreen:FlxSprite = new FlxSprite().makeGraphic(Std.int(FlxG.width * 2), Std.int(FlxG.height * 2), FlxColor.BLACK); - add(blackScreen); - blackScreen.scrollFactor.set(); - camHUD.visible = false; - inCutscene = true; - - FlxTween.tween(blackScreen, {alpha: 0}, 0.7, { - ease: FlxEase.linear, - onComplete: function(twn:FlxTween) { - remove(blackScreen); - } - }); - FlxG.sound.play(Paths.sound('Lights_Turn_On')); - snapCamFollowToPos(400, -2050); - FlxG.camera.focusOn(camFollow); - FlxG.camera.zoom = 1.5; - - new FlxTimer().start(0.8, function(tmr:FlxTimer) - { - camHUD.visible = true; - remove(blackScreen); - FlxTween.tween(FlxG.camera, {zoom: defaultCamZoom}, 2.5, { - ease: FlxEase.quadInOut, - onComplete: function(twn:FlxTween) - { - startCountdown(); - } - }); - }); - case 'senpai' | 'roses' | 'thorns': - if(daSong == 'roses') FlxG.sound.play(Paths.sound('ANGRY')); - schoolIntro(doof); - - case 'ugh' | 'guns' | 'stress': - tankIntro(); - - default: - startCountdown(); - } - seenCutscene = true; - } - else - { - startCountdown(); - } + startCallback(); RecalculateRating(); //PRECACHING MISS SOUNDS BECAUSE I THINK THEY CAN LAG PEOPLE AND FUCK THEM UP IDK HOW HAXE WORKS @@ -2319,7 +1870,7 @@ class PlayState extends MusicBeatState super.create(); - if(cpuControlled && ClientPrefs.randomBotplayText && ClientPrefs.hudType != 'Leather Engine' && botplayTxt != null && !ffmpegInfo) + if(cpuControlled && ClientPrefs.randomBotplayText && ClientPrefs.botTxtStyle != 'Hide' && botplayTxt != null && !ffmpegInfo) { botplayTxt.text = theListBotplay[FlxG.random.int(0, theListBotplay.length - 1)]; } @@ -2931,298 +2482,6 @@ class PlayState extends MusicBeatState } } - - function tankIntro() - { - var cutsceneHandler:CutsceneHandler = new CutsceneHandler(); - - var songName:String = Paths.formatToSongPath(SONG.song); - dadGroup.alpha = 0.00001; - camHUD.visible = false; - - var tankman:FlxSprite = new FlxSprite(-20, 320); - tankman.frames = Paths.getSparrowAtlas('cutscenes/' + songName); - tankman.antialiasing = ClientPrefs.globalAntialiasing; - addBehindDad(tankman); - cutsceneHandler.push(tankman); - - var tankman2:FlxSprite = new FlxSprite(16, 312); - tankman2.antialiasing = ClientPrefs.globalAntialiasing; - tankman2.alpha = 0.000001; - cutsceneHandler.push(tankman2); - var gfDance:FlxSprite = new FlxSprite(gf.x - 107, gf.y + 140); - gfDance.antialiasing = ClientPrefs.globalAntialiasing; - cutsceneHandler.push(gfDance); - var gfCutscene:FlxSprite = new FlxSprite(gf.x - 104, gf.y + 122); - gfCutscene.antialiasing = ClientPrefs.globalAntialiasing; - cutsceneHandler.push(gfCutscene); - var picoCutscene:FlxSprite = new FlxSprite(gf.x - 849, gf.y - 264); - picoCutscene.antialiasing = ClientPrefs.globalAntialiasing; - cutsceneHandler.push(picoCutscene); - var boyfriendCutscene:FlxSprite = new FlxSprite(boyfriend.x + 5, boyfriend.y + 20); - boyfriendCutscene.antialiasing = ClientPrefs.globalAntialiasing; - cutsceneHandler.push(boyfriendCutscene); - - cutsceneHandler.finishCallback = function() - { - var timeForStuff:Float = Conductor.crochet / 1000 * 4.5; - FlxG.sound.music.fadeOut(timeForStuff); - FlxTween.tween(FlxG.camera, {zoom: defaultCamZoom}, timeForStuff, {ease: FlxEase.quadInOut}); - moveCamera(true); - startCountdown(); - - dadGroup.alpha = 1; - camHUD.visible = true; - boyfriend.animation.finishCallback = null; - gf.animation.finishCallback = null; - gf.dance(); - }; - - camFollow.set(dad.x + 280, dad.y + 170); - switch(songName) - { - case 'ugh': - cutsceneHandler.endTime = 12; - cutsceneHandler.music = 'DISTORTO'; - precacheList.set('wellWellWell', 'sound'); - precacheList.set('killYou', 'sound'); - precacheList.set('bfBeep', 'sound'); - - var wellWellWell:FlxSound = new FlxSound().loadEmbedded(Paths.sound('wellWellWell')); - FlxG.sound.list.add(wellWellWell); - - tankman.animation.addByPrefix('wellWell', 'TANK TALK 1 P1', 24, false); - tankman.animation.addByPrefix('killYou', 'TANK TALK 1 P2', 24, false); - tankman.animation.play('wellWell', true); - FlxG.camera.zoom *= 1.2; - - // Well well well, what do we got here? - cutsceneHandler.timer(0.1, function() - { - wellWellWell.play(true); - }); - - // Move camera to BF - cutsceneHandler.timer(3, function() - { - camFollow.x += 750; - camFollow.y += 100; - }); - - // Beep! - cutsceneHandler.timer(4.5, function() - { - boyfriend.playAnim('singUP', true); - boyfriend.specialAnim = true; - FlxG.sound.play(Paths.sound('bfBeep')); - }); - - // Move camera to Tankman - cutsceneHandler.timer(6, function() - { - camFollow.x -= 750; - camFollow.y -= 100; - - // We should just kill you but... what the hell, it's been a boring day... let's see what you've got! - tankman.animation.play('killYou', true); - FlxG.sound.play(Paths.sound('killYou')); - }); - - case 'guns': - cutsceneHandler.endTime = 11.5; - cutsceneHandler.music = 'DISTORTO'; - tankman.x += 40; - tankman.y += 10; - precacheList.set('tankSong2', 'sound'); - - var tightBars:FlxSound = new FlxSound().loadEmbedded(Paths.sound('tankSong2')); - FlxG.sound.list.add(tightBars); - - tankman.animation.addByPrefix('tightBars', 'TANK TALK 2', 24, false); - tankman.animation.play('tightBars', true); - boyfriend.animation.curAnim.finish(); - - cutsceneHandler.onStart = function() - { - tightBars.play(true); - FlxTween.tween(FlxG.camera, {zoom: defaultCamZoom * 1.2}, 4, {ease: FlxEase.quadInOut}); - FlxTween.tween(FlxG.camera, {zoom: defaultCamZoom * 1.2 * 1.2}, 0.5, {ease: FlxEase.quadInOut, startDelay: 4}); - FlxTween.tween(FlxG.camera, {zoom: defaultCamZoom * 1.2}, 1, {ease: FlxEase.quadInOut, startDelay: 4.5}); - }; - - cutsceneHandler.timer(4, function() - { - gf.playAnim('sad', true); - gf.animation.finishCallback = function(name:String) - { - gf.playAnim('sad', true); - }; - }); - - case 'stress': - cutsceneHandler.endTime = 35.5; - tankman.x -= 54; - tankman.y -= 14; - gfGroup.alpha = 0.00001; - boyfriendGroup.alpha = 0.00001; - camFollow.set(dad.x + 400, dad.y + 170); - FlxTween.tween(FlxG.camera, {zoom: 0.9 * 1.2}, 1, {ease: FlxEase.quadInOut}); - foregroundSprites.forEach(function(spr:BGSprite) - { - spr.y += 100; - }); - precacheList.set('stressCutscene', 'sound'); - - tankman2.frames = Paths.getSparrowAtlas('cutscenes/stress2'); - addBehindDad(tankman2); - - if (!ClientPrefs.lowQuality) - { - gfDance.frames = Paths.getSparrowAtlas('characters/gfTankmen'); - gfDance.animation.addByPrefix('dance', 'GF Dancing at Gunpoint', 24, true); - gfDance.animation.play('dance', true); - addBehindGF(gfDance); - } - - gfCutscene.frames = Paths.getSparrowAtlas('cutscenes/stressGF'); - gfCutscene.animation.addByPrefix('dieBitch', 'GF STARTS TO TURN PART 1', 24, false); - gfCutscene.animation.addByPrefix('getRektLmao', 'GF STARTS TO TURN PART 2', 24, false); - gfCutscene.animation.play('dieBitch', true); - gfCutscene.animation.pause(); - addBehindGF(gfCutscene); - if (!ClientPrefs.lowQuality) - { - gfCutscene.alpha = 0.00001; - } - - picoCutscene.frames = AtlasFrameMaker.construct('cutscenes/stressPico'); - picoCutscene.animation.addByPrefix('anim', 'Pico Badass', 24, false); - addBehindGF(picoCutscene); - picoCutscene.alpha = 0.00001; - - boyfriendCutscene.frames = Paths.getSparrowAtlas('characters/BOYFRIEND'); - boyfriendCutscene.animation.addByPrefix('idle', 'BF idle dance', 24, false); - boyfriendCutscene.animation.play('idle', true); - boyfriendCutscene.animation.curAnim.finish(); - addBehindBF(boyfriendCutscene); - - var cutsceneSnd:FlxSound = new FlxSound().loadEmbedded(Paths.sound('stressCutscene')); - FlxG.sound.list.add(cutsceneSnd); - - tankman.animation.addByPrefix('godEffingDamnIt', 'TANK TALK 3', 24, false); - tankman.animation.play('godEffingDamnIt', true); - - var calledTimes:Int = 0; - var zoomBack:Void->Void = function() - { - var camPosX:Float = 630; - var camPosY:Float = 425; - camFollow.set(camPosX, camPosY); - camFollowPos.setPosition(camPosX, camPosY); - FlxG.camera.zoom = 0.8; - cameraSpeed = 1; - - calledTimes++; - if (calledTimes > 1) - { - foregroundSprites.forEach(function(spr:BGSprite) - { - spr.y -= 100; - }); - } - } - - cutsceneHandler.onStart = function() - { - cutsceneSnd.play(true); - }; - - cutsceneHandler.timer(15.2, function() - { - FlxTween.tween(camFollow, {x: 650, y: 300}, 1, {ease: FlxEase.sineOut}); - FlxTween.tween(FlxG.camera, {zoom: 0.9 * 1.2 * 1.2}, 2.25, {ease: FlxEase.quadInOut}); - - gfDance.visible = false; - gfCutscene.alpha = 1; - gfCutscene.animation.play('dieBitch', true); - gfCutscene.animation.finishCallback = function(name:String) - { - if(name == 'dieBitch') //Next part - { - gfCutscene.animation.play('getRektLmao', true); - gfCutscene.offset.set(224, 445); - } - else - { - gfCutscene.visible = false; - picoCutscene.alpha = 1; - picoCutscene.animation.play('anim', true); - - boyfriendGroup.alpha = 1; - boyfriendCutscene.visible = false; - boyfriend.playAnim('bfCatch', true); - boyfriend.animation.finishCallback = function(name:String) - { - if(name != 'idle') - { - boyfriend.playAnim('idle', true); - boyfriend.animation.curAnim.finish(); //Instantly goes to last frame - } - }; - - picoCutscene.animation.finishCallback = function(name:String) - { - picoCutscene.visible = false; - gfGroup.alpha = 1; - picoCutscene.animation.finishCallback = null; - }; - gfCutscene.animation.finishCallback = null; - } - }; - }); - - cutsceneHandler.timer(17.5, function() - { - zoomBack(); - }); - - cutsceneHandler.timer(19.5, function() - { - tankman2.animation.addByPrefix('lookWhoItIs', 'TANK TALK 3', 24, false); - tankman2.animation.play('lookWhoItIs', true); - tankman2.alpha = 1; - tankman.visible = false; - }); - - cutsceneHandler.timer(20, function() - { - camFollow.set(dad.x + 500, dad.y + 170); - }); - - cutsceneHandler.timer(31.2, function() - { - boyfriend.playAnim('singUPmiss', true); - boyfriend.animation.finishCallback = function(name:String) - { - if (name == 'singUPmiss') - { - boyfriend.playAnim('idle', true); - boyfriend.animation.curAnim.finish(); //Instantly goes to last frame - } - }; - - camFollow.set(boyfriend.x + 280, boyfriend.y + 200); - cameraSpeed = 12; - FlxTween.tween(FlxG.camera, {zoom: 0.9 * 1.2 * 1.2}, 0.25, {ease: FlxEase.elasticOut}); - }); - - cutsceneHandler.timer(32.2, function() - { - zoomBack(); - }); - } - } - var startTimer:FlxTimer; var finishTimer:FlxTimer = null; @@ -3438,28 +2697,25 @@ class PlayState extends MusicBeatState antialias = false; } - // head bopping for bg characters on Mall - if(curStage == 'mall') { - if(!ClientPrefs.lowQuality) - upperBoppers.dance(true); - - bottomBoppers.dance(true); - santa.dance(true); - } + var tick:Countdown = THREE; switch (swagCounter) { case 0: FlxG.sound.play(Paths.sound('intro3' + introSoundsSuffix), 0.6); + tick = THREE; case 1: countdownReady = createCountdownSprite(introAlts[0], antialias); FlxG.sound.play(Paths.sound('intro2' + introSoundsSuffix), 0.6); + tick = TWO; case 2: countdownSet = createCountdownSprite(introAlts[1], antialias); FlxG.sound.play(Paths.sound('intro1' + introSoundsSuffix), 0.6); + tick = ONE; case 3: countdownGo = createCountdownSprite(introAlts[2], antialias); FlxG.sound.play(Paths.sound('introGo' + introSoundsSuffix), 0.6); + tick = GO; if (ClientPrefs.tauntOnGo && ClientPrefs.charsAndBG) { final charsToHey = [dad, boyfriend, gf]; @@ -3482,6 +2738,7 @@ class PlayState extends MusicBeatState } } case 4: + tick = START; if (SONG.songCredit != null && SONG.songCredit.length > 0) { var creditsPopup:CreditsPopUp = new CreditsPopUp(FlxG.width, 200, SONG.song, SONG.songCredit); @@ -3514,6 +2771,7 @@ class PlayState extends MusicBeatState } } }); + stagesFunc(function(stage:BaseStage) stage.countdownTick(tick, swagCounter)); callOnLuas('onCountdownTick', [swagCounter]); swagCounter += 1; @@ -3593,45 +2851,59 @@ class PlayState extends MusicBeatState scoreTxtUpdateFrame++; if (!scoreTxt.visible) return; //GAH DAYUM THIS IS MORE OPTIMIZED THAN BEFORE + var divider = switch (ClientPrefs.scoreStyle) + { + case 'Leather Engine': '~'; + case 'Forever Engine': '•'; + default: '|'; + } formattedMaxScore = ClientPrefs.showMaxScore ? ' / ' + FlxStringUtil.formatMoney(maxScore, false) : ''; formattedSongScore = !ClientPrefs.compactNumbers ? FlxStringUtil.formatMoney(songScore, false) : compactScore; formattedScore = (!ClientPrefs.compactNumbers ? FlxStringUtil.formatMoney(songScore, false) : compactScore) + formattedMaxScore; + if (ClientPrefs.scoreStyle == 'JS Engine') formattedScore = (!ClientPrefs.compactNumbers ? FlxStringUtil.formatMoney(shownScore, false) : compactScore) + formattedMaxScore; formattedSongMisses = !ClientPrefs.compactNumbers ? FlxStringUtil.formatMoney(songMisses, false) : compactMisses; formattedCombo = !ClientPrefs.compactNumbers ? FlxStringUtil.formatMoney(combo, false) : compactCombo; formattedNPS = !ClientPrefs.compactNumbers ? FlxStringUtil.formatMoney(nps, false) : compactNPS; formattedMaxNPS = !ClientPrefs.compactNumbers ? FlxStringUtil.formatMoney(maxNPS, false) : formatCompactNumber(maxNPS); - npsString = ClientPrefs.showNPS ? (ClientPrefs.hudType != 'Leather Engine' ? ' | ' : ' ~ ') + (cpuControlled && !ClientPrefs.communityGameBot ? 'Bot ' : '') + 'NPS/Max: ' + formattedNPS + '/' + formattedMaxNPS : ''; + npsString = ClientPrefs.showNPS ? ' $divider ' + (cpuControlled && !ClientPrefs.communityGameBot ? 'Bot ' : '') + 'NPS/Max: ' + formattedNPS + '/' + formattedMaxNPS : ''; accuracy = Highscore.floorDecimal(ratingPercent * 100, 2) + '%'; fcString = ratingFC; - botText = cpuControlled && !ClientPrefs.communityGameBot ? ' | Botplay Mode' : ''; + + botText = cpuControlled && !ClientPrefs.communityGameBot ? ' $divider Botplay Mode' : ''; if (cpuControlled && !ClientPrefs.communityGameBot) { - tempScore = 'Bot Score: ' + formattedScore + ' | Bot Combo: ' + formattedCombo + npsString + botText; - if (ClientPrefs.healthDisplay) scoreTxt.text += ' | Health: ' + FlxMath.roundDecimal(health * 50, 2) + '%'; + tempScore = 'Bot Score: ' + formattedScore + ' $divider Bot Combo: ' + formattedCombo + npsString + botText; + if (ClientPrefs.healthDisplay) scoreTxt.text += ' $divider Health: ' + FlxMath.roundDecimal(health * 50, 2) + '%'; } - else switch (ClientPrefs.hudType) + else switch (ClientPrefs.scoreStyle) { case 'Kade Engine': - tempScore = 'Score: ' + formattedScore + ' | Misses: ' + formattedSongMisses + ' | Combo: ' + formattedCombo + npsString + ' | Accuracy: ' + accuracy + ' | (' + fcString + ') ' + ratingCool; + tempScore = 'Score: ' + formattedScore + ' $divider Misses: ' + formattedSongMisses + ' $divider Combo: ' + formattedCombo + npsString + ' $divider Accuracy: ' + accuracy + ' $divider (' + fcString + ') ' + ratingCool; case "Doki Doki+": - tempScore = 'Score: ' + formattedScore + ' | Breaks: ' + formattedSongMisses + ' | Combo: ' + formattedCombo + npsString + ' | Accuracy: ' + accuracy + ' | (' + fcString + ') ' + ratingCool; + tempScore = 'Score: ' + formattedScore + ' $divider Breaks: ' + formattedSongMisses + ' $divider Combo: ' + formattedCombo + npsString + ' $divider Accuracy: ' + accuracy + ' $divider (' + fcString + ') ' + ratingCool; + + case "Dave Engine": + tempScore = 'Score: ' + formattedScore + ' $divider Misses: ' + formattedSongMisses + ' $divider Combo: ' + formattedCombo + npsString + ' $divider Accuracy: ' + accuracy + ' $divider ' + fcString; + + case "Forever Engine": + tempScore = 'Score: ' + formattedScore + ' $divider Accuracy: ' + Highscore.floorDecimal(ratingPercent * 100, 2) + '% [' + fcString + ']' + ' $divider Combo Breaks: ' + formattedSongMisses + ' $divider Combo: ' + formattedCombo + npsString + ' $divider Rank: ' + ratingName; - case "Dave and Bambi": - tempScore = 'Score: ' + formattedScore + ' | Misses: ' + formattedSongMisses + ' | Combo: ' + formattedCombo + npsString + ' | Accuracy: ' + accuracy + ' | ' + fcString; + case "Psych Engine", "Tails Gets Trolled V4": + tempScore = 'Score: ' + formattedScore + ' $divider Misses: ' + formattedSongMisses + ' $divider Combo: ' + formattedCombo + npsString + ' $divider Rating: ' + ratingName + (ratingName != '?' ? ' (${accuracy}) - $fcString' : ''); - case "Psych Engine", "JS Engine", "Tails Gets Trolled V4": - tempScore = 'Score: ' + formattedScore + ' | Misses: ' + formattedSongMisses + ' | Combo: ' + formattedCombo + npsString + ' | Rating: ' + ratingName + (ratingName != '?' ? ' (${accuracy}) - $fcString' : ''); + case "JS Engine": + tempScore = 'Score: ' + formattedScore + ' $divider Misses: ' + formattedSongMisses + ' $divider Combo: ' + formattedCombo + npsString + ' $divider Rating: ' + ratingName + (ratingName != '?' ? ' (${accuracy}) - $fcString' : ''); case "Leather Engine": - tempScore = '< Score: ' + formattedScore + ' ~ Misses: ' + formattedSongMisses + ' ~ Combo: ' + formattedCombo + npsString + ' ~ Rating: ' + ratingName + (ratingName != '?' ? ' (${accuracy}) - $fcString' : ''); + tempScore = '< Score: ' + formattedScore + ' $divider Misses: ' + formattedSongMisses + ' $divider Combo: ' + formattedCombo + npsString + ' $divider Rating: ' + ratingName + (ratingName != '?' ? ' (${accuracy}) - $fcString' : ''); case 'VS Impostor': - tempScore = 'Score: ' + formattedScore + ' | Combo Breaks: ' + formattedSongMisses + ' | Combo: ' + formattedCombo + npsString + ' | Accuracy: ' + Highscore.floorDecimal(ratingPercent * 100, 2) + '% [' + fcString + ']'; + tempScore = 'Score: ' + formattedScore + ' $divider Combo Breaks: ' + formattedSongMisses + ' $divider Combo: ' + formattedCombo + npsString + ' $divider Accuracy: ' + Highscore.floorDecimal(ratingPercent * 100, 2) + '% [' + fcString + ']'; } - if (ClientPrefs.healthDisplay && !cpuControlled) tempScore += ' | Health: ' + FlxMath.roundDecimal(health * 50, 2) + '%'; + if (ClientPrefs.healthDisplay && !cpuControlled) tempScore += ' $divider Health: ' + FlxMath.roundDecimal(health * 50, 2) + '%'; scoreTxt.text = '${tempScore}\n'; @@ -3664,12 +2936,12 @@ class PlayState extends MusicBeatState songTime = time; } - function startNextDialogue() { + public function startNextDialogue() { dialogueCount++; callOnLuas('onNextDialogue', [dialogueCount]); } - function skipDialogue() { + public function skipDialogue() { callOnLuas('onSkipDialogue', [dialogueCount]); } @@ -3734,17 +3006,17 @@ class PlayState extends MusicBeatState iconsShouldGoUp = true; var renderedTxtY = -70; if (ClientPrefs.downScroll) renderedTxtY = 70; - if (ClientPrefs.hudType == 'VS Impostor') renderedTxtY = (ClientPrefs.downScroll ? 70 : -100); + if (ClientPrefs.botTxtStyle == 'VS Impostor') renderedTxtY = (ClientPrefs.downScroll ? 70 : -100); var scoreTxtY = 50; - switch (ClientPrefs.hudType) + switch (ClientPrefs.scoreStyle) { - case 'Dave and Bambi': scoreTxtY = 40; + case 'Dave and Bambi', 'Forever Engine': scoreTxtY = 40; case 'Psych Engine', 'VS Impostor': scoreTxtY = 36; case 'Tails Gets Trolled V4', 'Doki Doki+': scoreTxtY = 48; } var healthBarElements:Array = [healthBarBG, healthBar, scoreTxt, iconP1, iconP2, renderedTxt, botplayTxt]; var yTweens:Array = [0, 4, scoreTxtY, -75, -75, renderedTxtY]; - if (ClientPrefs.hudType == 'VS Impostor') + if (ClientPrefs.botTxtStyle == 'VS Impostor') { if (ClientPrefs.downScroll) healthBarElements = [healthBarBG, healthBar, scoreTxt, iconP1, iconP2, renderedTxt]; yTweens = [0, 4, scoreTxtY, -75, -75, renderedTxtY, -55]; @@ -3753,15 +3025,6 @@ class PlayState extends MusicBeatState if (healthBarElements[i] != null && i < yTweens.length) FlxTween.tween(healthBarElements[i], {y: (FlxG.height * (ClientPrefs.downScroll ? 0.11 : 0.89)) + yTweens[i]}, 1, {ease: FlxEase.expoOut, onComplete: function(tween:FlxTween) {iconsShouldGoUp = false;}}); } - switch(curStage) - { - case 'tank': - if(!ClientPrefs.lowQuality) tankWatchtower.dance(); - foregroundSprites.forEach(function(spr:BGSprite) - { - spr.dance(); - }); - } if (oneK) { @@ -4117,7 +3380,20 @@ class PlayState extends MusicBeatState notesLoadedRN = 0; } + // called only once per different event (Used for precaching) function eventPushed(event:EventNote) { + eventPushedUnique(event); + if(eventPushedMap.exists(event.event)) { + return; + } + + stagesFunc(function(stage:BaseStage) stage.eventPushed(event)); + if(!eventPushedMap.exists(event.event)) { + eventPushedMap.set(event.event, true); + } + } + + function eventPushedUnique(event:EventNote) { switch(event.event) { case 'Change Character': if (ClientPrefs.charsAndBG) @@ -4140,71 +3416,8 @@ class PlayState extends MusicBeatState charChangeNames.push(event.value2); charChangeTypes.push(charType); } - - case 'Dadbattle Spotlight': - if (curStage != 'stage') return; - - dadbattleBlack = new BGSprite(null, -800, -400, 0, 0); - dadbattleBlack.makeGraphic(Std.int(FlxG.width * 2), Std.int(FlxG.height * 2), FlxColor.BLACK); - dadbattleBlack.alpha = 0.25; - dadbattleBlack.visible = false; - add(dadbattleBlack); - - dadbattleLight = new BGSprite('spotlight', 400, -400); - dadbattleLight.alpha = 0.375; - dadbattleLight.blend = ADD; - dadbattleLight.visible = false; - - dadbattleSmokes.alpha = 0.7; - dadbattleSmokes.blend = ADD; - dadbattleSmokes.visible = false; - add(dadbattleLight); - add(dadbattleSmokes); - - var offsetX = 200; - var smoke:BGSprite = new BGSprite('smoke', -1550 + offsetX, 660 + FlxG.random.float(-20, 20), 1.2, 1.05); - smoke.setGraphicSize(Std.int(smoke.width * FlxG.random.float(1.1, 1.22))); - smoke.updateHitbox(); - smoke.velocity.x = FlxG.random.float(15, 22); - smoke.active = true; - dadbattleSmokes.add(smoke); - var smoke:BGSprite = new BGSprite('smoke', 1550 + offsetX, 660 + FlxG.random.float(-20, 20), 1.2, 1.05); - smoke.setGraphicSize(Std.int(smoke.width * FlxG.random.float(1.1, 1.22))); - smoke.updateHitbox(); - smoke.velocity.x = FlxG.random.float(-15, -22); - smoke.active = true; - smoke.flipX = true; - dadbattleSmokes.add(smoke); - - - case 'Philly Glow': - if (curStage != 'philly') return; - - blammedLightsBlack = new FlxSprite(FlxG.width * -0.5, FlxG.height * -0.5).makeGraphic(Std.int(FlxG.width * 2), Std.int(FlxG.height * 2), FlxColor.BLACK); - blammedLightsBlack.visible = false; - insert(members.indexOf(phillyStreet), blammedLightsBlack); - - phillyWindowEvent = new BGSprite('philly/window', phillyWindow.x, phillyWindow.y, 0.3, 0.3); - phillyWindowEvent.setGraphicSize(Std.int(phillyWindowEvent.width * 0.85)); - phillyWindowEvent.updateHitbox(); - phillyWindowEvent.visible = false; - insert(members.indexOf(blammedLightsBlack) + 1, phillyWindowEvent); - - - phillyGlowGradient = new PhillyGlow.PhillyGlowGradient(-400, 225); //This shit was refusing to properly load FlxGradient so fuck it - phillyGlowGradient.visible = false; - insert(members.indexOf(blammedLightsBlack) + 1, phillyGlowGradient); - if(!ClientPrefs.flashing) phillyGlowGradient.intendedAlpha = 0.7; - - precacheList.set('philly/particle', 'image'); //precache particle image - phillyGlowParticles = new FlxTypedGroup(); - phillyGlowParticles.visible = false; - insert(members.indexOf(phillyGlowGradient) + 1, phillyGlowParticles); - } - - if(!eventPushedMap.exists(event.event)) { - eventPushedMap.set(event.event, true); } + stagesFunc(function(stage:BaseStage) stage.eventPushedUnique(event)); } function eventNoteEarlyTrigger(event:EventNote):Float { @@ -4299,6 +3512,7 @@ class PlayState extends MusicBeatState override function openSubState(SubState:FlxSubState) { + stagesFunc(function(stage:BaseStage) stage.openSubState(SubState)); if (paused) { if (FlxG.sound.music != null) @@ -4316,8 +3530,6 @@ class PlayState extends MusicBeatState if (songSpeedTween != null) songSpeedTween.active = false; - if(carTimer != null) carTimer.active = false; - var chars:Array = [boyfriend, gf, dad]; for (char in chars) { if(char != null && char.colorTween != null) { @@ -4338,6 +3550,7 @@ class PlayState extends MusicBeatState override function closeSubState() { + stagesFunc(function(stage:BaseStage) stage.closeSubState()); if (paused) { if (FlxG.sound.music != null && !startingSong && !ffmpegMode) @@ -4352,8 +3565,6 @@ class PlayState extends MusicBeatState if (songSpeedTween != null) songSpeedTween.active = true; - if(carTimer != null) carTimer.active = true; - var chars:Array = [boyfriend, gf, dad]; for (char in chars) { if(char != null && char.colorTween != null) { @@ -4564,136 +3775,6 @@ class PlayState extends MusicBeatState //That says / songSpeed. If it's less than 1 it'll multiply instead of divide. var NOTE_SPAWN_TIME = (ClientPrefs.dynamicSpawnTime ? (1600 / songSpeed) : 1600 * ClientPrefs.noteSpawnTime) / camHUD.zoom; - if (ClientPrefs.charsAndBG && curStage != 'stage') switch (curStage) - { - case 'tank': - moveTank(elapsed); - case 'schoolEvil': - if(!ClientPrefs.lowQuality && bgGhouls.animation.curAnim.finished) { - bgGhouls.visible = false; - } - case 'philly': - if (trainMoving) - { - trainFrameTiming += elapsed; - - if (trainFrameTiming >= 1 / 24) - { - updateTrainPos(); - trainFrameTiming = 0; - } - } - phillyWindow.alpha -= (Conductor.crochet / 1000) * FlxG.elapsed * 1.5; - - if(phillyGlowParticles != null) - { - var i:Int = phillyGlowParticles.members.length-1; - while (i > 0) - { - var particle = phillyGlowParticles.members[i]; - if(particle.alpha < 0) - { - particle.kill(); - phillyGlowParticles.remove(particle, true); - particle.destroy(); - } - --i; - } - } - case 'limo': - if(!ClientPrefs.lowQuality) { - grpLimoParticles.forEach(function(spr:BGSprite) { - if(spr.animation.curAnim.finished) { - spr.kill(); - grpLimoParticles.remove(spr, true); - spr.destroy(); - } - }); - - switch(limoKillingState) { - case 1: - limoMetalPole.x += 5000 * elapsed; - limoLight.x = limoMetalPole.x - 180; - limoCorpse.x = limoLight.x - 50; - limoCorpseTwo.x = limoLight.x + 35; - - var dancers:Array = grpLimoDancers.members; - for (i in 0...dancers.length) { - if(dancers[i].x < FlxG.width * 1.5 && limoLight.x > (370 * i) + 170) { - switch(i) { - case 0 | 3: - if(i == 0) FlxG.sound.play(Paths.sound('dancerdeath'), 0.5); - - var diffStr:String = i == 3 ? ' 2 ' : ' '; - var particle:BGSprite = new BGSprite('gore/noooooo', dancers[i].x + 200, dancers[i].y, 0.4, 0.4, ['hench leg spin' + diffStr + 'PINK'], false); - grpLimoParticles.add(particle); - var particle:BGSprite = new BGSprite('gore/noooooo', dancers[i].x + 160, dancers[i].y + 200, 0.4, 0.4, ['hench arm spin' + diffStr + 'PINK'], false); - grpLimoParticles.add(particle); - var particle:BGSprite = new BGSprite('gore/noooooo', dancers[i].x, dancers[i].y + 50, 0.4, 0.4, ['hench head spin' + diffStr + 'PINK'], false); - grpLimoParticles.add(particle); - - var particle:BGSprite = new BGSprite('gore/stupidBlood', dancers[i].x - 110, dancers[i].y + 20, 0.4, 0.4, ['blood'], false); - particle.flipX = true; - particle.angle = -57.5; - grpLimoParticles.add(particle); - case 1: - limoCorpse.visible = true; - case 2: - limoCorpseTwo.visible = true; - } //Note: Nobody cares about the fifth dancer because he is mostly hidden offscreen :( - dancers[i].x += FlxG.width * 2; - } - } - - if(limoMetalPole.x > FlxG.width * 2) { - resetLimoKill(); - limoSpeed = 800; - limoKillingState = 2; - } - - case 2: - limoSpeed -= 4000 * elapsed; - bgLimo.x -= limoSpeed * elapsed; - if(bgLimo.x > FlxG.width * 1.5) { - limoSpeed = 3000; - limoKillingState = 3; - } - - case 3: - limoSpeed -= 2000 * elapsed; - if(limoSpeed < 1000) limoSpeed = 1000; - - bgLimo.x -= limoSpeed * elapsed; - if(bgLimo.x < -275) { - limoKillingState = 4; - limoSpeed = 800; - } - - case 4: - bgLimo.x = FlxMath.lerp(bgLimo.x, -150, CoolUtil.boundTo(elapsed * 9, 0, 1)); - if(Math.round(bgLimo.x) == -150) { - bgLimo.x = -150; - limoKillingState = 0; - } - } - - if(limoKillingState > 2) { - var dancers:Array = grpLimoDancers.members; - for (i in 0...dancers.length) { - dancers[i].x = (370 * i) + bgLimo.x + 280; - } - } - } - case 'mall': - if(heyTimer > 0) { - heyTimer -= elapsed; - if(heyTimer <= 0) { - bottomBoppers.dance(true); - heyTimer = 0; - } - } - } - if(!inCutscene && ClientPrefs.charsAndBG) { final lerpVal:Float = CoolUtil.boundTo(elapsed * 2.4 * cameraSpeed * playbackRate, 0, 1); camFollowPos.setPosition(FlxMath.lerp(camFollowPos.x + moveCamTo[0]/102, camFollow.x + moveCamTo[0]/102, lerpVal), FlxMath.lerp(camFollowPos.y + moveCamTo[1]/102, camFollow.y + moveCamTo[1]/102, lerpVal)); @@ -4814,7 +3895,7 @@ if (ClientPrefs.showNPS && (notesHitDateArray.length > 0 || oppNotesHitDateArray if (splashesPerFrame[0] > 0 || splashesPerFrame[1] > 0) splashesPerFrame = [0, 0]; if (lerpingScore) updateScore(); - if (shownScore != songScore && ClientPrefs.hudType == 'JS Engine' && Math.abs(shownScore - songScore) >= 10) { + if (shownScore != songScore && ClientPrefs.scoreStyle == 'JS Engine' && Math.abs(shownScore - songScore) >= 10) { shownScore = FlxMath.lerp(shownScore, songScore, 0.4 / (ClientPrefs.framerate / 60)); lerpingScore = true; // Indicate that lerping is in progress } else { @@ -4828,7 +3909,7 @@ if (ClientPrefs.showNPS && (notesHitDateArray.length > 0 || oppNotesHitDateArray setOnLuas('curDecStep', curDecStep); setOnLuas('curDecBeat', curDecBeat); - if(botplayTxt != null && botplayTxt.visible && ClientPrefs.hudType != 'Kade Engine' && ClientPrefs.botTxtFade) { + if(botplayTxt != null && botplayTxt.visible && ClientPrefs.botTxtFade) { botplaySine += 180 * elapsed; botplayTxt.alpha = 1 - Math.sin((Math.PI * botplaySine) / 180 * playbackRate); } @@ -5306,7 +4387,7 @@ if (ClientPrefs.showNPS && (notesHitDateArray.length > 0 || oppNotesHitDateArray if(eventNotes[0].value2 != null) value2 = eventNotes[0].value2; - triggerEventNote(eventNotes[0].event, value1, value2); + triggerEventNote(eventNotes[0].event, value1, value2, eventNotes[0].strumTime); eventNotes.shift(); } } @@ -5494,44 +4575,13 @@ if (ClientPrefs.showNPS && (notesHitDateArray.length > 0 || oppNotesHitDateArray return pressed; } - public function triggerEventNote(eventName:String, value1:String, value2:String) { - switch(eventName) { - case 'Dadbattle Spotlight': - if (curStage != 'stage') return; - - var val:Null = Std.parseInt(value1); - if(val == null) val = 0; - - switch(Std.parseInt(value1)) - { - case 1, 2, 3: //enable and target dad - if(val == 1) //enable - { - dadbattleBlack.visible = true; - dadbattleLight.visible = true; - dadbattleSmokes.visible = true; - defaultCamZoom += 0.12; - } - - var who:Character = dad; - if(val > 2) who = boyfriend; - //2 only targets dad - dadbattleLight.alpha = 0; - new FlxTimer().start(0.12, function(tmr:FlxTimer) { - dadbattleLight.alpha = 0.375; - }); - dadbattleLight.setPosition(who.getGraphicMidpoint().x - dadbattleLight.width / 2, who.y + who.height - dadbattleLight.height + 50); - - default: - dadbattleBlack.visible = false; - dadbattleLight.visible = false; - defaultCamZoom -= 0.12; - FlxTween.tween(dadbattleSmokes, {alpha: 0}, 1, {onComplete: function(twn:FlxTween) - { - dadbattleSmokes.visible = false; - }}); - } + public function triggerEventNote(eventName:String, value1:String, value2:String, strumTime:Float) { + var flValue1:Null = Std.parseFloat(value1); + var flValue2:Null = Std.parseFloat(value2); + if(Math.isNaN(flValue1)) flValue1 = null; + if(Math.isNaN(flValue2)) flValue2 = null; + switch(eventName) { case 'Hey!': if (ClientPrefs.charsAndBG) { var value:Int = 2; @@ -5555,11 +4605,6 @@ if (ClientPrefs.showNPS && (notesHitDateArray.length > 0 || oppNotesHitDateArray gf.specialAnim = true; gf.heyTimer = time; } - - if(curStage == 'mall') { - bottomBoppers.animation.play('hey', true); - heyTimer = time; - } } if(value != 1) { boyfriend.playAnim('hey', true); @@ -5574,110 +4619,6 @@ if (ClientPrefs.showNPS && (notesHitDateArray.length > 0 || oppNotesHitDateArray gfSpeed = value; if (Conductor.bpm >= 500) singDurMult = value; - case 'Philly Glow': - if (curStage != 'philly') return; - - var lightId:Int = Std.parseInt(value1); - if(Math.isNaN(lightId)) lightId = 0; - - var doFlash:Void->Void = function() { - var color:FlxColor = FlxColor.WHITE; - if(!ClientPrefs.flashing) color.alphaFloat = 0.5; - - FlxG.camera.flash(color, 0.15, null, true); - }; - - var chars:Array = [boyfriend, gf, dad]; - switch(lightId) - { - case 0: - if(phillyGlowGradient.visible) - { - doFlash(); - if(ClientPrefs.camZooms) - { - FlxG.camera.zoom += 0.5; - camHUD.zoom += 0.1; - } - - blammedLightsBlack.visible = false; - phillyWindowEvent.visible = false; - phillyGlowGradient.visible = false; - phillyGlowParticles.visible = false; - curLightEvent = -1; - - for (who in chars) - { - who.color = FlxColor.WHITE; - } - phillyStreet.color = FlxColor.WHITE; - } - - case 1: //turn on - curLightEvent = FlxG.random.int(0, phillyLightsColors.length-1, [curLightEvent]); - var color:FlxColor = phillyLightsColors[curLightEvent]; - - if(!phillyGlowGradient.visible) - { - doFlash(); - if(ClientPrefs.camZooms) - { - FlxG.camera.zoom += 0.5; - camHUD.zoom += 0.1; - } - - blammedLightsBlack.visible = true; - blammedLightsBlack.alpha = 1; - phillyWindowEvent.visible = true; - phillyGlowGradient.visible = true; - phillyGlowParticles.visible = true; - } - else if(ClientPrefs.flashing) - { - var colorButLower:FlxColor = color; - colorButLower.alphaFloat = 0.25; - FlxG.camera.flash(colorButLower, 0.5, null, true); - } - - var charColor:FlxColor = color; - if(!ClientPrefs.flashing) charColor.saturation *= 0.5; - else charColor.saturation *= 0.75; - - for (who in chars) - { - who.color = charColor; - } - phillyGlowParticles.forEachAlive(function(particle:PhillyGlow.PhillyGlowParticle) - { - particle.color = color; - }); - phillyGlowGradient.color = color; - phillyWindowEvent.color = color; - - color.brightness *= 0.5; - phillyStreet.color = color; - - case 2: // spawn particles - if(!ClientPrefs.lowQuality) - { - var particlesNum:Int = FlxG.random.int(8, 12); - var width:Float = (2000 / particlesNum); - var color:FlxColor = phillyLightsColors[curLightEvent]; - for (j in 0...3) - { - for (i in 0...particlesNum) - { - var particle:PhillyGlow.PhillyGlowParticle = new PhillyGlow.PhillyGlowParticle(-400 + width * i + FlxG.random.float(-width / 5, width / 5), phillyGlowGradient.originalY + 200 + (FlxG.random.float(0, 125) + j * 40), color); - phillyGlowParticles.add(particle); - } - } - } - phillyGlowGradient.bop(); - } - - case 'Kill Henchmen': - killHenchmen(); - case 'Enable Camera Bop': camZooming = true; @@ -5758,11 +4699,6 @@ if (ClientPrefs.showNPS && (notesHitDateArray.length > 0 || oppNotesHitDateArray camHUD.zoom += hudZoom; } - case 'Trigger BG Ghouls': - if(curStage == 'schoolEvil' && !ClientPrefs.lowQuality) { - bgGhouls.dance(true); - bgGhouls.visible = true; - } case 'Play Animation': //trace('Anim to play: ' + value1); var char:Character = dad; @@ -5902,12 +4838,12 @@ if (ClientPrefs.showNPS && (notesHitDateArray.length > 0 || oppNotesHitDateArray } dad.alpha = lastAlpha; iconP2.changeIcon(dad.healthIcon); - if (ClientPrefs.hudType == 'VS Impostor') { + if (ClientPrefs.botTxtStyle == 'VS Impostor') { if (botplayTxt != null) FlxTween.color(botplayTxt, 1, botplayTxt.color, FlxColor.fromRGB(dad.healthColorArray[0], dad.healthColorArray[1], dad.healthColorArray[2])); if (!ClientPrefs.hideScore && scoreTxt != null && !ClientPrefs.hideHud) FlxTween.color(scoreTxt, 1, scoreTxt.color, FlxColor.fromRGB(dad.healthColorArray[0], dad.healthColorArray[1], dad.healthColorArray[2])); } - if (ClientPrefs.hudType == 'JS Engine' && !ClientPrefs.hideHud) { + if (ClientPrefs.scoreStyle == 'JS Engine' && !ClientPrefs.hideHud) { if (!ClientPrefs.hideScore && scoreTxt != null) FlxTween.color(scoreTxt, 1, scoreTxt.color, FlxColor.fromRGB(dad.healthColorArray[0], dad.healthColorArray[1], dad.healthColorArray[2])); } } @@ -5966,9 +4902,6 @@ if (ClientPrefs.showNPS && (notesHitDateArray.length > 0 || oppNotesHitDateArray } } - case 'BG Freaks Expression': - if(bgGirls != null) bgGirls.swapDanceType(); - case 'Rainbow Eyesore': if(ClientPrefs.flashing) { var timeRainbow:Int = Std.parseInt(value1); @@ -6038,7 +4971,8 @@ if (ClientPrefs.showNPS && (notesHitDateArray.length > 0 || oppNotesHitDateArray FunkinLua.setVarInArray(this, value1, value2); } } - callOnLuas('onEvent', [eventName, value1, value2]); + stagesFunc(function(stage:BaseStage) stage.eventCalled(eventName, value1, value2, flValue1, flValue2, strumTime)); + callOnLuas('onEvent', [eventName, value1, value2, strumTime]); } function moveCameraSection():Void { @@ -6112,7 +5046,6 @@ if (ClientPrefs.showNPS && (notesHitDateArray.length > 0 || oppNotesHitDateArray public function finishSong(?ignoreNoteOffset:Bool = false):Void { if (!trollingMode && SONG.song.toLowerCase() != 'anti-cheat-song') { - var finishCallback:Void->Void = endSong; //In case you want to change it in a specific song. updateTime = false; if (ClientPrefs.songLoading) { FlxG.sound.music.volume = 0; @@ -6121,13 +5054,13 @@ if (ClientPrefs.showNPS && (notesHitDateArray.length > 0 || oppNotesHitDateArray vocals.pause(); if(!ffmpegMode){ if(ClientPrefs.noteOffset <= 0 || ignoreNoteOffset) { - finishCallback(); + endCallback(); } else { finishTimer = new FlxTimer().start(ClientPrefs.noteOffset / 1000, function(tmr:FlxTimer) { - finishCallback(); + endCallback(); }); } - } else finishCallback(); + } else endCallback(); } } @@ -6265,6 +5198,7 @@ if (ClientPrefs.showNPS && (notesHitDateArray.length > 0 || oppNotesHitDateArray if (storyPlaylist.length <= 0) { + disableCoolHealthTween = false; WeekData.loadTheFirstEnabledMod(); FlxG.sound.playMusic(Paths.music('freakyMenu-' + ClientPrefs.daMenuMusic)); @@ -6295,18 +5229,6 @@ if (ClientPrefs.showNPS && (notesHitDateArray.length > 0 || oppNotesHitDateArray trace('LOADING NEXT SONG'); trace(Paths.formatToSongPath(PlayState.storyPlaylist[0]) + difficulty); - var winterHorrorlandNext = (Paths.formatToSongPath(SONG.song) == "eggnog"); - if (winterHorrorlandNext) - { - var blackShit:FlxSprite = new FlxSprite(-FlxG.width * FlxG.camera.zoom, - -FlxG.height * FlxG.camera.zoom).makeGraphic(FlxG.width * 3, FlxG.height * 3, FlxColor.BLACK); - blackShit.scrollFactor.set(); - add(blackShit); - camHUD.visible = false; - - FlxG.sound.play(Paths.sound('Lights_Shut_off')); - } - FlxTransitionableState.skipNextTransIn = true; FlxTransitionableState.skipNextTransOut = true; @@ -6328,20 +5250,14 @@ if (ClientPrefs.showNPS && (notesHitDateArray.length > 0 || oppNotesHitDateArray PlayState.SONG = Song.loadFromJson(PlayState.storyPlaylist[0] + difficulty, PlayState.storyPlaylist[0]); } FlxG.sound.music.stop(); - - if(winterHorrorlandNext) { - new FlxTimer().start(1.5, function(tmr:FlxTimer) { - cancelMusicFadeTween(); - LoadingState.loadAndSwitchState(new PlayState()); - }); - } else { - cancelMusicFadeTween(); - LoadingState.loadAndSwitchState(new PlayState()); - } + disableCoolHealthTween = true; + cancelMusicFadeTween(); + LoadingState.loadAndSwitchState(new PlayState()); } } else { + disableCoolHealthTween = false; trace('WENT BACK TO FREEPLAY??'); WeekData.loadTheFirstEnabledMod(); cancelMusicFadeTween(); @@ -6364,7 +5280,7 @@ if (ClientPrefs.showNPS && (notesHitDateArray.length > 0 || oppNotesHitDateArray #if ACHIEVEMENTS_ALLOWED var achievementObj:AchievementObject = null; - function startAchievement(achieve:String) { + public function startAchievement(achieve:String) { achievementObj = new AchievementObject(achieve, camOther); achievementObj.onFinish = achievementEnd; add(achievementObj); @@ -6398,6 +5314,7 @@ if (ClientPrefs.showNPS && (notesHitDateArray.length > 0 || oppNotesHitDateArray { FlxTransitionableState.skipNextTransOut = true; FlxG.resetState(); + disableCoolHealthTween = true; } else { @@ -6674,7 +5591,7 @@ if (ClientPrefs.showNPS && (notesHitDateArray.length > 0 || oppNotesHitDateArray { pixelShitPart1 = 'goldstuff/'; } - if (!allSicks && ClientPrefs.marvRateColor == 'Golden' && noteDiff < ClientPrefs.perfectWindow && ClientPrefs.hudType != 'Tails Gets Trolled V4' && ClientPrefs.hudType != 'Doki Doki+' && !ClientPrefs.noMarvJudge) + if (!allSicks && ClientPrefs.marvRateColor == 'Golden' && noteDiff < ClientPrefs.perfectWindow && ClientPrefs.ratingType != 'Tails Gets Trolled V4' && ClientPrefs.ratingType != 'Doki Doki+' && !ClientPrefs.noMarvJudge) { pixelShitPart1 = 'goldstuff/'; } @@ -6691,27 +5608,27 @@ if (ClientPrefs.showNPS && (notesHitDateArray.length > 0 || oppNotesHitDateArray rating.y -= ClientPrefs.comboOffset[1]; if (!miss) { - if (!allSicks && ClientPrefs.colorRatingFC && perfects > 0 && noteDiff > ClientPrefs.perfectWindow && ClientPrefs.hudType != 'Tails Gets Trolled V4' && ClientPrefs.hudType != 'Doki Doki+' && ClientPrefs.noMarvJudge) + if (!allSicks && ClientPrefs.colorRatingFC && perfects > 0 && noteDiff > ClientPrefs.perfectWindow && ClientPrefs.ratingType != 'Tails Gets Trolled V4' && ClientPrefs.ratingType != 'Doki Doki+' && ClientPrefs.noMarvJudge) { rating.color = judgeColours.get('perfect'); } - if (!allSicks && ClientPrefs.colorRatingFC && sicks > 0 && noteDiff > ClientPrefs.perfectWindow && ClientPrefs.hudType != 'Tails Gets Trolled V4' && ClientPrefs.hudType != 'Doki Doki+' && ClientPrefs.marvRateColor != 'Golden' && !ClientPrefs.noMarvJudge) + if (!allSicks && ClientPrefs.colorRatingFC && sicks > 0 && noteDiff > ClientPrefs.perfectWindow && ClientPrefs.ratingType != 'Tails Gets Trolled V4' && ClientPrefs.ratingType != 'Doki Doki+' && ClientPrefs.marvRateColor != 'Golden' && !ClientPrefs.noMarvJudge) { rating.color = judgeColours.get('sick'); } - if (!allSicks && ClientPrefs.colorRatingFC && goods > 0 && noteDiff > ClientPrefs.perfectWindow && ClientPrefs.hudType != 'Tails Gets Trolled V4' && ClientPrefs.hudType != 'Doki Doki+') + if (!allSicks && ClientPrefs.colorRatingFC && goods > 0 && noteDiff > ClientPrefs.perfectWindow && ClientPrefs.ratingType != 'Tails Gets Trolled V4' && ClientPrefs.ratingType != 'Doki Doki+') { rating.color = judgeColours.get('good'); } - if (!allSicks && ClientPrefs.colorRatingFC && bads > 0 && noteDiff > ClientPrefs.perfectWindow && ClientPrefs.hudType != 'Tails Gets Trolled V4' && ClientPrefs.hudType != 'Doki Doki+') + if (!allSicks && ClientPrefs.colorRatingFC && bads > 0 && noteDiff > ClientPrefs.perfectWindow && ClientPrefs.ratingType != 'Tails Gets Trolled V4' && ClientPrefs.ratingType != 'Doki Doki+') { rating.color = judgeColours.get('bad'); } - if (!allSicks && ClientPrefs.colorRatingFC && shits > 0 && noteDiff > ClientPrefs.perfectWindow && ClientPrefs.hudType != 'Tails Gets Trolled V4' && ClientPrefs.hudType != 'Doki Doki+') + if (!allSicks && ClientPrefs.colorRatingFC && shits > 0 && noteDiff > ClientPrefs.perfectWindow && ClientPrefs.ratingType != 'Tails Gets Trolled V4' && ClientPrefs.ratingType != 'Doki Doki+') { rating.color = judgeColours.get('shit'); } - if (!allSicks && ClientPrefs.colorRatingHit && ClientPrefs.hudType != 'Tails Gets Trolled V4' && ClientPrefs.hudType != 'Doki Doki+' && !miss) + if (!allSicks && ClientPrefs.colorRatingHit && ClientPrefs.ratingType != 'Tails Gets Trolled V4' && ClientPrefs.ratingType != 'Doki Doki+' && !miss) { switch (daRating.name) //This is so stupid, but it works { @@ -6779,7 +5696,7 @@ if (ClientPrefs.showNPS && (notesHitDateArray.length > 0 || oppNotesHitDateArray numScore.x += ClientPrefs.comboOffset[2]; numScore.y -= ClientPrefs.comboOffset[3]; - if (ClientPrefs.colorRatingHit && ClientPrefs.hudType != 'Tails Gets Trolled V4' && ClientPrefs.hudType != 'Doki Doki+' && noteDiff >= ClientPrefs.perfectWindow) numScore.color = rating.color; + if (ClientPrefs.colorRatingHit && ClientPrefs.ratingType != 'Tails Gets Trolled V4' && ClientPrefs.ratingType != 'Doki Doki+' && noteDiff >= ClientPrefs.perfectWindow) numScore.color = rating.color; if (!ClientPrefs.comboStacking) lastScore.push(numScore); @@ -8078,182 +6995,6 @@ if (ClientPrefs.showNPS && (notesHitDateArray.length > 0 || oppNotesHitDateArray grpNoteSplashes.add(splash); } - var fastCarCanDrive:Bool = true; - - function resetFastCar():Void - { - fastCar.x = -12600; - fastCar.y = FlxG.random.int(140, 250); - fastCar.velocity.x = 0; - fastCarCanDrive = true; - } - - var carTimer:FlxTimer; - function fastCarDrive() - { - //trace('Car drive'); - FlxG.sound.play(Paths.soundRandom('carPass', 0, 1), 0.7); - - fastCar.velocity.x = (FlxG.random.int(170, 220) / FlxG.elapsed) * 3; - fastCarCanDrive = false; - carTimer = new FlxTimer().start(2, function(tmr:FlxTimer) - { - resetFastCar(); - carTimer = null; - }); - } - - var trainMoving:Bool = false; - var trainFrameTiming:Float = 0; - - var trainCars:Int = 8; - var trainFinishing:Bool = false; - var trainCooldown:Int = 0; - - function trainStart():Void - { - trainMoving = true; - if (!trainSound.playing) - trainSound.play(true); - } - - var startedMoving:Bool = false; - - function updateTrainPos():Void - { - if (trainSound.time >= 4700) - { - startedMoving = true; - if (gf != null) - { - gf.playAnim('hairBlow'); - gf.specialAnim = true; - } - } - - if (startedMoving) - { - phillyTrain.x -= 400; - - if (phillyTrain.x < -2000 && !trainFinishing) - { - phillyTrain.x = -1150; - trainCars -= 1; - - if (trainCars <= 0) - trainFinishing = true; - } - - if (phillyTrain.x < -4000 && trainFinishing) - trainReset(); - } - } - - function trainReset():Void - { - if(gf != null) - { - gf.danced = false; //Sets head to the correct position once the animation ends - gf.playAnim('hairFall'); - gf.specialAnim = true; - } - phillyTrain.x = FlxG.width + 200; - trainMoving = false; - // trainSound.stop(); - // trainSound.time = 0; - trainCars = 8; - trainFinishing = false; - startedMoving = false; - } - - function lightningStrikeShit():Void - { - FlxG.sound.play(Paths.soundRandom('thunder_', 1, 2)); - if(!ClientPrefs.lowQuality) halloweenBG.animation.play('halloweem bg lightning strike'); - - lightningStrikeBeat = curBeat; - lightningOffset = FlxG.random.int(8, 24); - - if(boyfriend.animOffsets.exists('scared')) { - boyfriend.playAnim('scared', true); - } - - if(gf != null && gf.animOffsets.exists('scared')) { - gf.playAnim('scared', true); - } - - if(ClientPrefs.camZooms) { - FlxG.camera.zoom += 0.015; - camHUD.zoom += 0.03; - - if(!camZooming) { //Just a way for preventing it to be permanently zoomed until Skid & Pump hits a note - FlxTween.tween(FlxG.camera, {zoom: defaultCamZoom}, 0.5); - FlxTween.tween(camHUD, {zoom: 1}, 0.5); - } - } - - if(ClientPrefs.flashing) { - halloweenWhite.alpha = 0.4; - FlxTween.tween(halloweenWhite, {alpha: 0.5}, 0.075); - FlxTween.tween(halloweenWhite, {alpha: 0}, 0.25, {startDelay: 0.15}); - } - } - - function killHenchmen():Void - { - if(!ClientPrefs.lowQuality && ClientPrefs.violence && curStage == 'limo') { - if(limoKillingState < 1) { - limoMetalPole.x = -400; - limoMetalPole.visible = true; - limoLight.visible = true; - limoCorpse.visible = false; - limoCorpseTwo.visible = false; - limoKillingState = 1; - - #if ACHIEVEMENTS_ALLOWED - Achievements.henchmenDeath++; - FlxG.save.data.henchmenDeath = Achievements.henchmenDeath; - var achieve:String = checkForAchievement(['roadkill_enthusiast']); - if (achieve != null) { - startAchievement(achieve); - } else { - FlxG.save.flush(); - } - FlxG.log.add('Deaths: ' + Achievements.henchmenDeath); - #end - } - } - } - - function resetLimoKill():Void - { - if(curStage == 'limo') { - limoMetalPole.x = -500; - limoMetalPole.visible = false; - limoLight.x = -500; - limoLight.visible = false; - limoCorpse.x = -500; - limoCorpse.visible = false; - limoCorpseTwo.x = -500; - limoCorpseTwo.visible = false; - } - } - - var tankX:Float = 400; - var tankSpeed:Float = FlxG.random.float(5, 7); - var tankAngle:Float = FlxG.random.int(-90, 45); - - function moveTank(?elapsed:Float = 0):Void - { - if(!inCutscene) - { - tankAngle += elapsed * tankSpeed; - tankGround.angle = tankAngle - 90 + 15; - tankGround.x = tankX + 1500 * Math.cos(Math.PI / 180 * (1 * tankAngle + 180)); - tankGround.y = 1300 + 1100 * Math.sin(Math.PI / 180 * (1 * tankAngle + 180)); - } - } - override function destroy() { for (lua in luaArray) { lua.call('onDestroy', []); @@ -8284,6 +7025,7 @@ if (ClientPrefs.showNPS && (notesHitDateArray.length > 0 || oppNotesHitDateArray FlxG.animationTimeScale = 1; } } + Paths.noteSkinFramesMap.clear(); Paths.noteSkinAnimsMap.clear(); Paths.splashSkinFramesMap.clear(); @@ -8304,6 +7046,7 @@ if (ClientPrefs.showNPS && (notesHitDateArray.length > 0 || oppNotesHitDateArray var lastStepHit:Int = -1; override function stepHit() { + if (curStep == 0) moveCameraSection(); super.stepHit(); if (tankmanAscend) @@ -8435,9 +7178,6 @@ if (ClientPrefs.showNPS && (notesHitDateArray.length > 0 || oppNotesHitDateArray callOnLuas('onStepHit', []); } - var lightningStrikeBeat:Int = 0; - var lightningOffset:Int = 8; - var lastBeatHit:Int = -1; override function beatHit() @@ -8502,61 +7242,6 @@ if (ClientPrefs.showNPS && (notesHitDateArray.length > 0 || oppNotesHitDateArray { dad.dance(); } - - switch (curStage) - { - case 'tank': - if(!ClientPrefs.lowQuality) tankWatchtower.dance(); - foregroundSprites.forEach(function(spr:BGSprite) - { - spr.dance(); - }); - - case 'school': - if(!ClientPrefs.lowQuality) { - bgGirls.dance(); - } - - case 'mall': - if(!ClientPrefs.lowQuality) { - upperBoppers.dance(true); - } - - if(heyTimer <= 0) bottomBoppers.dance(true); - santa.dance(true); - - case 'limo': - if(!ClientPrefs.lowQuality) { - grpLimoDancers.forEach(function(dancer:BackgroundDancer) - { - dancer.dance(); - }); - } - - if (FlxG.random.bool(10) && fastCarCanDrive) - fastCarDrive(); - case "philly": - if (!trainMoving) - trainCooldown += 1; - - if (curBeat % 4 == 0) - { - curLight = FlxG.random.int(0, phillyLightsColors.length - 1, [curLight]); - phillyWindow.color = phillyLightsColors[curLight]; - phillyWindow.alpha = 1; - } - - if (curBeat % 8 == 4 && FlxG.random.bool(30) && !trainMoving && trainCooldown > 8) - { - trainCooldown = FlxG.random.int(-4, 0); - trainStart(); - } - } - - if (curStage == 'spooky' && FlxG.random.bool(10) && curBeat > lightningStrikeBeat + lightningOffset) - { - lightningStrikeShit(); - } } lastBeatHit = curBeat; @@ -8575,7 +7260,7 @@ if (ClientPrefs.showNPS && (notesHitDateArray.length > 0 || oppNotesHitDateArray moveCameraSection(); } - if (ClientPrefs.hudType == 'Leather Engine') timeBar.color = SONG.notes[curSection].mustHitSection ? FlxColor.fromRGB(boyfriend.healthColorArray[0], boyfriend.healthColorArray[1], boyfriend.healthColorArray[2]) : FlxColor.fromRGB(dad.healthColorArray[0], dad.healthColorArray[1], dad.healthColorArray[2]); + if (ClientPrefs.timeBarStyle == 'Leather Engine') timeBar.color = SONG.notes[curSection].mustHitSection ? FlxColor.fromRGB(boyfriend.healthColorArray[0], boyfriend.healthColorArray[1], boyfriend.healthColorArray[2]) : FlxColor.fromRGB(dad.healthColorArray[0], dad.healthColorArray[1], dad.healthColorArray[2]); if (SONG.notes[curSection].changeBPM) { @@ -9055,7 +7740,7 @@ if (ClientPrefs.showNPS && (notesHitDateArray.length > 0 || oppNotesHitDateArray } #if ACHIEVEMENTS_ALLOWED - private function checkForAchievement(achievesToCheck:Array = null):String + public function checkForAchievement(achievesToCheck:Array = null):String { if(chartingMode || trollingMode) return null; diff --git a/source/import.hx b/source/import.hx index 4b6700acbca..506507daf1f 100644 --- a/source/import.hx +++ b/source/import.hx @@ -1,5 +1,33 @@ #if !macro import Paths; import haxe.ds.Vector as HaxeVector; //apparently denpa uses vectors, which is required for camera panning i guess -import flixel.group.FlxSpriteGroup; + +#if sys +import sys.*; +import sys.io.*; +#elseif js +import js.html.*; +#end + +#if flxanimate +import flxanimate.*; #end + +//so that it doesn't bring up a "Type not found: Countdown" +import BaseStage.Countdown; + +//Flixel +import flixel.sound.FlxSound; +import flixel.FlxG; +import flixel.FlxSprite; +import flixel.FlxCamera; +import flixel.math.FlxMath; +import flixel.math.FlxPoint; +import flixel.util.FlxColor; +import flixel.util.FlxTimer; +import flixel.text.FlxText; +import flixel.tweens.FlxEase; +import flixel.tweens.FlxTween; +import flixel.group.FlxSpriteGroup; +import flixel.group.FlxGroup.FlxTypedGroup; +#end \ No newline at end of file diff --git a/source/options/VisualsUISubState.hx b/source/options/VisualsUISubState.hx index 9bd2b2d8b7d..796c0f29087 100644 --- a/source/options/VisualsUISubState.hx +++ b/source/options/VisualsUISubState.hx @@ -316,12 +316,44 @@ class VisualsUISubState extends BaseOptionsMenu ['Time Left', 'Time Elapsed', 'Song Name', 'Modern Time', 'Song Name + Time', 'Time Left (No Bar)', 'Time Elapsed (No Bar)', 'Modern Time (No Bar)', 'Disabled']); addOption(option); - var option:Option = new Option('HUD Type:', - "Which HUD would you like?", - 'hudType', + var option:Option = new Option('ScoreTxt Style:', + "How would you like your scoreTxt to look like?", + 'scoreStyle', 'string', - 'VS Impostor', - ['VS Impostor', 'Kade Engine', 'Tails Gets Trolled V4', 'Dave and Bambi', 'Doki Doki+', 'Psych Engine', 'Leather Engine', 'JS Engine']); + 'Psych Engine', + ['Psych Engine', 'VS Impostor', 'Kade Engine', 'Forever Engine', 'TGT V4', 'Dave Engine', 'Doki Doki+', 'Leather Engine', 'JS Engine']); + addOption(option); + + var option:Option = new Option('Time Bar Style:', + "How would you like the Time Bar to look like?", + 'timeBarStyle', + 'string', + 'Vanilla', + ['Vanilla', 'VS Impostor', 'TGT V4', 'Dave Engine', 'Doki Doki+', 'Leather Engine', 'JS Engine']); + addOption(option); + + var option:Option = new Option('Health Bar Style:', + "How would you like your Health Bar to look?", + 'healthBarStyle', + 'string', + 'Vanilla', + ['Vanilla', 'Dave Engine', 'Doki Doki+']); + addOption(option); + + var option:Option = new Option('Watermark Style:', + "How would you like your Watermark to look?", + 'watermarkStyle', + 'string', + 'Vanilla', + ['Vanilla', 'Kade Engine', 'Dave Engine', 'JS Engine', 'Forever Engine', 'Hide']); + addOption(option); + + var option:Option = new Option('Bot Txt Style:', + "How would you like your Botplay text to look?", + 'botTxtStyle', + 'string', + 'Vanilla', + ['Vanilla', 'JS Engine', 'Dave Engine', 'Doki Doki+', 'TGT V4', 'VS Impostor', 'Hide']); addOption(option); var option:Option = new Option('Strum Light Up Style:', diff --git a/source/stages/Limo.hx b/source/stages/Limo.hx new file mode 100644 index 00000000000..a8cb9c62f17 --- /dev/null +++ b/source/stages/Limo.hx @@ -0,0 +1,279 @@ +package stages; + +import stages.objects.*; + +enum HenchmenKillState +{ + WAIT; + KILLING; + SPEEDING_OFFSCREEN; + SPEEDING; + STOPPING; +} + +class Limo extends BaseStage +{ + var grpLimoDancers:FlxTypedGroup; + var fastCar:BGSprite; + var fastCarCanDrive:Bool = true; + + // event + var limoKillingState:HenchmenKillState = WAIT; + var limoMetalPole:BGSprite; + var limoLight:BGSprite; + var limoCorpse:BGSprite; + var limoCorpseTwo:BGSprite; + var bgLimo:BGSprite; + var grpLimoParticles:FlxTypedGroup; + var dancersDiff:Float = 320; + + override function create() + { + var skyBG:BGSprite = new BGSprite('limo/limoSunset', -120, -50, 0.1, 0.1); + add(skyBG); + + if(!ClientPrefs.lowQuality) { + limoMetalPole = new BGSprite('gore/metalPole', -500, 220, 0.4, 0.4); + add(limoMetalPole); + + bgLimo = new BGSprite('limo/bgLimo', -150, 480, 0.4, 0.4, ['background limo pink'], true); + add(bgLimo); + + limoCorpse = new BGSprite('gore/noooooo', -500, limoMetalPole.y - 130, 0.4, 0.4, ['Henchmen on rail'], true); + add(limoCorpse); + + limoCorpseTwo = new BGSprite('gore/noooooo', -500, limoMetalPole.y, 0.4, 0.4, ['henchmen death'], true); + add(limoCorpseTwo); + + grpLimoDancers = new FlxTypedGroup(); + add(grpLimoDancers); + + for (i in 0...5) + { + var dancer:BackgroundDancer = new BackgroundDancer((370 * i) + dancersDiff + bgLimo.x, bgLimo.y - 400); + dancer.scrollFactor.set(0.4, 0.4); + grpLimoDancers.add(dancer); + } + + limoLight = new BGSprite('gore/coldHeartKiller', limoMetalPole.x - 180, limoMetalPole.y - 80, 0.4, 0.4); + add(limoLight); + + grpLimoParticles = new FlxTypedGroup(); + add(grpLimoParticles); + + //PRECACHE BLOOD + var particle:BGSprite = new BGSprite('gore/stupidBlood', -400, -400, 0.4, 0.4, ['blood'], false); + particle.alpha = 0.01; + grpLimoParticles.add(particle); + resetLimoKill(); + + //PRECACHE SOUND + Paths.sound('dancerdeath'); + setDefaultGF('gf-car'); + } + + fastCar = new BGSprite('limo/fastCarLol', -300, 160); + fastCar.active = true; + } + override function createPost() + { + resetFastCar(); + addBehindGF(fastCar); + + var limo:BGSprite = new BGSprite('limo/limoDrive', -120, 550, 1, 1, ['Limo stage'], true); + addBehindGF(limo); //Shitty layering but whatev it works LOL + } + + var limoSpeed:Float = 0; + override function update(elapsed:Float) + { + if(!ClientPrefs.lowQuality) { + grpLimoParticles.forEach(function(spr:BGSprite) { + if(spr.animation.curAnim.finished) { + spr.kill(); + grpLimoParticles.remove(spr, true); + spr.destroy(); + } + }); + + switch(limoKillingState) { + case KILLING: + limoMetalPole.x += 5000 * elapsed; + limoLight.x = limoMetalPole.x - 180; + limoCorpse.x = limoLight.x - 50; + limoCorpseTwo.x = limoLight.x + 35; + + var dancers:Array = grpLimoDancers.members; + for (i in 0...dancers.length) { + if(dancers[i].x < FlxG.width * 1.5 && limoLight.x > (370 * i) + 170) { + switch(i) { + case 0 | 3: + if(i == 0) FlxG.sound.play(Paths.sound('dancerdeath'), 0.5); + + var diffStr:String = i == 3 ? ' 2 ' : ' '; + var particle:BGSprite = new BGSprite('gore/noooooo', dancers[i].x + 200, dancers[i].y, 0.4, 0.4, ['hench leg spin' + diffStr + 'PINK'], false); + grpLimoParticles.add(particle); + var particle:BGSprite = new BGSprite('gore/noooooo', dancers[i].x + 160, dancers[i].y + 200, 0.4, 0.4, ['hench arm spin' + diffStr + 'PINK'], false); + grpLimoParticles.add(particle); + var particle:BGSprite = new BGSprite('gore/noooooo', dancers[i].x, dancers[i].y + 50, 0.4, 0.4, ['hench head spin' + diffStr + 'PINK'], false); + grpLimoParticles.add(particle); + + var particle:BGSprite = new BGSprite('gore/stupidBlood', dancers[i].x - 110, dancers[i].y + 20, 0.4, 0.4, ['blood'], false); + particle.flipX = true; + particle.angle = -57.5; + grpLimoParticles.add(particle); + case 1: + limoCorpse.visible = true; + case 2: + limoCorpseTwo.visible = true; + } //Note: Nobody cares about the fifth dancer because he is mostly hidden offscreen :( + dancers[i].x += FlxG.width * 2; + } + } + + if(limoMetalPole.x > FlxG.width * 2) { + resetLimoKill(); + limoSpeed = 800; + limoKillingState = SPEEDING_OFFSCREEN; + } + + case SPEEDING_OFFSCREEN: + limoSpeed -= 4000 * elapsed; + bgLimo.x -= limoSpeed * elapsed; + if(bgLimo.x > FlxG.width * 1.5) { + limoSpeed = 3000; + limoKillingState = SPEEDING; + } + + case SPEEDING: + limoSpeed -= 2000 * elapsed; + if(limoSpeed < 1000) limoSpeed = 1000; + + bgLimo.x -= limoSpeed * elapsed; + if(bgLimo.x < -275) { + limoKillingState = STOPPING; + limoSpeed = 800; + } + dancersParenting(); + + case STOPPING: + bgLimo.x = FlxMath.lerp(-150, bgLimo.x, Math.exp(-elapsed * 9)); + if(Math.round(bgLimo.x) == -150) { + bgLimo.x = -150; + limoKillingState = WAIT; + } + dancersParenting(); + + default: //nothing + } + } + } + + override function beatHit() + { + if(!ClientPrefs.lowQuality) { + grpLimoDancers.forEach(function(dancer:BackgroundDancer) + { + dancer.dance(); + }); + } + + if (FlxG.random.bool(10) && fastCarCanDrive) + fastCarDrive(); + } + + // Substates for pausing/resuming tweens and timers + override function closeSubState() + { + if(paused) + { + if(carTimer != null) carTimer.active = true; + } + } + + override function openSubState(SubState:flixel.FlxSubState) + { + if(paused) + { + if(carTimer != null) carTimer.active = false; + } + } + + override function eventCalled(eventName:String, value1:String, value2:String, flValue1:Null, flValue2:Null, strumTime:Float) + { + switch(eventName) + { + case "Kill Henchmen": + killHenchmen(); + } + } + + function dancersParenting() + { + var dancers:Array = grpLimoDancers.members; + for (i in 0...dancers.length) { + dancers[i].x = (370 * i) + dancersDiff + bgLimo.x; + } + } + + function resetLimoKill():Void + { + limoMetalPole.x = -500; + limoMetalPole.visible = false; + limoLight.x = -500; + limoLight.visible = false; + limoCorpse.x = -500; + limoCorpse.visible = false; + limoCorpseTwo.x = -500; + limoCorpseTwo.visible = false; + } + + function resetFastCar():Void + { + fastCar.x = -12600; + fastCar.y = FlxG.random.int(140, 250); + fastCar.velocity.x = 0; + fastCarCanDrive = true; + } + + var carTimer:FlxTimer; + function fastCarDrive() + { + //trace('Car drive'); + FlxG.sound.play(Paths.soundRandom('carPass', 0, 1), 0.7); + + fastCar.velocity.x = (FlxG.random.int(170, 220) / FlxG.elapsed) * 3; + fastCarCanDrive = false; + carTimer = new FlxTimer().start(2, function(tmr:FlxTimer) + { + resetFastCar(); + carTimer = null; + }); + } + + function killHenchmen():Void + { + if(!ClientPrefs.lowQuality) { + if(limoKillingState == WAIT) { + limoMetalPole.x = -400; + limoMetalPole.visible = true; + limoLight.visible = true; + limoCorpse.visible = false; + limoCorpseTwo.visible = false; + limoKillingState = KILLING; + + #if ACHIEVEMENTS_ALLOWED + Achievements.henchmenDeath++; + FlxG.save.data.henchmenDeath = Achievements.henchmenDeath; + var achieve:String = PlayState.instance.checkForAchievement(['roadkill_enthusiast']); + if (achieve != null) { + PlayState.instance.startAchievement(achieve); + } else { + FlxG.save.flush(); + } + FlxG.log.add('Deaths: ' + Achievements.henchmenDeath); + #end + } + } + } +} \ No newline at end of file diff --git a/source/stages/Mall.hx b/source/stages/Mall.hx new file mode 100644 index 00000000000..1821e72f52f --- /dev/null +++ b/source/stages/Mall.hx @@ -0,0 +1,103 @@ +package stages; + +import stages.objects.*; + +class Mall extends BaseStage +{ + var upperBoppers:BGSprite; + var bottomBoppers:MallCrowd; + var santa:BGSprite; + + override function create() + { + var bg:BGSprite = new BGSprite('christmas/bgWalls', -1000, -500, 0.2, 0.2); + bg.setGraphicSize(Std.int(bg.width * 0.8)); + bg.updateHitbox(); + add(bg); + + if(!ClientPrefs.lowQuality) { + upperBoppers = new BGSprite('christmas/upperBop', -240, -90, 0.33, 0.33, ['Upper Crowd Bob']); + upperBoppers.setGraphicSize(Std.int(upperBoppers.width * 0.85)); + upperBoppers.updateHitbox(); + add(upperBoppers); + + var bgEscalator:BGSprite = new BGSprite('christmas/bgEscalator', -1100, -600, 0.3, 0.3); + bgEscalator.setGraphicSize(Std.int(bgEscalator.width * 0.9)); + bgEscalator.updateHitbox(); + add(bgEscalator); + } + + var tree:BGSprite = new BGSprite('christmas/christmasTree', 370, -250, 0.40, 0.40); + add(tree); + + bottomBoppers = new MallCrowd(-300, 140); + add(bottomBoppers); + + var fgSnow:BGSprite = new BGSprite('christmas/fgSnow', -600, 700); + add(fgSnow); + + santa = new BGSprite('christmas/santa', -840, 150, 1, 1, ['santa idle in fear']); + add(santa); + Paths.sound('Lights_Shut_off'); + setDefaultGF('gf-christmas'); + + if(isStoryMode && !seenCutscene) + setEndCallback(eggnogEndCutscene); + } + + override function countdownTick(count:Countdown, num:Int) everyoneDance(); + override function beatHit() everyoneDance(); + + override function eventCalled(eventName:String, value1:String, value2:String, flValue1:Null, flValue2:Null, strumTime:Float) + { + switch(eventName) + { + case "Hey!": + switch(value1.toLowerCase()) { + case 'bf' | 'boyfriend' | '0': + return; + } + bottomBoppers.animation.play('hey', true); + bottomBoppers.heyTimer = flValue2; + } + } + + function everyoneDance() + { + if(!ClientPrefs.lowQuality) + upperBoppers.dance(true); + + bottomBoppers.dance(true); + santa.dance(true); + } + + function eggnogEndCutscene() + { + if(PlayState.storyPlaylist[1] == null) + { + endSong(); + return; + } + + var nextSong:String = Paths.formatToSongPath(PlayState.storyPlaylist[1]); + trace (nextSong); + if(nextSong == 'winter-horrorland') + { + FlxG.sound.play(Paths.sound('Lights_Shut_off')); + + var blackShit:FlxSprite = new FlxSprite(-FlxG.width * FlxG.camera.zoom, + -FlxG.height * FlxG.camera.zoom).makeGraphic(FlxG.width * 3, FlxG.height * 3, FlxColor.BLACK); + blackShit.scrollFactor.set(); + add(blackShit); + camHUD.visible = false; + + inCutscene = true; + canPause = false; + + new FlxTimer().start(1.5, function(tmr:FlxTimer) { + endSong(); + }); + } + else endSong(); + } +} \ No newline at end of file diff --git a/source/stages/MallEvil.hx b/source/stages/MallEvil.hx new file mode 100644 index 00000000000..c3fc222f66e --- /dev/null +++ b/source/stages/MallEvil.hx @@ -0,0 +1,69 @@ +package stages; + +import stages.objects.*; +import flixel.FlxObject; + +class MallEvil extends BaseStage +{ + override function create() + { + var bg:BGSprite = new BGSprite('christmas/evilBG', -400, -500, 0.2, 0.2); + bg.setGraphicSize(Std.int(bg.width * 0.8)); + bg.updateHitbox(); + add(bg); + + var evilTree:BGSprite = new BGSprite('christmas/evilTree', 300, -300, 0.2, 0.2); + add(evilTree); + + var evilSnow:BGSprite = new BGSprite('christmas/evilSnow', -200, 700); + add(evilSnow); + setDefaultGF('gf-christmas'); + + //Winter Horrorland cutscene + if (isStoryMode && !seenCutscene) + { + switch(songName) + { + case 'winter-horrorland': + setStartCallback(winterHorrorlandCutscene); + } + } + } + + function winterHorrorlandCutscene() + { + camHUD.visible = false; + inCutscene = true; + + FlxG.sound.play(Paths.sound('Lights_Turn_On')); + FlxG.camera.zoom = 1.5; + FlxG.camera.follow(new FlxObject(400, -2050)); + + // blackout at the start + var blackScreen:FlxSprite = new FlxSprite().makeGraphic(Std.int(FlxG.width * 2), Std.int(FlxG.height * 2), FlxColor.BLACK); + blackScreen.scrollFactor.set(); + add(blackScreen); + + FlxTween.tween(blackScreen, {alpha: 0}, 0.7, { + ease: FlxEase.linear, + onComplete: function(twn:FlxTween) { + remove(blackScreen); + } + }); + + // zoom out + new FlxTimer().start(0.8, function(tmr:FlxTimer) + { + camHUD.visible = true; + FlxTween.tween(FlxG.camera, {zoom: defaultCamZoom}, 2.5, { + ease: FlxEase.quadInOut, + onComplete: function(twn:FlxTween) + { + startCountdown(); + FlxG.camera.follow(PlayState.instance.camFollowPos); + FlxG.camera.focusOn(camFollow); + } + }); + }); + } +} \ No newline at end of file diff --git a/source/stages/Philly.hx b/source/stages/Philly.hx new file mode 100644 index 00000000000..6b61782d7f2 --- /dev/null +++ b/source/stages/Philly.hx @@ -0,0 +1,215 @@ +package stages; + +import stages.objects.*; +import Character; + +class Philly extends BaseStage +{ + var phillyLightsColors:Array; + var phillyWindow:BGSprite; + var phillyStreet:BGSprite; + var phillyTrain:PhillyTrain; + var curLight:Int = -1; + + //For Philly Glow events + var blammedLightsBlack:FlxSprite; + var phillyGlowGradient:PhillyGlowGradient; + var phillyGlowParticles:FlxTypedGroup; + var phillyWindowEvent:BGSprite; + var curLightEvent:Int = -1; + + override function create() + { + if(!ClientPrefs.lowQuality) { + var bg:BGSprite = new BGSprite('philly/sky', -100, 0, 0.1, 0.1); + add(bg); + } + + var city:BGSprite = new BGSprite('philly/city', -10, 0, 0.3, 0.3); + city.setGraphicSize(Std.int(city.width * 0.85)); + city.updateHitbox(); + add(city); + + phillyLightsColors = [0xFF31A2FD, 0xFF31FD8C, 0xFFFB33F5, 0xFFFD4531, 0xFFFBA633]; + phillyWindow = new BGSprite('philly/window', city.x, city.y, 0.3, 0.3); + phillyWindow.setGraphicSize(Std.int(phillyWindow.width * 0.85)); + phillyWindow.updateHitbox(); + add(phillyWindow); + phillyWindow.alpha = 0; + + if(!ClientPrefs.lowQuality) { + var streetBehind:BGSprite = new BGSprite('philly/behindTrain', -40, 50); + add(streetBehind); + } + + phillyTrain = new PhillyTrain(2000, 360); + add(phillyTrain); + + phillyStreet = new BGSprite('philly/street', -40, 50); + add(phillyStreet); + } + override function eventPushed(event:Note.EventNote) + { + switch(event.event) + { + case "Philly Glow": + blammedLightsBlack = new FlxSprite(FlxG.width * -0.5, FlxG.height * -0.5).makeGraphic(Std.int(FlxG.width * 2), Std.int(FlxG.height * 2), FlxColor.BLACK); + blammedLightsBlack.visible = false; + insert(members.indexOf(phillyStreet), blammedLightsBlack); + + phillyWindowEvent = new BGSprite('philly/window', phillyWindow.x, phillyWindow.y, 0.3, 0.3); + phillyWindowEvent.setGraphicSize(Std.int(phillyWindowEvent.width * 0.85)); + phillyWindowEvent.updateHitbox(); + phillyWindowEvent.visible = false; + insert(members.indexOf(blammedLightsBlack) + 1, phillyWindowEvent); + + + phillyGlowGradient = new PhillyGlowGradient(-400, 225); //This shit was refusing to properly load FlxGradient so fuck it + phillyGlowGradient.visible = false; + insert(members.indexOf(blammedLightsBlack) + 1, phillyGlowGradient); + if(!ClientPrefs.flashing) phillyGlowGradient.intendedAlpha = 0.7; + + Paths.image('philly/particle'); //precache philly glow particle image + phillyGlowParticles = new FlxTypedGroup(); + phillyGlowParticles.visible = false; + insert(members.indexOf(phillyGlowGradient) + 1, phillyGlowParticles); + } + } + + override function update(elapsed:Float) + { + phillyWindow.alpha -= (Conductor.crochet / 1000) * FlxG.elapsed * 1.5; + if(phillyGlowParticles != null) + { + var i:Int = phillyGlowParticles.members.length-1; + while (i > 0) + { + var particle = phillyGlowParticles.members[i]; + if(particle.alpha <= 0) + { + particle.kill(); + phillyGlowParticles.remove(particle, true); + particle.destroy(); + } + --i; + } + } + } + + override function beatHit() + { + phillyTrain.beatHit(curBeat); + if (curBeat % 4 == 0) + { + curLight = FlxG.random.int(0, phillyLightsColors.length - 1, [curLight]); + phillyWindow.color = phillyLightsColors[curLight]; + phillyWindow.alpha = 1; + } + } + + override function eventCalled(eventName:String, value1:String, value2:String, flValue1:Null, flValue2:Null, strumTime:Float) + { + switch(eventName) + { + case "Philly Glow": + if(flValue1 == null || flValue1 <= 0) flValue1 = 0; + var lightId:Int = Math.round(flValue1); + + var chars:Array = [boyfriend, gf, dad]; + switch(lightId) + { + case 0: + if(phillyGlowGradient.visible) + { + doFlash(); + if(ClientPrefs.camZooms) + { + FlxG.camera.zoom += 0.5; + camHUD.zoom += 0.1; + } + + blammedLightsBlack.visible = false; + phillyWindowEvent.visible = false; + phillyGlowGradient.visible = false; + phillyGlowParticles.visible = false; + curLightEvent = -1; + + for (who in chars) + { + who.color = FlxColor.WHITE; + } + phillyStreet.color = FlxColor.WHITE; + } + + case 1: //turn on + curLightEvent = FlxG.random.int(0, phillyLightsColors.length-1, [curLightEvent]); + var color:FlxColor = phillyLightsColors[curLightEvent]; + + if(!phillyGlowGradient.visible) + { + doFlash(); + if(ClientPrefs.camZooms) + { + FlxG.camera.zoom += 0.5; + camHUD.zoom += 0.1; + } + + blammedLightsBlack.visible = true; + blammedLightsBlack.alpha = 1; + phillyWindowEvent.visible = true; + phillyGlowGradient.visible = true; + phillyGlowParticles.visible = true; + } + else if(ClientPrefs.flashing) + { + var colorButLower:FlxColor = color; + colorButLower.alphaFloat = 0.25; + FlxG.camera.flash(colorButLower, 0.5, null, true); + } + + var charColor:FlxColor = color; + if(!ClientPrefs.flashing) charColor.saturation *= 0.5; + else charColor.saturation *= 0.75; + + for (who in chars) + { + who.color = charColor; + } + phillyGlowParticles.forEachAlive(function(particle:PhillyGlowParticle) + { + particle.color = color; + }); + phillyGlowGradient.color = color; + phillyWindowEvent.color = color; + + color.brightness *= 0.5; + phillyStreet.color = color; + + case 2: // spawn particles + if(!ClientPrefs.lowQuality) + { + var particlesNum:Int = FlxG.random.int(8, 12); + var width:Float = (2000 / particlesNum); + var color:FlxColor = phillyLightsColors[curLightEvent]; + for (j in 0...3) + { + for (i in 0...particlesNum) + { + var particle:PhillyGlowParticle = new PhillyGlowParticle(-400 + width * i + FlxG.random.float(-width / 5, width / 5), phillyGlowGradient.originalY + 200 + (FlxG.random.float(0, 125) + j * 40), color); + phillyGlowParticles.add(particle); + } + } + } + phillyGlowGradient.bop(); + } + } + } + + function doFlash() + { + var color:FlxColor = FlxColor.WHITE; + if(!ClientPrefs.flashing) color.alphaFloat = 0.5; + + FlxG.camera.flash(color, 0.15, null, true); + } +} \ No newline at end of file diff --git a/source/stages/School.hx b/source/stages/School.hx new file mode 100644 index 00000000000..fb88c3da121 --- /dev/null +++ b/source/stages/School.hx @@ -0,0 +1,155 @@ +package stages; + +import stages.objects.*; +import GameOverSubstate; +import DialogueBox; + +import openfl.utils.Assets as OpenFlAssets; + +class School extends BaseStage +{ + var bgGirls:BackgroundGirls; + override function create() + { + var _song = PlayState.SONG; + GameOverSubstate.deathSoundName = 'fnf_loss_sfx-pixel'; + GameOverSubstate.loopSoundName = 'gameOver-pixel'; + GameOverSubstate.endSoundName = 'gameOverEnd-pixel'; + GameOverSubstate.characterName = 'bf-pixel-dead'; + + var bgSky:BGSprite = new BGSprite('weeb/weebSky', 0, 0, 0.1, 0.1); + add(bgSky); + bgSky.antialiasing = false; + + var repositionShit = -200; + + var bgSchool:BGSprite = new BGSprite('weeb/weebSchool', repositionShit, 0, 0.6, 0.90); + add(bgSchool); + bgSchool.antialiasing = false; + + var bgStreet:BGSprite = new BGSprite('weeb/weebStreet', repositionShit, 0, 0.95, 0.95); + add(bgStreet); + bgStreet.antialiasing = false; + + var widShit = Std.int(bgSky.width * PlayState.daPixelZoom); + if(!ClientPrefs.lowQuality) { + var fgTrees:BGSprite = new BGSprite('weeb/weebTreesBack', repositionShit + 170, 130, 0.9, 0.9); + fgTrees.setGraphicSize(Std.int(widShit * 0.8)); + fgTrees.updateHitbox(); + add(fgTrees); + fgTrees.antialiasing = false; + } + + var bgTrees:FlxSprite = new FlxSprite(repositionShit - 380, -800); + bgTrees.frames = Paths.getPackerAtlas('weeb/weebTrees'); + bgTrees.animation.add('treeLoop', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18], 12); + bgTrees.animation.play('treeLoop'); + bgTrees.scrollFactor.set(0.85, 0.85); + add(bgTrees); + bgTrees.antialiasing = false; + + if(!ClientPrefs.lowQuality) { + var treeLeaves:BGSprite = new BGSprite('weeb/petals', repositionShit, -40, 0.85, 0.85, ['PETALS ALL'], true); + treeLeaves.setGraphicSize(widShit); + treeLeaves.updateHitbox(); + add(treeLeaves); + treeLeaves.antialiasing = false; + } + + bgSky.setGraphicSize(widShit); + bgSchool.setGraphicSize(widShit); + bgStreet.setGraphicSize(widShit); + bgTrees.setGraphicSize(Std.int(widShit * 1.4)); + + bgSky.updateHitbox(); + bgSchool.updateHitbox(); + bgStreet.updateHitbox(); + bgTrees.updateHitbox(); + + if(!ClientPrefs.lowQuality) { + bgGirls = new BackgroundGirls(-100, 190); + bgGirls.scrollFactor.set(0.9, 0.9); + add(bgGirls); + } + setDefaultGF('gf-pixel'); + + switch (songName) + { + case 'senpai': + FlxG.sound.playMusic(Paths.music('Lunchbox'), 0); + FlxG.sound.music.fadeIn(1, 0, 0.8); + case 'roses': + FlxG.sound.play(Paths.sound('ANGRY_TEXT_BOX')); + } + if(isStoryMode && !seenCutscene) + { + if(songName == 'roses') FlxG.sound.play(Paths.sound('ANGRY')); + initDoof(); + setStartCallback(schoolIntro); + } + } + + override function beatHit() + { + if(bgGirls != null) bgGirls.dance(); + } + + // For events + override function eventCalled(eventName:String, value1:String, value2:String, flValue1:Null, flValue2:Null, strumTime:Float) + { + switch(eventName) + { + case "BG Freaks Expression": + if(bgGirls != null) bgGirls.swapDanceType(); + } + } + + var doof:DialogueBox = null; + function initDoof() + { + var file:String = Paths.txt(songName + '/' + songName + 'Dialogue'); //Checks for vanilla/Senpai dialogue + trace(file); + #if MODS_ALLOWED + if (!FileSystem.exists(file)) + #else + if (!OpenFlAssets.exists(file)) + #end + { + startCountdown(); + return; + } + + doof = new DialogueBox(false, CoolUtil.coolTextFile(file)); + doof.cameras = [camHUD]; + doof.scrollFactor.set(); + doof.finishThing = startCountdown; + doof.nextDialogueThing = PlayState.instance.startNextDialogue; + doof.skipDialogueThing = PlayState.instance.skipDialogue; + } + + function schoolIntro():Void + { + inCutscene = true; + var black:FlxSprite = new FlxSprite(-100, -100).makeGraphic(FlxG.width * 2, FlxG.height * 2, FlxColor.BLACK); + black.scrollFactor.set(); + if(songName == 'senpai') add(black); + + new FlxTimer().start(0.3, function(tmr:FlxTimer) + { + black.alpha -= 0.15; + + if (black.alpha > 0) + tmr.reset(0.3); + else + { + if (doof != null) + add(doof); + else + startCountdown(); + + remove(black); + black.destroy(); + } + }); + } +} \ No newline at end of file diff --git a/source/stages/SchoolEvil.hx b/source/stages/SchoolEvil.hx new file mode 100644 index 00000000000..22fdb0dd086 --- /dev/null +++ b/source/stages/SchoolEvil.hx @@ -0,0 +1,160 @@ +package stages; + +import flixel.addons.effects.FlxTrail; +import stages.objects.*; +import GameOverSubstate; +import DialogueBox; +import openfl.utils.Assets as OpenFlAssets; + +class SchoolEvil extends BaseStage +{ + override function create() + { + var _song = PlayState.SONG; + GameOverSubstate.deathSoundName = 'fnf_loss_sfx-pixel'; + GameOverSubstate.loopSoundName = 'gameOver-pixel'; + GameOverSubstate.endSoundName = 'gameOverEnd-pixel'; + GameOverSubstate.characterName = 'bf-pixel-dead'; + + var posX = 400; + var posY = 200; + + var bg:BGSprite; + if(!ClientPrefs.lowQuality) + bg = new BGSprite('weeb/animatedEvilSchool', posX, posY, 0.8, 0.9, ['background 2'], true); + else + bg = new BGSprite('weeb/animatedEvilSchool_low', posX, posY, 0.8, 0.9); + + bg.scale.set(PlayState.daPixelZoom, PlayState.daPixelZoom); + bg.antialiasing = false; + add(bg); + setDefaultGF('gf-pixel'); + + FlxG.sound.playMusic(Paths.music('LunchboxScary'), 0); + FlxG.sound.music.fadeIn(1, 0, 0.8); + if(isStoryMode && !seenCutscene) + { + initDoof(); + setStartCallback(schoolIntro); + } + } + override function createPost() + { + var trail:FlxTrail = new FlxTrail(dad, null, 4, 24, 0.3, 0.069); + addBehindDad(trail); + } + + // Ghouls event + var bgGhouls:BGSprite; + override function eventCalled(eventName:String, value1:String, value2:String, flValue1:Null, flValue2:Null, strumTime:Float) + { + switch(eventName) + { + case "Trigger BG Ghouls": + if(!ClientPrefs.lowQuality) + { + bgGhouls.dance(true); + bgGhouls.visible = true; + } + } + } + override function eventPushed(event:Note.EventNote) + { + // used for preloading assets used on events + switch(event.event) + { + case "Trigger BG Ghouls": + if(!ClientPrefs.lowQuality) + { + bgGhouls = new BGSprite('weeb/bgGhouls', -100, 190, 0.9, 0.9, ['BG freaks glitch instance'], false); + bgGhouls.setGraphicSize(Std.int(bgGhouls.width * PlayState.daPixelZoom)); + bgGhouls.updateHitbox(); + bgGhouls.visible = false; + bgGhouls.antialiasing = false; + bgGhouls.animation.finishCallback = function(name:String) + { + if(name == 'BG freaks glitch instance') + bgGhouls.visible = false; + } + addBehindGF(bgGhouls); + } + } + } + + var doof:DialogueBox = null; + function initDoof() + { + var file:String = Paths.txt(songName + '/' + songName + 'Dialogue'); //Checks for vanilla/Senpai dialogue + #if MODS_ALLOWED + if (!FileSystem.exists(file)) + #else + if (!OpenFlAssets.exists(file)) + #end + { + startCountdown(); + return; + } + + doof = new DialogueBox(false, CoolUtil.coolTextFile(file)); + doof.cameras = [camHUD]; + doof.scrollFactor.set(); + doof.finishThing = startCountdown; + doof.nextDialogueThing = PlayState.instance.startNextDialogue; + doof.skipDialogueThing = PlayState.instance.skipDialogue; + } + + function schoolIntro():Void + { + inCutscene = true; + var red:FlxSprite = new FlxSprite(-100, -100).makeGraphic(FlxG.width * 2, FlxG.height * 2, 0xFFff1b31); + red.scrollFactor.set(); + add(red); + + var senpaiEvil:FlxSprite = new FlxSprite(); + senpaiEvil.frames = Paths.getSparrowAtlas('weeb/senpaiCrazy'); + senpaiEvil.animation.addByPrefix('idle', 'Senpai Pre Explosion', 24, false); + senpaiEvil.setGraphicSize(Std.int(senpaiEvil.width * 6)); + senpaiEvil.scrollFactor.set(); + senpaiEvil.updateHitbox(); + senpaiEvil.screenCenter(); + senpaiEvil.x += 300; + camHUD.visible = false; + + new FlxTimer().start(2.1, function(tmr:FlxTimer) + { + if (doof != null) + { + add(senpaiEvil); + senpaiEvil.alpha = 0; + new FlxTimer().start(0.3, function(swagTimer:FlxTimer) + { + senpaiEvil.alpha += 0.15; + if (senpaiEvil.alpha < 1) + { + swagTimer.reset(); + } + else + { + senpaiEvil.animation.play('idle'); + FlxG.sound.play(Paths.sound('Senpai_Dies'), 1, false, null, true, function() + { + remove(senpaiEvil); + senpaiEvil.destroy(); + remove(red); + red.destroy(); + FlxG.camera.fade(FlxColor.WHITE, 0.01, true, function() + { + add(doof); + camHUD.visible = true; + }, true); + }); + new FlxTimer().start(3.2, function(deadTime:FlxTimer) + { + FlxG.camera.fade(FlxColor.WHITE, 1.6, false); + }); + } + }); + } + }); + } +} \ No newline at end of file diff --git a/source/stages/Spooky.hx b/source/stages/Spooky.hx new file mode 100644 index 00000000000..8e83af0832a --- /dev/null +++ b/source/stages/Spooky.hx @@ -0,0 +1,116 @@ +package stages; + +class Spooky extends BaseStage +{ + var halloweenBG:BGSprite; + var halloweenWhite:BGSprite; + override function create() + { + if(!ClientPrefs.lowQuality) { + halloweenBG = new BGSprite('halloween_bg', -200, -100, ['halloweem bg0', 'halloweem bg lightning strike']); + } else { + halloweenBG = new BGSprite('halloween_bg_low', -200, -100); + } + add(halloweenBG); + + //PRECACHE SOUNDS + Paths.sound('thunder_1'); + Paths.sound('thunder_2'); + + //Monster cutscene + if (isStoryMode && !seenCutscene) + { + switch(songName) + { + case 'monster': + setStartCallback(monsterCutscene); + } + } + } + override function createPost() + { + halloweenWhite = new BGSprite(null, -800, -400, 0, 0); + halloweenWhite.makeGraphic(Std.int(FlxG.width * 2), Std.int(FlxG.height * 2), FlxColor.WHITE); + halloweenWhite.alpha = 0; + halloweenWhite.blend = ADD; + add(halloweenWhite); + } + + var lightningStrikeBeat:Int = 0; + var lightningOffset:Int = 8; + override function beatHit() + { + if (FlxG.random.bool(10) && curBeat > lightningStrikeBeat + lightningOffset) + { + lightningStrikeShit(); + } + } + + function lightningStrikeShit():Void + { + FlxG.sound.play(Paths.soundRandom('thunder_', 1, 2)); + if(!ClientPrefs.lowQuality) halloweenBG.animation.play('halloweem bg lightning strike'); + + lightningStrikeBeat = curBeat; + lightningOffset = FlxG.random.int(8, 24); + + if(boyfriend.animOffsets.exists('scared')) { + boyfriend.playAnim('scared', true); + } + + if(dad.animOffsets.exists('scared')) { + dad.playAnim('scared', true); + } + + if(gf != null && gf.animOffsets.exists('scared')) { + gf.playAnim('scared', true); + } + + if(ClientPrefs.camZooms) { + FlxG.camera.zoom += 0.015; + camHUD.zoom += 0.03; + + if(!game.camZooming) { //Just a way for preventing it to be permanently zoomed until Skid & Pump hits a note + FlxTween.tween(FlxG.camera, {zoom: defaultCamZoom}, 0.5); + FlxTween.tween(camHUD, {zoom: 1}, 0.5); + } + } + + if(ClientPrefs.flashing) { + halloweenWhite.alpha = 0.4; + FlxTween.tween(halloweenWhite, {alpha: 0.5}, 0.075); + FlxTween.tween(halloweenWhite, {alpha: 0}, 0.25, {startDelay: 0.15}); + } + } + + function monsterCutscene() + { + inCutscene = true; + camHUD.visible = false; + + FlxG.camera.focusOn(new FlxPoint(dad.getMidpoint().x + 150, dad.getMidpoint().y - 100)); + + // character anims + FlxG.sound.play(Paths.soundRandom('thunder_', 1, 2)); + if(gf != null) gf.playAnim('scared', true); + boyfriend.playAnim('scared', true); + + // white flash + var whiteScreen:FlxSprite = new FlxSprite().makeGraphic(Std.int(FlxG.width * 2), Std.int(FlxG.height * 2), FlxColor.WHITE); + whiteScreen.scrollFactor.set(); + whiteScreen.blend = ADD; + add(whiteScreen); + FlxTween.tween(whiteScreen, {alpha: 0}, 1, { + startDelay: 0.1, + ease: FlxEase.linear, + onComplete: function(twn:FlxTween) + { + remove(whiteScreen); + whiteScreen.destroy(); + + camHUD.visible = true; + startCountdown(); + } + }); + } +} \ No newline at end of file diff --git a/source/stages/StageWeek1.hx b/source/stages/StageWeek1.hx new file mode 100644 index 00000000000..741be89fe26 --- /dev/null +++ b/source/stages/StageWeek1.hx @@ -0,0 +1,97 @@ +package stages; + +import stages.objects.*; +import Character; + +class StageWeek1 extends BaseStage +{ + var dadbattleBlack:BGSprite; + var dadbattleLight:BGSprite; + var dadbattleFog:DadBattleFog; + override function create() + { + var bg:BGSprite = new BGSprite('stageback', -600, -200, 0.9, 0.9); + add(bg); + + var stageFront:BGSprite = new BGSprite('stagefront', -650, 600, 0.9, 0.9); + stageFront.setGraphicSize(Std.int(stageFront.width * 1.1)); + stageFront.updateHitbox(); + add(stageFront); + if(!ClientPrefs.lowQuality) { + var stageLight:BGSprite = new BGSprite('stage_light', -125, -100, 0.9, 0.9); + stageLight.setGraphicSize(Std.int(stageLight.width * 1.1)); + stageLight.updateHitbox(); + add(stageLight); + var stageLight:BGSprite = new BGSprite('stage_light', 1225, -100, 0.9, 0.9); + stageLight.setGraphicSize(Std.int(stageLight.width * 1.1)); + stageLight.updateHitbox(); + stageLight.flipX = true; + add(stageLight); + + var stageCurtains:BGSprite = new BGSprite('stagecurtains', -500, -300, 1.3, 1.3); + stageCurtains.setGraphicSize(Std.int(stageCurtains.width * 0.9)); + stageCurtains.updateHitbox(); + add(stageCurtains); + } + } + override function eventPushed(event:Note.EventNote) + { + switch(event.event) + { + case "Dadbattle Spotlight": + dadbattleBlack = new BGSprite(null, -800, -400, 0, 0); + dadbattleBlack.makeGraphic(Std.int(FlxG.width * 2), Std.int(FlxG.height * 2), FlxColor.BLACK); + dadbattleBlack.alpha = 0.25; + dadbattleBlack.visible = false; + add(dadbattleBlack); + + dadbattleLight = new BGSprite('spotlight', 400, -400); + dadbattleLight.alpha = 0.375; + dadbattleLight.blend = ADD; + dadbattleLight.visible = false; + add(dadbattleLight); + + dadbattleFog = new DadBattleFog(); + dadbattleFog.visible = false; + add(dadbattleFog); + } + } + + override function eventCalled(eventName:String, value1:String, value2:String, flValue1:Null, flValue2:Null, strumTime:Float) + { + switch(eventName) + { + case "Dadbattle Spotlight": + if(flValue1 == null) flValue1 = 0; + var val:Int = Math.round(flValue1); + + switch(val) + { + case 1, 2, 3: //enable and target dad + if(val == 1) //enable + { + dadbattleBlack.visible = true; + dadbattleLight.visible = true; + dadbattleFog.visible = true; + defaultCamZoom += 0.12; + } + + var who:Character = dad; + if(val > 2) who = boyfriend; + //2 only targets dad + dadbattleLight.alpha = 0; + new FlxTimer().start(0.12, function(tmr:FlxTimer) { + dadbattleLight.alpha = 0.375; + }); + dadbattleLight.setPosition(who.getGraphicMidpoint().x - dadbattleLight.width / 2, who.y + who.height - dadbattleLight.height + 50); + FlxTween.tween(dadbattleFog, {alpha: 0.7}, 1.5, {ease: FlxEase.quadInOut}); + + default: + dadbattleBlack.visible = false; + dadbattleLight.visible = false; + defaultCamZoom -= 0.12; + FlxTween.tween(dadbattleFog, {alpha: 0}, 0.7, {onComplete: function(twn:FlxTween) dadbattleFog.visible = false}); + } + } + } +} \ No newline at end of file diff --git a/source/stages/Tank.hx b/source/stages/Tank.hx new file mode 100644 index 00000000000..94789927df5 --- /dev/null +++ b/source/stages/Tank.hx @@ -0,0 +1,389 @@ +package stages; + +import stages.objects.*; +import CutsceneHandler; +import GameOverSubstate; +import Character; + +class Tank extends BaseStage +{ + var tankWatchtower:BGSprite; + var tankGround:BackgroundTank; + var tankmanRun:FlxTypedGroup; + var foregroundSprites:FlxTypedGroup; + + override function create() + { + var sky:BGSprite = new BGSprite('tankSky', -400, -400, 0, 0); + add(sky); + + if(!ClientPrefs.lowQuality) + { + var clouds:BGSprite = new BGSprite('tankClouds', FlxG.random.int(-700, -100), FlxG.random.int(-20, 20), 0.1, 0.1); + clouds.active = true; + clouds.velocity.x = FlxG.random.float(5, 15); + add(clouds); + + var mountains:BGSprite = new BGSprite('tankMountains', -300, -20, 0.2, 0.2); + mountains.setGraphicSize(Std.int(1.2 * mountains.width)); + mountains.updateHitbox(); + add(mountains); + + var buildings:BGSprite = new BGSprite('tankBuildings', -200, 0, 0.3, 0.3); + buildings.setGraphicSize(Std.int(1.1 * buildings.width)); + buildings.updateHitbox(); + add(buildings); + } + + var ruins:BGSprite = new BGSprite('tankRuins',-200,0,.35,.35); + ruins.setGraphicSize(Std.int(1.1 * ruins.width)); + ruins.updateHitbox(); + add(ruins); + + if(!ClientPrefs.lowQuality) + { + var smokeLeft:BGSprite = new BGSprite('smokeLeft', -200, -100, 0.4, 0.4, ['SmokeBlurLeft'], true); + add(smokeLeft); + var smokeRight:BGSprite = new BGSprite('smokeRight', 1100, -100, 0.4, 0.4, ['SmokeRight'], true); + add(smokeRight); + + tankWatchtower = new BGSprite('tankWatchtower', 100, 50, 0.5, 0.5, ['watchtower gradient color']); + add(tankWatchtower); + } + + tankGround = new BackgroundTank(); + add(tankGround); + + tankmanRun = new FlxTypedGroup(); + add(tankmanRun); + + var ground:BGSprite = new BGSprite('tankGround', -420, -150); + ground.setGraphicSize(Std.int(1.15 * ground.width)); + ground.updateHitbox(); + add(ground); + + foregroundSprites = new FlxTypedGroup(); + foregroundSprites.add(new BGSprite('tank0', -500, 650, 1.7, 1.5, ['fg'])); + if(!ClientPrefs.lowQuality) foregroundSprites.add(new BGSprite('tank1', -300, 750, 2, 0.2, ['fg'])); + foregroundSprites.add(new BGSprite('tank2', 450, 940, 1.5, 1.5, ['foreground'])); + if(!ClientPrefs.lowQuality) foregroundSprites.add(new BGSprite('tank4', 1300, 900, 1.5, 1.5, ['fg'])); + foregroundSprites.add(new BGSprite('tank5', 1620, 700, 1.5, 1.5, ['fg'])); + if(!ClientPrefs.lowQuality) foregroundSprites.add(new BGSprite('tank3', 1300, 1200, 3.5, 2.5, ['fg'])); + + // Default GFs + if(songName == 'stress') setDefaultGF('pico-speaker'); + else setDefaultGF('gf-tankmen'); + + if (isStoryMode && !seenCutscene) + { + switch (songName) + { + case 'ugh': + setStartCallback(ughIntro); + case 'guns': + setStartCallback(gunsIntro); + case 'stress': + setStartCallback(stressIntro); + } + } + } + override function createPost() + { + add(foregroundSprites); + + if(!ClientPrefs.lowQuality) + { + for (daGf in gfGroup) + { + var gf:Character = cast daGf; + if(gf.curCharacter == 'pico-speaker') + { + var firstTank:TankmenBG = new TankmenBG(20, 500, true); + firstTank.resetShit(20, 1500, true); + firstTank.strumTime = 10; + firstTank.visible = false; + tankmanRun.add(firstTank); + + for (i in 0...TankmenBG.animationNotes.length) + { + if(FlxG.random.bool(16)) { + var tankBih = tankmanRun.recycle(TankmenBG); + tankBih.strumTime = TankmenBG.animationNotes[i][0]; + tankBih.resetShit(500, 200 + FlxG.random.int(50, 100), TankmenBG.animationNotes[i][1] < 2); + tankmanRun.add(tankBih); + } + } + break; + } + } + } + } + + override function countdownTick(count:Countdown, num:Int) if(num % 2 == 0) everyoneDance(); + override function beatHit() everyoneDance(); + function everyoneDance() + { + if(!ClientPrefs.lowQuality) tankWatchtower.dance(); + foregroundSprites.forEach(function(spr:BGSprite) + { + spr.dance(); + }); + } + + // Cutscenes + var cutsceneHandler:CutsceneHandler; + var tankman:FlxAnimate; + var pico:FlxAnimate; + var boyfriendCutscene:FlxSprite; + function prepareCutscene() + { + cutsceneHandler = new CutsceneHandler(); + + dadGroup.alpha = 0.00001; + camHUD.visible = false; + //inCutscene = true; //this would stop the camera movement, oops + + tankman = new FlxAnimate(dad.x + 419, dad.y + 225); + tankman.showPivot = false; + Paths.loadAnimateAtlas(tankman, 'cutscenes/tankman'); + tankman.antialiasing = ClientPrefs.globalAntialiasing; + addBehindDad(tankman); + cutsceneHandler.push(tankman); + + cutsceneHandler.finishCallback = function() + { + var timeForStuff:Float = Conductor.crochet / 1000 * 4.5; + FlxG.sound.music.fadeOut(timeForStuff); + FlxTween.tween(FlxG.camera, {zoom: defaultCamZoom}, timeForStuff, {ease: FlxEase.quadInOut}); + startCountdown(); + + dadGroup.alpha = 1; + camHUD.visible = true; + boyfriend.animation.finishCallback = null; + gf.animation.finishCallback = null; + gf.dance(); + }; + camFollow.set(dad.x + 280, dad.y + 170); + } + + function ughIntro() + { + prepareCutscene(); + cutsceneHandler.endTime = 12; + cutsceneHandler.music = 'DISTORTO'; + Paths.sound('wellWellWell'); + Paths.sound('killYou'); + Paths.sound('bfBeep'); + + var wellWellWell:FlxSound = new FlxSound().loadEmbedded(Paths.sound('wellWellWell')); + FlxG.sound.list.add(wellWellWell); + + tankman.anim.addBySymbol('wellWell', 'TANK TALK 1 P1', 24, false); + tankman.anim.addBySymbol('killYou', 'TANK TALK 1 P2', 24, false); + tankman.anim.play('wellWell', true); + FlxG.camera.zoom *= 1.2; + + // Well well well, what do we got here? + cutsceneHandler.timer(0.1, function() + { + wellWellWell.play(true); + }); + + // Move camera to BF + cutsceneHandler.timer(3, function() + { + camFollow.x += 750; + camFollow.y += 100; + }); + + // Beep! + cutsceneHandler.timer(4.5, function() + { + boyfriend.playAnim('singUP', true); + boyfriend.specialAnim = true; + FlxG.sound.play(Paths.sound('bfBeep')); + }); + + // Move camera to Tankman + cutsceneHandler.timer(6, function() + { + camFollow.x -= 750; + camFollow.y -= 100; + + // We should just kill you but... what the hell, it's been a boring day... let's see what you've got! + tankman.anim.play('killYou', true); + FlxG.sound.play(Paths.sound('killYou')); + }); + } + function gunsIntro() + { + prepareCutscene(); + cutsceneHandler.endTime = 11.5; + cutsceneHandler.music = 'DISTORTO'; + Paths.sound('tankSong2'); + + var tightBars:FlxSound = new FlxSound().loadEmbedded(Paths.sound('tankSong2')); + FlxG.sound.list.add(tightBars); + + tankman.anim.addBySymbol('tightBars', 'TANK TALK 2', 24, false); + tankman.anim.play('tightBars', true); + boyfriend.animation.curAnim.finish(); + + cutsceneHandler.onStart = function() + { + tightBars.play(true); + FlxTween.tween(FlxG.camera, {zoom: defaultCamZoom * 1.2}, 4, {ease: FlxEase.quadInOut}); + FlxTween.tween(FlxG.camera, {zoom: defaultCamZoom * 1.2 * 1.2}, 0.5, {ease: FlxEase.quadInOut, startDelay: 4}); + FlxTween.tween(FlxG.camera, {zoom: defaultCamZoom * 1.2}, 1, {ease: FlxEase.quadInOut, startDelay: 4.5}); + }; + + cutsceneHandler.timer(4, function() + { + gf.playAnim('sad', true); + gf.animation.finishCallback = function(name:String) + { + gf.playAnim('sad', true); + }; + }); + } + var dualWieldAnimPlayed = 0; + function stressIntro() + { + prepareCutscene(); + + cutsceneHandler.endTime = 35.5; + gfGroup.alpha = 0.00001; + boyfriendGroup.alpha = 0.00001; + camFollow.set(dad.x + 400, dad.y + 170); + FlxTween.tween(FlxG.camera, {zoom: 0.9 * 1.2}, 1, {ease: FlxEase.quadInOut}); + foregroundSprites.forEach(function(spr:BGSprite) + { + spr.y += 100; + }); + Paths.sound('stressCutscene'); + + pico = new FlxAnimate(gf.x + 150, gf.y + 450); + pico.showPivot = false; + Paths.loadAnimateAtlas(pico, 'cutscenes/picoAppears'); + pico.antialiasing = ClientPrefs.globalAntialiasing; + pico.anim.addBySymbol('dance', 'GF Dancing at Gunpoint', 24, true); + pico.anim.addBySymbol('dieBitch', 'GF Time to Die sequence', 24, false); + pico.anim.addBySymbol('picoAppears', 'Pico Saves them sequence', 24, false); + pico.anim.addBySymbol('picoEnd', 'Pico Dual Wield on Speaker idle', 24, false); + pico.anim.play('dance', true); + addBehindGF(pico); + cutsceneHandler.push(pico); + + boyfriendCutscene = new FlxSprite(boyfriend.x + 5, boyfriend.y + 20); + boyfriendCutscene.antialiasing = ClientPrefs.globalAntialiasing; + boyfriendCutscene.frames = Paths.getSparrowAtlas('characters/BOYFRIEND'); + boyfriendCutscene.animation.addByPrefix('idle', 'BF idle dance', 24, false); + boyfriendCutscene.animation.play('idle', true); + boyfriendCutscene.animation.curAnim.finish(); + addBehindBF(boyfriendCutscene); + cutsceneHandler.push(boyfriendCutscene); + + var cutsceneSnd:FlxSound = new FlxSound().loadEmbedded(Paths.sound('stressCutscene')); + FlxG.sound.list.add(cutsceneSnd); + + tankman.anim.addBySymbol('godEffingDamnIt', 'TANK TALK 3 P1 UNCUT', 24, false); + tankman.anim.addBySymbol('lookWhoItIs', 'TANK TALK 3 P2 UNCUT', 24, false); + tankman.anim.play('godEffingDamnIt', true); + + cutsceneHandler.onStart = function() + { + cutsceneSnd.play(true); + }; + + cutsceneHandler.timer(15.2, function() + { + FlxTween.tween(camFollow, {x: 650, y: 300}, 1, {ease: FlxEase.sineOut}); + FlxTween.tween(FlxG.camera, {zoom: 0.9 * 1.2 * 1.2}, 2.25, {ease: FlxEase.quadInOut}); + + pico.anim.play('dieBitch', true); + pico.anim.onComplete = function() + { + pico.anim.play('picoAppears', true); + pico.anim.onComplete = function() + { + pico.anim.play('picoEnd', true); + pico.anim.onComplete = function() + { + gfGroup.alpha = 1; + pico.visible = false; + pico.anim.onComplete = null; + } + }; + + boyfriendGroup.alpha = 1; + boyfriendCutscene.visible = false; + boyfriend.playAnim('bfCatch', true); + + boyfriend.animation.finishCallback = function(name:String) + { + if(name != 'idle') + { + boyfriend.playAnim('idle', true); + boyfriend.animation.curAnim.finish(); //Instantly goes to last frame + } + }; + }; + }); + + cutsceneHandler.timer(17.5, function() + { + zoomBack(); + }); + + cutsceneHandler.timer(19.5, function() + { + tankman.anim.play('lookWhoItIs', true); + }); + + cutsceneHandler.timer(20, function() + { + camFollow.set(dad.x + 500, dad.y + 170); + }); + + cutsceneHandler.timer(31.2, function() + { + boyfriend.playAnim('singUPmiss', true); + boyfriend.animation.finishCallback = function(name:String) + { + if (name == 'singUPmiss') + { + boyfriend.playAnim('idle', true); + boyfriend.animation.curAnim.finish(); //Instantly goes to last frame + } + }; + + camFollow.set(boyfriend.x + 280, boyfriend.y + 200); + FlxG.camera.snapToTarget(); + game.cameraSpeed = 12; + FlxTween.tween(FlxG.camera, {zoom: 0.9 * 1.2 * 1.2}, 0.25, {ease: FlxEase.elasticOut}); + }); + + cutsceneHandler.timer(32.2, function() + { + zoomBack(); + }); + } + + function zoomBack() + { + var calledTimes:Int = 0; + camFollow.set(630, 425); + FlxG.camera.snapToTarget(); + FlxG.camera.zoom = 0.8; + game.cameraSpeed = 1; + + calledTimes++; + if (calledTimes > 1) + { + foregroundSprites.forEach(function(spr:BGSprite) + { + spr.y -= 100; + }); + } + } +} \ No newline at end of file diff --git a/source/stages/Template.hx b/source/stages/Template.hx new file mode 100644 index 00000000000..eec5c4b8df0 --- /dev/null +++ b/source/stages/Template.hx @@ -0,0 +1,123 @@ +package stages; + +import stages.objects.*; + +class Template extends BaseStage +{ + // If you're moving your stage from PlayState to a stage file, + // you might have to rename some variables if they're missing, for example: camZooming -> game.camZooming + + override function create() + { + // Spawn your stage sprites here. + // Characters are not ready yet on this function, so you can't add things above them yet. + // Use createPost() if that's what you want to do. + } + + override function createPost() + { + // Use this function to layer things above characters! + } + + override function update(elapsed:Float) + { + // Code here + } + + + override function countdownTick(count:BaseStage.Countdown, num:Int) + { + switch(count) + { + case THREE: //num 0 + case TWO: //num 1 + case ONE: //num 2 + case GO: //num 3 + case START: //num 4 + } + } + + // Steps, Beats and Sections: + // curStep, curDecStep + // curBeat, curDecBeat + // curSection + override function stepHit() + { + // Code here + } + override function beatHit() + { + // Code here + } + override function sectionHit() + { + // Code here + } + + // Substates for pausing/resuming tweens and timers + override function closeSubState() + { + if(paused) + { + //timer.active = true; + //tween.active = true; + } + } + + override function openSubState(SubState:flixel.FlxSubState) + { + if(paused) + { + //timer.active = false; + //tween.active = false; + } + } + + // For events + override function eventCalled(eventName:String, value1:String, value2:String, flValue1:Null, flValue2:Null, strumTime:Float) + { + switch(eventName) + { + case "My Event": + } + } + override function eventPushed(event:Note.EventNote) + { + // used for preloading assets used on events that doesn't need different assets based on its values + switch(event.event) + { + case "My Event": + //precacheImage('myImage') //preloads images/myImage.png + //precacheSound('mySound') //preloads sounds/mySound.ogg + //precacheMusic('myMusic') //preloads music/myMusic.ogg + } + } + override function eventPushedUnique(event:objects.Note.EventNote) + { + // used for preloading assets used on events where its values affect what assets should be preloaded + switch(event.event) + { + case "My Event": + switch(event.value1) + { + // If value 1 is "blah blah", it will preload these assets: + case 'blah blah': + //precacheImage('myImageOne') //preloads images/myImageOne.png + //precacheSound('mySoundOne') //preloads sounds/mySoundOne.ogg + //precacheMusic('myMusicOne') //preloads music/myMusicOne.ogg + + // If value 1 is "coolswag", it will preload these assets: + case 'coolswag': + //precacheImage('myImageTwo') //preloads images/myImageTwo.png + //precacheSound('mySoundTwo') //preloads sounds/mySoundTwo.ogg + //precacheMusic('myMusicTwo') //preloads music/myMusicTwo.ogg + + // If value 1 is not "blah blah" or "coolswag", it will preload these assets: + default: + //precacheImage('myImageThree') //preloads images/myImageThree.png + //precacheSound('mySoundThree') //preloads sounds/mySoundThree.ogg + //precacheMusic('myMusicThree') //preloads music/myMusicThree.ogg + } + } + } +} \ No newline at end of file diff --git a/source/stages/objects/BackgroundDancer.hx b/source/stages/objects/BackgroundDancer.hx new file mode 100644 index 00000000000..38bc44475a1 --- /dev/null +++ b/source/stages/objects/BackgroundDancer.hx @@ -0,0 +1,29 @@ +package stages.objects; + +import flixel.graphics.frames.FlxAtlasFrames; + +class BackgroundDancer extends FlxSprite +{ + public function new(x:Float, y:Float) + { + super(x, y); + + frames = Paths.getSparrowAtlas("limo/limoDancer"); + animation.addByIndices('danceLeft', 'bg dancer sketch PINK', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], "", 24, false); + animation.addByIndices('danceRight', 'bg dancer sketch PINK', [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], "", 24, false); + animation.play('danceLeft'); + antialiasing = ClientPrefs.globalAntialiasing; + } + + var danceDir:Bool = false; + + public function dance():Void + { + danceDir = !danceDir; + + if (danceDir) + animation.play('danceRight', true); + else + animation.play('danceLeft', true); + } +} diff --git a/source/stages/objects/BackgroundGirls.hx b/source/stages/objects/BackgroundGirls.hx new file mode 100644 index 00000000000..5eb246c647b --- /dev/null +++ b/source/stages/objects/BackgroundGirls.hx @@ -0,0 +1,44 @@ +package stages.objects; + +class BackgroundGirls extends FlxSprite +{ + var isPissed:Bool = true; + public function new(x:Float, y:Float) + { + super(x, y); + + // BG fangirls dissuaded + frames = Paths.getSparrowAtlas('weeb/bgFreaks'); + antialiasing = false; + swapDanceType(); + + setGraphicSize(Std.int(width * PlayState.daPixelZoom)); + updateHitbox(); + animation.play('danceLeft'); + } + + var danceDir:Bool = false; + + public function swapDanceType():Void + { + isPissed = !isPissed; + if(!isPissed) { //Gets unpissed + animation.addByIndices('danceLeft', 'BG girls group', CoolUtil.numberArray(14), "", 24, false); + animation.addByIndices('danceRight', 'BG girls group', CoolUtil.numberArray(30, 15), "", 24, false); + } else { //Pisses + animation.addByIndices('danceLeft', 'BG fangirls dissuaded', CoolUtil.numberArray(14), "", 24, false); + animation.addByIndices('danceRight', 'BG fangirls dissuaded', CoolUtil.numberArray(30, 15), "", 24, false); + } + dance(); + } + + public function dance():Void + { + danceDir = !danceDir; + + if (danceDir) + animation.play('danceRight', true); + else + animation.play('danceLeft', true); + } +} diff --git a/source/stages/objects/BackgroundTank.hx b/source/stages/objects/BackgroundTank.hx new file mode 100644 index 00000000000..6e883744d7b --- /dev/null +++ b/source/stages/objects/BackgroundTank.hx @@ -0,0 +1,26 @@ +package stages.objects; + +class BackgroundTank extends BGSprite +{ + public var offsetX:Float = 400; + public var offsetY:Float = 1300; + public var tankSpeed:Float = 0; + public var tankAngle:Float = 0; + public function new() + { + super('tankRolling', 0, 0, 0.5, 0.5, ['BG tank w lighting'], true); + tankSpeed = FlxG.random.float(5, 7); + tankAngle = FlxG.random.int(-90, 45); + antialiasing = ClientPrefs.globalAntialiasing; + } + + override function update(elapsed:Float) + { + super.update(elapsed); + + tankAngle += elapsed * tankSpeed; + angle = tankAngle - 90 + 15; + x = offsetX + 1500 * Math.cos(Math.PI / 180 * (tankAngle + 180)); + y = offsetY + 1100 * Math.sin(Math.PI / 180 * (tankAngle + 180)); + } +} \ No newline at end of file diff --git a/source/stages/objects/DadBattleFog.hx b/source/stages/objects/DadBattleFog.hx new file mode 100644 index 00000000000..537c0dbe4eb --- /dev/null +++ b/source/stages/objects/DadBattleFog.hx @@ -0,0 +1,30 @@ +package stages.objects; + +class DadBattleFog extends FlxSpriteGroup +{ + public function new() + { + super(); + + alpha = 0; + blend = ADD; + + var offsetX = 200; + var smoke:BGSprite = new BGSprite('smoke', -1550 + offsetX, 660 + FlxG.random.float(-20, 20), 1.2, 1.05); + smoke.setGraphicSize(Std.int(smoke.width * FlxG.random.float(1.1, 1.22))); + smoke.updateHitbox(); + smoke.velocity.x = FlxG.random.float(15, 22); + smoke.active = true; + smoke.antialiasing = ClientPrefs.globalAntialiasing; + add(smoke); + + var smoke:BGSprite = new BGSprite('smoke', 1550 + offsetX, 660 + FlxG.random.float(-20, 20), 1.2, 1.05); + smoke.setGraphicSize(Std.int(smoke.width * FlxG.random.float(1.1, 1.22))); + smoke.updateHitbox(); + smoke.velocity.x = FlxG.random.float(-15, -22); + smoke.active = true; + smoke.flipX = true; + smoke.antialiasing = ClientPrefs.globalAntialiasing; + add(smoke); + } +} \ No newline at end of file diff --git a/source/stages/objects/MallCrowd.hx b/source/stages/objects/MallCrowd.hx new file mode 100644 index 00000000000..4c98ad48abe --- /dev/null +++ b/source/stages/objects/MallCrowd.hx @@ -0,0 +1,31 @@ +package stages.objects; + +class MallCrowd extends BGSprite +{ + public var heyTimer:Float = 0; + public function new(x:Float = 0, y:Float = 0, sprite:String = 'christmas/bottomBop', idle:String = 'Bottom Level Boppers Idle', hey:String = 'Bottom Level Boppers HEY') + { + super(sprite, x, y, 0.9, 0.9, [idle]); + animation.addByPrefix('hey', hey, 24, false); + antialiasing = ClientPrefs.globalAntialiasing; + } + + override function update(elapsed:Float) + { + super.update(elapsed); + + if(heyTimer > 0) { + heyTimer -= elapsed; + if(heyTimer <= 0) { + dance(true); + heyTimer = 0; + } + } + } + + override function dance(?forceplay:Bool = false) + { + if(heyTimer > 0) return; + super.dance(forceplay); + } +} \ No newline at end of file diff --git a/source/stages/objects/PhillyGlowGradient.hx b/source/stages/objects/PhillyGlowGradient.hx new file mode 100644 index 00000000000..03eb2e9ba58 --- /dev/null +++ b/source/stages/objects/PhillyGlowGradient.hx @@ -0,0 +1,46 @@ +package stages.objects; + +class PhillyGlowGradient extends FlxSprite +{ + public var originalY:Float; + public var originalHeight:Int = 400; + public var intendedAlpha:Float = 1; + public function new(x:Float, y:Float) + { + super(x, y); + originalY = y; + + loadGraphic(Paths.image('philly/gradient')); + scrollFactor.set(0, 0.75); + setGraphicSize(2000, originalHeight); + updateHitbox(); + antialiasing = ClientPrefs.globalAntialiasing; + } + + override function update(elapsed:Float) + { + var newHeight:Int = Math.round(height - 1000 * elapsed); + if(newHeight > 0) + { + alpha = intendedAlpha; + setGraphicSize(2000, newHeight); + updateHitbox(); + y = originalY + (originalHeight - height); + } + else + { + alpha = 0; + y = -5000; + } + + super.update(elapsed); + } + + public function bop() + { + setGraphicSize(2000, originalHeight); + updateHitbox(); + y = originalY; + alpha = intendedAlpha; + } +} \ No newline at end of file diff --git a/source/stages/objects/PhillyGlowParticle.hx b/source/stages/objects/PhillyGlowParticle.hx new file mode 100644 index 00000000000..bca4e14107c --- /dev/null +++ b/source/stages/objects/PhillyGlowParticle.hx @@ -0,0 +1,45 @@ +package stages.objects; + +class PhillyGlowParticle extends FlxSprite +{ + var lifeTime:Float = 0; + var decay:Float = 0; + var originalScale:Float = 1; + public function new(x:Float, y:Float, color:FlxColor) + { + super(x, y); + this.color = color; + + loadGraphic(Paths.image('philly/particle')); + lifeTime = FlxG.random.float(0.6, 0.9); + decay = FlxG.random.float(0.8, 1); + if(!ClientPrefs.flashing) + { + decay *= 0.5; + alpha = 0.5; + } + + originalScale = FlxG.random.float(0.75, 1); + scale.set(originalScale, originalScale); + + scrollFactor.set(FlxG.random.float(0.3, 0.75), FlxG.random.float(0.65, 0.75)); + velocity.set(FlxG.random.float(-40, 40), FlxG.random.float(-175, -250)); + acceleration.set(FlxG.random.float(-10, 10), 25); + antialiasing = ClientPrefs.globalAntialiasing; + } + + override function update(elapsed:Float) + { + lifeTime -= elapsed; + if(lifeTime < 0) + { + lifeTime = 0; + alpha -= decay * elapsed; + if(alpha > 0) + { + scale.set(originalScale * alpha, originalScale * alpha); + } + } + super.update(elapsed); + } +} \ No newline at end of file diff --git a/source/stages/objects/PhillyTrain.hx b/source/stages/objects/PhillyTrain.hx new file mode 100644 index 00000000000..53733cf23ab --- /dev/null +++ b/source/stages/objects/PhillyTrain.hx @@ -0,0 +1,95 @@ +package stages.objects; + +class PhillyTrain extends BGSprite +{ + public var sound:FlxSound; + public function new(x:Float = 0, y:Float = 0, image:String = 'philly/train', sound:String = 'train_passes') + { + super(image, x, y); + active = true; //Allow update + antialiasing = ClientPrefs.globalAntialiasing; + + this.sound = new FlxSound().loadEmbedded(Paths.sound(sound)); + FlxG.sound.list.add(this.sound); + } + + public var moving:Bool = false; + public var finishing:Bool = false; + public var startedMoving:Bool = false; + public var frameTiming:Float = 0; //Simulates 24fps cap + + public var cars:Int = 8; + public var cooldown:Int = 0; + + override function update(elapsed:Float) + { + if (moving) + { + frameTiming += elapsed; + if (frameTiming >= 1 / 24) + { + if (sound.time >= 4700) + { + startedMoving = true; + if (PlayState.instance.gf != null) + { + PlayState.instance.gf.playAnim('hairBlow'); + PlayState.instance.gf.specialAnim = true; + } + } + + if (startedMoving) + { + x -= 400; + if (x < -2000 && !finishing) + { + x = -1150; + cars -= 1; + + if (cars <= 0) + finishing = true; + } + + if (x < -4000 && finishing) + restart(); + } + frameTiming = 0; + } + } + super.update(elapsed); + } + + public function beatHit(curBeat:Int):Void + { + if (!moving) + cooldown += 1; + + if (curBeat % 8 == 4 && FlxG.random.bool(30) && !moving && cooldown > 8) + { + cooldown = FlxG.random.int(-4, 0); + start(); + } + } + + public function start():Void + { + moving = true; + if (!sound.playing) + sound.play(true); + } + + public function restart():Void + { + if(PlayState.instance.gf != null) + { + PlayState.instance.gf.danced = false; //Makes she bop her head to the correct side once the animation ends + PlayState.instance.gf.playAnim('hairFall'); + PlayState.instance.gf.specialAnim = true; + } + x = FlxG.width + 200; + moving = false; + cars = 8; + finishing = false; + startedMoving = false; + } +} \ No newline at end of file diff --git a/source/stages/objects/TankmenBG.hx b/source/stages/objects/TankmenBG.hx new file mode 100644 index 00000000000..3113f031e28 --- /dev/null +++ b/source/stages/objects/TankmenBG.hx @@ -0,0 +1,71 @@ +package stages.objects; + +import flixel.graphics.frames.FlxAtlasFrames; + +class TankmenBG extends FlxSprite +{ + public static var animationNotes:Array = []; + private var tankSpeed:Float; + private var endingOffset:Float; + private var goingRight:Bool; + public var strumTime:Float; + + public function new(x:Float, y:Float, facingRight:Bool) + { + tankSpeed = 0.7; + goingRight = false; + strumTime = 0; + goingRight = facingRight; + super(x, y); + + frames = Paths.getSparrowAtlas('tankmanKilled1'); + animation.addByPrefix('run', 'tankman running', 24, true); + animation.addByPrefix('shot', 'John Shot ' + FlxG.random.int(1, 2), 24, false); + animation.play('run'); + animation.curAnim.curFrame = FlxG.random.int(0, animation.curAnim.frames.length - 1); + antialiasing = ClientPrefs.globalAntialiasing; + + scale.set(0.8, 0.8); + updateHitbox(); + } + + public function resetShit(x:Float, y:Float, goingRight:Bool):Void + { + this.x = x; + this.y = y; + this.goingRight = goingRight; + endingOffset = FlxG.random.float(50, 200); + tankSpeed = FlxG.random.float(0.6, 1); + flipX = goingRight; + } + + override function update(elapsed:Float) + { + super.update(elapsed); + + visible = (x > -0.5 * FlxG.width && x < 1.2 * FlxG.width); + + if(animation.curAnim.name == "run") + { + var speed:Float = (Conductor.songPosition - strumTime) * tankSpeed; + if(goingRight) + x = (0.02 * FlxG.width - endingOffset) + speed; + else + x = (0.74 * FlxG.width + endingOffset) - speed; + } + else if(animation.curAnim.finished) + { + kill(); + } + + if(Conductor.songPosition > strumTime) + { + animation.play('shot'); + if(goingRight) + { + offset.x = 300; + offset.y = 200; + } + } + } +} \ No newline at end of file