Skip to content

Commit 8c714d6

Browse files
committed
a
1 parent f053e3d commit 8c714d6

File tree

8 files changed

+112
-22
lines changed

8 files changed

+112
-22
lines changed

source/archipelago/APPlayState.hx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1690,6 +1690,7 @@ class APPlayState extends PlayState {
16901690
if (randoTimer != null && randoTimer.active)
16911691
randoTimer.cancel();
16921692

1693+
instance != null;
16931694
super.destroy();
16941695
}
16951696

source/backend/Song.hx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,12 @@ class Song
138138
//trace("Song mania value is NULL, set to " + Note.defaultMania);
139139
}
140140

141+
if (songJson.startMania == null)
142+
{
143+
songJson.startMania = Note.defaultMania;
144+
//trace("Song mania value is NULL, set to " + Note.defaultMania);
145+
}
146+
141147
if(songJson.events == null)
142148
{
143149
songJson.events = [];

source/backend/modchart/modifiers/AccelModifier.hx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
package backend.modchart.modifiers;
22

3-
import backend.ui.*;
3+
import backend.math.*;
4+
import backend.math.Vector3;
45
import backend.modchart.*;
5-
import flixel.math.FlxPoint;
6-
import flixel.math.FlxMath;
6+
import backend.ui.*;
77
import flixel.FlxG;
8-
import backend.math.Vector3;
9-
import backend.math.*;
8+
import flixel.math.FlxMath;
9+
import flixel.math.FlxPoint;
1010
import objects.playfields.NoteField;
1111

1212
class AccelModifier extends NoteModifier
@@ -22,8 +22,8 @@ class AccelModifier extends NoteModifier
2222
override function getPos(visualDiff:Float, timeDiff:Float, beat:Float, pos:Vector3, data:Int, player:Int, obj:FlxSprite, field:NoteField)
2323
{
2424
if (getOtherValue("movePastReceptors", player) == 0 && visualDiff<=0)
25-
return pos;
26-
25+
return pos;
26+
2727
var wave = getSubmodValue("wave", player);
2828
var brake = getSubmodValue("brake", player);
2929
var boost = getValue(player);
@@ -47,7 +47,7 @@ class AccelModifier extends NoteModifier
4747
yAdjust += CoolUtil.clamp(boost * (off - visualDiff), -600, 600);
4848
}
4949

50-
if (getSubmodValue("wavePeriod", player) != -1 /**< no division by 0**/ && wave != 0)
50+
if (getSubmodValue("wavePeriod", player) != -1 /**< no division by 0**/ && wave != 0)
5151
yAdjust += wave * 40 * FlxMath.fastSin(visualDiff / ((114 * getSubmodValue("wavePeriod", player)) + 114));
5252

5353
pos.y += yAdjust * mult;
@@ -59,4 +59,4 @@ class AccelModifier extends NoteModifier
5959
var subMods:Array<String> = ["brake", "wave", "wavePeriod"];
6060
return subMods;
6161
}
62-
}
62+
}

source/objects/playfields/PlayField.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1097,7 +1097,7 @@ class PlayField extends FlxTypedGroup<FlxBasic>
10971097
}
10981098
modManager.updateObject(curDecBeat, daNote, modNumber);
10991099

1100-
daNote.clipToStrumNote(strumNotes[daNote.column]);
1100+
//daNote.clipToStrumNote(strumNotes[daNote.column]);
11011101

11021102
// check for hold inputs
11031103
if(!daNote.isSustainNote){

source/psychlua/FunkinLua.hx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ class FunkinLua {
351351
}
352352
luaTrace("addLuaScript: Script doesn't exist!", false, false, FlxColor.RED);
353353
});
354+
354355
Lua_helper.add_callback(lua, "addHScript", function(scriptFile:String, ?ignoreAlreadyRunning:Bool = false) {
355356
#if HSCRIPT_ALLOWED
356357
var scriptPath:String = findScript(scriptFile, '.hx');
@@ -372,6 +373,7 @@ class FunkinLua {
372373
luaTrace("addHScript: HScript is not supported on this platform!", false, false, FlxColor.RED);
373374
#end
374375
});
376+
375377
Lua_helper.add_callback(lua, "removeLuaScript", function(luaFile:String) {
376378
var luaPath:String = findScript(luaFile);
377379
if(luaPath != null)
@@ -392,6 +394,7 @@ class FunkinLua {
392394
luaTrace('removeLuaScript: Script $luaFile isn\'t running!', false, false, FlxColor.RED);
393395
return false;
394396
});
397+
395398
Lua_helper.add_callback(lua, "removeHScript", function(scriptFile:String) {
396399
#if HSCRIPT_ALLOWED
397400
var scriptPath:String = findScript(scriptFile, '.hx');
@@ -459,6 +462,7 @@ class FunkinLua {
459462
spr.loadGraphic(Paths.image(image), animated, gridX, gridY);
460463
}
461464
});
465+
462466
Lua_helper.add_callback(lua, "loadFrames", function(variable:String, image:String, spriteType:String = 'auto') {
463467
var split:Array<String> = variable.split('.');
464468
var spr:FlxSprite = LuaUtils.getObjectDirectly(split[0]);
@@ -471,6 +475,7 @@ class FunkinLua {
471475
LuaUtils.loadFrames(spr, image, spriteType);
472476
}
473477
});
478+
474479
Lua_helper.add_callback(lua, "loadMultipleFrames", function(variable:String, images:Array<String>) {
475480
var split:Array<String> = variable.split('.');
476481
var spr:FlxSprite = LuaUtils.getObjectDirectly(split[0]);
@@ -514,6 +519,7 @@ class FunkinLua {
514519
luaTrace('getObjectOrder: Object $obj doesn\'t exist!', false, false, FlxColor.RED);
515520
return -1;
516521
});
522+
517523
Lua_helper.add_callback(lua, "setObjectOrder", function(obj:String, position:Int, ?group:String = null) {
518524
var leObj:FlxBasic = LuaUtils.getObjectDirectly(obj);
519525
if(leObj != null)
@@ -1767,6 +1773,15 @@ class FunkinLua {
17671773
var strumNote:StrumNote = PlayState.instance.strumLineNotes.members[note % PlayState.instance.strumLineNotes.length];
17681774
if(strumNote == null) return null;
17691775

1776+
for (field in PlayState.instance.playfields.members) {
1777+
if (field.strumNotes.contains(strumNote)) {
1778+
var i = field.strumNotes.indexOf(strumNote);
1779+
if (i != -1) {
1780+
strumNote = field.strumNotes[i];
1781+
}
1782+
}
1783+
}
1784+
17701785
if(tag != null)
17711786
{
17721787
var originalTag:String = tag;

source/states/PlayState.hx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2568,10 +2568,9 @@ class PlayState extends MusicBeatState
25682568
// return super.add(obj);
25692569
// }
25702570

2571-
public function addBehind(obj:FlxBasic, behind:FlxBasic):FlxBasic
2571+
public function addBehind(obj:FlxBasic, behind:FlxBasic)
25722572
{
25732573
insert(members.indexOf(behind), obj);
2574-
return obj;
25752574
}
25762575

25772576
public function addBehindGF(obj:FlxBasic)
@@ -3427,7 +3426,7 @@ class PlayState extends MusicBeatState
34273426

34283427
var gottaHitNote:Bool;
34293428
noteColumn = Std.int(songNotes[1] % Note.ammo[SONG.mania != null ? SONG.mania : 3]);
3430-
gottaHitNote = (songNotes[1] < (SONG.mania != null ? totalColumns : Note.ammo[3]));
3429+
gottaHitNote = (songNotes[1] < (SONG.mania != null ? totalColumns : Note.ammo[SONG.mania != null ? SONG.mania : 3]));
34313430

34323431
//if (songData.format.contains("mixtape_v1")) gottaHitNote = section.mustHitSection;
34333432

source/states/editors/ChartingState.hx

Lines changed: 75 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,21 @@ class ChartingState extends MusicBeatState implements PsychUIEventHandler.PsychU
545545
lilBf.antialiasing = true;
546546
add(lilBf);
547547

548+
lilBf2 = new FlxSprite(32, 332).loadGraphic(Paths.image("editors/lilBf"), true, 300, 256);
549+
lilBf2.animation.add("idle", [0, 1], 12, true);
550+
lilBf2.animation.add("0", [3, 4, 5], 12, false);
551+
lilBf2.animation.add("1", [6, 7, 8], 12, false);
552+
lilBf2.animation.add("2", [9, 10, 11], 12, false);
553+
lilBf2.animation.add("3", [12, 13, 14], 12, false);
554+
lilBf2.animation.add("yeah", [17, 20, 23], 12, false);
555+
lilBf2.animation.play("idle");
556+
lilBf2.animation.finishCallback = function(name:String){
557+
lilBf2.animation.play(name, true, false, lilBf2.animation.getByName(name).numFrames - 2);
558+
}
559+
lilBf2.scrollFactor.set();
560+
lilBf2.antialiasing = true;
561+
add(lilBf2);
562+
548563
lilOpp = new FlxSprite(32, 332).loadGraphic(Paths.image("editors/lilOpp"), true, 300, 256);
549564
lilOpp.animation.add("idle", [0, 1], 12, true);
550565
lilOpp.animation.add("0", [3, 4, 5], 12, false);
@@ -559,6 +574,20 @@ class ChartingState extends MusicBeatState implements PsychUIEventHandler.PsychU
559574
lilOpp.antialiasing = true;
560575
add(lilOpp);
561576

577+
lilOpp2 = new FlxSprite(32, 332).loadGraphic(Paths.image("editors/lilOpp"), true, 300, 256);
578+
lilOpp2.animation.add("idle", [0, 1], 12, true);
579+
lilOpp2.animation.add("0", [3, 4, 5], 12, false);
580+
lilOpp2.animation.add("1", [6, 7, 8], 12, false);
581+
lilOpp2.animation.add("2", [9, 10, 11], 12, false);
582+
lilOpp2.animation.add("3", [12, 13, 14], 12, false);
583+
lilOpp2.animation.play("idle");
584+
lilOpp2.animation.finishCallback = function(name:String){
585+
lilOpp2.animation.play(name, true, false, lilOpp2.animation.getByName(name).numFrames - 2);
586+
}
587+
lilOpp2.scrollFactor.set();
588+
lilOpp2.antialiasing = true;
589+
add(lilOpp2);
590+
562591
//remember to add the new function
563592
createLilGirlfriend();
564593
createLilPlayer();
@@ -570,6 +599,8 @@ class ChartingState extends MusicBeatState implements PsychUIEventHandler.PsychU
570599
if(chartEditorSave.data.lilBuddiesBox != null) lilBuddiesOn = chartEditorSave.data.lilBuddiesBox;
571600
if(chartEditorSave.data.reverseScroll != null) reverseScrollEnabled = chartEditorSave.data.reverseScroll;
572601
lilStage.visible = lilBf.visible = lilOpp.visible = lilStage.active = lilBf.active = lilOpp.active = lilBuddiesOn;
602+
lilBf2.visible = lilBf2.active = (lilBuddiesOn && PlayState.SONG.player4 != null);
603+
lilOpp2.visible = lilOpp2.active = (lilBuddiesOn && PlayState.SONG.player5 != null);
573604

574605
if (lilBuddiesOn) {
575606
remove(lilPlayer);
@@ -1296,6 +1327,8 @@ class ChartingState extends MusicBeatState implements PsychUIEventHandler.PsychU
12961327

12971328
var lilBfResetAnim:Float = 0;
12981329
var lilOppResetAnim:Float = 0;
1330+
var lilBf2ResetAnim:Float = 0;
1331+
var lilOpp2ResetAnim:Float = 0;
12991332

13001333
var lilPlayerDP:Array<Float> = [-300, 110];
13011334
var lilPlayer2DP:Array<Float> = [-200, 150];
@@ -1542,6 +1575,15 @@ class ChartingState extends MusicBeatState implements PsychUIEventHandler.PsychU
15421575
}
15431576
}
15441577

1578+
if(lilOpp2ResetAnim > 0) {
1579+
lilOpp2ResetAnim -= elapsed;
1580+
if(lilOpp2ResetAnim <= 0) {
1581+
lilOpp2.animation.play('idle');
1582+
lilOpp2.color = FlxColor.WHITE;
1583+
lilOpp2ResetAnim = 0;
1584+
}
1585+
}
1586+
15451587
if(lilBfResetAnim > 0) {
15461588
lilBfResetAnim -= elapsed;
15471589
if(lilBfResetAnim <= 0) {
@@ -1551,6 +1593,15 @@ class ChartingState extends MusicBeatState implements PsychUIEventHandler.PsychU
15511593
}
15521594
}
15531595

1596+
if(lilBf2ResetAnim > 0) {
1597+
lilBf2ResetAnim -= elapsed;
1598+
if(lilBf2ResetAnim <= 0) {
1599+
lilBf2.animation.play('idle');
1600+
lilBf2.color = FlxColor.WHITE;
1601+
lilBf2ResetAnim = 0;
1602+
}
1603+
}
1604+
15541605
super.update(elapsed);
15551606

15561607
if(songFinished)
@@ -2286,15 +2337,27 @@ class ChartingState extends MusicBeatState implements PsychUIEventHandler.PsychU
22862337
if (!note.noAnimation) {
22872338
if (note.mustPress)
22882339
{
2289-
lilBf.animation.play("" + (note.noteData % Note.ammo[PlayState.mania]), true);
2290-
lilBf.color = note.rgbShader.r;
2291-
lilBfResetAnim = ((Conductor.stepCrochet * PlayState.mania) + note.sustainLength) / 1000 / playbackRate; // for lil buddies to reset after hitting notes. It doesn't stop at sections anymore.
2340+
if (note.exNote) {
2341+
lilBf2.animation.play("" + (note.noteData % Note.ammo[PlayState.mania]), true);
2342+
lilBf2.color = note.rgbShader.r;
2343+
lilBf2ResetAnim = ((Conductor.stepCrochet * PlayState.mania) + note.sustainLength) / 1000 / playbackRate; // for lil buddies to reset after hitting notes. It doesn't stop at sections anymore.
2344+
} else {
2345+
lilBf.animation.play("" + (note.noteData % Note.ammo[PlayState.mania]), true);
2346+
lilBf.color = note.rgbShader.r;
2347+
lilBfResetAnim = ((Conductor.stepCrochet * PlayState.mania) + note.sustainLength) / 1000 / playbackRate; // for lil buddies to reset after hitting notes. It doesn't stop at sections anymore.
2348+
}
22922349
}
22932350
else
22942351
{
2295-
lilOpp.animation.play("" + (note.noteData % Note.ammo[PlayState.mania]), true);
2296-
lilOpp.color = note.rgbShader.r;
2297-
lilOppResetAnim = ((Conductor.stepCrochet * PlayState.mania) + note.sustainLength) / 1000 / playbackRate;
2352+
if (note.exNote) {
2353+
lilOpp2.animation.play("" + (note.noteData % Note.ammo[PlayState.mania]), true);
2354+
lilOpp2.color = note.rgbShader.r;
2355+
lilOpp2ResetAnim = ((Conductor.stepCrochet * PlayState.mania) + note.sustainLength) / 1000 / playbackRate;
2356+
} else {
2357+
lilOpp.animation.play("" + (note.noteData % Note.ammo[PlayState.mania]), true);
2358+
lilOpp.color = note.rgbShader.r;
2359+
lilOppResetAnim = ((Conductor.stepCrochet * PlayState.mania) + note.sustainLength) / 1000 / playbackRate;
2360+
}
22982361
}
22992362
}
23002363
}
@@ -2311,8 +2374,10 @@ class ChartingState extends MusicBeatState implements PsychUIEventHandler.PsychU
23112374
function resetBuddies() // lil buddies
23122375
{
23132376
lilBf.animation.play("idle");
2377+
lilBf2.animation.play("idle");
23142378
lilOpp.animation.play("idle");
2315-
lilBf.color = lilOpp.color = FlxColor.WHITE;
2379+
lilOpp2.animation.play("idle");
2380+
lilBf.color = lilBf2.color = lilOpp.color = lilOpp2.color = FlxColor.WHITE;
23162381
}
23172382

23182383
function moveSelectedNotes(noteData:Int = 0, lastY:Float) //This turns selected notes into moving notes
@@ -2788,7 +2853,7 @@ class ChartingState extends MusicBeatState implements PsychUIEventHandler.PsychU
27882853
var section = PlayState.SONG.notes[secNum];
27892854

27902855
var daStrumTime:Float = note[0];
2791-
var daNoteData:Int = Std.int(note[1] % GRID_COLUMNS_PER_PLAYER);
2856+
var daNoteData:Int = (note[1]);
27922857
var gottaHitNote:Bool = (note[1] < GRID_COLUMNS_PER_PLAYER);
27932858
try {
27942859
var isAlt: Bool = section.altAnim && !gottaHitNote;
@@ -5517,6 +5582,8 @@ class ChartingState extends MusicBeatState implements PsychUIEventHandler.PsychU
55175582
lilBuddiesOn = !lilBuddiesOn;
55185583
chartEditorSave.data.lilBuddiesBox = lilBuddiesOn;
55195584
lilStage.visible = lilBf.visible = lilOpp.visible = lilStage.active = lilBf.active = lilOpp.active = lilBuddiesOn;
5585+
lilBf2.visible = lilBf2.active = (lilBuddiesOn && PlayState.SONG.player4 != null);
5586+
lilOpp2.visible = lilOpp2.active = (lilBuddiesOn && PlayState.SONG.player5 != null);
55205587
lilBuddiesBoxButton.text.text = lilBuddiesOn ? ' Lil Buddies ON' : ' Lil Buddies OFF';
55215588
if (!lilBuddiesOn) reloadLilBuddies();
55225589
else lilPlayer.visible = lilPlayer2.visible = lilOpponent.visible = lilOpponent2.visible = lilGf.visible = false;

source/states/editors/ChartingStateOG.hx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,10 @@ class ChartingStateOG extends backend.MusicBeatChartingState
389389
override function create()
390390
{
391391
states.editors.ChartEditorEvents.pushToArray(eventStuff);
392-
if (PlayState.SONG != null)
392+
if (PlayState.SONG != null) {
393393
_song = PlayState.SONG;
394+
_song.format = 'mixtape_v1';
395+
}
394396
else
395397
{
396398
Difficulty.resetList();

0 commit comments

Comments
 (0)