Skip to content

Commit

Permalink
Merge pull request #5 from OpenGOAL-Mods/misc-fixes
Browse files Browse the repository at this point in the history
no klaww skip, fix temple/firecanyon checkpoint softlocks
  • Loading branch information
dallmeyer authored May 20, 2024
2 parents 68b9381 + b3d999d commit 0fd0054
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 33 deletions.
3 changes: 2 additions & 1 deletion game/assets/jak1/text/game_custom_text_en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
5 changes: 4 additions & 1 deletion goal_src/jak1/engine/level/level.gc
Original file line number Diff line number Diff line change
Expand Up @@ -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...
Expand Down Expand Up @@ -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)))
Expand Down
24 changes: 0 additions & 24 deletions goal_src/jak1/engine/mods/mod-custom-code.gc
Original file line number Diff line number Diff line change
Expand Up @@ -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 <PAD_TRIANGLE> 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)
Expand Down
34 changes: 34 additions & 0 deletions goal_src/jak1/engine/mods/mods-rco.gc
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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))))
Expand Down
1 change: 1 addition & 0 deletions goal_src/jak1/engine/ui/text-h.gc
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
2 changes: 2 additions & 0 deletions goal_src/jak1/pc/pckernel-h.gc
Original file line number Diff line number Diff line change
Expand Up @@ -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_)
Expand Down Expand Up @@ -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))

Expand Down
2 changes: 2 additions & 0 deletions goal_src/jak1/pc/pckernel.gc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)))
)
)
)
Expand Down
16 changes: 9 additions & 7 deletions goal_src/jak1/pc/progress-pc.gc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 0fd0054

Please sign in to comment.