Skip to content

Commit

Permalink
E A
Browse files Browse the repository at this point in the history
added the title and changed the credits popup text a little bit
added an event that can pop up song credits at anytime
fixed opponent stats not updating fast enough when notes are hit
  • Loading branch information
JordanSantiagoYT committed Nov 4, 2023
1 parent 2b1e00b commit a2f562d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 10 deletions.
6 changes: 2 additions & 4 deletions source/CreditsPopUp.hx
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,13 @@ class CreditsPopUp extends FlxSpriteGroup
public var funnyText:FlxText;
var curHeading:SongHeading;

public function new(x:Float, y:Float)
public function new(x:Float, y:Float, title:String = '', songCreator:String = '')
{
super(x, y);
bg = new FlxSprite().makeGraphic(400, 50, FlxColor.WHITE);
add(bg);
var songCreator:String = '';
var headingPath:SongHeading = null;

songCreator = PlayState.SONG.songCredit;
headingPath = {path: 'JSEHeading', antiAliasing: false, iconOffset: 0};

if (headingPath != null)
Expand All @@ -39,7 +37,7 @@ class CreditsPopUp extends FlxSpriteGroup
bg.antialiasing = headingPath.antiAliasing;
curHeading = headingPath;
}
createHeadingText("Song by" + ' ' + songCreator);
createHeadingText(title + "\nComposed by" + ' ' + songCreator);
if (PlayState.instance != null) bg.color = FlxColor.fromRGB(PlayState.instance.dad.healthColorArray[0], PlayState.instance.dad.healthColorArray[1], PlayState.instance.dad.healthColorArray[2]);

rescaleBG();
Expand Down
32 changes: 26 additions & 6 deletions source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -3750,9 +3750,9 @@ class PlayState extends MusicBeatState
});
FlxG.sound.play(Paths.sound('introGo' + introSoundsSuffix), 0.6);
case 4:
if (SONG.songCredit != null)
if (SONG.songCredit != null && SONG.songCredit != '')
{
var creditsPopup:CreditsPopUp = new CreditsPopUp(FlxG.width, 200);
var creditsPopup:CreditsPopUp = new CreditsPopUp(FlxG.width, 200, SONG.song, SONG.songCredit);
creditsPopup.camera = camHUD;
creditsPopup.scrollFactor.set();
creditsPopup.x = creditsPopup.width * -1;
Expand Down Expand Up @@ -5027,6 +5027,8 @@ if (ClientPrefs.showNPS) {
compactUpdateFrame = 0;
scoreTxtUpdateFrame = 0;

if (deathCounter < 0) botplayTxt.text = 'DEAR GOD YOU OVERFLOWED THE DEATH COUNTER;

if (shownScore != songScore && ClientPrefs.hudType == 'JS Engine' && Math.abs(shownScore - songScore) >= 10) {
shownScore = FlxMath.lerp(shownScore, songScore, 0.4 / (ClientPrefs.framerate / 60));
lerpingScore = true; // Indicate that lerping is in progress
Expand Down Expand Up @@ -5976,10 +5978,6 @@ if (unspawnNotes[0] != null && (Conductor.songPosition + 1800 / songSpeed) >= fi
}
daNote.hitByOpponent = true;

if (opponentDrain && health > 0.1 && !practiceMode || opponentDrain && practiceMode) {
health -= daNote.hitHealth * hpDrainLevel * polyphony;
if (ClientPrefs.healthDisplay && !ClientPrefs.hideScore && scoreTxtUpdateFrame <= 4 && scoreTxt != null) updateScore();
}

callOnLuas('opponentNoteHit', [notes.members.indexOf(daNote), Math.abs(daNote.noteData), daNote.noteType, daNote.isSustainNote]);
callOnLuas((opponentChart ? 'goodNoteHitFix' : 'opponentNoteHitFix'), [notes.members.indexOf(daNote), Math.abs(daNote.noteData), daNote.noteType, daNote.isSustainNote]);
Expand All @@ -6003,6 +6001,12 @@ if (unspawnNotes[0] != null && (Conductor.songPosition + 1800 / songSpeed) >= fi
daNote.destroy();
}
}
if (opponentDrain && health > 0.1 && !practiceMode || opponentDrain && practiceMode) {
health -= daNote.hitHealth * hpDrainLevel * polyphony;
if (ClientPrefs.healthDisplay && !ClientPrefs.hideScore && scoreTxtUpdateFrame <= 4 && scoreTxt != null) updateScore();
}
if (ClientPrefs.ratingCounter && judgeCountUpdateFrame <= 4) updateRatingCounter();
if (ClientPrefs.compactNumbers && compactUpdateFrame <= 4) updateCompactNumbers();
}
if (ClientPrefs.showcaseMode && !ClientPrefs.charsAndBG)
{
Expand Down Expand Up @@ -6406,6 +6410,22 @@ if (unspawnNotes[0] != null && (Conductor.songPosition + 1800 / songSpeed) >= fi
case 'Disable Camera Bop':
camZooming = false;

case 'Credits Popup':
{
var creditsPopup:CreditsPopUp = new CreditsPopUp(FlxG.width, 200, value1, value2);
creditsPopup.camera = camHUD;
creditsPopup.scrollFactor.set();
creditsPopup.x = creditsPopup.width * -1;
add(creditsPopup);

FlxTween.tween(creditsPopup, {x: 0}, 0.5, {ease: FlxEase.backOut, onComplete: function(tweeen:FlxTween)
{
FlxTween.tween(creditsPopup, {x: creditsPopup.width * -1} , 1, {ease: FlxEase.backIn, onComplete: function(tween:FlxTween)
{
creditsPopup.destroy();
}, startDelay: 3});
}});
}
case 'Camera Bopping':
var _interval:Int = Std.parseInt(value1);
if (Math.isNaN(_interval))
Expand Down
1 change: 1 addition & 0 deletions source/editors/ChartingState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ class ChartingState extends MusicBeatState
['Alt Idle Animation', "Sets a specified suffix after the idle animation name.\nYou can use this to trigger 'idle-alt' if you set\nValue 2 to -alt\n\nValue 1: Character to set (Dad, BF or GF)\nValue 2: New suffix (Leave it blank to disable)"],
['Enable Camera Bop', "Enables camera bopping. Useful if you don't want the\nopponent to hit a note, but you want camera bouncing."],
['Disable Camera Bop', "Same thing as 'Enable Camera Bopping', but disables it\ninstead."],
['Credits Popup', "Makes some credits pop up. \n\nValue 1: The title. \nValue 2: The composer(s)"],
['Screen Shake', "Value 1: Camera shake\nValue 2: HUD shake\n\nEvery value works as the following example: \"1, 0.05\".\nThe first number (1) is the duration.\nThe second number (0.05) is the intensity."],
['Camera Bopping', "Makes the camera do funny bopping\n\nValue 1: Bopping Speed (how many beats you want before it bops)\nValue 2: Bopping Intensity (how hard you want it to bop, default is 1)\n\nTo reset camera bopping, place a new event and put both values as '4' and '1' respectively."],
['Change Note Multiplier', "Changes the amount of notes played every time you hit a note.\n\nValue 1: Note Multiplier that you want."],
Expand Down

0 comments on commit a2f562d

Please sign in to comment.