Skip to content

Commit 0d62759

Browse files
committed
its a very bad patchwork, but it works for now so I dont care
1 parent f4e3ab8 commit 0d62759

File tree

10 files changed

+79
-30
lines changed

10 files changed

+79
-30
lines changed

assets/base_game/shared/data/blazin/blazin-easy.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,7 @@
961961
"format": "psych_v1_convert",
962962
"bpm": 180,
963963
"needsVoices": false,
964-
"song": "Blazin'",
964+
"song": "Blazin",
965965
"offset": 0
966966
}
967967
}

assets/base_game/shared/data/blazin/blazin-hard.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,7 @@
979979
"format": "psych_v1_convert",
980980
"bpm": 180,
981981
"needsVoices": false,
982-
"song": "Blazin'",
982+
"song": "Blazin",
983983
"offset": 0
984984
}
985985
}

assets/base_game/shared/data/blazin/blazin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,7 @@
965965
"format": "psych_v1_convert",
966966
"bpm": 180,
967967
"needsVoices": false,
968-
"song": "Blazin'",
968+
"song": "Blazin",
969969
"offset": 0
970970
}
971971
}

source/archipelago/APEntryState.hx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,7 @@ class APEntryState extends MusicBeatState
409409
function onSlotConnected(slotData:Dynamic):Void
410410
{
411411
trace("Connected - switching to game state");
412+
gonnaRunSync = true; // You'll thank me later
412413
polltimer.stop();
413414
ap.onRoomInfo.remove(onRoomInfo);
414415
ap.onSlotRefused.remove(onSlotRefused);
@@ -443,6 +444,7 @@ class APEntryState extends MusicBeatState
443444
// if (ClientPrefs.data.deathlink)
444445
apGame.info().toggleDeathLink(deathLink);
445446

447+
APGameState.isSync = true;
446448
runArch();
447449
}
448450

@@ -655,7 +657,6 @@ class APEntryState extends MusicBeatState
655657
function runArch():Void // Soon
656658
{
657659
inArchipelagoMode = true;
658-
gonnaRunSync = true; // You'll thank me later
659660
backend.WeekData.reloadWeekFiles(false);
660661
FlxG.save.data.closeDuringOverRide = false;
661662
FlxG.save.data.manualOverride = false;

source/archipelago/APGameState.hx

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ class APGameState {
278278
}
279279

280280
public static var isSync:Bool = false;
281-
var haventranyet:Bool = true;
281+
public static var haventranyet:Bool = true;
282282
function addSongs(song:Array<NetworkItem>)
283283
{
284284
var nonSongs:Map<String, Int> = [];
@@ -390,15 +390,34 @@ class APGameState {
390390
}
391391
else
392392
{
393-
ItemIndex = nonSongs.get(items);
394-
archipelago.APItem.createItemByName(items);
393+
if (haventranyet) {
394+
if (!trapList.contains(items)) {
395+
ItemIndex = nonSongs.get(items);
396+
archipelago.APItem.createItemByName(items);
397+
}
398+
} else {
399+
ItemIndex = nonSongs.get(items);
400+
archipelago.APItem.createItemByName(items);
401+
}
395402
}
396403
}
397-
archipelago.APItem.doCheck();
404+
if (!haventranyet) {
405+
archipelago.APItem.doCheck();
406+
}
407+
//haventranyet = false;
398408
isSync = false;
399409

400410
}
401411

412+
// A bandage fix till we have enough brainpower to fix this properly
413+
var trapList:Array<String> = [
414+
"Blue Balls Curse",
415+
"Fake Transition",
416+
"SvC Effect",
417+
"Ghost Chat",
418+
"Tutorial Trap"
419+
];
420+
402421
public function isLocationMissing(location:String):Bool
403422
{
404423
for (missing in info().missingLocations)

source/archipelago/APItem.hx

Lines changed: 40 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ class APItem {
103103
this.isException = true;
104104
}
105105

106-
if (APEntryState.gonnaRunSync && this.toSync) {
106+
if (APGameState.isSync && this.toSync) {
107107
allItems.push(this); trace('Item to sync: ${this.name}');
108-
} else if (!APEntryState.gonnaRunSync) {
108+
} else if (!APGameState.isSync) {
109109
allItems.push(this); trace('Item: ${this.name}');
110110
}
111111

@@ -179,23 +179,45 @@ class APItem {
179179
}
180180

181181
public function trigger():Void {
182-
trace("Triggering item: " + this.name);
183-
trace("Is exception: " + this.isException);
184-
trace("Condition type: " + this.condition.type);
185-
trace("Condition check result: " + this.condition.checkFn());
186-
187-
if (!this.isException && this.condition.type != ConditionType.Everywhere && this.condition.checkFn()) {
188-
trace("Setting active item to: " + this.name);
189-
APItem.activeItem = this;
190-
} else {
191-
trace("Active item not set due to condition, exception rules, or being an Everywhere item.");
192-
}
182+
trace('is Gonna Run Sync: ${APGameState.isSync}');
183+
if (APGameState.isSync && !this.toSync) {
184+
trace("Triggering item: " + this.name);
185+
trace("Is exception: " + this.isException);
186+
trace("Condition type: " + this.condition.type);
187+
trace("Condition check result: " + this.condition.checkFn());
188+
189+
if (!this.isException && this.condition.type != ConditionType.Everywhere && this.condition.checkFn()) {
190+
trace("Setting active item to: " + this.name);
191+
APItem.activeItem = this;
192+
} else {
193+
trace("Active item not set due to condition, exception rules, or being an Everywhere item.");
194+
}
195+
196+
if (this.condition.checkFn()) {
197+
trace("Condition passed, executing onTrigger for item: " + this.name);
198+
onTrigger();
199+
} else {
200+
trace("Condition failed, onTrigger not executed for item: " + this.name);
201+
}
202+
} else if (!APGameState.isSync) {
203+
trace("Triggering item: " + this.name);
204+
trace("Is exception: " + this.isException);
205+
trace("Condition type: " + this.condition.type);
206+
trace("Condition check result: " + this.condition.checkFn());
207+
208+
if (!this.isException && this.condition.type != ConditionType.Everywhere && this.condition.checkFn()) {
209+
trace("Setting active item to: " + this.name);
210+
APItem.activeItem = this;
211+
} else {
212+
trace("Active item not set due to condition, exception rules, or being an Everywhere item.");
213+
}
193214

194-
if (this.condition.checkFn()) {
195-
trace("Condition passed, executing onTrigger for item: " + this.name);
196-
onTrigger();
197-
} else {
198-
trace("Condition failed, onTrigger not executed for item: " + this.name);
215+
if (this.condition.checkFn()) {
216+
trace("Condition passed, executing onTrigger for item: " + this.name);
217+
onTrigger();
218+
} else {
219+
trace("Condition failed, onTrigger not executed for item: " + this.name);
220+
}
199221
}
200222

201223
trace("Removing item from allItems: " + this.name);

source/archipelago/APPlayState.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,7 @@ effectMap = [
11231123
var content:String = sys.io.File.getContent(Paths.txt("words"));
11241124
wordList = content.toLowerCase().split("\n");
11251125
}
1126-
wordList.push(PlayState.SONG.song);
1126+
wordList.push(PlayState.SONG?.song);
11271127
trace(wordList.length + " words loaded");
11281128
trace(wordList);
11291129
validWords.resize(0);

source/archipelago/Client.hx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1405,7 +1405,6 @@ class Client {
14051405
games: gameData,
14061406
};
14071407
_dataPackage = data;
1408-
APGameState.isSync = true;
14091408
APGameState.instance.APLocations = missingLocations.concat(checkedLocations);
14101409
APGameState.instance.APItems = APGameState.instance.findSpecialItems();
14111410
return ArchPopup.startPopupCustom("The game can now be played!", "You are now connected to the server. Have fun!", "archColor");

source/states/FreeplayState.hx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class FreeplayState extends MusicBeatState
131131
Cursor.cursorMode = Default;
132132
instance = this; // For Archipelago
133133

134-
if (APEntryState.apGame != null && APEntryState.apGame.info() != null) {
134+
if (APEntryState.apGame != null && APEntryState.apGame.info() != null && APEntryState.gonnaRunSync) {
135135
APEntryState.apGame.info().Sync();
136136
APEntryState.gonnaRunSync = false;
137137

@@ -329,6 +329,9 @@ class FreeplayState extends MusicBeatState
329329
ticketCounter.setFormat(Paths.font("fnf1.ttf"), 32, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
330330
ticketCounter.scrollFactor.set();
331331
add(ticketCounter);
332+
new FlxTimer().start(1, function(tmr:FlxTimer) {
333+
archipelago.APGameState.haventranyet = false;
334+
});
332335
}
333336
}
334337

source/states/PlayState.hx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,11 @@ class PlayState extends MusicBeatState
444444

445445
override public function create()
446446
{
447+
if (SONG == null) {
448+
var songLowercase:String = Paths.formatToSongPath('tutorial');
449+
var poop:String = Highscore.formatSong(songLowercase, storyDifficulty);
450+
Song.loadFromJson(poop, songLowercase);
451+
}
447452
inArchipelagoMode = archipelago.APEntryState.inArchipelagoMode;
448453
if (inArchipelagoMode && !(this is archipelago.APPlayState))
449454
{
@@ -1964,7 +1969,7 @@ class PlayState extends MusicBeatState
19641969

19651970
private var noteTypes:Array<String> = [];
19661971
private var eventsPushed:Array<String> = [];
1967-
private var totalColumns:Int = Note.ammo[SONG.mania != null ? SONG.mania : mania];
1972+
private var totalColumns:Int = Note.ammo[SONG?.mania != null ? SONG?.mania : mania];
19681973
var prevNoteData:Int = -1;
19691974
var initialNoteData:Int = -1;
19701975
var caseExecutionCount:Int = FlxG.random.int(-50, 50);

0 commit comments

Comments
 (0)