Files
jak-project/test/decompiler/reference/jak3/engine/common-obs/gem-pool_REF.gc
T
water111 7348e6a4ff [decompiler] Update vector ops, reduce casts (#3849)
Update the decompiler to use the new vf macros.

Also, fix a bunch of silly casting issues where accessing inline fields
with an offset of 0 would be better than a cast:

![image](https://github.com/user-attachments/assets/885bbb07-634f-47b8-99f5-5a947941cdde)

---------

Co-authored-by: water111 <awaterford1111445@gmail.com>
2025-01-20 16:32:58 -05:00

90 lines
2.0 KiB
Common Lisp
Vendored
Generated

;;-*-Lisp-*-
(in-package goal)
;; definition for function get-gem-pool-size
(defun get-gem-pool-size ((arg0 int))
(case arg0
((1)
(cond
((task-node-closed? (game-task-node city-power-game-resolution))
1000.0
)
((task-node-closed? (game-task-node city-port-assault-resolution))
120.0
)
((task-node-closed? (game-task-node city-port-assault-introduction))
90.0
)
(else
60.0
)
)
)
((2)
10.0
)
(else
0.0
)
)
)
;; definition for function compare-gems
(defun compare-gems ((arg0 int) (arg1 (pointer float)))
(< (-> arg1 0) (get-gem-pool-size arg0))
)
;; definition for function gems-available?
(defun gems-available? ((arg0 int))
(let ((v1-0 arg0))
(cond
((zero? v1-0)
#t
)
((= v1-0 1)
(let ((a1-1 (task-perm-by-index *game-info* 6)))
(compare-gems arg0 (-> a1-1 user-float))
)
)
((= v1-0 2)
(let ((a1-3 (task-perm-by-index *game-info* 41)))
(compare-gems arg0 (-> a1-3 user-float))
)
)
(else
#f
)
)
)
)
;; definition for function notify-gem-pickup
(defun notify-gem-pickup ((arg0 uint))
(let ((v1-0 arg0))
(cond
((zero? v1-0)
#f
)
((= v1-0 1)
(let ((v1-2 (task-perm-by-index *game-info* 6)))
(logior! (-> v1-2 status) (entity-perm-status bit-5))
(set! (-> v1-2 user-object 0) (+ 1.0 (the-as float (-> v1-2 user-object 0))))
(logior! (-> v1-2 status) (entity-perm-status bit-14))
)
#t
)
((= v1-0 2)
(let ((v1-4 (task-perm-by-index *game-info* 41)))
(logior! (-> v1-4 status) (entity-perm-status bit-5))
(set! (-> v1-4 user-object 0) (+ 1.0 (the-as float (-> v1-4 user-object 0))))
(logior! (-> v1-4 status) (entity-perm-status bit-14))
)
#t
)
(else
#f
)
)
)
)