mirror of
https://github.com/open-goal/jak-project
synced 2026-08-15 12:59:39 -04:00
58a5440c8a
Makes a bunch of missions mostly playable, including: - `arena-training-1` - `arena-fight-1` - `wascity-chase` - `arena-fight-2` - `arena-fight-3` - `volcano-darkeco` - `desert-hover` - `nest-eggs` - `temple-climb` - `temple-oracle` - `temple-tests` - `desert-beast-battle` - `desert-turtle-training` - `desert-course-race` - `desert-artifact-race1` - `wascity-leaper-race` - `wascity-pre-game` - `sewer-met-hum` - `forest-kill-plants` - `forest-ring-chase` - `temple-defend` - `tower-destroy` - `desert-glide` --- Files: - `ripple` - `waswide-mood` - `sig-rider` - `nst-tasks` - `nst-part` - `nst-gas` - `nst-eggs-h` - `nst-obs` - `nst-mood` - `egg-spider` - `wasdoors-init` - `wasall-tasks` - `wvehicle-race` - `wcar-marauder` - `wcar-marauder-b` - `turret-control` - `was-squad-control` - `turtle-training` - `kleever-rider` - `course-race` - `artifact-race` - `desert-hover` - `desbeast-path-h` - `des-beast` - `desertg-obs` - `desertf-obs` - `desertd-obs` - `desert-dust-storm` - `des-cactus` - `race-hud` - `race-info` - `race-manager` - `tizard` - `flyingsaw` - `hover-training` - `temple-mood` - `temple-obs` - `temple-obs2` - `temple-part` - `temple-scenes` - `templex-mood` - `templex-obs` - `templex-part` - `tomb-baby-spider` - `target-turret-shot` - `target-turret` - `beast-battle-path` - `des-beast-2` - `mh-flyer` - `scorpion-gun` - `hover-enemy-h` - `hover-enemy` - `hover-formation-h` - `hover-formation` - `hover-nav-control-h` - `hover-nav-control` - `flamer-hover` - `hover-nav-templea` - `robo-hover` - `hover-nav-sewb` - `hover-nav-sewg` - `hover-nav-sewj` - `hover-nav-sewl` - `hover-nav-sewo` - `hover-nav-towera` - `tower-mood` - `tower-obs` - `tower-scenes` - `tower-part` - `eco-green-collider` - `forest-bridges` - `forest-kill-plants` - `forest-mood` - `forest-ring-chase` - `forest-tasks` - `forest-part` - `foresta-obs` - `hover-nav-foresta` - `mh-plant` - `dp-bipedal-part` - `dp-bipedal-shot` - `dp-bipedal` - `neo-spawner` - `for-turret` - `for-turret-shot` - `neo-wasp` - `neo-wasp-part` - `volcanox-scenes` - `volcanox-mood` - `volcano-scenes` - `volcano-mood` - `volcano-obs` - `volcano-obs2` - `chain-physics` - `rigid-body-plat` - `volcano-part` - `flamer-lava` - `flitter` - `spiky-frog` - `flut-wild` - `target-indax` - `target-indax-hang` - `mantis` - `volcanox-obs` - `spyder` - `wcar-faccar` - `mhcity-obs2` - `mhcity-part` - `mhcity-obs` - `dm-mine-spider` - `rapid-gunner` - `stadium-mood` - `stadium-scenes` - `stadiuma-mood` - `stadiuma-part` - `kanga-lizard` - `marauder` - `arena-scenes` - `wasstada-mood` - `wasstada-obs` - `wasstada-part` - `wasstadb-obs` - `wasstadc-obs` - `dm-flyer` - `maker-part` - `maker-projectile` - `skeet-part` - `wascity-turret` - `wasgun-h` - `wasgun-hud` - `wasgun-manager` - `nav-graph-h` - `traffic-engine-h` - `waswide-init` - `cty-borrow-manager-h` - `cty-borrow-manager` - `desert-part` - `height-map-h` - `height-map` - `traffic-height-map` - `vehicle-control` - `hvehicle-h` - `hvehicle` - `hvehicle-effects` - `hvehicle-physics` - `hvehicle-util` - `glider-h` - `glider-hud` - `glider-manager` - `glider-ring` - `glider-ring-part` - `h-glider` - `hanga-init` - `was-pre-game` - `was-leaper-race` - `flut-racer` - `desert-scenes` - `desert-lizard-h` - `desert-lizard-task` - `desert-lizard` - `throne-scenes` - `waspal-mood` - `waspala-obs` - `waspala-part` - `deswalk-obs` - `deswalk-part` - `terraformer-drone` - `terraformer-head` - `terraformer-part` - `terraformer-setup`
1358 lines
45 KiB
Common Lisp
1358 lines
45 KiB
Common Lisp
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; name: flitter.gc
|
|
;; name in dgo: flitter
|
|
;; dgos: VOCX
|
|
|
|
;; DECOMP BEGINS
|
|
|
|
(defpartgroup group-flitter-dust-puff
|
|
:id 257
|
|
:duration (seconds 0.017)
|
|
:flags (sp0)
|
|
:bounds (static-bspherem 0 0 0 8)
|
|
:parts ((sp-item 4647))
|
|
)
|
|
|
|
(defpart 4647
|
|
: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-flitter-birth
|
|
:id 1412
|
|
:duration (seconds 7.335)
|
|
:linger-duration (seconds 4)
|
|
:flags (sp0)
|
|
:bounds (static-bspherem 0 3 0 8)
|
|
:parts ((sp-item 4650 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 7.335) :length (seconds 0.835) :binding 4648)
|
|
(sp-item 4650 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 7.335) :length (seconds 0.667) :binding 4648)
|
|
(sp-item 4650 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 7.335) :length (seconds 0.5) :binding 4648)
|
|
(sp-item 4650 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 7.335) :length (seconds 0.335) :binding 4648)
|
|
(sp-item 4651 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 7.335) :length (seconds 0.4) :binding 4649)
|
|
(sp-item 4649 :flags (sp1 sp2))
|
|
(sp-item 4649 :flags (sp1 sp2))
|
|
(sp-item 4649 :flags (sp1 sp2))
|
|
(sp-item 4649 :flags (sp1 sp2))
|
|
(sp-item 4649 :flags (sp1 sp2))
|
|
(sp-item 4649 :flags (sp1 sp2))
|
|
(sp-item 4649 :flags (sp1 sp2))
|
|
(sp-item 4649 :flags (sp1 sp2))
|
|
(sp-item 4649 :flags (sp1 sp2))
|
|
(sp-item 4649 :flags (sp1 sp2))
|
|
(sp-item 4649 :flags (sp1 sp2))
|
|
(sp-item 4649 :flags (sp1 sp2))
|
|
(sp-item 4649 :flags (sp1 sp2))
|
|
(sp-item 4649 :flags (sp1 sp2))
|
|
(sp-item 4649 :flags (sp1 sp2))
|
|
(sp-item 4649 :flags (sp1 sp2))
|
|
(sp-item 4649 :flags (sp1 sp2))
|
|
(sp-item 4649 :flags (sp1 sp2))
|
|
(sp-item 4649 :flags (sp1 sp2))
|
|
(sp-item 4649 :flags (sp1 sp2))
|
|
(sp-item 4649 :flags (sp1 sp2))
|
|
(sp-item 4649 :flags (sp1 sp2))
|
|
(sp-item 4649 :flags (sp1 sp2))
|
|
(sp-item 4649 :flags (sp1 sp2))
|
|
(sp-item 4649 :flags (sp1 sp2))
|
|
(sp-item 4649 :flags (sp1 sp2))
|
|
(sp-item 4649 :flags (sp1 sp2))
|
|
(sp-item 4649 :flags (sp1 sp2))
|
|
(sp-item 4649 :flags (sp1 sp2))
|
|
(sp-item 4649 :flags (sp1 sp2))
|
|
(sp-item 4649 :flags (sp1 sp2))
|
|
(sp-item 4649 :flags (sp1 sp2))
|
|
(sp-item 4649 :flags (sp1 sp2))
|
|
(sp-item 4649 :flags (sp1 sp2))
|
|
(sp-item 4648 :flags (sp1 sp2))
|
|
(sp-item 4648 :flags (sp1 sp2))
|
|
(sp-item 4648 :flags (sp1 sp2))
|
|
(sp-item 4648 :flags (sp1 sp2))
|
|
(sp-item 4648 :flags (sp1 sp2))
|
|
(sp-item 4648 :flags (sp1 sp2))
|
|
(sp-item 4648 :flags (sp1 sp2))
|
|
(sp-item 4648 :flags (sp1 sp2))
|
|
(sp-item 4648 :flags (sp1 sp2))
|
|
(sp-item 4648 :flags (sp1 sp2))
|
|
(sp-item 4648 :flags (sp1 sp2))
|
|
(sp-item 4648 :flags (sp1 sp2))
|
|
(sp-item 4648 :flags (sp1 sp2))
|
|
(sp-item 4648 :flags (sp1 sp2))
|
|
(sp-item 4648 :flags (sp1 sp2))
|
|
(sp-item 4648 :flags (sp1 sp2))
|
|
(sp-item 4648 :flags (sp1 sp2))
|
|
(sp-item 4648 :flags (sp1 sp2))
|
|
(sp-item 4648 :flags (sp1 sp2))
|
|
(sp-item 4648 :flags (sp1 sp2))
|
|
(sp-item 4648 :flags (sp1 sp2))
|
|
(sp-item 4648 :flags (sp1 sp2))
|
|
(sp-item 4648 :flags (sp1 sp2))
|
|
(sp-item 4648 :flags (sp1 sp2))
|
|
(sp-item 4648 :flags (sp1 sp2))
|
|
(sp-item 4648 :flags (sp1 sp2))
|
|
(sp-item 4648 :flags (sp1 sp2))
|
|
(sp-item 4648 :flags (sp1 sp2))
|
|
(sp-item 4648 :flags (sp1 sp2))
|
|
(sp-item 4648 :flags (sp1 sp2))
|
|
(sp-item 4648 :flags (sp1 sp2))
|
|
(sp-item 4648 :flags (sp1 sp2))
|
|
(sp-item 4652 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 7.335) :length (seconds 1.067))
|
|
)
|
|
)
|
|
|
|
(defpart 4652
|
|
: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))
|
|
)
|
|
)
|
|
|
|
(defun check-drop-level-flitter-dirt-rubble ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector))
|
|
(let ((f30-0 (-> arg1 key origin trans y)))
|
|
(when (< (-> arg2 y) f30-0)
|
|
(let ((gp-0 (new 'stack-no-clear 'vector)))
|
|
(sp-kill-particle arg0 arg1)
|
|
(set-vector! gp-0 (-> arg2 x) f30-0 (-> arg2 z) 1.0)
|
|
(launch-particles (-> *part-id-table* 4653) gp-0)
|
|
(launch-particles (-> *part-id-table* 4654) gp-0)
|
|
(launch-particles (-> *part-id-table* 4655) gp-0)
|
|
)
|
|
)
|
|
)
|
|
(none)
|
|
)
|
|
|
|
(defpart 4649
|
|
: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 4648
|
|
: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 4651
|
|
:init-specs ((:texture (rockbit01 level-default-sprite))
|
|
(:birth-func 'birth-func-texture-group)
|
|
(:num 0.5 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.033333335) (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 #x408c00 #x40a100 #x40a200 #x40a300))
|
|
(:func 'check-drop-level-flitter-dirt-rubble)
|
|
(:conerot-x (degrees 0) (degrees 45))
|
|
(:conerot-y (degrees 0) (degrees 360))
|
|
(:rotate-y (degrees 0) (degrees 360))
|
|
(:conerot-radius (meters 0.5))
|
|
)
|
|
)
|
|
|
|
(defpart 4650
|
|
:init-specs ((:texture (rockbit02 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 #x408c00 #x40a100 #x40a200 #x40a300))
|
|
(:func 'check-drop-level-flitter-dirt-rubble-ruins)
|
|
(:conerot-x (degrees 0) (degrees 15))
|
|
(:conerot-y (degrees 0) (degrees 360))
|
|
(:rotate-y (degrees 0) (degrees 360))
|
|
(:conerot-radius (meters 0.1))
|
|
)
|
|
)
|
|
|
|
(defpart 4653
|
|
:init-specs ((:texture (rockbit03 level-default-sprite))
|
|
(:birth-func 'birth-func-texture-group)
|
|
(:num 1.0 2.0)
|
|
(:scale-x (meters 0.05) (meters 0.15))
|
|
(:rot-z (degrees 0) (degrees 360))
|
|
(:scale-y (meters 0.05) (meters 0.15))
|
|
(:r 200.0 55.0)
|
|
(:g :copy r)
|
|
(:b :copy g)
|
|
(:a 128.0)
|
|
(:vel-y (meters 0.006666667) (meters 0.026666667))
|
|
(:rotvel-z (degrees -1.2) (degrees 2.4))
|
|
(:fade-a -0.42666668 -0.85333335)
|
|
(:accel-y (meters -0.00066666666))
|
|
(:timer (seconds 2))
|
|
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13))
|
|
(:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x408b00 #x408c00 #x40a100 #x40a200 #x40a300))
|
|
(:conerot-x (degrees 10) (degrees 60))
|
|
(:conerot-y (degrees 0) (degrees 360))
|
|
)
|
|
)
|
|
|
|
(defpart 4654
|
|
:init-specs ((:texture (rockbit04 level-default-sprite))
|
|
(:birth-func 'birth-func-texture-group)
|
|
(:num 1.0 1.0)
|
|
(:scale-x (meters 0.05) (meters 0.15))
|
|
(:rot-z (degrees 0) (degrees 360))
|
|
(:scale-y (meters 0.05) (meters 0.15))
|
|
(:r 200.0 55.0)
|
|
(:g :copy r)
|
|
(:b :copy g)
|
|
(:a 128.0)
|
|
(:vel-y (meters 0) (meters 0.04))
|
|
(:rotvel-z (degrees -1.2) (degrees 2.4))
|
|
(:friction 0.94 0.02)
|
|
(:timer (seconds 8))
|
|
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13))
|
|
(:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x408b00 #x408c00 #x40a100 #x40a200 #x40a300))
|
|
(:next-time (seconds 1.5) (seconds 0.497))
|
|
(:next-launcher 4656)
|
|
(:conerot-x (degrees 90))
|
|
(:conerot-y (degrees 0) (degrees 360))
|
|
)
|
|
)
|
|
|
|
(defpart 4656
|
|
:init-specs ((:rotvel-z (degrees 0)) (:fade-a -0.10666667 -0.10666667))
|
|
)
|
|
|
|
(defpart 4655
|
|
:init-specs ((:texture (bigpuff level-default-sprite))
|
|
(:num 1.0)
|
|
(:sound (static-sound-spec "debris-ground" :num 0.01 :group 0 :volume 100.0))
|
|
(:scale-x (meters 1) (meters 0.5))
|
|
(:scale-y (meters 0.5) (meters 0.5))
|
|
(:r 160.0 16.0)
|
|
(:g 130.0 32.0)
|
|
(:b 110.0 16.0)
|
|
(:a 16.0 32.0)
|
|
(:vel-y (meters 0.013333334) (meters 0.026666667))
|
|
(:scalevel-x (meters 0.0033333334) (meters 0.0016666667))
|
|
(:scalevel-y (meters 0.0033333334) (meters 0.0016666667))
|
|
(:fade-a -0.026666667 -0.026666667)
|
|
(:accel-y (meters 0) (meters 0.00033333333))
|
|
(:friction 0.9 0.05)
|
|
(:timer (seconds 8))
|
|
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13))
|
|
(:conerot-x (degrees 70) (degrees 20))
|
|
(:conerot-y (degrees 0) (degrees 360))
|
|
)
|
|
)
|
|
|
|
(deftype flitter (nav-enemy)
|
|
((move-angle float)
|
|
(heading symbol)
|
|
(change-dir-time time-frame)
|
|
(last-change-dir time-frame)
|
|
(off-screen-timer time-frame)
|
|
(amb-sound-timer time-frame)
|
|
(attack-time time-frame)
|
|
(target-pos vector :inline)
|
|
(attack-pos vector :inline)
|
|
(base-height float)
|
|
(minimap connection-minimap)
|
|
)
|
|
(:state-methods
|
|
attack
|
|
ambush-jumping
|
|
)
|
|
(:methods
|
|
(flitter-method-192 (_type_) none)
|
|
(play-amb (_type_) none)
|
|
(flitter-method-194 (_type_ process-focusable) symbol)
|
|
(lerp-between-attack-pos-and-trans (_type_) float)
|
|
)
|
|
)
|
|
|
|
|
|
(defskelgroup skel-flitter flitter flitter-lod0-jg -1
|
|
((flitter-lod0-mg (meters 20)) (flitter-lod1-mg (meters 40)) (flitter-lod2-mg (meters 999999)))
|
|
:bounds (static-spherem 0 0 0 5.5)
|
|
:shadow flitter-shadow-mg
|
|
:origin-joint-index 3
|
|
)
|
|
|
|
(define *flitter-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 16
|
|
(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 3
|
|
:param1 6
|
|
:param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0))
|
|
)
|
|
(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 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 #x7
|
|
:param0 15
|
|
:param1 30
|
|
:param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0))
|
|
)
|
|
(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 4
|
|
:param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0))
|
|
)
|
|
(new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30)
|
|
(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
|
|
:command (idle-control-cmd play)
|
|
:anim #x9
|
|
:param0 10
|
|
:param1 20
|
|
:param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0))
|
|
)
|
|
(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 1
|
|
:param1 2
|
|
:param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0))
|
|
)
|
|
(new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30)
|
|
(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
|
|
:command (idle-control-cmd play)
|
|
:anim #x9
|
|
:param0 15
|
|
:param1 30
|
|
:param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0))
|
|
)
|
|
(new 'static 'idle-control-frame)
|
|
)
|
|
:idle-anim 5
|
|
:notice-anim 12
|
|
:hostile-anim 14
|
|
:hit-anim 5
|
|
:knocked-anim 20
|
|
:knocked-land-anim 21
|
|
:die-anim 19
|
|
:die-falling-anim 18
|
|
:victory-anim 5
|
|
:jump-wind-up-anim 5
|
|
:jump-in-air-anim 5
|
|
:jump-land-anim 5
|
|
:neck-joint -1
|
|
:look-at-joint 28
|
|
:bullseye-joint 3
|
|
:sound-hit (static-sound-name "flitter-hit")
|
|
:sound-die (static-sound-name "flitter-die")
|
|
:notice-distance (meters 40)
|
|
:notice-distance-delta (meters 10)
|
|
:proximity-notice-distance (meters 20)
|
|
:default-hit-points 1.0
|
|
:gnd-collide-with (collide-spec backgnd)
|
|
:overlaps-others-collide-with-filter (collide-spec jak bot player-list)
|
|
:penetrate-knocked (penetrate
|
|
generic-attack
|
|
flop
|
|
punch
|
|
spin
|
|
roll
|
|
uppercut
|
|
bonk
|
|
tube
|
|
flut-attack
|
|
board
|
|
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
|
|
knocked
|
|
)
|
|
:movement-gravity (meters -100)
|
|
:friction 0.8
|
|
:attack-shove-back (meters 6)
|
|
:attack-shove-up (meters 3)
|
|
:attack-mode 'generic
|
|
:attack-damage 1
|
|
: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.25)
|
|
:ragdoll-rotate-velocity-mult 1.0
|
|
:jump-height-min (meters 3)
|
|
:jump-height-factor 0.5
|
|
:knocked-seek-ry-clamp 2730.6667
|
|
:knocked-soft-vxz-lo 72089.6
|
|
:knocked-soft-vxz-hi 108134.4
|
|
:knocked-soft-vy-lo 81920.0
|
|
:knocked-soft-vy-hi 122880.0
|
|
:knocked-medium-vxz-lo 147456.0
|
|
:knocked-medium-vxz-hi 196608.0
|
|
:knocked-medium-vy-lo 135168.0
|
|
:knocked-medium-vy-hi 151552.0
|
|
:knocked-hard-vxz-lo 78643.2
|
|
:knocked-hard-vxz-hi 117964.8
|
|
:knocked-hard-vy-lo 183500.8
|
|
:knocked-hard-vy-hi 275251.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 #f
|
|
:shadow-size (meters 2)
|
|
:shadow-max-y (meters 1)
|
|
:shadow-min-y (meters -1)
|
|
:shadow-locus-dist (meters 150)
|
|
:gem-joint 28
|
|
:gem-seg #x2
|
|
:gem-no-seg #x4
|
|
:gem-offset (new 'static 'sphere :y 696.32 :z 1843.2 :r 163840.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 13
|
|
:turn-anim 15
|
|
:run-anim 14
|
|
:taunt-anim -1
|
|
:run-travel-speed (meters 12)
|
|
:run-acceleration (meters 8)
|
|
:run-turning-acceleration (meters 120)
|
|
:walk-travel-speed (meters 4)
|
|
:walk-acceleration (meters 1)
|
|
:walk-turning-acceleration (meters 5)
|
|
:maximum-rotation-rate (degrees 720)
|
|
:notice-nav-radius (meters 5)
|
|
:frustration-distance (meters 12)
|
|
:frustration-time (seconds 4)
|
|
:blocked-time (seconds 0.3)
|
|
:circle-dist-lo 20480.0
|
|
:circle-dist-hi 61440.0
|
|
:nav-mesh #f
|
|
)
|
|
)
|
|
|
|
(set! (-> *flitter-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*)
|
|
|
|
(defmethod flitter-method-194 ((this flitter) (arg0 process-focusable))
|
|
(and (logtest? (-> this draw status) (draw-control-status on-screen))
|
|
(let ((s4-0 (camera-matrix)))
|
|
(camera-pos)
|
|
(let* ((s3-0 (get-trans arg0 0))
|
|
(s5-1 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s4-0 fvec) 1.0))
|
|
(v1-7 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this root trans) s3-0) 1.0))
|
|
)
|
|
(< 0.0 (vector-dot s5-1 v1-7))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
(defmethod knocked-anim ((this flitter) (arg0 enemy-knocked-info))
|
|
(case (-> this incoming knocked-type)
|
|
(((knocked-type yellow-shot))
|
|
(let ((a0-2 (-> this skel root-channel 0)))
|
|
(set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 20)))
|
|
(set! (-> a0-2 param 0)
|
|
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 20)) frames num-frames) -1))
|
|
)
|
|
(set! (-> a0-2 param 1) (-> arg0 anim-speed))
|
|
(set! (-> a0-2 frame-num) 0.0)
|
|
(joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 20)) num-func-seek!)
|
|
)
|
|
#t
|
|
)
|
|
(((knocked-type blue-shot))
|
|
(let ((v1-17 (if (> (-> this skel active-channels) 0)
|
|
(-> this skel root-channel 0 frame-group)
|
|
)
|
|
)
|
|
)
|
|
(if (and v1-17 (= v1-17 (-> this draw art-group data 21)))
|
|
(ja-channel-push! 1 (seconds 0.17))
|
|
(ja-channel-push! 1 (seconds 0.02))
|
|
)
|
|
)
|
|
(let ((a0-10 (-> this skel root-channel 0)))
|
|
(set! (-> a0-10 frame-group) (the-as art-joint-anim (-> this draw art-group data 23)))
|
|
(set! (-> a0-10 param 0)
|
|
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 23)) frames num-frames) -1))
|
|
)
|
|
(set! (-> a0-10 param 1) 1.0)
|
|
(set! (-> a0-10 frame-num) 0.0)
|
|
(joint-control-channel-group! a0-10 (the-as art-joint-anim (-> this draw art-group data 23)) num-func-seek!)
|
|
)
|
|
#t
|
|
)
|
|
(else
|
|
((method-of-type nav-enemy knocked-anim) this arg0)
|
|
)
|
|
)
|
|
)
|
|
|
|
(defmethod knocked-land-anim ((this flitter) (arg0 enemy-knocked-info))
|
|
(case (-> this incoming knocked-type)
|
|
(((knocked-type blue-shot))
|
|
(when (>= (-> this incoming blue-juggle-count) (the-as uint 2))
|
|
(let ((v1-4 (-> this skel root-channel 0)))
|
|
(set! (-> v1-4 frame-group) (the-as art-joint-anim (-> this draw art-group data 22)))
|
|
(set! (-> v1-4 param 0)
|
|
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 22)) frames num-frames) -1))
|
|
)
|
|
(set! (-> v1-4 param 1) 1.0)
|
|
(set! (-> v1-4 frame-num) 0.0)
|
|
(joint-control-channel-group! v1-4 (the-as art-joint-anim (-> this draw art-group data 22)) num-func-seek!)
|
|
)
|
|
#t
|
|
)
|
|
)
|
|
(else
|
|
((method-of-type nav-enemy knocked-land-anim) this arg0)
|
|
)
|
|
)
|
|
)
|
|
|
|
(defmethod go-stare2 ((this flitter))
|
|
(if (and (= (-> this focus aware) (enemy-aware ea2))
|
|
(not (nav-enemy-method-174 this))
|
|
(not (and (-> this next-state) (= (-> this next-state name) 'pacing)))
|
|
)
|
|
(go (method-of-object this pacing))
|
|
(go (method-of-object this stare))
|
|
)
|
|
)
|
|
|
|
(defstate ambush (flitter)
|
|
: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))
|
|
)
|
|
)
|
|
)
|
|
(set! (-> self base-height) (-> self root trans y))
|
|
(let ((v1-13 (-> self root root-prim)))
|
|
(set! (-> v1-13 prim-core collide-as) (collide-spec))
|
|
(set! (-> v1-13 prim-core collide-with) (collide-spec))
|
|
)
|
|
0
|
|
(logior! (-> self draw status) (draw-control-status no-draw))
|
|
)
|
|
:code (behavior ()
|
|
(cond
|
|
((logtest? (-> *part-group-id-table* 1412 flags) (sp-group-flag sp13))
|
|
(set! (-> *launch-matrix* trans quad) (-> self root trans quad))
|
|
(part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 1412))
|
|
)
|
|
(else
|
|
(set! (-> *launch-matrix* trans quad) (-> self root trans quad))
|
|
(part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1412))
|
|
)
|
|
)
|
|
(let ((gp-2 (current-time)))
|
|
(until (time-elapsed? gp-2 (seconds 0.6))
|
|
(suspend)
|
|
)
|
|
)
|
|
(+! (-> self root trans y) -8192.0)
|
|
(update-focus self)
|
|
(let ((a0-14 (handle->process (-> self focus handle))))
|
|
(when a0-14
|
|
(let* ((gp-3 (-> self root))
|
|
(s3-0
|
|
(vector-normalize!
|
|
(vector-! (new 'stack-no-clear 'vector) (get-trans (the-as process-focusable a0-14) 0) (-> gp-3 trans))
|
|
1.0
|
|
)
|
|
)
|
|
(f0-3 (deg-diff (quaternion-y-angle (-> gp-3 quat)) (vector-y-angle s3-0)))
|
|
)
|
|
(quaternion-rotate-y! (-> gp-3 quat) (-> gp-3 quat) f0-3)
|
|
)
|
|
)
|
|
)
|
|
(let ((gp-4 (current-time)))
|
|
(until (time-elapsed? gp-4 (the int (* 300.0 (rnd-float-range self 0.0 0.6))))
|
|
(suspend)
|
|
)
|
|
)
|
|
(logclear! (-> self draw status) (draw-control-status no-draw))
|
|
(go-virtual ambush-jumping)
|
|
)
|
|
)
|
|
|
|
(defstate ambush-jumping (flitter)
|
|
: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))
|
|
(let ((gp-0 (-> self root)))
|
|
(vector-reset! (-> gp-0 transv))
|
|
(set! (-> gp-0 transv y) (* 4096.0 (rnd-float-range self 34.0 38.0)))
|
|
)
|
|
)
|
|
:code (behavior ()
|
|
(ja-channel-push! 1 (seconds 0.1))
|
|
(ja-no-eval :group! flitter-ambush-jump-ja :num! (seek!))
|
|
(until #f
|
|
(when (< (-> self base-height) (-> self root trans y))
|
|
(cond
|
|
((logtest? (-> *part-group-id-table* 257 flags) (sp-group-flag sp13))
|
|
(set! (-> *launch-matrix* trans quad) (-> self root trans quad))
|
|
(part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 257))
|
|
)
|
|
(else
|
|
(set! (-> *launch-matrix* trans quad) (-> self root trans quad))
|
|
(part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 257))
|
|
)
|
|
)
|
|
(goto cfg-14)
|
|
)
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
#f
|
|
(until #f
|
|
(when (< (+ 204.8 (-> self base-height)) (-> self root trans y))
|
|
(let ((v1-64 (-> self root root-prim)))
|
|
(set! (-> v1-64 prim-core collide-as) (-> self root backup-collide-as))
|
|
(set! (-> v1-64 prim-core collide-with) (-> self root backup-collide-with))
|
|
)
|
|
(goto cfg-15)
|
|
)
|
|
(label cfg-14)
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
#f
|
|
(until #f
|
|
(label cfg-15)
|
|
(if (or (and (>= 0.0 (-> self root transv y)) (>= (+ 1638.4 (-> self base-height)) (-> self root trans y)))
|
|
(logtest? (-> self root status) (collide-status on-ground))
|
|
)
|
|
(goto cfg-30)
|
|
)
|
|
(suspend)
|
|
(if (not (ja-done? 0))
|
|
(ja :num! (seek!))
|
|
)
|
|
)
|
|
#f
|
|
(label cfg-30)
|
|
(ja-no-eval :group! flitter-ambush-land-ja :num! (seek!) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
(until #f
|
|
(if (logtest? (-> self root status) (collide-status on-ground))
|
|
(goto cfg-37)
|
|
)
|
|
(suspend)
|
|
)
|
|
#f
|
|
(label cfg-37)
|
|
(go-virtual hostile)
|
|
)
|
|
:post nav-enemy-falling-post
|
|
)
|
|
|
|
(defmethod enemy-method-108 ((this flitter) (arg0 process-focusable))
|
|
(focus-test? arg0 mech)
|
|
)
|
|
|
|
(defmethod flitter-method-192 ((this flitter))
|
|
(let* ((s5-0 (handle->process (-> this focus handle)))
|
|
(s3-0 (if (type? s5-0 process-focusable)
|
|
s5-0
|
|
)
|
|
)
|
|
)
|
|
(when s3-0
|
|
(let* ((s5-1 (get-trans (the-as process-focusable s3-0) 0))
|
|
(s4-1 (vector-! (new 'stack-no-clear 'vector) s5-1 (-> this root trans)))
|
|
(f30-0 (vector-length s4-1))
|
|
)
|
|
(cond
|
|
((enemy-method-108 this (the-as process-focusable s3-0))
|
|
(go-flee this)
|
|
)
|
|
((and (< f30-0 32768.0) (not (flitter-method-194 this (the-as process-focusable s3-0))))
|
|
(go (method-of-object this circling))
|
|
)
|
|
((< f30-0 (-> this enemy-info notice-nav-radius))
|
|
(set! (-> this target-pos quad) (-> s5-1 quad))
|
|
(let ((s3-1 (new 'stack-no-clear 'vector)))
|
|
(set! (-> s3-1 quad) (-> s4-1 quad))
|
|
(let ((s5-2 (new 'stack-no-clear 'vector)))
|
|
(set! (-> s5-2 quad) (-> this root transv quad))
|
|
(vector-normalize! s5-2 f30-0)
|
|
(if (>= (vector-dot s3-1 s5-2) 0.98)
|
|
(go (method-of-object this attack))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
((< f30-0 32768.0)
|
|
(set! (-> this target-pos quad) (-> s5-1 quad))
|
|
)
|
|
((or (time-elapsed? (-> this last-change-dir) (-> this change-dir-time))
|
|
(< (vector-vector-distance-squared (-> this root trans) (-> this target-pos)) 0.1)
|
|
)
|
|
(set-time! (-> this last-change-dir))
|
|
(set! (-> this change-dir-time) (rand-vu-int-range (seconds 0.5) (seconds 0.7)))
|
|
(let ((s3-2 (new 'stack-no-clear 'vector))
|
|
(f0-9 (* 0.5 f30-0 (tan (-> this move-angle))))
|
|
(s2-0 (new 'stack-no-clear 'vector))
|
|
)
|
|
(if (-> this heading)
|
|
(set-vector! s3-2 (-> s4-1 z) (-> s4-1 y) (- (-> s4-1 x)) 1.0)
|
|
(set-vector! s3-2 (- (-> s4-1 z)) (-> s4-1 y) (-> s4-1 x) 1.0)
|
|
)
|
|
(set! (-> this heading) (not (-> this heading)))
|
|
(let ((f28-1 (rand-vu-float-range (* 0.75 f0-9) f0-9))
|
|
(s4-2 (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-1 (* -0.6 f30-0)))
|
|
)
|
|
(vector-normalize! s3-2 f28-1)
|
|
(vector+! s3-2 s3-2 s4-2)
|
|
)
|
|
(clamp-vector-to-mesh-cross-gaps (-> this nav state) s3-2)
|
|
(vector+! s2-0 s5-1 s3-2)
|
|
(set! (-> this target-pos quad) (-> s2-0 quad))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
0
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; WARN: Return type mismatch time-frame vs none.
|
|
(defmethod play-amb ((this flitter))
|
|
(when (time-elapsed? (-> this amb-sound-timer) (the int (* 300.0 (rand-vu-float-range 1.5 3.0))))
|
|
(sound-play "flitter-amb" :position (-> this root trans))
|
|
(set-time! (-> this amb-sound-timer))
|
|
)
|
|
(none)
|
|
)
|
|
|
|
(defbehavior flitter-fall-and-play-death-anim flitter ((arg0 art-joint-anim) (arg1 float) (arg2 time-frame))
|
|
(local-vars (v1-29 symbol))
|
|
(stop-look-at! self)
|
|
(set! (-> self skel root-channel 0 frame-group) arg0)
|
|
(let ((s4-1 (get-knockback-dir! self (new 'stack-no-clear 'vector)))
|
|
(s3-0 (-> self root))
|
|
)
|
|
(when (if (type? s3-0 collide-shape-moving)
|
|
s3-0
|
|
)
|
|
(set! (-> self root transv y) 33775.48)
|
|
(ja :num-func num-func-identity :frame-num 0.0)
|
|
(set-time! (-> self state-time))
|
|
(logclear! (-> self root status) (collide-status on-surface on-ground touch-surface))
|
|
(until v1-29
|
|
(let ((f0-2 102400.0))
|
|
(set! (-> self root transv x) (* (-> s4-1 x) f0-2))
|
|
(set! (-> self root transv z) (* (-> s4-1 z) f0-2))
|
|
)
|
|
(suspend)
|
|
(ja :num! (seek! max arg1))
|
|
(set! v1-29 (or (ja-done? 0) (time-elapsed? (-> self state-time) arg2)))
|
|
)
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
(defstate active (flitter)
|
|
:virtual #t
|
|
:post (behavior ()
|
|
(play-amb self)
|
|
(let ((t9-1 (-> (method-of-type nav-enemy active) post)))
|
|
(if t9-1
|
|
((the-as (function none) t9-1))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
(defstate stare (flitter)
|
|
:virtual #t
|
|
:code (behavior ()
|
|
(ja-channel-push! 1 (seconds 0.1))
|
|
(let ((f30-0 (rnd-float-range self 0.8 1.2)))
|
|
(until #f
|
|
(when (not (enemy-method-105 self 2730.6667 #t))
|
|
(let ((v1-5 self))
|
|
(set! (-> v1-5 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-5 enemy-flags))))
|
|
)
|
|
0
|
|
(ja-no-eval :num! (loop!))
|
|
(ja-channel-push! 1 (seconds 0.2))
|
|
(ja :group! flitter-turn-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! 0.75))
|
|
)
|
|
(let ((v1-25 self))
|
|
(set! (-> v1-25 enemy-flags) (the-as enemy-flag (logclear (-> v1-25 enemy-flags) (enemy-flag ef38))))
|
|
)
|
|
0
|
|
)
|
|
(let ((v1-29 (ja-group)))
|
|
(if (not (and v1-29 (= v1-29 (-> self draw art-group data (-> self enemy-info idle-anim)))))
|
|
(ja-channel-push! 1 (seconds 0.2))
|
|
)
|
|
)
|
|
(ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim))
|
|
:num! (seek! max f30-0)
|
|
:frame-num 0.0
|
|
)
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek! max f30-0))
|
|
)
|
|
)
|
|
)
|
|
#f
|
|
)
|
|
:post (behavior ()
|
|
(play-amb self)
|
|
(let ((t9-1 (-> (method-of-type nav-enemy stare) post)))
|
|
(if t9-1
|
|
((the-as (function none) t9-1))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
(defstate circling (flitter)
|
|
:virtual #t
|
|
:enter (behavior ()
|
|
(let ((t9-0 (-> (method-of-type nav-enemy circling) enter)))
|
|
(if t9-0
|
|
(t9-0)
|
|
)
|
|
)
|
|
(set-time! (-> self off-screen-timer))
|
|
)
|
|
:trans (behavior ()
|
|
(let ((gp-0 (handle->process (-> self focus handle))))
|
|
(if gp-0
|
|
(set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad))
|
|
)
|
|
(when (time-elapsed? (-> self state-time) (seconds 0.1))
|
|
(let ((v1-11 (-> self focus aware)))
|
|
(cond
|
|
((= v1-11 (enemy-aware ea3))
|
|
(cond
|
|
((when gp-0
|
|
(let* ((gp-1 self)
|
|
(s5-1 (method-of-object gp-1 flitter-method-194))
|
|
(s4-0 (handle->process (-> self focus handle)))
|
|
)
|
|
(s5-1 gp-1 (the-as process-focusable (if (type? s4-0 process-focusable)
|
|
s4-0
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(if (and (get-focus! self) (time-elapsed? (-> self off-screen-timer) (seconds 0.3)))
|
|
(go-hostile self)
|
|
)
|
|
)
|
|
(else
|
|
(set-time! (-> self off-screen-timer))
|
|
)
|
|
)
|
|
)
|
|
((= v1-11 (enemy-aware ea2))
|
|
(go-stare self)
|
|
)
|
|
((>= 1 (the-as int v1-11))
|
|
(go-virtual active)
|
|
)
|
|
)
|
|
)
|
|
(if (or (nav-enemy-method-174 self) (logtest? (enemy-flag ef42) (-> self enemy-flags)))
|
|
(go-stare2 self)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
:code (behavior ()
|
|
(nav-enemy-method-177 self)
|
|
(ja-channel-push! 1 (seconds 0.2))
|
|
(until #f
|
|
(ja-no-eval :group! (-> self draw art-group data (-> self enemy-info run-anim))
|
|
:num! (seek! max (rnd-float-range self 0.9 1.1))
|
|
:frame-num 0.0
|
|
)
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek! max (rnd-float-range self 0.9 1.1)))
|
|
)
|
|
)
|
|
#f
|
|
)
|
|
)
|
|
|
|
(defstate hostile (flitter)
|
|
:virtual #t
|
|
:enter (behavior ()
|
|
(set-time! (-> self last-change-dir))
|
|
(set! (-> self change-dir-time) 0)
|
|
(set! (-> self attack-time) (+ (current-time) (seconds 0.35)))
|
|
(let ((t9-0 (-> (method-of-type nav-enemy hostile) enter)))
|
|
(if t9-0
|
|
(t9-0)
|
|
)
|
|
)
|
|
)
|
|
:trans (behavior ()
|
|
(let ((t9-0 (-> (method-of-type nav-enemy hostile) trans)))
|
|
(if t9-0
|
|
(t9-0)
|
|
)
|
|
)
|
|
(flitter-method-192 self)
|
|
)
|
|
:post (behavior ()
|
|
(let ((a0-0 (-> self nav state))
|
|
(v1-1 (-> self target-pos))
|
|
)
|
|
(logclear! (-> a0-0 flags) (nav-state-flag directional-mode))
|
|
(logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty))
|
|
(set! (-> a0-0 target-pos quad) (-> v1-1 quad))
|
|
)
|
|
0
|
|
(nav-enemy-travel-post)
|
|
)
|
|
)
|
|
|
|
(defstate die (flitter)
|
|
:virtual #t
|
|
:enter (behavior ()
|
|
(sound-play "flitter-die")
|
|
(let ((t9-2 (-> (method-of-type nav-enemy die) enter)))
|
|
(if t9-2
|
|
(t9-2)
|
|
)
|
|
)
|
|
)
|
|
:code (behavior ()
|
|
(ja-channel-push! 1 (seconds 0.2))
|
|
(flitter-fall-and-play-death-anim
|
|
(the-as art-joint-anim (-> self draw art-group data (-> self enemy-info die-anim)))
|
|
1.0
|
|
(seconds 2)
|
|
)
|
|
(send-event self 'death-end)
|
|
(cleanup-for-death self)
|
|
)
|
|
)
|
|
|
|
(defmethod lerp-between-attack-pos-and-trans ((this flitter))
|
|
(lerp-scale 0.0 1.0 (- (-> this attack-pos y) (-> this root trans y)) 13926.4 25600.0)
|
|
)
|
|
|
|
(defstate attack (flitter)
|
|
: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
|
|
(sound-play "flitter-attack")
|
|
(set! (-> self amb-sound-timer) 0)
|
|
(logior! (-> self focus-status) (focus-status dangerous))
|
|
(let* ((v1-8 *game-info*)
|
|
(v0-2 (+ (-> v1-8 attack-id) 1))
|
|
)
|
|
(set! (-> v1-8 attack-id) v0-2)
|
|
(set! (-> self attack-id) v0-2)
|
|
)
|
|
)
|
|
: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))
|
|
)
|
|
)
|
|
:trans (behavior ()
|
|
(local-vars (s5-2 object))
|
|
(let* ((s5-0 (handle->process (-> self focus handle)))
|
|
(gp-0 (if (type? s5-0 process-focusable)
|
|
s5-0
|
|
)
|
|
)
|
|
)
|
|
(set! s5-2
|
|
(cond
|
|
((and gp-0
|
|
(not (time-elapsed? (-> self state-time) (seconds 1.5)))
|
|
gp-0
|
|
(not (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status disable dead ignore grabbed)))
|
|
)
|
|
(let ((s5-1 (-> self nav state))
|
|
(v1-10 (get-trans (the-as process-focusable gp-0) 0))
|
|
)
|
|
(logclear! (-> s5-1 flags) (nav-state-flag directional-mode))
|
|
(logior! (-> s5-1 flags) (nav-state-flag target-poly-dirty))
|
|
(set! (-> s5-1 target-pos quad) (-> v1-10 quad))
|
|
)
|
|
0
|
|
(set! s5-2 (-> self attack-pos))
|
|
(set! (-> (the-as vector s5-2) quad) (-> (get-trans (the-as process-focusable gp-0) 3) quad))
|
|
s5-2
|
|
)
|
|
(else
|
|
(go-stare self)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
:code (behavior ()
|
|
(ja-channel-push! 2 (seconds 0.1))
|
|
(let ((f30-0 (lerp-between-attack-pos-and-trans self)))
|
|
(ja-no-eval :group! flitter-attack-ja :num! (seek! max 0.8) :frame-num 0.0)
|
|
(ja-no-eval :chan 1
|
|
:group! flitter-attack-high-ja
|
|
:num! (chan 0)
|
|
:frame-interp0 f30-0
|
|
:frame-interp1 f30-0
|
|
:frame-num 0.0
|
|
)
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(set! f30-0 (seek f30-0 (lerp-between-attack-pos-and-trans self) (* 0.2 (seconds-per-frame))))
|
|
(ja :num! (seek! max 0.8))
|
|
(ja :chan 1 :num! (chan 0) :frame-interp0 f30-0 :frame-interp1 f30-0)
|
|
)
|
|
)
|
|
(let ((v1-40 self))
|
|
(set! (-> v1-40 enemy-flags) (the-as enemy-flag (logclear (-> v1-40 enemy-flags) (enemy-flag ef37))))
|
|
(set! (-> v1-40 nav callback-info) *null-nav-callback-info*)
|
|
)
|
|
0
|
|
(ja-channel-push! 1 (seconds 0.1))
|
|
(if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup))
|
|
(logior! (-> self focus-status) (focus-status dangerous))
|
|
(logclear! (-> self focus-status) (focus-status dangerous))
|
|
)
|
|
(dotimes (gp-1 (rnd-int self 3))
|
|
(ja-no-eval :group! flitter-idle-ja :num! (seek!) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
)
|
|
(go-best-state self)
|
|
)
|
|
:post nav-enemy-travel-post
|
|
)
|
|
|
|
(defstate victory (flitter)
|
|
:virtual #t
|
|
:post (behavior ()
|
|
(play-amb self)
|
|
(nav-enemy-simple-post)
|
|
)
|
|
)
|
|
|
|
(defmethod on-dying ((this flitter))
|
|
(when (-> this minimap)
|
|
(logior! (-> this minimap flags) (minimap-flag fade-out))
|
|
(set! (-> this minimap) #f)
|
|
)
|
|
(call-parent-method this)
|
|
(none)
|
|
)
|
|
|
|
(defmethod init-enemy-collision! ((this flitter))
|
|
(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)
|
|
)
|
|
(let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 3) 0)))
|
|
(set! (-> s5-0 total-prims) (the-as uint 4))
|
|
(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 10240.0 0.0 15360.0)
|
|
(set! (-> s5-0 root-prim) s4-0)
|
|
)
|
|
(let ((v1-12 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
|
|
(set! (-> v1-12 prim-core collide-as) (collide-spec enemy))
|
|
(set! (-> v1-12 prim-core collide-with)
|
|
(collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list)
|
|
)
|
|
(set! (-> v1-12 prim-core action) (collide-action solid can-ride deadly no-standon))
|
|
(set-vector! (-> v1-12 local-sphere) 0.0 5734.4 0.0 5734.4)
|
|
)
|
|
(let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
|
|
(set! (-> v1-14 prim-core collide-as) (collide-spec enemy))
|
|
(set! (-> v1-14 prim-core collide-with) (collide-spec jak bot player-list))
|
|
(set! (-> v1-14 prim-core action) (collide-action deadly))
|
|
(set! (-> v1-14 transform-index) 34)
|
|
(set-vector! (-> v1-14 local-sphere) 0.0 0.0 0.0 3481.6)
|
|
)
|
|
(let ((v1-16 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
|
|
(set! (-> v1-16 prim-core collide-as) (collide-spec enemy))
|
|
(set! (-> v1-16 prim-core collide-with) (collide-spec jak bot player-list))
|
|
(set! (-> v1-16 prim-core action) (collide-action deadly))
|
|
(set! (-> v1-16 transform-index) 35)
|
|
(set-vector! (-> v1-16 local-sphere) 0.0 0.0 0.0 3481.6)
|
|
)
|
|
(set! (-> s5-0 nav-radius) 3686.4)
|
|
(let ((v1-18 (-> s5-0 root-prim)))
|
|
(set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as))
|
|
(set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with))
|
|
)
|
|
(set! (-> s5-0 max-iteration-count) (the-as uint 3))
|
|
(set! (-> this root) s5-0)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; WARN: Return type mismatch connection-minimap vs none.
|
|
(defmethod init-enemy! ((this flitter))
|
|
(initialize-skeleton
|
|
this
|
|
(the-as skeleton-group (art-group-get-by-name *level* "skel-flitter" (the-as (pointer level) #f)))
|
|
(the-as pair 0)
|
|
)
|
|
(init-enemy-defaults! this *flitter-nav-enemy-info*)
|
|
(set! (-> this move-angle) 10922.667)
|
|
(set! (-> this heading) (if (= (rand-vu-int-range 0 1) 1)
|
|
#t
|
|
#f
|
|
)
|
|
)
|
|
(set! (-> this change-dir-time) 0)
|
|
(set! (-> this off-screen-timer) 0)
|
|
(set! (-> this amb-sound-timer) 0)
|
|
(add-connection
|
|
*part-engine*
|
|
this
|
|
28
|
|
this
|
|
468
|
|
(new 'static 'vector :x 942.08 :y -860.16 :z 1269.76 :w 163840.0)
|
|
)
|
|
(add-connection
|
|
*part-engine*
|
|
this
|
|
28
|
|
this
|
|
468
|
|
(new 'static 'vector :x -942.08 :y -860.16 :z 1269.76 :w 163840.0)
|
|
)
|
|
(set-gravity-length (-> this root dynam) 491520.0)
|
|
(let ((s4-1 "rockbit01"))
|
|
(-> this level name)
|
|
(let ((s5-2 (new 'static 'boxed-array :type int32 40 1 0 #x408b00 #x408c00 #x40a100 #x40a200 #x40a300)))
|
|
(setup-special-textures (-> *part-id-table* 4651) s4-1)
|
|
(setup-special-textures (-> *part-id-table* 4650) s4-1)
|
|
(setup-special-textures (-> *part-id-table* 4653) s4-1)
|
|
(setup-special-textures (-> *part-id-table* 4654) s4-1)
|
|
(set! (-> (get-field-spec-by-id (-> *part-id-table* 4651) (sp-field-id spt-userdata)) initial-valuef)
|
|
(the-as float s5-2)
|
|
)
|
|
(set! (-> (get-field-spec-by-id (-> *part-id-table* 4650) (sp-field-id spt-userdata)) initial-valuef)
|
|
(the-as float s5-2)
|
|
)
|
|
(set! (-> (get-field-spec-by-id (-> *part-id-table* 4653) (sp-field-id spt-userdata)) initial-valuef)
|
|
(the-as float s5-2)
|
|
)
|
|
(set! (-> (get-field-spec-by-id (-> *part-id-table* 4654) (sp-field-id spt-userdata)) initial-valuef)
|
|
(the-as float s5-2)
|
|
)
|
|
)
|
|
)
|
|
(set! (-> this minimap) (add-icon! *minimap* this (the-as uint 108) (the-as int #f) (the-as vector #t) 0))
|
|
(none)
|
|
)
|