diff --git a/goal_src/jak3/levels/mine/prebot-states.gc b/goal_src/jak3/levels/mine/prebot-states.gc index 50ecd756d8..9f91506b87 100644 --- a/goal_src/jak3/levels/mine/prebot-states.gc +++ b/goal_src/jak3/levels/mine/prebot-states.gc @@ -358,6 +358,9 @@ ) ) (remove-setting! 'point-of-interest) + ;; og:preserve-this + (#when PC_PORT + (set! (-> *autosplit-info-jak3* prebot-dead?) 1)) ) :exit (behavior () (ja-channel-push! 1 (seconds 0.1)) diff --git a/goal_src/jak3/pc/features/autosplit-h.gc b/goal_src/jak3/pc/features/autosplit-h.gc index 77ed8631bd..0997e4d1d8 100644 --- a/goal_src/jak3/pc/features/autosplit-h.gc +++ b/goal_src/jak3/pc/features/autosplit-h.gc @@ -16,7 +16,8 @@ (num-skullgems uint32) (errol-dead? uint8) (all-collectables-acquired? uint8) - (padding-stats uint8 198) ;; padding for future growth + (prebot-dead? uint8) + (padding-stats uint8 197) ;; padding for future growth ;; loading/cutscene/control related info (game-hash uint32) (in-cutscene? uint8) diff --git a/goal_src/jak3/pc/features/autosplit.gc b/goal_src/jak3/pc/features/autosplit.gc index 25b920fc83..8627a7b177 100644 --- a/goal_src/jak3/pc/features/autosplit.gc +++ b/goal_src/jak3/pc/features/autosplit.gc @@ -250,11 +250,13 @@ (defmethod reset! ((this autosplit-info)) (set! (-> this game-hash) (pc-get-unix-timestamp)) - (set! (-> this errol-dead?) 0)) + (set! (-> this errol-dead?) 0) + (set! (-> this prebot-dead?) 0)) (defmethod debug-draw ((this autosplit-info)) (format (clear *temp-string*) "errol-dead?: ~D~%" (-> this errol-dead?)) (format *temp-string* "all-collectables-acquired?: ~D~%" (-> this all-collectables-acquired?)) + (format *temp-string* "prebot-dead?: ~D~%" (-> this prebot-dead?)) (with-dma-buffer-add-bucket ((buf (-> (current-frame) global-buf)) (bucket-id debug-no-zbuf1)) ;; reset bucket settings prior to drawing - font won't do this for us, and ;; draw-raw-image can sometimes mess them up. (intro sequence) diff --git a/goal_src/jak3/pc/features/speedruns.gc b/goal_src/jak3/pc/features/speedruns.gc index 294386ae69..5a2e4a0076 100644 --- a/goal_src/jak3/pc/features/speedruns.gc +++ b/goal_src/jak3/pc/features/speedruns.gc @@ -143,6 +143,10 @@ lighteco darkeco)) +(defun reset-speedrunner-mode-hm-secrets! ((obj pc-settings-jak3)) + (set! (-> obj speedrunner-mode-hm-secrets) (the-as uint64 HERO_MODE_SECRETS)) + (none)) + (define-extern reset-arena-trainer-globals (function none)) (defmethod start-run! ((this speedrun-info)) ;; turn on speedrun verification display @@ -175,9 +179,11 @@ (play-task (game-task arena-training-1) 'debug #f) (until (and *target* (!= (-> *target* next-state name) 'target-continue)) (suspend)) + (mark-played! (-> *talker-speech* 138)) ;; prevent 600 orbs popup + (send-event *target* 'get-pickup (pickup-type skill) 1000.0) (send-event *target* 'get-pickup (pickup-type gem) 1000.0) - (set! (-> *game-info* secrets) HERO_MODE_SECRETS) - (set! (-> *game-info* purchase-secrets) HERO_MODE_SECRETS) + (set! (-> *game-info* secrets) (the-as game-secrets (-> *pc-settings* speedrunner-mode-hm-secrets))) + (set! (-> *game-info* purchase-secrets) (the-as game-secrets (-> *pc-settings* speedrunner-mode-hm-secrets))) (set! (-> *game-info* features) HERO_MODE_FEATURES)))) (((speedrun-category all-cheats-allowed)) (process-spawn-function process @@ -395,6 +401,26 @@ :is-toggled? (lambda () (= (-> *speedrun-info* category) (speedrun-category all-cheats-allowed)))))) + (new 'static + 'popup-menu-dynamic-submenu + :label "Select Hero Mode secrets" + :get-length + (lambda () + 58) + :get-entry-label + (lambda ((index int) (str-dest string)) + (copy-string<-string str-dest (bitfield->string game-secrets index))) + :on-entry-confirm + (lambda ((index int)) + (logxor! (-> *pc-settings* speedrunner-mode-hm-secrets) (shl 1 index)) + (pc-settings-save)) + :entry-selected? + (lambda ((index int)) + (logtest? (-> *pc-settings* speedrunner-mode-hm-secrets) (shl 1 index))) + :on-reset + (lambda () + (reset-speedrunner-mode-hm-secrets! *pc-settings*) + (pc-settings-save))) (new 'static 'popup-menu-dynamic-submenu :label "Custom Category Select" diff --git a/goal_src/jak3/pc/pckernel-impl.gc b/goal_src/jak3/pc/pckernel-impl.gc index f6e30929f6..9f047de459 100644 --- a/goal_src/jak3/pc/pckernel-impl.gc +++ b/goal_src/jak3/pc/pckernel-impl.gc @@ -111,6 +111,7 @@ (controller-swap-r1-r2? symbol) (pacman-dpad? symbol) (speedrunner-mode-custom-bind uint32) + (speedrunner-mode-hm-secrets uint64) (memcard-subtitles? symbol) @@ -199,6 +200,7 @@ (set! (-> obj hinttitles?) #t) 0) +(define-extern reset-speedrunner-mode-hm-secrets! (function pc-settings-jak3 none)) (defmethod reset-extra ((obj pc-settings-jak3) (call-handlers symbol)) "Set the default goodies settings" @@ -214,6 +216,8 @@ (dotimes (i 6) (set! (-> obj flava-unlocked i) #f)) + (reset-speedrunner-mode-hm-secrets! obj) + ;(set! (-> obj stats) *statistics*) 0) diff --git a/goal_src/jak3/pc/pckernel.gc b/goal_src/jak3/pc/pckernel.gc index 02627f5398..1af0904b45 100644 --- a/goal_src/jak3/pc/pckernel.gc +++ b/goal_src/jak3/pc/pckernel.gc @@ -676,6 +676,8 @@ (set! (-> obj flava-unlocked i) (file-stream-read-symbol file)) ) ) + (("speedrunner-mode-hm-secrets") (set! (-> obj speedrunner-mode-hm-secrets) (file-stream-read-int file))) + ;; (("stats") ;; (dosettings (file) ;; (case-str *pc-temp-string* @@ -728,6 +730,8 @@ ) (format file ")~%") + (format file " (speedrunner-mode-hm-secrets #x~x)~%" (-> obj speedrunner-mode-hm-secrets)) + ;; (format file " (stats~%") ;; (format file " (kill-stats~%") ;; (dotimes (i KILL_STATS_MAX_ENEMY_TYPES)