Files
jak-project/test/decompiler/reference/jak2/levels/castle/roboguard-level_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

1315 lines
54 KiB
Common Lisp
Vendored
Generated

;;-*-Lisp-*-
(in-package goal)
;; definition of type roboguard-level
(deftype roboguard-level (nav-enemy)
((unknown-n12kjh3n123 int32 5)
(flags uint16)
(roll-timer time-frame)
(roll-dir vector :inline)
(incoming-attack-id uint32)
(turning-acc float)
(speed float)
(roll-attack-count uint32)
(roll-sound sound-id)
)
(:state-methods
roboguard-level-state-178
roboguard-level-state-179
roll-enter
roll-hostile
roll-to-walk
idle-dizzy
explode
)
(:methods
(roboguard-level-method-185 (_type_ symbol) none)
(roboguard-level-method-186 (_type_) none)
(roboguard-level-method-187 (_type_) none)
(roboguard-level-method-188 (_type_) none)
)
)
;; definition for method 3 of type roboguard-level
(defmethod inspect ((this roboguard-level))
(when (not this)
(set! this this)
(goto cfg-4)
)
(let ((t9-0 (method-of-type nav-enemy inspect)))
(t9-0 this)
)
(format #t "~2Tmove-dest: #<vector @ #x~X>~%" (-> this move-dest))
(format #t "~2Tflags: ~D~%" (-> this flags))
(format #t "~2Troll-timer: ~D~%" (-> this roll-timer))
(format #t "~2Troll-dir: #<vector @ #x~X>~%" (-> this roll-dir))
(format #t "~2Tincoming-attack-id: ~D~%" (-> this incoming-attack-id))
(format #t "~2Tturning-acc: ~f~%" (-> this turning-acc))
(format #t "~2Tspeed: ~f~%" (-> this speed))
(format #t "~2Troll-attack-count: ~D~%" (-> this roll-attack-count))
(format #t "~2Troll-sound: ~D~%" (-> this roll-sound))
(label cfg-4)
this
)
;; failed to figure out what this is:
(defskelgroup skel-roboguard-level roboguard roboguard-lod0-jg roboguard-idle0-ja
((roboguard-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 3)
:shadow roboguard-shadow-mg
:origin-joint-index 3
)
;; failed to figure out what this is:
(defskelgroup skel-roboguard-level-explode roboguard roboguard-explode-lod0-jg roboguard-explode-idle-ja
((roboguard-explode-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 80)
)
;; definition for symbol *roboguard-level-exploder-params*, type joint-exploder-static-params
(define *roboguard-level-exploder-params*
(new 'static 'joint-exploder-static-params
:joints (new 'static 'boxed-array :type joint-exploder-static-joint-params
(new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index 15)
(new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index 11)
(new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index 14)
(new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index 10)
(new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index 9)
(new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index 13)
(new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index 24)
(new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index 27)
(new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index 18)
(new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index 21)
(new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index 12)
(new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index 8)
(new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index 6)
(new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index 17)
(new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index 4)
)
:collide-spec #x1
)
)
;; failed to figure out what this is:
(set! (-> *lightning-spec-id-table* 26) (new 'static 'lightning-spec
:name "lightning-roboguard-shock"
:flags (lightning-spec-flags lsf0)
:start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)
:end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)
:fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5)
:fade-start-factor 0.2
:texture (new 'static 'texture-id :index #x83 :page #xc)
:reduction 0.42
:num-points 6
:box-size 6144.0
:merge-factor 0.5
:merge-count 2
:radius 2048.0
:duration 30.0
:sound #f
)
)
;; definition for symbol *roboguard-level-nav-enemy-info*, type nav-enemy-info
(define *roboguard-level-nav-enemy-info* (new 'static 'nav-enemy-info
:use-die-falling #f
:use-victory #f
:use-jump-blocked #f
:debug-draw-neck #f
:jump-debug-draw #f
:move-to-ground #t
:hover-if-no-ground #f
:idle-anim-script #f
:idle-anim 5
:notice-anim 6
:hostile-anim 8
:hit-anim 5
:knocked-anim 21
:knocked-land-anim 22
:die-anim 12
:die-falling-anim 23
:victory-anim 5
:jump-wind-up-anim 5
:jump-in-air-anim 5
:jump-land-anim 5
:neck-joint 5
:look-at-joint 4
:bullseye-joint 4
:notice-distance (meters 50)
:notice-distance-delta (meters 20)
:proximity-notice-distance (meters 30)
:default-hit-points 8
:gnd-collide-with (collide-spec backgnd)
:overlaps-others-collide-with-filter (collide-spec jak bot enemy hit-by-others-list player-list)
:penetrate-knocked (penetrate
touch
generic-attack
lunge
flop
punch
spin
roll
uppercut
bonk
tube
vehicle
flut-attack
board
mech
mech-punch
mech-bonk
dark-skin
dark-punch
dark-bomb
dark-giant
shield
explode
jak-yellow-shot
jak-red-shot
jak-blue-shot
jak-dark-shot
enemy-yellow-shot
enemy-dark-shot
eco-yellow
eco-red
eco-blue
eco-green
knocked
penetrate-33
penetrate-34
penetrate-35
penetrate-36
penetrate-37
penetrate-38
penetrate-39
penetrate-40
penetrate-41
penetrate-42
penetrate-43
penetrate-44
penetrate-45
penetrate-46
penetrate-47
penetrate-48
penetrate-49
penetrate-50
penetrate-51
penetrate-52
penetrate-53
penetrate-54
penetrate-55
penetrate-56
penetrate-57
penetrate-58
penetrate-59
penetrate-60
penetrate-61
penetrate-62
penetrate-63
)
:movement-gravity (meters -100)
:friction 0.5
:attack-shove-back (meters 5)
:attack-shove-up (meters 3)
:attack-mode 'generic
:attack-damage 2
:recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher)
:jump-height-min (meters 0.5)
:jump-height-factor 0.1
:knocked-seek-ry-clamp 6371.5557
:knocked-soft-vxz-lo 20480.0
:knocked-soft-vxz-hi 28672.0
:knocked-soft-vy-lo 36864.0
:knocked-soft-vy-hi 45056.0
:knocked-medium-vxz-lo 147456.0
:knocked-medium-vxz-hi 196608.0
:knocked-medium-vy-lo 135168.0
:knocked-medium-vy-hi 151552.0
:knocked-hard-vxz-lo 49152.0
:knocked-hard-vxz-hi 57344.0
:knocked-hard-vy-lo 49152.0
:knocked-hard-vy-hi 57344.0
:knocked-huge-vxz-lo 164659.2
:knocked-huge-vxz-hi 249036.8
:knocked-huge-vy-lo 183500.8
:knocked-huge-vy-hi 217907.2
:knocked-yellow-vxz-lo 20480.0
:knocked-yellow-vxz-hi 28672.0
:knocked-yellow-vy-lo 36864.0
:knocked-yellow-vy-hi 4096.0
:knocked-red-vxz-lo 24576.0
:knocked-red-vxz-hi 196608.0
:knocked-red-vy-lo 94208.0
:knocked-red-vy-hi 151552.0
:knocked-blue-vxz-lo 16384.0
:knocked-blue-vxz-hi 20480.0
:knocked-blue-vy-lo 16384.0
:knocked-blue-vy-hi 32768.0
: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)
:callback-info #f
:use-momentum #f
:use-frustration #t
:use-stop-chase #f
:use-circling #f
:use-pacing #f
:walk-anim 7
:turn-anim 4
:run-anim 8
:taunt-anim -1
:run-travel-speed (meters 8)
:run-acceleration (meters 2)
:run-turning-acceleration (meters 30)
:walk-travel-speed (meters 3)
:walk-acceleration (meters 1)
:walk-turning-acceleration (meters 8)
:maximum-rotation-rate (degrees 720)
:notice-nav-radius (meters 10)
: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! (-> *roboguard-level-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*)
;; failed to figure out what this is:
(defpart 5116
:init-specs ((:texture (pal-lightning effects))
(:birth-func 'birth-func-set-quat)
(:num 1.0)
(:scale-x (meters 1))
(:scale-y (meters 40))
(:r 128.0 64.0)
(:g 128.0 64.0)
(:b 128.0 64.0)
(:a 128.0)
(:timer (seconds 0.017))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat))
)
)
;; failed to figure out what this is:
(defpart 5117
:init-specs ((:texture (glow-hotdot effects))
(:num 1.0)
(:scale-x (meters 1))
(:scale-y :copy scale-x)
(:r 128.0 64.0)
(:g 128.0 64.0)
(:b 128.0 64.0)
(:a 128.0)
(:rotvel-z (degrees 0.3))
(:fade-g -1.0666667)
(:fade-b -1.0666667)
(:fade-a -8.533334)
(:timer (seconds 0.017))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14))
)
)
;; failed to figure out what this is:
(defpart 5118
:init-specs ((:texture (glow-hotdot effects))
(:num 1.0)
(:scale-x (meters 1))
(:scale-y :copy scale-x)
(:r 128.0 64.0)
(:g 128.0 64.0)
(:b 128.0 64.0)
(:a 128.0)
(:rotvel-z (degrees 0.3))
(:fade-g -1.0666667)
(:fade-b -1.0666667)
(:fade-a -8.533334)
(:timer (seconds 0.017))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14))
)
)
;; definition for function roboguard-roll-travel-post
;; INFO: Used lq/sq
(defbehavior roboguard-roll-travel-post roboguard-level ()
(let ((a1-0 (new 'stack-no-clear 'collide-query))
(gp-0 (-> self root))
)
(if (find-ground gp-0 a1-0 (-> self enemy-info gnd-collide-with) 8192.0 81920.0 1024.0)
(set! (-> gp-0 trans y) (-> gp-0 gspot-pos y))
)
)
(let ((a0-1 (-> self nav state))
(v1-6 (-> self roll-dir))
)
(logior! (-> a0-1 flags) (nav-state-flag directional-mode))
(set! (-> a0-1 travel quad) (-> v1-6 quad))
)
0
(nav-enemy-travel-post)
(none)
)
;; failed to figure out what this is:
(defstate ambush (roboguard-level)
:virtual #t
:enter (behavior ()
(call-parent-state-handler enter)
(logand! (-> self flags) -9)
(logior! (-> self flags) 4)
(logior! (-> self nav flags) (nav-control-flag output-sphere-hash))
(let ((a1-1 (new 'stack-no-clear 'collide-query)))
(ground-pat-set! self a1-1 (collide-spec backgnd) 8192.0 81920.0 1024.0)
)
(let* ((v1-11 (-> self nav))
(a1-2 (-> self root gspot-pos))
(f0-0 (-> v1-11 extra-nav-sphere w))
)
(set! (-> v1-11 extra-nav-sphere quad) (-> a1-2 quad))
(set! (-> v1-11 extra-nav-sphere w) f0-0)
)
0
(let ((v1-14 (-> self nav)))
(set! (-> v1-14 extra-nav-sphere w) (-> self nav-radius-backup))
)
0
(let ((v1-16 (-> self nav)))
(logior! (-> v1-16 shape nav-flags) (nav-flags has-extra-sphere))
)
0
(enemy-method-129 self)
(let ((a0-11 (handle->process (-> self focus handle))))
(if a0-11
(point-toward-point! (-> self root) (get-trans (the-as process-focusable a0-11) 0))
)
)
)
:exit (behavior ()
(logclear! (-> self nav flags) (nav-control-flag output-sphere-hash))
(let ((v1-2 (-> self nav)))
(logclear! (-> v1-2 shape nav-flags) (nav-flags has-extra-sphere))
)
0
)
:code (behavior ()
(ja-no-eval :group! roboguard-idle-to-ball-ja :num! (identity 3.0))
(until (logtest? (-> self root status) (collide-status on-surface))
(nav-enemy-falling-post)
(suspend)
)
(sound-play "robo-bounce")
(go-virtual roll-hostile)
)
:post (behavior ()
(let ((a1-0 (new 'stack-no-clear 'vector)))
(set! (-> a1-0 quad) (-> self root gspot-pos quad))
(set! (-> a1-0 w) (-> self nav-radius-backup))
(if (not (add-root-sphere-to-hash! (-> self nav) a1-0 32))
(nav-enemy-falling-post)
)
)
)
)
;; failed to figure out what this is:
(defstate idle (roboguard-level)
:virtual #t
:enter (behavior ()
(call-parent-state-handler enter)
(roboguard-level-method-185 self (the-as symbol 0))
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.1))
(until #f
(ja-no-eval :group! roboguard-idle0-ja :num! (seek! 2.0 (rand-vu-float-range 0.1 0.15)) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! 2.0 (rand-vu-float-range 0.1 0.15)))
)
(ja-no-eval :group! roboguard-idle0-ja :num! (seek! 3.0 (rand-vu-float-range 0.1 0.15)) :frame-num 2.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! 3.0 (rand-vu-float-range 0.1 0.15)))
)
(ja-no-eval :group! roboguard-idle0-ja :num! (seek! 4.0 (rand-vu-float-range 0.1 0.15)) :frame-num 3.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! 4.0 (rand-vu-float-range 0.1 0.15)))
)
(ja-no-eval :group! roboguard-idle0-ja :num! (seek! 5.0 (rand-vu-float-range 0.1 0.15)) :frame-num 4.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! 5.0 (rand-vu-float-range 0.1 0.15)))
)
(ja-no-eval :group! roboguard-idle0-ja :num! (seek! 6.0 (rand-vu-float-range 0.1 0.15)) :frame-num 5.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! 6.0 (rand-vu-float-range 0.1 0.15)))
)
(ja-no-eval :group! roboguard-idle0-ja :num! (seek! 7.0 0.07) :frame-num 6.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! 7.0 0.07))
)
(ja-no-eval :group! roboguard-idle0-ja :num! (seek! 8.0 0.07) :frame-num 7.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! 8.0 0.07))
)
(ja-no-eval :group! roboguard-idle0-ja :num! (seek! 9.0 0.07) :frame-num 8.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! 9.0 0.07))
)
(ja-no-eval :group! roboguard-idle0-ja :num! (seek! 10.0 (rand-vu-float-range 0.02 0.05)) :frame-num 9.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! 10.0 (rand-vu-float-range 0.02 0.05)))
)
)
#f
)
:post (behavior ()
(if (and (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-control-status on-screen)))
(set-time! (-> self last-draw-time))
)
(enemy-method-129 self)
(ja-post)
)
)
;; failed to figure out what this is:
(defstate stare (roboguard-level)
:virtual #t
:enter (behavior ()
(call-parent-state-handler enter)
(roboguard-level-method-185 self (the-as symbol 0))
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.2))
(let ((f30-0 (rnd-float-range self 0.9 1.1)))
(until #f
(ja-no-eval :group! roboguard-idle0-ja :num! (seek! 10.0 (/ f30-0 10)) :frame-num 9.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! 10.0 (/ f30-0 10)))
)
)
)
#f
)
)
;; failed to figure out what this is:
(defstate roll-enter (roboguard-level)
:virtual #t
:enter (behavior ()
(logior! (-> self flags) 4)
(roboguard-level-method-185 self (the-as symbol 1))
(logand! (-> self flags) -9)
)
:code (behavior ()
(ja-no-eval :group! roboguard-idle-to-ball-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(go-virtual roll-hostile)
)
:post (behavior ()
(let ((a1-0 (new 'stack-no-clear 'collide-query))
(gp-0 (-> self root))
)
(if (find-ground gp-0 a1-0 (-> self enemy-info gnd-collide-with) 8192.0 81920.0 1024.0)
(set! (-> gp-0 trans y) (-> gp-0 gspot-pos y))
)
)
(nav-enemy-simple-post)
)
)
;; failed to figure out what this is:
(defstate roll-hostile (roboguard-level)
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(logior! (-> self enemy-flags) (enemy-flag cam-attack-mode))
(logior! (-> self flags) 4)
(logclear! (-> self enemy-flags) (enemy-flag chase-startup))
(logclear! (-> self mask) (process-mask actor-pause))
(when (logtest? (-> self enemy-flags) (enemy-flag enable-on-hostile))
(logclear! (-> self enemy-flags) (enemy-flag enable-on-hostile))
(let ((gp-0 (-> self on-hostile)))
(if gp-0
(script-eval gp-0 :vector (-> self root trans))
)
)
)
(set! (-> self speed) 81920.0)
(let ((v1-20 (-> self nav)))
(set! (-> v1-20 acceleration) 16384.0)
)
0
(set! (-> self turning-acc) 122880.0)
(let ((v1-23 self))
(if (not (logtest? (enemy-flag enemy-flag36) (-> v1-23 enemy-flags)))
(set! (-> v1-23 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-23 enemy-flags))))
)
(set! (-> v1-23 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag36) (-> v1-23 enemy-flags))))
(set! (-> v1-23 nav callback-info) (-> v1-23 enemy-info callback-info))
)
0
(let ((v1-26 self))
(set! (-> v1-26 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-26 enemy-flags))))
)
0
(logior! (-> self focus-status) (focus-status dangerous))
(set-time! (-> self state-time))
(roboguard-level-method-185 self (the-as symbol 1))
(vector-z-quaternion! (-> self roll-dir) (-> self root quat))
(set! (-> self roll-timer) 0)
(set! (-> self roll-attack-count) (the-as uint 0))
0
)
:exit (behavior ()
(sound-stop (-> self roll-sound))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
)
:trans (behavior ()
(let ((a0-0 (static-sound-spec "robo-roll")))
(sound-play-by-spec a0-0 (-> self roll-sound) (-> self root trans))
)
(cond
((logtest? (-> self flags) 64)
(if (not (logtest? (-> self flags) 32))
(sound-play "robo-ball-hit")
)
(logior! (-> self flags) 32)
)
(else
(logand! (-> self flags) -33)
)
)
(logand! (-> self flags) -65)
(seek! (-> self speed) 81920.0 (* 1228800.0 (seconds-per-frame)))
(seek! (-> self turning-acc) 4096.0 (* 1228800.0 (seconds-per-frame)))
(let ((v1-20 (-> self nav)))
(set! (-> v1-20 target-speed) (-> self speed))
)
0
(let ((v1-22 (-> self nav)))
(set! (-> v1-22 turning-acceleration) (-> self turning-acc))
)
0
(nav-enemy-method-160 self)
(when (< (-> self roll-timer) (current-time))
(set! (-> self roll-timer) (+ (current-time) (the int (* 300.0 (rnd-float-range self 3.0 5.0)))))
(let ((gp-2 (handle->process (-> self focus handle))))
(when (and gp-2
(and gp-2
(not (logtest? (-> (the-as process-focusable gp-2) focus-status) (focus-status disable dead ignore grabbed)))
)
(< 2 (the-as int (-> self focus aware)))
)
(let ((s5-2
(vector-! (new 'stack-no-clear 'vector) (get-trans (the-as process-focusable gp-2) 0) (-> self root trans))
)
(s4-0 (new 'stack-no-clear 'vector))
)
(set! (-> s5-2 y) 0.0)
(vector-xz-normalize! s5-2 (if (logtest? (-> self pid) 1)
10240.0
-10240.0
)
)
(vector-rotate-around-y! s5-2 s5-2 16384.0)
(vector+! s4-0 (get-trans (the-as process-focusable gp-2) 0) s5-2)
(vector-! (-> self roll-dir) s4-0 (-> self root trans))
)
(set! (-> self roll-dir y) 0.0)
(vector-normalize! (-> self roll-dir) 1.0)
)
)
)
(let ((gp-3 (new 'stack-no-clear 'vector)))
(vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))
(new 'stack-no-clear 'vector)
(set! (-> gp-3 quad) (-> self roll-dir quad))
(let ((s3-2 (new 'stack-no-clear 'vector))
(s4-1 (new 'stack-no-clear 'vector))
(s5-3 (new 'stack 'clamp-travel-vector-to-mesh-return-info))
)
(let ((s2-0 (-> self nav state current-poly)))
(vector-xz-normalize-copy! s3-2 gp-3 20480.0)
(set! (-> s4-1 quad) (-> s3-2 quad))
(clamp-vector-to-mesh-no-gaps (-> self nav) (-> self root trans) s2-0 s4-1 s5-3)
)
(when (-> s5-3 found-boundary)
(let ((f30-1 (vector-length gp-3)))
(vector-flatten! gp-3 gp-3 (-> s5-3 boundary-normal))
(vector-rotate-around-y! gp-3 (-> s5-3 boundary-normal) (if (logtest? (-> self pid) 1)
17294.223
-17294.223
)
)
(vector-normalize! gp-3 f30-1)
)
)
)
(set! (-> self roll-dir quad) (-> gp-3 quad))
)
(if (>= (-> self roll-attack-count) (the-as uint 3))
(go-virtual roll-to-walk)
)
)
:code (behavior ()
(ja :group! roboguard-ball-ja)
(until #f
(let ((a0-3 (-> self skel root-channel 0)))
(let ((f0-0 0.000024414063)
(a2-0 (-> self nav state))
(v1-7 (new 'stack-no-clear 'vector))
)
(set! (-> v1-7 quad) (-> a2-0 velocity quad))
(set! (-> a0-3 param 0) (* f0-0 (sqrtf (+ (* (-> v1-7 x) (-> v1-7 x)) (* (-> v1-7 z) (-> v1-7 z))))))
)
(joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-loop!)
)
(suspend)
)
#f
)
:post roboguard-roll-travel-post
)
;; failed to figure out what this is:
(defstate roll-to-walk (roboguard-level)
:virtual #t
:event enemy-event-handler
:enter (behavior ()
'()
)
:code (behavior ()
(ja-no-eval :group! roboguard-ball-to-dizzy-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(when (< 17.0 (ja-aframe-num 0))
(logand! (-> self flags) -5)
(roboguard-level-method-185 self (the-as symbol 0))
)
(suspend)
(ja :num! (seek!))
)
(go-virtual idle-dizzy)
)
:post (behavior ()
(let ((a1-0 (new 'stack-no-clear 'collide-query))
(gp-0 (-> self root))
)
(if (find-ground gp-0 a1-0 (-> self enemy-info gnd-collide-with) 8192.0 81920.0 1024.0)
(set! (-> gp-0 trans y) (-> gp-0 gspot-pos y))
)
)
(nav-enemy-face-focus-post)
)
)
;; failed to figure out what this is:
(defstate idle-dizzy (roboguard-level)
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(logand! (-> self flags) -5)
(roboguard-level-method-185 self (the-as symbol 0))
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.1))
(ja-no-eval :group! roboguard-dizzy-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(go-virtual roll-enter)
)
:post (behavior ()
(nav-enemy-simple-post)
)
)
;; definition for method 70 of type roboguard-level
(defmethod go-hostile ((this roboguard-level))
(go (method-of-object this roll-enter))
)
;; failed to figure out what this is:
(defstate die (roboguard-level)
:virtual #t
:enter (behavior ()
(call-parent-state-handler enter)
(roboguard-level-method-185 self (the-as symbol 0))
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.075))
(ja-no-eval :group! roboguard-death-standing-ja
:num! (seek! (ja-aframe 20.0 0))
:frame-num (ja-aframe 13.0 0)
)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! (ja-aframe 20.0 0)))
)
(ja-no-eval :group! roboguard-death-standing-ja
:num! (seek! (ja-aframe 25.0 0) 0.5)
:frame-num (ja-aframe 20.0 0)
)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! (ja-aframe 25.0 0) 0.5))
)
(ja-no-eval :group! roboguard-death-standing-ja
:num! (seek! (ja-aframe 26.0 0))
:frame-num (ja-aframe 25.0 0)
)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! (ja-aframe 26.0 0)))
)
(let ((gp-6 (new 'stack 'joint-exploder-tuning (the-as uint 0))))
(set-vector! (-> gp-6 fountain-rand-transv-lo) -163840.0 0.0 -163840.0 1.0)
(set-vector! (-> gp-6 fountain-rand-transv-hi) 163840.0 409.6 163840.0 1.0)
(set! (-> gp-6 gravity) -40960.0)
(process-spawn
joint-exploder
(art-group-get-by-name *level* "skel-roboguard-level-explode" (the-as (pointer uint32) #f))
31
gp-6
*roboguard-level-exploder-params*
:to self
)
)
(go-virtual explode)
)
)
;; failed to figure out what this is:
(defstate explode (roboguard-level)
:virtual #t
:enter #f
:exit #f
:trans #f
:code (behavior ()
(sound-play "robo-explode")
(let ((v1-2 (-> self root root-prim)))
(set! (-> v1-2 prim-core collide-as) (collide-spec))
(set! (-> v1-2 prim-core collide-with) (collide-spec))
)
0
(logior! (-> self draw status) (draw-control-status no-draw))
(while (-> self child)
(suspend)
)
(cleanup-for-death self)
)
:post #f
)
;; definition for method 185 of type roboguard-level
;; WARN: Return type mismatch int vs none.
(defmethod roboguard-level-method-185 ((this roboguard-level) (arg0 symbol))
(let ((v1-1 (-> this root root-prim))
(a0-1 arg0)
)
(cond
((zero? a0-1)
(set! (-> (the-as collide-shape-prim-group v1-1) child 0 prim-core collide-as) (collide-spec enemy))
(set! (-> (the-as collide-shape-prim-group v1-1) child 0 prim-core collide-with)
(collide-spec backgnd jak bot player-list)
)
(set! (-> (the-as collide-shape-prim-group v1-1) child 1 prim-core collide-as) (collide-spec enemy))
(set! (-> (the-as collide-shape-prim-group v1-1) child 1 prim-core collide-with)
(collide-spec backgnd jak bot player-list)
)
(set! (-> (the-as collide-shape-prim-group v1-1) child 2 prim-core collide-as) (collide-spec))
(set! (-> (the-as collide-shape-prim-group v1-1) child 2 prim-core collide-with) (collide-spec))
(set! (-> (the-as collide-shape-prim-group v1-1) child 3 prim-core collide-as) (collide-spec))
(set! (-> (the-as collide-shape-prim-group v1-1) child 3 prim-core collide-with) (collide-spec))
(set! (-> (the-as collide-shape-prim-group v1-1) child 4 prim-core collide-as) (collide-spec))
(set! (-> (the-as collide-shape-prim-group v1-1) child 4 prim-core collide-with) (collide-spec))
(set-vector! (-> v1-1 local-sphere) 0.0 8192.0 0.0 12288.0)
)
((= a0-1 1)
(set! (-> (the-as collide-shape-prim-group v1-1) child 0 prim-core collide-as) (collide-spec))
(set! (-> (the-as collide-shape-prim-group v1-1) child 0 prim-core collide-with) (collide-spec))
(set! (-> (the-as collide-shape-prim-group v1-1) child 1 prim-core collide-as) (collide-spec))
(set! (-> (the-as collide-shape-prim-group v1-1) child 1 prim-core collide-with) (collide-spec))
(set! (-> (the-as collide-shape-prim-group v1-1) child 2 prim-core collide-as) (collide-spec enemy))
(set! (-> (the-as collide-shape-prim-group v1-1) child 2 prim-core collide-with)
(collide-spec jak bot enemy player-list)
)
(set! (-> (the-as collide-shape-prim-group v1-1) child 3 prim-core collide-as) (collide-spec))
(set! (-> (the-as collide-shape-prim-group v1-1) child 3 prim-core collide-with) (collide-spec))
(set! (-> (the-as collide-shape-prim-group v1-1) child 4 prim-core collide-as) (collide-spec enemy))
(set! (-> (the-as collide-shape-prim-group v1-1) child 4 prim-core collide-with)
(collide-spec jak bot player-list)
)
(set-vector! (-> v1-1 local-sphere) 0.0 5734.4 0.0 7372.8)
)
((= a0-1 2)
(set! (-> (the-as collide-shape-prim-group v1-1) child 0 prim-core collide-as) (collide-spec enemy))
(set! (-> (the-as collide-shape-prim-group v1-1) child 0 prim-core collide-with)
(collide-spec backgnd jak bot player-list)
)
(set! (-> (the-as collide-shape-prim-group v1-1) child 1 prim-core collide-as) (collide-spec enemy))
(set! (-> (the-as collide-shape-prim-group v1-1) child 1 prim-core collide-with)
(collide-spec backgnd jak bot player-list)
)
(set! (-> (the-as collide-shape-prim-group v1-1) child 2 prim-core collide-as) (collide-spec enemy))
(set! (-> (the-as collide-shape-prim-group v1-1) child 2 prim-core collide-with)
(collide-spec jak bot player-list)
)
(set! (-> (the-as collide-shape-prim-group v1-1) child 3 prim-core collide-as) (collide-spec enemy))
(set! (-> (the-as collide-shape-prim-group v1-1) child 3 prim-core collide-with)
(collide-spec jak bot player-list)
)
(set! (-> (the-as collide-shape-prim-group v1-1) child 4 prim-core collide-as) (collide-spec))
(set! (-> (the-as collide-shape-prim-group v1-1) child 4 prim-core collide-with) (collide-spec))
(set-vector! (-> v1-1 local-sphere) 0.0 8192.0 0.0 24576.0)
)
)
)
0
(none)
)
;; definition for method 77 of type roboguard-level
(defmethod enemy-method-77 ((this roboguard-level) (arg0 enemy-knocked-info))
(ja-channel-push! 1 0)
(case (-> this incoming knocked-type)
(((knocked-type knocked-type-0)
(knocked-type knocked-type-1)
(knocked-type knocked-type-4)
(knocked-type knocked-type-6)
)
(let ((a0-5 (-> this skel root-channel 0)))
(set! (-> a0-5 frame-group) (the-as art-joint-anim (-> this draw art-group data 21)))
(set! (-> a0-5 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 21)) frames num-frames) -1))
)
(set! (-> a0-5 param 1) (-> arg0 anim-speed))
(set! (-> a0-5 frame-num) 0.0)
(joint-control-channel-group! a0-5 (the-as art-joint-anim (-> this draw art-group data 21)) num-func-seek!)
)
)
(else
(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
)
;; definition for method 78 of type roboguard-level
(defmethod enemy-method-78 ((this roboguard-level) (arg0 enemy-knocked-info))
(case (-> this incoming knocked-type)
(((knocked-type knocked-type-0)
(knocked-type knocked-type-1)
(knocked-type knocked-type-4)
(knocked-type knocked-type-6)
)
(let ((v1-4 (-> this skel root-channel 0)))
(set! (-> v1-4 frame-group) (the-as art-joint-anim (-> this draw art-group data 22)))
(set! (-> v1-4 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 22)) frames num-frames) -1))
)
(set! (-> v1-4 param 1) (-> arg0 anim-speed))
(set! (-> v1-4 frame-num) 0.0)
(joint-control-channel-group! v1-4 (the-as art-joint-anim (-> this draw art-group data 22)) num-func-seek!)
)
)
(else
(let ((v1-8 (-> this skel root-channel 0)))
(set! (-> v1-8 frame-group) (the-as art-joint-anim (-> this draw art-group data 24)))
(set! (-> v1-8 param 0)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 24)) frames num-frames) -1))
)
(set! (-> v1-8 param 1) (-> arg0 anim-speed))
(set! (-> v1-8 frame-num) 0.0)
(joint-control-channel-group! v1-8 (the-as art-joint-anim (-> this draw art-group data 24)) num-func-seek!)
)
)
)
#t
)
;; definition for method 74 of type roboguard-level
;; INFO: Used lq/sq
(defmethod general-event-handler ((this roboguard-level) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
"Handles various events for the enemy
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
(case arg2
(('attack)
(cond
((logtest? (-> this flags) 4)
(let ((v1-3 (the-as object (-> arg3 param 1)))
(a0-2 arg0)
)
(cond
((!= (-> (the-as attack-info v1-3) id) (-> this incoming-attack-id))
(set! (-> this incoming-attack-id) (-> (the-as attack-info v1-3) id))
(when (and a0-2 (not (logtest? (process-mask enemy) (-> a0-2 mask))))
(let ((s5-0 (find-offending-process-focusable a0-2 (the-as attack-info v1-3))))
(when s5-0
(new 'stack-no-clear 'vector)
(set! (-> (new 'stack-no-clear 'vector) quad) (-> s5-0 root trans quad))
(if (< (-> this roll-attack-count) (the-as uint 3))
(+! (-> this roll-attack-count) 1)
)
(vector-! (-> this roll-dir) (-> this root trans) (-> s5-0 root trans))
(set! (-> this roll-dir y) 0.0)
(vector-xz-normalize! (-> this roll-dir) 1.0)
(set! (-> this speed) (+ 245760.0 (vector-length (-> s5-0 root transv))))
(let ((a0-9 (-> this nav state))
(v1-19 (vector-float*! (new 'stack-no-clear 'vector) (-> this roll-dir) (-> this speed)))
)
(set! (-> a0-9 velocity quad) (-> v1-19 quad))
)
0
(let ((v1-23 (-> this nav state)))
(set! (-> v1-23 speed) (-> this speed))
)
0
(let ((v1-25 (-> this nav)))
(set! (-> v1-25 target-speed) (-> this speed))
)
0
(sound-play "robo-ball-kick")
)
)
)
#t
)
(else
#f
)
)
)
)
(else
((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3)
)
)
)
(('hit 'hit-knocked 'hit-flinch)
(when (not (logtest? (-> this flags) 4))
(let ((s5-2 (new 'stack 'joint-exploder-tuning (the-as uint 1))))
(set! (-> s5-2 fountain-rand-transv-lo quad) (-> this incoming attacker-pos quad))
(set! (-> s5-2 fountain-rand-transv-hi x) 4096.0)
(set! (-> s5-2 fountain-rand-transv-hi y) 122880.0)
(process-spawn
joint-exploder
(art-group-get-by-name *level* "skel-roboguard-level-explode" (the-as (pointer uint32) #f))
31
s5-2
*roboguard-level-exploder-params*
:to this
)
)
(dying this)
(go (method-of-object this explode))
)
)
(else
((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3)
)
)
)
;; definition for method 76 of type roboguard-level
;; INFO: Used lq/sq
;; WARN: Return type mismatch object vs symbol.
(defmethod enemy-method-76 ((this roboguard-level) (arg0 process) (arg1 event-message-block))
(rlet ((acc :class vf)
(vf0 :class vf)
(vf4 :class vf)
(vf5 :class vf)
(vf6 :class vf)
(vf7 :class vf)
)
(init-vf0-vector)
(the-as
symbol
(cond
((or (= (-> arg0 type) target) (not (logtest? (-> this flags) 4)))
((method-of-type nav-enemy enemy-method-76) this arg0 arg1)
)
(else
(when (!= (-> arg0 type) target)
(-> arg1 param 0)
(let ((s1-0 (the-as process (as-type arg0 process-focusable))))
(when (and s1-0 (logtest? (process-mask enemy) (-> s1-0 mask)))
(let ((s2-1
(vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> (the-as process-drawable s1-0) root trans))
)
)
(new 'stack-no-clear 'vector)
0.0
(let ((s3-1 (new 'stack-no-clear 'vector)))
(vector-normalize! s2-1 1.0)
(let ((f0-3
(- (vector-dot (-> this root transv) s2-1) (vector-dot (-> (the-as process-drawable s1-0) root transv) s2-1))
)
)
(let ((a1-5 (-> this nav state)))
(set! (-> s3-1 quad) (-> a1-5 velocity quad))
)
(let ((a0-16 s3-1))
(let ((v1-20 s3-1))
(let ((a1-9 (* -1.0 f0-3)))
(.mov vf7 a1-9)
)
(.lvf vf5 (&-> s2-1 quad))
(.lvf vf4 (&-> v1-20 quad))
)
(.add.x.vf.w vf6 vf0 vf0)
(.mul.x.vf.xyz acc vf5 vf7)
(.add.mul.w.vf.xyz vf6 vf4 vf0 acc)
(.svf (&-> a0-16 quad) vf6)
)
)
(let ((a0-17 (-> this nav state))
(v1-22 s3-1)
)
(set! (-> a0-17 velocity quad) (-> v1-22 quad))
)
0
(set! (-> this speed) (vector-length s3-1))
(let ((v1-28 (-> this nav state)))
(set! (-> v1-28 speed) (-> this speed))
)
0
(let ((v1-30 (-> this nav)))
(set! (-> v1-30 target-speed) (-> this speed))
)
0
(set! (-> this roll-timer) (+ (current-time) (the int (* 300.0 (rnd-float-range this 3.0 5.0)))))
(set! (-> this roll-dir quad) (-> s3-1 quad))
)
)
(set! (-> this roll-dir y) 0.0)
(vector-xz-normalize! (-> this roll-dir) 1.0)
(let ((a0-22 (-> this nav state))
(v1-40 (-> this roll-dir))
)
(set! (-> a0-22 heading quad) (-> v1-40 quad))
)
0
(logior! (-> this flags) 64)
)
)
(send-event arg0 'touch (-> arg1 param 0))
)
)
)
)
)
)
;; definition for method 142 of type roboguard-level
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod nav-enemy-method-142 ((this roboguard-level) (arg0 nav-control))
(let ((s3-0 (new 'stack-no-clear 'vector)))
(let ((a1-1 (-> arg0 state)))
(set! (-> s3-0 quad) (-> a1-1 heading quad))
)
(set! (-> s3-0 y) 0.0)
(vector-normalize! s3-0 1.0)
(let ((gp-0 (new 'stack-no-clear 'quaternion))
(s5-1 (-> this root quat))
)
(quaternion-set! gp-0 0.0 (-> s3-0 x) 0.0 (+ 1.0 (-> s3-0 z)))
(quaternion-normalize! gp-0)
(quaternion-pseudo-seek
s5-1
s5-1
gp-0
(* (fmax 0.5 (/ (-> arg0 state speed) METER_LENGTH)) (seconds-per-frame))
)
)
)
0
(none)
)
;; definition for method 176 of type roboguard-level
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod nav-enemy-method-176 ((this roboguard-level))
(nav-enemy-method-177 this)
(let ((a0-2 this))
(when (logtest? (enemy-flag enemy-flag36) (-> a0-2 enemy-flags))
(cond
((logtest? (enemy-flag enemy-flag38) (-> this enemy-flags))
(set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag enemy-flag38))))
(set! (-> this root gspot-pos quad) (-> this root trans quad))
)
(else
(nav-enemy-method-142 this (-> this nav))
(nav-enemy-method-143 this (-> this nav))
)
)
)
)
(common-post this)
(update-transforms (-> this root))
0
(none)
)
;; definition for method 132 of type roboguard-level
(defmethod dying ((this roboguard-level))
"Cleans-up the enemy and any associated resources. Potentially spawns skull gems"
(when (not (logtest? (enemy-flag called-dying) (-> this enemy-flags)))
(send-event (ppointer->process (-> this parent)) 'roboguard-die)
((method-of-type nav-enemy dying) this)
)
(none)
)
;; definition for method 10 of type roboguard-level
(defmethod deactivate ((this roboguard-level))
"Make a process dead, clean it up, remove it from the active pool, and return to dead pool."
(sound-stop (-> this roll-sound))
(call-parent-method this)
(none)
)
;; definition for method 7 of type roboguard-level
(defmethod relocate ((this roboguard-level) (offset int))
(call-parent-method this offset)
)
;; definition for method 114 of type roboguard-level
;; WARN: Return type mismatch int vs none.
(defmethod init-enemy-collision! ((this roboguard-level))
"Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly"
(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))
(let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 5) 0)))
(set! (-> s5-0 total-prims) (the-as uint 6))
(set! (-> s4-0 prim-core collide-as) (collide-spec enemy))
(set! (-> s4-0 prim-core collide-with) (collide-spec backgnd jak bot enemy 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 8192.0 0.0 20480.0)
(set! (-> s5-0 root-prim) s4-0)
)
(let ((v1-12 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-12 prim-core collide-as) (collide-spec enemy))
(set! (-> v1-12 prim-core collide-with) (collide-spec backgnd jak bot player-list))
(set! (-> v1-12 prim-core action) (collide-action solid deadly))
(set-vector! (-> v1-12 local-sphere) 0.0 6144.0 0.0 6144.0)
)
(let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-14 prim-core collide-as) (collide-spec enemy))
(set! (-> v1-14 prim-core collide-with) (collide-spec backgnd jak bot player-list))
(set! (-> v1-14 prim-core action) (collide-action solid deadly no-standon))
(set-vector! (-> v1-14 local-sphere) 0.0 9830.4 0.0 6144.0)
)
(let ((v1-16 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-16 prim-core collide-as) (collide-spec enemy))
(set! (-> v1-16 prim-core collide-with) (collide-spec backgnd enemy hit-by-others-list))
(set! (-> v1-16 prim-core action) (collide-action solid no-standon))
(set-vector! (-> v1-16 local-sphere) 0.0 5734.4 0.0 5734.4)
)
(let ((v1-18 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-18 prim-core action) (collide-action))
(set! (-> v1-18 transform-index) 11)
(set-vector! (-> v1-18 local-sphere) 0.0 0.0 0.0 4096.0)
)
(let ((v1-20 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-20 prim-core collide-as) (collide-spec enemy))
(set! (-> v1-20 prim-core collide-with) (collide-spec jak bot player-list))
(set! (-> v1-20 prim-core action) (collide-action deadly))
(set-vector! (-> v1-20 local-sphere) 0.0 5734.4 0.0 7372.8)
)
(set! (-> s5-0 nav-radius) 8192.0)
(let ((v1-22 (-> s5-0 root-prim)))
(set! (-> s5-0 backup-collide-as) (-> v1-22 prim-core collide-as))
(set! (-> s5-0 backup-collide-with) (-> v1-22 prim-core collide-with))
)
(set! (-> s5-0 max-iteration-count) (the-as uint 3))
(set! (-> this root) s5-0)
)
0
(none)
)
;; definition for method 115 of type roboguard-level
;; WARN: Return type mismatch int vs none.
(defmethod init-enemy! ((this roboguard-level))
"Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods"
(initialize-skeleton
this
(the-as skeleton-group (art-group-get-by-name *level* "skel-roboguard-level" (the-as (pointer uint32) #f)))
(the-as pair 0)
)
(set! (-> this enemy-flags)
(the-as enemy-flag (logior (enemy-flag no-initial-move-to-ground) (-> this enemy-flags)))
)
(init-enemy-behaviour-and-stats! this *roboguard-level-nav-enemy-info*)
(let ((v1-8 (-> this nav)))
(set! (-> v1-8 nav-cull-radius) 81920.0)
)
0
(set! (-> this fact cam-horz) 98304.0)
(set! (-> this fact cam-vert) 24576.0)
(set! (-> this fact cam-notice-dist) 122880.0)
(let ((v1-16 (-> this nav)))
(logclear! (-> v1-16 flags) (nav-control-flag limit-rotation-rate output-sphere-hash))
(logclear! (-> this nav flags) (nav-control-flag update-heading-from-facing))
(set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag enemy-flag43))))
(let ((a0-13 v1-16))
(set! (-> a0-13 sphere-mask) (the-as uint #x800fe))
)
0
(let ((a0-15 v1-16))
(set! (-> a0-15 nav-cull-radius) 12288.0)
)
0
(logclear! (-> v1-16 flags) (nav-control-flag output-sphere-hash))
)
(set! (-> this enemy-info callback-info) *nav-enemy-physics-callback-info*)
(let ((v1-18 this))
(if (not (logtest? (enemy-flag enemy-flag36) (-> v1-18 enemy-flags)))
(set! (-> v1-18 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-18 enemy-flags))))
)
(set! (-> v1-18 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag36) (-> v1-18 enemy-flags))))
(set! (-> v1-18 nav callback-info) (-> v1-18 enemy-info callback-info))
)
0
(set! (-> this roll-sound) (new-sound-id))
(set! (-> this flags) (the-as uint 0))
0
(none)
)