@@ -201,78 +201,78 @@ class RankingSubstate extends MusicBeatSubstate
201201 var locationIdInts = APEntryState .apGame .locationData (locationId .trim ());
202202 trace (' Location IDs: ' + locationIdInts );
203203
204- if (comboRankLimit <= comboRankSetLimit && accRankLimit <= accRankSetLimit ) {
205- if (locationIdInts == null || locationIdInts .length == 0 || locationIdInts .indexOf (0 ) != - 1 )
204+ // if (comboRankLimit <= comboRankSetLimit && accRankLimit <= accRankSetLimit) {
205+ if (locationIdInts == null || locationIdInts .length == 0 || locationIdInts .indexOf (0 ) != - 1 )
206+ {
207+ for (song in WeekData .getCurrentWeek ().songs )
206208 {
207- for (song in WeekData .getCurrentWeek ().songs )
209+ if ((cast song [0 ] : String ).toLowerCase ().trim () == PlayState .SONG .song .trim ().toLowerCase () ||
210+ (cast song [0 ] : String ).toLowerCase ().trim ().replace (" " , " -" ) == PlayState .SONG .song .trim ().toLowerCase ().replace (" " , " -" ))
208211 {
209- if ((cast song [0 ] : String ).toLowerCase ().trim () == PlayState .SONG .song .trim ().toLowerCase () ||
210- (cast song [0 ] : String ).toLowerCase ().trim ().replace (" " , " -" ) == PlayState .SONG .song .trim ().toLowerCase ().replace (" " , " -" ))
211- {
212- locationId = archipelago. APPlayState .currentMod .trim () != " "
213- ? song [0 ] + " (" + archipelago. APPlayState .currentMod + " )"
214- : song [0 ];
215- locationIdInts = APEntryState .apGame .locationData (locationId .trim ());
216- break ;
217- }
212+ locationId = archipelago. APPlayState .currentMod .trim () != " "
213+ ? song [0 ] + " (" + archipelago. APPlayState .currentMod + " )"
214+ : song [0 ];
215+ locationIdInts = APEntryState .apGame .locationData (locationId .trim ());
216+ break ;
218217 }
219218 }
219+ }
220220
221- if (locationIdInts == null || locationIdInts .length == 0 || locationIdInts .indexOf (0 ) != - 1 )
221+ if (locationIdInts == null || locationIdInts .length == 0 || locationIdInts .indexOf (0 ) != - 1 )
222+ {
223+ for (song in WeekData .getCurrentWeek ().songs )
222224 {
223- for (song in WeekData .getCurrentWeek ().songs )
225+ var songPath = archipelago. APPlayState .currentMod .trim () != " "
226+ ? " mods/" + archipelago. APPlayState .currentMod + " /data/" + song [0 ] + " /" + song [0 ] + " -" + Difficulty .getString (PlayState .storyDifficulty ) + " .json"
227+ : " assets/shared" + (song [0 ] + Difficulty .getFilePath ());
228+ var songJson : SwagSong = null ;
229+ var jsonStuff : Array <String > = archipelago. APPlayState .currentMod .trim () != " "
230+ ? Paths .crawlDirectoryOG (" mods/" + archipelago. APPlayState .currentMod + " /data" , " .json" )
231+ : Paths .crawlDirectoryOG (" assets/shared/data" , " .json" ); // I'm an idiot for not realizing this bug sooner. - Yuta
232+
233+ for (json in jsonStuff )
224234 {
225- var songPath = archipelago. APPlayState .currentMod .trim () != " "
226- ? " mods/" + archipelago. APPlayState .currentMod + " /data/" + song [0 ] + " /" + song [0 ] + " -" + Difficulty .getString (PlayState .storyDifficulty ) + " .json"
227- : " assets/shared" + (song [0 ] + Difficulty .getFilePath ());
228- var songJson : SwagSong = null ;
229- var jsonStuff : Array <String > = archipelago. APPlayState .currentMod .trim () != " "
230- ? Paths .crawlDirectoryOG (" mods/" + archipelago. APPlayState .currentMod + " /data" , " .json" )
231- : Paths .crawlDirectoryOG (" assets/shared/data" , " .json" ); // I'm an idiot for not realizing this bug sooner. - Yuta
232-
233- for (json in jsonStuff )
235+ if (json .trim ().toLowerCase ().replace (" " , " -" ) == songPath .trim ().toLowerCase ().replace (" " , " -" ))
234236 {
235- if (json .trim ().toLowerCase ().replace (" " , " -" ) == songPath .trim ().toLowerCase ().replace (" " , " -" ))
237+ songJson = Song .parseJSON (File .getContent (json ));
238+ if (songJson != null )
236239 {
237- songJson = Song .parseJSON (File .getContent (json ));
238- if (songJson != null )
240+ if (songJson .song .trim ().toLowerCase ().replace (" " , " -" ) == PlayState .SONG .song .trim ().toLowerCase ().replace (" " , " -" ))
239241 {
240- if (songJson .song .trim ().toLowerCase ().replace (" " , " -" ) == PlayState .SONG .song .trim ().toLowerCase ().replace (" " , " -" ))
241- {
242- locationId = archipelago. APPlayState .currentMod .trim () != " "
243- ? song [0 ] + " (" + archipelago. APPlayState .currentMod + " )"
244- : song [0 ];
245- locationIdInts = APEntryState .apGame .locationData (locationId .trim ());
246- break ;
247- }
242+ locationId = archipelago. APPlayState .currentMod .trim () != " "
243+ ? song [0 ] + " (" + archipelago. APPlayState .currentMod + " )"
244+ : song [0 ];
245+ locationIdInts = APEntryState .apGame .locationData (locationId .trim ());
246+ break ;
248247 }
249- }
250- }
248+ }
249+ }
251250 }
252251 }
253-
254- for (locationIdInt in locationIdInts )
255- {
256- trace (APEntryState .apGame .info ().LocationChecks ([locationIdInt ]));
257- trace (APEntryState .apGame .info ().get_location_name (locationIdInt ));
258- }
259- trace (PlayState .SONG .song );
252+ }
253+
254+ for (locationIdInt in locationIdInts )
255+ {
256+ trace (APEntryState .apGame .info ().LocationChecks ([locationIdInt ]));
257+ trace (APEntryState .apGame .info ().get_location_name (locationIdInt ));
258+ }
259+ trace (PlayState .SONG .song );
260260
261- archipelago. ArchPopup .startPopupCustom (" You've sent " + APEntryState .apGame .info ().get_location_name (locationIdInts [0 ]) + " to Archipelago!" , " Good Job!" , " archColor" , function () {
262- FlxG .sound .playMusic (Paths .sound (' secret' ));
263- });
261+ archipelago. ArchPopup .startPopupCustom (" You've sent " + APEntryState .apGame .info ().get_location_name (locationIdInts [0 ]) + " to Archipelago!" , " Good Job!" , " archColor" , function () {
262+ FlxG .sound .playMusic (Paths .sound (' secret' ));
263+ });
264264
265- for (locationIdInt in locationIdInts )
265+ for (locationIdInt in locationIdInts )
266+ {
267+ if (locationIdInt != 0 && states. FreeplayState .isVictorySong (PlayState .SONG .song , archipelago. APPlayState .currentMod ))
266268 {
267- if (locationIdInt != 0 && states. FreeplayState .isVictorySong (PlayState .SONG .song , archipelago. APPlayState .currentMod ))
268- {
269- archipelago. ArchPopup .startPopupCustom (" You've completed your goal!" , " You win!" , " archipelago" , function () {
270- FlxG .sound .playMusic (Paths .sound (' secret' ));
271- });
272- APEntryState .apGame .info ().set_goal ();
273- }
269+ archipelago. ArchPopup .startPopupCustom (" You've completed your goal!" , " You win!" , " archipelago" , function () {
270+ FlxG .sound .playMusic (Paths .sound (' secret' ));
271+ });
272+ APEntryState .apGame .info ().set_goal ();
274273 }
275274 }
275+ // }
276276 Mods .loadTopMod ();
277277 }
278278 }
0 commit comments