Skip to content

Commit

Permalink
Module update and other fun stuff (read update log)
Browse files Browse the repository at this point in the history
  • Loading branch information
AFunkinDisappointment committed Jun 12, 2023
1 parent fe5c492 commit 3c75f2e
Show file tree
Hide file tree
Showing 32 changed files with 1,040 additions and 519 deletions.
Binary file modified .vs/slnx.sqlite
Binary file not shown.
1 change: 1 addition & 0 deletions Project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@

<assets path="CHANGELOG.md"/>
<assets path="USER-README.txt"/>
<assets path="updateLog.txt"/>
<!-- NOTE FOR FUTURE SELF SINCE FONTS ARE ALWAYS FUCKY
TO FIX ONE OF THEM, I CONVERTED IT TO OTF. DUNNO IF YOU NEED TO
THEN UHHH I USED THE NAME OF THE FONT WITH SETFORMAT() ON THE TEXT!!!
Expand Down
Binary file added assets/images/Look gary there I am.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/images/custom_ui/ui_layouts/classic.hscript
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// The plain and simple FNF ui
// Only the score is shown

function start(song) {
difficTxt.visible = false;

Expand Down
3 changes: 3 additions & 0 deletions assets/images/custom_ui/ui_layouts/legacy.hscript
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// going back to when Modding Plus was just starting
// pretty nostalgic

var healthTxt;
var accuracyTxt;
function start(song) {
Expand Down
3 changes: 2 additions & 1 deletion assets/images/custom_ui/ui_layouts/psych.hscript
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// this ui layout is based off Psych Engine
// all credit goes to the cool people who made it
// highly recommend downloading it
// way better than this engine 😅
// https://gamebanana.com/mods/309789

var songLength;
Expand Down Expand Up @@ -59,7 +60,7 @@ function start(song) {
}

function stepHit(step) {
if (step == 1)
if (songLength == null)
songLength = FlxG.sound.music.length;
}

Expand Down
2 changes: 1 addition & 1 deletion assets/images/custom_ui/ui_packs/normal/NOTE_assets.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<SubTexture name="left press0017" x="374" y="470" width="146" height="149"/>
<SubTexture name="left press0018" x="374" y="470" width="146" height="149"/>
<SubTexture name="left press0019" x="374" y="470" width="146" height="149"/>
<SubTexture name="pruple end hold0000" x="520" y="470" width="50" height="64"/>
<SubTexture name="purple hold end0000" x="520" y="470" width="50" height="64"/>
<SubTexture name="purple0000" x="570" y="470" width="154" height="157"/>
<SubTexture name="purple hold piece0000" x="724" y="470" width="50" height="44"/>
<SubTexture name="purple lift0000" x="774" y="470" width="154" height="157"/>
Expand Down
Binary file added assets/images/plainbox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 13 additions & 5 deletions source/AnimationDebug.hx
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,19 @@ import flixel.addons.ui.FlxInputText;
import flixel.addons.ui.FlxUIInputText;
import flixel.ui.FlxButton;

/**
*DEBUG MODE
*/
typedef HScriptStorage = {
var type:String;
var line:Int;
var values:Array<Dynamic>;
};

class AnimationDebug extends FlxState
{
var bf:Character;
var bfHScript = FNFAssets.getText('assets/images/custom_chars/bf/char.xml');
var bfText:FlxUIInputText;
var dad:Character;
var dadHScript = FNFAssets.getText('assets/images/custom_chars/dad/char.xml');
var dadText:FlxUIInputText;
var loadCharButton:FlxButton;
var char:Character;
Expand All @@ -42,11 +47,12 @@ class AnimationDebug extends FlxState
private var camBG:FlxCamera;
private var camHUD:FlxCamera;

public function new(daAnim:String = 'spooky', daOtherAnim:String = 'bf')
{
public function new(daAnim:String = 'spooky', daOtherAnim:String = 'bf') {
super();
this.daAnim = daAnim;
dadHScript = FNFAssets.getText('assets/images/custom_chars/' + daAnim + '/char.xml');
this.daOtherAnim = daOtherAnim;
bfHScript = FNFAssets.getText('assets/images/custom_chars/' + daOtherAnim + '/char.xml');
}

override function create()
Expand Down Expand Up @@ -167,13 +173,15 @@ class AnimationDebug extends FlxState
dad.x += dad.enemyOffsetX;
dad.y += dad.enemyOffsetY;
add(dad);
dadHScript = FNFAssets.getText('assets/images/custom_chars/' + daAnim + '/char.xml');

if (replace) remove(bf);
bf = new Character(770, 450, daOtherAnim, true);
bf.debugMode = true;
bf.x += bf.playerOffsetX;
bf.y += bf.playerOffsetY;
add(bf);
bfHScript = FNFAssets.getText('assets/images/custom_chars/' + daOtherAnim + '/char.xml');

char = dad;
}
Expand Down
111 changes: 36 additions & 75 deletions source/Character.hx
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ class Character extends FlxSprite
public var camOffsets:Map<String, Array<Dynamic>>;
public var debugMode:Bool = false;

public static var charStorage:Map<String, FlxFramesCollection>;
public static var makeStorage:Bool = true;

public var isPlayer:Bool = false;
public var curCharacter:String = 'bf';
public var altAnim:String = "";
Expand All @@ -81,6 +78,7 @@ class Character extends FlxSprite
public var isCustom:Bool = false;
public var holdTimer:Float = 0;
public var animationNotes:Array<Dynamic> = [];
public var singPriority:Array<String> = [];
public var like:String = "bf";
public var beNormal:Bool = true;
/**
Expand Down Expand Up @@ -152,10 +150,6 @@ class Character extends FlxSprite
{
animOffsets = new Map<String, Array<Dynamic>>();
camOffsets = new Map<String, Array<Dynamic>>();
if (makeStorage) {
charStorage = new Map<String, FlxFramesCollection>();
makeStorage = false;
}
super(x, y);

curCharacter = character;
Expand Down Expand Up @@ -226,28 +220,20 @@ class Character extends FlxSprite
if (animation.getByName(directName + missName) != null) {
missSupported = true;
}
if (alt > 0)
{
if (alt == 1 && animation.getByName(directName + missName + '-alt') != null)
{
if (alt > 0) {
if (alt == 1 && animation.getByName(directName + missName + '-alt') != null) {
missAltSupported = true;
}
else if (alt > 1 && animation.getByName(directName + missName +"-" + alt + "alt") != null)
{
} else if (alt > 1 && animation.getByName(directName + missName +"-" + alt + "alt") != null) {
missAltSupported = true;
}
}
if (missSupported && (alt == 0 || missAltSupported))
directName += missName;
}
if (alt > 0 && (!miss || missAltSupported))
{
if (alt == 1 && animation.getByName(directName + '-alt') != null)
{
if (alt > 0 && (!miss || missAltSupported)) {
if (alt == 1 && animation.getByName(directName + '-alt') != null) {
directName += "-alt";
}
else if (alt > 1 && animation.getByName(directName + "-" + alt + "alt") != null)
{
} else if (alt > 1 && animation.getByName(directName + "-" + alt + "alt") != null) {
directName += "-" + alt + "alt";
}
}
Expand All @@ -257,9 +243,7 @@ class Character extends FlxSprite
// second, we don't want no animation to be played, which again is handled.
// third, we want character to turn purple, which is handled here.
color = 0xCFAFFF;
}
else if (color == 0xCFAFFF)
{
} else if (color == 0xCFAFFF) {
color = FlxColor.WHITE;
}
if (alt > 0) {
Expand All @@ -271,55 +255,39 @@ class Character extends FlxSprite
}
playAnim(directName, true);
}
public static function preloadCharacter(daChar:String) {
var charLoad = new Character(0, 0, daChar);
charStorage[daChar] = charLoad.frames;
}
override function update(elapsed:Float)
{

override function update(elapsed:Float) {
//curCharacter = curCharacter.trim();
//var charJson:Dynamic = Json.parse(Assets.getText('assets/images/custom_chars/custom_chars.json'));
//var animJson = File.getContent("assets/images/custom_chars/"+Reflect.field(charJson,curCharacter).like+".json");
if (beingControlled)
{
if (!debugMode)
{
if (animation.curAnim.name.startsWith('sing'))
{
if (beingControlled) {
if (!debugMode) {
if (animation.curAnim.name.startsWith('sing') || singPriority.contains(animation.curAnim.name)) {
holdTimer += elapsed;
}
else
} else
holdTimer = 0;

if (animation.curAnim.name.endsWith('miss') && animation.curAnim.finished && !debugMode && beNormal)
{
if (animation.curAnim.name.endsWith('miss') && animation.curAnim.finished && beNormal) {
playAnim('idle', true, false, 10);
trace("idle after miss");
}

if (animation.curAnim.name == 'firstDeath' && animation.curAnim.finished)
{
if (animation.curAnim.name == 'firstDeath' && animation.curAnim.finished) {
playAnim('deathLoop');
}
}
}
//if (!StringTools.contains(animJson, "firstDeath") && like != "bf-pixel") //supposed to fix note anim shit for bfs with unique jsons, currently broken
if (!beingControlled)
{
if (animation.curAnim != null && animation.curAnim.name.startsWith('sing'))
{
if (!beingControlled) {
if (animation.curAnim != null && (animation.curAnim.name.startsWith('sing') || singPriority.contains(animation.curAnim.name))) {
holdTimer += elapsed;
}

var dadVar:Float = 4;

if (interp != null)
{
if (interp != null) {
dadVar = interp.variables.get("dadVar");
}
if (holdTimer >= Conductor.stepCrochet * dadVar * 0.001)
{
if (holdTimer >= Conductor.stepCrochet * dadVar * 0.001) {
dance();
holdTimer = 0;
}
Expand All @@ -337,12 +305,10 @@ class Character extends FlxSprite

}
if (animation.curAnim != null && animation.curAnim.finished)
{
playAnim(animation.curAnim.name, false, false, animation.curAnim.frames.length - 3);
}
} else {
if (0 < animationNotes.length && Conductor.songPosition > animationNotes[0][0]) {
sing(animationNotes[0][1]);
sing(Std.int(animationNotes[0][1] % 4));
animationNotes.shift();
}
}
Expand All @@ -358,16 +324,13 @@ class Character extends FlxSprite
/**
* FOR GF DANCING SHIT
*/
public function dance()
{
if (!debugMode && beNormal)
{
public function dance() {
if (!debugMode && beNormal) {
if (interp != null)
callInterp("dance", [this]);
else
playAnim('idle');
if (color == 0xCFAFFF)
{
if (color == 0xCFAFFF) {
color = FlxColor.WHITE;
}
}
Expand All @@ -388,27 +351,20 @@ class Character extends FlxSprite
// kalm
animName = animation.curAnim.name;
}
if (animOffsets.exists(animName))
{
if (animOffsets.exists(animName)) {
var daOffset = animOffsets.get(animName);
offset.set(daOffset[0], daOffset[1]);
}
else
} else
offset.set(0, 0);
// should spooky be on this?
if (likeGf)
{
if (AnimName == 'singLEFT')
{
if (likeGf) {
if (AnimName == 'singLEFT') {
danced = true;
}
else if (AnimName == 'singRIGHT')
{
} else if (AnimName == 'singRIGHT') {
danced = false;
}

if (AnimName == 'singUP' || AnimName == 'singDOWN')
{
if (AnimName == 'singUP' || AnimName == 'singDOWN') {
danced = !danced;
}
}
Expand All @@ -425,10 +381,15 @@ class Character extends FlxSprite
else
mappedAnims = Song.loadFromJson(curCharacter, PlayState.SONG.song).notes;

var noteAmount = 4;
if (song.preferredNoteAmount != null)
noteAmount = song.preferredNoteAmount;

for (anim in mappedAnims) {
for (note in anim.sectionNotes) {
if ((char == 'bf' && ((note[1] <= 3 && anim.mustHitSection) || (note[1] > 3 && note[1] < 8 && !anim.mustHitSection)))
|| (char == 'dad' && ((note[1] <= 3 && !anim.mustHitSection) || (note[1] > 3 && note[1] < 8 &&anim.mustHitSection)))
var rootNote = note[1] % (noteAmount*2);
if ((char == 'bf' && ((rootNote <= noteAmount-1 && anim.mustHitSection) || (rootNote > noteAmount-1 && rootNote <= noteAmount*2-1 && !anim.mustHitSection)))
|| (char == 'dad' && ((rootNote <= noteAmount-1 && !anim.mustHitSection) || (rootNote > noteAmount-1 && rootNote <= noteAmount*2-1 && anim.mustHitSection)))
|| char == null) //dude what the funk is this
animationNotes.push(note);
}
Expand Down
Loading

0 comments on commit 3c75f2e

Please sign in to comment.