jak-project/goal_src/jak3/engine/common-obs/gem-pool.gc
Hat Kid 2969833b2d
decomp3: more engine stuff, detect non-virtual state inheritance (#3377)
- `speech`
- `ambient`
- `water-h`
- `vol-h`
- `generic-obs`
- `carry-h`
- `pilot-h`
- `board-h`
- `gun-h`
- `flut-h`
- `indax-h`
- `lightjak-h`
- `darkjak-h`
- `target-util`
- `history`
- `collide-reaction-target`
- `logic-target`
- `sidekick`
- `projectile`
- `voicebox`
- `ragdoll-edit`
- most of `ragdoll` (not added to gsrc yet)
- `curves`
- `find-nearest`
- `lightjak-wings`
- `target-handler`
- `target-anim`
- `target`
- `target2`
- `target-swim`
- `target-lightjak`
- `target-invisible`
- `target-death`
- `target-gun`
- `gun-util`
- `board-util`
- `target-board`
- `board-states`
- `mech-h`
- `vol`
- `vent`
- `viewer`
- `gem-pool`
- `collectables`
- `crates`
- `secrets-menu`

Additionally:

- Detection of non-virtual state inheritance
- Added a config file that allows overriding the process stack size set
by `stack-size-set!` calls
- Fix for integer multiplication with `r0`
- Fixed detection for the following macros:
	- `static-attack-info`
- `defpart` and `defpartgroup` (probably still needs adjustments, uses
Jak 2 implementation at the moment)
- `sound-play` (Jak 3 seems to always call `sound-play-by-name` with a
`sound-group` of 0, so the macro has been temporarily defaulted to use
that)

One somewhat significant change made here that should be noted is that
the return type of `process::init-from-entity!` was changed to `object`.
I've been thinking about this for a while, since it looks a bit nicer
without the `(none)` at the end and I have recently encountered init
methods that early return `0`.
2024-03-03 15:15:27 -05:00

92 lines
1.9 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: gem-pool.gc
;; name in dgo: gem-pool
;; dgos: GAME
;; DECOMP BEGINS
(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
)
)
)
(defun compare-gems ((arg0 int) (arg1 (pointer float)))
(< (-> arg1 0) (get-gem-pool-size arg0))
)
(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 (the-as (pointer float) a1-1))
)
)
((= v1-0 2)
(let ((a1-3 (task-perm-by-index *game-info* 41)))
(compare-gems arg0 (the-as (pointer float) a1-3))
)
)
(else
#f
)
)
)
)
(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
)
)
)
)