some cleanup and docs on collide-touch and the tie extractor (#1074)

* some cleanup and docs on collide-touch and the tie extractor

* temp

* more updates

* update ref tests

* type fix

* rest of collide shape

* another set of updates
This commit is contained in:
water111
2022-01-12 10:47:17 -05:00
committed by GitHub
parent 4bb1cbf304
commit c3b6e7eb7e
225 changed files with 7321 additions and 7278 deletions
+3 -3
View File
@@ -622,12 +622,12 @@ TP_Type SimpleExpression::get_type_int2(const TypeState& input,
return TP_Type::make_from_ts(arg0_type.typespec());
}
if (m_kind == Kind::ADD && tc(dts, TypeSpec("structure"), arg0_type) &&
if ((m_kind == Kind::ADD || m_kind == Kind::SUB) && tc(dts, TypeSpec("structure"), arg0_type) &&
arg1_type.is_integer_constant()) {
auto type_info = dts.ts.lookup_type(arg0_type.typespec());
// get next in memory, allow this as &+
if ((u64)type_info->get_size_in_memory() == arg1_type.get_integer_constant()) {
// get next in memory, allow this as &+/&-
if ((s64)type_info->get_size_in_memory() == std::abs((s64)arg1_type.get_integer_constant())) {
return TP_Type::make_from_ts(arg0_type.typespec());
}
+1 -1
View File
@@ -387,7 +387,7 @@ IR2_BranchDelay get_branch_delay(const Instruction& i0, int idx) {
return IR2_BranchDelay(IR2_BranchDelay::Kind::NOP);
} else if (is_gpr_3(i0, InstructionKind::OR, {}, rs7(), rr0())) {
return IR2_BranchDelay(IR2_BranchDelay::Kind::SET_REG_FALSE, make_dst_var(i0, idx));
} else if (is_gpr_3(i0, InstructionKind::OR, {}, {}, rr0())) {
} else if (is_gpr_3(i0, InstructionKind::OR, {}, {}, rr0()) && !i0.get_src(0).is_reg(rr0())) {
return IR2_BranchDelay(IR2_BranchDelay::Kind::SET_REG_REG, make_dst_var(i0, idx),
make_src_var(i0.get_src(0).get_reg(), idx));
} else if (i0.kind == InstructionKind::DADDIU && i0.get_src(0).is_reg(rs7()) &&
+67 -62
View File
@@ -11029,12 +11029,12 @@
:flag-assert #x1000000028
(:methods
(debug-draw-tris (_type_ process-drawable int) none 9)
(dummy-10 (_type_ object vector) none 10) ;; what is the second arg!?
(dummy-11 (_type_ collide-mesh-cache-tri collide-tri-result vector float) none 11)
(dummy-12 (_type_ collide-mesh-cache-tri collide-tri-result vector float) float 12)
(dummy-13 (_type_) none 13)
(dummy-14 (_type_) none 14)
(dummy-15 (_type_) none 15)
(overlap-test (_type_ collide-mesh-cache-tri vector) symbol 10)
(should-push-away-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float 11) ;; spat
(sphere-on-platform-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float 12) ;; sopt
(populate-cache! (_type_ collide-mesh-cache-tri matrix) none 13)
(dummy-14 (_type_ object object) none 14)
(dummy-15 (_type_ object object object) none 15)
)
)
@@ -11048,7 +11048,7 @@
:size-assert #xa020
:flag-assert #xc0000a020
(:methods
(dummy-9 (_type_) none 9)
(allocate! (_type_ int) int 9)
(is-id? (_type_ int) symbol 10)
(next-id! (_type_) uint 11)
)
@@ -11110,7 +11110,7 @@
(deftype pull-rider-info (structure)
((rider collide-sticky-rider :offset-assert 0)
(rider-cshape collide-shape-prim :offset-assert 4) ;; collide-shape-prim fixes some methods...but this is likely a collide-shape...right (it fixes other methods!)
(rider-cshape collide-shape-moving :offset-assert 4)
(rider-delta-ry float :offset-assert 8)
(rider-dest vector :inline :offset-assert 16)
)
@@ -11165,9 +11165,9 @@
:type uint64
:bitfield #t
(background 0)
(cak-1 1) ;;
(cak-2 2)
(cak-3 3)
(cak-1 1) ;; hit by player
(cak-2 2) ;; usually hit by player
(cak-3 3) ;; hit by others
(target 4) ;; target
(water 5)
(powerup 6)
@@ -11188,7 +11188,7 @@
(solid 0)
(ca-1 1) ;; sticky?
(ca-2 2) ;; target?
(ca-3 3) ;; edge grab related
(ca-3 3) ;; edge grab related? if set, we can't initiate collision.
(ca-4 4)
(ca-5 5) ;; unused?
(ca-6 6) ;; swing pole, manipy
@@ -11237,6 +11237,7 @@
)
(declare-type collide-cache-prim structure)
(declare-type collide-shape-prim-group basic)
(deftype collide-shape-prim (basic)
((cshape collide-shape :offset-assert 4)
(prim-id uint32 :offset-assert 8)
@@ -11256,23 +11257,23 @@
:flag-assert #x1c00000048
(:methods
(new (symbol type collide-shape uint int) _type_ 0)
(dummy-9 (_type_ vector) object 9) ;; ret - symbol | float
(dummy-10 (_type_ uint) collide-shape-prim 10)
(move-by-vector! (_type_ vector) none 9)
(find-prim-by-id (_type_ uint) collide-shape-prim 10)
(debug-draw-world-sphere (_type_) symbol 11)
(add-fg-prim-using-box (_type_ process-drawable) none 12)
(add-fg-prim-using-line-sphere (_type_ process-drawable) none 13)
(add-fg-prim-using-y-probe (_type_ process-drawable) none 14)
(overlaps-others-test (_type_) symbol 15)
(dummy-16 () none 16)
(overlaps-others-test (_type_ overlaps-others-params collide-shape-prim) symbol 15)
(overlaps-others-group (_type_ overlaps-others-params collide-shape-prim-group) symbol 16)
(dummy-17 () none 17)
(collide-with-collide-cache-prim-mesh (_type_ collide-shape-intersect collide-cache-prim) none 18)
(collide-with-collide-cache-prim-sphere (_type_ collide-shape-intersect collide-cache-prim) none 19)
(dummy-20 (_type_ collide-kind) symbol 20)
(add-to-bounding-box (_type_ collide-kind) symbol 20)
(num-mesh (_type_ collide-shape-prim) int 21)
(on-platform-test (_type_ _type_ collide-overlap-result float) pat-surface 22)
(should-push-away-test () none 23)
(dummy-24 () none 24)
(dummy-25 (_type_ process-drawable) symbol 25)
(on-platform-test (_type_ collide-shape-prim collide-overlap-result float) none 22)
(should-push-away-test (_type_ collide-shape-prim collide-overlap-result) none 23)
(should-push-away-reverse-test (_type_ collide-shape-prim-group collide-overlap-result) none 24)
(update-transforms! (_type_ process-drawable) symbol 25)
(set-collide-as! (_type_ collide-kind) none 26)
(set-collide-with! (_type_ collide-kind) none 27)
)
@@ -11293,7 +11294,7 @@
((mesh collide-mesh :offset-assert 72)
(mesh-id int32 :offset-assert 76)
(mesh-cache-id uint64 :offset-assert 80)
(mesh-cache-tris uint32 :offset-assert 88)
(mesh-cache-tris (inline-array collide-mesh-cache-tri) :offset-assert 88)
)
:method-count-assert 29
:size-assert #x5c
@@ -11306,6 +11307,7 @@
(deftype collide-shape-prim-group (collide-shape-prim)
((num-prims int32 :offset-assert 72)
(num-prims-u uint32 :offset 72)
(allocated-prims int32 :offset-assert 76)
(prim collide-shape-prim 1 :offset-assert 80)
(prims collide-shape-prim :dynamic :score 20 :offset 80) ;; added
@@ -11316,7 +11318,7 @@
(:methods
(new (symbol type collide-shape uint int) _type_ 0)
(append-prim (_type_ collide-shape-prim) none 28)
(dummy-29 (_type_ uint) none 29)
(add-to-non-empty-bounding-box (_type_ collide-kind) none 29)
)
)
@@ -11341,34 +11343,34 @@
:flag-assert #x38000000b8
(:methods
(new (symbol type process-drawable collide-list-enum) _type_)
(TODO-RENAME-28 (_type_ vector) object 28) ;; ret - symbol | float (CSPG::9)
(dummy-29 (_type_ int) none 29)
(TODO-RENAME-30 (_type_ vector) object 30) ;; ret - symbol | float (CSPG::9)
(move-by-vector! (_type_ vector) none 28)
(alloc-riders (_type_ int) none 29)
(move-to-point! (_type_ vector) none 30) ;; ret - symbol | float (CSPG::9)
(debug-draw (_type_) none 31)
(dummy-32 (_type_ object collide-kind) none 32)
(dummy-33 (_type_ vector collide-kind) none 33)
(dummy-34 (_type_ uint) collide-shape-prim 34)
(dummy-35 (_type_) symbol 35)
(dummy-36 (_type_ bounding-box float collide-kind) symbol 36)
(dummy-37 (_type_ vector) none 37)
(fill-cache-for-shape! (_type_ float collide-kind) none 32)
(fill-cache-integrate-and-collide! (_type_ vector collide-kind) none 33)
(find-prim-by-id (_type_ uint) collide-shape-prim 34)
(detect-riders! (_type_) symbol 35)
(build-bounding-box-for-shape (_type_ bounding-box float collide-kind) symbol 36)
(integrate-and-collide! (_type_ vector) none 37)
(find-collision-meshes (_type_) symbol 38)
(dummy-39 (_type_ collide-shape collide-overlap-result) symbol 39)
(dummy-40 (_type_ structure) none 40) ;; ?? - I've seen overlaps-others-params | collide-edge-hold-list
(on-platform (_type_ collide-shape collide-overlap-result) symbol 39)
(find-overlapping-shapes (_type_ overlaps-others-params) symbol 40) ;; check if blocked??
(dummy-41 (_type_ attack-info float) vector 41)
(dummy-42 (_type_ collide-shape collide-work) none 42) ; collide-work is a guess
(dummy-43 (_type_ pull-rider-info) none 43)
(dummy-44 (_type_) symbol 44)
(dummy-45 (_type_) symbol 45)
(compute-overlap (_type_ collide-shape collide-overlap-result) symbol 42)
(pull-rider! (_type_ pull-rider-info) none 43)
(pull-riders! (_type_) symbol 44)
(respond-to-collisions! (_type_) symbol 45)
(set-root-prim! (_type_ collide-shape-prim) collide-shape-prim 46)
(dummy-47 (_type_) symbol 47)
(update-transforms! (_type_) symbol 47)
(clear-collide-with-as (_type_) none 48)
(restore-collide-with-as (_type_) none 49)
(backup-collide-with-as (_type_) none 50)
(set-root-prim-collide-with! (_type_ collide-kind) none 51)
(set-root-prim-collide-as! (_type_ collide-kind) none 52)
(dummy-53 (_type_ int collide-kind collide-kind) none 53)
(dummy-54 (_type_ int collide-offense) none 54)
(dummy-55 (_type_ process touching-shapes-entry float float float) none 55)
(set-collide-kinds (_type_ int collide-kind collide-kind) none 53)
(set-collide-offense (_type_ int collide-offense) none 54)
(send-shove-back (_type_ process touching-shapes-entry float float float) none 55)
)
)
@@ -11379,7 +11381,7 @@
(poly-pat pat-surface :offset-assert 256)
(cur-pat pat-surface :offset-assert 260)
(ground-pat pat-surface :offset-assert 264)
(status uint64 :offset-assert 272)
(status uint64 :offset-assert 272) ;; 1: onsurf 2: onground 4: tsurf 8: twall 16: t-ciel 32: t-act ?? 1024: on-water
(old-status uint64 :offset-assert 280)
(prev-status uint64 :offset-assert 288)
(reaction-flag uint32 :offset-assert 296)
@@ -11404,14 +11406,14 @@
:flag-assert #x41000001bc
(:methods
(set-and-handle-pat! (_type_ pat-surface) none 56)
(dummy-57 (_type_ vector) none 57)
(integrate-no-collide! (_type_ vector) none 57)
(dummy-58 (_type_ vector) symbol 58)
(dummy-59 (_type_ vector uint float symbol symbol symbol) none 59)
(dummy-60 (_type_ float float symbol collide-kind) symbol 60)
(TODO-RENAME-61 (_type_ vector vector vector) none 61)
(dummy-62 (_type_ vector float) vector 62)
(dummy-63 (_type_ vector vector float) float 63)
(dummy-64 (_type_ collide-tri-result vector) none 64)
(integrate-for-enemy-with-move-to-ground! (_type_ vector collide-kind float symbol symbol symbol) none 59)
(move-to-ground (_type_ float float symbol collide-kind) symbol 60)
(move-to-ground-point! (_type_ vector vector vector) none 61)
(compute-acc-due-to-gravity (_type_ vector float) vector 62)
(step-collison! (_type_ vector vector float) float 63)
(move-to-tri! (_type_ collide-tri-result vector) none 64)
)
)
@@ -11503,7 +11505,7 @@
(unknown-vector51 vector :inline :offset 1200) ;; from - logic-target::build-conversions
(unknown-vector52 vector :inline :offset 1216)
(unknown-vector53 vector :inline :offset 1232)
(unknown-vector54 vector :inline :offset 1248)
(last-known-safe-ground vector :inline :offset 1248)
(unknown-vector55 vector :inline :offset 1264)
(unknown-dword10 int64 :offset 1280) ;; from - collide-reaction-target::target-collision-reaction
(unknown-dword11 int64 :offset 1288) ;; from - target-util::can-jump?
@@ -11639,10 +11641,10 @@
:size-assert #xe4
:flag-assert #xd000000e4
(:methods
(get-touched-prim (_type_ trsqv touching-prims-entry) collide-shape-prim 9)
(get-touched-prim (_type_ trsqv touching-shapes-entry) collide-shape-prim 9)
(dummy-10 () none 10)
(dummy-11 (_type_ vector) vector 11)
(get-touched-tri (_type_ touching-prims-entry touching-prims-entry) collide-tri-result 12)
(get-middle-of-bsphere-overlap (_type_ vector) vector 11)
(get-touched-tri (_type_ collide-shape touching-shapes-entry) collide-tri-result 12)
)
)
@@ -11656,7 +11658,7 @@
(:methods
(new (symbol type) _type_ 0)
(alloc-node (_type_) touching-prims-entry 9)
(get-size (_type_) int 10)
(get-free-node-count (_type_) int 10)
(init-list! (_type_) none 11)
(free-node (_type_ touching-prims-entry) touching-prims-entry 12)
)
@@ -11678,8 +11680,8 @@
(dummy-11 () none 11)
(prims-touching? (_type_ collide-shape-moving uint) touching-prims-entry 12) ; this one!
(prims-touching-action? (_type_ collide-shape collide-action collide-action) touching-prims-entry 13)
(free-list () none 14)
(free-entry-list (_type_) symbol 15)
(dummy-14 () none 14)
(free-touching-prims-list (_type_) symbol 15)
(get-head (_type_) touching-prims-entry 16)
(get-next (_type_ touching-prims-entry) touching-prims-entry 17)
)
@@ -11697,10 +11699,10 @@
(new (symbol type) _type_ 0)
(add-touching-prims (_type_ collide-shape-prim collide-shape-prim float collide-tri-result collide-tri-result) none 9)
(dummy-10 () none 10)
(dummy-11 (_type_ float) none 11)
(dummy-12 (_type_) none 12)
(update-from-step-size (_type_ float) none 11)
(send-events-for-touching-shapes (_type_) none 12)
(get-shapes-entry (_type_ collide-shape collide-shape) touching-shapes-entry 13)
(dummy-14 (_type_) none 14)
(free-all-prim-nodes (_type_) none 14)
)
)
@@ -12079,7 +12081,7 @@
:size-assert #x248 ;;#x250
:flag-assert #x1501e00248 ;;#x1501e00250
(:methods
(dummy-20 (_type_ collide-cache) object 20) ;; none or #f
(find-edge-grabs! (_type_ collide-cache) object 20) ;; none or #f
)
(:states
(target-jump float float surface)
@@ -12550,7 +12552,7 @@
:size-assert #x8670
:flag-assert #x2100008670
(:methods
(dummy-9 (_type_) none 9)
(debug-draw (_type_) none 9)
(fill-and-probe-using-line-sphere (_type_ vector vector float collide-kind process collide-tri-result int) float 10)
(fill-and-probe-using-spheres (_type_ collide-using-spheres-params) none 11)
(fill-and-probe-using-y-probe (_type_ vector float collide-kind process collide-tri-result uint) float 12)
@@ -21998,6 +22000,9 @@
(deftype viewer (process-drawable)
((janim art-joint-anim :offset-assert 176)
)
(:states
viewer-process
)
:method-count-assert 20
:size-assert #xb4
:heap-base #x50
@@ -242,17 +242,6 @@
"(method 18 collide-edge-work)", // CFG
"(method 10 collide-edge-hold-list)", // CFG
// collide-shape
"(method 15 collide-shape-prim-mesh)", // CFG
"(method 15 collide-shape-prim-sphere)", // CFG
"(method 16 collide-shape-prim)", // CFG
"(method 15 collide-shape-prim-group)", // CFG
"(method 18 collide-shape-prim-sphere)",
"(method 23 collide-shape-prim-sphere)", // CFG
"(method 23 collide-shape-prim-mesh)", // BUG - crash in variable pass
"(method 24 collide-shape-prim)", // CFG
"(method 23 collide-shape-prim-group)", // CFG
"(method 42 collide-shape)", // CFG
"(method 12 collide-mesh)",
@@ -482,7 +471,23 @@
"draw-bones-hud": [7, 8],
"(method 16 drawable-tree)": [7, 9, 10],
"(method 21 collide-cache)" : [3, 5, 19, 20,24,25,28,29],
"(method 14 collide-cache)" : [0, 1,2, 3, 4, 5]
"(method 14 collide-cache)" : [0, 1,2, 3, 4, 5],
"(method 9 collide-mesh-cache)" : [0, 1, 2, 5],
"(method 42 collide-shape)" : [0, 1, 2, 3, 4, 7],
"(method 23 collide-shape-prim-group)" : [1, 2, 3, 4, 5],
"(method 23 collide-shape-prim-mesh)" : [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14],
"(method 23 collide-shape-prim-sphere)" : [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14],
"(method 18 collide-shape-prim-sphere)" : [1, 3,4, 5, 7],
"(method 45 collide-shape)" : [0, 16, 42, 67, 92],
"(method 24 collide-shape-prim)" : [2, 3, 4, 5, 1],
"(method 20 collide-shape-prim-group)" : [11],
"(method 28 collide-shape-prim-mesh)" : [10],
"(method 40 collide-shape)": [0, 2,5,6,7, 11,12, 28, 43, 58, 63],
"(method 15 collide-shape-prim-group)" : [1, 2, 3, 4, 5, 6],
"(method 16 collide-shape-prim)" : [1, 2, 3, 4, 5, 6],
"(method 15 collide-shape-prim-sphere)" : [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19],
"(method 15 collide-shape-prim-mesh)" : [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 29],
"(method 35 collide-shape)" : [1]
},
// Sometimes the game might use format strings that are fetched dynamically,
@@ -4147,7 +4147,7 @@
],
"(method 35 collide-shape)": [
[16, "pull-rider-info"],
[16, "collide-overlap-result"],
[128, "matrix"],
[192, "event-message-block"],
[272, "collide-overlap-result"],
@@ -4196,11 +4196,11 @@
"(method 59 collide-shape-moving)": [
[16, "collide-tri-result"],
[112, "touching-shapes-entry"]
[112, "overlaps-others-params"]
],
"(method 58 collide-shape-moving)": [
[16, "touching-shapes-entry"]
[16, "overlaps-others-params"]
],
"simple-collision-reaction": [
@@ -4256,16 +4256,16 @@
],
"(method 45 collide-shape)": [
[16, "collide-work"],
[16, "collide-overlap-result"],
[128, "vector"],
[144, "vector"],
[160, "collide-work"],
[160, "collide-overlap-result"],
[272, "vector"],
[288, "vector"],
[304, "collide-work"],
[304, "collide-overlap-result"],
[416, "vector"],
[432, "vector"],
[448, "collide-work"],
[448, "collide-overlap-result"],
[560, "vector"],
[576, "vector"]
],
@@ -6067,5 +6067,21 @@
[16, "bounding-box"]
],
"(method 23 collide-shape-prim-mesh)" :[
[16, "collide-tri-result"]
],
"(method 23 collide-shape-prim-sphere)" : [
[16, "vector"],
[32, "vector"],
[48, "collide-tri-result"],
[144, "vector"],
[160, "vector"]
],
"(method 18 collide-shape-prim-sphere)" : [
[16, "collide-tri-result"]
],
"placeholder-do-not-add-below!": []
}
@@ -5623,19 +5623,19 @@
],
"(method 14 touching-list)": [
[5, "s5", "touching-shapes-entry"],
[10, "s5", "touching-shapes-entry"]
[[0,11], "s5", "touching-shapes-entry"]
],
"(method 13 touching-list)": [
[5, "v0", "touching-shapes-entry"],
[10, "v0", "touching-shapes-entry"],
[17, "v0", "touching-shapes-entry"],
[26, "v0", "touching-shapes-entry"],
[46, "v0", "touching-shapes-entry"],
[47, "v0", "touching-shapes-entry"],
[48, "v0", "touching-shapes-entry"],
[50, "v0", "touching-shapes-entry"]
[[0, 51], "v0", "touching-shapes-entry"]
// [5, "v0", "touching-shapes-entry"],
// [10, "v0", "touching-shapes-entry"],
// [17, "v0", "touching-shapes-entry"],
// [26, "v0", "touching-shapes-entry"],
// [46, "v0", "touching-shapes-entry"],
// [47, "v0", "touching-shapes-entry"],
// [48, "v0", "touching-shapes-entry"],
// [50, "v0", "touching-shapes-entry"]
],
"(method 11 touching-list)": [
@@ -5697,17 +5697,15 @@
],
"(method 28 collide-shape-prim-mesh)": [
[27, "s4", "collide-shape-prim-group"]
[[22,45], "s4", "(array collide-mesh)"]
],
"(method 53 collide-shape)": [
[26, "a1", "collide-shape-prim-group"],
[36, "v1", "collide-shape-prim-group"]
[[24, 40], "v1", "collide-shape-prim-group"]
],
"(method 54 collide-shape)": [
[22, "a1", "collide-shape-prim-group"],
[29, "v1", "collide-shape-prim-group"]
[[18, 33], "v1", "collide-shape-prim-group"]
],
"(method 45 collide-shape)": [
@@ -5815,7 +5813,8 @@
],
"(method 22 collide-shape-prim-mesh)": [
[10, "s4", "collide-shape-prim-group"]
[10, "s4", "collide-shape-prim-group"],
[41, "s4", "collide-shape-prim-group"]
],
"(method 44 collide-shape)": [
@@ -7551,5 +7550,45 @@
[[217, 227], "s3", "collide-list-item"]
],
"(method 23 collide-shape-prim-sphere)": [
[[74,114], "s4", "collide-shape-prim-mesh"]
],
"(method 13 collide-mesh)" : [
[[0, 60], "a3", "(inline-array vector)"],
[[61, 123], "v1", "collide-mesh-tri"]
],
"(method 20 collide-shape-prim-group)": [
[5, "gp", "pointer"],
[6, "v1", "(pointer collide-shape-prim)"],
[[7,14], "a0", "collide-shape-prim"],
[32, "gp", "pointer"],
[33, "v1", "(pointer collide-shape-prim)"],
[[34,40], "a0", "collide-shape-prim"],
[[40, 46], "a0", "collide-shape-prim-group"]
],
"(method 29 collide-shape-prim-group)" : [
[5, "gp", "pointer"],
[6, "v1", "(pointer collide-shape-prim)"],
[[13, 19], "a0", "collide-shape-prim-group"]
],
"(method 40 collide-shape)" : [
[21, "a0", "connection"],
[[22,40], "a0", "collide-shape-moving"],
[85, "a0", "connection"],
[[86, 104], "a0", "collide-shape-moving"],
[147, "a0", "connection"],
[[148, 166], "a0", "collide-shape-moving"],
[209, "a0", "connection"],
[[210, 228], "a0", "collide-shape-moving"]
],
"(method 15 collide-shape-prim-sphere)" : [
[[16, 55], "gp", "collide-shape-prim-mesh"]
],
"placeholder-do-not-add-below": []
}
@@ -3932,5 +3932,17 @@
}
},
"(method 13 touching-list)": {
"vars": {
"v0-0": ["v0-0", "touching-shapes-entry"]
}
},
"(method 11 touching-list)": {
"vars": {
"s5-0": ["s5-0", "touching-shapes-entry"]
}
},
"aaaaaaaaaaaaaaaaaaaaaaa": {}
}
+238 -76
View File
@@ -160,6 +160,15 @@ void extract_vis_data(const level_tools::DrawableTreeInstanceTie* tree,
}
}
// Each TIE prototype is broken up into "fragments". These "fragments" have some maximum size based
// on the VU memory limit, so an instance may have multiple fragments, depending on how many
// vertices are in the model.
// Each instance has different set of time of day colors per fragment in the prototype.
// this type contains the indicies of these colors.
// For the PC port we combine all colors into a single "big palette".
// this stores the indices as indices into the original game's per fragment palette.
// and an offset for where this palette is located in the big palette.
struct TieInstanceFragInfo {
// the color index table uploaded to VU.
// this contains indices into the shared palette.
@@ -168,26 +177,11 @@ struct TieInstanceFragInfo {
// in the PC port format, we upload a single giant time of day color. this points to the offset
// of the colors from this frag instance.
u16 color_index_offset_in_big_palette = -1;
math::Vector<u32, 4> lq_colors_ui(u32 qw) const {
// note: this includes the unpack
assert(qw >= 204);
qw -= 204;
qw *= 4;
assert(qw + 4 <= color_indices.size());
math::Vector<u32, 4> result;
for (int i = 0; i < 4; i++) {
result[i] = color_indices.at(qw + i);
}
return result;
}
};
// Each TIE instance has one of these. This is reorganized/unpacked data from the instance-tie type.
struct TieInstanceInfo {
// The index of the prototype (the geometry) that is used by this instance
// note: we're going to trust that this lines up with bucket.
// if this assumption is wrong, we'll be drawing with the wrong model and it will be super
// obvious.
u16 prototype_idx = 0;
// our bsphere's index in the BVH tree
@@ -197,33 +191,44 @@ struct TieInstanceInfo {
// actually cull using the tree)
math::Vector4f bsphere;
// the transformation matrix, unpacked from the weird TIE format.
// this can be used to transform points directly to world-space points that work
// with the normal math camera stuff.
std::array<math::Vector4f, 4> mat;
// this value is stashed inside the above matrix. It tells which "wind" we should use
// we just need to pass this along to the C++ rendering code.
u16 wind_index = 0;
float unknown_wind_related_value = 0.f; // w of the first mat vec.
std::vector<TieInstanceFragInfo> frags; // per-instance per-fragment info
std::vector<TieInstanceFragInfo> frags; // per-instance per-fragment info (just colors)
};
// The 5 qw of adgif data contains draw settings, and they also snuck in some extra data.
struct AdgifInfo {
u32 first_w;
u32 second_w;
u32 third_w;
u32 combo_tex;
u64 alpha_val;
u64 clamp_val;
// secret stuff they snuck in
u32 first_w; // VU memory offset
u32 second_w; // some size
u32 third_w; // unused, at least for not-near TIE
// the draw settings we care about:
u32 combo_tex; // PC texture ID
u64 alpha_val; // alpha blend settings
u64 clamp_val; // texture clamp settings
};
// When the prototype is uploaded, it places a bunch of strgif tags in VU memory.
// we'll need to remember where these are.
struct StrGifInfo {
u16 address;
u16 nloop;
u16 mode; // not yet fully understood, but can allow the use of other templates.
bool eop;
u16 address; // vu memory address
u16 nloop; // the nloop field of this strgif (how much to send)
u16 mode; // not yet fully understood, but can allow the use of other templates
bool eop; // end of packet flag
};
// data per vertex in a tie prototype
struct TieProtoVertex {
math::Vector<float, 3> pos;
math::Vector<float, 3> tex;
math::Vector<float, 3> pos; // position
math::Vector<float, 3> tex; // texture coordinate
// NOTE: this is a double lookup.
// first you look up the index in the _instance_ color table
@@ -231,26 +236,34 @@ struct TieProtoVertex {
u32 color_index_index;
};
// a tie fragment is made up of strips. Each strip has a single adgif info, and vertices
// the vertices make up a triangle strip
struct TieStrip {
AdgifInfo adgif;
std::vector<TieProtoVertex> verts;
};
// the tie fragment
// this is a per-prototype (all instances share the same TieFrags)
struct TieFrag {
bool has_magic_tex0_bit = false;
std::vector<AdgifInfo> adgifs;
bool has_magic_tex0_bit = false; // use decal mode (todo)
std::vector<AdgifInfo>
adgifs; // the adgifs that come with this tiefrag (different strips can hve different)
std::vector<u8> other_gif_data;
std::vector<u8> points_data;
std::vector<u32> point_sizes;
std::vector<u8> other_gif_data; // data sent from EE asm code, sizes/offsets/metadata
std::vector<u8> points_data; // data sent from EE asm code, actual vertex data
// number of "dverts" expected from game's metadata. we check our extraction from this.
u32 expected_dverts = 0;
// all the strips in this fragment
std::vector<TieStrip> strips;
// this contains vertices, key is the start of the actual xyzf/st/rgbaq data for it.
// this contains vertices, key is the address of the actual xyzf/st/rgbaq data in VU1 memory
// after the prototype program runs
std::unordered_map<u32, TieProtoVertex> vertex_by_dest_addr;
// simulate a load in the points data (using vu mem addr)
math::Vector<float, 4> lq_points(u32 qw) const {
assert(qw >= 50);
qw -= 50;
@@ -260,6 +273,8 @@ struct TieFrag {
return result;
}
// simulate a load from points, but don't die if we load past the end
// this can happen when pipelining.
math::Vector<float, 4> lq_points_allow_past_end(u32 qw) const {
assert(qw >= 50);
qw -= 50;
@@ -272,6 +287,8 @@ struct TieFrag {
}
}
// store data into points. annoyingly the points have to be unpacked
// and they are modified in place.
void sq_points(u32 qw, const math::Vector4f& data) {
assert(qw >= 50);
qw -= 50;
@@ -279,6 +296,7 @@ struct TieFrag {
memcpy(points_data.data() + (qw * 16), data.data(), 16);
}
// do a ilw from the other gif data.
u16 ilw_other_gif(u32 qw, u32 offset) const {
// unpacked with v8.
int qwi = qw;
@@ -287,6 +305,7 @@ struct TieFrag {
return other_gif_data.at(qwi * 4 + offset);
}
// reg values from the prototype program that are used by the instance program.
struct ProgramInfo {
std::vector<u16> adgif_offset_in_gif_buf_qw;
std::vector<StrGifInfo> str_gifs;
@@ -305,16 +324,21 @@ struct TieFrag {
} prog_info;
};
// main instance type
// unlike the GOAL type, we store all instances info in here too.
struct TieProtoInfo {
std::string name;
std::vector<TieInstanceInfo> instances;
bool uses_generic = false;
float stiffness = 0;
float stiffness = 0; // wind
u32 generic_flag;
std::vector<tfrag3::TimeOfDayColor> time_of_day_colors;
std::vector<TieFrag> frags;
std::vector<tfrag3::TimeOfDayColor> time_of_day_colors; // c++ type for time of day data
std::vector<TieFrag> frags; // the fragments of the prototype
};
/*!
* Convert TIE packed matrix to normal one. this was figured out from the EE asm.
*/
std::array<math::Vector4f, 4> extract_tie_matrix(const u16* data) {
std::array<math::Vector4f, 4> result;
for (int i = 0; i < 4; i++) {
@@ -336,10 +360,13 @@ std::array<math::Vector4f, 4> extract_tie_matrix(const u16* data) {
return result;
}
// geometry we use (todo, should really look at this)
constexpr int GEOM_IDX = 1; // todo 0 or 1??
/*!
* Confirm that the initial value of all wind vectors is 0.
* If this is true, we don't have to actually save them to the fr3 file, we can just create
* a bunch of 0 vectors in the TIE setup.
*/
void check_wind_vectors_zero(const std::vector<TieProtoInfo>& protos, Ref wind_ref) {
u16 max_wind = 0;
@@ -357,25 +384,28 @@ void check_wind_vectors_zero(const std::vector<TieProtoInfo>& protos, Ref wind_r
}
}
// get per-instance info from the level data
std::vector<TieProtoInfo> collect_instance_info(
const level_tools::DrawableInlineArrayInstanceTie* instances,
const std::vector<level_tools::PrototypeBucketTie>* protos) {
std::vector<TieProtoInfo> result;
// loop over instances in level
for (auto& instance : instances->instances) {
// copy basic data.
TieInstanceInfo info;
info.prototype_idx = instance.bucket_index;
info.vis_id = instance.id;
for (int i = 0; i < 4; i++) {
info.bsphere[i] = instance.bsphere.data[i];
}
// from ee asm
info.mat = extract_tie_matrix(instance.origin.data);
info.mat[3][0] += info.bsphere[0];
info.mat[3][1] += info.bsphere[1];
info.mat[3][2] += info.bsphere[2];
info.wind_index = instance.wind_index;
// there's a value stashed here that we can get rid of
// it is related to wind.
info.unknown_wind_related_value = info.mat[0][3];
info.mat[0][3] = 0.f;
// each fragment has its own color data (3 dmatags)
@@ -388,10 +418,15 @@ std::vector<TieProtoInfo> collect_instance_info(
// and this is only the indices.... there's yet another lookup on the VU
auto& proto = protos->at(info.prototype_idx);
u32 offset_bytes = proto.base_qw[GEOM_IDX] * 16;
// loop over frags. this is only the per-instance info so only colors indices. We know the
// location/layout of the color data from the EE asm code.
for (int frag_idx = 0; frag_idx < proto.frag_count[GEOM_IDX]; frag_idx++) {
TieInstanceFragInfo frag_info;
// read the number of quadwords
u32 num_color_qwc = proto.color_index_qwc.at(proto.index_start[GEOM_IDX] + frag_idx);
// loop over 4-byte words
for (u32 i = 0; i < num_color_qwc * 4; i++) {
// loop over bytes in word
for (u32 j = 0; j < 4; j++) {
frag_info.color_indices.push_back(
instance.color_indices.data->words_by_seg.at(instance.color_indices.seg)
@@ -401,6 +436,7 @@ std::vector<TieProtoInfo> collect_instance_info(
}
info.frags.push_back(std::move(frag_info));
assert(info.frags.back().color_indices.size() > 0);
offset_bytes += num_color_qwc * 16;
}
@@ -413,6 +449,10 @@ std::vector<TieProtoInfo> collect_instance_info(
return result;
}
/*!
* adgif shader texture id's can be "remapped". I think it allows textures to be shared.
* So far we haven't seen this feature used, but we do have the texture map and we check it here.
*/
u32 remap_texture(u32 original, const std::vector<level_tools::TextureRemap>& map) {
auto masked = original & 0xffffff00;
for (auto& t : map) {
@@ -425,6 +465,9 @@ u32 remap_texture(u32 original, const std::vector<level_tools::TextureRemap>& ma
return original;
}
/*!
* Update per-proto information.
*/
void update_proto_info(std::vector<TieProtoInfo>* out,
const std::vector<level_tools::TextureRemap>& map,
const TextureDB& tdb,
@@ -433,15 +476,18 @@ void update_proto_info(std::vector<TieProtoInfo>* out,
for (size_t i = 0; i < protos.size(); i++) {
const auto& proto = protos[i];
auto& info = out->at(i);
// the flags can either be 0 or 2.
assert(proto.flags == 0 || proto.flags == 2);
// flag of 2 means it should use the generic renderer (determined from EE asm)
// for now, we ignore this and use TIE on everything.
info.uses_generic = (proto.flags == 2);
// for debug, remember the name
info.name = proto.name;
// wind "stiffness" nonzero value means it has the wind effect
info.stiffness = proto.stiffness;
if (info.stiffness != 0) {
fmt::print("--------------------proto {} wind {}\n", info.name, info.stiffness);
}
info.generic_flag = proto.flags & 2;
// the actual colors (rgba) used by time of day interpolation
// there are "height" colors. Each color is actually 8 colors that are interpolated.
info.time_of_day_colors.resize(proto.time_of_day.height);
for (int k = 0; k < (int)proto.time_of_day.height; k++) {
for (int j = 0; j < 8; j++) {
@@ -449,20 +495,41 @@ void update_proto_info(std::vector<TieProtoInfo>* out,
}
}
// loop over fragments in the proto. This is the actual mesh data data and drawing settings
for (int frag_idx = 0; frag_idx < proto.frag_count[GEOM_IDX]; frag_idx++) {
TieFrag frag_info;
// loop over adgif shaders
for (int tex_idx = 0;
tex_idx < proto.geometry[GEOM_IDX].tie_fragments.at(frag_idx).tex_count / 5; tex_idx++) {
// this adgif shader data is modified in the real game by the login methods.
// all TIE things have pretty normal adgif shaders
// all the useful adgif data will be saved into this AdgifInfo
AdgifInfo adgif;
// pointer to the level data
auto& gif_data = proto.geometry[GEOM_IDX].tie_fragments[frag_idx].gif_data;
// address for the first adgif shader qw.
u8 ra_tex0 = gif_data.at(16 * (tex_idx * 5 + 0) + 8);
// data for the first adgif shader qw.
u64 ra_tex0_val;
memcpy(&ra_tex0_val, &gif_data.at(16 * (tex_idx * 5 + 0)), 8);
// always expecting TEX0_1
assert(ra_tex0 == (u8)GsRegisterAddress::TEX0_1);
// the value is overwritten by the login function. We don't care about this value, it's
// specific to the PS2's texture system.
assert(ra_tex0_val == 0 || ra_tex0_val == 0x800000000); // note: decal
// the original value is a flag. this means to use decal texture mode (todo)
frag_info.has_magic_tex0_bit = ra_tex0_val == 0x800000000;
// there's also a hidden value in the unused bits of the a+d data. it'll be used by the
// VU program.
memcpy(&adgif.first_w, &gif_data.at(16 * (tex_idx * 5 + 0) + 12), 4);
// Second adgif. Similar to the first, except the original data value is a texture ID.
u8 ra_tex1 = gif_data.at(16 * (tex_idx * 5 + 1) + 8);
u64 ra_tex1_val;
memcpy(&ra_tex1_val, &gif_data.at(16 * (tex_idx * 5 + 1)), 8);
@@ -470,34 +537,41 @@ void update_proto_info(std::vector<TieProtoInfo>* out,
assert(ra_tex1_val == 0x120); // some flag
u32 original_tex;
memcpy(&original_tex, &gif_data.at(16 * (tex_idx * 5 + 1) + 8), 4);
// try remapping it
u32 new_tex = remap_texture(original_tex, map);
if (original_tex != new_tex) {
fmt::print("map from 0x{:x} to 0x{:x}\n", original_tex, new_tex);
}
// texture the texture page/texture index, and convert to a PC port texture ID
u32 tpage = new_tex >> 20;
u32 tidx = (new_tex >> 8) & 0b1111'1111'1111;
u32 tex_combo = (((u32)tpage) << 16) | tidx;
// look up the texture to make sure it's valid
auto tex = tdb.textures.find(tex_combo);
assert(tex != tdb.textures.end());
// remember the texture id
adgif.combo_tex = tex_combo;
// and the hidden value in the unused a+d
memcpy(&adgif.second_w, &gif_data.at(16 * (tex_idx * 5 + 1) + 12), 4);
// todo: figure out if this matters
if (ra_tex0_val == 0x800000000) {
fmt::print("texture {} in {} has weird tex setting\n", tex->second.name, proto.name);
}
// mipmap settings. we ignore, but get the hidden value
u8 ra_mip = gif_data.at(16 * (tex_idx * 5 + 2) + 8);
assert(ra_mip == (u8)GsRegisterAddress::MIPTBP1_1);
memcpy(&adgif.third_w, &gif_data.at(16 * (tex_idx * 5 + 2) + 12), 4);
// who cares about the value
// clamp settings. we care about these. no hidden value.
u8 ra_clamp = gif_data.at(16 * (tex_idx * 5 + 3) + 8);
assert(ra_clamp == (u8)GsRegisterAddress::CLAMP_1);
u64 clamp;
memcpy(&clamp, &gif_data.at(16 * (tex_idx * 5 + 3)), 8);
adgif.clamp_val = clamp;
// alpha settings. we care about these, but no hidden value
u8 ra_alpha = gif_data.at(16 * (tex_idx * 5 + 4) + 8);
assert(ra_alpha == (u8)GsRegisterAddress::ALPHA_1);
u64 alpha;
@@ -505,7 +579,12 @@ void update_proto_info(std::vector<TieProtoInfo>* out,
adgif.alpha_val = alpha;
frag_info.adgifs.push_back(adgif);
}
// they store a vertex count. we later use this to sanity check out mesh extraction
frag_info.expected_dverts = proto.geometry[GEOM_IDX].tie_fragments[frag_idx].num_dverts;
// each frag also has "other" data. This is some index data that the VU program uses.
// it comes in gif_data, after tex_qwc (determined from EE program)
int tex_qwc = proto.geometry[GEOM_IDX].tie_fragments.at(frag_idx).tex_count;
int other_qwc = proto.geometry[GEOM_IDX].tie_fragments.at(frag_idx).gif_count;
frag_info.other_gif_data.resize(16 * other_qwc);
@@ -513,6 +592,8 @@ void update_proto_info(std::vector<TieProtoInfo>* out,
proto.geometry[GEOM_IDX].tie_fragments[frag_idx].gif_data.data() + (16 * tex_qwc),
16 * other_qwc);
// each frag's "point" data. These are stored as int16's, but get unpacked to 32-bit ints by
// the VIF. (determined from EE program)
const auto& pr = proto.geometry[GEOM_IDX].tie_fragments[frag_idx].point_ref;
int in_qw = pr.size() / 16;
int out_qw = in_qw * 2;
@@ -530,6 +611,10 @@ void update_proto_info(std::vector<TieProtoInfo>* out,
}
}
// List of dma tags from the EE code.
// upload-palette/upload-model happen per prototype.
// (palette may happen per prototype, model per geometry, but we only use 1 geom)
// upload-palette-0: just a flusha
// no data
@@ -550,9 +635,12 @@ void update_proto_info(std::vector<TieProtoInfo>* out,
// points
// upload-model-3
// mscal 6
// mscal 6 <- this runs a VU program that unpacks the model data
// call the models!
// These upload-color's happen per instance. They only happen after the upload-palette/model's
// happen for the given model.
// upload-color-0
// 6 qw of matrix plus flag stuff
// to 198 (relative to TOP)
@@ -561,9 +649,13 @@ void update_proto_info(std::vector<TieProtoInfo>* out,
// to 204 unsigned (relative to TOP)
// upload-color-2/ret
// mscal 0
// mscal 0 <- this runs a VU program that generates GS data to draw the instance.
// MEMORY MAP of TIE
// these are quadword addresses.
// some things are double/triple buffered.
// we ignore this for the most part and by convention use the lower address.
// 0 gif tags
// extra gifs
// 32 model
@@ -586,6 +678,9 @@ void update_proto_info(std::vector<TieProtoInfo>* out,
// 973 atest-tra
// 974 atest-def
// the vu program emulation will fill out the vertex positions/draw settings for each instance.
// helper functions for the vu programs
math::Vector4f itof0(const math::Vector4f& vec) {
math::Vector4f result;
for (int i = 0; i < 4; i++) {
@@ -1573,38 +1668,49 @@ void emulate_tie_instance_program(std::vector<TieProtoInfo>& protos) {
}
}
// makes per-prototype meshes
// the final step of the VU program emulation is the "xgkick" instruction.
// there is a signal xgkick per fragment and it goes through the entire gif buf, hitting
// strgifs and adgifs. We look at the memory map for each frag and figure out which strips
// go with which adgifs, then copy vertices
void emulate_kicks(std::vector<TieProtoInfo>& protos) {
for (auto& proto : protos) {
for (auto& frag : proto.frags) {
// we iterate over both adgifs/stgifs. sometimes you can have multiple strgifs that use the
// same adgif. But we never expect to see multiple adgifs in a row.
auto adgif_it = frag.prog_info.adgif_offset_in_gif_buf_qw.begin();
auto adgif_end = frag.prog_info.adgif_offset_in_gif_buf_qw.end();
auto str_it = frag.prog_info.str_gifs.begin();
auto str_end = frag.prog_info.str_gifs.end();
// but, we should always start with an adgif (otherwise we'd use the draw settings from
// the last model, which we don't know)
assert(frag.prog_info.adgif_offset_in_gif_buf_qw.at(0) == 0);
// and we expect that the VU program placed all adgifs somewhere
assert(frag.prog_info.adgif_offset_in_gif_buf_qw.size() == frag.adgifs.size());
const AdgifInfo* adgif_info = nullptr;
int expected_next_tag = 0;
// loop over strgifs
while (str_it != str_end) {
// try advance adgif
// try to see if we got a adgif here
if (adgif_it != adgif_end && (*adgif_it) == expected_next_tag) {
// yep
int idx = adgif_it - frag.prog_info.adgif_offset_in_gif_buf_qw.begin();
adgif_info = &frag.adgifs.at(idx);
// fmt::print("using adgif {}\n", *adgif_it);
// the next strgif should come 6 qw's after
expected_next_tag += 6;
adgif_it++;
}
assert(adgif_info);
// fmt::print("strip: {}\n", str_it->address);
// make sure the next str is where we expect
assert(expected_next_tag == str_it->address);
// the next tag (either str/adgif) should be located at the end of this tag's data.
expected_next_tag += 3 * str_it->nloop + 1;
// here we have the right str and adgif.
// kinda stupid, but we have to guess the base address of the gifbuf
// kinda stupid, but we have to guess the base address of the gifbuf we're using.
// 286 gifbuf
// 470 gifbuf again
// 654 ??
@@ -1617,12 +1723,15 @@ void emulate_kicks(std::vector<TieProtoInfo>& protos) {
base_address = 470;
}
// now, vertices!
// now, we can add the vertices!
frag.strips.emplace_back();
auto& strip = frag.strips.back();
strip.adgif = *adgif_info;
// loop over all the vertices the strgif says we'll have
for (int vtx = 0; vtx < str_it->nloop; vtx++) {
// compute the address of this vertex (stored after the strgif)
u32 vtx_addr = str_it->address + 1 + (3 * vtx) + base_address;
// and grab it from the vertex map we made earlier.
strip.verts.push_back(frag.vertex_by_dest_addr.at(vtx_addr));
}
@@ -1634,6 +1743,11 @@ void emulate_kicks(std::vector<TieProtoInfo>& protos) {
}
}
// from here on, we are mostly converting the "info" formats to the C++ renderer format (tfrag3)
/*!
* Just used to debug, save a proto as an .obj mesh file.
*/
std::string debug_dump_proto_to_obj(const TieProtoInfo& proto) {
std::vector<math::Vector<float, 3>> verts;
std::vector<math::Vector<float, 2>> tcs;
@@ -1690,6 +1804,9 @@ std::string debug_dump_proto_to_obj(const TieProtoInfo& proto) {
return result;
}
/*!
* Transform a point in a prototype to the actual point location in the game world.
*/
math::Vector<float, 3> transform_tie(const std::array<math::Vector4f, 4> mat,
const math::Vector3f& pt) {
auto temp = mat[0] * pt.x() + mat[1] * pt.y() + mat[2] * pt.z() + mat[3];
@@ -1700,6 +1817,10 @@ math::Vector<float, 3> transform_tie(const std::array<math::Vector4f, 4> mat,
return result;
}
/*!
* Dump the entire tie tree to an obj. Used to debug the transform_tie function. If we get this
* right, it should fit in with .obj's produced from the tfrag debug.
*/
std::string dump_full_to_obj(const std::vector<TieProtoInfo>& protos) {
std::vector<math::Vector<float, 3>> verts;
std::vector<math::Vector<float, 2>> tcs;
@@ -1779,6 +1900,7 @@ struct BigPalette {
std::vector<tfrag3::TimeOfDayColor> colors;
};
// combine all individual time of day palettes into one giant one.
BigPalette make_big_palette(std::vector<TieProtoInfo>& protos) {
BigPalette result;
@@ -1805,6 +1927,9 @@ BigPalette make_big_palette(std::vector<TieProtoInfo>& protos) {
return result;
}
/*!
* Given a current draw mode, update the alpha settings from a gs-alpha register value.
*/
void update_mode_from_alpha1(u64 val, DrawMode& mode) {
GsAlpha reg(val);
if (reg.a_mode() == GsAlpha::BlendMode::SOURCE && reg.b_mode() == GsAlpha::BlendMode::DEST &&
@@ -1842,13 +1967,19 @@ void update_mode_from_alpha1(u64 val, DrawMode& mode) {
fmt::print("unsupported blend: a {} b {} c {} d {}\n", (int)reg.a_mode(), (int)reg.b_mode(),
(int)reg.c_mode(), (int)reg.d_mode());
mode.set_alpha_blend(DrawMode::AlphaBlend::SRC_DST_SRC_DST);
// assert(false);
assert(false);
}
}
/*!
* Convert adgif info into a C++ renderer DrawMode.
*/
DrawMode process_draw_mode(const AdgifInfo& info, bool use_atest, bool use_decal) {
DrawMode mode;
// some of these are set up once as part of tie initialization
mode.set_alpha_test(DrawMode::AlphaTest::GEQUAL);
// the atest giftag is set up at the end of the VU program.
if (use_atest) {
mode.enable_at();
mode.set_aref(0x26);
@@ -1860,13 +1991,17 @@ DrawMode process_draw_mode(const AdgifInfo& info, bool use_atest, bool use_decal
if (use_decal) {
mode.enable_decal();
}
// set up once.
mode.enable_depth_write();
mode.enable_zt(); // :zte #x1
mode.set_depth_test(GsTest::ZTest::GEQUAL); // :ztst (gs-ztest greater-equal))
mode.disable_ab();
mode.set_alpha_blend(DrawMode::AlphaBlend::SRC_DST_SRC_DST);
// the alpha matters
update_mode_from_alpha1(info.alpha_val, mode);
// the clamp matters
if (!(info.clamp_val == 0b101 || info.clamp_val == 0 || info.clamp_val == 1 ||
info.clamp_val == 0b100)) {
fmt::print("clamp: 0x{:x}\n", info.clamp_val);
@@ -1879,17 +2014,18 @@ DrawMode process_draw_mode(const AdgifInfo& info, bool use_atest, bool use_decal
return mode;
}
// we need the lev to pool textures with tfrag.
/*!
* Convert TieProtoInfo's to C++ renderer format
*/
void add_vertices_and_static_draw(tfrag3::TieTree& tree,
tfrag3::Level& lev,
const TextureDB& tdb,
const std::vector<TieProtoInfo>& protos) {
// our current approach for static draws is just to flatten to giant mesh, except for wind stuff.
// this map sorts these two types of draws by texture.
std::unordered_map<u32, std::vector<u32>> static_draws_by_tex;
std::unordered_map<u32, std::vector<u32>> wind_draws_by_tex;
// renumbering instances.
// loop over all prototypes
for (auto& proto : protos) {
// bool using_wind = true; // hack, for testing
@@ -1897,25 +2033,30 @@ void add_vertices_and_static_draw(tfrag3::TieTree& tree,
// loop over instances of the prototypes
for (auto& inst : proto.instances) {
// if we're using wind, we use the instanced renderer, which requires some extra info
// and we should remember which instance ID we are.
// Note: this is different from the game's instance index - we don't draw everything instanced
// so the non-instanced models don't get a C++ renderer instance ID
u32 wind_instance_idx = tree.instance_info.size();
if (using_wind) {
tfrag3::TieWindInstance wind_instance_info;
wind_instance_info.wind_idx = inst.wind_index;
wind_instance_info.stiffness = proto.stiffness;
wind_instance_info.matrix = inst.mat;
wind_instance_info.wind_idx = inst.wind_index; // which wind value to apply in the table
wind_instance_info.stiffness = proto.stiffness; // wind stiffness (how much we move)
wind_instance_info.matrix = inst.mat; // instance transformation matrix.
tree.instance_info.push_back(wind_instance_info);
}
// loop over fragments of the prototype
for (size_t frag_idx = 0; frag_idx < proto.frags.size(); frag_idx++) {
auto& frag = proto.frags[frag_idx];
auto& ifrag = inst.frags.at(frag_idx);
auto& frag = proto.frags[frag_idx]; // shared info for all instances of this frag
auto& ifrag = inst.frags.at(frag_idx); // color info for this instance of the frag
// loop over triangle strips within the fragment
for (auto& strip : frag.strips) {
// what texture are we using?
u32 combo_tex = strip.adgif.combo_tex;
// try looking it up in the existing textures
// try looking it up in the existing textures that we have in the C++ renderer data.
// (this is shared with tfrag)
u32 idx_in_lev_data = UINT32_MAX;
for (u32 i = 0; i < lev.textures.size(); i++) {
if (lev.textures[i].combo_id == combo_tex) {
@@ -1925,10 +2066,10 @@ void add_vertices_and_static_draw(tfrag3::TieTree& tree,
}
if (idx_in_lev_data == UINT32_MAX) {
// didn't find it, have to add a new one
// didn't find it, have to add a new one texture.
auto tex_it = tdb.textures.find(combo_tex);
if (tex_it == tdb.textures.end()) {
bool ok_to_miss = false; // TODO
bool ok_to_miss = false; // for TIE, there's no missing textures.
if (ok_to_miss) {
// we're missing a texture, just use the first one.
tex_it = tdb.textures.begin();
@@ -1943,6 +2084,7 @@ void add_vertices_and_static_draw(tfrag3::TieTree& tree,
assert(false);
}
}
// add a new texture to the level data
idx_in_lev_data = lev.textures.size();
lev.textures.emplace_back();
auto& new_tex = lev.textures.back();
@@ -1971,7 +2113,7 @@ void add_vertices_and_static_draw(tfrag3::TieTree& tree,
}
if (!draw_to_add_to) {
// nope, need to create a new draw
// nope no existing draw for these settings, need to create a new draw
tree.instanced_wind_draws.emplace_back();
wind_draws_by_tex[idx_in_lev_data].push_back(tree.instanced_wind_draws.size() - 1);
draw_to_add_to = &tree.instanced_wind_draws.back();
@@ -1979,10 +2121,16 @@ void add_vertices_and_static_draw(tfrag3::TieTree& tree,
draw_to_add_to->tree_tex_id = idx_in_lev_data;
}
// now we have a draw, time to add vertices
// now we have a draw, time to add vertices. We make a vertex "group" which is a group
// of vertices that the renderer can decide to not draw based on visibility data.
tfrag3::InstancedStripDraw::InstanceGroup igroup;
igroup.vis_idx = inst.vis_id; // associate with the tfrag for culling
igroup.num = strip.verts.size() + 1; // one for the primitive restart!
// needs to be associated with this instance.
igroup.vis_idx = inst.vis_id; // associate with the instance for culling
// number of vertices. The +1 is for the primitive restart index, which tells opengl
// that the triangle strip is done.
igroup.num = strip.verts.size() + 1;
// groups for instances also need the instance idx to grab the appropriate wind/matrix
// data.
igroup.instance_idx = wind_instance_idx;
draw_to_add_to->num_triangles += strip.verts.size() - 2;
// note: this is a bit wasteful to duplicate the xyz/stq.
@@ -2008,6 +2156,7 @@ void add_vertices_and_static_draw(tfrag3::TieTree& tree,
tree.vertices.push_back(vtx);
draw_to_add_to->vertex_index_stream.push_back(vert_idx);
}
// the primitive restart index
draw_to_add_to->vertex_index_stream.push_back(UINT32_MAX);
draw_to_add_to->instance_groups.push_back(igroup);
} else {
@@ -2033,7 +2182,7 @@ void add_vertices_and_static_draw(tfrag3::TieTree& tree,
// now we have a draw, time to add vertices
tfrag3::StripDraw::VisGroup vgroup;
vgroup.vis_idx = inst.vis_id; // associate with the tfrag for culling
vgroup.vis_idx = inst.vis_id; // associate with the instance for culling
vgroup.num = strip.verts.size() + 1; // one for the primitive restart!
draw_to_add_to->num_triangles += strip.verts.size() - 2;
for (auto& vert : strip.verts) {
@@ -2068,12 +2217,18 @@ void add_vertices_and_static_draw(tfrag3::TieTree& tree,
}
}
// sort draws by texture. no idea if this really matters, but will reduce the number of
// times the renderer changes textures. it at least makes the rendererdoc debugging easier.
std::stable_sort(tree.static_draws.begin(), tree.static_draws.end(),
[](const tfrag3::StripDraw& a, const tfrag3::StripDraw& b) {
return a.tree_tex_id < b.tree_tex_id;
});
}
/*!
* The groups are created per-fragment, but usually you have a few fragments per instance, so there
* are often consecutive groups that can be merged.
*/
void merge_groups(std::vector<tfrag3::InstancedStripDraw::InstanceGroup>& grps) {
std::vector<tfrag3::InstancedStripDraw::InstanceGroup> result;
result.push_back(grps.at(0));
@@ -2130,7 +2285,9 @@ void extract_tie(const level_tools::DrawableTreeInstanceTie* tree,
// parent of between 1 and 8 instances.
extract_vis_data(tree, as_instance_array->instances.front().id, this_tree);
// map of instance ID to its parent. We'll need this later.
// we use the index of the instance in the instance list as its index. But this is different
// from its visibility index. This map goes from instance index to the parent node in the vis
// tree. later, we can use this to remap from instance idx to the visiblity node index.
std::unordered_map<int, int> instance_parents;
for (size_t node_idx = 0; node_idx < this_tree.bvh.vis_nodes.size(); node_idx++) {
const auto& node = this_tree.bvh.vis_nodes[node_idx];
@@ -2141,30 +2298,35 @@ void extract_tie(const level_tools::DrawableTreeInstanceTie* tree,
}
}
// convert level format data to a nicer format
auto info = collect_instance_info(as_instance_array, &tree->prototypes.prototype_array_tie.data);
update_proto_info(&info, tex_map, tex_db, tree->prototypes.prototype_array_tie.data);
check_wind_vectors_zero(info, tree->prototypes.wind_vectors);
// debug_print_info(info);
// determine draws from VU program
emulate_tie_prototype_program(info);
emulate_tie_instance_program(info);
emulate_kicks(info);
// debug save to .obj
if (dump_level) {
auto dir = file_util::get_file_path({fmt::format("debug_out/tie-{}/", debug_name)});
file_util::create_dir_if_needed(dir);
for (auto& proto : info) {
auto data = debug_dump_proto_to_obj(proto);
file_util::write_text_file(fmt::format("{}/{}.obj", dir, proto.name), data);
// file_util::create_dir_if_needed()
}
auto full = dump_full_to_obj(info);
file_util::write_text_file(fmt::format("{}/ALL.obj", dir), full);
}
// create time of day data.
auto full_palette = make_big_palette(info);
// create draws
add_vertices_and_static_draw(this_tree, out, tex_db, info);
// remap vis indices and merge
for (auto& draw : this_tree.static_draws) {
for (auto& str : draw.vis_groups) {
auto it = instance_parents.find(str.vis_idx);
+1 -1
View File
@@ -134,7 +134,7 @@
:size-assert #x8670
:flag-assert #x2100008670
(:methods
(dummy-9 (_type_) none 9)
(debug-draw (_type_) none 9)
(fill-and-probe-using-line-sphere (_type_ vector vector float collide-kind process collide-tri-result int) float 10)
(fill-and-probe-using-spheres (_type_ collide-using-spheres-params) none 11)
(fill-and-probe-using-y-probe (_type_ vector float collide-kind process collide-tri-result uint) float 12)
+7 -7
View File
@@ -57,12 +57,12 @@
:flag-assert #x1000000028
(:methods
(debug-draw-tris (_type_ process-drawable int) none 9)
(dummy-10 (_type_ object vector) none 10) ;; what is the second arg!?
(dummy-11 (_type_ collide-mesh-cache-tri collide-tri-result vector float) none 11)
(dummy-12 (_type_ collide-mesh-cache-tri collide-tri-result vector float) float 12)
(dummy-13 (_type_) none 13)
(dummy-14 (_type_) none 14)
(dummy-15 (_type_) none 15)
(overlap-test (_type_ collide-mesh-cache-tri vector) symbol 10)
(should-push-away-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float 11) ;; spat
(sphere-on-platform-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float 12) ;; sopt
(populate-cache! (_type_ collide-mesh-cache-tri matrix) none 13)
(dummy-14 (_type_ object object) none 14)
(dummy-15 (_type_ object object object) none 15)
)
)
@@ -84,7 +84,7 @@
:size-assert #xa020
:flag-assert #xc0000a020
(:methods
(dummy-9 (_type_) none 9)
(allocate! (_type_ int) int 9)
(is-id? (_type_ int) symbol 10)
(next-id! (_type_) uint 11)
)
+43 -41
View File
@@ -72,7 +72,7 @@
;; This includes possibly rotating the rider (if the platform spins, it spins Jak too).
(deftype pull-rider-info (structure)
((rider collide-sticky-rider :offset-assert 0)
(rider-cshape collide-shape-prim :offset-assert 4) ;; maybe just collide-shape
(rider-cshape collide-shape-moving :offset-assert 4)
(rider-delta-ry float :offset-assert 8)
(rider-dest vector :inline :offset-assert 16)
)
@@ -241,6 +241,7 @@
(declare-type collide-shape basic)
(declare-type collide-cache-prim structure)
(declare-type collide-shape-prim-group basic)
;; the base class for collision shapes.
(deftype collide-shape-prim (basic)
((cshape collide-shape :offset-assert 4) ;; our parent collide-shape
@@ -263,23 +264,23 @@
:flag-assert #x1c00000048
(:methods
(new (symbol type collide-shape uint int) _type_ 0)
(dummy-9 (_type_ vector) object 9) ;; ret - symbol | float
(dummy-10 (_type_ uint) collide-shape-prim 10)
(move-by-vector! (_type_ vector) none 9)
(find-prim-by-id (_type_ uint) collide-shape-prim 10)
(debug-draw-world-sphere (_type_) symbol 11)
(add-fg-prim-using-box (_type_ process-drawable) none 12)
(add-fg-prim-using-line-sphere (_type_ process-drawable) none 13)
(add-fg-prim-using-y-probe (_type_ process-drawable) none 14)
(overlaps-others-test (_type_) symbol 15)
(dummy-16 () none 16)
(overlaps-others-test (_type_ overlaps-others-params collide-shape-prim) symbol 15)
(overlaps-others-group (_type_ overlaps-others-params collide-shape-prim-group) symbol 16)
(dummy-17 () none 17)
(collide-with-collide-cache-prim-mesh (_type_ collide-shape-intersect collide-cache-prim) none 18)
(collide-with-collide-cache-prim-sphere (_type_ collide-shape-intersect collide-cache-prim) none 19)
(dummy-20 (_type_ collide-kind) symbol 20)
(add-to-bounding-box (_type_ collide-kind) symbol 20)
(num-mesh (_type_ collide-shape-prim) int 21)
(on-platform-test (_type_ _type_ collide-overlap-result float) pat-surface 22)
(should-push-away-test () none 23)
(dummy-24 () none 24)
(dummy-25 (_type_ process-drawable) symbol 25)
(on-platform-test (_type_ collide-shape-prim collide-overlap-result float) none 22)
(should-push-away-test (_type_ collide-shape-prim collide-overlap-result) none 23)
(should-push-away-reverse-test (_type_ collide-shape-prim-group collide-overlap-result) none 24)
(update-transforms! (_type_ process-drawable) symbol 25)
(set-collide-as! (_type_ collide-kind) none 26)
(set-collide-with! (_type_ collide-kind) none 27)
)
@@ -312,10 +313,10 @@
;; These meshes interact with a cache automatically (a specific collide-shape-prim-mesh cache, not the
;; more general collide-cache)
(deftype collide-shape-prim-mesh (collide-shape-prim)
((mesh collide-mesh :offset-assert 72)
(mesh-id int32 :offset-assert 76)
(mesh-cache-id uint64 :offset-assert 80)
(mesh-cache-tris uint32 :offset-assert 88)
((mesh collide-mesh :offset-assert 72)
(mesh-id int32 :offset-assert 76)
(mesh-cache-id uint64 :offset-assert 80)
(mesh-cache-tris (inline-array collide-mesh-cache-tri) :offset-assert 88)
)
:method-count-assert 29
:size-assert #x5c
@@ -329,6 +330,7 @@
;; A group of collide-shape-prim's
(deftype collide-shape-prim-group (collide-shape-prim)
((num-prims int32 :offset-assert 72)
(num-prims-u uint32 :offset 72)
(allocated-prims int32 :offset-assert 76)
(prim collide-shape-prim 1 :offset-assert 80)
(prims collide-shape-prim :dynamic :score 20 :offset 80) ;; added
@@ -339,7 +341,7 @@
(:methods
(new (symbol type collide-shape uint int) _type_ 0)
(append-prim (_type_ collide-shape-prim) none 28)
(dummy-29 (_type_ uint) none 29)
(add-to-non-empty-bounding-box (_type_ collide-kind) none 29)
)
)
@@ -376,34 +378,34 @@
:flag-assert #x38000000b8
(:methods
(new (symbol type process-drawable collide-list-enum) _type_)
(TODO-RENAME-28 (_type_ vector) object 28) ;; ret - symbol | float (CSPG::9)
(dummy-29 (_type_ int) none 29)
(TODO-RENAME-30 (_type_ vector) object 30) ;; ret - symbol | float (CSPG::9)
(move-by-vector! (_type_ vector) none 28)
(alloc-riders (_type_ int) none 29)
(move-to-point! (_type_ vector) none 30) ;; ret - symbol | float (CSPG::9)
(debug-draw (_type_) none 31)
(dummy-32 (_type_ object collide-kind) none 32)
(dummy-33 (_type_ vector collide-kind) none 33)
(dummy-34 (_type_ uint) collide-shape-prim 34)
(dummy-35 (_type_) symbol 35)
(dummy-36 (_type_ bounding-box float collide-kind) symbol 36)
(dummy-37 (_type_ vector) none 37)
(fill-cache-for-shape! (_type_ float collide-kind) none 32)
(fill-cache-integrate-and-collide! (_type_ vector collide-kind) none 33)
(find-prim-by-id (_type_ uint) collide-shape-prim 34)
(detect-riders! (_type_) symbol 35)
(build-bounding-box-for-shape (_type_ bounding-box float collide-kind) symbol 36)
(integrate-and-collide! (_type_ vector) none 37)
(find-collision-meshes (_type_) symbol 38)
(dummy-39 (_type_ collide-shape collide-overlap-result) symbol 39)
(dummy-40 (_type_ structure) none 40) ;; ?? - I've seen overlaps-others-params | collide-edge-hold-list
(on-platform (_type_ collide-shape collide-overlap-result) symbol 39)
(find-overlapping-shapes (_type_ overlaps-others-params) symbol 40) ;; check if blocked??
(dummy-41 (_type_ attack-info float) vector 41)
(dummy-42 (_type_ collide-shape collide-work) none 42) ; collide-work is a guess
(dummy-43 (_type_ pull-rider-info) none 43)
(dummy-44 (_type_) symbol 44)
(dummy-45 (_type_) symbol 45)
(compute-overlap (_type_ collide-shape collide-overlap-result) symbol 42)
(pull-rider! (_type_ pull-rider-info) none 43)
(pull-riders! (_type_) symbol 44)
(respond-to-collisions! (_type_) symbol 45)
(set-root-prim! (_type_ collide-shape-prim) collide-shape-prim 46)
(dummy-47 (_type_) symbol 47)
(update-transforms! (_type_) symbol 47)
(clear-collide-with-as (_type_) none 48)
(restore-collide-with-as (_type_) none 49)
(backup-collide-with-as (_type_) none 50)
(set-root-prim-collide-with! (_type_ collide-kind) none 51)
(set-root-prim-collide-as! (_type_ collide-kind) none 52)
(dummy-53 (_type_ int collide-kind collide-kind) none 53)
(dummy-54 (_type_ int collide-offense) none 54)
(dummy-55 (_type_ process touching-shapes-entry float float float) none 55)
(set-collide-kinds (_type_ int collide-kind collide-kind) none 53)
(set-collide-offense (_type_ int collide-offense) none 54)
(send-shove-back (_type_ process touching-shapes-entry float float float) none 55)
)
)
@@ -440,14 +442,14 @@
:flag-assert #x41000001bc
(:methods
(set-and-handle-pat! (_type_ pat-surface) none 56)
(dummy-57 (_type_ vector) none 57)
(integrate-no-collide! (_type_ vector) none 57)
(dummy-58 (_type_ vector) symbol 58)
(dummy-59 (_type_ vector uint float symbol symbol symbol) none 59)
(dummy-60 (_type_ float float symbol collide-kind) symbol 60)
(TODO-RENAME-61 (_type_ vector vector vector) none 61)
(dummy-62 (_type_ vector float) vector 62)
(dummy-63 (_type_ vector vector float) float 63)
(dummy-64 (_type_ collide-tri-result vector) none 64)
(integrate-for-enemy-with-move-to-ground! (_type_ vector collide-kind float symbol symbol symbol) none 59)
(move-to-ground (_type_ float float symbol collide-kind) symbol 60)
(move-to-ground-point! (_type_ vector vector vector) none 61)
(compute-acc-due-to-gravity (_type_ vector float) vector 62)
(step-collison! (_type_ vector vector float) float 63)
(move-to-tri! (_type_ collide-tri-result vector) none 64)
)
)
@@ -5,3 +5,484 @@
;; name in dgo: collide-shape-rider
;; dgos: GAME, ENGINE
(defmethod on-platform collide-shape ((obj collide-shape) (arg0 collide-shape) (arg1 collide-overlap-result))
"Are we on the platform? Returns #t/#f and also sets an overlap result."
(let ((v1-0 arg1))
(set! (-> v1-0 best-dist) 0.0)
(set! (-> v1-0 best-from-prim) #f)
(set! (-> v1-0 best-to-prim) #f)
)
(set! (-> arg1 best-dist) 122.88)
(let ((s5-0 (-> obj root-prim))
(s4-0 (-> arg0 root-prim))
)
(when (and (logtest? (-> s5-0 collide-with) (-> s4-0 prim-core collide-as))
(logtest? (-> s5-0 prim-core action) (collide-action ca-1))
(logtest? (-> s4-0 prim-core action) (collide-action ca-2))
)
(let ((f0-4 (- (- (vector-vector-distance (the-as vector (-> s5-0 prim-core)) (the-as vector (-> s4-0 prim-core)))
(-> s5-0 prim-core world-sphere w)
)
(-> s4-0 prim-core world-sphere w)
)
)
)
(if (< f0-4 122.88)
(on-platform-test s5-0 s4-0 arg1 f0-4)
)
)
)
)
(< (-> arg1 best-dist) 122.88)
)
(defmethod on-platform-test collide-shape-prim ((obj collide-shape-prim) (arg0 collide-shape-prim) (arg1 collide-overlap-result) (arg2 float))
(format 0 "ERROR: collide-shape-prim::on-platform-test was called illegally!~%")
(none)
)
(defmethod on-platform-test collide-shape-prim-group ((obj collide-shape-prim-group) (arg0 collide-shape-prim) (arg1 collide-overlap-result) (arg2 float))
"Check if we're on the platform for a prim group."
(let ((s3-0 (-> arg0 prim-core collide-as)))
(dotimes (s2-0 (-> obj num-prims))
(let ((s1-0 (-> obj prims s2-0)))
;; check collide kind
(when (and (logtest? (-> s1-0 collide-with) s3-0) (logtest? (-> s1-0 prim-core action) (collide-action ca-1)))
;; check dist
(let ((f0-2 (- (- (vector-vector-distance (the-as vector (-> s1-0 prim-core)) (the-as vector (-> arg0 prim-core)))
(-> s1-0 prim-core world-sphere w)
)
(-> arg0 prim-core world-sphere w)
)
)
)
;; dist close enough, check!
(if (< f0-2 122.88)
(on-platform-test s1-0 arg0 arg1 f0-2)
)
)
)
)
)
)
(none)
)
(defmethod on-platform-test collide-shape-prim-mesh ((obj collide-shape-prim-mesh) (arg0 collide-shape-prim) (arg1 collide-overlap-result) (arg2 float))
"check if we're on the platform for a mesh."
(case (-> arg0 type)
;; mesh to group
((collide-shape-prim-group)
(let ((s3-0 (-> obj collide-with)))
(dotimes (s2-0 (-> (the-as collide-shape-prim-group arg0) num-prims))
(let ((s1-0 (-> (the-as collide-shape-prim-group arg0) prims s2-0)))
(when (and (logtest? s3-0 (-> s1-0 prim-core collide-as))
(logtest? (-> s1-0 prim-core action) (collide-action ca-2))
)
(let ((f0-2 (- (- (vector-vector-distance (the-as vector (-> obj prim-core)) (the-as vector (-> s1-0 prim-core)))
(-> obj prim-core world-sphere w)
)
(-> s1-0 prim-core world-sphere w)
)
)
)
(if (< f0-2 122.88)
(on-platform-test obj s1-0 arg1 f0-2)
)
)
)
)
)
)
)
;; mesh to sphere. use the collide-mesh-cache.
((collide-shape-prim-sphere)
(let ((s3-1 (-> obj mesh)))
(when s3-1
(let ((s2-1 *collide-mesh-cache*))
(when (!= (-> obj mesh-cache-id) (-> s2-1 id))
(let ((v1-17 (allocate! s2-1 (* 96 (-> s3-1 num-tris)))))
(cond
(v1-17
(set! (-> obj mesh-cache-tris) (the-as (inline-array collide-mesh-cache-tri) v1-17))
(set! (-> obj mesh-cache-id) (-> s2-1 id))
(populate-cache!
s3-1
(the-as collide-mesh-cache-tri (-> obj mesh-cache-tris))
(-> obj cshape process node-list data (-> obj transform-index) bone transform)
)
)
(else
(return #f)
)
)
)
)
)
(let* ((s2-2 (new 'stack-no-clear 'collide-tri-result))
(f0-4 (sphere-on-platform-test
s3-1
(the-as collide-mesh-cache-tri (-> obj mesh-cache-tris))
s2-2
(the-as vector (-> arg0 prim-core))
(-> arg1 best-dist)
)
)
)
(when (< f0-4 (-> arg1 best-dist))
(set! (-> arg1 best-dist) f0-4)
(set! (-> arg1 best-from-prim) obj)
(set! (-> arg1 best-to-prim) arg0)
(set! (-> arg1 best-from-tri vertex 0 quad) (-> s2-2 vertex 0 quad))
(set! (-> arg1 best-from-tri vertex 1 quad) (-> s2-2 vertex 1 quad))
(set! (-> arg1 best-from-tri vertex 2 quad) (-> s2-2 vertex 2 quad))
(set! (-> arg1 best-from-tri intersect quad) (-> s2-2 intersect quad))
(set! (-> arg1 best-from-tri normal quad) (-> s2-2 normal quad))
(set! (-> arg1 best-from-tri pat) (-> s2-2 pat))
)
)
)
)
)
)
(none)
)
(defmethod add-rider! collide-sticky-rider-group ((obj collide-sticky-rider-group) (arg0 process-drawable))
"Add a rider to this platform."
(let ((gp-0 (the-as collide-sticky-rider #f)))
(cond
((< (-> obj num-riders) (-> obj allocated-riders))
(set! gp-0 (-> obj rider (-> obj num-riders)))
(+! (-> obj num-riders) 1)
(let ((v1-6 gp-0))
(set! (-> v1-6 rider-handle) (the-as handle arg0))
(set! (-> v1-6 sticky-prim) #f)
)
)
(else
(format 0 "ERROR: Exeeded max number of riders!~%")
)
)
gp-0
)
)
(defmethod detect-riders! collide-shape ((obj collide-shape))
"See who is riding us."
(let ((s5-0 (-> obj riders)))
(when s5-0
(let* ((v1-0 *collide-mesh-cache*)
(a0-1 (-> v1-0 id))
)
(set! (-> v1-0 used-size) (the-as uint 0))
(let ((a0-2 (the-as int (+ a0-1 1))))
(b! (zero? (the-as uint a0-2)) cfg-3 :likely-delay (set! a0-2 1))
(label cfg-3)
(set! (-> v1-0 id) (the-as uint a0-2))
)
)
(set! (-> s5-0 num-riders) 0)
0
(let ((s4-0 (-> obj root-prim collide-with)))
(when (logtest? s4-0 (collide-kind target))
(let ((v1-7 (-> *collide-player-list* alive-list next0)))
*collide-player-list*
(let ((s3-0 (-> v1-7 next0)))
(while (!= v1-7 (-> *collide-player-list* alive-list-end))
(let* ((s2-0 (-> (the-as connection v1-7) param1))
(v1-8 (-> (the-as collide-shape s2-0) root-prim))
)
(when (logtest? s4-0 (-> v1-8 prim-core collide-as))
(when (and (logtest? (-> v1-8 prim-core action) (collide-action ca-2))
(!= (-> obj process) (-> (the-as collide-shape s2-0) process))
)
(let ((s1-0 (new 'stack-no-clear 'collide-overlap-result)))
(when (on-platform obj (the-as collide-shape s2-0) s1-0)
(let ((s4-1 (add-rider! s5-0 (the-as process-drawable (process->handle (-> (the-as collide-shape s2-0) process)))))
)
(when s4-1
(let ((a0-11 (-> s1-0 best-from-prim)))
(set! (-> s4-1 sticky-prim) a0-11)
(let ((s1-1
(-> (the-as process-drawable (-> obj process)) node-list data (-> a0-11 transform-index) bone transform)
)
)
(set! (-> s4-1 prim-ry) (matrix-y-angle s1-1))
(let ((s0-0 (new 'stack-no-clear 'matrix)))
(matrix-4x4-inverse! s0-0 s1-1)
(vector-matrix*! (-> s4-1 rider-local-pos) (-> (the-as collide-shape s2-0) trans) s0-0)
)
)
)
(send-event (-> obj process) 'ridden s4-1)
)
)
(set! s4-0 (-> obj root-prim collide-with))
)
)
)
)
)
(set! v1-7 s3-0)
*collide-player-list*
(set! s3-0 (-> s3-0 next0))
)
)
)
)
(when (logtest? s4-0 (collide-kind cak-1 cak-2 cak-3))
(when (logtest? s4-0 (collide-kind cak-1))
(let ((v1-37 (-> *collide-hit-by-player-list* alive-list next0)))
*collide-hit-by-player-list*
(let ((s3-1 (-> v1-37 next0)))
(while (!= v1-37 (-> *collide-hit-by-player-list* alive-list-end))
(let* ((s2-1 (-> (the-as connection v1-37) param1))
(v1-38 (-> (the-as collide-shape s2-1) root-prim))
)
(when (logtest? s4-0 (-> v1-38 prim-core collide-as))
(when (and (logtest? (-> v1-38 prim-core action) (collide-action ca-2))
(!= (-> obj process) (-> (the-as collide-shape s2-1) process))
)
(let ((s1-2 (new 'stack-no-clear 'collide-overlap-result)))
(when (on-platform obj (the-as collide-shape s2-1) s1-2)
(let ((s4-2 (add-rider! s5-0 (the-as process-drawable (process->handle (-> (the-as collide-shape s2-1) process)))))
)
(when s4-2
(let ((a0-30 (-> s1-2 best-from-prim)))
(set! (-> s4-2 sticky-prim) a0-30)
(let ((s1-3 (-> obj process node-list data (-> a0-30 transform-index) bone transform)))
(set! (-> s4-2 prim-ry) (matrix-y-angle s1-3))
(let ((s0-1 (new 'stack-no-clear 'matrix)))
(matrix-4x4-inverse! s0-1 s1-3)
(vector-matrix*! (-> s4-2 rider-local-pos) (-> (the-as collide-shape s2-1) trans) s0-1)
)
)
)
(send-event (-> obj process) 'ridden s4-2)
)
)
(set! s4-0 (-> obj root-prim collide-with))
)
)
)
)
)
(set! v1-37 s3-1)
*collide-hit-by-player-list*
(set! s3-1 (-> s3-1 next0))
)
)
)
)
(when (logtest? s4-0 (collide-kind cak-2))
(let ((v1-66 (-> *collide-usually-hit-by-player-list* alive-list next0)))
*collide-usually-hit-by-player-list*
(let ((s3-2 (-> v1-66 next0)))
(while (!= v1-66 (-> *collide-usually-hit-by-player-list* alive-list-end))
(let* ((s2-2 (-> (the-as connection v1-66) param1))
(v1-67 (-> (the-as collide-shape s2-2) root-prim))
)
(when (logtest? s4-0 (-> v1-67 prim-core collide-as))
(when (and (logtest? (-> v1-67 prim-core action) (collide-action ca-2))
(!= (-> obj process) (-> (the-as collide-shape s2-2) process))
)
(let ((s1-4 (new 'stack-no-clear 'collide-overlap-result)))
(when (on-platform obj (the-as collide-shape s2-2) s1-4)
(let ((s4-3 (add-rider! s5-0 (the-as process-drawable (process->handle (-> (the-as collide-shape s2-2) process)))))
)
(when s4-3
(let ((a0-49 (-> s1-4 best-from-prim)))
(set! (-> s4-3 sticky-prim) a0-49)
(let ((s1-5 (-> obj process node-list data (-> a0-49 transform-index) bone transform)))
(set! (-> s4-3 prim-ry) (matrix-y-angle s1-5))
(let ((s0-2 (new 'stack-no-clear 'matrix)))
(matrix-4x4-inverse! s0-2 s1-5)
(vector-matrix*! (-> s4-3 rider-local-pos) (-> (the-as collide-shape s2-2) trans) s0-2)
)
)
)
(send-event (-> obj process) 'ridden s4-3)
)
)
(set! s4-0 (-> obj root-prim collide-with))
)
)
)
)
)
(set! v1-66 s3-2)
*collide-usually-hit-by-player-list*
(set! s3-2 (-> s3-2 next0))
)
)
)
)
(when (logtest? s4-0 (collide-kind cak-3))
(let ((v1-94 (-> *collide-hit-by-others-list* alive-list next0)))
*collide-hit-by-others-list*
(let ((s3-3 (-> v1-94 next0)))
(while (!= v1-94 (-> *collide-hit-by-others-list* alive-list-end))
(let* ((s2-3 (-> (the-as connection v1-94) param1))
(v1-95 (-> (the-as collide-shape s2-3) root-prim))
)
(when (logtest? s4-0 (-> v1-95 prim-core collide-as))
(when (and (logtest? (-> v1-95 prim-core action) (collide-action ca-2))
(!= (-> obj process) (-> (the-as collide-shape s2-3) process))
)
(let ((s1-6 (new 'stack-no-clear 'collide-overlap-result)))
(when (on-platform obj (the-as collide-shape s2-3) s1-6)
(let ((s4-4 (add-rider! s5-0 (the-as process-drawable (process->handle (-> (the-as collide-shape s2-3) process)))))
)
(when s4-4
(let ((a0-68 (-> s1-6 best-from-prim)))
(set! (-> s4-4 sticky-prim) a0-68)
(let ((s1-7 (-> obj process node-list data (-> a0-68 transform-index) bone transform)))
(set! (-> s4-4 prim-ry) (matrix-y-angle s1-7))
(let ((s0-3 (new 'stack-no-clear 'matrix)))
(matrix-4x4-inverse! s0-3 s1-7)
(vector-matrix*! (-> s4-4 rider-local-pos) (-> (the-as collide-shape s2-3) trans) s0-3)
)
)
)
(send-event (-> obj process) 'ridden s4-4)
)
)
(set! s4-0 (-> obj root-prim collide-with))
)
)
)
)
)
(set! v1-94 s3-3)
*collide-hit-by-others-list*
(set! s3-3 (-> s3-3 next0))
)
)
)
#f
)
)
)
)
)
)
(defmethod pull-riders! collide-shape ((obj collide-shape))
"Move our riders."
(let ((s5-0 (-> obj riders)))
(when s5-0
(let ((s4-0 (new 'stack-no-clear 'pull-rider-info)))
(countdown (s3-0 (-> s5-0 num-riders))
(let* ((v1-2 (-> s5-0 rider s3-0))
(a0-1 (-> v1-2 rider-handle))
)
(when (handle->process a0-1)
(set! (-> s4-0 rider) v1-2)
(set! (-> s4-0 rider-cshape)
(the-as collide-shape-moving (-> (the-as process-drawable (-> a0-1 process 0)) root))
)
(let ((a0-5 (-> v1-2 sticky-prim)))
(when a0-5
(let ((s2-0 (-> obj process node-list data (-> a0-5 transform-index) bone transform)))
(let ((s1-0 (-> s4-0 rider-dest)))
(vector-matrix*! s1-0 (-> v1-2 rider-local-pos) s2-0)
(vector-float*! s1-0 s1-0 (/ 1.0 (-> s1-0 w)))
)
(set! (-> s4-0 rider-delta-ry) (deg- (matrix-y-angle s2-0) (-> s4-0 rider prim-ry)))
)
(pull-rider! obj s4-0)
)
)
)
)
)
)
#f
)
)
)
(defmethod pull-rider! collide-shape ((obj collide-shape) (arg0 pull-rider-info))
"Move a rider."
(local-vars (at-0 int) (sv-160 (function collide-shape-moving float collide-kind none)))
(rlet ((vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
)
(init-vf0-vector)
(let ((gp-0 (-> arg0 rider-cshape)))
(let ((s3-0 (new 'stack-no-clear 'vector))
(s4-0 (new 'stack-no-clear 'vector))
)
(set! (-> s4-0 quad) (-> gp-0 trans quad))
(vector-! s3-0 (-> arg0 rider-dest) s4-0)
(cond
((logtest? (-> obj root-prim prim-core action) (collide-action ca-4))
(let ((s1-0 (-> obj root-prim prim-core collide-as)))
(set! (-> obj root-prim prim-core collide-as) (collide-kind))
(let ((s0-0 gp-0))
(set! sv-160 (method-of-object s0-0 fill-cache-for-shape!))
(let ((a1-3 (+ 8192.0 (vector-length s3-0)))
(a2-0 (-> gp-0 root-prim collide-with))
)
(sv-160 s0-0 a1-3 a2-0)
)
)
(set! (-> obj root-prim prim-core collide-as) s1-0)
)
(let ((s2-1 (new 'stack-no-clear 'vector)))
(set! (-> s2-1 quad) (-> s3-0 quad))
(let ((v1-12 s2-1))
(.lvf vf1 (&-> s2-1 quad))
(let ((f0-2 (-> *display* frames-per-second)))
(.mov at-0 f0-2)
)
(.mov vf2 at-0)
(.mov.vf vf1 vf0 :mask #b1000)
(.mul.x.vf vf1 vf1 vf2 :mask #b111)
(.svf (&-> v1-12 quad) vf1)
)
(cond
((type-type? (-> gp-0 type) collide-shape-moving)
(let ((s3-1 (-> gp-0 status)))
(integrate-and-collide! gp-0 s2-1)
(set! (-> gp-0 status) s3-1)
)
)
(else
(integrate-and-collide! gp-0 s2-1)
)
)
)
)
(else
(move-by-vector! gp-0 s3-0)
)
)
(when (type-type? (-> gp-0 type) collide-shape-moving)
(let ((v1-18 (new 'stack-no-clear 'vector)))
(vector-! v1-18 (-> gp-0 trans) s4-0)
(vector-float*! (-> gp-0 rider-last-move) v1-18 (-> *display* frames-per-second))
)
(set! (-> gp-0 rider-time) (the-as uint (-> *display* base-frame-counter)))
)
)
(let ((f0-4 (-> arg0 rider-delta-ry)))
(if (!= f0-4 0.0)
(send-event (-> gp-0 process) 'rotate-y-angle f0-4)
)
)
)
(none)
)
)
(defmethod alloc-riders collide-shape ((obj collide-shape) (arg0 int))
(if (-> obj riders)
(format 0 "ERROR: colide-shape::alloc-riders is being called multiple times!~%")
(set! (-> obj riders) (new 'process 'collide-sticky-rider-group arg0))
)
(none)
)
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -79,7 +79,7 @@
(unknown-vector51 vector :inline :offset 1200) ;; from - logic-target::build-conversions
(unknown-vector52 vector :inline :offset 1216)
(unknown-vector53 vector :inline :offset 1232)
(unknown-vector54 vector :inline :offset 1248)
(last-known-safe-ground vector :inline :offset 1248)
(unknown-vector55 vector :inline :offset 1264)
(unknown-dword10 int64 :offset 1280) ;; from - collide-reaction-target::target-collision-reaction
(unknown-dword11 int64 :offset 1288) ;; from - target-util::can-jump?
+18 -10
View File
@@ -5,9 +5,17 @@
;; name in dgo: collide-touch-h
;; dgos: GAME, ENGINE
;;;;;;;;;;;;;;;;;;;;;;;;
;; Collide Touch
;;;;;;;;;;;;;;;;;;;;;;;;
;; The collide-touch system is used to track collisions between collide shapes during collision resolution.
;; As the collision is resolved, shapes are added and removed from the touching list.
;; Once collision is done solving, you can send events or inspect what you touched!
;; A record of a primitive which is touching another, possibly including the triangle that is involved.
(deftype touching-prim (structure)
((cprim collide-shape-prim :offset-assert 0) ;; not 100% sure
((cprim collide-shape-prim :offset-assert 0)
(has-tri? symbol :offset-assert 4)
(tri collide-tri-result :inline :offset-assert 16)
)
@@ -29,10 +37,10 @@
:size-assert #xe4
:flag-assert #xd000000e4
(:methods
(get-touched-prim (_type_ trsqv touching-prims-entry) collide-shape-prim 9)
(get-touched-prim (_type_ trsqv touching-shapes-entry) collide-shape-prim 9)
(dummy-10 () none 10)
(dummy-11 (_type_ vector) vector 11)
(get-touched-tri (_type_ touching-prims-entry touching-prims-entry) collide-tri-result 12)
(get-middle-of-bsphere-overlap (_type_ vector) vector 11)
(get-touched-tri (_type_ collide-shape touching-shapes-entry) collide-tri-result 12)
)
)
@@ -47,7 +55,7 @@
(:methods
(new (symbol type) _type_ 0)
(alloc-node (_type_) touching-prims-entry 9)
(get-size (_type_) int 10)
(get-free-node-count (_type_) int 10)
(init-list! (_type_) none 11)
(free-node (_type_ touching-prims-entry) touching-prims-entry 12)
)
@@ -108,8 +116,8 @@
(dummy-11 () none 11)
(prims-touching? (_type_ collide-shape-moving uint) touching-prims-entry 12) ; this one!
(prims-touching-action? (_type_ collide-shape collide-action collide-action) touching-prims-entry 13)
(free-list () none 14)
(free-entry-list (_type_) symbol 15)
(dummy-14 () none 14)
(free-touching-prims-list (_type_) symbol 15)
(get-head (_type_) touching-prims-entry 16)
(get-next (_type_ touching-prims-entry) touching-prims-entry 17)
)
@@ -128,10 +136,10 @@
(new (symbol type) _type_ 0)
(add-touching-prims (_type_ collide-shape-prim collide-shape-prim float collide-tri-result collide-tri-result) none 9)
(dummy-10 () none 10)
(dummy-11 (_type_ float) none 11)
(dummy-12 (_type_) none 12)
(update-from-step-size (_type_ float) none 11)
(send-events-for-touching-shapes (_type_) none 12)
(get-shapes-entry (_type_ collide-shape collide-shape) touching-shapes-entry 13)
(dummy-14 (_type_) none 14)
(free-all-prim-nodes (_type_) none 14)
)
)
+209 -74
View File
@@ -7,7 +7,25 @@
;; DECOMP BEGINS
(defmethod get-size touching-prims-entry-pool ((obj touching-prims-entry-pool))
;;;;;;;;;;;;;;;;;;;;;
;; Touching List
;;;;;;;;;;;;;;;;;;;;;
;; The idea behind the touching list is to determine which things were touched during collision resolution, then
;; send events to processes based on this.
;; In the end, we want to track pairs of collide-shape-prims, and possibly triangles (if one of the prims has triangles).
;; The logic for this is more confusing than you might expect because they don't count every single intersection that
;; occurs in every single iteration of the collision solve.
;;;;;;;;;;;;;;;;;;;;
;; Entry Pool
;;;;;;;;;;;;;;;;;;;;
;; there's a global shared pool of entries that you can alloc and free from.
(defmethod get-free-node-count touching-prims-entry-pool ((obj touching-prims-entry-pool))
"Get the number of nodes that are not in use."
(let ((v0-0 0))
(let ((v1-0 (-> obj head)))
(while v1-0
@@ -23,6 +41,7 @@
)
(defmethod alloc-node touching-prims-entry-pool ((obj touching-prims-entry-pool))
"Allocate a node. Will return #f if there are none left."
(let ((gp-0 (-> obj head)))
(cond
(gp-0
@@ -45,6 +64,7 @@
)
(defmethod free-node touching-prims-entry-pool ((obj touching-prims-entry-pool) (arg0 touching-prims-entry))
"Free a node allocated with alloc-node"
(when (-> arg0 allocated?)
(set! (-> arg0 allocated?) #f)
(let ((v1-1 (-> obj head)))
@@ -59,7 +79,15 @@
)
)
(defmethod free-entry-list touching-shapes-entry ((obj touching-shapes-entry))
;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Shapes Entry
;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; a single shape entry represents a pair of shapes that collide.
;; There can be multiple colliding primitives.
(defmethod free-touching-prims-list touching-shapes-entry ((obj touching-shapes-entry))
"Return all nodes used by this touching-shapes-entry to the touching-prims-entry-pool"
(when (-> obj cshape1)
(set! (-> obj cshape1) #f)
(let ((gp-0 (-> obj head)))
@@ -79,11 +107,18 @@
)
)
(defmethod dummy-14 touching-list ((obj touching-list))
(let ((s5-0 (the-as object (-> obj touching-shapes))))
;;;;;;;;;;;;;;;;;;;;;;
;; Touching List
;;;;;;;;;;;;;;;;;;;;;;
;; A touching list is a list up to 32 pairs of colliding collide-shapes.
(defmethod free-all-prim-nodes touching-list ((obj touching-list))
"Free all prim nodes used by all touching shapes in this touching-list."
(let ((s5-0 (the-as touching-shapes-entry (-> obj touching-shapes))))
(countdown (s4-0 (-> obj num-touching-shapes))
(free-entry-list (the-as touching-shapes-entry s5-0))
(set! s5-0 (&+ (the-as touching-shapes-entry s5-0) 16))
(free-touching-prims-list s5-0)
(&+! s5-0 16)
)
)
(set! (-> obj num-touching-shapes) 0)
@@ -92,45 +127,58 @@
(none)
)
(defmethod get-shapes-entry touching-list ((obj touching-list) (arg0 collide-shape) (arg1 collide-shape))
(let ((v0-0 (the-as object (-> obj touching-shapes))))
(let ((v1-0 (the-as object #f)))
"Get a touching-shapes-entry for the two shapes. If one exists, it will be returned. Otherwise a new one will be made."
(let ((v0-0 (the-as touching-shapes-entry (-> obj touching-shapes)))) ;; the candidate
(let ((v1-0 (the-as touching-shapes-entry #f))) ;; a good one
;; loop over all touching shapes
(countdown (a3-0 (-> obj num-touching-shapes))
(let ((t0-0 (-> (the-as touching-shapes-entry v0-0) cshape1)))
(set! v1-0 (cond
(t0-0
(if (or (and (= t0-0 arg0) (= (-> (the-as touching-shapes-entry v0-0) cshape2) arg1))
(and (= t0-0 arg1) (= (-> (the-as touching-shapes-entry v0-0) cshape2) arg0))
)
(return (the-as touching-shapes-entry v0-0))
)
v1-0
)
(else
v0-0
)
)
(let ((t0-0 (-> v0-0 cshape1)))
(set! v1-0
(cond
(t0-0
;; in use. If it's match, return it (allows a,b or b,a to match a,b)
(if (or (and (= t0-0 arg0) (= (-> v0-0 cshape2) arg1)) (and (= t0-0 arg1) (= (-> v0-0 cshape2) arg0)))
(return v0-0)
)
;; otherwise bad
v1-0
)
(else
;; not in use. remember it's free and keep looking.
v0-0
)
)
)
)
(set! v0-0 (&+ (the-as touching-shapes-entry v0-0) 16))
(&+! v0-0 16)
)
;; done looping.
(cond
(v1-0
(v1-0 ;; did we find an unused slot? if so return it
(set! v0-0 v1-0)
)
(else
;; need to add a new one
(when (>= (-> obj num-touching-shapes) 32)
;; but there's no room!
(format 0 "ERROR: touching-list::get-shapes-entry() failed!~%")
(return (the-as touching-shapes-entry #f))
)
;; enough room, increase the size
(+! (-> obj num-touching-shapes) 1)
)
)
)
(set! (-> (the-as touching-shapes-entry v0-0) cshape1) arg0)
(set! (-> (the-as touching-shapes-entry v0-0) cshape2) arg1)
(set! (-> (the-as touching-shapes-entry v0-0) head) #f)
(set! (-> (the-as touching-shapes-entry v0-0) resolve-u) 1)
;; if we're doing a new one, set it up.
(set! (-> v0-0 cshape1) arg0)
(set! (-> v0-0 cshape2) arg1)
(set! (-> v0-0 head) #f)
(set! (-> v0-0 resolve-u) 1)
(set! (-> obj resolve-u) 1)
(the-as touching-shapes-entry v0-0)
)
@@ -146,7 +194,24 @@
)
;; WARN: Expression building failed: Function (method 9 touching-list) has a return type of none, but the expression builder found a return statement.
;;;;;;;;;;;;;;;;;;;;;;;;;
;; Touching List Update
;;;;;;;;;;;;;;;;;;;;;;;;;
;; Note: this code relies a lot on the details of the iterative collision solver they made.
;; Basically, the solver works like this:
;; "What happens if I move forward 1.0 timesteps?"
;; "You'd hit object A after 0.6 of a step, and object B after 0.3 of a step" (touching list has A and B now)
;; "OK. I will move forward 0.3 then. I will remove A from the touching list because I only went 0.3 of a step, and that's not enough to reach A."
;; ~Move forward 0.3, and handle the collision reaction from hitting B~
;; "I moved forward 0.3, so I now have 0.7 left to move (but potentially in a different direction because I bounced off of B)"
;; "What happens if I move forward 0.7 timesteps?"
;; .. repeat ..
(defmethod add-touching-prims touching-list ((obj touching-list)
(arg0 collide-shape-prim)
(arg1 collide-shape-prim)
@@ -154,11 +219,21 @@
(arg3 collide-tri-result)
(arg4 collide-tri-result)
)
"Tell the touching list that if we end taking a step of at least arg2, the prims arg0/arg1 will collide.
However, you don't have to know for sure if you're going to take this big of a step yet.
You can provide triangles if you want, but you don't have to.
The logic for calling this twice for the same prims in between calls to update-from-step-size is a little weird
so I suspect this never happens (and it's probably cheaper to avoid this duplication in the actual prim collision code)."
;; I don't know why they made this type, but I'm guessing it's to avoid the compiler spilling to the stack
(let ((gp-0 (new 'stack-no-clear 'add-prims-touching-work)))
(set! (-> gp-0 tri1) arg3)
(set! (-> gp-0 tri2) arg4)
;; first, grab the entry for the collide-shapes involved.
(let ((s2-0 (get-shapes-entry obj (-> arg0 cshape) (-> arg1 cshape))))
(when s2-0
;; if we ask for a,b, that function might give us b,a. Detect that, and swap our collide shape prims.
(when (= (-> s2-0 cshape1) (-> arg1 cshape))
(let ((v1-4 arg0))
(set! arg0 arg1)
@@ -166,23 +241,30 @@
)
)
(let ((s0-0 (-> s2-0 head)))
;; loop over all the entries in the shapes
(while s0-0
;; and only look at the ones that match these prims
(when (and (= (-> s0-0 prim1 cprim) arg0) (= (-> s0-0 prim2 cprim) arg1))
;; if we already have an entry for this one, only update if this one is closer.
(when (< arg2 (-> s0-0 u))
;; this value is unused.
(-> s0-0 u)
(let ((v1-12 (-> s0-0 prim1))
(a1-2 (-> gp-0 tri1))
)
(cond
(a1-2
;; we have a tri, copy it
(set! (-> v1-12 has-tri?) #t)
(mem-copy! (the-as pointer (-> v1-12 tri)) (the-as pointer a1-2) 84)
)
(else
;; no tri
(set! (-> v1-12 has-tri?) #f)
)
)
)
;; same for the other tri.
(let ((v1-15 (-> s0-0 prim2))
(a1-3 (-> gp-0 tri2))
)
@@ -197,12 +279,16 @@
)
)
)
;; after we found the matching node for these prims, we're done!
(return 0)
)
(set! s0-0 (-> s0-0 next))
)
)
;; nope, didn't find an entry, so make a new one.
(let ((s0-1 (alloc-node *touching-prims-entry-pool*)))
;; allocate a new node, link it.
(when s0-1
(let ((v1-22 (-> s2-0 head)))
(set! (-> s0-1 next) v1-22)
@@ -212,8 +298,15 @@
(set! (-> v1-22 prev) s0-1)
)
)
;; and set it up.
(set! (-> s0-1 u) arg2)
(when (>= arg2 0.0)
;; if we're >0, we have to move (which we haven't done yet) to actually collide.
;; flag us as resolve-u (meaning our u is from the resolve function, which looks at what _would_
;; happen if we did it all at once.)
;; if we're <0, we started in collision (possible, if we didnt' converge on the last frame)
;; we should still add, but we don't need to bother with the "did we go far enough" checks.
(set! (-> s2-0 resolve-u) 1)
(set! (-> obj resolve-u) 1)
)
@@ -254,58 +347,77 @@
(none)
)
(defmethod dummy-11 touching-list ((obj touching-list) (arg0 float))
(defmethod update-from-step-size touching-list ((obj touching-list) (arg0 float))
"Given that we actually will take a step size of arg0, remove things we won't actually hit."
;; only if we have some un-updated potential collision
(when (nonzero? (-> obj resolve-u))
;; remember we did it
(set! (-> obj resolve-u) 0)
(let ((s5-0 (the-as object (-> obj touching-shapes))))
;; loop through touching-shape-entries
(let ((s5-0 (the-as touching-shapes-entry (-> obj touching-shapes))))
(countdown (s4-0 (-> obj num-touching-shapes))
(when (nonzero? (-> (the-as touching-shapes-entry s5-0) resolve-u))
(set! (-> (the-as touching-shapes-entry s5-0) resolve-u) 0)
(when (-> (the-as touching-shapes-entry s5-0) cshape1)
(let ((s3-0 (-> (the-as touching-shapes-entry s5-0) head)))
;; only when the entry isn't done yet
(when (nonzero? (-> s5-0 resolve-u))
;; remember we did it
(set! (-> s5-0 resolve-u) 0)
;; we can have empty entries, so check cshape1
(when (-> s5-0 cshape1)
;; loop over nodes (each node is a pair of prims)
(let ((s3-0 (-> s5-0 head)))
(while s3-0
(let ((f0-0 (-> s3-0 u)))
(set! s3-0 (cond
((>= f0-0 0.0)
(cond
((>= arg0 f0-0)
(set! (-> s3-0 u) -1.0)
(set! s3-0 (-> s3-0 next))
(set! s3-0
(cond
((>= f0-0 0.0)
;; we'd have to take a step to hit this one!
(cond
((>= arg0 f0-0)
;; our step is big enough!
;; we hit it. To prevent this from being possibly removed later on
;; we set the u to -1.0 to indicate that we're massively intersecting.
;; this will no longer be eligible for removal because we actually hit it.
(set! (-> s3-0 u) -1.0)
(set! s3-0 (-> s3-0 next))
)
(else
;; we would have needed to move more than arg0 to hit this one.
;; at least for now, remove by splicing out of the list and freeing.
(let ((a1-1 s3-0)) ;; this
(let ((v1-7 (-> s3-0 next))) ;; next
(let ((a0-1 (-> s3-0 prev))) ;; prev
(if a0-1
(set! (-> a0-1 next) v1-7)
(set! (-> s5-0 head) v1-7)
)
(if v1-7
(set! (-> v1-7 prev) a0-1)
)
)
(set! s3-0 v1-7)
)
(else
(let ((a1-1 s3-0))
(let ((v1-7 (-> s3-0 next)))
(let ((a0-1 (-> s3-0 prev)))
(if a0-1
(set! (-> a0-1 next) v1-7)
(set! (-> (the-as touching-shapes-entry s5-0) head) v1-7)
)
(if v1-7
(set! (-> v1-7 prev) a0-1)
)
)
(set! s3-0 v1-7)
)
(free-node *touching-prims-entry-pool* a1-1)
)
)
)
s3-0
)
(else
(-> s3-0 next)
(free-node *touching-prims-entry-pool* a1-1)
)
)
)
s3-0
)
(else
;; not touching, advance to the next.
(-> s3-0 next)
)
)
)
)
)
)
(if (not (-> (the-as touching-shapes-entry s5-0) head))
(set! (-> (the-as touching-shapes-entry s5-0) cshape1) #f)
;; if we removed everything from this, mark it as dead (the allocation function will reuse it now)
(if (not (-> s5-0 head))
(set! (-> s5-0 cshape1) #f)
)
)
)
(set! s5-0 (&+ (the-as touching-shapes-entry s5-0) 16))
(&+! s5-0 16)
)
)
)
@@ -313,18 +425,26 @@
(none)
)
(defmethod dummy-12 touching-list ((obj touching-list))
(defmethod send-events-for-touching-shapes touching-list ((obj touching-list))
"Send all events for touching shapes.
Note that the order of event sending is basically random.
(this could explain lava walks's unreliable behavior)"
(let ((gp-0 (the-as object (-> obj touching-shapes))))
(countdown (s5-0 (-> obj num-touching-shapes))
(let ((s4-0 (-> (the-as touching-shapes-entry gp-0) cshape1)))
(when s4-0
(let ((s3-0 (-> (the-as touching-shapes-entry gp-0) cshape2)))
;; not quite sure why, but we make it look like cshape1 (s4) is target always.
;; I guess this makes it so the target/enemy events are always sent in the same order.
(when (= (-> s3-0 process type) target)
(let ((v1-2 s4-0))
(set! s4-0 s3-0)
(set! s3-0 v1-2)
)
)
;; send events!
(let ((v1-4 (-> s4-0 event-self)))
(when v1-4
(let ((a1-0 (new 'stack-no-clear 'event-message-block)))
@@ -380,6 +500,7 @@
)
(defmethod prims-touching? touching-shapes-entry ((obj touching-shapes-entry) (arg0 collide-shape-moving) (arg1 uint))
"In a pair of collide shapes, is a prim from the given collide shape with the given prim-id mask touching the other shape?"
(cond
((= (-> obj cshape1) arg0)
(let ((v1-1 (-> obj head)))
@@ -409,6 +530,8 @@
)
(defmethod prims-touching-action? touching-shapes-entry ((obj touching-shapes-entry) (arg0 collide-shape) (arg1 collide-action) (arg2 collide-action))
"In a pair of collide shapes, find a pair of colliding prims where the prim from the given collide shape has at least one of the actions in arg1
and none of the actions in arg2."
(cond
((= (-> obj cshape1) arg0)
(let ((v1-1 (-> obj head)))
@@ -442,6 +565,7 @@
)
(defmethod get-touched-shape touching-shapes-entry ((obj touching-shapes-entry) (arg0 collide-shape))
"Get the other shape in a pair of shapes."
(cond
((= (-> obj cshape1) arg0)
(return (-> obj cshape2))
@@ -453,29 +577,31 @@
(the-as collide-shape #f)
)
(defmethod get-touched-prim touching-prims-entry ((obj touching-prims-entry) (arg0 trsqv) (arg1 touching-prims-entry))
(defmethod get-touched-prim touching-prims-entry ((obj touching-prims-entry) (arg0 trsqv) (arg1 touching-shapes-entry))
"Get the primitive belonging to the collide shape that is touching."
(cond
((= (-> arg1 next) arg0)
((= (-> arg1 cshape1) arg0)
(return (-> obj prim1 cprim))
)
((= (-> arg1 prev) arg0)
((= (-> arg1 cshape2) arg0)
(return (-> obj prim2 cprim))
)
)
(the-as collide-shape-prim #f)
)
(defmethod get-touched-tri touching-prims-entry ((obj touching-prims-entry) (arg0 touching-prims-entry) (arg1 touching-prims-entry))
(defmethod get-touched-tri touching-prims-entry ((obj touching-prims-entry) (arg0 collide-shape) (arg1 touching-shapes-entry))
"Get the triangle belonging to the the collide shape that is touching (if it has one, otherwise #f)"
(let ((v0-0 (the-as collide-tri-result #f)))
(cond
((= (-> arg1 next) arg0)
((= (-> arg1 cshape1) arg0)
(let ((v1-2 (-> obj prim1)))
(if (-> v1-2 has-tri?)
(set! v0-0 (-> v1-2 tri))
)
)
)
((= (-> arg1 prev) arg0)
((= (-> arg1 cshape2) arg0)
(let ((v1-5 (-> obj prim2)))
(if (-> v1-5 has-tri?)
(set! v0-0 (-> v1-5 tri))
@@ -487,9 +613,14 @@
)
)
(defmethod dummy-11 touching-prims-entry ((obj touching-prims-entry) (arg0 vector))
(defmethod get-middle-of-bsphere-overlap touching-prims-entry ((obj touching-prims-entry) (arg0 vector))
"This is a bit weird...
But assuming the the bounding spheres overlap, draw a line between their centers, consider the line segment
that is inside of both spheres, and get the midpoint of that."
(let* ((s4-0 (-> obj prim1 cprim))
(s3-0 (-> obj prim2 cprim))
;; compute the offset between the prim cores.
(gp-1 (vector-!
(new 'stack-no-clear 'vector)
(the-as vector (-> s3-0 prim-core))
@@ -497,9 +628,13 @@
)
)
)
;; subtract off the two radius. this is now the offset between the "closest" points (and is negative)
(let ((f1-2 (- (- (vector-length gp-1) (-> s3-0 prim-core world-sphere w)) (-> s4-0 prim-core world-sphere w))))
;; this offset is the radius, minus half the overlap distance
(vector-normalize! gp-1 (+ (-> s4-0 prim-core world-sphere w) (* 0.5 f1-2)))
)
;; so add it to s4's origin to get to the halfway point
(vector+! arg0 gp-1 (the-as vector (-> s4-0 prim-core)))
)
arg0
+3
View File
@@ -17,6 +17,9 @@
(deftype viewer (process-drawable)
((janim art-joint-anim :offset-assert 176)
)
(:states
viewer-process
)
:heap-base #x50
:method-count-assert 20
:size-assert #xb4
+9 -9
View File
@@ -273,7 +273,7 @@
(defmethod dummy-17 process-drawable ((obj process-drawable))
(cond
(#t;;(logtest? (-> obj draw status) (draw-status drwf01 drwf02))
(#t;;(logtest? (-> obj draw status) (draw-status drwf01 drwf02)) TODO
)
((zero? (-> obj skel))
(matrix<-transformq+trans!
@@ -892,7 +892,7 @@
(when (or (logtest? (-> self skel status) 1) gp-1)
(dummy-17 self)
(if (and gp-1 (type-type? (-> self root type) collide-shape))
(dummy-47 (the-as collide-shape (-> self root)))
(update-transforms! (the-as collide-shape (-> self root)))
)
(return #f)
)
@@ -950,21 +950,21 @@
(defbehavior transform-post process-drawable ()
(ja-post)
(dummy-47 (the-as collide-shape (-> self root)))
(update-transforms! (the-as collide-shape (-> self root)))
0
)
(defbehavior rider-trans process-drawable ()
(dummy-35 (the-as collide-shape (-> self root)))
(detect-riders! (the-as collide-shape (-> self root)))
0
)
(defbehavior rider-post process-drawable ()
(ja-post)
(let ((gp-0 (the-as collide-shape (-> self root))))
(dummy-47 gp-0)
(dummy-44 gp-0)
(dummy-45 gp-0)
(update-transforms! gp-0)
(pull-riders! gp-0)
(respond-to-collisions! gp-0)
)
0
)
@@ -972,8 +972,8 @@
(defbehavior pusher-post process-drawable ()
(ja-post)
(let ((gp-0 (the-as collide-shape (-> self root))))
(dummy-47 gp-0)
(dummy-45 gp-0)
(update-transforms! gp-0)
(respond-to-collisions! gp-0)
)
0
)
+35 -29
View File
@@ -272,7 +272,7 @@
(initialize-params self 4500 (the-as float 1024.0))
)
)
(dummy-47 (-> self root-override))
(update-transforms! (-> self root-override))
(set! (-> self event-hook) (-> (method-of-object self wait) event))
(if (logtest? (fact-options eco-blocked) (-> self fact options))
(go-virtual blocked)
@@ -288,7 +288,7 @@
(set! (-> obj root-override trans quad) (-> arg0 extra trans quad))
(get-pickup-sound obj (-> obj fact pickup-type))
(initialize-params obj 0 (the-as float 1024.0))
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(if (logtest? (fact-options eco-blocked) (-> obj fact options))
(go (method-of-object obj blocked))
)
@@ -469,7 +469,7 @@
(set! (-> self root-override trans quad) (-> self jump-pos quad))
(set! (-> self base quad) (-> self root-override trans quad))
(vector-reset! (-> self root-override transv))
(dummy-47 (-> self root-override))
(update-transforms! (-> self root-override))
(logclear! (-> self flags) (collectable-flags trans))
(logior! (-> self flags) (collectable-flags can-collect))
(if (-> self actor-pause)
@@ -511,7 +511,7 @@
)
((= arg2 'trans)
(set! (-> self root-override trans quad) (-> (the-as vector (-> arg3 param 0)) quad))
(dummy-47 (-> self root-override))
(update-transforms! (-> self root-override))
(ja-post)
)
((= arg2 'jump)
@@ -522,7 +522,7 @@
((= arg2 'pickup)
(when (!= (-> self next-state name) 'pickup)
(if (and (> arg1 0) (-> arg3 param 0))
(TODO-RENAME-30 (-> self root-override) (the-as vector (-> arg3 param 0)))
(move-to-point! (-> self root-override) (the-as vector (-> arg3 param 0)))
)
(logclear! (-> self mask) (process-mask actor-pause))
(go-virtual pickup #f (the-as handle #f))
@@ -579,9 +579,9 @@
((logtest? (-> self flags) (collectable-flags trans))
(vector-v++!
(-> self root-override transv)
(dummy-62 (-> self root-override) (new-stack-vector0) (the-as float 0.0))
(compute-acc-due-to-gravity (-> self root-override) (new-stack-vector0) (the-as float 0.0))
)
(dummy-57 (-> self root-override) (-> self root-override transv))
(integrate-no-collide! (-> self root-override) (-> self root-override transv))
(when (and (>= 0.0 (-> self root-override transv y)) (>= (-> self base y) (-> self root-override trans y)))
(set! (-> self root-override trans y) (-> self base y))
(cond
@@ -615,7 +615,7 @@
(set! (-> self trans-hook) #f)
)
)
(dummy-47 (-> self root-override))
(update-transforms! (-> self root-override))
(none)
)
:code
@@ -709,7 +709,7 @@
(while #t
(set! (-> self root-override trans quad) (-> self base quad))
(add-blue-motion #t #f #t #f)
(dummy-47 (-> self root-override))
(update-transforms! (-> self root-override))
(if (nonzero? (-> self draw))
(ja-post)
)
@@ -1215,7 +1215,7 @@
)
)
)
(dummy-47 (-> self root-override))
(update-transforms! (-> self root-override))
)
)
(ja-post)
@@ -1318,7 +1318,7 @@
(initialize obj)
(process-drawable-from-entity! obj (the-as entity-actor (-> obj entity)))
(initialize-params obj 0 (the-as float 1024.0))
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(go (method-of-object obj wait))
(none)
)
@@ -1341,7 +1341,7 @@
(vector-identity! (-> self root-override scale))
(set! (-> self root-override transv quad) (-> arg1 quad))
(initialize-params self 4500 (the-as float 1024.0))
(dummy-47 (-> self root-override))
(update-transforms! (-> self root-override))
(set! (-> self event-hook) (-> (method-of-object self wait) event))
(go-virtual wait)
(none)
@@ -1361,7 +1361,7 @@
(set! (-> self root-override transv quad) (-> arg1 quad))
(initialize-params self 4500 (the-as float 0.0))
(logior! (-> self flags) (collectable-flags ignore-blue))
(dummy-47 (-> self root-override))
(update-transforms! (-> self root-override))
(set! (-> self event-hook) (-> (method-of-object self wait) event))
(go-virtual wait)
(none)
@@ -1523,12 +1523,12 @@
((= arg2 'trans)
(set! (-> self root-override trans quad) (-> (the-as vector (-> arg3 param 0)) quad))
(set! (-> self base quad) (-> self root-override trans quad))
(dummy-47 (-> self root-override))
(update-transforms! (-> self root-override))
)
((= arg2 'pickup)
(when (!= (-> self next-state name) 'pickup)
(if (and (> arg1 0) (-> arg3 param 0))
(TODO-RENAME-30 (-> self root-override) (the-as vector (-> arg3 param 0)))
(move-to-point! (-> self root-override) (the-as vector (-> arg3 param 0)))
)
(logclear! (-> self mask) (process-mask actor-pause))
(go-virtual pickup #f (process->handle *target*))
@@ -1717,19 +1717,25 @@
)
(cond
((and *debug-segment* (< (-> *fuel-cell-tune-pos* w) 1000000000.0))
(TODO-RENAME-30 (-> self root-override) *fuel-cell-tune-pos*)
(move-to-point! (-> self root-override) *fuel-cell-tune-pos*)
(set-yaw-angle-clear-roll-pitch! (-> self root-override) (-> *fuel-cell-tune-pos* w))
)
((= (-> self movie-pos-index) -1)
)
(gp-1
(TODO-RENAME-30 (-> self root-override) gp-1)
(move-to-point! (-> self root-override) gp-1)
(set-yaw-angle-clear-roll-pitch! (-> self root-override) (-> gp-1 w))
)
(else
(TODO-RENAME-30 (-> self root-override) (-> *target* control trans))
(move-to-point! (-> self root-override) (-> *target* control trans))
(set-yaw-angle-clear-roll-pitch! (-> self root-override) (y-angle (-> *target* control)))
(dummy-60 (-> self root-override) (the-as float 40960.0) (the-as float 40960.0) #f (collide-kind background))
(move-to-ground
(-> self root-override)
(the-as float 40960.0)
(the-as float 40960.0)
#f
(collide-kind background)
)
)
)
)
@@ -2115,7 +2121,7 @@
(process-drawable-from-entity! obj (the-as entity-actor (-> obj entity)))
(initialize-params obj 0 (the-as float 1024.0))
(logclear! (-> obj fact options) (fact-options can-collect))
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(go (method-of-object obj wait))
(none)
)
@@ -2139,7 +2145,7 @@
(set! (-> self root-override transv quad) (-> arg1 quad))
(initialize-params self 0 (the-as float 1024.0))
(logclear! (-> self fact options) (fact-options can-collect))
(dummy-47 (-> self root-override))
(update-transforms! (-> self root-override))
(let ((gp-1 (res-lump-struct (-> self entity) 'movie-pos structure :time (the-as float -1000000000.0))))
(cond
((and *debug-segment* (< (-> *fuel-cell-tune-pos* w) 1000000000.0))
@@ -2173,7 +2179,7 @@
(('pickup)
(when (!= (-> self next-state name) 'pickup)
(if (and (> arg1 0) (-> arg3 param 0))
(TODO-RENAME-30 (-> self root-override) (the-as vector (-> arg3 param 0)))
(move-to-point! (-> self root-override) (the-as vector (-> arg3 param 0)))
)
(logclear! (-> self mask) (process-mask actor-pause))
(go-virtual pickup #f (the-as handle #f))
@@ -2182,7 +2188,7 @@
(('trans)
(set! (-> self root-override trans quad) (-> (the-as vector (-> arg3 param 0)) quad))
(set! (-> self base quad) (-> self root-override trans quad))
(dummy-47 (-> self root-override))
(update-transforms! (-> self root-override))
)
(('stop-cloning 'notify)
(set! (-> self root-override trans quad) (-> self draw origin quad))
@@ -2215,7 +2221,7 @@
)
:post
(behavior ()
(dummy-47 (-> self root-override))
(update-transforms! (-> self root-override))
(animate self)
(none)
)
@@ -2471,7 +2477,7 @@
(process-drawable-from-entity! obj (the-as entity-actor (-> obj entity)))
(initialize-params obj 0 (the-as float 1024.0))
(set! (-> obj collect-timeout) 600)
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(update-trans! (-> obj sound) (-> obj root-override trans))
(if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete)))
(go (method-of-object obj wait))
@@ -2498,7 +2504,7 @@
(vector-identity! (-> self root-override scale))
(set! (-> self root-override transv quad) (-> arg1 quad))
(initialize-params self 0 (the-as float 1024.0))
(dummy-47 (-> self root-override))
(update-transforms! (-> self root-override))
(update-trans! (-> self sound) (-> self root-override trans))
(set! (-> self event-hook) (-> (method-of-object self wait) event))
(go-virtual wait)
@@ -2860,7 +2866,7 @@
)
(when (!= (-> self offset-target y) (-> self offset y))
(vector-seek! (-> self offset) (-> self offset-target) (* 4096.0 (-> *display* seconds-per-frame)))
(TODO-RENAME-30 (-> self root-override) (vector+!
(move-to-point! (-> self root-override) (vector+!
(new 'stack-no-clear 'vector)
(-> (the-as process-drawable (-> self parent 0)) root trans)
(-> self offset)
@@ -2906,7 +2912,7 @@
)
(set! (-> self offset quad) (-> self offset-target quad))
(initialize-skeleton self *ecovalve-sg* '())
(TODO-RENAME-30 (-> self root-override) (vector+!
(move-to-point! (-> self root-override) (vector+!
(new 'stack-no-clear 'vector)
(-> (the-as process-drawable (-> self parent 0)) root trans)
(-> self offset)
@@ -2956,7 +2962,7 @@
(set! (-> obj root-override) s3-0)
)
(set! (-> obj root-override trans quad) (-> arg0 extra trans quad))
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(set! (-> obj root-override pause-adjust-distance) 409600.0)
(set! (-> obj fact) (new 'process 'fact-info obj arg1 (-> *FACT-bank* eco-full-inc)))
(set! (-> obj block-func) (the-as (function vent symbol) true-func))
+3 -3
View File
@@ -807,7 +807,7 @@
:code
(behavior ()
(suspend)
(dummy-47 (-> self root-override))
(update-transforms! (-> self root-override))
(logior! (-> self mask) (process-mask sleep))
(while #t
(suspend)
@@ -1219,7 +1219,7 @@
(set! (-> s4-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s4-0 1)
(alloc-riders 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) (collide-kind crate blue-eco-suck))
(set! (-> s3-0 collide-with) (collide-kind target))
@@ -1499,7 +1499,7 @@
(behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
(suspend)
(dummy-47 (-> self root-override))
(update-transforms! (-> self root-override))
(while #t
(set! (-> self state-time) (-> *display* base-frame-counter))
(ja-post)
+12 -12
View File
@@ -52,7 +52,7 @@
)
)
(if a0-7
(TODO-RENAME-30 a0-7 (-> (the-as process-drawable s5-0) root trans))
(move-to-point! a0-7 (-> (the-as process-drawable s5-0) root trans))
(set! (-> self root trans quad) (-> (the-as process-drawable s5-0) root trans quad))
)
)
@@ -315,7 +315,7 @@
((= v1-0 'trans)
(cond
((type-type? (-> self root type) collide-shape)
(TODO-RENAME-30 (the-as collide-shape (-> self root)) (the-as vector (-> arg3 param 0)))
(move-to-point! (the-as collide-shape (-> self root)) (the-as vector (-> arg3 param 0)))
)
(else
(set! v0-0 (the-as none (-> self root trans)))
@@ -442,7 +442,7 @@
(when v1-20
(let ((gp-1 (-> (the-as process-drawable v1-20) root trans)))
(if (type-type? (-> self root type) collide-shape)
(TODO-RENAME-28
(move-by-vector!
(the-as collide-shape (-> self root))
(vector-! (new 'stack-no-clear 'vector) gp-1 (-> self old-grab-pos))
)
@@ -576,7 +576,7 @@
(set! (-> self root trans quad) (-> arg0 quad))
(initialize-skeleton self arg2 '())
(if (type-type? (-> self root type) collide-shape)
(dummy-47 (the-as collide-shape (-> self root)))
(update-transforms! (the-as collide-shape (-> self root)))
)
(set! (-> self shadow-backup) (-> self draw shadow))
(set! (-> self new-trans-hook) nothing)
@@ -2031,8 +2031,8 @@
(go launcher-deactivated)
)
(('trans)
(TODO-RENAME-30 (-> self root-override) (the-as vector (-> arg3 param 0)))
(dummy-47 (-> self root-override))
(move-to-point! (-> self root-override) (the-as vector (-> arg3 param 0)))
(update-transforms! (-> self root-override))
)
)
)
@@ -2104,8 +2104,8 @@
(go launcher-deactivated)
)
((= arg2 'trans)
(TODO-RENAME-30 (-> self root-override) (the-as vector (-> arg3 param 0)))
(dummy-47 (-> self root-override))
(move-to-point! (-> self root-override) (the-as vector (-> arg3 param 0)))
(update-transforms! (-> self root-override))
)
)
)
@@ -2178,7 +2178,7 @@
(set! (-> obj root-override) s4-0)
)
(process-drawable-from-entity! obj arg0)
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(set! (-> obj active-distance) 409600.0)
(set! (-> obj spring-height) (res-lump-float arg0 'spring-height :default 163840.0))
(let ((s4-1 (res-lump-value arg0 'mode uint128)))
@@ -2241,7 +2241,7 @@
(set! (-> self root-override trans quad) (-> arg0 quad))
(set-vector! (-> self root-override scale) 1.0 1.0 1.0 1.0)
(set-vector! (-> self root-override quat) 0.0 0.0 0.0 1.0)
(dummy-47 (-> self root-override))
(update-transforms! (-> self root-override))
(set! (-> self spring-height) arg1)
(set! (-> self active-distance) arg3)
(let ((v1-23 (-> self entity extra level name)))
@@ -2420,11 +2420,11 @@
(if (-> self callback)
((-> self callback) self)
)
(dummy-47 (-> self root-override))
(update-transforms! (-> self root-override))
(let ((a1-3 (new 'stack-no-clear 'touching-shapes-entry)))
(set! (-> a1-3 cshape1) (the-as collide-shape 2))
(set! (-> a1-3 cshape2) (the-as collide-shape *touching-list*))
(dummy-40 (-> self root-override) a1-3)
(find-overlapping-shapes (-> self root-override) (the-as overlaps-others-params a1-3))
)
(suspend)
)
+45 -51
View File
@@ -635,25 +635,22 @@
)
)
(cond
((and
(= (-> self control ground-pat material) (pat-material ice))
(and
(>= (-> self control unknown-float01) 204.8)
(< (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) 15)
)
)
((and (= (-> self control ground-pat material) (pat-material ice))
(and (>= (-> self control unknown-float01) 204.8)
(< (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) 15)
)
)
(let ((gp-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 74))))
(if (and
(< (fabs
(if (and (< (fabs
(vector-dot
(-> self control dynam gravity-normal)
(vector-! (new 'stack-no-clear 'vector) gp-0 (-> self control trans))
)
)
819.2
)
(rand-vu-percent? 0.5)
)
819.2
)
(rand-vu-percent? 0.5)
)
(sp-launch-particles-var
*sp-particle-system-3d*
(-> *part-id-table* 2391)
@@ -665,17 +662,16 @@
)
)
(let ((gp-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 70))))
(if (and
(< (fabs
(if (and (< (fabs
(vector-dot
(-> self control dynam gravity-normal)
(vector-! (new 'stack-no-clear 'vector) gp-1 (-> self control trans))
)
)
819.2
)
(rand-vu-percent? 0.5)
)
819.2
)
(rand-vu-percent? 0.5)
)
(sp-launch-particles-var
*sp-particle-system-3d*
(-> *part-id-table* 2391)
@@ -688,11 +684,11 @@
)
(let ((f0-8 (lerp-scale 60.0 90.0 (-> self control unknown-float01) 0.0 81920.0)))
(if (not (= (if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
(-> self draw art-group data 104)
)
)
(-> self skel root-channel 0 frame-group)
)
(-> self draw art-group data 104)
)
)
(set! f0-8 (* 0.75 f0-8))
)
(set! (-> self control unknown-float141)
@@ -733,37 +729,35 @@
(set! (-> a0-33 settings shadow-dir y) (-> v1-67 y))
(set! (-> a0-33 settings shadow-dir z) (-> v1-67 z))
)
(when (and
(!= (-> self fact-info-target eco-level) 0.0)
(>= (- (-> *display* game-frame-counter) (the-as int (-> self fact-info-target eco-pickup-time)))
(the-as int (-> self fact-info-target eco-timeout))
)
)
(when (and (!= (-> self fact-info-target eco-level) 0.0)
(>= (- (-> *display* game-frame-counter) (the-as int (-> self fact-info-target eco-pickup-time)))
(the-as int (-> self fact-info-target eco-timeout))
)
)
(set! (-> self fact-info-target eco-level) 0.0)
(set! (-> self fact-info-target eco-timeout) 0)
(set! (-> self state-flags) (logand -65 (-> self state-flags)))
(send-event self 'reset-collide)
(stop! (-> self sound))
)
(when (and
(< 0.0 (-> self fact-info-target eco-level))
(zero? (logand (-> self state-flags) 512))
(zero? (logand (-> self draw status) 6))
(not (movie?))
(rand-vu-percent?
(lerp-scale
0.0
1.0
(the float
(- (-> self fact-info-target eco-timeout)
(the-as uint (- (-> *display* game-frame-counter) (the-as int (-> self fact-info-target eco-pickup-time))))
(when (and (< 0.0 (-> self fact-info-target eco-level))
(zero? (logand (-> self state-flags) 512))
(zero? (logand (-> self draw status) (draw-status drwf01 drwf02)))
(not (movie?))
(rand-vu-percent?
(lerp-scale
0.0
1.0
(the float
(- (-> self fact-info-target eco-timeout)
(the-as uint (- (-> *display* game-frame-counter) (the-as int (-> self fact-info-target eco-pickup-time))))
)
)
)
0.0
900.0
)
)
)
0.0
900.0
)
)
)
(case (-> self fact-info-target eco-type)
((1)
(change-sound! (-> self sound) (static-sound-name "yel-eco-jak"))
@@ -796,14 +790,14 @@
)
((2)
(target-danger-set! (-> self control unknown-symbol30) #t)
(dummy-47 (-> self control))
(update-transforms! (-> self control))
(let ((a1-23 (new 'stack-no-clear 'touching-shapes-entry)))
(set! (-> a1-23 cshape1) (the-as collide-shape 0))
(set! (-> a1-23 cshape2) (the-as collide-shape *touching-list*))
(dummy-40 (-> self control) a1-23)
(find-overlapping-shapes (-> self control) (the-as overlaps-others-params a1-23))
)
(target-danger-set! (-> self control unknown-symbol30) #f)
(dummy-47 (-> self control))
(update-transforms! (-> self control))
(change-sound! (-> self sound) (static-sound-name "red-eco-jak"))
(let ((s4-2 (rand-vu-int-range 3 (+ (-> self node-list length) -1))))
(sp-launch-particles-var
+9 -6
View File
@@ -111,7 +111,7 @@
(set! (-> sv-72 vector 0 quad) (-> arg3 quad))
(let ((a1-1 (new 'stack-no-clear 'vector)))
(vector-float*! a1-1 (-> arg1 move-vec) (-> arg1 best-u))
(TODO-RENAME-28 arg0 a1-1)
(move-by-vector! arg0 a1-1)
)
(set-and-handle-pat! arg0 (-> arg1 best-tri pat))
(case (-> arg1 best-tri pat material)
@@ -128,7 +128,7 @@
)
(when (= (-> arg1 best-u) 0.0)
(let ((a1-7 (vector-float*! (new 'stack-no-clear 'vector) sv-68 32.0)))
(TODO-RENAME-28 arg0 a1-7)
(move-by-vector! arg0 a1-7)
)
)
(set! (-> arg0 surface-normal quad) (-> sv-68 quad))
@@ -780,7 +780,7 @@
)
(let ((s3-0 (new 'stack-no-clear 'vector)))
(set! (-> s3-0 quad) (-> self root-override trans quad))
(dummy-33
(fill-cache-integrate-and-collide!
(-> self root-override)
(-> self root-override transv)
(-> self root-override root-prim collide-with)
@@ -832,7 +832,10 @@
)
(vector+! (-> arg0 root-override transv) (-> arg0 root-override transv) s5-1)
)
(vector-v++! (-> arg0 root-override transv) (dummy-62 (-> arg0 root-override) (new-stack-vector0) 0.0))
(vector-v++!
(-> arg0 root-override transv)
(compute-acc-due-to-gravity (-> arg0 root-override) (new-stack-vector0) 0.0)
)
(if (< (-> arg0 max-speed) (vector-length (-> arg0 root-override transv)))
(vector-normalize! (-> arg0 root-override transv) (-> arg0 max-speed))
)
@@ -1003,7 +1006,7 @@
(let ((a1-8 (new 'stack-no-clear 'collide-edge-hold-list)))
(set! (-> a1-8 num-allocs) (the-as uint 1))
(set! (-> a1-8 num-attempts) (the-as uint *touching-list*))
(dummy-40 (-> self root-override) a1-8)
(find-overlapping-shapes (-> self root-override) (the-as overlaps-others-params a1-8))
)
)
(set! (-> self event-hook) (-> (method-of-object self projectile-moving) event))
@@ -1108,7 +1111,7 @@
(if (< (-> obj root-override trans y) (-> obj root-override shadow-pos y))
(set! (-> obj root-override trans y) (+ 1228.8 (-> obj root-override shadow-pos y)))
)
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(set! (-> *part-id-table* 353 init-specs 16 initial-valuef) (the-as float 30))
(set! (-> *part-id-table* 353 init-specs 16 random-rangef) (the-as float 300))
(cond
+43 -40
View File
@@ -955,47 +955,50 @@
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as
object
(cond
((= v1-0 'attack)
(the-as symbol (when (-> self bounce-away)
(let ((a1-3 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-3 from) self)
(set! (-> a1-3 num-params) 2)
(set! (-> a1-3 message) 'shove)
(set! (-> a1-3 param 0) (the-as uint #f))
(let ((v1-4 (new 'static 'attack-info :mask #xc0)))
(set! (-> v1-4 shove-back) 12288.0)
(set! (-> v1-4 shove-up) 4096.0)
(set! (-> a1-3 param 1) (the-as uint v1-4))
(the-as object (cond
((= v1-0 'attack)
(the-as symbol (when (-> self bounce-away)
(let ((a1-3 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-3 from) self)
(set! (-> a1-3 num-params) 2)
(set! (-> a1-3 message) 'shove)
(set! (-> a1-3 param 0) (the-as uint #f))
(let ((v1-4 (new 'static 'attack-info :mask #xc0)))
(set! (-> v1-4 shove-back) 12288.0)
(set! (-> v1-4 shove-up) 4096.0)
(set! (-> a1-3 param 1) (the-as uint v1-4))
)
(the-as symbol (send-event-function arg0 a1-3))
)
)
)
(the-as symbol (send-event-function arg0 a1-3))
)
)
)
)
((= v1-0 'touch)
(the-as
symbol
(dummy-55 (-> self root-override) arg0 (the-as touching-shapes-entry (-> arg3 param 0)) 0.7 6144.0 16384.0)
)
)
((= v1-0 'clone)
(the-as symbol (go-virtual be-clone (the-as handle (-> arg3 param 0))))
)
((= v1-0 'play-anim)
(logclear! (-> self mask) (process-mask actor-pause))
(let ((v0-0 #t))
(set! (-> self been-kicked) v0-0)
v0-0
)
)
((= v1-0 'hidden-other)
(the-as symbol (go-virtual hidden-other))
)
)
)
)
((= v1-0 'touch)
(the-as symbol (send-shove-back
(-> self root-override)
arg0
(the-as touching-shapes-entry (-> arg3 param 0))
0.7
6144.0
16384.0
)
)
)
((= v1-0 'clone)
(the-as symbol (go-virtual be-clone (the-as handle (-> arg3 param 0))))
)
((= v1-0 'play-anim)
(logclear! (-> self mask) (process-mask actor-pause))
(let ((v0-0 #t))
(set! (-> self been-kicked) v0-0)
v0-0
)
)
((= v1-0 'hidden-other)
(the-as symbol (go-virtual hidden-other))
)
)
)
)
)
:enter
+94 -89
View File
@@ -819,10 +819,13 @@
(set! (-> obj flags) (logand -31745 (-> obj flags)))
(set! (-> obj bob-offset) (update! (-> obj bob)))
(cond
((and
(logtest? (-> obj flags) 256)
(zero? (logand (-> (the-as collide-shape-moving (-> obj process root)) root-prim prim-core action) 512))
)
((and (logtest? (-> obj flags) 256)
(zero?
(logand (-> (the-as collide-shape-moving (-> obj process root)) root-prim prim-core action)
(collide-action ca-9)
)
)
)
(set! (-> obj real-ocean-offset) (- (ocean-get-height (the-as vector (-> obj bottom))) (-> obj base-height)))
(if (zero? (logand (-> obj flags) 512))
(set! (-> obj ocean-offset) (-> obj real-ocean-offset))
@@ -849,7 +852,9 @@
(set! (-> obj ocean-offset) 0.0)
)
)
(if (logtest? (-> (the-as collide-shape-moving (-> obj process root)) root-prim prim-core action) 512)
(if (logtest? (-> (the-as collide-shape-moving (-> obj process root)) root-prim prim-core action)
(collide-action ca-9)
)
(set! (-> obj bob-offset) 0.0)
)
(set! (-> obj height)
@@ -874,12 +879,11 @@
(set! (-> s4-0 quad) (-> obj bottom 0 quad))
(vector-xz-length (-> obj process root transv))
(set! (-> s4-0 y) (-> obj surface-height))
(when (and
(logtest? (-> obj process draw status) (draw-status drwf03))
(zero? (-> obj process draw cur-lod))
(logtest? #x400000 (-> obj flags))
(logtest? #x800000 (-> obj flags))
)
(when (and (logtest? (-> obj process draw status) (draw-status drwf03))
(zero? (-> obj process draw cur-lod))
(logtest? #x400000 (-> obj flags))
(logtest? #x800000 (-> obj flags))
)
(let ((f30-1 (y-angle (-> obj process root)))
(f28-0 (vector-xz-length (-> obj process root transv)))
)
@@ -943,12 +947,12 @@
(set! (-> *part-id-table* 110 init-specs 16 initial-valuef) (-> obj surface-height))
(set! (-> *part-id-table* 110 init-specs 1 initial-valuef)
(+ (lerp-scale
12.0
0.4
(the float (- (-> *display* base-frame-counter) (the-as int (-> obj enter-water-time))))
0.0
600.0
)
12.0
0.4
(the float (- (-> *display* base-frame-counter) (the-as int (-> obj enter-water-time))))
0.0
600.0
)
(* 0.00012207031 (vector-xz-length (-> obj process root transv)))
)
)
@@ -985,34 +989,29 @@
(and v1-146 (< (- (-> *display* base-frame-counter) (-> (the-as control-info v1-146) unknown-dword11)) 150))
)
)
(if (and
(logtest? (-> obj flags) 16)
(and s4-3 (zero? (logand (-> (the-as collide-shape-moving (-> obj process root)) status) 1024)))
)
(if (and (logtest? (-> obj flags) 16)
(and s4-3 (zero? (logand (-> (the-as collide-shape-moving (-> obj process root)) status) 1024)))
)
(set! (-> obj bob amp) (* 0.8 (-> obj bob amp)))
)
(cond
((and
(logtest? (-> obj flags) 8)
(or
(logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) 1024)
(>= f30-3 (-> obj bottom 0 y))
(and
(logtest? s5-0 2048)
(logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) 4)
(zero? (logand (-> (the-as collide-shape-moving (-> obj process root)) status) 1))
(>= (+ 204.8 f30-3) (-> obj bottom 0 y))
)
)
(or
(logtest? s5-0 2048)
(< 12288.0 (vector-xz-length (-> obj process root transv)))
(< (+ (-> *display* base-frame-counter) -60) (the-as int (-> obj enter-water-time)))
(>= (+ (- 204.8 (fmin 6144.0 (+ (-> obj ocean-offset) (-> obj bob-offset) (-> obj align-offset)))) f30-3)
(-> obj bottom 0 y)
)
)
)
((and (logtest? (-> obj flags) 8)
(or (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) 1024)
(>= f30-3 (-> obj bottom 0 y))
(and (logtest? s5-0 2048)
(logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) 4)
(zero? (logand (-> (the-as collide-shape-moving (-> obj process root)) status) 1))
(>= (+ 204.8 f30-3) (-> obj bottom 0 y))
)
)
(or (logtest? s5-0 2048)
(< 12288.0 (vector-xz-length (-> obj process root transv)))
(< (+ (-> *display* base-frame-counter) -60) (the-as int (-> obj enter-water-time)))
(>= (+ (- 204.8 (fmin 6144.0 (+ (-> obj ocean-offset) (-> obj bob-offset) (-> obj align-offset)))) f30-3)
(-> obj bottom 0 y)
)
)
)
(set! (-> obj swim-time) (the-as uint (-> *display* base-frame-counter)))
(send-event (-> obj process) 'swim)
(logior! (-> obj flags) 2048)
@@ -1020,23 +1019,21 @@
(set! (-> obj enter-swim-time) (the-as uint (-> *display* base-frame-counter)))
)
(cond
((and
(logtest? (-> obj flags) 16)
(logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) 4)
(zero? (logand #x10000 (-> obj flags)))
)
((and (logtest? (-> obj flags) 16)
(logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) 4)
(zero? (logand #x10000 (-> obj flags)))
)
(let ((v1-200 (new 'stack-no-clear 'vector)))
(set! (-> v1-200 quad) (-> obj bottom 0 quad))
(set! (-> v1-200 y) (- (-> obj height) (-> obj swim-height)))
(let ((s4-4 (-> obj process root)))
(when (and
(zero? (logand (-> (the-as collide-shape-moving s4-4) status) 4096))
(logtest? (-> obj flags) 2048)
(zero? (logand (-> (the-as collide-shape-moving s4-4) root-prim prim-core action) 512))
)
(when (and (zero? (logand (-> (the-as collide-shape-moving s4-4) status) 4096))
(logtest? (-> obj flags) 2048)
(zero? (logand (-> (the-as collide-shape-moving s4-4) root-prim prim-core action) (collide-action ca-9)))
)
(let ((a1-27 (vector-! (new 'stack-no-clear 'vector) v1-200 (-> s4-4 trans))))
(vector-float*! a1-27 a1-27 (-> *display* frames-per-second))
(dummy-37 (the-as collide-shape-moving s4-4) a1-27)
(integrate-and-collide! (the-as collide-shape-moving s4-4) a1-27)
)
(logior! (-> (the-as collide-shape-moving s4-4) status) 1031)
)
@@ -1049,14 +1046,12 @@
)
)
((begin
(set! s4-3 (and
(logtest? (-> obj flags) 4)
(or
(not (!= (-> obj bob amp) 0.0))
(>= (- (-> *display* base-frame-counter) (the-as int (-> obj swim-time))) 15)
)
(and (>= (- (-> obj height) (-> obj wade-height)) (-> obj bottom 0 y)) s4-3)
)
(set! s4-3 (and (logtest? (-> obj flags) 4)
(or (not (!= (-> obj bob amp) 0.0))
(>= (- (-> *display* base-frame-counter) (the-as int (-> obj swim-time))) 15)
)
(and (>= (- (-> obj height) (-> obj wade-height)) (-> obj bottom 0 y)) s4-3)
)
)
s4-3
)
@@ -1066,19 +1061,18 @@
)
)
)
(when (and
(logtest? (-> obj flags) 8)
(< (-> obj bottom 1 y) f30-3)
(and (< f30-3 (-> obj bottom 0 y)) (logtest? s5-0 4096))
)
(when (and (logtest? (-> obj flags) 8)
(< (-> obj bottom 1 y) f30-3)
(and (< f30-3 (-> obj bottom 0 y)) (logtest? s5-0 4096))
)
(logior! (-> obj flags) 2048)
(let ((a1-30 (new 'stack-no-clear 'vector)))
(set! (-> a1-30 quad) (-> obj bottom 0 quad))
(let ((s5-1 (-> obj process root)))
(set! (-> a1-30 y) f30-3)
(when (zero? (logand (-> (the-as collide-shape-moving s5-1) root-prim prim-core action) 512))
(when (zero? (logand (-> (the-as collide-shape-moving s5-1) root-prim prim-core action) (collide-action ca-9)))
(let ((f30-4 (-> (the-as collide-shape-moving s5-1) ground-impact-vel)))
(TODO-RENAME-61 (the-as collide-shape-moving s5-1) a1-30 (-> s5-1 transv) *up-vector*)
(move-to-ground-point! (the-as collide-shape-moving s5-1) a1-30 (-> s5-1 transv) *up-vector*)
(logior! (-> (the-as collide-shape-moving s5-1) status) 1024)
(set! (-> (the-as collide-shape-moving s5-1) ground-impact-vel) f30-4)
)
@@ -1088,13 +1082,18 @@
)
)
(when (and (logtest? #x20000 (-> obj flags)) (= (-> obj process type) target))
(when (and
(logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) 1025)
(zero? (logand (-> (the-as collide-shape-moving (-> obj process root)) root-prim prim-core action) 512))
)
(when (and (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) 1025)
(zero? (logand (-> (the-as collide-shape-moving (-> obj process root)) root-prim prim-core action)
(collide-action ca-9)
)
)
)
(when (< (-> obj process root trans y) -409.6)
(send-event (-> obj process) 'no-look-around 450)
(when (zero? (logand (-> (the-as collide-shape-moving (-> obj process root)) root-prim prim-core action) #x4000))
(when (zero? (logand (-> (the-as collide-shape-moving (-> obj process root)) root-prim prim-core action)
(collide-action ca-14)
)
)
(cond
((= (-> obj process type) target)
(let ((a1-32 (new 'stack-no-clear 'event-message-block)))
@@ -1182,10 +1181,9 @@
(let* ((s5-2 (rand-vu-int-range 3 (+ (-> obj process node-list length) -1)))
(v1-328 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data s5-2)))
)
(when (and
(< (- (-> v1-328 y) (-> obj process root trans y)) (-> obj drip-height))
(< (-> obj height) (-> v1-328 y))
)
(when (and (< (- (-> v1-328 y) (-> obj process root trans y)) (-> obj drip-height))
(< (-> obj height) (-> v1-328 y))
)
(set! (-> obj drip-joint-index) s5-2)
(set! (-> obj drip-old-pos quad) (-> v1-328 quad))
(logior! (-> obj flags) #x8000)
@@ -1406,11 +1404,10 @@
)
(else
(let ((v1-15 (-> (the-as target (-> obj target process 0)) water)))
(when (and
(logtest? #x80000 (-> obj flags))
(logtest? (-> v1-15 flags) 512)
(>= (-> v1-15 surface-height) (-> v1-15 bottom 0 y))
)
(when (and (logtest? #x80000 (-> obj flags))
(logtest? (-> v1-15 flags) 512)
(>= (-> v1-15 surface-height) (-> v1-15 bottom 0 y))
)
(let ((v1-18 (-> obj attack-event)))
(case v1-18
((#f)
@@ -1455,10 +1452,9 @@
)
)
)
((and
*target*
(and (not (handle->process (-> *target* water volume))) (dummy-10 (-> obj vol) (-> *target* control trans)))
)
((and *target*
(and (not (handle->process (-> *target* water volume))) (dummy-10 (-> obj vol) (-> *target* control trans)))
)
(let ((s5-0 (-> *target* water)))
(process-entity-status! obj (entity-perm-status bit-3) #t)
(set! (-> s5-0 volume) (process->handle obj))
@@ -1488,7 +1484,10 @@
(defstate water-vol-startup (water-vol)
:virtual #t
:code
(behavior () (go-virtual water-vol-idle) (none))
(behavior ()
(go-virtual water-vol-idle)
(none)
)
)
(defstate water-vol-idle (water-vol)
@@ -1503,9 +1502,15 @@
)
)
:exit
(behavior () (dummy-27 self) (none))
(behavior ()
(dummy-27 self)
(none)
)
:trans
(behavior () (TODO-RENAME-26 self) (none))
(behavior ()
(TODO-RENAME-26 self)
(none)
)
:code
(the-as (function none :behavior water-vol) anim-loop)
)
+51 -33
View File
@@ -831,7 +831,7 @@
(let ((s5-0 (new-stack-vector0))
(gp-0 (new-stack-vector0))
)
(dummy-62 (-> self control) s5-0 (-> self control unknown-surface01 slip-factor))
(compute-acc-due-to-gravity (-> self control) s5-0 (-> self control unknown-surface01 slip-factor))
(vector-matrix*! gp-0 s5-0 (-> self control unknown-matrix00))
(vector-v++! (-> self control unknown-vector00) gp-0)
)
@@ -998,7 +998,7 @@
(zero? (logand (-> self control status) 1056))
(logtest? (-> self control status) 2)
)
(set! (-> self control unknown-vector54 quad) (-> self control trans quad))
(set! (-> self control last-known-safe-ground quad) (-> self control trans quad))
)
((-> self control unknown-surface01 touch-hook))
)
@@ -1084,7 +1084,7 @@
)
)
)
(TODO-RENAME-30 (-> self control) gp-1)
(move-to-point! (-> self control) gp-1)
)
(send-event *camera* 'reset-follow)
(set! (-> self control surf) *standard-ground-surface*)
@@ -1265,7 +1265,7 @@
(>= (- (-> *display* base-frame-counter) (-> self control unknown-dword40)) 60)
)
(vector-normalize! s4-1 1228.8)
(TODO-RENAME-28 (-> self control) s4-1)
(move-by-vector! (-> self control) s4-1)
(vector-float*! (-> self control rider-last-move) s4-1 (-> *display* frames-per-second))
(set! (-> self control rider-time) (the-as uint (-> *display* base-frame-counter)))
(if (and (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword41)) 150)
@@ -1279,7 +1279,7 @@
(vector-! a1-6 (-> s5-0 center-hold) (-> self control unknown-vector91))
(vector-float*! (-> self control rider-last-move) s4-1 (-> *display* frames-per-second))
(set! (-> self control rider-time) (the-as uint (-> *display* base-frame-counter)))
(TODO-RENAME-30 (-> self control) a1-6)
(move-to-point! (-> self control) a1-6)
)
(set! (-> self control unknown-float110) 0.0)
(set! (-> self control unknown-vector52 quad) (-> self control trans quad))
@@ -1315,7 +1315,7 @@
(let ((a1-7 (vector-! (new-stack-vector0) (-> gp-0 center-hold) (-> gp-0 center-hold-old))))
(vector-float*! (-> self control rider-last-move) a1-7 (-> *display* frames-per-second))
(set! (-> self control rider-time) (the-as uint (-> *display* base-frame-counter)))
(TODO-RENAME-28 (-> self control) a1-7)
(move-by-vector! (-> self control) a1-7)
)
)
(set! (-> self control unknown-float110) 0.0)
@@ -1382,11 +1382,11 @@
(let ((s4-2 (vector-! (new-stack-vector0) s5-0 (-> self control unknown-vector90))))
(cond
((and (< 2457.6 (vector-length s4-2)) (not (-> self control unknown-int21)))
(TODO-RENAME-28 (-> self control) (vector-normalize! s4-2 2457.6))
(move-by-vector! (-> self control) (vector-normalize! s4-2 2457.6))
)
(else
(set! (-> self control unknown-int21) (the-as int #t))
(TODO-RENAME-30
(move-to-point!
(-> self control)
(vector-! (new 'stack-no-clear 'vector) s5-0 (-> self control unknown-vector91))
)
@@ -1406,7 +1406,7 @@
)
(set-quaternion! (-> self control) (-> self control dir-targ))
(dummy-17 self)
(dummy-47 (-> self control))
(update-transforms! (-> self control))
(none)
)
@@ -1560,12 +1560,13 @@
f30-0
)
)
(a2-1 (vector-float*!
(new 'stack-no-clear 'vector)
(-> self control unknown-vector40)
(-> self control unknown-float50)
)
)
(a2-1
(vector-float*!
(new 'stack-no-clear 'vector)
(-> self control unknown-vector40)
(-> self control unknown-float50)
)
)
)
(vector-lerp! s4-0 a1-2 a2-1 f0-12)
)
@@ -1588,9 +1589,13 @@
)
)
(set! (-> self control reaction) target-collision-reaction)
(dummy-33 (-> self control) (-> self control transv) (-> self control root-prim collide-with))
(fill-cache-integrate-and-collide!
(-> self control)
(-> self control transv)
(-> self control root-prim collide-with)
)
(if (logtest? (-> self control root-prim prim-core action) (collide-action ca-6))
(dummy-20 *target* *collide-cache*)
(find-edge-grabs! *target* *collide-cache*)
)
(if *debug-segment*
(add-frame
@@ -1653,9 +1658,13 @@
(new 'static 'rgba :r #x40 :b #x40 :a #x80)
)
)
(dummy-33 (-> self control) (-> self control transv) (-> self control root-prim collide-with))
(fill-cache-integrate-and-collide!
(-> self control)
(-> self control transv)
(-> self control root-prim collide-with)
)
(if (logtest? (-> self control root-prim prim-core action) (collide-action ca-6))
(dummy-20 *target* *collide-cache*)
(find-edge-grabs! *target* *collide-cache*)
)
(if *debug-segment*
(add-frame
@@ -1712,9 +1721,13 @@
(new 'static 'rgba :r #x40 :b #x40 :a #x80)
)
)
(dummy-33 (-> self control) (-> self control transv) (-> self control root-prim collide-with))
(fill-cache-integrate-and-collide!
(-> self control)
(-> self control transv)
(-> self control root-prim collide-with)
)
(if (logtest? (-> self control root-prim prim-core action) (collide-action ca-6))
(dummy-20 *target* *collide-cache*)
(find-edge-grabs! *target* *collide-cache*)
)
(if *debug-segment*
(add-frame
@@ -1767,7 +1780,7 @@
(let ((a1-3 (new 'stack-no-clear 'overlaps-others-params)))
(set! (-> a1-3 options) (the-as uint 1))
(set! (-> a1-3 tlist) *touching-list*)
(dummy-40 (-> self control) a1-3)
(find-overlapping-shapes (-> self control) a1-3)
)
(post-flag-setup)
)
@@ -1802,12 +1815,13 @@
(flag-setup)
(build-conversions (-> self control transv))
(do-rotations1)
(let ((s4-1 (vector-flatten!
(new-stack-vector0)
(vector-negate! (new-stack-vector0) (-> self control dynam gravity-normal))
(-> self control local-normal)
)
)
(let ((s4-1
(vector-flatten!
(new-stack-vector0)
(vector-negate! (new-stack-vector0) (-> self control dynam gravity-normal))
(-> self control local-normal)
)
)
)
(let ((s3-1 (new-stack-vector0)))
(new-stack-matrix0)
@@ -1830,9 +1844,13 @@
(new 'static 'rgba :r #x40 :b #x40 :a #x80)
)
)
(dummy-33 (-> self control) (-> self control transv) (-> self control root-prim collide-with))
(fill-cache-integrate-and-collide!
(-> self control)
(-> self control transv)
(-> self control root-prim collide-with)
)
(if (logtest? (-> self control root-prim prim-core action) (collide-action ca-6))
(dummy-20 *target* *collide-cache*)
(find-edge-grabs! *target* *collide-cache*)
)
(if *debug-segment*
(add-frame
@@ -1876,7 +1894,7 @@
(let ((a1-2 (new 'stack-no-clear 'overlaps-others-params)))
(set! (-> a1-2 options) (the-as uint 1))
(set! (-> a1-2 tlist) *touching-list*)
(dummy-40 (-> self control) a1-2)
(find-overlapping-shapes (-> self control) a1-2)
)
(target-calc-camera-pos)
(do-target-shadow)
@@ -1985,7 +2003,7 @@
(target-collide-set! 'normal 0.0)
(backup-collide-with-as (-> self control))
(set! (-> self game) *game-info*)
(TODO-RENAME-30 (-> self control) (-> arg0 trans))
(move-to-point! (-> self control) (-> arg0 trans))
(set! (-> (&-> (-> self control) unknown-qword00) 0) (-> arg0 trans quad))
(set! (-> self control unknown-cpad-info00) (-> *cpad-list* cpads 0))
(set! (-> self control unknown-surface01) (new 'process 'surface))
@@ -2059,7 +2077,7 @@
0
)
;; HACK for not starting target
;; hack for not starting target.
(defun start ((arg0 symbol) (arg1 continue-point))
(set! *target* #f)
(return *target*)
+79 -96
View File
@@ -84,7 +84,7 @@
(target-exit)
(ja-channel-set! 0)
(quaternion-copy! (-> self control unknown-quaternion00) (-> arg0 quat))
(TODO-RENAME-30 (-> self control) (-> arg0 trans))
(move-to-point! (-> self control) (-> arg0 trans))
(rot->dir-targ! (-> self control))
(set! (-> (&-> (-> self control) unknown-qword00) 0) (-> self control trans quad))
(cond
@@ -112,17 +112,15 @@
(set! (-> *load-state* want 1 force-inside?) #f)
(when (not (string= (-> arg0 name) "default"))
(while (not
(and
(or (not (-> arg0 lev0)) (not (-> arg0 disp0)) (= (level-status *level* (-> arg0 lev0)) 'active))
(or (not (-> arg0 lev1)) (not (-> arg0 disp1)) (= (level-status *level* (-> arg0 lev1)) 'active))
)
(and (or (not (-> arg0 lev0)) (not (-> arg0 disp0)) (= (level-status *level* (-> arg0 lev0)) 'active))
(or (not (-> arg0 lev1)) (not (-> arg0 disp1)) (= (level-status *level* (-> arg0 lev1)) 'active))
)
)
(let ((v1-52 (lookup-level-info (-> arg0 level))))
(if (and
v1-52
(= (-> *setting-control* current music) (-> v1-52 music-bank))
(zero? (logand (-> arg0 flags) 160))
)
(if (and v1-52
(= (-> *setting-control* current music) (-> v1-52 music-bank))
(zero? (logand (-> arg0 flags) 160))
)
(clear-pending-settings-from-process *setting-control* self 'music-volume)
)
)
@@ -219,13 +217,11 @@
)
)
)
((and
(logtest? (-> arg0 flags) 2048)
(or
(= (get-task-status (game-task beach-ecorocks)) (task-status need-hint))
(= (get-task-status (game-task beach-ecorocks)) (task-status need-introduction))
)
)
((and (logtest? (-> arg0 flags) 2048)
(or (= (get-task-status (game-task beach-ecorocks)) (task-status need-hint))
(= (get-task-status (game-task beach-ecorocks)) (task-status need-introduction))
)
)
(let ((s5-4 (entity-by-name "sage-23")))
(when s5-4
(set-blackout-frames #x7530)
@@ -653,34 +649,28 @@
(defbehavior target-hit-push target ((arg0 vector) (arg1 matrix) (arg2 float) (arg3 float) (arg4 attack-info))
(case (-> arg4 angle)
(('jump 'up 'up-forward)
(when (and
(zero? (logand (-> self control root-prim prim-core action) #x4200))
(not (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact-info-target health))))
)
(if (and
(logtest?
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(pad-buttons circle)
)
(can-feet?)
)
(when (and (zero? (logand (-> self control root-prim prim-core action) (collide-action ca-9 ca-14)))
(not (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact-info-target health))))
)
(if (and (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(pad-buttons circle)
)
(can-feet?)
)
(go target-attack-air #f)
)
(if (and
(logtest?
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(pad-buttons square)
)
(< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 26624.0)
(and
(< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))
(>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36))
(the-as int (-> *TARGET-bank* stuck-timeout))
(if (and (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(pad-buttons square)
)
(< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 26624.0)
(and (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))
(>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36))
(the-as int (-> *TARGET-bank* stuck-timeout))
)
(zero? (logand (-> self state-flags) 4096))
(zero? (logand (-> self control unknown-surface01 flags) 384))
)
(zero? (logand (-> self state-flags) 4096))
(zero? (logand (-> self control unknown-surface01 flags) 384))
)
)
)
(go
target-flop
(the-as float 65502.96)
@@ -695,18 +685,15 @@
)
)
)
(when (if (and
(< (target-move-dist (the-as int (-> *TARGET-bank* stuck-time))) (-> *TARGET-bank* stuck-distance))
(and
(>= (- (-> *display* base-frame-counter) (-> self state-time)) (the-as int (-> *TARGET-bank* stuck-time)))
(not
(and
*cheat-mode*
(logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2))
(when (if (and (< (target-move-dist (the-as int (-> *TARGET-bank* stuck-time))) (-> *TARGET-bank* stuck-distance))
(and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (the-as int (-> *TARGET-bank* stuck-time)))
(not
(and *cheat-mode*
(logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2))
)
)
)
)
)
)
)
#t
)
(logior! (-> self control status) 1)
@@ -732,12 +719,11 @@
(defbehavior target-hit-orient target ((arg0 attack-info) (arg1 vector))
(let ((s5-0 #f))
(if (and
(!= (-> arg0 angle) 'front)
(!= (-> arg0 angle) 'shove)
(logtest? (-> arg0 mask) 2)
(!= (-> arg0 shove-back) 0.0)
)
(if (and (!= (-> arg0 angle) 'front)
(!= (-> arg0 angle) 'shove)
(logtest? (-> arg0 mask) 2)
(!= (-> arg0 shove-back) 0.0)
)
(forward-up-nopitch->quaternion (-> self control dir-targ) arg1 (-> self control dynam gravity-normal))
)
(case (-> arg0 angle)
@@ -770,8 +756,8 @@
(case (-> arg0 angle)
(('back)
(when (not (= (if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
(-> self skel root-channel 0 frame-group)
)
(-> self draw art-group data 74)
)
)
@@ -791,8 +777,8 @@
)
(('up 'up-forward)
(when (not (= (if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
(-> self skel root-channel 0 frame-group)
)
(-> self draw art-group data 75)
)
)
@@ -842,8 +828,8 @@
)
(else
(when (not (= (if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
(-> self skel root-channel 0 frame-group)
)
(-> self draw art-group data 73)
)
)
@@ -891,15 +877,15 @@
(set-quaternion! (-> self control) (-> self control dir-targ))
#t
(let ((f28-1 (* 1.05 (/ (* -60.0 arg3) (* (the float (+ (-> (if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
data
0
length
)
-1
)
)
(-> self skel root-channel 0 frame-group)
)
data
0
length
)
-1
)
)
(ja-step 0)
)
)
@@ -965,10 +951,9 @@
:trans
(behavior ()
(when (= *cheat-mode* 'debug)
(when (and
(not *pause-lock*)
(logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2))
)
(when (and (not *pause-lock*)
(logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2))
)
(pickup-collectable! (-> self fact-info-target) (pickup-type eco-green) (the-as float 1.0) (the-as handle #f))
(go target-stance)
)
@@ -1029,14 +1014,14 @@
(cond
((= (-> self game mode) 'debug)
(let ((s4-1 (new-stack-vector0)))
(set! (-> s4-1 quad) (-> self control unknown-vector54 quad))
(set! (-> s4-1 quad) (-> self control last-known-safe-ground quad))
(ja-channel-set! 0)
(let ((s3-1 (-> *display* base-frame-counter)))
(until (>= (- (-> *display* base-frame-counter) s3-1) 300)
(suspend)
)
)
(TODO-RENAME-30 (-> self control) s4-1)
(move-to-point! (-> self control) s4-1)
)
(set! (-> (&-> (-> self control) unknown-qword00) 0) (-> self control trans quad))
(send-event *camera* 'teleport)
@@ -1516,8 +1501,8 @@
)
(+! (-> *game-info* death-movie-tick) 1)
(if (= (death-movie-remap (+ (-> *game-info* death-movie-tick) -1) (-> *death-spool-array* length))
(death-movie-remap (-> *game-info* death-movie-tick) (-> *death-spool-array* length))
)
(death-movie-remap (-> *game-info* death-movie-tick) (-> *death-spool-array* length))
)
(+! (-> *game-info* death-movie-tick) 1)
)
(let ((gp-18
@@ -1526,24 +1511,22 @@
)
(set-setting! *setting-control* self 'allow-progress #f (the-as float 0.0) 0)
(target-death-anim gp-18)
(when (and
(< (rand-vu-int-count (-> *game-info* death-movie-tick)) (* (-> *death-spool-array* length) 2))
(zero? (logand (-> self water flags) 512))
(!= (-> self control ground-pat material) 9)
(!= (-> self control ground-pat material) 10)
)
(when (and (< (rand-vu-int-count (-> *game-info* death-movie-tick)) (* (-> *death-spool-array* length) 2))
(zero? (logand (-> self water flags) 512))
(!= (-> self control ground-pat material) 9)
(!= (-> self control ground-pat material) 10)
)
(iterate-process-tree
*entity-pool*
(lambda :behavior target
((arg0 process))
(if (and
(logtest? (process-mask enemy) (-> arg0 mask))
(type-type? (-> arg0 type) process-drawable)
(nonzero? (-> (the-as process-drawable arg0) root))
(< (vector-vector-distance (-> (the-as process-drawable arg0) root trans) (-> *target* control trans))
61440.0
)
)
(if (and (logtest? (process-mask enemy) (-> arg0 mask))
(type-type? (-> arg0 type) process-drawable)
(nonzero? (-> (the-as process-drawable arg0) root))
(< (vector-vector-distance (-> (the-as process-drawable arg0) root trans) (-> *target* control trans))
61440.0
)
)
(process-entity-status! arg0 (entity-perm-status bit-9) #t)
)
)
+1 -1
View File
@@ -81,7 +81,7 @@
:size-assert #x248
:flag-assert #x1501e00248
(:methods
(dummy-20 (_type_ collide-cache) object 20)
(find-edge-grabs! (_type_ collide-cache) object 20)
)
(:states
target-attack
+2 -2
View File
@@ -992,7 +992,7 @@
(logior! (-> arg1 state-flags) 32)
(set! (-> arg1 control unknown-dword80) (-> *display* base-frame-counter))
(set! (-> arg1 control unknown-dword81) (the-as int arg0))
(dummy-53 (-> arg1 control) 2 (collide-kind target-attack) (collide-kind))
(set-collide-kinds (-> arg1 control) 2 (collide-kind target-attack) (collide-kind))
0
(none)
)
@@ -1000,7 +1000,7 @@
(defun target-timed-invulnerable-off ((arg0 target))
(logclear! (-> arg0 draw status) (draw-status drwf01))
(set! (-> arg0 state-flags) (logand -33 (-> arg0 state-flags)))
(dummy-53 (-> arg0 control) 2 (collide-kind) (collide-kind target-attack))
(set-collide-kinds (-> arg0 control) 2 (collide-kind) (collide-kind target-attack))
0
(none)
)
+7 -7
View File
@@ -1690,7 +1690,7 @@
(TODO-RENAME-9 (-> self align))
(when (zero? (logand (-> self align flags) 1))
(vector-matrix*! s4-0 (the-as vector (-> self align delta)) (-> self control unknown-matrix01))
(TODO-RENAME-28 (-> self control) s4-0)
(move-by-vector! (-> self control) s4-0)
)
(suspend)
(let ((a0-12 (-> self skel root-channel 0)))
@@ -1733,7 +1733,7 @@
(TODO-RENAME-9 (-> self align))
(when (zero? (logand (-> self align flags) 1))
(vector-matrix*! gp-0 (the-as vector (-> self align delta)) (-> self control unknown-matrix01))
(TODO-RENAME-28 (-> self control) gp-0)
(move-by-vector! (-> self control) gp-0)
)
(suspend)
(let ((s5-1 (-> self skel root-channel 0)))
@@ -3642,7 +3642,7 @@
:enter
(behavior ((arg0 string) (arg1 handle))
(set! (-> self control unknown-handle10) arg1)
(dummy-60
(move-to-ground
(-> self control)
(the-as float 40960.0)
(the-as float 40960.0)
@@ -3721,10 +3721,10 @@
((not (-> self control unknown-spoolanim00))
)
((zero? (logand (-> self draw status) (draw-status drwf01)))
(TODO-RENAME-30 (-> self control) (the-as vector a1-2))
(move-to-point! (-> self control) (the-as vector a1-2))
(matrix->quaternion (-> self control unknown-quaternion00) (-> gp-0 bone transform))
(quaternion-copy! (-> self control quat) (-> self control unknown-quaternion00))
(dummy-60
(move-to-ground
(-> self control)
(the-as float 4096.0)
(the-as float 40960.0)
@@ -3737,13 +3737,13 @@
(set! (-> a1-6 y) (-> self water height))
(set! (-> a1-6 z) (-> self control trans z))
(set! (-> a1-6 w) 1.0)
(TODO-RENAME-30 (-> self control) a1-6)
(move-to-point! (-> self control) a1-6)
)
)
)
(else
(format 0 "ERROR: <ASG>: camera used backup position~%")
(TODO-RENAME-30 (-> self control) (-> self control unknown-vector102))
(move-to-point! (-> self control) (-> self control unknown-vector102))
(quaternion-copy! (-> self control quat) (the-as quaternion (-> self control unknown-vector103)))
)
)
+39 -14
View File
@@ -90,7 +90,7 @@
(set! (-> s4-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s4-0 1)
(alloc-riders s4-0 1)
(let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0)))
(set! (-> s3-0 prim-core collide-as) (collide-kind ground-object))
(set! (-> s3-0 collide-with) (collide-kind target))
@@ -125,7 +125,7 @@
(process-drawable-from-entity! obj arg0)
(initialize-skeleton obj *windmill-one-sg* '())
(logior! (-> obj skel status) 1)
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(set! (-> obj sound-id) (new-sound-id))
(go windmill-one-idle)
(none)
@@ -334,7 +334,7 @@
(set! s2-0 #t)
)
(set! (-> s4-0 y) (* f28-0 arg1))
(TODO-RENAME-28 (-> arg0 root-override) s4-0)
(move-by-vector! (-> arg0 root-override) s4-0)
(+! f30-0 f28-0)
)
(set! (-> s3-0 quad) (-> arg0 entity extra trans quad))
@@ -351,7 +351,7 @@
(defun move-grottopole-to-position ((arg0 grottopole))
(let ((a1-0 (new 'stack-no-clear 'vector)))
(set-vector! a1-0 0.0 (* (-> arg0 distance) (the float (-> arg0 position))) 0.0 1.0)
(TODO-RENAME-28 (-> arg0 root-override) a1-0)
(move-by-vector! (-> arg0 root-override) a1-0)
)
0
(none)
@@ -874,10 +874,17 @@
(vector-float*! (-> self root-override transv) (-> self root-override transv) f30-0)
(set! (-> self root-override transv w) 1.0)
(if (not gp-0)
(vector-v++! (-> self root-override transv) (dummy-62 (-> self root-override) (new-stack-vector0) 1.0))
(vector-v++!
(-> self root-override transv)
(compute-acc-due-to-gravity (-> self root-override) (new-stack-vector0) 1.0)
)
)
(dummy-47 (-> self root-override))
(dummy-33 (-> self root-override) (-> self root-override transv) (collide-kind background))
(update-transforms! (-> self root-override))
(fill-cache-integrate-and-collide!
(-> self root-override)
(-> self root-override transv)
(collide-kind background)
)
(quaternion*! (-> self root-override quat) (-> self root-override quat) (-> self tumble))
(suspend)
)
@@ -889,12 +896,19 @@
)
(else
(vector-float*! (-> self root-override transv) (-> self root-override transv) 0.99)
(vector-v++! (-> self root-override transv) (dummy-62 (-> self root-override) (new-stack-vector0) 1.0))
(vector-v++!
(-> self root-override transv)
(compute-acc-due-to-gravity (-> self root-override) (new-stack-vector0) 1.0)
)
)
)
(set! (-> self root-override transv w) 1.0)
(dummy-47 (-> self root-override))
(dummy-33 (-> self root-override) (-> self root-override transv) (collide-kind background))
(update-transforms! (-> self root-override))
(fill-cache-integrate-and-collide!
(-> self root-override)
(-> self root-override transv)
(collide-kind background)
)
(let ((gp-2 (new 'stack-no-clear 'vector))
(f30-1 (vector-length (-> self root-override transv)))
)
@@ -1290,7 +1304,7 @@
(let ((a1-0 (new 'stack-no-clear 'vector)))
(vector-float*! a1-0 (-> self dir) (-> self pos))
(vector+! a1-0 a1-0 (-> self start))
(TODO-RENAME-30 (-> self root-override) a1-0)
(move-to-point! (-> self root-override) a1-0)
)
(TODO-RENAME-12 (-> self wobbler) (-> self root-override quat))
(let ((a2-3 (quaternion-axis-angle! (new 'stack-no-clear 'quaternion) 0.0 1.0 0.0 -18204.445)))
@@ -1353,8 +1367,19 @@
(vector-float*! (-> self root-override transv) (-> self dir) (-> self vel))
(set! (-> self state-time) (-> *display* base-frame-counter))
(until v1-25
(vector-v++! (-> self root-override transv) (dummy-62 (-> self root-override) (new-stack-vector0) 0.0))
(dummy-59 (-> self root-override) (-> self root-override transv) (the-as uint 1) 8192.0 #f #f #f)
(vector-v++!
(-> self root-override transv)
(compute-acc-due-to-gravity (-> self root-override) (new-stack-vector0) 0.0)
)
(integrate-for-enemy-with-move-to-ground!
(-> self root-override)
(-> self root-override transv)
(collide-kind background)
8192.0
#f
#f
#f
)
(move! (-> self wobbler))
(TODO-RENAME-12 (-> self wobbler) (-> self root-override quat))
(let ((a2-6 (quaternion-axis-angle! (new 'stack-no-clear 'quaternion) 0.0 1.0 0.0 -18204.445)))
@@ -1383,7 +1408,7 @@
(quaternion-axis-angle! (-> self root-override quat) 0.0 1.0 0.0 -18204.445)
)
(suspend)
(dummy-47 (-> self root-override))
(update-transforms! (-> self root-override))
(when (not arg0)
(let ((a0-3 (-> self skel root-channel 0)))
(set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 5)))
+1 -1
View File
@@ -494,7 +494,7 @@
(+! (-> self root-override trans y) (-> v1-6 trans y))
)
(suspend)
(dummy-47 (-> self root-override))
(update-transforms! (-> self root-override))
(logior! (-> self mask) (process-mask sleep))
(suspend)
0
+26 -10
View File
@@ -91,17 +91,25 @@
)
(defmethod dummy-44 lurkercrab ((obj lurkercrab) (arg0 process) (arg1 event-message-block))
(if (and (logtest? (-> obj nav-enemy-flags) 64) ((method-of-type touching-shapes-entry prims-touching?)
(the-as touching-shapes-entry (-> arg1 param 0))
(-> obj collide-info)
(the-as uint 1)
)
(if (and (logtest? (-> obj nav-enemy-flags) 64)
((method-of-type touching-shapes-entry prims-touching?)
(the-as touching-shapes-entry (-> arg1 param 0))
(-> obj collide-info)
(the-as uint 1)
)
)
(nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic)
)
(dummy-55 (-> obj collide-info) arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 0.7 6144.0 16384.0)
(send-shove-back
(-> obj collide-info)
arg0
(the-as touching-shapes-entry (-> arg1 param 0))
0.7
6144.0
16384.0
)
(the-as object (if (zero? (logand (-> obj nav-enemy-flags) 256))
(dummy-45 (-> obj collide-info))
(respond-to-collisions! (-> obj collide-info))
)
)
)
@@ -189,7 +197,15 @@ nav-enemy-default-event-handler
)
(defmethod TODO-RENAME-38 lurkercrab ((obj lurkercrab))
(dummy-59 (-> obj collide-info) (-> obj collide-info transv) (the-as uint 1) 8192.0 #f #f #f)
(integrate-for-enemy-with-move-to-ground!
(-> obj collide-info)
(-> obj collide-info transv)
(collide-kind background)
8192.0
#f
#f
#f
)
0
(none)
)
@@ -271,7 +287,7 @@ nav-enemy-default-event-handler
(defbehavior lurkercrab-invulnerable lurkercrab ()
(set! (-> self nav-enemy-flags) (logand -33 (-> self nav-enemy-flags)))
(let ((v1-3 (dummy-34 (-> self collide-info) (the-as uint 2))))
(let ((v1-3 (find-prim-by-id (-> self collide-info) (the-as uint 2))))
(when v1-3
(let ((v0-1 4))
(set! (-> v1-3 prim-core offense) (the-as collide-offense v0-1))
@@ -283,7 +299,7 @@ nav-enemy-default-event-handler
(defbehavior lurkercrab-vulnerable lurkercrab ()
(logior! (-> self nav-enemy-flags) 32)
(let ((v1-3 (dummy-34 (-> self collide-info) (the-as uint 2))))
(let ((v1-3 (find-prim-by-id (-> self collide-info) (the-as uint 2))))
(when v1-3
(let ((v0-1 1))
(set! (-> v1-3 prim-core offense) (the-as collide-offense v0-1))
File diff suppressed because it is too large Load Diff
+12 -5
View File
@@ -119,7 +119,7 @@
)
(eval-path-curve-div! (-> self path) s3-0 f30-0 'interp)
(+! (-> s3-0 y) (-> self align align trans y))
(TODO-RENAME-30 (-> self root-override) s3-0)
(move-to-point! (-> self root-override) s3-0)
(TODO-RENAME-12 (-> self path) s3-0 f30-0)
)
(if arg4
@@ -594,7 +594,14 @@
)
)
((= v1-0 'touch)
(dummy-55 (-> self root-override) arg0 (the-as touching-shapes-entry (-> arg3 param 0)) 0.7 6144.0 16384.0)
(send-shove-back
(-> self root-override)
arg0
(the-as touching-shapes-entry (-> arg3 param 0))
0.7
6144.0
16384.0
)
)
)
)
@@ -615,7 +622,7 @@
)
(TODO-RENAME-12 (-> self path) (-> self path-vector) (-> self path-pos))
(when arg0
(TODO-RENAME-30 (-> self root-override) (-> self state-vector))
(move-to-point! (-> self root-override) (-> self state-vector))
(set-heading-vec! (-> self root-override) (-> self path-vector))
(let ((a0-7 (handle->process (-> self fuel-cell))))
(if a0-7
@@ -647,9 +654,9 @@
)
(set! (-> gp-0 quad) (-> self root-override trans quad))
(vector-seek! gp-0 a1-0 (* (-> self state-float 0) (-> *display* seconds-per-frame)))
(TODO-RENAME-30 (-> self root-override) gp-0)
(move-to-point! (-> self root-override) gp-0)
)
(dummy-45 (-> self root-override))
(respond-to-collisions! (-> self root-override))
(seek-toward-heading-vec! (-> self root-override) (-> self path-vector) 131072.0 300)
(spool-push *art-control* "pelican-spit-ext" 0 self -99.0)
(none)
+16 -8
View File
@@ -394,8 +394,8 @@
:code
(behavior ()
(set! (-> self root-override trans y) (+ 20480.0 (-> self root-override trans y)))
(dummy-60 (-> self root-override) 40960.0 40960.0 #t (collide-kind background))
(dummy-47 (-> self root-override))
(move-to-ground (-> self root-override) 40960.0 40960.0 #t (collide-kind background))
(update-transforms! (-> self root-override))
(clear-collide-with-as (-> self root-override))
(let ((gp-0 (-> self skel root-channel 0)))
(joint-control-channel-group-eval!
@@ -591,7 +591,7 @@
)
(vector-! s5-0 s5-0 (-> obj root-override trans))
(vector-float*! s5-0 s5-0 0.9)
(TODO-RENAME-28 (-> obj root-override) s5-0)
(move-by-vector! (-> obj root-override) s5-0)
)
(set! (-> obj teleport) #f)
#f
@@ -649,8 +649,8 @@
)
(vector+! a1-1 a0-2 v1-0)
(if (points-in-air? a0-2 a1-1 *seagull-boxes* 10)
(dummy-57 (-> obj root-override) (-> obj root-override transv))
(dummy-33 (-> obj root-override) s5-0 (collide-kind background))
(integrate-no-collide! (-> obj root-override) (-> obj root-override transv))
(fill-cache-integrate-and-collide! (-> obj root-override) s5-0 (collide-kind background))
)
)
(none)
@@ -1140,7 +1140,11 @@
(while (< 0.5 f30-0)
(suspend)
(set! f30-0 (- f30-0 (-> *display* seconds-per-frame)))
(dummy-33 (-> self root-override) (-> self root-override transv) (collide-kind background))
(fill-cache-integrate-and-collide!
(-> self root-override)
(-> self root-override transv)
(collide-kind background)
)
(let* ((v1-21 self)
(f1-3 (the float (sar (shl (the int (- (-> self heading) (-> v1-21 heading))) 48) 48)))
(f0-12 (- (-> v1-21 tilt)))
@@ -1195,7 +1199,11 @@
(joint-control-channel-group-eval! a0-29 (the-as art-joint-anim #f) num-func-seek!)
)
(set! f30-0 (- f30-0 (-> *display* seconds-per-frame)))
(dummy-33 (-> self root-override) (-> self root-override transv) (collide-kind background))
(fill-cache-integrate-and-collide!
(-> self root-override)
(-> self root-override transv)
(collide-kind background)
)
(let* ((v1-48 self)
(f1-13 (the float (sar (shl (the int (- (-> self heading) (-> v1-48 heading))) 48) 48)))
(f0-32 (- (-> v1-48 tilt)))
@@ -1282,7 +1290,7 @@
(let ((a1-1 (new 'stack-no-clear 'vector)))
(vector-float*! a1-1 (-> arg1 move-vec) (-> arg1 best-u))
(set! (-> a1-1 y) (-> arg1 move-vec y))
(TODO-RENAME-28 arg0 a1-1)
(move-by-vector! arg0 a1-1)
)
(let ((f0-3 (vector-dot (-> arg0 transv) (-> arg1 best-tri normal)))
(v1-6 (new 'stack-no-clear 'vector))
+7 -7
View File
@@ -216,7 +216,7 @@
(set! (-> s5-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s5-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s4-0 collide-with) (collide-kind target))
@@ -451,7 +451,7 @@
(set! (-> s5-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s5-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s4-0 collide-with) (collide-kind target))
@@ -612,7 +612,7 @@
(set! (-> obj close-distance) 49152.0)
(set! (-> obj auto-close) #t)
(process-entity-status! obj (entity-perm-status complete) #t)
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
0
(none)
)
@@ -687,7 +687,7 @@
)
(set! (-> obj anim-speed) 2.0)
(set! (-> obj timeout) 1.0)
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(ja-post)
(none)
)
@@ -1061,7 +1061,7 @@
(send-event (ppointer->process gp-7) 'art-joint-anim "citb-robotboss-belly-idle" 0)
(send-event (ppointer->process gp-7) 'draw #t)
)
(dummy-47 (-> self root-override))
(update-transforms! (-> self root-override))
(while #t
(when (-> self shield-on)
(update! (-> self sound))
@@ -1609,7 +1609,7 @@
:code
(behavior ()
(lods-assign! (-> self draw) (-> self normal-look))
(dummy-47 (-> self root-override))
(update-transforms! (-> self root-override))
(while #t
(spawn (-> self part) (-> self root-override trans))
(update! (-> self sound))
@@ -1710,7 +1710,7 @@
:code
(behavior ()
(lods-assign! (-> self draw) (-> self broken-look))
(dummy-47 (-> self root-override))
(update-transforms! (-> self root-override))
(cond
((-> self birth-fuel-cell)
(process-drawable-birth-fuel-cell (the-as entity #f) (the-as vector #f) #t)
+1 -1
View File
@@ -183,7 +183,7 @@
(set! (-> s5-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s5-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s4-0 collide-with) (collide-kind target))
@@ -96,7 +96,7 @@
:code
(behavior ()
(suspend)
(dummy-47 (-> self root-override))
(update-transforms! (-> self root-override))
(set! (-> self state-time) (-> *display* base-frame-counter))
(logior! (-> self mask) (process-mask actor-pause))
(while #t
@@ -232,7 +232,10 @@
)
)
(while #t
(vector-v++! (-> self root-override transv) (dummy-62 (-> self root-override) (new-stack-vector0) 0.0))
(vector-v++!
(-> self root-override transv)
(compute-acc-due-to-gravity (-> 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))
@@ -271,7 +274,7 @@
(set! (-> s5-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s5-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s4-0 collide-with) (collide-kind target))
+10 -10
View File
@@ -117,7 +117,7 @@
(set! (-> s5-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s5-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s4-0 collide-with) (collide-kind target))
@@ -173,7 +173,7 @@
(set! (-> s5-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s5-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s4-0 collide-with) (collide-kind target))
@@ -253,7 +253,7 @@
(set! (-> s5-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s5-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s4-0 collide-with) (collide-kind target))
@@ -371,7 +371,7 @@
(behavior ()
(set! (-> self root-override trans y) (-> self rise-height))
(suspend)
(dummy-47 (-> self root-override))
(update-transforms! (-> self root-override))
(logior! (-> self mask) (process-mask actor-pause))
(anim-loop)
(none)
@@ -617,7 +617,7 @@
(set! (-> s5-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s5-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s4-0 collide-with) (collide-kind target))
@@ -751,7 +751,7 @@
(set! (-> s5-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s5-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s4-0 collide-with) (collide-kind target))
@@ -817,7 +817,7 @@
(set! (-> s5-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s5-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s4-0 collide-with) (collide-kind target))
@@ -907,7 +907,7 @@
(set! (-> s5-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s5-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s4-0 collide-with) (collide-kind target))
@@ -1258,7 +1258,7 @@
)
)
)
(TODO-RENAME-28 (-> *target* control) gp-0)
(move-by-vector! (-> *target* control) gp-0)
)
(send-event *target* 'reset-height)
0
@@ -1328,7 +1328,7 @@
(set! (-> s5-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s5-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s4-0 collide-with) (collide-kind target))
+2 -2
View File
@@ -384,7 +384,7 @@
)
)
(set! (-> obj anim-speed) 2.0)
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(ja-post)
(none)
)
@@ -396,7 +396,7 @@
(set! (-> s5-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s5-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s4-0 collide-with) (collide-kind target))
+6 -6
View File
@@ -71,14 +71,14 @@
(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)
(move-to-point! (-> 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))
(move-to-point! (-> self root-override) (-> self basetrans))
)
)
(none)
@@ -173,7 +173,7 @@ eco-door-event-handler
(set! (-> v1-2 frame-num) 0.0)
)
(suspend)
(dummy-47 (-> self root-override))
(update-transforms! (-> self root-override))
(ja-post)
(while #t
(when (and *target* (>= (-> self open-distance)
@@ -263,7 +263,7 @@ eco-door-event-handler
)
(logior! (-> self draw status) (draw-status drwf01))
(suspend)
(dummy-47 (-> self root-override))
(update-transforms! (-> self root-override))
(ja-post)
(while #t
(let ((f30-0 (vector4-dot (-> self out-dir) (target-pos 0)))
@@ -297,7 +297,7 @@ eco-door-event-handler
(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)
(while (find-overlapping-shapes (-> self root-override) gp-0)
(suspend)
)
)
@@ -377,7 +377,7 @@ eco-door-event-handler
(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))
(update-transforms! (-> obj root-override))
(TODO-RENAME-25 obj)
(if (and (not (-> obj auto-close))
(-> obj entity)
+36 -14
View File
@@ -80,7 +80,7 @@
)
)
)
(dummy-54 (-> obj collide-info) 2 (collide-offense touch))
(set-collide-offense (-> obj collide-info) 2 (collide-offense touch))
(set! (-> obj nav-enemy-flags) (logand -257 (-> obj nav-enemy-flags)))
)
(dummy-14 (-> obj draw shadow-ctrl))
@@ -164,7 +164,7 @@
(set! (-> v1-0 param 1) (the-as uint a1-1))
)
(the-as object (when (send-event-function arg0 v1-0)
(dummy-54 (-> self collide-info) 2 (collide-offense no-offense))
(set-collide-offense (-> self collide-info) 2 (collide-offense no-offense))
(logior! (-> self nav-enemy-flags) 256)
#t
)
@@ -253,7 +253,7 @@ nav-enemy-default-event-handler
(defbehavior nav-enemy-simple-post nav-enemy ()
(TODO-RENAME-9 (-> self align))
(nav-enemy-common-post)
(dummy-47 (-> self collide-info))
(update-transforms! (-> self collide-info))
0
(none)
)
@@ -305,7 +305,10 @@ nav-enemy-default-event-handler
)
)
(if (-> obj nav-info move-to-ground)
(vector-v++! (-> obj collide-info transv) (dummy-62 (-> obj collide-info) (new-stack-vector0) 0.0))
(vector-v++!
(-> obj collide-info transv)
(compute-acc-due-to-gravity (-> obj collide-info) (new-stack-vector0) 0.0)
)
)
0
(none)
@@ -329,10 +332,10 @@ nav-enemy-default-event-handler
(defmethod TODO-RENAME-38 nav-enemy ((obj nav-enemy))
(if (-> obj nav-info move-to-ground)
(dummy-59
(integrate-for-enemy-with-move-to-ground!
(-> obj collide-info)
(-> obj collide-info transv)
(-> obj nav-info gnd-collide-with)
(the-as collide-kind (-> obj nav-info gnd-collide-with))
8192.0
#f
(-> obj nav-info hover-if-no-ground)
@@ -430,16 +433,26 @@ nav-enemy-default-event-handler
)
(defbehavior nav-enemy-falling-post nav-enemy ()
(vector-v++! (-> self collide-info transv) (dummy-62 (-> self collide-info) (new-stack-vector0) 0.0))
(dummy-33 (-> self collide-info) (-> self collide-info transv) (-> self collide-info root-prim collide-with))
(vector-v++!
(-> self collide-info transv)
(compute-acc-due-to-gravity (-> self collide-info) (new-stack-vector0) 0.0)
)
(fill-cache-integrate-and-collide!
(-> self collide-info)
(-> self collide-info transv)
(-> self collide-info root-prim collide-with)
)
(nav-enemy-common-post)
0
(none)
)
(defbehavior nav-enemy-death-post nav-enemy ()
(vector-v++! (-> self collide-info transv) (dummy-62 (-> self collide-info) (new-stack-vector0) 0.0))
(dummy-57 (-> self collide-info) (-> self collide-info transv))
(vector-v++!
(-> self collide-info transv)
(compute-acc-due-to-gravity (-> self collide-info) (new-stack-vector0) 0.0)
)
(integrate-no-collide! (-> self collide-info) (-> self collide-info transv))
(nav-enemy-common-post)
0
(none)
@@ -735,7 +748,13 @@ nav-enemy-default-event-handler
(nav-enemy-neck-control-inactive)
(set! (-> self state-time) (-> *display* base-frame-counter))
(if (-> self nav-info move-to-ground)
(dummy-60 (-> self collide-info) 40960.0 40960.0 #t (the-as collide-kind (-> self nav-info gnd-collide-with)))
(move-to-ground
(-> self collide-info)
40960.0
40960.0
#t
(the-as collide-kind (-> self nav-info gnd-collide-with))
)
)
(set! (-> self nav-enemy-flags) (logand -7 (-> self nav-enemy-flags)))
(set! (-> self state-timeout) 300)
@@ -1854,11 +1873,14 @@ nav-enemy-default-event-handler
(-> self turn-time)
)
)
(vector-v++! (-> self collide-info transv) (dummy-62 (-> self collide-info) (new-stack-vector0) 0.0))
(dummy-59
(vector-v++!
(-> self collide-info transv)
(compute-acc-due-to-gravity (-> self collide-info) (new-stack-vector0) 0.0)
)
(integrate-for-enemy-with-move-to-ground!
(-> self collide-info)
(-> self collide-info transv)
(-> self nav-info gnd-collide-with)
(the-as collide-kind (-> self nav-info gnd-collide-with))
8192.0
#f
(-> self nav-info hover-if-no-ground)
+2 -2
View File
@@ -352,7 +352,7 @@
(set! (-> s4-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s4-0 1)
(alloc-riders 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) (collide-kind ground-object blue-eco-suck))
(set! (-> s3-0 collide-with) (collide-kind target))
@@ -370,7 +370,7 @@
(logclear! (-> obj mask) (process-mask actor-pause))
(initialize-skeleton obj *orb-cache-top-sg* '())
(logior! (-> obj skel status) 1)
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(dummy-21 obj)
(set! (-> obj money) (res-lump-value (-> obj entity) 'orb-cache-count int :default (the-as uint128 20)))
(set! (-> obj active-distance) 61440.0)
+5 -5
View File
@@ -164,7 +164,7 @@
(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)
(move-to-point! (-> self root-override) gp-0)
)
)
(ja-post)
@@ -267,7 +267,7 @@
(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)
(move-to-point! (-> self root-override) gp-0)
)
)
(sound-play-by-name (static-sound-name "elev-loop") (-> self sound-id) 1024 0 0 1 #t)
@@ -346,7 +346,7 @@
(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)
(move-to-point! (-> self root-override) gp-0)
)
)
(sound-play-by-name (static-sound-name "elev-loop") (-> self sound-id) 1024 0 0 1 #t)
@@ -406,7 +406,7 @@
(set! (-> s5-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s5-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s4-0 collide-with) (collide-kind target))
@@ -471,7 +471,7 @@
)
)
(ja-post)
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(none)
)
+2 -2
View File
@@ -156,7 +156,7 @@
(set! (-> s5-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s5-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s4-0 collide-with) (collide-kind target))
@@ -290,7 +290,7 @@
(process-drawable-from-entity! obj arg0)
(initialize-skeleton obj (get-unlit-skel obj) '())
(logior! (-> obj skel status) 1)
(dummy-47 (-> obj root-override))
(update-transforms! (-> 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)
+3 -3
View File
@@ -440,7 +440,7 @@
(defmethod TODO-RENAME-28 rigid-body-platform ((obj rigid-body-platform))
(if (-> obj info platform)
(dummy-35 (-> obj root-overlay))
(detect-riders! (-> obj root-overlay))
)
(set! (-> obj player-velocity-prev quad) (-> obj player-velocity quad))
(if *target*
@@ -661,7 +661,7 @@
(new 'process 'rigid-body-control-point-inline-array (-> obj info control-point-count))
)
(logior! (-> obj skel status) 1)
(dummy-47 (-> obj root-overlay))
(update-transforms! (-> obj root-overlay))
(set-vector!
(-> obj rbody cm-offset-joint)
(-> obj info cm-joint-x)
@@ -701,7 +701,7 @@
(set! (-> s5-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s5-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s4-0 collide-with) (collide-kind target))
+9 -1
View File
@@ -481,7 +481,15 @@ nav-enemy-default-event-handler
)
(vector-normalize-copy! (-> self dir) (-> self collide-info transv) 1.0)
(forward-up->quaternion (-> self collide-info quat) (-> self dir) *up-vector*)
(dummy-59 (-> self collide-info) (-> self collide-info transv) (the-as uint 1) 8192.0 #t #f #f)
(integrate-for-enemy-with-move-to-ground!
(-> self collide-info)
(-> self collide-info transv)
(collide-kind background)
8192.0
#t
#f
#f
)
(set! (-> self collide-info trans y) f26-0)
(suspend)
(let ((a0-27 (-> self skel root-channel 0)))
+1 -1
View File
@@ -268,7 +268,7 @@
(set! (-> s5-1 frame-num) 0.0)
)
(ja-post)
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(TODO-RENAME-9 *cavecrystal-light-control* (-> obj crystal-id) 0.0 obj)
(set! (-> obj sound) (new
'process
+1 -1
View File
@@ -384,7 +384,7 @@
(let ((a0-2 (get-task-control (game-task finalboss-movies))))
(save-reminder a0-2 (logior (get-reminder a0-2 0) 2) 0)
)
(TODO-RENAME-30 (-> self control) (new 'static 'vector :x 11368946.0 :y 2215900.2 :z -19405602.0 :w 1.0))
(move-to-point! (-> self control) (new 'static 'vector :x 11368946.0 :y 2215900.2 :z -19405602.0 :w 1.0))
(set-quaternion! (-> self control) (the-as quaternion (new 'static 'vector :y -0.8472 :w 0.5312)))
(rot->dir-targ! (-> self control))
(transform-post)
+1 -1
View File
@@ -451,7 +451,7 @@
(set! (-> s4-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s4-0 1)
(alloc-riders s4-0 1)
(let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 4) 0)))
(set! (-> s3-0 prim-core collide-as) (collide-kind ground-object))
(set! (-> s3-0 collide-with) (collide-kind target))
+1 -1
View File
@@ -387,7 +387,7 @@
)
(set! (-> obj part) (create-launch-control (-> *part-group-id-table* 120) obj))
(set! (-> obj auto-get-off) #f)
(dummy-60 (-> obj root-override) 40960.0 40960.0 #t (collide-kind background))
(move-to-ground (-> obj root-override) 40960.0 40960.0 #t (collide-kind background))
(set! (-> obj cell) (the-as handle #f))
(blocking-plane-spawn
(the-as
+7 -7
View File
@@ -346,7 +346,7 @@
)
)
(('swim)
(let* ((gp-1 (-> self control unknown-vector54))
(let* ((gp-1 (-> self control last-known-safe-ground))
(s3-1 (vector-! (new 'stack-no-clear 'vector) gp-1 (-> self control trans)))
(f30-1 (fmax 8192.0 (fmin 40960.0 (vector-xz-length s3-1))))
)
@@ -2023,7 +2023,7 @@
(* 286720.0 (-> *display* seconds-per-frame))
)
)
(dummy-47 (-> arg0 collide-info))
(update-transforms! (-> arg0 collide-info))
(none)
)
)
@@ -2158,14 +2158,14 @@
(cond
((= (-> self game mode) 'debug)
(let ((s4-1 (new-stack-vector0)))
(set! (-> s4-1 quad) (-> self control unknown-vector54 quad))
(set! (-> s4-1 quad) (-> self control last-known-safe-ground quad))
(ja-channel-set! 0)
(let ((s3-1 (-> *display* base-frame-counter)))
(until (>= (- (-> *display* base-frame-counter) s3-1) 300)
(suspend)
)
)
(TODO-RENAME-30 (-> self control) s4-1)
(move-to-point! (-> self control) s4-1)
)
(set! (-> (&-> (-> self control) unknown-qword00) 0) (-> self control trans quad))
(send-event *camera* 'teleport)
@@ -2478,7 +2478,7 @@
)
)
)
(TODO-RENAME-30 (-> self control) gp-0)
(move-to-point! (-> self control) gp-0)
(quaternion-slerp!
(-> self control unknown-quaternion00)
(-> self control unknown-quaternion02)
@@ -2583,7 +2583,7 @@
(ja-post)
(vector<-cspace! gp-0 (-> self node-list data 3))
(set! (-> gp-0 y) (+ -5896.192 (-> gp-0 y)))
(TODO-RENAME-30 (-> self control) gp-0)
(move-to-point! (-> self control) gp-0)
)
(send-event *camera* 'ease-in)
(ja-channel-set! 0)
@@ -2609,7 +2609,7 @@
)
)
)
(TODO-RENAME-30 (-> self control) gp-0)
(move-to-point! (-> self control) gp-0)
(quaternion-slerp!
(-> self control unknown-quaternion00)
(-> self control unknown-quaternion02)
+4 -4
View File
@@ -152,7 +152,7 @@
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'touch)
(dummy-45 (-> self root-override))
(respond-to-collisions! (-> self root-override))
(when (-> self dangerous)
(let ((a1-1 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-1 from) self)
@@ -161,7 +161,7 @@
(set! (-> a1-1 param 0) (-> arg3 param 0))
(set! (-> a1-1 param 1) (the-as uint (new 'static 'attack-info)))
(if (send-event-function arg0 a1-1)
(dummy-54 (-> self root-override) 2 (collide-offense no-offense))
(set-collide-offense (-> self root-override) 2 (collide-offense no-offense))
)
)
)
@@ -172,7 +172,7 @@
((!= v1-10 (-> self player-attack-id))
(set! (-> self player-attack-id) (the-as int v1-10))
(when (-> self vulnerable)
(dummy-45 (-> self root-override))
(respond-to-collisions! (-> self root-override))
(go darkvine-retreat)
)
)
@@ -233,7 +233,7 @@
(when (and (-> self hit-player)
(or (not *target*) (>= (- (-> *display* base-frame-counter) (the-as int (-> self touch-time))) 15))
)
(dummy-54 (-> self root-override) 2 (collide-offense indestructible))
(set-collide-offense (-> self root-override) 2 (collide-offense indestructible))
(set! (-> self hit-player) #f)
)
(transform-post)
+101 -121
View File
@@ -20,179 +20,159 @@
(defmethod can-activate? jungle-elevator ((obj jungle-elevator))
(and
((method-of-type plat-button can-activate?) obj)
(task-complete? *game-info* (game-task jungle-tower))
)
(and ((method-of-type plat-button can-activate?) obj) (task-complete? *game-info* (game-task jungle-tower)))
)
(defstate plat-button-move-downward (jungle-elevator)
:virtual #t
:enter
(behavior ()
(let
((t9-0 (-> (method-of-type plat-button plat-button-move-downward) enter)))
(if t9-0
(t9-0)
)
(let ((t9-0 (-> (method-of-type plat-button plat-button-move-downward) enter)))
(if t9-0
(t9-0)
)
)
(set! (-> self draw light-index) (the-as uint 255))
(set! (-> self bottom-height) (-> jungle bottom-height))
(set! (-> jungle bottom-height) (-> jungleb bottom-height))
(send-event *target* 'reset-pickup 'eco)
(none)
)
(set! (-> self draw light-index) (the-as uint 255))
(set! (-> self bottom-height) (-> jungle bottom-height))
(set! (-> jungle bottom-height) (-> jungleb bottom-height))
(send-event *target* 'reset-pickup 'eco)
(none)
)
:exit
(behavior ()
(set! (-> jungle bottom-height) (-> self bottom-height))
(let
((t9-0 (-> (method-of-type plat-button plat-button-move-downward) exit)))
(if t9-0
(t9-0)
)
(set! (-> jungle bottom-height) (-> self bottom-height))
(let ((t9-0 (-> (method-of-type plat-button plat-button-move-downward) exit)))
(if t9-0
(t9-0)
)
)
(none)
)
(none)
)
:trans
(behavior ()
(let ((s5-0 (new 'stack-no-clear 'vector))
(gp-0 (new 'stack-no-clear 'vector))
)
(set! (-> s5-0 quad) (-> self root-override trans quad))
(let
((t9-1
(->
(the-as (state plat-button) (find-parent-method jungle-elevator 23))
trans
(let ((s5-0 (new 'stack-no-clear 'vector))
(gp-0 (new 'stack-no-clear 'vector))
)
(set! (-> s5-0 quad) (-> self root-override trans quad))
(let ((t9-1 (-> (the-as (state plat-button) (find-parent-method jungle-elevator 23)) trans)))
(if t9-1
(t9-1)
)
)
(vector-! gp-0 (-> self root-override trans) s5-0)
(when (< (-> self path-pos) 0.9)
(move-by-vector! (-> *target* control) gp-0)
(send-event *target* 'reset-height)
)
)
)
(if t9-1
(t9-1)
)
)
(vector-! gp-0 (-> self root-override trans) s5-0)
(when (< (-> self path-pos) 0.9)
(TODO-RENAME-28 (-> *target* control) gp-0)
(send-event *target* 'reset-height)
)
(if (and (>= (-> self path-pos) 0.2) (< (- (-> *display* base-frame-counter) (-> self state-time)) 60))
(load-commands-set! *level* (load-command-get-index *level* 'jungle 0))
)
(none)
)
(if
(and
(>= (-> self path-pos) 0.2)
(< (- (-> *display* base-frame-counter) (-> self state-time)) 60)
)
(load-commands-set! *level* (load-command-get-index *level* 'jungle 0))
)
(none)
)
)
(defstate plat-button-move-upward (jungle-elevator)
:virtual #t
:enter
(behavior ()
(let ((t9-0 (-> (method-of-type plat-button plat-button-move-upward) enter)))
(if t9-0
(t9-0)
)
(let ((t9-0 (-> (method-of-type plat-button plat-button-move-upward) enter)))
(if t9-0
(t9-0)
)
)
(set! (-> self draw light-index) (the-as uint 255))
(set! (-> self bottom-height) (-> jungle bottom-height))
(set! (-> jungle bottom-height) (-> jungleb bottom-height))
(set! (-> self grab-player?) (process-grab? *target*))
(none)
)
(set! (-> self draw light-index) (the-as uint 255))
(set! (-> self bottom-height) (-> jungle bottom-height))
(set! (-> jungle bottom-height) (-> jungleb bottom-height))
(set! (-> self grab-player?) (process-grab? *target*))
(none)
)
:exit
(behavior ()
(set! (-> jungle bottom-height) (-> self bottom-height))
(let ((t9-0 (-> (method-of-type plat-button plat-button-move-upward) exit)))
(if t9-0
(t9-0)
)
(set! (-> jungle bottom-height) (-> self bottom-height))
(let ((t9-0 (-> (method-of-type plat-button plat-button-move-upward) exit)))
(if t9-0
(t9-0)
)
)
(none)
)
(none)
)
:trans
(behavior ()
(let ((t9-0 (-> (method-of-type plat-button plat-button-move-upward) trans)))
(if t9-0
(t9-0)
)
(let ((t9-0 (-> (method-of-type plat-button plat-button-move-upward) trans)))
(if t9-0
(t9-0)
)
)
(if (and (< (-> self path-pos) 0.8) (< (- (-> *display* base-frame-counter) (-> self state-time)) 60))
(load-commands-set! *level* (load-command-get-index *level* 'jungle 1))
)
(none)
)
(if
(and
(< (-> self path-pos) 0.8)
(< (- (-> *display* base-frame-counter) (-> self state-time)) 60)
)
(load-commands-set! *level* (load-command-get-index *level* 'jungle 1))
)
(none)
)
)
(defstate plat-button-at-end (jungle-elevator)
:virtual #t
:code
(behavior ()
(cond
((!= (-> self path-pos) 0.0)
(set! (-> self draw light-index) (the-as uint 1))
(let ((a1-1 (res-lump-struct (-> self entity) 'continue-name structure)))
(when a1-1
(let ((v1-4 (set-continue! *game-info* (the-as basic a1-1))))
(load-commands-set! *level* (-> v1-4 load-commands))
)
(cond
((!= (-> self path-pos) 0.0)
(set! (-> self draw light-index) (the-as uint 1))
(let ((a1-1 (res-lump-struct (-> self entity) 'continue-name structure)))
(when a1-1
(let ((v1-4 (set-continue! *game-info* (the-as basic a1-1))))
(load-commands-set! *level* (-> v1-4 load-commands))
)
)
)
)
(else
(set! (-> self draw light-index) (the-as uint 255))
(load-commands-set! *level* '())
)
)
)
(else
(set! (-> self draw light-index) (the-as uint 255))
(load-commands-set! *level* '())
)
(let ((t9-4 (-> (method-of-type plat-button plat-button-at-end) code)))
(if t9-4
((the-as (function none :behavior plat-button) t9-4))
)
)
(none)
)
(let ((t9-4 (-> (method-of-type plat-button plat-button-at-end) code)))
(if t9-4
((the-as (function none :behavior plat-button) t9-4))
)
)
(none)
)
)
(defmethod should-teleport? jungle-elevator ((obj jungle-elevator))
(let ((f0-0 (-> (camera-pos) y)))
(case (-> obj path-pos)
((0.0)
(when (< f0-0 (-> obj teleport-if-below-y))
(set! (-> obj draw light-index) (the-as uint 1))
(return #t)
(case (-> obj path-pos)
((0.0)
(when (< f0-0 (-> obj teleport-if-below-y))
(set! (-> obj draw light-index) (the-as uint 1))
(return #t)
)
)
((1.0)
(when (< (-> obj teleport-if-above-y) f0-0)
(set! (-> obj draw light-index) (the-as uint 255))
(return #t)
)
)
)
((1.0)
(when (< (-> obj teleport-if-above-y) f0-0)
(set! (-> obj draw light-index) (the-as uint 255))
(return #t)
)
)
)
)
#f
)
(defmethod can-target-move? jungle-elevator ((obj jungle-elevator))
(let ((s5-0 (new 'stack-no-clear 'vector)))
(eval-path-curve! (-> obj path) s5-0 0.4 'interp)
(set! (-> obj teleport-if-above-y) (-> s5-0 y))
(eval-path-curve! (-> obj path) s5-0 0.6 'interp)
(set! (-> obj teleport-if-below-y) (-> s5-0 y))
)
(eval-path-curve! (-> obj path) s5-0 0.4 'interp)
(set! (-> obj teleport-if-above-y) (-> s5-0 y))
(eval-path-curve! (-> obj path) s5-0 0.6 'interp)
(set! (-> obj teleport-if-below-y) (-> s5-0 y))
)
(set! (-> obj draw light-index) (the-as uint 255))
(set! (-> obj bidirectional?) #f)
(let ((v0-2 #t))
(set! (-> obj should-grab-player?) v0-2)
v0-2
)
(set! (-> obj should-grab-player?) v0-2)
v0-2
)
)
+5 -5
View File
@@ -864,7 +864,7 @@
(-> self parent-override 0 node-list data 6 bone transform vector 3 quad)
)
(ja-post)
(dummy-47 (-> self root-override))
(update-transforms! (-> self root-override))
(suspend)
)
)
@@ -1184,7 +1184,7 @@
(periscope-draw-beam-impact)
(periscope-update-joints)
(ja-post)
(dummy-47 (-> self root-override))
(update-transforms! (-> self root-override))
0
(none)
)
@@ -1393,7 +1393,7 @@
(periscope-update-joints)
(ja-post)
(suspend)
(dummy-47 (-> self root-override))
(update-transforms! (-> self root-override))
(logior! (-> self draw status) (draw-status drwf01))
(while #t
(suspend)
@@ -1477,7 +1477,7 @@
(suspend)
)
)
(dummy-47 (-> self root-override))
(update-transforms! (-> self root-override))
(set! (-> self y-offset) (-> self height))
(while #t
(if (periscope-has-power-input?)
@@ -1594,7 +1594,7 @@
(vector-z-quaternion! s3-0 (-> self grips transform quat))
(set! (-> self grips-moving?) (< (vector-dot s4-0 s3-0) (cos 182.04445)))
(periscope-update-joints)
(dummy-47 (-> self root-override))
(update-transforms! (-> self root-override))
(when (and (-> self player-touching-grips?) (not (level-hint-displayed?)))
(set! (-> self player-touching-grips?) #f)
(hide-hud)
+15 -15
View File
@@ -141,7 +141,7 @@
(initialize-skeleton obj *logtrap-sg* '())
(set! (-> obj draw shadow-ctrl) (new 'process 'shadow-control -5734.4 0.0 614400.0 (the-as float 1) 163840.0))
(logclear! (-> obj mask) (process-mask actor-pause))
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(go (method-of-object obj idle))
(none)
)
@@ -284,7 +284,7 @@
(set! (-> s4-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s4-0 1)
(alloc-riders s4-0 1)
(let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0)))
(set! (-> s3-0 prim-core collide-as) (collide-kind ground-object))
(set! (-> s3-0 collide-with) (collide-kind target))
@@ -309,7 +309,7 @@
(process-drawable-from-entity! obj arg0)
(initialize-skeleton obj *lurkerm-tall-sail-sg* '())
(logior! (-> obj skel status) 1)
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(set! (-> obj alt-actor) (entity-actor-lookup (-> obj entity) 'alt-actor 0))
(set! (-> obj speed) 1.0)
(if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete)))
@@ -398,7 +398,7 @@
(set! (-> s4-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s4-0 1)
(alloc-riders s4-0 1)
(let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0)))
(set! (-> s3-0 prim-core collide-as) (collide-kind ground-object))
(set! (-> s3-0 collide-with) (collide-kind target))
@@ -440,7 +440,7 @@
(process-drawable-from-entity! obj arg0)
(initialize-skeleton obj *lurkerm-short-sail-sg* '())
(logior! (-> obj skel status) 1)
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(set! (-> obj alt-actor) (entity-actor-lookup (-> obj entity) 'alt-actor 0))
(set! (-> obj speed) 1.0)
(if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete)))
@@ -508,7 +508,7 @@
(let ((gp-0 (new-stack-vector0)))
(set! (-> gp-0 quad) (-> self base quad))
(+! (-> gp-0 y) (* (get-current-value-with-mirror (-> self sync) (-> self height y)) (-> self speed)))
(TODO-RENAME-30 (-> self root-override) gp-0)
(move-to-point! (-> self root-override) gp-0)
)
(suspend)
(let ((a0-3 (-> self skel root-channel 0)))
@@ -533,7 +533,7 @@
(set! (-> s4-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s4-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s3-0 collide-with) (collide-kind target))
@@ -551,7 +551,7 @@
(logclear! (-> obj mask) (process-mask actor-pause))
(initialize-skeleton obj *lurkerm-piston-sg* '())
(logior! (-> obj skel status) 1)
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(set! (-> obj base quad) (-> obj root-override trans quad))
(let ((f30-0 (-> obj base y)))
(set! sv-16 (new 'static 'res-tag))
@@ -901,7 +901,7 @@
(a0-2 (-> (the-as touching-shapes-entry gp-0) head))
(s5-0 (-> self root-override))
)
(get-touched-prim a0-2 s5-0 (the-as touching-prims-entry gp-0))
(get-touched-prim a0-2 s5-0 (the-as touching-shapes-entry gp-0))
((method-of-type touching-shapes-entry get-touched-shape) (the-as touching-shapes-entry gp-0) s5-0)
)
(activate! (-> self smush) -1.0 150 600 1.0 1.0)
@@ -926,7 +926,7 @@
)
)
(ja-post)
(dummy-47 (-> self root-override))
(update-transforms! (-> self root-override))
(logior! (-> self mask) (process-mask actor-pause))
(while #t
(if (not (movie?))
@@ -992,7 +992,7 @@
(set! (-> s4-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s4-0 1)
(alloc-riders s4-0 1)
(let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 16) 0)))
(set! (-> s3-0 prim-core collide-as) (collide-kind ground-object))
(set! (-> s3-0 collide-with) (collide-kind target))
@@ -1154,7 +1154,7 @@
(initialize-skeleton obj *precurbridge-sg* '())
(logior! (-> obj skel status) 1)
(ja-post)
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(set! (-> obj base quad) (-> obj root-override trans quad))
(set! (-> obj sound) (new 'process 'ambient-sound arg0 (-> obj root-override trans)))
(cond
@@ -1204,7 +1204,7 @@
)
)
(suspend)
(dummy-47 (-> self root-override))
(update-transforms! (-> self root-override))
(while #t
(when (or (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))
(and (and *target*
@@ -1303,7 +1303,7 @@
)
(process-drawable-from-entity! obj arg0)
(initialize-skeleton obj *maindoor-sg* '())
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(set! (-> obj thresh w) 61440.0)
(if (or (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete)))
(and (and *target*
@@ -1359,7 +1359,7 @@
(set! (-> obj open-distance) 22528.0)
(set! (-> obj close-distance) 61440.0)
(set! (-> obj speed) 6.0)
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
0
(none)
)
+4 -4
View File
@@ -143,7 +143,7 @@
)
)
(else
(dummy-45 (-> self root-override))
(respond-to-collisions! (-> self root-override))
(let ((a1-3 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-3 from) self)
(set! (-> a1-3 num-params) 2)
@@ -662,7 +662,7 @@ junglesnake-default-event-handler
)
(set-vector! (-> self root-override scale) 1.0 (- 1.0 f0-7) 1.0 1.0)
(vector-lerp! s4-0 gp-0 s5-0 f0-7)
(TODO-RENAME-30 (-> self root-override) s4-0)
(move-to-point! (-> self root-override) s4-0)
)
(suspend)
(let ((a0-10 (-> self skel root-channel 0)))
@@ -672,7 +672,7 @@ junglesnake-default-event-handler
)
)
)
(TODO-RENAME-30 (-> self root-override) gp-0)
(move-to-point! (-> self root-override) gp-0)
)
(set-vector! (-> self root-override scale) 1.0 1.0 1.0 1.0)
(go junglesnake-sleeping)
@@ -734,7 +734,7 @@ junglesnake-default-event-handler
(let ((v1-4 (-> (the-as collide-shape-prim-group (-> obj root-override root-prim)) prims 0)))
(logior! (-> v1-4 prim-core action) (collide-action solid))
)
(dummy-45 (-> obj root-override))
(respond-to-collisions! (-> obj root-override))
)
0
(none)
+2 -2
View File
@@ -28,13 +28,13 @@
(defbehavior aphid-invulnerable aphid ()
(set! (-> self nav-enemy-flags) (logand -33 (-> self nav-enemy-flags)))
(dummy-54 (-> self collide-info) 2 (collide-offense indestructible))
(set-collide-offense (-> self collide-info) 2 (collide-offense indestructible))
(none)
)
(defbehavior aphid-vulnerable aphid ()
(logior! (-> self nav-enemy-flags) 32)
(dummy-54 (-> self collide-info) 2 (collide-offense touch))
(set-collide-offense (-> self collide-info) 2 (collide-offense touch))
(none)
)
+4 -4
View File
@@ -271,7 +271,7 @@
:code
(behavior ()
(suspend)
(dummy-47 (-> self root-override))
(update-transforms! (-> self root-override))
(anim-loop)
(none)
)
@@ -413,7 +413,7 @@
(set! (-> s4-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s4-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s3-0 collide-with) (collide-kind target))
@@ -430,7 +430,7 @@
(process-drawable-from-entity! obj arg0)
(initialize-skeleton obj *eggtop-sg* '())
(logior! (-> obj skel status) 1)
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(set! (-> obj part) (create-launch-control (-> *part-group-id-table* 189) obj))
(set! (-> obj sound-id) (new-sound-id))
(cond
@@ -492,7 +492,7 @@
(initialize-skeleton obj *jng-iris-door-sg* '())
(set! (-> obj open-distance) 32768.0)
(set! (-> obj close-distance) 49152.0)
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
0
(none)
)
+9 -9
View File
@@ -455,11 +455,11 @@
)
)
)
(set! (-> (dummy-34 (-> self root-override) (the-as uint 1)) prim-core action) (collide-action))
(set! (-> (find-prim-by-id (-> self root-override) (the-as uint 1)) prim-core action) (collide-action))
0
(set! (-> (dummy-34 (-> self root-override) (the-as uint 2)) prim-core action) (collide-action))
(set! (-> (find-prim-by-id (-> self root-override) (the-as uint 2)) prim-core action) (collide-action))
0
(dummy-47 (-> self root-override))
(update-transforms! (-> self root-override))
(while #t
(logior! (-> self mask) (process-mask sleep))
(suspend)
@@ -1316,7 +1316,7 @@
(set! (-> s3-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s3-0 1)
(alloc-riders s3-0 1)
(let ((s2-0 (new 'process 'collide-shape-prim-mesh s3-0 (the-as uint 0) (the-as uint 0))))
(set! (-> s2-0 prim-core collide-as) (collide-kind ground-object))
(set! (-> s2-0 collide-with) (collide-kind target))
@@ -1399,7 +1399,7 @@
(defstate plant-boss-intro (plant-boss)
:code
(behavior () (none)) ;; TODO
(behavior () (none)) ;; todo
:post
(the-as (function none :behavior plant-boss) ja-post)
)
@@ -2372,9 +2372,9 @@
(set! (-> self death-prim 1 collide-with) (collide-kind target))
(set! (-> self death-prim 1 prim-core offense) (collide-offense indestructible))
(logior! (-> self death-prim 1 prim-core action) (collide-action solid))
(set! (-> (dummy-34 (-> self root-override) (the-as uint 8)) prim-core action) (collide-action))
(set! (-> (find-prim-by-id (-> self root-override) (the-as uint 8)) prim-core action) (collide-action))
0
(set! (-> (dummy-34 (-> self root-override) (the-as uint 16)) prim-core action) (collide-action))
(set! (-> (find-prim-by-id (-> self root-override) (the-as uint 16)) prim-core action) (collide-action))
0
(logior! (-> self mask) (process-mask actor-pause))
(clear-pending-settings-from-process *setting-control* self 'music)
@@ -2384,7 +2384,7 @@
:post
(behavior ()
(plant-boss-post)
(dummy-45 (-> self root-override))
(respond-to-collisions! (-> self root-override))
(none)
)
)
@@ -2424,7 +2424,7 @@
(let ((gp-1 (-> *display* base-frame-counter)))
(until (>= (- (-> *display* base-frame-counter) gp-1) 1500)
(transform-post)
(dummy-45 (-> self root-override))
(respond-to-collisions! (-> self root-override))
(suspend)
)
)
+3 -3
View File
@@ -129,7 +129,7 @@
(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)
(move-to-point! (-> self root-override) s5-5)
)
(suspend)
)
@@ -149,7 +149,7 @@
(set! (-> s4-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s4-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s3-0 collide-with) (collide-kind target))
@@ -212,7 +212,7 @@
)
)
)
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(go plat-flip-idle)
(none)
)
+9 -1
View File
@@ -241,7 +241,15 @@ baby-spider-default-event-handler
)
(defmethod TODO-RENAME-38 baby-spider ((obj baby-spider))
(dummy-59 (-> obj collide-info) (-> obj collide-info transv) (the-as uint 1) 8192.0 #t #f #f)
(integrate-for-enemy-with-move-to-ground!
(-> obj collide-info)
(-> obj collide-info transv)
(collide-kind background)
8192.0
#t
#f
#f
)
(none)
)
+1 -1
View File
@@ -748,7 +748,7 @@
(set! (-> s5-1 frame-num) 0.0)
)
(ja-post)
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete)))
(go dark-crystal-spawn-fuel-cell)
(go dark-crystal-idle)
+5 -7
View File
@@ -269,10 +269,8 @@
(s0-0 (-> s1-0 head))
)
(while s0-0
(set! sv-96 (get-touched-prim s0-0 (-> self root-overeride) (the-as touching-prims-entry s1-0)))
(if (and (logtest? (-> (get-touched-prim s0-0 (-> s4-0 control) (the-as touching-prims-entry s1-0)) prim-core action)
(collide-action solid)
)
(set! sv-96 (get-touched-prim s0-0 (-> self root-overeride) s1-0))
(if (and (logtest? (-> (get-touched-prim s0-0 (-> s4-0 control) s1-0) prim-core action) (collide-action solid))
(logtest? (-> sv-96 prim-id) 1)
)
(set! s2-0 #t)
@@ -298,7 +296,7 @@
(when (send-event-function arg0 a1-6)
(set! (-> self hit-player?) #t)
(set! (-> self hit-player-time) (the-as uint (-> *display* base-frame-counter)))
(dummy-54 (-> self root-overeride) 2 (collide-offense no-offense))
(set-collide-offense (-> self root-overeride) 2 (collide-offense no-offense))
(let ((v1-39 (-> self mode)))
(if (or (zero? v1-39) (= v1-39 1) (= v1-39 2))
(go driller-lurker-chase #t)
@@ -347,7 +345,7 @@
(when (send-event-function arg0 a1-11)
(set! (-> self hit-player?) #t)
(set! (-> self hit-player-time) (the-as uint (-> *display* base-frame-counter)))
(dummy-54 (-> self root-overeride) 2 (collide-offense no-offense))
(set-collide-offense (-> self root-overeride) 2 (collide-offense no-offense))
(let ((v1-62 (-> self mode)))
(if (or (zero? v1-62) (= v1-62 1) (= v1-62 2))
(go driller-lurker-chase #t)
@@ -548,7 +546,7 @@
)
)
)
(dummy-54 (-> obj root-overeride) 2 (collide-offense touch))
(set-collide-offense (-> obj root-overeride) 2 (collide-offense touch))
(set! (-> obj hit-player?) #f)
#f
)
+1 -1
View File
@@ -1234,7 +1234,7 @@
(v1-19 (-> (get-touched-prim
(-> (the-as touching-shapes-entry a2-1) head)
(-> self root-override)
(the-as touching-prims-entry a2-1)
(the-as touching-shapes-entry a2-1)
)
prim-id
)
+9 -9
View File
@@ -223,7 +223,7 @@
(set! (-> s5-1 frame-num) 0.0)
)
(ja-post)
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(go cavecrusher-idle)
(none)
)
@@ -422,7 +422,7 @@
(set! (-> s4-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s4-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s3-0 collide-with) (collide-kind target))
@@ -448,7 +448,7 @@
(set! (-> s4-1 frame-num) 0.0)
)
(ja-post)
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(let ((f0-7 (quaternion-y-angle (-> obj root-override quat)))
(s4-2 (-> obj draw bounds))
)
@@ -751,7 +751,7 @@
)
)
)
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(let ((f30-1 300.0))
(set! sv-16 (new 'static 'res-tag))
(let ((v1-70 (res-lump-data arg0 'cycle-speed (pointer float) :tag-ptr (& sv-16))))
@@ -854,7 +854,7 @@
(set! (-> s4-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s4-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s3-0 collide-with) (collide-kind target))
@@ -919,7 +919,7 @@
(logior! (-> obj skel status) 1)
(load-params! (-> obj sync) obj (the-as uint 3000) 0.0 0.15 0.15)
(ja-post)
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(create-connection!
*cavecrystal-light-control*
obj
@@ -984,7 +984,7 @@
(set! (-> s4-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s4-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s3-0 collide-with) (collide-kind target))
@@ -1096,7 +1096,7 @@
(let ((s5-0 (new 'stack-no-clear 'vector)))
(set! (-> s5-0 quad) (-> obj orig-trans quad))
(+! (-> s5-0 y) (* 819.2 (update! (-> obj smush))))
(TODO-RENAME-30 (-> obj root-override) s5-0)
(move-to-point! (-> obj root-override) s5-0)
)
)
)
@@ -1435,7 +1435,7 @@
(set! (-> s4-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s4-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s3-0 collide-with) (collide-kind target))
+16 -11
View File
@@ -306,17 +306,22 @@
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as
object
(cond
((= v1-0 'touch)
(dummy-55 (-> self root-override) arg0 (the-as touching-shapes-entry (-> arg3 param 0)) 0.7 6144.0 16384.0)
)
((= v1-0 'attack)
(go mother-spider-egg-die)
)
)
)
(the-as object (cond
((= v1-0 'touch)
(send-shove-back
(-> self root-override)
arg0
(the-as touching-shapes-entry (-> arg3 param 0))
0.7
6144.0
16384.0
)
)
((= v1-0 'attack)
(go mother-spider-egg-die)
)
)
)
)
)
:enter
+9 -6
View File
@@ -469,7 +469,7 @@
(-> self root-overlay)
(the-as uint 1)
)
(dummy-45 (-> self root-overlay))
(respond-to-collisions! (-> self root-overlay))
(let ((a1-3 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-3 from) self)
(set! (-> a1-3 num-params) 2)
@@ -495,7 +495,7 @@
(-> self root-overlay)
(the-as uint s3-0)
)
(let ((a0-10 (dummy-34 (-> self root-overlay) (the-as uint s3-0))))
(let ((a0-10 (find-prim-by-id (-> self root-overlay) (the-as uint s3-0))))
(when a0-10
(set! (-> self explosion-force-position quad) (-> a0-10 prim-core world-sphere quad))
(let ((a1-6 (new 'stack-no-clear 'event-message-block)))
@@ -752,7 +752,7 @@
(logtest? (-> self draw status) (draw-status drwf03))
)
(logclear! (-> self draw status) (draw-status drwf05))
(dummy-47 (-> self root-overlay))
(update-transforms! (-> self root-overlay))
(ja-post)
)
(else
@@ -975,7 +975,7 @@
(behavior ()
(set! (-> self root-override trans quad) (-> self parent-override 0 root-overlay trans quad))
(quaternion-copy! (-> self root-override quat) (-> self parent-override 0 root-overlay quat))
(dummy-47 (-> self root-override))
(update-transforms! (-> self root-override))
(ja-post)
(none)
)
@@ -1036,8 +1036,11 @@
)
:post
(behavior ()
(vector-v++! (-> self root-override transv) (dummy-62 (-> self root-override) (new-stack-vector0) 0.0))
(dummy-57 (-> self root-override) (-> self root-override transv))
(vector-v++!
(-> self root-override transv)
(compute-acc-due-to-gravity (-> self root-override) (new-stack-vector0) 0.0)
)
(integrate-no-collide! (-> self root-override) (-> self root-override transv))
(ja-post)
(none)
)
+13 -2
View File
@@ -163,9 +163,20 @@ nav-enemy-default-event-handler
1.0
(* (-> self enemy-info speed) (-> self speed-scale))
)
(vector-v++! (-> self collide-info transv) (dummy-62 (-> self collide-info) (new-stack-vector0) 0.0))
(vector-v++!
(-> self collide-info transv)
(compute-acc-due-to-gravity (-> self collide-info) (new-stack-vector0) 0.0)
)
(TODO-RENAME-10 (-> self align) 16 1.0 1.0 1.0)
(dummy-59 (-> self collide-info) (-> self collide-info transv) (the-as uint 1) 8192.0 #t #f #f)
(integrate-for-enemy-with-move-to-ground!
(-> self collide-info)
(-> self collide-info transv)
(collide-kind background)
8192.0
#t
#f
#f
)
(nav-enemy-common-post)
(none)
)
+3 -3
View File
@@ -1570,7 +1570,7 @@
(set! (-> s4-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s4-0 1)
(alloc-riders s4-0 1)
(let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0)))
(set! (-> s3-0 prim-core collide-as) (collide-kind ground-object))
(set! (-> s3-0 collide-with) (collide-kind target))
@@ -1785,7 +1785,7 @@
(set! (-> s4-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s4-0 1)
(alloc-riders s4-0 1)
(let ((s2-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
(set! (-> s2-0 prim-core collide-as) (collide-kind ground-object))
(set! (-> s2-0 collide-with) (collide-kind target))
@@ -2029,7 +2029,7 @@
(set! (-> s5-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s5-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s4-0 collide-with) (collide-kind target))
+1 -1
View File
@@ -212,7 +212,7 @@
(set! (-> s4-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s4-0 1)
(alloc-riders s4-0 1)
(let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 5) 0)))
(set! (-> s3-0 prim-core collide-as) (collide-kind ground-object))
(set! (-> s3-0 collide-with) (collide-kind target))
+2 -2
View File
@@ -176,7 +176,7 @@
(set! (-> s4-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s4-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s3-0 collide-with) (collide-kind target))
@@ -252,7 +252,7 @@
(set! (-> obj one-way) #t)
(vector-x-quaternion! (-> obj out-dir) (-> obj root-override quat))
(set! (-> obj out-dir w) (- 8192.0 (vector-dot (-> obj out-dir) (-> obj root-override trans))))
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
0
(none)
)
+207 -38
View File
@@ -18,7 +18,7 @@
:flag-assert #x900000010
)
;; definition for function angle-tracker-apply-move!
(defun angle-tracker-apply-move! ((arg0 angle-tracker) (arg1 float))
(let* ((f0-2 (* arg1 (-> arg0 speed) (-> *display* seconds-per-frame)))
(f0-3 (+ (-> arg0 value) f0-2))
@@ -41,6 +41,8 @@
)
)
;; definition for function angle-tracker-init-range!
;; INFO: Return type mismatch int vs none.
(defun angle-tracker-init-range! ((arg0 angle-tracker) (arg1 float) (arg2 float) (arg3 float))
(set! (-> arg0 min) arg1)
(set! (-> arg0 range) (the float (sar (shl (the int (- arg2 arg1)) 48) 48)))
@@ -53,10 +55,12 @@
(none)
)
;; definition for function angle-tracker-get-value
(defun angle-tracker-get-value ((arg0 angle-tracker))
(the float (sar (shl (the int (+ (-> arg0 min) (-> arg0 value))) 48) 48))
)
;; definition for function angle-tracker-set-value
(defun angle-tracker-set-value ((arg0 angle-tracker) (arg1 float))
(let ((v1-0 (- arg1 (-> arg0 min))))
(when (!= (-> arg0 range) 0.0)
@@ -72,6 +76,7 @@
)
)
;; definition for function angle-tracker-seek!
(defun angle-tracker-seek! ((arg0 angle-tracker) (arg1 float))
(let* ((v1-0 arg0)
(f1-1 (the float (sar (shl (the int (+ (-> v1-0 min) (-> v1-0 value))) 48) 48)))
@@ -141,6 +146,7 @@
#f
)
;; failed to figure out what this is:
(set! (-> *part-group-id-table* 117) (new 'static 'sparticle-launch-group
:length 3
:duration #xbb8
@@ -156,6 +162,7 @@
)
)
;; failed to figure out what this is:
(set! (-> *part-id-table* 517) (new 'static 'sparticle-launcher
:init-specs
(new 'static 'inline-array sp-field-init-spec 18
@@ -181,6 +188,7 @@
)
)
;; failed to figure out what this is:
(set! (-> *part-id-table* 518) (new 'static 'sparticle-launcher
:init-specs
(new 'static 'inline-array sp-field-init-spec 12
@@ -200,6 +208,7 @@
)
)
;; failed to figure out what this is:
(set! (-> *part-id-table* 519) (new 'static 'sparticle-launcher
:init-specs
(new 'static 'inline-array sp-field-init-spec 19
@@ -226,6 +235,7 @@
)
)
;; failed to figure out what this is:
(set! (-> *part-group-id-table* 118)
(new 'static 'sparticle-launch-group
:length 21
@@ -261,6 +271,7 @@
)
)
;; failed to figure out what this is:
(set! (-> *part-id-table* 520) (new 'static 'sparticle-launcher
:init-specs
(new 'static 'inline-array sp-field-init-spec 24
@@ -292,6 +303,7 @@
)
)
;; failed to figure out what this is:
(set! (-> *part-id-table* 526)
(new 'static 'sparticle-launcher :init-specs (new 'static 'inline-array sp-field-init-spec 4
(sp-flt spt-scalevel-x (meters 0.0))
@@ -302,6 +314,7 @@
)
)
;; failed to figure out what this is:
(set! (-> *part-id-table* 521) (new 'static 'sparticle-launcher
:init-specs
(new 'static 'inline-array sp-field-init-spec 21
@@ -330,6 +343,7 @@
)
)
;; failed to figure out what this is:
(set! (-> *part-id-table* 527)
(new 'static 'sparticle-launcher
:init-specs
@@ -337,6 +351,7 @@
)
)
;; failed to figure out what this is:
(set! (-> *part-id-table* 522) (new 'static 'sparticle-launcher
:init-specs
(new 'static 'inline-array sp-field-init-spec 13
@@ -357,6 +372,7 @@
)
)
;; failed to figure out what this is:
(set! (-> *part-id-table* 523) (new 'static 'sparticle-launcher
:init-specs
(new 'static 'inline-array sp-field-init-spec 13
@@ -377,6 +393,7 @@
)
)
;; failed to figure out what this is:
(set! (-> *part-id-table* 524) (new 'static 'sparticle-launcher
:init-specs
(new 'static 'inline-array sp-field-init-spec 24
@@ -408,6 +425,7 @@
)
)
;; failed to figure out what this is:
(set! (-> *part-id-table* 528)
(new 'static 'sparticle-launcher :init-specs (new 'static 'inline-array sp-field-init-spec 7
(sp-flt spt-scalevel-x (meters -0.0033333334))
@@ -421,6 +439,7 @@
)
)
;; failed to figure out what this is:
(set! (-> *part-id-table* 525)
(new 'static 'sparticle-launcher :init-specs (new 'static 'inline-array sp-field-init-spec 19
(sp-tex spt-texture (new 'static 'texture-id :page #x2))
@@ -446,6 +465,7 @@
)
)
;; failed to figure out what this is:
(set! (-> *part-group-id-table* 119)
(new 'static 'sparticle-launch-group
:length 30
@@ -490,6 +510,7 @@
)
)
;; failed to figure out what this is:
(set! (-> *part-id-table* 529)
(new 'static 'sparticle-launcher :init-specs (new 'static 'inline-array sp-field-init-spec 26
(sp-tex spt-texture (new 'static 'texture-id :page #x2))
@@ -522,6 +543,7 @@
)
)
;; failed to figure out what this is:
(set! (-> *part-id-table* 536)
(new 'static 'sparticle-launcher :init-specs (new 'static 'inline-array sp-field-init-spec 4
(sp-flt spt-scalevel-x (meters 0.006666667))
@@ -532,6 +554,7 @@
)
)
;; failed to figure out what this is:
(set! (-> *part-id-table* 530) (new 'static 'sparticle-launcher
:init-specs
(new 'static 'inline-array sp-field-init-spec 25
@@ -564,6 +587,7 @@
)
)
;; failed to figure out what this is:
(set! (-> *part-id-table* 531) (new 'static 'sparticle-launcher
:init-specs
(new 'static 'inline-array sp-field-init-spec 20
@@ -591,6 +615,7 @@
)
)
;; failed to figure out what this is:
(set! (-> *part-id-table* 537)
(new 'static 'sparticle-launcher
:init-specs
@@ -598,6 +623,7 @@
)
)
;; failed to figure out what this is:
(set! (-> *part-id-table* 532) (new 'static 'sparticle-launcher
:init-specs
(new 'static 'inline-array sp-field-init-spec 13
@@ -618,6 +644,7 @@
)
)
;; failed to figure out what this is:
(set! (-> *part-id-table* 533) (new 'static 'sparticle-launcher
:init-specs
(new 'static 'inline-array sp-field-init-spec 13
@@ -638,6 +665,7 @@
)
)
;; failed to figure out what this is:
(set! (-> *part-id-table* 534) (new 'static 'sparticle-launcher
:init-specs
(new 'static 'inline-array sp-field-init-spec 23
@@ -668,6 +696,7 @@
)
)
;; failed to figure out what this is:
(set! (-> *part-id-table* 538)
(new 'static 'sparticle-launcher :init-specs (new 'static 'inline-array sp-field-init-spec 6
(sp-flt spt-scalevel-x (meters -0.0033333334))
@@ -680,6 +709,7 @@
)
)
;; failed to figure out what this is:
(set! (-> *part-id-table* 535)
(new 'static 'sparticle-launcher :init-specs (new 'static 'inline-array sp-field-init-spec 19
(sp-tex spt-texture (new 'static 'texture-id :page #x2))
@@ -705,6 +735,7 @@
)
)
;; definition of type mistycannon-missile
(deftype mistycannon-missile (process-drawable)
((root-override collide-shape-moving :offset 112)
(muzzle-time float :offset-assert 176)
@@ -729,7 +760,23 @@
)
)
;; definition for method 3 of type mistycannon-missile
(defmethod inspect mistycannon-missile ((obj mistycannon-missile))
(let ((t9-0 (method-of-type process-drawable inspect)))
(t9-0 obj)
)
(format #t "~T~Tmuzzle-time: ~f~%" (-> obj muzzle-time))
(format #t "~T~Ttumble-quat: #<quaternion @ #x~X>~%" (-> obj tumble-quat))
(format #t "~T~Tblast-radius: ~f~%" (-> obj blast-radius))
(format #t "~T~Twater-height: ~f~%" (-> obj water-height))
(format #t "~T~Tsfx: ~D~%" (-> obj sfx))
(format #t "~T~Tpart2: ~A~%" (-> obj part2))
(format #t "~T~Tground-time: ~D~%" (-> obj ground-time))
obj
)
;; definition for method 7 of type mistycannon-missile
;; INFO: Return type mismatch process-drawable vs mistycannon-missile.
(defmethod relocate mistycannon-missile ((obj mistycannon-missile) (arg0 int))
(if (nonzero? (-> obj part2))
(&+! (-> obj part2) arg0)
@@ -737,6 +784,7 @@
(the-as mistycannon-missile ((method-of-type process-drawable relocate) obj arg0))
)
;; definition for method 10 of type mistycannon-missile
(defmethod deactivate mistycannon-missile ((obj mistycannon-missile))
(if (nonzero? (-> obj part2))
(kill-and-free-particles (-> obj part2))
@@ -745,6 +793,7 @@
(none)
)
;; failed to figure out what this is:
(defskelgroup *mistycannon-missile-sg* sack
0
2
@@ -753,6 +802,8 @@
:longest-edge (meters 0)
)
;; definition for method 20 of type mistycannon-missile
;; INFO: Return type mismatch int vs none.
(defmethod spawn-part mistycannon-missile ((obj mistycannon-missile))
(let ((gp-0 (-> obj part))
(a1-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 7)))
@@ -763,6 +814,7 @@
(none)
)
;; failed to figure out what this is:
(defstate mistycannon-missile-idle (mistycannon-missile)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
@@ -809,15 +861,14 @@
(restore-collide-with-as (-> self root-override))
(set-vector! (-> self root-override scale) 0.6 0.6 0.6 1.0)
(while (zero? (logand (-> self root-override status) 1))
(if (and
(zero? (-> self sfx))
(< (if *target*
(if (and (zero? (-> self sfx))
(< (if *target*
(vector-vector-distance (-> self root-override trans) (-> *target* control trans))
4096000.0
)
409600.0
)
)
409600.0
)
)
(set! (-> self sfx)
(the-as
uint
@@ -856,7 +907,7 @@
(suspend)
)
(quaternion-set! (-> self root-override quat) 0.0 0.0 0.0 1.0)
(dummy-47 (-> self root-override))
(update-transforms! (-> self root-override))
(when (nonzero? (-> self sfx))
(sound-stop (the-as sound-id (-> self sfx)))
(set! (-> self sfx) (the-as uint 0))
@@ -911,9 +962,12 @@
)
:post
(behavior ()
(vector-v++! (-> self root-override transv) (dummy-62 (-> self root-override) (new-stack-vector0) 1.0))
(vector-v++!
(-> self root-override transv)
(compute-acc-due-to-gravity (-> self root-override) (new-stack-vector0) 1.0)
)
(set! (-> self root-override root-prim prim-core offense) (collide-offense touch))
(dummy-33
(fill-cache-integrate-and-collide!
(-> self root-override)
(-> self root-override transv)
(-> self root-override root-prim collide-with)
@@ -946,6 +1000,7 @@
)
)
;; failed to figure out what this is:
(defstate mistycannon-missile-in-water (mistycannon-missile)
:code
(behavior ()
@@ -962,10 +1017,13 @@
(splash-spawn (the-as basic 1.0) (the-as basic a1-0) 1)
)
(label cfg-3)
(vector-v++! (-> self root-override transv) (dummy-62 (-> self root-override) (new-stack-vector0) 1.0))
(vector-v++!
(-> self root-override transv)
(compute-acc-due-to-gravity (-> self root-override) (new-stack-vector0) 1.0)
)
(vector-float*! (-> self root-override transv) (-> self root-override transv) 0.5)
(dummy-47 (-> self root-override))
(dummy-33
(update-transforms! (-> self root-override))
(fill-cache-integrate-and-collide!
(-> self root-override)
(-> self root-override transv)
(-> self root-override root-prim collide-with)
@@ -990,9 +1048,10 @@
(the-as (function none :behavior mistycannon-missile) ja-post)
)
;; failed to figure out what this is:
(defstate mistycannon-missile-explode (mistycannon-missile)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(case arg2
(('touched)
(let* ((s4-0 arg0)
@@ -1089,11 +1148,11 @@
(set! (-> v1-11 collide-with) (collide-kind cak-2 cak-3 target crate enemy wall-object))
(set! (-> v1-11 prim-core collide-as) (collide-kind enemy))
)
(dummy-47 (-> self root-override))
(update-transforms! (-> self root-override))
(let ((a1-3 (new 'stack-no-clear 'overlaps-others-params)))
(set! (-> a1-3 options) (the-as uint 0))
(set! (-> a1-3 tlist) *touching-list*)
(dummy-40 (-> self root-override) a1-3)
(find-overlapping-shapes (-> self root-override) a1-3)
)
(suspend)
(clear-collide-with-as (-> self root-override))
@@ -1111,11 +1170,13 @@
(the-as (function none :behavior mistycannon-missile) ja-post)
)
;; definition for function mistycannon-collision-reaction
;; INFO: Return type mismatch int vs none.
(defun mistycannon-collision-reaction ((arg0 collide-shape-moving) (arg1 collide-shape-intersect))
(let ((s5-0 0))
(let ((a1-1 (new 'stack-no-clear 'vector)))
(vector-float*! a1-1 (-> arg1 move-vec) (-> arg1 best-u))
(TODO-RENAME-28 arg0 a1-1)
(move-by-vector! arg0 a1-1)
)
(let ((f0-2 (vector-dot (-> arg0 transv) (-> arg1 best-tri normal)))
(v1-6 (new 'stack-no-clear 'vector))
@@ -1131,6 +1192,7 @@
(none)
)
;; definition of type mistycannon-init-data
(deftype mistycannon-init-data (structure)
((pos vector :offset-assert 0)
(vel vector :offset-assert 4)
@@ -1144,7 +1206,21 @@
:flag-assert #x900000018
)
;; definition for method 3 of type mistycannon-init-data
(defmethod inspect mistycannon-init-data ((obj mistycannon-init-data))
(format #t "[~8x] ~A~%" obj 'mistycannon-init-data)
(format #t "~Tpos: #<vector @ #x~X>~%" (-> obj pos))
(format #t "~Tvel: #<vector @ #x~X>~%" (-> obj vel))
(format #t "~Trotate: ~f~%" (-> obj rotate))
(format #t "~Tflight-time: ~f~%" (-> obj flight-time))
(format #t "~Tmuzzle-time: ~f~%" (-> obj muzzle-time))
(format #t "~Tblast-radius: ~f~%" (-> obj blast-radius))
obj
)
;; definition for function mistycannon-missile-init-by-other
;; INFO: Return type mismatch object vs none.
;; Used lq/sq
(defbehavior mistycannon-missile-init-by-other mistycannon-missile ((arg0 mistycannon-init-data) (arg1 entity))
(set! (-> self mask) (logior (process-mask projectile) (-> self mask)))
(logclear! (-> self mask) (process-mask actor-pause))
@@ -1192,6 +1268,8 @@
(none)
)
;; definition for function spawn-mistycannon-missile
;; INFO: Return type mismatch int vs none.
(defun spawn-mistycannon-missile ((arg0 process-tree)
(arg1 vector)
(arg2 vector)
@@ -1222,6 +1300,7 @@
(none)
)
;; definition of type mistycannon
(deftype mistycannon (process-drawable)
((root-override collide-shape-moving :offset 112)
(rotate angle-tracker :inline :offset-assert 176)
@@ -1263,7 +1342,33 @@
)
)
;; definition for method 3 of type mistycannon
(defmethod inspect mistycannon ((obj mistycannon))
(let ((t9-0 (method-of-type process-drawable inspect)))
(t9-0 obj)
)
(format #t "~T~Trotate: #<angle-tracker @ #x~X>~%" (-> obj rotate))
(format #t "~T~Ttilt: #<angle-tracker @ #x~X>~%" (-> obj tilt))
(format #t "~T~Tfront-wheel: ~f~%" (-> obj front-wheel))
(format #t "~T~Trear-wheel: ~f~%" (-> obj rear-wheel))
(format #t "~T~Tlast-known-rotation: ~f~%" (-> obj last-known-rotation))
(format #t "~T~Tpart-timer: ~D~%" (-> obj part-timer))
(format #t "~T~Thellmouth: #<vector @ #x~X>~%" (-> obj hellmouth))
(format #t "~T~Tpostbindinfo-ok: ~A~%" (-> obj postbindinfo-ok))
(format #t "~T~Tlaunch-origin: #<vector @ #x~X>~%" (-> obj launch-origin))
(format #t "~T~Tgoggles: #<vector @ #x~X>~%" (-> obj goggles))
(format #t "~T~Tavoid-entity: ~A~%" (-> obj avoid-entity))
(format #t "~T~Tcenter-point: #<vector @ #x~X>~%" (-> obj center-point))
(format #t "~T~Tat-point: #<vector @ #x~X>~%" (-> obj at-point))
(format #t "~T~Taccuracy-range: ~f~%" (-> obj accuracy-range))
(format #t "~T~Ttarget-theta: ~f~%" (-> obj target-theta))
(format #t "~T~Tsound-id: ~D~%" (-> obj sound-id))
(format #t "~T~Taim-sound-id: ~D~%" (-> obj aim-sound-id))
(format #t "~T~Tplayer-touching-grips?: ~A~%" (-> obj player-touching-grips?))
obj
)
;; definition for function mistycannon-pick-random-target-point
(defbehavior mistycannon-pick-random-target-point mistycannon ()
(let ((f30-0 (* (sqrtf (rand-vu)) (-> self center-point w)))
(f28-1 (* 65536.0 (rand-vu)))
@@ -1279,18 +1384,24 @@
)
)
;; definition for method 20 of type mistycannon
;; INFO: Return type mismatch int vs none.
(defmethod rotate! mistycannon ((obj mistycannon) (arg0 float))
(angle-tracker-apply-move! (-> obj rotate) arg0)
0
(none)
)
;; definition for method 21 of type mistycannon
;; INFO: Return type mismatch int vs none.
(defmethod tilt! mistycannon ((obj mistycannon) (arg0 float))
(angle-tracker-apply-move! (-> obj tilt) arg0)
0
(none)
)
;; definition for method 22 of type mistycannon
;; INFO: Return type mismatch int vs none.
;; WARN: Expression building failed: Function (method 22 mistycannon) has a return type of none, but the expression builder found a return statement.
(defmethod dummy-22 mistycannon ((obj mistycannon) (arg0 float) (arg1 float) (arg2 float))
(if (not (-> obj postbindinfo-ok))
@@ -1321,6 +1432,8 @@
(none)
)
;; definition for method 23 of type mistycannon
;; INFO: Return type mismatch int vs none.
(defmethod dummy-23 mistycannon ((obj mistycannon))
(when (< (- (-> *display* base-frame-counter) (the-as int (-> obj part-timer))) 900)
(let ((v1-4 (-> obj rotate)))
@@ -1365,6 +1478,7 @@
(none)
)
;; failed to figure out what this is:
(defskelgroup *mistycannon-sg* mistycannon
0
3
@@ -1373,6 +1487,8 @@
:longest-edge (meters 4)
)
;; definition for function mistycannon-prebind-function
;; INFO: Return type mismatch int vs none.
(defun mistycannon-prebind-function ((arg0 mistycannon) (arg1 int) (arg2 mistycannon))
(let ((t9-0 quaternion-axis-angle!)
(a0-1 (&-> arg0 link))
@@ -1425,6 +1541,9 @@
(none)
)
;; definition for function mistycannon-postbind-function
;; INFO: Return type mismatch int vs none.
;; Used lq/sq
(defun mistycannon-postbind-function ((arg0 mistycannon))
(set! (-> arg0 launch-origin quad) (-> arg0 node-list data 4 bone transform vector 3 quad))
(let ((s5-0 (new 'stack-no-clear 'vector)))
@@ -1437,19 +1556,19 @@
(none)
)
;; failed to figure out what this is:
(defstate mistycannon-idle (mistycannon)
:trans
(behavior ()
(if (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete))))
(go mistycannon-waiting-for-player)
)
(if (and
(-> self postbindinfo-ok)
*target*
(>= (-> self fact-info-override idle-distance)
(vector-vector-distance (-> self root-override trans) (-> *target* control trans))
)
)
(if (and (-> self postbindinfo-ok)
*target*
(>= (-> self fact-info-override idle-distance)
(vector-vector-distance (-> self root-override trans) (-> *target* control trans))
)
)
(go mistycannon-aim-at-player)
)
(rider-trans)
@@ -1467,6 +1586,7 @@
(the-as (function none :behavior mistycannon) rider-post)
)
;; definition of type quadratic-solution
(deftype quadratic-solution (structure)
((s1 float :offset-assert 0)
(s2 float :offset-assert 4)
@@ -1476,7 +1596,15 @@
:flag-assert #x900000008
)
;; definition for method 3 of type quadratic-solution
(defmethod inspect quadratic-solution ((obj quadratic-solution))
(format #t "[~8x] ~A~%" obj 'quadratic-solution)
(format #t "~Ts1: ~f~%" (-> obj s1))
(format #t "~Ts2: ~f~%" (-> obj s2))
obj
)
;; definition for function solve-missile-tilt
(defun solve-missile-tilt ((arg0 quadratic-solution) (arg1 float) (arg2 float) (arg3 float) (arg4 float))
(let* ((f1-3 (* 0.5 arg2 arg2 arg4))
(f0-3 f1-3)
@@ -1496,6 +1624,7 @@
#t
)
;; definition of type trajectory-params
(deftype trajectory-params (structure)
((x float :offset-assert 0)
(y float :offset-assert 4)
@@ -1509,7 +1638,20 @@
:flag-assert #x900000018
)
;; definition for method 3 of type trajectory-params
(defmethod inspect trajectory-params ((obj trajectory-params))
(format #t "[~8x] ~A~%" obj 'trajectory-params)
(format #t "~Tx: ~f~%" (-> obj x))
(format #t "~Ty: ~f~%" (-> obj y))
(format #t "~Tgravity: ~f~%" (-> obj gravity))
(format #t "~Ttheta: ~f~%" (-> obj theta))
(format #t "~Tspeed: ~f~%" (-> obj speed))
(format #t "~Ttime: ~f~%" (-> obj time))
obj
)
;; definition for function solve-missile-velocity
;; INFO: Return type mismatch int vs none.
(defun solve-missile-velocity ((arg0 trajectory-params) (arg1 float))
(set! (-> arg0 theta) arg1)
(let ((f0-4 (* (- (* (-> arg0 x) (tan arg1)) (-> arg0 y)) (/ 2.0 (-> arg0 gravity)))))
@@ -1522,6 +1664,7 @@
(none)
)
;; definition for function mistycannon-find-best-solution
(defbehavior mistycannon-find-best-solution mistycannon ((arg0 quadratic-solution))
(let ((v1-0 #t)
(a1-0 #t)
@@ -1560,12 +1703,15 @@
)
)
;; definition for function mistycannon-find-trajectory
(defbehavior mistycannon-find-trajectory mistycannon ((arg0 trajectory-params))
(set! (-> arg0 time) 0.0)
(solve-missile-velocity arg0 (-> arg0 theta))
(none)
)
;; definition for function mistycannon-do-aim
;; INFO: Return type mismatch int vs none.
;; WARN: Expression building failed: Function mistycannon-do-aim has a return type of none, but the expression builder found a return statement.
(defbehavior mistycannon-do-aim mistycannon ((arg0 vector) (arg1 vector))
(if (not (-> self postbindinfo-ok))
@@ -1627,19 +1773,23 @@
(none)
)
;; failed to figure out what this is:
(defstate mistycannon-aim-at-player (mistycannon)
:enter
(behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none))
(behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
(none)
)
:trans
(behavior ()
(if (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete))))
(go mistycannon-waiting-for-player)
)
(if (not (and *target* (>= (-> self fact-info-override idle-distance)
(vector-vector-distance (-> self root-override trans) (-> *target* control trans))
)
)
)
(vector-vector-distance (-> self root-override trans) (-> *target* control trans))
)
)
)
(go mistycannon-idle)
)
(rider-trans)
@@ -1661,6 +1811,7 @@
(the-as (function none :behavior mistycannon) rider-post)
)
;; failed to figure out what this is:
(defstate mistycannon-waiting-for-player (mistycannon)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
@@ -1738,6 +1889,7 @@
(the-as (function none :behavior mistycannon) rider-post)
)
;; failed to figure out what this is:
(defstate cam-mistycannon (camera-slave)
:event
cam-standard-event-handler
@@ -1774,6 +1926,7 @@
)
)
;; failed to figure out what this is:
(defstate mistycannon-player-control (mistycannon)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
@@ -1784,9 +1937,17 @@
)
)
:exit
(behavior () (sound-stop (-> self sound-id)) (sound-stop (-> self aim-sound-id)) (none))
(behavior ()
(sound-stop (-> self sound-id))
(sound-stop (-> self aim-sound-id))
(none)
)
:trans
(behavior () (dummy-23 self) (rider-trans) (none))
(behavior ()
(dummy-23 self)
(rider-trans)
(none)
)
:code
(behavior ()
(send-event *camera* 'change-state cam-mistycannon 0)
@@ -1841,10 +2002,9 @@
#t
)
)
(when (or
(= gp-0 300)
(and (zero? (logand (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons x))) (nonzero? gp-0))
)
(when (or (= gp-0 300)
(and (zero? (logand (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons x))) (nonzero? gp-0))
)
(let ((gp-1 (+ 50 (the int (* 0.16666667 (the float gp-0))))))
(level-hint-spawn (game-text-id daxter-get-some) "sksp009f" (the-as entity #f) *entity-pool* (game-task none))
(dummy-22 self (* 4096.0 (the float gp-1)) 2.0 40960.0)
@@ -1878,6 +2038,7 @@
(the-as (function none :behavior mistycannon) rider-post)
)
;; failed to figure out what this is:
(defstate mistycannon-waiting-for-player-to-fuck-off (mistycannon)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
@@ -1898,7 +2059,10 @@
)
)
:enter
(behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none))
(behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
(none)
)
:trans
(the-as (function none :behavior mistycannon) rider-trans)
:code
@@ -1916,6 +2080,9 @@
(the-as (function none :behavior mistycannon) rider-post)
)
;; definition for method 11 of type mistycannon
;; INFO: Return type mismatch object vs none.
;; Used lq/sq
(defmethod init-from-entity! mistycannon ((obj mistycannon) (arg0 entity-actor))
(local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag))
(set! (-> obj mask) (logior (process-mask enemy) (-> obj mask)))
@@ -1925,7 +2092,7 @@
(set! (-> s4-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s4-0 1)
(alloc-riders s4-0 1)
(let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0)))
(set! (-> s3-0 prim-core collide-as) (collide-kind ground-object))
(set! (-> s3-0 collide-with) (collide-kind target))
@@ -1959,7 +2126,7 @@
(quaternion-identity! (-> obj root-override quat))
(initialize-skeleton obj *mistycannon-sg* '())
(logior! (-> obj skel status) 1)
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(set! (-> obj skel prebind-function)
(the-as (function pointer int process-drawable none) mistycannon-prebind-function)
)
@@ -2034,3 +2201,5 @@
)
+3 -3
View File
@@ -454,13 +454,13 @@ nav-enemy-default-event-handler
(let ((gp-1 (res-lump-struct (-> self entity) 'movie-pos vector)))
(cond
(gp-1
(TODO-RENAME-30 (-> self collide-info) gp-1)
(move-to-point! (-> self collide-info) gp-1)
(set-yaw-angle-clear-roll-pitch! (-> self collide-info) (-> gp-1 w))
)
(else
(TODO-RENAME-30 (-> self collide-info) (-> *target* control trans))
(move-to-point! (-> self collide-info) (-> *target* control trans))
(quaternion-copy! (-> self collide-info quat) (-> *target* control quat))
(dummy-60 (-> self collide-info) 40960.0 40960.0 #f (collide-kind background))
(move-to-ground (-> self collide-info) 40960.0 40960.0 #f (collide-kind background))
)
)
)
+2 -2
View File
@@ -409,7 +409,7 @@
:code
(behavior ()
(while (< (- (-> *display* base-frame-counter) (-> self state-time)) 1200)
(dummy-33
(fill-cache-integrate-and-collide!
(-> self root-override)
(-> self root-override transv)
(-> self root-override root-prim collide-with)
@@ -438,7 +438,7 @@
)
:post
(behavior ()
(dummy-47 (-> self root-override))
(update-transforms! (-> self root-override))
(none)
)
)
+2 -2
View File
@@ -709,7 +709,7 @@
(set! (-> s5-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s5-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s4-0 collide-with) (collide-kind target))
@@ -1216,7 +1216,7 @@
(set! (-> s4-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s4-0 1)
(alloc-riders s4-0 1)
(let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 17) 0)))
(set! (-> s3-0 prim-core collide-as) (collide-kind ground-object))
(set! (-> s3-0 collide-with) (collide-kind target))
@@ -23,7 +23,7 @@
(set! (-> sv-88 1 quad) (-> arg3 quad))
(let ((a1-3 (new 'stack-no-clear 'vector)))
(vector-float*! a1-3 (-> arg1 move-vec) (-> arg1 best-u))
(TODO-RENAME-28 arg0 a1-3)
(move-by-vector! arg0 a1-3)
)
(set-and-handle-pat! arg0 (-> arg1 best-tri pat))
(if (= (-> arg0 poly-pat mode) (pat-mode wall))
@@ -50,7 +50,7 @@
(set! (-> sv-84 quad) v1-31)
)
(if (= (-> arg1 best-u) 0.0)
(TODO-RENAME-28 arg0 (vector-normalize-copy! (new-stack-vector0) sv-84 3.0))
(move-by-vector! arg0 (vector-normalize-copy! (new-stack-vector0) sv-84 3.0))
)
(set! (-> arg0 poly-normal quad) (-> arg1 best-tri normal quad))
(collide-shape-moving-angle-set! arg0 sv-84 (-> sv-88 0))
@@ -1473,7 +1473,7 @@
)
)
)
(TODO-RENAME-30 (-> self control) gp-0)
(move-to-point! (-> self control) gp-0)
(quaternion-slerp!
(-> self control unknown-quaternion00)
(-> self control unknown-quaternion02)
@@ -1649,7 +1649,7 @@
(ja-post)
(vector<-cspace! gp-1 (-> self node-list data 3))
(set! (-> gp-1 y) (+ -5896.192 (-> gp-1 y)))
(TODO-RENAME-30 (-> self control) gp-1)
(move-to-point! (-> self control) gp-1)
)
(send-event *camera* 'ease-in)
(ja-channel-set! 0)
@@ -1712,7 +1712,7 @@
)
)
)
(TODO-RENAME-30 (-> self control) gp-0)
(move-to-point! (-> self control) gp-0)
(quaternion-slerp!
(-> self control unknown-quaternion00)
(-> self control unknown-quaternion02)
@@ -129,15 +129,15 @@
(cond
((zero? v1-1)
(if (zero?
(logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1 r1))
)
(logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1 r1))
)
(set! (-> self racer slide-mode) -1)
)
)
((= v1-1 1)
(if (zero?
(logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1 r1))
)
(logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1 r1))
)
(set! (-> self racer slide-mode) -1)
)
)
@@ -209,11 +209,10 @@
(meters 0.000061035156)
(new 'static 'rgba :r #xff :a #x80)
)
(if (and
(< 409.6 (vector-xz-length (-> self control unknown-vector00)))
s5-1
(= (-> self next-state name) 'target-racing)
)
(if (and (< 409.6 (vector-xz-length (-> self control unknown-vector00)))
s5-1
(= (-> self next-state name) 'target-racing)
)
(vector-rotate-y!
(-> self control unknown-vector00)
(-> self control unknown-vector00)
@@ -264,11 +263,10 @@
(defbehavior racer-thrust target ((arg0 basic) (arg1 float))
(let ((f0-0
(if (and
(logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons x))
(not (-> self racer stick-lock))
(not (-> self racer stick-off))
)
(if (and (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons x))
(not (-> self racer stick-lock))
(not (-> self racer stick-off))
)
1.0
0.0
)
@@ -308,29 +306,25 @@
)
(set! f0-13
(cond
((and
(not (and (= (-> self fact-info-target eco-type) 1) (>= (-> self fact-info-target eco-level) 1.0)))
(logtest?
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0)
(pad-buttons square)
)
)
(if (and
(logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons x))
(not (-> self racer stick-lock))
(not (-> self racer stick-off))
)
((and (not (and (= (-> self fact-info-target eco-type) 1) (>= (-> self fact-info-target eco-level) 1.0)))
(logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0)
(pad-buttons square)
)
)
(if (and (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons x))
(not (-> self racer stick-lock))
(not (-> self racer stick-off))
)
(* 0.9875 f0-13)
(* 0.49375 (+ 1.0 f0-13))
)
)
(else
(cond
((and
(logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons x))
(not (-> self racer stick-lock))
(not (-> self racer stick-off))
)
((and (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons x))
(not (-> self racer stick-lock))
(not (-> self racer stick-off))
)
)
(else
(set! f0-13 (* 0.5 (+ 1.0 f0-13)))
@@ -348,10 +342,9 @@
(vector-xz-normalize! (-> self control unknown-vector00) f30-0)
)
)
(+!
(-> self racer bottom-rot)
(* (+ 364088.88 (* 0.32 (fabs (-> self control unknown-vector00 y)))) (-> *display* seconds-per-frame))
)
(+! (-> self racer bottom-rot)
(* (+ 364088.88 (* 0.32 (fabs (-> self control unknown-vector00 y)))) (-> *display* seconds-per-frame))
)
0
(none)
)
@@ -420,25 +413,26 @@
(let ((gp-0 (new 'stack-no-clear 'vector)))
(set! (-> gp-0 quad) (-> self control transv quad))
(let ((f30-0 0.8))
(dummy-33 (-> self control) (-> self control transv) (-> self control root-prim collide-with))
(+! (-> self racer shock-offsetv) (* (- (-> gp-0 y) (-> self control transv y)) f30-0))
(+!
(-> self racer shock-offsetv)
(+ (* -20.0 (-> *display* seconds-per-frame) (-> self racer shock-offset))
(if (racer-on-ground?)
(* (-> self control dynam gravity-length) (-> *display* seconds-per-frame) f30-0)
0.0
)
)
(fill-cache-integrate-and-collide!
(-> self control)
(-> self control transv)
(-> self control root-prim collide-with)
)
(+! (-> self racer shock-offsetv) (* (- (-> gp-0 y) (-> self control transv y)) f30-0))
(+! (-> self racer shock-offsetv)
(+ (* -20.0 (-> *display* seconds-per-frame) (-> self racer shock-offset))
(if (racer-on-ground?)
(* (-> self control dynam gravity-length) (-> *display* seconds-per-frame) f30-0)
0.0
)
)
)
)
(if (and
(or
(< (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) 60)
(< (-> self racer shock-offset) 0.0)
)
(!= (-> self control unknown-surface00 mode) 'air)
)
(if (and (or (< (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) 60)
(< (-> self racer shock-offset) 0.0)
)
(!= (-> self control unknown-surface00 mode) 'air)
)
(+! (-> self racer shock-offset) (* (-> self racer shock-offsetv) (-> *display* seconds-per-frame)))
)
(set! (-> self racer shock-offset)
@@ -466,11 +460,10 @@
)
(deg-diff (vector-y-angle gp-0) (vector-y-angle (-> self control transv)))
(let ((f30-2 (vector-xz-length gp-0)))
(when (and
(logtest? (-> self control status) 8)
(< 20480.0 f30-2)
(and (< (fabs (-> self racer mod-x)) 0.5) (!= (-> self next-state name) 'target-racing-smack))
)
(when (and (logtest? (-> self control status) 8)
(< 20480.0 f30-2)
(and (< (fabs (-> self racer mod-x)) 0.5) (!= (-> self next-state name) 'target-racing-smack))
)
(let ((s5-3 (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control unknown-vector70))))
(vector-normalize! s5-3 1.0)
(let ((gp-1 (vector-reflect-flat! (new 'stack-no-clear 'vector) gp-0 s5-3)))
@@ -530,13 +523,11 @@
(quaternion-copy! (-> self control quat) (-> self control unknown-quaternion00))
(set-twist! (-> self racer front-blade) (the-as float #f) (- (-> self racer front-rot)) (the-as float #f))
(set-twist! (-> self racer bottom-blade) (the-as float #f) (the-as float #f) (- (-> self racer bottom-rot)))
(if (and
(= *cheat-mode* 'debug)
(and
(logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2))
(not *pause-lock*)
)
)
(if (and (= *cheat-mode* 'debug)
(and (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2))
(not *pause-lock*)
)
)
(vector-reset! (-> self control transv))
)
0
@@ -550,8 +541,7 @@
)
)
(let ((f0-2
(if (or
(and (logtest? (-> self control status) 8) (zero? (logand (-> self control status) 1)))
(if (or (and (logtest? (-> self control status) 8) (zero? (logand (-> self control status) 1)))
(logtest? (-> self state-flags) #x8000)
)
0.0
@@ -591,11 +581,11 @@
(let ((f0-6
(+ (* 2.0 f0-1)
(if (< 4096.0
(vector-dot
(-> self control dynam gravity-normal)
(vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control shadow-pos))
)
(vector-dot
(-> self control dynam gravity-normal)
(vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control shadow-pos))
)
)
0.7
0.0
)
@@ -645,10 +635,9 @@
(send-event-function self a1-6)
)
)
((and
(>= (- (-> *display* base-frame-counter) (-> self racer unstuck-time)) 900)
(>= (- (-> *display* base-frame-counter) (the-as int (-> self racer heat-sound-time))) 300)
)
((and (>= (- (-> *display* base-frame-counter) (-> self racer unstuck-time)) 900)
(>= (- (-> *display* base-frame-counter) (the-as int (-> self racer heat-sound-time))) 300)
)
(set! (-> self racer heat-sound-time) (the-as uint (-> *display* base-frame-counter)))
(sound-play-by-name (static-sound-name "warning") (new-sound-id) 1024 0 0 1 #t)
)
@@ -758,23 +747,21 @@
((= v1-61 (pat-material hotcoals))
(-> *part-id-table* 2214)
)
((or
(= v1-61 (pat-material pcmetal))
(= v1-61 (pat-material metal))
(= v1-61 (pat-material tube))
(= v1-61 (pat-material rotate))
)
((or (= v1-61 (pat-material pcmetal))
(= v1-61 (pat-material metal))
(= v1-61 (pat-material tube))
(= v1-61 (pat-material rotate))
)
(-> *part-id-table* 2215)
)
((= v1-61 (pat-material grass))
(-> *part-id-table* 2207)
)
((or
(= v1-61 (pat-material dirt))
(= v1-61 (pat-material sand))
(= v1-61 (pat-material straw))
(= v1-61 (pat-material gravel))
)
((or (= v1-61 (pat-material dirt))
(= v1-61 (pat-material sand))
(= v1-61 (pat-material straw))
(= v1-61 (pat-material gravel))
)
(-> *part-id-table* 2216)
)
((or (= v1-61 (pat-material wood)) (= v1-61 (pat-material crwood)))
@@ -842,15 +829,13 @@
)
)
)
(when (and
(and (= (-> self fact-info-target eco-type) 1) (>= (-> self fact-info-target eco-level) 1.0))
(logtest?
(-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(pad-buttons circle square)
)
(>= (- (-> *display* base-frame-counter) (-> self control unknown-dword82)) 75)
(zero? (logand (-> self state-flags) #x8008))
)
(when (and (and (= (-> self fact-info-target eco-type) 1) (>= (-> self fact-info-target eco-level) 1.0))
(logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
(pad-buttons circle square)
)
(>= (- (-> *display* base-frame-counter) (-> self control unknown-dword82)) 75)
(zero? (logand (-> self state-flags) #x8008))
)
(let ((gp-6 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat)))
(s5-4 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self manipy 0 node-list data 4)))
)
@@ -954,13 +939,12 @@
(set! (-> self racer boost-curve) 0.0)
)
)
(when (or
(zero?
(logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons x))
(when (or (zero?
(logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons x))
)
(< (-> self control unknown-float01) 4096.0)
(= (-> self racer boost-level) 0.0)
)
(< (-> self control unknown-float01) 4096.0)
(= (-> self racer boost-level) 0.0)
)
(when (nonzero? (-> self racer boost-sound-id))
(let ((v1-241 (the-as sound-rpc-set-param (get-sound-buffer-entry))))
(set! (-> v1-241 command) (sound-command set-param))
@@ -1035,15 +1019,13 @@
#t
)
)
(when (and
(< (-> self racer heat) (-> *RACER-bank* heat-max))
(and
(< (* 0.8 (-> *RACER-bank* heat-max)) (-> self racer heat))
(>= (- (-> *display* base-frame-counter) (the-as int (-> self racer heat-sound-time)))
(the int (* 3000.0 (- 1.0 (/ (-> self racer heat) (-> *RACER-bank* heat-max)))))
)
)
)
(when (and (< (-> self racer heat) (-> *RACER-bank* heat-max))
(and (< (* 0.8 (-> *RACER-bank* heat-max)) (-> self racer heat))
(>= (- (-> *display* base-frame-counter) (the-as int (-> self racer heat-sound-time)))
(the int (* 3000.0 (- 1.0 (/ (-> self racer heat) (-> *RACER-bank* heat-max)))))
)
)
)
(set! (-> self racer heat-sound-time) (the-as uint (-> *display* base-frame-counter)))
(sound-play-by-name (static-sound-name "warning") (new-sound-id) 1024 0 0 1 #t)
)
@@ -1083,26 +1065,24 @@
(countdown (s5-0 gp-0)
(set! (-> self control unknown-int40) s5-0)
(set! (-> self racer turn-anim-targ) (fmax -16.0 (fmin 16.0 (-> self racer turn-anim-targ))))
(or
(not (>= (* (-> self racer turn-anim-targ) (-> self racer turn-anim-frame)) 0.0))
(< (fabs (-> self racer turn-anim-frame)) (fabs (-> self racer turn-anim-targ)))
)
(+!
(-> self racer turn-anim-vel)
(* (- (-> self racer turn-anim-targ) (-> self racer turn-anim-frame))
(lerp-scale
20.0
(if (< (fabs (-> self racer turn-anim-frame)) (fabs (-> self racer turn-anim-targ)))
30.0
60.0
)
(-> self control unknown-float01)
0.0
(* 0.3 (-> self racer transv-max))
(or (not (>= (* (-> self racer turn-anim-targ) (-> self racer turn-anim-frame)) 0.0))
(< (fabs (-> self racer turn-anim-frame)) (fabs (-> self racer turn-anim-targ)))
)
(+! (-> self racer turn-anim-vel)
(* (- (-> self racer turn-anim-targ) (-> self racer turn-anim-frame))
(lerp-scale
20.0
(if (< (fabs (-> self racer turn-anim-frame)) (fabs (-> self racer turn-anim-targ)))
30.0
60.0
)
(-> self control unknown-float01)
0.0
(* 0.3 (-> self racer transv-max))
)
(-> *display* seconds-per-frame)
)
(-> *display* seconds-per-frame)
)
)
)
(set! (-> self racer turn-anim-vel)
(fmax
-100.0
@@ -1124,15 +1104,14 @@
(set! (-> self racer turn-anim-vel) 0.0)
)
)
(+!
(-> self racer tail-anim-vel)
(* -50.0
(-> *display* seconds-per-frame)
(- (-> self racer tail-anim-frame)
(* -0.0091552725 (- (-> self racer change-roty) (-> self racer change-roty-old)))
)
)
)
(+! (-> self racer tail-anim-vel)
(* -50.0
(-> *display* seconds-per-frame)
(- (-> self racer tail-anim-frame)
(* -0.0091552725 (- (-> self racer change-roty) (-> self racer change-roty-old)))
)
)
)
(set! (-> self racer tail-anim-vel) (fmax -100.0 (fmin 100.0 (* 0.8 (-> self racer tail-anim-vel)))))
(+! (-> self racer tail-anim-frame) (* (-> self racer tail-anim-vel) (-> *display* seconds-per-frame)))
(set! (-> self racer tail-anim-frame) (fmax -20.0 (fmin 20.0 (-> self racer tail-anim-frame))))
@@ -1144,10 +1123,9 @@
(set! (-> self racer tail-anim-vel) 0.0)
)
)
(+!
(-> self racer rudd-anim-vel)
(* 40.0 (-> *display* seconds-per-frame) (- (-> self racer tail-anim-frame) (-> self racer rudd-anim-frame)))
)
(+! (-> self racer rudd-anim-vel)
(* 40.0 (-> *display* seconds-per-frame) (- (-> self racer tail-anim-frame) (-> self racer rudd-anim-frame)))
)
(set! (-> self racer rudd-anim-vel) (fmax -100.0 (fmin 100.0 (* 0.96 (-> self racer rudd-anim-vel)))))
(+! (-> self racer rudd-anim-frame) (* (-> self racer rudd-anim-vel) (-> *display* seconds-per-frame)))
(set! (-> self racer rudd-anim-frame) (fmax -20.0 (fmin 20.0 (-> self racer rudd-anim-frame))))
@@ -1388,21 +1366,21 @@
(cond
((zero? v1-17)
(- (fmax
(analog-input
(the-as int (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) abutton 8))
0.0
32.0
255.0
1.0
)
(analog-input
(the-as int (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) abutton 9))
0.0
32.0
255.0
1.0
)
)
(analog-input
(the-as int (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) abutton 8))
0.0
32.0
255.0
1.0
)
(analog-input
(the-as int (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) abutton 9))
0.0
32.0
255.0
1.0
)
)
)
)
((= v1-17 1)
@@ -1446,15 +1424,15 @@
)
(f1-3 (* -0.8 (-> self racer rotv y)))
(f0-33 (+ (cond
((< (* f1-3 f26-3) 0.0)
0.0
)
(else
(let ((f2-3 (+ 910.2222 (fabs f1-3))))
(fmax (fmin f26-3 f2-3) (- f2-3))
)
)
((< (* f1-3 f26-3) 0.0)
0.0
)
(else
(let ((f2-3 (+ 910.2222 (fabs f1-3))))
(fmax (fmin f26-3 f2-3) (- f2-3))
)
)
)
(cond
((< (* f1-3 f0-29) 0.0)
0.0
@@ -1557,10 +1535,9 @@
(cond
((>= f0-77 -32768.0)
(cond
((or
(= (-> self next-state name) 'target-racing-jump)
(and (= (-> self next-state name) 'target-racing-bounce) (= (-> self racer bounce) 1))
)
((or (= (-> self next-state name) 'target-racing-jump)
(and (= (-> self next-state name) 'target-racing-bounce) (= (-> self racer bounce) 1))
)
(set! (-> self racer speed-rotx) 0.5)
(when (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) 30)
(set! (-> self racer hill-rotx)
@@ -1603,29 +1580,25 @@
)
)
(cond
((and
(logtest? (-> self control status) 8)
(and
(>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) 30)
(or (-> self racer stick-lock) (< (target-move-dist (the-as int (-> *TARGET-bank* stuck-time))) 4096.0))
(not
(and
(= *cheat-mode* 'debug)
(logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2))
)
)
)
)
(cond
((and
(< 0.0
(vector-dot
(-> self control dynam gravity-normal)
(vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control unknown-vector54))
((and (logtest? (-> self control status) 8)
(and (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) 30)
(or (-> self racer stick-lock) (< (target-move-dist (the-as int (-> *TARGET-bank* stuck-time))) 4096.0))
(not
(and (= *cheat-mode* 'debug)
(logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2))
)
)
)
)
(logtest? (-> self control root-prim prim-core action) #x8000)
)
(cond
((and (< 0.0
(vector-dot
(-> self control dynam gravity-normal)
(vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control last-known-safe-ground))
)
)
(logtest? (-> self control root-prim prim-core action) (collide-action ca-15))
)
(+! (-> self racer stuck-count) 1)
(go target-racing-smack 122880.0 #f)
)
+25 -20
View File
@@ -51,24 +51,29 @@
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(local-vars (v0-0 none))
(let ((v1-0 arg2))
(the-as
object
(cond
((= v1-0 'touch)
(dummy-55 (-> self root-override) arg0 (the-as touching-shapes-entry (-> arg3 param 0)) 0.7 6144.0 16384.0)
)
((= v1-0 'can-spawn?)
(return (the-as object #t))
v0-0
)
((= v1-0 'notify-spawned)
(go spider-egg-hatch)
)
((= v1-0 'attack)
(go spider-egg-die)
)
)
)
(the-as object (cond
((= v1-0 'touch)
(send-shove-back
(-> self root-override)
arg0
(the-as touching-shapes-entry (-> arg3 param 0))
0.7
6144.0
16384.0
)
)
((= v1-0 'can-spawn?)
(return (the-as object #t))
v0-0
)
((= v1-0 'notify-spawned)
(go spider-egg-hatch)
)
((= v1-0 'attack)
(go spider-egg-die)
)
)
)
)
)
:enter
@@ -334,7 +339,7 @@
(initialize-skeleton obj *spider-egg-unbroken-sg* '())
(dummy-9 (-> obj broken-look) *spider-egg-broken-sg* (-> obj draw art-group) (-> obj entity))
(set-vector! (-> obj root-override scale) 0.4 0.4 0.4 1.0)
(if (not (dummy-60 (-> obj root-override) 12288.0 40960.0 #t (collide-kind background)))
(if (not (move-to-ground (-> obj root-override) 12288.0 40960.0 #t (collide-kind background)))
(go process-drawable-art-error "no ground")
)
(set! (-> obj root-override trans y) (+ -409.6 (-> obj root-override trans y)))
@@ -351,7 +356,7 @@
(rand-vu-float-range 0.0 65536.0)
)
)
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(nav-mesh-connect obj (-> obj root-override) (the-as nav-control #f))
(if (> (entity-actor-count arg0 'alt-actor) 0)
(set! (-> obj notify-actor) (entity-actor-lookup arg0 'alt-actor 0))
+4 -4
View File
@@ -455,7 +455,7 @@
(set! (-> s4-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s4-0 1)
(alloc-riders s4-0 1)
(let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0)))
(set! (-> s3-0 prim-core collide-as) (collide-kind ground-object))
(set! (-> s3-0 collide-with) (collide-kind target))
@@ -1091,7 +1091,7 @@
(set! (-> s5-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s5-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s4-0 collide-with) (collide-kind target))
@@ -1127,7 +1127,7 @@
(set! (-> s5-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s5-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s4-0 collide-with) (collide-kind target))
@@ -1180,7 +1180,7 @@
(set! (-> s5-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s5-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s4-0 collide-with) (collide-kind target))
+8 -8
View File
@@ -615,7 +615,7 @@
(set! (-> s4-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s4-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s3-0 collide-with) (collide-kind target))
@@ -634,7 +634,7 @@
(logior! (-> obj skel status) 1)
(set! (-> obj spawn-trans quad) (-> obj root-override trans quad))
(set! (-> obj root-override trans y) (+ -2662.4 (-> obj root-override trans y)))
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(set! (-> obj part) (create-launch-control (-> *part-group-id-table* 510) obj))
(set! (-> obj sound) (new
'process
@@ -906,7 +906,7 @@
(set! (-> s4-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s4-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s3-0 collide-with) (collide-kind target))
@@ -1254,7 +1254,7 @@
)
)
(vector-seek-3d-smooth! s5-0 (-> self open-trans) (* 16384.0 (-> *display* seconds-per-frame)) 0.9)
(TODO-RENAME-30 (-> self root-override) s5-0)
(move-to-point! (-> self root-override) s5-0)
)
(let ((a1-7 (new 'stack-no-clear 'vector)))
(set! (-> a1-7 quad) (-> self root-override trans quad))
@@ -1818,7 +1818,7 @@
(set! (-> s5-1 y)
(seek-with-smooth (-> self root-override trans y) f0-1 (* 6144.0 (-> *display* seconds-per-frame)) 0.2 204.8)
)
(TODO-RENAME-30 (-> self root-override) s5-1)
(move-to-point! (-> self root-override) s5-1)
)
)
)
@@ -1858,7 +1858,7 @@
(set! (-> s4-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s4-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s3-0 collide-with) (collide-kind target))
@@ -2143,7 +2143,7 @@
(set! (-> s4-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s4-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s3-0 collide-with) (collide-kind target))
@@ -2304,7 +2304,7 @@
(set! (-> s4-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s4-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s3-0 collide-with) (collide-kind target))
+2 -2
View File
@@ -454,7 +454,7 @@
(set! (-> s4-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s4-0 1)
(alloc-riders s4-0 1)
(let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0)))
(set! (-> s3-0 prim-core collide-as) (collide-kind ground-object))
(set! (-> s3-0 collide-with) (collide-kind target))
@@ -496,7 +496,7 @@
(initialize-skeleton obj *ram-sg* '())
(logior! (-> obj skel status) 1)
(ja-post)
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(set! (-> obj orient-ry) (quaternion-y-angle (-> obj root-override quat)))
(nav-mesh-connect obj (-> obj root-override) (the-as nav-control #f))
(set! (-> obj part) (create-launch-control (-> *part-group-id-table* 526) obj))
+1 -1
View File
@@ -106,7 +106,7 @@
(reset-target-state #t)
(set! (-> self control transv quad) (the-as uint128 0))
(set! (-> self control unknown-float01) 0.0)
(TODO-RENAME-28 (-> self control) (new 'static 'vector :y 4096.0 :w 1.0))
(move-by-vector! (-> self control) (new 'static 'vector :y 4096.0 :w 1.0))
(logior! (-> self control root-prim prim-core action) (collide-action ca-12))
(ja-channel-set! 1)
(let ((gp-1 (-> self skel root-channel 0)))
+1 -1
View File
@@ -246,7 +246,7 @@
(nav-enemy-neck-control-inactive)
(set! (-> self state-time) (-> *display* base-frame-counter))
(if (-> self nav-info move-to-ground)
(dummy-60 (-> self collide-info) 40960.0 40960.0 #t (collide-kind background))
(move-to-ground (-> self collide-info) 40960.0 40960.0 #t (collide-kind background))
)
(set! (-> self nav-enemy-flags) (logand -7 (-> self nav-enemy-flags)))
(set! (-> self state-timeout) 300)
+21 -5
View File
@@ -411,7 +411,7 @@
(set! (-> self bounced?) #t)
(set! (-> self bounce-volume) 100)
(set! (-> self hit-player-time) (the-as uint (-> *display* base-frame-counter)))
(dummy-54 (-> self root-override) 2 (collide-offense no-offense))
(set-collide-offense (-> self root-override) 2 (collide-offense no-offense))
)
)
)
@@ -466,7 +466,7 @@
)
)
)
(dummy-54 (-> self root-override) 2 (collide-offense normal-attack))
(set-collide-offense (-> self root-override) 2 (collide-offense normal-attack))
(set! (-> self hit-player?) #f)
)
(transform-post)
@@ -678,7 +678,15 @@
(joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!)
)
(+! (-> self root-override transv y) (* -545996.8 (-> *display* seconds-per-frame)))
(dummy-59 (-> self root-override) (-> self root-override transv) (the-as uint 1) 12288.0 #f #f #f)
(integrate-for-enemy-with-move-to-ground!
(-> self root-override)
(-> self root-override transv)
(collide-kind background)
12288.0
#f
#f
#f
)
(when *target*
(let ((gp-3 (new 'stack-no-clear 'vector)))
(vector-! gp-3 (target-pos 0) (-> self root-override trans))
@@ -763,7 +771,15 @@
(+! (-> self facing-ry) (* (-> self spin-vel) (-> *display* seconds-per-frame)))
(quaternion-axis-angle! (-> self root-override quat) 0.0 1.0 0.0 (-> self facing-ry))
(dummy-20 self)
(dummy-59 (-> self root-override) (-> self root-override transv) (the-as uint 1) 8192.0 #f #f #f)
(integrate-for-enemy-with-move-to-ground!
(-> self root-override)
(-> self root-override transv)
(collide-kind background)
8192.0
#f
#f
#f
)
(dummy-27 (-> self nav))
(none)
)
@@ -1088,7 +1104,7 @@
(set! (-> v1-49 ignore-angle) 16384.0)
)
(transform-post)
(if (not (dummy-60 (-> obj root-override) 12288.0 40960.0 #t (collide-kind background)))
(if (not (move-to-ground (-> obj root-override) 12288.0 40960.0 #t (collide-kind background)))
(go process-drawable-art-error "no ground")
)
(set! (-> obj facing-ry) (quaternion-y-angle (-> obj root-override quat)))
+6 -6
View File
@@ -268,7 +268,7 @@
#t
""
)
(dummy-47 (-> self collide-info))
(update-transforms! (-> self collide-info))
(suspend)
)
(none)
@@ -561,7 +561,7 @@
(set! (-> gp-2 frame-num) 0.0)
)
(transform-post)
(dummy-60 (-> self collide-info) 40960.0 40960.0 #t (collide-kind background))
(move-to-ground (-> self collide-info) 40960.0 40960.0 #t (collide-kind background))
(dummy-51 self)
(go double-lurker-top-resume)
)
@@ -837,10 +837,10 @@
)
)
(set! (-> self collide-info transv y) (+ -36864.0 (-> self collide-info transv y)))
(dummy-59
(integrate-for-enemy-with-move-to-ground!
(-> self collide-info)
(-> self collide-info transv)
(the-as uint 1)
(collide-kind background)
8192.0
#t
(-> self nav-info hover-if-no-ground)
@@ -1016,10 +1016,10 @@
)
)
(set! (-> self collide-info transv y) (+ -36864.0 (-> self collide-info transv y)))
(dummy-59
(integrate-for-enemy-with-move-to-ground!
(-> self collide-info)
(-> self collide-info transv)
(the-as uint 1)
(collide-kind background)
8192.0
#t
(-> self nav-info hover-if-no-ground)
+4 -4
View File
@@ -78,13 +78,13 @@
(set! f30-0 (seek f30-0 0.0 (-> *display* seconds-per-frame)))
(eval-path-curve-div! (-> self path) (-> self basetrans) f30-0 'interp)
(set! (-> self launcher 0 root-override trans quad) (-> self basetrans quad))
(dummy-47 (-> self launcher 0 root-override))
(update-transforms! (-> self launcher 0 root-override))
(suspend)
)
)
(eval-path-curve-div! (-> self path) (-> self basetrans) 0.0 'interp)
(set! (-> self launcher 0 root-override trans quad) (-> self basetrans quad))
(dummy-47 (-> self launcher 0 root-override))
(update-transforms! (-> self launcher 0 root-override))
(go floating-launcher-ready)
(none)
)
@@ -111,7 +111,7 @@
(set! (-> s4-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s4-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s3-0 collide-with) (collide-kind target))
@@ -147,7 +147,7 @@
)
(initialize-skeleton obj *floating-launcher-sg* '())
(logior! (-> obj skel status) 1)
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(dummy-21 obj)
(set! (-> obj trigger-height) (res-lump-float arg0 'trigger-height))
(go floating-launcher-idle)
+25 -24
View File
@@ -5,6 +5,13 @@
;; name in dgo: helix-water
;; dgos: L1, SUN, SUNKEN
(declare-type helix-water basic)
(declare-type helix-slide-door basic)
(declare-type helix-button basic)
(define-extern *helix-slide-door* helix-slide-door)
(define-extern *helix-water* helix-water)
(define-extern *helix-button* helix-button)
;; DECOMP BEGINS
(deftype helix-slide-door (process-drawable)
@@ -21,8 +28,6 @@
)
)
;; Manually added!
(define-extern *helix-slide-door* helix-slide-door)
(defskelgroup *helix-slide-door-sg* helix-slide-door
0
@@ -53,8 +58,6 @@
)
)
;; Manually added!
(define-extern *helix-button* helix-button)
(defskelgroup *helix-button-sg* helix-button
0
@@ -95,8 +98,6 @@
)
)
;; Manually added!
(define-extern *helix-water* helix-water)
(defstate water-vol-idle (helix-dark-eco)
:virtual #t
@@ -151,12 +152,13 @@
(defstate helix-slide-door-idle-open (helix-slide-door)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2
(('trigger)
(go helix-slide-door-close)
)
)
)
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(case arg2
(('trigger)
(go helix-slide-door-close)
)
)
)
:code
(behavior ()
(while #t
@@ -233,7 +235,7 @@
(set! (-> s5-1 frame-num) 0.0)
)
(ja-post)
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(set! *helix-slide-door* obj)
(go helix-slide-door-idle-open)
(none)
@@ -276,10 +278,9 @@
(when *target*
(when (logtest? (-> *target* control status) 1)
(cond
((and
(and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))
(not (handle->process (-> self fcell-handle)))
)
((and (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))
(not (handle->process (-> self fcell-handle)))
)
(go helix-button-quick-activate)
)
(else
@@ -361,9 +362,9 @@
(when (< 12288.0 (vector-xz-length gp-1))
(set! (-> gp-1 y) 0.0)
(vector-normalize! gp-1 4096.0)
(TODO-RENAME-28 (-> *target* control) gp-1)
(dummy-45 (-> self root-override))
(dummy-35 (-> self root-override))
(move-by-vector! (-> *target* control) gp-1)
(respond-to-collisions! (-> self root-override))
(detect-riders! (-> self root-override))
)
)
)
@@ -398,7 +399,7 @@
(set! (-> a1-11 quad) (-> self root-override trans quad))
(set! (-> a1-11 y) f0-3)
)
(TODO-RENAME-30 (-> self root-override) a1-11)
(move-to-point! (-> self root-override) a1-11)
)
(suspend)
)
@@ -537,7 +538,7 @@
(set! (-> a1-5 quad) (-> self root-override trans quad))
(set! (-> a1-5 y) f0-1)
)
(TODO-RENAME-30 (-> self root-override) a1-5)
(move-to-point! (-> self root-override) a1-5)
)
(suspend)
)
@@ -569,7 +570,7 @@
(set! (-> s4-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s4-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s3-0 collide-with) (collide-kind target))
@@ -602,7 +603,7 @@
(new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc))
)
(ja-post)
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(set! *helix-button* obj)
(go helix-button-startup)
(none)
+3 -3
View File
@@ -606,7 +606,7 @@
:trans
(the-as (function none :behavior orbit-plat) plat-trans)
:code
(behavior () (none)) ;; TODO - fix!
(behavior () (none)) ;; todo
:post
(the-as (function none :behavior orbit-plat) plat-post)
)
@@ -866,7 +866,7 @@
(set! (-> s4-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s4-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s3-0 collide-with) (collide-kind target))
@@ -893,7 +893,7 @@
(set! (-> s4-1 frame-num) 0.0)
)
(ja-post)
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(dummy-21 obj)
(set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0))
(logior! (-> obj nav flags) (nav-control-flags display-marks bit3 bit5 bit6 bit7))
+3 -3
View File
@@ -130,7 +130,7 @@
(when (send-event-function arg0 a1-9)
(set! (-> self hit-player?) #t)
(set! (-> self hit-player-time) (the-as uint (-> *display* base-frame-counter)))
(dummy-54 (-> self root-override) 2 (collide-offense no-offense))
(set-collide-offense (-> self root-override) 2 (collide-offense no-offense))
)
)
)
@@ -146,7 +146,7 @@
)
)
)
(dummy-54 (-> self root-override) 2 (collide-offense normal-attack))
(set-collide-offense (-> self root-override) 2 (collide-offense normal-attack))
(set! (-> self hit-player?) #f)
)
(transform-post)
@@ -1194,7 +1194,7 @@
(set! (-> v1-59 max-dist) 102400.0)
(set! (-> v1-59 ignore-angle) 16384.0)
)
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(go puffer-idle)
(none)
)
+2 -2
View File
@@ -334,7 +334,7 @@
(set! (-> s5-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s5-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s4-0 collide-with) (collide-kind target))
@@ -356,7 +356,7 @@
(initialize-skeleton obj *qbert-plat-sg* '())
(set! (-> obj anchor-point quad) (-> obj root-overlay trans quad))
(logior! (-> obj skel status) 1)
(dummy-47 (-> obj root-overlay))
(update-transforms! (-> obj root-overlay))
(TODO-RENAME-29 obj *qbert-plat-constants*)
(set! (-> obj float-height-offset) 6144.0)
(let ((v1-11 (-> obj control-point-array data)))
+1 -1
View File
@@ -151,7 +151,7 @@
(set! (-> s5-1 frame-num) 0.0)
)
(ja-post)
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(set! *shover* obj)
(go shover-idle)
(none)
+2 -2
View File
@@ -491,7 +491,7 @@
(set! (-> s4-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s4-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s3-0 collide-with) (collide-kind target))
@@ -548,7 +548,7 @@
(set! (-> obj part4) (create-launch-control (-> *part-group-id-table* 439) obj))
(set! (-> obj water-entity) (entity-actor-lookup arg0 'alt-actor 0))
(ja-post)
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(go square-platform-lowered)
(none)
)
+4 -4
View File
@@ -508,7 +508,7 @@
(let ((a1-1 (new 'stack-no-clear 'vector)))
(set! (-> a1-1 x) (the-as float 1))
(set! (-> a1-1 y) (the-as float #f))
(if (dummy-40 (-> obj root-override) a1-1)
(if (find-overlapping-shapes (-> obj root-override) (the-as overlaps-others-params a1-1))
(set! s5-0 #t)
)
)
@@ -705,7 +705,7 @@
)
(set! (-> a1-16 quad) (-> obj root-override trans quad))
(set! (-> a1-16 y) f0-32)
(TODO-RENAME-30 (-> obj root-override) a1-16)
(move-to-point! (-> obj root-override) a1-16)
)
)
(let ((v1-77 (new 'stack-no-clear 'vector))
@@ -774,7 +774,7 @@
(set! (-> s4-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s4-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s3-0 collide-with) (collide-kind target))
@@ -803,7 +803,7 @@
)
(set! (-> s4-1 frame-num) 0.0)
)
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(load-params! (-> obj sync) obj (the-as uint 1800) 0.0 0.15 0.15)
(let ((f30-0 0.4)
(f28-0 0.9)
+4 -4
View File
@@ -598,7 +598,7 @@
(set! (-> s4-1 frame-num) 0.0)
)
(ja-post)
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(nav-mesh-connect obj (-> obj root-override) (the-as nav-control #f))
(set! (-> obj master) (entity-actor-lookup arg0 'alt-actor 0))
(set! (-> obj link) (new 'process 'actor-link-info obj))
@@ -737,7 +737,7 @@
(let ((a1-6 (new 'stack-no-clear 'vector)))
(set! (-> a1-6 quad) (-> s5-1 button-pos quad))
(set! (-> a1-6 y) (+ 2662.4 (-> a1-6 y)))
(TODO-RENAME-30 (-> *target* control) a1-6)
(move-to-point! (-> *target* control) a1-6)
)
(vector-reset! (-> *target* control transv))
)
@@ -1345,7 +1345,7 @@
(set! (-> s4-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s4-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s3-0 collide-with) (collide-kind target))
@@ -1412,7 +1412,7 @@
)
)
(ja-post)
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(dummy-21 obj (the-as exit-chamber-items s3-1))
(let ((s1-3 #t))
(let ((v1-64 s4-1))
+5 -5
View File
@@ -115,7 +115,7 @@
(behavior ()
(when (-> self move-to?)
(set! (-> self move-to?) #f)
(TODO-RENAME-30 (-> self root-override) (-> self move-to-pos))
(move-to-point! (-> self root-override) (-> self move-to-pos))
(quaternion-copy! (-> self root-override quat) (-> self move-to-quat))
(ja-post)
)
@@ -162,7 +162,7 @@
(cond
((-> self move-to?)
(set! (-> self move-to?) #f)
(TODO-RENAME-30 (-> self root-override) (-> self move-to-pos))
(move-to-point! (-> self root-override) (-> self move-to-pos))
(quaternion-copy! (-> self root-override quat) (-> self move-to-quat))
(ja-post)
)
@@ -285,7 +285,7 @@
(behavior ()
(when (-> self move-to?)
(set! (-> self move-to?) #f)
(TODO-RENAME-30 (-> self root-override) (-> self move-to-pos))
(move-to-point! (-> self root-override) (-> self move-to-pos))
(quaternion-copy! (-> self root-override quat) (-> self move-to-quat))
(ja-post)
)
@@ -332,7 +332,7 @@
(cond
((-> self move-to?)
(set! (-> self move-to?) #f)
(TODO-RENAME-30 (-> self root-override) (-> self move-to-pos))
(move-to-point! (-> self root-override) (-> self move-to-pos))
(quaternion-copy! (-> self root-override quat) (-> self move-to-quat))
(ja-post)
)
@@ -401,7 +401,7 @@
)
(set! (-> s5-2 frame-num) 0.0)
)
(dummy-47 (-> obj root-override))
(update-transforms! (-> obj root-override))
(ja-post)
(go sun-iris-door-closed)
(none)
+1 -1
View File
@@ -116,7 +116,7 @@
(set! (-> s5-0 no-reaction)
(the-as (function collide-shape-moving collide-shape-intersect vector vector none) nothing)
)
(dummy-29 s5-0 1)
(alloc-riders 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) (collide-kind ground-object))
(set! (-> s4-0 collide-with) (collide-kind target))
+6 -2
View File
@@ -385,9 +385,13 @@
)
)
(set! (-> self control reaction) target-collision-reaction)
(dummy-33 (-> self control) (-> self control transv) (-> self control root-prim collide-with))
(fill-cache-integrate-and-collide!
(-> self control)
(-> self control transv)
(-> self control root-prim collide-with)
)
(if (logtest? (-> self control root-prim prim-core action) (collide-action ca-6))
(dummy-20 *target* *collide-cache*)
(find-edge-grabs! *target* *collide-cache*)
)
(if *debug-segment*
(add-frame

Some files were not shown because too many files have changed in this diff Show More