@@ -629,3 +629,156 @@ if config.RepeatableChaosTrials.Enabled then
629
629
end
630
630
end )
631
631
end
632
+
633
+ if config .Skip .Enabled then
634
+ if config .Skip .RunEndCutscene then
635
+ ModUtil .Path .Override (" EndEarlyAccessPresentation" , function ()
636
+ AddInputBlock ({ Name = " EndEarlyAccessPresentation" })
637
+ SetPlayerInvulnerable (" EndEarlyAccessPresentation" )
638
+
639
+ CurrentRun .Hero .Mute = true
640
+ CurrentRun .ActiveBiomeTimer = false
641
+ ToggleCombatControl (CombatControlsDefaults , false , " EarlyAccessPresentation" )
642
+
643
+ wait (0.1 )
644
+ StopAmbientSound ({ All = true })
645
+ SetAudioEffectState ({ Name = " Reverb" , Value = 1.5 })
646
+ EndAmbience (0.5 )
647
+ EndAllBiomeStates ()
648
+ FadeOut ({ Duration = 0.375 , Color = Color .Black })
649
+
650
+ -- first production / early access
651
+ EndBiomeRecords ()
652
+ RecordRunCleared ()
653
+
654
+ -- destroy the player / back to DeathArea
655
+ SetPlayerVulnerable (" EndEarlyAccessPresentation" )
656
+ RemoveInputBlock ({ Name = " EndEarlyAccessPresentation" })
657
+ ToggleCombatControl (CombatControlsDefaults , true , " EarlyAccessPresentation" )
658
+
659
+ CurrentRun .Hero .Mute = false
660
+ thread (Kill , CurrentRun .Hero )
661
+ wait (0.15 )
662
+
663
+ FadeIn ({ Duration = 0.5 })
664
+ end )
665
+
666
+ ModUtil .Path .Override (" KillHero" , function (victim , triggerArgs )
667
+ local killer = triggerArgs .AttackerTable
668
+ thread (CheckOnDeathPowers , victim , killer , triggerArgs .SourceWeapon )
669
+ for k , spawnThreadName in pairs (CurrentRun .CurrentRoom .SpawnThreads ) do
670
+ killTaggedThreads (spawnThreadName )
671
+ end
672
+ CurrentRun .CurrentRoom .SpawnThreads = {}
673
+ killWaitUntilThreads (" RequiredKillEnemyKilledOrSpawned" )
674
+ killWaitUntilThreads (" AllRequiredKillEnemiesDead" )
675
+ killWaitUntilThreads (" AllEncounterEnemiesDead" )
676
+ killWaitUntilThreads (" RequiredEnemyKilled" )
677
+ killWaitUntilThreads (UIData .BoonMenuId )
678
+ ClearGameplayElapsedTimeMultipliers ()
679
+ ClearPauseMenuTakeover ()
680
+ EndAmbience (0.5 )
681
+ EndMusic (AudioState .MusicId , AudioState .MusicName , triggerArgs .MusicEndTime or 0.0 )
682
+ if killer == nil then
683
+ killer = {}
684
+ killer .Name = triggerArgs .AttackerName
685
+ killer .ObjectId = triggerArgs .AttackerId
686
+ end
687
+ local killedByName = killer .Name or triggerArgs .SourceWeapon
688
+ CurrentRun .KilledByName = killedByName
689
+ GameState .LastKilledByName = killedByName or GameState .LastKilledByName
690
+ if GetConfigOptionValue ({ Name = " EditingMode" }) then
691
+ SetAnimation ({ Name = " ZagreusDeadStartBlood" , DestinationId = CurrentRun .Hero .ObjectId })
692
+ return
693
+ end
694
+ AddTimerBlock (CurrentRun , " HandleDeath" )
695
+ if ActiveScreens .TraitTrayScreen ~= nil then
696
+ TraitTrayScreenClose (ActiveScreens .TraitTrayScreen )
697
+ end
698
+ ClearHealthShroud ()
699
+ SessionMapState .HandlingDeath = true
700
+ CurrentRun .Hero .IsDead = true
701
+ CurrentRun .ActiveBiomeTimer = false
702
+ CurrentRun .ActiveBiomeTimerKeepsake = false
703
+ if ShouldIncrementEasyMode () then
704
+ GameState .EasyModeLevel = GameState .EasyModeLevel + 1
705
+ end
706
+ if not CurrentRun .Cleared then -- Already recorded if cleared
707
+ RecordRunStats ()
708
+ end
709
+ InvalidateCheckpoint ()
710
+ FinishTargetMarker (killer )
711
+ ResetObjectives ()
712
+ if killer .Name ~= nil and killer .ObjectId ~= nil and not killer .SkipModifiers then
713
+ GameState .CauseOfDeath = GetGenusName (killer )
714
+ end
715
+ local deathPresentationFunctionName = " DeathPresentation"
716
+ CallFunctionName (deathPresentationFunctionName , CurrentRun , killer , triggerArgs )
717
+ AddInputBlock ({ Name = " MapLoad" })
718
+
719
+ CurrentRun .CurrentRoom .EndingHealth = CurrentRun .Hero .Health
720
+ table.insert (CurrentRun .RoomHistory , CurrentRun .CurrentRoom )
721
+ UpdateRunHistoryCache (CurrentRun , CurrentRun .CurrentRoom )
722
+
723
+ GameState .Resources .Money = 0
724
+ CurrentRun .NumRerolls = GetTotalHeroTraitValue (" RerollCount" )
725
+ CurrentRun .NumTalentPoints = GetTotalHeroTraitValue (" TalentPointCount" )
726
+ CurrentRun .ShrineUpgradesDisabled = {}
727
+
728
+ GamePhaseTick ({ Ticks = GetDeathGamePhaseTicks (), SkipGarden = true })
729
+ SessionMapState .HandlingDeath = false
730
+ CurrentRun .Hero .Health = CurrentRun .Hero .MaxHealth
731
+ CurrentRun .Hero .HealthBuffer = 0
732
+ CurrentRun .Hero .Mana = CurrentRun .Hero .MaxMana
733
+ CurrentRun .Hero .ReserveManaSources = {}
734
+
735
+ if CurrentRun .Hero .Weapons .WeaponLob then
736
+ ReloadAmmo ({ Name = " WeaponLob" })
737
+ end
738
+ for resourceName , resourceData in pairs (ResourceData ) do
739
+ if resourceData .RunResource then
740
+ GameState .Resources [resourceName ] = 0
741
+ end
742
+ end
743
+ local currentRoom = CurrentRun .CurrentRoom
744
+ local deathMap = GameData .HubMapName
745
+ GameState .LocationName = HubRoomData .BaseHub .SaveProfileLocationText
746
+ RandomSetNextInitSeed ()
747
+ for deathMapName , deathMapData in pairs ( HubRoomData ) do
748
+ if deathMapData .OnDeathLoadRequirements ~= nil then
749
+ for k , gameStateRequirements in pairs ( deathMapData .OnDeathLoadRequirements ) do
750
+ if IsGameStateEligible ( CurrentRun , gameStateRequirements ) then
751
+ deathMap = deathMapName
752
+ break
753
+ end
754
+ end
755
+ end
756
+ end
757
+ CurrentRun .Hero .PreDeathTraits = CurrentRun .Hero .Traits
758
+ if config .Skip .RunEndCutscene .RespawnInTrainingGrounds then
759
+ deathMap = " Hub_PreRun"
760
+ end
761
+ RequestSave ({ StartNextMap = deathMap , DevSaveName = CreateDevSaveName (CurrentRun , { StartNextMap = deathMap , PostDeath = true , }), SendSave = true })
762
+ ClearUpgrades ()
763
+ SetConfigOption ({ Name = " FlipMapThings" , Value = false })
764
+ LoadMap ({ Name = deathMap , ResetBinks = true })
765
+ end )
766
+ end
767
+
768
+ if config .Skip .RunDialog then
769
+ ModUtil .Path .Wrap (" PlayTextLines" , function (base , source , textLines , args )
770
+ if CurrentRun .Hero .IsDead then
771
+ return base (source , textLines , args )
772
+ end
773
+ return
774
+ end )
775
+ end
776
+
777
+ if config .Skip .DeathCutScene then
778
+ ModUtil .Path .Context .Wrap (" DeathPresentation" , function ()
779
+ ModUtil .Path .Wrap (" wait" , function (...)
780
+ return
781
+ end )
782
+ end )
783
+ end
784
+ end
0 commit comments