diff --git a/mods/test/data/characterSelect.json b/mods/test/data/characterSelect.json index 48cc447..29b114a 100644 --- a/mods/test/data/characterSelect.json +++ b/mods/test/data/characterSelect.json @@ -3,7 +3,7 @@ { "newCharacter": [ { - "playername": "Example", + "playername": "example", "thecharactername": "Example", "thenotems": [1, 1, 1, 1], "notestyle": "3D" diff --git a/mods/test/data/characters/Example.json b/mods/test/data/characters/Example.json index aa2e21c..84c5bf7 100644 --- a/mods/test/data/characters/Example.json +++ b/mods/test/data/characters/Example.json @@ -45,5 +45,6 @@ "nativelyPlayable": true, "flipX": true, "updateHitbox": true, - "setGraphicSize": "" + "setGraphicSize": "", + "effect": "3dfloat" } diff --git a/mods/test/data/customCharacterList.txt b/mods/test/data/customCharacterList.txt index 0c3c67e..96236f8 100644 --- a/mods/test/data/customCharacterList.txt +++ b/mods/test/data/customCharacterList.txt @@ -1 +1 @@ -Example \ No newline at end of file +example \ No newline at end of file diff --git a/source/Character.hx b/source/Character.hx index 5a68946..c299fea 100644 --- a/source/Character.hx +++ b/source/Character.hx @@ -26,6 +26,7 @@ typedef CharacterFile = var flipX:Bool; var updateHitbox:Bool; var setGraphicSize:String; + var effect:String; } typedef Anim = @@ -1213,9 +1214,29 @@ class Character extends FlxSprite if (jsonCustom.setGraphicSize != '') { var thing = jsonCustom.setGraphicSize; - setGraphicSize(Std.int(width * Reflect.field(PlayState, thing))); + if (thing == 'furiosityScale') { + setGraphicSize(Std.int((width * 1.3) / furiosityScale)); + } else if (thing == 'daPixelZoom') { + setGraphicSize(Std.int(width * PlayState.daPixelZoom)); + }else { + setGraphicSize(Std.int(width * Std.parseInt(thing))); + } } + if (jsonCustom.effect != '') + { + var funnyeffect = jsonCustom.effect; + if (funnyeffect == '3dfloat' && !PlayState.funnyFloatyBoys.contains(curCharacter )&& !Note.CharactersWith3D.contains(curCharacter)) { + PlayState.funnyFloatyBoys.push(curCharacter); + Note.CharactersWith3D.push(curCharacter); + } else if (funnyeffect == 'float' && !PlayState.floatyBoysMod.contains(curCharacter)) { + PlayState.floatyBoysMod.push(curCharacter); + } else if (funnyeffect == '3d' && !PlayState.threedBoysMod.contains(curCharacter) && !Note.CharactersWith3D.contains(curCharacter)) { + PlayState.threedBoysMod.push(curCharacter); + Note.CharactersWith3D.push(curCharacter); + } + } + if (jsonCustom.updateHitbox) { updateHitbox(); @@ -1258,8 +1279,30 @@ class Character extends FlxSprite if (jsonCustom.setGraphicSize != '') { var thing = jsonCustom.setGraphicSize; - setGraphicSize(Std.int(width * Reflect.field(PlayState, thing))); + if (thing == 'furiosityScale') { + setGraphicSize(Std.int((width * 1.3) / furiosityScale)); + } else if (thing == 'daPixelZoom') { + setGraphicSize(Std.int(width * PlayState.daPixelZoom)); + }else { + setGraphicSize(Std.int(width * Std.parseInt(thing))); + } } + + if (jsonCustom.effect != '') + { + var funnyeffect = jsonCustom.effect; + if (funnyeffect == '3dfloat' && !PlayState.funnyFloatyBoys.contains(curCharacter) || !Note.CharactersWith3D.contains(curCharacter)) { + PlayState.funnyFloatyBoys.push(curCharacter); + Note.CharactersWith3D.push(curCharacter); + } else if (funnyeffect == 'float' && !PlayState.floatyBoysMod.contains(curCharacter)) { + PlayState.floatyBoysMod.push(curCharacter); + } else if (funnyeffect == '3d' && !PlayState.threedBoysMod.contains(curCharacter) || !Note.CharactersWith3D.contains(curCharacter)) { + PlayState.threedBoysMod.push(curCharacter); + Note.CharactersWith3D.push(curCharacter); + } + } + + if (jsonCustom.updateHitbox) { diff --git a/source/CharacterSelectState.hx b/source/CharacterSelectState.hx index 224c96d..0046fd1 100644 --- a/source/CharacterSelectState.hx +++ b/source/CharacterSelectState.hx @@ -89,7 +89,7 @@ class CharacterSelectState extends MusicBeatState public var notemodtext:FlxText; public var characterText:FlxText; public var wasInFullscreen:Bool; - + public static var inCS:Bool = false; public var funnyIconMan:HealthIcon; var strummies:FlxTypedGroup; @@ -163,6 +163,8 @@ class CharacterSelectState extends MusicBeatState override public function create():Void { + + inCS = true; unlockCharacter('shaggy'); if (PlayState.SONG.song.toLowerCase() == 'exploitation' && !FlxG.save.data.modchart) { @@ -488,6 +490,7 @@ class CharacterSelectState extends MusicBeatState { FlxG.fullscreen = true; } + inCS = false; LoadingState.loadAndSwitchState(new FreeplayState()); } @@ -529,6 +532,7 @@ class CharacterSelectState extends MusicBeatState char.playAnim(heyAnimation ? 'hey' : 'singUP', true); FlxG.sound.music.fadeOut(1.9, 0); FlxG.sound.play(Paths.sound('confirmMenu', 'preload')); + inCS = false; new FlxTimer().start(1.9, endIt); } if (FlxG.keys.justPressed.LEFT && !selectedCharacter) diff --git a/source/FreeplayState.hx b/source/FreeplayState.hx index 73255fc..efbc88a 100644 --- a/source/FreeplayState.hx +++ b/source/FreeplayState.hx @@ -597,6 +597,7 @@ class FreeplayState extends MusicBeatState } if (controls.BACK && canInteract && !awaitingExploitation) { + isaCustomSong = false; FlxG.switchState(new MainMenuState()); } diff --git a/source/ModSubState.hx b/source/ModSubState.hx index 6021889..93d3412 100644 --- a/source/ModSubState.hx +++ b/source/ModSubState.hx @@ -22,7 +22,7 @@ class ModSubState extends MusicBeatSubstate var grpMenuShit:FlxTypedGroup; var bg:FlxBackdrop; -// First, create an empty array + var menuItems:Array = []; var curSelected:Int = 0; diff --git a/source/Note.hx b/source/Note.hx index ff45ad2..8232981 100644 --- a/source/Note.hx +++ b/source/Note.hx @@ -33,7 +33,7 @@ class Note extends FlxSprite public var sustainLength:Float = 0; public var isSustainNote:Bool = false; - private var CharactersWith3D:Array = ["dave-angey", "bambi-3d", 'bambi-unfair', 'exbungo', 'expunged', 'dave-festival-3d', 'dave-3d-recursed', 'bf-3d', 'nofriend']; + public static var CharactersWith3D:Array = ["dave-angey", "bambi-3d", 'bambi-unfair', 'exbungo', 'expunged', 'dave-festival-3d', 'dave-3d-recursed', 'bf-3d', 'nofriend']; public var mania:Int = 0; diff --git a/source/PauseSubState.hx b/source/PauseSubState.hx index c6bb0b5..2cfacc6 100644 --- a/source/PauseSubState.hx +++ b/source/PauseSubState.hx @@ -264,6 +264,7 @@ class PauseSubState extends MusicBeatSubstate PlayState.instance.shakeCam = false; PlayState.instance.camZooming = false; FlxG.mouse.visible = false; + FreeplayState.isaCustomSong = false; FlxG.switchState(new MainMenuState()); } } diff --git a/source/PlayState.hx b/source/PlayState.hx index 22928a4..9bdf1b7 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -163,7 +163,9 @@ class PlayState extends MusicBeatState var focusOnDadGlobal:Bool = true; - var funnyFloatyBoys:Array = ['dave-angey', 'bambi-3d', 'expunged', 'bambi-unfair', 'exbungo', 'dave-festival-3d', 'dave-3d-recursed', 'bf-3d']; + public static var funnyFloatyBoys:Array = ['dave-angey', 'bambi-3d', 'expunged', 'bambi-unfair', 'exbungo', 'dave-festival-3d', 'dave-3d-recursed', 'bf-3d']; + public static var floatyBoysMod:Array = []; + public static var threedBoysMod:Array = ['nofriend']; var storyDifficultyText:String = ""; var iconRPC:String = ""; @@ -778,7 +780,8 @@ class PlayState extends MusicBeatState var gfVersion:String = 'gf'; var noGFSongs = ['memory', 'five-nights', 'bot-trot', 'escape-from-california', 'overdrive']; - + trace(funnyFloatyBoys); + trace('this this false right?: ' + CharacterSelectState.inCS); if(SONG.gf != null) { gfVersion = SONG.gf; @@ -1110,7 +1113,7 @@ class PlayState extends MusicBeatState if (isShaggy) boyfriend.y += 200; if (boyfriend.curCharacter == 'godshaggy') boyfriend.x += 300; case 'red-void': - if (funnyFloatyBoys.contains(dad.curCharacter)) + if (funnyFloatyBoys.contains(dad.curCharacter) || floatyBoysMod.contains(dad.curCharacter)) { dad.y -= 70; } @@ -2722,7 +2725,7 @@ class PlayState extends MusicBeatState { var arrowType:Int = note_order[i]; var strumType:String = ''; - if ((funnyFloatyBoys.contains(dad.curCharacter) || dad.curCharacter == "nofriend") && player == 0 || funnyFloatyBoys.contains(boyfriend.curCharacter) && player == 1) + if ((funnyFloatyBoys.contains(dad.curCharacter) || threedBoysMod.contains(dad.curCharacter)) && player == 0 || funnyFloatyBoys.contains(boyfriend.curCharacter) || threedBoysMod.contains(boyfriend.curCharacter) && player == 1) { strumType = '3D'; } @@ -3265,7 +3268,7 @@ class PlayState extends MusicBeatState dad.y += (toy - dad.y); } - if(funnyFloatyBoys.contains(dad.curCharacter.toLowerCase()) && canFloat) + if(funnyFloatyBoys.contains(dad.curCharacter.toLowerCase()) || floatyBoysMod.contains(dad.curCharacter.toLowerCase()) && canFloat) { if (dad.curCharacter.toLowerCase() == "expunged") { @@ -3278,7 +3281,7 @@ class PlayState extends MusicBeatState dad.y += (Math.sin(elapsedtime) * 0.2); } } - if(funnyFloatyBoys.contains(boyfriend.curCharacter.toLowerCase()) && canFloat) + if(funnyFloatyBoys.contains(boyfriend.curCharacter.toLowerCase()) || floatyBoysMod.contains(boyfriend.curCharacter.toLowerCase()) && canFloat) { boyfriend.y += (Math.sin(elapsedtime) * 0.2); } @@ -3287,7 +3290,7 @@ class PlayState extends MusicBeatState dadmirror.y += (Math.sin(elapsedtime) * 0.6); }*/ - if(funnyFloatyBoys.contains(gf.curCharacter.toLowerCase()) && canFloat) + if(funnyFloatyBoys.contains(gf.curCharacter.toLowerCase()) || floatyBoysMod.contains(gf.curCharacter.toLowerCase()) && canFloat) { gf.y += (Math.sin(elapsedtime) * 0.2); }