Skip to content

Commit 29f8514

Browse files
committed
a handful of things
1 parent ca52e38 commit 29f8514

File tree

17 files changed

+1508
-61
lines changed

17 files changed

+1508
-61
lines changed

assets/shared/data/apthings/dialogue/0.json

Lines changed: 821 additions & 0 deletions
Large diffs are not rendered by default.
1.15 MB
Binary file not shown.
1.28 MB
Binary file not shown.
1.46 MB
Binary file not shown.

source/archipelago/APGameState.hx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -925,6 +925,12 @@ class APGameState
925925
waitForPlayState();
926926
case "Instant Death Trap":
927927
archipelago.APItem.createItemByName("Blue Balls Curse").fromTrapLink = true;
928+
case "Ghost":
929+
archipelago.APItem.createItemByName("Ghost").fromTrapLink = true;
930+
case "My Turn! Trap":
931+
archipelago.APItem.createItemByName("My Turn! Trap").fromTrapLink = true;
932+
case "Paralyze Trap":
933+
archipelago.APItem.createItemByName("Paralyze Trap").fromTrapLink = true;
928934
default:
929935
// If it's not a known trap, we can just log it.
930936
trace("Unknown trap link received: " + trapName + ".");

source/archipelago/APItem.hx

Lines changed: 456 additions & 0 deletions
Large diffs are not rendered by default.

source/archipelago/APPlayState.hx

Lines changed: 91 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ class APPlayState extends PlayState {
612612

613613
applyEffect(ttl, onEnd, playSound, playSoundVol, noIcon);
614614
},
615-
'flashbang' => function() {
615+
'strongflashbang' => function() {
616616
var noIcon:Bool = true;
617617
var playSound:String = "bang";
618618
if (flashbangTimer != null && flashbangTimer.active)
@@ -622,9 +622,9 @@ class APPlayState extends PlayState {
622622
whiteScreen.cameras = [camOther];
623623
add(whiteScreen);
624624
flashbangTimer.start(0.4, function(timer) {
625-
camOther.flash(FlxColor.WHITE, 7, null, true);
625+
camOther.flash(FlxColor.WHITE, 15, null, true);
626626
remove(whiteScreen);
627-
FlxG.sound.play(Paths.sound('streamervschat/ringing'), 0.4);
627+
FlxG.sound.play(Paths.sound('streamervschat/ringingex'), 0.4);
628628
});
629629
applyEffect(0, null, playSound, 1, noIcon);
630630
},
@@ -660,6 +660,14 @@ class APPlayState extends PlayState {
660660
addNoteSvCLegacy(0, i, i);
661661
}
662662
},
663+
'insanespam' => function() {
664+
var noIcon:Bool = true;
665+
var startingPoint = FlxG.random.int(5, 39);
666+
var endingPoint = FlxG.random.int(startingPoint + 5, startingPoint + 10);
667+
for (i in startingPoint...endingPoint) {
668+
addNoteSvCLegacy(0, i, i);
669+
}
670+
},
663671
'sever' => function() {
664672
var ttl:Float = 6;
665673
var onEnd:(Void->Void) = function() {
@@ -702,6 +710,48 @@ class APPlayState extends PlayState {
702710

703711
applyEffect(ttl, onEnd, playSound, playSoundVol, noIcon, alwaysEnd);
704712
},
713+
'permasever' => function() {
714+
var ttl:Float = 6;
715+
var playSound:String = "sever";
716+
var playSoundVol:Float = 1;
717+
var noIcon:Bool = false;
718+
var alwaysEnd:Bool = false;
719+
var onEnd:(Void->Void) = function() {
720+
trace("Nah, I don't feel like giving it back");
721+
};
722+
723+
var chooseFrom:Array<Int> = [];
724+
for (i in 0...severInputs.length) {
725+
if (!severInputs[i])
726+
chooseFrom.push(i);
727+
}
728+
if (chooseFrom.length <= 0)
729+
picked = FlxG.random.int(0, 3);
730+
else
731+
picked = chooseFrom[FlxG.random.int(0, chooseFrom.length - 1)];
732+
playerField.strumNotes[picked].alpha = 0;
733+
severInputs[picked] = true;
734+
735+
var okayden:Array<Int> = [];
736+
for (i in 0...64) {
737+
okayden.push(i);
738+
}
739+
var baseY = ClientPrefs.data.downScroll ? (FlxG.height - 150) : 50;
740+
var explosion = new FlxSprite().loadGraphic(Paths.image("streamervschat/explosion"), true, 256, 256);
741+
explosion.animation.add("boom", okayden, 60, false);
742+
explosion.animation.finishCallback = function(name) {
743+
explosion.visible = false;
744+
remove(explosion);
745+
explosion.kill();
746+
};
747+
explosion.cameras = [camHUD];
748+
explosion.x = (playerField.strumNotes[picked].x - playerField.baseXPositions[picked]) + playerField.strumNotes[picked].width / 2 - explosion.width / 2;
749+
explosion.y = (playerField.strumNotes[picked].y - baseY) + playerField.strumNotes[picked].height / 2 - explosion.height / 2;
750+
explosion.animation.play("boom", true);
751+
add(explosion);
752+
753+
applyEffect(ttl, onEnd, playSound, playSoundVol, noIcon, alwaysEnd);
754+
},
705755
'shake' => function() {
706756
var noIcon:Bool = false;
707757
var playSound:String = "shake";
@@ -725,6 +775,22 @@ class APPlayState extends PlayState {
725775

726776
applyEffect(ttl, onEnd, playSound, playSoundVol, noIcon);
727777
},
778+
'poisonbutworse' => function() {
779+
var ttl:Float = 5;
780+
var onEnd:(Void->Void) = function() {
781+
trace("Nah, you're still poisoned");
782+
};
783+
var playSound:String = "poison";
784+
var playSoundVol:Float = 0.6;
785+
var noIcon:Bool = false;
786+
787+
dmgMultiplier = 0.3;
788+
789+
drainHealth = true;
790+
boyfriend.color = 0xf003fc;
791+
792+
applyEffect(ttl, onEnd, playSound, playSoundVol, noIcon);
793+
},
728794
'dizzy' => function() {
729795
var ttl:Float = 8;
730796
var onEnd:(Void->Void) = function() {
@@ -881,6 +947,23 @@ class APPlayState extends PlayState {
881947
addNoteSvCLegacy(4, nextPoint, nextPoint, -1);
882948
addNoteSvCLegacy(4, lastPoint, lastPoint, -1);
883949
},
950+
'icebutmoreagressive' => function() {
951+
var noIcon:Bool = true;
952+
var lastPoint:Int = 0;
953+
var exList:Array<Int> = [];
954+
for (note in 0...10) {
955+
var startPoint:Int = FlxG.random.int(5, 39, exList);
956+
if (lastPoint == 0) {
957+
addNoteSvCLegacy(4, startPoint, startPoint, -1);
958+
lastPoint = startPoint;
959+
exList.push(startPoint);
960+
}
961+
else {
962+
addNoteSvCLegacy(4, lastPoint + 2, startPoint + 6, -1);
963+
lastPoint = 0;
964+
}
965+
}
966+
},
884967
'randomize' => function() {
885968
var ttl:Float = 10;
886969
var availableS:String = "";
@@ -1755,7 +1838,7 @@ class APPlayState extends PlayState {
17551838
field.clearStackedNotes();
17561839
}
17571840

1758-
var isFrozen:Bool = false;
1841+
public var isFrozen:Bool = false;
17591842
var doRandomize:Bool = false;
17601843
override public function update(elapsed:Float)
17611844
{
@@ -1983,9 +2066,13 @@ class APPlayState extends PlayState {
19832066
});
19842067
trace("Ghost Chat Re-activated!");
19852068
}
2069+
2070+
if (bfAscend) boyfriendGroup.y += 0.001;
2071+
19862072
super.update(elapsed);
19872073
}
19882074

2075+
public var bfAscend:Bool = false;
19892076
var alreadySent:Bool = false;
19902077
override function doDeathCheck(?skipHealthCheck:Bool = false):Bool
19912078
{

source/backend/MusicBeatState.hx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class MusicBeatState extends FlxState
2121
public static var APFlip(get, set):Bool;
2222

2323
public static var words:Dynamic = yutautil.modules.SyncUtils.syncHttpRequestJson("https://random-word-api.herokuapp.com/all");
24+
public static var revokeControls:Bool = false;
2425

2526
private static function get_APFlip():Bool
2627
return _apFlip;
@@ -57,7 +58,7 @@ public var controls(get, never):Controls;
5758

5859
private function get_controls()
5960
{
60-
return Controls.instance;
61+
return if (!revokeControls) Controls.instance else null;
6162
}
6263

6364
var _psychCameraInitialized:Bool = false;

source/backend/modules/EvacuateDebugPlugin.hx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package backend.modules;
22

33
import flixel.FlxBasic;
4+
import cutscenes.DialogueBoxPsych;
45

56
/**
67
* A plugin which adds functionality to press `F4` to immediately transition to the main menu.
@@ -26,6 +27,26 @@ class EvacuateDebugPlugin extends FlxBasic
2627
{
2728
FlxG.switchState(new states.MainMenuState());
2829
}
30+
31+
if (FlxG.keys.justPressed.F5)
32+
{
33+
states.PlayState.instance.inCutscene = true;
34+
states.PlayState.instance.paused = true;
35+
backend.MusicBeatState.revokeControls = true;
36+
var psychDialogue:DialogueBoxPsych;
37+
psychDialogue = new DialogueBoxPsych(DialogueBoxPsych.parseDialogue(Paths.json('apthings/dialogue/0')));
38+
psychDialogue.scrollFactor.set();
39+
psychDialogue.autoScroller = true;
40+
psychDialogue.finishThing = function() {
41+
states.PlayState.instance.paused = false;
42+
states.PlayState.instance.inCutscene = false;
43+
backend.MusicBeatState.revokeControls = false;
44+
FlxG.state.remove(psychDialogue);
45+
psychDialogue = null;
46+
}
47+
//psychDialogue.screenCenter();
48+
FlxG.state.add(psychDialogue);
49+
}
2950
}
3051

3152
public override function destroy():Void

source/cutscenes/DialogueBoxPsych.hx

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ class DialogueBoxPsych extends FlxSpriteGroup
5858
var staticDialList:Array<DialogueLine> = [];
5959
//var charPositionList:Array<String> = ['left', 'center', 'right'];
6060

61+
public var autoScroller:Bool = false;
62+
public var autoScrollerTimer:Float = 3;
63+
var asCurTimer:Float = 0;
64+
6165
public function new(dialogueList:DialogueFile, ?song:String = null)
6266
{
6367
super();
@@ -172,7 +176,7 @@ class DialogueBoxPsych extends FlxSpriteGroup
172176
if(!dialogueEnded) {
173177

174178
var back:Bool = Controls.instance.BACK;
175-
if((Controls.instance.ACCEPT || back) && box.visible) {
179+
if((Controls.instance.ACCEPT || back) && box.visible && !autoScroller) {
176180
if(!style.isLineFinished() && !back)
177181
{
178182
style.finishLine();
@@ -195,6 +199,14 @@ class DialogueBoxPsych extends FlxSpriteGroup
195199
FlxG.sound.play(Paths.sound(closeSound), closeVolume);
196200
style.advanceBoxLine(startNextDialog.bind(false));
197201
}
202+
} else if(style.isLineFinished() && autoScroller && currentText < dialogueList.dialogue.length && asCurTimer == 0) {
203+
FlxG.sound.play(Paths.sound(closeSound), closeVolume);
204+
asCurTimer = autoScrollerTimer;
205+
style.advanceBoxLine(startNextDialog.bind(false));
206+
} else if(style.isLineFinished() && autoScroller && currentText >= dialogueList.dialogue.length) {
207+
skipDialogue(false);
208+
asCurTimer = autoScrollerTimer;
209+
FlxG.sound.play(Paths.sound(closeSound), closeVolume);
198210
} else if(style.isLineFinished()) {
199211
var char:DialogueCharacter = arrayCharacters[lastCharacter];
200212
if(char != null && char.animation.curAnim != null && char.animationIsLoop() && char.animation.finished) {
@@ -292,10 +304,18 @@ class DialogueBoxPsych extends FlxSpriteGroup
292304
kill();
293305
}
294306
}
307+
308+
if (asCurTimer > 0)
309+
asCurTimer -= 0.05;
310+
else if (asCurTimer < 0) // to prevent an overflow
311+
asCurTimer = 0;
312+
313+
//trace(asCurTimer);
314+
295315
super.update(elapsed_real);
296316
}
297317

298-
function skipDialogue(){
318+
function skipDialogue(?fadeMusic:Bool = false){
299319
dialogueEnded = true;
300320
style.playBoxAnim(style.last_position,CLOSE_FINISH,lastBoxType);
301321
if(daText != null)
@@ -305,7 +325,7 @@ class DialogueBoxPsych extends FlxSpriteGroup
305325
daText.destroy();
306326
}
307327
skipText.visible = false;
308-
FlxG.sound.music.fadeOut(1, 0, (_) -> FlxG.sound.music.stop());
328+
if (fadeMusic) FlxG.sound.music.fadeOut(1, 0, (_) -> FlxG.sound.music.stop());
309329
}
310330

311331
var lastCharacter:Int = -1;

0 commit comments

Comments
 (0)