mirror of
https://github.com/open-goal/jak-project
synced 2026-07-05 05:40:00 -04:00
36f1592b90
Also adds: - BLERC - Minimap (with missing texture for the map, sprites work) - Eco Mine files - Precursor robot boss files - Sewer files - Vehicle files
2129 lines
72 KiB
Common Lisp
Vendored
Generated
2129 lines
72 KiB
Common Lisp
Vendored
Generated
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup skel-rat rat rat-lod0-jg -1
|
|
((rat-lod0-mg (meters 999999)))
|
|
:bounds (static-spherem 0 0 0 4)
|
|
:shadow rat-shadow-mg
|
|
:origin-joint-index 18
|
|
)
|
|
|
|
;; definition of type rat
|
|
(deftype rat (nav-enemy)
|
|
((init-quat quaternion :inline)
|
|
(roll-transform transformq :inline)
|
|
(face-dir vector :inline)
|
|
(flee-focus-pos vector :inline)
|
|
(wheel-actor entity-actor)
|
|
(permanently-scared symbol)
|
|
(slide-sound-id uint32)
|
|
(scared-timer time-frame)
|
|
(scared-interval time-frame)
|
|
(return-to-nav-mesh? symbol)
|
|
)
|
|
(:state-methods
|
|
wait-by-wheel-seek
|
|
wait-by-wheel-wait
|
|
active-turn
|
|
attack
|
|
flee-stare
|
|
undefined
|
|
running-in-wheel
|
|
wheel-die
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type rat
|
|
(defmethod inspect ((this rat))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(let ((t9-0 (method-of-type nav-enemy inspect)))
|
|
(t9-0 this)
|
|
)
|
|
(format #t "~2Tinit-quat: #<quaternion @ #x~X>~%" (-> this init-quat))
|
|
(format #t "~2Troll-transform: #<transformq @ #x~X>~%" (-> this roll-transform))
|
|
(format #t "~2Tface-dir: #<vector @ #x~X>~%" (-> this face-dir))
|
|
(format #t "~2Tflee-focus-pos: #<vector @ #x~X>~%" (-> this flee-focus-pos))
|
|
(format #t "~2Twheel-actor: ~A~%" (-> this wheel-actor))
|
|
(format #t "~2Tpermanently-scared: ~A~%" (-> this permanently-scared))
|
|
(format #t "~2Tslide-sound-id: ~D~%" (-> this slide-sound-id))
|
|
(format #t "~2Tscared-timer: ~D~%" (-> this scared-timer))
|
|
(format #t "~2Tscared-interval: ~D~%" (-> this scared-interval))
|
|
(format #t "~2Treturn-to-nav-mesh?: ~A~%" (-> this return-to-nav-mesh?))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; definition for symbol *fact-info-rat-defaults*, type fact-info-enemy-defaults
|
|
(define *fact-info-rat-defaults* (new 'static 'fact-info-enemy-defaults :idle-distance (meters 80)))
|
|
|
|
;; definition for symbol *rat-nav-enemy-info*, type nav-enemy-info
|
|
(define *rat-nav-enemy-info*
|
|
(new 'static 'nav-enemy-info
|
|
:use-die-falling #t
|
|
:use-victory #f
|
|
:use-jump-blocked #f
|
|
:debug-draw-neck #f
|
|
:jump-debug-draw #f
|
|
:move-to-ground #t
|
|
:hover-if-no-ground #f
|
|
:idle-anim-script (new 'static 'inline-array idle-control-frame 7
|
|
(new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30)
|
|
(new 'static 'idle-control-frame
|
|
:command (idle-control-cmd play)
|
|
:anim #x6
|
|
:param0 1
|
|
:param1 3
|
|
:param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0))
|
|
)
|
|
(new 'static 'idle-control-frame
|
|
:command (idle-control-cmd play)
|
|
:anim #x7
|
|
:param0 1
|
|
:param1 3
|
|
:param2 '((new 'static 'bfloat :data 0.75) (new 'static 'bfloat :data 1.5))
|
|
)
|
|
(new 'static 'idle-control-frame
|
|
:command (idle-control-cmd play)
|
|
:anim #x5
|
|
:param0 1
|
|
:param1 1
|
|
:param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0))
|
|
)
|
|
(new 'static 'idle-control-frame
|
|
:command (idle-control-cmd play)
|
|
:anim #x3
|
|
:param0 2
|
|
:param1 5
|
|
:param2 '((new 'static 'bfloat :data 0.75) (new 'static 'bfloat :data 1.5))
|
|
)
|
|
(new 'static 'idle-control-frame
|
|
:command (idle-control-cmd play)
|
|
:anim #x4
|
|
:param0 1
|
|
:param1 1
|
|
:param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0))
|
|
)
|
|
(new 'static 'idle-control-frame)
|
|
)
|
|
:idle-anim 6
|
|
:notice-anim 5
|
|
:hostile-anim 11
|
|
:hit-anim 6
|
|
:knocked-anim 16
|
|
:knocked-land-anim 17
|
|
:die-anim 24
|
|
:die-falling-anim 24
|
|
:victory-anim -1
|
|
:jump-wind-up-anim -1
|
|
:jump-in-air-anim -1
|
|
:jump-land-anim -1
|
|
:neck-joint 6
|
|
:look-at-joint 6
|
|
:bullseye-joint 6
|
|
:sound-hit (static-sound-name "rat-squeal")
|
|
:sound-die (static-sound-name "rat-die")
|
|
:notice-distance (meters 40)
|
|
:notice-distance-delta (meters 10)
|
|
:proximity-notice-distance (meters 5)
|
|
:default-hit-points 5.0
|
|
: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-smack
|
|
flut
|
|
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
|
|
jak-red-shockwave
|
|
jak-dark-nuke
|
|
jak-dark-blackhole
|
|
emp-blast
|
|
penetrate38
|
|
penetrate39
|
|
penetrate40
|
|
penetrate41
|
|
penetrate42
|
|
penetrate43
|
|
penetrate44
|
|
penetrate45
|
|
penetrate46
|
|
penetrate47
|
|
penetrate48
|
|
penetrate49
|
|
penetrate50
|
|
penetrate51
|
|
penetrate52
|
|
penetrate53
|
|
penetrate54
|
|
penetrate55
|
|
penetrate56
|
|
penetrate57
|
|
penetrate58
|
|
penetrate59
|
|
penetrate60
|
|
penetrate61
|
|
penetrate64
|
|
penetrate63
|
|
)
|
|
:movement-gravity (meters -100)
|
|
:friction 0.8
|
|
:attack-shove-back (meters 5)
|
|
:attack-shove-up (meters 3)
|
|
:attack-mode 'generic
|
|
:attack-damage 2
|
|
:recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher)
|
|
:knocked-can-land-timeout (seconds 0.5)
|
|
:knocked-recover-timeout (seconds 2)
|
|
:ragdoll-blend-out-time (seconds 0.4)
|
|
:ragdoll-rotate-velocity-mult 1.0
|
|
:jump-height-min (meters 3)
|
|
:jump-height-factor 0.5
|
|
:knocked-seek-ry-clamp 364.0889
|
|
:knocked-soft-vxz-lo 49152.0
|
|
:knocked-soft-vxz-hi 77824.0
|
|
:knocked-soft-vy-lo 65536.0
|
|
:knocked-soft-vy-hi 102400.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
|
|
:ragdoll-info (new 'static 'ragdoll-setup
|
|
:orient-tform (new 'static 'vector :x 0.9898 :y 0.0756 :z 0.1191 :w 16871.352)
|
|
:scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0)
|
|
:bg-collide-with (collide-spec backgnd obstacle hit-by-others-list pusher)
|
|
:joint-setup (new 'static 'boxed-array :type ragdoll-joint-setup
|
|
(new 'static 'ragdoll-joint-setup
|
|
:joint-index 4
|
|
:parent-joint -1
|
|
:pre-tform (new 'static 'vector :x 0.9975 :y 0.0623 :z -0.0291 :w 23209.137)
|
|
:geo-tform (new 'static 'vector :x 1.0 :w 12952.898)
|
|
:axial-slop 1800.5653
|
|
:max-angle 3301.7039
|
|
:coll-rad 2231.0913
|
|
:hit-sound (static-sound-name "rat-bf")
|
|
)
|
|
(new 'static 'ragdoll-joint-setup
|
|
:joint-index 3
|
|
:parent-joint -1
|
|
:pre-tform (new 'static 'vector :x 0.9999 :z 0.0004 :w 32758.518)
|
|
:geo-tform (new 'static 'vector :x 1.0 :z 0.0004 :w 32768.02)
|
|
:axial-slop 1800.5653
|
|
:max-angle 3299.4827
|
|
:coll-rad 1563.4432
|
|
:hit-sound (static-sound-name "rat-ragdoll")
|
|
)
|
|
(new 'static 'ragdoll-joint-setup
|
|
:joint-index 5
|
|
:parent-joint -1
|
|
:pre-tform (new 'static 'vector :x 0.7428 :y -0.0498 :z 0.6675 :w 33924.785)
|
|
:geo-tform (new 'static 'vector :x 0.6487 :y 0.4895 :z 0.5825 :w 43181.707)
|
|
:axial-slop 1800.5653
|
|
:max-angle 4193.594
|
|
:coll-rad 1294.7456
|
|
)
|
|
(new 'static 'ragdoll-joint-setup
|
|
:joint-index 6
|
|
:parent-joint -1
|
|
:pre-tform (new 'static 'vector :x 0.1409 :y -0.1438 :z 0.9794 :w 5063.1294)
|
|
:geo-tform (new 'static 'vector :x 0.7137 :y 0.3672 :z 0.5963 :w 41407.32)
|
|
:axial-slop 1800.5653
|
|
:max-angle 4537.8584
|
|
:coll-rad 1197.6704
|
|
:hit-sound (static-sound-name "rat-ragdoll")
|
|
)
|
|
(new 'static 'ragdoll-joint-setup
|
|
:joint-index 7
|
|
:parent-joint -1
|
|
:pre-tform (new 'static 'vector :x -0.4227 :y 0.5005 :z 0.7554 :w 43021.234)
|
|
:geo-tform (new 'static 'vector :x -0.48 :y -0.8771 :z 0.0154 :w 16837.107)
|
|
:axial-slop 1800.5653
|
|
:max-angle 4537.8584
|
|
:coll-rad 1030.144
|
|
)
|
|
(new 'static 'ragdoll-joint-setup
|
|
:joint-index 8
|
|
:parent-joint 6
|
|
:pre-tform (new 'static 'vector :x -0.4637 :y -0.5607 :z 0.6859 :w 24477.533)
|
|
:geo-tform (new 'static 'vector :x -0.5132 :y -0.0929 :z 0.8532 :w 39898.88)
|
|
:axial-slop 1800.5653
|
|
:max-angle 4806.5015
|
|
:coll-rad 991.6416
|
|
:hit-sound (static-sound-name "rat-ragdoll")
|
|
)
|
|
(new 'static 'ragdoll-joint-setup
|
|
:joint-index 9
|
|
:parent-joint 4
|
|
:pre-tform (new 'static 'vector :x 0.5308 :y -0.0302 :z -0.8469 :w 9008.215)
|
|
:geo-tform (new 'static 'vector :x 0.8575 :y 0.4582 :z -0.2339 :w 23058.24)
|
|
:axial-slop 1800.5653
|
|
:max-angle 3692.2073
|
|
:coll-rad 1030.144
|
|
:hit-sound (static-sound-name "rat-ragdoll")
|
|
)
|
|
(new 'static 'ragdoll-joint-setup
|
|
:joint-index 10
|
|
:parent-joint -1
|
|
:pre-tform (new 'static 'vector :x 0.9113 :y 0.3345 :z -0.2396 :w 9324.316)
|
|
:geo-tform (new 'static 'vector :x -0.6075 :y 0.6787 :z 0.4125 :w 11790.964)
|
|
:axial-slop 1800.5653
|
|
:max-angle 3223.1514
|
|
:coll-rad 1030.144
|
|
:hit-sound (static-sound-name "rat-ragdoll")
|
|
)
|
|
(new 'static 'ragdoll-joint-setup
|
|
:joint-index 11
|
|
:parent-joint -1
|
|
:pre-tform (new 'static 'vector :x -0.5485 :y 0.0296 :z 0.8355 :w 8436.723)
|
|
:geo-tform (new 'static 'vector :x -0.5367 :y 0.8135 :z 0.2236 :w 9872.307)
|
|
:axial-slop 1800.5653
|
|
:max-angle 2035.4388
|
|
:coll-rad 697.5488
|
|
:hit-sound (static-sound-name "rat-ragdoll")
|
|
)
|
|
(new 'static 'ragdoll-joint-setup
|
|
:joint-index 12
|
|
:parent-joint -1
|
|
:pre-tform (new 'static 'vector :x -0.7012 :y -0.0152 :z 0.7127 :w 6800.543)
|
|
:geo-tform (new 'static 'vector :x 0.7478 :y -0.0492 :z 0.662 :w 16398.764)
|
|
:axial-slop 1800.5653
|
|
:max-angle 3487.4438
|
|
:coll-rad 556.2368
|
|
:hit-sound (static-sound-name "rat-ragdoll")
|
|
)
|
|
(new 'static 'ragdoll-joint-setup
|
|
:joint-index 13
|
|
:parent-joint 4
|
|
:pre-tform (new 'static 'vector :x 0.4697 :y 0.169 :z 0.8664 :w 9123.412)
|
|
:geo-tform (new 'static 'vector :x 0.8284 :y -0.482 :z 0.2849 :w 23692.027)
|
|
:axial-slop 1800.5653
|
|
:max-angle 3475.6653
|
|
:coll-rad 1030.144
|
|
:hit-sound (static-sound-name "rat-ragdoll")
|
|
)
|
|
(new 'static 'ragdoll-joint-setup
|
|
:joint-index 14
|
|
:parent-joint -1
|
|
:pre-tform (new 'static 'vector :x 0.8702 :y -0.3516 :z 0.3448 :w 9364.0205)
|
|
:geo-tform (new 'static 'vector :x -0.5482 :y -0.7233 :z -0.4196 :w 12565.746)
|
|
:axial-slop 1800.5653
|
|
:max-angle 3745.783
|
|
:coll-rad 1030.144
|
|
:hit-sound (static-sound-name "rat-ragdoll")
|
|
)
|
|
(new 'static 'ragdoll-joint-setup
|
|
:joint-index 15
|
|
:parent-joint -1
|
|
:pre-tform (new 'static 'vector :x -0.5319 :y -0.3084 :z -0.7885 :w 8845.867)
|
|
:geo-tform (new 'static 'vector :x -0.6153 :y -0.7608 :z -0.2061 :w 8654.2295)
|
|
:axial-slop 1800.5653
|
|
:max-angle 2274.791
|
|
:coll-rad 757.76
|
|
:hit-sound (static-sound-name "rat-ragdoll")
|
|
)
|
|
(new 'static 'ragdoll-joint-setup
|
|
:joint-index 16
|
|
:parent-joint -1
|
|
:pre-tform (new 'static 'vector :x -0.8155 :y -0.1199 :z -0.5661 :w 6821.0957)
|
|
:geo-tform (new 'static 'vector :x 0.7005 :y 0.2295 :z -0.6757 :w 16967.252)
|
|
:axial-slop 1800.5653
|
|
:max-angle 3639.3962
|
|
:coll-rad 397.7216
|
|
:hit-sound (static-sound-name "rat-ragdoll")
|
|
)
|
|
(new 'static 'ragdoll-joint-setup
|
|
:joint-index 17
|
|
:parent-joint 3
|
|
:pre-tform (new 'static 'vector :x -0.9985 :y -0.0463 :z 0.0288 :w 11897.897)
|
|
:geo-tform (new 'static 'vector :x -0.997 :y 0.0705 :z 0.0292 :w 8203.996)
|
|
:axial-slop 1800.5653
|
|
:max-angle 3417.666
|
|
:coll-rad 1127.2192
|
|
:hit-sound (static-sound-name "rat-ragdoll")
|
|
)
|
|
(new 'static 'ragdoll-joint-setup
|
|
:joint-index 18
|
|
:parent-joint -1
|
|
:pre-tform (new 'static 'vector :x -0.3436 :y -0.9382 :z 0.0401 :w 1372.5969)
|
|
:geo-tform (new 'static 'vector :x -0.984 :y 0.1534 :z 0.0897 :w 11190.399)
|
|
:axial-slop 1800.5653
|
|
:max-angle 3380.966
|
|
:coll-rad 1597.8496
|
|
:hit-sound (static-sound-name "rat-ragdoll")
|
|
)
|
|
(new 'static 'ragdoll-joint-setup
|
|
:joint-index 19
|
|
:parent-joint -1
|
|
:pre-tform (new 'static 'vector :x -0.3309 :y 0.0632 :z -0.9415 :w 15700.951)
|
|
:geo-tform (new 'static 'vector :x 0.7557 :y 0.568 :z 0.3258 :w 34107.156)
|
|
:axial-slop 1800.5653
|
|
:max-angle 3795.7178
|
|
:coll-rad 1286.144
|
|
)
|
|
(new 'static 'ragdoll-joint-setup
|
|
:joint-index 20
|
|
:parent-joint -1
|
|
:pre-tform (new 'static 'vector :x -0.9673 :y -0.2207 :z 0.1243 :w 10359.821)
|
|
:geo-tform (new 'static 'vector :x 0.7738 :y -0.299 :z 0.5583 :w 23514.645)
|
|
:axial-slop 1800.5653
|
|
:max-angle 3626.18
|
|
:coll-rad 1030.144
|
|
:hit-sound (static-sound-name "rat-ragdoll")
|
|
)
|
|
(new 'static 'ragdoll-joint-setup
|
|
:joint-index 21
|
|
:parent-joint -1
|
|
:pre-tform (new 'static 'vector :x 0.4253 :y -0.0324 :z 0.9044 :w 21694.164)
|
|
:geo-tform (new 'static 'vector :x -0.816 :y -0.3366 :z -0.4697 :w 21449.367)
|
|
:axial-slop 1800.5653
|
|
:max-angle 3774.4185
|
|
:coll-rad 591.4624
|
|
:hit-sound (static-sound-name "rat-ragdoll")
|
|
)
|
|
(new 'static 'ragdoll-joint-setup
|
|
:joint-index 22
|
|
:parent-joint -1
|
|
:pre-tform (new 'static 'vector :x -0.5431 :y -0.0261 :z -0.8392 :w 19577.861)
|
|
:geo-tform (new 'static 'vector :x 0.4968 :y -0.8225 :z 0.2766 :w 11542.782)
|
|
:axial-slop 1800.5653
|
|
:max-angle 2293.8694
|
|
:coll-rad 626.2784
|
|
:hit-sound (static-sound-name "rat-ragdoll")
|
|
)
|
|
(new 'static 'ragdoll-joint-setup
|
|
:joint-index 23
|
|
:parent-joint -1
|
|
:pre-tform (new 'static 'vector :x 0.5367 :y 0.0778 :z 0.8401 :w 6345.687)
|
|
:geo-tform (new 'static 'vector :x -0.62 :y -0.7018 :z -0.3505 :w 13527.996)
|
|
:axial-slop 1800.5653
|
|
:max-angle 2710.7876
|
|
:coll-rad 445.2352
|
|
)
|
|
(new 'static 'ragdoll-joint-setup
|
|
:joint-index 24
|
|
:parent-joint 18
|
|
:pre-tform (new 'static 'vector :x 0.9719 :y -0.1118 :z -0.2067 :w 4947.2944)
|
|
:geo-tform (new 'static 'vector :x 0.9852 :y 0.1266 :z -0.1151 :w 13674.414)
|
|
:axial-slop 1800.5653
|
|
:max-angle 1986.9968
|
|
:coll-rad 1030.144
|
|
)
|
|
(new 'static 'ragdoll-joint-setup
|
|
:joint-index 25
|
|
:parent-joint -1
|
|
:pre-tform (new 'static 'vector :x 0.3961 :y -0.884 :z -0.248 :w 1440.9546)
|
|
:geo-tform (new 'static 'vector :x -0.4417 :y 0.8968 :z 0.0222 :w 3241.5017)
|
|
:axial-slop 1800.5653
|
|
:max-angle 2815.7542
|
|
:coll-rad 791.3472
|
|
)
|
|
(new 'static 'ragdoll-joint-setup
|
|
:joint-index 26
|
|
:parent-joint -1
|
|
:pre-tform (new 'static 'vector :x -0.7521 :y -0.6312 :z 0.1891 :w 1846.6588)
|
|
:geo-tform (new 'static 'vector :x 0.1732 :y 0.9842 :z -0.0343 :w 4142.276)
|
|
:axial-slop 1800.5653
|
|
:max-angle 3795.7178
|
|
:coll-rad 760.2176
|
|
)
|
|
(new 'static 'ragdoll-joint-setup
|
|
:joint-index 27
|
|
:parent-joint -1
|
|
:pre-tform (new 'static 'vector :x 0.5148 :y -0.8218 :z -0.2441 :w 1278.8622)
|
|
:geo-tform (new 'static 'vector :x 0.0427 :y 0.999 :z -0.0107 :w 5133.7627)
|
|
:axial-slop 1800.5653
|
|
:max-angle 4537.8584
|
|
:coll-rad 575.0784
|
|
)
|
|
(new 'static 'ragdoll-joint-setup
|
|
:joint-index 28
|
|
:parent-joint -1
|
|
:pre-tform (new 'static 'vector :x 0.1457 :y -0.9851 :z -0.0908 :w 1308.1167)
|
|
:geo-tform (new 'static 'vector :x -0.0891 :y 0.9956 :z 0.0283 :w 6443.0444)
|
|
:axial-slop 1800.5653
|
|
:max-angle 5359.261
|
|
:coll-rad 513.2288
|
|
)
|
|
(new 'static 'ragdoll-joint-setup
|
|
:joint-index 29
|
|
:parent-joint 18
|
|
:pre-tform (new 'static 'vector :x -0.084 :y 0.0546 :z 0.9949 :w 15687.553)
|
|
:geo-tform (new 'static 'vector :x 0.7291 :y -0.57 :z -0.3786 :w 33257.48)
|
|
:axial-slop 1800.5653
|
|
:max-angle 3678.281
|
|
:coll-rad 1030.144
|
|
)
|
|
(new 'static 'ragdoll-joint-setup
|
|
:joint-index 30
|
|
:parent-joint -1
|
|
:pre-tform (new 'static 'vector :x -0.7243 :y 0.6445 :z -0.2448 :w 13605.893)
|
|
:geo-tform (new 'static 'vector :x 0.9233 :y 0.1682 :z -0.345 :w 22198.062)
|
|
:axial-slop 1800.5653
|
|
:max-angle 3652.5945
|
|
:coll-rad 931.0208
|
|
:hit-sound (static-sound-name "rat-ragdoll")
|
|
)
|
|
(new 'static 'ragdoll-joint-setup
|
|
:joint-index 31
|
|
:parent-joint -1
|
|
:pre-tform (new 'static 'vector :x 0.8853 :y 0.1044 :z -0.4529 :w 21871.893)
|
|
:geo-tform (new 'static 'vector :x -0.9877 :y 0.0861 :z 0.1303 :w 19674.363)
|
|
:axial-slop 1800.5653
|
|
:max-angle 3709.101
|
|
:coll-rad 675.4304
|
|
:hit-sound (static-sound-name "rat-ragdoll")
|
|
)
|
|
(new 'static 'ragdoll-joint-setup
|
|
:joint-index 32
|
|
:parent-joint -1
|
|
:pre-tform (new 'static 'vector :x -0.9484 :y -0.0508 :z 0.3126 :w 19602.928)
|
|
:geo-tform (new 'static 'vector :x 0.8427 :y 0.5037 :z -0.1896 :w 7369.013)
|
|
:axial-slop 1800.5653
|
|
:max-angle 3767.8103
|
|
:coll-rad 740.5568
|
|
:hit-sound (static-sound-name "rat-ragdoll")
|
|
)
|
|
(new 'static 'ragdoll-joint-setup
|
|
:joint-index 33
|
|
:parent-joint -1
|
|
:pre-tform (new 'static 'vector :x 0.8652 :y -0.2236 :z -0.4486 :w 6495.9824)
|
|
:geo-tform (new 'static 'vector :x -0.854 :y 0.4607 :z 0.2416 :w 10556.411)
|
|
:axial-slop 1800.5653
|
|
:max-angle 2548.5496
|
|
:coll-rad 1030.144
|
|
)
|
|
(new 'static 'ragdoll-joint-setup
|
|
:joint-index 34
|
|
:parent-joint 6
|
|
:pre-tform (new 'static 'vector :x 0.5956 :y -0.5418 :z 0.5929 :w 18988.164)
|
|
:geo-tform (new 'static 'vector :x -0.75 :y -0.6581 :z -0.0655 :w 2752.0388)
|
|
:axial-slop 1800.5653
|
|
:max-angle 4537.8584
|
|
:coll-rad 1277.1328
|
|
)
|
|
(new 'static 'ragdoll-joint-setup
|
|
:joint-index 35
|
|
:parent-joint 7
|
|
:pre-tform (new 'static 'vector :x -0.8792 :y 0.2318 :z -0.4161 :w 7033.5786)
|
|
:geo-tform (new 'static 'vector :x -0.0562 :y -0.9874 :z -0.1475 :w 16494.428)
|
|
:axial-slop 1800.5653
|
|
:max-angle 4537.8584
|
|
:coll-rad 744.2432
|
|
)
|
|
(new 'static 'ragdoll-joint-setup
|
|
:joint-index 36
|
|
:parent-joint 8
|
|
:pre-tform (new 'static 'vector :x -0.5619 :y -0.0979 :z 0.8213 :w 6875.181)
|
|
:geo-tform (new 'static 'vector :x -0.5163 :y -0.1113 :z 0.8491 :w 33034.82)
|
|
:axial-slop 1800.5653
|
|
:max-angle 4537.8584
|
|
:coll-rad 645.5296
|
|
)
|
|
(new 'static 'ragdoll-joint-setup
|
|
:joint-index 37
|
|
:parent-joint 6
|
|
:pre-tform (new 'static 'vector :x 0.8388 :y -0.5396 :z -0.0716 :w 22881.477)
|
|
:geo-tform (new 'static 'vector :x -0.0691 :y 0.6797 :z 0.7301 :w 12063.759)
|
|
:axial-slop 1800.5653
|
|
:max-angle 4537.8584
|
|
:coll-rad 1030.144
|
|
)
|
|
(new 'static 'ragdoll-joint-setup
|
|
:joint-index 38
|
|
:parent-joint 6
|
|
:pre-tform (new 'static 'vector :x 0.2823 :y -0.5464 :z 0.7884 :w 23099.492)
|
|
:geo-tform (new 'static 'vector :x 0.9118 :y -0.3801 :z 0.1549 :w 29933.094)
|
|
:axial-slop 1800.5653
|
|
:max-angle 4537.8584
|
|
:coll-rad 1030.144
|
|
)
|
|
(new 'static 'ragdoll-joint-setup
|
|
:joint-index 39
|
|
:parent-joint 12
|
|
:pre-tform (new 'static 'vector :x -0.7122 :y 0.0482 :z 0.7002 :w 7344.5103)
|
|
:geo-tform (new 'static 'vector :x 0.5743 :y 0.7856 :z -0.2297 :w 9826.541)
|
|
:axial-slop 1800.5653
|
|
:max-angle 4537.8584
|
|
:coll-rad 1135.8208
|
|
)
|
|
(new 'static 'ragdoll-joint-setup
|
|
:joint-index 40
|
|
:parent-joint 16
|
|
:pre-tform (new 'static 'vector :x -0.755 :y 0.3048 :z -0.5805 :w 6001.295)
|
|
:geo-tform (new 'static 'vector :x 0.9264 :y 0.104 :z 0.3618 :w 38196.477)
|
|
:axial-slop 1800.5653
|
|
:max-angle 4537.8584
|
|
:coll-rad 1147.6992
|
|
)
|
|
)
|
|
)
|
|
:shadow-size (meters 2)
|
|
:shadow-max-y (meters 1)
|
|
:shadow-min-y (meters -1)
|
|
:shadow-locus-dist (meters 150)
|
|
:gem-joint -1
|
|
:gem-offset (new 'static 'sphere :r 163840.0)
|
|
:knocked-off #t
|
|
:callback-info #f
|
|
:use-momentum #f
|
|
:use-frustration #f
|
|
:use-stop-chase #f
|
|
:use-circling #f
|
|
:use-pacing #f
|
|
:walk-anim 10
|
|
:turn-anim -1
|
|
:run-anim 11
|
|
:taunt-anim -1
|
|
:run-travel-speed (meters 8)
|
|
:run-acceleration (meters 6)
|
|
:run-turning-acceleration (meters 60)
|
|
:walk-travel-speed (meters 3)
|
|
:walk-acceleration (meters 6)
|
|
:walk-turning-acceleration (meters 2)
|
|
:maximum-rotation-rate (degrees 360)
|
|
:notice-nav-radius (meters 2)
|
|
: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! (-> *rat-nav-enemy-info* fact-defaults) *fact-info-rat-defaults*)
|
|
|
|
;; definition for method 120 of type rat
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod init-enemy-collision! ((this rat))
|
|
(let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player))))
|
|
(set! (-> s5-0 dynam) (copy *standard-dynamics* 'process))
|
|
(set! (-> s5-0 reaction) cshape-reaction-default)
|
|
(set! (-> s5-0 no-reaction)
|
|
(the-as (function collide-shape-moving collide-query vector vector object) nothing)
|
|
)
|
|
(set! (-> s5-0 penetrated-by) (penetrate
|
|
generic-attack
|
|
lunge
|
|
flop
|
|
punch
|
|
spin
|
|
roll
|
|
uppercut
|
|
bonk
|
|
tube
|
|
flut-attack
|
|
board
|
|
mech-punch
|
|
dark-punch
|
|
dark-smack
|
|
flut
|
|
)
|
|
)
|
|
(let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 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 pusher)
|
|
)
|
|
(set! (-> s4-0 prim-core action) (collide-action solid can-ride deadly no-standon))
|
|
(set-vector! (-> s4-0 local-sphere) 0.0 4915.2 0.0 10240.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 obstacle hit-by-others-list pusher))
|
|
(set! (-> v1-13 prim-core action) (collide-action solid can-ride))
|
|
(set-vector! (-> v1-13 local-sphere) 0.0 819.2 0.0 819.2)
|
|
)
|
|
(let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
|
|
(set! (-> v1-15 prim-core collide-with)
|
|
(collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list pusher)
|
|
)
|
|
(set-vector! (-> v1-15 local-sphere) 0.0 4956.16 0.0 4915.2)
|
|
)
|
|
(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 action) (collide-action solid no-standon))
|
|
(set! (-> v1-17 transform-index) 4)
|
|
(set-vector! (-> v1-17 local-sphere) 0.0 0.0 1228.8 3276.8)
|
|
)
|
|
(let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
|
|
(set! (-> v1-19 prim-core collide-as) (collide-spec enemy))
|
|
(set! (-> v1-19 prim-core action) (collide-action solid deadly no-standon))
|
|
(set! (-> v1-19 transform-index) 34)
|
|
(set-vector! (-> v1-19 local-sphere) 0.0 0.0 1228.8 2048.0)
|
|
)
|
|
(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 action) (collide-action solid no-standon))
|
|
(set! (-> v1-21 transform-index) 18)
|
|
(set-vector! (-> v1-21 local-sphere) 0.0 0.0 0.0 2867.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 action) (collide-action solid no-standon))
|
|
(set! (-> v1-23 transform-index) 25)
|
|
(set-vector! (-> v1-23 local-sphere) 0.0 0.0 0.0 1638.4)
|
|
)
|
|
(set! (-> s5-0 nav-radius) 8192.0)
|
|
(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 function rat-run-code
|
|
;; WARN: Return type mismatch symbol vs none.
|
|
;; WARN: new jak 2 until loop case, check carefully
|
|
(defbehavior rat-run-code rat ()
|
|
(ja-channel-push! 1 (seconds 0.2))
|
|
(until #f
|
|
(ja-no-eval :group! rat-run0-ja
|
|
:num! (seek! max (lerp-scale 0.5 1.333 (vector-length (-> self root transv)) 0.0 32768.0))
|
|
:frame-num 0.0
|
|
)
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek! max (lerp-scale 0.5 1.333 (vector-length (-> self root transv)) 0.0 32768.0)))
|
|
)
|
|
)
|
|
#f
|
|
(none)
|
|
)
|
|
|
|
;; definition for function rat-falling-post
|
|
(defbehavior rat-falling-post rat ()
|
|
(nav-enemy-falling-post)
|
|
(none)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate idle (rat)
|
|
:virtual #t
|
|
:enter (behavior ()
|
|
(if (enemy-method-109 self)
|
|
(go-virtual die)
|
|
)
|
|
(let ((t9-3 (-> (find-parent-state) enter)))
|
|
(if t9-3
|
|
(t9-3)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate ambush (rat)
|
|
:virtual #t
|
|
:enter (behavior ()
|
|
(let ((t9-0 (-> (method-of-type nav-enemy ambush) enter)))
|
|
(if t9-0
|
|
(t9-0)
|
|
)
|
|
)
|
|
(logior! (-> self focus-status) (focus-status dangerous))
|
|
(set-vector! (-> self draw color-mult) 0.0 0.0 0.0 1.0)
|
|
(let ((v1-8 self))
|
|
(set! (-> v1-8 enemy-flags) (the-as enemy-flag (logclear (-> v1-8 enemy-flags) (enemy-flag ef37))))
|
|
(set! (-> v1-8 nav callback-info) *null-nav-callback-info*)
|
|
)
|
|
0
|
|
(let ((v1-11 self))
|
|
(set! (-> v1-11 enemy-flags) (the-as enemy-flag (logclear (-> v1-11 enemy-flags) (enemy-flag ef38))))
|
|
)
|
|
0
|
|
(set-time! (-> self state-time))
|
|
(logclear! (-> self enemy-flags) (enemy-flag alert))
|
|
(let ((s5-0 (new 'stack-no-clear 'collide-query))
|
|
(gp-0 (new 'stack-no-clear 'vector))
|
|
)
|
|
(let ((a0-8 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))))
|
|
(vector+float*! gp-0 (-> self root trans) a0-8 32768.0)
|
|
)
|
|
(if (enemy-above-ground? self s5-0 gp-0 (collide-spec backgnd) 8192.0 81920.0 1024.0)
|
|
(set! (-> gp-0 y) (-> s5-0 best-other-tri intersect y))
|
|
)
|
|
(set! (-> self root gspot-pos quad) (-> gp-0 quad))
|
|
)
|
|
(sound-play "rat-spawner")
|
|
)
|
|
:exit (behavior ()
|
|
(set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0)
|
|
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
|
|
(logior! (-> self focus-status) (focus-status dangerous))
|
|
(logclear! (-> self focus-status) (focus-status dangerous))
|
|
)
|
|
)
|
|
:trans (behavior ()
|
|
(let* ((v1-2 (- (current-time) (-> self state-time)))
|
|
(f0-1 (fmin 1.0 (* 0.0016666667 (the float v1-2))))
|
|
)
|
|
(set-vector! (-> self draw color-mult) f0-1 f0-1 f0-1 1.0)
|
|
)
|
|
0
|
|
)
|
|
:code (behavior ()
|
|
(ja-channel-push! 1 0)
|
|
(ja-no-eval :group! rat-pipe-jump0-start-ja :num! (seek!) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(compute-alignment! (-> self align))
|
|
(align! (-> self align) (align-opts adjust-y-vel adjust-xz-vel) 1.0 1.0 1.0)
|
|
(vector-v++! (-> self root trans) (-> self root transv))
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
(ja-no-eval :group! rat-pipe-jump0-end-ja :num! (seek!) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(compute-alignment! (-> self align))
|
|
(align! (-> self align) (align-opts adjust-xz-vel) 1.0 1.0 1.0)
|
|
(cond
|
|
((>= (-> self root gspot-pos y) (-> self root trans y))
|
|
(set! (-> self root trans y) (-> self root gspot-pos y))
|
|
)
|
|
(else
|
|
(vector-v++!
|
|
(-> self root transv)
|
|
(compute-acc-due-to-gravity (-> self root) (new 'stack-no-clear 'vector) (-> self enemy-info slip-factor))
|
|
)
|
|
(vector-v++! (-> self root trans) (-> self root transv))
|
|
)
|
|
)
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
(ja-channel-push! 1 (seconds 0.2))
|
|
(ja-no-eval :group! rat-idle-stand-ja :num! (seek!) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
(go-hostile self)
|
|
)
|
|
:post (behavior ()
|
|
(nav-enemy-simple-post)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate active (rat)
|
|
:virtual #t
|
|
:enter (behavior ()
|
|
(let ((v1-0 self))
|
|
(if (not (logtest? (enemy-flag ef37) (-> v1-0 enemy-flags)))
|
|
(set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-0 enemy-flags))))
|
|
)
|
|
(set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-0 enemy-flags))))
|
|
(set! (-> v1-0 nav callback-info) (-> v1-0 enemy-info callback-info))
|
|
)
|
|
0
|
|
(let ((v1-3 self))
|
|
(set! (-> v1-3 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-3 enemy-flags))))
|
|
)
|
|
0
|
|
(nav-enemy-method-176 self)
|
|
(set-look-at-mode! self 2)
|
|
(let ((gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))
|
|
(f0-1 (* 4096.0 (rnd-float-range self 8.0 20.0)))
|
|
)
|
|
(vector+float*! (-> self move-dest) (-> self root trans) gp-0 f0-1)
|
|
)
|
|
(closest-point-on-mesh (-> self nav) (-> self move-dest) (-> self move-dest) (the-as nav-poly #f))
|
|
(let ((a0-22 (-> self nav state))
|
|
(v1-18 (-> self move-dest))
|
|
)
|
|
(logclear! (-> a0-22 flags) (nav-state-flag directional-mode))
|
|
(logior! (-> a0-22 flags) (nav-state-flag target-poly-dirty))
|
|
(set! (-> a0-22 target-pos quad) (-> v1-18 quad))
|
|
)
|
|
0
|
|
)
|
|
:code (behavior ()
|
|
(ja-channel-push! 1 (seconds 0.2))
|
|
(until #f
|
|
(if (< (vector-vector-distance (-> self root trans) (-> self move-dest)) 8192.0)
|
|
(go-virtual active-turn)
|
|
)
|
|
(ja-no-eval :group! rat-walk0-ja
|
|
:num! (seek! max (lerp-scale 0.0 1.0 (vector-length (-> self root transv)) 0.0 12288.0))
|
|
:frame-num 0.0
|
|
)
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek! max (lerp-scale 0.0 1.0 (vector-length (-> self root transv)) 0.0 12288.0)))
|
|
)
|
|
)
|
|
#f
|
|
)
|
|
:post (behavior ()
|
|
(nav-enemy-travel-post)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate active-turn (rat)
|
|
:virtual #t
|
|
:parent (rat active)
|
|
:enter (behavior ()
|
|
(local-vars (v1-20 symbol))
|
|
(let ((v1-0 self))
|
|
(set! (-> v1-0 enemy-flags) (the-as enemy-flag (logclear (-> v1-0 enemy-flags) (enemy-flag ef37))))
|
|
(set! (-> v1-0 nav callback-info) *null-nav-callback-info*)
|
|
)
|
|
0
|
|
(let ((v1-3 self))
|
|
(set! (-> v1-3 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-3 enemy-flags))))
|
|
)
|
|
0
|
|
(nav-enemy-method-176 self)
|
|
(set-look-at-mode! self 2)
|
|
(let ((gp-0 (-> self root trans)))
|
|
(let ((s5-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))
|
|
(s4-0 (new 'stack-no-clear 'vector))
|
|
(s3-0 (new 'stack-no-clear 'vector))
|
|
(s2-0 (new 'stack-no-clear 'vector))
|
|
(f30-0 0.0)
|
|
)
|
|
(until v1-20
|
|
(+! f30-0 (* 182.04445 (rnd-float-range self 42.0 198.0)))
|
|
(vector-rotate-around-y! s4-0 s5-0 f30-0)
|
|
(vector+float*! s3-0 gp-0 s4-0 24576.0)
|
|
(closest-point-on-mesh (-> self nav) s2-0 s3-0 (the-as nav-poly #f))
|
|
(set! v1-20 (or (>= 2048.0 (vector-vector-distance s2-0 s3-0)) (>= f30-0 65536.0)))
|
|
)
|
|
(vector-rotate-around-y! (-> self face-dir) s5-0 f30-0)
|
|
)
|
|
(vector+float*! (-> self move-dest) gp-0 (-> self face-dir) 24576.0)
|
|
)
|
|
)
|
|
:trans (behavior ()
|
|
(let ((a0-0 (method-of-type nav-enemy active)))
|
|
(when a0-0
|
|
(let ((t9-0 (-> a0-0 trans)))
|
|
(if t9-0
|
|
(t9-0)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(if (enemy-method-103 self (-> self face-dir) 1820.4445)
|
|
(go-virtual active)
|
|
)
|
|
)
|
|
:code (behavior ()
|
|
(ja-channel-push! 1 (seconds 0.075))
|
|
(until #f
|
|
(cond
|
|
((< 0.0 (deg-diff (quaternion-y-angle (-> self root quat)) (vector-y-angle (-> self face-dir))))
|
|
(ja-no-eval :group! rat-turn-left-ja :num! (seek!) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
)
|
|
(else
|
|
(ja-no-eval :group! rat-turn-right-ja :num! (seek!) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
#f
|
|
)
|
|
:post (behavior ()
|
|
(seek-toward-heading-vec!
|
|
(-> self root)
|
|
(-> self face-dir)
|
|
(* 0.5 (-> self nav max-rotation-rate))
|
|
(seconds 0.02)
|
|
)
|
|
(nav-enemy-simple-post)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate notice (rat)
|
|
:virtual #t
|
|
:enter (behavior ()
|
|
(let ((t9-0 (-> (method-of-type nav-enemy notice) enter)))
|
|
(if t9-0
|
|
(t9-0)
|
|
)
|
|
)
|
|
(stop-look-at! self)
|
|
)
|
|
:code (behavior ()
|
|
(ja-channel-push! 1 (seconds 0.075))
|
|
(let ((f30-0 (rnd-float-range self 0.8 1.2)))
|
|
(ja-no-eval :group! rat-walk-to-sit-ja :num! (seek! max f30-0) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(seek-to-point-toward-point!
|
|
(-> self root)
|
|
(-> self focus-pos)
|
|
(-> self nav max-rotation-rate)
|
|
(seconds 0.02)
|
|
)
|
|
(suspend)
|
|
(ja :num! (seek! max f30-0))
|
|
)
|
|
)
|
|
(ja-no-eval :group! rat-sit-to-alert-ja :num! (seek!) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
(set-look-at-mode! self 1)
|
|
(dotimes (gp-0 (set-reaction-time! self (seconds 0.007) (seconds 0.015)))
|
|
(ja-no-eval :group! rat-sit-alert-idle-ja :num! (seek!) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
)
|
|
(ja-no-eval :group! rat-sit-to-run-ja :num! (seek!) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
(go-best-state self)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate wait-by-wheel-seek (rat)
|
|
:virtual #t
|
|
:enter (behavior ()
|
|
(let ((v1-0 self))
|
|
(if (not (logtest? (enemy-flag ef37) (-> v1-0 enemy-flags)))
|
|
(set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-0 enemy-flags))))
|
|
)
|
|
(set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-0 enemy-flags))))
|
|
(set! (-> v1-0 nav callback-info) (-> v1-0 enemy-info callback-info))
|
|
)
|
|
0
|
|
(let ((v1-3 self))
|
|
(set! (-> v1-3 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-3 enemy-flags))))
|
|
)
|
|
0
|
|
(nav-enemy-method-177 self)
|
|
(set-time! (-> self state-time))
|
|
(let ((v1-9 (-> self nav)))
|
|
(set! (-> v1-9 sphere-mask) (the-as uint #x1000fe))
|
|
)
|
|
0
|
|
)
|
|
:trans (behavior ()
|
|
(when (time-elapsed? (-> self state-time) (seconds 0.1))
|
|
(if (< (vector-vector-xz-distance (-> self root trans) (-> self move-dest)) 8192.0)
|
|
(go-virtual wait-by-wheel-wait)
|
|
)
|
|
)
|
|
)
|
|
:code rat-run-code
|
|
:post (behavior ()
|
|
(let ((gp-0 (new 'stack-no-clear 'vector)))
|
|
(let ((a1-0 (new 'stack-no-clear 'event-message-block)))
|
|
(set! (-> a1-0 from) (process->ppointer self))
|
|
(set! (-> a1-0 num-params) 1)
|
|
(set! (-> a1-0 message) 'wait-pos)
|
|
(set! (-> a1-0 param 0) (the-as uint gp-0))
|
|
(let ((t9-0 send-event-function)
|
|
(v1-3 (-> self wheel-actor))
|
|
)
|
|
(if (not (t9-0
|
|
(if v1-3
|
|
(-> v1-3 extra process)
|
|
)
|
|
a1-0
|
|
)
|
|
)
|
|
(set! (-> gp-0 quad) (-> self wheel-actor extra trans quad))
|
|
)
|
|
)
|
|
)
|
|
(closest-point-on-mesh (-> self nav) (-> self move-dest) gp-0 (the-as nav-poly #f))
|
|
)
|
|
(let ((a0-7 (-> self nav state))
|
|
(v1-11 (-> self move-dest))
|
|
)
|
|
(logclear! (-> a0-7 flags) (nav-state-flag directional-mode))
|
|
(logior! (-> a0-7 flags) (nav-state-flag target-poly-dirty))
|
|
(set! (-> a0-7 target-pos quad) (-> v1-11 quad))
|
|
)
|
|
0
|
|
(nav-enemy-method-187 self)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate wait-by-wheel-wait (rat)
|
|
:virtual #t
|
|
:event enemy-event-handler
|
|
:enter (behavior ()
|
|
(let ((v1-0 self))
|
|
(set! (-> v1-0 enemy-flags) (the-as enemy-flag (logclear (-> v1-0 enemy-flags) (enemy-flag ef37))))
|
|
(set! (-> v1-0 nav callback-info) *null-nav-callback-info*)
|
|
)
|
|
0
|
|
(let ((v1-3 self))
|
|
(set! (-> v1-3 enemy-flags) (the-as enemy-flag (logclear (-> v1-3 enemy-flags) (enemy-flag ef38))))
|
|
)
|
|
0
|
|
(nav-enemy-method-178 self)
|
|
(vector-reset! (-> self root transv))
|
|
(set-look-at-mode! self 1)
|
|
)
|
|
:code (behavior ()
|
|
(until #f
|
|
(when (not (enemy-method-105 self 4551.1113 #t))
|
|
(let ((v1-3 self))
|
|
(set! (-> v1-3 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-3 enemy-flags))))
|
|
)
|
|
0
|
|
(ja-channel-push! 1 (seconds 0.2))
|
|
(ja :group! rat-turn-left-ja)
|
|
(ja :num-func num-func-identity :frame-num 0.0)
|
|
(until (enemy-method-105 self 1820.4445 #t)
|
|
(ja-blend-eval)
|
|
(suspend)
|
|
(ja :num! (loop!))
|
|
)
|
|
(let ((v1-19 self))
|
|
(set! (-> v1-19 enemy-flags) (the-as enemy-flag (logclear (-> v1-19 enemy-flags) (enemy-flag ef38))))
|
|
)
|
|
0
|
|
)
|
|
(let ((v1-23 (ja-group)))
|
|
(if (not (and v1-23 (= v1-23 rat-idle-stand-ja)))
|
|
(ja-channel-push! 1 (seconds 0.2))
|
|
)
|
|
)
|
|
(ja-no-eval :group! rat-idle-stand-ja :num! (seek!) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
)
|
|
#f
|
|
)
|
|
:post nav-enemy-stare-post
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate hostile (rat)
|
|
:virtual #t
|
|
:trans (behavior ()
|
|
(let ((t9-0 (-> (method-of-type nav-enemy hostile) trans)))
|
|
(if t9-0
|
|
(t9-0)
|
|
)
|
|
)
|
|
(if (and (time-elapsed? (-> self state-time) (-> self reaction-time))
|
|
(and (< (vector-vector-xz-distance (-> self focus-pos) (-> self root trans)) 20480.0) (get-focus! self))
|
|
)
|
|
(go-virtual attack)
|
|
)
|
|
)
|
|
:code rat-run-code
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate attack (rat)
|
|
:virtual #t
|
|
:event enemy-event-handler
|
|
:enter (behavior ()
|
|
(set-time! (-> self state-time))
|
|
(logior! (-> self focus-status) (focus-status dangerous))
|
|
(set-time! (-> self scared-timer))
|
|
(set! (-> self scared-interval) (seconds 3))
|
|
)
|
|
:exit (behavior ()
|
|
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
|
|
(logior! (-> self focus-status) (focus-status dangerous))
|
|
(logclear! (-> self focus-status) (focus-status dangerous))
|
|
)
|
|
)
|
|
:code (behavior ()
|
|
(ja-channel-push! 1 (seconds 0.1))
|
|
(ja-no-eval :group! rat-run0-ja :num! (seek! max 1.5) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek! max 1.5))
|
|
)
|
|
(go-best-state self)
|
|
)
|
|
:post nav-enemy-chase-post
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate flee (rat)
|
|
:virtual #t
|
|
:enter (behavior ()
|
|
(let ((t9-0 (-> (method-of-type nav-enemy flee) enter)))
|
|
(if t9-0
|
|
(t9-0)
|
|
)
|
|
)
|
|
(set-look-at-mode! self 2)
|
|
)
|
|
:code rat-run-code
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate flee-stare (rat)
|
|
:virtual #t
|
|
:event enemy-event-handler
|
|
:enter (behavior ()
|
|
(set-time! (-> self state-time))
|
|
(let ((v1-2 self))
|
|
(set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef38))))
|
|
)
|
|
0
|
|
(set-look-at-mode! self 1)
|
|
(set! (-> self flee-focus-pos quad) (-> self focus-pos quad))
|
|
)
|
|
:trans (behavior ()
|
|
(when (time-elapsed? (-> self state-time) (seconds 1))
|
|
(if (and (handle->process (-> self focus handle))
|
|
(< 12288.0 (vector-vector-distance (-> self flee-focus-pos) (-> self focus-pos)))
|
|
)
|
|
(go-virtual flee)
|
|
)
|
|
)
|
|
)
|
|
:code (behavior ()
|
|
(until #f
|
|
(when (not (enemy-method-105 self 4551.1113 #t))
|
|
(let ((v1-3 self))
|
|
(set! (-> v1-3 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-3 enemy-flags))))
|
|
)
|
|
0
|
|
(ja-channel-push! 1 (seconds 0.2))
|
|
(ja :group! rat-turn-left-ja)
|
|
(ja :num-func num-func-identity :frame-num 0.0)
|
|
(until (enemy-method-105 self 1820.4445 #t)
|
|
(ja-blend-eval)
|
|
(suspend)
|
|
(ja :num! (loop!))
|
|
)
|
|
(let ((v1-19 self))
|
|
(set! (-> v1-19 enemy-flags) (the-as enemy-flag (logclear (-> v1-19 enemy-flags) (enemy-flag ef38))))
|
|
)
|
|
0
|
|
)
|
|
(let ((v1-23 (ja-group)))
|
|
(if (not (and v1-23 (= v1-23 rat-idle-stand-ja)))
|
|
(ja-channel-push! 1 (seconds 0.2))
|
|
)
|
|
)
|
|
(ja-no-eval :group! rat-idle-stand-ja :num! (seek!) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
)
|
|
#f
|
|
)
|
|
:post nav-enemy-face-focus-post
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate stare (rat)
|
|
:virtual #t
|
|
:enter (behavior ()
|
|
(let ((t9-0 (-> (method-of-type nav-enemy stare) enter)))
|
|
(if t9-0
|
|
(t9-0)
|
|
)
|
|
)
|
|
(set-look-at-mode! self 1)
|
|
)
|
|
:code (behavior ()
|
|
(until #f
|
|
(when (not (enemy-method-105 self 4551.1113 #t))
|
|
(let ((v1-3 self))
|
|
(set! (-> v1-3 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-3 enemy-flags))))
|
|
)
|
|
0
|
|
(ja-channel-push! 1 (seconds 0.2))
|
|
(ja :group! rat-turn-left-ja)
|
|
(ja :num-func num-func-identity :frame-num 0.0)
|
|
(until (enemy-method-105 self 1820.4445 #t)
|
|
(ja-blend-eval)
|
|
(suspend)
|
|
(ja :num! (loop!))
|
|
)
|
|
(let ((v1-19 self))
|
|
(set! (-> v1-19 enemy-flags) (the-as enemy-flag (logclear (-> v1-19 enemy-flags) (enemy-flag ef38))))
|
|
)
|
|
0
|
|
)
|
|
(let ((v1-23 (ja-group)))
|
|
(if (not (and v1-23 (= v1-23 rat-idle-stand-ja)))
|
|
(ja-channel-push! 1 (seconds 0.2))
|
|
)
|
|
)
|
|
(ja-no-eval :group! rat-idle-stand-ja :num! (seek!) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
)
|
|
#f
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate knocked (rat)
|
|
:virtual #t
|
|
:enter (behavior ()
|
|
(let ((t9-0 (-> (method-of-type nav-enemy knocked) enter)))
|
|
(if t9-0
|
|
(t9-0)
|
|
)
|
|
)
|
|
(if (nonzero? (-> self slide-sound-id))
|
|
(sound-stop (the-as sound-id (-> self slide-sound-id)))
|
|
)
|
|
)
|
|
:post (behavior ()
|
|
(nav-enemy-simple-post)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate knocked-recover (rat)
|
|
:virtual #t
|
|
:exit (behavior ()
|
|
(let ((t9-0 (-> (method-of-type nav-enemy knocked-recover) exit)))
|
|
(if t9-0
|
|
(t9-0)
|
|
)
|
|
)
|
|
(set! (-> self return-to-nav-mesh?) #t)
|
|
)
|
|
:trans #f
|
|
:code (behavior ()
|
|
(cond
|
|
((handle->process (-> self ragdoll-proc))
|
|
(vector-reset! (-> self root transv))
|
|
(try-locate-ground self (meters 10) (meters 10) #t (collide-spec backgnd))
|
|
(ja-channel-push! 1 0)
|
|
(ja-no-eval :group! rat-ground-to-run-ja :num! (seek!) :frame-num 0.0)
|
|
(let ((gp-0 (-> (the-as ragdoll-proc (-> self ragdoll-proc process 0)) ragdoll)))
|
|
(enable-ragdoll! gp-0 self)
|
|
(quaternion-copy! (-> self root quat) (the-as quaternion (-> gp-0 ragdoll-joints)))
|
|
)
|
|
(let ((a1-6 (new 'stack-no-clear 'event-message-block)))
|
|
(set! (-> a1-6 from) (process->ppointer self))
|
|
(set! (-> a1-6 num-params) 0)
|
|
(set! (-> a1-6 message) 'inside?)
|
|
(let ((t9-5 send-event-function)
|
|
(v1-31 (-> self wheel-actor))
|
|
)
|
|
(when (t9-5
|
|
(if v1-31
|
|
(-> v1-31 extra process)
|
|
)
|
|
a1-6
|
|
)
|
|
(let ((a1-7 (new 'stack-no-clear 'event-message-block)))
|
|
(set! (-> a1-7 from) (process->ppointer self))
|
|
(set! (-> a1-7 num-params) 0)
|
|
(set! (-> a1-7 message) 'claim-wheel?)
|
|
(let ((t9-6 send-event-function)
|
|
(v1-37 (-> self wheel-actor))
|
|
)
|
|
(if (t9-6
|
|
(if v1-37
|
|
(-> v1-37 extra process)
|
|
)
|
|
a1-7
|
|
)
|
|
(go-virtual running-in-wheel)
|
|
(go-virtual die)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(let ((f30-0 0.12))
|
|
(ja-channel-push! 1 (the-as time-frame (the int (* 300.0 f30-0))))
|
|
(ja-no-eval :group! rat-ground-to-run-ja :num! (seek!) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(let ((gp-1 (new 'stack-no-clear 'quaternion))
|
|
(f28-0 (lerp-scale 0.0 1.0 (the float (- (current-time) (-> self state-time))) 0.0 (* 300.0 f30-0)))
|
|
)
|
|
(forward-up-nopitch->quaternion
|
|
gp-1
|
|
(vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))
|
|
*y-vector*
|
|
)
|
|
(quaternion-slerp! (-> self root quat) (-> self root quat) gp-1 f28-0)
|
|
)
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
)
|
|
)
|
|
(else
|
|
(ja-channel-push! 1 (seconds 0.2))
|
|
(ja-no-eval :group! rat-on-back-idle-ja :num! (seek!) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
)
|
|
)
|
|
(if (enemy-method-109 self)
|
|
(go-die self)
|
|
(go-virtual flee)
|
|
)
|
|
)
|
|
:post rat-falling-post
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate running-in-wheel (rat)
|
|
:virtual #t
|
|
:enter (behavior ()
|
|
(set-time! (-> self state-time))
|
|
(logclear! (-> self enemy-flags) (enemy-flag trackable))
|
|
(logclear! (-> self enemy-flags) (enemy-flag vulnerable))
|
|
(let ((gp-0 (-> self parent 0 child)))
|
|
(while gp-0
|
|
(if (!= gp-0 self)
|
|
(send-event (ppointer->process gp-0) 'scared)
|
|
)
|
|
(set! gp-0 (-> gp-0 0 brother))
|
|
)
|
|
)
|
|
(let ((v1-18 (-> self root root-prim)))
|
|
(logclear! (-> v1-18 prim-core action) (collide-action can-ride))
|
|
(dotimes (a0-6 (the-as int (-> v1-18 specific 0)))
|
|
(logclear! (-> (the-as collide-shape-prim-group v1-18) child a0-6 prim-core action) (collide-action can-ride))
|
|
)
|
|
)
|
|
)
|
|
:trans (behavior ()
|
|
(let ((v1-0 (-> self wheel-actor)))
|
|
(if (not (if v1-0
|
|
(-> v1-0 extra process)
|
|
)
|
|
)
|
|
(go empty-state)
|
|
)
|
|
)
|
|
(if (and (time-elapsed? (-> self state-time) (seconds 8))
|
|
(< 204800.0 (vector-vector-xz-distance (-> self root trans) (target-pos 0)))
|
|
)
|
|
(go-virtual wheel-die)
|
|
)
|
|
)
|
|
:code (behavior ()
|
|
(ja-channel-push! 1 (seconds 0.2))
|
|
(ja-no-eval :group! rat-ground-to-run-ja :num! (seek!) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
(ja-channel-push! 1 (seconds 0.1))
|
|
(let ((f30-0 2.0))
|
|
(until #f
|
|
(ja-no-eval :group! rat-run-wheel0-ja :num! (seek! max f30-0) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(let ((a1-5 (new 'stack-no-clear 'event-message-block)))
|
|
(set! (-> a1-5 from) (process->ppointer self))
|
|
(set! (-> a1-5 num-params) 0)
|
|
(set! (-> a1-5 message) 'turn)
|
|
(let* ((t9-6 send-event-function)
|
|
(v1-41 (-> self wheel-actor))
|
|
(a0-6 (if v1-41
|
|
(-> v1-41 extra process)
|
|
)
|
|
)
|
|
)
|
|
(t9-6 a0-6 a1-5)
|
|
)
|
|
)
|
|
(set! f30-0 (seek f30-0 1.5 (* 0.1 (seconds-per-frame))))
|
|
(suspend)
|
|
(ja :num! (seek! max f30-0))
|
|
)
|
|
)
|
|
)
|
|
#f
|
|
)
|
|
:post (behavior ()
|
|
(let ((a1-0 (new 'stack-no-clear 'event-message-block)))
|
|
(set! (-> a1-0 from) (process->ppointer self))
|
|
(set! (-> a1-0 num-params) 1)
|
|
(set! (-> a1-0 message) 'run-dir)
|
|
(set! (-> a1-0 param 0) (the-as uint (new 'stack-no-clear 'vector)))
|
|
(let* ((t9-0 send-event-function)
|
|
(v1-4 (-> self wheel-actor))
|
|
(a1-1 (t9-0
|
|
(if v1-4
|
|
(-> v1-4 extra process)
|
|
)
|
|
a1-0
|
|
)
|
|
)
|
|
)
|
|
(seek-toward-heading-vec! (-> self root) (the-as vector a1-1) (-> self nav max-rotation-rate) (seconds 0.02))
|
|
)
|
|
)
|
|
(let ((gp-0 (-> self root))
|
|
(a1-2 (new 'stack-no-clear 'event-message-block))
|
|
)
|
|
(set! (-> a1-2 from) (process->ppointer self))
|
|
(set! (-> a1-2 num-params) 2)
|
|
(set! (-> a1-2 message) 'run-pos)
|
|
(set! (-> a1-2 param 0) (the-as uint (-> gp-0 trans)))
|
|
(set! (-> a1-2 param 1) (the-as uint (new 'stack-no-clear 'vector)))
|
|
(let* ((t9-2 send-event-function)
|
|
(v1-14 (-> self wheel-actor))
|
|
(s5-0 (t9-2
|
|
(if v1-14
|
|
(-> v1-14 extra process)
|
|
)
|
|
a1-2
|
|
)
|
|
)
|
|
(a1-3 (new 'stack-no-clear 'event-message-block))
|
|
)
|
|
(set! (-> a1-3 from) (process->ppointer self))
|
|
(set! (-> a1-3 num-params) 2)
|
|
(set! (-> a1-3 message) 'run-up)
|
|
(set! (-> a1-3 param 0) (the-as uint (-> gp-0 trans)))
|
|
(set! (-> a1-3 param 1) (the-as uint (new 'stack-no-clear 'vector)))
|
|
(let* ((t9-3 send-event-function)
|
|
(v1-21 (-> self wheel-actor))
|
|
(s4-0 (t9-3
|
|
(if v1-21
|
|
(-> v1-21 extra process)
|
|
)
|
|
a1-3
|
|
)
|
|
)
|
|
)
|
|
(vector-seek! (-> gp-0 trans) (the-as vector s5-0) (* 10240.0 (seconds-per-frame)))
|
|
(let ((s5-1 (new 'stack-no-clear 'quaternion)))
|
|
(forward-up-nopitch->quaternion
|
|
s5-1
|
|
(vector-z-quaternion! (new 'stack-no-clear 'vector) (-> gp-0 quat))
|
|
(the-as vector s4-0)
|
|
)
|
|
(quaternion-slerp! (-> gp-0 quat) (-> gp-0 quat) s5-1 (* 4.0 (seconds-per-frame)))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
0
|
|
(transform-post)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate wheel-die (rat)
|
|
:virtual #t
|
|
:event enemy-event-handler
|
|
:enter (behavior ()
|
|
(logclear! (-> self enemy-flags) (enemy-flag vulnerable vulnerable-backup))
|
|
(logclear! (-> self focus-status) (focus-status dangerous))
|
|
(logclear! (-> self enemy-flags) (enemy-flag dangerous-backup))
|
|
(logclear! (-> self enemy-flags) (enemy-flag attackable attackable-backup))
|
|
(logclear! (-> self mask) (process-mask actor-pause))
|
|
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
|
|
(logior! (-> self focus-status) (focus-status dead))
|
|
(if (-> self skel effect)
|
|
(logior! (-> self skel effect flags) (effect-control-flag ecf1))
|
|
)
|
|
(stop-look-at! self)
|
|
(let ((v1-24 (-> self root root-prim)))
|
|
(set! (-> v1-24 prim-core collide-as) (collide-spec))
|
|
(set! (-> v1-24 prim-core collide-with) (collide-spec))
|
|
)
|
|
0
|
|
(set-time! (-> self state-time))
|
|
(send-event (ppointer->process (-> self parent)) 'die)
|
|
)
|
|
:code (behavior ()
|
|
(ja-channel-push! 1 0)
|
|
(ja-no-eval :group! rat-run-wheel0-die-ja :num! (seek!) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
(send-event self 'death-end)
|
|
(cleanup-for-death self)
|
|
)
|
|
:post nav-enemy-simple-post
|
|
)
|
|
|
|
;; definition for function rat-joint-mod-roll
|
|
;; WARN: Return type mismatch vector vs none.
|
|
(defun rat-joint-mod-roll ((arg0 cspace) (arg1 transformq))
|
|
(let ((gp-0 (-> arg0 param1)))
|
|
(cspace<-parented-transformq-joint! arg0 arg1)
|
|
(vector+!
|
|
(-> arg0 bone transform trans)
|
|
(-> arg0 bone transform trans)
|
|
(the-as vector (-> (the-as rat gp-0) roll-transform))
|
|
)
|
|
)
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 108 of type rat
|
|
(defmethod enemy-method-108 ((this rat) (arg0 process-focusable))
|
|
(or (not (time-elapsed? (-> this scared-timer) (-> this scared-interval))) (-> this permanently-scared))
|
|
)
|
|
|
|
;; definition for method 109 of type rat
|
|
(defmethod enemy-method-109 ((this rat))
|
|
(with-pp
|
|
(let ((a1-0 (new 'stack-no-clear 'event-message-block)))
|
|
(set! (-> a1-0 from) (process->ppointer pp))
|
|
(set! (-> a1-0 num-params) 0)
|
|
(set! (-> a1-0 message) 'near?)
|
|
(let ((t9-0 send-event-function)
|
|
(v1-2 (-> this wheel-actor))
|
|
)
|
|
(when (not (t9-0
|
|
(if v1-2
|
|
(-> v1-2 extra process)
|
|
)
|
|
a1-0
|
|
)
|
|
)
|
|
(let ((s5-0 (-> this root))
|
|
(gp-0 (new 'stack-no-clear 'vector))
|
|
(v1-6 (-> this nav state))
|
|
)
|
|
(new 'stack-no-clear 'vector)
|
|
(or (not (closest-point-on-mesh (-> v1-6 nav) gp-0 (-> s5-0 trans) (the-as nav-poly #f)))
|
|
(< 24576.0 (vector-vector-xz-distance (-> s5-0 trans) gp-0))
|
|
(< (-> s5-0 trans y) (+ -16384.0 (-> gp-0 y)))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for method 89 of type rat
|
|
(defmethod within-gspot-range? ((this rat))
|
|
(with-pp
|
|
(let ((a1-0 (new 'stack-no-clear 'event-message-block)))
|
|
(set! (-> a1-0 from) (process->ppointer pp))
|
|
(set! (-> a1-0 num-params) 0)
|
|
(set! (-> a1-0 message) 'near?)
|
|
(let ((t9-0 send-event-function)
|
|
(v1-2 (-> this wheel-actor))
|
|
)
|
|
(if (not (t9-0
|
|
(if v1-2
|
|
(-> v1-2 extra process)
|
|
)
|
|
a1-0
|
|
)
|
|
)
|
|
((method-of-type nav-enemy within-gspot-range?) this)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for method 125 of type rat
|
|
(defmethod ragdoll-settled? ((this rat))
|
|
(with-pp
|
|
(and (or (time-elapsed? (-> this state-time) (seconds 3)) (let ((a1-0 (new 'stack-no-clear 'event-message-block)))
|
|
(set! (-> a1-0 from) (process->ppointer pp))
|
|
(set! (-> a1-0 num-params) 0)
|
|
(set! (-> a1-0 message) 'inside?)
|
|
(let ((t9-0 send-event-function)
|
|
(v1-6 (-> this wheel-actor))
|
|
)
|
|
(t9-0
|
|
(if v1-6
|
|
(-> v1-6 extra process)
|
|
)
|
|
a1-0
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(call-parent-method this)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for method 56 of type rat
|
|
;; WARN: Return type mismatch float vs object.
|
|
(defmethod knocked-handler ((this rat) (arg0 vector))
|
|
(get-knockback-dir! this arg0)
|
|
(let ((f30-0 (rnd-float-range this 0.9 1.0)))
|
|
(let ((f0-0 0.0)
|
|
(f1-0 98304.0)
|
|
)
|
|
(vector-float*! arg0 arg0 (lerp f0-0 f1-0 f30-0))
|
|
)
|
|
(set! (-> arg0 y) (lerp 0.0 73728.0 f30-0))
|
|
)
|
|
)
|
|
|
|
;; definition for method 63 of type rat
|
|
(defmethod enemy-method-63 ((this rat) (arg0 float))
|
|
(if (= (-> this hit-points) (-> this enemy-info default-hit-points))
|
|
1.0
|
|
0.0
|
|
)
|
|
)
|
|
|
|
;; definition for method 142 of type rat
|
|
;; WARN: Return type mismatch int vs knocked-type.
|
|
(defmethod penetrate->knocked-type ((this rat) (arg0 penetrate))
|
|
(the-as knocked-type (cond
|
|
((logtest? arg0 (penetrate vehicle))
|
|
7
|
|
)
|
|
((logtest? (penetrate jak-blue-shot) arg0)
|
|
6
|
|
)
|
|
((logtest? (penetrate dark-bomb dark-smack) arg0)
|
|
3
|
|
)
|
|
((logtest? (penetrate explode jak-dark-shot enemy-dark-shot) arg0)
|
|
2
|
|
)
|
|
(else
|
|
0
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for method 78 of type rat
|
|
(defmethod go-hostile ((this rat))
|
|
(if (logtest? (-> this fact enemy-options) (enemy-option user8))
|
|
(go (method-of-object this wait-by-wheel-seek))
|
|
(go (method-of-object this hostile))
|
|
)
|
|
)
|
|
|
|
;; definition for method 67 of type rat
|
|
(defmethod coin-flip? ((this rat))
|
|
#f
|
|
)
|
|
|
|
;; definition for method 59 of type rat
|
|
;; INFO: Used lq/sq
|
|
(defmethod enemy-common-post ((this rat))
|
|
(let ((a0-2 (handle->process (-> this focus handle))))
|
|
(if a0-2
|
|
(set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable a0-2) 3) quad))
|
|
)
|
|
)
|
|
(when (-> this return-to-nav-mesh?)
|
|
(format *stdebug* "~s ~d off nav-mesh~%" (-> this name) (-> this pid))
|
|
(when (enemy-method-109 this)
|
|
(set! (-> this return-to-nav-mesh?) #f)
|
|
(go-die this)
|
|
)
|
|
(let ((s5-2 (new 'stack-no-clear 'vector))
|
|
(s4-0 (-> this root))
|
|
)
|
|
(if (and (closest-point-on-mesh (-> this nav state nav) s5-2 (-> s4-0 trans) (the-as nav-poly #f))
|
|
(< (vector-vector-xz-distance (-> s4-0 trans) s5-2) 409.6)
|
|
(< (fabs (- (-> s4-0 trans y) (-> s5-2 y))) 8192.0)
|
|
)
|
|
(set! (-> this return-to-nav-mesh?) #f)
|
|
)
|
|
)
|
|
)
|
|
((method-of-type nav-enemy enemy-common-post) this)
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 50 of type rat
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod enemy-method-50 ((this rat) (arg0 int))
|
|
(let ((v1-0 arg0))
|
|
(cond
|
|
((= v1-0 1)
|
|
(let ((v1-4 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1)))
|
|
(set! (-> v1-4 prim-core action) (collide-action solid))
|
|
(set! (-> v1-4 prim-core collide-with)
|
|
(collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list pusher)
|
|
)
|
|
)
|
|
)
|
|
((or (= v1-0 2) (zero? v1-0))
|
|
(let ((v1-8 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1)))
|
|
(set! (-> v1-8 prim-core action) (collide-action))
|
|
(set! (-> v1-8 prim-core collide-with) (collide-spec))
|
|
)
|
|
0
|
|
)
|
|
)
|
|
)
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 20 of type rat
|
|
;; WARN: Return type mismatch int vs search-info-flag.
|
|
(defmethod process-mask->search-info-flag ((this rat))
|
|
(the-as search-info-flag 8)
|
|
)
|
|
|
|
;; definition for method 82 of type rat
|
|
;; INFO: Used lq/sq
|
|
(defmethod event-handler ((this rat) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
|
(local-vars (v0-5 object))
|
|
(case arg2
|
|
(('hit 'hit-knocked 'hit-flinch)
|
|
(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 (= (-> this hit-points) 0.0)
|
|
(logior! (-> this focus-status) (focus-status dead))
|
|
)
|
|
(logclear! (-> this enemy-flags) (enemy-flag lock-focus))
|
|
(enemy-method-69 this)
|
|
(logior! (-> this enemy-flags) (enemy-flag lock-focus))
|
|
(process-contact-action arg0)
|
|
(send-event arg0 'get-attack-count 1)
|
|
(freeze-hit-begin)
|
|
(go (method-of-object this knocked))
|
|
#t
|
|
)
|
|
(('rat?)
|
|
#t
|
|
)
|
|
(('scared)
|
|
(set! v0-5 #t)
|
|
(set! (-> this permanently-scared) (the-as symbol v0-5))
|
|
v0-5
|
|
)
|
|
(('trans)
|
|
(set! v0-5 (-> arg3 param 0))
|
|
(set! (-> (the-as vector v0-5) quad) (-> this root trans quad))
|
|
v0-5
|
|
)
|
|
(else
|
|
((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for method 10 of type rat
|
|
(defmethod deactivate ((this rat))
|
|
"Make a process dead, clean it up, remove it from the active pool, and return to dead pool."
|
|
(if (nonzero? (-> this slide-sound-id))
|
|
(sound-stop (the-as sound-id (-> this slide-sound-id)))
|
|
)
|
|
(call-parent-method this)
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 121 of type rat
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod init-enemy! ((this rat))
|
|
(with-pp
|
|
(rlet ((vf0 :class vf))
|
|
(init-vf0-vector)
|
|
(initialize-skeleton
|
|
this
|
|
(the-as skeleton-group (art-group-get-by-name *level* "skel-rat" (the-as (pointer level) #f)))
|
|
(the-as pair 0)
|
|
)
|
|
(init-enemy-defaults! this *rat-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 15473.777 0.0 1.0)
|
|
(set! (-> v1-5 ignore-angle) 30947.555)
|
|
)
|
|
(set! (-> this align) (new 'process 'align-control this))
|
|
(set! (-> this slide-sound-id) (the-as uint (new-sound-id)))
|
|
(set! (-> this wheel-actor) (entity-actor-lookup (-> this entity) 'alt-actor 0))
|
|
(.svf (&-> (-> this roll-transform) trans quad) vf0)
|
|
(let ((a1-8 (new 'stack-no-clear 'event-message-block)))
|
|
(set! (-> a1-8 from) (process->ppointer pp))
|
|
(set! (-> a1-8 num-params) 0)
|
|
(set! (-> a1-8 message) 'running?)
|
|
(let ((t9-6 send-event-function)
|
|
(v1-11 (-> this wheel-actor))
|
|
)
|
|
(set! (-> this permanently-scared) (the-as symbol (t9-6
|
|
(if v1-11
|
|
(-> v1-11 extra process)
|
|
)
|
|
a1-8
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(set! (-> this scared-timer) 0)
|
|
(set! (-> this scared-interval) 0)
|
|
(set! (-> this return-to-nav-mesh?) #f)
|
|
0
|
|
(none)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition of type rat-spawner
|
|
(deftype rat-spawner (process)
|
|
((rats-spawned uint32)
|
|
(wheel-entity entity-actor)
|
|
(state-time time-frame)
|
|
(active? symbol)
|
|
(rats-to-spawn uint32)
|
|
(actor-group (pointer actor-group))
|
|
(actor-group-count int32)
|
|
)
|
|
(:state-methods
|
|
idle
|
|
die
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type rat-spawner
|
|
(defmethod inspect ((this rat-spawner))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-7)
|
|
)
|
|
(let ((t9-0 (method-of-type process inspect)))
|
|
(t9-0 this)
|
|
)
|
|
(format #t "~2Trats-spawned: ~D~%" (-> this rats-spawned))
|
|
(format #t "~2Twheel-entity: ~A~%" (-> this wheel-entity))
|
|
(format #t "~2Tstate-time: ~D~%" (-> this state-time))
|
|
(format #t "~2Tactive?: ~A~%" (-> this active?))
|
|
(format #t "~2Trats-to-spawn: ~D~%" (-> this rats-to-spawn))
|
|
(format #t "~2Tactor-group: #x~X~%" (-> this actor-group))
|
|
(dotimes (s5-0 (-> this actor-group-count))
|
|
(format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0))
|
|
)
|
|
(format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count))
|
|
(label cfg-7)
|
|
this
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate idle (rat-spawner)
|
|
:virtual #t
|
|
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
|
|
(case message
|
|
(('die)
|
|
(go-virtual die)
|
|
)
|
|
(('child-die)
|
|
(let ((v0-0 (the-as object (max 0 (the-as int (+ (-> self rats-spawned) -1))))))
|
|
(set! (-> self rats-spawned) (the-as uint v0-0))
|
|
v0-0
|
|
)
|
|
)
|
|
)
|
|
)
|
|
:enter (behavior ()
|
|
(set-time! (-> self state-time))
|
|
(set! (-> self active?) #f)
|
|
)
|
|
:code sleep-code
|
|
:post (behavior ()
|
|
(local-vars (v1-19 symbol) (v1-37 symbol))
|
|
(when (and (time-elapsed? (-> self state-time) (seconds 0.5))
|
|
(< (-> self rats-spawned) (-> self rats-to-spawn))
|
|
(or (-> self active?) (< (vector-vector-xz-distance (-> self entity extra trans) (target-pos 0)) 163840.0))
|
|
)
|
|
(set! (-> self active?) #t)
|
|
(if (logtest? (-> self wheel-entity extra perm status) (entity-perm-status subtask-complete))
|
|
(go-virtual die)
|
|
)
|
|
(dotimes (v1-18 (-> self actor-group-count))
|
|
(dotimes (a0-6 (-> self actor-group v1-18 length))
|
|
(let ((a1-4 (-> self actor-group v1-18 data a0-6 actor)))
|
|
(when (if a1-4
|
|
(-> a1-4 extra process)
|
|
)
|
|
(set! v1-19 #f)
|
|
(goto cfg-23)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(set! v1-19 #t)
|
|
(label cfg-23)
|
|
(when (and v1-19
|
|
(begin
|
|
(let ((gp-1 (-> self entity extra trans))
|
|
(s5-1 (-> self child))
|
|
)
|
|
(while s5-1
|
|
(let ((a1-11 (new 'stack-no-clear 'event-message-block)))
|
|
(set! (-> a1-11 from) (process->ppointer self))
|
|
(set! (-> a1-11 num-params) 1)
|
|
(set! (-> a1-11 message) 'trans)
|
|
(set! (-> a1-11 param 0) (the-as uint (new 'stack-no-clear 'vector)))
|
|
(let ((s4-0 (the-as vector (send-event-function (ppointer->process s5-1) a1-11))))
|
|
(when (and s4-0 (< (vector-vector-xz-distance gp-1 s4-0) 40960.0) (< (fabs (- (-> s4-0 y) (-> gp-1 y))) 16384.0))
|
|
(set! v1-37 #t)
|
|
(goto cfg-44)
|
|
)
|
|
)
|
|
)
|
|
(set! s5-1 (-> s5-1 0 brother))
|
|
)
|
|
)
|
|
(set! v1-37 #f)
|
|
(label cfg-44)
|
|
(not v1-37)
|
|
)
|
|
)
|
|
(let ((s5-2 (-> self entity))
|
|
(gp-2 (new 'stack-no-clear 'enemy-init-by-other-params))
|
|
)
|
|
(set! (-> gp-2 trans quad) (-> s5-2 extra trans quad))
|
|
(quaternion-copy! (-> gp-2 quat) (-> s5-2 quat))
|
|
(set! (-> gp-2 entity) s5-2)
|
|
(set! (-> gp-2 directed?) #f)
|
|
(set! (-> gp-2 no-initial-move-to-ground?) #f)
|
|
(set! (-> gp-2 art-level) #f)
|
|
(let ((s5-3 (get-process *default-dead-pool* rat #x4000 1)))
|
|
(if (ppointer->handle (when s5-3
|
|
(let ((t9-7 (method-of-type process activate)))
|
|
(t9-7 s5-3 self "rat" (the-as pointer #x70004000))
|
|
)
|
|
(run-now-in-process s5-3 enemy-init-by-other self gp-2)
|
|
(-> s5-3 ppointer)
|
|
)
|
|
)
|
|
(+! (-> self rats-spawned) 1)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(set-time! (-> self state-time))
|
|
)
|
|
)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate die (rat-spawner)
|
|
:virtual #t
|
|
:enter (behavior ()
|
|
(logior! (-> self entity extra perm status) (entity-perm-status subtask-complete))
|
|
)
|
|
:code (behavior ()
|
|
(let ((gp-0 (current-time)))
|
|
(until (time-elapsed? gp-0 (seconds 1))
|
|
(suspend)
|
|
)
|
|
)
|
|
(while (-> self child)
|
|
(suspend)
|
|
)
|
|
(process-entity-status! self (entity-perm-status dead) #t)
|
|
)
|
|
)
|
|
|
|
;; definition for method 11 of type rat-spawner
|
|
;; INFO: Used lq/sq
|
|
(defmethod init-from-entity! ((this rat-spawner) (arg0 entity-actor))
|
|
(local-vars (sv-16 res-tag))
|
|
(set! (-> this wheel-entity) (entity-actor-lookup (-> this entity) 'alt-actor 0))
|
|
(set! (-> this rats-spawned) (the-as uint 0))
|
|
(set! (-> this rats-to-spawn)
|
|
(res-lump-value (-> this entity) 'extra-id uint :default (the-as uint128 1) :time -1000000000.0)
|
|
)
|
|
(set! sv-16 (new 'static 'res-tag))
|
|
(let ((v1-2 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16))))
|
|
(cond
|
|
((and v1-2 (nonzero? (-> sv-16 elt-count)))
|
|
(set! (-> this actor-group) (the-as (pointer actor-group) v1-2))
|
|
(set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count)))
|
|
)
|
|
(else
|
|
(set! (-> this actor-group) (the-as (pointer actor-group) #f))
|
|
(set! (-> this actor-group-count) 0)
|
|
0
|
|
)
|
|
)
|
|
)
|
|
(if (logtest? (-> arg0 extra perm status) (entity-perm-status subtask-complete))
|
|
(go (method-of-object this die))
|
|
(go (method-of-object this idle))
|
|
)
|
|
)
|