decomp: decompile almost all the platform related files (#812)

* deocmp: `plat` finished, `baseplat` started

* decomp: finish `baseplat`

* decomp: finish `plat-button`

* decomp: finish `plat-eco`

* decomp: finish `citb-drop-plat-CIT`

* decomp: finish `cit-drop-plat-L1`

* decomp: finish `plat-flip`

* decomp: added a bunch of label defs

* decomp: `plat-button` ref test added

* stash

* decomp: finish `baseplat`

* decomp: finish `plat`

* decomp: finish `plat-button`

* tests: fix offline-test to handle multi-DGO files better

* decomp: finish `citb-drop-plat-CIT`

* decomp: finish `plat-flip`

* decomp: finish `wedge-plats`

* tools: fix memory analyzer, skip invalid type

* decomp: finish `wall-plat`

* fix ordering

* fix some casting issues

* cleanup after conflict resolution

* address reviews
This commit is contained in:
Tyler Wilding
2021-09-06 21:10:19 -04:00
committed by GitHub
parent d6ffaede3a
commit 4ff2130d55
35 changed files with 9183 additions and 634 deletions
+7
View File
@@ -97,6 +97,13 @@
"name" : "Run - EE Memory Analyze",
"args" : [ "${workspaceRoot}/eeMemory.bin", "${workspaceRoot}"]
},
{
"type" : "default",
"project" : "CMakeLists.txt",
"projectTarget" : "memory_dump_tool.exe (bin\\memory_dump_tool.exe)",
"name" : "Run - EE Memory Analyze - Test",
"args" : [ "\"C:\\Users\\xtvas\\Repositories\\pcsx2\\128mb\\sstates\\SCUS-97124 (1B3976AB).00.p2s\"", "${workspaceRoot}"]
},
{
"type" : "default",
"project" : "CMakeLists.txt",
+11
View File
@@ -49,6 +49,10 @@ tasks:
- task: decomp-file
- python ./scripts/add-reference-test.py --file "{{.FILE}}"
- task: offline-tests
add-reference-test-no-decomp:
cmds:
- python ./scripts/add-reference-test.py --file "{{.FILE}}"
- task: offline-tests
update-reference-tests:
cmds:
- cmd: python ./scripts/default-file-or-folder.py --path failures
@@ -64,4 +68,11 @@ tasks:
type-test:
cmds:
- ./out/build/Release/bin/goalc-test.exe --gtest_brief=0 --gtest_filter="*TypeConsistency*"
# TODO - make a script that checks for function/method splits
# TODO - make a script to cleanup common cruft from finished file
file-good?:
cmds:
- task: type-test
- task: offline-tests
- task: find-label-types
File diff suppressed because it is too large Load Diff
@@ -608,10 +608,6 @@
[8, "(function none :behavior rigid-body-platform)"]
],
"plat-eco": [
[9, "(function none :behavior plat-eco)"]
],
"sunken-elevator": [
[3, "(function object :behavior sunken-elevator)"],
[4, "(function int :behavior sunken-elevator)"],
@@ -713,5 +709,23 @@
[12, "(function final-door symbol)"]
],
"plat-eco": [
[4, "(function none :behavior plat-eco)"], // trans
[5, "(function int float :behavior plat-eco)"], // enter
[6, "(function none :behavior plat-eco)"], // post
[7, "(function handle none :behavior plat-eco)"], // code
[8, "(function none :behavior plat-eco)"], // trans
[9, "(function process int symbol event-message-block object :behavior plat-eco)"], // event
[10, "(function symbol :behavior plat-eco)"], // code
[11, "(function none :behavior plat-eco)"], // trans
[12, "(function int :behavior plat-eco)"], // enter
[13, "(function process int symbol event-message-block object :behavior plat-eco)"] // event
],
"plat-flip": [
[1, "(function none :behavior plat-flip)"], // code
[2, "(function process int symbol event-message-block object :behavior plat-flip)"] // event
],
"placeholder-do-not-add-below": []
}
@@ -588,6 +588,13 @@
["L60", "vector"]
],
"crates": [
["L242", "float", true],
["L243", "float", true],
["L245", "float", true],
["L263", "float", true]
],
// please do not add things after this entry! git is dumb.
"object-file-that-doesnt-actually-exist-and-i-just-put-this-here-to-prevent-merge-conflicts-with-this-file": []
}
@@ -1701,5 +1701,159 @@
[32, "event-message-block"]
],
"voicebox-track": [
[16, "vector"],
[32, "vector"],
[48, "vector"]
],
"crate-standard-event-handler": [
[16, "event-message-block"]
],
"plat-trans": [
[16, "vector"]
],
"(code door-closing eco-door)": [
[16, "overlaps-others-params"]
],
"(code door-open eco-door)": [
[16, "event-message-block"]
],
"(code door-opening eco-door)": [
[16, "event-message-block"]
],
"(code door-closed eco-door)": [
[16, "event-message-block"]
],
"(code plat-button-teleport-to-other-end plat-button)": [
[16, "vector"]
],
"plat-button-camera-on": [
[16, "event-message-block"]
],
"plat-button-camera-off": [
[16, "event-message-block"]
],
"(trans plat-button-move-downward plat-button)": [
[16, "vector"]
],
"(trans plat-button-move-upward plat-button)": [
[16, "vector"]
],
"(event plat-idle plat-eco)": [
[16, "event-message-block"]
],
"(trans plat-idle plat-eco)": [
[16, "vector"]
],
"(anon-function 8 plat-eco)": [
[16, "event-message-block"]
],
"(anon-function 7 plat-eco)": [
[16, "vector"] // code
],
"(event drop-plat-idle)": [
[16, "event-message-block"]
],
"(code drop-plat-rise)": [
[16, "vector"]
],
"(post drop-plat-rise)": [
[16, "quaternion"]
],
"(code drop-plat-drop)": [
[16, "vector"]
],
"(post drop-plat-drop)": [
[16, "quaternion"]
],
"(method 21 drop-plat)": [
[16, "vector"],
[32, "vector"],
[48, "vector"]
],
"citb-drop-plat-spawn-children": [
[16, "vector"],
[32, "vector"]
],
"citb-drop-plat-drop-all-children": [
[16, "event-message-block"]
],
"citb-drop-plat-drop-children": [
[16, "event-message-block"]
],
"(event plat-flip-idle)": [
[16, "event-message-block"]
],
"(code plat-flip-idle)": [
[16, "vector"]
],
"(method 27 square-platform)": [
[16, "vector"],
[32, "vector"]
],
"(event wedge-plat-tip)": [
[16, "event-message-block"]
],
"(event wedge-plat-outer-tip)": [
[16, "event-message-block"]
],
"(event wall-plat-extending)": [
[16, "event-message-block"]
],
"(code wall-plat-extending)": [
[16, "vector"]
],
"(event wall-plat-retracting)": [
[16, "event-message-block"]
],
"(code wall-plat-retracting)": [
[16, "vector"]
],
"(event wall-plat-sync-idle)": [
[16, "event-message-block"]
],
"(code wall-plat-sync-idle)": [
[16, "vector"]
],
"(method 11 wall-plat)": [
[16, "vector"]
],
"placeholder-do-not-add-below!": []
}
@@ -1238,8 +1238,6 @@
"dm-cam-render-float": [[[71, 72], "v0", "float"]],
"build-continue-menu": [[4, "v1", "symbol"]],
"can-hint-be-played?": [
[[25, 28], "a0", "level-hint"] // kinda a guess, but its the only process that makes sense
],
@@ -2968,5 +2966,106 @@
[101, "v1", "art-joint-anim"]
],
"voicebox-track": [
[4, "a0", "target"]
],
"(method 27 plat-button)": [
[37, "v1", "art-joint-anim"]
],
"(method 11 plat-button)": [
[17, "v1", "vector"]
],
"(trans plat-button-move-downward plat-button)": [
[[92, 999], "gp", "sound-rpc-set-param"]
],
"(trans plat-button-move-upward plat-button)": [
[[92, 999], "gp", "sound-rpc-set-param"]
],
"(anon-function 7 plat-eco)": [
[22, "v1", "target"]
],
"drop-plat-set-fade": [
[7, "v1", "process-drawable"]
],
"(code drop-plat-spawn)": [
[3, "v1", "process-drawable"]
],
"(code drop-plat-rise)": [
[10, "v1", "process-drawable"],
[24, "v1", "process-drawable"],
[45, "v1", "process-drawable"],
[85, "v1", "process-drawable"]
],
"(post drop-plat-rise)": [
[12, "v1", "process-drawable"]
],
"(code drop-plat-drop)": [
[2, "v1", "process-drawable"],
[85, "v1", "process-drawable"]
],
"(post drop-plat-drop)": [
[12, "v1", "process-drawable"]
],
"drop-plat-init-by-other": [
[22, "v1", "process-drawable"]
],
"citb-drop-plat-drop-children": [
[[23,29], "a0", "drop-plat"]
],
"citb-drop-plat-spawn-children": [
[98, "t9", "(function process function vector uint uint int)"]
],
"(method 11 citb-drop-plat)": [
[24, "v1", "(pointer int32)"],
[26, "v1", "(pointer int32)"]
],
"(code plat-flip-idle)": [
[62, "v1", "art-joint-anim"],
[91, "v1", "art-joint-anim"],
[132, "v1", "art-joint-anim"]
],
"(method 11 plat-flip)": [
["_stack_", 16, "res-tag"],
["_stack_", 32, "res-tag"],
["_stack_", 48, "res-tag"],
[147, "v1", "(pointer float)"],
[192, "v1", "(pointer float)"]
],
"(method 27 square-platform)": [
[29, "a0", "water-vol"]
],
"(method 27 wedge-plat)": [
[4, "v1", "process-drawable"],
[10, "f0", "float"],
[40, "f26", "float"],
[50, "f26", "float"]
],
"(method 27 wedge-plat-outer)": [
[4, "v1", "process-drawable"],
[10, "f0", "float"],
[40, "f26", "float"],
[50, "f26", "float"]
],
"placeholder-do-not-add-below": []
}
@@ -3448,6 +3448,18 @@
"v1-34": ["v1-34", "dma-packet"]
}
},
"voicebox-track": {
"vars": {
"a0-1": "target"
}
},
"citb-drop-plat-drop-children": {
"vars": {
"v1-4": ["v1-4", "handle"]
}
},
"aaaaaaaaaaaaaaaaaaaaaaa": {}
}
+4 -3
View File
@@ -5,6 +5,8 @@
;; name in dgo: collide-shape-h
;; dgos: GAME, ENGINE
(declare-type touching-list structure)
;; Represents a collision between the "rider" (zoomer?) and a primitive shape.
;; collisions are "sticky", meaning these structures stick around.
(deftype collide-sticky-rider (structure)
@@ -104,7 +106,7 @@
(deftype overlaps-others-params (structure)
((options uint32 :offset-assert 0)
(tlist basic :offset-assert 4)
(tlist touching-list :offset-assert 4)
)
:method-count-assert 9
:size-assert #x8
@@ -230,7 +232,6 @@
)
;; an actual instance of a collision primitive.
;; it's based on a transform (q means quaternion, v means with derivatives)
(declare-type collide-edge-hold-list structure)
(deftype collide-shape (trsqv)
((process process :offset-assert 140)
(max-iteration-count uint8 :offset-assert 144)
@@ -261,7 +262,7 @@
(dummy-37 () none 37)
(dummy-38 () none 38)
(dummy-39 () none 39)
(dummy-40 (_type_ collide-edge-hold-list) none 40)
(dummy-40 (_type_ structure) none 40) ;; ?? - I've seen overlaps-others-params | collide-edge-hold-list
(dummy-41 () none 41)
(dummy-42 () none 42)
(dummy-43 () none 43)
+3
View File
@@ -151,6 +151,9 @@
(misty-teetertotter-bonk-dax-tutorial #x2a4)
(daxter-blue-eco-plat-tutorial #x2a7)
(firecanyon-collect-cells-text #x2b3)
(village2-gambler-money #x300)
+1 -2
View File
@@ -26,7 +26,7 @@
(set-zero! (_type_) _type_ 9)
(update! (_type_) float 10)
(get-no-update (_type_) float 11)
(activate! (_type_ float int int float float float) _type_ 12)
(activate! (_type_ float int int float float) _type_ 12)
(nonzero-amplitude? (_type_) symbol 13)
(die-on-next-update! (_type_) _type_ 14)
)
@@ -123,7 +123,6 @@
(arg2 int)
(arg3 float)
(arg4 float)
(arg5 float)
)
"Activate the smush! This only activates if the ongoing smush is mostly done."
+1
View File
@@ -16,6 +16,7 @@
((offset float :offset-assert 0) ;; offset, stored as a time, not a phase.
(period uint32 :offset-assert 4) ;; period, stored in seconds units
)
:pack-me
:method-count-assert 18
:size-assert #x8
:flag-assert #x1200000008
@@ -5,3 +5,918 @@
;; name in dgo: citb-drop-plat
;; dgos: CIT
(define-extern *citb-drop-plat-red-sg* skeleton-group)
(define-extern *citb-drop-plat-green-sg* skeleton-group)
(define-extern *citb-drop-plat-blue-sg* skeleton-group)
(define-extern *citb-drop-plat-yellow-sg* skeleton-group)
(define-extern *citb-drop-plat-sg* skeleton-group)
(declare-type drop-plat process)
(declare-type citb-drop-plat process)
(define-extern drop-plat-die (state drop-plat)) ;; unknown type
(define-extern drop-plat-idle (state drop-plat)) ;; unknown type
(define-extern drop-plat-drop (state drop-plat)) ;; unknown type
(define-extern drop-plat-rise (state draw-control drop-plat)) ;; unknown type
(define-extern citb-drop-plat-idle (state citb-drop-plat)) ;; unknown type
(define-extern citb-drop-plat-active (state citb-drop-plat)) ;; unknown type
(define-extern drop-plat-spawn (state drop-plat)) ;; unknown type
;;-*-Lisp-*-
(in-package goal)
;; failed to figure out what this is:
(let
((v1-0
(new 'static 'skeleton-group
:art-group-name "citb-drop-plat"
:bounds (new 'static 'vector :w 12288.0)
:max-lod 1
:version #x6
)
)
)
(set! (-> v1-0 jgeo) 0)
(set! (-> v1-0 janim) 3)
(set! (-> v1-0 mgeo 0) (the-as uint 1))
(set! (-> v1-0 lod-dist 0) 81920.0)
(set! (-> v1-0 mgeo 1) (the-as uint 2))
(set! (-> v1-0 lod-dist 1) 4095996000.0)
(set! *citb-drop-plat-sg* v1-0)
)
;; failed to figure out what this is:
(let
((v1-1
(new 'static 'skeleton-group
:art-group-name "citb-drop-plat"
:bounds (new 'static 'vector :w 12288.0)
:max-lod 1
:version #x6
)
)
)
(set! (-> v1-1 jgeo) 4)
(set! (-> v1-1 janim) 7)
(set! (-> v1-1 mgeo 0) (the-as uint 5))
(set! (-> v1-1 lod-dist 0) 81920.0)
(set! (-> v1-1 mgeo 1) (the-as uint 6))
(set! (-> v1-1 lod-dist 1) 4095996000.0)
(set! *citb-drop-plat-red-sg* v1-1)
)
;; failed to figure out what this is:
(let
((v1-2
(new 'static 'skeleton-group
:art-group-name "citb-drop-plat"
:bounds (new 'static 'vector :w 12288.0)
:max-lod 1
:version #x6
)
)
)
(set! (-> v1-2 jgeo) 8)
(set! (-> v1-2 janim) 11)
(set! (-> v1-2 mgeo 0) (the-as uint 9))
(set! (-> v1-2 lod-dist 0) 81920.0)
(set! (-> v1-2 mgeo 1) (the-as uint 10))
(set! (-> v1-2 lod-dist 1) 4095996000.0)
(set! *citb-drop-plat-green-sg* v1-2)
)
;; failed to figure out what this is:
(let
((v1-3
(new 'static 'skeleton-group
:art-group-name "citb-drop-plat"
:bounds (new 'static 'vector :w 12288.0)
:max-lod 1
:version #x6
)
)
)
(set! (-> v1-3 jgeo) 12)
(set! (-> v1-3 janim) 15)
(set! (-> v1-3 mgeo 0) (the-as uint 13))
(set! (-> v1-3 lod-dist 0) 81920.0)
(set! (-> v1-3 mgeo 1) (the-as uint 14))
(set! (-> v1-3 lod-dist 1) 4095996000.0)
(set! *citb-drop-plat-blue-sg* v1-3)
)
;; failed to figure out what this is:
(let
((v1-4
(new 'static 'skeleton-group
:art-group-name "citb-drop-plat"
:bounds (new 'static 'vector :w 12288.0)
:max-lod 1
:version #x6
)
)
)
(set! (-> v1-4 jgeo) 16)
(set! (-> v1-4 janim) 19)
(set! (-> v1-4 mgeo 0) (the-as uint 17))
(set! (-> v1-4 lod-dist 0) 81920.0)
(set! (-> v1-4 mgeo 1) (the-as uint 18))
(set! (-> v1-4 lod-dist 1) 4095996000.0)
(set! *citb-drop-plat-yellow-sg* v1-4)
)
;; definition of type drop-plat
(deftype drop-plat (process-drawable)
((root-override collide-shape-moving :offset 112)
(spin-axis vector :inline :offset-assert 176)
(spin-angle float :offset-assert 192)
(spin-speed float :offset-assert 196)
(interp float :offset-assert 200)
(duration uint64 :offset-assert 208)
(delay uint64 :offset-assert 216)
(color int8 :offset-assert 224)
)
:heap-base #x80
:method-count-assert 22
:size-assert #xe1
:flag-assert #x16008000e1
(:methods
(TODO-RENAME-20 (_type_) none 20)
(dummy-21 (_type_) none 21)
)
)
;; failed to figure out what this is:
(defstate drop-plat-idle (drop-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'drop)
(logclear! (-> self mask) (process-mask actor-pause))
(go drop-plat-drop)
)
((or (= v1-0 'touch) (= v1-0 'attack))
(let ((a1-2 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-2 from) self)
(set! (-> a1-2 num-params) 1)
(set! (-> a1-2 message) 'no-look-around)
(set! (-> a1-2 param 0) (the-as uint 300))
(send-event-function *target* a1-2)
)
(let ((a1-3 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-3 from) self)
(set! (-> a1-3 num-params) 1)
(set! (-> a1-3 message) 'player-stepped)
(set! (-> a1-3 param 0) (the-as uint (-> self color)))
(send-event-function
(ppointer->process (-> self parent))
a1-3
)
)
#f
)
)
)
)
)
:code
(behavior ()
(suspend)
(dummy-47 (-> self root-override))
(set!
(-> self state-time)
(the-as seconds (-> *display* base-frame-counter))
)
(logior! (-> self mask) (process-mask actor-pause))
(while #t
(if
(>=
(- (-> *display* base-frame-counter) (the-as int (-> self state-time)))
(the-as int (-> self duration))
)
(go drop-plat-drop)
)
(suspend)
)
(none)
)
:post
(the-as (function none :behavior drop-plat) ja-post)
)
;; definition for function drop-plat-set-fade
;; INFO: Return type mismatch int vs none.
(defbehavior drop-plat-set-fade drop-plat ()
(let
((f0-1
(fmin
1.0
(*
0.000012207031
(-
(-> self root-override trans y)
(+
-204800.0
(-> (the-as process-drawable (-> self parent 0)) root trans y)
)
)
)
)
)
)
(set-vector! (-> self draw color-mult) f0-1 f0-1 f0-1 1.0)
)
0
(none)
)
;; failed to figure out what this is:
(defstate drop-plat-spawn (drop-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (if (= v1-0 'drop)
(go drop-plat-die)
)
)
)
)
:code
(behavior ()
(set!
(-> self root-override trans y)
(+ -204800.0 (-> (the-as process-drawable (-> self parent 0)) root trans y))
)
(logior! (-> self draw status) 2)
(ja-post)
(set!
(-> self state-time)
(the-as seconds (-> *display* base-frame-counter))
)
(while #t
(when
(>=
(- (-> *display* base-frame-counter) (the-as int (-> self state-time)))
(the-as int (-> self delay))
)
(let ((v1-14 (logand -3 (-> self draw status)))
(a0-5 (-> self draw))
)
(set! (-> a0-5 status) v1-14)
(go drop-plat-rise a0-5)
)
)
(suspend)
)
(none)
)
)
;; failed to figure out what this is:
(defstate drop-plat-rise (drop-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (if (= v1-0 'drop)
(go drop-plat-drop)
)
)
)
)
:code
(behavior ((arg0 draw-control))
(set! (-> self interp) 1.0)
(set!
(-> self state-time)
(the-as seconds (-> *display* base-frame-counter))
)
(set! (-> self spin-angle) 0.0)
(set!
(-> self root-override trans y)
(+ -204800.0 (-> (the-as process-drawable (-> self parent 0)) root trans y))
)
(let ((gp-0 (new 'stack-no-clear 'vector))
(s5-0 #f)
)
(set! (-> gp-0 quad) (-> self root-override trans quad))
(set!
(-> gp-0 y)
(-> (the-as process-drawable (-> self parent 0)) root trans y)
)
(while #t
(let
((f0-6
(fmax
0.0
(-
1.0
(*
0.0033333334
(the
float
(-
(-> *display* base-frame-counter)
(the-as int (-> self state-time))
)
)
)
)
)
)
)
(set! (-> self interp) (* f0-6 f0-6))
)
(set!
(-> self root-override trans y)
(-
(-> (the-as process-drawable (-> self parent 0)) root trans y)
(* 204800.0 (-> self interp))
)
)
(when (and (not s5-0) (< (-> self interp) 0.05))
(set! s5-0 #t)
(sound-play-by-name
(static-sound-name "bridge-piece-up")
(new-sound-id)
1024
0
0
(the-as uint 1)
gp-0
)
)
(set! (-> self spin-angle) (* 10.0 (-> self spin-speed) (-> self interp)))
(if
(=
(-> (the-as process-drawable (-> self parent 0)) root trans y)
(-> self root-override trans y)
)
(go drop-plat-idle)
)
(suspend)
)
)
(none)
)
:post
(behavior ()
(let ((gp-0 (new 'stack-no-clear 'quaternion)))
(quaternion-vector-angle! gp-0 (-> self spin-axis) (-> self spin-angle))
(quaternion*!
(-> self root-override quat)
(-> (the-as process-drawable (-> self parent 0)) root quat)
gp-0
)
)
(drop-plat-set-fade)
(transform-post)
(none)
)
)
;; failed to figure out what this is:
(defstate drop-plat-drop (drop-plat)
:code
(behavior ()
(when
(=
(-> (the-as process-drawable (-> self parent 0)) root trans y)
(-> self root-override trans y)
)
(set!
(-> self state-time)
(the-as seconds (-> *display* base-frame-counter))
)
(sound-play-by-name
(static-sound-name "bridge-piece-dn")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(let ((gp-1 (the int (* 300.0 (rand-vu-float-range 0.2 0.3)))))
(while
(<
(- (-> *display* base-frame-counter) (the-as int (-> self state-time)))
gp-1
)
(set!
(-> self interp)
(/
(the
float
(- (-> *display* base-frame-counter) (the-as int (-> self state-time)))
)
(the float gp-1)
)
)
(set!
(-> self spin-angle)
(* 910.2222 (sin (* 196608.0 (-> self interp))))
)
(suspend)
)
)
)
(while #t
(vector-v++!
(-> self root-override transv)
(dummy-62 (-> self root-override) (new-stack-vector0) 0.0)
)
(vector-v++! (-> self root-override trans) (-> self root-override transv))
(if
(<
204800.0
(-
(-> (the-as process-drawable (-> self parent 0)) root trans y)
(-> self root-override trans y)
)
)
(go drop-plat-die)
)
(+!
(-> self spin-angle)
(* (-> self spin-speed) (-> *display* seconds-per-frame))
)
(suspend)
)
(none)
)
:post
(behavior ()
(let ((gp-0 (new 'stack-no-clear 'quaternion)))
(quaternion-vector-angle! gp-0 (-> self spin-axis) (-> self spin-angle))
(quaternion*!
(-> self root-override quat)
(-> (the-as process-drawable (-> self parent 0)) root quat)
gp-0
)
)
(drop-plat-set-fade)
(transform-post)
(none)
)
)
;; failed to figure out what this is:
(defstate drop-plat-die (drop-plat)
:code
(behavior ()
(dummy-18 self)
(none)
)
)
;; definition for method 20 of type drop-plat
;; INFO: Return type mismatch int vs none.
(defmethod TODO-RENAME-20 drop-plat ((obj drop-plat))
(let
((s5-0
(new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player))
)
)
(set! (-> s5-0 dynam) (copy *standard-dynamics* 'process))
(set! (-> s5-0 reaction) default-collision-reaction)
(set! (-> s5-0 no-reaction) nothing)
(dummy-29 s5-0 1)
(let
((s4-0
(new
'process
'collide-shape-prim-mesh
s5-0
(the-as uint 0)
(the-as uint 0)
)
)
)
(set! (-> s4-0 prim-core collide-as) (the-as uint 2048))
(set! (-> s4-0 collide-with) (the-as uint 16))
(set! (-> s4-0 prim-core action) (the-as uint 3))
(set! (-> s4-0 prim-core offense) 4)
(set! (-> s4-0 transform-index) 0)
(set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 12288.0)
)
(dummy-46 s5-0)
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
(dummy-50 s5-0)
(set! (-> obj root-override) s5-0)
)
0
(none)
)
;; definition for method 21 of type drop-plat
;; INFO: Return type mismatch int vs none.
(defmethod dummy-21 drop-plat ((obj drop-plat))
(case (-> obj color)
((1)
(dummy-14 obj *citb-drop-plat-red-sg* '())
)
((2)
(dummy-14 obj *citb-drop-plat-green-sg* '())
)
((3)
(dummy-14 obj *citb-drop-plat-blue-sg* '())
)
((4)
(dummy-14 obj *citb-drop-plat-yellow-sg* '())
)
(else
(dummy-14 obj *citb-drop-plat-sg* '())
)
)
(logclear! (-> obj mask) (process-mask actor-pause))
(let ((s3-0 (new 'stack-no-clear 'vector))
(s5-0 (new 'stack-no-clear 'vector))
(s4-0 (new 'stack-no-clear 'vector))
)
(set! (-> s3-0 x) (* 65536.0 (rand-vu)))
(let ((f30-1 14563.556)
(f0-2 (rand-vu-float-range -1.0 1.0))
)
(set! (-> s3-0 y) (* f30-1 (* f0-2 f0-2)))
)
(vector-sincos! s5-0 s4-0 s3-0)
(set! (-> obj spin-axis x) (* (-> s4-0 y) (-> s4-0 x)))
(set! (-> obj spin-axis y) (-> s5-0 y))
(set! (-> obj spin-axis z) (* (-> s4-0 y) (-> s5-0 x)))
)
(set! (-> obj spin-axis w) 1.0)
(set! (-> obj spin-angle) 0.0)
(set! (-> obj spin-speed) (* 8192.0 (+ 1.0 (rand-vu))))
0
(none)
)
;; definition for function drop-plat-init-by-other
;; Used lq/sq
(defbehavior
drop-plat-init-by-other drop-plat
((arg0 vector) (arg1 uint) (arg2 uint) (arg3 int))
(set! (-> self color) arg3)
(set! (-> self delay) arg1)
(set! (-> self duration) arg2)
(TODO-RENAME-20 self)
(set! (-> self root-override trans quad) (-> arg0 quad))
(vector-identity! (-> self root-override scale))
(quaternion-copy!
(-> self root-override quat)
(-> (the-as process-drawable (-> self parent 0)) root quat)
)
(dummy-21 self)
(go drop-plat-spawn)
(none)
)
;; definition of type handle-inline-array
(deftype handle-inline-array (inline-array-class)
((data handle :dynamic :offset-assert 16)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; failed to figure out what this is:
(set! (-> handle-inline-array heap-base) (the-as uint 8))
;; definition of type citb-drop-plat
(deftype citb-drop-plat (process-drawable)
((x-count int32 :offset-assert 176)
(z-count int32 :offset-assert 180)
(child-count int32 :offset-assert 184)
(child-array handle-inline-array :offset-assert 188)
(child-color-array (pointer int8) :offset-assert 192)
(x-dir vector :inline :offset-assert 208)
(z-dir vector :inline :offset-assert 224)
(origin vector :inline :offset-assert 240)
(x-spacing float :offset-assert 256)
(z-spacing float :offset-assert 260)
(idle-distance float :offset-assert 264)
(duration uint64 :offset-assert 272)
(drop-time uint64 :offset-assert 280)
)
:heap-base #xb0
:method-count-assert 20
:size-assert #x120
:flag-assert #x1400b00120
)
;; definition for method 7 of type citb-drop-plat
;; INFO: Return type mismatch process-drawable vs citb-drop-plat.
(defmethod relocate citb-drop-plat ((obj citb-drop-plat) (arg0 int))
(if (nonzero? (-> obj child-array))
(&+! (-> obj child-array) arg0)
)
(the-as citb-drop-plat ((method-of-type process-drawable relocate) obj arg0))
)
;; definition for function citb-drop-plat-spawn-children
;; INFO: Return type mismatch int vs none.
;; Used lq/sq
(defbehavior citb-drop-plat-spawn-children citb-drop-plat ()
(local-vars (s0-0 int) (sv-48 process) (sv-64 int))
(let ((gp-0 (new 'stack-no-clear 'vector)))
6
0
(let ((s5-0 0)
(s4-0 1)
)
(when
(<
0.0
(vector-dot
(vector-!
(new 'stack-no-clear 'vector)
(target-pos 0)
(-> self root trans)
)
(-> self z-dir)
)
)
(set! s5-0 (+ (-> self z-count) -1))
(set! s4-0 -1)
)
(dotimes (s3-2 (-> self z-count))
(dotimes (s2-0 (-> self x-count))
(let ((s1-0 (+ s2-0 (* s5-0 (-> self x-count)))))
(set! (-> gp-0 quad) (-> self origin quad))
(vector+*!
gp-0
gp-0
(-> self x-dir)
(* (-> self x-spacing) (the float s2-0))
)
(vector+*!
gp-0
gp-0
(-> self z-dir)
(* (-> self z-spacing) (the float s5-0))
)
(if (-> self child-color-array)
(set! s0-0 (-> self child-color-array s1-0))
(set! s0-0 (rand-vu-int-range 0 5))
)
(when (nonzero? s0-0)
(set! sv-64 (the int (* 150.0 (rand-vu))))
(set! sv-48 (get-process *default-dead-pool* drop-plat #x4000))
(set! (-> self child-array data s1-0) (ppointer->handle (when sv-48
(let
((t9-6
(method-of-type
drop-plat
activate
)
)
)
(t9-6
(the-as
drop-plat
sv-48
)
self
'drop-plat
(the-as
pointer
#x70004000
)
)
)
(let
((t9-7
run-function-in-process
)
(a0-8 sv-48)
(a1-5
drop-plat-init-by-other
)
(a2-4 gp-0)
(t0-0
(->
self
duration
)
)
)
((the-as
(function process function vector uint uint int)
t9-7
)
a0-8
a1-5
a2-4
(the-as
uint
sv-64
)
t0-0
)
)
(->
sv-48
ppointer
)
)
)
)
)
)
)
(let ((s2-1 (-> *display* base-frame-counter)))
(until (>= (- (-> *display* base-frame-counter) s2-1) 36)
(suspend)
)
)
(+! s5-0 s4-0)
)
)
)
(set! (-> self drop-time) (the-as uint (-> *display* base-frame-counter)))
0
(none)
)
;; definition for function citb-drop-plat-drop-all-children
(defbehavior citb-drop-plat-drop-all-children citb-drop-plat ()
(dotimes (gp-0 (-> self child-count))
(let ((a1-0 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-0 from) self)
(set! (-> a1-0 num-params) 0)
(set! (-> a1-0 message) 'drop)
(send-event-function (handle->process (-> self child-array data gp-0)) a1-0)
)
(set! (-> self child-array data gp-0) (the-as handle #f))
)
#f
)
;; definition for function citb-drop-plat-drop-children
;; INFO: Return type mismatch int vs none.
(defbehavior citb-drop-plat-drop-children citb-drop-plat ((arg0 int))
(cond
((= arg0 6)
)
(else
(dotimes (s5-0 (-> self child-count))
(let ((a0-3 (handle->process (-> self child-array data s5-0))))
(when
(and
a0-3
(!= (-> (the-as drop-plat a0-3) color) 6)
(= arg0 (-> (the-as drop-plat a0-3) color))
)
(let ((a1-2 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-2 from) self)
(set! (-> a1-2 num-params) 0)
(set! (-> a1-2 message) 'drop)
(send-event-function a0-3 a1-2)
)
(set! (-> self child-array data s5-0) (the-as handle #f))
)
)
)
)
)
0
(none)
)
;; failed to figure out what this is:
(defstate citb-drop-plat-idle (citb-drop-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (if (= v1-0 'trigger)
(go citb-drop-plat-active)
)
)
)
)
:code
(behavior ()
(citb-drop-plat-drop-all-children)
(while #t
(suspend)
)
(none)
)
)
;; failed to figure out what this is:
(defstate citb-drop-plat-active (citb-drop-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'player-stepped)
(when
(>=
(-
(-> *display* base-frame-counter)
(the-as int (-> self drop-time))
)
60
)
(set!
(-> self drop-time)
(the-as uint (-> *display* base-frame-counter))
)
(citb-drop-plat-drop-children
(the-as int (-> arg3 param 0))
)
)
)
((= v1-0 'trigger)
(go citb-drop-plat-idle)
)
)
)
)
)
:code
(behavior ()
(set!
(-> self state-time)
(the-as seconds (-> *display* base-frame-counter))
)
(citb-drop-plat-spawn-children)
(while #t
(if
(or
(>=
(- (-> *display* base-frame-counter) (the-as int (-> self state-time)))
(the-as int (+ (-> self duration) 600))
)
(or
(not *target*)
(<
(-> self idle-distance)
(vector-vector-distance
(-> self root trans)
(-> *target* control trans)
)
)
)
(not (-> self child))
)
(go citb-drop-plat-idle)
)
(suspend)
)
(none)
)
)
;; definition for method 11 of type citb-drop-plat
;; Used lq/sq
(defmethod copy-defaults! citb-drop-plat ((obj citb-drop-plat) (arg0 res-lump))
(set! (-> obj root) (new 'process 'trsqv))
(process-drawable-from-entity! obj arg0)
(let ((v1-2 (res-lump-data arg0 'count pointer)))
(when v1-2
(set! (-> obj x-count) (-> (the-as (pointer int32) v1-2) 0))
(set! (-> obj z-count) (-> (the-as (pointer int32) v1-2) 1))
)
)
(set! (-> obj child-count) (* (-> obj x-count) (-> obj z-count)))
(set!
(-> obj child-color-array)
(res-lump-data arg0 'plat-type (pointer int8))
)
(when (> (-> obj child-count) 0)
(set!
(-> obj child-array)
(new 'process 'handle-inline-array (-> obj child-count))
)
(dotimes (v1-9 (-> obj child-count))
(set! (-> obj child-array data v1-9) (the-as handle #f))
)
)
(set! (-> obj x-spacing) 16384.0)
(set! (-> obj z-spacing) 16384.0)
(set!
(-> obj idle-distance)
(+ 40960.0 (* 0.5 (the float (-> obj z-count)) (-> obj z-spacing)))
)
(set!
(-> obj duration)
(the-as uint (the int (* 300.0 (+ 2.0 (the float (-> obj z-count))))))
)
(let ((f0-7 (res-lump-float arg0 'rotoffset)))
(quaternion-rotate-y! (-> obj root quat) (-> obj root quat) f0-7)
)
(vector-x-quaternion! (-> obj x-dir) (-> obj root quat))
(vector-z-quaternion! (-> obj z-dir) (-> obj root quat))
(set! (-> obj origin quad) (-> obj root trans quad))
(let ((f0-10 (* -0.5 (the float (+ (-> obj x-count) -1)) (-> obj x-spacing)))
(f30-0 (* -0.5 (the float (+ (-> obj z-count) -1)) (-> obj z-spacing)))
)
(vector+*! (-> obj origin) (-> obj origin) (-> obj x-dir) f0-10)
(vector+*! (-> obj origin) (-> obj origin) (-> obj z-dir) f30-0)
)
(go citb-drop-plat-idle)
(none)
)
+556 -25
View File
@@ -5,33 +5,564 @@
;; name in dgo: baseplat
;; dgos: GAME, COMMON, L1
;; TODO - for misty-warehouse
(deftype eco-door (process-drawable)
((root-override collide-shape :score 100 :offset 112)
(speed float :offset-assert 176)
(open-distance float :offset-assert 180)
(close-distance float :offset-assert 184)
(out-dir vector :inline :offset-assert 192)
(open-sound sound-name :offset-assert 208)
(close-sound sound-name :offset-assert 224)
(state-actor basic :offset-assert 240)
(flags int32 :offset-assert 244)
(locked symbol :offset-assert 248)
(auto-close symbol :offset-assert 252)
(one-way symbol :offset-assert 256)
;; definition of type baseplat
(deftype baseplat (process-drawable)
((root-override collide-shape-moving :offset 112)
(smush smush-control :inline :offset-assert 176)
(basetrans vector :inline :offset-assert 208)
(bouncing basic :offset-assert 224)
)
:heap-base #x80
:method-count-assert 27
:size-assert #x104
:heap-base #xa0
:flag-assert #x1b00a00104
;; inherited inspect of process-drawable
:size-assert #xe4
:flag-assert #x1b008000e4
(:methods
(dummy-20 () none 20)
(dummy-21 () none 21)
(dummy-22 () none 22)
(dummy-23 () none 23)
(TODO-RENAME-24 (_type_) none 24)
(TODO-RENAME-25 (_type_) none 25)
(dummy-26 () none 26)
(dummy-20 (_type_) none 20)
(dummy-21 (_type_) none 21)
(dummy-22 (_type_) none 22)
(TODO-RENAME-23 (_type_) skeleton-group 23)
(dummy-24 (_type_) none 24)
(TODO-RENAME-25 (_type_) sparticle-launch-group 25)
(dummy-26 (_type_) none 26)
)
)
;; definition for method 21 of type baseplat
;; INFO: Return type mismatch int vs none.
;; Used lq/sq
(defmethod dummy-21 baseplat ((obj baseplat))
(logior! (-> obj skel status) 1)
(set! (-> obj basetrans quad) (-> obj root-override trans quad))
(set! (-> obj bouncing) #f)
0
(none)
)
;; definition for method 22 of type baseplat
;; INFO: Return type mismatch int vs none.
(defmethod dummy-22 baseplat ((obj baseplat))
(activate! (-> obj smush) -1.0 60 150 1.0 1.0)
(set! (-> obj bouncing) #t)
(logclear! (-> obj mask) (process-mask sleep))
(logclear! (-> obj mask) (process-mask sleep-code))
0
(none)
)
;; definition for function plat-code
(defbehavior plat-code baseplat ()
(transform-post)
(suspend)
(transform-post)
(suspend)
(while #t
(when (not (-> self bouncing))
(logior! (-> self mask) (process-mask sleep))
(suspend)
0
)
(while (-> self bouncing)
(suspend)
)
)
(none)
)
;; definition for function plat-trans
;; Used lq/sq
(defbehavior plat-trans baseplat ()
(rider-trans)
(cond
((-> self bouncing)
(let ((gp-0 (new 'stack-no-clear 'vector)))
(set! (-> gp-0 quad) (-> self basetrans quad))
(+! (-> gp-0 y) (* 819.2 (update! (-> self smush))))
(TODO-RENAME-30 (-> self root-override) gp-0)
)
(if (not (!= (-> self smush amp) 0.0))
(set! (-> self bouncing) #f)
)
)
(else
(TODO-RENAME-30 (-> self root-override) (-> self basetrans))
)
)
(none)
)
;; definition for function plat-post
;; INFO: Return type mismatch int vs none.
(defbehavior plat-post baseplat ()
(dummy-20 self)
(rider-post)
(none)
)
;; definition for method 25 of type baseplat
;; INFO: Return type mismatch int vs sparticle-launch-group.
(defmethod TODO-RENAME-25 baseplat ((obj baseplat))
(the-as sparticle-launch-group 0)
)
;; definition for method 20 of type baseplat
(defmethod dummy-20 baseplat ((obj baseplat))
(if (nonzero? (-> obj part))
(dummy-11 (-> obj part) (-> obj root-override trans))
)
(none)
)
;; definition for function plat-event
;; INFO: Return type mismatch none vs object.
(defbehavior
plat-event baseplat
((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (if (= v1-0 'bonk)
(dummy-22 self)
)
)
)
)
;; definition of type eco-door
(deftype eco-door (process-drawable)
((root-override collide-shape :offset 112)
(speed float :offset-assert 176)
(open-distance float :offset-assert 180)
(close-distance float :offset-assert 184)
(out-dir vector :inline :offset-assert 192)
(open-sound sound-name :offset-assert 208)
(close-sound sound-name :offset-assert 224)
(state-actor entity-actor :offset-assert 240)
(flags int32 :offset-assert 244)
(locked symbol :offset-assert 248)
(auto-close symbol :offset-assert 252)
(one-way symbol :offset-assert 256)
)
:heap-base #xa0
:method-count-assert 27
:size-assert #x104
:flag-assert #x1b00a00104
(:methods
(door-closed () _type_ :state 20)
(door-opening () _type_ :state 21)
(door-open () _type_ :state 22)
(door-closing () _type_ :state 23)
(TODO-RENAME-24 (_type_) none 24)
(TODO-RENAME-25 (_type_) none 25)
(dummy-26 (_type_) none 26)
)
)
;; definition for method 3 of type eco-door
;; Used lq/sq
(defmethod inspect eco-door ((obj eco-door))
(let ((t9-0 (method-of-type process-drawable inspect)))
(t9-0 obj)
)
(format #t "~T~Tspeed: ~f~%" (-> obj speed))
(format #t "~T~Topen-distance: ~f~%" (-> obj open-distance))
(format #t "~T~Tclose-distance: ~f~%" (-> obj close-distance))
(format #t "~T~Tout-dir: #<vector @ #x~X>~%" (-> obj out-dir))
(format #t "~T~Topen-sound: ~D~%" (-> obj open-sound))
(format #t "~T~Tclose-sound: ~D~%" (-> obj close-sound))
(format #t "~T~Tstate-actor: ~A~%" (-> obj state-actor))
(format #t "~T~Tflags: ~D~%" (-> obj flags))
(format #t "~T~Tlocked: ~A~%" (-> obj locked))
(format #t "~T~Tauto-close: ~A~%" (-> obj auto-close))
(format #t "~T~Tone-way: ~A~%" (-> obj one-way))
obj
)
;; definition for function eco-door-event-handler
;; INFO: Return type mismatch symbol vs object.
(defbehavior
eco-door-event-handler eco-door
((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (when (= v1-0 'trigger)
(set! (-> self locked) (not (-> self locked)))
(cond
((-> self locked)
(if (= (-> self next-state name) 'door-closed)
(sound-play-by-name
(static-sound-name "door-lock")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
)
)
(else
(sound-play-by-name
(static-sound-name "door-unlock")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
)
)
#t
)
)
)
)
;; failed to figure out what this is:
eco-door-event-handler
;; failed to figure out what this is:
(defstate door-closed (eco-door)
:virtual #t
:event
eco-door-event-handler
:code
(behavior ()
(let ((v1-2 (-> self skel root-channel 0)))
(set! (-> v1-2 num-func) num-func-identity)
(set! (-> v1-2 frame-num) 0.0)
)
(suspend)
(dummy-47 (-> self root-override))
(ja-post)
(while #t
(when
(and
*target*
(>=
(-> self open-distance)
(vector-vector-distance
(-> self root-override trans)
(-> *target* control trans)
)
)
)
(dummy-26 self)
(if
(and
(not (-> self locked))
(or
(and
(-> self entity)
(logtest?
(-> self entity extra perm status)
(entity-perm-status complete)
)
)
(let ((a1-1 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-1 from) self)
(set! (-> a1-1 num-params) 2)
(set! (-> a1-1 message) 'query)
(set! (-> a1-1 param 0) (the-as uint 'powerup))
(set! (-> a1-1 param 1) (the-as uint 3))
(send-event-function *target* a1-1)
)
(and
(-> self one-way)
(< (vector4-dot (-> self out-dir) (target-pos 0)) -8192.0)
)
)
)
(go-virtual door-opening)
)
(level-hint-spawn
(game-text-id zero)
(the-as string #f)
(the-as symbol (-> self entity))
*entity-pool*
0
)
)
(suspend)
)
(none)
)
)
;; failed to figure out what this is:
(defstate door-opening (eco-door)
:virtual #t
:event
eco-door-event-handler
:code
(behavior ()
(let
((gp-0
(and
(not
(and
(-> self entity)
(logtest?
(-> self entity extra perm status)
(entity-perm-status complete)
)
)
)
(let ((a1-0 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-0 from) self)
(set! (-> a1-0 num-params) 2)
(set! (-> a1-0 message) 'query)
(set! (-> a1-0 param 0) (the-as uint 'powerup))
(set! (-> a1-0 param 1) (the-as uint 3))
(send-event-function *target* a1-0)
)
)
)
)
(if gp-0
(sound-play-by-name
(static-sound-name "blue-eco-on")
(new-sound-id)
1024
0
0
(the-as uint 1)
(-> self root-override trans)
)
)
(sound-play-by-name
(-> self open-sound)
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(dummy-48 (-> self root-override))
(until (ja-done? 0)
(let ((a0-9 (-> self skel root-channel 0)))
(set!
(-> a0-9 param 0)
(the float (+ (-> a0-9 frame-group data 0 length) -1))
)
(set! (-> a0-9 param 1) (-> self speed))
(joint-control-channel-group-eval!
a0-9
(the-as art-joint-anim #f)
num-func-seek!
)
)
(if (and gp-0 (rand-vu-percent? 0.5))
(spawn-projectile-blue *target*)
)
(suspend)
)
)
(go-virtual door-open)
(none)
)
:post
(the-as (function none :behavior eco-door) transform-post)
)
;; failed to figure out what this is:
(defstate door-open (eco-door)
:virtual #t
:event
eco-door-event-handler
:code
(behavior ()
(set!
(-> self state-time)
(the-as seconds (-> *display* base-frame-counter))
)
(process-entity-status! self (entity-perm-status complete) #t)
(dummy-48 (-> self root-override))
(let ((v1-6 (-> self skel root-channel 0)))
(set! (-> v1-6 num-func) num-func-identity)
(set!
(-> v1-6 frame-num)
(the float (+ (-> v1-6 frame-group data 0 length) -1))
)
)
(logior! (-> self draw status) 2)
(suspend)
(dummy-47 (-> self root-override))
(ja-post)
(while #t
(let ((f30-0 (vector4-dot (-> self out-dir) (target-pos 0)))
(f28-0 (vector4-dot (-> self out-dir) (camera-pos)))
)
(when
(and
(-> self auto-close)
(or
(not *target*)
(<
(-> self close-distance)
(vector-vector-distance
(-> self root-override trans)
(-> *target* control trans)
)
)
)
)
(if (and (>= (* f30-0 f28-0) 0.0) (< 16384.0 (fabs f28-0)))
(go-virtual door-closing)
)
)
)
(suspend)
)
(none)
)
)
;; failed to figure out what this is:
(defstate door-closing (eco-door)
:virtual #t
:event
eco-door-event-handler
:code
(behavior ()
((method-of-object (-> self root-override) dummy-49))
(set! (-> self draw status) (logand -3 (-> self draw status)))
(let ((gp-0 (new 'stack 'overlaps-others-params)))
(set! (-> gp-0 options) (the-as uint 1))
(set! (-> gp-0 tlist) #f)
(while (dummy-40 (-> self root-override) gp-0)
(suspend)
)
)
(sound-play-by-name
(-> self close-sound)
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(until (ja-done? 0)
(let ((a0-7 (-> self skel root-channel 0)))
(set! (-> a0-7 param 0) 0.0)
(set! (-> a0-7 param 1) (-> self speed))
(joint-control-channel-group-eval!
a0-7
(the-as art-joint-anim #f)
num-func-seek!
)
)
(suspend)
)
(if (-> self locked)
(sound-play-by-name
(static-sound-name "door-lock")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
)
(go-virtual door-closed)
(none)
)
:post
(the-as (function none :behavior eco-door) transform-post)
)
;; definition for method 26 of type eco-door
;; INFO: Return type mismatch int vs none.
(defmethod dummy-26 eco-door ((obj eco-door))
(when (-> obj state-actor)
(if
(logtest?
(-> obj state-actor extra perm status)
(entity-perm-status complete)
)
(set! (-> obj locked) (logtest? (-> obj flags) 2))
(set! (-> obj locked) (logtest? (-> obj flags) 1))
)
)
0
(none)
)
;; definition for method 24 of type eco-door
;; INFO: Return type mismatch int vs none.
(defmethod TODO-RENAME-24 eco-door ((obj eco-door))
(let
((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player))))
(let
((s4-0
(new
'process
'collide-shape-prim-mesh
s5-0
(the-as uint 0)
(the-as uint 0)
)
)
)
(set! (-> s4-0 prim-core collide-as) (the-as uint 512))
(set! (-> s4-0 collide-with) (the-as uint 16))
(set! (-> s4-0 prim-core action) (the-as uint 1))
(set! (-> s4-0 prim-core offense) 4)
(set! (-> s4-0 transform-index) 0)
(set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 16384.0)
)
(dummy-46 s5-0)
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
(dummy-50 s5-0)
(set! (-> obj root-override) s5-0)
)
0
(none)
)
;; definition for method 25 of type eco-door
;; INFO: Return type mismatch int vs none.
(defmethod TODO-RENAME-25 eco-door ((obj eco-door))
0
(none)
)
;; definition for method 11 of type eco-door
(defmethod copy-defaults! eco-door ((obj eco-door) (arg0 res-lump))
(TODO-RENAME-24 obj)
(process-drawable-from-entity! obj arg0)
(let ((f0-0 (res-lump-float (-> obj entity) 'scale :default 1.0)))
(set-vector! (-> obj root-override scale) f0-0 f0-0 f0-0 1.0)
)
(set! (-> obj open-distance) 32768.0)
(set! (-> obj close-distance) 49152.0)
(set! (-> obj speed) 1.0)
(set! (-> obj state-actor) #f)
(let ((v1-5 (entity-actor-lookup arg0 'state-actor 0)))
(if v1-5
(set! (-> obj state-actor) v1-5)
)
)
(set! (-> obj locked) #f)
(set! (-> obj flags) (res-lump-value arg0 'flags int))
(dummy-26 obj)
(set! (-> obj auto-close) (logtest? (-> obj flags) 4))
(set! (-> obj one-way) (logtest? (-> obj flags) 8))
(vector-z-quaternion! (-> obj out-dir) (-> obj root-override quat))
(set!
(-> obj out-dir w)
(- (vector-dot (-> obj out-dir) (-> obj root-override trans)))
)
(dummy-47 (-> obj root-override))
(TODO-RENAME-25 obj)
(if
(and
(not (-> obj auto-close))
(-> obj entity)
(logtest? (-> obj entity extra perm status) (entity-perm-status complete))
)
(go (method-of-object obj door-open))
(go (method-of-object obj door-closed))
)
(none)
)
+748 -19
View File
@@ -5,37 +5,766 @@
;; name in dgo: plat-button
;; dgos: GAME, COMMON, L1
;; TODO - for sunken-elevator
(define-extern *plat-button-sg* skeleton-group)
;; definition of type plat-button
(deftype plat-button (process-drawable)
((root-override collide-shape-moving :score 100 :offset 112)
(go-back-if-lost-player? symbol :offset-assert 176)
(grab-player? symbol :offset-assert 180)
(should-grab-player? symbol :offset-assert 184)
(path-pos float :offset-assert 188)
(bidirectional? symbol :offset-assert 192)
(allow-auto-kill symbol :offset-assert 196)
(sound-id sound-id :offset-assert 200)
(trans-off vector :inline :offset-assert 208)
(spawn-pos vector :inline :offset-assert 224)
((root-override collide-shape-moving :offset 112)
(go-back-if-lost-player? symbol :offset-assert 176)
(grab-player? symbol :offset-assert 180)
(should-grab-player? symbol :offset-assert 184)
(path-pos float :offset-assert 188)
(bidirectional? symbol :offset-assert 192)
(allow-auto-kill symbol :offset-assert 196)
(sound-id sound-id :offset-assert 200)
(trans-off vector :inline :offset-assert 208)
(spawn-pos vector :inline :offset-assert 224)
)
:heap-base #x80
:method-count-assert 33
:size-assert #xf0
:heap-base #x80
:flag-assert #x21008000f0
;; inherited inspect of process-drawable
(:methods
(plat-button-at-end () _type_ :state 20) ;; state
(dummy-21 () none 21)
(plat-button-at-end () _type_ :state 20)
(plat-button-idle () _type_ :state 21)
(plat-button-pressed () _type_ :state 22)
(plat-button-move-downward () _type_ :state 23)
(plat-button-move-upward () _type_ :state 24)
(dummy-25 () none 25)
(plat-button-teleport-to-other-end () _type_ :state 25)
(can-activate? (_type_) symbol 26)
(TODO-RENAME-27 (_type_) none 27)
(dummy-28 () none 28)
(TODO-RENAME-28 (_type_) collide-shape-moving 28)
(can-target-move? (_type_) symbol 29)
(should-teleport? (_type_) symbol 30)
(TODO-RENAME-31 (_type_) none 31) ;; TODO - need to know super::14
(dummy-32 () none 32)
(TODO-RENAME-31 (_type_) none 31)
(TODO-RENAME-32 (_type_) none 32)
)
)
;; failed to figure out what this is:
(let
((v1-1
(new 'static 'skeleton-group
:art-group-name "plat-button"
:bounds
(new 'static 'vector :y -4096.0 :w 27033.6)
:version #x6
)
)
)
(set! (-> v1-1 jgeo) 0)
(set! (-> v1-1 janim) 2)
(set! (-> v1-1 mgeo 0) (the-as uint 1))
(set! (-> v1-1 lod-dist 0) 4095996000.0)
(set! *plat-button-sg* v1-1)
)
;; definition for method 30 of type plat-button
(defmethod should-teleport? plat-button ((obj plat-button))
#f
)
;; definition for method 26 of type plat-button
(defmethod can-activate? plat-button ((obj plat-button))
(or
(= (-> obj path-pos) 0.0)
(and (-> obj bidirectional?) (= (-> obj path-pos) 1.0))
)
)
;; failed to figure out what this is:
(defstate plat-button-idle (plat-button)
:virtual #t
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (when (= v1-0 'touch)
(when (can-activate? self)
(if
(and
((method-of-type touching-shapes-entry prims-touching?)
(the-as touching-shapes-entry (-> arg3 param 0))
(-> self root-override)
(the-as uint 1)
)
(or
(not (-> self should-grab-player?))
(let ((v0-3 (process-grab? *target*)))
(set! (-> self grab-player?) v0-3)
v0-3
)
)
)
(go-virtual plat-button-pressed)
)
)
)
)
)
)
:code
(behavior ()
(let ((gp-0 (can-activate? self)))
(cond
(gp-0
(let ((a0-1 (-> self skel root-channel 0)))
(set! (-> a0-1 param 0) 0.0)
(set! (-> a0-1 param 1) 1.0)
(joint-control-channel-group!
a0-1
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
(else
(let ((a0-2 (-> self skel root-channel 0)))
(set!
(-> a0-2 param 0)
(the float (+ (-> a0-2 frame-group data 0 length) -1))
)
(set! (-> a0-2 param 1) 1.0)
(joint-control-channel-group!
a0-2
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
)
(while #t
(if (should-teleport? self)
(go-virtual plat-button-teleport-to-other-end)
)
(let ((s5-0 (can-activate? self)))
(when (!= s5-0 gp-0)
(set! gp-0 s5-0)
(cond
(s5-0
(let ((a0-5 (-> self skel root-channel 0)))
(set! (-> a0-5 param 0) 0.0)
(set! (-> a0-5 param 1) 1.0)
(joint-control-channel-group!
a0-5
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
(else
(let ((a0-6 (-> self skel root-channel 0)))
(set!
(-> a0-6 param 0)
(the float (+ (-> a0-6 frame-group data 0 length) -1))
)
(set! (-> a0-6 param 1) 1.0)
(joint-control-channel-group!
a0-6
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
)
)
(when (not (ja-done? 0))
(rider-trans)
(cond
(s5-0
(let ((a0-8 (-> self skel root-channel 0)))
(set! (-> a0-8 param 0) 0.0)
(set! (-> a0-8 param 1) 1.0)
(joint-control-channel-group-eval!
a0-8
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
(else
(let ((a0-9 (-> self skel root-channel 0)))
(set!
(-> a0-9 param 0)
(the float (+ (-> a0-9 frame-group data 0 length) -1))
)
(set! (-> a0-9 param 1) 1.0)
(joint-control-channel-group-eval!
a0-9
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
)
(rider-post)
)
)
(suspend)
)
)
(none)
)
)
;; failed to figure out what this is:
(defstate plat-button-teleport-to-other-end (plat-button)
:virtual #t
:code
(behavior ()
(let ((f0-0 1.0))
(if (>= (-> self path-pos) 0.5)
(set! f0-0 0.0)
)
(set! (-> self path-pos) f0-0)
(let ((gp-0 (new 'stack-no-clear 'vector)))
(eval-path-curve! (-> self path) gp-0 f0-0 'interp)
(vector+! gp-0 gp-0 (-> self trans-off))
(TODO-RENAME-30 (-> self root-override) gp-0)
)
)
(ja-post)
(go-virtual plat-button-idle)
(none)
)
)
;; failed to figure out what this is:
(defstate plat-button-pressed (plat-button)
:virtual #t
:trans
(the-as (function none :behavior plat-button) rider-trans)
:code
(behavior ()
(let ((a0-0 (-> self skel root-channel 0)))
(set!
(-> a0-0 param 0)
(the float (+ (-> a0-0 frame-group data 0 length) -1))
)
(set! (-> a0-0 param 1) 1.0)
(joint-control-channel-group!
a0-0
(the-as art-joint-anim #f)
num-func-seek!
)
)
(until (ja-done? 0)
(suspend)
(let ((a0-1 (-> self skel root-channel 0)))
(set!
(-> a0-1 param 0)
(the float (+ (-> a0-1 frame-group data 0 length) -1))
)
(set! (-> a0-1 param 1) 1.0)
(joint-control-channel-group-eval!
a0-1
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
(set! (-> self go-back-if-lost-player?) #t)
(process-entity-status! self (entity-perm-status complete) #t)
(if (= (-> self path-pos) 0.0)
(go-virtual plat-button-move-downward)
(go-virtual plat-button-move-upward)
)
(none)
)
:post
(the-as (function none :behavior plat-button) rider-post)
)
;; definition for function plat-button-camera-on
;; INFO: Return type mismatch int vs none.
(defbehavior plat-button-camera-on plat-button ()
(let ((v1-1 (res-lump-struct (-> self entity) 'camera-name structure)))
(when v1-1
(let ((a1-1 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-1 from) self)
(set! (-> a1-1 num-params) 1)
(set! (-> a1-1 message) 'change-to-entity-by-name)
(set! (-> a1-1 param 0) (the-as uint v1-1))
(send-event-function *camera* a1-1)
)
)
)
0
(none)
)
;; definition for function plat-button-camera-off
;; INFO: Return type mismatch int vs none.
(defbehavior plat-button-camera-off plat-button ()
(let ((a1-0 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-0 from) self)
(set! (-> a1-0 num-params) 0)
(set! (-> a1-0 message) 'clear-entity)
(send-event-function *camera* a1-0)
)
0
(none)
)
;; failed to figure out what this is:
(defstate plat-button-move-downward (plat-button)
:virtual #t
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(the-as object (when (or (= arg2 'touch) (= arg2 'attack))
(set!
(-> self state-time)
(the-as seconds (-> *display* base-frame-counter))
)
#f
)
)
)
:enter
(behavior ()
(set!
(-> self state-time)
(the-as seconds (-> *display* base-frame-counter))
)
(process-entity-status! self (entity-perm-status bit-3) #t)
(plat-button-camera-on)
(set-setting! *setting-control* self 'allow-look-around #f 0.0 0)
(none)
)
:exit
(behavior ()
(plat-button-camera-off)
(clear-pending-settings-from-process
*setting-control*
self
'allow-look-around
)
(none)
)
:trans
(behavior ()
(if (= (-> self path-pos) 1.0)
(go-virtual plat-button-at-end)
)
(rider-trans)
(when (-> self go-back-if-lost-player?)
(when
(or
(not *target*)
(and
(>=
(- (-> *display* base-frame-counter) (the-as int (-> self state-time)))
1200
)
(not
(and
(logtest? (-> *target* control unknown-surface00 flags) 2048)
(zero? (logand (-> *target* control status) 1))
)
)
)
)
(set! (-> self go-back-if-lost-player?) #f)
(go-virtual plat-button-move-upward)
)
)
(let
((f0-4
(seek-with-smooth
(-> self path-pos)
1.0
(* 0.1 (-> *display* seconds-per-frame))
0.25
0.001
)
)
)
(set! (-> self path-pos) f0-4)
(let ((gp-0 (new 'stack-no-clear 'vector)))
(eval-path-curve! (-> self path) gp-0 f0-4 'interp)
(vector+! gp-0 gp-0 (-> self trans-off))
(TODO-RENAME-30 (-> self root-override) gp-0)
)
)
(sound-play-by-name
(static-sound-name "elev-loop")
(-> self sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(let ((gp-1 (the-as sound-rpc-set-param (get-sound-buffer-entry))))
(set! (-> gp-1 command) (sound-command set-param))
(set! (-> gp-1 id) (-> self sound-id))
(let ((a1-6 (-> self root-override trans)))
(let ((s5-0 self))
(when (= a1-6 #t)
(if
(and
s5-0
(type-type? (-> s5-0 type) process-drawable)
(nonzero? (-> s5-0 root-override))
)
(set! a1-6 (-> s5-0 root-override trans))
(set! a1-6 (the-as vector #f))
)
)
)
(sound-trans-convert (-> gp-1 parms trans) a1-6)
)
(set! (-> gp-1 parms mask) (the-as uint 32))
(-> gp-1 id)
)
(if (and (-> self grab-player?) (< 0.2 (-> self path-pos)))
(set! (-> self grab-player?) (not (process-release? *target*)))
)
(none)
)
:code
(the-as (function none :behavior plat-button) anim-loop)
:post
(the-as (function none :behavior plat-button) rider-post)
)
;; failed to figure out what this is:
(defstate plat-button-move-upward (plat-button)
:virtual #t
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(the-as object (when (or (= arg2 'touch) (= arg2 'attack))
(set!
(-> self state-time)
(the-as seconds (-> *display* base-frame-counter))
)
#f
)
)
)
:enter
(behavior ()
(set!
(-> self state-time)
(the-as seconds (-> *display* base-frame-counter))
)
(process-entity-status! self (entity-perm-status bit-3) #t)
(plat-button-camera-on)
(set-setting! *setting-control* self 'allow-look-around #f 0.0 0)
(none)
)
:exit
(behavior ()
(plat-button-camera-off)
(clear-pending-settings-from-process
*setting-control*
self
'allow-look-around
)
(none)
)
:trans
(behavior ()
(if (= (-> self path-pos) 0.0)
(go-virtual plat-button-at-end)
)
(rider-trans)
(when (-> self go-back-if-lost-player?)
(when
(or
(not *target*)
(and
(>=
(- (-> *display* base-frame-counter) (the-as int (-> self state-time)))
1200
)
(not
(and
(logtest? (-> *target* control unknown-surface00 flags) 2048)
(zero? (logand (-> *target* control status) 1))
)
)
)
)
(set! (-> self go-back-if-lost-player?) #f)
(go-virtual plat-button-move-downward)
)
)
(let
((f0-4
(seek-with-smooth
(-> self path-pos)
0.0
(* 0.1 (-> *display* seconds-per-frame))
0.25
0.001
)
)
)
(set! (-> self path-pos) f0-4)
(let ((gp-0 (new 'stack-no-clear 'vector)))
(eval-path-curve! (-> self path) gp-0 f0-4 'interp)
(vector+! gp-0 gp-0 (-> self trans-off))
(TODO-RENAME-30 (-> self root-override) gp-0)
)
)
(sound-play-by-name
(static-sound-name "elev-loop")
(-> self sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(let ((gp-1 (the-as sound-rpc-set-param (get-sound-buffer-entry))))
(set! (-> gp-1 command) (sound-command set-param))
(set! (-> gp-1 id) (-> self sound-id))
(let ((a1-6 (-> self root-override trans)))
(let ((s5-0 self))
(when (= a1-6 #t)
(if
(and
s5-0
(type-type? (-> s5-0 type) process-drawable)
(nonzero? (-> s5-0 root-override))
)
(set! a1-6 (-> s5-0 root-override trans))
(set! a1-6 (the-as vector #f))
)
)
)
(sound-trans-convert (-> gp-1 parms trans) a1-6)
)
(set! (-> gp-1 parms mask) (the-as uint 32))
(-> gp-1 id)
)
(if (and (-> self grab-player?) (< (-> self path-pos) 0.8))
(set! (-> self grab-player?) (not (process-release? *target*)))
)
(none)
)
:code
(the-as (function none :behavior plat-button) anim-loop)
:post
(the-as (function none :behavior plat-button) rider-post)
)
;; failed to figure out what this is:
(defstate plat-button-at-end (plat-button)
:virtual #t
:code
(behavior ()
(if (-> self allow-auto-kill)
(process-entity-status! self (entity-perm-status bit-3) #f)
)
(sound-stop (-> self sound-id))
(sound-play-by-name
(static-sound-name "elev-land")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(while #t
(if
(or
(not *target*)
(<
268435460.0
(vector-vector-xz-distance-squared
(-> self root-override trans)
(target-pos 0)
)
)
)
(go-virtual plat-button-idle)
)
(suspend)
)
(none)
)
)
;; definition for method 28 of type plat-button
(defmethod TODO-RENAME-28 plat-button ((obj plat-button))
(let
((s5-0
(new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player))
)
)
(set! (-> s5-0 dynam) (copy *standard-dynamics* 'process))
(set! (-> s5-0 reaction) default-collision-reaction)
(set! (-> s5-0 no-reaction) nothing)
(dummy-29 s5-0 1)
(let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0)))
(set! (-> s4-0 prim-core collide-as) (the-as uint 2048))
(set! (-> s4-0 collide-with) (the-as uint 16))
(set! (-> s4-0 prim-core action) (the-as uint 3))
(set! (-> s4-0 transform-index) 0)
(set-vector! (-> s4-0 local-sphere) 0.0 -4096.0 0.0 27033.6)
(dummy-46 s5-0)
(let
((s3-0
(new
'process
'collide-shape-prim-mesh
s5-0
(the-as uint 0)
(the-as uint 1)
)
)
)
(set! (-> s3-0 prim-core collide-as) (the-as uint 2048))
(set! (-> s3-0 collide-with) (the-as uint 16))
(set! (-> s3-0 prim-core action) (the-as uint 3))
(set! (-> s3-0 prim-core offense) 4)
(set! (-> s3-0 transform-index) 4)
(set-vector! (-> s3-0 local-sphere) 0.0 -3072.0 0.0 7372.8)
)
(dummy-28 s4-0)
(let
((s3-1
(new
'process
'collide-shape-prim-mesh
s5-0
(the-as uint 1)
(the-as uint 2)
)
)
)
(set! (-> s3-1 prim-core collide-as) (the-as uint 2048))
(set! (-> s3-1 collide-with) (the-as uint 16))
(set! (-> s3-1 prim-core action) (the-as uint 3))
(set! (-> s3-1 prim-core offense) 4)
(set! (-> s3-1 transform-index) 3)
(set-vector! (-> s3-1 local-sphere) 0.0 -4096.0 0.0 27033.6)
)
(dummy-28 s4-0)
)
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
(dummy-50 s5-0)
(set! (-> obj root-override) s5-0)
s5-0
)
)
;; definition for method 29 of type plat-button
;; INFO: Return type mismatch int vs symbol.
(defmethod can-target-move? plat-button ((obj plat-button))
(the-as symbol 0)
)
;; definition for method 27 of type plat-button
(defmethod TODO-RENAME-27 plat-button ((obj plat-button))
(ja-channel-set! 1)
(cond
((can-activate? obj)
(let ((s5-0 (-> obj skel root-channel 0)))
(joint-control-channel-group-eval!
s5-0
(the-as art-joint-anim (-> obj draw art-group data 2))
num-func-identity
)
(set! (-> s5-0 frame-num) 0.0)
)
)
(else
(let ((s5-1 (-> obj skel root-channel 0)))
(joint-control-channel-group-eval!
s5-1
(the-as art-joint-anim (-> obj draw art-group data 2))
num-func-identity
)
(set!
(-> s5-1 frame-num)
(the
float
(+
(->
(the-as art-joint-anim (-> obj draw art-group data 2))
data
0
length
)
-1
)
)
)
)
)
)
(ja-post)
(dummy-47 (-> obj root-override))
(none)
)
;; definition for method 31 of type plat-button
;; INFO: Return type mismatch int vs none.
(defmethod TODO-RENAME-31 plat-button ((obj plat-button))
(dummy-14 obj *plat-button-sg* '())
0
(none)
)
;; definition for method 32 of type plat-button
;; INFO: Return type mismatch int vs none.
(defmethod TODO-RENAME-32 plat-button ((obj plat-button))
(go (method-of-object obj plat-button-idle))
0
(none)
)
;; definition for method 11 of type plat-button
;; Used lq/sq
(defmethod copy-defaults! plat-button ((obj plat-button) (arg0 res-lump))
(set! (-> obj go-back-if-lost-player?) #f)
(set! (-> obj grab-player?) #f)
(set! (-> obj should-grab-player?) #f)
(set!
(-> obj trans-off quad)
(->
(the-as
vector
(get-property-struct
arg0
'trans-offset
'interp
-1000000000.0
*null-vector*
(the-as (pointer res-tag) #f)
*res-static-buf*
)
)
quad
)
)
(set!
(-> obj bidirectional?)
(nonzero? (res-lump-value arg0 'bidirectional uint128))
)
(TODO-RENAME-28 obj)
(process-drawable-from-entity! obj arg0)
(logclear! (-> obj mask) (process-mask actor-pause))
(TODO-RENAME-31 obj)
(logior! (-> obj skel status) 1)
(set! (-> obj spawn-pos quad) (-> obj root-override trans quad))
(set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0))
(logior!
(-> obj path flags)
(path-control-flag display draw-line draw-point draw-text)
)
(set! (-> obj path-pos) 0.0)
(let ((s5-1 (-> obj root-override trans)))
(eval-path-curve! (-> obj path) s5-1 (-> obj path-pos) 'interp)
(vector+! s5-1 s5-1 (-> obj trans-off))
)
(set! (-> obj sound-id) (new-sound-id))
(set! (-> obj allow-auto-kill) #t)
(can-target-move? obj)
(TODO-RENAME-27 obj)
(TODO-RENAME-32 obj)
(none)
)
+597
View File
@@ -5,3 +5,600 @@
;; name in dgo: plat
;; dgos: GAME, COMMON, L1
(define-extern *plat-jungleb-sg* skeleton-group)
(define-extern *plat-sunken-sg* skeleton-group)
(define-extern *plat-sg* skeleton-group)
;; failed to figure out what this is:
(set!
(-> *part-group-id-table* 107)
(new 'static 'sparticle-launch-group
:length 2
:duration #xbb8
:linger-duration #x5dc
:name "group-standard-plat"
:launcher
(new 'static 'inline-array sparticle-group-item 2
(new 'static 'sparticle-group-item
:launcher #x16b
:fade-after (meters 60.0)
:falloff-to (meters 60.0)
)
(new 'static 'sparticle-group-item
:launcher #x16c
:fade-after (meters 160.0)
:falloff-to (meters 160.0)
)
)
:bounds
(new 'static 'sphere :y -49152.0 :w 57344.0)
)
)
;; failed to figure out what this is:
(set!
(-> *part-id-table* 363)
(new 'static 'sparticle-launcher
:init-specs
(new 'static 'inline-array sp-field-init-spec 14
(new 'static 'sp-field-init-spec
:field #x6
:flags #x1
:initial-value #x3fc00000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #xb
:flags #x1
:initial-value #x45800000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec :field #xe :initial-value 5 :random-mult 1)
(new 'static 'sp-field-init-spec
:field #x12
:flags #x1
:initial-value #x45a66666
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x13
:flags #x1
:initial-value #x45800000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x14
:flags #x1
:initial-value #x45666666
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x1a
:flags #x1
:initial-value #x415a740e
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x23
:flags #x1
:initial-value -1048374674
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x2e
:initial-value 25
:random-mult 1
)
(new 'static 'sp-field-init-spec
:field #x2f
:initial-value #x100
:random-mult 1
)
(new 'static 'sp-field-init-spec
:field #x3a
:flags #x1
:initial-value #x46c71c72
:random-range #x45e38e39
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x3b
:flags #x1
:random-range #x47800000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x3e
:flags #x1
:initial-value #x46400000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec :field #x43)
)
)
)
;; failed to figure out what this is:
(set!
(-> *part-id-table* 364)
(new 'static 'sparticle-launcher
:init-specs
(new 'static 'inline-array sp-field-init-spec 19
(new 'static 'sp-field-init-spec :field #x1 :initial-value #x200f00)
(new 'static 'sp-field-init-spec
:field #x6
:flags #x1
:initial-value #x40000000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #xb
:flags #x1
:initial-value #x45c00000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #xd
:flags #x1
:initial-value #x46000000
:random-range #x45800000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x11
:flags #x3
:initial-value -4
:random-mult 1
)
(new 'static 'sp-field-init-spec
:field #x13
:flags #x1
:random-range #x42800000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x14
:flags #x1
:initial-value #x43000000
:random-range #x43000000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x15
:flags #x1
:initial-value #x41800000
:random-range #x42000000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x1a
:flags #x1
:initial-value #x4223d70a
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x22
:flags #x1
:initial-value -1092979698
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x24
:flags #x1
:initial-value -1096558838
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x26
:flags #x1
:initial-value -1106522267
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x2d
:flags #x1
:initial-value #x3f75c28f
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x2e
:initial-value #x96
:random-mult 1
)
(new 'static 'sp-field-init-spec
:field #x2f
:initial-value 12
:random-mult 1
)
(new 'static 'sp-field-init-spec
:field #x3a
:flags #x1
:initial-value #x46b8e38e
:random-range #x468e38e4
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x3b
:flags #x1
:random-range #x47800000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x3e
:flags #x1
:initial-value #x46400000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec :field #x43)
)
)
)
;; definition of type plat
(deftype plat (baseplat)
((path-pos float :offset-assert 228)
(sync sync-info-eased :inline :offset-assert 232)
(sound-id sound-id :offset-assert 260)
)
:heap-base #xa0
:method-count-assert 33
:size-assert #x108
:flag-assert #x2100a00108
(:methods
(dummy-27 () none 27)
(dummy-28 () none 28)
(wad () _type_ :state 29)
(plat-startup () _type_ :state 30)
(plat-idle () _type_ :state 31)
(plat-path-active () _type_ :state 32)
)
)
;; definition for method 3 of type plat
(defmethod inspect plat ((obj plat))
(let ((t9-0 (method-of-type baseplat inspect)))
(t9-0 obj)
)
(format #t "~T~Tpath-pos: ~f~%" (-> obj path-pos))
(format #t "~T~Tsync: #<sync-info-eased @ #x~X>~%" (-> obj sync))
(format #t "~T~Tsound-id: ~D~%" (-> obj sound-id))
obj
)
;; failed to figure out what this is:
(let
((v1-4
(new 'static 'skeleton-group
:art-group-name "plat"
:bounds
(new 'static 'vector :y -2048.0 :w 12288.0)
:max-lod 2
:version #x6
)
)
)
(set! (-> v1-4 jgeo) 0)
(set! (-> v1-4 janim) 4)
(set! (-> v1-4 mgeo 0) (the-as uint 1))
(set! (-> v1-4 lod-dist 0) 81920.0)
(set! (-> v1-4 mgeo 1) (the-as uint 2))
(set! (-> v1-4 lod-dist 1) 163840.0)
(set! (-> v1-4 mgeo 2) (the-as uint 3))
(set! (-> v1-4 lod-dist 2) 4095996000.0)
(set! *plat-sg* v1-4)
)
;; failed to figure out what this is:
(let
((v1-5
(new 'static 'skeleton-group
:art-group-name "plat-jungleb"
:bounds
(new 'static 'vector :y -2048.0 :w 12288.0)
:version #x6
)
)
)
(set! (-> v1-5 jgeo) 0)
(set! (-> v1-5 janim) 4)
(set! (-> v1-5 mgeo 0) (the-as uint 1))
(set! (-> v1-5 lod-dist 0) 4095996000.0)
(set! *plat-jungleb-sg* v1-5)
)
;; failed to figure out what this is:
(let
((v1-6
(new 'static 'skeleton-group
:art-group-name "plat-sunken"
:bounds
(new 'static 'vector :y -2048.0 :w 13107.2)
:version #x6
)
)
)
(set! (-> v1-6 jgeo) 0)
(set! (-> v1-6 janim) 4)
(set! (-> v1-6 mgeo 0) (the-as uint 1))
(set! (-> v1-6 lod-dist 0) 4095996000.0)
(set! *plat-sunken-sg* v1-6)
)
;; definition for method 23 of type plat
(defmethod TODO-RENAME-23 plat ((obj plat))
(cond
((= (-> (if (-> obj entity)
(-> obj entity extra level)
(-> *level* level-default)
)
name
)
'jungleb
)
*plat-jungleb-sg*
)
((or (= (-> (if (-> obj entity)
(-> obj entity extra level)
(-> *level* level-default)
)
name
)
'sunken
)
(= (-> (if (-> obj entity)
(-> obj entity extra level)
(-> *level* level-default)
)
name
)
'sunkenb
)
)
*plat-sunken-sg*
)
(else
*plat-sg*
)
)
)
;; definition for method 24 of type plat
;; INFO: Return type mismatch int vs none.
(defmethod dummy-24 plat ((obj plat))
(let
((s5-0
(new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player))
)
)
(set! (-> s5-0 dynam) (copy *standard-dynamics* 'process))
(set! (-> s5-0 reaction) default-collision-reaction)
(set! (-> s5-0 no-reaction) nothing)
(dummy-29 s5-0 1)
(let
((s4-0
(new
'process
'collide-shape-prim-mesh
s5-0
(the-as uint 0)
(the-as uint 0)
)
)
)
(set! (-> s4-0 prim-core collide-as) (the-as uint 2048))
(set! (-> s4-0 collide-with) (the-as uint 16))
(set! (-> s4-0 prim-core action) (the-as uint 3))
(set! (-> s4-0 prim-core offense) 4)
(set! (-> s4-0 transform-index) 0)
(set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 13107.2)
)
(dummy-46 s5-0)
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
(dummy-50 s5-0)
(set! (-> obj root-override) s5-0)
)
0
(none)
)
;; definition for method 26 of type plat
;; INFO: Return type mismatch int vs none.
(defmethod dummy-26 plat ((obj plat))
0
(none)
)
;; definition for method 25 of type plat
;; INFO: Return type mismatch sparticle-launch-control vs sparticle-launch-group.
(defmethod TODO-RENAME-25 plat ((obj plat))
(the-as sparticle-launch-group (when (!= (-> (if (-> obj entity)
(-> obj entity extra level)
(-> *level* level-default)
)
name
)
'maincave
)
(let
((v0-0
(create-launch-control
(-> *part-group-id-table* 107)
obj
)
)
)
(set! (-> obj part) v0-0)
v0-0
)
)
)
)
;; failed to figure out what this is:
(defstate plat-startup (plat)
:virtual #t
:code
(behavior ()
(cond
((logtest? (-> self path flags) (path-control-flag not-found))
(go-virtual plat-idle)
)
((> (-> self sync period) 0)
(go-virtual plat-path-active)
)
(else
(go-virtual plat-idle)
)
)
(none)
)
)
;; failed to figure out what this is:
(defstate plat-idle (plat)
:virtual #t
:event
(the-as
(function process int symbol event-message-block object :behavior plat)
plat-event
)
:trans
(behavior ()
(dummy-20 self)
(none)
)
:code
(behavior ()
(plat-trans)
(rider-post)
(suspend)
(while #t
(when (not (-> self bouncing))
(plat-trans)
(rider-post)
(logior! (-> self mask) (process-mask sleep-code))
(suspend)
0
)
(while (-> self bouncing)
(plat-trans)
(rider-post)
(suspend)
)
)
(none)
)
)
;; failed to figure out what this is:
(defstate plat-path-active (plat)
:virtual #t
:event
(the-as
(function process int symbol event-message-block object :behavior plat)
plat-event
)
:exit
(behavior ()
(sound-stop (-> self sound-id))
(none)
)
:trans
(behavior ()
(set! (-> self path-pos) (if (logtest? (-> self fact options) 8)
(get-current-phase (-> self sync))
(get-current-phase-with-mirror (-> self sync))
)
)
(eval-path-curve!
(-> self path)
(-> self basetrans)
(-> self path-pos)
'interp
)
(if
(<
(vector-vector-distance (-> self root-override trans) (ear-trans))
81920.0
)
(sound-play-by-name
(static-sound-name "eco-plat-hover")
(-> self sound-id)
1024
0
0
(the-as uint 1)
(-> self root-override trans)
)
)
(plat-trans)
(none)
)
:code
(the-as (function none :behavior plat) anim-loop)
:post
(the-as (function none :behavior plat) plat-post)
)
;; definition for method 11 of type plat
(defmethod copy-defaults! plat ((obj plat) (arg0 res-lump))
(set! (-> obj mask) (logior (process-mask platform) (-> obj mask)))
(dummy-24 obj)
(process-drawable-from-entity! obj arg0)
(dummy-14 obj (TODO-RENAME-23 obj) '())
(logior! (-> obj skel status) 1)
(dummy-47 (-> obj root-override))
(dummy-21 obj)
(TODO-RENAME-25 obj)
(load-params! (-> obj sync) obj (the-as uint 0) 0.0 0.15 0.15)
(set!
(-> obj fact)
(new
'process
'fact-info
obj
(pickup-type eco-pill-random)
(-> *FACT-bank* default-pill-inc)
)
)
(set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0))
(logior!
(-> obj path flags)
(path-control-flag display draw-line draw-point draw-text)
)
(set! (-> obj sound-id) (new-sound-id))
(cond
((logtest? (-> obj path flags) (path-control-flag not-found))
(set! (-> obj path-pos) 0.0)
(dummy-26 obj)
(go (method-of-object obj plat-startup))
)
((> (-> obj sync period) 0)
(set! (-> obj path-pos) (if (logtest? (-> obj fact options) 8)
(get-current-phase (-> obj sync))
(get-current-phase-with-mirror (-> obj sync))
)
)
(eval-path-curve!
(-> obj path)
(-> obj root-override trans)
(-> obj path-pos)
'interp
)
(dummy-26 obj)
(go (method-of-object obj plat-startup))
)
(else
(set! (-> obj path-pos) 0.0)
(eval-path-curve!
(-> obj path)
(-> obj root-override trans)
(-> obj path-pos)
'interp
)
(dummy-26 obj)
(go (method-of-object obj plat-startup))
)
)
(none)
)
@@ -217,4 +217,3 @@
v0-2
)
)
+314
View File
@@ -5,3 +5,317 @@
;; name in dgo: plat-flip
;; dgos: JUB, L1
(define-extern *plat-flip-sg* skeleton-group)
;; definition of type plat-flip
(deftype plat-flip (process-drawable)
((root-override collide-shape-moving :offset 112)
(path-pos float :offset-assert 176)
(before-turn-down-time float :offset-assert 180)
(turn-down-time float :offset-assert 184)
(before-turn-up-time float :offset-assert 188)
(turn-up-time float :offset-assert 192)
(total-time float :offset-assert 196)
(sync sync-info :inline :offset-assert 200)
(base-pos vector :inline :offset-assert 208)
(smush smush-control :inline :offset-assert 224)
)
:heap-base #x90
:method-count-assert 20
:size-assert #x100
:flag-assert #x1400900100
)
;; failed to figure out what this is:
(let
((v1-1
(new 'static 'skeleton-group
:art-group-name "plat-flip"
:bounds (new 'static 'vector :w 32768.0)
:version #x6
)
)
)
(set! (-> v1-1 jgeo) 0)
(set! (-> v1-1 janim) 2)
(set! (-> v1-1 mgeo 0) (the-as uint 1))
(set! (-> v1-1 lod-dist 0) 4095996000.0)
(set! *plat-flip-sg* v1-1)
)
;; failed to figure out what this is:
(defstate plat-flip-idle (plat-flip)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'bonk)
(activate! (-> self smush) -1.0 90 300 1.0 1.0)
)
((= v1-0 'touch)
(let ((a1-5 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-5 from) self)
(set! (-> a1-5 num-params) 1)
(set! (-> a1-5 message) 'no-look-around)
(set! (-> a1-5 param 0) (the-as uint 450))
(send-event-function arg0 a1-5)
)
(the-as smush-control #f)
)
)
)
)
)
:trans
(the-as (function none :behavior plat-flip) rider-trans)
:code
(behavior ()
(local-vars (f30-0 float) (f30-1 float))
(let ((gp-0 #f))
(while #t
(let ((f0-1 (get-current-value (-> self sync) (-> self total-time))))
(cond
((< f0-1 (-> self before-turn-down-time))
(let ((gp-1 (-> self skel root-channel 0)))
(joint-control-channel-group-eval!
gp-1
(the-as art-joint-anim (-> self draw art-group data 2))
num-func-identity
)
(set! (-> gp-1 frame-num) 0.0)
)
(set! gp-0 #f)
)
((begin
(set! f30-0 (- f0-1 (-> self before-turn-down-time)))
(< f30-0 (-> self turn-down-time))
)
(when (not gp-0)
(set! gp-0 #t)
(sound-play-by-name
(static-sound-name "plat-flip")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
)
(let ((s5-1 (-> self skel root-channel 0)))
(joint-control-channel-group-eval!
s5-1
(the-as art-joint-anim (-> self draw art-group data 2))
num-func-identity
)
(set!
(-> s5-1 frame-num)
(/
(*
f30-0
(the
float
(+
(->
(the-as art-joint-anim (-> self draw art-group data 2))
data
0
length
)
-1
)
)
)
(-> self turn-down-time)
)
)
)
)
((begin
(set! f30-1 (- f30-0 (-> self turn-down-time)))
(< f30-1 (-> self before-turn-up-time))
)
(set! gp-0 #f)
(let ((s5-2 (-> self skel root-channel 0)))
(joint-control-channel-group-eval!
s5-2
(the-as art-joint-anim (-> self draw art-group data 2))
num-func-identity
)
(set!
(-> s5-2 frame-num)
(the
float
(+
(->
(the-as art-joint-anim (-> self draw art-group data 2))
data
0
length
)
-1
)
)
)
)
)
(else
(when (not gp-0)
(set! gp-0 #t)
(sound-play-by-name
(static-sound-name "plat-flip")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
)
(let ((f30-2 (- f30-1 (-> self before-turn-up-time)))
(s5-4 (-> self skel root-channel 0))
)
(joint-control-channel-group-eval!
s5-4
(the-as art-joint-anim (-> self draw art-group data 3))
num-func-identity
)
(set!
(-> s5-4 frame-num)
(/
(*
f30-2
(the
float
(+
(->
(the-as art-joint-anim (-> self draw art-group data 3))
data
0
length
)
-1
)
)
)
(-> self turn-up-time)
)
)
)
)
)
)
(let ((s5-5 (new 'stack-no-clear 'vector)))
(set! (-> s5-5 quad) (-> self base-pos quad))
(+! (-> s5-5 y) (* 1638.4 (update! (-> self smush))))
(TODO-RENAME-30 (-> self root-override) s5-5)
)
(suspend)
)
)
(none)
)
:post
(the-as (function none :behavior plat-flip) rider-post)
)
;; definition for method 11 of type plat-flip
;; Used lq/sq
(defmethod copy-defaults! plat-flip ((obj plat-flip) (arg0 res-lump))
(local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag))
(set! (-> obj mask) (logior (process-mask platform) (-> obj mask)))
(let
((s4-0
(new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player))
)
)
(set! (-> s4-0 dynam) (copy *standard-dynamics* 'process))
(set! (-> s4-0 reaction) default-collision-reaction)
(set! (-> s4-0 no-reaction) nothing)
(dummy-29 s4-0 1)
(let
((s3-0
(new
'process
'collide-shape-prim-mesh
s4-0
(the-as uint 0)
(the-as uint 0)
)
)
)
(set! (-> s3-0 prim-core collide-as) (the-as uint 2048))
(set! (-> s3-0 collide-with) (the-as uint 16))
(set! (-> s3-0 prim-core action) (the-as uint 3))
(set! (-> s3-0 prim-core offense) 4)
(set! (-> s3-0 transform-index) 3)
(set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 11468.8)
)
(dummy-46 s4-0)
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
(dummy-50 s4-0)
(set! (-> obj root-override) s4-0)
)
(process-drawable-from-entity! obj arg0)
(set! (-> obj base-pos quad) (-> obj root-override trans quad))
(dummy-14 obj *plat-flip-sg* '())
(logior! (-> obj skel status) 1)
(let ((f30-0 300.0))
(set! sv-16 (new 'static 'res-tag))
(let ((v1-28 (res-lump-data arg0 'delay pointer :tag-ptr (& sv-16))))
(set!
(-> obj before-turn-down-time)
(* f30-0 (if (and v1-28 (> (the-as int (-> sv-16 elt-count)) 0))
(-> (the-as (pointer float) v1-28))
2.0
)
)
)
)
)
(let ((f30-1 300.0))
(set! sv-32 (new 'static 'res-tag))
(let ((v1-31 (res-lump-data arg0 'delay pointer :tag-ptr (& sv-32))))
(set!
(-> obj before-turn-up-time)
(* f30-1 (if (and v1-31 (< 1 (the-as int (-> sv-32 elt-count))))
(-> (the-as (pointer float) v1-31) 1)
0.2
)
)
)
)
)
(set! (-> obj turn-down-time) 300.0)
(set! (-> obj turn-up-time) 300.0)
(set!
(-> obj total-time)
(+
(-> obj before-turn-down-time)
(-> obj turn-down-time)
(-> obj before-turn-up-time)
(-> obj turn-up-time)
)
)
(let ((s4-1 (-> obj sync))
(s3-1 (method-of-type sync-info setup-params!))
(s2-0 (the int (-> obj total-time)))
)
(set! sv-48 (new 'static 'res-tag))
(let ((v1-35 (res-lump-data arg0 'sync-percent pointer :tag-ptr (& sv-48))))
(s3-1
s4-1
(the-as uint s2-0)
(if (and v1-35 (> (the-as int (-> sv-48 elt-count)) 0))
(-> (the-as (pointer float) v1-35) 0)
0.0
)
0.15
0.15
)
)
)
(dummy-47 (-> obj root-override))
(go plat-flip-idle)
(none)
)
+381
View File
@@ -5,3 +5,384 @@
;; name in dgo: wall-plat
;; dgos: L1, SUN, SUNKEN
(define-extern *wall-plat-sg* skeleton-group)
(declare-type wall-plat process-drawable)
(define-extern wall-plat-sync-idle (state wall-plat)) ;; unknown type
(define-extern wall-plat-retracted (state wall-plat)) ;; unknown type
(define-extern wall-plat-retracting (state wall-plat)) ;; unknown type
(define-extern wall-plat-extended (state wall-plat)) ;; unknown type
(define-extern wall-plat-extending (state wall-plat)) ;; unknown type
;; definition of type wall-plat
(deftype wall-plat (process-drawable)
((root-override collide-shape-moving :offset 112)
(use-sync? symbol :offset-assert 176)
(extended-amount float :offset-assert 180)
(in-trans vector :inline :offset-assert 192)
(out-trans vector :inline :offset-assert 208)
(sync sync-info-paused :inline :offset-assert 224)
)
:heap-base #x80
:method-count-assert 20
:size-assert #xf0
:flag-assert #x14008000f0
)
;; failed to figure out what this is:
(let
((v1-1
(new 'static 'skeleton-group
:art-group-name "wall-plat"
:bounds
(new 'static 'vector :x 4096.0 :y -8192.0 :w 26624.0)
:version #x6
)
)
)
(set! (-> v1-1 jgeo) 0)
(set! (-> v1-1 janim) -1)
(set! (-> v1-1 mgeo 0) (the-as uint 1))
(set! (-> v1-1 lod-dist 0) 4095996000.0)
(set! *wall-plat-sg* v1-1)
)
;; failed to figure out what this is:
(defstate wall-plat-retracted (wall-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (if (= v1-0 'trigger)
(go wall-plat-extending)
)
)
)
)
:code
(behavior ()
(set! (-> self extended-amount) 0.0)
(TODO-RENAME-30 (-> self root-override) (-> self in-trans))
(transform-post)
(dummy-48 (-> self root-override))
(while #t
(logior! (-> self mask) (process-mask sleep-code))
(suspend)
)
(none)
)
)
;; failed to figure out what this is:
(defstate wall-plat-extending (wall-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (when (= v1-0 'touch)
(let ((a1-2 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-2 from) self)
(set! (-> a1-2 num-params) 1)
(set! (-> a1-2 message) 'no-look-around)
(set! (-> a1-2 param 0) (the-as uint 450))
(send-event-function arg0 a1-2)
)
#f
)
)
)
)
:enter
(behavior ()
(sound-play-by-name
(static-sound-name "wall-plat")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(none)
)
:trans
(the-as (function none :behavior wall-plat) rider-trans)
:code
(behavior ()
((method-of-object (-> self root-override) dummy-49))
(set!
(-> self state-time)
(the-as seconds (-> *display* base-frame-counter))
)
(while #t
(set!
(-> self extended-amount)
(seek
(-> self extended-amount)
1.0
(* 2.5 (-> *display* seconds-per-frame))
)
)
(let ((gp-0 (new 'stack-no-clear 'vector)))
(vector-lerp!
gp-0
(-> self in-trans)
(-> self out-trans)
(-> self extended-amount)
)
(TODO-RENAME-30 (-> self root-override) gp-0)
)
(suspend)
(if (= (-> self extended-amount) 1.0)
(go wall-plat-extended)
)
)
(none)
)
:post
(the-as (function none :behavior wall-plat) rider-post)
)
;; failed to figure out what this is:
(defstate wall-plat-extended (wall-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (if (= v1-0 'untrigger)
(go wall-plat-retracting)
)
)
)
)
:code
(behavior ()
(set! (-> self extended-amount) 1.0)
(TODO-RENAME-30 (-> self root-override) (-> self out-trans))
(transform-post)
(while #t
(logior! (-> self mask) (process-mask sleep-code))
(suspend)
)
(none)
)
)
;; failed to figure out what this is:
(defstate wall-plat-retracting (wall-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (when (= v1-0 'touch)
(let ((a1-2 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-2 from) self)
(set! (-> a1-2 num-params) 1)
(set! (-> a1-2 message) 'no-look-around)
(set! (-> a1-2 param 0) (the-as uint 450))
(send-event-function arg0 a1-2)
)
#f
)
)
)
)
:enter
(behavior ()
(sound-play-by-name
(static-sound-name "wall-plat")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(none)
)
:trans
(the-as (function none :behavior wall-plat) rider-trans)
:code
(behavior ()
(set!
(-> self state-time)
(the-as seconds (-> *display* base-frame-counter))
)
(while #t
(set!
(-> self extended-amount)
(seek
(-> self extended-amount)
0.0
(* 2.5 (-> *display* seconds-per-frame))
)
)
(let ((gp-0 (new 'stack-no-clear 'vector)))
(vector-lerp!
gp-0
(-> self in-trans)
(-> self out-trans)
(-> self extended-amount)
)
(TODO-RENAME-30 (-> self root-override) gp-0)
)
(suspend)
(if (= (-> self extended-amount) 0.0)
(go wall-plat-retracted)
)
)
(none)
)
:post
(the-as (function none :behavior wall-plat) rider-post)
)
;; failed to figure out what this is:
(defstate wall-plat-sync-idle (wall-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (when (= v1-0 'touch)
(let ((a1-2 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-2 from) self)
(set! (-> a1-2 num-params) 1)
(set! (-> a1-2 message) 'no-look-around)
(set! (-> a1-2 param 0) (the-as uint 450))
(send-event-function arg0 a1-2)
)
#f
)
)
)
)
:enter
(behavior ()
(logclear! (-> self mask) (process-mask actor-pause))
(none)
)
:exit
(behavior ()
(logior! (-> self mask) (process-mask actor-pause))
(none)
)
:trans
(the-as (function none :behavior wall-plat) rider-trans)
:code
(behavior ()
(let ((gp-0 #f))
(while #t
(let ((f30-0 (get-current-phase-with-mirror (-> self sync))))
(let ((s5-0 (new 'stack-no-clear 'vector)))
(vector-lerp! s5-0 (-> self in-trans) (-> self out-trans) f30-0)
(TODO-RENAME-30 (-> self root-override) s5-0)
)
(cond
((= f30-0 0.0)
(set! gp-0 #f)
(dummy-48 (-> self root-override))
)
((= f30-0 1.0)
(set! gp-0 #f)
((method-of-object (-> self root-override) dummy-49))
)
(else
(when (not gp-0)
(sound-play-by-name
(static-sound-name "wall-plat")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(set! gp-0 #t)
)
((method-of-object (-> self root-override) dummy-49))
)
)
)
(suspend)
)
)
(none)
)
:post
(the-as (function none :behavior wall-plat) rider-post)
)
;; definition for method 11 of type wall-plat
(defmethod copy-defaults! wall-plat ((obj wall-plat) (arg0 res-lump))
(set! (-> obj extended-amount) 0.0)
(set! (-> obj mask) (logior (process-mask platform) (-> obj mask)))
(let
((s4-0
(new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player))
)
)
(set! (-> s4-0 dynam) (copy *standard-dynamics* 'process))
(set! (-> s4-0 reaction) default-collision-reaction)
(set! (-> s4-0 no-reaction) nothing)
(dummy-29 s4-0 1)
(let
((s3-0
(new
'process
'collide-shape-prim-mesh
s4-0
(the-as uint 0)
(the-as uint 0)
)
)
)
(set! (-> s3-0 prim-core collide-as) (the-as uint 2048))
(set! (-> s3-0 collide-with) (the-as uint 16))
(set! (-> s3-0 prim-core action) (the-as uint 19))
(set! (-> s3-0 prim-core offense) 4)
(set! (-> s3-0 transform-index) 2)
(set-vector! (-> s3-0 local-sphere) 0.0 -6144.0 -12288.0 19456.0)
)
(dummy-46 s4-0)
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
(dummy-50 s4-0)
(set! (-> obj root-override) s4-0)
)
(process-drawable-from-entity! obj arg0)
(dummy-14 obj *wall-plat-sg* '())
(logior! (-> obj skel status) 1)
(set!
(-> obj use-sync?)
(load-params! (-> obj sync) obj (the-as uint 1500) 0.0 0.2 0.2)
)
(let ((f30-0 (quaternion-y-angle (-> obj root-override quat)))
(s4-1 (new 'stack-no-clear 'vector))
)
(set-vector! s4-1 0.0 0.0 (+ 1638.4 (res-lump-float arg0 'tunemeters)) 1.0)
(vector-rotate-around-y! s4-1 s4-1 f30-0)
(vector+! (-> obj out-trans) (-> obj root-override trans) s4-1)
(set-vector! s4-1 0.0 0.0 20480.0 1.0)
(vector-rotate-around-y! s4-1 s4-1 f30-0)
(vector+! (-> obj in-trans) (-> obj out-trans) s4-1)
)
(ja-channel-push! 1 0)
(let ((s5-1 (-> obj skel root-channel 0)))
(joint-control-channel-group-eval!
s5-1
(the-as art-joint-anim (-> obj draw art-group data 2))
num-func-identity
)
(set! (-> s5-1 frame-num) 0.0)
)
(ja-post)
(dummy-47 (-> obj root-override))
(cond
((-> obj use-sync?)
(logclear! (-> obj mask) (process-mask actor-pause))
(go wall-plat-sync-idle)
)
(else
(go wall-plat-retracted)
)
)
(none)
)
+674
View File
@@ -5,3 +5,677 @@
;; name in dgo: wedge-plats
;; dgos: L1, SUN, SUNKEN
(define-extern *wedge-plat-sg* skeleton-group)
(declare-type wedge-plat-outer process)
(declare-type wedge-plat-master process)
(declare-type wedge-plat process)
(define-extern wedge-plat-outer-idle (state wedge-plat-outer)) ;; unknown type
(define-extern wedge-plat-outer-tip (state wedge-plat-outer)) ;; unknown type
(define-extern wedge-plat-idle (state wedge-plat)) ;; unknown type
(define-extern wedge-plat-tip (state wedge-plat)) ;; unknown type
(define-extern wedge-plat-master-idle (state wedge-plat-master)) ;; unknown type
(define-extern *wedge-plat-outer-sg* skeleton-group)
;; definition of type wedge-plat-master
(deftype wedge-plat-master (process)
((center vector :inline :offset-assert 112)
(rotspeed float :offset-assert 128)
(rotate-inner float :offset-assert 132)
(rotate-outer float :offset-assert 136)
)
:heap-base #x20
:method-count-assert 14
:size-assert #x8c
:flag-assert #xe0020008c
)
;; failed to figure out what this is:
(defstate wedge-plat-master-idle (wedge-plat-master)
:code
(behavior ()
(while #t
(set!
(-> self rotate-inner)
(the
float
(sar
(shl
(the
int
(+
(-> self rotate-inner)
(* (-> self rotspeed) (-> *display* seconds-per-frame))
)
)
48
)
48
)
)
)
(set!
(-> self rotate-outer)
(the
float
(sar
(shl
(the
int
(-
(-> self rotate-outer)
(* (-> self rotspeed) (-> *display* seconds-per-frame))
)
)
48
)
48
)
)
)
(suspend)
)
(none)
)
)
;; definition for method 11 of type wedge-plat-master
;; Used lq/sq
(defmethod
copy-defaults!
wedge-plat-master
((obj wedge-plat-master) (arg0 res-lump))
(set! (-> obj mask) (logior (process-mask platform) (-> obj mask)))
(set! (-> obj center quad) (-> arg0 extra trans quad))
(set! (-> obj center y) (+ 819.2 (-> obj center y)))
(set! (-> obj rotspeed) (res-lump-float arg0 'rotspeed))
(set! (-> obj rotate-inner) 0.0)
(set! (-> obj rotate-outer) 0.0)
(logclear! (-> obj mask) (process-mask actor-pause))
(go wedge-plat-master-idle)
(none)
)
;; definition of type wedge-plat
(deftype wedge-plat (baseplat)
((master wedge-plat-master :offset-assert 228)
(distance float :offset-assert 232)
(offset float :offset-assert 236)
)
:heap-base #x80
:method-count-assert 28
:size-assert #xf0
:flag-assert #x1c008000f0
(:methods
(dummy-27 (_type_) symbol 27)
)
)
;; failed to figure out what this is:
(let
((v1-3
(new 'static 'skeleton-group
:art-group-name "wedge-plat"
:bounds (new 'static 'vector :w 24576.0)
:version #x6
)
)
)
(set! (-> v1-3 jgeo) 0)
(set! (-> v1-3 janim) 2)
(set! (-> v1-3 mgeo 0) (the-as uint 1))
(set! (-> v1-3 lod-dist 0) 4095996000.0)
(set! *wedge-plat-sg* v1-3)
)
;; definition for method 27 of type wedge-plat
(defmethod dummy-27 wedge-plat ((obj wedge-plat))
(let* ((a0-1 (-> obj master))
(v1-0 (if a0-1
(-> (the-as process-drawable (-> a0-1 ppointer)) brother)
)
)
)
(when v1-0
(let ((s4-0 (&-> v1-0 27))
(f30-0 (-> obj distance))
(f28-0
(the
float
(sar
(shl (the int (+ (the-as float (-> v1-0 32)) (-> obj offset))) 48)
48
)
)
)
(s5-0 #f)
)
(quaternion-axis-angle!
(-> obj root-override quat)
0.0
1.0
0.0
(the float (sar (shl (the int (- 49152.0 f28-0)) 48) 48))
)
(set!
(-> obj basetrans x)
(+ (the-as float (-> s4-0 0)) (* f30-0 (cos f28-0)))
)
(set! (-> obj basetrans y) (the-as float (-> s4-0 1)))
(set!
(-> obj basetrans z)
(+ (the-as float (-> s4-0 2)) (* f30-0 (sin f28-0)))
)
(let ((f0-16 (cos f28-0)))
(if (or (< 0.95 f0-16) (< f0-16 -0.95))
(set! s5-0 #t)
)
)
s5-0
)
)
)
)
;; failed to figure out what this is:
(defstate wedge-plat-idle (wedge-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (if (= v1-0 'bonk)
(dummy-22 self)
)
)
)
)
:trans
(the-as (function none :behavior wedge-plat) plat-trans)
:code
(behavior ()
(let ((gp-0 (-> self skel root-channel 0)))
(set! (-> gp-0 num-func) num-func-identity)
(set! (-> gp-0 frame-num) (ja-aframe 0.0 0))
)
(while #t
(if (dummy-27 self)
(go wedge-plat-tip)
)
(suspend)
)
(none)
)
:post
(the-as (function none :behavior wedge-plat) plat-post)
)
;; failed to figure out what this is:
(defstate wedge-plat-tip (wedge-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'bonk)
(dummy-22 self)
)
((= v1-0 'touch)
(let ((a1-4 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-4 from) self)
(set! (-> a1-4 num-params) 1)
(set! (-> a1-4 message) 'no-look-around)
(set! (-> a1-4 param 0) (the-as uint 450))
(send-event-function arg0 a1-4)
)
#f
)
)
)
)
)
:trans
(the-as (function none :behavior wedge-plat) plat-trans)
:code
(behavior ()
(let ((gp-0 (-> self skel root-channel 0)))
(set!
(-> gp-0 frame-group)
(the-as art-joint-anim (-> self draw art-group data 3))
)
(set! (-> gp-0 param 0) (ja-aframe 60.0 0))
(set! (-> gp-0 param 1) 1.0)
(set! (-> gp-0 frame-num) (ja-aframe 0.0 0))
(joint-control-channel-group!
gp-0
(the-as art-joint-anim (-> self draw art-group data 3))
num-func-seek!
)
)
(until (ja-done? 0)
(dummy-27 self)
(suspend)
(let ((gp-1 (-> self skel root-channel 0)))
(set! (-> gp-1 param 0) (ja-aframe 60.0 0))
(set! (-> gp-1 param 1) 1.0)
(joint-control-channel-group-eval!
gp-1
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
(let ((gp-2 (-> self skel root-channel 0)))
(set!
(-> gp-2 frame-group)
(the-as art-joint-anim (-> self draw art-group data 3))
)
(set! (-> gp-2 param 0) (ja-aframe 100.0 0))
(set! (-> gp-2 param 1) 1.0)
(set! (-> gp-2 frame-num) (ja-aframe 60.0 0))
(joint-control-channel-group!
gp-2
(the-as art-joint-anim (-> self draw art-group data 3))
num-func-seek!
)
)
(until (ja-done? 0)
(dummy-27 self)
(suspend)
(let ((gp-3 (-> self skel root-channel 0)))
(set! (-> gp-3 param 0) (ja-aframe 100.0 0))
(set! (-> gp-3 param 1) 1.0)
(joint-control-channel-group-eval!
gp-3
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
(set!
(-> self state-time)
(the-as seconds (-> *display* base-frame-counter))
)
(until
(>=
(- (-> *display* base-frame-counter) (the-as int (-> self state-time)))
300
)
(let ((gp-4 (-> self skel root-channel 0)))
(set! (-> gp-4 num-func) num-func-identity)
(set! (-> gp-4 frame-num) (ja-aframe 100.0 0))
)
(dummy-27 self)
(suspend)
)
(let ((gp-5 (-> self skel root-channel 0)))
(set!
(-> gp-5 frame-group)
(the-as art-joint-anim (-> self draw art-group data 3))
)
(set! (-> gp-5 param 0) (ja-aframe 153.0 0))
(set! (-> gp-5 param 1) 1.0)
(set! (-> gp-5 frame-num) (ja-aframe 100.0 0))
(joint-control-channel-group!
gp-5
(the-as art-joint-anim (-> self draw art-group data 3))
num-func-seek!
)
)
(until (ja-done? 0)
(dummy-27 self)
(suspend)
(let ((gp-6 (-> self skel root-channel 0)))
(set! (-> gp-6 param 0) (ja-aframe 153.0 0))
(set! (-> gp-6 param 1) 1.0)
(joint-control-channel-group-eval!
gp-6
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
(go wedge-plat-idle)
(none)
)
:post
(the-as (function none :behavior wedge-plat) plat-post)
)
;; definition for method 11 of type wedge-plat
(defmethod copy-defaults! wedge-plat ((obj wedge-plat) (arg0 res-lump))
(set! (-> obj mask) (logior (process-mask platform) (-> obj mask)))
(let
((s4-0
(new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player))
)
)
(set! (-> s4-0 dynam) (copy *standard-dynamics* 'process))
(set! (-> s4-0 reaction) default-collision-reaction)
(set! (-> s4-0 no-reaction) nothing)
(dummy-29 s4-0 1)
(let
((s3-0
(new
'process
'collide-shape-prim-mesh
s4-0
(the-as uint 0)
(the-as uint 0)
)
)
)
(set! (-> s3-0 prim-core collide-as) (the-as uint 2048))
(set! (-> s3-0 collide-with) (the-as uint 16))
(set! (-> s3-0 prim-core action) (the-as uint 3))
(set! (-> s3-0 prim-core offense) 4)
(set! (-> s3-0 transform-index) 3)
(set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 24576.0)
)
(dummy-46 s4-0)
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
(dummy-50 s4-0)
(set! (-> obj root-override) s4-0)
)
(process-drawable-from-entity! obj arg0)
(dummy-14 obj *wedge-plat-sg* '())
(logior! (-> obj skel status) 1)
(dummy-47 (-> obj root-override))
(dummy-21 obj)
(set!
(-> obj master)
(the-as wedge-plat-master (entity-actor-lookup arg0 'alt-actor 0))
)
(set! (-> obj offset) (res-lump-float arg0 'rotoffset))
(set! (-> obj distance) (res-lump-float arg0 'distance :default 36864.0))
(logclear! (-> obj mask) (process-mask actor-pause))
(go wedge-plat-idle)
(none)
)
;; definition of type wedge-plat-outer
(deftype wedge-plat-outer (wedge-plat)
()
:heap-base #x80
:method-count-assert 28
:size-assert #xf0
:flag-assert #x1c008000f0
)
;; failed to figure out what this is:
(let
((v1-7
(new 'static 'skeleton-group
:art-group-name "wedge-plat-outer"
:bounds (new 'static 'vector :w 32768.0)
:version #x6
)
)
)
(set! (-> v1-7 jgeo) 0)
(set! (-> v1-7 janim) 2)
(set! (-> v1-7 mgeo 0) (the-as uint 1))
(set! (-> v1-7 lod-dist 0) 4095996000.0)
(set! *wedge-plat-outer-sg* v1-7)
)
;; definition for method 27 of type wedge-plat-outer
(defmethod dummy-27 wedge-plat-outer ((obj wedge-plat-outer))
(let* ((a0-1 (-> obj master))
(v1-0 (if a0-1
(-> (the-as process-drawable (-> a0-1 ppointer)) brother)
)
)
)
(when v1-0
(let ((s4-0 (&-> v1-0 27))
(f30-0 (-> obj distance))
(f28-0
(the
float
(sar
(shl (the int (+ (the-as float (-> v1-0 33)) (-> obj offset))) 48)
48
)
)
)
(s5-0 #f)
)
(quaternion-axis-angle!
(-> obj root-override quat)
0.0
1.0
0.0
(the float (sar (shl (the int (- 49152.0 f28-0)) 48) 48))
)
(set!
(-> obj basetrans x)
(+ (the-as float (-> s4-0 0)) (* f30-0 (cos f28-0)))
)
(set! (-> obj basetrans y) (the-as float (-> s4-0 1)))
(set!
(-> obj basetrans z)
(+ (the-as float (-> s4-0 2)) (* f30-0 (sin f28-0)))
)
(let ((f0-16 (sin f28-0)))
(if (or (< 0.95 f0-16) (< f0-16 -0.95))
(set! s5-0 #t)
)
)
s5-0
)
)
)
)
;; failed to figure out what this is:
(defstate wedge-plat-outer-idle (wedge-plat-outer)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (if (= v1-0 'bonk)
(dummy-22 self)
)
)
)
)
:trans
(the-as (function none :behavior wedge-plat-outer) plat-trans)
:code
(behavior ()
(while #t
(let ((gp-0 (-> self skel root-channel 0)))
(set! (-> gp-0 num-func) num-func-identity)
(set! (-> gp-0 frame-num) (ja-aframe 0.0 0))
)
(if (dummy-27 self)
(go wedge-plat-outer-tip)
)
(suspend)
)
(none)
)
:post
(the-as (function none :behavior wedge-plat-outer) plat-post)
)
;; failed to figure out what this is:
(defstate wedge-plat-outer-tip (wedge-plat-outer)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'bonk)
(dummy-22 self)
)
((= v1-0 'touch)
(let ((a1-4 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-4 from) self)
(set! (-> a1-4 num-params) 1)
(set! (-> a1-4 message) 'no-look-around)
(set! (-> a1-4 param 0) (the-as uint 450))
(send-event-function arg0 a1-4)
)
)
)
)
)
)
:trans
(the-as (function none :behavior wedge-plat-outer) plat-trans)
:code
(behavior ()
(let ((gp-0 (-> self skel root-channel 0)))
(set!
(-> gp-0 frame-group)
(the-as art-joint-anim (-> self draw art-group data 3))
)
(set! (-> gp-0 param 0) (ja-aframe 60.0 0))
(set! (-> gp-0 param 1) 1.0)
(set! (-> gp-0 frame-num) (ja-aframe 0.0 0))
(joint-control-channel-group!
gp-0
(the-as art-joint-anim (-> self draw art-group data 3))
num-func-seek!
)
)
(until (ja-done? 0)
(dummy-27 self)
(suspend)
(let ((gp-1 (-> self skel root-channel 0)))
(set! (-> gp-1 param 0) (ja-aframe 60.0 0))
(set! (-> gp-1 param 1) 1.0)
(joint-control-channel-group-eval!
gp-1
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
(let ((gp-2 (-> self skel root-channel 0)))
(set!
(-> gp-2 frame-group)
(the-as art-joint-anim (-> self draw art-group data 3))
)
(set! (-> gp-2 param 0) (ja-aframe 100.0 0))
(set! (-> gp-2 param 1) 1.0)
(set! (-> gp-2 frame-num) (ja-aframe 60.0 0))
(joint-control-channel-group!
gp-2
(the-as art-joint-anim (-> self draw art-group data 3))
num-func-seek!
)
)
(until (ja-done? 0)
(dummy-27 self)
(suspend)
(let ((gp-3 (-> self skel root-channel 0)))
(set! (-> gp-3 param 0) (ja-aframe 100.0 0))
(set! (-> gp-3 param 1) 1.0)
(joint-control-channel-group-eval!
gp-3
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
(set!
(-> self state-time)
(the-as seconds (-> *display* base-frame-counter))
)
(until
(>=
(- (-> *display* base-frame-counter) (the-as int (-> self state-time)))
300
)
(let ((gp-4 (-> self skel root-channel 0)))
(set! (-> gp-4 num-func) num-func-identity)
(set! (-> gp-4 frame-num) (ja-aframe 100.0 0))
)
(dummy-27 self)
(suspend)
)
(let ((gp-5 (-> self skel root-channel 0)))
(set!
(-> gp-5 frame-group)
(the-as art-joint-anim (-> self draw art-group data 3))
)
(set! (-> gp-5 param 0) (ja-aframe 153.0 0))
(set! (-> gp-5 param 1) 1.0)
(set! (-> gp-5 frame-num) (ja-aframe 100.0 0))
(joint-control-channel-group!
gp-5
(the-as art-joint-anim (-> self draw art-group data 3))
num-func-seek!
)
)
(until (ja-done? 0)
(dummy-27 self)
(suspend)
(let ((gp-6 (-> self skel root-channel 0)))
(set! (-> gp-6 param 0) (ja-aframe 153.0 0))
(set! (-> gp-6 param 1) 1.0)
(joint-control-channel-group-eval!
gp-6
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
(go wedge-plat-outer-idle)
(none)
)
:post
(the-as (function none :behavior wedge-plat-outer) plat-post)
)
;; definition for method 11 of type wedge-plat-outer
(defmethod
copy-defaults!
wedge-plat-outer
((obj wedge-plat-outer) (arg0 res-lump))
(set! (-> obj mask) (logior (process-mask platform) (-> obj mask)))
(let
((s4-0
(new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player))
)
)
(set! (-> s4-0 dynam) (copy *standard-dynamics* 'process))
(set! (-> s4-0 reaction) default-collision-reaction)
(set! (-> s4-0 no-reaction) nothing)
(dummy-29 s4-0 1)
(let
((s3-0
(new
'process
'collide-shape-prim-mesh
s4-0
(the-as uint 0)
(the-as uint 0)
)
)
)
(set! (-> s3-0 prim-core collide-as) (the-as uint 2048))
(set! (-> s3-0 collide-with) (the-as uint 16))
(set! (-> s3-0 prim-core action) (the-as uint 19))
(set! (-> s3-0 prim-core offense) 4)
(set! (-> s3-0 transform-index) 3)
(set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 32768.0)
)
(dummy-46 s4-0)
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
(dummy-50 s4-0)
(set! (-> obj root-override) s4-0)
)
(process-drawable-from-entity! obj arg0)
(dummy-14 obj *wedge-plat-sg* '())
(logior! (-> obj skel status) 1)
(dummy-47 (-> obj root-override))
(dummy-21 obj)
(set!
(-> obj master)
(the-as wedge-plat-master (entity-actor-lookup arg0 'alt-actor 0))
)
(set! (-> obj offset) (res-lump-float arg0 'rotoffset))
(set! (-> obj distance) (res-lump-float arg0 'distance :default 69632.0))
(logclear! (-> obj mask) (process-mask actor-pause))
(go wedge-plat-outer-idle)
(none)
)
+10 -3
View File
@@ -7,7 +7,7 @@ parser.add_argument("--file")
parser.add_argument("--list", type=int)
args = parser.parse_args()
def update_file(file):
def update_file(file, hack):
new_file_contents = []
print("Next file to decompile is - " + file[0])
print("Target is - " + "goal_src/" + file[4] + "/" + file[0] + ".gc")
@@ -16,8 +16,10 @@ def update_file(file):
with open("decompiler\config\jak1_ntsc_black_label.jsonc", "r") as config_file:
cfg_lines = config_file.readlines()
for line in cfg_lines:
if "allowed_objects" in line:
if "allowed_objects" in line and hack == False:
line = " \"allowed_objects\": [\"" + file[0] + "\"],\n"
elif "allowed_objects" in line and hack == True:
line = " \"allowed_objects\": [\"" + file[1] + "\"],\n"
new_file_contents.append(line)
if len(new_file_contents) > 0:
with open("decompiler\config\jak1_ntsc_black_label.jsonc", "w") as f:
@@ -27,7 +29,12 @@ def update_file(file):
if args.file:
for file in file_list:
if file[0] == args.file:
update_file(file)
update_file(file, False)
break
elif file[1] == args.file:
# NOTE - kinda a hack, assumes -ag files always come after
update_file(file, True)
break
else:
list_eligible = []
for file in file_list:
@@ -156,8 +156,8 @@
;; definition of type overlaps-others-params
(deftype overlaps-others-params (structure)
((options uint32 :offset-assert 0)
(tlist basic :offset-assert 4)
((options uint32 :offset-assert 0)
(tlist touching-list :offset-assert 4)
)
:method-count-assert 9
:size-assert #x8
@@ -418,7 +418,7 @@
(dummy-37 () none 37)
(dummy-38 () none 38)
(dummy-39 () none 39)
(dummy-40 (_type_ collide-edge-hold-list) none 40)
(dummy-40 (_type_ structure) none 40)
(dummy-41 () none 41)
(dummy-42 () none 42)
(dummy-43 () none 43)
@@ -18,7 +18,7 @@
(set-zero! (_type_) _type_ 9)
(update! (_type_) float 10)
(get-no-update (_type_) float 11)
(activate! (_type_ float int int float float float) _type_ 12)
(activate! (_type_ float int int float float) _type_ 12)
(nonzero-amplitude? (_type_) symbol 13)
(die-on-next-update! (_type_) _type_ 14)
)
@@ -128,7 +128,6 @@
(arg2 int)
(arg3 float)
(arg4 float)
(arg5 float)
)
(when (>= (fabs (* 0.2 (-> obj amp))) (fabs (get-no-update obj)))
(set! (-> obj amp) arg0)
@@ -6,6 +6,7 @@
((offset float :offset-assert 0)
(period uint32 :offset-assert 4)
)
:pack-me
:method-count-assert 18
:size-assert #x8
:flag-assert #x1200000008
@@ -0,0 +1,944 @@
;;-*-Lisp-*-
(in-package goal)
;; failed to figure out what this is:
(let
((v1-0
(new 'static 'skeleton-group
:art-group-name "citb-drop-plat"
:bounds (new 'static 'vector :w 12288.0)
:max-lod 1
:version #x6
)
)
)
(set! (-> v1-0 jgeo) 0)
(set! (-> v1-0 janim) 3)
(set! (-> v1-0 mgeo 0) (the-as uint 1))
(set! (-> v1-0 lod-dist 0) 81920.0)
(set! (-> v1-0 mgeo 1) (the-as uint 2))
(set! (-> v1-0 lod-dist 1) 4095996000.0)
(set! *citb-drop-plat-sg* v1-0)
)
;; failed to figure out what this is:
(let
((v1-1
(new 'static 'skeleton-group
:art-group-name "citb-drop-plat"
:bounds (new 'static 'vector :w 12288.0)
:max-lod 1
:version #x6
)
)
)
(set! (-> v1-1 jgeo) 4)
(set! (-> v1-1 janim) 7)
(set! (-> v1-1 mgeo 0) (the-as uint 5))
(set! (-> v1-1 lod-dist 0) 81920.0)
(set! (-> v1-1 mgeo 1) (the-as uint 6))
(set! (-> v1-1 lod-dist 1) 4095996000.0)
(set! *citb-drop-plat-red-sg* v1-1)
)
;; failed to figure out what this is:
(let
((v1-2
(new 'static 'skeleton-group
:art-group-name "citb-drop-plat"
:bounds (new 'static 'vector :w 12288.0)
:max-lod 1
:version #x6
)
)
)
(set! (-> v1-2 jgeo) 8)
(set! (-> v1-2 janim) 11)
(set! (-> v1-2 mgeo 0) (the-as uint 9))
(set! (-> v1-2 lod-dist 0) 81920.0)
(set! (-> v1-2 mgeo 1) (the-as uint 10))
(set! (-> v1-2 lod-dist 1) 4095996000.0)
(set! *citb-drop-plat-green-sg* v1-2)
)
;; failed to figure out what this is:
(let
((v1-3
(new 'static 'skeleton-group
:art-group-name "citb-drop-plat"
:bounds (new 'static 'vector :w 12288.0)
:max-lod 1
:version #x6
)
)
)
(set! (-> v1-3 jgeo) 12)
(set! (-> v1-3 janim) 15)
(set! (-> v1-3 mgeo 0) (the-as uint 13))
(set! (-> v1-3 lod-dist 0) 81920.0)
(set! (-> v1-3 mgeo 1) (the-as uint 14))
(set! (-> v1-3 lod-dist 1) 4095996000.0)
(set! *citb-drop-plat-blue-sg* v1-3)
)
;; failed to figure out what this is:
(let
((v1-4
(new 'static 'skeleton-group
:art-group-name "citb-drop-plat"
:bounds (new 'static 'vector :w 12288.0)
:max-lod 1
:version #x6
)
)
)
(set! (-> v1-4 jgeo) 16)
(set! (-> v1-4 janim) 19)
(set! (-> v1-4 mgeo 0) (the-as uint 17))
(set! (-> v1-4 lod-dist 0) 81920.0)
(set! (-> v1-4 mgeo 1) (the-as uint 18))
(set! (-> v1-4 lod-dist 1) 4095996000.0)
(set! *citb-drop-plat-yellow-sg* v1-4)
)
;; definition of type drop-plat
(deftype drop-plat (process-drawable)
((root-override collide-shape-moving :offset 112)
(spin-axis vector :inline :offset-assert 176)
(spin-angle float :offset-assert 192)
(spin-speed float :offset-assert 196)
(interp float :offset-assert 200)
(duration uint64 :offset-assert 208)
(delay uint64 :offset-assert 216)
(color int8 :offset-assert 224)
)
:heap-base #x80
:method-count-assert 22
:size-assert #xe1
:flag-assert #x16008000e1
(:methods
(TODO-RENAME-20 (_type_) none 20)
(dummy-21 (_type_) none 21)
)
)
;; definition for method 3 of type drop-plat
(defmethod inspect drop-plat ((obj drop-plat))
(let ((t9-0 (method-of-type process-drawable inspect)))
(t9-0 obj)
)
(format #t "~T~Tspin-axis: #<vector @ #x~X>~%" (-> obj spin-axis))
(format #t "~T~Tspin-angle: ~f~%" (-> obj spin-angle))
(format #t "~T~Tspin-speed: ~f~%" (-> obj spin-speed))
(format #t "~T~Tinterp: ~f~%" (-> obj interp))
(format #t "~T~Tduration: ~D~%" (-> obj duration))
(format #t "~T~Tdelay: ~D~%" (-> obj delay))
(format #t "~T~Tcolor: ~D~%" (-> obj color))
obj
)
;; failed to figure out what this is:
(defstate drop-plat-idle (drop-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'drop)
(logclear! (-> self mask) (process-mask actor-pause))
(go drop-plat-drop)
)
((or (= v1-0 'touch) (= v1-0 'attack))
(let ((a1-2 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-2 from) self)
(set! (-> a1-2 num-params) 1)
(set! (-> a1-2 message) 'no-look-around)
(set! (-> a1-2 param 0) (the-as uint 300))
(send-event-function *target* a1-2)
)
(let ((a1-3 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-3 from) self)
(set! (-> a1-3 num-params) 1)
(set! (-> a1-3 message) 'player-stepped)
(set! (-> a1-3 param 0) (the-as uint (-> self color)))
(send-event-function
(ppointer->process (-> self parent))
a1-3
)
)
#f
)
)
)
)
)
:code
(behavior ()
(suspend)
(dummy-47 (-> self root-override))
(set!
(-> self state-time)
(the-as seconds (-> *display* base-frame-counter))
)
(logior! (-> self mask) (process-mask actor-pause))
(while #t
(if
(>=
(- (-> *display* base-frame-counter) (the-as int (-> self state-time)))
(the-as int (-> self duration))
)
(go drop-plat-drop)
)
(suspend)
)
(none)
)
:post
(the-as (function none :behavior drop-plat) ja-post)
)
;; definition for function drop-plat-set-fade
;; INFO: Return type mismatch int vs none.
(defbehavior drop-plat-set-fade drop-plat ()
(let
((f0-1
(fmin
1.0
(*
0.000012207031
(-
(-> self root-override trans y)
(+
-204800.0
(-> (the-as process-drawable (-> self parent 0)) root trans y)
)
)
)
)
)
)
(set-vector! (-> self draw color-mult) f0-1 f0-1 f0-1 1.0)
)
0
(none)
)
;; failed to figure out what this is:
(defstate drop-plat-spawn (drop-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (if (= v1-0 'drop)
(go drop-plat-die)
)
)
)
)
:code
(behavior ()
(set!
(-> self root-override trans y)
(+ -204800.0 (-> (the-as process-drawable (-> self parent 0)) root trans y))
)
(logior! (-> self draw status) 2)
(ja-post)
(set!
(-> self state-time)
(the-as seconds (-> *display* base-frame-counter))
)
(while #t
(when
(>=
(- (-> *display* base-frame-counter) (the-as int (-> self state-time)))
(the-as int (-> self delay))
)
(let ((v1-14 (logand -3 (-> self draw status)))
(a0-5 (-> self draw))
)
(set! (-> a0-5 status) v1-14)
(go drop-plat-rise a0-5)
)
)
(suspend)
)
(none)
)
)
;; failed to figure out what this is:
(defstate drop-plat-rise (drop-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (if (= v1-0 'drop)
(go drop-plat-drop)
)
)
)
)
:code
(behavior ((arg0 draw-control))
(set! (-> self interp) 1.0)
(set!
(-> self state-time)
(the-as seconds (-> *display* base-frame-counter))
)
(set! (-> self spin-angle) 0.0)
(set!
(-> self root-override trans y)
(+ -204800.0 (-> (the-as process-drawable (-> self parent 0)) root trans y))
)
(let ((gp-0 (new 'stack-no-clear 'vector))
(s5-0 #f)
)
(set! (-> gp-0 quad) (-> self root-override trans quad))
(set!
(-> gp-0 y)
(-> (the-as process-drawable (-> self parent 0)) root trans y)
)
(while #t
(let
((f0-6
(fmax
0.0
(-
1.0
(*
0.0033333334
(the
float
(-
(-> *display* base-frame-counter)
(the-as int (-> self state-time))
)
)
)
)
)
)
)
(set! (-> self interp) (* f0-6 f0-6))
)
(set!
(-> self root-override trans y)
(-
(-> (the-as process-drawable (-> self parent 0)) root trans y)
(* 204800.0 (-> self interp))
)
)
(when (and (not s5-0) (< (-> self interp) 0.05))
(set! s5-0 #t)
(sound-play-by-name
(static-sound-name "bridge-piece-up")
(new-sound-id)
1024
0
0
(the-as uint 1)
gp-0
)
)
(set! (-> self spin-angle) (* 10.0 (-> self spin-speed) (-> self interp)))
(if
(=
(-> (the-as process-drawable (-> self parent 0)) root trans y)
(-> self root-override trans y)
)
(go drop-plat-idle)
)
(suspend)
)
)
(none)
)
:post
(behavior ()
(let ((gp-0 (new 'stack-no-clear 'quaternion)))
(quaternion-vector-angle! gp-0 (-> self spin-axis) (-> self spin-angle))
(quaternion*!
(-> self root-override quat)
(-> (the-as process-drawable (-> self parent 0)) root quat)
gp-0
)
)
(drop-plat-set-fade)
(transform-post)
(none)
)
)
;; failed to figure out what this is:
(defstate drop-plat-drop (drop-plat)
:code
(behavior ()
(when
(=
(-> (the-as process-drawable (-> self parent 0)) root trans y)
(-> self root-override trans y)
)
(set!
(-> self state-time)
(the-as seconds (-> *display* base-frame-counter))
)
(sound-play-by-name
(static-sound-name "bridge-piece-dn")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(let ((gp-1 (the int (* 300.0 (rand-vu-float-range 0.2 0.3)))))
(while
(<
(- (-> *display* base-frame-counter) (the-as int (-> self state-time)))
gp-1
)
(set!
(-> self interp)
(/
(the
float
(- (-> *display* base-frame-counter) (the-as int (-> self state-time)))
)
(the float gp-1)
)
)
(set!
(-> self spin-angle)
(* 910.2222 (sin (* 196608.0 (-> self interp))))
)
(suspend)
)
)
)
(while #t
(vector-v++!
(-> self root-override transv)
(dummy-62 (-> self root-override) (new-stack-vector0) 0.0)
)
(vector-v++! (-> self root-override trans) (-> self root-override transv))
(if
(<
204800.0
(-
(-> (the-as process-drawable (-> self parent 0)) root trans y)
(-> self root-override trans y)
)
)
(go drop-plat-die)
)
(+!
(-> self spin-angle)
(* (-> self spin-speed) (-> *display* seconds-per-frame))
)
(suspend)
)
(none)
)
:post
(behavior ()
(let ((gp-0 (new 'stack-no-clear 'quaternion)))
(quaternion-vector-angle! gp-0 (-> self spin-axis) (-> self spin-angle))
(quaternion*!
(-> self root-override quat)
(-> (the-as process-drawable (-> self parent 0)) root quat)
gp-0
)
)
(drop-plat-set-fade)
(transform-post)
(none)
)
)
;; failed to figure out what this is:
(defstate drop-plat-die (drop-plat)
:code
(behavior ()
(dummy-18 self)
(none)
)
)
;; definition for method 20 of type drop-plat
;; INFO: Return type mismatch int vs none.
(defmethod TODO-RENAME-20 drop-plat ((obj drop-plat))
(let
((s5-0
(new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player))
)
)
(set! (-> s5-0 dynam) (copy *standard-dynamics* 'process))
(set! (-> s5-0 reaction) default-collision-reaction)
(set! (-> s5-0 no-reaction) nothing)
(dummy-29 s5-0 1)
(let
((s4-0
(new
'process
'collide-shape-prim-mesh
s5-0
(the-as uint 0)
(the-as uint 0)
)
)
)
(set! (-> s4-0 prim-core collide-as) (the-as uint 2048))
(set! (-> s4-0 collide-with) (the-as uint 16))
(set! (-> s4-0 prim-core action) (the-as uint 3))
(set! (-> s4-0 prim-core offense) 4)
(set! (-> s4-0 transform-index) 0)
(set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 12288.0)
)
(dummy-46 s5-0)
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
(dummy-50 s5-0)
(set! (-> obj root-override) s5-0)
)
0
(none)
)
;; definition for method 21 of type drop-plat
;; INFO: Return type mismatch int vs none.
(defmethod dummy-21 drop-plat ((obj drop-plat))
(case (-> obj color)
((1)
(dummy-14 obj *citb-drop-plat-red-sg* '())
)
((2)
(dummy-14 obj *citb-drop-plat-green-sg* '())
)
((3)
(dummy-14 obj *citb-drop-plat-blue-sg* '())
)
((4)
(dummy-14 obj *citb-drop-plat-yellow-sg* '())
)
(else
(dummy-14 obj *citb-drop-plat-sg* '())
)
)
(logclear! (-> obj mask) (process-mask actor-pause))
(let ((s3-0 (new 'stack-no-clear 'vector))
(s5-0 (new 'stack-no-clear 'vector))
(s4-0 (new 'stack-no-clear 'vector))
)
(set! (-> s3-0 x) (* 65536.0 (rand-vu)))
(let ((f30-1 14563.556)
(f0-2 (rand-vu-float-range -1.0 1.0))
)
(set! (-> s3-0 y) (* f30-1 (* f0-2 f0-2)))
)
(vector-sincos! s5-0 s4-0 s3-0)
(set! (-> obj spin-axis x) (* (-> s4-0 y) (-> s4-0 x)))
(set! (-> obj spin-axis y) (-> s5-0 y))
(set! (-> obj spin-axis z) (* (-> s4-0 y) (-> s5-0 x)))
)
(set! (-> obj spin-axis w) 1.0)
(set! (-> obj spin-angle) 0.0)
(set! (-> obj spin-speed) (* 8192.0 (+ 1.0 (rand-vu))))
0
(none)
)
;; definition for function drop-plat-init-by-other
;; Used lq/sq
(defbehavior
drop-plat-init-by-other drop-plat
((arg0 vector) (arg1 uint) (arg2 uint) (arg3 int))
(set! (-> self color) arg3)
(set! (-> self delay) arg1)
(set! (-> self duration) arg2)
(TODO-RENAME-20 self)
(set! (-> self root-override trans quad) (-> arg0 quad))
(vector-identity! (-> self root-override scale))
(quaternion-copy!
(-> self root-override quat)
(-> (the-as process-drawable (-> self parent 0)) root quat)
)
(dummy-21 self)
(go drop-plat-spawn)
(none)
)
;; definition of type handle-inline-array
(deftype handle-inline-array (inline-array-class)
((data handle :dynamic :offset-assert 16)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
;; definition for method 3 of type handle-inline-array
(defmethod inspect handle-inline-array ((obj handle-inline-array))
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~Tlength: ~D~%" (-> obj length))
(format #t "~Tallocated-length: ~D~%" (-> obj allocated-length))
(format #t "~Tdata[0] @ #x~X~%" (-> obj data))
obj
)
;; failed to figure out what this is:
(set! (-> handle-inline-array heap-base) (the-as uint 8))
;; definition of type citb-drop-plat
(deftype citb-drop-plat (process-drawable)
((x-count int32 :offset-assert 176)
(z-count int32 :offset-assert 180)
(child-count int32 :offset-assert 184)
(child-array handle-inline-array :offset-assert 188)
(child-color-array (pointer int8) :offset-assert 192)
(x-dir vector :inline :offset-assert 208)
(z-dir vector :inline :offset-assert 224)
(origin vector :inline :offset-assert 240)
(x-spacing float :offset-assert 256)
(z-spacing float :offset-assert 260)
(idle-distance float :offset-assert 264)
(duration uint64 :offset-assert 272)
(drop-time uint64 :offset-assert 280)
)
:heap-base #xb0
:method-count-assert 20
:size-assert #x120
:flag-assert #x1400b00120
)
;; definition for method 3 of type citb-drop-plat
(defmethod inspect citb-drop-plat ((obj citb-drop-plat))
(let ((t9-0 (method-of-type process-drawable inspect)))
(t9-0 obj)
)
(format #t "~T~Tx-count: ~D~%" (-> obj x-count))
(format #t "~T~Tz-count: ~D~%" (-> obj z-count))
(format #t "~T~Tchild-count: ~D~%" (-> obj child-count))
(format #t "~T~Tchild-array: ~A~%" (-> obj child-array))
(format #t "~T~Tchild-color-array: #x~X~%" (-> obj child-color-array))
(format #t "~T~Tx-dir: #<vector @ #x~X>~%" (-> obj x-dir))
(format #t "~T~Tz-dir: #<vector @ #x~X>~%" (-> obj z-dir))
(format #t "~T~Torigin: #<vector @ #x~X>~%" (-> obj origin))
(format #t "~T~Tx-spacing: ~f~%" (-> obj x-spacing))
(format #t "~T~Tz-spacing: ~f~%" (-> obj z-spacing))
(format #t "~T~Tidle-distance: ~f~%" (-> obj idle-distance))
(format #t "~T~Tduration: ~D~%" (-> obj duration))
(format #t "~T~Tdrop-time: ~D~%" (-> obj drop-time))
obj
)
;; definition for method 7 of type citb-drop-plat
;; INFO: Return type mismatch process-drawable vs citb-drop-plat.
(defmethod relocate citb-drop-plat ((obj citb-drop-plat) (arg0 int))
(if (nonzero? (-> obj child-array))
(&+! (-> obj child-array) arg0)
)
(the-as citb-drop-plat ((method-of-type process-drawable relocate) obj arg0))
)
;; definition for function citb-drop-plat-spawn-children
;; INFO: Return type mismatch int vs none.
;; Used lq/sq
(defbehavior citb-drop-plat-spawn-children citb-drop-plat ()
(local-vars (s0-0 int) (sv-48 process) (sv-64 int))
(let ((gp-0 (new 'stack-no-clear 'vector)))
6
0
(let ((s5-0 0)
(s4-0 1)
)
(when
(<
0.0
(vector-dot
(vector-!
(new 'stack-no-clear 'vector)
(target-pos 0)
(-> self root trans)
)
(-> self z-dir)
)
)
(set! s5-0 (+ (-> self z-count) -1))
(set! s4-0 -1)
)
(dotimes (s3-2 (-> self z-count))
(dotimes (s2-0 (-> self x-count))
(let ((s1-0 (+ s2-0 (* s5-0 (-> self x-count)))))
(set! (-> gp-0 quad) (-> self origin quad))
(vector+*!
gp-0
gp-0
(-> self x-dir)
(* (-> self x-spacing) (the float s2-0))
)
(vector+*!
gp-0
gp-0
(-> self z-dir)
(* (-> self z-spacing) (the float s5-0))
)
(if (-> self child-color-array)
(set! s0-0 (-> self child-color-array s1-0))
(set! s0-0 (rand-vu-int-range 0 5))
)
(when (nonzero? s0-0)
(set! sv-64 (the int (* 150.0 (rand-vu))))
(set! sv-48 (get-process *default-dead-pool* drop-plat #x4000))
(set! (-> self child-array data s1-0) (ppointer->handle (when sv-48
(let
((t9-6
(method-of-type
drop-plat
activate
)
)
)
(t9-6
(the-as
drop-plat
sv-48
)
self
'drop-plat
(the-as
pointer
#x70004000
)
)
)
(let
((t9-7
run-function-in-process
)
(a0-8 sv-48)
(a1-5
drop-plat-init-by-other
)
(a2-4 gp-0)
(t0-0
(->
self
duration
)
)
)
((the-as
(function process function vector uint uint int)
t9-7
)
a0-8
a1-5
a2-4
(the-as
uint
sv-64
)
t0-0
)
)
(->
sv-48
ppointer
)
)
)
)
)
)
)
(let ((s2-1 (-> *display* base-frame-counter)))
(until (>= (- (-> *display* base-frame-counter) s2-1) 36)
(suspend)
)
)
(+! s5-0 s4-0)
)
)
)
(set! (-> self drop-time) (the-as uint (-> *display* base-frame-counter)))
0
(none)
)
;; definition for function citb-drop-plat-drop-all-children
(defbehavior citb-drop-plat-drop-all-children citb-drop-plat ()
(dotimes (gp-0 (-> self child-count))
(let ((a1-0 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-0 from) self)
(set! (-> a1-0 num-params) 0)
(set! (-> a1-0 message) 'drop)
(send-event-function (handle->process (-> self child-array data gp-0)) a1-0)
)
(set! (-> self child-array data gp-0) (the-as handle #f))
)
#f
)
;; definition for function citb-drop-plat-drop-children
;; INFO: Return type mismatch int vs none.
(defbehavior citb-drop-plat-drop-children citb-drop-plat ((arg0 int))
(cond
((= arg0 6)
)
(else
(dotimes (s5-0 (-> self child-count))
(let ((a0-3 (handle->process (-> self child-array data s5-0))))
(when
(and
a0-3
(!= (-> (the-as drop-plat a0-3) color) 6)
(= arg0 (-> (the-as drop-plat a0-3) color))
)
(let ((a1-2 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-2 from) self)
(set! (-> a1-2 num-params) 0)
(set! (-> a1-2 message) 'drop)
(send-event-function a0-3 a1-2)
)
(set! (-> self child-array data s5-0) (the-as handle #f))
)
)
)
)
)
0
(none)
)
;; failed to figure out what this is:
(defstate citb-drop-plat-idle (citb-drop-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (if (= v1-0 'trigger)
(go citb-drop-plat-active)
)
)
)
)
:code
(behavior ()
(citb-drop-plat-drop-all-children)
(while #t
(suspend)
)
(none)
)
)
;; failed to figure out what this is:
(defstate citb-drop-plat-active (citb-drop-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'player-stepped)
(when
(>=
(-
(-> *display* base-frame-counter)
(the-as int (-> self drop-time))
)
60
)
(set!
(-> self drop-time)
(the-as uint (-> *display* base-frame-counter))
)
(citb-drop-plat-drop-children
(the-as int (-> arg3 param 0))
)
)
)
((= v1-0 'trigger)
(go citb-drop-plat-idle)
)
)
)
)
)
:code
(behavior ()
(set!
(-> self state-time)
(the-as seconds (-> *display* base-frame-counter))
)
(citb-drop-plat-spawn-children)
(while #t
(if
(or
(>=
(- (-> *display* base-frame-counter) (the-as int (-> self state-time)))
(the-as int (+ (-> self duration) 600))
)
(or
(not *target*)
(<
(-> self idle-distance)
(vector-vector-distance
(-> self root trans)
(-> *target* control trans)
)
)
)
(not (-> self child))
)
(go citb-drop-plat-idle)
)
(suspend)
)
(none)
)
)
;; definition for method 11 of type citb-drop-plat
;; Used lq/sq
(defmethod copy-defaults! citb-drop-plat ((obj citb-drop-plat) (arg0 res-lump))
(set! (-> obj root) (new 'process 'trsqv))
(process-drawable-from-entity! obj arg0)
(let ((v1-2 (res-lump-data arg0 'count pointer)))
(when v1-2
(set! (-> obj x-count) (-> (the-as (pointer int32) v1-2) 0))
(set! (-> obj z-count) (-> (the-as (pointer int32) v1-2) 1))
)
)
(set! (-> obj child-count) (* (-> obj x-count) (-> obj z-count)))
(set!
(-> obj child-color-array)
(res-lump-data arg0 'plat-type (pointer int8))
)
(when (> (-> obj child-count) 0)
(set!
(-> obj child-array)
(new 'process 'handle-inline-array (-> obj child-count))
)
(dotimes (v1-9 (-> obj child-count))
(set! (-> obj child-array data v1-9) (the-as handle #f))
)
)
(set! (-> obj x-spacing) 16384.0)
(set! (-> obj z-spacing) 16384.0)
(set!
(-> obj idle-distance)
(+ 40960.0 (* 0.5 (the float (-> obj z-count)) (-> obj z-spacing)))
)
(set!
(-> obj duration)
(the-as uint (the int (* 300.0 (+ 2.0 (the float (-> obj z-count))))))
)
(let ((f0-7 (res-lump-float arg0 'rotoffset)))
(quaternion-rotate-y! (-> obj root quat) (-> obj root quat) f0-7)
)
(vector-x-quaternion! (-> obj x-dir) (-> obj root quat))
(vector-z-quaternion! (-> obj z-dir) (-> obj root quat))
(set! (-> obj origin quad) (-> obj root trans quad))
(let ((f0-10 (* -0.5 (the float (+ (-> obj x-count) -1)) (-> obj x-spacing)))
(f30-0 (* -0.5 (the float (+ (-> obj z-count) -1)) (-> obj z-spacing)))
)
(vector+*! (-> obj origin) (-> obj origin) (-> obj x-dir) f0-10)
(vector+*! (-> obj origin) (-> obj origin) (-> obj z-dir) f30-0)
)
(go citb-drop-plat-idle)
(none)
)
+579
View File
@@ -0,0 +1,579 @@
;;-*-Lisp-*-
(in-package goal)
;; definition of type baseplat
(deftype baseplat (process-drawable)
((root-override collide-shape-moving :offset 112)
(smush smush-control :inline :offset-assert 176)
(basetrans vector :inline :offset-assert 208)
(bouncing basic :offset-assert 224)
)
:heap-base #x80
:method-count-assert 27
:size-assert #xe4
:flag-assert #x1b008000e4
(:methods
(dummy-20 (_type_) none 20)
(dummy-21 (_type_) none 21)
(dummy-22 (_type_) none 22)
(TODO-RENAME-23 (_type_) skeleton-group 23)
(dummy-24 (_type_) none 24)
(TODO-RENAME-25 (_type_) sparticle-launch-group 25)
(dummy-26 (_type_) none 26)
)
)
;; definition for method 3 of type baseplat
(defmethod inspect baseplat ((obj baseplat))
(let ((t9-0 (method-of-type process-drawable inspect)))
(t9-0 obj)
)
(format #t "~T~Tsmush: #<smush-control @ #x~X>~%" (-> obj smush))
(format #t "~T~Tbasetrans: #<vector @ #x~X>~%" (-> obj basetrans))
(format #t "~T~Tbouncing: ~A~%" (-> obj bouncing))
obj
)
;; definition for method 21 of type baseplat
;; INFO: Return type mismatch int vs none.
;; Used lq/sq
(defmethod dummy-21 baseplat ((obj baseplat))
(logior! (-> obj skel status) 1)
(set! (-> obj basetrans quad) (-> obj root-override trans quad))
(set! (-> obj bouncing) #f)
0
(none)
)
;; definition for method 22 of type baseplat
;; INFO: Return type mismatch int vs none.
(defmethod dummy-22 baseplat ((obj baseplat))
(activate! (-> obj smush) -1.0 60 150 1.0 1.0)
(set! (-> obj bouncing) #t)
(logclear! (-> obj mask) (process-mask sleep))
(logclear! (-> obj mask) (process-mask sleep-code))
0
(none)
)
;; definition for function plat-code
(defbehavior plat-code baseplat ()
(transform-post)
(suspend)
(transform-post)
(suspend)
(while #t
(when (not (-> self bouncing))
(logior! (-> self mask) (process-mask sleep))
(suspend)
0
)
(while (-> self bouncing)
(suspend)
)
)
(none)
)
;; definition for function plat-trans
;; Used lq/sq
(defbehavior plat-trans baseplat ()
(rider-trans)
(cond
((-> self bouncing)
(let ((gp-0 (new 'stack-no-clear 'vector)))
(set! (-> gp-0 quad) (-> self basetrans quad))
(+! (-> gp-0 y) (* 819.2 (update! (-> self smush))))
(TODO-RENAME-30 (-> self root-override) gp-0)
)
(if (not (!= (-> self smush amp) 0.0))
(set! (-> self bouncing) #f)
)
)
(else
(TODO-RENAME-30 (-> self root-override) (-> self basetrans))
)
)
(none)
)
;; definition for function plat-post
;; INFO: Return type mismatch int vs none.
(defbehavior plat-post baseplat ()
(dummy-20 self)
(rider-post)
(none)
)
;; definition for method 25 of type baseplat
;; INFO: Return type mismatch int vs sparticle-launch-group.
(defmethod TODO-RENAME-25 baseplat ((obj baseplat))
(the-as sparticle-launch-group 0)
)
;; definition for method 20 of type baseplat
(defmethod dummy-20 baseplat ((obj baseplat))
(if (nonzero? (-> obj part))
(dummy-11 (-> obj part) (-> obj root-override trans))
)
(none)
)
;; definition for function plat-event
;; INFO: Return type mismatch none vs object.
(defbehavior
plat-event baseplat
((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (if (= v1-0 'bonk)
(dummy-22 self)
)
)
)
)
;; definition of type eco-door
(deftype eco-door (process-drawable)
((root-override collide-shape :offset 112)
(speed float :offset-assert 176)
(open-distance float :offset-assert 180)
(close-distance float :offset-assert 184)
(out-dir vector :inline :offset-assert 192)
(open-sound sound-name :offset-assert 208)
(close-sound sound-name :offset-assert 224)
(state-actor entity-actor :offset-assert 240)
(flags int32 :offset-assert 244)
(locked symbol :offset-assert 248)
(auto-close symbol :offset-assert 252)
(one-way symbol :offset-assert 256)
)
:heap-base #xa0
:method-count-assert 27
:size-assert #x104
:flag-assert #x1b00a00104
(:methods
(door-closed () _type_ :state 20)
(door-opening () _type_ :state 21)
(door-open () _type_ :state 22)
(door-closing () _type_ :state 23)
(TODO-RENAME-24 (_type_) none 24)
(TODO-RENAME-25 (_type_) none 25)
(dummy-26 (_type_) none 26)
)
)
;; definition for method 3 of type eco-door
;; Used lq/sq
(defmethod inspect eco-door ((obj eco-door))
(let ((t9-0 (method-of-type process-drawable inspect)))
(t9-0 obj)
)
(format #t "~T~Tspeed: ~f~%" (-> obj speed))
(format #t "~T~Topen-distance: ~f~%" (-> obj open-distance))
(format #t "~T~Tclose-distance: ~f~%" (-> obj close-distance))
(format #t "~T~Tout-dir: #<vector @ #x~X>~%" (-> obj out-dir))
(format #t "~T~Topen-sound: ~D~%" (-> obj open-sound))
(format #t "~T~Tclose-sound: ~D~%" (-> obj close-sound))
(format #t "~T~Tstate-actor: ~A~%" (-> obj state-actor))
(format #t "~T~Tflags: ~D~%" (-> obj flags))
(format #t "~T~Tlocked: ~A~%" (-> obj locked))
(format #t "~T~Tauto-close: ~A~%" (-> obj auto-close))
(format #t "~T~Tone-way: ~A~%" (-> obj one-way))
obj
)
;; definition for function eco-door-event-handler
;; INFO: Return type mismatch symbol vs object.
(defbehavior
eco-door-event-handler eco-door
((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (when (= v1-0 'trigger)
(set! (-> self locked) (not (-> self locked)))
(cond
((-> self locked)
(if (= (-> self next-state name) 'door-closed)
(sound-play-by-name
(static-sound-name "door-lock")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
)
)
(else
(sound-play-by-name
(static-sound-name "door-unlock")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
)
)
#t
)
)
)
)
;; failed to figure out what this is:
eco-door-event-handler
;; failed to figure out what this is:
(defstate door-closed (eco-door)
:virtual #t
:event
eco-door-event-handler
:code
(behavior ()
(let ((v1-2 (-> self skel root-channel 0)))
(set! (-> v1-2 num-func) num-func-identity)
(set! (-> v1-2 frame-num) 0.0)
)
(suspend)
(dummy-47 (-> self root-override))
(ja-post)
(while #t
(when
(and
*target*
(>=
(-> self open-distance)
(vector-vector-distance
(-> self root-override trans)
(-> *target* control trans)
)
)
)
(dummy-26 self)
(if
(and
(not (-> self locked))
(or
(and
(-> self entity)
(logtest?
(-> self entity extra perm status)
(entity-perm-status complete)
)
)
(let ((a1-1 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-1 from) self)
(set! (-> a1-1 num-params) 2)
(set! (-> a1-1 message) 'query)
(set! (-> a1-1 param 0) (the-as uint 'powerup))
(set! (-> a1-1 param 1) (the-as uint 3))
(send-event-function *target* a1-1)
)
(and
(-> self one-way)
(< (vector4-dot (-> self out-dir) (target-pos 0)) -8192.0)
)
)
)
(go-virtual door-opening)
)
(level-hint-spawn
(game-text-id zero)
(the-as string #f)
(the-as symbol (-> self entity))
*entity-pool*
0
)
)
(suspend)
)
(none)
)
)
;; failed to figure out what this is:
(defstate door-opening (eco-door)
:virtual #t
:event
eco-door-event-handler
:code
(behavior ()
(let
((gp-0
(and
(not
(and
(-> self entity)
(logtest?
(-> self entity extra perm status)
(entity-perm-status complete)
)
)
)
(let ((a1-0 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-0 from) self)
(set! (-> a1-0 num-params) 2)
(set! (-> a1-0 message) 'query)
(set! (-> a1-0 param 0) (the-as uint 'powerup))
(set! (-> a1-0 param 1) (the-as uint 3))
(send-event-function *target* a1-0)
)
)
)
)
(if gp-0
(sound-play-by-name
(static-sound-name "blue-eco-on")
(new-sound-id)
1024
0
0
(the-as uint 1)
(-> self root-override trans)
)
)
(sound-play-by-name
(-> self open-sound)
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(dummy-48 (-> self root-override))
(until (ja-done? 0)
(let ((a0-9 (-> self skel root-channel 0)))
(set!
(-> a0-9 param 0)
(the float (+ (-> a0-9 frame-group data 0 length) -1))
)
(set! (-> a0-9 param 1) (-> self speed))
(joint-control-channel-group-eval!
a0-9
(the-as art-joint-anim #f)
num-func-seek!
)
)
(if (and gp-0 (rand-vu-percent? 0.5))
(spawn-projectile-blue *target*)
)
(suspend)
)
)
(go-virtual door-open)
(none)
)
:post
(the-as (function none :behavior eco-door) transform-post)
)
;; failed to figure out what this is:
(defstate door-open (eco-door)
:virtual #t
:event
eco-door-event-handler
:code
(behavior ()
(set!
(-> self state-time)
(the-as seconds (-> *display* base-frame-counter))
)
(process-entity-status! self (entity-perm-status complete) #t)
(dummy-48 (-> self root-override))
(let ((v1-6 (-> self skel root-channel 0)))
(set! (-> v1-6 num-func) num-func-identity)
(set!
(-> v1-6 frame-num)
(the float (+ (-> v1-6 frame-group data 0 length) -1))
)
)
(logior! (-> self draw status) 2)
(suspend)
(dummy-47 (-> self root-override))
(ja-post)
(while #t
(let ((f30-0 (vector4-dot (-> self out-dir) (target-pos 0)))
(f28-0 (vector4-dot (-> self out-dir) (camera-pos)))
)
(when
(and
(-> self auto-close)
(or
(not *target*)
(<
(-> self close-distance)
(vector-vector-distance
(-> self root-override trans)
(-> *target* control trans)
)
)
)
)
(if (and (>= (* f30-0 f28-0) 0.0) (< 16384.0 (fabs f28-0)))
(go-virtual door-closing)
)
)
)
(suspend)
)
(none)
)
)
;; failed to figure out what this is:
(defstate door-closing (eco-door)
:virtual #t
:event
eco-door-event-handler
:code
(behavior ()
((method-of-object (-> self root-override) dummy-49))
(set! (-> self draw status) (logand -3 (-> self draw status)))
(let ((gp-0 (new 'stack 'overlaps-others-params)))
(set! (-> gp-0 options) (the-as uint 1))
(set! (-> gp-0 tlist) #f)
(while (dummy-40 (-> self root-override) gp-0)
(suspend)
)
)
(sound-play-by-name
(-> self close-sound)
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(until (ja-done? 0)
(let ((a0-7 (-> self skel root-channel 0)))
(set! (-> a0-7 param 0) 0.0)
(set! (-> a0-7 param 1) (-> self speed))
(joint-control-channel-group-eval!
a0-7
(the-as art-joint-anim #f)
num-func-seek!
)
)
(suspend)
)
(if (-> self locked)
(sound-play-by-name
(static-sound-name "door-lock")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
)
(go-virtual door-closed)
(none)
)
:post
(the-as (function none :behavior eco-door) transform-post)
)
;; definition for method 26 of type eco-door
;; INFO: Return type mismatch int vs none.
(defmethod dummy-26 eco-door ((obj eco-door))
(when (-> obj state-actor)
(if
(logtest?
(-> obj state-actor extra perm status)
(entity-perm-status complete)
)
(set! (-> obj locked) (logtest? (-> obj flags) 2))
(set! (-> obj locked) (logtest? (-> obj flags) 1))
)
)
0
(none)
)
;; definition for method 24 of type eco-door
;; INFO: Return type mismatch int vs none.
(defmethod TODO-RENAME-24 eco-door ((obj eco-door))
(let
((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player))))
(let
((s4-0
(new
'process
'collide-shape-prim-mesh
s5-0
(the-as uint 0)
(the-as uint 0)
)
)
)
(set! (-> s4-0 prim-core collide-as) (the-as uint 512))
(set! (-> s4-0 collide-with) (the-as uint 16))
(set! (-> s4-0 prim-core action) (the-as uint 1))
(set! (-> s4-0 prim-core offense) 4)
(set! (-> s4-0 transform-index) 0)
(set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 16384.0)
)
(dummy-46 s5-0)
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
(dummy-50 s5-0)
(set! (-> obj root-override) s5-0)
)
0
(none)
)
;; definition for method 25 of type eco-door
;; INFO: Return type mismatch int vs none.
(defmethod TODO-RENAME-25 eco-door ((obj eco-door))
0
(none)
)
;; definition for method 11 of type eco-door
(defmethod copy-defaults! eco-door ((obj eco-door) (arg0 res-lump))
(TODO-RENAME-24 obj)
(process-drawable-from-entity! obj arg0)
(let ((f0-0 (res-lump-float (-> obj entity) 'scale :default 1.0)))
(set-vector! (-> obj root-override scale) f0-0 f0-0 f0-0 1.0)
)
(set! (-> obj open-distance) 32768.0)
(set! (-> obj close-distance) 49152.0)
(set! (-> obj speed) 1.0)
(set! (-> obj state-actor) #f)
(let ((v1-5 (entity-actor-lookup arg0 'state-actor 0)))
(if v1-5
(set! (-> obj state-actor) v1-5)
)
)
(set! (-> obj locked) #f)
(set! (-> obj flags) (res-lump-value arg0 'flags int))
(dummy-26 obj)
(set! (-> obj auto-close) (logtest? (-> obj flags) 4))
(set! (-> obj one-way) (logtest? (-> obj flags) 8))
(vector-z-quaternion! (-> obj out-dir) (-> obj root-override quat))
(set!
(-> obj out-dir w)
(- (vector-dot (-> obj out-dir) (-> obj root-override trans)))
)
(dummy-47 (-> obj root-override))
(TODO-RENAME-25 obj)
(if
(and
(not (-> obj auto-close))
(-> obj entity)
(logtest? (-> obj entity extra perm status) (entity-perm-status complete))
)
(go (method-of-object obj door-open))
(go (method-of-object obj door-closed))
)
(none)
)
@@ -0,0 +1,785 @@
;;-*-Lisp-*-
(in-package goal)
;; definition of type plat-button
(deftype plat-button (process-drawable)
((root-override collide-shape-moving :offset 112)
(go-back-if-lost-player? symbol :offset-assert 176)
(grab-player? symbol :offset-assert 180)
(should-grab-player? symbol :offset-assert 184)
(path-pos float :offset-assert 188)
(bidirectional? symbol :offset-assert 192)
(allow-auto-kill symbol :offset-assert 196)
(sound-id sound-id :offset-assert 200)
(trans-off vector :inline :offset-assert 208)
(spawn-pos vector :inline :offset-assert 224)
)
:heap-base #x80
:method-count-assert 33
:size-assert #xf0
:flag-assert #x21008000f0
(:methods
(plat-button-at-end () _type_ :state 20)
(plat-button-idle () _type_ :state 21)
(plat-button-pressed () _type_ :state 22)
(plat-button-move-downward () _type_ :state 23)
(plat-button-move-upward () _type_ :state 24)
(plat-button-teleport-to-other-end () _type_ :state 25)
(can-activate? (_type_) symbol 26)
(TODO-RENAME-27 (_type_) none 27)
(TODO-RENAME-28 (_type_) collide-shape-moving 28)
(can-target-move? (_type_) symbol 29)
(should-teleport? (_type_) symbol 30)
(TODO-RENAME-31 (_type_) none 31)
(TODO-RENAME-32 (_type_) none 32)
)
)
;; definition for method 3 of type plat-button
(defmethod inspect plat-button ((obj plat-button))
(let ((t9-0 (method-of-type process-drawable inspect)))
(t9-0 obj)
)
(format
#t
"~T~Tgo-back-if-lost-player?: ~A~%"
(-> obj go-back-if-lost-player?)
)
(format #t "~T~Tgrab-player?: ~A~%" (-> obj grab-player?))
(format #t "~T~Tshould-grab-player?: ~A~%" (-> obj should-grab-player?))
(format #t "~T~Tpath-pos: ~f~%" (-> obj path-pos))
(format #t "~T~Tbidirectional?: ~A~%" (-> obj bidirectional?))
(format #t "~T~Tallow-auto-kill: ~A~%" (-> obj allow-auto-kill))
(format #t "~T~Tsound-id: ~D~%" (-> obj sound-id))
(format #t "~T~Ttrans-off: #<vector @ #x~X>~%" (-> obj trans-off))
(format #t "~T~Tspawn-pos: #<vector @ #x~X>~%" (-> obj spawn-pos))
obj
)
;; failed to figure out what this is:
(let
((v1-1
(new 'static 'skeleton-group
:art-group-name "plat-button"
:bounds
(new 'static 'vector :y -4096.0 :w 27033.6)
:version #x6
)
)
)
(set! (-> v1-1 jgeo) 0)
(set! (-> v1-1 janim) 2)
(set! (-> v1-1 mgeo 0) (the-as uint 1))
(set! (-> v1-1 lod-dist 0) 4095996000.0)
(set! *plat-button-sg* v1-1)
)
;; definition for method 30 of type plat-button
(defmethod should-teleport? plat-button ((obj plat-button))
#f
)
;; definition for method 26 of type plat-button
(defmethod can-activate? plat-button ((obj plat-button))
(or
(= (-> obj path-pos) 0.0)
(and (-> obj bidirectional?) (= (-> obj path-pos) 1.0))
)
)
;; failed to figure out what this is:
(defstate plat-button-idle (plat-button)
:virtual #t
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (when (= v1-0 'touch)
(when (can-activate? self)
(if
(and
((method-of-type touching-shapes-entry prims-touching?)
(the-as touching-shapes-entry (-> arg3 param 0))
(-> self root-override)
(the-as uint 1)
)
(or
(not (-> self should-grab-player?))
(let ((v0-3 (process-grab? *target*)))
(set! (-> self grab-player?) v0-3)
v0-3
)
)
)
(go-virtual plat-button-pressed)
)
)
)
)
)
)
:code
(behavior ()
(let ((gp-0 (can-activate? self)))
(cond
(gp-0
(let ((a0-1 (-> self skel root-channel 0)))
(set! (-> a0-1 param 0) 0.0)
(set! (-> a0-1 param 1) 1.0)
(joint-control-channel-group!
a0-1
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
(else
(let ((a0-2 (-> self skel root-channel 0)))
(set!
(-> a0-2 param 0)
(the float (+ (-> a0-2 frame-group data 0 length) -1))
)
(set! (-> a0-2 param 1) 1.0)
(joint-control-channel-group!
a0-2
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
)
(while #t
(if (should-teleport? self)
(go-virtual plat-button-teleport-to-other-end)
)
(let ((s5-0 (can-activate? self)))
(when (!= s5-0 gp-0)
(set! gp-0 s5-0)
(cond
(s5-0
(let ((a0-5 (-> self skel root-channel 0)))
(set! (-> a0-5 param 0) 0.0)
(set! (-> a0-5 param 1) 1.0)
(joint-control-channel-group!
a0-5
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
(else
(let ((a0-6 (-> self skel root-channel 0)))
(set!
(-> a0-6 param 0)
(the float (+ (-> a0-6 frame-group data 0 length) -1))
)
(set! (-> a0-6 param 1) 1.0)
(joint-control-channel-group!
a0-6
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
)
)
(when (not (ja-done? 0))
(rider-trans)
(cond
(s5-0
(let ((a0-8 (-> self skel root-channel 0)))
(set! (-> a0-8 param 0) 0.0)
(set! (-> a0-8 param 1) 1.0)
(joint-control-channel-group-eval!
a0-8
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
(else
(let ((a0-9 (-> self skel root-channel 0)))
(set!
(-> a0-9 param 0)
(the float (+ (-> a0-9 frame-group data 0 length) -1))
)
(set! (-> a0-9 param 1) 1.0)
(joint-control-channel-group-eval!
a0-9
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
)
(rider-post)
)
)
(suspend)
)
)
(none)
)
)
;; failed to figure out what this is:
(defstate plat-button-teleport-to-other-end (plat-button)
:virtual #t
:code
(behavior ()
(let ((f0-0 1.0))
(if (>= (-> self path-pos) 0.5)
(set! f0-0 0.0)
)
(set! (-> self path-pos) f0-0)
(let ((gp-0 (new 'stack-no-clear 'vector)))
(eval-path-curve! (-> self path) gp-0 f0-0 'interp)
(vector+! gp-0 gp-0 (-> self trans-off))
(TODO-RENAME-30 (-> self root-override) gp-0)
)
)
(ja-post)
(go-virtual plat-button-idle)
(none)
)
)
;; failed to figure out what this is:
(defstate plat-button-pressed (plat-button)
:virtual #t
:trans
(the-as (function none :behavior plat-button) rider-trans)
:code
(behavior ()
(let ((a0-0 (-> self skel root-channel 0)))
(set!
(-> a0-0 param 0)
(the float (+ (-> a0-0 frame-group data 0 length) -1))
)
(set! (-> a0-0 param 1) 1.0)
(joint-control-channel-group!
a0-0
(the-as art-joint-anim #f)
num-func-seek!
)
)
(until (ja-done? 0)
(suspend)
(let ((a0-1 (-> self skel root-channel 0)))
(set!
(-> a0-1 param 0)
(the float (+ (-> a0-1 frame-group data 0 length) -1))
)
(set! (-> a0-1 param 1) 1.0)
(joint-control-channel-group-eval!
a0-1
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
(set! (-> self go-back-if-lost-player?) #t)
(process-entity-status! self (entity-perm-status complete) #t)
(if (= (-> self path-pos) 0.0)
(go-virtual plat-button-move-downward)
(go-virtual plat-button-move-upward)
)
(none)
)
:post
(the-as (function none :behavior plat-button) rider-post)
)
;; definition for function plat-button-camera-on
;; INFO: Return type mismatch int vs none.
(defbehavior plat-button-camera-on plat-button ()
(let ((v1-1 (res-lump-struct (-> self entity) 'camera-name structure)))
(when v1-1
(let ((a1-1 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-1 from) self)
(set! (-> a1-1 num-params) 1)
(set! (-> a1-1 message) 'change-to-entity-by-name)
(set! (-> a1-1 param 0) (the-as uint v1-1))
(send-event-function *camera* a1-1)
)
)
)
0
(none)
)
;; definition for function plat-button-camera-off
;; INFO: Return type mismatch int vs none.
(defbehavior plat-button-camera-off plat-button ()
(let ((a1-0 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-0 from) self)
(set! (-> a1-0 num-params) 0)
(set! (-> a1-0 message) 'clear-entity)
(send-event-function *camera* a1-0)
)
0
(none)
)
;; failed to figure out what this is:
(defstate plat-button-move-downward (plat-button)
:virtual #t
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(the-as object (when (or (= arg2 'touch) (= arg2 'attack))
(set!
(-> self state-time)
(the-as seconds (-> *display* base-frame-counter))
)
#f
)
)
)
:enter
(behavior ()
(set!
(-> self state-time)
(the-as seconds (-> *display* base-frame-counter))
)
(process-entity-status! self (entity-perm-status bit-3) #t)
(plat-button-camera-on)
(set-setting! *setting-control* self 'allow-look-around #f 0.0 0)
(none)
)
:exit
(behavior ()
(plat-button-camera-off)
(clear-pending-settings-from-process
*setting-control*
self
'allow-look-around
)
(none)
)
:trans
(behavior ()
(if (= (-> self path-pos) 1.0)
(go-virtual plat-button-at-end)
)
(rider-trans)
(when (-> self go-back-if-lost-player?)
(when
(or
(not *target*)
(and
(>=
(- (-> *display* base-frame-counter) (the-as int (-> self state-time)))
1200
)
(not
(and
(logtest? (-> *target* control unknown-surface00 flags) 2048)
(zero? (logand (-> *target* control status) 1))
)
)
)
)
(set! (-> self go-back-if-lost-player?) #f)
(go-virtual plat-button-move-upward)
)
)
(let
((f0-4
(seek-with-smooth
(-> self path-pos)
1.0
(* 0.1 (-> *display* seconds-per-frame))
0.25
0.001
)
)
)
(set! (-> self path-pos) f0-4)
(let ((gp-0 (new 'stack-no-clear 'vector)))
(eval-path-curve! (-> self path) gp-0 f0-4 'interp)
(vector+! gp-0 gp-0 (-> self trans-off))
(TODO-RENAME-30 (-> self root-override) gp-0)
)
)
(sound-play-by-name
(static-sound-name "elev-loop")
(-> self sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(let ((gp-1 (the-as sound-rpc-set-param (get-sound-buffer-entry))))
(set! (-> gp-1 command) (sound-command set-param))
(set! (-> gp-1 id) (-> self sound-id))
(let ((a1-6 (-> self root-override trans)))
(let ((s5-0 self))
(when (= a1-6 #t)
(if
(and
s5-0
(type-type? (-> s5-0 type) process-drawable)
(nonzero? (-> s5-0 root-override))
)
(set! a1-6 (-> s5-0 root-override trans))
(set! a1-6 (the-as vector #f))
)
)
)
(sound-trans-convert (-> gp-1 parms trans) a1-6)
)
(set! (-> gp-1 parms mask) (the-as uint 32))
(-> gp-1 id)
)
(if (and (-> self grab-player?) (< 0.2 (-> self path-pos)))
(set! (-> self grab-player?) (not (process-release? *target*)))
)
(none)
)
:code
(the-as (function none :behavior plat-button) anim-loop)
:post
(the-as (function none :behavior plat-button) rider-post)
)
;; failed to figure out what this is:
(defstate plat-button-move-upward (plat-button)
:virtual #t
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(the-as object (when (or (= arg2 'touch) (= arg2 'attack))
(set!
(-> self state-time)
(the-as seconds (-> *display* base-frame-counter))
)
#f
)
)
)
:enter
(behavior ()
(set!
(-> self state-time)
(the-as seconds (-> *display* base-frame-counter))
)
(process-entity-status! self (entity-perm-status bit-3) #t)
(plat-button-camera-on)
(set-setting! *setting-control* self 'allow-look-around #f 0.0 0)
(none)
)
:exit
(behavior ()
(plat-button-camera-off)
(clear-pending-settings-from-process
*setting-control*
self
'allow-look-around
)
(none)
)
:trans
(behavior ()
(if (= (-> self path-pos) 0.0)
(go-virtual plat-button-at-end)
)
(rider-trans)
(when (-> self go-back-if-lost-player?)
(when
(or
(not *target*)
(and
(>=
(- (-> *display* base-frame-counter) (the-as int (-> self state-time)))
1200
)
(not
(and
(logtest? (-> *target* control unknown-surface00 flags) 2048)
(zero? (logand (-> *target* control status) 1))
)
)
)
)
(set! (-> self go-back-if-lost-player?) #f)
(go-virtual plat-button-move-downward)
)
)
(let
((f0-4
(seek-with-smooth
(-> self path-pos)
0.0
(* 0.1 (-> *display* seconds-per-frame))
0.25
0.001
)
)
)
(set! (-> self path-pos) f0-4)
(let ((gp-0 (new 'stack-no-clear 'vector)))
(eval-path-curve! (-> self path) gp-0 f0-4 'interp)
(vector+! gp-0 gp-0 (-> self trans-off))
(TODO-RENAME-30 (-> self root-override) gp-0)
)
)
(sound-play-by-name
(static-sound-name "elev-loop")
(-> self sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(let ((gp-1 (the-as sound-rpc-set-param (get-sound-buffer-entry))))
(set! (-> gp-1 command) (sound-command set-param))
(set! (-> gp-1 id) (-> self sound-id))
(let ((a1-6 (-> self root-override trans)))
(let ((s5-0 self))
(when (= a1-6 #t)
(if
(and
s5-0
(type-type? (-> s5-0 type) process-drawable)
(nonzero? (-> s5-0 root-override))
)
(set! a1-6 (-> s5-0 root-override trans))
(set! a1-6 (the-as vector #f))
)
)
)
(sound-trans-convert (-> gp-1 parms trans) a1-6)
)
(set! (-> gp-1 parms mask) (the-as uint 32))
(-> gp-1 id)
)
(if (and (-> self grab-player?) (< (-> self path-pos) 0.8))
(set! (-> self grab-player?) (not (process-release? *target*)))
)
(none)
)
:code
(the-as (function none :behavior plat-button) anim-loop)
:post
(the-as (function none :behavior plat-button) rider-post)
)
;; failed to figure out what this is:
(defstate plat-button-at-end (plat-button)
:virtual #t
:code
(behavior ()
(if (-> self allow-auto-kill)
(process-entity-status! self (entity-perm-status bit-3) #f)
)
(sound-stop (-> self sound-id))
(sound-play-by-name
(static-sound-name "elev-land")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(while #t
(if
(or
(not *target*)
(<
268435460.0
(vector-vector-xz-distance-squared
(-> self root-override trans)
(target-pos 0)
)
)
)
(go-virtual plat-button-idle)
)
(suspend)
)
(none)
)
)
;; definition for method 28 of type plat-button
(defmethod TODO-RENAME-28 plat-button ((obj plat-button))
(let
((s5-0
(new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player))
)
)
(set! (-> s5-0 dynam) (copy *standard-dynamics* 'process))
(set! (-> s5-0 reaction) default-collision-reaction)
(set! (-> s5-0 no-reaction) nothing)
(dummy-29 s5-0 1)
(let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0)))
(set! (-> s4-0 prim-core collide-as) (the-as uint 2048))
(set! (-> s4-0 collide-with) (the-as uint 16))
(set! (-> s4-0 prim-core action) (the-as uint 3))
(set! (-> s4-0 transform-index) 0)
(set-vector! (-> s4-0 local-sphere) 0.0 -4096.0 0.0 27033.6)
(dummy-46 s5-0)
(let
((s3-0
(new
'process
'collide-shape-prim-mesh
s5-0
(the-as uint 0)
(the-as uint 1)
)
)
)
(set! (-> s3-0 prim-core collide-as) (the-as uint 2048))
(set! (-> s3-0 collide-with) (the-as uint 16))
(set! (-> s3-0 prim-core action) (the-as uint 3))
(set! (-> s3-0 prim-core offense) 4)
(set! (-> s3-0 transform-index) 4)
(set-vector! (-> s3-0 local-sphere) 0.0 -3072.0 0.0 7372.8)
)
(dummy-28 s4-0)
(let
((s3-1
(new
'process
'collide-shape-prim-mesh
s5-0
(the-as uint 1)
(the-as uint 2)
)
)
)
(set! (-> s3-1 prim-core collide-as) (the-as uint 2048))
(set! (-> s3-1 collide-with) (the-as uint 16))
(set! (-> s3-1 prim-core action) (the-as uint 3))
(set! (-> s3-1 prim-core offense) 4)
(set! (-> s3-1 transform-index) 3)
(set-vector! (-> s3-1 local-sphere) 0.0 -4096.0 0.0 27033.6)
)
(dummy-28 s4-0)
)
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
(dummy-50 s5-0)
(set! (-> obj root-override) s5-0)
s5-0
)
)
;; definition for method 29 of type plat-button
;; INFO: Return type mismatch int vs symbol.
(defmethod can-target-move? plat-button ((obj plat-button))
(the-as symbol 0)
)
;; definition for method 27 of type plat-button
(defmethod TODO-RENAME-27 plat-button ((obj plat-button))
(ja-channel-set! 1)
(cond
((can-activate? obj)
(let ((s5-0 (-> obj skel root-channel 0)))
(joint-control-channel-group-eval!
s5-0
(the-as art-joint-anim (-> obj draw art-group data 2))
num-func-identity
)
(set! (-> s5-0 frame-num) 0.0)
)
)
(else
(let ((s5-1 (-> obj skel root-channel 0)))
(joint-control-channel-group-eval!
s5-1
(the-as art-joint-anim (-> obj draw art-group data 2))
num-func-identity
)
(set!
(-> s5-1 frame-num)
(the
float
(+
(->
(the-as art-joint-anim (-> obj draw art-group data 2))
data
0
length
)
-1
)
)
)
)
)
)
(ja-post)
(dummy-47 (-> obj root-override))
(none)
)
;; definition for method 31 of type plat-button
;; INFO: Return type mismatch int vs none.
(defmethod TODO-RENAME-31 plat-button ((obj plat-button))
(dummy-14 obj *plat-button-sg* '())
0
(none)
)
;; definition for method 32 of type plat-button
;; INFO: Return type mismatch int vs none.
(defmethod TODO-RENAME-32 plat-button ((obj plat-button))
(go (method-of-object obj plat-button-idle))
0
(none)
)
;; definition for method 11 of type plat-button
;; Used lq/sq
(defmethod copy-defaults! plat-button ((obj plat-button) (arg0 res-lump))
(set! (-> obj go-back-if-lost-player?) #f)
(set! (-> obj grab-player?) #f)
(set! (-> obj should-grab-player?) #f)
(set!
(-> obj trans-off quad)
(->
(the-as
vector
(get-property-struct
arg0
'trans-offset
'interp
-1000000000.0
*null-vector*
(the-as (pointer res-tag) #f)
*res-static-buf*
)
)
quad
)
)
(set!
(-> obj bidirectional?)
(nonzero? (res-lump-value arg0 'bidirectional uint128))
)
(TODO-RENAME-28 obj)
(process-drawable-from-entity! obj arg0)
(logclear! (-> obj mask) (process-mask actor-pause))
(TODO-RENAME-31 obj)
(logior! (-> obj skel status) 1)
(set! (-> obj spawn-pos quad) (-> obj root-override trans quad))
(set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0))
(logior!
(-> obj path flags)
(path-control-flag display draw-line draw-point draw-text)
)
(set! (-> obj path-pos) 0.0)
(let ((s5-1 (-> obj root-override trans)))
(eval-path-curve! (-> obj path) s5-1 (-> obj path-pos) 'interp)
(vector+! s5-1 s5-1 (-> obj trans-off))
)
(set! (-> obj sound-id) (new-sound-id))
(set! (-> obj allow-auto-kill) #t)
(can-target-move? obj)
(TODO-RENAME-27 obj)
(TODO-RENAME-32 obj)
(none)
)
+596
View File
@@ -0,0 +1,596 @@
;;-*-Lisp-*-
(in-package goal)
;; failed to figure out what this is:
(set!
(-> *part-group-id-table* 107)
(new 'static 'sparticle-launch-group
:length 2
:duration #xbb8
:linger-duration #x5dc
:name "group-standard-plat"
:launcher
(new 'static 'inline-array sparticle-group-item 2
(new 'static 'sparticle-group-item
:launcher #x16b
:fade-after (meters 60.0)
:falloff-to (meters 60.0)
)
(new 'static 'sparticle-group-item
:launcher #x16c
:fade-after (meters 160.0)
:falloff-to (meters 160.0)
)
)
:bounds
(new 'static 'sphere :y -49152.0 :w 57344.0)
)
)
;; failed to figure out what this is:
(set!
(-> *part-id-table* 363)
(new 'static 'sparticle-launcher
:init-specs
(new 'static 'inline-array sp-field-init-spec 14
(new 'static 'sp-field-init-spec
:field #x6
:flags #x1
:initial-value #x3fc00000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #xb
:flags #x1
:initial-value #x45800000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec :field #xe :initial-value 5 :random-mult 1)
(new 'static 'sp-field-init-spec
:field #x12
:flags #x1
:initial-value #x45a66666
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x13
:flags #x1
:initial-value #x45800000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x14
:flags #x1
:initial-value #x45666666
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x1a
:flags #x1
:initial-value #x415a740e
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x23
:flags #x1
:initial-value -1048374674
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x2e
:initial-value 25
:random-mult 1
)
(new 'static 'sp-field-init-spec
:field #x2f
:initial-value #x100
:random-mult 1
)
(new 'static 'sp-field-init-spec
:field #x3a
:flags #x1
:initial-value #x46c71c72
:random-range #x45e38e39
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x3b
:flags #x1
:random-range #x47800000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x3e
:flags #x1
:initial-value #x46400000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec :field #x43)
)
)
)
;; failed to figure out what this is:
(set!
(-> *part-id-table* 364)
(new 'static 'sparticle-launcher
:init-specs
(new 'static 'inline-array sp-field-init-spec 19
(new 'static 'sp-field-init-spec :field #x1 :initial-value #x200f00)
(new 'static 'sp-field-init-spec
:field #x6
:flags #x1
:initial-value #x40000000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #xb
:flags #x1
:initial-value #x45c00000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #xd
:flags #x1
:initial-value #x46000000
:random-range #x45800000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x11
:flags #x3
:initial-value -4
:random-mult 1
)
(new 'static 'sp-field-init-spec
:field #x13
:flags #x1
:random-range #x42800000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x14
:flags #x1
:initial-value #x43000000
:random-range #x43000000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x15
:flags #x1
:initial-value #x41800000
:random-range #x42000000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x1a
:flags #x1
:initial-value #x4223d70a
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x22
:flags #x1
:initial-value -1092979698
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x24
:flags #x1
:initial-value -1096558838
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x26
:flags #x1
:initial-value -1106522267
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x2d
:flags #x1
:initial-value #x3f75c28f
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x2e
:initial-value #x96
:random-mult 1
)
(new 'static 'sp-field-init-spec
:field #x2f
:initial-value 12
:random-mult 1
)
(new 'static 'sp-field-init-spec
:field #x3a
:flags #x1
:initial-value #x46b8e38e
:random-range #x468e38e4
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x3b
:flags #x1
:random-range #x47800000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec
:field #x3e
:flags #x1
:initial-value #x46400000
:random-mult #x3f800000
)
(new 'static 'sp-field-init-spec :field #x43)
)
)
)
;; definition of type plat
(deftype plat (baseplat)
((path-pos float :offset-assert 228)
(sync sync-info-eased :inline :offset-assert 232)
(sound-id sound-id :offset-assert 260)
)
:heap-base #xa0
:method-count-assert 33
:size-assert #x108
:flag-assert #x2100a00108
(:methods
(dummy-27 () none 27)
(dummy-28 () none 28)
(wad () _type_ :state 29)
(plat-startup () _type_ :state 30)
(plat-idle () _type_ :state 31)
(plat-path-active () _type_ :state 32)
)
)
;; definition for method 3 of type plat
(defmethod inspect plat ((obj plat))
(let ((t9-0 (method-of-type baseplat inspect)))
(t9-0 obj)
)
(format #t "~T~Tpath-pos: ~f~%" (-> obj path-pos))
(format #t "~T~Tsync: #<sync-info-eased @ #x~X>~%" (-> obj sync))
(format #t "~T~Tsound-id: ~D~%" (-> obj sound-id))
obj
)
;; failed to figure out what this is:
(let
((v1-4
(new 'static 'skeleton-group
:art-group-name "plat"
:bounds
(new 'static 'vector :y -2048.0 :w 12288.0)
:max-lod 2
:version #x6
)
)
)
(set! (-> v1-4 jgeo) 0)
(set! (-> v1-4 janim) 4)
(set! (-> v1-4 mgeo 0) (the-as uint 1))
(set! (-> v1-4 lod-dist 0) 81920.0)
(set! (-> v1-4 mgeo 1) (the-as uint 2))
(set! (-> v1-4 lod-dist 1) 163840.0)
(set! (-> v1-4 mgeo 2) (the-as uint 3))
(set! (-> v1-4 lod-dist 2) 4095996000.0)
(set! *plat-sg* v1-4)
)
;; failed to figure out what this is:
(let
((v1-5
(new 'static 'skeleton-group
:art-group-name "plat-jungleb"
:bounds
(new 'static 'vector :y -2048.0 :w 12288.0)
:version #x6
)
)
)
(set! (-> v1-5 jgeo) 0)
(set! (-> v1-5 janim) 4)
(set! (-> v1-5 mgeo 0) (the-as uint 1))
(set! (-> v1-5 lod-dist 0) 4095996000.0)
(set! *plat-jungleb-sg* v1-5)
)
;; failed to figure out what this is:
(let
((v1-6
(new 'static 'skeleton-group
:art-group-name "plat-sunken"
:bounds
(new 'static 'vector :y -2048.0 :w 13107.2)
:version #x6
)
)
)
(set! (-> v1-6 jgeo) 0)
(set! (-> v1-6 janim) 4)
(set! (-> v1-6 mgeo 0) (the-as uint 1))
(set! (-> v1-6 lod-dist 0) 4095996000.0)
(set! *plat-sunken-sg* v1-6)
)
;; definition for method 23 of type plat
(defmethod TODO-RENAME-23 plat ((obj plat))
(cond
((= (-> (if (-> obj entity)
(-> obj entity extra level)
(-> *level* level-default)
)
name
)
'jungleb
)
*plat-jungleb-sg*
)
((or (= (-> (if (-> obj entity)
(-> obj entity extra level)
(-> *level* level-default)
)
name
)
'sunken
)
(= (-> (if (-> obj entity)
(-> obj entity extra level)
(-> *level* level-default)
)
name
)
'sunkenb
)
)
*plat-sunken-sg*
)
(else
*plat-sg*
)
)
)
;; definition for method 24 of type plat
;; INFO: Return type mismatch int vs none.
(defmethod dummy-24 plat ((obj plat))
(let
((s5-0
(new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player))
)
)
(set! (-> s5-0 dynam) (copy *standard-dynamics* 'process))
(set! (-> s5-0 reaction) default-collision-reaction)
(set! (-> s5-0 no-reaction) nothing)
(dummy-29 s5-0 1)
(let
((s4-0
(new
'process
'collide-shape-prim-mesh
s5-0
(the-as uint 0)
(the-as uint 0)
)
)
)
(set! (-> s4-0 prim-core collide-as) (the-as uint 2048))
(set! (-> s4-0 collide-with) (the-as uint 16))
(set! (-> s4-0 prim-core action) (the-as uint 3))
(set! (-> s4-0 prim-core offense) 4)
(set! (-> s4-0 transform-index) 0)
(set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 13107.2)
)
(dummy-46 s5-0)
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
(dummy-50 s5-0)
(set! (-> obj root-override) s5-0)
)
0
(none)
)
;; definition for method 26 of type plat
;; INFO: Return type mismatch int vs none.
(defmethod dummy-26 plat ((obj plat))
0
(none)
)
;; definition for method 25 of type plat
;; INFO: Return type mismatch sparticle-launch-control vs sparticle-launch-group.
(defmethod TODO-RENAME-25 plat ((obj plat))
(the-as sparticle-launch-group (when (!= (-> (if (-> obj entity)
(-> obj entity extra level)
(-> *level* level-default)
)
name
)
'maincave
)
(let
((v0-0
(create-launch-control
(-> *part-group-id-table* 107)
obj
)
)
)
(set! (-> obj part) v0-0)
v0-0
)
)
)
)
;; failed to figure out what this is:
(defstate plat-startup (plat)
:virtual #t
:code
(behavior ()
(cond
((logtest? (-> self path flags) (path-control-flag not-found))
(go-virtual plat-idle)
)
((> (-> self sync period) 0)
(go-virtual plat-path-active)
)
(else
(go-virtual plat-idle)
)
)
(none)
)
)
;; failed to figure out what this is:
(defstate plat-idle (plat)
:virtual #t
:event
(the-as
(function process int symbol event-message-block object :behavior plat)
plat-event
)
:trans
(behavior ()
(dummy-20 self)
(none)
)
:code
(behavior ()
(plat-trans)
(rider-post)
(suspend)
(while #t
(when (not (-> self bouncing))
(plat-trans)
(rider-post)
(logior! (-> self mask) (process-mask sleep-code))
(suspend)
0
)
(while (-> self bouncing)
(plat-trans)
(rider-post)
(suspend)
)
)
(none)
)
)
;; failed to figure out what this is:
(defstate plat-path-active (plat)
:virtual #t
:event
(the-as
(function process int symbol event-message-block object :behavior plat)
plat-event
)
:exit
(behavior ()
(sound-stop (-> self sound-id))
(none)
)
:trans
(behavior ()
(set! (-> self path-pos) (if (logtest? (-> self fact options) 8)
(get-current-phase (-> self sync))
(get-current-phase-with-mirror (-> self sync))
)
)
(eval-path-curve!
(-> self path)
(-> self basetrans)
(-> self path-pos)
'interp
)
(if
(<
(vector-vector-distance (-> self root-override trans) (ear-trans))
81920.0
)
(sound-play-by-name
(static-sound-name "eco-plat-hover")
(-> self sound-id)
1024
0
0
(the-as uint 1)
(-> self root-override trans)
)
)
(plat-trans)
(none)
)
:code
(the-as (function none :behavior plat) anim-loop)
:post
(the-as (function none :behavior plat) plat-post)
)
;; definition for method 11 of type plat
(defmethod copy-defaults! plat ((obj plat) (arg0 res-lump))
(set! (-> obj mask) (logior (process-mask platform) (-> obj mask)))
(dummy-24 obj)
(process-drawable-from-entity! obj arg0)
(dummy-14 obj (TODO-RENAME-23 obj) '())
(logior! (-> obj skel status) 1)
(dummy-47 (-> obj root-override))
(dummy-21 obj)
(TODO-RENAME-25 obj)
(load-params! (-> obj sync) obj (the-as uint 0) 0.0 0.15 0.15)
(set!
(-> obj fact)
(new
'process
'fact-info
obj
(pickup-type eco-pill-random)
(-> *FACT-bank* default-pill-inc)
)
)
(set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0))
(logior!
(-> obj path flags)
(path-control-flag display draw-line draw-point draw-text)
)
(set! (-> obj sound-id) (new-sound-id))
(cond
((logtest? (-> obj path flags) (path-control-flag not-found))
(set! (-> obj path-pos) 0.0)
(dummy-26 obj)
(go (method-of-object obj plat-startup))
)
((> (-> obj sync period) 0)
(set! (-> obj path-pos) (if (logtest? (-> obj fact options) 8)
(get-current-phase (-> obj sync))
(get-current-phase-with-mirror (-> obj sync))
)
)
(eval-path-curve!
(-> obj path)
(-> obj root-override trans)
(-> obj path-pos)
'interp
)
(dummy-26 obj)
(go (method-of-object obj plat-startup))
)
(else
(set! (-> obj path-pos) 0.0)
(eval-path-curve!
(-> obj path)
(-> obj root-override trans)
(-> obj path-pos)
'interp
)
(dummy-26 obj)
(go (method-of-object obj plat-startup))
)
)
(none)
)
@@ -222,7 +222,3 @@
v0-2
)
)
@@ -0,0 +1,332 @@
;;-*-Lisp-*-
(in-package goal)
;; definition of type plat-flip
(deftype plat-flip (process-drawable)
((root-override collide-shape-moving :offset 112)
(path-pos float :offset-assert 176)
(before-turn-down-time float :offset-assert 180)
(turn-down-time float :offset-assert 184)
(before-turn-up-time float :offset-assert 188)
(turn-up-time float :offset-assert 192)
(total-time float :offset-assert 196)
(sync sync-info :inline :offset-assert 200)
(base-pos vector :inline :offset-assert 208)
(smush smush-control :inline :offset-assert 224)
)
:heap-base #x90
:method-count-assert 20
:size-assert #x100
:flag-assert #x1400900100
)
;; definition for method 3 of type plat-flip
(defmethod inspect plat-flip ((obj plat-flip))
(let ((t9-0 (method-of-type process-drawable inspect)))
(t9-0 obj)
)
(format #t "~T~Tpath-pos: ~f~%" (-> obj path-pos))
(format #t "~T~Tbefore-turn-down-time: ~f~%" (-> obj before-turn-down-time))
(format #t "~T~Tturn-down-time: ~f~%" (-> obj turn-down-time))
(format #t "~T~Tbefore-turn-up-time: ~f~%" (-> obj before-turn-up-time))
(format #t "~T~Tturn-up-time: ~f~%" (-> obj turn-up-time))
(format #t "~T~Ttotal-time: ~f~%" (-> obj total-time))
(format #t "~T~Tsync: #<sync-info @ #x~X>~%" (-> obj sync))
(format #t "~T~Tbase-pos: #<vector @ #x~X>~%" (-> obj base-pos))
(format #t "~T~Tsmush: #<smush-control @ #x~X>~%" (-> obj smush))
obj
)
;; failed to figure out what this is:
(let
((v1-1
(new 'static 'skeleton-group
:art-group-name "plat-flip"
:bounds (new 'static 'vector :w 32768.0)
:version #x6
)
)
)
(set! (-> v1-1 jgeo) 0)
(set! (-> v1-1 janim) 2)
(set! (-> v1-1 mgeo 0) (the-as uint 1))
(set! (-> v1-1 lod-dist 0) 4095996000.0)
(set! *plat-flip-sg* v1-1)
)
;; failed to figure out what this is:
(defstate plat-flip-idle (plat-flip)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'bonk)
(activate! (-> self smush) -1.0 90 300 1.0 1.0)
)
((= v1-0 'touch)
(let ((a1-5 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-5 from) self)
(set! (-> a1-5 num-params) 1)
(set! (-> a1-5 message) 'no-look-around)
(set! (-> a1-5 param 0) (the-as uint 450))
(send-event-function arg0 a1-5)
)
(the-as smush-control #f)
)
)
)
)
)
:trans
(the-as (function none :behavior plat-flip) rider-trans)
:code
(behavior ()
(local-vars (f30-0 float) (f30-1 float))
(let ((gp-0 #f))
(while #t
(let ((f0-1 (get-current-value (-> self sync) (-> self total-time))))
(cond
((< f0-1 (-> self before-turn-down-time))
(let ((gp-1 (-> self skel root-channel 0)))
(joint-control-channel-group-eval!
gp-1
(the-as art-joint-anim (-> self draw art-group data 2))
num-func-identity
)
(set! (-> gp-1 frame-num) 0.0)
)
(set! gp-0 #f)
)
((begin
(set! f30-0 (- f0-1 (-> self before-turn-down-time)))
(< f30-0 (-> self turn-down-time))
)
(when (not gp-0)
(set! gp-0 #t)
(sound-play-by-name
(static-sound-name "plat-flip")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
)
(let ((s5-1 (-> self skel root-channel 0)))
(joint-control-channel-group-eval!
s5-1
(the-as art-joint-anim (-> self draw art-group data 2))
num-func-identity
)
(set!
(-> s5-1 frame-num)
(/
(*
f30-0
(the
float
(+
(->
(the-as art-joint-anim (-> self draw art-group data 2))
data
0
length
)
-1
)
)
)
(-> self turn-down-time)
)
)
)
)
((begin
(set! f30-1 (- f30-0 (-> self turn-down-time)))
(< f30-1 (-> self before-turn-up-time))
)
(set! gp-0 #f)
(let ((s5-2 (-> self skel root-channel 0)))
(joint-control-channel-group-eval!
s5-2
(the-as art-joint-anim (-> self draw art-group data 2))
num-func-identity
)
(set!
(-> s5-2 frame-num)
(the
float
(+
(->
(the-as art-joint-anim (-> self draw art-group data 2))
data
0
length
)
-1
)
)
)
)
)
(else
(when (not gp-0)
(set! gp-0 #t)
(sound-play-by-name
(static-sound-name "plat-flip")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
)
(let ((f30-2 (- f30-1 (-> self before-turn-up-time)))
(s5-4 (-> self skel root-channel 0))
)
(joint-control-channel-group-eval!
s5-4
(the-as art-joint-anim (-> self draw art-group data 3))
num-func-identity
)
(set!
(-> s5-4 frame-num)
(/
(*
f30-2
(the
float
(+
(->
(the-as art-joint-anim (-> self draw art-group data 3))
data
0
length
)
-1
)
)
)
(-> self turn-up-time)
)
)
)
)
)
)
(let ((s5-5 (new 'stack-no-clear 'vector)))
(set! (-> s5-5 quad) (-> self base-pos quad))
(+! (-> s5-5 y) (* 1638.4 (update! (-> self smush))))
(TODO-RENAME-30 (-> self root-override) s5-5)
)
(suspend)
)
)
(none)
)
:post
(the-as (function none :behavior plat-flip) rider-post)
)
;; definition for method 11 of type plat-flip
;; Used lq/sq
(defmethod copy-defaults! plat-flip ((obj plat-flip) (arg0 res-lump))
(local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag))
(set! (-> obj mask) (logior (process-mask platform) (-> obj mask)))
(let
((s4-0
(new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player))
)
)
(set! (-> s4-0 dynam) (copy *standard-dynamics* 'process))
(set! (-> s4-0 reaction) default-collision-reaction)
(set! (-> s4-0 no-reaction) nothing)
(dummy-29 s4-0 1)
(let
((s3-0
(new
'process
'collide-shape-prim-mesh
s4-0
(the-as uint 0)
(the-as uint 0)
)
)
)
(set! (-> s3-0 prim-core collide-as) (the-as uint 2048))
(set! (-> s3-0 collide-with) (the-as uint 16))
(set! (-> s3-0 prim-core action) (the-as uint 3))
(set! (-> s3-0 prim-core offense) 4)
(set! (-> s3-0 transform-index) 3)
(set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 11468.8)
)
(dummy-46 s4-0)
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
(dummy-50 s4-0)
(set! (-> obj root-override) s4-0)
)
(process-drawable-from-entity! obj arg0)
(set! (-> obj base-pos quad) (-> obj root-override trans quad))
(dummy-14 obj *plat-flip-sg* '())
(logior! (-> obj skel status) 1)
(let ((f30-0 300.0))
(set! sv-16 (new 'static 'res-tag))
(let ((v1-28 (res-lump-data arg0 'delay pointer :tag-ptr (& sv-16))))
(set!
(-> obj before-turn-down-time)
(* f30-0 (if (and v1-28 (> (the-as int (-> sv-16 elt-count)) 0))
(-> (the-as (pointer float) v1-28))
2.0
)
)
)
)
)
(let ((f30-1 300.0))
(set! sv-32 (new 'static 'res-tag))
(let ((v1-31 (res-lump-data arg0 'delay pointer :tag-ptr (& sv-32))))
(set!
(-> obj before-turn-up-time)
(* f30-1 (if (and v1-31 (< 1 (the-as int (-> sv-32 elt-count))))
(-> (the-as (pointer float) v1-31) 1)
0.2
)
)
)
)
)
(set! (-> obj turn-down-time) 300.0)
(set! (-> obj turn-up-time) 300.0)
(set!
(-> obj total-time)
(+
(-> obj before-turn-down-time)
(-> obj turn-down-time)
(-> obj before-turn-up-time)
(-> obj turn-up-time)
)
)
(let ((s4-1 (-> obj sync))
(s3-1 (method-of-type sync-info setup-params!))
(s2-0 (the int (-> obj total-time)))
)
(set! sv-48 (new 'static 'res-tag))
(let ((v1-35 (res-lump-data arg0 'sync-percent pointer :tag-ptr (& sv-48))))
(s3-1
s4-1
(the-as uint s2-0)
(if (and v1-35 (> (the-as int (-> sv-48 elt-count)) 0))
(-> (the-as (pointer float) v1-35) 0)
0.0
)
0.15
0.15
)
)
)
(dummy-47 (-> obj root-override))
(go plat-flip-idle)
(none)
)
+388
View File
@@ -0,0 +1,388 @@
;;-*-Lisp-*-
(in-package goal)
;; definition of type wall-plat
(deftype wall-plat (process-drawable)
((root-override collide-shape-moving :offset 112)
(use-sync? symbol :offset-assert 176)
(extended-amount float :offset-assert 180)
(in-trans vector :inline :offset-assert 192)
(out-trans vector :inline :offset-assert 208)
(sync sync-info-paused :inline :offset-assert 224)
)
:heap-base #x80
:method-count-assert 20
:size-assert #xf0
:flag-assert #x14008000f0
)
;; definition for method 3 of type wall-plat
(defmethod inspect wall-plat ((obj wall-plat))
(let ((t9-0 (method-of-type process-drawable inspect)))
(t9-0 obj)
)
(format #t "~T~Tuse-sync?: ~A~%" (-> obj use-sync?))
(format #t "~T~Textended-amount: ~f~%" (-> obj extended-amount))
(format #t "~T~Tin-trans: #<vector @ #x~X>~%" (-> obj in-trans))
(format #t "~T~Tout-trans: #<vector @ #x~X>~%" (-> obj out-trans))
(format #t "~T~Tsync: #<sync-info-paused @ #x~X>~%" (-> obj sync))
obj
)
;; failed to figure out what this is:
(let
((v1-1
(new 'static 'skeleton-group
:art-group-name "wall-plat"
:bounds
(new 'static 'vector :x 4096.0 :y -8192.0 :w 26624.0)
:version #x6
)
)
)
(set! (-> v1-1 jgeo) 0)
(set! (-> v1-1 janim) -1)
(set! (-> v1-1 mgeo 0) (the-as uint 1))
(set! (-> v1-1 lod-dist 0) 4095996000.0)
(set! *wall-plat-sg* v1-1)
)
;; failed to figure out what this is:
(defstate wall-plat-retracted (wall-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (if (= v1-0 'trigger)
(go wall-plat-extending)
)
)
)
)
:code
(behavior ()
(set! (-> self extended-amount) 0.0)
(TODO-RENAME-30 (-> self root-override) (-> self in-trans))
(transform-post)
(dummy-48 (-> self root-override))
(while #t
(logior! (-> self mask) (process-mask sleep-code))
(suspend)
)
(none)
)
)
;; failed to figure out what this is:
(defstate wall-plat-extending (wall-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (when (= v1-0 'touch)
(let ((a1-2 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-2 from) self)
(set! (-> a1-2 num-params) 1)
(set! (-> a1-2 message) 'no-look-around)
(set! (-> a1-2 param 0) (the-as uint 450))
(send-event-function arg0 a1-2)
)
#f
)
)
)
)
:enter
(behavior ()
(sound-play-by-name
(static-sound-name "wall-plat")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(none)
)
:trans
(the-as (function none :behavior wall-plat) rider-trans)
:code
(behavior ()
((method-of-object (-> self root-override) dummy-49))
(set!
(-> self state-time)
(the-as seconds (-> *display* base-frame-counter))
)
(while #t
(set!
(-> self extended-amount)
(seek
(-> self extended-amount)
1.0
(* 2.5 (-> *display* seconds-per-frame))
)
)
(let ((gp-0 (new 'stack-no-clear 'vector)))
(vector-lerp!
gp-0
(-> self in-trans)
(-> self out-trans)
(-> self extended-amount)
)
(TODO-RENAME-30 (-> self root-override) gp-0)
)
(suspend)
(if (= (-> self extended-amount) 1.0)
(go wall-plat-extended)
)
)
(none)
)
:post
(the-as (function none :behavior wall-plat) rider-post)
)
;; failed to figure out what this is:
(defstate wall-plat-extended (wall-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (if (= v1-0 'untrigger)
(go wall-plat-retracting)
)
)
)
)
:code
(behavior ()
(set! (-> self extended-amount) 1.0)
(TODO-RENAME-30 (-> self root-override) (-> self out-trans))
(transform-post)
(while #t
(logior! (-> self mask) (process-mask sleep-code))
(suspend)
)
(none)
)
)
;; failed to figure out what this is:
(defstate wall-plat-retracting (wall-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (when (= v1-0 'touch)
(let ((a1-2 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-2 from) self)
(set! (-> a1-2 num-params) 1)
(set! (-> a1-2 message) 'no-look-around)
(set! (-> a1-2 param 0) (the-as uint 450))
(send-event-function arg0 a1-2)
)
#f
)
)
)
)
:enter
(behavior ()
(sound-play-by-name
(static-sound-name "wall-plat")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(none)
)
:trans
(the-as (function none :behavior wall-plat) rider-trans)
:code
(behavior ()
(set!
(-> self state-time)
(the-as seconds (-> *display* base-frame-counter))
)
(while #t
(set!
(-> self extended-amount)
(seek
(-> self extended-amount)
0.0
(* 2.5 (-> *display* seconds-per-frame))
)
)
(let ((gp-0 (new 'stack-no-clear 'vector)))
(vector-lerp!
gp-0
(-> self in-trans)
(-> self out-trans)
(-> self extended-amount)
)
(TODO-RENAME-30 (-> self root-override) gp-0)
)
(suspend)
(if (= (-> self extended-amount) 0.0)
(go wall-plat-retracted)
)
)
(none)
)
:post
(the-as (function none :behavior wall-plat) rider-post)
)
;; failed to figure out what this is:
(defstate wall-plat-sync-idle (wall-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (when (= v1-0 'touch)
(let ((a1-2 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-2 from) self)
(set! (-> a1-2 num-params) 1)
(set! (-> a1-2 message) 'no-look-around)
(set! (-> a1-2 param 0) (the-as uint 450))
(send-event-function arg0 a1-2)
)
#f
)
)
)
)
:enter
(behavior ()
(logclear! (-> self mask) (process-mask actor-pause))
(none)
)
:exit
(behavior ()
(logior! (-> self mask) (process-mask actor-pause))
(none)
)
:trans
(the-as (function none :behavior wall-plat) rider-trans)
:code
(behavior ()
(let ((gp-0 #f))
(while #t
(let ((f30-0 (get-current-phase-with-mirror (-> self sync))))
(let ((s5-0 (new 'stack-no-clear 'vector)))
(vector-lerp! s5-0 (-> self in-trans) (-> self out-trans) f30-0)
(TODO-RENAME-30 (-> self root-override) s5-0)
)
(cond
((= f30-0 0.0)
(set! gp-0 #f)
(dummy-48 (-> self root-override))
)
((= f30-0 1.0)
(set! gp-0 #f)
((method-of-object (-> self root-override) dummy-49))
)
(else
(when (not gp-0)
(sound-play-by-name
(static-sound-name "wall-plat")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(set! gp-0 #t)
)
((method-of-object (-> self root-override) dummy-49))
)
)
)
(suspend)
)
)
(none)
)
:post
(the-as (function none :behavior wall-plat) rider-post)
)
;; definition for method 11 of type wall-plat
(defmethod copy-defaults! wall-plat ((obj wall-plat) (arg0 res-lump))
(set! (-> obj extended-amount) 0.0)
(set! (-> obj mask) (logior (process-mask platform) (-> obj mask)))
(let
((s4-0
(new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player))
)
)
(set! (-> s4-0 dynam) (copy *standard-dynamics* 'process))
(set! (-> s4-0 reaction) default-collision-reaction)
(set! (-> s4-0 no-reaction) nothing)
(dummy-29 s4-0 1)
(let
((s3-0
(new
'process
'collide-shape-prim-mesh
s4-0
(the-as uint 0)
(the-as uint 0)
)
)
)
(set! (-> s3-0 prim-core collide-as) (the-as uint 2048))
(set! (-> s3-0 collide-with) (the-as uint 16))
(set! (-> s3-0 prim-core action) (the-as uint 19))
(set! (-> s3-0 prim-core offense) 4)
(set! (-> s3-0 transform-index) 2)
(set-vector! (-> s3-0 local-sphere) 0.0 -6144.0 -12288.0 19456.0)
)
(dummy-46 s4-0)
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
(dummy-50 s4-0)
(set! (-> obj root-override) s4-0)
)
(process-drawable-from-entity! obj arg0)
(dummy-14 obj *wall-plat-sg* '())
(logior! (-> obj skel status) 1)
(set!
(-> obj use-sync?)
(load-params! (-> obj sync) obj (the-as uint 1500) 0.0 0.2 0.2)
)
(let ((f30-0 (quaternion-y-angle (-> obj root-override quat)))
(s4-1 (new 'stack-no-clear 'vector))
)
(set-vector! s4-1 0.0 0.0 (+ 1638.4 (res-lump-float arg0 'tunemeters)) 1.0)
(vector-rotate-around-y! s4-1 s4-1 f30-0)
(vector+! (-> obj out-trans) (-> obj root-override trans) s4-1)
(set-vector! s4-1 0.0 0.0 20480.0 1.0)
(vector-rotate-around-y! s4-1 s4-1 f30-0)
(vector+! (-> obj in-trans) (-> obj out-trans) s4-1)
)
(ja-channel-push! 1 0)
(let ((s5-1 (-> obj skel root-channel 0)))
(joint-control-channel-group-eval!
s5-1
(the-as art-joint-anim (-> obj draw art-group data 2))
num-func-identity
)
(set! (-> s5-1 frame-num) 0.0)
)
(ja-post)
(dummy-47 (-> obj root-override))
(cond
((-> obj use-sync?)
(logclear! (-> obj mask) (process-mask actor-pause))
(go wall-plat-sync-idle)
)
(else
(go wall-plat-retracted)
)
)
(none)
)
@@ -0,0 +1,700 @@
;;-*-Lisp-*-
(in-package goal)
;; definition of type wedge-plat-master
(deftype wedge-plat-master (process)
((center vector :inline :offset-assert 112)
(rotspeed float :offset-assert 128)
(rotate-inner float :offset-assert 132)
(rotate-outer float :offset-assert 136)
)
:heap-base #x20
:method-count-assert 14
:size-assert #x8c
:flag-assert #xe0020008c
)
;; definition for method 3 of type wedge-plat-master
(defmethod inspect wedge-plat-master ((obj wedge-plat-master))
(let ((t9-0 (method-of-type process inspect)))
(t9-0 obj)
)
(format #t "~T~Tcenter: #<vector @ #x~X>~%" (-> obj center))
(format #t "~T~Trotspeed: ~f~%" (-> obj rotspeed))
(format #t "~T~Trotate-inner: ~f~%" (-> obj rotate-inner))
(format #t "~T~Trotate-outer: ~f~%" (-> obj rotate-outer))
obj
)
;; failed to figure out what this is:
(defstate wedge-plat-master-idle (wedge-plat-master)
:code
(behavior ()
(while #t
(set!
(-> self rotate-inner)
(the
float
(sar
(shl
(the
int
(+
(-> self rotate-inner)
(* (-> self rotspeed) (-> *display* seconds-per-frame))
)
)
48
)
48
)
)
)
(set!
(-> self rotate-outer)
(the
float
(sar
(shl
(the
int
(-
(-> self rotate-outer)
(* (-> self rotspeed) (-> *display* seconds-per-frame))
)
)
48
)
48
)
)
)
(suspend)
)
(none)
)
)
;; definition for method 11 of type wedge-plat-master
;; Used lq/sq
(defmethod
copy-defaults!
wedge-plat-master
((obj wedge-plat-master) (arg0 res-lump))
(set! (-> obj mask) (logior (process-mask platform) (-> obj mask)))
(set! (-> obj center quad) (-> arg0 extra trans quad))
(set! (-> obj center y) (+ 819.2 (-> obj center y)))
(set! (-> obj rotspeed) (res-lump-float arg0 'rotspeed))
(set! (-> obj rotate-inner) 0.0)
(set! (-> obj rotate-outer) 0.0)
(logclear! (-> obj mask) (process-mask actor-pause))
(go wedge-plat-master-idle)
(none)
)
;; definition of type wedge-plat
(deftype wedge-plat (baseplat)
((master wedge-plat-master :offset-assert 228)
(distance float :offset-assert 232)
(offset float :offset-assert 236)
)
:heap-base #x80
:method-count-assert 28
:size-assert #xf0
:flag-assert #x1c008000f0
(:methods
(dummy-27 (_type_) symbol 27)
)
)
;; definition for method 3 of type wedge-plat
(defmethod inspect wedge-plat ((obj wedge-plat))
(let ((t9-0 (method-of-type baseplat inspect)))
(t9-0 obj)
)
(format #t "~T~Tmaster: ~A~%" (-> obj master))
(format #t "~T~Tdistance: ~f~%" (-> obj distance))
(format #t "~T~Toffset: ~f~%" (-> obj offset))
obj
)
;; failed to figure out what this is:
(let
((v1-3
(new 'static 'skeleton-group
:art-group-name "wedge-plat"
:bounds (new 'static 'vector :w 24576.0)
:version #x6
)
)
)
(set! (-> v1-3 jgeo) 0)
(set! (-> v1-3 janim) 2)
(set! (-> v1-3 mgeo 0) (the-as uint 1))
(set! (-> v1-3 lod-dist 0) 4095996000.0)
(set! *wedge-plat-sg* v1-3)
)
;; definition for method 27 of type wedge-plat
(defmethod dummy-27 wedge-plat ((obj wedge-plat))
(let* ((a0-1 (-> obj master))
(v1-0 (if a0-1
(-> (the-as process-drawable (-> a0-1 ppointer)) brother)
)
)
)
(when v1-0
(let ((s4-0 (&-> v1-0 27))
(f30-0 (-> obj distance))
(f28-0
(the
float
(sar
(shl (the int (+ (the-as float (-> v1-0 32)) (-> obj offset))) 48)
48
)
)
)
(s5-0 #f)
)
(quaternion-axis-angle!
(-> obj root-override quat)
0.0
1.0
0.0
(the float (sar (shl (the int (- 49152.0 f28-0)) 48) 48))
)
(set!
(-> obj basetrans x)
(+ (the-as float (-> s4-0 0)) (* f30-0 (cos f28-0)))
)
(set! (-> obj basetrans y) (the-as float (-> s4-0 1)))
(set!
(-> obj basetrans z)
(+ (the-as float (-> s4-0 2)) (* f30-0 (sin f28-0)))
)
(let ((f0-16 (cos f28-0)))
(if (or (< 0.95 f0-16) (< f0-16 -0.95))
(set! s5-0 #t)
)
)
s5-0
)
)
)
)
;; failed to figure out what this is:
(defstate wedge-plat-idle (wedge-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (if (= v1-0 'bonk)
(dummy-22 self)
)
)
)
)
:trans
(the-as (function none :behavior wedge-plat) plat-trans)
:code
(behavior ()
(let ((gp-0 (-> self skel root-channel 0)))
(set! (-> gp-0 num-func) num-func-identity)
(set! (-> gp-0 frame-num) (ja-aframe 0.0 0))
)
(while #t
(if (dummy-27 self)
(go wedge-plat-tip)
)
(suspend)
)
(none)
)
:post
(the-as (function none :behavior wedge-plat) plat-post)
)
;; failed to figure out what this is:
(defstate wedge-plat-tip (wedge-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'bonk)
(dummy-22 self)
)
((= v1-0 'touch)
(let ((a1-4 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-4 from) self)
(set! (-> a1-4 num-params) 1)
(set! (-> a1-4 message) 'no-look-around)
(set! (-> a1-4 param 0) (the-as uint 450))
(send-event-function arg0 a1-4)
)
#f
)
)
)
)
)
:trans
(the-as (function none :behavior wedge-plat) plat-trans)
:code
(behavior ()
(let ((gp-0 (-> self skel root-channel 0)))
(set!
(-> gp-0 frame-group)
(the-as art-joint-anim (-> self draw art-group data 3))
)
(set! (-> gp-0 param 0) (ja-aframe 60.0 0))
(set! (-> gp-0 param 1) 1.0)
(set! (-> gp-0 frame-num) (ja-aframe 0.0 0))
(joint-control-channel-group!
gp-0
(the-as art-joint-anim (-> self draw art-group data 3))
num-func-seek!
)
)
(until (ja-done? 0)
(dummy-27 self)
(suspend)
(let ((gp-1 (-> self skel root-channel 0)))
(set! (-> gp-1 param 0) (ja-aframe 60.0 0))
(set! (-> gp-1 param 1) 1.0)
(joint-control-channel-group-eval!
gp-1
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
(let ((gp-2 (-> self skel root-channel 0)))
(set!
(-> gp-2 frame-group)
(the-as art-joint-anim (-> self draw art-group data 3))
)
(set! (-> gp-2 param 0) (ja-aframe 100.0 0))
(set! (-> gp-2 param 1) 1.0)
(set! (-> gp-2 frame-num) (ja-aframe 60.0 0))
(joint-control-channel-group!
gp-2
(the-as art-joint-anim (-> self draw art-group data 3))
num-func-seek!
)
)
(until (ja-done? 0)
(dummy-27 self)
(suspend)
(let ((gp-3 (-> self skel root-channel 0)))
(set! (-> gp-3 param 0) (ja-aframe 100.0 0))
(set! (-> gp-3 param 1) 1.0)
(joint-control-channel-group-eval!
gp-3
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
(set!
(-> self state-time)
(the-as seconds (-> *display* base-frame-counter))
)
(until
(>=
(- (-> *display* base-frame-counter) (the-as int (-> self state-time)))
300
)
(let ((gp-4 (-> self skel root-channel 0)))
(set! (-> gp-4 num-func) num-func-identity)
(set! (-> gp-4 frame-num) (ja-aframe 100.0 0))
)
(dummy-27 self)
(suspend)
)
(let ((gp-5 (-> self skel root-channel 0)))
(set!
(-> gp-5 frame-group)
(the-as art-joint-anim (-> self draw art-group data 3))
)
(set! (-> gp-5 param 0) (ja-aframe 153.0 0))
(set! (-> gp-5 param 1) 1.0)
(set! (-> gp-5 frame-num) (ja-aframe 100.0 0))
(joint-control-channel-group!
gp-5
(the-as art-joint-anim (-> self draw art-group data 3))
num-func-seek!
)
)
(until (ja-done? 0)
(dummy-27 self)
(suspend)
(let ((gp-6 (-> self skel root-channel 0)))
(set! (-> gp-6 param 0) (ja-aframe 153.0 0))
(set! (-> gp-6 param 1) 1.0)
(joint-control-channel-group-eval!
gp-6
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
(go wedge-plat-idle)
(none)
)
:post
(the-as (function none :behavior wedge-plat) plat-post)
)
;; definition for method 11 of type wedge-plat
(defmethod copy-defaults! wedge-plat ((obj wedge-plat) (arg0 res-lump))
(set! (-> obj mask) (logior (process-mask platform) (-> obj mask)))
(let
((s4-0
(new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player))
)
)
(set! (-> s4-0 dynam) (copy *standard-dynamics* 'process))
(set! (-> s4-0 reaction) default-collision-reaction)
(set! (-> s4-0 no-reaction) nothing)
(dummy-29 s4-0 1)
(let
((s3-0
(new
'process
'collide-shape-prim-mesh
s4-0
(the-as uint 0)
(the-as uint 0)
)
)
)
(set! (-> s3-0 prim-core collide-as) (the-as uint 2048))
(set! (-> s3-0 collide-with) (the-as uint 16))
(set! (-> s3-0 prim-core action) (the-as uint 3))
(set! (-> s3-0 prim-core offense) 4)
(set! (-> s3-0 transform-index) 3)
(set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 24576.0)
)
(dummy-46 s4-0)
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
(dummy-50 s4-0)
(set! (-> obj root-override) s4-0)
)
(process-drawable-from-entity! obj arg0)
(dummy-14 obj *wedge-plat-sg* '())
(logior! (-> obj skel status) 1)
(dummy-47 (-> obj root-override))
(dummy-21 obj)
(set!
(-> obj master)
(the-as wedge-plat-master (entity-actor-lookup arg0 'alt-actor 0))
)
(set! (-> obj offset) (res-lump-float arg0 'rotoffset))
(set! (-> obj distance) (res-lump-float arg0 'distance :default 36864.0))
(logclear! (-> obj mask) (process-mask actor-pause))
(go wedge-plat-idle)
(none)
)
;; definition of type wedge-plat-outer
(deftype wedge-plat-outer (wedge-plat)
()
:heap-base #x80
:method-count-assert 28
:size-assert #xf0
:flag-assert #x1c008000f0
)
;; definition for method 3 of type wedge-plat-outer
(defmethod inspect wedge-plat-outer ((obj wedge-plat-outer))
(let ((t9-0 (method-of-type wedge-plat inspect)))
(t9-0 obj)
)
obj
)
;; failed to figure out what this is:
(let
((v1-7
(new 'static 'skeleton-group
:art-group-name "wedge-plat-outer"
:bounds (new 'static 'vector :w 32768.0)
:version #x6
)
)
)
(set! (-> v1-7 jgeo) 0)
(set! (-> v1-7 janim) 2)
(set! (-> v1-7 mgeo 0) (the-as uint 1))
(set! (-> v1-7 lod-dist 0) 4095996000.0)
(set! *wedge-plat-outer-sg* v1-7)
)
;; definition for method 27 of type wedge-plat-outer
(defmethod dummy-27 wedge-plat-outer ((obj wedge-plat-outer))
(let* ((a0-1 (-> obj master))
(v1-0 (if a0-1
(-> (the-as process-drawable (-> a0-1 ppointer)) brother)
)
)
)
(when v1-0
(let ((s4-0 (&-> v1-0 27))
(f30-0 (-> obj distance))
(f28-0
(the
float
(sar
(shl (the int (+ (the-as float (-> v1-0 33)) (-> obj offset))) 48)
48
)
)
)
(s5-0 #f)
)
(quaternion-axis-angle!
(-> obj root-override quat)
0.0
1.0
0.0
(the float (sar (shl (the int (- 49152.0 f28-0)) 48) 48))
)
(set!
(-> obj basetrans x)
(+ (the-as float (-> s4-0 0)) (* f30-0 (cos f28-0)))
)
(set! (-> obj basetrans y) (the-as float (-> s4-0 1)))
(set!
(-> obj basetrans z)
(+ (the-as float (-> s4-0 2)) (* f30-0 (sin f28-0)))
)
(let ((f0-16 (sin f28-0)))
(if (or (< 0.95 f0-16) (< f0-16 -0.95))
(set! s5-0 #t)
)
)
s5-0
)
)
)
)
;; failed to figure out what this is:
(defstate wedge-plat-outer-idle (wedge-plat-outer)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (if (= v1-0 'bonk)
(dummy-22 self)
)
)
)
)
:trans
(the-as (function none :behavior wedge-plat-outer) plat-trans)
:code
(behavior ()
(while #t
(let ((gp-0 (-> self skel root-channel 0)))
(set! (-> gp-0 num-func) num-func-identity)
(set! (-> gp-0 frame-num) (ja-aframe 0.0 0))
)
(if (dummy-27 self)
(go wedge-plat-outer-tip)
)
(suspend)
)
(none)
)
:post
(the-as (function none :behavior wedge-plat-outer) plat-post)
)
;; failed to figure out what this is:
(defstate wedge-plat-outer-tip (wedge-plat-outer)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'bonk)
(dummy-22 self)
)
((= v1-0 'touch)
(let ((a1-4 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-4 from) self)
(set! (-> a1-4 num-params) 1)
(set! (-> a1-4 message) 'no-look-around)
(set! (-> a1-4 param 0) (the-as uint 450))
(send-event-function arg0 a1-4)
)
)
)
)
)
)
:trans
(the-as (function none :behavior wedge-plat-outer) plat-trans)
:code
(behavior ()
(let ((gp-0 (-> self skel root-channel 0)))
(set!
(-> gp-0 frame-group)
(the-as art-joint-anim (-> self draw art-group data 3))
)
(set! (-> gp-0 param 0) (ja-aframe 60.0 0))
(set! (-> gp-0 param 1) 1.0)
(set! (-> gp-0 frame-num) (ja-aframe 0.0 0))
(joint-control-channel-group!
gp-0
(the-as art-joint-anim (-> self draw art-group data 3))
num-func-seek!
)
)
(until (ja-done? 0)
(dummy-27 self)
(suspend)
(let ((gp-1 (-> self skel root-channel 0)))
(set! (-> gp-1 param 0) (ja-aframe 60.0 0))
(set! (-> gp-1 param 1) 1.0)
(joint-control-channel-group-eval!
gp-1
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
(let ((gp-2 (-> self skel root-channel 0)))
(set!
(-> gp-2 frame-group)
(the-as art-joint-anim (-> self draw art-group data 3))
)
(set! (-> gp-2 param 0) (ja-aframe 100.0 0))
(set! (-> gp-2 param 1) 1.0)
(set! (-> gp-2 frame-num) (ja-aframe 60.0 0))
(joint-control-channel-group!
gp-2
(the-as art-joint-anim (-> self draw art-group data 3))
num-func-seek!
)
)
(until (ja-done? 0)
(dummy-27 self)
(suspend)
(let ((gp-3 (-> self skel root-channel 0)))
(set! (-> gp-3 param 0) (ja-aframe 100.0 0))
(set! (-> gp-3 param 1) 1.0)
(joint-control-channel-group-eval!
gp-3
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
(set!
(-> self state-time)
(the-as seconds (-> *display* base-frame-counter))
)
(until
(>=
(- (-> *display* base-frame-counter) (the-as int (-> self state-time)))
300
)
(let ((gp-4 (-> self skel root-channel 0)))
(set! (-> gp-4 num-func) num-func-identity)
(set! (-> gp-4 frame-num) (ja-aframe 100.0 0))
)
(dummy-27 self)
(suspend)
)
(let ((gp-5 (-> self skel root-channel 0)))
(set!
(-> gp-5 frame-group)
(the-as art-joint-anim (-> self draw art-group data 3))
)
(set! (-> gp-5 param 0) (ja-aframe 153.0 0))
(set! (-> gp-5 param 1) 1.0)
(set! (-> gp-5 frame-num) (ja-aframe 100.0 0))
(joint-control-channel-group!
gp-5
(the-as art-joint-anim (-> self draw art-group data 3))
num-func-seek!
)
)
(until (ja-done? 0)
(dummy-27 self)
(suspend)
(let ((gp-6 (-> self skel root-channel 0)))
(set! (-> gp-6 param 0) (ja-aframe 153.0 0))
(set! (-> gp-6 param 1) 1.0)
(joint-control-channel-group-eval!
gp-6
(the-as art-joint-anim #f)
num-func-seek!
)
)
)
(go wedge-plat-outer-idle)
(none)
)
:post
(the-as (function none :behavior wedge-plat-outer) plat-post)
)
;; definition for method 11 of type wedge-plat-outer
(defmethod
copy-defaults!
wedge-plat-outer
((obj wedge-plat-outer) (arg0 res-lump))
(set! (-> obj mask) (logior (process-mask platform) (-> obj mask)))
(let
((s4-0
(new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player))
)
)
(set! (-> s4-0 dynam) (copy *standard-dynamics* 'process))
(set! (-> s4-0 reaction) default-collision-reaction)
(set! (-> s4-0 no-reaction) nothing)
(dummy-29 s4-0 1)
(let
((s3-0
(new
'process
'collide-shape-prim-mesh
s4-0
(the-as uint 0)
(the-as uint 0)
)
)
)
(set! (-> s3-0 prim-core collide-as) (the-as uint 2048))
(set! (-> s3-0 collide-with) (the-as uint 16))
(set! (-> s3-0 prim-core action) (the-as uint 19))
(set! (-> s3-0 prim-core offense) 4)
(set! (-> s3-0 transform-index) 3)
(set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 32768.0)
)
(dummy-46 s4-0)
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
(dummy-50 s4-0)
(set! (-> obj root-override) s4-0)
)
(process-drawable-from-entity! obj arg0)
(dummy-14 obj *wedge-plat-sg* '())
(logior! (-> obj skel status) 1)
(dummy-47 (-> obj root-override))
(dummy-21 obj)
(set!
(-> obj master)
(the-as wedge-plat-master (entity-actor-lookup arg0 'alt-actor 0))
)
(set! (-> obj offset) (res-lump-float arg0 'rotoffset))
(set! (-> obj distance) (res-lump-float arg0 'distance :default 69632.0))
(logclear! (-> obj mask) (process-mask actor-pause))
(go wedge-plat-outer-idle)
(none)
)
+56 -20
View File
@@ -181,7 +181,18 @@ std::string g_iso_data_path = "";
bool g_dump_mode = false;
std::vector<std::pair<std::string, fs::path>> g_object_files_to_decompile_or_ref_check;
struct decomp_meta {
std::string fileName;
std::string fileNameOverride;
fs::path filePath;
};
std::vector<decomp_meta> g_object_files_to_decompile_or_ref_check;
std::vector<std::string> dgos = {"CGO/KERNEL.CGO", "CGO/ENGINE.CGO", "CGO/GAME.CGO", "DGO/BEA.DGO",
"DGO/INT.DGO", "DGO/VI1.DGO", "DGO/VI2.DGO", "DGO/VI3.DGO",
"DGO/CIT.DGO", "DGO/MIS.DGO", "DGO/JUB.DGO", "DGO/SUN.DGO",
"DGO/DEM.DGO", "DGO/FIN.DGO", "DGO/JUN.DGO", "DGO/FIC.DGO"};
} // namespace
@@ -200,7 +211,7 @@ int main(int argc, char** argv) {
// Determine the files to decompile and reference check by scanning the reference directory
// All relevant files are assumed to end with `_REF.g[c|d]`
// First rough order them
std::vector<std::pair<std::string, fs::path>> reference_files_rough_order;
std::vector<decomp_meta> reference_files_rough_order;
for (auto& p : fs::recursive_directory_iterator(
file_util::get_file_path({"test", "decompiler", "reference"}))) {
if (p.is_regular_file()) {
@@ -209,7 +220,7 @@ int main(int argc, char** argv) {
continue;
}
std::string object_name = replaceFirstOccurrence(file_name, "_REF", "");
reference_files_rough_order.push_back({object_name, p.path()});
reference_files_rough_order.push_back({object_name, "", p.path()});
}
}
// use the all_objs.json file to place them in the correct build order
@@ -218,8 +229,33 @@ int main(int argc, char** argv) {
"all_objs.json");
for (auto& x : j) {
auto mapped_name = x[0].get<std::string>();
std::vector<std::string> dgoList = x[3].get<std::vector<std::string>>();
for (auto& p : reference_files_rough_order) {
if (p.first == mapped_name) {
if (p.fileName == mapped_name) {
// Check to see if we've included atleast one of the DGO/CGOs in our hardcoded list
// If not BLOW UP
bool dgoValidated = false;
for (int i = 0; i < dgoList.size(); i++) {
std::string& dgo = dgoList.at(i);
// can either be in the DGO or CGO folder, and can either end with .CGO or .DGO
if (std::find(dgos.begin(), dgos.end(), fmt::format("DGO/{}.DGO", dgo)) != dgos.end() ||
std::find(dgos.begin(), dgos.end(), fmt::format("DGO/{}.CGO", dgo)) != dgos.end() ||
std::find(dgos.begin(), dgos.end(), fmt::format("CGO/{}.DGO", dgo)) != dgos.end() ||
std::find(dgos.begin(), dgos.end(), fmt::format("CGO/{}.CGO", dgo)) != dgos.end()) {
dgoValidated = true;
}
}
if (!dgoValidated) {
fmt::print(
"File [{}] is in the following DGOs [{}], and not one of these is in our list! Add "
"it!\n",
mapped_name, fmt::join(dgoList, ", "));
return 1;
}
// Hack for working around multi-DGO files
if (mapped_name != x[1]) {
p.fileNameOverride = x[1];
}
g_object_files_to_decompile_or_ref_check.push_back(p);
break;
}
@@ -281,15 +317,13 @@ class OfflineDecompilation : public ::testing::Test {
std::unordered_set<std::string> object_files;
for (auto& p : g_object_files_to_decompile_or_ref_check) {
object_files.insert(p.first);
std::string fileName = p.fileNameOverride == "" ? p.fileName : p.fileNameOverride;
object_files.insert(fileName);
}
config->allowed_objects = object_files;
// don't try to do this because we can't write the file
config->generate_symbol_definition_map = false;
std::vector<std::string> dgos = {"CGO/KERNEL.CGO", "CGO/ENGINE.CGO", "CGO/GAME.CGO",
"DGO/BEA.DGO", "CGO/L1.CGO", "DGO/INT.DGO",
"DGO/VI1.DGO", "DGO/DEM.DGO"};
std::vector<std::string> dgo_paths;
if (g_iso_data_path.empty()) {
for (auto& x : dgos) {
@@ -476,16 +510,17 @@ void strip_trailing_newlines(std::string& in) {
} // namespace
TEST_F(OfflineDecompilation, Reference) {
for (auto& file : g_object_files_to_decompile_or_ref_check) {
auto& obj_l = db->obj_files_by_name.at(file.first);
for (decomp_meta& file : g_object_files_to_decompile_or_ref_check) {
std::string fileName = file.fileNameOverride == "" ? file.fileName : file.fileNameOverride;
auto& obj_l = db->obj_files_by_name.at(fileName);
ASSERT_EQ(obj_l.size(), 1);
std::string src = db->ir2_final_out(obj_l.at(0));
lg::info("Comparing {}...", file.first);
lg::info("Comparing {}...", fileName);
// NOTE - currently only handles .gc files!
auto reference = file_util::read_text_file(file.second.string());
auto reference = file_util::read_text_file(file.filePath.string());
bool can_cache = true;
for (auto& func_list : obj_l.at(0).linked_data.functions_by_seg) {
@@ -499,8 +534,8 @@ TEST_F(OfflineDecompilation, Reference) {
}
if (can_cache) {
EXPECT_EQ(final_output_cache->count(file.first), 0);
final_output_cache->insert({file.first, src});
EXPECT_EQ(final_output_cache->count(fileName), 0);
final_output_cache->insert({file.fileName, src});
}
strip_trailing_newlines(reference);
@@ -509,7 +544,7 @@ TEST_F(OfflineDecompilation, Reference) {
if (g_dump_mode) {
if (reference != src) {
file_util::create_dir_if_needed("./failures");
file_util::write_text_file("./failures/" + file.first + "_REF.gc", src);
file_util::write_text_file("./failures/" + file.fileName + "_REF.gc", src);
EXPECT_TRUE(false);
}
} else {
@@ -538,17 +573,18 @@ TEST_F(OfflineDecompilation, Compile) {
Timer timer;
int total_lines = 0;
for (auto& file : g_object_files_to_decompile_or_ref_check) {
if (g_files_to_skip_compiling.find(file.first) != g_files_to_skip_compiling.end()) {
for (decomp_meta& file : g_object_files_to_decompile_or_ref_check) {
std::string fileName = file.fileNameOverride == "" ? file.fileName : file.fileNameOverride;
if (g_files_to_skip_compiling.find(fileName) != g_files_to_skip_compiling.end()) {
continue;
}
lg::info("Compiling {}...", file.first);
lg::info("Compiling {}...", fileName);
auto& obj_l = db->obj_files_by_name.at(file.first);
auto& obj_l = db->obj_files_by_name.at(fileName);
ASSERT_EQ(obj_l.size(), 1);
const auto& cache = final_output_cache->find(file.first);
const auto& cache = final_output_cache->find(fileName);
if (cache != final_output_cache->end()) {
const auto& src = cache->second;
total_lines += line_count(src);
+3 -1
View File
@@ -259,7 +259,9 @@ void follow_references_to_find_pointers(
if (type_system.fully_defined_type_exists(to_check.first)) {
auto type_info = dynamic_cast<StructureType*>(type_system.lookup_type(to_check.first));
assert(type_info);
if (type_info == NULL) {
continue;
}
for (auto& field : type_info->fields()) {
if (type_system.fully_defined_type_exists(field.type())) {
auto field_info = type_system.lookup_type(field.type());