[jak3] Implement city-peace and desert-peace cheats (#4079)

https://www.youtube.com/watch?v=VrEfiMFvUKU
This commit is contained in:
Matt Dallmeyer
2025-11-20 15:27:01 +00:00
committed by GitHub
parent 0385c76811
commit 2e7bbf2110
12 changed files with 177 additions and 21 deletions
+8 -7
View File
@@ -10142,13 +10142,14 @@
(progress-cheats-weather-bad #x1261)
(progress-cheats-weather-good #x1262)
(progress-cheats-hijack-lines #x1263)
(progress-cheats-locked #x1264)
(progress-cheats-turbo-board-unlock #x1265)
(progress-cheats-health-bars-unlock #x1266)
(progress-cheats-vehicle-health-bars-unlock #x1267)
(progress-cheats-statistics-unlock #x1268)
(progress-cheats-suck-in-all-unlock #x1269)
(progress-cheats-fast-travel-unlock #x126a)
(progress-cheats-desert-peace #x1264)
(progress-cheats-locked #x1265)
(progress-cheats-turbo-board-unlock #x1266)
(progress-cheats-health-bars-unlock #x1267)
(progress-cheats-vehicle-health-bars-unlock #x1268)
(progress-cheats-statistics-unlock #x1269)
(progress-cheats-suck-in-all-unlock #x126a)
(progress-cheats-fast-travel-unlock #x126b)
; (progress-camera-options #x1280)
; (progress-camera-options-first-horz #x1281)
; (progress-camera-options-first-vert #x1282)
@@ -100,13 +100,14 @@
"1261": "Bad Weather",
"1262": "Nice Weather",
"1263": "Vehicle Hijack Voice Lines",
"1264": "Locked",
"1265": "Hit all 3 valves and find Mar's Statue in \"~S\" in under ~D seconds",
"1266": "Reduce Haven City's population count by ~D",
"1267": "Reduce Haven City's vehicle count by ~D",
"1268": "Hunt every species of Metal Head",
"1269": "Use the JET-Board to break open containers",
"126a": "Transport the Rift Rider while leaving Samos and Young Samos unscathed",
"1264": "Pacified Wasteland",
"1265": "Locked",
"1266": "Hit all 3 valves and find Mar's Statue in \"~S\" in under ~D seconds",
"1267": "Reduce Haven City's population count by ~D",
"1268": "Reduce Haven City's vehicle count by ~D",
"1269": "Hunt every species of Metal Head",
"126a": "Use the JET-Board to break open containers",
"126b": "Transport the Rift Rider while leaving Samos and Young Samos unscathed",
"1280": "Camera Options",
"1281": "Left/Right (1st Person)",
"1282": "Up/Down (1st Person)",
+2
View File
@@ -149,6 +149,8 @@
;(progress-cheats-fast-speed fast-speed #t nest-boss-resolution :skill 250)
;(progress-cheats-slow-speed slow-speed #t nest-boss-resolution :skill 250)
;(progress-cheats-statistics statistics auto atoll-water-introduction :unlock (progress-cheats-statistics-unlock pc-cheat-statistics-unlock))
;(progress-cheats-city-peace city-peace #t nest-boss-resolution :skill 200)
;(progress-cheats-hijack-lines hijack-lines #t nest-boss-resolution :skill 200)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -3175,6 +3175,13 @@
(send-event *target* 'change-mode 'pilot #f arg0 #t)
)
(defun dm-game-opengoal-cheat-toggle-pick-func ((arg0 int) (arg1 debug-menu-msg))
(if (= arg1 (debug-menu-msg press))
(logxor! (-> *pc-settings* cheats) (the-as uint (/ arg0 8)))
)
(logtest? (-> *pc-settings* cheats) (/ arg0 8))
)
(defun stop-watch-display ((arg0 object) (arg1 object))
(let ((v1-3 (- (-> *display* base-clock frame-counter) (-> *game-info* stop-watch-start))))
(format arg1 "Stop watch ~D:~D:~D~%" (/ v1-3 #x4650) (/ (mod v1-3 #x4650) 300) (/ (* 100 (mod v1-3 300)) 300))
@@ -3469,6 +3476,28 @@
(flag "gun-upgrade-ammo-blue" 56 dm-game-secret-toggle-pick-func)
(flag "gun-upgrade-ammo-dark" 57 dm-game-secret-toggle-pick-func)
)
;; og:preserve-this new menu
(menu
"OpenGOAL Cheats"
(flag "turbo-board" 1 dm-game-opengoal-cheat-toggle-pick-func)
(flag "health-bars" 2 dm-game-opengoal-cheat-toggle-pick-func)
(flag "vehicle-health-bars" 4 dm-game-opengoal-cheat-toggle-pick-func)
(flag "vehicle-invuln" 8 dm-game-opengoal-cheat-toggle-pick-func)
(flag "statistics" 16 dm-game-opengoal-cheat-toggle-pick-func)
(flag "suck-in-all" 32 dm-game-opengoal-cheat-toggle-pick-func)
(flag "music-player" 64 dm-game-opengoal-cheat-toggle-pick-func)
(flag "no-textures" 128 dm-game-opengoal-cheat-toggle-pick-func)
(flag "fast-speed" 256 dm-game-opengoal-cheat-toggle-pick-func)
(flag "slow-speed" 512 dm-game-opengoal-cheat-toggle-pick-func)
(flag "fast-travel" 1024 dm-game-opengoal-cheat-toggle-pick-func)
(flag "orb-tracker" 2048 dm-game-opengoal-cheat-toggle-pick-func)
(flag "real-time-of-day" 4096 dm-game-opengoal-cheat-toggle-pick-func)
(flag "city-peace" 8192 dm-game-opengoal-cheat-toggle-pick-func)
(flag "board-tricks" 16384 dm-game-opengoal-cheat-toggle-pick-func)
(flag "weather-bad" 32768 dm-game-opengoal-cheat-toggle-pick-func)
(flag "weather-good" 65536 dm-game-opengoal-cheat-toggle-pick-func)
(flag "desert-peace" 131072 dm-game-opengoal-cheat-toggle-pick-func)
)
(function "Print Load State" #f ,(lambda ((arg0 int) (arg1 debug-menu-msg) (arg2 float))
(dotimes (gp-0 11)
(let ((s5-0 (-> *level* level gp-0)))
+8 -7
View File
@@ -1447,13 +1447,14 @@
(progress-cheats-weather-bad #x1261)
(progress-cheats-weather-good #x1262)
(progress-cheats-hijack-lines #x1263)
(progress-cheats-locked #x1264)
(progress-cheats-turbo-board-unlock #x1265)
(progress-cheats-health-bars-unlock #x1266)
(progress-cheats-vehicle-health-bars-unlock #x1267)
(progress-cheats-statistics-unlock #x1268)
(progress-cheats-suck-in-all-unlock #x1269)
(progress-cheats-fast-travel-unlock #x126a)
(progress-cheats-desert-peace #x1264)
(progress-cheats-locked #x1265)
(progress-cheats-turbo-board-unlock #x1266)
(progress-cheats-health-bars-unlock #x1267)
(progress-cheats-vehicle-health-bars-unlock #x1268)
(progress-cheats-statistics-unlock #x1269)
(progress-cheats-suck-in-all-unlock #x126a)
(progress-cheats-fast-travel-unlock #x126b)
; (progress-camera-options #x1280)
; (progress-camera-options-first-horz #x1281)
; (progress-camera-options-first-vert #x1282)
@@ -672,6 +672,23 @@
(-> a1-13 guard-info-normal min-target-count)
)
)
;; og:preserve-this peaceful city cheat
(#when PC_PORT
(when (and (pc-cheats? (-> *pc-settings* cheats) city-peace)
(not (task-node-open? (game-task-node city-port-fight-resolution)))
(not (task-node-open? (game-task-node city-port-assault-resolution)))
(not (task-node-open? (game-task-node city-protect-hq-resolution)))
)
(dotimes (guard-info-type 3) ;; normal/war/mission
(when (= (-> a1-13 data guard-info-type object-type) (traffic-type guard-a))
(set! (-> a1-13 data guard-info-type target-count) (-> a1-13 data guard-info-type min-target-count))
;; (set! (-> this alert-level) 0)
(when (zero? (-> a1-13 data guard-info-type target-count))
(send-event *traffic-manager* 'deactivate-by-type (-> a1-13 data guard-info-type object-type)))
)
)
)
)
)
)
)
@@ -180,6 +180,25 @@
(dotimes (v1-3 3)
(dotimes (a1-3 4)
(let ((a2-12 (the-as kg-squad-settings (+ (+ (* a1-3 16) 860 (* v1-3 64)) (the-as int this)))))
;; og:preserve-this peaceful city cheat
(#when PC_PORT
(when (and (pc-cheats? (-> *pc-settings* cheats) city-peace)
(not (task-node-open? (game-task-node city-port-fight-resolution)))
(not (task-node-open? (game-task-node city-port-assault-resolution)))
(not (task-node-open? (game-task-node city-protect-hq-resolution)))
)
(dotimes (squad-setting-type 4) ;; roboguard/roboguard-giant/flying-turret/spydroid
(when (or (= (-> a2-12 kg-enemy-settings squad-setting-type object-type) (traffic-type roboguard))
(= (-> a2-12 kg-enemy-settings squad-setting-type object-type) (traffic-type flying-turret))
(= (-> a2-12 kg-enemy-settings squad-setting-type object-type) (traffic-type spydroid)))
(set! (-> a2-12 kg-enemy-settings squad-setting-type target-count) (-> a2-12 kg-enemy-settings squad-setting-type min-target-count))
(set! (-> this alert-level) 0)
(when (zero? (-> a2-12 kg-enemy-settings squad-setting-type target-count))
(send-event *traffic-manager* 'deactivate-by-type (-> a2-12 kg-enemy-settings squad-setting-type object-type)))
)
)
)
)
(+! (-> this
traffic
object-type-info-array
@@ -260,6 +279,9 @@
(copy-squad-settings-to-idx this *default-kg-squad-member-settings* 0)
)
)
;; og:preserve-this - restore war/mission squad settings (e.g. if city-peace cheat is toggled on->off)
(copy-squad-settings-to-idx this *war-kg-squad-member-settings* 1)
(copy-squad-settings-to-idx this *default-kg-squad-member-settings* 2)
(kg-squad-control-method-51 this)
(kg-squad-control-method-53 this)
(when *cty-faction-manager*
@@ -109,6 +109,21 @@
(dotimes (v1-0 3)
(dotimes (a1-0 3)
(let ((a3-2 (the-as mh-squad-settings (+ (+ (* a1-0 16) 828 (* 48 v1-0)) (the-as int this)))))
;; og:preserve-this peaceful city cheat
(#when PC_PORT
(when (and (pc-cheats? (-> *pc-settings* cheats) city-peace)
(not (task-node-open? (game-task-node city-port-fight-resolution)))
(not (task-node-open? (game-task-node city-port-assault-resolution)))
(not (task-node-open? (game-task-node city-protect-hq-resolution)))
)
(dotimes (squad-setting-type 3) ;; grunt/flitter/predator
(set! (-> a3-2 mh-enemy-settings squad-setting-type target-count) (-> a3-2 mh-enemy-settings squad-setting-type min-target-count))
(set! (-> this alert-level) 0)
(when (zero? (-> a3-2 mh-enemy-settings squad-setting-type target-count))
(send-event *traffic-manager* 'deactivate-by-type (-> a3-2 mh-enemy-settings squad-setting-type object-type)))
)
)
)
(set! (-> this traffic object-type-info-array 0 target-counts (+ v1-0 (* (-> a3-2 grunt-settings object-type) 32)))
(max
(min (-> a3-2 grunt-settings target-count) (-> a3-2 grunt-settings max-target-count))
@@ -140,6 +155,17 @@
)
)
)
;; og:preserve-this - restore war/mission squad settings (e.g. if city-peace cheat is toggled on->off)
(copy-squad-settings-to-idx
this
(the-as (inline-array mh-squad-member-settings) *war-mh-squad-member-settings*)
1
)
(copy-squad-settings-to-idx
this
(the-as (inline-array mh-squad-member-settings) *default-mh-squad-member-settings*)
2
)
(when *cty-faction-manager*
(let ((a2-2 (if (-> *setting-control* user-current mh-enemy-settings)
7
+18
View File
@@ -2600,6 +2600,24 @@
(set-time! (-> self state-time))
)
:trans (behavior ()
;; og:preserve-this peaceful city cheat
(#when PC_PORT
(when (and (pc-cheats? (-> *pc-settings* cheats) city-peace)
(not (task-node-open? (game-task-node city-port-fight-resolution)))
(not (task-node-open? (game-task-node city-port-assault-resolution)))
(not (task-node-open? (game-task-node city-protect-hq-resolution)))
)
(dotimes (s5-0 (-> self spawner records length))
(let ((v1-11 (as-type (handle->process (-> self spawner records data s5-0 proc)) process-focusable)))
(when v1-11
(if (not (focus-test? (the-as process-focusable v1-11) disable dead inactive))
(send-event v1-11 'traffic-off-force)
)
)
)
)
)
)
(when (time-elapsed? (-> self state-time) (seconds 1))
(set-time! (-> self state-time))
(let ((gp-0 0))
@@ -334,6 +334,24 @@
)
)
)
;; og:preserve-this peaceful wasteland cheat
(#when PC_PORT
(when (pc-cheats? (-> *pc-settings* cheats) desert-peace)
(set! (-> this target-count) 0)
(dotimes (s4-1 10)
(let ((s3-0 (as-type (handle->process (-> this units s4-1)) process-focusable)))
(when (and s3-0
(not (focus-test? (the-as process-focusable s3-0) dead))
(send-event s3-0 'go-die))
(+! (-> this reserve-count) 1)
(set! (-> this units s4-1) (the-as handle #f))
)
)
)
(remove-setting! 'dust-storm-sound-scalar)
(set-setting! 'fog-special-interp-targ #f 0.0 0)
)
)
(let ((s5-2 0)
(s4-2 0)
)
+1
View File
@@ -40,6 +40,7 @@
(board-tricks)
(weather-bad)
(weather-good)
(desert-peace)
)
(defun pc-cheats->string ((cheats pc-cheats) (buf object))
+20
View File
@@ -68,6 +68,26 @@
(def-pc-cheat-list *pc-cheats-list*
;; name cheat flag can-toggle avail-after
;(progress-cheats-music-player music-player #f fortress-escape-introduction)
;(progress-cheats-real-time-of-day real-time-of-day #t fortress-escape-resolution)
;(progress-cheats-board-tricks board-tricks #t stadium-board1-gold)
;(progress-cheats-health-bars health-bars #t palace-boss-resolution :unlock (progress-cheats-health-bars-unlock pc-cheat-health-bars-unlock))
;(progress-cheats-vehicle-health-bars vehicle-health-bars #t palace-boss-resolution :unlock (progress-cheats-vehicle-health-bars-unlock pc-cheat-vehicle-health-bars-unlock))
;(progress-cheats-weather-bad weather-bad #t fortress-escape-resolution :skill 85)
;(progress-cheats-weather-good weather-good #t fortress-escape-resolution :skill 85)
;(progress-cheats-suck-in-all suck-in-all #t forest-scouts-get-board :unlock (progress-cheats-suck-in-all-unlock pc-cheat-suck-in-all-unlock))
;(progress-cheats-turbo-board turbo-board #t sewer-board-introduction :unlock (progress-cheats-turbo-board-unlock pc-cheat-board-fast-unlock))
;(progress-cheats-fast-travel fast-travel auto city-defend-stadium-introduction :unlock (progress-cheats-fast-travel-unlock pc-cheat-fast-travel-unlock))
;(progress-cheats-orb-tracker orb-tracker auto nest-boss-resolution)
;(progress-cheats-no-textures no-textures #t nest-boss-resolution :skill 115)
;(progress-cheats-vehicle-invuln vehicle-invuln #t nest-boss-resolution :skill 185)
;(progress-cheats-fast-movies fast-movies #t nest-boss-resolution :skill 200)
;(progress-cheats-slow-movies slow-movies #t nest-boss-resolution :skill 200)
;(progress-cheats-fast-speed fast-speed #t nest-boss-resolution :skill 250)
;(progress-cheats-slow-speed slow-speed #t nest-boss-resolution :skill 250)
;(progress-cheats-statistics statistics auto atoll-water-introduction :unlock (progress-cheats-statistics-unlock pc-cheat-statistics-unlock))
;(progress-cheats-city-peace city-peace #t nest-boss-resolution :skill 200)
;(progress-cheats-hijack-lines hijack-lines #t nest-boss-resolution :skill 200)
;(progress-cheats-desert-peace desert-peace #t nest-boss-resolution :skill 200)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;