mirror of
https://github.com/open-goal/jak-project
synced 2026-05-26 15:46:14 -04:00
24578b64b9
* hardcode `time-frame`things * Update cam-states_REF.gc * Update level-info_REF.gc * update refs 1 * update refs 2 * update refs 3 * update refs 4 * update refs 5 * update detection and casting * Update FormExpressionAnalysis.cpp * update refs 6 * update mood decomp * update refs 7 * update refs 8 * remove temp entity birth code * update time-frame casts * fix compiler * hardcode stuff and fix some types * fix some bitfield detection being wrong * bug fixes * detect seconds on adds with immediate * update refs 9 * fix casts and rand-vu-int-range bugs (update refs 10) * update refs 11 * update 12 * update 13 * update 14 * Update game-info_REF.gc * improve cpad macros detection * remove unused code * update refs * clang * update source code * Update cam-states.gc * `lavatube-energy` finish * update refs * fix actor bank stuff * Update navigate.gc * reduce entity default stack size * Update transformq-h.gc * oops forgot these * fix code and tests * fix mood sound stuff * Update load-dgo.gc * Update README.md
188 lines
6.7 KiB
Common Lisp
188 lines
6.7 KiB
Common Lisp
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; name: task-control-h.gc
|
|
;; name in dgo: task-control-h
|
|
;; dgos: GAME, ENGINE
|
|
|
|
;; for process-taskable
|
|
(declare-type process-taskable process-drawable)
|
|
(define-extern othercam-init-by-other (function process-taskable symbol symbol symbol none :behavior othercam))
|
|
|
|
;; There are a fixed number of game tasks. Most are just getting a power cell,
|
|
;; but there are also ones for using the levitator etc.
|
|
|
|
;; The list of all tasks is the game-task enum in game-info-h.gc
|
|
|
|
;; the task control contains a list of all cstage.
|
|
;; Each task may have multiple cstages.
|
|
;; Each cstage corresponds to a game-task and a task-status.
|
|
|
|
;; There is a concept of a "current stage" being played, but it may sometimes be invalid (-1).
|
|
;; it is an index into the task-control list
|
|
|
|
;; names from task-status->string function
|
|
;; the status value will increase.
|
|
;; some tasks may do their own thing and not use these values.
|
|
(defenum task-status
|
|
:type uint64
|
|
(invalid 0)
|
|
(unknown 1)
|
|
(need-hint 2)
|
|
(need-introduction 3)
|
|
(need-reminder-a 4)
|
|
(need-reminder 5)
|
|
(need-reward-speech 6)
|
|
(need-resolution 7)
|
|
)
|
|
|
|
;; our names
|
|
(defenum task-flags
|
|
:type uint8
|
|
:bitfield #t
|
|
(closed 0)
|
|
(has-entity 1)
|
|
(closed-by-default 2)
|
|
)
|
|
|
|
(declare-type task-control basic)
|
|
|
|
;; DECOMP BEGINS
|
|
|
|
(deftype task-cstage (structure)
|
|
((game-task game-task :offset-assert 0)
|
|
(status task-status :offset-assert 8)
|
|
(flags task-flags :offset-assert 16)
|
|
(condition (function task-control symbol) :offset-assert 20)
|
|
)
|
|
:method-count-assert 16
|
|
:size-assert #x18
|
|
:flag-assert #x1000000018
|
|
(:methods
|
|
(get-task (_type_) game-task 9)
|
|
(get-status (_type_) task-status 10)
|
|
(task-available? (_type_ task-control) symbol 11)
|
|
(closed? (_type_) symbol 12)
|
|
(closed-by-default? (_type_) symbol 13)
|
|
(close-task! (_type_) int 14)
|
|
(open-task! (_type_) int 15)
|
|
)
|
|
)
|
|
|
|
|
|
(deftype task-control (basic)
|
|
((current-stage int16 :offset-assert 4)
|
|
(stage (array task-cstage) :offset-assert 8)
|
|
)
|
|
:method-count-assert 19
|
|
:size-assert #xc
|
|
:flag-assert #x130000000c
|
|
(:methods
|
|
(current-task (_type_) game-task 9)
|
|
(current-status (_type_) task-status 10)
|
|
(close-current! (_type_) game-task 11)
|
|
(close-status! (_type_ task-status) game-task 12)
|
|
(first-any (_type_ symbol) game-task 13)
|
|
(reset! (_type_ symbol symbol) int 14)
|
|
(closed? (_type_ game-task task-status) symbol 15)
|
|
(get-reminder (_type_ int) int 16)
|
|
(save-reminder (_type_ int int) int 17)
|
|
(exists? (_type_ game-task task-status) symbol 18)
|
|
)
|
|
)
|
|
|
|
|
|
(deftype ambient-control (structure)
|
|
((last-ambient-time time-frame :offset-assert 0)
|
|
(last-ambient string :offset-assert 8)
|
|
(last-ambient-id sound-id :offset-assert 12)
|
|
)
|
|
:pack-me
|
|
:method-count-assert 12
|
|
:size-assert #x10
|
|
:flag-assert #xc00000010
|
|
(:methods
|
|
(dummy-9 (_type_) none 9)
|
|
(TODO-RENAME-10 (_type_ vector time-frame float process-drawable) vector 10)
|
|
(play-ambient (_type_ string symbol vector) symbol 11)
|
|
)
|
|
)
|
|
|
|
|
|
(deftype process-taskable (process-drawable)
|
|
((root-override collide-shape :offset 112)
|
|
(tasks task-control :offset-assert 176)
|
|
(query gui-query :inline :offset-assert 180)
|
|
(old-target-pos transformq :inline :offset-assert 208)
|
|
(cell-for-task game-task :offset-assert 256)
|
|
(cell-x handle :offset-assert 264)
|
|
(cam-joint-index int32 :offset-assert 272)
|
|
(skippable symbol :offset-assert 276)
|
|
(blend-on-exit art-joint-anim :offset-assert 280)
|
|
(camera handle :offset-assert 288)
|
|
(will-talk symbol :offset-assert 296)
|
|
(talk-message game-text-id :offset-assert 300)
|
|
(last-talk time-frame :offset-assert 304)
|
|
(bounce-away symbol :offset-assert 312)
|
|
(ambient ambient-control :inline :offset-assert 320)
|
|
(center-joint-index int32 :offset-assert 336)
|
|
(draw-bounds-y-offset float :offset-assert 340)
|
|
(neck-joint-index int32 :offset-assert 344)
|
|
(fuel-cell-anim spool-anim :offset-assert 348)
|
|
(sound-flava music-flava :offset-assert 352)
|
|
(have-flava symbol :offset-assert 356)
|
|
(music symbol :offset-assert 360)
|
|
(have-music symbol :offset-assert 364)
|
|
(been-kicked symbol :offset-assert 368)
|
|
(cur-trans-hook (function none) :offset-assert 372)
|
|
(shadow-backup shadow-geo :offset-assert 376)
|
|
)
|
|
:heap-base #x110
|
|
:method-count-assert 53
|
|
:size-assert #x17c
|
|
:flag-assert #x350110017c
|
|
(:methods
|
|
(release () _type_ :state 20)
|
|
(give-cell () _type_ :state 21)
|
|
(lose () _type_ :state 22)
|
|
(enter-playing () _type_ :state 23)
|
|
(play-accept () _type_ :state 24)
|
|
(play-reject () _type_ :state 25)
|
|
(query () _type_ :state 26)
|
|
(play-anim () _type_ :state 27)
|
|
(hidden () _type_ :state 28)
|
|
(be-clone (handle) _type_ :state 29)
|
|
(idle () _type_ :state 30)
|
|
(get-art-elem (_type_) art-element 31)
|
|
(play-anim! (_type_ symbol) basic 32)
|
|
(dummy-33 (_type_) none 33)
|
|
(get-accept-anim (_type_ symbol) spool-anim 34)
|
|
(push-accept-anim (_type_) none 35)
|
|
(get-reject-anim (_type_ symbol) spool-anim 36)
|
|
(push-reject-anim (_type_) none 37)
|
|
(dummy-38 (_type_) none 38)
|
|
(should-display? (_type_) symbol 39)
|
|
(dummy-40 (_type_ object skeleton-group int int vector int) none 40)
|
|
(initialize-collision (_type_ int vector) none 41)
|
|
(dummy-42 (_type_) none 42)
|
|
(TODO-RENAME-43 (_type_) symbol 43)
|
|
(play-reminder (_type_) symbol 44)
|
|
(dummy-45 (_type_) symbol 45)
|
|
(dummy-46 (_type_) none 46)
|
|
(target-above-threshold? (_type_) symbol 47)
|
|
(draw-npc-shadow (_type_) none 48)
|
|
(hidden-other () _type_ :state 49)
|
|
(TODO-RENAME-50 (_type_) symbol 50)
|
|
(close-anim-file! (_type_) symbol 51)
|
|
(dummy-52 (_type_) none 52)
|
|
)
|
|
)
|
|
|
|
(defun-extern task-known? game-task symbol)
|
|
(defun-extern task-control-reset symbol none)
|
|
|
|
(define-extern task-closed? (function game-task task-status symbol))
|
|
(define-extern get-task-status (function game-task task-status))
|
|
(define-extern get-task-control (function game-task task-control))
|
|
(define-extern close-specific-task! (function game-task task-status game-task))
|