Skip to content

Commit ca7d0e7

Browse files
committed
icons are hard
1 parent fcab22d commit ca7d0e7

File tree

5 files changed

+62
-6
lines changed

5 files changed

+62
-6
lines changed

source/archipelago/APPlayState.hx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ class APPlayState extends PlayState {
309309
var playSound:String = "spin";
310310
var playSoundVol:Float = 1;
311311
var noIcon:Bool = false;
312-
modManager.setValue('orient', (FlxG.random.bool() ? 1 : -1) * FlxG.random.float(333 * 0.8, 333 * 1.15));
312+
modManager.setValue('confusion', (FlxG.random.bool() ? 1 : -1) * FlxG.random.float(333 * 0.8, 333 * 1.15));
313313
applyEffect(ttl, onEnd, playSound, playSoundVol, noIcon, 'spin');
314314
},
315315
'songslower' => function() {
@@ -880,7 +880,7 @@ class APPlayState extends PlayState {
880880
applyEffect(ttl, onEnd, playSound, playSoundVol, noIcon, 'flip');
881881
},
882882
'invuln' => function() {
883-
var ttl:Float = 5;
883+
var ttl:Float = 30;
884884
var onEnd:(Void->Void) = function() {
885885
boyfriend.invuln = false;
886886
shieldSprite.visible = false;

source/backend/ClientPrefs.hx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,7 @@ class ClientPrefs {
432432
'debug_2' => [],
433433

434434
'sidebar' => [],
435+
'dodge' => [],
435436
];
436437
public static var defaultKeys:Map<String, Array<FlxKey>> = null;
437438
public static var defaultButtons:Map<String, Array<FlxGamepadInputID>> = null;

source/objects/HealthIcon.hx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ class HealthIcon extends FlxSprite
6767
frames = Paths.getSparrowAtlas(name);
6868

6969
// Try to load JSON file
70-
if (Paths.fileExists(Paths.json(name), TEXT)) {
70+
if (Paths.fileExists('images/' + name + '.json', TEXT)) {
7171
try {
72-
jsonData = haxe.Json.parse(File.getContent(Paths.json(name)));
72+
jsonData = haxe.Json.parse(File.getContent(Paths.getPath('images/$name.json', TEXT)));
7373
} catch (e:Dynamic) {
7474
trace('Invalid JSON file: ' + jsonPath);
7575
}
@@ -98,18 +98,22 @@ class HealthIcon extends FlxSprite
9898
case WINNING:
9999
trace('if you see this trace you messed up somewhere bro');
100100
case ANIMSINGLE:
101+
trace('Loaded Anim Single!');
101102
animation.addByPrefix('idle', 'idle', 24, true);
102103
animation.play('idle', true);
103104
case ANIMDEFAULT:
105+
trace('Loaded Anim Default!');
104106
animation.addByPrefix('normal', 'normal', 24, true);
105107
animation.addByPrefix('losing', 'losing', 24, true);
106108
animation.play('normal', true);
107109
case ANIMWINNING:
110+
trace('Loaded Anim Winning!');
108111
animation.addByPrefix('winning', 'winning', 24, true);
109112
animation.addByPrefix('normal', 'normal', 24, true);
110113
animation.addByPrefix('losing', 'losing', 24, true);
111114
animation.play('normal', true);
112115
case ANIMSINGING:
116+
trace('Loaded Anim Singing!');
113117
animation.addByPrefix('idle', 'idle', 24, true);
114118
animation.addByPrefix('left', 'left', 24, true);
115119
animation.addByPrefix('down', 'down', 24, true);

source/options/ControlsSubState.hx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ class ControlsSubState extends MusicBeatSubstate
249249
[false, 'Key 2', 'debug_2', 'Debug Key #2'],
250250
[false, 'Archipelago'],
251251
[false, 'Open Console', 'sidebar', 'Side Bar'],
252+
[false, 'Dodge', 'dodge', 'Dodge'],
252253
];
253254
var curOptions:Array<Int>;
254255
var curOptionsValid:Array<Int>;

source/states/PlayState.hx

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4816,6 +4816,12 @@ class PlayState extends MusicBeatState
48164816
iconP1.animation.curAnim.curFrame = 0;
48174817
case WINNING:
48184818
iconP1.animation.curAnim.curFrame = (healthBar.percent > 80 ? 1 : (healthBar.percent < 20 ? 2 : 0));
4819+
case ANIMSINGLE:
4820+
iconP1.animation.play('idle', true);
4821+
case ANIMDEFAULT:
4822+
iconP1.animation.play((healthBar.percent < 20 ? 'normal' : 'losing'), true);
4823+
case ANIMWINNING:
4824+
iconP1.animation.play((healthBar.percent < 20 ? 'winning' : (healthBar.percent > 80 ? 'losing' : 'normal')), true);
48194825
default:
48204826
iconP1.animation.curAnim.curFrame = (healthBar.percent < 20 ? 0 : 1);
48214827
}
@@ -4826,6 +4832,12 @@ class PlayState extends MusicBeatState
48264832
iconP2.animation.curAnim.curFrame = 0;
48274833
case WINNING:
48284834
iconP2.animation.curAnim.curFrame = (healthBar.percent > 80 ? 2 : (healthBar.percent < 20 ? 1 : 0));
4835+
case ANIMSINGLE:
4836+
iconP2.animation.play('idle', true);
4837+
case ANIMDEFAULT:
4838+
iconP2.animation.play((healthBar.percent > 80 ? 'normal' : 'losing'), true);
4839+
case ANIMWINNING:
4840+
iconP2.animation.play((healthBar.percent > 80 ? 'losing' : (healthBar.percent < 20 ? 'winning' : 'normal')), true);
48294841
default:
48304842
iconP2.animation.curAnim.curFrame = (healthBar.percent > 80 ? 0 : 1);
48314843
}
@@ -4838,10 +4850,17 @@ class PlayState extends MusicBeatState
48384850
iconP22.animation.curAnim.curFrame = 0;
48394851
case WINNING:
48404852
iconP22.animation.curAnim.curFrame = (healthBar.percent > 80 ? 2 : (healthBar.percent < 20 ? 1 : 0));
4853+
case ANIMSINGLE:
4854+
iconP22.animation.play('idle', true);
4855+
case ANIMDEFAULT:
4856+
iconP22.animation.play((healthBar.percent > 80 ? 'normal' : 'losing'), true);
4857+
case ANIMWINNING:
4858+
iconP22.animation.play((healthBar.percent > 80 ? 'losing' : (healthBar.percent < 20 ? 'winning' : 'normal')), true);
48414859
default:
48424860
iconP22.animation.curAnim.curFrame = (healthBar.percent > 80 ? 0 : 1);
48434861
}
48444862
}
4863+
48454864
if (iconP12 != null)
48464865
{
48474866
switch (iconP12.type)
@@ -4850,6 +4869,12 @@ class PlayState extends MusicBeatState
48504869
iconP12.animation.curAnim.curFrame = 0;
48514870
case WINNING:
48524871
iconP12.animation.curAnim.curFrame = (healthBar.percent > 80 ? 1 : (healthBar.percent < 20 ? 2 : 0));
4872+
case ANIMSINGLE:
4873+
iconP12.animation.play('idle', true);
4874+
case ANIMDEFAULT:
4875+
iconP12.animation.play((healthBar.percent < 20 ? 'normal' : 'losing'), true);
4876+
case ANIMWINNING:
4877+
iconP12.animation.play((healthBar.percent < 20 ? 'winning' : (healthBar.percent > 80 ? 'losing' : 'normal')), true);
48534878
default:
48544879
iconP12.animation.curAnim.curFrame = (healthBar.percent < 20 ? 0 : 1);
48554880
}
@@ -4862,7 +4887,13 @@ class PlayState extends MusicBeatState
48624887
case SINGLE:
48634888
iconP1.animation.curAnim.curFrame = 0;
48644889
case WINNING:
4865-
iconP1.animation.curAnim.curFrame = (healthBar.percent > 80 ? 2 : (healthBar.percent < 20 ? 1 : 0));
4890+
iconP1.animation.curAnim.curFrame = (healthBar.percent < 20 ? 0 : (healthBar.percent > 80 ? 2 : 1));
4891+
case ANIMSINGLE:
4892+
iconP1.animation.play('idle', true);
4893+
case ANIMDEFAULT:
4894+
iconP1.animation.play((healthBar.percent < 20 ? 'losing' : 'normal'), true);
4895+
case ANIMWINNING:
4896+
iconP1.animation.play((healthBar.percent < 20 ? 'losing' : (healthBar.percent > 80 ? 'winning' : 'normal')), true);
48664897
default:
48674898
iconP1.animation.curAnim.curFrame = (healthBar.percent < 20 ? 1 : 0);
48684899
}
@@ -4873,6 +4904,12 @@ class PlayState extends MusicBeatState
48734904
iconP2.animation.curAnim.curFrame = 0;
48744905
case WINNING:
48754906
iconP2.animation.curAnim.curFrame = (healthBar.percent > 80 ? 1 : (healthBar.percent < 20 ? 2 : 0));
4907+
case ANIMSINGLE:
4908+
iconP2.animation.play('idle', true);
4909+
case ANIMDEFAULT:
4910+
iconP2.animation.play((healthBar.percent > 80 ? 'losing' : 'normal'), true);
4911+
case ANIMWINNING:
4912+
iconP2.animation.play((healthBar.percent > 80 ? 'losing' : (healthBar.percent < 20 ? 'winning' : 'normal')), true);
48764913
default:
48774914
iconP2.animation.curAnim.curFrame = (healthBar.percent > 80 ? 1 : 0);
48784915
}
@@ -4885,10 +4922,17 @@ class PlayState extends MusicBeatState
48854922
iconP22.animation.curAnim.curFrame = 0;
48864923
case WINNING:
48874924
iconP22.animation.curAnim.curFrame = (healthBar.percent > 80 ? 1 : (healthBar.percent < 20 ? 2 : 0));
4925+
case ANIMSINGLE:
4926+
iconP22.animation.play('idle', true);
4927+
case ANIMDEFAULT:
4928+
iconP22.animation.play((healthBar.percent < 20 ? 'losing' : 'normal'), true);
4929+
case ANIMWINNING:
4930+
iconP22.animation.play((healthBar.percent < 20 ? 'losing' : (healthBar.percent > 80 ? 'winning' : 'normal')), true);
48884931
default:
48894932
iconP22.animation.curAnim.curFrame = (healthBar.percent > 80 ? 1 : 0);
48904933
}
48914934
}
4935+
48924936
if (iconP12 != null)
48934937
{
48944938
switch (iconP12.type)
@@ -4897,6 +4941,12 @@ class PlayState extends MusicBeatState
48974941
iconP12.animation.curAnim.curFrame = 0;
48984942
case WINNING:
48994943
iconP12.animation.curAnim.curFrame = (healthBar.percent > 80 ? 2 : (healthBar.percent < 20 ? 1 : 0));
4944+
case ANIMSINGLE:
4945+
iconP12.animation.play('idle', true);
4946+
case ANIMDEFAULT:
4947+
iconP12.animation.play((healthBar.percent > 80 ? 'losing' : 'normal'), true);
4948+
case ANIMWINNING:
4949+
iconP12.animation.play((healthBar.percent > 80 ? 'winning' : (healthBar.percent < 20 ? 'losing' : 'normal')), true);
49004950
default:
49014951
iconP12.animation.curAnim.curFrame = (healthBar.percent < 20 ? 1 : 0);
49024952
}
@@ -5096,7 +5146,7 @@ class PlayState extends MusicBeatState
50965146
}
50975147
new FlxTimer().start(5 / 60, function(tmr:FlxTimer)
50985148
{
5099-
gf.playAnim('sad', true);
5149+
if (gf != null) gf.playAnim('sad', true);
51005150
});
51015151
FlxG.sound.play(Paths.sound('fnf_loss_sfx'));
51025152
health = 1 / lives * lives;

0 commit comments

Comments
 (0)