mirror of
https://github.com/open-goal/jak-project.git
synced 2024-11-27 00:10:31 +00:00
d/jak2: "finish" traffic-manager
, vehicle-util
and citizen-h
(#2144)
Some more progress on vehicle code, the following files still remain: - vehicle-guard (annoying stack types) - traffic-engine (many issues, some which already have issues made for them, other entirely new confusing things!)
This commit is contained in:
parent
3d08d079c9
commit
50c57e23be
@ -9017,6 +9017,12 @@
|
||||
:flag-assert #x900000068
|
||||
)
|
||||
|
||||
(deftype mystery-traffic-object-spawn-params (structure)
|
||||
"TODO - what is this!"
|
||||
((params traffic-object-spawn-params :inline :offset-assert 0)
|
||||
(vector vector 3 :inline :offset-assert 112)
|
||||
))
|
||||
|
||||
(define-extern *traffic-manager* process)
|
||||
(define-extern *ctywide-entity* object)
|
||||
(define-extern *lwide-entity* object)
|
||||
@ -31910,7 +31916,7 @@
|
||||
(max-command int32 :offset-assert 140)
|
||||
(selected-index int32 :offset-assert 144)
|
||||
(selected-dist float :offset-assert 148)
|
||||
(selected-node-edge? basic :offset-assert 152)
|
||||
(selected-node-edge? symbol :offset-assert 152)
|
||||
(closest-node int32 :offset-assert 156)
|
||||
(dist-closest-node float :offset-assert 160)
|
||||
(closest-edge int32 :offset-assert 164)
|
||||
@ -32999,7 +33005,6 @@
|
||||
(blocked-start-time time-frame :offset-assert 584)
|
||||
(restore-nav-radius-time time-frame :offset-assert 592)
|
||||
(nav-radius-backup float :offset-assert 600)
|
||||
(circle-radial-dist float :offset 244)
|
||||
)
|
||||
:method-count-assert 178
|
||||
:size-assert #x25c
|
||||
@ -33340,7 +33345,7 @@
|
||||
(rigid-body-object-method-41 (_type_) none 41)
|
||||
(rigid-body-object-method-42 (_type_) none :behavior rigid-body-object 42)
|
||||
(rigid-body-object-method-43 (_type_) none 43)
|
||||
(apply-damage (_type_ float matrix) none 44)
|
||||
(apply-damage (_type_ float rigid-body-impact) none 44)
|
||||
(rigid-body-object-method-45 (_type_ rigid-body-impact) none 45)
|
||||
(rigid-body-object-method-46 (_type_ process-drawable int symbol event-message-block) none :behavior rigid-body-object 46)
|
||||
(rigid-body-object-method-47 (_type_ process-drawable attack-info touching-shapes-entry penetrate) symbol 47)
|
||||
@ -48713,14 +48718,16 @@
|
||||
:size-assert #x40
|
||||
:flag-assert #xe00000040
|
||||
(:methods
|
||||
(grid-info-method-9 (_type_) none 9)
|
||||
(grid-info-method-9 (_type_ (pointer bounding-box) int int) none 9)
|
||||
(grid-info-method-10 (_type_ vis-grid-pos vector) none 10)
|
||||
(grid-info-method-11 (_type_) none 11)
|
||||
(grid-info-method-11 (_type_ vis-grid-box vector) none 11)
|
||||
(grid-info-method-12 (_type_ rgba) none 12)
|
||||
(grid-info-method-13 (_type_ vis-grid-pos rgba) none 13) ;; vis-grid-pos is a total guess
|
||||
)
|
||||
)
|
||||
|
||||
(declare-type traffic-engine basic)
|
||||
(declare-type traffic-find-segment-struct structure)
|
||||
(deftype city-level-info (structure)
|
||||
((grid-info grid-info :inline :offset-assert 0)
|
||||
(cell-array (inline-array vis-cell) :offset-assert 64)
|
||||
@ -48735,15 +48742,15 @@
|
||||
:size-assert #x8c
|
||||
:flag-assert #x130000008c
|
||||
(:methods
|
||||
(city-level-info-method-9 (_type_) none 9)
|
||||
(city-level-info-method-9 (_type_) symbol 9)
|
||||
(city-level-info-method-10 (_type_ vis-ray vector vector) none 10)
|
||||
(city-level-info-method-11 (_type_) none 11)
|
||||
(city-level-info-method-12 (_type_) none 12)
|
||||
(city-level-info-method-11 (_type_ vis-ray) none 11)
|
||||
(city-level-info-method-12 (_type_ vector nav-branch vector) vector 12)
|
||||
(city-level-info-method-13 (_type_ vector) none 13)
|
||||
(city-level-info-method-14 (_type_) none 14)
|
||||
(city-level-info-method-15 (_type_) none 15)
|
||||
(city-level-info-method-16 (_type_) none 16)
|
||||
(city-level-info-method-17 (_type_) none 17)
|
||||
(city-level-info-method-14 (_type_ vis-grid-box) vis-cell 14)
|
||||
(city-level-info-method-15 (_type_ int int) symbol 15)
|
||||
(city-level-info-method-16 (_type_ vector int traffic-find-segment-struct (function traffic-find-segment-struct object none)) none 16)
|
||||
(city-level-info-method-17 (_type_ traffic-engine) none 17)
|
||||
(city-level-info-method-18 (_type_) none 18)
|
||||
)
|
||||
)
|
||||
@ -48764,7 +48771,7 @@
|
||||
(traffic-level-data-method-10 (_type_ vis-cell) none 10)
|
||||
(traffic-level-data-method-11 (_type_ int) none 11)
|
||||
(traffic-level-data-method-12 (_type_ vis-cell) none 12)
|
||||
(traffic-level-data-method-13 (_type_) none 13)
|
||||
(traffic-level-data-method-13 (_type_) vis-cell 13)
|
||||
(traffic-level-data-method-14 (_type_) none 14)
|
||||
)
|
||||
)
|
||||
@ -48916,7 +48923,7 @@
|
||||
(:methods
|
||||
(traffic-suppressor-method-9 (_type_) none 9)
|
||||
(traffic-suppressor-method-10 (_type_ traffic-suppression-params) none 10)
|
||||
(traffic-suppressor-method-11 (_type_ traffic-suppression-params) none 11)
|
||||
(traffic-suppressor-method-11 (_type_ int) none 11)
|
||||
(traffic-suppressor-method-12 (_type_ traffic-suppression-params) none 12)
|
||||
(traffic-suppressor-method-13 (_type_) none 13)
|
||||
)
|
||||
@ -48950,7 +48957,7 @@
|
||||
(traffic-tracker-method-19 (_type_ handle) none 19)
|
||||
(traffic-tracker-method-20 (_type_ int symbol) none 20)
|
||||
(traffic-tracker-method-21 (_type_ traffic-object-spawn-params) none 21)
|
||||
(traffic-tracker-method-22 (_type_ object nav-segment int) none 22)
|
||||
(traffic-tracker-method-22 (_type_ int nav-segment float) none 22)
|
||||
(traffic-tracker-method-23 (_type_ traffic-object-spawn-params) none 23)
|
||||
(traffic-tracker-method-24 (_type_ uint traffic-engine) none 24)
|
||||
(traffic-tracker-method-25 (_type_ (function process-focusable traffic-object-type-info none)) none 25)
|
||||
@ -48973,7 +48980,7 @@
|
||||
(level-data-array traffic-level-data 2 :inline :offset-assert 1040)
|
||||
(object-type-info-array traffic-object-type-info 21 :inline :offset-assert 5200)
|
||||
(tracker-array traffic-tracker 2 :inline :offset-assert 5872)
|
||||
(inactive-object-array uint64 420 :offset-assert 8176)
|
||||
(inactive-object-array handle 420 :offset-assert 8176)
|
||||
(suppressor traffic-suppressor :inline :offset-assert 11536)
|
||||
(danger-sphere-count int8 :offset-assert 12096)
|
||||
(pad int8 15 :offset-assert 12097)
|
||||
@ -48991,8 +48998,8 @@
|
||||
(traffic-engine-method-12 (_type_) none 12)
|
||||
(add-object (_type_ int process) none 13)
|
||||
(traffic-engine-method-14 (_type_ object object) symbol 14)
|
||||
(traffic-engine-method-15 (_type_ object int) none 15)
|
||||
(traffic-engine-method-16 (_type_ object int) none 16)
|
||||
(traffic-engine-method-15 (_type_ nav-segment float) none 15)
|
||||
(traffic-engine-method-16 (_type_ nav-segment float) none 16)
|
||||
(traffic-engine-method-17 (_type_ nav-branch) symbol 17)
|
||||
(child-killed (_type_ process) none 18)
|
||||
(traffic-engine-method-19 (_type_ object) none 19)
|
||||
@ -49003,7 +49010,7 @@
|
||||
(set-target-level (_type_ float) none 24)
|
||||
(set-guard-target-level (_type_ float) none 25)
|
||||
(deactivate-all (_type_) none 26)
|
||||
(deactivate-by-type (_type_ object) none 27)
|
||||
(deactivate-by-type (_type_ int) none 27)
|
||||
(traffic-engine-method-28 (_type_) symbol 28)
|
||||
(restore-default-settings (_type_) none 29)
|
||||
(increase-alert-level (_type_ object target) none 30)
|
||||
@ -49011,15 +49018,15 @@
|
||||
(set-alert-level (_type_ object) none 32)
|
||||
(set-max-alert-level (_type_ object) none 33)
|
||||
(set-alert-duration (_type_ object) none 34)
|
||||
(get-alert-level (_type_) none 35)
|
||||
(get-alert-level (_type_) symbol 35)
|
||||
(get-target "@returns [[*target*]]" (_type_) target 36)
|
||||
(set-object-target-level (_type_ int float) none 37)
|
||||
(set-object-target-count (_type_ int int) none 38)
|
||||
(set-object-reserve-count (_type_ int uint) none 39)
|
||||
(get-object-reserve-count (_type_ int) none 40)
|
||||
(get-object-remaining-count (_type_ int) none 41)
|
||||
(activate-object (_type_ object) none 42)
|
||||
(traffic-engine-method-43 (_type_) none 43)
|
||||
(get-object-reserve-count (_type_ int) int 40)
|
||||
(get-object-remaining-count (_type_ int) int 41)
|
||||
(activate-object (_type_ traffic-object-spawn-params) none 42)
|
||||
(traffic-engine-method-43 (_type_ traffic-object-spawn-params) none 43)
|
||||
(traffic-engine-method-44 (_type_ int float) none 44)
|
||||
(traffic-engine-method-45 (_type_) int 45)
|
||||
(new-suppression-box (_type_ object) none 46)
|
||||
@ -49036,9 +49043,9 @@
|
||||
(set-guard-target-count-range (_type_ int int int) none 57)
|
||||
(set-object-auto-activate (_type_ object object) none 58)
|
||||
(traffic-engine-method-59 (_type_ object int) none 59)
|
||||
(kill-traffic-sphere (_type_ object) none 60)
|
||||
(level-loaded (_type_ object) none 61)
|
||||
(level-killed (_type_) none 62)
|
||||
(kill-traffic-sphere (_type_ sphere) none 60)
|
||||
(level-loaded (_type_ level) none 61)
|
||||
(level-killed (_type_ level) none 62)
|
||||
(traffic-engine-method-63 (_type_) none 63)
|
||||
(traffic-engine-method-64 (_type_) none 64)
|
||||
(traffic-engine-method-65 (_type_ vis-cell) none 65)
|
||||
@ -49312,6 +49319,7 @@
|
||||
:flag-assert #x900000004
|
||||
)
|
||||
|
||||
;; +++vehicle-h:vehicle-type
|
||||
(defenum vehicle-type
|
||||
:type int32
|
||||
(bikea 0)
|
||||
@ -49326,6 +49334,7 @@
|
||||
(test-bike 9)
|
||||
(test-car 10)
|
||||
)
|
||||
;; ---vehicle-h:vehicle-type
|
||||
|
||||
(declare-type vehicle-physics-work structure)
|
||||
(deftype vehicle (rigid-body-object)
|
||||
@ -49505,9 +49514,57 @@
|
||||
;; citizen-h ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;; +++citizen-h:citizen-flag
|
||||
(defenum citizen-flag
|
||||
:type uint16
|
||||
:bitfield #t
|
||||
(persistent)
|
||||
(run-mode)
|
||||
(shuffle-mode)
|
||||
(in-pursuit)
|
||||
(hostile)
|
||||
(target-in-sight)
|
||||
(sticky-weapon)
|
||||
(knocked-out-car)
|
||||
(knocked-out-bike)
|
||||
(dark-guard)
|
||||
(female)
|
||||
)
|
||||
;; ---citizen-h:citizen-flag
|
||||
|
||||
(deftype citizen (nav-enemy)
|
||||
(
|
||||
(pad uint8 :offset 963))
|
||||
(flags citizen-flag :offset-assert 604)
|
||||
(traffic-id int8 :offset-assert 606)
|
||||
(hit-by-player-count int8 :offset-assert 607)
|
||||
(gnd-height float :offset-assert 608)
|
||||
(speed-scale float :offset-assert 612)
|
||||
(controller vehicle-controller :inline :offset-assert 624)
|
||||
(danger-pos sphere :inline :offset-assert 768)
|
||||
(vehicle int64 :offset-assert 784)
|
||||
(anim-shuffle int32 :offset-assert 792)
|
||||
(dist-walk-anim float :offset-assert 796)
|
||||
(speed-walk float :offset-assert 800)
|
||||
(anim-walk int32 :offset-assert 804)
|
||||
(dist-run-anim float :offset-assert 808)
|
||||
(speed-run float :offset-assert 812)
|
||||
(anim-run int32 :offset-assert 816)
|
||||
(water-anim int32 :offset-assert 820)
|
||||
(interp float :offset-assert 824)
|
||||
(last-danger-time time-frame :offset-assert 832)
|
||||
(next-time-look-at time-frame :offset-assert 840)
|
||||
(stop-time-look-at time-frame :offset-assert 848)
|
||||
(wait-return-state symbol :offset-assert 856)
|
||||
(wait-time time-frame :offset-assert 864)
|
||||
(cp-valid? symbol :offset-assert 872)
|
||||
(cp-sphere sphere :inline :offset-assert 880)
|
||||
(cp-vec vector :inline :offset-assert 896)
|
||||
(cp-next-time time-frame :offset-assert 912)
|
||||
(cp-exit-time time-frame :offset-assert 920)
|
||||
(cp-force vector :inline :offset-assert 928)
|
||||
(cp-plane plane :inline :offset-assert 944)
|
||||
(cp-factor float :offset-assert 960)
|
||||
)
|
||||
:method-count-assert 201
|
||||
:size-assert #x3c4
|
||||
:flag-assert #xc9035003c4
|
||||
@ -49733,6 +49790,17 @@
|
||||
;; vehicle-util ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(deftype mystery-vehicle-type (structure)
|
||||
"TODO - What are you! Custom added for decomp"
|
||||
((matrices matrix 3 :inline :offset-assert 0)
|
||||
(vectors vector 2 :inline :offset-assert 192)
|
||||
(handles handle 2 :offset-assert 224)
|
||||
(cquery collide-query :inline :offset-assert 240)
|
||||
(floats float 5 :offset-assert 780))
|
||||
:method-count-assert 9
|
||||
:size-assert #x320
|
||||
:flag-assert #x900000320)
|
||||
|
||||
(deftype vehicle-hud-request (structure)
|
||||
((handle handle :offset-assert 0)
|
||||
(hack-handle-init basic :offset 0)
|
||||
@ -51382,6 +51450,12 @@
|
||||
;; traffic-manager ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(deftype mystery-traffic-manager-type (structure)
|
||||
((bytes vector16b 2 :inline :offset-assert 0))
|
||||
:method-count-assert 9
|
||||
:size-assert #x20
|
||||
:flag-assert #x900000020)
|
||||
|
||||
(deftype traffic-manager (process)
|
||||
((traffic-engine traffic-engine :offset-assert 128)
|
||||
(fast-spawn basic :offset-assert 132)
|
||||
@ -51410,7 +51484,7 @@
|
||||
(define-extern citizen-spawn (function process type traffic-object-spawn-params process-drawable))
|
||||
(define-extern traffic-object-spawn (function process traffic-object-spawn-params process-drawable))
|
||||
(define-extern type-from-vehicle-type (function vehicle-type type))
|
||||
(define-extern traffic-manager-event-handler (function process int symbol event-message-block none :behavior traffic-manager))
|
||||
(define-extern traffic-manager-event-handler (function process int symbol event-message-block object :behavior traffic-manager))
|
||||
(define-extern traffic-manager-init-by-other (function none :behavior traffic-manager))
|
||||
(define-extern traffic-start (function none))
|
||||
(define-extern traffic-kill (function none))
|
||||
|
@ -488,11 +488,6 @@
|
||||
"(method 48 vehicle)": [
|
||||
0, 1, 2, 3, 4, 5, 9, 10, 11, 12, 13, 16, 17, 23, 24, 29, 30, 31
|
||||
],
|
||||
"(method 48 rigid-body-object)": [0, 1, 2, 3, 4, 5],
|
||||
"(method 15 rigid-body)": [0, 1, 2, 5],
|
||||
"(method 63 collide-shape-moving)": [
|
||||
0, 1, 2, 3, 4, 5, 6, 10, 12, 13, 14, 28, 38, 39, 40, 44
|
||||
],
|
||||
"(method 11 vehicle-hud-requests)": [0, 6, 7, 10, 11, 12],
|
||||
"(method 17 traffic-manager)": [
|
||||
0, 4, 7, 17, 23, 25, 26, 27, 28, 39, 42, 43, 44
|
||||
|
@ -1569,16 +1569,17 @@
|
||||
[672, "vector"],
|
||||
[688, "vector"]
|
||||
],
|
||||
"(method 133 vehicle)": [[16, ["inline-array", "matrix", 12]]],
|
||||
"(method 133 vehicle)": [[16, "mystery-vehicle-type"]],
|
||||
"(method 153 vehicle-guard)": [[16, "vector"]],
|
||||
"(method 150 vehicle-guard)": [[16, "vehicle-control-point"]],
|
||||
"(method 9 turret-control)": [[16, "rigid-body-info"]],
|
||||
"(method 21 traffic-manager)": [[16, ["inline-array", "vector16b", 2]]],
|
||||
"(method 21 traffic-manager)": [[16, ["array", "int8", 21]]],
|
||||
"(method 71 traffic-engine)": [[16, "vector"]],
|
||||
"(method 18 city-level-info)": [[16, "bounding-box"]],
|
||||
"(method 49 traffic-engine)": [
|
||||
[32, "(array crimson-guard)"],
|
||||
[112, "(array float)"]
|
||||
[112, "(array float)"],
|
||||
[240, "vector"]
|
||||
],
|
||||
"(method 68 traffic-engine)": [
|
||||
[16, "vector"],
|
||||
@ -1588,7 +1589,7 @@
|
||||
[16, "bounding-box"],
|
||||
[48, "vector4w"]
|
||||
],
|
||||
"(method 22 traffic-tracker)": [[16, ["inline-array", "vector", 10]]],
|
||||
"(method 22 traffic-tracker)": [[16, "mystery-traffic-object-spawn-params"]],
|
||||
"(method 10 simple-sprite-system)": [[16, ["array", "texture-id", 4]]],
|
||||
"(anon-function 3 ruins-obs)": [[16, "event-message-block"]],
|
||||
"(event unbroken ruins-breakable-wall)": [[16, "attack-info"]],
|
||||
@ -1739,5 +1740,26 @@
|
||||
"(anon-function 18 ctywide-bbush)": [
|
||||
[64, "vector"],
|
||||
[128, "vector"]
|
||||
]
|
||||
],
|
||||
"(method 9 city-level-info)": [
|
||||
[192, "vector"],
|
||||
[208, "vector"],
|
||||
[224, "vector"],
|
||||
[16, "vis-ray"],
|
||||
[128, "vector"],
|
||||
[144, "vector"]
|
||||
],
|
||||
"(method 11 city-level-info)": [[16, "vector"]],
|
||||
"(method 17 city-level-info)": [[16, ["inline-array", "vis-grid-pos", 2]]],
|
||||
"(method 16 city-level-info)": [
|
||||
[48, "vis-grid-box"],
|
||||
[64, "vis-grid-box"]
|
||||
],
|
||||
"(method 15 city-level-info)": [
|
||||
[32, "vis-grid-box"],
|
||||
[16, "vis-grid-box"]
|
||||
],
|
||||
"(method 9 grid-info)": [[16, "vector"]],
|
||||
"(method 11 grid-info)": [[16, "bounding-box"]],
|
||||
"(method 12 city-level-info)": [[16, ["inline-array", "vector", 7]]]
|
||||
}
|
||||
|
@ -6860,8 +6860,8 @@
|
||||
],
|
||||
"(method 97 vehicle)": [[6, "v1", "float"]],
|
||||
"(method 18 vehicle-controller)": [[231, "s2", "vehicle"]],
|
||||
"(method 10 vehicle)": [[10, "v0", "(function rigid-body-object none)"]],
|
||||
"(method 119 vehicle)": [[14, "a0", "vehicle-rider"]],
|
||||
"(method 10 vehicle)": [[12, "t9", "(function rigid-body-object none)"]],
|
||||
"(method 119 vehicle)": [[[19, 45], "s4", "vehicle-rider"]],
|
||||
"(method 99 vehicle)": [[14, "s3", "collide-shape-prim-group"]],
|
||||
"(method 100 vehicle)": [[163, "a0", "vector"]],
|
||||
"(method 46 vehicle-guard)": [
|
||||
@ -6888,10 +6888,22 @@
|
||||
[32, "s3", "process-focusable"],
|
||||
[[72, 75], "s3", "process-focusable"],
|
||||
[265, "a0", "(array crimson-guard)"],
|
||||
[166, "s2", "process-focusable"]
|
||||
[166, "s2", "process-focusable"],
|
||||
[[170, 195], "s2", "crimson-guard"],
|
||||
[[32, 109], "s3", "process-focusable"],
|
||||
[354, "s5", "process-focusable"],
|
||||
[135, "v0", "(array crimson-guard)"],
|
||||
[143, "v0", "(array float)"]
|
||||
],
|
||||
"(method 25 traffic-tracker)": [[24, "a0", "process-focusable"]],
|
||||
"(method 68 traffic-engine)": [[46, "a2", "process-focusable"]],
|
||||
"(method 68 traffic-engine)": [
|
||||
[46, "a2", "process-focusable"],
|
||||
[312, "s2", "nav-segment"],
|
||||
[321, "s2", "nav-segment"],
|
||||
[327, "s2", "nav-segment"],
|
||||
[[159, 191], "s3", "process-focusable"],
|
||||
[[89, 125], "s3", "vehicle"]
|
||||
],
|
||||
"(method 50 traffic-engine)": [
|
||||
[13, "v1", "connection"],
|
||||
[[14, 19], "v1", "collide-shape"],
|
||||
@ -7951,5 +7963,10 @@
|
||||
[96, "a1", "process-focusable"],
|
||||
[19, "a0", "part-tracker"]
|
||||
],
|
||||
"race-ring-set-particle-rotation-callback": [[1, "v1", "(pointer race-ring)"]]
|
||||
"race-ring-set-particle-rotation-callback": [[1, "v1", "(pointer race-ring)"]],
|
||||
"(method 9 city-level-info)": [[387, "v1", "nav-segment"]],
|
||||
"(method 67 traffic-engine)": [
|
||||
[[137, 183], "s0", "crimson-guard"],
|
||||
[[44, 86], "a3", "vehicle"]
|
||||
]
|
||||
}
|
||||
|
@ -20,7 +20,7 @@
|
||||
(max-command int32 :offset-assert 140)
|
||||
(selected-index int32 :offset-assert 144)
|
||||
(selected-dist float :offset-assert 148)
|
||||
(selected-node-edge? basic :offset-assert 152)
|
||||
(selected-node-edge? symbol :offset-assert 152)
|
||||
(closest-node int32 :offset-assert 156)
|
||||
(dist-closest-node float :offset-assert 160)
|
||||
(closest-edge int32 :offset-assert 164)
|
||||
|
@ -62,7 +62,6 @@
|
||||
(blocked-start-time time-frame :offset-assert 584)
|
||||
(restore-nav-radius-time time-frame :offset-assert 592)
|
||||
(nav-radius-backup float :offset-assert 600)
|
||||
(circle-radial-dist float :offset 244)
|
||||
)
|
||||
:heap-base #x1e0
|
||||
:method-count-assert 178
|
||||
|
@ -368,7 +368,7 @@
|
||||
(rigid-body-object-method-41 (_type_) none 41)
|
||||
(rigid-body-object-method-42 (_type_) none :behavior rigid-body-object 42)
|
||||
(rigid-body-object-method-43 (_type_) none 43)
|
||||
(apply-damage (_type_ float matrix) none 44)
|
||||
(apply-damage (_type_ float rigid-body-impact) none 44)
|
||||
(rigid-body-object-method-45 (_type_ rigid-body-impact) none 45)
|
||||
(rigid-body-object-method-46 (_type_ process-drawable int symbol event-message-block) none :behavior rigid-body-object 46)
|
||||
(rigid-body-object-method-47 (_type_ process-drawable attack-info touching-shapes-entry penetrate) symbol 47)
|
||||
|
@ -1089,7 +1089,7 @@ This commonly includes things such as:
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod apply-damage rigid-body-object ((obj rigid-body-object) (arg0 float) (arg1 matrix))
|
||||
(defmethod apply-damage rigid-body-object ((obj rigid-body-object) (arg0 float) (arg1 rigid-body-impact))
|
||||
0
|
||||
(none)
|
||||
)
|
||||
@ -1178,7 +1178,7 @@ This commonly includes things such as:
|
||||
)
|
||||
)
|
||||
(set! (-> s5-0 impulse) (* f0-2 (-> obj info attack-force-scale)))
|
||||
(apply-damage obj (* 0.667 f1-0) (the-as matrix s5-0))
|
||||
(apply-damage obj (* 0.667 f1-0) s5-0)
|
||||
)
|
||||
(rigid-body-object-method-42 obj)
|
||||
(let ((s4-1 (new 'stack-no-clear 'vector)))
|
||||
|
@ -5,15 +5,67 @@
|
||||
;; name in dgo: citizen-h
|
||||
;; dgos: CWI
|
||||
|
||||
;; +++citizen-flag
|
||||
(defenum citizen-flag
|
||||
:type uint16
|
||||
:bitfield #t
|
||||
(persistent)
|
||||
(run-mode)
|
||||
(shuffle-mode)
|
||||
(in-pursuit)
|
||||
(hostile)
|
||||
(target-in-sight)
|
||||
(sticky-weapon)
|
||||
(knocked-out-car)
|
||||
(knocked-out-bike)
|
||||
(dark-guard)
|
||||
(female)
|
||||
)
|
||||
;; ---citizen-flag
|
||||
|
||||
;; TODO - for traffic-manager
|
||||
(declare-type citizen nav-enemy)
|
||||
(declare-type traffic-object-spawn-params structure)
|
||||
(define-extern citizen-init-by-other (function traffic-object-spawn-params none :behavior citizen))
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
(deftype citizen (nav-enemy)
|
||||
(
|
||||
(pad uint8 :offset 963))
|
||||
((flags citizen-flag :offset-assert 604)
|
||||
(traffic-id int8 :offset-assert 606)
|
||||
(hit-by-player-count int8 :offset-assert 607)
|
||||
(gnd-height float :offset-assert 608)
|
||||
(speed-scale float :offset-assert 612)
|
||||
(controller vehicle-controller :inline :offset-assert 624)
|
||||
(danger-pos sphere :inline :offset-assert 768)
|
||||
(vehicle int64 :offset-assert 784)
|
||||
(anim-shuffle int32 :offset-assert 792)
|
||||
(dist-walk-anim float :offset-assert 796)
|
||||
(speed-walk float :offset-assert 800)
|
||||
(anim-walk int32 :offset-assert 804)
|
||||
(dist-run-anim float :offset-assert 808)
|
||||
(speed-run float :offset-assert 812)
|
||||
(anim-run int32 :offset-assert 816)
|
||||
(water-anim int32 :offset-assert 820)
|
||||
(interp float :offset-assert 824)
|
||||
(last-danger-time time-frame :offset-assert 832)
|
||||
(next-time-look-at time-frame :offset-assert 840)
|
||||
(stop-time-look-at time-frame :offset-assert 848)
|
||||
(wait-return-state symbol :offset-assert 856)
|
||||
(wait-time time-frame :offset-assert 864)
|
||||
(cp-valid? symbol :offset-assert 872)
|
||||
(cp-sphere sphere :inline :offset-assert 880)
|
||||
(cp-vec vector :inline :offset-assert 896)
|
||||
(cp-next-time time-frame :offset-assert 912)
|
||||
(cp-exit-time time-frame :offset-assert 920)
|
||||
(cp-force vector :inline :offset-assert 928)
|
||||
(cp-plane plane :inline :offset-assert 944)
|
||||
(cp-factor float :offset-assert 960)
|
||||
)
|
||||
:heap-base #x350
|
||||
:method-count-assert 201
|
||||
:size-assert #x3c4
|
||||
:flag-assert #xc9035003c4
|
||||
;; Failed to read fields.
|
||||
(:methods
|
||||
(citizen-method-178 () none 178)
|
||||
(citizen-method-179 () none 179)
|
||||
@ -39,4 +91,4 @@
|
||||
(citizen-method-199 () none 199)
|
||||
(citizen-method-200 () none 200)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
@ -135,9 +135,9 @@
|
||||
:size-assert #x40
|
||||
:flag-assert #xe00000040
|
||||
(:methods
|
||||
(grid-info-method-9 (_type_) none 9)
|
||||
(grid-info-method-9 (_type_ (pointer bounding-box) int int) none 9)
|
||||
(grid-info-method-10 (_type_ vis-grid-pos vector) none 10)
|
||||
(grid-info-method-11 (_type_) none 11)
|
||||
(grid-info-method-11 (_type_ vis-grid-box vector) none 11)
|
||||
(grid-info-method-12 (_type_ rgba) none 12)
|
||||
(grid-info-method-13 (_type_ vis-grid-pos rgba) none 13)
|
||||
)
|
||||
@ -158,15 +158,15 @@
|
||||
:size-assert #x8c
|
||||
:flag-assert #x130000008c
|
||||
(:methods
|
||||
(city-level-info-method-9 (_type_) none 9)
|
||||
(city-level-info-method-9 (_type_) symbol 9)
|
||||
(city-level-info-method-10 (_type_ vis-ray vector vector) none 10)
|
||||
(city-level-info-method-11 (_type_) none 11)
|
||||
(city-level-info-method-12 (_type_) none 12)
|
||||
(city-level-info-method-11 (_type_ vis-ray) none 11)
|
||||
(city-level-info-method-12 (_type_ vector nav-branch vector) vector 12)
|
||||
(city-level-info-method-13 (_type_ vector) none 13)
|
||||
(city-level-info-method-14 (_type_) none 14)
|
||||
(city-level-info-method-15 (_type_) none 15)
|
||||
(city-level-info-method-16 (_type_) none 16)
|
||||
(city-level-info-method-17 (_type_) none 17)
|
||||
(city-level-info-method-14 (_type_ vis-grid-box) vis-cell 14)
|
||||
(city-level-info-method-15 (_type_ int int) symbol 15)
|
||||
(city-level-info-method-16 (_type_ vector int traffic-find-segment-struct (function traffic-find-segment-struct object none)) none 16)
|
||||
(city-level-info-method-17 (_type_ traffic-engine) none 17)
|
||||
(city-level-info-method-18 (_type_) none 18)
|
||||
)
|
||||
)
|
||||
@ -188,7 +188,7 @@
|
||||
(traffic-level-data-method-10 (_type_ vis-cell) none 10)
|
||||
(traffic-level-data-method-11 (_type_ int) none 11)
|
||||
(traffic-level-data-method-12 (_type_ vis-cell) none 12)
|
||||
(traffic-level-data-method-13 (_type_) none 13)
|
||||
(traffic-level-data-method-13 (_type_) vis-cell 13)
|
||||
(traffic-level-data-method-14 (_type_) none 14)
|
||||
)
|
||||
)
|
||||
@ -321,7 +321,7 @@
|
||||
(:methods
|
||||
(traffic-suppressor-method-9 (_type_) none 9)
|
||||
(traffic-suppressor-method-10 (_type_ traffic-suppression-params) none 10)
|
||||
(traffic-suppressor-method-11 (_type_ traffic-suppression-params) none 11)
|
||||
(traffic-suppressor-method-11 (_type_ int) none 11)
|
||||
(traffic-suppressor-method-12 (_type_ traffic-suppression-params) none 12)
|
||||
(traffic-suppressor-method-13 (_type_) none 13)
|
||||
)
|
||||
@ -355,7 +355,7 @@
|
||||
(traffic-tracker-method-19 (_type_ handle) none 19)
|
||||
(traffic-tracker-method-20 (_type_ int symbol) none 20)
|
||||
(traffic-tracker-method-21 (_type_ traffic-object-spawn-params) none 21)
|
||||
(traffic-tracker-method-22 (_type_ object nav-segment int) none 22)
|
||||
(traffic-tracker-method-22 (_type_ int nav-segment float) none 22)
|
||||
(traffic-tracker-method-23 (_type_ traffic-object-spawn-params) none 23)
|
||||
(traffic-tracker-method-24 (_type_ uint traffic-engine) none 24)
|
||||
(traffic-tracker-method-25 (_type_ (function process-focusable traffic-object-type-info none)) none 25)
|
||||
@ -378,7 +378,7 @@
|
||||
(level-data-array traffic-level-data 2 :inline :offset-assert 1040)
|
||||
(object-type-info-array traffic-object-type-info 21 :inline :offset-assert 5200)
|
||||
(tracker-array traffic-tracker 2 :inline :offset-assert 5872)
|
||||
(inactive-object-array uint64 420 :offset-assert 8176)
|
||||
(inactive-object-array handle 420 :offset-assert 8176)
|
||||
(suppressor traffic-suppressor :inline :offset-assert 11536)
|
||||
(danger-sphere-count int8 :offset-assert 12096)
|
||||
(pad int8 15 :offset-assert 12097)
|
||||
@ -394,8 +394,8 @@
|
||||
(traffic-engine-method-12 (_type_) none 12)
|
||||
(add-object (_type_ int process) none 13)
|
||||
(traffic-engine-method-14 (_type_ object object) symbol 14)
|
||||
(traffic-engine-method-15 (_type_ object int) none 15)
|
||||
(traffic-engine-method-16 (_type_ object int) none 16)
|
||||
(traffic-engine-method-15 (_type_ nav-segment float) none 15)
|
||||
(traffic-engine-method-16 (_type_ nav-segment float) none 16)
|
||||
(traffic-engine-method-17 (_type_ nav-branch) symbol 17)
|
||||
(child-killed (_type_ process) none 18)
|
||||
(traffic-engine-method-19 (_type_ object) none 19)
|
||||
@ -406,7 +406,7 @@
|
||||
(set-target-level (_type_ float) none 24)
|
||||
(set-guard-target-level (_type_ float) none 25)
|
||||
(deactivate-all (_type_) none 26)
|
||||
(deactivate-by-type (_type_ object) none 27)
|
||||
(deactivate-by-type (_type_ int) none 27)
|
||||
(traffic-engine-method-28 (_type_) symbol 28)
|
||||
(restore-default-settings (_type_) none 29)
|
||||
(increase-alert-level (_type_ object target) none 30)
|
||||
@ -414,15 +414,15 @@
|
||||
(set-alert-level (_type_ object) none 32)
|
||||
(set-max-alert-level (_type_ object) none 33)
|
||||
(set-alert-duration (_type_ object) none 34)
|
||||
(get-alert-level (_type_) none 35)
|
||||
(get-alert-level (_type_) symbol 35)
|
||||
(get-target (_type_) target 36)
|
||||
(set-object-target-level (_type_ int float) none 37)
|
||||
(set-object-target-count (_type_ int int) none 38)
|
||||
(set-object-reserve-count (_type_ int uint) none 39)
|
||||
(get-object-reserve-count (_type_ int) none 40)
|
||||
(get-object-remaining-count (_type_ int) none 41)
|
||||
(activate-object (_type_ object) none 42)
|
||||
(traffic-engine-method-43 (_type_) none 43)
|
||||
(get-object-reserve-count (_type_ int) int 40)
|
||||
(get-object-remaining-count (_type_ int) int 41)
|
||||
(activate-object (_type_ traffic-object-spawn-params) none 42)
|
||||
(traffic-engine-method-43 (_type_ traffic-object-spawn-params) none 43)
|
||||
(traffic-engine-method-44 (_type_ int float) none 44)
|
||||
(traffic-engine-method-45 (_type_) int 45)
|
||||
(new-suppression-box (_type_ object) none 46)
|
||||
@ -439,9 +439,9 @@
|
||||
(set-guard-target-count-range (_type_ int int int) none 57)
|
||||
(set-object-auto-activate (_type_ object object) none 58)
|
||||
(traffic-engine-method-59 (_type_ object int) none 59)
|
||||
(kill-traffic-sphere (_type_ object) none 60)
|
||||
(level-loaded (_type_ object) none 61)
|
||||
(level-killed (_type_) none 62)
|
||||
(kill-traffic-sphere (_type_ sphere) none 60)
|
||||
(level-loaded (_type_ level) none 61)
|
||||
(level-killed (_type_ level) none 62)
|
||||
(traffic-engine-method-63 (_type_) none 63)
|
||||
(traffic-engine-method-64 (_type_) none 64)
|
||||
(traffic-engine-method-65 (_type_ vis-cell) none 65)
|
||||
|
@ -6,4 +6,3 @@
|
||||
;; dgos: CWI
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
|
@ -26,6 +26,35 @@
|
||||
(declare-type vehicle rigid-body-object)
|
||||
(declare-type vehicle-physics-work structure)
|
||||
|
||||
(deftype mystery-vehicle-type (structure)
|
||||
"TODO - What are you! Custom added for decomp"
|
||||
((matrices matrix 3 :inline :offset-assert 0)
|
||||
(vectors vector 2 :inline :offset-assert 192)
|
||||
(handles handle 2 :offset-assert 224)
|
||||
(cquery collide-query :inline :offset-assert 240)
|
||||
(floats float 5 :offset-assert 780))
|
||||
:method-count-assert 9
|
||||
:size-assert #x320
|
||||
:flag-assert #x900000320)
|
||||
|
||||
;; +++vehicle-type
|
||||
(defenum vehicle-type
|
||||
:type int32
|
||||
(bikea 0)
|
||||
(bikeb 1)
|
||||
(bikec 2)
|
||||
(cara 3)
|
||||
(carb 4)
|
||||
(carc 5)
|
||||
(guard-bike 6)
|
||||
(hellcat 7)
|
||||
(evan-test-bike 8)
|
||||
(test-bike 9)
|
||||
(test-car 10)
|
||||
)
|
||||
;; ---vehicle-type
|
||||
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
(deftype vehicle-lookup-info (structure)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -99,21 +99,21 @@
|
||||
(if (logtest? (-> obj flags) (rigid-body-object-flag player-driving))
|
||||
(cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 1))
|
||||
)
|
||||
(apply-damage obj 1.0 (the-as matrix arg0))
|
||||
(apply-damage obj 1.0 arg0)
|
||||
(vehicle-method-76 obj 2 (the-as uint 300))
|
||||
)
|
||||
((< (* 131072.0 f28-0) (-> arg0 impulse))
|
||||
(if (logtest? (-> obj flags) (rigid-body-object-flag player-driving))
|
||||
(cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.5))
|
||||
)
|
||||
(apply-damage obj 0.25 (the-as matrix arg0))
|
||||
(apply-damage obj 0.25 arg0)
|
||||
(vehicle-method-76 obj 1 (the-as uint 75))
|
||||
)
|
||||
((< (* 102400.0 f28-0) (-> arg0 impulse))
|
||||
(if (logtest? (-> obj flags) (rigid-body-object-flag player-driving))
|
||||
(cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.25))
|
||||
)
|
||||
(apply-damage obj 0.125 (the-as matrix arg0))
|
||||
(apply-damage obj 0.125 arg0)
|
||||
(vehicle-method-76 obj 1 (the-as uint 75))
|
||||
)
|
||||
(else
|
||||
@ -122,7 +122,7 @@
|
||||
(f2-5 (* 16384000.0 f28-0))
|
||||
(f0-10 (fmax f0-9 (* f1-7 (/ 1.0 f2-5))))
|
||||
)
|
||||
(apply-damage obj f0-10 (the-as matrix arg0))
|
||||
(apply-damage obj f0-10 arg0)
|
||||
)
|
||||
(when (< (* 32768.0 f28-0) (-> arg0 impulse))
|
||||
(if (logtest? (-> obj flags) (rigid-body-object-flag player-driving))
|
||||
@ -1597,7 +1597,7 @@
|
||||
)
|
||||
)
|
||||
(set! (-> s5-0 trans x) f0-2)
|
||||
(apply-damage obj (* 0.667 f1-0) s5-0)
|
||||
(apply-damage obj (* 0.667 f1-0) (the-as rigid-body-impact s5-0))
|
||||
)
|
||||
(rigid-body-object-method-42 obj)
|
||||
(let ((s3-1 (new 'stack-no-clear 'vector)))
|
||||
|
1
test/decompiler/reference/jak2/engine/nav/nav-enemy-h_REF.gc
generated
vendored
1
test/decompiler/reference/jak2/engine/nav/nav-enemy-h_REF.gc
generated
vendored
@ -162,7 +162,6 @@
|
||||
(blocked-start-time time-frame :offset-assert 584)
|
||||
(restore-nav-radius-time time-frame :offset-assert 592)
|
||||
(nav-radius-backup float :offset-assert 600)
|
||||
(circle-radial-dist float :offset 244)
|
||||
)
|
||||
:heap-base #x1e0
|
||||
:method-count-assert 178
|
||||
|
2
test/decompiler/reference/jak2/engine/physics/rigid-body-h_REF.gc
generated
vendored
2
test/decompiler/reference/jak2/engine/physics/rigid-body-h_REF.gc
generated
vendored
@ -500,7 +500,7 @@
|
||||
(rigid-body-object-method-41 (_type_) none 41)
|
||||
(rigid-body-object-method-42 (_type_) none :behavior rigid-body-object 42)
|
||||
(rigid-body-object-method-43 (_type_) none 43)
|
||||
(apply-damage (_type_ float matrix) none 44)
|
||||
(apply-damage (_type_ float rigid-body-impact) none 44)
|
||||
(rigid-body-object-method-45 (_type_ rigid-body-impact) none 45)
|
||||
(rigid-body-object-method-46 (_type_ process-drawable int symbol event-message-block) none :behavior rigid-body-object 46)
|
||||
(rigid-body-object-method-47 (_type_ process-drawable attack-info touching-shapes-entry penetrate) symbol 47)
|
||||
|
5
test/decompiler/reference/jak2/engine/physics/rigid-body_REF.gc
generated
vendored
5
test/decompiler/reference/jak2/engine/physics/rigid-body_REF.gc
generated
vendored
@ -877,7 +877,6 @@
|
||||
)
|
||||
|
||||
;; definition for method 10 of type rigid-body-control
|
||||
;; INFO: this function exists in multiple non-identical object files
|
||||
;; WARN: Return type mismatch int vs object.
|
||||
(defmethod rigid-body-control-method-10 rigid-body-control ((obj rigid-body-control) (arg0 rigid-body-object) (arg1 float) (arg2 float))
|
||||
(let* ((s4-1 (max 1 (min 4 (+ (the int (* 0.9999 (/ arg1 arg2))) 1))))
|
||||
@ -1184,7 +1183,7 @@ This commonly includes things such as:
|
||||
|
||||
;; definition for method 44 of type rigid-body-object
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod apply-damage rigid-body-object ((obj rigid-body-object) (arg0 float) (arg1 matrix))
|
||||
(defmethod apply-damage rigid-body-object ((obj rigid-body-object) (arg0 float) (arg1 rigid-body-impact))
|
||||
0
|
||||
(none)
|
||||
)
|
||||
@ -1280,7 +1279,7 @@ This commonly includes things such as:
|
||||
)
|
||||
)
|
||||
(set! (-> s5-0 impulse) (* f0-2 (-> obj info attack-force-scale)))
|
||||
(apply-damage obj (* 0.667 f1-0) (the-as matrix s5-0))
|
||||
(apply-damage obj (* 0.667 f1-0) s5-0)
|
||||
)
|
||||
(rigid-body-object-method-42 obj)
|
||||
(let ((s4-1 (new 'stack-no-clear 'vector)))
|
||||
|
153
test/decompiler/reference/jak2/levels/city/common/citizen-h_REF.gc
generated
vendored
Normal file
153
test/decompiler/reference/jak2/levels/city/common/citizen-h_REF.gc
generated
vendored
Normal file
@ -0,0 +1,153 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; definition of type citizen
|
||||
(deftype citizen (nav-enemy)
|
||||
((flags citizen-flag :offset-assert 604)
|
||||
(traffic-id int8 :offset-assert 606)
|
||||
(hit-by-player-count int8 :offset-assert 607)
|
||||
(gnd-height float :offset-assert 608)
|
||||
(speed-scale float :offset-assert 612)
|
||||
(controller vehicle-controller :inline :offset-assert 624)
|
||||
(danger-pos sphere :inline :offset-assert 768)
|
||||
(vehicle int64 :offset-assert 784)
|
||||
(anim-shuffle int32 :offset-assert 792)
|
||||
(dist-walk-anim float :offset-assert 796)
|
||||
(speed-walk float :offset-assert 800)
|
||||
(anim-walk int32 :offset-assert 804)
|
||||
(dist-run-anim float :offset-assert 808)
|
||||
(speed-run float :offset-assert 812)
|
||||
(anim-run int32 :offset-assert 816)
|
||||
(water-anim int32 :offset-assert 820)
|
||||
(interp float :offset-assert 824)
|
||||
(last-danger-time time-frame :offset-assert 832)
|
||||
(next-time-look-at time-frame :offset-assert 840)
|
||||
(stop-time-look-at time-frame :offset-assert 848)
|
||||
(wait-return-state symbol :offset-assert 856)
|
||||
(wait-time time-frame :offset-assert 864)
|
||||
(cp-valid? symbol :offset-assert 872)
|
||||
(cp-sphere sphere :inline :offset-assert 880)
|
||||
(cp-vec vector :inline :offset-assert 896)
|
||||
(cp-next-time time-frame :offset-assert 912)
|
||||
(cp-exit-time time-frame :offset-assert 920)
|
||||
(cp-force vector :inline :offset-assert 928)
|
||||
(cp-plane plane :inline :offset-assert 944)
|
||||
(cp-factor float :offset-assert 960)
|
||||
)
|
||||
:heap-base #x350
|
||||
:method-count-assert 201
|
||||
:size-assert #x3c4
|
||||
:flag-assert #xc9035003c4
|
||||
(:methods
|
||||
(citizen-method-178 () none 178)
|
||||
(citizen-method-179 () none 179)
|
||||
(citizen-method-180 () none 180)
|
||||
(citizen-method-181 () none 181)
|
||||
(citizen-method-182 () none 182)
|
||||
(citizen-method-183 () none 183)
|
||||
(citizen-method-184 () none 184)
|
||||
(citizen-method-185 () none 185)
|
||||
(citizen-method-186 () none 186)
|
||||
(citizen-method-187 () none 187)
|
||||
(citizen-method-188 () none 188)
|
||||
(citizen-method-189 () none 189)
|
||||
(citizen-method-190 () none 190)
|
||||
(citizen-method-191 () none 191)
|
||||
(citizen-method-192 () none 192)
|
||||
(citizen-method-193 () none 193)
|
||||
(citizen-method-194 () none 194)
|
||||
(citizen-method-195 () none 195)
|
||||
(citizen-method-196 () none 196)
|
||||
(citizen-method-197 () none 197)
|
||||
(citizen-method-198 () none 198)
|
||||
(citizen-method-199 () none 199)
|
||||
(citizen-method-200 () none 200)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type citizen
|
||||
(defmethod inspect citizen ((obj citizen))
|
||||
(when (not obj)
|
||||
(set! obj obj)
|
||||
(goto cfg-26)
|
||||
)
|
||||
(let ((t9-0 (method-of-type nav-enemy inspect)))
|
||||
(t9-0 obj)
|
||||
)
|
||||
(format #t "~2Tflags: #x~X : (citizen-flag " (-> obj flags))
|
||||
(let ((s5-0 (-> obj flags)))
|
||||
(if (= (logand s5-0 (citizen-flag female)) (citizen-flag female))
|
||||
(format #t "female ")
|
||||
)
|
||||
(if (= (logand s5-0 (citizen-flag knocked-out-car)) (citizen-flag knocked-out-car))
|
||||
(format #t "knocked-out-car ")
|
||||
)
|
||||
(if (= (logand s5-0 (citizen-flag sticky-weapon)) (citizen-flag sticky-weapon))
|
||||
(format #t "sticky-weapon ")
|
||||
)
|
||||
(if (= (logand s5-0 (citizen-flag in-pursuit)) (citizen-flag in-pursuit))
|
||||
(format #t "in-pursuit ")
|
||||
)
|
||||
(if (= (logand s5-0 (citizen-flag dark-guard)) (citizen-flag dark-guard))
|
||||
(format #t "dark-guard ")
|
||||
)
|
||||
(if (= (logand s5-0 (citizen-flag hostile)) (citizen-flag hostile))
|
||||
(format #t "hostile ")
|
||||
)
|
||||
(if (= (logand s5-0 (citizen-flag persistent)) (citizen-flag persistent))
|
||||
(format #t "persistent ")
|
||||
)
|
||||
(if (= (logand s5-0 (citizen-flag shuffle-mode)) (citizen-flag shuffle-mode))
|
||||
(format #t "shuffle-mode ")
|
||||
)
|
||||
(if (= (logand s5-0 (citizen-flag knocked-out-bike)) (citizen-flag knocked-out-bike))
|
||||
(format #t "knocked-out-bike ")
|
||||
)
|
||||
(if (= (logand s5-0 (citizen-flag target-in-sight)) (citizen-flag target-in-sight))
|
||||
(format #t "target-in-sight ")
|
||||
)
|
||||
(if (= (logand s5-0 (citizen-flag run-mode)) (citizen-flag run-mode))
|
||||
(format #t "run-mode ")
|
||||
)
|
||||
)
|
||||
(format #t ")~%")
|
||||
(format #t "~2Ttraffic-id: ~D~%" (-> obj traffic-id))
|
||||
(format #t "~2Thit-by-player-count: ~D~%" (-> obj hit-by-player-count))
|
||||
(format #t "~2Tgnd-height: ~f~%" (-> obj gnd-height))
|
||||
(format #t "~2Tspeed-scale: ~f~%" (-> obj speed-scale))
|
||||
(format #t "~2Tcontroller: #<vehicle-controller @ #x~X>~%" (-> obj controller))
|
||||
(format #t "~2Tdanger-pos: #<sphere @ #x~X>~%" (-> obj danger-pos))
|
||||
(format #t "~2Tdest-point: #<vector @ #x~X>~%" (-> obj controller turn-exit-point))
|
||||
(format #t "~2Tvehicle: ~D~%" (-> obj vehicle))
|
||||
(format #t "~2Tanim-shuffle: ~D~%" (-> obj anim-shuffle))
|
||||
(format #t "~2Tdist-walk-anim: ~f~%" (-> obj dist-walk-anim))
|
||||
(format #t "~2Tspeed-walk: ~f~%" (-> obj speed-walk))
|
||||
(format #t "~2Tanim-walk: ~D~%" (-> obj anim-walk))
|
||||
(format #t "~2Tdist-run-anim: ~f~%" (-> obj dist-run-anim))
|
||||
(format #t "~2Tspeed-run: ~f~%" (-> obj speed-run))
|
||||
(format #t "~2Tanim-run: ~D~%" (-> obj anim-run))
|
||||
(format #t "~2Twater-anim: ~D~%" (-> obj water-anim))
|
||||
(format #t "~2Tinterp: ~f~%" (-> obj interp))
|
||||
(format #t "~2Tlast-danger-time: ~D~%" (-> obj last-danger-time))
|
||||
(format #t "~2Tnext-time-look-at: ~D~%" (-> obj next-time-look-at))
|
||||
(format #t "~2Tstop-time-look-at: ~D~%" (-> obj stop-time-look-at))
|
||||
(format #t "~2Twait-return-state: ~A~%" (-> obj wait-return-state))
|
||||
(format #t "~2Twait-time: ~D~%" (-> obj wait-time))
|
||||
(format #t "~2Tcp-valid?: ~A~%" (-> obj cp-valid?))
|
||||
(format #t "~2Tcp-sphere: #<sphere @ #x~X>~%" (-> obj cp-sphere))
|
||||
(format #t "~2Tcp-vec: #<vector @ #x~X>~%" (-> obj cp-vec))
|
||||
(format #t "~2Tcp-next-time: ~D~%" (-> obj cp-next-time))
|
||||
(format #t "~2Tcp-exit-time: ~D~%" (-> obj cp-exit-time))
|
||||
(format #t "~2Tcp-force: #<vector @ #x~X>~%" (-> obj cp-force))
|
||||
(format #t "~2Tcp-plane: #<plane @ #x~X>~%" (-> obj cp-plane))
|
||||
(format #t "~2Tcp-factor: ~f~%" (-> obj cp-factor))
|
||||
(label cfg-26)
|
||||
obj
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
0
|
||||
|
||||
|
||||
|
||||
|
48
test/decompiler/reference/jak2/levels/city/common/traffic-engine-h_REF.gc
generated
vendored
48
test/decompiler/reference/jak2/levels/city/common/traffic-engine-h_REF.gc
generated
vendored
@ -203,9 +203,9 @@
|
||||
:size-assert #x40
|
||||
:flag-assert #xe00000040
|
||||
(:methods
|
||||
(grid-info-method-9 (_type_) none 9)
|
||||
(grid-info-method-9 (_type_ (pointer bounding-box) int int) none 9)
|
||||
(grid-info-method-10 (_type_ vis-grid-pos vector) none 10)
|
||||
(grid-info-method-11 (_type_) none 11)
|
||||
(grid-info-method-11 (_type_ vis-grid-box vector) none 11)
|
||||
(grid-info-method-12 (_type_ rgba) none 12)
|
||||
(grid-info-method-13 (_type_ vis-grid-pos rgba) none 13)
|
||||
)
|
||||
@ -242,15 +242,15 @@
|
||||
:size-assert #x8c
|
||||
:flag-assert #x130000008c
|
||||
(:methods
|
||||
(city-level-info-method-9 (_type_) none 9)
|
||||
(city-level-info-method-9 (_type_) symbol 9)
|
||||
(city-level-info-method-10 (_type_ vis-ray vector vector) none 10)
|
||||
(city-level-info-method-11 (_type_) none 11)
|
||||
(city-level-info-method-12 (_type_) none 12)
|
||||
(city-level-info-method-11 (_type_ vis-ray) none 11)
|
||||
(city-level-info-method-12 (_type_ vector nav-branch vector) vector 12)
|
||||
(city-level-info-method-13 (_type_ vector) none 13)
|
||||
(city-level-info-method-14 (_type_) none 14)
|
||||
(city-level-info-method-15 (_type_) none 15)
|
||||
(city-level-info-method-16 (_type_) none 16)
|
||||
(city-level-info-method-17 (_type_) none 17)
|
||||
(city-level-info-method-14 (_type_ vis-grid-box) vis-cell 14)
|
||||
(city-level-info-method-15 (_type_ int int) symbol 15)
|
||||
(city-level-info-method-16 (_type_ vector int traffic-find-segment-struct (function traffic-find-segment-struct object none)) none 16)
|
||||
(city-level-info-method-17 (_type_ traffic-engine) none 17)
|
||||
(city-level-info-method-18 (_type_) none 18)
|
||||
)
|
||||
)
|
||||
@ -291,7 +291,7 @@
|
||||
(traffic-level-data-method-10 (_type_ vis-cell) none 10)
|
||||
(traffic-level-data-method-11 (_type_ int) none 11)
|
||||
(traffic-level-data-method-12 (_type_ vis-cell) none 12)
|
||||
(traffic-level-data-method-13 (_type_) none 13)
|
||||
(traffic-level-data-method-13 (_type_) vis-cell 13)
|
||||
(traffic-level-data-method-14 (_type_) none 14)
|
||||
)
|
||||
)
|
||||
@ -614,7 +614,7 @@
|
||||
(:methods
|
||||
(traffic-suppressor-method-9 (_type_) none 9)
|
||||
(traffic-suppressor-method-10 (_type_ traffic-suppression-params) none 10)
|
||||
(traffic-suppressor-method-11 (_type_ traffic-suppression-params) none 11)
|
||||
(traffic-suppressor-method-11 (_type_ int) none 11)
|
||||
(traffic-suppressor-method-12 (_type_ traffic-suppression-params) none 12)
|
||||
(traffic-suppressor-method-13 (_type_) none 13)
|
||||
)
|
||||
@ -662,7 +662,7 @@
|
||||
(traffic-tracker-method-19 (_type_ handle) none 19)
|
||||
(traffic-tracker-method-20 (_type_ int symbol) none 20)
|
||||
(traffic-tracker-method-21 (_type_ traffic-object-spawn-params) none 21)
|
||||
(traffic-tracker-method-22 (_type_ object nav-segment int) none 22)
|
||||
(traffic-tracker-method-22 (_type_ int nav-segment float) none 22)
|
||||
(traffic-tracker-method-23 (_type_ traffic-object-spawn-params) none 23)
|
||||
(traffic-tracker-method-24 (_type_ uint traffic-engine) none 24)
|
||||
(traffic-tracker-method-25 (_type_ (function process-focusable traffic-object-type-info none)) none 25)
|
||||
@ -704,7 +704,7 @@
|
||||
(level-data-array traffic-level-data 2 :inline :offset-assert 1040)
|
||||
(object-type-info-array traffic-object-type-info 21 :inline :offset-assert 5200)
|
||||
(tracker-array traffic-tracker 2 :inline :offset-assert 5872)
|
||||
(inactive-object-array uint64 420 :offset-assert 8176)
|
||||
(inactive-object-array handle 420 :offset-assert 8176)
|
||||
(suppressor traffic-suppressor :inline :offset-assert 11536)
|
||||
(danger-sphere-count int8 :offset-assert 12096)
|
||||
(pad int8 15 :offset-assert 12097)
|
||||
@ -720,8 +720,8 @@
|
||||
(traffic-engine-method-12 (_type_) none 12)
|
||||
(add-object (_type_ int process) none 13)
|
||||
(traffic-engine-method-14 (_type_ object object) symbol 14)
|
||||
(traffic-engine-method-15 (_type_ object int) none 15)
|
||||
(traffic-engine-method-16 (_type_ object int) none 16)
|
||||
(traffic-engine-method-15 (_type_ nav-segment float) none 15)
|
||||
(traffic-engine-method-16 (_type_ nav-segment float) none 16)
|
||||
(traffic-engine-method-17 (_type_ nav-branch) symbol 17)
|
||||
(child-killed (_type_ process) none 18)
|
||||
(traffic-engine-method-19 (_type_ object) none 19)
|
||||
@ -732,7 +732,7 @@
|
||||
(set-target-level (_type_ float) none 24)
|
||||
(set-guard-target-level (_type_ float) none 25)
|
||||
(deactivate-all (_type_) none 26)
|
||||
(deactivate-by-type (_type_ object) none 27)
|
||||
(deactivate-by-type (_type_ int) none 27)
|
||||
(traffic-engine-method-28 (_type_) symbol 28)
|
||||
(restore-default-settings (_type_) none 29)
|
||||
(increase-alert-level (_type_ object target) none 30)
|
||||
@ -740,15 +740,15 @@
|
||||
(set-alert-level (_type_ object) none 32)
|
||||
(set-max-alert-level (_type_ object) none 33)
|
||||
(set-alert-duration (_type_ object) none 34)
|
||||
(get-alert-level (_type_) none 35)
|
||||
(get-alert-level (_type_) symbol 35)
|
||||
(get-target (_type_) target 36)
|
||||
(set-object-target-level (_type_ int float) none 37)
|
||||
(set-object-target-count (_type_ int int) none 38)
|
||||
(set-object-reserve-count (_type_ int uint) none 39)
|
||||
(get-object-reserve-count (_type_ int) none 40)
|
||||
(get-object-remaining-count (_type_ int) none 41)
|
||||
(activate-object (_type_ object) none 42)
|
||||
(traffic-engine-method-43 (_type_) none 43)
|
||||
(get-object-reserve-count (_type_ int) int 40)
|
||||
(get-object-remaining-count (_type_ int) int 41)
|
||||
(activate-object (_type_ traffic-object-spawn-params) none 42)
|
||||
(traffic-engine-method-43 (_type_ traffic-object-spawn-params) none 43)
|
||||
(traffic-engine-method-44 (_type_ int float) none 44)
|
||||
(traffic-engine-method-45 (_type_) int 45)
|
||||
(new-suppression-box (_type_ object) none 46)
|
||||
@ -765,9 +765,9 @@
|
||||
(set-guard-target-count-range (_type_ int int int) none 57)
|
||||
(set-object-auto-activate (_type_ object object) none 58)
|
||||
(traffic-engine-method-59 (_type_ object int) none 59)
|
||||
(kill-traffic-sphere (_type_ object) none 60)
|
||||
(level-loaded (_type_ object) none 61)
|
||||
(level-killed (_type_) none 62)
|
||||
(kill-traffic-sphere (_type_ sphere) none 60)
|
||||
(level-loaded (_type_ level) none 61)
|
||||
(level-killed (_type_ level) none 62)
|
||||
(traffic-engine-method-63 (_type_) none 63)
|
||||
(traffic-engine-method-64 (_type_) none 64)
|
||||
(traffic-engine-method-65 (_type_ vis-cell) none 65)
|
||||
|
919
test/decompiler/reference/jak2/levels/city/common/traffic-manager_REF.gc
generated
vendored
Normal file
919
test/decompiler/reference/jak2/levels/city/common/traffic-manager_REF.gc
generated
vendored
Normal file
@ -0,0 +1,919 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; definition for symbol *traffic-engine*, type traffic-engine
|
||||
(define *traffic-engine* (the-as traffic-engine #f))
|
||||
|
||||
;; definition for symbol *traffic-fast-spawn*, type symbol
|
||||
(define *traffic-fast-spawn* #f)
|
||||
|
||||
;; definition of type traffic-manager
|
||||
(deftype traffic-manager (process)
|
||||
((traffic-engine traffic-engine :offset-assert 128)
|
||||
(fast-spawn basic :offset-assert 132)
|
||||
(dark-guard-ratio int32 :offset-assert 136)
|
||||
(spawn-params traffic-object-spawn-params :inline :offset-assert 144)
|
||||
)
|
||||
:heap-base #x80
|
||||
:method-count-assert 22
|
||||
:size-assert #xf8
|
||||
:flag-assert #x16008000f8
|
||||
(:methods
|
||||
(idle () _type_ :state 14)
|
||||
(active () _type_ :state 15)
|
||||
(traffic-manager-method-16 (_type_) none 16)
|
||||
(spawn-all (_type_) none 17)
|
||||
(traffic-manager-method-18 (_type_) none 18)
|
||||
(kill-all (_type_) none 19)
|
||||
(traffic-manager-method-20 (_type_) none 20)
|
||||
(traffic-manager-method-21 (_type_) none 21)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type traffic-manager
|
||||
(defmethod inspect traffic-manager ((obj traffic-manager))
|
||||
(when (not obj)
|
||||
(set! obj obj)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(let ((t9-0 (method-of-type process inspect)))
|
||||
(t9-0 obj)
|
||||
)
|
||||
(format #t "~2Ttraffic-engine: ~A~%" (-> obj traffic-engine))
|
||||
(format #t "~2Tfast-spawn: ~A~%" (-> obj fast-spawn))
|
||||
(format #t "~2Tdark-guard-ratio: ~D~%" (-> obj dark-guard-ratio))
|
||||
(format #t "~2Tspawn-params: #<traffic-object-spawn-params @ #x~X>~%" (-> obj spawn-params))
|
||||
(label cfg-4)
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition for function draw-city-info
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defun draw-city-info ((arg0 city-level-info) (arg1 vis-grid-pos))
|
||||
"@unused - but would be cool to revive! TODO"
|
||||
(let ((v1-0 (-> arg0 grid-info box)))
|
||||
(add-debug-box #t (bucket-id debug2) (-> v1-0 min) (-> v1-0 max) *color-yellow*)
|
||||
)
|
||||
(grid-info-method-12 (-> arg0 grid-info) *color-gray*)
|
||||
(grid-info-method-13 (-> arg0 grid-info) arg1 *color-red*)
|
||||
(let* ((v1-8 (+ (-> arg1 x)
|
||||
(* (-> arg1 z) (-> arg0 grid-info dimension-array 0))
|
||||
(* (* (-> arg1 y) (-> arg0 grid-info dimension-array 0)) (-> arg0 grid-info dimension-array 2))
|
||||
)
|
||||
)
|
||||
(v1-10 (-> arg0 cell-array v1-8))
|
||||
)
|
||||
(add-debug-sphere #t (bucket-id debug2) (-> v1-10 sphere) (-> v1-10 sphere r) *color-green*)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 16 of type traffic-manager
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod traffic-manager-method-16 traffic-manager ((obj traffic-manager))
|
||||
(traffic-engine-method-9 (-> obj traffic-engine))
|
||||
(traffic-manager-method-18 obj)
|
||||
(spawn-all obj)
|
||||
(if *debug-segment*
|
||||
(traffic-engine-method-12 (-> obj traffic-engine))
|
||||
)
|
||||
(if *display-traffic-height-map*
|
||||
(xz-height-map-method-13 *traffic-height-map* (target-pos 0))
|
||||
)
|
||||
(when *display-trail-graph*
|
||||
(let ((a0-7 *trail-graph*))
|
||||
(if a0-7
|
||||
(debug-draw a0-7)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 18 of type traffic-manager
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod traffic-manager-method-18 traffic-manager ((obj traffic-manager))
|
||||
(let ((s5-0 0))
|
||||
(while (< (the-as uint s5-0) (the-as uint 21))
|
||||
(let ((v1-2 (-> obj traffic-engine object-type-info-array s5-0)))
|
||||
(when (logtest? (-> v1-2 flags) 2)
|
||||
(let ((a0-5 (+ (-> v1-2 active-count) (-> v1-2 inactive-count))))
|
||||
(when (< (-> v1-2 want-count) a0-5)
|
||||
(let ((a0-10 (handle->process
|
||||
(traffic-tracker-method-15 (-> obj traffic-engine tracker-array (-> v1-2 tracker-index)) s5-0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if a0-10
|
||||
(deactivate a0-10)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(+! s5-0 1)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 19 of type traffic-manager
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod kill-all traffic-manager ((obj traffic-manager))
|
||||
(let ((s5-0 0))
|
||||
(while (< (the-as uint s5-0) (the-as uint 21))
|
||||
(let ((s4-0 (-> obj traffic-engine object-type-info-array s5-0)))
|
||||
(countdown (s3-0 (-> s4-0 inactive-count))
|
||||
(let ((a0-6 (handle->process
|
||||
(traffic-tracker-method-15 (-> obj traffic-engine tracker-array (-> s4-0 tracker-index)) s5-0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if a0-6
|
||||
(deactivate a0-6)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(+! s5-0 1)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 17 of type traffic-manager
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod spawn-all traffic-manager ((obj traffic-manager))
|
||||
(let ((s5-0 0))
|
||||
(b! #t cfg-4 :delay (nop!))
|
||||
(label cfg-1)
|
||||
(let ((s4-0 (-> obj traffic-engine object-type-info-array s5-0)))
|
||||
(set! (-> s4-0 flags) (logand -9 (-> s4-0 flags)))
|
||||
(if (= (level-status *level* (the-as symbol (-> s4-0 level))) 'active)
|
||||
(logior! (-> s4-0 flags) 8)
|
||||
)
|
||||
)
|
||||
(+! s5-0 1)
|
||||
(label cfg-4)
|
||||
(b! (< s5-0 21) cfg-1)
|
||||
)
|
||||
(let ((s5-1 1)
|
||||
(s4-1 0)
|
||||
(s3-1 #x1fffff)
|
||||
)
|
||||
(if (-> obj fast-spawn)
|
||||
(set! s5-1 120)
|
||||
)
|
||||
(b! #t cfg-36 :delay (nop!))
|
||||
(label cfg-8)
|
||||
(let* ((s2-0 (-> obj spawn-params))
|
||||
(s1-0 (-> s2-0 object-type))
|
||||
)
|
||||
(when (logtest? s3-1 (ash 1 s1-0))
|
||||
(let ((s0-0 (-> obj traffic-engine object-type-info-array s1-0)))
|
||||
(let ((v1-21 (+ (-> s0-0 active-count) (-> s0-0 inactive-count))))
|
||||
(b!
|
||||
(not (and (logtest? (-> s0-0 flags) 2) (logtest? (-> s0-0 flags) 8) (< v1-21 (-> s0-0 want-count))))
|
||||
cfg-29
|
||||
:delay (nop!)
|
||||
)
|
||||
(set! (-> s2-0 flags) (logand -9 (-> s2-0 flags)))
|
||||
(b!
|
||||
(not (and (= (-> s2-0 object-type) 6)
|
||||
(> (-> obj dark-guard-ratio) 0)
|
||||
(zero? (mod v1-21 (-> obj dark-guard-ratio)))
|
||||
)
|
||||
)
|
||||
cfg-25
|
||||
:delay (empty-form)
|
||||
)
|
||||
)
|
||||
(logior! (-> s2-0 flags) 8)
|
||||
(label cfg-25)
|
||||
(let ((a2-0 (traffic-object-spawn obj s2-0)))
|
||||
(b! (not a2-0) cfg-27 :delay (nop!))
|
||||
(add-object (-> obj traffic-engine) (the-as int s1-0) a2-0)
|
||||
)
|
||||
(+! (-> s0-0 reserve-count) -1)
|
||||
)
|
||||
(+! (-> s2-0 id) 1)
|
||||
(+! s4-1 1)
|
||||
(b! #t cfg-28 :delay (nop!))
|
||||
(label cfg-27)
|
||||
(format #t "traffic-manager: unable to spawn~%")
|
||||
(b! #t cfg-41 :delay (nop!))
|
||||
(label cfg-28)
|
||||
(b! #t cfg-33 :delay (nop!))
|
||||
(label cfg-29)
|
||||
(set! s3-1 (logclear s3-1 (ash 1 s1-0)))
|
||||
)
|
||||
(label cfg-33)
|
||||
(let ((v1-37 (the-as int (+ s1-0 1))))
|
||||
(if (>= (the-as uint v1-37) (the-as uint 21))
|
||||
(set! v1-37 0)
|
||||
)
|
||||
(set! (-> s2-0 object-type) (the-as uint v1-37))
|
||||
)
|
||||
)
|
||||
(label cfg-36)
|
||||
(b! (and (< s4-1 s5-1) (nonzero? s3-1)) cfg-8 :delay (nop!))
|
||||
)
|
||||
(label cfg-41)
|
||||
(set! (-> obj fast-spawn) #f)
|
||||
0
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function vehicle-spawn
|
||||
;; WARN: Return type mismatch process vs process-drawable.
|
||||
(defun vehicle-spawn ((arg0 process) (arg1 type) (arg2 traffic-object-spawn-params))
|
||||
(let ((gp-0 (the-as process #f)))
|
||||
(let* ((s3-0 (get-process *default-dead-pool* arg1 #x4000))
|
||||
(v1-1 (when s3-0
|
||||
(let ((t9-1 (method-of-type process activate)))
|
||||
(t9-1 s3-0 arg0 (symbol->string (-> arg1 symbol)) (the-as pointer #x70004000))
|
||||
)
|
||||
(run-now-in-process s3-0 vehicle-init-by-other arg2)
|
||||
(-> s3-0 ppointer)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if v1-1
|
||||
(set! gp-0 (-> v1-1 0))
|
||||
)
|
||||
)
|
||||
(if (and gp-0 (logtest? (-> arg2 flags) 2))
|
||||
(vehicle-method-137 (the-as vehicle gp-0) arg2)
|
||||
)
|
||||
(the-as process-drawable gp-0)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for function citizen-spawn
|
||||
;; WARN: Return type mismatch process vs process-drawable.
|
||||
(defun citizen-spawn ((arg0 process) (arg1 type) (arg2 traffic-object-spawn-params))
|
||||
(let ((gp-0 (the-as process #f)))
|
||||
(let* ((s3-0 (get-process *default-dead-pool* arg1 #x4000))
|
||||
(v1-1 (when s3-0
|
||||
(let ((t9-1 (method-of-type process activate)))
|
||||
(t9-1 s3-0 arg0 (symbol->string (-> arg1 symbol)) (the-as pointer #x70004000))
|
||||
)
|
||||
(run-now-in-process s3-0 citizen-init-by-other arg2)
|
||||
(-> s3-0 ppointer)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if v1-1
|
||||
(set! gp-0 (-> v1-1 0))
|
||||
)
|
||||
)
|
||||
(the-as process-drawable gp-0)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for function traffic-object-spawn
|
||||
(defun traffic-object-spawn ((arg0 process) (arg1 traffic-object-spawn-params))
|
||||
(let ((v0-0 (the-as process-drawable #f)))
|
||||
(let ((v1-0 (-> arg1 object-type)))
|
||||
(cond
|
||||
((= v1-0 11)
|
||||
(set! v0-0 (vehicle-spawn arg0 bikea arg1))
|
||||
)
|
||||
((= v1-0 12)
|
||||
(set! v0-0 (vehicle-spawn arg0 bikeb arg1))
|
||||
)
|
||||
((= v1-0 13)
|
||||
(set! v0-0 (vehicle-spawn arg0 bikec arg1))
|
||||
)
|
||||
((= v1-0 14)
|
||||
(set! v0-0 (vehicle-spawn arg0 cara arg1))
|
||||
)
|
||||
((= v1-0 15)
|
||||
(set! v0-0 (vehicle-spawn arg0 carb arg1))
|
||||
)
|
||||
((= v1-0 16)
|
||||
(set! v0-0 (vehicle-spawn arg0 carc arg1))
|
||||
)
|
||||
((= v1-0 18)
|
||||
(set! v0-0 (vehicle-spawn arg0 guard-bike arg1))
|
||||
)
|
||||
((= v1-0 19)
|
||||
(set! v0-0 (vehicle-spawn arg0 hellcat arg1))
|
||||
)
|
||||
((zero? v1-0)
|
||||
(set! v0-0 (citizen-spawn arg0 citizen-norm arg1))
|
||||
)
|
||||
((= v1-0 1)
|
||||
(set! v0-0 (citizen-spawn arg0 citizen-chick arg1))
|
||||
)
|
||||
((= v1-0 2)
|
||||
(set! v0-0 (citizen-spawn arg0 citizen-fat arg1))
|
||||
)
|
||||
((= v1-0 3)
|
||||
(set! v0-0 (citizen-spawn arg0 citizen-norm arg1))
|
||||
)
|
||||
((= v1-0 10)
|
||||
(set! v0-0 (citizen-spawn arg0 metalhead-predator arg1))
|
||||
)
|
||||
((= v1-0 8)
|
||||
(set! v0-0 (citizen-spawn arg0 metalhead-grunt arg1))
|
||||
)
|
||||
((= v1-0 9)
|
||||
(set! v0-0 (citizen-spawn arg0 metalhead-flitter arg1))
|
||||
)
|
||||
((= v1-0 6)
|
||||
(set! v0-0 (citizen-spawn arg0 crimson-guard arg1))
|
||||
)
|
||||
((= v1-0 4)
|
||||
(set! v0-0 (citizen-spawn arg0 crimson-guard arg1))
|
||||
)
|
||||
)
|
||||
)
|
||||
v0-0
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for function type-from-vehicle-type
|
||||
(defun type-from-vehicle-type ((arg0 vehicle-type))
|
||||
(case arg0
|
||||
(((vehicle-type bikea))
|
||||
bikea
|
||||
)
|
||||
(((vehicle-type bikeb))
|
||||
bikeb
|
||||
)
|
||||
(((vehicle-type bikec))
|
||||
bikec
|
||||
)
|
||||
(((vehicle-type cara))
|
||||
cara
|
||||
)
|
||||
(((vehicle-type carb))
|
||||
carb
|
||||
)
|
||||
(((vehicle-type carc))
|
||||
carc
|
||||
)
|
||||
(((vehicle-type guard-bike))
|
||||
guard-bike
|
||||
)
|
||||
(((vehicle-type hellcat))
|
||||
hellcat
|
||||
)
|
||||
(((vehicle-type evan-test-bike))
|
||||
evan-test-bike
|
||||
)
|
||||
(((vehicle-type test-bike))
|
||||
test-bike
|
||||
)
|
||||
(((vehicle-type test-car))
|
||||
test-car
|
||||
)
|
||||
(else
|
||||
bikea
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 20 of type traffic-manager
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod traffic-manager-method-20 traffic-manager ((obj traffic-manager))
|
||||
(set! (-> obj traffic-engine) *traffic-engine*)
|
||||
(traffic-engine-method-10 (-> obj traffic-engine) obj)
|
||||
(restore-city-speeches)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 7 of type traffic-manager
|
||||
;; WARN: Return type mismatch process vs traffic-manager.
|
||||
(defmethod relocate traffic-manager ((obj traffic-manager) (arg0 int))
|
||||
(set! *traffic-manager* obj)
|
||||
(if *traffic-manager*
|
||||
(set! *traffic-manager* (&+ *traffic-manager* arg0))
|
||||
)
|
||||
(the-as traffic-manager ((method-of-type process relocate) obj arg0))
|
||||
)
|
||||
|
||||
;; definition for method 10 of type traffic-manager
|
||||
(defmethod deactivate traffic-manager ((obj traffic-manager))
|
||||
(traffic-engine-method-11 (-> obj traffic-engine))
|
||||
(set! *traffic-manager* #f)
|
||||
(remove-setting *setting-control* obj 'task-mask)
|
||||
(apply-settings *setting-control*)
|
||||
(speech-control-method-9 *speech-control*)
|
||||
((method-of-type process deactivate) obj)
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 21 of type traffic-manager
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod traffic-manager-method-21 traffic-manager ((obj traffic-manager))
|
||||
(let ((s5-0 (new 'stack-no-clear 'array 'int8 21)))
|
||||
(set! (-> s5-0 11) 8)
|
||||
(set! (-> s5-0 12) 8)
|
||||
(set! (-> s5-0 13) 8)
|
||||
(set! (-> s5-0 14) 7)
|
||||
(set! (-> s5-0 15) 7)
|
||||
(set! (-> s5-0 16) 7)
|
||||
(set! (-> s5-0 18) 4)
|
||||
(set! (-> s5-0 19) 3)
|
||||
(set! (-> s5-0 20) 0)
|
||||
(set! (-> s5-0 0) 15)
|
||||
(set! (-> s5-0 1) 15)
|
||||
(set! (-> s5-0 2) 14)
|
||||
(set! (-> s5-0 3) 1)
|
||||
(set! (-> s5-0 4) 1)
|
||||
(set! (-> s5-0 6) 9)
|
||||
(set! (-> s5-0 7) 0)
|
||||
(set! (-> s5-0 8) 14)
|
||||
(set! (-> s5-0 9) 14)
|
||||
(set! (-> s5-0 10) 14)
|
||||
(set! (-> obj fast-spawn) (the-as basic *traffic-fast-spawn*))
|
||||
(traffic-manager-method-20 obj)
|
||||
(let ((v1-20 (-> obj traffic-engine)))
|
||||
(dotimes (a0-2 21)
|
||||
(set! (-> v1-20 object-type-info-array a0-2 want-count) (-> s5-0 a0-2))
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((s5-1 (-> obj spawn-params)))
|
||||
(set! (-> s5-1 object-type) (the-as uint 6))
|
||||
(set! (-> s5-1 behavior) (the-as uint 1))
|
||||
(set! (-> s5-1 id) (the-as uint 0))
|
||||
(set! (-> s5-1 nav-mesh) #f)
|
||||
(set! (-> s5-1 nav-branch) #f)
|
||||
(set! (-> s5-1 proc) #f)
|
||||
(set! (-> s5-1 handle) (the-as uint #f))
|
||||
(set! (-> s5-1 user-data) (the-as uint 0))
|
||||
(set! (-> s5-1 flags) (the-as uint 2))
|
||||
(set! (-> s5-1 guard-type) (the-as uint 7))
|
||||
(vector-reset! (-> s5-1 velocity))
|
||||
(vector-reset! (-> s5-1 position))
|
||||
(forward-up-nopitch->quaternion
|
||||
(-> s5-1 rotation)
|
||||
(new 'static 'vector :z 1.0 :w 1.0)
|
||||
(new 'static 'vector :y 1.0 :w 1.0)
|
||||
)
|
||||
(set! (-> s5-1 id) (the-as uint 1))
|
||||
)
|
||||
(set! (-> obj dark-guard-ratio) (if (task-node-closed? (game-task-node tomb-boss-resolution))
|
||||
5
|
||||
0
|
||||
)
|
||||
)
|
||||
(restore-default-settings (-> obj traffic-engine))
|
||||
(set! *traffic-manager* obj)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function traffic-manager-event-handler
|
||||
(defbehavior traffic-manager-event-handler traffic-manager ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
||||
(let ((gp-0 (the-as object #t)))
|
||||
(case arg2
|
||||
(('child-killed)
|
||||
(child-killed (-> self traffic-engine) arg0)
|
||||
)
|
||||
(('increase-alert-level)
|
||||
(when *target*
|
||||
(let ((a1-4 (-> arg3 param 0)))
|
||||
(increase-alert-level (-> self traffic-engine) a1-4 *target*)
|
||||
)
|
||||
)
|
||||
)
|
||||
(('decrease-alert-level)
|
||||
(let ((a1-5 (-> arg3 param 0)))
|
||||
(decrease-alert-level (-> self traffic-engine) a1-5)
|
||||
)
|
||||
)
|
||||
(('set-alert-level)
|
||||
(let ((a1-6 (-> arg3 param 0)))
|
||||
(set-alert-level (-> self traffic-engine) a1-6)
|
||||
)
|
||||
)
|
||||
(('set-max-alert-level)
|
||||
(let ((a1-7 (-> arg3 param 0)))
|
||||
(set-max-alert-level (-> self traffic-engine) a1-7)
|
||||
)
|
||||
)
|
||||
(('get-alert-level)
|
||||
(set! gp-0 (get-alert-level (-> self traffic-engine)))
|
||||
)
|
||||
(('set-alert-duration)
|
||||
(let ((a1-8 (-> arg3 param 0)))
|
||||
(set-alert-duration (-> self traffic-engine) a1-8)
|
||||
)
|
||||
)
|
||||
(('deactivate-all)
|
||||
(deactivate-all (-> self traffic-engine))
|
||||
)
|
||||
(('set-target-level)
|
||||
(let ((f0-0 (the-as float (-> arg3 param 0))))
|
||||
(set-target-level (-> self traffic-engine) f0-0)
|
||||
)
|
||||
)
|
||||
(('set-guard-target-level)
|
||||
(let ((f0-1 (the-as float (-> arg3 param 0))))
|
||||
(set-guard-target-level (-> self traffic-engine) f0-1)
|
||||
)
|
||||
)
|
||||
(('restore-default-settings)
|
||||
(restore-default-settings (-> self traffic-engine))
|
||||
)
|
||||
(('add-danger-sphere)
|
||||
(let ((a1-11 (-> arg3 param 0)))
|
||||
(add-danger-sphere (-> self traffic-engine) (the-as traffic-danger-info a1-11))
|
||||
)
|
||||
)
|
||||
(('spawn-object)
|
||||
(let ((s5-0 (the-as traffic-object-spawn-params (-> arg3 param 0))))
|
||||
(set! (-> s5-0 proc) (traffic-object-spawn self s5-0))
|
||||
)
|
||||
)
|
||||
(('activate-object)
|
||||
(let ((a1-13 (-> arg3 param 0)))
|
||||
(activate-object (-> self traffic-engine) (the-as traffic-object-spawn-params a1-13))
|
||||
)
|
||||
)
|
||||
(('get-object-remaining-count)
|
||||
(let ((a1-14 (-> arg3 param 0)))
|
||||
(set! gp-0 (get-object-remaining-count (-> self traffic-engine) (the-as int a1-14)))
|
||||
)
|
||||
)
|
||||
(('set-object-reserve-count)
|
||||
(let ((a1-15 (-> arg3 param 0))
|
||||
(a2-2 (-> arg3 param 1))
|
||||
)
|
||||
(set-object-reserve-count (-> self traffic-engine) (the-as int a1-15) a2-2)
|
||||
)
|
||||
)
|
||||
(('get-object-reserve-count)
|
||||
(let ((a1-16 (-> arg3 param 0)))
|
||||
(set! gp-0 (get-object-reserve-count (-> self traffic-engine) (the-as int a1-16)))
|
||||
)
|
||||
)
|
||||
(('set-object-target-level)
|
||||
(let ((a1-17 (-> arg3 param 0))
|
||||
(f0-2 (the-as float (-> arg3 param 1)))
|
||||
)
|
||||
(set-object-target-level (-> self traffic-engine) (the-as int a1-17) f0-2)
|
||||
)
|
||||
)
|
||||
(('set-object-target-count)
|
||||
(let ((a1-18 (-> arg3 param 0))
|
||||
(a2-4 (-> arg3 param 1))
|
||||
)
|
||||
(set-object-target-count (-> self traffic-engine) (the-as int a1-18) (the-as int a2-4))
|
||||
)
|
||||
)
|
||||
(('set-guard-target-count-range)
|
||||
(let ((a1-19 (-> arg3 param 0))
|
||||
(a2-5 (-> arg3 param 1))
|
||||
(a3-1 (-> arg3 param 2))
|
||||
)
|
||||
(set-guard-target-count-range (-> self traffic-engine) (the-as int a1-19) (the-as int a2-5) (the-as int a3-1))
|
||||
)
|
||||
)
|
||||
(('deactivate-by-type)
|
||||
(let ((a1-20 (-> arg3 param 0)))
|
||||
(deactivate-by-type (-> self traffic-engine) (the-as int a1-20))
|
||||
)
|
||||
)
|
||||
(('new-suppression-box)
|
||||
(let ((a1-21 (-> arg3 param 0)))
|
||||
(new-suppression-box (-> self traffic-engine) a1-21)
|
||||
)
|
||||
)
|
||||
(('update-suppression-box)
|
||||
(let ((a1-22 (-> arg3 param 0)))
|
||||
(update-suppression-box (-> self traffic-engine) (the-as traffic-suppression-params a1-22))
|
||||
)
|
||||
)
|
||||
(('kill-traffic-sphere)
|
||||
(let ((a1-23 (-> arg3 param 0)))
|
||||
(kill-traffic-sphere (-> self traffic-engine) (the-as sphere a1-23))
|
||||
)
|
||||
)
|
||||
(('set-guard-multi-focus)
|
||||
(let ((a0-74 (-> arg3 param 0))
|
||||
(v1-29 (-> self traffic-engine alert-state))
|
||||
)
|
||||
(if a0-74
|
||||
(logior! (-> v1-29 flags) (traffic-alert-flag guard-multi-focus))
|
||||
(logclear! (-> v1-29 flags) (traffic-alert-flag guard-multi-focus))
|
||||
)
|
||||
)
|
||||
)
|
||||
(('set-disable-pursuit-control)
|
||||
(let ((a0-80 (-> arg3 param 0))
|
||||
(v1-31 (-> self traffic-engine alert-state))
|
||||
)
|
||||
(if a0-80
|
||||
(logior! (-> v1-31 flags) (traffic-alert-flag disable-pursuit-control))
|
||||
(logclear! (-> v1-31 flags) (traffic-alert-flag disable-pursuit-control))
|
||||
)
|
||||
)
|
||||
)
|
||||
(('set-object-auto-activate)
|
||||
(let ((a1-26 (-> arg3 param 0))
|
||||
(a2-6 (-> arg3 param 1))
|
||||
)
|
||||
(set-object-auto-activate (-> self traffic-engine) a1-26 a2-6)
|
||||
)
|
||||
)
|
||||
(('set-guard-force-visible)
|
||||
(let ((a0-89 (-> arg3 param 0))
|
||||
(v1-34 (-> self traffic-engine alert-state target-status-array))
|
||||
)
|
||||
(if a0-89
|
||||
(logior! (-> v1-34 0 flags) (traffic-target-flag force-visible))
|
||||
(logclear! (-> v1-34 0 flags) (traffic-target-flag force-visible))
|
||||
)
|
||||
)
|
||||
)
|
||||
(('end-pursuit-by-type)
|
||||
(let ((a1-28 (-> arg3 param 0)))
|
||||
(end-pursuit-by-type (-> self traffic-engine) (the-as int a1-28))
|
||||
)
|
||||
)
|
||||
(('level-loaded)
|
||||
(let ((a1-29 (-> arg3 param 0)))
|
||||
(level-loaded (-> self traffic-engine) (the-as level a1-29))
|
||||
)
|
||||
)
|
||||
(('level-killed)
|
||||
(let ((s5-1 (the-as object (-> arg3 param 0))))
|
||||
(level-killed (-> self traffic-engine) (the-as level s5-1))
|
||||
(format #t "traffic-manager : level killed ~S~%" (-> (the-as level s5-1) nickname))
|
||||
)
|
||||
)
|
||||
(('add-object)
|
||||
(let ((a1-32 (-> arg3 param 0))
|
||||
(a2-8 (-> arg3 param 1))
|
||||
)
|
||||
(add-object (-> self traffic-engine) (the-as int a1-32) (the-as process a2-8))
|
||||
)
|
||||
)
|
||||
(('kill-all)
|
||||
(format #t "traffic-manager::kill-all~%")
|
||||
(deactivate-all (-> self traffic-engine))
|
||||
(kill-all self)
|
||||
)
|
||||
(('spawn-all)
|
||||
(format #t "traffic-manager::spawn-all~%")
|
||||
(set! (-> self fast-spawn) (the-as basic #t))
|
||||
(spawn-all self)
|
||||
)
|
||||
(('set-density-factor)
|
||||
(let ((f0-3 (the-as float (-> arg3 param 0))))
|
||||
(set! (-> self traffic-engine inv-density-factor) (/ 5.0 f0-3))
|
||||
)
|
||||
)
|
||||
(('rider-off)
|
||||
(let ((s5-2 (-> self child)))
|
||||
(while s5-2
|
||||
(send-event (ppointer->process s5-2) 'rider-off)
|
||||
(set! s5-2 (-> s5-2 0 brother))
|
||||
)
|
||||
)
|
||||
)
|
||||
(('rider-on)
|
||||
(let ((s5-3 (-> self child)))
|
||||
(while s5-3
|
||||
(send-event (ppointer->process s5-3) 'rider-on)
|
||||
(set! s5-3 (-> s5-3 0 brother))
|
||||
)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(set! gp-0 #f)
|
||||
)
|
||||
)
|
||||
gp-0
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for function traffic-manager-init-by-other
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defbehavior traffic-manager-init-by-other traffic-manager ()
|
||||
(stack-size-set! (-> self main-thread) 128)
|
||||
(ctywide-entity-hack)
|
||||
(traffic-manager-method-21 self)
|
||||
(add-setting! 'task-mask 'clear 0 #x4000)
|
||||
(set! (-> self event-hook) traffic-manager-event-handler)
|
||||
(rigid-body-queue-manager-spawn *traffic-rigid-body-queue* self)
|
||||
(go-virtual idle)
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function traffic-start
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defun traffic-start ()
|
||||
(kill-by-type traffic-manager *active-pool*)
|
||||
(process-spawn traffic-manager :from *city-dead-pool* :to *entity-pool*)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function traffic-kill
|
||||
;; WARN: Return type mismatch symbol vs none.
|
||||
(defun traffic-kill ()
|
||||
(kill-by-type traffic-manager *active-pool*)
|
||||
(none)
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(defstate idle (traffic-manager)
|
||||
:virtual #t
|
||||
:event traffic-manager-event-handler
|
||||
:enter (behavior ()
|
||||
(spawn-all self)
|
||||
(none)
|
||||
)
|
||||
:code (behavior ()
|
||||
(suspend)
|
||||
(suspend)
|
||||
(go-virtual active)
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(defstate active (traffic-manager)
|
||||
:virtual #t
|
||||
:event traffic-manager-event-handler
|
||||
:code (the-as (function none :behavior traffic-manager) sleep-code)
|
||||
:post (behavior ()
|
||||
(traffic-manager-method-16 self)
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for function riders-on
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defun riders-on ()
|
||||
(send-event *traffic-manager* 'rider-on)
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function riders-off
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defun riders-off ()
|
||||
(send-event *traffic-manager* 'rider-off)
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function ctywide-login
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defun ctywide-login ()
|
||||
(format 0 "citywide-login~%")
|
||||
(set! *traffic-engine* (new 'loading-level 'traffic-engine))
|
||||
(init *city-dead-pool* 'loading-level #x8000)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function ctywide-activate
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defun ctywide-activate ((arg0 level) (arg1 symbol))
|
||||
(when (zero? (-> arg0 entity length))
|
||||
(format 0 "ERROR: ctywide-activate: level ~s has no entities!!" (-> arg0 name))
|
||||
(break!)
|
||||
0
|
||||
)
|
||||
(set! *ctywide-entity* (-> arg0 entity data 0 entity))
|
||||
(set! *traffic-fast-spawn* (or (= arg1 'life) (= arg1 'debug)))
|
||||
(if (and (= arg1 'debug) (not *spawn-actors*))
|
||||
(traffic-kill)
|
||||
(traffic-start)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for symbol *traffic-alert-level-force*, type symbol
|
||||
(define *traffic-alert-level-force* #f)
|
||||
|
||||
;; definition for function lwide-activate
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defun lwide-activate ((arg0 level) (arg1 symbol))
|
||||
(format #t "lwide-activate~%")
|
||||
(set! *lwide-entity* (-> arg0 entity data 0 entity))
|
||||
(let ((gp-0 *traffic-engine*))
|
||||
(when gp-0
|
||||
(case (-> arg0 name)
|
||||
(('lwidea)
|
||||
(set! (-> gp-0 object-type-info-array 0 level) (the-as level 'lwidea))
|
||||
(set! (-> gp-0 object-type-info-array 1 level) (the-as level 'lwidea))
|
||||
(set! (-> gp-0 object-type-info-array 2 level) (the-as level 'lwidea))
|
||||
(set! (-> gp-0 object-type-info-array 3 level) (the-as level 'lwidea))
|
||||
(set! (-> gp-0 object-type-info-array 4 level) (the-as level 'lwidea))
|
||||
(set! (-> gp-0 object-type-info-array 5 level) #f)
|
||||
(set! (-> gp-0 object-type-info-array 6 level) (the-as level 'lwidea))
|
||||
(set! (-> gp-0 object-type-info-array 7 level) #f)
|
||||
(set! (-> gp-0 object-type-info-array 8 level) #f)
|
||||
(set! (-> gp-0 object-type-info-array 9 level) #f)
|
||||
(set! (-> gp-0 object-type-info-array 10 level) #f)
|
||||
(set! (-> gp-0 object-type-info-array 11 level) (the-as level 'lwidea))
|
||||
(set! (-> gp-0 object-type-info-array 12 level) (the-as level 'lwidea))
|
||||
(set! (-> gp-0 object-type-info-array 13 level) (the-as level 'lwidea))
|
||||
(set! (-> gp-0 object-type-info-array 14 level) (the-as level 'lwidea))
|
||||
(set! (-> gp-0 object-type-info-array 15 level) (the-as level 'lwidea))
|
||||
(set! (-> gp-0 object-type-info-array 16 level) (the-as level 'lwidea))
|
||||
(set! (-> gp-0 object-type-info-array 17 level) #f)
|
||||
(set! (-> gp-0 object-type-info-array 18 level) (the-as level 'lwidea))
|
||||
(set! (-> gp-0 object-type-info-array 19 level) (the-as level 'lwidea))
|
||||
(logior! (-> gp-0 alert-state flags) (traffic-alert-flag target-jak))
|
||||
(set! *traffic-alert-level-force* #f)
|
||||
)
|
||||
(('lwideb)
|
||||
(set! (-> gp-0 object-type-info-array 0 level) (the-as level 'lwideb))
|
||||
(set! (-> gp-0 object-type-info-array 1 level) #f)
|
||||
(set! (-> gp-0 object-type-info-array 2 level) #f)
|
||||
(set! (-> gp-0 object-type-info-array 3 level) (the-as level 'lwideb))
|
||||
(set! (-> gp-0 object-type-info-array 4 level) (the-as level 'lwideb))
|
||||
(set! (-> gp-0 object-type-info-array 5 level) #f)
|
||||
(set! (-> gp-0 object-type-info-array 6 level) (the-as level 'lwideb))
|
||||
(set! (-> gp-0 object-type-info-array 7 level) #f)
|
||||
(set! (-> gp-0 object-type-info-array 8 level) (the-as level 'lwideb))
|
||||
(set! (-> gp-0 object-type-info-array 9 level) (the-as level 'lwideb))
|
||||
(set! (-> gp-0 object-type-info-array 10 level) (the-as level 'lwideb))
|
||||
(set! (-> gp-0 object-type-info-array 11 level) (the-as level 'lwideb))
|
||||
(set! (-> gp-0 object-type-info-array 12 level) #f)
|
||||
(set! (-> gp-0 object-type-info-array 13 level) #f)
|
||||
(set! (-> gp-0 object-type-info-array 14 level) (the-as level 'lwideb))
|
||||
(set! (-> gp-0 object-type-info-array 15 level) #f)
|
||||
(set! (-> gp-0 object-type-info-array 16 level) #f)
|
||||
(set! (-> gp-0 object-type-info-array 17 level) #f)
|
||||
(set! (-> gp-0 object-type-info-array 18 level) (the-as level 'lwideb))
|
||||
(set! (-> gp-0 object-type-info-array 19 level) #f)
|
||||
(logclear! (-> gp-0 alert-state flags) (traffic-alert-flag target-jak))
|
||||
(set-alert-level gp-0 3)
|
||||
(logior! (-> gp-0 alert-state flags) (traffic-alert-flag guard-multi-focus))
|
||||
(set-alert-duration gp-0 #x6c258c00)
|
||||
(set! *traffic-alert-level-force* #t)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function lwide-deactivate
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defun lwide-deactivate ()
|
||||
(set! *lwide-entity* (the-as object #f))
|
||||
(send-event *traffic-manager* 'kill-all)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function ctywide-deactivate
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defun ctywide-deactivate ()
|
||||
(set! *ctywide-entity* (the-as object #f))
|
||||
(set! *traffic-engine* #f)
|
||||
(set! *trail-graph* #f)
|
||||
(init *city-dead-pool* 'loading-level 0)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function ctywide-entity-hack
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defun ctywide-entity-hack ()
|
||||
(with-pp
|
||||
(cond
|
||||
((and (-> pp entity) (= pp (-> pp entity extra process)))
|
||||
(let ((v1-6 (level-get *level* 'ctywide)))
|
||||
(if v1-6
|
||||
(set! (-> pp level) v1-6)
|
||||
)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(process-entity-set! pp (the-as entity-actor *ctywide-entity*))
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for function lwide-entity-hack
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defun lwide-entity-hack ()
|
||||
(with-pp
|
||||
(process-entity-set! pp (the-as entity-actor *lwide-entity*))
|
||||
0
|
||||
(none)
|
||||
)
|
||||
)
|
1609
test/decompiler/reference/jak2/levels/city/common/vehicle-util_REF.gc
generated
vendored
Normal file
1609
test/decompiler/reference/jak2/levels/city/common/vehicle-util_REF.gc
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
10
test/decompiler/reference/jak2/levels/city/common/vehicle_REF.gc
generated
vendored
10
test/decompiler/reference/jak2/levels/city/common/vehicle_REF.gc
generated
vendored
@ -113,21 +113,21 @@
|
||||
(if (logtest? (-> obj flags) (rigid-body-object-flag player-driving))
|
||||
(cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 1))
|
||||
)
|
||||
(apply-damage obj 1.0 (the-as matrix arg0))
|
||||
(apply-damage obj 1.0 arg0)
|
||||
(vehicle-method-76 obj 2 (the-as uint 300))
|
||||
)
|
||||
((< (* 131072.0 f28-0) (-> arg0 impulse))
|
||||
(if (logtest? (-> obj flags) (rigid-body-object-flag player-driving))
|
||||
(cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.5))
|
||||
)
|
||||
(apply-damage obj 0.25 (the-as matrix arg0))
|
||||
(apply-damage obj 0.25 arg0)
|
||||
(vehicle-method-76 obj 1 (the-as uint 75))
|
||||
)
|
||||
((< (* 102400.0 f28-0) (-> arg0 impulse))
|
||||
(if (logtest? (-> obj flags) (rigid-body-object-flag player-driving))
|
||||
(cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.25))
|
||||
)
|
||||
(apply-damage obj 0.125 (the-as matrix arg0))
|
||||
(apply-damage obj 0.125 arg0)
|
||||
(vehicle-method-76 obj 1 (the-as uint 75))
|
||||
)
|
||||
(else
|
||||
@ -136,7 +136,7 @@
|
||||
(f2-5 (* 16384000.0 f28-0))
|
||||
(f0-10 (fmax f0-9 (* f1-7 (/ 1.0 f2-5))))
|
||||
)
|
||||
(apply-damage obj f0-10 (the-as matrix arg0))
|
||||
(apply-damage obj f0-10 arg0)
|
||||
)
|
||||
(when (< (* 32768.0 f28-0) (-> arg0 impulse))
|
||||
(if (logtest? (-> obj flags) (rigid-body-object-flag player-driving))
|
||||
@ -1649,7 +1649,7 @@
|
||||
)
|
||||
)
|
||||
(set! (-> s5-0 trans x) f0-2)
|
||||
(apply-damage obj (* 0.667 f1-0) s5-0)
|
||||
(apply-damage obj (* 0.667 f1-0) (the-as rigid-body-impact s5-0))
|
||||
)
|
||||
(rigid-body-object-method-42 obj)
|
||||
(let ((s3-1 (new 'stack-no-clear 'vector)))
|
||||
|
Loading…
Reference in New Issue
Block a user