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
+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