jak-project/goal_src/jak3/engine/game/game-info-h.gc

468 lines
13 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: game-info-h.gc
;; name in dgo: game-info-h
;; dgos: GAME
;; +++game-items
(defenum game-items
:type uint64
:bitfield #t
(amulet0 0)
(amulet1 1)
(amulet2 2)
(pass-front-gate 3)
(seal-of-mar 4)
(cypher-gliph 5)
(artifact-holocube 6)
(artifact-av-reflector 7)
(artifact-av-prism 8)
(artifact-av-generator 9)
(artifact-av-map 10)
(light-eco-crystal0 11)
(light-eco-crystal1 12)
(light-eco-crystal2 13)
(light-eco-crystal3 14)
(dark-eco-crystal0 15)
(dark-eco-crystal1 16)
(dark-eco-crystal2 17)
(dark-eco-crystal3 18)
(item19 19)
(item20 20)
(item21 21)
(item22 22)
(item23 23)
(item24 24)
(item25 25)
(item26 26)
(item27 27)
(item28 28)
(item29 29)
(item30 30)
(item31 31)
)
;; ---game-items
;; +++pickup-type
(defenum pickup-type
:type int32
(none 0)
(eco-yellow 1)
(eco-red 2)
(eco-blue 3)
(eco-dark 4)
(eco-green 5)
(eco-pill-green 6)
(eco-pill-dark 7)
(eco-pill-light 8)
(eco-pill-random 9)
(money 10)
(fuel-cell 11)
(buzzer 12)
(darkjak 13)
(lightjak 14)
(ammo-yellow 15)
(ammo-red 16)
(ammo-blue 17)
(ammo-dark 18)
(shield 19)
(health 20)
(trick-point 21)
(trick-judge 22)
(gem 23)
(skill 24)
(karma 25)
(gun-red-1 26)
(gun-red-2 27)
(gun-red-3 28)
(gun-yellow-1 29)
(gun-yellow-2 30)
(gun-yellow-3 31)
(gun-blue-1 32)
(gun-blue-2 33)
(gun-blue-3 34)
(gun-dark-1 35)
(gun-dark-2 36)
(gun-dark-3 37)
(board 38)
(pass-red 39)
(pass-green 40)
(pass-yellow 41)
(pass-blue 42)
(ammo-random 43)
(health-max 44)
(light-eco-crystal 45)
(dark-eco-crystal 46)
(pass-slumb-genb 47)
(ammo-light-random 48)
(ammo-dark-light-random 49)
(light-random 50)
)
;; ---pickup-type
;; +++highscore-flags
(defenum highscore-flags
:bitfield #t
:type uint8
(time)
(hf1 1)
(hf2 2)
(hf3 3)
(hf4 4)
(hf5 5)
(hf6 6)
(hf7 7)
)
;; ---highscore-flags
;; +++continue-flags
(defenum continue-flags
:type uint32
:bitfield #t
;(continue-flag-0 0)
(scene-wait 1)
(change-continue 2)
(no-auto 3)
(no-blackout 4)
(game-start 5)
(grab)
(warp-gate 7)
(demo 8)
(intro 9)
(hero-mode 10)
(darkjak)
(title 12)
(title-movie 13)
(continue-flag-14 14)
(copy-entity-pos 15)
(test)
(nothing-apparently 17)
(race 18)
(credits)
(indax)
(mech)
(continue-flag-22 22)
(flut 23)
(flut-racer 24)
(vehicle 25)
(vehicle-movie 26)
(indax-hang 27)
(flut-fight 28)
(htorpedo 29)
(vehicle-scorpion 30)
(lightjak 31)
)
;; ---continue-flags
(declare-type game-info basic)
(define-extern *game-info* game-info)
(declare-type entity-perm-array inline-array-class)
(declare-type game-save basic)
(declare-type entity-perm structure)
(define-extern cam-master-activate-slave (function symbol none))
(define-extern position-in-front-of-camera! (function vector float float vector))
;; DECOMP BEGINS
(local-vars (gp-0 game-info))
(deftype game-bank (basic)
((life-max-default float)
(life-start-default float)
(life-single-inc float)
(money-task-inc float)
(money-oracle-inc float)
)
)
(define *GAME-bank* (new 'static 'game-bank
:life-max-default 99.0
:life-start-default 5.0
:life-single-inc 1.0
:money-task-inc 90.0
:money-oracle-inc 120.0
)
)
(deftype actor-id (uint32)
()
)
(deftype highscore-info (structure)
((flags highscore-flags)
(award-scores float 3)
(bronze-score float :overlay-at (-> award-scores 0))
(silver-score float :overlay-at (-> award-scores 1))
(gold-score float :overlay-at (-> award-scores 2))
)
(:methods
(get-rank (_type_ float) int)
)
)
(deftype level-buffer-state (structure)
((name symbol)
(display? symbol)
(force-vis? symbol)
(force-inside? symbol)
)
:pack-me
)
(deftype level-buffer-state-small (structure)
((name symbol)
(display? symbol)
)
:pack-me
)
(deftype load-state (basic)
((want level-buffer-state 10 :inline)
(want-exp level-buffer-state 10 :inline)
(target level-buffer-state 10 :inline)
(want-sound sound-bank-state 3 :inline)
(want-exp-sound sound-bank-state 6 :inline)
(target-sound sound-bank-state 6 :inline)
(vis-nick symbol)
(command-list pair)
(object-name string 256)
(object-status basic 256)
(update-callback (function load-state object))
)
(:methods
(new (symbol type) _type_)
(reset! (_type_) _type_)
(update! (_type_) int)
(want-levels (_type_ (pointer symbol)) int)
(want-sound-banks (_type_ (pointer symbol)) none)
(want-display-level (_type_ symbol symbol) int)
(want-vis-level (_type_ symbol) none)
(want-force-vis (_type_ symbol symbol) int)
(want-force-inside (_type_ symbol symbol) none)
(execute-commands-up-to (_type_ float) none)
(backup-load-state-and-set-cmds (_type_ pair) int)
(restore-load-state-and-cleanup (_type_) int)
(restore-load-state (_type_) int)
(add-borrow-levels (_type_) none)
)
)
(defmethod new load-state ((allocation symbol) (type-to-make type))
(let ((a0-1 (object-new allocation type-to-make (the-as int (-> type-to-make size)))))
(set! (-> a0-1 update-callback) #f)
(reset! a0-1)
)
)
(deftype continue-point (basic)
((name string)
(level symbol)
(flags continue-flags)
(trans vector :inline)
(camera-trans vector :inline)
(quat vector4h :inline)
(camera-rot int16 9)
(on-goto object)
(vis-nick symbol)
(vehicle-type uint8)
(want-count int8)
(want (inline-array level-buffer-state-small))
(want-sound symbol 3)
)
(:methods
(debug-draw (_type_) int)
(continue-point-method-10 (_type_ load-state) continue-point)
(move-camera! (_type_) none)
)
)
(deftype game-info (basic)
((mode symbol)
(save-name string)
(life float)
(life-max float)
(money float)
(money-total float)
(money-per-level uint8 32)
(deaths-per-level uint8 32)
(buzzer-total float)
(fuel float)
(gem float)
(gem-total float)
(skill float)
(skill-total float)
(skill-high-watermark float)
(light-crystal float)
(dark-crystal float)
(karma float)
(eco-pill-dark float)
(eco-pill-dark-total float)
(eco-pill-light float)
(eco-pill-light-total float)
(features game-feature)
(debug-features game-feature)
(old-features game-feature)
(items game-items)
(debug-items game-items)
(old-items game-items)
(secrets game-secrets)
(purchase-secrets game-secrets)
(gun-type pickup-type)
(gun-ammo float 4)
(shield float)
(vehicles game-vehicles)
(debug-vehicles game-vehicles)
(old-vehicles game-vehicles)
(score float)
(score-owner handle)
(timer time-frame)
(timer-owner handle)
(timer-flash symbol)
(counter float)
(counter-flash symbol)
(health-bar float)
(health-bar-owner handle)
(enemies-killed float)
(civilians-killed float)
(marauders-killed float)
(shots-fired float 4)
(shots-hit float 4)
(crates-opened float)
(health-collected float)
(board-time time-frame)
(attack-id uint32)
(perm-list entity-perm-array)
(task-perm-list entity-perm-array)
(current-continue continue-point)
(last-continue continue-point)
(play-list (array game-task-info))
(sub-task-list (array game-task-node-info))
(mission-list (array game-task-node-info))
(task-node-commands (array game-task-node-command))
(task-node-exclusive (array uint16))
(task-counter uint32)
(unknown-arr4 (array uint16))
(level-opened uint8 32)
(total-deaths int32)
(continue-deaths int32)
(task-deaths int32)
(total-trys int32)
(game-start-time time-frame)
(continue-time time-frame)
(death-time time-frame)
(hit-time time-frame)
(task-pickup-time time-frame)
(task-complete-time (array time-frame))
(task-enter-times (array time-frame))
(task-in-times (array time-frame))
(death-pos vector-array)
(stop-watch-start time-frame)
(stop-watch-stop time-frame)
(blackout-time time-frame)
(letterbox-time time-frame)
(hint-play-time time-frame)
(display-text-time time-frame)
(display-text-handle handle)
(death-movie-tick int32)
(want-auto-save symbol)
(auto-save-proc handle)
(auto-save-status mc-status-code)
(auto-save-card int32)
(auto-save-which int32)
(auto-save-count int32)
(pov-camera-handle handle)
(other-camera-handle handle)
(controller handle 2)
(race-timer time-frame)
(race-current-lap-count int32)
(race-total-lap-count int32)
(race-position int32)
(race-number-turbos int32)
(bot-health float 3)
(demo-state uint32)
(wanted-flash symbol)
(distance float)
(kiosk-timeout time-frame)
(pause-start-time time-frame)
(game-score (array float))
(goal float)
(miss float)
(miss-max float)
(task-start-time (array time-frame))
(live-eco-pill-count int32)
(live-gem-count int32)
(air-supply float)
(homing-beacon int32)
(dark-eco-pickup int32)
(green-eco-pickup int32)
(health-bar-vehicle float)
(dust-storm handle)
(flut-count int32)
(death-resetter resetter-spec :inline)
(current-vehicle vehicle-type-u8)
(vehicle-turbo-ready float)
(percent-complete float)
)
(:methods
(initialize! (_type_ symbol game-save string resetter-spec) _type_)
(give (_type_ symbol float handle) float)
(task-complete? (_type_ game-task) symbol)
(subtask-index-by-name (_type_ string) int)
(actor-perm (_type_ actor-id) entity-perm)
(task-perm-by-index (_type_ int) entity-perm)
(copy-perms-from-level! (_type_ level) int)
(copy-perms-to-level! (_type_ level) int)
(debug-inspect (_type_ symbol) _type_)
(get-current-continue-forced (_type_) continue-point)
(get-continue-by-name (_type_ string) continue-point)
(set-continue! (_type_ basic symbol) continue-point)
(game-info-method-21 (_type_) none)
(save-game (_type_ game-save string) game-save)
(load-game (_type_ game-save) game-save)
(you-suck-stage (_type_ symbol int) int)
(you-suck-scale (_type_ symbol int) float)
(get-next-attack-id! (_type_) uint)
(game-info-method-27 (_type_ game-score float) int)
(get-game-score-ref (_type_ int) (pointer float))
(game-info-method-29 (_type_ int) int)
(get-highscore-rank (_type_ int float) int)
(game-info-method-31 (_type_ int int) float)
(calculate-percentage (_type_) float)
(inc-death-count! (_type_) none)
(get-max-ammo-for-gun (_type_ pickup-type) float)
)
)
(defmethod get-next-attack-id! ((this game-info))
(let ((v0-0 (+ (-> this attack-id) 1)))
(set! (-> this attack-id) v0-0)
v0-0
)
)
(set! gp-0
(when (or (not *game-info*) (zero? *game-info*))
(set! gp-0 (new 'static 'game-info :mode 'debug :current-continue #f :last-continue #f))
(set! (-> gp-0 task-complete-time) (the-as (array time-frame) (new 'global 'boxed-array uint64 138)))
(set! (-> gp-0 task-start-time) (the-as (array time-frame) (new 'global 'boxed-array uint64 138)))
(set! (-> gp-0 task-enter-times) (the-as (array time-frame) (new 'global 'boxed-array uint64 32)))
(set! (-> gp-0 task-in-times) (the-as (array time-frame) (new 'global 'boxed-array uint64 32)))
(set! *game-info* gp-0)
gp-0
)
)