From b3d999dc31f485b6ddaf7ab444abd078f76aec8e Mon Sep 17 00:00:00 2001 From: Matt Dallmeyer Date: Mon, 20 May 2024 12:47:29 -0700 Subject: [PATCH] no klaww skip, fix temple/firecanyon checkpoint softlocks --- .../jak1/text/game_custom_text_en-US.json | 3 +- goal_src/jak1/engine/level/level.gc | 5 ++- goal_src/jak1/engine/mods/mod-custom-code.gc | 24 ------------- goal_src/jak1/engine/mods/mods-rco.gc | 34 +++++++++++++++++++ goal_src/jak1/engine/ui/text-h.gc | 1 + goal_src/jak1/pc/pckernel-h.gc | 2 ++ goal_src/jak1/pc/pckernel.gc | 2 ++ goal_src/jak1/pc/progress-pc.gc | 16 +++++---- 8 files changed, 54 insertions(+), 33 deletions(-) diff --git a/game/assets/jak1/text/game_custom_text_en-US.json b/game/assets/jak1/text/game_custom_text_en-US.json index e599b1e083..21fd19215b 100644 --- a/game/assets/jak1/text/game_custom_text_en-US.json +++ b/game/assets/jak1/text/game_custom_text_en-US.json @@ -247,5 +247,6 @@ "3009": "NO SNOWY FORT W/O FLUTFLUT", "300a": "NO EARLY BEACH TOWER", "300b": "NO EARLY MP SECRET CELL", - "300c": "NO BOULDER SKIP" + "300c": "NO BOULDER SKIP", + "300d": "NO KLAWW SKIPS" } diff --git a/goal_src/jak1/engine/level/level.gc b/goal_src/jak1/engine/level/level.gc index 50b0a10493..60b0712f59 100644 --- a/goal_src/jak1/engine/level/level.gc +++ b/goal_src/jak1/engine/level/level.gc @@ -1865,7 +1865,7 @@ ) ;; method 16 level-group (debug text stuff) - +(define-extern rco-continue-point-check (function none)) (defmethod level-update ((this level-group)) ;; this does nothing... @@ -1935,6 +1935,9 @@ ) ) + ;; special RCO continue-point checks to prevent softlocks/required skips + (rco-continue-point-check) + ;; determine vis info idx for each level (dotimes (v1-67 (-> this length)) (let ((a0-26 (-> this level v1-67))) diff --git a/goal_src/jak1/engine/mods/mod-custom-code.gc b/goal_src/jak1/engine/mods/mod-custom-code.gc index f2ab9da9b0..fee2fc5bd3 100644 --- a/goal_src/jak1/engine/mods/mod-custom-code.gc +++ b/goal_src/jak1/engine/mods/mod-custom-code.gc @@ -26,30 +26,6 @@ (rco-run-each-frame) - - - (when (and - (string= (the-as string (-> *game-info* current-continue name)) "firecanyon-end") - (not (task-closed? (game-task firecanyon-end) (task-status need-resolution))) - (not (logtest? (-> *target* control root-prim prim-core action) (collide-action racer))) - ) - (let ((a1-3 - (new 'stack 'font-context *font-default-matrix* 56 160 0.0 (font-color default) (font-flags shadow kerning)) - ) - ) - (let ((v1-5 a1-3)) - (set! (-> v1-5 width) (the float 400)) - ) - (let ((v1-6 a1-3)) - (set! (-> v1-6 height) (the float 96)) - ) - (set! (-> a1-3 flags) (font-flags shadow kerning middle middle-vert large)) - ;;(print-game-text "PRESS TO DIE" a1-3 #f 128 22) - (print-game-text "PRESS TRIANGLE TO GO BACK" a1-3 #f 128 22) - ) - (when (cpad-pressed? 0 triangle) (start 'play (get-continue-by-name *game-info* "village1-hut"))) - - ) (if *show-input-display* (input-display-on) (input-display-off) diff --git a/goal_src/jak1/engine/mods/mods-rco.gc b/goal_src/jak1/engine/mods/mods-rco.gc index c989699a4a..51312fd109 100644 --- a/goal_src/jak1/engine/mods/mods-rco.gc +++ b/goal_src/jak1/engine/mods/mods-rco.gc @@ -186,6 +186,12 @@ ) ;; require 45 cells before any MP or beyond cells ) + ((and (-> *rco-settings* no-klaww-skip?) + (not (-> *tasks-used* (game-task ogre-boss))) + (> rand-idx 66) ;; anything after ogre-boss + ) + ;; require klaww before anything else in MP or beyond cells + ) (else ;; OK to use this game-task-idx! (format 0 "RCO - idx ~D rand-idx ~D game-task-idx ~D using ~S ~%" idx rand-idx game-task-idx (game-task->string game-task-idx)) @@ -270,6 +276,34 @@ (none) ) +;; continue-point adjustments to prevent softlocks / required skips +(defun rco-continue-point-check () + (case (-> *game-info* current-continue name) :comp name= + (('firecanyon-end) + (when (and (not (task-complete? *game-info* (game-task firecanyon-end))) + (!= (-> *rco-info* task-list (-> *rco-info* task-list-idx)) (game-task firecanyon-end)) + ) + ;; swap firecanyon-end -> firecanyon-start if we dont have the cell and it isn't the active cell + (set-continue! *game-info* "firecanyon-start") + ) + ) + (('jungle-tower) + (when (and (-> *rco-settings* fj-no-early-plant-boss?) + (not (task-complete? *game-info* (game-task jungle-eggtop))) + (!= (-> *rco-info* task-list (-> *rco-info* task-list-idx)) (game-task jungle-plant)) + (!= (-> *rco-info* task-list (-> *rco-info* task-list-idx)) (game-task jungle-eggtop)) + ) + ;; swap jungle-tower -> jungle-start if we dont have blue switch cell and the active cell isn't a temple one + (set-continue! *game-info* "jungle-start") + ) + ) + (else + ;; (format 0 "some other checkpoint ~A~%" (-> *game-info* current-continue name)) + ) + ) + (none) + ) + (defun rco-run-each-frame () ;; check if current task is complete (loading save) (while (and *target* (< (-> *rco-info* task-list-idx) 101) (task-complete? *game-info* (-> *rco-info* task-list (-> *rco-info* task-list-idx)))) diff --git a/goal_src/jak1/engine/ui/text-h.gc b/goal_src/jak1/engine/ui/text-h.gc index 7daa612907..bca5d78bf7 100644 --- a/goal_src/jak1/engine/ui/text-h.gc +++ b/goal_src/jak1/engine/ui/text-h.gc @@ -852,6 +852,7 @@ (beach-no-early-tower #x300a) (mp-no-early-secret-cell #x300b) (no-boulder-skip #x300c) + (no-klaww-skip #x300d) ;; GAME-TEXT-ID ENUM ENDS ) diff --git a/goal_src/jak1/pc/pckernel-h.gc b/goal_src/jak1/pc/pckernel-h.gc index cb2b120774..1ea1e8cf96 100644 --- a/goal_src/jak1/pc/pckernel-h.gc +++ b/goal_src/jak1/pc/pckernel-h.gc @@ -295,6 +295,7 @@ (beach-no-early-tower? symbol) (mp-no-early-secret-cell? symbol) (no-boulder-skip? symbol) + (no-klaww-skip? symbol) ) (:methods (new (symbol type) _type_) @@ -364,6 +365,7 @@ (set! (-> obj beach-no-early-tower?) #f) (set! (-> obj mp-no-early-secret-cell?) #f) (set! (-> obj no-boulder-skip?) #f) + (set! (-> obj no-klaww-skip?) #f) (none)) diff --git a/goal_src/jak1/pc/pckernel.gc b/goal_src/jak1/pc/pckernel.gc index 84cd54138e..27a6e58aef 100644 --- a/goal_src/jak1/pc/pckernel.gc +++ b/goal_src/jak1/pc/pckernel.gc @@ -639,6 +639,7 @@ (format file " (beach-no-early-tower? ~A)~%" (-> obj beach-no-early-tower?)) (format file " (mp-no-early-secret-cell? ~A)~%" (-> obj mp-no-early-secret-cell?)) (format file " (no-boulder-skip? ~A)~%" (-> obj no-boulder-skip?)) + (format file " (no-klaww-skip? ~A)~%" (-> obj no-klaww-skip?)) (format file " )~%") (file-stream-close file) @@ -717,6 +718,7 @@ (("beach-no-early-tower?") (set! (-> obj beach-no-early-tower?) (file-stream-read-symbol file))) (("mp-no-early-secret-cell?") (set! (-> obj mp-no-early-secret-cell?) (file-stream-read-symbol file))) (("no-boulder-skip?") (set! (-> obj no-boulder-skip?) (file-stream-read-symbol file))) + (("no-klaww-skip?") (set! (-> obj no-klaww-skip?) (file-stream-read-symbol file))) ) ) ) diff --git a/goal_src/jak1/pc/progress-pc.gc b/goal_src/jak1/pc/progress-pc.gc index 855c7df669..7b3c768bc5 100644 --- a/goal_src/jak1/pc/progress-pc.gc +++ b/goal_src/jak1/pc/progress-pc.gc @@ -290,6 +290,7 @@ (new 'static 'game-option :option-type (game-option-type on-off) :name (text-id beach-no-early-tower) :scale #t) (new 'static 'game-option :option-type (game-option-type on-off) :name (text-id no-fcs) :scale #t) (new 'static 'game-option :option-type (game-option-type on-off) :name (text-id no-boulder-skip) :scale #t) + (new 'static 'game-option :option-type (game-option-type on-off) :name (text-id no-klaww-skip) :scale #t) (new 'static 'game-option :option-type (game-option-type on-off) :name (text-id mp-no-early-secret-cell) :scale #t) (new 'static 'game-option :option-type (game-option-type on-off) :name (text-id no-tree-hops) :scale #t) (new 'static 'game-option :option-type (game-option-type on-off) :name (text-id snowy-no-fortress-without-flut) :scale #t) @@ -1036,13 +1037,14 @@ (set! (-> *rco-options* 2 value-to-modify) (&-> *rco-settings* beach-no-early-tower?)) (set! (-> *rco-options* 3 value-to-modify) (&-> *rco-settings* no-fcs?)) (set! (-> *rco-options* 4 value-to-modify) (&-> *rco-settings* no-boulder-skip?)) - (set! (-> *rco-options* 5 value-to-modify) (&-> *rco-settings* mp-no-early-secret-cell?)) - (set! (-> *rco-options* 6 value-to-modify) (&-> *rco-settings* no-tree-hops?)) - (set! (-> *rco-options* 7 value-to-modify) (&-> *rco-settings* snowy-no-fortress-without-flut?)) - (set! (-> *rco-options* 8 value-to-modify) (&-> *rco-settings* snowy-no-gate-skip?)) - (set! (-> *rco-options* 9 value-to-modify) (&-> *rco-settings* no-lts?)) - (set! (-> *rco-options* 10 value-to-modify) (&-> *rco-settings* no-citadel-hops?)) - (set! (-> *rco-options* 11 value-to-modify) (&-> *rco-settings* nms-citadel?)) + (set! (-> *rco-options* 5 value-to-modify) (&-> *rco-settings* no-klaww-skip?)) + (set! (-> *rco-options* 6 value-to-modify) (&-> *rco-settings* mp-no-early-secret-cell?)) + (set! (-> *rco-options* 7 value-to-modify) (&-> *rco-settings* no-tree-hops?)) + (set! (-> *rco-options* 8 value-to-modify) (&-> *rco-settings* snowy-no-fortress-without-flut?)) + (set! (-> *rco-options* 9 value-to-modify) (&-> *rco-settings* snowy-no-gate-skip?)) + (set! (-> *rco-options* 10 value-to-modify) (&-> *rco-settings* no-lts?)) + (set! (-> *rco-options* 11 value-to-modify) (&-> *rco-settings* no-citadel-hops?)) + (set! (-> *rco-options* 12 value-to-modify) (&-> *rco-settings* nms-citadel?)) (set! (-> *gfx-ps2-options* 0 value-to-modify) (&-> *progress-carousell* int-backup)) (set! (-> *gfx-ps2-options* 1 value-to-modify) (&-> *progress-carousell* int-backup))