@@ -5,6 +5,8 @@ import haxe.ds.StringMap;
55import cutscenes .DialogueBoxPsych ;
66import flixel .util .FlxDestroyUtil ;
77import archipelago .TrapLinkFunctions ;
8+ import openfl .filters .ShaderFilter ;
9+ import flixel .addons .display .FlxRuntimeShader ;
810
911typedef Condition = {
1012 var checkFn : APItem -> Bool ;
@@ -329,22 +331,21 @@ class APItem {
329331 case " Phone Trap" | " Literature Trap" :
330332 return new APTrap (name , ConditionHelper . Everywhere (), function () {
331333 APPlayState .instance .inCutscene = true ;
332- APPlayState .instance .paused = true ;
334+ APPlayState .instance .pausePlayState () ;
333335 backend. MusicBeatState .revokeControls = (name == ' Phone Trap' );
334336 var psychDialogue : DialogueBoxPsych ;
335337 psychDialogue = new DialogueBoxPsych (DialogueBoxPsych .parseDialogue (Paths .json (' apthings/dialogue/' + FlxG .random .int (0 , 10 ))));
336338 psychDialogue .scrollFactor .set ();
337339 psychDialogue .autoScroller = (name == ' Phone Trap' );
338340 psychDialogue .finishThing = function () {
339- APPlayState .instance .paused = false ;
341+ APPlayState .instance .resumePlayState () ;
340342 APPlayState .instance .inCutscene = false ;
341343 backend. MusicBeatState .revokeControls = false ;
342344 FlxG .state .remove (psychDialogue );
343345 psychDialogue = null ;
344346 }
345- psychDialogue .screenCenter ();
346347 FlxG .state .add (psychDialogue );
347- popup (' You \' ve been Paralyzed! ' , ' TrapLink: $name ' );
348+ popup (' I hope you like reading... ' , ' TrapLink: $name ' );
348349 }, true , true ).funcAndReturn (function (t : APItem ) {
349350 // Set it as a trap.
350351 t .isTrap = true ;
@@ -450,20 +451,39 @@ class APItem {
450451 okayden .push (i );
451452 }
452453
453- var explosion = new FlxSprite ().loadGraphic (Paths .image (" streamervschat/explosion" ), true , 256 , 256 );
454- explosion .animation .add (" boom" , okayden , 60 , false );
455- explosion .animation .finishCallback = function (name ) {
456- explosion .visible = false ;
457- APPlayState .instance .remove (explosion );
458- explosion .kill ();
459- };
460- explosion .cameras = [APPlayState .instance .camHUD ];
461- explosion .animation .play (" boom" , true );
462- explosion .x = APPlayState .instance .boyfriend .x + APPlayState .instance .boyfriend .width / 2 - explosion .width / 2 ;
463- explosion .y = APPlayState .instance .boyfriend .y + APPlayState .instance .boyfriend .height / 2 - explosion .height / 2 ;
464- APPlayState .instance .add (explosion );
465- APPlayState .instance .boyfriend .animation .play (' hurt' , true );
466- APPlayState .instance .boyfriend .specialAnim = true ;
454+ if (FlxG .random .bool (18 )) {
455+ var explosion = new FlxSprite ().loadGraphic (Paths .image (" streamervschat/explosion" ), true , 256 , 256 );
456+ explosion .animation .add (" boom" , okayden , 60 , false );
457+ explosion .animation .finishCallback = function (name ) {
458+ explosion .visible = false ;
459+ APPlayState .instance .remove (explosion );
460+ explosion .kill ();
461+ };
462+ // explosion.cameras = [APPlayState.instance.camHUD];
463+ explosion .animation .play (" boom" , true );
464+ explosion .x = APPlayState .instance .boyfriend .x + APPlayState .instance .boyfriend .width / 2 - explosion .width / 2 ;
465+ explosion .y = APPlayState .instance .boyfriend .y + APPlayState .instance .boyfriend .height / 2 - explosion .height / 2 ;
466+ APPlayState .instance .add (explosion );
467+ APPlayState .instance .boyfriend .animation .play (' hurt' , true );
468+ APPlayState .instance .boyfriend .specialAnim = true ;
469+ } else {
470+ var explosion = new FlxSprite ().loadGraphic (Paths .image (" streamervschat/explosion" ), true , 256 , 256 );
471+ explosion .animation .add (" boom" , okayden , 60 , false );
472+ explosion .animation .finishCallback = function (name ) {
473+ explosion .visible = false ;
474+ APPlayState .instance .remove (explosion );
475+ explosion .kill ();
476+ };
477+ explosion .setGraphicSize (Std .int (explosion .width * 5 ));
478+ // explosion.cameras = [APPlayState.instance.camHUD];
479+ explosion .animation .play (" boom" , true );
480+ explosion .x = APPlayState .instance .boyfriend .x + APPlayState .instance .boyfriend .width / 2 - explosion .width / 2 ;
481+ explosion .y = APPlayState .instance .boyfriend .y + APPlayState .instance .boyfriend .height / 2 - explosion .height / 2 ;
482+ APPlayState .instance .add (explosion );
483+ APPlayState .instance .boyfriend .animation .play (' hurt' , true );
484+ APPlayState .instance .boyfriend .specialAnim = true ;
485+ APPlayState .instance .health - = 0.4 ;
486+ }
467487 popup (' That looked like it hurt' , " TrapLink: Damage Trap" );
468488 }, true , true ).funcAndReturn (function (t : APItem ) {
469489 // Set it as a trap.
@@ -501,12 +521,12 @@ class APItem {
501521 case " Deisometric Trap" :
502522 return new APTrap (name , ConditionHelper . PlayState (), function () {
503523 popup (' Can you tilt your screen? I can\' t see...' , " TrapLink: Deisometric Trap" );
504- for ( cam in FlxG . cameras . list ) {
505- if ( ! cam . filters . contains ( shaders. ShadersHandler . perspective ))
506- cam . filters . push ( shaders. ShadersHandler . perspective );
507- }
508- flixel.tweens. FlxTween .num (shaders. ShadersHandler . perspective . shader . data . zrot . value [ 0 ] , 0 , 15 , function (value : Float ) {
509- shaders. ShadersHandler . perspective . shader . data . zrot . value = [ value ] ;
524+ var pers : shaders. PerspectiveShader ;
525+ pers = new shaders. PerspectiveShader ();
526+ for ( cam in FlxG . cameras . list )
527+ cam . filters = [ new ShaderFilter ( pers )];
528+ flixel.tweens. FlxTween .num (pers . xrot , 0.45 , 1 , function (value : Float ) {
529+ pers . xrot = value ;
510530 });
511531 }, true , true ).funcAndReturn (function (t : APItem ) {
512532 // Set it as a trap.
@@ -517,6 +537,7 @@ class APItem {
517537 case " Push Trap" :
518538 return new APTrap (name , ConditionHelper . PlayState (), function () {
519539 popup (' You go bye bye now :)' , " TrapLink: Push Trap" );
540+ TrapLinkFunctions .bfPosition = [APPlayState .instance .boyfriend .x ,APPlayState .instance .boyfriend .y ];
520541 TrapLinkFunctions .doCarCrash (true );
521542 }, true , true ).funcAndReturn (function (t : APItem ) {
522543 // Set it as a trap.
@@ -570,7 +591,7 @@ class APItem {
570591 });
571592
572593 case " Zoom Trap" :
573- return new APTrap (name , ConditionHelper . PlayState (), function () {
594+ return new APTrap (name , ConditionHelper . Special (), function () {
574595 popup (' ZOOM!' , " TrapLink: Zoom Trap" );
575596 for (cam in FlxG .cameras .list ) {
576597 cam .zoom + = 5 ;
@@ -725,7 +746,7 @@ class APItem {
725746
726747 case " Confound Trap" :
727748 return new APTrap (name , ConditionHelper . PlayState (), function () {
728- popup (' FLASHBACG OUT' , ' TrapLink: Confound Trap' );
749+ popup (' FLASHBANG OUT' , ' TrapLink: Confound Trap' );
729750 APPlayState .instance .doEffect (' strongflashbang' );
730751 }, true , true ).funcAndReturn (function (t : APItem ) {
731752 // Set it as a trap.
0 commit comments