forked from open-goal/jak-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mods-common.gc
173 lines (153 loc) · 5.65 KB
/
mods-common.gc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
;;-*-Lisp-*-
(in-package goal)
;; name: mods-common.gc
;; name in dgo: main
;; dgos: GAME, ENGINE
(define racer? #f)
(define flutflut? #f)
(defun enable-unlockZoomers-20-cells? ()
(-> *randomizer-settings* checkpoint-randomizer?)
)
(defun enable-skip-samos-intro? ()
(-> *randomizer-settings* checkpoint-randomizer?)
)
(defun enable-citadel-cutscene-skips? ()
;; relies on modifcations in collectibles.gc
;; relies on modifcations in assistant-citadel.gc
(-> *randomizer-settings* checkpoint-randomizer?)
)
(defun enable-geyser-spawn-game-start? ()
(-> *randomizer-settings* checkpoint-randomizer?)
)
(defun enable-powercell-cutscenes? ()
;; depends on modifiations in snow-obs (crash)
(and
(not (and
(-> *randomizer-settings* checkpoint-randomizer?)
(-> *randomizer-settings* warp-on-cell?)
))
(-> *mods-settings* mod-powercellcutscenes?)
)
)
(defun enable-unlock-citadel-door-no-cells? ()
;; depends on modifcations in racer.gc
(and
(-> *randomizer-settings* checkpoint-randomizer?)
(or
(= (-> *level* level 0 name) 'lavatube)
(= (-> *level* level 0 name) 'citadel)
)
)
)
(defun enable-pelican-explode-punch? ()
;; depends on modifcations in pelican.gc
(if
(and (-> *randomizer-settings* checkpoint-randomizer?) (-> *randomizer-settings* warp-on-cell?))
(return #t)
)
#f
)
(defun unlock-citadel-door-no-cells ()
;; Unlock citadel door if the randomizer is on. Invis wall is removed elsewhere (racer.gc). Softlocks bad.
(if (entity-by-name "citb-iris-door-21")
;; rather than trigger the warp gate switch at end of lava tube with:
;; (close-specific-task! (game-task village4-button) (task-status need-hint))
;;
;; we break the link between the citadel door's state and the warp gate switch,
;; and then manually open the door
(let ((citb-iris-door-21 (the eco-door (-> (entity-by-name "citb-iris-door-21") extra process))))
(set! (-> citb-iris-door-21 state-actor) #f)
(set! (-> citb-iris-door-21 locked) #f)
)
))
(defun unlockZoomers-20-cells ()
;; Skip the keira zoomer cutscenes if the player has 20 or more cells, or if they have collected the end cell.
(if (or (>= (-> *game-info* fuel) 20) (task-complete? *game-info* (game-task firecanyon-end)) )
(begin
(close-specific-task! (game-task firecanyon-assistant) (task-status need-reward-speech))
))
(if (or (>= (-> *game-info* fuel) 20) (task-complete? *game-info* (game-task lavatube-end)) )
(begin
(close-specific-task! (game-task lavatube-start) (task-status need-reward-speech))
))
)
(defun skip-samos-intro ()
;; Skip the samos cutscenes if the randomizer is on. Cutscenes bad.
(close-specific-task! (game-task intro) (task-status need-resolution))
(close-specific-task! (game-task beach-ecorocks) (task-status need-introduction))
)
(defun change-geyser-spawn-game-start ()
(if (string= (symbol->string (-> (level-get-target-inside *level*) name)) "training")
(set! (-> *game-info* current-continue) (the-as continue-point (get-continue-by-name *game-info* "game-start")))
(none))
)
(defun mods-common-run-each-frame ()
;; Update global variables
(set! racer? (aif *target* (case (-> it next-state name) (
('target-racing
'target-racing-bounce
'target-racing-death
'target-racing-falling
'target-racing-grab
'target-racing-hit
'target-racing-jump
'target-racing-smack
'target-racing-start) #t))))
(set! flutflut? (aif *target* (case (-> it next-state name) (
('target-flut-air-attack
'target-flut-air-attack-hit-ground
'target-flut-double-jump
'target-flut-falling
'target-flut-grab
'target-flut-hit
'target-flut-hit-ground
'target-flut-jump
'target-flut-running-attack
'target-flut-stance
'target-flut-start
'target-flut-walk) #t))))
;; Enable/disable things
(if (enable-unlockZoomers-20-cells?)
(unlockZoomers-20-cells))
(if (enable-skip-samos-intro?)
(skip-samos-intro))
(if (enable-geyser-spawn-game-start?)
(change-geyser-spawn-game-start))
(when (enable-unlock-citadel-door-no-cells?)
(unlock-citadel-door-no-cells)
)
(none)
)
;; Target color functions
(defun draw-xyz ((jak target) (x float) (y float) (z float))
(set! (-> jak draw color-mult x) x)
(set! (-> jak draw color-mult y) y)
(set! (-> jak draw color-mult z) z)
)
(defun draw-normal ((jak target))
(draw-xyz jak 1.0 1.0 1.0)
)
(defun draw-white ((jak target))
(draw-xyz jak 10.0 10.0 10.0)
)
(defun draw-black ((jak target))
(draw-xyz jak 0.0 0.0 0.0)
)
(defun draw-red ((jak target))
(draw-xyz jak 3.0 0.0 0.0)
)
(defun draw-green ((jak target))
(draw-xyz jak 0.0 3.0 0.0)
)
(defun draw-blue ((jak target))
(draw-xyz jak 0.0 0.0 3.0)
)
(defun draw-yellow ((jak target))
(draw-xyz jak 3.0 3.0 0.0)
)
(defun draw-pink ((jak target))
(draw-xyz jak 3.0 0.0 3.0)
)
(defun draw-light-blue ((jak target))
(draw-xyz jak 0.0 3.0 3.0)
)