Skip to content
This repository has been archived by the owner on Jul 9, 2023. It is now read-only.

Custom note speed #240

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions source/Note.hx
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ class Note extends FlxSprite
public var noMissAnimation:Bool = false;
public var hitCausesMiss:Bool = false;
public var distance:Float = 2000; //plan on doing scroll directions soon -bb
public var scrollMult:Float = 1;

public var hitsoundDisabled:Bool = false;

Expand Down Expand Up @@ -196,9 +197,7 @@ class Note extends FlxSprite
hitCausesMiss = false;
hitHealth += 0.020;
chartSound = 'yay';
precacheThis = [
['yay', 'sound']
];
precacheThis = [['yay', 'sound']];

case 'Crash Note':
ignoreNote = mustPress;
Expand All @@ -208,8 +207,7 @@ class Note extends FlxSprite
colorSwap.saturation = 0;
colorSwap.brightness = 0;
hitCausesMiss = true;
precacheThis = [
['wiicrash', 'sound']];
precacheThis = [['wiicrash', 'sound']];

case 'Window Note':
ignoreNote = mustPress;
Expand Down Expand Up @@ -239,6 +237,15 @@ class Note extends FlxSprite
colorSwap.brightness = 0;
hitCausesMiss = true;

case 'Slow Note': // just a normal note :trollface:
scrollMult = 0.56;

case 'Fast Note':
scrollMult = 1.56;

case 'Inverse Scroll Note':
scrollMult = -1;

case 'Alt Animation':
animSuffix = '-alt';

Expand Down
53 changes: 23 additions & 30 deletions source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -3414,15 +3414,15 @@ class PlayState extends MusicBeatState
strumAngle += daNote.offsetAngle;
strumAlpha *= daNote.multAlpha;

if (strumScroll) //Downscroll
if (strumScroll) //Downscroll FUCK! THIS IS THE NOTES CUSTOM SCROLL SPEED!!
{
//daNote.y = (strumY + 0.45 * (Conductor.songPosition - daNote.strumTime) * songSpeed);
daNote.distance = (0.45 * (Conductor.songPosition - daNote.strumTime) * songSpeed * daNote.multSpeed);
daNote.y = (strumY + 0.45 * (Conductor.songPosition - daNote.strumTime) * songSpeed);
daNote.distance = (0.45 * (Conductor.songPosition - daNote.strumTime) * (songSpeed * daNote.scrollMult) * daNote.multSpeed);
}
else //Upscroll
{
//daNote.y = (strumY - 0.45 * (Conductor.songPosition - daNote.strumTime) * songSpeed);
daNote.distance = (-0.45 * (Conductor.songPosition - daNote.strumTime) * songSpeed * daNote.multSpeed);
daNote.y = (strumY - 0.45 * (Conductor.songPosition - daNote.strumTime) * songSpeed);
daNote.distance = (-0.45 * (Conductor.songPosition - daNote.strumTime) * (songSpeed * daNote.scrollMult) * daNote.multSpeed); // multSpeed changes the size, scrollMult doesnt
}

var angleDir = strumDirection * Math.PI / 180;
Expand Down Expand Up @@ -3515,7 +3515,7 @@ class PlayState extends MusicBeatState

#if debug
if(!endingSong && !startingSong) {
if (FlxG.keys.justPressed.ONE) {
if (FlxG.keys.justPressed.ONE) { // finish song :O
KillNotes();
FlxG.sound.music.onComplete();
}
Expand Down Expand Up @@ -3638,7 +3638,7 @@ class PlayState extends MusicBeatState
return pressed;
}

public function triggerEventNote(eventName:String, value1:String = '', value2:String = '', value3:String = '') {
public function triggerEventNote(eventName:String = '', value1:String = '', value2:String = '', value3:String = '') {
var theValue1:String = value1.toLowerCase().trim();
var theValue2:String = value2.toLowerCase().trim();
var theValue3:String = value3.toLowerCase().trim();
Expand Down Expand Up @@ -4032,7 +4032,7 @@ class PlayState extends MusicBeatState
case 'Add Shader':
if(!ClientPrefs.shaders) return;

var theEffects:Array<String> = value3.split(',');
var theEffects:Array<String> = value3.replace(' ', '').split(',');
var theFloatEffects:Array<Float> = [];
for (effect in theEffects) {
if(!Math.isNaN(Std.parseFloat(effect)))
Expand Down Expand Up @@ -4369,7 +4369,7 @@ class PlayState extends MusicBeatState
}

var things:Array<String> = ['sick', 'good', 'bad', 'shit', 'combo'];
for(thing in things)
for (thing in things)
Paths.image(pixelShitPart1 + thing + pixelShitPart2);

for (i in 0...10)
Expand Down Expand Up @@ -4832,8 +4832,7 @@ class PlayState extends MusicBeatState
doDeathCheck(true);
}


if (combo > 5 && gf != null && gf.animOffsets.exists('sad'))
if (combo > 5 && gf != null && gf.contains('sad'))
{
gf.playAnim('sad');
}
Expand All @@ -4859,7 +4858,7 @@ class PlayState extends MusicBeatState
});
*/

if(boyfriend.hasMissAnimations && boyfriend.animOffsets.exists(singAnimations[Std.int(Math.abs(direction))] + 'miss')) {
if(boyfriend.hasMissAnimations && boyfriend.contains(singAnimations[Std.int(Math.abs(direction))] + 'miss')) {
boyfriend.playAnim(singAnimations[Std.int(Math.abs(direction))] + 'miss', true);
}
vocals.volume = 0;
Expand Down Expand Up @@ -4911,7 +4910,7 @@ class PlayState extends MusicBeatState
char = gf;
}

if(char != null && char.animOffsets.exists(animToPlay))
if(char != null && char.contains(animToPlay))
{
char.playAnim(animToPlay, true);
char.holdTimer = 0;
Expand Down Expand Up @@ -5042,31 +5041,25 @@ class PlayState extends MusicBeatState
}

var animToPlay:String = singAnimations[Std.int(Math.abs(note.noteData))];
var char:Character = boyfriend;
if(note.gfNote)
char = gf;

if(note.gfNote)
{
if(gf != null && gf.animOffsets.exists(animToPlay + note.animSuffix)) {
gf.playAnim(animToPlay + note.animSuffix, true);
gf.holdTimer = 0;
}
}
else
if(char != null && char.contains(animToPlay + note.animSuffix))
{
if(boyfriend.animOffsets.exists(animToPlay + note.animSuffix)) {
boyfriend.playAnim(animToPlay + note.animSuffix, true);
boyfriend.holdTimer = 0;
}
char.playAnim(animToPlay + note.animSuffix, true);
char.holdTimer = 0;
}

if(note.noteType == 'Hey!') {
if(boyfriend.animOffsets.exists('hey')) {
if(boyfriend.contains('hey')) {
boyfriend.playAnim('hey', true);
boyfriend.specialAnim = true;
boyfriend.heyTimer = 0.6;
}

if(gf != null && (gf.animOffsets.exists('cheer') || gf.animOffsets.exists('hey'))) {
if(gf.animOffsets.exists('cheer')) gf.playAnim('cheer', true);
if(gf != null && (gf.contains('cheer') || gf.contains('hey'))) {
if(gf.contains('cheer')) gf.playAnim('cheer', true);
else gf.playAnim('hey', true);

gf.specialAnim = true;
Expand Down Expand Up @@ -5184,7 +5177,7 @@ class PlayState extends MusicBeatState
if (trainSound.time >= 4700)
{
startedMoving = true;
if (gf != null && gf.animOffsets.exists('hairBlow'))
if (gf != null && gf.contains('hairBlow'))
{
gf.playAnim('hairBlow');
gf.specialAnim = true;
Expand All @@ -5211,7 +5204,7 @@ class PlayState extends MusicBeatState

function trainReset():Void
{
if(gf != null && gf.animOffsets.exists('hairFall'))
if(gf != null && gf.contains('hairFall'))
{
gf.danced = false; //Sets head to the correct position once the animation ends
gf.playAnim('hairFall');
Expand Down
3 changes: 3 additions & 0 deletions source/editors/ChartingState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ class ChartingState extends MusicBeatState
'Healthy Note',
'Poisoned Note',
'Crash Note', //so we can actually test it -DEMOLITIONDON96 // Wait, that released right ? -Theoyeah // Wait, what do you mean? -Wither362
'Slow Note',
'Fast Note',
'Inverse Scroll Note',
'GF Sing',
'No Animation'
];
Expand Down