jak-project/goal_src/levels/beach/lurkerpuppy.gc
Tyler Wilding d1f16b34ff
decomp: another batch of easy files (#823)
* decomp: finish `sharkey`

* decomp: finish `lurkercrab`

* decomp: finish `lurkerpuppy`

* decomp: finish `assistant-citadel`

* decomp: finish `static-screen`

* decomp: finish `robotboss-h`

* decomp: finish `final-door`

* decomp: finish `aphid`

* addressed review
2021-09-06 15:34:31 -04:00

647 lines
15 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: lurkerpuppy.gc
;; name in dgo: lurkerpuppy
;; dgos: BEA, L1
(define-extern *lurkerpuppy-sg* skeleton-group)
;; definition of type lurkerpuppy
(deftype lurkerpuppy (nav-enemy)
()
:heap-base #x120
:method-count-assert 76
:size-assert #x190
:flag-assert #x4c01200190
)
;; failed to figure out what this is:
(let
((v1-1
(new 'static 'skeleton-group
:art-group-name "lurkerpuppy"
:bounds (new 'static 'vector :w 8192.0)
:max-lod 2
:version #x6
:shadow 4
)
)
)
(set! (-> v1-1 jgeo) 0)
(set! (-> v1-1 janim) 5)
(set! (-> v1-1 mgeo 0) (the-as uint 1))
(set! (-> v1-1 lod-dist 0) 81920.0)
(set! (-> v1-1 mgeo 1) (the-as uint 2))
(set! (-> v1-1 lod-dist 1) 163840.0)
(set! (-> v1-1 mgeo 2) (the-as uint 3))
(set! (-> v1-1 lod-dist 2) 4095996000.0)
(set! *lurkerpuppy-sg* v1-1)
)
;; failed to figure out what this is:
nav-enemy-default-event-handler
;; failed to figure out what this is:
(defstate nav-enemy-notice (lurkerpuppy)
:virtual #t
:event
(the-as
(function process int symbol event-message-block object :behavior lurkerpuppy)
nav-enemy-default-event-handler
)
:code
(behavior ()
(let ((a0-0 (-> self skel root-channel 0)))
(set! (-> a0-0 param 0) 1.0)
(joint-control-channel-group!
a0-0
(the-as art-joint-anim #f)
num-func-loop!
)
)
(ja-channel-push! 1 51)
(let ((a0-2 (-> self skel root-channel 0)))
(set!
(-> a0-2 frame-group)
(the-as art-joint-anim (-> self draw art-group data 8))
)
(set!
(-> a0-2 param 0)
(the
float
(+
(->
(the-as art-joint-anim (-> self draw art-group data 8))
data
0
length
)
-1
)
)
)
(set! (-> a0-2 param 1) 1.0)
(set! (-> a0-2 frame-num) 0.0)
(joint-control-channel-group!
a0-2
(the-as art-joint-anim (-> self draw art-group data 8))
num-func-seek!
)
)
(until (ja-done? 0)
(ja-blend-eval)
(suspend)
(let ((a0-3 (-> self skel root-channel 0)))
(set!
(-> a0-3 param 0)
(the float (+ (-> a0-3 frame-group data 0 length) -1))
)
(set! (-> a0-3 param 1) 1.0)
(joint-control-channel-group-eval!
a0-3
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
(go-virtual nav-enemy-chase)
(none)
)
)
;; failed to figure out what this is:
(defstate nav-enemy-chase (lurkerpuppy)
:virtual #t
:event
(the-as
(function process int symbol event-message-block object :behavior lurkerpuppy)
nav-enemy-default-event-handler
)
:code
(behavior ()
(cond
((= (if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
(-> self draw art-group data 10)
)
(ja-channel-push! 1 51)
(let ((gp-0 (-> self skel root-channel 0)))
(set!
(-> gp-0 frame-group)
(the-as art-joint-anim (-> self draw art-group data 7))
)
(set!
(-> gp-0 param 0)
(the
float
(+
(->
(the-as art-joint-anim (-> self draw art-group data 7))
data
0
length
)
-1
)
)
)
(set! (-> gp-0 param 1) 1.0)
(set! (-> gp-0 frame-num) (ja-aframe 4.0 0))
(joint-control-channel-group!
gp-0
(the-as art-joint-anim (-> self draw art-group data 7))
num-func-seek!
)
)
(until (ja-done? 0)
(suspend)
(let ((a0-7 (-> self skel root-channel 0)))
(set!
(-> a0-7 param 0)
(the float (+ (-> a0-7 frame-group data 0 length) -1))
)
(set! (-> a0-7 param 1) 1.0)
(joint-control-channel-group-eval!
a0-7
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
)
(else
(ja-channel-push! 1 51)
)
)
(let ((f30-0 (rand-vu-float-range 0.9 1.1)))
(while #t
(if (rand-vu-percent? 0.25)
(sound-play-by-name
(static-sound-name "puppy-bark")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
)
(let ((a0-14 (-> self skel root-channel 0)))
(set!
(-> a0-14 frame-group)
(the-as art-joint-anim (-> self draw art-group data 7))
)
(set!
(-> a0-14 param 0)
(the
float
(+
(->
(the-as art-joint-anim (-> self draw art-group data 7))
data
0
length
)
-1
)
)
)
(set! (-> a0-14 param 1) f30-0)
(set! (-> a0-14 frame-num) 0.0)
(joint-control-channel-group!
a0-14
(the-as art-joint-anim (-> self draw art-group data 7))
num-func-seek!
)
)
(until (ja-done? 0)
(if (logtest? (-> self nav-enemy-flags) 256)
(go-virtual nav-enemy-attack)
)
(suspend)
(let ((a0-15 (-> self skel root-channel 0)))
(set!
(-> a0-15 param 0)
(the float (+ (-> a0-15 frame-group data 0 length) -1))
)
(set! (-> a0-15 param 1) f30-0)
(joint-control-channel-group-eval!
a0-15
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
)
)
(none)
)
)
;; failed to figure out what this is:
(defstate nav-enemy-stare (lurkerpuppy)
:virtual #t
:event
(the-as
(function process int symbol event-message-block object :behavior lurkerpuppy)
nav-enemy-default-event-handler
)
:code
(behavior ()
(set! (-> self rotate-speed) 1456355.5)
(set! (-> self turn-time) 30)
(set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags)))
(let ((f30-0 (rand-vu-float-range 0.8 1.2)))
(while #t
(logior! (-> self nav-enemy-flags) 16)
(ja-channel-push! 1 30)
(let ((gp-0 (-> self skel root-channel 0)))
(set!
(-> gp-0 frame-group)
(the-as art-joint-anim (-> self draw art-group data 8))
)
(set! (-> gp-0 param 0) (ja-aframe 12.0 0))
(set! (-> gp-0 param 1) f30-0)
(set! (-> gp-0 frame-num) 0.0)
(joint-control-channel-group!
gp-0
(the-as art-joint-anim (-> self draw art-group data 8))
num-func-seek!
)
)
(until (ja-done? 0)
(let ((f0-3 (ja-aframe-num 0)))
(set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags)))
(if (and (>= f0-3 2.5) (>= 7.5 f0-3))
(logior! (-> self nav-enemy-flags) 16)
)
)
(suspend)
(let ((gp-1 (-> self skel root-channel 0)))
(set! (-> gp-1 param 0) (ja-aframe 12.0 0))
(set! (-> gp-1 param 1) f30-0)
(joint-control-channel-group-eval!
gp-1
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
(set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags)))
(let ((a0-11 (-> self skel root-channel 0)))
(set! (-> a0-11 param 0) 1.0)
(joint-control-channel-group!
a0-11
(the-as art-joint-anim #f)
num-func-loop!
)
)
(ja-channel-push! 1 30)
(let ((v1-31 (-> self skel root-channel 0)))
(set!
(-> v1-31 frame-group)
(the-as art-joint-anim (-> self draw art-group data 5))
)
)
(let ((v1-34 (-> self skel root-channel 0)))
(set! (-> v1-34 num-func) num-func-identity)
(set! (-> v1-34 frame-num) 0.0)
)
(let ((gp-2 (rand-vu-int-range 750 900))
(s5-0 (-> *display* base-frame-counter))
)
(until (>= (- (-> *display* base-frame-counter) s5-0) gp-2)
(let ((a0-18 (-> self skel root-channel 0)))
(set! (-> a0-18 param 0) 1.0)
(joint-control-channel-group-eval!
a0-18
(the-as art-joint-anim #f)
num-func-loop!
)
)
(ja-blend-eval)
(suspend)
)
)
)
)
(none)
)
)
;; failed to figure out what this is:
(defstate nav-enemy-give-up (lurkerpuppy)
:virtual #t
:event
(the-as
(function process int symbol event-message-block object :behavior lurkerpuppy)
nav-enemy-default-event-handler
)
:code
(behavior ()
(set! (-> self rotate-speed) 218453.33)
(set! (-> self turn-time) 150)
(ja-channel-push! 1 22)
(let ((a0-1 (-> self skel root-channel 0)))
(set!
(-> a0-1 frame-group)
(the-as art-joint-anim (-> self draw art-group data 5))
)
(set!
(-> a0-1 param 0)
(the
float
(+
(->
(the-as art-joint-anim (-> self draw art-group data 5))
data
0
length
)
-1
)
)
)
(set! (-> a0-1 param 1) 1.0)
(set! (-> a0-1 frame-num) 0.0)
(joint-control-channel-group!
a0-1
(the-as art-joint-anim (-> self draw art-group data 5))
num-func-seek!
)
)
(until (ja-done? 0)
(suspend)
(let ((a0-2 (-> self skel root-channel 0)))
(set!
(-> a0-2 param 0)
(the float (+ (-> a0-2 frame-group data 0 length) -1))
)
(set! (-> a0-2 param 1) 1.0)
(joint-control-channel-group-eval!
a0-2
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
(logclear! (-> self nav flags) (nav-control-flags bit17 bit19))
(nav-enemy-get-new-patrol-point)
(let ((a0-7 (-> self skel root-channel 0)))
(set!
(-> a0-7 frame-group)
(the-as art-joint-anim (-> self draw art-group data 5))
)
(set!
(-> a0-7 param 0)
(the
float
(+
(->
(the-as art-joint-anim (-> self draw art-group data 5))
data
0
length
)
-1
)
)
)
(set! (-> a0-7 param 1) 1.4)
(set! (-> a0-7 frame-num) 0.0)
(joint-control-channel-group!
a0-7
(the-as art-joint-anim (-> self draw art-group data 5))
num-func-seek!
)
)
(until (ja-done? 0)
(seek-to-point-toward-point!
(-> self collide-info)
(-> self nav destination-pos)
(-> self rotate-speed)
(-> self turn-time)
)
(suspend)
(let ((a0-9 (-> self skel root-channel 0)))
(set!
(-> a0-9 param 0)
(the float (+ (-> a0-9 frame-group data 0 length) -1))
)
(set! (-> a0-9 param 1) 1.4)
(joint-control-channel-group-eval!
a0-9
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
(go-virtual nav-enemy-patrol)
(none)
)
)
;; failed to figure out what this is:
(defstate nav-enemy-attack (lurkerpuppy)
:virtual #t
:event
(the-as
(function process int symbol event-message-block object :behavior lurkerpuppy)
nav-enemy-default-event-handler
)
:code
(behavior ()
(sound-play-by-name
(static-sound-name "head-butt")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(go-virtual nav-enemy-victory)
(none)
)
)
;; failed to figure out what this is:
(defstate nav-enemy-victory (lurkerpuppy)
:virtual #t
:event
(the-as
(function process int symbol event-message-block object :behavior lurkerpuppy)
nav-enemy-default-event-handler
)
:exit
(behavior ()
(logior! (-> self nav-enemy-flags) 16)
(none)
)
:code
(behavior ()
(set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags)))
(ja-channel-push! 1 22)
(dotimes (gp-0 4)
(let ((a0-2 (-> self skel root-channel 0)))
(set!
(-> a0-2 frame-group)
(the-as art-joint-anim (-> self draw art-group data 8))
)
(set!
(-> a0-2 param 0)
(the
float
(+
(->
(the-as art-joint-anim (-> self draw art-group data 8))
data
0
length
)
-1
)
)
)
(set! (-> a0-2 param 1) 1.0)
(set! (-> a0-2 frame-num) 0.0)
(joint-control-channel-group!
a0-2
(the-as art-joint-anim (-> self draw art-group data 8))
num-func-seek!
)
)
(until (ja-done? 0)
(let ((f0-4 (ja-aframe-num 0)))
(set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags)))
(if (and (>= f0-4 2.5) (>= 7.5 f0-4))
(logior! (-> self nav-enemy-flags) 16)
)
)
(suspend)
(let ((a0-5 (-> self skel root-channel 0)))
(set!
(-> a0-5 param 0)
(the float (+ (-> a0-5 frame-group data 0 length) -1))
)
(set! (-> a0-5 param 1) 1.0)
(joint-control-channel-group-eval!
a0-5
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
)
(go-virtual nav-enemy-chase)
(none)
)
:post
(the-as (function none :behavior lurkerpuppy) nav-enemy-face-player-post)
)
;; definition for symbol *lurkerpuppy-nav-enemy-info*, type nav-enemy-info
(define
*lurkerpuppy-nav-enemy-info*
(new 'static 'nav-enemy-info
:idle-anim 5
:walk-anim 6
:turn-anim 6
:notice-anim 8
:run-anim 7
:jump-anim 9
:jump-land-anim 10
:victory-anim 8
:taunt-anim 8
:die-anim 11
:neck-joint -1
:player-look-at-joint 5
:run-travel-speed (meters 5.0)
:run-rotate-speed (degrees 3999.9998)
:run-acceleration (meters 1.0)
:run-turn-time #x2d
:walk-travel-speed (meters 2.0)
:walk-rotate-speed (degrees 1999.9999)
:walk-acceleration (meters 1.0)
:walk-turn-time #x1e
:attack-shove-back (meters 3.0)
:attack-shove-up (meters 2.0)
:shadow-size (meters 2.0)
:notice-nav-radius (meters 1.0)
:nav-nearest-y-threshold (meters 10.0)
:notice-distance (meters 30.0)
:stop-chase-distance (meters 40.0)
:frustration-distance (meters 8.0)
:frustration-time #x4b0
:die-anim-hold-frame 6.0
:jump-anim-start-frame 3.5
:jump-land-anim-end-frame 14.0
:jump-height-min (meters 1.0)
:jump-height-factor 0.5
:jump-start-anim-speed 1.0
:shadow-max-y (meters 0.5)
:shadow-min-y (meters -1.0)
:shadow-locus-dist (meters 150.0)
:use-align #f
:draw-shadow #t
:move-to-ground #t
:hover-if-no-ground #f
:use-momentum #f
:use-flee #f
:use-proximity-notice #f
:use-jump-blocked #f
:use-jump-patrol #f
:gnd-collide-with #x1
:debug-draw-neck #f
:debug-draw-jump #f
)
)
;; definition for method 47 of type lurkerpuppy
;; INFO: Return type mismatch int vs none.
(defmethod TODO-RENAME-47 lurkerpuppy ((obj lurkerpuppy))
(let
((s5-0
(new
'process
'collide-shape-moving
obj
(collide-list-enum usually-hit-by-player)
)
)
)
(set! (-> s5-0 dynam) (copy *standard-dynamics* 'process))
(set! (-> s5-0 reaction) default-collision-reaction)
(set! (-> s5-0 no-reaction) nothing)
(let ((s4-0 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 3))))
(set! (-> s4-0 prim-core collide-as) (the-as uint 256))
(set! (-> s4-0 collide-with) (the-as uint 16))
(set! (-> s4-0 prim-core action) (the-as uint 1))
(set! (-> s4-0 prim-core offense) 2)
(set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 4915.2)
)
(dummy-46 s5-0)
(set! (-> s5-0 nav-radius) 2048.0)
(dummy-50 s5-0)
(set! (-> obj collide-info) s5-0)
)
0
(none)
)
;; definition for method 48 of type lurkerpuppy
;; INFO: Return type mismatch int vs none.
(defmethod TODO-RENAME-48 lurkerpuppy ((obj lurkerpuppy))
(dummy-14 obj *lurkerpuppy-sg* '())
(TODO-RENAME-45 obj *lurkerpuppy-nav-enemy-info*)
(when (nonzero? (-> obj neck))
(set! (-> obj neck up) (the-as uint 0))
(set! (-> obj neck nose) (the-as uint 1))
(set! (-> obj neck ear) (the-as uint 2))
)
0
(none)
)