jak-project/goal_src/jak3/engine/common-obs/water-h.gc

104 lines
3.4 KiB
Common Lisp
Raw Normal View History

2023-10-10 09:41:05 -04:00
;;-*-Lisp-*-
(in-package goal)
;; name: water-h.gc
;; name in dgo: water-h
;; dgos: GAME
(define-extern find-water-with-spheres (function (inline-array water-sphere) int water-info object))
2023-10-10 09:41:05 -04:00
;; DECOMP BEGINS
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
(deftype water-control (basic)
((flags water-flag)
(process target)
(joint-index int32)
(top-y-offset float)
(attack-id uint32)
(enter-water-time time-frame)
(wade-time time-frame)
(on-water-time time-frame)
(enter-swim-time time-frame)
(swim-time time-frame)
(base-height meters)
(wade-height meters)
(swim-height meters)
(surface-height meters)
(bottom-height meters)
(collide-height meters)
(height meters)
(height-offset float 4)
(base-ocean-offset meters :overlay-at (-> height-offset 0))
(real-ocean-offset meters :overlay-at (-> height-offset 0))
(ocean-offset meters :overlay-at (-> height-offset 1))
(bob-offset meters :overlay-at (-> height-offset 2))
(align-offset meters :overlay-at (-> height-offset 3))
(swim-depth meters :offset 108)
(bob smush-control :inline)
(ripple handle)
(ripple-size meters)
(wake-size meters)
(bottom vector 2 :inline)
(top vector 2 :inline)
(enter-water-pos vector :inline)
(drip-old-pos vector :inline)
(drip-joint-index int32)
(drip-wetness float)
(drip-time time-frame)
(drip-speed float)
(drip-height meters)
(drip-mult float)
(distort-time time-frame)
(enter-water-sound sound-name)
(normal vector :inline)
)
(:methods
(new (symbol type process int float float float) _type_)
(water-control-method-9 (_type_) none)
(water-control-method-10 (_type_) none)
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
(start-bobbing! (_type_ float int int) none)
(distance-from-surface (_type_) float)
(spawn-ripples (_type_ float vector int vector symbol) none)
(display-water-marks? (_type_) symbol)
(enter-water (_type_) none)
(water-control-method-16 (_type_) none)
(water-control-method-17 (_type_) none)
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
)
)
(defmethod display-water-marks? ((this water-control))
*display-water-marks*
)
(defmethod new water-control ((allocation symbol) (type-to-make type) (arg0 process) (arg1 int) (arg2 float) (arg3 float) (arg4 float))
(let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size)))))
(set! (-> v0-0 process) (the-as target arg0))
(set! (-> v0-0 joint-index) arg1)
(set! (-> v0-0 wade-height) arg4)
(set! (-> v0-0 swim-height) arg3)
(set! (-> v0-0 bottom-height) 32768.0)
(set! (-> v0-0 ripple-size) 1638.4)
(set! (-> v0-0 wake-size) 3072.0)
(set! (-> v0-0 ripple) (the-as handle #f))
(set! (-> v0-0 drip-mult) 1.0)
(set! (-> v0-0 top-y-offset) arg2)
(let* ((v1-6 *game-info*)
(a0-2 (+ (-> v1-6 attack-id) 1))
)
(set! (-> v1-6 attack-id) a0-2)
(set! (-> v0-0 attack-id) a0-2)
)
(set! (-> v0-0 enter-water-sound) (static-sound-name "swim-enter"))
v0-0
)
)
(defmethod distance-from-surface ((this water-control))
(- (-> this top 0 y) (-> this height))
)
(deftype water-vol (process-hidden)
()
)