Files
Hat Kid 949508d0ed decomp3: traffic/citizen/faction code, desert-rescue (#3506)
- `cty-faction-h`
- `nav-graph`
- `citizen-h`
- `citizen`
- `civilian`
- `traffic-engine`
- `traffic-manager`
- `cty-attack-controller`
- `cty-faction`
- `formation-object`
- `formations`
- `squad-control-city-h`
- `squad-control-city`
- `traffic-util`
- `wlander-female`
- `wlander-h`
- `wlander-male`
- `speech-manager`
- `desert-rescue`
- `desresc-path`
- `neo-satellite`
- `rope-prim-system-h`
- `rope-prim-system`
- `rope-system`
- `wland-passenger`
- `cty-guard-projectile`
- `ctywide-init`
- `ff-squad-control`
- `guard-grenade`
- `guard-rifle`
- `guard-states`
- `guard-tazer`
- `ctywide-speech`
- `citizen-chick`
- `citizen-fat`
- `citizen-norm`
- `guard`
- `bike`
- `car`
- `test-bike`
- `vehicle-rider`
- `desert-rescue-bbush`
- `ff-squad-control-h`
- `flee-info`
- `guard-h`
- `mission-squad-control`
- `kg-squad-control`
- `kg-squad-member-h`
- `kg-squad-member`
- `mh-squad-control`
- `mh-squad-member-h`
- `mh-squad-member`
- `ctywide-obs-h`
- `ctywide-obs`
- `ctywide-part`
- `ctywide-scenes`
- `ctywide-tasks`
- `ctywide-texture`
- `billiards`
- `guide-arrow`
- `kg-vehicles`
- `flying-turret`
- `roboguard-city`
- `citizen-enemy`
- `metalhead-flitter`
- `metalhead-grunt`
- `metalhead-predator`
- `spydroid`
- `kg-squad-control-h`
- `mh-squad-control-h`
- `krimson-wall`
- `ctyport-obs`
- `ctyinda-obs`
- `ctyinda-part`
- `ctyindb-obs`
- `ctyindb-part`
- `ctyport-attack`
- `h-torpedo`
- `ctyport-part`
- `ctyport-scenes`
- `external-player-control`
- `desert-chase-path-h`
- `desert-chase-path`
- `desert-chase`
- `desert-jump`
- `wcar-catapult`
- `bombbot-h`
- `bombbot`
- `bombbot-path`
- `cty-hijack-missile`
- `cty-hijack`
- `ctyport-attack-bbush`
- `ctysluma-part`
- `ctyslumb-part`
- `ctyslumc-obs`
- `ctyslumc-part`
- `searchlight`
- `cty-destroy-grid`
- `ctyfarm-obs`
- `ctyfarma-part`
- `ctyfarmb-part`
- `freehq-part`
- `freehq-scenes`
- `onintent-scenes`
- `onintent-part`
- `cty-sniper-battery`
- `cty-sniper-turret`
- `intro-obs`
- `intro-part`
- `intro-scenes`
- `palcab-part`
- `palroof-part`
2024-05-09 19:18:55 -04:00

2113 lines
75 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: mantis.gc
;; name in dgo: mantis
;; dgos: STAA, VOCA
;; +++mantis-flag
(defenum mantis-flag
:type uint16
:bitfield #t
(tracked 0)
(attack1-enabled 1)
)
;; ---mantis-flag
;; DECOMP BEGINS
(defpartgroup group-mantis-dust-puff
:id 1405
:duration (seconds 0.017)
:flags (sp0)
:bounds (static-bspherem 0 0 0 8)
:parts ((sp-item 4631))
)
(defpart 4631
:init-specs ((:texture (bigpuff level-default-sprite))
(:num 6.0)
(:scale-x (meters 0.6) (meters 0.4))
(:rot-z (degrees 0) (degrees 360))
(:scale-y :copy scale-x)
(:r 32.0 8.0)
(:g 16.0 8.0)
(:b 16.0 8.0)
(:a 32.0 32.0)
(:vel-y (meters 0.01) (meters 0.0026666666))
(:scalevel-x (meters 0.0016666667))
(:rotvel-z (degrees -0.2) (degrees 0.4))
(:scalevel-y :copy scalevel-x)
(:fade-r -0.35555556)
(:fade-g -0.35555556)
(:fade-b -0.35555556)
(:fade-a -0.30476192)
(:accel-y (meters -0.00033333333))
(:timer (seconds 0.4))
(:flags (sp-cpuinfo-flag-2))
(:next-time (seconds 0.2))
(:next-launcher 4632)
(:conerot-x (degrees 60) (degrees 30))
(:conerot-y (degrees 0) (degrees 360))
(:rotate-y (degrees 0) (degrees 180))
)
)
(defpartgroup group-mantis-birth-nest
:id 1406
:duration (seconds 7.335)
:linger-duration (seconds 4)
:flags (sp0)
:bounds (static-bspherem 0 3 0 8)
:parts ((sp-item 4635 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 7.335) :length (seconds 0.835) :binding 4633)
(sp-item 4635 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 7.335) :length (seconds 0.667) :binding 4633)
(sp-item 4635 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 7.335) :length (seconds 0.5) :binding 4633)
(sp-item 4635 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 7.335) :length (seconds 0.335) :binding 4633)
(sp-item 4636 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 7.335) :length (seconds 0.4) :binding 4634)
(sp-item 4634 :flags (sp1 sp2))
(sp-item 4634 :flags (sp1 sp2))
(sp-item 4634 :flags (sp1 sp2))
(sp-item 4634 :flags (sp1 sp2))
(sp-item 4634 :flags (sp1 sp2))
(sp-item 4634 :flags (sp1 sp2))
(sp-item 4634 :flags (sp1 sp2))
(sp-item 4634 :flags (sp1 sp2))
(sp-item 4634 :flags (sp1 sp2))
(sp-item 4634 :flags (sp1 sp2))
(sp-item 4634 :flags (sp1 sp2))
(sp-item 4634 :flags (sp1 sp2))
(sp-item 4634 :flags (sp1 sp2))
(sp-item 4634 :flags (sp1 sp2))
(sp-item 4634 :flags (sp1 sp2))
(sp-item 4634 :flags (sp1 sp2))
(sp-item 4634 :flags (sp1 sp2))
(sp-item 4634 :flags (sp1 sp2))
(sp-item 4634 :flags (sp1 sp2))
(sp-item 4634 :flags (sp1 sp2))
(sp-item 4634 :flags (sp1 sp2))
(sp-item 4634 :flags (sp1 sp2))
(sp-item 4634 :flags (sp1 sp2))
(sp-item 4634 :flags (sp1 sp2))
(sp-item 4634 :flags (sp1 sp2))
(sp-item 4634 :flags (sp1 sp2))
(sp-item 4634 :flags (sp1 sp2))
(sp-item 4634 :flags (sp1 sp2))
(sp-item 4634 :flags (sp1 sp2))
(sp-item 4634 :flags (sp1 sp2))
(sp-item 4634 :flags (sp1 sp2))
(sp-item 4634 :flags (sp1 sp2))
(sp-item 4634 :flags (sp1 sp2))
(sp-item 4634 :flags (sp1 sp2))
(sp-item 4633 :flags (sp1 sp2))
(sp-item 4633 :flags (sp1 sp2))
(sp-item 4633 :flags (sp1 sp2))
(sp-item 4633 :flags (sp1 sp2))
(sp-item 4633 :flags (sp1 sp2))
(sp-item 4633 :flags (sp1 sp2))
(sp-item 4633 :flags (sp1 sp2))
(sp-item 4633 :flags (sp1 sp2))
(sp-item 4633 :flags (sp1 sp2))
(sp-item 4633 :flags (sp1 sp2))
(sp-item 4633 :flags (sp1 sp2))
(sp-item 4633 :flags (sp1 sp2))
(sp-item 4633 :flags (sp1 sp2))
(sp-item 4633 :flags (sp1 sp2))
(sp-item 4633 :flags (sp1 sp2))
(sp-item 4633 :flags (sp1 sp2))
(sp-item 4633 :flags (sp1 sp2))
(sp-item 4633 :flags (sp1 sp2))
(sp-item 4633 :flags (sp1 sp2))
(sp-item 4633 :flags (sp1 sp2))
(sp-item 4633 :flags (sp1 sp2))
(sp-item 4633 :flags (sp1 sp2))
(sp-item 4633 :flags (sp1 sp2))
(sp-item 4633 :flags (sp1 sp2))
(sp-item 4633 :flags (sp1 sp2))
(sp-item 4633 :flags (sp1 sp2))
(sp-item 4633 :flags (sp1 sp2))
(sp-item 4633 :flags (sp1 sp2))
(sp-item 4633 :flags (sp1 sp2))
(sp-item 4633 :flags (sp1 sp2))
(sp-item 4633 :flags (sp1 sp2))
(sp-item 4633 :flags (sp1 sp2))
(sp-item 4637 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 7.335) :length (seconds 1.067))
)
)
(defpart 4635
:init-specs ((:texture (rockbit01 level-default-sprite))
(:birth-func 'birth-func-texture-group)
(:num 0.1 0.5)
(:x (meters 0) (meters 1))
(:scale-x (meters 0.1) (meters 0.1))
(:rot-z (degrees 0) (degrees 360))
(:scale-y (meters 0.1) (meters 0.1))
(:r 200.0 55.0)
(:g :copy r)
(:b :copy g)
(:a 128.0)
(:vel-y (meters 0.06666667) (meters 0.033333335))
(:rotvel-z (degrees -1.2) (degrees 2.4))
(:accel-y (meters -0.002) (meters -0.002))
(:friction 0.98)
(:timer (seconds 1.167))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13))
(:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x408b00 #x40a200 #x40a600 #x40aa00))
(:func 'check-drop-level-mantis-dirt-rubble-nest)
(:conerot-x (degrees 0) (degrees 15))
(:conerot-y (degrees 0) (degrees 360))
(:rotate-y (degrees 0) (degrees 360))
(:conerot-radius (meters 0.1))
)
)
(defpart 4634
:init-specs ((:texture (bigpuff level-default-sprite))
(:num 0.0 0.2)
(:sound (static-sound-spec "debris-fall" :num 0.01 :group 0 :volume 100.0))
(:scale-x (meters 0.3) (meters 0.1))
(:scale-y (meters 1) (meters 0.2))
(:r 160.0 16.0)
(:g 130.0 32.0)
(:b 110.0 16.0)
(:a 16.0 16.0)
(:vel-y (meters 0) (meters -0.0033333334))
(:scalevel-x (meters 0.0033333334) (meters 0.0016666667))
(:scalevel-y (meters 0) (meters 0.00033333333))
(:fade-a -0.042666666 -0.064)
(:accel-y (meters -0.00033333333) (meters -0.00033333333))
(:timer (seconds 0.835))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13))
(:func 'check-drop-group-center)
(:rotate-y (degrees 0) (degrees 360))
)
)
(defpart 4633
:init-specs ((:texture (bigpuff level-default-sprite))
(:num 0.0 0.2)
(:scale-x (meters 0.3) (meters 0.1))
(:scale-y (meters 1) (meters 0.2))
(:r 160.0 16.0)
(:g 130.0 32.0)
(:b 110.0 16.0)
(:a 16.0 16.0)
(:vel-y (meters 0) (meters -0.0033333334))
(:scalevel-x (meters 0.0033333334) (meters 0.0016666667))
(:scalevel-y (meters 0) (meters 0.00033333333))
(:fade-a -0.042666666 -0.064)
(:accel-y (meters -0.00033333333) (meters -0.00033333333))
(:timer (seconds 2.5))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13))
(:func 'check-drop-group-center)
(:rotate-y (degrees 0) (degrees 360))
)
)
(defpart 4637
:init-specs ((:texture (bigpuff level-default-sprite))
(:num 1.0 1.0)
(:scale-x (meters 1) (meters 0.5))
(:scale-y (meters 1) (meters 0.5))
(:r 160.0 16.0)
(:g 130.0 32.0)
(:b 110.0 16.0)
(:a 16.0 48.0)
(:vel-y (meters 0.026666667) (meters 0.026666667))
(:scalevel-x (meters 0.006666667) (meters 0.0016666667))
(:scalevel-y (meters 0.0033333334) (meters 0.0016666667))
(:fade-a -0.053333335 -0.053333335)
(:accel-y (meters 0) (meters 0.00033333333))
(:friction 0.85 0.05)
(:timer (seconds 8))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13))
(:conerot-x (degrees 0) (degrees 90))
(:conerot-y (degrees 0) (degrees 360))
(:conerot-radius (meters 0) (meters 0.5))
)
)
(deftype mantis-jump-info (structure)
((distance float)
(search-step uint32)
(destination vector :inline)
(direction uint16)
(start-anim uint32)
(air-anim uint32)
(land-anim uint32)
)
)
(deftype mantis (nav-enemy)
((base-height float)
(flags mantis-flag)
(attack-timer time-frame :offset 632)
(track-timer time-frame)
(gspot-timer time-frame)
(gspot-normal vector :inline)
(my-up-vector vector :inline)
(jump mantis-jump-info :inline)
)
(:state-methods
crawl
attack0
attack1
ambush-crawling
ambush-jumping
undefined
roll-right
roll-left
hop-away
)
(:methods
(mantis-method-199 (_type_) none)
(mantis-method-200 (_type_) none)
(mantis-method-201 (_type_ vector vector) symbol)
(mantis-method-202 (_type_ process-focusable vector) none)
(mantis-method-203 (_type_ process-focusable vector) none)
(mantis-method-204 (_type_ process-focusable vector) none)
(mantis-method-205 (_type_ vector) none)
(mantis-method-206 (_type_) object)
)
)
(defskelgroup skel-mantis mantis mantis-lod0-jg mantis-idle0-ja
((mantis-lod0-mg (meters 999999)))
:bounds (static-spherem 0 1.5 0 4)
:shadow mantis-shadow-mg
)
(define *fact-info-mantis-defaults*
(new 'static 'fact-info-enemy-defaults :idle-distance (meters 80) :pickup-type 9)
)
(define *mantis-nav-enemy-info*
(new 'static 'nav-enemy-info
:use-die-falling #f
:use-victory #f
:use-jump-blocked #f
:debug-draw-neck #f
:jump-debug-draw #f
:move-to-ground #t
:hover-if-no-ground #f
:idle-anim-script (new 'static 'inline-array idle-control-frame 6
(new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30)
(new 'static 'idle-control-frame
:command (idle-control-cmd play)
:anim #x5
:param0 2
:param1 5
: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 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 #x6
: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 #x8
:param0 1
:param1 1
:param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0))
)
(new 'static 'idle-control-frame)
)
:idle-anim 5
:notice-anim 5
:hostile-anim 9
:hit-anim 5
:knocked-anim -1
:knocked-land-anim -1
:die-anim 24
:die-falling-anim -1
:victory-anim 5
:jump-wind-up-anim -1
:jump-in-air-anim -1
:jump-land-anim -1
:neck-joint -1
:sound-hit (static-sound-name "mantis-hit")
:sound-die (static-sound-name "mantis-die")
:notice-distance (meters 60)
:notice-distance-delta (meters 10)
:proximity-notice-distance (meters 2)
:default-hit-points 2.0
:gnd-collide-with (collide-spec backgnd)
:overlaps-others-collide-with-filter (collide-spec jak bot player-list)
:movement-gravity (meters -100)
:friction 0.8
:attack-shove-back (meters 3)
:attack-shove-up (meters 2)
:attack-mode 'generic
:attack-damage 2
:recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher)
:knocked-can-land-timeout (seconds 0.1)
:knocked-recover-timeout (seconds 2)
:ragdoll-blend-out-time (seconds 0.5)
:ragdoll-rotate-velocity-mult 0.5
:jump-height-min (meters 3)
:jump-height-factor 0.3
: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 106496.0
:knocked-red-vxz-hi 106496.0
:knocked-red-vy-lo 55296.0
:knocked-red-vy-hi 55296.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.9971 :y -0.0748 :z -0.0134 :w 36483.785)
:scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0)
:bg-collide-with (collide-spec backgnd player-list)
:joint-setup (new 'static 'boxed-array :type ragdoll-joint-setup
(new 'static 'ragdoll-joint-setup
:joint-index 3
:parent-joint -1
:geo-tform (new 'static 'vector :x -1.0 :w 13.471289)
:axial-slop 2037.7144
:max-angle 3884.5737
:coll-rad 2090.1887
)
(new 'static 'ragdoll-joint-setup
:joint-index 4
:parent-joint -1
:pre-tform (new 'static 'vector :x 1.0 :w 32761.248)
:geo-tform (new 'static 'vector :x 1.0 :w 42658.984)
:axial-slop 2037.7144
:max-angle 3884.5737
:coll-rad 2226.176
)
(new 'static 'ragdoll-joint-setup
:joint-index 5
:parent-joint -1
:pre-tform (new 'static 'vector :x 1.0 :w 11229.412)
:geo-tform (new 'static 'vector :x 1.0 :w 24710.967)
:axial-slop 2037.7144
:max-angle 3884.5737
:coll-rad 2618.5728
)
(new 'static 'ragdoll-joint-setup
:joint-index 6
:parent-joint -1
:pre-tform (new 'static 'vector :x 1.0 :w 24711.021)
:geo-tform (new 'static 'vector :x -1.0 :w 15281.083)
:axial-slop 2037.7144
:max-angle 3884.5737
:coll-rad 1776.8448
)
(new 'static 'ragdoll-joint-setup
:joint-index 7
:parent-joint -1
:pre-tform (new 'static 'vector :x -1.0 :w 15281.139)
:geo-tform (new 'static 'vector :x -1.0 :w 6391.1797)
:axial-slop 2037.7144
:max-angle 3884.5737
:coll-rad 1776.8448
)
(new 'static 'ragdoll-joint-setup
:joint-index 8
:parent-joint 4
:pre-tform (new 'static 'vector :x 0.2151 :z -0.9765 :w 10876.719)
:geo-tform (new 'static 'vector :x -0.1855 :y -0.62 :z 0.7622 :w 17803.783)
:axial-slop 2037.7144
:max-angle 3884.5737
:coll-rad 1776.8448
)
(new 'static 'ragdoll-joint-setup
:joint-index 9
:parent-joint -1
:pre-tform (new 'static 'vector :x -0.6612 :z -0.7501 :w 12233.223)
:geo-tform (new 'static 'vector :x 0.3946 :y 0.5706 :z 0.7201 :w 39090.094)
:axial-slop 2037.7144
:max-angle 3884.5737
:coll-rad 1776.8448
)
(new 'static 'ragdoll-joint-setup
:joint-index 10
:parent-joint -1
:pre-tform (new 'static 'vector :x 0.5381 :z -0.8428 :w 18789.955)
:geo-tform (new 'static 'vector :x -0.2331 :y 0.8744 :z -0.4254 :w 42089.312)
:axial-slop 2037.7144
:max-angle 3884.5737
:coll-rad 1776.8448
)
(new 'static 'ragdoll-joint-setup
:joint-index 11
:parent-joint 4
:pre-tform (new 'static 'vector :x 0.2154 :z 0.9765 :w 10870.493)
:geo-tform (new 'static 'vector :x -0.1858 :y 0.6201 :z -0.7621 :w 17800.434)
:axial-slop 2037.7144
:max-angle 3884.5737
:coll-rad 1776.8448
)
(new 'static 'ragdoll-joint-setup
:joint-index 12
:parent-joint -1
:pre-tform (new 'static 'vector :x -0.661 :z 0.7503 :w 12238.302)
:geo-tform (new 'static 'vector :x -0.3946 :y 0.5706 :z 0.7201 :w 26445.633)
:axial-slop 2037.7144
:max-angle 3884.5737
:coll-rad 1776.8448
)
(new 'static 'ragdoll-joint-setup
:joint-index 13
:parent-joint -1
:pre-tform (new 'static 'vector :x 0.538 :z 0.8428 :w 18789.955)
:geo-tform (new 'static 'vector :x -0.442 :y 0.3925 :z 0.8065 :w 28348.29)
:axial-slop 2037.7144
:max-angle 3884.5737
:coll-rad 1776.8448
)
(new 'static 'ragdoll-joint-setup
:joint-index 14
:parent-joint 3
:pre-tform (new 'static 'vector :x 1.0 :w 16.09273)
:geo-tform (new 'static 'vector :x -1.0 :w 10.176285)
:axial-slop 2037.7144
:max-angle 3884.5737
:coll-rad 2218.8032
)
(new 'static 'ragdoll-joint-setup
:joint-index 15
:parent-joint -1
:pre-tform (new 'static 'vector :x 0.1803 :z -0.9835 :w 15569.134)
:geo-tform (new 'static 'vector :x -0.7427 :y -0.3083 :z 0.5942 :w 16228.461)
:axial-slop 2037.7144
:max-angle 3884.5737
:coll-rad 1867.3665
)
(new 'static 'ragdoll-joint-setup
:joint-index 16
:parent-joint -1
:pre-tform (new 'static 'vector :x -0.9287 :z 0.3707 :w 15249.116)
:geo-tform (new 'static 'vector :x 0.7979 :y -0.5517 :z 0.2424 :w 10499.832)
:axial-slop 2037.7144
:max-angle 3884.5737
:coll-rad 1776.8448
)
(new 'static 'ragdoll-joint-setup
:joint-index 17
:parent-joint -1
:pre-tform (new 'static 'vector :x 0.8309 :z 0.5562 :w 8636.462)
:geo-tform (new 'static 'vector :x -0.7625 :y -0.604 :z -0.2316 :w 9720.991)
:axial-slop 2037.7144
:max-angle 3884.5737
:coll-rad 1612.5952
)
(new 'static 'ragdoll-joint-setup
:joint-index 18
:parent-joint -1
:pre-tform (new 'static 'vector :x -0.8309 :z -0.5562 :w 7639.1494)
:geo-tform (new 'static 'vector :x 0.8246 :y 0.4477 :z 0.3457 :w 43655.15)
:axial-slop 2037.7144
:max-angle 3884.5737
:coll-rad 575.8976
)
(new 'static 'ragdoll-joint-setup
:joint-index 19
:parent-joint -1
:pre-tform (new 'static 'vector :x -0.4901 :z -0.8716 :w 18501.959)
:geo-tform (new 'static 'vector :x 0.5913 :y -0.662 :z 0.4603 :w 18066.91)
:axial-slop 2037.7144
:max-angle 3884.5737
:coll-rad 291.6352
)
(new 'static 'ragdoll-joint-setup
:joint-index 20
:parent-joint 14
:pre-tform (new 'static 'vector :x 0.1809 :z 0.9834 :w 15566.401)
:geo-tform (new 'static 'vector :x 0.7719 :y -0.5517 :z -0.3156 :w 21170.258)
:axial-slop 2037.7144
:max-angle 3884.5737
:coll-rad 1776.8448
)
(new 'static 'ragdoll-joint-setup
:joint-index 21
:parent-joint -1
:pre-tform (new 'static 'vector :x -0.9434 :z -0.3315 :w 16345.443)
:geo-tform (new 'static 'vector :x 0.9059 :y -0.2048 :z -0.3704 :w 42454.566)
:axial-slop 2037.7144
:max-angle 3884.5737
:coll-rad 1776.8448
)
(new 'static 'ragdoll-joint-setup
:joint-index 22
:parent-joint -1
:pre-tform (new 'static 'vector :x 0.7134 :z -0.7006 :w 10535.239)
:geo-tform (new 'static 'vector :x 0.9107 :y 0.1783 :z -0.3724 :w 24186.316)
:axial-slop 2037.7144
:max-angle 3884.5737
:coll-rad 1609.728
)
(new 'static 'ragdoll-joint-setup
:joint-index 23
:parent-joint -1
:pre-tform (new 'static 'vector :x -0.7134 :z 0.7006 :w 9318.982)
:geo-tform (new 'static 'vector :x 0.7173 :y 0.4697 :z -0.5145 :w 17036.283)
:axial-slop 2037.7144
:max-angle 3884.5737
:coll-rad 762.6752
)
(new 'static 'ragdoll-joint-setup
:joint-index 24
:parent-joint -1
:pre-tform (new 'static 'vector :x -0.4661 :z 0.8847 :w 18186.404)
:geo-tform (new 'static 'vector :x 0.7531 :y -0.3756 :z -0.5401 :w 42831.836)
:axial-slop 2037.7144
:max-angle 3884.5737
:coll-rad 278.1184
)
(new 'static 'ragdoll-joint-setup
:joint-index 25
:parent-joint 14
:pre-tform (new 'static 'vector :x 1.0 :w 9033.228)
:geo-tform (new 'static 'vector :x -1.0 :w 2230.7363)
:axial-slop 2037.7144
:max-angle 3884.5737
:coll-rad 1776.8448
)
(new 'static 'ragdoll-joint-setup
:joint-index 26
:parent-joint -1
:pre-tform (new 'static 'vector :x -1.0 :w 2230.718)
:geo-tform (new 'static 'vector :x 1.0 :w 3975.4866)
:axial-slop 2037.7144
:max-angle 3884.5737
:coll-rad 1492.1729
)
(new 'static 'ragdoll-joint-setup
:joint-index 27
:parent-joint -1
:pre-tform (new 'static 'vector :x 1.0 :w 3975.505)
:geo-tform (new 'static 'vector :x 1.0 :w 2262.5393)
:axial-slop 2037.7144
:max-angle 3884.5737
:coll-rad 823.7056
)
(new 'static 'ragdoll-joint-setup
:joint-index 28
:parent-joint -1
:pre-tform (new 'static 'vector :x 1.0 :w 2262.5576)
:geo-tform (new 'static 'vector :x -1.0 :w 1645.4996)
:axial-slop 2037.7144
:max-angle 3884.5737
:coll-rad 800.3584
)
)
)
:shadow-size (meters 1)
:shadow-max-y (meters 1)
:shadow-min-y (meters -1)
:shadow-locus-dist (meters 150)
:gem-joint 7
:gem-seg #x2
:gem-no-seg #x4
:gem-offset (new 'static 'sphere :y 1286.144 :z 122.88 :r 327680.0)
:knocked-off #t
:callback-info #f
:use-momentum #f
:use-frustration #t
:use-stop-chase #f
:use-circling #t
:use-pacing #t
:walk-anim 9
:turn-anim 5
:run-anim 9
:taunt-anim -1
:run-travel-speed (meters 6)
:run-acceleration (meters 1)
:run-turning-acceleration (meters 50)
:walk-travel-speed (meters 3)
:walk-acceleration (meters 1)
:walk-turning-acceleration (meters 20)
:maximum-rotation-rate (degrees 720)
:notice-nav-radius (meters 10)
:frustration-distance (meters 8)
:frustration-time (seconds 4)
:blocked-time (seconds 0.3)
:circle-dist-lo 20480.0
:circle-dist-hi 61440.0
:nav-mesh #f
)
)
(set! (-> *mantis-nav-enemy-info* fact-defaults) *fact-info-mantis-defaults*)
(defstate active (mantis)
:virtual #t
:trans (behavior ()
(let ((t9-1 (-> (find-parent-state) trans)))
(if t9-1
(t9-1)
)
)
(if (logtest? (-> self flags) (mantis-flag tracked))
(mantis-method-199 self)
)
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.2))
(until #f
(let ((gp-0 (set-reaction-time! self (seconds 0.01) (seconds 0.017))))
(dotimes (s5-0 gp-0)
(ja-no-eval :group! mantis-idle0-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
)
)
(ja-no-eval :group! mantis-idle0-to-idle1-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(let ((gp-1 (rnd-int self 3)))
(dotimes (s5-1 gp-1)
(ja-no-eval :group! mantis-idle1-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
)
)
(ja-no-eval :group! mantis-idle1-to-idle0-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
)
#f
)
:post nav-enemy-face-focus-post
)
(defstate ambush (mantis)
:virtual #t
:enter (behavior ()
(when (logtest? (-> self enemy-flags) (enemy-flag enable-on-notice))
(logclear! (-> self enemy-flags) (enemy-flag enable-on-notice))
(let ((gp-0 (-> self on-notice)))
(if gp-0
(script-eval gp-0 :vector (-> self root trans))
)
)
)
(let ((v1-12 (-> self root root-prim)))
(set! (-> v1-12 prim-core collide-as) (collide-spec))
(set! (-> v1-12 prim-core collide-with) (collide-spec))
)
0
(let* ((gp-1 *target*)
(a0-4 (if (type? gp-1 process-focusable)
gp-1
)
)
)
(when a0-4
(let* ((gp-2 (-> self root))
(s3-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (get-trans a0-4 0) (-> gp-2 trans)) 1.0))
(f0-0 (deg-diff (quaternion-y-angle (-> gp-2 quat)) (vector-y-angle s3-0)))
)
(quaternion-rotate-y! (-> gp-2 quat) (-> gp-2 quat) f0-0)
)
)
)
)
:code (behavior ()
(let ((v1-0 (new 'stack-no-clear 'vector)))
(set! (-> v1-0 quad) (-> self root trans quad))
(+! (-> v1-0 y) -18841.6)
(cond
((logtest? (-> *part-group-id-table* 1406 flags) (sp-group-flag sp13))
(set! (-> *launch-matrix* trans quad) (-> v1-0 quad))
(part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1406))
)
(else
(set! (-> *launch-matrix* trans quad) (-> v1-0 quad))
(part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1406))
)
)
)
(let ((gp-2 (current-time)))
(until (time-elapsed? gp-2 (seconds 0.3))
(suspend)
)
)
(logior! (-> self draw status) (draw-control-status no-draw))
(let ((gp-3 (current-time)))
(until (time-elapsed? gp-3 (the int (* 300.0 (rnd-float-range self 0.0 0.6))))
(suspend)
)
)
(logclear! (-> self draw status) (draw-control-status no-draw))
(let* ((v1-45 (-> self nav))
(a1-7 (-> self root trans))
(f0-6 (-> v1-45 extra-nav-sphere w))
)
(set! (-> v1-45 extra-nav-sphere quad) (-> a1-7 quad))
(set! (-> v1-45 extra-nav-sphere w) f0-6)
)
0
(let ((v1-48 (-> self nav)))
(set! (-> v1-48 extra-nav-sphere w) (-> self root nav-radius))
)
0
(let ((v1-50 (-> self nav)))
(logior! (-> v1-50 shape nav-flags) (nav-flags has-extra-sphere))
)
0
(if (rnd-chance? self 0.5)
(go-virtual ambush-jumping)
(go-virtual ambush-crawling)
)
)
)
(defstate ambush-crawling (mantis)
:virtual #t
:event enemy-event-handler
:exit (behavior ()
;; og:preserve-this fix potential use-after-free bug
(if (-> self nav)
(let ((v1-0 (-> self nav)))
(logclear! (-> v1-0 shape nav-flags) (nav-flags has-extra-sphere))
)
)
0
)
:code (behavior ()
(set-look-at-mode! self 1)
(set! (-> self root trans y) (-> self base-height))
(ja-channel-push! 1 0)
(ja-no-eval :group! mantis-ground-crawl-out-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(let ((v1-28 (-> self root root-prim)))
(set! (-> v1-28 prim-core collide-as) (-> self root backup-collide-as))
(set! (-> v1-28 prim-core collide-with) (-> self root backup-collide-with))
)
(go-virtual hostile)
)
:post nav-enemy-simple-post
)
(defstate ambush-jumping (mantis)
:virtual #t
:event enemy-event-handler
: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
(set-look-at-mode! self 1)
(set-time! (-> self state-time))
(set! (-> self root trans y) (+ -18841.6 (-> self base-height)))
(let ((gp-0 (-> self root)))
(let ((v1-11 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> gp-0 quat))))
(vector-reset! (-> gp-0 transv))
(set! (-> v1-11 y) 0.0)
)
(vector-reset! (-> gp-0 transv))
(set! (-> gp-0 transv y) (* 4096.0 (rnd-float-range self 28.0 32.0)))
)
)
:exit (-> (method-of-type mantis ambush-crawling) exit)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.2))
(ja-no-eval :group! mantis-ground-jump-out-ja :num! (seek!))
(until #f
(if (< (-> self base-height) (-> self root trans y))
(goto cfg-5)
)
(suspend)
(ja :num! (seek!))
)
#f
(until #f
(label cfg-5)
(when (< (+ 819.2 (-> self base-height)) (-> self root trans y))
(let ((v1-32 (-> self root root-prim)))
(set! (-> v1-32 prim-core collide-as) (-> self root backup-collide-as))
(set! (-> v1-32 prim-core collide-with) (-> self root backup-collide-with))
)
(goto cfg-9)
)
(suspend)
(ja :num! (seek!))
)
#f
(until #f
(label cfg-9)
(if (or (and (>= (fabs (* 4096.0 (seconds-per-frame))) (-> self root transv y))
(>= (+ 4096.0 (-> self base-height)) (-> self root trans y))
)
(or (logtest? (-> self root status) (collide-status on-ground))
(>= (fabs (* 40.96 (seconds-per-frame))) (-> self root transv y))
)
)
(goto cfg-27)
)
(suspend)
(if (not (ja-done? 0))
(ja :num! (seek!))
)
)
#f
(label cfg-27)
(ja-channel-push! 1 (seconds 0.05))
(ja-no-eval :group! mantis-ground-jump-out-land-ja :num! (seek! max 1.2) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! max 1.2))
)
(let ((gp-0 (current-time)))
(until (time-elapsed? gp-0 (seconds 1))
(if (logtest? (-> self root status) (collide-status on-ground))
(goto cfg-35)
)
(suspend)
)
)
(label cfg-35)
(go-virtual hostile)
)
:post nav-enemy-falling-post
)
(defstate hostile (mantis)
:virtual #t
:exit (behavior ()
(logclear! (-> self flags) (mantis-flag attack1-enabled))
)
:trans (behavior ()
(rlet ((acc :class vf)
(vf0 :class vf)
(vf4 :class vf)
(vf5 :class vf)
(vf6 :class vf)
(vf7 :class vf)
)
(init-vf0-vector)
(let ((t9-0 (-> (method-of-type nav-enemy hostile) trans)))
(if t9-0
(t9-0)
)
)
(let ((gp-0 (handle->process (-> self focus handle))))
(when gp-0
(let* ((s4-0 (-> self focus-pos))
(s5-1 (vector-! (new 'stack-no-clear 'vector) s4-0 (-> self root trans)))
)
(let ((s2-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (get-quat (the-as process-focusable gp-0) 0)))
(s1-0 s5-1)
)
(let ((s3-1 s5-1))
(let ((v1-14 (* 2.0 (vector-length (get-transv (the-as process-focusable gp-0))))))
(.mov vf7 v1-14)
)
(.lvf vf5 (&-> s2-1 quad))
(.lvf vf4 (&-> s3-1 quad))
)
(.add.x.vf vf6 vf0 vf0 :mask #b1000)
(.mul.x.vf acc vf5 vf7 :mask #b111)
(.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111)
(.svf (&-> s1-0 quad) vf6)
)
(let ((f30-1 (vector-length s5-1)))
(when (not (logtest? (-> self flags) (mantis-flag tracked)))
(cond
((not (time-elapsed? (-> self attack-timer) (seconds 5)))
(if (and (< 73728.0 f30-1) (mantis-method-206 self))
(go-virtual crawl)
)
)
((< 40960.0 f30-1)
(mantis-method-202 self (the-as process-focusable gp-0) s5-1)
)
)
)
(when (and (and gp-0
(not (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status disable dead ignore grabbed)))
)
(and (time-elapsed? (-> self attack-timer) (seconds 5)) (enemy-method-104 self s4-0 8192.0) (< f30-1 32768.0))
)
(cond
((< 24576.0 f30-1)
(if (logtest? (-> self flags) (mantis-flag attack1-enabled))
(go-virtual attack1)
)
)
((< 16384.0 f30-1)
(go-virtual attack0)
)
)
)
)
(if (enemy-method-104 self s4-0 10922.667)
(mantis-method-199 self)
)
(if (logtest? (-> self flags) (mantis-flag tracked))
(mantis-method-204 self (the-as process-focusable gp-0) s5-1)
(mantis-method-203 self (the-as process-focusable gp-0) s5-1)
)
)
)
)
)
)
)
(defstate crawl (mantis)
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(set-time! (-> self state-time))
(change-to (nav-mesh-from-res-tag (-> self entity) 'nav-mesh-actor 1) self)
(nav-enemy-method-177 self)
(let ((v1-6 (-> self nav)))
(set! (-> v1-6 max-rotation-rate) 21845.334)
)
0
)
:exit (behavior ()
(change-to (nav-mesh-from-res-tag (-> self entity) 'nav-mesh-actor 0) self)
;; og:preserve-this fix potential use-after-free bug
(if (-> self nav)
(let ((v1-2 (-> self nav)))
(set! (-> v1-2 max-rotation-rate) (-> self enemy-info maximum-rotation-rate))
)
)
0
)
:trans (behavior ()
(nav-enemy-method-171 self)
(if (logtest? (-> self flags) (mantis-flag tracked))
(go-virtual hostile)
)
)
:code (behavior ()
(until #f
(ja-channel-push! 1 (seconds 0.3))
(let ((v1-0 self))
(set! (-> v1-0 enemy-flags) (the-as enemy-flag (logclear (-> v1-0 enemy-flags) (enemy-flag ef37))))
(set! (-> v1-0 nav callback-info) *null-nav-callback-info*)
)
0
(dotimes (gp-0 (set-reaction-time! self 1 (seconds 0.007)))
(ja-no-eval :group! mantis-idle0-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
)
(let ((gp-1 (handle->process (-> self focus handle))))
(cond
((or (not gp-1) (< (the-as int (-> self focus aware)) 1))
(go-virtual idle)
)
(else
(let* ((s5-0 (-> self root trans))
(s4-1 (vector-! (new 'stack-no-clear 'vector) (-> self focus-pos) s5-0))
(s0-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))
(s2-0 (new 'stack-no-clear 'vector))
(s3-0 (new 'stack-no-clear 'vector))
)
(let ((f30-1 (* 4096.0 (rnd-float-range self 8.0 12.0)))
(s1-0 (closest-point-on-mesh (-> self nav) s5-0 s5-0 (the-as nav-poly #f)))
)
(vector-normalize-copy! s2-0 s4-1 1.0)
(vector-rotate-around-y! s2-0 s2-0 (if (< 0.0 (vector-dot s2-0 s0-0))
-16384.0
16384.0
)
)
(vector-float*! s3-0 s2-0 f30-1)
(clamp-vector-to-mesh-cross-gaps
(-> self nav)
s5-0
s1-0
s3-0
204.8
#f
(the-as clamp-travel-vector-to-mesh-return-info #f)
)
(when (< (vector-length s3-0) (+ -819.2 f30-1))
(vector-float*! s3-0 s2-0 (- f30-1))
(clamp-vector-to-mesh-cross-gaps
(-> self nav)
s5-0
s1-0
s3-0
204.8
#f
(the-as clamp-travel-vector-to-mesh-return-info #f)
)
(if (< (vector-length s3-0) (+ -819.2 f30-1))
(mantis-method-202 self (the-as process-focusable gp-1) s4-1)
)
)
)
(vector+! (-> self move-dest) s5-0 s3-0)
)
(let ((a0-21 (-> self nav state))
(v1-70 (-> self move-dest))
)
(logclear! (-> a0-21 flags) (nav-state-flag directional-mode))
(logior! (-> a0-21 flags) (nav-state-flag target-poly-dirty))
(set! (-> a0-21 target-pos quad) (-> v1-70 quad))
)
0
)
)
)
(ja-channel-push! 1 (seconds 0.3))
(let ((v1-73 self))
(if (not (logtest? (enemy-flag ef37) (-> v1-73 enemy-flags)))
(set! (-> v1-73 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-73 enemy-flags))))
)
(set! (-> v1-73 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-73 enemy-flags))))
(set! (-> v1-73 nav callback-info) (-> v1-73 enemy-info callback-info))
)
0
(dotimes (gp-2 (set-reaction-time! self (seconds 0.01) (seconds 0.017)))
(ja-no-eval :group! mantis-run0-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(if (and (time-elapsed? (-> self attack-timer) (seconds 5)) (< 1 (the-as int (-> self focus aware))))
(go-virtual hostile)
)
(if (< (vector-vector-xz-distance (-> self root trans) (-> self move-dest)) 13107.2)
(goto cfg-38)
)
)
(label cfg-38)
)
#f
)
:post nav-enemy-travel-post
)
(defstate attack0 (mantis)
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(set-time! (-> self state-time))
(let ((v1-2 self))
(if (not (logtest? (enemy-flag ef37) (-> v1-2 enemy-flags)))
(set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-2 enemy-flags))))
)
(set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-2 enemy-flags))))
(set! (-> v1-2 nav callback-info) (-> v1-2 enemy-info callback-info))
)
0
(set-time! (-> self attack-timer))
)
: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 ()
(logior! (-> self focus-status) (focus-status dangerous))
(let ((v1-2 (-> self nav)))
(set! (-> v1-2 target-speed) 81920.0)
)
0
(ja-no-eval :group! mantis-attack0-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(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-34 self))
(set! (-> v1-34 enemy-flags) (the-as enemy-flag (logclear (-> v1-34 enemy-flags) (enemy-flag ef37))))
(set! (-> v1-34 nav callback-info) *null-nav-callback-info*)
)
0
(ja-no-eval :group! mantis-attack0-land-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(nav-enemy-method-177 self)
(let ((v1-63 self))
(if (not (logtest? (enemy-flag ef37) (-> v1-63 enemy-flags)))
(set! (-> v1-63 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-63 enemy-flags))))
)
(set! (-> v1-63 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-63 enemy-flags))))
(set! (-> v1-63 nav callback-info) (-> v1-63 enemy-info callback-info))
)
0
(go-hostile self)
)
:post nav-enemy-chase-post
)
(defstate attack1 (mantis)
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(set-time! (-> self state-time))
(set-time! (-> self attack-timer))
)
: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 ()
(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
(ja-no-eval :group! mantis-attack1-wind-up-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(let ((a0-5 (handle->process (-> self focus handle))))
(if a0-5
(seek-to-point-toward-point!
(-> self root)
(get-trans (the-as process-focusable a0-5) 0)
(-> self nav max-rotation-rate)
(seconds 0.02)
)
)
)
(suspend)
(ja :num! (seek!))
)
(let ((v1-36 self))
(if (not (logtest? (enemy-flag ef37) (-> v1-36 enemy-flags)))
(set! (-> v1-36 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-36 enemy-flags))))
)
(set! (-> v1-36 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-36 enemy-flags))))
(set! (-> v1-36 nav callback-info) (-> v1-36 enemy-info callback-info))
)
0
(logior! (-> self focus-status) (focus-status dangerous))
(let ((v1-41 (-> self nav)))
(set! (-> v1-41 target-speed) 286720.0)
)
0
(ja-no-eval :group! mantis-attack1-go-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(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-73 self))
(set! (-> v1-73 enemy-flags) (the-as enemy-flag (logclear (-> v1-73 enemy-flags) (enemy-flag ef37))))
(set! (-> v1-73 nav callback-info) *null-nav-callback-info*)
)
0
(ja-no-eval :group! mantis-attack1-land-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(nav-enemy-method-177 self)
(let ((v1-102 self))
(if (not (logtest? (enemy-flag ef37) (-> v1-102 enemy-flags)))
(set! (-> v1-102 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-102 enemy-flags))))
)
(set! (-> v1-102 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-102 enemy-flags))))
(set! (-> v1-102 nav callback-info) (-> v1-102 enemy-info callback-info))
)
0
(go-hostile self)
)
:post nav-enemy-chase-post
)
(defbehavior mantis-roll-post mantis ()
(let ((gp-0 (new 'stack-no-clear 'collide-query)))
(if (set-ground-pat! self gp-0 (collide-spec backgnd) 8192.0 81920.0 1024.0 (the-as process #f))
(set! (-> self root trans y) (-> gp-0 best-other-tri intersect y))
)
)
(nav-enemy-simple-post)
(none)
)
(defstate roll-right (mantis)
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(let ((gp-0 (new 'stack-no-clear 'vector)))
(vector-x-quaternion! gp-0 (-> self root quat))
(vector+float*! (-> self move-dest) (-> self root trans) gp-0 -40960.0)
)
(closest-point-on-mesh (-> self nav) (-> self move-dest) (-> self move-dest) (the-as nav-poly #f))
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.2))
(ja-no-eval :group! mantis-roll-right-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(vector-seek! (-> self root trans) (-> self move-dest) (* 88064.0 (seconds-per-frame)))
(suspend)
(ja :num! (seek!))
)
(ja-no-eval :group! mantis-roll-right-land-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(logior! (-> self flags) (mantis-flag attack1-enabled))
(go-hostile self)
)
:post mantis-roll-post
)
(defstate roll-left (mantis)
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(let ((gp-0 (new 'stack-no-clear 'vector)))
(vector-x-quaternion! gp-0 (-> self root quat))
(vector+float*! (-> self move-dest) (-> self root trans) gp-0 34119.68)
)
(closest-point-on-mesh (-> self nav) (-> self move-dest) (-> self move-dest) (the-as nav-poly #f))
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.067))
(ja-no-eval :group! mantis-hop-left-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(vector-seek! (-> self root trans) (-> self move-dest) (* 102400.0 (seconds-per-frame)))
(suspend)
(ja :num! (seek!))
)
(ja-no-eval :group! mantis-hop-left-land-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(go-hostile self)
)
:post mantis-roll-post
)
(defstate hop-away (mantis)
:virtual #t
:event enemy-event-handler
:enter (behavior ()
(set-time! (-> self state-time))
(set-look-at-mode! self 1)
(logior! (-> self enemy-flags) (enemy-flag cam-attack-mode))
(let ((v1-6 self))
(if (not (logtest? (enemy-flag ef37) (-> v1-6 enemy-flags)))
(set! (-> v1-6 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-6 enemy-flags))))
)
(set! (-> v1-6 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-6 enemy-flags))))
(set! (-> v1-6 nav callback-info) (-> v1-6 enemy-info callback-info))
)
0
(nav-enemy-method-176 self)
(let ((v1-11 self))
(set! (-> v1-11 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-11 enemy-flags))))
)
0
(logclear! (-> self mask) (process-mask actor-pause))
(set-time! (-> self starting-time))
)
:trans (behavior ()
'()
)
:code (behavior ()
(rlet ((acc :class vf)
(vf0 :class vf)
(vf4 :class vf)
(vf5 :class vf)
(vf6 :class vf)
(vf7 :class vf)
)
(init-vf0-vector)
(ja-channel-push! 1 (seconds 0.2))
(until #f
(let ((gp-0 (handle->process (-> self focus handle))))
(when gp-0
(let* ((v1-5 (-> self focus-pos))
(s5-1 (vector-! (new 'stack-no-clear 'vector) v1-5 (-> self root trans)))
)
(let ((s4-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (get-quat (the-as process-focusable gp-0) 0))))
(if (and (>= (vector-length s5-1) 122880.0) (mantis-method-206 self))
(go-virtual crawl)
)
(let ((s2-0 s5-1))
(let ((s3-1 s5-1))
(let ((v1-21 (* 0.2 (vector-length (get-transv (the-as process-focusable gp-0))))))
(.mov vf7 v1-21)
)
(.lvf vf5 (&-> s4-1 quad))
(.lvf vf4 (&-> s3-1 quad))
)
(.add.x.vf vf6 vf0 vf0 :mask #b1000)
(.mul.x.vf acc vf5 vf7 :mask #b111)
(.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111)
(.svf (&-> s2-0 quad) vf6)
)
)
(if (not (or (mantis-method-203 self (the-as process-focusable gp-0) s5-1) (not (mantis-method-206 self))))
(go-virtual crawl)
)
)
(if (and (time-elapsed? (-> self state-time) (-> self reaction-time))
(>= (the-as int (-> self focus aware)) 3)
(get-focus! self)
)
(go-hostile self)
)
)
)
(dotimes (gp-1 (set-reaction-time! self (seconds 0.007) (seconds 0.015)))
(ja-no-eval :group! mantis-idle0-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
)
)
#f
)
)
:post nav-enemy-face-focus-post
)
(defmethod go-ambush-delay ((this mantis))
(let ((s5-0 (new 'stack-no-clear 'collide-query)))
(if (enemy-above-ground? this s5-0 (-> this root trans) (collide-spec backgnd) 8192.0 81920.0 1024.0)
(set! (-> this base-height) (-> s5-0 best-other-tri intersect y))
(set! (-> this base-height) (-> this root trans y))
)
)
(let ((s5-1 (new 'stack-no-clear 'collide-query)))
(let ((s4-0 (new 'stack-no-clear 'inline-array 'sphere 6)))
(dotimes (s3-0 6)
((method-of-type sphere new) (the-as symbol (-> s4-0 s3-0)) sphere)
)
(set! (-> s4-0 0 quad) (-> this root trans quad))
(set! (-> s4-0 0 y) (+ (-> this base-height) (* 0.5 (-> this root root-prim prim-core world-sphere w))))
(set! (-> s4-0 0 r) (-> this root root-prim prim-core world-sphere w))
(let ((v1-16 s5-1))
(set! (-> v1-16 best-dist) (the-as float s4-0))
(set! (-> v1-16 best-other-prim) (the-as collide-shape-prim 1))
(set! (-> v1-16 collide-with) (collide-spec jak bot crate obstacle hit-by-others-list player-list))
(set! (-> v1-16 ignore-process0) #f)
(set! (-> v1-16 ignore-process1) #f)
(set! (-> v1-16 ignore-pat)
(new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1)
)
(set! (-> v1-16 best-my-prim) (the-as collide-shape-prim #t))
(set! (-> v1-16 action-mask) (collide-action solid))
)
)
(if (not (fill-and-probe-using-spheres *collide-cache* s5-1))
(go (method-of-object this ambush))
)
)
)
(defmethod event-handler ((this mantis) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(case arg2
(('track)
(if (and (-> arg3 param 0) (time-elapsed? (-> this track-timer) (seconds 0.5)))
'abort
#t
)
)
(('tracked)
(logior! (-> this flags) (mantis-flag tracked))
(let ((v0-0 (the-as object (current-time))))
(set! (-> this track-timer) (the-as time-frame v0-0))
v0-0
)
)
(('hit 'hit-knocked)
(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)
(cond
((= (-> this hit-points) 0.0)
(let ((s5-1 (-> this incoming knocked-type)))
(cond
((and (= s5-1 (knocked-type yellow-shot))
(not (and (-> this next-state) (let ((v1-39 (-> this next-state name)))
(or (= v1-39 'knocked) (= v1-39 'jump) (= v1-39 'jump-land))
)
)
)
(zero? (rnd-int this 3))
(let ((f0-2 (vector-vector-distance-squared (-> this root trans) (target-pos 0)))
(f1-2 32768.0)
)
(>= f0-2 (* f1-2 f1-2))
)
)
(go-die this)
)
((or (= s5-1 (knocked-type yellow-shot)) (= s5-1 (knocked-type blue-shot)))
(set! (-> this incoming knocked-type) (knocked-type none))
(go (method-of-object this knocked))
)
(else
(go (method-of-object this knocked))
)
)
)
)
(else
(go (method-of-object this knocked))
)
)
#t
)
(else
((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3)
)
)
)
;; WARN: Return type mismatch symbol vs pat-surface.
(defmethod set-ground-pat! ((this mantis) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float) (arg5 process))
(the-as
pat-surface
(when (find-ground (-> this root) arg0 arg1 arg2 arg3 arg4 (the-as process #f))
(set! (-> this root ground-pat) (-> arg0 best-other-tri pat))
(when (time-elapsed? (-> this gspot-timer) (seconds 0.2))
(let ((a1-2 (new 'stack-no-clear 'collide-query)))
(set! (-> a1-2 start-pos quad) (-> this root gspot-pos quad))
(+! (-> a1-2 start-pos y) 2048.0)
(set-vector! (-> a1-2 move-dist) 0.0 -6144.0 0.0 0.0)
(let ((v1-10 a1-2))
(set! (-> v1-10 radius) 4915.2)
(set! (-> v1-10 collide-with) arg1)
(set! (-> v1-10 ignore-process0) this)
(set! (-> v1-10 ignore-process1) #f)
(set! (-> v1-10 ignore-pat) (-> this root pat-ignore-mask))
(set! (-> v1-10 action-mask) (collide-action solid))
)
(fill-using-line-sphere *collide-cache* a1-2)
)
(let ((s5-1 (new 'stack-no-clear 'vector)))
(vector-reset! s5-1)
(dotimes (s4-1 (-> *collide-cache* num-tris))
(let* ((v1-16 (-> *collide-cache* tris s4-1))
(s2-1 (vector-! (new 'stack-no-clear 'vector) (-> v1-16 vertex 1) (the-as vector (-> v1-16 vertex))))
(s1-1 (vector-! (new 'stack-no-clear 'vector) (-> v1-16 vertex 2) (the-as vector (-> v1-16 vertex))))
(s3-0 (new 'stack-no-clear 'vector))
)
(vector-normalize! s2-1 1.0)
(vector-normalize! s1-1 1.0)
(vector-cross! s3-0 s2-1 s1-1)
(if (< (cos 10922.667) (vector-dot s3-0 *y-vector*))
(vector+! s5-1 s5-1 s3-0)
)
)
)
(vector-normalize-copy! (-> this gspot-normal) s5-1 1.0)
)
(set-time! (-> this gspot-timer))
)
#t
)
)
)
(defmethod mantis-method-206 ((this mantis))
(let ((a0-2 (nav-mesh-from-res-tag (-> this entity) 'nav-mesh-actor 1))
(gp-0 (new 'stack-no-clear 'vector))
)
(and a0-2
(nav-mesh-method-10 a0-2 gp-0 (-> this root trans) (the-as nav-poly #f))
(< (vector-vector-xz-distance gp-0 (-> this root trans)) 2048.0)
)
)
)
(defmethod mantis-method-205 ((this mantis) (arg0 vector))
(cond
((= (-> this root gspot-pos y) -40959590.0)
(set! (-> arg0 y) 0.0)
(vector-normalize! arg0 1.0)
(quaternion-set! (-> this root quat) 0.0 (-> arg0 x) 0.0 (+ 1.0 (-> arg0 z)))
(quaternion-normalize! (-> this root quat))
)
(else
(let ((s4-0 (new 'stack-no-clear 'vector)))
(set! (-> s4-0 quad) (-> *up-vector* quad))
(let ((s3-0 (new 'stack-no-clear 'quaternion)))
(quaternion-from-two-vectors-max-angle! s3-0 s4-0 (-> this gspot-normal) 10922.667)
(vector-orient-by-quat! s4-0 s4-0 s3-0)
)
(let ((s3-1 (-> this my-up-vector)))
(vector-deg-seek s3-1 s3-1 s4-0 (* 8192.0 (seconds-per-frame)))
(vector-normalize! s3-1 1.0)
(set! (-> arg0 y) 0.0)
(vector-normalize! arg0 1.0)
(forward-up-nopitch->quaternion (-> this root quat) arg0 s3-1)
)
)
)
)
0
(none)
)
(defmethod normalize-heading! ((this mantis) (arg0 nav-control))
(let ((t9-0 (method-of-object this mantis-method-205))
(a2-0 (-> arg0 state))
(a1-1 (new 'stack-no-clear 'vector))
)
(set! (-> a1-1 quad) (-> a2-0 heading quad))
(t9-0 this a1-1)
)
0
(none)
)
;; WARN: Return type mismatch vector vs none.
(defmethod enemy-common-post ((this mantis))
(local-vars (s5-0 vector))
(let ((t9-0 (method-of-type nav-enemy enemy-common-post)))
(t9-0 this)
)
(logclear! (-> this flags) (mantis-flag tracked))
(let ((a0-4 (handle->process (-> this focus handle))))
(set! s5-0 (when a0-4
(set! s5-0 (-> this focus-pos))
(set! (-> s5-0 quad) (-> (get-trans (the-as process-focusable a0-4) 0) quad))
s5-0
)
)
)
(none)
)
;; WARN: Return type mismatch object vs none.
(defmethod mantis-method-199 ((this mantis))
(let ((s3-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)))
(s4-0 (-> this root))
(s5-0 (lambda ((arg0 mantis) (arg1 collide-shape-moving) (arg2 vector))
(let ((s3-0 (new 'stack-no-clear 'vector))
(f30-0 (vector-length arg2))
)
(clamp-vector-to-mesh-cross-gaps
(-> arg0 nav)
(-> arg1 trans)
(-> arg0 nav state current-poly)
arg2
204.8
#f
(the-as clamp-travel-vector-to-mesh-return-info #f)
)
(vector+! s3-0 (-> arg1 trans) arg2)
(cond
((< (vector-vector-xz-distance (-> arg1 trans) s3-0) (+ -8192.0 f30-0))
#f
)
((let ((a1-5 (new 'stack-no-clear 'vector)))
(set! (-> a1-5 quad) (-> s3-0 quad))
(set! (-> a1-5 w) (-> arg0 root nav-radius))
(add-root-sphere-to-hash! (-> arg0 nav) a1-5 1134)
)
#f
)
(else
(let ((a1-6 (new 'stack-no-clear 'collide-query)))
(set! (-> a1-6 start-pos quad) (-> arg1 trans quad))
(set! (-> a1-6 move-dist quad) (-> arg2 quad))
(let ((v1-14 a1-6))
(set! (-> v1-14 radius) 2048.0)
(set! (-> v1-14 collide-with) (-> arg1 root-prim prim-core collide-with))
(set! (-> v1-14 ignore-process0) arg0)
(set! (-> v1-14 ignore-process1) #f)
(set! (-> v1-14 ignore-pat) (-> arg1 pat-ignore-mask))
(set! (-> v1-14 action-mask) (collide-action solid))
)
(if (>= (fill-and-probe-using-line-sphere *collide-cache* a1-6) 0.0)
#f
#t
)
)
)
)
)
)
)
)
(cond
((s5-0 this s4-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) s3-0 -40960.0))
(go (method-of-object this roll-right))
)
((s5-0 this s4-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) s3-0 34160.64))
(go (method-of-object this roll-left))
)
)
)
(none)
)
(defmethod mantis-method-200 ((this mantis))
(rlet ((acc :class vf)
(vf0 :class vf)
(vf4 :class vf)
(vf5 :class vf)
(vf6 :class vf)
(vf7 :class vf)
)
(init-vf0-vector)
(let ((s5-0 (handle->process (-> this focus handle))))
(when s5-0
(let* ((v1-4 (-> this focus-pos))
(s4-1 (vector-! (new 'stack-no-clear 'vector) v1-4 (-> this root trans)))
)
(let ((s2-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (get-quat (the-as process-focusable s5-0) 0)))
(s1-0 s4-1)
)
(let ((s3-1 s4-1))
(let ((v1-10 (* 0.2 (vector-length (get-transv (the-as process-focusable s5-0))))))
(.mov vf7 v1-10)
)
(.lvf vf5 (&-> s2-1 quad))
(.lvf vf4 (&-> s3-1 quad))
)
(.add.x.vf vf6 vf0 vf0 :mask #b1000)
(.mul.x.vf acc vf5 vf7 :mask #b111)
(.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111)
(.svf (&-> s1-0 quad) vf6)
)
(mantis-method-203 this (the-as process-focusable s5-0) s4-1)
)
)
)
(none)
)
)
(defmethod go-stare ((this mantis))
(let ((a0-2 (handle->process (-> this focus handle))))
(if (and a0-2
(and (< 81920.0 (vector-vector-xz-distance (-> this root trans) (get-trans (the-as process-focusable a0-2) 0)))
(mantis-method-206 this)
)
)
(go (method-of-object this crawl))
)
)
(go (method-of-object this hop-away))
)
(defmethod mantis-method-202 ((this mantis) (arg0 process-focusable) (arg1 vector))
(let ((s5-0 (-> this jump)))
(let* ((f0-0 (vector-length arg1))
(f0-1 (if (< 102400.0 f0-0)
81920.0
(+ -20480.0 f0-0)
)
)
)
(vector-normalize! arg1 f0-1)
)
(when (mantis-method-201 this (-> s5-0 destination) arg1)
(set! (-> s5-0 direction) (the-as uint 0))
(set! (-> s5-0 start-anim) (the-as uint 10))
(set! (-> s5-0 air-anim) (the-as uint 11))
(set! (-> s5-0 land-anim) (the-as uint 0))
(set! (-> this enemy-flags)
(the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag jump-check-blocked)))
)
(send-event this 'jump 0 (-> s5-0 destination))
)
)
0
(none)
)
(defmethod mantis-method-203 ((this mantis) (arg0 process-focusable) (arg1 vector))
(let ((s5-0 (-> this jump)))
(vector-length arg1)
(vector-normalize! arg1 1.0)
(vector-rotate-y! arg1 arg1 (* 182.04445 (rnd-float-range this -45.0 45.0)))
(let ((a2-5 (vector-normalize-copy! (new 'stack-no-clear 'vector) arg1 (* 4096.0 (rnd-float-range this -4.0 -6.0))))
)
(when (mantis-method-201 this (-> s5-0 destination) a2-5)
(set! (-> s5-0 direction) (the-as uint 1))
(set! (-> s5-0 start-anim) (the-as uint 12))
(set! (-> s5-0 air-anim) (the-as uint 13))
(set! (-> s5-0 land-anim) (the-as uint 14))
(set! (-> this enemy-flags)
(the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag jump-check-blocked)))
)
(send-event this 'jump 0 (-> s5-0 destination))
)
)
)
0
(none)
)
(defmethod mantis-method-204 ((this mantis) (arg0 process-focusable) (arg1 vector))
(let ((s5-0 (-> this jump)))
(vector-length arg1)
(vector-normalize! arg1 1.0)
(vector-rotate-y! arg1 arg1 (* 182.04445 (rnd-float-range this -45.0 45.0)))
(let ((a2-5
(vector-normalize-copy! (new 'stack-no-clear 'vector) arg1 (* 4096.0 (rnd-float-range this -15.0 -22.0)))
)
)
(when (mantis-method-201 this (-> s5-0 destination) a2-5)
(set! (-> s5-0 direction) (the-as uint 1))
(set! (-> s5-0 start-anim) (the-as uint 18))
(set! (-> s5-0 air-anim) (the-as uint 19))
(set! (-> s5-0 land-anim) (the-as uint 20))
(set! (-> this enemy-flags)
(the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag jump-check-blocked)))
)
(send-event this 'jump 0 (-> s5-0 destination))
)
)
)
0
(none)
)
(defmethod mantis-method-201 ((this mantis) (arg0 vector) (arg1 vector))
(let* ((s4-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) arg1 1.0))
(f30-0 (vector-length arg1))
(f28-0 3640.889)
(f26-0 f28-0)
(s3-1
(lambda ((arg0 mantis) (arg1 vector) (arg2 float) (arg3 int) (arg4 vector))
(local-vars (v0-3 vector))
(let* ((s3-0 (-> arg0 root trans))
(a0-2 (vector-rotate-y! (new 'stack-no-clear 'vector) arg1 (the-as float arg3)))
(s5-1 (vector+float*! (new 'stack-no-clear 'vector) s3-0 a0-2 arg2))
(s2-0 (new 'stack-no-clear 'vector))
)
(closest-point-on-mesh (-> arg0 nav) s5-1 s5-1 (the-as nav-poly #f))
(vector-! s2-0 s5-1 s3-0)
(clamp-vector-to-mesh-cross-gaps
(-> arg0 nav)
s3-0
(-> arg0 nav state current-poly)
s2-0
204.8
#f
(the-as clamp-travel-vector-to-mesh-return-info #f)
)
(when (< 0.8 (/ (vector-length s2-0) arg2))
(vector+! s5-1 s3-0 s2-0)
(let ((a1-7 (new 'stack-no-clear 'collide-query)))
(set! (-> a1-7 start-pos quad) (-> s3-0 quad))
(set! (-> a1-7 move-dist quad) (-> s2-0 quad))
(+! (-> a1-7 start-pos y) (* 1.5 (-> arg0 enemy-info jump-height-min)))
(let ((v1-17 a1-7))
(set! (-> v1-17 radius) 409.6)
(set! (-> v1-17 collide-with) (collide-spec backgnd))
(set! (-> v1-17 ignore-process0) #f)
(set! (-> v1-17 ignore-process1) #f)
(set! (-> v1-17 ignore-pat)
(new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1)
)
(set! (-> v1-17 action-mask) (collide-action solid))
)
(when (< (fill-and-probe-using-line-sphere *collide-cache* a1-7) 0.0)
(set! (-> s5-1 w) (-> arg0 root nav-radius))
(when (not (add-root-sphere-to-hash! (-> arg0 nav) s5-1 #x10046e))
(set! (-> arg4 quad) (-> s5-1 quad))
(return arg4)
v0-3
)
)
)
)
)
)
)
)
(cond
((s3-1 this s4-0 f30-0 0 arg0)
#t
)
(else
(dotimes (s2-0 2)
(if (or (s3-1 this s4-0 f30-0 (the-as int f26-0) arg0) (s3-1 this s4-0 f30-0 (the-as int (- f26-0)) arg0))
(return #t)
)
(+! f26-0 f28-0)
)
#f
)
)
)
)
(defmethod jump-wind-up-anim ((this mantis) (arg0 enemy-jump-info))
(ja-channel-push! 1 (seconds 0.1))
(let ((a1-2 (-> this draw art-group data (-> this jump start-anim)))
(a0-4 (-> this skel root-channel 0))
)
(set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2))
(set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1)))
(set! (-> a0-4 param 1) (-> arg0 anim-speed))
(set! (-> a0-4 frame-num) 0.0)
(joint-control-channel-group! a0-4 (the-as art-joint-anim a1-2) num-func-seek!)
)
#t
)
(defmethod jump-in-air-anim ((this mantis) (arg0 enemy-jump-info))
(ja-channel-push! 1 (seconds 0.1))
(let ((a1-2 (-> this draw art-group data (-> this jump air-anim)))
(a0-4 (-> this skel root-channel 0))
)
(set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2))
(set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1)))
(set! (-> a0-4 param 1) (-> arg0 anim-speed))
(set! (-> a0-4 frame-num) 0.0)
(joint-control-channel-group! a0-4 (the-as art-joint-anim a1-2) num-func-seek!)
)
#t
)
;; WARN: Return type mismatch quaternion vs none.
(defmethod enemy-method-101 ((this mantis) (arg0 int) (arg1 enemy-jump-info))
(let ((v1-0 arg0))
(when (or (zero? v1-0) (= v1-0 1) (= v1-0 2) (= v1-0 3))
(let ((a0-4 this))
(when (logtest? (enemy-flag ef38) (-> a0-4 enemy-flags))
(let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> arg1 dest-pos) (-> this root trans))))
(vector-normalize! s5-1 1.0)
(let ((v1-5 (-> this jump direction)))
(cond
((zero? v1-5)
)
((= v1-5 1)
(vector-negate! s5-1 s5-1)
)
((= v1-5 2)
(vector-rotate-y! s5-1 s5-1 -16384.0)
)
((= v1-5 3)
(vector-rotate-y! s5-1 s5-1 16384.0)
)
)
)
(seek-toward-heading-vec! (-> this root) s5-1 (-> this nav max-rotation-rate) (seconds 0.02))
)
)
)
)
)
(none)
)
(defmethod jump-land-anim ((this mantis) (arg0 enemy-jump-info))
(cond
((zero? (-> this jump land-anim))
#f
)
(else
(ja-channel-push! 1 (seconds 0.075))
(let ((a1-2 (-> this draw art-group data (-> this jump land-anim)))
(a0-4 (-> this skel root-channel 0))
)
(set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2))
(set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1)))
(set! (-> a0-4 param 1) (-> arg0 anim-speed))
(set! (-> a0-4 frame-num) 0.0)
(joint-control-channel-group! a0-4 (the-as art-joint-anim a1-2) num-func-seek!)
)
#t
)
)
)
(defmethod coin-flip? ((this mantis))
#f
)
;; WARN: Return type mismatch collide-shape-moving vs none.
(defmethod init-enemy-collision! ((this mantis))
(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 8) 0)))
(set! (-> s5-0 total-prims) (the-as uint 9))
(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 can-ride deadly no-standon))
(set-vector! (-> s4-0 local-sphere) 0.0 6144.0 0.0 17408.0)
(set! (-> s5-0 root-prim) s4-0)
)
(let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-13 prim-core collide-as) (collide-spec enemy))
(set! (-> v1-13 prim-core collide-with)
(collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list)
)
(set! (-> v1-13 prim-core action) (collide-action solid can-ride deadly no-standon))
(set-vector! (-> v1-13 local-sphere) 0.0 4915.2 0.0 4915.2)
)
(let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-15 prim-core collide-as) (collide-spec enemy))
(set! (-> v1-15 prim-core collide-with) (collide-spec jak bot player-list))
(set! (-> v1-15 prim-core action) (collide-action solid))
(set! (-> v1-15 transform-index) 7)
(set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 2048.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 jak bot player-list))
(set! (-> v1-17 prim-core action) (collide-action solid))
(set! (-> v1-17 transform-index) 13)
(set-vector! (-> v1-17 local-sphere) 0.0 0.0 0.0 2048.0)
)
(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 collide-with) (collide-spec jak bot player-list))
(set! (-> v1-19 prim-core action) (collide-action solid))
(set! (-> v1-19 transform-index) 10)
(set-vector! (-> v1-19 local-sphere) 0.0 0.0 0.0 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 collide-with) (collide-spec jak bot player-list))
(set! (-> v1-21 prim-core action) (collide-action solid deadly))
(set! (-> v1-21 transform-index) 24)
(set-vector! (-> v1-21 local-sphere) 0.0 0.0 0.0 2457.6)
)
(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 solid deadly))
(set! (-> v1-23 transform-index) 19)
(set-vector! (-> v1-23 local-sphere) 0.0 0.0 0.0 2457.6)
)
(let ((v1-25 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-25 prim-core collide-as) (collide-spec enemy))
(set! (-> v1-25 prim-core collide-with) (collide-spec jak bot player-list))
(set! (-> v1-25 prim-core action) (collide-action solid deadly))
(set! (-> v1-25 transform-index) 27)
(set-vector! (-> v1-25 local-sphere) 0.0 0.0 0.0 1228.8)
)
(let ((v1-27 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-27 prim-core collide-as) (collide-spec enemy))
(set! (-> v1-27 prim-core collide-with) (collide-spec jak bot player-list))
(set! (-> v1-27 prim-core action) (collide-action solid deadly))
(set! (-> v1-27 transform-index) 28)
(set-vector! (-> v1-27 local-sphere) 0.0 0.0 0.0 2048.0)
)
(set! (-> s5-0 nav-radius) 8192.0)
(let ((v1-29 (-> s5-0 root-prim)))
(set! (-> s5-0 backup-collide-as) (-> v1-29 prim-core collide-as))
(set! (-> s5-0 backup-collide-with) (-> v1-29 prim-core collide-with))
)
(set! (-> this root) s5-0)
)
(none)
)
(defmethod init-enemy! ((this mantis))
(initialize-skeleton
this
(the-as skeleton-group (art-group-get-by-name *level* "skel-mantis" (the-as (pointer level) #f)))
(the-as pair 0)
)
(init-enemy-defaults! this *mantis-nav-enemy-info*)
(set! (-> this flags) (mantis-flag))
(set! (-> this my-up-vector quad) (-> *y-vector* quad))
(set! (-> this gspot-normal quad) (-> *y-vector* quad))
(set! (-> this gspot-timer) 0)
(set! (-> this attack-timer) (+ (current-time) (seconds -5)))
(set! (-> this track-timer) 0)
(set! (-> this draw light-index) (the-as uint 30))
(none)
)