Files
jak-project/test/decompiler/reference/levels/snow/yeti_REF.gc
T
ManDude 7ce58f709f process-spawn + pretty printer improvements (#1428)
* some jp support to fix some errors in the original game

* music fade toggle

* recognize `process-new` macros!!

* strip casts in this macro

* rename macro

* fix cast typecheck

* update source 1

* detect kernel stack case

* less boilerplate

* `manipy-spawn` special case

* pretty printer improvements

* revert dumb thing from earlier

* use shell detection on `send-event`

* fix some events

* remove unused argument

* detect `static-attack-info` and add `CondNoElse` to shell detect

* better `attack-info` detect

* support `process-spawn` in multi-lets

* detect `rand-float-gen` pt 1

* detect as return value

* detect in `countdown` and  `dotimes`

* oops this wasnt working

* fancier `send-event`s

* clang

* update source!!

* fix tests

* fine jeez

* uh okay

* fix some accidental regressions

* fix more regressions

* regression fixes

* fix big bug...

* extra safety!
2022-06-10 02:18:08 +01:00

771 lines
26 KiB
Common Lisp
Vendored
Generated

;;-*-Lisp-*-
(in-package goal)
(import "goal_src/import/yeti-ag.gc")
;; definition of type yeti-slave
(deftype yeti-slave (nav-enemy)
((ground-y float :offset-assert 400)
(part2 sparticle-launch-control :offset-assert 404)
)
:heap-base #x130
:method-count-assert 76
:size-assert #x198
:flag-assert #x4c01300198
(:states
yeti-slave-appear-jump-up
yeti-slave-appear-land
yeti-slave-show-anims
)
)
;; definition for method 3 of type yeti-slave
(defmethod inspect yeti-slave ((obj yeti-slave))
(let ((t9-0 (method-of-type nav-enemy inspect)))
(t9-0 obj)
)
(format #t "~T~Tground-y: ~f~%" (-> obj ground-y))
(format #t "~T~Tpart2: ~A~%" (-> obj part2))
obj
)
;; definition of type yeti
(deftype yeti (process-drawable)
((child-process (pointer yeti-slave) :offset 20)
(desired-num-children int32 :offset-assert 176)
(spawn-delay int32 :offset-assert 180)
(first-time-spawn-dist float :offset-assert 184)
(unknown basic :offset-assert 188)
(unknown1 basic :offset-assert 192)
(unknown2 basic :offset-assert 196)
)
:heap-base #x60
:method-count-assert 22
:size-assert #xc8
:flag-assert #x16006000c8
(:methods
(TODO-RENAME-20 (_type_ vector vector) symbol 20)
(aggro? (_type_ vector) symbol 21)
)
(:states
yeti-first-time-start
yeti-idle
yeti-resuming-start
)
)
;; definition for method 3 of type yeti
(defmethod inspect yeti ((obj yeti))
(let ((t9-0 (method-of-type process-drawable inspect)))
(t9-0 obj)
)
(format #t "~T~Tdesired-num-children: ~D~%" (-> obj desired-num-children))
(format #t "~T~Tspawn-delay: ~D~%" (-> obj spawn-delay))
(format #t "~T~Tfirst-time-spawn-dist: ~f~%" (-> obj first-time-spawn-dist))
(format #t "~T~Tstate-time: ~D~%" (-> obj state-time))
obj
)
;; failed to figure out what this is:
(defskelgroup *yeti-sg* yeti yeti-lod0-jg -1
((yeti-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0.75 0 3.9)
:longest-edge (meters 1.3)
)
;; definition for symbol *yeti-nav-enemy-info*, type nav-enemy-info
(define *yeti-nav-enemy-info* (new 'static 'nav-enemy-info
:idle-anim 2
:walk-anim 3
:turn-anim -1
:notice-anim 4
:run-anim 5
:jump-anim 10
:jump-land-anim 11
:victory-anim 8
:taunt-anim 8
:die-anim 9
:neck-joint 5
:player-look-at-joint 5
:run-travel-speed (meters 6)
:run-rotate-speed (degrees 2880.0)
:run-acceleration (meters 1)
:run-turn-time (seconds 0.1)
:walk-travel-speed (meters 3)
:walk-rotate-speed (degrees 720.0)
:walk-acceleration (meters 1)
:walk-turn-time (seconds 0.5)
:attack-shove-back (meters 3)
:attack-shove-up (meters 2)
:shadow-size (meters 2)
:notice-nav-radius (meters 2)
:nav-nearest-y-threshold (meters 10)
:notice-distance (meters 30)
:stop-chase-distance (meters 40)
:frustration-distance (meters 8)
:frustration-time (seconds 4)
:die-anim-hold-frame 24.0
:jump-anim-start-frame 10.0
:jump-land-anim-end-frame 10000000000.0
:jump-height-min (meters 3)
:jump-height-factor 0.5
:jump-start-anim-speed 1.0
:shadow-max-y (meters 1)
:shadow-min-y (meters -1)
:shadow-locus-dist (meters 150)
:use-align #t
:draw-shadow #t
:move-to-ground #t
:hover-if-no-ground #f
:use-momentum #f
:use-flee #f
:use-proximity-notice #f
:use-jump-blocked #f
:use-jump-patrol #f
:gnd-collide-with (collide-kind background)
:debug-draw-neck #f
:debug-draw-jump #f
)
)
;; failed to figure out what this is:
(defpartgroup group-yeti-slave-appear1
:id 538
:flags (use-local-clock)
:bounds (static-bspherem 0 0 0 16)
:parts ((sp-item 1928 :fade-after (meters 70) :falloff-to (meters 70))
(sp-item 1929 :fade-after (meters 70) :falloff-to (meters 70))
)
)
;; failed to figure out what this is:
(defpart 1929
:init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2))
(sp-flt spt-num 16.0)
(sp-rnd-flt spt-x (meters -2) (meters 4) 1.0)
(sp-rnd-flt spt-y (meters 0.5) (meters 1) 1.0)
(sp-rnd-flt spt-z (meters -2) (meters 4) 1.0)
(sp-rnd-flt spt-scale-x (meters 0.24) (meters 0.24) 1.0)
(sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0)
(sp-copy-from-other spt-scale-y -4)
(sp-flt spt-r 128.0)
(sp-flt spt-g 128.0)
(sp-flt spt-b 128.0)
(sp-rnd-flt spt-a 96.0 32.0 1.0)
(sp-rnd-flt spt-vel-y (meters 0.033333335) (meters 0.05) 1.0)
(sp-rnd-flt spt-rotvel-z (degrees -2.4) (degrees 3.4666667) 1.0)
(sp-flt spt-accel-y -5.4613333)
(sp-flt spt-friction 0.99)
(sp-int spt-timer 450)
(sp-cpuinfo-flags bit2 bit12)
(sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 40.0) 1.0)
(sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0)
)
)
;; failed to figure out what this is:
(defpart 1928
:init-specs ((sp-tex spt-texture (new 'static 'texture-id :page #x2))
(sp-flt spt-num 32.0)
(sp-rnd-flt spt-x (meters -2) (meters 4) 1.0)
(sp-rnd-flt spt-y (meters 0.5) (meters 1) 1.0)
(sp-rnd-flt spt-z (meters -2) (meters 4) 1.0)
(sp-rnd-flt spt-scale-x (meters 2.5) (meters 2.5) 1.0)
(sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0)
(sp-copy-from-other spt-scale-y -4)
(sp-flt spt-r 128.0)
(sp-flt spt-g 128.0)
(sp-flt spt-b 128.0)
(sp-rnd-flt spt-a 16.0 16.0 1.0)
(sp-rnd-flt spt-vel-y (meters 0.05) (meters 0.016666668) 1.0)
(sp-flt spt-scalevel-x (meters 0.006666667))
(sp-rnd-flt spt-rotvel-z (degrees -1.2) (degrees 1.2) 1.0)
(sp-copy-from-other spt-scalevel-y -4)
(sp-flt spt-fade-a -0.07111111)
(sp-flt spt-accel-y -5.4613333)
(sp-flt spt-friction 0.99)
(sp-int spt-timer 450)
(sp-cpuinfo-flags bit2 bit12)
(sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 40.0) 1.0)
(sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0)
)
)
;; failed to figure out what this is:
(defpartgroup group-yeti-slave-appear2
:id 539
:flags (use-local-clock)
:bounds (static-bspherem 0 0 0 16)
:parts ((sp-item 1930 :fade-after (meters 70) :falloff-to (meters 70)))
)
;; failed to figure out what this is:
(defpart 1930
:init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x19 :page #x2))
(sp-rnd-flt spt-num 1.0 2.0 1.0)
(sp-rnd-flt spt-x (meters -0.25) (meters 0.5) 1.0)
(sp-rnd-flt spt-z (meters -0.25) (meters 0.5) 1.0)
(sp-rnd-flt spt-scale-x (meters 0.2) (meters 0.1) 1.0)
(sp-rnd-flt spt-rot-z (degrees 0.0) (degrees 360.0) 1.0)
(sp-copy-from-other spt-scale-y -4)
(sp-flt spt-r 128.0)
(sp-flt spt-g 128.0)
(sp-flt spt-b 128.0)
(sp-rnd-flt spt-a 64.0 64.0 1.0)
(sp-rnd-flt spt-vel-y (meters 0) (meters 0.006666667) 1.0)
(sp-rnd-flt spt-rotvel-z (degrees -2.4) (degrees 3.4666667) 1.0)
(sp-flt spt-accel-y -5.4613333)
(sp-int spt-timer 150)
(sp-cpuinfo-flags bit2 bit12)
(sp-rnd-flt spt-conerot-x (degrees 0.0) (degrees 30.0) 1.0)
(sp-rnd-flt spt-conerot-y (degrees 0.0) (degrees 360.0) 1.0)
)
)
;; definition for function yeti-slave-default-event-handler
(defbehavior yeti-slave-default-event-handler yeti-slave ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(case arg2
(('attack)
(nav-enemy-set-hit-from-direction arg0)
(go-virtual nav-enemy-die)
)
(('touch)
(nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg3 param 0)) 'generic)
)
)
)
;; failed to figure out what this is:
(defstate yeti-slave-appear-jump-up (yeti-slave)
:event yeti-slave-default-event-handler
:enter (behavior ()
(nav-enemy-neck-control-inactive)
(set! (-> self state-time) (-> *display* base-frame-counter))
(if (-> self nav-info move-to-ground)
(move-to-ground (-> self collide-info) 40960.0 40960.0 #t (collide-kind background))
)
(logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1 navenmf2))
(set! (-> self state-timeout) (seconds 1))
(set! (-> self ground-y) (-> self collide-info trans y))
(spawn (-> self part) (-> self collide-info trans))
(set! (-> self collide-info trans y) (+ -12288.0 (-> self collide-info trans y)))
(set! (-> self collide-info transv quad) (-> *null-vector* quad))
(set! (-> self collide-info transv y) (rand-vu-float-range 102400.0 114688.0))
(none)
)
:trans (behavior ()
(when (and (< (-> self collide-info trans y) (-> self ground-y)) (< (-> self collide-info transv y) 0.0))
(set! (-> self collide-info trans y) (-> self ground-y))
(set! (-> self collide-info transv quad) (-> *null-vector* quad))
(go yeti-slave-appear-land)
)
(let* ((s5-0 (-> self node-list))
(a0-2 (-> s5-0 length))
(gp-0 (new 'stack-no-clear 'vector))
)
(vector<-cspace! gp-0 (-> s5-0 data (nav-enemy-rnd-int-count a0-2)))
(spawn (-> self part2) gp-0)
)
(none)
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.075))
(ja-no-eval :group! yeti-jump-ja :num! (seek!) :frame-num (ja-aframe 10.0 0))
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(loop
(suspend)
)
(none)
)
:post (the-as (function none :behavior yeti-slave) nav-enemy-falling-post)
)
;; failed to figure out what this is:
(defstate yeti-slave-appear-land (yeti-slave)
:event yeti-slave-default-event-handler
:code (behavior ()
(ja-channel-push! 1 (seconds 0.05))
(ja-no-eval :group! yeti-jump-land-ja :num! (seek! max 0.5) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! max 0.5))
)
(if (TODO-RENAME-46 self (-> self nav-info notice-distance))
(go-virtual nav-enemy-chase)
(go-virtual nav-enemy-idle)
)
(none)
)
:post (the-as (function none :behavior yeti-slave) ja-post)
)
;; failed to figure out what this is:
(defstate yeti-slave-show-anims (yeti-slave)
:trans (behavior ()
0
(none)
)
:code (behavior ()
0
(none)
)
:post (the-as (function none :behavior yeti-slave) transform-post)
)
;; failed to figure out what this is:
(defstate nav-enemy-patrol (yeti-slave)
:virtual #t
:code (behavior ()
(cond
((ja-group? yeti-give-up-hop-ja)
(ja-channel-push! 1 (seconds 0.15))
(ja-no-eval :group! yeti-walk-ja :num! (seek!) :frame-num (ja-aframe 12.0 0))
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
)
(else
(ja-channel-push! 1 (seconds 0.2))
)
)
(loop
(ja-no-eval :group! yeti-walk-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(when (nav-enemy-rnd-percent? 0.2)
(ja-no-eval :num! (loop!))
(ja-channel-push! 1 (seconds 0.6))
(logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate))
(let ((gp-1 (nav-enemy-rnd-int-range 2 6)))
(dotimes (s5-0 gp-1)
(ja-no-eval :group! yeti-idle-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(ja-blend-eval)
(suspend)
(ja :num! (seek!))
)
)
)
(logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate))
(ja-no-eval :num! (loop!))
(ja-channel-push! 1 (seconds 0.6))
(ja-no-eval :group! yeti-walk-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(ja-blend-eval)
(suspend)
(ja :num! (seek!))
)
)
)
(none)
)
)
;; failed to figure out what this is:
(defstate nav-enemy-chase (yeti-slave)
:virtual #t
:code (behavior ()
(let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1)))
(cond
((ja-group? yeti-jump-land-ja)
(ja-no-eval :num! (seek!))
(ja-channel-push! 1 (seconds 0.17))
(ja-no-eval :group! (-> self draw art-group data (-> self nav-info run-anim))
:num! (seek! max f30-0)
:frame-num 0.0
)
(until (ja-done? 0)
(ja-blend-eval)
(suspend)
(ja :num! (seek! max f30-0))
)
)
(else
(ja-channel-push! 1 (seconds 0.2))
(ja :group! (-> self draw art-group data (-> self nav-info run-anim)))
(ja :num-func num-func-identity :frame-num 0.0)
)
)
(loop
(suspend)
(ja :num! (loop! f30-0))
)
)
(none)
)
)
;; failed to figure out what this is:
(defstate nav-enemy-stare (yeti-slave)
:virtual #t
:code (behavior ()
(set! (-> self turn-time) (seconds 0.2))
(let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2)))
(when (or (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf8))
(and (nav-enemy-player-vulnerable?) (nav-enemy-rnd-percent? 0.5))
)
(ja-channel-push! 1 (seconds 0.1))
(ja-no-eval :group! yeti-win-ja :num! (seek! (ja-aframe 68.0 0) f30-0) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! (ja-aframe 68.0 0) f30-0))
)
)
(loop
(when (not (nav-enemy-facing-player? 2730.6667))
(logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel))
(ja-no-eval :num! (loop!))
(ja-channel-push! 1 (seconds 0.2))
(ja :group! yeti-turn-ja)
(ja :num-func num-func-identity :frame-num 0.0)
(until (nav-enemy-facing-player? 1820.4445)
(ja-blend-eval)
(suspend)
(ja :num! (loop! 0.75))
)
(logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel))
)
(if (not (ja-group? yeti-idle-ja))
(ja-channel-push! 1 (seconds 0.2))
)
(ja-no-eval :group! yeti-idle-ja :num! (seek! max f30-0) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! max f30-0))
)
(when (nav-enemy-rnd-percent? 0.3)
(ja-channel-push! 1 (seconds 0.1))
(ja-no-eval :group! yeti-win-ja :num! (seek! (ja-aframe 68.0 0) f30-0) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! (ja-aframe 68.0 0) f30-0))
)
)
)
)
(none)
)
)
;; failed to figure out what this is:
(defstate nav-enemy-give-up (yeti-slave)
:virtual #t
:code (behavior ()
(set! (-> self rotate-speed) 218453.33)
(set! (-> self turn-time) (seconds 0.5))
(ja-channel-push! 1 (seconds 0.15))
(let ((s4-0 (-> self collide-info))
(s5-0 (target-pos 0))
)
(when (< (fabs
(deg-diff (y-angle s4-0) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s5-0 (-> s4-0 trans))))
)
12743.111
)
(ja-no-eval :group! yeti-give-up-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
)
)
(logclear! (-> self nav flags) (nav-control-flags navcf17 navcf19))
(nav-enemy-get-new-patrol-point)
(ja-no-eval :group! yeti-give-up-hop-ja :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(seek-to-point-toward-point!
(-> self collide-info)
(-> self nav destination-pos)
(-> self rotate-speed)
(-> self turn-time)
)
(suspend)
(ja :num! (seek!))
)
(go-virtual nav-enemy-patrol)
(none)
)
)
;; failed to figure out what this is:
(defstate nav-enemy-jump-land (yeti-slave)
:virtual #t
:code (behavior ()
(ja-no-eval :num! (seek!))
(ja-channel-push! 1 (seconds 0.075))
(ja-no-eval :group! (-> self draw art-group data (-> self nav-info jump-land-anim))
:num! (seek! (ja-aframe 32.0 0) 0.5)
:frame-num 0.0
)
(until (ja-done? 0)
(ja-blend-eval)
(suspend)
(ja :num! (seek! (ja-aframe 32.0 0) 0.5))
)
(go-virtual nav-enemy-chase)
(none)
)
)
;; definition for method 47 of type yeti-slave
;; INFO: Return type mismatch int vs none.
(defmethod initialize-collision yeti-slave ((obj yeti-slave))
(let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player))))
(set! (-> s5-0 dynam) (copy *standard-dynamics* 'process))
(set! (-> s5-0 reaction) default-collision-reaction)
(set! (-> s5-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 3) 0)))
(set! (-> s4-0 prim-core collide-as) (collide-kind enemy))
(set! (-> s4-0 collide-with) (collide-kind target))
(set! (-> s4-0 prim-core action) (collide-action solid))
(set-vector! (-> s4-0 local-sphere) 0.0 8192.0 0.0 12288.0)
(set-root-prim! s5-0 s4-0)
(let ((s3-0 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 3))))
(set! (-> s3-0 prim-core collide-as) (collide-kind enemy))
(set! (-> s3-0 collide-with) (collide-kind target))
(set! (-> s3-0 prim-core action) (collide-action solid))
(set! (-> s3-0 prim-core offense) (collide-offense touch))
(set-vector! (-> s3-0 local-sphere) 0.0 4096.0 0.0 3072.0)
(append-prim s4-0 s3-0)
)
(let ((s3-1 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 3))))
(set! (-> s3-1 prim-core collide-as) (collide-kind enemy))
(set! (-> s3-1 collide-with) (collide-kind target))
(set! (-> s3-1 prim-core action) (collide-action solid))
(set! (-> s3-1 prim-core offense) (collide-offense touch))
(set-vector! (-> s3-1 local-sphere) 0.0 9830.4 0.0 3072.0)
(append-prim s4-0 s3-1)
)
(let ((s3-2 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1))))
(set! (-> s3-2 prim-core collide-as) (collide-kind enemy))
(set! (-> s3-2 collide-with) (collide-kind target))
(set! (-> s3-2 prim-core offense) (collide-offense normal-attack))
(set! (-> s3-2 transform-index) 6)
(set-vector! (-> s3-2 local-sphere) 0.0 0.0 0.0 2048.0)
(append-prim s4-0 s3-2)
)
)
(set! (-> s5-0 nav-radius) 6144.0)
(backup-collide-with-as s5-0)
(set! (-> s5-0 max-iteration-count) (the-as uint 2))
(set! (-> obj collide-info) s5-0)
)
0
(none)
)
;; definition for method 48 of type yeti-slave
;; INFO: Return type mismatch int vs none.
(defmethod TODO-RENAME-48 yeti-slave ((obj yeti-slave))
(initialize-skeleton obj *yeti-sg* '())
(set! (-> obj draw origin-joint-index) (the-as uint 3))
(TODO-RENAME-45 obj *yeti-nav-enemy-info*)
(set! (-> obj neck up) (the-as uint 0))
(set! (-> obj neck nose) (the-as uint 1))
(set! (-> obj neck ear) (the-as uint 2))
0
(none)
)
;; definition for method 10 of type yeti-slave
(defmethod deactivate yeti-slave ((obj yeti-slave))
(if (nonzero? (-> obj part2))
(kill-and-free-particles (-> obj part2))
)
((method-of-type process-drawable deactivate) obj)
(none)
)
;; definition for method 7 of type yeti-slave
;; INFO: Return type mismatch nav-enemy vs yeti-slave.
(defmethod relocate yeti-slave ((obj yeti-slave) (arg0 int))
(if (nonzero? (-> obj part2))
(&+! (-> obj part2) arg0)
)
(the-as yeti-slave ((the-as (function nav-enemy int nav-enemy) (find-parent-method yeti-slave 7)) obj arg0))
)
;; definition for function yeti-slave-init-by-other
;; INFO: Return type mismatch object vs none.
;; Used lq/sq
(defbehavior yeti-slave-init-by-other yeti-slave ((arg0 entity) (arg1 yeti) (arg2 vector) (arg3 vector) (arg4 symbol))
(set! (-> self part) (create-launch-control (-> *part-group-id-table* 538) self))
(set! (-> self part2) (create-launch-control (-> *part-group-id-table* 539) self))
(initialize-collision self)
(set! (-> self collide-info trans quad) (-> arg2 quad))
(vector-identity! (-> self collide-info scale))
(forward-up->quaternion (-> self collide-info quat) arg3 *up-vector*)
(set! (-> self entity) (-> arg1 entity))
(TODO-RENAME-48 self)
(if arg4
(go-virtual nav-enemy-idle)
(go yeti-slave-appear-jump-up)
)
(none)
)
;; definition for method 21 of type yeti
(defmethod aggro? yeti ((obj yeti) (arg0 vector))
(let ((s5-0 (the-as (pointer process-tree) (-> obj child-process))))
(while s5-0
(if (< (vector-vector-xz-distance-squared arg0 (-> (the-as (pointer yeti-slave) s5-0) 0 collide-info trans))
603979800.0
)
(return #f)
)
(set! s5-0 (-> s5-0 0 brother))
)
)
(when *target*
(if (< (vector-vector-xz-distance-squared arg0 (target-pos 0)) 603979800.0)
(return #f)
)
)
#t
)
;; definition for method 20 of type yeti
(defmethod TODO-RENAME-20 yeti ((obj yeti) (arg0 vector) (arg1 vector))
(let ((s3-0 (-> obj path curve num-cverts)))
(if (<= s3-0 0)
(return #f)
)
(let ((s1-0 (rand-vu-int-count s3-0))
(s2-0 s3-0)
)
(while (> s2-0 0)
(eval-path-curve-div! (-> obj path) arg0 (the float s1-0) 'interp)
(when (aggro? obj arg0)
(cond
(*target*
(vector-! arg1 (target-pos 0) arg0)
(set! (-> arg1 y) 0.0)
)
(else
(set-vector! arg1 (rand-vu-float-range -4096.0 4096.0) 0.0 (rand-vu-float-range -4096.0 4096.0) 1.0)
(set! (-> arg1 x) (+ 409.6 (-> arg1 x)))
)
)
(vector-normalize! arg1 1.0)
(return #t)
)
(set! s1-0 (mod (+ s1-0 1) s3-0))
(+! s2-0 -1)
)
)
)
#f
)
;; failed to figure out what this is:
(defstate yeti-first-time-start (yeti)
:code (behavior ()
(loop
(when *target*
(when (>= (-> self first-time-spawn-dist) (vector-vector-xz-distance (target-pos 0) (-> self root trans)))
(process-entity-status! self (entity-perm-status complete) #t)
(go yeti-idle)
)
)
(suspend)
)
(none)
)
)
;; failed to figure out what this is:
(defstate yeti-resuming-start (yeti)
:code (behavior ()
(let ((gp-0 0))
(let ((v1-0 (the-as (pointer process-tree) (-> self child-process))))
(while v1-0
(+! gp-0 1)
(set! v1-0 (-> v1-0 0 brother))
(nop!)
(nop!)
)
)
(while (< gp-0 (-> self desired-num-children))
(let ((s5-0 (new 'stack-no-clear 'vector))
(s4-0 (new 'stack-no-clear 'vector))
)
(if (not (TODO-RENAME-20 self s5-0 s4-0))
(go yeti-idle)
)
(process-spawn yeti-slave (-> self entity) self s5-0 s4-0 #t :to self)
)
(+! gp-0 1)
)
)
(go yeti-idle)
(none)
)
)
;; failed to figure out what this is:
(defstate yeti-idle (yeti)
:code (behavior ()
(loop
(cond
((zero? (-> self spawn-delay))
(let ((v1-1 0))
(let ((a0-0 (the-as (pointer process-tree) (-> self child-process))))
(while a0-0
(+! v1-1 1)
(set! a0-0 (-> a0-0 0 brother))
(nop!)
(nop!)
)
)
(when (< v1-1 (-> self desired-num-children))
(set! (-> self spawn-delay) (rand-vu-int-range 150 1200))
(set! (-> self state-time) (-> *display* base-frame-counter))
)
)
)
(else
(when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self spawn-delay))
(let ((gp-0 (new 'stack-no-clear 'vector))
(s5-0 (new 'stack-no-clear 'vector))
)
(when (TODO-RENAME-20 self gp-0 s5-0)
(process-spawn yeti-slave (-> self entity) self gp-0 s5-0 #f :to self)
(set! (-> self spawn-delay) 0)
0
)
)
)
)
)
(suspend)
)
(none)
)
)
;; definition for method 11 of type yeti
;; INFO: Return type mismatch object vs none.
(defmethod init-from-entity! yeti ((obj yeti) (arg0 entity-actor))
(set! (-> obj spawn-delay) 0)
(set! (-> obj root) (new 'process 'trsqv))
(set! (-> obj path) (new 'process 'path-control obj 'path 0.0))
(process-drawable-from-entity! obj arg0)
(set! (-> obj desired-num-children)
(res-lump-value arg0 'num-lurkers int :default (the-as uint128 (-> obj path curve num-cverts)))
)
(set! (-> obj first-time-spawn-dist) (res-lump-float arg0 'notice-dist :default 204800.0))
(if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete)))
(go yeti-resuming-start)
(go yeti-first-time-start)
)
(none)
)