Skip to content

Commit

Permalink
hold animations
Browse files Browse the repository at this point in the history
now the wack animations on sustains can not be wack
  • Loading branch information
TheRealJake12 committed Oct 4, 2024
1 parent 628c01b commit 6151eb8
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 15 deletions.
Binary file added assets/shared/images/credshit/jake.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 removed assets/shared/images/credshit/meredo.png
Binary file not shown.
3 changes: 3 additions & 0 deletions source/kec/backend/Constants.hx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ class Constants
public static final defaultBF:String = 'bf';
public static final defaultOP:String = 'dad';
public static final defaultGF:String = 'gf';
// Note Animation Names
public static final noteColors:Array<String> = ['purple', 'blue', 'green', 'red'];
// Animation Names
public static final singAnimations:Array<String> = ['singLEFT', 'singDOWN', 'singUP', 'singRIGHT'];

public static final discordRpc:String = "898970552600002561";
}
2 changes: 1 addition & 1 deletion source/kec/backend/Ratings.hx
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ class RatingWindow
var missArray:Array<Bool> = [false, false, false, false, false];
var splashArray:Array<Bool> = [false, false, false, true, true];
var suffixes:Array<String> = ['s', 's', 's', 's', 's'];
var combos:Array<String> = ['', 'FC', 'GFC', 'PFC', 'MFC'];
var combos:Array<String> = ['FC', 'FC', 'GFC', 'PFC', 'MFC'];
for (i in 0...ratings.length)
{
var rClass = new RatingWindow(ratings[i], timings[i], combos[i], colors[i], healthBonuses[i], scoreBonuses[i], acc[i], missArray[i],
Expand Down
35 changes: 22 additions & 13 deletions source/kec/states/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,6 @@ class PlayState extends MusicBeatState
var allowedToHeadbang:Bool = true; // Will decide if gf is allowed to headbang depending on the song
var allowedToCheer:Bool = false; // Will decide if gf is allowed to cheer depending on the song

// Note Animation Suffixes.
private var dataSuffix:Array<String> = ['LEFT', 'DOWN', 'UP', 'RIGHT'];

// Tracks The Last Score (I Don't Know What It Does.)
public static var lastScore:Array<FlxSprite> = [];

Expand Down Expand Up @@ -1590,15 +1587,14 @@ class PlayState extends MusicBeatState
if (PlayStateChangeables.opponentMode)
char = dad;

if (char.animOffsets.exists('sing' + dataSuffix[direction] + 'miss'))
char.playAnim('sing' + dataSuffix[direction] + 'miss', true);
if (char.animOffsets.exists(Constants.singAnimations[direction] + 'miss'))
char.playAnim(Constants.singAnimations[direction] + 'miss', true);

if (FlxG.save.data.missSounds)
{
var num = FlxG.random.int(1, 3);
FlxG.sound.play(Paths.sound('styles/$styleName/missnote$num'), FlxG.random.float(0.1, 0.2));
}
boyfriend.playAnim('sing' + dataSuffix[direction] + 'miss', true);
if (!SONG.splitVoiceTracks)
vocals.volume = 0;
else
Expand Down Expand Up @@ -2635,7 +2631,7 @@ class PlayState extends MusicBeatState
&& daNote.sustainActive
&& !daNote.isSustainEnd
&& daNote.causesMisses
&& !holdArray[Std.int(Math.abs(daNote.noteData))])
&& !holdArray[daNote.noteData])
{
// there should be a ! infront of the wasGoodHit one but it'd cause a miss per every sustain note.
// now it just misses on the slightest sustain end for some reason.
Expand Down Expand Up @@ -3180,8 +3176,8 @@ class PlayState extends MusicBeatState
if (PlayStateChangeables.opponentMode)
char = dad;

if (char.animOffsets.exists('sing' + dataSuffix[direction] + 'miss'))
char.playAnim('sing' + dataSuffix[direction] + 'miss', true);
if (char.animOffsets.exists(Constants.singAnimations[direction] + 'miss'))
char.playAnim(Constants.singAnimations[direction] + 'miss', true);

#if FEATURE_LUAMODCHART
if (luaModchart != null)
Expand Down Expand Up @@ -3291,7 +3287,7 @@ class PlayState extends MusicBeatState

if (!daNote.isSustainEnd)
{
var singData:Int = Std.int(Math.abs(daNote.noteData));
final singData:Int = daNote.noteData;

if (daNote.canPlayAnims)
{
Expand All @@ -3301,8 +3297,14 @@ class PlayState extends MusicBeatState

if (daNote.noteType.toLowerCase() == 'gf' && gf != null)
char = gf;

char.playAnim('sing' + dataSuffix[daNote.noteData] + altAnim, true);
var animToPlay:String = Constants.singAnimations[daNote.noteData] + altAnim;
if (daNote.isSustainNote)
{
var holdAnim:String = animToPlay + '-hold';
if (char.animOffsets.exists(holdAnim))
animToPlay = holdAnim;
}
char.playAnim(animToPlay, true);
char.holdTimer = 0;
}

Expand Down Expand Up @@ -3423,7 +3425,14 @@ class PlayState extends MusicBeatState
if (note.noteType.toLowerCase() == 'gf' && gf != null)
char = gf;

char.playAnim('sing' + dataSuffix[note.noteData] + altAnim, true);
var animToPlay:String = Constants.singAnimations[note.noteData] + altAnim;
if (note.isSustainNote)
{
var holdAnim:String = animToPlay + '-hold';
if (char.animOffsets.exists(holdAnim))
animToPlay = holdAnim;
}
char.playAnim(animToPlay, true);
char.holdTimer = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion source/kec/states/TitleState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class TitleState extends MusicBeatState

credTextShit.visible = false;

ngSpr = new FlxSprite(0, FlxG.height * 0.52).loadGraphic(Paths.image('credshit/meredo'));
ngSpr = new FlxSprite(0, FlxG.height * 0.52).loadGraphic(Paths.image('credshit/jake'));
add(ngSpr);
ngSpr.alpha = 0;
ngSpr.setGraphicSize(Std.int(ngSpr.width * 0.8));
Expand Down

0 comments on commit 6151eb8

Please sign in to comment.