decomp: add a bunch of enemy files (#2101)

Adds the following files:

- `amphibian`
- `centurion`
- `ginsu`
- `grenadier`
- `hopper`
- `metalmonk`
- `monster-frog`
- `predator-graph`
- `predator-h`
- `predator`
- `rapid-gunner`
- `rhino`
- `rhino-wall`
- `tomb-baby-spider`

Also adds the DGOs for the following levels:

- Mar's Tomb
- Mountain Temple
- Drill Platform
- Sacred Site (Sage Hut)

Manual patches:

- The decompiler emits `(b! #t cfg-17)` in `(trans hostile hopper)`
without putting a `(label cfg-17)` anywhere
- Added cast to `art-joint-anim` in `(code broken rhino-wall)` and
`(code hit rhino-wall)`

Other notes:

- `amphibian` seems to occasionally crash when using its tongue attack.
Haven't investigated this yet
- `ginsu` crashes after being killed somewhere in the `deactivate`
method, possibly because of its `part-spawner`
- Predators aren't spawning in the forest hunt mission, not sure if
`forest-obs` might be needed for that or if it's something else
- The `rhino-wall` STR animation seems to load (albeit a bit broken due
to missing VAG stream playback), but causes the viewport to shrink as
soon as it's played
- I added `pegasus::74` to the `event_handler_hack` bool in
`variable_naming.cpp` because I got a `none` cast after changing the
return value of `enemy::74`
This commit is contained in:
Hat Kid
2023-01-07 23:14:12 +01:00
committed by GitHub
parent 00ac12094e
commit bdee98323d
60 changed files with 37190 additions and 1196 deletions
+3 -3
View File
@@ -438,12 +438,12 @@
(enemy-method-55 (_type_) none 55)
(enemy-method-56 (_type_ process event-message-block) int 56)
(enemy-method-57 (_type_ process-focusable enemy-best-focus) enemy-aware 57)
(enemy-method-58 (_type_) symbol 58)
(enemy-method-58 (_type_ process event-message-block) symbol 58)
(enemy-method-59 (_type_) penetrate 59)
(coin-flip? (_type_) symbol 60)
(enemy-method-61 (_type_ int) int :behavior enemy 61)
(enemy-method-62 (_type_) none 62)
(enemy-method-63 (_type_ process-focusable symbol) none 63)
(enemy-method-63 (_type_ process-focusable symbol) symbol 63)
(enemy-method-64 (_type_) none 64)
(enemy-method-65 (_type_) none 65)
(go-ambush (_type_) none 66)
@@ -454,7 +454,7 @@
(go-flee (_type_) none 71)
(enemy-method-72 (_type_) none 72)
(enemy-method-73 (_type_) none 73)
(enemy-method-74 (_type_ process object symbol event-message-block) none 74)
(enemy-method-74 (_type_ process object symbol event-message-block) object 74)
(enemy-method-75 (_type_ process touching-shapes-entry) none 75)
(enemy-method-76 (_type_ process event-message-block) symbol 76)
(enemy-method-77 (_type_ (pointer float)) symbol 77)
+327 -314
View File
@@ -426,13 +426,11 @@
)
;; definition for method 63 of type enemy
;; WARN: Return type mismatch symbol vs none.
(defmethod enemy-method-63 enemy ((obj enemy) (arg0 process-focusable) (arg1 symbol))
(if arg1
(enemy-focus-method-13 (-> obj focus) arg0 (the-as enemy-aware arg1))
(try-update-focus (-> obj focus) arg0 obj)
)
(none)
)
;; definition for method 62 of type enemy
@@ -1678,124 +1676,162 @@
;; definition for method 74 of type enemy
;; INFO: Used lq/sq
;; WARN: Return type mismatch none vs object.
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 17]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 28]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 89]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 202]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 274]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 346]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 413]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 490]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 493]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 530]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 560]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 610]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 641]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 774]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 807]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 814]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 850]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 933]
(defmethod enemy-method-74 enemy ((obj enemy) (arg0 process) (arg1 object) (arg2 symbol) (arg3 event-message-block))
(local-vars (s5-5 rgbaf) (sv-432 process) (sv-448 event-message-block))
(with-pp
(cond
((= arg2 'track)
(and (nonzero? (-> obj hit-points))
(logtest? (-> obj enemy-flags) (enemy-flag enable-on-active))
(logtest? (enemy-flag check-water-backup) (-> obj enemy-flags))
)
)
((= arg2 'combo)
(and (not (logtest? (enemy-flag multi-focus) (-> obj enemy-flags))) (nonzero? (-> obj hit-points)))
)
((= arg2 'touch)
(enemy-method-75 obj arg0 (the-as touching-shapes-entry arg3))
)
((= arg2 'touched)
(when (logtest? (-> obj enemy-flags) (enemy-flag attackable-backup))
(let* ((s3-1 arg0)
(v1-20 (if (type? s3-1 process-drawable)
(the-as process-drawable s3-1)
)
)
)
(when v1-20
(let* ((s3-2 (-> v1-20 root))
(a1-4 (if (type? s3-2 collide-shape)
s3-2
)
)
(s3-3 (-> arg3 param 0))
)
(if (and a1-4
s3-3
((method-of-type touching-shapes-entry prims-touching-action?)
(the-as touching-shapes-entry s3-3)
(the-as collide-shape a1-4)
(collide-action solid)
(collide-action)
)
((method-of-type touching-shapes-entry prims-touching-action?)
(the-as touching-shapes-entry s3-3)
(-> obj root-override2)
(collide-action solid)
(collide-action)
)
)
(set! (-> obj auto-reset-penetrate-time) (the-as uint (-> pp clock frame-counter)))
)
)
)
)
)
(enemy-method-76 obj arg0 arg3)
)
((= arg2 'attack-invinc)
(case (-> (the-as attack-info (-> arg3 param 1)) mode)
(('endlessfall)
(let ((v1-31 (-> obj root-override2 root-prim)))
(set! (-> v1-31 prim-core collide-as) (collide-spec))
(set! (-> v1-31 prim-core collide-with) (collide-spec))
)
0
(enemy-method-73 obj)
)
)
)
((= arg2 'attack)
(let ((s2-0 (the-as object (-> arg3 param 1))))
(when (!= (-> (the-as attack-info s2-0) id) (-> obj incoming attack-id))
(cond
((and (logtest? (-> obj enemy-flags) (enemy-flag enable-on-active))
(zero? (logand (-> obj focus-status) (focus-status grabbed)))
)
(let* ((s1-0 obj)
(s0-0 (method-of-object s1-0 enemy-method-106))
)
(set! sv-432 arg0)
(set! sv-448 arg3)
(let ((a3-3 (get-penetrate-using-from-attack-event (the-as process-drawable arg0) arg3)))
(s0-0 s1-0 sv-432 sv-448 (the-as int a3-3) (the-as attack-info s2-0))
)
)
(send-event (ppointer->process (-> obj parent)) 'child-hit)
0
(if (not *debug-unkillable*)
(enemy-method-48 obj arg0 arg3)
)
(let ((s2-1 (the-as attack-info (enemy-method-58 obj))))
(when s2-1
(logclear! (-> obj enemy-flags) (enemy-flag called-dying))
(enemy-method-108 obj (the-as enemy arg0) arg3)
(let ((a1-13 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-13 from) (process->ppointer arg0))
(set! (-> a1-13 num-params) (the-as int arg1))
(set! (-> a1-13 message) (the-as symbol s2-1))
(set! (-> a1-13 param 0) (-> arg3 param 0))
(set! (-> a1-13 param 1) (-> arg3 param 1))
(set! (-> a1-13 param 2) (-> arg3 param 2))
(set! (-> a1-13 param 3) (-> arg3 param 3))
(set! (-> a1-13 param 4) (-> arg3 param 4))
(set! (-> a1-13 param 5) (-> arg3 param 5))
(send-event-function obj a1-13)
)
)
)
(the-as
object
(cond
((= arg2 'track)
(and (nonzero? (-> obj hit-points))
(logtest? (-> obj enemy-flags) (enemy-flag enable-on-active))
(logtest? (enemy-flag check-water-backup) (-> obj enemy-flags))
)
(else
(set! (-> obj incoming attack-id) (-> (the-as attack-info s2-0) id))
(enemy-method-75 obj arg0 (the-as touching-shapes-entry arg3))
)
((= arg2 'combo)
(and (not (logtest? (enemy-flag multi-focus) (-> obj enemy-flags))) (nonzero? (-> obj hit-points)))
)
((= arg2 'touch)
(enemy-method-75 obj arg0 (the-as touching-shapes-entry arg3))
)
((= arg2 'touched)
(when (logtest? (-> obj enemy-flags) (enemy-flag attackable-backup))
(let* ((s3-1 arg0)
(v1-20 (if (type? s3-1 process-drawable)
(the-as process-drawable s3-1)
)
)
)
(when v1-20
(let* ((s3-2 (-> v1-20 root))
(a1-4 (if (type? s3-2 collide-shape)
s3-2
)
)
(s3-3 (-> arg3 param 0))
)
(if (and a1-4
s3-3
((method-of-type touching-shapes-entry prims-touching-action?)
(the-as touching-shapes-entry s3-3)
(the-as collide-shape a1-4)
(collide-action solid)
(collide-action)
)
((method-of-type touching-shapes-entry prims-touching-action?)
(the-as touching-shapes-entry s3-3)
(-> obj root-override2)
(collide-action solid)
(collide-action)
)
)
(set! (-> obj auto-reset-penetrate-time) (the-as uint (-> pp clock frame-counter)))
)
)
)
)
)
(enemy-method-76 obj arg0 arg3)
)
((= arg2 'attack-invinc)
(case (-> (the-as attack-info (-> arg3 param 1)) mode)
(('endlessfall)
(let ((v1-31 (-> obj root-override2 root-prim)))
(set! (-> v1-31 prim-core collide-as) (collide-spec))
(set! (-> v1-31 prim-core collide-with) (collide-spec))
)
0
(enemy-method-73 obj)
)
)
)
((= arg2 'attack)
(let ((s2-0 (the-as object (-> arg3 param 1))))
(when (!= (-> (the-as attack-info s2-0) id) (-> obj incoming attack-id))
(cond
((and (logtest? (-> obj enemy-flags) (enemy-flag enable-on-active))
(zero? (logand (-> obj focus-status) (focus-status grabbed)))
)
(let* ((s1-0 obj)
(s0-0 (method-of-object s1-0 enemy-method-106))
)
(set! sv-432 arg0)
(set! sv-448 arg3)
(let ((a3-3 (get-penetrate-using-from-attack-event (the-as process-drawable arg0) arg3)))
(s0-0 s1-0 sv-432 sv-448 (the-as int a3-3) (the-as attack-info s2-0))
)
)
(send-event (ppointer->process (-> obj parent)) 'child-hit)
0
(if (not *debug-unkillable*)
(enemy-method-48 obj arg0 arg3)
)
(let ((s2-1 (the-as attack-info (enemy-method-58 obj arg0 arg3))))
(when s2-1
(logclear! (-> obj enemy-flags) (enemy-flag called-dying))
(enemy-method-108 obj (the-as enemy arg0) arg3)
(let ((a1-13 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-13 from) (process->ppointer arg0))
(set! (-> a1-13 num-params) (the-as int arg1))
(set! (-> a1-13 message) (the-as symbol s2-1))
(set! (-> a1-13 param 0) (-> arg3 param 0))
(set! (-> a1-13 param 1) (-> arg3 param 1))
(set! (-> a1-13 param 2) (-> arg3 param 2))
(set! (-> a1-13 param 3) (-> arg3 param 3))
(set! (-> a1-13 param 4) (-> arg3 param 4))
(set! (-> a1-13 param 5) (-> arg3 param 5))
(send-event-function obj a1-13)
)
)
)
)
(else
(set! (-> obj incoming attack-id) (-> (the-as attack-info s2-0) id))
(enemy-method-75 obj arg0 (the-as touching-shapes-entry arg3))
)
)
)
)
)
)
((= arg2 'hit-flinch)
(when (zero? (-> obj hit-points))
((= arg2 'hit-flinch)
(when (zero? (-> obj hit-points))
(logclear! (-> obj mask) (process-mask actor-pause))
(logclear! (-> obj focus-status) (focus-status dangerous))
(logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice))
(logior! (-> obj enemy-flags) (enemy-flag chase-startup))
(logior! (-> obj focus-status) (focus-status hit))
(if (zero? (-> obj hit-points))
(logior! (-> obj focus-status) (focus-status dead))
)
(logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup))
(enemy-method-62 obj)
(set! (-> obj enemy-flags) (logior (enemy-flag actor-pause-backup) (-> obj enemy-flags)))
(process-contact-action arg0)
(send-event arg0 'get-attack-count 1)
(enemy-method-73 obj)
)
#t
)
((= arg2 'hit-knocked)
(logclear! (-> obj mask) (process-mask actor-pause))
(logclear! (-> obj focus-status) (focus-status dangerous))
(logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice))
@@ -1809,138 +1845,17 @@
(set! (-> obj enemy-flags) (logior (enemy-flag actor-pause-backup) (-> obj enemy-flags)))
(process-contact-action arg0)
(send-event arg0 'get-attack-count 1)
(enemy-method-73 obj)
)
#t
)
((= arg2 'hit-knocked)
(logclear! (-> obj mask) (process-mask actor-pause))
(logclear! (-> obj focus-status) (focus-status dangerous))
(logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice))
(logior! (-> obj enemy-flags) (enemy-flag chase-startup))
(logior! (-> obj focus-status) (focus-status hit))
(if (zero? (-> obj hit-points))
(logior! (-> obj focus-status) (focus-status dead))
)
(logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup))
(enemy-method-62 obj)
(set! (-> obj enemy-flags) (logior (enemy-flag actor-pause-backup) (-> obj enemy-flags)))
(process-contact-action arg0)
(send-event arg0 'get-attack-count 1)
(when (zero? (-> obj hit-points))
(case (-> obj incoming knocked-type)
(((knocked-type knocked-type-4) (knocked-type knocked-type-6))
(set! (-> obj incoming knocked-type) (knocked-type knocked-type-0))
0
)
)
)
(go (method-of-object obj knocked))
)
((= arg2 'hit)
(logclear! (-> obj mask) (process-mask actor-pause))
(logclear! (-> obj focus-status) (focus-status dangerous))
(logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice))
(logior! (-> obj enemy-flags) (enemy-flag chase-startup))
(logior! (-> obj focus-status) (focus-status hit))
(if (zero? (-> obj hit-points))
(logior! (-> obj focus-status) (focus-status dead))
)
(logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup))
(enemy-method-62 obj)
(set! (-> obj enemy-flags) (logior (enemy-flag actor-pause-backup) (-> obj enemy-flags)))
(process-contact-action arg0)
(send-event arg0 'get-attack-count 1)
(if (zero? (-> obj hit-points))
(enemy-method-73 obj)
(go (method-of-object obj hit))
)
)
((= arg2 'cue-chase)
(when (and (> (-> obj hit-points) 0)
(zero? (-> obj fated-time))
(zero? (logand (-> obj focus-status) (focus-status grabbed)))
)
(let ((v1-162 (logtest? (enemy-flag alert) (-> obj enemy-flags))))
(logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice alert victory called-dying))
(set! (-> obj enemy-flags) (logior (enemy-flag dangerous-backup) (-> obj enemy-flags)))
(logclear! (-> obj mask) (process-mask actor-pause))
(cond
(v1-162
(if (logtest? (enemy-option ambush) (-> obj fact-info-override enemy-options))
(go-ambush obj)
(go-hostile obj)
)
)
((and (-> obj next-state) (let ((v1-173 (-> obj next-state name)))
(or (= v1-173 'dormant) (= v1-173 'dormant-aware))
)
)
(if (logtest? (enemy-option ambush) (-> obj fact-info-override enemy-options))
(go-ambush obj)
(go (method-of-object obj notice))
)
(when (zero? (-> obj hit-points))
(case (-> obj incoming knocked-type)
(((knocked-type knocked-type-4) (knocked-type knocked-type-6))
(set! (-> obj incoming knocked-type) (knocked-type knocked-type-0))
0
)
)
)
#t
(go (method-of-object obj knocked))
)
)
((= arg2 'cue-wake)
(when (and (> (-> obj hit-points) 0)
(zero? (-> obj fated-time))
(zero? (logand (-> obj focus-status) (focus-status grabbed)))
)
(logclear! (-> obj enemy-flags) (enemy-flag alert victory called-dying))
(if (logtest? (enemy-option ambush) (-> obj fact-info-override enemy-options))
(go-ambush obj)
(enemy-method-72 obj)
)
#t
)
)
((= arg2 'jump)
(when (and (> (-> obj hit-points) 0)
(zero? (-> obj fated-time))
(zero? (logand (-> obj focus-status) (focus-status grabbed)))
)
(logclear! (-> obj mask) (process-mask actor-pause))
(set! (-> obj jump-why) (-> arg3 param 0))
(set! (-> obj event-param-point quad) (-> (the-as vector (-> arg3 param 1)) quad))
(go (method-of-object obj jump))
)
)
((= arg2 'death-start)
(set! (-> obj enemy-flags) (the-as enemy-flag (logior (enemy-flag recover) (-> obj enemy-flags))))
(send-event (ppointer->process (-> obj parent)) 'child-die)
(drop-pickup (-> obj fact-info-override) #t *entity-pool* (-> obj fact-info-override) 0)
(let ((s5-1 (-> obj on-death)))
(if s5-1
(eval!
(new 'stack 'script-context (the-as basic (process->ppointer pp)) pp (-> obj root-override2 trans))
(the-as pair s5-1)
)
)
)
)
((= arg2 'death-end)
(if (-> obj skel effect)
(logior! (-> obj skel effect flags) (effect-control-flag ecf2))
)
(logior! (-> obj draw status) (draw-control-status no-draw))
(logclear! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water))
(logclear! (-> obj focus-status) (focus-status dangerous))
(logclear! (-> obj enemy-flags) (enemy-flag check-water))
)
((= arg2 'instant-death)
(when (and (> (-> obj hit-points) 0) (zero? (-> obj fated-time)))
(set! (-> obj hit-points) 0)
(set! (-> obj root-override2 penetrated-by) (enemy-method-59 obj))
(let ((s5-2 (enemy-method-50 obj (new 'stack-no-clear 'vector))))
(vector-z-quaternion! s5-2 (-> obj root-override2 quat))
(vector-float*! s5-2 s5-2 -1.0)
(vector-normalize! s5-2 1.0)
)
((= arg2 'hit)
(logclear! (-> obj mask) (process-mask actor-pause))
(logclear! (-> obj focus-status) (focus-status dangerous))
(logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice))
@@ -1952,88 +1867,187 @@
(logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup))
(enemy-method-62 obj)
(set! (-> obj enemy-flags) (logior (enemy-flag actor-pause-backup) (-> obj enemy-flags)))
(enemy-method-73 obj)
(process-contact-action arg0)
(send-event arg0 'get-attack-count 1)
(if (zero? (-> obj hit-points))
(enemy-method-73 obj)
(go (method-of-object obj hit))
)
)
)
((= arg2 'die-fast)
(logior! (-> obj draw status) (draw-control-status no-draw))
(enemy-method-132 obj)
(send-event (ppointer->process (-> obj parent)) 'child-die)
(let ((s5-3 (-> obj on-death)))
(if s5-3
(eval!
(new 'stack 'script-context (the-as basic (process->ppointer pp)) pp (-> obj root-override2 trans))
(the-as pair s5-3)
((= arg2 'cue-chase)
(when (and (> (-> obj hit-points) 0)
(zero? (-> obj fated-time))
(zero? (logand (-> obj focus-status) (focus-status grabbed)))
)
(let ((v1-162 (logtest? (enemy-flag alert) (-> obj enemy-flags))))
(logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice alert victory called-dying))
(set! (-> obj enemy-flags) (logior (enemy-flag dangerous-backup) (-> obj enemy-flags)))
(logclear! (-> obj mask) (process-mask actor-pause))
(cond
(v1-162
(if (logtest? (enemy-option ambush) (-> obj fact-info-override enemy-options))
(go-ambush obj)
(go-hostile obj)
)
)
((and (-> obj next-state) (let ((v1-173 (-> obj next-state name)))
(or (= v1-173 'dormant) (= v1-173 'dormant-aware))
)
)
(if (logtest? (enemy-option ambush) (-> obj fact-info-override enemy-options))
(go-ambush obj)
(go (method-of-object obj notice))
)
)
)
)
)
(cleanup-for-death obj)
(go (method-of-object obj die-fast))
)
((= arg2 'victory)
(if (and (-> obj enemy-info use-victory)
(not (and (-> obj next-state) (= (-> obj next-state name) 'victory)))
(> (-> obj hit-points) 0)
(zero? (-> obj fated-time))
(zero? (logand (-> obj focus-status) (focus-status grabbed)))
)
(go (method-of-object obj victory))
)
)
((= arg2 'nav-control)
(if (nonzero? (-> obj nav))
(-> obj nav)
)
)
((= arg2 'push-trans)
(move-by-vector! (-> obj root-override2) (the-as vector (-> arg3 param 0)))
)
((= arg2 'move-trans)
(move-to-point! (-> obj root-override2) (the-as vector (-> arg3 param 0)))
)
((= arg2 'shadow)
(cond
((-> arg3 param 0)
(let ((v1-320 (-> obj draw shadow-ctrl)))
(logclear! (-> v1-320 settings flags) (shadow-flags disable-draw))
)
0
)
(else
(let ((v1-323 (-> obj draw shadow-ctrl)))
(logior! (-> v1-323 settings flags) (shadow-flags disable-draw))
)
0
#t
)
)
)
((= arg2 'color-effect)
(let ((v1-325 (-> arg3 param 0)))
(set! s5-5
(cond
((= v1-325 'dark)
(let ((f30-0 (rand-vu-float-range 0.2 1.0)))
(set-vector! (-> obj draw color-mult) (lerp 1.0 1.0 f30-0) (lerp 1.0 0.0 f30-0) (lerp 1.0 1.0 f30-0) 1.0)
(set! s5-5 (-> obj draw color-emissive))
(set! (-> s5-5 x) (lerp 0.0 0.3 f30-0))
(set! (-> s5-5 y) (lerp 0.0 0.0 f30-0))
(set! (-> s5-5 z) (lerp 0.0 0.3 f30-0))
((= arg2 'cue-wake)
(when (and (> (-> obj hit-points) 0)
(zero? (-> obj fated-time))
(zero? (logand (-> obj focus-status) (focus-status grabbed)))
)
(set! (-> s5-5 w) 1.0)
s5-5
)
((= v1-325 #f)
(set-vector! (-> obj draw color-mult) 1.0 1.0 1.0 1.0)
(set! s5-5 (-> obj draw color-emissive))
(set! (-> s5-5 quad) (the-as uint128 0))
s5-5
)
(logclear! (-> obj enemy-flags) (enemy-flag alert victory called-dying))
(if (logtest? (enemy-option ambush) (-> obj fact-info-override enemy-options))
(go-ambush obj)
(enemy-method-72 obj)
)
#t
)
)
((= arg2 'jump)
(when (and (> (-> obj hit-points) 0)
(zero? (-> obj fated-time))
(zero? (logand (-> obj focus-status) (focus-status grabbed)))
)
(logclear! (-> obj mask) (process-mask actor-pause))
(set! (-> obj jump-why) (-> arg3 param 0))
(set! (-> obj event-param-point quad) (-> (the-as vector (-> arg3 param 1)) quad))
(go (method-of-object obj jump))
)
)
((= arg2 'death-start)
(set! (-> obj enemy-flags) (the-as enemy-flag (logior (enemy-flag recover) (-> obj enemy-flags))))
(send-event (ppointer->process (-> obj parent)) 'child-die)
(drop-pickup (-> obj fact-info-override) #t *entity-pool* (-> obj fact-info-override) 0)
(let ((s5-1 (-> obj on-death)))
(if s5-1
(eval!
(new 'stack 'script-context (the-as basic (process->ppointer pp)) pp (-> obj root-override2 trans))
(the-as pair s5-1)
)
)
)
)
)
((= arg2 'death-end)
(if (-> obj skel effect)
(logior! (-> obj skel effect flags) (effect-control-flag ecf2))
)
(logior! (-> obj draw status) (draw-control-status no-draw))
(logclear! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water))
(logclear! (-> obj focus-status) (focus-status dangerous))
(set! (-> obj enemy-flags) (logclear (-> obj enemy-flags) (enemy-flag check-water)))
)
((= arg2 'instant-death)
(when (and (> (-> obj hit-points) 0) (zero? (-> obj fated-time)))
(set! (-> obj hit-points) 0)
(set! (-> obj root-override2 penetrated-by) (enemy-method-59 obj))
(let ((s5-2 (enemy-method-50 obj (new 'stack-no-clear 'vector))))
(vector-z-quaternion! s5-2 (-> obj root-override2 quat))
(vector-float*! s5-2 s5-2 -1.0)
(vector-normalize! s5-2 1.0)
)
(logclear! (-> obj mask) (process-mask actor-pause))
(logclear! (-> obj focus-status) (focus-status dangerous))
(logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice))
(logior! (-> obj enemy-flags) (enemy-flag chase-startup))
(logior! (-> obj focus-status) (focus-status hit))
(if (zero? (-> obj hit-points))
(logior! (-> obj focus-status) (focus-status dead))
)
(logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup))
(enemy-method-62 obj)
(set! (-> obj enemy-flags) (logior (enemy-flag actor-pause-backup) (-> obj enemy-flags)))
(enemy-method-73 obj)
)
)
((= arg2 'die-fast)
(logior! (-> obj draw status) (draw-control-status no-draw))
(enemy-method-132 obj)
(send-event (ppointer->process (-> obj parent)) 'child-die)
(let ((s5-3 (-> obj on-death)))
(if s5-3
(eval!
(new 'stack 'script-context (the-as basic (process->ppointer pp)) pp (-> obj root-override2 trans))
(the-as pair s5-3)
)
)
)
(cleanup-for-death obj)
(go (method-of-object obj die-fast))
)
((= arg2 'victory)
(if (and (-> obj enemy-info use-victory)
(not (and (-> obj next-state) (= (-> obj next-state name) 'victory)))
(> (-> obj hit-points) 0)
(zero? (-> obj fated-time))
(zero? (logand (-> obj focus-status) (focus-status grabbed)))
)
(go (method-of-object obj victory))
)
)
((= arg2 'nav-control)
(if (nonzero? (-> obj nav))
(-> obj nav)
)
)
((= arg2 'push-trans)
(move-by-vector! (-> obj root-override2) (the-as vector (-> arg3 param 0)))
)
((= arg2 'move-trans)
(move-to-point! (-> obj root-override2) (the-as vector (-> arg3 param 0)))
)
((= arg2 'shadow)
(cond
((-> arg3 param 0)
(let ((v1-320 (-> obj draw shadow-ctrl)))
(logclear! (-> v1-320 settings flags) (shadow-flags disable-draw))
)
0
)
(else
(let ((v1-323 (-> obj draw shadow-ctrl)))
(logior! (-> v1-323 settings flags) (shadow-flags disable-draw))
)
0
)
)
)
((= arg2 'color-effect)
(case (-> arg3 param 0)
(('dark)
(let ((f30-0 (rand-vu-float-range 0.2 1.0)))
(set-vector! (-> obj draw color-mult) (lerp 1.0 1.0 f30-0) (lerp 1.0 0.0 f30-0) (lerp 1.0 1.0 f30-0) 1.0)
(set! s5-5 (-> obj draw color-emissive))
(set! (-> s5-5 x) (lerp 0.0 0.3 f30-0))
(set! (-> s5-5 y) (lerp 0.0 0.0 f30-0))
(set! (-> s5-5 z) (lerp 0.0 0.3 f30-0))
)
(set! (-> s5-5 w) 1.0)
s5-5
)
((#f)
(set-vector! (-> obj draw color-mult) 1.0 1.0 1.0 1.0)
(set! s5-5 (-> obj draw color-emissive))
(set! (-> s5-5 quad) (the-as uint128 0))
s5-5
)
)
)
)
)
(none)
)
)
@@ -2048,7 +2062,7 @@
)
;; definition for method 58 of type enemy
(defmethod enemy-method-58 enemy ((obj enemy))
(defmethod enemy-method-58 enemy ((obj enemy) (arg0 process) (arg1 event-message-block))
(let ((v1-0 (-> obj incoming penetrate-using)))
(cond
((logtest? (the-as penetrate v1-0) (-> obj penetrated-flinch))
@@ -2188,9 +2202,8 @@
)
;; definition for function enemy-event-handler
;; WARN: Return type mismatch none vs object.
(defbehavior enemy-event-handler enemy ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(the-as object (enemy-method-74 self arg0 arg1 arg2 arg3))
(enemy-method-74 self arg0 arg1 arg2 arg3)
)
;; definition for function enemy-simple-post
+1 -1
View File
@@ -304,7 +304,7 @@
(clamp-vector-to-mesh-no-gaps (_type_ vector nav-poly vector clamp-travel-vector-to-mesh-return-info) none 21)
(find-first-sphere-and-update-avoid-params (_type_ vector nav-avoid-spheres-params) float 22)
(set-spheres-from-nav-ids (_type_) none 23)
(add-root-sphere-to-hash! (_type_ vector int) none 24)
(add-root-sphere-to-hash! (_type_ vector int) symbol 24)
(get-max-rotation-rate (_type_) float 25)
(get-sphere-mask (_type_) uint 26)
(get-target-speed (_type_) meters 27)
+6 -5
View File
@@ -949,12 +949,14 @@
(a1-31 (-> s5-0 temp-dir v1-30))
(a0-39 (-> s5-0 in-dir))
(a2-14 (-> s5-0 right-dir))
(a3-7 (vector-dot a1-31 a2-14))
(a3-7 (the-as number (vector-dot a1-31 a2-14)))
(t0-1 #xffffffff80000000)
(a2-16 #x3f800000)
(f0-30
(* f0-29 (* (the-as float (logior (logand a3-7 (the-as uint t0-1)) a2-16)) (- 1.0 (vector-dot a1-31 a0-39))))
)
(f0-30 (* f0-29 (* (the-as float (logior (logand (the-as uint a3-7) (the-as uint t0-1)) a2-16))
(- 1.0 (vector-dot a1-31 a0-39))
)
)
)
)
(when (< (-> s5-0 best-dir-angle s3-0) f0-30)
(set! (-> s5-0 best-dir s3-0 quad) (-> s5-0 temp-dir v1-30 quad))
@@ -2120,7 +2122,6 @@
(the-as int (-> obj root-sphere-id))
)
)
(none)
)
;; definition for method 47 of type nav-state
+27 -21
View File
@@ -23,27 +23,34 @@
)
;; definition for method 74 of type nav-enemy
;; WARN: Return type mismatch none vs object.
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 7]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 15]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 23]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 33]
(defmethod enemy-method-74 nav-enemy ((obj nav-enemy) (arg0 process) (arg1 object) (arg2 symbol) (arg3 event-message-block))
(case arg2
(('nav-mesh-kill)
(deactivate obj)
#t
)
(('nav-mesh-new)
(set! (-> obj water-max-height) (-> obj nav state mesh water-max-height))
#t
)
(('debug-control-on)
(go (method-of-object obj debug-control))
)
(('debug-control-off)
(enemy-method-72 obj)
)
(else
((method-of-type enemy enemy-method-74) obj arg0 arg1 arg2 arg3)
)
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'nav-mesh-kill)
(deactivate obj)
#t
)
((= v1-0 'nav-mesh-new)
(set! (-> obj water-max-height) (-> obj nav state mesh water-max-height))
#t
)
((= v1-0 'debug-control-on)
(go (method-of-object obj debug-control))
)
((= v1-0 'debug-control-off)
(enemy-method-72 obj)
)
(else
((method-of-type enemy enemy-method-74) obj arg0 arg1 arg2 arg3)
)
)
)
)
(none)
)
;; definition for symbol *nav-enemy-dummy-shadow-control*, type shadow-control
@@ -2827,13 +2834,12 @@
;; definition for method 82 of type nav-enemy
;; INFO: Used lq/sq
;; WARN: Return type mismatch none vs symbol.
(defmethod enemy-method-82 nav-enemy ((obj nav-enemy) (arg0 enemy-jump-info))
"@abstract"
(let ((v1-0 (new 'stack-no-clear 'vector)))
(set! (-> v1-0 quad) (-> arg0 dest-pos quad))
(set! (-> v1-0 w) (-> obj nav-radius-backup))
(the-as symbol (add-root-sphere-to-hash! (-> obj nav) v1-0 #x80068))
(add-root-sphere-to-hash! (-> obj nav) v1-0 #x80068)
)
)
+1 -1
View File
@@ -155,7 +155,7 @@
(update-from-spheres (_type_) none 28)
(sphere-hash-method-29 (_type_ find-nav-sphere-ids-params int int int) none 29)
(find-nav-sphere-ids (_type_ find-nav-sphere-ids-params) none 30)
(add-sphere-with-mask-and-id (_type_ vector int int) none 31)
(add-sphere-with-mask-and-id (_type_ vector int int) symbol 31)
(sphere-hash-method-32 (_type_ vector vector float int) symbol 32)
(remove-by-id (_type_ sphere int) none 33)
)
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,796 @@
;;-*-Lisp-*-
(in-package goal)
;; definition of type tomb-baby-spider
(deftype tomb-baby-spider (nav-enemy)
()
:heap-base #x1e0
:method-count-assert 180
:size-assert #x25c
:flag-assert #xb401e0025c
(:methods
(attack () _type_ :state 178)
(attack-stop () _type_ :state 179)
)
)
;; definition for method 3 of type tomb-baby-spider
(defmethod inspect tomb-baby-spider ((obj tomb-baby-spider))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(let ((t9-0 (method-of-type nav-enemy inspect)))
(t9-0 obj)
)
(label cfg-4)
obj
)
;; failed to figure out what this is:
(defskelgroup skel-tomb-baby-spider tomb-baby-spider tomb-baby-spider-lod0-jg tomb-baby-spider-idle-ja
((tomb-baby-spider-lod0-mg (meters 20)) (tomb-baby-spider-lod1-mg (meters 999999)))
:bounds (static-spherem 0 0 0 5.5)
:shadow tomb-baby-spider-shadow-mg
)
;; definition for symbol *tomb-baby-spider-nav-enemy-info*, type nav-enemy-info
(define *tomb-baby-spider-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 'array uint32 4 #x1e0002 #x64640401 #x0 #x0)
:idle-anim 4
:notice-anim 5
:hostile-anim 8
:hit-anim 4
:knocked-anim 14
:knocked-land-anim 15
:die-anim 13
:die-falling-anim 13
:victory-anim 4
:jump-wind-up-anim 4
:jump-in-air-anim 4
:jump-land-anim 4
:neck-joint -1
:look-at-joint 3
:bullseye-joint 3
:sound-die (static-sound-name "bspider-die")
:notice-distance (meters 40)
:notice-distance-delta (meters 10)
:proximity-notice-distance (meters 2)
:default-hit-points 1
:gnd-collide-with (collide-spec backgnd)
:overlaps-others-collide-with-filter (collide-spec jak bot player-list)
:penetrate-knocked #x11fffdffa
:movement-gravity (meters -100)
:friction 0.8
:attack-shove-back (meters 6)
:attack-shove-up (meters 3)
:attack-mode 'generic
:attack-damage 2
:recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher)
:jump-height-min (meters 3)
:jump-height-factor 0.5
:knocked-seek-ry-clamp 2730.6667
:knocked-soft-vxz-lo 80281.6
:knocked-soft-vxz-hi 87654.4
:knocked-soft-vy-lo 67993.6
:knocked-soft-vy-hi 112230.4
: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 55705.6
:knocked-hard-vxz-hi 71270.4
:knocked-hard-vy-lo 88473.6
:knocked-hard-vy-hi 132710.4
: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 55705.6
:knocked-red-vxz-hi 71270.4
:knocked-red-vy-lo 88473.6
:knocked-red-vy-hi 132710.4
:knocked-blue-vxz-lo 40960.0
:knocked-blue-vxz-hi 49152.0
:knocked-blue-vy-lo 24576.0
:knocked-blue-vy-hi 81920.0
:shadow-size (meters 2)
:shadow-max-y (meters 1)
:shadow-min-y (meters -1)
:shadow-locus-dist (meters 150)
:gem-joint -1
:gem-offset (new 'static 'sphere :r 163840.0)
:callback-info #f
:use-momentum #f
:use-frustration #f
:use-stop-chase #f
:use-circling #f
:use-pacing #f
:walk-anim 5
:turn-anim 5
:run-anim 8
:taunt-anim -1
:run-travel-speed (meters 6)
:run-acceleration (meters 4)
:run-turning-acceleration (meters 18)
:walk-travel-speed (meters 4)
:walk-acceleration (meters 1)
:walk-turning-acceleration (meters 8)
:maximum-rotation-rate (degrees 180.0)
:notice-nav-radius (meters 2)
:frustration-distance (meters 6)
:frustration-time (seconds 4)
:blocked-time (seconds 0.3)
:circle-dist-lo 20480.0
:circle-dist-hi 61440.0
:nav-mesh #f
)
)
;; failed to figure out what this is:
(set! (-> *tomb-baby-spider-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*)
;; failed to figure out what this is:
(defstate active (tomb-baby-spider)
:virtual #t
:code (behavior ()
(ja-channel-push! 1 (seconds 0.2))
(let ((f30-0 (get-rand-float-range self 0.9 1.1)))
(until #f
(ja-no-eval :group! (-> self draw art-group data (-> self enemy-info-override walk-anim))
:num! (seek!
(the float
(+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self enemy-info-override walk-anim)))
frames
num-frames
)
-1
)
)
f30-0
)
:frame-num 0.0
)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! max f30-0))
)
(when (enemy-method-123 self 0.2)
(ja-no-eval :num! (loop!))
(ja-channel-push! 1 (seconds 0.2))
(let ((v1-37 self))
(set! (-> v1-37 enemy-flags) (the-as enemy-flag (logclear (-> v1-37 enemy-flags) (enemy-flag enemy-flag36))))
(set! (-> v1-37 nav callback-info) *nav-enemy-null-callback-info*)
)
0
(nav-enemy-method-167 self)
(ja-no-eval :group! (-> self draw art-group data (-> self enemy-info-override idle-anim))
:num! (seek!
(the float
(+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self enemy-info-override idle-anim)))
frames
num-frames
)
-1
)
)
f30-0
)
:frame-num 0.0
)
(until (ja-done? 0)
(ja-blend-eval)
(suspend)
(ja :num! (seek! max f30-0))
)
(until (not (enemy-method-123 self 0.2))
(ja-no-eval :group! (-> self draw art-group data (-> self enemy-info-override idle-anim))
:num! (seek!
(the float
(+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self enemy-info-override idle-anim)))
frames
num-frames
)
-1
)
)
f30-0
)
:frame-num 0.0
)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! max f30-0))
)
)
(let ((v1-101 self))
(if (not (logtest? (enemy-flag enemy-flag36) (-> v1-101 enemy-flags)))
(set! (-> v1-101 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-101 enemy-flags))))
)
(set! (-> v1-101 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag36) (-> v1-101 enemy-flags))))
(set! (-> v1-101 nav callback-info) (-> v1-101 enemy-info-override callback-info))
)
0
(nav-enemy-method-165 self)
(ja-no-eval :num! (loop!))
(ja-channel-push! 1 (seconds 0.05))
(ja-no-eval :group! (-> self draw art-group data (-> self enemy-info-override walk-anim))
:num! (seek!
(the float
(+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self enemy-info-override walk-anim)))
frames
num-frames
)
-1
)
)
f30-0
)
:frame-num 0.0
)
(until (ja-done? 0)
(ja-blend-eval)
(suspend)
(ja :num! (seek! max f30-0))
)
)
)
)
#f
(none)
)
)
;; failed to figure out what this is:
(defstate notice (tomb-baby-spider)
:virtual #t
:code (behavior ()
(ja-channel-push! 1 (seconds 0.2))
(let ((f30-0 (get-rand-float-range self 0.8 1.2)))
(let ((gp-0 (new 'stack-no-clear 'vector)))
(let ((a0-3 (handle->process (-> self focus handle))))
(cond
(a0-3
(set! (-> gp-0 quad) (-> (get-trans (the-as process-focusable a0-3) 0) quad))
)
(else
(let ((a1-4 (-> self nav state)))
(set! (-> gp-0 quad) (-> a1-4 target-post quad))
)
)
)
)
(ja-no-eval :group! tomb-baby-spider-notice-spin-ja
:num! (seek!
(the float (+ (-> (the-as art-joint-anim tomb-baby-spider-notice-spin-ja) frames num-frames) -1))
f30-0
)
:frame-num 0.0
)
(until (ja-done? 0)
(seek-to-point-toward-point!
(-> self root-override2)
gp-0
(* 1.8 (-> self nav max-rotation-rate))
(seconds 0.02)
)
(suspend)
(ja :num! (seek! max f30-0))
)
)
(ja-no-eval :group! tomb-baby-spider-notice-land-ja
:num! (seek!
(the float (+ (-> (the-as art-joint-anim tomb-baby-spider-notice-land-ja) frames num-frames) -1))
f30-0
)
:frame-num 0.0
)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! max f30-0))
)
)
(enemy-method-72 self)
(none)
)
)
;; failed to figure out what this is:
(defstate attack (tomb-baby-spider)
:virtual #t
:event (the-as
(function process int symbol event-message-block object :behavior tomb-baby-spider)
enemy-event-handler
)
:enter (behavior ()
(nav-enemy-method-166 self)
(set! (-> self enemy-flags) (logior (enemy-flag actor-pause-backup) (-> self enemy-flags)))
(logior! (-> self focus-status) (focus-status dangerous))
(let ((v1-9 (-> (the-as collide-shape-prim-group (-> self root-override2 root-prim)) child 1)))
(set! (-> v1-9 local-sphere w) 4915.2)
)
(set! (-> self root-override2 penetrate-using) (penetrate generic-attack lunge))
(enemy-method-49 self)
(let* ((v1-14 *game-info*)
(v0-2 (+ (-> v1-14 attack-id) 1))
)
(set! (-> v1-14 attack-id) v0-2)
(set! (-> self attack-id) v0-2)
)
(none)
)
:exit (behavior ()
(let ((v1-3 (-> (the-as collide-shape-prim-group (-> self root-override2 root-prim)) child 1)))
(set! (-> v1-3 local-sphere w) 819.2)
)
(logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup))
(if (logtest? (-> self enemy-flags) (enemy-flag check-water))
(logior! (-> self focus-status) (focus-status dangerous))
(logclear! (-> self focus-status) (focus-status dangerous))
)
(nav-enemy-method-165 self)
(none)
)
:trans (behavior ()
(enemy-method-49 self)
(if (logtest? (-> self enemy-flags) (enemy-flag look-at-focus))
(logclear! (-> self enemy-flags) (enemy-flag look-at-focus))
)
(none)
)
:code (behavior ()
(let ((v1-0 (-> self nav)))
(set! (-> v1-0 target-speed) (* 2.8 (-> self enemy-info-override run-travel-speed)))
)
0
(let ((v1-2 (-> self nav)))
(set! (-> v1-2 acceleration) (* 2.4 (-> self enemy-info-override run-acceleration)))
)
0
(ja-channel-push! 1 (seconds 0.1))
(ja-no-eval :group! tomb-baby-spider-attack0-start-ja
:num! (seek!
(the float (+ (-> (the-as art-joint-anim tomb-baby-spider-attack0-start-ja) frames num-frames) -1))
0.8
)
:frame-num 0.0
)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! max 0.8))
)
(go-virtual attack-stop)
(none)
)
:post (the-as (function none :behavior tomb-baby-spider) nav-enemy-chase-post)
)
;; failed to figure out what this is:
(defstate attack-stop (tomb-baby-spider)
:virtual #t
:event (the-as
(function process int symbol event-message-block object :behavior tomb-baby-spider)
enemy-event-handler
)
:enter (behavior ()
(let ((v1-0 (-> self nav)))
(set! (-> v1-0 target-speed) 0.0)
)
0
(let ((v1-2 self))
(set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag37))))
)
0
(none)
)
:exit (behavior ()
(let ((v1-0 self))
(set! (-> v1-0 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-0 enemy-flags))))
)
0
(none)
)
:code (behavior ()
(ja-no-eval :group! tomb-baby-spider-attack0-stop-ja
:num! (seek! (the float (+ (-> (the-as art-joint-anim tomb-baby-spider-attack0-stop-ja) frames num-frames) -1)))
:frame-num 0.0
)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
(when (not (enemy-method-96 self 6371.5557 #t))
(let ((v1-27 self))
(set! (-> v1-27 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-27 enemy-flags))))
)
0
(let ((t9-4 vector-normalize!)
(a0-7 (new 'stack-no-clear 'vector))
(a2-3 (-> self nav state))
(v1-30 (new 'stack-no-clear 'vector))
)
(set! (-> v1-30 quad) (-> a2-3 target-post quad))
(let* ((s5-0 (t9-4 (vector-! a0-7 v1-30 (-> self root-override2 trans)) 1.0))
(f30-0 (deg-diff (quaternion-y-angle (-> self root-override2 quat)) (vector-y-angle s5-0)))
)
(ja-no-eval :num! (loop!))
(cond
((< 0.0 f30-0)
(ja-channel-push! 1 (seconds 0.1))
(ja :group! tomb-baby-spider-turn-left-ja :num! min)
)
(else
(ja-channel-push! 1 (seconds 0.1))
(ja :group! tomb-baby-spider-turn-right-ja :num! min)
)
)
)
)
(until (enemy-method-96 self 910.2222 #t)
(ja-blend-eval)
(suspend)
(ja :num! (loop!))
)
(let ((v1-53 self))
(set! (-> v1-53 enemy-flags) (the-as enemy-flag (logclear (-> v1-53 enemy-flags) (enemy-flag enemy-flag37))))
)
0
)
(ja-channel-push! 1 (seconds 0.2))
(let ((gp-3 (-> self clock frame-counter))
(s5-1 (the int (* 300.0 (rand-vu-float-range 0.6 1.2))))
(f30-2 1.0)
)
(ja-no-eval :group! (-> self draw art-group data (-> self enemy-info-override idle-anim))
:num! (loop! f30-2)
:frame-num 0.0
)
(until (>= (- (-> self clock frame-counter) gp-3) s5-1)
(suspend)
(ja :num! (loop! f30-2))
)
)
(let ((gp-4 (-> self focus aware)))
(if (or (not (enemy-method-107 self)) (!= gp-4 3))
(go-stare self)
)
)
(go-virtual hostile)
(none)
)
:post (the-as (function none :behavior tomb-baby-spider) nav-enemy-face-focus-post)
)
;; failed to figure out what this is:
(defstate hostile (tomb-baby-spider)
:virtual #t
:trans (behavior ()
(let ((t9-0 (-> (method-of-type nav-enemy hostile) trans)))
(if t9-0
(t9-0)
)
)
(let ((a0-1 (enemy-method-107 self)))
(when a0-1
(let ((a0-2 (get-trans a0-1 0)))
(if (and (< (vector-vector-distance a0-2 (-> self root-override2 trans)) 20480.0)
(enemy-method-96 self 1274.3112 #t)
)
(go-virtual attack)
)
)
)
)
(none)
)
)
;; definition for method 77 of type tomb-baby-spider
(defmethod enemy-method-77 tomb-baby-spider ((obj tomb-baby-spider) (arg0 (pointer float)))
(let* ((a2-0 (the-as collide-shape-prim-group (-> obj root-override2 root-prim)))
(v1-2 (-> a2-0 child 3))
)
(dotimes (a3-0 3)
(set! (-> a2-0 child a3-0 local-sphere w) 819.2)
)
(set! (-> v1-2 prim-core action) (collide-action solid))
(set! (-> v1-2 prim-core collide-as) (collide-spec enemy))
(set! (-> v1-2 prim-core collide-with)
(collide-spec backgnd jak bot crate obstacle player-list blocking-plane pusher)
)
)
(case (-> obj incoming knocked-type)
(((knocked-type knocked-type-6))
(let ((v1-6 (-> obj skel root-channel 0)))
(set! (-> v1-6 frame-group) (the-as art-joint-anim (-> obj draw art-group data 20)))
(set! (-> v1-6 param 0)
(the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 20)) frames num-frames) -1))
)
(set! (-> v1-6 param 1) (-> arg0 0))
(set! (-> v1-6 frame-num) 0.0)
(joint-control-channel-group! v1-6 (the-as art-joint-anim (-> obj draw art-group data 20)) num-func-seek!)
)
#t
)
(((knocked-type knocked-type-2) (knocked-type knocked-type-5))
(let ((v1-11 (-> obj skel root-channel 0)))
(set! (-> v1-11 frame-group) (the-as art-joint-anim (-> obj draw art-group data 17)))
(set! (-> v1-11 param 0)
(the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 17)) frames num-frames) -1))
)
(set! (-> v1-11 param 1) (-> arg0 0))
(set! (-> v1-11 frame-num) 0.0)
(joint-control-channel-group! v1-11 (the-as art-joint-anim (-> obj draw art-group data 17)) num-func-seek!)
)
#t
)
(else
((method-of-type nav-enemy enemy-method-77) obj arg0)
)
)
)
;; definition for method 78 of type tomb-baby-spider
(defmethod enemy-method-78 tomb-baby-spider ((obj tomb-baby-spider) (arg0 (pointer float)))
(case (-> obj incoming knocked-type)
(((knocked-type knocked-type-6))
(let ((v1-3 (-> obj skel root-channel 0)))
(set! (-> v1-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 22)))
(set! (-> v1-3 param 0)
(the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 22)) frames num-frames) -1))
)
(set! (-> v1-3 param 1) (-> arg0 0))
(set! (-> v1-3 frame-num) 0.0)
(joint-control-channel-group! v1-3 (the-as art-joint-anim (-> obj draw art-group data 22)) num-func-seek!)
)
#t
)
(((knocked-type knocked-type-2) (knocked-type knocked-type-5))
(let ((v1-8 (-> obj skel root-channel 0)))
(set! (-> v1-8 frame-group) (the-as art-joint-anim (-> obj draw art-group data 18)))
(set! (-> v1-8 param 0)
(the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 18)) frames num-frames) -1))
)
(set! (-> v1-8 param 1) (-> arg0 0))
(set! (-> v1-8 frame-num) 0.0)
(joint-control-channel-group! v1-8 (the-as art-joint-anim (-> obj draw art-group data 18)) num-func-seek!)
)
#t
)
(else
((method-of-type nav-enemy enemy-method-78) obj arg0)
)
)
)
;; definition for method 79 of type tomb-baby-spider
(defmethod enemy-method-79 tomb-baby-spider ((obj tomb-baby-spider) (arg0 int) (arg1 enemy-knocked-info))
(case arg0
((3)
(let ((s4-0 (ja-done? 0)))
(let ((a0-3 (-> obj skel root-channel 0)))
(set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group frames num-frames) -1)))
(set! (-> a0-3 param 1) (-> arg1 anim-speed))
(joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!)
)
(when s4-0
(case (-> obj incoming knocked-type)
(((knocked-type knocked-type-6))
)
(((knocked-type knocked-type-2) (knocked-type knocked-type-5))
(let ((a0-7 (-> obj skel root-channel 0)))
(set! (-> a0-7 frame-group) (the-as art-joint-anim (-> obj draw art-group data 19)))
(set! (-> a0-7 param 0)
(the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 19)) frames num-frames) -1))
)
(set! (-> a0-7 param 1) (-> arg1 anim-speed))
(set! (-> a0-7 frame-num) 0.0)
(joint-control-channel-group! a0-7 (the-as art-joint-anim (-> obj draw art-group data 19)) num-func-seek!)
)
)
(else
(let ((a0-8 (-> obj skel root-channel 0)))
(set! (-> a0-8 frame-group) (the-as art-joint-anim (-> obj draw art-group data 16)))
(set! (-> a0-8 param 0)
(the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 16)) frames num-frames) -1))
)
(set! (-> a0-8 param 1) (-> arg1 anim-speed))
(set! (-> a0-8 frame-num) 0.0)
(joint-control-channel-group! a0-8 (the-as art-joint-anim (-> obj draw art-group data 16)) num-func-seek!)
)
)
)
(vector-reset! (-> obj root-override2 transv))
#t
)
)
)
((4)
(let ((s4-1 (ja-done? 0)))
(let ((a0-11 (-> obj skel root-channel 0)))
(set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group frames num-frames) -1)))
(set! (-> a0-11 param 1) (-> arg1 anim-speed))
(joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!)
)
(when s4-1
(let ((v1-50 (-> obj root-override2 root-prim)))
(set! (-> (the-as collide-shape-prim-group v1-50) child 0 local-sphere w) 1638.4)
(set! (-> (the-as collide-shape-prim-group v1-50) child 1 local-sphere w) 1638.4)
(set! (-> (the-as collide-shape-prim-group v1-50) child 2 local-sphere w) 3276.8)
(set! (-> (the-as collide-shape-prim-group v1-50) child 3 prim-core action) (collide-action))
(set! (-> (the-as collide-shape-prim-group v1-50) child 3 prim-core collide-with) (collide-spec))
)
0
)
s4-1
)
)
(else
((method-of-type nav-enemy enemy-method-79) obj arg0 arg1)
)
)
)
;; definition for method 104 of type tomb-baby-spider
(defmethod enemy-method-104 tomb-baby-spider ((obj tomb-baby-spider) (arg0 process) (arg1 uint) (arg2 uint))
(let* ((s1-0 arg0)
(s2-0 (if (type? s1-0 process-focusable)
s1-0
)
)
(s1-1 *target*)
(v1-0 (if (type? s1-1 process-focusable)
s1-1
)
)
(f0-0 1.0)
)
(if (and (= s2-0 v1-0) (logtest? (focus-status indax) (-> v1-0 focus-status)))
(set! f0-0 0.6)
)
(let ((a1-5 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-5 from) (process->ppointer self))
(set! (-> a1-5 num-params) 2)
(set! (-> a1-5 message) 'attack)
(set! (-> a1-5 param 0) arg1)
(let ((v1-9 (new 'static 'attack-info :mask (attack-info-mask mode shove-back shove-up id damage knock))))
(set! (-> v1-9 id) arg2)
(set! (-> v1-9 shove-back) (* f0-0 (-> obj enemy-info-override attack-shove-back)))
(set! (-> v1-9 shove-up) (* f0-0 (-> obj enemy-info-override attack-shove-up)))
(set! (-> v1-9 mode) (-> obj enemy-info-override attack-mode))
(set! (-> v1-9 damage) (the float (-> obj enemy-info-override attack-damage)))
(set! (-> v1-9 knock) (the-as uint 8))
(set! (-> a1-5 param 1) (the-as uint v1-9))
)
(when (send-event-function arg0 a1-5)
(enemy-method-105 obj arg0)
#t
)
)
)
)
;; definition for method 114 of type tomb-baby-spider
;; WARN: Return type mismatch int vs none.
(defmethod enemy-method-114 tomb-baby-spider ((obj tomb-baby-spider))
"@abstract"
(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) 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 5) 0)))
(set! (-> s5-0 total-prims) (the-as uint 6))
(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 deadly no-standon))
(set! (-> s4-0 transform-index) 3)
(set-vector! (-> s4-0 local-sphere) 0.0 409.6 0.0 7782.4)
(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 no-standon))
(set! (-> v1-13 transform-index) 3)
(set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 1638.4)
)
(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 backgnd jak bot crate obstacle hit-by-others-list player-list)
)
(set! (-> v1-15 prim-core action) (collide-action solid deadly no-standon))
(set! (-> v1-15 transform-index) 24)
(set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 1638.4)
)
(let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-17 prim-core collide-as) (collide-spec enemy))
(set! (-> v1-17 prim-core collide-with)
(collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list)
)
(set! (-> v1-17 prim-core action) (collide-action solid no-standon))
(set! (-> v1-17 transform-index) 4)
(set-vector! (-> v1-17 local-sphere) 0.0 0.0 0.0 3276.8)
)
(set-vector!
(-> (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)) local-sphere)
0.0
2867.2
0.0
3276.8
)
(let ((v1-21 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
(set! (-> v1-21 prim-core collide-as) (collide-spec enemy))
(set! (-> v1-21 prim-core collide-with)
(collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list)
)
(set! (-> v1-21 prim-core action) (collide-action solid no-standon))
(set! (-> v1-21 transform-index) 5)
(set-vector! (-> v1-21 local-sphere) 0.0 4096.0 -1228.8 1638.4)
)
(set! (-> s5-0 nav-radius) 3686.4)
(let ((v1-23 (-> s5-0 root-prim)))
(set! (-> s5-0 backup-collide-as) (-> v1-23 prim-core collide-as))
(set! (-> s5-0 backup-collide-with) (-> v1-23 prim-core collide-with))
)
(set! (-> s5-0 max-iteration-count) (the-as uint 3))
(set! (-> obj root-override2) s5-0)
)
0
(none)
)
;; definition for method 115 of type tomb-baby-spider
(defmethod enemy-method-115 tomb-baby-spider ((obj tomb-baby-spider))
"@abstract"
(initialize-skeleton
obj
(the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-baby-spider" (the-as (pointer uint32) #f)))
(the-as pair 0)
)
(enemy-method-113 obj *tomb-baby-spider-nav-enemy-info*)
(none)
)
;; definition of type dig-spider
(deftype dig-spider (tomb-baby-spider)
()
:heap-base #x1e0
:method-count-assert 180
:size-assert #x25c
:flag-assert #xb401e0025c
)
;; definition for method 3 of type dig-spider
(defmethod inspect dig-spider ((obj dig-spider))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(let ((t9-0 (method-of-type tomb-baby-spider inspect)))
(t9-0 obj)
)
(label cfg-4)
obj
)
;; failed to figure out what this is:
0
+946
View File
@@ -0,0 +1,946 @@
;;-*-Lisp-*-
(in-package goal)
;; definition of type hopper
(deftype hopper (nav-enemy)
((speed-y float :offset-assert 604)
(accel-y float :offset-assert 608)
(next-jump-time int32 :offset-assert 612)
(path-intro path-control :offset-assert 616)
(can-go-knocked? symbol :offset-assert 620)
(land-anim-index int32 :offset-assert 624)
(step-num int32 :offset-assert 628)
(best-point vector :inline :offset-assert 640)
(best-score float :offset-assert 656)
(origin vector :inline :offset-assert 672)
(direction vector :inline :offset-assert 688)
(jump-dist float :offset-assert 704)
(side float :offset-assert 708)
(jump-start-anim uint32 :offset-assert 712)
(jump-air-anim uint32 :offset-assert 716)
(jump-land-anim uint32 :offset-assert 720)
(jump-height-min float :offset-assert 724)
(jump-anim-start-frame float :offset-assert 728)
(minimap connection-minimap :offset-assert 732)
)
:heap-base #x260
:method-count-assert 180
:size-assert #x2e0
:flag-assert #xb4026002e0
(:methods
(hopper-method-178 (_type_) symbol 178)
(hopper-method-179 (_type_) none 179)
)
)
;; definition for method 3 of type hopper
(defmethod inspect hopper ((obj hopper))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(let ((t9-0 (method-of-type nav-enemy inspect)))
(t9-0 obj)
)
(format #t "~2Tspeed-y: ~f~%" (-> obj speed-y))
(format #t "~2Taccel-y: ~f~%" (-> obj accel-y))
(format #t "~2Tnext-jump-time: ~D~%" (-> obj next-jump-time))
(format #t "~2Tpath-intro: ~A~%" (-> obj path-intro))
(format #t "~2Tcan-go-knocked?: ~A~%" (-> obj can-go-knocked?))
(format #t "~2Tland-anim-index: ~D~%" (-> obj land-anim-index))
(format #t "~2Tstep-num: ~D~%" (-> obj step-num))
(format #t "~2Tbest-point: #<vector @ #x~X>~%" (-> obj best-point))
(format #t "~2Tbest-score: ~f~%" (-> obj best-score))
(format #t "~2Torigin: #<vector @ #x~X>~%" (-> obj origin))
(format #t "~2Tdirection: #<vector @ #x~X>~%" (-> obj direction))
(format #t "~2Tjump-dist: ~f~%" (-> obj jump-dist))
(format #t "~2Tside: ~f~%" (-> obj side))
(format #t "~2Tjump-start-anim: ~D~%" (-> obj jump-start-anim))
(format #t "~2Tjump-air-anim: ~D~%" (-> obj jump-air-anim))
(format #t "~2Tjump-land-anim: ~D~%" (-> obj jump-land-anim))
(format #t "~2Tjump-height-min: ~f~%" (-> obj jump-height-min))
(format #t "~2Tjump-anim-start-frame: ~f~%" (-> obj jump-anim-start-frame))
(format #t "~2Tminimap: #<connection-minimap @ #x~X>~%" (-> obj minimap))
(label cfg-4)
obj
)
;; failed to figure out what this is:
(defskelgroup skel-hopper hopper hopper-lod0-jg hopper-idle-ja
((hopper-lod0-mg (meters 20)) (hopper-lod1-mg (meters 999999)))
:bounds (static-spherem 0 2.25 -0.7 6.5)
:shadow hopper-shadow-mg
)
;; definition of type hopper-anim-info
(deftype hopper-anim-info (structure)
((hit-anim-index int32 :offset-assert 0)
(land-anim-index int32 :offset-assert 4)
)
:pack-me
:method-count-assert 9
:size-assert #x8
:flag-assert #x900000008
)
;; definition for method 3 of type hopper-anim-info
(defmethod inspect hopper-anim-info ((obj hopper-anim-info))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj 'hopper-anim-info)
(format #t "~1Thit-anim-index: ~D~%" (-> obj hit-anim-index))
(format #t "~1Tland-anim-index: ~D~%" (-> obj land-anim-index))
(label cfg-4)
obj
)
;; definition of type hopper-global-info
(deftype hopper-global-info (basic)
((prev-yellow-hit int8 :offset-assert 4)
(prev-blue-hit int8 :offset-assert 5)
(yellow-hit-anim hopper-anim-info 3 :inline :offset-assert 8)
(blue-hit-anim hopper-anim-info 3 :inline :offset-assert 32)
)
:method-count-assert 9
:size-assert #x38
:flag-assert #x900000038
)
;; definition for method 3 of type hopper-global-info
(defmethod inspect hopper-global-info ((obj hopper-global-info))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~1Tprev-yellow-hit: ~D~%" (-> obj prev-yellow-hit))
(format #t "~1Tprev-blue-hit: ~D~%" (-> obj prev-blue-hit))
(format #t "~1Tyellow-hit-anim[3] @ #x~X~%" (-> obj yellow-hit-anim))
(format #t "~1Tblue-hit-anim[3] @ #x~X~%" (-> obj blue-hit-anim))
(label cfg-4)
obj
)
;; definition for symbol *hopper-global-info*, type hopper-global-info
(define *hopper-global-info* (new 'static 'hopper-global-info
:yellow-hit-anim (new 'static 'inline-array hopper-anim-info 3
(new 'static 'hopper-anim-info :hit-anim-index 25 :land-anim-index 26)
(new 'static 'hopper-anim-info :hit-anim-index 27 :land-anim-index 28)
(new 'static 'hopper-anim-info :hit-anim-index 29 :land-anim-index 30)
)
:blue-hit-anim (new 'static 'inline-array hopper-anim-info 3
(new 'static 'hopper-anim-info :hit-anim-index 21 :land-anim-index 24)
(new 'static 'hopper-anim-info :hit-anim-index 22 :land-anim-index 24)
(new 'static 'hopper-anim-info :hit-anim-index 23 :land-anim-index 24)
)
)
)
;; definition for method 77 of type hopper
(defmethod enemy-method-77 hopper ((obj hopper) (arg0 (pointer float)))
(case (-> obj incoming knocked-type)
(((knocked-type knocked-type-6))
(let* ((a2-0 (ash 1 (-> *hopper-global-info* prev-blue-hit)))
(v1-3 (enemy-method-120 obj 3 a2-0))
(a1-5 (-> obj draw art-group data (-> *hopper-global-info* blue-hit-anim v1-3 hit-anim-index)))
)
(set! (-> *hopper-global-info* prev-blue-hit) v1-3)
(let ((a0-12 (-> obj skel root-channel 0)))
(set! (-> a0-12 frame-group) (the-as art-joint-anim a1-5))
(set! (-> a0-12 param 0) (the float (+ (-> (the-as art-joint-anim a1-5) frames num-frames) -1)))
(set! (-> a0-12 param 1) 1.0)
(set! (-> a0-12 frame-num) 0.0)
(joint-control-channel-group! a0-12 (the-as art-joint-anim a1-5) num-func-seek!)
)
)
)
(else
(ja-channel-push! 1 (seconds 0.1))
(let* ((a2-2 (ash 1 (-> *hopper-global-info* prev-yellow-hit)))
(v1-13 (enemy-method-120 obj 3 a2-2))
(a1-11 (-> obj draw art-group data (-> *hopper-global-info* yellow-hit-anim v1-13 hit-anim-index)))
)
(set! (-> obj land-anim-index) (-> *hopper-global-info* yellow-hit-anim v1-13 land-anim-index))
(set! (-> *hopper-global-info* prev-yellow-hit) v1-13)
(let ((a0-27 (-> obj skel root-channel 0)))
(set! (-> a0-27 frame-group) (the-as art-joint-anim a1-11))
(set! (-> a0-27 param 0) (the float (+ (-> (the-as art-joint-anim a1-11) frames num-frames) -1)))
(set! (-> a0-27 param 1) (-> arg0 0))
(set! (-> a0-27 frame-num) 0.0)
(joint-control-channel-group! a0-27 (the-as art-joint-anim a1-11) num-func-seek!)
)
)
)
)
#t
)
;; definition for method 78 of type hopper
(defmethod enemy-method-78 hopper ((obj hopper) (arg0 (pointer float)))
(cond
((= (-> obj incoming knocked-type) (knocked-type knocked-type-6))
(when (>= (-> obj incoming blue-juggle-count) (the-as uint 2))
(let ((s4-0 (-> obj draw art-group data 24)))
(ja-channel-push! 1 (seconds 0.1))
(let ((a0-3 (-> obj skel root-channel 0)))
(set! (-> a0-3 frame-group) (the-as art-joint-anim s4-0))
(set! (-> a0-3 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1)))
(set! (-> a0-3 param 1) (-> arg0 0))
(set! (-> a0-3 frame-num) 0.0)
(joint-control-channel-group! a0-3 (the-as art-joint-anim s4-0) num-func-seek!)
)
)
#t
)
#f
)
(else
(ja-channel-push! 1 (seconds 0.1))
(let ((a0-5 (-> obj skel root-channel 0)))
(set! (-> a0-5 frame-group) (the-as art-joint-anim (-> obj draw art-group data (-> obj land-anim-index))))
(set! (-> a0-5 param 0)
(the float
(+ (-> (the-as art-joint-anim (-> obj draw art-group data (-> obj land-anim-index))) frames num-frames) -1)
)
)
(set! (-> a0-5 param 1) (-> arg0 0))
(set! (-> a0-5 frame-num) 0.0)
(joint-control-channel-group!
a0-5
(the-as art-joint-anim (-> obj draw art-group data (-> obj land-anim-index)))
num-func-seek!
)
)
#t
)
)
)
;; definition for symbol *hopper-nav-enemy-info*, type nav-enemy-info
(define *hopper-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 'array uint32 8 #x5010401 #x1010501 #x5010401 #x1010601 #x0 #x0 #x0 #x0)
:idle-anim 4
:notice-anim 7
:hostile-anim 4
:hit-anim 4
:knocked-anim 25
:knocked-land-anim 26
:die-anim 19
:die-falling-anim 20
:victory-anim -1
:jump-wind-up-anim -1
:jump-in-air-anim -1
:jump-land-anim -1
:neck-joint 5
:look-at-joint 5
:bullseye-joint 4
:sound-hit (static-sound-name "hopper-hit")
:sound-die (static-sound-name "hopper-die")
:notice-distance (meters 40)
:notice-distance-delta (meters 40)
:proximity-notice-distance (meters 4)
:default-hit-points 1
:gnd-collide-with (collide-spec backgnd)
:overlaps-others-collide-with-filter (collide-spec jak bot player-list)
:penetrate-knocked #xffffffffffffffff
: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)
:jump-height-min (meters 3)
:jump-height-factor 0.5
:knocked-seek-ry-clamp 4551.1113
:knocked-soft-vxz-lo 72089.6
:knocked-soft-vxz-hi 108134.4
:knocked-soft-vy-lo 81920.0
:knocked-soft-vy-hi 122880.0
:knocked-medium-vxz-lo 147456.0
:knocked-medium-vxz-hi 196608.0
:knocked-medium-vy-lo 135168.0
:knocked-medium-vy-hi 151552.0
:knocked-hard-vxz-lo 78643.2
:knocked-hard-vxz-hi 117964.8
:knocked-hard-vy-lo 183500.8
:knocked-hard-vy-hi 209715.2
:knocked-huge-vxz-lo 164659.2
:knocked-huge-vxz-hi 249036.8
:knocked-huge-vy-lo 183500.8
:knocked-huge-vy-hi 217907.2
:knocked-yellow-vxz-lo 40960.0
:knocked-yellow-vxz-hi 49152.0
:knocked-yellow-vy-lo 57344.0
:knocked-yellow-vy-hi 81920.0
:knocked-red-vxz-lo 24576.0
:knocked-red-vxz-hi 196608.0
:knocked-red-vy-lo 94208.0
:knocked-red-vy-hi 151552.0
:knocked-blue-vxz-lo 40960.0
:knocked-blue-vxz-hi 49152.0
:knocked-blue-vy-lo 24576.0
:knocked-blue-vy-hi 81920.0
:shadow-size (meters 2)
:shadow-max-y (meters 1)
:shadow-min-y (meters -1)
:shadow-locus-dist (meters 150)
:gem-joint 5
:gem-seg #x2
:gem-no-seg #x4
:gem-offset (new 'static 'sphere :y 1843.2 :z 1884.16 :r 163840.0)
:callback-info #f
:use-momentum #f
:use-frustration #t
:use-stop-chase #f
:use-circling #f
:use-pacing #f
:walk-anim 4
:turn-anim 9
:run-anim 13
:taunt-anim -1
:run-travel-speed (meters 1)
:run-acceleration (meters 1)
:run-turning-acceleration (meters 2)
:walk-travel-speed (meters 1)
:walk-acceleration (meters 1)
:walk-turning-acceleration (meters 3)
:maximum-rotation-rate (degrees 720.0)
:notice-nav-radius (meters 2)
:frustration-distance (meters 8)
:frustration-time (seconds 4)
:blocked-time (seconds 0.3)
:circle-dist-lo 20480.0
:circle-dist-hi 61440.0
:nav-mesh #f
)
)
;; failed to figure out what this is:
(set! (-> *hopper-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*)
;; definition for method 73 of type hopper
(defmethod enemy-method-73 hopper ((obj hopper))
(cond
((-> obj can-go-knocked?)
(set! (-> obj can-go-knocked?) #f)
(go (method-of-object obj knocked))
)
(else
((method-of-type nav-enemy enemy-method-73) obj)
)
)
(none)
)
;; definition for method 90 of type hopper
;; INFO: Used lq/sq
(defmethod enemy-method-90 hopper ((obj hopper) (arg0 int) (arg1 enemy-jump-info))
(when (= (-> obj jump-why) 2)
(cond
((zero? arg0)
(logior! (-> obj focus-status) (focus-status touch-water under-water))
)
(else
(when (logtest? (-> obj focus-status) (focus-status touch-water))
(let ((s3-0 (new 'stack-no-clear 'water-info)))
(water-info-init! (-> obj root-override2) s3-0 (collide-action solid semi-solid))
(let ((v1-9 #f))
(cond
((not (logtest? (water-flags touch-water) (-> s3-0 flags)))
(if (logtest? (-> obj focus-status) (focus-status under-water))
(set! v1-9 #t)
)
(logclear! (-> obj focus-status) (focus-status touch-water under-water))
)
((logtest? (-> obj focus-status) (focus-status under-water))
(let ((f0-1 (+ 11264.0 (-> obj root-override2 trans y))))
(if (< (-> s3-0 trans y) f0-1)
(set! v1-9 #t)
)
)
)
)
(when v1-9
(logclear! (-> obj focus-status) (focus-status under-water))
(let ((s2-0 (new 'stack-no-clear 'vector)))
(set! (-> s2-0 quad) (-> obj root-override2 trans quad))
(when (logtest? (water-flags touch-water) (-> s3-0 flags))
(set! (-> s2-0 y) (-> s3-0 trans y))
(let ((s3-1 (get-process *default-dead-pool* part-tracker #x4000)))
(when s3-1
(let ((t9-2 (method-of-type part-tracker activate)))
(t9-2
(the-as part-tracker s3-1)
*entity-pool*
(symbol->string (-> part-tracker symbol))
(the-as pointer #x70004000)
)
)
(let ((t9-3 run-function-in-process)
(a0-26 s3-1)
(a1-6 part-tracker-init)
(a2-6 (-> *part-group-id-table* 121))
(a3-1 0)
(t0-0 #f)
(t1-0 #f)
(t2-0 #f)
(t3-0 *launch-matrix*)
)
(set! (-> t3-0 trans quad) (-> s2-0 quad))
((the-as (function object object object object object object object object none) t9-3)
a0-26
a1-6
a2-6
a3-1
t0-0
t1-0
t2-0
t3-0
)
)
(-> s3-1 ppointer)
)
)
(sound-play "splash-out")
)
)
)
)
)
)
)
)
)
((method-of-type nav-enemy enemy-method-90) obj arg0 arg1)
)
;; definition for method 89 of type hopper
(defmethod enemy-method-89 hopper ((obj hopper) (arg0 enemy-jump-info))
(ja-channel-push! 1 (seconds 0.1))
(let ((a1-2 (-> obj draw art-group data (-> obj jump-start-anim)))
(a0-4 (-> obj 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
)
;; definition for method 87 of type hopper
(defmethod enemy-method-87 hopper ((obj hopper) (arg0 enemy-jump-info))
(ja-channel-push! 1 (seconds 0.1))
(let ((a1-2 (-> obj draw art-group data (-> obj jump-air-anim)))
(a0-4 (-> obj 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
)
;; definition for method 88 of type hopper
(defmethod enemy-method-88 hopper ((obj hopper) (arg0 enemy-jump-info))
(ja-channel-push! 1 (seconds 0.075))
(let ((a1-2 (-> obj draw art-group data (-> obj jump-land-anim)))
(a0-4 (-> obj 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
)
;; failed to figure out what this is:
(defstate jump (hopper)
:virtual #t
:enter (behavior ()
(let ((t9-0 (-> (method-of-type nav-enemy jump) enter)))
(if t9-0
(t9-0)
)
)
(none)
)
:exit (behavior ()
(let ((t9-0 (-> (method-of-type nav-enemy jump) exit)))
(if t9-0
(t9-0)
)
)
(let ((v1-5 (-> self draw shadow-ctrl)))
(logclear! (-> v1-5 settings flags) (shadow-flags shdf03))
(let ((a0-2 v1-5))
(set! (-> a0-2 settings top-plane w) (- 4096.0))
)
0
(set! (-> v1-5 settings bot-plane w) (- -4096.0))
)
0
(none)
)
:trans (behavior ()
(let ((t9-0 (-> (method-of-type nav-enemy jump) trans)))
(if t9-0
(t9-0)
)
)
(let ((v1-5 (-> self draw shadow-ctrl)))
(logior! (-> v1-5 settings flags) (shadow-flags shdf03))
(let ((a0-2 v1-5))
(set! (-> a0-2 settings bot-plane w)
(- (+ (- -4096.0 (-> self root-override2 trans y)) (-> self root-override2 gspot-pos y)))
)
)
0
(set! (-> v1-5 settings top-plane w)
(- (+ (- 8192.0 (-> self root-override2 trans y)) (-> self root-override2 gspot-pos y)))
)
)
0
(none)
)
)
;; definition for method 178 of type hopper
;; INFO: Used lq/sq
(defmethod hopper-method-178 hopper ((obj hopper))
(local-vars (sv-752 vector))
(rlet ((acc :class vf)
(vf0 :class vf)
(vf4 :class vf)
(vf5 :class vf)
(vf6 :class vf)
(vf7 :class vf)
)
(init-vf0-vector)
(+! (-> obj step-num) -1)
(cond
((>= (-> obj step-num) 0)
(let ((s3-0 (new 'stack-no-clear 'vector))
(s5-0 (new 'stack-no-clear 'vector))
)
(vector-rotate-around-y! s3-0 (-> obj direction) (* 182.04445 (the float (+ (* (-> obj step-num) 16) -135))))
(let ((a1-1 s5-0))
(let ((v1-7 (-> obj origin)))
(let ((a0-2 s3-0))
(let ((a2-1 (-> obj jump-dist)))
(.mov vf7 a2-1)
)
(.lvf vf5 (&-> a0-2 quad))
)
(.lvf vf4 (&-> v1-7 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 (&-> a1-1 quad) vf6)
)
(let ((v1-8 (-> obj nav))
(a0-3 s5-0)
(a1-2 (new 'stack-no-clear 'nav-find-poly-parms))
)
(vector-! (-> a1-2 point) a0-3 (-> v1-8 state mesh bounds))
(set! (-> a1-2 y-threshold) (-> v1-8 nearest-y-threshold))
(set! (-> a1-2 ignore) (the-as uint 2))
(let ((s4-0 (find-poly-containing-point-local (-> v1-8 state mesh) a1-2)))
(when s4-0
(let ((f30-0 (vector-dot s3-0 (-> obj direction))))
(new 'stack-no-clear 'vector)
(let ((a1-3 (new 'stack-no-clear 'vector)))
(set! (-> a1-3 quad) (-> s5-0 quad))
(set! (-> a1-3 w) 6144.0)
(when (not (add-root-sphere-to-hash! (-> obj nav) a1-3 #x8006c))
(when (< (-> obj best-score) f30-0)
(set! (-> obj best-score) f30-0)
(let ((s2-0 (new 'stack-no-clear 'vector)))
(set! sv-752 (new 'stack-no-clear 'vector))
(let ((s3-1 (new 'stack 'collide-query)))
(let ((s0-0 (-> obj nav))
(s1-0 s2-0)
)
(let* ((v1-21 s5-0)
(a0-10 (-> s0-0 state mesh))
(t9-4 (method-of-object a0-10 project-point-onto-plane-of-poly-local))
(a2-5 s1-0)
(t0-1 (vector-! (new 'stack-no-clear 'vector) v1-21 (-> s0-0 state mesh bounds)))
)
(t9-4 a0-10 s4-0 a2-5 sv-752 t0-1)
)
(vector+! s1-0 s1-0 (-> s0-0 state mesh bounds))
)
0
(set! (-> s5-0 y) (-> s2-0 y))
(if (enemy-method-126 obj s3-1 s5-0 (collide-spec backgnd) 8192.0 81920.0 1024.0)
(set! (-> s5-0 y) (-> s3-1 best-other-tri intersect y))
)
)
)
(set! (-> obj best-point quad) (-> s5-0 quad))
)
)
)
)
)
)
)
)
#t
)
(else
#f
)
)
)
)
;; failed to figure out what this is:
(defstate stare (hopper)
:virtual #t
:enter (behavior ()
(let ((t9-0 (-> (method-of-type nav-enemy stare) enter)))
(if t9-0
(t9-0)
)
)
(let ((v1-4 self))
(set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag enemy-flag37))))
)
0
(none)
)
)
;; definition for symbol *hopper-next-jump-time*, type time-frame
(define *hopper-next-jump-time* (the-as time-frame 0))
;; failed to figure out what this is:
(defstate hostile (hopper)
:virtual #t
:enter (behavior ()
(let ((t9-0 (-> (method-of-type nav-enemy hostile) enter)))
(if t9-0
(t9-0)
)
)
(let ((v1-4 self))
(set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag enemy-flag36))))
(set! (-> v1-4 nav callback-info) *nav-enemy-null-callback-info*)
)
0
(let ((v1-7 self))
(set! (-> v1-7 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-7 enemy-flags))))
)
0
(set! (-> self speed-y) 0.0)
(set! (-> self accel-y) 0.0)
(set! (-> self next-jump-time) (the-as int (+ (-> self clock frame-counter) (get-rand-int-range self 0 120))))
(set! (-> self step-num) 0)
(set! (-> self best-score) -2.0)
(none)
)
:exit (behavior ()
(let ((t9-0 (-> (method-of-type nav-enemy hostile) exit)))
(if t9-0
(t9-0)
)
)
(none)
)
:post (the-as (function none :behavior hopper) nav-enemy-simple-post)
)
;; failed to figure out what this is:
(defstate active (hopper)
:virtual #t
:enter (behavior ()
(let ((t9-0 (-> (method-of-type nav-enemy active) enter)))
(if t9-0
(t9-0)
)
)
(none)
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.2))
(let ((f30-0 (get-rand-float-range self 0.9 1.1)))
(until #f
(ja-no-eval :group! hopper-idle-ja
:num! (seek! (the float (+ (-> (the-as art-joint-anim hopper-idle-ja) frames num-frames) -1)) f30-0)
:frame-num 0.0
)
(until (ja-done? 0)
(suspend)
(ja :num! (seek! max f30-0))
)
)
)
#f
(none)
)
:post (the-as (function none :behavior hopper) nav-enemy-simple-post)
)
;; failed to figure out what this is:
(defstate notice (hopper)
:virtual #t
:code (behavior ()
(ja-channel-push! 1 (seconds 0.075))
(let ((f30-0 (get-rand-float-range self 0.8 1.2))
(gp-0 (new 'stack-no-clear 'vector))
)
(if (zero? (get-rand-int self 2))
(ja :group! hopper-notice-ja)
(ja :group! hopper-notice-alt-ja)
)
(ja-no-eval :group! (ja-group)
:num! (seek! (the float (+ (-> (ja-group) frames num-frames) -1)) f30-0)
:frame-num 0.0
)
(until (ja-done? 0)
(let ((a1-4 (-> self nav state)))
(set! (-> gp-0 quad) (-> a1-4 travel quad))
)
(seek-toward-heading-vec! (-> self root-override2) gp-0 (-> self nav max-rotation-rate) (seconds 0.02))
(suspend)
(ja :num! (seek! max f30-0))
)
)
(enemy-method-72 self)
(none)
)
)
;; failed to figure out what this is:
(defstate ambush (hopper)
:virtual #t
:enter (behavior ()
(when (logtest? (-> self enemy-flags) (enemy-flag auto-reset-penetrate))
(logclear! (-> self enemy-flags) (enemy-flag auto-reset-penetrate))
(let ((gp-0 (-> self on-notice)))
(if gp-0
(eval!
(new 'stack 'script-context (the-as basic (process->ppointer self)) self (-> self root-override2 trans))
(the-as pair gp-0)
)
)
)
)
(let ((v1-12 (-> self root-override2 root-prim)))
(set! (-> self root-override2 backup-collide-as) (-> v1-12 prim-core collide-as))
(set! (-> self root-override2 backup-collide-with) (-> v1-12 prim-core collide-with))
)
(let ((v1-15 (-> self root-override2 root-prim)))
(set! (-> v1-15 prim-core collide-as) (collide-spec))
(set! (-> v1-15 prim-core collide-with) (collide-spec))
)
0
(when (handle->process (-> self focus handle))
(let ((gp-1 (-> self root-override2))
(s5-0 (new 'stack-no-clear 'vector))
)
(let ((s4-0 (new 'stack-no-clear 'vector)))
0.0
(get-point-in-path! (-> self path-intro) s5-0 0.0 'exact)
(set! (-> s5-0 y) (+ -16384.0 (-> s5-0 y)))
(get-point-in-path! (-> self path-intro) s4-0 1.0 'exact)
(let ((f0-3 (deg-diff
(quaternion-y-angle (-> gp-1 quat))
(vector-y-angle (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s4-0 s5-0) 1.0))
)
)
)
(quaternion-rotate-y! (-> gp-1 quat) (-> gp-1 quat) f0-3)
)
)
(set! (-> gp-1 trans quad) (-> s5-0 quad))
)
)
(none)
)
:exit (behavior ()
(let ((v1-1 (-> self root-override2 root-prim)))
(set! (-> v1-1 prim-core collide-as) (-> self root-override2 backup-collide-as))
(set! (-> v1-1 prim-core collide-with) (-> self root-override2 backup-collide-with))
)
(none)
)
:trans (behavior ()
'()
(none)
)
:code (behavior ()
(logclear! (-> self draw status) (draw-control-status no-draw))
(let ((gp-0 (new 'stack-no-clear 'vector)))
(let ((s5-0 (new 'stack 'collide-query)))
(get-point-in-path! (-> self path-intro) gp-0 1.0 'exact)
(if (enemy-method-126 self s5-0 gp-0 (collide-spec backgnd) 8192.0 81920.0 1024.0)
(set! (-> gp-0 y) (-> s5-0 best-other-tri intersect y))
)
)
(set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag vulnerable))))
(send-event self 'jump 2 gp-0)
)
(go-virtual hostile)
(none)
)
)
;; definition for method 132 of type hopper
(defmethod enemy-method-132 hopper ((obj hopper))
(when (-> obj minimap)
(logior! (-> obj minimap flags) (minimap-flag fade-out))
(set! (-> obj minimap) #f)
)
((the-as (function enemy none) (find-parent-method hopper 132)) obj)
(none)
)
;; definition for method 7 of type hopper
;; WARN: Return type mismatch process-focusable vs hopper.
(defmethod relocate hopper ((obj hopper) (arg0 int))
(if (nonzero? (-> obj path-intro))
(&+! (-> obj path-intro) arg0)
)
(the-as
hopper
((the-as (function process-focusable int process-focusable) (find-parent-method hopper 7)) obj arg0)
)
)
;; definition for method 114 of type hopper
;; WARN: Return type mismatch int vs none.
(defmethod enemy-method-114 hopper ((obj hopper))
"@abstract"
(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) 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
vehicle
flut-attack
board
mech-punch
dark-punch
dark-giant
)
)
(let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0)))
(set! (-> s5-0 total-prims) (the-as uint 3))
(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 deadly no-standon))
(set! (-> s4-0 transform-index) 12)
(set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 9216.0)
(set! (-> s5-0 root-prim) s4-0)
)
(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 backgnd jak bot crate obstacle hit-by-others-list player-list)
)
(set! (-> v1-14 prim-core action) (collide-action solid no-standon))
(set-vector! (-> v1-14 local-sphere) 0.0 3686.4 0.0 3686.4)
)
(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) 5)
(set-vector! (-> v1-16 local-sphere) 0.0 0.0 819.2 3276.8)
)
(set! (-> s5-0 nav-radius) 4096.0)
(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! (-> obj root-override2) s5-0)
)
0
(none)
)
;; definition for method 115 of type hopper
;; WARN: Return type mismatch int vs none.
(defmethod enemy-method-115 hopper ((obj hopper))
"@abstract"
(stack-size-set! (-> obj main-thread) 256)
(initialize-skeleton
obj
(the-as skeleton-group (art-group-get-by-name *level* "skel-hopper" (the-as (pointer uint32) #f)))
(the-as pair 0)
)
(set! (-> obj skel generate-frame-function) create-interpolated2-joint-animation-frame)
(enemy-method-113 obj *hopper-nav-enemy-info*)
(set! (-> obj can-go-knocked?) #t)
(let ((v1-9 (-> obj neck)))
(set! (-> v1-9 up) (the-as uint 1))
(set! (-> v1-9 nose) (the-as uint 2))
(set! (-> v1-9 ear) (the-as uint 0))
(set-vector! (-> v1-9 twist-max) 10922.667 12743.111 0.0 1.0)
(set! (-> v1-9 ignore-angle) 18204.445)
)
(set! (-> obj jump-start-anim) (the-as uint 10))
(set! (-> obj jump-air-anim) (the-as uint 13))
(set! (-> obj jump-land-anim) (the-as uint 14))
(set! (-> obj jump-height-min) 12288.0)
(set! (-> obj jump-anim-start-frame) 8.0)
(set! (-> obj land-anim-index) 26)
(set! (-> obj side) (get-rand-float-range obj -1.5 1.5))
(when (logtest? (enemy-option ambush) (-> obj fact-info-override enemy-options))
(set! (-> obj path-intro) (new 'process 'path-control obj 'intro 0.0 (-> obj entity) #f))
(if (-> obj path-intro)
(logior! (-> obj path-intro flags) (path-control-flag display draw-line draw-point draw-text))
)
)
(add-connection *part-engine* obj 5 obj 318 (new 'static 'vector :x 1392.64 :y 491.52 :z 1638.4 :w 163840.0))
(add-connection *part-engine* obj 5 obj 318 (new 'static 'vector :x -1392.64 :y 491.52 :z 1638.4 :w 163840.0))
(logior! (-> obj nav flags) (nav-control-flag output-sphere-hash))
(let ((v1-34 (-> obj nav)))
(set! (-> v1-34 speed-scale) 1.0)
)
0
(set-gravity-length (-> obj root-override2 dynam) 327680.0)
(let ((v1-39 (-> obj nav)))
(set! (-> v1-39 nav-cull-radius) 61440.0)
)
0
(set! (-> obj minimap)
(minimap-method-12 *minimap* obj (the-as uint 70) (the-as int #f) (the-as vector #t) 0)
)
0
(none)
)
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-1
View File
@@ -389,7 +389,6 @@
((method-of-type nav-enemy enemy-method-74) obj arg0 arg1 arg2 arg3)
)
)
(none)
)
;; definition for method 66 of type grunt
File diff suppressed because it is too large Load Diff
+37 -28
View File
@@ -243,39 +243,48 @@
)
;; definition for method 74 of type pegasus
;; WARN: Return type mismatch none vs object.
(defmethod enemy-method-74 pegasus ((obj pegasus) (arg0 process) (arg1 object) (arg2 symbol) (arg3 event-message-block))
(with-pp
(case arg2
(('track)
)
(('hit 'hit-knocked)
(cond
((zero? (-> obj hit-points))
(logclear! (-> obj mask) (process-mask actor-pause))
(logclear! (-> obj focus-status) (focus-status dangerous))
(logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice))
(logior! (-> obj enemy-flags) (enemy-flag chase-startup))
(logior! (-> obj focus-status) (focus-status hit))
(if (zero? (-> obj hit-points))
(logior! (-> obj focus-status) (focus-status dead))
)
(logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup))
(enemy-method-62 obj)
(set! (-> obj enemy-flags) (logior (enemy-flag actor-pause-backup) (-> obj enemy-flags)))
(process-contact-action arg0)
(send-event arg0 'get-attack-count 1)
(enemy-method-73 obj)
)
(else
(set! (-> obj targetted-timer) (the-as uint (-> pp clock frame-counter)))
(let ((v1-0 arg2))
(the-as
object
(cond
((= v1-0 'track)
#f
)
)
)
(else
((method-of-type enemy enemy-method-74) obj arg0 arg1 arg2 arg3)
((or (= v1-0 'hit) (= v1-0 'hit-knocked))
(cond
((zero? (-> obj hit-points))
(logclear! (-> obj mask) (process-mask actor-pause))
(logclear! (-> obj focus-status) (focus-status dangerous))
(logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice))
(logior! (-> obj enemy-flags) (enemy-flag chase-startup))
(logior! (-> obj focus-status) (focus-status hit))
(if (zero? (-> obj hit-points))
(logior! (-> obj focus-status) (focus-status dead))
)
(logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup))
(enemy-method-62 obj)
(set! (-> obj enemy-flags) (logior (enemy-flag actor-pause-backup) (-> obj enemy-flags)))
(process-contact-action arg0)
(send-event arg0 'get-attack-count 1)
(the-as object (enemy-method-73 obj))
)
(else
(let ((v0-0 (the-as object (-> pp clock frame-counter))))
(set! (-> obj targetted-timer) (the-as uint v0-0))
v0-0
)
)
)
)
(else
((method-of-type enemy enemy-method-74) obj arg0 arg1 arg2 arg3)
)
)
)
)
(none)
)
)
File diff suppressed because it is too large Load Diff
+5 -8
View File
@@ -54,6 +54,7 @@
((dest-node-id uint16 :offset-assert 0)
(flags predator-edge-flag :offset-assert 2)
)
:pack-me
:method-count-assert 9
:size-assert #x4
:flag-assert #x900000004
@@ -76,10 +77,10 @@
;; definition of type predator-graph
(deftype predator-graph (structure)
((node-count uint16 :offset-assert 0)
(edge-count uint16 :offset-assert 2)
(node uint32 :offset-assert 4)
(edge uint32 :offset-assert 8)
((node-count uint16 :offset-assert 0)
(edge-count uint16 :offset-assert 2)
(node (inline-array predator-node) :offset-assert 4)
(edge (inline-array predator-edge) :offset-assert 8)
)
:method-count-assert 9
:size-assert #xc
@@ -103,7 +104,3 @@
;; failed to figure out what this is:
0
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+288
View File
@@ -0,0 +1,288 @@
;;-*-Lisp-*-
(in-package goal)
;; definition of type rhino-wall
(deftype rhino-wall (process-focusable)
((anim spool-anim :offset-assert 204)
(art-name string :offset-assert 208)
(id int8 :offset-assert 212)
)
:heap-base #x60
:method-count-assert 31
:size-assert #xd5
:flag-assert #x1f006000d5
(:methods
(unbroken () _type_ :state 27)
(hit () _type_ :state 28)
(broken () _type_ :state 29)
(rhino-wall-method-30 (_type_) none 30)
)
)
;; definition for method 3 of type rhino-wall
(defmethod inspect rhino-wall ((obj rhino-wall))
(when (not obj)
(set! obj obj)
(goto cfg-4)
)
(let ((t9-0 (method-of-type process-focusable inspect)))
(t9-0 obj)
)
(format #t "~2Tanim: ~A~%" (-> obj anim))
(format #t "~2Tart-name: ~A~%" (-> obj art-name))
(format #t "~2Tid: ~D~%" (-> obj id))
(label cfg-4)
obj
)
;; failed to figure out what this is:
(defskelgroup skel-rhino-wall-1 rhino-wall rhino-wall-1-lod0-jg rhino-wall-1-idle-ja
((rhino-wall-1-lod0-mg (meters 999999)))
:bounds (static-spherem 0.3 9 -3 11)
)
;; failed to figure out what this is:
(defskelgroup skel-rhino-wall-2 rhino-wall rhino-wall-2-lod0-jg rhino-wall-2-idle-ja
((rhino-wall-2-lod0-mg (meters 999999)))
:bounds (static-spherem 0.3 13.5 0 14.5)
)
;; definition for method 30 of type rhino-wall
;; WARN: Return type mismatch vector vs none.
(defmethod rhino-wall-method-30 rhino-wall ((obj rhino-wall))
(let ((v1-1 (-> obj root-override root-prim)))
(countdown (a1-0 (-> v1-1 specific 0))
(let ((a2-1 (-> (the-as collide-shape-prim-group v1-1) child a1-0)))
(cond
((zero? a1-0)
(set! (-> a2-1 prim-core collide-as) (collide-spec))
0
)
(else
(set! (-> a2-1 prim-core collide-as) (collide-spec obstacle))
)
)
)
)
(case (-> obj id)
((1)
(set! (-> obj draw origin-joint-index) (the-as uint 2))
(set-vector! (-> obj draw bounds) 0.0 0.0 81920.0 131072.0)
(set! (-> v1-1 transform-index) 2)
(set-vector! (-> v1-1 local-sphere) 0.0 0.0 81920.0 122880.0)
)
((2)
(set! (-> obj draw origin-joint-index) (the-as uint 2))
(set-vector! (-> obj draw bounds) 0.0 0.0 81920.0 131072.0)
(set! (-> v1-1 transform-index) 2)
(set-vector! (-> v1-1 local-sphere) 0.0 0.0 81920.0 122880.0)
)
)
)
(none)
)
;; failed to figure out what this is:
(defstate unbroken (rhino-wall)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
(('trigger)
(go-virtual hit)
)
)
)
:code (behavior ()
(add-process *gui-control* self (gui-channel art-load) (gui-action queue) (-> self anim name) -99.0 0)
(transform-post)
(suspend)
(transform-post)
(sleep-code)
(none)
)
)
;; failed to figure out what this is:
(defstate hit (rhino-wall)
:virtual #t
:post (the-as (function none :behavior rhino-wall) transform-post)
)
;; failed to figure out what this is:
(defstate broken (rhino-wall)
:virtual #t
)
;; definition for method 11 of type rhino-wall
;; WARN: Return type mismatch object vs none.
(defmethod init-from-entity! rhino-wall ((obj rhino-wall) (arg0 entity-actor))
(stack-size-set! (-> obj main-thread) 512)
(set! (-> obj mask) (logior (process-mask collectable) (-> obj mask)))
(let ((s3-0 (res-lump-struct (-> obj entity) 'art-name structure))
(s4-0 (art-group-get-by-name *level* "skel-rhino-wall-1" (the-as (pointer uint32) #f)))
)
(set! (-> obj art-name) (the-as string s3-0))
(cond
((string= (the-as string s3-0) "rhino-wall-1")
(set! (-> obj id) 1)
(let ((s4-1 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player))))
(set! (-> s4-1 dynam) (copy *standard-dynamics* 'process))
(set! (-> s4-1 reaction) cshape-reaction-default)
(set! (-> s4-1 no-reaction)
(the-as (function collide-shape-moving collide-query vector vector object) nothing)
)
(set! (-> s4-1 penetrated-by) (penetrate))
(let ((s3-1 (new 'process 'collide-shape-prim-group s4-1 (the-as uint 9) 0)))
(set! (-> s4-1 total-prims) (the-as uint 10))
(set! (-> s3-1 prim-core collide-as) (collide-spec obstacle))
(set! (-> s3-1 prim-core action) (collide-action solid))
(set! (-> s3-1 transform-index) 3)
(set-vector! (-> s3-1 local-sphere) 14336.0 -8192.0 0.0 40960.0)
(set! (-> s4-1 root-prim) s3-1)
)
(let ((v1-19 (new 'process 'collide-shape-prim-mesh s4-1 (the-as uint 1) (the-as uint 0))))
(set! (-> v1-19 prim-core collide-as) (collide-spec obstacle))
(set! (-> v1-19 prim-core action) (collide-action solid))
(set! (-> v1-19 transform-index) 3)
(set-vector! (-> v1-19 local-sphere) 14336.0 -8192.0 0.0 40960.0)
)
(let ((v1-21 (new 'process 'collide-shape-prim-mesh s4-1 (the-as uint 8) (the-as uint 0))))
(set! (-> v1-21 prim-core action) (collide-action solid))
(set! (-> v1-21 transform-index) 43)
(set-vector! (-> v1-21 local-sphere) 0.0 0.0 0.0 32768.0)
)
(let ((v1-23 (new 'process 'collide-shape-prim-mesh s4-1 (the-as uint 2) (the-as uint 0))))
(set! (-> v1-23 prim-core action) (collide-action solid))
(set! (-> v1-23 transform-index) 7)
(set-vector! (-> v1-23 local-sphere) 0.0 0.0 0.0 8192.0)
)
(let ((v1-25 (new 'process 'collide-shape-prim-mesh s4-1 (the-as uint 5) (the-as uint 0))))
(set! (-> v1-25 prim-core action) (collide-action solid))
(set! (-> v1-25 transform-index) 12)
(set-vector! (-> v1-25 local-sphere) 8192.0 0.0 0.0 12288.0)
)
(let ((v1-27 (new 'process 'collide-shape-prim-mesh s4-1 (the-as uint 6) (the-as uint 0))))
(set! (-> v1-27 prim-core action) (collide-action solid))
(set! (-> v1-27 transform-index) 16)
(set-vector! (-> v1-27 local-sphere) 0.0 0.0 0.0 10240.0)
)
(let ((v1-29 (new 'process 'collide-shape-prim-mesh s4-1 (the-as uint 0) (the-as uint 0))))
(set! (-> v1-29 prim-core action) (collide-action solid))
(set! (-> v1-29 transform-index) 3)
(set-vector! (-> v1-29 local-sphere) 0.0 0.0 0.0 8192.0)
)
(let ((v1-31 (new 'process 'collide-shape-prim-mesh s4-1 (the-as uint 4) (the-as uint 0))))
(set! (-> v1-31 prim-core action) (collide-action solid))
(set! (-> v1-31 transform-index) 9)
(set-vector! (-> v1-31 local-sphere) 0.0 0.0 0.0 8192.0)
)
(let ((v1-33 (new 'process 'collide-shape-prim-mesh s4-1 (the-as uint 7) (the-as uint 0))))
(set! (-> v1-33 prim-core action) (collide-action solid))
(set! (-> v1-33 transform-index) 28)
(set-vector! (-> v1-33 local-sphere) 0.0 0.0 0.0 8192.0)
)
(let ((v1-35 (new 'process 'collide-shape-prim-mesh s4-1 (the-as uint 3) (the-as uint 0))))
(set! (-> v1-35 prim-core action) (collide-action solid))
(set! (-> v1-35 transform-index) 8)
(set-vector! (-> v1-35 local-sphere) 0.0 0.0 0.0 16384.0)
)
(set! (-> s4-1 nav-radius) (* 0.75 (-> s4-1 root-prim local-sphere w)))
(let ((v1-38 (-> s4-1 root-prim)))
(set! (-> s4-1 backup-collide-as) (-> v1-38 prim-core collide-as))
(set! (-> s4-1 backup-collide-with) (-> v1-38 prim-core collide-with))
)
(set! (-> obj root-override) s4-1)
)
(set! s4-0 (art-group-get-by-name *level* "skel-rhino-wall-1" (the-as (pointer uint32) #f)))
(set! (-> obj anim)
(new 'static 'spool-anim :name "rhino-wall-1" :anim-name "1-break" :parts 2 :command-list '())
)
)
((string= (the-as string s3-0) "rhino-wall-2")
(set! (-> obj id) 2)
(let ((s4-2 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player))))
(set! (-> s4-2 dynam) (copy *standard-dynamics* 'process))
(set! (-> s4-2 reaction) cshape-reaction-default)
(set! (-> s4-2 no-reaction)
(the-as (function collide-shape-moving collide-query vector vector object) nothing)
)
(set! (-> s4-2 penetrated-by) (penetrate))
(let ((s3-2 (new 'process 'collide-shape-prim-group s4-2 (the-as uint 9) 0)))
(set! (-> s4-2 total-prims) (the-as uint 10))
(set! (-> s3-2 prim-core collide-as) (collide-spec obstacle))
(set! (-> s3-2 prim-core action) (collide-action solid))
(set! (-> s3-2 transform-index) 3)
(set-vector! (-> s3-2 local-sphere) -8192.0 -4096.0 0.0 40960.0)
(set! (-> s4-2 root-prim) s3-2)
)
(let ((v1-55 (new 'process 'collide-shape-prim-mesh s4-2 (the-as uint 0) (the-as uint 0))))
(set! (-> v1-55 prim-core collide-as) (collide-spec obstacle))
(set! (-> v1-55 prim-core action) (collide-action solid))
(set! (-> v1-55 transform-index) 3)
(set-vector! (-> v1-55 local-sphere) -8192.0 -4096.0 0.0 40960.0)
)
(let ((v1-57 (new 'process 'collide-shape-prim-mesh s4-2 (the-as uint 1) (the-as uint 0))))
(set! (-> v1-57 prim-core action) (collide-action solid))
(set! (-> v1-57 transform-index) 4)
(set-vector! (-> v1-57 local-sphere) 0.0 0.0 0.0 8192.0)
)
(let ((v1-59 (new 'process 'collide-shape-prim-mesh s4-2 (the-as uint 2) (the-as uint 0))))
(set! (-> v1-59 prim-core action) (collide-action solid))
(set! (-> v1-59 transform-index) 7)
(set-vector! (-> v1-59 local-sphere) 0.0 0.0 0.0 8192.0)
)
(let ((v1-61 (new 'process 'collide-shape-prim-mesh s4-2 (the-as uint 3) (the-as uint 0))))
(set! (-> v1-61 prim-core action) (collide-action solid))
(set! (-> v1-61 transform-index) 15)
(set-vector! (-> v1-61 local-sphere) 0.0 0.0 0.0 12288.0)
)
(let ((v1-63 (new 'process 'collide-shape-prim-mesh s4-2 (the-as uint 4) (the-as uint 0))))
(set! (-> v1-63 prim-core action) (collide-action solid))
(set! (-> v1-63 transform-index) 16)
(set-vector! (-> v1-63 local-sphere) 0.0 0.0 0.0 8192.0)
)
(let ((v1-65 (new 'process 'collide-shape-prim-mesh s4-2 (the-as uint 5) (the-as uint 0))))
(set! (-> v1-65 prim-core action) (collide-action solid))
(set! (-> v1-65 transform-index) 26)
(set-vector! (-> v1-65 local-sphere) 0.0 0.0 0.0 8192.0)
)
(let ((v1-67 (new 'process 'collide-shape-prim-mesh s4-2 (the-as uint 6) (the-as uint 0))))
(set! (-> v1-67 prim-core action) (collide-action solid))
(set! (-> v1-67 transform-index) 27)
(set-vector! (-> v1-67 local-sphere) 0.0 0.0 0.0 8192.0)
)
(let ((v1-69 (new 'process 'collide-shape-prim-mesh s4-2 (the-as uint 7) (the-as uint 0))))
(set! (-> v1-69 prim-core action) (collide-action solid))
(set! (-> v1-69 transform-index) 28)
(set-vector! (-> v1-69 local-sphere) 0.0 0.0 0.0 8192.0)
)
(let ((v1-71 (new 'process 'collide-shape-prim-mesh s4-2 (the-as uint 9) (the-as uint 0))))
(set! (-> v1-71 prim-core action) (collide-action solid))
(set! (-> v1-71 transform-index) 58)
(set-vector! (-> v1-71 local-sphere) 0.0 12288.0 0.0 32768.0)
)
(set! (-> s4-2 nav-radius) (* 0.75 (-> s4-2 root-prim local-sphere w)))
(let ((v1-74 (-> s4-2 root-prim)))
(set! (-> s4-2 backup-collide-as) (-> v1-74 prim-core collide-as))
(set! (-> s4-2 backup-collide-with) (-> v1-74 prim-core collide-with))
)
(set! (-> obj root-override) s4-2)
)
(set! s4-0 (art-group-get-by-name *level* "skel-rhino-wall-2" (the-as (pointer uint32) #f)))
(set! (-> obj anim)
(new 'static 'spool-anim :name "rhino-wall-2" :anim-name "2-break" :parts 1 :command-list '())
)
)
(else
(go process-drawable-art-error (the-as string s3-0))
)
)
(process-drawable-from-entity! obj arg0)
(initialize-skeleton obj (the-as skeleton-group s4-0) (the-as pair 0))
)
(if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete)))
(go (method-of-object obj broken))
(go (method-of-object obj unbroken))
)
(none)
)
File diff suppressed because it is too large Load Diff
+7 -2
View File
@@ -264,12 +264,17 @@
"(method 43 nav-mesh)",
"(method 34 nav-mesh)",
"(method 18 nav-control)",
"(method 10 idle-control)" // re-assigns `self`
"(method 10 idle-control)", // re-assigns `self`
"(method 3 rhino)"
],
"skip_compile_states": {
"(idle process-taskable)": ["event"],
"(impact gun-dark-shot)": ["code"],
"(target-gun-stance target)": ["code"]
"(target-gun-stance target)": ["code"],
"(hostile hopper)": ["trans"], // adds b! but the corresponding label is missing
"(broken rhino-wall)": ["code"], // missing cast to art-joint-anim
"(hit rhino-wall)": ["code"] // missing cast to art-joint-anim
}
}