diff --git a/decompiler/IR2/AtomicOpTypeAnalysis.cpp b/decompiler/IR2/AtomicOpTypeAnalysis.cpp index be77a82bd7..6066cc6ff9 100644 --- a/decompiler/IR2/AtomicOpTypeAnalysis.cpp +++ b/decompiler/IR2/AtomicOpTypeAnalysis.cpp @@ -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()); } diff --git a/decompiler/analysis/atomic_op_builder.cpp b/decompiler/analysis/atomic_op_builder.cpp index 13a15c3482..049543e02f 100644 --- a/decompiler/analysis/atomic_op_builder.cpp +++ b/decompiler/analysis/atomic_op_builder.cpp @@ -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()) && diff --git a/decompiler/config/all-types.gc b/decompiler/config/all-types.gc index 2fb0e7b9c7..690d71fb47 100644 --- a/decompiler/config/all-types.gc +++ b/decompiler/config/all-types.gc @@ -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 diff --git a/decompiler/config/jak1_ntsc_black_label/hacks.jsonc b/decompiler/config/jak1_ntsc_black_label/hacks.jsonc index e1ce25b6ff..f342e9c14e 100644 --- a/decompiler/config/jak1_ntsc_black_label/hacks.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/hacks.jsonc @@ -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, diff --git a/decompiler/config/jak1_ntsc_black_label/stack_structures.jsonc b/decompiler/config/jak1_ntsc_black_label/stack_structures.jsonc index 719cd2b7c6..472cc78f67 100644 --- a/decompiler/config/jak1_ntsc_black_label/stack_structures.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/stack_structures.jsonc @@ -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!": [] } diff --git a/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc b/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc index 6ff255c9ef..d5abb81d24 100644 --- a/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc @@ -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": [] } diff --git a/decompiler/config/jak1_ntsc_black_label/var_names.jsonc b/decompiler/config/jak1_ntsc_black_label/var_names.jsonc index 82421a4886..f485425103 100644 --- a/decompiler/config/jak1_ntsc_black_label/var_names.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/var_names.jsonc @@ -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": {} } diff --git a/decompiler/level_extractor/extract_tie.cpp b/decompiler/level_extractor/extract_tie.cpp index 5d2904b37c..ff9017888c 100644 --- a/decompiler/level_extractor/extract_tie.cpp +++ b/decompiler/level_extractor/extract_tie.cpp @@ -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 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 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 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 frags; // per-instance per-fragment info + std::vector 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 pos; - math::Vector tex; + math::Vector pos; // position + math::Vector 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 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 adgifs; + bool has_magic_tex0_bit = false; // use decal mode (todo) + std::vector + adgifs; // the adgifs that come with this tiefrag (different strips can hve different) - std::vector other_gif_data; - std::vector points_data; - std::vector point_sizes; + std::vector other_gif_data; // data sent from EE asm code, sizes/offsets/metadata + std::vector 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 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 vertex_by_dest_addr; + // simulate a load in the points data (using vu mem addr) math::Vector 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 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 adgif_offset_in_gif_buf_qw; std::vector 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 instances; bool uses_generic = false; - float stiffness = 0; + float stiffness = 0; // wind u32 generic_flag; - std::vector time_of_day_colors; - std::vector frags; + std::vector time_of_day_colors; // c++ type for time of day data + std::vector frags; // the fragments of the prototype }; +/*! + * Convert TIE packed matrix to normal one. this was figured out from the EE asm. + */ std::array extract_tie_matrix(const u16* data) { std::array result; for (int i = 0; i < 4; i++) { @@ -336,10 +360,13 @@ std::array 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& protos, Ref wind_ref) { u16 max_wind = 0; @@ -357,25 +384,28 @@ void check_wind_vectors_zero(const std::vector& protos, Ref wind_r } } +// get per-instance info from the level data std::vector collect_instance_info( const level_tools::DrawableInlineArrayInstanceTie* instances, const std::vector* protos) { std::vector 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 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 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 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& map) { auto masked = original & 0xffffff00; for (auto& t : map) { @@ -425,6 +465,9 @@ u32 remap_texture(u32 original, const std::vector& ma return original; } +/*! + * Update per-proto information. + */ void update_proto_info(std::vector* out, const std::vector& map, const TextureDB& tdb, @@ -433,15 +476,18 @@ void update_proto_info(std::vector* 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* 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* 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* 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* 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* 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* 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* 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* 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& 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& 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& 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& 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> verts; std::vector> 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 transform_tie(const std::array 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 transform_tie(const std::array 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& protos) { std::vector> verts; std::vector> tcs; @@ -1779,6 +1900,7 @@ struct BigPalette { std::vector colors; }; +// combine all individual time of day palettes into one giant one. BigPalette make_big_palette(std::vector& protos) { BigPalette result; @@ -1805,6 +1927,9 @@ BigPalette make_big_palette(std::vector& 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& 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> static_draws_by_tex; std::unordered_map> 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& grps) { std::vector 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 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); diff --git a/goal_src/engine/collide/collide-cache-h.gc b/goal_src/engine/collide/collide-cache-h.gc index 1abee12630..505687266b 100644 --- a/goal_src/engine/collide/collide-cache-h.gc +++ b/goal_src/engine/collide/collide-cache-h.gc @@ -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) diff --git a/goal_src/engine/collide/collide-mesh-h.gc b/goal_src/engine/collide/collide-mesh-h.gc index ce3cb0944f..b62ea81692 100644 --- a/goal_src/engine/collide/collide-mesh-h.gc +++ b/goal_src/engine/collide/collide-mesh-h.gc @@ -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) ) diff --git a/goal_src/engine/collide/collide-shape-h.gc b/goal_src/engine/collide/collide-shape-h.gc index b2d7ceb42f..82bfeeeb69 100644 --- a/goal_src/engine/collide/collide-shape-h.gc +++ b/goal_src/engine/collide/collide-shape-h.gc @@ -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) ) ) diff --git a/goal_src/engine/collide/collide-shape-rider.gc b/goal_src/engine/collide/collide-shape-rider.gc index a6972f0765..d253af35e1 100644 --- a/goal_src/engine/collide/collide-shape-rider.gc +++ b/goal_src/engine/collide/collide-shape-rider.gc @@ -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) + ) diff --git a/goal_src/engine/collide/collide-shape.gc b/goal_src/engine/collide/collide-shape.gc index 5be4c24a48..5b577ffb4d 100644 --- a/goal_src/engine/collide/collide-shape.gc +++ b/goal_src/engine/collide/collide-shape.gc @@ -5,32 +5,576 @@ ;; name in dgo: collide-shape ;; dgos: GAME, ENGINE -;; TODO - for misty-teetertotter | rigid-body -(define-extern default-collision-reaction (function collide-shape-moving collide-shape-intersect vector vector none)) ;; TODO - not completely confirmed +;; The collide shape system is used to handle collision reactions. -;; DECOMP BEGINS +;;;;;;;;;;;;;;;;;;;;;;; +;; OVERLAP +;;;;;;;;;;;;;;;;;;;;;;; -;; ERROR: function was not converted to expressions. Cannot decompile. +;; The overlap algorithm determines if two collide shapes are in contact. +;; If shapes are far away, it will abort early and just return #f. +;; overlap and "should push away" are the same thing. +;; both check collision flags and require "solid" flags. So this is only for solid collisions. +;; the collision isn't symmetric [collide(a, b) != collide(b, a)] because the with/as flags. +;; so there's some weirdness to get all the method dispatch stuff to work around (you can only dispatch on one type) -(defmethod should-push-away-test collide-shape-prim () + +(defmethod compute-overlap collide-shape ((obj collide-shape) (arg0 collide-shape) (arg1 collide-overlap-result)) + "Find the overlap between two collide shapes. This is the main entry point for the overlap algorithm. + The result is returned in arg1. The obj is collided _with_ arg0 (meaning obj uses its collide-with, arg0 uses colide-as). + The best-dist is only valid if the result is #t (it should be negative then)" + + ;; this method begins the recursive traversal through the tree of collide-shape-prims, starting with the + ;; root of each shape. + (local-vars (v1-3 collide-action) (v1-4 float) (a2-2 collide-action) (a3-2 collide-action)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + ) + (init-vf0-vector) + + ;; reset the 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) + ) + ;; grab the roots + (let ((a0-1 (-> obj root-prim)) + (a1-1 (-> arg0 root-prim)) + ) + (let ((a3-0 (-> a0-1 collide-with)) ;; this object's collide with + (t0-0 (-> a1-1 prim-core collide-as)) ;; the incoming object's as + (v1-2 (-> a0-1 prim-core action)) ;; our action + ) + (let ((a2-1 (-> a1-1 prim-core action))) ;; their action + ;; reject if (logand with as) fails + (b! (zero? (logand a3-0 t0-0)) cfg-8 :delay (set! a3-2 (logand a2-1 1))) + ;; reject if non-solid + (b! (zero? a3-2) cfg-8 :delay (set! a2-2 (logand a2-1 8))) + ) + ;; reject if ca-3 on us fails (not sure what this means yet) + (b! (nonzero? a2-2) cfg-8 :delay (set! v1-3 (logand v1-2 1))) + ) + ;; reject if non-solid + (b! (zero? v1-3) cfg-8 :delay (nop!)) + + ;; if we're here, our collision types allow us to collide + (.lvf vf1 (&-> a0-1 prim-core world-sphere quad)) + (.lvf vf2 (&-> a1-1 prim-core world-sphere quad)) + + ;; see if bsphere's overlap + (.sub.vf vf3 vf1 vf2) + (.add.w.vf vf4 vf1 vf2 :mask #b1000) + (.mul.vf vf3 vf3 vf3 :mask #b111) + (.mul.w.vf vf4 vf4 vf4 :mask #b1000) + (.mul.x.vf acc vf0 vf3 :mask #b1000) + (.add.mul.y.vf acc vf0 vf3 acc :mask #b1000) + (.add.mul.z.vf vf3 vf0 vf3 acc :mask #b1000) + (.sub.w.vf vf5 vf3 vf4 :mask #b1000) + (let ((f0-1 0.0)) + (.add.w.vf vf5 vf0 vf5 :mask #b1) + (.mov v1-4 vf5) + (b! (<= f0-1 v1-4) cfg-8) ;; they don't, fail! + ) + + ;; our bsphere's overlap. We need a more detailed test to know for sure + ;; this will dispatch a more specific method for a0-1. + (should-push-away-test a0-1 a1-1 arg1) + ) + + ;; return the result of the more detailed test. + (let ((v0-1 (< (-> arg1 best-dist) 0.0))) + (b! #t cfg-9 :delay (nop!)) + (label cfg-8) + (set! v0-1 #f) + (label cfg-9) + v0-1 + ) + ) + ) + +;; the should-push-away-test will update the collide-overlap-result. The best-dist will be negative if they overlap. +;; it works on collide prims. + +(defmethod should-push-away-test collide-shape-prim ((obj collide-shape-prim) (arg0 collide-shape-prim) (arg1 collide-overlap-result)) + "Should be impossible to call - collide-shape-prim is abstract." (format 0 "ERROR: collide-shape-prim::should-push-away-test was called illegally!~%") (none) ) -;; ERROR: function was not converted to expressions. Cannot decompile. +(defmethod should-push-away-test collide-shape-prim-group ((obj collide-shape-prim-group) (arg0 collide-shape-prim) (arg1 collide-overlap-result)) + "Update test for a group against an unknown prim. + The grouip prims use their collide with " + (local-vars (a1-3 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (nop!) + (let ((s4-0 (-> obj prims)) + (s3-0 (-> obj num-prims-u)) + ) + (nop!) + ;; very similar to compute-overlap. + ;; check collide-as/collide-with and solid + (let ((v1-0 (-> arg0 prim-core collide-as))) + (nop!) + (.lvf vf1 (&-> arg0 prim-core world-sphere quad)) + (label cfg-1) + (b! (zero? s3-0) cfg-6 :delay (nop!)) + (+! s3-0 -1) + (let ((a0-1 (-> s4-0 0))) + (set! s4-0 (&-> s4-0 1)) + (let ((a2-1 (-> a0-1 collide-with))) + (nop!) + (let* ((a1-1 (-> a0-1 prim-core action)) + (a2-2 (logand a2-1 v1-0)) + (a1-2 (logand a1-1 (collide-action solid))) + ) + ;; on reject, just move to the next thing in the group. + (b! (zero? a2-2) cfg-1 :delay (.lvf vf2 (&-> a0-1 prim-core world-sphere quad))) + (b! (zero? a1-2) cfg-1 :delay (nop!)) + ) + ) + ;; check bspheres + (.sub.vf vf3 vf2 vf1) + (.add.w.vf vf4 vf2 vf1 :mask #b1000) + (.mul.vf vf3 vf3 vf3 :mask #b111) + (.mul.w.vf vf4 vf4 vf4 :mask #b1000) + (.mul.x.vf acc vf0 vf3 :mask #b1000) + (.add.mul.y.vf acc vf0 vf3 acc :mask #b1000) + (.add.mul.z.vf vf3 vf0 vf3 acc :mask #b1000) + (.sub.w.vf vf3 vf3 vf4 :mask #b1000) + (let ((f0-0 0.0)) + (.add.w.vf vf3 vf0 vf3 :mask #b1) + (.mov a1-3 vf3) + (b! (<= f0-0 a1-3) cfg-1) + ) + ;; bspheres overlap, more accurate test is required. + (should-push-away-test a0-1 arg0 arg1) + ) + (set! v1-0 (-> arg0 prim-core collide-as)) + ) + ) + (b! #t cfg-1 :delay (.lvf vf1 (&-> arg0 prim-core world-sphere quad))) + (label cfg-6) + 0 + (none) + ) + ) -;; ERROR: function was not converted to expressions. Cannot decompile. +(defmethod should-push-away-reverse-test collide-shape-prim ((obj collide-shape-prim) (arg0 collide-shape-prim-group) (arg1 collide-overlap-result)) + "This is a flipped version of should-push-away-test. + the group uses their collide-as" + (local-vars (a0-3 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (nop!) + (let ((s4-0 (-> arg0 prims)) + (s3-0 (-> arg0 num-prims-u)) + ) + (nop!) + (let ((v1-0 (-> obj collide-with))) + (nop!) + (.lvf vf2 (&-> obj prim-core world-sphere quad)) + (label cfg-1) + (b! (zero? s3-0) cfg-6 :delay (nop!)) + (+! s3-0 -1) + (let ((a1-1 (-> s4-0 0))) + (set! s4-0 (&-> s4-0 1)) + (let ((a2-1 (-> a1-1 prim-core collide-as))) + (nop!) + (let* ((a0-1 (-> a1-1 prim-core action)) + (a2-2 (logand v1-0 a2-1)) + (a0-2 (logand a0-1 (collide-action solid))) + ) + (b! (zero? a2-2) cfg-1 :delay (.lvf vf1 (&-> a1-1 prim-core world-sphere quad))) + (b! (zero? a0-2) cfg-1 :delay (nop!)) + ) + ) + (.sub.vf vf3 vf2 vf1) + (.add.w.vf vf4 vf2 vf1 :mask #b1000) + (.mul.vf vf3 vf3 vf3 :mask #b111) + (.mul.w.vf vf4 vf4 vf4 :mask #b1000) + (.mul.x.vf acc vf0 vf3 :mask #b1000) + (.add.mul.y.vf acc vf0 vf3 acc :mask #b1000) + (.add.mul.z.vf vf3 vf0 vf3 acc :mask #b1000) + (.sub.w.vf vf3 vf3 vf4 :mask #b1000) + (let ((f0-0 0.0)) + (.add.w.vf vf3 vf0 vf3 :mask #b1) + (.mov a0-3 vf3) + (b! (<= f0-0 a0-3) cfg-1) + ) + (should-push-away-test obj a1-1 arg1) + ) + (set! v1-0 (-> obj collide-with)) + ) + ) + (b! #t cfg-1 :delay (.lvf vf2 (&-> obj prim-core world-sphere quad))) + (label cfg-6) + 0 + (none) + ) + ) -;; ERROR: function was not converted to expressions. Cannot decompile. +(defmethod should-push-away-test collide-shape-prim-mesh ((obj collide-shape-prim-mesh) (arg0 collide-shape-prim) (arg1 collide-overlap-result)) + "Collide a prim with a mesh. The prim must be a sphere or group of spheres" + + ;; first, check the prim type + (let ((v1-0 (-> arg0 prim-core prim-type))) + (b! (nonzero? v1-0) cfg-2 :delay (nop!)) + ;; if we got a group, recurse. + (should-push-away-reverse-test obj (the-as collide-shape-prim-group arg0) arg1) + (b! #t cfg-13 :delay (nop!)) + (label cfg-2) + ;; mesh to mesh. abort! + (b! (> v1-0 0) cfg-12 :delay (nop!)) + ) + (let ((s3-0 (-> obj mesh))) + ;; if we don't have a mesh, then abort. + (b! (not s3-0) cfg-11 :delay (nop!)) ;; empty-form + + ;; we must put the mesh in the cache before we can collide. + ;; NOTE: this is not the full collide-cache, but instead a smaller, simpler collide-mesh-cche. + (let ((s2-0 *collide-mesh-cache*)) + (let ((v1-4 (-> s2-0 id))) + ;; if we already got it, don't bother populating the cache again. + (b! (= (-> obj mesh-cache-id) v1-4) cfg-9 :delay (nop!)) + ) + ;; "allocate" triangles. + (let ((v1-8 (allocate! s2-0 (* 96 (-> s3-0 num-tris))))) + (b! (not v1-8) cfg-7 :delay (nop!)) + ;; remember that we got these triangles + (set! (-> obj mesh-cache-tris) (the-as (inline-array collide-mesh-cache-tri) v1-8)) + ) + ;; and remember the cache has this + (set! (-> obj mesh-cache-id) (-> s2-0 id)) + ) + + ;; load this mesh into the cache. + ;; strangely, they transform the entire mesh. + (populate-cache! + s3-0 + (the-as collide-mesh-cache-tri (-> obj mesh-cache-tris)) + (-> obj cshape process node-list data (-> obj transform-index) bone transform) + ) + (b! #t cfg-9 :delay (nop!)) + (label cfg-7) ;; cache failure abort + (b! #t cfg-14 :delay (nop!)) + (the-as none 0) + (label cfg-9) + ;; now, use the cache! + (let ((s2-1 (new 'stack-no-clear 'collide-tri-result))) + (let ((f0-1 (should-push-away-test + s3-0 + (the-as collide-mesh-cache-tri (-> obj mesh-cache-tris)) + s2-1 + (the-as vector (-> arg0 prim-core)) + (-> arg1 best-dist) + ) + ) + ) + ;; did we find something closer? + (b! (>= f0-1 (-> arg1 best-dist)) cfg-11 :delay #f) + ;; we did! + (set! (-> arg1 best-dist) f0-1) + ) + ;; remeber this triangle! + (set! (-> arg1 best-from-prim) obj) + (set! (-> arg1 best-to-prim) arg0) + (set! (-> arg1 best-from-tri vertex 0 quad) (-> s2-1 vertex 0 quad)) + (set! (-> arg1 best-from-tri vertex 1 quad) (-> s2-1 vertex 1 quad)) + (set! (-> arg1 best-from-tri vertex 2 quad) (-> s2-1 vertex 2 quad)) + (set! (-> arg1 best-from-tri intersect quad) (-> s2-1 intersect quad)) + (set! (-> arg1 best-from-tri normal quad) (-> s2-1 normal quad)) + (set! (-> arg1 best-from-tri pat) (-> s2-1 pat)) + ) + ) + (label cfg-11) + (b! #t cfg-13 :delay (nop!)) + (label cfg-12) + (format 0 "ERROR: Attempted unsupported mesh -> mesh test in collide-shape-prim::should-push-away-test!~%") + (label cfg-13) + 0 + (label cfg-14) + (none) + ) -;; ERROR: function was not converted to expressions. Cannot decompile. +(defmethod should-push-away-test collide-shape-prim-sphere ((obj collide-shape-prim-sphere) (arg0 collide-shape-prim) (arg1 collide-overlap-result)) + "The push away where we manually dispatch on the type of the second." + (local-vars (v1-3 float)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (let ((v1-0 (-> arg0 prim-core prim-type))) + (b! (nonzero? v1-0) cfg-2 :delay (nop!)) + ;; we're colliding with group, we've got a whole other function for that. + (should-push-away-reverse-test obj (the-as collide-shape-prim-group arg0) arg1) + (b! #t cfg-13 :delay (nop!)) + (label cfg-2) + (b! (> v1-0 0) cfg-5 :delay (nop!)) + ) + ;; if we're here, it's sphere->sphere. + (.lvf vf1 (&-> obj prim-core world-sphere quad)) + (.lvf vf2 (&-> arg0 prim-core world-sphere quad)) + (.sub.vf vf3 vf2 vf1 :mask #b111) + (.add.w.vf vf5 vf1 vf2 :mask #b1000) + (.mul.vf vf4 vf3 vf3 :mask #b111) + (.mul.x.vf acc vf0 vf4 :mask #b1000) + (.add.mul.y.vf acc vf0 vf4 acc :mask #b1000) + (.add.mul.z.vf vf4 vf0 vf4 acc :mask #b1000) + (.sqrt.vf Q vf4 :ftf #b11) + (.mov.vf vf3 vf0 :mask #b1000) + (.add.w.vf vf5 vf0 vf5 :mask #b1) + (let ((f2-0 (-> arg1 best-dist))) + (.wait.vf) + (nop!) + (.add.vf vf4 vf0 Q :mask #b1) + (.sub.x.vf vf6 vf4 vf5 :mask #b1) + (.mul.x.vf vf3 vf3 vf4 :mask #b111) + (.mov v1-3 vf6) + (let ((f1-0 v1-3)) + (b! (<= f2-0 f1-0) cfg-13) + (let ((v1-4 (-> obj pat))) + (set! (-> arg1 best-dist) f1-0) + (set! (-> arg1 best-from-prim) obj) + (set! (-> arg1 best-to-prim) arg0) + (.svf (&-> arg1 best-from-tri normal quad) vf3) + (set! (-> arg1 best-from-tri pat) v1-4) + ) + ) + ) + + ;; make up a triangle. + (let ((s4-1 (-> arg1 best-from-tri normal)) + (s3-0 (-> arg1 best-from-tri intersect)) + ) + (vector-float*! s3-0 s4-1 (-> obj prim-core world-sphere w)) + (vector+! s3-0 s3-0 (the-as vector (-> obj prim-core))) + (set! (-> arg1 best-from-tri vertex 0 quad) (-> s3-0 quad)) + (point-in-plane-<-point+normal! (-> arg1 best-from-tri vertex 1) s3-0 s4-1) + (let* ((v1-10 (vector-normalize! + (vector-! + (new 'stack-no-clear 'vector) + (-> arg1 best-from-tri vertex 1) + (the-as vector (-> arg1 best-from-tri)) + ) + 1.0 + ) + ) + (a2-4 (vector-cross! (new 'stack-no-clear 'vector) s4-1 v1-10)) + ) + (vector+*! (-> arg1 best-from-tri vertex 2) s3-0 a2-4 4096.0) + ) + ) + (b! #t cfg-13 :delay (nop!)) + + ;; Mesh. this is the same as the above function. start with populating the cache. + (label cfg-5) + (let ((s3-1 (-> (the-as collide-shape-prim-mesh arg0) mesh))) + (b! (not s3-1) cfg-13) + (let ((s2-0 *collide-mesh-cache*)) + (let ((v1-13 (-> s2-0 id))) + (b! (= (-> (the-as collide-shape-prim-mesh arg0) mesh-cache-id) v1-13) cfg-11) + ) + (let ((v1-17 (allocate! s2-0 (* 96 (-> s3-1 num-tris))))) + (b! (not v1-17) cfg-9 :delay (nop!)) + (set! (-> (the-as collide-shape-prim-mesh arg0) mesh-cache-tris) + (the-as (inline-array collide-mesh-cache-tri) v1-17) + ) + ) + (set! (-> (the-as collide-shape-prim-mesh arg0) mesh-cache-id) (-> s2-0 id)) + ) + (populate-cache! + s3-1 + (the-as collide-mesh-cache-tri (-> (the-as collide-shape-prim-mesh arg0) mesh-cache-tris)) + (-> (the-as collide-shape-prim-mesh arg0) + cshape + process + node-list + data + (-> (the-as collide-shape-prim-mesh arg0) transform-index) + bone + transform + ) + ) + (b! #t cfg-11 :delay (nop!)) + (label cfg-9) + (b! #t cfg-14 :delay (nop!)) + (the-as none 0) + (label cfg-11) + ;; do the collision + (let ((s2-1 (new 'stack-no-clear 'collide-tri-result))) + (let ((f0-2 (should-push-away-test + s3-1 + (the-as collide-mesh-cache-tri (-> (the-as collide-shape-prim-mesh arg0) mesh-cache-tris)) + s2-1 + (the-as vector (-> obj prim-core)) + (-> arg1 best-dist) + ) + ) + ) + (b! (>= f0-2 (-> arg1 best-dist)) cfg-13 :delay #f) + (set! (-> arg1 best-dist) f0-2) + ) + ;; but this time, we need a tri from the sphere. So make one up again. + (set! (-> arg1 best-from-prim) obj) + (set! (-> arg1 best-to-prim) arg0) + (let ((s4-2 (-> arg1 best-from-tri normal))) + (vector-! s4-2 (-> s2-1 intersect) (the-as vector (-> obj prim-core))) + (vector-normalize! s4-2 1.0) + (let ((s3-2 (-> arg1 best-from-tri intersect))) + (vector-float*! s3-2 s4-2 (-> obj prim-core world-sphere w)) + (vector+! s3-2 s3-2 (the-as vector (-> obj prim-core))) + (set! (-> arg1 best-from-tri vertex 0 quad) (-> s3-2 quad)) + (point-in-plane-<-point+normal! (-> arg1 best-from-tri vertex 1) s3-2 s4-2) + (let* ((v1-37 (vector-normalize! + (vector-! + (new 'stack-no-clear 'vector) + (-> arg1 best-from-tri vertex 1) + (the-as vector (-> arg1 best-from-tri)) + ) + 1.0 + ) + ) + (a2-11 (vector-cross! (new 'stack-no-clear 'vector) s4-2 v1-37)) + ) + (vector+*! (-> arg1 best-from-tri vertex 2) s3-2 a2-11 4096.0) + ) + ) + ) + ) + ) + (set! (-> arg1 best-from-tri pat) (-> obj pat)) + (label cfg-13) + 0 + (label cfg-14) + (none) + ) + ) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Moving Collision Resolutions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; These functions see if we canmove a given length in a given direction. +;; If not, they adjust the length so we are just touching, and add the prim to the touching list. + +;; these use the "offense". The offense of the thing in the cache must be higher. If the cache has 0, we reject always. +;; these use the "solid" bit of action. This must be set on both. (defmethod collide-with-collide-cache-prim-mesh collide-shape-prim ((obj collide-shape-prim) (arg0 collide-shape-intersect) (arg1 collide-cache-prim)) + "abstract base class version." (format 0 "ERROR: Unsupported prim type in collide-shape-prim::collide-with-collide-cache-prim-mesh!~%") (none) ) -;; ERROR: function was not converted to expressions. Cannot decompile. + +(defmethod collide-with-collide-cache-prim-mesh collide-shape-prim-sphere ((obj collide-shape-prim-sphere) (arg0 collide-shape-intersect) (arg1 collide-cache-prim)) + "Collide this sphere with the mesh in the real collide cache." + (local-vars (v1-4 collide-offense)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + ) + (let* ((s5-0 (new 'stack-no-clear 'collide-tri-result)) + ;; try to move the sphere by best-u. + (f0-1 (resolve-moving-sphere-tri + arg1 + s5-0 + (-> obj prim-core) + (-> arg0 move-vec) + (-> arg0 best-u) + (-> obj prim-core action) + ) + ) + ) + ;; did we hit something? + (when (>= f0-1 0.0) + ;; yup. + (let ((a2-2 (the-as collide-shape-prim #f))) + ;; not really sure why we do this, need to learn more about the stuff in the collide cache + (let ((a1-2 (-> arg1 prim-core prim-type)) + (a3-1 2) + (t0-1 (-> arg1 prim)) + (v1-3 0) + (a0-2 (-> arg1 prim-core offense)) + ) + (b! (!= a1-2 a3-1) cfg-3 :likely-delay (set! a2-2 t0-1)) + (label cfg-3) + (nop!) + (let ((a3-2 (-> obj prim-core offense))) + (nop!) + (let ((a1-3 (-> obj prim-core action))) + (nop!) + (let ((t0-2 (-> arg1 prim-core action))) + (b! (= a0-2 v1-3) cfg-7 :delay (set! v1-4 (- a3-2 a0-2))) + (let ((a1-4 (logand a1-3 t0-2)) + (a0-3 (-> s5-0 pat)) + ) + (let ((a1-5 (logand a1-4 (collide-action solid)))) + (.lvf vf1 (&-> s5-0 intersect quad)) + (b! (> (the-as int v1-4) 0) cfg-7 :delay (.lvf vf2 (&-> s5-0 normal quad))) + (b! (zero? a1-5) cfg-7 :delay (.lvf vf3 (&-> s5-0 vertex 0 quad))) + ) + (.lvf vf4 (&-> s5-0 vertex 1 quad)) + (.lvf vf5 (&-> s5-0 vertex 2 quad)) + ;; remember what we hit + (set! (-> arg0 best-u) f0-1) + (set! (-> arg0 best-to-prim) a2-2) + (set! (-> arg0 best-from-prim) obj) + (set! (-> arg0 best-tri pat) a0-3) + ) + ) + ) + ) + ) + ;; remember the tri + (.svf (&-> arg0 best-tri intersect quad) vf1) + (.svf (&-> arg0 best-tri normal quad) vf2) + (.svf (&-> arg0 best-tri vertex 0 quad) vf3) + (.svf (&-> arg0 best-tri vertex 1 quad) vf4) + (.svf (&-> arg0 best-tri vertex 2 quad) vf5) + (nop!) + (label cfg-7) + (b! (= a2-2 #f) cfg-9 :delay (nop!)) + ;; add prim to list. + (add-touching-prims *touching-list* obj a2-2 f0-1 (the-as collide-tri-result #f) s5-0) + ) + (label cfg-9) + 0 + ) + ) + 0 + (none) + ) + ) (defmethod collide-with-collide-cache-prim-mesh collide-shape-prim-mesh ((obj collide-shape-prim-mesh) (arg0 collide-shape-intersect) (arg1 collide-cache-prim)) (format 0 "ERROR: collide-shape-prim-mesh vs. collide-cache-prim mesh is not currently supported!~%") @@ -135,129 +679,181 @@ (none) ) -(defun find-ground-point ((arg0 control-info) (arg1 vector) (arg2 float) (arg3 float)) - (local-vars (sv-176 int) (sv-192 int)) - (let ((f30-1 (if (< 819.2 (vector-xz-length (-> arg0 transv))) - (vector-y-angle (-> arg0 transv)) - (y-angle arg0) - ) - ) - (s2-0 (-> arg0 trans)) - (s1-0 (new 'stack-no-clear 'vector)) - (s0-0 (new 'stack-no-clear 'collide-tri-result)) +;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Target Specific Stuff +;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; This implements the default collision reaction function. +;; This is a target-specific reaction. + + +(defun find-ground-point ((target-ctrl control-info) (ground-result vector) (start-len float) (max-len float)) + "Find somewhere safe to land. This is used to find where to bounce back the player if you jump on fire canyon. + It's a nice example function for the collision system." + (local-vars (direction-idx int) (sv-192 int)) + + ;; first, let's find our heading + (let ((current-heading (if (< 819.2 (vector-xz-length (-> target-ctrl transv))) ;; if we're moving in the xz plane + (vector-y-angle (-> target-ctrl transv)) ;; use the direction we're moving + (y-angle target-ctrl) ;; otherwise, use the direction we're facing. + ) + ) + ;; the current position of jak + (current-pos (-> target-ctrl trans)) + (probe-dir (new 'stack-no-clear 'vector)) + (result-tri (new 'stack-no-clear 'collide-tri-result)) ) - (let ((a1-1 (new 'stack-no-clear 'bounding-box))) - (set! (-> arg1 w) 0.0) + + ;; create a bounding box, centered around our current location. + (let ((bbox (new 'stack-no-clear 'bounding-box))) + (set! (-> ground-result w) 0.0) + ;; look at most max-len away from where we are.. (dotimes (v1-1 3) - (set! (-> a1-1 min data v1-1) (- (-> s2-0 data v1-1) arg3)) - (set! (-> a1-1 max data v1-1) (+ (-> s2-0 data v1-1) arg3)) + (set! (-> bbox min data v1-1) (- (-> current-pos data v1-1) max-len)) + (set! (-> bbox max data v1-1) (+ (-> current-pos data v1-1) max-len)) ) - (set! (-> a1-1 min y) (+ -40960.0 (-> s2-0 y))) - (set! (-> a1-1 max y) (+ 20480.0 (-> s2-0 y))) + ;; except for in y (height). Look 10m down, and 5m up. + (set! (-> bbox min y) (+ -40960.0 (-> current-pos y))) + (set! (-> bbox max y) (+ 20480.0 (-> current-pos y))) + + ;; fill the collide cache will all the triangles in bounding box. (fill-using-bounding-box *collide-cache* - a1-1 - (-> arg0 root-prim collide-with) - (-> arg0 process) + bbox + (-> target-ctrl root-prim collide-with) + (-> target-ctrl process) (new 'static 'pat-surface :skip #x1 :noentity #x1) ) ) - (set! sv-176 0) - (while (< sv-176 8) - (let ((f28-0 (+ f30-1 (if (zero? (logand sv-176 1)) - (* 8192.0 (the float (/ sv-176 2))) - (* -8192.0 (the float (/ sv-176 2))) - ) - ) - ) + + ;; loop over 8 directions to check. + (set! direction-idx 0) + (while (< direction-idx 8) + ;; this picks starts with the current direction, then a little to the left, then a little to the right, + ;; then a little more to the left.... so ideally we go in the direction the player is facing, if that's possible. + (let ((probe-heading (+ current-heading (if (zero? (logand direction-idx 1)) + (* 8192.0 (the float (/ direction-idx 2))) + (* -8192.0 (the float (/ direction-idx 2))) + ) + ) + ) ) + + ;; this will count the number of hits we have in this direction. (set! sv-192 0) - (let ((f26-0 arg3)) - (set-vector! s1-0 0.0 0.0 arg3 1.0) - (vector-rotate-y! s1-0 s1-0 f28-0) + + ;; we don't know anything, so assume we can go the maximum length in this direction + (let ((max-len-this-dir max-len)) + ;; but, if we did max-len bounce in this direction, we might hit some wall mid-bounce. + + ;; start with a probe of max len, pointing straight forward. + (set-vector! probe-dir 0.0 0.0 max-len 1.0) + ;; rotate to point along our heading + (vector-rotate-y! probe-dir probe-dir probe-heading) + + ;; see how far we can go, 10m above the current target. + ;; this is likely checking to see if we'll hit a wall mid-bounce (if (>= (probe-using-line-sphere *collide-cache* - (vector+! (new 'stack-no-clear 'vector) s2-0 (new 'static 'vector :y 20480.0 :w 1.0)) - s1-0 + (vector+! (new 'stack-no-clear 'vector) current-pos (new 'static 'vector :y 20480.0 :w 1.0)) + probe-dir 2048.0 - (-> arg0 root-prim collide-with) - s0-0 + (-> target-ctrl root-prim collide-with) + result-tri 1 ) 0.0 ) - (set! f26-0 (+ -6144.0 (vector-vector-xz-distance s2-0 (-> s0-0 intersect)))) + (set! max-len-this-dir (+ -6144.0 (vector-vector-xz-distance current-pos (-> result-tri intersect)))) ) - (let ((f24-0 arg2)) - (while (>= f26-0 f24-0) - (set-vector! s1-0 0.0 0.0 f24-0 1.0) - (vector-rotate-y! s1-0 s1-0 f28-0) - (vector+! s1-0 s2-0 s1-0) - (set! (-> s1-0 y) (+ 20480.0 (-> s2-0 y))) + + ;; now, let's search between start-len and max-len-this-dir to see if there's somewhere safe to bounce. + (let ((current-len start-len)) + (while (>= max-len-this-dir current-len) + ;; probe heading + (set-vector! probe-dir 0.0 0.0 current-len 1.0) + (vector-rotate-y! probe-dir probe-dir probe-heading) + + ;; put probe dir at the end of the probe + (vector+! probe-dir current-pos probe-dir) + ;; start 10m above the curren pos. + (set! (-> probe-dir y) (+ 20480.0 (-> current-pos y))) + ;; and probe straight down, to find the first ground after a 10m jump. (when (>= (probe-using-line-sphere *collide-cache* - s1-0 + probe-dir (new 'static 'vector :y -251658240.0 :w 1.0) 10240.0 - (-> arg0 root-prim collide-with) - s0-0 + (-> target-ctrl root-prim collide-with) + result-tri 1 ) 0.0 ) (cond - ((and (= (-> s0-0 pat mode) (pat-mode ground)) - (= (-> s0-0 pat event) (pat-event none)) - (< 0.7 (-> s0-0 normal y)) + ((and (= (-> result-tri pat mode) (pat-mode ground)) ;; we found ground + (= (-> result-tri pat event) (pat-event none)) ;; and it's not more dangerous ground + (< 0.7 (-> result-tri normal y)) ;; and it's pretty flat ) - (set! (-> arg1 quad) (-> s0-0 intersect quad)) + (set! (-> ground-result quad) (-> result-tri intersect quad)) ;; remember it + ;; count this as a success (set! sv-192 (+ sv-192 1)) + ;; if we get 2 or more hits, it seems like a good place to land, let's do it! (if (>= sv-192 2) - (return arg1) + (return ground-result) ) ) - ((and (= (-> s0-0 pat mode) (pat-mode wall)) (< (+ 4096.0 (-> s2-0 y)) (-> s0-0 intersect y))) + ((and (= (-> result-tri pat mode) (pat-mode wall)) (< (+ 4096.0 (-> current-pos y)) (-> result-tri intersect y))) + ;; give up on this direction. There's a wall in the way (missed by the earlier fast wall check) (goto cfg-35) ) ) ) - (set! f24-0 (+ 4096.0 f24-0)) + ;; move 1m out more. + (set! current-len (+ 4096.0 current-len)) ) ) ) ) (label cfg-35) - (set! sv-176 (+ sv-176 1)) + (set! direction-idx (+ direction-idx 1)) ) ) (the-as vector #f) ) (defun target-attack-up ((arg0 target) (arg1 symbol) (arg2 symbol)) + "Handle an attack up. This launches the player in the air, forcing them back to a safe location." (with-pp + ;; attempt to find a safe ground. (let ((s4-0 (find-ground-point (-> arg0 control) (new 'stack-no-clear 'vector) 8192.0 40960.0))) (set! s4-0 (cond - (s4-0 - (empty) + (s4-0 ;; if we found it, use that s4-0 ) (else - (-> arg0 control unknown-vector54) + ;; failed to find it. Use the last known safe ground point instaed. + (-> arg0 control last-known-safe-ground) ) ) ) - (let* ((s2-1 (vector-! (new 'stack-no-clear 'vector) s4-0 (-> arg0 control trans))) - (f30-1 (fmax 8192.0 (fmin 40960.0 (vector-xz-length s2-1)))) + (let* ((s2-1 (vector-! (new 'stack-no-clear 'vector) s4-0 (-> arg0 control trans))) ;; jump direction + (f30-1 (fmax 8192.0 (fmin 40960.0 (vector-xz-length s2-1)))) ;; distance we should jump (limited) ) + ;; note: the above limit is the same as the limit passed into find-ground-point. So the limiting should only kick in + ;; if we use last safe ground. (cond ((< (fabs (vector-dot - (-> arg0 control dynam gravity-normal) - (vector-! (new 'stack-no-clear 'vector) s4-0 (-> arg0 control trans)) - ) - ) + (-> arg0 control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) s4-0 (-> arg0 control trans)) + ) + ) 40960.0 ) + ;; if we reach here, we have to jump up or down less than 10m. + ;; reduce our jump direction to within reasonable distance (vector-xz-normalize! s2-1 f30-1) + ;; send an attack (let ((s1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> s1-0 from) pp) (set! (-> s1-0 num-params) 2) @@ -265,17 +861,22 @@ (set! (-> s1-0 param 0) (the-as uint #f)) (let ((s3-1 (new 'static 'attack-info :mask #x8a2))) (set! (-> s3-1 mode) arg2) + ;; go in the direction we determined. (set! (-> s3-1 vector quad) (-> s2-1 quad)) + ;; the shove is proportional to how high we jump (and has a min, so we at least get off the ground) (set! (-> s3-1 shove-up) (+ (lerp-scale 4096.0 16384.0 f30-1 4096.0 40960.0) (fmax 0.0 (- (-> s4-0 y) (-> arg0 control trans y)))) ) (set! (-> s3-1 angle) 'up) (set! (-> s1-0 param 1) (the-as uint s3-1)) ) + ;; shove! (send-event-function arg0 s1-0) ) ) (else + ;; the last safest place we jumped is too high. just launch jak in the air and hope for the best. + ;; fire canyon skip jumps (let ((a1-6 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-6 from) pp) (set! (-> a1-6 num-params) 2) @@ -283,12 +884,7 @@ (set! (-> a1-6 param 0) (the-as uint #f)) (let ((v1-12 (new 'static 'attack-info :mask #xca2))) (set! (-> v1-12 mode) arg2) - (set! (-> v1-12 vector quad) - (-> (new 'static 'attack-info :trans (new 'static 'vector :y 40960.0 :w 1.0) :speed (the-as float #x1)) - trans - quad - ) - ) + (set! (-> v1-12 vector quad) (-> (new 'static 'vector :y 40960.0 :w 1.0) quad)) (set! (-> v1-12 shove-up) 40960.0) (set! (-> v1-12 angle) 'up) (set! (-> v1-12 control) 1.0) @@ -305,9 +901,12 @@ ) (defmethod set-and-handle-pat! collide-shape-moving ((obj collide-shape-moving) (arg0 pat-surface)) + "Handle landing on the given pat-surface. This is likely target-specific." (with-pp + ;; set our pat (set! (-> obj cur-pat) arg0) (set! (-> obj poly-pat) arg0) + ;; set our surface (case (-> arg0 material) (((pat-material ice)) (set! (-> obj surf) *ice-surface*) @@ -325,12 +924,16 @@ (set! (-> obj surf) *standard-ground-surface*) ) ) + + ;; ca-9 gets set whenever you get on the zoomer. If we are on the zoomer, just go to "race-track" (if (logtest? (-> obj root-prim prim-core action) (collide-action ca-9)) (set! (-> obj surf) *race-track-surface*) ) + (when (nonzero? (-> arg0 event)) (case (-> arg0 event) (((pat-event deadly)) + ;; deadly. Send a deadly event (let ((a1-3 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-3 from) pp) (set! (-> a1-3 num-params) 2) @@ -345,6 +948,7 @@ ) ) (((pat-event burn)) + ;; burn. Send a burn event (let ((a1-6 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-6 from) pp) (set! (-> a1-6 num-params) 2) @@ -359,16 +963,18 @@ ) ) (((pat-event deadlyup)) + ;; deadlyup. Launch! (target-attack-up (the-as target (-> obj process)) 'attack-or-shove 'deadlyup) ) (((pat-event burnup)) - (if (zero? - (logand (-> (the-as target (-> obj process)) control root-prim prim-core action) (collide-action ca-9)) - ) + ;; burnup (like fire canyon lava). + ;; only send if we don't have ca-9 (on zoomer) + (if (zero? (logand (-> (the-as target (-> obj process)) control root-prim prim-core action) (collide-action ca-9))) (target-attack-up (the-as target (-> obj process)) 'attack-or-shove 'burnup) ) ) (((pat-event melt)) + ;; just send melt (let ((a1-15 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-15 from) pp) (set! (-> a1-15 num-params) 2) @@ -382,6 +988,7 @@ ) ) (((pat-event endlessfall)) + ;; endless pit death plane. (let ((a1-17 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-17 from) pp) (set! (-> a1-17 num-params) 2) @@ -402,16 +1009,22 @@ ) (defun default-collision-reaction ((arg0 collide-shape-moving) (arg1 collide-shape-intersect) (arg2 vector) (arg3 vector)) + "Move into collision!" (local-vars (sv-64 vector) (sv-68 vector) (sv-72 vector) (sv-80 int) (sv-128 symbol)) (set! sv-64 (new-stack-vector0)) (set! sv-68 (new-stack-vector0)) (set! sv-72 (new 'stack-no-clear 'vector)) (set! sv-80 0) (set! (-> sv-72 quad) (-> arg3 quad)) + + ;; move along the vector by the best move-vec + ;; this will hit the best-tri (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) ) + + ;; so handle hitting that tri (set-and-handle-pat! arg0 (-> arg1 best-tri pat)) (vector-! sv-64 (the-as vector (-> arg1 best-from-prim prim-core)) (-> arg1 best-tri intersect)) (set! (-> sv-64 w) 1.0) @@ -420,9 +1033,12 @@ (let ((v1-16 (-> sv-64 quad))) (set! (-> sv-68 quad) v1-16) ) + ;; ? (if (= (-> arg1 best-u) 0.0) - (TODO-RENAME-28 arg0 sv-68) + (move-by-vector! arg0 sv-68) ) + + ;; (set! (-> arg0 surface-normal quad) (-> sv-68 quad)) (set! (-> arg0 poly-normal quad) (-> arg1 best-tri normal quad)) (set! (-> arg0 surface-angle) (vector-dot sv-68 (-> arg0 dynam gravity-normal))) @@ -435,6 +1051,7 @@ ) (set! sv-128 (< (fabs (-> arg0 surface-angle)) (-> *pat-mode-info* (-> arg0 cur-pat mode) wall-angle))) (when (zero? (logand (-> arg0 prev-status) 1)) + ;; hit the ground! (set! (-> arg0 ground-impact-vel) (- (vector-dot (-> arg0 transv) (-> arg0 dynam gravity-normal)))) (when (not sv-128) (let ((f30-0 (- 1.0 (-> arg0 surf impact-fric)))) @@ -461,17 +1078,18 @@ ) ) ) + ;; set t-surf (touching a surface) (set! sv-80 (logior sv-80 4)) (if (-> arg1 best-to-prim) - (set! sv-80 (logior sv-80 32)) + (set! sv-80 (logior sv-80 32)) ;; t-ceil. not sure why this is the case. ) (cond (sv-128 - (set! sv-80 (logior sv-80 8)) + (set! sv-80 (logior sv-80 8)) ;; using it as a wall (set! (-> arg0 cur-pat mode) 1) ) (else - (set! sv-80 (logior sv-80 1)) + (set! sv-80 (logior sv-80 1)) ;; on. (set! (-> arg0 local-normal quad) (-> sv-68 quad)) ) ) @@ -490,14 +1108,17 @@ ) (defun simple-collision-reaction ((arg0 collide-shape-moving) (arg1 collide-shape-intersect)) + "A much simpler collide reaction." (let ((s5-0 0)) (let ((a1-1 (new 'stack-no-clear 'vector))) + ;; move by the amount we should. (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)) ) + ;; bounce off (vector-float*! v1-6 (-> arg1 best-tri normal) (* 1.5 f0-2)) (vector-! (-> arg0 transv) (-> arg0 transv) v1-6) ) @@ -508,21 +1129,33 @@ (none) ) -(defmethod dummy-63 collide-shape-moving ((obj collide-shape-moving) (arg0 vector) (arg1 vector) (arg2 float)) +(defmethod step-collison! collide-shape-moving ((obj collide-shape-moving) (arg0 vector) (arg1 vector) (arg2 float)) + "Take 1 step in the collision. Attempt to move at velocity of arg1, for arg2 of a step. + The resulting velocity is stored in arg0. The amount of a step actually taken is returned." + (local-vars (sv-192 int)) (let ((s5-0 (new 'stack 'collide-shape-intersect)) (s2-0 (new 'stack-no-clear 'vector)) ) + + ;; integrate our velocity, get the "move vector" + ;; which is what we'd move if we hit nothing. (vector-float*! s2-0 arg1 (* arg2 (-> *display* seconds-per-frame))) + + ;; initialize the collision data. (init! s5-0 s2-0) + + ;; only if we have something in the collide cache, I guess. (let* ((s1-1 (-> obj root-prim)) (v1-4 *collide-cache*) (s0-0 (the-as collide-cache-prim (-> v1-4 prims))) ) (set! sv-192 (-> v1-4 num-prims)) + ;; collide with everything in the collide cache. (while (nonzero? sv-192) (set! sv-192 (+ sv-192 -1)) (when (logtest? (-> s1-1 collide-with) (-> s0-0 prim-core collide-as)) + ;; pick between sphere and mesh. (if (>= (-> s0-0 prim-core prim-type) 0) (collide-with-collide-cache-prim-mesh s1-1 s5-0 s0-0) (collide-with-collide-cache-prim-sphere s1-1 s5-0 s0-0) @@ -531,14 +1164,22 @@ (set! s0-0 (-> (the-as (inline-array collide-cache-prim) s0-0) 1)) ) ) + + ;; now we've collided with everything. If we have a best-u of > 0, it means we can't do the full move. (let ((f30-0 (-> s5-0 best-u))) (cond ((>= f30-0 0.0) (let ((s2-1 (new 'stack-no-clear 'vector))) + + ;; if debugging, remember our input velocity. (if *display-collision-marks* (set! (-> s2-1 quad) (-> arg1 quad)) ) + + ;; do the collision reaction! this function should move the collide shape. (set! (-> obj prev-status) (the-as uint ((-> obj reaction) obj s5-0 arg0 arg1))) + + ;; debug draw collision marks. (when *display-collision-marks* (let ((t1-0 (-> *pat-mode-info* (-> s5-0 best-tri pat mode) hilite-color))) (add-debug-outline-triangle @@ -578,31 +1219,37 @@ ) ) ) + + ;; and return the step size we could take. (return f30-0) ) (else + ;; didn't hit anything! call the no-reaction function. (set! (-> obj reaction-flag) (the-as uint 0)) ((-> obj no-reaction) obj s5-0 arg0 arg1) (set! (-> obj prev-status) (the-as uint 0)) - (TODO-RENAME-28 obj s2-0) + ;; and do the move ourself + (move-by-vector! obj s2-0) + ;; velocity is unchanged (set! (-> arg0 quad) (-> arg1 quad)) + ;; moved the whole way! (return 1.0) ) ) ) ) - (the-as none 0) - (the-as float 1.0) + 1.0 ) -(defmethod dummy-37 collide-shape ((obj collide-shape) (arg0 vector)) +(defmethod integrate-and-collide! collide-shape ((obj collide-shape) (arg0 vector)) + "For a non-moving collide shape, we just move ourself. We have no reaction to anything we hit." (local-vars (at-0 int)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) ) (init-vf0-vector) - (let ((t9-0 (method-of-object obj TODO-RENAME-28)) + (let ((t9-0 (method-of-object obj move-by-vector!)) (v1-1 (new 'stack-no-clear 'vector)) ) (.lvf vf1 (&-> arg0 quad)) @@ -619,29 +1266,44 @@ ) ) -(defmethod dummy-37 collide-shape-moving ((obj collide-shape-moving) (arg0 vector)) - (dummy-47 obj) +(defmethod integrate-and-collide! collide-shape-moving ((obj collide-shape-moving) (arg0 vector)) + "Integrate forward, with collisions and collision responses. + This will adjust our velocity based on collision. + It will process updates from hitting triangles with pat-surfaces + It will update the touching list. + It will update the current surface and surface flags." + + ;; update the world-spheres for us and our children. + (update-transforms! obj) + + ;; remember our history (set! (-> obj trans-old 2 quad) (-> obj trans-old 1 quad)) (set! (-> obj trans-old 1 quad) (-> obj trans-old 0 quad)) (set! (-> obj trans-old 0 quad) (-> obj trans quad)) (set! (-> obj prev-status) (-> obj status)) + + ;; setup (set! (-> obj status) (logand -16128 (-> obj status))) (set! (-> obj local-normal quad) (-> obj dynam gravity-normal quad)) (set! (-> obj surface-normal quad) (-> obj dynam gravity-normal quad)) (set! (-> obj poly-normal quad) (-> obj dynam gravity-normal quad)) (set! (-> obj coverage) 0.0) (set! (-> obj touch-angle) 0.0) + + ;; we want to take a step of 1.0 (let ((f30-0 1.0) - (s4-0 0) + (s4-0 0) ;; iterations ) - (while (and (< 0.05 f30-0) (and - (< s4-0 (the-as int (-> obj max-iteration-count))) - (not (and (= (-> arg0 x) 0.0) (= (-> arg0 y) 0.0) (= (-> arg0 z) 0.0))) - ) + (while (and (< 0.05 f30-0) ;; at least 5% left + (and (< s4-0 (the-as int (-> obj max-iteration-count))) ;; iterations left + (not (and (= (-> arg0 x) 0.0) (= (-> arg0 y) 0.0) (= (-> arg0 z) 0.0))) ;; nonzero velocity + ) ) - (let ((f28-0 (dummy-63 obj arg0 arg0 f30-0))) - (dummy-11 *touching-list* f28-0) - (set! f30-0 (- f30-0 (* f28-0 f30-0))) + + ;; note that in between step-collision! and update-from-step-szie, the touching list is in an invalid state. + (let ((f28-0 (step-collison! obj arg0 arg0 f30-0))) ;; step forward! + (update-from-step-size *touching-list* f28-0) ;; update touching list. + (set! f30-0 (- f30-0 (* f28-0 f30-0))) ;; advance the fraction of the remaining step. ) (+! s4-0 1) ) @@ -650,12 +1312,18 @@ (none) ) -(defmethod dummy-37 control-info ((obj control-info) (arg0 vector)) +(defmethod integrate-and-collide! control-info ((obj control-info) (arg0 vector)) + "Specialization of integrate and collide for the target" + ;; time it (stopwatch-start (-> *collide-stats* total-target)) + + ;; check and correct massive velocity. (when (< 1638400.0 (vector-length arg0)) (format 0 "WARNING: target vel is ~M m/s, reseting to zero.~%" (vector-length arg0)) (vector-reset! arg0) ) + + ;; ??? (set! (-> obj unknown-vector15 quad) (-> obj unknown-vector14 quad)) (vector-matrix*! (-> obj unknown-vector14) (-> obj unknown-vector13) (-> obj unknown-matrix02)) (vector-! (-> obj unknown-vector16) (-> obj unknown-vector14) (-> obj unknown-vector15)) @@ -666,7 +1334,9 @@ (s4-1 (new 'stack-no-clear 'vector)) ) (set! (-> s4-1 quad) (-> arg0 quad)) - (let ((t9-7 (method-of-type collide-shape-moving dummy-37))) + + ;; call the normal integrate. + (let ((t9-7 (method-of-type collide-shape-moving integrate-and-collide!))) (t9-7 obj s3-1) ) (let ((s1-0 (new-stack-vector0))) @@ -738,10 +1408,9 @@ (set! (-> arg0 quad) (-> s3-1 quad)) (vector--float*! arg0 s3-1 (-> obj unknown-vector16) 60.0) ) - (if (and - (logtest? (-> obj status) 1) - (and (zero? (logand (-> obj status) 520)) (< (vector-length (-> obj unknown-vector61)) (vector-length s4-1))) - ) + (if (and (logtest? (-> obj status) 1) + (and (zero? (logand (-> obj status) 520)) (< (vector-length (-> obj unknown-vector61)) (vector-length s4-1))) + ) (set! (-> obj unknown-vector61 quad) (-> s4-1 quad)) ) ) @@ -759,8 +1428,14 @@ (none) ) -(defmethod TODO-RENAME-61 collide-shape-moving ((obj collide-shape-moving) (arg0 vector) (arg1 vector) (arg2 vector)) - (TODO-RENAME-30 obj arg0) + +(defmethod move-to-ground-point! collide-shape-moving ((obj collide-shape-moving) (arg0 vector) (arg1 vector) (arg2 vector)) + "Move the collide shape to the ground immediately: + arg0: ground point + arg1: velocity (will be modified) + arg2: ground normal. + Even if the ground is sloped, transv.y is set to 0." + (move-to-point! obj arg0) (set! (-> arg1 y) 0.0) (logior! (-> obj status) 7) (set! (-> obj poly-normal quad) (-> arg2 quad)) @@ -773,14 +1448,16 @@ (none) ) -(defmethod dummy-57 collide-shape-moving ((obj collide-shape-moving) (arg0 vector)) +(defmethod integrate-no-collide! collide-shape-moving ((obj collide-shape-moving) (arg0 vector)) + "Integrate, but ignore all collisions. + Will set both trans and shadow-pos" (local-vars (at-0 int)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) ) (init-vf0-vector) - (dummy-47 obj) + (update-transforms! obj) (set! (-> obj trans-old 2 quad) (-> obj trans-old 1 quad)) (set! (-> obj trans-old 1 quad) (-> obj trans-old 0 quad)) (set! (-> obj trans-old 0 quad) (-> obj trans quad)) @@ -792,7 +1469,7 @@ (set! (-> obj coverage) 0.0) (set! (-> obj touch-angle) 0.0) (let* ((a0-12 obj) - (t9-1 (method-of-object a0-12 TODO-RENAME-28)) + (t9-1 (method-of-object a0-12 move-by-vector!)) (a1-1 (new 'stack-no-clear 'vector)) ) (.lvf vf1 (&-> arg0 quad)) @@ -812,20 +1489,22 @@ ) (defmethod dummy-58 collide-shape-moving ((obj collide-shape-moving) (arg0 vector)) - (dummy-57 obj arg0) - (let ((a1-1 (new 'stack-no-clear 'touching-shapes-entry))) - (set! (-> a1-1 cshape1) (the-as collide-shape 1)) - (set! (-> a1-1 cshape2) (the-as collide-shape *touching-list*)) - (when (dummy-40 obj a1-1) - (TODO-RENAME-30 obj (the-as vector (-> obj trans-old))) + ;; not sure yet. moves shadow-pos, but possibly not trans. + (integrate-no-collide! obj arg0) + (let ((a1-1 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-1 options) (the-as uint 1)) + (set! (-> a1-1 tlist) *touching-list*) + (when (find-overlapping-shapes obj a1-1) + (move-to-point! obj (the-as vector (-> obj trans-old))) (return #t) ) ) #f ) -(defmethod dummy-64 collide-shape-moving ((obj collide-shape-moving) (arg0 collide-tri-result) (arg1 vector)) - (TODO-RENAME-30 obj arg1) +(defmethod move-to-tri! collide-shape-moving ((obj collide-shape-moving) (arg0 collide-tri-result) (arg1 vector)) + "Move us to tri arg0, at point arg1." + (move-to-point! obj arg1) (logior! (-> obj status) 7) (let ((v1-4 (-> arg0 normal))) (set! (-> obj poly-normal quad) (-> v1-4 quad)) @@ -842,7 +1521,21 @@ ) ;; WARN: Stack slot offset 128 signed mismatch -(defmethod dummy-59 collide-shape-moving ((obj collide-shape-moving) (arg0 vector) (arg1 uint) (arg2 float) (arg3 symbol) (arg4 symbol) (arg5 symbol)) +(defmethod integrate-for-enemy-with-move-to-ground! collide-shape-moving ((obj collide-shape-moving) + (arg0 vector) + (arg1 collide-kind) + (arg2 float) + (arg3 symbol) + (arg4 symbol) + (arg5 symbol) + ) + "This is likely the main method for stepping an enemy. + arg0: velocity + arg1: ground collision + arg2: ground height probe start + arg3: revert move if blocked + arg4: hover if ran off the ground + arg5: use misty hack" (local-vars (sv-128 float) (sv-144 collide-tri-result)) (set! sv-128 arg2) (let ((s5-0 arg3)) @@ -856,20 +1549,24 @@ (new 'static 'rgba :r #x40 :b #x40 :a #x80) ) ) - (dummy-57 obj arg0) + ;; move us forward! + (integrate-no-collide! obj arg0) + ;; set our position to shadow (not sure why) (let ((s0-0 (-> obj shadow-pos))) (set! (-> s0-0 quad) (-> obj trans quad)) (set! sv-144 (new 'stack-no-clear 'collide-tri-result)) + ;; move off the ground by the given height probe offset (+! (-> s0-0 y) sv-128) 0.0 + ;; probe the ground! (let ((f0-4 (if s1-0 (misty-ambush-height-probe s0-0 81920.0) (fill-and-probe-using-line-sphere *collide-cache* s0-0 - (new 'static 'vector :y -81920.0 :w 1.0) + (new 'static 'vector :y -81920.0 :w 1.0) ;; probe down. 40.96 - (the-as collide-kind arg1) + arg1 (-> obj process) sv-144 1 @@ -879,29 +1576,39 @@ ) (cond ((>= f0-4 0.0) + ;; found the ground! (let ((a2-3 (new 'static 'vector :y -81920.0 :w 1.0))) + ;; set s0-0 to the ground. (vector+float*! s0-0 s0-0 a2-3 f0-4) ) (when (>= (-> s0-0 y) (-> obj trans y)) - (dummy-64 obj sv-144 s0-0) + ;; we're in the ground, move us out of the ground. + (move-to-tri! obj sv-144 s0-0) + ;; remember how hard we hit (set! (-> obj ground-impact-vel) (- (vector-dot arg0 (-> obj dynam gravity-normal)))) + ;; and kill our vertical velocity. (set! (-> arg0 y) 0.0) ) ) (s3-0 + ;; no ground. if the hover flag is set, we just hover. (set! (-> obj trans y) (-> obj trans-old 0 y)) ) ) ) ) ) + + ;; if we need to collide with things. (when (logtest? (-> obj root-prim collide-with) (collide-kind cak-1 cak-2 cak-3 target)) - (let ((a1-7 (new 'stack-no-clear 'touching-shapes-entry))) - (set! (-> a1-7 cshape1) (the-as collide-shape 1)) - (set! (-> a1-7 cshape2) (the-as collide-shape *touching-list*)) - (when (dummy-40 obj a1-7) + (let ((a1-7 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-7 options) (the-as uint 1)) + (set! (-> a1-7 tlist) *touching-list*) + ;; compute overlaps. + (when (find-overlapping-shapes obj a1-7) + ;; if we have the revert move if blocked, go back to our old point. (if s5-0 - (TODO-RENAME-30 obj (the-as vector (-> obj trans-old))) + (move-to-point! obj (the-as vector (-> obj trans-old))) ) ) ) @@ -918,7 +1625,8 @@ (none) ) -(defmethod dummy-60 collide-shape-moving ((obj collide-shape-moving) (arg0 float) (arg1 float) (arg2 symbol) (arg3 collide-kind)) +(defmethod move-to-ground collide-shape-moving ((obj collide-shape-moving) (arg0 float) (arg1 float) (arg2 symbol) (arg3 collide-kind)) + "Move to the ground now." (if *debug-segment* (add-frame (-> *display* frames (-> *display* on-screen) frame profile-bar 0) @@ -933,12 +1641,11 @@ (set! (-> s4-0 quad) (-> obj trans quad)) (+! (-> s4-0 y) arg0) 0.0 + ;; find the ground (let ((f0-4 (fill-and-probe-using-y-probe *collide-cache* s4-0 f30-0 arg3 (-> obj process) s3-0 (the-as uint 1)))) (when (< f0-4 0.0) (if arg2 - (format - 0 - "WARNING: move-to-ground: (~f ~f) failed to locate ground [~S type ~S]~%" + (format 0 "WARNING: move-to-ground: (~f ~f) failed to locate ground [~S type ~S]~%" (* 0.00024414062 (-> s4-0 y)) (* 0.00024414062 f30-0) (-> obj process name) @@ -947,11 +1654,14 @@ ) (return #f) ) + ;; calulate the ground position. (set! (-> s4-0 y) (- (-> s4-0 y) (* f0-4 f30-0))) ) ) + ;; move our shadow there too (set! (-> obj shadow-pos quad) (-> s4-0 quad)) - (dummy-64 obj s3-0 s4-0) + ;; and move us there! + (move-to-tri! obj s3-0 s4-0) ) (if *debug-segment* (add-frame @@ -963,11 +1673,14 @@ #t ) -(defmethod dummy-62 collide-shape-moving ((obj collide-shape-moving) (arg0 vector) (arg1 float)) - (let* ((s4-0 (vector-negate! (new-stack-vector0) (-> obj dynam gravity))) +(defmethod compute-acc-due-to-gravity collide-shape-moving ((obj collide-shape-moving) (arg0 vector) (arg1 float)) + "Compute the acceleration due to gravity." + (let* ((s4-0 (vector-negate! (new-stack-vector0) (-> obj dynam gravity))) ;; this is the acceleration from gravity. (a2-1 (-> obj local-normal)) - (a2-2 (vector-reflect-flat! (new-stack-vector0) s4-0 a2-1)) + (a2-2 (vector-reflect-flat! (new-stack-vector0) s4-0 a2-1)) ;; figure out the accleration from sliding down a sloped wall. ) + ;; apply that. note that we scale the slopiness by arg1 + ;; (this is not really how things work.) (vector--float*! arg0 s4-0 a2-2 (cond ((logtest? (-> obj status) 1) (empty) @@ -982,49 +1695,61 @@ arg0 ) -(defmethod dummy-33 collide-shape ((obj collide-shape) (arg0 vector) (arg1 collide-kind)) +(defmethod fill-cache-integrate-and-collide! collide-shape ((obj collide-shape) (arg0 vector) (arg1 collide-kind)) + "Fill the collide cache for the object, integrate, and handle collisions!" (local-vars (at-0 int)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) ) - (init-vf0-vector) - (let ((a0-1 (new 'stack-no-clear 'vector))) - (let ((v1-0 a0-1)) - (.lvf vf1 (&-> arg0 quad)) - (let ((f0-0 (-> *display* seconds-per-frame))) - (.mov at-0 f0-0) - ) - (.mov vf2 at-0) - (.mov.vf vf1 vf0 :mask #b1000) - (.mul.x.vf vf1 vf1 vf2 :mask #b111) - (.svf (&-> v1-0 quad) vf1) - ) - (let ((f0-2 (+ (vector-length a0-1) (if (= (-> obj process type) target) - 4096.0 - 0.0 - ) - ) - ) + (init-vf0-vector) + + ;; scale the velocity, to see how far we can go, at max. + (let ((a0-1 (new 'stack-no-clear 'vector))) + (let ((v1-0 a0-1)) + (.lvf vf1 (&-> arg0 quad)) + (let ((f0-0 (-> *display* seconds-per-frame))) + (.mov at-0 f0-0) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-0 quad) vf1) ) - (dummy-32 obj f0-2 arg1) + + ;; add a bonus size if we are target. + (let ((f0-2 (+ (vector-length a0-1) + (if (= (-> obj process type) target) + 4096.0 + 0.0 + ) + ) + ) + ) + ;; and now fill the cache with all things we could hit + (fill-cache-for-shape! obj f0-2 arg1) + ) + ) + ;; do the integration, colliding with stuff in the cache. + (integrate-and-collide! obj arg0) + (none) ) - ) - (dummy-37 obj arg0) - (none) - ) ) -(defmethod dummy-32 collide-shape ((obj collide-shape) (arg0 object) (arg1 collide-kind)) +(defmethod fill-cache-for-shape! collide-shape ((obj collide-shape) (arg0 float) (arg1 collide-kind)) + "Fill cache for a box." (let ((s5-0 (new 'stack-no-clear 'bounding-box))) (cond - ((dummy-36 obj s5-0 (the-as float arg0) arg1) + ((build-bounding-box-for-shape obj s5-0 arg0 arg1) ;; <- this generates the box + ;; fill with the gox (fill-using-bounding-box *collide-cache* s5-0 arg1 (-> obj process) (-> obj pat-ignore-mask)) + ;; only draw collide cache, if we're the target (if (and *display-collide-cache* (= (-> obj process type) target)) - (dummy-9 *collide-cache*) + (debug-draw *collide-cache*) ) ) (else + ;; no need. the cache can be empty. (initialize *collide-cache*) ) ) @@ -1032,7 +1757,39 @@ (none) ) -(defmethod dummy-36 collide-shape ((obj collide-shape) (arg0 bounding-box) (arg1 float) (arg2 collide-kind)) +;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; bounding box of shape +;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; NOTE: these functions don't obey calling conventions, so they are modified for the PC port. +(deftype pc-bounding-box-work (structure) + ((reg-vf29 vector :inline) + (reg-vf30 vector :inline) + (reg-vf31 vector :inline) + ) + ) + +(define *pc-bounding-box-work* (new 'global 'pc-bounding-box-work)) + +(defmacro save-bounding-box-work () + `(begin + (.svf (&-> *pc-bounding-box-work* reg-vf31 quad) vf31) + (.svf (&-> *pc-bounding-box-work* reg-vf30 quad) vf30) + (.svf (&-> *pc-bounding-box-work* reg-vf29 quad) vf29) + ) + ) + +(defmacro load-bounding-box-work () + `(begin + (.lvf vf29 (&-> *pc-bounding-box-work* reg-vf29 quad)) + (.lvf vf30 (&-> *pc-bounding-box-work* reg-vf30 quad)) + (.lvf vf31 (&-> *pc-bounding-box-work* reg-vf31 quad)) + ) + ) + +(defmethod build-bounding-box-for-shape collide-shape ((obj collide-shape) (arg0 bounding-box) (arg1 float) (arg2 collide-kind)) + "Build a bounding box containing the whole shape. + If the box is empty, returns #f." (rlet ((vf0 :class vf) (vf1 :class vf) (vf29 :class vf) @@ -1048,8 +1805,11 @@ (.mov vf31 arg1) (.lvf vf1 (&-> v1-0 quad)) (.add.x.vf vf31 vf31 vf1 :mask #b1) + (.svf (&-> *pc-bounding-box-work* reg-vf31 quad) vf31) ;; added (cond - ((dummy-20 a0-1 arg2) + ((add-to-bounding-box a0-1 arg2) + (.lvf vf29 (&-> *pc-bounding-box-work* reg-vf29 quad)) ;; added + (.lvf vf30 (&-> *pc-bounding-box-work* reg-vf30 quad)) ;; added (.mov.vf vf29 vf0 :mask #b1000) (.mov.vf vf30 vf0 :mask #b1000) (.svf (&-> arg0 min quad) vf29) @@ -1072,116 +1832,186 @@ ) ;; WARN: Bad vector register dependency: vf31 -(defmethod dummy-20 collide-shape-prim ((obj collide-shape-prim) (arg0 collide-kind)) +(defmethod add-to-bounding-box collide-shape-prim ((obj collide-shape-prim) (arg0 collide-kind)) + "Add a single prim to the bounding box. (just adds the bsphere)" (rlet ((vf1 :class vf) (vf2 :class vf) (vf29 :class vf) (vf30 :class vf) (vf31 :class vf) ) + (load-bounding-box-work) (.lvf vf1 (&-> obj prim-core world-sphere quad)) (.add.w.vf vf2 vf31 vf1 :mask #b1) (.add.x.vf vf30 vf1 vf2 :mask #b111) (.sub.x.vf vf29 vf1 vf2 :mask #b111) + (save-bounding-box-work) #t ) ) -;; ERROR: function was not converted to expressions. Cannot decompile. - -;; WARN: Bad vector register dependency: vf29 -;; WARN: Bad vector register dependency: vf30 -;; WARN: Bad vector register dependency: vf31 -;; WARN: Expression building failed: In (method 29 collide-shape-prim-group): Could not match ArrayFieldAccess (stride power of 2) values: (+ v1-0 (the-as int obj)) -; (defmethod dummy-29 collide-shape-prim-group ((obj collide-shape-prim-group) (arg0 uint)) -; (local-vars -; (v0-0 none) -; (v0-1 int) -; (v1-0 int) -; (v1-1 int) -; (v1-2 uint) -; (v1-3 uint) -; (v1-5 type) -; (v1-6 type) -; (v1-8 float) -; (a0-1 collide-shape-prim) -; (a1-1 type) -; (a1-2 uint) -; (s3-0 int) -; (s4-0 int) -; (t9-0 (function collide-shape-prim-group uint none)) -; ) -; (rlet ((vf1 :class vf) -; (vf2 :class vf) -; (vf29 :class vf) -; (vf3 :class vf) -; (vf30 :class vf) -; (vf31 :class vf) -; (vf4 :class vf) -; ) -; (set! s4-0 (-> obj num-prims)) -; (set! s3-0 0) -; (label cfg-1) -; ((b! (= s3-0 s4-0) L214 (set! v1-0 (sll s3-0 2))) (set! v1-0 (sll s3-0 2))) -; (when (begin -; (set! v1-1 (+ v1-0 (the-as int obj))) -; (set! a0-1 (dynamic-array-field-access v1-1 prims PLACEHOLDER)) -; (set! v1-2 (-> a0-1 collide-with)) -; (set! v1-3 (logand v1-2 arg0)) -; (nonzero? v1-3) -; ) -; (cond -; ((begin (set! v1-5 collide-shape-prim-group) (set! a1-1 (-> a0-1 type)) (= a1-1 v1-5)) -; (set! v1-6 (-> (the-as collide-shape-prim-group a0-1) type)) -; (set! t9-0 (method-of-type v1-6 dummy-29)) -; (set! a1-2 arg0) -; (call! a0-1 a1-2) -; (set! v1-7 v0-0) -; ) -; (else -; (.lvf vf1 (&-> a0-1 prim-core world-sphere quad)) -; (.add.w.vf vf2 vf31 vf1 :mask #b1) -; (.add.x.vf vf4 vf1 vf2 :mask #b111) -; (.sub.x.vf vf3 vf1 vf2 :mask #b111) -; (.min.vf vf29 vf29 vf3) -; (.max.vf vf30 vf30 vf4) -; (.mov v1-8 vf30) -; ) -; ) -; ) -; ((b! #t L211 (set! s3-0 (+ s3-0 1))) (set! s3-0 (+ s3-0 1))) -; (label cfg-7) -; (set! v0-1 0) -; (ret-none) -; ) -; ) - -(defmethod dummy-34 collide-shape ((obj collide-shape) (arg0 uint)) - (dummy-10 (-> obj root-prim) arg0) +(defmethod add-to-bounding-box collide-shape-prim-group ((obj collide-shape-prim-group) (arg0 collide-kind)) + "Add a group of prims." + (local-vars (v1-0 int) (v1-10 none) (v1-11 int) (v1-19 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf29 :class vf) + (vf3 :class vf) + (vf30 :class vf) + (vf31 :class vf) + (vf4 :class vf) + ) + + (load-bounding-box-work) + ;; this first loop looks for a non-empty group. + (let ((s4-0 (-> obj num-prims)) + (s3-0 0) + ) + (label cfg-1) + (b! (= s3-0 s4-0) cfg-11 :delay (set! v1-0 (* s3-0 4))) + (let ((a0-1 (-> (the-as (pointer collide-shape-prim) (+ v1-0 (the-as int obj))) 19))) + (when (logtest? (-> a0-1 collide-with) arg0) + (cond + ((= (-> a0-1 type) collide-shape-prim-group) + (save-bounding-box-work) + (when (add-to-bounding-box a0-1 arg0) + (load-bounding-box-work) + (empty) + (goto cfg-12) + ) + (load-bounding-box-work) + ) + (else + (.lvf vf1 (&-> a0-1 prim-core world-sphere quad)) + (.add.w.vf vf2 vf31 vf1 :mask #b1) + (.add.x.vf vf30 vf1 vf2 :mask #b111) + (b! #t cfg-12 :delay (.sub.x.vf vf29 vf1 vf2 :mask #b111)) + (.mov v1-10 vf29) + ) + ) + ) + ) + ;; and now + (b! #t cfg-1 :delay (set! s3-0 (+ s3-0 1))) + (label cfg-11) + (let ((v0-1 #f)) + (b! #t cfg-21 :delay (nop!)) + (label cfg-12) + (let ((s3-1 (+ s3-0 1))) + (label cfg-13) + (b! (= s3-1 s4-0) cfg-19 :delay (set! v1-11 (* s3-1 4))) + (let ((a0-2 (-> (the-as (pointer collide-shape-prim) (+ v1-11 (the-as int obj))) 19))) + (when (logtest? (-> a0-2 collide-with) arg0) + (cond + ((= (-> a0-2 type) collide-shape-prim-group) + (save-bounding-box-work) + (add-to-non-empty-bounding-box (the-as collide-shape-prim-group a0-2) arg0) + (load-bounding-box-work) + ) + (else + (.lvf vf1 (&-> a0-2 prim-core world-sphere quad)) + (.add.w.vf vf2 vf31 vf1 :mask #b1) + (.add.x.vf vf4 vf1 vf2 :mask #b111) + (.sub.x.vf vf3 vf1 vf2 :mask #b111) + (.min.vf vf29 vf29 vf3) + (.max.vf vf30 vf30 vf4) + (.mov v1-19 vf30) + ) + ) + ) + ) + (b! #t cfg-13 :delay (set! s3-1 (+ s3-1 1))) + ) + (label cfg-19) + (save-bounding-box-work) + (return #t) + (label cfg-21) + (save-bounding-box-work) + v0-1 + ) + ) + ) ) -(defmethod dummy-10 collide-shape-prim ((obj collide-shape-prim) (arg0 uint)) - (if (= (-> obj prim-id) arg0) +(defmethod add-to-non-empty-bounding-box collide-shape-prim-group ((obj collide-shape-prim-group) (arg0 collide-kind)) + (local-vars (v1-0 int) (v1-8 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf29 :class vf) + (vf3 :class vf) + (vf30 :class vf) + (vf31 :class vf) + (vf4 :class vf) + ) + (load-bounding-box-work) + (let ((s4-0 (-> obj num-prims)) + (s3-0 0) + ) + (label cfg-1) + (b! (= s3-0 s4-0) cfg-7 :delay (set! v1-0 (* s3-0 4))) + (let ((a0-1 (-> (the-as (pointer collide-shape-prim) (+ v1-0 (the-as int obj))) 19))) + (when (logtest? (-> a0-1 collide-with) arg0) + (cond + ((= (-> a0-1 type) collide-shape-prim-group) + (save-bounding-box-work) + (add-to-non-empty-bounding-box (the-as collide-shape-prim-group a0-1) arg0) + (load-bounding-box-work) + ) + (else + (.lvf vf1 (&-> a0-1 prim-core world-sphere quad)) + (.add.w.vf vf2 vf31 vf1 :mask #b1) + (.add.x.vf vf4 vf1 vf2 :mask #b111) + (.sub.x.vf vf3 vf1 vf2 :mask #b111) + (.min.vf vf29 vf29 vf3) + (.max.vf vf30 vf30 vf4) + (.mov v1-8 vf30) + ) + ) + ) + ) + (b! #t cfg-1 :delay (set! s3-0 (+ s3-0 1))) + ) + (label cfg-7) + (save-bounding-box-work) + 0 + (none) + ) + ) + +;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; prim lookup +;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defmethod find-prim-by-id collide-shape ((obj collide-shape) (arg0 uint)) + "Find a prim in this shape with the given id." + (find-prim-by-id (-> obj root-prim) arg0) + ) + +(defmethod find-prim-by-id collide-shape-prim ((obj collide-shape-prim) (arg0 uint)) + "Find a prim in this shape or its children with the given id." + (if (= (-> obj prim-id) arg0) ;; it's us! (return obj) ) (the-as collide-shape-prim #f) ) -(defmethod dummy-10 collide-shape-prim-group ((obj collide-shape-prim-group) (arg0 uint)) - (if (= (-> obj prim-id) arg0) +(defmethod find-prim-by-id collide-shape-prim-group ((obj collide-shape-prim-group) (arg0 uint)) + "Find a prim in this shape or its children with the given id." + (if (= (-> obj prim-id) arg0) ;; it's us (return obj) ) (countdown (s4-0 (-> obj num-prims)) (let ((a0-1 (-> obj prims s4-0))) (cond ((= (-> a0-1 type) collide-shape-prim-group) - (let ((a0-2 (dummy-10 a0-1 arg0))) + (let ((a0-2 (find-prim-by-id a0-1 arg0))) (if a0-2 (return a0-2) ) ) ) (else + ;; just check here, to avoid the virtual call (if (= (-> a0-1 prim-id) arg0) (return a0-1) ) @@ -1192,7 +2022,12 @@ (the-as collide-shape-prim #f) ) +;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; debug +;;;;;;;;;;;;;;;;;;;;;;;;;;; + (defun-debug collide-shape-draw-debug-marks () + "Draw collision debug." (add-debug-sphere (or *display-collision-marks* *display-target-marks*) (bucket-id debug-draw0) @@ -1288,6 +2123,7 @@ (defmethod debug-draw collide-shape ((obj collide-shape)) + "Draw a collide shape" (if (sphere-in-view-frustum? (the-as sphere (-> obj root-prim prim-core))) (debug-draw-world-sphere (-> obj root-prim)) ) @@ -1312,12 +2148,19 @@ ) ) -(defmethod dummy-47 collide-shape ((obj collide-shape)) - (dummy-25 (-> obj root-prim) (-> obj process)) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; transform spheres by joints +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defmethod update-transforms! collide-shape ((obj collide-shape)) + "Update all transforms for this shape. After this is called, you can use the + world-spheres." + (update-transforms! (-> obj root-prim) (-> obj process)) #f ) -(defmethod dummy-25 collide-shape-prim ((obj collide-shape-prim) (arg0 process-drawable)) +(defmethod update-transforms! collide-shape-prim ((obj collide-shape-prim) (arg0 process-drawable)) + "Update our world sphere, and our children's world sphere's too." (local-vars (a0-2 float) (a0-4 float) (a0-6 float)) (rlet ((acc :class vf) (Q :class vf) @@ -1377,34 +2220,40 @@ ) (when (= (-> obj type) collide-shape-prim-group) (countdown (s4-0 (-> (the-as collide-shape-prim-group obj) num-prims)) - (dummy-25 (-> (the-as collide-shape-prim-group obj) prims s4-0) arg0) + (update-transforms! (-> (the-as collide-shape-prim-group obj) prims s4-0) arg0) ) #f ) ) ) -(defmethod TODO-RENAME-28 collide-shape ((obj collide-shape) (arg0 vector)) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; move by vector, move to point +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defmethod move-by-vector! collide-shape ((obj collide-shape) (arg0 vector)) + "Adjust our position by the given vector" (vector+! (-> obj trans) (-> obj trans) arg0) - (dummy-9 (-> obj root-prim) arg0) + (move-by-vector! (-> obj root-prim) arg0) + (none) ) -(defmethod dummy-9 collide-shape-prim ((obj collide-shape-prim) (arg0 vector)) +(defmethod move-by-vector! collide-shape-prim ((obj collide-shape-prim) (arg0 vector)) + "Adjust our position by the given vector" (vector+! (the-as vector (-> obj prim-core)) (the-as vector (-> obj prim-core)) arg0) - (let ((f0-0 (-> obj local-sphere w))) - (set! (-> obj prim-core world-sphere w) f0-0) - (the-as object f0-0) - ) + (set! (-> obj prim-core world-sphere w) (-> obj local-sphere w)) + (none) ) -(defmethod dummy-9 collide-shape-prim-group ((obj collide-shape-prim-group) (arg0 vector)) +(defmethod move-by-vector! collide-shape-prim-group ((obj collide-shape-prim-group) (arg0 vector)) + "Adjust our position by the given vector" (vector+! (the-as vector (-> obj prim-core)) (the-as vector (-> obj prim-core)) arg0) (set! (-> obj prim-core world-sphere w) (-> obj local-sphere w)) (countdown (s4-0 (-> obj num-prims)) (let ((a0-2 (-> obj prims s4-0))) (cond ((= (-> a0-2 type) collide-shape-prim-group) - (dummy-9 a0-2 arg0) + (move-by-vector! a0-2 arg0) ) (else (vector+! (the-as vector (-> a0-2 prim-core)) (the-as vector (-> a0-2 prim-core)) arg0) @@ -1413,16 +2262,22 @@ ) ) ) - (the-as object #f) + (none) ) -(defmethod TODO-RENAME-30 collide-shape ((obj collide-shape) (arg0 vector)) +(defmethod move-to-point! collide-shape ((obj collide-shape) (arg0 vector)) + "Move us to exactly the given position." (let ((v1-0 (new 'stack-no-clear 'vector))) (vector-! v1-0 arg0 (-> obj trans)) - (TODO-RENAME-28 obj v1-0) + (move-by-vector! obj v1-0) ) + (none) ) +;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; construction functions +;;;;;;;;;;;;;;;;;;;;;;;;;;;; + (defmethod set-root-prim! collide-shape ((obj collide-shape) (arg0 collide-shape-prim)) (set! (-> obj root-prim) arg0) arg0 @@ -1500,7 +2355,7 @@ (format 0 "ERROR: Failed to find collision meshes for ~D prim(s) in ~A!~%" s5-0 (-> obj process name)) ) ) - (dummy-47 obj) + (update-transforms! obj) ) (defmethod num-mesh collide-shape-prim ((obj collide-shape-prim) (arg0 collide-shape-prim)) @@ -1534,55 +2389,44 @@ ) ) -;; WARN: Expression building failed: In (method 28 collide-shape-prim-mesh): Unhandled branch delay in BranchElement::push_to_stack: (bl! (zero? (the-as uint v0-5)) L148 (no-delay!)) -; (defmethod change-mesh collide-shape-prim-mesh ((obj collide-shape-prim-mesh) (arg0 int)) -; (local-vars -; (v0-5 int) -; (v0-6 object) -; (v1-3 draw-control) -; (v1-8 int) -; (v1-9 int) -; (v1-10 uint) -; (v1-11 collide-mesh-cache) -; (a0-6 uint) -; (a0-7 int) -; (a1-2 string) -; (s4-0 structure) -; (t9-2 (function _varargs_ object)) -; ) -; (when (!= (-> obj mesh-id) arg0) -; (when (and (nonzero? v1-3) (-> v1-3 jgeo)) -; (when s4-0 -; (cond -; ((and (>= arg0 0) (< arg0 (length (the-as collide-shape-prim-group s4-0)))) -; (set! v1-8 (* arg0 4)) -; (set! v1-9 (+ (* arg0 4) (the-as int s4-0))) -; (set! v1-10 (l.wu (+ (* arg0 4) (the-as int s4-0) 12))) -; (set! (-> obj mesh) (the-as collide-mesh v1-10)) -; (set! (-> obj mesh-id) arg0) -; (set! v1-11 *collide-mesh-cache*) -; (set! a0-6 (-> v1-11 id)) -; (set! (-> v1-11 used-size) (the-as uint 0)) -; (set! v0-5 (the-as int (+ a0-6 1))) -; (bl! (zero? (the-as uint v0-5)) L148 (no-delay!)) -; (set! v0-5 1) -; (label cfg-12) -; (set! (-> v1-11 id) (the-as uint v0-5)) -; ) -; (else -; (set! t9-2 format) -; (set! a0-7 0) -; (set! a1-2 L402) -; (call! a0-7 a1-2) -; ) -; ) -; ) -; ) -; ) -; (ret-none) -; ) +(defmethod change-mesh collide-shape-prim-mesh ((obj collide-shape-prim-mesh) (arg0 int)) + "Change our mesh to the given mesh ID." + (when (!= (-> obj mesh-id) arg0) ;; only if we don't have the right one. + (let ((v1-3 (-> obj cshape process draw))) + (when (and (nonzero? v1-3) (-> v1-3 jgeo)) ;; and we have jgeo + ;; look up the collide mesh array! + (let ((s4-0 (res-lump-struct (-> v1-3 jgeo extra) 'collide-mesh-group (array collide-mesh)))) + (when s4-0 ;; we got it + (cond + ((and (>= arg0 0) (< arg0 (length s4-0))) ;; in range + (set! (-> obj mesh) (-> s4-0 arg0)) ;; grab it! + (set! (-> obj mesh-id) arg0) + ;; kill the collide mesh cache. + (let* ((v1-11 *collide-mesh-cache*) + (a0-6 (-> v1-11 id)) + ) + (set! (-> v1-11 used-size) (the-as uint 0)) + (let ((v0-5 (the-as int (+ a0-6 1)))) + (b! (zero? (the-as uint v0-5)) cfg-12 :likely-delay (set! v0-5 1)) + (label cfg-12) + (set! (-> v1-11 id) (the-as uint v0-5)) + ) + ) + ) + (else + (format 0 "ERROR: ~%~%collide-shape-prim-mesh::change-mesh(): Failed to find collision mesh!~%") + ) + ) + ) + ) + ) + ) + ) + (none) + ) (defmethod init! collide-shape-intersect ((obj collide-shape-intersect) (arg0 vector)) + "Initialize the intersection in the given direction." (set! (-> obj move-vec quad) (-> arg0 quad)) (set! (-> obj best-u) -100000000.0) (set! (-> obj best-from-prim) #f) @@ -1591,6 +2435,7 @@ ) (defmethod debug-draw-world-sphere collide-shape-prim ((obj collide-shape-prim)) + "Draw our sphere" (add-debug-sphere #t (bucket-id debug-draw0) @@ -1601,6 +2446,7 @@ ) (defmethod debug-draw-world-sphere collide-shape-prim-sphere ((obj collide-shape-prim-sphere)) + "Draw our sphere" (add-debug-sphere #t (bucket-id debug-draw0) @@ -1622,6 +2468,7 @@ ) (defmethod debug-draw-world-sphere collide-shape-prim-mesh ((obj collide-shape-prim-mesh)) + "Draw our sphere" (add-debug-sphere #t (bucket-id debug-draw0) @@ -1632,6 +2479,7 @@ ) (defmethod debug-draw-world-sphere collide-shape-prim-group ((obj collide-shape-prim-group)) + "Draw our sphere" (add-debug-sphere #t (bucket-id debug-draw0) @@ -1645,956 +2493,894 @@ #f ) -;; WARN: Expression building failed: In (method 45 collide-shape): Unhandled branch delay in BranchElement::push_to_stack: (bl! (zero? (the-as uint a0-2)) L93 (no-delay!)) -; (defmethod dummy-45 collide-shape ((obj collide-shape)) -; (local-vars -; (at-0 int) -; (at-1 int) -; (at-2 int) -; (at-3 int) -; (v0-0 none) -; (v0-1 none) -; (v0-2 vector) -; (v0-3 none) -; (v0-4 none) -; (v0-5 symbol) -; (v0-6 none) -; (v0-7 none) -; (v0-8 vector) -; (v0-9 none) -; (v0-10 none) -; (v0-11 none) -; (v0-12 none) -; (v0-13 vector) -; (v0-14 none) -; (v0-15 none) -; (v0-16 none) -; (v0-17 none) -; (v0-18 vector) -; (v0-19 none) -; (v0-20 none) -; (v1-0 collide-mesh-cache) -; (v1-1 collide-shape-prim) -; (v1-2 uint) -; (v1-4 engine) -; (v1-5 connectable) -; (v1-6 collide-shape-prim) -; (v1-7 uint) -; (v1-8 uint) -; (v1-10 process-drawable) -; (v1-12 type) -; (v1-13 none) -; (v1-14 none) -; (v1-16 type) -; (v1-17 collide-shape-prim) -; (v1-19 vector) -; (v1-20 float) -; (v1-21 vector) -; (v1-22 vector) -; (v1-23 vector) -; (v1-24 type) -; (v1-26 symbol) -; (v1-27 type) -; (v1-28 none) -; (v1-30 collide-shape-prim) -; (v1-34 uint) -; (v1-35 uint) -; (v1-37 engine) -; (v1-38 connectable) -; (v1-39 collide-shape-prim) -; (v1-40 uint) -; (v1-41 uint) -; (v1-43 process-drawable) -; (v1-45 type) -; (v1-46 none) -; (v1-47 none) -; (v1-49 type) -; (v1-50 collide-shape-prim) -; (v1-52 vector) -; (v1-53 float) -; (v1-54 vector) -; (v1-55 vector) -; (v1-56 vector) -; (v1-57 type) -; (v1-59 symbol) -; (v1-60 type) -; (v1-61 none) -; (v1-63 collide-shape-prim) -; (v1-67 uint) -; (v1-69 engine) -; (v1-70 connectable) -; (v1-71 collide-shape-prim) -; (v1-72 uint) -; (v1-73 uint) -; (v1-75 process-drawable) -; (v1-77 type) -; (v1-78 none) -; (v1-79 none) -; (v1-81 type) -; (v1-82 collide-shape-prim) -; (v1-84 vector) -; (v1-85 float) -; (v1-86 vector) -; (v1-87 vector) -; (v1-88 vector) -; (v1-89 type) -; (v1-91 symbol) -; (v1-92 type) -; (v1-93 none) -; (v1-95 collide-shape-prim) -; (v1-99 uint) -; (v1-100 engine) -; (v1-101 connectable) -; (v1-102 collide-shape-prim) -; (v1-103 uint) -; (v1-104 uint) -; (v1-106 process-drawable) -; (v1-108 type) -; (v1-109 none) -; (v1-110 none) -; (v1-112 type) -; (v1-113 collide-shape-prim) -; (v1-115 vector) -; (v1-116 float) -; (v1-117 vector) -; (v1-118 vector) -; (v1-119 vector) -; (v1-120 type) -; (v1-122 symbol) -; (v1-123 type) -; (v1-124 none) -; (v1-126 collide-shape-prim) -; (a0-1 uint) -; (a0-2 int) -; (a0-3 engine) -; (a0-4 connectable) -; (a0-5 process-drawable) -; (a0-6 collide-shape) -; (a0-7 collide-shape-moving) -; (a0-8 vector) -; (a0-14 vector) -; (a0-15 vector) -; (a0-16 vector) -; (a0-17 display) -; (a0-18 collide-shape-moving) -; (a0-19 symbol) -; (a0-20 collide-shape) -; (a0-21 engine) -; (a0-22 connectable) -; (a0-23 engine) -; (a0-24 connectable) -; (a0-25 engine) -; (a0-26 connectable) -; (a0-27 process-drawable) -; (a0-28 collide-shape) -; (a0-29 collide-shape-moving) -; (a0-30 vector) -; (a0-36 vector) -; (a0-37 vector) -; (a0-38 vector) -; (a0-39 display) -; (a0-40 collide-shape-moving) -; (a0-41 symbol) -; (a0-42 collide-shape) -; (a0-43 engine) -; (a0-44 connectable) -; (a0-45 engine) -; (a0-46 connectable) -; (a0-47 engine) -; (a0-48 connectable) -; (a0-49 process-drawable) -; (a0-50 collide-shape) -; (a0-51 collide-shape-moving) -; (a0-52 vector) -; (a0-58 vector) -; (a0-59 vector) -; (a0-60 vector) -; (a0-61 display) -; (a0-62 collide-shape-moving) -; (a0-63 symbol) -; (a0-64 collide-shape) -; (a0-65 engine) -; (a0-66 connectable) -; (a0-67 engine) -; (a0-68 connectable) -; (a0-69 engine) -; (a0-70 connectable) -; (a0-71 process-drawable) -; (a0-72 collide-shape) -; (a0-73 collide-shape-moving) -; (a0-74 vector) -; (a0-80 vector) -; (a0-81 vector) -; (a0-82 vector) -; (a0-83 display) -; (a0-84 collide-shape-moving) -; (a0-85 symbol) -; (a0-86 collide-shape) -; (a0-87 engine) -; (a0-88 connectable) -; (a0-89 engine) -; (a0-90 connectable) -; (a1-0 collide-shape-moving) -; (a1-1 float) -; (a1-2 vector) -; (a1-3 uint128) -; (a1-4 float) -; (a1-5 vector) -; (a1-6 collide-shape-moving) -; (a1-7 collide-shape-moving) -; (a1-8 float) -; (a1-9 vector) -; (a1-10 uint128) -; (a1-11 float) -; (a1-12 vector) -; (a1-13 collide-shape-moving) -; (a1-14 collide-shape-moving) -; (a1-15 float) -; (a1-16 vector) -; (a1-17 uint128) -; (a1-18 float) -; (a1-19 vector) -; (a1-20 collide-shape-moving) -; (a1-21 collide-shape-moving) -; (a1-22 float) -; (a1-23 vector) -; (a1-24 uint128) -; (a1-25 float) -; (a1-26 vector) -; (a1-27 collide-shape-moving) -; (a2-0 collide-work) -; (a2-1 uint) -; (a2-2 collide-work) -; (a2-3 collide-work) -; (a2-4 uint) -; (a2-5 collide-work) -; (a2-6 collide-work) -; (a2-7 uint) -; (a2-8 collide-work) -; (a2-9 collide-work) -; (a2-10 uint) -; (a2-11 collide-work) -; (s0-0 uint) -; (s0-1 uint) -; (s0-2 uint) -; (s0-3 uint) -; (s1-0 vector) -; (s1-1 vector) -; (s1-2 vector) -; (s1-3 vector) -; (s2-0 collide-work) -; (s2-1 collide-work) -; (s2-2 collide-work) -; (s2-3 collide-work) -; (s3-0 collide-shape-moving) -; (s3-1 collide-shape-moving) -; (s3-2 collide-shape-moving) -; (s3-3 collide-shape-moving) -; (s4-0 connectable) -; (s4-1 connectable) -; (s4-2 connectable) -; (s4-3 connectable) -; (s5-0 uint) -; (s5-1 int) -; (s5-2 int) -; (s5-3 int) -; (s5-4 int) -; (t9-0 (function collide-shape collide-shape collide-work none)) -; (t9-1 (function collide-shape-moving object uint none)) -; (t9-2 (function vector float vector)) -; (t9-3 (function collide-shape-moving vector none)) -; (t9-4 (function collide-shape collide-shape collide-work none)) -; (t9-5 (function collide-shape collide-shape collide-work none)) -; (t9-6 (function collide-shape-moving object uint none)) -; (t9-7 (function vector float vector)) -; (t9-8 (function collide-shape-moving vector none)) -; (t9-9 (function collide-shape collide-shape collide-work none)) -; (t9-10 (function collide-shape collide-shape collide-work none)) -; (t9-11 (function collide-shape-moving object uint none)) -; (t9-12 (function vector float vector)) -; (t9-13 (function collide-shape-moving vector none)) -; (t9-14 (function collide-shape collide-shape collide-work none)) -; (t9-15 (function collide-shape collide-shape collide-work none)) -; (t9-16 (function collide-shape-moving object uint none)) -; (t9-17 (function vector float vector)) -; (t9-18 (function collide-shape-moving vector none)) -; (t9-19 (function collide-shape collide-shape collide-work none)) -; (f0-0 float) -; (f0-1 float) -; (f0-2 float) -; (f0-3 float) -; (f0-4 float) -; (f0-5 float) -; (f0-6 float) -; (f0-7 float) -; (f0-8 float) -; (f0-9 float) -; (f0-10 float) -; (f0-11 float) -; (f0-12 float) -; (f0-13 float) -; (f0-14 float) -; (f0-15 float) -; (f0-16 float) -; (f0-17 float) -; (f0-18 float) -; (f0-19 float) -; (f0-20 float) -; (f0-21 float) -; (f0-22 float) -; (f0-23 float) -; (f0-24 float) -; (f0-25 float) -; (f0-26 float) -; (f0-27 float) -; (f1-0 float) -; (f1-1 float) -; (f1-2 float) -; (f1-3 float) -; (f1-4 float) -; (f1-5 float) -; (f1-6 float) -; (f1-7 float) -; (f1-8 float) -; (f1-9 float) -; (f1-10 float) -; (f1-11 float) -; (f2-0 float) -; (f2-1 float) -; (f2-2 float) -; (f2-3 float) -; ) -; (rlet ((vf0 :class vf) -; (vf1 :class vf) -; (vf2 :class vf) -; (vf3 :class vf) -; (vf4 :class vf) -; (vf5 :class vf) -; ) -; (init-vf0-vector) -; (when (begin -; (when (begin -; (set! v1-0 *collide-mesh-cache*) -; (set! a0-1 (-> v1-0 id)) -; (set! (-> v1-0 used-size) (the-as uint 0)) -; (set! a0-2 (the-as int (+ a0-1 1))) -; (bl! (zero? (the-as uint a0-2)) L93 (no-delay!)) -; (set! a0-2 1) -; (label cfg-2) -; (set! (-> v1-0 id) (the-as uint a0-2)) -; (set! v1-1 (-> obj root-prim)) -; (set! s5-0 (-> v1-1 collide-with)) -; (set! v1-2 (logand s5-0 16)) -; (nonzero? v1-2) -; ) -; (set! v1-4 *collide-player-list*) -; (set! v1-5 (-> v1-4 alive-list next0)) -; (set! a0-3 *collide-player-list*) -; (set! a0-4 v1-5) -; (set! s4-0 (-> a0-4 next0)) -; (while (begin (set! a0-23 *collide-player-list*) (set! a0-24 (-> a0-23 alive-list-end)) (!= v1-5 a0-24)) -; (when (begin -; (set! s3-0 (the-as collide-shape-moving (-> (the-as connection v1-5) param1))) -; (set! v1-6 (-> s3-0 root-prim)) -; (set! v1-7 (-> v1-6 prim-core collide-as)) -; (set! v1-8 (logand s5-0 v1-7)) -; (nonzero? v1-8) -; ) -; (when (begin (set! v1-10 (-> s3-0 process)) (set! a0-5 (-> obj process)) (!= a0-5 v1-10)) -; (when (begin -; (and -; (begin -; (set! s2-0 (new 'stack-no-clear 'collide-work)) -; (set! a0-6 obj) -; (set! v1-12 (-> a0-6 type)) -; (set! t9-0 (method-of-type v1-12 dummy-42)) -; (set! a1-0 s3-0) -; (set! a2-0 s2-0) -; (set! v0-0 (call! a0-6 a1-0 a2-0)) -; (set! v1-13 v0-0) -; v1-13 -; ) -; (begin -; (set! f0-0 -81.92) -; (set! f1-0 (-> s2-0 collide-sphere-neg-r x)) -; (set! v1-14 (the-as none (>=.s f0-0 f1-0))) -; ) -; ) -; v1-14 -; ) -; (set! a0-7 s3-0) -; (set! v1-16 (-> a0-7 type)) -; (set! t9-1 (method-of-type v1-16 dummy-32)) -; (set! a1-1 8192.0) -; (set! v1-17 (-> s3-0 root-prim)) -; (set! a2-1 (-> v1-17 collide-with)) -; (call! a0-7 a1-1 a2-1) -; (set! v1-18 v0-1) -; (set! s5-1 3) -; (until (begin -; (cond -; ((begin -; (set! s1-0 (new 'stack-no-clear 'vector)) -; (set! v1-19 (new 'stack-no-clear 'vector)) -; (set! a0-8 v1-19) -; (set! a1-2 (-> s3-0 trans)) -; (set! a1-3 (-> a1-2 quad)) -; (set! (-> a0-8 quad) a1-3) -; (set! f0-1 2867.2) -; (set! f1-1 (-> v1-19 y)) -; (set! f1-2 (+.s f0-1 f1-1)) -; (set! f0-2 5734.4) -; (set! f2-0 (+.s f0-2 f1-2)) -; (set! f0-3 (-> s2-0 inv-mat vector 1 y)) -; (<.s f0-3 f1-2) -; ) -; (set! f0-3 f1-2) -; (set! a0-10 (fpr->gpr f0-3)) -; ) -; ((<.s f2-0 f0-3) -; (set! f0-3 f2-0) -; (set! a0-12 (fpr->gpr f0-3)) -; ) -; ) -; (set! (-> v1-19 y) f0-3) -; (set! a0-13 (fpr->gpr f0-3)) -; (.lvf vf4 (&-> v1-19 quad)) -; (.lvf vf3 (&-> s2-0 inv-mat vector 1 quad)) -; (.lvf vf5 (&-> s2-0 inv-mat vector 2 quad)) -; (.sub.vf vf2 vf4 vf3) -; (.mul.vf vf1 vf5 vf2) -; (.add.x.vf vf1 vf1 vf1 :mask #b10) -; (.add.z.vf vf1 vf1 vf1 :mask #b10) -; (.mov v1-20 vf1) -; (bl! (<0.si v1-20) L99 (no-delay!)) -; (.sub.vf vf2 vf0 vf2) -; (or -; (begin -; (label cfg-18) -; (.svf (&-> s1-0 quad) vf2) -; (set! t9-2 vector-normalize!) -; (set! a0-14 s1-0) -; (set! a1-4 1.0) -; (call! a0-14 a1-4) -; (set! v1-21 s1-0) -; (set! a0-15 s1-0) -; (set! f0-4 (-> s2-0 collide-sphere-neg-r x)) -; (set! f0-5 (neg.s f0-4)) -; (set! v1-22 (vector-float*!2 v1-21 a0-15 f0-5)) -; (set! v1-23 s1-0) -; (set! a0-16 s1-0) -; (.lvf vf1 (&-> a0-16 quad)) -; (set! a0-17 *display*) -; (set! f0-6 (-> a0-17 frames-per-second)) -; (.mov at-0 f0-6) -; (.mov vf2 at-0) -; (.mov.vf vf1 vf0 :mask #b1000) -; (.mul.x.vf vf1 vf1 vf2 :mask #b111) -; (.svf (&-> v1-23 quad) vf1) -; (set! s0-0 (-> s3-0 status)) -; (set! a0-18 s3-0) -; (set! v1-24 (-> a0-18 type)) -; (set! t9-3 (method-of-type v1-24 dummy-37)) -; (set! a1-5 s1-0) -; (call! a0-18 a1-5) -; (set! v1-25 v0-3) -; (set! (-> s3-0 status) s0-0) -; (set! s5-1 (+ s5-1 -1)) -; (set! a0-19 (<=0.si s5-1)) -; a0-19 -; ) -; (begin -; (set! a0-20 obj) -; (set! v1-27 (-> a0-20 type)) -; (set! t9-4 (method-of-type v1-27 dummy-42)) -; (set! a1-6 s3-0) -; (set! a2-2 s2-0) -; (set! v0-4 (call! a0-20 a1-6 a2-2)) -; (set! v1-28 v0-4) -; (set! v1-26 (not v1-28)) -; ) -; ) -; v1-26 -; ) -; (empty) -; ) -; (set! v1-30 (-> obj root-prim)) -; (set! s5-0 (-> v1-30 collide-with)) -; (set! v1-31 s5-0) -; ) -; ) -; ) -; (set! v1-5 s4-0) -; (set! a0-21 *collide-player-list*) -; (set! a0-22 (-> s4-0 next0)) -; (set! s4-0 a0-22) -; ) -; ) -; (set! v1-34 (logand s5-0 14)) -; (nonzero? v1-34) -; ) -; (when (begin -; (when (begin -; (when (begin (set! v1-35 (logand s5-0 2)) (nonzero? v1-35)) -; (set! v1-37 *collide-hit-by-player-list*) -; (set! v1-38 (-> v1-37 alive-list next0)) -; (set! a0-25 *collide-hit-by-player-list*) -; (set! a0-26 v1-38) -; (set! s4-1 (-> a0-26 next0)) -; (while (begin (set! a0-45 *collide-hit-by-player-list*) (set! a0-46 (-> a0-45 alive-list-end)) (!= v1-38 a0-46)) -; (when (begin -; (set! s3-1 (the-as collide-shape-moving (-> (the-as connection v1-38) param1))) -; (set! v1-39 (-> s3-1 root-prim)) -; (set! v1-40 (-> v1-39 prim-core collide-as)) -; (set! v1-41 (logand s5-0 v1-40)) -; (nonzero? v1-41) -; ) -; (when (begin (set! v1-43 (-> s3-1 process)) (set! a0-27 (-> obj process)) (!= a0-27 v1-43)) -; (when (begin -; (and -; (begin -; (set! s2-1 (new 'stack-no-clear 'collide-work)) -; (set! a0-28 obj) -; (set! v1-45 (-> a0-28 type)) -; (set! t9-5 (method-of-type v1-45 dummy-42)) -; (set! a1-7 s3-1) -; (set! a2-3 s2-1) -; (set! v0-6 (call! a0-28 a1-7 a2-3)) -; (set! v1-46 v0-6) -; v1-46 -; ) -; (begin -; (set! f0-7 -81.92) -; (set! f1-3 (-> s2-1 collide-sphere-neg-r x)) -; (set! v1-47 (the-as none (>=.s f0-7 f1-3))) -; ) -; ) -; v1-47 -; ) -; (set! a0-29 s3-1) -; (set! v1-49 (-> a0-29 type)) -; (set! t9-6 (method-of-type v1-49 dummy-32)) -; (set! a1-8 8192.0) -; (set! v1-50 (-> s3-1 root-prim)) -; (set! a2-4 (-> v1-50 collide-with)) -; (call! a0-29 a1-8 a2-4) -; (set! v1-51 v0-7) -; (set! s5-2 3) -; (until (begin -; (cond -; ((begin -; (set! s1-1 (new 'stack-no-clear 'vector)) -; (set! v1-52 (new 'stack-no-clear 'vector)) -; (set! a0-30 v1-52) -; (set! a1-9 (-> s3-1 trans)) -; (set! a1-10 (-> a1-9 quad)) -; (set! (-> a0-30 quad) a1-10) -; (set! f0-8 2867.2) -; (set! f1-4 (-> v1-52 y)) -; (set! f1-5 (+.s f0-8 f1-4)) -; (set! f0-9 5734.4) -; (set! f2-1 (+.s f0-9 f1-5)) -; (set! f0-10 (-> s2-1 inv-mat vector 1 y)) -; (<.s f0-10 f1-5) -; ) -; (set! f0-10 f1-5) -; (set! a0-32 (fpr->gpr f0-10)) -; ) -; ((<.s f2-1 f0-10) -; (set! f0-10 f2-1) -; (set! a0-34 (fpr->gpr f0-10)) -; ) -; ) -; (set! (-> v1-52 y) f0-10) -; (set! a0-35 (fpr->gpr f0-10)) -; (.lvf vf4 (&-> v1-52 quad)) -; (.lvf vf3 (&-> s2-1 inv-mat vector 1 quad)) -; (.lvf vf5 (&-> s2-1 inv-mat vector 2 quad)) -; (.sub.vf vf2 vf4 vf3) -; (.mul.vf vf1 vf5 vf2) -; (.add.x.vf vf1 vf1 vf1 :mask #b10) -; (.add.z.vf vf1 vf1 vf1 :mask #b10) -; (.mov v1-53 vf1) -; (bl! (<0.si v1-53) L109 (no-delay!)) -; (.sub.vf vf2 vf0 vf2) -; (or -; (begin -; (label cfg-44) -; (.svf (&-> s1-1 quad) vf2) -; (set! t9-7 vector-normalize!) -; (set! a0-36 s1-1) -; (set! a1-11 1.0) -; (call! a0-36 a1-11) -; (set! v1-54 s1-1) -; (set! a0-37 s1-1) -; (set! f0-11 (-> s2-1 collide-sphere-neg-r x)) -; (set! f0-12 (neg.s f0-11)) -; (set! v1-55 (vector-float*!2 v1-54 a0-37 f0-12)) -; (set! v1-56 s1-1) -; (set! a0-38 s1-1) -; (.lvf vf1 (&-> a0-38 quad)) -; (set! a0-39 *display*) -; (set! f0-13 (-> a0-39 frames-per-second)) -; (.mov at-1 f0-13) -; (.mov vf2 at-1) -; (.mov.vf vf1 vf0 :mask #b1000) -; (.mul.x.vf vf1 vf1 vf2 :mask #b111) -; (.svf (&-> v1-56 quad) vf1) -; (set! s0-1 (-> s3-1 status)) -; (set! a0-40 s3-1) -; (set! v1-57 (-> a0-40 type)) -; (set! t9-8 (method-of-type v1-57 dummy-37)) -; (set! a1-12 s1-1) -; (call! a0-40 a1-12) -; (set! v1-58 v0-9) -; (set! (-> s3-1 status) s0-1) -; (set! s5-2 (+ s5-2 -1)) -; (set! a0-41 (<=0.si s5-2)) -; a0-41 -; ) -; (begin -; (set! a0-42 obj) -; (set! v1-60 (-> a0-42 type)) -; (set! t9-9 (method-of-type v1-60 dummy-42)) -; (set! a1-13 s3-1) -; (set! a2-5 s2-1) -; (set! v0-10 (call! a0-42 a1-13 a2-5)) -; (set! v1-61 v0-10) -; (set! v1-59 (not v1-61)) -; ) -; ) -; v1-59 -; ) -; (empty) -; ) -; (set! v1-63 (-> obj root-prim)) -; (set! s5-0 (-> v1-63 collide-with)) -; (set! v1-64 s5-0) -; ) -; ) -; ) -; (set! v1-38 s4-1) -; (set! a0-43 *collide-hit-by-player-list*) -; (set! a0-44 (-> s4-1 next0)) -; (set! s4-1 a0-44) -; ) -; ) -; (set! v1-67 (logand s5-0 4)) -; (nonzero? v1-67) -; ) -; (set! v1-69 *collide-usually-hit-by-player-list*) -; (set! v1-70 (-> v1-69 alive-list next0)) -; (set! a0-47 *collide-usually-hit-by-player-list*) -; (set! a0-48 v1-70) -; (set! s4-2 (-> a0-48 next0)) -; (while (begin -; (set! a0-67 *collide-usually-hit-by-player-list*) -; (set! a0-68 (-> a0-67 alive-list-end)) -; (!= v1-70 a0-68) -; ) -; (when (begin -; (set! s3-2 (the-as collide-shape-moving (-> (the-as connection v1-70) param1))) -; (set! v1-71 (-> s3-2 root-prim)) -; (set! v1-72 (-> v1-71 prim-core collide-as)) -; (set! v1-73 (logand s5-0 v1-72)) -; (nonzero? v1-73) -; ) -; (when (begin (set! v1-75 (-> s3-2 process)) (set! a0-49 (-> obj process)) (!= a0-49 v1-75)) -; (when (begin -; (and -; (begin -; (set! s2-2 (new 'stack-no-clear 'collide-work)) -; (set! a0-50 obj) -; (set! v1-77 (-> a0-50 type)) -; (set! t9-10 (method-of-type v1-77 dummy-42)) -; (set! a1-14 s3-2) -; (set! a2-6 s2-2) -; (set! v0-11 (call! a0-50 a1-14 a2-6)) -; (set! v1-78 v0-11) -; v1-78 -; ) -; (begin -; (set! f0-14 -81.92) -; (set! f1-6 (-> s2-2 collide-sphere-neg-r x)) -; (set! v1-79 (the-as none (>=.s f0-14 f1-6))) -; ) -; ) -; v1-79 -; ) -; (set! a0-51 s3-2) -; (set! v1-81 (-> a0-51 type)) -; (set! t9-11 (method-of-type v1-81 dummy-32)) -; (set! a1-15 8192.0) -; (set! v1-82 (-> s3-2 root-prim)) -; (set! a2-7 (-> v1-82 collide-with)) -; (call! a0-51 a1-15 a2-7) -; (set! v1-83 v0-12) -; (set! s5-3 3) -; (until (begin -; (cond -; ((begin -; (set! s1-2 (new 'stack-no-clear 'vector)) -; (set! v1-84 (new 'stack-no-clear 'vector)) -; (set! a0-52 v1-84) -; (set! a1-16 (-> s3-2 trans)) -; (set! a1-17 (-> a1-16 quad)) -; (set! (-> a0-52 quad) a1-17) -; (set! f0-15 2867.2) -; (set! f1-7 (-> v1-84 y)) -; (set! f1-8 (+.s f0-15 f1-7)) -; (set! f0-16 5734.4) -; (set! f2-2 (+.s f0-16 f1-8)) -; (set! f0-17 (-> s2-2 inv-mat vector 1 y)) -; (<.s f0-17 f1-8) -; ) -; (set! f0-17 f1-8) -; (set! a0-54 (fpr->gpr f0-17)) -; ) -; ((<.s f2-2 f0-17) -; (set! f0-17 f2-2) -; (set! a0-56 (fpr->gpr f0-17)) -; ) -; ) -; (set! (-> v1-84 y) f0-17) -; (set! a0-57 (fpr->gpr f0-17)) -; (.lvf vf4 (&-> v1-84 quad)) -; (.lvf vf3 (&-> s2-2 inv-mat vector 1 quad)) -; (.lvf vf5 (&-> s2-2 inv-mat vector 2 quad)) -; (.sub.vf vf2 vf4 vf3) -; (.mul.vf vf1 vf5 vf2) -; (.add.x.vf vf1 vf1 vf1 :mask #b10) -; (.add.z.vf vf1 vf1 vf1 :mask #b10) -; (.mov v1-85 vf1) -; (bl! (<0.si v1-85) L119 (no-delay!)) -; (.sub.vf vf2 vf0 vf2) -; (or -; (begin -; (label cfg-69) -; (.svf (&-> s1-2 quad) vf2) -; (set! t9-12 vector-normalize!) -; (set! a0-58 s1-2) -; (set! a1-18 1.0) -; (call! a0-58 a1-18) -; (set! v1-86 s1-2) -; (set! a0-59 s1-2) -; (set! f0-18 (-> s2-2 collide-sphere-neg-r x)) -; (set! f0-19 (neg.s f0-18)) -; (set! v1-87 (vector-float*!2 v1-86 a0-59 f0-19)) -; (set! v1-88 s1-2) -; (set! a0-60 s1-2) -; (.lvf vf1 (&-> a0-60 quad)) -; (set! a0-61 *display*) -; (set! f0-20 (-> a0-61 frames-per-second)) -; (.mov at-2 f0-20) -; (.mov vf2 at-2) -; (.mov.vf vf1 vf0 :mask #b1000) -; (.mul.x.vf vf1 vf1 vf2 :mask #b111) -; (.svf (&-> v1-88 quad) vf1) -; (set! s0-2 (-> s3-2 status)) -; (set! a0-62 s3-2) -; (set! v1-89 (-> a0-62 type)) -; (set! t9-13 (method-of-type v1-89 dummy-37)) -; (set! a1-19 s1-2) -; (call! a0-62 a1-19) -; (set! v1-90 v0-14) -; (set! (-> s3-2 status) s0-2) -; (set! s5-3 (+ s5-3 -1)) -; (set! a0-63 (<=0.si s5-3)) -; a0-63 -; ) -; (begin -; (set! a0-64 obj) -; (set! v1-92 (-> a0-64 type)) -; (set! t9-14 (method-of-type v1-92 dummy-42)) -; (set! a1-20 s3-2) -; (set! a2-8 s2-2) -; (set! v0-15 (call! a0-64 a1-20 a2-8)) -; (set! v1-93 v0-15) -; (set! v1-91 (not v1-93)) -; ) -; ) -; v1-91 -; ) -; (empty) -; ) -; (set! v1-95 (-> obj root-prim)) -; (set! s5-0 (-> v1-95 collide-with)) -; (set! v1-96 s5-0) -; ) -; ) -; ) -; (set! v1-70 s4-2) -; (set! a0-65 *collide-usually-hit-by-player-list*) -; (set! a0-66 (-> s4-2 next0)) -; (set! s4-2 a0-66) -; ) -; ) -; (set! v1-99 (logand s5-0 8)) -; (nonzero? v1-99) -; ) -; (set! v1-100 *collide-hit-by-others-list*) -; (set! v1-101 (-> v1-100 alive-list next0)) -; (set! a0-69 *collide-hit-by-others-list*) -; (set! a0-70 v1-101) -; (set! s4-3 (-> a0-70 next0)) -; (while (begin (set! a0-89 *collide-hit-by-others-list*) (set! a0-90 (-> a0-89 alive-list-end)) (!= v1-101 a0-90)) -; (when (begin -; (set! s3-3 (the-as collide-shape-moving (-> (the-as connection v1-101) param1))) -; (set! v1-102 (-> s3-3 root-prim)) -; (set! v1-103 (-> v1-102 prim-core collide-as)) -; (set! v1-104 (logand s5-0 v1-103)) -; (nonzero? v1-104) -; ) -; (when (begin (set! v1-106 (-> s3-3 process)) (set! a0-71 (-> obj process)) (!= a0-71 v1-106)) -; (when (begin -; (and -; (begin -; (set! s2-3 (new 'stack-no-clear 'collide-work)) -; (set! a0-72 obj) -; (set! v1-108 (-> a0-72 type)) -; (set! t9-15 (method-of-type v1-108 dummy-42)) -; (set! a1-21 s3-3) -; (set! a2-9 s2-3) -; (set! v0-16 (call! a0-72 a1-21 a2-9)) -; (set! v1-109 v0-16) -; v1-109 -; ) -; (begin -; (set! f0-21 -81.92) -; (set! f1-9 (-> s2-3 collide-sphere-neg-r x)) -; (set! v1-110 (the-as none (>=.s f0-21 f1-9))) -; ) -; ) -; v1-110 -; ) -; (set! a0-73 s3-3) -; (set! v1-112 (-> a0-73 type)) -; (set! t9-16 (method-of-type v1-112 dummy-32)) -; (set! a1-22 8192.0) -; (set! v1-113 (-> s3-3 root-prim)) -; (set! a2-10 (-> v1-113 collide-with)) -; (call! a0-73 a1-22 a2-10) -; (set! v1-114 v0-17) -; (set! s5-4 3) -; (until (begin -; (cond -; ((begin -; (set! s1-3 (new 'stack-no-clear 'vector)) -; (set! v1-115 (new 'stack-no-clear 'vector)) -; (set! a0-74 v1-115) -; (set! a1-23 (-> s3-3 trans)) -; (set! a1-24 (-> a1-23 quad)) -; (set! (-> a0-74 quad) a1-24) -; (set! f0-22 2867.2) -; (set! f1-10 (-> v1-115 y)) -; (set! f1-11 (+.s f0-22 f1-10)) -; (set! f0-23 5734.4) -; (set! f2-3 (+.s f0-23 f1-11)) -; (set! f0-24 (-> s2-3 inv-mat vector 1 y)) -; (<.s f0-24 f1-11) -; ) -; (set! f0-24 f1-11) -; (set! a0-76 (fpr->gpr f0-24)) -; ) -; ((<.s f2-3 f0-24) -; (set! f0-24 f2-3) -; (set! a0-78 (fpr->gpr f0-24)) -; ) -; ) -; (set! (-> v1-115 y) f0-24) -; (set! a0-79 (fpr->gpr f0-24)) -; (.lvf vf4 (&-> v1-115 quad)) -; (.lvf vf3 (&-> s2-3 inv-mat vector 1 quad)) -; (.lvf vf5 (&-> s2-3 inv-mat vector 2 quad)) -; (.sub.vf vf2 vf4 vf3) -; (.mul.vf vf1 vf5 vf2) -; (.add.x.vf vf1 vf1 vf1 :mask #b10) -; (.add.z.vf vf1 vf1 vf1 :mask #b10) -; (.mov v1-116 vf1) -; (bl! (<0.si v1-116) L129 (no-delay!)) -; (.sub.vf vf2 vf0 vf2) -; (or -; (begin -; (label cfg-94) -; (.svf (&-> s1-3 quad) vf2) -; (set! t9-17 vector-normalize!) -; (set! a0-80 s1-3) -; (set! a1-25 1.0) -; (call! a0-80 a1-25) -; (set! v1-117 s1-3) -; (set! a0-81 s1-3) -; (set! f0-25 (-> s2-3 collide-sphere-neg-r x)) -; (set! f0-26 (neg.s f0-25)) -; (set! v1-118 (vector-float*!2 v1-117 a0-81 f0-26)) -; (set! v1-119 s1-3) -; (set! a0-82 s1-3) -; (.lvf vf1 (&-> a0-82 quad)) -; (set! a0-83 *display*) -; (set! f0-27 (-> a0-83 frames-per-second)) -; (.mov at-3 f0-27) -; (.mov vf2 at-3) -; (.mov.vf vf1 vf0 :mask #b1000) -; (.mul.x.vf vf1 vf1 vf2 :mask #b111) -; (.svf (&-> v1-119 quad) vf1) -; (set! s0-3 (-> s3-3 status)) -; (set! a0-84 s3-3) -; (set! v1-120 (-> a0-84 type)) -; (set! t9-18 (method-of-type v1-120 dummy-37)) -; (set! a1-26 s1-3) -; (call! a0-84 a1-26) -; (set! v1-121 v0-19) -; (set! (-> s3-3 status) s0-3) -; (set! s5-4 (+ s5-4 -1)) -; (set! a0-85 (<=0.si s5-4)) -; a0-85 -; ) -; (begin -; (set! a0-86 obj) -; (set! v1-123 (-> a0-86 type)) -; (set! t9-19 (method-of-type v1-123 dummy-42)) -; (set! a1-27 s3-3) -; (set! a2-11 s2-3) -; (set! v0-20 (call! a0-86 a1-27 a2-11)) -; (set! v1-124 v0-20) -; (set! v1-122 (not v1-124)) -; ) -; ) -; v1-122 -; ) -; (empty) -; ) -; (set! v1-126 (-> obj root-prim)) -; (set! s5-0 (-> v1-126 collide-with)) -; (set! v1-127 s5-0) -; ) -; ) -; ) -; (set! v1-101 s4-3) -; (set! a0-87 *collide-hit-by-others-list*) -; (set! a0-88 (-> s4-3 next0)) -; (set! s4-3 a0-88) -; ) -; (set! v0-5 #f) -; ) -; ) -; (ret-value v0-5) -; ) -; ) +(defmethod respond-to-collisions! collide-shape ((obj collide-shape)) + "This is the main function to call to respond" + (local-vars + (at-0 int) + (at-1 int) + (at-2 int) + (at-3 int) + (v1-20 float) + (v1-53 float) + (v1-85 float) + (v1-116 float) + ) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + ) + (init-vf0-vector) + + ;; kill the mesh cache + (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-2 :likely-delay (set! a0-2 1)) + (label cfg-2) + (set! (-> v1-0 id) (the-as uint a0-2)) + ) + ) + + ;; loop over everything! + (let ((s5-0 (-> obj root-prim collide-with))) + + ;; we collide with target, so check the player list. + (when (logtest? s5-0 (collide-kind target)) + (let ((v1-5 (-> *collide-player-list* alive-list next0))) + *collide-player-list* + (let ((s4-0 (-> v1-5 next0))) + (while (!= v1-5 (-> *collide-player-list* alive-list-end)) + (let ((s3-0 (the-as collide-shape-moving (-> (the-as connection v1-5) param1)))) + (when (logtest? s5-0 (-> s3-0 root-prim prim-core collide-as)) + ;; we might collide with this! + (when (!= (-> obj process) (-> s3-0 process)) ;; self check + ;; see if we collide! + (let ((s2-0 (new 'stack-no-clear 'collide-overlap-result))) + (when (and (compute-overlap obj s3-0 s2-0) (>= -81.92 (-> s2-0 best-dist))) ;; we collide! + ;; fill the collide cache. + (fill-cache-for-shape! s3-0 8192.0 (-> s3-0 root-prim collide-with)) + ;; 3 iterations to solve it. + (let ((s5-1 3)) + (until (or (<= s5-1 0) (not (compute-overlap obj s3-0 s2-0))) ;; run until we're out. + (let ((s1-0 (new 'stack-no-clear 'vector))) + (let ((v1-19 (new 'stack-no-clear 'vector))) + (set! (-> v1-19 quad) (-> s3-0 trans quad)) + + ;; this is... a bit of a hack. + ;; this adjusts our collision to be within 0.7 - 1.4m of our base. + ;; (note, this only applies for intermediate iterations of this loop) + (let* ((f1-2 (+ 2867.2 (-> v1-19 y))) ;; f1-2 = 0.7 m above use + (f2-0 (+ 5734.4 f1-2)) ;; 1.4m above us + (f0-3 (-> s2-0 best-from-tri intersect y)) + ) + (cond + ((< f0-3 f1-2) + (set! f0-3 f1-2) + ) + ((< f2-0 f0-3) + (set! f0-3 f2-0) + ) + ) + (set! (-> v1-19 y) f0-3) + ) + (.lvf vf4 (&-> v1-19 quad)) + ) + (.lvf vf3 (&-> s2-0 best-from-tri intersect quad)) + (.lvf vf5 (&-> s2-0 best-from-tri normal quad)) + (.sub.vf vf2 vf4 vf3) + (.mul.vf vf1 vf5 vf2) + (.add.x.vf vf1 vf1 vf1 :mask #b10) + (.add.z.vf vf1 vf1 vf1 :mask #b10) + (.mov v1-20 vf1) + (b! (< (the-as int v1-20) 0) cfg-18 :likely-delay (.sub.vf vf2 vf0 vf2)) + (label cfg-18) + (.svf (&-> s1-0 quad) vf2) + (vector-normalize! s1-0 1.0) + (vector-float*! s1-0 s1-0 (- (-> s2-0 best-dist))) + (let ((v1-23 s1-0)) + (.lvf vf1 (&-> s1-0 quad)) + (let ((f0-6 (-> *display* frames-per-second))) + (.mov at-0 f0-6) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-23 quad) vf1) + ) + (let ((s0-0 (-> s3-0 status))) + ;; step. + (integrate-and-collide! s3-0 s1-0) + (set! (-> s3-0 status) s0-0) + ) + ) + (+! s5-1 -1) + ) + ) + (set! s5-0 (-> obj root-prim collide-with)) + ) + ) + ) + ) + ) + (set! v1-5 s4-0) + *collide-player-list* + (set! s4-0 (-> s4-0 next0)) + ) + ) + ) + ) + + + (when (logtest? s5-0 (collide-kind cak-1 cak-2 cak-3)) + + (when (logtest? s5-0 (collide-kind cak-1)) + (let ((v1-38 (-> *collide-hit-by-player-list* alive-list next0))) + *collide-hit-by-player-list* + (let ((s4-1 (-> v1-38 next0))) + (while (!= v1-38 (-> *collide-hit-by-player-list* alive-list-end)) + (let ((s3-1 (the-as collide-shape-moving (-> (the-as connection v1-38) param1)))) + (when (logtest? s5-0 (-> s3-1 root-prim prim-core collide-as)) + (when (!= (-> obj process) (-> s3-1 process)) + (let ((s2-1 (new 'stack-no-clear 'collide-overlap-result))) + (when (and (compute-overlap obj s3-1 s2-1) (>= -81.92 (-> s2-1 best-dist))) + (fill-cache-for-shape! s3-1 8192.0 (-> s3-1 root-prim collide-with)) + (let ((s5-2 3)) + (until (or (<= s5-2 0) (not (compute-overlap obj s3-1 s2-1))) + (let ((s1-1 (new 'stack-no-clear 'vector))) + (let ((v1-52 (new 'stack-no-clear 'vector))) + (set! (-> v1-52 quad) (-> s3-1 trans quad)) + (let* ((f1-5 (+ 2867.2 (-> v1-52 y))) + (f2-1 (+ 5734.4 f1-5)) + (f0-10 (-> s2-1 best-from-tri intersect y)) + ) + (cond + ((< f0-10 f1-5) + (set! f0-10 f1-5) + ) + ((< f2-1 f0-10) + (set! f0-10 f2-1) + ) + ) + (set! (-> v1-52 y) f0-10) + ) + (.lvf vf4 (&-> v1-52 quad)) + ) + (.lvf vf3 (&-> s2-1 best-from-tri intersect quad)) + (.lvf vf5 (&-> s2-1 best-from-tri normal quad)) + (.sub.vf vf2 vf4 vf3) + (.mul.vf vf1 vf5 vf2) + (.add.x.vf vf1 vf1 vf1 :mask #b10) + (.add.z.vf vf1 vf1 vf1 :mask #b10) + (.mov v1-53 vf1) + (b! (< (the-as int v1-53) 0) cfg-44 :likely-delay (.sub.vf vf2 vf0 vf2)) + (label cfg-44) + (.svf (&-> s1-1 quad) vf2) + (vector-normalize! s1-1 1.0) + (vector-float*! s1-1 s1-1 (- (-> s2-1 best-dist))) + (let ((v1-56 s1-1)) + (.lvf vf1 (&-> s1-1 quad)) + (let ((f0-13 (-> *display* frames-per-second))) + (.mov at-1 f0-13) + ) + (.mov vf2 at-1) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-56 quad) vf1) + ) + (let ((s0-1 (-> s3-1 status))) + (integrate-and-collide! s3-1 s1-1) + (set! (-> s3-1 status) s0-1) + ) + ) + (+! s5-2 -1) + ) + ) + (set! s5-0 (-> obj root-prim collide-with)) + ) + ) + ) + ) + ) + (set! v1-38 s4-1) + *collide-hit-by-player-list* + (set! s4-1 (-> s4-1 next0)) + ) + ) + ) + ) + + + (when (logtest? s5-0 (collide-kind cak-2)) + (let ((v1-70 (-> *collide-usually-hit-by-player-list* alive-list next0))) + *collide-usually-hit-by-player-list* + (let ((s4-2 (-> v1-70 next0))) + (while (!= v1-70 (-> *collide-usually-hit-by-player-list* alive-list-end)) + (let ((s3-2 (the-as collide-shape-moving (-> (the-as connection v1-70) param1)))) + (when (logtest? s5-0 (-> s3-2 root-prim prim-core collide-as)) + (when (!= (-> obj process) (-> s3-2 process)) + (let ((s2-2 (new 'stack-no-clear 'collide-overlap-result))) + (when (and (compute-overlap obj s3-2 s2-2) (>= -81.92 (-> s2-2 best-dist))) + (fill-cache-for-shape! s3-2 8192.0 (-> s3-2 root-prim collide-with)) + (let ((s5-3 3)) + (until (or (<= s5-3 0) (not (compute-overlap obj s3-2 s2-2))) + (let ((s1-2 (new 'stack-no-clear 'vector))) + (let ((v1-84 (new 'stack-no-clear 'vector))) + (set! (-> v1-84 quad) (-> s3-2 trans quad)) + (let* ((f1-8 (+ 2867.2 (-> v1-84 y))) + (f2-2 (+ 5734.4 f1-8)) + (f0-17 (-> s2-2 best-from-tri intersect y)) + ) + (cond + ((< f0-17 f1-8) + (set! f0-17 f1-8) + ) + ((< f2-2 f0-17) + (set! f0-17 f2-2) + ) + ) + (set! (-> v1-84 y) f0-17) + ) + (.lvf vf4 (&-> v1-84 quad)) + ) + (.lvf vf3 (&-> s2-2 best-from-tri intersect quad)) + (.lvf vf5 (&-> s2-2 best-from-tri normal quad)) + (.sub.vf vf2 vf4 vf3) + (.mul.vf vf1 vf5 vf2) + (.add.x.vf vf1 vf1 vf1 :mask #b10) + (.add.z.vf vf1 vf1 vf1 :mask #b10) + (.mov v1-85 vf1) + (b! (< (the-as int v1-85) 0) cfg-69 :likely-delay (.sub.vf vf2 vf0 vf2)) + (label cfg-69) + (.svf (&-> s1-2 quad) vf2) + (vector-normalize! s1-2 1.0) + (vector-float*! s1-2 s1-2 (- (-> s2-2 best-dist))) + (let ((v1-88 s1-2)) + (.lvf vf1 (&-> s1-2 quad)) + (let ((f0-20 (-> *display* frames-per-second))) + (.mov at-2 f0-20) + ) + (.mov vf2 at-2) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-88 quad) vf1) + ) + (let ((s0-2 (-> s3-2 status))) + (integrate-and-collide! s3-2 s1-2) + (set! (-> s3-2 status) s0-2) + ) + ) + (+! s5-3 -1) + ) + ) + (set! s5-0 (-> obj root-prim collide-with)) + ) + ) + ) + ) + ) + (set! v1-70 s4-2) + *collide-usually-hit-by-player-list* + (set! s4-2 (-> s4-2 next0)) + ) + ) + ) + ) + (when (logtest? s5-0 (collide-kind cak-3)) + (let ((v1-101 (-> *collide-hit-by-others-list* alive-list next0))) + *collide-hit-by-others-list* + (let ((s4-3 (-> v1-101 next0))) + (while (!= v1-101 (-> *collide-hit-by-others-list* alive-list-end)) + (let ((s3-3 (the-as collide-shape-moving (-> (the-as connection v1-101) param1)))) + (when (logtest? s5-0 (-> s3-3 root-prim prim-core collide-as)) + (when (!= (-> obj process) (-> s3-3 process)) + (let ((s2-3 (new 'stack-no-clear 'collide-overlap-result))) + (when (and (compute-overlap obj s3-3 s2-3) (>= -81.92 (-> s2-3 best-dist))) + (fill-cache-for-shape! s3-3 8192.0 (-> s3-3 root-prim collide-with)) + (let ((s5-4 3)) + (until (or (<= s5-4 0) (not (compute-overlap obj s3-3 s2-3))) + (let ((s1-3 (new 'stack-no-clear 'vector))) + (let ((v1-115 (new 'stack-no-clear 'vector))) + (set! (-> v1-115 quad) (-> s3-3 trans quad)) + (let* ((f1-11 (+ 2867.2 (-> v1-115 y))) + (f2-3 (+ 5734.4 f1-11)) + (f0-24 (-> s2-3 best-from-tri intersect y)) + ) + (cond + ((< f0-24 f1-11) + (set! f0-24 f1-11) + ) + ((< f2-3 f0-24) + (set! f0-24 f2-3) + ) + ) + (set! (-> v1-115 y) f0-24) + ) + (.lvf vf4 (&-> v1-115 quad)) + ) + (.lvf vf3 (&-> s2-3 best-from-tri intersect quad)) + (.lvf vf5 (&-> s2-3 best-from-tri normal quad)) + (.sub.vf vf2 vf4 vf3) + (.mul.vf vf1 vf5 vf2) + (.add.x.vf vf1 vf1 vf1 :mask #b10) + (.add.z.vf vf1 vf1 vf1 :mask #b10) + (.mov v1-116 vf1) + (b! (< (the-as int v1-116) 0) cfg-94 :likely-delay (.sub.vf vf2 vf0 vf2)) + (label cfg-94) + (.svf (&-> s1-3 quad) vf2) + (vector-normalize! s1-3 1.0) + (vector-float*! s1-3 s1-3 (- (-> s2-3 best-dist))) + (let ((v1-119 s1-3)) + (.lvf vf1 (&-> s1-3 quad)) + (let ((f0-27 (-> *display* frames-per-second))) + (.mov at-3 f0-27) + ) + (.mov vf2 at-3) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-119 quad) vf1) + ) + (let ((s0-3 (-> s3-3 status))) + (integrate-and-collide! s3-3 s1-3) + (set! (-> s3-3 status) s0-3) + ) + ) + (+! s5-4 -1) + ) + ) + (set! s5-0 (-> obj root-prim collide-with)) + ) + ) + ) + ) + ) + (set! v1-101 s4-3) + *collide-hit-by-others-list* + (set! s4-3 (-> s4-3 next0)) + ) + ) + ) + #f + ) + ) + ) + ) + ) -;; ERROR: function was not converted to expressions. Cannot decompile. +;;;;;;;;;;;;;;;;;;;;;;; +;; overlap test +;;;;;;;;;;;;;;;;;;;;;;; -(defmethod overlaps-others-test collide-shape-prim ((obj collide-shape-prim)) +(defmethod find-overlapping-shapes collide-shape ((obj collide-shape) (arg0 overlaps-others-params)) + (local-vars + (v1-2 symbol) + (v1-7 symbol) + (v1-12 symbol) + (v1-17 symbol) + (a0-9 uint) + (a0-10 touching-list) + (a0-24 uint) + (a0-25 touching-list) + (a0-37 uint) + (a0-38 touching-list) + (a0-50 uint) + (a0-51 touching-list) + (a3-0 float) + (a3-1 uint) + (a3-3 float) + (a3-4 uint) + (a3-6 float) + (a3-7 uint) + (a3-9 float) + (a3-10 uint) + (s2-0 symbol) + ) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (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-2 :likely-delay (set! a0-2 1)) + (label cfg-2) + (set! (-> v1-0 id) (the-as uint a0-2)) + ) + ) + (let ((s3-0 (the-as object #f))) + (let ((s4-0 (-> obj root-prim))) + (.lvf vf1 (&-> s4-0 prim-core world-sphere quad)) + (let ((v1-1 (-> s4-0 collide-with))) + (b! (zero? (logand v1-1 (collide-kind target))) cfg-17) + (let ((a0-6 (-> *collide-player-list* alive-list next0))) + *collide-player-list* + (let ((s1-0 (-> a0-6 next0))) + (while (!= a0-6 (-> *collide-player-list* alive-list-end)) + (let* ((a0-7 (the-as collide-shape-moving (-> (the-as connection a0-6) param1))) + (a2-0 (-> a0-7 root-prim)) + ) + (when (logtest? v1-1 (-> a2-0 prim-core collide-as)) + (.lvf vf2 (&-> a2-0 prim-core world-sphere quad)) + (.sub.vf vf3 vf1 vf2) + (.add.w.vf vf4 vf1 vf2 :mask #b1000) + (.mul.vf vf3 vf3 vf3 :mask #b111) + (.mul.w.vf vf4 vf4 vf4 :mask #b1000) + (.mul.x.vf acc vf0 vf3 :mask #b1000) + (.add.mul.y.vf acc vf0 vf3 acc :mask #b1000) + (.add.mul.z.vf vf3 vf0 vf3 acc :mask #b1000) + (.sub.w.vf vf3 vf3 vf4 :mask #b1000) + (let ((f0-0 0.0)) + (.add.w.vf vf3 vf0 vf3 :mask #b1) + (let ((a1-6 (-> obj process))) + (.mov a3-0 vf3) + (let ((a0-8 (-> a0-7 process))) + (b! (< f0-0 a3-0) cfg-13 :delay (set! a3-1 (-> arg0 options))) + (b! (= a1-6 a0-8) cfg-13 :delay (set! a0-9 (logand a3-1 2))) + ) + ) + ) + (b! (zero? a0-9) cfg-10 :delay (set! a0-10 (-> arg0 tlist))) + (b! (= a0-10 #f) cfg-11 :delay (set! v1-2 #t)) + (set! s2-0 v1-2) + (add-touching-prims a0-10 s4-0 a2-0 -1.0 (the-as collide-tri-result #f) (the-as collide-tri-result #f)) + (b! #t cfg-11 :delay #t) + (label cfg-10) + (set! s2-0 (overlaps-others-test s4-0 arg0 a2-0)) + (label cfg-11) + (.lvf vf1 (&-> s4-0 prim-core world-sphere quad)) + (b! (= s2-0 #f) cfg-13 :delay (set! v1-1 (-> s4-0 collide-with))) + (b! (= (-> arg0 tlist) #f) cfg-63 :delay (set! s3-0 0)) + (label cfg-13) + 0 + ) + ) + (set! a0-6 s1-0) + *collide-player-list* + (set! s1-0 (-> s1-0 next0)) + ) + ) + ) + (label cfg-17) + (when (logtest? v1-1 (collide-kind cak-1 cak-2 cak-3)) + (when (logtest? v1-1 (collide-kind cak-1)) + (let ((a0-21 (-> *collide-hit-by-player-list* alive-list next0))) + *collide-hit-by-player-list* + (let ((s1-1 (-> a0-21 next0))) + (while (!= a0-21 (-> *collide-hit-by-player-list* alive-list-end)) + (let* ((a0-22 (the-as collide-shape-moving (-> (the-as connection a0-21) param1))) + (a2-1 (-> a0-22 root-prim)) + ) + (when (logtest? v1-1 (-> a2-1 prim-core collide-as)) + (.lvf vf2 (&-> a2-1 prim-core world-sphere quad)) + (.sub.vf vf3 vf1 vf2) + (.add.w.vf vf4 vf1 vf2 :mask #b1000) + (.mul.vf vf3 vf3 vf3 :mask #b111) + (.mul.w.vf vf4 vf4 vf4 :mask #b1000) + (.mul.x.vf acc vf0 vf3 :mask #b1000) + (.add.mul.y.vf acc vf0 vf3 acc :mask #b1000) + (.add.mul.z.vf vf3 vf0 vf3 acc :mask #b1000) + (.sub.w.vf vf3 vf3 vf4 :mask #b1000) + (let ((f0-1 0.0)) + (.add.w.vf vf3 vf0 vf3 :mask #b1) + (let ((a1-18 (-> obj process))) + (.mov a3-3 vf3) + (let ((a0-23 (-> a0-22 process))) + (b! (< f0-1 a3-3) cfg-29 :delay (set! a3-4 (-> arg0 options))) + (b! (= a1-18 a0-23) cfg-29 :delay (set! a0-24 (logand a3-4 2))) + ) + ) + ) + (b! (zero? a0-24) cfg-26 :delay (set! a0-25 (-> arg0 tlist))) + (b! (= a0-25 #f) cfg-27 :delay (set! v1-7 #t)) + (set! s2-0 v1-7) + (add-touching-prims a0-25 s4-0 a2-1 -1.0 (the-as collide-tri-result #f) (the-as collide-tri-result #f)) + (b! #t cfg-27 :delay #t) + (label cfg-26) + (set! s2-0 (overlaps-others-test s4-0 arg0 a2-1)) + (label cfg-27) + (.lvf vf1 (&-> s4-0 prim-core world-sphere quad)) + (b! (= s2-0 #f) cfg-29 :delay (set! v1-1 (-> s4-0 collide-with))) + (b! (= (-> arg0 tlist) #f) cfg-63 :delay (set! s3-0 0)) + (label cfg-29) + 0 + ) + ) + (set! a0-21 s1-1) + *collide-hit-by-player-list* + (set! s1-1 (-> s1-1 next0)) + ) + ) + ) + ) + (when (logtest? v1-1 (collide-kind cak-2)) + (let ((a0-34 (-> *collide-usually-hit-by-player-list* alive-list next0))) + *collide-usually-hit-by-player-list* + (let ((s1-2 (-> a0-34 next0))) + (while (!= a0-34 (-> *collide-usually-hit-by-player-list* alive-list-end)) + (let* ((a0-35 (the-as collide-shape-moving (-> (the-as connection a0-34) param1))) + (a2-2 (-> a0-35 root-prim)) + ) + (when (logtest? v1-1 (-> a2-2 prim-core collide-as)) + (.lvf vf2 (&-> a2-2 prim-core world-sphere quad)) + (.sub.vf vf3 vf1 vf2) + (.add.w.vf vf4 vf1 vf2 :mask #b1000) + (.mul.vf vf3 vf3 vf3 :mask #b111) + (.mul.w.vf vf4 vf4 vf4 :mask #b1000) + (.mul.x.vf acc vf0 vf3 :mask #b1000) + (.add.mul.y.vf acc vf0 vf3 acc :mask #b1000) + (.add.mul.z.vf vf3 vf0 vf3 acc :mask #b1000) + (.sub.w.vf vf3 vf3 vf4 :mask #b1000) + (let ((f0-2 0.0)) + (.add.w.vf vf3 vf0 vf3 :mask #b1) + (let ((a1-30 (-> obj process))) + (.mov a3-6 vf3) + (let ((a0-36 (-> a0-35 process))) + (b! (< f0-2 a3-6) cfg-44 :delay (set! a3-7 (-> arg0 options))) + (b! (= a1-30 a0-36) cfg-44 :delay (set! a0-37 (logand a3-7 2))) + ) + ) + ) + (b! (zero? a0-37) cfg-41 :delay (set! a0-38 (-> arg0 tlist))) + (b! (= a0-38 #f) cfg-42 :delay (set! v1-12 #t)) + (set! s2-0 v1-12) + (add-touching-prims a0-38 s4-0 a2-2 -1.0 (the-as collide-tri-result #f) (the-as collide-tri-result #f)) + (b! #t cfg-42 :delay #t) + (label cfg-41) + (set! s2-0 (overlaps-others-test s4-0 arg0 a2-2)) + (label cfg-42) + (.lvf vf1 (&-> s4-0 prim-core world-sphere quad)) + (b! (= s2-0 #f) cfg-44 :delay (set! v1-1 (-> s4-0 collide-with))) + (b! (= (-> arg0 tlist) #f) cfg-63 :delay (set! s3-0 0)) + (label cfg-44) + 0 + ) + ) + (set! a0-34 s1-2) + *collide-usually-hit-by-player-list* + (set! s1-2 (-> s1-2 next0)) + ) + ) + ) + ) + (when (logtest? v1-1 (collide-kind cak-3)) + (let ((a0-47 (-> *collide-hit-by-others-list* alive-list next0))) + *collide-hit-by-others-list* + (let ((s1-3 (-> a0-47 next0))) + (while (!= a0-47 (-> *collide-hit-by-others-list* alive-list-end)) + (let* ((a0-48 (the-as collide-shape-moving (-> (the-as connection a0-47) param1))) + (a2-3 (-> a0-48 root-prim)) + ) + (when (logtest? v1-1 (-> a2-3 prim-core collide-as)) + (.lvf vf2 (&-> a2-3 prim-core world-sphere quad)) + (.sub.vf vf3 vf1 vf2) + (.add.w.vf vf4 vf1 vf2 :mask #b1000) + (.mul.vf vf3 vf3 vf3 :mask #b111) + (.mul.w.vf vf4 vf4 vf4 :mask #b1000) + (.mul.x.vf acc vf0 vf3 :mask #b1000) + (.add.mul.y.vf acc vf0 vf3 acc :mask #b1000) + (.add.mul.z.vf vf3 vf0 vf3 acc :mask #b1000) + (.sub.w.vf vf3 vf3 vf4 :mask #b1000) + (let ((f0-3 0.0)) + (.add.w.vf vf3 vf0 vf3 :mask #b1) + (let ((a1-42 (-> obj process))) + (.mov a3-9 vf3) + (let ((a0-49 (-> a0-48 process))) + (b! (< f0-3 a3-9) cfg-59 :delay (set! a3-10 (-> arg0 options))) + (b! (= a1-42 a0-49) cfg-59 :delay (set! a0-50 (logand a3-10 2))) + ) + ) + ) + (b! (zero? a0-50) cfg-56 :delay (set! a0-51 (-> arg0 tlist))) + (b! (= a0-51 #f) cfg-57 :delay (set! v1-17 #t)) + (set! s2-0 v1-17) + (add-touching-prims a0-51 s4-0 a2-3 -1.0 (the-as collide-tri-result #f) (the-as collide-tri-result #f)) + (b! #t cfg-57 :delay #t) + (label cfg-56) + (set! s2-0 (overlaps-others-test s4-0 arg0 a2-3)) + (label cfg-57) + (.lvf vf1 (&-> s4-0 prim-core world-sphere quad)) + (b! (= s2-0 #f) cfg-59 :delay (set! v1-1 (-> s4-0 collide-with))) + (b! (= (-> arg0 tlist) #f) cfg-63 :delay (set! s3-0 0)) + (label cfg-59) + 0 + ) + ) + (set! a0-47 s1-3) + *collide-hit-by-others-list* + (set! s1-3 (-> s1-3 next0)) + ) + ) + ) + ) + ) + ) + ) + (label cfg-63) + (b! (= (the-as int s3-0) #f) cfg-65 :delay (nop!)) + (set! s3-0 #t) + (label cfg-65) + (the-as symbol s3-0) + ) + ) + ) + +(defmethod overlaps-others-test collide-shape-prim ((obj collide-shape-prim) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) (format 0 "ERROR: Unsupported call to collide-shape-prim::overlaps-others-test!~%") #f ) -;; ERROR: function was not converted to expressions. Cannot decompile. -;; ERROR: function was not converted to expressions. Cannot decompile. +(defmethod overlaps-others-test collide-shape-prim-group ((obj collide-shape-prim-group) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) + (local-vars (a1-3 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 (-> obj prims)) + (s3-0 (-> obj num-prims-u)) + (s2-0 (the-as object #f)) + ) + (let ((v1-0 (-> arg1 prim-core collide-as))) + (nop!) + (.lvf vf1 (&-> arg1 prim-core world-sphere quad)) + (label cfg-1) + (b! (zero? s3-0) cfg-6 :delay (nop!)) + (+! s3-0 -1) + (let ((a0-1 (-> s4-0 0))) + (set! s4-0 (&-> s4-0 1)) + (let ((a1-2 (logand (-> a0-1 collide-with) v1-0))) + (.lvf vf2 (&-> a0-1 prim-core world-sphere quad)) + (b! (zero? a1-2) cfg-1 :delay (.sub.vf vf3 vf2 vf1)) + ) + (.add.w.vf vf4 vf2 vf1 :mask #b1000) + (.mul.vf vf3 vf3 vf3 :mask #b111) + (.mul.w.vf vf4 vf4 vf4 :mask #b1000) + (.mul.x.vf acc vf0 vf3 :mask #b1000) + (.add.mul.y.vf acc vf0 vf3 acc :mask #b1000) + (.add.mul.z.vf vf3 vf0 vf3 acc :mask #b1000) + (.sub.w.vf vf3 vf3 vf4 :mask #b1000) + (let ((f0-0 0.0)) + (.add.w.vf vf3 vf0 vf3 :mask #b1) + (.mov a1-3 vf3) + (b! (< f0-0 a1-3) cfg-1) + ) + (let ((a0-2 (overlaps-others-test a0-1 arg0 arg1))) + (set! v1-0 (-> arg1 prim-core collide-as)) + (b! (= a0-2 #f) cfg-1 :delay (.lvf vf1 (&-> arg1 prim-core world-sphere quad))) + ) + ) + ) + (b! (!= (-> arg0 tlist) #f) cfg-1 :delay (set! s2-0 0)) + (label cfg-6) + (b! (= (the-as int s2-0) #f) cfg-8 :delay (nop!)) + (set! s2-0 #t) + (label cfg-8) + (the-as symbol s2-0) + ) + ) + ) -;; ERROR: function was not converted to expressions. Cannot decompile. -;; ERROR: function was not converted to expressions. Cannot decompile. +(defmethod overlaps-others-group collide-shape-prim ((obj collide-shape-prim) (arg0 overlaps-others-params) (arg1 collide-shape-prim-group)) + "Overlap, from group." + (local-vars (a0-3 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 (-> arg1 prims)) + (s3-0 (-> arg1 num-prims-u)) + (s2-0 (the-as object #f)) + ) + (let ((v1-0 (-> obj collide-with))) + (nop!) + (.lvf vf2 (&-> obj prim-core world-sphere quad)) + (label cfg-1) + (b! (zero? s3-0) cfg-6 :delay (nop!)) + (+! s3-0 -1) + (let ((a2-1 (-> s4-0 0))) + (set! s4-0 (&-> s4-0 1)) + (let ((a0-2 (logand v1-0 (-> a2-1 prim-core collide-as)))) + (.lvf vf1 (&-> a2-1 prim-core world-sphere quad)) + (b! (zero? a0-2) cfg-1 :delay (.sub.vf vf3 vf2 vf1)) + ) + (.add.w.vf vf4 vf2 vf1 :mask #b1000) + (.mul.vf vf3 vf3 vf3 :mask #b111) + (.mul.w.vf vf4 vf4 vf4 :mask #b1000) + (.mul.x.vf acc vf0 vf3 :mask #b1000) + (.add.mul.y.vf acc vf0 vf3 acc :mask #b1000) + (.add.mul.z.vf vf3 vf0 vf3 acc :mask #b1000) + (.sub.w.vf vf3 vf3 vf4 :mask #b1000) + (let ((f0-0 0.0)) + (.add.w.vf vf3 vf0 vf3 :mask #b1) + (.mov a0-3 vf3) + (b! (< f0-0 a0-3) cfg-1) + ) + (let ((a0-5 (overlaps-others-test obj arg0 a2-1))) + (set! v1-0 (-> obj collide-with)) + (b! (= a0-5 #f) cfg-1 :delay (.lvf vf2 (&-> obj prim-core world-sphere quad))) + ) + ) + ) + (b! (!= (-> arg0 tlist) #f) cfg-1 :delay (set! s2-0 0)) + (label cfg-6) + (b! (= (the-as int s2-0) #f) cfg-8 :delay (nop!)) + (set! s2-0 #t) + (label cfg-8) + (the-as symbol s2-0) + ) + ) + ) + +(defmethod overlaps-others-test collide-shape-prim-sphere ((obj collide-shape-prim-sphere) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) + (local-vars (v1-26 collide-action)) + (let ((v1-0 (-> arg1 prim-core prim-type))) + (b! (nonzero? v1-0) cfg-2 :delay (nop!)) + (let ((v0-1 (overlaps-others-group obj arg0 (the-as collide-shape-prim-group arg1)))) + (b! #t cfg-20 :delay (nop!)) + (label cfg-2) + (b! (> v1-0 0) cfg-4 :delay (nop!)) + (b! #t cfg-14 :delay (nop!)) + (label cfg-4) + (let ((s3-0 (-> (the-as collide-shape-prim-mesh arg1) mesh))) + (b! (not s3-0) cfg-13) + (let ((s2-0 *collide-mesh-cache*)) + (let ((v1-4 (-> s2-0 id))) + (b! (= (-> (the-as collide-shape-prim-mesh arg1) mesh-cache-id) v1-4) cfg-10) + ) + (let ((v1-8 (allocate! s2-0 (* 96 (-> s3-0 num-tris))))) + (b! (not v1-8) cfg-8 :delay (nop!)) + (set! (-> (the-as collide-shape-prim-mesh arg1) mesh-cache-tris) + (the-as (inline-array collide-mesh-cache-tri) v1-8) + ) + ) + (set! (-> (the-as collide-shape-prim-mesh arg1) mesh-cache-id) (-> s2-0 id)) + ) + (populate-cache! + s3-0 + (the-as collide-mesh-cache-tri (-> (the-as collide-shape-prim-mesh arg1) mesh-cache-tris)) + (-> (the-as collide-shape-prim-mesh arg1) + cshape + process + node-list + data + (-> (the-as collide-shape-prim-mesh arg1) transform-index) + bone + transform + ) + ) + (b! #t cfg-10 :delay (nop!)) + (label cfg-8) + (set! v0-1 #f) + (b! #t cfg-20 :delay (nop!)) + (the-as none 0) + (label cfg-10) + (b! + (not (overlap-test + s3-0 + (the-as collide-mesh-cache-tri (-> (the-as collide-shape-prim-mesh arg1) mesh-cache-tris)) + (the-as vector (-> obj prim-core)) + ) + ) + cfg-13 + ) + ) + (b! #t cfg-14 :delay (nop!)) + (the-as none 0) + (label cfg-13) + (set! v0-1 #f) + (b! #t cfg-20 :delay (nop!)) + (label cfg-14) + (let ((a0-6 (-> arg0 tlist))) + (b! (= a0-6 #f) cfg-16 :delay (nop!)) + (add-touching-prims a0-6 obj arg1 -1.0 (the-as collide-tri-result #f) (the-as collide-tri-result #f)) + ) + (label cfg-16) + (b! (zero? (logand (-> arg0 options) 1)) cfg-19 :delay (set! v1-26 (-> obj prim-core action))) + (let ((a0-7 (-> arg1 prim-core action))) + (b! (logtest? (logand v1-26 (collide-action solid)) a0-7) cfg-19 :delay (nop!)) + ) + (set! v0-1 #f) + (b! #t cfg-20 :delay (nop!)) + (label cfg-19) + (set! v0-1 #t) + (label cfg-20) + v0-1 + ) + ) + ) + +(defmethod overlaps-others-test collide-shape-prim-mesh ((obj collide-shape-prim-mesh) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) + (local-vars (v1-26 collide-action)) + (let ((v1-0 (-> arg1 prim-core prim-type))) + (b! (nonzero? v1-0) cfg-2 :delay (nop!)) + (let ((v0-1 (overlaps-others-group obj arg0 (the-as collide-shape-prim-group arg1)))) + (b! #t cfg-20 :delay (nop!)) + (label cfg-2) + (b! (> v1-0 0) cfg-13 :delay (nop!)) + (let ((s3-0 (-> obj mesh))) + (b! (not s3-0) cfg-12) + (let ((s2-0 *collide-mesh-cache*)) + (let ((v1-4 (-> s2-0 id))) + (b! (= (-> obj mesh-cache-id) v1-4) cfg-9) + ) + (let ((v1-8 (allocate! s2-0 (* 96 (-> s3-0 num-tris))))) + (b! (not v1-8) cfg-7 :delay (nop!)) + (set! (-> obj mesh-cache-tris) (the-as (inline-array collide-mesh-cache-tri) v1-8)) + ) + (set! (-> obj mesh-cache-id) (-> s2-0 id)) + ) + (populate-cache! + s3-0 + (the-as collide-mesh-cache-tri (-> obj mesh-cache-tris)) + (-> obj cshape process node-list data (-> obj transform-index) bone transform) + ) + (b! #t cfg-9 :delay (nop!)) + (label cfg-7) + (set! v0-1 #f) + (b! #t cfg-20 :delay (nop!)) + (the-as none 0) + (label cfg-9) + (b! + (not + (overlap-test + s3-0 + (the-as collide-mesh-cache-tri (-> obj mesh-cache-tris)) + (the-as vector (-> arg1 prim-core)) + ) + ) + cfg-12 + ) + ) + (b! #t cfg-14 :delay (nop!)) + (the-as none 0) + (label cfg-12) + (set! v0-1 #f) + (b! #t cfg-20 :delay (nop!)) + (label cfg-13) + (format + 0 + "ERROR: Unsupported mesh -> mesh test attempted in collide-shape-prim-mesh::overlaps-others-test!~%" + ) + (set! v0-1 #f) + (b! #t cfg-20 :delay (nop!)) + (label cfg-14) + (let ((a0-7 (-> arg0 tlist))) + (b! (= a0-7 #f) cfg-16 :delay (nop!)) + (add-touching-prims a0-7 obj arg1 -1.0 (the-as collide-tri-result #f) (the-as collide-tri-result #f)) + ) + (label cfg-16) + (b! (zero? (logand (-> arg0 options) 1)) cfg-19 :delay (set! v1-26 (-> obj prim-core action))) + (let ((a0-8 (-> arg1 prim-core action))) + (b! (logtest? (logand v1-26 (collide-action solid)) a0-8) cfg-19 :delay (nop!)) + ) + (set! v0-1 #f) + (b! #t cfg-20 :delay (nop!)) + (label cfg-19) + (set! v0-1 #t) + (label cfg-20) + v0-1 + ) + ) + ) (defmethod clear-collide-with-as collide-shape ((obj collide-shape)) (set! (-> obj root-prim collide-with) (collide-kind)) @@ -2617,7 +3403,7 @@ (none) ) -(defmethod dummy-53 collide-shape ((obj collide-shape) (arg0 int) (arg1 collide-kind) (arg2 collide-kind)) +(defmethod set-collide-kinds collide-shape ((obj collide-shape) (arg0 int) (arg1 collide-kind) (arg2 collide-kind)) (let ((s3-0 (-> obj root-prim))) (if (logtest? (-> s3-0 prim-id) arg0) (set! (-> s3-0 prim-core collide-as) (logior (logclear (-> s3-0 prim-core collide-as) arg1) arg2)) @@ -2629,7 +3415,7 @@ ) (when v1-7 (dotimes (a0-4 (-> (the-as collide-shape-prim-group v1-7) num-prims)) - (let ((a1-4 (-> (the-as collide-shape-prim-group (+ (* a0-4 4) (the-as int v1-7))) prims 0))) + (let ((a1-4 (-> (the-as collide-shape-prim-group v1-7) prims a0-4))) (if (logtest? (-> a1-4 prim-id) arg0) (set! (-> a1-4 prim-core collide-as) (logior (logclear (-> a1-4 prim-core collide-as) arg1) arg2)) ) @@ -2642,7 +3428,7 @@ (none) ) -(defmethod dummy-54 collide-shape ((obj collide-shape) (arg0 int) (arg1 collide-offense)) +(defmethod set-collide-offense collide-shape ((obj collide-shape) (arg0 int) (arg1 collide-offense)) (let ((s4-0 (-> obj root-prim))) (if (logtest? (-> s4-0 prim-id) arg0) (set! (-> s4-0 prim-core offense) arg1) @@ -2654,7 +3440,7 @@ ) (when v1-5 (dotimes (a0-3 (-> (the-as collide-shape-prim-group v1-5) num-prims)) - (let ((a1-4 (-> (the-as collide-shape-prim-group (+ (* a0-3 4) (the-as int v1-5))) prims 0))) + (let ((a1-4 (-> (the-as collide-shape-prim-group v1-5) prims a0-3))) (if (logtest? (-> a1-4 prim-id) arg0) (set! (-> a1-4 prim-core offense) arg1) ) @@ -2667,7 +3453,7 @@ (none) ) -(defmethod dummy-55 collide-shape ((obj collide-shape) (arg0 process) (arg1 touching-shapes-entry) (arg2 float) (arg3 float) (arg4 float)) +(defmethod send-shove-back collide-shape ((obj collide-shape) (arg0 process) (arg1 touching-shapes-entry) (arg2 float) (arg3 float) (arg4 float)) (local-vars (sv-144 process)) (with-pp (when arg1 @@ -2679,9 +3465,9 @@ ) ) (when (and s1-0 s5-0) - (let ((s0-1 (get-touched-prim s1-0 obj (the-as touching-prims-entry arg1)))) - (get-touched-prim s1-0 (-> (the-as process-drawable s5-0) root) (the-as touching-prims-entry arg1)) - (let* ((v1-8 (dummy-11 s1-0 (new 'stack-no-clear 'vector))) + (let ((s0-1 (get-touched-prim s1-0 obj arg1))) + (get-touched-prim s1-0 (-> (the-as process-drawable s5-0) root) arg1) + (let* ((v1-8 (get-middle-of-bsphere-overlap s1-0 (new 'stack-no-clear 'vector))) (s1-2 (vector-! (new 'stack-no-clear 'vector) v1-8 (the-as vector (-> s0-1 prim-core)))) ) (vector-normalize! s1-2 1.0) diff --git a/goal_src/engine/collide/collide-target-h.gc b/goal_src/engine/collide/collide-target-h.gc index 5739baa907..2660cb6678 100644 --- a/goal_src/engine/collide/collide-target-h.gc +++ b/goal_src/engine/collide/collide-target-h.gc @@ -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? diff --git a/goal_src/engine/collide/collide-touch-h.gc b/goal_src/engine/collide/collide-touch-h.gc index 9bb5c1d76b..1e8dcbc572 100644 --- a/goal_src/engine/collide/collide-touch-h.gc +++ b/goal_src/engine/collide/collide-touch-h.gc @@ -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) ) ) diff --git a/goal_src/engine/collide/collide-touch.gc b/goal_src/engine/collide/collide-touch.gc index 91dccc8cda..783f1cdbcc 100644 --- a/goal_src/engine/collide/collide-touch.gc +++ b/goal_src/engine/collide/collide-touch.gc @@ -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 diff --git a/goal_src/engine/debug/viewer.gc b/goal_src/engine/debug/viewer.gc index 836edda029..77777516f2 100644 --- a/goal_src/engine/debug/viewer.gc +++ b/goal_src/engine/debug/viewer.gc @@ -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 diff --git a/goal_src/engine/draw/process-drawable.gc b/goal_src/engine/draw/process-drawable.gc index 54aea2b268..f6a52e23c0 100644 --- a/goal_src/engine/draw/process-drawable.gc +++ b/goal_src/engine/draw/process-drawable.gc @@ -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 ) diff --git a/goal_src/engine/game/collectables.gc b/goal_src/engine/game/collectables.gc index 67c4f19c83..0125300dde 100644 --- a/goal_src/engine/game/collectables.gc +++ b/goal_src/engine/game/collectables.gc @@ -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)) diff --git a/goal_src/engine/game/crates.gc b/goal_src/engine/game/crates.gc index 2618c20b27..81a5842c8d 100644 --- a/goal_src/engine/game/crates.gc +++ b/goal_src/engine/game/crates.gc @@ -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) diff --git a/goal_src/engine/game/generic-obs.gc b/goal_src/engine/game/generic-obs.gc index 871c089bf4..750a1a8090 100644 --- a/goal_src/engine/game/generic-obs.gc +++ b/goal_src/engine/game/generic-obs.gc @@ -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) ) diff --git a/goal_src/engine/game/powerups.gc b/goal_src/engine/game/powerups.gc index 1a975964d4..02d097e91e 100644 --- a/goal_src/engine/game/powerups.gc +++ b/goal_src/engine/game/powerups.gc @@ -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 diff --git a/goal_src/engine/game/projectiles.gc b/goal_src/engine/game/projectiles.gc index b524e3b623..c7305e7d88 100644 --- a/goal_src/engine/game/projectiles.gc +++ b/goal_src/engine/game/projectiles.gc @@ -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 diff --git a/goal_src/engine/game/task/process-taskable.gc b/goal_src/engine/game/task/process-taskable.gc index c95fba5be2..554588e53a 100644 --- a/goal_src/engine/game/task/process-taskable.gc +++ b/goal_src/engine/game/task/process-taskable.gc @@ -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 diff --git a/goal_src/engine/gfx/water/water.gc b/goal_src/engine/gfx/water/water.gc index a77bdc26fa..71b58e712e 100644 --- a/goal_src/engine/gfx/water/water.gc +++ b/goal_src/engine/gfx/water/water.gc @@ -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) ) diff --git a/goal_src/engine/target/logic-target.gc b/goal_src/engine/target/logic-target.gc index 65e9b22e19..bbb1101862 100644 --- a/goal_src/engine/target/logic-target.gc +++ b/goal_src/engine/target/logic-target.gc @@ -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*) diff --git a/goal_src/engine/target/target-death.gc b/goal_src/engine/target/target-death.gc index dcf3d4301c..f8de973fce 100644 --- a/goal_src/engine/target/target-death.gc +++ b/goal_src/engine/target/target-death.gc @@ -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) ) ) diff --git a/goal_src/engine/target/target-h.gc b/goal_src/engine/target/target-h.gc index e984c80643..fa274cda4c 100644 --- a/goal_src/engine/target/target-h.gc +++ b/goal_src/engine/target/target-h.gc @@ -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 diff --git a/goal_src/engine/target/target-util.gc b/goal_src/engine/target/target-util.gc index 81d1f91b5d..85825fc9bb 100644 --- a/goal_src/engine/target/target-util.gc +++ b/goal_src/engine/target/target-util.gc @@ -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) ) diff --git a/goal_src/engine/target/target2.gc b/goal_src/engine/target/target2.gc index 27755642b1..ab0699c668 100644 --- a/goal_src/engine/target/target2.gc +++ b/goal_src/engine/target/target2.gc @@ -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: : 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))) ) ) diff --git a/goal_src/levels/beach/beach-obs.gc b/goal_src/levels/beach/beach-obs.gc index db589b77fb..15c482c7b8 100644 --- a/goal_src/levels/beach/beach-obs.gc +++ b/goal_src/levels/beach/beach-obs.gc @@ -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))) diff --git a/goal_src/levels/beach/beach-rocks.gc b/goal_src/levels/beach/beach-rocks.gc index f2266bfec5..725ea09f25 100644 --- a/goal_src/levels/beach/beach-rocks.gc +++ b/goal_src/levels/beach/beach-rocks.gc @@ -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 diff --git a/goal_src/levels/beach/lurkercrab.gc b/goal_src/levels/beach/lurkercrab.gc index 698d282854..e0ecd01d4c 100644 --- a/goal_src/levels/beach/lurkercrab.gc +++ b/goal_src/levels/beach/lurkercrab.gc @@ -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)) diff --git a/goal_src/levels/beach/mayor.gc b/goal_src/levels/beach/mayor.gc index 5d43016c5a..5079ccfad3 100644 --- a/goal_src/levels/beach/mayor.gc +++ b/goal_src/levels/beach/mayor.gc @@ -27,1980 +27,614 @@ (defmethod dummy-52 mayor ((obj mayor)) (let ((v1-1 (-> obj draw shadow-ctrl))) - (when v1-1 - (let ((f0-0 (-> obj root-override trans y))) - (let ((a0-2 v1-1)) - (set! (-> a0-2 settings bot-plane w) (- (+ -2048.0 f0-0))) + (when v1-1 + (let ((f0-0 (-> obj root-override trans y))) + (let ((a0-2 v1-1)) + (set! (-> a0-2 settings bot-plane w) (- (+ -2048.0 f0-0))) + ) + 0 + (set! (-> v1-1 settings top-plane w) (- (+ 2048.0 f0-0))) + ) + 0 ) - 0 - (set! (-> v1-1 settings top-plane w) (- (+ 2048.0 f0-0))) - ) - 0 ) - ) (none) ) (defmethod draw-npc-shadow mayor ((obj mayor)) (-> obj draw shadow-ctrl) (cond - ((and - (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) 8) + ((and (-> obj draw shadow) (zero? (-> obj draw cur-lod)) (logtest? (-> obj draw status) (draw-status drwf03))) + (let ((v1-9 (-> obj draw shadow-ctrl))) + (set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags))) + ) + 0 + (dummy-14 (-> obj draw shadow-ctrl)) ) - (let ((v1-9 (-> obj draw shadow-ctrl))) - (set! (-> v1-9 settings flags) (logand -33 (-> v1-9 settings flags))) - ) - 0 - (dummy-14 (-> obj draw shadow-ctrl)) - ) - (else - (let ((v1-14 (-> obj draw shadow-ctrl))) - (set! - (-> v1-14 settings flags) - (logior (the-as int (-> v1-14 settings flags)) 32) + (else + (let ((v1-14 (-> obj draw shadow-ctrl))) + (set! (-> v1-14 settings flags) (logior (the-as int (-> v1-14 settings flags)) 32)) + ) + 0 ) - ) - 0 ) - ) (none) ) (defun mayor-lurkerm-reward-speech ((arg0 mayor) (arg1 symbol)) (when arg1 - (set! (-> arg0 cell-for-task) (game-task jungle-lurkerm)) - (close-specific-task! - (game-task jungle-lurkerm) - (task-status need-reward-speech) + (set! (-> arg0 cell-for-task) (game-task jungle-lurkerm)) + (close-specific-task! (game-task jungle-lurkerm) (task-status need-reward-speech)) + (first-any (-> arg0 tasks) #t) ) - (first-any (-> arg0 tasks) #t) - ) - (new 'static 'spool-anim - :name "mayor-resolution-beams" - :index 7 - :parts 6 - :command-list '() - ) + (new 'static 'spool-anim :name "mayor-resolution-beams" :index 7 :parts 6 :command-list '()) ) (defmethod play-anim! mayor ((obj mayor) (arg0 symbol)) (set! (-> obj talk-message) (the-as uint 260)) - (case (current-status (-> obj tasks)) - (((task-status need-hint) (task-status need-introduction)) + (case (current-status (-> obj tasks)) + (((task-status need-hint) (task-status need-introduction)) (when arg0 - (close-specific-task! - (game-task jungle-lurkerm) - (task-status need-introduction) + (close-specific-task! (game-task jungle-lurkerm) (task-status need-introduction)) + (close-specific-task! (game-task village1-mayor-money) (task-status need-introduction)) ) - (close-specific-task! - (game-task village1-mayor-money) - (task-status need-introduction) - ) - ) (cond - ((closed? - (-> obj tasks) - (game-task jungle-lurkerm) - (task-status need-reminder) - ) - (mayor-lurkerm-reward-speech obj arg0) - ) - (else - (new 'static 'spool-anim - :name "mayor-introduction" - :index 4 - :parts 16 - :command-list '() - ) - (new 'static 'spool-anim - :name "mayor-introduction" - :index 4 - :parts 16 - :command-list - '( - (0 - kill - "villagea-part-65" - ) - (0 - kill - "villagea-part-70" - ) - (0 - kill - "med-res-level-2" - ) - (0 - kill - "med-res-level-3" - ) - (0 - kill - "med-res-level-4" - ) - (0 - kill - "med-res-level-6" - ) - (0 - kill - "med-res-level-7" - ) - (0 - kill - "med-res-level-8" - ) - (0 - kill - "med-res-level-11" - ) - (0 - kill - "med-res-level-14" - ) - (0 - kill - "fishermans-boat-2" - ) - (0 - kill - "windspinner-9" - ) - (0 - kill - "sagesail-6" - ) - (0 - kill - "sharkey-12" - ) - (0 - kill - "windmill-sail-4" - ) - (0 - kill - "water-vol-7" - ) - (0 - kill - "windspinner-8" - ) - (0 - kill - "villagea-part-32" - ) - (0 - kill - "water-vol-10" - ) - (0 - kill - "ropebridge-4" - ) - (0 - kill - "ropebridge-5" - ) - (0 - kill - "reflector-end-1" - ) - (0 - kill - "eco-10" - ) - (0 - kill - "eco-11" - ) - (0 - kill - "warp-gate-switch-3" - ) - (0 - kill - "reflector-middle-2" - ) - (0 - kill - "evilplant-2" - ) - (0 - kill - "crate-3147" - ) - (0 - kill - "villagea-water-2" - ) - (0 - kill - "med-res-level-22" - ) - (0 - kill - "med-res-level-23" - ) - (0 - kill - "villagea-part-50" - ) - (0 - kill - "water-vol-9" - ) - (0 - kill - "crate-3144" - ) - (0 - kill - "orb-cache-top-4" - ) - (0 - kill - "village-cam-2" - ) - (0 - kill - "villagea-part-18" - ) - (0 - kill - "villagea-part-24" - ) - (0 - kill - "money-2676" - ) - (0 - kill - "villagea-part-64" - ) - (0 - kill - "villagea-part-13" - ) - (0 - kill - "villagea-part-17" - ) - (0 - kill - "money-2689" - ) - (0 - kill - "money-2690" - ) - (0 - kill - "farmer-3" - ) - (0 - kill - "villagea-part-26" - ) - (0 - kill - "money-2692" - ) - (0 - kill - "villagea-part-37" - ) - (0 - kill - "villagea-part-38" - ) - (0 - kill - "villagea-part-64" - ) - (0 - kill - "crate-3142" - ) - (0 - kill - "crate-3143" - ) - (0 - kill - "money-2688" - ) - (0 - kill - "villagea-part-14" - ) - (0 - kill - "money-2691" - ) - (0 - kill - "villagea-part-62" - ) - (0 - kill - "villagea-part-63" - ) - (0 - kill - "sharkey-1" - ) - (0 - kill - "eco-82" - ) - (0 - kill - "eco-83" - ) - (0 - kill - "crate-2470" - ) - (0 - kill - "villagea-part-3" - ) - (0 - kill - "villagea-part-15" - ) - (0 - kill - "villagea-part-22" - ) - (0 - kill - "villagea-part-28" - ) - (0 - kill - "explorer-4" - ) - (0 - kill - "oracle-1" - ) - (0 - kill - "crate-3141" - ) - (0 - kill - "crate-3145" - ) - (0 - kill - "water-vol-8" - ) - (0 - kill - "water-vol-63" - ) - (0 - kill - "lrocklrg-1" - ) - (0 - kill - "crate-2469" - ) - (0 - kill - "villagea-part-69" - ) - (0 - display-level - beach - special - ) - ((the binteger 565) - joint - "cameraB" - ) - ((the binteger 850) - joint - "camera" - ) - ((the binteger 915) joint "cameraB") - ) - ) - ) - ) - ) - (((task-status need-reminder-a) (task-status need-reminder)) - (set! (-> obj skippable) #t) - (cond - ((closed? - (-> obj tasks) - (game-task jungle-lurkerm) - (task-status need-reward-speech) - ) - (new 'static 'spool-anim - :name "mayor-reminder-donation" - :index 6 - :parts 3 - :command-list - '( - (0 - kill - "villagea-part-65" - ) - (0 - kill - "villagea-part-70" - ) - (0 - kill - "med-res-level-2" - ) - (0 - kill - "med-res-level-3" - ) - (0 - kill - "med-res-level-4" - ) - (0 - kill - "med-res-level-6" - ) - (0 - kill - "med-res-level-7" - ) - (0 - kill - "med-res-level-8" - ) - (0 - kill - "med-res-level-11" - ) - (0 - kill - "med-res-level-14" - ) - (0 - kill - "fishermans-boat-2" - ) - (0 - kill - "windspinner-9" - ) - (0 - kill - "sagesail-6" - ) - (0 - kill - "sharkey-12" - ) - (0 - kill - "windmill-sail-4" - ) - (0 - kill - "water-vol-7" - ) - (0 - kill - "windspinner-8" - ) - (0 - kill - "villagea-part-32" - ) - (0 - kill - "water-vol-10" - ) - (0 - kill - "ropebridge-4" - ) - (0 - kill - "ropebridge-5" - ) - (0 - kill - "reflector-end-1" - ) - (0 - kill - "eco-10" - ) - (0 - kill - "eco-11" - ) - (0 - kill - "warp-gate-switch-3" - ) - (0 - kill - "reflector-middle-2" - ) - (0 - kill - "evilplant-2" - ) - (0 - kill - "crate-3147" - ) - (0 - kill - "villagea-water-2" - ) - (0 - kill - "med-res-level-22" - ) - (0 - kill - "med-res-level-23" - ) - (0 - kill - "villagea-part-50" - ) - (0 - kill - "water-vol-9" - ) - (0 - kill - "crate-3144" - ) - (0 - kill - "orb-cache-top-4" - ) - (0 - kill - "village-cam-2" - ) - (0 - kill - "villagea-part-18" - ) - (0 - kill - "villagea-part-24" - ) - (0 - kill - "money-2676" - ) - (0 - kill - "villagea-part-64" - ) - (0 - kill - "villagea-part-13" - ) - (0 - kill - "villagea-part-17" - ) - (0 - kill - "money-2689" - ) - (0 - kill - "money-2690" - ) - (0 - kill - "farmer-3" - ) - (0 - kill - "villagea-part-26" - ) - (0 - kill - "money-2692" - ) - (0 - kill - "villagea-part-37" - ) - (0 - kill - "villagea-part-38" - ) - (0 - kill - "villagea-part-64" - ) - (0 - kill - "crate-3142" - ) - (0 - kill - "crate-3143" - ) - (0 - kill - "money-2688" - ) - (0 - kill - "villagea-part-14" - ) - (0 - kill - "money-2691" - ) - (0 - kill - "villagea-part-62" - ) - (0 - kill - "villagea-part-63" - ) - (0 - kill - "sharkey-1" - ) - (0 - kill - "eco-82" - ) - (0 - kill - "eco-83" - ) - (0 - kill - "crate-2470" - ) - (0 - kill - "villagea-part-3" - ) - (0 - kill - "villagea-part-15" - ) - (0 - kill - "villagea-part-22" - ) - (0 - kill - "villagea-part-28" - ) - (0 - kill - "explorer-4" - ) - (0 - kill - "oracle-1" - ) - (0 - kill - "crate-3141" - ) - (0 - kill - "crate-3145" - ) - (0 - kill - "water-vol-8" - ) - (0 - kill - "water-vol-63" - ) - (0 - kill - "lrocklrg-1" - ) - (0 - kill - "crate-2469" - ) - (0 kill "villagea-part-69") (0 display-level beach special) - ) - ) - ) - ((closed? - (-> obj tasks) - (game-task village1-mayor-money) - (task-status need-reward-speech) - ) - (new 'static 'spool-anim - :name "mayor-reminder-beams" - :index 5 - :parts 3 - :command-list - '( - (0 - kill - "villagea-part-65" - ) - (0 - kill - "villagea-part-70" - ) - (0 - kill - "med-res-level-2" - ) - (0 - kill - "med-res-level-3" - ) - (0 - kill - "med-res-level-4" - ) - (0 - kill - "med-res-level-6" - ) - (0 - kill - "med-res-level-7" - ) - (0 - kill - "med-res-level-8" - ) - (0 - kill - "med-res-level-11" - ) - (0 - kill - "med-res-level-14" - ) - (0 - kill - "fishermans-boat-2" - ) - (0 - kill - "windspinner-9" - ) - (0 - kill - "sagesail-6" - ) - (0 - kill - "sharkey-12" - ) - (0 - kill - "windmill-sail-4" - ) - (0 - kill - "water-vol-7" - ) - (0 - kill - "windspinner-8" - ) - (0 - kill - "villagea-part-32" - ) - (0 - kill - "water-vol-10" - ) - (0 - kill - "ropebridge-4" - ) - (0 - kill - "ropebridge-5" - ) - (0 - kill - "reflector-end-1" - ) - (0 - kill - "eco-10" - ) - (0 - kill - "eco-11" - ) - (0 - kill - "warp-gate-switch-3" - ) - (0 - kill - "reflector-middle-2" - ) - (0 - kill - "evilplant-2" - ) - (0 - kill - "crate-3147" - ) - (0 - kill - "villagea-water-2" - ) - (0 - kill - "med-res-level-22" - ) - (0 - kill - "med-res-level-23" - ) - (0 - kill - "villagea-part-50" - ) - (0 - kill - "water-vol-9" - ) - (0 - kill - "crate-3144" - ) - (0 - kill - "orb-cache-top-4" - ) - (0 - kill - "village-cam-2" - ) - (0 - kill - "villagea-part-18" - ) - (0 - kill - "villagea-part-24" - ) - (0 - kill - "money-2676" - ) - (0 - kill - "villagea-part-64" - ) - (0 - kill - "villagea-part-13" - ) - (0 - kill - "villagea-part-17" - ) - (0 - kill - "money-2689" - ) - (0 - kill - "money-2690" - ) - (0 - kill - "farmer-3" - ) - (0 - kill - "villagea-part-26" - ) - (0 - kill - "money-2692" - ) - (0 - kill - "villagea-part-37" - ) - (0 - kill - "villagea-part-38" - ) - (0 - kill - "villagea-part-64" - ) - (0 - kill - "crate-3142" - ) - (0 - kill - "crate-3143" - ) - (0 - kill - "money-2688" - ) - (0 - kill - "villagea-part-14" - ) - (0 - kill - "money-2691" - ) - (0 - kill - "villagea-part-62" - ) - (0 - kill - "villagea-part-63" - ) - (0 - kill - "sharkey-1" - ) - (0 - kill - "eco-82" - ) - (0 - kill - "eco-83" - ) - (0 - kill - "crate-2470" - ) - (0 - kill - "villagea-part-3" - ) - (0 - kill - "villagea-part-15" - ) - (0 - kill - "villagea-part-22" - ) - (0 - kill - "villagea-part-28" - ) - (0 - kill - "explorer-4" - ) - (0 - kill - "oracle-1" - ) - (0 - kill - "crate-3141" - ) - (0 - kill - "crate-3145" - ) - (0 - kill - "water-vol-8" - ) - (0 - kill - "water-vol-63" - ) - (0 - kill - "lrocklrg-1" - ) - (0 - kill - "crate-2469" - ) - (0 kill "villagea-part-69") (0 display-level beach special) - ) - ) - ) - ((zero? (get-reminder (-> obj tasks) 0)) - (if arg0 - (save-reminder (-> obj tasks) 1 0) - ) - (new 'static 'spool-anim - :name "mayor-reminder-beams" - :index 5 - :parts 3 - :command-list - '( - (0 - kill - "villagea-part-65" - ) - (0 - kill - "villagea-part-70" - ) - (0 - kill - "med-res-level-2" - ) - (0 - kill - "med-res-level-3" - ) - (0 - kill - "med-res-level-4" - ) - (0 - kill - "med-res-level-6" - ) - (0 - kill - "med-res-level-7" - ) - (0 - kill - "med-res-level-8" - ) - (0 - kill - "med-res-level-11" - ) - (0 - kill - "med-res-level-14" - ) - (0 - kill - "fishermans-boat-2" - ) - (0 - kill - "windspinner-9" - ) - (0 - kill - "sagesail-6" - ) - (0 - kill - "sharkey-12" - ) - (0 - kill - "windmill-sail-4" - ) - (0 - kill - "water-vol-7" - ) - (0 - kill - "windspinner-8" - ) - (0 - kill - "villagea-part-32" - ) - (0 - kill - "water-vol-10" - ) - (0 - kill - "ropebridge-4" - ) - (0 - kill - "ropebridge-5" - ) - (0 - kill - "reflector-end-1" - ) - (0 - kill - "eco-10" - ) - (0 - kill - "eco-11" - ) - (0 - kill - "warp-gate-switch-3" - ) - (0 - kill - "reflector-middle-2" - ) - (0 - kill - "evilplant-2" - ) - (0 - kill - "crate-3147" - ) - (0 - kill - "villagea-water-2" - ) - (0 - kill - "med-res-level-22" - ) - (0 - kill - "med-res-level-23" - ) - (0 - kill - "villagea-part-50" - ) - (0 - kill - "water-vol-9" - ) - (0 - kill - "crate-3144" - ) - (0 - kill - "orb-cache-top-4" - ) - (0 - kill - "village-cam-2" - ) - (0 - kill - "villagea-part-18" - ) - (0 - kill - "villagea-part-24" - ) - (0 - kill - "money-2676" - ) - (0 - kill - "villagea-part-64" - ) - (0 - kill - "villagea-part-13" - ) - (0 - kill - "villagea-part-17" - ) - (0 - kill - "money-2689" - ) - (0 - kill - "money-2690" - ) - (0 - kill - "farmer-3" - ) - (0 - kill - "villagea-part-26" - ) - (0 - kill - "money-2692" - ) - (0 - kill - "villagea-part-37" - ) - (0 - kill - "villagea-part-38" - ) - (0 - kill - "villagea-part-64" - ) - (0 - kill - "crate-3142" - ) - (0 - kill - "crate-3143" - ) - (0 - kill - "money-2688" - ) - (0 - kill - "villagea-part-14" - ) - (0 - kill - "money-2691" - ) - (0 - kill - "villagea-part-62" - ) - (0 - kill - "villagea-part-63" - ) - (0 - kill - "sharkey-1" - ) - (0 - kill - "eco-82" - ) - (0 - kill - "eco-83" - ) - (0 - kill - "crate-2470" - ) - (0 - kill - "villagea-part-3" - ) - (0 - kill - "villagea-part-15" - ) - (0 - kill - "villagea-part-22" - ) - (0 - kill - "villagea-part-28" - ) - (0 - kill - "explorer-4" - ) - (0 - kill - "oracle-1" - ) - (0 - kill - "crate-3141" - ) - (0 - kill - "crate-3145" - ) - (0 - kill - "water-vol-8" - ) - (0 - kill - "water-vol-63" - ) - (0 - kill - "lrocklrg-1" - ) - (0 - kill - "crate-2469" - ) - (0 kill "villagea-part-69") (0 display-level beach special) - ) - ) - ) - (else - (if arg0 - (save-reminder (-> obj tasks) 0 0) - ) - (new 'static 'spool-anim - :name "mayor-reminder-donation" - :index 6 - :parts 3 - :command-list - '( - (0 - kill - "villagea-part-65" - ) - (0 - kill - "villagea-part-70" - ) - (0 - kill - "med-res-level-2" - ) - (0 - kill - "med-res-level-3" - ) - (0 - kill - "med-res-level-4" - ) - (0 - kill - "med-res-level-6" - ) - (0 - kill - "med-res-level-7" - ) - (0 - kill - "med-res-level-8" - ) - (0 - kill - "med-res-level-11" - ) - (0 - kill - "med-res-level-14" - ) - (0 - kill - "fishermans-boat-2" - ) - (0 - kill - "windspinner-9" - ) - (0 - kill - "sagesail-6" - ) - (0 - kill - "sharkey-12" - ) - (0 - kill - "windmill-sail-4" - ) - (0 - kill - "water-vol-7" - ) - (0 - kill - "windspinner-8" - ) - (0 - kill - "villagea-part-32" - ) - (0 - kill - "water-vol-10" - ) - (0 - kill - "ropebridge-4" - ) - (0 - kill - "ropebridge-5" - ) - (0 - kill - "reflector-end-1" - ) - (0 - kill - "eco-10" - ) - (0 - kill - "eco-11" - ) - (0 - kill - "warp-gate-switch-3" - ) - (0 - kill - "reflector-middle-2" - ) - (0 - kill - "evilplant-2" - ) - (0 - kill - "crate-3147" - ) - (0 - kill - "villagea-water-2" - ) - (0 - kill - "med-res-level-22" - ) - (0 - kill - "med-res-level-23" - ) - (0 - kill - "villagea-part-50" - ) - (0 - kill - "water-vol-9" - ) - (0 - kill - "crate-3144" - ) - (0 - kill - "orb-cache-top-4" - ) - (0 - kill - "village-cam-2" - ) - (0 - kill - "villagea-part-18" - ) - (0 - kill - "villagea-part-24" - ) - (0 - kill - "money-2676" - ) - (0 - kill - "villagea-part-64" - ) - (0 - kill - "villagea-part-13" - ) - (0 - kill - "villagea-part-17" - ) - (0 - kill - "money-2689" - ) - (0 - kill - "money-2690" - ) - (0 - kill - "farmer-3" - ) - (0 - kill - "villagea-part-26" - ) - (0 - kill - "money-2692" - ) - (0 - kill - "villagea-part-37" - ) - (0 - kill - "villagea-part-38" - ) - (0 - kill - "villagea-part-64" - ) - (0 - kill - "crate-3142" - ) - (0 - kill - "crate-3143" - ) - (0 - kill - "money-2688" - ) - (0 - kill - "villagea-part-14" - ) - (0 - kill - "money-2691" - ) - (0 - kill - "villagea-part-62" - ) - (0 - kill - "villagea-part-63" - ) - (0 - kill - "sharkey-1" - ) - (0 - kill - "eco-82" - ) - (0 - kill - "eco-83" - ) - (0 - kill - "crate-2470" - ) - (0 - kill - "villagea-part-3" - ) - (0 - kill - "villagea-part-15" - ) - (0 - kill - "villagea-part-22" - ) - (0 - kill - "villagea-part-28" - ) - (0 - kill - "explorer-4" - ) - (0 - kill - "oracle-1" - ) - (0 - kill - "crate-3141" - ) - (0 - kill - "crate-3145" - ) - (0 - kill - "water-vol-8" - ) - (0 - kill - "water-vol-63" - ) - (0 - kill - "lrocklrg-1" - ) - (0 - kill - "crate-2469" - ) - (0 kill "villagea-part-69") (0 display-level beach special) - ) - ) - ) - ) - ) - (((task-status need-reward-speech)) - (if (not arg0) - (set! (-> obj will-talk) #t) - ) - (case (current-task (-> obj tasks)) - (((game-task jungle-lurkerm)) - (mayor-lurkerm-reward-speech obj arg0) - ) - (else - (cond - (arg0 - (set! (-> obj cell-for-task) (current-task (-> obj tasks))) - (close-current! (-> obj tasks)) - (send-event *target* 'get-pickup 5 (- (-> *GAME-bank* money-task-inc))) + ((closed? (-> obj tasks) (game-task jungle-lurkerm) (task-status need-reminder)) + (mayor-lurkerm-reward-speech obj arg0) ) (else - (set! (-> obj talk-message) (the-as uint 282)) - ) - ) - (new 'static 'spool-anim - :name "mayor-resolution-donation" - :index 8 - :parts 5 - :command-list - '( - (0 - kill - "villagea-part-65" + (new 'static 'spool-anim :name "mayor-introduction" :index 4 :parts 16 :command-list '()) + (new 'static 'spool-anim + :name "mayor-introduction" + :index 4 + :parts 16 + :command-list + '((0 kill "villagea-part-65") + (0 kill "villagea-part-70") + (0 kill "med-res-level-2") + (0 kill "med-res-level-3") + (0 kill "med-res-level-4") + (0 kill "med-res-level-6") + (0 kill "med-res-level-7") + (0 kill "med-res-level-8") + (0 kill "med-res-level-11") + (0 kill "med-res-level-14") + (0 kill "fishermans-boat-2") + (0 kill "windspinner-9") + (0 kill "sagesail-6") + (0 kill "sharkey-12") + (0 kill "windmill-sail-4") + (0 kill "water-vol-7") + (0 kill "windspinner-8") + (0 kill "villagea-part-32") + (0 kill "water-vol-10") + (0 kill "ropebridge-4") + (0 kill "ropebridge-5") + (0 kill "reflector-end-1") + (0 kill "eco-10") + (0 kill "eco-11") + (0 kill "warp-gate-switch-3") + (0 kill "reflector-middle-2") + (0 kill "evilplant-2") + (0 kill "crate-3147") + (0 kill "villagea-water-2") + (0 kill "med-res-level-22") + (0 kill "med-res-level-23") + (0 kill "villagea-part-50") + (0 kill "water-vol-9") + (0 kill "crate-3144") + (0 kill "orb-cache-top-4") + (0 kill "village-cam-2") + (0 kill "villagea-part-18") + (0 kill "villagea-part-24") + (0 kill "money-2676") + (0 kill "villagea-part-64") + (0 kill "villagea-part-13") + (0 kill "villagea-part-17") + (0 kill "money-2689") + (0 kill "money-2690") + (0 kill "farmer-3") + (0 kill "villagea-part-26") + (0 kill "money-2692") + (0 kill "villagea-part-37") + (0 kill "villagea-part-38") + (0 kill "villagea-part-64") + (0 kill "crate-3142") + (0 kill "crate-3143") + (0 kill "money-2688") + (0 kill "villagea-part-14") + (0 kill "money-2691") + (0 kill "villagea-part-62") + (0 kill "villagea-part-63") + (0 kill "sharkey-1") + (0 kill "eco-82") + (0 kill "eco-83") + (0 kill "crate-2470") + (0 kill "villagea-part-3") + (0 kill "villagea-part-15") + (0 kill "villagea-part-22") + (0 kill "villagea-part-28") + (0 kill "explorer-4") + (0 kill "oracle-1") + (0 kill "crate-3141") + (0 kill "crate-3145") + (0 kill "water-vol-8") + (0 kill "water-vol-63") + (0 kill "lrocklrg-1") + (0 kill "crate-2469") + (0 kill "villagea-part-69") + (0 display-level beach special) + (565 joint "cameraB") + (850 joint "camera") + (915 joint "cameraB") + ) ) - (0 - kill - "villagea-part-70" - ) - (0 - kill - "med-res-level-2" - ) - (0 - kill - "med-res-level-3" - ) - (0 - kill - "med-res-level-4" - ) - (0 - kill - "med-res-level-6" - ) - (0 - kill - "med-res-level-7" - ) - (0 - kill - "med-res-level-8" - ) - (0 - kill - "med-res-level-11" - ) - (0 - kill - "med-res-level-14" - ) - (0 - kill - "fishermans-boat-2" - ) - (0 - kill - "windspinner-9" - ) - (0 - kill - "sagesail-6" - ) - (0 - kill - "sharkey-12" - ) - (0 - kill - "windmill-sail-4" - ) - (0 - kill - "water-vol-7" - ) - (0 - kill - "windspinner-8" - ) - (0 - kill - "villagea-part-32" - ) - (0 - kill - "water-vol-10" - ) - (0 - kill - "ropebridge-4" - ) - (0 - kill - "ropebridge-5" - ) - (0 - kill - "reflector-end-1" - ) - (0 - kill - "eco-10" - ) - (0 - kill - "eco-11" - ) - (0 - kill - "warp-gate-switch-3" - ) - (0 - kill - "reflector-middle-2" - ) - (0 - kill - "evilplant-2" - ) - (0 - kill - "crate-3147" - ) - (0 - kill - "villagea-water-2" - ) - (0 - kill - "med-res-level-22" - ) - (0 - kill - "med-res-level-23" - ) - (0 - kill - "villagea-part-50" - ) - (0 - kill - "water-vol-9" - ) - (0 - kill - "crate-3144" - ) - (0 - kill - "orb-cache-top-4" - ) - (0 - kill - "village-cam-2" - ) - (0 - kill - "villagea-part-18" - ) - (0 - kill - "villagea-part-24" - ) - (0 - kill - "money-2676" - ) - (0 - kill - "villagea-part-64" - ) - (0 - kill - "villagea-part-13" - ) - (0 - kill - "villagea-part-17" - ) - (0 - kill - "money-2689" - ) - (0 - kill - "money-2690" - ) - (0 - kill - "farmer-3" - ) - (0 - kill - "villagea-part-26" - ) - (0 - kill - "money-2692" - ) - (0 - kill - "villagea-part-37" - ) - (0 - kill - "villagea-part-38" - ) - (0 - kill - "villagea-part-64" - ) - (0 - kill - "crate-3142" - ) - (0 - kill - "crate-3143" - ) - (0 - kill - "money-2688" - ) - (0 - kill - "villagea-part-14" - ) - (0 - kill - "money-2691" - ) - (0 - kill - "villagea-part-62" - ) - (0 - kill - "villagea-part-63" - ) - (0 - kill - "sharkey-1" - ) - (0 - kill - "eco-82" - ) - (0 - kill - "eco-83" - ) - (0 - kill - "crate-2470" - ) - (0 - kill - "villagea-part-3" - ) - (0 - kill - "villagea-part-15" - ) - (0 - kill - "villagea-part-22" - ) - (0 - kill - "villagea-part-28" - ) - (0 - kill - "explorer-4" - ) - (0 - kill - "oracle-1" - ) - (0 - kill - "crate-3141" - ) - (0 - kill - "crate-3145" - ) - (0 - kill - "water-vol-8" - ) - (0 - kill - "water-vol-63" - ) - (0 - kill - "lrocklrg-1" - ) - (0 - kill - "crate-2469" - ) - (0 kill "villagea-part-69") (0 display-level beach special) ) ) - ) ) - ) - (else - (if arg0 - (format - 0 - "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) - ) + (((task-status need-reminder-a) (task-status need-reminder)) + (set! (-> obj skippable) #t) + (cond + ((closed? (-> obj tasks) (game-task jungle-lurkerm) (task-status need-reward-speech)) + (new 'static 'spool-anim + :name "mayor-reminder-donation" + :index 6 + :parts 3 + :command-list + '((0 kill "villagea-part-65") + (0 kill "villagea-part-70") + (0 kill "med-res-level-2") + (0 kill "med-res-level-3") + (0 kill "med-res-level-4") + (0 kill "med-res-level-6") + (0 kill "med-res-level-7") + (0 kill "med-res-level-8") + (0 kill "med-res-level-11") + (0 kill "med-res-level-14") + (0 kill "fishermans-boat-2") + (0 kill "windspinner-9") + (0 kill "sagesail-6") + (0 kill "sharkey-12") + (0 kill "windmill-sail-4") + (0 kill "water-vol-7") + (0 kill "windspinner-8") + (0 kill "villagea-part-32") + (0 kill "water-vol-10") + (0 kill "ropebridge-4") + (0 kill "ropebridge-5") + (0 kill "reflector-end-1") + (0 kill "eco-10") + (0 kill "eco-11") + (0 kill "warp-gate-switch-3") + (0 kill "reflector-middle-2") + (0 kill "evilplant-2") + (0 kill "crate-3147") + (0 kill "villagea-water-2") + (0 kill "med-res-level-22") + (0 kill "med-res-level-23") + (0 kill "villagea-part-50") + (0 kill "water-vol-9") + (0 kill "crate-3144") + (0 kill "orb-cache-top-4") + (0 kill "village-cam-2") + (0 kill "villagea-part-18") + (0 kill "villagea-part-24") + (0 kill "money-2676") + (0 kill "villagea-part-64") + (0 kill "villagea-part-13") + (0 kill "villagea-part-17") + (0 kill "money-2689") + (0 kill "money-2690") + (0 kill "farmer-3") + (0 kill "villagea-part-26") + (0 kill "money-2692") + (0 kill "villagea-part-37") + (0 kill "villagea-part-38") + (0 kill "villagea-part-64") + (0 kill "crate-3142") + (0 kill "crate-3143") + (0 kill "money-2688") + (0 kill "villagea-part-14") + (0 kill "money-2691") + (0 kill "villagea-part-62") + (0 kill "villagea-part-63") + (0 kill "sharkey-1") + (0 kill "eco-82") + (0 kill "eco-83") + (0 kill "crate-2470") + (0 kill "villagea-part-3") + (0 kill "villagea-part-15") + (0 kill "villagea-part-22") + (0 kill "villagea-part-28") + (0 kill "explorer-4") + (0 kill "oracle-1") + (0 kill "crate-3141") + (0 kill "crate-3145") + (0 kill "water-vol-8") + (0 kill "water-vol-63") + (0 kill "lrocklrg-1") + (0 kill "crate-2469") + (0 kill "villagea-part-69") + (0 display-level beach special) + ) + ) + ) + ((closed? (-> obj tasks) (game-task village1-mayor-money) (task-status need-reward-speech)) + (new 'static 'spool-anim + :name "mayor-reminder-beams" + :index 5 + :parts 3 + :command-list + '((0 kill "villagea-part-65") + (0 kill "villagea-part-70") + (0 kill "med-res-level-2") + (0 kill "med-res-level-3") + (0 kill "med-res-level-4") + (0 kill "med-res-level-6") + (0 kill "med-res-level-7") + (0 kill "med-res-level-8") + (0 kill "med-res-level-11") + (0 kill "med-res-level-14") + (0 kill "fishermans-boat-2") + (0 kill "windspinner-9") + (0 kill "sagesail-6") + (0 kill "sharkey-12") + (0 kill "windmill-sail-4") + (0 kill "water-vol-7") + (0 kill "windspinner-8") + (0 kill "villagea-part-32") + (0 kill "water-vol-10") + (0 kill "ropebridge-4") + (0 kill "ropebridge-5") + (0 kill "reflector-end-1") + (0 kill "eco-10") + (0 kill "eco-11") + (0 kill "warp-gate-switch-3") + (0 kill "reflector-middle-2") + (0 kill "evilplant-2") + (0 kill "crate-3147") + (0 kill "villagea-water-2") + (0 kill "med-res-level-22") + (0 kill "med-res-level-23") + (0 kill "villagea-part-50") + (0 kill "water-vol-9") + (0 kill "crate-3144") + (0 kill "orb-cache-top-4") + (0 kill "village-cam-2") + (0 kill "villagea-part-18") + (0 kill "villagea-part-24") + (0 kill "money-2676") + (0 kill "villagea-part-64") + (0 kill "villagea-part-13") + (0 kill "villagea-part-17") + (0 kill "money-2689") + (0 kill "money-2690") + (0 kill "farmer-3") + (0 kill "villagea-part-26") + (0 kill "money-2692") + (0 kill "villagea-part-37") + (0 kill "villagea-part-38") + (0 kill "villagea-part-64") + (0 kill "crate-3142") + (0 kill "crate-3143") + (0 kill "money-2688") + (0 kill "villagea-part-14") + (0 kill "money-2691") + (0 kill "villagea-part-62") + (0 kill "villagea-part-63") + (0 kill "sharkey-1") + (0 kill "eco-82") + (0 kill "eco-83") + (0 kill "crate-2470") + (0 kill "villagea-part-3") + (0 kill "villagea-part-15") + (0 kill "villagea-part-22") + (0 kill "villagea-part-28") + (0 kill "explorer-4") + (0 kill "oracle-1") + (0 kill "crate-3141") + (0 kill "crate-3145") + (0 kill "water-vol-8") + (0 kill "water-vol-63") + (0 kill "lrocklrg-1") + (0 kill "crate-2469") + (0 kill "villagea-part-69") + (0 display-level beach special) + ) + ) + ) + ((zero? (get-reminder (-> obj tasks) 0)) + (if arg0 + (save-reminder (-> obj tasks) 1 0) + ) + (new 'static 'spool-anim + :name "mayor-reminder-beams" + :index 5 + :parts 3 + :command-list + '((0 kill "villagea-part-65") + (0 kill "villagea-part-70") + (0 kill "med-res-level-2") + (0 kill "med-res-level-3") + (0 kill "med-res-level-4") + (0 kill "med-res-level-6") + (0 kill "med-res-level-7") + (0 kill "med-res-level-8") + (0 kill "med-res-level-11") + (0 kill "med-res-level-14") + (0 kill "fishermans-boat-2") + (0 kill "windspinner-9") + (0 kill "sagesail-6") + (0 kill "sharkey-12") + (0 kill "windmill-sail-4") + (0 kill "water-vol-7") + (0 kill "windspinner-8") + (0 kill "villagea-part-32") + (0 kill "water-vol-10") + (0 kill "ropebridge-4") + (0 kill "ropebridge-5") + (0 kill "reflector-end-1") + (0 kill "eco-10") + (0 kill "eco-11") + (0 kill "warp-gate-switch-3") + (0 kill "reflector-middle-2") + (0 kill "evilplant-2") + (0 kill "crate-3147") + (0 kill "villagea-water-2") + (0 kill "med-res-level-22") + (0 kill "med-res-level-23") + (0 kill "villagea-part-50") + (0 kill "water-vol-9") + (0 kill "crate-3144") + (0 kill "orb-cache-top-4") + (0 kill "village-cam-2") + (0 kill "villagea-part-18") + (0 kill "villagea-part-24") + (0 kill "money-2676") + (0 kill "villagea-part-64") + (0 kill "villagea-part-13") + (0 kill "villagea-part-17") + (0 kill "money-2689") + (0 kill "money-2690") + (0 kill "farmer-3") + (0 kill "villagea-part-26") + (0 kill "money-2692") + (0 kill "villagea-part-37") + (0 kill "villagea-part-38") + (0 kill "villagea-part-64") + (0 kill "crate-3142") + (0 kill "crate-3143") + (0 kill "money-2688") + (0 kill "villagea-part-14") + (0 kill "money-2691") + (0 kill "villagea-part-62") + (0 kill "villagea-part-63") + (0 kill "sharkey-1") + (0 kill "eco-82") + (0 kill "eco-83") + (0 kill "crate-2470") + (0 kill "villagea-part-3") + (0 kill "villagea-part-15") + (0 kill "villagea-part-22") + (0 kill "villagea-part-28") + (0 kill "explorer-4") + (0 kill "oracle-1") + (0 kill "crate-3141") + (0 kill "crate-3145") + (0 kill "water-vol-8") + (0 kill "water-vol-63") + (0 kill "lrocklrg-1") + (0 kill "crate-2469") + (0 kill "villagea-part-69") + (0 display-level beach special) + ) + ) + ) + (else + (if arg0 + (save-reminder (-> obj tasks) 0 0) + ) + (new 'static 'spool-anim + :name "mayor-reminder-donation" + :index 6 + :parts 3 + :command-list + '((0 kill "villagea-part-65") + (0 kill "villagea-part-70") + (0 kill "med-res-level-2") + (0 kill "med-res-level-3") + (0 kill "med-res-level-4") + (0 kill "med-res-level-6") + (0 kill "med-res-level-7") + (0 kill "med-res-level-8") + (0 kill "med-res-level-11") + (0 kill "med-res-level-14") + (0 kill "fishermans-boat-2") + (0 kill "windspinner-9") + (0 kill "sagesail-6") + (0 kill "sharkey-12") + (0 kill "windmill-sail-4") + (0 kill "water-vol-7") + (0 kill "windspinner-8") + (0 kill "villagea-part-32") + (0 kill "water-vol-10") + (0 kill "ropebridge-4") + (0 kill "ropebridge-5") + (0 kill "reflector-end-1") + (0 kill "eco-10") + (0 kill "eco-11") + (0 kill "warp-gate-switch-3") + (0 kill "reflector-middle-2") + (0 kill "evilplant-2") + (0 kill "crate-3147") + (0 kill "villagea-water-2") + (0 kill "med-res-level-22") + (0 kill "med-res-level-23") + (0 kill "villagea-part-50") + (0 kill "water-vol-9") + (0 kill "crate-3144") + (0 kill "orb-cache-top-4") + (0 kill "village-cam-2") + (0 kill "villagea-part-18") + (0 kill "villagea-part-24") + (0 kill "money-2676") + (0 kill "villagea-part-64") + (0 kill "villagea-part-13") + (0 kill "villagea-part-17") + (0 kill "money-2689") + (0 kill "money-2690") + (0 kill "farmer-3") + (0 kill "villagea-part-26") + (0 kill "money-2692") + (0 kill "villagea-part-37") + (0 kill "villagea-part-38") + (0 kill "villagea-part-64") + (0 kill "crate-3142") + (0 kill "crate-3143") + (0 kill "money-2688") + (0 kill "villagea-part-14") + (0 kill "money-2691") + (0 kill "villagea-part-62") + (0 kill "villagea-part-63") + (0 kill "sharkey-1") + (0 kill "eco-82") + (0 kill "eco-83") + (0 kill "crate-2470") + (0 kill "villagea-part-3") + (0 kill "villagea-part-15") + (0 kill "villagea-part-22") + (0 kill "villagea-part-28") + (0 kill "explorer-4") + (0 kill "oracle-1") + (0 kill "crate-3141") + (0 kill "crate-3145") + (0 kill "water-vol-8") + (0 kill "water-vol-63") + (0 kill "lrocklrg-1") + (0 kill "crate-2469") + (0 kill "villagea-part-69") + (0 display-level beach special) + ) + ) + ) + ) ) - (-> obj draw art-group data 3) + (((task-status need-reward-speech)) + (if (not arg0) + (set! (-> obj will-talk) #t) + ) + (case (current-task (-> obj tasks)) + (((game-task jungle-lurkerm)) + (mayor-lurkerm-reward-speech obj arg0) + ) + (else + (cond + (arg0 + (set! (-> obj cell-for-task) (current-task (-> obj tasks))) + (close-current! (-> obj tasks)) + (send-event *target* 'get-pickup 5 (- (-> *GAME-bank* money-task-inc))) + ) + (else + (set! (-> obj talk-message) (the-as uint 282)) + ) + ) + (new 'static 'spool-anim + :name "mayor-resolution-donation" + :index 8 + :parts 5 + :command-list + '((0 kill "villagea-part-65") + (0 kill "villagea-part-70") + (0 kill "med-res-level-2") + (0 kill "med-res-level-3") + (0 kill "med-res-level-4") + (0 kill "med-res-level-6") + (0 kill "med-res-level-7") + (0 kill "med-res-level-8") + (0 kill "med-res-level-11") + (0 kill "med-res-level-14") + (0 kill "fishermans-boat-2") + (0 kill "windspinner-9") + (0 kill "sagesail-6") + (0 kill "sharkey-12") + (0 kill "windmill-sail-4") + (0 kill "water-vol-7") + (0 kill "windspinner-8") + (0 kill "villagea-part-32") + (0 kill "water-vol-10") + (0 kill "ropebridge-4") + (0 kill "ropebridge-5") + (0 kill "reflector-end-1") + (0 kill "eco-10") + (0 kill "eco-11") + (0 kill "warp-gate-switch-3") + (0 kill "reflector-middle-2") + (0 kill "evilplant-2") + (0 kill "crate-3147") + (0 kill "villagea-water-2") + (0 kill "med-res-level-22") + (0 kill "med-res-level-23") + (0 kill "villagea-part-50") + (0 kill "water-vol-9") + (0 kill "crate-3144") + (0 kill "orb-cache-top-4") + (0 kill "village-cam-2") + (0 kill "villagea-part-18") + (0 kill "villagea-part-24") + (0 kill "money-2676") + (0 kill "villagea-part-64") + (0 kill "villagea-part-13") + (0 kill "villagea-part-17") + (0 kill "money-2689") + (0 kill "money-2690") + (0 kill "farmer-3") + (0 kill "villagea-part-26") + (0 kill "money-2692") + (0 kill "villagea-part-37") + (0 kill "villagea-part-38") + (0 kill "villagea-part-64") + (0 kill "crate-3142") + (0 kill "crate-3143") + (0 kill "money-2688") + (0 kill "villagea-part-14") + (0 kill "money-2691") + (0 kill "villagea-part-62") + (0 kill "villagea-part-63") + (0 kill "sharkey-1") + (0 kill "eco-82") + (0 kill "eco-83") + (0 kill "crate-2470") + (0 kill "villagea-part-3") + (0 kill "villagea-part-15") + (0 kill "villagea-part-22") + (0 kill "villagea-part-28") + (0 kill "explorer-4") + (0 kill "oracle-1") + (0 kill "crate-3141") + (0 kill "crate-3145") + (0 kill "water-vol-8") + (0 kill "water-vol-63") + (0 kill "lrocklrg-1") + (0 kill "crate-2469") + (0 kill "villagea-part-69") + (0 display-level beach special) + ) + ) + ) + ) + ) + (else + (if arg0 + (format + 0 + "ERROR: : ~S playing anim for task status ~S~%" + (-> obj name) + (task-status->string (current-status (-> obj tasks))) + ) + ) + (-> obj draw art-group data 3) + ) ) - ) ) (defmethod get-art-elem mayor ((obj mayor)) @@ -2009,173 +643,86 @@ (defmethod should-display? mayor ((obj mayor)) (if *target* - (< (- (-> (target-pos 0) z) (-> obj root-override trans z)) 57344.0) - (< (- (-> (camera-pos) z) (-> obj root-override trans z)) 57344.0) - ) + (< (- (-> (target-pos 0) z) (-> obj root-override trans z)) 57344.0) + (< (- (-> (camera-pos) z) (-> obj root-override trans z)) 57344.0) + ) ) (defmethod TODO-RENAME-43 mayor ((obj mayor)) - (when - (TODO-RENAME-10 - (-> obj ambient) - (new 'stack-no-clear 'vector) - 9000 - 122880.0 - obj - ) - (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-4 (the-as number (logior #x3f800000 v1-3))) - (f0-2 (+ -1.0 (the-as float v1-4))) + (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) 9000 122880.0 obj) + (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-4 (the-as number (logior #x3f800000 v1-3))) + (f0-2 (+ -1.0 (the-as float v1-4))) + ) + (cond + ((< 0.8888889 f0-2) + (if (not (closed? (-> obj tasks) (game-task jungle-lurkerm) (task-status need-reminder))) + (play-ambient (-> obj ambient) "CHI-LO01" #f (-> obj root-override trans)) + ) + ) + ((< 0.7777778 f0-2) + (if (not (closed? (-> obj tasks) (game-task jungle-lurkerm) (task-status need-reminder))) + (play-ambient (-> obj ambient) "CHI-LO02" #f (-> obj root-override trans)) + ) + ) + ((< 0.6666667 f0-2) + (if (not (closed? (-> obj tasks) (game-task jungle-lurkerm) (task-status need-reminder))) + (play-ambient (-> obj ambient) "CHI-AM07" #f (-> obj root-override trans)) + ) + ) + ((< 0.5555556 f0-2) + (play-ambient (-> obj ambient) "CHI-AM06" #f (-> obj root-override trans)) + ) + ((< 0.44444445 f0-2) + (play-ambient (-> obj ambient) "CHI-AM05" #f (-> obj root-override trans)) + ) + ((< 0.33333334 f0-2) + (play-ambient (-> obj ambient) "CHI-AM04" #f (-> obj root-override trans)) + ) + ((< 0.22222222 f0-2) + (if (not (closed? (-> obj tasks) (game-task jungle-lurkerm) (task-status need-reminder))) + (play-ambient (-> obj ambient) "CHI-AM03" #f (-> obj root-override trans)) + ) + ) + ((< 0.11111111 f0-2) + (if (not (closed? (-> obj tasks) (game-task jungle-lurkerm) (task-status need-reminder))) + (play-ambient (-> obj ambient) "CHI-AM02" #f (-> obj root-override trans)) + ) + ) + (else + (if (not (closed? (-> obj tasks) (game-task jungle-lurkerm) (task-status need-reminder))) + (play-ambient (-> obj ambient) "CHI-AM01" #f (-> obj root-override trans)) + ) ) - (cond - ((< 0.8888889 f0-2) - (if - (not - (closed? - (-> obj tasks) - (game-task jungle-lurkerm) - (task-status need-reminder) - ) ) - (play-ambient - (-> obj ambient) - "CHI-LO01" - #f - (-> obj root-override trans) - ) - ) ) - ((< 0.7777778 f0-2) - (if - (not - (closed? - (-> obj tasks) - (game-task jungle-lurkerm) - (task-status need-reminder) - ) - ) - (play-ambient - (-> obj ambient) - "CHI-LO02" - #f - (-> obj root-override trans) - ) - ) - ) - ((< 0.6666667 f0-2) - (if - (not - (closed? - (-> obj tasks) - (game-task jungle-lurkerm) - (task-status need-reminder) - ) - ) - (play-ambient - (-> obj ambient) - "CHI-AM07" - #f - (-> obj root-override trans) - ) - ) - ) - ((< 0.5555556 f0-2) - (play-ambient (-> obj ambient) "CHI-AM06" #f (-> obj root-override trans)) - ) - ((< 0.44444445 f0-2) - (play-ambient (-> obj ambient) "CHI-AM05" #f (-> obj root-override trans)) - ) - ((< 0.33333334 f0-2) - (play-ambient (-> obj ambient) "CHI-AM04" #f (-> obj root-override trans)) - ) - ((< 0.22222222 f0-2) - (if - (not - (closed? - (-> obj tasks) - (game-task jungle-lurkerm) - (task-status need-reminder) - ) - ) - (play-ambient - (-> obj ambient) - "CHI-AM03" - #f - (-> obj root-override trans) - ) - ) - ) - ((< 0.11111111 f0-2) - (if - (not - (closed? - (-> obj tasks) - (game-task jungle-lurkerm) - (task-status need-reminder) - ) - ) - (play-ambient - (-> obj ambient) - "CHI-AM02" - #f - (-> obj root-override trans) - ) - ) - ) - (else - (if - (not - (closed? - (-> obj tasks) - (game-task jungle-lurkerm) - (task-status need-reminder) - ) - ) - (play-ambient - (-> obj ambient) - "CHI-AM01" - #f - (-> obj root-override trans) - ) - ) - ) - ) ) - ) ) (defstate idle (mayor) :virtual #t :trans (behavior () - (if (not (should-display? self)) - (go-virtual hidden) + (if (not (should-display? self)) + (go-virtual hidden) + ) + ((-> (method-of-type process-taskable idle) trans)) + (none) ) - ((-> (method-of-type process-taskable idle) trans)) - (none) - ) :post (behavior () - (let ((t9-0 (-> (method-of-type process-taskable idle) post))) - (if t9-0 - ((the-as (function none) t9-0)) - ) + (let ((t9-0 (-> (method-of-type process-taskable idle) post))) + (if t9-0 + ((the-as (function none) t9-0)) + ) + ) + (respond-to-collisions! (-> self root-override)) + (none) ) - (dummy-45 (-> self root-override)) - (none) - ) ) (defmethod init-from-entity! mayor ((obj mayor) (arg0 entity-actor)) - (dummy-40 - obj - arg0 - *mayor-sg* - 3 - 51 - (new 'static 'vector :y 4096.0 :w 4096.0) - 5 - ) + (dummy-40 obj arg0 *mayor-sg* 3 51 (new 'static 'vector :y 4096.0 :w 4096.0) 5) (set! (-> obj bounce-away) #f) (set! (-> obj tasks) (get-task-control (game-task jungle-lurkerm))) (set! (-> obj sound-flava) (the-as uint 8)) diff --git a/goal_src/levels/beach/pelican.gc b/goal_src/levels/beach/pelican.gc index 6fdc28ca47..3259e5c3aa 100644 --- a/goal_src/levels/beach/pelican.gc +++ b/goal_src/levels/beach/pelican.gc @@ -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) diff --git a/goal_src/levels/beach/seagull.gc b/goal_src/levels/beach/seagull.gc index 07b52e473f..2c96f1da79 100644 --- a/goal_src/levels/beach/seagull.gc +++ b/goal_src/levels/beach/seagull.gc @@ -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)) diff --git a/goal_src/levels/citadel/citadel-obs.gc b/goal_src/levels/citadel/citadel-obs.gc index 225fe25415..b758fbc87c 100644 --- a/goal_src/levels/citadel/citadel-obs.gc +++ b/goal_src/levels/citadel/citadel-obs.gc @@ -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) diff --git a/goal_src/levels/citadel/citadel-sages.gc b/goal_src/levels/citadel/citadel-sages.gc index bb641cb36b..9f03b1451b 100644 --- a/goal_src/levels/citadel/citadel-sages.gc +++ b/goal_src/levels/citadel/citadel-sages.gc @@ -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)) diff --git a/goal_src/levels/citadel/citb-drop-plat-CIT.gc b/goal_src/levels/citadel/citb-drop-plat-CIT.gc index f726f1beb9..ec8648a165 100644 --- a/goal_src/levels/citadel/citb-drop-plat-CIT.gc +++ b/goal_src/levels/citadel/citb-drop-plat-CIT.gc @@ -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)) diff --git a/goal_src/levels/citadel/citb-plat.gc b/goal_src/levels/citadel/citb-plat.gc index d86603230e..8aa4be25f5 100644 --- a/goal_src/levels/citadel/citb-plat.gc +++ b/goal_src/levels/citadel/citb-plat.gc @@ -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)) diff --git a/goal_src/levels/common/basebutton.gc b/goal_src/levels/common/basebutton.gc index d468372280..4ceb573e10 100644 --- a/goal_src/levels/common/basebutton.gc +++ b/goal_src/levels/common/basebutton.gc @@ -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)) diff --git a/goal_src/levels/common/baseplat.gc b/goal_src/levels/common/baseplat.gc index 084befff58..b3dd350084 100644 --- a/goal_src/levels/common/baseplat.gc +++ b/goal_src/levels/common/baseplat.gc @@ -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) diff --git a/goal_src/levels/common/nav-enemy.gc b/goal_src/levels/common/nav-enemy.gc index 9756d91bcf..3111f953fe 100644 --- a/goal_src/levels/common/nav-enemy.gc +++ b/goal_src/levels/common/nav-enemy.gc @@ -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) diff --git a/goal_src/levels/common/orb-cache.gc b/goal_src/levels/common/orb-cache.gc index 8aaf90d3f4..16ab26d1ff 100644 --- a/goal_src/levels/common/orb-cache.gc +++ b/goal_src/levels/common/orb-cache.gc @@ -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) diff --git a/goal_src/levels/common/plat-button.gc b/goal_src/levels/common/plat-button.gc index 043f46a791..c30ce1f49a 100644 --- a/goal_src/levels/common/plat-button.gc +++ b/goal_src/levels/common/plat-button.gc @@ -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) ) diff --git a/goal_src/levels/common/plat.gc b/goal_src/levels/common/plat.gc index 73c30b226d..8141a3bdea 100644 --- a/goal_src/levels/common/plat.gc +++ b/goal_src/levels/common/plat.gc @@ -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) diff --git a/goal_src/levels/common/rigid-body.gc b/goal_src/levels/common/rigid-body.gc index cc37fbbaf3..bda2575060 100644 --- a/goal_src/levels/common/rigid-body.gc +++ b/goal_src/levels/common/rigid-body.gc @@ -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)) diff --git a/goal_src/levels/common/sharkey.gc b/goal_src/levels/common/sharkey.gc index 77832d9bfb..0d2ecda21b 100644 --- a/goal_src/levels/common/sharkey.gc +++ b/goal_src/levels/common/sharkey.gc @@ -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))) diff --git a/goal_src/levels/darkcave/darkcave-obs.gc b/goal_src/levels/darkcave/darkcave-obs.gc index b66d681cf9..a0713ebefb 100644 --- a/goal_src/levels/darkcave/darkcave-obs.gc +++ b/goal_src/levels/darkcave/darkcave-obs.gc @@ -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 diff --git a/goal_src/levels/finalboss/final-door.gc b/goal_src/levels/finalboss/final-door.gc index f264b409c7..c4590b64d0 100644 --- a/goal_src/levels/finalboss/final-door.gc +++ b/goal_src/levels/finalboss/final-door.gc @@ -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) diff --git a/goal_src/levels/finalboss/robotboss-misc.gc b/goal_src/levels/finalboss/robotboss-misc.gc index 3775638e77..eea3165eed 100644 --- a/goal_src/levels/finalboss/robotboss-misc.gc +++ b/goal_src/levels/finalboss/robotboss-misc.gc @@ -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)) diff --git a/goal_src/levels/flut_common/flutflut.gc b/goal_src/levels/flut_common/flutflut.gc index b0cef02d01..56ae93f4e4 100644 --- a/goal_src/levels/flut_common/flutflut.gc +++ b/goal_src/levels/flut_common/flutflut.gc @@ -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 diff --git a/goal_src/levels/flut_common/target-flut.gc b/goal_src/levels/flut_common/target-flut.gc index 964fffe98b..4352eafb39 100644 --- a/goal_src/levels/flut_common/target-flut.gc +++ b/goal_src/levels/flut_common/target-flut.gc @@ -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) diff --git a/goal_src/levels/jungle/darkvine.gc b/goal_src/levels/jungle/darkvine.gc index ae4c383a8a..64772cd47b 100644 --- a/goal_src/levels/jungle/darkvine.gc +++ b/goal_src/levels/jungle/darkvine.gc @@ -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) diff --git a/goal_src/levels/jungle/jungle-elevator.gc b/goal_src/levels/jungle/jungle-elevator.gc index f4b996fefa..918d513555 100644 --- a/goal_src/levels/jungle/jungle-elevator.gc +++ b/goal_src/levels/jungle/jungle-elevator.gc @@ -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 + ) ) diff --git a/goal_src/levels/jungle/jungle-mirrors.gc b/goal_src/levels/jungle/jungle-mirrors.gc index 9690717e33..960664b437 100644 --- a/goal_src/levels/jungle/jungle-mirrors.gc +++ b/goal_src/levels/jungle/jungle-mirrors.gc @@ -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) diff --git a/goal_src/levels/jungle/jungle-obs.gc b/goal_src/levels/jungle/jungle-obs.gc index 2b89486ff9..049d75008f 100644 --- a/goal_src/levels/jungle/jungle-obs.gc +++ b/goal_src/levels/jungle/jungle-obs.gc @@ -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) ) diff --git a/goal_src/levels/jungle/junglesnake.gc b/goal_src/levels/jungle/junglesnake.gc index b9aa40f1ba..6c9a56afa4 100644 --- a/goal_src/levels/jungle/junglesnake.gc +++ b/goal_src/levels/jungle/junglesnake.gc @@ -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) diff --git a/goal_src/levels/jungleb/aphid.gc b/goal_src/levels/jungleb/aphid.gc index decae656c2..6f823016c4 100644 --- a/goal_src/levels/jungleb/aphid.gc +++ b/goal_src/levels/jungleb/aphid.gc @@ -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) ) diff --git a/goal_src/levels/jungleb/jungleb-obs.gc b/goal_src/levels/jungleb/jungleb-obs.gc index b9bc3d9604..3226638406 100644 --- a/goal_src/levels/jungleb/jungleb-obs.gc +++ b/goal_src/levels/jungleb/jungleb-obs.gc @@ -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) ) diff --git a/goal_src/levels/jungleb/plant-boss.gc b/goal_src/levels/jungleb/plant-boss.gc index ed09028d1b..ffb0bfcf17 100644 --- a/goal_src/levels/jungleb/plant-boss.gc +++ b/goal_src/levels/jungleb/plant-boss.gc @@ -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) ) ) diff --git a/goal_src/levels/jungleb/plat-flip.gc b/goal_src/levels/jungleb/plat-flip.gc index a09b49e516..ef3f770369 100644 --- a/goal_src/levels/jungleb/plat-flip.gc +++ b/goal_src/levels/jungleb/plat-flip.gc @@ -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) ) diff --git a/goal_src/levels/maincave/baby-spider.gc b/goal_src/levels/maincave/baby-spider.gc index a893ddcdc4..0dfa70404a 100644 --- a/goal_src/levels/maincave/baby-spider.gc +++ b/goal_src/levels/maincave/baby-spider.gc @@ -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) ) diff --git a/goal_src/levels/maincave/dark-crystal.gc b/goal_src/levels/maincave/dark-crystal.gc index e6d098a510..c52fb5e8a4 100644 --- a/goal_src/levels/maincave/dark-crystal.gc +++ b/goal_src/levels/maincave/dark-crystal.gc @@ -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) diff --git a/goal_src/levels/maincave/driller-lurker.gc b/goal_src/levels/maincave/driller-lurker.gc index bc91e101ce..b09627e6e7 100644 --- a/goal_src/levels/maincave/driller-lurker.gc +++ b/goal_src/levels/maincave/driller-lurker.gc @@ -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 ) diff --git a/goal_src/levels/maincave/gnawer.gc b/goal_src/levels/maincave/gnawer.gc index 32aa83fd5d..a3cdf3e071 100644 --- a/goal_src/levels/maincave/gnawer.gc +++ b/goal_src/levels/maincave/gnawer.gc @@ -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 ) diff --git a/goal_src/levels/maincave/maincave-obs.gc b/goal_src/levels/maincave/maincave-obs.gc index d230ebced2..6a52d90802 100644 --- a/goal_src/levels/maincave/maincave-obs.gc +++ b/goal_src/levels/maincave/maincave-obs.gc @@ -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)) diff --git a/goal_src/levels/maincave/mother-spider-egg.gc b/goal_src/levels/maincave/mother-spider-egg.gc index 531151b472..f8a475cda8 100644 --- a/goal_src/levels/maincave/mother-spider-egg.gc +++ b/goal_src/levels/maincave/mother-spider-egg.gc @@ -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 diff --git a/goal_src/levels/misty/balloonlurker.gc b/goal_src/levels/misty/balloonlurker.gc index f4404240f5..70566c868b 100644 --- a/goal_src/levels/misty/balloonlurker.gc +++ b/goal_src/levels/misty/balloonlurker.gc @@ -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) ) diff --git a/goal_src/levels/misty/bonelurker.gc b/goal_src/levels/misty/bonelurker.gc index e2ca0f826a..5c74350895 100644 --- a/goal_src/levels/misty/bonelurker.gc +++ b/goal_src/levels/misty/bonelurker.gc @@ -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) ) diff --git a/goal_src/levels/misty/misty-obs.gc b/goal_src/levels/misty/misty-obs.gc index 768731adb1..7d97707471 100644 --- a/goal_src/levels/misty/misty-obs.gc +++ b/goal_src/levels/misty/misty-obs.gc @@ -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)) diff --git a/goal_src/levels/misty/misty-teetertotter.gc b/goal_src/levels/misty/misty-teetertotter.gc index 31d7fbb359..c170fb61e4 100644 --- a/goal_src/levels/misty/misty-teetertotter.gc +++ b/goal_src/levels/misty/misty-teetertotter.gc @@ -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)) diff --git a/goal_src/levels/misty/misty-warehouse.gc b/goal_src/levels/misty/misty-warehouse.gc index a670117a8a..f4cde58d48 100644 --- a/goal_src/levels/misty/misty-warehouse.gc +++ b/goal_src/levels/misty/misty-warehouse.gc @@ -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) ) diff --git a/goal_src/levels/misty/mistycannon.gc b/goal_src/levels/misty/mistycannon.gc index 7ed304e2b9..f6821eb84c 100644 --- a/goal_src/levels/misty/mistycannon.gc +++ b/goal_src/levels/misty/mistycannon.gc @@ -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: #~%" (-> 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: #~%" (-> obj pos)) + (format #t "~Tvel: #~%" (-> 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: #~%" (-> obj rotate)) + (format #t "~T~Ttilt: #~%" (-> 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: #~%" (-> obj hellmouth)) + (format #t "~T~Tpostbindinfo-ok: ~A~%" (-> obj postbindinfo-ok)) + (format #t "~T~Tlaunch-origin: #~%" (-> obj launch-origin)) + (format #t "~T~Tgoggles: #~%" (-> obj goggles)) + (format #t "~T~Tavoid-entity: ~A~%" (-> obj avoid-entity)) + (format #t "~T~Tcenter-point: #~%" (-> obj center-point)) + (format #t "~T~Tat-point: #~%" (-> 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 @@ ) + + diff --git a/goal_src/levels/misty/muse.gc b/goal_src/levels/misty/muse.gc index d3edfcab52..07a5759fca 100644 --- a/goal_src/levels/misty/muse.gc +++ b/goal_src/levels/misty/muse.gc @@ -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)) ) ) ) diff --git a/goal_src/levels/misty/quicksandlurker.gc b/goal_src/levels/misty/quicksandlurker.gc index 28c7e27ce4..a64de450d6 100644 --- a/goal_src/levels/misty/quicksandlurker.gc +++ b/goal_src/levels/misty/quicksandlurker.gc @@ -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) ) ) diff --git a/goal_src/levels/ogre/ogre-obs.gc b/goal_src/levels/ogre/ogre-obs.gc index baee56dcf8..27b8b6455f 100644 --- a/goal_src/levels/ogre/ogre-obs.gc +++ b/goal_src/levels/ogre/ogre-obs.gc @@ -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)) diff --git a/goal_src/levels/racer_common/collide-reaction-racer.gc b/goal_src/levels/racer_common/collide-reaction-racer.gc index 47355c6f7a..17eb86f7cb 100644 --- a/goal_src/levels/racer_common/collide-reaction-racer.gc +++ b/goal_src/levels/racer_common/collide-reaction-racer.gc @@ -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)) diff --git a/goal_src/levels/racer_common/racer-states-FIC-LAV-MIS-OGR-ROL.gc b/goal_src/levels/racer_common/racer-states-FIC-LAV-MIS-OGR-ROL.gc index 4094011165..e742bc7bb3 100644 --- a/goal_src/levels/racer_common/racer-states-FIC-LAV-MIS-OGR-ROL.gc +++ b/goal_src/levels/racer_common/racer-states-FIC-LAV-MIS-OGR-ROL.gc @@ -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) diff --git a/goal_src/levels/racer_common/target-racer-FIC-LAV-MIS-OGR-ROL.gc b/goal_src/levels/racer_common/target-racer-FIC-LAV-MIS-OGR-ROL.gc index b55031f6d7..e322806b4b 100644 --- a/goal_src/levels/racer_common/target-racer-FIC-LAV-MIS-OGR-ROL.gc +++ b/goal_src/levels/racer_common/target-racer-FIC-LAV-MIS-OGR-ROL.gc @@ -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) ) diff --git a/goal_src/levels/robocave/spider-egg.gc b/goal_src/levels/robocave/spider-egg.gc index eb2525e818..9d15576b1f 100644 --- a/goal_src/levels/robocave/spider-egg.gc +++ b/goal_src/levels/robocave/spider-egg.gc @@ -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)) diff --git a/goal_src/levels/snow/snow-flutflut-obs.gc b/goal_src/levels/snow/snow-flutflut-obs.gc index 0159f7b1af..77186c84b9 100644 --- a/goal_src/levels/snow/snow-flutflut-obs.gc +++ b/goal_src/levels/snow/snow-flutflut-obs.gc @@ -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)) diff --git a/goal_src/levels/snow/snow-obs.gc b/goal_src/levels/snow/snow-obs.gc index 8639c58a14..6ad838a5cf 100644 --- a/goal_src/levels/snow/snow-obs.gc +++ b/goal_src/levels/snow/snow-obs.gc @@ -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)) diff --git a/goal_src/levels/snow/snow-ram.gc b/goal_src/levels/snow/snow-ram.gc index a6b2a68ac7..5e5d758fa8 100644 --- a/goal_src/levels/snow/snow-ram.gc +++ b/goal_src/levels/snow/snow-ram.gc @@ -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)) diff --git a/goal_src/levels/snow/target-snowball.gc b/goal_src/levels/snow/target-snowball.gc index 5f84ba6b71..2c19cb557e 100644 --- a/goal_src/levels/snow/target-snowball.gc +++ b/goal_src/levels/snow/target-snowball.gc @@ -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))) diff --git a/goal_src/levels/snow/yeti.gc b/goal_src/levels/snow/yeti.gc index 0af73ce634..f391eade4c 100644 --- a/goal_src/levels/snow/yeti.gc +++ b/goal_src/levels/snow/yeti.gc @@ -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) diff --git a/goal_src/levels/sunken/bully.gc b/goal_src/levels/sunken/bully.gc index 0a5d756dfa..ba339536e0 100644 --- a/goal_src/levels/sunken/bully.gc +++ b/goal_src/levels/sunken/bully.gc @@ -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))) diff --git a/goal_src/levels/sunken/double-lurker.gc b/goal_src/levels/sunken/double-lurker.gc index b64cc319f3..531a2cff3f 100644 --- a/goal_src/levels/sunken/double-lurker.gc +++ b/goal_src/levels/sunken/double-lurker.gc @@ -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) diff --git a/goal_src/levels/sunken/floating-launcher.gc b/goal_src/levels/sunken/floating-launcher.gc index 2101d234dd..37fc95bf4a 100644 --- a/goal_src/levels/sunken/floating-launcher.gc +++ b/goal_src/levels/sunken/floating-launcher.gc @@ -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) diff --git a/goal_src/levels/sunken/helix-water.gc b/goal_src/levels/sunken/helix-water.gc index 547654ebc8..aa94b0ff29 100644 --- a/goal_src/levels/sunken/helix-water.gc +++ b/goal_src/levels/sunken/helix-water.gc @@ -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) diff --git a/goal_src/levels/sunken/orbit-plat.gc b/goal_src/levels/sunken/orbit-plat.gc index ebe7d7c319..49f6df2654 100644 --- a/goal_src/levels/sunken/orbit-plat.gc +++ b/goal_src/levels/sunken/orbit-plat.gc @@ -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)) diff --git a/goal_src/levels/sunken/puffer.gc b/goal_src/levels/sunken/puffer.gc index a9731d0348..24f83dda3a 100644 --- a/goal_src/levels/sunken/puffer.gc +++ b/goal_src/levels/sunken/puffer.gc @@ -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) ) diff --git a/goal_src/levels/sunken/qbert-plat.gc b/goal_src/levels/sunken/qbert-plat.gc index 68aaf80799..cc16eefdfa 100644 --- a/goal_src/levels/sunken/qbert-plat.gc +++ b/goal_src/levels/sunken/qbert-plat.gc @@ -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))) diff --git a/goal_src/levels/sunken/shover.gc b/goal_src/levels/sunken/shover.gc index e5c6eca7df..0541103656 100644 --- a/goal_src/levels/sunken/shover.gc +++ b/goal_src/levels/sunken/shover.gc @@ -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) diff --git a/goal_src/levels/sunken/square-platform.gc b/goal_src/levels/sunken/square-platform.gc index 4519c1c527..1a7e5bf19c 100644 --- a/goal_src/levels/sunken/square-platform.gc +++ b/goal_src/levels/sunken/square-platform.gc @@ -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) ) diff --git a/goal_src/levels/sunken/steam-cap.gc b/goal_src/levels/sunken/steam-cap.gc index df67bfe1ad..f0aafa8218 100644 --- a/goal_src/levels/sunken/steam-cap.gc +++ b/goal_src/levels/sunken/steam-cap.gc @@ -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) diff --git a/goal_src/levels/sunken/sun-exit-chamber.gc b/goal_src/levels/sunken/sun-exit-chamber.gc index 893dcfd898..0a81386a69 100644 --- a/goal_src/levels/sunken/sun-exit-chamber.gc +++ b/goal_src/levels/sunken/sun-exit-chamber.gc @@ -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)) diff --git a/goal_src/levels/sunken/sun-iris-door.gc b/goal_src/levels/sunken/sun-iris-door.gc index d9249dae30..15317f700b 100644 --- a/goal_src/levels/sunken/sun-iris-door.gc +++ b/goal_src/levels/sunken/sun-iris-door.gc @@ -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) diff --git a/goal_src/levels/sunken/sunken-obs.gc b/goal_src/levels/sunken/sunken-obs.gc index a327db7e15..0df1ec20e9 100644 --- a/goal_src/levels/sunken/sunken-obs.gc +++ b/goal_src/levels/sunken/sunken-obs.gc @@ -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)) diff --git a/goal_src/levels/sunken/target-tube.gc b/goal_src/levels/sunken/target-tube.gc index ec7fb405cf..2e8e6897d8 100644 --- a/goal_src/levels/sunken/target-tube.gc +++ b/goal_src/levels/sunken/target-tube.gc @@ -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 diff --git a/goal_src/levels/sunken/wall-plat.gc b/goal_src/levels/sunken/wall-plat.gc index 4475275437..1628b33520 100644 --- a/goal_src/levels/sunken/wall-plat.gc +++ b/goal_src/levels/sunken/wall-plat.gc @@ -51,7 +51,7 @@ :code (behavior () (set! (-> self extended-amount) 0.0) - (TODO-RENAME-30 (-> self root-override) (-> self in-trans)) + (move-to-point! (-> self root-override) (-> self in-trans)) (transform-post) (clear-collide-with-as (-> self root-override)) (while #t @@ -88,7 +88,7 @@ (set! (-> self extended-amount) (seek (-> self extended-amount) 1.0 (* 2.5 (-> *display* seconds-per-frame)))) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-lerp! gp-0 (-> self in-trans) (-> self out-trans) (-> self extended-amount)) - (TODO-RENAME-30 (-> self root-override) gp-0) + (move-to-point! (-> self root-override) gp-0) ) (suspend) (if (= (-> self extended-amount) 1.0) @@ -113,7 +113,7 @@ :code (behavior () (set! (-> self extended-amount) 1.0) - (TODO-RENAME-30 (-> self root-override) (-> self out-trans)) + (move-to-point! (-> self root-override) (-> self out-trans)) (transform-post) (while #t (logior! (-> self mask) (process-mask sleep-code)) @@ -148,7 +148,7 @@ (set! (-> self extended-amount) (seek (-> self extended-amount) 0.0 (* 2.5 (-> *display* seconds-per-frame)))) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-lerp! gp-0 (-> self in-trans) (-> self out-trans) (-> self extended-amount)) - (TODO-RENAME-30 (-> self root-override) gp-0) + (move-to-point! (-> self root-override) gp-0) ) (suspend) (if (= (-> self extended-amount) 0.0) @@ -191,7 +191,7 @@ (let ((f30-0 (get-current-phase-with-mirror (-> self sync)))) (let ((s5-0 (new 'stack-no-clear 'vector))) (vector-lerp! s5-0 (-> self in-trans) (-> self out-trans) f30-0) - (TODO-RENAME-30 (-> self root-override) s5-0) + (move-to-point! (-> self root-override) s5-0) ) (cond ((= f30-0 0.0) @@ -229,7 +229,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)) @@ -267,7 +267,7 @@ (set! (-> s5-1 frame-num) 0.0) ) (ja-post) - (dummy-47 (-> obj root-override)) + (update-transforms! (-> obj root-override)) (cond ((-> obj use-sync?) (logclear! (-> obj mask) (process-mask actor-pause)) diff --git a/goal_src/levels/sunken/wedge-plats.gc b/goal_src/levels/sunken/wedge-plats.gc index e37e77c9ff..eb82ef8659 100644 --- a/goal_src/levels/sunken/wedge-plats.gc +++ b/goal_src/levels/sunken/wedge-plats.gc @@ -242,7 +242,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)) @@ -259,7 +259,7 @@ (process-drawable-from-entity! obj arg0) (initialize-skeleton obj *wedge-plat-sg* '()) (logior! (-> obj skel status) 1) - (dummy-47 (-> obj root-override)) + (update-transforms! (-> obj root-override)) (dummy-21 obj) (set! (-> obj master) (the-as wedge-plat-master (entity-actor-lookup arg0 'alt-actor 0))) (set! (-> obj offset) (res-lump-float arg0 'rotoffset)) @@ -445,7 +445,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)) @@ -462,7 +462,7 @@ (process-drawable-from-entity! obj arg0) (initialize-skeleton obj *wedge-plat-sg* '()) (logior! (-> obj skel status) 1) - (dummy-47 (-> obj root-override)) + (update-transforms! (-> obj root-override)) (dummy-21 obj) (set! (-> obj master) (the-as wedge-plat-master (entity-actor-lookup arg0 'alt-actor 0))) (set! (-> obj offset) (res-lump-float arg0 'rotoffset)) diff --git a/goal_src/levels/sunken/whirlpool.gc b/goal_src/levels/sunken/whirlpool.gc index 70d089cc87..39523275c4 100644 --- a/goal_src/levels/sunken/whirlpool.gc +++ b/goal_src/levels/sunken/whirlpool.gc @@ -328,9 +328,9 @@ (set! (-> s4-1 z) (* (- (-> s4-1 z) (-> gp-0 z)) (-> *display* frames-per-second))) (let ((gp-1 (-> *target* control))) (send-event (-> gp-1 process) 'rotate-y-angle f30-0) - (dummy-32 gp-1 8192.0 (-> gp-1 root-prim collide-with)) + (fill-cache-for-shape! gp-1 8192.0 (-> gp-1 root-prim collide-with)) (let ((s3-0 (-> gp-1 status))) - (dummy-37 gp-1 s4-1) + (integrate-and-collide! gp-1 s4-1) (set! (-> gp-1 status) s3-0) s3-0 ) @@ -437,7 +437,7 @@ (set! (-> s5-1 frame-num) 0.0) ) (ja-post) - (dummy-47 (-> obj root-override)) + (update-transforms! (-> obj root-override)) (go whirlpool-idle) (none) ) diff --git a/goal_src/levels/swamp/billy.gc b/goal_src/levels/swamp/billy.gc index fa3b113a2e..e62b1b3af0 100644 --- a/goal_src/levels/swamp/billy.gc +++ b/goal_src/levels/swamp/billy.gc @@ -39,20 +39,14 @@ (defmethod relocate billy ((obj billy) (arg0 int)) (countdown (v1-0 3) - (if (nonzero? (-> obj path-data v1-0)) - (&+! (-> obj path-data v1-0) arg0) + (if (nonzero? (-> obj path-data v1-0)) + (&+! (-> obj path-data v1-0) arg0) + ) ) - ) (the-as - billy - ((the-as - (function process-drawable int process-drawable) - (find-parent-method billy 7) - ) - obj - arg0 + billy + ((the-as (function process-drawable int process-drawable) (find-parent-method billy 7)) obj arg0) ) - ) ) (deftype billy-snack (process-drawable) @@ -80,65 +74,49 @@ (defstate billy-snack-eat (billy-snack) :code (behavior () - (let ((v1-2 (-> self skel root-channel 0))) - (set! - (-> v1-2 frame-group) - (the-as art-joint-anim (-> self draw art-group data 3)) - ) - ) - (let ((a0-3 (-> self skel root-channel 0))) - (set! (-> a0-3 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! - (-> a0-3 param 0) - (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) + (let ((v1-2 (-> self skel root-channel 0))) + (set! (-> v1-2 frame-group) (the-as art-joint-anim (-> self draw art-group data 3))) ) - ) - (set! (-> a0-3 param 1) 1.0) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (if (> (-> self skel active-channels) 0) - (-> - self - skel - root-channel - 0 - frame-group - ) - ) - num-func-seek! - ) - ) - (until (ja-done? 0) - (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! - (-> a0-4 param 0) - (the float (+ (-> a0-4 frame-group data 0 length) -1)) + (let ((a0-3 (-> self skel root-channel 0))) + (set! (-> a0-3 frame-group) (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + (set! (-> a0-3 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-3 param 1) 1.0) + (set! (-> a0-3 frame-num) 0.0) + (joint-control-channel-group! + a0-3 + (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + num-func-seek! + ) ) - (set! (-> a0-4 param 1) 1.0) - (joint-control-channel-group-eval! - a0-4 - (the-as art-joint-anim #f) - num-func-seek! + (until (ja-done? 0) + (suspend) + (let ((a0-4 (-> self skel root-channel 0))) + (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) + (set! (-> a0-4 param 1) 1.0) + (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) + ) ) - ) + (deactivate self) + (while #t + (suspend) + ) + (none) ) - (deactivate self) - (while #t - (suspend) - ) - (none) - ) :post (the-as (function none :behavior billy-snack) ja-post) ) @@ -146,65 +124,52 @@ (defstate billy-snack-idle (billy-snack) :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 - (('eat) - (go billy-snack-eat) + (case arg2 + (('eat) + (go billy-snack-eat) + ) ) ) - ) :code (behavior () - (while #t - (let ((a0-0 (-> self skel root-channel 0))) - (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (while #t + (let ((a0-0 (-> self skel root-channel 0))) + (set! (-> a0-0 frame-group) (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-0 param 1) 1.0) + (set! (-> a0-0 frame-num) 0.0) + (joint-control-channel-group! + a0-0 + (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-1 (-> self skel root-channel 0))) + (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group data 0 length) -1))) + (set! (-> a0-1 param 1) 1.0) + (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) + ) + ) ) - (set! - (-> a0-0 param 0) - (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-0 param 1) 1.0) - (set! (-> a0-0 frame-num) 0.0) - (joint-control-channel-group! a0-0 (if (> (-> self skel active-channels) 0) - (-> - self - skel - root-channel - 0 - frame-group - ) - ) - num-func-seek! - ) - ) - (until (ja-done? 0) - (suspend) - (let ((a0-1 (-> self skel root-channel 0))) - (set! - (-> a0-1 param 0) - (the float (+ (-> a0-1 frame-group data 0 length) -1)) - ) - (set! (-> a0-1 param 1) 1.0) - (joint-control-channel-group-eval! - a0-1 - (the-as art-joint-anim #f) - num-func-seek! - ) - ) - ) + (none) ) - (none) - ) :post (the-as (function none :behavior billy-snack) ja-post) ) @@ -236,23 +201,16 @@ (defun rat-about-to-eat? ((arg0 billy-rat) (arg1 billy)) - (the-as - symbol - (and - (= (-> arg0 dest-type) 2) - (> (-> arg1 num-snacks) 0) - (handle->process (-> arg0 snack)) - ) - ) + (the-as symbol (and (= (-> arg0 dest-type) 2) (> (-> arg1 num-snacks) 0) (handle->process (-> arg0 snack)))) ) (defstate nav-enemy-idle (billy-rat) :virtual #t :enter (behavior () - (go-virtual nav-enemy-chase) - (none) - ) + (go-virtual nav-enemy-chase) + (none) + ) :post (the-as (function none :behavior billy-rat) nav-enemy-common-post) ) @@ -261,104 +219,72 @@ :virtual #t :code (behavior () - (nav-enemy-fall-and-play-death-anim - (the-as - art-joint-anim - (-> self draw art-group data (-> self nav-info die-anim)) - ) - 1.0 - 1.0 - 1000000000000000.0 - 600 + (nav-enemy-fall-and-play-death-anim + (the-as art-joint-anim (-> self draw art-group data (-> self nav-info die-anim))) + 1.0 + 1.0 + 1000000000000000.0 + 600 + ) + (send-event (ppointer->process (-> self billy)) 'billy-rat-die) + (dummy-18 self) + (none) ) - (send-event (ppointer->process (-> self billy)) 'billy-rat-die) - (dummy-18 self) - (none) - ) ) (defstate billy-rat-eat (billy-rat) :trans (behavior () - (seek-to-point-toward-point! - (-> self collide-info) - (-> self destination) - 131072.0 - 3 + (seek-to-point-toward-point! (-> self collide-info) (-> self destination) 131072.0 3) + (none) ) - (none) - ) :code (behavior () - (send-event (handle->process (-> self snack)) 'eat) - (sound-play-by-name - (static-sound-name "rat-gulp") - (new-sound-id) - 1024 - 0 - 0 - 1 - #t - ) - (ja-channel-push! 1 15) - (let ((v1-8 (-> self skel root-channel 0))) - (set! - (-> v1-8 frame-group) - (the-as art-joint-anim (-> self draw art-group data 12)) - ) - ) - (let ((a0-9 (-> self skel root-channel 0))) - (set! (-> a0-9 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - (set! - (-> a0-9 param 0) - (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) + (send-event (handle->process (-> self snack)) 'eat) + (sound-play-by-name (static-sound-name "rat-gulp") (new-sound-id) 1024 0 0 1 #t) + (ja-channel-push! 1 15) + (let ((v1-8 (-> self skel root-channel 0))) + (set! (-> v1-8 frame-group) (the-as art-joint-anim (-> self draw art-group data 12))) ) - ) - (set! (-> a0-9 param 1) 1.0) - (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! a0-9 (if (> (-> self skel active-channels) 0) - (-> - self - skel - root-channel - 0 - frame-group - ) - ) - num-func-seek! - ) - ) - (until (ja-done? 0) - (suspend) - (let ((a0-10 (-> self skel root-channel 0))) - (set! - (-> a0-10 param 0) - (the float (+ (-> a0-10 frame-group data 0 length) -1)) + (let ((a0-9 (-> self skel root-channel 0))) + (set! (-> a0-9 frame-group) (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + (set! (-> a0-9 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-9 param 1) 1.0) + (set! (-> a0-9 frame-num) 0.0) + (joint-control-channel-group! + a0-9 + (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + num-func-seek! + ) ) - (set! (-> a0-10 param 1) 1.0) - (joint-control-channel-group-eval! - a0-10 - (the-as art-joint-anim #f) - num-func-seek! + (until (ja-done? 0) + (suspend) + (let ((a0-10 (-> self skel root-channel 0))) + (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) + (set! (-> a0-10 param 1) 1.0) + (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-seek!) + ) ) - ) + (send-event (ppointer->process (-> self billy)) 'billy-rat-needs-destination) + (logclear! (-> self nav flags) (nav-control-flags bit19)) + (go-virtual nav-enemy-chase) + (none) ) - (send-event (ppointer->process (-> self billy)) 'billy-rat-needs-destination) - (logclear! (-> self nav flags) (nav-control-flags bit19)) - (go-virtual nav-enemy-chase) - (none) - ) :post (the-as (function none :behavior billy-rat) nav-enemy-simple-post) ) @@ -366,84 +292,51 @@ (defstate billy-rat-salivate (billy-rat) :event (the-as - (function process int symbol event-message-block object :behavior billy-rat) - nav-enemy-default-event-handler - ) + (function process int symbol event-message-block object :behavior billy-rat) + nav-enemy-default-event-handler + ) :code (behavior () - (ja-channel-push! 1 22) - (dotimes (gp-0 1) - (sound-play-by-name - (static-sound-name "rat-eat") - (new-sound-id) - 1024 - 0 - 0 - 1 - #t - ) - (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) - (let ((a0-3 (-> self skel root-channel 0))) - (set! - (-> a0-3 frame-group) - (the-as - art-joint-anim - (-> self draw art-group data (-> self nav-info victory-anim)) - ) - ) - (set! - (-> a0-3 param 0) - (the - float - (+ - (-> - (the-as - art-joint-anim - (-> self draw art-group data (-> self nav-info victory-anim)) - ) - data - 0 - length + (ja-channel-push! 1 22) + (dotimes (gp-0 1) + (sound-play-by-name (static-sound-name "rat-eat") (new-sound-id) 1024 0 0 1 #t) + (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) + (let ((a0-3 (-> self skel root-channel 0))) + (set! (-> a0-3 frame-group) + (the-as art-joint-anim (-> self draw art-group data (-> self nav-info victory-anim))) + ) + (set! (-> a0-3 param 0) + (the float + (+ (-> (the-as art-joint-anim (-> self draw art-group data (-> self nav-info victory-anim))) data 0 length) + -1 + ) + ) + ) + (set! (-> a0-3 param 1) f30-0) + (set! (-> a0-3 frame-num) 0.0) + (joint-control-channel-group! + a0-3 + (the-as art-joint-anim (-> self draw art-group data (-> self nav-info victory-anim))) + num-func-seek! + ) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-4 (-> self skel root-channel 0))) + (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group data 0 length) -1))) + (set! (-> a0-4 param 1) f30-0) + (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) + ) ) - -1 - ) ) - ) - (set! (-> a0-3 param 1) f30-0) - (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! - a0-3 - (the-as - art-joint-anim - (-> self draw art-group data (-> self nav-info victory-anim)) - ) - num-func-seek! - ) ) - (until (ja-done? 0) - (suspend) - (let ((a0-4 (-> self skel root-channel 0))) - (set! - (-> a0-4 param 0) - (the float (+ (-> a0-4 frame-group data 0 length) -1)) + (send-event (ppointer->process (-> self billy)) 'billy-rat-needs-destination) + (if (= (-> self dest-type) 3) + (go billy-rat-eat) + (go-virtual nav-enemy-chase) ) - (set! (-> a0-4 param 1) f30-0) - (joint-control-channel-group-eval! - a0-4 - (the-as art-joint-anim #f) - num-func-seek! - ) - ) - ) - ) + (none) ) - (send-event (ppointer->process (-> self billy)) 'billy-rat-needs-destination) - (if (= (-> self dest-type) 3) - (go billy-rat-eat) - (go-virtual nav-enemy-chase) - ) - (none) - ) :post (the-as (function none :behavior billy-rat) nav-enemy-simple-post) ) @@ -452,75 +345,61 @@ :virtual #t :enter (behavior () - (let - ((t9-1 - (-> (the-as (state nav-enemy) (find-parent-method billy-rat 33)) enter) + (let ((t9-1 (-> (the-as (state nav-enemy) (find-parent-method billy-rat 33)) enter))) + (if t9-1 + (t9-1) + ) ) - ) - (if t9-1 - (t9-1) - ) - ) - (when (logtest? (nav-control-flags bit19) (-> self nav flags)) - (logclear! (-> self nav flags) (nav-control-flags bit19)) - (if (rat-about-to-eat? self (-> self billy 0)) - (go billy-rat-salivate) - (send-event - (ppointer->process (-> self billy)) - 'billy-rat-needs-destination + (when (logtest? (nav-control-flags bit19) (-> self nav flags)) + (logclear! (-> self nav flags) (nav-control-flags bit19)) + (if (rat-about-to-eat? self (-> self billy 0)) + (go billy-rat-salivate) + (send-event (ppointer->process (-> self billy)) 'billy-rat-needs-destination) + ) ) - ) + (none) ) - (none) - ) ) (defstate nav-enemy-stare (billy-rat) :virtual #t :enter (behavior () - (go-virtual nav-enemy-chase) - (none) - ) + (go-virtual nav-enemy-chase) + (none) + ) ) (defstate nav-enemy-chase (billy-rat) :virtual #t :trans (behavior () - (set! (-> self speed-scale) (-> self billy 0 rat-speed)) - (if - (or - (logtest? (nav-control-flags bit19) (-> self nav flags)) - (>= - (- (-> *display* base-frame-counter) (-> self state-time)) - (the-as int (-> self chase-rest-time)) - ) - ) - (go-virtual nav-enemy-victory) + (set! (-> self speed-scale) (-> self billy 0 rat-speed)) + (if (or (logtest? (nav-control-flags bit19) (-> self nav flags)) + (>= (- (-> *display* base-frame-counter) (-> self state-time)) (the-as int (-> self chase-rest-time))) + ) + (go-virtual nav-enemy-victory) + ) + (none) ) - (none) - ) :post (behavior () - (swamp-rat-update-wiggle-target (-> self destination)) - (nav-enemy-travel-post) - (none) - ) + (swamp-rat-update-wiggle-target (-> self destination)) + (nav-enemy-travel-post) + (none) + ) ) -(defbehavior - billy-rat-init-by-other billy-rat - ((arg0 billy) (arg1 vector) (arg2 vector)) +(defbehavior billy-rat-init-by-other billy-rat ((arg0 billy) (arg1 vector) (arg2 vector)) (set! (-> self billy) (the-as (pointer billy) (process->ppointer arg0))) (set! (-> self destination quad) (-> arg2 quad)) (set! (-> self dest-type) (the-as uint 1)) (let ((s4-0 (new 'stack-no-clear 'vector))) - (vector-! s4-0 arg2 arg1) - (set! (-> s4-0 y) 0.0) - (vector-normalize! s4-0 1.0) - (swamp-rat-init-by-other arg0 arg1 s4-0 (pickup-type none) #t) - ) + (vector-! s4-0 arg2 arg1) + (set! (-> s4-0 y) 0.0) + (vector-normalize! s4-0 1.0) + (swamp-rat-init-by-other arg0 arg1 s4-0 (pickup-type none) #t) + ) (none) ) @@ -545,903 +424,500 @@ (let* ((gp-0 (the-as (pointer process-tree) (-> self child-override))) (s5-0 (-> (the-as (pointer billy-snack) gp-0) 0 brother)) ) - (while gp-0 - (if - (not - (or - (= gp-0 (-> self farthy process)) - (type-type? (-> (ppointer->process gp-0) type) fuel-cell) - ) + (while gp-0 + (if (not (or (= gp-0 (-> self farthy process)) (type-type? (-> (ppointer->process gp-0) type) fuel-cell))) + (deactivate (-> gp-0 0)) + ) + (set! gp-0 s5-0) + (set! s5-0 (-> gp-0 0 brother)) ) - (deactivate (-> gp-0 0)) - ) - (set! gp-0 s5-0) - (set! s5-0 (-> gp-0 0 brother)) ) - ) #f ) (defmethod play-anim! billy ((obj billy) (arg0 symbol)) - (case (current-status (-> obj tasks)) - (((task-status need-hint) (task-status need-introduction)) + (case (current-status (-> obj tasks)) + (((task-status need-hint) (task-status need-introduction)) (when arg0 - (set! (-> obj blend-on-exit) #t) - (close-status! (-> obj tasks) (task-status need-introduction)) - (let ((s5-1 (new 'stack-no-clear 'vector))) - (dotimes - (s4-0 - (+ - (the int (the float (+ (-> obj path-snacks curve num-cverts) -1))) - 1 - ) - ) - (eval-path-curve-div! (-> obj path-snacks) s5-1 (the float s4-0) 'exact) - (set! (-> s5-1 x) (+ -40960.0 (-> s5-1 x))) - (set! (-> s5-1 z) (+ 20480.0 (-> s5-1 z))) - (let ((s3-0 (get-process *default-dead-pool* manipy #x4000))) - (when s3-0 - (let ((t9-4 (method-of-type manipy activate))) - (t9-4 (the-as manipy s3-0) obj 'manipy (the-as pointer #x70004000)) + (set! (-> obj blend-on-exit) #t) + (close-status! (-> obj tasks) (task-status need-introduction)) + (let ((s5-1 (new 'stack-no-clear 'vector))) + (dotimes (s4-0 (+ (the int (the float (+ (-> obj path-snacks curve num-cverts) -1))) 1)) + (eval-path-curve-div! (-> obj path-snacks) s5-1 (the float s4-0) 'exact) + (set! (-> s5-1 x) (+ -40960.0 (-> s5-1 x))) + (set! (-> s5-1 z) (+ 20480.0 (-> s5-1 z))) + (let ((s3-0 (get-process *default-dead-pool* manipy #x4000))) + (when s3-0 + (let ((t9-4 (method-of-type manipy activate))) + (t9-4 (the-as manipy s3-0) obj 'manipy (the-as pointer #x70004000)) + ) + (run-now-in-process s3-0 manipy-init s5-1 (-> obj entity) *farthy-snack-sg* #f) + (-> s3-0 ppointer) + ) + ) ) - (run-now-in-process - s3-0 - manipy-init - s5-1 - (-> obj entity) - *farthy-snack-sg* - #f - ) - (-> s3-0 ppointer) - ) ) - ) ) - ) (new 'static 'spool-anim - :name "billy-introduction" - :index 5 - :parts 14 - :command-list - '( - (0 - kill - "swamp-blimp-3" + :name "billy-introduction" + :index 5 + :parts 14 + :command-list + '((0 kill "swamp-blimp-3") + (0 kill "swamp-tetherrock-14") + (0 kill "swamp-tetherrock-15") + (0 kill "flutflut-3") + (0 kill "tar-plat-26") + (0 kill "tar-plat-25") + (0 kill "babak-380") + (0 kill "eco-164") + (0 kill "eco-165") + (0 kill "eco-140") + (0 kill "launcher-97") + (0 kill "swamp-rat-nest-5") + (0 kill "swamp-rat-nest-4") + (0 kill "swamp-rat-nest-3") + (0 kill "swamp-rat-nest-2") + (0 kill "sharkey-9") + (0 kill "launcher-46") + (0 kill "launcher-44") + (0 kill "launcher-42") + (0 kill "swamp-spike-43") + (0 kill "swamp-spike-44") + (0 kill "swamp-spike-45") + (346 blackout 10) + (349 blackout 0) + (494 blackout 10) + (497 blackout 0) + (1145 blackout 10) + (1148 blackout 0) + (1518 blackout 10) + (1521 blackout 0) + ) + ) + ) + (((task-status need-reminder-a) (task-status need-reminder)) + (set! (-> obj skippable) #t) + (set! (-> obj blend-on-exit) #t) + (set! (-> obj will-talk) #t) + (new 'static 'spool-anim + :name "billy-reminder-1" + :index 8 + :parts 2 + :command-list + '((0 kill "swamp-blimp-3") + (0 kill "swamp-tetherrock-14") + (0 kill "swamp-tetherrock-15") + (0 kill "flutflut-3") + (0 kill "tar-plat-26") + (0 kill "tar-plat-25") + (0 kill "babak-380") + (0 kill "eco-164") + (0 kill "eco-165") + (0 kill "eco-140") + (0 kill "launcher-97") + (0 kill "swamp-rat-nest-5") + (0 kill "swamp-rat-nest-4") + (0 kill "swamp-rat-nest-3") + (0 kill "swamp-rat-nest-2") + (0 kill "sharkey-9") + (0 kill "launcher-46") + (0 kill "launcher-44") + (0 kill "launcher-42") + (0 kill "swamp-spike-43") + (0 kill "swamp-spike-44") + (0 kill "swamp-spike-45") + ) + ) + ) + (((task-status need-reward-speech)) + (when arg0 + (set! (-> obj cell-for-task) (current-task (-> obj tasks))) + (close-current! (-> obj tasks)) + ) + (new 'static 'spool-anim + :name "billy-resolution" + :index 9 + :parts 2 + :command-list + '((0 kill "swamp-blimp-3") + (0 kill "swamp-tetherrock-14") + (0 kill "swamp-tetherrock-15") + (0 kill "flutflut-3") + (0 kill "tar-plat-26") + (0 kill "tar-plat-25") + (0 kill "babak-380") + (0 kill "eco-164") + (0 kill "eco-165") + (0 kill "eco-140") + (0 kill "launcher-97") + (0 kill "swamp-rat-nest-5") + (0 kill "swamp-rat-nest-4") + (0 kill "swamp-rat-nest-3") + (0 kill "swamp-rat-nest-2") + (0 kill "sharkey-9") + (0 kill "launcher-46") + (0 kill "launcher-44") + (0 kill "launcher-42") + (0 kill "swamp-spike-43") + (0 kill "swamp-spike-44") + (0 kill "swamp-spike-45") + ) + ) + ) + (else + (if arg0 + (format + 0 + "ERROR: : ~S playing anim for task status ~S~%" + (-> obj name) + (task-status->string (current-status (-> obj tasks))) + ) ) - (0 - kill - "swamp-tetherrock-14" - ) - (0 - kill - "swamp-tetherrock-15" - ) - (0 - kill - "flutflut-3" - ) - (0 - kill - "tar-plat-26" - ) - (0 - kill - "tar-plat-25" - ) - (0 - kill - "babak-380" - ) - (0 - kill - "eco-164" - ) - (0 - kill - "eco-165" - ) - (0 - kill - "eco-140" - ) - (0 - kill - "launcher-97" - ) - (0 - kill - "swamp-rat-nest-5" - ) - (0 - kill - "swamp-rat-nest-4" - ) - (0 - kill - "swamp-rat-nest-3" - ) - (0 - kill - "swamp-rat-nest-2" - ) - (0 - kill - "sharkey-9" - ) - (0 - kill - "launcher-46" - ) - (0 - kill - "launcher-44" - ) - (0 - kill - "launcher-42" - ) - (0 - kill - "swamp-spike-43" - ) - (0 - kill - "swamp-spike-44" - ) - (0 - kill - "swamp-spike-45" - ) - ((the binteger 346) - blackout - (the binteger 10) - ) - ((the binteger 349) - blackout - 0 - ) - ((the binteger 494) - blackout - (the binteger 10) - ) - ((the binteger 497) - blackout - 0 - ) - ((the binteger 1145) - blackout - (the binteger 10) - ) - ((the binteger 1148) - blackout - 0 - ) - ((the binteger 1518) - blackout - (the binteger 10) - ) - ((the binteger 1521) blackout 0) - ) + (-> obj draw art-group data 3) ) - ) - (((task-status need-reminder-a) (task-status need-reminder)) - (set! (-> obj skippable) #t) - (set! (-> obj blend-on-exit) #t) - (set! (-> obj will-talk) #t) - (new 'static 'spool-anim - :name "billy-reminder-1" - :index 8 - :parts 2 - :command-list - '( - (0 - kill - "swamp-blimp-3" - ) - (0 - kill - "swamp-tetherrock-14" - ) - (0 - kill - "swamp-tetherrock-15" - ) - (0 - kill - "flutflut-3" - ) - (0 - kill - "tar-plat-26" - ) - (0 - kill - "tar-plat-25" - ) - (0 - kill - "babak-380" - ) - (0 - kill - "eco-164" - ) - (0 - kill - "eco-165" - ) - (0 - kill - "eco-140" - ) - (0 - kill - "launcher-97" - ) - (0 - kill - "swamp-rat-nest-5" - ) - (0 - kill - "swamp-rat-nest-4" - ) - (0 - kill - "swamp-rat-nest-3" - ) - (0 - kill - "swamp-rat-nest-2" - ) - (0 - kill - "sharkey-9" - ) - (0 - kill - "launcher-46" - ) - (0 - kill - "launcher-44" - ) - (0 - kill - "launcher-42" - ) - (0 - kill - "swamp-spike-43" - ) - (0 kill "swamp-spike-44") (0 kill "swamp-spike-45") - ) - ) ) - (((task-status need-reward-speech)) - (when arg0 - (set! (-> obj cell-for-task) (current-task (-> obj tasks))) - (close-current! (-> obj tasks)) - ) - (new 'static 'spool-anim - :name "billy-resolution" - :index 9 - :parts 2 - :command-list - '( - (0 - kill - "swamp-blimp-3" - ) - (0 - kill - "swamp-tetherrock-14" - ) - (0 - kill - "swamp-tetherrock-15" - ) - (0 - kill - "flutflut-3" - ) - (0 - kill - "tar-plat-26" - ) - (0 - kill - "tar-plat-25" - ) - (0 - kill - "babak-380" - ) - (0 - kill - "eco-164" - ) - (0 - kill - "eco-165" - ) - (0 - kill - "eco-140" - ) - (0 - kill - "launcher-97" - ) - (0 - kill - "swamp-rat-nest-5" - ) - (0 - kill - "swamp-rat-nest-4" - ) - (0 - kill - "swamp-rat-nest-3" - ) - (0 - kill - "swamp-rat-nest-2" - ) - (0 - kill - "sharkey-9" - ) - (0 - kill - "launcher-46" - ) - (0 - kill - "launcher-44" - ) - (0 - kill - "launcher-42" - ) - (0 - kill - "swamp-spike-43" - ) - (0 kill "swamp-spike-44") (0 kill "swamp-spike-45") - ) - ) - ) - (else - (if arg0 - (format - 0 - "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) - ) - ) - (-> obj draw art-group data 3) - ) - ) ) (defmethod get-art-elem billy ((obj billy)) - (case (current-status (-> obj tasks)) - (((task-status invalid) (task-status need-resolution)) + (case (current-status (-> obj tasks)) + (((task-status invalid) (task-status need-resolution)) (-> obj draw art-group data 10) ) - (else - (-> obj draw art-group data 3) + (else + (-> obj draw art-group data 3) + ) ) - ) ) (defmethod dummy-38 billy ((obj billy)) - (case (current-status (-> obj tasks)) - (((task-status need-reminder-a) (task-status need-reminder)) + (case (current-status (-> obj tasks)) + (((task-status need-reminder-a) (task-status need-reminder)) (go (method-of-object obj query)) ) - (((task-status need-reward-speech)) - (go (method-of-object obj play-anim)) - ) - (else - ((the-as (function nav-enemy none) (find-parent-method billy 38)) - (the-as nav-enemy obj) + (((task-status need-reward-speech)) + (go (method-of-object obj play-anim)) ) + (else + ((the-as (function nav-enemy none) (find-parent-method billy 38)) (the-as nav-enemy obj)) + ) ) - ) (none) ) (defmethod get-accept-anim billy ((obj billy) (arg0 symbol)) (if arg0 - (close-current! (-> obj tasks)) - ) - (new 'static 'spool-anim - :name "billy-accept" - :index 6 - :parts 3 - :command-list '() - ) + (close-current! (-> obj tasks)) + ) + (new 'static 'spool-anim :name "billy-accept" :index 6 :parts 3 :command-list '()) ) (defmethod get-reject-anim billy ((obj billy) (arg0 symbol)) - (new 'static 'spool-anim - :name "billy-reject" - :index 7 - :parts 3 - :command-list '() - ) + (new 'static 'spool-anim :name "billy-reject" :index 7 :parts 3 :command-list '()) ) (defstate billy-done (billy) :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (let ((v1-0 arg2)) - (the-as object (when (= v1-0 'billy-rat-needs-destination) - (let* ((gp-0 arg0) - (v1-2 - (if - (and - (nonzero? gp-0) - (type-type? (-> gp-0 type) billy-rat) + (let ((v1-0 arg2)) + (the-as object (when (= v1-0 'billy-rat-needs-destination) + (let* ((gp-0 arg0) + (v1-2 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) billy-rat)) + gp-0 + ) + ) ) - gp-0 - ) - ) + (when v1-2 + (set! (-> (the-as billy-rat v1-2) dest-type) (the-as uint 1)) + (get-random-point (-> self path-waypts) (-> (the-as billy-rat v1-2) destination)) ) - (when v1-2 - (set! - (-> (the-as billy-rat v1-2) dest-type) - (the-as uint 1) + ) ) - (get-random-point - (-> self path-waypts) - (-> (the-as billy-rat v1-2) destination) - ) - ) - ) - ) - ) + ) + ) ) - ) :enter (behavior () - (init! - (-> self query) - (lookup-text! *common-text* (game-text-id play-again?) #f) - 40 - 150 - 30 - #f - (lookup-text! *common-text* (game-text-id quit) #f) - ) - (ja-channel-set! 1) - (let ((gp-1 (-> self skel root-channel 0))) - (set! (-> gp-1 frame-group) (the-as art-joint-anim (get-art-elem self))) - ) - (send-event *target* 'end-mode) - (when - (and (handle->process (-> self offending-rat)) (zero? (-> self num-snacks))) - (send-event - *camera* - 'change-target - (handle->process (-> self offending-rat)) - ) - (send-event *camera* 'change-state cam-standoff 0) - (send-event *camera* 'set-standoff-height 0.0) - (send-event *camera* 'set-standoff-dist 20480.0) - (send-event *camera* 'set-standoff-height 16384.0) - (send-event *camera-combiner* 'stop-tracking) - (send-event - *camera-combiner* - 'start-tracking - (ppointer->process (-> *camera* slave 0)) - ) - (let ((a0-24 (get-reminder (-> self tasks) 0))) - (save-reminder (-> self tasks) (seekl a0-24 255 1) 0) - ) - (let* ((v1-49 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-50 (the-as number (logior #x3f800000 v1-49))) - (f0-2 (+ -1.0 (the-as float v1-50))) - ) - (cond - ((< 0.75 f0-2) - (play-ambient (-> self ambient) "BIL-TA04" #t (the-as vector #f)) - ) - ((< 0.5 f0-2) - (play-ambient (-> self ambient) "BIL-TA05" #t (the-as vector #f)) - ) - ((< 0.25 f0-2) - (play-ambient (-> self ambient) "BIL-TA4A" #t (the-as vector #f)) - ) - (else - (play-ambient (-> self ambient) "BIL-TA5A" #t (the-as vector #f)) - ) + (init! + (-> self query) + (lookup-text! *common-text* (game-text-id play-again?) #f) + 40 + 150 + 30 + #f + (lookup-text! *common-text* (game-text-id quit) #f) ) - ) + (ja-channel-set! 1) + (let ((gp-1 (-> self skel root-channel 0))) + (set! (-> gp-1 frame-group) (the-as art-joint-anim (get-art-elem self))) + ) + (send-event *target* 'end-mode) + (when (and (handle->process (-> self offending-rat)) (zero? (-> self num-snacks))) + (send-event *camera* 'change-target (handle->process (-> self offending-rat))) + (send-event *camera* 'change-state cam-standoff 0) + (send-event *camera* 'set-standoff-height 0.0) + (send-event *camera* 'set-standoff-dist 20480.0) + (send-event *camera* 'set-standoff-height 16384.0) + (send-event *camera-combiner* 'stop-tracking) + (send-event *camera-combiner* 'start-tracking (ppointer->process (-> *camera* slave 0))) + (let ((a0-24 (get-reminder (-> self tasks) 0))) + (save-reminder (-> self tasks) (seekl a0-24 255 1) 0) + ) + (let* ((v1-49 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-50 (the-as number (logior #x3f800000 v1-49))) + (f0-2 (+ -1.0 (the-as float v1-50))) + ) + (cond + ((< 0.75 f0-2) + (play-ambient (-> self ambient) "BIL-TA04" #t (the-as vector #f)) + ) + ((< 0.5 f0-2) + (play-ambient (-> self ambient) "BIL-TA05" #t (the-as vector #f)) + ) + ((< 0.25 f0-2) + (play-ambient (-> self ambient) "BIL-TA4A" #t (the-as vector #f)) + ) + (else + (play-ambient (-> self ambient) "BIL-TA5A" #t (the-as vector #f)) + ) + ) + ) + ) + (none) ) - (none) - ) :exit (behavior () - (billy-kill-all-but-farthy) - (send-event *camera* 'change-target *target*) - (send-event *camera* 'change-state *camera-base-mode* 0) - (none) - ) + (billy-kill-all-but-farthy) + (send-event *camera* 'change-target *target*) + (send-event *camera* 'change-state *camera-base-mode* 0) + (none) + ) :trans (behavior () - (cond - ((> (-> self num-snacks) 0) - (when (process-grab? *target*) - (close-current! (-> self tasks)) - (go-virtual play-anim) - ) - ) - ((< (-> self num-snacks) 0) - (go-virtual idle) - ) - (else - (process-grab? *target*) - (when (and *target* (logtest? (-> *target* state-flags) 256)) - (let ((gp-0 (get-response (-> self query)))) - (cond - ((and (= gp-0 'yes) (process-release? *target*)) - (go-virtual enter-playing) + (cond + ((> (-> self num-snacks) 0) + (when (process-grab? *target*) + (close-current! (-> self tasks)) + (go-virtual play-anim) ) - ((= gp-0 'no) - (go-virtual play-reject) - ) - ) ) + ((< (-> self num-snacks) 0) + (go-virtual idle) + ) + (else + (process-grab? *target*) + (when (and *target* (logtest? (-> *target* state-flags) 256)) + (let ((gp-0 (get-response (-> self query)))) + (cond + ((and (= gp-0 'yes) (process-release? *target*)) + (go-virtual enter-playing) + ) + ((= gp-0 'no) + (go-virtual play-reject) + ) + ) + ) + ) + ) ) - ) + (spool-push *art-control* "billy-reject" 0 self -99.0) + (none) ) - (spool-push *art-control* "billy-reject" 0 self -99.0) - (none) - ) :code (the-as (function none :behavior billy) process-taskable-anim-loop) :post (behavior () - (ja-post) - (none) - ) + (ja-post) + (none) + ) ) (defbehavior billy-game-update-wave billy () - (let* - ((a0-2 - (/ (the-as uint (+ (get-reminder (-> self tasks) 0) 1)) (the-as uint 5)) - ) - (v1-4 (min 3 (the-as int a0-2))) + (let* ((a0-2 (/ (the-as uint (+ (get-reminder (-> self tasks) 0) 1)) (the-as uint 5))) + (v1-4 (min 3 (the-as int a0-2))) + ) + (cond + ((zero? v1-4) + (let ((v1-5 (-> self current-wave))) + (cond + ((zero? v1-5) + (set! (-> self max-rats) 6) + (set! (-> self rat-speed) 1.0) + (set! (-> self spawn-rats) #t) + (set! (-> self passed-last-stage) #f) + (when (>= (- (-> *display* base-frame-counter) (the-as int (-> self wave-start-time))) 4500) + (+! (-> self current-wave) 1) + (set! (-> self wave-start-time) (the-as uint (-> *display* base-frame-counter))) + ) + ) + ((= v1-5 2) + (set! (-> self max-rats) 8) + (set! (-> self rat-speed) 1.2) + (set! (-> self spawn-rats) #t) + (when (>= (- (-> *display* base-frame-counter) (the-as int (-> self wave-start-time))) 6000) + (+! (-> self current-wave) 1) + (set! (-> self wave-start-time) (the-as uint (-> *display* base-frame-counter))) + ) + ) + ((= v1-5 4) + (set! (-> self max-rats) 10) + (set! (-> self rat-speed) 1.35) + (set! (-> self spawn-rats) #t) + (when (>= (- (-> *display* base-frame-counter) (the-as int (-> self wave-start-time))) 7500) + (+! (-> self current-wave) 1) + (set! (-> self wave-start-time) (the-as uint (-> *display* base-frame-counter))) + ) + ) + ) + ) + ) + ((= v1-4 1) + (let ((v1-30 (-> self current-wave))) + (cond + ((zero? v1-30) + (set! (-> self max-rats) 6) + (set! (-> self rat-speed) 1.0) + (set! (-> self spawn-rats) #t) + (set! (-> self passed-last-stage) #f) + (when (>= (- (-> *display* base-frame-counter) (the-as int (-> self wave-start-time))) 4500) + (+! (-> self current-wave) 1) + (set! (-> self wave-start-time) (the-as uint (-> *display* base-frame-counter))) + ) + ) + ((= v1-30 2) + (set! (-> self max-rats) 7) + (set! (-> self rat-speed) 1.2) + (set! (-> self spawn-rats) #t) + (when (>= (- (-> *display* base-frame-counter) (the-as int (-> self wave-start-time))) 6000) + (+! (-> self current-wave) 1) + (set! (-> self wave-start-time) (the-as uint (-> *display* base-frame-counter))) + ) + ) + ((= v1-30 4) + (set! (-> self max-rats) 10) + (set! (-> self rat-speed) 1.3) + (set! (-> self spawn-rats) #t) + (when (>= (- (-> *display* base-frame-counter) (the-as int (-> self wave-start-time))) 6600) + (+! (-> self current-wave) 1) + (set! (-> self wave-start-time) (the-as uint (-> *display* base-frame-counter))) + ) + ) + ) + ) + ) + ((= v1-4 2) + (let ((v1-55 (-> self current-wave))) + (cond + ((zero? v1-55) + (set! (-> self max-rats) 6) + (set! (-> self rat-speed) 1.0) + (set! (-> self spawn-rats) #t) + (set! (-> self passed-last-stage) #f) + (when (>= (- (-> *display* base-frame-counter) (the-as int (-> self wave-start-time))) 4500) + (+! (-> self current-wave) 1) + (set! (-> self wave-start-time) (the-as uint (-> *display* base-frame-counter))) + ) + ) + ((= v1-55 2) + (set! (-> self max-rats) 7) + (set! (-> self rat-speed) 1.1) + (set! (-> self spawn-rats) #t) + (when (>= (- (-> *display* base-frame-counter) (the-as int (-> self wave-start-time))) 5400) + (+! (-> self current-wave) 1) + (set! (-> self wave-start-time) (the-as uint (-> *display* base-frame-counter))) + ) + ) + ((= v1-55 4) + (set! (-> self max-rats) 9) + (set! (-> self rat-speed) 1.25) + (set! (-> self spawn-rats) #t) + (when (>= (- (-> *display* base-frame-counter) (the-as int (-> self wave-start-time))) 6000) + (+! (-> self current-wave) 1) + (set! (-> self wave-start-time) (the-as uint (-> *display* base-frame-counter))) + ) + ) + ) + ) + ) + (else + (let ((v1-80 (-> self current-wave))) + (cond + ((zero? v1-80) + (set! (-> self max-rats) 5) + (set! (-> self rat-speed) 0.9) + (set! (-> self spawn-rats) #t) + (set! (-> self passed-last-stage) #f) + (when (>= (- (-> *display* base-frame-counter) (the-as int (-> self wave-start-time))) 4500) + (+! (-> self current-wave) 1) + (set! (-> self wave-start-time) (the-as uint (-> *display* base-frame-counter))) + ) + ) + ((= v1-80 2) + (set! (-> self max-rats) 6) + (set! (-> self rat-speed) 1.0) + (set! (-> self spawn-rats) #t) + (when (>= (- (-> *display* base-frame-counter) (the-as int (-> self wave-start-time))) 5400) + (+! (-> self current-wave) 1) + (set! (-> self wave-start-time) (the-as uint (-> *display* base-frame-counter))) + ) + ) + ((= v1-80 4) + (set! (-> self max-rats) 8) + (set! (-> self rat-speed) 1.1) + (set! (-> self spawn-rats) #t) + (when (>= (- (-> *display* base-frame-counter) (the-as int (-> self wave-start-time))) 6000) + (+! (-> self current-wave) 1) + (set! (-> self wave-start-time) (the-as uint (-> *display* base-frame-counter))) + ) + ) + ) + ) + ) + ) ) - (cond - ((zero? v1-4) - (let ((v1-5 (-> self current-wave))) - (cond - ((zero? v1-5) - (set! (-> self max-rats) 6) - (set! (-> self rat-speed) 1.0) - (set! (-> self spawn-rats) #t) - (set! (-> self passed-last-stage) #f) - (when - (>= - (- - (-> *display* base-frame-counter) - (the-as int (-> self wave-start-time)) - ) - 4500 - ) - (+! (-> self current-wave) 1) - (set! - (-> self wave-start-time) - (the-as uint (-> *display* base-frame-counter)) - ) - ) - ) - ((= v1-5 2) - (set! (-> self max-rats) 8) - (set! (-> self rat-speed) 1.2) - (set! (-> self spawn-rats) #t) - (when - (>= - (- - (-> *display* base-frame-counter) - (the-as int (-> self wave-start-time)) - ) - 6000 - ) - (+! (-> self current-wave) 1) - (set! - (-> self wave-start-time) - (the-as uint (-> *display* base-frame-counter)) - ) - ) - ) - ((= v1-5 4) - (set! (-> self max-rats) 10) - (set! (-> self rat-speed) 1.35) - (set! (-> self spawn-rats) #t) - (when - (>= - (- - (-> *display* base-frame-counter) - (the-as int (-> self wave-start-time)) - ) - 7500 - ) - (+! (-> self current-wave) 1) - (set! - (-> self wave-start-time) - (the-as uint (-> *display* base-frame-counter)) - ) - ) - ) - ) - ) - ) - ((= v1-4 1) - (let ((v1-30 (-> self current-wave))) - (cond - ((zero? v1-30) - (set! (-> self max-rats) 6) - (set! (-> self rat-speed) 1.0) - (set! (-> self spawn-rats) #t) - (set! (-> self passed-last-stage) #f) - (when - (>= - (- - (-> *display* base-frame-counter) - (the-as int (-> self wave-start-time)) - ) - 4500 - ) - (+! (-> self current-wave) 1) - (set! - (-> self wave-start-time) - (the-as uint (-> *display* base-frame-counter)) - ) - ) - ) - ((= v1-30 2) - (set! (-> self max-rats) 7) - (set! (-> self rat-speed) 1.2) - (set! (-> self spawn-rats) #t) - (when - (>= - (- - (-> *display* base-frame-counter) - (the-as int (-> self wave-start-time)) - ) - 6000 - ) - (+! (-> self current-wave) 1) - (set! - (-> self wave-start-time) - (the-as uint (-> *display* base-frame-counter)) - ) - ) - ) - ((= v1-30 4) - (set! (-> self max-rats) 10) - (set! (-> self rat-speed) 1.3) - (set! (-> self spawn-rats) #t) - (when - (>= - (- - (-> *display* base-frame-counter) - (the-as int (-> self wave-start-time)) - ) - 6600 - ) - (+! (-> self current-wave) 1) - (set! - (-> self wave-start-time) - (the-as uint (-> *display* base-frame-counter)) - ) - ) - ) - ) - ) - ) - ((= v1-4 2) - (let ((v1-55 (-> self current-wave))) - (cond - ((zero? v1-55) - (set! (-> self max-rats) 6) - (set! (-> self rat-speed) 1.0) - (set! (-> self spawn-rats) #t) - (set! (-> self passed-last-stage) #f) - (when - (>= - (- - (-> *display* base-frame-counter) - (the-as int (-> self wave-start-time)) - ) - 4500 - ) - (+! (-> self current-wave) 1) - (set! - (-> self wave-start-time) - (the-as uint (-> *display* base-frame-counter)) - ) - ) - ) - ((= v1-55 2) - (set! (-> self max-rats) 7) - (set! (-> self rat-speed) 1.1) - (set! (-> self spawn-rats) #t) - (when - (>= - (- - (-> *display* base-frame-counter) - (the-as int (-> self wave-start-time)) - ) - 5400 - ) - (+! (-> self current-wave) 1) - (set! - (-> self wave-start-time) - (the-as uint (-> *display* base-frame-counter)) - ) - ) - ) - ((= v1-55 4) - (set! (-> self max-rats) 9) - (set! (-> self rat-speed) 1.25) - (set! (-> self spawn-rats) #t) - (when - (>= - (- - (-> *display* base-frame-counter) - (the-as int (-> self wave-start-time)) - ) - 6000 - ) - (+! (-> self current-wave) 1) - (set! - (-> self wave-start-time) - (the-as uint (-> *display* base-frame-counter)) - ) - ) - ) - ) - ) - ) - (else - (let ((v1-80 (-> self current-wave))) - (cond - ((zero? v1-80) - (set! (-> self max-rats) 5) - (set! (-> self rat-speed) 0.9) - (set! (-> self spawn-rats) #t) - (set! (-> self passed-last-stage) #f) - (when - (>= - (- - (-> *display* base-frame-counter) - (the-as int (-> self wave-start-time)) - ) - 4500 - ) - (+! (-> self current-wave) 1) - (set! - (-> self wave-start-time) - (the-as uint (-> *display* base-frame-counter)) - ) - ) - ) - ((= v1-80 2) - (set! (-> self max-rats) 6) - (set! (-> self rat-speed) 1.0) - (set! (-> self spawn-rats) #t) - (when - (>= - (- - (-> *display* base-frame-counter) - (the-as int (-> self wave-start-time)) - ) - 5400 - ) - (+! (-> self current-wave) 1) - (set! - (-> self wave-start-time) - (the-as uint (-> *display* base-frame-counter)) - ) - ) - ) - ((= v1-80 4) - (set! (-> self max-rats) 8) - (set! (-> self rat-speed) 1.1) - (set! (-> self spawn-rats) #t) - (when - (>= - (- - (-> *display* base-frame-counter) - (the-as int (-> self wave-start-time)) - ) - 6000 - ) - (+! (-> self current-wave) 1) - (set! - (-> self wave-start-time) - (the-as uint (-> *display* base-frame-counter)) - ) - ) - ) - ) - ) - ) - ) - ) (none) ) (defbehavior billy-game-update billy () (let ((v1-0 (-> self current-wave))) - (cond - ((or (zero? v1-0) (= v1-0 2) (= v1-0 4)) - (billy-game-update-wave) - ) - ((= v1-0 5) - (set! (-> self spawn-rats) #f) - (set! (-> self passed-last-stage) #t) - ) - ((begin - (set! (-> self spawn-rats) #f) - (zero? (-> self num-rats)) - ) - (when - (>= - (- - (-> *display* base-frame-counter) - (the-as int (-> self wave-start-time)) - ) - 900 + (cond + ((or (zero? v1-0) (= v1-0 2) (= v1-0 4)) + (billy-game-update-wave) ) - (+! (-> self current-wave) 1) - (set! - (-> self wave-start-time) - (the-as uint (-> *display* base-frame-counter)) + ((= v1-0 5) + (set! (-> self spawn-rats) #f) + (set! (-> self passed-last-stage) #t) ) - ) - ) - (else - (set! - (-> self wave-start-time) - (the-as uint (-> *display* base-frame-counter)) - ) - ) - ) - ) - (when (and (< (-> self num-rats) (-> self max-rats)) (-> self spawn-rats)) - (let ((gp-0 (new 'stack-no-clear 'vector)) - (s5-0 (new 'stack-no-clear 'vector)) + ((begin (set! (-> self spawn-rats) #f) (zero? (-> self num-rats))) + (when (>= (- (-> *display* base-frame-counter) (the-as int (-> self wave-start-time))) 900) + (+! (-> self current-wave) 1) + (set! (-> self wave-start-time) (the-as uint (-> *display* base-frame-counter))) ) - (get-random-point (-> self path-starts) gp-0) - (get-random-point (-> self path-waypts) s5-0) - (let ((s4-0 (get-process *default-dead-pool* billy-rat #x4000))) - (if (when s4-0 - (let ((t9-4 (method-of-type billy-rat activate))) - (t9-4 - (the-as billy-rat s4-0) - self - 'billy-rat - (the-as pointer #x70004000) - ) - ) - (run-now-in-process s4-0 billy-rat-init-by-other self gp-0 s5-0) - (-> s4-0 ppointer) - ) - (+! (-> self num-rats) 1) + ) + (else + (set! (-> self wave-start-time) (the-as uint (-> *display* base-frame-counter))) + ) + ) + ) + (when (and (< (-> self num-rats) (-> self max-rats)) (-> self spawn-rats)) + (let ((gp-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (get-random-point (-> self path-starts) gp-0) + (get-random-point (-> self path-waypts) s5-0) + (let ((s4-0 (get-process *default-dead-pool* billy-rat #x4000))) + (if (when s4-0 + (let ((t9-4 (method-of-type billy-rat activate))) + (t9-4 (the-as billy-rat s4-0) self 'billy-rat (the-as pointer #x70004000)) + ) + (run-now-in-process s4-0 billy-rat-init-by-other self gp-0 s5-0) + (-> s4-0 ppointer) + ) + (+! (-> self num-rats) 1) + ) + ) ) - ) ) - ) 0 (none) ) @@ -1449,588 +925,447 @@ (defstate billy-playing (billy) :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (case arg2 - (('billy-rat-die) - (+! (-> self num-rats) -1) - (let* ((v1-4 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-5 (the-as number (logior #x3f800000 v1-4))) - (f0-2 (+ -1.0 (the-as float v1-5))) - (f0-3 (* 3.0 f0-2)) - ) - (cond - ((< 1.0 f0-3) - #f - ) - ((< 0.8333333 f0-3) - (play-ambient (-> self ambient) "SKSP009F" #t (the-as vector #f)) - ) - ((< 0.6666667 f0-3) - (play-ambient (-> self ambient) "BIL-TA02" #t (the-as vector #f)) - ) - ((< 0.5 f0-3) - (play-ambient (-> self ambient) "BIL-TA08" #t (the-as vector #f)) - ) - ((< 0.33333334 f0-3) - (play-ambient (-> self ambient) "BIL-TA09" #t (the-as vector #f)) - ) - ((< 0.16666667 f0-3) - (play-ambient (-> self ambient) "BIL-TA2A" #t (the-as vector #f)) - ) - (else - (play-ambient (-> self ambient) "BIL-TA4B" #t (the-as vector #f)) - ) - ) - ) - ) - (('billy-rat-needs-destination) - (let* ((s5-0 arg0) - (gp-0 - (if (and (nonzero? s5-0) (type-type? (-> s5-0 type) billy-rat)) - (the-as billy-rat s5-0) + (case arg2 + (('billy-rat-die) + (+! (-> self num-rats) -1) + (let* ((v1-4 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-5 (the-as number (logior #x3f800000 v1-4))) + (f0-2 (+ -1.0 (the-as float v1-5))) + (f0-3 (* 3.0 f0-2)) ) - ) + (cond + ((< 1.0 f0-3) + #f ) - (when gp-0 - (let* ((v1-15 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-16 (the-as number (logior #x3f800000 v1-15))) - (f0-6 (+ -1.0 (the-as float v1-16))) - ) - (cond - ((< 0.75 f0-6) - (play-ambient (-> self ambient) "BIL-TA01" #t (the-as vector #f)) - ) - ((< 0.5 f0-6) - (play-ambient (-> self ambient) "BIL-TA03" #t (the-as vector #f)) - ) - ((< 0.25 f0-6) - (play-ambient (-> self ambient) "BIL-TA1A" #t (the-as vector #f)) - ) - (else - (play-ambient (-> self ambient) "BIL-TA3A" #t (the-as vector #f)) - ) - ) - ) - (cond - ((rat-about-to-eat? gp-0 self) - (set! (-> self num-snacks) 0) - (set! (-> self offending-rat) (process->handle gp-0)) - (set! (-> gp-0 dest-type) (the-as uint 3)) - (let ((v0-1 (the-as object (-> gp-0 destination)))) - (set! - (-> (the-as vector v0-1) quad) - (-> (the-as billy-snack (-> gp-0 snack process 0)) root trans quad) - ) - v0-1 - ) - ) - ((or - (= (-> gp-0 dest-type) 2) - (= (-> gp-0 dest-type) 3) - (<= (-> self num-snacks) 0) - ) - (set! (-> gp-0 dest-type) (the-as uint 1)) - (get-random-point (-> self path-starts) (-> gp-0 destination)) - ) - (else - (let ((s3-0 100) - (s4-0 0) - (s2-0 (the-as (pointer process-tree) (-> self child-override))) - (s5-1 (the-as process-tree #f)) - ) - (while s2-0 - (let* ((s1-0 (ppointer->process s2-0)) - (v1-47 - (if - (and - (nonzero? s1-0) - (type-type? (-> s1-0 type) billy-snack) - ) - s1-0 - ) - ) - ) - (cond - ((not v1-47) - ) - ((< (-> (the-as billy-snack v1-47) num-rats) s3-0) - (set! s5-1 v1-47) - (set! s3-0 (-> (the-as billy-snack v1-47) num-rats)) - (set! s4-0 1) - ) - ((= (-> (the-as billy-snack v1-47) num-rats) s3-0) - (+! s4-0 1) - ) - ) + ((< 0.8333333 f0-3) + (play-ambient (-> self ambient) "SKSP009F" #t (the-as vector #f)) ) - (set! s2-0 (-> s2-0 0 brother)) - ) - (cond - ((zero? s4-0) - (set! (-> gp-0 dest-type) (the-as uint 1)) - (get-random-point (-> self path-waypts) (-> gp-0 destination)) + ((< 0.6666667 f0-3) + (play-ambient (-> self ambient) "BIL-TA02" #t (the-as vector #f)) + ) + ((< 0.5 f0-3) + (play-ambient (-> self ambient) "BIL-TA08" #t (the-as vector #f)) + ) + ((< 0.33333334 f0-3) + (play-ambient (-> self ambient) "BIL-TA09" #t (the-as vector #f)) + ) + ((< 0.16666667 f0-3) + (play-ambient (-> self ambient) "BIL-TA2A" #t (the-as vector #f)) ) (else - (set! (-> gp-0 snack) (process->handle (the-as billy-snack s5-1))) - (+! (-> (the-as billy-snack s5-1) num-rats) 1) - (set! (-> gp-0 dest-type) (the-as uint 2)) - (set! - (-> gp-0 destination quad) - (-> (the-as billy-snack s5-1) root trans quad) + (play-ambient (-> self ambient) "BIL-TA4B" #t (the-as vector #f)) + ) + ) + ) + ) + (('billy-rat-needs-destination) + (let* ((s5-0 arg0) + (gp-0 (if (and (nonzero? s5-0) (type-type? (-> s5-0 type) billy-rat)) + (the-as billy-rat s5-0) + ) + ) + ) + (when gp-0 + (let* ((v1-15 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-16 (the-as number (logior #x3f800000 v1-15))) + (f0-6 (+ -1.0 (the-as float v1-16))) + ) + (cond + ((< 0.75 f0-6) + (play-ambient (-> self ambient) "BIL-TA01" #t (the-as vector #f)) + ) + ((< 0.5 f0-6) + (play-ambient (-> self ambient) "BIL-TA03" #t (the-as vector #f)) + ) + ((< 0.25 f0-6) + (play-ambient (-> self ambient) "BIL-TA1A" #t (the-as vector #f)) + ) + (else + (play-ambient (-> self ambient) "BIL-TA3A" #t (the-as vector #f)) + ) + ) + ) + (cond + ((rat-about-to-eat? gp-0 self) + (set! (-> self num-snacks) 0) + (set! (-> self offending-rat) (process->handle gp-0)) + (set! (-> gp-0 dest-type) (the-as uint 3)) + (let ((v0-1 (the-as object (-> gp-0 destination)))) + (set! (-> (the-as vector v0-1) quad) (-> (the-as billy-snack (-> gp-0 snack process 0)) root trans quad)) + v0-1 + ) + ) + ((or (= (-> gp-0 dest-type) 2) (= (-> gp-0 dest-type) 3) (<= (-> self num-snacks) 0)) + (set! (-> gp-0 dest-type) (the-as uint 1)) + (get-random-point (-> self path-starts) (-> gp-0 destination)) + ) + (else + (let ((s3-0 100) + (s4-0 0) + (s2-0 (the-as (pointer process-tree) (-> self child-override))) + (s5-1 (the-as process-tree #f)) + ) + (while s2-0 + (let* ((s1-0 (ppointer->process s2-0)) + (v1-47 (if (and (nonzero? s1-0) (type-type? (-> s1-0 type) billy-snack)) + s1-0 + ) + ) + ) + (cond + ((not v1-47) + ) + ((< (-> (the-as billy-snack v1-47) num-rats) s3-0) + (set! s5-1 v1-47) + (set! s3-0 (-> (the-as billy-snack v1-47) num-rats)) + (set! s4-0 1) + ) + ((= (-> (the-as billy-snack v1-47) num-rats) s3-0) + (+! s4-0 1) + ) + ) + ) + (set! s2-0 (-> s2-0 0 brother)) + ) + (cond + ((zero? s4-0) + (set! (-> gp-0 dest-type) (the-as uint 1)) + (get-random-point (-> self path-waypts) (-> gp-0 destination)) + ) + (else + (set! (-> gp-0 snack) (process->handle (the-as billy-snack s5-1))) + (+! (-> (the-as billy-snack s5-1) num-rats) 1) + (set! (-> gp-0 dest-type) (the-as uint 2)) + (set! (-> gp-0 destination quad) (-> (the-as billy-snack s5-1) root trans quad)) + (let ((f0-8 (+ 6799.36 (-> gp-0 destination x)))) + (set! (-> gp-0 destination x) f0-8) + f0-8 + ) + ) + ) + ) + ) ) - (let ((f0-8 (+ 6799.36 (-> gp-0 destination x)))) - (set! (-> gp-0 destination x) f0-8) - f0-8 - ) - ) ) - ) ) - ) ) ) - ) ) - ) :enter (behavior () - (push-setting! *setting-control* self 'music 'danger 0.0 0) - (ja-channel-set! 0) - (clear-collide-with-as (-> self root-override)) - (init! - (-> self query) - (the-as string #f) - 40 - 150 - 25 - #t - (lookup-text! *common-text* (game-text-id quit) #f) - ) - (set! - (-> self wave-start-time) - (the-as uint (-> *display* base-frame-counter)) - ) - (set! (-> self num-snacks) 0) - (set! (-> self num-rats) 0) - (set! (-> self current-wave) 0) - (set! (-> self offending-rat) (the-as handle #f)) - (let ((gp-1 (new 'stack-no-clear 'vector))) - (dotimes - (s5-1 - (+ (the int (the float (+ (-> self path-snacks curve num-cverts) -1))) 1) - ) - (eval-path-curve-div! (-> self path-snacks) gp-1 (the float s5-1) 'exact) - (let ((s4-1 (get-process *default-dead-pool* billy-snack #x4000))) - (if (when s4-1 - (let ((t9-7 (method-of-type billy-snack activate))) - (t9-7 - (the-as billy-snack s4-1) - self - 'billy-snack - (the-as pointer #x70004000) - ) - ) - (run-now-in-process s4-1 billy-snack-init-by-other gp-1) - (-> s4-1 ppointer) - ) - (+! (-> self num-snacks) 1) - ) - ) - ) - ) - (backup-load-state-and-set-cmds *load-state* '()) - (let* - ((gp-2 - '( - (kill - "swamp-blimp-3" + (push-setting! *setting-control* self 'music 'danger 0.0 0) + (ja-channel-set! 0) + (clear-collide-with-as (-> self root-override)) + (init! (-> self query) (the-as string #f) 40 150 25 #t (lookup-text! *common-text* (game-text-id quit) #f)) + (set! (-> self wave-start-time) (the-as uint (-> *display* base-frame-counter))) + (set! (-> self num-snacks) 0) + (set! (-> self num-rats) 0) + (set! (-> self current-wave) 0) + (set! (-> self offending-rat) (the-as handle #f)) + (let ((gp-1 (new 'stack-no-clear 'vector))) + (dotimes (s5-1 (+ (the int (the float (+ (-> self path-snacks curve num-cverts) -1))) 1)) + (eval-path-curve-div! (-> self path-snacks) gp-1 (the float s5-1) 'exact) + (let ((s4-1 (get-process *default-dead-pool* billy-snack #x4000))) + (if (when s4-1 + (let ((t9-7 (method-of-type billy-snack activate))) + (t9-7 (the-as billy-snack s4-1) self 'billy-snack (the-as pointer #x70004000)) + ) + (run-now-in-process s4-1 billy-snack-init-by-other gp-1) + (-> s4-1 ppointer) + ) + (+! (-> self num-snacks) 1) + ) ) - (kill - "swamp-tetherrock-14" - ) - (kill - "swamp-tetherrock-15" - ) - (kill - "flutflut-3" - ) - (kill - "tar-plat-26" - ) - (kill - "tar-plat-25" - ) - (kill - "babak-380" - ) - (kill - "eco-164" - ) - (kill - "eco-165" - ) - (kill - "eco-140" - ) - (kill - "launcher-97" - ) - (kill - "swamp-rat-nest-5" - ) - (kill - "swamp-rat-nest-4" - ) - (kill - "swamp-rat-nest-3" - ) - (kill - "swamp-rat-nest-2" - ) - (kill - "sharkey-9" - ) - (kill - "launcher-46" - ) - (kill - "launcher-44" - ) - (kill - "launcher-42" - ) - (kill "swamp-spike-43") (kill "swamp-spike-44") (kill "swamp-spike-45") ) ) - (a1-8 (car gp-2)) - ) - (while (not (null? gp-2)) - (execute-command *load-state* (the-as pair a1-8)) - (set! gp-2 (cdr gp-2)) - (set! a1-8 (car gp-2)) - ) + (backup-load-state-and-set-cmds *load-state* '()) + (let* ((gp-2 '((kill "swamp-blimp-3") + (kill "swamp-tetherrock-14") + (kill "swamp-tetherrock-15") + (kill "flutflut-3") + (kill "tar-plat-26") + (kill "tar-plat-25") + (kill "babak-380") + (kill "eco-164") + (kill "eco-165") + (kill "eco-140") + (kill "launcher-97") + (kill "swamp-rat-nest-5") + (kill "swamp-rat-nest-4") + (kill "swamp-rat-nest-3") + (kill "swamp-rat-nest-2") + (kill "sharkey-9") + (kill "launcher-46") + (kill "launcher-44") + (kill "launcher-42") + (kill "swamp-spike-43") + (kill "swamp-spike-44") + (kill "swamp-spike-45") + ) + ) + (a1-8 (car gp-2)) + ) + (while (not (null? gp-2)) + (execute-command *load-state* (the-as pair a1-8)) + (set! gp-2 (cdr gp-2)) + (set! a1-8 (car gp-2)) + ) + ) + (none) ) - (none) - ) :exit (behavior () - (restore-collide-with-as (-> self root-override)) - (restore-load-state-and-cleanup *load-state*) - (set! (-> *ACTOR-bank* birth-max) 1000) - (clear-pending-settings-from-process *setting-control* self 'music) - (none) - ) + (restore-collide-with-as (-> self root-override)) + (restore-load-state-and-cleanup *load-state*) + (set! (-> *ACTOR-bank* birth-max) 1000) + (clear-pending-settings-from-process *setting-control* self 'music) + (none) + ) :trans (behavior () - (spool-push *art-control* "billy-resolution" 0 self -99.0) - (spool-push *art-control* "billy-reject" 0 self -99.0) - (none) - ) + (spool-push *art-control* "billy-resolution" 0 self -99.0) + (spool-push *art-control* "billy-reject" 0 self -99.0) + (none) + ) :code (behavior () - (while #t - (billy-game-update) - (if - (or - (zero? (-> self num-snacks)) - (and (zero? (-> self num-rats)) (-> self passed-last-stage)) - (and - *cheat-mode* - (logtest? (-> *cpad-list* cpads 1 button0-rel 0) (pad-buttons x)) - ) + (while #t + (billy-game-update) + (if (or (zero? (-> self num-snacks)) + (and (zero? (-> self num-rats)) (-> self passed-last-stage)) + (and *cheat-mode* (cpad-pressed? 1 x)) + ) + (go billy-done) + ) + (suspend) ) - (go billy-done) - ) - (suspend) + (none) ) - (none) - ) :post (behavior () - (ja-post) - (none) - ) + (ja-post) + (none) + ) ) (defstate enter-playing (billy) :virtual #t :trans (behavior () - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 1) - (set! (-> a1-0 message) 'change-mode) - (set! (-> a1-0 param 0) (the-as uint 'billy)) - (when (send-event-function *target* a1-0) - (send-event *target* 'trans 'reset) - (let ((v1-8 (entity-actor-lookup (-> self entity) 'alt-actor 0))) - (cond - (v1-8 - (TODO-RENAME-30 (-> *target* control) (-> v1-8 extra trans)) - (go billy-playing) + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) self) + (set! (-> a1-0 num-params) 1) + (set! (-> a1-0 message) 'change-mode) + (set! (-> a1-0 param 0) (the-as uint 'billy)) + (when (send-event-function *target* a1-0) + (send-event *target* 'trans 'reset) + (let ((v1-8 (entity-actor-lookup (-> self entity) 'alt-actor 0))) + (cond + (v1-8 + (move-to-point! (-> *target* control) (-> v1-8 extra trans)) + (go billy-playing) + ) + (else + ) + ) + ) ) - (else - ) - ) ) - ) + (none) ) - (none) - ) ) (defmethod TODO-RENAME-43 billy ((obj billy)) - (when - (TODO-RENAME-10 - (-> obj ambient) - (new 'stack-no-clear 'vector) - 9000 - 122880.0 - obj - ) - (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-4 (the-as number (logior #x3f800000 v1-3))) - (f30-0 (+ -1.0 (the-as float v1-4))) + (when (TODO-RENAME-10 (-> obj ambient) (new 'stack-no-clear 'vector) 9000 122880.0 obj) + (let* ((v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-4 (the-as number (logior #x3f800000 v1-3))) + (f30-0 (+ -1.0 (the-as float v1-4))) + ) + (cond + ((< 0.9411765 f30-0) + (play-ambient (-> obj ambient) "BIL-AM01" #f (-> obj root-override trans)) + ) + ((< 0.88235295 f30-0) + (play-ambient (-> obj ambient) "BIL-AM02" #f (-> obj root-override trans)) + ) + ((< 0.8235294 f30-0) + (play-ambient (-> obj ambient) "BIL-AM03" #f (-> obj root-override trans)) + ) + ((< 0.7647059 f30-0) + (play-ambient (-> obj ambient) "BIL-AM04" #f (-> obj root-override trans)) + ) + ((< 0.7058824 f30-0) + (play-ambient (-> obj ambient) "BIL-AM05" #f (-> obj root-override trans)) + ) + ((< 0.64705884 f30-0) + (play-ambient (-> obj ambient) "BIL-AM06" #f (-> obj root-override trans)) + ) + ((< 0.5882353 f30-0) + (play-ambient (-> obj ambient) "BIL-AM07" #f (-> obj root-override trans)) + ) + ((< 0.5294118 f30-0) + (play-ambient (-> obj ambient) "BIL-AM08" #f (-> obj root-override trans)) + ) + ((< 0.47058824 f30-0) + (play-ambient (-> obj ambient) "BIL-AM1A" #f (-> obj root-override trans)) + ) + ((< 0.4117647 f30-0) + (play-ambient (-> obj ambient) "BIL-AM2A" #f (-> obj root-override trans)) + ) + ((< 0.3529412 f30-0) + (play-ambient (-> obj ambient) "BIL-AM2B" #f (-> obj root-override trans)) + ) + ((= (current-status (-> obj tasks)) (task-status invalid)) + #f + ) + ((< 0.29411766 f30-0) + (play-ambient (-> obj ambient) "BIL-LO01" #f (-> obj root-override trans)) + ) + ((< 0.23529412 f30-0) + (play-ambient (-> obj ambient) "BIL-LO02" #f (-> obj root-override trans)) + ) + ((< 0.1764706 f30-0) + (play-ambient (-> obj ambient) "BIL-LO03" #f (-> obj root-override trans)) + ) + ((< 0.11764706 f30-0) + (play-ambient (-> obj ambient) "BIL-LO1A" #f (-> obj root-override trans)) + ) + ((< 0.05882353 f30-0) + (play-ambient (-> obj ambient) "BIL-LO2A" #f (-> obj root-override trans)) + ) + (else + (play-ambient (-> obj ambient) "BIL-LO2B" #f (-> obj root-override trans)) ) - (cond - ((< 0.9411765 f30-0) - (play-ambient (-> obj ambient) "BIL-AM01" #f (-> obj root-override trans)) + ) ) - ((< 0.88235295 f30-0) - (play-ambient (-> obj ambient) "BIL-AM02" #f (-> obj root-override trans)) - ) - ((< 0.8235294 f30-0) - (play-ambient (-> obj ambient) "BIL-AM03" #f (-> obj root-override trans)) - ) - ((< 0.7647059 f30-0) - (play-ambient (-> obj ambient) "BIL-AM04" #f (-> obj root-override trans)) - ) - ((< 0.7058824 f30-0) - (play-ambient (-> obj ambient) "BIL-AM05" #f (-> obj root-override trans)) - ) - ((< 0.64705884 f30-0) - (play-ambient (-> obj ambient) "BIL-AM06" #f (-> obj root-override trans)) - ) - ((< 0.5882353 f30-0) - (play-ambient (-> obj ambient) "BIL-AM07" #f (-> obj root-override trans)) - ) - ((< 0.5294118 f30-0) - (play-ambient (-> obj ambient) "BIL-AM08" #f (-> obj root-override trans)) - ) - ((< 0.47058824 f30-0) - (play-ambient (-> obj ambient) "BIL-AM1A" #f (-> obj root-override trans)) - ) - ((< 0.4117647 f30-0) - (play-ambient (-> obj ambient) "BIL-AM2A" #f (-> obj root-override trans)) - ) - ((< 0.3529412 f30-0) - (play-ambient (-> obj ambient) "BIL-AM2B" #f (-> obj root-override trans)) - ) - ((= (current-status (-> obj tasks)) (task-status invalid)) - #f - ) - ((< 0.29411766 f30-0) - (play-ambient (-> obj ambient) "BIL-LO01" #f (-> obj root-override trans)) - ) - ((< 0.23529412 f30-0) - (play-ambient (-> obj ambient) "BIL-LO02" #f (-> obj root-override trans)) - ) - ((< 0.1764706 f30-0) - (play-ambient (-> obj ambient) "BIL-LO03" #f (-> obj root-override trans)) - ) - ((< 0.11764706 f30-0) - (play-ambient (-> obj ambient) "BIL-LO1A" #f (-> obj root-override trans)) - ) - ((< 0.05882353 f30-0) - (play-ambient (-> obj ambient) "BIL-LO2A" #f (-> obj root-override trans)) - ) - (else - (play-ambient (-> obj ambient) "BIL-LO2B" #f (-> obj root-override trans)) - ) - ) ) - ) ) (defstate play-anim (billy) :virtual #t :exit (behavior () - (billy-kill-all-but-farthy) - ((-> (method-of-type process-taskable play-anim) exit)) - (none) - ) + (billy-kill-all-but-farthy) + ((-> (method-of-type process-taskable play-anim) exit)) + (none) + ) ) (defstate idle (billy) :virtual #t :code (behavior () - (if (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) + (if (!= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (get-art-elem self) ) - (get-art-elem self) + (ja-channel-push! 1 60) ) - (ja-channel-push! 1 60) - ) - (while #t - (let ((gp-0 (-> self skel root-channel 0))) - (set! (-> gp-0 frame-group) (the-as art-joint-anim (get-art-elem self))) - ) - (let* ((f30-0 5.0) - (v1-9 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-10 (the-as number (logior #x3f800000 v1-9))) - ) - (countdown (gp-1 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-10)))) 5)) - (let ((a0-10 (-> self skel root-channel 0))) - (set! (-> a0-10 frame-group) (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (while #t + (let ((gp-0 (-> self skel root-channel 0))) + (set! (-> gp-0 frame-group) (the-as art-joint-anim (get-art-elem self))) ) - (set! - (-> a0-10 param 0) - (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) - ) - (set! (-> a0-10 param 1) 1.0) - (set! (-> a0-10 frame-num) 0.0) - (joint-control-channel-group! - a0-10 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - num-func-seek! - ) - ) - (until (ja-done? 0) - (TODO-RENAME-43 self) - (suspend) - (let ((a0-12 (-> self skel root-channel 0))) - (set! - (-> a0-12 param 0) - (the float (+ (-> a0-12 frame-group data 0 length) -1)) - ) - (set! (-> a0-12 param 1) 1.0) - (joint-control-channel-group-eval! - a0-12 - (the-as art-joint-anim #f) - num-func-seek! - ) - ) - ) - ) - ) - (when (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) + (let* ((f30-0 5.0) + (v1-9 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-10 (the-as number (logior #x3f800000 v1-9))) + ) + (countdown (gp-1 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-10)))) 5)) + (let ((a0-10 (-> self skel root-channel 0))) + (set! (-> a0-10 frame-group) (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + (set! (-> a0-10 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) + -1 + ) + ) + ) + (set! (-> a0-10 param 1) 1.0) + (set! (-> a0-10 frame-num) 0.0) + (joint-control-channel-group! + a0-10 + (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + num-func-seek! ) - (-> self draw art-group data 3) - ) - (let ((a0-19 (-> self skel root-channel 0))) - (set! - (-> a0-19 frame-group) - (the-as art-joint-anim (-> self draw art-group data 4)) - ) - (set! - (-> a0-19 param 0) - (the - float - (+ - (-> - (the-as art-joint-anim (-> self draw art-group data 4)) - data - 0 - length + ) + (until (ja-done? 0) + (TODO-RENAME-43 self) + (suspend) + (let ((a0-12 (-> self skel root-channel 0))) + (set! (-> a0-12 param 0) (the float (+ (-> a0-12 frame-group data 0 length) -1))) + (set! (-> a0-12 param 1) 1.0) + (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + ) + ) + (when (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 3) + ) + (let ((a0-19 (-> self skel root-channel 0))) + (set! (-> a0-19 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) + (set! (-> a0-19 param 0) + (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) data 0 length) -1)) + ) + (set! (-> a0-19 param 1) 1.0) + (set! (-> a0-19 frame-num) 0.0) + (joint-control-channel-group! a0-19 (the-as art-joint-anim (-> self draw art-group data 4)) num-func-seek!) + ) + (until (ja-done? 0) + (suspend) + (let ((a0-20 (-> self skel root-channel 0))) + (set! (-> a0-20 param 0) (the float (+ (-> a0-20 frame-group data 0 length) -1))) + (set! (-> a0-20 param 1) 1.0) + (joint-control-channel-group-eval! a0-20 (the-as art-joint-anim #f) num-func-seek!) + ) ) - -1 - ) ) - ) - (set! (-> a0-19 param 1) 1.0) - (set! (-> a0-19 frame-num) 0.0) - (joint-control-channel-group! - a0-19 - (the-as art-joint-anim (-> self draw art-group data 4)) - num-func-seek! - ) ) - (until (ja-done? 0) - (suspend) - (let ((a0-20 (-> self skel root-channel 0))) - (set! - (-> a0-20 param 0) - (the float (+ (-> a0-20 frame-group data 0 length) -1)) - ) - (set! (-> a0-20 param 1) 1.0) - (joint-control-channel-group-eval! - a0-20 - (the-as art-joint-anim #f) - num-func-seek! - ) - ) - ) - ) + (none) ) - (none) - ) ) (defmethod target-above-threshold? billy ((obj billy)) (the-as - symbol - (and - *target* - (zero? (logand (-> *target* control root-prim prim-core action) #x4000)) + symbol + (and *target* (zero? (logand (-> *target* control root-prim prim-core action) (collide-action ca-14)))) ) - ) ) (defmethod init-from-entity! billy ((obj billy) (arg0 entity-actor)) (dummy-40 obj arg0 *billy-sg* 3 40 (new 'static 'vector :w 4096.0) 5) (set! (-> obj tasks) (get-task-control (game-task swamp-billy))) (dotimes (s5-0 3) - (let ((v1-3 (new 'process 'curve-control obj 'path (the float s5-0)))) - (set! (-> obj path-data s5-0) v1-3) - (logior! - (-> v1-3 flags) - (path-control-flag display draw-line draw-point draw-text) - ) + (let ((v1-3 (new 'process 'curve-control obj 'path (the float s5-0)))) + (set! (-> obj path-data s5-0) v1-3) + (logior! (-> v1-3 flags) (path-control-flag display draw-line draw-point draw-text)) + ) ) - ) (set! (-> obj path) (-> obj path-snacks)) (let ((s5-1 (get-process *default-dead-pool* manipy #x4000))) - (set! (-> obj farthy) (ppointer->handle (when s5-1 - (let - ((t9-4 - (method-of-type manipy activate) - ) - ) - (t9-4 - (the-as manipy s5-1) - obj - 'manipy - (the-as pointer #x70004000) - ) - ) - (run-now-in-process - s5-1 - manipy-init - (-> obj root-override trans) - (-> obj entity) - *billy-sidekick-sg* - #f - ) - (-> s5-1 ppointer) - ) - ) + (set! (-> obj farthy) + (ppointer->handle + (when s5-1 + (let ((t9-4 (method-of-type manipy activate))) + (t9-4 (the-as manipy s5-1) obj 'manipy (the-as pointer #x70004000)) + ) + (run-now-in-process s5-1 manipy-init (-> obj root-override trans) (-> obj entity) *billy-sidekick-sg* #f) + (-> s5-1 ppointer) + ) + ) + ) ) - ) (send-event (handle->process (-> obj farthy)) 'center-joint 3) (send-event (handle->process (-> obj farthy)) 'anim-mode 'clone-anim) (dummy-42 obj) diff --git a/goal_src/levels/swamp/kermit.gc b/goal_src/levels/swamp/kermit.gc index ee3ba1a664..41eae5f8e6 100644 --- a/goal_src/levels/swamp/kermit.gc +++ b/goal_src/levels/swamp/kermit.gc @@ -703,7 +703,7 @@ ) :post (behavior () - (dummy-47 (-> self root-override)) + (update-transforms! (-> self root-override)) (none) ) ) @@ -1049,17 +1049,29 @@ nav-enemy-default-event-handler (set! (-> self collide-info transv x) (-> self nav travel x)) (set! (-> self collide-info transv y) 0.0) (set! (-> self collide-info transv z) (-> self nav travel z)) - (let ((f0-5 (fmin - (-> self target-speed) - (* (vector-xz-length (-> self collide-info transv)) (-> *display* frames-per-second)) - ) - ) + (let ((f0-5 + (fmin + (-> self target-speed) + (* (vector-xz-length (-> self collide-info transv)) (-> *display* frames-per-second)) + ) + ) ) (vector-xz-normalize! (-> self collide-info transv) f0-5) ) (seek-toward-heading-vec! (-> self collide-info) (-> self rotate-dir) (-> self rotate-speed) 15) - (vector-v++! (-> self collide-info transv) (dummy-62 (-> self collide-info) (new-stack-vector0) 0.0)) - (dummy-59 (-> self collide-info) (-> self collide-info transv) (the-as uint 1) 8192.0 #t #f #f) + (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) + (collide-kind background) + 8192.0 + #t + #f + #f + ) (nav-enemy-common-post) ) (else diff --git a/goal_src/levels/swamp/swamp-obs.gc b/goal_src/levels/swamp/swamp-obs.gc index f4aa50da97..d58f701848 100644 --- a/goal_src/levels/swamp/swamp-obs.gc +++ b/goal_src/levels/swamp/swamp-obs.gc @@ -204,8 +204,8 @@ (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 to) (the-as process 1)) (set! (-> a1-0 from) (the-as process *touching-list*)) - (if (dummy-40 (-> self root-override) a1-0) - (dummy-45 (-> self root-override)) + (if (find-overlapping-shapes (-> self root-override) (the-as overlaps-others-params a1-0)) + (respond-to-collisions! (-> self root-override)) ) ) (none) @@ -604,7 +604,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)) @@ -829,7 +829,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 wall-object)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -986,7 +986,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)) diff --git a/goal_src/levels/swamp/swamp-rat.gc b/goal_src/levels/swamp/swamp-rat.gc index b819a937b3..0ec0861754 100644 --- a/goal_src/levels/swamp/swamp-rat.gc +++ b/goal_src/levels/swamp/swamp-rat.gc @@ -91,12 +91,20 @@ swamp-rat-default-event-handler ) (defmethod TODO-RENAME-38 swamp-rat ((obj swamp-rat)) - (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 + ) (when (< (-> obj collide-info trans y) (-> obj min-height)) (let ((a1-1 (new 'stack-no-clear 'vector))) (set! (-> a1-1 quad) (-> obj collide-info trans quad)) (set! (-> a1-1 y) (-> obj min-height)) - (TODO-RENAME-61 (-> obj collide-info) a1-1 (-> obj collide-info transv) *y-vector*) + (move-to-ground-point! (-> obj collide-info) a1-1 (-> obj collide-info transv) *y-vector*) ) ) 0 @@ -447,7 +455,15 @@ swamp-rat-default-event-handler (while #t (set! f30-0 (seek f30-0 1.5 0.1)) (vector-v++! (-> self collide-info transv) gp-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 + ) (when (or (logtest? (-> self collide-info status) 4) (or (< (-> self collide-info trans y) (-> self min-height)) (>= (- (-> *display* base-frame-counter) (-> self state-time)) 300) diff --git a/goal_src/levels/training/training-obs.gc b/goal_src/levels/training/training-obs.gc index 23f724877e..d5f098ae6a 100644 --- a/goal_src/levels/training/training-obs.gc +++ b/goal_src/levels/training/training-obs.gc @@ -427,7 +427,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 enemy)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -520,7 +520,7 @@ (initialize-skeleton obj *tra-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) ) @@ -849,7 +849,7 @@ hit f30-0 (if a0-24 - (dummy-11 a0-24 (-> self intersection)) + (get-middle-of-bsphere-overlap a0-24 (-> self intersection)) (target-pos 0) ) (the-as symbol (and ((method-of-type touching-shapes-entry prims-touching?) @@ -871,7 +871,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 + ) ) ) ) diff --git a/goal_src/levels/village1/fishermans-boat.gc b/goal_src/levels/village1/fishermans-boat.gc index 58a64d562d..dfccdb88de 100644 --- a/goal_src/levels/village1/fishermans-boat.gc +++ b/goal_src/levels/village1/fishermans-boat.gc @@ -1354,7 +1354,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 1) 0))) (set! (-> s4-0 prim-core collide-as) (collide-kind ground-object)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -1566,8 +1566,8 @@ (vector<-cspace! (the-as vector (-> self old-target-pos)) (-> *target* node-list data 3)) (send-event *target* 'trans 'restore (-> self old-target-pos)) (send-event *target* 'end-mode) - (dummy-47 (-> self root-overlay)) - (dummy-60 (-> *target* control) 4096.0 40960.0 #t (-> *target* control root-prim collide-with)) + (update-transforms! (-> self root-overlay)) + (move-to-ground (-> *target* control) 4096.0 40960.0 #t (-> *target* control root-prim collide-with)) (logior! (-> *target* control status) 7) (suspend) (send-event *camera* 'teleport-to-other-start-string) @@ -1742,8 +1742,8 @@ (vector<-cspace! (the-as vector (-> self old-target-pos)) (-> *target* node-list data 3)) (send-event *target* 'trans 'restore (-> self old-target-pos)) (send-event *target* 'end-mode) - (dummy-47 (-> self root-overlay)) - (dummy-60 (-> *target* control) 4096.0 40960.0 #t (-> *target* control root-prim collide-with)) + (update-transforms! (-> self root-overlay)) + (move-to-ground (-> *target* control) 4096.0 40960.0 #t (-> *target* control root-prim collide-with)) (logior! (-> *target* control status) 7) (suspend) (send-event *camera* 'teleport-to-other-start-string) diff --git a/goal_src/levels/village1/village-obs-VI1.gc b/goal_src/levels/village1/village-obs-VI1.gc index 0f778c9a65..a594505a37 100644 --- a/goal_src/levels/village1/village-obs-VI1.gc +++ b/goal_src/levels/village1/village-obs-VI1.gc @@ -729,7 +729,7 @@ (defstate starfish-idle (starfish) :enter (behavior () - (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 state-time) (-> *display* base-frame-counter)) (ja-channel-set! 0) (none) diff --git a/goal_src/levels/village1/yakow.gc b/goal_src/levels/village1/yakow.gc index db7d04ba73..c877521e86 100644 --- a/goal_src/levels/village1/yakow.gc +++ b/goal_src/levels/village1/yakow.gc @@ -149,39 +149,44 @@ ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 54] (defbehavior yakow-default-event-handler yakow ((arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) - (the-as - object - (cond - ((= v1-0 'touch) - (let* ((s4-0 arg0) - (v1-2 (if (and (nonzero? s4-0) (type-type? (-> s4-0 type) process-drawable)) - s4-0 + (the-as object (cond + ((= v1-0 'touch) + (let* ((s4-0 arg0) + (v1-2 (if (and (nonzero? s4-0) (type-type? (-> s4-0 type) process-drawable)) + s4-0 + ) + ) + ) + (when (and v1-2 (< 8192.0 (- (-> v1-2 root trans y) (-> self root-override trans y)))) + (respond-to-collisions! (-> self root-override)) + (send-shove-back + (-> self root-override) + arg0 + (the-as touching-shapes-entry (-> arg3 param 0)) + 0.7 + 6144.0 + 16384.0 + ) ) + ) ) - ) - (when (and v1-2 (< 8192.0 (- (-> v1-2 root trans y) (-> self root-override trans y)))) - (dummy-45 (-> self root-override)) - (dummy-55 (-> self root-override) arg0 (the-as touching-shapes-entry (-> arg3 param 0)) 0.7 6144.0 16384.0) - ) - ) - ) - ((= v1-0 'attack) - (let ((v1-9 (-> arg3 param 2))) - (cond - ((!= v1-9 (-> self player-attack-id)) - (set! (-> self player-attack-id) (the-as int v1-9)) - (if (-> self vulnerable) - (go yakow-kicked) - ) - ) - (else - 'push - ) - ) - ) - ) - ) - ) + ((= v1-0 'attack) + (let ((v1-9 (-> arg3 param 2))) + (cond + ((!= v1-9 (-> self player-attack-id)) + (set! (-> self player-attack-id) (the-as int v1-9)) + (if (-> self vulnerable) + (go yakow-kicked) + ) + ) + (else + 'push + ) + ) + ) + ) + ) + ) ) ) @@ -237,7 +242,7 @@ yakow-default-event-handler (defbehavior yakow-simple-post yakow () (yakow-common-post) - (dummy-47 (-> self root-override)) + (update-transforms! (-> self root-override)) (none) ) @@ -281,10 +286,21 @@ yakow-default-event-handler (set! (-> self root-override transv x) (-> v1-24 x)) (set! (-> self root-override transv z) (-> v1-24 z)) ) - (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) + ) (let ((gp-2 (new 'stack-no-clear 'vector))) (set! (-> gp-2 quad) (-> self root-override trans quad)) - (dummy-59 (-> self root-override) (-> self root-override transv) (the-as uint 1) 8192.0 #t #f #f) + (integrate-for-enemy-with-move-to-ground! + (-> self root-override) + (-> self root-override transv) + (collide-kind background) + 8192.0 + #t + #f + #f + ) (set! (-> self final-speed) (* (vector-vector-xz-distance gp-2 (-> self root-override trans)) (-> *display* frames-per-second)) ) diff --git a/goal_src/levels/village2/sunken-elevator.gc b/goal_src/levels/village2/sunken-elevator.gc index d69baf7ebf..7a16d71b48 100644 --- a/goal_src/levels/village2/sunken-elevator.gc +++ b/goal_src/levels/village2/sunken-elevator.gc @@ -29,19 +29,19 @@ (defmethod should-teleport? sunken-elevator ((obj sunken-elevator)) (let ((f0-0 (-> (camera-pos) y))) - (case (-> obj path-pos) - ((0.0) - (if (< f0-0 (-> obj teleport-if-below-y)) - (return #t) + (case (-> obj path-pos) + ((0.0) + (if (< f0-0 (-> obj teleport-if-below-y)) + (return #t) + ) + ) + ((1.0) + (if (< (-> obj teleport-if-above-y) f0-0) + (return #t) + ) ) ) - ((1.0) - (if (< (-> obj teleport-if-above-y) f0-0) - (return #t) - ) - ) ) - ) #f ) @@ -49,225 +49,183 @@ :virtual #t :enter (behavior () - (let ((t9-0 (-> (method-of-type plat-button plat-button-pressed) enter))) - (if t9-0 - (t9-0) - ) - ) - (case (-> self path-pos) - ((0.0) - (load-state-want-display-level 'sunken 'display) - (let ((gp-0 (get-process *default-dead-pool* village2cam #x4000))) - (set! (-> (the-as village2cam (-> (when gp-0 - (let - ((t9-3 - (method-of-type - village2cam - activate - ) + (let ((t9-0 (-> (method-of-type plat-button plat-button-pressed) enter))) + (if t9-0 + (t9-0) + ) + ) + (case (-> self path-pos) + ((0.0) + (load-state-want-display-level 'sunken 'display) + (let ((gp-0 (get-process *default-dead-pool* village2cam #x4000))) + (set! (-> (the-as village2cam (-> (when gp-0 + (let ((t9-3 (method-of-type village2cam activate))) + (t9-3 (the-as village2cam gp-0) self 'village2cam (the-as pointer #x70004000)) + ) + (run-now-in-process + gp-0 + pov-camera-init-by-other + (-> self spawn-pos) + *village2cam-sg* + "elevator-at-top-going-down" + 0 + #f + '() + ) + (-> gp-0 ppointer) ) - ) - (t9-3 - (the-as village2cam gp-0) - self - 'village2cam - (the-as pointer #x70004000) - ) - ) - (run-now-in-process - gp-0 - pov-camera-init-by-other - (-> self spawn-pos) - *village2cam-sg* - "elevator-at-top-going-down" 0 - #f - '() ) - (-> gp-0 ppointer) - ) - 0 - ) - ) - seq - ) - (the-as uint 0) - ) + ) + seq + ) + (the-as uint 0) + ) + ) + 0 ) - 0 - ) - ((1.0) - (let* ((gp-1 (get-process *default-dead-pool* village2cam #x4000)) - (v1-10 (when gp-1 - (let ((t9-6 (method-of-type village2cam activate))) - (t9-6 - (the-as village2cam gp-1) - self - 'village2cam - (the-as pointer #x70004000) - ) + ((1.0) + (let* ((gp-1 (get-process *default-dead-pool* village2cam #x4000)) + (v1-10 (when gp-1 + (let ((t9-6 (method-of-type village2cam activate))) + (t9-6 (the-as village2cam gp-1) self 'village2cam (the-as pointer #x70004000)) + ) + (run-now-in-process + gp-1 + pov-camera-init-by-other + (-> self spawn-pos) + *village2cam-sg* + "elevator-at-top-going-down" + 0 + #f + '() + ) + (-> gp-1 ppointer) + ) ) - (run-now-in-process - gp-1 - pov-camera-init-by-other - (-> self spawn-pos) - *village2cam-sg* - "elevator-at-top-going-down" - 0 - #f - '() - ) - (-> gp-1 ppointer) - ) - ) - ) - (set! (-> (the-as village2cam (-> v1-10 0)) seq) (the-as uint 1)) + ) + (set! (-> (the-as village2cam (-> v1-10 0)) seq) (the-as uint 1)) + ) + ) ) - ) + (none) ) - (none) - ) ) (defstate plat-button-move-upward (sunken-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 play-at-top-going-up-camera?) #t) + (none) ) - (set! (-> self play-at-top-going-up-camera?) #t) - (none) - ) :trans (behavior () - (let ((t9-0 (-> (method-of-type plat-button plat-button-move-upward) trans))) - (if t9-0 - (t9-0) - ) - ) - (when - (and (-> self play-at-top-going-up-camera?) (>= 0.14 (-> self path-pos))) - (set! *teleport* #t) - (set! (-> self play-at-top-going-up-camera?) #f) - (load-state-want-display-level 'sunken 'special) - (let* ((gp-0 (get-process *default-dead-pool* village2cam #x4000)) - (v1-8 (when gp-0 - (let ((t9-3 (method-of-type village2cam activate))) - (t9-3 - (the-as village2cam gp-0) - self - 'village2cam - (the-as pointer #x70004000) - ) + (let ((t9-0 (-> (method-of-type plat-button plat-button-move-upward) trans))) + (if t9-0 + (t9-0) + ) + ) + (when (and (-> self play-at-top-going-up-camera?) (>= 0.14 (-> self path-pos))) + (set! *teleport* #t) + (set! (-> self play-at-top-going-up-camera?) #f) + (load-state-want-display-level 'sunken 'special) + (let* ((gp-0 (get-process *default-dead-pool* village2cam #x4000)) + (v1-8 (when gp-0 + (let ((t9-3 (method-of-type village2cam activate))) + (t9-3 (the-as village2cam gp-0) self 'village2cam (the-as pointer #x70004000)) + ) + (run-now-in-process + gp-0 + pov-camera-init-by-other + (-> self spawn-pos) + *village2cam-sg* + "elevator-at-top-going-down" + 0 + #f + '() + ) + (-> gp-0 ppointer) + ) ) - (run-now-in-process - gp-0 - pov-camera-init-by-other - (-> self spawn-pos) - *village2cam-sg* - "elevator-at-top-going-down" - 0 - #f - '() - ) - (-> gp-0 ppointer) - ) - ) - ) - (set! (-> (the-as village2cam (-> v1-8 0)) seq) (the-as uint 2)) - ) + ) + (set! (-> (the-as village2cam (-> v1-8 0)) seq) (the-as uint 2)) + ) + ) + (none) ) - (none) - ) ) (defstate plat-button-move-downward (sunken-elevator) :virtual #t :trans (behavior () - (let ((s5-0 (new 'stack-no-clear 'vector)) - (gp-0 (new 'stack-no-clear 'vector)) - ) - (set! *teleport* #t) - (set! (-> s5-0 quad) (-> self root-override trans quad)) - (let - ((t9-1 - (-> - (the-as (state sunken-elevator) (find-parent-method sunken-elevator 23)) - trans + (let ((s5-0 (new 'stack-no-clear 'vector)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (set! *teleport* #t) + (set! (-> s5-0 quad) (-> self root-override trans quad)) + (let ((t9-1 (-> (the-as (state sunken-elevator) (find-parent-method sunken-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) - ) + (none) ) - (none) - ) ) (defmethod can-target-move? sunken-elevator ((obj sunken-elevator)) (set! (-> obj play-at-top-going-up-camera?) #f) (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) - (let ((f0-1 (-> s5-0 y))) - (set! (-> obj teleport-if-below-y) f0-1) - (the-as symbol f0-1) + (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) + (let ((f0-1 (-> s5-0 y))) + (set! (-> obj teleport-if-below-y) f0-1) + (the-as symbol f0-1) + ) ) - ) ) (defmethod TODO-RENAME-27 sunken-elevator ((obj sunken-elevator)) (ja-channel-set! 1) (cond - ((can-activate? obj) - (let ((s5-0 (-> obj skel root-channel 0))) - (joint-control-channel-group-eval! - s5-0 - (the-as art-joint-anim (-> obj draw art-group data 2)) - num-func-identity - ) - (set! (-> s5-0 frame-num) 0.0) - ) - ) - (else - (let ((s5-1 (-> obj skel root-channel 0))) - (joint-control-channel-group-eval! - s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) - num-func-identity - ) - (set! - (-> s5-1 frame-num) - (the - float - (+ - (-> + ((can-activate? obj) + (let ((s5-0 (-> obj skel root-channel 0))) + (joint-control-channel-group-eval! + s5-0 (the-as art-joint-anim (-> obj draw art-group data 2)) - data - 0 - length + num-func-identity ) - -1 - ) + (set! (-> s5-0 frame-num) 0.0) ) - ) ) + (else + (let ((s5-1 (-> obj skel root-channel 0))) + (joint-control-channel-group-eval! + s5-1 + (the-as art-joint-anim (-> obj draw art-group data 2)) + num-func-identity + ) + (set! (-> s5-1 frame-num) + (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 2)) data 0 length) -1)) + ) + ) + ) ) - ) (ja-post) - (dummy-47 (-> obj root-override)) + (update-transforms! (-> obj root-override)) (none) ) diff --git a/goal_src/levels/village2/swamp-blimp.gc b/goal_src/levels/village2/swamp-blimp.gc index b86e0c2be4..95326bfb46 100644 --- a/goal_src/levels/village2/swamp-blimp.gc +++ b/goal_src/levels/village2/swamp-blimp.gc @@ -995,7 +995,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 wall-object)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -1212,7 +1212,7 @@ (defmethod init-from-entity! precursor-arm ((obj precursor-arm) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) - (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 wall-object)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -1765,7 +1765,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 enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) diff --git a/goal_src/levels/village2/village2-obs.gc b/goal_src/levels/village2/village2-obs.gc index 6bc970562a..d04f0d0569 100644 --- a/goal_src/levels/village2/village2-obs.gc +++ b/goal_src/levels/village2/village2-obs.gc @@ -354,7 +354,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 enemy)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -414,7 +414,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 enemy)) (set! (-> s4-0 collide-with) (collide-kind target)) diff --git a/goal_src/levels/village3/minecart.gc b/goal_src/levels/village3/minecart.gc index 2d5d261721..8c64237a12 100644 --- a/goal_src/levels/village3/minecart.gc +++ b/goal_src/levels/village3/minecart.gc @@ -39,7 +39,7 @@ (the-as object (when (or (= v1-0 'touch) (= v1-0 'attack)) (when (= (-> arg0 type) target) (let ((a2-1 (new 'stack 'collide-overlap-result))) - (if (not (dummy-39 (-> self root-override) (-> *target* control) a2-1)) + (if (not (on-platform (-> self root-override) (-> *target* control) a2-1)) (send-event arg0 'no-look-around 450) ) ) @@ -93,7 +93,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)) diff --git a/goal_src/levels/village_common/villagep-obs.gc b/goal_src/levels/village_common/villagep-obs.gc index 110d2d9b94..547d4e1c41 100644 --- a/goal_src/levels/village_common/villagep-obs.gc +++ b/goal_src/levels/village_common/villagep-obs.gc @@ -42,7 +42,7 @@ (clear-collide-with-as (-> self control)) (ja-channel-set! 0) (vector-reset! (-> self control transv)) - (TODO-RENAME-30 (-> self control) (-> self control unknown-vector102)) + (move-to-point! (-> self control) (-> self control unknown-vector102)) (let ((gp-0 (-> *display* base-frame-counter))) (until (>= (- (-> *display* base-frame-counter) gp-0) 300) (suspend) @@ -507,7 +507,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 1) 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 anim-speed) 2.0) - (dummy-47 (-> obj root-override)) + (update-transforms! (-> obj root-override)) (ja-post) (none) ) diff --git a/goal_src/old/cavegeyserrock.gc b/goal_src/old/cavegeyserrock.gc index 4324a9d74e..a58f4e4910 100644 --- a/goal_src/old/cavegeyserrock.gc +++ b/goal_src/old/cavegeyserrock.gc @@ -996,7 +996,7 @@ This file is only found in early demos. (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) nothing) - (dummy-29 s4-0 1) + (alloc-riders s4-0 1) (let ((s3-0 (new diff --git a/test/decompiler/reference/engine/collide/collide-cache-h_REF.gc b/test/decompiler/reference/engine/collide/collide-cache-h_REF.gc index 71790e7841..ceab15c622 100644 --- a/test/decompiler/reference/engine/collide/collide-cache-h_REF.gc +++ b/test/decompiler/reference/engine/collide/collide-cache-h_REF.gc @@ -180,7 +180,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) diff --git a/test/decompiler/reference/engine/collide/collide-mesh-h_REF.gc b/test/decompiler/reference/engine/collide/collide-mesh-h_REF.gc index 379ef4c7f4..5620047d12 100644 --- a/test/decompiler/reference/engine/collide/collide-mesh-h_REF.gc +++ b/test/decompiler/reference/engine/collide/collide-mesh-h_REF.gc @@ -57,12 +57,12 @@ :flag-assert #x1000000028 (:methods (debug-draw-tris (_type_ process-drawable int) none 9) - (dummy-10 (_type_ object vector) none 10) - (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) + (sphere-on-platform-test (_type_ collide-mesh-cache-tri collide-tri-result vector float) float 12) + (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) ) ) @@ -88,7 +88,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) ) diff --git a/test/decompiler/reference/engine/collide/collide-shape-h_REF.gc b/test/decompiler/reference/engine/collide/collide-shape-h_REF.gc index b5f19fe2a9..c4260551f0 100644 --- a/test/decompiler/reference/engine/collide/collide-shape-h_REF.gc +++ b/test/decompiler/reference/engine/collide/collide-shape-h_REF.gc @@ -67,7 +67,7 @@ ;; definition of type pull-rider-info (deftype pull-rider-info (structure) ((rider collide-sticky-rider :offset-assert 0) - (rider-cshape collide-shape-prim :offset-assert 4) + (rider-cshape collide-shape-moving :offset-assert 4) (rider-delta-ry float :offset-assert 8) (rider-dest vector :inline :offset-assert 16) ) @@ -225,23 +225,23 @@ :flag-assert #x1c00000048 (:methods (new (symbol type collide-shape uint int) _type_ 0) - (dummy-9 (_type_ vector) object 9) - (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) ) @@ -298,10 +298,10 @@ ;; definition of type collide-shape-prim-mesh (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 @@ -337,6 +337,7 @@ ;; definition of type collide-shape-prim-group (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 :offset 80) @@ -347,7 +348,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) ) ) @@ -391,34 +392,34 @@ :flag-assert #x38000000b8 (:methods (new (symbol type process-drawable collide-list-enum) _type_ 0) - (TODO-RENAME-28 (_type_ vector) object 28) - (dummy-29 (_type_ int) none 29) - (TODO-RENAME-30 (_type_ vector) object 30) + (move-by-vector! (_type_ vector) none 28) + (alloc-riders (_type_ int) none 29) + (move-to-point! (_type_ vector) none 30) (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) + (on-platform (_type_ collide-shape collide-overlap-result) symbol 39) + (find-overlapping-shapes (_type_ overlaps-others-params) symbol 40) (dummy-41 (_type_ attack-info float) vector 41) - (dummy-42 (_type_ collide-shape collide-work) none 42) - (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) ) ) @@ -484,14 +485,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) ) ) diff --git a/test/decompiler/reference/engine/collide/collide-target-h_REF.gc b/test/decompiler/reference/engine/collide/collide-target-h_REF.gc index 600c1da963..0c018e5d6f 100644 --- a/test/decompiler/reference/engine/collide/collide-target-h_REF.gc +++ b/test/decompiler/reference/engine/collide/collide-target-h_REF.gc @@ -87,7 +87,7 @@ (unknown-vector51 vector :inline :offset 1200) (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) (unknown-dword11 int64 :offset 1288) diff --git a/test/decompiler/reference/engine/collide/collide-touch-h_REF.gc b/test/decompiler/reference/engine/collide/collide-touch-h_REF.gc index 43fcf06e50..1e46aa6feb 100644 --- a/test/decompiler/reference/engine/collide/collide-touch-h_REF.gc +++ b/test/decompiler/reference/engine/collide/collide-touch-h_REF.gc @@ -34,10 +34,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) ) ) @@ -64,7 +64,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) ) @@ -130,8 +130,8 @@ (dummy-11 () none 11) (prims-touching? (_type_ collide-shape-moving uint) touching-prims-entry 12) (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) ) @@ -160,10 +160,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) ) ) diff --git a/test/decompiler/reference/engine/collide/collide-touch_REF.gc b/test/decompiler/reference/engine/collide/collide-touch_REF.gc index e1b69fcabc..632ad5d9c7 100644 --- a/test/decompiler/reference/engine/collide/collide-touch_REF.gc +++ b/test/decompiler/reference/engine/collide/collide-touch_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 10 of type touching-prims-entry-pool -(defmethod get-size touching-prims-entry-pool ((obj touching-prims-entry-pool)) +(defmethod get-free-node-count touching-prims-entry-pool ((obj touching-prims-entry-pool)) (let ((v0-0 0)) (let ((v1-0 (-> obj head))) (while v1-0 @@ -57,7 +57,7 @@ ) ;; definition for method 15 of type touching-shapes-entry -(defmethod free-entry-list touching-shapes-entry ((obj touching-shapes-entry)) +(defmethod free-touching-prims-list touching-shapes-entry ((obj touching-shapes-entry)) (when (-> obj cshape1) (set! (-> obj cshape1) #f) (let ((gp-0 (-> obj head))) @@ -79,11 +79,11 @@ ;; definition for method 14 of type touching-list ;; INFO: Return type mismatch int vs none. -(defmethod dummy-14 touching-list ((obj touching-list)) - (let ((s5-0 (the-as object (-> obj touching-shapes)))) +(defmethod free-all-prim-nodes touching-list ((obj 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) @@ -95,26 +95,25 @@ ;; definition for method 13 of type touching-list ;; INFO: Return type mismatch object vs touching-shapes-entry. (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))) + (let ((v0-0 (the-as touching-shapes-entry (-> obj touching-shapes)))) + (let ((v1-0 (the-as touching-shapes-entry #f))) (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 + (if (or (and (= t0-0 arg0) (= (-> v0-0 cshape2) arg1)) (and (= t0-0 arg1) (= (-> v0-0 cshape2) arg0))) + (return v0-0) + ) + v1-0 + ) + (else + v0-0 + ) + ) ) ) - (set! v0-0 (&+ (the-as touching-shapes-entry v0-0) 16)) + (&+! v0-0 16) ) (cond (v1-0 @@ -129,10 +128,10 @@ ) ) ) - (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) + (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) ) @@ -268,15 +267,15 @@ ;; definition for method 11 of type touching-list ;; INFO: Return type mismatch int vs none. -(defmethod dummy-11 touching-list ((obj touching-list) (arg0 float)) +(defmethod update-from-step-size touching-list ((obj touching-list) (arg0 float)) (when (nonzero? (-> obj resolve-u)) (set! (-> obj resolve-u) 0) - (let ((s5-0 (the-as object (-> obj touching-shapes)))) + (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))) + (when (nonzero? (-> s5-0 resolve-u)) + (set! (-> s5-0 resolve-u) 0) + (when (-> s5-0 cshape1) + (let ((s3-0 (-> s5-0 head))) (while s3-0 (let ((f0-0 (-> s3-0 u))) (set! s3-0 (cond @@ -292,7 +291,7 @@ (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) + (set! (-> s5-0 head) v1-7) ) (if v1-7 (set! (-> v1-7 prev) a0-1) @@ -314,12 +313,12 @@ ) ) ) - (if (not (-> (the-as touching-shapes-entry s5-0) head)) - (set! (-> (the-as touching-shapes-entry s5-0) cshape1) #f) + (if (not (-> s5-0 head)) + (set! (-> s5-0 cshape1) #f) ) ) ) - (set! s5-0 (&+ (the-as touching-shapes-entry s5-0) 16)) + (&+! s5-0 16) ) ) ) @@ -329,7 +328,7 @@ ;; definition for method 12 of type touching-list ;; INFO: Return type mismatch int vs none. -(defmethod dummy-12 touching-list ((obj touching-list)) +(defmethod send-events-for-touching-shapes touching-list ((obj touching-list)) (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))) @@ -473,12 +472,12 @@ ) ;; definition for method 9 of type touching-prims-entry -(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)) (cond - ((= (-> arg1 next) arg0) + ((= (-> arg1 cshape1) arg0) (return (-> obj prim1 cprim)) ) - ((= (-> arg1 prev) arg0) + ((= (-> arg1 cshape2) arg0) (return (-> obj prim2 cprim)) ) ) @@ -486,17 +485,17 @@ ) ;; definition for method 12 of type touching-prims-entry -(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)) (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)) @@ -509,7 +508,7 @@ ) ;; definition for method 11 of type touching-prims-entry -(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)) (let* ((s4-0 (-> obj prim1 cprim)) (s3-0 (-> obj prim2 cprim)) (gp-1 (vector-! diff --git a/test/decompiler/reference/engine/debug/default-menu_REF.gc b/test/decompiler/reference/engine/debug/default-menu_REF.gc index 9260fc5852..6039628e0e 100644 --- a/test/decompiler/reference/engine/debug/default-menu_REF.gc +++ b/test/decompiler/reference/engine/debug/default-menu_REF.gc @@ -548,6 +548,7 @@ (define *shader-pick-menu* (the-as debug-menu #f)) ;; definition for function build-shader-list +;; INFO: Return type mismatch object vs none. (defun build-shader-list () (debug-menu-remove-all-items *shader-pick-menu*) (when *texture-page-dir* @@ -575,10 +576,8 @@ ) ) ) - (let ((v0-3 (sort (-> *shader-pick-menu* items) debug-menu-node *shader-pick-menu* items) (the-as pair v0-3)) - v0-3 - ) + (set! (-> *shader-pick-menu* items) (the-as pair (sort (-> *shader-pick-menu* items) debug-menu-node 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) ) @@ -996,13 +996,13 @@ ;; definition for function transform-post (defbehavior transform-post process-drawable () (ja-post) - (dummy-47 (the-as collide-shape (-> self root))) + (update-transforms! (the-as collide-shape (-> self root))) 0 ) ;; definition for function rider-trans (defbehavior rider-trans process-drawable () - (dummy-35 (the-as collide-shape (-> self root))) + (detect-riders! (the-as collide-shape (-> self root))) 0 ) @@ -1010,9 +1010,9 @@ (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 ) @@ -1021,8 +1021,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 ) diff --git a/test/decompiler/reference/engine/game/collectables_REF.gc b/test/decompiler/reference/engine/game/collectables_REF.gc index 1d9b1b32e1..c3ae062ed9 100644 --- a/test/decompiler/reference/engine/game/collectables_REF.gc +++ b/test/decompiler/reference/engine/game/collectables_REF.gc @@ -302,7 +302,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) @@ -320,7 +320,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)) ) @@ -509,7 +509,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) @@ -552,7 +552,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) @@ -563,7 +563,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)) @@ -620,9 +620,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 @@ -656,7 +656,7 @@ (set! (-> self trans-hook) #f) ) ) - (dummy-47 (-> self root-override)) + (update-transforms! (-> self root-override)) (none) ) :code @@ -751,7 +751,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) ) @@ -1339,7 +1339,7 @@ ) ) ) - (dummy-47 (-> self root-override)) + (update-transforms! (-> self root-override)) ) ) (ja-post) @@ -1447,7 +1447,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) ) @@ -1473,7 +1473,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) @@ -1496,7 +1496,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) @@ -1674,12 +1674,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*)) @@ -1869,19 +1869,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) + ) ) ) ) @@ -2271,7 +2277,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) ) @@ -2298,7 +2304,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)) @@ -2333,7 +2339,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)) @@ -2342,7 +2348,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)) @@ -2375,7 +2381,7 @@ ) :post (behavior () - (dummy-47 (-> self root-override)) + (update-transforms! (-> self root-override)) (animate self) (none) ) @@ -2650,7 +2656,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)) @@ -2680,7 +2686,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) @@ -3060,7 +3066,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) @@ -3109,7 +3115,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) @@ -3177,7 +3183,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)) diff --git a/test/decompiler/reference/engine/game/crates_REF.gc b/test/decompiler/reference/engine/game/crates_REF.gc index dca6d0813a..9f35eddf33 100644 --- a/test/decompiler/reference/engine/game/crates_REF.gc +++ b/test/decompiler/reference/engine/game/crates_REF.gc @@ -855,7 +855,7 @@ :code (behavior () (suspend) - (dummy-47 (-> self root-override)) + (update-transforms! (-> self root-override)) (logior! (-> self mask) (process-mask sleep)) (while #t (suspend) @@ -1276,7 +1276,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)) @@ -1597,7 +1597,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) diff --git a/test/decompiler/reference/engine/game/generic-obs_REF.gc b/test/decompiler/reference/engine/game/generic-obs_REF.gc index 91af9ae27c..2a130d9910 100644 --- a/test/decompiler/reference/engine/game/generic-obs_REF.gc +++ b/test/decompiler/reference/engine/game/generic-obs_REF.gc @@ -28,7 +28,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)) ) ) @@ -366,7 +366,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))) @@ -493,7 +493,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)) ) @@ -630,7 +630,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) @@ -2166,8 +2166,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)) ) ) ) @@ -2240,8 +2240,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)) ) ) ) @@ -2317,7 +2317,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))) @@ -2383,7 +2383,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))) @@ -2563,11 +2563,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) ) diff --git a/test/decompiler/reference/engine/game/main_REF.gc b/test/decompiler/reference/engine/game/main_REF.gc index 952b752c2e..d52d1aebdc 100644 --- a/test/decompiler/reference/engine/game/main_REF.gc +++ b/test/decompiler/reference/engine/game/main_REF.gc @@ -988,7 +988,7 @@ (init-time-of-day-context *time-of-day-context*) (display-sync disp) (swap-display disp) - (dummy-14 *touching-list*) + (free-all-prim-nodes *touching-list*) (blerc-init) (dma-send (the-as dma-bank #x10008000) diff --git a/test/decompiler/reference/engine/game/powerups_REF.gc b/test/decompiler/reference/engine/game/powerups_REF.gc index 74d243df25..7a989f2339 100644 --- a/test/decompiler/reference/engine/game/powerups_REF.gc +++ b/test/decompiler/reference/engine/game/powerups_REF.gc @@ -818,14 +818,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 diff --git a/test/decompiler/reference/engine/game/projectiles_REF.gc b/test/decompiler/reference/engine/game/projectiles_REF.gc index 0121a5e31d..23e1f26569 100644 --- a/test/decompiler/reference/engine/game/projectiles_REF.gc +++ b/test/decompiler/reference/engine/game/projectiles_REF.gc @@ -128,7 +128,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) @@ -145,7 +145,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)) @@ -824,7 +824,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) @@ -879,7 +879,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)) ) @@ -1062,7 +1065,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)) @@ -1174,7 +1177,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 diff --git a/test/decompiler/reference/engine/game/task/process-taskable_REF.gc b/test/decompiler/reference/engine/game/task/process-taskable_REF.gc index 7b2f16642e..abbdb11ac3 100644 --- a/test/decompiler/reference/engine/game/task/process-taskable_REF.gc +++ b/test/decompiler/reference/engine/game/task/process-taskable_REF.gc @@ -1002,47 +1002,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 diff --git a/test/decompiler/reference/engine/gfx/water/water_REF.gc b/test/decompiler/reference/engine/gfx/water/water_REF.gc index b42e8c4df8..74ce1064b8 100644 --- a/test/decompiler/reference/engine/gfx/water/water_REF.gc +++ b/test/decompiler/reference/engine/gfx/water/water_REF.gc @@ -1080,7 +1080,7 @@ ) (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) ) @@ -1119,7 +1119,7 @@ (set! (-> a1-30 y) f30-3) (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) ) diff --git a/test/decompiler/reference/engine/target/logic-target_REF.gc b/test/decompiler/reference/engine/target/logic-target_REF.gc index 2b8ad5c8a9..ebfce3a775 100644 --- a/test/decompiler/reference/engine/target/logic-target_REF.gc +++ b/test/decompiler/reference/engine/target/logic-target_REF.gc @@ -853,7 +853,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) ) @@ -1030,7 +1030,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)) ) @@ -1116,7 +1116,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*) @@ -1303,7 +1303,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) @@ -1317,7 +1317,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)) @@ -1355,7 +1355,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) @@ -1425,11 +1425,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)) ) @@ -1449,7 +1449,7 @@ ) (set-quaternion! (-> self control) (-> self control dir-targ)) (dummy-17 self) - (dummy-47 (-> self control)) + (update-transforms! (-> self control)) (none) ) @@ -1611,12 +1611,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) ) @@ -1639,9 +1640,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 @@ -1707,9 +1712,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 @@ -1768,9 +1777,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 @@ -1824,7 +1837,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) ) @@ -1861,12 +1874,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) @@ -1889,9 +1903,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 @@ -1936,7 +1954,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) @@ -2050,7 +2068,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)) diff --git a/test/decompiler/reference/engine/target/target-death_REF.gc b/test/decompiler/reference/engine/target/target-death_REF.gc index ec6a801646..ea96148024 100644 --- a/test/decompiler/reference/engine/target/target-death_REF.gc +++ b/test/decompiler/reference/engine/target/target-death_REF.gc @@ -83,7 +83,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 @@ -1028,14 +1028,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) diff --git a/test/decompiler/reference/engine/target/target-h_REF.gc b/test/decompiler/reference/engine/target/target-h_REF.gc index b892a67284..69cfaa1382 100644 --- a/test/decompiler/reference/engine/target/target-h_REF.gc +++ b/test/decompiler/reference/engine/target/target-h_REF.gc @@ -35,7 +35,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 diff --git a/test/decompiler/reference/engine/target/target-util_REF.gc b/test/decompiler/reference/engine/target/target-util_REF.gc index 520ab22667..9fb2f5e2d3 100644 --- a/test/decompiler/reference/engine/target/target-util_REF.gc +++ b/test/decompiler/reference/engine/target/target-util_REF.gc @@ -1110,7 +1110,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) ) @@ -1120,7 +1120,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) ) diff --git a/test/decompiler/reference/engine/target/target2_REF.gc b/test/decompiler/reference/engine/target/target2_REF.gc index 4cc76b5ee6..312b00cc11 100644 --- a/test/decompiler/reference/engine/target/target2_REF.gc +++ b/test/decompiler/reference/engine/target/target2_REF.gc @@ -1727,7 +1727,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))) @@ -1771,7 +1771,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))) @@ -3697,7 +3697,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) @@ -3777,10 +3777,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) @@ -3793,13 +3793,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: : 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))) ) ) diff --git a/test/decompiler/reference/levels/beach/beach-obs_REF.gc b/test/decompiler/reference/levels/beach/beach-obs_REF.gc index ad44023db5..c86fa3c8d6 100644 --- a/test/decompiler/reference/levels/beach/beach-obs_REF.gc +++ b/test/decompiler/reference/levels/beach/beach-obs_REF.gc @@ -96,7 +96,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)) @@ -131,7 +131,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) @@ -363,7 +363,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)) @@ -382,7 +382,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) @@ -941,10 +941,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) ) @@ -956,12 +963,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))) ) @@ -1406,7 +1420,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))) @@ -1470,8 +1484,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))) @@ -1501,7 +1526,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))) diff --git a/test/decompiler/reference/levels/beach/beach-rocks_REF.gc b/test/decompiler/reference/levels/beach/beach-rocks_REF.gc index ce4ef26c6c..cd5dd88b40 100644 --- a/test/decompiler/reference/levels/beach/beach-rocks_REF.gc +++ b/test/decompiler/reference/levels/beach/beach-rocks_REF.gc @@ -519,7 +519,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 diff --git a/test/decompiler/reference/levels/beach/lurkercrab_REF.gc b/test/decompiler/reference/levels/beach/lurkercrab_REF.gc index dbd578ef86..ca093f0214 100644 --- a/test/decompiler/reference/levels/beach/lurkercrab_REF.gc +++ b/test/decompiler/reference/levels/beach/lurkercrab_REF.gc @@ -100,17 +100,25 @@ ;; definition for method 44 of type lurkercrab ;; INFO: Return type mismatch symbol vs object. (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)) ) ) ) @@ -205,7 +213,15 @@ nav-enemy-default-event-handler ;; definition for method 38 of type lurkercrab ;; INFO: Return type mismatch int vs none. (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) ) @@ -289,7 +305,7 @@ nav-enemy-default-event-handler ;; definition for function lurkercrab-invulnerable (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)) @@ -302,7 +318,7 @@ nav-enemy-default-event-handler ;; definition for function lurkercrab-vulnerable (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)) diff --git a/test/decompiler/reference/levels/beach/mayor_REF.gc b/test/decompiler/reference/levels/beach/mayor_REF.gc index 4c1c3a559b..f8d0fe1a50 100644 --- a/test/decompiler/reference/levels/beach/mayor_REF.gc +++ b/test/decompiler/reference/levels/beach/mayor_REF.gc @@ -728,7 +728,7 @@ ((the-as (function none) t9-0)) ) ) - (dummy-45 (-> self root-override)) + (respond-to-collisions! (-> self root-override)) (none) ) ) diff --git a/test/decompiler/reference/levels/beach/pelican_REF.gc b/test/decompiler/reference/levels/beach/pelican_REF.gc index 90a56ab12a..08a24beeac 100644 --- a/test/decompiler/reference/levels/beach/pelican_REF.gc +++ b/test/decompiler/reference/levels/beach/pelican_REF.gc @@ -165,7 +165,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 @@ -646,7 +646,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 + ) ) ) ) @@ -667,7 +674,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 @@ -699,9 +706,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) diff --git a/test/decompiler/reference/levels/beach/seagull_REF.gc b/test/decompiler/reference/levels/beach/seagull_REF.gc index 797ca484b4..031ffaec23 100644 --- a/test/decompiler/reference/levels/beach/seagull_REF.gc +++ b/test/decompiler/reference/levels/beach/seagull_REF.gc @@ -443,8 +443,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! @@ -643,7 +643,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 @@ -708,8 +708,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) @@ -1203,7 +1203,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))) @@ -1258,7 +1262,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))) @@ -1347,7 +1355,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)) diff --git a/test/decompiler/reference/levels/citadel/citadel-obs_REF.gc b/test/decompiler/reference/levels/citadel/citadel-obs_REF.gc index 3274fad076..55dcee11c7 100644 --- a/test/decompiler/reference/levels/citadel/citadel-obs_REF.gc +++ b/test/decompiler/reference/levels/citadel/citadel-obs_REF.gc @@ -210,7 +210,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)) @@ -534,7 +534,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)) @@ -752,7 +752,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) ) @@ -839,7 +839,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) ) @@ -1246,7 +1246,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)) @@ -1886,7 +1886,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)) @@ -1989,7 +1989,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) diff --git a/test/decompiler/reference/levels/citadel/citadel-sages_REF.gc b/test/decompiler/reference/levels/citadel/citadel-sages_REF.gc index 969d89f120..fa90763536 100644 --- a/test/decompiler/reference/levels/citadel/citadel-sages_REF.gc +++ b/test/decompiler/reference/levels/citadel/citadel-sages_REF.gc @@ -184,7 +184,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)) diff --git a/test/decompiler/reference/levels/citadel/citb-drop-plat-CIT_REF.gc b/test/decompiler/reference/levels/citadel/citb-drop-plat-CIT_REF.gc index 9cbea3a0f5..1dcd2e3057 100644 --- a/test/decompiler/reference/levels/citadel/citb-drop-plat-CIT_REF.gc +++ b/test/decompiler/reference/levels/citadel/citb-drop-plat-CIT_REF.gc @@ -108,7 +108,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 @@ -249,7 +249,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)) @@ -291,7 +294,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)) diff --git a/test/decompiler/reference/levels/citadel/citb-plat_REF.gc b/test/decompiler/reference/levels/citadel/citb-plat_REF.gc index 15d86af3f0..929203fb4b 100644 --- a/test/decompiler/reference/levels/citadel/citb-plat_REF.gc +++ b/test/decompiler/reference/levels/citadel/citb-plat_REF.gc @@ -112,7 +112,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)) @@ -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)) @@ -280,7 +280,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)) @@ -415,7 +415,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) @@ -689,7 +689,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)) @@ -838,7 +838,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)) @@ -919,7 +919,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)) @@ -1024,7 +1024,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)) @@ -1412,7 +1412,7 @@ ) ) ) - (TODO-RENAME-28 (-> *target* control) gp-0) + (move-by-vector! (-> *target* control) gp-0) ) (send-event *target* 'reset-height) 0 @@ -1489,7 +1489,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)) diff --git a/test/decompiler/reference/levels/common/basebutton_REF.gc b/test/decompiler/reference/levels/common/basebutton_REF.gc index 39999532e5..fea2778ce2 100644 --- a/test/decompiler/reference/levels/common/basebutton_REF.gc +++ b/test/decompiler/reference/levels/common/basebutton_REF.gc @@ -411,7 +411,7 @@ ) ) (set! (-> obj anim-speed) 2.0) - (dummy-47 (-> obj root-override)) + (update-transforms! (-> obj root-override)) (ja-post) (none) ) @@ -424,7 +424,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)) diff --git a/test/decompiler/reference/levels/common/baseplat_REF.gc b/test/decompiler/reference/levels/common/baseplat_REF.gc index 431f6187bb..4c3200f701 100644 --- a/test/decompiler/reference/levels/common/baseplat_REF.gc +++ b/test/decompiler/reference/levels/common/baseplat_REF.gc @@ -76,7 +76,6 @@ ) ;; definition for function plat-trans -;; INFO: Return type mismatch object vs none. ;; Used lq/sq (defbehavior plat-trans baseplat () (rider-trans) @@ -85,14 +84,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) @@ -219,7 +218,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) @@ -311,7 +310,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))) @@ -346,7 +345,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) ) ) @@ -434,7 +433,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) diff --git a/test/decompiler/reference/levels/common/mistycannon_REF.gc b/test/decompiler/reference/levels/common/mistycannon_REF.gc index 22b5eaa753..a1e94111d2 100644 --- a/test/decompiler/reference/levels/common/mistycannon_REF.gc +++ b/test/decompiler/reference/levels/common/mistycannon_REF.gc @@ -912,7 +912,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)) @@ -967,9 +967,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) @@ -1019,10 +1022,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) @@ -1147,11 +1153,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)) @@ -1175,7 +1181,7 @@ (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)) @@ -2091,7 +2097,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)) @@ -2125,7 +2131,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) ) diff --git a/test/decompiler/reference/levels/common/nav-enemy_REF.gc b/test/decompiler/reference/levels/common/nav-enemy_REF.gc index bd504b697b..043882d8d6 100644 --- a/test/decompiler/reference/levels/common/nav-enemy_REF.gc +++ b/test/decompiler/reference/levels/common/nav-enemy_REF.gc @@ -85,7 +85,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)) @@ -176,7 +176,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 ) @@ -275,7 +275,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) ) @@ -332,7 +332,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) @@ -360,10 +363,10 @@ nav-enemy-default-event-handler ;; INFO: Return type mismatch int vs none. (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) @@ -476,8 +479,15 @@ nav-enemy-default-event-handler ;; INFO: Return type mismatch int vs none. ;; Used lq/sq (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) @@ -487,8 +497,11 @@ nav-enemy-default-event-handler ;; INFO: Return type mismatch int vs none. ;; Used lq/sq (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) @@ -815,7 +828,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) @@ -1969,11 +1988,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) diff --git a/test/decompiler/reference/levels/common/orb-cache_REF.gc b/test/decompiler/reference/levels/common/orb-cache_REF.gc index 2cd141dec9..6efb1fb5b0 100644 --- a/test/decompiler/reference/levels/common/orb-cache_REF.gc +++ b/test/decompiler/reference/levels/common/orb-cache_REF.gc @@ -375,7 +375,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)) @@ -393,7 +393,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) diff --git a/test/decompiler/reference/levels/common/plat-button_REF.gc b/test/decompiler/reference/levels/common/plat-button_REF.gc index d313fb2423..ec39c034a1 100644 --- a/test/decompiler/reference/levels/common/plat-button_REF.gc +++ b/test/decompiler/reference/levels/common/plat-button_REF.gc @@ -180,7 +180,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) @@ -289,7 +289,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) @@ -369,7 +369,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) @@ -431,7 +431,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)) @@ -500,7 +500,7 @@ ) ) (ja-post) - (dummy-47 (-> obj root-override)) + (update-transforms! (-> obj root-override)) (none) ) diff --git a/test/decompiler/reference/levels/common/plat_REF.gc b/test/decompiler/reference/levels/common/plat_REF.gc index 7ef22fdbb8..12e2a26f83 100644 --- a/test/decompiler/reference/levels/common/plat_REF.gc +++ b/test/decompiler/reference/levels/common/plat_REF.gc @@ -170,7 +170,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)) @@ -313,7 +313,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) diff --git a/test/decompiler/reference/levels/common/rigid-body_REF.gc b/test/decompiler/reference/levels/common/rigid-body_REF.gc index 28fff34e32..15fde1dbbd 100644 --- a/test/decompiler/reference/levels/common/rigid-body_REF.gc +++ b/test/decompiler/reference/levels/common/rigid-body_REF.gc @@ -544,7 +544,7 @@ ;; Used lq/sq (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* @@ -773,7 +773,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) @@ -815,7 +815,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)) diff --git a/test/decompiler/reference/levels/common/sharkey_REF.gc b/test/decompiler/reference/levels/common/sharkey_REF.gc index 9dbd533f38..7230f4acb9 100644 --- a/test/decompiler/reference/levels/common/sharkey_REF.gc +++ b/test/decompiler/reference/levels/common/sharkey_REF.gc @@ -529,7 +529,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))) diff --git a/test/decompiler/reference/levels/darkcave/darkcave-obs_REF.gc b/test/decompiler/reference/levels/darkcave/darkcave-obs_REF.gc index a0fbfc1192..98dea78ab3 100644 --- a/test/decompiler/reference/levels/darkcave/darkcave-obs_REF.gc +++ b/test/decompiler/reference/levels/darkcave/darkcave-obs_REF.gc @@ -293,7 +293,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 diff --git a/test/decompiler/reference/levels/finalboss/final-door_REF.gc b/test/decompiler/reference/levels/finalboss/final-door_REF.gc index 14cea15888..3a40a6d54f 100644 --- a/test/decompiler/reference/levels/finalboss/final-door_REF.gc +++ b/test/decompiler/reference/levels/finalboss/final-door_REF.gc @@ -460,7 +460,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) diff --git a/test/decompiler/reference/levels/finalboss/robotboss-misc_REF.gc b/test/decompiler/reference/levels/finalboss/robotboss-misc_REF.gc index 75fb866b16..5dd573317d 100644 --- a/test/decompiler/reference/levels/finalboss/robotboss-misc_REF.gc +++ b/test/decompiler/reference/levels/finalboss/robotboss-misc_REF.gc @@ -485,7 +485,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)) diff --git a/test/decompiler/reference/levels/flut_common/flutflut_REF.gc b/test/decompiler/reference/levels/flut_common/flutflut_REF.gc index 2b2c944541..ea1ff653d8 100644 --- a/test/decompiler/reference/levels/flut_common/flutflut_REF.gc +++ b/test/decompiler/reference/levels/flut_common/flutflut_REF.gc @@ -410,7 +410,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 diff --git a/test/decompiler/reference/levels/flut_common/target-flut_REF.gc b/test/decompiler/reference/levels/flut_common/target-flut_REF.gc index 1f1e54cd5d..a024e2ac63 100644 --- a/test/decompiler/reference/levels/flut_common/target-flut_REF.gc +++ b/test/decompiler/reference/levels/flut_common/target-flut_REF.gc @@ -376,7 +376,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)))) ) @@ -2064,7 +2064,7 @@ (* 286720.0 (-> *display* seconds-per-frame)) ) ) - (dummy-47 (-> arg0 collide-info)) + (update-transforms! (-> arg0 collide-info)) (none) ) ) @@ -2200,14 +2200,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) @@ -2522,7 +2522,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) @@ -2629,7 +2629,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) @@ -2655,7 +2655,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) diff --git a/test/decompiler/reference/levels/jungle/darkvine_REF.gc b/test/decompiler/reference/levels/jungle/darkvine_REF.gc index f54b428612..dc98aec2ba 100644 --- a/test/decompiler/reference/levels/jungle/darkvine_REF.gc +++ b/test/decompiler/reference/levels/jungle/darkvine_REF.gc @@ -164,7 +164,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) @@ -173,7 +173,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)) ) ) ) @@ -184,7 +184,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) ) ) @@ -246,7 +246,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) diff --git a/test/decompiler/reference/levels/jungle/jungle-elevator_REF.gc b/test/decompiler/reference/levels/jungle/jungle-elevator_REF.gc index 51914a9544..f6d3d4e9db 100644 --- a/test/decompiler/reference/levels/jungle/jungle-elevator_REF.gc +++ b/test/decompiler/reference/levels/jungle/jungle-elevator_REF.gc @@ -68,7 +68,7 @@ ) (vector-! gp-0 (-> self root-override trans) s5-0) (when (< (-> self path-pos) 0.9) - (TODO-RENAME-28 (-> *target* control) gp-0) + (move-by-vector! (-> *target* control) gp-0) (send-event *target* 'reset-height) ) ) diff --git a/test/decompiler/reference/levels/jungle/jungle-mirrors_REF.gc b/test/decompiler/reference/levels/jungle/jungle-mirrors_REF.gc index ffe381a8d7..ec512dfb15 100644 --- a/test/decompiler/reference/levels/jungle/jungle-mirrors_REF.gc +++ b/test/decompiler/reference/levels/jungle/jungle-mirrors_REF.gc @@ -954,7 +954,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) ) ) @@ -1295,7 +1295,7 @@ (periscope-draw-beam-impact) (periscope-update-joints) (ja-post) - (dummy-47 (-> self root-override)) + (update-transforms! (-> self root-override)) 0 (none) ) @@ -1510,7 +1510,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) @@ -1596,7 +1596,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?) @@ -1716,7 +1716,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) diff --git a/test/decompiler/reference/levels/jungle/jungle-obs_REF.gc b/test/decompiler/reference/levels/jungle/jungle-obs_REF.gc index dea74b3d47..b595e85bf7 100644 --- a/test/decompiler/reference/levels/jungle/jungle-obs_REF.gc +++ b/test/decompiler/reference/levels/jungle/jungle-obs_REF.gc @@ -124,7 +124,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) ) @@ -293,7 +293,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)) @@ -318,7 +318,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))) @@ -421,7 +421,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)) @@ -463,7 +463,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))) @@ -546,7 +546,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))) @@ -574,7 +574,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)) @@ -592,7 +592,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)) @@ -1020,7 +1020,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) @@ -1045,7 +1045,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?)) @@ -1114,7 +1114,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)) @@ -1276,7 +1276,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 @@ -1337,7 +1337,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* @@ -1439,7 +1439,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* @@ -1508,7 +1508,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) ) diff --git a/test/decompiler/reference/levels/jungle/junglesnake_REF.gc b/test/decompiler/reference/levels/jungle/junglesnake_REF.gc index f30d7a33ea..4da2154743 100644 --- a/test/decompiler/reference/levels/jungle/junglesnake_REF.gc +++ b/test/decompiler/reference/levels/jungle/junglesnake_REF.gc @@ -178,7 +178,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) @@ -707,7 +707,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))) @@ -717,7 +717,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) @@ -784,7 +784,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) diff --git a/test/decompiler/reference/levels/jungleb/aphid_REF.gc b/test/decompiler/reference/levels/jungleb/aphid_REF.gc index 68a99923f5..9153be40fa 100644 --- a/test/decompiler/reference/levels/jungleb/aphid_REF.gc +++ b/test/decompiler/reference/levels/jungleb/aphid_REF.gc @@ -33,14 +33,14 @@ ;; definition for function aphid-invulnerable (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) ) ;; definition for function aphid-vulnerable (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) ) diff --git a/test/decompiler/reference/levels/jungleb/jungleb-obs_REF.gc b/test/decompiler/reference/levels/jungleb/jungleb-obs_REF.gc index 7b412ab265..3ac25c8f27 100644 --- a/test/decompiler/reference/levels/jungleb/jungleb-obs_REF.gc +++ b/test/decompiler/reference/levels/jungleb/jungleb-obs_REF.gc @@ -282,7 +282,7 @@ :code (behavior () (suspend) - (dummy-47 (-> self root-override)) + (update-transforms! (-> self root-override)) (anim-loop) (none) ) @@ -427,7 +427,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)) @@ -444,7 +444,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 @@ -519,7 +519,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) ) diff --git a/test/decompiler/reference/levels/jungleb/plant-boss_REF.gc b/test/decompiler/reference/levels/jungleb/plant-boss_REF.gc index e56dbddab4..49fab44f20 100644 --- a/test/decompiler/reference/levels/jungleb/plant-boss_REF.gc +++ b/test/decompiler/reference/levels/jungleb/plant-boss_REF.gc @@ -510,11 +510,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) @@ -1400,7 +1400,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)) @@ -2464,9 +2464,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) @@ -2476,7 +2476,7 @@ :post (behavior () (plant-boss-post) - (dummy-45 (-> self root-override)) + (respond-to-collisions! (-> self root-override)) (none) ) ) @@ -2517,7 +2517,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) ) ) diff --git a/test/decompiler/reference/levels/jungleb/plat-flip_REF.gc b/test/decompiler/reference/levels/jungleb/plat-flip_REF.gc index 0067250ded..55fe3563e5 100644 --- a/test/decompiler/reference/levels/jungleb/plat-flip_REF.gc +++ b/test/decompiler/reference/levels/jungleb/plat-flip_REF.gc @@ -142,7 +142,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) ) @@ -165,7 +165,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)) @@ -228,7 +228,7 @@ ) ) ) - (dummy-47 (-> obj root-override)) + (update-transforms! (-> obj root-override)) (go plat-flip-idle) (none) ) diff --git a/test/decompiler/reference/levels/maincave/baby-spider_REF.gc b/test/decompiler/reference/levels/maincave/baby-spider_REF.gc index 1642872c1d..8c226da2f0 100644 --- a/test/decompiler/reference/levels/maincave/baby-spider_REF.gc +++ b/test/decompiler/reference/levels/maincave/baby-spider_REF.gc @@ -282,7 +282,15 @@ baby-spider-default-event-handler ;; definition for method 38 of type baby-spider (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) ) diff --git a/test/decompiler/reference/levels/maincave/dark-crystal_REF.gc b/test/decompiler/reference/levels/maincave/dark-crystal_REF.gc index 919cdb1e83..441b726972 100644 --- a/test/decompiler/reference/levels/maincave/dark-crystal_REF.gc +++ b/test/decompiler/reference/levels/maincave/dark-crystal_REF.gc @@ -781,7 +781,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) diff --git a/test/decompiler/reference/levels/maincave/driller-lurker_REF.gc b/test/decompiler/reference/levels/maincave/driller-lurker_REF.gc index 334fd78913..0806cca560 100644 --- a/test/decompiler/reference/levels/maincave/driller-lurker_REF.gc +++ b/test/decompiler/reference/levels/maincave/driller-lurker_REF.gc @@ -300,10 +300,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) @@ -329,7 +327,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) @@ -378,7 +376,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) @@ -581,7 +579,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 ) diff --git a/test/decompiler/reference/levels/maincave/gnawer_REF.gc b/test/decompiler/reference/levels/maincave/gnawer_REF.gc index 0d4b385925..04af2595a0 100644 --- a/test/decompiler/reference/levels/maincave/gnawer_REF.gc +++ b/test/decompiler/reference/levels/maincave/gnawer_REF.gc @@ -1330,7 +1330,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 ) diff --git a/test/decompiler/reference/levels/maincave/maincave-obs_REF.gc b/test/decompiler/reference/levels/maincave/maincave-obs_REF.gc index 9374d230d2..307eae6a95 100644 --- a/test/decompiler/reference/levels/maincave/maincave-obs_REF.gc +++ b/test/decompiler/reference/levels/maincave/maincave-obs_REF.gc @@ -252,7 +252,7 @@ (set! (-> s5-1 frame-num) 0.0) ) (ja-post) - (dummy-47 (-> obj root-override)) + (update-transforms! (-> obj root-override)) (go cavecrusher-idle) (none) ) @@ -465,7 +465,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)) @@ -491,7 +491,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)) ) @@ -815,7 +815,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)))) @@ -932,7 +932,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)) @@ -997,7 +997,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 @@ -1075,7 +1075,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)) @@ -1200,7 +1200,6 @@ ) ;; definition for method 20 of type caveelevator -;; INFO: Return type mismatch object vs none. ;; Used lq/sq (defmethod TODO-RENAME-20 caveelevator ((obj caveelevator)) (let ((v1-1 (-> *display* base-frame-counter))) @@ -1210,7 +1209,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) ) ) ) @@ -1561,7 +1560,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)) diff --git a/test/decompiler/reference/levels/maincave/mother-spider-egg_REF.gc b/test/decompiler/reference/levels/maincave/mother-spider-egg_REF.gc index 2dc0727774..f4aa8dac1b 100644 --- a/test/decompiler/reference/levels/maincave/mother-spider-egg_REF.gc +++ b/test/decompiler/reference/levels/maincave/mother-spider-egg_REF.gc @@ -323,17 +323,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 diff --git a/test/decompiler/reference/levels/misty/balloonlurker_REF.gc b/test/decompiler/reference/levels/misty/balloonlurker_REF.gc index 172b281780..1c5895ce3b 100644 --- a/test/decompiler/reference/levels/misty/balloonlurker_REF.gc +++ b/test/decompiler/reference/levels/misty/balloonlurker_REF.gc @@ -547,7 +547,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) @@ -573,7 +573,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))) @@ -838,7 +838,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 @@ -1067,7 +1067,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) ) @@ -1129,8 +1129,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) ) diff --git a/test/decompiler/reference/levels/misty/bonelurker_REF.gc b/test/decompiler/reference/levels/misty/bonelurker_REF.gc index 3a5b06af2c..dd7051e4c9 100644 --- a/test/decompiler/reference/levels/misty/bonelurker_REF.gc +++ b/test/decompiler/reference/levels/misty/bonelurker_REF.gc @@ -178,9 +178,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) ) diff --git a/test/decompiler/reference/levels/misty/misty-obs_REF.gc b/test/decompiler/reference/levels/misty/misty-obs_REF.gc index 9a52fde9f3..d0e4541030 100644 --- a/test/decompiler/reference/levels/misty/misty-obs_REF.gc +++ b/test/decompiler/reference/levels/misty/misty-obs_REF.gc @@ -1658,7 +1658,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)) @@ -1886,7 +1886,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)) @@ -2181,7 +2181,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)) diff --git a/test/decompiler/reference/levels/misty/misty-teetertotter_REF.gc b/test/decompiler/reference/levels/misty/misty-teetertotter_REF.gc index fe8720d49c..e39fb2fd78 100644 --- a/test/decompiler/reference/levels/misty/misty-teetertotter_REF.gc +++ b/test/decompiler/reference/levels/misty/misty-teetertotter_REF.gc @@ -223,7 +223,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)) diff --git a/test/decompiler/reference/levels/misty/misty-warehouse_REF.gc b/test/decompiler/reference/levels/misty/misty-warehouse_REF.gc index f2e3578e61..76a16d1794 100644 --- a/test/decompiler/reference/levels/misty/misty-warehouse_REF.gc +++ b/test/decompiler/reference/levels/misty/misty-warehouse_REF.gc @@ -186,7 +186,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)) @@ -276,7 +276,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) ) diff --git a/test/decompiler/reference/levels/misty/muse_REF.gc b/test/decompiler/reference/levels/misty/muse_REF.gc index 4dd98118ef..f7b2dbcbda 100644 --- a/test/decompiler/reference/levels/misty/muse_REF.gc +++ b/test/decompiler/reference/levels/misty/muse_REF.gc @@ -498,13 +498,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)) ) ) ) diff --git a/test/decompiler/reference/levels/misty/quicksandlurker_REF.gc b/test/decompiler/reference/levels/misty/quicksandlurker_REF.gc index fe0e3bdb76..ba656623aa 100644 --- a/test/decompiler/reference/levels/misty/quicksandlurker_REF.gc +++ b/test/decompiler/reference/levels/misty/quicksandlurker_REF.gc @@ -425,7 +425,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) @@ -454,7 +454,7 @@ ) :post (behavior () - (dummy-47 (-> self root-override)) + (update-transforms! (-> self root-override)) (none) ) ) diff --git a/test/decompiler/reference/levels/ogre/ogre-obs_REF.gc b/test/decompiler/reference/levels/ogre/ogre-obs_REF.gc index d1c5829f93..ee04e56309 100644 --- a/test/decompiler/reference/levels/ogre/ogre-obs_REF.gc +++ b/test/decompiler/reference/levels/ogre/ogre-obs_REF.gc @@ -744,7 +744,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)) @@ -1370,7 +1370,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)) diff --git a/test/decompiler/reference/levels/racer_common/collide-reaction-racer_REF.gc b/test/decompiler/reference/levels/racer_common/collide-reaction-racer_REF.gc index 25e8b41e1c..64d1ba85d5 100644 --- a/test/decompiler/reference/levels/racer_common/collide-reaction-racer_REF.gc +++ b/test/decompiler/reference/levels/racer_common/collide-reaction-racer_REF.gc @@ -20,7 +20,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)) @@ -47,7 +47,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)) diff --git a/test/decompiler/reference/levels/racer_common/racer-states-FIC-LAV-MIS-OGR-ROL_REF.gc b/test/decompiler/reference/levels/racer_common/racer-states-FIC-LAV-MIS-OGR-ROL_REF.gc index dcb4cf1f97..df8310fcba 100644 --- a/test/decompiler/reference/levels/racer_common/racer-states-FIC-LAV-MIS-OGR-ROL_REF.gc +++ b/test/decompiler/reference/levels/racer_common/racer-states-FIC-LAV-MIS-OGR-ROL_REF.gc @@ -1477,7 +1477,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) @@ -1655,7 +1655,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) @@ -1718,7 +1718,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) diff --git a/test/decompiler/reference/levels/racer_common/target-racer-FIC-LAV-MIS-OGR-ROL_REF.gc b/test/decompiler/reference/levels/racer_common/target-racer-FIC-LAV-MIS-OGR-ROL_REF.gc index 997aca2919..36ea2bb57a 100644 --- a/test/decompiler/reference/levels/racer_common/target-racer-FIC-LAV-MIS-OGR-ROL_REF.gc +++ b/test/decompiler/reference/levels/racer_common/target-racer-FIC-LAV-MIS-OGR-ROL_REF.gc @@ -425,7 +425,11 @@ (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)) + (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)) @@ -1623,7 +1627,7 @@ ((and (< 0.0 (vector-dot (-> self control dynam gravity-normal) - (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control unknown-vector54)) + (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)) diff --git a/test/decompiler/reference/levels/robocave/spider-egg_REF.gc b/test/decompiler/reference/levels/robocave/spider-egg_REF.gc index 2d28dd04b2..fd1a1ba8ec 100644 --- a/test/decompiler/reference/levels/robocave/spider-egg_REF.gc +++ b/test/decompiler/reference/levels/robocave/spider-egg_REF.gc @@ -52,24 +52,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 @@ -340,7 +345,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))) @@ -357,7 +362,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)) diff --git a/test/decompiler/reference/levels/snow/snow-flutflut-obs_REF.gc b/test/decompiler/reference/levels/snow/snow-flutflut-obs_REF.gc index eee85f05ef..ae6386c402 100644 --- a/test/decompiler/reference/levels/snow/snow-flutflut-obs_REF.gc +++ b/test/decompiler/reference/levels/snow/snow-flutflut-obs_REF.gc @@ -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-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)) @@ -1175,7 +1175,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! (-> 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)) @@ -1278,7 +1278,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)) diff --git a/test/decompiler/reference/levels/snow/snow-obs_REF.gc b/test/decompiler/reference/levels/snow/snow-obs_REF.gc index fdbb9bc968..6aae094552 100644 --- a/test/decompiler/reference/levels/snow/snow-obs_REF.gc +++ b/test/decompiler/reference/levels/snow/snow-obs_REF.gc @@ -649,7 +649,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)) @@ -668,7 +668,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 @@ -972,7 +972,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)) @@ -1346,7 +1346,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)) @@ -1955,7 +1955,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) ) ) ) @@ -1999,7 +1999,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)) @@ -2300,7 +2300,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)) @@ -2479,7 +2479,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)) diff --git a/test/decompiler/reference/levels/snow/snow-ram_REF.gc b/test/decompiler/reference/levels/snow/snow-ram_REF.gc index 6654459bf4..9f20f56897 100644 --- a/test/decompiler/reference/levels/snow/snow-ram_REF.gc +++ b/test/decompiler/reference/levels/snow/snow-ram_REF.gc @@ -461,7 +461,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)) @@ -503,7 +503,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)) diff --git a/test/decompiler/reference/levels/snow/target-snowball_REF.gc b/test/decompiler/reference/levels/snow/target-snowball_REF.gc index 004b07a872..e375917475 100644 --- a/test/decompiler/reference/levels/snow/target-snowball_REF.gc +++ b/test/decompiler/reference/levels/snow/target-snowball_REF.gc @@ -116,7 +116,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))) diff --git a/test/decompiler/reference/levels/snow/yeti_REF.gc b/test/decompiler/reference/levels/snow/yeti_REF.gc index 38230cb4c5..32c3faf481 100644 --- a/test/decompiler/reference/levels/snow/yeti_REF.gc +++ b/test/decompiler/reference/levels/snow/yeti_REF.gc @@ -268,7 +268,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) diff --git a/test/decompiler/reference/levels/sunken/bully_REF.gc b/test/decompiler/reference/levels/sunken/bully_REF.gc index ad8d543e00..3f99468e72 100644 --- a/test/decompiler/reference/levels/sunken/bully_REF.gc +++ b/test/decompiler/reference/levels/sunken/bully_REF.gc @@ -448,7 +448,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)) ) ) ) @@ -505,7 +505,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) @@ -721,7 +721,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)) @@ -807,7 +815,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) ) @@ -1138,7 +1154,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))) diff --git a/test/decompiler/reference/levels/sunken/double-lurker_REF.gc b/test/decompiler/reference/levels/sunken/double-lurker_REF.gc index e7e700075a..88d45b3043 100644 --- a/test/decompiler/reference/levels/sunken/double-lurker_REF.gc +++ b/test/decompiler/reference/levels/sunken/double-lurker_REF.gc @@ -288,7 +288,7 @@ #t "" ) - (dummy-47 (-> self collide-info)) + (update-transforms! (-> self collide-info)) (suspend) ) (none) @@ -595,7 +595,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) ) @@ -883,10 +883,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) @@ -1067,10 +1067,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) diff --git a/test/decompiler/reference/levels/sunken/floating-launcher_REF.gc b/test/decompiler/reference/levels/sunken/floating-launcher_REF.gc index 9de4bd78f3..121a3e1dc3 100644 --- a/test/decompiler/reference/levels/sunken/floating-launcher_REF.gc +++ b/test/decompiler/reference/levels/sunken/floating-launcher_REF.gc @@ -85,13 +85,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) ) @@ -121,7 +121,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)) @@ -157,7 +157,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) diff --git a/test/decompiler/reference/levels/sunken/helix-water_REF.gc b/test/decompiler/reference/levels/sunken/helix-water_REF.gc index c296d8747d..8997245cf2 100644 --- a/test/decompiler/reference/levels/sunken/helix-water_REF.gc +++ b/test/decompiler/reference/levels/sunken/helix-water_REF.gc @@ -273,7 +273,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) @@ -403,9 +403,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)) ) ) ) @@ -440,7 +440,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) ) @@ -580,7 +580,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) ) @@ -616,7 +616,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)) @@ -649,7 +649,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) diff --git a/test/decompiler/reference/levels/sunken/orbit-plat_REF.gc b/test/decompiler/reference/levels/sunken/orbit-plat_REF.gc index 5f1aab3df1..2475589559 100644 --- a/test/decompiler/reference/levels/sunken/orbit-plat_REF.gc +++ b/test/decompiler/reference/levels/sunken/orbit-plat_REF.gc @@ -911,7 +911,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)) @@ -938,7 +938,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)) diff --git a/test/decompiler/reference/levels/sunken/puffer_REF.gc b/test/decompiler/reference/levels/sunken/puffer_REF.gc index 49a19fc841..122ec6243e 100644 --- a/test/decompiler/reference/levels/sunken/puffer_REF.gc +++ b/test/decompiler/reference/levels/sunken/puffer_REF.gc @@ -157,7 +157,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)) ) ) ) @@ -175,7 +175,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) @@ -1263,7 +1263,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) ) diff --git a/test/decompiler/reference/levels/sunken/qbert-plat_REF.gc b/test/decompiler/reference/levels/sunken/qbert-plat_REF.gc index f77ff596e9..116791249b 100644 --- a/test/decompiler/reference/levels/sunken/qbert-plat_REF.gc +++ b/test/decompiler/reference/levels/sunken/qbert-plat_REF.gc @@ -384,7 +384,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)) @@ -409,7 +409,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))) diff --git a/test/decompiler/reference/levels/sunken/shover_REF.gc b/test/decompiler/reference/levels/sunken/shover_REF.gc index 06a48dcfa0..8a7e957e6e 100644 --- a/test/decompiler/reference/levels/sunken/shover_REF.gc +++ b/test/decompiler/reference/levels/sunken/shover_REF.gc @@ -156,7 +156,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) diff --git a/test/decompiler/reference/levels/sunken/square-platform_REF.gc b/test/decompiler/reference/levels/sunken/square-platform_REF.gc index 6be0743796..67f99b952d 100644 --- a/test/decompiler/reference/levels/sunken/square-platform_REF.gc +++ b/test/decompiler/reference/levels/sunken/square-platform_REF.gc @@ -547,7 +547,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)) @@ -604,7 +604,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) ) diff --git a/test/decompiler/reference/levels/sunken/steam-cap_REF.gc b/test/decompiler/reference/levels/sunken/steam-cap_REF.gc index 7fdb50bb41..e6f3813e5d 100644 --- a/test/decompiler/reference/levels/sunken/steam-cap_REF.gc +++ b/test/decompiler/reference/levels/sunken/steam-cap_REF.gc @@ -551,7 +551,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) ) ) @@ -750,7 +750,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)) @@ -826,7 +826,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)) @@ -855,7 +855,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) diff --git a/test/decompiler/reference/levels/sunken/sun-exit-chamber_REF.gc b/test/decompiler/reference/levels/sunken/sun-exit-chamber_REF.gc index 759f4e56aa..4a69271ffd 100644 --- a/test/decompiler/reference/levels/sunken/sun-exit-chamber_REF.gc +++ b/test/decompiler/reference/levels/sunken/sun-exit-chamber_REF.gc @@ -662,7 +662,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)) @@ -816,7 +816,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)) ) @@ -1433,7 +1433,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)) @@ -1500,7 +1500,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)) diff --git a/test/decompiler/reference/levels/sunken/sun-iris-door_REF.gc b/test/decompiler/reference/levels/sunken/sun-iris-door_REF.gc index 1f72e125a6..3ba5216038 100644 --- a/test/decompiler/reference/levels/sunken/sun-iris-door_REF.gc +++ b/test/decompiler/reference/levels/sunken/sun-iris-door_REF.gc @@ -130,7 +130,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) ) @@ -178,7 +178,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) ) @@ -303,7 +303,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) ) @@ -351,7 +351,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) ) @@ -423,7 +423,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) diff --git a/test/decompiler/reference/levels/sunken/sunken-obs_REF.gc b/test/decompiler/reference/levels/sunken/sunken-obs_REF.gc index 0f570b0ee0..fef5415854 100644 --- a/test/decompiler/reference/levels/sunken/sunken-obs_REF.gc +++ b/test/decompiler/reference/levels/sunken/sunken-obs_REF.gc @@ -151,7 +151,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)) diff --git a/test/decompiler/reference/levels/sunken/target-tube_REF.gc b/test/decompiler/reference/levels/sunken/target-tube_REF.gc index fc4a1d2c5e..b03df600c2 100644 --- a/test/decompiler/reference/levels/sunken/target-tube_REF.gc +++ b/test/decompiler/reference/levels/sunken/target-tube_REF.gc @@ -415,9 +415,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 diff --git a/test/decompiler/reference/levels/sunken/wall-plat_REF.gc b/test/decompiler/reference/levels/sunken/wall-plat_REF.gc index fd1a3a5db2..8a53ac405c 100644 --- a/test/decompiler/reference/levels/sunken/wall-plat_REF.gc +++ b/test/decompiler/reference/levels/sunken/wall-plat_REF.gc @@ -58,7 +58,7 @@ :code (behavior () (set! (-> self extended-amount) 0.0) - (TODO-RENAME-30 (-> self root-override) (-> self in-trans)) + (move-to-point! (-> self root-override) (-> self in-trans)) (transform-post) (clear-collide-with-as (-> self root-override)) (while #t @@ -96,7 +96,7 @@ (set! (-> self extended-amount) (seek (-> self extended-amount) 1.0 (* 2.5 (-> *display* seconds-per-frame)))) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-lerp! gp-0 (-> self in-trans) (-> self out-trans) (-> self extended-amount)) - (TODO-RENAME-30 (-> self root-override) gp-0) + (move-to-point! (-> self root-override) gp-0) ) (suspend) (if (= (-> self extended-amount) 1.0) @@ -122,7 +122,7 @@ :code (behavior () (set! (-> self extended-amount) 1.0) - (TODO-RENAME-30 (-> self root-override) (-> self out-trans)) + (move-to-point! (-> self root-override) (-> self out-trans)) (transform-post) (while #t (logior! (-> self mask) (process-mask sleep-code)) @@ -158,7 +158,7 @@ (set! (-> self extended-amount) (seek (-> self extended-amount) 0.0 (* 2.5 (-> *display* seconds-per-frame)))) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-lerp! gp-0 (-> self in-trans) (-> self out-trans) (-> self extended-amount)) - (TODO-RENAME-30 (-> self root-override) gp-0) + (move-to-point! (-> self root-override) gp-0) ) (suspend) (if (= (-> self extended-amount) 0.0) @@ -202,7 +202,7 @@ (let ((f30-0 (get-current-phase-with-mirror (-> self sync)))) (let ((s5-0 (new 'stack-no-clear 'vector))) (vector-lerp! s5-0 (-> self in-trans) (-> self out-trans) f30-0) - (TODO-RENAME-30 (-> self root-override) s5-0) + (move-to-point! (-> self root-override) s5-0) ) (cond ((= f30-0 0.0) @@ -242,7 +242,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)) @@ -280,7 +280,7 @@ (set! (-> s5-1 frame-num) 0.0) ) (ja-post) - (dummy-47 (-> obj root-override)) + (update-transforms! (-> obj root-override)) (cond ((-> obj use-sync?) (logclear! (-> obj mask) (process-mask actor-pause)) diff --git a/test/decompiler/reference/levels/sunken/wedge-plats_REF.gc b/test/decompiler/reference/levels/sunken/wedge-plats_REF.gc index 4d980dc235..00a3867c93 100644 --- a/test/decompiler/reference/levels/sunken/wedge-plats_REF.gc +++ b/test/decompiler/reference/levels/sunken/wedge-plats_REF.gc @@ -265,7 +265,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)) @@ -282,7 +282,7 @@ (process-drawable-from-entity! obj arg0) (initialize-skeleton obj *wedge-plat-sg* '()) (logior! (-> obj skel status) 1) - (dummy-47 (-> obj root-override)) + (update-transforms! (-> obj root-override)) (dummy-21 obj) (set! (-> obj master) (the-as wedge-plat-master (entity-actor-lookup arg0 'alt-actor 0))) (set! (-> obj offset) (res-lump-float arg0 'rotoffset)) @@ -482,7 +482,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)) @@ -499,7 +499,7 @@ (process-drawable-from-entity! obj arg0) (initialize-skeleton obj *wedge-plat-sg* '()) (logior! (-> obj skel status) 1) - (dummy-47 (-> obj root-override)) + (update-transforms! (-> obj root-override)) (dummy-21 obj) (set! (-> obj master) (the-as wedge-plat-master (entity-actor-lookup arg0 'alt-actor 0))) (set! (-> obj offset) (res-lump-float arg0 'rotoffset)) diff --git a/test/decompiler/reference/levels/sunken/whirlpool_REF.gc b/test/decompiler/reference/levels/sunken/whirlpool_REF.gc index 6d8c31d001..dad37bf996 100644 --- a/test/decompiler/reference/levels/sunken/whirlpool_REF.gc +++ b/test/decompiler/reference/levels/sunken/whirlpool_REF.gc @@ -341,9 +341,9 @@ (set! (-> s4-1 z) (* (- (-> s4-1 z) (-> gp-0 z)) (-> *display* frames-per-second))) (let ((gp-1 (-> *target* control))) (send-event (-> gp-1 process) 'rotate-y-angle f30-0) - (dummy-32 gp-1 8192.0 (-> gp-1 root-prim collide-with)) + (fill-cache-for-shape! gp-1 8192.0 (-> gp-1 root-prim collide-with)) (let ((s3-0 (-> gp-1 status))) - (dummy-37 gp-1 s4-1) + (integrate-and-collide! gp-1 s4-1) (set! (-> gp-1 status) s3-0) s3-0 ) @@ -455,7 +455,7 @@ (set! (-> s5-1 frame-num) 0.0) ) (ja-post) - (dummy-47 (-> obj root-override)) + (update-transforms! (-> obj root-override)) (go whirlpool-idle) (none) ) diff --git a/test/decompiler/reference/levels/swamp/billy_REF.gc b/test/decompiler/reference/levels/swamp/billy_REF.gc index 0cb6dd230f..9ecb0179e7 100644 --- a/test/decompiler/reference/levels/swamp/billy_REF.gc +++ b/test/decompiler/reference/levels/swamp/billy_REF.gc @@ -1231,7 +1231,7 @@ (let ((v1-8 (entity-actor-lookup (-> self entity) 'alt-actor 0))) (cond (v1-8 - (TODO-RENAME-30 (-> *target* control) (-> v1-8 extra trans)) + (move-to-point! (-> *target* control) (-> v1-8 extra trans)) (go billy-playing) ) (else diff --git a/test/decompiler/reference/levels/swamp/kermit_REF.gc b/test/decompiler/reference/levels/swamp/kermit_REF.gc index 20b5c5de16..051937a6eb 100644 --- a/test/decompiler/reference/levels/swamp/kermit_REF.gc +++ b/test/decompiler/reference/levels/swamp/kermit_REF.gc @@ -749,7 +749,7 @@ ) :post (behavior () - (dummy-47 (-> self root-override)) + (update-transforms! (-> self root-override)) (none) ) ) @@ -1149,17 +1149,29 @@ nav-enemy-default-event-handler (set! (-> self collide-info transv x) (-> self nav travel x)) (set! (-> self collide-info transv y) 0.0) (set! (-> self collide-info transv z) (-> self nav travel z)) - (let ((f0-5 (fmin - (-> self target-speed) - (* (vector-xz-length (-> self collide-info transv)) (-> *display* frames-per-second)) - ) - ) + (let ((f0-5 + (fmin + (-> self target-speed) + (* (vector-xz-length (-> self collide-info transv)) (-> *display* frames-per-second)) + ) + ) ) (vector-xz-normalize! (-> self collide-info transv) f0-5) ) (seek-toward-heading-vec! (-> self collide-info) (-> self rotate-dir) (-> self rotate-speed) 15) - (vector-v++! (-> self collide-info transv) (dummy-62 (-> self collide-info) (new-stack-vector0) 0.0)) - (dummy-59 (-> self collide-info) (-> self collide-info transv) (the-as uint 1) 8192.0 #t #f #f) + (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) + (collide-kind background) + 8192.0 + #t + #f + #f + ) (nav-enemy-common-post) ) (else diff --git a/test/decompiler/reference/levels/swamp/swamp-obs_REF.gc b/test/decompiler/reference/levels/swamp/swamp-obs_REF.gc index f09bd6306f..da103b4807 100644 --- a/test/decompiler/reference/levels/swamp/swamp-obs_REF.gc +++ b/test/decompiler/reference/levels/swamp/swamp-obs_REF.gc @@ -208,8 +208,8 @@ (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 to) (the-as process 1)) (set! (-> a1-0 from) (the-as process *touching-list*)) - (if (dummy-40 (-> self root-override) a1-0) - (dummy-45 (-> self root-override)) + (if (find-overlapping-shapes (-> self root-override) (the-as overlaps-others-params a1-0)) + (respond-to-collisions! (-> self root-override)) ) ) (none) @@ -642,7 +642,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)) @@ -888,7 +888,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 wall-object)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -1064,7 +1064,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)) diff --git a/test/decompiler/reference/levels/swamp/swamp-rat_REF.gc b/test/decompiler/reference/levels/swamp/swamp-rat_REF.gc index 6c9e881054..5c663bd0bd 100644 --- a/test/decompiler/reference/levels/swamp/swamp-rat_REF.gc +++ b/test/decompiler/reference/levels/swamp/swamp-rat_REF.gc @@ -111,12 +111,20 @@ swamp-rat-default-event-handler ;; INFO: Return type mismatch int vs none. ;; Used lq/sq (defmethod TODO-RENAME-38 swamp-rat ((obj swamp-rat)) - (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 + ) (when (< (-> obj collide-info trans y) (-> obj min-height)) (let ((a1-1 (new 'stack-no-clear 'vector))) (set! (-> a1-1 quad) (-> obj collide-info trans quad)) (set! (-> a1-1 y) (-> obj min-height)) - (TODO-RENAME-61 (-> obj collide-info) a1-1 (-> obj collide-info transv) *y-vector*) + (move-to-ground-point! (-> obj collide-info) a1-1 (-> obj collide-info transv) *y-vector*) ) ) 0 @@ -480,7 +488,15 @@ swamp-rat-default-event-handler (while #t (set! f30-0 (seek f30-0 1.5 0.1)) (vector-v++! (-> self collide-info transv) gp-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 + ) (when (or (logtest? (-> self collide-info status) 4) (or (< (-> self collide-info trans y) (-> self min-height)) (>= (- (-> *display* base-frame-counter) (-> self state-time)) 300) diff --git a/test/decompiler/reference/levels/training/training-obs_REF.gc b/test/decompiler/reference/levels/training/training-obs_REF.gc index 69fd52bfa0..c0fa20ea6c 100644 --- a/test/decompiler/reference/levels/training/training-obs_REF.gc +++ b/test/decompiler/reference/levels/training/training-obs_REF.gc @@ -468,7 +468,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 enemy)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -577,7 +577,7 @@ (initialize-skeleton obj *tra-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) ) @@ -941,7 +941,7 @@ hit f30-0 (if a0-24 - (dummy-11 a0-24 (-> self intersection)) + (get-middle-of-bsphere-overlap a0-24 (-> self intersection)) (target-pos 0) ) (the-as symbol (and ((method-of-type touching-shapes-entry prims-touching?) @@ -963,7 +963,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 + ) ) ) ) diff --git a/test/decompiler/reference/levels/village1/fishermans-boat_REF.gc b/test/decompiler/reference/levels/village1/fishermans-boat_REF.gc index f97a719424..04df1be279 100644 --- a/test/decompiler/reference/levels/village1/fishermans-boat_REF.gc +++ b/test/decompiler/reference/levels/village1/fishermans-boat_REF.gc @@ -1491,7 +1491,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 1) 0))) (set! (-> s4-0 prim-core collide-as) (collide-kind ground-object)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -1711,8 +1711,8 @@ (vector<-cspace! (the-as vector (-> self old-target-pos)) (-> *target* node-list data 3)) (send-event *target* 'trans 'restore (-> self old-target-pos)) (send-event *target* 'end-mode) - (dummy-47 (-> self root-overlay)) - (dummy-60 (-> *target* control) 4096.0 40960.0 #t (-> *target* control root-prim collide-with)) + (update-transforms! (-> self root-overlay)) + (move-to-ground (-> *target* control) 4096.0 40960.0 #t (-> *target* control root-prim collide-with)) (logior! (-> *target* control status) 7) (suspend) (send-event *camera* 'teleport-to-other-start-string) @@ -1888,8 +1888,8 @@ (vector<-cspace! (the-as vector (-> self old-target-pos)) (-> *target* node-list data 3)) (send-event *target* 'trans 'restore (-> self old-target-pos)) (send-event *target* 'end-mode) - (dummy-47 (-> self root-overlay)) - (dummy-60 (-> *target* control) 4096.0 40960.0 #t (-> *target* control root-prim collide-with)) + (update-transforms! (-> self root-overlay)) + (move-to-ground (-> *target* control) 4096.0 40960.0 #t (-> *target* control root-prim collide-with)) (logior! (-> *target* control status) 7) (suspend) (send-event *camera* 'teleport-to-other-start-string) diff --git a/test/decompiler/reference/levels/village1/village-obs-VI1_REF.gc b/test/decompiler/reference/levels/village1/village-obs-VI1_REF.gc index bccb22ecdc..5742ab445c 100644 --- a/test/decompiler/reference/levels/village1/village-obs-VI1_REF.gc +++ b/test/decompiler/reference/levels/village1/village-obs-VI1_REF.gc @@ -816,7 +816,7 @@ (defstate starfish-idle (starfish) :enter (behavior () - (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 state-time) (-> *display* base-frame-counter)) (ja-channel-set! 0) (none) diff --git a/test/decompiler/reference/levels/village1/yakow_REF.gc b/test/decompiler/reference/levels/village1/yakow_REF.gc index 9b9c03ba23..b470f3a089 100644 --- a/test/decompiler/reference/levels/village1/yakow_REF.gc +++ b/test/decompiler/reference/levels/village1/yakow_REF.gc @@ -204,39 +204,44 @@ ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 54] (defbehavior yakow-default-event-handler yakow ((arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (let ((v1-0 arg2)) - (the-as - object - (cond - ((= v1-0 'touch) - (let* ((s4-0 arg0) - (v1-2 (if (and (nonzero? s4-0) (type-type? (-> s4-0 type) process-drawable)) - s4-0 + (the-as object (cond + ((= v1-0 'touch) + (let* ((s4-0 arg0) + (v1-2 (if (and (nonzero? s4-0) (type-type? (-> s4-0 type) process-drawable)) + s4-0 + ) + ) + ) + (when (and v1-2 (< 8192.0 (- (-> v1-2 root trans y) (-> self root-override trans y)))) + (respond-to-collisions! (-> self root-override)) + (send-shove-back + (-> self root-override) + arg0 + (the-as touching-shapes-entry (-> arg3 param 0)) + 0.7 + 6144.0 + 16384.0 + ) ) + ) ) - ) - (when (and v1-2 (< 8192.0 (- (-> v1-2 root trans y) (-> self root-override trans y)))) - (dummy-45 (-> self root-override)) - (dummy-55 (-> self root-override) arg0 (the-as touching-shapes-entry (-> arg3 param 0)) 0.7 6144.0 16384.0) - ) - ) - ) - ((= v1-0 'attack) - (let ((v1-9 (-> arg3 param 2))) - (cond - ((!= v1-9 (-> self player-attack-id)) - (set! (-> self player-attack-id) (the-as int v1-9)) - (if (-> self vulnerable) - (go yakow-kicked) - ) - ) - (else - 'push - ) - ) - ) - ) - ) - ) + ((= v1-0 'attack) + (let ((v1-9 (-> arg3 param 2))) + (cond + ((!= v1-9 (-> self player-attack-id)) + (set! (-> self player-attack-id) (the-as int v1-9)) + (if (-> self vulnerable) + (go yakow-kicked) + ) + ) + (else + 'push + ) + ) + ) + ) + ) + ) ) ) @@ -297,7 +302,7 @@ yakow-default-event-handler ;; INFO: Return type mismatch symbol vs none. (defbehavior yakow-simple-post yakow () (yakow-common-post) - (dummy-47 (-> self root-override)) + (update-transforms! (-> self root-override)) (none) ) @@ -343,10 +348,21 @@ yakow-default-event-handler (set! (-> self root-override transv x) (-> v1-24 x)) (set! (-> self root-override transv z) (-> v1-24 z)) ) - (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) + ) (let ((gp-2 (new 'stack-no-clear 'vector))) (set! (-> gp-2 quad) (-> self root-override trans quad)) - (dummy-59 (-> self root-override) (-> self root-override transv) (the-as uint 1) 8192.0 #t #f #f) + (integrate-for-enemy-with-move-to-ground! + (-> self root-override) + (-> self root-override transv) + (collide-kind background) + 8192.0 + #t + #f + #f + ) (set! (-> self final-speed) (* (vector-vector-xz-distance gp-2 (-> self root-override trans)) (-> *display* frames-per-second)) ) diff --git a/test/decompiler/reference/levels/village2/sunken-elevator_REF.gc b/test/decompiler/reference/levels/village2/sunken-elevator_REF.gc index a25433c253..ec6a03087b 100644 --- a/test/decompiler/reference/levels/village2/sunken-elevator_REF.gc +++ b/test/decompiler/reference/levels/village2/sunken-elevator_REF.gc @@ -187,7 +187,7 @@ ) (vector-! gp-0 (-> self root-override trans) s5-0) (when (< (-> self path-pos) 0.9) - (TODO-RENAME-28 (-> *target* control) gp-0) + (move-by-vector! (-> *target* control) gp-0) (send-event *target* 'reset-height) ) ) @@ -239,7 +239,7 @@ ) ) (ja-post) - (dummy-47 (-> obj root-override)) + (update-transforms! (-> obj root-override)) (none) ) diff --git a/test/decompiler/reference/levels/village2/swamp-blimp_REF.gc b/test/decompiler/reference/levels/village2/swamp-blimp_REF.gc index d1f9e9745f..bcba633134 100644 --- a/test/decompiler/reference/levels/village2/swamp-blimp_REF.gc +++ b/test/decompiler/reference/levels/village2/swamp-blimp_REF.gc @@ -1162,7 +1162,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 wall-object)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -1385,7 +1385,7 @@ ;; INFO: Return type mismatch object vs none. (defmethod init-from-entity! precursor-arm ((obj precursor-arm) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) - (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 wall-object)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -1962,7 +1962,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 enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) diff --git a/test/decompiler/reference/levels/village2/village2-obs_REF.gc b/test/decompiler/reference/levels/village2/village2-obs_REF.gc index 9f74aef66d..96a700aa97 100644 --- a/test/decompiler/reference/levels/village2/village2-obs_REF.gc +++ b/test/decompiler/reference/levels/village2/village2-obs_REF.gc @@ -382,7 +382,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 enemy)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -447,7 +447,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 enemy)) (set! (-> s4-0 collide-with) (collide-kind target)) diff --git a/test/decompiler/reference/levels/village3/minecart_REF.gc b/test/decompiler/reference/levels/village3/minecart_REF.gc index af02cd4d93..fef7024172 100644 --- a/test/decompiler/reference/levels/village3/minecart_REF.gc +++ b/test/decompiler/reference/levels/village3/minecart_REF.gc @@ -46,7 +46,7 @@ (the-as object (when (or (= v1-0 'touch) (= v1-0 'attack)) (when (= (-> arg0 type) target) (let ((a2-1 (new 'stack 'collide-overlap-result))) - (if (not (dummy-39 (-> self root-override) (-> *target* control) a2-1)) + (if (not (on-platform (-> self root-override) (-> *target* control) a2-1)) (send-event arg0 'no-look-around 450) ) ) @@ -101,7 +101,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)) diff --git a/test/decompiler/reference/levels/village_common/villagep-obs_REF.gc b/test/decompiler/reference/levels/village_common/villagep-obs_REF.gc index 3bdafeedd5..3823fa8aa1 100644 --- a/test/decompiler/reference/levels/village_common/villagep-obs_REF.gc +++ b/test/decompiler/reference/levels/village_common/villagep-obs_REF.gc @@ -68,7 +68,7 @@ (clear-collide-with-as (-> self control)) (ja-channel-set! 0) (vector-reset! (-> self control transv)) - (TODO-RENAME-30 (-> self control) (-> self control unknown-vector102)) + (move-to-point! (-> self control) (-> self control unknown-vector102)) (let ((gp-0 (-> *display* base-frame-counter))) (until (>= (- (-> *display* base-frame-counter) gp-0) 300) (suspend) @@ -553,7 +553,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 1) 0))) (set! (-> s4-0 prim-core collide-as) (collide-kind ground-object)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -660,7 +660,7 @@ ) ) (set! (-> obj anim-speed) 2.0) - (dummy-47 (-> obj root-override)) + (update-transforms! (-> obj root-override)) (ja-post) (none) )