Files
jak-project/test/decompiler/reference/jak3/levels/mine/monster-frog_REF.gc
T
water111 48cb9bb787 [decompiler] as-type and font method support (#3855)
Add support for `as-type` macro, and detecting inline font methods. This
works in all three games but I've only updated jak 3's goal_src for now.
Eventually I will go back and work through the others, but I want to get
more decompiler features in first.


![image](https://github.com/user-attachments/assets/5c31bf85-97b4-437c-bc4b-dc054e60551e)

---------

Co-authored-by: water111 <awaterford1111445@gmail.com>
2025-02-01 21:23:11 -05:00

988 lines
34 KiB
Common Lisp
Vendored
Generated

;;-*-Lisp-*-
(in-package goal)
;; failed to figure out what this is:
(defskelgroup skel-monster-frog monster-frog monster-frog-lod0-jg monster-frog-idle0-ja
((monster-frog-lod0-mg (meters 20)) (monster-frog-lod1-mg (meters 999999)))
:bounds (static-spherem 0 0 0 5)
:shadow monster-frog-shadow-mg
:origin-joint-index 12
)
;; definition of type monster-frog
(deftype monster-frog (nav-enemy)
()
(:state-methods
(attack vector)
attack-recover
turn
)
)
;; definition for method 3 of type monster-frog
(defmethod inspect ((this monster-frog))
(when (not this)
(set! this this)
(goto cfg-4)
)
(let ((t9-0 (method-of-type nav-enemy inspect)))
(t9-0 this)
)
(label cfg-4)
this
)
;; definition for symbol *fact-info-monster-frog-defaults*, type fact-info-enemy-defaults
(define *fact-info-monster-frog-defaults*
(new 'static 'fact-info-enemy-defaults :idle-distance (meters 80) :pickup-type 9)
)
;; definition for symbol *monster-frog-nav-enemy-info*, type nav-enemy-info
(define *monster-frog-nav-enemy-info*
(new 'static 'nav-enemy-info
:use-die-falling #f
:use-victory #f
:use-jump-blocked #t
:debug-draw-neck #f
:jump-debug-draw #f
:move-to-ground #t
:hover-if-no-ground #f
:idle-anim-script (new 'static 'inline-array idle-control-frame 5
(new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30)
(new 'static 'idle-control-frame
:command (idle-control-cmd play)
:anim #x4
:param0 2
:param1 3
:param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0))
)
(new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30)
(new 'static 'idle-control-frame
:command (idle-control-cmd play)
:anim #x5
:param0 1
:param1 2
:param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0))
)
(new 'static 'idle-control-frame)
)
:idle-anim 4
:notice-anim 8
:hostile-anim 18
:hit-anim 30
:knocked-anim 30
:knocked-land-anim 31
:die-anim 4
:die-falling-anim 4
:victory-anim -1
:jump-wind-up-anim -1
:jump-in-air-anim -1
:jump-land-anim -1
:neck-joint 5
:look-at-joint 5
:bullseye-joint 4
:sound-die (static-sound-name "frog-die")
:notice-distance (meters 40)
:notice-distance-delta (meters 10)
:proximity-notice-distance (meters 40)
:default-hit-points 1.0
:gnd-collide-with (collide-spec backgnd)
:overlaps-others-collide-with-filter (collide-spec jak bot player-list)
:penetrate-knocked (penetrate
generic-attack
flop
punch
spin
roll
uppercut
bonk
tube
flut-attack
board
mech-punch
mech-bonk
dark-skin
dark-punch
dark-bomb
dark-smack
flut
shield
explode
jak-yellow-shot
jak-red-shot
jak-blue-shot
jak-dark-shot
enemy-yellow-shot
enemy-dark-shot
eco-yellow
knocked
)
:movement-gravity (meters -100)
:friction 0.8
:attack-shove-back (meters 3)
:attack-shove-up (meters 2)
:attack-mode 'generic
:attack-damage 2
:recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher)
:knocked-can-land-timeout (seconds 0.1)
:knocked-recover-timeout (seconds 2)
:ragdoll-blend-out-time (seconds 0.25)
:ragdoll-rotate-velocity-mult 1.0
:jump-height-min (meters 2.87)
:jump-height-factor 0.1
:knocked-seek-ry-clamp 4551.1113
:knocked-soft-vxz-lo (meters 18.5)
:knocked-soft-vxz-hi (meters 18.5)
:knocked-soft-vy-lo (meters 20)
:knocked-soft-vy-hi (meters 20)
:knocked-medium-vxz-lo (meters 36)
:knocked-medium-vxz-hi (meters 48)
:knocked-medium-vy-lo (meters 33)
:knocked-medium-vy-hi (meters 37)
:knocked-hard-vxz-lo (meters 19.5)
:knocked-hard-vxz-hi (meters 19.5)
:knocked-hard-vy-lo (meters 44.8)
:knocked-hard-vy-hi (meters 51.2)
:knocked-huge-vxz-lo (meters 40.2)
:knocked-huge-vxz-hi (meters 60.8)
:knocked-huge-vy-lo (meters 44.8)
:knocked-huge-vy-hi (meters 53.2)
:knocked-yellow-vxz-lo (meters 18.5)
:knocked-yellow-vxz-hi (meters 18.5)
:knocked-yellow-vy-lo (meters 20)
:knocked-yellow-vy-hi (meters 20)
:knocked-red-vxz-lo (meters 18)
:knocked-red-vxz-hi (meters 18)
:knocked-red-vy-lo (meters 23.5)
:knocked-red-vy-hi (meters 23.5)
:knocked-blue-vxz-lo (meters 10)
:knocked-blue-vxz-hi (meters 12)
:knocked-blue-vy-lo (meters 6)
:knocked-blue-vy-hi (meters 20)
:ragdoll-info #f
:shadow-size (meters 2)
:shadow-max-y (meters 1)
:shadow-min-y (meters -1)
:shadow-locus-dist (meters 150)
:gem-joint -1
:gem-offset (new 'static 'sphere :r 163840.0)
:knocked-off #t
:callback-info #f
:use-momentum #f
:use-frustration #t
:use-stop-chase #f
:use-circling #t
:use-pacing #t
:walk-anim 16
:turn-anim 16
:run-anim 18
:taunt-anim -1
:run-travel-speed (meters 18)
:run-acceleration (meters 10)
:run-turning-acceleration (meters 80)
:walk-travel-speed (meters 11.44)
:walk-acceleration (meters 5)
:walk-turning-acceleration (meters 20)
:maximum-rotation-rate (degrees 360)
:notice-nav-radius (meters 1.5)
:frustration-distance (meters 8)
:frustration-time (seconds 4)
:blocked-time (seconds 0.3)
:circle-dist-lo 20480.0
:circle-dist-hi 61440.0
:nav-mesh #f
)
)
;; failed to figure out what this is:
(set! (-> *monster-frog-nav-enemy-info* fact-defaults) *fact-info-monster-frog-defaults*)
;; definition for function monster-frog-hop-slow-code
;; WARN: new jak 2 until loop case, check carefully
(defbehavior monster-frog-hop-slow-code monster-frog ()
(until #f
(let ((v1-0 self))
(set! (-> v1-0 enemy-flags) (the-as enemy-flag (logclear (-> v1-0 enemy-flags) (enemy-flag ef37))))
(set! (-> v1-0 nav callback-info) *null-nav-callback-info*)
)
0
(dotimes (gp-0 (rnd-time-frame self (seconds 0.007) (seconds 0.01)))
(cond
((zero? (rnd-int self 4))
(let ((v1-7 (ja-group)))
(if (not (and v1-7 (= v1-7 monster-frog-idle0-ja)))
(ja-channel-push! 1 (seconds 0.1))
)
)
(ja-no-eval :group! monster-frog-idle0-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
)
(else
(let ((v1-38 (ja-group)))
(if (not (and v1-38 (= v1-38 monster-frog-idle1-ja)))
(ja-channel-push! 1 (seconds 0.1))
)
)
(ja-no-eval :group! monster-frog-idle1-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
)
)
)
(let ((v1-71 self))
(if (not (logtest? (enemy-flag ef37) (-> v1-71 enemy-flags)))
(set! (-> v1-71 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-71 enemy-flags))))
)
(set! (-> v1-71 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-71 enemy-flags))))
(set! (-> v1-71 nav callback-info) (-> v1-71 enemy-info callback-info))
)
0
(ja-channel-push! 1 (seconds 0.035))
(let ((v1-74 self))
(set! (-> v1-74 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-74 enemy-flags))))
)
0
(nav-enemy-method-176 self)
(let ((v1-78 (-> self nav)))
(set! (-> v1-78 target-speed) (* 1.4 (-> self enemy-info walk-travel-speed)))
)
0
(let ((v1-80 self))
(set! (-> v1-80 enemy-flags) (the-as enemy-flag (logclear (-> v1-80 enemy-flags) (enemy-flag ef38))))
)
0
(ja-no-eval :group! monster-frog-hop-slow-start-ja :num! (seek! max 1.4) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! max 1.4))
)
(nav-enemy-method-178 self)
(ja-no-eval :group! monster-frog-hop-slow-end-ja :num! (seek! max 1.4) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! max 1.4))
)
)
#f
)
;; definition for function monster-frog-hop-fast-code
;; WARN: new jak 2 until loop case, check carefully
(defbehavior monster-frog-hop-fast-code monster-frog ()
(until #f
(nav-enemy-method-177 self)
(ja-no-eval :group! monster-frog-hop-slow-start-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(nav-enemy-method-178 self)
(ja-no-eval :group! monster-frog-hop-slow-end-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
)
#f
)
;; failed to figure out what this is:
(defstate ambush (monster-frog)
:virtual #t
:enter (behavior ()
(when (logtest? (-> self enemy-flags) (enemy-flag enable-on-notice))
(logclear! (-> self enemy-flags) (enemy-flag enable-on-notice))
(let ((gp-0 (-> self on-notice)))
(if gp-0
(script-eval gp-0 :vector (-> self root trans))
)
)
)
(let ((v1-12 (-> self root root-prim)))
(set! (-> v1-12 prim-core collide-as) (collide-spec))
(set! (-> v1-12 prim-core collide-with) (collide-spec))
)
0
(logior! (-> self draw status) (draw-control-status no-draw))
)
:code (behavior ()
(update-focus self)
(let ((a0-2 (handle->process (-> self focus handle))))
(when a0-2
(let* ((gp-0 (-> self root))
(s3-0
(vector-normalize!
(vector-! (new 'stack-no-clear 'vector) (get-trans (the-as process-focusable a0-2) 0) (-> gp-0 trans))
1.0
)
)
(f0-0 (deg-diff (quaternion-y-angle (-> gp-0 quat)) (vector-y-angle s3-0)))
)
(quaternion-rotate-y! (-> gp-0 quat) (-> gp-0 quat) f0-0)
)
)
)
(logclear! (-> self draw status) (draw-control-status no-draw))
(ja-no-eval :group! monster-frog-popup0-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(let ((v1-37 (-> self root root-prim)))
(set! (-> v1-37 prim-core collide-as) (-> self root backup-collide-as))
(set! (-> v1-37 prim-core collide-with) (-> self root backup-collide-with))
)
(go-state-for-focused self)
)
:post nav-enemy-simple-post
)
;; failed to figure out what this is:
(defstate notice (monster-frog)
:virtual #t
:code (behavior ()
(ja-channel-push! 1 (seconds 0.075))
(let ((f30-0 (rnd-float-range self 0.8 1.2)))
(new 'stack-no-clear 'vector)
(ja-no-eval :group! monster-frog-notice0-ja :num! (seek! max f30-0) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! max f30-0))
)
(ja-no-eval :group! monster-frog-notice0-jump-ja :num! (seek! max f30-0) :frame-num 0.0)
(until (ja-done? 0)
(let ((a0-7 (handle->process (-> self focus handle))))
(if a0-7
(seek-to-point-toward-point!
(-> self root)
(get-trans (the-as process-focusable a0-7) 0)
(* 98304.0 f30-0)
(seconds 0.02)
)
)
)
(suspend)
(ja :num! (seek! max f30-0))
)
(ja-no-eval :group! monster-frog-notice0-land-ja :num! (seek! max f30-0) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! max f30-0))
)
)
(go-state-for-focused self)
)
)
;; failed to figure out what this is:
(defstate active (monster-frog)
:virtual #t
:code (behavior ()
(let ((f30-0 (rnd-float-range self 0.9 1.1)))
(until #f
(nav-enemy-method-176 self)
(ja-channel-push! 1 (seconds 0.2))
(ja-no-eval :group! monster-frog-hop-slow-start-ja :num! (seek! max f30-0) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! max f30-0))
)
(nav-enemy-method-178 self)
(ja-no-eval :group! monster-frog-hop-slow-end-ja :num! (seek! max f30-0) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! max f30-0))
)
(when (rnd-chance-for-idle? self 0.2)
(ja-no-eval :num! (loop!))
(ja-channel-push! 1 (seconds 0.6))
(let ((v1-57 self))
(set! (-> v1-57 enemy-flags) (the-as enemy-flag (logclear (-> v1-57 enemy-flags) (enemy-flag ef37))))
(set! (-> v1-57 nav callback-info) *null-nav-callback-info*)
)
0
(nav-enemy-method-178 self)
(ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim))
:num! (seek! max f30-0)
:frame-num 0.0
)
(until (ja-done? 0)
(ja-blend-eval)
(suspend)
(ja :num! (seek! max f30-0))
)
(until (not (rnd-chance-for-idle? self 0.2))
(ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim))
:num! (seek! max f30-0)
:frame-num 0.0
)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! max f30-0))
)
)
(let ((v1-121 self))
(if (not (logtest? (enemy-flag ef37) (-> v1-121 enemy-flags)))
(set! (-> v1-121 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-121 enemy-flags))))
)
(set! (-> v1-121 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-121 enemy-flags))))
(set! (-> v1-121 nav callback-info) (-> v1-121 enemy-info callback-info))
)
0
(nav-enemy-method-176 self)
(ja-no-eval :num! (loop!))
(ja-channel-push! 1 (seconds 0.6))
(ja-no-eval :group! (-> self draw art-group data (-> self enemy-info walk-anim))
:num! (seek! max f30-0)
:frame-num 0.0
)
(until (ja-done? 0)
(ja-blend-eval)
(suspend)
(ja :num! (seek! max f30-0))
)
)
)
)
#f
)
)
;; failed to figure out what this is:
(defstate pacing (monster-frog)
:virtual #t
:code monster-frog-hop-slow-code
)
;; failed to figure out what this is:
(defstate circling (monster-frog)
:virtual #t
:code monster-frog-hop-slow-code
)
;; failed to figure out what this is:
(defstate stare (monster-frog)
:virtual #t
:enter (behavior ()
(let ((t9-0 (-> (method-of-type nav-enemy stare) enter)))
(if t9-0
(t9-0)
)
)
(let ((v1-4 self))
(set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag ef38))))
)
0
)
)
;; failed to figure out what this is:
(defstate hostile (monster-frog)
:virtual #t
:enter (behavior ()
(logclear! (-> self enemy-flags) (enemy-flag alert))
(let ((t9-0 (-> (method-of-type nav-enemy hostile) enter)))
(if t9-0
(t9-0)
)
)
(let ((v1-6 self))
(set! (-> v1-6 enemy-flags) (the-as enemy-flag (logclear (-> v1-6 enemy-flags) (enemy-flag ef38))))
)
0
)
:trans (behavior ()
(nav-enemy-method-171 self)
(if (and (logtest? (-> self enemy-flags) (enemy-flag victory)) (-> self enemy-info use-victory))
(go-virtual victory)
)
(when (time-elapsed? (-> self state-time) (-> self reaction-time))
(if (nav-enemy-method-174 self)
(go-stare2 self)
)
(let ((gp-0 (-> self focus aware)))
(cond
((>= 1 (the-as int gp-0))
(if (-> self enemy-info use-stop-chase)
(go-virtual stop-chase)
(go-virtual active)
)
)
((or (>= 2 (the-as int gp-0)) (not (get-focus! self)))
(go-stare self)
)
((= gp-0 (enemy-aware flee))
(go-flee self)
)
)
)
(when (and (-> self enemy-info use-frustration) (logtest? (enemy-flag ef40) (-> self enemy-flags)))
(if (-> self enemy-info use-stop-chase)
(go-virtual stop-chase)
(go-stare self)
)
)
)
)
:code (behavior ()
(until #f
(let ((a0-4 (as-type (handle->process (-> self focus handle)) process-focusable)))
(cond
(a0-4
(let* ((s5-0 (get-trans a0-4 0))
(a1-4 (vector-! (new 'stack-no-clear 'vector) s5-0 (-> self root trans)))
(f30-0 (vector-length a1-4))
(gp-1 (-> self enemy-info))
)
(let ((a1-5 (vector-normalize-copy! (new 'stack-no-clear 'vector) a1-4 1.0)))
(if (not (heading-matches-direction? self a1-5 6371.5557))
(go-virtual turn)
)
)
(if (< f30-0 32768.0)
(go-virtual attack s5-0)
)
(let* ((f28-0 (fmax 0.0 (fmin 1.0 (* 0.000034877234 (+ -32768.0 f30-0)))))
(f26-0 (lerp 0.5 1.0 f28-0))
(f30-1 (lerp 0.0 1.0 f28-0))
(f28-1 (lerp 1.4 1.0 f28-0))
)
(let ((v1-21 (-> self nav)))
(set! (-> v1-21 target-speed) (/ (* f26-0 (-> gp-1 run-travel-speed)) f28-1))
)
0
(let ((v1-23 (-> self nav)))
(set! (-> v1-23 acceleration) (-> gp-1 run-acceleration))
)
0
(let ((v1-25 (-> self nav)))
(set! (-> v1-25 turning-acceleration) (-> gp-1 run-turning-acceleration))
)
0
(ja-channel-push! 2 (seconds 0.01))
(ja-no-eval :group! monster-frog-hop-small-start-ja :num! (seek! max f28-1) :frame-num 0.0)
(ja-no-eval :chan 1
:group! monster-frog-hop-slow-start-ja
:num! (chan 0)
:frame-interp0 f30-1
:frame-interp1 f30-1
:frame-num 0.0
)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! max f28-1))
(ja :chan 1 :num! (chan 0) :frame-interp0 f30-1 :frame-interp1 f30-1)
)
(nav-enemy-method-178 self)
(ja-no-eval :group! monster-frog-hop-small-end-ja :num! (seek! max f28-1) :frame-num 0.0)
(ja-no-eval :chan 1
:group! monster-frog-hop-slow-end-ja
:num! (chan 0)
:frame-interp0 f30-1
:frame-interp1 f30-1
:frame-num 0.0
)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! max f28-1))
(ja :chan 1 :num! (chan 0) :frame-interp0 f30-1 :frame-interp1 f30-1)
)
)
)
)
(else
(suspend)
0
)
)
)
)
#f
)
)
;; failed to figure out what this is:
(defstate turn (monster-frog)
:virtual #t
:event enemy-event-handler
:code (behavior ()
(ja-channel-push! 1 (seconds 0.1))
(let ((v1-0 self))
(set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-0 enemy-flags))))
)
0
(ja-no-eval :group! monster-frog-rotate-left-start-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(let ((v1-26 self))
(set! (-> v1-26 enemy-flags) (the-as enemy-flag (logclear (-> v1-26 enemy-flags) (enemy-flag ef38))))
)
0
(ja-no-eval :group! monster-frog-rotate-left-end-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(go-state-for-focused self)
)
:post (behavior ()
(let ((a0-0 self))
(when (logtest? (enemy-flag ef38) (-> a0-0 enemy-flags))
(let ((a0-4 (handle->process (-> self focus handle))))
(if a0-4
(seek-to-point-toward-point!
(-> self root)
(get-trans (the-as process-focusable a0-4) 0)
81920.0
(seconds 0.02)
)
)
)
)
)
(nav-enemy-simple-post)
)
)
;; failed to figure out what this is:
(defstate attack (monster-frog)
:virtual #t
:event enemy-event-handler
:enter (behavior ((arg0 vector))
(set-time! (-> self state-time))
(let ((v1-2 self))
(if (not (logtest? (enemy-flag ef37) (-> v1-2 enemy-flags)))
(set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-2 enemy-flags))))
)
(set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-2 enemy-flags))))
(set! (-> v1-2 nav callback-info) (-> v1-2 enemy-info callback-info))
)
0
(let ((v1-5 self))
(set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag ef38))))
)
0
(logior! (-> self focus-status) (focus-status dangerous))
(let* ((v1-9 *game-info*)
(a1-15 (+ (-> v1-9 attack-id) 1))
)
(set! (-> v1-9 attack-id) a1-15)
(set! (-> self attack-id) a1-15)
)
(let* ((gp-0 (-> self root trans))
(s5-1 (vector-! (new 'stack-no-clear 'vector) arg0 gp-0))
)
(let ((f0-0 (vector-length s5-1)))
(vector-normalize! s5-1 (fmin f0-0 (-> self enemy-info run-travel-speed)))
)
(let ((a0-3 (-> self nav state))
(v1-17 (vector+! (new 'stack-no-clear 'vector) gp-0 s5-1))
)
(logclear! (-> a0-3 flags) (nav-state-flag directional-mode))
(logior! (-> a0-3 flags) (nav-state-flag target-poly-dirty))
(vector-copy! (-> a0-3 target-pos) v1-17)
)
)
0
)
:exit (behavior ()
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
)
:code (behavior ((arg0 vector))
(ja-channel-push! 1 (seconds 0.04))
(nav-enemy-method-177 self)
(ja-no-eval :group! monster-frog-attack0-start-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(nav-enemy-method-178 self)
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
(go-virtual attack-recover)
)
:post nav-enemy-travel-post
)
;; failed to figure out what this is:
(defstate attack-recover (monster-frog)
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(let ((v1-0 self))
(set! (-> v1-0 enemy-flags) (the-as enemy-flag (logclear (-> v1-0 enemy-flags) (enemy-flag ef37))))
(set! (-> v1-0 nav callback-info) *null-nav-callback-info*)
)
0
(let ((v1-3 self))
(set! (-> v1-3 enemy-flags) (the-as enemy-flag (logclear (-> v1-3 enemy-flags) (enemy-flag ef38))))
)
0
)
:code (behavior ()
(ja-no-eval :group! monster-frog-attack0-end-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(cond
((zero? (rnd-int self 4))
(let ((v1-28 (ja-group)))
(if (not (and v1-28 (= v1-28 monster-frog-idle0-ja)))
(ja-channel-push! 1 (seconds 0.1))
)
)
(ja-no-eval :group! monster-frog-idle0-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
)
(else
(let ((v1-59 (ja-group)))
(if (not (and v1-59 (= v1-59 monster-frog-idle1-ja)))
(ja-channel-push! 1 (seconds 0.1))
)
)
(ja-no-eval :group! monster-frog-idle1-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
)
)
(go-state-for-focused self)
)
:post nav-enemy-simple-post
)
;; definition for method 85 of type monster-frog
(defmethod knocked-anim ((this monster-frog) (arg0 enemy-knocked-info))
"start the knocked animation."
(case (-> this incoming knocked-type)
(((knocked-type yellow-shot))
(ja-channel-push! 1 0)
(let ((a0-3 (-> this skel root-channel 0)))
(set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 26)))
(set! (-> a0-3 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 26)) frames num-frames) -1))
)
(set! (-> a0-3 param 1) (-> arg0 anim-speed))
(set! (-> a0-3 frame-num) 0.0)
(joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 26)) num-func-seek!)
)
#t
)
(((knocked-type blue-shot))
(ja-channel-push! 1 0)
(let ((a0-6 (-> this skel root-channel 0)))
(set! (-> a0-6 frame-group) (the-as art-joint-anim (-> this draw art-group data 22)))
(set! (-> a0-6 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 22)) frames num-frames) -1))
)
(set! (-> a0-6 param 1) (-> arg0 anim-speed))
(set! (-> a0-6 frame-num) 0.0)
(joint-control-channel-group! a0-6 (the-as art-joint-anim (-> this draw art-group data 22)) num-func-seek!)
)
#t
)
(else
(cond
((= (-> this incoming knocked-type) (knocked-type none))
(ja-channel-push! 1 0)
(let ((a0-8 (-> this skel root-channel 0)))
(set! (-> a0-8 frame-group) (the-as art-joint-anim (-> this draw art-group data 30)))
(set! (-> a0-8 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 30)) frames num-frames) -1))
)
(set! (-> a0-8 param 1) (-> arg0 anim-speed))
(set! (-> a0-8 frame-num) 0.0)
(joint-control-channel-group! a0-8 (the-as art-joint-anim (-> this draw art-group data 30)) num-func-seek!)
)
)
(else
(ja-channel-push! 1 0)
(let ((a0-10 (-> this skel root-channel 0)))
(set! (-> a0-10 frame-group) (the-as art-joint-anim (-> this draw art-group data 32)))
(set! (-> a0-10 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 32)) frames num-frames) -1))
)
(set! (-> a0-10 param 1) (-> arg0 anim-speed))
(set! (-> a0-10 frame-num) 0.0)
(joint-control-channel-group! a0-10 (the-as art-joint-anim (-> this draw art-group data 32)) num-func-seek!)
)
)
)
#t
)
)
)
;; definition for method 86 of type monster-frog
(defmethod knocked-land-anim ((this monster-frog) (arg0 enemy-knocked-info))
"start the knocked-land animation."
(case (-> this incoming knocked-type)
(((knocked-type yellow-shot))
(ja-channel-push! 1 (seconds 0.17))
(let ((a0-3 (-> this skel root-channel 0)))
(set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 27)))
(set! (-> a0-3 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 27)) frames num-frames) -1))
)
(set! (-> a0-3 param 1) (-> arg0 anim-speed))
(set! (-> a0-3 frame-num) 0.0)
(joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 27)) num-func-seek!)
)
#t
)
(((knocked-type blue-shot))
(ja-channel-push! 1 (seconds 0.17))
(let ((a0-6 (-> this skel root-channel 0)))
(set! (-> a0-6 frame-group) (the-as art-joint-anim (-> this draw art-group data 23)))
(set! (-> a0-6 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 23)) frames num-frames) -1))
)
(set! (-> a0-6 param 1) (-> arg0 anim-speed))
(set! (-> a0-6 frame-num) 0.0)
(joint-control-channel-group! a0-6 (the-as art-joint-anim (-> this draw art-group data 23)) num-func-seek!)
)
#t
)
(else
(cond
((= (-> this incoming knocked-type) (knocked-type none))
(ja-channel-push! 1 0)
(let ((a0-8 (-> this skel root-channel 0)))
(set! (-> a0-8 frame-group) (the-as art-joint-anim (-> this draw art-group data 31)))
(set! (-> a0-8 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 31)) frames num-frames) -1))
)
(set! (-> a0-8 param 1) (-> arg0 anim-speed))
(set! (-> a0-8 frame-num) 0.0)
(joint-control-channel-group! a0-8 (the-as art-joint-anim (-> this draw art-group data 31)) num-func-seek!)
)
)
(else
(ja-channel-push! 1 0)
(let ((a0-10 (-> this skel root-channel 0)))
(set! (-> a0-10 frame-group) (the-as art-joint-anim (-> this draw art-group data 33)))
(set! (-> a0-10 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 33)) frames num-frames) -1))
)
(set! (-> a0-10 param 1) (-> arg0 anim-speed))
(set! (-> a0-10 frame-num) 0.0)
(joint-control-channel-group! a0-10 (the-as art-joint-anim (-> this draw art-group data 33)) num-func-seek!)
)
)
)
#t
)
)
)
;; definition for method 59 of type monster-frog
(defmethod enemy-common-post ((this monster-frog))
"Common implementation of post. Runs ja-post."
(water-control-method-10 (-> this water))
((method-of-type nav-enemy enemy-common-post) this)
(none)
)
;; definition for method 120 of type monster-frog
;; WARN: Return type mismatch int vs none.
(defmethod init-enemy-collision! ((this monster-frog))
"Typical place to construct collision shapes"
(let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player))))
(set! (-> s5-0 dynam) (copy *standard-dynamics* 'process))
(set! (-> s5-0 reaction) cshape-reaction-default)
(set! (-> s5-0 no-reaction)
(the-as (function collide-shape-moving collide-query vector vector object) nothing)
)
(set! (-> s5-0 penetrated-by) (penetrate
generic-attack
lunge
flop
punch
spin
roll
uppercut
bonk
tube
flut-attack
board
mech-punch
dark-punch
dark-smack
flut
)
)
(let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0)))
(set! (-> s5-0 total-prims) (the-as uint 3))
(set! (-> s4-0 prim-core collide-as) (collide-spec enemy))
(set! (-> s4-0 prim-core collide-with)
(collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list)
)
(set! (-> s4-0 prim-core action) (collide-action solid deadly no-standon))
(set-vector! (-> s4-0 local-sphere) 0.0 4096.0 0.0 8192.0)
(set! (-> s5-0 root-prim) s4-0)
)
(let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-13 prim-core collide-as) (collide-spec enemy))
(set! (-> v1-13 prim-core collide-with)
(collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list)
)
(set! (-> v1-13 prim-core action) (collide-action solid deadly no-standon))
(set-vector! (-> v1-13 local-sphere) 0.0 4096.0 1638.4 3276.8)
)
(let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-15 prim-core collide-as) (collide-spec enemy))
(set! (-> v1-15 prim-core collide-with) (collide-spec jak bot player-list))
(set! (-> v1-15 prim-core action) (collide-action deadly))
(set! (-> v1-15 transform-index) 5)
(set-vector! (-> v1-15 local-sphere) 0.0 0.0 2048.0 2662.4)
)
(set! (-> s5-0 nav-radius) 4915.2)
(let ((v1-17 (-> s5-0 root-prim)))
(set! (-> s5-0 backup-collide-as) (-> v1-17 prim-core collide-as))
(set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with))
)
(set! (-> s5-0 max-iteration-count) (the-as uint 3))
(set! (-> this root) s5-0)
)
0
(none)
)
;; definition for method 121 of type monster-frog
;; WARN: Return type mismatch int vs none.
(defmethod init-enemy! ((this monster-frog))
"Typical place for shared init code. Runs from entity or process style init."
(initialize-skeleton
this
(the-as skeleton-group (art-group-get-by-name *level* "skel-monster-frog" (the-as (pointer level) #f)))
(the-as pair 0)
)
(setup-enemy! this *monster-frog-nav-enemy-info*)
(set! (-> this water) (new 'process 'water-control this 5 0.0 8192.0 2048.0))
(set! (-> this water flags)
(water-flag active use-water-anim touch-water part-splash part-drip part-rings part-water find-water)
)
(set! (-> this water height) (res-lump-float (-> this entity) 'water-height))
(set! (-> this water ripple-size) 12288.0)
(set! (-> this water wake-size) 6144.0)
0
(none)
)