From bccd1855e3b39e280a41da75c868ac2e948d8527 Mon Sep 17 00:00:00 2001 From: Joalor64 Date: Thu, 30 May 2024 17:30:28 -0400 Subject: [PATCH] stole again --- Project.xml | 2 +- art/readme.txt | 18 +-- source/meta/state/PlayState.hx | 196 +++++++++++++++++++++++++++++---- source/objects/Character.hx | 9 ++ 4 files changed, 191 insertions(+), 34 deletions(-) diff --git a/Project.xml b/Project.xml index 2adf1434..9bad5bcc 100644 --- a/Project.xml +++ b/Project.xml @@ -66,7 +66,7 @@ - + diff --git a/art/readme.txt b/art/readme.txt index 6f361b7c..e57b8ecb 100644 --- a/art/readme.txt +++ b/art/readme.txt @@ -4,20 +4,12 @@ Just wanted to say thanks for downloading! If you don't know already, this is just a remake of Joalor64 Engine. I started working on this because I sort of became bored one day. ------------------------------------------------------------- -I also got inspiration from the following: +Little Update Status: -Forever Engine - Yoshubs -Funkin Cocoa - TheWorldMachinima -Kade Engine - KadeDev -Chain Saw Engine - MAJigsaw77 -Denpa Engine - AT -TopoConnection and Forever Engine Underscore - BeastlyGhost/Gabi -Mic'd Up - Verwex -Gamer Engine - Mealthy/Betopia -Psych Forever Engine - ClassicBoost -Mag Engine - magnumsrt -Troll Engine - nebulazorua -Pull Requests - Psych Engine GitHub Contributors +I decided to finally get back to this project after finishing up another +important project. Now, the engine is coming back with new features, some +bug fixes, and a whole lot more! Maybe soon, I'll even make a version of the engine +that runs on the latest Psych version! But for now, enjoy the pre-release! ------------------------------------------------------------- So, yeah. That's pretty much it! I hope you enjoy! diff --git a/source/meta/state/PlayState.hx b/source/meta/state/PlayState.hx index ba8e769b..3db1da6b 100644 --- a/source/meta/state/PlayState.hx +++ b/source/meta/state/PlayState.hx @@ -293,6 +293,12 @@ class PlayState extends MusicBeatState var tankmanRun:FlxTypedGroup; var foregroundSprites:FlxTypedGroup; + public var tankmanRainbow:Bool = false; + final gunsColors:Array = [0xBFFF0000, 0xBFFF5E00, 0xBFFFFB00, 0xBF00FF0D, 0xBF0011FF, 0xBFD400FF]; //WTF BOYFRIEND REFERENCE?!?!??!#11/1/1??!Q + var gunsTween:FlxTween = null; + var stageGraphicArray:Array = []; //just for the guns thingamabob + var gunsNoteTweens:Array = []; + public var smoothScore:Float = 0; public var songScore:Int = 0; public var songHits:Int = 0; @@ -925,9 +931,29 @@ class PlayState extends MusicBeatState } case 'tank': //Week 7 - Ugh, Guns, Stress + tankmanRainbow = false; + + var layerArray:Array = []; var sky:BGSprite = new BGSprite('stages/tank/tankSky', -400, -400, 0, 0); add(sky); + var ruins:BGSprite = new BGSprite('stages/tank/tankRuins',-200,0,.35,.35); + ruins.setGraphicSize(Std.int(1.1 * ruins.width)); + ruins.updateHitbox(); + add(ruins); + + tankGround = new BGSprite('stages/tank/tankRolling', 300, 300, 0.5, 0.5,['BG tank w lighting'], true); + add(tankGround); + + tankmanRun = new FlxTypedGroup(); + add(tankmanRun); + + var ground:BGSprite = new BGSprite('stages/tank/tankGround', -420, -150); + ground.setGraphicSize(Std.int(1.15 * ground.width)); + ground.updateHitbox(); + add(ground); + moveTank(); + if(!ClientPrefs.lowQuality) { var clouds:BGSprite = new BGSprite('stages/tank/tankClouds', FlxG.random.int(-700, -100), FlxG.random.int(-20, 20), 0.1, 0.1); @@ -944,15 +970,7 @@ class PlayState extends MusicBeatState buildings.setGraphicSize(Std.int(1.1 * buildings.width)); buildings.updateHitbox(); add(buildings); - } - var ruins:BGSprite = new BGSprite('stages/tank/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('stages/tank/smokeLeft', -200, -100, 0.4, 0.4, ['SmokeBlurLeft'], true); add(smokeLeft); var smokeRight:BGSprite = new BGSprite('stages/tank/smokeRight', 1100, -100, 0.4, 0.4, ['SmokeRight'], true); @@ -960,19 +978,33 @@ class PlayState extends MusicBeatState tankWatchtower = new BGSprite('stages/tank/tankWatchtower', 100, 50, 0.5, 0.5, ['watchtower gradient color']); add(tankWatchtower); - } - tankGround = new BGSprite('stages/tank/tankRolling', 300, 300, 0.5, 0.5,['BG tank w lighting'], true); - add(tankGround); - - tankmanRun = new FlxTypedGroup(); - add(tankmanRun); - - var ground:BGSprite = new BGSprite('stages/tank/tankGround', -420, -150); - ground.setGraphicSize(Std.int(1.15 * ground.width)); - ground.updateHitbox(); - add(ground); - moveTank(); + layerArray = [sky, clouds, mountains, buildings, ruins, smokeLeft, smokeRight, tankWatchtower, tankGround, tankmanRun, ground]; + } + else + layerArray = [sky, ruins, tankGround, tankmanRun, ground]; + + autoLayer(layerArray); + + layerArray.remove(sky); + layerArray.remove(tankmanRun); + stageGraphicArray = cast layerArray; + + if (SONG.song.toLowerCase() == 'guns') { + gunsThing = new FlxSprite(-100, -100).makeGraphic(Std.int(FlxG.width * 1.5),Std.int(FlxG.height * 1.5), FlxColor.WHITE); + gunsThing.color = 0xBFFF0000; + gunsThing.alpha = 0.001; + gunsThing.visible = false; + gunsThing.scrollFactor.set(); + gunsThing.screenCenter(); + + gunsExtraClouds = new FlxBackdrop(Paths.image('stages/tank/tankClouds'), XY, 64, 128); + gunsExtraClouds.velocity.set(12, 168); + gunsExtraClouds.alpha = 0.001; + gunsExtraClouds.visible = false; + gunsExtraClouds.scrollFactor.set(0.1, 0.2); + add(gunsExtraClouds); + } foregroundSprites = new FlxTypedGroup(); foregroundSprites.add(new BGSprite('stages/tank/tank0', -500, 650, 1.7, 1.5, ['fg'])); @@ -3476,6 +3508,9 @@ class PlayState extends MusicBeatState override public function update(elapsed:Float) { + if (SONG.song.toLowerCase() == 'guns' && tankmanRainbow) + dad.y += (Math.sin(elapsedtime) * 0.2) * FlxG.elapsed * 244; + // SECRET KEYS!! SHHHHHHHH #if debug final keyPressed:FlxKey = FlxG.keys.firstJustPressed(); @@ -5848,6 +5883,105 @@ class PlayState extends MusicBeatState if (curStep == lastStepHit) return; + + switch (SONG.song.toLowerCase()) { + case 'guns': + switch (curStep) { + case 896: + var moveVals:Array = [40]; + for (i in 0...(mania * 2) + 1) moveVals.push(40); + function tweenNote(note:StrumNote, delay:Float, id:Int) { + gunsNoteTweens[id] = FlxTween.tween(note, {y: strumLine.y + moveVals[id]}, 2 / playbackRate, { + ease: FlxEase.sineInOut, + startDelay: delay, + onComplete: _ -> { + moveVals[id] /= -1; + tweenNote(note, 0, id); + } + }); + } + var i = 0; + opponentStrums.forEach(note -> { + gunsNoteTweens.push(null); + tweenNote(note, (0.12*i) / playbackRate, i); + i++; + }); + playerStrums.forEach(note -> { + gunsNoteTweens.push(null); + tweenNote(note, (0.12*i) / playbackRate, i); + i++; + }); + gunsThing.visible = true; + gunsExtraClouds.visible = true; + FlxTween.tween(dad, {y: dad.y - 50}, 1.35 / playbackRate, { + ease: FlxEase.quadInOut, + onComplete: _ -> tankmanRainbow = true + }); + cameraSpeed = 2; + FlxTween.tween(camGame, {zoom: 1.05}, 1.35 / playbackRate, { + ease: FlxEase.circInOut, + onComplete: _ -> defaultCamZoom = 1.05 + }); + FlxTween.tween(gunsThing, {alpha: 0.75}, 1.2 / playbackRate, {ease: FlxEase.quadInOut}); + FlxTween.tween(gunsExtraClouds, {alpha: 1}, 1.35 / playbackRate, {ease: FlxEase.quadInOut}); + foregroundSprites.forEach(spr -> FlxTween.tween(spr, {alpha: 0}, 1.35 / playbackRate, {ease: FlxEase.quadInOut})); + for (object in stageGraphicArray) if (object != null) FlxTween.tween(object, {y: object.y + 820}, 1.35 / playbackRate, {ease: FlxEase.expoInOut}); + if (gf != null) FlxTween.tween(gf, {y: gf.y + 840}, 1.35 / playbackRate, {ease: FlxEase.expoInOut}); + FlxTween.tween(tankGround, {alpha: 0}, 1.35 / playbackRate, {ease: FlxEase.quadInOut}); + case 1024: + boyfriend.colorSwap = new ColorSwap(); + boyfriend.shader = boyfriend.colorSwap.shader; + iconP1.shader = boyfriend.colorSwap.shader; + hud.healthBar.shader = boyfriend.colorSwap.shader; + FlxTween.tween(camGame, {zoom: defaultStageZoom + 0.5}, stepsToSecs(128), {ease: FlxEase.quadInOut}); + FlxTween.tween(boyfriend.colorSwap, {hue: 0.9}, stepsToSecs(128), {ease: FlxEase.quadInOut}); + case 1152: + for (tween in gunsNoteTweens) { + if (tween != null) { + tween.cancel(); + tween = null; + } + } + FlxTween.tween(boyfriend.colorSwap, {hue: 1}, 0.4 / playbackRate, { + ease: FlxEase.quadInOut, + onComplete: _ -> { + healthBar.shader = null; + iconP1.shader = null; + boyfriend.shader = null; + boyfriend.colorSwap = null; + } + }); + opponentStrums.forEach(note -> FlxTween.tween(note, {y: strumLine.y}, 0.4 / playbackRate, {ease: FlxEase.sineInOut})); + playerStrums.forEach(note -> FlxTween.tween(note, {y: strumLine.y}, 0.4 / playbackRate, {ease: FlxEase.sineInOut})); + tankmanRainbow = false; + cameraSpeed = 1; + if (gunsTween != null) gunsTween.cancel(); + gunsTween = null; + FlxTween.tween(camGame, {zoom: 0.9}, 1.35 / playbackRate, { + ease: FlxEase.circInOut, + onComplete: _ -> defaultCamZoom = 0.9 + }); + FlxTween.tween(gunsThing, {alpha: 0}, 1.2 / playbackRate, { + ease: FlxEase.quadInOut, + onComplete: _ -> { + remove(gunsThing, true); + gunsThing.destroy(); + } + }); + FlxTween.tween(gunsExtraClouds, {alpha: 0}, 1.35 / playbackRate, { + ease: FlxEase.quadInOut, + onComplete: _ -> { + remove(gunsExtraClouds, true); + gunsExtraClouds.destroy(); + } + }); + foregroundSprites.forEach(spr -> FlxTween.tween(spr, {alpha: 1}, 1.35 / playbackRate, {ease: FlxEase.quadInOut})); + FlxTween.tween(dad, {y: 340}, 1.3 / playbackRate, {ease: FlxEase.circInOut}); + for (object in stageGraphicArray) if (object != null) FlxTween.tween(object, {y: object.y - 820}, 1.35 / playbackRate, {ease: FlxEase.expoInOut}); + if (gf != null) FlxTween.tween(gf, {y: gf.y - 840}, 1.35 / playbackRate, {ease: FlxEase.expoInOut}); + FlxTween.tween(tankGround, {alpha: 1}, 1.35 / playbackRate, {ease: FlxEase.quadInOut}); + } + } lastStepHit = curStep; @@ -5857,6 +5991,7 @@ class PlayState extends MusicBeatState var lightningStrikeBeat:Int = 0; var lightningOffset:Int = 8; + var gunsColorIncrementor:Int = 0; var lastBeatHit:Int = -1; override function beatHit() @@ -5905,6 +6040,16 @@ class PlayState extends MusicBeatState { spr.dance(); }); + switch (SONG.song.toLowerCase()) { + case 'guns': + if (curBeat % 4 == 0 && tankmanRainbow && gunsThing != null) { + if (gunsTween != null) gunsTween.cancel(); + gunsTween = null; + gunsTween = FlxTween.color(gunsThing, 1, gunsThing.color, gunsColors[gunsColorIncrementor]); + gunsColorIncrementor++; + if (gunsColorIncrementor > 5) gunsColorIncrementor = 0; + } + } case 'school': if(!ClientPrefs.lowQuality) { @@ -6278,4 +6423,15 @@ class PlayState extends MusicBeatState return str; } + + // thanks denpa team + public function autoLayer(array:Array, ?group:FlxTypedGroup):Void { + try { + if (group != null) for (object in array) group.add(object); + else for (object in array) add(object); + } catch (e) { + trace('exception: ' + e); + return; + } + } } \ No newline at end of file diff --git a/source/objects/Character.hx b/source/objects/Character.hx index 61a99617..f438138b 100644 --- a/source/objects/Character.hx +++ b/source/objects/Character.hx @@ -2,6 +2,7 @@ package objects; import animateatlas.AtlasFrameMaker; import objects.background.*; +import objects.shaders.*; #if MODS_ALLOWED import sys.io.File; @@ -56,6 +57,8 @@ class Character extends FlxSprite public var danceIdle:Bool = false; //Character use "danceLeft" and "danceRight" instead of "idle" public var skipDance:Bool = false; + public var colorSwap:ColorSwap = null; + public var healthIcon:String = 'face'; public var animationsArray:Array = []; @@ -239,6 +242,12 @@ class Character extends FlxSprite } } + override function destroy() + { + colorSwap = null; + super.destroy(); + } + override function update(elapsed:Float) { if(!debugMode && animation.curAnim != null)