Pyro test

This commit is contained in:
Eric Myllyoja 2022-02-28 23:04:55 -05:00
parent c995870bac
commit f2b4dbe751
6 changed files with 78 additions and 16 deletions

View file

@ -725,6 +725,8 @@ class Character extends FlxSprite
public function playAnim(AnimName:String, Force:Bool = false, Reversed:Bool = false, Frame:Int = 0):Void
{
if (animation == null)
return;
animation.play(AnimName, Force, Reversed, Frame);
var daOffset = animOffsets.get(AnimName);

View file

@ -78,6 +78,7 @@ class FreeplayState extends MusicBeatSubstate
#if debug
isDebug = true;
addSong('Test', 1, 'bf-pixel');
addSong('Pyro', 4, 'bf');
#end
var initSonglist = CoolUtil.coolTextFile(Paths.txt('freeplaySonglist'));
@ -517,10 +518,8 @@ class FreeplayState extends MusicBeatSubstate
if (controls.BACK)
{
FlxG.sound.play(Paths.sound('cancelMenu'));
close();
// FlxG.switchState(new MainMenuState());
// close();
FlxG.switchState(new MainMenuState());
}
if (accepted)

View file

@ -117,6 +117,7 @@ class Note extends FlxSprite
var daStage:String = PlayState.curStageId;
// TODO: Make this logic more generic
switch (daStage)
{
case 'school' | 'schoolEvil':
@ -288,18 +289,20 @@ typedef RawNoteData =
var noteData:NoteType;
var sustainLength:Float;
var altNote:Bool;
var noteKind:NoteKind;
}
@:forward
abstract NoteData(RawNoteData)
{
public function new(strumTime = 0.0, noteData:NoteType = 0, sustainLength = 0.0, altNote = false)
public function new(strumTime = 0.0, noteData:NoteType = 0, sustainLength = 0.0, altNote = false, noteKind = NORMAL)
{
this = {
strumTime: strumTime,
noteData: noteData,
sustainLength: sustainLength,
altNote: altNote
altNote: altNote,
noteKind: noteKind
}
}
@ -456,3 +459,13 @@ enum abstract NoteColor(NoteType) from Int to Int from NoteType
}
}
}
enum abstract NoteKind(String) from String to String
{
var NORMAL = "normal";
var PYRO_LIGHT = "pyro_light";
var PYRO_KICK = "pyro_kick";
var PYRO_TOSS = "pyro_toss";
var PYRO_COCK = "pyro_cock"; // lol
var PYRO_SHOOT = "pyro_shoot";
}

View file

@ -84,7 +84,9 @@ class PlayState extends MusicBeatState
private var curSong:String = "";
private var gfSpeed:Int = 1;
private var health:Float = 1;
public static var health:Float = 1;
private var healthDisplay:Float = 1;
private var combo:Int = 0;
@ -156,6 +158,9 @@ class PlayState extends MusicBeatState
{
initCameras();
// Starting health.
health = 1;
persistentUpdate = true;
persistentDraw = true;
@ -171,11 +176,11 @@ class PlayState extends MusicBeatState
switch (SONG.song.toLowerCase())
{
case 'senpai':
dialogue = CoolUtil.coolTextFile(Paths.txt('senpai/senpaiDialogue'));
dialogue = CoolUtil.coolTextFile(Paths.txt('songs/senpai/senpaiDialogue'));
case 'roses':
dialogue = CoolUtil.coolTextFile(Paths.txt('roses/rosesDialogue'));
dialogue = CoolUtil.coolTextFile(Paths.txt('songs/roses/rosesDialogue'));
case 'thorns':
dialogue = CoolUtil.coolTextFile(Paths.txt('thorns/thornsDialogue'));
dialogue = CoolUtil.coolTextFile(Paths.txt('songs/thorns/thornsDialogue'));
}
#if discord_rpc
@ -400,6 +405,10 @@ class PlayState extends MusicBeatState
curStageId = 'mallEvil';
loadStage(curStageId);
case 'pyro':
curStageId = 'pyro';
loadStage(curStageId);
case 'senpai' | 'roses':
curStageId = 'school';
@ -1348,10 +1357,17 @@ class PlayState extends MusicBeatState
gf.dance();
if (swagCounter % 2 == 0)
{
if (!boyfriend.animation.curAnim.name.startsWith("sing"))
boyfriend.playAnim('idle');
if (!dad.animation.curAnim.name.startsWith("sing"))
dad.dance();
if (boyfriend.animation != null)
{
if (!boyfriend.animation.curAnim.name.startsWith("sing"))
boyfriend.playAnim('idle');
}
if (dad.animation != null)
{
if (!dad.animation.curAnim.name.startsWith("sing"))
dad.dance();
}
}
else if (dad.curCharacter == 'spooky' && !dad.animation.curAnim.name.startsWith("sing"))
dad.dance();
@ -1510,8 +1526,9 @@ class PlayState extends MusicBeatState
oldNote = null;
var swagNote:Note = new Note(daStrumTime, daNoteData, oldNote);
swagNote.data.sustainLength = songNotes.sustainLength;
swagNote.data.altNote = songNotes.altNote;
swagNote.data = songNotes;
// swagNote.data.sustainLength = songNotes.sustainLength;
// swagNote.data.altNote = songNotes.altNote;
swagNote.scrollFactor.set(0, 0);
var susLength:Float = swagNote.data.sustainLength;
@ -2127,8 +2144,13 @@ class PlayState extends MusicBeatState
}
else if (daNote.tooLate || daNote.wasGoodHit)
{
// TODO: Why the hell is the noteMiss logic in two different places?
if (daNote.tooLate)
{
if (curStage != null)
{
curStage.onNoteMiss(daNote);
}
health -= 0.0775;
vocals.volume = 0;
killCombo();
@ -2341,6 +2363,12 @@ class PlayState extends MusicBeatState
health += healthMulti;
// TODO: Redo note hit logic to make sure this always gets called
if (curStage != null)
{
curStage.onNoteHit(daNote);
}
if (isSick)
{
var noteSplash:NoteSplash = grpNoteSplashes.recycle(NoteSplash);

View file

@ -188,6 +188,10 @@ class SongLoad
noteStuff[sectionIndex].sectionNotes[noteIndex].noteData = arrayDipshit[1];
noteStuff[sectionIndex].sectionNotes[noteIndex].sustainLength = arrayDipshit[2];
noteStuff[sectionIndex].sectionNotes[noteIndex].altNote = arrayDipshit[3];
if (arrayDipshit.length >= 5)
{
noteStuff[sectionIndex].sectionNotes[noteIndex].noteKind = arrayDipshit[4];
}
}
else if (noteDataArray != null)
{

View file

@ -188,6 +188,22 @@ class Stage extends FlxSpriteGroup implements IHook
// trace('Stage.onUpdate(${elapsed})');
}
/**
* A function that gets called when the player hits a note.
*/
public function onNoteHit(note:Note):Void
{
// Override me in your scripted stage to perform custom behavior!
}
/**
* A function that gets called when the player hits a note.
*/
public function onNoteMiss(note:Note):Void
{
// Override me in your scripted stage to perform custom behavior!
}
/**
* Adjusts the position and other properties of the soon-to-be child of this sprite group.
* Private helper to avoid duplicate code in `add()` and `insert()`.