Skip to content

Commit c4c6a2c

Browse files
committed
WOHO FINALLY (mostly) WORKING SUSTAINS FOR REAL THIS TIME WOOOOOOOOOOOOOOOOOOOOOO
oh, and maina mode too is kinda cool ig
1 parent f2a3746 commit c4c6a2c

24 files changed

+5729
-310
lines changed
17.1 KB
Loading
38.7 KB
Loading
1.57 MB
Loading

source/backend/ClientPrefs.hx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ import states.TitleState;
105105
'loopModeC' => false,
106106
'loopPlayMult' => 1.05,
107107
'bothMode' => false,
108+
'maniaMode' => false,
108109
];
109110

110111
// public var inputSystem:String = 'Native';
@@ -147,6 +148,8 @@ import states.TitleState;
147148
public var deathlink:Bool = false;
148149
public var stageGimmick:Bool = false;
149150
public var healthMode:String = 'Mixtape';
151+
public var iconBounce:String = 'Mixtape';
152+
public var pauseBPM:Int = 102;
150153
}
151154

152155
class ClientPrefs {

source/backend/Song.hx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ typedef SwagSong =
1717

1818
var player1:String;
1919
var player2:String;
20+
var player4:String;
21+
var player5:String;
2022
var gfVersion:String;
2123
var stage:String;
2224
var format:String;
2325

24-
var mania:Int;
25-
var startMania:Int;
26+
var mania:Null<Int>;
27+
var startMania:Null<Int>;
2628

2729
@:optional var gameOverChar:String;
2830
@:optional var gameOverSound:String;
@@ -42,6 +44,7 @@ typedef SwagSection =
4244
var mustHitSection:Bool;
4345
@:optional var altAnim:Bool;
4446
@:optional var gfSection:Bool;
47+
@:optional var exSection:Bool;
4548
@:optional var bpm:Float;
4649
@:optional var changeBPM:Bool;
4750
}

source/backend/modchart/ModManager.hx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -561,12 +561,14 @@ class ModManager {
561561
}
562562
}
563563

564-
obj.updateHitbox();
565-
if (obj.objType == NOTE) {
566-
var cum:Note = cast obj;
567-
cum.offset.x += cum.typeOffsetX;
568-
cum.offset.y += cum.typeOffsetY;
569-
}
564+
try {
565+
obj.updateHitbox();
566+
if (obj.objType == NOTE) {
567+
var cum:Note = cast obj;
568+
cum.offset.x += cum.typeOffsetX;
569+
cum.offset.y += cum.typeOffsetY;
570+
}
571+
} catch(e) {trace("Something went wrong trying to update this note!");}
570572
}
571573

572574
public inline function getBaseVisPosD(diff:Float, songSpeed:Float = 1)

source/metadata/STMetaFile.hx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package metadata;
2+
3+
typedef MetadataFile = {
4+
var song:SongMetaSection;
5+
}
6+
7+
typedef SongMetaSection = {
8+
var name:String;
9+
var artist:String;
10+
var charter:String;
11+
var mod:String;
12+
}

source/objects/Note.hx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -861,14 +861,11 @@ class Note extends NoteObject
861861

862862
mania = PlayState.mania;
863863

864-
if (hitByOpponent)
865-
wasGoodHit = true;
866-
var diff = (strumTime - Conductor.songPosition);
867-
if (diff < -Conductor.safeZoneOffset && !wasGoodHit)
868-
tooLate = true;
869-
870-
if (hitByOpponent)
871-
wasGoodHit = true;
864+
if (hitByOpponent) wasGoodHit = true;
865+
866+
var diff = (strumTime - Conductor.songPosition);
867+
if (diff < -Conductor.safeZoneOffset && !wasGoodHit)
868+
tooLate = true;
872869

873870
if (tooLate && !inEditor)
874871
{

source/objects/playfields/NoteField.hx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,11 @@ class NoteField extends FieldBase
347347
var crotchet:Float = Conductor.getCrotchetAtTime(0.0) / 4.0;
348348
function drawHold(hold:Note, ?prevAlpha:Float, ?prevGlow:Float):Null<RenderObject>
349349
{
350-
if (hold.animation.curAnim == null || hold.scale == null || hold.frame == null)
350+
try {if (hold.animation.curAnim == null || hold.scale == null || hold.frame == null) return null;}
351+
catch(e) {
352+
trace("Note was null!");
351353
return null;
354+
}
352355

353356
var render:Bool = false;
354357
for (camera in cameras) {

source/objects/playfields/PlayField.hx

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ import backend.Rating;
1818
import objects.Character;
1919
import objects.NoteSplash;
2020
import flixel.FlxBasic;
21+
import objects.NoteObject;
22+
import objects.Note.SustainPart;
2123

2224
/*
2325
The system is seperated into 3 classes:
@@ -323,6 +325,21 @@ class PlayField extends FlxTypedGroup<FlxBasic>
323325
{
324326
case "Native":
325327
if(data > keyCount || data < 0)return null;
328+
329+
var noteList = getNotesWithEnd(data, Conductor.songPosition + ClientPrefs.data.badWindow, (note:Note) -> !note.tooLate);
330+
#if PE_MOD_COMPATIBILITY
331+
noteList.sort((a, b) -> Std.int((b.strumTime + (b.lowPriority ? 10000 : 0)) - (a.strumTime + (a.lowPriority ? 10000 : 0)))); // so lowPriority actually works (even though i hate it lol!)
332+
#else
333+
noteList.sort((a, b) -> Std.int(b.strumTime - a.strumTime)); //so lowPriority actually works (even though i hate it lol!)
334+
#end
335+
while (noteList.length > 0)
336+
{
337+
var note:Note = noteList.pop();
338+
if (!note.blockHit) noteHitCallback(note, this);
339+
return note;
340+
}
341+
case "Native-old":
342+
if(data > keyCount || data < 0)return null;
326343

327344
var noteList = getNotesWithEnd(data, Conductor.songPosition + ClientPrefs.data.badWindow, (note:Note) -> note.requiresTap);
328345
#if PE_MOD_COMPATIBILITY
@@ -666,7 +683,7 @@ class PlayField extends FlxTypedGroup<FlxBasic>
666683
PlayState.instance.mashViolations++;
667684
}
668685

669-
case "Andromeda Engine (legacy)":
686+
case "Andromeda (legacy)":
670687
var noteList = getNotesWithEnd(data, Conductor.songPosition + ClientPrefs.data.badWindow, (note:Note) -> !note.isSustainNote && note.requiresTap);
671688
noteList.sort((a,b)->Std.int(a.strumTime-b.strumTime)); // SHOULD be in order?
672689
// But just incase, we do this sort
@@ -882,13 +899,14 @@ class PlayField extends FlxTypedGroup<FlxBasic>
882899
modManager.updateObject(curDecBeat, daNote, modNumber);
883900

884901
// check for hold inputs
885-
if(daNote.isSustainNote){
902+
if(!daNote.isSustainNote){
886903
if(daNote.column > keyCount-1){
887904
garbage.push(daNote);
888905
continue;
889906
}
890907
if(daNote.holdingTime < daNote.sustainLength && inControl && !daNote.blockHit){
891908
if(!daNote.tooLate && daNote.wasGoodHit){
909+
trace("hitting tail hold");
892910
var isHeld:Bool = autoPlayed || keysPressed[daNote.column];
893911
var wasHeld:Bool = daNote.isHeld;
894912
daNote.isHeld = isHeld;
@@ -907,9 +925,7 @@ class PlayField extends FlxTypedGroup<FlxBasic>
907925
var receptor = strumNotes[daNote.column];
908926
var oldSteps:Int = Math.floor(daNote.holdingTime / Conductor.stepCrochet);
909927
var lastTime:Float = daNote.holdingTime;
910-
daNote.holdingTime = daNote.sustainLength;
911-
if (daNote.holdingTime > daNote.sustainLength)
912-
daNote.holdingTime = daNote.sustainLength;
928+
daNote.holdingTime = Conductor.songPosition - daNote.strumTime + 120;
913929
var currentSteps:Int = Math.floor(daNote.holdingTime / Conductor.stepCrochet);
914930
if(oldSteps < currentSteps)
915931
if(holdStepCallback != null)
@@ -923,7 +939,7 @@ class PlayField extends FlxTypedGroup<FlxBasic>
923939

924940
daNote.tripProgress = 1.0;
925941
}else
926-
daNote.tripProgress -= elapsed / (daNote.maxReleaseTime);
942+
daNote.tripProgress -= elapsed / (daNote.maxReleaseTime * 1);
927943

928944
// if rolls are ever implemented, uncomment this
929945
/*if(autoPlayed && daNote.tripProgress <= 0.5)
@@ -966,6 +982,19 @@ class PlayField extends FlxTypedGroup<FlxBasic>
966982
}
967983
}
968984
}
985+
986+
//kade is just evil lmao
987+
if (daNote.isParent && daNote.tooLate && !daNote.isSustainNote)
988+
{
989+
PlayState.instance.health -= 0.15; // give a health punishment for failing a LN
990+
trace("hold fell over at the start");
991+
for (i in daNote.childs)
992+
{
993+
i.alpha = 0.3;
994+
i.susActive = false;
995+
}
996+
}
997+
969998
// check for note deletion
970999
if (daNote.garbage)
9711000
garbage.push(daNote);
@@ -1027,7 +1056,7 @@ class PlayField extends FlxTypedGroup<FlxBasic>
10271056
}else{
10281057
for(data in 0...keyCount){
10291058
if (keysPressed[data]){
1030-
var noteList = getNotesWithEnd(data, Conductor.songPosition);
1059+
var noteList = getNotesWithEnd(data, Conductor.songPosition, (note:Note) -> note.isSustainNote && note.prevNote != null);
10311060
#if PE_MOD_COMPATIBILITY
10321061
// so lowPriority actually works (even though i hate it lol!)
10331062
noteList.sort((a, b) -> Std.int((b.strumTime + (b.lowPriority ? 10000 : 0)) - (a.strumTime + (a.lowPriority ? 10000 : 0))));
@@ -1038,7 +1067,6 @@ class PlayField extends FlxTypedGroup<FlxBasic>
10381067
{
10391068
var note:Note = noteList.pop();
10401069
noteHitCallback(note, this);
1041-
if (!note.isSustainNote) keysPressed[data] = false;
10421070
}
10431071
}
10441072
}

0 commit comments

Comments
 (0)