mirror of
https://github.com/open-goal/jak-project
synced 2026-06-18 15:36:25 -04:00
7348e6a4ff
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:  --------- Co-authored-by: water111 <awaterford1111445@gmail.com>
90 lines
2.0 KiB
Common Lisp
Vendored
Generated
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
|
|
)
|
|
)
|
|
)
|
|
)
|