Skip to content

Commit 99bf708

Browse files
committed
Merge branch 'Archipelago' of https://github.com/Z11Coding/Mixtape-Engine-Rework into Archipelago
2 parents c859efd + ef582e5 commit 99bf708

File tree

1 file changed

+250
-1
lines changed

1 file changed

+250
-1
lines changed

source/states/PlayState.hx

Lines changed: 250 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ class PlayState extends MusicBeatState
369369
public var maskedSongLength:Float = -1;
370370
public var saveMod:String = ""; // The modifier that allows sperate saves depending how how you want to play the game
371371
public var lyrics:FlxText;
372-
public var lyricsArray:Array<String> = [];
372+
public var rainIntensity:Float = 0;
373373
var lastUpdateTime:Float = 0.0;
374374
var endingTimeLimit:Int = 20;
375375
var metadata:MetadataFile;
@@ -393,6 +393,11 @@ class PlayState extends MusicBeatState
393393
public var localFreezeNotes:Bool = false;
394394
var justmissed:Bool = false;
395395
var middlecircle:FlxSprite;
396+
var hasGlow:Bool = false;
397+
var strumFocus:Bool = false;
398+
var daStatic:FlxSprite;
399+
var thunderON:Bool = false;
400+
var gfScared:Bool = false;
396401

397402
// Troll Engine
398403
private var AIScore:Int = 0;
@@ -841,6 +846,7 @@ class PlayState extends MusicBeatState
841846
add(noteGroup);
842847

843848
if (ClientPrefs.data.doubleGhosts) {
849+
trace("Running Double Ghost");
844850
IntegratedScript.runNamelessHScript("
845851
import psychlua.LuaUtils;
846852
@@ -1192,6 +1198,27 @@ class PlayState extends MusicBeatState
11921198
Paths.clearUnusedMemory();
11931199

11941200
add(blackOverlay);
1201+
1202+
raveLight = new FlxSprite(0, 0).makeGraphic(screenWidth, screenHeight, FlxColor.BLACK);
1203+
raveLight.cameras = [camHUD];
1204+
raveLight.antialiasing = true;
1205+
raveLight.scrollFactor.set(0, 0);
1206+
raveLight.updateHitbox();
1207+
raveLight.screenCenter();
1208+
raveLight.active = false;
1209+
raveLight.alpha = 0;
1210+
raveLight.visible = false;
1211+
1212+
daStatic = new FlxSprite(0, 0);
1213+
daStatic.frames = Paths.getSparrowAtlas('effects/static');
1214+
daStatic.animation.addByPrefix('static', 'lestatic', 24, true);
1215+
daStatic.animation.play('static');
1216+
daStatic.setGraphicSize(FlxG.width, FlxG.height);
1217+
daStatic.screenCenter();
1218+
daStatic.cameras = [camOther];
1219+
daStatic.alpha = 0;
1220+
add(daStatic);
1221+
11951222
lyrics = new FlxText(0, 100, 1280, "", 32, true);
11961223
lyrics.scrollFactor.set();
11971224
lyrics.cameras = [camOther];
@@ -1212,6 +1239,40 @@ class PlayState extends MusicBeatState
12121239
default:
12131240
pressMissDamage = 0.05;
12141241
}
1242+
1243+
raveLightsColors = [0xFF31A2FD, 0xFF31FD8C, 0xFFFB33F5, 0xFFFD4531, 0xFFFBA633];
1244+
}
1245+
1246+
function doStaticSign(lestatic:Int = 0)
1247+
{
1248+
trace('static Time Number: ' + lestatic);
1249+
1250+
switch (lestatic)
1251+
{
1252+
case 0:
1253+
daStatic.alpha = 1;
1254+
case 1:
1255+
daStatic.alpha = 0.5;
1256+
case 2:
1257+
daStatic.alpha = 0;
1258+
1259+
daStatic.animation.play('static');
1260+
daStatic.animation.finishCallback = function(pog:String)
1261+
{
1262+
daStatic.animation.play('static');
1263+
}
1264+
}
1265+
}
1266+
1267+
function doStaticSignFade(lestatictime:Float = 0, lestaticamount:Float = 0)
1268+
{
1269+
FlxTween.tween(daStatic, {alpha: lestaticamount}, lestatictime, {ease: FlxEase.expoInOut});
1270+
1271+
daStatic.animation.play('static');
1272+
daStatic.animation.finishCallback = function(pog:String)
1273+
{
1274+
daStatic.animation.play('static');
1275+
}
12151276
}
12161277

12171278
function set_songSpeed(value:Float):Float
@@ -4476,6 +4537,194 @@ class PlayState extends MusicBeatState
44764537
var color:String = split[0];
44774538
var effect:String = split[1];
44784539
lyricManager(split[0].trim(), split[1].trim());
4540+
4541+
case 'Turn on StrumFocus':
4542+
strumFocus = true;
4543+
4544+
case 'Turn off StrumFocus':
4545+
strumFocus = false;
4546+
modManager.queueEase(curStep, curStep + 4, 'alpha', 0, 'sineInOut', 0);
4547+
modManager.queueEase(curStep, curStep + 4, 'alpha', 0, 'sineInOut', 1);
4548+
4549+
case 'Fade Out':
4550+
FlxTween.tween(blackOverlay, {alpha: 1}, Std.parseFloat(value1));
4551+
FlxTween.tween(camHUD, {alpha: 0}, Std.parseFloat(value1));
4552+
4553+
case 'Fade In':
4554+
FlxTween.tween(blackOverlay, {alpha: 0}, Std.parseFloat(value1));
4555+
FlxTween.tween(camHUD, {alpha: 1}, Std.parseFloat(value1));
4556+
4557+
case 'Silhouette':
4558+
theShadow(value1);
4559+
4560+
case 'Save Song Posititon':
4561+
trace(Conductor.songPosition);
4562+
savedTime = Conductor.songPosition;
4563+
4564+
case 'Change Stage':
4565+
var stageName = value1;
4566+
// var newStageDatas = new Array<Dynamic>();
4567+
4568+
for (lua in luaArray)
4569+
{
4570+
var lua:Dynamic = cast(lua);
4571+
if (lua.scriptName == 'stages/' + stageName + '.lua')
4572+
{
4573+
return;
4574+
}
4575+
else if (lua.scriptName == 'stages/' + curStage + '.lua')
4576+
{
4577+
lua.call('onDestroy', []);
4578+
lua.closed = true;
4579+
lua.stop();
4580+
}
4581+
}
4582+
for (hscript in hscriptArray)
4583+
{
4584+
if (hscript.origin == 'stages/' + stageName + '.hx')
4585+
{
4586+
return;
4587+
}
4588+
else if (hscript.origin == 'stages/' + curStage + '.hx')
4589+
{
4590+
if(hscript != null)
4591+
{
4592+
if(hscript.exists('onDestroy')) hscript.call('onDestroy');
4593+
hscript.destroy();
4594+
}
4595+
}
4596+
}
4597+
4598+
// for (stage in MusicBeatState.stages)
4599+
// {
4600+
// if (stage is BaseStage)
4601+
// {
4602+
// stage.destroy();
4603+
// }
4604+
// }
4605+
4606+
stagesFunc(function(stage:BaseStage) stage.destroy());
4607+
4608+
switch (stageName)
4609+
{
4610+
case 'stage':
4611+
new StageWeek1(); // Week 1
4612+
case 'spooky':
4613+
new Spooky(); // Week 2
4614+
case 'philly':
4615+
new Philly(); // Week 3
4616+
case 'limo':
4617+
new Limo(); // Week 4
4618+
case 'mall':
4619+
new Mall(); // Week 5 - Cocoa, Eggnog
4620+
case 'mallEvil':
4621+
new MallEvil(); // Week 5 - Winter Horrorland
4622+
case 'school':
4623+
new School(); // Week 6 - Senpai, Roses
4624+
case 'schoolEvil':
4625+
new SchoolEvil(); // Week 6 - Thorns
4626+
case 'tank':
4627+
new Tank(); // Week 7 - Ugh, Guns, Stress
4628+
case 'phillyStreets':
4629+
new PhillyStreets(); // Weekend 1 - Darnell, Lit Up, 2Hot
4630+
case 'phillyBlazin':
4631+
new PhillyBlazin(); // Weekend 1 - Blazin
4632+
case 'mainStageErect':
4633+
new MainStageErect(); // Week 1 Special
4634+
case 'spookyMansionErect':
4635+
new SpookyMansionErect(); // Week 2 Special
4636+
case 'phillyTrainErect':
4637+
new PhillyTrainErect(); // Week 3 Special
4638+
case 'limoRideErect':
4639+
new LimoRideErect(); // Week 4 Special
4640+
case 'mallXmasErect':
4641+
new MallXmasErect(); // Week 5 Special
4642+
case 'phillyStreetsErect':
4643+
new PhillyStreetsErect(); // Weekend 1 Special
4644+
case 'desktop':
4645+
new Desktop(); // Literally your desktop as a stage lmao
4646+
default:
4647+
}
4648+
4649+
#if LUA_ALLOWED
4650+
startLuasNamed('stages/' + stageName + '.lua');
4651+
#end
4652+
#if HSCRIPT_ALLOWED
4653+
startHScriptsNamed('stages/' + stageName + '.hx');
4654+
#end
4655+
var scripts:Array<Array<Dynamic>> = [luaArray, hscriptArray];
4656+
stagesFunc(function(stage:BaseStage) stage.createPost());
4657+
for (stuff in scripts)
4658+
{
4659+
for (script in stuff)
4660+
{
4661+
if (script is HScript)
4662+
{
4663+
var script:HScript = cast(script);
4664+
if (script.origin == 'stages/' + stageName + '.hx' || script.origin == 'stages/' + stageName + '.lua')
4665+
{
4666+
script.call('onCreatePost', []);
4667+
}
4668+
}
4669+
else if (script is FunkinLua)
4670+
{
4671+
var script:FunkinLua = cast(script);
4672+
if (script.scriptName == 'stages/' + stageName + '.lua')
4673+
{
4674+
script.call('onCreatePost', []);
4675+
}
4676+
}
4677+
}
4678+
}
4679+
4680+
case 'Static':
4681+
if (value1 == 'true' || value1 == 'True' || value1 == 'on' || value1 == 'On')
4682+
{
4683+
doStaticSign(Std.parseInt(value2));
4684+
daStatic.alpha == 1;
4685+
}
4686+
else
4687+
{
4688+
daStatic.alpha == 0;
4689+
}
4690+
if (value2 == '' || value2 == null)
4691+
{
4692+
doStaticSign(3);
4693+
daStatic.alpha == 0;
4694+
}
4695+
4696+
case 'Static Fade':
4697+
doStaticSignFade(Std.parseFloat(value1), Std.parseFloat(value2));
4698+
4699+
case 'Rave Mode':
4700+
if (ClientPrefs.data.flashing)
4701+
{
4702+
switch (value1.toLowerCase())
4703+
{
4704+
case '0' | 'off' | 'false':
4705+
ravemode = false;
4706+
case '1' | 'on' | 'true':
4707+
ravemode = true;
4708+
}
4709+
}
4710+
4711+
case 'gfScared':
4712+
var newValue:Bool = false;
4713+
if (value1.toLowerCase() == "true")
4714+
newValue = true;
4715+
gfScared = newValue;
4716+
4717+
case 'Freeze Notes':
4718+
if (value1 == 'true' || value1 == 'True')
4719+
{
4720+
freezeNotes = true;
4721+
localFreezeNotes = true;
4722+
}
4723+
else
4724+
{
4725+
freezeNotes = false;
4726+
localFreezeNotes = false;
4727+
}
44794728
}
44804729

44814730
stagesFunc(function(stage:BaseStage) stage.eventCalled(eventName, value1, value2, flValue1, flValue2, strumTime));

0 commit comments

Comments
 (0)