From 672e3d6970417844c73bb98ddd2dea50760b6e8f Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Sat, 10 Apr 2021 18:23:56 -0400 Subject: [PATCH] ugh and stress animations --- source/Character.hx | 22 ++++++++++++++++------ source/ChartingState.hx | 23 +++++++++++++++++++++-- source/Note.hx | 8 ++++++-- source/PlayState.hx | 4 ++++ 4 files changed, 47 insertions(+), 10 deletions(-) diff --git a/source/Character.hx b/source/Character.hx index bd38df331..356eb1639 100644 --- a/source/Character.hx +++ b/source/Character.hx @@ -457,25 +457,31 @@ class Character extends FlxSprite if (isPlayer) { - quickAnimAdd('singLEFT', 'Tankman Note Left0'); - quickAnimAdd('singRIGHT', 'Tankman Right Note0'); + quickAnimAdd('singLEFT', 'Tankman Note Left '); + quickAnimAdd('singRIGHT', 'Tankman Right Note '); quickAnimAdd('singLEFTmiss', 'Tankman Note Left MISS'); quickAnimAdd('singRIGHTmiss', 'Tankman Right Note MISS'); } else { // Need to be flipped! REDO THIS LATER - quickAnimAdd('singLEFT', 'Tankman Right Note0'); - quickAnimAdd('singRIGHT', 'Tankman Note Left0'); + quickAnimAdd('singLEFT', 'Tankman Right Note '); + quickAnimAdd('singRIGHT', 'Tankman Note Left '); quickAnimAdd('singLEFTmiss', 'Tankman Right Note MISS'); quickAnimAdd('singRIGHTmiss', 'Tankman Note Left MISS'); } - quickAnimAdd('singUP', 'Tankman UP note0'); - quickAnimAdd('singDOWN', 'Tankman DOWN note0'); + quickAnimAdd('singUP', 'Tankman UP note '); + quickAnimAdd('singDOWN', 'Tankman DOWN note '); quickAnimAdd('singUPmiss', 'Tankman UP note MISS'); quickAnimAdd('singDOWNmiss', 'Tankman DOWN note MISS'); + // PRETTY GOOD tankman + // TANKMAN UGH instanc + + quickAnimAdd('singDOWN-alt', 'PRETTY GOOD'); + quickAnimAdd('singUP-alt', 'TANKMAN UGH'); + loadOffsetFile(curCharacter); playAnim('idle'); @@ -637,6 +643,10 @@ class Character extends FlxSprite // lol weed // playAnim('shoot' + FlxG.random.int(1, 4), true); + case 'tankman': + if (!animation.curAnim.name.endsWith('DOWN-alt')) + playAnim('idle'); + case 'spooky': danced = !danced; diff --git a/source/ChartingState.hx b/source/ChartingState.hx index 49ab32380..d36521a6b 100644 --- a/source/ChartingState.hx +++ b/source/ChartingState.hx @@ -478,6 +478,9 @@ class ChartingState extends MusicBeatState strumLine.y = getYfromStrum((Conductor.songPosition - sectionStartTime()) % (Conductor.stepCrochet * _song.notes[curSection].lengthInSteps)); + if (FlxG.keys.justPressed.X) + toggleAltAnimNote(); + if (curBeat % 4 == 0 && curStep >= 16 * (curSection + 1)) { trace(curStep); @@ -686,6 +689,21 @@ class ChartingState extends MusicBeatState updateGrid(); } + function toggleAltAnimNote():Void + { + if (curSelectedNote != null) + { + if (curSelectedNote[3] != null) + { + trace('ALT NOTE SHIT'); + curSelectedNote[3] = !curSelectedNote[3]; + trace(curSelectedNote[3]); + } + else + curSelectedNote[3] = true; + } + } + function recalculateSteps():Int { var lastChange:BPMChangeEvent = { @@ -945,14 +963,15 @@ class ChartingState extends MusicBeatState var noteStrum = getStrumTime(dummyArrow.y) + sectionStartTime(); var noteData = Math.floor(FlxG.mouse.x / GRID_SIZE); var noteSus = 0; + var noteAlt = false; - _song.notes[curSection].sectionNotes.push([noteStrum, noteData, noteSus]); + _song.notes[curSection].sectionNotes.push([noteStrum, noteData, noteSus, noteAlt]); curSelectedNote = _song.notes[curSection].sectionNotes[_song.notes[curSection].sectionNotes.length - 1]; if (FlxG.keys.pressed.CONTROL) { - _song.notes[curSection].sectionNotes.push([noteStrum, (noteData + 4) % 8, noteSus]); + _song.notes[curSection].sectionNotes.push([noteStrum, (noteData + 4) % 8, noteSus, noteAlt]); } trace(noteStrum); diff --git a/source/Note.hx b/source/Note.hx index 6e6eb127d..325529a2a 100644 --- a/source/Note.hx +++ b/source/Note.hx @@ -25,8 +25,12 @@ class Note extends FlxSprite public var tooLate:Bool = false; public var wasGoodHit:Bool = false; public var prevNote:Note; + private var willMiss:Bool = false; + public var altNote:Bool = false; + public var invisNote:Bool = false; + public var sustainLength:Float = 0; public var isSustainNote:Bool = false; @@ -210,11 +214,11 @@ class Note extends FlxSprite else { if (strumTime > Conductor.songPosition - Conductor.safeZoneOffset) - { // The * 0.5 is so that it's easier to hit them too late, instead of too early + { // The * 0.5 is so that it's easier to hit them too late, instead of too early if (strumTime < Conductor.songPosition + (Conductor.safeZoneOffset * 0.5)) canBeHit = true; } - else + else { canBeHit = true; willMiss = true; diff --git a/source/PlayState.hx b/source/PlayState.hx index 2774676f9..25a4ffcae 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -1578,6 +1578,7 @@ class PlayState extends MusicBeatState var swagNote:Note = new Note(daStrumTime, daNoteData, oldNote); swagNote.sustainLength = songNotes[2]; + swagNote.altNote = songNotes[3]; swagNote.scrollFactor.set(0, 0); var susLength:Float = swagNote.sustainLength; @@ -2146,6 +2147,9 @@ class PlayState extends MusicBeatState altAnim = '-alt'; } + if (daNote.altNote) + altAnim = '-alt'; + switch (Math.abs(daNote.noteData)) { case 0: