Skip to content

Commit 75766ce

Browse files
committed
Merge branch 'AP-CustomEx' of https://github.com/Z11Coding/Mixtape-Engine-Rework into AP-CustomEx
2 parents 1004aaf + 0dc1968 commit 75766ce

File tree

4 files changed

+95
-5
lines changed

4 files changed

+95
-5
lines changed
1.6 KB
Binary file not shown.

source/archipelago/APAdvancedSettingsState.hx

Lines changed: 90 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ class APAdvancedSettingsState extends MusicBeatState {
129129
var accRequirement:String = "Any";
130130
var allowMods:Bool = false;
131131
var includeSecrets:Bool = true;
132+
var includePico:Bool = true;
133+
var includeErect:Bool = true;
132134
var includeVanilla:Bool = true;
133135
// Player name setting
134136
var playerName:String = "Player";
@@ -318,6 +320,8 @@ class APAdvancedSettingsState extends MusicBeatState {
318320
case "accuracy_requirement" | "accrequirement": accRequirement = Std.string(value);
319321
case "allow_mods" | "mods_enabled": allowMods = value == true;
320322
case "include_secrets": includeSecrets = value == true;
323+
case "include_pico": includePico = value == true;
324+
case "include_erect": includeErect = value == true;
321325
case "include_vanilla": includeVanilla = value == true;
322326
case "starting_song": startingSong = Std.string(value);
323327
case "victory_song": victorySong = Std.string(value);
@@ -454,6 +458,20 @@ class APAdvancedSettingsState extends MusicBeatState {
454458
locked: false,
455459
contextMenu: createBoolContextMenu(includeSecrets, (value) -> { includeSecrets = value; updateSongStats(); })
456460
},
461+
{
462+
name: "Include Pico Mix",
463+
description: "Include pico mixes in the pool",
464+
callback: () -> { includePico = !includePico; updateSongStats(); },
465+
locked: false,
466+
contextMenu: createBoolContextMenu(includePico, (value) -> { includePico = value; updateSongStats(); })
467+
},
468+
{
469+
name: "Include Erect",
470+
description: "Include erect mixes in the pool",
471+
callback: () -> { includeErect = !includeErect; updateSongStats(); },
472+
locked: false,
473+
contextMenu: createBoolContextMenu(includeErect, (value) -> { includeErect = value; updateSongStats(); })
474+
},
457475
{
458476
name: "Include Vanilla",
459477
description: "Include base game songs (Base, Erect, Pico)",
@@ -628,7 +646,7 @@ class APAdvancedSettingsState extends MusicBeatState {
628646
// Example state options (you can add actual complex settings states here)
629647
var exampleStateOptions:Array<StateOption> = [
630648
createStateOption(
631-
"Song Selection",
649+
"Song Selection (DO NOT CLICK!)",
632650
"Open advanced song selection interface",
633651
cast states.freeplay.FreeplayState, // Example: open freeplay for song selection
634652
[], // No constructor args
@@ -1168,6 +1186,8 @@ class APAdvancedSettingsState extends MusicBeatState {
11681186
case "DeathLink": deathlink ? "ON" : "OFF";
11691187
case "Allow Mods": allowMods ? "ON" : "OFF";
11701188
case "Include Secrets": includeSecrets ? "ON" : "OFF";
1189+
case "Include Pico Mix": includePico ? "ON" : "OFF";
1190+
case "Include Erect": includeErect ? "ON" : "OFF";
11711191
case "Include Vanilla": includeVanilla ? "ON" : "OFF";
11721192
case "Starting Song": startingSong != null ? startingSong : "RANDOM";
11731193
case "Victory Song": victorySong != null ? victorySong : "RANDOM";
@@ -1541,6 +1561,12 @@ class APAdvancedSettingsState extends MusicBeatState {
15411561
case "Include Secrets":
15421562
includeSecrets = cast(value, Bool);
15431563
updateSongStats();
1564+
case "Include Pico Mix":
1565+
includePico = cast(value, Bool);
1566+
updateSongStats();
1567+
case "Include Erect":
1568+
includeErect = cast(value, Bool);
1569+
updateSongStats();
15441570
case "Include Vanilla":
15451571
includeVanilla = cast(value, Bool);
15461572
updateSongStats();
@@ -1554,6 +1580,8 @@ class APAdvancedSettingsState extends MusicBeatState {
15541580
case "DeathLink": deathlink;
15551581
case "Allow Mods": allowMods;
15561582
case "Include Secrets": includeSecrets;
1583+
case "Include Pico Mix": includePico;
1584+
case "Include Erect": includeErect;
15571585
case "Include Vanilla": includeVanilla;
15581586
default: false;
15591587
}
@@ -1669,7 +1697,17 @@ class APAdvancedSettingsState extends MusicBeatState {
16691697

16701698
// Base game songs
16711699
if (includeVanilla) {
1672-
totalSongs += APInfo.baseGame.length + APInfo.baseErect.length + APInfo.basePico.length;
1700+
totalSongs += APInfo.baseGame.length;
1701+
}
1702+
1703+
// Secret songs
1704+
if (includePico) {
1705+
totalSongs += APInfo.basePico.length;
1706+
}
1707+
1708+
// Secret songs
1709+
if (includeErect) {
1710+
totalSongs += APInfo.baseErect.length;
16731711
}
16741712

16751713
// Secret songs
@@ -1708,6 +1746,8 @@ class APAdvancedSettingsState extends MusicBeatState {
17081746

17091747
statsString += "Content Included:\n";
17101748
statsString += "• Vanilla: " + (includeVanilla ? "YES" : "NO") + "\n";
1749+
statsString += "• Erect: " + (includeErect ? "YES" : "NO") + "\n";
1750+
statsString += "• Pico: " + (includePico ? "YES" : "NO") + "\n";
17111751
statsString += "• Secrets: " + (includeSecrets ? "YES" : "NO") + "\n";
17121752
statsString += "• Mods: " + (allowMods ? "YES" : "NO") + "\n\n";
17131753

@@ -1822,6 +1862,8 @@ class APAdvancedSettingsState extends MusicBeatState {
18221862

18231863
// New settings with defaults if they don't exist
18241864
includeSecrets = Reflect.hasField(settings, "include_secrets") ? settings.include_secrets : true;
1865+
includePico = Reflect.hasField(settings, "include_pico") ? settings.include_pico : true;
1866+
includeErect = Reflect.hasField(settings, "include_erect") ? settings.include_erect : true;
18251867
includeVanilla = Reflect.hasField(settings, "include_vanilla") ? settings.include_vanilla : true;
18261868
startingSong = settings.starting_song != null ? settings.starting_song : "Tutorial";
18271869
victorySong = settings.victory_song != null ? settings.victory_song : "Tutorial";
@@ -1848,6 +1890,8 @@ class APAdvancedSettingsState extends MusicBeatState {
18481890

18491891
// Save new settings
18501892
settings.include_secrets = includeSecrets;
1893+
settings.include_pico = includePico;
1894+
settings.include_erect = includeErect;
18511895
settings.include_vanilla = includeVanilla;
18521896
settings.starting_song = startingSong;
18531897
settings.victory_song = victorySong;
@@ -1946,6 +1990,8 @@ class APAdvancedSettingsState extends MusicBeatState {
19461990

19471991
// Add new settings
19481992
Reflect.setField(yamlThing, "include_secrets", includeSecrets);
1993+
Reflect.setField(yamlThing, "include_pico", includePico);
1994+
Reflect.setField(yamlThing, "include_erect", includeErect);
19491995
Reflect.setField(yamlThing, "include_vanilla", includeVanilla);
19501996
if (startingSong != null) {
19511997
Reflect.setField(yamlThing, "starting_song", startingSong);
@@ -2017,6 +2063,31 @@ class APAdvancedSettingsState extends MusicBeatState {
20172063
Reflect.field(yamlThing, "songList").length : 0;
20182064

20192065
comment += "# Songs in pool: " + songCount + "\n";
2066+
var modCount = Mods.parseList().enabled.length;
2067+
var modComment = "";
2068+
if (modCount == 0) {
2069+
modComment = "No mods? Vanilla enjoyer detected!";
2070+
} else if (modCount == 1) {
2071+
modComment = "Just one mod? Testing the waters, huh?";
2072+
} else if (modCount <= 3) {
2073+
modComment = modCount + " mods. A modest modder!";
2074+
} else if (modCount <= 7) {
2075+
modComment = modCount + " mods. Getting spicy!";
2076+
} else if (modCount <= 15) {
2077+
modComment = modCount + " mods. Mod connoisseur!";
2078+
} else if (modCount <= 30) {
2079+
modComment = modCount + " mods. How do you even keep track?";
2080+
} else if (modCount <= 50) {
2081+
modComment = modCount + " mods. You must be insane...";
2082+
} else if (modCount <= 100) {
2083+
modComment = modCount + " mods. You are a madman! The Engine might not like this...";
2084+
} else if (modCount <= 200) {
2085+
modComment = modCount + " mods. Are you trying to break the game?!";
2086+
} else {
2087+
modComment = modCount + " mods. This is beyond all reason!";
2088+
}
2089+
comment += " # (" + modComment + ")\n";
2090+
comment += "\n";
20202091
comment += "# Song limit: " + songLimit + "\n";
20212092

20222093
var totalChecks = switch (unlockMethod) {
@@ -2031,6 +2102,8 @@ class APAdvancedSettingsState extends MusicBeatState {
20312102

20322103
comment += "# Content includes:\n";
20332104
comment += "# - Vanilla songs: " + (includeVanilla ? "YES" : "NO") + "\n";
2105+
comment += "# - Erect songs: " + (includeErect ? "YES" : "NO") + "\n";
2106+
comment += "# - Pico songs: " + (includePico ? "YES" : "NO") + "\n";
20342107
comment += "# - Secret songs: " + (includeSecrets ? "YES" : "NO") + "\n";
20352108
comment += "# - Modded songs: " + (allowMods ? "YES" : "NO") + "\n";
20362109

@@ -2112,6 +2185,8 @@ class APAdvancedSettingsState extends MusicBeatState {
21122185
case "accuracy_requirement" | "accrequirement": accRequirement = Std.string(value);
21132186
case "allow_mods" | "mods_enabled": allowMods = value == true;
21142187
case "include_secrets": includeSecrets = value == true;
2188+
case "include_pico": includePico = value == true;
2189+
case "include_erect": includeErect = value == true;
21152190
case "include_vanilla": includeVanilla = value == true;
21162191
case "starting_song": startingSong = Std.string(value);
21172192
case "victory_song": victorySong = Std.string(value);
@@ -2378,7 +2453,8 @@ class APAdvancedSettingsState extends MusicBeatState {
23782453
gradeRequirement: gradeRequirement,
23792454
accRequirement: accRequirement,
23802455
allowMods: allowMods,
2381-
includeSecrets: includeSecrets,
2456+
includePico: includePico,
2457+
includeErect: includeErect,
23822458
includeVanilla: includeVanilla,
23832459
startingSong: startingSong,
23842460
victorySong: victorySong,
@@ -2422,7 +2498,8 @@ class APAdvancedSettingsState extends MusicBeatState {
24222498
gradeRequirement = data.gradeRequirement;
24232499
accRequirement = data.accRequirement;
24242500
allowMods = data.allowMods;
2425-
includeSecrets = data.includeSecrets;
2501+
includePico = data.includePico;
2502+
includeErect = data.includeErect;
24262503
includeVanilla = data.includeVanilla;
24272504
startingSong = data.startingSong;
24282505
victorySong = data.victorySong;
@@ -2647,7 +2724,13 @@ class APAdvancedSettingsState extends MusicBeatState {
26472724
function calculateMaxAvailableSongs():Int {
26482725
var total = 0;
26492726
if (includeVanilla) {
2650-
total += APInfo.baseGame.length + APInfo.baseErect.length + APInfo.basePico.length;
2727+
total += APInfo.baseGame.length;
2728+
}
2729+
if (includeErect) {
2730+
total += APInfo.baseErect.length;
2731+
}
2732+
if (includePico) {
2733+
total += APInfo.basePico.length;
26512734
}
26522735
if (includeSecrets) {
26532736
total += APInfo.secrets.length;
@@ -2670,6 +2753,8 @@ class APAdvancedSettingsState extends MusicBeatState {
26702753
state.accRequirement = data.accRequirement;
26712754
state.allowMods = data.allowMods;
26722755
state.includeSecrets = data.includeSecrets;
2756+
state.includePico = data.includePico;
2757+
state.includeErect = data.includeErect;
26732758
state.includeVanilla = data.includeVanilla;
26742759
state.startingSong = data.startingSong;
26752760
state.victorySong = data.victorySong;

source/archipelago/APEntryState.hx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ typedef APOptions =
7474
var song_limit:Int;
7575
// New settings for APAdvancedSettingsState
7676
var include_secrets:Bool;
77+
var include_pico:Bool;
78+
var include_erect:Bool;
7779
var include_vanilla:Bool;
7880
var starting_song:String;
7981
var victory_song:String;
@@ -184,6 +186,8 @@ class APEntryState extends MusicBeatState
184186
song_limit: 5,
185187
// New settings for APAdvancedSettingsState
186188
include_secrets: true,
189+
include_pico: true,
190+
include_erect: true,
187191
include_vanilla: true,
188192
starting_song: "Tutorial",
189193
victory_song: "Bopeebo"

source/managers/FreeplayManager.hx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ class FreeplayManager {
7777

7878
/////////////////////////////////////////////////////FUNCTIONS///////////////////////////////////////////////////////////////////////////////
7979
public static function loadFPManager(?ensureLoaded:Bool = false) {
80+
trace("FP in Arch Mode: " + APEntryState.inArchipelagoMode);
8081
#if ARCHIPELAGO_ALLOWED
8182
return switch (APEntryState.inArchipelagoMode) {
8283
case true:

0 commit comments

Comments
 (0)