Skip to content

Commit

Permalink
Merge pull request #875 from NAEL2XD/patch-2
Browse files Browse the repository at this point in the history
optimization and easter egg
  • Loading branch information
moxie-coder authored Feb 3, 2025
2 parents e8ed7ce + bd05a85 commit ca0bb48
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 35 deletions.
2 changes: 1 addition & 1 deletion assets/preload/data/funnyTips.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ what 5 grams of jordan santiago does to an fnf engine:
What's a debug without a 7? ;)
JS engine aint JavaScript engine
These are some cool pngs
nael2xd says if you go to main menu and press 7 2 times, something cool happens
nael2xd says if you go to main menu and press 7 2 times in the span of 2 seconds, something cool happens
These tips were also inspired by Denpa Engine!
Did you know? The first ever FNF chart that reached over 100mb is Cydonian Sky 2!
FFNFNFN RUN BNTICH REAL ! ! !
Expand Down
Binary file added assets/preload/images/troll.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/preload/sounds/troll.ogg
Binary file not shown.
38 changes: 16 additions & 22 deletions source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -3401,10 +3401,14 @@ class PlayState extends MusicBeatState

if (ClientPrefs.showcaseMode && botplayTxt != null)
{
// formatNumber(Math.abs(totalNotesPlayed))
botplayTxt.text = '${formatNumber(Math.abs(enemyHits))}/${formatNumber(Math.abs(totalNotesPlayed))}\nNPS: ${formatNumber(nps)}/${formatNumber(maxNPS)}\nOpp NPS: ${formatNumber(oppNPS)}/${formatNumber(maxOppNPS)}';
if (polyphonyOppo != 1 || polyphonyBF != 1)
botplayTxt.text += '\nNote Multiplier: ' + formatNumber(polyphonyOppo) + "/" + formatNumber(polyphonyBF);
{
var set:String = formatNumber(polyphonyBF);
if (formatNumber(polyphonyOppo) != formatNumber(polyphonyBF))
set = formatNumber(polyphonyOppo) + "/" + formatNumber(polyphonyBF);
botplayTxt.text += '\nNote Multiplier: ' + set;
}
}

callOnLuas('onUpdate', [elapsed]);
Expand Down Expand Up @@ -3558,20 +3562,19 @@ class PlayState extends MusicBeatState
botplaySine += 180 * elapsed;
botplayTxt.alpha = 1 - Math.sin((Math.PI * botplaySine) / 180 * playbackRate);
}
if((botplayTxt != null && cpuControlled && !ClientPrefs.showcaseMode) && ClientPrefs.randomBotplayText) {
if(botplayTxt.text == "this text is gonna kick you out of botplay in 10 seconds" && !botplayUsed || botplayTxt.text == "Your Botplay Free Trial will end in 10 seconds." && !botplayUsed)
if((botplayTxt != null && cpuControlled && !ClientPrefs.showcaseMode && !botplayUsed) && ClientPrefs.randomBotplayText) {
botplayUsed = true;
if(botplayTxt.text == "this text is gonna kick you out of botplay in 10 seconds" || botplayTxt.text == "Your Botplay Free Trial will end in 10 seconds.")
{
botplayUsed = true;
new FlxTimer().start(10, function(tmr:FlxTimer)
{
cpuControlled = false;
botplayUsed = false;
botplayTxt.visible = false;
});
}
if(botplayTxt.text == "You use botplay? In 10 seconds I knock your botplay thing and text so you'll never use it >:)" && !botplayUsed)
if(botplayTxt.text == "You use botplay? In 10 seconds I knock your botplay thing and text so you'll never use it >:)")
{
botplayUsed = true;
new FlxTimer().start(10, function(tmr:FlxTimer)
{
cpuControlled = false;
Expand All @@ -3581,9 +3584,8 @@ class PlayState extends MusicBeatState
PauseSubState.botplayLockout = true;
});
}
if(botplayTxt.text == "you have 10 seconds to run." && !botplayUsed)
if(botplayTxt.text == "you have 10 seconds to run.")
{
botplayUsed = true;
new FlxTimer().start(10, function(tmr:FlxTimer)
{
#if VIDEOS_ALLOWED
Expand All @@ -3594,15 +3596,14 @@ class PlayState extends MusicBeatState
#end
});
}
if(botplayTxt.text == "you're about to die in 30 seconds" && !botplayUsed)
if(botplayTxt.text == "you're about to die in 30 seconds")
{
botplayUsed = true;
new FlxTimer().start(30, function(tmr:FlxTimer)
{
health = 0;
});
}
if(botplayTxt.text == "3 minutes until Boyfriend steals your liver." && !botplayUsed)
if(botplayTxt.text == "3 minutes until Boyfriend steals your liver.")
{
var title:String = 'Incoming Alert from Boyfriend';
var message:String = '3 minutes until Boyfriend steals your liver!';
Expand All @@ -3612,28 +3613,22 @@ class PlayState extends MusicBeatState
lime.app.Application.current.window.alert(message, title);
FlxG.sound.music.resume();
unpauseVocals();
botplayUsed = true;
new FlxTimer().start(180, function(tmr:FlxTimer)
{
Sys.exit(0);
});
}
if(botplayTxt.text == "[DATA EXPUNGED]" && !botplayUsed)
if(botplayTxt.text == "[DATA EXPUNGED]")
{
new FlxTimer().start(5, function(tmr:FlxTimer)
{
PlatformUtil.sendWindowsNotification('[DATA EXPUNGED]', 'Nice try...');
trace('[DATA EXPUNGED]');
trace('[DATA EXPUNGED]');
trace('[DATA EXPUNGED]');
trace('[DATA EXPUNGED]');
trace('[DATA EXPUNGED]');
trace('[DATA EXPUNGED]'); // he is taking over >:)
for (i in 0...5) trace('[DATA EXPUNGED]'); // he is taking over >:)
Sys.exit(0);
});
}

if(botplayTxt.text == "3 minutes until I steal your liver." && !botplayUsed)
if(botplayTxt.text == "3 minutes until I steal your liver.")
{
var title:String = 'Incoming Alert from Jordan';
var message:String = '3 minutes until I steal your liver.';
Expand All @@ -3642,7 +3637,6 @@ class PlayState extends MusicBeatState

lime.app.Application.current.window.alert(message, title);
unpauseVocals();
botplayUsed = true;
new FlxTimer().start(180, function(tmr:FlxTimer)
{
Sys.exit(0);
Expand Down
62 changes: 50 additions & 12 deletions source/editors/MasterEditorMenu.hx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class MasterEditorMenu extends MusicBeatState
grpTexts.add(leText);
leText.snapToPosition();
}

#if MODS_ALLOWED
var textBG:FlxSprite = new FlxSprite(0, FlxG.height - 42).makeGraphic(FlxG.width, 42, 0xFF000000);
textBG.alpha = 0.6;
Expand All @@ -68,14 +68,15 @@ class MasterEditorMenu extends MusicBeatState
directoryTxt.setFormat(Paths.font("vcr.ttf"), 32, FlxColor.WHITE, CENTER);
directoryTxt.scrollFactor.set();
add(directoryTxt);

for (folder in Paths.getModDirectories())
{
directories.push(folder);
}

var found:Int = directories.indexOf(Paths.currentModDirectory);
if(found > -1) curDirectory = found;
if (found > -1)
curDirectory = found;
changeDirectory();
#end
changeSelection();
Expand All @@ -96,11 +97,11 @@ class MasterEditorMenu extends MusicBeatState
changeSelection(1);
}
#if MODS_ALLOWED
if(controls.UI_LEFT_P)
if (controls.UI_LEFT_P)
{
changeDirectory(-1);
}
if(controls.UI_RIGHT_P)
if (controls.UI_RIGHT_P)
{
changeDirectory(1);
}
Expand All @@ -111,7 +112,8 @@ class MasterEditorMenu extends MusicBeatState

if (controls.ACCEPT)
{
switch(options[curSelected]) {
switch (options[curSelected])
{
case 'Character Editor':
LoadingState.loadAndSwitchState(() -> new CharacterEditorState(Character.DEFAULT_CHARACTER, false));
case 'Week Editor':
Expand All @@ -122,7 +124,7 @@ class MasterEditorMenu extends MusicBeatState
LoadingState.loadAndSwitchState(DialogueCharacterEditorState.new, false);
case 'Dialogue Editor':
LoadingState.loadAndSwitchState(DialogueEditorState.new, false);
case 'Chart Editor'://felt it would be cool maybe
case 'Chart Editor': // felt it would be cool maybe
LoadingState.loadAndSwitchState(ChartingState.new, false);
case 'Note Splash Debug':
LoadingState.loadAndSwitchState(NoteSplashDebugState.new, false);
Expand All @@ -134,7 +136,43 @@ class MasterEditorMenu extends MusicBeatState
FreeplayState.destroyFreeplayVocals();
#end
}


if (FlxG.keys.justPressed.SEVEN)
{
for (i in 1...100)
{
var peep:FlxSprite = new FlxSprite();
var x:Float = FlxG.random.float(-32, 1316);
peep.makeGraphic(32, 32, FlxColor.RED);
peep.x = x;
peep.y = FlxG.random.float(-200, -800);
FlxTween.tween(peep, {x: x + FlxG.random.float(-250, 250), y: 760, angle: FlxG.random.float(-180, 180)}, FlxG.random.float(1.5, 2), {
onComplete: function(e)
{
peep.destroy();
},
ease: FlxEase.expoIn
});
add(peep);
}

var murder:FlxSprite = new FlxSprite();
murder.loadGraphic(Paths.image('troll'));
murder.screenCenter();
new FlxTimer().start(1.5, function(f)
{
FlxTween.tween(murder, {alpha: 0}, 0.5, {
onComplete: function(e)
{
murder.destroy();
}
});
});
add(murder);

FlxG.sound.play(Paths.sound('troll'));
}

var bullShit:Int = 0;
for (item in grpTexts.members)
{
Expand Down Expand Up @@ -172,13 +210,13 @@ class MasterEditorMenu extends MusicBeatState

curDirectory += change;

if(curDirectory < 0)
if (curDirectory < 0)
curDirectory = directories.length - 1;
if(curDirectory >= directories.length)
if (curDirectory >= directories.length)
curDirectory = 0;

WeekData.setDirectoryFromWeek();
if(directories[curDirectory] == null || directories[curDirectory].length < 1)
if (directories[curDirectory] == null || directories[curDirectory].length < 1)
directoryTxt.text = '< No Mod Directory Loaded >';
else
{
Expand Down

2 comments on commit ca0bb48

@JordanSantiagoYT
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

Victim 1

@moxie-coder
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

Victim 1

:trollface:

Please sign in to comment.