Skip to content

Commit 10f2238

Browse files
committed
eeeeeeee
1 parent c9a8e49 commit 10f2238

File tree

13 files changed

+377
-85
lines changed

13 files changed

+377
-85
lines changed

.vscode/extensions.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
"recommendations": [
33
"nadako.vshaxe", // Basic Haxe integration
44
"wiggin77.codedox", // Haxe documentation
5-
"vshaxe.haxe-checkstyle", // Haxe code style and conventions
65
"vshaxe.hxcpp-debugger", // CPP debugging
76
"openfl.lime-vscode-extension", // Lime integration
87
"esbenp.prettier-vscode", // JSON formatting
98
"redhat.vscode-xml" // XML formatting
109
]
11-
}
10+
}

source/archipelago/APGameState.hx

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,10 @@ class APGameState
705705
var value = retrievedPacket.get(key);
706706
if (key.indexOf("_read_hints_") != -1)
707707
{
708-
APFreeplayManager.hintTable = new Map<String, String>();
708+
// Initialize hint storage with better structure
709+
APFreeplayManager.hintTable = new Map<String, Array<String>>();
710+
APFreeplayManager.curHinted = [];
711+
709712
// value.mapToObject() contains multiple hints indexed by keys
710713
var hintsObj:Dynamic = value.mapToObject();
711714
for (hintKey in Reflect.fields(hintsObj))
@@ -785,15 +788,29 @@ class APGameState
785788
message = "Hint: " + receivingPlayerName + " will find " + itemName + " in " + findingPlayerName + "'s World at " + locationName;
786789
}
787790

788-
var songName = getFullNameFromSongAndMod(songName);
791+
var fullSongName = getFullNameFromSongAndMod(songName);
789792

790-
if (APFreeplayManager.hintTable.exists(songName))
793+
// Store hints in an array for better organization
794+
if (!APFreeplayManager.hintTable.exists(fullSongName))
791795
{
792-
APFreeplayManager.hintTable.set(songName, APFreeplayManager.hintTable.get(songName) + "\n" + message);
796+
APFreeplayManager.hintTable.set(fullSongName, []);
793797
}
794-
else
798+
APFreeplayManager.hintTable.get(fullSongName).push(message);
799+
800+
// Add to hinted songs list if not already there
801+
var hintSong = {song: songName.song, mod: songName.mod != null ? songName.mod : ""};
802+
var isAlreadyHinted = false;
803+
for (hinted in APFreeplayManager.curHinted)
804+
{
805+
if (hinted.song == hintSong.song && hinted.mod == hintSong.mod)
806+
{
807+
isAlreadyHinted = true;
808+
break;
809+
}
810+
}
811+
if (!isAlreadyHinted)
795812
{
796-
APFreeplayManager.hintTable.set(songName, message);
813+
APFreeplayManager.curHinted.push(hintSong);
797814
}
798815
}
799816
else
@@ -808,14 +825,16 @@ class APGameState
808825
}
809826
}
810827
}
811-
for (hint in APFreeplayManager.hintTable.keys())
828+
829+
// Debug output for stored hints
830+
for (songName in APFreeplayManager.hintTable.keys())
812831
{
813-
APFreeplayManager.curHinted = [];
814-
var message = APFreeplayManager.hintTable.get(hint);
815-
trace("Hint: " + hint + " - " + message);
816-
var hintSong = getSongAndMod(hint);
817-
APFreeplayManager.curHinted.push({song: hintSong.song, mod: hintSong.mod != null ? hintSong.mod : ""});
818-
trace(hintSong);
832+
var hints = APFreeplayManager.hintTable.get(songName);
833+
trace("Song: " + songName + " has " + hints.length + " hints:");
834+
for (hint in hints)
835+
{
836+
trace(" - " + hint);
837+
}
819838
}
820839
}
821840

source/archipelago/APItem.hx

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ class APItem {
679679
return new APTrap(name, ConditionHelper.PlayState().funcAndReturn(function(c) {
680680
c.extraConditions = [];
681681
c.extraConditions.push(function(e) {
682-
return states.PlayState.instance?.startedSong == true;
682+
return states.PlayState.instance?.startedSong == true && APPlayState.resisting == false;
683683
});
684684
}), function() {
685685
popup('Oh god no here she comes', "Resistance Trap", true);
@@ -690,6 +690,80 @@ class APItem {
690690
t.isTrap = true;
691691
});
692692

693+
case "Mute Trap":
694+
return new APTrap(name, ConditionHelper.Special(), function() {
695+
popup('...', "Mute Trap", true);
696+
// Random between 1 to 30 seconds
697+
var muteDuration = FlxG.random.int(1, 30);
698+
new FlxTimer().start(muteDuration, function(tmr:FlxTimer)
699+
{
700+
// Randomly choose between toggling mute or changing volume with a tween
701+
if (FlxG.random.bool(50)) {
702+
// Toggle mute immediately
703+
FlxG.sound.toggleMuted();
704+
} else {
705+
// // Decide reduction target: usually reduce to 0, 1% chance to reduce by a random 0-1 amount
706+
// var currentVol:Float = FlxG.sound.volume;
707+
// var reduction:Float = if (FlxG.random.bool(1)) FlxG.random.float(0, 1) else currentVol;
708+
// reduction = Math.min(reduction, currentVol); // never reduce below 0
709+
// var duration:Float = FlxG.random.float(1, 2); // 1 to 2 seconds
710+
711+
// // First attempt: tween from 0 -> reduction and call changeVolume with the incremental negative delta
712+
// var prev:Float = 0;
713+
// flixel.tweens.FlxTween.num(0, reduction, duration, null, function(value:Float) {
714+
// var delta:Float = value - prev;
715+
// prev = value;
716+
// try {
717+
// FlxG.sound.changeVolume(-delta);
718+
// } catch (e:Dynamic) {
719+
// // ignore any errors calling changeVolume
720+
// }
721+
// }, { onComplete: function() {
722+
// // If volume still not 0 because player fought it, try once more
723+
// try {
724+
// if (FlxG.sound.volume > 0) {
725+
// var currentVol2:Float = FlxG.sound.volume;
726+
// var reduction2:Float = if (FlxG.random.bool(1)) FlxG.random.float(0, 1) else currentVol2;
727+
// reduction2 = Math.min(reduction2, currentVol2);
728+
// var duration2:Float = FlxG.random.float(0.8, 1.6);
729+
730+
// var prev2:Float = 0;
731+
// flixel.tweens.FlxTween.num(0, reduction2, duration2, function(value2:Float) {
732+
// var delta2:Float = value2 - prev2;
733+
// prev2 = value2;
734+
// try {
735+
// FlxG.sound.changeVolume(-delta2);
736+
// } catch (e:Dynamic) {
737+
// // ignore
738+
// }
739+
// }, { onComplete: function() {
740+
// // After second attempt, force volume to 0 by applying remaining negative delta
741+
// try {
742+
// var need:Float = FlxG.sound.volume;
743+
// if (need > 0) {
744+
// FlxG.sound.changeVolume(-need);
745+
// }
746+
// } catch (e:Dynamic) {
747+
// // ignore
748+
// }
749+
// }});
750+
// } else {
751+
// // Already at 0, nothing to do
752+
// }
753+
// } catch (e:Dynamic) {
754+
// // ignore any unexpected errors
755+
// }
756+
// }});
757+
}
758+
759+
FlxDestroyUtil.destroy(tmr);
760+
});
761+
}, true, true).funcAndReturn(function(t:APItem) {
762+
// Set it as a trap.
763+
t.isTrap = true;
764+
});
765+
766+
693767
case "Ultimate Confusion Trap":
694768
return new APTrap(name, ConditionHelper.Everywhere(), function() {
695769
unknownSongs = true;

source/archipelago/APPlayState.hx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2553,8 +2553,7 @@ class APPlayState extends PlayState {
25532553
if (ghostChat)
25542554
ghostChat = false;
25552555

2556-
if (((((((archipelago.APItem.activeItem != null))))))) // Why was this GONE???
2557-
archipelago.APItem.activeItem = null;
2556+
25582557

25592558
ClientPrefs.data.downScroll = ogScroll;
25602559

@@ -2606,6 +2605,9 @@ class APPlayState extends PlayState {
26062605
if (ClientPrefs.getGameplaySetting('chartModifier', 'Normal') != "Normal" || ClientPrefs.getGameplaySetting('chartModifier', 'Normal') == null)
26072606
ClientPrefs.data.gameplaySettings.set('chartModifier', 'Normal');
26082607

2608+
// Set chart modifier anyway, because it's bugging for some reason.
2609+
chartModifier = ClientPrefs.getGameplaySetting('chartModifier', 'Normal');
2610+
26092611
if (archipelago.HighQualityTrapManager.isTrapInUse()) {
26102612
// Don't stop the trap here - let APVictorySubstate handle it
26112613
// Remove the stopHighQualityTrap call

source/archipelago/traps/games/APUnoTrapState.hx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,10 @@ class APUnoTrapState extends UnoTestState {
103103
// Save AP Data.
104104
APEntryState.apGame.updateSaveData();
105105
if (previousState != null) {
106-
LoadingState.loadAndSwitchState(Type.createInstance(previousState, []));
106+
LoadingState.loadAndSwitchState(Type.createInstance(states.MainMenuState, []));
107107
} else {
108108
StageData.loadDirectory(PlayState.SONG);
109-
LoadingState.loadAndSwitchState(new archipelago.APPlayState());
109+
LoadingState.loadAndSwitchState(new states.MainMenuState());
110110
}
111111
});
112112
} else {

source/backend/Song.hx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ class Song
235235
private static function checkForSongVariants(folder:String, jsonInput:String):{folderPath:String, jsonInput:String, variantName:String}
236236
{
237237
#if MODS_ALLOWED
238+
if (!HighQualityTrapManager.isTrapInUse()) return null;
238239
// Check for variants folder in the song's data directory
239240
var songDataPath = Paths.getPath('data/$folder', TEXT, null, true);
240241
var songDataDir = haxe.io.Path.directory(songDataPath);

source/managers/APFreeplayManager.hx

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class APFreeplayManager extends FreeplayManager {
6161
public static var curUnlocked:Array<{song:String, mod:String}> = [];
6262
public static var curMissing:Array<{song:String, mod:String}> = [];
6363
public static var curHinted:Array<{song:String, mod:String}> = [];
64-
public static var hintTable:Map<String, String> = new Map<String, String>();
64+
public static var hintTable:Map<String, Array<String>> = new Map<String, Array<String>>();
6565
public static var trueMissing:Array<{song:String, mod:String}> = [];
6666
public static var unplayedList:Array<{song:String, mod:String}> = [];
6767
public static var callVictory:Bool = false;
@@ -85,6 +85,38 @@ class APFreeplayManager extends FreeplayManager {
8585
return locationId.trim().toLowerCase().replace('-', ' ') == APEntryState.victorySong.trim().toLowerCase().replace('-', ' ');
8686
}
8787

88+
/**
89+
* Get hints for a specific song
90+
* @param songName The song name
91+
* @param modName The mod name (can be null or empty)
92+
* @return Array of hint strings, empty if no hints
93+
*/
94+
public static function getHintsForSong(songName:String, modName:String):Array<String> {
95+
if (modName == null) modName = "";
96+
97+
// Create the full song identifier used in hint storage
98+
var fullSongName = songName;
99+
if (modName.trim() != "") {
100+
fullSongName += " (" + modName + ")";
101+
}
102+
103+
if (hintTable.exists(fullSongName)) {
104+
return hintTable.get(fullSongName).copy(); // Return copy to prevent external modification
105+
}
106+
107+
return []; // No hints found
108+
}
109+
110+
/**
111+
* Check if a song has any hints available
112+
* @param songName The song name
113+
* @param modName The mod name (can be null or empty)
114+
* @return True if hints exist, false otherwise
115+
*/
116+
public static function hasHintsForSong(songName:String, modName:String):Bool {
117+
return getHintsForSong(songName, modName).length > 0;
118+
}
119+
88120
// public static function addHint(song:String, item)
89121
public static function forceUnlockCheck(songName:String, modName:String):Void {
90122
trace("Starting forceUnlockCheck...");
@@ -196,7 +228,7 @@ class APFreeplayManager extends FreeplayManager {
196228
curUnlocked = [];
197229
curMissing = [];
198230
curHinted = [];
199-
hintTable = new Map<String, String>();
231+
hintTable = new Map<String, Array<String>>();
200232
trueMissing = [];
201233
unplayedList = [];
202234
callVictory = false;

source/objects/NoteTweener.hx

Whitespace-only changes.

source/states/PlayState.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10495,7 +10495,7 @@ class PlayState extends MusicBeatState
1049510495
public var strumOffsetbcauseitsstupid:Float = 0;
1049610496
public var strumOffsetspacebcauseitsstupid:Float = 0;
1049710497

10498-
public var altNoteMove:Bool = false;
10498+
public var altNoteMove:Bool = true;
1049910499
public var ModchartScrollType:Int = 0; // 0 = none, 1 = Downscroll, 3 = Rotate.
1050010500
public var curDownscroll:Bool = ClientPrefs.data.downScroll; // Used to check if the downscroll has changed.
1050110501
public function modchartSync(directChange:Bool = false):Void {

0 commit comments

Comments
 (0)