mirror of
https://github.com/open-goal/jak-project
synced 2026-07-03 21:10:50 -04:00
349919f788
Adds the opengoal cheats to the secrets menu. Only cheats that are fully functional and unlockable are there right now, which is eight cheats. This update will reset most Jak 2 settings. Also fixes #3274 .
296 lines
6.9 KiB
Common Lisp
296 lines
6.9 KiB
Common Lisp
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
#|
|
|
This file has the game-specific implementation of the pckernel (see pckernel-h.gc and pckernel.gc).
|
|
|#
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
;;;; constants
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
;; version: 0.2.0.0
|
|
(defconstant PC_KERNEL_VERSION (static-pckernel-version 0 2 0 0))
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
;;;; types and enums
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
;; cheats
|
|
(defenum pc-cheats
|
|
:bitfield #t
|
|
:type uint64
|
|
(turbo-board)
|
|
(health-bars)
|
|
(vehicle-health-bars)
|
|
(vehicle-invuln)
|
|
(statistics)
|
|
(suck-in-all)
|
|
(music-player)
|
|
(no-textures)
|
|
(fast-movies)
|
|
(slow-movies)
|
|
(fast-speed)
|
|
(slow-speed)
|
|
(fast-travel)
|
|
(orb-tracker)
|
|
(real-time-of-day)
|
|
(city-peace)
|
|
(board-tricks)
|
|
(weather-bad)
|
|
(weather-good)
|
|
(hijack-lines)
|
|
)
|
|
|
|
;; pc enum for languages. this is the game's languages + custom ones.
|
|
(defenum pc-language
|
|
:type uint16
|
|
(english 0)
|
|
(french 1)
|
|
(german 2)
|
|
(spanish 3)
|
|
(italian 4)
|
|
(japanese 5)
|
|
(korean 6)
|
|
(uk-english 7)
|
|
;; custom
|
|
(portuguese 8)
|
|
(finnish 9)
|
|
(swedish 10)
|
|
(danish 11)
|
|
(norwegian 12)
|
|
(dutch 13)
|
|
(br-portuguese 14)
|
|
(hungarian 15)
|
|
(catalan 16)
|
|
(icelandic 17)
|
|
(russian 18)
|
|
(polish 19)
|
|
(lithuanian 19)
|
|
|
|
(custom 999) ;; temp
|
|
)
|
|
|
|
;; The Jak 2 version of the pc-settings object.
|
|
(deftype pc-settings-jak2 (pc-settings)
|
|
(;; cheats
|
|
(cheats pc-cheats)
|
|
(cheats-revealed pc-cheats)
|
|
(cheats-purchased pc-cheats)
|
|
(cheats-unlocked pc-cheats)
|
|
(cheats-backup pc-cheats) ;; backup for 'cheats', persisted to disk to be restored when disabling speedrunner mode
|
|
;; music
|
|
(music-unlocked bit-array)
|
|
(flava-unlocked symbol 6)
|
|
|
|
;; misc
|
|
(fast-airlock? symbol)
|
|
(fast-elevator? symbol)
|
|
(fast-progress? symbol)
|
|
|
|
;; gfx
|
|
(smooth-minimap? symbol)
|
|
(hires-clouds? symbol)
|
|
|
|
;; other
|
|
(controller-led-status? symbol)
|
|
|
|
(text-language pc-language) ;; language for game text
|
|
)
|
|
|
|
(:methods
|
|
(eligible-for-fast-elevator? (_type_ process) symbol)
|
|
(get-airlock-speed (_type_) float)
|
|
(get-airlock-close-speed (_type_) float)
|
|
)
|
|
)
|
|
|
|
(define *pc-settings* (the pc-settings-jak2 #f))
|
|
|
|
|
|
;; jak 2 discord rpc structure
|
|
(deftype discord-info (structure)
|
|
((orb-count float)
|
|
(gem-count float)
|
|
(death-count int32)
|
|
(status string)
|
|
(level string)
|
|
(cutscene? symbol)
|
|
(time-of-day float)
|
|
(percent-complete float)
|
|
(focus-status uint32)
|
|
(task string) ;; currenly active game-task used for mission specific images
|
|
)
|
|
)
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
;;;; resets
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
(defmethod reset-misc ((obj pc-settings-jak2) (call-handlers symbol))
|
|
"Set the default misc settings"
|
|
|
|
((method-of-type pc-settings reset-misc) obj call-handlers)
|
|
|
|
(true! (-> obj fast-airlock?))
|
|
(true! (-> obj fast-elevator?))
|
|
(false! (-> obj fast-progress?))
|
|
(true! (-> obj smooth-minimap?))
|
|
(false! (-> obj hires-clouds?))
|
|
|
|
(cond
|
|
((and (= *default-territory* GAME_TERRITORY_SCEE) (= (-> obj text-language) (pc-language english)))
|
|
(set! (-> obj text-language) (pc-language uk-english))
|
|
)
|
|
((= *default-territory* GAME_TERRITORY_SCEI)
|
|
(set! (-> obj text-language) (pc-language japanese))
|
|
)
|
|
((= *default-territory* GAME_TERRITORY_SCEK)
|
|
(set! (-> obj text-language) (pc-language korean))
|
|
)
|
|
(else
|
|
))
|
|
0)
|
|
|
|
(defmethod reset-extra ((obj pc-settings-jak2) (call-handlers symbol))
|
|
"Set the default goodies settings"
|
|
|
|
((method-of-type pc-settings reset-extra) obj call-handlers)
|
|
|
|
(set! (-> obj cheats) (pc-cheats))
|
|
(set! (-> obj cheats-revealed) (pc-cheats))
|
|
(set! (-> obj cheats-purchased) (pc-cheats))
|
|
(set! (-> obj cheats-unlocked) (pc-cheats))
|
|
|
|
(clear-all! (-> obj music-unlocked))
|
|
(dotimes (i 6)
|
|
(set! (-> obj flava-unlocked i) #f))
|
|
0)
|
|
|
|
(defmethod reset-input ((obj pc-settings-jak2) (device symbol) (call-handlers symbol))
|
|
"Set the default input settings"
|
|
|
|
((method-of-type pc-settings reset-input) obj device call-handlers)
|
|
|
|
(when (or (= device 'all) (= device 'controller))
|
|
(set! (-> obj controller-led-status?) #t)
|
|
)
|
|
0)
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
;;;; other
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
|
|
(define *hires-sky* #t)
|
|
(define *debug-region-color-alt* #t)
|
|
(define *debug-region-show-bsphere* #f)
|
|
(define *debug-region-hide-water* #t)
|
|
(define *debug-region-hide-empty* #t)
|
|
(define *fallback-text-lookup?* #t)
|
|
|
|
|
|
(defun pc-settings-save ()
|
|
(commit-to-file *pc-settings*)
|
|
)
|
|
|
|
(defun get-video-params () *video-params*)
|
|
|
|
|
|
|
|
;; for debugging
|
|
(defenum pc-pat-skip-hack
|
|
:bitfield #t
|
|
(noentity 0)
|
|
(nocamera 1)
|
|
(noedge 2)
|
|
(nogrind 3)
|
|
(nojak 4)
|
|
(noboard 5)
|
|
(nopilot 6)
|
|
(nolineofsight 16)
|
|
(unknowncamera 17)
|
|
(probe 24)
|
|
(nomech 25)
|
|
(noproj 26)
|
|
(noendlessfall 27)
|
|
(noprobe 28)
|
|
)
|
|
|
|
|
|
|
|
;; cheat stuff
|
|
|
|
(defenum pc-cheat-state-flag
|
|
:bitfield #t
|
|
:type uint8
|
|
(turbo-board) ;; should turbo board be used
|
|
(clear-time-mod)
|
|
)
|
|
|
|
(deftype pc-cheat-state (structure)
|
|
((progress-speed float)
|
|
(airlock-speed float)
|
|
(airlock-close-speed float)
|
|
(turbo-board-speed float)
|
|
(hijack-speech-chance float)
|
|
(flags pc-cheat-state-flag)
|
|
|
|
(sewer-valve-start-time time-frame)
|
|
(sewer-valve-end-time time-frame)
|
|
(sewer-valve-target-seconds int8)
|
|
(sewer-valve-on int8)
|
|
|
|
(kill-civvie-target int16)
|
|
(kill-car-target int16)
|
|
)
|
|
)
|
|
|
|
(define *pc-cheat-state* (new 'static 'pc-cheat-state
|
|
:progress-speed 1.5
|
|
:airlock-speed 1.75
|
|
:airlock-close-speed 1.75
|
|
:turbo-board-speed 1.5
|
|
:hijack-speech-chance 0.45
|
|
|
|
:sewer-valve-target-seconds 75
|
|
|
|
:kill-civvie-target 40
|
|
:kill-car-target 20
|
|
))
|
|
|
|
(defmacro cheat-state-flag? (&rest flags)
|
|
"are the specified flags enabled?"
|
|
`(logtest? (-> *pc-cheat-state* flags) (pc-cheat-state-flag ,@flags)))
|
|
|
|
(defmacro set-cheat-state-flag! (&rest flags)
|
|
"set the specified flags"
|
|
`(logior! (-> *pc-cheat-state* flags) (pc-cheat-state-flag ,@flags)))
|
|
(defmacro clear-cheat-state-flag! (&rest flags)
|
|
"clear the specified flags"
|
|
`(logclear! (-> *pc-cheat-state* flags) (pc-cheat-state-flag ,@flags)))
|
|
|
|
|
|
(defmacro give-cheat! (&rest cheats)
|
|
`(begin
|
|
(logior! (-> *pc-settings* cheats) (pc-cheats ,@cheats))
|
|
)
|
|
)
|
|
|
|
(defmacro lock-cheat! (&rest cheats)
|
|
`(begin
|
|
(logclear! (-> *pc-settings* cheats) (pc-cheats ,@cheats))
|
|
(logclear! (-> *pc-settings* purchased-cheats) (pc-cheats ,@cheats))
|
|
(logclear! (-> *pc-settings* unlocked-cheats) (pc-cheats ,@cheats))
|
|
(logclear! (-> *pc-settings* revealed-cheats) (pc-cheats ,@cheats))
|
|
)
|
|
)
|
|
|
|
|