Files
jak-project/test/decompiler/reference/jak2/levels/atoll/juicer_REF.gc
T
Hat Kid 6a06291e6e jak1, jak2: add get-texture macro (#3778)
Ports the `get-texture` macro added in Jak 3 to Jak 1 and 2.
2024-11-26 11:29:34 +01:00

1934 lines
66 KiB
Common Lisp
Vendored
Generated

;;-*-Lisp-*-
(in-package goal)
;; failed to figure out what this is:
(defpartgroup group-juicer-shot-hit
:id 1061
:duration (seconds 0.017)
:flags (use-local-clock)
:bounds (static-bspherem 0 0 0 8)
:parts ((sp-item 4633))
)
;; failed to figure out what this is:
(defpart 4633
:init-specs ((:texture (bigpuff effects))
(:num 1.0)
(:scale-x (meters 1) (meters 1))
(:rot-z (degrees 0) (degrees 360))
(:scale-y :copy scale-x)
(:r 96.0 64.0)
(:g 64.0 32.0)
(:b 96.0 64.0)
(:a 64.0)
(:rotvel-z (degrees -0.2) (degrees 0.4))
(:fade-r -0.35555556)
(:fade-g -0.35555556)
(:fade-b 0.0)
(:fade-a -0.30476192)
(:accel-y (meters -0.00016666666) (meters 0.00016666666))
(:timer (seconds 0.7))
(:flags (sp-cpuinfo-flag-2))
(:next-time (seconds 0.2))
(:next-launcher 4634)
(:rotate-y (degrees 0) (degrees 180))
)
)
;; failed to figure out what this is:
(defpart 4635
:init-specs ((:texture (glow-soft effects))
(:num 1.0)
(:scale-x (meters 3.5))
(:rot-x (degrees 2.25))
(:scale-y :copy scale-x)
(:r 255.0)
(:g 0.0)
(:b 0.0)
(:a 16.0)
(:timer (seconds 0.017))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow))
(:userdata 819.2)
)
)
;; failed to figure out what this is:
(defpart 4636
:init-specs ((:texture (glow-soft effects))
(:num 1.0)
(:scale-x (meters 1.5) (meters 1))
(:rot-x (degrees 2.25))
(:rot-z (degrees 0) (degrees 360))
(:scale-y :copy scale-x)
(:r 255.0)
(:g 0.0)
(:b 0.0)
(:a 48.0 16.0)
(:timer (seconds 0.017))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow))
(:userdata 819.2)
)
)
;; failed to figure out what this is:
(defpart 4637
:init-specs ((:texture (glow effects))
(:num 1.0)
(:scale-x (meters 1.5) (meters 0.5))
(:rot-x (degrees 2.25))
(:rot-z (degrees 0) (degrees 16))
(:scale-y :copy scale-x)
(:r 255.0)
(:g 0.0)
(:b 0.0)
(:a 16.0 16.0)
(:timer (seconds 0.017))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow))
(:userdata 819.2)
)
)
;; failed to figure out what this is:
(defpart 4638
:init-specs ((:texture (glow effects))
(:num 1.0)
(:scale-x (meters 0.5) (meters 0.2))
(:rot-x (degrees 2.25))
(:scale-y :copy scale-x)
(:r 255.0)
(:g 196.0 128.0)
(:b 64.0 64.0)
(:a 32.0 16.0)
(:timer (seconds 0.017))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow))
(:userdata 819.2)
)
)
;; definition of type juicer-shot
(deftype juicer-shot (projectile)
((lightning lightning-control 5)
(victim handle)
)
)
;; definition for method 3 of type juicer-shot
(defmethod inspect ((this juicer-shot))
(when (not this)
(set! this this)
(goto cfg-4)
)
(let ((t9-0 (method-of-type projectile inspect)))
(t9-0 this)
)
(format #t "~2Tlightning[5] @ #x~X~%" (-> this lightning))
(format #t "~2Tvictim: ~D~%" (-> this victim))
(label cfg-4)
this
)
;; definition for method 35 of type juicer-shot
;; INFO: Used lq/sq
(defmethod event-handler! ((this juicer-shot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
"Multiplex the projectile's event processing, called by [[projectile-event-handler]]"
(case arg2
(('reset)
(let ((v1-1 (the-as object (-> arg3 param 0))))
(set! (-> this root trans quad) (-> (the-as matrix v1-1) trans quad))
(set! (-> this starting-pos quad) (-> (the-as matrix v1-1) trans quad))
(set! (-> this root transv quad) (-> (&+ (the-as matrix v1-1) 64) quad 0))
(set! (-> this pre-move-transv quad) (-> (&+ (the-as matrix v1-1) 64) quad 0))
)
(set! (-> this hits) 0)
(set-time! (-> this spawn-time))
(if (made-impact? this)
(go (method-of-object this impact))
(go (method-of-object this moving))
)
#t
)
(else
((method-of-type projectile event-handler!) this arg0 arg1 arg2 arg3)
)
)
)
;; failed to figure out what this is:
(defstate dissipate (juicer-shot)
:virtual #t
:enter (behavior ()
(go-virtual impact)
)
)
;; definition for method 37 of type juicer-shot
(defmethod deal-damage! ((this juicer-shot) (arg0 process) (arg1 event-message-block))
"Constructs an [[attack-info]] according to the projectile's `options`"
(let ((a0-2 (if (type? arg0 process-focusable)
arg0
)
)
)
(when a0-2
(set! (-> this victim) (process->handle a0-2))
#t
)
)
)
;; definition for method 25 of type juicer-shot
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod spawn-impact-particles ((this juicer-shot))
"Spawns associated particles with the projectile if applicable"
(let ((s5-0 (-> this starting-pos))
(s4-0 (-> this root trans))
)
(when (line-in-view-frustum? s5-0 s4-0)
(let ((s3-0 (new 'stack-no-clear 'vector))
(s2-0 (new 'stack-no-clear 'vector))
(s1-0 (new 'stack-no-clear 'matrix))
)
(launch-particles (-> *part-id-table* 4637) s5-0)
(launch-particles (-> *part-id-table* 4638) s5-0)
(when (not (handle->process (-> this victim)))
(launch-particles (-> *part-id-table* 4637) s4-0)
(launch-particles (-> *part-id-table* 4638) s4-0)
)
(vector-! s2-0 s4-0 s5-0)
(vector-normalize! s2-0 1.0)
(matrix-axis-angle! s1-0 s2-0 13107.2)
(vector-reset! (-> s1-0 trans))
(set-vector! s3-0 (-> s2-0 z) 0.0 (- (-> s2-0 x)) 1.0)
(vector-normalize! s3-0 409.6)
(dotimes (s0-0 5)
(vector-matrix*! s3-0 s3-0 s1-0)
(vector+! s2-0 s3-0 s5-0)
(let ((a0-17 (-> this lightning s0-0))
(v1-21 s2-0)
)
(set! (-> a0-17 state meet data 0 quad) (-> v1-21 quad))
)
(let ((a0-20 (-> this lightning s0-0))
(v1-25 s4-0)
)
(set! (-> a0-20 state meet data (+ (the-as int (-> a0-20 state points-to-draw)) -1) quad) (-> v1-25 quad))
)
)
)
)
)
0
(none)
)
;; definition for method 26 of type juicer-shot
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod spawn-shell-particles ((this juicer-shot))
"TODO - confirm"
(spawn-impact-particles this)
(let ((s5-0 (get-process *default-dead-pool* part-tracker #x4000)))
(when s5-0
(let ((t9-2 (method-of-type part-tracker activate)))
(t9-2
(the-as part-tracker s5-0)
*entity-pool*
(symbol->string (-> part-tracker symbol))
(the-as pointer #x70004000)
)
)
(let ((t9-3 run-function-in-process)
(a0-4 s5-0)
(a1-2 part-tracker-init)
(a2-4 (-> *part-group-id-table* 1061))
(a3-1 0)
(t0-0 #f)
(t1-0 #f)
(t2-0 #f)
(t3-0 *launch-matrix*)
)
(set! (-> t3-0 trans quad) (-> this root trans quad))
((the-as (function object object object object object object object object none) t9-3)
a0-4
a1-2
a2-4
a3-1
t0-0
t1-0
t2-0
t3-0
)
)
(-> s5-0 ppointer)
)
)
0
(none)
)
;; definition for method 38 of type juicer-shot
(defmethod made-impact? ((this juicer-shot))
"TODO - queries the collision cache, return true/false"
(let ((gp-0 (-> this root))
(s5-0 (new 'stack-no-clear 'collide-query))
)
(let ((v1-0 s5-0))
(set! (-> v1-0 radius) (-> gp-0 root-prim prim-core world-sphere w))
(set! (-> v1-0 collide-with) (-> gp-0 root-prim prim-core collide-with))
(set! (-> v1-0 ignore-process0) this)
(set! (-> v1-0 ignore-process1) (ppointer->process (-> this parent)))
(set! (-> v1-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1))
(set! (-> v1-0 action-mask) (collide-action solid))
)
(let ((a0-2 (handle->process (-> this notify-handle))))
(when a0-2
(let* ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> gp-0 trans) (get-trans (the-as process-focusable a0-2) 3)))
(f0-2 (- (vector-length s4-1)))
)
(fill-and-try-snap-to-surface gp-0 s4-1 f0-2 0.0 -3072.0 s5-0)
)
)
)
)
)
;; definition for function juicer-proj-move
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defbehavior juicer-proj-move juicer ((arg0 juicer-shot))
(let ((s5-0 (handle->process (-> arg0 victim))))
(cond
(s5-0
(set! (-> arg0 root trans quad) (-> (get-trans (the-as process-focusable s5-0) 3) quad))
((method-of-type projectile deal-damage!) arg0 s5-0 (the-as event-message-block #f))
)
(else
(projectile-move-fill-line-sphere arg0)
(if (logtest? (-> arg0 root status) (collide-status touch-surface))
(go (method-of-object arg0 impact))
)
)
)
)
0
(none)
)
;; definition for method 30 of type juicer-shot
;; WARN: Return type mismatch int vs none.
(defmethod init-proj-collision! ((this juicer-shot))
"Init the [[projectile]]'s [[collide-shape]]"
(let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum 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 penetrate-using) (penetrate enemy-yellow-shot))
(let ((v1-7 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-7 prim-core collide-as) (collide-spec projectile))
(set! (-> v1-7 prim-core collide-with)
(collide-spec
backgnd
jak
bot
crate
civilian
enemy
obstacle
vehicle-sphere
hit-by-others-list
player-list
pusher
)
)
(set! (-> v1-7 prim-core action) (collide-action solid))
(set-vector! (-> v1-7 local-sphere) 0.0 0.0 0.0 1228.8)
(set! (-> s5-0 total-prims) (the-as uint 1))
(set! (-> s5-0 root-prim) v1-7)
)
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
(let ((v1-10 (-> s5-0 root-prim)))
(set! (-> s5-0 backup-collide-as) (-> v1-10 prim-core collide-as))
(set! (-> s5-0 backup-collide-with) (-> v1-10 prim-core collide-with))
)
(set! (-> s5-0 max-iteration-count) (the-as uint 1))
(set! (-> this root) s5-0)
)
(set! (-> this root pat-ignore-mask)
(new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1)
)
(none)
)
;; definition for method 7 of type juicer-shot
;; WARN: Return type mismatch projectile vs juicer-shot.
(defmethod relocate ((this juicer-shot) (offset int))
(dotimes (v1-0 5)
(if (nonzero? (-> this lightning v1-0))
(&+! (-> this lightning v1-0) offset)
)
)
(the-as juicer-shot ((method-of-type projectile relocate) this offset))
)
;; definition for method 31 of type juicer-shot
;; WARN: Return type mismatch int vs none.
(defmethod init-proj-settings! ((this juicer-shot))
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc"
(logior! (-> this options) (projectile-options proj-options-8000))
(set! (-> this attack-mode) 'eco-yellow)
(set! (-> this move) juicer-proj-move)
(set! (-> this root dynam gravity y) 0.0)
(set! (-> this root dynam gravity-length) 0.0)
(set! (-> this root dynam gravity-max) 0.0)
(set! (-> this attack-mode) 'shock-red)
(dotimes (s5-0 5)
(set! (-> this lightning s5-0) (new
'process
'lightning-control
(new 'static 'lightning-spec
:name #f
:flags (lightning-spec-flags lsf0)
:start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)
:end-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)
:fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5)
:fade-start-factor 0.2
:fade-time 120.0
:texture (new 'static 'texture-id :index #x86 :page #xc)
:reduction 0.42
:num-points 8
:box-size 8192.0
:merge-factor 0.5
:merge-count 2
:radius 1433.6
:duration -1.0
:sound #f
)
this
0.0
)
)
)
(set! (-> this victim) (the-as handle #f))
0
(none)
)
;; failed to figure out what this is:
(defskelgroup skel-juicer juicer juicer-lod0-jg -1
((juicer-lod0-mg (meters 20)) (juicer-lod1-mg (meters 40)) (juicer-lod2-mg (meters 999999)))
:bounds (static-spherem 0 0 0 5.3)
:shadow juicer-shadow-mg
:origin-joint-index 21
)
;; definition of type juicer-anim-info
(deftype juicer-anim-info (structure)
((anim-index int32)
)
)
;; definition for method 3 of type juicer-anim-info
(defmethod inspect ((this juicer-anim-info))
(when (not this)
(set! this this)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" this 'juicer-anim-info)
(format #t "~1Tanim-index: ~D~%" (-> this anim-index))
(label cfg-4)
this
)
;; definition of type juicer-global-info
(deftype juicer-global-info (basic)
((prev-yellow-hit int8)
(prev-blue-hit int8)
(idle-anim int32 3)
(patrol-anim int32 2)
(notice-anim int32 2)
(charge-anim int32 2)
(knocked-anim int32 2)
(celebrate-anim int32 2)
(yellow-hit-anim int32 4)
(blue-hit-anim int32 6)
)
)
;; definition for method 3 of type juicer-global-info
(defmethod inspect ((this juicer-global-info))
(when (not this)
(set! this this)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" this (-> this type))
(format #t "~1Tprev-yellow-hit: ~D~%" (-> this prev-yellow-hit))
(format #t "~1Tprev-blue-hit: ~D~%" (-> this prev-blue-hit))
(format #t "~1Tidle-anim[3] @ #x~X~%" (-> this idle-anim))
(format #t "~1Tpatrol-anim[2] @ #x~X~%" (-> this patrol-anim))
(format #t "~1Tnotice-anim[2] @ #x~X~%" (-> this notice-anim))
(format #t "~1Tcharge-anim[2] @ #x~X~%" (-> this charge-anim))
(format #t "~1Tknocked-anim[2] @ #x~X~%" (-> this knocked-anim))
(format #t "~1Tcelebrate-anim[2] @ #x~X~%" (-> this celebrate-anim))
(format #t "~1Tyellow-hit-anim[4] @ #x~X~%" (-> this yellow-hit-anim))
(format #t "~1Tblue-hit-anim[6] @ #x~X~%" (-> this blue-hit-anim))
(label cfg-4)
this
)
;; definition of type juicer
(deftype juicer (nav-enemy)
((los los-control :inline)
(intro-path path-control)
(joint joint-mod)
(joint-enable symbol)
(joint-blend float)
(last-fire-time time-frame)
(heading basic)
(move-angle float)
(torso-track-player basic)
(circle-backward? symbol :offset 800)
(using-turn-anim symbol)
(hit-focus enemy-focus)
(ambush-path-pt int8)
(charge-index int8)
(hostile-dest vector :inline)
(focus-is-up symbol)
(current-projectile handle)
)
(:state-methods
ambush-cont
attack
)
(:methods
(juicer-method-180 (_type_) none)
(fire-projectile (_type_ process-focusable uint) none)
(juicer-method-182 (_type_) none)
(juicer-method-183 (_type_) none)
(juicer-method-184 (_type_ symbol) none)
)
)
;; definition for method 3 of type juicer
(defmethod inspect ((this juicer))
(when (not this)
(set! this this)
(goto cfg-4)
)
(let ((t9-0 (method-of-type nav-enemy inspect)))
(t9-0 this)
)
(format #t "~2Tlos: #<los-control @ #x~X>~%" (-> this los))
(format #t "~2Tintro-path: ~A~%" (-> this intro-path))
(format #t "~2Tjoint: ~A~%" (-> this joint))
(format #t "~2Tjoint-enable: ~A~%" (-> this joint-enable))
(format #t "~2Tjoint-blend: ~f~%" (-> this joint-blend))
(format #t "~2Tlast-fire-time: ~D~%" (-> this last-fire-time))
(format #t "~2Theading: ~A~%" (-> this heading))
(format #t "~2Tmove-angle: ~f~%" (-> this move-angle))
(format #t "~2Ttorso-track-player: ~A~%" (-> this torso-track-player))
(format #t "~2Tcircle-radial-dist: ~f~%" (-> this desired-angle))
(format #t "~2Tcircle-backward?: ~A~%" (-> this circle-backward?))
(format #t "~2Tusing-turn-anim: ~A~%" (-> this using-turn-anim))
(format #t "~2Thit-focus: ~A~%" (-> this hit-focus))
(format #t "~2Tambush-path-pt: ~D~%" (-> this ambush-path-pt))
(format #t "~2Tcharge-index: ~D~%" (-> this charge-index))
(format #t "~2Thostile-dest: #<vector @ #x~X>~%" (-> this hostile-dest))
(format #t "~2Tfocus-is-up: ~A~%" (-> this focus-is-up))
(format #t "~2Tcurrent-projectile: ~D~%" (-> this current-projectile))
(label cfg-4)
this
)
;; definition for symbol *juicer-global-info*, type juicer-global-info
(define *juicer-global-info* (new 'static 'juicer-global-info
:idle-anim (new 'static 'array int32 3 5 6 7)
:patrol-anim (new 'static 'array int32 2 8 23)
:notice-anim (new 'static 'array int32 2 21 22)
:charge-anim (new 'static 'array int32 2 9 20)
:knocked-anim (new 'static 'array int32 2 16 18)
:celebrate-anim (new 'static 'array int32 2 24 25)
:yellow-hit-anim (new 'static 'array int32 4 33 34 35 36)
:blue-hit-anim (new 'static 'array int32 6 26 27 28 29 30 31)
)
)
;; definition for symbol *juicer-nav-enemy-info*, type nav-enemy-info
(define *juicer-nav-enemy-info*
(new 'static 'nav-enemy-info
:use-die-falling #t
:use-victory #t
: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 'array idle-control-frame 4
(new 'static 'idle-control-frame :command (ic-cmd play) :anim #x5 :param0 #x1 :param1 #x1)
(new 'static 'idle-control-frame)
(new 'static 'idle-control-frame)
(new 'static 'idle-control-frame)
)
:idle-anim 5
:notice-anim 21
:hostile-anim 9
:hit-anim 11
:knocked-anim 18
:knocked-land-anim 19
:die-anim 40
:die-falling-anim 41
:victory-anim 24
:jump-wind-up-anim 37
:jump-in-air-anim 38
:jump-land-anim 39
:neck-joint 34
:look-at-joint 34
:bullseye-joint 6
:sound-hit (static-sound-name "juicer-hit")
:sound-die (static-sound-name "juicer-die")
:notice-distance (meters 30)
:notice-distance-delta (meters 10)
:proximity-notice-distance (meters 24)
:default-hit-points 9
:gnd-collide-with (collide-spec backgnd)
:overlaps-others-collide-with-filter (collide-spec jak bot 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.9
:attack-shove-back (meters 3)
:attack-shove-up (meters 2)
:attack-mode 'shock-red
:attack-damage 2
:recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher)
:jump-height-min (meters 3)
:jump-height-factor 0.5
:knocked-seek-ry-clamp 6371.5557
:knocked-soft-vxz-lo 65536.0
:knocked-soft-vxz-hi 94208.0
:knocked-soft-vy-lo 77824.0
:knocked-soft-vy-hi 98304.0
:knocked-medium-vxz-lo 81920.0
:knocked-medium-vxz-hi 98304.0
:knocked-medium-vy-lo 81920.0
:knocked-medium-vy-hi 122880.0
:knocked-hard-vxz-lo 65536.0
:knocked-hard-vxz-hi 95846.4
:knocked-hard-vy-lo 122880.0
:knocked-hard-vy-hi 163840.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 40960.0
:knocked-yellow-vxz-hi 49152.0
:knocked-yellow-vy-lo 57344.0
:knocked-yellow-vy-hi 81920.0
:knocked-red-vxz-lo 24576.0
:knocked-red-vxz-hi 98304.0
:knocked-red-vy-lo 90112.0
:knocked-red-vy-hi 131072.0
:knocked-blue-vxz-lo 24576.0
:knocked-blue-vxz-hi 32768.0
:knocked-blue-vy-lo 24576.0
:knocked-blue-vy-hi 73728.0
:shadow-size (meters 2)
:shadow-max-y (meters 1)
:shadow-min-y (meters -1)
:shadow-locus-dist (meters 150)
:gem-joint 34
:gem-seg #x2
:gem-no-seg #x4
:gem-offset (new 'static 'sphere :y 942.08 :z 40.96 :r 163840.0)
:callback-info #f
:use-momentum #f
:use-frustration #t
:use-stop-chase #f
:use-circling #t
:use-pacing #t
:walk-anim 8
:turn-anim 10
:run-anim 9
:taunt-anim -1
:run-travel-speed (meters 8)
:run-acceleration (meters 8)
:run-turning-acceleration (meters 20)
:walk-travel-speed (meters 2)
:walk-acceleration (meters 2)
:walk-turning-acceleration (meters 3)
:maximum-rotation-rate (degrees 360)
:notice-nav-radius (meters 7.5)
:frustration-distance (meters 8)
:frustration-time (seconds 4)
:blocked-time (seconds 0.3)
:circle-dist-lo 28672.0
:circle-dist-hi 53248.0
:nav-mesh #f
)
)
;; failed to figure out what this is:
(set! (-> *juicer-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*)
;; definition for method 182 of type juicer
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod juicer-method-182 ((this juicer))
(let ((s3-0 (handle->process (-> this focus handle))))
(when s3-0
(let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 4)))
(s5-0 (new 'stack-no-clear 'vector))
)
(set! (-> s5-0 quad) (-> (get-trans (the-as process-focusable s3-0) 3) quad))
(let ((s3-1
(vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this node-list data 4 bone transform vector 2) 1.0)
)
)
(vector-! s5-0 s5-0 s4-0)
(vector-normalize! s5-0 1.0)
(quaternion-from-two-vectors-partial! (-> this joint quat) s3-1 s5-0 (-> this joint-blend))
)
)
)
)
0
(none)
)
;; definition for method 183 of type juicer
;; WARN: Return type mismatch int vs none.
(defmethod juicer-method-183 ((this juicer))
(cond
((-> this torso-track-player)
(set! (-> this joint-enable) #t)
(seek! (-> this joint-blend) 1.0 (* 2.0 (seconds-per-frame)))
(juicer-method-182 this)
)
((-> this joint-enable)
(seek! (-> this joint-blend) 0.0 (* 4.0 (seconds-per-frame)))
(juicer-method-182 this)
(if (= (-> this joint-blend) 0.0)
(set! (-> this joint-enable) #f)
)
)
)
0
(none)
)
;; definition for method 55 of type juicer
(defmethod common-post ((this juicer))
"Does a lot of various things relating to interacting with the target
- tracks when the enemy was last drawn
- looks at the target and handles attacking
@TODO Not extremely well understood yet"
(let ((t9-0 (method-of-type nav-enemy common-post)))
(t9-0 this)
)
(los-control-method-9 (-> this los) (the-as process-focusable #f) (the-as vector #f) 2048.0)
(juicer-method-183 this)
(none)
)
;; definition for method 180 of type juicer
;; WARN: Return type mismatch object vs none.
(defmethod juicer-method-180 ((this juicer))
(if (and (= (-> this incoming knocked-type) (knocked-type knocked-type-4))
(not (and (-> this next-state) (let ((v1-6 (-> this next-state name)))
(or (= v1-6 'knocked) (= v1-6 'jump) (= v1-6 'jump-land))
)
)
)
(zero? (rnd-int-count this 3))
(let ((f0-0 (vector-vector-distance-squared (-> this root trans) (target-pos 0)))
(f1-0 32768.0)
)
(>= f0-0 (* f1-0 f1-0))
)
)
(kill-prefer-falling this)
(go (method-of-object this knocked))
)
(none)
)
;; definition for method 74 of type juicer
(defmethod general-event-handler ((this juicer) (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
(('hit-flinch)
(cond
((zero? (-> this hit-points))
(logclear! (-> this mask) (process-mask actor-pause))
(logclear! (-> this focus-status) (focus-status dangerous))
(logclear! (-> this enemy-flags) (enemy-flag use-notice-distance))
(logior! (-> this enemy-flags) (enemy-flag alert))
(logior! (-> this focus-status) (focus-status hit))
(if (zero? (-> this hit-points))
(logior! (-> this focus-status) (focus-status dead))
)
(logclear! (-> this enemy-flags) (enemy-flag lock-focus))
(enemy-method-62 this)
(logior! (-> this enemy-flags) (enemy-flag lock-focus))
(process-contact-action arg0)
(send-event arg0 'get-attack-count 1)
(juicer-method-180 this)
)
(else
(let ((v1-31 (ja-channel-float! (the-as art-joint-anim (-> this draw art-group data 11)) 0.0 0.0 0.0)))
(when v1-31
(set! (-> v1-31 param 0) 1.0)
(set! (-> v1-31 param 1) 0.75)
(set! (-> v1-31 param 2) 2.0)
(set! (-> v1-31 num-func) num-func-interp-play!)
)
)
)
)
#t
)
(('hit)
(logclear! (-> this mask) (process-mask actor-pause))
(logclear! (-> this focus-status) (focus-status dangerous))
(logclear! (-> this enemy-flags) (enemy-flag use-notice-distance))
(logior! (-> this enemy-flags) (enemy-flag alert))
(logior! (-> this focus-status) (focus-status hit))
(if (zero? (-> this hit-points))
(logior! (-> this focus-status) (focus-status dead))
)
(logclear! (-> this enemy-flags) (enemy-flag lock-focus))
(enemy-method-62 this)
(logior! (-> this enemy-flags) (enemy-flag lock-focus))
(process-contact-action arg0)
(send-event arg0 'get-attack-count 1)
(if (zero? (-> this hit-points))
(juicer-method-180 this)
(go (method-of-object this hit))
)
#t
)
(('instant-death)
(when (> (-> this hit-points) 0)
(set! (-> this hit-points) 0)
(set! (-> this root penetrated-by) (get-penetrate-info this))
(let ((s4-0 (enemy-method-50 this (new 'stack-no-clear 'vector))))
(vector-z-quaternion! s4-0 (-> this root quat))
(vector-float*! s4-0 s4-0 -1.0)
(vector-normalize! s4-0 1.0)
)
(logclear! (-> this mask) (process-mask actor-pause))
(logclear! (-> this focus-status) (focus-status dangerous))
(logclear! (-> this enemy-flags) (enemy-flag use-notice-distance))
(logior! (-> this enemy-flags) (enemy-flag alert))
(logior! (-> this focus-status) (focus-status hit))
(if (zero? (-> this hit-points))
(logior! (-> this focus-status) (focus-status dead))
)
(logclear! (-> this enemy-flags) (enemy-flag lock-focus))
(enemy-method-62 this)
(logior! (-> this enemy-flags) (enemy-flag lock-focus))
(process-contact-action arg0)
(send-event arg0 'get-attack-count 1)
(juicer-method-180 this)
)
#t
)
(('notify)
(if (and (= (-> arg3 param 0) 'attack) (= (-> arg3 param 1) (handle->process (-> this focus handle))))
(set! (-> this hit-focus) (the-as enemy-focus #t))
)
((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3)
)
(else
((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3)
)
)
)
;; failed to figure out what this is:
(defstate active (juicer)
:virtual #t
:code (behavior ()
(let ((v1-2 (ja-group)))
(when (or (and v1-2 (or (= v1-2 juicer-charge0-ja) (= v1-2 juicer-charge1-ja)))
(let ((v1-8 (ja-group)))
(and v1-8 (or (= v1-8 juicer-patrol0-ja) (= v1-8 juicer-patrol1-ja)))
)
)
(ja-no-eval :num! (seek!))
(while (not (ja-done? 0))
(suspend)
(ja-eval)
)
)
)
(let ((f30-0 (rnd-float-range self 0.9 1.1)))
(until #f
(let ((gp-0 (-> self draw art-group data (-> (&-> *juicer-global-info* patrol-anim (rnd-int-count self 2)) 0)))
(s5-0 (rnd-int-range self 1 8))
)
(let ((v1-34 (ja-group)))
(if (not (and v1-34 (= v1-34 gp-0)))
(ja-channel-push! 1 (seconds 0.2))
)
)
(dotimes (s4-0 s5-0)
(ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! max f30-0))
)
)
)
(when (zero? (rnd-int-count self 2))
(let ((v1-58 self))
(set! (-> v1-58 enemy-flags) (the-as enemy-flag (logclear (-> v1-58 enemy-flags) (enemy-flag enemy-flag36))))
(set! (-> v1-58 nav callback-info) *nav-enemy-null-callback-info*)
)
0
(ja-channel-push! 1 (seconds 0.3))
(let ((gp-1 0))
(until (not (rnd-go-idle? self 0.4))
(let* ((v1-62 (rnd-bit self 3 gp-1))
(a1-16 (-> self draw art-group data (-> *juicer-global-info* idle-anim v1-62)))
)
(set! gp-1 (ash 1 v1-62))
(ja-no-eval :group! a1-16 :num! (seek! max f30-0) :frame-num 0.0)
)
(ja-no-eval :group! (ja-group) :num! (seek! max f30-0) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! max f30-0))
)
)
)
(let ((v1-102 self))
(if (not (logtest? (enemy-flag enemy-flag36) (-> v1-102 enemy-flags)))
(set! (-> v1-102 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-102 enemy-flags))))
)
(set! (-> v1-102 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag36) (-> v1-102 enemy-flags))))
(set! (-> v1-102 nav callback-info) (-> v1-102 enemy-info callback-info))
)
0
)
)
)
#f
)
)
;; definition for method 84 of type juicer
(defmethod enemy-method-84 ((this juicer) (arg0 enemy-jump-info))
(cond
((logtest? (-> this fact enemy-options) (enemy-option user8))
(vector-vector-xz-distance (-> arg0 start-pos) (-> arg0 dest-pos))
(let ((f0-1 8192.0))
(setup-from-to-height! (-> arg0 traj) (-> arg0 start-pos) (-> arg0 dest-pos) f0-1 -4.551111)
)
)
(else
((method-of-type nav-enemy enemy-method-84) this arg0)
)
)
(none)
)
;; definition for method 93 of type juicer
;; WARN: Return type mismatch object vs none.
(defmethod enemy-method-93 ((this juicer))
(case (-> this jump-why)
((2)
(go (method-of-object this ambush-cont))
)
(else
((method-of-type nav-enemy enemy-method-93) this)
)
)
(none)
)
;; failed to figure out what this is:
(defstate ambush (juicer)
:virtual #t
:enter (behavior ()
(let ((t9-0 (-> (method-of-type nav-enemy ambush) enter)))
(if t9-0
(t9-0)
)
)
(when (zero? (-> self intro-path))
(format 0 "ERROR: ~A has no intro path, skipping ambush~%" (-> self name))
(go-virtual notice)
)
(get-point-in-path! (-> self intro-path) (-> self root trans) 0.0 'interp)
)
:code (behavior ()
(set! (-> self ambush-path-pt) 1)
(until #f
(let ((gp-0 (new 'stack-no-clear 'vector)))
(get-point-in-path! (-> self intro-path) gp-0 1.0 'interp)
(set! (-> self enemy-flags)
(the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked)))
)
(let ((a1-1 (new 'stack-no-clear 'event-message-block)))
(let ((v1-5 (process->ppointer self)))
(set! (-> a1-1 from) v1-5)
)
(set! (-> a1-1 num-params) 2)
(set! (-> a1-1 message) 'jump)
(set! (-> a1-1 param 0) (the-as uint 2))
(set! (-> a1-1 param 1) (the-as uint gp-0))
(send-event-function self a1-1)
)
)
(suspend)
)
#f
)
)
;; failed to figure out what this is:
(defstate ambush-cont (juicer)
:virtual #t
:event enemy-event-handler
:code (behavior ()
(let ((a0-0 (-> self intro-path))
(v1-1 (+ (-> self ambush-path-pt) 1))
)
(if (< v1-1 (-> a0-0 curve num-cverts))
(set! (-> self ambush-path-pt) v1-1)
(react-to-focus self)
)
)
(until #f
(let ((gp-0 (new 'stack-no-clear 'vector)))
(get-point-in-path! (-> self intro-path) gp-0 (the float (-> self ambush-path-pt)) 'interp)
(set! (-> self enemy-flags)
(the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag jump-check-blocked)))
)
(let ((a1-1 (new 'stack-no-clear 'event-message-block)))
(let ((v1-9 (process->ppointer self)))
(set! (-> a1-1 from) v1-9)
)
(set! (-> a1-1 num-params) 2)
(set! (-> a1-1 message) 'jump)
(set! (-> a1-1 param 0) (the-as uint 2))
(set! (-> a1-1 param 1) (the-as uint gp-0))
(send-event-function self a1-1)
)
)
(suspend)
)
#f
)
)
;; failed to figure out what this is:
(defstate notice (juicer)
:virtual #t
:code (behavior ()
(ja-channel-push! 1 (seconds 0.075))
(let ((s5-0 0))
(let ((s4-0 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat)))
(gp-1 (vector-!
(new 'stack-no-clear 'vector)
(get-trans (the-as process-focusable (handle->process (-> self focus handle))) 0)
(-> self root trans)
)
)
)
(vector-flatten! gp-1 gp-1 (-> s4-0 vector 1))
(vector-normalize! gp-1 1.0)
(cond
((< (vector-dot gp-1 (-> s4-0 vector 2)) (cos 8192.0))
)
(else
(set! s5-0 (logior s5-0 1))
)
)
)
(let ((f30-1 (rnd-float-range self 0.8 1.2))
(gp-2 (new 'stack-no-clear 'vector))
)
(let* ((a0-13 (rnd-bit self 2 s5-0))
(a1-8 (-> self draw art-group data (-> *juicer-global-info* notice-anim a0-13)))
)
(ja-no-eval :group! a1-8 :num! (seek! max f30-1) :frame-num 0.0)
)
(until (ja-done? 0)
(let ((a1-9 (-> self nav state)))
(set! (-> gp-2 quad) (-> a1-9 travel quad))
)
(seek-toward-heading-vec! (-> self root) gp-2 (-> self nav max-rotation-rate) (seconds 0.02))
(suspend)
(ja :num! (seek! max f30-1))
)
)
)
(react-to-focus self)
)
)
;; failed to figure out what this is:
(defstate victory (juicer)
:virtual #t
:code (behavior ()
(ja-channel-push! 1 (seconds 0.15))
(let ((gp-1 (-> self draw art-group data (-> *juicer-global-info* celebrate-anim (rnd-int-count self 2))))
(f30-0 (rnd-float-range self 0.9 1.1))
)
(ja-no-eval :group! gp-1 :num! (seek! max f30-0) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! max f30-0))
)
)
(react-to-focus self)
)
)
;; failed to figure out what this is:
(defstate hostile (juicer)
:virtual #t
:enter (behavior ()
(let ((t9-0 (-> (method-of-type nav-enemy hostile) enter)))
(if t9-0
(t9-0)
)
)
(set! (-> self focus-is-up) #f)
)
:exit (behavior ()
(let ((t9-0 (-> (method-of-type nav-enemy hostile) exit)))
(if t9-0
(t9-0)
)
)
)
:code (behavior ()
(let ((v1-2 (ja-group)))
(when (and v1-2 (or (= v1-2 juicer-charge0-ja) (= v1-2 juicer-charge1-ja)))
(ja-no-eval :num! (seek!))
(while (not (ja-done? 0))
(suspend)
(ja-eval)
)
)
)
(let* ((v1-16 (rnd-int-count self 2))
(gp-0 (-> self draw art-group data (-> *juicer-global-info* charge-anim v1-16)))
)
(set! (-> self charge-index) v1-16)
(let ((v1-19 (ja-group)))
(if (not (and v1-19 (= v1-19 gp-0)))
(ja-channel-push! 1 (seconds 0.2))
)
)
(set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-0))
)
(ja :num-func num-func-identity :frame-num 0.0)
(let ((f30-0 (rnd-float-range self 0.9 1.1)))
(until #f
(suspend)
(ja :num! (loop! f30-0))
)
)
#f
)
:post (behavior ()
(let ((a0-1 (handle->process (-> self focus handle))))
(when a0-1
(let* ((gp-0 (get-trans (the-as process-focusable a0-1) 1))
(f30-0 (vector-vector-xz-distance (-> self root trans) gp-0))
)
(cond
((< (- (-> gp-0 y) (-> self root trans y)) 4096.0)
(let ((v1-10 (-> self nav state)))
(logclear! (-> v1-10 flags) (nav-state-flag directional-mode))
(logior! (-> v1-10 flags) (nav-state-flag target-poly-dirty))
(set! (-> v1-10 target-post quad) (-> gp-0 quad))
)
0
(set! (-> self focus-is-up) #f)
)
((not (-> self focus-is-up))
(let ((s4-0 (new 'stack-no-clear 'vector))
(s5-0 (new 'stack-no-clear 'vector))
)
(let ((f28-0 (rand-vu-float-range 0.0 65536.0)))
(set-vector! s4-0 (* 8192.0 (cos f28-0)) 0.0 (* 8192.0 (sin f28-0)) 1.0)
)
(vector+! s4-0 s4-0 gp-0)
(cloest-point-on-mesh (-> self nav) s4-0 s4-0 (the-as nav-poly #f))
(vector-! s5-0 s4-0 gp-0)
(set! (-> s5-0 y) 0.0)
(vector-normalize! s5-0 30720.0)
(vector+! s5-0 s5-0 s4-0)
(let ((v1-24 (-> self nav state)))
(logclear! (-> v1-24 flags) (nav-state-flag directional-mode))
(logior! (-> v1-24 flags) (nav-state-flag target-poly-dirty))
(set! (-> v1-24 target-post quad) (-> s5-0 quad))
)
)
0
(set! (-> self focus-is-up) #t)
)
(else
(when (and (or (logtest? (-> self nav state flags) (nav-state-flag blocked))
(logtest? (-> self nav state flags) (nav-state-flag at-target))
)
(time-elapsed? (-> self state-time) (-> self reaction-time))
)
(if (and (time-elapsed? (-> self last-fire-time) (rand-vu-int-range (seconds 1) (seconds 2))) (< 20480.0 f30-0))
(go-virtual attack)
(go-virtual circling)
)
)
)
)
(if (and (check-los? (-> self los) 0)
(or (>= 11468.8 f30-0)
(and (time-elapsed? (-> self last-fire-time) (rand-vu-int-range (seconds 5) (seconds 8))) (>= 53248.0 f30-0))
)
)
(go-virtual attack)
)
)
)
)
(nav-enemy-travel-post)
)
)
;; definition for function juicer-face-player-post
;; WARN: Return type mismatch int vs none.
(defbehavior juicer-face-player-post juicer ()
(let ((gp-0 (handle->process (-> self focus handle)))
(a0-3 self)
)
(when (and (logtest? (enemy-flag enemy-flag37) (-> a0-3 enemy-flags)) gp-0)
(let ((f0-1
(fabs
(deg-diff
(quaternion-y-angle (-> self root quat))
(vector-y-angle
(vector-! (new 'stack-no-clear 'vector) (get-trans (the-as process-focusable gp-0) 0) (-> self root trans))
)
)
)
)
)
(cond
((or (< 5461.3335 f0-1) (and (-> self using-turn-anim) (< 910.2222 f0-1)))
(set! (-> self using-turn-anim) #t)
(seek-to-point-toward-point!
(-> self root)
(get-trans (the-as process-focusable gp-0) 0)
(-> self nav max-rotation-rate)
(seconds 0.2)
)
)
(else
(set! (-> self using-turn-anim) #f)
)
)
)
)
)
(nav-enemy-simple-post)
0
(none)
)
;; definition for method 181 of type juicer
;; WARN: Return type mismatch object vs none.
(defmethod fire-projectile ((this juicer) (arg0 process-focusable) (arg1 uint))
(with-pp
(let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 20)))
(s5-0 (new 'stack-no-clear 'projectile-init-by-other-params))
)
(when (not (handle->process (-> this current-projectile)))
(set! (-> s5-0 ent) (-> this entity))
(set! (-> s5-0 charge) 1.0)
(set! (-> s5-0 options) (projectile-options))
(set! (-> s5-0 notify-handle) (process->handle this))
(set! (-> s5-0 owner-handle) (the-as handle #f))
(set! (-> s5-0 ignore-handle) (process->handle this))
(set! (-> s5-0 attack-id) arg1)
(set! (-> s5-0 timeout) (seconds 4))
)
(vector-normalize! (vector-! (-> s5-0 pos) (get-trans arg0 3) s4-0) 1.0)
(vector-float*! (-> s5-0 vel) (-> s5-0 pos) (* 24576.0 (-> pp clock frames-per-second)))
(vector+float*! (-> s5-0 pos) s4-0 (-> s5-0 pos) -1024.0)
(let ((a0-20 (handle->process (-> this current-projectile))))
(if a0-20
(send-event a0-20 'reset s5-0)
(set! (-> this current-projectile)
(ppointer->handle (spawn-projectile juicer-shot s5-0 this *default-dead-pool*))
)
)
)
)
(none)
)
)
;; failed to figure out what this is:
(defstate attack (juicer)
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(let ((v1-1 (-> self nav state))
(a0-1 (-> self root trans))
)
(logclear! (-> v1-1 flags) (nav-state-flag directional-mode))
(logior! (-> v1-1 flags) (nav-state-flag target-poly-dirty))
(set! (-> v1-1 target-post quad) (-> a0-1 quad))
)
0
(set! (-> self torso-track-player) (the-as basic #t))
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
(set! (-> self hit-focus) #f)
(logior! (-> self focus-status) (focus-status dangerous))
(let* ((v1-9 *game-info*)
(v0-0 (+ (-> v1-9 attack-id) 1))
)
(set! (-> v1-9 attack-id) v0-0)
(set! (-> self attack-id) v0-0)
)
)
:exit (behavior ()
(set! (-> self torso-track-player) #f)
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(juicer-method-184 self #f)
(set-time! (-> self last-fire-time))
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
(send-event (handle->process (-> self current-projectile)) 'die)
)
:trans (behavior ()
(when (skip-check-los? (-> self los) 90)
)
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.1))
(ja-no-eval :group! juicer-attack0-start-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(if (< 11.0 (ja-aframe-num 0))
(juicer-method-184 self #t)
)
(suspend)
(ja :num! (seek!))
)
0
(let* ((gp-0 #f)
(v1-29 *game-info*)
(s5-0 (+ (-> v1-29 attack-id) 1))
)
(set! (-> v1-29 attack-id) s5-0)
(suspend-for (seconds 0.25)
(ja-no-eval :group! juicer-attack0-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(let ((s3-0 (handle->process (-> self focus handle))))
(when s3-0
(when (< 28672.0 (vector-vector-distance (-> self root trans) (get-trans (the-as process-focusable s3-0) 0)))
(fire-projectile self (the-as process-focusable s3-0) s5-0)
(current-time)
(if (not gp-0)
(set! gp-0 #t)
)
)
)
)
(if (and (logtest? (-> self enemy-flags) (enemy-flag victory)) (-> self enemy-info use-victory))
(go-virtual victory)
)
(b!
(not (and (-> self using-turn-anim) (let ((v1-73 (ja-group)))
(not (and v1-73 (= v1-73 juicer-attack-turn-ja)))
)
)
)
cfg-31
:delay (empty-form)
)
(ja-channel-push! 1 (seconds 0.05))
(ja :group! juicer-attack-turn-ja)
(b! #t cfg-42 :delay (nop!))
(label cfg-31)
(when (and (not (-> self using-turn-anim)) (let ((v1-84 (ja-group)))
(not (and v1-84 (= v1-84 juicer-attack0-ja)))
)
)
(ja-channel-push! 1 (seconds 0.05))
(ja :group! juicer-attack0-ja)
)
(label cfg-42)
(suspend)
(ja :num! (seek!))
)
(empty-form)
(send-event (handle->process (-> self current-projectile)) 'die)
(let ((a0-37 (handle->process (-> self focus handle))))
(when a0-37
(if (>= 28672.0 (vector-vector-distance (-> self root trans) (get-trans (the-as process-focusable a0-37) 0)))
(go-virtual circling)
)
)
)
)
)
(if (-> self hit-focus)
(go-virtual victory)
)
(go-hostile self)
)
:post juicer-face-player-post
)
;; failed to figure out what this is:
(defstate circling (juicer)
:virtual #t
:code (behavior ()
(let ((v1-2 (ja-group)))
(when (and v1-2 (or (= v1-2 juicer-charge0-ja) (= v1-2 juicer-charge1-ja)))
(ja-no-eval :num! (seek!))
(while (not (ja-done? 0))
(suspend)
(ja-eval)
)
)
)
(until #f
(let ((v1-15 self))
(if (not (logtest? (enemy-flag enemy-flag36) (-> v1-15 enemy-flags)))
(set! (-> v1-15 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-15 enemy-flags))))
)
(set! (-> v1-15 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag36) (-> v1-15 enemy-flags))))
(set! (-> v1-15 nav callback-info) (-> v1-15 enemy-info callback-info))
)
0
(let ((v1-18 self))
(set! (-> v1-18 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-18 enemy-flags))))
)
0
(nav-enemy-method-166 self)
(let* ((v1-23 (rnd-int-count self 2))
(gp-0 (-> self draw art-group data (-> *juicer-global-info* charge-anim v1-23)))
)
(set! (-> self charge-index) v1-23)
(let ((v1-26 (ja-group)))
(if (not (and v1-26 (= v1-26 gp-0)))
(ja-channel-push! 1 (seconds 0.15))
)
)
(let ((s5-0 (+ (rnd-int-count self 6) 2))
(f30-0 (rnd-float-range self 0.9 1.1))
)
(while (nonzero? s5-0)
(+! s5-0 -1)
(ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! max f30-0))
)
)
)
)
(when (< 20480.0 (vector-vector-xz-distance (-> self focus-pos) (-> self root trans)))
(let ((v1-54 self))
(set! (-> v1-54 enemy-flags) (the-as enemy-flag (logclear (-> v1-54 enemy-flags) (enemy-flag enemy-flag36))))
(set! (-> v1-54 nav callback-info) *nav-enemy-null-callback-info*)
)
0
(let ((v1-57 self))
(set! (-> v1-57 enemy-flags) (the-as enemy-flag (logclear (-> v1-57 enemy-flags) (enemy-flag enemy-flag37))))
)
0
(vector-reset! (-> self root transv))
(ja-channel-push! 1 (seconds 0.1))
(let ((gp-2 (-> self draw art-group data (-> *juicer-global-info* celebrate-anim (rnd-int-count self 2))))
(f30-2 (rnd-float-range self 0.9 1.1))
)
(ja-no-eval :group! gp-2 :num! (seek! max f30-2) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! max f30-2))
)
)
)
)
#f
)
)
;; failed to figure out what this is:
(defstate hit (juicer)
:virtual #t
:code (behavior ()
(local-vars (v1-37 enemy-flag) (v1-45 enemy-flag))
(ja-channel-push! 1 (seconds 0.2))
(let ((f30-0 (rnd-float-range self 0.9 1.1)))
(ja-no-eval :group! (-> self draw art-group data (-> self enemy-info hit-anim))
:num! (seek! max f30-0)
:frame-num 0.0
)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! max f30-0))
)
)
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
(let ((v1-36 (-> self enemy-flags)))
(if (logtest? v1-36 (enemy-flag vulnerable-backup))
(set! v1-37 (logior v1-36 (enemy-flag vulnerable)))
(set! v1-37 (logclear v1-36 (enemy-flag vulnerable)))
)
)
(set! (-> self enemy-flags) v1-37)
(if (logtest? (-> self enemy-flags) (enemy-flag attackable-backup))
(logior! (-> self mask) (process-mask collectable))
(logclear! (-> self mask) (process-mask collectable))
)
(let ((v1-44 (-> self enemy-flags)))
(if (logtest? (enemy-flag trackable-backup) v1-44)
(set! v1-45 (logior (enemy-flag trackable) v1-44))
(set! v1-45 (logclear v1-44 (enemy-flag trackable)))
)
)
(set! (-> self enemy-flags) v1-45)
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(logclear! (-> self focus-status) (focus-status hit))
(go-virtual hostile)
)
)
;; failed to figure out what this is:
(defstate stare (juicer)
:virtual #t
:code (behavior ()
(ja-channel-push! 1 (seconds 1))
(let ((f30-0 (rnd-float-range self 0.9 1.1))
(gp-0 (-> self draw art-group data (-> self enemy-info idle-anim)))
)
(until #f
(ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! max f30-0))
)
)
)
#f
)
)
;; failed to figure out what this is:
(defstate taunt (juicer)
:virtual #t
:code (behavior ()
(ja-channel-push! 1 (seconds 0.6))
(let ((f30-0 (rnd-float-range self 0.8 1.2)))
(let ((gp-0 (rnd-int-range self 60 210))
(s5-0 (current-time))
(f28-0 f30-0)
)
(ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim))
:num! (loop! f28-0)
:frame-num 0.0
)
(until (time-elapsed? s5-0 gp-0)
(suspend)
(ja :num! (loop! f28-0))
)
)
(ja-channel-push! 1 (seconds 0.1))
(ja-no-eval :group! (-> self draw art-group data (-> self enemy-info taunt-anim))
:num! (seek! max f30-0)
:frame-num 0.0
)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! max f30-0))
)
)
(go-virtual stare)
)
)
;; definition for method 77 of type juicer
(defmethod enemy-method-77 ((this juicer) (arg0 enemy-knocked-info))
(local-vars (a2-2 int))
(case (-> this incoming knocked-type)
(((knocked-type knocked-type-4))
(ja-channel-push! 1 0)
(let* ((a2-0 (ash 1 (-> *juicer-global-info* prev-yellow-hit)))
(v1-3 (rnd-bit this 4 a2-0))
(a1-6 (-> this draw art-group data (-> *juicer-global-info* yellow-hit-anim v1-3)))
)
(set! (-> *juicer-global-info* prev-yellow-hit) v1-3)
(let ((a0-13 (-> this skel root-channel 0)))
(set! (-> a0-13 frame-group) (the-as art-joint-anim a1-6))
(set! (-> a0-13 param 0) (the float (+ (-> (the-as art-joint-anim a1-6) frames num-frames) -1)))
(set! (-> a0-13 param 1) (-> arg0 anim-speed))
(set! (-> a0-13 frame-num) 0.0)
(joint-control-channel-group! a0-13 (the-as art-joint-anim a1-6) num-func-seek!)
)
)
)
(((knocked-type knocked-type-6))
(let ((v1-11 (ash 1 (-> *juicer-global-info* prev-blue-hit))))
(if (zero? (-> this charge-index))
(set! a2-2 (logior v1-11 56))
(set! a2-2 (logior v1-11 7))
)
)
(let* ((v1-15 (rnd-bit this 6 a2-2))
(s5-1 (-> this draw art-group data (-> *juicer-global-info* blue-hit-anim v1-15)))
)
(set! (-> *juicer-global-info* prev-blue-hit) v1-15)
(let ((v1-18 (if (> (-> this skel active-channels) 0)
(-> this skel root-channel 0 frame-group)
)
)
)
(if (and v1-18 (= v1-18 (-> this draw art-group data 32)))
(ja-channel-push! 1 (seconds 0.17))
(ja-channel-push! 1 (seconds 0.02))
)
)
(let ((a0-32 (-> this skel root-channel 0)))
(set! (-> a0-32 frame-group) (the-as art-joint-anim s5-1))
(set! (-> a0-32 param 0) (the float (+ (-> (the-as art-joint-anim s5-1) frames num-frames) -1)))
(set! (-> a0-32 param 1) 1.0)
(set! (-> a0-32 frame-num) 0.0)
(joint-control-channel-group! a0-32 (the-as art-joint-anim s5-1) num-func-seek!)
)
)
)
(else
(let ((s4-1 (-> this draw art-group data (-> *juicer-global-info* knocked-anim (rnd-int-count this 2)))))
(ja-channel-push! 1 (seconds 0.17))
(let ((a0-37 (-> this skel root-channel 0)))
(set! (-> a0-37 frame-group) (the-as art-joint-anim s4-1))
(set! (-> a0-37 param 0) (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1)))
(set! (-> a0-37 param 1) (-> arg0 anim-speed))
(set! (-> a0-37 frame-num) 0.0)
(joint-control-channel-group! a0-37 (the-as art-joint-anim s4-1) num-func-seek!)
)
)
)
)
#t
)
;; definition for method 78 of type juicer
(defmethod enemy-method-78 ((this juicer) (arg0 enemy-knocked-info))
(cond
((= (-> this incoming knocked-type) (knocked-type knocked-type-6))
(when (>= (-> this incoming blue-juggle-count) (the-as uint 2))
(let ((s4-0 (-> this draw art-group data 32)))
(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 s4-0))
(set! (-> a0-3 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) 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 s4-0) num-func-seek!)
)
)
#t
)
)
((!= (-> this incoming knocked-type) (knocked-type knocked-type-4))
(let* ((v1-14 (if (> (-> this skel active-channels) 0)
(-> this skel root-channel 0 frame-group)
)
)
(s4-1 (if (and v1-14 (= v1-14 (-> this draw art-group data 18)))
(-> this draw art-group data 19)
(-> this draw art-group data 17)
)
)
)
(ja-channel-push! 1 (seconds 0.17))
(let ((a0-10 (-> this skel root-channel 0)))
(set! (-> a0-10 frame-group) (the-as art-joint-anim s4-1))
(set! (-> a0-10 param 0) (the float (+ (-> (the-as art-joint-anim s4-1) 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 s4-1) num-func-seek!)
)
)
#t
)
)
)
;; definition for method 184 of type juicer
;; WARN: Return type mismatch symbol vs none.
(defmethod juicer-method-184 ((this juicer) (arg0 symbol))
(let ((v1-1 (-> this root root-prim)))
(dotimes (a0-1 (the-as int (-> v1-1 specific 0)))
(let ((a2-1 (-> (the-as collide-shape-prim-group v1-1) child a0-1)))
(if arg0
(logior! (-> a2-1 prim-core action) (collide-action deadly))
(logclear! (-> a2-1 prim-core action) (collide-action deadly))
)
)
)
)
(none)
)
;; definition for method 63 of type juicer
;; WARN: Return type mismatch none vs symbol.
(defmethod enemy-method-63 ((this juicer) (arg0 process-focusable) (arg1 enemy-aware))
(let ((t9-0 (method-of-type nav-enemy enemy-method-63)))
(the-as symbol (if (t9-0 this arg0 arg1)
(set-dst-proc! (-> this los) (-> this focus handle))
)
)
)
)
;; definition for method 114 of type juicer
;; WARN: Return type mismatch int vs none.
(defmethod init-enemy-collision! ((this juicer))
"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
generic-attack
lunge
flop
punch
spin
roll
uppercut
bonk
tube
vehicle
flut-attack
board
mech-punch
dark-punch
dark-giant
)
)
(let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 6) 0)))
(set! (-> s5-0 total-prims) (the-as uint 7))
(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! (-> s4-0 transform-index) 21)
(set-vector! (-> s4-0 local-sphere) 0.0 0.0 -4096.0 18432.0)
(set! (-> s5-0 root-prim) s4-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 crate obstacle hit-by-others-list player-list)
)
(set! (-> v1-14 prim-core action) (collide-action solid no-standon))
(set-vector! (-> v1-14 local-sphere) 0.0 6144.0 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 jak bot player-list))
(set! (-> v1-16 prim-core action) (collide-action solid))
(set! (-> v1-16 transform-index) 6)
(set-vector! (-> v1-16 local-sphere) 0.0 0.0 0.0 6144.0)
)
(let ((v1-18 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-18 prim-core collide-as) (collide-spec enemy))
(set! (-> v1-18 prim-core collide-with) (collide-spec jak bot player-list))
(set! (-> v1-18 prim-core action) (collide-action solid))
(set! (-> v1-18 transform-index) 16)
(set-vector! (-> v1-18 local-sphere) 0.0 0.0 0.0 2048.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 solid))
(set! (-> v1-20 transform-index) 11)
(set-vector! (-> v1-20 local-sphere) 0.0 0.0 0.0 2048.0)
)
(let ((v1-22 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-22 prim-core collide-as) (collide-spec enemy))
(set! (-> v1-22 prim-core collide-with) (collide-spec jak bot player-list))
(set! (-> v1-22 prim-core action) (collide-action solid))
(set! (-> v1-22 transform-index) 34)
(set-vector! (-> v1-22 local-sphere) 0.0 0.0 0.0 2048.0)
)
(let ((v1-24 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-24 prim-core collide-as) (collide-spec enemy))
(set! (-> v1-24 prim-core collide-with) (collide-spec jak bot player-list))
(set! (-> v1-24 prim-core action) (collide-action solid))
(set! (-> v1-24 transform-index) 20)
(set-vector! (-> v1-24 local-sphere) 0.0 0.0 0.0 2048.0)
)
(set! (-> s5-0 nav-radius) 8192.0)
(let ((v1-26 (-> s5-0 root-prim)))
(set! (-> s5-0 backup-collide-as) (-> v1-26 prim-core collide-as))
(set! (-> s5-0 backup-collide-with) (-> v1-26 prim-core collide-with))
)
(set! (-> s5-0 max-iteration-count) (the-as uint 3))
(set! (-> this root) s5-0)
)
0
(none)
)
;; definition for method 7 of type juicer
(defmethod relocate ((this juicer) (offset int))
(if (nonzero? (-> this intro-path))
(&+! (-> this intro-path) offset)
)
(if (nonzero? (-> this joint))
(&+! (-> this joint) offset)
)
(call-parent-method this offset)
)
;; definition for method 115 of type juicer
;; WARN: Return type mismatch int vs none.
(defmethod init-enemy! ((this juicer))
"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-juicer" (the-as (pointer uint32) #f)))
(the-as pair 0)
)
(init-enemy-behaviour-and-stats! this *juicer-nav-enemy-info*)
(let ((v1-5 (-> this neck)))
(set! (-> v1-5 up) (the-as uint 1))
(set! (-> v1-5 nose) (the-as uint 2))
(set! (-> v1-5 ear) (the-as uint 0))
(set-vector! (-> v1-5 twist-max) 11832.889 11832.889 0.0 1.0)
(set! (-> v1-5 ignore-angle) 30947.555)
)
(let ((v1-7 (-> this nav)))
(set! (-> v1-7 speed-scale) 1.0)
)
0
(set-gravity-length (-> this root dynam) 573440.0)
(set! (-> this last-fire-time) 0)
(set! (-> this heading) (the-as basic (if (rand-vu-percent? 0.5)
#t
#f
)
)
)
(set! (-> this move-angle) 5461.3335)
(set! (-> this torso-track-player) #f)
(new-source! (-> this los) this (seconds 0.2) (collide-spec backgnd obstacle))
(set! (-> this joint) (new 'process 'joint-mod (joint-mod-mode joint-set*-world) this 5))
(set! (-> this using-turn-anim) #f)
(let ((v1-18 (new 'process 'path-control this 'intro 0.0 (the-as entity #f) #t)))
(set! (-> this intro-path) v1-18)
(if (nonzero? v1-18)
(logior! (-> v1-18 flags) (path-control-flag display draw-line draw-point draw-text))
)
)
(add-connection
*part-engine*
this
34
this
318
(new 'static 'vector :x 901.12 :y -1146.88 :z 1269.76 :w 163840.0)
)
(add-connection
*part-engine*
this
34
this
318
(new 'static 'vector :x -901.12 :y -1146.88 :z 1269.76 :w 163840.0)
)
(add-connection *part-engine* this 20 this 4635 (new 'static 'vector :w 163840.0))
(set! (-> this root pause-adjust-distance) 81920.0)
(set! (-> this current-projectile) (the-as handle #f))
0
(none)
)