diff --git a/decompiler/config/jak2/all-types.gc b/decompiler/config/jak2/all-types.gc index 230424dc56..9d2f553356 100644 --- a/decompiler/config/jak2/all-types.gc +++ b/decompiler/config/jak2/all-types.gc @@ -7381,6 +7381,7 @@ (progress-cheats-board-tricks #x1260) (progress-cheats-weather-bad #x1261) (progress-cheats-weather-good #x1262) + (progress-cheats-hijack-lines #x1263) (progress-camera-options #x1280) (progress-camera-options-first-horz #x1281) (progress-camera-options-first-vert #x1282) diff --git a/game/assets/jak2/text/game_custom_text_en-US.json b/game/assets/jak2/text/game_custom_text_en-US.json index 55f695da01..7f319ea9d1 100644 --- a/game/assets/jak2/text/game_custom_text_en-US.json +++ b/game/assets/jak2/text/game_custom_text_en-US.json @@ -107,6 +107,7 @@ "1260": "JET-Board Trick Display", "1261": "Bad Weather", "1262": "Nice Weather", + "1263": "Vehicle Hijack Voice Lines", "1280": "Camera Options", "1281": "Left/Right (1st Person)", "1282": "Up/Down (1st Person)", diff --git a/goal_src/jak2/engine/ui/text-id-h.gc b/goal_src/jak2/engine/ui/text-id-h.gc index e009a797c4..6136e12cfc 100644 --- a/goal_src/jak2/engine/ui/text-id-h.gc +++ b/goal_src/jak2/engine/ui/text-id-h.gc @@ -696,6 +696,7 @@ (progress-cheats-board-tricks #x1260) (progress-cheats-weather-bad #x1261) (progress-cheats-weather-good #x1262) + (progress-cheats-hijack-lines #x1263) (progress-camera-options #x1280) (progress-camera-options-first-horz #x1281) (progress-camera-options-first-vert #x1282) diff --git a/goal_src/jak2/levels/city/common/target-pilot.gc b/goal_src/jak2/levels/city/common/target-pilot.gc index 0b3fd6cc7c..74cc5819f1 100644 --- a/goal_src/jak2/levels/city/common/target-pilot.gc +++ b/goal_src/jak2/levels/city/common/target-pilot.gc @@ -12,6 +12,19 @@ ) ) +;; added for hijack lines cheat +(define *jak-hijack-speeches* (new 'static 'boxed-array :type string + "jak040" "jak041" "jak042" "jak044" "jak045" "jak046" + "jak047" "jak048" "jak049" "jak050" "jak051" "jak052" + "jak053" "jak054" "jak055" + ) + ) + +(define *civ-hijack-speeches* (new 'static 'boxed-array :type string + "cit051" "cit053" "cit055" "cit056" "cit057" "cit058" + ) + ) + ;; DECOMP BEGINS (define *pilot-mods* (new 'static 'surface :name 'empty :seek0 1.0 :seek90 1.0 :seek180 1.0 :fric 1.0)) @@ -214,6 +227,20 @@ (let ((s3-0 (get-seat-count (the-as vehicle s4-1)))) (dotimes (s2-0 s3-0) (let ((a0-20 (get-rider-in-seat (the-as vehicle s4-1) s2-0))) + ;; og:preserve-this added for hijack lines cheat + (when (and a0-20 (or (type-type? (-> a0-20 type) citizen-norm-rider) (type-type? (-> a0-20 type) crimson-guard-rider))) + (let ((cheat? (pc-cheats? (-> *pc-settings* cheats) hijack-lines)) + (chance? (rand-vu-percent? (-> *pc-cheat-state* hijack-speech-chance)))) + (when (and cheat? chance?) + (add-process *gui-control* self (gui-channel jak) (gui-action play) + (-> *jak-hijack-speeches* (rand-vu-int-range 0 (1- (-> *jak-hijack-speeches* length)))) -99.0 0) + (if (type-type? (-> a0-20 type) citizen-norm-rider) + (add-process *gui-control* self (gui-channel jak) (gui-action play) + (-> *civ-hijack-speeches* (rand-vu-int-range 0 (1- (-> *civ-hijack-speeches* length)))) -99.0 0) + ) + ) + ) + ) (if (and a0-20 (send-event a0-20 'knocked-off)) (put-rider-in-seat (the-as vehicle s4-1) s2-0 (the-as process-focusable #f)) ) diff --git a/goal_src/jak2/pc/pckernel-impl.gc b/goal_src/jak2/pc/pckernel-impl.gc index aba53d456a..2dd593225b 100644 --- a/goal_src/jak2/pc/pckernel-impl.gc +++ b/goal_src/jak2/pc/pckernel-impl.gc @@ -20,7 +20,7 @@ ;; cheats -(defconstant PC_CHEAT_MAX 19) ;; number of cheats +(defconstant PC_CHEAT_MAX 20) ;; number of cheats (defenum pc-cheats :bitfield #t :type uint64 @@ -43,6 +43,7 @@ (board-tricks) (weather-bad) (weather-good) + (hijack-lines) ) ;; pc enum for languages. this is the game's languages + custom ones. @@ -232,6 +233,7 @@ (airlock-speed float) (airlock-close-speed float) (turbo-board-speed float) + (hijack-speech-chance float) (flags pc-cheat-state-flag) ) ) @@ -241,6 +243,7 @@ :airlock-speed 1.75 :airlock-close-speed 1.75 :turbo-board-speed 1.5 + :hijack-speech-chance 0.45 )) (defmacro cheat-state-flag? (&rest flags)