yep from KadeDev/master
yep
This commit is contained in:
commit
19209ab803
1
assets/preload/data/offsettest/offsettest.json
Normal file
1
assets/preload/data/offsettest/offsettest.json
Normal file
File diff suppressed because one or more lines are too long
BIN
assets/songs/offsettest/Inst.mp3
Normal file
BIN
assets/songs/offsettest/Inst.mp3
Normal file
Binary file not shown.
BIN
assets/songs/offsettest/Inst.ogg
Normal file
BIN
assets/songs/offsettest/Inst.ogg
Normal file
Binary file not shown.
@ -85,6 +85,9 @@ class ChartingState extends MusicBeatState
|
||||
var leftIcon:HealthIcon;
|
||||
var rightIcon:HealthIcon;
|
||||
|
||||
private var lastNote:Note;
|
||||
|
||||
|
||||
override function create()
|
||||
{
|
||||
curSection = lastSection;
|
||||
@ -587,8 +590,6 @@ class ChartingState extends MusicBeatState
|
||||
}
|
||||
else
|
||||
{
|
||||
trace('tryin to delete note');
|
||||
trace(note.noteData);
|
||||
deleteNote(note);
|
||||
}
|
||||
}
|
||||
@ -656,6 +657,19 @@ class ChartingState extends MusicBeatState
|
||||
|
||||
if (!typingShit.hasFocus)
|
||||
{
|
||||
|
||||
if (FlxG.keys.pressed.CONTROL)
|
||||
{
|
||||
if (FlxG.keys.justPressed.Z && lastNote != null)
|
||||
{
|
||||
trace(curRenderedNotes.members.contains(lastNote) ? "delete note" : "add note");
|
||||
if (curRenderedNotes.members.contains(lastNote))
|
||||
deleteNote(lastNote);
|
||||
else
|
||||
addNote(lastNote);
|
||||
}
|
||||
}
|
||||
|
||||
var shiftThing:Int = 1;
|
||||
if (FlxG.keys.pressed.SHIFT)
|
||||
shiftThing = 4;
|
||||
@ -959,6 +973,10 @@ class ChartingState extends MusicBeatState
|
||||
note.x = Math.floor(daNoteInfo * GRID_SIZE);
|
||||
note.y = Math.floor(getYfromStrum((daStrumTime - sectionStartTime()) % (Conductor.stepCrochet * _song.notes[curSection].lengthInSteps)));
|
||||
|
||||
if (curSelectedNote != null)
|
||||
if (curSelectedNote[0] == note.strumTime)
|
||||
lastNote = note;
|
||||
|
||||
curRenderedNotes.add(note);
|
||||
|
||||
if (daSus > 0)
|
||||
@ -1003,27 +1021,20 @@ class ChartingState extends MusicBeatState
|
||||
updateNoteUI();
|
||||
}
|
||||
|
||||
function deleteNote(note:Note):Void
|
||||
{
|
||||
trace(_song.notes[curSection].sectionNotes);
|
||||
for (n in 0..._song.notes[curSection].sectionNotes.length)
|
||||
{
|
||||
var i = _song.notes[curSection].sectionNotes[n];
|
||||
if (i == null)
|
||||
continue;
|
||||
if ((i[0] == note.strumTime + (note.strumTime == 0 ? 0 : 1)
|
||||
? true : i[0] == note.strumTime)
|
||||
&& i[1] % 4 == note.noteData)
|
||||
// Why does it do this?
|
||||
// I DONT FUCKING KNOW!!!!!!!!!!!!!!
|
||||
{
|
||||
trace('GAMING');
|
||||
_song.notes[curSection].sectionNotes.remove(i);
|
||||
}
|
||||
}
|
||||
|
||||
updateGrid();
|
||||
}
|
||||
function deleteNote(note:Note):Void
|
||||
{
|
||||
lastNote = note;
|
||||
for (i in _song.notes[curSection].sectionNotes)
|
||||
{
|
||||
if (i[0] == note.strumTime && i[1] % 4 == note.noteData)
|
||||
{
|
||||
_song.notes[curSection].sectionNotes.remove(i);
|
||||
}
|
||||
}
|
||||
|
||||
updateGrid();
|
||||
}
|
||||
|
||||
function clearSection():Void
|
||||
{
|
||||
@ -1042,23 +1053,20 @@ class ChartingState extends MusicBeatState
|
||||
updateGrid();
|
||||
}
|
||||
|
||||
private function addNote():Void
|
||||
private function addNote(?n:Note):Void
|
||||
{
|
||||
var noteStrum = getStrumTime(dummyArrow.y) + sectionStartTime();
|
||||
var noteData = Math.floor(FlxG.mouse.x / GRID_SIZE);
|
||||
var noteSus = 0;
|
||||
|
||||
_song.notes[curSection].sectionNotes.push([noteStrum, noteData, noteSus]);
|
||||
if (n != null)
|
||||
_song.notes[curSection].sectionNotes.push([n.strumTime, n.noteData, n.sustainLength]);
|
||||
else
|
||||
_song.notes[curSection].sectionNotes.push([noteStrum, noteData, noteSus]);
|
||||
|
||||
curSelectedNote = _song.notes[curSection].sectionNotes[_song.notes[curSection].sectionNotes.length - 1];
|
||||
var thingy = _song.notes[curSection].sectionNotes[_song.notes[curSection].sectionNotes.length - 1];
|
||||
|
||||
if (FlxG.keys.pressed.CONTROL)
|
||||
{
|
||||
_song.notes[curSection].sectionNotes.push([noteStrum, (noteData + 4) % 8, noteSus]);
|
||||
}
|
||||
|
||||
trace(noteStrum);
|
||||
trace(curSection);
|
||||
curSelectedNote = thingy;
|
||||
|
||||
updateGrid();
|
||||
updateNoteUI();
|
||||
|
@ -66,4 +66,4 @@ class Conductor
|
||||
crochet = ((60 / bpm) * 1000);
|
||||
stepCrochet = crochet / 4;
|
||||
}
|
||||
}
|
||||
}
|
@ -217,7 +217,6 @@ class FreeplayState extends MusicBeatState
|
||||
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 PlayState());
|
||||
@ -272,6 +271,7 @@ class FreeplayState extends MusicBeatState
|
||||
#end
|
||||
|
||||
#if PRELOAD_ALL
|
||||
Conductor.changeBPM(Song.loadFromJson(Highscore.formatSong(songs[curSelected].songName,0),songs[curSelected].songName.toLowerCase()).bpm);
|
||||
FlxG.sound.playMusic(Paths.inst(songs[curSelected].songName), 0);
|
||||
#end
|
||||
|
||||
|
@ -12,7 +12,7 @@ class HealthIcon extends FlxSprite
|
||||
public function new(char:String = 'bf', isPlayer:Bool = false)
|
||||
{
|
||||
super();
|
||||
trace(Paths.image('iconGrid','data'));
|
||||
|
||||
loadGraphic(Paths.image('iconGrid'), true, 150, 150);
|
||||
|
||||
antialiasing = true;
|
||||
|
@ -51,6 +51,9 @@ class KadeEngineData
|
||||
if (FlxG.save.data.scrollSpeed == null)
|
||||
FlxG.save.data.scrollSpeed = 1;
|
||||
|
||||
if (FlxG.save.data.npsDisplay == null)
|
||||
FlxG.save.data.npsDisplay = false;
|
||||
|
||||
(cast (Lib.current.getChildAt(0), Main)).setFPSCap(FlxG.save.data.fpsCap);
|
||||
}
|
||||
}
|
||||
|
@ -1,74 +0,0 @@
|
||||
package;
|
||||
|
||||
import flixel.FlxG;
|
||||
import flixel.FlxSprite;
|
||||
import flixel.FlxState;
|
||||
import flixel.group.FlxGroup.FlxTypedGroup;
|
||||
import flixel.text.FlxText;
|
||||
|
||||
class LatencyState extends FlxState
|
||||
{
|
||||
var offsetText:FlxText;
|
||||
var noteGrp:FlxTypedGroup<Note>;
|
||||
var strumLine:FlxSprite;
|
||||
|
||||
override function create()
|
||||
{
|
||||
FlxG.sound.playMusic(Paths.sound('soundTest'));
|
||||
|
||||
noteGrp = new FlxTypedGroup<Note>();
|
||||
add(noteGrp);
|
||||
|
||||
for (i in 0...32)
|
||||
{
|
||||
var note:Note = new Note(Conductor.crochet * i, 1);
|
||||
noteGrp.add(note);
|
||||
}
|
||||
|
||||
offsetText = new FlxText();
|
||||
offsetText.screenCenter();
|
||||
add(offsetText);
|
||||
|
||||
strumLine = new FlxSprite(FlxG.width / 2, 100).makeGraphic(FlxG.width, 5);
|
||||
add(strumLine);
|
||||
|
||||
Conductor.changeBPM(120);
|
||||
|
||||
super.create();
|
||||
}
|
||||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
offsetText.text = "Offset: " + Conductor.offset + "ms";
|
||||
|
||||
Conductor.songPosition = FlxG.sound.music.time - Conductor.offset;
|
||||
|
||||
var multiply:Float = 1;
|
||||
|
||||
if (FlxG.keys.pressed.SHIFT)
|
||||
multiply = 10;
|
||||
|
||||
if (FlxG.keys.justPressed.RIGHT)
|
||||
Conductor.offset += 1 * multiply;
|
||||
if (FlxG.keys.justPressed.LEFT)
|
||||
Conductor.offset -= 1 * multiply;
|
||||
|
||||
if (FlxG.keys.justPressed.SPACE)
|
||||
{
|
||||
FlxG.sound.music.stop();
|
||||
|
||||
FlxG.resetState();
|
||||
}
|
||||
|
||||
noteGrp.forEach(function(daNote:Note)
|
||||
{
|
||||
daNote.y = (strumLine.y - (Conductor.songPosition - daNote.strumTime) * 0.45);
|
||||
daNote.x = strumLine.x + 30;
|
||||
|
||||
if (daNote.y < strumLine.y)
|
||||
daNote.kill();
|
||||
});
|
||||
|
||||
super.update(elapsed);
|
||||
}
|
||||
}
|
@ -33,7 +33,7 @@ class LoadReplayState extends MusicBeatState
|
||||
{
|
||||
var menuBG:FlxSprite = new FlxSprite().loadGraphic(Paths.image('menuDesat'));
|
||||
#if sys
|
||||
controlsStrings = sys.FileSystem.readDirectory(Sys.getCwd() + "\\assets\\replays\\");
|
||||
controlsStrings = sys.FileSystem.readDirectory(Sys.getCwd() + "/assets/replays/");
|
||||
#end
|
||||
trace(controlsStrings);
|
||||
|
||||
|
@ -36,7 +36,7 @@ class MainMenuState extends MusicBeatState
|
||||
var newGaming2:FlxText;
|
||||
var newInput:Bool = true;
|
||||
|
||||
public static var nightly:String = "-Nightly.2";
|
||||
public static var nightly:String = "-Nightly.3";
|
||||
|
||||
public static var kadeEngineVer:String = "1.3.1" + nightly;
|
||||
public static var gameVer:String = "0.2.7.1";
|
||||
|
@ -24,6 +24,8 @@ class MusicBeatState extends FlxUIState
|
||||
|
||||
override function create()
|
||||
{
|
||||
(cast (Lib.current.getChildAt(0), Main)).setFPSCap(FlxG.save.data.fpsCap);
|
||||
|
||||
if (transIn != null)
|
||||
trace('reg ' + transIn.region);
|
||||
|
||||
@ -69,6 +71,7 @@ class MusicBeatState extends FlxUIState
|
||||
|
||||
private function updateBeat():Void
|
||||
{
|
||||
lastBeat = curStep;
|
||||
curBeat = Math.floor(curStep / 4);
|
||||
}
|
||||
|
||||
|
107
source/Note.hx
107
source/Note.hx
@ -41,14 +41,14 @@ class Note extends FlxSprite
|
||||
|
||||
if (prevNote == null)
|
||||
prevNote = this;
|
||||
|
||||
|
||||
this.prevNote = prevNote;
|
||||
isSustainNote = sustainNote;
|
||||
|
||||
x += 50;
|
||||
// MAKE SURE ITS DEFINITELY OFF SCREEN?
|
||||
y -= 2000;
|
||||
this.strumTime = strumTime + FlxG.save.data.offset;
|
||||
this.strumTime = strumTime;
|
||||
|
||||
this.noteData = noteData;
|
||||
|
||||
@ -121,61 +121,60 @@ class Note extends FlxSprite
|
||||
animation.play('redScroll');
|
||||
}
|
||||
|
||||
// trace(prevNote);
|
||||
|
||||
// we make sure its downscroll and its a SUSTAIN NOTE (aka a trail, not a note)
|
||||
// and flip it so it doesn't look weird.
|
||||
// THIS DOESN'T FUCKING FLIP THE NOTE, CONTRIBUTERS DON'T JUST COMMENT THIS OUT JESUS
|
||||
if (FlxG.save.data.downscroll && sustainNote)
|
||||
flipY = true;
|
||||
|
||||
|
||||
if (isSustainNote && prevNote != null)
|
||||
{
|
||||
noteScore * 0.2;
|
||||
alpha = 0.6;
|
||||
|
||||
x += width / 2;
|
||||
|
||||
switch (noteData)
|
||||
{
|
||||
case 2:
|
||||
animation.play('greenholdend');
|
||||
case 3:
|
||||
animation.play('redholdend');
|
||||
case 1:
|
||||
animation.play('blueholdend');
|
||||
case 0:
|
||||
animation.play('purpleholdend');
|
||||
}
|
||||
|
||||
updateHitbox();
|
||||
|
||||
x -= width / 2;
|
||||
|
||||
if (PlayState.curStage.startsWith('school'))
|
||||
x += 30;
|
||||
|
||||
if (prevNote.isSustainNote)
|
||||
{
|
||||
switch (prevNote.noteData)
|
||||
{
|
||||
case 0:
|
||||
prevNote.animation.play('purplehold');
|
||||
case 1:
|
||||
prevNote.animation.play('bluehold');
|
||||
case 2:
|
||||
prevNote.animation.play('greenhold');
|
||||
case 3:
|
||||
prevNote.animation.play('redhold');
|
||||
}
|
||||
|
||||
prevNote.scale.y *= Conductor.stepCrochet / 100 * 1.5 * PlayState.SONG.speed;
|
||||
prevNote.updateHitbox();
|
||||
// prevNote.setGraphicSize();
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
noteScore * 0.2;
|
||||
alpha = 0.6;
|
||||
|
||||
var oneTime:Bool = false;
|
||||
x += width / 2;
|
||||
|
||||
switch (noteData)
|
||||
{
|
||||
case 2:
|
||||
animation.play('greenholdend');
|
||||
case 3:
|
||||
animation.play('redholdend');
|
||||
case 1:
|
||||
animation.play('blueholdend');
|
||||
case 0:
|
||||
animation.play('purpleholdend');
|
||||
}
|
||||
|
||||
updateHitbox();
|
||||
|
||||
x -= width / 2;
|
||||
|
||||
if (PlayState.curStage.startsWith('school'))
|
||||
x += 30;
|
||||
|
||||
if (prevNote.isSustainNote)
|
||||
{
|
||||
switch (prevNote.noteData)
|
||||
{
|
||||
case 0:
|
||||
prevNote.animation.play('purplehold');
|
||||
case 1:
|
||||
prevNote.animation.play('bluehold');
|
||||
case 2:
|
||||
prevNote.animation.play('greenhold');
|
||||
case 3:
|
||||
prevNote.animation.play('redhold');
|
||||
}
|
||||
|
||||
prevNote.scale.y *= Conductor.stepCrochet / 100 * 1.8 * PlayState.SONG.speed;
|
||||
prevNote.updateHitbox();
|
||||
// prevNote.setGraphicSize();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
@ -183,19 +182,15 @@ class Note extends FlxSprite
|
||||
|
||||
if (mustPress)
|
||||
{
|
||||
if ((strumTime > Conductor.songPosition - Conductor.safeZoneOffset
|
||||
&& strumTime < Conductor.songPosition + Conductor.safeZoneOffset))
|
||||
{
|
||||
// The * 0.5 is so that it's easier to hit them too late, instead of too early
|
||||
if (strumTime > Conductor.songPosition - Conductor.safeZoneOffset
|
||||
&& strumTime < Conductor.songPosition + (Conductor.safeZoneOffset * 0.5))
|
||||
canBeHit = true;
|
||||
}
|
||||
else
|
||||
canBeHit = false;
|
||||
|
||||
if (strumTime < Conductor.songPosition - Conductor.safeZoneOffset && !wasGoodHit)
|
||||
{
|
||||
tooLate = true;
|
||||
rating = "shit";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -255,6 +255,27 @@ class RainbowFPSOption extends Option
|
||||
}
|
||||
}
|
||||
|
||||
class NPSDisplayOption extends Option
|
||||
{
|
||||
public function new(desc:String)
|
||||
{
|
||||
super();
|
||||
description = desc;
|
||||
}
|
||||
|
||||
public override function press():Bool
|
||||
{
|
||||
FlxG.save.data.npsDisplay = !FlxG.save.data.npsDisplay;
|
||||
display = updateDisplay();
|
||||
return true;
|
||||
}
|
||||
|
||||
private override function updateDisplay():String
|
||||
{
|
||||
return "NPS Display " + (!FlxG.save.data.npsDisplay ? "off" : "on");
|
||||
}
|
||||
}
|
||||
|
||||
class ReplayOption extends Option
|
||||
{
|
||||
public function new(desc:String)
|
||||
@ -297,3 +318,33 @@ class CustomizeGameplay extends Option
|
||||
}
|
||||
}
|
||||
|
||||
class OffsetMenu extends Option
|
||||
{
|
||||
public function new(desc:String)
|
||||
{
|
||||
super();
|
||||
description = desc;
|
||||
}
|
||||
|
||||
public override function press():Bool
|
||||
{
|
||||
trace("switch");
|
||||
var poop:String = Highscore.formatSong("offsetTest", 1);
|
||||
|
||||
PlayState.SONG = Song.loadFromJson(poop, "offsetTest");
|
||||
PlayState.isStoryMode = false;
|
||||
PlayState.storyDifficulty = 0;
|
||||
PlayState.storyWeek = 0;
|
||||
trace('CUR WEEK' + PlayState.storyWeek);
|
||||
LoadingState.loadAndSwitchState(new PlayState());
|
||||
return false;
|
||||
}
|
||||
|
||||
private override function updateDisplay():String
|
||||
{
|
||||
return "Time your offset";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -23,14 +23,16 @@ class OptionsMenu extends MusicBeatState
|
||||
new OptionCatagory("Gameplay", [
|
||||
new DFJKOption(controls),
|
||||
new FPSCapOption("Cap your FPS (Left for -10, Right for -10)"),
|
||||
new CustomizeGameplay("Drag'n'Drop Gameplay Modules around to your preference"),
|
||||
new ScrollSpeedOption("Change your scroll speed (Left for -0.1, right for +0.1. If its at 1, it will be chart dependent)")
|
||||
new ScrollSpeedOption("Change your scroll speed (Left for -0.1, right for +0.1. If its at 1, it will be chart dependent)"),
|
||||
new OffsetMenu("Get a note offset based off of your inputs!"),
|
||||
new CustomizeGameplay("Drag'n'Drop Gameplay Modules around to your preference")
|
||||
]),
|
||||
new OptionCatagory("Appearence", [
|
||||
new SongPositionOption("Show the songs current position (as a bar)"),
|
||||
new DownscrollOption("Change the layout of the strumline."),
|
||||
new RainbowFPSOption("Make the FPS Counter Rainbow (Only works with the FPS Counter toggeled on)"),
|
||||
new AccuracyOption("Display accuracy information.")
|
||||
new AccuracyOption("Display accuracy information."),
|
||||
new NPSDisplayOption("Shows your current Notes Per Second.")
|
||||
]),
|
||||
new OptionCatagory("Misc", [
|
||||
new EtternaModeOption("Harder Hit Windows and a different scoring system."),
|
||||
@ -147,10 +149,10 @@ class OptionsMenu extends MusicBeatState
|
||||
versionShit.text = "Current Scroll Speed: " + FlxG.save.data.scrollSpeed + " - Description - " + currentDescription;
|
||||
default:
|
||||
if (FlxG.keys.pressed.RIGHT)
|
||||
FlxG.save.data.offset++;
|
||||
FlxG.save.data.offset += 0.1;
|
||||
|
||||
if (FlxG.keys.pressed.LEFT)
|
||||
FlxG.save.data.offset--;
|
||||
FlxG.save.data.offset -= 0.1;
|
||||
|
||||
versionShit.text = "Offset (Left, Right): " + FlxG.save.data.offset + " - Description - " + currentDescription;
|
||||
}
|
||||
|
@ -124,6 +124,10 @@ class PlayState extends MusicBeatState
|
||||
private var camHUD:FlxCamera;
|
||||
private var camGame:FlxCamera;
|
||||
|
||||
|
||||
var notesHitArray:Array<Date> = [];
|
||||
var currentFrames:Int = 0;
|
||||
|
||||
var dialogue:Array<String> = ['blah blah blah', 'coolswag'];
|
||||
|
||||
var halloweenBG:FlxSprite;
|
||||
@ -823,6 +827,8 @@ class PlayState extends MusicBeatState
|
||||
scoreTxt.x = healthBarBG.x + healthBarBG.width / 2;
|
||||
scoreTxt.setFormat(Paths.font("vcr.ttf"), 16, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE,FlxColor.BLACK);
|
||||
scoreTxt.scrollFactor.set();
|
||||
if (SONG.song.contains('offsetTest'))
|
||||
scoreTxt.x += 300;
|
||||
add(scoreTxt);
|
||||
|
||||
replayTxt = new FlxText(healthBarBG.x + healthBarBG.width / 2 - 75, healthBarBG.y + (FlxG.save.data.downscroll ? 100 : -100), 0, "REPLAY", 20);
|
||||
@ -1476,12 +1482,10 @@ class PlayState extends MusicBeatState
|
||||
ranking = "(MFC)";
|
||||
else if (misses == 0 && bads == 0 && shits == 0 && goods >= 1) // Good Full Combo (Nothing but Goods & Sicks)
|
||||
ranking = "(GFC)";
|
||||
else if ((shits < 10 && shits != 0) && misses == 0) // Single Digit Combo Breaks
|
||||
ranking = "(SDCB)";
|
||||
else if (misses == 0 && (shits >= 10)) // Regular FC
|
||||
else if (misses == 0) // Regular FC
|
||||
ranking = "(FC)";
|
||||
else if (misses >= 10 || (shits >= 10)) // Combo Breaks
|
||||
ranking = "(CB)";
|
||||
else if (misses < 10) // Single Digit Combo Breaks
|
||||
ranking = "(SDCB)";
|
||||
else
|
||||
ranking = "(Clear)";
|
||||
|
||||
@ -1564,6 +1568,21 @@ class PlayState extends MusicBeatState
|
||||
perfectMode = false;
|
||||
#end
|
||||
|
||||
if (currentFrames == FlxG.save.data.fpsCap)
|
||||
{
|
||||
for(i in 0...notesHitArray.length)
|
||||
{
|
||||
var cock:Date = notesHitArray[i];
|
||||
if (cock != null)
|
||||
if (cock.getTime() + 2000 < Date.now().getTime())
|
||||
notesHitArray.remove(cock);
|
||||
}
|
||||
nps = Math.floor(notesHitArray.length / 2);
|
||||
currentFrames = 0;
|
||||
}
|
||||
else
|
||||
currentFrames++;
|
||||
|
||||
if (FlxG.keys.justPressed.NINE)
|
||||
{
|
||||
if (iconP1.animation.curAnim.name == 'bf-old')
|
||||
@ -1590,13 +1609,21 @@ class PlayState extends MusicBeatState
|
||||
|
||||
super.update(elapsed);
|
||||
|
||||
if (FlxG.save.data.accuracyDisplay)
|
||||
if (!SONG.song.contains('offsetTest'))
|
||||
{
|
||||
scoreTxt.text = "Score:" + (FlxG.save.data.etternaMode ? Math.max(0,etternaModeScore) + " (" + songScore + ")" : "" + songScore) + " | Combo Breaks:" + misses + " | Accuracy:" + truncateFloat(accuracy, 2) + "% | " + generateRanking();
|
||||
if (FlxG.save.data.accuracyDisplay)
|
||||
{
|
||||
scoreTxt.text = (FlxG.save.data.npsDisplay ? "NPS: " + nps + " | " : "") + "Score:" + (FlxG.save.data.etternaMode ? Math.max(0,etternaModeScore) + " (" + songScore + ")" : "" + songScore) + " | Combo Breaks:" + misses + " | Accuracy:" + truncateFloat(accuracy, 2) + "% | " + generateRanking();
|
||||
}
|
||||
else
|
||||
{
|
||||
scoreTxt.text = (FlxG.save.data.npsDisplay ? "NPS: " + nps + " | " : "") + "Score:" + songScore;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
scoreTxt.text = "Score:" + songScore;
|
||||
scoreTxt.text = "Suggested Offset: " + offsetTest;
|
||||
|
||||
}
|
||||
if (FlxG.keys.justPressed.ENTER && startedCountdown && canPause)
|
||||
{
|
||||
@ -1940,77 +1967,89 @@ class PlayState extends MusicBeatState
|
||||
#end
|
||||
}
|
||||
|
||||
if (isStoryMode)
|
||||
if (SONG.song.contains('offsetTest'))
|
||||
{
|
||||
campaignScore += Math.round(songScore);
|
||||
|
||||
storyPlaylist.remove(storyPlaylist[0]);
|
||||
|
||||
if (storyPlaylist.length <= 0)
|
||||
{
|
||||
FlxG.sound.playMusic(Paths.music('freakyMenu'));
|
||||
|
||||
transIn = FlxTransitionableState.defaultTransIn;
|
||||
transOut = FlxTransitionableState.defaultTransOut;
|
||||
|
||||
FlxG.switchState(new StoryMenuState());
|
||||
|
||||
// if ()
|
||||
StoryMenuState.weekUnlocked[Std.int(Math.min(storyWeek + 1, StoryMenuState.weekUnlocked.length - 1))] = true;
|
||||
|
||||
if (SONG.validScore)
|
||||
{
|
||||
NGio.unlockMedal(60961);
|
||||
Highscore.saveWeekScore(storyWeek, campaignScore, storyDifficulty);
|
||||
}
|
||||
|
||||
FlxG.save.data.weekUnlocked = StoryMenuState.weekUnlocked;
|
||||
FlxG.save.flush();
|
||||
}
|
||||
else
|
||||
{
|
||||
var difficulty:String = "";
|
||||
|
||||
if (storyDifficulty == 0)
|
||||
difficulty = '-easy';
|
||||
|
||||
if (storyDifficulty == 2)
|
||||
difficulty = '-hard';
|
||||
|
||||
trace('LOADING NEXT SONG');
|
||||
trace(PlayState.storyPlaylist[0].toLowerCase() + difficulty);
|
||||
|
||||
if (SONG.song.toLowerCase() == 'eggnog')
|
||||
{
|
||||
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;
|
||||
prevCamFollow = camFollow;
|
||||
|
||||
PlayState.SONG = Song.loadFromJson(PlayState.storyPlaylist[0].toLowerCase() + difficulty, PlayState.storyPlaylist[0]);
|
||||
FlxG.sound.music.stop();
|
||||
|
||||
LoadingState.loadAndSwitchState(new PlayState());
|
||||
}
|
||||
FlxG.sound.playMusic(Paths.music('freakyMenu'));
|
||||
LoadingState.loadAndSwitchState(new OptionsMenu());
|
||||
FlxG.save.data.offset = offsetTest;
|
||||
}
|
||||
else
|
||||
{
|
||||
trace('WENT BACK TO FREEPLAY??');
|
||||
FlxG.switchState(new FreeplayState());
|
||||
if (isStoryMode)
|
||||
{
|
||||
campaignScore += Math.round(songScore);
|
||||
|
||||
storyPlaylist.remove(storyPlaylist[0]);
|
||||
|
||||
if (storyPlaylist.length <= 0)
|
||||
{
|
||||
FlxG.sound.playMusic(Paths.music('freakyMenu'));
|
||||
|
||||
transIn = FlxTransitionableState.defaultTransIn;
|
||||
transOut = FlxTransitionableState.defaultTransOut;
|
||||
|
||||
FlxG.switchState(new StoryMenuState());
|
||||
|
||||
// if ()
|
||||
StoryMenuState.weekUnlocked[Std.int(Math.min(storyWeek + 1, StoryMenuState.weekUnlocked.length - 1))] = true;
|
||||
|
||||
if (SONG.validScore)
|
||||
{
|
||||
NGio.unlockMedal(60961);
|
||||
Highscore.saveWeekScore(storyWeek, campaignScore, storyDifficulty);
|
||||
}
|
||||
|
||||
FlxG.save.data.weekUnlocked = StoryMenuState.weekUnlocked;
|
||||
FlxG.save.flush();
|
||||
}
|
||||
else
|
||||
{
|
||||
var difficulty:String = "";
|
||||
|
||||
if (storyDifficulty == 0)
|
||||
difficulty = '-easy';
|
||||
|
||||
if (storyDifficulty == 2)
|
||||
difficulty = '-hard';
|
||||
|
||||
trace('LOADING NEXT SONG');
|
||||
trace(PlayState.storyPlaylist[0].toLowerCase() + difficulty);
|
||||
|
||||
if (SONG.song.toLowerCase() == 'eggnog')
|
||||
{
|
||||
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;
|
||||
prevCamFollow = camFollow;
|
||||
|
||||
PlayState.SONG = Song.loadFromJson(PlayState.storyPlaylist[0].toLowerCase() + difficulty, PlayState.storyPlaylist[0]);
|
||||
FlxG.sound.music.stop();
|
||||
|
||||
LoadingState.loadAndSwitchState(new PlayState());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
trace('WENT BACK TO FREEPLAY??');
|
||||
FlxG.switchState(new FreeplayState());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var endingSong:Bool = false;
|
||||
|
||||
var hits:Array<Float> = [];
|
||||
var offsetTest:Float = 0;
|
||||
|
||||
var timeShown = 0;
|
||||
var currentTimingShown:FlxText = null;
|
||||
|
||||
@ -2130,6 +2169,27 @@ class PlayState extends MusicBeatState
|
||||
currentTimingShown.text = msTiming + "ms";
|
||||
currentTimingShown.size = 20;
|
||||
|
||||
if (msTiming >= 0.03 && SONG.song.contains('offsetTest'))
|
||||
{
|
||||
//Remove Outliers
|
||||
hits.shift();
|
||||
hits.shift();
|
||||
hits.shift();
|
||||
hits.pop();
|
||||
hits.pop();
|
||||
hits.pop();
|
||||
hits.push(msTiming);
|
||||
|
||||
var total = 0.0;
|
||||
|
||||
for(i in hits)
|
||||
total += i;
|
||||
|
||||
|
||||
|
||||
offsetTest = truncateFloat(total / hits.length,2);
|
||||
}
|
||||
|
||||
if (currentTimingShown.alpha != 1)
|
||||
currentTimingShown.alpha = 1;
|
||||
|
||||
@ -2800,6 +2860,8 @@ class PlayState extends MusicBeatState
|
||||
}
|
||||
}
|
||||
|
||||
var nps:Int = 0;
|
||||
|
||||
function goodNoteHit(note:Note, resetMashViolation = true):Void
|
||||
{
|
||||
|
||||
@ -2814,6 +2876,9 @@ class PlayState extends MusicBeatState
|
||||
else if (noteDiff < Conductor.safeZoneOffset * 0.44 && noteDiff > Conductor.safeZoneOffset * -0.44)
|
||||
note.rating = "sick";
|
||||
|
||||
if (!note.isSustainNote)
|
||||
notesHitArray.push(Date.now());
|
||||
|
||||
if (resetMashViolation)
|
||||
mashViolations--;
|
||||
|
||||
|
@ -85,10 +85,10 @@ class Replay
|
||||
public function LoadFromJSON()
|
||||
{
|
||||
#if sys
|
||||
trace('loading ' + Sys.getCwd() + 'assets\\replays\\' + path + ' replay...');
|
||||
trace('loading ' + Sys.getCwd() + 'assets/replays/' + path + ' replay...');
|
||||
try
|
||||
{
|
||||
var repl:ReplayJSON = cast Json.parse(File.getContent(Sys.getCwd() + "assets\\replays\\" + path));
|
||||
var repl:ReplayJSON = cast Json.parse(File.getContent(Sys.getCwd() + "assets/replays/" + path));
|
||||
replay = repl;
|
||||
}
|
||||
catch(e)
|
||||
|
@ -52,8 +52,8 @@ class TitleState extends MusicBeatState
|
||||
#end
|
||||
|
||||
#if sys
|
||||
if (!sys.FileSystem.exists(Sys.getCwd() + "\\assets\\replays"))
|
||||
sys.FileSystem.createDirectory(Sys.getCwd() + "\\assets\\replays");
|
||||
if (!sys.FileSystem.exists(Sys.getCwd() + "/assets/replays"))
|
||||
sys.FileSystem.createDirectory(Sys.getCwd() + "/assets/replays");
|
||||
#end
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user