Files
jak-project/goal_src/jak2/engine/game/game-h.gc
T
ManDude 7a8aa71204 [jak2] implement statistics tracker (#3288)
Currently only tracks enemy kills, and how they were killed. There is
currently no menu for this, but I've already added most of the text for
it. Also did a bunch of misc decompilation fixes and renamed some
methods.

Fixes #3277 
Fixes #3278
2024-01-11 22:49:41 +00:00

380 lines
13 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: game-h.gc
;; name in dgo: game-h
;; dgos: ENGINE, GAME
(declare-type nav-control structure)
(declare-type path-control basic)
(declare-type vol-control basic)
(declare-type actor-link-info basic)
(declare-type water-control basic)
(declare-type align-control basic)
(declare-type fact-info basic)
(declare-type carry-info basic)
(declare-type touching-shapes-entry structure)
(declare-type rigid-body-control basic)
(define-extern eco-blue-glow (function vector none))
(define-extern process-contact-action (function process none :behavior target))
(define-extern vector<-cspace! (function vector cspace vector))
(defenum state-flags
:bitfield #t
:type uint32
(sf0 0)
(sf1 1)
(sf2 2)
(tinvul1 3)
(sf4 4)
(sf5 5)
(sf6 6)
(prevent-jump 7)
(prevent-attack 8)
(prevent-duck 9)
(sf10 10)
(sf11 11)
(sf12 12)
(sf13 13)
(sf14 14)
(sf15 15)
(sf16 16)
(prevent-board 17)
(prevent-gun 18)
(lleg-still 19)
(rleg-still 20)
(lleg-no-ik 21)
(rleg-no-ik 22)
(prevent-double-jump 23)
(disable-attacks 24)
(tinvul2 25)
(sf26 26)
(sf27 27)
(sf28 28)
(sf29 29)
(sf30 30)
(sf31 31)
)
(defenum attack-mask
:bitfield #t
:type uint32
(trans 0) ;; 1
(vector 1) ;; 2
(intersection 2) ;; 4
(attacker 3) ;; 8
(attack-time 4) ;; 16
(invinc-time 5) ;; 32
(mode 6) ;; 64
(shove-back 7) ;; 128
(shove-up 8) ;; 256
(speed 9) ;; 512
(dist 10) ;; 1024
(control 11) ;; 2048
(angle 12) ;; 4096
(rotate-to 13) ;; 8192
(prev-state 14) ;; 16384
(id 15) ;; 32768
(count 16) ;; hi 1
(penetrate-using 17) ;; hi 2
(attacker-velocity 18);; hi 4
(damage 19) ;; hi 8
(shield-damage 20) ;; hi16
(knock 21) ;; hi 32
(test 22) ;; hi 64
)
;; +++knocked-type
(defenum knocked-type
:type uint8
(knocked-type-0 0)
(knocked-type-1 1)
(knocked-type-2 2)
(knocked-type-3 3)
(knocked-type-4 4) ;; what the heck is this! (its on gator, and cant trigger it for the life of me)
(knocked-type-5 5)
(knocked-type-6 6)
(knocked-type-7 7)
(knocked-type-8 8)
(knocked-type-9 9)
(knocked-type-10 10)
)
;; ---knocked-type
(defmacro static-attack-info (&key (mask ()) args)
(let ((mask-actual mask))
(dolist (it args)
(when (not (member (caar it) mask-actual))
(cons! mask-actual (caar it))
)
)
`(let ((atk (new 'static 'attack-info :mask (attack-mask ,@mask-actual))))
,@(apply (lambda (x) (if (or (eq? (car x) 'vector)
(eq? (car x) 'intersection)
(eq? (car x) 'attacker-velocity))
`(vector-copy! (-> atk ,(car x)) ,(cadr x))
`(set! (-> atk ,(car x)) ,(cadr x))
)) args)
atk)
)
)
(defmacro new-attack-id ()
"generate a new attack-id. TODO remove this, it's meant to be an inlined method"
`(1+! (-> *game-info* attack-id))
)
;; DECOMP BEGINS
(deftype process-drawable (process)
((root trsqv)
(node-list cspace-array)
(draw draw-control)
(skel joint-control)
(nav nav-control)
(align align-control)
(path path-control)
(vol vol-control)
(fact fact-info)
(link actor-link-info)
(part sparticle-launch-control)
(water water-control)
(sound ambient-sound)
(carry carry-info)
(rbody rigid-body-control)
(state-flags state-flags)
(state-time time-frame)
)
(:methods
(initialize-skeleton (_type_ skeleton-group pair) draw-control)
(initialize-skeleton-by-name (_type_ string) draw-control)
(apply-alignment (_type_ align-opts transformq vector) trsqv)
(cleanup-for-death (_type_) none)
(relocate-nav (_type_ int) none)
(evaluate-joint-control (_type_) none)
)
(:states
(process-drawable-art-error string)
process-drawable-idle
)
)
(deftype process-drawable-reserved (process-drawable)
()
(:methods
(process-drawable-reserved-method-20 () none)
(process-drawable-reserved-method-21 () none)
(process-drawable-reserved-method-22 () none)
(process-drawable-reserved-method-23 () none)
(process-drawable-reserved-method-24 () none)
(process-drawable-reserved-method-25 () none)
(process-drawable-reserved-method-26 () none)
(process-drawable-reserved-method-27 () none)
(process-drawable-reserved-method-28 () none)
(process-drawable-reserved-method-29 () none)
(process-drawable-reserved-method-30 () none)
(process-drawable-reserved-method-31 () none)
(process-drawable-reserved-method-32 () none)
(process-drawable-reserved-method-33 () none)
(process-drawable-reserved-method-34 () none)
(process-drawable-reserved-method-35 () none)
(process-drawable-reserved-method-36 () none)
(process-drawable-reserved-method-37 () none)
(process-drawable-reserved-method-38 () none)
(process-drawable-reserved-method-39 () none)
(process-drawable-reserved-method-40 () none)
(process-drawable-reserved-method-41 () none)
(process-drawable-reserved-method-42 () none)
(process-drawable-reserved-method-43 () none)
(process-drawable-reserved-method-44 () none)
(process-drawable-reserved-method-45 () none)
(process-drawable-reserved-method-46 () none)
(process-drawable-reserved-method-47 () none)
(process-drawable-reserved-method-48 () none)
(process-drawable-reserved-method-49 () none)
(process-drawable-reserved-method-50 () none)
(process-drawable-reserved-method-51 () none)
(process-drawable-reserved-method-52 () none)
(process-drawable-reserved-method-53 () none)
(process-drawable-reserved-method-54 () none)
(process-drawable-reserved-method-55 () none)
(process-drawable-reserved-method-56 () none)
(process-drawable-reserved-method-57 () none)
(process-drawable-reserved-method-58 () none)
(process-drawable-reserved-method-59 () none)
(process-drawable-reserved-method-60 () none)
(process-drawable-reserved-method-61 () none)
(process-drawable-reserved-method-62 () none)
(process-drawable-reserved-method-63 () none)
(process-drawable-reserved-method-64 () none)
(process-drawable-reserved-method-65 () none)
(process-drawable-reserved-method-66 () none)
(process-drawable-reserved-method-67 () none)
(process-drawable-reserved-method-68 () none)
(process-drawable-reserved-method-69 () none)
(process-drawable-reserved-method-70 () none)
(process-drawable-reserved-method-71 () none)
(process-drawable-reserved-method-72 () none)
(process-drawable-reserved-method-73 () none)
(process-drawable-reserved-method-74 () none)
(process-drawable-reserved-method-75 () none)
(process-drawable-reserved-method-76 () none)
(process-drawable-reserved-method-77 () none)
(process-drawable-reserved-method-78 () none)
(process-drawable-reserved-method-79 () none)
(process-drawable-reserved-method-80 () none)
(process-drawable-reserved-method-81 () none)
(process-drawable-reserved-method-82 () none)
(process-drawable-reserved-method-83 () none)
(process-drawable-reserved-method-84 () none)
(process-drawable-reserved-method-85 () none)
(process-drawable-reserved-method-86 () none)
(process-drawable-reserved-method-87 () none)
(process-drawable-reserved-method-88 () none)
(process-drawable-reserved-method-89 () none)
(process-drawable-reserved-method-90 () none)
(process-drawable-reserved-method-91 () none)
(process-drawable-reserved-method-92 () none)
(process-drawable-reserved-method-93 () none)
(process-drawable-reserved-method-94 () none)
(process-drawable-reserved-method-95 () none)
(process-drawable-reserved-method-96 () none)
(process-drawable-reserved-method-97 () none)
(process-drawable-reserved-method-98 () none)
(process-drawable-reserved-method-99 () none)
(process-drawable-reserved-method-100 () none)
(process-drawable-reserved-method-101 () none)
(process-drawable-reserved-method-102 () none)
(process-drawable-reserved-method-103 () none)
(process-drawable-reserved-method-104 () none)
(process-drawable-reserved-method-105 () none)
(process-drawable-reserved-method-106 () none)
(process-drawable-reserved-method-107 () none)
(process-drawable-reserved-method-108 () none)
(process-drawable-reserved-method-109 () none)
(process-drawable-reserved-method-110 () none)
(process-drawable-reserved-method-111 () none)
(process-drawable-reserved-method-112 () none)
(process-drawable-reserved-method-113 () none)
(process-drawable-reserved-method-114 () none)
(process-drawable-reserved-method-115 () none)
(process-drawable-reserved-method-116 () none)
(process-drawable-reserved-method-117 () none)
(process-drawable-reserved-method-118 () none)
(process-drawable-reserved-method-119 () none)
(process-drawable-reserved-method-120 () none)
(process-drawable-reserved-method-121 () none)
(process-drawable-reserved-method-122 () none)
(process-drawable-reserved-method-123 () none)
(process-drawable-reserved-method-124 () none)
(process-drawable-reserved-method-125 () none)
(process-drawable-reserved-method-126 () none)
(process-drawable-reserved-method-127 () none)
(process-drawable-reserved-method-128 () none)
(process-drawable-reserved-method-129 () none)
(process-drawable-reserved-method-130 () none)
(process-drawable-reserved-method-131 () none)
(process-drawable-reserved-method-132 () none)
(process-drawable-reserved-method-133 () none)
(process-drawable-reserved-method-134 () none)
(process-drawable-reserved-method-135 () none)
(process-drawable-reserved-method-136 () none)
(process-drawable-reserved-method-137 () none)
(process-drawable-reserved-method-138 () none)
(process-drawable-reserved-method-139 () none)
(process-drawable-reserved-method-140 () none)
(process-drawable-reserved-method-141 () none)
(process-drawable-reserved-method-142 () none)
(process-drawable-reserved-method-143 () none)
(process-drawable-reserved-method-144 () none)
(process-drawable-reserved-method-145 () none)
(process-drawable-reserved-method-146 () none)
(process-drawable-reserved-method-147 () none)
(process-drawable-reserved-method-148 () none)
(process-drawable-reserved-method-149 () none)
(process-drawable-reserved-method-150 () none)
(process-drawable-reserved-method-151 () none)
(process-drawable-reserved-method-152 () none)
(process-drawable-reserved-method-153 () none)
(process-drawable-reserved-method-154 () none)
(process-drawable-reserved-method-155 () none)
(process-drawable-reserved-method-156 () none)
(process-drawable-reserved-method-157 () none)
(process-drawable-reserved-method-158 () none)
(process-drawable-reserved-method-159 () none)
(process-drawable-reserved-method-160 () none)
(process-drawable-reserved-method-161 () none)
(process-drawable-reserved-method-162 () none)
(process-drawable-reserved-method-163 () none)
(process-drawable-reserved-method-164 () none)
(process-drawable-reserved-method-165 () none)
(process-drawable-reserved-method-166 () none)
(process-drawable-reserved-method-167 () none)
(process-drawable-reserved-method-168 () none)
(process-drawable-reserved-method-169 () none)
(process-drawable-reserved-method-170 () none)
(process-drawable-reserved-method-171 () none)
(process-drawable-reserved-method-172 () none)
(process-drawable-reserved-method-173 () none)
(process-drawable-reserved-method-174 () none)
(process-drawable-reserved-method-175 () none)
(process-drawable-reserved-method-176 () none)
(process-drawable-reserved-method-177 () none)
)
)
(deftype attack-dir-info (structure)
((dir vector :inline)
(xz-dir vector :inline)
(attacker-velocity vector :inline)
(pos vector :inline)
)
)
(deftype attack-info (structure)
((trans vector :inline)
(vector vector :inline)
(attacker-velocity vector :inline)
(intersection vector :inline)
(attacker handle)
(attack-time time-frame)
(invinc-time time-frame)
(mask attack-mask)
(mode symbol)
(shove-back meters)
(shove-up meters)
(speed meters)
(dist meters)
(control float)
(angle symbol)
(rotate-to degrees)
(prev-state state)
(id uint32)
(count uint32)
(penetrate-using penetrate)
(damage float)
(shield-damage float)
(knock knocked-type)
(test symbol)
)
(:methods
(attack-info-method-9 (_type_ attack-info process-drawable process-drawable) none)
(compute-intersect-info (_type_ object process-drawable process touching-shapes-entry) attack-info)
(combine! (_type_ attack-info process-drawable) attack-info)
)
)
(deftype ground-tween-info (structure)
((chan uint8 3)
(blend float 3)
(group uint32 5)
)
:pack-me
)