Skip to content

Commit

Permalink
Character effects wooo and some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
CamLikesKirby committed May 22, 2024
1 parent a276db4 commit 554a62e
Show file tree
Hide file tree
Showing 10 changed files with 68 additions and 15 deletions.
2 changes: 1 addition & 1 deletion mods/test/data/characterSelect.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"newCharacter": [
{
"playername": "Example",
"playername": "example",
"thecharactername": "Example",
"thenotems": [1, 1, 1, 1],
"notestyle": "3D"
Expand Down
3 changes: 2 additions & 1 deletion mods/test/data/characters/Example.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@
"nativelyPlayable": true,
"flipX": true,
"updateHitbox": true,
"setGraphicSize": ""
"setGraphicSize": "",
"effect": "3dfloat"
}
2 changes: 1 addition & 1 deletion mods/test/data/customCharacterList.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Example
example
47 changes: 45 additions & 2 deletions source/Character.hx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ typedef CharacterFile =
var flipX:Bool;
var updateHitbox:Bool;
var setGraphicSize:String;
var effect:String;
}

typedef Anim =
Expand Down Expand Up @@ -1213,9 +1214,29 @@ class Character extends FlxSprite
if (jsonCustom.setGraphicSize != '')
{
var thing = jsonCustom.setGraphicSize;
setGraphicSize(Std.int(width * Reflect.field(PlayState, thing)));
if (thing == 'furiosityScale') {
setGraphicSize(Std.int((width * 1.3) / furiosityScale));
} else if (thing == 'daPixelZoom') {
setGraphicSize(Std.int(width * PlayState.daPixelZoom));
}else {
setGraphicSize(Std.int(width * Std.parseInt(thing)));
}
}

if (jsonCustom.effect != '')
{
var funnyeffect = jsonCustom.effect;
if (funnyeffect == '3dfloat' && !PlayState.funnyFloatyBoys.contains(curCharacter )&& !Note.CharactersWith3D.contains(curCharacter)) {
PlayState.funnyFloatyBoys.push(curCharacter);
Note.CharactersWith3D.push(curCharacter);
} else if (funnyeffect == 'float' && !PlayState.floatyBoysMod.contains(curCharacter)) {
PlayState.floatyBoysMod.push(curCharacter);
} else if (funnyeffect == '3d' && !PlayState.threedBoysMod.contains(curCharacter) && !Note.CharactersWith3D.contains(curCharacter)) {
PlayState.threedBoysMod.push(curCharacter);
Note.CharactersWith3D.push(curCharacter);
}
}

if (jsonCustom.updateHitbox)
{
updateHitbox();
Expand Down Expand Up @@ -1258,8 +1279,30 @@ class Character extends FlxSprite
if (jsonCustom.setGraphicSize != '')
{
var thing = jsonCustom.setGraphicSize;
setGraphicSize(Std.int(width * Reflect.field(PlayState, thing)));
if (thing == 'furiosityScale') {
setGraphicSize(Std.int((width * 1.3) / furiosityScale));
} else if (thing == 'daPixelZoom') {
setGraphicSize(Std.int(width * PlayState.daPixelZoom));
}else {
setGraphicSize(Std.int(width * Std.parseInt(thing)));
}
}

if (jsonCustom.effect != '')
{
var funnyeffect = jsonCustom.effect;
if (funnyeffect == '3dfloat' && !PlayState.funnyFloatyBoys.contains(curCharacter) || !Note.CharactersWith3D.contains(curCharacter)) {
PlayState.funnyFloatyBoys.push(curCharacter);
Note.CharactersWith3D.push(curCharacter);
} else if (funnyeffect == 'float' && !PlayState.floatyBoysMod.contains(curCharacter)) {
PlayState.floatyBoysMod.push(curCharacter);
} else if (funnyeffect == '3d' && !PlayState.threedBoysMod.contains(curCharacter) || !Note.CharactersWith3D.contains(curCharacter)) {
PlayState.threedBoysMod.push(curCharacter);
Note.CharactersWith3D.push(curCharacter);
}
}



if (jsonCustom.updateHitbox)
{
Expand Down
6 changes: 5 additions & 1 deletion source/CharacterSelectState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class CharacterSelectState extends MusicBeatState
public var notemodtext:FlxText;
public var characterText:FlxText;
public var wasInFullscreen:Bool;

public static var inCS:Bool = false;
public var funnyIconMan:HealthIcon;

var strummies:FlxTypedGroup<FlxSprite>;
Expand Down Expand Up @@ -163,6 +163,8 @@ class CharacterSelectState extends MusicBeatState

override public function create():Void
{

inCS = true;
unlockCharacter('shaggy');
if (PlayState.SONG.song.toLowerCase() == 'exploitation' && !FlxG.save.data.modchart)
{
Expand Down Expand Up @@ -488,6 +490,7 @@ class CharacterSelectState extends MusicBeatState
{
FlxG.fullscreen = true;
}
inCS = false;
LoadingState.loadAndSwitchState(new FreeplayState());
}

Expand Down Expand Up @@ -529,6 +532,7 @@ class CharacterSelectState extends MusicBeatState
char.playAnim(heyAnimation ? 'hey' : 'singUP', true);
FlxG.sound.music.fadeOut(1.9, 0);
FlxG.sound.play(Paths.sound('confirmMenu', 'preload'));
inCS = false;
new FlxTimer().start(1.9, endIt);
}
if (FlxG.keys.justPressed.LEFT && !selectedCharacter)
Expand Down
1 change: 1 addition & 0 deletions source/FreeplayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,7 @@ class FreeplayState extends MusicBeatState
}
if (controls.BACK && canInteract && !awaitingExploitation)
{
isaCustomSong = false;
FlxG.switchState(new MainMenuState());
}

Expand Down
2 changes: 1 addition & 1 deletion source/ModSubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ModSubState extends MusicBeatSubstate
var grpMenuShit:FlxTypedGroup<Alphabet>;
var bg:FlxBackdrop;

// First, create an empty array

var menuItems:Array<ModOption> = [];

var curSelected:Int = 0;
Expand Down
2 changes: 1 addition & 1 deletion source/Note.hx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Note extends FlxSprite
public var sustainLength:Float = 0;
public var isSustainNote:Bool = false;

private var CharactersWith3D:Array<String> = ["dave-angey", "bambi-3d", 'bambi-unfair', 'exbungo', 'expunged', 'dave-festival-3d', 'dave-3d-recursed', 'bf-3d', 'nofriend'];
public static var CharactersWith3D:Array<String> = ["dave-angey", "bambi-3d", 'bambi-unfair', 'exbungo', 'expunged', 'dave-festival-3d', 'dave-3d-recursed', 'bf-3d', 'nofriend'];

public var mania:Int = 0;

Expand Down
1 change: 1 addition & 0 deletions source/PauseSubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ class PauseSubState extends MusicBeatSubstate
PlayState.instance.shakeCam = false;
PlayState.instance.camZooming = false;
FlxG.mouse.visible = false;
FreeplayState.isaCustomSong = false;
FlxG.switchState(new MainMenuState());
}
}
Expand Down
17 changes: 10 additions & 7 deletions source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,9 @@ class PlayState extends MusicBeatState

var focusOnDadGlobal:Bool = true;

var funnyFloatyBoys:Array<String> = ['dave-angey', 'bambi-3d', 'expunged', 'bambi-unfair', 'exbungo', 'dave-festival-3d', 'dave-3d-recursed', 'bf-3d'];
public static var funnyFloatyBoys:Array<String> = ['dave-angey', 'bambi-3d', 'expunged', 'bambi-unfair', 'exbungo', 'dave-festival-3d', 'dave-3d-recursed', 'bf-3d'];
public static var floatyBoysMod:Array<String> = [];
public static var threedBoysMod:Array<String> = ['nofriend'];

var storyDifficultyText:String = "";
var iconRPC:String = "";
Expand Down Expand Up @@ -778,7 +780,8 @@ class PlayState extends MusicBeatState
var gfVersion:String = 'gf';

var noGFSongs = ['memory', 'five-nights', 'bot-trot', 'escape-from-california', 'overdrive'];

trace(funnyFloatyBoys);
trace('this this false right?: ' + CharacterSelectState.inCS);
if(SONG.gf != null)
{
gfVersion = SONG.gf;
Expand Down Expand Up @@ -1110,7 +1113,7 @@ class PlayState extends MusicBeatState
if (isShaggy) boyfriend.y += 200;
if (boyfriend.curCharacter == 'godshaggy') boyfriend.x += 300;
case 'red-void':
if (funnyFloatyBoys.contains(dad.curCharacter))
if (funnyFloatyBoys.contains(dad.curCharacter) || floatyBoysMod.contains(dad.curCharacter))
{
dad.y -= 70;
}
Expand Down Expand Up @@ -2722,7 +2725,7 @@ class PlayState extends MusicBeatState
{
var arrowType:Int = note_order[i];
var strumType:String = '';
if ((funnyFloatyBoys.contains(dad.curCharacter) || dad.curCharacter == "nofriend") && player == 0 || funnyFloatyBoys.contains(boyfriend.curCharacter) && player == 1)
if ((funnyFloatyBoys.contains(dad.curCharacter) || threedBoysMod.contains(dad.curCharacter)) && player == 0 || funnyFloatyBoys.contains(boyfriend.curCharacter) || threedBoysMod.contains(boyfriend.curCharacter) && player == 1)
{
strumType = '3D';
}
Expand Down Expand Up @@ -3265,7 +3268,7 @@ class PlayState extends MusicBeatState
dad.y += (toy - dad.y);
}

if(funnyFloatyBoys.contains(dad.curCharacter.toLowerCase()) && canFloat)
if(funnyFloatyBoys.contains(dad.curCharacter.toLowerCase()) || floatyBoysMod.contains(dad.curCharacter.toLowerCase()) && canFloat)
{
if (dad.curCharacter.toLowerCase() == "expunged")
{
Expand All @@ -3278,7 +3281,7 @@ class PlayState extends MusicBeatState
dad.y += (Math.sin(elapsedtime) * 0.2);
}
}
if(funnyFloatyBoys.contains(boyfriend.curCharacter.toLowerCase()) && canFloat)
if(funnyFloatyBoys.contains(boyfriend.curCharacter.toLowerCase()) || floatyBoysMod.contains(boyfriend.curCharacter.toLowerCase()) && canFloat)
{
boyfriend.y += (Math.sin(elapsedtime) * 0.2);
}
Expand All @@ -3287,7 +3290,7 @@ class PlayState extends MusicBeatState
dadmirror.y += (Math.sin(elapsedtime) * 0.6);
}*/

if(funnyFloatyBoys.contains(gf.curCharacter.toLowerCase()) && canFloat)
if(funnyFloatyBoys.contains(gf.curCharacter.toLowerCase()) || floatyBoysMod.contains(gf.curCharacter.toLowerCase()) && canFloat)
{
gf.y += (Math.sin(elapsedtime) * 0.2);
}
Expand Down

0 comments on commit 554a62e

Please sign in to comment.