Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
dallmeyer committed Apr 20, 2024
2 parents 114895b + fb5b5d4 commit 2a2b42b
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 11 deletions.
3 changes: 2 additions & 1 deletion decompiler/config/jak1/all-types.gc
Original file line number Diff line number Diff line change
Expand Up @@ -1032,7 +1032,7 @@
(sidekick-hint-rounddoor #x23c)
(sidekick-hint-lurkerm #x23d)
(sidekick-hint-tower #x23e)

(sidekick-reminder-fish #x240)

(firecanyon-need-cells #x24f)
Expand Down Expand Up @@ -1653,6 +1653,7 @@
(speedrun-hub2-100 #x1522)
(speedrun-hub3-100 #x1523)
(speedrun-all-cutscenes #x1524)
(speedrun-low-collect #x1525)

;; input options
(input-options #x1600)
Expand Down
1 change: 1 addition & 0 deletions game/assets/jak1/text/game_custom_text_en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@
"1522": "HUB 2 100%",
"1523": "HUB 3 100%",
"1524": "ALL CUTSCENES",
"1525": "LOW COLLECT PRAC",
"1600": "INPUT OPTIONS",
"1601": "SELECT CONTROLLER",
"1602": "ANALOG DEADZONE",
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 @@ -801,6 +801,7 @@
(speedrun-hub2-100 #x1522)
(speedrun-hub3-100 #x1523)
(speedrun-all-cutscenes #x1524)
(speedrun-low-collect #x1525)

;; input options
(input-options #x1600)
Expand Down
3 changes: 2 additions & 1 deletion goal_src/jak1/game.gp
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@
:deps ;; no idea what these depend on, make it depend on the whole engine
("$OUT/obj/ticky.o")


"village_common/villagep-obs.gc"
"village_common/oracle.gc"

Expand Down Expand Up @@ -1727,7 +1728,7 @@
:deps
("$OUT/obj/display.o"
"$OUT/obj/decomp-h.o")

"engine/connect.gc"
"ui/text-h.gc"
"game/settings-h.gc"
Expand Down
33 changes: 25 additions & 8 deletions goal_src/jak1/levels/racer_common/racer.gc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
;; dgos: L1, FIC, LAV, MIS, OGR, RACERP, ROL

(define-extern *allow-zoomer-anywhere* symbol)

(define-extern *speedrun-info* speedrun-info-jak1)
(define-extern blocking-plane-destroy (function none))
(define-extern blocking-plane-spawn (function curve-control none :behavior process))

Expand Down Expand Up @@ -242,15 +242,32 @@
(set! (-> v1-25 height) (the float 80))
)
(set! (-> gp-0 flags) (font-flags shadow kerning large))
(print-game-text (lookup-text! *common-text* (text-id press-to-use) #f) gp-0 #f 128 22)
)
(if *allow-zoomer-anywhere* ;; if "self" is passed instead of #f, deloading level/zoomer will crash
(if (and (or (cpad-pressed? 0 circle) (= (-> self condition) 4)) (send-event *target* 'change-mode 'racing #f))
(go-virtual pickup (the-as (state collectable) (method-of-object self wait-for-return)))

(cond
((and (= (-> *speedrun-info* category) (speedrun-category low-collect-prac))
(= (-> (level-get-target-inside *level*) name) 'firecanyon)
(!= (-> *game-info* current-continue) (get-continue-by-name *game-info* "firecanyon-end"))
)
;; skip FCS for low-collect-prac
(print-game-text (lookup-text! *common-text* (text-id press-to-warp) #f) gp-0 #f 128 22)
(if (cpad-pressed? 0 circle)
(send-event *target* 'continue (get-continue-by-name *game-info* "firecanyon-end"))
)
)
(if (and (or (cpad-pressed? 0 circle) (= (-> self condition) 4)) (send-event *target* 'change-mode 'racing self))
(go-virtual pickup (the-as (state collectable) (method-of-object self wait-for-return)))
(*allow-zoomer-anywhere* ;; if "self" is passed instead of #f, deloading level/zoomer will crash
(print-game-text (lookup-text! *common-text* (text-id press-to-use) #f) gp-0 #f 128 22)
(if (and (or (cpad-pressed? 0 circle) (= (-> self condition) 4)) (send-event *target* 'change-mode 'racing #f))
(go-virtual pickup (the-as (state collectable) (method-of-object self wait-for-return)))
)
)
(else
;; vanilla
(print-game-text (lookup-text! *common-text* (text-id press-to-use) #f) gp-0 #f 128 22)
(if (and (or (cpad-pressed? 0 circle) (= (-> self condition) 4)) (send-event *target* 'change-mode 'racing self))
(go-virtual pickup (the-as (state collectable) (method-of-object self wait-for-return)))
)
)
)
)
)
)
Expand Down
1 change: 1 addition & 0 deletions goal_src/jak1/pc/features/speedruns-h.gc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
(hub2-100 118) ;; Hub 2 100% (all of Hub 1 completed)
(hub3-100 119) ;; Hub 3 100% (all of Hub 1+2 completed)
(all-cutscenes 120) ;; All Cutscenes
(low-collect-prac 121) ;; Low collectables Practice
)

(deftype speedrun-info-jak1 (structure)
Expand Down
11 changes: 10 additions & 1 deletion goal_src/jak1/pc/features/speedruns.gc
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,11 @@
;; spawn at the geyser warp gate checkpoint
(initialize! *game-info* 'game (the-as game-save #f) "intro-start")
)
(((speedrun-category low-collect-prac))
;; spawn at the geyser warp gate checkpoint

(initialize! *game-info* 'game (the-as game-save #f) "game-start")
)
(else
(format 0 "start-speedrun: unrecognized category ~S~%" (enum->string speedrun-category (-> *speedrun-info* category)))
)
Expand Down Expand Up @@ -416,6 +421,10 @@
(((speedrun-category all-cutscenes))
;; no post-blackout actions needed
)
(((speedrun-category low-collect-prac))
;; skip keira intro cutscene a
(close-specific-task! (game-task firecanyon-assistant) (task-status need-reward-speech))
)
(else
(format 0 "setup-speedrun-post-blackout: unrecognized category ~S~%" (enum->string speedrun-category (-> *speedrun-info* category)))
)
Expand Down Expand Up @@ -766,7 +775,7 @@
(when (-> *tmp-continue-point* level)
(set! *practice-spawn-post-init* custom-reset-multi-post-init)
;; fully reset game if r2 held too
(if (cpad-hold? 0 r2)
(if (cpad-hold? 0 r2)
(initialize! *game-info* 'game (the-as game-save #f) "default")
)
;; store last real checkpoint to restore later
Expand Down
4 changes: 4 additions & 0 deletions goal_src/jak1/pc/progress-pc.gc
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,7 @@
(new 'static 'game-option :option-type (game-option-type button) :name (text-id speedrun-hub2-100) :scale #t)
(new 'static 'game-option :option-type (game-option-type button) :name (text-id speedrun-hub3-100) :scale #t)
(new 'static 'game-option :option-type (game-option-type button) :name (text-id speedrun-all-cutscenes) :scale #t)
(new 'static 'game-option :option-type (game-option-type button) :name (text-id speedrun-low-collect) :scale #t)
(new 'static 'game-option :option-type (game-option-type button) :name (text-id back) :scale #t)
)
)
Expand Down Expand Up @@ -1798,6 +1799,9 @@
(((text-id speedrun-all-cutscenes))
(progress-fast-save-and-start-speedrun (speedrun-category all-cutscenes))
)
(((text-id speedrun-low-collect))
(progress-fast-save-and-start-speedrun (speedrun-category low-collect-prac))
)
)
(commit-to-file *pc-settings*)
;; other behaviors are hardcoded elsewhere because screw you.
Expand Down

0 comments on commit 2a2b42b

Please sign in to comment.