jak-project/goal_src/jak2/engine/common_objs/water-anim.gc
ManDude cd68cb671e
deftype and defmethod syntax major changes (#3094)
Major change to how `deftype` shows up in our code:
- the decompiler will no longer emit the `offset-assert`,
`method-count-assert`, `size-assert` and `flag-assert` parameters. There
are extremely few cases where having this in the decompiled code is
helpful, as the types there come from `all-types` which already has
those parameters. This also doesn't break type consistency because:
  - the asserts aren't compared.
- the first step of the test uses `all-types`, which has the asserts,
which will throw an error if they're bad.
- the decompiler won't emit the `heap-base` parameter unless necessary
now.
- the decompiler will try its hardest to turn a fixed-offset field into
an `overlay-at` field. It falls back to the old offset if all else
fails.
- `overlay-at` now supports field "dereferencing" to specify the offset
that's within a field that's a structure, e.g.:
```lisp
(deftype foobar (structure)
  ((vec    vector  :inline)
   (flags  int32   :overlay-at (-> vec w))
   )
  )
```
in this structure, the offset of `flags` will be 12 because that is the
final offset of `vec`'s `w` field within this structure.
- **removed ID from all method declarations.** IDs are only ever
automatically assigned now. Fixes #3068.
- added an `:overlay` parameter to method declarations, in order to
declare a new method that goes on top of a previously-defined method.
Syntax is `:overlay <method-name>`. Please do not ever use this.
- added `state-methods` list parameter. This lets you quickly specify a
list of states to be put in the method table. Same syntax as the
`states` list parameter. The decompiler will try to put as many states
in this as it can without messing with the method ID order.

Also changes `defmethod` to make the first type definition (before the
arguments) optional. The type can now be inferred from the first
argument. Fixes #3093.

---------

Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
2023-10-30 03:20:02 +00:00

616 lines
24 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: water-anim.gc
;; name in dgo: water-anim
;; dgos: GAME, COMMON
(declare-type flow-control basic)
;; DECOMP BEGINS
(deftype water-anim (process-drawable)
((water-height meters)
(wade-height meters)
(swim-height meters)
(bottom-height meters)
(attack-event symbol)
(attack-id uint32)
(flow flow-control)
(target handle)
(flags water-flags)
(look int32)
(play-ambient-sound? symbol)
(visible symbol)
)
(:state-methods
water-anim-state-20
idle
)
(:methods
(move-to-point! (_type_ vector) int)
(get-ripple-height (_type_ vector) float)
(init-water! (_type_) none)
(reset-root! (_type_) trsqv)
(water-anim-init! (_type_) none)
(water-anim-method-27 (_type_) none)
(offset! (_type_) none)
)
)
(defmethod relocate ((this water-anim) (arg0 int))
(if (nonzero? (-> this flow))
(&+! (-> this flow) arg0)
)
(call-parent-method this arg0)
)
(defskelgroup skel-water-anim-nest-dark-eco-largepool water-anim-nest-dark-eco water-anim-nest-dark-eco-largepool-lod0-jg -1
((water-anim-nest-dark-eco-largepool-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 50)
)
(defskelgroup skel-water-anim-nest-dark-eco-smlupperpool water-anim-nest-dark-eco water-anim-nest-dark-eco-smlupperpool-lod0-jg -1
((water-anim-nest-dark-eco-smlupperpool-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 30)
)
(defskelgroup skel-water-anim-nest-dark-eco-middlepool water-anim-nest-dark-eco water-anim-nest-dark-eco-middlepool-lod0-jg -1
((water-anim-nest-dark-eco-middlepool-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 32)
)
(defskelgroup skel-water-anim-nest-dark-eco-botpool water-anim-nest-dark-eco water-anim-nest-dark-eco-botpool-lod0-jg -1
((water-anim-nest-dark-eco-botpool-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 35)
)
(defskelgroup skel-water-anim-strip-dark-eco-near-lift water-anim-strip-dark-eco water-anim-strip-dark-eco-near-lift-lod0-jg -1
((water-anim-strip-dark-eco-near-lift-lod0-mg (meters 20))
(water-anim-strip-dark-eco-near-lift-lod1-mg (meters 999999))
)
:bounds (static-spherem 0 0 0 29)
)
(defskelgroup skel-water-anim-strip-dark-eco-near-crane water-anim-strip-dark-eco water-anim-strip-dark-eco-near-crane-lod0-jg -1
((water-anim-strip-dark-eco-near-crane-lod0-mg (meters 20))
(water-anim-strip-dark-eco-near-crane-lod1-mg (meters 999999))
)
:bounds (static-spherem 0 0 0 35)
)
(defskelgroup skel-water-anim-strip-dark-eco-with-eggs water-anim-strip-dark-eco water-anim-strip-dark-eco-with-eggs-lod0-jg -1
((water-anim-strip-dark-eco-with-eggs-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 40)
)
(defskelgroup skel-water-anim-strip-dark-eco-under-bridge water-anim-strip-dark-eco water-anim-strip-dark-eco-under-bridge-lod0-jg -1
((water-anim-strip-dark-eco-under-bridge-lod0-mg (meters 20))
(water-anim-strip-dark-eco-under-bridge-lod1-mg (meters 999999))
)
:bounds (static-spherem 0 0 0 32)
)
(defskelgroup skel-water-anim-mountain-dark-eco-dice water-anim-mountain-dark-eco water-anim-mountain-dark-eco-dice-lod0-jg -1
((water-anim-mountain-dark-eco-dice-lod0-mg (meters 999999)))
:bounds (static-spherem -20 0 0 110)
)
(defskelgroup skel-water-anim-under-pool water-anim-under water-anim-under-pool-lod0-jg -1
((water-anim-under-pool-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 51)
)
(defskelgroup skel-water-anim-under-drainout water-anim-under water-anim-under-drainout-lod0-jg -1
((water-anim-under-drainout-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 20)
)
(defskelgroup skel-water-anim-under-fillup water-anim-under water-anim-under-fillup-lod0-jg -1
((water-anim-under-fillup-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 23)
)
(defskelgroup skel-water-anim-mountain-fall-hi water-anim-mountain water-anim-mountain-fall-hi-lod0-jg -1
((water-anim-mountain-fall-hi-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 42)
)
(defskelgroup skel-water-anim-mountain-fall-med water-anim-mountain water-anim-mountain-fall-med-lod0-jg -1
((water-anim-mountain-fall-med-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 30)
)
(defskelgroup skel-water-anim-mountain-fall-low water-anim-mountain water-anim-mountain-fall-low-lod0-jg -1
((water-anim-mountain-fall-low-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 25)
)
(defskelgroup skel-water-anim-stadium-middle-pool water-anim-stadium water-anim-stadium-middle-pool-lod0-jg -1
((water-anim-stadium-middle-pool-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 24)
)
(defskelgroup skel-water-anim-stadium-top-fountain water-anim-stadium water-anim-stadium-top-fountain-lod0-jg -1
((water-anim-stadium-top-fountain-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 9.5)
)
(defskelgroup skel-water-anim-stadium-floor-pool water-anim-stadium water-anim-stadium-floor-pool-lod0-jg -1
((water-anim-stadium-floor-pool-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 22)
)
(defskelgroup skel-water-anim-tomb-dark-eco-stair-block water-anim-tomb-dark-eco water-anim-tomb-dark-eco-stair-block-lod0-jg -1
((water-anim-tomb-dark-eco-stair-block-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 80)
)
(defskelgroup skel-water-anim-tomb-dark-eco-raised-block water-anim-tomb-dark-eco water-anim-tomb-dark-eco-raised-block-lod0-jg -1
((water-anim-tomb-dark-eco-raised-block-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 80)
)
(defskelgroup skel-water-anim-fortress-exitb-pool water-anim-fortress water-anim-fortress-exitb-pool-lod0-jg -1
((water-anim-fortress-exitb-pool-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 51)
)
(defskelgroup skel-water-anim-tomb-main-hall water-anim-tomb water-anim-tomb-main-hall-lod0-jg -1
((water-anim-tomb-main-hall-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 150)
)
(defskelgroup skel-water-anim-tomb-tunnel-b water-anim-tomb water-anim-tomb-tunnel-b-lod0-jg -1
((water-anim-tomb-tunnel-b-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 36)
)
(defskelgroup skel-water-anim-tomb-tunnel-c water-anim-tomb water-anim-tomb-tunnel-c-lod0-jg -1
((water-anim-tomb-tunnel-c-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 23)
)
(defskelgroup skel-water-anim-tomb-tunnel-d water-anim-tomb water-anim-tomb-tunnel-d-lod0-jg -1
((water-anim-tomb-tunnel-d-lod0-mg (meters 999999)))
:bounds (static-spherem 5 0 5 42)
)
(defskelgroup skel-water-anim-tomb-tunnel-e water-anim-tomb water-anim-tomb-tunnel-e-lod0-jg -1
((water-anim-tomb-tunnel-e-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 37)
)
(defskelgroup skel-water-anim-tomb-tunnel-f water-anim-tomb water-anim-tomb-tunnel-f-lod0-jg -1
((water-anim-tomb-tunnel-f-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 24)
)
(defskelgroup skel-water-anim-mincan-exitb-pool water-anim-mincan water-anim-mincan-exitb-pool-lod0-jg -1
((water-anim-mincan-exitb-pool-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 55)
)
(defskelgroup skel-water-anim-ctypal-lrgsqr-pool water-anim-ctypal water-anim-ctypal-lrgsqr-pool-lod0-jg -1
((water-anim-ctypal-lrgsqr-pool-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 24)
)
(defskelgroup skel-water-anim-ctypal-smlsqr-pool water-anim-ctypal water-anim-ctypal-smlsqr-pool-lod0-jg -1
((water-anim-ctypal-smlsqr-pool-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 11.25)
)
(defskelgroup skel-water-anim-ctypal-lrgfloor-pool water-anim-ctypal water-anim-ctypal-lrgfloor-pool-lod0-jg -1
((water-anim-ctypal-lrgfloor-pool-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 22)
)
(defskelgroup skel-water-anim-ctypal-smlground-pool water-anim-ctypal water-anim-ctypal-smlground-pool-lod0-jg -1
((water-anim-ctypal-smlground-pool-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 22.5)
)
(defskelgroup skel-water-anim-ctypal-middle-fountain water-anim-ctypal water-anim-ctypal-middle-fountain-lod0-jg -1
((water-anim-ctypal-middle-fountain-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 22.5)
)
(defskelgroup skel-water-anim-ctypal-long-grnd-pool water-anim-ctypal water-anim-ctypal-long-grnd-pool-lod0-jg -1
((water-anim-ctypal-long-grnd-pool-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 50)
)
(deftype water-anim-look (structure)
((skel-group string)
(anim int32)
(ambient-sound-spec sound-spec)
)
)
(define *water-anim-look*
(new 'static 'boxed-array :type water-anim-look
(new 'static 'water-anim-look :skel-group "water-anim-nest-dark-eco-largepool" :anim 8 :ambient-sound-spec #f)
(new 'static 'water-anim-look
:skel-group "water-anim-nest-dark-eco-smlupperpool"
:anim 8
:ambient-sound-spec #f
)
(new 'static 'water-anim-look
:skel-group "water-anim-nest-dark-eco-middlepool"
:anim 8
:ambient-sound-spec #f
)
(new 'static 'water-anim-look :skel-group "water-anim-nest-dark-eco-botpool" :anim 8 :ambient-sound-spec #f)
(new 'static 'water-anim-look
:skel-group "water-anim-strip-dark-eco-near-lift"
:anim 12
:ambient-sound-spec #f
)
(new 'static 'water-anim-look
:skel-group "water-anim-strip-dark-eco-near-lift"
:anim 12
:ambient-sound-spec #f
)
(new 'static 'water-anim-look
:skel-group "water-anim-strip-dark-eco-near-crane"
:anim 12
:ambient-sound-spec #f
)
(new 'static 'water-anim-look
:skel-group "water-anim-strip-dark-eco-with-eggs"
:anim 12
:ambient-sound-spec #f
)
(new 'static 'water-anim-look
:skel-group "water-anim-strip-dark-eco-under-bridge"
:anim 12
:ambient-sound-spec #f
)
(new 'static 'water-anim-look :skel-group "water-anim-mountain-dark-eco-dice" :anim 2 :ambient-sound-spec #f)
(new 'static 'water-anim-look :skel-group "water-anim-under-pool" :anim 6 :ambient-sound-spec #f)
(new 'static 'water-anim-look :skel-group "water-anim-under-drainout" :anim 6 :ambient-sound-spec #f)
(new 'static 'water-anim-look :skel-group "water-anim-under-fillup" :anim 6 :ambient-sound-spec #f)
(new 'static 'water-anim-look :skel-group "water-anim-mountain-fall-hi" :anim 6 :ambient-sound-spec #f)
(new 'static 'water-anim-look :skel-group "water-anim-mountain-fall-med" :anim 6 :ambient-sound-spec #f)
(new 'static 'water-anim-look :skel-group "water-anim-mountain-fall-low" :anim 6 :ambient-sound-spec #f)
(new 'static 'water-anim-look :skel-group "water-anim-stadium-middle-pool" :anim 6 :ambient-sound-spec #f)
(new 'static 'water-anim-look :skel-group "water-anim-stadium-top-fountain" :anim 6 :ambient-sound-spec #f)
(new 'static 'water-anim-look :skel-group "water-anim-stadium-floor-pool" :anim 6 :ambient-sound-spec #f)
(new 'static 'water-anim-look
:skel-group "water-anim-tomb-dark-eco-stair-block"
:anim 4
:ambient-sound-spec #f
)
(new 'static 'water-anim-look
:skel-group "water-anim-tomb-dark-eco-raised-block"
:anim 4
:ambient-sound-spec #f
)
(new 'static 'water-anim-look :skel-group "water-anim-fortress-exitb-pool" :anim 2 :ambient-sound-spec #f)
(new 'static 'water-anim-look :skel-group "water-anim-tomb-main-hall" :anim 12 :ambient-sound-spec #f)
(new 'static 'water-anim-look :skel-group "water-anim-tomb-tunnel-b" :anim 12 :ambient-sound-spec #f)
(new 'static 'water-anim-look :skel-group "water-anim-tomb-tunnel-c" :anim 12 :ambient-sound-spec #f)
(new 'static 'water-anim-look :skel-group "water-anim-tomb-tunnel-d" :anim 12 :ambient-sound-spec #f)
(new 'static 'water-anim-look :skel-group "water-anim-tomb-tunnel-e" :anim 12 :ambient-sound-spec #f)
(new 'static 'water-anim-look :skel-group "water-anim-tomb-tunnel-f" :anim 12 :ambient-sound-spec #f)
(new 'static 'water-anim-look :skel-group "water-anim-mincan-exitb-pool" :anim 2 :ambient-sound-spec #f)
(new 'static 'water-anim-look :skel-group "water-anim-ctypal-lrgsqr-pool" :anim 12 :ambient-sound-spec #f)
(new 'static 'water-anim-look :skel-group "water-anim-ctypal-smlsqr-pool" :anim 12 :ambient-sound-spec #f)
(new 'static 'water-anim-look :skel-group "water-anim-ctypal-lrgfloor-pool" :anim 12 :ambient-sound-spec #f)
(new 'static 'water-anim-look :skel-group "water-anim-ctypal-smlground-pool" :anim 12 :ambient-sound-spec #f)
(new 'static 'water-anim-look :skel-group "water-anim-ctypal-middle-fountain" :anim 12 :ambient-sound-spec #f)
(new 'static 'water-anim-look :skel-group "water-anim-ctypal-long-grnd-pool" :anim 12 :ambient-sound-spec #f)
)
)
(defbehavior water-anim-event-handler water-anim ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(local-vars (v0-1 object))
(case arg2
(('move-to)
(move-to-point! self (the-as vector (-> arg3 param 0)))
(set! v0-1 (logclear (-> self mask) (process-mask sleep-code)))
(set! (-> self mask) (the-as process-mask v0-1))
v0-1
)
(('move-to-y)
(let ((a1-2 (new 'stack-no-clear 'vector)))
(set! (-> a1-2 quad) (-> self root trans quad))
(set! (-> a1-2 y) (the-as float (-> arg3 param 0)))
(move-to-point! self a1-2)
)
(set! v0-1 (logclear (-> self mask) (process-mask sleep-code)))
(set! (-> self mask) (the-as process-mask v0-1))
v0-1
)
(('water)
(let* ((s5-0 (the-as object (-> arg3 param 0)))
(s4-0 (the-as object (-> arg3 param 1)))
(gp-0 (if (type? (the-as process s4-0) process-focusable)
(the-as uint s4-0)
)
)
)
(when (and (logtest? (-> self flags) (water-flags deadly))
(logtest? (water-flags touch-water) (-> (the-as water-info s5-0) flags))
(the-as uint gp-0)
)
(let ((v1-15 (-> self attack-event)))
(case v1-15
((#f)
)
(('heat)
(send-event (the-as process-tree gp-0) 'heat (* 10.0 (seconds-per-frame)))
)
(('drown-death 'lava 'dark-eco-pool)
(if (and (not (focus-test? (the-as process-focusable gp-0) board))
(send-event
(the-as process-focusable gp-0)
'attack-invinc
#f
(static-attack-info ((id (-> self attack-id)) (mode v1-15)))
)
)
(send-event self 'notify 'attack)
)
)
(else
(if (and (not (focus-test? (the-as process-focusable gp-0) board))
(send-event
(the-as process-tree gp-0)
'attack
#f
(static-attack-info ((id (-> self attack-id)) (mode v1-15)))
)
)
(send-event self 'notify 'attack)
)
)
)
)
)
(when (and (logtest? (-> self flags) (water-flags flow))
(logtest? (water-flags touch-water) (-> (the-as water-info s5-0) flags))
)
(let ((a0-40 (-> self flow)))
(if (nonzero? a0-40)
(push-process a0-40 (the-as process-focusable gp-0))
)
)
)
)
)
(('visible)
(cond
((-> arg3 param 0)
(set! (-> self visible) #t)
)
(else
(set! (-> self visible) #f)
(logior! (-> self draw status) (draw-control-status no-draw))
)
)
(logclear! (-> self mask) (process-mask sleep-code))
#t
)
)
)
(defstate idle (water-anim)
:virtual #t
:event water-anim-event-handler
:trans (behavior ()
(let ((a0-0 (-> self flow)))
(if (and (nonzero? a0-0) *display-vol-marks*)
(draw-path a0-0)
)
)
(cond
((not (-> self visible))
)
((< (-> (math-camera-pos) y) (+ -8192.0 (-> self root trans y)))
(logior! (-> self draw status) (draw-control-status no-draw))
)
(else
(logclear! (-> self draw status) (draw-control-status no-draw))
)
)
(if (and (-> self visible) (and (-> self play-ambient-sound?) (nonzero? (-> self sound))))
(update! (-> self sound))
)
)
:code (behavior ()
(until #f
(ja-post)
(logior! (-> self mask) (process-mask sleep-code))
(suspend)
)
#f
)
)
(defmethod move-to-point! ((this water-anim) (arg0 vector))
"Set a [[water-anim]]'s `trans` as specified by the [[vector]] and update `water-height`."
(set! (-> this root trans quad) (-> arg0 quad))
(set! (-> this water-height) (-> this root trans y))
(if (nonzero? (-> this sound))
(update-trans! (-> this sound) (-> this root trans))
)
)
(defmethod get-ripple-height ((this water-anim) (arg0 vector))
(ripple-find-height this 0 arg0)
)
;; WARN: Return type mismatch symbol vs none.
(defmethod water-anim-method-27 ((this water-anim))
"Empty."
(none)
)
;; WARN: Return type mismatch quaternion vs none.
(defmethod offset! ((this water-anim))
"Offset a [[water-anim]]'s `trans` and `quat` by the lump data in `entity`."
(local-vars (sv-16 res-tag))
(set! (-> this play-ambient-sound?) #t)
(set! (-> this visible) #t)
(set! (-> this look)
(res-lump-value (-> this entity) 'look int :default (the-as uint128 -1) :time -1000000000.0)
)
(set! sv-16 (new 'static 'res-tag))
(let ((v1-4 (res-lump-data (-> this entity) 'trans-offset vector :tag-ptr (& sv-16))))
(when v1-4
(+! (-> this root trans x) (-> v1-4 x))
(+! (-> this root trans y) (-> v1-4 y))
(+! (-> this root trans z) (-> v1-4 z))
)
)
(let ((f0-6 (res-lump-float (-> this entity) 'rotoffset)))
(if (!= f0-6 0.0)
(quaternion-rotate-y! (-> this root quat) (-> this root quat) f0-6)
)
)
(none)
)
(defmethod init-water! ((this water-anim))
"Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]"
(let ((s5-0 (-> this look)))
(if (or (< s5-0 0) (>= s5-0 (-> *water-anim-look* length)))
(go process-drawable-art-error "skel group")
)
(let ((s5-1 (-> *water-anim-look* s5-0)))
(initialize-skeleton-by-name this (-> s5-1 skel-group))
(ja-channel-set! 1)
(let ((s4-0 (-> this skel root-channel 0)))
(joint-control-channel-group-eval!
s4-0
(the-as art-joint-anim (-> this draw art-group data (-> s5-1 anim)))
num-func-identity
)
(set! (-> s4-0 frame-num) 0.0)
)
(let ((a2-1 (-> s5-1 ambient-sound-spec)))
(when a2-1
(let ((a3-0 (new 'stack-no-clear 'vector)))
(vector+! a3-0 (-> this root trans) (-> this draw bounds))
(set! (-> this sound) (new 'process 'ambient-sound a2-1 a3-0))
)
)
)
)
)
(ja-post)
(none)
)
(defmethod reset-root! ((this water-anim))
"Reset a [[water-anim]]'s `root`."
(let ((v0-0 (new 'process 'trsqv)))
(set! (-> this root) v0-0)
v0-0
)
)
;; WARN: Return type mismatch water-flags vs none.
(defmethod water-anim-init! ((this water-anim))
"Initialize a [[water-anim]]."
(local-vars (sv-16 res-tag))
(set! (-> this attack-event) (the-as symbol ((method-of-type res-lump get-property-struct)
(-> this entity)
'attack-event
'interp
-1000000000.0
(the-as structure 'drown)
(the-as (pointer res-tag) #f)
*res-static-buf*
)
)
)
(process-drawable-from-entity! this (-> this entity))
(logclear! (-> this mask) (process-mask actor-pause))
(set! (-> this vol) (new 'process 'vol-control this))
(logior! (-> this vol flags) (vol-flags display? vol-flags-1))
(set! (-> this bottom-height) 32768.0)
(let* ((v1-8 *game-info*)
(a0-7 (+ (-> v1-8 attack-id) 1))
)
(set! (-> v1-8 attack-id) a0-7)
(set! (-> this attack-id) a0-7)
)
(set! (-> this target) (the-as handle #f))
(set! sv-16 (new 'static 'res-tag))
(let ((v1-10 (the-as (pointer float) ((method-of-type res-lump get-property-data)
(-> this entity)
'water-height
'exact
-1000000000.0
(the-as pointer #f)
(& sv-16)
*res-static-buf*
)
)
)
)
(when v1-10
(set! (-> this water-height) (-> v1-10 0))
(set! (-> this wade-height) (-> v1-10 1))
(set! (-> this swim-height) (-> v1-10 2))
(if (>= (-> sv-16 elt-count) (the-as uint 4))
(set! (-> this flags) (the-as water-flags (the int (-> v1-10 3))))
)
(if (>= (-> sv-16 elt-count) (the-as uint 5))
(set! (-> this bottom-height) (-> v1-10 4))
)
)
)
(logior! (-> this flags) (water-flags part-water))
(if (logtest? (-> this flags) (water-flags flow))
(set! (-> this flow) (new 'process 'flow-control this (the-as res-lump #f)))
)
(cond
((zero? (-> this flags))
(if (< 0.0 (-> this wade-height))
(logior! (-> this flags) (water-flags can-wade))
)
(if (< 0.0 (-> this swim-height))
(logior! (-> this flags) (water-flags can-swim))
)
)
(else
)
)
(none)
)
;; WARN: Return type mismatch object vs none.
(defbehavior water-anim-init-by-other water-anim ((arg0 entity-actor))
(process-entity-set! self arg0)
(water-anim-method-27 self)
(reset-root! self)
(water-anim-init! self)
(offset! self)
(init-water! self)
(go-virtual idle)
(none)
)
;; WARN: Return type mismatch object vs none.
(defmethod init-from-entity! ((this water-anim) (arg0 entity-actor))
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
This commonly includes things such as:
- stack size
- collision information
- loading the skeleton group / bones
- sounds"
(water-anim-method-27 this)
(reset-root! this)
(water-anim-init! this)
(offset! this)
(init-water! this)
(go (method-of-object this idle))
(none)
)