Skip to content

Commit c6a3bca

Browse files
committed
In-Game Hints... kinda.
1 parent c784138 commit c6a3bca

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

source/archipelago/APInfo.hx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,18 @@ class APInfo {
1414

1515
public static var hasSongChecks(get, never):Bool;
1616

17+
public static var hintPoints(get, never):Int;
18+
public static var hintCost(get, never):Int;
19+
20+
public static function get_hintPoints():Int {
21+
return APInfo.apGame.info().hintPoints;
22+
}
23+
24+
public static function get_hintCost():Int {
25+
return APInfo.apGame.info().hintCostPoints;
26+
}
27+
28+
1729
public static function get_hasNoteChecks():Bool {
1830
return unlockMethod == "Note Checks" || unlockMethod == "Both";
1931
}

source/states/FreeplayState.hx

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1012,6 +1012,17 @@ class FreeplayState extends MusicBeatState
10121012
MusicBeatState.resetState();
10131013
}
10141014

1015+
if (FlxG.keys.justPressed.H && APEntryState.inArchipelagoMode && !searchBar.hasFocus) {
1016+
try {
1017+
var SongInfo = APEntryState.apGame.getSongAndMod(songs[curSelected].songName + (songs[curSelected].folder != "" ? " (" + songs[curSelected].folder + ")" : ""));
1018+
if (APEntryState.ap != null) {
1019+
APEntryState.ap.Say("!hint " + SongInfo.song + ((SongInfo.mod != "" && SongInfo.mod != null) ? " (" + SongInfo.mod + ")" : ""));
1020+
archipelago.console.SideUI.instance.active = true;
1021+
}
1022+
} catch (e:Dynamic) {
1023+
trace("You can't hint nothing, silly!");
1024+
}
1025+
}
10151026
lerpScore = Math.floor(FlxMath.lerp(intendedScore, lerpScore, Math.exp(-elapsed * 24)));
10161027
lerpRating = FlxMath.lerp(intendedRating, lerpRating, Math.exp(-elapsed * 12));
10171028

@@ -1473,7 +1484,15 @@ class FreeplayState extends MusicBeatState
14731484
updateTexts(elapsed);
14741485
super.update(elapsed);
14751486

1476-
if (ticketCounter != null) ticketCounter.text = 'Current ticket amount: ${APInfo.ticketCount}\nTickets Needed: ${APInfo.ticketWinCount}\nTickets Left: ${Std.int(APInfo.ticketWinCount - APInfo.ticketCount)}';
1487+
if (ticketCounter != null) {
1488+
ticketCounter.text = 'Current ticket amount: ${APInfo.ticketCount}\n' +
1489+
'Tickets Needed: ${APInfo.ticketWinCount}\n' +
1490+
'Tickets Left: ${Std.int(APInfo.ticketWinCount - APInfo.ticketCount)}\n' +
1491+
'Hint Points Available: ${APInfo.hintPoints}\n' +
1492+
'Hint Cost: ${APInfo.hintCost}\n' +
1493+
'(L) to release song\n' +
1494+
'(H) to hint song';
1495+
}
14771496

14781497
grpLocks.forEach(function(lock:FlxSprite)
14791498
{

0 commit comments

Comments
 (0)