Skip to content

Commit 6c47240

Browse files
committed
man I love bugs
especially when they BREAK EVERYTHING
1 parent 55aa633 commit 6c47240

24 files changed

+2535
-275
lines changed

source/archipelago/APPlayState.hx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,7 +1154,7 @@ effectMap = [
11541154
trace(validWords.length + " words accepted");
11551155
trace(validWords);
11561156
controlButtons.resize(0);
1157-
for (thing in [
1157+
/*for (thing in [
11581158
ClientPrefs.keyBinds.get('note_left').copy().toString(),
11591159
ClientPrefs.keyBinds.get('note_down').copy().toString(),
11601160
ClientPrefs.keyBinds.get('note_up').copy().toString(),
@@ -1170,7 +1170,7 @@ effectMap = [
11701170
])
11711171
{
11721172
controlButtons.push(StringTools.trim(thing).toLowerCase());
1173-
}
1173+
}*/
11741174

11751175
if (FlxG.save.data.activeItems == null)
11761176
{
@@ -2353,7 +2353,7 @@ public function doEffect(effect:String)
23532353
if (note.isSustainNote && !note.animation.curAnim.name.endsWith('tail'))
23542354
time += 0.15;
23552355

2356-
strumPlayAnim(false, Std.int(Math.abs(note.noteData)) % Note.ammo[PlayState.mania], time, /*note*/);
2356+
strumPlayAnim(field, note.column % field.keyCount, time, /*note*/);
23572357
}
23582358
else
23592359
{

source/archipelago/Client.hx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,8 @@ class Client {
403403
public var _hOnThrow(null, default):(String, Dynamic) -> Void = (_, _) -> {};
404404
#end
405405

406+
public var dontTryToReconnect:Bool = false;
407+
406408
/**
407409
Creates a new instance of the Archipelago client.
408410
@param uuid The unique ID for this client. Deprecated, and likely to be removed in a later version.
@@ -1050,8 +1052,8 @@ class Client {
10501052
_hOnThrow("poll", new Exception("Connect timed out"));
10511053
trace("Connect timed out. Retrying.");
10521054
} else
1053-
trace("Reconnecting to server");
1054-
connect_socket();
1055+
if (!dontTryToReconnect) trace("Reconnecting to server");
1056+
if (!dontTryToReconnect) connect_socket();
10551057
}
10561058
}
10571059
}
@@ -1599,6 +1601,7 @@ class Client {
15991601

16001602
/** Creates a new websocket client and connects to the server. **/
16011603
private function connect_socket() {
1604+
dontTryToReconnect = false;
16021605
if (_ws != null)
16031606
_ws.close();
16041607
if (uri.length == 0) {
@@ -1636,6 +1639,7 @@ class Client {
16361639
if (_ws != null) {
16371640
_ws.close();
16381641
state = State.DISCONNECTED;
1642+
dontTryToReconnect = true;
16391643
}
16401644
}
16411645

source/backend/Song.hx

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,49 @@ class Song
7070
public var gfVersion:String = 'gf';
7171
public var format:String = 'psych_v1';
7272

73+
private static function convertMixtape(songJson:Dynamic) // Convert old charts to mixtape format
74+
{
75+
if(songJson.gfVersion == null)
76+
{
77+
songJson.gfVersion = songJson.player3;
78+
songJson.player3 = null;
79+
}
80+
81+
if(songJson.events == null)
82+
{
83+
songJson.events = [];
84+
for (secNum in 0...songJson.notes.length)
85+
{
86+
var sec:SwagSection = songJson.notes[secNum];
87+
88+
var i:Int = 0;
89+
var notes:Array<Dynamic> = sec.sectionNotes;
90+
var len:Int = notes.length;
91+
while(i < len)
92+
{
93+
var note:Array<Dynamic> = notes[i];
94+
if(note[1] < 0)
95+
{
96+
songJson.events.push([note[0], [[note[2], note[3], note[4]]]]);
97+
notes.remove(note);
98+
len = notes.length;
99+
}
100+
else i++;
101+
}
102+
}
103+
}
104+
if (songJson.mania == null)
105+
{
106+
songJson.mania = Note.defaultMania;
107+
//trace("Song mania value is NULL, set to " + Note.defaultMania);
108+
}
109+
if (songJson.startMania == null)
110+
{
111+
songJson.startMania = Note.defaultMania;
112+
//trace("Song mania value is NULL, set to " + Note.defaultMania);
113+
}
114+
}
115+
73116
public static function convert(songJson:Dynamic) // Convert old charts to psych_v1 format
74117
{
75118
if(songJson.gfVersion == null)
@@ -181,6 +224,14 @@ class Song
181224
songJson.format = 'psych_v1_convert';
182225
convert(songJson);
183226
}
227+
228+
case 'mixtape_v1':
229+
if(!fmt.startsWith('mixtape_v1')) //Convert to Mixtape 1.0 format
230+
{
231+
trace('converting chart $nameForError with format $fmt to Mixtape_v1 format...');
232+
songJson.format = 'mixtape_v1_convert';
233+
convertMixtape(songJson);
234+
}
184235
}
185236
}
186237
return songJson;

source/backend/modchart/ModManager.hx

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
package backend.modchart;
22
// @author Nebula_Zorua
33

4+
import objects.StrumNote;
45
import objects.playfields.NoteField;
56
import backend.modchart.Modifier;
67
import backend.modchart.modifiers.*;
8+
import backend.modchart.modifiers.extra.*;
79
import backend.modchart.events.*;
810
import backend.math.Vector3;
911
import flixel.tweens.FlxEase;
@@ -88,6 +90,7 @@ class ModManager {
8890
ConfusionModifier,
8991
OpponentModifier,
9092
TransformModifier,
93+
//PsychTransformModifier,
9194
InfinitePathModifier,
9295
PathModifier,
9396
AccelModifier,
@@ -542,34 +545,26 @@ class ModManager {
542545
}
543546

544547
public function updateObject(beat:Float, obj:NoteObject, player:Int){
545-
if (obj != null && obj.active) {
546-
for (name in getActiveMods(player))
547-
{
548-
/*if (!obj.active)
549-
continue;*/
548+
if (obj.active)
549+
for (name in getActiveMods(player))
550+
{
551+
/*if (!obj.active)
552+
continue;*/
550553

551-
var mod:Modifier = notemodRegister.get(name);
552-
if (mod==null) continue;
553-
554-
if(obj.objType == NOTE){
555-
if (mod.ignoreUpdateNote()) continue;
556-
mod.updateNote(beat, cast obj, player);
557-
}
558-
else if(obj.objType == STRUM){
559-
if (mod.ignoreUpdateReceptor()) continue;
560-
mod.updateReceptor(beat, cast obj, player);
561-
}
554+
var mod:Modifier = notemodRegister.get(name);
555+
if (mod==null) continue;
556+
557+
if(obj.objType == NOTE){
558+
if (mod.ignoreUpdateNote()) continue;
559+
mod.updateNote(beat, cast obj, player);
560+
}
561+
else if(obj.objType == STRUM){
562+
if (mod.ignoreUpdateReceptor()) continue;
563+
mod.updateReceptor(beat, cast obj, player);
562564
}
563-
564-
try {
565-
if (obj.objType == NOTE) {
566-
obj.updateHitbox();
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!");}
572565
}
566+
567+
obj.updateHitbox();
573568
}
574569

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

source/backend/modchart/Modifier.hx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,10 @@ class Modifier {
191191
inline public function setOtherValue(modName:String, endValue:Float, player:Int)
192192
return modMgr.setValue(modName, endValue, player);
193193

194+
public function getDefaultValues():Null<Map<String, Float>>{
195+
return null;
196+
}
197+
194198
public function new(modMgr:ModManager, ?parent:Modifier)
195199
{
196200
this.modMgr = modMgr;

source/backend/modchart/modifiers/InfinitePathModifier.hx

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)