Soft-coding of additional Weeks and additional songs

Fixes to mod functions
This commit is contained in:
Nennneko5787 2023-02-26 14:37:55 +09:00
parent f3cf6e7240
commit 72063c24b1
31 changed files with 505 additions and 106 deletions

View File

@ -60,6 +60,7 @@
<library name="week5" preload="true" />
<library name="week6" preload="true" />
<library name="week7" preload="true" />
<library name="weeks" preload="true" />
</section>
<section if="NO_PRELOAD_ALL">
@ -73,6 +74,7 @@
<library name="week5" preload="false" />
<library name="week6" preload="false" />
<library name="week7" preload="false" />
<library name="weeks" preload="false" />
</section>
<assets path="assets/songs" library="songs" exclude="*.fla|*.ogg" if="web"/>
@ -95,6 +97,8 @@
<assets path="assets/week6" library="week6" exclude="*.fla|*.mp3" unless="web"/>
<assets path="assets/week7" library="week7" exclude="*.fla|*.ogg" if="web"/>
<assets path="assets/week7" library="week7" exclude="*.fla|*.mp3" unless="web"/>
<assets path="assets/weeks" library="weeks" exclude="*.fla|*.ogg" if="web"/>
<assets path="assets/weeks" library="weeks" exclude="*.fla|*.mp3" unless="web"/>
<!-- <assets path='example_mods' rename='mods' embed='false'/> -->
@ -189,6 +193,8 @@
<haxedef name="POLYMOD_SCRIPT_EXT" value=".hscript" />
<haxedef name="HXCPP_GC_BIG_BLOCKS" />
<!-- _________________________________ Custom _______________________________ -->
<!--Place custom nodes like icons here (higher priority to override the HaxeFlixel icon)-->

View File

@ -44,6 +44,7 @@ Run build-Itch-WINDOWS.bat in /art/ and build.
* nennneko5787 - Programmer
* ShadowMario - The StrumNote.hx code I stole and modified from PsychEngine
* k.net(brightfyre) - Window focus & unfocus source code I stole from Indie Cross
* Leather128 - Part of the 5K+ support code stolen from LeatherEngine and part of the Mod Menu code
## Funkin
* ninjamuffin99 - Programmer
* PhantomArcade3K and Evilsk8r - Art

25
art/setup_libraries.bat Normal file
View File

@ -0,0 +1,25 @@
@echo off
color 0a
cd ..
echo Install the latest Haxe ( https://haxe.org/download/ ) and Git ( https://git-scm.com/downloads ). After that, press the Enter key.
pause
@echo on
haxelib install lime
haxelib install openfl
haxelib install flixel
haxelib run lime setup flixel
haxelib run lime setup
haxelib install flixel-tools
haxelib run flixel-tools setup
haxelib install flixel-addons
haxelib install flixel-ui
haxelib install hscript
haxelib install newgrounds 1.1.5
haxelib install hxCodec
haxelib install hxcpp-debug-server
haxelib git polymod https://github.com/larsiusprime/polymod.git
haxelib git discord_rpc https://github.com/Aidan63/linc_discord-rpc
haxelib git flixel-addons https://github.com/HaxeFlixel/flixel-addons
@echo off
echo Setup Successful!
pause

24
art/update_libraries.bat Normal file
View File

@ -0,0 +1,24 @@
@echo off
color 0a
cd ..
echo update the latest Haxe ( https://haxe.org/download/ ) and Git ( https://git-scm.com/downloads ). After that, press the Enter key.
pause
@echo on
haxelib update lime
haxelib update openfl
haxelib update flixel
haxelib run lime setup flixel
haxelib run lime setup
haxelib update flixel-tools
haxelib run flixel-tools setup
haxelib update flixel-addons
haxelib update flixel-ui
haxelib update hscript
haxelib update hxCodec
haxelib update hxcpp-debug-server
haxelib git polymod https://github.com/larsiusprime/polymod.git
haxelib git discord_rpc https://github.com/Aidan63/linc_discord-rpc
haxelib git flixel-addons https://github.com/HaxeFlixel/flixel-addons
@echo off
echo Update Successful!
pause

File diff suppressed because one or more lines are too long

5
assets/weeks/week1.json Normal file
View File

@ -0,0 +1,5 @@
{
"songs":["Bopeebo", "Fresh", "Dadbattle"],
"weekid":1,
"weekIcon":["dad"]
}

5
assets/weeks/week2.json Normal file
View File

@ -0,0 +1,5 @@
{
"songs":["Spookeez", "South", "Monster"],
"weekid":2,
"weekIcon":["spooky", "spooky", "monster"]
}

5
assets/weeks/week3.json Normal file
View File

@ -0,0 +1,5 @@
{
"songs":["Pico", "Philly", "Blammed"],
"weekid":3,
"weekIcon":["pico"]
}

5
assets/weeks/week4.json Normal file
View File

@ -0,0 +1,5 @@
{
"songs":["Satin-Panties", "High", "Milf"],
"weekid":4,
"weekIcon":["mom"]
}

5
assets/weeks/week5.json Normal file
View File

@ -0,0 +1,5 @@
{
"songs":["Cocoa", "Eggnog", "Winter-Horrorland"],
"weekid":5,
"weekIcon":["parents-christmas", "parents-christmas", "monster-christmas"]
}

5
assets/weeks/week6.json Normal file
View File

@ -0,0 +1,5 @@
{
"songs":["Senpai", "Roses", "Thorns"],
"weekid":6,
"weekIcon":["senpai", "senpai", "spirit"]
}

5
assets/weeks/week7.json Normal file
View File

@ -0,0 +1,5 @@
{
"songs":["Ugh", "Guns", "Stress"],
"weekid":7,
"weekIcon":["tankman"]
}

View File

@ -8,7 +8,7 @@
"role": "Developer"
}
],
"api_version":"0.2.8",
"api_version":"0.0.1",
"mod_version":"0.0.1",
"license":"unknown"
}

View File

Before

Width:  |  Height:  |  Size: 2.3 MiB

After

Width:  |  Height:  |  Size: 2.3 MiB

View File

@ -1 +0,0 @@
introMod

View File

@ -65,8 +65,9 @@ class ChartingState extends MusicBeatState
var curRenderedSustains:FlxTypedGroup<FlxSprite>;
var gridBG:FlxSprite;
var gridBlackLine:FlxSprite;
var _song:SwagSong;
public static var _song:SwagSong;
var typingShit:FlxInputText;
/*
@ -81,6 +82,8 @@ class ChartingState extends MusicBeatState
var leftIcon:HealthIcon;
var rightIcon:HealthIcon;
var diff:Int = 1;
override function create()
{
curSection = lastSection;
@ -102,7 +105,7 @@ class ChartingState extends MusicBeatState
leftIcon.setPosition(0, -100);
rightIcon.setPosition(gridBG.width / 2, -100);
var gridBlackLine:FlxSprite = new FlxSprite(gridBG.x + gridBG.width / 2).makeGraphic(2, Std.int(gridBG.height), FlxColor.BLACK);
gridBlackLine = new FlxSprite(gridBG.x + gridBG.width / 2).makeGraphic(2, Std.int(gridBG.height), FlxColor.BLACK);
add(gridBlackLine);
curRenderedNotes = new FlxTypedGroup<Note>();
@ -120,7 +123,9 @@ class ChartingState extends MusicBeatState
player1: 'bf',
player2: 'dad',
speed: 1,
validScore: false
validScore: false,
p1KeyCount: 4,
p2KeyCount: 4
};
}
@ -158,8 +163,8 @@ class ChartingState extends MusicBeatState
UI_box = new FlxUITabMenu(null, tabs, true);
UI_box.resize(300, 400);
UI_box.x = FlxG.width / 2;
UI_box.y = 20;
UI_box.x = 0;
UI_box.y = 100;
add(UI_box);
addSongUI();
@ -178,6 +183,10 @@ class ChartingState extends MusicBeatState
var UI_songTitle = new FlxUIInputText(10, 10, 70, _song.song, 8);
typingShit = UI_songTitle;
var stepperdiff:FlxUINumericStepper = new FlxUINumericStepper(10, 40, 1, 0, 0, 3, 2);
stepperdiff.value = diff;
stepperdiff.name = 'song_diff';
var check_voices = new FlxUICheckBox(10, 25, null, null, "Has voice track", 100);
check_voices.checked = _song.needsVoices;
// _song.needsVoices = check_voices.checked;
@ -240,6 +249,15 @@ class ChartingState extends MusicBeatState
});
player2DropDown.selectedLabel = _song.player2;
var stepperp1KeyCount:FlxUINumericStepper = new FlxUINumericStepper(10, 130, 1, 4, 1, 21, 2);
stepperp1KeyCount.value = _song.p1KeyCount;
stepperp1KeyCount.name = 'song_p1KeyCount';
var stepperp2KeyCount:FlxUINumericStepper = new FlxUINumericStepper(140, 130, 1, 4, 1, 21, 2);
stepperp2KeyCount.value = _song.p2KeyCount;
stepperp2KeyCount.name = 'song_p2KeyCount';
var tab_group_song = new FlxUI(null, UI_box);
tab_group_song.name = "Song";
tab_group_song.add(UI_songTitle);
@ -254,6 +272,10 @@ class ChartingState extends MusicBeatState
tab_group_song.add(stepperSpeed);
tab_group_song.add(player1DropDown);
tab_group_song.add(player2DropDown);
tab_group_song.add(stepperdiff);
tab_group_song.add(stepperp1KeyCount);
tab_group_song.add(stepperp2KeyCount);
UI_box.addGroup(tab_group_song);
UI_box.scrollFactor.set();
@ -439,6 +461,21 @@ class ChartingState extends MusicBeatState
_song.notes[curSection].bpm = nums.value;
updateGrid();
}
else if (wname == "song_p1KeyCount")
{
_song.p1KeyCount = Std.int(nums.value);
updateGrid();
}
else if (wname == "song_p2KeyCount")
{
_song.p2KeyCount = Std.int(nums.value);
updateGrid();
}
else if (wname == "song_diff")
{
diff = Std.int(nums.value);
updateGrid();
}
}
// FlxG.log.add(id + " WEED " + sender + " WEED " + data + " WEED " + params);
@ -829,6 +866,27 @@ class ChartingState extends MusicBeatState
function updateGrid():Void
{
//Thanks For LeatherEngine
remove(gridBG);
gridBG.kill();
gridBG.destroy();
gridBG = FlxGridOverlay.create(GRID_SIZE, GRID_SIZE, GRID_SIZE * (_song.p1KeyCount + _song.p2KeyCount),
Std.int(GRID_SIZE * 10));
add(gridBG);
remove(gridBlackLine);
gridBlackLine.kill();
gridBlackLine.destroy();
gridBlackLine = new FlxSprite(gridBG.x
+ (GRID_SIZE * ((!_song.notes[curSection].mustHitSection ? _song.p1KeyCount - 1: _song.p2KeyCount)
+ 1))).makeGraphic(2, Std.int(gridBG.height), FlxColor.BLACK);
add(gridBlackLine);
if (strumLine != null)
strumLine.makeGraphic(Std.int(gridBG.width), 4);
while (curRenderedNotes.members.length > 0)
{
curRenderedNotes.remove(curRenderedNotes.members[0], true);
@ -883,6 +941,8 @@ class ChartingState extends MusicBeatState
note.x = Math.floor(daNoteInfo * GRID_SIZE);
note.y = Math.floor(getYfromStrum((daStrumTime - sectionStartTime()) % (Conductor.stepCrochet * _song.notes[curSection].lengthInSteps)));
note.rawNoteData = daNoteInfo;
curRenderedNotes.add(note);
if (daSus > 0)
@ -915,7 +975,7 @@ class ChartingState extends MusicBeatState
for (i in _song.notes[curSection].sectionNotes)
{
if (i.strumTime == note.strumTime && i.noteData % 4 == note.noteData)
if (i.strumTime == note.strumTime && i.noteData % _song.p1KeyCount == note.noteData)
{
curSelectedNote = _song.notes[curSection].sectionNotes[swagNum];
}
@ -931,7 +991,7 @@ class ChartingState extends MusicBeatState
{
for (i in _song.notes[curSection].sectionNotes)
{
if (i[0] == note.strumTime && i[1] % 4 == note.noteData)
if (i[0] == note.strumTime && i[1] == note.rawNoteData)
{
FlxG.log.add('FOUND EVIL NUMBER');
_song.notes[curSection].sectionNotes.remove(i);
@ -971,7 +1031,7 @@ class ChartingState extends MusicBeatState
if (FlxG.keys.pressed.CONTROL)
{
_song.notes[curSection].sectionNotes.push([noteStrum, (noteData + 4) % 8, noteSus, noteAlt]);
_song.notes[curSection].sectionNotes.push([noteStrum, (noteData + _song.p1KeyCount) % (_song.p1KeyCount + _song.p2KeyCount), noteSus, noteAlt]);
}
trace(noteStrum);
@ -1037,7 +1097,8 @@ class ChartingState extends MusicBeatState
function loadJson(song:String):Void
{
PlayState.SONG = Song.loadFromJson(song.toLowerCase(), song.toLowerCase());
var poop:String = Highscore.formatSong(song.toLowerCase(), diff);
PlayState.SONG = Song.loadFromJson(poop, song.toLowerCase());
LoadingState.loadAndSwitchState(new ChartingState());
}

View File

@ -11,6 +11,10 @@ import flixel.system.FlxAssets.FlxGraphicAsset;
import haxe.Json;
import lime.math.Rectangle;
import lime.utils.Assets;
#if desktop
import sys.FileSystem;
import sys.io.File;
#end
using StringTools;
@ -36,6 +40,20 @@ class CoolUtil
return daList;
}
#if desktop
public static function hotTextFile(path:String):Array<String>
{
var daList:Array<String> = File.getContent(path).trim().split('\n');
for (i in 0...daList.length)
{
daList[i] = daList[i].trim();
}
return daList;
}
#end
public static function numberArray(max:Int, ?min = 0):Array<Int>
{
var dumbArray:Array<Int> = [];

View File

@ -16,6 +16,8 @@ import lime.utils.Assets;
#if desktop
import sys.FileSystem;
import sys.io.File;
import haxe.Json;
import haxe.format.JsonParser;
#end
using StringTools;
@ -35,6 +37,7 @@ class FreeplayState extends MusicBeatState
var lerpScore:Float = 0;
var intendedScore:Int = 0;
/*
var coolColors:Array<Int> = [
0xff9271fd,
0xff9271fd,
@ -45,6 +48,7 @@ class FreeplayState extends MusicBeatState
0xffff78bf,
0xfff6b604
];
*/
private var grpSongs:FlxTypedGroup<Alphabet>;
private var curPlaying:Bool = false;
@ -67,12 +71,14 @@ class FreeplayState extends MusicBeatState
addSong('Test', 1, 'bf-pixel');
#end
/*
var initSonglist = CoolUtil.coolTextFile(Paths.txt('freeplaySonglist'));
for (i in 0...initSonglist.length)
{
songs.push(new SongMetadata(initSonglist[i], 1, 'gf'));
}
*/
if (FlxG.sound.music != null)
{
@ -80,7 +86,21 @@ class FreeplayState extends MusicBeatState
FlxG.sound.playMusic(Paths.music('freakyMenu'));
}
if (StoryMenuState.weekUnlocked[2] || isDebug)
#if desktop
var weekList:Array<String> = sys.FileSystem.readDirectory("assets/weeks/");
var weekJson:String;
var weekParseJson:Dynamic;
for(i in 0...weekList.length) {
weekJson = File.getContent("assets/weeks/"+weekList[i]);
weekParseJson = haxe.Json.parse(weekJson);
var weekSongs:Array<String> = Reflect.getProperty(weekParseJson, "songs");
var weekid:Int = Reflect.getProperty(weekParseJson, "weekid");
var weekIcon:Array<String> = Reflect.getProperty(weekParseJson, "weekIcon");
addWeek(weekSongs, weekid, weekIcon);
trace("Add Week: "+weekList[i]);
}
#else
if (StoryMenuState.weekUnlocked[1] || isDebug)
addWeek(['Bopeebo', 'Fresh', 'Dadbattle'], 1, ['dad']);
if (StoryMenuState.weekUnlocked[2] || isDebug)
@ -100,7 +120,7 @@ class FreeplayState extends MusicBeatState
if (StoryMenuState.weekUnlocked[7] || isDebug)
addWeek(['Ugh', 'Guns', 'Stress'], 7, ['tankman']);
#end
// LOAD MUSIC
// LOAD CHARACTERS
@ -219,7 +239,7 @@ class FreeplayState extends MusicBeatState
}
lerpScore = CoolUtil.coolLerp(lerpScore, intendedScore, 0.4);
bg.color = FlxColor.interpolate(bg.color, coolColors[songs[curSelected].week % coolColors.length], CoolUtil.camLerpShit(0.045));
bg.color = FlxColor.interpolate(bg.color, 0xff9271fd, CoolUtil.camLerpShit(0.045));
scoreText.text = "PERSONAL BEST:" + Math.round(lerpScore);
@ -259,6 +279,17 @@ class FreeplayState extends MusicBeatState
trace('CUR WEEK' + PlayState.storyWeek);
LoadingState.loadAndSwitchState(new PlayState());
}
if (FlxG.keys.pressed.SHIFT){
var poop:String = Highscore.formatSong(songs[curSelected].songName.toLowerCase(), curDifficulty);
PlayState.SONG = Song.loadFromJson(poop, songs[curSelected].songName.toLowerCase());
PlayState.isStoryMode = false;
PlayState.storyDifficulty = curDifficulty;
PlayState.storyWeek = songs[curSelected].week;
trace('CUR WEEK' + PlayState.storyWeek);
LoadingState.loadAndSwitchState(new ChartingState());
}
}
function changeDiff(change:Int = 0)

View File

@ -16,7 +16,7 @@ class Highscore
var formattedSong:String = formatSong(song, diff);
#if newgrounds
NGio.postScore(score, song);
//NGio.postScore(score, song);
#end
if (songScores.exists(formattedSong))

48
source/ManiaTools.hx Normal file
View File

@ -0,0 +1,48 @@
package;
import Controls;
import flixel.FlxG;
class ManiaTools
{
private static var controls(get, never):Controls;
private static function get_controls():Controls
return PlayerSettings.player1.controls;
public static function getHoldKeysToNumber(keyCount:Int = 4):Array<Bool>
{
if (keyCount == 1) return [FlxG.keys.pressed.SPACE];
if (keyCount == 2) return [FlxG.keys.pressed.F, FlxG.keys.pressed.J];
if (keyCount == 3) return [FlxG.keys.pressed.F, FlxG.keys.pressed.SPACE, FlxG.keys.pressed.J];
if (keyCount == 4) return [controls.NOTE_LEFT, controls.NOTE_DOWN, controls.NOTE_UP, controls.NOTE_RIGHT];
if (keyCount == 5) return [FlxG.keys.pressed.D, FlxG.keys.pressed.F, FlxG.keys.pressed.SPACE, FlxG.keys.pressed.J, FlxG.keys.pressed.K];
if (keyCount == 6) return [FlxG.keys.pressed.S, FlxG.keys.pressed.D, FlxG.keys.pressed.F, FlxG.keys.pressed.J, FlxG.keys.pressed.K, FlxG.keys.pressed.L];
return [controls.NOTE_LEFT, controls.NOTE_DOWN, controls.NOTE_UP, controls.NOTE_RIGHT];
}
public static function getPressedKeysToNumber(keyCount:Int = 4):Array<Bool>
{
if (keyCount == 1) return [FlxG.keys.justPressed.SPACE];
if (keyCount == 2) return [FlxG.keys.justPressed.F, FlxG.keys.justPressed.J];
if (keyCount == 3) return [FlxG.keys.justPressed.F, FlxG.keys.justPressed.SPACE, FlxG.keys.justPressed.J];
if (keyCount == 4) return [controls.NOTE_LEFT, controls.NOTE_DOWN, controls.NOTE_UP, controls.NOTE_RIGHT];
if (keyCount == 5) return [FlxG.keys.justPressed.D, FlxG.keys.justPressed.F, FlxG.keys.justPressed.SPACE, FlxG.keys.justPressed.J, FlxG.keys.justPressed.K];
if (keyCount == 6) return [FlxG.keys.justPressed.S, FlxG.keys.justPressed.D, FlxG.keys.justPressed.F, FlxG.keys.justPressed.J, FlxG.keys.justPressed.K, FlxG.keys.justPressed.L];
return [controls.NOTE_LEFT, controls.NOTE_DOWN, controls.NOTE_UP, controls.NOTE_RIGHT];
}
public static function getReleasedKeysToNumber(keyCount:Int = 4):Array<Bool>
{
if (keyCount == 1) return [FlxG.keys.justReleased.SPACE];
if (keyCount == 2) return [FlxG.keys.justReleased.F, FlxG.keys.justReleased.J];
if (keyCount == 3) return [FlxG.keys.justReleased.F, FlxG.keys.justReleased.SPACE, FlxG.keys.justReleased.J];
if (keyCount == 4) return [controls.NOTE_LEFT, controls.NOTE_DOWN, controls.NOTE_UP, controls.NOTE_RIGHT];
if (keyCount == 5) return [FlxG.keys.justReleased.D, FlxG.keys.justReleased.F, FlxG.keys.justReleased.SPACE, FlxG.keys.justReleased.J, FlxG.keys.justReleased.K];
if (keyCount == 6) return [FlxG.keys.justReleased.S, FlxG.keys.justReleased.D, FlxG.keys.justReleased.F, FlxG.keys.justReleased.J, FlxG.keys.justReleased.K, FlxG.keys.justReleased.L];
return [controls.NOTE_LEFT, controls.NOTE_DOWN, controls.NOTE_UP, controls.NOTE_RIGHT];
}
}

View File

@ -26,6 +26,8 @@ class Note extends FlxSprite
public var wasGoodHit:Bool = false;
public var prevNote:Note;
public var rawNoteData:Int = 0;
private var willMiss:Bool = false;
public var altNote:Bool = false;
@ -62,6 +64,26 @@ class Note extends FlxSprite
this.noteData = noteData;
if (PlayState.SONG != null){
if (mustPress)
{
scale.x = scale.x / (PlayState.SONG.p1KeyCount - 3);
scale.y = scale.y / (PlayState.SONG.p1KeyCount - 3);
}else{
scale.x = scale.x / (PlayState.SONG.p2KeyCount - 3);
scale.y = scale.y / (PlayState.SONG.p2KeyCount - 3);
}
}else{
if (mustPress)
{
scale.x = scale.x / (ChartingState._song.p1KeyCount - 3);
scale.y = scale.y / (ChartingState._song.p1KeyCount - 3);
}else{
scale.x = scale.x / (ChartingState._song.p2KeyCount - 3);
scale.y = scale.y / (ChartingState._song.p2KeyCount - 3);
}
}
var daStage:String = PlayState.curStage;
switch (daStage)
@ -126,19 +148,16 @@ class Note extends FlxSprite
shader = colorSwap.shader;
updateColors();
switch (noteData)
x += swagWidth * Math.abs(noteData);
switch (Math.abs(noteData) % 4)
{
case 0:
x += swagWidth * 0;
animation.play('purpleScroll');
case 1:
x += swagWidth * 1;
animation.play('blueScroll');
case 2:
x += swagWidth * 2;
animation.play('greenScroll');
case 3:
x += swagWidth * 3;
animation.play('redScroll');
}
@ -157,7 +176,7 @@ class Note extends FlxSprite
x += width / 2;
switch (noteData)
switch (Math.abs(noteData) % 4)
{
case 2:
animation.play('greenholdend');
@ -178,7 +197,7 @@ class Note extends FlxSprite
if (prevNote.isSustainNote)
{
switch (prevNote.noteData)
switch (Math.abs(prevNote.noteData) % 4)
{
case 0:
prevNote.animation.play('purplehold');

View File

@ -49,7 +49,7 @@ import ui.PreferencesMenu;
import StrumNote;
#if hxCodec
import vlc.MP4Handler;
import hxcodec.VideoHandler;
#end
using StringTools;
@ -963,7 +963,7 @@ class PlayState extends MusicBeatState
inCutscene = true;
FlxG.sound.music.stop();
var video:MP4Handler = new MP4Handler();
var video:VideoHandler = new VideoHandler();
video.finishCallback = function()
{
inCutscene = false;
@ -1510,8 +1510,8 @@ class PlayState extends MusicBeatState
inCutscene = false;
camHUD.visible = true;
generateStaticArrows(0);
generateStaticArrows(1);
generateStaticArrows(0,SONG.p1KeyCount);
generateStaticArrows(1,SONG.p2KeyCount);
talking = false;
startedCountdown = true;
@ -1645,14 +1645,13 @@ class PlayState extends MusicBeatState
for (songNotes in section.sectionNotes)
{
var daStrumTime:Float = songNotes[0];
var daNoteData:Int = Std.int(songNotes[1] % 4);
var gottaHitNote:Bool = section.mustHitSection;
if (songNotes[1] > 3)
if (songNotes[1] >= (!gottaHitNote ? SONG.p1KeyCount : SONG.p2KeyCount))
gottaHitNote = !section.mustHitSection;
var oldNote:Note;
var daNoteData:Int = Std.int(songNotes[1] % (!gottaHitNote ? SONG.p1KeyCount : SONG.p2KeyCount));
if (unspawnNotes.length > 0)
oldNote = unspawnNotes[Std.int(unspawnNotes.length - 1)];
else
@ -1711,12 +1710,12 @@ class PlayState extends MusicBeatState
// ^ These two sorts also look cute together ^
private function generateStaticArrows(player:Int):Void
private function generateStaticArrows(player:Int, keyCount:Int = 4):Void
{
for (i in 0...4)
for (i in 0...keyCount)
{
// FlxG.log.add(i);
var babyArrow:StrumNote = new StrumNote(0, strumLine.y, i, player);
var babyArrow:StrumNote = new StrumNote(0, strumLine.y, i, player, keyCount);
var colorswap:ColorSwap = new ColorSwap();
babyArrow.shader = colorswap.shader;
colorswap.update(Note.arrowColors[i]);
@ -2628,19 +2627,9 @@ class PlayState extends MusicBeatState
private function keyShit():Void
{
// control arrays, order L D R U
var holdArray:Array<Bool> = [controls.NOTE_LEFT, controls.NOTE_DOWN, controls.NOTE_UP, controls.NOTE_RIGHT];
var pressArray:Array<Bool> = [
controls.NOTE_LEFT_P,
controls.NOTE_DOWN_P,
controls.NOTE_UP_P,
controls.NOTE_RIGHT_P
];
var releaseArray:Array<Bool> = [
controls.NOTE_LEFT_R,
controls.NOTE_DOWN_R,
controls.NOTE_UP_R,
controls.NOTE_RIGHT_R
];
var holdArray:Array<Bool> = ManiaTools.getHoldKeysToNumber(SONG.p2KeyCount);
var pressArray:Array<Bool> = ManiaTools.getPressedKeysToNumber(SONG.p2KeyCount);
var releaseArray:Array<Bool> = ManiaTools.getReleasedKeysToNumber(SONG.p2KeyCount);
// HOLDS, check for sustain notes
if (holdArray.contains(true) && /*!boyfriend.stunned && */ generatedMusic)

View File

@ -18,6 +18,9 @@ typedef SwagSong =
var player1:String;
var player2:String;
var validScore:Bool;
var p1KeyCount:Null<Int>;
var p2KeyCount:Null<Int>;
}
class Song
@ -31,6 +34,9 @@ class Song
public var player1:String = 'bf';
public var player2:String = 'dad';
public var p1KeyCount:Int = 4;
public var p2KeyCount:Int = 4;
public function new(song, notes, bpm)
{
this.song = song;
@ -71,6 +77,9 @@ class Song
{
var swagShit:SwagSong = cast Json.parse(rawJson).song;
swagShit.validScore = true;
if (swagShit.p1KeyCount == null) swagShit.p1KeyCount = 4;
if (swagShit.p2KeyCount == null) swagShit.p2KeyCount = swagShit.p1KeyCount;
return swagShit;
}
}

View File

@ -15,6 +15,12 @@ import flixel.tweens.FlxTween;
import flixel.util.FlxColor;
import flixel.util.FlxTimer;
import lime.net.curl.CURLCode;
#if desktop
import sys.FileSystem;
import sys.io.File;
import haxe.Json;
import haxe.format.JsonParser;
#end
using StringTools;
@ -22,41 +28,14 @@ class StoryMenuState extends MusicBeatState
{
var scoreText:FlxText;
var weekData:Array<Dynamic> = [
['Tutorial'],
['Bopeebo', 'Fresh', 'Dadbattle'],
['Spookeez', 'South', "Monster"],
['Pico', 'Philly', "Blammed"],
['Satin-Panties', "High", "Milf"],
['Cocoa', 'Eggnog', 'Winter-Horrorland'],
['Senpai', 'Roses', 'Thorns'],
['Ugh', 'Guns', 'Stress']
];
var weekData:Array<Dynamic> = [];
var curDifficulty:Int = 1;
public static var weekUnlocked:Array<Bool> = [true, true, true, true, true, true, true, true];
var weekCharacters:Array<Dynamic> = [
['dad', 'bf', 'gf'],
['dad', 'bf', 'gf'],
['spooky', 'bf', 'gf'],
['pico', 'bf', 'gf'],
['mom', 'bf', 'gf'],
['parents-christmas', 'bf', 'gf'],
['senpai', 'bf', 'gf'],
['tankman', 'bf', 'gf']
];
var weekCharacters:Array<Dynamic> = [];
var weekNames:Array<String> = [
"",
"Daddy Dearest",
"Spooky Month",
"PICO",
"MOMMY MUST MURDER",
"RED SNOW",
"hating simulator ft. moawling",
"TANKMAN"
];
var weekNames:Array<String> = [];
var txtWeekTitle:FlxText;
@ -85,6 +64,56 @@ class StoryMenuState extends MusicBeatState
FlxG.sound.playMusic(Paths.music('freakyMenu'));
}
#if desktop
var weekList:Array<String> = sys.FileSystem.readDirectory("assets/weeks/");
var weekJson:String;
var weekParseJson:Dynamic;
for(i in 0...weekList.length) {
weekJson = File.getContent("assets/weeks/"+weekList[i]);
weekParseJson = haxe.Json.parse(weekJson);
var weekSongs:Array<String> = Reflect.getProperty(weekParseJson, "songs");
var weekChars:Array<String> = Reflect.getProperty(weekParseJson, "weekCharacter");
var weekName:String = Reflect.getProperty(weekParseJson, "weekName");
weekData.push(weekSongs);
weekCharacters.push(weekChars);
weekNames.push(weekName);
trace("Add Week: "+weekList[i]);
}
#else
weekData = [
['Tutorial'],
['Bopeebo', 'Fresh', 'Dadbattle'],
['Spookeez', 'South', "Monster"],
['Pico', 'Philly', "Blammed"],
['Satin-Panties', "High", "Milf"],
['Cocoa', 'Eggnog', 'Winter-Horrorland'],
['Senpai', 'Roses', 'Thorns'],
['Ugh', 'Guns', 'Stress']
];
weekCharacters = [
['dad', 'bf', 'gf'],
['dad', 'bf', 'gf'],
['spooky', 'bf', 'gf'],
['pico', 'bf', 'gf'],
['mom', 'bf', 'gf'],
['parents-christmas', 'bf', 'gf'],
['senpai', 'bf', 'gf'],
['tankman', 'bf', 'gf']
];
var weekNames = [
"",
"Daddy Dearest",
"Spooky Month",
"PICO",
"MOMMY MUST MURDER",
"RED SNOW",
"hating simulator ft. moawling",
"TANKMAN"
];
#end
persistentUpdate = persistentDraw = true;
scoreText = new FlxText(10, 10, 0, "SCORE: 49324858", 36);

View File

@ -17,6 +17,7 @@ class StrumNote extends FlxSprite
public var direction:Float = 90;//plan on doing scroll directions soon -bb
public var downScroll:Bool = false;//plan on doing scroll directions soon -bb
public var sustainReduce:Bool = true;
public var keyCount:Int = 4;
private var player:Int;
@ -29,13 +30,14 @@ class StrumNote extends FlxSprite
return value;
}
public function new(x:Float, y:Float, leData:Int, player:Int) {
public function new(x:Float, y:Float, leData:Int, player:Int, keyCount:Int = 4) {
x += Note.swagWidth * leData;
colorSwap = new ColorSwap();
shader = colorSwap.shader;
noteData = leData;
this.player = player;
this.noteData = leData;
this.keyCount = keyCount;
super(x, y);
var skin:String = 'NOTE_assets';
@ -182,8 +184,14 @@ class StrumNote extends FlxSprite
if(animation.curAnim.name == 'confirm' && !PlayState.curStage.startsWith('school')) {
centerOrigin();
centerOffsets();
offset.x -= 13;
offset.y -= 13;
//Thanks For LeatherEngine
offset.x = frameWidth / 2;
offset.y = frameHeight / 2;
var scale = keyCount;
offset.x -= 156 * scale / 2;
offset.y -= 156 * scale / 2;
}
}
}

View File

@ -75,10 +75,11 @@ class TitleState extends MusicBeatState
override public function create():Void
{
#if polymod
var mods:Array<String> = CoolUtil.hotTextFile("mods/modList.txt");
//Thanks For Leather Engine
Polymod.init({
modRoot:"mods/",
dirs: ['introMod'],
dirs: mods,
framework: FLIXEL,
errorCallback: function(error:PolymodError)
{
@ -91,11 +92,24 @@ class TitleState extends MusicBeatState
"songs" => "songs",
"stages" => "stages",
"shared" => "shared",
"fonts" => "fonts"
"fonts" => "fonts",
"weeks" => "weeks",
"data" => "data",
"images" => "images",
"music" => "music",
"sounds" => "sounds",
"tutorial" => "tutorial",
"week1" => "week1",
"week2" => "week2",
"week3" => "week3",
"week4" => "week4",
"week5" => "week5",
"week6" => "week6",
"week7" => "week7"
]
}
});
// FlxG.bitmap.clearCache();
FlxG.bitmap.clearCache();
#end
if (!doneFlixelSplash) {
@ -186,10 +200,13 @@ class TitleState extends MusicBeatState
// netConnection.addEventListener(MouseEvent.MOUSE_DOWN, overlay_onMouseDown);
#else
/*
new FlxTimer().start(1, function(tmr:FlxTimer)
{
startIntro();
});
*/
startIntro();
#end
#if discord_rpc
@ -353,8 +370,10 @@ class TitleState extends MusicBeatState
else
initialized = true;
/*
if (FlxG.sound.music != null)
FlxG.sound.music.onComplete = function() FlxG.switchState(new VideoState());
*/
startedIntro = true;
// credGroup.add(credTextShit);

View File

@ -5,6 +5,15 @@ import flixel.group.FlxSpriteGroup;
import flixel.graphics.frames.FlxAtlasFrames;
import flixel.util.FlxStringUtil;
@:forward
abstract DefaultText(AtlasText) from AtlasText to AtlasText
{
inline public function new (x = 0.0, y = 0.0, text:String)
{
this = new AtlasText(x, y, text, Default);
}
}
@:forward
abstract BoldText(AtlasText) from AtlasText to AtlasText
{

View File

@ -101,7 +101,7 @@ class ControlsMenu extends ui.OptionsState.Page
if (currentHeader != null && name.indexOf(currentHeader) == 0)
name = name.substr(currentHeader.length);
var label = labels.add(new BoldText(150, y, name));
var label = labels.add(new DefaultText(150, y, name));
label.alpha = 0.6;
for (i in 0...COLUMNS)
createItem(label.x + 400 + i * 300, y, control, i);

View File

@ -4,22 +4,34 @@ import flixel.FlxG;
import flixel.group.FlxGroup.FlxTypedGroup;
import flixel.text.FlxText;
import flixel.util.FlxColor;
import flixel.FlxSprite;
import Controls;
#if desktop
import sys.FileSystem;
import sys.io.File;
import haxe.Json;
import haxe.format.JsonParser;
#end
#if polymod
import polymod.Polymod;
import polymod.Polymod.ModMetadata;
#end
using StringTools;
class ModMenu extends ui.OptionsState.Page
{
var grpMods:FlxTypedGroup<ModMenuItem>;
var enabledMods:Array<String> = [];
var modFolders:Array<String> = [];
var modList:Array<ModMetadata> = [];
public static var grpMods:FlxTypedGroup<ModMenuItem>;
public static var enabledMods:Array<String> = [];
var curSelected:Int = 0;
var descriptionText:FlxText;
var descBg:FlxSprite;
public static var MOD_PATH = "./mods";
public function new():Void
{
super();
@ -28,6 +40,19 @@ class ModMenu extends ui.OptionsState.Page
add(grpMods);
refreshModList();
descBg = new FlxSprite(0, FlxG.height - 90).makeGraphic(FlxG.width, 90, 0xFF000000);
descBg.alpha = 0.6;
add(descBg);
descriptionText = new FlxText(descBg.x, descBg.y + 4, FlxG.width, "Description", 18);
descriptionText.setFormat(Paths.font("vcr.ttf"), 18, FlxColor.WHITE, CENTER);
descriptionText.borderColor = FlxColor.BLACK;
descriptionText.borderSize = 1;
descriptionText.borderStyle = OUTLINE;
descriptionText.scrollFactor.set();
descriptionText.screenCenter(X);
add(descriptionText);
}
override function update(elapsed:Float)
@ -42,8 +67,9 @@ class ModMenu extends ui.OptionsState.Page
if (controls.UI_DOWN_P)
selections(1);
if (FlxG.keys.justPressed.SPACE)
if (FlxG.keys.justPressed.SPACE){
grpMods.members[curSelected].modEnabled = !grpMods.members[curSelected].modEnabled;
}
if (FlxG.keys.justPressed.I && curSelected != 0)
{
@ -68,10 +94,10 @@ class ModMenu extends ui.OptionsState.Page
{
curSelected += change;
if (curSelected >= modFolders.length)
if (curSelected >= modList.length)
curSelected = 0;
if (curSelected < 0)
curSelected = modFolders.length - 1;
curSelected = modList.length - 1;
for (txt in 0...grpMods.length)
{
@ -83,10 +109,33 @@ class ModMenu extends ui.OptionsState.Page
grpMods.members[txt].color = FlxColor.WHITE;
}
descriptionText.screenCenter(X);
descriptionText.text =
modList[curSelected].description
+ "\nContributors:";
var _count:Int = 0;
for (i in modList[curSelected].contributors){
if (_count != 0){
descriptionText.text =
descriptionText.text
+ ",";
}
descriptionText.text =
descriptionText.text
+ i.name+"("+i.role+")";
}
descriptionText.text =
descriptionText.text
+ "\nnekoEngine Version: " + modList[curSelected].apiVersion
+ "\nMod Version: " + modList[curSelected].modVersion
+ "\n";
organizeByY();
}
inline static var MOD_PATH = "./mods";
private function refreshModList():Void
{
while (grpMods.members.length > 0)
@ -95,8 +144,7 @@ class ModMenu extends ui.OptionsState.Page
}
#if polymod
var modList:Array<ModMetadata> = [];
modFolders = [];
modList = [];
trace("mods path:" + FileSystem.absolutePath(MOD_PATH));
if (!FileSystem.exists(MOD_PATH))
@ -104,22 +152,15 @@ class ModMenu extends ui.OptionsState.Page
FlxG.log.warn("missing mods folder, expected: " + FileSystem.absolutePath(MOD_PATH));
return;
}
for (file in FileSystem.readDirectory(MOD_PATH))
{
if (FileSystem.isDirectory(MOD_PATH + file))
modFolders.push(file);
}
enabledMods = [];
enabledMods = CoolUtil.hotTextFile(MOD_PATH+"/modList.txt");
modList = Polymod.scan(MOD_PATH);
trace(modList);
modList = Polymod.scan({modRoot: MOD_PATH});
var loopNum:Int = 0;
for (i in modList)
{
trace(i.id);
var txt:ModMenuItem = new ModMenuItem(0, 10 + (40 * loopNum), 0, i.id, 32);
txt.text = i.id;
grpMods.add(txt);

View File

@ -7,6 +7,20 @@ import flixel.addons.transition.FlxTransitionableState;
import flixel.group.FlxGroup;
import flixel.util.FlxSignal;
#if desktop
import sys.FileSystem;
import sys.io.File;
import haxe.Json;
import haxe.format.JsonParser;
#end
#if polymod
import polymod.Polymod;
import polymod.Polymod.ModMetadata;
#end
using StringTools;
// typedef OptionsState = OptionsMenu_old;
// class OptionsState_new extends MusicBeatState
class OptionsState extends MusicBeatState
@ -33,7 +47,7 @@ class OptionsState extends MusicBeatState
var controls = addPage(Controls, new ControlsMenu());
// var colors = addPage(Colors, new ColorsMenu());
#if cpp
#if desktop
var mods = addPage(Mods, new ModMenu());
#end
@ -44,8 +58,8 @@ class OptionsState extends MusicBeatState
// colors.onExit.add(switchPage.bind(Options));
preferences.onExit.add(switchPage.bind(Options));
#if cpp
mods.onExit.add(switchPage.bind(Options));
#if desktop
mods.onExit.add(reloadMod);
#end
}
else
@ -99,6 +113,20 @@ class OptionsState extends MusicBeatState
// Todo animate?
FlxG.switchState(new MainMenuState());
}
function reloadMod()
{
var rawEnabledMods:String = "";
for (i in ModMenu.grpMods.members){
if (i.modEnabled){
rawEnabledMods += i.text + "\n";
}
}
File.saveContent(ModMenu.MOD_PATH + "/modList.txt", rawEnabledMods.trim());
ModMenu.enabledMods = rawEnabledMods.trim().split('\n');
FlxG.sound.play(Paths.sound('cancelMenu'));
FlxG.switchState(new OptionsState());
}
}
class Page extends FlxGroup
@ -180,7 +208,7 @@ class OptionsMenu extends Page
createItem('preferences', function() switchPage(Preferences));
createItem("controls", function() switchPage(Controls));
// createItem('colors', function() switchPage(Colors));
#if cpp
#if polymod
createItem('mods', function() switchPage(Mods));
#end