From 9fd1782ffd67d002cdf36d98b6a18a801ebfda2f Mon Sep 17 00:00:00 2001 From: Hat Kid <6624576+Hat-Kid@users.noreply.github.com> Date: Sun, 17 Nov 2024 04:50:55 +0100 Subject: [PATCH] skip intro cutscene, give hero mode secrets, use `arena-fight-1-throne` --- goal_src/jak3/pc/features/autosplit-h.gc | 1 + goal_src/jak3/pc/features/autosplit.gc | 6 +- goal_src/jak3/pc/features/speedruns.gc | 104 +++++++++++++++++++++-- 3 files changed, 100 insertions(+), 11 deletions(-) diff --git a/goal_src/jak3/pc/features/autosplit-h.gc b/goal_src/jak3/pc/features/autosplit-h.gc index fefd7099d76..70f76cfc032 100644 --- a/goal_src/jak3/pc/features/autosplit-h.gc +++ b/goal_src/jak3/pc/features/autosplit-h.gc @@ -152,6 +152,7 @@ (res-city-jetboard-bbush uint8) (res-desert-bbush-destroy-interceptors uint8) ;; TODO misc other task-nodes + (arena-fight-1-throne uint8) ;; after arena 1 cutscene ;; TODO - orbs in level X ;; end marker just to make things look nice in a memory view (end-marker uint8 4)) diff --git a/goal_src/jak3/pc/features/autosplit.gc b/goal_src/jak3/pc/features/autosplit.gc index 023e09dda88..8d1109f41d1 100644 --- a/goal_src/jak3/pc/features/autosplit.gc +++ b/goal_src/jak3/pc/features/autosplit.gc @@ -235,11 +235,7 @@ (autosplit-flag-task-complete! res-city-jetboard-bbush city-jetboard-bbush) (autosplit-flag-task-complete! res-desert-bbush-destroy-interceptors desert-bbush-destroy-interceptors) ;; misc other tasks - ; (autosplit-flag-task-node-closed! tomb-poles-poles tomb-poles-poles) ;; left tomb/daxter boulder start - ; (autosplit-flag-task-node-closed! fortress-save-friends-introduction fortress-save-friends-introduction) ;; talk to torn (before rescue friends) - ; (autosplit-flag-task-node-closed! sewer-escort-get-gun sewer-escort-get-gun) ;; get peacemaker - ; (autosplit-flag-task-node-closed! forest-protect-introduction forest-protect-introduction) ;; talk to onin (protect samos) - ; (autosplit-flag-task-node-closed! forest-protect-meeting forest-protect-meeting) ;; talk to samos (protect samos) + (autosplit-flag-task-node-closed! arena-fight-1-throne arena-fight-1-throne) ;; after arena 1 cutscene ;; debug only, draw stuff to the screen so i don't have to stare at a memory editor (if AUTOSPLITTER_DEBUG (debug-draw this))) diff --git a/goal_src/jak3/pc/features/speedruns.gc b/goal_src/jak3/pc/features/speedruns.gc index 398c6f6afe3..9b88ceb22d9 100644 --- a/goal_src/jak3/pc/features/speedruns.gc +++ b/goal_src/jak3/pc/features/speedruns.gc @@ -72,6 +72,76 @@ (defmethod set-category! ((this speedrun-info) (category speedrun-category)) (set! (-> this category) category)) +(defconstant HERO_MODE_SECRETS + (game-secrets hero-mode + endless-ammo + invulnerable + endless-dark + endless-light + unlimited-turbos + vehicle-hit-points + board-fast + vehicle-fox + vehicle-mirage + vehicle-x-ride + darkjak-tracking + button-invis + gun-upgrade-red-1 + gun-upgrade-red-2 + gun-upgrade-red-3 + gun-upgrade-yellow-1 + gun-upgrade-yellow-2 + gun-upgrade-yellow-3 + gun-upgrade-blue-1 + gun-upgrade-blue-2 + gun-upgrade-blue-3 + gun-upgrade-dark-1 + gun-upgrade-dark-2 + gun-upgrade-dark-3 + gun-upgrade-ammo-red + gun-upgrade-ammo-yellow + gun-upgrade-ammo-blue + gun-upgrade-ammo-dark)) + +(defconstant HERO_MODE_FEATURES + (game-feature gun + gun-red-1 + gun-red-2 + gun-red-3 + gun-yellow-1 + gun-yellow-2 + gun-yellow-3 + gun-blue-1 + gun-blue-2 + gun-blue-3 + gun-dark-1 + gun-dark-2 + gun-dark-3 + board + gun-upgrade-yellow-ammo-1 + gun-upgrade-yellow-ammo-2 + gun-upgrade-red-ammo-1 + gun-upgrade-red-ammo-2 + gun-upgrade-blue-ammo-1 + gun-upgrade-blue-ammo-2 + gun-upgrade-dark-ammo-1 + gun-upgrade-dark-ammo-2 + board-launch + board-zap + darkjak + darkjak-bomb0 + darkjak-bomb1 + lightjak + lightjak-regen + lightjak-freeze + lightjak-shield + armor0 + armor1 + armor2 + armor3 + lighteco + darkeco)) + (defmethod start-run! ((this speedrun-info)) ;; randomize game id so the autosplitter knows to restart (reset! *autosplit-info-jak3*) @@ -83,19 +153,40 @@ ;; finalize any category specific setup code (case (-> this category) (((speedrun-category newgame-normal)) - (initialize! *game-info* 'game (the game-save #f) "intro-start" (the resetter-spec #f))) + (set! (-> *game-info* mode) 'debug) + (initialize! *game-info* 'game (the game-save #f) (the string #f) (the resetter-spec #f)) + (set! (-> *game-info* mode) 'play) + (start 'play (get-continue-by-name *game-info* "wasstada-jump-training")) + (play-task (game-task arena-training-1) 'debug #f)) (((speedrun-category newgame-heromode)) - (initialize! *game-info* 'game (the game-save #f) "intro-start-hero" (the resetter-spec #f))) + (process-spawn-function process + (lambda :behavior process () + (set! (-> *game-info* mode) 'debug) + (initialize! *game-info* 'game (the game-save #f) (the string #f) (the resetter-spec #f)) + (set! (-> *game-info* mode) 'play) + (logior! (-> *game-info* secrets) (game-secrets hero-mode)) + (logior! (-> *game-info* purchase-secrets) (game-secrets hero-mode)) + (start 'play (get-continue-by-name *game-info* "wasstada-jump-training")) + (play-task (game-task arena-training-1) 'debug #f) + (until (and *target* (= (-> *target* next-state name) 'target-stance)) + (suspend)) + (set! (-> *game-info* secrets) HERO_MODE_SECRETS) + (set! (-> *game-info* purchase-secrets) HERO_MODE_SECRETS) + (set! (-> *game-info* features) HERO_MODE_FEATURES)))) (((speedrun-category all-cheats-allowed)) - (initialize! *game-info* 'game (the game-save #f) "intro-start" (the resetter-spec #f))) + (process-spawn-function process + (lambda :behavior process () + (set! (-> *game-info* mode) 'debug) + (initialize! *game-info* 'game (the game-save #f) (the string #f) (the resetter-spec #f)) + (set! (-> *game-info* mode) 'play) + (start 'play (get-continue-by-name *game-info* "wasstada-jump-training")) + (play-task (game-task arena-training-1) 'debug #f)))) (((speedrun-category custom)) - (set-master-mode 'game) - (send-event (ppointer->process (-> *speedrun-manager* 0 popup-menu)) 'close-menu) (process-spawn-function process (lambda :behavior process () (clear *temp-string*) (pc-sr-mode-get-custom-category-continue-point (-> *speedrun-info* active-custom-category index) *temp-string*) - (if (string= *temp-string* "") + (if (string= *temp-string* EMPTY_STRING) (initialize! *game-info* 'game (the game-save #f) "intro-start" (the resetter-spec #f)) (initialize! *game-info* 'game (the game-save #f) *temp-string* (the resetter-spec #f))) (until (and *target* (= (-> *target* next-state name) 'target-stance)) @@ -116,6 +207,7 @@ ;; disable any active cheats (set! (-> *pc-settings* cheats) (pc-cheats))) (((speedrun-category custom)) + (set! (-> *game-info* purchase-secrets) (-> *speedrun-info* active-custom-category secrets)) (set! (-> *game-info* secrets) (-> *speedrun-info* active-custom-category secrets)) (logior! (-> *game-info* features) (-> *speedrun-info* active-custom-category features)) (logclear! (-> *game-info* features) (-> *speedrun-info* active-custom-category forbidden-features))