jak-project/goal_src/jak2/characters/ashelin/ash-task.gc
Hat Kid 8a82c2225e
decomp: ai-task-h, whack, bot, sig, ash files (#2127)
`whack` is missing a single function (`birth-func-whack-score`) that I
couldn't figure out the right args for.

I was not able to test any of this code because I cannot get `atoll` to
extract.
2023-01-14 16:12:03 -05:00

81 lines
2.4 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: ash-task.gc
;; name in dgo: ash-task
;; dgos: ATE, CTYASHA
;; DECOMP BEGINS
(defmethod reset-task! asht-wait-spot ((obj asht-wait-spot))
"Virtual"
(set! (-> obj check-done) #f)
(set! (-> obj which-spot) -1)
(set! (-> obj num-spots) (the-as uint 0))
0
(none)
)
(defmethod ai-task-method-11 asht-wait-spot ((obj asht-wait-spot) (arg0 bot))
"Virtual"
(let ((s4-0 (-> obj which-spot)))
(when (>= s4-0 0)
(let ((s3-0 (-> arg0 course spots (-> obj spot-indexes s4-0))))
(if (and (not (outside-spot-radius? arg0 s3-0 (the-as vector #f) #f)) (player-blocking-spot? arg0 s3-0))
(set! s4-0 -1)
)
)
)
(when (< s4-0 0)
(set! s4-0 (choose-spot arg0 (the-as int (-> obj num-spots)) (the-as (pointer uint) (-> obj spot-indexes))))
(set! (-> obj which-spot) s4-0)
(mem-copy!
(the-as pointer (-> arg0 spot))
(the-as pointer (-> arg0 course spots (-> obj spot-indexes s4-0)))
20
)
)
(if (logtest? *display-bot-marks* (bot-marks-controls bmc16))
(bot-debug-draw-spot-sphere
arg0
(the-as int (-> obj num-spots))
(the-as (pointer uint) (-> obj spot-indexes))
(the-as int (-> obj spot-indexes s4-0))
)
)
)
(when (not ((-> obj check-done) obj (the-as ashelin arg0)))
(let ((a1-10 (handle->process (-> arg0 focus handle))))
(when (and a1-10
(attacked-by-player? arg0 (the-as process-focusable a1-10))
(zero? (logand (-> arg0 focus-status) (focus-status grabbed)))
)
(get-task-by-type (-> arg0 ai-ctrl) asht-fight-focus arg0)
(ai-task-control-method-10 (-> arg0 ai-ctrl) arg0)
)
)
)
(none)
)
(defmethod ai-task-method-11 asht-fight-focus ((obj asht-fight-focus) (arg0 bot))
"Virtual"
(let ((a1-1 (handle->process (-> arg0 focus handle))))
(if (and a1-1
(attacked-by-player? arg0 (the-as process-focusable a1-1))
(zero? (logand (-> arg0 focus-status) (focus-status grabbed)))
)
(logior! (-> arg0 bot-flags) (bot-flags bf00))
(ai-task-control-method-14 (-> arg0 ai-ctrl) obj arg0)
)
)
(none)
)
;; WARN: Return type mismatch bot-flags vs none.
(defmethod ai-task-method-10 asht-fight-focus ((obj asht-fight-focus) (arg0 bot))
"Virtual"
(logclear! (-> arg0 bot-flags) (bot-flags bf00))
(none)
)