Files
jak-project/test/decompiler/reference/jak2/levels/mountain/rhino_REF.gc
T
water111 637990314b wip: better stack var support (#4222)
Closes #736

---------

Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
2026-04-19 00:14:44 +02:00

1902 lines
61 KiB
Common Lisp
Vendored
Generated

;;-*-Lisp-*-
(in-package goal)
;; failed to figure out what this is:
(defpartgroup group-rhino-slide-poof-pmt
:id 350
:duration (seconds 0.035)
:linger-duration (seconds 1.5)
:bounds (static-bspherem 0 0 0 2)
:parts ((sp-item 1488))
)
;; failed to figure out what this is:
(defpart 1488
:init-specs ((:texture (bigpuff effects))
(:num 6.0 6.0)
(:scale-x (meters 1) (meters 1))
(:rot-z (degrees 0) (degrees 360))
(:scale-y :copy scale-x)
(:r 128.0 64.0)
(:g 70.0 32.0)
(:b 40.0 20.0)
(:a 16.0 16.0)
(:vel-y (meters 0.02) (meters 0.01))
(:scalevel-x (meters 0.01) (meters 0.0033333334))
(:rotvel-z (degrees -0.2) (degrees 0.4))
(:scalevel-y :copy scalevel-x)
(:fade-a -0.07111111 -0.07111111)
(:accel-y (meters -0.00006666667))
(:friction 0.94)
(:timer (seconds 1.5))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-12 sp-cpuinfo-flag-14))
(:conerot-x (degrees 60) (degrees 30))
(:conerot-y (degrees 0) (degrees 360))
)
)
;; failed to figure out what this is:
(defpartgroup group-rhino-slide-poof-grs
:id 351
:duration (seconds 0.035)
:linger-duration (seconds 1.5)
:bounds (static-bspherem 0 0 0 2)
:parts ((sp-item 1489) (sp-item 1490))
)
;; failed to figure out what this is:
(defpart 1489
:init-specs ((:texture (bigpuff effects))
(:num 6.0 6.0)
(:scale-x (meters 1) (meters 1))
(:rot-z (degrees 0) (degrees 360))
(:scale-y :copy scale-x)
(:r 96.0 32.0)
(:g 128.0 32.0)
(:b 0.0 64.0)
(:a 16.0 16.0)
(:vel-y (meters 0.02) (meters 0.01))
(:scalevel-x (meters 0.01) (meters 0.0033333334))
(:rotvel-z (degrees -0.2) (degrees 0.4))
(:scalevel-y :copy scalevel-x)
(:fade-a -0.07111111 -0.07111111)
(:accel-y (meters -0.00006666667))
(:friction 0.94)
(:timer (seconds 1.5))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-12 sp-cpuinfo-flag-14))
(:conerot-x (degrees 60) (degrees 30))
(:conerot-y (degrees 0) (degrees 360))
)
)
;; failed to figure out what this is:
(defpart 1490
:init-specs ((:texture (woodchip effects))
(:num 0.0 8.0)
(:x (meters -0.4) (meters 0.8))
(:y (meters -0.1) (meters 0.4))
(:z (meters -0.4) (meters 0.8))
(:scale-x (meters 0.15) (meters 0.35))
(:rot-z (degrees 0) (degrees 360))
(:scale-y (meters 0.15))
(:r 128.0 2.0 64.0)
(:g 255.0 0 1.0)
(:a 128.0 64.0)
(:vel-y (meters 0.015) (meters 0.01))
(:rotvel-z (degrees -2.4) (degrees 4.8))
(:fade-a -0.42666668)
(:accel-y (meters -0.001) (meters 0.0005))
(:timer (seconds 1))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-12 sp-cpuinfo-flag-14))
(:conerot-x (degrees 30) (degrees 50.000004))
(:conerot-y (degrees 0) (degrees 360))
(:conerot-radius (meters 0.5))
)
)
;; failed to figure out what this is:
(defskelgroup skel-rhino rhino rhino-lod0-jg -1
((rhino-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 1 7)
:shadow rhino-shadow-mg
:origin-joint-index 16
)
;; definition of type rhino
(deftype rhino (nav-enemy)
((wall rhino-wall)
(path-intro path-control)
(charge-aware uint64)
(anim-skid-left int32)
(anim-skid-right int32)
(anim-victory-hit int32)
(circle-backward? symbol)
(skid-speed float :offset 672)
(angle float)
(angle-speed float)
(dest vector :inline)
(charge-straight symbol)
(in-stop-run symbol)
(smush-target smush-control)
(num-hit-flinch int32)
(frame-die-smush float)
(quat quaternion :inline)
(can-hit? symbol)
(interest int32)
(victory-count uint32)
(stomach-touched-once? symbol)
)
(:state-methods
attack
stop-run
run-away
charge
)
(:methods
(hit-stomach? (_type_ process event-message-block) symbol)
)
)
;; definition for method 3 of type rhino
;; ERROR: failed type prop at 48: Could not figure out load: (set! a2 (l.wu (+ gp 636)))
(defmethod inspect ((a0-0 rhino))
(local-vars
(v0-0 nav-enemy)
(v0-1 object)
(v0-2 object)
(v0-3 object)
(v0-4 object)
(v0-5 object)
(v0-6 object)
(v0-7 object)
(v0-8 none)
(v0-9 none)
(v0-10 none)
(v0-11 none)
(v0-12 none)
(v0-13 none)
(v0-14 none)
(v0-15 none)
(v0-16 none)
(v0-17 none)
(v0-18 none)
(v0-19 none)
(v0-20 none)
(v0-21 none)
(v0-22 none)
(v0-23 none)
(v0-24 rhino)
(v1-2 type)
(a0-1 rhino)
(a0-2 symbol)
(a0-3 symbol)
(a0-4 symbol)
(a0-5 symbol)
(a0-6 symbol)
(a0-7 symbol)
(a0-8 symbol)
(a0-9 symbol)
(a0-10 none)
(a0-11 none)
(a0-12 none)
(a0-13 none)
(a0-14 none)
(a0-15 none)
(a0-16 none)
(a0-17 none)
(a0-18 none)
(a0-19 none)
(a0-20 none)
(a0-21 none)
(a0-22 none)
(a0-23 none)
(a0-24 none)
(a1-0 string)
(a1-1 string)
(a1-2 string)
(a1-3 string)
(a1-4 string)
(a1-5 string)
(a1-6 string)
(a1-7 string)
(a1-8 none)
(a1-9 none)
(a1-10 none)
(a1-11 none)
(a1-12 none)
(a1-13 none)
(a1-14 none)
(a1-15 none)
(a1-16 none)
(a1-17 none)
(a1-18 none)
(a1-19 none)
(a1-20 none)
(a1-21 none)
(a1-22 none)
(a2-0 rhino-wall)
(a2-1 path-control)
(a2-2 uint)
(a2-3 int)
(a2-4 int)
(a2-5 int)
(a2-6 degrees)
(a2-7 none)
(a2-8 none)
(a2-12 none)
(a2-13 none)
(a2-14 none)
(a2-15 none)
(a2-16 none)
(a2-18 none)
(a2-19 none)
(a2-20 none)
(a2-21 none)
(a2-22 none)
(t9-0 (function nav-enemy nav-enemy))
(t9-1 (function _varargs_ object))
(t9-2 (function _varargs_ object))
(t9-3 (function _varargs_ object))
(t9-4 (function _varargs_ object))
(t9-5 (function _varargs_ object))
(t9-6 (function _varargs_ object))
(t9-7 (function _varargs_ object))
(t9-8 (function _varargs_ object))
(t9-9 none)
(t9-10 none)
(t9-11 none)
(t9-12 none)
(t9-13 none)
(t9-14 none)
(t9-15 none)
(t9-16 none)
(t9-17 none)
(t9-18 none)
(t9-19 none)
(t9-20 none)
(t9-21 none)
(t9-22 none)
(t9-23 none)
(f0-0 degrees)
(f0-1 none)
(f0-2 none)
(f0-3 none)
(f0-4 none)
)
(if (begin (not a0-0))
(begin (set! a0-0 a0-0) (goto cfg-4))
)
(set! v1-2 nav-enemy)
(set! t9-0 (method-of-type v1-2 inspect))
(set! a0-1 a0-0)
(call! a0-1)
(set! t9-1 format)
(set! a0-2 #t)
(set! a1-0 L303)
(set! a2-0 (-> a0-0 wall))
(call! a0-2 a1-0 a2-0)
(set! t9-2 format)
(set! a0-3 #t)
(set! a1-1 L302)
(set! a2-1 (-> a0-0 path-intro))
(call! a0-3 a1-1 a2-1)
(set! t9-3 format)
(set! a0-4 #t)
(set! a1-2 L301)
(set! a2-2 (-> a0-0 charge-aware))
(call! a0-4 a1-2 a2-2)
(set! t9-4 format)
(set! a0-5 #t)
(set! a1-3 L300)
(set! a2-3 (-> a0-0 anim-skid-left))
(call! a0-5 a1-3 a2-3)
(set! t9-5 format)
(set! a0-6 #t)
(set! a1-4 L299)
(set! a2-4 (-> a0-0 anim-skid-right))
(call! a0-6 a1-4 a2-4)
(set! t9-6 format)
(set! a0-7 #t)
(set! a1-5 L298)
(set! a2-5 (-> a0-0 anim-victory-hit))
(call! a0-7 a1-5 a2-5)
(set! t9-7 format)
(set! a0-8 #t)
(set! a1-6 L297)
(set! f0-0 (-> a0-0 desired-angle))
(set! a2-6 (fpr->gpr f0-0))
(call! a0-8 a1-6 a2-6)
(set! t9-8 format)
(set! a0-9 #t)
(set! a1-7 L296)
(set! a2-7 (the-as none (l.wu (+ a0-0 636))))
(call!)
(set! t9-9 (the-as none format))
(set! a0-10 (the-as none #t))
(set! a1-8 (the-as none L295))
(set! a2-8 (the-as none (-> a0-0 focus-pos)))
(call!)
(set! t9-10 (the-as none format))
(set! a0-11 (the-as none #t))
(set! a1-9 (the-as none L294))
(set! f0-1 (the-as none (-> a0-0 skid-speed)))
(set! a2-9 (the-as none (fpr->gpr f0-1)))
(call!)
(set! t9-11 (the-as none format))
(set! a0-12 (the-as none #t))
(set! a1-10 (the-as none L293))
(set! f0-2 (the-as none (-> a0-0 angle)))
(set! a2-10 (the-as none (fpr->gpr f0-2)))
(call!)
(set! t9-12 (the-as none format))
(set! a0-13 (the-as none #t))
(set! a1-11 (the-as none L292))
(set! f0-3 (the-as none (-> a0-0 angle-speed)))
(set! a2-11 (the-as none (fpr->gpr f0-3)))
(call!)
(set! t9-13 (the-as none format))
(set! a0-14 (the-as none #t))
(set! a1-12 (the-as none L291))
(set! a2-12 (the-as none (-> a0-0 dest)))
(call!)
(set! t9-14 (the-as none format))
(set! a0-15 (the-as none #t))
(set! a1-13 (the-as none L290))
(set! a2-13 (the-as none (-> a0-0 charge-straight)))
(call!)
(set! t9-15 (the-as none format))
(set! a0-16 (the-as none #t))
(set! a1-14 (the-as none L289))
(set! a2-14 (the-as none (-> a0-0 in-stop-run)))
(call!)
(set! t9-16 (the-as none format))
(set! a0-17 (the-as none #t))
(set! a1-15 (the-as none L288))
(set! a2-15 (the-as none (-> a0-0 smush-target)))
(call!)
(set! t9-17 (the-as none format))
(set! a0-18 (the-as none #t))
(set! a1-16 (the-as none L287))
(set! a2-16 (the-as none (-> a0-0 num-hit-flinch)))
(call!)
(set! t9-18 (the-as none format))
(set! a0-19 (the-as none #t))
(set! a1-17 (the-as none L286))
(set! f0-4 (the-as none (-> a0-0 frame-die-smush)))
(set! a2-17 (the-as none (fpr->gpr f0-4)))
(call!)
(set! t9-19 (the-as none format))
(set! a0-20 (the-as none #t))
(set! a1-18 (the-as none L285))
(set! a2-18 (the-as none (-> a0-0 quat)))
(call!)
(set! t9-20 (the-as none format))
(set! a0-21 (the-as none #t))
(set! a1-19 (the-as none L284))
(set! a2-19 (the-as none (-> a0-0 can-hit?)))
(call!)
(set! t9-21 (the-as none format))
(set! a0-22 (the-as none #t))
(set! a1-20 (the-as none L283))
(set! a2-20 (the-as none (-> a0-0 interest)))
(call!)
(set! t9-22 (the-as none format))
(set! a0-23 (the-as none #t))
(set! a1-21 (the-as none L282))
(set! a2-21 (the-as none (-> a0-0 victory-count)))
(call!)
(set! t9-23 (the-as none format))
(set! a0-24 (the-as none #t))
(set! a1-22 (the-as none L281))
(set! a2-22 (the-as none (-> a0-0 stomach-touched-once?)))
(call!)
(label cfg-4)
(set! v0-24 a0-0)
(ret-value v0-24)
)
;; definition for symbol *rhino-nav-enemy-info*, type nav-enemy-info
(define *rhino-nav-enemy-info*
(new 'static 'nav-enemy-info
:use-die-falling #f
:use-victory #t
:use-jump-blocked #f
: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 8
(new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e)
(new 'static 'idle-control-frame :command (ic-cmd play) :anim #x3 :param0 #x1 :param1 #x4)
(new 'static 'idle-control-frame :command (ic-cmd push) :param0 #x1e)
(new 'static 'idle-control-frame :command (ic-cmd play) :anim #x4 :param0 #x1 :param1 #x4)
(new 'static 'idle-control-frame)
(new 'static 'idle-control-frame)
(new 'static 'idle-control-frame)
(new 'static 'idle-control-frame)
)
:idle-anim 3
:notice-anim 7
:hostile-anim 10
:hit-anim 23
:knocked-anim -1
:knocked-land-anim -1
:die-anim 14
:die-falling-anim 14
:victory-anim 11
:jump-wind-up-anim -1
:jump-in-air-anim -1
:jump-land-anim -1
:neck-joint 5
:look-at-joint 6
:bullseye-joint 4
:sound-hit (static-sound-name "rhino-hit")
:sound-die (static-sound-name "rhino-die")
:notice-distance (meters 40)
:notice-distance-delta (meters 10)
:proximity-notice-distance (meters 2)
:default-hit-points 35
:gnd-collide-with (collide-spec backgnd)
:overlaps-others-collide-with-filter (collide-spec jak bot player-list)
:penetrate-flinch (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
jak-yellow-shot
jak-red-shot
jak-blue-shot
enemy-yellow-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.8
:attack-shove-back (meters 4)
:attack-shove-up (meters 4)
:attack-mode 'generic
: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 2730.6667
:knocked-soft-vxz-lo 72089.6
:knocked-soft-vxz-hi 108134.4
:knocked-soft-vy-lo 81920.0
:knocked-soft-vy-hi 122880.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 78643.2
:knocked-hard-vxz-hi 117964.8
:knocked-hard-vy-lo 183500.8
:knocked-hard-vy-hi 209715.2
: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 196608.0
:knocked-red-vy-lo 94208.0
:knocked-red-vy-hi 151552.0
:knocked-blue-vxz-lo 40960.0
:knocked-blue-vxz-hi 49152.0
:knocked-blue-vy-lo 24576.0
:knocked-blue-vy-hi 81920.0
:shadow-size (meters 2)
:shadow-max-y (meters 1)
:shadow-min-y (meters -1)
:shadow-locus-dist (meters 150)
:gem-joint 6
:gem-seg #x2
:gem-no-seg #x4
:gem-offset (new 'static 'sphere :y 2170.88 :z 1761.28 :r 163840.0)
:callback-info #f
:use-momentum #t
:use-frustration #t
:use-stop-chase #f
:use-circling #f
:use-pacing #f
:walk-anim 6
:turn-anim -1
:run-anim 10
:taunt-anim -1
:run-travel-speed (meters 14)
:run-acceleration (meters 40)
:run-turning-acceleration (meters 26)
:walk-travel-speed (meters 1)
:walk-acceleration (meters 1)
:walk-turning-acceleration (meters 3)
:maximum-rotation-rate (degrees 180)
:notice-nav-radius (meters 4)
: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! (-> *rhino-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*)
;; definition for method 182 of type rhino
(defmethod hit-stomach? ((this rhino) (arg0 process) (arg1 event-message-block))
(let ((gp-0 (-> arg1 param 0))
(s2-0 (the-as process (as-type arg0 process-drawable)))
)
(cond
((and (-> this can-hit?) gp-0 ((method-of-type touching-shapes-entry prims-touching?)
(the-as touching-shapes-entry gp-0)
(-> this root)
(the-as uint 1)
)
)
(let ((s4-0 (new 'stack-no-clear 'vector))
(gp-1 (new 'stack-no-clear 'vector))
(s5-1 (new 'stack-no-clear 'vector))
)
(vector-z-quaternion! s4-0 (-> this root quat))
(vector-x-quaternion! gp-1 (-> this root quat))
(vector-! s5-1 (-> (the-as process-drawable s2-0) root trans) (-> this root trans))
(if (and (< 0.0 (vector-dot s5-1 s4-0)) (< (fabs (vector-dot s5-1 gp-1)) 10240.0))
#t
#f
)
)
)
(else
#f
)
)
)
)
;; definition for method 58 of type rhino
(defmethod enemy-method-58 ((this rhino) (arg0 process) (arg1 event-message-block))
(let ((t9-0 (method-of-type nav-enemy enemy-method-58)))
(t9-0 this arg0 arg1)
)
(if (hit-stomach? this arg0 arg1)
'hit
'hit-flinch
)
)
;; definition for method 74 of type rhino
;; INFO: Used lq/sq
(defmethod general-event-handler ((this rhino) (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
(('charge)
(if (-> this wall)
(go (method-of-object this charge))
)
)
(('hit)
(cond
((zero? (-> this hit-points))
(set! (-> *rhino-nav-enemy-info* die-anim) 15)
(set! (-> this frame-die-smush) 11.0)
(kill-prefer-falling this)
)
(else
((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3)
)
)
)
(('hit-flinch)
(cond
((zero? (-> this hit-points))
(set! (-> *rhino-nav-enemy-info* die-anim) 14)
(set! (-> this frame-die-smush) 16.0)
(kill-prefer-falling this)
)
(else
(let ((s2-0 (the-as process (as-type arg0 process-drawable)))
(s3-0 (new 'stack-no-clear 'vector))
(s4-0 (new 'stack-no-clear 'vector))
(s5-1 (new 'stack-no-clear 'vector))
)
(vector-z-quaternion! s3-0 (-> this root quat))
(vector-x-quaternion! s4-0 (-> this root quat))
(vector-! s5-1 (-> (the-as process-focusable s2-0) root trans) (-> this root trans))
(set! (-> s5-1 y) 0.0)
(vector-normalize! s5-1 1.0)
(let* ((f30-0 (vector-dot s3-0 s5-1))
(f28-0 (vector-dot s4-0 s5-1))
(a0-16 (cond
((>= f30-0 (cos 8192.0))
(-> this draw art-group data 16)
)
((>= (cos 24576.0) f30-0)
(-> this draw art-group data 19)
)
((>= f28-0 (cos 8192.0))
(-> this draw art-group data 17)
)
((>= (cos 24576.0) f28-0)
(-> this draw art-group data 18)
)
(else
(-> this draw art-group data 16)
)
)
)
(v0-9 (ja-channel-float! (the-as art-joint-anim a0-16) 0.0 0.0 0.0))
)
(when v0-9
(set! (-> this skel interp-select 0) (the-as int (the-as uint #x1c9002228)))
(set! (-> this skel interp-select 1) 0)
(set! (-> v0-9 param 0) 1.0)
(set! (-> v0-9 param 1) 1.0)
(set! (-> v0-9 param 2) 3.0)
(set! (-> v0-9 num-func) num-func-interp1-play!)
)
)
)
(+! (-> this num-hit-flinch) 1)
'back
)
)
)
(('event-slide-poof)
(let ((s5-2 (-> arg3 param 1)))
(if (= (-> this root ground-pat material) (pat-material grass))
(part-tracker-spawn
:to this
:group group-rhino-slide-poof-grs
:callback (the-as symbol #f)
:userdata (the-as symbol #f)
:target (the-as symbol #f)
:mat-joint (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data s5-2))
)
(part-tracker-spawn
:to this
:group group-rhino-slide-poof-pmt
:callback (the-as symbol #f)
:userdata (the-as symbol #f)
:target (the-as symbol #f)
:mat-joint (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data s5-2))
)
)
)
)
(('interesting)
(+! (-> this interest) 1)
(let ((v1-67 (process->ppointer this)))
(set-setting! 'handle-of-interest v1-67 0.0 (-> v1-67 0 pid))
)
)
(('uninteresting)
(+! (-> this interest) -1)
(when (<= (-> this interest) 0)
(set! (-> this interest) 0)
(remove-setting! 'handle-of-interest)
)
)
(('death-end)
(let ((v1-74 (-> this root root-prim)))
(set! (-> v1-74 prim-core collide-as) (collide-spec))
(set! (-> v1-74 prim-core collide-with) (collide-spec))
)
0
((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 idle (rhino)
:virtual #t
:enter (behavior ()
(remove-setting! 'sound-mode)
(remove-setting! 'sound-excitement)
(set! (-> self interest) 0)
(let ((t9-2 (-> (method-of-type nav-enemy idle) enter)))
(if t9-2
(t9-2)
)
)
(logclear! (-> self enemy-flags) (enemy-flag vulnerable))
)
:exit (behavior ()
(local-vars (v0-1 enemy-flag))
(let ((t9-0 (-> (method-of-type nav-enemy idle) exit)))
(if t9-0
(t9-0)
)
)
(let ((v1-4 (-> self enemy-flags)))
(if (logtest? v1-4 (enemy-flag vulnerable-backup))
(set! v0-1 (logior v1-4 (enemy-flag vulnerable)))
(set! v0-1 (logclear v1-4 (enemy-flag vulnerable)))
)
)
(set! (-> self enemy-flags) v0-1)
)
:trans (behavior ()
(cond
((-> self wall)
(debug-draw (-> self path-intro))
(when (and (>= (the-as int (-> self focus aware)) (the-as int (-> self charge-aware)))
*target*
(and (>= 122880.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))
(not (logtest? (focus-status teleporting) (-> *target* focus-status)))
)
)
(process-entity-status! self (entity-perm-status subtask-complete) #t)
(go-virtual charge)
)
)
(else
(if (and (time-elapsed? (-> self state-time) (-> self state-timeout)) (> (the-as int (-> self focus aware)) 0))
(go-virtual active)
)
)
)
)
)
;; failed to figure out what this is:
(defstate die (rhino)
:virtual #t
:enter (behavior ()
(remove-setting! 'sound-mode)
(dying self)
(set! (-> self hit-points) 0)
0
)
:code (behavior ()
(set! (-> self smush-target) (the-as smush-control #t))
(ja-channel-push! 1 (seconds 0.075))
(let ((f30-0 (rnd-float-range self 0.8 1.2))
(gp-0 #t)
)
(ja-no-eval :group! (-> self draw art-group data (-> self enemy-info die-anim))
:num! (seek! max f30-0)
:frame-num 0.0
)
(until (ja-done? 0)
(when (and gp-0 (>= (ja-frame-num 0) (-> self frame-die-smush)))
(activate! *camera-smush-control* 819.2 37 600 1.0 0.1 (-> self clock))
(cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.5))
(set! gp-0 #f)
)
(suspend)
(ja :num! (seek! max f30-0))
)
)
(send-event self 'death-end)
(while (-> self child)
(suspend)
)
(cleanup-for-death self)
)
)
;; failed to figure out what this is:
(defstate hit (rhino)
:virtual #t
:code (behavior ()
(local-vars (v1-67 enemy-flag) (v1-75 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))
)
(let ((gp-0 #t))
(ja-no-eval :group! rhino-victory-hit2-ja :num! (seek! max f30-0) :frame-num 0.0)
(until (ja-done? 0)
(when (and gp-0 (>= (ja-frame-num 0) 5.0))
(activate! *camera-smush-control* 819.2 37 600 1.0 0.1 (-> self clock))
(cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.5))
(set! gp-0 #f)
)
(suspend)
(ja :num! (seek! max f30-0))
)
)
)
(ja-channel-push! 1 (seconds 0.075))
(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-66 (-> self enemy-flags)))
(if (logtest? v1-66 (enemy-flag vulnerable-backup))
(set! v1-67 (logior v1-66 (enemy-flag vulnerable)))
(set! v1-67 (logclear v1-66 (enemy-flag vulnerable)))
)
)
(set! (-> self enemy-flags) v1-67)
(if (logtest? (-> self enemy-flags) (enemy-flag attackable-backup))
(logior! (-> self mask) (process-mask collectable))
(logclear! (-> self mask) (process-mask collectable))
)
(let ((v1-74 (-> self enemy-flags)))
(if (logtest? (enemy-flag trackable-backup) v1-74)
(set! v1-75 (logior (enemy-flag trackable) v1-74))
(set! v1-75 (logclear v1-74 (enemy-flag trackable)))
)
)
(set! (-> self enemy-flags) v1-75)
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(logclear! (-> self focus-status) (focus-status hit))
(go-hostile self)
)
)
;; definition for method 56 of type rhino
(defmethod damage-amount-from-attack ((this rhino) (arg0 process) (arg1 event-message-block))
"@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]"
(-> arg1 param 1)
(let ((f30-0 (the float (penetrate-using->damage (-> this incoming penetrate-using)))))
(cond
((hit-stomach? this arg0 arg1)
(set! (-> this stomach-touched-once?) #t)
(the int (* 4.0 f30-0))
)
((logtest? (penetrate dark-bomb dark-giant) (-> this incoming penetrate-using))
(if (and (logtest? (penetrate dark-bomb) (-> this incoming penetrate-using))
(logtest? (penetrate dark-giant) (-> this incoming penetrate-using))
)
#x420c0000
(the int (* 1.8 f30-0))
)
)
((logtest? (penetrate dark-punch) (-> this incoming penetrate-using))
(the int (* 2.0 f30-0))
)
(else
(the int (/ f30-0 2))
)
)
)
)
;; definition for method 75 of type rhino
;; WARN: Return type mismatch symbol vs object.
(defmethod enemy-method-75 ((this rhino) (arg0 process) (arg1 event-message-block))
(let ((touch-entry (the-as touching-shapes-entry (-> arg1 param 0)))
(v1-0 (the-as object (as-type arg0 process-focusable)))
)
(when (and (the-as uint touch-entry) v1-0)
(cond
((and (focus-test? this dangerous) ((method-of-type touching-shapes-entry prims-touching-action?)
touch-entry
(-> this root)
(collide-action deadly)
(collide-action)
)
)
(let ((a3-2 (if ((method-of-type touching-shapes-entry prims-touching-action?)
touch-entry
(-> this root)
(collide-action persistent-attack)
(collide-action)
)
(-> this persistent-attack-id)
(-> this attack-id)
)
)
)
(enemy-method-104 this arg0 touch-entry a3-2)
)
)
(((method-of-type touching-shapes-entry prims-touching-action?)
touch-entry
(-> this root)
(collide-action no-standon)
(collide-action)
)
(send-shoves (-> this root) arg0 touch-entry 0.7 6144.0 16384.0)
)
)
)
)
)
;; definition for method 104 of type rhino
;; INFO: Used lq/sq
(defmethod enemy-method-104 ((this rhino) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint))
(if (and (-> this next-state) (= (-> this next-state name) 'victory))
'attack-or-shove
'attack
)
(let ((s2-0 (if (-> this smush-target)
'smush
(-> this enemy-info attack-mode)
)
)
(a0-3 (the-as process (as-type arg0 process-focusable)))
(s1-1 (new 'stack-no-clear 'vector))
)
(vector-! s1-1 (get-trans (the-as process-focusable a0-3) 0) (-> this root trans))
(set! (-> s1-1 y) 0.0)
(vector-normalize! s1-1 1.0)
(vector+float*! s1-1 s1-1 (-> this root transv) 0.5)
(set! (-> s1-1 y) 20480.0)
(when (send-event arg0 'attack arg1 (static-attack-info ((id arg2) (angle 'front) (vector s1-1) (mode s2-0))))
(enemy-method-105 this arg0)
#t
)
)
)
;; failed to figure out what this is:
(defstate active (rhino)
:virtual #t
:enter (behavior ()
(let ((t9-0 (-> (method-of-type nav-enemy active) enter)))
(if t9-0
(t9-0)
)
)
)
)
;; failed to figure out what this is:
(defstate notice (rhino)
:virtual #t
:enter (behavior ()
(let ((t9-0 (-> (method-of-type nav-enemy notice) enter)))
(if t9-0
(t9-0)
)
)
)
)
;; failed to figure out what this is:
(defstate victory (rhino)
:virtual #t
:enter (behavior ()
(let ((t9-0 (-> (method-of-type nav-enemy victory) enter)))
(if t9-0
(t9-0)
)
)
(set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 1 prim-core collide-as)
(collide-spec)
)
(set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 1 prim-core collide-with)
(collide-spec)
)
(set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 1 prim-core action)
(collide-action deadly)
)
(set! (-> self can-hit?) #t)
(let ((v1-13 (-> self nav state)))
(set! (-> v1-13 speed) 0.0)
)
0
(+! (-> self victory-count) 1)
(if (and (= (-> self victory-count) 3) (not (-> self stomach-touched-once?)))
(talker-spawn-func (-> *talker-speech* 59) *entity-pool* (target-pos 0) (the-as region #f))
)
)
:exit (behavior ()
(set! (-> self can-hit?) #f)
(set! (-> self smush-target) #f)
(let ((t9-0 (-> (method-of-type nav-enemy victory) exit)))
(if t9-0
(t9-0)
)
)
(set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 1 prim-core collide-as)
(collide-spec)
)
(set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 1 prim-core collide-with)
(collide-spec)
)
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.075))
(ja-no-eval :group! rhino-victory-begin-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 1 prim-core collide-as)
(collide-spec enemy)
)
(set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 1 prim-core collide-with)
(collide-spec jak bot player-list)
)
(set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 1 prim-core action)
(collide-action solid no-standon)
)
(until #f
(ja-no-eval :group! rhino-victory-loop-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(let ((gp-0 (handle->process (-> self focus handle))))
(cond
(gp-0
(if (or (< 10240.0 (vector-vector-xz-distance (get-trans (the-as process-focusable gp-0) 0) (-> self root trans)))
(and gp-0
(not (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status disable dead ignore grabbed)))
)
)
(goto cfg-25)
)
)
(else
(goto cfg-25)
)
)
)
)
#f
(label cfg-25)
(set! (-> self can-hit?) #f)
(set! (-> self smush-target) (the-as smush-control #t))
(let* ((v1-68 *game-info*)
(a0-24 (+ (-> v1-68 attack-id) 1))
)
(set! (-> v1-68 attack-id) a0-24)
(set! (-> self attack-id) a0-24)
)
(set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 1 prim-core action)
(collide-action deadly)
)
(logior! (-> self focus-status) (focus-status dangerous))
(let* ((v1-72 *game-info*)
(a0-29 (+ (-> v1-72 attack-id) 1))
)
(set! (-> v1-72 attack-id) a0-29)
(set! (-> self attack-id) a0-29)
)
(let ((gp-1 #t))
(ja-no-eval :group! rhino-victory-end-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(when (and gp-1 (>= (ja-frame-num 0) 12.0))
(activate! *camera-smush-control* 819.2 37 600 1.0 0.1 (-> self clock))
(cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.5))
(set! gp-1 #f)
)
(suspend)
(ja :num! (seek!))
)
)
(let ((a0-37 (handle->process (-> self focus handle))))
(cond
(a0-37
(cond
((< 22528.0 (vector-vector-xz-distance (get-trans (the-as process-focusable a0-37) 0) (-> self root trans)))
(ja-channel-push! 1 (seconds 0.075))
(react-to-focus self)
)
(else
(go-virtual run-away)
)
)
)
(else
(ja-channel-push! 1 (seconds 0.075))
(react-to-focus self)
)
)
)
)
)
;; failed to figure out what this is:
(defstate run-away (rhino)
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(set-time! (-> self state-time))
(nav-enemy-method-166 self)
(let ((v1-4 self))
(if (not (logtest? (enemy-flag enemy-flag36) (-> v1-4 enemy-flags)))
(set! (-> v1-4 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-4 enemy-flags))))
)
(set! (-> v1-4 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag36) (-> v1-4 enemy-flags))))
(set! (-> v1-4 nav callback-info) (-> v1-4 enemy-info callback-info))
)
0
(let ((v1-7 self))
(set! (-> v1-7 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-7 enemy-flags))))
)
0
(set! (-> self root penetrate-using) (penetrate generic-attack lunge))
(enemy-method-49 self)
(let ((s5-0 (-> self path curve num-cverts)))
(if (<= s5-0 0)
(go process-drawable-art-error "no path")
)
0
(let ((f30-0 0.0)
(s4-0 (new 'stack-no-clear 'vector))
(gp-0 (new 'stack-no-clear 'vector))
)
(dotimes (s3-0 s5-0)
(get-point-in-path! (-> self path) s4-0 (the float s3-0) 'interp)
(let ((f0-2 (vector-vector-xz-distance s4-0 (-> self root trans))))
(when (< f30-0 f0-2)
(set! f30-0 f0-2)
(set! (-> gp-0 quad) (-> s4-0 quad))
)
)
)
(let ((v1-25 (-> self nav state)))
(logclear! (-> v1-25 flags) (nav-state-flag directional-mode))
(logior! (-> v1-25 flags) (nav-state-flag target-poly-dirty))
(set! (-> v1-25 target-post quad) (-> gp-0 quad))
)
)
)
0
)
:trans (behavior ()
(if (time-elapsed? (-> self state-time) (seconds 1.5))
(go-virtual active)
)
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.05))
(until #f
(ja-no-eval :group! rhino-charge-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(suspend)
)
#f
)
:post (behavior ()
(nav-enemy-travel-post)
)
)
;; failed to figure out what this is:
(defstate hostile (rhino)
:virtual #t
:enter (behavior ()
(set-setting! 'sound-mode #f 0.0 1)
(set-setting! 'sound-excitement 'abs 0.0 0)
(let ((t9-2 (-> (method-of-type nav-enemy hostile) enter)))
(if t9-2
(t9-2)
)
)
(set! (-> self charge-straight) #f)
(nav-enemy-method-166 self)
(set-time! (-> self state-time))
(logclear! (-> self enemy-flags) (enemy-flag victory))
)
:trans (behavior ()
(let ((t9-0 (-> (method-of-type nav-enemy hostile) trans)))
(if t9-0
(t9-0)
)
)
(let ((s3-0 (handle->process (-> self focus handle))))
(when s3-0
(let ((s2-0 (get-trans (the-as process-focusable s3-0) 0))
(s5-0 (new 'stack-no-clear 'vector))
(s1-0 (new 'stack-no-clear 'vector))
(s4-0 (new 'stack-no-clear 'vector))
(gp-0 (new 'stack-no-clear 'vector))
)
0.0
0.0
(vector-z-quaternion! s5-0 (-> self root quat))
(vector-! s1-0 s2-0 (-> self root trans))
(let ((f28-0 (vector-dot s1-0 s5-0)))
(vector-normalize! s1-0 1.0)
(let ((f30-0 (vector-dot s1-0 s5-0)))
(vector-! gp-0 s2-0 (-> self root trans))
(vector-normalize! gp-0 (+ 16384.0 (vector-length gp-0)))
(vector+! s4-0 (-> self root trans) gp-0)
(when (time-elapsed? (-> self state-time) (-> self reaction-time))
(if (and (< (vector-vector-xz-distance (get-trans (the-as process-focusable s3-0) 0) (-> self root trans)) 40960.0)
(< 0.9 f30-0)
)
(set! (-> self charge-straight) #t)
)
)
(cond
((-> self charge-straight)
(cond
((time-elapsed? (-> self state-time) (-> self reaction-time))
(if (< (vector-vector-xz-distance (get-trans (the-as process-focusable s3-0) 0) (-> self root trans)) 20480.0)
(go-virtual attack)
)
(when (and (< f30-0 0.7) (>= 9.0 (ja-frame-num 0)))
(set! (-> self charge-straight) #f)
(go-virtual stop-run)
)
)
(else
(set! (-> self dest quad) (-> s4-0 quad))
)
)
)
((and (< f28-0 8192.0) (and (time-elapsed? (-> self state-time) (seconds 2)) (>= 9.0 (ja-frame-num 0))))
(go-virtual stop-run)
)
(else
(set! (-> self dest quad) (-> s4-0 quad))
)
)
)
)
(vector-float*! gp-0 s5-0 40960.0)
(let* ((s5-1 (-> self nav))
(v1-67 s5-1)
(a0-31 (-> self root trans))
(a1-12 (new 'stack-no-clear 'nav-find-poly-parms))
)
(vector-! (-> a1-12 point) a0-31 (-> v1-67 state mesh bounds))
(set! (-> a1-12 y-threshold) (-> v1-67 nearest-y-threshold))
(set! (-> a1-12 ignore) (the-as uint 2))
(let ((s3-1 (find-poly-containing-point-local (-> v1-67 state mesh) a1-12))
(s4-2 (new 'stack 'clamp-travel-vector-to-mesh-return-info))
)
(when s3-1
(clamp-vector-to-mesh-no-gaps s5-1 (-> self root trans) s3-1 gp-0 s4-2)
(when (-> s4-2 found-boundary)
(if (and (< (vector-length gp-0) 32768.0) (and (-> self charge-straight) (>= 9.0 (ja-frame-num 0))))
(go-virtual stop-run)
)
)
)
)
)
)
)
)
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.2))
(ja :group! (-> self draw art-group data (-> self enemy-info hostile-anim)))
(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-0 (-> self nav state))
(v1-1 (-> self dest))
)
(logclear! (-> a0-0 flags) (nav-state-flag directional-mode))
(logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty))
(set! (-> a0-0 target-post quad) (-> v1-1 quad))
)
0
(nav-enemy-travel-post)
)
)
;; failed to figure out what this is:
(defstate attack (rhino)
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(logior! (-> self enemy-flags) (enemy-flag lock-focus))
(logior! (-> self focus-status) (focus-status dangerous))
(let* ((v1-4 *game-info*)
(a0-2 (+ (-> v1-4 attack-id) 1))
)
(set! (-> v1-4 attack-id) a0-2)
(set! (-> self attack-id) a0-2)
)
(set! (-> self root penetrate-using) (penetrate generic-attack lunge))
(enemy-method-49 self)
(nav-enemy-method-166 self)
(let ((gp-0 (new 'stack-no-clear 'vector)))
(new 'stack-no-clear 'vector)
(vector-z-quaternion! gp-0 (-> self root quat))
(vector-float*! gp-0 gp-0 40960.0)
(vector+! (-> self dest) (-> self root trans) gp-0)
)
(let ((a0-10 (-> self nav state))
(v1-17 (-> self dest))
)
(logclear! (-> a0-10 flags) (nav-state-flag directional-mode))
(logior! (-> a0-10 flags) (nav-state-flag target-poly-dirty))
(set! (-> a0-10 target-post quad) (-> v1-17 quad))
)
0
)
:exit (behavior ()
(logclear! (-> self enemy-flags) (enemy-flag lock-focus))
(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 ()
(enemy-method-49 self)
)
:code (behavior ()
(let ((gp-0 #f))
(ja-channel-push! 1 (seconds 0.05))
(ja-no-eval :group! rhino-attack-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(if (logtest? (-> self enemy-flags) (enemy-flag victory))
(set! gp-0 #t)
)
(suspend)
(ja :num! (seek!))
)
(if gp-0
(go-virtual victory)
(go-hostile self)
)
)
)
:post nav-enemy-travel-post
)
;; definition for method 142 of type rhino
;; WARN: Return type mismatch int vs none.
(defmethod nav-enemy-method-142 ((this rhino) (arg0 nav-control))
(if (-> this in-stop-run)
(quaternion*!
(-> this root quat)
(-> this quat)
(quaternion-axis-angle! (new 'stack-no-clear 'quaternion) 0.0 1.0 0.0 (* 182.04445 (* 180.0 (-> this angle))))
)
((method-of-type nav-enemy nav-enemy-method-142) this arg0)
)
0
(none)
)
;; failed to figure out what this is:
(defstate stop-run (rhino)
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(let ((gp-0 (new 'stack-no-clear 'vector)))
(new 'stack-no-clear 'vector)
(vector-z-quaternion! gp-0 (-> self root quat))
(vector-float*! gp-0 gp-0 40960.0)
(vector+! (-> self dest) (-> self root trans) gp-0)
(let* ((s5-0 (-> self nav))
(v1-6 s5-0)
(a0-5 (-> self root trans))
(a1-3 (new 'stack-no-clear 'nav-find-poly-parms))
)
(vector-! (-> a1-3 point) a0-5 (-> v1-6 state mesh bounds))
(set! (-> a1-3 y-threshold) (-> v1-6 nearest-y-threshold))
(set! (-> a1-3 ignore) (the-as uint 2))
(let ((s3-0 (find-poly-containing-point-local (-> v1-6 state mesh) a1-3))
(s4-0 (new 'stack 'clamp-travel-vector-to-mesh-return-info))
)
(when s3-0
(clamp-vector-to-mesh-no-gaps s5-0 (-> self root trans) s3-0 gp-0 s4-0)
(if (-> s4-0 found-boundary)
(vector+! (-> self dest) (-> self root trans) gp-0)
)
)
)
)
)
(let ((a0-12 (-> self nav state))
(v1-18 (-> self dest))
)
(logclear! (-> a0-12 flags) (nav-state-flag directional-mode))
(logior! (-> a0-12 flags) (nav-state-flag target-poly-dirty))
(set! (-> a0-12 target-post quad) (-> v1-18 quad))
)
0
(set! (-> self skid-speed) 57344.0)
(set! (-> self in-stop-run) #t)
(quaternion-copy! (-> self quat) (-> self root quat))
(set! (-> self angle) 0.0)
(set! (-> self angle-speed) 0.0)
(set! (-> self num-hit-flinch) 0)
0
)
:exit (behavior ()
(let ((v1-1 (-> self nav state)))
(set! (-> v1-1 speed) 0.0)
)
0
(let ((v1-3 (-> self nav)))
(set! (-> v1-3 target-speed) (-> self enemy-info walk-travel-speed))
)
0
(set! (-> self in-stop-run) #f)
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.2))
(ja-no-eval :group! rhino-skid-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(set! (-> self skid-speed) (fmax 0.0 (- (-> self skid-speed) (* 32768.0 (seconds-per-frame)))))
(suspend)
(ja :num! (seek!))
)
(let ((a0-5 (handle->process (-> self focus handle)))
(v1-30 0)
)
(when a0-5
(let ((s5-0 (new 'stack-no-clear 'vector))
(s4-0 (new 'stack-no-clear 'vector))
(gp-0 (new 'stack-no-clear 'vector))
)
0.0
(vector-! s5-0 (get-trans (the-as process-focusable a0-5) 0) (-> self root trans))
(vector-normalize! s5-0 1.0)
(vector-x-quaternion! gp-0 (-> self root quat))
(vector-z-quaternion! s4-0 (-> self root quat))
(set! (-> self angle-speed) (* 0.5 (- 1.0 (vector-dot s5-0 s4-0))))
(set! v1-30 (cond
((< (vector-dot s5-0 gp-0) 0.0)
(set! v1-30 (-> self anim-skid-right))
(set! (-> self angle-speed) (- (-> self angle-speed)))
v1-30
)
(else
(-> self anim-skid-left)
)
)
)
)
)
(ja-no-eval :group! (-> self draw art-group data v1-30) :num! (seek!) :frame-num 0.0)
)
(until (ja-done? 0)
(set! (-> self skid-speed) (fmax 0.0 (- (-> self skid-speed) (* 32768.0 (seconds-per-frame)))))
(let ((v1-45 (-> self nav)))
(set! (-> v1-45 target-speed) (-> self skid-speed))
)
0
(if (and (>= (ja-frame-num 0) 0.0) (>= 15.0 (ja-frame-num 0)))
(+! (-> self angle) (* (-> self angle-speed) (seconds-per-frame)))
)
(let ((a0-20 (-> self nav state))
(v1-54 (-> self dest))
)
(logclear! (-> a0-20 flags) (nav-state-flag directional-mode))
(logior! (-> a0-20 flags) (nav-state-flag target-poly-dirty))
(set! (-> a0-20 target-post quad) (-> v1-54 quad))
)
0
(suspend)
(ja :num! (seek!))
)
(if (zero? (-> self num-hit-flinch))
(go-virtual victory)
(go-virtual hostile)
)
)
:post nav-enemy-travel-post
)
;; failed to figure out what this is:
(defstate charge (rhino)
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(set-setting! 'sound-mode #f 0.0 1)
(set-setting! 'sound-excitement 'abs 0.0 0)
(set-time! (-> self state-time))
(nav-enemy-method-166 self)
(let ((v1-8 self))
(if (not (logtest? (enemy-flag enemy-flag36) (-> v1-8 enemy-flags)))
(set! (-> v1-8 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-8 enemy-flags))))
)
(set! (-> v1-8 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag36) (-> v1-8 enemy-flags))))
(set! (-> v1-8 nav callback-info) (-> v1-8 enemy-info callback-info))
)
0
(let ((v1-11 self))
(set! (-> v1-11 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-11 enemy-flags))))
)
0
(let* ((gp-0 (get-point-in-path! (-> self path-intro) (new 'stack-no-clear 'vector) 0.0 'exact))
(v1-15 (get-point-in-path! (-> self path-intro) (new 'stack-no-clear 'vector) 1.0 'exact))
(s5-1 (vector-! (new 'stack-no-clear 'vector) v1-15 gp-0))
)
(set! (-> s5-1 y) 0.0)
(vector-xz-normalize! s5-1 163840.0)
(vector+! (-> self dest) gp-0 s5-1)
)
)
:exit (behavior ()
(set! (-> self wall) #f)
)
:code (behavior ()
(let ((a1-0 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-0 from) (process->ppointer self))
(set! (-> a1-0 num-params) 0)
(set! (-> a1-0 message) 'trigger)
(let ((t9-0 send-event-function)
(v1-2 (-> self wall))
)
(t9-0
(if v1-2
(-> v1-2 child 3)
)
a1-0
)
)
)
(ja-channel-push! 1 (seconds 0.05))
(ja-no-eval :group! rhino-attack-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(ja-channel-push! 1 (seconds 0.05))
(ja-no-eval :group! rhino-charge-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(ja-no-eval :group! rhino-charge-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(go-virtual victory)
)
:post (behavior ()
(let ((a0-0 (-> self nav state))
(v1-1 (-> self dest))
)
(logclear! (-> a0-0 flags) (nav-state-flag directional-mode))
(logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty))
(set! (-> a0-0 target-post quad) (-> v1-1 quad))
)
0
(nav-enemy-travel-post)
)
)
;; failed to figure out what this is:
(defstate stare (rhino)
:virtual #t
:enter (behavior ()
(let ((t9-0 (-> (method-of-type nav-enemy stare) enter)))
(if t9-0
(t9-0)
)
)
(let ((v1-4 self))
(set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag enemy-flag37))))
)
0
)
)
;; failed to figure out what this is:
(defstate circling (rhino)
:virtual #t
:enter (behavior ()
(let ((t9-0 (-> (method-of-type nav-enemy circling) enter)))
(if t9-0
(t9-0)
)
)
(let ((v1-5 (-> self nav state)))
(set! (-> v1-5 speed) 0.0)
)
0
)
:code (behavior ()
(let ((v1-2 (ja-group)))
(when (and v1-2 (= v1-2 (-> self draw art-group data (-> self enemy-info walk-anim))))
(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
(let ((v1-20 (-> self nav)))
(set! (-> v1-20 target-speed) 4096.0)
)
0
(let ((v1-22 (-> self nav)))
(set! (-> v1-22 acceleration) (-> self enemy-info run-acceleration))
)
0
(let ((v1-24 (-> self nav)))
(set! (-> v1-24 turning-acceleration) (-> self enemy-info run-turning-acceleration))
)
0
(let ((gp-0 (-> self draw art-group data (-> self enemy-info walk-anim))))
(let ((v1-32 (ja-group)))
(if (not (and v1-32 (= v1-32 gp-0)))
(ja-channel-push! 1 (seconds 0.1))
)
)
(let ((s5-0 (rnd-int-count self 8))
(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-59 self))
(set! (-> v1-59 enemy-flags) (the-as enemy-flag (logclear (-> v1-59 enemy-flags) (enemy-flag enemy-flag36))))
(set! (-> v1-59 nav callback-info) *nav-enemy-null-callback-info*)
)
0
(let ((v1-62 self))
(set! (-> v1-62 enemy-flags) (the-as enemy-flag (logclear (-> v1-62 enemy-flags) (enemy-flag enemy-flag37))))
)
0
(vector-reset! (-> self root transv))
(let ((v1-68 (ja-group)))
(if (not (and v1-68 (= v1-68 (-> self draw art-group data (-> self enemy-info victory-anim)))))
(ja-channel-push! 1 (seconds 0.1))
)
)
(let ((f30-2 (rnd-float-range self 0.9 1.1)))
(ja-no-eval :group! (-> self draw art-group data (-> self enemy-info victory-anim))
:num! (seek! max f30-2)
:frame-num 0.0
)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! max f30-2))
)
)
)
)
#f
)
)
;; definition for method 114 of type rhino
;; WARN: Return type mismatch int vs none.
(defmethod init-enemy-collision! ((this rhino))
"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 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 semi-solid deadly no-standon))
(set! (-> s4-0 transform-index) 4)
(set-vector! (-> s4-0 local-sphere) 0.0 -2048.0 0.0 27648.0)
(set! (-> s5-0 root-prim) s4-0)
)
(let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-13 prim-core collide-as) (collide-spec enemy))
(set! (-> v1-13 prim-core collide-with) (collide-spec backgnd jak bot crate hit-by-others-list player-list))
(set! (-> v1-13 prim-core action) (collide-action solid no-standon))
(set! (-> v1-13 transform-index) 4)
(set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 8192.0)
)
(let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1))))
(set! (-> v1-15 prim-core action) (collide-action solid no-standon))
(set! (-> v1-15 transform-index) 4)
(set-vector! (-> v1-15 local-sphere) 0.0 0.0 2048.0 10240.0)
)
(let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-17 prim-core collide-as) (collide-spec enemy))
(set! (-> v1-17 prim-core collide-with) (collide-spec backgnd jak bot crate hit-by-others-list player-list))
(set! (-> v1-17 prim-core action) (collide-action solid no-standon))
(set! (-> v1-17 transform-index) 16)
(set-vector! (-> v1-17 local-sphere) 0.0 0.0 0.0 6144.0)
)
(let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2))))
(set! (-> v1-19 prim-core collide-as) (collide-spec enemy))
(set! (-> v1-19 prim-core collide-with) (collide-spec jak bot player-list))
(set! (-> v1-19 prim-core action) (collide-action semi-solid deadly))
(set! (-> v1-19 transform-index) 6)
(set-vector! (-> v1-19 local-sphere) 0.0 -2048.0 0.0 7372.8)
)
(let ((v1-21 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-21 prim-core collide-as) (collide-spec enemy))
(set! (-> v1-21 prim-core collide-with) (collide-spec jak bot player-list))
(set! (-> v1-21 prim-core action) (collide-action deadly persistent-attack))
(set! (-> v1-21 transform-index) 4)
(set-vector! (-> v1-21 local-sphere) 0.0 0.0 -3072.0 4915.2)
)
(let ((v1-23 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-23 prim-core collide-as) (collide-spec enemy))
(set! (-> v1-23 prim-core collide-with) (collide-spec jak bot player-list))
(set! (-> v1-23 prim-core action) (collide-action deadly persistent-attack))
(set! (-> v1-23 transform-index) 21)
(set-vector! (-> v1-23 local-sphere) 0.0 2252.8 0.0 3276.8)
)
(set! (-> s5-0 nav-radius) 3686.4)
(let ((v1-25 (-> s5-0 root-prim)))
(set! (-> s5-0 backup-collide-as) (-> v1-25 prim-core collide-as))
(set! (-> s5-0 backup-collide-with) (-> v1-25 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 rhino
(defmethod relocate ((this rhino) (offset int))
(if (nonzero? (-> this path-intro))
(&+! (-> this path-intro) offset)
)
(call-parent-method this offset)
)
;; definition for method 115 of type rhino
;; WARN: Return type mismatch int vs none.
(defmethod init-enemy! ((this rhino))
"Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods"
(stack-size-set! (-> this main-thread) 256)
(initialize-skeleton
this
(the-as skeleton-group (art-group-get-by-name *level* "skel-rhino" (the-as (pointer uint32) #f)))
(the-as pair 0)
)
(set! (-> this skel generate-frame-function) create-interpolated2-joint-animation-frame)
(init-enemy-behaviour-and-stats! this *rhino-nav-enemy-info*)
(let ((v1-8 (-> this neck)))
(set! (-> v1-8 up) (the-as uint 1))
(set! (-> v1-8 nose) (the-as uint 2))
(set! (-> v1-8 ear) (the-as uint 0))
(set-vector! (-> v1-8 twist-max) 10922.667 12743.111 0.0 1.0)
(set! (-> v1-8 ignore-angle) 18204.445)
)
(set! (-> this wall) #f)
(set! (-> this wall) (the-as rhino-wall (entity-actor-lookup (-> this entity) 'alt-actor 0)))
(when (-> this wall)
(set! (-> this path-intro) (new 'process 'path-control this 'intro 0.0 (-> this entity) #f))
(if (-> this path-intro)
(logior! (-> this path-intro flags) (path-control-flag display draw-line draw-point draw-text))
)
(when (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)))
(format #t "~S : sub task done~%" (-> this name))
(get-point-in-path! (-> this path-intro) (-> this root trans) 1.0 'exact)
(set! (-> this wall) #f)
)
)
(set! (-> this charge-aware) (the-as uint 1))
(if (>= (res-lump-value (-> this entity) 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) 0)
(set! (-> this charge-aware) (the-as uint 2))
)
(set! (-> this charge-straight) #f)
(set! (-> this in-stop-run) #f)
(set! (-> this smush-target) #f)
(set! (-> this num-hit-flinch) 0)
(set! (-> this can-hit?) #f)
(set! (-> this anim-skid-left) 21)
(set! (-> this anim-skid-right) 22)
(set! (-> this anim-victory-hit) 23)
(set! (-> this interest) 0)
(set! (-> this victory-count) (the-as uint 0))
(set! (-> this stomach-touched-once?) #f)
(add-connection
*part-engine*
this
6
this
318
(new 'static 'vector :x 1433.6 :y -1105.92 :z 1925.12 :w 163840.0)
)
(add-connection
*part-engine*
this
6
this
318
(new 'static 'vector :x -1433.6 :y -1105.92 :z 1925.12 :w 163840.0)
)
(let ((v1-38 (-> this nav)))
(set! (-> v1-38 speed-scale) 1.0)
)
0
(set-gravity-length (-> this root dynam) 573440.0)
(logior! (-> this nav flags) (nav-control-flag momentum-ignore-heading))
(logior! (-> this focus-status) (focus-status dangerous))
(logior! (-> this enemy-flags) (enemy-flag dangerous-backup))
0
(none)
)