Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transfer hard-coded base-game code into their respective soft-coded areas. #12

Merged
merged 7 commits into from
Nov 5, 2024
Merged
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
2 changes: 1 addition & 1 deletion content/base-game/data/cocoa/cocoa-easy.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"song": {
"player1": "bf-christmas",
"events": [],
"gfVersion": "gf",
"gfVersion": "gf-christmas",
"notes": [
{
"sectionNotes": [
Expand Down
2 changes: 1 addition & 1 deletion content/base-game/data/cocoa/cocoa-hard.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"song": {
"player1": "bf-christmas",
"events": [],
"gfVersion": "gf",
"gfVersion": "gf-christmas",
"notes": [
{
"sectionNotes": [
Expand Down
2 changes: 1 addition & 1 deletion content/base-game/data/cocoa/cocoa.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"song": {
"player1": "bf-christmas",
"events": [],
"gfVersion": "gf",
"gfVersion": "gf-christmas",
"notes": [
{
"sectionNotes": [
Expand Down
2 changes: 1 addition & 1 deletion content/base-game/data/eggnog/eggnog-easy.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"song": {
"player1": "bf-christmas",
"events": [],
"gfVersion": "gf",
"gfVersion": "gf-christmas",
"notes": [
{
"sectionNotes": [],
Expand Down
2 changes: 1 addition & 1 deletion content/base-game/data/eggnog/eggnog-hard.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"song": {
"player1": "bf-christmas",
"events": [],
"gfVersion": "gf",
"gfVersion": "gf-christmas",
"notes": [
{
"sectionNotes": [],
Expand Down
2 changes: 1 addition & 1 deletion content/base-game/data/eggnog/eggnog.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"song": {
"player1": "bf-christmas",
"events": [],
"gfVersion": "gf",
"gfVersion": "gf-christmas",
"notes": [
{
"sectionNotes": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"song": {
"player1": "bf-christmas",
"events": [],
"gfVersion": "gf",
"gfVersion": "gf-christmas",
"notes": [
{
"sectionNotes": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"song": {
"player1": "bf-christmas",
"events": [],
"gfVersion": "gf",
"gfVersion": "gf-christmas",
"notes": [
{
"sectionNotes": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"song": {
"player1": "bf-christmas",
"events": [],
"gfVersion": "gf",
"gfVersion": "gf-christmas",
"notes": [
{
"sectionNotes": [],
Expand Down
30 changes: 30 additions & 0 deletions content/base-game/stages/mall.hx
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
importClass("meta.states.LoadingState");

var heyTimer:Float;
var upperBoppers:BGSprite;
var bottomBoppers:BGSprite;
var santa:BGSprite;

function onLoad(){

var bg:BGSprite = new BGSprite('christmas/bgWalls', -1000, -500, 0.2, 0.2);
bg.setGraphicSize(Std.int(bg.width * 0.8));
bg.updateHitbox();
Expand Down Expand Up @@ -46,6 +49,33 @@ function onCountdownTick(){
santa.dance(true);
}

function onEndSong() {
// Check to see if horrorland is next up in the song list, and that we are in story mode.
if (Paths.formatToSongPath(PlayState.SONG.song) == "eggnog" && PlayState.isStoryMode) {
var blackShit:FlxSprite = new FlxSprite(-FlxG.width * FlxG.camera.zoom,
-FlxG.height * FlxG.camera.zoom).makeGraphic(FlxG.width * 3, FlxG.height * 3, FlxColor.BLACK);
blackShit.scrollFactor.set();
blackShit.cameras = [game.camOther];
add(blackShit);

FlxG.sound.play(Paths.sound('Lights_Shut_off'));

// Begin our transition!
new FlxTimer().start(1.5, (_) -> {
PlayState.campaignScore += game.songScore;
PlayState.campaignMisses += game.songScore;

PlayState.storyPlaylist.remove(PlayState.storyPlaylist[0]);

PlayState.SONG = Song.loadFromJson(PlayState.storyPlaylist[0] + CoolUtil.getDifficultyFilePath(), PlayState.storyPlaylist[0]);
PlayState.cancelMusicFadeTween();
LoadingState.loadAndSwitchState(new PlayState());
});

return Function_Stop;
}
}

function onBeatHit(){
if(!ClientPrefs.lowQuality) {
upperBoppers.dance(true);
Expand Down
109 changes: 103 additions & 6 deletions content/base-game/stages/school.hx
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,106 @@ function onBeatHit(){
}
}

// function popupNumScore(rating, comboSpr, note){
// rating.scale.set(6,6);
// rating.updateHitbox();
// comboSpr.scale.set(6,6);
// comboSpr.updateHitbox();
// }
function doStartCountdown() {
if (PlayState.isStoryMode) {
if (Paths.formatToSongPath(PlayState.SONG.song) == 'roses')
FlxG.sound.play(Paths.sound('ANGRY'));

schoolIntro(doof);

return Function_Stop;
}
}

function schoolIntro(?dialogueBox:DialogueBox):Void {
game.inCutscene = true;
var black:FlxSprite = new FlxSprite(-100, -100).makeGraphic(FlxG.width * 2, FlxG.height * 2, FlxColor.BLACK);
black.scrollFactor.set();
black.cameras = [ game.camHUD ];
add(black);

var red:FlxSprite = new FlxSprite(-100, -100).makeGraphic(FlxG.width * 2, FlxG.height * 2, 0xFFff1b31);
red.cameras = [ game.camOther ];
red.scrollFactor.set();

var senpaiEvil:FlxSprite = new FlxSprite();
senpaiEvil.frames = Paths.getSparrowAtlas('weeb/senpaiCrazy');
senpaiEvil.animation.addByPrefix('idle', 'Senpai Pre Explosion', 24, false);
senpaiEvil.setGraphicSize(Std.int(senpaiEvil.width * 6));
senpaiEvil.scrollFactor.set();
senpaiEvil.updateHitbox();
senpaiEvil.screenCenter();
senpaiEvil.cameras = [ game.camOther ];
senpaiEvil.x += 300;

var songName:String = Paths.formatToSongPath(PlayState.SONG.song);
if (songName == 'roses' || songName == 'thorns')
{
remove(black);

if (songName == 'thorns')
{
add(red);
game.camHUD.visible = false;
}
}

new FlxTimer().start(0.3, function(tmr:FlxTimer)
{
black.alpha -= 0.15;

if (black.alpha > 0)
{
tmr.reset(0.3);
}
else
{
if (dialogueBox != null)
{
if (Paths.formatToSongPath(PlayState.SONG.song) == 'thorns')
{
add(senpaiEvil);
senpaiEvil.alpha = 0;
new FlxTimer().start(0.3, function(swagTimer:FlxTimer)
{
senpaiEvil.alpha += 0.15;
if (senpaiEvil.alpha < 1)
{
swagTimer.reset();
}
else
{
senpaiEvil.animation.play('idle');
FlxG.sound.play(Paths.sound('Senpai_Dies'), 1, false, null, true, function()
{
// Just incase...
senpaiEvil.alpha = 0.001;
red.alpha = 0.001;

remove(senpaiEvil);
remove(red);
game.camOther.fade(FlxColor.WHITE, 0.01, true, function()
{
add(dialogueBox);
game.camHUD.visible = true;
}, true);
});
new FlxTimer().start(3.2, function(deadTime:FlxTimer)
{
game.camOther.fade(FlxColor.WHITE, 1.6, false);
});
}
});
}
else
{
add(dialogueBox);
}
}
else
game.startCountdown();

remove(black);
}
});
}
104 changes: 104 additions & 0 deletions content/base-game/stages/schoolEvil.hx
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,108 @@ function onEvent(eventName, value1, value2){
bgGhouls.visible = true;
trace('Triggered BG Ghouls');
}
}

function doStartCountdown() {
if (PlayState.isStoryMode) {
if (Paths.formatToSongPath(PlayState.SONG.song) == 'roses')
FlxG.sound.play(Paths.sound('ANGRY'));

schoolIntro(doof);

return Function_Stop;
}
}

function schoolIntro(?dialogueBox:DialogueBox):Void {
game.inCutscene = true;
var black:FlxSprite = new FlxSprite(-100, -100).makeGraphic(FlxG.width * 2, FlxG.height * 2, FlxColor.BLACK);
black.scrollFactor.set();
black.cameras = [ game.camHUD ];
add(black);

var red:FlxSprite = new FlxSprite(-100, -100).makeGraphic(FlxG.width * 2, FlxG.height * 2, 0xFFff1b31);
red.cameras = [ game.camOther ];
red.scrollFactor.set();

var senpaiEvil:FlxSprite = new FlxSprite();
senpaiEvil.frames = Paths.getSparrowAtlas('weeb/senpaiCrazy');
senpaiEvil.animation.addByPrefix('idle', 'Senpai Pre Explosion', 24, false);
senpaiEvil.setGraphicSize(Std.int(senpaiEvil.width * 6));
senpaiEvil.scrollFactor.set();
senpaiEvil.updateHitbox();
senpaiEvil.screenCenter();
senpaiEvil.cameras = [ game.camOther ];
senpaiEvil.x += 300;

var songName:String = Paths.formatToSongPath(PlayState.SONG.song);
if (songName == 'roses' || songName == 'thorns')
{
remove(black);

if (songName == 'thorns')
{
add(red);
game.camHUD.visible = false;
}
}

new FlxTimer().start(0.3, function(tmr:FlxTimer)
{
black.alpha -= 0.15;

if (black.alpha > 0)
{
tmr.reset(0.3);
}
else
{
if (dialogueBox != null)
{
if (Paths.formatToSongPath(PlayState.SONG.song) == 'thorns')
{
add(senpaiEvil);
senpaiEvil.alpha = 0;
new FlxTimer().start(0.3, function(swagTimer:FlxTimer)
{
senpaiEvil.alpha += 0.15;
if (senpaiEvil.alpha < 1)
{
swagTimer.reset();
}
else
{
senpaiEvil.animation.play('idle');
FlxG.sound.play(Paths.sound('Senpai_Dies'), 1, false, null, true, function()
{
// Just incase...
senpaiEvil.alpha = 0.001;
red.alpha = 0.001;

remove(senpaiEvil);
remove(red);
game.camOther.fade(FlxColor.WHITE, 0.01, true, function()
{
add(dialogueBox);
game.camHUD.visible = true;
}, true);
});
new FlxTimer().start(3.2, function(deadTime:FlxTimer)
{
game.camOther.fade(FlxColor.WHITE, 1.6, false);
});
}
});
}
else
{
add(dialogueBox);
}
}
else
game.startCountdown();

remove(black);
}
});
}
Loading