Skip to content

Commit b42961d

Browse files
committed
Merge branch 'Archipelago' of https://github.com/Z11Coding/Mixtape-Engine-Rework into Archipelago
2 parents a9d131b + 0b32ff6 commit b42961d

19 files changed

+303
-447
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Archipelago Randomizer Configuration / Setup Guide
32

43
Archipelago is a Multiworld Randomizer, meaning it randomizes a bunch of games into one randomizer pool, and it challenges you to conplete all of the games.
@@ -21,8 +20,8 @@ When updating the Engine, make sure to use the Update/Install APWorld Button to
2120
### Need help?
2221
Join our [Test Discord Server](https://discord.gg/KJXvEVUfZX) to get assistance with issues, or to submit a bug report.
2322

24-
# Friday Night Funkin' - Psych Engine
25-
Engine originally used on [Mind Games Mod](https://gamebanana.com/mods/301107), intended to be a fix for the vanilla version's many issues while keeping the casual play aspect of it. Also aiming to be an easier alternative to newbie coders.
23+
# Mixtape Engine
24+
Mixtape is a fork of [Psych Engine](https://gamebanana.com/mods/309789) (another one, oh the horror!), with the goal of being the most compatible engine ever. Eventually, we want to be able to have *every* mod from *every* engine compatible all in one *right here*.
2625

2726
## Installation:
2827

source/archipelago/APDisconnectSubstate.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class APDisconnectSubstate extends FlxSubState
2727

2828
// AP.disconnect_socket();
2929
states.ExitState.addExitCallback(function() {
30-
var restartProcess = new Process("Mixtape.exe", ["APDisconnectError", "restart"]);
30+
//var restartProcess = new Process("Mixtape.exe", ["APDisconnectError", "restart"]);
3131

3232
});
3333
FlxG.switchState(new states.ExitState());

source/archipelago/APPlayState.hx

Lines changed: 18 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class APPlayState extends PlayState {
8181
public var effectArray:Array<String> = [
8282
'colorblind', 'blur', 'lag', 'mine', 'warning', 'heal', 'spin', 'songslower', 'songfaster', 'scrollswitch', 'scrollfaster', 'scrollslower', 'rainbow',
8383
'cover', 'ghost', 'flashbang', 'nostrum', 'jackspam', 'spam', 'sever', 'shake', 'poison', 'dizzy', 'noise', 'flip', 'invuln',
84-
'desync', 'mute', 'ice', 'randomize', 'randomizeAlt', 'opponentPlay', 'bothplay', 'fakeheal', 'spell', 'terminate', 'lowpass', #if windows 'notif' #end
84+
'desync', 'mute', 'ice', 'fakeheal', 'spell', 'terminate', 'lowpass', #if windows 'notif' #end
8585
];
8686
var notifs:Array<String> = [
8787
"You're crazy...",
@@ -184,15 +184,15 @@ class APPlayState extends PlayState {
184184
'colorblind' => function() {
185185
var ttl:Float = 16;
186186
var onEnd:(Void->Void) = function() {
187-
camHUDfilters.remove(filterMap.get("Grayscale").filter);
188-
camGamefilters.remove(filterMap.get("Grayscale").filter);
187+
camHUD.filters.remove(filterMap.get("Grayscale").filter);
188+
camGame.filters.remove(filterMap.get("Grayscale").filter);
189189
};
190190
var playSound:String = "colorblind";
191191
var playSoundVol:Float = 0.8;
192192
var noIcon:Bool = false;
193193

194-
camHUDfilters.push(filterMap.get("Grayscale").filter);
195-
camGamefilters.push(filterMap.get("Grayscale").filter);
194+
camGame.filters.push(filterMap.get("Grayscale").filter);
195+
camGame.filters.push(filterMap.get("Grayscale").filter);
196196

197197
applyEffect(ttl, onEnd, playSound, playSoundVol, noIcon, 'colorblind');
198198
},
@@ -304,12 +304,12 @@ class APPlayState extends PlayState {
304304
'spin' => function() {
305305
var ttl:Float = 15;
306306
var onEnd:(Void->Void) = function() {
307-
modManager.setValue('roll', 0);
307+
modManager.setValue('orient', 0);
308308
};
309309
var playSound:String = "spin";
310310
var playSoundVol:Float = 1;
311311
var noIcon:Bool = false;
312-
modManager.setValue('roll', (FlxG.random.bool() ? 1 : -1) * FlxG.random.float(333 * 0.8, 333 * 1.15));
312+
modManager.setValue('orient', (FlxG.random.bool() ? 1 : -1) * FlxG.random.float(333 * 0.8, 333 * 1.15));
313313
applyEffect(ttl, onEnd, playSound, playSoundVol, noIcon, 'spin');
314314
},
315315
'songslower' => function() {
@@ -691,9 +691,8 @@ class APPlayState extends PlayState {
691691
explosion.animation.add("boom", okayden, 60, false);
692692
explosion.animation.finishCallback = function(name) {
693693
explosion.visible = false;
694-
explosion.kill();
695694
remove(explosion);
696-
FlxDestroyUtil.destroy(explosion);
695+
explosion.kill();
697696
};
698697
explosion.cameras = [camHUD];
699698
explosion.x = playerField.strumNotes[picked].x + playerField.strumNotes[picked].width / 2 - explosion.width / 2;
@@ -843,6 +842,7 @@ class APPlayState extends PlayState {
843842
var onEnd:(Void->Void) = function() {
844843
FlxG.sound.music.time += delayOffset;
845844
delayOffset = 0;
845+
resyncVocals();
846846
};
847847
var playSound:String = "delay";
848848
var playSoundVol:Float = 1;
@@ -1027,8 +1027,8 @@ class APPlayState extends PlayState {
10271027
var ttl:Float = 10;
10281028
var onEnd:(Void->Void) = function() {
10291029
blurEffect.setStrength(0, 0);
1030-
camHUDfilters.remove(filterMap.get("BlurLittle").filter);
1031-
camGamefilters.remove(filterMap.get("BlurLittle").filter);
1030+
camHUD.filters.remove(filterMap.get("BlurLittle").filter);
1031+
camGame.filters.remove(filterMap.get("BlurLittle").filter);
10321032
lowFilterAmount = 1;
10331033
vocalLowFilterAmount = 1;
10341034
};
@@ -1038,12 +1038,12 @@ class APPlayState extends PlayState {
10381038

10391039
if (FlxG.random.bool(40)) {
10401040
lowFilterAmount = .0134;
1041-
camGamefilters.push(filterMap.get("BlurLittle").filter);
1041+
camGame.filters.push(filterMap.get("BlurLittle").filter);
10421042
blurEffect.setStrength(32, 32);
10431043
} else {
10441044
vocalLowFilterAmount = .0134;
1045-
camHUDfilters.push(filterMap.get("BlurLittle").filter);
1046-
camGamefilters.push(filterMap.get("BlurLittle").filter);
1045+
camHUD.filters.push(filterMap.get("BlurLittle").filter);
1046+
camGame.filters.push(filterMap.get("BlurLittle").filter);
10471047
blurEffect.setStrength(32, 32);
10481048
}
10491049

@@ -1854,12 +1854,6 @@ class APPlayState extends PlayState {
18541854
note.blockHit = true;
18551855
else
18561856
note.blockHit = false;
1857-
1858-
if (note is archipelago.APNote) {
1859-
note.rgbShader.r = 0xFF313131;
1860-
note.rgbShader.g = 0xFFFFFFFF;
1861-
note.rgbShader.b = 0xFFB4B4B4;
1862-
}
18631857
});
18641858
}
18651859

@@ -1982,6 +1976,7 @@ class APPlayState extends PlayState {
19821976
super.update(elapsed);
19831977
}
19841978

1979+
var alreadySent:Bool = false;
19851980
override function doDeathCheck(?skipHealthCheck:Bool = false):Bool
19861981
{
19871982
if (activeItems[0] <= 0)
@@ -1996,8 +1991,10 @@ class APPlayState extends PlayState {
19961991
noiseSound.pause();
19971992
}
19981993
}
1999-
if (health <= 0 && bfkilledcheck && !deathByLink)
1994+
if (health <= 0 && bfkilledcheck && !deathByLink && !alreadySent) {
1995+
alreadySent = true; // because indie cross likes to spam this every frame for some reason
20001996
APEntryState.apGame.info().sendDeathLink(COD.COD);
1997+
}
20011998
super.doDeathCheck();
20021999
return true;
20032000
}
@@ -2219,7 +2216,6 @@ class APPlayState extends PlayState {
22192216

22202217
if (daNote.specialNote)
22212218
{
2222-
specialNoteHit(daNote, field);
22232219
return;
22242220
}
22252221
super.noteMiss(daNote, field);
@@ -2379,38 +2375,6 @@ class APPlayState extends PlayState {
23792375
}
23802376
}
23812377

2382-
override function beatHit()
2383-
{
2384-
switch (terminateStep)
2385-
{
2386-
case 3:
2387-
var terminate = new TerminateTimestamp(Math.floor(Conductor.songPosition / Conductor.crochet) * Conductor.crochet + Conductor.crochet * 3);
2388-
add(terminate);
2389-
terminateTimestamps.push(terminate);
2390-
terminateStep--;
2391-
COD.setPresetCOD('custom');
2392-
COD.custom = 'You were Terminated.';
2393-
case 2 | 1 | 0:
2394-
terminateMessage.loadGraphic(Paths.image("streamervschat/terminate" + terminateStep));
2395-
terminateMessage.screenCenter(XY);
2396-
terminateMessage.cameras = [camOther];
2397-
terminateMessage.visible = true;
2398-
if (terminateStep > 0)
2399-
{
2400-
terminateSound.volume = 0.6;
2401-
terminateSound.play(true);
2402-
}
2403-
else if (terminateStep == 0)
2404-
{
2405-
FlxG.sound.play(Paths.sound('streamervschat/beep2'), 0.85);
2406-
}
2407-
terminateStep--;
2408-
case -1:
2409-
terminateMessage.visible = false;
2410-
}
2411-
super.beatHit();
2412-
}
2413-
24142378
override function closeSubState()
24152379
{
24162380
setBoyfriendInvuln(1 / 60);

source/backend/ClientPrefs.hx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ import states.TitleState;
165165
public var aprilFools:Bool = true;
166166
public var freeplayMenu:String = 'Mixtape';
167167
public var showMods:Bool = false;
168+
public var checkAPWorld:Bool = true;
168169
}
169170

170171
class ClientPrefs {

source/backend/Conductor.hx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ class Conductor
2929
@:noCompletion static function get_jackLimit()
3030
return (jackLimit < 0) ? (jackLimit = Conductor.stepCrochet / _internalJackLimit) : jackLimit;
3131

32+
public static var ROWS_PER_BEAT = 48; // from Stepmania
33+
3234
public static function judgeNote(arr:Array<Rating>, diff:Float=0):Rating // die
3335
{
3436
var data:Array<Rating> = arr;
@@ -44,6 +46,9 @@ class Conductor
4446
return lastChange.stepCrochet*4;
4547
}
4648

49+
public inline static function secsToRow(sex:Float):Int
50+
return Math.round(getBeat(sex) * ROWS_PER_BEAT);
51+
4752
public static function getBPMFromSeconds(time:Float){
4853
var lastChange:BPMChangeEvent = {
4954
stepTime: 0,

source/backend/Difficulty.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Difficulty
1616
if(num == null) num = PlayState.storyDifficulty;
1717

1818
var filePostfix:String = list[num];
19-
if(filePostfix != null && Paths.formatToSongPath(filePostfix) != Paths.formatToSongPath(defaultDifficulty))
19+
if(filePostfix != null && (Paths.formatToSongPath(filePostfix) != Paths.formatToSongPath(defaultDifficulty) || Paths.formatToSongPath(filePostfix) != Paths.formatToSongPath(defaultDifficulty.toLowerCase())))
2020
filePostfix = '-' + filePostfix;
2121
else
2222
filePostfix = '';

source/backend/Mods.hx

Lines changed: 3 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package backend;
22

33
import openfl.utils.Assets;
4-
54
import haxe.Json;
65

76
typedef ModsList = {
@@ -32,8 +31,6 @@ class Mods
3231
];
3332

3433
private static var globalMods:Array<String> = [];
35-
private static var internetModSources:Array<String> = [];
36-
private static var githubModSources:Array<String> = [];
3734

3835
inline public static function getGlobalMods()
3936
return globalMods;
@@ -96,13 +93,15 @@ class Mods
9693
inline public static function directoriesWithFile(path:String, fileToFind:String, mods:Bool = true)
9794
{
9895
var foldersToCheck:Array<String> = [];
96+
//Main folder
9997
if(FileSystem.exists(path + fileToFind))
10098
foldersToCheck.push(path + fileToFind);
10199

100+
// Week folder
102101
if(Paths.currentLevel != null && Paths.currentLevel != path)
103102
{
104103
var pth:String = Paths.getFolderPath(fileToFind, Paths.currentLevel);
105-
if(FileSystem.exists(pth))
104+
if(!foldersToCheck.contains(pth) && FileSystem.exists(pth))
106105
foldersToCheck.push(pth);
107106
}
108107

@@ -212,40 +211,6 @@ class Mods
212211
}
213212
}
214213

215-
// // Add internet mod sources
216-
// for (url in internetModSources) {
217-
// try {
218-
// var modContent:String = downloadModFromUrl(url);
219-
// if (modContent != null) {
220-
// var modFolder:String = extractMod(modContent);
221-
// if (modFolder != null && !added.contains(modFolder)) {
222-
// added.push(modFolder);
223-
// list.push([modFolder, true]);
224-
// }
225-
// }
226-
// } catch (e:Dynamic) {
227-
// trace('Failed to download mod from URL: ' + url);
228-
// trace(e);
229-
// }
230-
// }
231-
232-
// // Add GitHub mod sources
233-
// for (repoUrl in githubModSources) {
234-
// try {
235-
// var modContent:String = downloadModFromGithub(repoUrl);
236-
// if (modContent != null) {
237-
// var modFolder:String = extractMod(modContent);
238-
// if (modFolder != null && !added.contains(modFolder)) {
239-
// added.push(modFolder);
240-
// list.push([modFolder, true]);
241-
// }
242-
// }
243-
// } catch (e:Dynamic) {
244-
// trace('Failed to download mod from GitHub: ' + repoUrl);
245-
// trace(e);
246-
// }
247-
// }
248-
249214
// Now save file
250215
var fileStr:String = '';
251216
for (values in list)
@@ -270,32 +235,4 @@ class Mods
270235
Mods.currentModDirectory = list[0];
271236
#end
272237
}
273-
274-
// public static function addInternetModSource(url:String):Void {
275-
// if (!internetModSources.contains(url)) {
276-
// internetModSources.push(url);
277-
// updateModList();
278-
// }
279-
// }
280-
281-
// public static function removeInternetModSource(url:String):Void {
282-
// if (internetModSources.contains(url)) {
283-
// internetModSources.remove(url);
284-
// updateModList();
285-
// }
286-
// }
287-
288-
// public static function addGithubModSource(repoUrl:String):Void {
289-
// if (!githubModSources.contains(repoUrl)) {
290-
// githubModSources.push(repoUrl);
291-
// updateModList();
292-
// }
293-
// }
294-
295-
// public static function removeGithubModSource(repoUrl:String):Void {
296-
// if (githubModSources.contains(repoUrl)) {
297-
// githubModSources.remove(repoUrl);
298-
// updateModList();
299-
// }
300-
// }
301238
}

source/backend/MusicBeatState.hx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ class MusicBeatState extends FlxState
5858

5959
// if (backend.window.CppAPI.getWindowOpacity()!=1)
6060
#if windows
61-
if (emergencyOpacityFix) {
62-
CppAPI.setWindowOppacity(1);
63-
}
6461

6562
if (firstRun) {
6663
FlxTween.num(0, 1, 0.5, {
@@ -137,6 +134,11 @@ class MusicBeatState extends FlxState
137134

138135
override function update(elapsed:Float)
139136
{
137+
if (emergencyOpacityFix) {
138+
CppAPI.setWindowOppacity(1);
139+
emergencyOpacityFix = false;
140+
}
141+
140142
if (Main.audioDisconnected && getState() == PlayState.instance)
141143
{
142144
//Save your progress and THEN reset it (I knew there was a common use for this)

source/backend/WeekData.hx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ class WeekData {
3939
public var hideFreeplay:Bool;
4040
public var difficulties:String;
4141
public var category:flixel.util.typeLimit.OneOfTwo<String, Array<String>>;
42-
4342
public var fileName:String;
4443

4544
public static function createWeekFile():WeekFile {
@@ -181,14 +180,14 @@ class WeekData {
181180
return null;
182181
}
183182

184-
// FUNCTIONS YOU WILL PROBABLY NEVER NEED TO USE
183+
// FUNCTIONS YOU WILL PROBABLY NEVER NEED TO USE
185184

186-
//To use on PlayState.hx or Highscore stuff
185+
// To use on PlayState.hx or Highscore stuff
187186
public static function getWeekFileName():String {
188187
return weeksList[PlayState.storyWeek];
189188
}
190189

191-
//Used on LoadingState, nothing really too relevant
190+
// Used on LoadingState, nothing really too relevant
192191
public static function getCurrentWeek():WeekData {
193192
return weeksLoaded.get(weeksList[PlayState.storyWeek]);
194193
}
@@ -199,4 +198,4 @@ class WeekData {
199198
Mods.currentModDirectory = data.folder;
200199
}
201200
}
202-
}
201+
}

0 commit comments

Comments
 (0)