@@ -8,10 +8,8 @@ import backend.Song;
88import objects .HealthIcon ;
99import objects .MusicPlayer ;
1010
11- import archipelago .ArchPopup ;
12- import archipelago .APEntryState ;
13- import archipelago .APInfo ;
14-
11+ import archipelago .* ;
12+ import archipelago .PacketTypes .ClientStatus ;
1513// import states.editors.ChartingStateOG;
1614
1715import flixel .addons .ui .FlxUIInputText ;
@@ -25,7 +23,6 @@ import flixel.ui.FlxButton;
2523import flixel .input .keyboard .FlxKey ;
2624import flixel .util .FlxDestroyUtil ;
2725import haxe .Json ;
28- import archipelago .PacketTypes .ClientStatus ;
2926import yutautil .ChanceSelector ;
3027import yutautil .ChanceSelector .Chance ;
3128
@@ -102,6 +99,9 @@ class FreeplayState extends MusicBeatState
10299 var listChoices : Array <String > = [];
103100 var multiSongs : Array <String > = [];
104101
102+ public static var lastSongPlayed : String = " " ;
103+ public static var lastModPlayed : String = " " ;
104+
105105 public static var curUnlocked : Map <String , String > = new Map <String , String >();
106106 public static var curMissing : Map <String , String > = new Map <String , String >();
107107 public static var trueMissing : Array <String > = [];
@@ -134,19 +134,12 @@ class FreeplayState extends MusicBeatState
134134 if (APEntryState .apGame != null && APEntryState .apGame .info () != null && APEntryState .gonnaRunSync ) {
135135 APEntryState .apGame .info ().Sync ();
136136 APEntryState .gonnaRunSync = false ;
137+ APPlayState .deathByBlueBalls = false ;
138+ }
137139
138- function getLastParenthesesContent (input : String ): String {
139- var lastParenIndex = input .lastIndexOf (" (" );
140- if (lastParenIndex != - 1 ) {
141- var endIndex = input .indexOf (" )" , lastParenIndex );
142- if (endIndex != - 1 ) {
143- return input .substring (lastParenIndex + 1 , endIndex );
144- }
145- }
146- return " " ;
147- }
148-
149- if (curUnlocked .exists (APEntryState .victorySong .trim ().toLowerCase ().replace (' -' , ' ' )) && callVictory )
140+ if (APEntryState .inArchipelagoMode ) {
141+ trace (' Last song: $lastSongPlayed \n From Mod: $lastModPlayed \n Is victory: ${isVictorySong (lastSongPlayed , lastModPlayed )}' );
142+ if (isVictorySong (lastSongPlayed , lastModPlayed ))
150143 {
151144 trace (" GOAL COMPLETE" );
152145 callVictory = false ;
@@ -590,44 +583,52 @@ class FreeplayState extends MusicBeatState
590583 {
591584 if (refresh )
592585 {
593- for (songName in (CategoryState .loadWeekForce == " unplayed" ? curMissing : curUnlocked ).keys ()) {
594- if (songName .trim ().toLowerCase ().replace (' -' , ' ' ) == ' small argument' .trim ().toLowerCase ().replace (' -' , ' ' ) && (CategoryState .loadWeekForce == " unplayed" ? curMissing : curUnlocked ).get (songName ) == ' ' )
595- addSong (' Small Argument' , 0 , " gfchibi" , FlxColor .fromRGB (235 , 100 , 161 ));
596- if (songName .trim ().toLowerCase ().replace (' -' , ' ' ) == ' beat battle' .trim ().toLowerCase ().replace (' -' , ' ' ) && (CategoryState .loadWeekForce == " unplayed" ? curMissing : curUnlocked ).get (songName ) == ' ' )
597- addSong (' Beat Battle' , 0 , " gf" , FlxColor .fromRGB (165 , 0 , 77 ));
598- if (songName .trim ().toLowerCase ().replace (' -' , ' ' ) == ' beat battle 2' .trim ().toLowerCase ().replace (' -' , ' ' ) && (CategoryState .loadWeekForce == " unplayed" ? curMissing : curUnlocked ).get (songName ) == ' ' )
599- addSong (' Beat Battle 2' , 0 , " gf" , FlxColor .fromRGB (165 , 0 , 77 ));
586+ if (CategoryState .loadWeekForce == " all" ){
587+ // Add them to Wekk 7 so they're below that week
588+ addSong (' Small Argument' , 7 , " gfchibi" , FlxColor .fromRGB (235 , 100 , 161 ));
589+ addSong (' Beat Battle' , 7 , " gf" , FlxColor .fromRGB (165 , 0 , 77 ));
590+ addSong (' Beat Battle 2' , 7 , " gf" , FlxColor .fromRGB (165 , 0 , 77 ));
591+ }
592+ else {
593+ for (songName in curUnlocked .keys ()) {
594+ if (songName .trim ().toLowerCase ().replace (' -' , ' ' ) == ' small argument' .trim ().toLowerCase ().replace (' -' , ' ' ) && curUnlocked .get (songName ) == ' ' )
595+ addSong (' Small Argument' , 7 , " gfchibi" , FlxColor .fromRGB (235 , 100 , 161 ));
596+ if (songName .trim ().toLowerCase ().replace (' -' , ' ' ) == ' beat battle' .trim ().toLowerCase ().replace (' -' , ' ' ) && curUnlocked .get (songName ) == ' ' )
597+ addSong (' Beat Battle' , 7 , " gf" , FlxColor .fromRGB (165 , 0 , 77 ));
598+ if (songName .trim ().toLowerCase ().replace (' -' , ' ' ) == ' beat battle 2' .trim ().toLowerCase ().replace (' -' , ' ' ) && curUnlocked .get (songName ) == ' ' )
599+ addSong (' Beat Battle 2' , 7 , " gf" , FlxColor .fromRGB (165 , 0 , 77 ));
600+ }
600601 }
601602 }
602603 else
603604 {
604- if (( CategoryState . loadWeekForce == " unplayed " ? curMissing : curUnlocked ) .exists (' Small Argument' .toLowerCase ()) && Std .string (' Small Argument' ).toLowerCase ().trim ().contains (searchBar .text .toLowerCase ().trim ()) && FlxG . save . data . gotIntoAnArgument && (CategoryState .loadWeekForce == " secrets" || CategoryState .loadWeekForce == " all" ))
605- addSong (' Small Argument' , 0 , " gfchibi" , FlxColor .fromRGB (235 , 100 , 161 ));
606- if (( CategoryState . loadWeekForce == " unplayed " ? curMissing : curUnlocked ) .exists (' Beat Battle' .toLowerCase ()) && Std .string (' Beat Battle' ).toLowerCase ().trim ().contains (searchBar .text .toLowerCase ().trim ()) && FlxG . save . data . gotbeatbattle && (CategoryState .loadWeekForce == " secrets" || CategoryState .loadWeekForce == " all" ))
607- addSong (' Beat Battle' , 0 , " gf" , FlxColor .fromRGB (165 , 0 , 77 ));
608- if (( CategoryState . loadWeekForce == " unplayed " ? curMissing : curUnlocked ) .exists (' Beat Battle 2' .toLowerCase ()) && Std .string (' Beat Battle 2' ).toLowerCase ().trim ().contains (searchBar .text .toLowerCase ().trim ()) && FlxG . save . data . gotbeatbattle2 && (CategoryState .loadWeekForce == " secrets" || CategoryState .loadWeekForce == " all" ))
609- addSong (' Beat Battle 2' , 0 , " gf" , FlxColor .fromRGB (165 , 0 , 77 ));
605+ if (curUnlocked .exists (' Small Argument' .toLowerCase ()) && Std .string (' Small Argument' ).toLowerCase ().trim ().contains (searchBar .text .toLowerCase ().trim ()) && (CategoryState .loadWeekForce == " secrets" || CategoryState .loadWeekForce == " all" ))
606+ addSong (' Small Argument' , 7 , " gfchibi" , FlxColor .fromRGB (235 , 100 , 161 ));
607+ if (curUnlocked .exists (' Beat Battle' .toLowerCase ()) && Std .string (' Beat Battle' ).toLowerCase ().trim ().contains (searchBar .text .toLowerCase ().trim ()) && (CategoryState .loadWeekForce == " secrets" || CategoryState .loadWeekForce == " all" ))
608+ addSong (' Beat Battle' , 7 , " gf" , FlxColor .fromRGB (165 , 0 , 77 ));
609+ if (curUnlocked .exists (' Beat Battle 2' .toLowerCase ()) && Std .string (' Beat Battle 2' ).toLowerCase ().trim ().contains (searchBar .text .toLowerCase ().trim ()) && (CategoryState .loadWeekForce == " secrets" || CategoryState .loadWeekForce == " all" ))
610+ addSong (' Beat Battle 2' , 7 , " gf" , FlxColor .fromRGB (165 , 0 , 77 ));
610611 }
611612 }
612613 else
613614 {
614615 if (refresh )
615616 {
616617 if (FlxG .save .data .gotIntoAnArgument && (CategoryState .loadWeekForce == " secrets" || CategoryState .loadWeekForce == " all" ))
617- addSong (' Small Argument' , 0 , " gfchibi" , FlxColor .fromRGB (235 , 100 , 161 ));
618+ addSong (' Small Argument' , 7 , " gfchibi" , FlxColor .fromRGB (235 , 100 , 161 ));
618619 if (FlxG .save .data .gotbeatbattle && (CategoryState .loadWeekForce == " secrets" || CategoryState .loadWeekForce == " all" ))
619- addSong (' Beat Battle' , 0 , " gf" , FlxColor .fromRGB (165 , 0 , 77 ));
620+ addSong (' Beat Battle' , 7 , " gf" , FlxColor .fromRGB (165 , 0 , 77 ));
620621 if (FlxG .save .data .gotbeatbattle2 && (CategoryState .loadWeekForce == " secrets" || CategoryState .loadWeekForce == " all" ))
621- addSong (' Beat Battle 2' , 0 , " gf" , FlxColor .fromRGB (165 , 0 , 77 ));
622+ addSong (' Beat Battle 2' , 7 , " gf" , FlxColor .fromRGB (165 , 0 , 77 ));
622623 }
623624 else
624625 {
625626 if (Std .string (' Small Argument' ).toLowerCase ().trim ().contains (searchBar .text .toLowerCase ().trim ()) && FlxG .save .data .gotIntoAnArgument && (CategoryState .loadWeekForce == " secrets" || CategoryState .loadWeekForce == " all" ))
626- addSong (' Small Argument' , 0 , " gfchibi" , FlxColor .fromRGB (235 , 100 , 161 ));
627+ addSong (' Small Argument' , 7 , " gfchibi" , FlxColor .fromRGB (235 , 100 , 161 ));
627628 if (Std .string (' Beat Battle' ).toLowerCase ().trim ().contains (searchBar .text .toLowerCase ().trim ()) && FlxG .save .data .gotbeatbattle && (CategoryState .loadWeekForce == " secrets" || CategoryState .loadWeekForce == " all" ))
628- addSong (' Beat Battle' , 0 , " gf" , FlxColor .fromRGB (165 , 0 , 77 ));
629+ addSong (' Beat Battle' , 7 , " gf" , FlxColor .fromRGB (165 , 0 , 77 ));
629630 if (Std .string (' Beat Battle 2' ).toLowerCase ().trim ().contains (searchBar .text .toLowerCase ().trim ()) && FlxG .save .data .gotbeatbattle2 && (CategoryState .loadWeekForce == " secrets" || CategoryState .loadWeekForce == " all" ))
630- addSong (' Beat Battle 2' , 0 , " gf" , FlxColor .fromRGB (165 , 0 , 77 ));
631+ addSong (' Beat Battle 2' , 7 , " gf" , FlxColor .fromRGB (165 , 0 , 77 ));
631632 }
632633 }
633634
@@ -1141,7 +1142,7 @@ class FreeplayState extends MusicBeatState
11411142 return ;
11421143 }
11431144
1144- var vicCheck : Bool = isVictorySong (songs [curSelected ].songName , songs [curSelected ].folder ) && APInfo .ticketWinCount - APInfo .ticketCount == 0 ;
1145+ var vicCheck : Bool = isVictorySong (songs [curSelected ].songName , songs [curSelected ].folder ) && APInfo .ticketWinCount - APInfo .ticketCount <= 0 ; // in case you go over and beyon getting the tickets you need
11451146 // You need the song AND the tickets.
11461147 trace (' can play victory song: ${vicCheck }' );
11471148 if (isVictorySong (songs [curSelected ].songName , songs [curSelected ].folder ) && ! vicCheck ) {
0 commit comments