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

[ENHANCEMENT] Reformat every script #113

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
49 changes: 27 additions & 22 deletions preload/scripts/characters/bf-christmas.hxc
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,33 @@ import funkin.play.character.MultiSparrowCharacter;
import funkin.play.character.CharacterType;
import funkin.play.GameOverSubState;

class BoyfriendChristmasCharacter extends MultiSparrowCharacter {
function new() {
super('bf-christmas');
}
class BoyfriendChristmasCharacter extends MultiSparrowCharacter
{
function new()
{
super('bf-christmas');
}

function onNoteHit(event:HitNoteScriptEvent)
{
if (event.eventCanceled) {
// onNoteHit event was cancelled by the gameplay module.
return;
}
function onNoteHit(event:HitNoteScriptEvent)
{
if (event.eventCanceled)
{
// onNoteHit event was cancelled by the gameplay module.
return;
}

if (event.note.noteData.getMustHitNote() && characterType == CharacterType.BF) {
// Override the hit note animation.
switch(event.note.kind) {
case "censor":
holdTimer = 0;
this.playSingAnimation(event.note.noteData.getDirection(), false, 'censor');
return;
default:
super.onNoteHit(event);
}
}
}
if (event.note.noteData.getMustHitNote() && characterType == CharacterType.BF)
{
// Override the hit note animation.
switch (event.note.kind)
{
case "censor":
holdTimer = 0;
this.playSingAnimation(event.note.noteData.getDirection(), false, 'censor');
return;
default:
super.onNoteHit(event);
}
}
}
}
60 changes: 32 additions & 28 deletions preload/scripts/characters/bf-dark.hxc
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,44 @@ import funkin.play.character.CharacterType;
import funkin.play.PlayState;
import funkin.play.character.MultiSparrowCharacter;

class BoyfriendDarkCharacter extends MultiSparrowCharacter {
function new() {
super('bf-dark');
}
class BoyfriendDarkCharacter extends MultiSparrowCharacter
{
function new()
{
super('bf-dark');
}

var normalChar:BaseCharacter;

override function set_alpha(val:Float):Float{
super.set_alpha(val);
if(val != 1)
normalChar.alpha = 1;
else
normalChar.alpha = 0;
override function set_alpha(val:Float):Float
{
super.set_alpha(val);
if (val != 1) normalChar.alpha = 1;
else
normalChar.alpha = 0;

return val;
}

override function playAnimation(name:String, restart:Bool, ignoreOther:Bool) {
super.playAnimation(name, restart, ignoreOther);
if(normalChar != null){
normalChar.playAnimation(name, restart, ignoreOther);
normalChar.setPosition(this.x, this.y);
}
}

function onCreate(event:ScriptEvent) {
super.onCreate(event);
normalChar = CharacterDataParser.fetchCharacter('bf');
}

override function playAnimation(name:String, restart:Bool, ignoreOther:Bool)
{
super.playAnimation(name, restart, ignoreOther);
if (normalChar != null)
{
normalChar.playAnimation(name, restart, ignoreOther);
normalChar.setPosition(this.x, this.y);
}
}

function onCreate(event:ScriptEvent)
{
super.onCreate(event);
normalChar = CharacterDataParser.fetchCharacter('bf');
normalChar.zIndex = 199;
normalChar.alpha = 0;
normalChar.alpha = 0;
normalChar.flipX = false;

PlayState.instance.currentStage.add(normalChar);
PlayState.instance.currentStage.refresh(); // Apply z-index.
}

PlayState.instance.currentStage.add(normalChar);
PlayState.instance.currentStage.refresh(); // Apply z-index.
}
}
23 changes: 13 additions & 10 deletions preload/scripts/characters/bf-pixel.hxc
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,20 @@ import funkin.play.PauseSubState;
import flixel.FlxSprite;
import flixel.FlxG;

class BFPixelCharacter extends MultiSparrowCharacter {
function new() {
super('bf-pixel');
}
class BFPixelCharacter extends MultiSparrowCharacter
{
function new()
{
super('bf-pixel');
}

function onCreate(event:ScriptEvent) {
super.onCreate(event);
function onCreate(event:ScriptEvent)
{
super.onCreate(event);

GameOverSubState.musicSuffix = '-pixel';
GameOverSubState.blueBallSuffix = '-pixel';
GameOverSubState.musicSuffix = '-pixel';
GameOverSubState.blueBallSuffix = '-pixel';

PauseSubState.musicSuffix = '-pixel';
}
PauseSubState.musicSuffix = '-pixel';
}
}
47 changes: 27 additions & 20 deletions preload/scripts/characters/bf.hxc
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,44 @@ import funkin.audio.FunkinSound;
import funkin.play.character.MultiSparrowCharacter;
import funkin.play.GameOverSubState;

class BoyfriendCharacter extends MultiSparrowCharacter {
function new() {
super('bf');
}
class BoyfriendCharacter extends MultiSparrowCharacter
{
function new()
{
super('bf');
}

override function playAnimation(name:String, restart:Bool, ignoreOther:Bool) {
if (name == "fakeoutDeath" && !this.debug) {
doFakeoutDeath();
} else {
super.playAnimation(name, restart, ignoreOther);
}
}
override function playAnimation(name:String, restart:Bool, ignoreOther:Bool)
{
if (name == "fakeoutDeath" && !this.debug)
{
doFakeoutDeath();
}
else
{
super.playAnimation(name, restart, ignoreOther);
}
}

function doFakeoutDeath():Void {
FunkinSound.playOnce(Paths.sound("gameplay/gameover/fakeout_death"), 1.0);
function doFakeoutDeath():Void
{
FunkinSound.playOnce(Paths.sound("gameplay/gameover/fakeout_death"), 1.0);

var bfFakeout:FlxAtlasSprite = new FlxAtlasSprite(this.x - 440, this.y - 240, Paths.animateAtlas("characters/bfFakeOut", "shared"));
var bfFakeout:FlxAtlasSprite = new FlxAtlasSprite(this.x - 440, this.y - 240, Paths.animateAtlas("characters/bfFakeOut", "shared"));
FlxG.state.subState.add(bfFakeout);
bfFakeout.zIndex = 1000;
bfFakeout.zIndex = 1000;
bfFakeout.playAnimation('');
// We don't want people to miss this.
FlxG.state.subState.mustNotExit = true;
// We don't want people to miss this.
FlxG.state.subState.mustNotExit = true;
bfFakeout.onAnimationComplete.add(() -> {
bfFakeout.visible = false;
this.visible = true;
FlxG.state.subState.mustNotExit = false;
FlxG.state.subState.mustNotExit = false;
this.playAnimation('firstDeath', true, true);
// Play the "blue balled" sound. May play a variant if one has been assigned.
GameOverSubState.playBlueBalledSFX();
});
bfFakeout.visible = true;
this.visible = false;
}
this.visible = false;
}
}
Loading