Files
jak-project/test/decompiler/reference/jak1/engine/game/fact-h_REF.gc
T
water111 637990314b wip: better stack var support (#4222)
Closes #736

---------

Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
2026-04-19 00:14:44 +02:00

296 lines
11 KiB
Common Lisp
Vendored
Generated

;;-*-Lisp-*-
(in-package goal)
;; definition of type fact-bank
(deftype fact-bank (basic)
((eco-level-max float)
(eco-single-inc float)
(eco-full-inc float)
(eco-single-timeout seconds)
(eco-full-timeout seconds)
(dummy seconds)
(health-max-default float)
(health-single-inc float)
(eco-pill-max-default float)
(health-small-inc float)
(buzzer-max-default float)
(buzzer-single-inc float)
(suck-bounce-dist meters)
(suck-suck-dist meters)
(default-pill-inc float)
)
)
;; definition for method 3 of type fact-bank
(defmethod inspect ((this fact-bank))
(format #t "[~8x] ~A~%" this (-> this type))
(format #t "~Teco-level-max: ~f~%" (-> this eco-level-max))
(format #t "~Teco-single-inc: ~f~%" (-> this eco-single-inc))
(format #t "~Teco-full-inc: ~f~%" (-> this eco-full-inc))
(format #t "~Teco-single-timeout: (seconds ~e)~%" (-> this eco-single-timeout))
(format #t "~Teco-full-timeout: (seconds ~e)~%" (-> this eco-full-timeout))
(format #t "~Tdummy: (seconds ~e)~%" (-> this dummy))
(format #t "~Thealth-max-default: ~f~%" (-> this health-max-default))
(format #t "~Thealth-single-inc: ~f~%" (-> this health-single-inc))
(format #t "~Teco-pill-max-default: ~f~%" (-> this eco-pill-max-default))
(format #t "~Thealth-small-inc: ~f~%" (-> this health-small-inc))
(format #t "~Tbuzzer-max-default: ~f~%" (-> this buzzer-max-default))
(format #t "~Tbuzzer-single-inc: ~f~%" (-> this buzzer-single-inc))
(format #t "~Tsuck-bounce-dist: (meters ~m)~%" (-> this suck-bounce-dist))
(format #t "~Tsuck-suck-dist: (meters ~m)~%" (-> this suck-suck-dist))
(format #t "~Tdefault-pill-inc: ~f~%" (-> this default-pill-inc))
this
)
;; definition for symbol *FACT-bank*, type fact-bank
(define *FACT-bank* (new 'static 'fact-bank
:eco-level-max 2.0
:eco-single-inc 1.0
:eco-full-inc 5.0
:eco-single-timeout (seconds 5)
:eco-full-timeout (seconds 20)
:dummy (seconds 15)
:health-max-default 3.0
:health-single-inc 1.0
:eco-pill-max-default 50.0
:health-small-inc 1.0
:buzzer-max-default 7.0
:buzzer-single-inc 1.0
:suck-bounce-dist (meters 18)
:suck-suck-dist (meters 7.5)
)
)
;; definition for function pickup-type->string
(defun pickup-type->string ((arg0 pickup-type))
(case arg0
(((pickup-type eco-pill-random))
"eco-pill-random"
)
(((pickup-type buzzer))
"buzzer"
)
(((pickup-type eco-pill))
"eco-pill"
)
(((pickup-type fuel-cell))
"fuel-cell"
)
(((pickup-type money))
"money"
)
(((pickup-type eco-green))
"eco-green"
)
(((pickup-type eco-blue))
"eco-blue"
)
(((pickup-type eco-red))
"eco-red"
)
(((pickup-type eco-yellow))
"eco-yellow"
)
(((pickup-type none))
"none"
)
(else
"*unknown*"
)
)
)
;; definition of type fact-info
(deftype fact-info (basic)
((process process-drawable)
(pickup-type pickup-type)
(pickup-amount float)
(pickup-spawn-amount float)
(options fact-options)
(fade-time time-frame)
)
(:methods
(new (symbol type process-drawable pickup-type float) _type_)
(drop-pickup (_type_ symbol process-tree fact-info int) (pointer process))
(reset! (_type_ symbol) none)
(pickup-collectable! (_type_ pickup-type float handle) float)
)
)
;; definition for method 3 of type fact-info
(defmethod inspect ((this fact-info))
(format #t "[~8x] ~A~%" this (-> this type))
(format #t "~Tprocess: ~A~%" (-> this process))
(format #t "~Tpickup-type: ~D~%" (-> this pickup-type))
(format #t "~Tpickup-amount: ~f~%" (-> this pickup-amount))
(format #t "~Tpickup-spawn-amount: ~f~%" (-> this pickup-spawn-amount))
(format #t "~Toptions: ~D~%" (-> this options))
(format #t "~Tfade-time: ~D~%" (-> this fade-time))
this
)
;; definition of type fact-info-target
(deftype fact-info-target (fact-info)
((eco-type pickup-type)
(eco-level float)
(eco-pickup-time time-frame)
(eco-timeout seconds)
(health float)
(health-max float)
(buzzer float)
(buzzer-max float)
(eco-pill float)
(eco-pill-max float)
(health-pickup-time time-frame)
(eco-source handle)
(eco-source-time time-frame)
(money-pickup-time time-frame)
(buzzer-pickup-time time-frame)
(fuel-cell-pickup-time time-frame)
(eco-pill-pickup-time time-frame)
)
(:methods
(new (symbol type process-drawable pickup-type float) _type_)
)
)
;; definition for method 3 of type fact-info-target
(defmethod inspect ((this fact-info-target))
(format #t "[~8x] ~A~%" this (-> this type))
(format #t "~Tprocess: ~A~%" (-> this process))
(format #t "~Tpickup-type: ~D~%" (-> this pickup-type))
(format #t "~Tpickup-amount: ~f~%" (-> this pickup-amount))
(format #t "~Tpickup-spawn-amount: ~f~%" (-> this pickup-spawn-amount))
(format #t "~Toptions: ~D~%" (-> this options))
(format #t "~Tfade-time: ~D~%" (-> this fade-time))
(format #t "~Teco-type: ~D~%" (-> this eco-type))
(format #t "~Teco-level: ~f~%" (-> this eco-level))
(format #t "~Teco-pickup-time: ~D~%" (-> this eco-pickup-time))
(format #t "~Teco-timeout: (seconds ~e)~%" (-> this eco-timeout))
(format #t "~Thealth: ~f~%" (-> this health))
(format #t "~Thealth-max: ~f~%" (-> this health-max))
(format #t "~Tbuzzer: ~f~%" (-> this buzzer))
(format #t "~Tbuzzer-max: ~f~%" (-> this buzzer-max))
(format #t "~Teco-pill: ~f~%" (-> this eco-pill))
(format #t "~Teco-pill-max: ~f~%" (-> this eco-pill-max))
(format #t "~Thealth-pickup-time: ~D~%" (-> this health-pickup-time))
(format #t "~Teco-source: ~D~%" (-> this eco-source))
(format #t "~Teco-source-time: ~D~%" (-> this eco-source-time))
(format #t "~Tmoney-pickup-time: ~D~%" (-> this money-pickup-time))
(format #t "~Tbuzzer-pickup-time: ~D~%" (-> this buzzer-pickup-time))
(format #t "~Tfuel-cell-pickup-time: ~D~%" (-> this fuel-cell-pickup-time))
(format #t "~Teco-pill-pickup-time: ~D~%" (-> this eco-pill-pickup-time))
this
)
;; definition of type fact-info-enemy
(deftype fact-info-enemy (fact-info)
((speed float)
(idle-distance meters)
(notice-top meters)
(notice-bottom meters)
(cam-horz meters)
(cam-vert meters)
(cam-notice-dist meters)
)
(:methods
(new (symbol type process-drawable pickup-type float) _type_)
)
)
;; definition for method 3 of type fact-info-enemy
(defmethod inspect ((this fact-info-enemy))
(format #t "[~8x] ~A~%" this (-> this type))
(format #t "~Tprocess: ~A~%" (-> this process))
(format #t "~Tpickup-type: ~D~%" (-> this pickup-type))
(format #t "~Tpickup-amount: ~f~%" (-> this pickup-amount))
(format #t "~Tpickup-spawn-amount: ~f~%" (-> this pickup-spawn-amount))
(format #t "~Toptions: ~D~%" (-> this options))
(format #t "~Tfade-time: ~D~%" (-> this fade-time))
(format #t "~Tspeed: ~f~%" (-> this speed))
(format #t "~Tidle-distance: (meters ~m)~%" (-> this idle-distance))
(format #t "~Tnotice-top: (meters ~m)~%" (-> this notice-top))
(format #t "~Tnotice-bottom: (meters ~m)~%" (-> this notice-bottom))
(format #t "~Tcam-horz: (meters ~m)~%" (-> this cam-horz))
(format #t "~Tcam-vert: (meters ~m)~%" (-> this cam-vert))
(format #t "~Tcam-notice-dist: (meters ~m)~%" (-> this cam-notice-dist))
this
)
;; definition for method 0 of type fact-info
;; INFO: Used lq/sq
(defmethod new fact-info ((allocation symbol) (type-to-make type) (proc process-drawable) (pkup-type pickup-type) (pkup-amount float))
(let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size)))))
(let ((ent (-> proc entity)))
(when (zero? this)
(go process-drawable-art-error "memory")
(set! this (the-as fact-info 0))
(goto cfg-10)
)
(set! (-> this process) proc)
(let* ((tag (new 'static 'res-tag))
(v1-6 (res-lump-data ent 'eco-info (pointer int32) :tag-ptr (& tag) :time 0.0))
)
(cond
(v1-6
(let ((a0-6 (-> tag elt-count)))
(set! (-> this pickup-type) (the-as pickup-type (-> v1-6 0)))
(set! pkup-amount (cond
((< (the-as uint 1) a0-6)
(the float (-> v1-6 1))
)
(else
(empty)
pkup-amount
)
)
)
)
(set! (-> this pickup-amount) pkup-amount)
)
(else
(set! (-> this pickup-type) pkup-type)
(set! (-> this pickup-amount) pkup-amount)
)
)
)
(set! (-> this options) (res-lump-value ent 'options fact-options))
(if (logtest? (fact-options fade respawn) (-> this options))
(set! (-> this fade-time) (the-as time-frame (the int (* 300.0 (res-lump-float ent 'timeout)))))
)
)
(label cfg-10)
this
)
)
;; definition for method 11 of type fact-info
(defmethod pickup-collectable! ((this fact-info) (arg0 pickup-type) (arg1 float) (arg2 handle))
0.0
)
;; definition for method 0 of type fact-info-enemy
(defmethod new fact-info-enemy ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 pickup-type) (arg2 float))
(let ((this (the-as fact-info-enemy ((method-of-type fact-info new) allocation type-to-make arg0 arg1 arg2))))
(let ((entity (-> this process entity)))
(set! (-> this speed) (res-lump-float entity 'speed :default 1.0))
(set! (-> this idle-distance) (res-lump-float entity 'idle-distance :default 327680.0))
(set! (-> this notice-top) (res-lump-float entity 'notice-top :default 4096000.0))
(set! (-> this notice-bottom) (res-lump-float entity 'notice-bottom :default 4096000.0))
(set! (-> this cam-horz) (res-lump-float entity 'cam-horz))
(set! (-> this cam-vert) (res-lump-float entity 'cam-vert))
(set! (-> this cam-notice-dist) (res-lump-float entity 'cam-notice-dist :default -4096.0))
)
this
)
)
;; definition for method 0 of type fact-info-target
(defmethod new fact-info-target ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 pickup-type) (arg2 float))
(let ((this (the-as fact-info-target ((method-of-type fact-info new) allocation type-to-make arg0 arg1 arg2))))
(set! (-> this eco-source) (the-as handle #f))
(reset! this #f)
this
)
)