Skip to content

Commit

Permalink
a whole lotta stuff!
Browse files Browse the repository at this point in the history
  • Loading branch information
Burgerballs committed Feb 9, 2023
1 parent be7c470 commit 2e1263f
Show file tree
Hide file tree
Showing 21 changed files with 594 additions and 143 deletions.
5 changes: 4 additions & 1 deletion Project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<project>
<!-- _________________________ Application Settings _________________________ -->

<app title="Friday Night Funkin'" file="Funkin" packageName="com.ninjamuffin99.funkin" package="com.ninjamuffin99.funkin" main="Main" version="0.2.8" company="ninjamuffin99" />
<app title="Friday Night Funkin - W7FIX'" file="W7FIX" packageName="com.ninjamuffin99.funkin" package="com.ninjamuffin99.funkin" main="Main" version="0.2.8" company="ninjamuffin99" />

<!--Switch Export with Unique ApplicationID and Icon-->
<set name="APP_ID" value="0x0100f6c013bbc000" />
Expand Down Expand Up @@ -186,6 +186,9 @@

<haxedef name="CAN_OPEN_LINKS" unless="switch"/>
<haxedef name="CAN_CHEAT" if="switch debug"/>

<!--THIS ALLOWS THE GAME TO BE ALLOCATED TO MORE MEMORY IDK I AM NOT A DOCTOR-->
<haxedef name="HXCPP_GC_BIG_BLOCKS"/>

<!-- <haxedef name="CLEAR_INPUT_SAVE"/> -->

Expand Down
1 change: 1 addition & 0 deletions assets/preload/data/bopeebo/bopeebo-erect.json

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions assets/preload/data/south/script.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
function onSongStart() {
game.camZooming = true;
game.camHUD.alpha = 0.3;
game.defaultCamZoom *= 1.2;
game.camGame.zoom *= 1.4;
game.camHUD.zoom *= 1.4;
}

function onBeatHit(c) {
switch (c) {
case 16:
game.defaultCamZoom /= 1.2;
game.camGame.zoom *= 1.4;
game.camHUD.zoom *= 1.4;
case 31:
game.defaultCamZoom /= 1.05;
case 32:
game.defaultCamZoom *= 1.05;
game.camGame.zoom *= 1.4;
game.camHUD.zoom *= 1.4;
game.camHUD.alpha = 1;
}
}
1 change: 1 addition & 0 deletions assets/preload/data/south/south-erect.json

Large diffs are not rendered by default.

Binary file added assets/preload/sounds/hitsound.ogg
Binary file not shown.
Binary file added assets/preload/sounds/sillyhit.ogg
Binary file not shown.
Binary file added assets/songs/bopeebo/Inst-erect.ogg
Binary file not shown.
Binary file added assets/songs/south/Inst-erect.ogg
Binary file not shown.
79 changes: 76 additions & 3 deletions source/ChartingState.hx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package;

import sys.FileSystem;
import Conductor.BPMChangeEvent;
import Section.SwagSection;
import Song.SwagSong;
Expand Down Expand Up @@ -52,6 +53,7 @@ class ChartingState extends MusicBeatState

var strumLine:FlxSprite;
var curSong:String = 'Dadbattle';
var stages:Array<String> = ['stage', 'spooky', 'philly', 'limo', 'mall', 'mallEvil', 'school', 'schoolEvil', 'tank'];
var amountSteps:Int = 0;
var bullshitUI:FlxGroup;

Expand Down Expand Up @@ -81,6 +83,14 @@ class ChartingState extends MusicBeatState
var leftIcon:HealthIcon;
var rightIcon:HealthIcon;

var suffix:String = '';

public function new(?isErect) {
super();
if (isErect)
suffix = '-erect';
}

override function create()
{
curSection = lastSection;
Expand Down Expand Up @@ -120,6 +130,7 @@ class ChartingState extends MusicBeatState
player1: 'bf',
player2: 'dad',
speed: 1,
stage: 'stage',
validScore: false
};
}
Expand Down Expand Up @@ -199,6 +210,18 @@ class ChartingState extends MusicBeatState
FlxG.sound.music.volume = vol;
};

var check_mute_voice = new FlxUICheckBox(10, 240, null, null, "Mute Voices (in editor)", 100);
check_mute_voice.checked = false;
check_mute_voice.callback = function()
{
var vol:Float = 1;

if (check_mute_voice.checked)
vol = 0;

vocals.volume = vol;
};

var saveButton:FlxButton = new FlxButton(110, 8, "Save", function()
{
saveLevel();
Expand Down Expand Up @@ -231,7 +254,38 @@ class ChartingState extends MusicBeatState
_song.player1 = characters[Std.parseInt(character)];
updateHeads();
});
player1DropDown.selectedLabel = _song.player1;

var tempMap:Map<String, Bool> = new Map<String, Bool>();
#if MODS_ALLOWED
var directories:Array<String> = [Paths.mods('stages/'), Paths.mods(Paths.currentModDirectory + '/stages/'), Paths.getPreloadPath('stages/')];
for(mod in Paths.getGlobalMods())
directories.push(Paths.mods(mod + '/stages/'));
#else
var directories:Array<String> = [Paths.getPreloadPath('stages/')];
#end
#if MODS_ALLOWED
for (i in 0...directories.length) {
var directory:String = directories[i];
if(FileSystem.exists(directory)) {
for (file in FileSystem.readDirectory(directory)) {
var path = haxe.io.Path.join([directory, file]);
if (!FileSystem.isDirectory(path) && file.endsWith('.hx')) {
var stageToCheck:String = file.substr(0, file.length - 5);
if(!tempMap.exists(stageToCheck)) {
tempMap.set(stageToCheck, true);
stages.push(stageToCheck);
}
}
}
}
}
#end

var stageDropDown = new FlxUIDropDownMenu(10, 280, FlxUIDropDownMenu.makeStrIdLabelArray(stages, true), function(stage:String)
{
_song.stage = stages[Std.parseInt(stage)];
});
stageDropDown.selectedLabel = _song.stage;

var player2DropDown = new FlxUIDropDownMenu(140, 100, FlxUIDropDownMenu.makeStrIdLabelArray(characters, true), function(character:String)
{
Expand All @@ -246,13 +300,15 @@ class ChartingState extends MusicBeatState

tab_group_song.add(check_voices);
tab_group_song.add(check_mute_inst);
tab_group_song.add(check_mute_voice);
tab_group_song.add(saveButton);
tab_group_song.add(reloadSong);
tab_group_song.add(reloadSongJson);
tab_group_song.add(loadAutosaveBtn);
tab_group_song.add(stepperBPM);
tab_group_song.add(stepperSpeed);
tab_group_song.add(player1DropDown);
tab_group_song.add(stageDropDown);
tab_group_song.add(player2DropDown);

UI_box.addGroup(tab_group_song);
Expand Down Expand Up @@ -326,6 +382,8 @@ class ChartingState extends MusicBeatState

var stepperSusLength:FlxUINumericStepper;

var check_noteAltAnim:FlxUICheckBox;

function addNoteUI():Void
{
var tab_group_note = new FlxUI(null, UI_box);
Expand All @@ -335,10 +393,14 @@ class ChartingState extends MusicBeatState
stepperSusLength.value = 0;
stepperSusLength.name = 'note_susLength';

check_noteAltAnim = new FlxUICheckBox(10, 100, null, null, "Alt Animation (for note)", 100);
check_noteAltAnim.name = 'check_noteAltAnim';

var applyLength:FlxButton = new FlxButton(100, 10, 'Apply');

tab_group_note.add(stepperSusLength);
tab_group_note.add(applyLength);
tab_group_note.add(check_noteAltAnim);

UI_box.addGroup(tab_group_note);
}
Expand All @@ -351,7 +413,7 @@ class ChartingState extends MusicBeatState
// vocals.stop();
}

FlxG.sound.playMusic(Paths.inst(daSong), 0.6);
FlxG.sound.playMusic(Paths.inst(daSong, suffix), 0.6);

// WONT WORK FOR TUTORIAL OR TEST SONG!!! REDO LATER
vocals = new FlxSound().loadEmbedded(Paths.voices(daSong));
Expand Down Expand Up @@ -407,6 +469,8 @@ class ChartingState extends MusicBeatState
FlxG.log.add('changed bpm shit');
case "Alt Animation":
_song.notes[curSection].altAnim = check.checked;
case "Alt Animation (for note)":
curSelectedNote[3] = check.checked;
}
}
else if (id == FlxUINumericStepper.CHANGE_EVENT && (sender is FlxUINumericStepper))
Expand Down Expand Up @@ -675,6 +739,12 @@ class ChartingState extends MusicBeatState
+ curBeat
+ "\nStep: "
+ curStep;
curRenderedNotes.forEachAlive(function(note:Note) {
note.alpha = 1;
if(note.strumTime <= Conductor.songPosition) {
note.alpha = 0.4;
}
});
super.update(elapsed);
}

Expand Down Expand Up @@ -705,6 +775,7 @@ class ChartingState extends MusicBeatState
}
else
curSelectedNote[3] = true;
updateNoteUI();
}
}

Expand Down Expand Up @@ -827,8 +898,10 @@ class ChartingState extends MusicBeatState

function updateNoteUI():Void
{
if (curSelectedNote != null)
if (curSelectedNote != null) {
stepperSusLength.value = curSelectedNote[2];
check_noteAltAnim.checked = curSelectedNote[3];
}
}

function updateGrid():Void
Expand Down
40 changes: 36 additions & 4 deletions source/CoolUtil.hx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package;

import sys.FileSystem;
import flixel.FlxG;
import flixel.graphics.FlxGraphic;
import flixel.graphics.frames.FlxAtlasFrames;
Expand All @@ -17,12 +18,12 @@ class CoolUtil
{
public static var difficultyArray:Array<String> = ['EASY', "NORMAL", "HARD"];

public static function difficultyString():String
public static inline function difficultyString():String
{
return difficultyArray[PlayState.storyDifficulty];
}

public static function coolTextFile(path:String):Array<String>
public static inline function coolTextFile(path:String):Array<String>
{
var daList:Array<String> = Assets.getText(path).trim().split('\n');

Expand All @@ -34,7 +35,7 @@ class CoolUtil
return daList;
}

public static function numberArray(max:Int, ?min = 0):Array<Int>
public static inline function numberArray(max:Int, ?min = 0):Array<Int>
{
var dumbArray:Array<Int> = [];
for (i in min...max)
Expand All @@ -51,11 +52,42 @@ class CoolUtil
Actually make and modify the scroll and lerp shit in it's own function
instead of solely relying on changing the lerp on the fly
*/
public static function camLerpShit(lerp:Float):Float
public static inline function camLerpShit(lerp:Float):Float
{
return lerp * (FlxG.elapsed / (1 / 60));
}


public static inline function coolDirectory(file:String):Array<String>
{
if (!file.endsWith('/'))
file = '$file/';

var path:String = Paths.mods(file);
if (!FileSystem.exists(path))
path = Paths.getPath(file);

var absolutePath:String = FileSystem.absolutePath(path);
var directory:Array<String> = FileSystem.readDirectory(absolutePath);

if (directory != null)
{
var dirCopy:Array<String> = directory.copy();

for (i in dirCopy)
{
var index:Int = dirCopy.indexOf(i);
var file:String = '$path$i';
dirCopy.remove(i);
dirCopy.insert(index, file);
}

directory = dirCopy;
}

return if (directory != null) directory else [];
}

/*
* just lerp that does camLerpShit for u so u dont have to do it every time
*/
Expand Down
25 changes: 23 additions & 2 deletions source/FreeplayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,17 @@ class FreeplayState extends MusicBeatState
{
curDifficulty += change;

for (i in 0...erectList.length) {
if (songs[curSelected].songName == erectList[i]) {
CoolUtil.difficultyArray = ['EASY', "NORMAL", "HARD", "ERECT"];
break;
} else
CoolUtil.difficultyArray = ['EASY', "NORMAL", "HARD"];
}

if (curDifficulty < 0)
curDifficulty = 2;
if (curDifficulty > 2)
curDifficulty = CoolUtil.difficultyArray.length-1;
if (curDifficulty > CoolUtil.difficultyArray.length-1)
curDifficulty = 0;

intendedScore = Highscore.getScore(songs[curSelected].songName, curDifficulty);
Expand All @@ -264,6 +272,12 @@ class FreeplayState extends MusicBeatState
positionHighscore();
}

var erectList:Array<String> = [
'Bopeebo',
'Dadbattle',
'South'
];

function changeSelection(change:Int = 0)
{
NGio.logEvent('Fresh');
Expand Down Expand Up @@ -310,6 +324,13 @@ class FreeplayState extends MusicBeatState
// item.setGraphicSize(Std.int(item.width));
}
}

for (i in 0...erectList.length)
if (songs[curSelected].songName == erectList[i]) {
CoolUtil.difficultyArray = ['EASY', "NORMAL", "HARD", "ERECT"];
break;
} else
CoolUtil.difficultyArray = ['EASY', "NORMAL", "HARD"];
}

function positionHighscore()
Expand Down
Loading

0 comments on commit 2e1263f

Please sign in to comment.