Skip to content

Commit 3dddc56

Browse files
committed
crazy
1 parent 1378f98 commit 3dddc56

File tree

6 files changed

+283
-17
lines changed

6 files changed

+283
-17
lines changed

source/archipelago/APGameState.hx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ class APGameState {
278278
}
279279

280280
public static var isSync:Bool = false;
281+
var haventranyet:Bool = true;
281282
function addSongs(song:Array<NetworkItem>)
282283
{
283284
var nonSongs:Map<String, Int> = [];
@@ -384,17 +385,17 @@ class APGameState {
384385
{
385386

386387
if (nonSongs.get(items) <= ItemIndex)
387-
{
388-
continue;
389-
}
390-
else
391-
{
392-
ItemIndex = nonSongs.get(items);
393-
archipelago.APItem.createItemByName(items);
394-
}
388+
{
389+
continue;
390+
}
391+
else
392+
{
393+
ItemIndex = nonSongs.get(items);
394+
archipelago.APItem.createItemByName(items);
395+
}
395396
}
396397
archipelago.APItem.doCheck();
397-
isSync = false;
398+
isSync = false;
398399

399400
}
400401

source/archipelago/APItem.hx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,13 @@ class APItem {
101101
if (this.condition.type == Everywhere) {
102102
this.isException = true;
103103
}
104-
allItems.push(this);
105-
106-
// if ((!archipelago.APGameState.isSynced && !toSync))
107-
108104

105+
if (APEntryState.gonnaRunSync && toSync) {
106+
allItems.push(this); trace('Item to sync: ${this.name}');
107+
} else if (!APEntryState.gonnaRunSync) {
108+
allItems.push(this); trace('Item: ${this.name}');
109+
}
110+
109111
}
110112

111113
public static function popup(desc:String):Void {
@@ -134,7 +136,9 @@ class APItem {
134136
var playState:archipelago.APPlayState = cast states.PlayState.instance;
135137
if (playState != null && playState.startedCountdown) {
136138
// Call the die() function once the countdown has started
137-
backend.COD.COD.COD = "Killed by Blue Balls Curse."; // HOW AND WHY DOES THIS WORK THE WAY IT DOES????
139+
// HOW AND WHY DOES THIS WORK THE WAY IT DOES???? - Yuta
140+
// Welcome back old friend - Z11
141+
backend.COD.COD.COD = "Killed by Blue Balls Curse.";
138142
archipelago.APPlayState.deathByBlueBalls = true;
139143

140144
playState.die();

source/objects/playfields/PlayField.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,7 @@ class PlayField extends FlxTypedGroup<FlxBasic>
997997
}
998998

999999
//kade is just evil lmao
1000-
if (daNote.isParent && daNote.tooLate && !daNote.isSustainNote)
1000+
if (ClientPrefs.data.inputSystem == "Kade" && daNote.isParent && daNote.tooLate && !daNote.isSustainNote)
10011001
{
10021002
PlayState.instance.health -= 0.15; // give a health punishment for failing a LN
10031003
trace("hold fell over at the start");

source/states/FreeplayState.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1324,7 +1324,7 @@ class FreeplayState extends MusicBeatState
13241324
updateTexts(elapsed);
13251325
super.update(elapsed);
13261326

1327-
if (ticketCounter != null) ticketCounter.text = 'Current ticket amount: ${APInfo.ticketCount}\nTickets Total: ${APInfo.ticketWinCount}\nTickets Left: ${Std.int(APInfo.ticketCount - APInfo.ticketWinCount)}';
1327+
if (ticketCounter != null) ticketCounter.text = 'Current ticket amount: ${APInfo.ticketCount}\nTickets Total: ${APInfo.ticketWinCount}\nTickets Left: ${Std.int(APInfo.ticketWinCount - APInfo.ticketCount)}';
13281328

13291329
grpLocks.forEach(function(lock:FlxSprite)
13301330
{

source/states/PlayState.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3619,7 +3619,7 @@ class PlayState extends MusicBeatState
36193619
var healthRatio:Float = health / MaxHP;
36203620
switch (ClientPrefs.data.healthMode) {
36213621
case "Tabi":
3622-
var p2ToUse:Float = healthBar.x + (healthBar.width * (FlxMath.remapToRange((health / 2 * 100), 0, 100, 100, 0) * 0.01)) - (iconP2.width - iconOffset);
3622+
var p2ToUse:Float = healthBar.barCenter - (150 * iconP2.scale.x) / 2 - iconOffset * 2;
36233623
if (iconP2.x - iconP2.width / 2 < healthBar.x && iconP2.x > p2ToUse)
36243624
{
36253625
healthBar.offset.x = iconP2.x - p2ToUse;
Lines changed: 261 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,261 @@
1+
package substates;
2+
3+
import archipelago.APPlayState;
4+
import objects.GameOverVideoSprite;
5+
import backend.WeekData;
6+
7+
import objects.Character;
8+
import flixel.FlxObject;
9+
import flixel.FlxSubState;
10+
import flixel.math.FlxPoint;
11+
12+
import states.StoryMenuState;
13+
import states.FreeplayState;
14+
15+
//It has its own folder cuz it was made for something much bigger.
16+
//im just too lazy to move it.
17+
//-sans
18+
import undertale.UnderTextParser;
19+
20+
class APGameOverSubstate extends MusicBeatSubstate
21+
{
22+
public var boyfriend:Character;
23+
var camFollow:FlxObject;
24+
25+
var stagePostfix:String = "";
26+
27+
public static var characterName:String = 'bf-dead';
28+
public static var deathSoundName:String = 'fnf_loss_sfx';
29+
public static var loopSoundName:String = 'gameOver';
30+
public static var endSoundName:String = 'gameOverEnd';
31+
public static var deathDelay:Float = 0;
32+
33+
public static var deathbysquare:FlxSprite;
34+
public static var causeofdeath:UnderTextParser;
35+
36+
public static var video:Null<GameOverVideoSprite> = null;
37+
public static var isVideo:Bool = false;
38+
39+
public static var instance:APGameOverSubstate;
40+
public function new() {
41+
super();
42+
}
43+
44+
public static function resetVariables() {
45+
characterName = 'bf-dead';
46+
deathSoundName = 'fnf_loss_sfx';
47+
loopSoundName = 'gameOver';
48+
endSoundName = 'gameOverEnd';
49+
deathDelay = 0;
50+
51+
video = null;
52+
isVideo = false;
53+
54+
var _song = PlayState.SONG;
55+
if(_song != null)
56+
{
57+
if(_song.gameOverChar != null && _song.gameOverChar.trim().length > 0) characterName = _song.gameOverChar;
58+
if(_song.gameOverSound != null && _song.gameOverSound.trim().length > 0) deathSoundName = _song.gameOverSound;
59+
if(_song.gameOverLoop != null && _song.gameOverLoop.trim().length > 0) loopSoundName = _song.gameOverLoop;
60+
if(_song.gameOverEnd != null && _song.gameOverEnd.trim().length > 0) endSoundName = _song.gameOverEnd;
61+
}
62+
}
63+
64+
var charX:Float = 0;
65+
var charY:Float = 0;
66+
67+
var overlay:FlxSprite;
68+
var overlayConfirmOffsets:FlxPoint = FlxPoint.get();
69+
override function create()
70+
{
71+
instance = this;
72+
73+
FlxG.camera.bgColor = 0xFF000000; // to fix mods that like to change its color (looking at you, 17bucks)
74+
75+
if (Std.is(PlayState.instance, APPlayState) && APPlayState.deathByLink)
76+
{
77+
APPlayState.deathByLink = false;
78+
APPlayState.deathLinkPacket = null;
79+
}
80+
81+
Conductor.songPosition = 0;
82+
83+
if(boyfriend == null)
84+
{
85+
boyfriend = new Character(0, 0, 'bf-dead', true);
86+
boyfriend.x += boyfriend.positionArray[0];
87+
boyfriend.y += boyfriend.positionArray[1];
88+
}
89+
boyfriend.skipDance = true;
90+
add(boyfriend);
91+
92+
FlxG.sound.play(Paths.sound(deathSoundName));
93+
FlxG.camera.scroll.set();
94+
FlxG.camera.target = null;
95+
96+
boyfriend.playAnim('firstDeath');
97+
98+
camFollow = new FlxObject(0, 0, 1, 1);
99+
camFollow.setPosition(boyfriend.getGraphicMidpoint().x + boyfriend.cameraPosition[0], boyfriend.getGraphicMidpoint().y + boyfriend.cameraPosition[1]);
100+
FlxG.camera.focusOn(new FlxPoint(FlxG.camera.scroll.x + (FlxG.camera.width / 2), FlxG.camera.scroll.y + (FlxG.camera.height / 2)));
101+
FlxG.camera.follow(camFollow, LOCKON, 0.01);
102+
add(camFollow);
103+
104+
PlayState.instance?.setOnScripts('inGameOver', true);
105+
PlayState.instance?.callOnScripts('onGameOverStart', []);
106+
FlxG.sound.music.loadEmbedded(Paths.music(loopSoundName), true);
107+
108+
if(characterName == 'pico-dead')
109+
{
110+
overlay = new FlxSprite(boyfriend.x + 205, boyfriend.y - 80);
111+
overlay.frames = Paths.getSparrowAtlas('Pico_Death_Retry');
112+
overlay.animation.addByPrefix('deathLoop', 'Retry Text Loop', 24, true);
113+
overlay.animation.addByPrefix('deathConfirm', 'Retry Text Confirm', 24, false);
114+
overlay.antialiasing = ClientPrefs.data.antialiasing;
115+
overlayConfirmOffsets.set(250, 200);
116+
overlay.visible = false;
117+
add(overlay);
118+
119+
boyfriend.animation.callback = function(name:String, frameNumber:Int, frameIndex:Int)
120+
{
121+
switch(name)
122+
{
123+
case 'firstDeath':
124+
if(frameNumber >= 36 - 1)
125+
{
126+
overlay.visible = true;
127+
overlay.animation.play('deathLoop');
128+
boyfriend.animation.callback = null;
129+
}
130+
default:
131+
boyfriend.animation.callback = null;
132+
}
133+
}
134+
135+
if(PlayState.instance?.gf != null && PlayState.instance?.gf.curCharacter == 'nene')
136+
{
137+
var neneKnife:FlxSprite = new FlxSprite(boyfriend.x - 450, boyfriend.y - 250);
138+
neneKnife.frames = Paths.getSparrowAtlas('NeneKnifeToss');
139+
neneKnife.animation.addByPrefix('anim', 'knife toss', 24, false);
140+
neneKnife.antialiasing = ClientPrefs.data.antialiasing;
141+
neneKnife.animation.finishCallback = function(_)
142+
{
143+
remove(neneKnife);
144+
neneKnife.destroy();
145+
}
146+
insert(0, neneKnife);
147+
neneKnife.animation.play('anim', true);
148+
}
149+
}
150+
151+
deathbysquare = new FlxSprite().makeGraphic(500, 300, 0xFFFFFFFF);
152+
deathbysquare.scrollFactor.set();
153+
deathbysquare.x += 800;
154+
deathbysquare.y -= 100;
155+
deathbysquare.alpha = 0.3;
156+
add(deathbysquare);
157+
158+
var alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
159+
causeofdeath = new UnderTextParser(deathbysquare.x, deathbysquare.y + 125, Std.int(deathbysquare.width), "", 32);
160+
causeofdeath.scrollFactor.set();
161+
causeofdeath.font = Paths.font("fnf1.ttf");
162+
causeofdeath.color = 0xFFFFFFFF;
163+
for (letter in alphabet) {
164+
causeofdeath.soundOnChars.set(letter, FlxG.sound.load(Paths.sound('ut/uifont'), 1));
165+
causeofdeath.soundOnChars.set(letter.toUpperCase(), FlxG.sound.load(Paths.sound('ut/uifont'), 1));
166+
}
167+
add(causeofdeath);
168+
169+
super.create();
170+
}
171+
172+
override function update(elapsed:Float)
173+
{
174+
super.update(elapsed);
175+
176+
PlayState.instance?.callOnScripts('onUpdate', [elapsed]);
177+
178+
var justPlayedLoop:Bool = false;
179+
if (!boyfriend.isAnimationNull() && boyfriend.getAnimationName() == 'firstDeath' && boyfriend.isAnimationFinished())
180+
{
181+
boyfriend.playAnim('deathLoop');
182+
if(overlay != null && overlay.animation.exists('deathLoop'))
183+
{
184+
overlay.visible = true;
185+
overlay.animation.play('deathLoop');
186+
}
187+
justPlayedLoop = true;
188+
}
189+
190+
if(!isEnding)
191+
{
192+
if (controls.ACCEPT)
193+
{
194+
endBullshit();
195+
}
196+
else if (controls.BACK)
197+
{
198+
#if DISCORD_ALLOWED DiscordClient.resetClientID(); #end
199+
FlxG.camera.visible = false;
200+
FlxG.sound.music.stop();
201+
202+
Mods.loadTopMod();
203+
MusicBeatState.switchState(new FreeplayState());
204+
205+
FlxG.sound.playMusic(Paths.music('freakyMenu'));
206+
PlayState.instance?.callOnScripts('onGameOverConfirm', [false]);
207+
}
208+
else if (justPlayedLoop) coolStartDeath();
209+
210+
if (FlxG.sound.music.playing)
211+
{
212+
Conductor.songPosition = FlxG.sound.music.time;
213+
}
214+
}
215+
PlayState.instance?.callOnScripts('onUpdatePost', [elapsed]);
216+
}
217+
218+
var isEnding:Bool = false;
219+
function coolStartDeath(?volume:Float = 1):Void
220+
{
221+
FlxG.sound.music.play(true);
222+
FlxG.sound.music.volume = volume;
223+
causeofdeath.resetText(COD.getCOD());
224+
causeofdeath.start(0.05, true);
225+
}
226+
227+
function endBullshit():Void
228+
{
229+
if (!isEnding)
230+
{
231+
isEnding = true;
232+
if(boyfriend.hasAnimation('deathConfirm'))
233+
boyfriend.playAnim('deathConfirm', true);
234+
else if(boyfriend.hasAnimation('deathLoop'))
235+
boyfriend.playAnim('deathLoop', true);
236+
237+
if(overlay != null && overlay.animation.exists('deathConfirm'))
238+
{
239+
overlay.visible = true;
240+
overlay.animation.play('deathConfirm');
241+
overlay.offset.set(overlayConfirmOffsets.x, overlayConfirmOffsets.y);
242+
}
243+
FlxG.sound.music.stop();
244+
FlxG.sound.play(Paths.music(endSoundName));
245+
new FlxTimer().start(0.7, function(tmr:FlxTimer)
246+
{
247+
FlxG.camera.fade(FlxColor.BLACK, 2, false, function()
248+
{
249+
MusicBeatState.resetState();
250+
});
251+
});
252+
PlayState.instance?.callOnScripts('onGameOverConfirm', [true]);
253+
}
254+
}
255+
256+
override function destroy()
257+
{
258+
instance = null;
259+
super.destroy();
260+
}
261+
}

0 commit comments

Comments
 (0)