mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 11:26:18 -04:00
d/jak2: finish forest-obs
(#2266)
This commit is contained in:
parent
190fa4bbe8
commit
90d5e83d9e
|
@ -31757,7 +31757,7 @@
|
|||
(temp-edge-list (inline-array mysql-nav-edge) :offset-assert 8)
|
||||
(level-node-index int32 :offset-assert 12)
|
||||
(cam-dist float :offset-assert 16)
|
||||
(visible basic :offset-assert 20)
|
||||
(visible symbol :offset-assert 20)
|
||||
(nav_node_id uint32 :offset-assert 24)
|
||||
(nav_graph_id uint32 :offset-assert 28)
|
||||
(position vector :inline :offset-assert 32)
|
||||
|
@ -35842,7 +35842,6 @@
|
|||
;; hover-nav-edit ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
#|
|
||||
(deftype hover-nav-bsp-point (list-node)
|
||||
((index int32 :offset-assert 8)
|
||||
(pos vector :inline :offset-assert 16)
|
||||
|
@ -35851,9 +35850,7 @@
|
|||
:size-assert #x20
|
||||
:flag-assert #x900000020
|
||||
)
|
||||
|#
|
||||
|
||||
#|
|
||||
(deftype hover-nav-bsp-node (structure)
|
||||
((split-plane vector :inline :offset-assert 0)
|
||||
(point-list hover-nav-bsp-point :offset-assert 16)
|
||||
|
@ -35864,13 +35861,11 @@
|
|||
:size-assert #x1c
|
||||
:flag-assert #xb0000001c
|
||||
(:methods
|
||||
(hover-nav-bsp-node-method-9 () none 9)
|
||||
(hover-nav-bsp-node-method-10 () none 10)
|
||||
(hover-nav-bsp-node-method-9 (_type_) none 9)
|
||||
(hover-nav-bsp-node-method-10 (_type_ int) none 10)
|
||||
)
|
||||
)
|
||||
|#
|
||||
|
||||
#|
|
||||
(deftype hover-nav-bsp (structure)
|
||||
((root hover-nav-bsp-node :offset-assert 0)
|
||||
)
|
||||
|
@ -35878,16 +35873,15 @@
|
|||
:size-assert #x4
|
||||
:flag-assert #x900000004
|
||||
)
|
||||
|#
|
||||
|
||||
;; (define-extern probe-for-clear-collision? function)
|
||||
;; (define-extern hover-nav-graph-process-points function)
|
||||
;; (define-extern hover-nav-graph-output function)
|
||||
;; (define-extern *axes-table* array)
|
||||
;; (define-extern *hover-bsp* object)
|
||||
;; (define-extern hover-nav-graph-output-bsp function)
|
||||
;; (define-extern hover-nav-network-build-bsp function)
|
||||
;; (define-extern hover-nav-bsp-output function)
|
||||
(define-extern probe-for-clear-collision? (function vector vector symbol))
|
||||
(define-extern hover-nav-graph-process-points (function none))
|
||||
(define-extern hover-nav-graph-output (function none))
|
||||
(define-extern *axes-table* (array vector))
|
||||
(define-extern *hover-bsp* hover-nav-bsp)
|
||||
(define-extern hover-nav-graph-output-bsp (function hover-nav-bsp))
|
||||
(define-extern hover-nav-network-build-bsp (function hover-nav-bsp-node none))
|
||||
(define-extern hover-nav-bsp-output (function hover-nav-bsp none))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; wasp-part ;;
|
||||
|
@ -36050,9 +36044,8 @@
|
|||
;; forest-obs ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
#|
|
||||
(deftype forest-hover-manager (hover-enemy-manager)
|
||||
((transport-actor UNKNOWN 2 :offset-assert 164)
|
||||
((transport-actor entity-actor 2 :offset-assert 168)
|
||||
)
|
||||
:method-count-assert 19
|
||||
:size-assert #xb0
|
||||
|
@ -36060,19 +36053,18 @@
|
|||
(:methods
|
||||
)
|
||||
)
|
||||
|#
|
||||
|
||||
#|
|
||||
(deftype forest-youngsamos (process-focusable)
|
||||
((init-quat quaternion :inline :offset-assert 204)
|
||||
(desired-pos vector :inline :offset-assert 220)
|
||||
(hit-dir vector :inline :offset-assert 236)
|
||||
(hit-points float :offset-assert 252)
|
||||
(incoming-attack-id uint32 :offset-assert 256)
|
||||
(falling? basic :offset-assert 260)
|
||||
(focus-disable-timer uint64 :offset-assert 268)
|
||||
(hud uint64 :offset-assert 276)
|
||||
(sound-id uint32 :offset-assert 284)
|
||||
((root-override2 collide-shape-moving :offset 128 :score 999)
|
||||
(init-quat quaternion :inline :offset-assert 208)
|
||||
(desired-pos vector :inline :offset-assert 224)
|
||||
(hit-dir vector :inline :offset-assert 240)
|
||||
(hit-points float :offset-assert 256)
|
||||
(incoming-attack-id uint32 :offset-assert 260)
|
||||
(falling? basic :offset-assert 264)
|
||||
(focus-disable-timer uint64 :offset-assert 272)
|
||||
(hud handle :offset-assert 280)
|
||||
(sound-id uint32 :offset-assert 288)
|
||||
)
|
||||
:method-count-assert 31
|
||||
:size-assert #x124
|
||||
|
@ -36084,14 +36076,13 @@
|
|||
(dormant () _type_ :state 30)
|
||||
)
|
||||
)
|
||||
|#
|
||||
|
||||
;; (define-extern *forest-protect-battle* array)
|
||||
;; (define-extern forest-youngsamos-post function)
|
||||
;; (define-extern forest-youngsamos-bounce-reaction function)
|
||||
;; (define-extern forest-login function)
|
||||
;; (define-extern forest-deactivate function)
|
||||
;; (define-extern forest-activate function)
|
||||
(define-extern *forest-protect-battle* (array hover-enemy-battle-command))
|
||||
(define-extern forest-youngsamos-post (function none :behavior forest-youngsamos))
|
||||
(define-extern forest-youngsamos-bounce-reaction (function control-info collide-query vector vector collide-status))
|
||||
(define-extern forest-login (function none))
|
||||
(define-extern forest-deactivate (function none))
|
||||
(define-extern forest-activate (function level none))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; pegasus ;;
|
||||
|
@ -45368,7 +45359,7 @@
|
|||
(:methods
|
||||
(idle () _type_ :state 27)
|
||||
(stad-force-field-method-28 (_type_) none 28)
|
||||
(stad-force-field-method-29 (_type_ vector) none 29))
|
||||
(stad-force-field-method-29 (_type_ touching-shapes-entry) int 29))
|
||||
)
|
||||
|
||||
(deftype stad-c-force-field (stad-force-field)
|
||||
|
@ -46877,27 +46868,6 @@
|
|||
:flag-assert #x10003000b0
|
||||
)
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; helldog ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
#|
|
||||
(deftype helldog (hellcat)
|
||||
((current-level basic :offset-assert 1076)
|
||||
)
|
||||
:method-count-assert 159
|
||||
:size-assert #x43c
|
||||
:flag-assert #x9f03c0043c
|
||||
(:methods
|
||||
)
|
||||
)
|
||||
|#
|
||||
|
||||
;; (define-extern *helldog-constants* object)
|
||||
;; (define-extern *helldog-front-turret-control-info* object)
|
||||
;; (define-extern *helldog-top-turret-control-info* object)
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; gun-dummy ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
@ -50961,6 +50931,24 @@
|
|||
(define-extern *hellcat-constants* rigid-body-vehicle-constants)
|
||||
(define-extern *hellcat-front-turret-control-info* turret-control-info)
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; helldog ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(deftype helldog (hellcat)
|
||||
((current-level level :offset-assert 1080)
|
||||
)
|
||||
:method-count-assert 159
|
||||
:size-assert #x43c
|
||||
:flag-assert #x9f03c0043c
|
||||
(:methods
|
||||
)
|
||||
)
|
||||
|
||||
(define-extern *helldog-constants* rigid-body-vehicle-constants)
|
||||
(define-extern *helldog-front-turret-control-info* turret-control-info)
|
||||
(define-extern *helldog-top-turret-control-info* turret-control-info)
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; test-bike ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
|
|
@ -1390,5 +1390,19 @@
|
|||
[20, "(function object ashelin-tanker symbol)"],
|
||||
[21, "(function ashelin-tanker none)"],
|
||||
[22, "(function object ashelin-tanker symbol)"]
|
||||
],
|
||||
"forest-obs": [
|
||||
[3, "(function none :behavior task-manager)"],
|
||||
[4, "(function none :behavior task-manager)"],
|
||||
[5, "(function none :behavior task-manager)"],
|
||||
[6, "(function none :behavior task-manager)"]
|
||||
],
|
||||
"helldog": [
|
||||
[0, "(function none :behavior task-manager)"],
|
||||
[1, "(function none :behavior task-manager)"],
|
||||
[2, "(function none :behavior task-manager)"],
|
||||
[3, "(function none :behavior task-manager)"],
|
||||
[4, "(function none :behavior task-manager)"],
|
||||
[5, "(function none :behavior task-manager)"]
|
||||
]
|
||||
}
|
||||
|
|
|
@ -1679,5 +1679,7 @@
|
|||
"race-mesh": [["L111", "(pointer rgba)", 16]],
|
||||
"racebike": [["L11", "vector"]],
|
||||
"race-manager": [["L459", "attack-info"]],
|
||||
"palcab-obs": [["L146", "attack-info"]]
|
||||
"palcab-obs": [["L146", "attack-info"]],
|
||||
"forest-obs": [["L240", "(pointer int32)", 4]],
|
||||
"helldog": [["L72", "vector"]]
|
||||
}
|
||||
|
|
|
@ -2198,7 +2198,10 @@
|
|||
[80, "vector"]
|
||||
],
|
||||
"(method 23 pal-rot-gun)": [[16, "projectile-init-by-other-params"]],
|
||||
"(method 31 propa)": [
|
||||
[16, ["array", "collide-shape", 64]]
|
||||
"(method 31 propa)": [[16, ["array", "collide-shape", 64]]],
|
||||
"forest-youngsamos-bounce-reaction": [[16, ["array", "sound-name", 2]]],
|
||||
"(method 29 stad-force-field)": [
|
||||
[144, "vector"],
|
||||
[160, "vector"]
|
||||
]
|
||||
}
|
||||
|
|
|
@ -10116,7 +10116,7 @@
|
|||
[215, "v0", "city-lurker"],
|
||||
[174, "v0", "paddywagon"]
|
||||
],
|
||||
"(method 238 kid-escort)": [[[19, 79], "s5", "vehicle"]],
|
||||
"(method 238 kid-escort)": [[[19, 79], "s5", "vehicle"]],
|
||||
"(method 78 kid-escort)": [[17, "a1", "art-joint-anim"]],
|
||||
"(method 97 kid-escort)": [[78, "s4", "process-focusable"]],
|
||||
"(method 74 kid-escort)": [
|
||||
|
@ -10532,16 +10532,37 @@
|
|||
[[76, 84], "a0", "dma-packet"],
|
||||
[[85, 92], "v1", "dma-packet"]
|
||||
],
|
||||
"sprite-glow-add-sprite": [
|
||||
[[0, 33], "v1", "sprite-glow-cnt-template"]
|
||||
],
|
||||
"sprite-glow-add-sprite": [[[0, 33], "v1", "sprite-glow-cnt-template"]],
|
||||
"sprite-glow-add-simple-sprite": [
|
||||
[[0, 33], "v1", "sprite-glow-ref-template"]
|
||||
],
|
||||
"add-shader-to-dma": [
|
||||
[[6, 8], "v1", "(pointer uint32)"]
|
||||
"add-shader-to-dma": [[[6, 8], "v1", "(pointer uint32)"]],
|
||||
"(method 11 cty-guard-turret)": [[[100, 109], "v1", "handle"]],
|
||||
"(event idle forest-youngsamos)": [
|
||||
[29, "s3", "process-focusable"],
|
||||
[[32, 81], "s5", "attack-info"],
|
||||
[60, "gp", "process-focusable"]
|
||||
],
|
||||
"(method 11 cty-guard-turret)" : [
|
||||
[[100, 109], "v1", "handle"]
|
||||
]
|
||||
"(code idle forest-youngsamos)": [[14, "v1", "art-joint-anim"]],
|
||||
"(code hit forest-youngsamos)": [
|
||||
[53, "v1", "art-joint-anim"],
|
||||
[109, "v1", "art-joint-anim"],
|
||||
[162, "v1", "art-joint-anim"]
|
||||
],
|
||||
"(code die forest-youngsamos)": [
|
||||
[64, "v1", "art-joint-anim"],
|
||||
[116, "v1", "art-joint-anim"]
|
||||
],
|
||||
"(method 10 forest-youngsamos)": [
|
||||
[40, "t9", "(function process-focusable none)"]
|
||||
],
|
||||
"forest-youngsamos-bounce-reaction": [[18, "v0", "(array sound-name)"]],
|
||||
"defend-stadium-rift-rider-handler": [
|
||||
[96, "s4", "process-drawable"],
|
||||
[97, "a1", "collide-shape"],
|
||||
[57, "v1", "vector"]
|
||||
],
|
||||
"(method 9 hover-nav-bsp-node)": [[[22, 28], "v1", "hover-nav-bsp-point"]],
|
||||
"(method 0 hover-nav-bsp-node)": [[[6, 9], "v0", "hover-nav-bsp-node"]],
|
||||
"(method 0 hover-nav-bsp-point)": [[[6, 8], "v0", "hover-nav-bsp-point"]]
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// if you want to filter to only some object names.
|
||||
// it will make the decompiler much faster.
|
||||
"allowed_objects": [],
|
||||
"banned_objects": ["hal", "tomb-beetle"],
|
||||
"banned_objects": [],
|
||||
|
||||
////////////////////////////
|
||||
// CODE ANALYSIS OPTIONS
|
||||
|
|
|
@ -89,7 +89,7 @@
|
|||
(temp-edge-list (inline-array mysql-nav-edge) :offset-assert 8)
|
||||
(level-node-index int32 :offset-assert 12)
|
||||
(cam-dist float :offset-assert 16)
|
||||
(visible basic :offset-assert 20)
|
||||
(visible symbol :offset-assert 20)
|
||||
(nav_node_id uint32 :offset-assert 24)
|
||||
(nav_graph_id uint32 :offset-assert 28)
|
||||
(position vector :inline :offset-assert 32)
|
||||
|
|
|
@ -1827,7 +1827,7 @@
|
|||
)
|
||||
|
||||
(defbehavior task-manager-init-by-other task-manager ((arg0 game-task-node-info) (arg1 symbol))
|
||||
(stack-size-set! (-> self main-thread) 1024)
|
||||
(stack-size-set! (-> self main-thread) 2048)
|
||||
(add-connection *task-manager-engine* self nothing self arg0 #f)
|
||||
(set! (-> self node-info) arg0)
|
||||
(set! (-> self lev-name) arg1)
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -7,10 +7,10 @@
|
|||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
(defskelgroup skel-tomb-beetle tomb-beetle 0 -1
|
||||
((1 (meters 999999)))
|
||||
(defskelgroup skel-tomb-beetle tomb-beetle tomb-beetle-lod0-jg -1
|
||||
((tomb-beetle-lod0-mg (meters 999999)))
|
||||
:bounds (static-spherem 0 0.6 0 2)
|
||||
:shadow 2
|
||||
:shadow tomb-beetle-shadow-mg
|
||||
)
|
||||
|
||||
(deftype tomb-beetle-fly-info (structure)
|
||||
|
@ -88,7 +88,35 @@
|
|||
:proximity-notice-distance (meters 40)
|
||||
:default-hit-points 1
|
||||
:gnd-collide-with (collide-spec backgnd)
|
||||
:penetrate-knocked #x11fffdffa
|
||||
:penetrate-knocked (penetrate
|
||||
generic-attack
|
||||
flop
|
||||
punch
|
||||
spin
|
||||
roll
|
||||
uppercut
|
||||
bonk
|
||||
tube
|
||||
vehicle
|
||||
flut-attack
|
||||
board
|
||||
mech-punch
|
||||
mech-bonk
|
||||
dark-skin
|
||||
dark-punch
|
||||
dark-bomb
|
||||
dark-giant
|
||||
shield
|
||||
explode
|
||||
jak-yellow-shot
|
||||
jak-red-shot
|
||||
jak-blue-shot
|
||||
jak-dark-shot
|
||||
enemy-yellow-shot
|
||||
enemy-dark-shot
|
||||
eco-yellow
|
||||
knocked
|
||||
)
|
||||
:movement-gravity (meters -100)
|
||||
:friction 0.8
|
||||
:attack-shove-back (meters 3)
|
||||
|
@ -163,6 +191,8 @@
|
|||
(set! (-> *tomb-beetle-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*)
|
||||
|
||||
(defmethod general-event-handler tomb-beetle ((obj tomb-beetle) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
||||
"Handles various events for the enemy
|
||||
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
|
||||
(with-pp
|
||||
(let ((v1-0 (new 'static 'array int64 2 -1 0)))
|
||||
(case arg2
|
||||
|
@ -339,8 +369,8 @@
|
|||
:code (behavior ()
|
||||
(ja-channel-push! 1 (seconds 0.1))
|
||||
(until #f
|
||||
(ja-no-eval :group! (-> self draw art-group data 3)
|
||||
:num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 3)) frames num-frames) -1)))
|
||||
(ja-no-eval :group! tomb-beetle-falling-ja
|
||||
:num! (seek! (the float (+ (-> (the-as art-joint-anim tomb-beetle-falling-ja) frames num-frames) -1)))
|
||||
:frame-num 0.0
|
||||
)
|
||||
(until (ja-done? 0)
|
||||
|
@ -369,8 +399,8 @@
|
|||
(none)
|
||||
)
|
||||
:code (behavior ()
|
||||
(ja-no-eval :group! (-> self draw art-group data 4)
|
||||
:num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 4)) frames num-frames) -1)))
|
||||
(ja-no-eval :group! tomb-beetle-land-ja
|
||||
:num! (seek! (the float (+ (-> (the-as art-joint-anim tomb-beetle-land-ja) frames num-frames) -1)))
|
||||
:frame-num 0.0
|
||||
)
|
||||
(until (ja-done? 0)
|
||||
|
@ -381,14 +411,14 @@
|
|||
(s5-0 (the int (* 300.0 (rand-vu-float-range 1.1 2.3))))
|
||||
(f30-1 (rand-vu-float-range 0.8 1.4))
|
||||
)
|
||||
(ja-no-eval :group! (-> self draw art-group data 5) :num! (loop! f30-1) :frame-num 0.0)
|
||||
(ja-no-eval :group! tomb-beetle-wiggle-ja :num! (loop! f30-1) :frame-num 0.0)
|
||||
(until (>= (- (-> self clock frame-counter) gp-0) s5-0)
|
||||
(suspend)
|
||||
(ja :num! (loop! f30-1))
|
||||
)
|
||||
)
|
||||
(ja-no-eval :group! (-> self draw art-group data 6)
|
||||
:num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 6)) frames num-frames) -1)))
|
||||
(ja-no-eval :group! tomb-beetle-flip-ja
|
||||
:num! (seek! (the float (+ (-> (the-as art-joint-anim tomb-beetle-flip-ja) frames num-frames) -1)))
|
||||
:frame-num 0.0
|
||||
)
|
||||
(until (ja-done? 0)
|
||||
|
@ -455,11 +485,8 @@
|
|||
(f30-0 (rand-vu-float-range 1.8 1.2))
|
||||
)
|
||||
(dotimes (s5-0 gp-0)
|
||||
(ja-no-eval :group! (-> self draw art-group data 7)
|
||||
:num! (seek!
|
||||
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 7)) frames num-frames) -1))
|
||||
f30-0
|
||||
)
|
||||
(ja-no-eval :group! tomb-beetle-run0-ja
|
||||
:num! (seek! (the float (+ (-> (the-as art-joint-anim tomb-beetle-run0-ja) frames num-frames) -1)) f30-0)
|
||||
:frame-num 0.0
|
||||
)
|
||||
(until (ja-done? 0)
|
||||
|
@ -467,11 +494,8 @@
|
|||
(ja :num! (seek! max f30-0))
|
||||
)
|
||||
)
|
||||
(ja-no-eval :group! (-> self draw art-group data 8)
|
||||
:num! (seek!
|
||||
(the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 8)) frames num-frames) -1))
|
||||
f30-0
|
||||
)
|
||||
(ja-no-eval :group! tomb-beetle-run1-ja
|
||||
:num! (seek! (the float (+ (-> (the-as art-joint-anim tomb-beetle-run1-ja) frames num-frames) -1)) f30-0)
|
||||
:frame-num 0.0
|
||||
)
|
||||
(until (ja-done? 0)
|
||||
|
@ -507,15 +531,15 @@
|
|||
(none)
|
||||
)
|
||||
:trans (behavior ()
|
||||
(if (>= (- (-> self clock frame-counter) (-> self state-time)) (the-as time-frame (-> self state-timeout)))
|
||||
(if (>= (- (-> self clock frame-counter) (-> self state-time)) (-> self state-timeout))
|
||||
(go-virtual active)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
:code (behavior ()
|
||||
(until #f
|
||||
(ja-no-eval :group! (-> self draw art-group data 9)
|
||||
:num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) frames num-frames) -1)))
|
||||
(ja-no-eval :group! tomb-beetle-stand0-ja
|
||||
:num! (seek! (the float (+ (-> (the-as art-joint-anim tomb-beetle-stand0-ja) frames num-frames) -1)))
|
||||
:frame-num 0.0
|
||||
)
|
||||
(until (ja-done? 0)
|
||||
|
@ -533,7 +557,7 @@
|
|||
:virtual #t
|
||||
:enter (behavior ()
|
||||
(let ((s5-0 (-> self fly-info))
|
||||
(gp-0 (the-as (inline-array tomb-beetle-fly-info) (&-> self stack 544)))
|
||||
(gp-0 (the-as (inline-array tomb-beetle-fly-info) (-> self fly-info 1)))
|
||||
)
|
||||
(set! (-> s5-0 0 dst quad) (the-as uint128 (the-as vector (-> self root-override2 trans quad))))
|
||||
(set! (-> gp-0 0 dst quad) (-> self entity extra trans quad))
|
||||
|
@ -567,14 +591,14 @@
|
|||
)
|
||||
:code (behavior ()
|
||||
(set! (-> self state-timeout)
|
||||
(the-as time-frame (+ (-> self clock frame-counter) (the int (* 300.0 (rand-vu-float-range 0.0 0.8)))))
|
||||
(+ (-> self clock frame-counter) (the int (* 300.0 (rand-vu-float-range 0.0 0.8))))
|
||||
)
|
||||
(let ((v1-6 (ja-group)))
|
||||
(cond
|
||||
((and v1-6 (= v1-6 (-> self draw art-group data 9)))
|
||||
((and v1-6 (= v1-6 tomb-beetle-stand0-ja))
|
||||
(ja-no-eval :num! (seek!))
|
||||
(while (not (ja-done? 0))
|
||||
(if (>= (-> self clock frame-counter) (the-as time-frame (-> self state-timeout)))
|
||||
(if (>= (-> self clock frame-counter) (-> self state-timeout))
|
||||
(goto cfg-20)
|
||||
)
|
||||
(suspend)
|
||||
|
@ -587,12 +611,12 @@
|
|||
)
|
||||
)
|
||||
(until #f
|
||||
(ja-no-eval :group! (-> self draw art-group data 9)
|
||||
:num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 9)) frames num-frames) -1)))
|
||||
(ja-no-eval :group! tomb-beetle-stand0-ja
|
||||
:num! (seek! (the float (+ (-> (the-as art-joint-anim tomb-beetle-stand0-ja) frames num-frames) -1)))
|
||||
:frame-num 0.0
|
||||
)
|
||||
(until (ja-done? 0)
|
||||
(if (>= (-> self clock frame-counter) (the-as time-frame (-> self state-timeout)))
|
||||
(if (>= (-> self clock frame-counter) (-> self state-timeout))
|
||||
(goto cfg-20)
|
||||
)
|
||||
(suspend)
|
||||
|
@ -602,7 +626,7 @@
|
|||
#f
|
||||
(label cfg-20)
|
||||
(ja-channel-push! 1 (seconds 0.075))
|
||||
(ja-no-eval :group! (-> self draw art-group data 10) :num! (seek! 6.0) :frame-num 0.0)
|
||||
(ja-no-eval :group! tomb-beetle-fly-takeoff-ja :num! (seek! 6.0) :frame-num 0.0)
|
||||
(until (ja-done? 0)
|
||||
(suspend)
|
||||
(ja :num! (seek! 6.0))
|
||||
|
@ -614,8 +638,8 @@
|
|||
(ja-eval)
|
||||
)
|
||||
(until #f
|
||||
(ja-no-eval :group! (-> self draw art-group data 11)
|
||||
:num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) frames num-frames) -1)))
|
||||
(ja-no-eval :group! tomb-beetle-fly-ja
|
||||
:num! (seek! (the float (+ (-> (the-as art-joint-anim tomb-beetle-fly-ja) frames num-frames) -1)))
|
||||
:frame-num 0.0
|
||||
)
|
||||
(until (ja-done? 0)
|
||||
|
@ -663,7 +687,7 @@
|
|||
(quaternion-smooth-seek!
|
||||
(-> self root-override2 quat)
|
||||
(-> self root-override2 quat)
|
||||
(the-as quaternion (&-> self stack 560))
|
||||
(-> self fly-info 1 dst-quat)
|
||||
(* 12.0 (-> self clock seconds-per-frame))
|
||||
)
|
||||
)
|
||||
|
@ -809,7 +833,7 @@
|
|||
0
|
||||
(set! (-> self flying?) #f)
|
||||
(let ((s5-0 (-> self fly-info))
|
||||
(gp-0 (the-as (inline-array tomb-beetle-fly-info) (&-> self stack 544)))
|
||||
(gp-0 (the-as (inline-array tomb-beetle-fly-info) (-> self fly-info 1)))
|
||||
)
|
||||
(cond
|
||||
((nonzero? (-> self actor-group-count))
|
||||
|
@ -878,8 +902,8 @@
|
|||
(-> self fly-info (-> self dest-index) threshold)
|
||||
)
|
||||
(when (= (-> self dest-index) 1)
|
||||
(set! (-> self root-override2 trans quad) (-> (the-as vector (&-> self stack 544)) quad))
|
||||
(quaternion-copy! (-> self root-override2 quat) (the-as quaternion (&-> self stack 560)))
|
||||
(set! (-> self root-override2 trans quad) (-> (the-as vector (-> self fly-info 1)) quad))
|
||||
(quaternion-copy! (-> self root-override2 quat) (-> self fly-info 1 dst-quat))
|
||||
(go-virtual key)
|
||||
)
|
||||
(set! (-> self speed) 81920.0)
|
||||
|
@ -891,7 +915,7 @@
|
|||
)
|
||||
:code (behavior ()
|
||||
(ja-channel-push! 1 (seconds 0.075))
|
||||
(ja-no-eval :group! (-> self draw art-group data 10) :num! (seek! 6.0) :frame-num 0.0)
|
||||
(ja-no-eval :group! tomb-beetle-fly-takeoff-ja :num! (seek! 6.0) :frame-num 0.0)
|
||||
(until (ja-done? 0)
|
||||
(suspend)
|
||||
(ja :num! (seek! 6.0))
|
||||
|
@ -903,8 +927,8 @@
|
|||
(ja-eval)
|
||||
)
|
||||
(until #f
|
||||
(ja-no-eval :group! (-> self draw art-group data 11)
|
||||
:num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) frames num-frames) -1)))
|
||||
(ja-no-eval :group! tomb-beetle-fly-ja
|
||||
:num! (seek! (the float (+ (-> (the-as art-joint-anim tomb-beetle-fly-ja) frames num-frames) -1)))
|
||||
:frame-num 0.0
|
||||
)
|
||||
(until (ja-done? 0)
|
||||
|
@ -981,8 +1005,8 @@
|
|||
)
|
||||
:trans (the-as (function none :behavior tomb-beetle) ja-post)
|
||||
:code (behavior ()
|
||||
(ja-no-eval :group! (-> self draw art-group data 12)
|
||||
:num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 12)) frames num-frames) -1)))
|
||||
(ja-no-eval :group! tomb-beetle-fly-land-ja
|
||||
:num! (seek! (the float (+ (-> (the-as art-joint-anim tomb-beetle-fly-land-ja) frames num-frames) -1)))
|
||||
:frame-num 0.0
|
||||
)
|
||||
(until (ja-done? 0)
|
||||
|
@ -995,7 +1019,7 @@
|
|||
)
|
||||
|
||||
(defmethod init-enemy-collision! tomb-beetle ((obj tomb-beetle))
|
||||
"@abstract"
|
||||
"Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly"
|
||||
(let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player))))
|
||||
(set! (-> s5-0 dynam) (copy *standard-dynamics* 'process))
|
||||
(set! (-> s5-0 reaction) cshape-reaction-default)
|
||||
|
@ -1043,7 +1067,7 @@
|
|||
)
|
||||
|
||||
(defmethod init-enemy! tomb-beetle ((obj tomb-beetle))
|
||||
"@abstract"
|
||||
"Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods"
|
||||
(initialize-skeleton
|
||||
obj
|
||||
(the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-beetle" (the-as (pointer uint32) #f)))
|
||||
|
|
|
@ -273,7 +273,7 @@
|
|||
)
|
||||
|
||||
(defmethod init-enemy-collision! hal ((obj hal))
|
||||
"@abstract"
|
||||
"Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly"
|
||||
(let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player))))
|
||||
(set! (-> s5-0 dynam) (copy *standard-dynamics* 'process))
|
||||
(set! (-> s5-0 reaction) cshape-reaction-default)
|
||||
|
@ -312,7 +312,7 @@
|
|||
)
|
||||
|
||||
(defmethod init-enemy! hal ((obj hal))
|
||||
"@abstract"
|
||||
"Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods"
|
||||
(init! obj)
|
||||
(initialize-skeleton
|
||||
obj
|
||||
|
@ -386,6 +386,8 @@
|
|||
|
||||
;; WARN: Return type mismatch none vs object.
|
||||
(defmethod general-event-handler hal ((obj hal) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
||||
"Handles various events for the enemy
|
||||
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
|
||||
(the-as
|
||||
object
|
||||
(case arg2
|
||||
|
|
2
test/decompiler/reference/jak2/engine/debug/nav/mysql-nav-graph_REF.gc
generated
vendored
2
test/decompiler/reference/jak2/engine/debug/nav/mysql-nav-graph_REF.gc
generated
vendored
|
@ -11,7 +11,7 @@
|
|||
(temp-edge-list (inline-array mysql-nav-edge) :offset-assert 8)
|
||||
(level-node-index int32 :offset-assert 12)
|
||||
(cam-dist float :offset-assert 16)
|
||||
(visible basic :offset-assert 20)
|
||||
(visible symbol :offset-assert 20)
|
||||
(nav_node_id uint32 :offset-assert 24)
|
||||
(nav_graph_id uint32 :offset-assert 28)
|
||||
(position vector :inline :offset-assert 32)
|
||||
|
|
4
test/decompiler/reference/jak2/engine/game/idle-control_REF.gc
generated
vendored
4
test/decompiler/reference/jak2/engine/game/idle-control_REF.gc
generated
vendored
|
@ -177,3 +177,7 @@
|
|||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
4
test/decompiler/reference/jak2/levels/city/common/nav-graph_REF.gc
generated
vendored
4
test/decompiler/reference/jak2/levels/city/common/nav-graph_REF.gc
generated
vendored
|
@ -1469,3 +1469,7 @@ and patched at runtime after loading."
|
|||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
1126
test/decompiler/reference/jak2/levels/forest/forest-obs_REF.gc
generated
vendored
Normal file
1126
test/decompiler/reference/jak2/levels/forest/forest-obs_REF.gc
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
1145
test/decompiler/reference/jak2/levels/mars_tomb/tomb-beetle_REF.gc
generated
vendored
Normal file
1145
test/decompiler/reference/jak2/levels/mars_tomb/tomb-beetle_REF.gc
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
564
test/decompiler/reference/jak2/levels/undefined/hal_REF.gc
generated
vendored
Normal file
564
test/decompiler/reference/jak2/levels/undefined/hal_REF.gc
generated
vendored
Normal file
|
@ -0,0 +1,564 @@
|
|||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; definition for symbol *hal-nav-enemy-info*, type nav-enemy-info
|
||||
(define *hal-nav-enemy-info* (new 'static 'nav-enemy-info
|
||||
:use-die-falling #t
|
||||
:use-victory #f
|
||||
:use-jump-blocked #f
|
||||
:debug-draw-neck #f
|
||||
:jump-debug-draw #f
|
||||
:move-to-ground #f
|
||||
:hover-if-no-ground #f
|
||||
:idle-anim-script #f
|
||||
:idle-anim -1
|
||||
:notice-anim -1
|
||||
:hostile-anim -1
|
||||
:hit-anim -1
|
||||
:knocked-anim -1
|
||||
:knocked-land-anim -1
|
||||
:die-anim -1
|
||||
:die-falling-anim -1
|
||||
:victory-anim -1
|
||||
:jump-wind-up-anim -1
|
||||
:jump-in-air-anim -1
|
||||
:jump-land-anim -1
|
||||
:neck-joint -1
|
||||
:notice-distance (meters 30)
|
||||
:notice-distance-delta (meters 10)
|
||||
:default-hit-points 1
|
||||
:gnd-collide-with (collide-spec backgnd)
|
||||
:overlaps-others-collide-with-filter (collide-spec jak bot player-list)
|
||||
:movement-gravity (meters -100)
|
||||
:friction 0.8
|
||||
:attack-shove-back (meters 3)
|
||||
:attack-shove-up (meters 2)
|
||||
:attack-mode 'generic
|
||||
:attack-damage 2
|
||||
:recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher)
|
||||
:jump-height-min (meters 3)
|
||||
:jump-height-factor 0.5
|
||||
:knocked-seek-ry-clamp 2730.6667
|
||||
:knocked-soft-vxz-lo 72089.6
|
||||
:knocked-soft-vxz-hi 108134.4
|
||||
:knocked-soft-vy-lo 81920.0
|
||||
:knocked-soft-vy-hi 122880.0
|
||||
:knocked-medium-vxz-lo 147456.0
|
||||
:knocked-medium-vxz-hi 196608.0
|
||||
:knocked-medium-vy-lo 135168.0
|
||||
:knocked-medium-vy-hi 151552.0
|
||||
:knocked-hard-vxz-lo 78643.2
|
||||
:knocked-hard-vxz-hi 117964.8
|
||||
:knocked-hard-vy-lo 183500.8
|
||||
:knocked-hard-vy-hi 209715.2
|
||||
:knocked-huge-vxz-lo 164659.2
|
||||
:knocked-huge-vxz-hi 249036.8
|
||||
:knocked-huge-vy-lo 183500.8
|
||||
:knocked-huge-vy-hi 217907.2
|
||||
:knocked-yellow-vxz-lo 40960.0
|
||||
:knocked-yellow-vxz-hi 49152.0
|
||||
:knocked-yellow-vy-lo 57344.0
|
||||
:knocked-yellow-vy-hi 81920.0
|
||||
:knocked-red-vxz-lo 24576.0
|
||||
:knocked-red-vxz-hi 196608.0
|
||||
:knocked-red-vy-lo 94208.0
|
||||
:knocked-red-vy-hi 151552.0
|
||||
:knocked-blue-vxz-lo 40960.0
|
||||
:knocked-blue-vxz-hi 49152.0
|
||||
:knocked-blue-vy-lo 24576.0
|
||||
:knocked-blue-vy-hi 81920.0
|
||||
:shadow-size (meters 1)
|
||||
:shadow-max-y (meters 1)
|
||||
:shadow-min-y (meters -1)
|
||||
:shadow-locus-dist (meters 150)
|
||||
:gem-joint -1
|
||||
:gem-offset (new 'static 'sphere :r 163840.0)
|
||||
:callback-info #f
|
||||
:use-momentum #f
|
||||
:use-frustration #t
|
||||
:use-stop-chase #f
|
||||
:use-circling #f
|
||||
:use-pacing #f
|
||||
:walk-anim -1
|
||||
:turn-anim -1
|
||||
:run-anim -1
|
||||
:taunt-anim -1
|
||||
:run-travel-speed (meters 6)
|
||||
:run-acceleration (meters 1)
|
||||
:run-turning-acceleration (meters 2)
|
||||
:walk-travel-speed (meters 3)
|
||||
:walk-acceleration (meters 1)
|
||||
:walk-turning-acceleration (meters 1)
|
||||
:maximum-rotation-rate (degrees 720.0)
|
||||
:notice-nav-radius (meters 1)
|
||||
:frustration-distance (meters 8)
|
||||
:frustration-time (seconds 4)
|
||||
:blocked-time (seconds 0.3)
|
||||
:circle-dist-lo 20480.0
|
||||
:circle-dist-hi 61440.0
|
||||
:nav-mesh #f
|
||||
)
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(set! (-> *hal-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*)
|
||||
|
||||
;; definition for function hal-simple-check-too-far
|
||||
(defun hal-simple-check-too-far ((arg0 hal))
|
||||
(let ((s5-0 (-> *target* control trans))
|
||||
(f30-0 40960000.0)
|
||||
)
|
||||
(countdown (s4-0 3)
|
||||
(let ((v1-6 (handle->process (-> arg0 slave-handle s4-0))))
|
||||
(when v1-6
|
||||
(let ((f0-0 (vector-vector-xz-distance s5-0 (-> (the-as process-drawable v1-6) root trans))))
|
||||
(if (< f0-0 f30-0)
|
||||
(set! f30-0 f0-0)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((v0-1 0))
|
||||
(let ((f0-1 (-> arg0 too-far-warn-dist)))
|
||||
(when (>= f30-0 f0-1)
|
||||
(if (>= (- f30-0 f0-1) (-> arg0 too-far-fail-dist-delta))
|
||||
(set! v0-1 2)
|
||||
(set! v0-1 1)
|
||||
)
|
||||
)
|
||||
)
|
||||
v0-1
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 220 of type hal
|
||||
(defmethod stop-speech hal ((obj hal) (arg0 uint) (arg1 symbol))
|
||||
(cond
|
||||
((zero? arg0)
|
||||
(let ((t9-0 (method-of-type bot stop-speech)))
|
||||
(t9-0 obj (-> obj channel) arg1)
|
||||
)
|
||||
(countdown (s4-0 3)
|
||||
(let ((v1-4 (handle->process (-> obj slave-handle s4-0))))
|
||||
(when v1-4
|
||||
(let ((t9-1 (method-of-type bot stop-speech)))
|
||||
(t9-1 (the-as bot v1-4) (-> v1-4 stack 580) arg1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(else
|
||||
((method-of-type bot stop-speech) obj arg0 arg1)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 206 of type hal
|
||||
;; WARN: Return type mismatch gui-connection vs none.
|
||||
(defmethod play-speech hal ((obj hal) (arg0 int))
|
||||
(let ((v1-2 (-> obj course speeches arg0)))
|
||||
(logior! (-> v1-2 flags) (speech-flags playing))
|
||||
(let ((a1-4 (-> v1-2 slave-id))
|
||||
(t2-0 (-> v1-2 hold-time))
|
||||
(gp-0 (-> obj course speech-tunings (-> v1-2 tuning-id)))
|
||||
)
|
||||
(cond
|
||||
((>= a1-4 0)
|
||||
(let* ((a2-2 (handle->process (-> obj slave-handle a1-4)))
|
||||
(a1-11 (add-process
|
||||
*gui-control*
|
||||
a2-2
|
||||
(the-as gui-channel (-> a2-2 stack 580))
|
||||
(gui-action play)
|
||||
(-> v1-2 name)
|
||||
-99.0
|
||||
(the-as time-frame t2-0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set-falloff! *gui-control* a1-11 (-> gp-0 trans?) (-> gp-0 fo-min) (-> gp-0 fo-max) (-> gp-0 fo-curve))
|
||||
)
|
||||
)
|
||||
(else
|
||||
(let ((a1-14 (add-process
|
||||
*gui-control*
|
||||
obj
|
||||
(the-as gui-channel (-> obj channel))
|
||||
(gui-action play)
|
||||
(-> v1-2 name)
|
||||
-99.0
|
||||
(the-as time-frame t2-0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set-falloff! *gui-control* a1-14 (-> gp-0 trans?) (-> gp-0 fo-min) (-> gp-0 fo-max) (-> gp-0 fo-curve))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 209 of type hal
|
||||
(defmethod channel-active? hal ((obj hal) (arg0 uint))
|
||||
"Is the given [[gui-channel]] active?"
|
||||
(cond
|
||||
((zero? arg0)
|
||||
(let ((t9-0 (method-of-type bot channel-active?)))
|
||||
(if (t9-0 obj (-> obj channel))
|
||||
(return #t)
|
||||
)
|
||||
)
|
||||
(countdown (s5-0 3)
|
||||
(let ((v1-7 (handle->process (-> obj slave-handle s5-0))))
|
||||
(when v1-7
|
||||
(let ((t9-1 (method-of-type bot channel-active?)))
|
||||
(if (t9-1 (the-as bot v1-7) (-> v1-7 stack 580))
|
||||
(return #t)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
#f
|
||||
)
|
||||
(else
|
||||
((method-of-type bot channel-active?) obj arg0)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 226 of type hal
|
||||
(defmethod hal-method-226 hal ((obj hal))
|
||||
(countdown (s5-0 3)
|
||||
(let ((a0-2 (handle->process (-> obj slave-handle s5-0))))
|
||||
(when a0-2
|
||||
(if (not (send-event a0-2 'request 'slave-id s5-0))
|
||||
(return #f)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
#t
|
||||
)
|
||||
|
||||
;; definition for method 225 of type hal
|
||||
(defmethod hal-method-225 hal ((obj hal))
|
||||
(countdown (v1-0 3)
|
||||
(if (handle->process (-> obj slave-handle v1-0))
|
||||
(return #f)
|
||||
)
|
||||
)
|
||||
#t
|
||||
)
|
||||
|
||||
;; definition for method 196 of type hal
|
||||
;; WARN: Return type mismatch symbol vs none.
|
||||
(defmethod bot-method-196 hal ((obj hal))
|
||||
(when (not (logtest? (-> obj bot-flags) (bot-flags too-far-fail)))
|
||||
(let ((t9-0 (method-of-type bot bot-method-196)))
|
||||
(t9-0 obj)
|
||||
)
|
||||
(countdown (s5-0 3)
|
||||
(let ((a0-3 (handle->process (-> obj slave-handle s5-0))))
|
||||
(if a0-3
|
||||
(bot-method-196 (the-as bot a0-3))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 114 of type hal
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod init-enemy-collision! hal ((obj hal))
|
||||
"Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly"
|
||||
(let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player))))
|
||||
(set! (-> s5-0 dynam) (copy *standard-dynamics* 'process))
|
||||
(set! (-> s5-0 reaction) cshape-reaction-default)
|
||||
(set! (-> s5-0 no-reaction)
|
||||
(the-as (function collide-shape-moving collide-query vector vector object) nothing)
|
||||
)
|
||||
(set! (-> s5-0 penetrated-by) (the-as penetrate -1))
|
||||
(let ((v1-7 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0))))
|
||||
(set-vector! (-> v1-7 local-sphere) 0.0 0.0 0.0 40.96)
|
||||
(set! (-> s5-0 total-prims) (the-as uint 1))
|
||||
(set! (-> s5-0 root-prim) v1-7)
|
||||
)
|
||||
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
|
||||
(let ((v1-10 (-> s5-0 root-prim)))
|
||||
(set! (-> s5-0 backup-collide-as) (-> v1-10 prim-core collide-as))
|
||||
(set! (-> s5-0 backup-collide-with) (-> v1-10 prim-core collide-with))
|
||||
)
|
||||
(set! (-> obj root-override2) s5-0)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 210 of type hal
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod init! hal ((obj hal))
|
||||
"Set defaults for various fields."
|
||||
(let ((t9-0 (method-of-type bot init!)))
|
||||
(t9-0 obj)
|
||||
)
|
||||
(set! (-> obj handle-failed-slave-id) -1)
|
||||
(countdown (v1-2 3)
|
||||
(set! (-> obj slave-handle v1-2) (the-as handle #f))
|
||||
(nop!)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 115 of type hal
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod init-enemy! hal ((obj hal))
|
||||
"Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods"
|
||||
(init! obj)
|
||||
(initialize-skeleton
|
||||
obj
|
||||
(the-as skeleton-group (art-group-get-by-name *level* "skel-scenecamera" (the-as (pointer uint32) #f)))
|
||||
(the-as pair 0)
|
||||
)
|
||||
(init-enemy-behaviour-and-stats! obj *hal-nav-enemy-info*)
|
||||
(let ((t9-4 (method-of-type bot init-enemy!)))
|
||||
(t9-4 obj)
|
||||
)
|
||||
(set! (-> obj channel) (the-as uint 28))
|
||||
(set! (-> obj spot-color) (the-as uint #x5000ffff))
|
||||
(set! (-> obj notice-enemy-dist) 0.0)
|
||||
(logior! (-> obj focus-status) (focus-status disable))
|
||||
(let ((v1-13 (-> obj root-override2 root-prim)))
|
||||
(set! (-> v1-13 prim-core collide-as) (collide-spec))
|
||||
(set! (-> v1-13 prim-core collide-with) (collide-spec))
|
||||
)
|
||||
(set! (-> obj root-override2 backup-collide-as) (collide-spec))
|
||||
(set! (-> obj root-override2 backup-collide-with) (collide-spec))
|
||||
0
|
||||
(logior! (-> obj draw status) (draw-control-status no-draw))
|
||||
(remove-process-drawable (-> obj nav state mesh) obj)
|
||||
(set! (-> obj nav) #f)
|
||||
(set! (-> obj nav-mesh-index) -1)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 205 of type hal
|
||||
(defmethod scene-play hal ((obj hal) (arg0 string) (arg1 symbol))
|
||||
"Spawn a [[scene-player]] process for the given scene."
|
||||
(when (and (process-grab? obj #t) (or arg1 (process-grab? *target* #t)))
|
||||
(countdown (s3-0 3)
|
||||
(let ((a0-4 (handle->process (-> obj slave-handle s3-0))))
|
||||
(if (and a0-4 (not (process-grab? a0-4 #t)))
|
||||
(return #f)
|
||||
)
|
||||
)
|
||||
)
|
||||
(process-grab? obj #f)
|
||||
(if (not arg1)
|
||||
(process-grab? *target* #f)
|
||||
)
|
||||
(countdown (s4-1 3)
|
||||
(let ((a0-10 (handle->process (-> obj slave-handle s4-1))))
|
||||
(if a0-10
|
||||
(process-grab? a0-10 #f)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! (-> obj scene-player-handle)
|
||||
(ppointer->handle (process-spawn scene-player :init scene-player-init arg0 #t #f))
|
||||
)
|
||||
#t
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 188 of type hal
|
||||
(defmethod scene-release? hal ((obj hal))
|
||||
(when (not (handle->process (-> obj scene-player-handle)))
|
||||
(process-release? obj)
|
||||
(countdown (s5-0 3)
|
||||
(let ((a0-7 (handle->process (-> obj slave-handle s5-0))))
|
||||
(if a0-7
|
||||
(process-release? a0-7)
|
||||
)
|
||||
)
|
||||
)
|
||||
#t
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 74 of type hal
|
||||
;; INFO: Used lq/sq
|
||||
;; WARN: Return type mismatch none vs object.
|
||||
(defmethod general-event-handler hal ((obj hal) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
||||
"Handles various events for the enemy
|
||||
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
|
||||
(the-as
|
||||
object
|
||||
(case arg2
|
||||
(('notify)
|
||||
(case (-> arg3 param 0)
|
||||
(('hit-by)
|
||||
(let* ((s4-0 arg0)
|
||||
(v1-2 (if (type? s4-0 bot)
|
||||
s4-0
|
||||
)
|
||||
)
|
||||
)
|
||||
(when v1-2
|
||||
(when (= (-> (the-as process (-> arg3 param 1)) type) target)
|
||||
(logior! (-> obj bot-flags) (ash 1 (+ (-> (the-as bot v1-2) slave-id) 19)))
|
||||
(the-as object (stop-speech obj (the-as uint 0) #t))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(('mission-failed)
|
||||
(let* ((s4-1 arg0)
|
||||
(s5-1 (if (type? s4-1 bot)
|
||||
s4-1
|
||||
)
|
||||
)
|
||||
)
|
||||
(when s5-1
|
||||
(when (not (logtest? (-> obj bot-flags) (bot-flags too-far-fail)))
|
||||
(when (not (logtest? (-> obj bot-flags) (bot-flags bf09)))
|
||||
(logior! (-> obj bot-flags) (bot-flags bf09))
|
||||
(let ((a1-7 (new 'stack-no-clear 'fail-mission-params)))
|
||||
(set! (-> a1-7 flags) (fail-mission-flags famflags-5))
|
||||
(set! (-> a1-7 message) (fail-mission-message fammsg-0))
|
||||
(set! (-> a1-7 retry-continue) #f)
|
||||
(set! (-> a1-7 fail-continue) #f)
|
||||
(set! (-> a1-7 reset-delay) (the-as uint 1500))
|
||||
(set! (-> a1-7 task) (game-task none))
|
||||
(set! (-> a1-7 fail-message) (game-text-id null))
|
||||
(if (start! *fail-mission-control* a1-7)
|
||||
(set! (-> obj handle-failed-slave-id) (-> (the-as bot s5-1) slave-id))
|
||||
)
|
||||
)
|
||||
(set! (-> obj delay-too-far-check) -1)
|
||||
(stop-speech obj (the-as uint 0) #f)
|
||||
(countdown (s4-2 3)
|
||||
(send-event (handle->process (-> obj slave-handle s4-2)) 'notify 'mission-failed)
|
||||
)
|
||||
)
|
||||
(= (-> obj handle-failed-slave-id) (-> (the-as bot s5-1) slave-id))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(('follow-dir)
|
||||
(set! (-> obj follow-dir quad) (-> (the-as vector (-> arg3 param 1)) quad))
|
||||
#t
|
||||
)
|
||||
)
|
||||
)
|
||||
(('set-task)
|
||||
(let ((a1-10 (/ (the-as int (-> arg3 param 0)) 8)))
|
||||
(logior! (-> obj bot-task-bits) (ash 1 a1-10))
|
||||
)
|
||||
#t
|
||||
)
|
||||
(('clear-task)
|
||||
(let ((a1-12 (/ (the-as int (-> arg3 param 0)) 8)))
|
||||
(logclear! (-> obj bot-task-bits) (ash 1 a1-12))
|
||||
)
|
||||
#t
|
||||
)
|
||||
(('change-mode)
|
||||
(when (= (-> arg3 param 0) 'grab)
|
||||
(let ((v0-1 (the-as object (alive? obj))))
|
||||
(if (and (the-as symbol v0-1) (-> arg3 param 1))
|
||||
(logior! (-> obj focus-status) (focus-status grabbed))
|
||||
)
|
||||
v0-1
|
||||
)
|
||||
)
|
||||
)
|
||||
(('end-mode)
|
||||
(when (logtest? (-> obj focus-status) (focus-status grabbed))
|
||||
(logclear! (-> obj focus-status) (focus-status grabbed))
|
||||
#t
|
||||
)
|
||||
)
|
||||
(('skip)
|
||||
(the-as object (skip-waypoint obj))
|
||||
)
|
||||
(('move-trans)
|
||||
(move-to-point! (-> obj root-override2) (the-as vector (-> arg3 param 0)))
|
||||
#t
|
||||
)
|
||||
(('die-fast)
|
||||
(cleanup-for-death obj)
|
||||
(go (method-of-object obj die-fast))
|
||||
)
|
||||
(('nav-mesh-kill)
|
||||
(remove-process-drawable (-> obj nav state mesh) obj)
|
||||
(set! (-> obj nav) #f)
|
||||
(set! (-> obj nav-mesh-index) -1)
|
||||
#t
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for function hal-post
|
||||
(defbehavior hal-post hal ()
|
||||
(when (not (logtest? (-> self bot-flags) (bot-flags bf09)))
|
||||
(let ((t9-0 (-> self waypoint on-update)))
|
||||
(if t9-0
|
||||
(t9-0 self)
|
||||
)
|
||||
)
|
||||
)
|
||||
(when (and (not (logtest? (-> self bot-flags) (bot-flags too-far-fail bf09))) (bot-check-too-far self))
|
||||
(let ((gp-0 0))
|
||||
(countdown (s5-0 3)
|
||||
(let ((s4-0 (enemy-method-120 self 3 gp-0)))
|
||||
(let ((a0-4 (handle->process (-> self slave-handle s4-0))))
|
||||
(if (send-event a0-4 'request 'too-far-fail)
|
||||
(goto cfg-24)
|
||||
)
|
||||
)
|
||||
(set! gp-0 (logior gp-0 (ash 1 s4-0)))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(label cfg-24)
|
||||
(if (not (logtest? (-> self bot-flags) (bot-flags bf09)))
|
||||
(ai-task-control-method-10 (-> self ai-ctrl) self)
|
||||
)
|
||||
(if (logtest? *display-bot-marks* (bot-marks-controls bmc08))
|
||||
(bot-debug-draw-spot-id self)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function hal-event-handler
|
||||
(defbehavior hal-event-handler hal ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
||||
(general-event-handler self arg0 arg1 arg2 arg3)
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(defstate idle (hal)
|
||||
:virtual #t
|
||||
:event hal-event-handler
|
||||
:enter (the-as (function none :behavior hal) nothing)
|
||||
:exit (the-as (function none :behavior hal) nothing)
|
||||
:trans (the-as (function none :behavior hal) nothing)
|
||||
:code (the-as (function none :behavior hal) sleep-code)
|
||||
:post hal-post
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in a new issue