mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 21:27:52 -04:00
e546fce370
Fixes #2825
828 lines
26 KiB
Common Lisp
828 lines
26 KiB
Common Lisp
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; name: ctywide-tasks.gc
|
|
;; name in dgo: ctywide-tasks
|
|
;; dgos: CWI
|
|
|
|
(define-extern race-start (function int process symbol process))
|
|
|
|
;; DECOMP BEGINS
|
|
|
|
(set-subtask-hook!
|
|
*game-info*
|
|
(game-task-node stadium-board1-resolution)
|
|
TASK_MANAGER_INIT_HOOK
|
|
(lambda :behavior task-manager
|
|
()
|
|
(set-setting! 'minimap 'clear 0.0 (minimap-flag task-graph))
|
|
(set! (-> self minimap 0) (add-icon! *minimap* self (the-as uint 12) (the-as int #f) (the-as vector #f) 0))
|
|
(none)
|
|
)
|
|
)
|
|
|
|
(set-subtask-hook!
|
|
*game-info*
|
|
(game-task-node stadium-board1-resolution)
|
|
TASK_MANAGER_UPDATE_HOOK
|
|
(lambda :behavior task-manager () (none))
|
|
)
|
|
|
|
(set-subtask-hook!
|
|
*game-info*
|
|
(game-task-node stadium-board1-board)
|
|
TASK_MANAGER_INIT_HOOK
|
|
(lambda :behavior task-manager
|
|
()
|
|
(set-setting! 'minimap 'clear 0.0 (minimap-flag task-graph))
|
|
(set! (-> self minimap 0) (add-icon! *minimap* self (the-as uint 39) (the-as int #f) (the-as vector #f) 0))
|
|
(none)
|
|
)
|
|
)
|
|
|
|
(set-subtask-hook!
|
|
*game-info*
|
|
(game-task-node stadium-board1-board)
|
|
TASK_MANAGER_COMPLETE_HOOK
|
|
(lambda :behavior task-manager
|
|
()
|
|
(set! (-> self state-time) (current-time))
|
|
(while (< (- (current-time) (-> self state-time)) (seconds 2))
|
|
(suspend)
|
|
)
|
|
(none)
|
|
)
|
|
)
|
|
|
|
(set-subtask-hook!
|
|
*game-info*
|
|
(game-task-node city-protect-water-slums-get-seal)
|
|
TASK_MANAGER_INIT_HOOK
|
|
(lambda :behavior task-manager
|
|
()
|
|
(let ((gp-0 (new 'stack-no-clear 'task-arrow-params)))
|
|
(set! (-> gp-0 pos quad) (-> (new 'static 'vector :x 3132661.8 :y 33669.12 :z -2965708.8 :w 1.0) quad))
|
|
(quaternion-identity! (-> gp-0 quat))
|
|
(set! (-> gp-0 flags) (task-arrow-flags))
|
|
(set! (-> gp-0 map-icon) (the-as uint 15))
|
|
(set! (-> self arrow) (process->handle (task-arrow-spawn gp-0 (the-as task-arrow self))))
|
|
)
|
|
(none)
|
|
)
|
|
)
|
|
|
|
(set-subtask-hook!
|
|
*game-info*
|
|
(game-task-node city-protect-water-slums-get-seal)
|
|
TASK_MANAGER_UPDATE_HOOK
|
|
(lambda :behavior task-manager
|
|
()
|
|
(when (movie?)
|
|
(if (handle->process (-> self arrow))
|
|
(send-event (handle->process (-> self arrow)) 'leave)
|
|
)
|
|
)
|
|
(none)
|
|
)
|
|
)
|
|
|
|
(set-subtask-hook!
|
|
*game-info*
|
|
(game-task-node city-protect-water-slums-get-seal)
|
|
TASK_MANAGER_COMPLETE_HOOK
|
|
(lambda :behavior task-manager
|
|
()
|
|
(send-event (handle->process (-> self arrow)) 'leave)
|
|
(set! (-> self state-time) (current-time))
|
|
(while (< (- (current-time) (-> self state-time)) (seconds 2))
|
|
(suspend)
|
|
)
|
|
(none)
|
|
)
|
|
)
|
|
|
|
(set-subtask-hook!
|
|
*game-info*
|
|
(game-task-node city-help-kid-introduction)
|
|
TASK_MANAGER_CODE_HOOK
|
|
(lambda :behavior task-manager
|
|
()
|
|
(while (not *traffic-manager*)
|
|
(suspend)
|
|
)
|
|
(suspend)
|
|
(let ((gp-0 *traffic-manager*))
|
|
(send-event gp-0 'deactivate-by-type (traffic-type crimson-guard-1))
|
|
(send-event gp-0 'deactivate-by-type (traffic-type guard-bike))
|
|
(send-event gp-0 'deactivate-by-type (traffic-type hellcat))
|
|
(send-event gp-0 'deactivate-by-type (traffic-type traffic-type-20))
|
|
(send-event gp-0 'set-guard-target-level 0)
|
|
)
|
|
(set-setting! 'pilot #f 0.0 0)
|
|
(set-setting! 'vehicle-hijacking #f 0.0 0)
|
|
(set-setting! 'exclusive-task #f 0.0 (-> self node-info task))
|
|
(while (let ((a0-9 (level-get-target-inside *level*)))
|
|
(not (and a0-9 (logtest? (-> a0-9 info level-flags) 1)))
|
|
)
|
|
(suspend)
|
|
)
|
|
(set-setting! 'airlock #f 0.0 0)
|
|
(apply-settings *setting-control*)
|
|
(none)
|
|
)
|
|
)
|
|
|
|
(set-subtask-hook!
|
|
*game-info*
|
|
(game-task-node city-help-kid-introduction)
|
|
TASK_MANAGER_CLEANUP_HOOK
|
|
(lambda :behavior task-manager
|
|
()
|
|
(let ((a0-0 *traffic-manager*))
|
|
(send-event a0-0 'restore-default-settings)
|
|
)
|
|
(none)
|
|
)
|
|
)
|
|
|
|
(set-subtask-hook!
|
|
*game-info*
|
|
(game-task-node city-help-kid-introduction)
|
|
TASK_MANAGER_EVENT_HOOK
|
|
(lambda :behavior task-manager
|
|
((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
|
(case arg2
|
|
(('target)
|
|
(case (-> arg3 param 0)
|
|
(('normal)
|
|
(send-event (handle->process (-> self slave 0)) 'request 'scene-player)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; WARN: Return type mismatch symbol vs none.
|
|
(defun wait-for-speech-end ((arg0 sound-id))
|
|
(while (nonzero? (get-status *gui-control* arg0))
|
|
(suspend)
|
|
)
|
|
(none)
|
|
)
|
|
|
|
(set-subtask-hook!
|
|
*game-info*
|
|
(game-task-node city-vehicle-training-map)
|
|
TASK_MANAGER_CODE_HOOK
|
|
(lambda :behavior task-manager
|
|
()
|
|
(set! (-> self sound-id 0)
|
|
(talker-spawn-func (-> *talker-speech* 38) *entity-pool* (target-pos 0) (the-as region #f))
|
|
)
|
|
(wait-for-speech-end (-> self sound-id 0))
|
|
(let ((gp-1 (current-time)))
|
|
(until (>= (- (current-time) gp-1) (seconds 1))
|
|
(suspend)
|
|
)
|
|
)
|
|
(while (or (not *target*) (focus-test? *target* dead teleporting))
|
|
(suspend)
|
|
)
|
|
(set! (-> self sound-id 0)
|
|
(talker-spawn-func (-> *talker-speech* 39) *entity-pool* (target-pos 0) (the-as region #f))
|
|
)
|
|
(wait-for-speech-end (-> self sound-id 0))
|
|
(go-virtual complete)
|
|
(none)
|
|
)
|
|
)
|
|
|
|
(set-subtask-hook!
|
|
*game-info*
|
|
(game-task-node city-vehicle-training-hover-zone-1)
|
|
TASK_MANAGER_UPDATE_HOOK
|
|
(lambda :behavior task-manager
|
|
()
|
|
(when (and (= (-> self sub-state) 1) (not (and *target* (focus-test? *target* pilot))))
|
|
(set! (-> self sound-id 0)
|
|
(talker-spawn-func (-> *talker-speech* 46) *entity-pool* (target-pos 0) (the-as region #f))
|
|
)
|
|
(go-virtual fail)
|
|
)
|
|
(none)
|
|
)
|
|
)
|
|
|
|
(set-subtask-hook!
|
|
*game-info*
|
|
(game-task-node city-vehicle-training-hover-zone-1)
|
|
TASK_MANAGER_CODE_HOOK
|
|
(lambda :behavior task-manager
|
|
()
|
|
(local-vars (v1-1 object))
|
|
(until v1-1
|
|
(suspend)
|
|
(set! v1-1 (and *target* (focus-test? *target* pilot)))
|
|
)
|
|
(set! (-> self slave 0) (-> *target* pilot vehicle))
|
|
(set! (-> self sub-state) (the-as uint 1))
|
|
(while (or (not *target*) (focus-test? *target* dead teleporting))
|
|
(suspend)
|
|
)
|
|
(set! (-> self sound-id 0)
|
|
(talker-spawn-func (-> *talker-speech* 31) *entity-pool* (target-pos 0) (the-as region #f))
|
|
)
|
|
(wait-for-speech-end (-> self sound-id 0))
|
|
(let ((gp-1 (current-time)))
|
|
(until (>= (- (current-time) gp-1) (seconds 1))
|
|
(suspend)
|
|
)
|
|
)
|
|
(while (or (not *target*) (focus-test? *target* dead teleporting))
|
|
(suspend)
|
|
)
|
|
(set! (-> self sound-id 0)
|
|
(talker-spawn-func (-> *talker-speech* 35) *entity-pool* (target-pos 0) (the-as region #f))
|
|
)
|
|
(wait-for-speech-end (-> self sound-id 0))
|
|
(let ((gp-3 (current-time)))
|
|
(until (>= (- (current-time) gp-3) (seconds 1))
|
|
(suspend)
|
|
)
|
|
)
|
|
(while (or (not *target*) (focus-test? *target* dead teleporting))
|
|
(suspend)
|
|
)
|
|
(set! (-> self sound-id 0)
|
|
(talker-spawn-func (-> *talker-speech* 36) *entity-pool* (target-pos 0) (the-as region #f))
|
|
)
|
|
(while (let ((v1-34 (handle->process (-> self slave 0))))
|
|
(not (logtest? (rigid-body-object-flag flight-level-transition) (-> (the-as vehicle v1-34) flags)))
|
|
)
|
|
(suspend)
|
|
)
|
|
(wait-for-speech-end (-> self sound-id 0))
|
|
(while (or (not *target*) (focus-test? *target* dead teleporting))
|
|
(suspend)
|
|
)
|
|
(set! (-> self sound-id 0)
|
|
(talker-spawn-func (-> *talker-speech* 37) *entity-pool* (target-pos 0) (the-as region #f))
|
|
)
|
|
(wait-for-speech-end (-> self sound-id 0))
|
|
(set! (-> self sub-state) (the-as uint 2))
|
|
(let ((gp-6 (current-time)))
|
|
(until (>= (- (current-time) gp-6) (seconds 1))
|
|
(suspend)
|
|
)
|
|
)
|
|
(go-virtual complete)
|
|
(none)
|
|
)
|
|
)
|
|
|
|
(set-subtask-hook!
|
|
*game-info*
|
|
(game-task-node city-vehicle-training-hover-zone-1)
|
|
TASK_MANAGER_FAIL_HOOK
|
|
(lambda :behavior task-manager
|
|
()
|
|
(task-node-close! (game-task-node city-vehicle-training-hover-zone-1))
|
|
(none)
|
|
)
|
|
)
|
|
|
|
(set-subtask-hook!
|
|
*game-info*
|
|
(game-task-node city-vehicle-training-hover-zone-1)
|
|
TASK_MANAGER_COMPLETE_HOOK
|
|
(lambda :behavior task-manager
|
|
()
|
|
(task-node-close! (game-task-node city-vehicle-training-hover-zone-2))
|
|
(none)
|
|
)
|
|
)
|
|
|
|
(set-subtask-hook!
|
|
*game-info*
|
|
(game-task-node city-vehicle-training-hover-zone-2)
|
|
TASK_MANAGER_UPDATE_HOOK
|
|
(lambda :behavior task-manager
|
|
()
|
|
(cond
|
|
((zero? (-> self sub-state))
|
|
(cond
|
|
((and *target* (focus-test? *target* pilot))
|
|
(let ((v1-8 (handle->process (-> *target* pilot vehicle))))
|
|
(if (logtest? (rigid-body-object-flag flight-level-transition) (-> (the-as vehicle v1-8) flags))
|
|
(go-virtual complete)
|
|
)
|
|
)
|
|
)
|
|
(else
|
|
(set! (-> self state-time) (current-time))
|
|
)
|
|
)
|
|
)
|
|
((= (-> self sub-state) 1)
|
|
(if (not (and *target* (focus-test? *target* pilot)))
|
|
(go-virtual fail)
|
|
)
|
|
)
|
|
)
|
|
(none)
|
|
)
|
|
)
|
|
|
|
(set-subtask-hook!
|
|
*game-info*
|
|
(game-task-node city-vehicle-training-hover-zone-2)
|
|
TASK_MANAGER_CODE_HOOK
|
|
(lambda :behavior task-manager
|
|
()
|
|
(until (>= (- (current-time) (-> self state-time)) (seconds 60))
|
|
(suspend)
|
|
)
|
|
(set! (-> self sub-state) (the-as uint 1))
|
|
(set! (-> self sound-id 0)
|
|
(talker-spawn-func (-> *talker-speech* 35) *entity-pool* (target-pos 0) (the-as region #f))
|
|
)
|
|
(wait-for-speech-end (-> self sound-id 0))
|
|
(let ((gp-1 (current-time)))
|
|
(until (>= (- (current-time) gp-1) (seconds 1))
|
|
(suspend)
|
|
)
|
|
)
|
|
(set! (-> self sound-id 0)
|
|
(talker-spawn-func (-> *talker-speech* 36) *entity-pool* (target-pos 0) (the-as region #f))
|
|
)
|
|
(while (let ((v1-15 (handle->process (-> *target* pilot vehicle))))
|
|
(not (logtest? (rigid-body-object-flag flight-level-transition) (-> (the-as vehicle v1-15) flags)))
|
|
)
|
|
(suspend)
|
|
)
|
|
(wait-for-speech-end (-> self sound-id 0))
|
|
(set! (-> self sound-id 0)
|
|
(talker-spawn-func (-> *talker-speech* 37) *entity-pool* (target-pos 0) (the-as region #f))
|
|
)
|
|
(wait-for-speech-end (-> self sound-id 0))
|
|
(let ((gp-4 (current-time)))
|
|
(until (>= (- (current-time) gp-4) (seconds 3))
|
|
(suspend)
|
|
)
|
|
)
|
|
(go-virtual complete)
|
|
(none)
|
|
)
|
|
)
|
|
|
|
(set-subtask-hook!
|
|
*game-info*
|
|
(game-task-node city-keira-delivery-delivery)
|
|
TASK_MANAGER_INIT_HOOK
|
|
(lambda :behavior task-manager
|
|
()
|
|
(set-setting! 'exclusive-task #f 0.0 (-> self node-info task))
|
|
(set! (-> self begin-pos quad) (-> (new 'static 'vector :x -245760.0 :y 45056.0 :z 5468160.0 :w 1.0) quad))
|
|
(set! (-> self end-pos quad) (-> (new 'static 'vector :x 579584.0 :y 49152.0 :z -1985331.2 :w 1.0) quad))
|
|
(set-setting! 'minimap 'clear 0.0 (minimap-flag task-graph))
|
|
(let ((s5-0 *traffic-manager*)
|
|
(gp-0 (new 'stack 'traffic-object-spawn-params))
|
|
)
|
|
(set! (-> gp-0 position quad) (-> self begin-pos quad))
|
|
(quaternion-axis-angle! (-> gp-0 rotation) 0.0 1.0 0.0 16384.0)
|
|
(set! (-> gp-0 object-type) (traffic-type bikec))
|
|
(set! (-> gp-0 behavior) (the-as uint 0))
|
|
(set! (-> gp-0 id) (the-as uint 0))
|
|
(set! (-> gp-0 proc) #f)
|
|
(send-event s5-0 'spawn-object gp-0)
|
|
(if (-> gp-0 proc)
|
|
(set! (-> self slave 0) (process->handle (-> gp-0 proc)))
|
|
)
|
|
)
|
|
(let ((gp-1 (new 'stack-no-clear 'task-arrow-params)))
|
|
(set! (-> gp-1 pos quad) (-> self end-pos quad))
|
|
(quaternion-identity! (-> gp-1 quat))
|
|
(set! (-> gp-1 flags) (task-arrow-flags task-arrow-flag-00))
|
|
(set! (-> gp-1 map-icon) (the-as uint 12))
|
|
(label cfg-10)
|
|
(let ((a0-20 (task-arrow-spawn gp-1 (the-as task-arrow self))))
|
|
(when (not a0-20)
|
|
(suspend)
|
|
(goto cfg-10)
|
|
)
|
|
(set! (-> self arrow) (process->handle a0-20))
|
|
)
|
|
)
|
|
(set! (-> self start-time) 0)
|
|
(set! (-> self time-limit) (seconds 180))
|
|
(none)
|
|
)
|
|
)
|
|
|
|
(set-subtask-hook!
|
|
*game-info*
|
|
(game-task-node city-keira-delivery-delivery)
|
|
TASK_MANAGER_CLEANUP_HOOK
|
|
(lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none))
|
|
)
|
|
|
|
(set-subtask-hook!
|
|
*game-info*
|
|
(game-task-node city-keira-delivery-delivery)
|
|
TASK_MANAGER_UPDATE_HOOK
|
|
(lambda :behavior task-manager
|
|
()
|
|
(check-time self)
|
|
(let ((f0-0 (vector-vector-distance-squared (target-pos 0) (-> self end-pos)))
|
|
(f1-0 49152.0)
|
|
)
|
|
(if (>= (* f1-0 f1-0) f0-0)
|
|
(go-virtual complete)
|
|
)
|
|
)
|
|
(none)
|
|
)
|
|
)
|
|
|
|
(set-subtask-hook!
|
|
*game-info*
|
|
(game-task-node city-keira-delivery-delivery)
|
|
TASK_MANAGER_CODE_HOOK
|
|
(lambda :behavior task-manager
|
|
()
|
|
(local-vars (v1-7 symbol))
|
|
(send-event *traffic-manager* 'set-target-level 1.0)
|
|
(until (or v1-7 (and *target* (focus-test? *target* pilot)))
|
|
(suspend)
|
|
(let ((f0-0 122880.0))
|
|
(set! v1-7 (< (* f0-0 f0-0) (vector-vector-distance-squared (-> self begin-pos) (target-pos 0))))
|
|
)
|
|
)
|
|
(set-setting! 'airlock #f 0.0 0)
|
|
(set! (-> self start-time) (current-time))
|
|
(none)
|
|
)
|
|
)
|
|
|
|
(set-subtask-hook!
|
|
*game-info*
|
|
(game-task-node city-keira-delivery-delivery)
|
|
TASK_MANAGER_COMPLETE_HOOK
|
|
(lambda :behavior task-manager
|
|
()
|
|
(send-event *traffic-manager* 'decrease-alert-level 0)
|
|
(send-event *traffic-manager* 'set-alert-duration (seconds 30))
|
|
(send-event *target* 'end-mode)
|
|
(set-setting! 'pilot #f 0.0 0)
|
|
(set! (-> self state-time) (current-time))
|
|
(while (< (- (current-time) (-> self state-time)) (seconds 2))
|
|
(suspend)
|
|
)
|
|
(script-eval '(send-event "keira-npc-1" 'say))
|
|
(none)
|
|
)
|
|
)
|
|
|
|
(set-subtask-hook!
|
|
*game-info*
|
|
(game-task-node stadium-race-class3-race)
|
|
TASK_MANAGER_INIT_HOOK
|
|
(lambda :behavior task-manager
|
|
()
|
|
(set-setting! 'minimap 'clear 0.0 (minimap-flag task-graph))
|
|
(set! (-> self minimap 0) (add-icon! *minimap* self (the-as uint 39) (the-as int #f) (the-as vector #f) 0))
|
|
(set! (-> self sub-state) (the-as uint 0))
|
|
0
|
|
(none)
|
|
)
|
|
)
|
|
|
|
(set-subtask-hook!
|
|
*game-info*
|
|
(game-task-node stadium-race-class3-race)
|
|
TASK_MANAGER_CLEANUP_HOOK
|
|
(lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none))
|
|
)
|
|
|
|
(set-subtask-hook!
|
|
*game-info*
|
|
(game-task-node stadium-race-class3-race)
|
|
TASK_MANAGER_UPDATE_HOOK
|
|
(lambda :behavior task-manager
|
|
()
|
|
(let* ((v1-1 (-> self info index))
|
|
(a1-2 (cond
|
|
((or (zero? v1-1) (= v1-1 4) (= v1-1 9))
|
|
'stadiumb
|
|
)
|
|
((or (= v1-1 1) (= v1-1 5) (= v1-1 10))
|
|
'stadiumc
|
|
)
|
|
((or (= v1-1 2) (= v1-1 6) (= v1-1 11))
|
|
'stadiumd
|
|
)
|
|
(else
|
|
#f
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(cond
|
|
((= (level-status *level* a1-2) 'active)
|
|
(when (zero? (-> self sub-state))
|
|
(set! (-> self sub-state) (the-as uint 1))
|
|
(set-setting! 'exclusive-task #f 0.0 (-> self node-info task))
|
|
(set! (-> self slave 0) (process->handle (race-start (-> self info index) self #f)))
|
|
)
|
|
)
|
|
(else
|
|
(when (nonzero? (-> self sub-state))
|
|
(remove-setting! 'exclusive-task)
|
|
(set! (-> self sub-state) (the-as uint 0))
|
|
0
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(none)
|
|
)
|
|
)
|
|
|
|
(set-subtask-hook!
|
|
*game-info*
|
|
(game-task-node stadium-race-class3-race)
|
|
TASK_MANAGER_COMPLETE_HOOK
|
|
(lambda :behavior task-manager
|
|
()
|
|
(case (-> self info index)
|
|
((2)
|
|
(format #t "kill race manager~%")
|
|
(send-event (handle->process (-> self slave 0)) 'die)
|
|
)
|
|
)
|
|
(none)
|
|
)
|
|
)
|
|
|
|
(copy-hooks!
|
|
(-> *game-info* sub-task-list (game-task-node stadium-race-class2-race))
|
|
(-> *game-info* sub-task-list (game-task-node stadium-race-class3-race))
|
|
)
|
|
|
|
(copy-hooks!
|
|
(-> *game-info* sub-task-list (game-task-node stadium-race-class1-race))
|
|
(-> *game-info* sub-task-list (game-task-node stadium-race-class3-race))
|
|
)
|
|
|
|
(copy-hooks!
|
|
(-> *game-info* sub-task-list (game-task-node stadium-burning-bush-race-class3-resolution))
|
|
(-> *game-info* sub-task-list (game-task-node stadium-race-class3-race))
|
|
)
|
|
|
|
(copy-hooks!
|
|
(-> *game-info* sub-task-list (game-task-node stadium-burning-bush-race-class2-resolution))
|
|
(-> *game-info* sub-task-list (game-task-node stadium-race-class2-race))
|
|
)
|
|
|
|
(copy-hooks!
|
|
(-> *game-info* sub-task-list (game-task-node stadium-burning-bush-race-class1-resolution))
|
|
(-> *game-info* sub-task-list (game-task-node stadium-race-class1-race))
|
|
)
|
|
|
|
(copy-hooks!
|
|
(-> *game-info* sub-task-list (game-task-node stadium-burning-bush-race-class3-r-resolution))
|
|
(-> *game-info* sub-task-list (game-task-node stadium-race-class3-race))
|
|
)
|
|
|
|
(copy-hooks!
|
|
(-> *game-info* sub-task-list (game-task-node stadium-burning-bush-race-class2-r-resolution))
|
|
(-> *game-info* sub-task-list (game-task-node stadium-race-class2-race))
|
|
)
|
|
|
|
(copy-hooks!
|
|
(-> *game-info* sub-task-list (game-task-node stadium-burning-bush-race-class1-r-resolution))
|
|
(-> *game-info* sub-task-list (game-task-node stadium-race-class1-race))
|
|
)
|
|
|
|
(set-subtask-hook!
|
|
*game-info*
|
|
(game-task-node stadium-race-class1-resolution)
|
|
TASK_MANAGER_CODE_HOOK
|
|
(lambda :behavior task-manager
|
|
()
|
|
(let ((gp-0 *traffic-manager*))
|
|
(send-event gp-0 'set-guard-target-count-range 0 0 0)
|
|
(send-event gp-0 'set-guard-target-count-range 1 0 0)
|
|
(send-event gp-0 'set-guard-target-count-range 2 0 0)
|
|
(format #t "class-1 race complete~%")
|
|
(send-event gp-0 'set-alert-level 3)
|
|
)
|
|
(while (!= (level-status *level* 'lwidea) 'active)
|
|
(suspend)
|
|
)
|
|
(send-event *traffic-manager* 'spawn-all)
|
|
(suspend)
|
|
(suspend)
|
|
(let ((gp-2 (new 'static 'city-ambush-info
|
|
:count 5
|
|
:array (new 'static 'inline-array city-ambush-spot 5
|
|
(new 'static 'city-ambush-spot
|
|
:pos (new 'static 'vector :x 503808.0 :y 49152.0 :z -2805760.0 :w 1.0)
|
|
:obj-type #x6
|
|
)
|
|
(new 'static 'city-ambush-spot
|
|
:pos (new 'static 'vector :x 458752.0 :y 49152.0 :z -2838528.0 :w 1.0)
|
|
:obj-type #x6
|
|
)
|
|
(new 'static 'city-ambush-spot
|
|
:pos (new 'static 'vector :x 450560.0 :y 49152.0 :z -2871296.0 :w 1.0)
|
|
:obj-type #x6
|
|
)
|
|
(new 'static 'city-ambush-spot
|
|
:pos (new 'static 'vector :x 413696.0 :y 49152.0 :z -2879488.0 :w 1.0)
|
|
:obj-type #x6
|
|
)
|
|
(new 'static 'city-ambush-spot
|
|
:pos (new 'static 'vector :x 368640.0 :y 49152.0 :z -2916352.0 :w 1.0)
|
|
:obj-type #x6
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(s5-0 (new 'stack-no-clear 'traffic-object-spawn-params))
|
|
)
|
|
(set! (-> s5-0 object-type) (traffic-type crimson-guard-1))
|
|
(set! (-> s5-0 behavior) (the-as uint 9))
|
|
(set! (-> s5-0 id) (the-as uint 0))
|
|
(set! (-> s5-0 nav-mesh) #f)
|
|
(set! (-> s5-0 nav-branch) #f)
|
|
(set! (-> s5-0 proc) #f)
|
|
(set! (-> s5-0 handle) (process->handle *target*))
|
|
(set! (-> s5-0 user-data) (the-as uint 0))
|
|
(set! (-> s5-0 flags) (traffic-spawn-flags))
|
|
(set! (-> s5-0 guard-type) (the-as uint 1))
|
|
(vector-reset! (-> s5-0 velocity))
|
|
(quaternion-identity! (-> s5-0 rotation))
|
|
(city-ambush-info-method-9 gp-2 s5-0)
|
|
)
|
|
(go-virtual complete)
|
|
(none)
|
|
)
|
|
)
|
|
|
|
(deftype city-bb-racepoint-info (structure)
|
|
((bike-pos vector :inline :offset-assert 0)
|
|
(end-pos vector :inline :offset-assert 16)
|
|
(bike-angle float :offset-assert 32)
|
|
(map symbol :offset-assert 36)
|
|
(time float :offset-assert 40)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #x2c
|
|
:flag-assert #x90000002c
|
|
)
|
|
|
|
|
|
(define *city-bb-racepoint-info* (new 'static 'boxed-array :type city-bb-racepoint-info
|
|
(new 'static 'city-bb-racepoint-info
|
|
:bike-pos (new 'static 'vector :x -687431.7 :y 40960.0 :z 3485491.2 :w 1.0)
|
|
:end-pos (new 'static 'vector :x 4694794.0 :y 33341.44 :z 137297.92 :w 1.0)
|
|
:bike-angle 32768.0
|
|
:map #t
|
|
:time 27000.0
|
|
)
|
|
(new 'static 'city-bb-racepoint-info
|
|
:bike-pos (new 'static 'vector :x 3399843.8 :y 40960.0 :z 1019863.06 :w 1.0)
|
|
:end-pos (new 'static 'vector :x 47308.8 :y 32768.0 :z 573440.0 :w 1.0)
|
|
:bike-angle 8192.0
|
|
:map #t
|
|
:time 22500.0
|
|
)
|
|
(new 'static 'city-bb-racepoint-info
|
|
:bike-pos (new 'static 'vector :x 1773486.1 :y 40960.0 :z -284180.47 :w 1.0)
|
|
:end-pos (new 'static 'vector :x -282624.0 :y 45056.0 :z 5464064.0 :w 1.0)
|
|
:bike-angle 8192.0
|
|
:map #f
|
|
:time 33000.0
|
|
)
|
|
(new 'static 'city-bb-racepoint-info
|
|
:bike-pos (new 'static 'vector :x 3190005.8 :y 40960.0 :z 2962514.0 :w 1.0)
|
|
:end-pos (new 'static 'vector :x 2532597.8 :y -9338.88 :z -2062909.5 :w 1.0)
|
|
:bike-angle 8192.0
|
|
:map #t
|
|
:time 29400.0
|
|
)
|
|
)
|
|
)
|
|
|
|
(set-subtask-hook!
|
|
*game-info*
|
|
(game-task-node city-burning-bush-racepoint-1-resolution)
|
|
TASK_MANAGER_INIT_HOOK
|
|
(lambda :behavior task-manager
|
|
()
|
|
(set-setting! 'exclusive-task #f 0.0 (-> self node-info task))
|
|
(set-setting! 'airlock #f 0.0 0)
|
|
(set-setting! 'minimap 'clear 0.0 (minimap-flag task-graph))
|
|
(let ((gp-0 (-> *city-bb-racepoint-info* (-> self info index))))
|
|
(set! (-> self end-pos quad) (-> gp-0 end-pos quad))
|
|
(let ((s4-0 *traffic-manager*)
|
|
(s5-0 (new 'stack 'traffic-object-spawn-params))
|
|
)
|
|
(set! (-> s5-0 position quad) (-> gp-0 bike-pos quad))
|
|
(quaternion-axis-angle! (-> s5-0 rotation) 0.0 1.0 0.0 (-> gp-0 bike-angle))
|
|
(set! (-> s5-0 object-type) (traffic-type bikea))
|
|
(set! (-> s5-0 behavior) (the-as uint 0))
|
|
(set! (-> s5-0 id) (the-as uint 0))
|
|
(set! (-> s5-0 proc) #f)
|
|
(send-event s4-0 'spawn-object s5-0)
|
|
(if (-> s5-0 proc)
|
|
(set! (-> self slave 0) (process->handle (-> s5-0 proc)))
|
|
)
|
|
)
|
|
(let ((s5-1 (new 'stack-no-clear 'task-arrow-params)))
|
|
(set! (-> s5-1 pos quad) (-> self end-pos quad))
|
|
(quaternion-identity! (-> s5-1 quat))
|
|
(set! (-> s5-1 flags) (task-arrow-flags task-arrow-flag-00))
|
|
(set! (-> s5-1 map-icon) (the-as uint 15))
|
|
(cond
|
|
((-> gp-0 map)
|
|
(set! (-> s5-1 map-icon) (the-as uint 15))
|
|
)
|
|
(else
|
|
(set! (-> s5-1 map-icon) (the-as uint 0))
|
|
0
|
|
)
|
|
)
|
|
(label cfg-12)
|
|
(let ((a0-20 (task-arrow-spawn s5-1 (the-as task-arrow self))))
|
|
(when (not a0-20)
|
|
(suspend)
|
|
(goto cfg-12)
|
|
)
|
|
(set! (-> self arrow) (process->handle a0-20))
|
|
)
|
|
)
|
|
(set! (-> self start-time) (current-time))
|
|
(set! (-> self time-limit) (the-as time-frame (the int (-> gp-0 time))))
|
|
)
|
|
(none)
|
|
)
|
|
)
|
|
|
|
(set-subtask-hook!
|
|
*game-info*
|
|
(game-task-node city-burning-bush-racepoint-1-resolution)
|
|
TASK_MANAGER_CLEANUP_HOOK
|
|
(lambda :behavior task-manager () (send-event *traffic-manager* 'restore-default-settings) (none))
|
|
)
|
|
|
|
(set-subtask-hook!
|
|
*game-info*
|
|
(game-task-node city-burning-bush-racepoint-1-resolution)
|
|
TASK_MANAGER_UPDATE_HOOK
|
|
(lambda :behavior task-manager
|
|
()
|
|
(check-time self)
|
|
(let ((f0-0 (vector-vector-distance-squared (target-pos 0) (-> self end-pos)))
|
|
(f1-0 49152.0)
|
|
)
|
|
(if (>= (* f1-0 f1-0) f0-0)
|
|
(go-virtual complete)
|
|
)
|
|
)
|
|
(none)
|
|
)
|
|
)
|
|
|
|
(set-subtask-hook!
|
|
*game-info*
|
|
(game-task-node city-burning-bush-racepoint-1-resolution)
|
|
TASK_MANAGER_CODE_HOOK
|
|
(lambda :behavior task-manager
|
|
()
|
|
(send-event *traffic-manager* 'restore-default-settings)
|
|
(send-event *traffic-manager* 'set-target-level 1.0)
|
|
(none)
|
|
)
|
|
)
|
|
|
|
(set-subtask-hook!
|
|
*game-info*
|
|
(game-task-node city-burning-bush-racepoint-1-resolution)
|
|
TASK_MANAGER_COMPLETE_HOOK
|
|
(lambda :behavior task-manager
|
|
()
|
|
(send-event *target* 'end-mode)
|
|
(set-setting! 'pilot #f 0.0 0)
|
|
(set! (-> self state-time) (current-time))
|
|
(while (< (- (current-time) (-> self state-time)) (seconds 2))
|
|
(suspend)
|
|
)
|
|
;; unnecessary - the task manager can take care of this
|
|
(close! (-> self node-info) 'event)
|
|
(none)
|
|
)
|
|
)
|