From 1c083fe0004c2b952da3bd8e45de0c4139f62786 Mon Sep 17 00:00:00 2001 From: Peter Kohaut Date: Thu, 23 Mar 2017 16:20:10 +0100 Subject: BLADERUNNER: Reorganized script files --- engines/bladerunner/actor.cpp | 9 +- engines/bladerunner/adq.cpp | 4 +- engines/bladerunner/bladerunner.cpp | 33 +- engines/bladerunner/bladerunner.h | 4 +- engines/bladerunner/module.mk | 232 +-- engines/bladerunner/scene.cpp | 14 +- engines/bladerunner/script/ai.cpp | 168 ++ engines/bladerunner/script/ai.h | 174 ++ engines/bladerunner/script/ai/mccoy.cpp | 1851 +++++++++++++++++++ engines/bladerunner/script/ai/officer_leroy.cpp | 1214 +++++++++++++ engines/bladerunner/script/ai/runciter.cpp | 653 +++++++ engines/bladerunner/script/ai_00_mccoy.cpp | 1855 -------------------- engines/bladerunner/script/ai_00_mccoy.h | 83 - engines/bladerunner/script/ai_15_runciter.cpp | 656 ------- engines/bladerunner/script/ai_15_runciter.h | 65 - engines/bladerunner/script/ai_23_officer_leroy.cpp | 1217 ------------- engines/bladerunner/script/ai_23_officer_leroy.h | 66 - engines/bladerunner/script/ar01.cpp | 361 ---- engines/bladerunner/script/ar02.cpp | 388 ---- engines/bladerunner/script/bb01.cpp | 231 --- engines/bladerunner/script/bb02.cpp | 159 -- engines/bladerunner/script/bb03.cpp | 161 -- engines/bladerunner/script/bb04.cpp | 130 -- engines/bladerunner/script/bb05.cpp | 213 --- engines/bladerunner/script/bb06.cpp | 177 -- engines/bladerunner/script/bb07.cpp | 184 -- engines/bladerunner/script/bb08.cpp | 136 -- engines/bladerunner/script/bb09.cpp | 124 -- engines/bladerunner/script/bb10.cpp | 205 --- engines/bladerunner/script/bb11.cpp | 132 -- engines/bladerunner/script/bb12.cpp | 144 -- engines/bladerunner/script/bb51.cpp | 123 -- engines/bladerunner/script/ct01.cpp | 515 ------ engines/bladerunner/script/ct02.cpp | 294 ---- engines/bladerunner/script/ct03.cpp | 132 -- engines/bladerunner/script/ct04.cpp | 237 --- engines/bladerunner/script/ct05.cpp | 241 --- engines/bladerunner/script/ct06.cpp | 180 -- engines/bladerunner/script/ct07.cpp | 104 -- engines/bladerunner/script/ct08.cpp | 196 --- engines/bladerunner/script/ct09.cpp | 214 --- engines/bladerunner/script/ct10.cpp | 160 -- engines/bladerunner/script/ct11.cpp | 213 --- engines/bladerunner/script/ct12.cpp | 284 --- engines/bladerunner/script/ct51.cpp | 129 -- engines/bladerunner/script/dr01.cpp | 262 --- engines/bladerunner/script/dr02.cpp | 183 -- engines/bladerunner/script/dr03.cpp | 288 --- engines/bladerunner/script/dr04.cpp | 269 --- engines/bladerunner/script/dr05.cpp | 189 -- engines/bladerunner/script/dr06.cpp | 224 --- engines/bladerunner/script/hc01.cpp | 433 ----- engines/bladerunner/script/hc02.cpp | 216 --- engines/bladerunner/script/hc03.cpp | 188 -- engines/bladerunner/script/hc04.cpp | 242 --- engines/bladerunner/script/hf01.cpp | 475 ----- engines/bladerunner/script/hf02.cpp | 144 -- engines/bladerunner/script/hf03.cpp | 254 --- engines/bladerunner/script/hf04.cpp | 167 -- engines/bladerunner/script/hf05.cpp | 673 ------- engines/bladerunner/script/hf06.cpp | 286 --- engines/bladerunner/script/hf07.cpp | 154 -- engines/bladerunner/script/kp01.cpp | 171 -- engines/bladerunner/script/kp02.cpp | 147 -- engines/bladerunner/script/kp03.cpp | 262 --- engines/bladerunner/script/kp04.cpp | 118 -- engines/bladerunner/script/kp05.cpp | 171 -- engines/bladerunner/script/kp06.cpp | 237 --- engines/bladerunner/script/kp07.cpp | 178 -- engines/bladerunner/script/ma01.cpp | 257 --- engines/bladerunner/script/ma02.cpp | 267 --- engines/bladerunner/script/ma04.cpp | 565 ------ engines/bladerunner/script/ma05.cpp | 142 -- engines/bladerunner/script/ma06.cpp | 154 -- engines/bladerunner/script/ma07.cpp | 159 -- engines/bladerunner/script/ma08.cpp | 81 - engines/bladerunner/script/nr01.cpp | 436 ----- engines/bladerunner/script/nr02.cpp | 215 --- engines/bladerunner/script/nr03.cpp | 351 ---- engines/bladerunner/script/nr04.cpp | 358 ---- engines/bladerunner/script/nr05.cpp | 369 ---- engines/bladerunner/script/nr06.cpp | 162 -- engines/bladerunner/script/nr07.cpp | 379 ---- engines/bladerunner/script/nr08.cpp | 242 --- engines/bladerunner/script/nr09.cpp | 145 -- engines/bladerunner/script/nr10.cpp | 164 -- engines/bladerunner/script/nr11.cpp | 382 ---- engines/bladerunner/script/ps01.cpp | 277 --- engines/bladerunner/script/ps02.cpp | 177 -- engines/bladerunner/script/ps03.cpp | 134 -- engines/bladerunner/script/ps04.cpp | 304 ---- engines/bladerunner/script/ps05.cpp | 273 --- engines/bladerunner/script/ps06.cpp | 137 -- engines/bladerunner/script/ps07.cpp | 189 -- engines/bladerunner/script/ps09.cpp | 354 ---- engines/bladerunner/script/ps10.cpp | 248 --- engines/bladerunner/script/ps11.cpp | 285 --- engines/bladerunner/script/ps12.cpp | 302 ---- engines/bladerunner/script/ps13.cpp | 285 --- engines/bladerunner/script/ps14.cpp | 127 -- engines/bladerunner/script/ps15.cpp | 173 -- engines/bladerunner/script/rc01.cpp | 623 ------- engines/bladerunner/script/rc02.cpp | 392 ----- engines/bladerunner/script/rc03.cpp | 301 ---- engines/bladerunner/script/rc04.cpp | 420 ----- engines/bladerunner/script/rc51.cpp | 130 -- engines/bladerunner/script/scene.cpp | 152 ++ engines/bladerunner/script/scene.h | 559 ++++++ engines/bladerunner/script/scene/ar01.cpp | 361 ++++ engines/bladerunner/script/scene/ar02.cpp | 388 ++++ engines/bladerunner/script/scene/bb01.cpp | 231 +++ engines/bladerunner/script/scene/bb02.cpp | 159 ++ engines/bladerunner/script/scene/bb03.cpp | 161 ++ engines/bladerunner/script/scene/bb04.cpp | 130 ++ engines/bladerunner/script/scene/bb05.cpp | 213 +++ engines/bladerunner/script/scene/bb06.cpp | 177 ++ engines/bladerunner/script/scene/bb07.cpp | 184 ++ engines/bladerunner/script/scene/bb08.cpp | 136 ++ engines/bladerunner/script/scene/bb09.cpp | 124 ++ engines/bladerunner/script/scene/bb10.cpp | 205 +++ engines/bladerunner/script/scene/bb11.cpp | 132 ++ engines/bladerunner/script/scene/bb12.cpp | 144 ++ engines/bladerunner/script/scene/bb51.cpp | 123 ++ engines/bladerunner/script/scene/ct01.cpp | 515 ++++++ engines/bladerunner/script/scene/ct02.cpp | 294 ++++ engines/bladerunner/script/scene/ct03.cpp | 132 ++ engines/bladerunner/script/scene/ct04.cpp | 237 +++ engines/bladerunner/script/scene/ct05.cpp | 241 +++ engines/bladerunner/script/scene/ct06.cpp | 180 ++ engines/bladerunner/script/scene/ct07.cpp | 104 ++ engines/bladerunner/script/scene/ct08.cpp | 196 +++ engines/bladerunner/script/scene/ct09.cpp | 214 +++ engines/bladerunner/script/scene/ct10.cpp | 160 ++ engines/bladerunner/script/scene/ct11.cpp | 213 +++ engines/bladerunner/script/scene/ct12.cpp | 284 +++ engines/bladerunner/script/scene/ct51.cpp | 129 ++ engines/bladerunner/script/scene/dr01.cpp | 262 +++ engines/bladerunner/script/scene/dr02.cpp | 183 ++ engines/bladerunner/script/scene/dr03.cpp | 288 +++ engines/bladerunner/script/scene/dr04.cpp | 269 +++ engines/bladerunner/script/scene/dr05.cpp | 189 ++ engines/bladerunner/script/scene/dr06.cpp | 224 +++ engines/bladerunner/script/scene/hc01.cpp | 433 +++++ engines/bladerunner/script/scene/hc02.cpp | 216 +++ engines/bladerunner/script/scene/hc03.cpp | 188 ++ engines/bladerunner/script/scene/hc04.cpp | 242 +++ engines/bladerunner/script/scene/hf01.cpp | 475 +++++ engines/bladerunner/script/scene/hf02.cpp | 144 ++ engines/bladerunner/script/scene/hf03.cpp | 254 +++ engines/bladerunner/script/scene/hf04.cpp | 167 ++ engines/bladerunner/script/scene/hf05.cpp | 673 +++++++ engines/bladerunner/script/scene/hf06.cpp | 286 +++ engines/bladerunner/script/scene/hf07.cpp | 154 ++ engines/bladerunner/script/scene/kp01.cpp | 171 ++ engines/bladerunner/script/scene/kp02.cpp | 147 ++ engines/bladerunner/script/scene/kp03.cpp | 262 +++ engines/bladerunner/script/scene/kp04.cpp | 118 ++ engines/bladerunner/script/scene/kp05.cpp | 171 ++ engines/bladerunner/script/scene/kp06.cpp | 237 +++ engines/bladerunner/script/scene/kp07.cpp | 178 ++ engines/bladerunner/script/scene/ma01.cpp | 257 +++ engines/bladerunner/script/scene/ma02.cpp | 267 +++ engines/bladerunner/script/scene/ma04.cpp | 565 ++++++ engines/bladerunner/script/scene/ma05.cpp | 142 ++ engines/bladerunner/script/scene/ma06.cpp | 154 ++ engines/bladerunner/script/scene/ma07.cpp | 159 ++ engines/bladerunner/script/scene/ma08.cpp | 81 + engines/bladerunner/script/scene/nr01.cpp | 436 +++++ engines/bladerunner/script/scene/nr02.cpp | 215 +++ engines/bladerunner/script/scene/nr03.cpp | 351 ++++ engines/bladerunner/script/scene/nr04.cpp | 358 ++++ engines/bladerunner/script/scene/nr05.cpp | 369 ++++ engines/bladerunner/script/scene/nr06.cpp | 162 ++ engines/bladerunner/script/scene/nr07.cpp | 379 ++++ engines/bladerunner/script/scene/nr08.cpp | 242 +++ engines/bladerunner/script/scene/nr09.cpp | 145 ++ engines/bladerunner/script/scene/nr10.cpp | 164 ++ engines/bladerunner/script/scene/nr11.cpp | 382 ++++ engines/bladerunner/script/scene/ps01.cpp | 277 +++ engines/bladerunner/script/scene/ps02.cpp | 177 ++ engines/bladerunner/script/scene/ps03.cpp | 134 ++ engines/bladerunner/script/scene/ps04.cpp | 304 ++++ engines/bladerunner/script/scene/ps05.cpp | 273 +++ engines/bladerunner/script/scene/ps06.cpp | 137 ++ engines/bladerunner/script/scene/ps07.cpp | 189 ++ engines/bladerunner/script/scene/ps09.cpp | 354 ++++ engines/bladerunner/script/scene/ps10.cpp | 248 +++ engines/bladerunner/script/scene/ps11.cpp | 285 +++ engines/bladerunner/script/scene/ps12.cpp | 302 ++++ engines/bladerunner/script/scene/ps13.cpp | 285 +++ engines/bladerunner/script/scene/ps14.cpp | 127 ++ engines/bladerunner/script/scene/ps15.cpp | 173 ++ engines/bladerunner/script/scene/rc01.cpp | 623 +++++++ engines/bladerunner/script/scene/rc02.cpp | 392 +++++ engines/bladerunner/script/scene/rc03.cpp | 301 ++++ engines/bladerunner/script/scene/rc04.cpp | 420 +++++ engines/bladerunner/script/scene/rc51.cpp | 130 ++ engines/bladerunner/script/scene/tb02.cpp | 469 +++++ engines/bladerunner/script/scene/tb03.cpp | 155 ++ engines/bladerunner/script/scene/tb05.cpp | 197 +++ engines/bladerunner/script/scene/tb06.cpp | 192 ++ engines/bladerunner/script/scene/tb07.cpp | 290 +++ engines/bladerunner/script/scene/ug01.cpp | 179 ++ engines/bladerunner/script/scene/ug02.cpp | 256 +++ engines/bladerunner/script/scene/ug03.cpp | 145 ++ engines/bladerunner/script/scene/ug04.cpp | 140 ++ engines/bladerunner/script/scene/ug05.cpp | 275 +++ engines/bladerunner/script/scene/ug06.cpp | 161 ++ engines/bladerunner/script/scene/ug07.cpp | 193 ++ engines/bladerunner/script/scene/ug08.cpp | 145 ++ engines/bladerunner/script/scene/ug09.cpp | 153 ++ engines/bladerunner/script/scene/ug10.cpp | 234 +++ engines/bladerunner/script/scene/ug12.cpp | 122 ++ engines/bladerunner/script/scene/ug13.cpp | 410 +++++ engines/bladerunner/script/scene/ug14.cpp | 193 ++ engines/bladerunner/script/scene/ug15.cpp | 203 +++ engines/bladerunner/script/scene/ug16.cpp | 369 ++++ engines/bladerunner/script/scene/ug17.cpp | 117 ++ engines/bladerunner/script/scene/ug18.cpp | 407 +++++ engines/bladerunner/script/scene/ug19.cpp | 139 ++ engines/bladerunner/script/script.cpp | 257 --- engines/bladerunner/script/script.h | 585 ------ engines/bladerunner/script/tb02.cpp | 469 ----- engines/bladerunner/script/tb03.cpp | 155 -- engines/bladerunner/script/tb05.cpp | 197 --- engines/bladerunner/script/tb06.cpp | 192 -- engines/bladerunner/script/tb07.cpp | 290 --- engines/bladerunner/script/ug01.cpp | 179 -- engines/bladerunner/script/ug02.cpp | 256 --- engines/bladerunner/script/ug03.cpp | 145 -- engines/bladerunner/script/ug04.cpp | 140 -- engines/bladerunner/script/ug05.cpp | 275 --- engines/bladerunner/script/ug06.cpp | 161 -- engines/bladerunner/script/ug07.cpp | 193 -- engines/bladerunner/script/ug08.cpp | 145 -- engines/bladerunner/script/ug09.cpp | 153 -- engines/bladerunner/script/ug10.cpp | 234 --- engines/bladerunner/script/ug12.cpp | 122 -- engines/bladerunner/script/ug13.cpp | 410 ----- engines/bladerunner/script/ug14.cpp | 193 -- engines/bladerunner/script/ug15.cpp | 203 --- engines/bladerunner/script/ug16.cpp | 369 ---- engines/bladerunner/script/ug17.cpp | 117 -- engines/bladerunner/script/ug18.cpp | 407 ----- engines/bladerunner/script/ug19.cpp | 139 -- 245 files changed, 31725 insertions(+), 31728 deletions(-) create mode 100644 engines/bladerunner/script/ai.cpp create mode 100644 engines/bladerunner/script/ai.h create mode 100644 engines/bladerunner/script/ai/mccoy.cpp create mode 100644 engines/bladerunner/script/ai/officer_leroy.cpp create mode 100644 engines/bladerunner/script/ai/runciter.cpp delete mode 100644 engines/bladerunner/script/ai_00_mccoy.cpp delete mode 100644 engines/bladerunner/script/ai_00_mccoy.h delete mode 100644 engines/bladerunner/script/ai_15_runciter.cpp delete mode 100644 engines/bladerunner/script/ai_15_runciter.h delete mode 100644 engines/bladerunner/script/ai_23_officer_leroy.cpp delete mode 100644 engines/bladerunner/script/ai_23_officer_leroy.h delete mode 100644 engines/bladerunner/script/ar01.cpp delete mode 100644 engines/bladerunner/script/ar02.cpp delete mode 100644 engines/bladerunner/script/bb01.cpp delete mode 100644 engines/bladerunner/script/bb02.cpp delete mode 100644 engines/bladerunner/script/bb03.cpp delete mode 100644 engines/bladerunner/script/bb04.cpp delete mode 100644 engines/bladerunner/script/bb05.cpp delete mode 100644 engines/bladerunner/script/bb06.cpp delete mode 100644 engines/bladerunner/script/bb07.cpp delete mode 100644 engines/bladerunner/script/bb08.cpp delete mode 100644 engines/bladerunner/script/bb09.cpp delete mode 100644 engines/bladerunner/script/bb10.cpp delete mode 100644 engines/bladerunner/script/bb11.cpp delete mode 100644 engines/bladerunner/script/bb12.cpp delete mode 100644 engines/bladerunner/script/bb51.cpp delete mode 100644 engines/bladerunner/script/ct01.cpp delete mode 100644 engines/bladerunner/script/ct02.cpp delete mode 100644 engines/bladerunner/script/ct03.cpp delete mode 100644 engines/bladerunner/script/ct04.cpp delete mode 100644 engines/bladerunner/script/ct05.cpp delete mode 100644 engines/bladerunner/script/ct06.cpp delete mode 100644 engines/bladerunner/script/ct07.cpp delete mode 100644 engines/bladerunner/script/ct08.cpp delete mode 100644 engines/bladerunner/script/ct09.cpp delete mode 100644 engines/bladerunner/script/ct10.cpp delete mode 100644 engines/bladerunner/script/ct11.cpp delete mode 100644 engines/bladerunner/script/ct12.cpp delete mode 100644 engines/bladerunner/script/ct51.cpp delete mode 100644 engines/bladerunner/script/dr01.cpp delete mode 100644 engines/bladerunner/script/dr02.cpp delete mode 100644 engines/bladerunner/script/dr03.cpp delete mode 100644 engines/bladerunner/script/dr04.cpp delete mode 100644 engines/bladerunner/script/dr05.cpp delete mode 100644 engines/bladerunner/script/dr06.cpp delete mode 100644 engines/bladerunner/script/hc01.cpp delete mode 100644 engines/bladerunner/script/hc02.cpp delete mode 100644 engines/bladerunner/script/hc03.cpp delete mode 100644 engines/bladerunner/script/hc04.cpp delete mode 100644 engines/bladerunner/script/hf01.cpp delete mode 100644 engines/bladerunner/script/hf02.cpp delete mode 100644 engines/bladerunner/script/hf03.cpp delete mode 100644 engines/bladerunner/script/hf04.cpp delete mode 100644 engines/bladerunner/script/hf05.cpp delete mode 100644 engines/bladerunner/script/hf06.cpp delete mode 100644 engines/bladerunner/script/hf07.cpp delete mode 100644 engines/bladerunner/script/kp01.cpp delete mode 100644 engines/bladerunner/script/kp02.cpp delete mode 100644 engines/bladerunner/script/kp03.cpp delete mode 100644 engines/bladerunner/script/kp04.cpp delete mode 100644 engines/bladerunner/script/kp05.cpp delete mode 100644 engines/bladerunner/script/kp06.cpp delete mode 100644 engines/bladerunner/script/kp07.cpp delete mode 100644 engines/bladerunner/script/ma01.cpp delete mode 100644 engines/bladerunner/script/ma02.cpp delete mode 100644 engines/bladerunner/script/ma04.cpp delete mode 100644 engines/bladerunner/script/ma05.cpp delete mode 100644 engines/bladerunner/script/ma06.cpp delete mode 100644 engines/bladerunner/script/ma07.cpp delete mode 100644 engines/bladerunner/script/ma08.cpp delete mode 100644 engines/bladerunner/script/nr01.cpp delete mode 100644 engines/bladerunner/script/nr02.cpp delete mode 100644 engines/bladerunner/script/nr03.cpp delete mode 100644 engines/bladerunner/script/nr04.cpp delete mode 100644 engines/bladerunner/script/nr05.cpp delete mode 100644 engines/bladerunner/script/nr06.cpp delete mode 100644 engines/bladerunner/script/nr07.cpp delete mode 100644 engines/bladerunner/script/nr08.cpp delete mode 100644 engines/bladerunner/script/nr09.cpp delete mode 100644 engines/bladerunner/script/nr10.cpp delete mode 100644 engines/bladerunner/script/nr11.cpp delete mode 100644 engines/bladerunner/script/ps01.cpp delete mode 100644 engines/bladerunner/script/ps02.cpp delete mode 100644 engines/bladerunner/script/ps03.cpp delete mode 100644 engines/bladerunner/script/ps04.cpp delete mode 100644 engines/bladerunner/script/ps05.cpp delete mode 100644 engines/bladerunner/script/ps06.cpp delete mode 100644 engines/bladerunner/script/ps07.cpp delete mode 100644 engines/bladerunner/script/ps09.cpp delete mode 100644 engines/bladerunner/script/ps10.cpp delete mode 100644 engines/bladerunner/script/ps11.cpp delete mode 100644 engines/bladerunner/script/ps12.cpp delete mode 100644 engines/bladerunner/script/ps13.cpp delete mode 100644 engines/bladerunner/script/ps14.cpp delete mode 100644 engines/bladerunner/script/ps15.cpp delete mode 100644 engines/bladerunner/script/rc01.cpp delete mode 100644 engines/bladerunner/script/rc02.cpp delete mode 100644 engines/bladerunner/script/rc03.cpp delete mode 100644 engines/bladerunner/script/rc04.cpp delete mode 100644 engines/bladerunner/script/rc51.cpp create mode 100644 engines/bladerunner/script/scene.cpp create mode 100644 engines/bladerunner/script/scene.h create mode 100644 engines/bladerunner/script/scene/ar01.cpp create mode 100644 engines/bladerunner/script/scene/ar02.cpp create mode 100644 engines/bladerunner/script/scene/bb01.cpp create mode 100644 engines/bladerunner/script/scene/bb02.cpp create mode 100644 engines/bladerunner/script/scene/bb03.cpp create mode 100644 engines/bladerunner/script/scene/bb04.cpp create mode 100644 engines/bladerunner/script/scene/bb05.cpp create mode 100644 engines/bladerunner/script/scene/bb06.cpp create mode 100644 engines/bladerunner/script/scene/bb07.cpp create mode 100644 engines/bladerunner/script/scene/bb08.cpp create mode 100644 engines/bladerunner/script/scene/bb09.cpp create mode 100644 engines/bladerunner/script/scene/bb10.cpp create mode 100644 engines/bladerunner/script/scene/bb11.cpp create mode 100644 engines/bladerunner/script/scene/bb12.cpp create mode 100644 engines/bladerunner/script/scene/bb51.cpp create mode 100644 engines/bladerunner/script/scene/ct01.cpp create mode 100644 engines/bladerunner/script/scene/ct02.cpp create mode 100644 engines/bladerunner/script/scene/ct03.cpp create mode 100644 engines/bladerunner/script/scene/ct04.cpp create mode 100644 engines/bladerunner/script/scene/ct05.cpp create mode 100644 engines/bladerunner/script/scene/ct06.cpp create mode 100644 engines/bladerunner/script/scene/ct07.cpp create mode 100644 engines/bladerunner/script/scene/ct08.cpp create mode 100644 engines/bladerunner/script/scene/ct09.cpp create mode 100644 engines/bladerunner/script/scene/ct10.cpp create mode 100644 engines/bladerunner/script/scene/ct11.cpp create mode 100644 engines/bladerunner/script/scene/ct12.cpp create mode 100644 engines/bladerunner/script/scene/ct51.cpp create mode 100644 engines/bladerunner/script/scene/dr01.cpp create mode 100644 engines/bladerunner/script/scene/dr02.cpp create mode 100644 engines/bladerunner/script/scene/dr03.cpp create mode 100644 engines/bladerunner/script/scene/dr04.cpp create mode 100644 engines/bladerunner/script/scene/dr05.cpp create mode 100644 engines/bladerunner/script/scene/dr06.cpp create mode 100644 engines/bladerunner/script/scene/hc01.cpp create mode 100644 engines/bladerunner/script/scene/hc02.cpp create mode 100644 engines/bladerunner/script/scene/hc03.cpp create mode 100644 engines/bladerunner/script/scene/hc04.cpp create mode 100644 engines/bladerunner/script/scene/hf01.cpp create mode 100644 engines/bladerunner/script/scene/hf02.cpp create mode 100644 engines/bladerunner/script/scene/hf03.cpp create mode 100644 engines/bladerunner/script/scene/hf04.cpp create mode 100644 engines/bladerunner/script/scene/hf05.cpp create mode 100644 engines/bladerunner/script/scene/hf06.cpp create mode 100644 engines/bladerunner/script/scene/hf07.cpp create mode 100644 engines/bladerunner/script/scene/kp01.cpp create mode 100644 engines/bladerunner/script/scene/kp02.cpp create mode 100644 engines/bladerunner/script/scene/kp03.cpp create mode 100644 engines/bladerunner/script/scene/kp04.cpp create mode 100644 engines/bladerunner/script/scene/kp05.cpp create mode 100644 engines/bladerunner/script/scene/kp06.cpp create mode 100644 engines/bladerunner/script/scene/kp07.cpp create mode 100644 engines/bladerunner/script/scene/ma01.cpp create mode 100644 engines/bladerunner/script/scene/ma02.cpp create mode 100644 engines/bladerunner/script/scene/ma04.cpp create mode 100644 engines/bladerunner/script/scene/ma05.cpp create mode 100644 engines/bladerunner/script/scene/ma06.cpp create mode 100644 engines/bladerunner/script/scene/ma07.cpp create mode 100644 engines/bladerunner/script/scene/ma08.cpp create mode 100644 engines/bladerunner/script/scene/nr01.cpp create mode 100644 engines/bladerunner/script/scene/nr02.cpp create mode 100644 engines/bladerunner/script/scene/nr03.cpp create mode 100644 engines/bladerunner/script/scene/nr04.cpp create mode 100644 engines/bladerunner/script/scene/nr05.cpp create mode 100644 engines/bladerunner/script/scene/nr06.cpp create mode 100644 engines/bladerunner/script/scene/nr07.cpp create mode 100644 engines/bladerunner/script/scene/nr08.cpp create mode 100644 engines/bladerunner/script/scene/nr09.cpp create mode 100644 engines/bladerunner/script/scene/nr10.cpp create mode 100644 engines/bladerunner/script/scene/nr11.cpp create mode 100644 engines/bladerunner/script/scene/ps01.cpp create mode 100644 engines/bladerunner/script/scene/ps02.cpp create mode 100644 engines/bladerunner/script/scene/ps03.cpp create mode 100644 engines/bladerunner/script/scene/ps04.cpp create mode 100644 engines/bladerunner/script/scene/ps05.cpp create mode 100644 engines/bladerunner/script/scene/ps06.cpp create mode 100644 engines/bladerunner/script/scene/ps07.cpp create mode 100644 engines/bladerunner/script/scene/ps09.cpp create mode 100644 engines/bladerunner/script/scene/ps10.cpp create mode 100644 engines/bladerunner/script/scene/ps11.cpp create mode 100644 engines/bladerunner/script/scene/ps12.cpp create mode 100644 engines/bladerunner/script/scene/ps13.cpp create mode 100644 engines/bladerunner/script/scene/ps14.cpp create mode 100644 engines/bladerunner/script/scene/ps15.cpp create mode 100644 engines/bladerunner/script/scene/rc01.cpp create mode 100644 engines/bladerunner/script/scene/rc02.cpp create mode 100644 engines/bladerunner/script/scene/rc03.cpp create mode 100644 engines/bladerunner/script/scene/rc04.cpp create mode 100644 engines/bladerunner/script/scene/rc51.cpp create mode 100644 engines/bladerunner/script/scene/tb02.cpp create mode 100644 engines/bladerunner/script/scene/tb03.cpp create mode 100644 engines/bladerunner/script/scene/tb05.cpp create mode 100644 engines/bladerunner/script/scene/tb06.cpp create mode 100644 engines/bladerunner/script/scene/tb07.cpp create mode 100644 engines/bladerunner/script/scene/ug01.cpp create mode 100644 engines/bladerunner/script/scene/ug02.cpp create mode 100644 engines/bladerunner/script/scene/ug03.cpp create mode 100644 engines/bladerunner/script/scene/ug04.cpp create mode 100644 engines/bladerunner/script/scene/ug05.cpp create mode 100644 engines/bladerunner/script/scene/ug06.cpp create mode 100644 engines/bladerunner/script/scene/ug07.cpp create mode 100644 engines/bladerunner/script/scene/ug08.cpp create mode 100644 engines/bladerunner/script/scene/ug09.cpp create mode 100644 engines/bladerunner/script/scene/ug10.cpp create mode 100644 engines/bladerunner/script/scene/ug12.cpp create mode 100644 engines/bladerunner/script/scene/ug13.cpp create mode 100644 engines/bladerunner/script/scene/ug14.cpp create mode 100644 engines/bladerunner/script/scene/ug15.cpp create mode 100644 engines/bladerunner/script/scene/ug16.cpp create mode 100644 engines/bladerunner/script/scene/ug17.cpp create mode 100644 engines/bladerunner/script/scene/ug18.cpp create mode 100644 engines/bladerunner/script/scene/ug19.cpp delete mode 100644 engines/bladerunner/script/tb02.cpp delete mode 100644 engines/bladerunner/script/tb03.cpp delete mode 100644 engines/bladerunner/script/tb05.cpp delete mode 100644 engines/bladerunner/script/tb06.cpp delete mode 100644 engines/bladerunner/script/tb07.cpp delete mode 100644 engines/bladerunner/script/ug01.cpp delete mode 100644 engines/bladerunner/script/ug02.cpp delete mode 100644 engines/bladerunner/script/ug03.cpp delete mode 100644 engines/bladerunner/script/ug04.cpp delete mode 100644 engines/bladerunner/script/ug05.cpp delete mode 100644 engines/bladerunner/script/ug06.cpp delete mode 100644 engines/bladerunner/script/ug07.cpp delete mode 100644 engines/bladerunner/script/ug08.cpp delete mode 100644 engines/bladerunner/script/ug09.cpp delete mode 100644 engines/bladerunner/script/ug10.cpp delete mode 100644 engines/bladerunner/script/ug12.cpp delete mode 100644 engines/bladerunner/script/ug13.cpp delete mode 100644 engines/bladerunner/script/ug14.cpp delete mode 100644 engines/bladerunner/script/ug15.cpp delete mode 100644 engines/bladerunner/script/ug16.cpp delete mode 100644 engines/bladerunner/script/ug17.cpp delete mode 100644 engines/bladerunner/script/ug18.cpp delete mode 100644 engines/bladerunner/script/ug19.cpp diff --git a/engines/bladerunner/actor.cpp b/engines/bladerunner/actor.cpp index 597dc60454..330ed58ddf 100644 --- a/engines/bladerunner/actor.cpp +++ b/engines/bladerunner/actor.cpp @@ -35,7 +35,8 @@ #include "bladerunner/movement_track.h" #include "bladerunner/scene.h" #include "bladerunner/scene_objects.h" -#include "bladerunner/script/script.h" +#include "bladerunner/script/scene.h" +#include "bladerunner/script/ai.h" #include "bladerunner/slice_animations.h" #include "bladerunner/slice_renderer.h" #include "bladerunner/waypoints.h" @@ -199,7 +200,7 @@ void Actor::countdownTimerUpdate(int timerId) { case 0: case 1: case 2: - if (!_vm->_aiScripts->IsInsideScript() && !_vm->_script->IsInsideScript()) { + if (!_vm->_aiScripts->IsInsideScript() && !_vm->_sceneScript->IsInsideScript()) { _vm->_aiScripts->TimerExpired(this->_id, timerId); this->_timersRemain[timerId] = 0; } else { @@ -926,7 +927,7 @@ void Actor::retire(bool retired, int width, int height, int retiredByActorId) { _vm->_playerDead = true; } if (_isRetired) { - //TODO: _vm->actorScript->Retired(_id, retiredByActorId); + _vm->_aiScripts->Retired(_id, retiredByActorId); } } @@ -1013,7 +1014,7 @@ void Actor::setGoal(int goalNumber) { } _vm->_aiScripts->GoalChanged(_id, oldGoalNumber, goalNumber); - _vm->_script->ActorChangedGoal(_id, goalNumber, oldGoalNumber, _vm->_scene->getSetId() == _setId); + _vm->_sceneScript->ActorChangedGoal(_id, goalNumber, oldGoalNumber, _vm->_scene->getSetId() == _setId); } int Actor::getGoal() { diff --git a/engines/bladerunner/adq.cpp b/engines/bladerunner/adq.cpp index d2d3dec6ce..71315e8492 100644 --- a/engines/bladerunner/adq.cpp +++ b/engines/bladerunner/adq.cpp @@ -28,7 +28,7 @@ #include "bladerunner/audio_speech.h" #include "bladerunner/scene.h" -#include "script/script.h" +#include "bladerunner/script/scene.h" namespace BladeRunner { @@ -99,7 +99,7 @@ void ADQ::flush(int a1, bool callScript) { } clear(); if (callScript) { - _vm->_script->DialogueQueueFlushed(a1); + _vm->_sceneScript->DialogueQueueFlushed(a1); } } diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp index 6a06422a24..78239adbbb 100644 --- a/engines/bladerunner/bladerunner.cpp +++ b/engines/bladerunner/bladerunner.cpp @@ -43,7 +43,8 @@ #include "bladerunner/scene.h" #include "bladerunner/scene_objects.h" #include "bladerunner/script/init.h" -#include "bladerunner/script/script.h" +#include "bladerunner/script/scene.h" +#include "bladerunner/script/ai.h" #include "bladerunner/settings.h" #include "bladerunner/shape.h" #include "bladerunner/slice_animations.h" @@ -72,7 +73,7 @@ BladeRunnerEngine::BladeRunnerEngine(OSystem *syst) _playerLosesControlCounter = 0; _crimesDatabase = nullptr; - _script = new Script(this); + _sceneScript = new SceneScript(this); _settings = new Settings(this); _lights = new Lights(this); _combat = new Combat(this); @@ -120,7 +121,7 @@ BladeRunnerEngine::~BladeRunnerEngine() { delete _combat; delete _lights; delete _settings; - delete _script; + delete _sceneScript; } bool BladeRunnerEngine::hasFeature(EngineFeature f) const { @@ -346,11 +347,17 @@ bool BladeRunnerEngine::startup(bool hasSavegames) { void BladeRunnerEngine::initChapterAndScene() { // TODO: Init actors... - for (int i = 0, end = _gameInfo->getActorCount(); i != end; ++i) + for (int i = 0, end = _gameInfo->getActorCount(); i != end; ++i) { _aiScripts->Initialize(i); + } - for (int i = 0, end = _gameInfo->getActorCount(); i != end; ++i) + for (int i = 0, end = _gameInfo->getActorCount(); i != end; ++i) { _actors[i]->changeAnimationMode(0); + } + + for (int i = 1, end = _gameInfo->getActorCount(); i != end; ++i) { // skip first actor, probably player + _actors[i]->movementTrackNext(true); + } _settings->setChapter(1); _settings->setNewSetAndScene(_gameInfo->getInitialSetId(), _gameInfo->getInitialSceneId()); @@ -587,7 +594,7 @@ void BladeRunnerEngine::gameTick() { _adq->tick(); if (_scene->didPlayerWalkIn()) { - _script->PlayerWalkedIn(); + _sceneScript->PlayerWalkedIn(); } // TODO: Gun range announcements // TODO: ZBUF repair dirty rects @@ -597,7 +604,7 @@ void BladeRunnerEngine::gameTick() { bool backgroundChanged = false; int frame = _scene->advanceFrame(_surface1, _zBuffer1); if (frame >= 0) { - _script->SceneFrameAdvanced(frame); + _sceneScript->SceneFrameAdvanced(frame); backgroundChanged = true; } (void)backgroundChanged; @@ -626,7 +633,7 @@ void BladeRunnerEngine::gameTick() { //if (!dialogueMenu) actorsUpdate(); - if (_settings->getNewScene() == -1 || _script->IsInsideScript() || _aiScripts->IsInsideScript()) { + if (_settings->getNewScene() == -1 || _sceneScript->IsInsideScript() || _aiScripts->IsInsideScript()) { _sliceRenderer->setView(*_view); // Tick and draw all actors in current set @@ -846,28 +853,28 @@ void BladeRunnerEngine::handleMouseClick(int x, int y) { void BladeRunnerEngine::handleMouseClickExit(int x, int y, int exitIndex) { // clickedOnExit(exitType, x, y); debug("clicked on exit %d %d %d", exitIndex, x, y); - _script->ClickedOnExit(exitIndex); + _sceneScript->ClickedOnExit(exitIndex); } void BladeRunnerEngine::handleMouseClickRegion(int x, int y, int regionIndex) { debug("clicked on region %d %d %d", regionIndex, x, y); - _script->ClickedOn2DRegion(regionIndex); + _sceneScript->ClickedOn2DRegion(regionIndex); } void BladeRunnerEngine::handleMouseClick3DObject(int x, int y, int objectId, bool isClickable, bool isTarget) { const char *objectName = _scene->objectGetName(objectId); debug("Clicked on object %s", objectName); - _script->ClickedOn3DObject(objectName, false); + _sceneScript->ClickedOn3DObject(objectName, false); } void BladeRunnerEngine::handleMouseClickItem(int x, int y, int itemId) { debug("Clicked on item %d", itemId); - _script->ClickedOnItem(itemId, false); + _sceneScript->ClickedOnItem(itemId, false); } void BladeRunnerEngine::handleMouseClickActor(int x, int y, int actorId) { debug("Clicked on actor %d", actorId); - _script->ClickedOnActor(actorId); + _sceneScript->ClickedOnActor(actorId); } void BladeRunnerEngine::gameWaitForActive() { diff --git a/engines/bladerunner/bladerunner.h b/engines/bladerunner/bladerunner.h index 0aab57625b..87bb7dbeca 100644 --- a/engines/bladerunner/bladerunner.h +++ b/engines/bladerunner/bladerunner.h @@ -55,7 +55,7 @@ class Mouse; class Obstacles; class Scene; class SceneObjects; -class Script; +class SceneScript; class Settings; class Shape; class SliceAnimations; @@ -91,7 +91,7 @@ public: Obstacles *_obstacles; Scene *_scene; SceneObjects *_sceneObjects; - Script *_script; + SceneScript *_sceneScript; Settings *_settings; SliceAnimations *_sliceAnimations; SliceRenderer *_sliceRenderer; diff --git a/engines/bladerunner/module.mk b/engines/bladerunner/module.mk index f8394e9318..5ef5735a74 100644 --- a/engines/bladerunner/module.mk +++ b/engines/bladerunner/module.mk @@ -38,125 +38,127 @@ MODULE_OBJS = \ regions.o \ scene.o \ scene_objects.o \ - script/ai_00_mccoy.o \ - script/ai_15_runciter.o \ - script/ai_23_officer_leroy.o \ + script/script.o \ script/init.o \ script/kia.o \ script/vk.o \ script/esper.o \ - script/ar01.o \ - script/ar02.o \ - script/bb01.o \ - script/bb02.o \ - script/bb03.o \ - script/bb04.o \ - script/bb05.o \ - script/bb06.o \ - script/bb07.o \ - script/bb08.o \ - script/bb09.o \ - script/bb10.o \ - script/bb11.o \ - script/bb12.o \ - script/bb51.o \ - script/ct01.o \ - script/ct02.o \ - script/ct03.o \ - script/ct04.o \ - script/ct05.o \ - script/ct06.o \ - script/ct07.o \ - script/ct08.o \ - script/ct09.o \ - script/ct10.o \ - script/ct11.o \ - script/ct12.o \ - script/ct51.o \ - script/dr01.o \ - script/dr02.o \ - script/dr03.o \ - script/dr04.o \ - script/dr05.o \ - script/dr06.o \ - script/hc01.o \ - script/hc02.o \ - script/hc03.o \ - script/hc04.o \ - script/hf01.o \ - script/hf02.o \ - script/hf03.o \ - script/hf04.o \ - script/hf05.o \ - script/hf06.o \ - script/kp01.o \ - script/kp02.o \ - script/kp03.o \ - script/kp04.o \ - script/kp05.o \ - script/kp06.o \ - script/kp07.o \ - script/ma01.o \ - script/ma02.o \ - script/ma04.o \ - script/ma05.o \ - script/ma06.o \ - script/ma07.o \ - script/ma08.o \ - script/nr01.o \ - script/nr02.o \ - script/nr03.o \ - script/nr04.o \ - script/nr05.o \ - script/nr06.o \ - script/nr07.o \ - script/nr08.o \ - script/nr09.o \ - script/nr10.o \ - script/nr11.o \ - script/ps01.o \ - script/ps02.o \ - script/ps03.o \ - script/ps04.o \ - script/ps05.o \ - script/ps06.o \ - script/ps07.o \ - script/ps09.o \ - script/ps10.o \ - script/ps11.o \ - script/ps12.o \ - script/ps13.o \ - script/ps14.o \ - script/ps15.o \ - script/rc01.o \ - script/rc02.o \ - script/rc03.o \ - script/rc04.o \ - script/rc51.o \ - script/tb02.o \ - script/tb03.o \ - script/tb05.o \ - script/tb06.o \ - script/tb07.o \ - script/ug01.o \ - script/ug02.o \ - script/ug03.o \ - script/ug04.o \ - script/ug05.o \ - script/ug06.o \ - script/ug07.o \ - script/ug08.o \ - script/ug09.o \ - script/ug10.o \ - script/ug12.o \ - script/ug13.o \ - script/ug14.o \ - script/ug15.o \ - script/ug16.o \ - script/ug17.o \ - script/ug18.o \ - script/ug19.o \ - script/script.o \ + script/ai.o \ + script/ai/mccoy.o \ + script/ai/runciter.o \ + script/ai/officer_leroy.o \ + script/scene.o \ + script/scene/ar01.o \ + script/scene/ar02.o \ + script/scene/bb01.o \ + script/scene/bb02.o \ + script/scene/bb03.o \ + script/scene/bb04.o \ + script/scene/bb05.o \ + script/scene/bb06.o \ + script/scene/bb07.o \ + script/scene/bb08.o \ + script/scene/bb09.o \ + script/scene/bb10.o \ + script/scene/bb11.o \ + script/scene/bb12.o \ + script/scene/bb51.o \ + script/scene/ct01.o \ + script/scene/ct02.o \ + script/scene/ct03.o \ + script/scene/ct04.o \ + script/scene/ct05.o \ + script/scene/ct06.o \ + script/scene/ct07.o \ + script/scene/ct08.o \ + script/scene/ct09.o \ + script/scene/ct10.o \ + script/scene/ct11.o \ + script/scene/ct12.o \ + script/scene/ct51.o \ + script/scene/dr01.o \ + script/scene/dr02.o \ + script/scene/dr03.o \ + script/scene/dr04.o \ + script/scene/dr05.o \ + script/scene/dr06.o \ + script/scene/hc01.o \ + script/scene/hc02.o \ + script/scene/hc03.o \ + script/scene/hc04.o \ + script/scene/hf01.o \ + script/scene/hf02.o \ + script/scene/hf03.o \ + script/scene/hf04.o \ + script/scene/hf05.o \ + script/scene/hf06.o \ + script/scene/kp01.o \ + script/scene/kp02.o \ + script/scene/kp03.o \ + script/scene/kp04.o \ + script/scene/kp05.o \ + script/scene/kp06.o \ + script/scene/kp07.o \ + script/scene/ma01.o \ + script/scene/ma02.o \ + script/scene/ma04.o \ + script/scene/ma05.o \ + script/scene/ma06.o \ + script/scene/ma07.o \ + script/scene/ma08.o \ + script/scene/nr01.o \ + script/scene/nr02.o \ + script/scene/nr03.o \ + script/scene/nr04.o \ + script/scene/nr05.o \ + script/scene/nr06.o \ + script/scene/nr07.o \ + script/scene/nr08.o \ + script/scene/nr09.o \ + script/scene/nr10.o \ + script/scene/nr11.o \ + script/scene/ps01.o \ + script/scene/ps02.o \ + script/scene/ps03.o \ + script/scene/ps04.o \ + script/scene/ps05.o \ + script/scene/ps06.o \ + script/scene/ps07.o \ + script/scene/ps09.o \ + script/scene/ps10.o \ + script/scene/ps11.o \ + script/scene/ps12.o \ + script/scene/ps13.o \ + script/scene/ps14.o \ + script/scene/ps15.o \ + script/scene/rc01.o \ + script/scene/rc02.o \ + script/scene/rc03.o \ + script/scene/rc04.o \ + script/scene/rc51.o \ + script/scene/tb02.o \ + script/scene/tb03.o \ + script/scene/tb05.o \ + script/scene/tb06.o \ + script/scene/tb07.o \ + script/scene/ug01.o \ + script/scene/ug02.o \ + script/scene/ug03.o \ + script/scene/ug04.o \ + script/scene/ug05.o \ + script/scene/ug06.o \ + script/scene/ug07.o \ + script/scene/ug08.o \ + script/scene/ug09.o \ + script/scene/ug10.o \ + script/scene/ug12.o \ + script/scene/ug13.o \ + script/scene/ug14.o \ + script/scene/ug15.o \ + script/scene/ug16.o \ + script/scene/ug17.o \ + script/scene/ug18.o \ + script/scene/ug19.o \ set.o \ settings.o \ set_effects.o \ diff --git a/engines/bladerunner/scene.cpp b/engines/bladerunner/scene.cpp index abf0285660..05abfbe16e 100644 --- a/engines/bladerunner/scene.cpp +++ b/engines/bladerunner/scene.cpp @@ -31,7 +31,7 @@ #include "bladerunner/items.h" #include "bladerunner/settings.h" #include "bladerunner/scene_objects.h" -#include "bladerunner/script/script.h" +#include "bladerunner/script/scene.h" #include "bladerunner/slice_renderer.h" #include "common/str.h" @@ -78,11 +78,11 @@ bool Scene::open(int setId, int sceneId, bool isLoadingGame) { _vqaPlayer = new VQAPlayer(_vm); Common::String sceneName = _vm->_gameInfo->getSceneName(sceneId); - if (!_vm->_script->open(sceneName)) + if (!_vm->_sceneScript->Open(sceneName)) return false; if (!isLoadingGame) - _vm->_script->InitializeScene(); + _vm->_sceneScript->InitializeScene(); Common::String setResourceName = Common::String::format("%s-MIN.SET", sceneName.c_str()); if (!_set->open(setResourceName)) @@ -93,7 +93,7 @@ bool Scene::open(int setId, int sceneId, bool isLoadingGame) { if (isLoadingGame) { // TODO: Advance VQA frame if (sceneId >= 73 && sceneId <= 76) - _vm->_script->SceneLoaded(); + _vm->_sceneScript->SceneLoaded(); return true; } @@ -110,7 +110,7 @@ bool Scene::open(int setId, int sceneId, bool isLoadingGame) { _vm->_playerActor->setAtXYZ(_actorStartPosition, _actorStartFacing); _vm->_playerActor->setSetId(setId); - _vm->_script->SceneLoaded(); + _vm->_sceneScript->SceneLoaded(); _vm->_sceneObjects->clear(); @@ -137,7 +137,7 @@ bool Scene::open(int setId, int sceneId, bool isLoadingGame) { // TODO: calculate walking obstacles?? if (_specialLoopMode) { - _vm->_script->PlayerWalkedIn(); + _vm->_sceneScript->PlayerWalkedIn(); } return true; @@ -151,7 +151,7 @@ bool Scene::close(bool isLoadingGame) { //_vm->_policeMaze->clear(!isLoadingGame); if (isLoadingGame) { - _vm->_script->PlayerWalkedOut(); + _vm->_sceneScript->PlayerWalkedOut(); } // if (SceneScript_isLoaded() && !SceneScript_unload()) { diff --git a/engines/bladerunner/script/ai.cpp b/engines/bladerunner/script/ai.cpp new file mode 100644 index 0000000000..d51200dc55 --- /dev/null +++ b/engines/bladerunner/script/ai.cpp @@ -0,0 +1,168 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/ai.h" + +#include "bladerunner/bladerunner.h" + +#include "bladerunner/actor.h" + +namespace BladeRunner { + +AIScripts::AIScripts(BladeRunnerEngine *vm, int actorsCount) : _vm(vm), _inScriptCounter(0) { + _actorsCount = actorsCount; + _actorUpdating = new bool[actorsCount]; + _AIScripts = new AIScriptBase*[actorsCount]; + for (int i = 0; i < actorsCount; ++i) { + _AIScripts[i] = nullptr; + _actorUpdating[i] = false; + } + + _AIScripts[0] = new AIScriptMcCoy(_vm); + _AIScripts[15] = new AIScriptRunciter(_vm); + _AIScripts[23] = new AIScriptOfficerLeroy(_vm); +} + +AIScripts::~AIScripts() { + for (int i = 0; i < _actorsCount; ++i) { + delete _AIScripts[i]; + _AIScripts[i] = nullptr; + } + delete[] _AIScripts; + delete[] _actorUpdating; +} + +void AIScripts::Initialize(int actor) { + assert(actor < _actorsCount); + if (_AIScripts[actor]) + _AIScripts[actor]->Initialize(); +} + +void AIScripts::Update(int actor) { + assert(actor < _actorsCount); + if (this->_actorUpdating[actor] != 1) { + this->_actorUpdating[actor] = true; + ++this->_inScriptCounter; + if (_AIScripts[actor]) + _AIScripts[actor]->Update(); + --this->_inScriptCounter; + this->_actorUpdating[actor] = false; + } +} + +void AIScripts::TimerExpired(int actor, int timer) { + assert(actor < _actorsCount); + _inScriptCounter++; + if (_AIScripts[actor]) { + _AIScripts[actor]->TimerExpired(timer); + } + _inScriptCounter--; +} + +void AIScripts::CompletedMovementTrack(int actor) { + assert(actor < _actorsCount); + if (!_vm->_actors[actor]->inCombat()) { + _inScriptCounter++; + if (_AIScripts[actor]) { + _AIScripts[actor]->CompletedMovementTrack(); + } + _inScriptCounter--; + } +} + +void AIScripts::EnteredScene(int actor, int setId) { + assert(actor < _actorsCount); + _inScriptCounter++; + if (_AIScripts[actor]) { + _AIScripts[actor]->EnteredScene(setId); + } + _inScriptCounter--; +} + +void AIScripts::OtherAgentEnteredThisScene(int actor, int otherActorId) { + assert(actor < _actorsCount); + _inScriptCounter++; + if (_AIScripts[actor]) { + _AIScripts[actor]->OtherAgentEnteredThisScene(otherActorId); + } + _inScriptCounter--; +} + +void AIScripts::OtherAgentExitedThisScene(int actor, int otherActorId) { + assert(actor < _actorsCount); + _inScriptCounter++; + if (_AIScripts[actor]) { + _AIScripts[actor]->OtherAgentExitedThisScene(otherActorId); + } + _inScriptCounter--; +} + +void AIScripts::Retired(int actor, int retiredByActorId) { + assert(actor < _actorsCount); + _inScriptCounter++; + if (_AIScripts[actor]) { + _AIScripts[actor]->Retired(retiredByActorId); + } + _inScriptCounter--; +} + +void AIScripts::GoalChanged(int actor, int currentGoalNumber, int newGoalNumber) { + assert(actor < _actorsCount); + _inScriptCounter++; + if (_AIScripts[actor]) { + _AIScripts[actor]->GoalChanged(currentGoalNumber, newGoalNumber); + } + _inScriptCounter--; +} + +bool AIScripts::ReachedMovementTrackWaypoint(int actor, int waypointId) { + assert(actor < _actorsCount); + bool result = false; + if (!_vm->_actors[actor]->inCombat()) { + _inScriptCounter++; + if (_AIScripts[actor]) { + result = _AIScripts[actor]->ReachedMovementTrackWaypoint(waypointId); + } + _inScriptCounter--; + } + return result; +} + +void AIScripts::UpdateAnimation(int actor, int *animation, int *frame) { + assert(actor < _actorsCount); + _inScriptCounter++; + if (_AIScripts[actor]) { + _AIScripts[actor]->UpdateAnimation(animation, frame); + } + _inScriptCounter--; +} + +void AIScripts::ChangeAnimationMode(int actor, int mode) { + assert(actor < _actorsCount); + _inScriptCounter++; + if (_AIScripts[actor]) { + _AIScripts[actor]->ChangeAnimationMode(mode); + } + _inScriptCounter--; +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ai.h b/engines/bladerunner/script/ai.h new file mode 100644 index 0000000000..056b22a333 --- /dev/null +++ b/engines/bladerunner/script/ai.h @@ -0,0 +1,174 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef BLADERUNNER_SCRIPT_AI_H +#define BLADERUNNER_SCRIPT_AI_H + +#include "bladerunner/script/script.h" + +namespace BladeRunner { + +class BladeRunnerEngine; + +class AIScriptBase : public ScriptBase { +public: + AIScriptBase(BladeRunnerEngine *vm) : ScriptBase(vm) {} + + virtual void Initialize() = 0; + virtual bool Update() = 0; + virtual void TimerExpired(int timer) = 0; + virtual void CompletedMovementTrack() = 0; + virtual void ReceivedClue(int clueId, int fromActorId) = 0; + virtual void ClickedByPlayer() = 0; + virtual void EnteredScene(int setId) = 0; + virtual void OtherAgentEnteredThisScene(int otherActorId) = 0; + virtual void OtherAgentExitedThisScene(int otherActorId) = 0; + virtual void OtherAgentEnteredCombatMode(int otherActorId, int combatMode) = 0; + virtual void ShotAtAndMissed() = 0; + virtual void ShotAtAndHit() = 0; + virtual void Retired(int byActorId) = 0; + virtual int GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId) = 0; + virtual bool GoalChanged(int currentGoalNumber, int newGoalNumber) = 0; + virtual bool UpdateAnimation(int *animation, int *frame) = 0; + virtual bool ChangeAnimationMode(int mode) = 0; + virtual void QueryAnimationState(int *animationState, int *a2, int *a3, int *a4) = 0; + virtual void SetAnimationState(int animationState, int a2, int a3, int a4) = 0; + virtual bool ReachedMovementTrackWaypoint(int waypointId) = 0; + virtual void FledCombat() = 0; +}; + +#define DECLARE_SCRIPT(name) \ +class AIScript##name : public AIScriptBase { \ +public: \ + AIScript##name(BladeRunnerEngine *vm) \ + : AIScriptBase(vm) \ + {} \ + void Initialize(); \ + bool Update(); \ + void TimerExpired(int timer); \ + void CompletedMovementTrack(); \ + void ReceivedClue(int clueId, int fromActorId); \ + void ClickedByPlayer(); \ + void EnteredScene(int setId); \ + void OtherAgentEnteredThisScene(int otherActorId); \ + void OtherAgentExitedThisScene(int otherActorId); \ + void OtherAgentEnteredCombatMode(int otherActorId, int combatMode); \ + void ShotAtAndMissed(); \ + void ShotAtAndHit(); \ + void Retired(int byActorId); \ + int GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId); \ + bool GoalChanged(int currentGoalNumber, int newGoalNumber); \ + bool UpdateAnimation(int *animation, int *frame); \ + bool ChangeAnimationMode(int mode); \ + void QueryAnimationState(int *animationState, int *a2, int *a3, int *a4); \ + void SetAnimationState(int animationState, int a2, int a3, int a4); \ + bool ReachedMovementTrackWaypoint(int waypointId); \ + void FledCombat(); \ +private: +#define END_SCRIPT }; + +DECLARE_SCRIPT(McCoy) + int dword_45A0D0_animation_state; + int dword_45A0D4_animation_frame; + int dword_45A0D8; + int dword_45A0DC; + int dword_45A0E0; + int dword_45A0E4; + float off_45A0EC; + int dword_45A0E8; + int dword_45A0F0; + int dword_45A0F4; + int dword_45A0F8; + int dword_45A0FC; + int dword_462718; + int dword_46271C; + float off_45A100; + float flt_462710; + float flt_462714; + + void sub_4053E0(); + void sub_4054F0(); + void sub_405660(); + void sub_405800(); + void sub_4058B0(); + void sub_405920(); + void sub_405940(float a1); + void sub_4059D0(float a1); +END_SCRIPT + +DECLARE_SCRIPT(Runciter) + int var_45CD70_animation_state; + int var_45CD74_animation_frame; + int var_462800; + int var_462804; + int var_45CD78; + int var_45CD7C; + int var_45CD80; + int var_45CD84; + int var_45CD88; +END_SCRIPT + +DECLARE_SCRIPT(OfficerLeroy) + int var_45D5B0_animation_state; + int var_45D5B4_animation_frame; + int var_45D5B8; + int var_45D5BC; + int var_462880; + int var_462884; + + bool sub_431408(); + bool sub_431420(); +END_SCRIPT + +#undef DECLARE_SCRIPT +#undef END_SCRIPT + +class AIScripts { +private: + BladeRunnerEngine *_vm; + int _inScriptCounter; + int _actorsCount; + AIScriptBase **_AIScripts; + bool *_actorUpdating; +public: + AIScripts(BladeRunnerEngine *vm, int actorsCount); + ~AIScripts(); + + void Initialize(int actor); + void Update(int actor); + void TimerExpired(int actor, int timer); + void CompletedMovementTrack(int actor); + void EnteredScene(int actor, int setId); + void OtherAgentEnteredThisScene(int actor, int otherActorId); + void OtherAgentExitedThisScene(int actor, int otherActorId); + void Retired(int actor, int retiredByActorId); + void GoalChanged(int actor, int currentGoalNumber, int newGoalNumber); + bool ReachedMovementTrackWaypoint(int actor, int waypointId); + void UpdateAnimation(int actor, int *animation, int *frame); + void ChangeAnimationMode(int actor, int mode); + + bool IsInsideScript() { return _inScriptCounter > 0; } +}; + +} // End of namespace BladeRunner + +#endif diff --git a/engines/bladerunner/script/ai/mccoy.cpp b/engines/bladerunner/script/ai/mccoy.cpp new file mode 100644 index 0000000000..fb9561cbcb --- /dev/null +++ b/engines/bladerunner/script/ai/mccoy.cpp @@ -0,0 +1,1851 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/ai.h" + +namespace BladeRunner { + +void AIScriptMcCoy::Initialize() { + dword_45A0D0_animation_state = 0; + dword_45A0D4_animation_frame = 0; + dword_45A0D8 = 0; + dword_45A0DC = 30; + dword_45A0E0 = 1; + dword_45A0E4 = 0; + off_45A0EC = 0; + dword_45A0E8 = 3; + dword_45A0F0 = 3; + dword_45A0F4 = 20; + dword_45A0F8 = -1; + dword_45A0FC = 0; + off_45A100 = 0; + Actor_Set_Goal_Number(0, 0); +} + +bool AIScriptMcCoy::Update() { + if (dword_45A0F8 != -1) { + Sound_Play(dword_45A0F8, 100, 0, 0, 50); + dword_45A0F8 = -1; + } + switch (Actor_Query_Goal_Number(0)) { + case 101: + Actor_Set_Goal_Number(0, 102); + return true; + case 102: + if (Actor_Query_Inch_Distance_From_Waypoint(0, 316) < 36 && !Game_Flag_Query(375)) { + Actor_Change_Animation_Mode(0, 21); + Game_Flag_Set(375); + } + if (Actor_Query_Inch_Distance_From_Waypoint(0, 316) < 4) { + Actor_Set_Goal_Number(0, 103); + } + return true; + case 201: + Actor_Set_Goal_Number(0, 0); + if (Player_Query_Current_Set() == 55) { + Loop_Actor_Walk_To_XYZ(0, -166.0f, -70.19f, -501.0f, 0, 0, false, 0); + Actor_Face_Heading(0, 300, false); + } else { + Loop_Actor_Walk_To_XYZ(0, -461.0f, 0.0f, -373.0f, 0, 0, false, 0); + } + Player_Gains_Control(); + return true; + case 212: + if (Global_Variable_Query(47) >= 13) { + Global_Variable_Set(47, 500); + } else if (Global_Variable_Query(47) > 0) { + Global_Variable_Decrement(47, 1); + } + break; + case 221: + Actor_Set_Goal_Number(0, 0); + Actor_Set_Goal_Number(18, 212); + return true; + case 309: + sub_4053E0(); + break; + case 391: + Actor_Retired_Here(0, 12, 48, 1, -1); + Actor_Set_Goal_Number(0, 599); + break; + case 231: + sub_4053E0(); + break; + } + return false; +} + +void AIScriptMcCoy::TimerExpired(int timer) { +} + +void AIScriptMcCoy::CompletedMovementTrack() { +} + +void AIScriptMcCoy::ReceivedClue(int clueId, int fromActorId) { + switch (clueId) { + case 8: + case 9: + Spinner_Set_Selectable_Destination_Flag(3, 1); + break; + case 44: + case 47: + Spinner_Set_Selectable_Destination_Flag(4, 1); + break; + case 53: + case 263: + if (Query_Difficulty_Level() == 0) { + Spinner_Set_Selectable_Destination_Flag(4, 1); + } + break; + case 90: + Spinner_Set_Selectable_Destination_Flag(8, 1); + break; + case 84: + case 113: + case 114: + case 115: + case 118: + Spinner_Set_Selectable_Destination_Flag(9, 1); + Spinner_Set_Selectable_Destination_Flag(8, 1); + break; + case 66: + case 80: + case 82: + case 83: + Global_Variable_Increment(49, 1); + break; + case 125: + Global_Variable_Increment(49, 5); + break; + case 124: + case 128: + Global_Variable_Increment(49, 3); + break; + case 120: + case 121: + Global_Variable_Increment(49, 2); + break; + case 147: + case 148: + case 149: + case 150: + case 151: + case 152: + Global_Variable_Increment(48, 1); + break; + } + if (Global_Variable_Query(49) > 6 && Global_Variable_Query(1) > 3 && !Actor_Clue_Query(0, 126)) { + Delay(500); + Actor_Voice_Over(3320, 99); + switch (clueId) { + case 66: + case 80: + case 82: + case 83: + case 121: + case 128: + Actor_Voice_Over(3340, 99); + Actor_Voice_Over(3350, 99); + Actor_Voice_Over(3360, 99); + Actor_Voice_Over(3370, 99); + Actor_Voice_Over(3380, 99); + break; + case 124: + Actor_Voice_Over(3330, 99); + break; + case 120: + Actor_Voice_Over(3390, 99); + Actor_Voice_Over(3400, 99); + Actor_Voice_Over(3420, 99); + break; + } + Actor_Clue_Acquire(0, 126, 1, -1); + if (clueId == 125) { + Actor_Voice_Over(2780, 99); + Actor_Voice_Over(2800, 99); + Actor_Voice_Over(2810, 99); + } else if (Actor_Clue_Query(0, 125)) { + Actor_Voice_Over(3430, 99); + Actor_Voice_Over(3440, 99); + Actor_Voice_Over(3450, 99); + Actor_Voice_Over(3460, 99); + Actor_Voice_Over(3470, 99); + Actor_Voice_Over(3480, 99); + Actor_Voice_Over(3490, 99); + Actor_Voice_Over(3500, 99); + } else { + Actor_Voice_Over(3510, 99); + Actor_Voice_Over(3520, 99); + Actor_Voice_Over(3530, 99); + Actor_Voice_Over(3540, 99); + } + } +} + +void AIScriptMcCoy::ClickedByPlayer() { +} + +void AIScriptMcCoy::EnteredScene(int sceneId) { +} + +void AIScriptMcCoy::OtherAgentEnteredThisScene(int otherActorId) { +} + +void AIScriptMcCoy::OtherAgentExitedThisScene(int otherActorId) { +} + +void AIScriptMcCoy::OtherAgentEnteredCombatMode(int otherActorId, int combatMode) { +} + +void AIScriptMcCoy::ShotAtAndMissed() { +} + +void AIScriptMcCoy::ShotAtAndHit() { +} + +void AIScriptMcCoy::Retired(int byActorId) { + if (byActorId == 1 && Actor_Query_In_Set(1, 42)) { + if (Actor_Query_In_Set(3, 42) && Actor_Query_Goal_Number(3) != 599) { + Non_Player_Actor_Combat_Mode_On(1, 3, 1, 3, 15, 4, 7, 8, 0, 0, 100, 25, 300, 0); + } else if (Actor_Query_In_Set(6, 42) && Actor_Query_Goal_Number(6) != 599) { + Non_Player_Actor_Combat_Mode_On(1, 3, 1, 6, 15, 4, 7, 8, 0, 0, 100, 25, 300, 0); + } + } + if (Actor_Query_In_Set(0, 41) && Actor_Query_In_Set(23, 41) && Actor_Query_In_Set(3, 41) && Actor_Query_Goal_Number(3) != 599) { + Non_Player_Actor_Combat_Mode_On(23, 3, 1, 3, 4, 4, 7, 8, 0, 0, 100, 25, 300, 0); + } + if (Actor_Query_In_Set(0, 41) && Actor_Query_In_Set(24, 41) && Actor_Query_In_Set(3, 41) && Actor_Query_Goal_Number(3) != 599) { + Non_Player_Actor_Combat_Mode_On(24, 3, 1, 3, 4, 4, 7, 8, 0, 0, 100, 25, 300, 0); + } + if (Actor_Query_In_Set(0, 41) && Actor_Query_In_Set(23, 41) && Actor_Query_In_Set(6, 41) && Actor_Query_Goal_Number(6) != 599) { + Non_Player_Actor_Combat_Mode_On(23, 3, 1, 6, 4, 4, 7, 8, 0, 0, 100, 25, 300, 0); + } + if (Actor_Query_In_Set(0, 41) && Actor_Query_In_Set(24, 41) && Actor_Query_In_Set(6, 41) && Actor_Query_Goal_Number(6) != 599) { + Non_Player_Actor_Combat_Mode_On(24, 3, 1, 6, 4, 4, 7, 8, 0, 0, 100, 25, 300, 0); + } +} + +int AIScriptMcCoy::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId) { + return 0; +} + +bool AIScriptMcCoy::GoalChanged(int currentGoalNumber, int newGoalNumber) { + unsigned int v5; + unsigned int v7; + + switch (newGoalNumber) { + case 0: + return true; + case 1: + sub_4058B0(); + return true; + case 2: + sub_405920(); + return true; + case 100: + Actor_Set_At_Waypoint(0, 315, 263); + dword_45A0D0_animation_state = 53; + dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(18) - 1; + Actor_Set_Invisible(0, false); + return true; + case 102: + Async_Actor_Walk_To_Waypoint(0, 316, 0, 1); + return true; + case 103: + Actor_Face_Actor(0, 8, true); + return true; + case 231: + Player_Set_Combat_Mode(false); + Preload(18); + Set_Enter(59, 63); + Player_Loses_Control(); + Actor_Force_Stop_Walking(0); + Actor_Put_In_Set(0, 59); + Actor_Set_At_XYZ(0, 14.0f, 110.84f, -300.0f, 926); + Actor_Change_Animation_Mode(0, 48); + dword_45A0D0_animation_state = 27; + dword_45A0D4_animation_frame = 0; + flt_462714 = 2.84f; + flt_462710 = 110.84f; + off_45A100 = -6.0f; + return true; + case 230: + dword_45A0FC = Actor_Query_Goal_Number(1) == 215; + Actor_Change_Animation_Mode(0, 6); + return true; + case 220: + Actor_Change_Animation_Mode(0, 75); + return true; + case 212: + Global_Variable_Set(47, 0); + Player_Set_Combat_Mode_Access(false); + Player_Gains_Control(); + Scene_Exits_Disable(); + dword_45A0D0_animation_state = 68; + dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(18) - 1; + return true; + case 211: + Actor_Face_Heading(0, 512, false); + Actor_Face_Heading(0, 768, true); + if (Random_Query(0, 1)) { + Actor_Change_Animation_Mode(0, 18); + } else { + Actor_Change_Animation_Mode(0, 16); + } + Delay(150); + Actor_Change_Animation_Mode(0, 0); + Actor_Set_Goal_Number(0, 0); + Player_Gains_Control(); + return true; + case 210: + Actor_Put_In_Set(0, 54); + Actor_Set_At_XYZ(0, -204.0, 24.0, -817.0, 256); + Actor_Set_Invisible(0, false); + if (Game_Flag_Query(627)) { + Actor_Set_Goal_Number(0, 212); + } else { + dword_45A0D0_animation_state = 53; + dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(18) - 1; + Actor_Set_Invisible(0, false); + } + return true; + case 200: + Player_Loses_Control(); + Actor_Change_Animation_Mode(0, 0); + return true; + case 301: + dword_45A0D0_animation_state = 62; + dword_45A0D4_animation_frame = 0; + return true; + case 302: + dword_45A0D0_animation_state = 64; + dword_45A0D4_animation_frame = 0; + return true; + case 303: + dword_45A0D0_animation_state = 65; + dword_45A0D4_animation_frame = 0; + return true; + case 350: + Sound_Play(123, 50, 0, 0, 50); + Delay(1000); + Sound_Play(403, 30, 0, 0, 50); + Delay(1000); + Sound_Play(123, 50, 0, 0, 50); + Actor_Says(4, 1380, 3); + Actor_Says(0, 6610, 13); + Actor_Says(4, 1390, 3); + Actor_Says(0, 6615, 18); + Actor_Says(4, 1420, 3); + Actor_Says(0, 6625, 11); + Actor_Says(4, 1430, 3); + Actor_Says(0, 6630, 12); + Actor_Says(0, 6635, 17); + Actor_Says(0, 6640, 13); + Actor_Says(0, 6645, 19); + Actor_Says(0, 6650, 18); + Actor_Says(0, 6655, 11); + Actor_Says(4, 1440, 3); + Actor_Says(0, 6660, 17); + Actor_Says(0, 6665, 13); + Delay(1000); + Actor_Says(4, 1450, 3); + Actor_Says(0, 6670, 14); + Actor_Says(0, 6675, 11); + Actor_Says(4, 1460, 3); + Actor_Says(0, 6680, 12); + Actor_Says(4, 1470, 3); + Actor_Says(0, 6685, 13); + Delay(500); + Actor_Says(0, 6695, 16); + Actor_Says(0, 6700, 17); + Actor_Says(4, 1480, 3); + Actor_Says(0, 6705, 11); + Sound_Play(123, 50, 0, 0, 50); + return true; + case 390: + Actor_Force_Stop_Walking(0); + Player_Loses_Control(); + flt_462710 = 48.07f; + off_45A100 = -4.0f; + flt_462714 = -20.0f; + if (dword_45A0D0_animation_state != 27 && dword_45A0D0_animation_state != 50) { + dword_45A0D0_animation_state = 50; + dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(18) - 1; + } + return true; + case 400: + Actor_Set_Health(0, 50, 50); + Game_Flag_Set(373); + v5 = Global_Variable_Query(45); + if (v5 == 1) { + Actor_Modify_Friendliness_To_Other(1, 0, 3); + } else if (v5 == 2) { + Actor_Modify_Friendliness_To_Other(1, 0, -5); + Actor_Modify_Friendliness_To_Other(5, 0, 3); + } else if (v5 == 3) { + Actor_Modify_Friendliness_To_Other(1, 0, -5); + Actor_Modify_Friendliness_To_Other(5, 0, 5); + } + if (Game_Flag_Query(666)) { + Actor_Modify_Friendliness_To_Other(1, 0, 3); + } + if (Actor_Query_Friendliness_To_Other(1, 0) < Actor_Query_Friendliness_To_Other(5, 0)) { + Game_Flag_Set(653); + } + v7 = Global_Variable_Query(45); + if (v7 == 1) { + if (Game_Flag_Query(653)) { + Global_Variable_Set(45, 0); + } + } else if (v7 == 2 || v7 == 3) { + if (!Game_Flag_Query(653)) { + Global_Variable_Set(45, 0); + } + } + if (!Game_Flag_Query(653)) { + Game_Flag_Set(461); + } + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Global_Variable_Set(1, 5); + Outtake_Play(10, 0, -1); + if (Game_Flag_Query(666)) { + Chapter_Enter(5, 53, 53); + } else { + Game_Flag_Set(34); + Chapter_Enter(5, 10, 49); + } + return true; + case 500: + Music_Stop(3); + Player_Set_Combat_Mode(false); + Actor_Change_Animation_Mode(0, 0); + dword_45A0D0_animation_state = 0; + dword_45A0D4_animation_frame = 0; + Game_Flag_Set(465); + Set_Enter(67, 72); + return true; + } + return false; +} + +bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) { + int v7, v18, v19, v46; + switch (dword_45A0D0_animation_state) { + case 71: + *animation = 52; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(52)) { + Actor_Change_Animation_Mode(0, 0); + *animation = 19; + dword_45A0D4_animation_frame = 0; + dword_45A0D0_animation_state = 0; + Player_Gains_Control(); + } + break; + case 70: + *animation = 51; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(51)) { + dword_45A0D4_animation_frame = 0; + } + break; + case 69: + *animation = 50; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(50)) { + Actor_Change_Animation_Mode(0, 53); + *animation = 51; + } + break; + case 68: + *animation = 18; + v7 = Slice_Animation_Query_Number_Of_Frames(*animation) - 1 - Global_Variable_Query(47); + if (dword_45A0D4_animation_frame < v7) { + dword_45A0D4_animation_frame++; + } else if (dword_45A0D4_animation_frame > v7) { + dword_45A0D4_animation_frame--; + } + if (dword_45A0D4_animation_frame <= 0) { + Actor_Change_Animation_Mode(0, 0); + *animation = 19; + dword_45A0D0_animation_state = 0; + dword_45A0D4_animation_frame = 0; + Game_Flag_Reset(627); + Scene_Exits_Enable(); + Player_Set_Combat_Mode_Access(true); + Actor_Set_Goal_Number(0, 0); + } + break; + case 67: + *animation = 53; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(53)) { + Actor_Change_Animation_Mode(0, 0); + *animation = 19; + dword_45A0D0_animation_state = 0; + dword_45A0D4_animation_frame = 0; + if (Actor_Query_Goal_Number(0) == 220) { + Actor_Change_Animation_Mode(0, 48); + } + } + break; + case 66: + *animation = 40; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(40)) { + Actor_Change_Animation_Mode(0, 0); + *animation = 19; + dword_45A0D4_animation_frame = 0; + dword_45A0D0_animation_state = 0; + } + break; + case 65: + *animation = 45; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(45)) { + dword_45A0D4_animation_frame = 0; + dword_45A0D0_animation_state = 14; + *animation = 0; + Actor_Set_Goal_Number(0, 0); + } + break; + case 64: + *animation = 44; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(44)) { + dword_45A0D4_animation_frame = 0; + dword_45A0D0_animation_state = 63; + *animation = 43; + } + break; + case 63: + *animation = 43; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(43)) { + dword_45A0D4_animation_frame = 0; + } + break; + case 62: + *animation = 42; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(42)) { + dword_45A0D4_animation_frame = 0; + dword_45A0D0_animation_state = 63; + *animation = 43; + } + break; + case 61: + *animation = 41; + dword_45A0D4_animation_frame--; + if (dword_45A0D4_animation_frame <= 0) { + *animation = 19; + dword_45A0D4_animation_frame = 0; + dword_45A0D0_animation_state = 0; + if (Actor_Query_Goal_Number(0) == 200) { + Actor_Set_Goal_Number(0, 201); + } + } + break; + case 60: + *animation = 41; + if (dword_45A0D4_animation_frame < Slice_Animation_Query_Number_Of_Frames(41) - 1) { + dword_45A0D4_animation_frame++; + } + return true; + case 59: + *animation = 48; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(48)) { + *animation = 19; + dword_45A0D4_animation_frame = 0; + dword_45A0DC = 0; + dword_45A0D0_animation_state = 0; + Player_Gains_Control(); + Item_Add_To_World(109, 982, 6, -110.0, 0.0, -192.0, 0, 48, 32, false, true, false, false); + } + break; + case 58: + *animation = 47; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame == 6) { + v18 = Random_Query(0, 2); + v19 = 0; + if (v18 == 0) { + v19 = 595; + } else if (v18 == 1) { + v19 = 594; + } else if (v18 == 2) { + v19 = 593; + } + Ambient_Sounds_Play_Sound(v19, 39, 0, 0, 99); + } + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(*animation) - 1) { //why -1? + dword_45A0D4_animation_frame = 0; + } + break; + case 57: + *animation = 46; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(46)) { + dword_45A0D4_animation_frame = 0; + } + if (!Game_Flag_Query(550)) { + dword_45A0D4_animation_frame = 0; + dword_45A0D0_animation_state = 59; + *animation = 48; + } + break; + case 56: + *animation = 49; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(49)) { + dword_45A0D4_animation_frame = 0; + if (Actor_Query_Which_Set_In(0) == 87) { + dword_45A0D0_animation_state = 27; + } else { + *animation = 19; + dword_45A0D0_animation_state = 0; + Actor_Change_Animation_Mode(0, 0); + } + } + break; + case 55: + *animation = 32; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame == 7) { + Actor_Change_Animation_Mode(66, 52); + } + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(*animation)) { + *animation = 19; + dword_45A0D0_animation_state = 0; + } + break; + case 53: + *animation = 18; + dword_45A0D4_animation_frame--; + if (dword_45A0D4_animation_frame <= 0) { + Actor_Change_Animation_Mode(0, 0); + *animation = 19; + dword_45A0D4_animation_frame = 0; + dword_45A0D0_animation_state = 0; + if (Actor_Query_Goal_Number(0) == 100) { + Actor_Set_Goal_Number(0, 101); + } + if (Actor_Query_Goal_Number(0) == 210) { + Actor_Set_Goal_Number(0, 211); + } + } + break; + case 52: + *animation = 31; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(31)) { + dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(31) - 1; + dword_45A0D0_animation_state = 50; + } + break; + case 51: + *animation = 28; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(28)) { + Player_Set_Combat_Mode(true); + sub_405800(); + Actor_Set_Goal_Number(0, 0); + dword_45A0D4_animation_frame = 0; + Player_Gains_Control(); + } + break; + case 50: + *animation = 18; + dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(18) - 1; + break; + case 49: + *animation = 34; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(34)) { + Actor_Set_Goal_Number(0, 0); + *animation = 19; + dword_45A0D4_animation_frame = 0; + sub_405660(); + } + break; + case 48: + *animation = 33; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(33)) { + dword_45A0D4_animation_frame = 0; + dword_45A0D0_animation_state = 49; + *animation = 34; + } + break; + case 47: + *animation = 29; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(29)) { + dword_45A0D4_animation_frame = 0; + dword_45A0D0_animation_state = 48; + *animation = 33; + } + break; + case 46: + Actor_Set_Invisible(0, false); + *animation = 36; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(36)) { + *animation = 19; + dword_45A0D4_animation_frame = 0; + Player_Gains_Control(); + sub_405660(); + Actor_Face_Heading(0, (Actor_Query_Facing_1024(0) + 512) & 1023, false); + } + break; + case 45: + *animation = 35; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(35)) { + Actor_Set_Invisible(0, true); + *animation = 19; + dword_45A0D4_animation_frame = 0; + sub_405660(); + } + break; + case 44: + *animation = 30; + if (dword_45A0D4_animation_frame++ == 127) { + Game_Flag_Set(325); + } + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(30)) { + *animation = 19; + sub_405660(); + Actor_Set_At_XYZ(0, -203.41f, -621.3f, 724.57f, 538); + Player_Gains_Control(); + } + break; + case 43: + *animation = 38; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(38) - 1) { //why -1? + dword_45A0D4_animation_frame = 0; + } + switch (dword_45A0D4_animation_frame) { + case 9: + Sound_Left_Footstep_Walk(0); + break; + case 4: + Sound_Right_Footstep_Walk(0); + break; + case 1: + Sound_Right_Footstep_Walk(0); + break; + } + break; + case 42: + *animation = 37; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(37) - 1) { //why -1? + dword_45A0D4_animation_frame = 0; + } + switch (dword_45A0D4_animation_frame) { + case 9: + Sound_Left_Footstep_Walk(0); + break; + case 4: + Sound_Right_Footstep_Walk(0); + break; + case 1: + Sound_Right_Footstep_Walk(0); + break; + } + break; + case 41: + *animation = 7; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(7)) { + dword_45A0D4_animation_frame = 0; + ++off_45A0EC; + } + if (dword_45A0D4_animation_frame == 9) { + Sound_Left_Footstep_Walk(0); + } else if (dword_45A0D4_animation_frame == 4) { + Sound_Right_Footstep_Walk(0); + } + if (Game_Flag_Query(359)) { + sub_4059D0(-0.2f); + } + break; + case 40: + *animation = 6; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(6)) { + dword_45A0D4_animation_frame = 0; + ++off_45A0EC; + } + if (dword_45A0D4_animation_frame == 8) { + Sound_Left_Footstep_Walk(0); + } else if (dword_45A0D4_animation_frame == 3) { + Sound_Right_Footstep_Walk(0); + } + if (Game_Flag_Query(358)) { + sub_405940(0.5f); + } + break; + case 39: + *animation = 16; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(16)) { + dword_45A0D4_animation_frame = 0; + ++off_45A0EC; + } + if (dword_45A0D4_animation_frame == 8) { + Sound_Left_Footstep_Walk(0); + } else if (dword_45A0D4_animation_frame == 3) { + Sound_Right_Footstep_Walk(0); + } + if (Game_Flag_Query(359)) { + sub_4059D0(-0.2f); + } + break; + case 38: + *animation = 15; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(15)) { + dword_45A0D4_animation_frame = 0; + ++off_45A0EC; + } + if (dword_45A0D4_animation_frame == 9) { + Sound_Left_Footstep_Walk(0); + } else if (dword_45A0D4_animation_frame == 4) { + Sound_Right_Footstep_Walk(0); + } + if (Game_Flag_Query(358)) { + sub_405940(0.5f); + } + break; + case 37: + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(4)) { + dword_45A0D4_animation_frame = 0; + } + *animation = 4; + if (dword_45A0D4_animation_frame == 6) { + Sound_Left_Footstep_Run(0); + } + if (dword_45A0D4_animation_frame == 0) { + Sound_Right_Footstep_Run(0); + } + break; + case 36: + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(3)) { + dword_45A0D4_animation_frame = 0; + } + *animation = 3; + if (dword_45A0D4_animation_frame == 15) { + Sound_Left_Footstep_Walk(0); + } + if (dword_45A0D4_animation_frame == 6) { + Sound_Right_Footstep_Walk(0); + } + break; + case 32: + dword_45A0D4_animation_frame = 1; + dword_45A0D0_animation_state = 30; + *animation = 13; + break; + case 31: + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(14)) { + dword_45A0D4_animation_frame = 0; + } + *animation = 14; + if (dword_45A0D4_animation_frame == 5) { + Sound_Left_Footstep_Run(0); + } else if (dword_45A0D4_animation_frame == 12) { + Sound_Right_Footstep_Run(0); + } + break; + case 30: + *animation = 13; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(13)) { + dword_45A0D4_animation_frame = 0; + } + if (dword_45A0D4_animation_frame == 2) { + Sound_Right_Footstep_Walk(0); + } else if (dword_45A0D4_animation_frame == 10) { + Sound_Left_Footstep_Walk(0); + } + break; + case 29: + v46 = dword_45A0D4_animation_frame + dword_45A0E0; + *animation = 18; + dword_45A0D4_animation_frame = v46; + if (v46 < 14) { + dword_45A0E0 = 1; + } + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(*animation)) { + Actor_Change_Animation_Mode(0, 48); + *animation = 18; + dword_45A0D0_animation_state = 27; + dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(18) - 1; + } + break; + case 28: + *animation = 5; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(5)) { + dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(*animation) - 1; + dword_45A0D0_animation_state = 50; + sub_4054F0(); + } + break; + case 27: + *animation = 18; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(18)) { + dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(*animation) - 1; + dword_45A0D0_animation_state = 50; + sub_4054F0(); + if (Actor_Query_Goal_Number(0) == 220) { + Actor_Set_Goal_Number(0, 221); + } + } + break; + case 26: + *animation = 17; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(17)) { + *animation = 19; + dword_45A0D4_animation_frame = 0; + dword_45A0D0_animation_state = 0; + Actor_Change_Animation_Mode(0, 0); + } + break; + case 25: + *animation = 17; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(17)) { + *animation = 19; + dword_45A0D4_animation_frame = 0; + dword_45A0D0_animation_state = 0; + Actor_Change_Animation_Mode(0, 0); + } + break; + case 24: + *animation = 1; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(1)) { + dword_45A0D4_animation_frame = 0; + dword_45A0D0_animation_state = 14; + *animation = 0; + Actor_Change_Animation_Mode(0, 4); + } + break; + case 23: + *animation = 1; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(1)) { + dword_45A0D4_animation_frame = 0; + dword_45A0D0_animation_state = 14; + *animation = 0; + Actor_Change_Animation_Mode(0, 4); + } + break; + case 22: + dword_45A0D4_animation_frame = 0; + dword_45A0D0_animation_state = 17; + *animation = 12; + break; + case 21: + *animation = 12; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame == 1 && Actor_Query_Goal_Number(0) == 230 && dword_45A0FC == 1) { + dword_45A0F8 = 27; + } + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(12)) { + dword_45A0D0_animation_state = 17; + dword_45A0D4_animation_frame = 0; + *animation = 12; + if (Actor_Query_Goal_Number(0) == 230) { + dword_45A0D4_animation_frame = 0; + dword_45A0D0_animation_state = 21; + dword_45A0FC = 1; + *animation = 12; + } + } + break; + case 19: + *animation = 11; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= 12) { + dword_45A0D4_animation_frame = 0; + dword_45A0D0_animation_state = 14; + *animation = 0; + } + break; + case 18: + *animation = 10; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(10)) { + dword_45A0D4_animation_frame = 0; + dword_45A0D0_animation_state = 17; + *animation = 12; + } + break; + case 17: + *animation = 12; + dword_45A0D4_animation_frame = 0; + // weird, but thats in game code + if (Slice_Animation_Query_Number_Of_Frames(12) <= 0) { + dword_45A0D4_animation_frame = 0; + dword_45A0D0_animation_state = 17; + } + break; + case 16: + *animation = 9; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(9)) { + *animation = 19; + dword_45A0D4_animation_frame = 0; + dword_45A0D0_animation_state = 0; + } + break; + case 15: + *animation = 8; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(8)) { + dword_45A0D4_animation_frame = 0; + dword_45A0D0_animation_state = 14; + *animation = 0; + } + break; + case 14: + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(0)) { + dword_45A0D0_animation_state = 14; + dword_45A0D4_animation_frame = 0; + } + *animation = 0; + break; + case 13: + *animation = 19; + if (dword_45A0D4_animation_frame < Slice_Animation_Query_Number_Of_Frames(19) / 2) { + dword_45A0D4_animation_frame -= 3; + if (dword_45A0D4_animation_frame <= 0) { + dword_45A0D4_animation_frame = 0; + *animation = dword_46271C; + dword_45A0D0_animation_state = dword_462718; + } + } else { + dword_45A0D4_animation_frame += 3; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(19)) { + dword_45A0D4_animation_frame = 0; + *animation = dword_46271C; + dword_45A0D0_animation_state = dword_462718; + } + } + break; + case 12: + *animation = 27; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(27)) { + dword_45A0D4_animation_frame = 0; + dword_45A0D0_animation_state = 3; + *animation = 20; + } + break; + case 11: + *animation = 26; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(26)) { + dword_45A0D4_animation_frame = 0; + dword_45A0D0_animation_state = 3; + *animation = 20; + } + break; + case 10: + *animation = 25; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(25)) { + dword_45A0D4_animation_frame = 0; + dword_45A0D0_animation_state = 3; + *animation = 20; + } + break; + case 9: + *animation = 24; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(24)) { + dword_45A0D4_animation_frame = 0; + dword_45A0D0_animation_state = 3; + *animation = 20; + } + break; + case 8: + *animation = 23; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(23)) { + dword_45A0D4_animation_frame = 0; + dword_45A0D0_animation_state = 3; + *animation = 20; + } + break; + case 7: + *animation = 22; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(22)) { + dword_45A0D4_animation_frame = 0; + dword_45A0D0_animation_state = 3; + *animation = 20; + } + break; + case 6: + *animation = 27; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(27)) { + dword_45A0D4_animation_frame = 0; + dword_45A0D0_animation_state = 3; + *animation = 20; + } + break; + case 5: + *animation = 21; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(21)) { + dword_45A0D4_animation_frame = 0; + dword_45A0D0_animation_state = 3; + *animation = 20; + } + break; + case 3: + case 4: + if (dword_45A0D4_animation_frame == 0 && !Game_Flag_Query(236)) { + dword_45A0D4_animation_frame = 1; + dword_45A0D0_animation_state = dword_45A0F0; + *animation = dword_45A0F4; + dword_45A0F0 = 4; + dword_45A0F4 = 20; + } else if (dword_45A0D4_animation_frame <= 4 && Game_Flag_Query(236)) { + Game_Flag_Reset(236); + *animation = 19; + dword_45A0D4_animation_frame = 0; + dword_45A0D0_animation_state = 0; + } else { + *animation = 20; + dword_45A0D4_animation_frame++; + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(20)) { + dword_45A0D4_animation_frame = 0; + } + } + break; + case 0: + *animation = 19; + if (dword_45A0D8 < dword_45A0DC) { + //*frame = dword_45A0E8; + dword_45A0D4_animation_frame += dword_45A0E0; + if (dword_45A0D4_animation_frame > dword_45A0E8) { + dword_45A0D4_animation_frame = dword_45A0E8; + dword_45A0E0 = -1; + } else if (dword_45A0D4_animation_frame < dword_45A0E4) { + dword_45A0D4_animation_frame = dword_45A0E4; + dword_45A0E0 = 1; + } + dword_45A0D8++; + } else { + dword_45A0D4_animation_frame += dword_45A0E0; + dword_45A0DC = 0; + if (dword_45A0D4_animation_frame == 18 && Random_Query(0, 2)) { + dword_45A0E0 = -1; + dword_45A0D8 = 0; + dword_45A0E4 = 14; + dword_45A0E8 = 18; + dword_45A0DC = Random_Query(0, 30); + } + if (dword_45A0D4_animation_frame == 26) { + if (Random_Query(0, 2)) { + dword_45A0E0 = -1; + dword_45A0D8 = 0; + dword_45A0E4 = 23; + dword_45A0E8 = 26; + dword_45A0DC = Random_Query(0, 30); + } + } + if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(19)) { + dword_45A0D4_animation_frame = 0; + if (Random_Query(0, 2)) { + dword_45A0D8 = 0; + dword_45A0E4 = 0; + dword_45A0E8 = 3; + dword_45A0DC = Random_Query(0, 45); + } + } + if (dword_45A0D4_animation_frame < 0) { + dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(19) - 1; + } + } + break; + } + *frame = dword_45A0D4_animation_frame; + return true; +} + +bool AIScriptMcCoy::ChangeAnimationMode(int mode) { + int v2; + switch (mode) { + case 85: + dword_45A0D4_animation_frame = 0; + dword_45A0D0_animation_state = 69; + return true; + case 75: + dword_45A0D0_animation_state = 67; + dword_45A0D4_animation_frame = 0; + return true; + case 68: + dword_45A0D0_animation_state = 29; + dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(18) - 1; + dword_45A0E0 = -1; + return true; + case 65: + case 67: + dword_45A0D0_animation_state = 43; + dword_45A0D4_animation_frame = 0; + return true; + case 64: + case 66: + dword_45A0D0_animation_state = 42; + dword_45A0D4_animation_frame = 0; + return true; + case 53: + if (dword_45A0D0_animation_state != 60 && (Player_Query_Current_Set() == 55 || Player_Query_Current_Set() == 13)) { + dword_45A0D0_animation_state = 60; + dword_45A0D4_animation_frame = 0; + } else { + dword_45A0D4_animation_frame = 0; + dword_45A0D0_animation_state = 70; + } + return true; + case 52: + dword_45A0D0_animation_state = 55; + dword_45A0D4_animation_frame = 0; + return true; + case 51: + dword_45A0D0_animation_state = 27; + dword_45A0D4_animation_frame = 0; + return true; + case 49: + dword_45A0D0_animation_state = 28; + dword_45A0D4_animation_frame = 0; + return true; + case 48: + switch (dword_45A0D0_animation_state) { + case 14: + dword_45A0D0_animation_state = 28; + dword_45A0D4_animation_frame = 0; + break; + case 13: + dword_45A0D0_animation_state = 22; + dword_45A0D4_animation_frame = 0; + return true; + case 10: + dword_45A0D0_animation_state = 18; + dword_45A0D4_animation_frame = 8 * (13 - dword_45A0D4_animation_frame) / 13; + return true; + case 8: + case 9: + case 12: + return true; + case 11: + dword_45A0D0_animation_state = 18; + dword_45A0D4_animation_frame = 0; + break; + case 7: + dword_45A0D0_animation_state = 14; + dword_45A0D4_animation_frame = 0; + break; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + dword_45A0D0_animation_state = 15; + dword_45A0D4_animation_frame = 0; + break; + default: + if (dword_45A0D0_animation_state != 50) { + dword_45A0D0_animation_state = 27; + dword_45A0D4_animation_frame = 0; + } + break; + } + return true; + case 47: + dword_45A0D0_animation_state = 41; + dword_45A0D4_animation_frame = 0; + return true; + case 46: + dword_45A0D0_animation_state = 40; + dword_45A0D4_animation_frame = 0; + return true; + case 45: + dword_45A0D0_animation_state = 39; + dword_45A0D4_animation_frame = 0; + return true; + case 44: + dword_45A0D0_animation_state = 38; + dword_45A0D4_animation_frame = 0; + return true; + case 42: + dword_45A0D0_animation_state = 46; + dword_45A0D4_animation_frame = 0; + Player_Loses_Control(); + return true; + case 41: + dword_45A0D0_animation_state = 45; + dword_45A0D4_animation_frame = 0; + return true; + case 40: + dword_45A0D0_animation_state = 44; + dword_45A0D4_animation_frame = 0; + return true; + case 39: + dword_45A0D4_animation_frame = 0; + dword_45A0D0_animation_state = 52; + if (Player_Query_Current_Set() == 27) { + dword_45A0D4_animation_frame = 23; + } + return true; + case 38: + dword_45A0D0_animation_state = 47; + dword_45A0D4_animation_frame = 0; + return true; + case 29: + Player_Loses_Control(); + dword_45A0D4_animation_frame = 0; + dword_45A0D0_animation_state = 71; + return true; + case 23: + dword_45A0D0_animation_state = 66; + dword_45A0D4_animation_frame = 0; + return true; + case 22: + if (Random_Query(0, 1)) { + dword_45A0D0_animation_state = 23; + } else { + dword_45A0D0_animation_state = 24; + } + dword_45A0D4_animation_frame = 0; + return true; + case 21: + switch (dword_45A0D0_animation_state) { + case 0: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + dword_45A0D0_animation_state = 28; + dword_45A0D4_animation_frame = 0; + break; + case 1: + case 8: + dword_45A0D0_animation_state = 27; + dword_45A0D4_animation_frame = 0; + break; + default: + + if (Random_Query(0, 1)) { + dword_45A0D0_animation_state = 26; + } else { + dword_45A0D0_animation_state = 25; + } + dword_45A0D4_animation_frame = 0; + break; + } + return true; + case 20: + v2 = Actor_Query_Which_Set_In(0); + if (v2 == 27) { + dword_45A0D0_animation_state = 51; + dword_45A0D4_animation_frame = 0; + Player_Loses_Control(); + Game_Flag_Set(210); + } else if (v2 == 70 || v2 == 87) { + dword_45A0D0_animation_state = 56; + dword_45A0D4_animation_frame = 0; + } + return true; + case 19: + if (dword_45A0D0_animation_state < 3 || dword_45A0D0_animation_state > 12) { + dword_45A0D0_animation_state = 13; + dword_462718 = 12; + dword_46271C = 27; + } else { + Game_Flag_Reset(236); + dword_45A0F0 = 12; + dword_45A0F4 = 27; + } + return true; + case 18: + if (dword_45A0D0_animation_state < 3 || dword_45A0D0_animation_state > 12) { + dword_45A0D0_animation_state = 13; + dword_462718 = 11; + dword_46271C = 26; + } else { + Game_Flag_Reset(236); + dword_45A0F0 = 11; + dword_45A0F4 = 26; + } + return true; + case 17: + if (dword_45A0D0_animation_state < 3 || dword_45A0D0_animation_state > 12) { + dword_45A0D0_animation_state = 13; + dword_462718 = 10; + dword_46271C = 25; + } else { + Game_Flag_Reset(236); + dword_45A0F0 = 10; + dword_45A0F4 = 25; + } + return true; + case 16: + if (dword_45A0D0_animation_state < 3 || dword_45A0D0_animation_state > 12) { + dword_45A0D0_animation_state = 13; + dword_462718 = 9; + dword_46271C = 24; + } else { + Game_Flag_Reset(236); + dword_45A0F0 = 9; + dword_45A0F4 = 24; + } + return true; + case 15: + if (dword_45A0D0_animation_state < 3 || dword_45A0D0_animation_state > 12) { + dword_45A0D0_animation_state = 13; + dword_462718 = 8; + dword_46271C = 23; + } else { + Game_Flag_Reset(236); + dword_45A0F0 = 8; + dword_45A0F4 = 23; + } + return true; + case 11: + case 14: + if (dword_45A0D0_animation_state < 3 || dword_45A0D0_animation_state > 12) { + dword_45A0D0_animation_state = 13; + dword_462718 = 7; + dword_46271C = 22; + } else { + Game_Flag_Reset(236); + dword_45A0F0 = 7; + dword_45A0F4 = 22; + } + return true; + case 10: + case 13: + if (dword_45A0D0_animation_state < 3 || dword_45A0D0_animation_state > 12) { + dword_45A0D0_animation_state = 13; + dword_462718 = 6; + dword_46271C = 27; + } else { + Game_Flag_Reset(236); + dword_45A0F0 = 6; + dword_45A0F4 = 27; + } + return true; + case 9: + case 12: + if (dword_45A0D0_animation_state < 3 || dword_45A0D0_animation_state > 12) { + dword_45A0D0_animation_state = 13; + dword_462718 = 5; + dword_46271C = 21; + } else { + Game_Flag_Reset(236); + dword_45A0F0 = 5; + dword_45A0F4 = 21; + } + return true; + case 8: + if (dword_45A0D0_animation_state != 27 && dword_45A0D0_animation_state != 50) { + dword_45A0D0_animation_state = 37; + dword_45A0D4_animation_frame = 0; + } + return true; + case 7: + if (dword_45A0D0_animation_state != 27 && dword_45A0D0_animation_state != 50) { + dword_45A0D0_animation_state = 36; + dword_45A0D4_animation_frame = 0; + } + return true; + case 6: + dword_45A0D0_animation_state = 21; + dword_45A0D4_animation_frame = 0; + return true; + case 5: + switch (dword_45A0D0_animation_state) { + case 1: + case 2: + case 5: + dword_45A0D0_animation_state = 14; + dword_45A0D4_animation_frame = 0; + break; + case 0: + case 3: + case 4: + dword_45A0D0_animation_state = 15; + dword_45A0D4_animation_frame = 0; + break; + default: + dword_45A0D0_animation_state = 18; + dword_45A0D4_animation_frame = 0; + break; + } + return true; + case 4: + switch (dword_45A0D0_animation_state) { + case 22: + dword_45A0D0_animation_state = 19; + dword_45A0D4_animation_frame = 41; + break; + case 18: + dword_45A0D0_animation_state = 19; + dword_45A0D4_animation_frame = 13 * ((8 - dword_45A0D4_animation_frame) / 8); + break; + case 17: + case 20: + dword_45A0D0_animation_state = 19; + dword_45A0D4_animation_frame = 0; + break; + case 16: + dword_45A0D0_animation_state = 15; + dword_45A0D4_animation_frame = 12 - 12 * dword_45A0D4_animation_frame / 16; + break; + case 14: + case 15: + case 19: + case 21: + case 2: + case 3: + return true; + default: + dword_45A0D0_animation_state = 15; + dword_45A0D4_animation_frame = 0; + break; + case 13: + dword_45A0D0_animation_state = 16; + dword_45A0D4_animation_frame = 0; + break; + case 0: + case 1: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + dword_45A0D0_animation_state = 0; + dword_45A0D4_animation_frame = 0; + dword_45A0DC = 0; + break; + } + return true; + case 3: + if (dword_45A0D0_animation_state >= 3 && dword_45A0D0_animation_state <= 12) { + Game_Flag_Reset(236); + dword_45A0F0 = 4; + dword_45A0F4 = 20; + } else { + dword_45A0D0_animation_state = 13; + dword_462718 = 3; + dword_46271C = 20; + } + return true; + case 2: + if (dword_45A0D0_animation_state == 27 || dword_45A0D0_animation_state == 50) { + return true; + } + if (!Game_Flag_Query(550)) { + dword_45A0D0_animation_state = 31; + dword_45A0D4_animation_frame = 0; + return true; + } + dword_45A0D0_animation_state = 58; + dword_45A0D4_animation_frame = 4; + return true; + case 1: + if (dword_45A0D0_animation_state == 27 || dword_45A0D0_animation_state == 50) { + return true; + } + if (!Game_Flag_Query(550)) { + dword_45A0D0_animation_state = 32; + dword_45A0D4_animation_frame = 0; + return true; + } + dword_45A0D0_animation_state = 58; + dword_45A0D4_animation_frame = 0; + return true; + case 0: + if (Game_Flag_Query(550)) { + if (dword_45A0D4_animation_frame > 6) { + dword_45A0D0_animation_state = 57; + dword_45A0D4_animation_frame = 0; + return true; + } + int v3 = Random_Query(0, 2); + int v4 = 0; + if (v3 == 0) { + v4 = 595; + } else if (v3 == 1) { + v4 = 594; + } else if (v3 == 2) { + v4 = 593; + } + Ambient_Sounds_Play_Sound(v4, 39, 0, 0, 99); + dword_45A0D0_animation_state = 57; + dword_45A0D4_animation_frame = 0; + return true; + } + if (dword_45A0D0_animation_state == 60) { + dword_45A0D0_animation_state = 61; + return true; + } + dword_45A0D0_animation_state = 0; + dword_45A0D4_animation_frame = 0; + dword_45A0DC = 0; + return true; + } + return true; +} + +void AIScriptMcCoy::QueryAnimationState(int *animationState, int *a2, int *a3, int *a4) { + *animationState = dword_45A0D0_animation_state; + *a2 = dword_45A0D4_animation_frame; + *a3 = dword_462718; + *a4 = dword_46271C; +} + +void AIScriptMcCoy::SetAnimationState(int animationState, int a2, int a3, int a4) { + dword_45A0D0_animation_state = animationState; + dword_45A0D4_animation_frame = a2; + dword_462718 = a3; + dword_46271C = a4; +} + +bool AIScriptMcCoy::ReachedMovementTrackWaypoint(int waypointId) { + return true; +} + +void AIScriptMcCoy::FledCombat() {} + +void AIScriptMcCoy::sub_4053E0() { + float x, y, z; + Actor_Query_XYZ(0, &x, &y, &z); + flt_462710 = flt_462710 + off_45A100; + if (flt_462714 < flt_462710) { + off_45A100 = off_45A100 - 0.2f; + } else { + flt_462710 = flt_462714; + Actor_Set_Goal_Number(0, 0); + Actor_Retired_Here(0, 12, 48, 1, -1); + } + return Actor_Set_At_XYZ(0, x, flt_462710, z, Actor_Query_Facing_1024(0)); +} + +void AIScriptMcCoy::sub_4054F0() { + if (Actor_Query_Which_Set_In(0) == 87 && Actor_Query_Goal_Number(0) != 390 && !Game_Flag_Query(682)) { + float x, y, z; + Actor_Query_XYZ(0, &x, &y, &z); + if ((z < 220.0f) && (-210.0f < x) && (-70.0f > x)) { + Game_Flag_Set(682); + Scene_Loop_Set_Default(3); + Scene_Loop_Start_Special(2, 2, 1); + Actor_Set_Goal_Number(0, 390); + Actor_Query_XYZ(64, &x, &y, &z); + if (-200.0 < x && -62.0f > x) { + Actor_Set_Goal_Number(64, 309); + } + } else { + Actor_Set_Goal_Number(0, 391); + } + } +} + +void AIScriptMcCoy::sub_405660() { + if (Game_Flag_Query(550)) { + if (dword_45A0D4_animation_frame <= 6) { + int v1 = Random_Query(0, 2); + int v2 = 0; + if (v1 == 0) { + v2 = 595; + } else if (v1 == 1) { + v2 = 594; + } else if (v1 == 2) { + v2 = 593; + } + Ambient_Sounds_Play_Sound(v2, 39, 0, 0, 99); + } + dword_45A0D0_animation_state = 57; + dword_45A0D4_animation_frame = 0; + return; + } + switch (dword_45A0D0_animation_state) { + case 17: + case 20: + case 21: + case 36: + dword_45A0D0_animation_state = 16; + dword_45A0D4_animation_frame = 0; + break; + case 16: + case 25: + case 26: + break; + case 15: + dword_45A0D0_animation_state = 16; + dword_45A0D4_animation_frame = 16 - 16 * dword_45A0D4_animation_frame / 12; + break; + case 14: + dword_45A0D0_animation_state = 16; + dword_45A0D4_animation_frame = 0; + break; + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + Game_Flag_Set(236); + dword_45A0D8 = 0; + dword_45A0DC = 30; + dword_45A0E4 = 0; + dword_45A0E0 = 1; + dword_45A0E8 = 3; + break; + case 60: + dword_45A0D0_animation_state = 61; + break; + default: + dword_45A0D0_animation_state = 0; + dword_45A0D4_animation_frame = 0; + dword_45A0DC = 0; + } +} + +void AIScriptMcCoy::sub_405800() { + switch (dword_45A0D0_animation_state) { + case 36: + case 37: + case 40: + case 41: + case 51: + dword_45A0D0_animation_state = 14; + dword_45A0D4_animation_frame = 0; + break; + case 22: + dword_45A0D0_animation_state = 19; + dword_45A0D4_animation_frame = 41; + break; + case 18: + dword_45A0D0_animation_state = 19; + dword_45A0D4_animation_frame = 13 * ((8 - dword_45A0D4_animation_frame) / 8); + break; + case 17: + case 20: + dword_45A0D0_animation_state = 19; + dword_45A0D4_animation_frame = 0; + break; + case 16: + dword_45A0D4_animation_frame = 12 - 12 * dword_45A0D4_animation_frame / 16; + dword_45A0D0_animation_state = 15; + break; + case 14: + case 15: + case 19: + case 21: + break; + default: + dword_45A0D0_animation_state = 15; + dword_45A0D4_animation_frame = 0; + break; + } +} + +void AIScriptMcCoy::sub_4058B0() { + int v0 = Actor_Query_Which_Set_In(0); + if (v0 == 27) { + dword_45A0D0_animation_state = 51; + dword_45A0D4_animation_frame = 0; + Player_Loses_Control(); + Game_Flag_Set(210); + } else if (v0 == 70 || v0 == 87) { + dword_45A0D0_animation_state = 56; + dword_45A0D4_animation_frame = 0; + } +} + +void AIScriptMcCoy::sub_405920() { + dword_45A0D4_animation_frame = 0; + dword_45A0D0_animation_state = 47; +} + +void AIScriptMcCoy::sub_405940(float a1) { + float x, y, z; + int currentAngle = Actor_Query_Facing_1024(0); + Actor_Query_XYZ(0, &x, &y, &z); + int angle = currentAngle - 12; + y = y + a1; + if (angle < 0) { + angle = currentAngle + 1012; + } + if (angle > 1023) { + angle -= 1024; + } + Actor_Set_At_XYZ(0, x, y, z, angle); +} + +void AIScriptMcCoy::sub_4059D0(float a1) { + float x, y, z; + int currentAngle = Actor_Query_Facing_1024(0); + Actor_Query_XYZ(0, &x, &y, &z); + int angle = currentAngle + 15; + y = y + a1; + if (angle < 0) { + angle = currentAngle + 1039; + } + if (angle > 1023) { + angle -= 1024; + } + return Actor_Set_At_XYZ(0, x, y, z, angle); +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ai/officer_leroy.cpp b/engines/bladerunner/script/ai/officer_leroy.cpp new file mode 100644 index 0000000000..9dc41650e8 --- /dev/null +++ b/engines/bladerunner/script/ai/officer_leroy.cpp @@ -0,0 +1,1214 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/ai.h" + +namespace BladeRunner { + +void AIScriptOfficerLeroy::Initialize() { + var_45D5B0_animation_state = 0; + var_45D5B4_animation_frame = 0; + var_462880 = 0; + var_45D5B8 = 0; + var_45D5BC = 0; + + Actor_Put_In_Set(23, 69); + Actor_Set_At_XYZ(23, -261.80f, 6.00f, 79.58f, 512); + Actor_Set_Goal_Number(23, 0); + Actor_Set_Frame_Rate_FPS(23, 8); +} + +bool AIScriptOfficerLeroy::Update() { + if (Global_Variable_Query(1) == 4 && Actor_Query_Goal_Number(23) < 300) { + AI_Movement_Track_Flush(23); + Actor_Set_Goal_Number(23, 300); + } else if (Global_Variable_Query(1) == 5 && Actor_Query_Goal_Number(23) < 400) { + AI_Movement_Track_Flush(23); + Actor_Set_Goal_Number(23, 400); + } else if (!Game_Flag_Query(182) && Game_Flag_Query(147) == 1 && Game_Flag_Query(163) == 1 && Player_Query_Current_Scene() != 78 && Global_Variable_Query(1) < 3) { + Game_Flag_Set(186); + Actor_Set_Goal_Number(23, 3); + } else if (Actor_Query_Goal_Number(23) != 1 && Actor_Query_Goal_Number(23) != 2 && Game_Flag_Query(199) == 1) { + Game_Flag_Reset(199); + } else if (Global_Variable_Query(15) > 4 && !Actor_Clue_Query(23, 239)) { + Actor_Clue_Acquire(23, 239, 1, -1); + } else if (Game_Flag_Query(629) == 1) { + Game_Flag_Reset(629); + } else if (Game_Flag_Query(623) == 1 && !Game_Flag_Query(664)) { + Game_Flag_Set(664); + Actor_Set_Goal_Number(23, 305); + } else if (Actor_Query_Goal_Number(23) == 310 && Actor_Query_Which_Set_In(23) != Player_Query_Current_Set()) { + Non_Player_Actor_Combat_Mode_Off(23); + Actor_Set_Goal_Number(23, 305); + } else if (Actor_Query_Goal_Number(23) == 599 && Actor_Query_Which_Set_In(23) != Player_Query_Current_Set()) { + Actor_Set_Health(23, 40, 40); + Actor_Set_Goal_Number(23, 305); + } else if (Actor_Query_Goal_Number(23) == 305) { + switch (Actor_Query_Which_Set_In(23)) { + case 7: + if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) { + Actor_Set_Goal_Number(23, 310); + Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 0, 4, 7, 8, -1, -1, -1, 10, 300, 0); + } + break; + case 20: + if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) { + Actor_Set_Goal_Number(23, 310); + Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 1, 4, 7, 8, -1, -1, -1, 10, 300, 0); + } + break; + case 33: + if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) { + Actor_Set_Goal_Number(23, 310); + Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 5, 4, 7, 8, -1, -1, -1, 10, 300, 0); + } + break; + case 53: + if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) { + Actor_Set_Goal_Number(23, 310); + Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 7, 4, 7, 8, -1, -1, -1, 10, 300, 0); + } + break; + case 54: + if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) { + Actor_Set_Goal_Number(23, 310); + Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 3, 4, 7, 8, -1, -1, -1, 10, 300, 0); + } + break; + case 70: + if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) { + Actor_Set_Goal_Number(23, 310); + Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 18, 4, 7, 8, -1, -1, -1, 10, 300, 0); + } + break; + case 74: + if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) { + Actor_Set_Goal_Number(23, 310); + Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 11, 4, 7, 8, -1, -1, -1, 10, 300, 0); + } + break; + case 77: + case 78: + case 79: + if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) { + Actor_Set_Goal_Number(23, 310); + Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 10, 4, 7, 8, -1, -1, -1, 10, 300, 0); + } + break; + case 81: + if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) { + Actor_Set_Goal_Number(23, 310); + Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 13, 4, 7, 8, -1, -1, -1, 10, 300, 0); + } + break; + case 83: + if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) { + Actor_Set_Goal_Number(23, 310); + Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 14, 4, 7, 8, -1, -1, -1, 10, 300, 0); + } + break; + case 84: + if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) { + Actor_Set_Goal_Number(23, 310); + Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 16, 4, 7, 8, -1, -1, -1, 10, 300, 0); + } + break; + case 86: + if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) { + Actor_Set_Goal_Number(23, 310); + Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 17, 4, 7, 8, -1, -1, -1, 10, 300, 0); + } + break; + } + } + return false; +} + +void AIScriptOfficerLeroy::TimerExpired(int timer) { + if (timer == 1) { + AI_Countdown_Timer_Reset(23, 1); + if (Actor_Query_In_Set(0, 41)) { + Actor_Set_Goal_Number(23, 430); + Actor_Set_Goal_Number(24, 430); + } else { + Game_Flag_Set(684); + } + } else if (timer == 2) { + AI_Countdown_Timer_Reset(23, 2); + sub_431420(); + } +} + +void AIScriptOfficerLeroy::CompletedMovementTrack() { + int v0; + unsigned int v1; + + v0 = Actor_Query_Goal_Number(23); + if (v0 == 1) { + Actor_Set_Goal_Number(23, 2); + return; + } + //todo: tidyup + v1 = v0 - 305; + if (v1 > 3) { + return; + } + if (!v1) { + Actor_Set_Goal_Number(23, 306); + return; + } + if (v1 != 2) { + if (v1 == 3) { + Actor_Change_Animation_Mode(23, 4); + Actor_Face_Actor(23, 0, true); + Actor_Set_Goal_Number(23, 309); + } + return; + } + Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 12, 4, 7, 8, 0, -1, -1, 15, 300, 0); +} + +void AIScriptOfficerLeroy::ReceivedClue(int clueId, int fromActorId) { + if (clueId == 222) { + Actor_Modify_Friendliness_To_Other(23, 0, 5); + } + if (clueId == 215) { + Actor_Modify_Friendliness_To_Other(23, 0, -4); + } +} + +void AIScriptOfficerLeroy::ClickedByPlayer() {} + +void AIScriptOfficerLeroy::EnteredScene(int sceneId) {} + +void AIScriptOfficerLeroy::OtherAgentEnteredThisScene(int otherActorId) {} + +void AIScriptOfficerLeroy::OtherAgentExitedThisScene(int otherActorId) {} + +void AIScriptOfficerLeroy::OtherAgentEnteredCombatMode(int otherActorId, int combatMode) {} + +void AIScriptOfficerLeroy::ShotAtAndMissed() {} + +void AIScriptOfficerLeroy::ShotAtAndHit() { + if (Actor_Query_Goal_Number(23) == 307) { + Actor_Set_Health(23, 50, 50); + } +} + +void AIScriptOfficerLeroy::Retired(int byActorId) { + Actor_Set_Goal_Number(23, 599); + Game_Flag_Set(607); +} + +int AIScriptOfficerLeroy::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId) { + if (otherActorId) { + return 0; + } + switch (clueId) { + case 242: + return -6; + case 240: + return -2; + case 239: + return -5; + case 228: + return 2; + case 227: + return 4; + case 226: + return 4; + case 225: + return 3; + case 224: + return 3; + case 223: + return 2; + case 222: + return 3; + case 215: + return -5; + } + return 0; +} + +bool AIScriptOfficerLeroy::GoalChanged(int currentGoalNumber, int newGoalNumber) { + switch (newGoalNumber) { + case 1: + AI_Movement_Track_Flush(23); + if (Random_Query(1, 2) == 1) { + AI_Movement_Track_Append(23, 57, 7); + AI_Movement_Track_Append(23, 58, 7); + } else { + AI_Movement_Track_Append(23, 58, 7); + AI_Movement_Track_Append(23, 57, 7); + } + AI_Movement_Track_Repeat(23); + return true; + case 2: + if (Random_Query(1, 3) == 1) { + if (Random_Query(1, 2) == 1 && !Actor_Clue_Query(23, 16)) { + Actor_Clue_Acquire(23, 16, 0, -1); + } else if (!Actor_Clue_Query(23, 17)) { + Actor_Clue_Acquire(23, 17, 0, -1); + } + } + if (Game_Flag_Query(182)) { + if (Actor_Clue_Query(23, 16) && Actor_Clue_Query(23, 17)) { + Actor_Set_Goal_Number(23, 0); + } else { + Actor_Set_Goal_Number(23, 1); + } + } else { + Actor_Set_Goal_Number(23, 0); + } + return true; + case 3: + AI_Movement_Track_Flush(23); + AI_Movement_Track_Append(23, 39, Random_Query(120, 240)); + AI_Movement_Track_Append(23, 35, 0); + AI_Movement_Track_Repeat(23); + return true; + case 99: + AI_Movement_Track_Flush(23); + return false; + case 102: + AI_Movement_Track_Flush(23); + AI_Movement_Track_Append(23, 107, 0); + AI_Movement_Track_Append(23, 108, 0); + AI_Movement_Track_Repeat(23); + return true; + case 300: + Actor_Set_Goal_Number(23, 305); + return true; + case 305: + AI_Movement_Track_Flush(23); + switch (Random_Query(1, 10)) { + case 1: + AI_Movement_Track_Append(23, 398, 15); + AI_Movement_Track_Append(23, 399, 0); + AI_Movement_Track_Append(23, 400, 0); + AI_Movement_Track_Append(23, 401, 0); + AI_Movement_Track_Append_With_Facing(23, 402, 3, 276); + AI_Movement_Track_Append(23, 403, 0); + AI_Movement_Track_Append(23, 404, 15); + AI_Movement_Track_Repeat(23); + break; + case 2: + AI_Movement_Track_Append(23, 385, 10); + AI_Movement_Track_Append(23, 242, 2); + AI_Movement_Track_Append(23, 386, 2); + AI_Movement_Track_Append(23, 387, 15); + AI_Movement_Track_Repeat(23); + break; + case 3: + AI_Movement_Track_Append(23, 390, 10); + AI_Movement_Track_Append(23, 391, 0); + AI_Movement_Track_Append(23, 392, 5); + AI_Movement_Track_Append(23, 345, 0); + AI_Movement_Track_Append(23, 393, 15); + AI_Movement_Track_Repeat(23); + break; + case 4: + AI_Movement_Track_Append(23, 381, 15); + AI_Movement_Track_Append(23, 382, 0); + AI_Movement_Track_Append(23, 383, 15); + AI_Movement_Track_Append(23, 382, 3); + AI_Movement_Track_Append(23, 384, 0); + AI_Movement_Track_Append(23, 35, 30); + AI_Movement_Track_Repeat(23); + break; + case 5: + AI_Movement_Track_Append(23, 388, 10); + AI_Movement_Track_Append(23, 389, 10); + AI_Movement_Track_Append(23, 35, 30); + AI_Movement_Track_Repeat(23); + break; + case 6: + AI_Movement_Track_Append(23, 385, 10); + AI_Movement_Track_Append(23, 242, 2); + AI_Movement_Track_Append(23, 386, 2); + AI_Movement_Track_Append(23, 387, 15); + AI_Movement_Track_Repeat(23); + break; + case 7: + AI_Movement_Track_Append(23, 394, 15); + AI_Movement_Track_Append(23, 395, 0); + AI_Movement_Track_Append(23, 396, 0); + AI_Movement_Track_Append(23, 397, 15); + AI_Movement_Track_Append(23, 396, 0); + AI_Movement_Track_Append(23, 395, 0); + AI_Movement_Track_Append(23, 430, 15); + AI_Movement_Track_Append(23, 35, 30); + AI_Movement_Track_Repeat(23); + break; + case 8: + switch (Random_Query(1, 7)) { + case 1: + AI_Movement_Track_Append(23, 302, 0); + AI_Movement_Track_Append(23, 407, 0); + AI_Movement_Track_Append(23, 408, 0); + AI_Movement_Track_Append(23, 35, 30); + AI_Movement_Track_Repeat(23); + break; + case 2: + AI_Movement_Track_Append(23, 536, 0); + AI_Movement_Track_Append(23, 537, 0); + AI_Movement_Track_Append(23, 538, 1); + AI_Movement_Track_Append(23, 537, 0); + AI_Movement_Track_Append(23, 536, 0); + AI_Movement_Track_Repeat(23); + break; + case 3: + AI_Movement_Track_Append(23, 296, 10); + AI_Movement_Track_Append(23, 409, 2); + AI_Movement_Track_Append(23, 296, 10); + AI_Movement_Track_Append(23, 35, 30); + AI_Movement_Track_Repeat(23); + break; + case 4: + AI_Movement_Track_Append(23, 411, 10); + AI_Movement_Track_Append(23, 412, 5); + AI_Movement_Track_Append(23, 411, 0); + AI_Movement_Track_Append(23, 35, 30); + AI_Movement_Track_Repeat(23); + break; + case 5: + AI_Movement_Track_Append(23, 413, 10); + AI_Movement_Track_Append(23, 414, 0); + AI_Movement_Track_Append_With_Facing(23, 431, 0, 1017); + AI_Movement_Track_Append(23, 432, 10); + AI_Movement_Track_Append(23, 35, 30); + AI_Movement_Track_Repeat(23); + break; + case 6: + AI_Movement_Track_Append(23, 415, 0); + AI_Movement_Track_Append_With_Facing(23, 416, 0, 620); + AI_Movement_Track_Append(23, 417, 0); + AI_Movement_Track_Append(23, 418, 0); + AI_Movement_Track_Append(23, 35, 30); + AI_Movement_Track_Repeat(23); + break; + case 7: + AI_Movement_Track_Append(23, 405, 10); + AI_Movement_Track_Append(23, 406, 0); + AI_Movement_Track_Append(23, 35, 30); + AI_Movement_Track_Repeat(23); + return false; + default: + return false; + } + //no break + case 9: + if (Random_Query(1, 2) - 1 == 1) { + AI_Movement_Track_Append(23, 433, 10); + AI_Movement_Track_Append(23, 434, 0); + AI_Movement_Track_Append(23, 435, 0); + AI_Movement_Track_Append(23, 35, 30); + AI_Movement_Track_Repeat(23); + return false; + } + AI_Movement_Track_Append(23, 420, 10); + AI_Movement_Track_Append(23, 422, 2); + AI_Movement_Track_Append(23, 421, 1); + AI_Movement_Track_Append_With_Facing(23, 422, 4, 182); + AI_Movement_Track_Append(23, 420, 10); + AI_Movement_Track_Append(23, 35, 30); + AI_Movement_Track_Repeat(23); + //no break + case 10: + AI_Movement_Track_Append(23, 310, 0); + AI_Movement_Track_Append(23, 307, 0); + AI_Movement_Track_Append(23, 309, 0); + AI_Movement_Track_Append(23, 310, 0); + AI_Movement_Track_Append(23, 35, 30); + AI_Movement_Track_Repeat(23); + return false; + default: + return false; + } + //no break + case 306: + Actor_Set_Goal_Number(23, 305); + return true; + case 307: + AI_Movement_Track_Flush(23); + AI_Movement_Track_Append_With_Facing(23, 416, 0, 556); + Actor_Change_Animation_Mode(23, 4); + AI_Movement_Track_Repeat(23); + return true; + case 308: + AI_Movement_Track_Flush(23); + AI_Movement_Track_Append_Run_With_Facing(23, 440, 2, 355); + AI_Movement_Track_Append_Run_With_Facing(23, 441, 0, 825); + AI_Movement_Track_Repeat(23); + return true; + case 400: + AI_Movement_Track_Flush(23); + AI_Movement_Track_Append(23, 35, 0); + AI_Movement_Track_Repeat(23); + Actor_Set_Goal_Number(23, 410); + return true; + case 420: + AI_Countdown_Timer_Reset(23, 1); + AI_Countdown_Timer_Start(23, 1, 120); + Actor_Set_Goal_Number(23, 410); + return true; + case 425: + AI_Countdown_Timer_Reset(23, 1); + AI_Countdown_Timer_Start(23, 1, 60); + Actor_Set_Goal_Number(23, 410); + return true; + case 430: + Actor_Set_Goal_Number(23, 410); + Actor_Set_Goal_Number(24, 410); + return false; + default: + return false; + } +} + +bool AIScriptOfficerLeroy::UpdateAnimation(int *animation, int *frame) { + int v57; + int a1; + + switch (var_45D5B0_animation_state) { + case 32: + *animation = 603; + var_45D5B4_animation_frame++; + if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(603)) { + *animation = 589; + var_45D5B0_animation_state = 0; + var_45D5B8 = 0; + var_45D5B4_animation_frame = 0; + } + *frame = var_45D5B4_animation_frame; + return true; + case 31: + *animation = 604; + var_45D5B4_animation_frame++; + if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(604)) { + *animation = 601; + var_45D5B0_animation_state = 1; + var_45D5B4_animation_frame = 0; + } + *frame = var_45D5B4_animation_frame; + return true; + case 30: + *animation = 587; + var_45D5B4_animation_frame++; + if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(587)) { + *animation = 589; + var_45D5B0_animation_state = 0; + var_45D5B4_animation_frame = 0; + Actor_Change_Animation_Mode(23, 0); + } + *frame = var_45D5B4_animation_frame; + return true; + case 29: + *animation = 586; + var_45D5B4_animation_frame++; + if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(586)) { + *animation = 589; + var_45D5B0_animation_state = 0; + var_45D5B4_animation_frame = 0; + Actor_Change_Animation_Mode(23, 0); + } + *frame = var_45D5B4_animation_frame; + return true; + case 28: + *animation = 576; + if (var_45D5B4_animation_frame < Slice_Animation_Query_Number_Of_Frames(576) - 1) { + ++var_45D5B4_animation_frame; + } + *frame = var_45D5B4_animation_frame; + return true; + case 27: + *animation = 588; + if (var_45D5B4_animation_frame < Slice_Animation_Query_Number_Of_Frames(588) - 1) { + ++var_45D5B4_animation_frame; + } + *frame = var_45D5B4_animation_frame; + return true; + case 26: + *animation = 573; + var_45D5B4_animation_frame++; + if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(573)) { + var_45D5B0_animation_state = 21; + var_45D5B4_animation_frame = 0; + *animation = 571; + Actor_Change_Animation_Mode(23, 4); + } + *frame = var_45D5B4_animation_frame; + return true; + case 25: + *animation = 572; + var_45D5B4_animation_frame++; + if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(572)) { + var_45D5B0_animation_state = 21; + var_45D5B4_animation_frame = 0; + *animation = 571; + Actor_Change_Animation_Mode(23, 4); + } + *frame = var_45D5B4_animation_frame; + return true; + case 24: + *animation = 581; + var_45D5B4_animation_frame++; + if (var_45D5B4_animation_frame == 4) { + if (Random_Query(1, 2) == 1) { + Sound_Play_Speech_Line(23, 9010, 75, 0, 99); + } else { + Sound_Play_Speech_Line(23, 9015, 75, 0, 99); + } + } + if (var_45D5B4_animation_frame == 5) { + Actor_Combat_AI_Hit_Attempt(23); + } + if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(581)) { + var_45D5B0_animation_state = 21; + var_45D5B4_animation_frame = 0; + *animation = 571; + Actor_Change_Animation_Mode(23, 4); + } + *frame = var_45D5B4_animation_frame; + return true; + case 23: + *animation = 580; + var_45D5B4_animation_frame++; + if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(580)) { + *animation = 589; + var_45D5B0_animation_state = 0; + var_45D5B4_animation_frame = 0; + } + *frame = var_45D5B4_animation_frame; + return true; + case 22: + *animation = 579; + var_45D5B4_animation_frame++; + if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(579)) { + var_45D5B0_animation_state = 21; + var_45D5B4_animation_frame = 0; + *animation = 571; + } + *frame = var_45D5B4_animation_frame; + return true; + case 21: + *animation = 571; + var_45D5B4_animation_frame++; + if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(571)) { + var_45D5B4_animation_frame = 0; + } + *frame = var_45D5B4_animation_frame; + return true; + case 20: + *animation = 571; + var_45D5B4_animation_frame++; + if (var_45D5B4_animation_frame > Slice_Animation_Query_Number_Of_Frames(571) - 1) { + var_45D5B4_animation_frame = 0; + } + *frame = var_45D5B4_animation_frame; + return true; + case 19: + *animation = 600; + var_45D5B4_animation_frame++; + if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(600)) { + var_45D5B0_animation_state = 11; + var_45D5B4_animation_frame = 0; + *animation = 592; + } + *frame = var_45D5B4_animation_frame; + return true; + case 18: + *animation = 599; + var_45D5B4_animation_frame++; + if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(599)) { + var_45D5B0_animation_state = 11; + var_45D5B4_animation_frame = 0; + *animation = 592; + } + *frame = var_45D5B4_animation_frame; + return true; + case 17: + *animation = 598; + var_45D5B4_animation_frame++; + if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(598)) { + var_45D5B0_animation_state = 11; + var_45D5B4_animation_frame = 0; + *animation = 592; + } + *frame = var_45D5B4_animation_frame; + return true; + case 16: + *animation = 597; + var_45D5B4_animation_frame++; + if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(597)) { + var_45D5B0_animation_state = 11; + var_45D5B4_animation_frame = 0; + *animation = 592; + } + *frame = var_45D5B4_animation_frame; + return true; + case 15: + *animation = 596; + var_45D5B4_animation_frame++; + if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(596)) { + var_45D5B0_animation_state = 11; + var_45D5B4_animation_frame = 0; + *animation = 592; + } + *frame = var_45D5B4_animation_frame; + return true; + case 14: + *animation = 595; + var_45D5B4_animation_frame++; + if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(595)) { + var_45D5B0_animation_state = 11; + var_45D5B4_animation_frame = 0; + *animation = 592; + } + *frame = var_45D5B4_animation_frame; + return true; + case 13: + *animation = 594; + var_45D5B4_animation_frame++; + if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(594)) { + var_45D5B0_animation_state = 11; + var_45D5B4_animation_frame = 0; + *animation = 592; + } + *frame = var_45D5B4_animation_frame; + return true; + case 12: + *animation = 593; + var_45D5B4_animation_frame++; + if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(593)) { + var_45D5B0_animation_state = 11; + var_45D5B4_animation_frame = 0; + *animation = 592; + } + *frame = var_45D5B4_animation_frame; + return true; + case 11: + if (var_45D5BC && var_45D5B4_animation_frame <= 2) { + var_45D5BC = 0; + var_45D5B0_animation_state = 0; + var_45D5B4_animation_frame = 0; + *animation = 589; + var_45D5B8 = Random_Query(0, 1); + *frame = var_45D5B4_animation_frame; + return true; + } + + *animation = 592; + var_45D5B4_animation_frame++; + if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(592)) { + var_45D5B4_animation_frame = 0; + if (var_45D5BC) { + var_45D5BC = 0; + var_45D5B0_animation_state = 0; + var_45D5B4_animation_frame = 0; + *animation = 589; + var_45D5B8 = Random_Query(0, 1); + } else { + var_45D5B0_animation_state = Random_Query(0, 8) + 11; + } + var_45D5B4_animation_frame = 0; + } + *frame = var_45D5B4_animation_frame; + return true; + case 10: + *animation = 578; + var_45D5B4_animation_frame++; + if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(578)) { + var_45D5B4_animation_frame = 0; + } + *frame = var_45D5B4_animation_frame; + return true; + case 9: + *animation = 577; + var_45D5B4_animation_frame++; + if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(577)) { + var_45D5B4_animation_frame = 0; + } + *frame = var_45D5B4_animation_frame; + return true; + case 8: + *animation = 575; + var_45D5B4_animation_frame++; + if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(575)) { + var_45D5B4_animation_frame = 0; + } + *frame = var_45D5B4_animation_frame; + return true; + case 7: + *animation = 574; + var_45D5B4_animation_frame++; + if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(574)) { + var_45D5B4_animation_frame = 0; + } + *frame = var_45D5B4_animation_frame; + return true; + case 6: + *animation = 585; + var_45D5B4_animation_frame++; + if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(585)) { + var_45D5B4_animation_frame = 0; + } + *frame = var_45D5B4_animation_frame; + return true; + case 5: + *animation = 584; + var_45D5B4_animation_frame++; + if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(584)) { + var_45D5B4_animation_frame = 0; + } + *frame = var_45D5B4_animation_frame; + return true; + case 4: + *animation = 583; + var_45D5B4_animation_frame++; + if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(583)) { + var_45D5B4_animation_frame = 0; + } + *frame = var_45D5B4_animation_frame; + return true; + case 3: + *animation = 582; + var_45D5B4_animation_frame++; + if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(582)) { + var_45D5B4_animation_frame = 0; + } + *frame = var_45D5B4_animation_frame; + return true; + case 2: + if (Game_Flag_Query(199)) { + *animation = 603; + var_45D5B4_animation_frame++; + if (var_45D5B4_animation_frame > Slice_Animation_Query_Number_Of_Frames(603) - 1) { + Game_Flag_Reset(199); + var_45D5B4_animation_frame = 0; + var_45D5B0_animation_state = var_462880; + *animation = var_462884; + } + } else { + if (var_45D5B8 == 0) { + *animation = 589; + } + if (var_45D5B8 == 1) { + *animation = 590; + } + if (var_45D5B8 == 2) { + *animation = 591; + } + if (var_45D5B4_animation_frame > Slice_Animation_Query_Number_Of_Frames(*animation) / 2) { + a1 = *animation; + var_45D5B4_animation_frame += 3; + v57 = var_45D5B4_animation_frame; + if (v57 > Slice_Animation_Query_Number_Of_Frames(a1) - 1) { + var_45D5B4_animation_frame = 0; + var_45D5B0_animation_state = var_462880; + *animation = var_462884; + } + } else { + var_45D5B4_animation_frame -= 3; + if (var_45D5B4_animation_frame < 0) { + var_45D5B4_animation_frame = 0; + var_45D5B0_animation_state = var_462880; + *animation = var_462884; + } + } + } + *frame = var_45D5B4_animation_frame; + return true; + case 1: + *animation = 601; + var_45D5B4_animation_frame++; + if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(601)) { + var_45D5B4_animation_frame = 0; + } + if (!Game_Flag_Query(199)) { + var_45D5B0_animation_state = 32; + var_45D5B4_animation_frame = 0; + *animation = 603; + } + *frame = var_45D5B4_animation_frame; + return true; + case 0: + if (Game_Flag_Query(199) && !Game_Flag_Query(392)) { + var_45D5B0_animation_state = 31; + var_45D5B4_animation_frame = 0; + *animation = 604; + } else if (var_45D5B8 == 1) { + *animation = 590; + var_45D5B4_animation_frame++; + if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(590)) { + var_45D5B8 = Random_Query(0, 2); + var_45D5B4_animation_frame = 0; + } + } else if (var_45D5B8 == 2) { + *animation = 591; + var_45D5B4_animation_frame++; + if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(591)) { + var_45D5B8 = Random_Query(0, 2); + var_45D5B4_animation_frame = 0; + } + } else if (var_45D5B8 == 0) { + *animation = 589; + var_45D5B4_animation_frame++; + if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(589)) { + var_45D5B8 = Random_Query(0, 2); + var_45D5B4_animation_frame = 0; + } + } + *frame = var_45D5B4_animation_frame; + return true; + default: + *animation = 399; + *frame = var_45D5B4_animation_frame; + return true; + } +} + +bool AIScriptOfficerLeroy::ChangeAnimationMode(int mode) { + int v1; + + switch (mode) { + case 28: + Game_Flag_Set(199); + break; + case 27: + Game_Flag_Reset(199); + break; + case 22: + if (Random_Query(0, 1)) { + var_45D5B0_animation_state = 25; + } else { + var_45D5B0_animation_state = 26; + } + var_45D5B4_animation_frame = 0; + break; + case 21: + if (var_45D5B0_animation_state == 21 || var_45D5B0_animation_state == 24) { + if (Random_Query(0, 1)) { + var_45D5B0_animation_state = 25; + } else { + var_45D5B0_animation_state = 26; + } + var_45D5B4_animation_frame = 0; + } else { + if (Random_Query(0, 1)) { + var_45D5B0_animation_state = 29; + } else { + var_45D5B0_animation_state = 30; + } + var_45D5B4_animation_frame = 0; + } + break; + case 19: + if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) { + var_45D5B0_animation_state = 2; + var_462880 = 19; + var_462884 = 600; + if (Game_Flag_Query(199) == 1) { + var_45D5B4_animation_frame = 0; + } + } else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) { + var_45D5B0_animation_state = 19; + var_45D5B4_animation_frame = 0; + var_45D5BC = 0; + } + break; + case 18: + if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) { + var_45D5B0_animation_state = 2; + var_462880 = 18; + var_462884 = 599; + if (Game_Flag_Query(199) == 1) { + var_45D5B4_animation_frame = 0; + } + } else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) { + var_45D5B0_animation_state = 18; + var_45D5B4_animation_frame = 0; + var_45D5BC = 0; + } + break; + case 17: + if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) { + var_45D5B0_animation_state = 2; + var_462880 = 17; + var_462884 = 598; + if (Game_Flag_Query(199) == 1) { + var_45D5B4_animation_frame = 0; + } + } else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) { + var_45D5B0_animation_state = 17; + var_45D5B4_animation_frame = 0; + var_45D5BC = 0; + } + break; + case 16: + if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) { + var_45D5B0_animation_state = 2; + var_462880 = 16; + var_462884 = 597; + if (Game_Flag_Query(199) == 1) { + var_45D5B4_animation_frame = 0; + } + } else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) { + var_45D5B0_animation_state = 16; + var_45D5B4_animation_frame = 0; + var_45D5BC = 0; + } + break; + case 15: + if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) { + var_45D5B0_animation_state = 2; + var_462880 = 15; + var_462884 = 596; + if (Game_Flag_Query(199) == 1) { + var_45D5B4_animation_frame = 0; + } + } else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) { + var_45D5B0_animation_state = 15; + var_45D5B4_animation_frame = 0; + var_45D5BC = 0; + } + break; + case 14: + if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) { + var_45D5B0_animation_state = 2; + var_462880 = 14; + var_462884 = 595; + if (Game_Flag_Query(199) == 1) { + var_45D5B4_animation_frame = 0; + } + } else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) { + var_45D5B0_animation_state = 14; + var_45D5B4_animation_frame = 0; + var_45D5BC = 0; + } + break; + case 13: + if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) { + var_45D5B0_animation_state = 2; + var_462880 = 13; + var_462884 = 594; + if (Game_Flag_Query(199) == 1) { + var_45D5B4_animation_frame = 0; + } + } else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) { + var_45D5B0_animation_state = 13; + var_45D5B4_animation_frame = 0; + var_45D5BC = 0; + } + break; + case 12: + if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) { + var_45D5B0_animation_state = 2; + var_462880 = 12; + var_462884 = 593; + if (Game_Flag_Query(199) == 1) { + var_45D5B4_animation_frame = 0; + } + } else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) { + var_45D5B0_animation_state = 12; + var_45D5B4_animation_frame = 0; + var_45D5BC = 0; + } + break; + case 8: + var_45D5B0_animation_state = 8; + var_45D5B4_animation_frame = 0; + break; + case 7: + var_45D5B0_animation_state = 7; + var_45D5B4_animation_frame = 0; + break; + case 6: + var_45D5B0_animation_state = 24; + var_45D5B4_animation_frame = 0; + break; + case 4: + switch (var_45D5B0_animation_state) { + case 21: + case 22: + case 24: + return true; + case 7: + case 8: + case 9: + case 10: + var_45D5B0_animation_state = 21; + var_45D5B4_animation_frame = 0; + break; + case 0: + var_45D5B0_animation_state = 22; + var_45D5B4_animation_frame = 0; + break; + default: + var_45D5B0_animation_state = 21; + var_45D5B4_animation_frame = 0; + break; + } + break; + case 3: + if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) { + var_45D5B0_animation_state = 2; + var_462880 = 11; + var_462884 = 592; + if (Game_Flag_Query(199) == 1) { + var_45D5B4_animation_frame = 0; + } + } else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) { + var_45D5B0_animation_state = 11; + var_45D5B4_animation_frame = 0; + var_45D5BC = 0; + } + break; + case 2: + var_45D5B0_animation_state = 4; + var_45D5B4_animation_frame = 0; + break; + case 1: + var_45D5B0_animation_state = 3; + var_45D5B4_animation_frame = 0; + break; + case 0: + switch (var_45D5B0_animation_state) { + case 21: + case 24: + var_45D5B0_animation_state = 23; + var_45D5B4_animation_frame = 0; + break; + case 20: + v1 = var_45D5B4_animation_frame; + Actor_Change_Animation_Mode(23, 4); + var_45D5B4_animation_frame = v1; + var_45D5B0_animation_state = 21; + break; + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + var_45D5BC = 1; + break; + case 0: + case 23: + return true; + default: + var_45D5B0_animation_state = 0; + var_45D5B4_animation_frame = 0; + var_45D5B8 = Random_Query(0, 1); + break; + } + break; + case 5: + case 9: + case 10: + case 11: + case 20: + case 23: + case 24: + case 25: + case 26: + return true; + default: + switch (mode) { + case 58: + var_45D5B0_animation_state = 20; + var_45D5B4_animation_frame = 0; + break; + case 48: + if (var_45D5B0_animation_state == 21 || var_45D5B0_animation_state == 22 || var_45D5B0_animation_state == 24) { + var_45D5B0_animation_state = 28; + var_45D5B4_animation_frame = 0; + } else { + var_45D5B0_animation_state = 27; + var_45D5B4_animation_frame = 0; + } + break; + case 47: + var_45D5B0_animation_state = 10; + var_45D5B4_animation_frame = 0; + break; + case 46: + var_45D5B0_animation_state = 9; + var_45D5B4_animation_frame = 0; + break; + case 45: + var_45D5B0_animation_state = 6; + var_45D5B4_animation_frame = 0; + break; + case 44: + var_45D5B0_animation_state = 5; + var_45D5B4_animation_frame = 0; + break; + default: + return true; + } + break; + } + return true; +} + +void AIScriptOfficerLeroy::QueryAnimationState(int *animationState, int *animationFrame, int *a3, int *a4) { + *animationState = var_45D5B0_animation_state; + *animationFrame = var_45D5B4_animation_frame; + *a3 = var_462880; + *a4 = var_462884; +} + +void AIScriptOfficerLeroy::SetAnimationState(int animationState, int animationFrame, int a3, int a4) { + var_45D5B0_animation_state = animationState; + var_45D5B4_animation_frame = animationFrame; + var_462880 = a3; + var_462884 = a4; +} + +bool AIScriptOfficerLeroy::ReachedMovementTrackWaypoint(int waypointId) { + if (waypointId == 57 || waypointId == 58) { + sub_431408(); + AI_Countdown_Timer_Reset(23, 2); + AI_Countdown_Timer_Start(23, 2, 6); + } + return true; +} + +void AIScriptOfficerLeroy::FledCombat() { + Actor_Set_Goal_Number(23, 300); +} + +bool AIScriptOfficerLeroy::sub_431408() { + Game_Flag_Set(199); + return true; +} + +bool AIScriptOfficerLeroy::sub_431420() { + Game_Flag_Reset(199); + return true; +} +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ai/runciter.cpp b/engines/bladerunner/script/ai/runciter.cpp new file mode 100644 index 0000000000..998f385a4f --- /dev/null +++ b/engines/bladerunner/script/ai/runciter.cpp @@ -0,0 +1,653 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/ai.h" + +namespace BladeRunner { + +void AIScriptRunciter::Initialize() { + var_45CD70_animation_state = 0; + var_45CD74_animation_frame = 0; + var_462800 = 0; + var_45CD78 = 0; + var_45CD7C = 6; + var_45CD80 = 1; + var_45CD84 = 0; + var_45CD88 = 0; + Actor_Set_Goal_Number(15, 0); +} + +bool AIScriptRunciter::Update() { + if (Actor_Query_Goal_Number(15) == 0 && Game_Flag_Query(186)) { + Actor_Set_Goal_Number(15, 2); + } + if (Global_Variable_Query(1) == 4 && Actor_Query_Goal_Number(15) < 300) { + Actor_Set_Goal_Number(15, 300); + } + return false; +} + +void AIScriptRunciter::TimerExpired(int timer) {} + +void AIScriptRunciter::CompletedMovementTrack() { + if (Actor_Query_Goal_Number(15) == 1) { + if (Player_Query_Current_Scene() == 79) { + switch (Random_Query(1, 5)) { + case 2: + case 3: + ADQ_Add(15, 530, -1); + break; + case 1: + case 5: + ADQ_Add(15, 80, -1); + break; + case 4: + ADQ_Add(15, 930, -1); + break; + } + } + Actor_Set_Goal_Number(15, 99); + Actor_Set_Goal_Number(15, 1); + //return true; + } + //return false; +} + +void AIScriptRunciter::ReceivedClue(int clueId, int fromActorId) {} + +void AIScriptRunciter::ClickedByPlayer() {} + +void AIScriptRunciter::EnteredScene(int sceneId) {} + +void AIScriptRunciter::OtherAgentEnteredThisScene(int otherActorId) {} + +void AIScriptRunciter::OtherAgentExitedThisScene(int otherActorId) {} + +void AIScriptRunciter::OtherAgentEnteredCombatMode(int otherActorId, int combatMode) { + if (Actor_Query_Goal_Number(15) == 300 && combatMode == 1 && !Game_Flag_Query(705)) { + Actor_Set_Targetable(15, true); + Actor_Face_Actor(15, 0, true); + Actor_Says(15, 420, 12); + Actor_Face_Actor(0, 15, true); + Actor_Change_Animation_Mode(0, 5); + if (Actor_Clue_Query(0, 158)) { + Actor_Says(0, 4770, -1); + Actor_Says(15, 590, 13); + Actor_Says(0, 4775, -1); + Actor_Says(15, 600, 17); + Sound_Play(492, 100, 0, 100, 50); + Actor_Says(0, 4780, -1); + Actor_Says(15, 610, 18); + Actor_Says(0, 4785, -1); + Actor_Says(15, 620, 15); + if (Game_Flag_Query(46)) { + Actor_Says(15, 630, 12); + Actor_Says(15, 640, 17); + Actor_Says(0, 4790, -1); + Actor_Says(15, 650, 18); + Actor_Says(15, 660, 19); + Actor_Clue_Acquire(0, 280, 1, 15); + } else { + Actor_Says(15, 670, 18); + Actor_Says(0, 4795, -1); + Actor_Says(15, 730, 17); + } + } else if (Actor_Clue_Query(0, 76)) { + Actor_Says(0, 4730, -1); + Actor_Says(15, 480, 17); + Actor_Says(0, 4735, -1); + Actor_Says(15, 490, 16); + Sound_Play(492, 100, 0, 100, 50); + Actor_Says(0, 4740, -1); + Actor_Says(15, 500, 18); + Actor_Says(15, 510, 19); + Actor_Says(0, 4745, -1); + Actor_Says(0, 4750, -1); + Actor_Says(15, 520, 17); + Actor_Says(15, 530, 18); + Actor_Says(15, 540, 16); + } + Game_Flag_Set(705); + } +} + +void AIScriptRunciter::ShotAtAndMissed() {} + +void AIScriptRunciter::ShotAtAndHit() { + Actor_Set_Targetable(15, false); + Actor_Change_Animation_Mode(15, 48); + Actor_Set_Goal_Number(15, 599); + Delay(2000); + if (Actor_Clue_Query(0, 158)) { + Actor_Voice_Over(2050, 99); + Actor_Voice_Over(2060, 99); + } else { + Actor_Voice_Over(2070, 99); + Actor_Voice_Over(2080, 99); + Actor_Voice_Over(2090, 99); + } + Actor_Modify_Friendliness_To_Other(5, 0, 3); +} + +void AIScriptRunciter::Retired(int byActorId) {} + +int AIScriptRunciter::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId) { + return 0; +} + +bool AIScriptRunciter::GoalChanged(int currentGoalNumber, int newGoalNumber) { + if (newGoalNumber == 0) { + Actor_Put_In_Set(15, 16); + Actor_Set_At_Waypoint(15, 92, 567); + return false; + } + if (newGoalNumber == 1) { + AI_Movement_Track_Flush(15); + if (Random_Query(0, 1) == 1) { + if (Random_Query(0, 1) == 0) { + AI_Movement_Track_Append_With_Facing(15, 89, Random_Query(6, 10), 567); + } + AI_Movement_Track_Append_With_Facing(15, 93, Random_Query(2, 6), 1002); + AI_Movement_Track_Append(15, 92, 5); + } else { + AI_Movement_Track_Append_With_Facing(15, 91, Random_Query(3, 10), 120); + if (Random_Query(1, 3) == 1) { + AI_Movement_Track_Append_With_Facing(15, 93, Random_Query(2, 6), 1002); + } + AI_Movement_Track_Append_With_Facing(15, 90, Random_Query(5, 10), 170); + } + AI_Movement_Track_Repeat(15); + return true; + } + if (newGoalNumber == 2) { + AI_Movement_Track_Flush(15); + AI_Movement_Track_Append(15, 39, 120); + AI_Movement_Track_Append(15, 40, 0); + AI_Movement_Track_Repeat(15); + return false; + } + if (newGoalNumber == 300) { + Actor_Put_In_Set(15, 16); + Actor_Set_At_Waypoint(15, 93, 1007); + return false; + } + return false; +} + +bool AIScriptRunciter::UpdateAnimation(int *animation, int *frame) { + + switch (var_45CD70_animation_state) { + case 15: + *animation = 528; + var_45CD74_animation_frame = Slice_Animation_Query_Number_Of_Frames(528) - 1; + *frame = var_45CD74_animation_frame; + break; + case 14: + *animation = 528; + var_45CD74_animation_frame++; + if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(528) - 1) { + *animation = 528; + var_45CD70_animation_state = 15; + } + *frame = var_45CD74_animation_frame; + break; + case 13: + if (var_45CD78 == 0) { + var_45CD74_animation_frame = 0; + var_45CD70_animation_state = var_462800; + *animation = var_462804; + } else if (var_45CD78 == 1) { + *animation = 530; + var_45CD74_animation_frame += 3; + if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(530)) { + var_45CD74_animation_frame = 0; + var_45CD70_animation_state = var_462800; + *animation = var_462804; + } + } else if (var_45CD78 == 2) { + *animation = 531; + var_45CD74_animation_frame -= 3; + if (var_45CD74_animation_frame - 3 < 0) { + var_45CD74_animation_frame = 0; + var_45CD70_animation_state = var_462800; + *animation = var_462804; + } + } + *frame = var_45CD74_animation_frame; + break; + case 12: + *animation = 532; + var_45CD74_animation_frame++; + if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(532)) { + *animation = 529; + var_45CD70_animation_state = 0; + var_45CD74_animation_frame = 0; + var_45CD78 = 0; + Actor_Change_Animation_Mode(15, 0); + } + *frame = var_45CD74_animation_frame; + break; + case 11: + *animation = 541; + if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(541)) { + var_45CD74_animation_frame = 0; + if (var_45CD88) { + *animation = 529; + var_45CD70_animation_state = 0; + var_45CD78 = 0; + } else { + *animation = 533; + var_45CD70_animation_state = 2; + } + } + *frame = var_45CD74_animation_frame; + break; + case 10: + *animation = 540; + var_45CD74_animation_frame++; + if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(540)) { + var_45CD74_animation_frame = 0; + if (var_45CD88) { + *animation = 529; + var_45CD70_animation_state = 0; + var_45CD78 = 0; + } else { + *animation = 533; + var_45CD70_animation_state = 2; + } + } + *frame = var_45CD74_animation_frame; + break; + case 9: + *animation = 539; + var_45CD74_animation_frame++; + if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(539)) { + var_45CD74_animation_frame = 0; + if (var_45CD88) { + *animation = 529; + var_45CD70_animation_state = 0; + var_45CD78 = 0; + } else { + *animation = 533; + var_45CD70_animation_state = 2; + } + } + *frame = var_45CD74_animation_frame; + break; + case 8: + *animation = 538; + var_45CD74_animation_frame++; + if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(538)) { + var_45CD74_animation_frame = 0; + if (var_45CD88) { + *animation = 529; + var_45CD70_animation_state = 0; + var_45CD78 = 0; + } else { + *animation = 533; + var_45CD70_animation_state = 2; + } + } + *frame = var_45CD74_animation_frame; + break; + case 7: + *animation = 537; + var_45CD74_animation_frame++; + if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(537)) { + var_45CD74_animation_frame = 0; + if (var_45CD88) { + *animation = 529; + var_45CD70_animation_state = 0; + var_45CD78 = 0; + } else { + *animation = 533; + var_45CD70_animation_state = 2; + } + } + *frame = var_45CD74_animation_frame; + break; + case 6: + *animation = 536; + var_45CD74_animation_frame++; + if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(536)) { + var_45CD74_animation_frame = 0; + if (var_45CD88) { + *animation = 529; + var_45CD70_animation_state = 0; + var_45CD78 = 0; + } else { + *animation = 533; + var_45CD70_animation_state = 2; + } + } + *frame = var_45CD74_animation_frame; + break; + case 5: + *animation = 535; + var_45CD74_animation_frame++; + if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(535)) { + var_45CD74_animation_frame = 0; + if (var_45CD88) { + *animation = 529; + var_45CD70_animation_state = 0; + var_45CD78 = 0; + } else { + *animation = 533; + var_45CD70_animation_state = 2; + } + } + *frame = var_45CD74_animation_frame; + break; + case 4: + *animation = 534; + var_45CD74_animation_frame++; + if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(534)) { + var_45CD74_animation_frame = 0; + if (var_45CD88) { + *animation = 529; + var_45CD70_animation_state = 0; + var_45CD78 = 0; + } else { + *animation = 533; + var_45CD70_animation_state = 2; + } + } + *frame = var_45CD74_animation_frame; + break; + case 2: + *animation = 533; + var_45CD74_animation_frame++; + if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(533)) { + var_45CD74_animation_frame = 0; + if (var_45CD88) { + *animation = 529; + var_45CD70_animation_state = 0; + var_45CD78 = 0; + } else { + var_45CD70_animation_state = 4; + } + } + *frame = var_45CD74_animation_frame; + break; + case 1: + *animation = 526; + var_45CD74_animation_frame++; + if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(526)) { + var_45CD74_animation_frame = 0; + } + *frame = var_45CD74_animation_frame; + break; + case 0: + if (var_45CD78 == 0) { + *animation = 529; + if (var_45CD84) { + var_45CD84--; + } else { + var_45CD74_animation_frame += var_45CD80; + if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(529)) { + var_45CD74_animation_frame = 0; + } + if (var_45CD74_animation_frame < 0) { + var_45CD74_animation_frame = Slice_Animation_Query_Number_Of_Frames(529) - 1; + } + --var_45CD7C; + if (var_45CD7C == 0) { + var_45CD80 = 2 * Random_Query(0, 1) - 1; + var_45CD7C = Random_Query(6, 14); + var_45CD84 = Random_Query(0, 4); + } + if (var_45CD74_animation_frame == 0) { + if (Random_Query(0, 1) == 1) { + var_45CD78 = Random_Query(1, 2); + var_45CD80 = 1; + var_45CD84 = 0; + } + } + } + } else if (var_45CD78 == 1) { + *animation = 530; + var_45CD74_animation_frame++; + if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(530)) { + var_45CD74_animation_frame = 0; + var_45CD78 = 0; + *animation = 529; + var_45CD7C = Random_Query(6, 14); + var_45CD80 = 2 * Random_Query(0, 1) - 1; + } + } else if (var_45CD78 == 2) { + *animation = 531; + if (var_45CD84) { + var_45CD84--; + } else { + var_45CD74_animation_frame += var_45CD80; + if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(*animation) - 1) { + var_45CD84 = Random_Query(5, 15); + var_45CD80 = -1; + } + if (var_45CD74_animation_frame <= 0) { + var_45CD74_animation_frame = 0; + var_45CD78 = 0; + *animation = 529; + var_45CD7C = Random_Query(6, 14); + var_45CD80 = 2 * Random_Query(0, 1) - 1; + } + } + } + *frame = var_45CD74_animation_frame; + break; + default: + *animation = 399; + var_45CD74_animation_frame = 0; + *frame = var_45CD74_animation_frame; + break; + } + return true; +} + +bool AIScriptRunciter::ChangeAnimationMode(int mode) { + + switch (mode) { + case 23: + var_45CD70_animation_state = 12; + var_45CD74_animation_frame = 0; + break; + case 19: + if (var_45CD70_animation_state) { + var_45CD70_animation_state = 2; + var_45CD74_animation_frame = 0; + } else { + var_45CD70_animation_state = 13; + var_462800 = 11; + var_462804 = 541; + } + var_45CD88 = 0; + break; + case 18: + if (var_45CD70_animation_state) { + var_45CD70_animation_state = 2; + var_45CD74_animation_frame = 0; + } else { + var_45CD70_animation_state = 13; + var_462800 = 10; + var_462804 = 540; + } + var_45CD88 = 0; + break; + case 17: + if (var_45CD70_animation_state) { + var_45CD70_animation_state = 2; + var_45CD74_animation_frame = 0; + } else { + var_45CD70_animation_state = 13; + var_462800 = 9; + var_462804 = 539; + } + var_45CD88 = 0; + break; + case 16: + if (var_45CD70_animation_state) { + var_45CD70_animation_state = 2; + var_45CD74_animation_frame = 0; + } else { + var_45CD70_animation_state = 13; + var_462800 = 8; + var_462804 = 538; + } + var_45CD88 = 0; + break; + case 15: + if (var_45CD70_animation_state) { + var_45CD70_animation_state = 2; + var_45CD74_animation_frame = 0; + } else { + var_45CD70_animation_state = 13; + var_462800 = 7; + var_462804 = 537; + } + var_45CD88 = 0; + break; + case 14: + if (var_45CD70_animation_state) { + var_45CD70_animation_state = 2; + var_45CD74_animation_frame = 0; + } else { + var_45CD70_animation_state = 13; + var_462800 = 6; + var_462804 = 536; + } + var_45CD88 = 0; + break; + case 13: + if (var_45CD70_animation_state) { + var_45CD70_animation_state = 2; + var_45CD74_animation_frame = 0; + } else { + var_45CD70_animation_state = 13; + var_462800 = 5; + var_462804 = 535; + } + var_45CD88 = 0; + break; + case 12: + if (var_45CD70_animation_state) { + var_45CD70_animation_state = 2; + var_45CD74_animation_frame = 0; + } else { + var_45CD70_animation_state = 13; + var_462800 = 4; + var_462804 = 534; + } + var_45CD88 = 0; + break; + case 3: + if (var_45CD70_animation_state) { + var_45CD70_animation_state = 2; + var_45CD74_animation_frame = 0; + } else { + var_45CD70_animation_state = 13; + var_462800 = 2; + var_462804 = 526; + } + var_45CD88 = 0; + break; + case 1: + if (var_45CD70_animation_state > 1) { + var_45CD70_animation_state = 1; + var_45CD74_animation_frame = 0; + } else if (!var_45CD70_animation_state) { + var_45CD70_animation_state = 13; + var_462800 = 1; + var_462804 = 526; + } + break; + case 0: + if (var_45CD70_animation_state >= 2 && var_45CD70_animation_state <= 11) { + var_45CD88 = 1; + } else { + var_45CD70_animation_state = 0; + var_45CD74_animation_frame = 0; + var_45CD78 = 0; + } + break; + case 2: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 20: + case 21: + case 22: + break; + default: + if (mode == 48) { + var_45CD70_animation_state = 14; + var_45CD74_animation_frame = 0; + } + break; + } + return true; +} + +void AIScriptRunciter::QueryAnimationState(int *animationState, int *animationFrame, int *a3, int *a4) { + *animationState = var_45CD70_animation_state; + *animationFrame = var_45CD74_animation_frame; + *a3 = var_462800; + *a4 = var_462804; +} + +void AIScriptRunciter::SetAnimationState(int animationState, int animationFrame, int a3, int a4) { + var_45CD70_animation_state = animationState; + var_45CD74_animation_frame = animationFrame; + var_462800 = a3; + var_462804 = a4; +} + +bool AIScriptRunciter::ReachedMovementTrackWaypoint(int waypointId) { + switch (waypointId) { + case 93: + Actor_Face_Heading(15, 1002, true); + break; + case 92: + Actor_Face_Heading(15, 664, true); + break; + case 91: + Actor_Face_Heading(15, 120, true); + break; + case 90: + Actor_Face_Heading(15, 170, true); + break; + case 89: + Actor_Face_Heading(15, 567, true); + break; + default: + return true; + } + return true; +} + +void AIScriptRunciter::FledCombat() {} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ai_00_mccoy.cpp b/engines/bladerunner/script/ai_00_mccoy.cpp deleted file mode 100644 index 70f127213f..0000000000 --- a/engines/bladerunner/script/ai_00_mccoy.cpp +++ /dev/null @@ -1,1855 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/ai_00_mccoy.h" - -namespace BladeRunner { - -AIScript_McCoy::AIScript_McCoy(BladeRunnerEngine *vm) - : AIScriptBase(vm) { -} - -void AIScript_McCoy::Initialize() { - dword_45A0D0_animation_state = 0; - dword_45A0D4_animation_frame = 0; - dword_45A0D8 = 0; - dword_45A0DC = 30; - dword_45A0E0 = 1; - dword_45A0E4 = 0; - off_45A0EC = 0; - dword_45A0E8 = 3; - dword_45A0F0 = 3; - dword_45A0F4 = 20; - dword_45A0F8 = -1; - dword_45A0FC = 0; - off_45A100 = 0; - Actor_Set_Goal_Number(0, 0); -} - -bool AIScript_McCoy::Update() { - if (dword_45A0F8 != -1) { - Sound_Play(dword_45A0F8, 100, 0, 0, 50); - dword_45A0F8 = -1; - } - switch (Actor_Query_Goal_Number(0)) { - case 101: - Actor_Set_Goal_Number(0, 102); - return true; - case 102: - if (Actor_Query_Inch_Distance_From_Waypoint(0, 316) < 36 && !Game_Flag_Query(375)) { - Actor_Change_Animation_Mode(0, 21); - Game_Flag_Set(375); - } - if (Actor_Query_Inch_Distance_From_Waypoint(0, 316) < 4) { - Actor_Set_Goal_Number(0, 103); - } - return true; - case 201: - Actor_Set_Goal_Number(0, 0); - if (Player_Query_Current_Set() == 55) { - Loop_Actor_Walk_To_XYZ(0, -166.0f, -70.19f, -501.0f, 0, 0, false, 0); - Actor_Face_Heading(0, 300, false); - } else { - Loop_Actor_Walk_To_XYZ(0, -461.0f, 0.0f, -373.0f, 0, 0, false, 0); - } - Player_Gains_Control(); - return true; - case 212: - if (Global_Variable_Query(47) >= 13) { - Global_Variable_Set(47, 500); - } else if (Global_Variable_Query(47) > 0) { - Global_Variable_Decrement(47, 1); - } - break; - case 221: - Actor_Set_Goal_Number(0, 0); - Actor_Set_Goal_Number(18, 212); - return true; - case 309: - sub_4053E0(); - break; - case 391: - Actor_Retired_Here(0, 12, 48, 1, -1); - Actor_Set_Goal_Number(0, 599); - break; - case 231: - sub_4053E0(); - break; - } - return false; -} - -void AIScript_McCoy::TimerExpired(int timer) { -} - -void AIScript_McCoy::CompletedMovementTrack() { -} - -void AIScript_McCoy::ReceivedClue(int clueId, int fromActorId) { - switch (clueId) { - case 8: - case 9: - Spinner_Set_Selectable_Destination_Flag(3, 1); - break; - case 44: - case 47: - Spinner_Set_Selectable_Destination_Flag(4, 1); - break; - case 53: - case 263: - if (Query_Difficulty_Level() == 0) { - Spinner_Set_Selectable_Destination_Flag(4, 1); - } - break; - case 90: - Spinner_Set_Selectable_Destination_Flag(8, 1); - break; - case 84: - case 113: - case 114: - case 115: - case 118: - Spinner_Set_Selectable_Destination_Flag(9, 1); - Spinner_Set_Selectable_Destination_Flag(8, 1); - break; - case 66: - case 80: - case 82: - case 83: - Global_Variable_Increment(49, 1); - break; - case 125: - Global_Variable_Increment(49, 5); - break; - case 124: - case 128: - Global_Variable_Increment(49, 3); - break; - case 120: - case 121: - Global_Variable_Increment(49, 2); - break; - case 147: - case 148: - case 149: - case 150: - case 151: - case 152: - Global_Variable_Increment(48, 1); - break; - } - if (Global_Variable_Query(49) > 6 && Global_Variable_Query(1) > 3 && !Actor_Clue_Query(0, 126)) { - Delay(500); - Actor_Voice_Over(3320, 99); - switch (clueId) { - case 66: - case 80: - case 82: - case 83: - case 121: - case 128: - Actor_Voice_Over(3340, 99); - Actor_Voice_Over(3350, 99); - Actor_Voice_Over(3360, 99); - Actor_Voice_Over(3370, 99); - Actor_Voice_Over(3380, 99); - break; - case 124: - Actor_Voice_Over(3330, 99); - break; - case 120: - Actor_Voice_Over(3390, 99); - Actor_Voice_Over(3400, 99); - Actor_Voice_Over(3420, 99); - break; - } - Actor_Clue_Acquire(0, 126, 1, -1); - if (clueId == 125) { - Actor_Voice_Over(2780, 99); - Actor_Voice_Over(2800, 99); - Actor_Voice_Over(2810, 99); - } else if (Actor_Clue_Query(0, 125)) { - Actor_Voice_Over(3430, 99); - Actor_Voice_Over(3440, 99); - Actor_Voice_Over(3450, 99); - Actor_Voice_Over(3460, 99); - Actor_Voice_Over(3470, 99); - Actor_Voice_Over(3480, 99); - Actor_Voice_Over(3490, 99); - Actor_Voice_Over(3500, 99); - } else { - Actor_Voice_Over(3510, 99); - Actor_Voice_Over(3520, 99); - Actor_Voice_Over(3530, 99); - Actor_Voice_Over(3540, 99); - } - } -} - -void AIScript_McCoy::ClickedByPlayer() { -} - -void AIScript_McCoy::EnteredScene(int sceneId) { -} - -void AIScript_McCoy::OtherAgentEnteredThisScene(int otherActorId) { -} - -void AIScript_McCoy::OtherAgentExitedThisScene(int otherActorId) { -} - -void AIScript_McCoy::OtherAgentEnteredCombatMode(int otherActorId, int combatMode) { -} - -void AIScript_McCoy::ShotAtAndMissed() { -} - -void AIScript_McCoy::ShotAtAndHit() { -} - -void AIScript_McCoy::Retired(int byActorId) { - if (byActorId == 1 && Actor_Query_In_Set(1, 42)) { - if (Actor_Query_In_Set(3, 42) && Actor_Query_Goal_Number(3) != 599) { - Non_Player_Actor_Combat_Mode_On(1, 3, 1, 3, 15, 4, 7, 8, 0, 0, 100, 25, 300, 0); - } else if (Actor_Query_In_Set(6, 42) && Actor_Query_Goal_Number(6) != 599) { - Non_Player_Actor_Combat_Mode_On(1, 3, 1, 6, 15, 4, 7, 8, 0, 0, 100, 25, 300, 0); - } - } - if (Actor_Query_In_Set(0, 41) && Actor_Query_In_Set(23, 41) && Actor_Query_In_Set(3, 41) && Actor_Query_Goal_Number(3) != 599) { - Non_Player_Actor_Combat_Mode_On(23, 3, 1, 3, 4, 4, 7, 8, 0, 0, 100, 25, 300, 0); - } - if (Actor_Query_In_Set(0, 41) && Actor_Query_In_Set(24, 41) && Actor_Query_In_Set(3, 41) && Actor_Query_Goal_Number(3) != 599) { - Non_Player_Actor_Combat_Mode_On(24, 3, 1, 3, 4, 4, 7, 8, 0, 0, 100, 25, 300, 0); - } - if (Actor_Query_In_Set(0, 41) && Actor_Query_In_Set(23, 41) && Actor_Query_In_Set(6, 41) && Actor_Query_Goal_Number(6) != 599) { - Non_Player_Actor_Combat_Mode_On(23, 3, 1, 6, 4, 4, 7, 8, 0, 0, 100, 25, 300, 0); - } - if (Actor_Query_In_Set(0, 41) && Actor_Query_In_Set(24, 41) && Actor_Query_In_Set(6, 41) && Actor_Query_Goal_Number(6) != 599) { - Non_Player_Actor_Combat_Mode_On(24, 3, 1, 6, 4, 4, 7, 8, 0, 0, 100, 25, 300, 0); - } -} - -int AIScript_McCoy::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId) { - return 0; -} - -bool AIScript_McCoy::GoalChanged(int currentGoalNumber, int newGoalNumber) { - unsigned int v5; - unsigned int v7; - - switch (newGoalNumber) { - case 0: - return true; - case 1: - sub_4058B0(); - return true; - case 2: - sub_405920(); - return true; - case 100: - Actor_Set_At_Waypoint(0, 315, 263); - dword_45A0D0_animation_state = 53; - dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(18) - 1; - Actor_Set_Invisible(0, false); - return true; - case 102: - Async_Actor_Walk_To_Waypoint(0, 316, 0, 1); - return true; - case 103: - Actor_Face_Actor(0, 8, true); - return true; - case 231: - Player_Set_Combat_Mode(false); - Preload(18); - Set_Enter(59, 63); - Player_Loses_Control(); - Actor_Force_Stop_Walking(0); - Actor_Put_In_Set(0, 59); - Actor_Set_At_XYZ(0, 14.0f, 110.84f, -300.0f, 926); - Actor_Change_Animation_Mode(0, 48); - dword_45A0D0_animation_state = 27; - dword_45A0D4_animation_frame = 0; - flt_462714 = 2.84f; - flt_462710 = 110.84f; - off_45A100 = -6.0f; - return true; - case 230: - dword_45A0FC = Actor_Query_Goal_Number(1) == 215; - Actor_Change_Animation_Mode(0, 6); - return true; - case 220: - Actor_Change_Animation_Mode(0, 75); - return true; - case 212: - Global_Variable_Set(47, 0); - Player_Set_Combat_Mode_Access(false); - Player_Gains_Control(); - Scene_Exits_Disable(); - dword_45A0D0_animation_state = 68; - dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(18) - 1; - return true; - case 211: - Actor_Face_Heading(0, 512, false); - Actor_Face_Heading(0, 768, true); - if (Random_Query(0, 1)) { - Actor_Change_Animation_Mode(0, 18); - } else { - Actor_Change_Animation_Mode(0, 16); - } - Delay(150); - Actor_Change_Animation_Mode(0, 0); - Actor_Set_Goal_Number(0, 0); - Player_Gains_Control(); - return true; - case 210: - Actor_Put_In_Set(0, 54); - Actor_Set_At_XYZ(0, -204.0, 24.0, -817.0, 256); - Actor_Set_Invisible(0, false); - if (Game_Flag_Query(627)) { - Actor_Set_Goal_Number(0, 212); - } else { - dword_45A0D0_animation_state = 53; - dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(18) - 1; - Actor_Set_Invisible(0, false); - } - return true; - case 200: - Player_Loses_Control(); - Actor_Change_Animation_Mode(0, 0); - return true; - case 301: - dword_45A0D0_animation_state = 62; - dword_45A0D4_animation_frame = 0; - return true; - case 302: - dword_45A0D0_animation_state = 64; - dword_45A0D4_animation_frame = 0; - return true; - case 303: - dword_45A0D0_animation_state = 65; - dword_45A0D4_animation_frame = 0; - return true; - case 350: - Sound_Play(123, 50, 0, 0, 50); - Delay(1000); - Sound_Play(403, 30, 0, 0, 50); - Delay(1000); - Sound_Play(123, 50, 0, 0, 50); - Actor_Says(4, 1380, 3); - Actor_Says(0, 6610, 13); - Actor_Says(4, 1390, 3); - Actor_Says(0, 6615, 18); - Actor_Says(4, 1420, 3); - Actor_Says(0, 6625, 11); - Actor_Says(4, 1430, 3); - Actor_Says(0, 6630, 12); - Actor_Says(0, 6635, 17); - Actor_Says(0, 6640, 13); - Actor_Says(0, 6645, 19); - Actor_Says(0, 6650, 18); - Actor_Says(0, 6655, 11); - Actor_Says(4, 1440, 3); - Actor_Says(0, 6660, 17); - Actor_Says(0, 6665, 13); - Delay(1000); - Actor_Says(4, 1450, 3); - Actor_Says(0, 6670, 14); - Actor_Says(0, 6675, 11); - Actor_Says(4, 1460, 3); - Actor_Says(0, 6680, 12); - Actor_Says(4, 1470, 3); - Actor_Says(0, 6685, 13); - Delay(500); - Actor_Says(0, 6695, 16); - Actor_Says(0, 6700, 17); - Actor_Says(4, 1480, 3); - Actor_Says(0, 6705, 11); - Sound_Play(123, 50, 0, 0, 50); - return true; - case 390: - Actor_Force_Stop_Walking(0); - Player_Loses_Control(); - flt_462710 = 48.07f; - off_45A100 = -4.0f; - flt_462714 = -20.0f; - if (dword_45A0D0_animation_state != 27 && dword_45A0D0_animation_state != 50) { - dword_45A0D0_animation_state = 50; - dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(18) - 1; - } - return true; - case 400: - Actor_Set_Health(0, 50, 50); - Game_Flag_Set(373); - v5 = Global_Variable_Query(45); - if (v5 == 1) { - Actor_Modify_Friendliness_To_Other(1, 0, 3); - } else if (v5 == 2) { - Actor_Modify_Friendliness_To_Other(1, 0, -5); - Actor_Modify_Friendliness_To_Other(5, 0, 3); - } else if (v5 == 3) { - Actor_Modify_Friendliness_To_Other(1, 0, -5); - Actor_Modify_Friendliness_To_Other(5, 0, 5); - } - if (Game_Flag_Query(666)) { - Actor_Modify_Friendliness_To_Other(1, 0, 3); - } - if (Actor_Query_Friendliness_To_Other(1, 0) < Actor_Query_Friendliness_To_Other(5, 0)) { - Game_Flag_Set(653); - } - v7 = Global_Variable_Query(45); - if (v7 == 1) { - if (Game_Flag_Query(653)) { - Global_Variable_Set(45, 0); - } - } else if (v7 == 2 || v7 == 3) { - if (!Game_Flag_Query(653)) { - Global_Variable_Set(45, 0); - } - } - if (!Game_Flag_Query(653)) { - Game_Flag_Set(461); - } - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Global_Variable_Set(1, 5); - Outtake_Play(10, 0, -1); - if (Game_Flag_Query(666)) { - Chapter_Enter(5, 53, 53); - } else { - Game_Flag_Set(34); - Chapter_Enter(5, 10, 49); - } - return true; - case 500: - Music_Stop(3); - Player_Set_Combat_Mode(false); - Actor_Change_Animation_Mode(0, 0); - dword_45A0D0_animation_state = 0; - dword_45A0D4_animation_frame = 0; - Game_Flag_Set(465); - Set_Enter(67, 72); - return true; - } - return false; -} - -bool AIScript_McCoy::UpdateAnimation(int *animation, int *frame) { - int v7, v18, v19, v46; - switch (dword_45A0D0_animation_state) { - case 71: - *animation = 52; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(52)) { - Actor_Change_Animation_Mode(0, 0); - *animation = 19; - dword_45A0D4_animation_frame = 0; - dword_45A0D0_animation_state = 0; - Player_Gains_Control(); - } - break; - case 70: - *animation = 51; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(51)) { - dword_45A0D4_animation_frame = 0; - } - break; - case 69: - *animation = 50; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(50)) { - Actor_Change_Animation_Mode(0, 53); - *animation = 51; - } - break; - case 68: - *animation = 18; - v7 = Slice_Animation_Query_Number_Of_Frames(*animation) - 1 - Global_Variable_Query(47); - if (dword_45A0D4_animation_frame < v7) { - dword_45A0D4_animation_frame++; - } else if (dword_45A0D4_animation_frame > v7) { - dword_45A0D4_animation_frame--; - } - if (dword_45A0D4_animation_frame <= 0) { - Actor_Change_Animation_Mode(0, 0); - *animation = 19; - dword_45A0D0_animation_state = 0; - dword_45A0D4_animation_frame = 0; - Game_Flag_Reset(627); - Scene_Exits_Enable(); - Player_Set_Combat_Mode_Access(true); - Actor_Set_Goal_Number(0, 0); - } - break; - case 67: - *animation = 53; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(53)) { - Actor_Change_Animation_Mode(0, 0); - *animation = 19; - dword_45A0D0_animation_state = 0; - dword_45A0D4_animation_frame = 0; - if (Actor_Query_Goal_Number(0) == 220) { - Actor_Change_Animation_Mode(0, 48); - } - } - break; - case 66: - *animation = 40; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(40)) { - Actor_Change_Animation_Mode(0, 0); - *animation = 19; - dword_45A0D4_animation_frame = 0; - dword_45A0D0_animation_state = 0; - } - break; - case 65: - *animation = 45; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(45)) { - dword_45A0D4_animation_frame = 0; - dword_45A0D0_animation_state = 14; - *animation = 0; - Actor_Set_Goal_Number(0, 0); - } - break; - case 64: - *animation = 44; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(44)) { - dword_45A0D4_animation_frame = 0; - dword_45A0D0_animation_state = 63; - *animation = 43; - } - break; - case 63: - *animation = 43; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(43)) { - dword_45A0D4_animation_frame = 0; - } - break; - case 62: - *animation = 42; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(42)) { - dword_45A0D4_animation_frame = 0; - dword_45A0D0_animation_state = 63; - *animation = 43; - } - break; - case 61: - *animation = 41; - dword_45A0D4_animation_frame--; - if (dword_45A0D4_animation_frame <= 0) { - *animation = 19; - dword_45A0D4_animation_frame = 0; - dword_45A0D0_animation_state = 0; - if (Actor_Query_Goal_Number(0) == 200) { - Actor_Set_Goal_Number(0, 201); - } - } - break; - case 60: - *animation = 41; - if (dword_45A0D4_animation_frame < Slice_Animation_Query_Number_Of_Frames(41) - 1) { - dword_45A0D4_animation_frame++; - } - return true; - case 59: - *animation = 48; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(48)) { - *animation = 19; - dword_45A0D4_animation_frame = 0; - dword_45A0DC = 0; - dword_45A0D0_animation_state = 0; - Player_Gains_Control(); - Item_Add_To_World(109, 982, 6, -110.0, 0.0, -192.0, 0, 48, 32, false, true, false, false); - } - break; - case 58: - *animation = 47; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame == 6) { - v18 = Random_Query(0, 2); - v19 = 0; - if (v18 == 0) { - v19 = 595; - } else if (v18 == 1) { - v19 = 594; - } else if (v18 == 2) { - v19 = 593; - } - Ambient_Sounds_Play_Sound(v19, 39, 0, 0, 99); - } - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(*animation) - 1) { //why -1? - dword_45A0D4_animation_frame = 0; - } - break; - case 57: - *animation = 46; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(46)) { - dword_45A0D4_animation_frame = 0; - } - if (!Game_Flag_Query(550)) { - dword_45A0D4_animation_frame = 0; - dword_45A0D0_animation_state = 59; - *animation = 48; - } - break; - case 56: - *animation = 49; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(49)) { - dword_45A0D4_animation_frame = 0; - if (Actor_Query_Which_Set_In(0) == 87) { - dword_45A0D0_animation_state = 27; - } else { - *animation = 19; - dword_45A0D0_animation_state = 0; - Actor_Change_Animation_Mode(0, 0); - } - } - break; - case 55: - *animation = 32; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame == 7) { - Actor_Change_Animation_Mode(66, 52); - } - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(*animation)) { - *animation = 19; - dword_45A0D0_animation_state = 0; - } - break; - case 53: - *animation = 18; - dword_45A0D4_animation_frame--; - if (dword_45A0D4_animation_frame <= 0) { - Actor_Change_Animation_Mode(0, 0); - *animation = 19; - dword_45A0D4_animation_frame = 0; - dword_45A0D0_animation_state = 0; - if (Actor_Query_Goal_Number(0) == 100) { - Actor_Set_Goal_Number(0, 101); - } - if (Actor_Query_Goal_Number(0) == 210) { - Actor_Set_Goal_Number(0, 211); - } - } - break; - case 52: - *animation = 31; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(31)) { - dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(31) - 1; - dword_45A0D0_animation_state = 50; - } - break; - case 51: - *animation = 28; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(28)) { - Player_Set_Combat_Mode(true); - sub_405800(); - Actor_Set_Goal_Number(0, 0); - dword_45A0D4_animation_frame = 0; - Player_Gains_Control(); - } - break; - case 50: - *animation = 18; - dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(18) - 1; - break; - case 49: - *animation = 34; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(34)) { - Actor_Set_Goal_Number(0, 0); - *animation = 19; - dword_45A0D4_animation_frame = 0; - sub_405660(); - } - break; - case 48: - *animation = 33; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(33)) { - dword_45A0D4_animation_frame = 0; - dword_45A0D0_animation_state = 49; - *animation = 34; - } - break; - case 47: - *animation = 29; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(29)) { - dword_45A0D4_animation_frame = 0; - dword_45A0D0_animation_state = 48; - *animation = 33; - } - break; - case 46: - Actor_Set_Invisible(0, false); - *animation = 36; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(36)) { - *animation = 19; - dword_45A0D4_animation_frame = 0; - Player_Gains_Control(); - sub_405660(); - Actor_Face_Heading(0, (Actor_Query_Facing_1024(0) + 512) & 1023, false); - } - break; - case 45: - *animation = 35; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(35)) { - Actor_Set_Invisible(0, true); - *animation = 19; - dword_45A0D4_animation_frame = 0; - sub_405660(); - } - break; - case 44: - *animation = 30; - if (dword_45A0D4_animation_frame++ == 127) { - Game_Flag_Set(325); - } - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(30)) { - *animation = 19; - sub_405660(); - Actor_Set_At_XYZ(0, -203.41f, -621.3f, 724.57f, 538); - Player_Gains_Control(); - } - break; - case 43: - *animation = 38; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(38) - 1) { //why -1? - dword_45A0D4_animation_frame = 0; - } - switch (dword_45A0D4_animation_frame) { - case 9: - Sound_Left_Footstep_Walk(0); - break; - case 4: - Sound_Right_Footstep_Walk(0); - break; - case 1: - Sound_Right_Footstep_Walk(0); - break; - } - break; - case 42: - *animation = 37; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(37) - 1) { //why -1? - dword_45A0D4_animation_frame = 0; - } - switch (dword_45A0D4_animation_frame) { - case 9: - Sound_Left_Footstep_Walk(0); - break; - case 4: - Sound_Right_Footstep_Walk(0); - break; - case 1: - Sound_Right_Footstep_Walk(0); - break; - } - break; - case 41: - *animation = 7; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(7)) { - dword_45A0D4_animation_frame = 0; - ++off_45A0EC; - } - if (dword_45A0D4_animation_frame == 9) { - Sound_Left_Footstep_Walk(0); - } else if (dword_45A0D4_animation_frame == 4) { - Sound_Right_Footstep_Walk(0); - } - if (Game_Flag_Query(359)) { - sub_4059D0(-0.2f); - } - break; - case 40: - *animation = 6; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(6)) { - dword_45A0D4_animation_frame = 0; - ++off_45A0EC; - } - if (dword_45A0D4_animation_frame == 8) { - Sound_Left_Footstep_Walk(0); - } else if (dword_45A0D4_animation_frame == 3) { - Sound_Right_Footstep_Walk(0); - } - if (Game_Flag_Query(358)) { - sub_405940(0.5f); - } - break; - case 39: - *animation = 16; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(16)) { - dword_45A0D4_animation_frame = 0; - ++off_45A0EC; - } - if (dword_45A0D4_animation_frame == 8) { - Sound_Left_Footstep_Walk(0); - } else if (dword_45A0D4_animation_frame == 3) { - Sound_Right_Footstep_Walk(0); - } - if (Game_Flag_Query(359)) { - sub_4059D0(-0.2f); - } - break; - case 38: - *animation = 15; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(15)) { - dword_45A0D4_animation_frame = 0; - ++off_45A0EC; - } - if (dword_45A0D4_animation_frame == 9) { - Sound_Left_Footstep_Walk(0); - } else if (dword_45A0D4_animation_frame == 4) { - Sound_Right_Footstep_Walk(0); - } - if (Game_Flag_Query(358)) { - sub_405940(0.5f); - } - break; - case 37: - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(4)) { - dword_45A0D4_animation_frame = 0; - } - *animation = 4; - if (dword_45A0D4_animation_frame == 6) { - Sound_Left_Footstep_Run(0); - } - if (dword_45A0D4_animation_frame == 0) { - Sound_Right_Footstep_Run(0); - } - break; - case 36: - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(3)) { - dword_45A0D4_animation_frame = 0; - } - *animation = 3; - if (dword_45A0D4_animation_frame == 15) { - Sound_Left_Footstep_Walk(0); - } - if (dword_45A0D4_animation_frame == 6) { - Sound_Right_Footstep_Walk(0); - } - break; - case 32: - dword_45A0D4_animation_frame = 1; - dword_45A0D0_animation_state = 30; - *animation = 13; - break; - case 31: - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(14)) { - dword_45A0D4_animation_frame = 0; - } - *animation = 14; - if (dword_45A0D4_animation_frame == 5) { - Sound_Left_Footstep_Run(0); - } else if (dword_45A0D4_animation_frame == 12) { - Sound_Right_Footstep_Run(0); - } - break; - case 30: - *animation = 13; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(13)) { - dword_45A0D4_animation_frame = 0; - } - if (dword_45A0D4_animation_frame == 2) { - Sound_Right_Footstep_Walk(0); - } else if (dword_45A0D4_animation_frame == 10) { - Sound_Left_Footstep_Walk(0); - } - break; - case 29: - v46 = dword_45A0D4_animation_frame + dword_45A0E0; - *animation = 18; - dword_45A0D4_animation_frame = v46; - if (v46 < 14) { - dword_45A0E0 = 1; - } - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(*animation)) { - Actor_Change_Animation_Mode(0, 48); - *animation = 18; - dword_45A0D0_animation_state = 27; - dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(18) - 1; - } - break; - case 28: - *animation = 5; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(5)) { - dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(*animation) - 1; - dword_45A0D0_animation_state = 50; - sub_4054F0(); - } - break; - case 27: - *animation = 18; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(18)) { - dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(*animation) - 1; - dword_45A0D0_animation_state = 50; - sub_4054F0(); - if (Actor_Query_Goal_Number(0) == 220) { - Actor_Set_Goal_Number(0, 221); - } - } - break; - case 26: - *animation = 17; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(17)) { - *animation = 19; - dword_45A0D4_animation_frame = 0; - dword_45A0D0_animation_state = 0; - Actor_Change_Animation_Mode(0, 0); - } - break; - case 25: - *animation = 17; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(17)) { - *animation = 19; - dword_45A0D4_animation_frame = 0; - dword_45A0D0_animation_state = 0; - Actor_Change_Animation_Mode(0, 0); - } - break; - case 24: - *animation = 1; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(1)) { - dword_45A0D4_animation_frame = 0; - dword_45A0D0_animation_state = 14; - *animation = 0; - Actor_Change_Animation_Mode(0, 4); - } - break; - case 23: - *animation = 1; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(1)) { - dword_45A0D4_animation_frame = 0; - dword_45A0D0_animation_state = 14; - *animation = 0; - Actor_Change_Animation_Mode(0, 4); - } - break; - case 22: - dword_45A0D4_animation_frame = 0; - dword_45A0D0_animation_state = 17; - *animation = 12; - break; - case 21: - *animation = 12; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame == 1 && Actor_Query_Goal_Number(0) == 230 && dword_45A0FC == 1) { - dword_45A0F8 = 27; - } - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(12)) { - dword_45A0D0_animation_state = 17; - dword_45A0D4_animation_frame = 0; - *animation = 12; - if (Actor_Query_Goal_Number(0) == 230) { - dword_45A0D4_animation_frame = 0; - dword_45A0D0_animation_state = 21; - dword_45A0FC = 1; - *animation = 12; - } - } - break; - case 19: - *animation = 11; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= 12) { - dword_45A0D4_animation_frame = 0; - dword_45A0D0_animation_state = 14; - *animation = 0; - } - break; - case 18: - *animation = 10; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(10)) { - dword_45A0D4_animation_frame = 0; - dword_45A0D0_animation_state = 17; - *animation = 12; - } - break; - case 17: - *animation = 12; - dword_45A0D4_animation_frame = 0; - // weird, but thats in game code - if (Slice_Animation_Query_Number_Of_Frames(12) <= 0) { - dword_45A0D4_animation_frame = 0; - dword_45A0D0_animation_state = 17; - } - break; - case 16: - *animation = 9; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(9)) { - *animation = 19; - dword_45A0D4_animation_frame = 0; - dword_45A0D0_animation_state = 0; - } - break; - case 15: - *animation = 8; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(8)) { - dword_45A0D4_animation_frame = 0; - dword_45A0D0_animation_state = 14; - *animation = 0; - } - break; - case 14: - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(0)) { - dword_45A0D0_animation_state = 14; - dword_45A0D4_animation_frame = 0; - } - *animation = 0; - break; - case 13: - *animation = 19; - if (dword_45A0D4_animation_frame < Slice_Animation_Query_Number_Of_Frames(19) / 2) { - dword_45A0D4_animation_frame -= 3; - if (dword_45A0D4_animation_frame <= 0) { - dword_45A0D4_animation_frame = 0; - *animation = dword_46271C; - dword_45A0D0_animation_state = dword_462718; - } - } else { - dword_45A0D4_animation_frame += 3; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(19)) { - dword_45A0D4_animation_frame = 0; - *animation = dword_46271C; - dword_45A0D0_animation_state = dword_462718; - } - } - break; - case 12: - *animation = 27; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(27)) { - dword_45A0D4_animation_frame = 0; - dword_45A0D0_animation_state = 3; - *animation = 20; - } - break; - case 11: - *animation = 26; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(26)) { - dword_45A0D4_animation_frame = 0; - dword_45A0D0_animation_state = 3; - *animation = 20; - } - break; - case 10: - *animation = 25; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(25)) { - dword_45A0D4_animation_frame = 0; - dword_45A0D0_animation_state = 3; - *animation = 20; - } - break; - case 9: - *animation = 24; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(24)) { - dword_45A0D4_animation_frame = 0; - dword_45A0D0_animation_state = 3; - *animation = 20; - } - break; - case 8: - *animation = 23; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(23)) { - dword_45A0D4_animation_frame = 0; - dword_45A0D0_animation_state = 3; - *animation = 20; - } - break; - case 7: - *animation = 22; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(22)) { - dword_45A0D4_animation_frame = 0; - dword_45A0D0_animation_state = 3; - *animation = 20; - } - break; - case 6: - *animation = 27; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(27)) { - dword_45A0D4_animation_frame = 0; - dword_45A0D0_animation_state = 3; - *animation = 20; - } - break; - case 5: - *animation = 21; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(21)) { - dword_45A0D4_animation_frame = 0; - dword_45A0D0_animation_state = 3; - *animation = 20; - } - break; - case 3: - case 4: - if (dword_45A0D4_animation_frame == 0 && !Game_Flag_Query(236)) { - dword_45A0D4_animation_frame = 1; - dword_45A0D0_animation_state = dword_45A0F0; - *animation = dword_45A0F4; - dword_45A0F0 = 4; - dword_45A0F4 = 20; - } else if (dword_45A0D4_animation_frame <= 4 && Game_Flag_Query(236)) { - Game_Flag_Reset(236); - *animation = 19; - dword_45A0D4_animation_frame = 0; - dword_45A0D0_animation_state = 0; - } else { - *animation = 20; - dword_45A0D4_animation_frame++; - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(20)) { - dword_45A0D4_animation_frame = 0; - } - } - break; - case 0: - *animation = 19; - if (dword_45A0D8 < dword_45A0DC) { - //*frame = dword_45A0E8; - dword_45A0D4_animation_frame += dword_45A0E0; - if (dword_45A0D4_animation_frame > dword_45A0E8) { - dword_45A0D4_animation_frame = dword_45A0E8; - dword_45A0E0 = -1; - } else if (dword_45A0D4_animation_frame < dword_45A0E4) { - dword_45A0D4_animation_frame = dword_45A0E4; - dword_45A0E0 = 1; - } - dword_45A0D8++; - } else { - dword_45A0D4_animation_frame += dword_45A0E0; - dword_45A0DC = 0; - if (dword_45A0D4_animation_frame == 18 && Random_Query(0, 2)) { - dword_45A0E0 = -1; - dword_45A0D8 = 0; - dword_45A0E4 = 14; - dword_45A0E8 = 18; - dword_45A0DC = Random_Query(0, 30); - } - if (dword_45A0D4_animation_frame == 26) { - if (Random_Query(0, 2)) { - dword_45A0E0 = -1; - dword_45A0D8 = 0; - dword_45A0E4 = 23; - dword_45A0E8 = 26; - dword_45A0DC = Random_Query(0, 30); - } - } - if (dword_45A0D4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(19)) { - dword_45A0D4_animation_frame = 0; - if (Random_Query(0, 2)) { - dword_45A0D8 = 0; - dword_45A0E4 = 0; - dword_45A0E8 = 3; - dword_45A0DC = Random_Query(0, 45); - } - } - if (dword_45A0D4_animation_frame < 0) { - dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(19) - 1; - } - } - break; - } - *frame = dword_45A0D4_animation_frame; - return true; -} - -bool AIScript_McCoy::ChangeAnimationMode(int mode) { - int v2; - switch (mode) { - case 85: - dword_45A0D4_animation_frame = 0; - dword_45A0D0_animation_state = 69; - return true; - case 75: - dword_45A0D0_animation_state = 67; - dword_45A0D4_animation_frame = 0; - return true; - case 68: - dword_45A0D0_animation_state = 29; - dword_45A0D4_animation_frame = Slice_Animation_Query_Number_Of_Frames(18) - 1; - dword_45A0E0 = -1; - return true; - case 65: - case 67: - dword_45A0D0_animation_state = 43; - dword_45A0D4_animation_frame = 0; - return true; - case 64: - case 66: - dword_45A0D0_animation_state = 42; - dword_45A0D4_animation_frame = 0; - return true; - case 53: - if (dword_45A0D0_animation_state != 60 && (Player_Query_Current_Set() == 55 || Player_Query_Current_Set() == 13)) { - dword_45A0D0_animation_state = 60; - dword_45A0D4_animation_frame = 0; - } else { - dword_45A0D4_animation_frame = 0; - dword_45A0D0_animation_state = 70; - } - return true; - case 52: - dword_45A0D0_animation_state = 55; - dword_45A0D4_animation_frame = 0; - return true; - case 51: - dword_45A0D0_animation_state = 27; - dword_45A0D4_animation_frame = 0; - return true; - case 49: - dword_45A0D0_animation_state = 28; - dword_45A0D4_animation_frame = 0; - return true; - case 48: - switch (dword_45A0D0_animation_state) { - case 14: - dword_45A0D0_animation_state = 28; - dword_45A0D4_animation_frame = 0; - break; - case 13: - dword_45A0D0_animation_state = 22; - dword_45A0D4_animation_frame = 0; - return true; - case 10: - dword_45A0D0_animation_state = 18; - dword_45A0D4_animation_frame = 8 * (13 - dword_45A0D4_animation_frame) / 13; - return true; - case 8: - case 9: - case 12: - return true; - case 11: - dword_45A0D0_animation_state = 18; - dword_45A0D4_animation_frame = 0; - break; - case 7: - dword_45A0D0_animation_state = 14; - dword_45A0D4_animation_frame = 0; - break; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - dword_45A0D0_animation_state = 15; - dword_45A0D4_animation_frame = 0; - break; - default: - if (dword_45A0D0_animation_state != 50) { - dword_45A0D0_animation_state = 27; - dword_45A0D4_animation_frame = 0; - } - break; - } - return true; - case 47: - dword_45A0D0_animation_state = 41; - dword_45A0D4_animation_frame = 0; - return true; - case 46: - dword_45A0D0_animation_state = 40; - dword_45A0D4_animation_frame = 0; - return true; - case 45: - dword_45A0D0_animation_state = 39; - dword_45A0D4_animation_frame = 0; - return true; - case 44: - dword_45A0D0_animation_state = 38; - dword_45A0D4_animation_frame = 0; - return true; - case 42: - dword_45A0D0_animation_state = 46; - dword_45A0D4_animation_frame = 0; - Player_Loses_Control(); - return true; - case 41: - dword_45A0D0_animation_state = 45; - dword_45A0D4_animation_frame = 0; - return true; - case 40: - dword_45A0D0_animation_state = 44; - dword_45A0D4_animation_frame = 0; - return true; - case 39: - dword_45A0D4_animation_frame = 0; - dword_45A0D0_animation_state = 52; - if (Player_Query_Current_Set() == 27) { - dword_45A0D4_animation_frame = 23; - } - return true; - case 38: - dword_45A0D0_animation_state = 47; - dword_45A0D4_animation_frame = 0; - return true; - case 29: - Player_Loses_Control(); - dword_45A0D4_animation_frame = 0; - dword_45A0D0_animation_state = 71; - return true; - case 23: - dword_45A0D0_animation_state = 66; - dword_45A0D4_animation_frame = 0; - return true; - case 22: - if (Random_Query(0, 1)) { - dword_45A0D0_animation_state = 23; - } else { - dword_45A0D0_animation_state = 24; - } - dword_45A0D4_animation_frame = 0; - return true; - case 21: - switch (dword_45A0D0_animation_state) { - case 0: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - dword_45A0D0_animation_state = 28; - dword_45A0D4_animation_frame = 0; - break; - case 1: - case 8: - dword_45A0D0_animation_state = 27; - dword_45A0D4_animation_frame = 0; - break; - default: - - if (Random_Query(0, 1)) { - dword_45A0D0_animation_state = 26; - } else { - dword_45A0D0_animation_state = 25; - } - dword_45A0D4_animation_frame = 0; - break; - } - return true; - case 20: - v2 = Actor_Query_Which_Set_In(0); - if (v2 == 27) { - dword_45A0D0_animation_state = 51; - dword_45A0D4_animation_frame = 0; - Player_Loses_Control(); - Game_Flag_Set(210); - } else if (v2 == 70 || v2 == 87) { - dword_45A0D0_animation_state = 56; - dword_45A0D4_animation_frame = 0; - } - return true; - case 19: - if (dword_45A0D0_animation_state < 3 || dword_45A0D0_animation_state > 12) { - dword_45A0D0_animation_state = 13; - dword_462718 = 12; - dword_46271C = 27; - } else { - Game_Flag_Reset(236); - dword_45A0F0 = 12; - dword_45A0F4 = 27; - } - return true; - case 18: - if (dword_45A0D0_animation_state < 3 || dword_45A0D0_animation_state > 12) { - dword_45A0D0_animation_state = 13; - dword_462718 = 11; - dword_46271C = 26; - } else { - Game_Flag_Reset(236); - dword_45A0F0 = 11; - dword_45A0F4 = 26; - } - return true; - case 17: - if (dword_45A0D0_animation_state < 3 || dword_45A0D0_animation_state > 12) { - dword_45A0D0_animation_state = 13; - dword_462718 = 10; - dword_46271C = 25; - } else { - Game_Flag_Reset(236); - dword_45A0F0 = 10; - dword_45A0F4 = 25; - } - return true; - case 16: - if (dword_45A0D0_animation_state < 3 || dword_45A0D0_animation_state > 12) { - dword_45A0D0_animation_state = 13; - dword_462718 = 9; - dword_46271C = 24; - } else { - Game_Flag_Reset(236); - dword_45A0F0 = 9; - dword_45A0F4 = 24; - } - return true; - case 15: - if (dword_45A0D0_animation_state < 3 || dword_45A0D0_animation_state > 12) { - dword_45A0D0_animation_state = 13; - dword_462718 = 8; - dword_46271C = 23; - } else { - Game_Flag_Reset(236); - dword_45A0F0 = 8; - dword_45A0F4 = 23; - } - return true; - case 11: - case 14: - if (dword_45A0D0_animation_state < 3 || dword_45A0D0_animation_state > 12) { - dword_45A0D0_animation_state = 13; - dword_462718 = 7; - dword_46271C = 22; - } else { - Game_Flag_Reset(236); - dword_45A0F0 = 7; - dword_45A0F4 = 22; - } - return true; - case 10: - case 13: - if (dword_45A0D0_animation_state < 3 || dword_45A0D0_animation_state > 12) { - dword_45A0D0_animation_state = 13; - dword_462718 = 6; - dword_46271C = 27; - } else { - Game_Flag_Reset(236); - dword_45A0F0 = 6; - dword_45A0F4 = 27; - } - return true; - case 9: - case 12: - if (dword_45A0D0_animation_state < 3 || dword_45A0D0_animation_state > 12) { - dword_45A0D0_animation_state = 13; - dword_462718 = 5; - dword_46271C = 21; - } else { - Game_Flag_Reset(236); - dword_45A0F0 = 5; - dword_45A0F4 = 21; - } - return true; - case 8: - if (dword_45A0D0_animation_state != 27 && dword_45A0D0_animation_state != 50) { - dword_45A0D0_animation_state = 37; - dword_45A0D4_animation_frame = 0; - } - return true; - case 7: - if (dword_45A0D0_animation_state != 27 && dword_45A0D0_animation_state != 50) { - dword_45A0D0_animation_state = 36; - dword_45A0D4_animation_frame = 0; - } - return true; - case 6: - dword_45A0D0_animation_state = 21; - dword_45A0D4_animation_frame = 0; - return true; - case 5: - switch (dword_45A0D0_animation_state) { - case 1: - case 2: - case 5: - dword_45A0D0_animation_state = 14; - dword_45A0D4_animation_frame = 0; - break; - case 0: - case 3: - case 4: - dword_45A0D0_animation_state = 15; - dword_45A0D4_animation_frame = 0; - break; - default: - dword_45A0D0_animation_state = 18; - dword_45A0D4_animation_frame = 0; - break; - } - return true; - case 4: - switch (dword_45A0D0_animation_state) { - case 22: - dword_45A0D0_animation_state = 19; - dword_45A0D4_animation_frame = 41; - break; - case 18: - dword_45A0D0_animation_state = 19; - dword_45A0D4_animation_frame = 13 * ((8 - dword_45A0D4_animation_frame) / 8); - break; - case 17: - case 20: - dword_45A0D0_animation_state = 19; - dword_45A0D4_animation_frame = 0; - break; - case 16: - dword_45A0D0_animation_state = 15; - dword_45A0D4_animation_frame = 12 - 12 * dword_45A0D4_animation_frame / 16; - break; - case 14: - case 15: - case 19: - case 21: - case 2: - case 3: - return true; - default: - dword_45A0D0_animation_state = 15; - dword_45A0D4_animation_frame = 0; - break; - case 13: - dword_45A0D0_animation_state = 16; - dword_45A0D4_animation_frame = 0; - break; - case 0: - case 1: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - dword_45A0D0_animation_state = 0; - dword_45A0D4_animation_frame = 0; - dword_45A0DC = 0; - break; - } - return true; - case 3: - if (dword_45A0D0_animation_state >= 3 && dword_45A0D0_animation_state <= 12) { - Game_Flag_Reset(236); - dword_45A0F0 = 4; - dword_45A0F4 = 20; - } else { - dword_45A0D0_animation_state = 13; - dword_462718 = 3; - dword_46271C = 20; - } - return true; - case 2: - if (dword_45A0D0_animation_state == 27 || dword_45A0D0_animation_state == 50) { - return true; - } - if (!Game_Flag_Query(550)) { - dword_45A0D0_animation_state = 31; - dword_45A0D4_animation_frame = 0; - return true; - } - dword_45A0D0_animation_state = 58; - dword_45A0D4_animation_frame = 4; - return true; - case 1: - if (dword_45A0D0_animation_state == 27 || dword_45A0D0_animation_state == 50) { - return true; - } - if (!Game_Flag_Query(550)) { - dword_45A0D0_animation_state = 32; - dword_45A0D4_animation_frame = 0; - return true; - } - dword_45A0D0_animation_state = 58; - dword_45A0D4_animation_frame = 0; - return true; - case 0: - if (Game_Flag_Query(550)) { - if (dword_45A0D4_animation_frame > 6) { - dword_45A0D0_animation_state = 57; - dword_45A0D4_animation_frame = 0; - return true; - } - int v3 = Random_Query(0, 2); - int v4 = 0; - if (v3 == 0) { - v4 = 595; - } else if (v3 == 1) { - v4 = 594; - } else if (v3 == 2) { - v4 = 593; - } - Ambient_Sounds_Play_Sound(v4, 39, 0, 0, 99); - dword_45A0D0_animation_state = 57; - dword_45A0D4_animation_frame = 0; - return true; - } - if (dword_45A0D0_animation_state == 60) { - dword_45A0D0_animation_state = 61; - return true; - } - dword_45A0D0_animation_state = 0; - dword_45A0D4_animation_frame = 0; - dword_45A0DC = 0; - return true; - } - return true; -} - -void AIScript_McCoy::QueryAnimationState(int *animationState, int *a2, int *a3, int *a4) { - *animationState = dword_45A0D0_animation_state; - *a2 = dword_45A0D4_animation_frame; - *a3 = dword_462718; - *a4 = dword_46271C; -} - -void AIScript_McCoy::SetAnimationState(int animationState, int a2, int a3, int a4) { - dword_45A0D0_animation_state = animationState; - dword_45A0D4_animation_frame = a2; - dword_462718 = a3; - dword_46271C = a4; -} - -bool AIScript_McCoy::ReachedMovementTrackWaypoint(int waypointId) { - return true; -} - -void AIScript_McCoy::FledCombat() {} - -void AIScript_McCoy::sub_4053E0() { - float x, y, z; - Actor_Query_XYZ(0, &x, &y, &z); - flt_462710 = flt_462710 + off_45A100; - if (flt_462714 < flt_462710) { - off_45A100 = off_45A100 - 0.2f; - } else { - flt_462710 = flt_462714; - Actor_Set_Goal_Number(0, 0); - Actor_Retired_Here(0, 12, 48, 1, -1); - } - return Actor_Set_At_XYZ(0, x, flt_462710, z, Actor_Query_Facing_1024(0)); -} - -void AIScript_McCoy::sub_4054F0() { - if (Actor_Query_Which_Set_In(0) == 87 && Actor_Query_Goal_Number(0) != 390 && !Game_Flag_Query(682)) { - float x, y, z; - Actor_Query_XYZ(0, &x, &y, &z); - if ((z < 220.0f) && (-210.0f < x) && (-70.0f > x)) { - Game_Flag_Set(682); - Scene_Loop_Set_Default(3); - Scene_Loop_Start_Special(2, 2, 1); - Actor_Set_Goal_Number(0, 390); - Actor_Query_XYZ(64, &x, &y, &z); - if (-200.0 < x && -62.0f > x) { - Actor_Set_Goal_Number(64, 309); - } - } else { - Actor_Set_Goal_Number(0, 391); - } - } -} - -void AIScript_McCoy::sub_405660() { - if (Game_Flag_Query(550)) { - if (dword_45A0D4_animation_frame <= 6) { - int v1 = Random_Query(0, 2); - int v2 = 0; - if (v1 == 0) { - v2 = 595; - } else if (v1 == 1) { - v2 = 594; - } else if (v1 == 2) { - v2 = 593; - } - Ambient_Sounds_Play_Sound(v2, 39, 0, 0, 99); - } - dword_45A0D0_animation_state = 57; - dword_45A0D4_animation_frame = 0; - return; - } - switch (dword_45A0D0_animation_state) { - case 17: - case 20: - case 21: - case 36: - dword_45A0D0_animation_state = 16; - dword_45A0D4_animation_frame = 0; - break; - case 16: - case 25: - case 26: - break; - case 15: - dword_45A0D0_animation_state = 16; - dword_45A0D4_animation_frame = 16 - 16 * dword_45A0D4_animation_frame / 12; - break; - case 14: - dword_45A0D0_animation_state = 16; - dword_45A0D4_animation_frame = 0; - break; - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - Game_Flag_Set(236); - dword_45A0D8 = 0; - dword_45A0DC = 30; - dword_45A0E4 = 0; - dword_45A0E0 = 1; - dword_45A0E8 = 3; - break; - case 60: - dword_45A0D0_animation_state = 61; - break; - default: - dword_45A0D0_animation_state = 0; - dword_45A0D4_animation_frame = 0; - dword_45A0DC = 0; - } -} - -void AIScript_McCoy::sub_405800() { - switch (dword_45A0D0_animation_state) { - case 36: - case 37: - case 40: - case 41: - case 51: - dword_45A0D0_animation_state = 14; - dword_45A0D4_animation_frame = 0; - break; - case 22: - dword_45A0D0_animation_state = 19; - dword_45A0D4_animation_frame = 41; - break; - case 18: - dword_45A0D0_animation_state = 19; - dword_45A0D4_animation_frame = 13 * ((8 - dword_45A0D4_animation_frame) / 8); - break; - case 17: - case 20: - dword_45A0D0_animation_state = 19; - dword_45A0D4_animation_frame = 0; - break; - case 16: - dword_45A0D4_animation_frame = 12 - 12 * dword_45A0D4_animation_frame / 16; - dword_45A0D0_animation_state = 15; - break; - case 14: - case 15: - case 19: - case 21: - break; - default: - dword_45A0D0_animation_state = 15; - dword_45A0D4_animation_frame = 0; - break; - } -} - -void AIScript_McCoy::sub_4058B0() { - int v0 = Actor_Query_Which_Set_In(0); - if (v0 == 27) { - dword_45A0D0_animation_state = 51; - dword_45A0D4_animation_frame = 0; - Player_Loses_Control(); - Game_Flag_Set(210); - } else if (v0 == 70 || v0 == 87) { - dword_45A0D0_animation_state = 56; - dword_45A0D4_animation_frame = 0; - } -} - -void AIScript_McCoy::sub_405920() { - dword_45A0D4_animation_frame = 0; - dword_45A0D0_animation_state = 47; -} - -void AIScript_McCoy::sub_405940(float a1) { - float x, y, z; - int currentAngle = Actor_Query_Facing_1024(0); - Actor_Query_XYZ(0, &x, &y, &z); - int angle = currentAngle - 12; - y = y + a1; - if (angle < 0) { - angle = currentAngle + 1012; - } - if (angle > 1023) { - angle -= 1024; - } - Actor_Set_At_XYZ(0, x, y, z, angle); -} - -void AIScript_McCoy::sub_4059D0(float a1) { - float x, y, z; - int currentAngle = Actor_Query_Facing_1024(0); - Actor_Query_XYZ(0, &x, &y, &z); - int angle = currentAngle + 15; - y = y + a1; - if (angle < 0) { - angle = currentAngle + 1039; - } - if (angle > 1023) { - angle -= 1024; - } - return Actor_Set_At_XYZ(0, x, y, z, angle); -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ai_00_mccoy.h b/engines/bladerunner/script/ai_00_mccoy.h deleted file mode 100644 index 2fda82f2de..0000000000 --- a/engines/bladerunner/script/ai_00_mccoy.h +++ /dev/null @@ -1,83 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -#include "bladerunner/bladerunner.h" - -namespace BladeRunner { -class AIScript_McCoy : public AIScriptBase { - int dword_45A0D0_animation_state; - int dword_45A0D4_animation_frame; - int dword_45A0D8; - int dword_45A0DC; - int dword_45A0E0; - int dword_45A0E4; - float off_45A0EC; - int dword_45A0E8; - int dword_45A0F0; - int dword_45A0F4; - int dword_45A0F8; - int dword_45A0FC; - int dword_462718; - int dword_46271C; - float off_45A100; - float flt_462710; - float flt_462714; - -public: - AIScript_McCoy(BladeRunnerEngine *vm); - - void Initialize(); - bool Update(); - void TimerExpired(int timer); - void CompletedMovementTrack(); - void ReceivedClue(int clueId, int fromActorId); - void ClickedByPlayer(); - void EnteredScene(int sceneId); - void OtherAgentEnteredThisScene(int otherActorId); - void OtherAgentExitedThisScene(int otherActorId); - void OtherAgentEnteredCombatMode(int otherActorId, int combatMode); - void ShotAtAndMissed(); - void ShotAtAndHit(); - void Retired(int byActorId); - int GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId); - bool GoalChanged(int currentGoalNumber, int newGoalNumber); - bool UpdateAnimation(int *animation, int *frame); - bool ChangeAnimationMode(int mode); - void QueryAnimationState(int *animationState, int *a2, int *a3, int *a4); - void SetAnimationState(int animationState, int a2, int a3, int a4); - bool ReachedMovementTrackWaypoint(int a1); - void FledCombat(); - -private: - void sub_4053E0(); - void sub_4054F0(); - void sub_405660(); - void sub_405800(); - void sub_4058B0(); - void sub_405920(); - void sub_405940(float a1); - void sub_4059D0(float a1); - -}; -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ai_15_runciter.cpp b/engines/bladerunner/script/ai_15_runciter.cpp deleted file mode 100644 index b26339b653..0000000000 --- a/engines/bladerunner/script/ai_15_runciter.cpp +++ /dev/null @@ -1,656 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/ai_15_runciter.h" - -namespace BladeRunner { - -AIScript_Runciter::AIScript_Runciter(BladeRunnerEngine *vm) - : AIScriptBase(vm) {} - -void AIScript_Runciter::Initialize() { - var_45CD70_animation_state = 0; - var_45CD74_animation_frame = 0; - var_462800 = 0; - var_45CD78 = 0; - var_45CD7C = 6; - var_45CD80 = 1; - var_45CD84 = 0; - var_45CD88 = 0; - Actor_Set_Goal_Number(15, 0); -} - -bool AIScript_Runciter::Update() { - if (Actor_Query_Goal_Number(15) == 0 && Game_Flag_Query(186)) { - Actor_Set_Goal_Number(15, 2); - } - if (Global_Variable_Query(1) == 4 && Actor_Query_Goal_Number(15) < 300) { - Actor_Set_Goal_Number(15, 300); - } - return false; -} - -void AIScript_Runciter::TimerExpired(int timer) {} - -void AIScript_Runciter::CompletedMovementTrack() { - if (Actor_Query_Goal_Number(15) == 1) { - if (Player_Query_Current_Scene() == 79) { - switch (Random_Query(1, 5)) { - case 2: - case 3: - ADQ_Add(15, 530, -1); - break; - case 1: - case 5: - ADQ_Add(15, 80, -1); - break; - case 4: - ADQ_Add(15, 930, -1); - break; - } - } - Actor_Set_Goal_Number(15, 99); - Actor_Set_Goal_Number(15, 1); - //return true; - } - //return false; -} - -void AIScript_Runciter::ReceivedClue(int clueId, int fromActorId) {} - -void AIScript_Runciter::ClickedByPlayer() {} - -void AIScript_Runciter::EnteredScene(int sceneId) {} - -void AIScript_Runciter::OtherAgentEnteredThisScene(int otherActorId) {} - -void AIScript_Runciter::OtherAgentExitedThisScene(int otherActorId) {} - -void AIScript_Runciter::OtherAgentEnteredCombatMode(int otherActorId, int combatMode) { - if (Actor_Query_Goal_Number(15) == 300 && combatMode == 1 && !Game_Flag_Query(705)) { - Actor_Set_Targetable(15, true); - Actor_Face_Actor(15, 0, true); - Actor_Says(15, 420, 12); - Actor_Face_Actor(0, 15, true); - Actor_Change_Animation_Mode(0, 5); - if (Actor_Clue_Query(0, 158)) { - Actor_Says(0, 4770, -1); - Actor_Says(15, 590, 13); - Actor_Says(0, 4775, -1); - Actor_Says(15, 600, 17); - Sound_Play(492, 100, 0, 100, 50); - Actor_Says(0, 4780, -1); - Actor_Says(15, 610, 18); - Actor_Says(0, 4785, -1); - Actor_Says(15, 620, 15); - if (Game_Flag_Query(46)) { - Actor_Says(15, 630, 12); - Actor_Says(15, 640, 17); - Actor_Says(0, 4790, -1); - Actor_Says(15, 650, 18); - Actor_Says(15, 660, 19); - Actor_Clue_Acquire(0, 280, 1, 15); - } else { - Actor_Says(15, 670, 18); - Actor_Says(0, 4795, -1); - Actor_Says(15, 730, 17); - } - } else if (Actor_Clue_Query(0, 76)) { - Actor_Says(0, 4730, -1); - Actor_Says(15, 480, 17); - Actor_Says(0, 4735, -1); - Actor_Says(15, 490, 16); - Sound_Play(492, 100, 0, 100, 50); - Actor_Says(0, 4740, -1); - Actor_Says(15, 500, 18); - Actor_Says(15, 510, 19); - Actor_Says(0, 4745, -1); - Actor_Says(0, 4750, -1); - Actor_Says(15, 520, 17); - Actor_Says(15, 530, 18); - Actor_Says(15, 540, 16); - } - Game_Flag_Set(705); - } -} - -void AIScript_Runciter::ShotAtAndMissed() {} - -void AIScript_Runciter::ShotAtAndHit() { - Actor_Set_Targetable(15, false); - Actor_Change_Animation_Mode(15, 48); - Actor_Set_Goal_Number(15, 599); - Delay(2000); - if (Actor_Clue_Query(0, 158)) { - Actor_Voice_Over(2050, 99); - Actor_Voice_Over(2060, 99); - } else { - Actor_Voice_Over(2070, 99); - Actor_Voice_Over(2080, 99); - Actor_Voice_Over(2090, 99); - } - Actor_Modify_Friendliness_To_Other(5, 0, 3); -} - -void AIScript_Runciter::Retired(int byActorId) {} - -int AIScript_Runciter::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId) { - return 0; -} - -bool AIScript_Runciter::GoalChanged(int currentGoalNumber, int newGoalNumber) { - if (newGoalNumber == 0) { - Actor_Put_In_Set(15, 16); - Actor_Set_At_Waypoint(15, 92, 567); - return false; - } - if (newGoalNumber == 1) { - AI_Movement_Track_Flush(15); - if (Random_Query(0, 1) == 1) { - if (Random_Query(0, 1) == 0) { - AI_Movement_Track_Append_With_Facing(15, 89, Random_Query(6, 10), 567); - } - AI_Movement_Track_Append_With_Facing(15, 93, Random_Query(2, 6), 1002); - AI_Movement_Track_Append(15, 92, 5); - } else { - AI_Movement_Track_Append_With_Facing(15, 91, Random_Query(3, 10), 120); - if (Random_Query(1, 3) == 1) { - AI_Movement_Track_Append_With_Facing(15, 93, Random_Query(2, 6), 1002); - } - AI_Movement_Track_Append_With_Facing(15, 90, Random_Query(5, 10), 170); - } - AI_Movement_Track_Repeat(15); - return true; - } - if (newGoalNumber == 2) { - AI_Movement_Track_Flush(15); - AI_Movement_Track_Append(15, 39, 120); - AI_Movement_Track_Append(15, 40, 0); - AI_Movement_Track_Repeat(15); - return false; - } - if (newGoalNumber == 300) { - Actor_Put_In_Set(15, 16); - Actor_Set_At_Waypoint(15, 93, 1007); - return false; - } - return false; -} - -bool AIScript_Runciter::UpdateAnimation(int *animation, int *frame) { - - switch (var_45CD70_animation_state) { - case 15: - *animation = 528; - var_45CD74_animation_frame = Slice_Animation_Query_Number_Of_Frames(528) - 1; - *frame = var_45CD74_animation_frame; - break; - case 14: - *animation = 528; - var_45CD74_animation_frame++; - if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(528) - 1) { - *animation = 528; - var_45CD70_animation_state = 15; - } - *frame = var_45CD74_animation_frame; - break; - case 13: - if (var_45CD78 == 0) { - var_45CD74_animation_frame = 0; - var_45CD70_animation_state = var_462800; - *animation = var_462804; - } else if (var_45CD78 == 1) { - *animation = 530; - var_45CD74_animation_frame += 3; - if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(530)) { - var_45CD74_animation_frame = 0; - var_45CD70_animation_state = var_462800; - *animation = var_462804; - } - } else if (var_45CD78 == 2) { - *animation = 531; - var_45CD74_animation_frame -= 3; - if (var_45CD74_animation_frame - 3 < 0) { - var_45CD74_animation_frame = 0; - var_45CD70_animation_state = var_462800; - *animation = var_462804; - } - } - *frame = var_45CD74_animation_frame; - break; - case 12: - *animation = 532; - var_45CD74_animation_frame++; - if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(532)) { - *animation = 529; - var_45CD70_animation_state = 0; - var_45CD74_animation_frame = 0; - var_45CD78 = 0; - Actor_Change_Animation_Mode(15, 0); - } - *frame = var_45CD74_animation_frame; - break; - case 11: - *animation = 541; - if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(541)) { - var_45CD74_animation_frame = 0; - if (var_45CD88) { - *animation = 529; - var_45CD70_animation_state = 0; - var_45CD78 = 0; - } else { - *animation = 533; - var_45CD70_animation_state = 2; - } - } - *frame = var_45CD74_animation_frame; - break; - case 10: - *animation = 540; - var_45CD74_animation_frame++; - if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(540)) { - var_45CD74_animation_frame = 0; - if (var_45CD88) { - *animation = 529; - var_45CD70_animation_state = 0; - var_45CD78 = 0; - } else { - *animation = 533; - var_45CD70_animation_state = 2; - } - } - *frame = var_45CD74_animation_frame; - break; - case 9: - *animation = 539; - var_45CD74_animation_frame++; - if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(539)) { - var_45CD74_animation_frame = 0; - if (var_45CD88) { - *animation = 529; - var_45CD70_animation_state = 0; - var_45CD78 = 0; - } else { - *animation = 533; - var_45CD70_animation_state = 2; - } - } - *frame = var_45CD74_animation_frame; - break; - case 8: - *animation = 538; - var_45CD74_animation_frame++; - if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(538)) { - var_45CD74_animation_frame = 0; - if (var_45CD88) { - *animation = 529; - var_45CD70_animation_state = 0; - var_45CD78 = 0; - } else { - *animation = 533; - var_45CD70_animation_state = 2; - } - } - *frame = var_45CD74_animation_frame; - break; - case 7: - *animation = 537; - var_45CD74_animation_frame++; - if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(537)) { - var_45CD74_animation_frame = 0; - if (var_45CD88) { - *animation = 529; - var_45CD70_animation_state = 0; - var_45CD78 = 0; - } else { - *animation = 533; - var_45CD70_animation_state = 2; - } - } - *frame = var_45CD74_animation_frame; - break; - case 6: - *animation = 536; - var_45CD74_animation_frame++; - if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(536)) { - var_45CD74_animation_frame = 0; - if (var_45CD88) { - *animation = 529; - var_45CD70_animation_state = 0; - var_45CD78 = 0; - } else { - *animation = 533; - var_45CD70_animation_state = 2; - } - } - *frame = var_45CD74_animation_frame; - break; - case 5: - *animation = 535; - var_45CD74_animation_frame++; - if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(535)) { - var_45CD74_animation_frame = 0; - if (var_45CD88) { - *animation = 529; - var_45CD70_animation_state = 0; - var_45CD78 = 0; - } else { - *animation = 533; - var_45CD70_animation_state = 2; - } - } - *frame = var_45CD74_animation_frame; - break; - case 4: - *animation = 534; - var_45CD74_animation_frame++; - if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(534)) { - var_45CD74_animation_frame = 0; - if (var_45CD88) { - *animation = 529; - var_45CD70_animation_state = 0; - var_45CD78 = 0; - } else { - *animation = 533; - var_45CD70_animation_state = 2; - } - } - *frame = var_45CD74_animation_frame; - break; - case 2: - *animation = 533; - var_45CD74_animation_frame++; - if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(533)) { - var_45CD74_animation_frame = 0; - if (var_45CD88) { - *animation = 529; - var_45CD70_animation_state = 0; - var_45CD78 = 0; - } else { - var_45CD70_animation_state = 4; - } - } - *frame = var_45CD74_animation_frame; - break; - case 1: - *animation = 526; - var_45CD74_animation_frame++; - if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(526)) { - var_45CD74_animation_frame = 0; - } - *frame = var_45CD74_animation_frame; - break; - case 0: - if (var_45CD78 == 0) { - *animation = 529; - if (var_45CD84) { - var_45CD84--; - } else { - var_45CD74_animation_frame += var_45CD80; - if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(529)) { - var_45CD74_animation_frame = 0; - } - if (var_45CD74_animation_frame < 0) { - var_45CD74_animation_frame = Slice_Animation_Query_Number_Of_Frames(529) - 1; - } - --var_45CD7C; - if (var_45CD7C == 0) { - var_45CD80 = 2 * Random_Query(0, 1) - 1; - var_45CD7C = Random_Query(6, 14); - var_45CD84 = Random_Query(0, 4); - } - if (var_45CD74_animation_frame == 0) { - if (Random_Query(0, 1) == 1) { - var_45CD78 = Random_Query(1, 2); - var_45CD80 = 1; - var_45CD84 = 0; - } - } - } - } else if (var_45CD78 == 1) { - *animation = 530; - var_45CD74_animation_frame++; - if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(530)) { - var_45CD74_animation_frame = 0; - var_45CD78 = 0; - *animation = 529; - var_45CD7C = Random_Query(6, 14); - var_45CD80 = 2 * Random_Query(0, 1) - 1; - } - } else if (var_45CD78 == 2) { - *animation = 531; - if (var_45CD84) { - var_45CD84--; - } else { - var_45CD74_animation_frame += var_45CD80; - if (var_45CD74_animation_frame >= Slice_Animation_Query_Number_Of_Frames(*animation) - 1) { - var_45CD84 = Random_Query(5, 15); - var_45CD80 = -1; - } - if (var_45CD74_animation_frame <= 0) { - var_45CD74_animation_frame = 0; - var_45CD78 = 0; - *animation = 529; - var_45CD7C = Random_Query(6, 14); - var_45CD80 = 2 * Random_Query(0, 1) - 1; - } - } - } - *frame = var_45CD74_animation_frame; - break; - default: - *animation = 399; - var_45CD74_animation_frame = 0; - *frame = var_45CD74_animation_frame; - break; - } - return true; -} - -bool AIScript_Runciter::ChangeAnimationMode(int mode) { - - switch (mode) { - case 23: - var_45CD70_animation_state = 12; - var_45CD74_animation_frame = 0; - break; - case 19: - if (var_45CD70_animation_state) { - var_45CD70_animation_state = 2; - var_45CD74_animation_frame = 0; - } else { - var_45CD70_animation_state = 13; - var_462800 = 11; - var_462804 = 541; - } - var_45CD88 = 0; - break; - case 18: - if (var_45CD70_animation_state) { - var_45CD70_animation_state = 2; - var_45CD74_animation_frame = 0; - } else { - var_45CD70_animation_state = 13; - var_462800 = 10; - var_462804 = 540; - } - var_45CD88 = 0; - break; - case 17: - if (var_45CD70_animation_state) { - var_45CD70_animation_state = 2; - var_45CD74_animation_frame = 0; - } else { - var_45CD70_animation_state = 13; - var_462800 = 9; - var_462804 = 539; - } - var_45CD88 = 0; - break; - case 16: - if (var_45CD70_animation_state) { - var_45CD70_animation_state = 2; - var_45CD74_animation_frame = 0; - } else { - var_45CD70_animation_state = 13; - var_462800 = 8; - var_462804 = 538; - } - var_45CD88 = 0; - break; - case 15: - if (var_45CD70_animation_state) { - var_45CD70_animation_state = 2; - var_45CD74_animation_frame = 0; - } else { - var_45CD70_animation_state = 13; - var_462800 = 7; - var_462804 = 537; - } - var_45CD88 = 0; - break; - case 14: - if (var_45CD70_animation_state) { - var_45CD70_animation_state = 2; - var_45CD74_animation_frame = 0; - } else { - var_45CD70_animation_state = 13; - var_462800 = 6; - var_462804 = 536; - } - var_45CD88 = 0; - break; - case 13: - if (var_45CD70_animation_state) { - var_45CD70_animation_state = 2; - var_45CD74_animation_frame = 0; - } else { - var_45CD70_animation_state = 13; - var_462800 = 5; - var_462804 = 535; - } - var_45CD88 = 0; - break; - case 12: - if (var_45CD70_animation_state) { - var_45CD70_animation_state = 2; - var_45CD74_animation_frame = 0; - } else { - var_45CD70_animation_state = 13; - var_462800 = 4; - var_462804 = 534; - } - var_45CD88 = 0; - break; - case 3: - if (var_45CD70_animation_state) { - var_45CD70_animation_state = 2; - var_45CD74_animation_frame = 0; - } else { - var_45CD70_animation_state = 13; - var_462800 = 2; - var_462804 = 526; - } - var_45CD88 = 0; - break; - case 1: - if (var_45CD70_animation_state > 1) { - var_45CD70_animation_state = 1; - var_45CD74_animation_frame = 0; - } else if (!var_45CD70_animation_state) { - var_45CD70_animation_state = 13; - var_462800 = 1; - var_462804 = 526; - } - break; - case 0: - if (var_45CD70_animation_state >= 2 && var_45CD70_animation_state <= 11) { - var_45CD88 = 1; - } else { - var_45CD70_animation_state = 0; - var_45CD74_animation_frame = 0; - var_45CD78 = 0; - } - break; - case 2: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 20: - case 21: - case 22: - break; - default: - if (mode == 48) { - var_45CD70_animation_state = 14; - var_45CD74_animation_frame = 0; - } - break; - } - return true; -} - -void AIScript_Runciter::QueryAnimationState(int *animationState, int *animationFrame, int *a3, int *a4) { - *animationState = var_45CD70_animation_state; - *animationFrame = var_45CD74_animation_frame; - *a3 = var_462800; - *a4 = var_462804; -} - -void AIScript_Runciter::SetAnimationState(int animationState, int animationFrame, int a3, int a4) { - var_45CD70_animation_state = animationState; - var_45CD74_animation_frame = animationFrame; - var_462800 = a3; - var_462804 = a4; -} - -bool AIScript_Runciter::ReachedMovementTrackWaypoint(int waypointId) { - switch (waypointId) { - case 93: - Actor_Face_Heading(15, 1002, true); - break; - case 92: - Actor_Face_Heading(15, 664, true); - break; - case 91: - Actor_Face_Heading(15, 120, true); - break; - case 90: - Actor_Face_Heading(15, 170, true); - break; - case 89: - Actor_Face_Heading(15, 567, true); - break; - default: - return true; - } - return true; -} - -void AIScript_Runciter::FledCombat() {} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ai_15_runciter.h b/engines/bladerunner/script/ai_15_runciter.h deleted file mode 100644 index b2cb70d2f8..0000000000 --- a/engines/bladerunner/script/ai_15_runciter.h +++ /dev/null @@ -1,65 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -#include "bladerunner/bladerunner.h" - -namespace BladeRunner { - -class AIScript_Runciter : public AIScriptBase { - int var_45CD70_animation_state; - int var_45CD74_animation_frame; - int var_462800; - int var_462804; - int var_45CD78; - int var_45CD7C; - int var_45CD80; - int var_45CD84; - int var_45CD88; -public: - AIScript_Runciter(BladeRunnerEngine *vm); - - void Initialize(); - bool Update(); - void TimerExpired(int timer); - void CompletedMovementTrack(); - void ReceivedClue(int clueId, int fromActorId); - void ClickedByPlayer(); - void EnteredScene(int sceneId); - void OtherAgentEnteredThisScene(int otherActorId); - void OtherAgentExitedThisScene(int otherActorId); - void OtherAgentEnteredCombatMode(int otherActorId, int combatMode); - void ShotAtAndMissed(); - void ShotAtAndHit(); - void Retired(int byActorId); - int GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId); - bool GoalChanged(int currentGoalNumber, int newGoalNumber); - bool UpdateAnimation(int *animation, int *frame); - bool ChangeAnimationMode(int mode); - void QueryAnimationState(int *animationState, int *animationFrame, int *a3, int *a4); - void SetAnimationState(int animationState, int animationFrame, int a3, int a4); - bool ReachedMovementTrackWaypoint(int a1); - void FledCombat(); -}; - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ai_23_officer_leroy.cpp b/engines/bladerunner/script/ai_23_officer_leroy.cpp deleted file mode 100644 index 8f97466a8a..0000000000 --- a/engines/bladerunner/script/ai_23_officer_leroy.cpp +++ /dev/null @@ -1,1217 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/ai_23_officer_leroy.h" - -namespace BladeRunner { - -AIScript_Officer_Leroy::AIScript_Officer_Leroy(BladeRunnerEngine *vm) - : AIScriptBase(vm), var_45D5B0_animation_state(0), var_45D5B4_animation_frame(0), var_45D5B8(0), var_45D5BC(0), var_462880(0), var_462884(0) {} - -void AIScript_Officer_Leroy::Initialize() { - var_45D5B0_animation_state = 0; - var_45D5B4_animation_frame = 0; - var_462880 = 0; - var_45D5B8 = 0; - var_45D5BC = 0; - - Actor_Put_In_Set(23, 69); - Actor_Set_At_XYZ(23, -261.80f, 6.00f, 79.58f, 512); - Actor_Set_Goal_Number(23, 0); - Actor_Set_Frame_Rate_FPS(23, 8); -} - -bool AIScript_Officer_Leroy::Update() { - if (Global_Variable_Query(1) == 4 && Actor_Query_Goal_Number(23) < 300) { - AI_Movement_Track_Flush(23); - Actor_Set_Goal_Number(23, 300); - } else if (Global_Variable_Query(1) == 5 && Actor_Query_Goal_Number(23) < 400) { - AI_Movement_Track_Flush(23); - Actor_Set_Goal_Number(23, 400); - } else if (!Game_Flag_Query(182) && Game_Flag_Query(147) == 1 && Game_Flag_Query(163) == 1 && Player_Query_Current_Scene() != 78 && Global_Variable_Query(1) < 3) { - Game_Flag_Set(186); - Actor_Set_Goal_Number(23, 3); - } else if (Actor_Query_Goal_Number(23) != 1 && Actor_Query_Goal_Number(23) != 2 && Game_Flag_Query(199) == 1) { - Game_Flag_Reset(199); - } else if (Global_Variable_Query(15) > 4 && !Actor_Clue_Query(23, 239)) { - Actor_Clue_Acquire(23, 239, 1, -1); - } else if (Game_Flag_Query(629) == 1) { - Game_Flag_Reset(629); - } else if (Game_Flag_Query(623) == 1 && !Game_Flag_Query(664)) { - Game_Flag_Set(664); - Actor_Set_Goal_Number(23, 305); - } else if (Actor_Query_Goal_Number(23) == 310 && Actor_Query_Which_Set_In(23) != Player_Query_Current_Set()) { - Non_Player_Actor_Combat_Mode_Off(23); - Actor_Set_Goal_Number(23, 305); - } else if (Actor_Query_Goal_Number(23) == 599 && Actor_Query_Which_Set_In(23) != Player_Query_Current_Set()) { - Actor_Set_Health(23, 40, 40); - Actor_Set_Goal_Number(23, 305); - } else if (Actor_Query_Goal_Number(23) == 305) { - switch (Actor_Query_Which_Set_In(23)) { - case 7: - if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) { - Actor_Set_Goal_Number(23, 310); - Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 0, 4, 7, 8, -1, -1, -1, 10, 300, 0); - } - break; - case 20: - if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) { - Actor_Set_Goal_Number(23, 310); - Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 1, 4, 7, 8, -1, -1, -1, 10, 300, 0); - } - break; - case 33: - if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) { - Actor_Set_Goal_Number(23, 310); - Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 5, 4, 7, 8, -1, -1, -1, 10, 300, 0); - } - break; - case 53: - if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) { - Actor_Set_Goal_Number(23, 310); - Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 7, 4, 7, 8, -1, -1, -1, 10, 300, 0); - } - break; - case 54: - if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) { - Actor_Set_Goal_Number(23, 310); - Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 3, 4, 7, 8, -1, -1, -1, 10, 300, 0); - } - break; - case 70: - if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) { - Actor_Set_Goal_Number(23, 310); - Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 18, 4, 7, 8, -1, -1, -1, 10, 300, 0); - } - break; - case 74: - if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) { - Actor_Set_Goal_Number(23, 310); - Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 11, 4, 7, 8, -1, -1, -1, 10, 300, 0); - } - break; - case 77: - case 78: - case 79: - if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) { - Actor_Set_Goal_Number(23, 310); - Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 10, 4, 7, 8, -1, -1, -1, 10, 300, 0); - } - break; - case 81: - if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) { - Actor_Set_Goal_Number(23, 310); - Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 13, 4, 7, 8, -1, -1, -1, 10, 300, 0); - } - break; - case 83: - if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) { - Actor_Set_Goal_Number(23, 310); - Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 14, 4, 7, 8, -1, -1, -1, 10, 300, 0); - } - break; - case 84: - if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) { - Actor_Set_Goal_Number(23, 310); - Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 16, 4, 7, 8, -1, -1, -1, 10, 300, 0); - } - break; - case 86: - if (Actor_Query_Which_Set_In(23) == Player_Query_Current_Set()) { - Actor_Set_Goal_Number(23, 310); - Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 17, 4, 7, 8, -1, -1, -1, 10, 300, 0); - } - break; - } - } - return false; -} - -void AIScript_Officer_Leroy::TimerExpired(int timer) { - if (timer == 1) { - AI_Countdown_Timer_Reset(23, 1); - if (Actor_Query_In_Set(0, 41)) { - Actor_Set_Goal_Number(23, 430); - Actor_Set_Goal_Number(24, 430); - } else { - Game_Flag_Set(684); - } - } else if (timer == 2) { - AI_Countdown_Timer_Reset(23, 2); - sub_431420(); - } -} - -void AIScript_Officer_Leroy::CompletedMovementTrack() { - int v0; - unsigned int v1; - - v0 = Actor_Query_Goal_Number(23); - if (v0 == 1) { - Actor_Set_Goal_Number(23, 2); - return; - } - //todo: tidyup - v1 = v0 - 305; - if (v1 > 3) { - return; - } - if (!v1) { - Actor_Set_Goal_Number(23, 306); - return; - } - if (v1 != 2) { - if (v1 == 3) { - Actor_Change_Animation_Mode(23, 4); - Actor_Face_Actor(23, 0, true); - Actor_Set_Goal_Number(23, 309); - } - return; - } - Non_Player_Actor_Combat_Mode_On(23, 0, 1, 0, 12, 4, 7, 8, 0, -1, -1, 15, 300, 0); -} - -void AIScript_Officer_Leroy::ReceivedClue(int clueId, int fromActorId) { - if (clueId == 222) { - Actor_Modify_Friendliness_To_Other(23, 0, 5); - } - if (clueId == 215) { - Actor_Modify_Friendliness_To_Other(23, 0, -4); - } -} - -void AIScript_Officer_Leroy::ClickedByPlayer() {} - -void AIScript_Officer_Leroy::EnteredScene(int sceneId) {} - -void AIScript_Officer_Leroy::OtherAgentEnteredThisScene(int otherActorId) {} - -void AIScript_Officer_Leroy::OtherAgentExitedThisScene(int otherActorId) {} - -void AIScript_Officer_Leroy::OtherAgentEnteredCombatMode(int otherActorId, int combatMode) {} - -void AIScript_Officer_Leroy::ShotAtAndMissed() {} - -void AIScript_Officer_Leroy::ShotAtAndHit() { - if (Actor_Query_Goal_Number(23) == 307) { - Actor_Set_Health(23, 50, 50); - } -} - -void AIScript_Officer_Leroy::Retired(int byActorId) { - Actor_Set_Goal_Number(23, 599); - Game_Flag_Set(607); -} - -int AIScript_Officer_Leroy::GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId) { - if (otherActorId) { - return 0; - } - switch (clueId) { - case 242: - return -6; - case 240: - return -2; - case 239: - return -5; - case 228: - return 2; - case 227: - return 4; - case 226: - return 4; - case 225: - return 3; - case 224: - return 3; - case 223: - return 2; - case 222: - return 3; - case 215: - return -5; - } - return 0; -} - -bool AIScript_Officer_Leroy::GoalChanged(int currentGoalNumber, int newGoalNumber) { - switch (newGoalNumber) { - case 1: - AI_Movement_Track_Flush(23); - if (Random_Query(1, 2) == 1) { - AI_Movement_Track_Append(23, 57, 7); - AI_Movement_Track_Append(23, 58, 7); - } else { - AI_Movement_Track_Append(23, 58, 7); - AI_Movement_Track_Append(23, 57, 7); - } - AI_Movement_Track_Repeat(23); - return true; - case 2: - if (Random_Query(1, 3) == 1) { - if (Random_Query(1, 2) == 1 && !Actor_Clue_Query(23, 16)) { - Actor_Clue_Acquire(23, 16, 0, -1); - } else if (!Actor_Clue_Query(23, 17)) { - Actor_Clue_Acquire(23, 17, 0, -1); - } - } - if (Game_Flag_Query(182)) { - if (Actor_Clue_Query(23, 16) && Actor_Clue_Query(23, 17)) { - Actor_Set_Goal_Number(23, 0); - } else { - Actor_Set_Goal_Number(23, 1); - } - } else { - Actor_Set_Goal_Number(23, 0); - } - return true; - case 3: - AI_Movement_Track_Flush(23); - AI_Movement_Track_Append(23, 39, Random_Query(120, 240)); - AI_Movement_Track_Append(23, 35, 0); - AI_Movement_Track_Repeat(23); - return true; - case 99: - AI_Movement_Track_Flush(23); - return false; - case 102: - AI_Movement_Track_Flush(23); - AI_Movement_Track_Append(23, 107, 0); - AI_Movement_Track_Append(23, 108, 0); - AI_Movement_Track_Repeat(23); - return true; - case 300: - Actor_Set_Goal_Number(23, 305); - return true; - case 305: - AI_Movement_Track_Flush(23); - switch (Random_Query(1, 10)) { - case 1: - AI_Movement_Track_Append(23, 398, 15); - AI_Movement_Track_Append(23, 399, 0); - AI_Movement_Track_Append(23, 400, 0); - AI_Movement_Track_Append(23, 401, 0); - AI_Movement_Track_Append_With_Facing(23, 402, 3, 276); - AI_Movement_Track_Append(23, 403, 0); - AI_Movement_Track_Append(23, 404, 15); - AI_Movement_Track_Repeat(23); - break; - case 2: - AI_Movement_Track_Append(23, 385, 10); - AI_Movement_Track_Append(23, 242, 2); - AI_Movement_Track_Append(23, 386, 2); - AI_Movement_Track_Append(23, 387, 15); - AI_Movement_Track_Repeat(23); - break; - case 3: - AI_Movement_Track_Append(23, 390, 10); - AI_Movement_Track_Append(23, 391, 0); - AI_Movement_Track_Append(23, 392, 5); - AI_Movement_Track_Append(23, 345, 0); - AI_Movement_Track_Append(23, 393, 15); - AI_Movement_Track_Repeat(23); - break; - case 4: - AI_Movement_Track_Append(23, 381, 15); - AI_Movement_Track_Append(23, 382, 0); - AI_Movement_Track_Append(23, 383, 15); - AI_Movement_Track_Append(23, 382, 3); - AI_Movement_Track_Append(23, 384, 0); - AI_Movement_Track_Append(23, 35, 30); - AI_Movement_Track_Repeat(23); - break; - case 5: - AI_Movement_Track_Append(23, 388, 10); - AI_Movement_Track_Append(23, 389, 10); - AI_Movement_Track_Append(23, 35, 30); - AI_Movement_Track_Repeat(23); - break; - case 6: - AI_Movement_Track_Append(23, 385, 10); - AI_Movement_Track_Append(23, 242, 2); - AI_Movement_Track_Append(23, 386, 2); - AI_Movement_Track_Append(23, 387, 15); - AI_Movement_Track_Repeat(23); - break; - case 7: - AI_Movement_Track_Append(23, 394, 15); - AI_Movement_Track_Append(23, 395, 0); - AI_Movement_Track_Append(23, 396, 0); - AI_Movement_Track_Append(23, 397, 15); - AI_Movement_Track_Append(23, 396, 0); - AI_Movement_Track_Append(23, 395, 0); - AI_Movement_Track_Append(23, 430, 15); - AI_Movement_Track_Append(23, 35, 30); - AI_Movement_Track_Repeat(23); - break; - case 8: - switch (Random_Query(1, 7)) { - case 1: - AI_Movement_Track_Append(23, 302, 0); - AI_Movement_Track_Append(23, 407, 0); - AI_Movement_Track_Append(23, 408, 0); - AI_Movement_Track_Append(23, 35, 30); - AI_Movement_Track_Repeat(23); - break; - case 2: - AI_Movement_Track_Append(23, 536, 0); - AI_Movement_Track_Append(23, 537, 0); - AI_Movement_Track_Append(23, 538, 1); - AI_Movement_Track_Append(23, 537, 0); - AI_Movement_Track_Append(23, 536, 0); - AI_Movement_Track_Repeat(23); - break; - case 3: - AI_Movement_Track_Append(23, 296, 10); - AI_Movement_Track_Append(23, 409, 2); - AI_Movement_Track_Append(23, 296, 10); - AI_Movement_Track_Append(23, 35, 30); - AI_Movement_Track_Repeat(23); - break; - case 4: - AI_Movement_Track_Append(23, 411, 10); - AI_Movement_Track_Append(23, 412, 5); - AI_Movement_Track_Append(23, 411, 0); - AI_Movement_Track_Append(23, 35, 30); - AI_Movement_Track_Repeat(23); - break; - case 5: - AI_Movement_Track_Append(23, 413, 10); - AI_Movement_Track_Append(23, 414, 0); - AI_Movement_Track_Append_With_Facing(23, 431, 0, 1017); - AI_Movement_Track_Append(23, 432, 10); - AI_Movement_Track_Append(23, 35, 30); - AI_Movement_Track_Repeat(23); - break; - case 6: - AI_Movement_Track_Append(23, 415, 0); - AI_Movement_Track_Append_With_Facing(23, 416, 0, 620); - AI_Movement_Track_Append(23, 417, 0); - AI_Movement_Track_Append(23, 418, 0); - AI_Movement_Track_Append(23, 35, 30); - AI_Movement_Track_Repeat(23); - break; - case 7: - AI_Movement_Track_Append(23, 405, 10); - AI_Movement_Track_Append(23, 406, 0); - AI_Movement_Track_Append(23, 35, 30); - AI_Movement_Track_Repeat(23); - return false; - default: - return false; - } - //no break - case 9: - if (Random_Query(1, 2) - 1 == 1) { - AI_Movement_Track_Append(23, 433, 10); - AI_Movement_Track_Append(23, 434, 0); - AI_Movement_Track_Append(23, 435, 0); - AI_Movement_Track_Append(23, 35, 30); - AI_Movement_Track_Repeat(23); - return false; - } - AI_Movement_Track_Append(23, 420, 10); - AI_Movement_Track_Append(23, 422, 2); - AI_Movement_Track_Append(23, 421, 1); - AI_Movement_Track_Append_With_Facing(23, 422, 4, 182); - AI_Movement_Track_Append(23, 420, 10); - AI_Movement_Track_Append(23, 35, 30); - AI_Movement_Track_Repeat(23); - //no break - case 10: - AI_Movement_Track_Append(23, 310, 0); - AI_Movement_Track_Append(23, 307, 0); - AI_Movement_Track_Append(23, 309, 0); - AI_Movement_Track_Append(23, 310, 0); - AI_Movement_Track_Append(23, 35, 30); - AI_Movement_Track_Repeat(23); - return false; - default: - return false; - } - //no break - case 306: - Actor_Set_Goal_Number(23, 305); - return true; - case 307: - AI_Movement_Track_Flush(23); - AI_Movement_Track_Append_With_Facing(23, 416, 0, 556); - Actor_Change_Animation_Mode(23, 4); - AI_Movement_Track_Repeat(23); - return true; - case 308: - AI_Movement_Track_Flush(23); - AI_Movement_Track_Append_Run_With_Facing(23, 440, 2, 355); - AI_Movement_Track_Append_Run_With_Facing(23, 441, 0, 825); - AI_Movement_Track_Repeat(23); - return true; - case 400: - AI_Movement_Track_Flush(23); - AI_Movement_Track_Append(23, 35, 0); - AI_Movement_Track_Repeat(23); - Actor_Set_Goal_Number(23, 410); - return true; - case 420: - AI_Countdown_Timer_Reset(23, 1); - AI_Countdown_Timer_Start(23, 1, 120); - Actor_Set_Goal_Number(23, 410); - return true; - case 425: - AI_Countdown_Timer_Reset(23, 1); - AI_Countdown_Timer_Start(23, 1, 60); - Actor_Set_Goal_Number(23, 410); - return true; - case 430: - Actor_Set_Goal_Number(23, 410); - Actor_Set_Goal_Number(24, 410); - return false; - default: - return false; - } -} - -bool AIScript_Officer_Leroy::UpdateAnimation(int *animation, int *frame) { - int v57; - int a1; - - switch (var_45D5B0_animation_state) { - case 32: - *animation = 603; - var_45D5B4_animation_frame++; - if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(603)) { - *animation = 589; - var_45D5B0_animation_state = 0; - var_45D5B8 = 0; - var_45D5B4_animation_frame = 0; - } - *frame = var_45D5B4_animation_frame; - return true; - case 31: - *animation = 604; - var_45D5B4_animation_frame++; - if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(604)) { - *animation = 601; - var_45D5B0_animation_state = 1; - var_45D5B4_animation_frame = 0; - } - *frame = var_45D5B4_animation_frame; - return true; - case 30: - *animation = 587; - var_45D5B4_animation_frame++; - if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(587)) { - *animation = 589; - var_45D5B0_animation_state = 0; - var_45D5B4_animation_frame = 0; - Actor_Change_Animation_Mode(23, 0); - } - *frame = var_45D5B4_animation_frame; - return true; - case 29: - *animation = 586; - var_45D5B4_animation_frame++; - if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(586)) { - *animation = 589; - var_45D5B0_animation_state = 0; - var_45D5B4_animation_frame = 0; - Actor_Change_Animation_Mode(23, 0); - } - *frame = var_45D5B4_animation_frame; - return true; - case 28: - *animation = 576; - if (var_45D5B4_animation_frame < Slice_Animation_Query_Number_Of_Frames(576) - 1) { - ++var_45D5B4_animation_frame; - } - *frame = var_45D5B4_animation_frame; - return true; - case 27: - *animation = 588; - if (var_45D5B4_animation_frame < Slice_Animation_Query_Number_Of_Frames(588) - 1) { - ++var_45D5B4_animation_frame; - } - *frame = var_45D5B4_animation_frame; - return true; - case 26: - *animation = 573; - var_45D5B4_animation_frame++; - if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(573)) { - var_45D5B0_animation_state = 21; - var_45D5B4_animation_frame = 0; - *animation = 571; - Actor_Change_Animation_Mode(23, 4); - } - *frame = var_45D5B4_animation_frame; - return true; - case 25: - *animation = 572; - var_45D5B4_animation_frame++; - if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(572)) { - var_45D5B0_animation_state = 21; - var_45D5B4_animation_frame = 0; - *animation = 571; - Actor_Change_Animation_Mode(23, 4); - } - *frame = var_45D5B4_animation_frame; - return true; - case 24: - *animation = 581; - var_45D5B4_animation_frame++; - if (var_45D5B4_animation_frame == 4) { - if (Random_Query(1, 2) == 1) { - Sound_Play_Speech_Line(23, 9010, 75, 0, 99); - } else { - Sound_Play_Speech_Line(23, 9015, 75, 0, 99); - } - } - if (var_45D5B4_animation_frame == 5) { - Actor_Combat_AI_Hit_Attempt(23); - } - if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(581)) { - var_45D5B0_animation_state = 21; - var_45D5B4_animation_frame = 0; - *animation = 571; - Actor_Change_Animation_Mode(23, 4); - } - *frame = var_45D5B4_animation_frame; - return true; - case 23: - *animation = 580; - var_45D5B4_animation_frame++; - if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(580)) { - *animation = 589; - var_45D5B0_animation_state = 0; - var_45D5B4_animation_frame = 0; - } - *frame = var_45D5B4_animation_frame; - return true; - case 22: - *animation = 579; - var_45D5B4_animation_frame++; - if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(579)) { - var_45D5B0_animation_state = 21; - var_45D5B4_animation_frame = 0; - *animation = 571; - } - *frame = var_45D5B4_animation_frame; - return true; - case 21: - *animation = 571; - var_45D5B4_animation_frame++; - if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(571)) { - var_45D5B4_animation_frame = 0; - } - *frame = var_45D5B4_animation_frame; - return true; - case 20: - *animation = 571; - var_45D5B4_animation_frame++; - if (var_45D5B4_animation_frame > Slice_Animation_Query_Number_Of_Frames(571) - 1) { - var_45D5B4_animation_frame = 0; - } - *frame = var_45D5B4_animation_frame; - return true; - case 19: - *animation = 600; - var_45D5B4_animation_frame++; - if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(600)) { - var_45D5B0_animation_state = 11; - var_45D5B4_animation_frame = 0; - *animation = 592; - } - *frame = var_45D5B4_animation_frame; - return true; - case 18: - *animation = 599; - var_45D5B4_animation_frame++; - if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(599)) { - var_45D5B0_animation_state = 11; - var_45D5B4_animation_frame = 0; - *animation = 592; - } - *frame = var_45D5B4_animation_frame; - return true; - case 17: - *animation = 598; - var_45D5B4_animation_frame++; - if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(598)) { - var_45D5B0_animation_state = 11; - var_45D5B4_animation_frame = 0; - *animation = 592; - } - *frame = var_45D5B4_animation_frame; - return true; - case 16: - *animation = 597; - var_45D5B4_animation_frame++; - if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(597)) { - var_45D5B0_animation_state = 11; - var_45D5B4_animation_frame = 0; - *animation = 592; - } - *frame = var_45D5B4_animation_frame; - return true; - case 15: - *animation = 596; - var_45D5B4_animation_frame++; - if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(596)) { - var_45D5B0_animation_state = 11; - var_45D5B4_animation_frame = 0; - *animation = 592; - } - *frame = var_45D5B4_animation_frame; - return true; - case 14: - *animation = 595; - var_45D5B4_animation_frame++; - if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(595)) { - var_45D5B0_animation_state = 11; - var_45D5B4_animation_frame = 0; - *animation = 592; - } - *frame = var_45D5B4_animation_frame; - return true; - case 13: - *animation = 594; - var_45D5B4_animation_frame++; - if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(594)) { - var_45D5B0_animation_state = 11; - var_45D5B4_animation_frame = 0; - *animation = 592; - } - *frame = var_45D5B4_animation_frame; - return true; - case 12: - *animation = 593; - var_45D5B4_animation_frame++; - if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(593)) { - var_45D5B0_animation_state = 11; - var_45D5B4_animation_frame = 0; - *animation = 592; - } - *frame = var_45D5B4_animation_frame; - return true; - case 11: - if (var_45D5BC && var_45D5B4_animation_frame <= 2) { - var_45D5BC = 0; - var_45D5B0_animation_state = 0; - var_45D5B4_animation_frame = 0; - *animation = 589; - var_45D5B8 = Random_Query(0, 1); - *frame = var_45D5B4_animation_frame; - return true; - } - - *animation = 592; - var_45D5B4_animation_frame++; - if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(592)) { - var_45D5B4_animation_frame = 0; - if (var_45D5BC) { - var_45D5BC = 0; - var_45D5B0_animation_state = 0; - var_45D5B4_animation_frame = 0; - *animation = 589; - var_45D5B8 = Random_Query(0, 1); - } else { - var_45D5B0_animation_state = Random_Query(0, 8) + 11; - } - var_45D5B4_animation_frame = 0; - } - *frame = var_45D5B4_animation_frame; - return true; - case 10: - *animation = 578; - var_45D5B4_animation_frame++; - if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(578)) { - var_45D5B4_animation_frame = 0; - } - *frame = var_45D5B4_animation_frame; - return true; - case 9: - *animation = 577; - var_45D5B4_animation_frame++; - if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(577)) { - var_45D5B4_animation_frame = 0; - } - *frame = var_45D5B4_animation_frame; - return true; - case 8: - *animation = 575; - var_45D5B4_animation_frame++; - if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(575)) { - var_45D5B4_animation_frame = 0; - } - *frame = var_45D5B4_animation_frame; - return true; - case 7: - *animation = 574; - var_45D5B4_animation_frame++; - if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(574)) { - var_45D5B4_animation_frame = 0; - } - *frame = var_45D5B4_animation_frame; - return true; - case 6: - *animation = 585; - var_45D5B4_animation_frame++; - if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(585)) { - var_45D5B4_animation_frame = 0; - } - *frame = var_45D5B4_animation_frame; - return true; - case 5: - *animation = 584; - var_45D5B4_animation_frame++; - if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(584)) { - var_45D5B4_animation_frame = 0; - } - *frame = var_45D5B4_animation_frame; - return true; - case 4: - *animation = 583; - var_45D5B4_animation_frame++; - if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(583)) { - var_45D5B4_animation_frame = 0; - } - *frame = var_45D5B4_animation_frame; - return true; - case 3: - *animation = 582; - var_45D5B4_animation_frame++; - if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(582)) { - var_45D5B4_animation_frame = 0; - } - *frame = var_45D5B4_animation_frame; - return true; - case 2: - if (Game_Flag_Query(199)) { - *animation = 603; - var_45D5B4_animation_frame++; - if (var_45D5B4_animation_frame > Slice_Animation_Query_Number_Of_Frames(603) - 1) { - Game_Flag_Reset(199); - var_45D5B4_animation_frame = 0; - var_45D5B0_animation_state = var_462880; - *animation = var_462884; - } - } else { - if (var_45D5B8 == 0) { - *animation = 589; - } - if (var_45D5B8 == 1) { - *animation = 590; - } - if (var_45D5B8 == 2) { - *animation = 591; - } - if (var_45D5B4_animation_frame > Slice_Animation_Query_Number_Of_Frames(*animation) / 2) { - a1 = *animation; - var_45D5B4_animation_frame += 3; - v57 = var_45D5B4_animation_frame; - if (v57 > Slice_Animation_Query_Number_Of_Frames(a1) - 1) { - var_45D5B4_animation_frame = 0; - var_45D5B0_animation_state = var_462880; - *animation = var_462884; - } - } else { - var_45D5B4_animation_frame -= 3; - if (var_45D5B4_animation_frame < 0) { - var_45D5B4_animation_frame = 0; - var_45D5B0_animation_state = var_462880; - *animation = var_462884; - } - } - } - *frame = var_45D5B4_animation_frame; - return true; - case 1: - *animation = 601; - var_45D5B4_animation_frame++; - if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(601)) { - var_45D5B4_animation_frame = 0; - } - if (!Game_Flag_Query(199)) { - var_45D5B0_animation_state = 32; - var_45D5B4_animation_frame = 0; - *animation = 603; - } - *frame = var_45D5B4_animation_frame; - return true; - case 0: - if (Game_Flag_Query(199) && !Game_Flag_Query(392)) { - var_45D5B0_animation_state = 31; - var_45D5B4_animation_frame = 0; - *animation = 604; - } else if (var_45D5B8 == 1) { - *animation = 590; - var_45D5B4_animation_frame++; - if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(590)) { - var_45D5B8 = Random_Query(0, 2); - var_45D5B4_animation_frame = 0; - } - } else if (var_45D5B8 == 2) { - *animation = 591; - var_45D5B4_animation_frame++; - if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(591)) { - var_45D5B8 = Random_Query(0, 2); - var_45D5B4_animation_frame = 0; - } - } else if (var_45D5B8 == 0) { - *animation = 589; - var_45D5B4_animation_frame++; - if (var_45D5B4_animation_frame >= Slice_Animation_Query_Number_Of_Frames(589)) { - var_45D5B8 = Random_Query(0, 2); - var_45D5B4_animation_frame = 0; - } - } - *frame = var_45D5B4_animation_frame; - return true; - default: - *animation = 399; - *frame = var_45D5B4_animation_frame; - return true; - } -} - -bool AIScript_Officer_Leroy::ChangeAnimationMode(int mode) { - int v1; - - switch (mode) { - case 28: - Game_Flag_Set(199); - break; - case 27: - Game_Flag_Reset(199); - break; - case 22: - if (Random_Query(0, 1)) { - var_45D5B0_animation_state = 25; - } else { - var_45D5B0_animation_state = 26; - } - var_45D5B4_animation_frame = 0; - break; - case 21: - if (var_45D5B0_animation_state == 21 || var_45D5B0_animation_state == 24) { - if (Random_Query(0, 1)) { - var_45D5B0_animation_state = 25; - } else { - var_45D5B0_animation_state = 26; - } - var_45D5B4_animation_frame = 0; - } else { - if (Random_Query(0, 1)) { - var_45D5B0_animation_state = 29; - } else { - var_45D5B0_animation_state = 30; - } - var_45D5B4_animation_frame = 0; - } - break; - case 19: - if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) { - var_45D5B0_animation_state = 2; - var_462880 = 19; - var_462884 = 600; - if (Game_Flag_Query(199) == 1) { - var_45D5B4_animation_frame = 0; - } - } else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) { - var_45D5B0_animation_state = 19; - var_45D5B4_animation_frame = 0; - var_45D5BC = 0; - } - break; - case 18: - if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) { - var_45D5B0_animation_state = 2; - var_462880 = 18; - var_462884 = 599; - if (Game_Flag_Query(199) == 1) { - var_45D5B4_animation_frame = 0; - } - } else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) { - var_45D5B0_animation_state = 18; - var_45D5B4_animation_frame = 0; - var_45D5BC = 0; - } - break; - case 17: - if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) { - var_45D5B0_animation_state = 2; - var_462880 = 17; - var_462884 = 598; - if (Game_Flag_Query(199) == 1) { - var_45D5B4_animation_frame = 0; - } - } else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) { - var_45D5B0_animation_state = 17; - var_45D5B4_animation_frame = 0; - var_45D5BC = 0; - } - break; - case 16: - if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) { - var_45D5B0_animation_state = 2; - var_462880 = 16; - var_462884 = 597; - if (Game_Flag_Query(199) == 1) { - var_45D5B4_animation_frame = 0; - } - } else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) { - var_45D5B0_animation_state = 16; - var_45D5B4_animation_frame = 0; - var_45D5BC = 0; - } - break; - case 15: - if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) { - var_45D5B0_animation_state = 2; - var_462880 = 15; - var_462884 = 596; - if (Game_Flag_Query(199) == 1) { - var_45D5B4_animation_frame = 0; - } - } else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) { - var_45D5B0_animation_state = 15; - var_45D5B4_animation_frame = 0; - var_45D5BC = 0; - } - break; - case 14: - if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) { - var_45D5B0_animation_state = 2; - var_462880 = 14; - var_462884 = 595; - if (Game_Flag_Query(199) == 1) { - var_45D5B4_animation_frame = 0; - } - } else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) { - var_45D5B0_animation_state = 14; - var_45D5B4_animation_frame = 0; - var_45D5BC = 0; - } - break; - case 13: - if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) { - var_45D5B0_animation_state = 2; - var_462880 = 13; - var_462884 = 594; - if (Game_Flag_Query(199) == 1) { - var_45D5B4_animation_frame = 0; - } - } else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) { - var_45D5B0_animation_state = 13; - var_45D5B4_animation_frame = 0; - var_45D5BC = 0; - } - break; - case 12: - if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) { - var_45D5B0_animation_state = 2; - var_462880 = 12; - var_462884 = 593; - if (Game_Flag_Query(199) == 1) { - var_45D5B4_animation_frame = 0; - } - } else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) { - var_45D5B0_animation_state = 12; - var_45D5B4_animation_frame = 0; - var_45D5BC = 0; - } - break; - case 8: - var_45D5B0_animation_state = 8; - var_45D5B4_animation_frame = 0; - break; - case 7: - var_45D5B0_animation_state = 7; - var_45D5B4_animation_frame = 0; - break; - case 6: - var_45D5B0_animation_state = 24; - var_45D5B4_animation_frame = 0; - break; - case 4: - switch (var_45D5B0_animation_state) { - case 21: - case 22: - case 24: - return true; - case 7: - case 8: - case 9: - case 10: - var_45D5B0_animation_state = 21; - var_45D5B4_animation_frame = 0; - break; - case 0: - var_45D5B0_animation_state = 22; - var_45D5B4_animation_frame = 0; - break; - default: - var_45D5B0_animation_state = 21; - var_45D5B4_animation_frame = 0; - break; - } - break; - case 3: - if (var_45D5B0_animation_state == 0 || var_45D5B0_animation_state == 1) { - var_45D5B0_animation_state = 2; - var_462880 = 11; - var_462884 = 592; - if (Game_Flag_Query(199) == 1) { - var_45D5B4_animation_frame = 0; - } - } else if (var_45D5B0_animation_state < 11 || var_45D5B0_animation_state > 19) { - var_45D5B0_animation_state = 11; - var_45D5B4_animation_frame = 0; - var_45D5BC = 0; - } - break; - case 2: - var_45D5B0_animation_state = 4; - var_45D5B4_animation_frame = 0; - break; - case 1: - var_45D5B0_animation_state = 3; - var_45D5B4_animation_frame = 0; - break; - case 0: - switch (var_45D5B0_animation_state) { - case 21: - case 24: - var_45D5B0_animation_state = 23; - var_45D5B4_animation_frame = 0; - break; - case 20: - v1 = var_45D5B4_animation_frame; - Actor_Change_Animation_Mode(23, 4); - var_45D5B4_animation_frame = v1; - var_45D5B0_animation_state = 21; - break; - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - case 19: - var_45D5BC = 1; - break; - case 0: - case 23: - return true; - default: - var_45D5B0_animation_state = 0; - var_45D5B4_animation_frame = 0; - var_45D5B8 = Random_Query(0, 1); - break; - } - break; - case 5: - case 9: - case 10: - case 11: - case 20: - case 23: - case 24: - case 25: - case 26: - return true; - default: - switch (mode) { - case 58: - var_45D5B0_animation_state = 20; - var_45D5B4_animation_frame = 0; - break; - case 48: - if (var_45D5B0_animation_state == 21 || var_45D5B0_animation_state == 22 || var_45D5B0_animation_state == 24) { - var_45D5B0_animation_state = 28; - var_45D5B4_animation_frame = 0; - } else { - var_45D5B0_animation_state = 27; - var_45D5B4_animation_frame = 0; - } - break; - case 47: - var_45D5B0_animation_state = 10; - var_45D5B4_animation_frame = 0; - break; - case 46: - var_45D5B0_animation_state = 9; - var_45D5B4_animation_frame = 0; - break; - case 45: - var_45D5B0_animation_state = 6; - var_45D5B4_animation_frame = 0; - break; - case 44: - var_45D5B0_animation_state = 5; - var_45D5B4_animation_frame = 0; - break; - default: - return true; - } - break; - } - return true; -} - -void AIScript_Officer_Leroy::QueryAnimationState(int *animationState, int *animationFrame, int *a3, int *a4) { - *animationState = var_45D5B0_animation_state; - *animationFrame = var_45D5B4_animation_frame; - *a3 = var_462880; - *a4 = var_462884; -} - -void AIScript_Officer_Leroy::SetAnimationState(int animationState, int animationFrame, int a3, int a4) { - var_45D5B0_animation_state = animationState; - var_45D5B4_animation_frame = animationFrame; - var_462880 = a3; - var_462884 = a4; -} - -bool AIScript_Officer_Leroy::ReachedMovementTrackWaypoint(int waypointId) { - if (waypointId == 57 || waypointId == 58) { - sub_431408(); - AI_Countdown_Timer_Reset(23, 2); - AI_Countdown_Timer_Start(23, 2, 6); - } - return true; -} - -void AIScript_Officer_Leroy::FledCombat() { - Actor_Set_Goal_Number(23, 300); -} - -bool AIScript_Officer_Leroy::sub_431408() { - Game_Flag_Set(199); - return true; -} - -bool AIScript_Officer_Leroy::sub_431420() { - Game_Flag_Reset(199); - return true; -} -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ai_23_officer_leroy.h b/engines/bladerunner/script/ai_23_officer_leroy.h deleted file mode 100644 index c78d80db4e..0000000000 --- a/engines/bladerunner/script/ai_23_officer_leroy.h +++ /dev/null @@ -1,66 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -#include "bladerunner/bladerunner.h" - -namespace BladeRunner { - -class AIScript_Officer_Leroy : public AIScriptBase { - int var_45D5B0_animation_state; - int var_45D5B4_animation_frame; - int var_45D5B8; - int var_45D5BC; - int var_462880; - int var_462884; -public: - AIScript_Officer_Leroy(BladeRunnerEngine *vm); - - void Initialize(); - bool Update(); - void TimerExpired(int timer); - void CompletedMovementTrack(); - void ReceivedClue(int clueId, int fromActorId); - void ClickedByPlayer(); - void EnteredScene(int sceneId); - void OtherAgentEnteredThisScene(int otherActorId); - void OtherAgentExitedThisScene(int otherActorId); - void OtherAgentEnteredCombatMode(int otherActorId, int combatMode); - void ShotAtAndMissed(); - void ShotAtAndHit(); - void Retired(int byActorId); - int GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId); - bool GoalChanged(int currentGoalNumber, int newGoalNumber); - bool UpdateAnimation(int *animation, int *frame); - bool ChangeAnimationMode(int mode); - void QueryAnimationState(int *animationState, int *animationFrame, int *a3, int *a4); - void SetAnimationState(int animationState, int animationFrame, int a3, int a4); - bool ReachedMovementTrackWaypoint(int a1); - void FledCombat(); - -private: - bool sub_431408(); - bool sub_431420(); -}; - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ar01.cpp b/engines/bladerunner/script/ar01.cpp deleted file mode 100644 index dda8a8c3b9..0000000000 --- a/engines/bladerunner/script/ar01.cpp +++ /dev/null @@ -1,361 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptAR01::InitializeScene() { - Music_Play(0, 25, 0, 2, -1, 1, 2); - if (Game_Flag_Query(323)) { - Setup_Scene_Information(-477.0f, 0.0f, -149.0f, 333); - } else if (Game_Flag_Query(321) == 1) { - Setup_Scene_Information(-182.0f, 0.0f, -551.0f, 518); - } else { - Setup_Scene_Information(-152.0f, 0.0f, 332.0f, 545); - } - Scene_Exit_Add_2D_Exit(0, 134, 165, 177, 290, 3); - Scene_Exit_Add_2D_Exit(1, 319, 0, 639, 207, 0); - if (Game_Flag_Query(252)) { - Scene_Exit_Add_2D_Exit(2, 0, 404, 99, 479, 2); - } - Ambient_Sounds_Add_Looping_Sound(54, 50, 1, 1); - Ambient_Sounds_Add_Looping_Sound(81, 60, 100, 1); - Ambient_Sounds_Add_Looping_Sound(241, 50, 1, 1); - Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(184, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(185, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(186, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(188, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(189, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(192, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(242, 3, 30, 11, 11, 50, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(243, 3, 30, 11, 11, 50, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(244, 3, 30, 11, 11, 50, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(245, 3, 30, 11, 11, 50, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(246, 3, 30, 11, 11, 50, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(247, 3, 30, 11, 11, 50, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(248, 3, 30, 11, 11, 50, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(249, 3, 30, 11, 11, 50, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Speech_Sound(60, 0, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 20, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 40, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 50, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Sound(68, 10, 180, 16, 25, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(69, 10, 180, 16, 25, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(375, 10, 180, 50, 100, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(376, 10, 180, 50, 100, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(377, 10, 180, 50, 100, 0, 0, -101, -101, 0, 0); - if (Game_Flag_Query(252) && !Game_Flag_Query(321) && !Game_Flag_Query(323)) { - Actor_Set_Invisible(0, true); - Game_Flag_Set(273); - Scene_Loop_Start_Special(0, 1, 0); - Scene_Loop_Set_Default(2); - } else if (Game_Flag_Query(252) && Game_Flag_Query(321)) { - Scene_Loop_Start_Special(0, 0, 0); - Scene_Loop_Set_Default(2); - Game_Flag_Reset(321); - } else if (!Game_Flag_Query(252) && Game_Flag_Query(321)) { - Scene_Loop_Start_Special(0, 6, 0); - Scene_Loop_Set_Default(7); - Game_Flag_Reset(321); - } else if (Game_Flag_Query(252) && Game_Flag_Query(323)) { - Scene_Loop_Set_Default(2); - } else if (!Game_Flag_Query(252) && Game_Flag_Query(323)) { - Scene_Loop_Set_Default(7); - } else { - Scene_Loop_Set_Default(7); - } -} - -void ScriptAR01::SceneLoaded() { - Obstacle_Object("DF_BOOTH", true); - Unobstacle_Object("SPINNER BODY", true); -} - -bool ScriptAR01::MouseClick(int x, int y) { - return false; -} - -bool ScriptAR01::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptAR01::ClickedOnActor(int actorId) { - if (actorId == 16 || actorId == 20) { - Actor_Face_Actor(0, actorId, true); - Actor_Says(0, 8910, 14); - return true; - } - if (actorId == 29) { - Actor_Set_Goal_Number(29, 2); - if (!Loop_Actor_Walk_To_XYZ(0, -120.73f, 0.0f, 219.17f, 12, 1, false, 0)) { - Actor_Face_Actor(0, 29, true); - Actor_Face_Actor(29, 0, true); - if (Game_Flag_Query(328)) { - if (Actor_Clue_Query(0, 93) && !Actor_Clue_Query(0, 64)) { - Actor_Says(0, 40, 11); - Actor_Says(29, 120, 14); - Actor_Says(0, 45, 17); - Actor_Says(29, 130, 14); - Actor_Says(29, 140, 14); - Actor_Says(0, 50, 13); - Actor_Says(29, 150, 14); - Actor_Clue_Acquire(0, 64, 1, 0); - } else { - if (Random_Query(1, 2) == 1) { - Actor_Says(0, 30, 17); - Actor_Says(29, 100, 14); - Actor_Says(29, 110, 14); - Actor_Says(0, 35, 13); - } else { - Actor_Says(0, 30, 17); - Actor_Says(29, 220, 14); - } - } - Actor_Set_Goal_Number(29, 1); - } else { - Actor_Says(0, 0, 18); - Actor_Says(29, 0, 14); - Actor_Says(29, 10, 14); - Actor_Says(29, 20, 14); - Actor_Says(29, 30, 14); - Actor_Says(0, 5, 17); - Actor_Says(29, 40, 14); - Actor_Says(0, 10, 13); - Actor_Says(29, 50, 14); - Actor_Says(0, 15, 17); - Actor_Says(29, 60, 14); - Actor_Says(29, 70, 14); - Actor_Says(29, 80, 14); - Actor_Says(29, 90, 14); - Actor_Says(0, 25, 13); - Game_Flag_Set(328); - Actor_Set_Goal_Number(29, 1); - } - return true; - } - } - return false; -} - -bool ScriptAR01::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptAR01::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -358.0, 0.0, -149.0, 0, 1, false, 0)) { - Loop_Actor_Walk_To_XYZ(0, -477.0, 0.0, -149.0, 0, 0, false, 0); - Game_Flag_Set(322); - Game_Flag_Set(464); - Game_Flag_Reset(180); - Game_Flag_Set(479); - Set_Enter(8, 31); - Actor_Set_Goal_Number(29, 3); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -182.0, 0.0, -551.0, 0, 1, false, 0)) { - Game_Flag_Set(320); - Async_Actor_Walk_To_XYZ(0, -222.0, 0.0, -690.0, 0, false); - Set_Enter(0, 1); - Actor_Set_Goal_Number(29, 3); - } - return true; - } - if (exitId == 2) { - if (Game_Flag_Query(486) == 1) { - Spinner_Set_Selectable_Destination_Flag(6, 1); - } - int v1 = Loop_Actor_Walk_To_XYZ(0, -164.0f, 0.0f, 332.0f, 0, 1, false, 0); - Actor_Face_Heading(0, 545, false); - if (Actor_Query_Goal_Number(7) >= 2 && Actor_Query_Goal_Number(7) <= 103) { - Player_Loses_Control(); - Actor_Put_In_Set(7, 0); - Actor_Set_At_XYZ(7, -448.0, 0.0, 130.0, 0); - Loop_Actor_Walk_To_XYZ(7, -323.0f, 0.64f, 101.74f, 48, 0, true, 0); - Loop_Actor_Walk_To_Actor(7, 0, 48, 0, true); - Actor_Face_Actor(7, 0, true); - Actor_Change_Animation_Mode(7, 6); - Actor_Says(0, 1800, 21); - Actor_Change_Animation_Mode(0, 48); - Player_Gains_Control(); - Actor_Retired_Here(0, 12, 48, 1, 7); - } else if (!v1) { - if (Game_Flag_Query(486) && !Game_Flag_Query(660)) { - Actor_Voice_Over(4310, 99); - Actor_Voice_Over(4320, 99); - Actor_Voice_Over(4330, 99); - Actor_Voice_Over(4340, 99); - Actor_Voice_Over(4350, 99); - Game_Flag_Set(660); - } - Game_Flag_Reset(176); - Game_Flag_Reset(182); - Game_Flag_Reset(179); - Game_Flag_Reset(178); - Game_Flag_Reset(258); - Game_Flag_Reset(257); - Game_Flag_Reset(180); - - int spinnerDest = Spinner_Interface_Choose_Dest(4, 0); - Actor_Face_Heading(0, 545, 0); - - switch (spinnerDest) { - case 0: - Game_Flag_Set(178); - Game_Flag_Reset(252); - Game_Flag_Set(251); - Set_Enter(61, 65); - Scene_Loop_Start_Special(1, 5, 1); - break; - case 1: - Game_Flag_Set(179); - Game_Flag_Reset(252); - Game_Flag_Set(250); - Set_Enter(49, 48); - Scene_Loop_Start_Special(1, 5, 1); - break; - case 2: - Game_Flag_Set(182); - Game_Flag_Reset(252); - Game_Flag_Set(249); - Set_Enter(69, 78); - Scene_Loop_Start_Special(1, 5, 1); - break; - case 3: - Game_Flag_Set(176); - Game_Flag_Reset(252); - Game_Flag_Set(248); - Set_Enter(4, 13); - Scene_Loop_Start_Special(1, 5, 1); - break; - case 5: - Game_Flag_Set(261); - Game_Flag_Reset(252); - Game_Flag_Set(307); - Set_Enter(17, 82); - Scene_Loop_Start_Special(1, 5, 1); - break; - case 6: - Game_Flag_Set(177); - Game_Flag_Reset(252); - Game_Flag_Set(253); - Set_Enter(7, 25); - Scene_Loop_Start_Special(1, 5, 1); - break; - case 7: - Game_Flag_Set(258); - Game_Flag_Reset(252); - Game_Flag_Set(254); - Set_Enter(20, 2); - Scene_Loop_Start_Special(1, 5, 1); - break; - case 8: - Game_Flag_Set(181); - Game_Flag_Reset(252); - Game_Flag_Set(255); - Set_Enter(54, 54); - Scene_Loop_Start_Special(1, 5, 1); - break; - case 9: - Game_Flag_Set(257); - Game_Flag_Reset(252); - Game_Flag_Set(256); - Set_Enter(37, 34); - Scene_Loop_Start_Special(1, 5, 1); - break; - default: - Game_Flag_Set(180); - Actor_Set_Invisible(0, 0); - break; - } - } - return true; - } - return false; -} - -bool ScriptAR01::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptAR01::SceneFrameAdvanced(int frame) { - if (frame == 16) { - Ambient_Sounds_Play_Sound(118, 40, 0, 0, 99); - } - if (frame == 78 || frame == 199) { - Ambient_Sounds_Play_Sound(116, 100, -50, -50, 99); - } - if (frame == 122 || frame == 242) { - Ambient_Sounds_Play_Sound(119, 100, -50, -50, 99); - } - if (frame == 256) { - Ambient_Sounds_Play_Sound(117, 40, -50, 80, 99); - } - if ((frame == 75 || frame == 196) && Game_Flag_Query(273)) { - Actor_Face_Heading(0, 545, false); - Actor_Change_Animation_Mode(0, 42); - Game_Flag_Reset(273); - } else if (frame == 196 && !Game_Flag_Query(273)) { - Actor_Change_Animation_Mode(0, 41); - } -} - -void ScriptAR01::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptAR01::PlayerWalkedIn() { - if (!Game_Flag_Query(710)) { - Game_Flag_Set(710); - } - if (Game_Flag_Query(323) == 1) { - Loop_Actor_Walk_To_XYZ(0, -358.0f, 0.0f, -149.0f, 0, 1, false, 0); - Game_Flag_Reset(323); - } - if (Actor_Query_Goal_Number(37) < 199) { - Actor_Set_Goal_Number(37, 199); - } -} - -void ScriptAR01::PlayerWalkedOut() { - Actor_Set_Invisible(0, 0); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - if (!Game_Flag_Query(479)) { - Music_Stop(2); - } - if (!Game_Flag_Query(322) && !Game_Flag_Query(320)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Outtake_Play(38, 1, -1); - } -} - -void ScriptAR01::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ar02.cpp b/engines/bladerunner/script/ar02.cpp deleted file mode 100644 index 220402794e..0000000000 --- a/engines/bladerunner/script/ar02.cpp +++ /dev/null @@ -1,388 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptAR02::InitializeScene() { - Music_Play(0, 22, 0, 2, -1, 1, 2); - if (Game_Flag_Query(116)) { - Setup_Scene_Information(-560.0f, 0.0f, -799.0f, 333); - } else { - Setup_Scene_Information(-182.0f, 0.0f, -551.0f, 973); - } - Scene_Exit_Add_2D_Exit(0, 0, 439, 212, 479, 2); - Scene_Exit_Add_2D_Exit(1, 81, 202, 215, 406, 3); - Ambient_Sounds_Add_Looping_Sound(54, 50, 1, 1); - Ambient_Sounds_Add_Looping_Sound(81, 60, 100, 1); - Ambient_Sounds_Add_Looping_Sound(241, 50, 1, 1); - Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(184, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(185, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(186, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(188, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(189, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(192, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(242, 3, 30, 16, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(243, 3, 30, 16, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(244, 3, 30, 16, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(245, 3, 30, 16, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(246, 3, 30, 16, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(247, 3, 30, 16, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(248, 3, 30, 16, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(249, 3, 30, 16, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Speech_Sound(60, 0, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 20, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 40, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 50, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Sound(68, 10, 180, 16, 25, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(69, 10, 180, 16, 25, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(375, 10, 180, 50, 100, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(376, 10, 180, 50, 100, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(377, 10, 180, 50, 100, 0, 0, -101, -101, 0, 0); - if (Game_Flag_Query(252) && Game_Flag_Query(320)) { - Scene_Loop_Start_Special(0, 1, 0); - Scene_Loop_Set_Default(2); - Game_Flag_Reset(320); - } else if (!Game_Flag_Query(252) && Game_Flag_Query(320)) { - Scene_Loop_Start_Special(0, 0, 0); - Scene_Loop_Set_Default(2); - Game_Flag_Reset(320); - } else { - Scene_Loop_Set_Default(2); - } -} - -void ScriptAR02::SceneLoaded() { - Obstacle_Object("DF_BOOTH", true); - if (!Game_Flag_Query(374)) { - Item_Add_To_World(106, 976, 0, -442.84f, 36.77f, -1144.51f, 360, 36, 36, false, true, false, true); - } - if (Global_Variable_Query(1) == 4 && !Game_Flag_Query(374)) { - Game_Flag_Set(0); - Item_Remove_From_World(106); - } -} - -bool ScriptAR02::MouseClick(int x, int y) { - return Region_Check(250, 215, 325, 260); -} - -bool ScriptAR02::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptAR02::ClickedOnActor(int actorId) { - if (actorId == 16) { - if (!Loop_Actor_Walk_To_XYZ(0, -386.96f, 0.0f, -1078.45f, 12, 1, false, 0)) { - Actor_Face_Actor(0, 16, true); - Actor_Face_Actor(16, 0, true); - if (Global_Variable_Query(1) == 2) { - if (Game_Flag_Query(329) && !Game_Flag_Query(366)) { - Game_Flag_Set(366); - Player_Loses_Control(); - ADQ_Flush(); - ADQ_Add(16, 210, 14); - Loop_Actor_Walk_To_XYZ(0, -350.66f, 0.0f, -1117.19f, 0, 0, false, 0); - Actor_Face_Actor(0, 16,true); - Actor_Says(0, 110, 18); - Actor_Says(16, 230, 14); - Actor_Says(0, 115, 18); - Actor_Says(16, 240, 14); - Item_Pickup_Spin_Effect(956, 288, 257); - Actor_Says(16, 250, 14); - Player_Gains_Control(); - sub_402AE0(); - } else if (Game_Flag_Query(329)) { - Actor_Says(0, 75, 18); - Actor_Says(16, 60, 12); - Actor_Says(16, 70, 14); - } else { - sub_402694(); - } - } else if (Global_Variable_Query(1) > 2) { - if (Actor_Clue_Query(0, 56) && !Actor_Clue_Query(0, 90)) { - Actor_Says(0, 205, 16); - Actor_Says(16, 290, 12); - Actor_Says(16, 300, 13); - Actor_Says(0, 210, 15); - Actor_Says(16, 310, 12); - Actor_Says(0, 215, 13); - if (Game_Flag_Query(374)) { - Actor_Says(0, 220, 14); - Actor_Says(16, 320, 12); - Actor_Says(0, 225, 13); - Actor_Says(16, 330, 14); - Actor_Says(0, 230, 19); - Actor_Says(16, 340, 13); - Actor_Says(16, 350, 12); - Actor_Says(0, 235, 16); - Actor_Clue_Acquire(0, 79, 0, 16); - } - Actor_Clue_Acquire(0, 90, 0, 16); - } else { - Actor_Says(0, 240, 17); - Actor_Says(16, 360, 13); - Actor_Says(16, 370, 14); - Actor_Says(0, 245, 13); - } - } - return true; - } - } - if (actorId == 20 && Global_Variable_Query(1) == 2) { - if (!Loop_Actor_Walk_To_XYZ(0, -240.79f, 0.0f, -1328.89f, 12, 1, false, 0)) { - Actor_Face_Actor(0, 20, true); - Actor_Face_Actor(20, 0, true); - if (Game_Flag_Query(330)) { - sub_402CE4(); - return false; - } - Actor_Says(20, 0, 14); - Actor_Says(0, 140, 18); - Game_Flag_Set(330); - return true; - } - } - return false; -} - -bool ScriptAR02::ClickedOnItem(int itemId, bool a2) { - if (itemId == 106) { - if (!Loop_Actor_Walk_To_XYZ(0, -386.96f, 0.0f, -1078.45f, 12, 1, false, 0)) { - Actor_Face_Actor(0, 16, true); - if (!Game_Flag_Query(331)) { - Actor_Says(16, 0, 14); - Actor_Says(0, 55, 18); - Actor_Says(16, 10, 14); - Actor_Says(0, 60, 18); - Actor_Says(16, 20, 14); - Game_Flag_Set(331); - } else if (Game_Flag_Query(331) && !Game_Flag_Query(367)) { - Actor_Says(0, 65, 21); - Actor_Says(16, 30, 14); - Actor_Says(16, 40, 14); - Actor_Says(0, 70, 18); - Actor_Says(16, 50, 14); - Game_Flag_Set(367); - } else { - Actor_Says(0, 8527, 14); - } - return true; - } - } - return false; -} - -bool ScriptAR02::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -182.0f, 0.0f, -551.0f, 0, 1, false, 0)) { - Game_Flag_Set(321); - Async_Actor_Walk_To_XYZ(0, -182.0f, 0.0f, -407.0f, 0, false); - Set_Enter(0, 0); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -465.0f, 0.0f, -799.0f, 0, 1, false, 0)) { - Loop_Actor_Walk_To_XYZ(0, -560.0f, 0.0f, -799.0f, 0, 0, false, 0); - Game_Flag_Set(117); - Game_Flag_Reset(180); - Game_Flag_Set(182); - Music_Stop(3); - Set_Enter(70, 80); - } - return true; - } - return false; -} - -bool ScriptAR02::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptAR02::SceneFrameAdvanced(int frame) { -} - -void ScriptAR02::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptAR02::PlayerWalkedIn() { - if (Game_Flag_Query(116) == 1) { - Loop_Actor_Walk_To_XYZ(0, -465.0f, 0.0f, -799.0f, 0, 0, false, 0); - Game_Flag_Reset(116); - } - Game_Flag_Set(726); -} - -void ScriptAR02::PlayerWalkedOut() { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); -} - -void ScriptAR02::DialogueQueueFlushed(int a1) { -} - -void ScriptAR02::sub_402694() { - Dialogue_Menu_Clear_List(); - if (Actor_Clue_Query(0, 44) || Actor_Clue_Query(0, 47)) { - DM_Add_To_List_Never_Repeat_Once_Selected(490, 3, 5, 5); - } - if (Actor_Clue_Query(0, 14) && !Actor_Clue_Query(0, 44) && !Actor_Clue_Query(0, 47)) { - DM_Add_To_List_Never_Repeat_Once_Selected(500, 3, 5, 5); - } - DM_Add_To_List_Never_Repeat_Once_Selected(510, 8, 3, -1); - Dialogue_Menu_Add_DONE_To_List(520); - Dialogue_Menu_Appear(320, 240); - int answerValue = Dialogue_Menu_Query_Input(); - Dialogue_Menu_Disappear(); - switch (answerValue) { - case 490: - case 500: - if (answerValue == 490) { - Actor_Says(0, 145, 15); - } else { - Actor_Says(0, 150, 15); - } - Actor_Says(16, 80, 14); - Actor_Says(0, 80, 16); - Actor_Says(16, 90, 12); - Actor_Says(0, 85, 17); - Actor_Says(16, 100, 14); - Actor_Says(16, 110, 12); - Actor_Says(16, 120, 12); - Actor_Says(0, 90, 13); - Actor_Says(16, 130, 12); - Actor_Says(16, 140, 14); - Actor_Says(0, 95, 15); - Actor_Says(16, 150, 12); - Actor_Says(16, 160, 13); - Actor_Says(16, 170, 14); - Actor_Says(0, 100, 16); - Actor_Says(16, 180, 13); - Game_Flag_Set(329); - Actor_Clue_Acquire(0, 56, 1, 16); - break; - case 510: - Actor_Says(0, 8475, 12); - Actor_Says(16, 190, 12); - Actor_Says(0, 105, 15); - Actor_Says(16, 200, 14); - break; - case 520: - Actor_Says(0, 215, 16); - break; - } -} - -void ScriptAR02::sub_402AE0() { - Dialogue_Menu_Clear_List(); - if (Global_Variable_Query(2) >= 15 || Query_Difficulty_Level() == 0) { - DM_Add_To_List_Never_Repeat_Once_Selected(530, 7, 5, 3); - } - DM_Add_To_List_Never_Repeat_Once_Selected(540, 3, 5, 7); - Dialogue_Menu_Appear(320, 240); - int answerValue = Dialogue_Menu_Query_Input(); - Dialogue_Menu_Disappear(); - if (answerValue == 530) { - Actor_Says(0, 120, 12); - if (Query_Difficulty_Level() != 0) { - Global_Variable_Decrement(2, 15); - } - Actor_Clue_Acquire(0, 75, 1, 16); - Actor_Modify_Friendliness_To_Other(16, 0, 5); - } else if (answerValue == 540) { - Actor_Says(0, 125, 13); - Actor_Says(16, 260, 3); - Actor_Says(0, 130, 15); - Actor_Says(16, 270, 3); - Actor_Says(16, 280, 3); - Actor_Says(0, 135, 11); - Actor_Modify_Friendliness_To_Other(16, 0, -5); - } -} - -void ScriptAR02::sub_402CE4() { - Dialogue_Menu_Clear_List(); - if (Actor_Clue_Query(0, 93)) { - DM_Add_To_List_Never_Repeat_Once_Selected(550, 8, 5, 2); - } - if (Actor_Clue_Query(0, 44)) { - DM_Add_To_List_Never_Repeat_Once_Selected(560, 6, 5, 7); - } - Dialogue_Menu_Add_DONE_To_List(570); - Dialogue_Menu_Appear(320, 240); - int answerValue = Dialogue_Menu_Query_Input(); - Dialogue_Menu_Disappear(); - switch (answerValue) { - case 550: - Actor_Says(0, 145, 11); - Actor_Says(20, 30, 11); - Actor_Says(0, 160, 11); - Actor_Says(20, 40, 11); - Actor_Says(0, 165, 11); - Actor_Says(20, 50, 11); - Actor_Says(0, 170, 11); - Actor_Says(20, 60, 11); - Actor_Says(0, 175, 11); - Game_Flag_Set(370); - break; - case 560: - Actor_Says(0, 150, 11); - Actor_Says(20, 140, 11); - Actor_Says(0, 185, 11); - Actor_Says(20, 150, 11); - Actor_Says(20, 160, 11); - Actor_Says(0, 190, 11); - Actor_Says(20, 170, 11); - Actor_Says(0, 195, 11); - Actor_Says(20, 180, 11); - Actor_Says(20, 190, 11); - Actor_Says(20, 200, 11); - Actor_Says(0, 200, 11); - Actor_Says(20, 210, 11); - Actor_Says(20, 220, 11); - Actor_Says(20, 230, 11); - Game_Flag_Set(370); - break; - case 570: - if (Actor_Clue_Query(0, 57)) { - Actor_Says(0, 1315, 11); - } else { - Actor_Says(0, 940, 13); - Actor_Says(20, 70, 12); - Actor_Says(20, 90, 12); - Actor_Says(0, 180, 15); - Actor_Says(20, 100, 14); - Actor_Says(20, 110, 12); - Actor_Says(20, 120, 13); - Actor_Modify_Friendliness_To_Other(20, 0, -1); - Actor_Clue_Acquire(0, 57, 0, 20); - } - break; - } -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/bb01.cpp b/engines/bladerunner/script/bb01.cpp deleted file mode 100644 index 6024a42b09..0000000000 --- a/engines/bladerunner/script/bb01.cpp +++ /dev/null @@ -1,231 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptBB01::InitializeScene() { - if (Game_Flag_Query(265)) { - Setup_Scene_Information(-253.0f, 9.0f, 715.0f, 266); - } else if (Game_Flag_Query(263)) { - Setup_Scene_Information(-128.0f, 9.0f, 342.0f, 266); - } else { - Setup_Scene_Information(43.0f, 0.0f, 1058.0f, 0); - } - Scene_Exit_Add_2D_Exit(0, 0, 0, 72, 299, 3); - Scene_Exit_Add_2D_Exit(1, 151, 218, 322, 290, 3); - if (Game_Flag_Query(254)) { - Scene_Exit_Add_2D_Exit(2, 0, 311, 312, 479, 2); - } - Ambient_Sounds_Add_Looping_Sound(54, 50, 0, 1); - Ambient_Sounds_Add_Looping_Sound(105, 25, -100, 0); - Ambient_Sounds_Add_Sound(82, 5, 60, 40, 60, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(83, 5, 60, 40, 65, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(84, 5, 60, 40, 60, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(67, 5, 80, 20, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(66, 5, 80, 20, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(378, 5, 120, 25, 33, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(379, 5, 120, 25, 33, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(380, 5, 120, 25, 33, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Speech_Sound(60, 0, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 20, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 40, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 50, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - if (Game_Flag_Query(254) && !Game_Flag_Query(265) && !Game_Flag_Query(263)) { - Scene_Loop_Start_Special(0, 0, 0); - Scene_Loop_Set_Default(1); - } else if (Game_Flag_Query(254) && Game_Flag_Query(265)) { - Scene_Loop_Set_Default(1); - } else if (Game_Flag_Query(254) && Game_Flag_Query(263)) { - Scene_Loop_Set_Default(1); - } else { - Scene_Loop_Set_Default(5); - } -} - -void ScriptBB01::SceneLoaded() { - Obstacle_Object("COLUME", true); -} - -bool ScriptBB01::MouseClick(int x, int y) { - return false; -} - -bool ScriptBB01::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptBB01::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptBB01::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptBB01::ClickedOnExit(int exitId) { - if (exitId == 0) { - Loop_Actor_Walk_To_XYZ(0, -140.0f, 9.0f, 818.0f, 0, 1, false, 0); - if (!Loop_Actor_Walk_To_XYZ(0, -233.0f, 9.0f, 846.0f, 0, 1, false, 0)) { - Game_Flag_Set(264); - Game_Flag_Reset(258); - Game_Flag_Set(177); - Set_Enter(7, 26); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -125.39f, 9.0f, 372.45f, 0, 1, false, 0)) { - Game_Flag_Set(262); - Set_Enter(1, 3); - } - return true; - } - if (exitId == 2) { - if (!Loop_Actor_Walk_To_XYZ(0, 43.0f, 0.0f, 1062.0f, 0, 1, false, 0)) { - Game_Flag_Reset(176); - Game_Flag_Reset(182); - Game_Flag_Reset(179); - Game_Flag_Reset(178); - Game_Flag_Reset(258); - int spinnerDest = Spinner_Interface_Choose_Dest(3, 0); - switch (spinnerDest) { - case 0: - Game_Flag_Set(178); - Game_Flag_Reset(254); - Game_Flag_Set(251); - Set_Enter(61, 65); - Scene_Loop_Start_Special(1, 4, 1); - break; - case 1: - Game_Flag_Set(179); - Game_Flag_Reset(254); - Game_Flag_Set(250); - Set_Enter(49, 48); - Scene_Loop_Start_Special(1, 4, 1); - break; - case 2: - Game_Flag_Set(182); - Game_Flag_Reset(254); - Game_Flag_Set(249); - Set_Enter(69, 78); - Scene_Loop_Start_Special(1, 4, 1); - break; - case 3: - Game_Flag_Set(176); - Game_Flag_Reset(254); - Game_Flag_Set(248); - Set_Enter(4, 13); - Scene_Loop_Start_Special(1, 4, 1); - break; - case 5: - Game_Flag_Set(261); - Game_Flag_Reset(254); - Game_Flag_Set(307); - Set_Enter(17, 82); - Scene_Loop_Start_Special(1, 4, 1); - break; - case 4: - Game_Flag_Set(180); - Game_Flag_Reset(254); - Game_Flag_Set(252); - Set_Enter(0, 0); - Scene_Loop_Start_Special(1, 4, 1); - break; - case 6: - Game_Flag_Set(177); - Game_Flag_Reset(254); - Game_Flag_Set(253); - Set_Enter(7, 25); - Scene_Loop_Start_Special(1, 4, 1); - break; - case 8: - Game_Flag_Set(181); - Game_Flag_Reset(254); - Game_Flag_Set(255); - Set_Enter(54, 54); - Scene_Loop_Start_Special(1, 4, 1); - break; - case 9: - Game_Flag_Set(257); - Game_Flag_Reset(254); - Game_Flag_Set(256); - Set_Enter(37, 34); - Scene_Loop_Start_Special(1, 4, 1); - break; - default: - Game_Flag_Set(258); - Scene_Loop_Start_Special(2, 3, 1); - break; - } - } - return true; - } - return false; -} - -bool ScriptBB01::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptBB01::SceneFrameAdvanced(int frame) { - if (frame == 193) { - Sound_Play(118, 40, 0, 0, 50); - } - if (frame == 241 || frame == 363) { - Sound_Play(116, 100, -50, -50, 50); - } - if (frame == 286 || frame == 407) { - Sound_Play(119, 100, -50, -50, 50); - } - if (frame == 433) { - Sound_Play(117, 40, -50, 80, 50); - } - if (frame == 120) { - Sound_Play(286, Random_Query(33, 33), 100, -100, 50); - } -} - -void ScriptBB01::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptBB01::PlayerWalkedIn() { - Spinner_Set_Selectable_Destination_Flag(7, 1); - if (Game_Flag_Query(265)) { - Game_Flag_Reset(265); - } else if (Game_Flag_Query(263)) { - Game_Flag_Reset(263); - } else { - Loop_Actor_Walk_To_XYZ(0, 43.0f, 0.0f, 954.0f, 0, 0, false, 0); - } -} - -void ScriptBB01::PlayerWalkedOut() { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); -} - -void ScriptBB01::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/bb02.cpp b/engines/bladerunner/script/bb02.cpp deleted file mode 100644 index 0fa6b0c237..0000000000 --- a/engines/bladerunner/script/bb02.cpp +++ /dev/null @@ -1,159 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptBB02::InitializeScene() { - if (Game_Flag_Query(281)) { - Setup_Scene_Information(179.0f, -415.06f, 274.0f, 904); - } else if (Game_Flag_Query(333)) { - Setup_Scene_Information(-12.0f, -415.06f, -27.0f, 264); - Scene_Loop_Start_Special(0, 0, 0); - } else { - Setup_Scene_Information(98.0f, -415.06f, -593.0f, 530); - Game_Flag_Reset(262); - } - Scene_Exit_Add_2D_Exit(0, 313, 137, 353, 173, 0); - Scene_Exit_Add_2D_Exit(1, 207, 291, 275, 443, 3); - Scene_Exit_Add_2D_Exit(2, 303, 422, 639, 479, 2); - Ambient_Sounds_Add_Looping_Sound(54, 20, 0, 1); - Ambient_Sounds_Add_Looping_Sound(103, 40, 0, 1); - Ambient_Sounds_Add_Sound(443, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(444, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(445, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(446, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(82, 5, 60, 20, 40, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(83, 5, 60, 20, 45, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(84, 5, 60, 20, 40, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(90, 5, 50, 17, 17, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(91, 5, 50, 17, 17, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(375, 5, 180, 25, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(376, 5, 180, 25, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(377, 5, 180, 25, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(72, 5, 80, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(73, 5, 80, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(74, 5, 80, 14, 16, -100, 100, -101, -101, 0, 0); - if (!Game_Flag_Query(494)) { - Game_Flag_Set(493); - Game_Flag_Set(494); - } - if (Game_Flag_Query(493)) { - Scene_Loop_Set_Default(1); - } else { - Scene_Loop_Set_Default(4); - } -} - -void ScriptBB02::SceneLoaded() { - Obstacle_Object("ELEVATOR01", true); - Obstacle_Object("U2 DOOR", true); -} - -bool ScriptBB02::MouseClick(int x, int y) { - return false; -} - -bool ScriptBB02::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptBB02::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptBB02::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptBB02::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, 98.0f, -415.06f, -593.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(263); - Set_Enter(20, 2); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -12.0f, -415.06f, -27.0f, 0, 1, false, 0)) { - Player_Loses_Control(); - if (!Game_Flag_Query(493)) { - Scene_Loop_Start_Special(2, 0, 1); - } - Game_Flag_Set(332); - Game_Flag_Reset(493); - Set_Enter(1, 5); - Scene_Loop_Start_Special(1, 3, 0); - } - return true; - } - if (exitId == 2) { - if (!Loop_Actor_Walk_To_XYZ(0, 86.0f, -415.06f, 174.0f, 0, 1, false, 0)) { - Loop_Actor_Walk_To_XYZ(0, 179.0f, -415.06f, 274.0f, 0, 0, false, 0); - Game_Flag_Set(282); - Game_Flag_Reset(493); - Set_Enter(21, 4); - } - return true; - } - return false; -} - -bool ScriptBB02::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptBB02::SceneFrameAdvanced(int frame) { - if (frame == 1) { - Ambient_Sounds_Play_Sound(434, 40, -50, -50, 0); - } - if (frame == 124) { - Ambient_Sounds_Play_Sound(434, 40, -50, -50, 0); - } -} - -void ScriptBB02::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptBB02::PlayerWalkedIn() { - if (Game_Flag_Query(281)) { - Loop_Actor_Walk_To_XYZ(0, 86.0f, -415.06f, 174.0f, 0, 0, false, 0); - Game_Flag_Reset(281); - } else if (Game_Flag_Query(333)) { - Loop_Actor_Walk_To_XYZ(0, 35.0f, -415.06f, -27.0f, 0, 0, false, 0); - Player_Gains_Control(); - Game_Flag_Reset(333); - } -} - -void ScriptBB02::PlayerWalkedOut() { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); -} - -void ScriptBB02::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/bb03.cpp b/engines/bladerunner/script/bb03.cpp deleted file mode 100644 index 7307c5c3a1..0000000000 --- a/engines/bladerunner/script/bb03.cpp +++ /dev/null @@ -1,161 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptBB03::InitializeScene() { - Setup_Scene_Information(20.0f, 60.16f, 0.0f, 0); - Game_Flag_Reset(282); - if (Game_Flag_Query(284)) { - Setup_Scene_Information(176.0f, 60.16f, 0.0f, 900); - } - if (Game_Flag_Query(286)) { - Setup_Scene_Information(204.0f, 60.16f, -164.0f, 740); - } - Scene_Exit_Add_2D_Exit(0, 589, 0, 639, 479, 1); - Scene_Exit_Add_2D_Exit(1, 167, 372, 439, 479, 2); - Scene_Exit_Add_2D_Exit(2, 451, 115, 547, 320, 1); - Ambient_Sounds_Add_Looping_Sound(54, 20, 0, 1); - Ambient_Sounds_Add_Looping_Sound(103, 40, 0, 1); - Ambient_Sounds_Add_Looping_Sound(105, 34, 100, 1); - Ambient_Sounds_Add_Sound(443, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(444, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(445, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(446, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(303, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(304, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(305, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(306, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(307, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(308, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(309, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(310, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(90, 5, 50, 17, 17, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(91, 5, 50, 17, 17, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(375, 5, 180, 25, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(376, 5, 180, 25, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(377, 5, 180, 25, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(72, 5, 80, 20, 20, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(73, 5, 80, 20, 20, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(74, 5, 80, 20, 20, -100, 100, -101, -101, 0, 0); -} - -void ScriptBB03::SceneLoaded() { - Obstacle_Object("BACKWALL", true); - Unobstacle_Object("BOX08", true); -} - -bool ScriptBB03::MouseClick(int x, int y) { - return false; -} - -bool ScriptBB03::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptBB03::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptBB03::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptBB03::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, 176.0f, 60.16f, -64.0f, 0, 1, false, 0)) { - Loop_Actor_Walk_To_XYZ(0, 176.0f, 60.16f, 0.0f, 0, 0, false, 0); - Game_Flag_Set(283); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Set_Enter(1, 5); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, 20.0f, 60.16f, 0.0f, 0, 1, false, 0)) { - Game_Flag_Set(281); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Set_Enter(1, 3); - } - return true; - } - if (exitId == 2) { - if (!Loop_Actor_Walk_To_XYZ(0, 204.0f, 60.16f, -164.0f, 0, 1, false, 0)) { - if (Global_Variable_Query(1) < 4) { - if (Actor_Query_Goal_Number(56) == 200) { - Actor_Says(56, 70, 3); - Actor_Says(0, 7010, 13); - Actor_Says(56, 80, 3); - Actor_Says(0, 7015, 12); - Actor_Says(56, 90, 3); - Actor_Says(0, 7020, 14); - Actor_Says(56, 100, 3); - Actor_Says(0, 7025, 15); - Actor_Says(56, 110, 3); - Actor_Set_Targetable(54, false); - Actor_Set_Targetable(58, false); - } - Game_Flag_Set(285); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Set_Enter(22, 6); - } else { - Actor_Says(0, 8522, 3); - } - } - return true; - } - return false; -} - -bool ScriptBB03::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptBB03::SceneFrameAdvanced(int frame) { -} - -void ScriptBB03::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptBB03::PlayerWalkedIn() { - if (Game_Flag_Query(286)) { - Loop_Actor_Walk_To_XYZ(0, 164.0f, 60.16f, -164.0f, 0, 0, false, 0); - Game_Flag_Reset(286); - } - if (Game_Flag_Query(284)) { - Loop_Actor_Walk_To_XYZ(0, 176.0f, 60.16f, -64.0f, 0, 0, false, 0); - Game_Flag_Reset(284); - } -} - -void ScriptBB03::PlayerWalkedOut() { -} - -void ScriptBB03::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/bb04.cpp b/engines/bladerunner/script/bb04.cpp deleted file mode 100644 index b99ea5004d..0000000000 --- a/engines/bladerunner/script/bb04.cpp +++ /dev/null @@ -1,130 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptBB04::InitializeScene() { - if (Game_Flag_Query(283)) { - Setup_Scene_Information(-107.0f, -26.6f, 397.0f, 29); - Game_Flag_Reset(283); - } else { - Setup_Scene_Information(-15.0f, -25.17f, 45.0f, 691); - } - Scene_Exit_Add_2D_Exit(0, 218, 102, 360, 254, 1); - Scene_Exit_Add_2D_Exit(1, 0, 334, 639, 479, 2); - Ambient_Sounds_Add_Looping_Sound(54, 20, 0, 1); - Ambient_Sounds_Add_Looping_Sound(103, 40, 0, 1); - Ambient_Sounds_Add_Looping_Sound(105, 44, -100, 1); - Ambient_Sounds_Add_Sound(443, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(444, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(445, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(446, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(303, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(304, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(305, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(306, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(307, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(308, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(309, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(310, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(90, 5, 50, 17, 17, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(91, 5, 50, 17, 17, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(375, 5, 180, 25, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(376, 5, 180, 25, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(377, 5, 180, 25, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(72, 5, 80, 20, 20, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(73, 5, 80, 20, 20, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(74, 5, 80, 20, 20, -100, 100, -101, -101, 0, 0); -} - -void ScriptBB04::SceneLoaded() { - Obstacle_Object("DH TRASH", true); -} - -bool ScriptBB04::MouseClick(int x, int y) { - return false; -} - -bool ScriptBB04::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptBB04::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptBB04::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptBB04::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -92.0f, -26.6f, 45.0f, 0, 1, false, 0)) { - Player_Loses_Control(); - Loop_Actor_Walk_To_XYZ(0, -15.0f, -25.17f, 45.0f, 0, 0, false, 0); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(333); - Game_Flag_Set(493); - Set_Enter(1, 3); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -107.0f, -26.6f, 397.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(284); - Set_Enter(21, 4); - } - return true; - } - return false; -} - -bool ScriptBB04::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptBB04::SceneFrameAdvanced(int frame) { -} - -void ScriptBB04::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptBB04::PlayerWalkedIn() { - if (Game_Flag_Query(332)) { - Loop_Actor_Walk_To_XYZ(0, -92.0f, -26.6f, 45.0f, 0, 0, false, 0); - Player_Gains_Control(); - Game_Flag_Reset(332); - } -} - -void ScriptBB04::PlayerWalkedOut() { -} - -void ScriptBB04::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/bb05.cpp b/engines/bladerunner/script/bb05.cpp deleted file mode 100644 index aff2f7bdc6..0000000000 --- a/engines/bladerunner/script/bb05.cpp +++ /dev/null @@ -1,213 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptBB05::InitializeScene() { - if (Game_Flag_Query(298)) { - Setup_Scene_Information(95.0f, -60.31f, 331.0f, 0); - } else if (Game_Flag_Query(302)) { - Setup_Scene_Information(87.0f, -60.34f, -96.0f, 0); - } else if (Game_Flag_Query(300)) { - Setup_Scene_Information(271.0f, -60.31f, 203.0f, 0); - } else { - Setup_Scene_Information(-212.0f, -60.31f, 131.0f, 0); - } - Scene_Exit_Add_2D_Exit(0, 92, 125, 187, 317, 3); - Scene_Exit_Add_2D_Exit(1, 0, 0, 30, 479, 3); - Scene_Exit_Add_2D_Exit(2, 589, 0, 639, 479, 1); - Scene_Exit_Add_2D_Exit(3, 481, 113, 573, 307, 0); - Ambient_Sounds_Add_Looping_Sound(54, 12, 0, 1); - Ambient_Sounds_Add_Looping_Sound(103, 28, 0, 1); - Ambient_Sounds_Add_Looping_Sound(105, 14, 0, 1); - Ambient_Sounds_Add_Sound(303, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(304, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(305, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(306, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(307, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(308, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(309, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(310, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(90, 5, 50, 17, 17, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(91, 5, 50, 17, 17, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(375, 5, 180, 25, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(376, 5, 180, 25, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(377, 5, 180, 25, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(72, 5, 80, 14, 14, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(73, 5, 80, 14, 14, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(74, 5, 80, 14, 14, -100, 100, -101, -101, 0, 0); - if (!Game_Flag_Query(495)) { - Overlay_Play("BB05OVER", 0, 0, 0, 0); - Game_Flag_Set(495); - } -} - -void ScriptBB05::SceneLoaded() { - Obstacle_Object("PINHEAD", true); - Obstacle_Object("X2WALLS&MOLDNG05", true); - Obstacle_Object("QUADPATCH04", true); - Unobstacle_Object("BOX16", true); - Clickable_Object("PINHEAD"); - Clickable_Object("BOX06"); - Unclickable_Object("BOX06"); - Unclickable_Object("BOX14"); - if (Actor_Query_Goal_Number(56) == 200) { - Actor_Set_Goal_Number(58, 299); - Actor_Put_In_Set(58, 97); - Actor_Set_At_Waypoint(58, 39, 0); - } -} - -bool ScriptBB05::MouseClick(int x, int y) { - return false; -} - -bool ScriptBB05::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptBB05::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptBB05::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptBB05::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -212.0f, -60.31f, 131.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(286); - Set_Enter(21, 4); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, 95.0f, -60.31f, 331.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(297); - Set_Enter(2, 7); - } - return true; - } - if (exitId == 2) { - if (!Loop_Actor_Walk_To_XYZ(0, 271.0f, -60.31f, 203.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(299); - Set_Enter(3, 8); - } - return true; - } - if (exitId == 3) { - if (!Loop_Actor_Walk_To_XYZ(0, 151.0f, -60.34f, -108.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(301); - Set_Enter(102, 120); - } - return true; - } - return false; -} - -bool ScriptBB05::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptBB05::SceneFrameAdvanced(int frame) { -} - -void ScriptBB05::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptBB05::PlayerWalkedIn() { - if (Game_Flag_Query(298)) { - Loop_Actor_Walk_To_XYZ(0, 95.0f, -60.31f, 303.0f, 0, 0, false, 0); - Game_Flag_Reset(298); - } else if (Game_Flag_Query(300)) { - Loop_Actor_Walk_To_XYZ(0, 231.0f, -60.31f, 203.0f, 0, 0, false, 0); - Game_Flag_Reset(300); - } else if (Game_Flag_Query(302)) { - Loop_Actor_Walk_To_XYZ(0, 111.0f, -60.31f, -24.0f, 0, 0, false, 0); - Game_Flag_Reset(302); - } else { - Loop_Actor_Walk_To_XYZ(0, -76.0f, -60.31f, 131.0f, 0, 0, false, 0); - Game_Flag_Reset(285); - } - if (Actor_Query_Goal_Number(56) == 200) { - Actor_Face_Actor(56, 0, true); - Actor_Face_Actor(0, 56, true); - Actor_Says(56, 120, 13); - Actor_Says(0, 7030, 15); - Actor_Says(56, 130, 17); - Actor_Says(56, 140, 16); - Actor_Says(56, 150, 14); - Actor_Says(56, 160, 15); - Actor_Says(0, 7035, 14); - Actor_Says(56, 170, 12); - Actor_Says(0, 7040, 14); - Actor_Says(56, 180, 16); - Actor_Says(0, 7045, 14); - if (Game_Flag_Query(399)) { - Actor_Says(56, 190, 15); - Actor_Says(0, 7050, 17); - Actor_Says(56, 200, 16); - Actor_Says_With_Pause(56, 210, 1.5f, 14); - Actor_Says(0, 7055, 15); - } else { - Actor_Put_In_Set(58, 22); - Actor_Set_At_Waypoint(58, 134, 0); - Loop_Actor_Walk_To_Waypoint(58, 135, 0, 0, false); - Actor_Says(58, 0, 3); - Actor_Face_Actor(0, 58, true); - Actor_Face_Actor(56, 58, true); - Actor_Says(56, 220, 13); - Loop_Actor_Walk_To_Waypoint(58, 134, 0, 0, false); - Actor_Face_Actor(56, 0, true); - Actor_Face_Actor(0, 56, true); - Actor_Says(56, 230, 15); - Actor_Says(0, 7060, 17); - Actor_Says(56, 240, 12); - } - Actor_Says(0, 7065, 16); - Actor_Says(56, 250, 16); - Actor_Says(0, 7070, 18); - Actor_Set_Goal_Number(56, 205); - Actor_Set_Goal_Number(58, 201); - Actor_Set_Goal_Number(54, 101); - Actor_Set_Goal_Number(58, 200); - } -} - -void ScriptBB05::PlayerWalkedOut() { -} - -void ScriptBB05::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/bb06.cpp b/engines/bladerunner/script/bb06.cpp deleted file mode 100644 index 66c9a85d3c..0000000000 --- a/engines/bladerunner/script/bb06.cpp +++ /dev/null @@ -1,177 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptBB06::InitializeScene() { - if (Game_Flag_Query(394)) { - Setup_Scene_Information(76.0f, 0.0f, 79.0f, 622); - } else if (Game_Flag_Query(395)) { - Setup_Scene_Information(55.0f, 0.0f, -96.0f, 761); - } else if (Game_Flag_Query(362)) { - Setup_Scene_Information(-115.0f, 0.0f, -103.0f, 375); - Game_Flag_Reset(362); - } else { - Setup_Scene_Information(-37.0f, 0.0f, 178.0f, 0); - } - Scene_Exit_Add_2D_Exit(0, 0, 43, 14, 478, 3); - Scene_Exit_Add_2D_Exit(1, 425, 0, 639, 361, 0); - Scene_Exit_Add_2D_Exit(3, 195, 164, 239, 280, 3); - Ambient_Sounds_Add_Looping_Sound(103, 28, 0, 1); - Ambient_Sounds_Add_Sound(303, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(304, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(443, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(444, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(445, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(446, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(305, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(306, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(307, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(308, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(309, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(310, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - if (Game_Flag_Query(394) || Game_Flag_Query(395)) { - Scene_Loop_Start_Special(0, 0, 0); - Scene_Loop_Set_Default(1); - Game_Flag_Reset(394); - Game_Flag_Reset(395); - } else { - Scene_Loop_Set_Default(1); - } - if (Game_Flag_Query(410)) { - Overlay_Play("BB06OVER", 1, 1, 0, 0); - } -} - -void ScriptBB06::SceneLoaded() { - Obstacle_Object("V2CHESSTBL01", true); - Clickable_Object("BOX31"); - Item_Add_To_World(77, 931, 2, -127.0f, 68.42f, 57.0f, 0, 8, 8, true, true, false, true); -} - -bool ScriptBB06::MouseClick(int x, int y) { - return false; -} - -bool ScriptBB06::ClickedOn3DObject(const char *objectName, bool a2) { - if (Object_Query_Click("BOX31", objectName)) { - if (!Loop_Actor_Walk_To_Scene_Object(0, "BOX31", 24, 1, false)) { - Actor_Face_Object(0, "BOX31", true); - if (Game_Flag_Query(410)) { - Actor_Voice_Over(60, 99); - Actor_Voice_Over(70, 99); - } else { - Actor_Voice_Over(50, 99); - } - } - } - return false; -} - -bool ScriptBB06::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptBB06::ClickedOnItem(int itemId, bool a2) { - if (itemId == 77) { - if (Player_Query_Combat_Mode()) { - Overlay_Play("BB06OVER", 1, 1, 1, 0); - Game_Flag_Set(410); - Item_Remove_From_World(77); - return true; - } - } - return false; -} - -bool ScriptBB06::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -37.0f, 0.0f, 178.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(298); - Set_Enter(22, 6); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, 101.0f, 0.0f, -25.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(393); - Set_Enter(1, 104); - } - return true; - } - if (exitId == 3) { - if (!Loop_Actor_Walk_To_XYZ(0, -115.0f, 0.0f, -103.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(363); - Set_Enter(2, 8); - } - return true; - } - return false; -} - -bool ScriptBB06::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptBB06::SceneFrameAdvanced(int frame) { - if (frame == 34) { - Ambient_Sounds_Play_Sound(447, 40, -50, -50, 10); - } - if (frame == 16) { - Ambient_Sounds_Play_Sound(448, 20, -50, -50, 10); - } - if (frame == 20) { - Ambient_Sounds_Play_Sound(448, 20, -50, -50, 10); - } - if (frame == 25) { - Ambient_Sounds_Play_Sound(448, 20, -50, -50, 10); - } - if (frame == 29) { - Ambient_Sounds_Play_Sound(448, 20, -50, -50, 10); - } -} - -void ScriptBB06::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptBB06::PlayerWalkedIn() { - if (Game_Flag_Query(297)) { - Loop_Actor_Walk_To_XYZ(0, -36.0f, 0.0f, 145.0f, 0, 0, false, 0); - Game_Flag_Reset(297); - } -} - -void ScriptBB06::PlayerWalkedOut() { -} - -void ScriptBB06::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/bb07.cpp b/engines/bladerunner/script/bb07.cpp deleted file mode 100644 index 7b9b4aea1f..0000000000 --- a/engines/bladerunner/script/bb07.cpp +++ /dev/null @@ -1,184 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptBB07::InitializeScene() { - if (Game_Flag_Query(365)) { - Setup_Scene_Information(-655.0f, 252.59f, -1136.0f, 323); - } else if (Game_Flag_Query(363)) { - Setup_Scene_Information(-551.0f, 252.59f, -1004.0f, 29); - Game_Flag_Reset(363); - } else { - Setup_Scene_Information(-652.0f, 252.59f, -1018.0f, 268); - } - Scene_Exit_Add_2D_Exit(0, 0, 16, 51, 426, 3); - Scene_Exit_Add_2D_Exit(1, 124, 101, 172, 305, 3); - Scene_Exit_Add_2D_Exit(2, 282, 408, 476, 479, 2); - Scene_2D_Region_Add(0, 308, 283, 354, 308); - Ambient_Sounds_Add_Looping_Sound(332, 44, 0, 1); - Ambient_Sounds_Add_Looping_Sound(331, 24, 0, 1); - Ambient_Sounds_Add_Sound(443, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(444, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(445, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(446, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(303, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(304, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(305, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(306, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(307, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(308, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(309, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(310, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Overlay_Play("BB07OVER", 0, 1, 0, 0); -} - -void ScriptBB07::SceneLoaded() { - Obstacle_Object("COUCH", true); - Unobstacle_Object("X2MAINWALLLEFT01", true); - Clickable_Object("PRINTER"); -} - -bool ScriptBB07::MouseClick(int x, int y) { - return false; -} - -bool ScriptBB07::ClickedOn3DObject(const char *objectName, bool a2) { - if (Object_Query_Click("PRINTER", objectName)) { - if (!Loop_Actor_Walk_To_XYZ(0, -472.63f, 252.59f, -1086.81f, 0, 0, false, 0)) { - Actor_Face_Object(0, "PRINTER", true); - if (Game_Flag_Query(396) && !Game_Flag_Query(398)) { - Actor_Voice_Over(130, 99); - Item_Pickup_Spin_Effect(941, 439, 242); - Actor_Voice_Over(140, 99); - Game_Flag_Set(398); - Actor_Clue_Acquire(0, 148, 1, -1); - } else if (Game_Flag_Query(396) && Game_Flag_Query(398)) { - Actor_Face_Object(0, "PRINTER", true); - Actor_Says(0, 8570, 13); - } else { - Actor_Face_Object(0, "PRINTER", true); - Actor_Says(0, 8575, 13); - } - } - } - return false; -} - -bool ScriptBB07::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptBB07::ClickedOnItem(int itemId, bool a2) { - if (itemId == 83) { - if (!Loop_Actor_Walk_To_Item(0, 83, 36, 1, false)) { - Actor_Face_Item(0, 83, true); - if (Game_Flag_Query(396) == 1) { - Actor_Voice_Over(150, 99); - Actor_Voice_Over(160, 99); - Actor_Voice_Over(170, 99); - } - } - } - return false; -} - -bool ScriptBB07::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -615.0f, 252.59f, -1018.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Overlay_Remove("BB07OVER"); - Game_Flag_Set(300); - Set_Enter(22, 6); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -619.0f, 252.59f, -1136.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Overlay_Remove("BB07OVER"); - Game_Flag_Set(364); - Set_Enter(102, 120); - } - return true; - } - if (exitId == 2) { - if (!Loop_Actor_Walk_To_XYZ(0, -551.0f, 252.59f, -1004.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Overlay_Remove("BB07OVER"); - Game_Flag_Set(362); - Set_Enter(2, 7); - } - return true; - } - return false; -} - -bool ScriptBB07::ClickedOn2DRegion(int region) { - if (region == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -568.63f, 252.59f, -1114.81f, 0, 1, false, 0)) { - Actor_Face_Heading(0, 229, false); - if (Game_Flag_Query(396)) { - Actor_Says(0, 8585, 15); - } else { - Ambient_Sounds_Play_Sound(592, 40, 20, 20, 99); - Overlay_Play("BB07OVER", 1, 0, 1, 0); - Overlay_Play("BB07OVER", 2, 1, 0, 0); - Game_Flag_Set(396); - if (!Game_Flag_Query(398)) { - Actor_Says(39, 0, 3); - } - } - } - } - return false; -} - -void ScriptBB07::SceneFrameAdvanced(int frame) { -} - -void ScriptBB07::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptBB07::PlayerWalkedIn() { - if (Game_Flag_Query(299)) { - Loop_Actor_Walk_To_XYZ(0, -594.0f, 252.59f, -1018.0f, 6, 0, false, 0); - Game_Flag_Reset(299); - } - if (Game_Flag_Query(365)) { - Loop_Actor_Walk_To_XYZ(0, -602.0f, 252.59f, -1124.0f, 6, 0, false, 0); - Game_Flag_Reset(365); - } -} - -void ScriptBB07::PlayerWalkedOut() { -} - -void ScriptBB07::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/bb08.cpp b/engines/bladerunner/script/bb08.cpp deleted file mode 100644 index 5464aabc28..0000000000 --- a/engines/bladerunner/script/bb08.cpp +++ /dev/null @@ -1,136 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptBB08::InitializeScene() { - if (Game_Flag_Query(219)) { - Setup_Scene_Information(204.0f, 0.0f, 92.0f, 875); - } else { - Setup_Scene_Information(247.0f, 0.0f, 27.0f, 790); - } - Scene_Exit_Add_2D_Exit(0, 307, 0, 361, 238, 0); - Scene_Exit_Add_2D_Exit(1, 117, 38, 214, 245, 0); - Ambient_Sounds_Add_Looping_Sound(105, 44, 0, 1); - Ambient_Sounds_Add_Sound(291, 1, 20, 20, 25, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(292, 1, 20, 20, 25, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(293, 1, 20, 20, 25, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(294, 1, 20, 20, 25, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(295, 1, 20, 20, 25, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(443, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(444, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(445, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(446, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(303, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(304, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(305, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(306, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(307, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(308, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(309, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(310, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - if (!Game_Flag_Query(496)) { - Overlay_Play("BB08OVER", 0, 0, 0, 0); - Game_Flag_Set(496); - } -} - -void ScriptBB08::SceneLoaded() { - Obstacle_Object("BATHTUB", true); - Unobstacle_Object("DOORWAY", true); - Unclickable_Object("BATHTUB"); -} - -bool ScriptBB08::MouseClick(int x, int y) { - return false; -} - -bool ScriptBB08::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptBB08::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptBB08::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptBB08::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, 204.0f, 0.1f, 94.0f, 0, 1, false, 0)) { - Actor_Face_Heading(0, 256, false); - Footstep_Sound_Override_On(2); - Loop_Actor_Travel_Ladder(0, 8, 1, 0); - Footstep_Sound_Override_Off(); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(218); - Set_Enter(24, 10); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, 247.0f, 0.1f, 27.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(506); - Set_Enter(102, 120); - } - return true; - } - return false; -} - -bool ScriptBB08::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptBB08::SceneFrameAdvanced(int frame) { -} - -void ScriptBB08::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptBB08::PlayerWalkedIn() { - if (Game_Flag_Query(219)) { - Actor_Set_At_XYZ(0, 204.0f, 96.1f, 94.0f, 256); - Footstep_Sound_Override_On(2); - Loop_Actor_Travel_Ladder(0, 8, 0, 0); - Footstep_Sound_Override_Off(); - Actor_Face_Heading(0, 768, false); - Game_Flag_Reset(219); - } else { - Loop_Actor_Walk_To_XYZ(0, 188.0f, 0.1f, 28.0f, 0, 0, false, 0); - } -} - -void ScriptBB08::PlayerWalkedOut() { -} - -void ScriptBB08::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/bb09.cpp b/engines/bladerunner/script/bb09.cpp deleted file mode 100644 index 0d672612ae..0000000000 --- a/engines/bladerunner/script/bb09.cpp +++ /dev/null @@ -1,124 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptBB09::InitializeScene() { - Setup_Scene_Information(111.2f, -8.96f, 134.65f, 0); - if (Game_Flag_Query(221)) { - Game_Flag_Reset(221); - Setup_Scene_Information(115.45f, -8.96f, 134.0f, 628); - } else if (Game_Flag_Query(218)) { - Game_Flag_Reset(218); - Setup_Scene_Information(107.45f, -9.14f, 166.0f, 244); - } - Scene_Exit_Add_2D_Exit(0, 224, 213, 286, 353, 1); - Scene_Exit_Add_2D_Exit(1, 75, 450, 480, 479, 2); - Ambient_Sounds_Add_Looping_Sound(54, 20, 100, 1); - Ambient_Sounds_Add_Looping_Sound(103, 40, 0, 1); - Ambient_Sounds_Add_Looping_Sound(105, 50, 55, 1); - Ambient_Sounds_Add_Sound(297, 5, 20, 20, 25, -100, -100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(298, 5, 20, 20, 25, -100, -100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(299, 5, 20, 20, 25, -100, -100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(443, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(444, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(445, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(446, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(303, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(304, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(305, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(306, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(307, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(308, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(309, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(310, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Actor_Set_Targetable(8, true); -} - -void ScriptBB09::SceneLoaded() { - Obstacle_Object("WICKER CHAIR ", true); - Unobstacle_Object("ROOM03 RIGHT WALL", true); - Unclickable_Object("WICKER CHAIR "); -} - -bool ScriptBB09::MouseClick(int x, int y) { - return false; -} - -bool ScriptBB09::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptBB09::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptBB09::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptBB09::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, 454.56f, -9.0f, 190.31f, 0, 1, false, 0)) { - Loop_Actor_Walk_To_XYZ(0, 450.56f, -9.0f, 250.31f, 0, 0, false, 0); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(216); - Game_Flag_Set(220); - Set_Enter(25, 11); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, 71.0f, -9.0f, 136.0f, 72, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(219); - Set_Enter(23, 9); - } - return true; - } - return false; -} - -bool ScriptBB09::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptBB09::SceneFrameAdvanced(int frame) { -} - -void ScriptBB09::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptBB09::PlayerWalkedIn() { -} - -void ScriptBB09::PlayerWalkedOut() { -} - -void ScriptBB09::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/bb10.cpp b/engines/bladerunner/script/bb10.cpp deleted file mode 100644 index 3a28ebb104..0000000000 --- a/engines/bladerunner/script/bb10.cpp +++ /dev/null @@ -1,205 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptBB10::InitializeScene() { - if (Game_Flag_Query(223)) { - Setup_Scene_Information(255.29f, 90.24f, -103.0f, 830); - } else if (Game_Flag_Query(220)) { - Game_Flag_Reset(220); - Setup_Scene_Information(151.67f, 66.84f, -313.06f, 0); - } else { - Setup_Scene_Information(199.67f, 67.4f, -169.06f, 628); - } - if (Global_Variable_Query(36) > 2) { - Scene_Exit_Add_2D_Exit(0, 281, 0, 531, 115, 0); - } - Scene_Exit_Add_2D_Exit(1, 58, 91, 193, 401, 3); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Add_Looping_Sound(382, 76, 0, 1); - Ambient_Sounds_Add_Sound(443, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(444, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(445, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(446, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(303, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(304, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(305, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(306, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(307, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(308, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(309, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(310, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - if (!Game_Flag_Query(466)) { - Scene_2D_Region_Add(0, 458, 99, 522, 133); - Overlay_Play("BB10OVR1", 0, 1, 0, 0); - } - if (!Game_Flag_Query(467)) { - Scene_2D_Region_Add(1, 459, 164, 522, 193); - Overlay_Play("BB10OVR2", 0, 1, 0, 0); - } - if (!Game_Flag_Query(468)) { - Scene_2D_Region_Add(2, 458, 194, 522, 223); - Overlay_Play("BB10OVR3", 0, 1, 0, 0); - } - if (!Game_Flag_Query(469)) { - Scene_2D_Region_Add(3, 458, 255, 522, 278); - Overlay_Play("BB10OVR4", 0, 1, 0, 0); - } - if (!Game_Flag_Query(470)) { - Scene_2D_Region_Add(4, 458, 316, 522, 335); - Overlay_Play("BB10OVR5", 0, 1, 0, 0); - } -} - -void ScriptBB10::SceneLoaded() { - Obstacle_Object("BARB NIGHT", true); - Unclickable_Object("BARB NIGHT"); - Unobstacle_Object("Box-Floor Hole01", true); - Unobstacle_Object("Box-Floor Hole02", true); - Unobstacle_Object("Box-Floor Hole03", true); -} - -bool ScriptBB10::MouseClick(int x, int y) { - return false; -} - -bool ScriptBB10::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptBB10::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptBB10::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptBB10::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, 225.58f, 67.2f, -102.1f, 0, 1, false, 0)) { - Player_Set_Combat_Mode(false); - Actor_Face_Heading(0, 274, false); - Footstep_Sound_Override_On(2); - Loop_Actor_Travel_Stairs(0, 2, 1, 0); - Footstep_Sound_Override_Off(); - Footstep_Sound_Override_On(2); - Loop_Actor_Travel_Ladder(0, 3, 1, 0); - Footstep_Sound_Override_Off(); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(222); - Set_Enter(26, 12); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, 206.01f, 66.84f, -261.62f, 0, 1, false, 0) && !Loop_Actor_Walk_To_XYZ(0, 151.67f, 66.84f, -313.06f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Reset(216); - Game_Flag_Set(221); - Set_Enter(24, 10); - } - return true; - } - return false; -} - -bool ScriptBB10::ClickedOn2DRegion(int region) { - if (!Loop_Actor_Walk_To_XYZ(0, 225.58f, 67.2f, -102.1f, 0, 1, false, 0)) { - Actor_Face_Heading(0, 274, false); - Sound_Play(Random_Query(289, 290), 40, 70, 70, 50); - switch (region) { - case 4: - Overlay_Remove("BB10OVR5"); - Game_Flag_Set(470); - Scene_2D_Region_Remove(4); - break; - case 3: - Overlay_Remove("BB10OVR4"); - Game_Flag_Set(469); - Scene_2D_Region_Remove(3); - break; - case 2: - Overlay_Remove("BB10OVR3"); - Game_Flag_Set(468); - Scene_2D_Region_Remove(2); - break; - case 1: - Overlay_Remove("BB10OVR2"); - Game_Flag_Set(467); - Scene_2D_Region_Remove(1); - break; - case 0: - Overlay_Remove("BB10OVR1"); - Game_Flag_Set(466); - Scene_2D_Region_Remove(0); - break; - default: - break; - } - Global_Variable_Increment(36, 1); - if (Global_Variable_Query(36) > 4) { - Scene_Exit_Add_2D_Exit(0, 281, 0, 531, 115, 0); - } - return false; - } - return true; -} - -void ScriptBB10::SceneFrameAdvanced(int frame) { -} - -void ScriptBB10::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptBB10::PlayerWalkedIn() { - if (Game_Flag_Query(216)) { - Player_Loses_Control(); - Actor_Set_At_XYZ(0, 214.01f, 66.84f, -349.62f, 462); - Loop_Actor_Walk_To_XYZ(0, 206.01f, 66.84f, -261.62f, 0, 0, false, 0); - Player_Gains_Control(); - Game_Flag_Reset(216); - } else if (Game_Flag_Query(223)) { - Actor_Set_At_XYZ(0, 249.58f, 127.2f, -102.1f, 256); - Footstep_Sound_Override_On(2); - Loop_Actor_Travel_Ladder(0, 3, 0, 0); - Footstep_Sound_Override_Off(); - Actor_Face_Heading(0, 768, false); - Footstep_Sound_Override_On(2); - Loop_Actor_Travel_Stairs(0, 3, 0, 0); - Footstep_Sound_Override_Off(); - Game_Flag_Reset(223); - } -} - -void ScriptBB10::PlayerWalkedOut() { -} - -void ScriptBB10::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/bb11.cpp b/engines/bladerunner/script/bb11.cpp deleted file mode 100644 index 686172d965..0000000000 --- a/engines/bladerunner/script/bb11.cpp +++ /dev/null @@ -1,132 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptBB11::InitializeScene() { - Setup_Scene_Information(43.39f, -10.27f, -20.52f, 200); - if (!Game_Flag_Query(509)) { - Scene_Exit_Add_2D_Exit(0, 280, 154, 388, 247, 2); - } - Ambient_Sounds_Add_Looping_Sound(101, 90, 0, 1); - Ambient_Sounds_Add_Looping_Sound(99, 45, 0, 1); - Ambient_Sounds_Add_Looping_Sound(100, 76, 0, 1); - Ambient_Sounds_Add_Sound(68, 5, 180, 16, 25, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(69, 5, 180, 16, 25, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(375, 5, 180, 50, 100, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(376, 5, 180, 50, 100, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(377, 5, 180, 50, 100, 0, 0, -101, -101, 0, 0); - if (Game_Flag_Query(509)) { - Preload(19); - Preload(220); - Preload(227); - Preload(328); - Preload(343); - Preload(344); - Preload(17); - Preload(14); - Preload(324); - Preload(323); - Preload(18); - Preload(345); - } -} - -void ScriptBB11::SceneLoaded() { - Obstacle_Object("X2AIRCON01", true); - Unclickable_Object("X2AIRCON01"); - if (Game_Flag_Query(509)) { - Unobstacle_Object("X2PIPES01", true); - Unobstacle_Object("X2PIPES02", true); - Unobstacle_Object("X2PIPES03", true); - Unobstacle_Object("X2_VENTS05", true); - Unobstacle_Object("X2_VENTSCYL05", true); - } -} - -bool ScriptBB11::MouseClick(int x, int y) { - return false; -} - -bool ScriptBB11::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptBB11::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptBB11::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptBB11::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, 43.39f, -10.27f, -68.52f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(223); - Set_Enter(25, 11); - } - return true; - } - return false; -} - -bool ScriptBB11::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptBB11::SceneFrameAdvanced(int frame) { - if (Actor_Query_Goal_Number(8) == 105 && !Game_Flag_Query(375)) { - Actor_Change_Animation_Mode(0, 48); - Game_Flag_Set(375); - } else { - if (frame == 1) { - Sound_Play(74, 10, -100, 100, 50); - } - } -} - -void ScriptBB11::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptBB11::PlayerWalkedIn() { - if (Actor_Query_Goal_Number(8) == 102 && Global_Variable_Query(1) == 2) { - Actor_Set_Invisible(0, true); - Actor_Set_Goal_Number(8, 103); - Music_Play(11, 61, 0, 1, -1, 0, 0); - Player_Loses_Control(); - } -} - -void ScriptBB11::PlayerWalkedOut() { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); -} - -void ScriptBB11::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/bb12.cpp b/engines/bladerunner/script/bb12.cpp deleted file mode 100644 index 336b0592cb..0000000000 --- a/engines/bladerunner/script/bb12.cpp +++ /dev/null @@ -1,144 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptBB12::InitializeScene() { - if (Game_Flag_Query(364)) { - Setup_Scene_Information(138.0f, 0.0f, 104.0f, 760); - } else if (Game_Flag_Query(506)) { - Setup_Scene_Information(-129.0f, 0.0f, 64.0f, 307); - } else { - Setup_Scene_Information(54.0f, 0.0f, 200.0f, 0); - Game_Flag_Reset(301); - } - Scene_Exit_Add_2D_Exit(0, 0, 0, 30, 479, 3); - Scene_Exit_Add_2D_Exit(1, 589, 0, 639, 479, 1); - Scene_Exit_Add_2D_Exit(2, 377, 374, 533, 479, 2); - Ambient_Sounds_Add_Looping_Sound(103, 28, 0, 1); - Ambient_Sounds_Add_Sound(443, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(444, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(445, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(446, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(303, 5, 50, 27, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(304, 5, 50, 27, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(305, 5, 50, 27, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(306, 5, 50, 27, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(307, 5, 50, 27, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(308, 5, 50, 27, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(309, 5, 50, 27, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(310, 5, 50, 27, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(375, 5, 180, 25, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(376, 5, 180, 25, 25, -100, 100, -101, -101, 0, 0); - if (!Game_Flag_Query(497)) { - Overlay_Play("BB12OVER", 0, 0, 0, 0); - Game_Flag_Set(497); - } -} - -void ScriptBB12::SceneLoaded() { - Obstacle_Object("BALLS", true); - Unclickable_Object("BALLS"); -} - -bool ScriptBB12::MouseClick(int x, int y) { - return false; -} - -bool ScriptBB12::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptBB12::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptBB12::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptBB12::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -129.0f, 0.0f, 64.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(507); - Set_Enter(23, 9); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, 138.0f, 0.0f, 104.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(365); - Set_Enter(3, 8); - } - return true; - } - if (exitId == 2) { - if (!Loop_Actor_Walk_To_XYZ(0, 54.0f, 0.0f, 200.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(302); - Set_Enter(22, 6); - } - return true; - } - return false; -} - -bool ScriptBB12::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptBB12::SceneFrameAdvanced(int frame) { - if (frame == 10 || frame == 22 || frame == 33 || frame == 41) { - Sound_Play(311, 17, -30, -30, 50); - } - if (frame == 3) { - Sound_Play(313, 16, -30, -30, 50); - } -} - -void ScriptBB12::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptBB12::PlayerWalkedIn() { - if (Game_Flag_Query(364)) { - Loop_Actor_Walk_To_XYZ(0, 114.0f, 0.0f, 104.0f, 0, 0, false, 0); - Game_Flag_Reset(364); - } else if (Game_Flag_Query(506)) { - Loop_Actor_Walk_To_XYZ(0, -101.0f, 0.0f, 64.0f, 0, 0, false, 0); - Game_Flag_Reset(506); - } -} - -void ScriptBB12::PlayerWalkedOut() { -} - -void ScriptBB12::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/bb51.cpp b/engines/bladerunner/script/bb51.cpp deleted file mode 100644 index 38079fa5be..0000000000 --- a/engines/bladerunner/script/bb51.cpp +++ /dev/null @@ -1,123 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptBB51::InitializeScene() { - Setup_Scene_Information(101.0f, 0.0f, -25.0f, 152); - Game_Flag_Reset(393); - Scene_Exit_Add_2D_Exit(0, 615, 0, 639, 479, 1); - Scene_Exit_Add_2D_Exit(1, 0, 323, 241, 479, 2); - Ambient_Sounds_Add_Looping_Sound(103, 28, 0, 1); - Ambient_Sounds_Add_Sound(303, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(304, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(443, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(444, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(445, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(446, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(305, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(306, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(307, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(308, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(309, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(310, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); - Scene_Loop_Start_Special(0, 0, 0); - Scene_Loop_Set_Default(1); -} - -void ScriptBB51::SceneLoaded() { - Obstacle_Object("V2CHESSTBL01", true); - Clickable_Object("V2CHESSTBL01"); - Clickable_Object("TOP02"); -} - -bool ScriptBB51::MouseClick(int x, int y) { - return false; -} - -bool ScriptBB51::ClickedOn3DObject(const char *objectName, bool a2) { - if (Object_Query_Click("V2CHESSTBL01", objectName)) { - Actor_Face_Object(0, "V2CHESSTBL01", true); - Actor_Voice_Over(80, 99); - Actor_Voice_Over(90, 99); - } - if (Object_Query_Click("TOP02", objectName)) { - Actor_Face_Object(0, "TOP02", true); - Actor_Voice_Over(100, 99); - Actor_Voice_Over(110, 99); - Actor_Voice_Over(120, 99); - } - return false; -} - -bool ScriptBB51::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptBB51::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptBB51::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, 76.0f, 0.0f, 79.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(394); - Set_Enter(1, 7); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, 55.0f, 0.0f, -96.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(395); - Set_Enter(1, 7); - } - return true; - } - return false; -} - -bool ScriptBB51::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptBB51::SceneFrameAdvanced(int frame) { -} - -void ScriptBB51::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptBB51::PlayerWalkedIn() { -} - -void ScriptBB51::PlayerWalkedOut() { -} - -void ScriptBB51::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ct01.cpp b/engines/bladerunner/script/ct01.cpp deleted file mode 100644 index 001c70245d..0000000000 --- a/engines/bladerunner/script/ct01.cpp +++ /dev/null @@ -1,515 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptCT01::InitializeScene() { - Music_Play(3, 28, 0, 2, -1, 1, 0); - Game_Flag_Reset(247); - if (Game_Flag_Query(68)) { - Game_Flag_Reset(68); - Setup_Scene_Information(-35.2f, -6.5f, 352.28f, 603); - } else if (Game_Flag_Query(71)) { - Game_Flag_Reset(71); - Setup_Scene_Information(-311.0f, -6.5f, 710.0f, 878); - } else if (Game_Flag_Query(88)) { - Game_Flag_Reset(88); - Setup_Scene_Information(-419.0f, -6.5f, 696.0f, 28); - if (Global_Variable_Query(1) != 2 && Global_Variable_Query(1) != 3) { - if (Game_Flag_Query(248)) { - Scene_Loop_Start_Special(0, 0, 0); - } else { - Scene_Loop_Start_Special(0, 6, 0); - } - } - } else if (Game_Flag_Query(248)) { - Setup_Scene_Information(-530.0f, -6.5f, 241.0f, 506); - Game_Flag_Set(247); - } else { - Setup_Scene_Information(-397.0f, -6.5f, 471.0f, 250); - } - Scene_Exit_Add_2D_Exit(0, 290, 256, 360, 304, 1); - if (Actor_Clue_Query(0, 18)) { - Scene_Exit_Add_2D_Exit(1, 571, 233, 639, 367, 1); - } - if (Game_Flag_Query(94)) { - Scene_Exit_Add_2D_Exit(2, 506, 400, 639, 479, 2); - } - if (Game_Flag_Query(248)) { - Scene_Exit_Add_2D_Exit(3, 0, 286, 158, 350, 2); - } - Ambient_Sounds_Add_Looping_Sound(54, 50, 1, 1); - Ambient_Sounds_Add_Looping_Sound(55, 40, -100, 1); - Ambient_Sounds_Add_Looping_Sound(56, 40, 100, 1); - Ambient_Sounds_Add_Sound(61, 10, 30, 16, 20, 0, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(62, 10, 30, 16, 20, 0, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(63, 10, 30, 16, 20, 0, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(64, 10, 30, 16, 20, 0, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Speech_Sound(60, 0, 10, 260, 27, 47, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 20, 10, 260, 27, 47, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 40, 10, 260, 27, 47, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 50, 10, 260, 27, 47, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Sound(68, 10, 40, 33, 50, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(69, 10, 40, 33, 50, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(375, 20, 40, 33, 50, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(376, 20, 40, 33, 50, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(377, 20, 40, 33, 50, -100, 100, -101, -101, 0, 0); - if (Game_Flag_Query(248)) { - Scene_Loop_Set_Default(2); - } else { - Scene_Loop_Set_Default(7); - } -} - -void ScriptCT01::SceneLoaded() { - Obstacle_Object("HYDRANT02", true); - Obstacle_Object("HOWWALLRT", true); - Obstacle_Object("HOW-CHAIR1", true); - Obstacle_Object("HOWWALLLFT", true); - Obstacle_Object("HOWDOOR01", true); - Unobstacle_Object("SPINNER BODY", true); - Unobstacle_Object("HOWFLOOR", true); - Unobstacle_Object("PAPER11", true); - Unobstacle_Object("PAPER16", true); - Unclickable_Object("HYDRANT02"); - Unclickable_Object("TURBINE"); - Unclickable_Object("SPINNER BODY"); - Unclickable_Object("OBJECT04"); -} - -bool ScriptCT01::MouseClick(int x, int y) { - return false; -} - -bool ScriptCT01::ClickedOn3DObject(const char *objectName, bool a2) { -// if ("ASIANSITTINGANDEATI" == objectName) { //bug? - if (Object_Query_Click("ASIANSITTINGANDEATI", objectName)) { - Actor_Face_Object(0, "ASIANSITTINGANDEATI", true); - Actor_Says(0, 365, 13); - Actor_Says(28, 160, 13); - return true; - } - return false; -} - -bool ScriptCT01::ClickedOnActor(int actorId) { - if (actorId == 28) { - Actor_Set_Goal_Number(28, 50); - if (!Loop_Actor_Walk_To_XYZ(0, -335.23f, -6.5f, 578.97f, 12, 1, false, 0)) { - Actor_Face_Actor(0, 28, true); - Actor_Face_Actor(28, 0, true); - if (!Game_Flag_Query(26)) { - Actor_Says(0, 260, 18); - Actor_Says(28, 0, 14); - Game_Flag_Set(26); - Actor_Set_Goal_Number(28, 0); - } else if (!Game_Flag_Query(30) && Actor_Query_Friendliness_To_Other(28, 0) >= 40) { - sub_40269C(); - Actor_Set_Goal_Number(28, 0); - } else { - if (Game_Flag_Query(31)) { - Actor_Says(0, 330, 17); - Actor_Says(28, 130, 13); - Actor_Says(28, 140, 14); - } else if (Actor_Query_Friendliness_To_Other(28, 0) < 50) { - Actor_Says(0, 330, 13); - Actor_Says(28, 160, 15); - } else { - Actor_Says(0, 310, 11); - Actor_Says(28, 10, 16); - } - Actor_Set_Goal_Number(28, 0); - } - return true; - } - } - if (actorId == 19) { - if (!Loop_Actor_Walk_To_XYZ(0, -335.23f, -6.5f, 578.97f, 12, 1, false, 0)) { - Actor_Face_Actor(0, 19, true); - Actor_Says(0, 355, 18); - if (!Actor_Query_Goal_Number(19)) { - Actor_Says(19, 10, 16); - Actor_Face_Actor(28, 0, true); - Actor_Says(28, 150, 3); - Actor_Face_Actor(0, 28, true); - Actor_Says(0, 360, 13); - Actor_Modify_Friendliness_To_Other(28, 0, -5); - Actor_Modify_Friendliness_To_Other(19, 0, -4); - } - return true; - } - } - if (actorId == 2) { - //todo: some weird code in assembly EBP is used but may not be initialized, loc_401C78 - if (!Actor_Query_Goal_Number(2)) { - if (Loop_Actor_Walk_To_XYZ(0, -338.1f, -6.5f, 419.65f, 6, 1, false, 0)) { - return false; - } - } - - Actor_Face_Actor(0, 2, true); - if (!Game_Flag_Query(32)) { - Actor_Says(0, 335, 18); - Actor_Says(2, 20, 30); - Game_Flag_Set(32); - Actor_Clue_Acquire(2, 213, 1, 0); - Actor_Clue_Acquire(0, 214, 1, 0); - Actor_Modify_Friendliness_To_Other(2, 0, -1); - } else if (Actor_Query_Goal_Number(2)) { - Actor_Says(0, 365, 14); - } else { - Actor_Says(0, 340, 13); - Actor_Says(0, 345, 11); - Actor_Says(2, 30, 30); - Actor_Says(0, 350, 13); - Actor_Says(2, 40, 30); - Actor_Modify_Friendliness_To_Other(2, 0, -5); - Player_Loses_Control(); - } - if (Actor_Query_Is_In_Current_Set(19)) { - Actor_Modify_Friendliness_To_Other(19, 0, -2); - } - return true; - } - return false; -} - -bool ScriptCT01::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptCT01::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -327.5f, -6.5f, 352.28f, 0, 1, false, 0)) { - Player_Loses_Control(); - Loop_Actor_Walk_To_Waypoint(0, 106, 0, 0, false); - Player_Gains_Control(); - Game_Flag_Reset(247); - Set_Enter(27, 14); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -259.0f, -6.5f, 710.0f, 0, 1, false, 0)) { - Game_Flag_Reset(247); - Set_Enter(5, 15); - } - return true; - } - if (exitId == 2) { - if (!Loop_Actor_Walk_To_XYZ(0, -419.0f, -6.5f, 696.0f, 0, 1, false, 0)) { - Game_Flag_Set(123); - Game_Flag_Reset(247); - Set_Enter(4, 24); - } - return true; - } - if (exitId == 3) { - if (!Loop_Actor_Walk_To_XYZ(0, -314.0f, -6.5f, 326.0f, 0, 1, false, 0)) { - Loop_Actor_Walk_To_XYZ(0, -330.0f, -6.5f, 221.0f, 0, 0, true, 0); - Loop_Actor_Walk_To_XYZ(0, -530.0f, -6.5f, 241.0f, 0, 0, true, 0); - Game_Flag_Reset(176); - Game_Flag_Reset(182); - Game_Flag_Reset(179); - Game_Flag_Reset(178); - Game_Flag_Reset(180); - Game_Flag_Reset(261); - Game_Flag_Reset(177); - Game_Flag_Reset(258); - int spinnerDest = Spinner_Interface_Choose_Dest(-1, 0); - - switch (spinnerDest) { - case 0: - Game_Flag_Set(178); - Game_Flag_Reset(247); - Game_Flag_Reset(248); - Game_Flag_Set(251); - Set_Enter(61, 65); - Scene_Loop_Start_Special(1, 5, 1); - break; - case 1: - Game_Flag_Set(179); - Game_Flag_Reset(247); - Game_Flag_Reset(248); - Game_Flag_Set(250); - Set_Enter(49, 48); - Scene_Loop_Start_Special(1, 5, 1); - break; - case 2: - Game_Flag_Set(182); - Game_Flag_Reset(247); - Game_Flag_Reset(248); - Game_Flag_Set(249); - Set_Enter(69, 78); - Scene_Loop_Start_Special(1, 5, 1); - break; - case 4: - Game_Flag_Set(180); - Game_Flag_Reset(247); - Game_Flag_Reset(248); - Game_Flag_Set(252); - Set_Enter(0, 0); - Scene_Loop_Start_Special(1, 5, 1); - break; - case 5: - Game_Flag_Set(261); - Game_Flag_Reset(248); - Game_Flag_Reset(247); - Game_Flag_Set(307); - Set_Enter(17, 82); - Scene_Loop_Start_Special(1, 5, 1); - break; - case 6: - Game_Flag_Set(177); - Game_Flag_Reset(247); - Game_Flag_Reset(248); - Game_Flag_Set(253); - Set_Enter(7, 25); - Scene_Loop_Start_Special(1, 5, 1); - break; - case 7: - Game_Flag_Set(258); - Game_Flag_Reset(247); - Game_Flag_Reset(248); - Game_Flag_Set(254); - Set_Enter(20, 2); - Scene_Loop_Start_Special(1, 5, 1); - break; - case 8: - Game_Flag_Set(181); - Game_Flag_Reset(247); - Game_Flag_Reset(248); - Game_Flag_Set(255); - Set_Enter(54, 54); - Scene_Loop_Start_Special(1, 5, 1); - break; - case 9: - Game_Flag_Set(257); - Game_Flag_Reset(247); - Game_Flag_Reset(248); - Game_Flag_Set(256); - Set_Enter(37, 34); - Scene_Loop_Start_Special(1, 5, 1); - break; - default: - Game_Flag_Set(176); - Player_Loses_Control(); - Loop_Actor_Walk_To_XYZ(0, -530.0f, -6.5f, 241.0f, 0, 0, true, 0); - Loop_Actor_Walk_To_XYZ(0, -330.0f, -6.5f, 221.0f, 0, 0, true, 0); - Loop_Actor_Walk_To_XYZ(0, -314.0f, -6.5f, 326.0f, 0, 0, false, 0); - Player_Gains_Control(); - break; - } - } - return true; - } - return false; -} - -bool ScriptCT01::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptCT01::SceneFrameAdvanced(int frame) { - if ((frame < 316 || frame > 435) && !((frame - 1) % 10)) { - /*int v1; - int v2 = Random_Query(0, 1); - if (v2 <= 1) { - if (v2) { - v1 = 60; - } else { - v1 = 59; - } - }*/ - Ambient_Sounds_Play_Sound(/*v1*/Random_Query(59, 60), 25, 30, 30, 0); - } - if (frame == 23) { - Ambient_Sounds_Play_Sound(118, 40, 99, 0, 0); - } - if (frame == 316) { - Ambient_Sounds_Play_Sound(373, 50, -50, 100, 99); - } - if (frame == 196 || frame == 452) { - int v3 = Random_Query(0, 6); - if (v3 == 0) { - Overlay_Play("ct01spnr", 0, 0, 1, 0); - if (Random_Query(0, 1)) { - Ambient_Sounds_Play_Sound(68, Random_Query(33, 50), 0, 0, 0); - } else { - Ambient_Sounds_Play_Sound(67, Random_Query(33, 50), 0, 0, 0); - } - } else if (v3 == 1) { - Overlay_Play("ct01spnr", 1, 0, 1, 0); - if (Random_Query(0, 1)) { - Ambient_Sounds_Play_Sound(69, Random_Query(33, 50), 0, 0, 0); - } else { - Ambient_Sounds_Play_Sound(66, Random_Query(33, 50), 0, 0, 0); - } - - } - } -} - -void ScriptCT01::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptCT01::PlayerWalkedIn() { - if (Game_Flag_Query(234)) { - Loop_Actor_Walk_To_XYZ(0, -327.2f, -6.5f, 352.28f, 0, 0, false, 0); - Game_Flag_Reset(234); - } else { - if (!Game_Flag_Query(247)) { - Game_Flag_Reset(247); - } - Loop_Actor_Walk_To_XYZ(0, -330.0f, -6.5f, 221.0f, 0, 0, false, 0); - Loop_Actor_Walk_To_XYZ(0, -314.0f, -6.5f, 326.0f, 0, 0, false, 0); - if (!Game_Flag_Query(25)) { - Game_Flag_Set(25); - if (!Game_Flag_Query(378)) { - Actor_Voice_Over(200, 99); - Actor_Voice_Over(210, 99); - Actor_Voice_Over(220, 99); - } - } - } -} - -void ScriptCT01::PlayerWalkedOut() { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - if (Game_Flag_Query(123)) { - Ambient_Sounds_Remove_Looping_Sound(55, true); - Ambient_Sounds_Remove_Looping_Sound(56, true); - } else { - Ambient_Sounds_Remove_All_Looping_Sounds(1); - } - Music_Stop(5); - if (!Game_Flag_Query(176) && Global_Variable_Query(1)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Outtake_Play(38, 1, -1); - } -} - -void ScriptCT01::DialogueQueueFlushed(int a1) { -} - -void ScriptCT01::sub_40269C() { - Dialogue_Menu_Clear_List(); - if (Actor_Clue_Query(0, 13)) { - DM_Add_To_List_Never_Repeat_Once_Selected(40, 4, 5, 6); - } - if ((Actor_Clue_Query(0, 8) || Actor_Clue_Query(0, 9)) && !Game_Flag_Query(27)) { - DM_Add_To_List_Never_Repeat_Once_Selected(50, 5, 5, 4); - } - if (Actor_Clue_Query(0, 8) && Actor_Clue_Query(0, 9) && Game_Flag_Query(27) && !Game_Flag_Query(28)) { - DM_Add_To_List_Never_Repeat_Once_Selected(60, 3, 5, 5); - } - if (Game_Flag_Query(293)) { - DM_Add_To_List_Never_Repeat_Once_Selected(80, 9, 9, 9); - } else if (Game_Flag_Query(29)) { - DM_Add_To_List_Never_Repeat_Once_Selected(80, 3, 4, 8); - } - if (Actor_Clue_Query(0, 30) && Actor_Clue_Query(0, 40) == 1) { - DM_Add_To_List_Never_Repeat_Once_Selected(90, 5, 4, 5); - } - DM_Add_To_List_Never_Repeat_Once_Selected(70, 7, 3, -1); - Dialogue_Menu_Add_DONE_To_List(100); - Dialogue_Menu_Appear(320, 240); - int answer = Dialogue_Menu_Query_Input(); - Dialogue_Menu_Disappear(); - switch (answer) { - case 40: - Actor_Says(0, 265, 11); - Actor_Says(28, 20, 14); - if (Actor_Query_Is_In_Current_Set(19)) { - if (!Actor_Query_Goal_Number(19)) { - Actor_Face_Actor(28, 19, true); - Actor_Says(28, 120, 14); - Actor_Face_Actor(19, 28, true); - Actor_Says(19, 40, 18); - Actor_Face_Heading(19, 103, false); - Actor_Face_Actor(28, 0, true); - Actor_Modify_Friendliness_To_Other(19, 0, -2); - if (Actor_Query_Is_In_Current_Set(2)) { - Actor_Modify_Friendliness_To_Other(2, 0, -3); - Actor_Clue_Acquire(2, 213, 1, 0); - } - } - } - break; - case 50: - if (Actor_Clue_Query(0, 8) == 1) { - Actor_Says(0, 270, 11); - Actor_Says(28, 30, 16); - } else { - Actor_Says(0, 280, 11); - Actor_Says(28, 40, 14); - } - Game_Flag_Set(27); - break; - case 60: - if (Actor_Clue_Query(0, 9) == 1) { - Actor_Says(0, 270, 11); - Actor_Says(28, 40, 15); - } else { - Actor_Says(0, 270, 11); - Actor_Says(28, 30, 14); - } - Actor_Modify_Friendliness_To_Other(28, 0, 5); - Game_Flag_Set(28); - break; - case 70: - Actor_Says(0, 290, 13); - if (Actor_Query_Friendliness_To_Other(28, 0) > 49 && (Global_Variable_Query(2) > 10 || Query_Difficulty_Level() == 0)) { - Actor_Says(28, 50, 3); - Actor_Says(28, 60, 3); - Actor_Face_Actor(28, 0, true); - Actor_Says(28, 70, 16); - Actor_Says(0, 325, 13); - if (Query_Difficulty_Level() != 0) { - Global_Variable_Decrement(2, 10); - } - Game_Flag_Set(192); - } else { - Actor_Says(28, 130, 15); - } - break; - case 80: - Actor_Says(0, 295, 11); - Actor_Says(28, 90, 14); - Actor_Says(28, 100, 13); - Actor_Clue_Acquire(0, 25, 1, 28); - Actor_Modify_Friendliness_To_Other(28, 0, -3); - break; - case 90: - Actor_Says(0, 300, 13); - Actor_Says(28, 110, 16); - break; - case 100: - Actor_Says(0, 305, 18); - break; - } -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ct02.cpp b/engines/bladerunner/script/ct02.cpp deleted file mode 100644 index aecf29139a..0000000000 --- a/engines/bladerunner/script/ct02.cpp +++ /dev/null @@ -1,294 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptCT02::InitializeScene() { - if (Game_Flag_Query(70)) { - Game_Flag_Reset(70); - Setup_Scene_Information(-154.83f, -145.11f, 9.39f, 516); - } else if (Game_Flag_Query(720)) { - Setup_Scene_Information(-213.82f, -145.11f, 214.43f, 82); - } else { - Setup_Scene_Information(-119.02f, -145.11f, 240.99f, 768); - } - Scene_Exit_Add_2D_Exit(0, 590, 0, 639, 479, 1); - if (Actor_Clue_Query(0, 18)) { - Scene_Exit_Add_2D_Exit(1, 332, 163, 404, 297, 0); - } else { - Overlay_Play("ct02over", 0, 1, 0, 0); - } - Ambient_Sounds_Add_Looping_Sound(96, 25, 0, 1); - Ambient_Sounds_Add_Looping_Sound(56, 38, 100, 1); - Ambient_Sounds_Add_Looping_Sound(95, 32, 0, 1); - Ambient_Sounds_Add_Sound(61, 10, 30, 8, 8, 100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(62, 10, 30, 7, 7, 100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(63, 10, 30, 8, 8, 100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(64, 10, 30, 7, 7, 100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Speech_Sound(60, 0, 10, 260, 17, 19, 100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 20, 10, 260, 17, 19, 100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 40, 10, 260, 17, 19, 100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 50, 10, 260, 17, 19, 100, 100, -101, -101, 1, 1); - if (Game_Flag_Query(293)) { - Scene_Loop_Set_Default(3); - } else { - Scene_Loop_Set_Default(0); - } -} - -void ScriptCT02::SceneLoaded() { - Obstacle_Object("STOVE-1", true); - Unobstacle_Object("BACK-DOOR", true); - Unclickable_Object("STOVE-1"); - Unclickable_Object("STOVE-2"); - Unclickable_Object("STOVE-3"); - Unclickable_Object("STOVE-4"); - Unclickable_Object("BIGPOT"); - Unclickable_Object("SOUP-BOWL"); - Unclickable_Object("HOWCOUNTRM"); - Unclickable_Object("LFTSTOVE-1"); - Unclickable_Object("FRIDGE-1"); - Unclickable_Object("LEFTWALL"); - Unclickable_Object("RIGHTWALL"); - Unclickable_Object("BACKWALL"); - Unclickable_Object("TABLE-1"); - Unclickable_Object("COUNTER-2"); - Unclickable_Object("COFFEJUG IN FOREGRO"); - Unclickable_Object("BACK-DOOR"); - if (!Game_Flag_Query(293)) { - Preload(0); - Preload(3); - Preload(3); - Preload(28); - Preload(400); - Preload(419); - Preload(420); - } - if (Game_Flag_Query(720)) { - Game_Flag_Reset(720); - Actor_Change_Animation_Mode(0, 0); - Player_Set_Combat_Mode(true); - Player_Gains_Control(); - } -} - -bool ScriptCT02::MouseClick(int x, int y) { - if (Actor_Query_Goal_Number(19) == 8) { - Actor_Set_Goal_Number(0, 1); - return true; - } - return false; -} - -bool ScriptCT02::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -void ScriptCT02::sub_401ACC() { - Dialogue_Menu_Clear_List(); - if (Actor_Clue_Query(0, 13)) { - DM_Add_To_List_Never_Repeat_Once_Selected(270, 8, 5, 3); - } - if (Actor_Clue_Query(0, 22) && !Actor_Clue_Query(0, 13)) { - DM_Add_To_List_Never_Repeat_Once_Selected(280, 8, 5, 3); - } - int v0 = 0; - if (Actor_Clue_Query(0, 2)) { - v0 = 1; - } - if (Actor_Clue_Query(0, 10)) { - ++v0; - } - if (Actor_Clue_Query(0, 3)) { - ++v0; - } - if (Actor_Clue_Query(0, 16)) { - ++v0; - } - if (Actor_Clue_Query(0, 25)) { - ++v0; - } - if (v0 > 3) { - DM_Add_To_List_Never_Repeat_Once_Selected(290, -1, 4, 8); - } - Dialogue_Menu_Add_DONE_To_List(300); - Dialogue_Menu_Appear(320, 240); - int answerValue = Dialogue_Menu_Query_Input(); - Dialogue_Menu_Disappear(); - switch (answerValue) { - case 270: - Actor_Says(0, 380, 11); - Actor_Says(19, 30, 17); - Actor_Says(19, 40, 15); - Actor_Says(0, 410, 9); - Actor_Says(19, 50, 18); - Actor_Says(0, 415, 10); - Actor_Clue_Acquire(0, 19, 0, -1); - Actor_Modify_Friendliness_To_Other(19, 0, -5); - if (Actor_Query_Friendliness_To_Other(19, 0) < 44) { - Scene_Exits_Disable(); - Actor_Clue_Acquire(0, 18, 1, -1); - Actor_Set_Goal_Number(19, 8); - Game_Flag_Set(293); - Scene_Loop_Set_Default(3); - Scene_Loop_Start_Special(2, 2, 1); - } - break; - case 280: - Actor_Says(0, 385, 9); - Actor_Says(19, 40, 19); - Actor_Modify_Friendliness_To_Other(19, 0, -2); - if (Actor_Query_Friendliness_To_Other(19, 0) < 44) { - Scene_Exits_Disable(); - Actor_Clue_Acquire(0, 18, 1, -1); - Actor_Set_Goal_Number(19, 8); - Game_Flag_Set(293); - Scene_Loop_Set_Default(3); - Scene_Loop_Start_Special(2, 2, 1); - } - break; - case 290: - Actor_Says(0, 395, 9); - Actor_Says(0, 400, 9); - Actor_Says(19, 70, 17); - Actor_Says(0, 420, 10); - Actor_Says(19, 80, 14); - Actor_Modify_Friendliness_To_Other(19, 0, -10); - if (Actor_Query_Friendliness_To_Other(19, 0) < 44) { - Scene_Exits_Disable(); - Actor_Clue_Acquire(0, 18, 1, -1); - Actor_Set_Goal_Number(19, 8); - Game_Flag_Set(293); - Scene_Loop_Set_Default(3); - Scene_Loop_Start_Special(2, 2, 1); - } - break; - case 300: - Actor_Says(0, 405, 11); - if (Actor_Query_Friendliness_To_Other(19, 0) < 44) { - Scene_Exits_Disable(); - Actor_Clue_Acquire(0, 18, 1, -1); - Actor_Set_Goal_Number(19, 8); - Game_Flag_Set(293); - Scene_Loop_Set_Default(3); - Scene_Loop_Start_Special(2, 2, 1); - } - break; - } -} - -bool ScriptCT02::ClickedOnActor(int actorId) { - if (actorId == 19 && Actor_Query_Goal_Number(19) == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -255.02f, -145.11f, 212.42f, 0, 1, false, 0)) { - Actor_Face_Actor(0, 19, true); - Actor_Face_Actor(19, 0, true); - if (!Game_Flag_Query(59)) { - Actor_Says(0, 370, 10); - Actor_Says(19, 20, 19); - Actor_Says(0, 375, 9); - Game_Flag_Set(59); - } - sub_401ACC(); - return true; - } - } - return false; -} - -bool ScriptCT02::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptCT02::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -111.2f, -145.11f, 243.28f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(234); - Game_Flag_Set(68); - Set_Enter(4, 13); - } - return true; - } - if (exitId == 1) { - bool v1; - if (Player_Query_Combat_Mode()) { - v1 = Loop_Actor_Walk_To_XYZ(0, -154.83f, -145.11f, -82.61f, 0, 1, true, 0); - } else { - v1 = Loop_Actor_Walk_To_XYZ(0, -154.83f, -145.11f, -82.61f, 0, 1, false, 0); - } - if (!v1) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(69); - Set_Enter(5, 15); - } - return true; - } - return false; -} - -bool ScriptCT02::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptCT02::SceneFrameAdvanced(int frame) { - if (frame == 6 || frame == 12 || frame == 19 || frame == 25 || frame == 46 || frame == 59) { - Sound_Play(97, Random_Query(25, 33), -70, -70, 50); - } - if (frame == 72) { - Sound_Play(200, 50, 0, 0, 50); - } - if (frame == 71) { - Sound_Play(204, 40, 0, 0, 50); - } - if (frame == 72) { - Sound_Play(203, 60, -20, 40, 50); - } - if (frame == 61) { - Music_Play(1, 50, 0, 2, -1, 0, 0); - } - if (frame == 81) { - Scene_Exit_Add_2D_Exit(1, 332, 163, 404, 297, 0); - Scene_Exits_Enable(); - } -} - -void ScriptCT02::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptCT02::PlayerWalkedIn() { -} - -void ScriptCT02::PlayerWalkedOut() { - if (Actor_Clue_Query(0, 18)) { - return; - } - Overlay_Remove("ct02over"); -} - -void ScriptCT02::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ct03.cpp b/engines/bladerunner/script/ct03.cpp deleted file mode 100644 index b7dcdd4e46..0000000000 --- a/engines/bladerunner/script/ct03.cpp +++ /dev/null @@ -1,132 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptCT03::InitializeScene() { - if (Game_Flag_Query(719)) { - Setup_Scene_Information(-852.58f, -621.3f, 285.6f, 0); - } else if (Game_Flag_Query(69)) { - Game_Flag_Reset(69); - Setup_Scene_Information(-557.1f, -616.31f, 224.29f, 249); - } else if (Game_Flag_Query(73)) { - Game_Flag_Reset(73); - Setup_Scene_Information(-173.99f, -619.19f, 347.54f, 808); - } else { - Setup_Scene_Information(-708.58f, -619.19f, 277.6f, 239); - } - Scene_Exit_Add_2D_Exit(0, 0, 460, 639, 479, 2); - Scene_Exit_Add_2D_Exit(1, 40, 40, 134, 302, 3); - Scene_Exit_Add_2D_Exit(2, 390, 0, 539, 230, 1); - Ambient_Sounds_Add_Looping_Sound(54, 50, 1, 1); - Ambient_Sounds_Add_Looping_Sound(56, 22, -100, 1); - Ambient_Sounds_Add_Looping_Sound(105, 34, -100, 1); - Ambient_Sounds_Add_Sound(68, 10, 40, 33, 50, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(69, 10, 40, 33, 50, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(61, 3, 30, 8, 10, -100, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(62, 3, 30, 8, 10, -100, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(63, 3, 30, 8, 10, -100, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(64, 3, 30, 8, 10, -100, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Speech_Sound(60, 0, 10, 260, 27, 47, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 20, 10, 260, 27, 47, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 40, 10, 260, 27, 47, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 50, 10, 260, 27, 47, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Sound(376, 10, 60, 33, 50, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(377, 10, 60, 33, 50, -100, 100, -101, -101, 0, 0); -} - -void ScriptCT03::SceneLoaded() { - Obstacle_Object("TRASH CAN", true); - Unclickable_Object("TRASH CAN"); - Footstep_Sounds_Set(0, 0); - Footstep_Sounds_Set(1, 1); -} - -bool ScriptCT03::MouseClick(int x, int y) { - return false; -} - -bool ScriptCT03::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptCT03::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptCT03::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptCT03::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -745.09f, -619.09f, 293.36f, 0, 1, false, 0)) { - Game_Flag_Set(71); - Set_Enter(4, 13); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -604.38f, -616.15f, 221.6f, 0, 1, false, 0)) { - Game_Flag_Set(70); - Set_Enter(27, 14); - } - return true; - } - if (exitId == 2) { - if (!Loop_Actor_Walk_To_XYZ(0, -150.0f, -621.3f, 357.0f, 0, 1, false, 0)) { - Game_Flag_Set(72); - Async_Actor_Walk_To_XYZ(0, -67.0f, -621.3f, 477.0f, 0, false); - Set_Enter(5, 16); - } - return true; - } - return false; -} - -bool ScriptCT03::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptCT03::SceneFrameAdvanced(int frame) { -} - -void ScriptCT03::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptCT03::PlayerWalkedIn() { - if (Actor_Query_Goal_Number(19) == 2) { - Actor_Set_Goal_Number(19, 13); - } -} - -void ScriptCT03::PlayerWalkedOut() { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); -} - -void ScriptCT03::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ct04.cpp b/engines/bladerunner/script/ct04.cpp deleted file mode 100644 index cad32dfdd2..0000000000 --- a/engines/bladerunner/script/ct04.cpp +++ /dev/null @@ -1,237 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptCT04::InitializeScene() { - if (Game_Flag_Query(72)) { - Scene_Loop_Start_Special(0, 0, 0); - Scene_Loop_Set_Default(1); - Setup_Scene_Information(-150.0f, -621.3f, 357.0f, 533); - } else { - Scene_Loop_Set_Default(1); - Setup_Scene_Information(-82.86f, -621.3f, 769.03f, 1020); - } - Scene_Exit_Add_2D_Exit(0, 590, 0, 639, 479, 1); - Scene_Exit_Add_2D_Exit(1, 194, 84, 320, 274, 0); - Ambient_Sounds_Add_Looping_Sound(54, 50, 1, 1); - Ambient_Sounds_Add_Looping_Sound(56, 15, -100, 1); - Ambient_Sounds_Add_Looping_Sound(105, 34, 100, 1); - Ambient_Sounds_Add_Sound(68, 10, 40, 33, 50, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(69, 10, 40, 33, 50, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Speech_Sound(60, 0, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 20, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 40, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 50, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Sound(376, 10, 60, 33, 50, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(377, 10, 60, 33, 50, -100, 100, -101, -101, 0, 0); -} - -void ScriptCT04::SceneLoaded() { - Obstacle_Object("DUMPSTER", true); - Obstacle_Object("RIGHTWALL01", true); - Obstacle_Object("BACK-BLDNG", true); - Clickable_Object("DUMPSTER"); - Footstep_Sounds_Set(0, 1); - if (Game_Flag_Query(72)) { - Game_Flag_Reset(72); - } - if (!Actor_Query_Goal_Number(12)) { - Actor_Change_Animation_Mode(12, 38); - } -} - -bool ScriptCT04::MouseClick(int x, int y) { - return false; -} - -bool ScriptCT04::ClickedOn3DObject(const char *objectName, bool a2) { - if (objectName) { - if (!Game_Flag_Query(137) && !Game_Flag_Query(169) && !Actor_Query_Goal_Number(12)) { - Game_Flag_Set(137); - Actor_Set_Goal_Number(12, 2); - } - if (Game_Flag_Query(169) && !Game_Flag_Query(170) && !Game_Flag_Query(171) && !Game_Flag_Query(172) && Global_Variable_Query(1) == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -147.41f, -621.3f, 724.57f, 0, 1, false, 0)) { - Player_Loses_Control(); - Actor_Face_Heading(0, 792, false); - Actor_Put_In_Set(12, 99); - Actor_Set_At_XYZ(12, 0, 0, 0, 0); - Actor_Change_Animation_Mode(0, 40); - Actor_Voice_Over(320, 99); - Actor_Voice_Over(330, 99); - Actor_Voice_Over(340, 99); - Game_Flag_Set(170); - Game_Flag_Set(173); - } - return false; - } - if (Game_Flag_Query(170)) { - if (Game_Flag_Query(172)) { - Actor_Voice_Over(270, 99); - Actor_Voice_Over(280, 99); - } else if (Game_Flag_Query(171)) { - Actor_Voice_Over(250, 99); - Actor_Voice_Over(260, 99); - } else { - Actor_Voice_Over(230, 99); - Actor_Voice_Over(240, 99); - Game_Flag_Reset(173); - } - return true; - } - if (Game_Flag_Query(174)) { - if (!Loop_Actor_Walk_To_Waypoint(0, 75, 0, 1, false)) { - Actor_Face_Heading(0, 707, false); - Actor_Change_Animation_Mode(0, 38); - Ambient_Sounds_Play_Sound(553, 45, 30, 30, 0); - Actor_Voice_Over(1810, 99); - Actor_Voice_Over(1820, 99); - return true; - } - return false; - } - if (!Loop_Actor_Walk_To_Waypoint(0, 75, 0, 1, false)) { - Actor_Face_Heading(0, 707, false); - Actor_Change_Animation_Mode(0, 38); - Actor_Clue_Acquire(0, 37, 1, -1); - Item_Pickup_Spin_Effect(952, 392, 225); - Game_Flag_Set(174); - return true; - } - } - return false; -} - -void ScriptCT04::sub_401D4C() { - Dialogue_Menu_Clear_List(); - if (Global_Variable_Query(2) > 10 || Query_Difficulty_Level() == 0) { - DM_Add_To_List_Never_Repeat_Once_Selected(410, 8, 4, -1); - } - DM_Add_To_List_Never_Repeat_Once_Selected(420, 2, 6, 8); - Dialogue_Menu_Appear(320, 240); - int answer = Dialogue_Menu_Query_Input(); - Dialogue_Menu_Disappear(); - if (answer == 410) { - Actor_Says(12, 10, 14); - Actor_Says(12, 20, 14); - Actor_Modify_Friendliness_To_Other(12, 0, 5); - if (Query_Difficulty_Level() != 0) { - Global_Variable_Decrement(2, 10); - } - } else if (answer == 420) { - Actor_Says(0, 430, 3); - Actor_Says(12, 30, 14); - Actor_Modify_Friendliness_To_Other(12, 0, -5); - } -} - -bool ScriptCT04::ClickedOnActor(int actorId) { - if (actorId == 12) { - if (Game_Flag_Query(169)) { - if (!Loop_Actor_Walk_To_Actor(0, 12, 36, 1, false)) { - Actor_Voice_Over(290, 99); - Actor_Voice_Over(300, 99); - Actor_Voice_Over(310, 99); - } - } else { - Actor_Set_Targetable(12, false); - if (!Loop_Actor_Walk_To_Actor(0, 12, 36, 1, false)) { - Actor_Face_Actor(0, 12, true); - if (!Game_Flag_Query(137)) { - if (Game_Flag_Query(40)) { - Actor_Says(0, 435, 3); - Actor_Set_Goal_Number(12, 2); - } else { - Music_Stop(3); - Actor_Says(0, 425, 3); - Actor_Says(12, 0, 13); - sub_401D4C(); - Actor_Set_Goal_Number(12, 2); - } - Game_Flag_Set(137); - } else { - Actor_Face_Actor(0, 12, true); - Actor_Says(0, 435, 3); - } - } - } - return true; - } - return false; -} - -bool ScriptCT04::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptCT04::ClickedOnExit(int exitId) { - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -82.86f, -621.3f, 769.03f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - if (!Actor_Query_Goal_Number(12)) { - Actor_Set_Goal_Number(12, 2); - } - Game_Flag_Set(74); - Set_Enter(28, 17); - } - return true; - } - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -187.0f, -621.3f, 437.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(73); - Set_Enter(5, 15); - } - return true; - } - return false; -} - -bool ScriptCT04::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptCT04::SceneFrameAdvanced(int frame) { - if (Game_Flag_Query(325)) { - Game_Flag_Reset(325); - Sound_Play(180, 100, 80, 80, 50); - } -} - -void ScriptCT04::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptCT04::PlayerWalkedIn() { -} - -void ScriptCT04::PlayerWalkedOut() { -} - -void ScriptCT04::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ct05.cpp b/engines/bladerunner/script/ct05.cpp deleted file mode 100644 index 0249110653..0000000000 --- a/engines/bladerunner/script/ct05.cpp +++ /dev/null @@ -1,241 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptCT05::InitializeScene() { - if (Game_Flag_Query(90)) { - Game_Flag_Reset(90); - Setup_Scene_Information(-128.42f, -109.91f, 112.83f, 516); - } else if (Game_Flag_Query(78)) { - Setup_Scene_Information(192.35f, 43.09f, 128.97f, 768); - } else { - Setup_Scene_Information(-375.0f, -109.91f, 750.0f, 600); - } - if (Game_Flag_Query(94)) { - Scene_Exit_Add_2D_Exit(0, 228, 205, 293, 300, 0); - } - Scene_Exit_Add_2D_Exit(1, 320, 458, 639, 479, 2); - Scene_Exit_Add_2D_Exit(2, 380, 110, 542, 300, 0); - Ambient_Sounds_Add_Looping_Sound(106, 15, -100, 1); - Ambient_Sounds_Add_Looping_Sound(107, 15, 100, 1); - Ambient_Sounds_Add_Looping_Sound(56, 13, -100, 1); - Ambient_Sounds_Add_Sound(90, 5, 20, 8, 10, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(91, 5, 20, 8, 10, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(205, 5, 30, 18, 30, -100, 100, -101, -101, 0, 0); - if (Game_Flag_Query(94)) { - Scene_Loop_Set_Default(2); - } else { - Scene_Loop_Set_Default(0); - } - if (Actor_Query_Goal_Number(53) == 1) { - Overlay_Play("ct05over", 0, 1, 0, 0); - } -} - -void ScriptCT05::SceneLoaded() { - Obstacle_Object("STAIR 1", true); - Obstacle_Object("STAIR 2", true); - Obstacle_Object("GRGDOOR", true); - Obstacle_Object("GRGDOOR2", true); - Obstacle_Object("TURBINE", true); - Obstacle_Object("BARREL", true); - Obstacle_Object("GRNDPIPE", true); - Clickable_Object("TURBINE"); - Clickable_Object("LFTDOOR"); - Clickable_Object("BARREL"); - Clickable_Object("GRNDPIPE"); - Unclickable_Object("GDFRAME"); - Unclickable_Object("GDFRAME2"); - Unclickable_Object("WINFRAME1"); - Unclickable_Object("WINFRAME2"); - Unclickable_Object("STAIR 1"); - Unclickable_Object("STAIR 2"); - Unclickable_Object("LFTDOOR"); - Unclickable_Object("LFTDOORFRM"); -} - -bool ScriptCT05::MouseClick(int x, int y) { - return false; -} - -bool ScriptCT05::ClickedOn3DObject(const char *objectName, bool a2) { - if (Object_Query_Click("STAIR1", objectName)) { - Actor_Face_Object(0, objectName, true); - return true; - } - if (Object_Query_Click("STAIR2", objectName)) { - Actor_Face_Object(0, objectName, true); - return true; - } - if (Object_Query_Click("GRGDOOR", objectName)) { - Loop_Actor_Walk_To_Scene_Object(0, "GRGDOOR", 24, 1, false); - Actor_Face_Object(0, objectName, true); - Actor_Says(0, 8522, 12); - return true; - } - if (Object_Query_Click("GRGDOOR2", objectName)) { - Loop_Actor_Walk_To_Scene_Object(0, "GRGDOOR2", 24, 1, false); - Actor_Face_Object(0, objectName, true); - Actor_Says(0, 8522, 12); - return true; - } - if (Object_Query_Click("TURBINE", objectName)) { - Loop_Actor_Walk_To_Scene_Object(0, "TURBINE", 36, 1, false); - Actor_Face_Object(0, objectName, true); - Actor_Says(0, 8528, 12); - return true; - } - if (Object_Query_Click("LFTDOOR", objectName)) { - Actor_Face_Object(0, objectName, true); - Actor_Says(0, 8522, 12); - return true; - } - if (Object_Query_Click("BARREL", objectName)) { - Loop_Actor_Walk_To_Scene_Object(0, "BARREL", 36, 1, false); - Actor_Face_Object(0, objectName, true); - Actor_Says(0, 8529, 12); - return true; - } - if (Object_Query_Click("GRNDPIPE", objectName)) { - Loop_Actor_Walk_To_Scene_Object(0, "GRNDPIPE", 24, 1, false); - Actor_Face_Object(0, objectName, true); - Actor_Says(0, 8528, 12); - return true; - } - return false; -} - -bool ScriptCT05::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptCT05::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptCT05::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -128.42f, -109.91f, 112.83f, 0, 1, false, 0)) { - Game_Flag_Set(76); - if (Actor_Query_Goal_Number(53) == 1) { - Overlay_Remove("ct05over"); - } - Set_Enter(4, 24); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -308.18f, -109.91f, 674.77f, 0, 1, false, 0)) { - Game_Flag_Set(75); - if (Actor_Query_Goal_Number(53) == 1) { - Overlay_Remove("ct05over"); - Actor_Set_Goal_Number(53, 5); - Game_Flag_Set(409); - } - Set_Enter(5, 16); - } - return true; - } - if (exitId == 2) { - if (!Loop_Actor_Walk_To_XYZ(0, 71.99f, -109.91f, 288.79f, 0, 1, false, 0)) { - Footstep_Sound_Override_On(2); - Actor_Face_Object(0, "STAIR 2", true); - Loop_Actor_Travel_Stairs(0, 9, 1, 0); - Actor_Set_At_XYZ(0, 99.73f, -19.91f, 134.97f, 256); - Loop_Actor_Travel_Stairs(0, 5, 1, 0); - Footstep_Sound_Override_Off(); - Game_Flag_Set(77); - if (Actor_Query_Goal_Number(53) == 1) { - Overlay_Remove("ct05over"); - } - Set_Enter(29, 18); - } - return true; - } - return false; -} - -bool ScriptCT05::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptCT05::SceneFrameAdvanced(int frame) { - if (frame == 7 || frame == 15 || frame == 29) { - switch (Random_Query(0, 4)) { - case 4: - Sound_Play(40, Random_Query(25, 50), -70, -70, 50); - break; - case 3: - Sound_Play(44, Random_Query(25, 50), -70, -70, 50); - break; - case 2: - Sound_Play(43, Random_Query(25, 50), -70, -70, 50); - break; - case 1: - Sound_Play(42, Random_Query(25, 50), -70, -70, 50); - break; - case 0: - Sound_Play(41, Random_Query(25, 50), -70, -70, 50); - break; - } - } -} - -void ScriptCT05::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptCT05::PlayerWalkedIn() { - if (Game_Flag_Query(74)) { - Player_Loses_Control(); - Game_Flag_Reset(74); - if (Player_Query_Combat_Mode()) { - Loop_Actor_Walk_To_XYZ(0, -308.18f, -109.91f, 674.77f, 0, 0, true, 0); - } else { - Loop_Actor_Walk_To_XYZ(0, -308.18f, -109.91f, 674.77f, 0, 0, false, 0); - } - Player_Gains_Control(); - } - if (Game_Flag_Query(78)) { - Footstep_Sound_Override_On(2); - Loop_Actor_Travel_Stairs(0, 7, 0, 0); - Actor_Set_At_XYZ(0, 90.73f, -19.91f, 164.97f, 520); - Loop_Actor_Travel_Stairs(0, 10, 0, 0); - Game_Flag_Reset(78); - Footstep_Sound_Override_Off(); - if (Actor_Query_Goal_Number(2) == 2 && Game_Flag_Query(145)) { - Actor_Set_Goal_Number(2, 3); - } - } -} - -void ScriptCT05::PlayerWalkedOut() { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); -} - -void ScriptCT05::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ct06.cpp b/engines/bladerunner/script/ct06.cpp deleted file mode 100644 index 30dfd19bd3..0000000000 --- a/engines/bladerunner/script/ct06.cpp +++ /dev/null @@ -1,180 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptCT06::InitializeScene() { - if (Game_Flag_Query(77)) { - Setup_Scene_Information(20.41f, -58.23f, 2.17f, 247); - Game_Flag_Reset(77); - } else if (Game_Flag_Query(144)) { - Setup_Scene_Information(203.91f, -58.02f, 0.47f, 768); - } else { - Setup_Scene_Information(175.91f, -58.23f, 24.47f, 768); - } - Scene_Exit_Add_2D_Exit(0, 0, 440, 639, 479, 2); - Scene_Exit_Add_2D_Exit(1, 401, 162, 536, 317, 0); - if (Game_Flag_Query(40) && Actor_Query_In_Set(19, 30)) { - Actor_Put_In_Set(19, 29); - Actor_Set_At_XYZ(19, 58.41f, -58.23f, -24.97f, 240); - Actor_Retired_Here(19, 72, 36, 1, 0); - } - Ambient_Sounds_Add_Looping_Sound(381, 100, 1, 1); - Ambient_Sounds_Add_Looping_Sound(205, 20, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 0, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 20, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 40, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 50, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Sound(67, 80, 180, 16, 25, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(68, 50, 180, 16, 25, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(379, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(380, 70, 180, 50, 100, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(377, 60, 180, 50, 100, 0, 0, -101, -101, 0, 0); - if (Actor_Query_Goal_Number(19) == 13) { - Ambient_Sounds_Add_Sound(196, 1, 5, 25, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(197, 1, 5, 25, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(198, 1, 5, 25, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(199, 1, 5, 25, 25, -100, 100, -101, -101, 0, 0); - } -} - -void ScriptCT06::SceneLoaded() { - Obstacle_Object("BOX02", true); - Obstacle_Object("CB BOX01", true); - Obstacle_Object("CB BOX02", true); - Obstacle_Object("CB BOX03", true); - Unobstacle_Object("INSULPIP01", true); - Unobstacle_Object("CB BOX04", true); - Unclickable_Object("DOOR"); - if (Actor_Query_Goal_Number(19) == 13) { - Preload(3); - Preload(4); - Preload(389); - Preload(390); - Preload(398); - Preload(421); - Preload(421); - } -} - -bool ScriptCT06::MouseClick(int x, int y) { - return false; -} - -bool ScriptCT06::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptCT06::ClickedOnActor(int actorId) { - if (actorId == 19) { - Loop_Actor_Walk_To_Actor(0, 19, 24, 1, false); - Actor_Face_Actor(0, 19, true); - if (Game_Flag_Query(145)) { - Actor_Says(0, 8570, 13); - return false; - } - Actor_Clue_Acquire(0, 20, 1, -1); - Item_Pickup_Spin_Effect(984, 340, 369); - Actor_Voice_Over(350, 99); - Actor_Voice_Over(360, 99); - Actor_Voice_Over(370, 99); - if (!Game_Flag_Query(378)) { - Actor_Voice_Over(380, 99); - Actor_Voice_Over(390, 99); - Actor_Voice_Over(400, 99); - Actor_Voice_Over(410, 99); - } - Game_Flag_Set(145); - return true; - } - return false; -} - -bool ScriptCT06::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptCT06::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, 20.41f, -58.23f, -2.17f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(78); - Set_Enter(28, 17); - Game_Flag_Reset(212); - } - return true; - } - if (exitId == 1) { - if (Actor_Query_Goal_Number(19) == 13) { - if (!Loop_Actor_Walk_To_XYZ(0, 203.91f, -58.02f, 0.47f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_Sound(196, true); - Ambient_Sounds_Remove_Sound(197, true); - Ambient_Sounds_Remove_Sound(198, true); - Ambient_Sounds_Remove_Sound(199, true); - Player_Loses_Control(); - Actor_Set_Goal_Number(19, 11); - Game_Flag_Reset(212); - } - return true; - } - if (!Loop_Actor_Walk_To_XYZ(0, 203.91f, -58.02f, 0.47f, 0, 1, false, 0)) { - if (Global_Variable_Query(1) < 3) { - Actor_Face_Object(0, "DOOR", true); - Actor_Says(0, 8522, 12); - } else { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(79); - Set_Enter(6, 20); - Game_Flag_Reset(212); - } - } - } - return false; -} - -bool ScriptCT06::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptCT06::SceneFrameAdvanced(int frame) { -} - -void ScriptCT06::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptCT06::PlayerWalkedIn() { - if (Game_Flag_Query(144) == 1) { - Game_Flag_Reset(144); - } -} - -void ScriptCT06::PlayerWalkedOut() { -} - -void ScriptCT06::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ct07.cpp b/engines/bladerunner/script/ct07.cpp deleted file mode 100644 index 771d4be676..0000000000 --- a/engines/bladerunner/script/ct07.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptCT07::InitializeScene() { - Setup_Scene_Information(202.32f, -58.23f, -12.86f, 225); - Actor_Put_In_Set(19, 30); - Actor_Set_At_XYZ(19, -9.68f, -58.23f, 11.14f, 250); - Ambient_Sounds_Add_Looping_Sound(54, 30, 90, 1); - Ambient_Sounds_Add_Looping_Sound(205, 20, 1, 1); - Ambient_Sounds_Add_Looping_Sound(56, 40, 100, 1); - Ambient_Sounds_Add_Speech_Sound(60, 0, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 20, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 40, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 50, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Sound(67, 80, 180, 16, 25, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(68, 50, 180, 16, 25, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(379, 10, 60, 50, 100, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(375, 6, 50, 50, 100, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(377, 10, 70, 50, 100, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(61, 10, 30, 12, 14, 100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(62, 10, 30, 12, 14, 100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(63, 10, 30, 12, 14, 100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(64, 10, 30, 12, 14, 100, 100, -101, -101, 0, 0); -} - -void ScriptCT07::SceneLoaded() { - Obstacle_Object("BOX01", true); - Obstacle_Object("BOX02", true); - Obstacle_Object("BOX03", true); - Obstacle_Object("BOX04", true); - Unclickable_Object("BOX01"); - Unclickable_Object("BOX02"); - Unclickable_Object("BOX03"); - Unclickable_Object("BOX04"); -} - -bool ScriptCT07::MouseClick(int x, int y) { - return true; -} - -bool ScriptCT07::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptCT07::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptCT07::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptCT07::ClickedOnExit(int exitId) { - return false; -} - -bool ScriptCT07::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptCT07::SceneFrameAdvanced(int frame) { -} - -void ScriptCT07::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptCT07::PlayerWalkedIn() { - Player_Gains_Control(); - Non_Player_Actor_Combat_Mode_On(19, 0, 0, 0, 2, 4, 7, 8, 0, 0, 100, 15, 300, 0); - Game_Flag_Set(516); - Actor_Face_Actor(0, 19, true); -} - -void ScriptCT07::PlayerWalkedOut() { - Music_Stop(2); -} - -void ScriptCT07::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ct08.cpp b/engines/bladerunner/script/ct08.cpp deleted file mode 100644 index 42b924e498..0000000000 --- a/engines/bladerunner/script/ct08.cpp +++ /dev/null @@ -1,196 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptCT08::InitializeScene() { - if (Game_Flag_Query(679)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Outtake_Play(2, 0, -1); - if (Game_Flag_Query(46)) { - Outtake_Play(3, 0, -1); - } else if (Game_Flag_Query(47)) { - Outtake_Play(4, 0, -1); - } else { - Outtake_Play(5, 0, -1); - } - Outtake_Play(6, 0, -1); - Game_Flag_Reset(679); - } - Actor_Force_Stop_Walking(0); - if (Game_Flag_Query(380)) { - Setup_Scene_Information(-11.0f, 0.0f, -156.0f, 769); - } else if (Game_Flag_Query(79)) { - Setup_Scene_Information(-143.0f, 0.0f, -92.0f, 420); - } else { - Setup_Scene_Information(-183.0f, 0.0f, 128.0f, 205); - } - Scene_Exit_Add_2D_Exit(0, 0, 0, 30, 479, 3); - Scene_Exit_Add_2D_Exit(1, 389, 0, 639, 303, 0); - Scene_Exit_Add_2D_Exit(2, 115, 87, 137, 267, 3); - if (Game_Flag_Query(550)) { - Scene_2D_Region_Add(0, 185, 185, 230, 230); - } - Ambient_Sounds_Add_Looping_Sound(381, 100, 1, 1); - Ambient_Sounds_Add_Looping_Sound(205, 20, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 0, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 20, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 40, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 50, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Sound(67, 80, 180, 16, 25, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(68, 50, 180, 16, 25, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(379, 5, 180, 50, 100, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(380, 5, 180, 50, 100, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(377, 5, 180, 50, 100, 0, 0, -101, -101, 0, 0); - if (Game_Flag_Query(380)) { - Scene_Loop_Start_Special(0, 0, 0); - Scene_Loop_Set_Default(1); - } else { - Scene_Loop_Set_Default(1); - } -} - -void ScriptCT08::SceneLoaded() { - Obstacle_Object("ASHTRAY", 1); - Unobstacle_Object("BLANKET03", 1); - if (!Actor_Clue_Query(0, 85)) { - Item_Add_To_World(85, 943, 6, 44.0f, 0.0f, -95.0f, 540, 12, 12, 0, 1, 0, 1); - } - if (!Actor_Clue_Query(0, 87)) { - Item_Add_To_World(81, 936, 6, -102.0f, 2.0f, 41.0f, 432, 6, 6, 0, 1, 0, 1); - } -} - -bool ScriptCT08::MouseClick(int x, int y) { - return false; -} - -bool ScriptCT08::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptCT08::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptCT08::ClickedOnItem(int itemId, bool a2) { - if (itemId == 81) { - if (!Loop_Actor_Walk_To_Item(0, 81, 36, 1, 0) && !Game_Flag_Query(550)) { - Actor_Clue_Acquire(0, 87, 1, -1); - Item_Pickup_Spin_Effect(936, 266, 328); - Item_Remove_From_World(81); - Actor_Voice_Over(480, 99); - Actor_Voice_Over(490, 99); - Actor_Voice_Over(500, 99); - } - return true; - } - return false; -} - -bool ScriptCT08::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -183.0f, 0.0f, 128.0f, 0, 1, 0, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(81); - Set_Enter(31, 21); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -11.0f, 0.0f, -156.0f, 0, 1, 0, 0)) { - Loop_Actor_Walk_To_XYZ(0, 0.0f, 0.0f, -102.0f, 0, 0, 0, 0); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(379); - Set_Enter(6, 105); - } - return true; - } - if (exitId == 2) { - if (!Loop_Actor_Walk_To_XYZ(0, -143.0f, 0.0f, -92.0f, 0, 1, 0, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(80); - Set_Enter(29, 18); - } - return true; - } - return false; -} - -bool ScriptCT08::ClickedOn2DRegion(int region) { - if (region == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -108.0f, 0.0f, -178.0f, 0, 1, 0, 0)) { - Actor_Face_Heading(0, 512, 0); - Game_Flag_Reset(550); - Player_Set_Combat_Mode_Access(1); - Scene_Exits_Enable(); - Ambient_Sounds_Play_Sound(564, 40, 99, 0, 0); - Scene_2D_Region_Remove(0); - Player_Loses_Control(); - } - return true; - } - return false; -} - -void ScriptCT08::SceneFrameAdvanced(int frame) { -} - -void ScriptCT08::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptCT08::PlayerWalkedIn() { - if (Game_Flag_Query(550)) { - Actor_Change_Animation_Mode(0, 3); - Actor_Change_Animation_Mode(0, 0); - Actor_Set_At_XYZ(0, -148.0f, 0.0f, 4.0f, 256); - Player_Set_Combat_Mode_Access(0); - Scene_Exits_Disable(); - Game_Flag_Reset(380); - Game_Flag_Reset(79); - Autosave_Game(1); - } else if (Game_Flag_Query(380)) { - Game_Flag_Reset(380); - } else if (Game_Flag_Query(79)) { - Game_Flag_Reset(79); - } else { - Loop_Actor_Walk_To_XYZ(0, -156.0f, 0.0f, 128.0f, 0, 0, 0, 0); - Game_Flag_Reset(84); - } -} - -void ScriptCT08::PlayerWalkedOut() { - if (!Actor_Clue_Query(0, 85)) { - Item_Remove_From_World(85); - } -} - -void ScriptCT08::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ct09.cpp b/engines/bladerunner/script/ct09.cpp deleted file mode 100644 index 0cc9910b19..0000000000 --- a/engines/bladerunner/script/ct09.cpp +++ /dev/null @@ -1,214 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptCT09::InitializeScene() { - if (Game_Flag_Query(85)) { - Setup_Scene_Information(160.0f, 349.0f, 587.0f, 490); - } else if (Game_Flag_Query(81)) { - Setup_Scene_Information(235.0f, 3348.52f, 599.0f, 800); - } else { - Setup_Scene_Information(107.0f, 348.52f, 927.0f, 200); - } - Scene_Exit_Add_2D_Exit(0, 321, 164, 345, 309, 1); - Scene_Exit_Add_2D_Exit(1, 0, 0, 15, 479, 3); - Scene_Exit_Add_2D_Exit(2, 198, 177, 263, 311, 0); - Ambient_Sounds_Add_Looping_Sound(336, 28, 0, 1); - Ambient_Sounds_Add_Sound(375, 6, 180, 33, 33, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(376, 5, 180, 33, 33, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(377, 5, 180, 33, 33, 0, 0, -101, -101, 0, 0); -} - -void ScriptCT09::SceneLoaded() { - Obstacle_Object("PHONE01", true); - Unobstacle_Object("MAINBEAM01", true); - Unobstacle_Object("MIDDLE WALL", true); - Clickable_Object("BELL"); -} - -bool ScriptCT09::MouseClick(int x, int y) { - return false; -} - -bool ScriptCT09::ClickedOn3DObject(const char *objectName, bool a2) { - if (Object_Query_Click("BELL", objectName)) { - if (Actor_Query_Which_Set_In(62) != 31) { - if (!Loop_Actor_Walk_To_XYZ(0, 229.0f, 348.52f, 851.0f, 36, 1, false, 0)) { - Actor_Face_Object(0, "BELL", true); - Sound_Play(337, 100, 0, 0, 50); - if (!Actor_Query_Goal_Number(27)) { - Actor_Says(27, 160, 3); - } - } - } - return true; - } - return false; -} - -bool ScriptCT09::ClickedOnActor(int actorId) { - if (actorId == 27) { - if (!Actor_Query_Goal_Number(27) && Actor_Query_Which_Set_In(62) != 31) { - if (!Loop_Actor_Walk_To_XYZ(0, 270.0f, 348.52f, 846.0f, 12, 1, false, 0)) { - Player_Loses_Control(); - Actor_Face_Actor(0, 27, true); - if (Global_Variable_Query(1) < 3) { - Actor_Says(0, 650, 3); - Actor_Says(27, 250, 12); - Actor_Says(0, 665, 18); - } else if (Game_Flag_Query(540)) { - Actor_Says(0, 650, 18); - Actor_Says(27, 220, 15); - } else { - Game_Flag_Set(540); - Actor_Says(27, 170, 13); - Actor_Says(0, 630, 12); - Actor_Says(27, 180, 14); - Actor_Says(0, 635, 3); - Actor_Says(27, 190, 15); - Actor_Says(0, 640, 12); - Actor_Says(0, 645, 3); - Actor_Says(27, 200, 13); - Actor_Says(27, 210, 14); - } - Player_Gains_Control(); - } - } - return true; - } - return false; -} - -bool ScriptCT09::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptCT09::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, 206.0f, 348.52f, 599.0f, 0, 1, false, 0)) { - Loop_Actor_Walk_To_XYZ(0, 235.0f, 348.52f, 599.0f, 0, 0, false, 0); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(84); - Set_Enter(6, 20); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, 107.0f, 348.52f, 927.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(83); - Set_Enter(33, 23); - } - return true; - } - if (exitId == 2) { - if (!Loop_Actor_Walk_To_XYZ(0, 159.0f, 349.0f, 570.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(82); - Set_Enter(32, 22); - } - return true; - } - return false;; -} - -bool ScriptCT09::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptCT09::SceneFrameAdvanced(int frame) { - if (frame == 6 || frame == 12 || frame == 19 || frame == 25 || frame == 46 || frame == 59) { - Sound_Play(97, Random_Query(47, 47), 70, 70, 50); - } -} - -void ScriptCT09::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptCT09::PlayerWalkedIn() { - bool v0 = false; - if (Global_Variable_Query(1) == 3 && !Game_Flag_Query(538)) { - Game_Flag_Set(538); - Actor_Set_Goal_Number(62, 1); - v0 = true; - } - if (Game_Flag_Query(85)) { - Game_Flag_Reset(85); - } else if (Game_Flag_Query(81)) { - if (v0) { - Async_Actor_Walk_To_XYZ(0, 206.0f, 348.52f, 599.0f, 0, false); - } else { - Loop_Actor_Walk_To_XYZ(0, 206.0f, 348.52f, 599.0f, 0, 0, false, 0); - } - Game_Flag_Reset(81); - } else { - if (v0) { - Async_Actor_Walk_To_XYZ(0, 124.0f, 348.52f, 886.0f, 0, false); - } else { - Loop_Actor_Walk_To_XYZ(0, 124.0f, 348.52f, 886.0f, 0, 0, false, 0); - } - Game_Flag_Reset(304); - } - if (Actor_Query_Goal_Number(27) == 2) { - if (Game_Flag_Query(539)) { - Actor_Says(27, 70, 13); - Actor_Face_Actor(0, 27, true); - Actor_Says(0, 600, 17); - Actor_Says(27, 80, 14); - Actor_Says(0, 605, 13); - Actor_Says(27, 90, 15); - } else { - Actor_Says(27, 20, 12); - Actor_Face_Actor(0, 27, true); - Actor_Says(0, 585, 18); - Actor_Says(27, 40, 15); - Actor_Says(0, 590, 16); - Actor_Says(27, 50, 14); - Actor_Says(0, 595, 14); - Actor_Says(27, 60, 13); - Actor_Modify_Friendliness_To_Other(27, 0, -1); - } - Actor_Set_Goal_Number(27, 0); - } -} - -void ScriptCT09::PlayerWalkedOut() { -} - -void ScriptCT09::DialogueQueueFlushed(int a1) { - Actor_Force_Stop_Walking(0); - if (Actor_Query_Goal_Number(62) == 1 && !Game_Flag_Query(539)) { - Player_Loses_Control(); - Actor_Set_Goal_Number(62, 2); - //return true; - } else { - //return false; - } -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ct10.cpp b/engines/bladerunner/script/ct10.cpp deleted file mode 100644 index 1781394c57..0000000000 --- a/engines/bladerunner/script/ct10.cpp +++ /dev/null @@ -1,160 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptCT10::InitializeScene() { - Setup_Scene_Information(-121.0f, 0.0f, -78.0f, 446); - Game_Flag_Reset(84); - Scene_Exit_Add_2D_Exit(0, 135, 74, 238, 340, 0); - Ambient_Sounds_Add_Looping_Sound(336, 28, 0, 1); - Ambient_Sounds_Add_Sound(375, 6, 180, 33, 33, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(376, 5, 180, 33, 33, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(377, 5, 180, 33, 33, 0, 0, -101, -101, 0, 0); -} - -void ScriptCT10::SceneLoaded() { - Obstacle_Object("BED", true); - Unobstacle_Object("WINDOW", true); - Unobstacle_Object("LOFT01", true); - Unobstacle_Object("LOFT02", true); - Unobstacle_Object("LOFT03", true); - Unobstacle_Object("LOFT04", true); - Unobstacle_Object("LOFT05", true); - Unobstacle_Object("LOFT06", true); - Unobstacle_Object("LOFT10", true); - Unobstacle_Object("LOFT11", true); - Unobstacle_Object("LOFT12", true); - Unobstacle_Object("LINE02", true); - Unobstacle_Object("CABINETFRONT", true); - Unobstacle_Object("CABINTESIDE", true); - Unobstacle_Object("BUSTEDTAPE2", true); - Unobstacle_Object("BOX CLOSET 1", true); - Clickable_Object("BED"); - Clickable_Object("CABINETFRONT"); - Clickable_Object("CABINETTOP"); - Clickable_Object("TUB"); - Scene_2D_Region_Add(0, 379, 229, 454, 375); -} - -bool ScriptCT10::MouseClick(int x, int y) { - return false; -} - -void ScriptCT10::sub_401844() { - if (!Loop_Actor_Walk_To_XYZ(0, 10.6f, 0.0f, -50.5f, 0, 1, false, 0)) { - Player_Loses_Control(); - Actor_Face_Heading(0, 0, false); - Sound_Play(339, 100, 0, 0, 50); - Delay(1000); - if (Actor_Clue_Query(0, 110)) { - Actor_Voice_Over(3700, 99); - } else { - Item_Pickup_Spin_Effect(931, 435, 258); - Actor_Clue_Acquire(0, 110, 1, -1); - } - Player_Gains_Control(); - } -} - -bool ScriptCT10::ClickedOn3DObject(const char *objectName, bool a2) { - if (Object_Query_Click("TUB", objectName)) { - if (!Loop_Actor_Walk_To_XYZ(0, -41.0f, 0.0f, -106.0f, 0, 1, false, 0)) { - Player_Loses_Control(); - Actor_Face_Heading(0, 850, false); - Actor_Change_Animation_Mode(0, 38); - Delay(1000); - Sound_Play(338, 33, 0, 0, 50); - Delay(3000); - if (Actor_Clue_Query(0, 93)) { - Actor_Voice_Over(3700, 99); - } else { - Actor_Clue_Acquire(0, 93, 1, -1); - Item_Pickup_Spin_Effect(969, 364, 214); - } - Delay(1000); - Loop_Actor_Walk_To_XYZ(0, -41.0f, 0.0f, -82.0f, 0, 0, false, 1); - Player_Gains_Control(); - } - return true; - } - if (Object_Query_Click("CABINETTOP", objectName) || Object_Query_Click("CABINETFRONT", objectName)) { - sub_401844(); - return true; - } - return false; -} - -bool ScriptCT10::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptCT10::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptCT10::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -93.0f, 0.0f, -38.0f, 0, 1, false, 0)) { - Loop_Actor_Walk_To_XYZ(0, -121.0f, 0.0f, -78.0f, 0, 0, false, 0); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(85); - Set_Enter(31, 21); - } - } - return false; -} - -bool ScriptCT10::ClickedOn2DRegion(int region) { - if (region == 0) { - sub_401844(); - } - return false; -} - -void ScriptCT10::SceneFrameAdvanced(int frame) { -} - -void ScriptCT10::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptCT10::PlayerWalkedIn() { - Loop_Actor_Walk_To_XYZ(0, -93.0f, 0.0f, -38.0f, 0, 0, false, 0); - Loop_Actor_Walk_To_XYZ(0, -49.0f, 0.0f, -38.0f, 0, 0, false, 0); - if (!Game_Flag_Query(525)) { - Actor_Voice_Over(450, 99); - Actor_Voice_Over(460, 99); - Actor_Voice_Over(470, 99); - Game_Flag_Set(525); - } -} - -void ScriptCT10::PlayerWalkedOut() { -} - -void ScriptCT10::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ct11.cpp b/engines/bladerunner/script/ct11.cpp deleted file mode 100644 index 3ef0bec48d..0000000000 --- a/engines/bladerunner/script/ct11.cpp +++ /dev/null @@ -1,213 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptCT11::InitializeScene() { - if (Game_Flag_Query(91)) { - Setup_Scene_Information(-378.0f, 9.68f, -55.0f, 440); - } else if (Game_Flag_Query(558)) { - Setup_Scene_Information(315.0f, 0.0f, 628.0f, 0); - } else { - Setup_Scene_Information(152.0f, 9.68f, -8.0f, 0); - } - Scene_Exit_Add_2D_Exit(0, 257, 240, 364, 330, 1); - Scene_Exit_Add_2D_Exit(1, 97, 0, 155, 324, 0); - Scene_Exit_Add_2D_Exit(2, 0, 0, 20, 479, 3); - Ambient_Sounds_Add_Looping_Sound(54, 50, 0, 1); - Ambient_Sounds_Add_Sound(67, 5, 80, 16, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(66, 5, 80, 16, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(378, 5, 80, 50, 100, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(379, 5, 80, 50, 100, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(380, 5, 80, 50, 100, -100, 100, -101, -101, 0, 0); - if (Global_Variable_Query(1) <= 3) { - Scene_Loop_Set_Default(0); - } else { - Scene_Loop_Set_Default(2); - } -} - -void ScriptCT11::SceneLoaded() { - Obstacle_Object("TRASH CAN", true); - Unobstacle_Object("BOX NORTHWEST 1", true); - Unobstacle_Object("BOX SOUTH 1", true); - if (Global_Variable_Query(1) < 4) { - if (!Game_Flag_Query(645)) { - Item_Add_To_World(115, 951, 33, 640.21002f, 30.0f, 470.0f, 512, 12, 12, false, true, false, true); - Scene_2D_Region_Add(0, 505, 316, 513, 321); - Game_Flag_Set(725); - } - if (!Actor_Clue_Query(0, 111)) { - Scene_2D_Region_Add(1, 412, 258, 552, 358); - } - } else { - if (Game_Flag_Query(725)) { - Item_Remove_From_World(115); - Game_Flag_Reset(725); - Game_Flag_Set(645); - } - Unobstacle_Object("BRIDGE SUPPORT", true); - Unobstacle_Object("BODY", true); - Unobstacle_Object("HEADLIGHTS", true); - Unobstacle_Object("LICENSE PLATE-FRONT", true); - Unobstacle_Object("LICENSE PLATE-REAR", true); - Unobstacle_Object("BRAKE DISC RF", true); - Unobstacle_Object("TIRE RF", true); - Unobstacle_Object("RIM RF", true); - Unobstacle_Object("DOOR RIGHT", true); - Unobstacle_Object("BUMPER REAR", true); - } - Unclickable_Object("TRASH CAN"); -} - -bool ScriptCT11::MouseClick(int x, int y) { - return false; -} - -bool ScriptCT11::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptCT11::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptCT11::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptCT11::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, 121.0f, 9.6800003f, -42.0f, 0, 1, false, 0)) { - Game_Flag_Set(304); - Set_Enter(31, 21); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -300.0f, 9.6800003f, 66.0f, 0, 1, false, 0)) { - Loop_Actor_Walk_To_XYZ(0, -400.0f, 9.6800003f, -70.0f, 0, 1, false, 0); - Game_Flag_Set(86); - Set_Enter(4, 24); - } - return true; - } - if (exitId == 2) { - if (!Loop_Actor_Walk_To_XYZ(0, 290.0f, 0.0f, 635.0f, 0, 1, false, 0)) { - Game_Flag_Set(531); - Game_Flag_Reset(176); - Game_Flag_Set(177); - Set_Enter(7, 25); - } - return true; - } - return false; -} - -bool ScriptCT11::ClickedOn2DRegion(int region) { - if (region == 0 && Game_Flag_Query(725)) { - if (!Loop_Actor_Walk_To_XYZ(0, 686.0f, 0.0f, 658.0f, 12, 1, false, 0)) { - Actor_Face_Heading(0, 47, false); - Item_Remove_From_World(115); - Actor_Clue_Acquire(0, 118, 0, -1); - Item_Pickup_Spin_Effect(951, 510, 319); - Game_Flag_Reset(725); - Game_Flag_Set(645); - Actor_Voice_Over(550, 99); - Actor_Voice_Over(560, 99); - Actor_Voice_Over(570, 99); - Actor_Voice_Over(580, 99); - } - return true; - } - if (region == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, 686.0f, 0.0f, 658.0f, 12, 1, false, 0)) { - Actor_Face_Heading(0, 47, false); - int temp = 0; - if (Actor_Clue_Query(0, 17)) { - temp = 1; - } - if (Actor_Clue_Query(0, 26)) { - ++temp; - } - if (Actor_Clue_Query(0, 39)) { - ++temp; - } - if (Actor_Clue_Query(0, 37)) { - temp += 2; - } - if (Actor_Clue_Query(0, 30)) { - temp += 2; - } - if (Actor_Clue_Query(0, 31)) { - temp += 2; - } - if (temp <= 2 || Actor_Clue_Query(0, 111)) { - Actor_Says(0, 8525, 12); - } else { - Actor_Voice_Over(510, 99); - Actor_Voice_Over(520, 99); - Actor_Voice_Over(530, 99); - Actor_Voice_Over(540, 99); - Actor_Clue_Acquire(0, 111, 0, -1); - Scene_2D_Region_Remove(1); - } - } - return true; - } - return false; -} - -void ScriptCT11::SceneFrameAdvanced(int frame) { -} - -void ScriptCT11::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptCT11::PlayerWalkedIn() { - if (Game_Flag_Query(91)) { - Loop_Actor_Walk_To_XYZ(0, -358.0f, 9.68f, 32.0f, 0, 0, false, 0); - Game_Flag_Reset(91); - } else if (Game_Flag_Query(558)) { - Loop_Actor_Walk_To_XYZ(0, 329.0f, 0.0f, 617.0f, 0, 0, false, 0); - Game_Flag_Reset(558); - } else { - Player_Loses_Control(); - Actor_Set_Immunity_To_Obstacles(0, true); - Loop_Actor_Walk_To_XYZ(0, 125.0f, 9.68f, 74.0f, 0, 0, false, 0); - Actor_Set_Immunity_To_Obstacles(0, false); - Player_Gains_Control(); - Game_Flag_Reset(83); - } -} - -void ScriptCT11::PlayerWalkedOut() { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); -} - -void ScriptCT11::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ct12.cpp b/engines/bladerunner/script/ct12.cpp deleted file mode 100644 index eabd25b76c..0000000000 --- a/engines/bladerunner/script/ct12.cpp +++ /dev/null @@ -1,284 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptCT12::InitializeScene() { - if (Game_Flag_Query(123)) { - Setup_Scene_Information(-419.0f, -6.5f, 696.0f, 616); - } else if (Game_Flag_Query(432)) { - Setup_Scene_Information(-292.0f, -6.5f, 990.0f, 827); - if (!Game_Flag_Query(150)) { - Game_Flag_Set(150); - } - Game_Flag_Reset(432); - } else if (Game_Flag_Query(86)) { - Setup_Scene_Information(-493.0f, -6.5f, 1174.0f, 990); - } else { - Setup_Scene_Information(-386.13f, -6.5f, 1132.72f, 783); - } - Scene_Exit_Add_2D_Exit(0, 0, 0, 40, 479, 3); - Scene_Exit_Add_2D_Exit(1, 78, 224, 162, 330, 0); - Scene_Exit_Add_2D_Exit(2, 500, 180, 619, 346, 0); - if (Global_Variable_Query(1) > 2) { - Scene_Exit_Add_2D_Exit(3, 620, 0, 639, 479, 1); - } - if (Global_Variable_Query(1) > 3) { - Scene_Exit_Add_2D_Exit(4, 324, 150, 435, 340, 0); - } - Ambient_Sounds_Add_Looping_Sound(54, 33, 1, 1); - Ambient_Sounds_Add_Looping_Sound(55, 20, -100, 1); - Ambient_Sounds_Add_Looping_Sound(56, 20, -100, 1); - Ambient_Sounds_Add_Speech_Sound(60, 0, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 20, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 40, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 50, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Sound(68, 60, 180, 20, 33, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(69, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(375, 60, 180, 50, 100, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(376, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(377, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0); - if (Global_Variable_Query(1) < 2 && Actor_Query_Goal_Number(53) == 1) { - Actor_Put_In_Set(53, 4); - Actor_Set_At_XYZ(53, -534.0f, -6.5f, 952.0f, 367); - Game_Flag_Set(294); - } - if (Game_Flag_Query(123) && Game_Flag_Query(248)) { - if (Global_Variable_Query(1) != 2 && Global_Variable_Query(1) != 3) { - Scene_Loop_Start_Special(0, 1, 0); - } - Scene_Loop_Set_Default(2); - Game_Flag_Reset(123); - } else if (Game_Flag_Query(123) && !Game_Flag_Query(248)) { - if (Global_Variable_Query(1) != 2 && Global_Variable_Query(1) != 3) { - Scene_Loop_Start_Special(0, 0, 0); - } - Scene_Loop_Set_Default(2); - Game_Flag_Reset(123); - } else if (Game_Flag_Query(76) && Game_Flag_Query(294)) { - Game_Flag_Reset(76); - Scene_Loop_Set_Default(4); - } else if (Game_Flag_Query(76) && !Game_Flag_Query(294)) { - Game_Flag_Reset(76); - Scene_Loop_Set_Default(2); - } else { - Scene_Loop_Set_Default(2); - - } -} - -void ScriptCT12::SceneLoaded() { - Obstacle_Object("BOX18", true); - Unobstacle_Object("SPINNER BODY", true); - Unobstacle_Object("HOWFLOOR", true); - Unclickable_Object("TURBINE"); -} - -bool ScriptCT12::MouseClick(int x, int y) { - return false; -} - -bool ScriptCT12::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptCT12::ClickedOnActor(int actorId) { - if (actorId == 28) { - Actor_Face_Actor(0, 28, true); - Actor_Says(0, 8910, 16); - } - if (actorId == 24 && Global_Variable_Query(1) == 4 && Game_Flag_Query(671) && Game_Flag_Query(703)) { - Actor_Face_Actor(24, 0, true); - Actor_Face_Actor(0, 24, true); - Actor_Says(0, 710, 3); - Actor_Says(24, 20, 3); - Actor_Says(0, 715, 3); - Actor_Says(24, 30, 3); - Actor_Says(0, 720, 3); - Actor_Says(24, 40, 3); - Actor_Says(24, 50, 3); - Actor_Says(24, 60, 3); - Actor_Says(0, 725, 3); - Actor_Says(24, 70, 3); - Actor_Says(24, 80, 3); - Actor_Says(24, 90, 3); - Actor_Says(24, 100, 3); - Actor_Says(24, 110, 3); - Game_Flag_Set(629); - Game_Flag_Set(666); - Actor_Set_Goal_Number(0, 400); - } - return false; -} - -bool ScriptCT12::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptCT12::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -419.14999f, -6.5f, 696.94f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Game_Flag_Set(88); - Set_Enter(4, 13); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -182.69f, -6.5f, 696.94f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(89); - Set_Enter(5, 15); - } - return true; - } - if (exitId == 2) { - if (!Loop_Actor_Walk_To_XYZ(0, -386.13f, -6.5f, 1132.72f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(90); - Set_Enter(28, 17); - } - return true; - } - if (exitId == 3) { - if (!Loop_Actor_Walk_To_XYZ(0, -493.0f, -6.5f, 1174.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(91); - Set_Enter(33, 23); - } - return true; - } - if (exitId == 4) { - if (!Loop_Actor_Walk_To_XYZ(0, -292.0f, -6.5f, 990.0f, 0, 1, false, 0)) { - if (Global_Variable_Query(1) == 4) { - Game_Flag_Set(629); - } - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(433); - Set_Enter(82, 94); - } - return true; - } - return false; -} - -bool ScriptCT12::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptCT12::SceneFrameAdvanced(int frame) { - if (!((frame - 1) % 10)) { - /*int v2 = Random_Query(0, 1); - if (v2 <= 1) - { - if (v2) - { - v1 = 60; - } - else - { - v1 = 59; - } - }*/ - Sound_Play(/*v1*/Random_Query(59, 60), 10, -80, -80, 50); - } - if (frame == 160) { - Actor_Change_Animation_Mode(53, 41); - } - if (frame == 152) { - Sound_Play(116, 100, 40, 0, 50); - } - if (frame == 203) { - Sound_Play(119, 100, 40, 0, 50); - } - if (frame == 212) { - Sound_Play(117, 40, 0, 0, 50); - } - if (frame == 269) { - Player_Gains_Control(); - Player_Set_Combat_Mode(false); - Actor_Set_Invisible(53, false); - } -} - -void ScriptCT12::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptCT12::PlayerWalkedIn() { - if (Global_Variable_Query(1) < 2 && !Game_Flag_Query(64) && Actor_Query_Goal_Number(53) == 1) { - Player_Loses_Control(); - Loop_Actor_Walk_To_Actor(53, 0, 48, 0, false); - Actor_Face_Actor(53, 0, true); - Actor_Face_Actor(0, 53, true); - Actor_Says(53, 0, 3); - Actor_Says(0, 670, 3); - Actor_Says(53, 10, 3); - Actor_Says(0, 675, 3); - Actor_Says(53, 20, 3); - Actor_Says(0, 680, 3); - Actor_Says(53, 30, 3); - Actor_Says(0, 685, 3); - Actor_Says(53, 40, 3); - Actor_Says(0, 690, 3); - Actor_Clue_Acquire(0, 33, 1, 53); - Game_Flag_Set(64); - CDB_Set_Crime(20, 8); - if (Game_Flag_Query(64) && Game_Flag_Query(40)) { - Actor_Says(53, 50, 3); - Actor_Says(0, 695, 3); - Actor_Says(53, 60, 3); - Actor_Says(0, 700, 3); - Actor_Says(53, 70, 3); - Actor_Clue_Acquire(53, 222, 1, -1); - } else if (Game_Flag_Query(64) && Game_Flag_Query(41)) { - Actor_Says(53, 80, 3); - Actor_Says(53, 90, 3); - Actor_Says(0, 705, 3); - Actor_Says(53, 100, 3); - Actor_Clue_Acquire(53, 215, 1, -1); - } - Actor_Set_Goal_Number(53, 2); - } - if (Game_Flag_Query(86)) { - Loop_Actor_Walk_To_XYZ(0, -520.0f, -6.5f, 1103.0f, 0, 0, false, 0); - Game_Flag_Reset(86); - } -} - -void ScriptCT12::PlayerWalkedOut() { - Game_Flag_Reset(443); - if (Game_Flag_Query(433)) { - Game_Flag_Reset(176); - Game_Flag_Set(259); - } -} - -void ScriptCT12::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ct51.cpp b/engines/bladerunner/script/ct51.cpp deleted file mode 100644 index bc47dddb21..0000000000 --- a/engines/bladerunner/script/ct51.cpp +++ /dev/null @@ -1,129 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptCT51::InitializeScene() { - Setup_Scene_Information(0.0f, 0.0f, -102.0f, 470); - Game_Flag_Reset(379); - Scene_Exit_Add_2D_Exit(1, 0, 0, 30, 479, 3); - Ambient_Sounds_Add_Looping_Sound(381, 100, 1, 1); - Ambient_Sounds_Add_Sound(68, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(69, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(375, 60, 180, 50, 100, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(376, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(377, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0); - Scene_Loop_Start_Special(0, 0, 0); - Scene_Loop_Set_Default(1); -} - -void ScriptCT51::SceneLoaded() { - Unobstacle_Object("BLANKET03", true); - Clickable_Object("BED02"); - if (!Actor_Clue_Query(0, 85)) { - Item_Add_To_World(85, 943, 6, 44.0f, 0.0f, -95.0f, 540, 24, 24, false, true, false, true); - } - if (!Actor_Clue_Query(0, 86)) { - Item_Add_To_World(120, 984, 6, 44.0f, 0.0f, -22.0f, 0, 12, 12, false, true, false, true); - } -} - -bool ScriptCT51::MouseClick(int x, int y) { - return true; -} - -bool ScriptCT51::ClickedOn3DObject(const char *objectName, bool a2) { - if (Object_Query_Click("BED02", objectName)) { - if (Actor_Clue_Query(0, 84)) { - Actor_Says(0, 8580, 12); - return false; - } - Item_Pickup_Spin_Effect(970, 203, 200); - Actor_Clue_Acquire(0, 84, 1, -1); - Actor_Voice_Over(420, 99); - return true; - } - return false; -} - -bool ScriptCT51::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptCT51::ClickedOnItem(int itemId, bool a2) { - if (itemId == 85) { - Actor_Clue_Acquire(0, 85, 1, -1); - Item_Pickup_Spin_Effect(943, 260, 200); - Ambient_Sounds_Play_Sound(563, 40, 99, 0, 0); - Item_Remove_From_World(85); - return true; - } - if (itemId == 120) { - Actor_Clue_Acquire(0, 86, 1, -1); - Item_Pickup_Spin_Effect(984, 490, 307); - Item_Remove_From_World(120); - Actor_Says(0, 8527, 3); - return true; - } - return false; -} - -bool ScriptCT51::ClickedOnExit(int exitId) { - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, 0.0f, 0.0f, -102.0f, 0, 1, false, 0)) { - Loop_Actor_Walk_To_XYZ(0, -11.0f, 0.0f, -156.0f, 0, 0, false, 0); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(380); - Set_Enter(6, 20); - } - return true; - } - return false; - -} - -bool ScriptCT51::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptCT51::SceneFrameAdvanced(int frame) { -} - -void ScriptCT51::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptCT51::PlayerWalkedIn() { -} - -void ScriptCT51::PlayerWalkedOut() { - if (!Actor_Clue_Query(0, 85)) { - Item_Remove_From_World(85); - } -} - -void ScriptCT51::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/dr01.cpp b/engines/bladerunner/script/dr01.cpp deleted file mode 100644 index e8d89a27fe..0000000000 --- a/engines/bladerunner/script/dr01.cpp +++ /dev/null @@ -1,262 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptDR01::InitializeScene() { - if (Game_Flag_Query(225)) { - Setup_Scene_Information(-835.0f, -0.04f, -118.0f, 664); - } else if (Game_Flag_Query(11)) { - Setup_Scene_Information(-711.0f, -0.04f, 70.0f, 307); - } else if (Game_Flag_Query(531)) { - Setup_Scene_Information(-1765.28f, -0.04f, -23.82f, 269); - } else { - Setup_Scene_Information(-386.0f, -0.04f, -82.0f, 792); - } - Scene_Exit_Add_2D_Exit(0, 240, 60, 450, 250, 0); - Scene_Exit_Add_2D_Exit(1, 0, 0, 30, 479, 3); - if (Game_Flag_Query(253) && Global_Variable_Query(1) < 4) { - Scene_Exit_Add_2D_Exit(2, 610, 0, 639, 479, 1); - } - if (Global_Variable_Query(1) >= 3) { - Scene_Exit_Add_2D_Exit(3, 0, 45, 142, 201, 0); - } - Ambient_Sounds_Remove_All_Non_Looping_Sounds(0); - Ambient_Sounds_Add_Looping_Sound(54, 50, 0, 1); - Ambient_Sounds_Add_Looping_Sound(219, 12, 85, 1); - Ambient_Sounds_Add_Looping_Sound(98, 14, 85, 1); - Ambient_Sounds_Add_Speech_Sound(60, 0, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 20, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 40, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 50, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Sound(67, 5, 80, 16, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(66, 5, 80, 16, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(378, 5, 80, 50, 100, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(379, 5, 80, 50, 100, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(380, 5, 80, 50, 100, -100, 100, -101, -101, 0, 0); - if (Game_Flag_Query(272) && Game_Flag_Query(11)) { - Scene_Loop_Start_Special(0, 3, 0); - Scene_Loop_Set_Default(4); - } else if (!Game_Flag_Query(272) && Game_Flag_Query(11)) { - Scene_Loop_Start_Special(0, 2, 0); - Scene_Loop_Set_Default(4); - } else if (Game_Flag_Query(225)) { - Scene_Loop_Start_Special(0, 1, 0); - Scene_Loop_Set_Default(4); - } else if (Game_Flag_Query(531) == 1) { - Scene_Loop_Set_Default(4); - } else { - Scene_Loop_Start_Special(0, 0, 0); - Scene_Loop_Set_Default(4); - } -} - -void ScriptDR01::SceneLoaded() { - Obstacle_Object("TRASH CAN WITH FIRE", true); - Obstacle_Object("V2PYLON02", true); - Obstacle_Object("V2PYLON04", true); - Obstacle_Object("U2 CHEWDOOR", true); - Obstacle_Object("MMTRASHCAN", true); - Obstacle_Object("PARKMETR02", true); - Obstacle_Object("TRANSFORMER 01", true); - Obstacle_Object("TRANSFORMER 02", true); - Obstacle_Object("PARKMETR01", true); - Obstacle_Object("Z2TRSHCAN", true); - Obstacle_Object("Z2ENTRYDR", true); - Obstacle_Object("Z2DR2", true); - Unobstacle_Object("V2 BUILD01", true); -} - -bool ScriptDR01::MouseClick(int x, int y) { - return false; -} - -bool ScriptDR01::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptDR01::ClickedOnActor(int actorId) { - return actorId == 50; -} - -bool ScriptDR01::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptDR01::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -835.0f, -0.04f, -118.0f, 0, 1, false, 0)) { - Async_Actor_Walk_To_XYZ(0, -911.0f, -0.04f, -118.0f, 0, false); - Ambient_Sounds_Adjust_Looping_Sound(112, 10, -100, 1); - Game_Flag_Set(224); - Set_Enter(7, 26); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -711.0f, -0.04f, 70.0f, 0, 1, false, 0)) { - Async_Actor_Walk_To_XYZ(0, -796.0f, -0.04f, 166.0f, 0, false); - Game_Flag_Set(10); - Set_Enter(7, 28); - } - return true; - } - if (exitId == 2) { - if (Loop_Actor_Walk_To_XYZ(0, -372.0f, -0.04f, -82.0f, 0, 1, false, 0)) { - Game_Flag_Reset(176); - Game_Flag_Reset(182); - Game_Flag_Reset(179); - Game_Flag_Reset(178); - Game_Flag_Reset(180); - Game_Flag_Reset(261); - Game_Flag_Reset(177); - Game_Flag_Reset(258); - int spinnerDest = Spinner_Interface_Choose_Dest(-1, 0); - switch (spinnerDest) { - case 2: - Game_Flag_Set(182); - Game_Flag_Reset(253); - Game_Flag_Set(249); - Set_Enter(69, 78); - break; - case 3: - Game_Flag_Set(176); - Game_Flag_Reset(253); - Game_Flag_Set(248); - Set_Enter(4, 13); - break; - case 1: - Game_Flag_Set(179); - Game_Flag_Reset(253); - Game_Flag_Set(250); - Set_Enter(49, 48); - break; - case 0: - Game_Flag_Set(178); - Game_Flag_Reset(253); - Game_Flag_Set(251); - Set_Enter(61, 65); - break; - case 5: - Game_Flag_Set(261); - Game_Flag_Reset(253); - Game_Flag_Set(307); - Set_Enter(17, 82); - break; - case 4: - Game_Flag_Set(180); - Game_Flag_Reset(253); - Game_Flag_Set(252); - Set_Enter(0, 0); - break; - case 7: - Game_Flag_Set(258); - Game_Flag_Reset(253); - Game_Flag_Set(254); - Set_Enter(20, 2); - break; - case 8: - Game_Flag_Set(181); - Game_Flag_Reset(253); - Game_Flag_Set(255); - Set_Enter(54, 54); - break; - case 9: - Game_Flag_Set(257); - Game_Flag_Reset(253); - Game_Flag_Set(256); - Set_Enter(37, 34); - break; - default: - Player_Loses_Control(); - Game_Flag_Set(177); - Loop_Actor_Walk_To_XYZ(0, -447.39f, 0.16f, -92.38f, 0, 0, true, 0); - Player_Gains_Control(); - break; - } - } - return true; - } - - if (exitId == 3) { - float x, y, z; - Actor_Query_XYZ(0, &x, &y, &z); - bool v7 = false; - if (-1200 < x) { - v7 = Loop_Actor_Walk_To_XYZ(0, -1236.4f, -0.04f, -13.91f, 0, 1, false, 0); - } - if (!v7) { - Game_Flag_Set(558); - Game_Flag_Set(176); - Game_Flag_Reset(177); - Set_Enter(33, 23); - } - return true; - } - return false; -} - -bool ScriptDR01::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptDR01::SceneFrameAdvanced(int frame) { - if (frame < 75) { - Actor_Set_Invisible(0, true); - } else { - Actor_Set_Invisible(0, false); - } - if (frame == 2) { - Ambient_Sounds_Play_Sound(487, 40, -40, 100, 99); - } -} - -void ScriptDR01::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptDR01::PlayerWalkedIn() { - if (Game_Flag_Query(531)) { - Async_Actor_Walk_To_XYZ(0, -757.15f, -0.04f, 24.64f, 0, false); - } else if (!Game_Flag_Query(225) && !Game_Flag_Query(11)) { - Player_Loses_Control(); - Loop_Actor_Walk_To_XYZ(0, -447.39f, 0.16f, -92.38f, 0, 0, false, 0); - Player_Gains_Control(); - } - Game_Flag_Reset(225); - Game_Flag_Reset(11); - Game_Flag_Reset(531); -} - -void ScriptDR01::PlayerWalkedOut() { - if (!Game_Flag_Query(10) && !Game_Flag_Query(224) && !Game_Flag_Query(558)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Outtake_Play(35, 1, -1); - } -} - -void ScriptDR01::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/dr02.cpp b/engines/bladerunner/script/dr02.cpp deleted file mode 100644 index c075d808f5..0000000000 --- a/engines/bladerunner/script/dr02.cpp +++ /dev/null @@ -1,183 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptDR02::InitializeScene() { - if (Game_Flag_Query(227)) { - Setup_Scene_Information(-1162.0f, 7.18f, -322.0f, 552); - } else if (Game_Flag_Query(224)) { - Setup_Scene_Information(-835.0f, -0.04f, -118.0f, 193); - } else if (Game_Flag_Query(264)) { - Setup_Scene_Information(-1258.0f, 7.18f, -314.0f, 400); - } else { - Setup_Scene_Information(168.78f, 0.16f, -775.71997f, 193); - } - Scene_Exit_Add_2D_Exit(0, 605, 0, 639, 479, 1); - Scene_Exit_Add_2D_Exit(1, 222, 176, 279, 314, 0); - if (Game_Flag_Query(326)) { - Scene_Exit_Add_2D_Exit(2, 95, 0, 148, 292, 0); - } - Ambient_Sounds_Remove_All_Non_Looping_Sounds(0); - Ambient_Sounds_Remove_All_Looping_Sounds(0); - Ambient_Sounds_Add_Looping_Sound(54, 50, 0, 1); - Ambient_Sounds_Add_Looping_Sound(219, 27, 85, 1); - Ambient_Sounds_Add_Looping_Sound(98, 38, 85, 1); - Ambient_Sounds_Add_Sound(378, 2, 50, 33, 100, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(379, 2, 50, 33, 100, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(380, 2, 50, 33, 100, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(67, 5, 100, 16, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(66, 5, 100, 16, 25, -100, 100, -101, -101, 0, 0); - if (Game_Flag_Query(224)) { - Scene_Loop_Start_Special(0, 0, 0); - Scene_Loop_Set_Default(1); - } else { - Scene_Loop_Set_Default(1); - } -} - -void ScriptDR02::SceneLoaded() { - Obstacle_Object("TRASH CAN WITH FIRE", true); - Obstacle_Object("V2PYLON02", true); - Obstacle_Object("V2PYLON04", true); - Obstacle_Object("U2 CHEWDOOR", true); - Obstacle_Object("MMTRASHCAN", true); - Obstacle_Object("PARKMETR02", true); - Obstacle_Object("TRANSFORMER 01", true); - Obstacle_Object("TRANSFORMER 02", true); - Obstacle_Object("PARKMETR01", true); - Obstacle_Object("Z2ENTRYDR", true); - Obstacle_Object("Z2DR2", true); - Clickable_Object("TRASH CAN WITH FIRE"); - Clickable_Object("U2 CHEWDOOR"); - Clickable_Object("MMTRASHCAN"); - Clickable_Object("U2 EYE"); - Clickable_Object("U2 E"); - Clickable_Object("MMNEWSP01"); - Clickable_Object("MMNEWSP01"); - Clickable_Object("MMNEWSP04"); - Clickable_Object("MMNEWSP05"); - Clickable_Object("MMNEWSP07"); - Clickable_Object("PARKMETR02"); - Clickable_Object("TRANSFORMER 01"); - Clickable_Object("TRANSFORMER 02"); - Clickable_Object("V2CANPIPE02"); - Unclickable_Object("TRASH CAN WITH FIRE"); - Unclickable_Object("U2 CHEWDOOR"); - Unclickable_Object("MMTRASHCAN"); - Unclickable_Object("U2 EYE"); - Unclickable_Object("U2 E"); - Unclickable_Object("MMNEWSP01"); - Unclickable_Object("MMNEWSP02"); - Unclickable_Object("MMNEWSP04"); - Unclickable_Object("MMNEWSP06"); - Unclickable_Object("MMNEWSP07"); - Unclickable_Object("PARKMETR02"); - Unclickable_Object("TRANSFORMER 01"); - Unclickable_Object("TRANSFORMER 02"); - Unclickable_Object("V2CANPIPE02"); -} - -bool ScriptDR02::MouseClick(int x, int y) { - return false; -} - -bool ScriptDR02::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptDR02::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptDR02::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptDR02::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -835.0f, -0.04f, -118.0f, 0, 1, false, 0)) { - Async_Actor_Walk_To_XYZ(0, -727.0f, -0.04f, -118.0f, 0, false); - Game_Flag_Set(225); - Set_Enter(7, 25); - } - Ambient_Sounds_Adjust_Looping_Sound(219, 12, -101, 1); - Ambient_Sounds_Adjust_Looping_Sound(98, 14, -101, 1); - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -1162.0f, 7.18f, -322.0f, 0, 1, false, 0)) { - if (Global_Variable_Query(1) > 2) { - Actor_Says(0, 8522, 15); - } else { - Game_Flag_Set(226); - Set_Enter(34, 27); - } - } - return true; - } - if (exitId == 2) { - if (!Loop_Actor_Walk_To_XYZ(0, -1258.0f, 7.18f, -314.0f, 0, 1, false, 0)) { - Game_Flag_Set(265); - Game_Flag_Reset(177); - Game_Flag_Set(258); - Set_Enter(20, 2); - } - return true; - } - return false; -} - -bool ScriptDR02::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptDR02::SceneFrameAdvanced(int frame) { - if (frame == 1) { - Sound_Play(1, 10, 85, 85, 50); - } -} - -void ScriptDR02::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptDR02::PlayerWalkedIn() { - if (Game_Flag_Query(227)) { - Game_Flag_Reset(227); - } - if (Game_Flag_Query(224)) { - Game_Flag_Reset(224); - } - if (Game_Flag_Query(264)) { - Game_Flag_Reset(264); - } -} - -void ScriptDR02::PlayerWalkedOut() { -} - -void ScriptDR02::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/dr03.cpp b/engines/bladerunner/script/dr03.cpp deleted file mode 100644 index cea23b7ec3..0000000000 --- a/engines/bladerunner/script/dr03.cpp +++ /dev/null @@ -1,288 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptDR03::InitializeScene() { - if (Game_Flag_Query(226)) { - Game_Flag_Reset(226); - Setup_Scene_Information(330.31f, 4.27f, -910.91f, 297); - } - Setup_Scene_Information(330.31f, 4.27f, -910.91f, 297); - Scene_Exit_Add_2D_Exit(0, 377, 122, 445, 266, 0); - if (Global_Variable_Query(1) == 3) { - Actor_Put_In_Set(52, 34); - Actor_Set_At_XYZ(52, 431.21f, 4.27f, -776.26f, 0); - } else { - Actor_Put_In_Set(52, 34); - Actor_Set_At_XYZ(52, 360.77f, 4.4f, -806.67f, 126); - } - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Ambient_Sounds_Add_Looping_Sound(110, 7, 0, 1); - Ambient_Sounds_Add_Looping_Sound(109, 50, 0, 1); - Ambient_Sounds_Add_Looping_Sound(95, 20, 70, 1); -} - -void ScriptDR03::SceneLoaded() { - Obstacle_Object("W2-CENTCASE02", 1); - Obstacle_Object("W2-CARTTOP", 1); - Obstacle_Object("W2-TANKAFLUID01", 1); -} - -bool ScriptDR03::MouseClick(int x, int y) { - return false; -} - -bool ScriptDR03::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptDR03::ClickedOnActor(int actorId) { - if (actorId == 52) { - Actor_Face_Actor(0, 52, 1); - Actor_Face_Actor(52, 0, 1); - if (!Game_Flag_Query(267)) { - Actor_Says(0, 755, 18); - Actor_Says(52, 10, 14); - Actor_Says(0, 760, 18); - Actor_Says(52, 20, 14); - Actor_Says(0, 765, 18); - Actor_Says(52, 30, 14); - Game_Flag_Set(267); - return true; - } - if (Actor_Clue_Query(0, 67)) { - if (Game_Flag_Query(266) && Game_Flag_Query(267)) { - Actor_Says(0, 815, 18); - Actor_Says(52, 60, 14); - Actor_Says(52, 70, 14); - Actor_Says(52, 80, 14); - Actor_Says(0, 820, 18); - Actor_Says(52, 90, 14); - Actor_Says(0, 825, 18); - Actor_Says(52, 100, 14); - Game_Flag_Reset(266); - Game_Flag_Set(505); - return true; - } - if ((Actor_Clue_Query(0, 147) || Actor_Clue_Query(0, 71) || Actor_Clue_Query(0, 76) || Actor_Clue_Query(0, 67)) - && Game_Flag_Query(505)) { - sub_401B18(); - } else { - Actor_Says(0, 810, 18); - Actor_Says(52, 40, 14); - Actor_Says(52, 50, 14); - } - return true; - } - Actor_Says(0, 770, 12); - Actor_Says(52, 110, 12); - Actor_Says(52, 120, 13); - Actor_Says(0, 835, 13); - Actor_Says(52, 130, 14); - Actor_Says(0, 840, 16); - Actor_Says(52, 140, 15); - if (!Game_Flag_Query(505)) { - Actor_Says(52, 150, 13); - Actor_Says(0, 845, 17); - Actor_Says(52, 170, 18); - Actor_Says(52, 180, 16); - Actor_Says(0, 850, 15); - Actor_Says(52, 190, 14); - Actor_Says(52, 200, 13); - Actor_Says(0, 855, 18); - Actor_Says(52, 210, 12); - } - Actor_Clue_Acquire(0, 67, 1, 52); - return true; - } - return false; -} - -bool ScriptDR03::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptDR03::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, 330.31f, 4.27f, -910.91f, 24, 1, 0, 0)) { - Game_Flag_Set(227); - Set_Enter(7, 26); - } - return true; - } - return false; -} - -bool ScriptDR03::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptDR03::SceneFrameAdvanced(int frame) { - if (frame == 1 || frame == 4 || frame == 8 || frame == 10 || frame == 19 || frame == 21 || frame == 22 || frame == 23 || frame == 30 || frame == 31 || frame == 32 || frame == 33 || frame == 46 || frame == 49) { - if (Random_Query(0, 1)) { - Sound_Play(97, Random_Query(20, 33), 80, 80, 50); - } else { - Sound_Play(59, Random_Query(5, 6), 80, 80, 50); - } - } -} - -void ScriptDR03::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptDR03::PlayerWalkedIn() { - if (!Game_Flag_Query(226)) { - if (Random_Query(1, 2) == 1) { - Actor_Says(52, 660, 14); - Actor_Says(52, 680, 14); - } else if (Random_Query(1, 2) == 2) { - Actor_Says(52, 670, 14); - Actor_Says(52, 620, 14); - } else { - Actor_Says(52, 690, 14); - Actor_Says(52, 710, 14); - } - } -} - -void ScriptDR03::PlayerWalkedOut() { -} - -void ScriptDR03::DialogueQueueFlushed(int a1) { -} - -void ScriptDR03::sub_401B18() { - Dialogue_Menu_Clear_List(); - if (Actor_Clue_Query(0, 67) || Actor_Clue_Query(0, 71) || Actor_Clue_Query(0, 68)) { - DM_Add_To_List_Never_Repeat_Once_Selected(650, 5, 5, 5); - } - if (Actor_Clue_Query(0, 67)) { - DM_Add_To_List_Never_Repeat_Once_Selected(660, 5, 5, 5); - } - if (Actor_Clue_Query(0, 279)) { - DM_Add_To_List_Never_Repeat_Once_Selected(670, 6, 5, 2); - } - if (Game_Flag_Query(505)) { - if (Actor_Clue_Query(0, 71)) { - DM_Add_To_List_Never_Repeat_Once_Selected(680, 8, 8, 8); - } - if (Actor_Clue_Query(0, 76)) { - DM_Add_To_List_Never_Repeat_Once_Selected(1270, 2, 5, 7); - } - } - Dialogue_Menu_Add_DONE_To_List(690); - Dialogue_Menu_Appear(320, 240); - int answer = Dialogue_Menu_Query_Input(); - Dialogue_Menu_Disappear(); - switch (answer) { - case 640: - Actor_Says(0, 770, 12); - Actor_Says(52, 110, 12); - Actor_Says(52, 120, 13); - Actor_Says(0, 835, 13); - Actor_Says(52, 130, 14); - Actor_Says(0, 840, 16); - Actor_Says(52, 140, 15); - if (!Game_Flag_Query(505)) { - Actor_Says(52, 150, 13); - Actor_Says(0, 845, 17); - Actor_Says(52, 170, 18); - Actor_Says(52, 180, 16); - Actor_Says(0, 850, 15); - Actor_Says(52, 190, 14); - Actor_Says(52, 200, 13); - Actor_Says(0, 855, 18); - Actor_Says(52, 210, 12); - } - Actor_Clue_Acquire(0, 67, 1, 52); - break; - case 650: - Actor_Says(0, 775, 11); - Actor_Says(52, 220, 14); - Actor_Says(0, 860, 11); - Actor_Says(52, 230, 14); - Actor_Says(0, 865, 11); - Actor_Says(52, 240, 14); - Actor_Says(52, 250, 14); - break; - case 660: - Actor_Says(0, 780, 13); - if (Game_Flag_Query(505)) { - Actor_Says(52, 260, 14); - Actor_Says(52, 270, 13); - Actor_Says(52, 280, 12); - } else { - Actor_Says(52, 260, 14); - Actor_Says(52, 270, 13); - Actor_Says(52, 280, 12); - Actor_Says(0, 870, 18); - Actor_Says(52, 290, 15); - if (!Game_Flag_Query(266)) { - Actor_Says(52, 300, 12); - } - } - Actor_Clue_Acquire(0, 67, 1, 52); - break; - case 670: - Actor_Says(0, 765, 12); - Actor_Says(0, 790, 13); - Actor_Says(52, 310, 12); - Actor_Says(52, 320, 3); - break; - case 680: - Actor_Says(0, 795, 3); - if (Game_Flag_Query(505) == 1) { - Actor_Says(52, 330, 12); - Actor_Says(52, 340, 15); - Actor_Says(0, 875, 16); - Actor_Says(52, 350, 12); - Actor_Says(52, 360, 15); - Game_Flag_Set(326); - } else { - Actor_Says(52, 320, 13); - Actor_Says(52, 150, 14); - Game_Flag_Set(326); - } - break; - case 1270: - Actor_Says(0, 800, 16); - Actor_Says(52, 370, 3); - Actor_Says(0, 880, 15); - Actor_Says(52, 380, 13); - Actor_Says(52, 390, 12); - Actor_Says(0, 885, 14); - Actor_Says(52, 400, 13); - Actor_Says(52, 410, 15); - Actor_Says(0, 890, 18); - Actor_Says(52, 420, 13); - Actor_Says(52, 430, 12); - break; - case 690: - Actor_Says(0, 805, 3); - break; - } -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/dr04.cpp b/engines/bladerunner/script/dr04.cpp deleted file mode 100644 index 1cef91b967..0000000000 --- a/engines/bladerunner/script/dr04.cpp +++ /dev/null @@ -1,269 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptDR04::InitializeScene() { - if (Game_Flag_Query(515)) { - Setup_Scene_Information(0.0f, 0.0f, 0.0f, 0); - } else if (Game_Flag_Query(10)) { - Setup_Scene_Information(-711.0f, -0.04f, 70.0f, 472); - } else if (Game_Flag_Query(229)) { - Setup_Scene_Information(-1067.0f, 7.18f, 421.0f, 125); - } else if (Game_Flag_Query(231)) { - Setup_Scene_Information(-897.75f, 134.45f, 569.75f, 512); - } else { - Setup_Scene_Information(-810.0f, -0.04f, 242.0f, 125); - } - Scene_Exit_Add_2D_Exit(0, 589, 0, 639, 479, 1); - Scene_Exit_Add_2D_Exit(1, 443, 264, 488, 353, 0); - Scene_Exit_Add_2D_Exit(2, 222, 110, 269, 207, 0); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(0); - Ambient_Sounds_Add_Looping_Sound(54, 50, 1, 1); - Ambient_Sounds_Add_Looping_Sound(288, 55, -100, 1); - Ambient_Sounds_Add_Looping_Sound(217, 28, -100, 100); - Ambient_Sounds_Add_Speech_Sound(60, 0, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 20, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 40, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 50, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Sound(67, 40, 180, 16, 25, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(66, 40, 180, 16, 25, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(378, 5, 80, 50, 100, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(379, 5, 80, 50, 100, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(380, 5, 80, 50, 100, 0, 0, -101, -101, 0, 0); - if (Game_Flag_Query(272)) { - Scene_Loop_Set_Default(1); - } else { - Scene_Loop_Set_Default(4); - } - if (Game_Flag_Query(10)) { - if (Game_Flag_Query(272)) { - Scene_Loop_Start_Special(0, 0, 0); - } else { - Scene_Loop_Start_Special(0, 3, 0); - } - } -} - -void ScriptDR04::SceneLoaded() { - Obstacle_Object("TRASH CAN WITH FIRE", true); - Obstacle_Object("V2PYLON02", true); - Obstacle_Object("V2PYLON04", true); - Obstacle_Object("U2 CHEWDOOR", true); - Obstacle_Object("MMTRASHCAN", true); - Obstacle_Object("PARKMETR02", true); - Obstacle_Object("TRANSFORMER 01", true); - Obstacle_Object("TRANSFORMER 02", true); - Obstacle_Object("PARKMETR01", true); - Obstacle_Object("Z2ENTRYDR", true); - Obstacle_Object("Z2DR2", true); - Unclickable_Object("PARKMETR01"); - Unclickable_Object("Z2ENTRYDR"); - Unclickable_Object("Z2DR2"); -} - -bool ScriptDR04::MouseClick(int x, int y) { - return false; -} - -bool ScriptDR04::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptDR04::ClickedOnActor(int actorId) { - if (actorId == 35 && !Player_Query_Combat_Mode()) { - if (Actor_Query_Goal_Number(35) != 21) { - if (Actor_Query_Goal_Number(35) == 23) { - if (!Loop_Actor_Walk_To_Actor(0, 35, 36, 1, false)) { - Actor_Set_Goal_Number(24, 106); - return true; - } - } - return false; - } - if (!Loop_Actor_Walk_To_Waypoint(0, 109, 0, 1, true)) { - Actor_Face_Actor(0, 35, true); - Actor_Says(0, 945, 13); - Actor_Says(35, 0, 3); - Actor_Says(35, 10, 3); - Actor_Says(0, 950, 13); - Actor_Says(35, 20, 3); - Actor_Says(35, 30, 3); - Actor_Says(0, 955, 13); - Actor_Says_With_Pause(35, 40, 0, 3); - Actor_Says(35, 50, 3); - Actor_Clue_Acquire(0, 68, 1, 35); - Actor_Set_Goal_Number(35, 22); - Actor_Set_Goal_Number(24, 101); - return true; - } - return false; - } - return false; -} - -bool ScriptDR04::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptDR04::ClickedOnExit(int exitId) { - if (Actor_Query_Goal_Number(35) == 21) { - Actor_Force_Stop_Walking(0); - Actor_Set_Goal_Number(35, 22); - Actor_Set_Goal_Number(24, 101); - return true; - } - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -761.0f, -0.04f, 97.0f, 0, 1, false, 0)) { - Async_Actor_Walk_To_XYZ(0, -683.0f, -0.04f, 43.0f, 0, false); - Game_Flag_Set(11); - Set_Enter(7, 25); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -1067.0f, 7.18f, 421.0f, 0, 1, false, 0)) { - Game_Flag_Set(232); - Game_Flag_Set(228); - Set_Enter(35, 29); - } - return true; - } - if (exitId == 2) { - if (!Loop_Actor_Walk_To_XYZ(0, -851.0f, 6.98f, 560.0f, 0, 1, false, 0)) { - Footstep_Sound_Override_On(3); - Actor_Set_Immunity_To_Obstacles(0, true); - Actor_Face_Heading(0, 512, false); - Loop_Actor_Travel_Stairs(0, 7, 1, 0); - Loop_Actor_Walk_To_XYZ(0, -899.0f, 71.64f, 647.0f, 0, 0, false, 0); - Actor_Face_Heading(0, 0, false); - Loop_Actor_Travel_Stairs(0, 7, 1, 0); - Actor_Set_Immunity_To_Obstacles(0, false); - Footstep_Sound_Override_Off(); - Game_Flag_Set(230); - Set_Enter(36, 30); - } - return true; - } - return true; //bug? -} - -bool ScriptDR04::ClickedOn2DRegion(int region) { - return false; -} - -bool ScriptDR04::sub_401160() { - float x, y, z; - Actor_Query_XYZ(0, &x, &y, &z); - return (x + 1089.94f) * (x + 1089.94f) + (z - 443.49f) * (z - 443.49f) >= (360.0f * 360.0f); -} - -void ScriptDR04::SceneFrameAdvanced(int frame) { - if (Game_Flag_Query(515)) { - Game_Flag_Reset(515); - Game_Flag_Reset(271); - Scene_Loop_Set_Default(1); - Scene_Loop_Start_Special(2, 6, 1); - Music_Stop(4); - Actor_Set_Goal_Number(35, 99); - } else { - if (Game_Flag_Query(271)) { - Game_Flag_Reset(271); - Game_Flag_Set(272); - Scene_Loop_Set_Default(1); - Scene_Loop_Start_Special(2, 6, 1); - Item_Remove_From_World(78); - } - switch (frame) { - case 193: - Sound_Play(301, 100, 0, 100, 50); - Actor_Set_Goal_Number(35, 30); - Player_Loses_Control(); - Actor_Force_Stop_Walking(0); - if (sub_401160()) { - if (Player_Query_Combat_Mode()) { - Actor_Change_Animation_Mode(0, 22); - } else { - Actor_Change_Animation_Mode(0, 21); - } - } else { - Sound_Play_Speech_Line(0, 9905, 100, 0, 99); - Actor_Change_Animation_Mode(0, 48); - Actor_Retired_Here(0, 6, 6, 1, -1); - } - Player_Gains_Control(); - break; - case 235: - if (Actor_Query_Goal_Number(35) != 20 && Actor_Query_Goal_Number(35) != 21 && Actor_Query_Goal_Number(35) != 99) { - Actor_Set_Goal_Number(24, 101); - } - Scene_Exits_Enable(); - break; - case 237: - Overlay_Play("DR04OVER", 0, 1, 1, 0); - break; - } - } -} - -void ScriptDR04::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptDR04::PlayerWalkedIn() { - if (Game_Flag_Query(515)) { - Player_Loses_Control(); - Delay(4000); - Actor_Retired_Here(0, 6, 6, 1, -1); - } else { - if (Game_Flag_Query(269) && !Game_Flag_Query(272)) { - Scene_Exits_Disable(); - } - if (Game_Flag_Query(231)) { - Footstep_Sound_Override_On(3); - Actor_Set_Immunity_To_Obstacles(0, true); - Actor_Face_Heading(0, 512, false); - Loop_Actor_Travel_Stairs(0, 7, 0, 0); - Loop_Actor_Walk_To_XYZ(0, -851.0f, 71.64f, 647.0f, 0, 0, false, 0); - Actor_Face_Heading(0, 0, false); - Loop_Actor_Travel_Stairs(0, 7, 0, 0); - Loop_Actor_Walk_To_XYZ(0, -774.85f, 7.18f, 386.67001f, 0, 0, false, 0); - Actor_Set_Immunity_To_Obstacles(0, false); - Footstep_Sound_Override_Off(); - } - } - Game_Flag_Reset(10); - Game_Flag_Reset(229); - Game_Flag_Reset(231); -} - -void ScriptDR04::PlayerWalkedOut() { - Music_Stop(2); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); -} - -void ScriptDR04::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/dr05.cpp b/engines/bladerunner/script/dr05.cpp deleted file mode 100644 index c7beafe6ba..0000000000 --- a/engines/bladerunner/script/dr05.cpp +++ /dev/null @@ -1,189 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptDR05::InitializeScene() { - Setup_Scene_Information(-22.0f, 0.3f, 221.0f, 0); - Game_Flag_Reset(228); - Scene_Exit_Add_2D_Exit(0, 0, 38, 80, 467, 3); - Ambient_Sounds_Add_Looping_Sound(383, 25, 0, 1); - if (!Game_Flag_Query(272)) { - Overlay_Play("DR05OVER", 0, 1, 0, 0); - } - if (Game_Flag_Query(272)) { - Scene_Loop_Set_Default(2); - } else { - Scene_Loop_Set_Default(0); - } -} - -void ScriptDR05::SceneLoaded() { - Obstacle_Object("MAN PROPHI", true); - Unobstacle_Object("BOX06", true); - Unobstacle_Object("BOX183", true); - Clickable_Object("T2 DOORWAY"); - if (!Game_Flag_Query(272)) { - Item_Add_To_World(78, 932, 35, -1.57f, 31.33f, 75.21f, 540, 16, 16, true, true, false, true); - if (!Actor_Query_Goal_Number(35)) { - Item_Add_To_World(122, 931, 35, 37.35f, 1.59f, 46.72f, 0, 20, 20, true, true, false, true); - } - } -} - -bool ScriptDR05::MouseClick(int x, int y) { - return false; -} - -bool ScriptDR05::ClickedOn3DObject(const char *objectName, bool a2) { - if (Object_Query_Click("T2 DOORWAY", objectName)) { - if (Game_Flag_Query(276) || Actor_Query_Goal_Number(35)) { - if (!Loop_Actor_Walk_To_XYZ(0, 57.61f, 0.3f, 69.27f, 0, 1, false, 0)) { - Actor_Face_Object(0, "T2 DOORWAY", true); - Actor_Says(0, 8522, 13); - Actor_Says(0, 8521, 14); - } - } else { - Actor_Face_Object(0, "T2 DOORWAY", true); - Actor_Says(0, 1020, 14); - Actor_Says(35, 90, 13); - } - return true; - } - return false; -} - -bool ScriptDR05::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptDR05::ClickedOnItem(int itemId, bool a2) { - if (itemId == 78) { - if (Player_Query_Combat_Mode()) { - Game_Flag_Set(271); - Actor_Set_Goal_Number(35, 30); - } else if (!Game_Flag_Query(272) && !Loop_Actor_Walk_To_Item(0, 78, 24, 1, true) && Actor_Query_Goal_Number(35) != 11) { - if (!Actor_Query_Goal_Number(35)) { - Actor_Says_With_Pause(0, 1015, 0.1f, 12); - Actor_Says(35, 70, 13); - } - Actor_Set_Goal_Number(35, 30); - } - //return true; //bug? - } - if (itemId == 122 && Player_Query_Combat_Mode() && !Actor_Query_Goal_Number(35)) { - Overlay_Play("DR05OVER", 1, 0, 1, 0); - Item_Remove_From_World(122); - Game_Flag_Set(270); - Actor_Set_Goal_Number(35, 10); - Music_Play(18, 71, 0, 0, -1, 0, 2); - return true; - } - return false; -} - -bool ScriptDR05::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -22.0f, 0.3f, 221.0f, 0, 1, false, 0)) { - Game_Flag_Reset(232); - Game_Flag_Set(229); - Set_Enter(7, 28); - } - return true; - } - return false; -} - -bool ScriptDR05::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptDR05::SceneFrameAdvanced(int frame) { - if (frame == 49) { - Sound_Play(148, Random_Query(50, 50), 80, 80, 50); - } - if (Game_Flag_Query(271)) { - Item_Remove_From_World(78); - Game_Flag_Reset(271); - Game_Flag_Set(272); - Actor_Set_Goal_Number(35, 30); - } -} - -void ScriptDR05::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptDR05::PlayerWalkedIn() { - if (!Game_Flag_Query(511) && !Game_Flag_Query(270) && Game_Flag_Query(272)) { - Item_Remove_From_World(122); - } - if (Game_Flag_Query(272)) { - Loop_Actor_Walk_To_XYZ(0, -10.0f, 0.3f, 133.0f, 0, 0, false, 0); - if (!Game_Flag_Query(511)) { - Game_Flag_Set(511); - if (Game_Flag_Query(48)) { - Actor_Voice_Over(730, 99); - Actor_Voice_Over(740, 99); - Actor_Voice_Over(750, 99); - Actor_Voice_Over(760, 99); - Actor_Clue_Acquire(0, 269, 1, -1); - } else { - Actor_Voice_Over(670, 99); - Actor_Voice_Over(680, 99); - Actor_Voice_Over(700, 99); - Actor_Voice_Over(710, 99); - Actor_Voice_Over(720, 99); - Actor_Clue_Acquire(0, 270, 1, -1); - } - } - } else { - Loop_Actor_Walk_To_XYZ(0, -10.0f, 0.3f, 133.0f, 0, 0, true, 0); - } - if (!Game_Flag_Query(274) && !Actor_Query_Goal_Number(35)) { - Actor_Face_Actor(0, 35, true); - Actor_Says(0, 1010, 13); - Actor_Face_Item(0, 78, true); - Player_Set_Combat_Mode(true); - Actor_Says(35, 60, 12); - Actor_Change_Animation_Mode(0, 0); - Game_Flag_Set(274); - //return true; - } - //return false; -} - -void ScriptDR05::PlayerWalkedOut() { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - if (Actor_Query_Goal_Number(35) == 10 || Actor_Query_Goal_Number(35) == 18 || Actor_Query_Goal_Number(35) == 19) { - Actor_Set_Goal_Number(35, 11); - //return true; - } - //return false; -} - -void ScriptDR05::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/dr06.cpp b/engines/bladerunner/script/dr06.cpp deleted file mode 100644 index f744d21a13..0000000000 --- a/engines/bladerunner/script/dr06.cpp +++ /dev/null @@ -1,224 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptDR06::InitializeScene() { - if (Game_Flag_Query(230)) { - Setup_Scene_Information(-733.57001f, 136.60001f, -968.64001f, 0); - } else { - Setup_Scene_Information(-707.57001f, 136.60001f, -1132.64f, 472); - } - Scene_Exit_Add_2D_Exit(0, 601, 11, 639, 479, 1); - if (Global_Variable_Query(1) > 3 && Game_Flag_Query(715)) { - Scene_Exit_Add_2D_Exit(1, 0, 272, 46, 477, 2); - } - Ambient_Sounds_Add_Looping_Sound(383, 25, 0, 1); - Ambient_Sounds_Add_Sound(73, 5, 60, 20, 20, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(74, 5, 60, 20, 20, -100, 100, -101, -101, 0, 0); - if (Game_Flag_Query(268)) { - Overlay_Play("DR06over", 1, 1, 0, 0); - Ambient_Sounds_Add_Looping_Sound(300, 47, -75, 0); - } else { - Overlay_Play("DR06over", 0, 1, 0, 0); - } - if (Game_Flag_Query(548)) { - Overlay_Play("DR06ovr2", 0, 1, 0, 0); - } -} - -void ScriptDR06::SceneLoaded() { - Obstacle_Object("X2_ASHTRAY", true); - Clickable_Object("X2_ASHTRAY"); - Clickable_Object("X2KEYBRD02"); - Clickable_Object("X2_MON01D01"); - Clickable_Object("X2_MON01A04"); - Clickable_Object("X2_TORSO04HIRES"); - Clickable_Object("BOX16"); - if (Actor_Clue_Query(0, 76)) { - Unclickable_Object("X2_TORSO04HIRES"); - } -} - -bool ScriptDR06::MouseClick(int x, int y) { - return false; -} - -bool ScriptDR06::ClickedOn3DObject(const char *objectName, bool a2) { - if (Object_Query_Click("BOX16", objectName)) { - Loop_Actor_Walk_To_XYZ(0, -743.0f, 136.6f, -1091.0f, 0, 1, false, 0); - Actor_Face_Object(0, "BOX16", true); - if (!Game_Flag_Query(268)) { - Overlay_Play("DR06over", 1, 1, 1, 0); - Ambient_Sounds_Add_Looping_Sound(300, 47, -75, 0); - Game_Flag_Set(268); - return true; - } - Overlay_Play("DR06over", 0, 1, 1, 0); - Ambient_Sounds_Remove_Looping_Sound(300, false); - Game_Flag_Reset(268); - return true; - } - if (Object_Query_Click("X2_MON01A04", objectName)) { - if (Actor_Clue_Query(0, 71)) { - Actor_Face_Object(0, "X2_MON01A04", true); - Actor_Says(0, 8570, 13); - } else if (!Loop_Actor_Walk_To_XYZ(0, -684.94f, 136.6f, -1136.12f, 0, 1, false, 0)) { - Actor_Face_Object(0, "X2_MON01A04", true); - Actor_Says(39, 10, 3); - Actor_Says(39, 20, 3); - Actor_Says(39, 30, 3); - Actor_Says(0, 1025, 13); - Actor_Says(56, 0, 3); - Actor_Says(56, 10, 3); - Actor_Says(56, 20, 3); - Actor_Says(56, 30, 3); - Actor_Says(56, 40, 3); - Actor_Says(56, 50, 3); - Actor_Says(39, 40, 3); - Actor_Says(0, 1030, 13); - Actor_Says(39, 50, 3); - Actor_Clue_Acquire(0, 71, 1, 39); - } - return true; - } - if (Object_Query_Click("X2_MON01D01", objectName)) { - if (!Loop_Actor_Walk_To_XYZ(0, -645.34f, 136.6f, -1047.37f, 0, 1, false, 0)) { - Actor_Face_Heading(0, 329, false); - if (Actor_Clue_Query(0, 125) && Actor_Clue_Query(0, 126) && !Game_Flag_Query(670)) { - Actor_Set_Goal_Number(0, 350); - Game_Flag_Set(670); - } else if (Game_Flag_Query(280)) { - Actor_Says(0, 8570, 13); - } else { - Actor_Voice_Over(770, 99); - Actor_Voice_Over(780, 99); - Actor_Voice_Over(790, 99); - Actor_Voice_Over(800, 99); - Game_Flag_Set(280); - } - } - return true; - } - if (Object_Query_Click("X2_KEYBRD02", objectName) && !Game_Flag_Query(278)) { - Loop_Actor_Walk_To_XYZ(0, -655.57f, 136.6f, -1092.64f, 0, 1, false, 0); - Actor_Face_Object(0, "X2_KEYBRD02", true); - Actor_Voice_Over(830, 99); - Actor_Voice_Over(840, 99); - Game_Flag_Set(278); - return true; - } - if (Object_Query_Click("X2_TORSO04HIRES", objectName)) { - if (!Loop_Actor_Walk_To_XYZ(0, -700.0f, 136.6f, -1133.0f, 4, 1, false, 0)) { - Actor_Face_Object(0, "x2_TORSO04HIRES", true); - if (Global_Variable_Query(39) > 12) { - return true; - } - if (Game_Flag_Query(548)) { - Overlay_Remove("DR06ovr2"); - Game_Flag_Reset(548); - Sound_Play(161, 100, 0, 0, 50); - } else { - Overlay_Play("DR06ovr2", 0, 1, 0, 0); - Game_Flag_Set(548); - Sound_Play(160, 100, 0, 0, 50); - if (!Actor_Clue_Query(0, 76)) { - Actor_Voice_Over(850, 99); - Item_Pickup_Spin_Effect(944, 171, 280); - Actor_Voice_Over(860, 99); - Actor_Voice_Over(870, 99); - Actor_Voice_Over(880, 99); - Actor_Clue_Acquire(0, 76, 1, 13); - if (Query_Difficulty_Level() != 0) { - Global_Variable_Increment(2, 200); - } - } - } - Global_Variable_Increment(39, 1); - if (Global_Variable_Query(39) > 12) { - Sound_Play(204, 100, 0, 0, 50); - Unclickable_Object("X2_TORSO04HIRES"); - } - } - return true; - } - Actor_Face_Object(0, "X2_MON01D01", true); - Actor_Says(0, 8525, 13); - return true; -} - -bool ScriptDR06::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptDR06::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptDR06::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -733.0f, 136.6f, -980.0f, 0, 1, false, 0)) { - Game_Flag_Set(231); - Set_Enter(7, 28); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -707.57f, 136.6f, -1132.64f, 0, 1, false, 0)) { - Game_Flag_Set(552); - Set_Enter(19, 100); - } - return true; - } - return false; -} - -bool ScriptDR06::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptDR06::SceneFrameAdvanced(int frame) { -} - -void ScriptDR06::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptDR06::PlayerWalkedIn() { - if (Game_Flag_Query(230)) { - Loop_Actor_Walk_To_XYZ(0, -729.57f, 136.6f, -1016.0f, 0, 0, false, 0); - } - Game_Flag_Reset(230); - Game_Flag_Reset(551); -} - -void ScriptDR06::PlayerWalkedOut() { - Overlay_Remove("DR06over"); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(0); - Ambient_Sounds_Remove_All_Looping_Sounds(1); -} - -void ScriptDR06::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/hc01.cpp b/engines/bladerunner/script/hc01.cpp deleted file mode 100644 index c59eab6ed5..0000000000 --- a/engines/bladerunner/script/hc01.cpp +++ /dev/null @@ -1,433 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptHC01::InitializeScene() { - Music_Play(0, 31, 0, 2, -1, 1, 2); - if (Game_Flag_Query(385)) { - Setup_Scene_Information(64.0f, 0.14f, 83.0f, 266); - } else if (Game_Flag_Query(387)) { - Setup_Scene_Information(607.0f, 0.14f, 9.0f, 530); - } else { - Setup_Scene_Information(780.0f, 0.14f, 153.0f, 815); - } - Scene_Exit_Add_2D_Exit(0, 0, 460, 639, 479, 2); - if (Game_Flag_Query(402)) { - Scene_Exit_Add_2D_Exit(1, 394, 229, 485, 371, 1); - } - Scene_Exit_Add_2D_Exit(2, 117, 0, 286, 319, 0); - Ambient_Sounds_Add_Looping_Sound(103, 50, 50, 0); - Ambient_Sounds_Add_Looping_Sound(241, 50, 50, 0); - Ambient_Sounds_Add_Sound(242, 3, 30, 16, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(243, 3, 30, 16, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(244, 3, 30, 16, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(245, 3, 30, 16, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(246, 3, 30, 16, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(247, 3, 30, 16, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(248, 3, 30, 16, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(249, 3, 30, 16, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(181, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(183, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(184, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(185, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(186, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(188, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(189, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(190, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(192, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(193, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(194, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Scene_Loop_Set_Default(0); -} - -void ScriptHC01::SceneLoaded() { - Obstacle_Object("PILLAR", true); - if (Game_Flag_Query(322)) { - Preload(19); - Preload(426); - Preload(430); - Preload(437); - Preload(427); - Preload(431); - Preload(433); - Preload(424); - Preload(428); - Preload(436); - Preload(429); - Preload(425); - Preload(432); - } -} - -bool ScriptHC01::MouseClick(int x, int y) { - return false; -} - -bool ScriptHC01::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptHC01::ClickedOnActor(int actorId) { - if (actorId == 7 && (Actor_Query_Goal_Number(7) == 150 || Actor_Query_Goal_Number(7) == 0)) { - AI_Movement_Track_Pause(7); - if (!Loop_Actor_Walk_To_XYZ(0, 624.43f, 0.14f, 83.0f, 0, 1, false, 0)) { - if (Game_Flag_Query(400)) { - Actor_Face_Actor(0, 7, true); - Actor_Face_Actor(7, 0, true); - sub_402384(); - } else { - Actor_Face_Actor(7, 0, true); - Actor_Says_With_Pause(7, 10, 0.2f, 13); - Actor_Face_Actor(0, 7, true); - Actor_Says(7, 20, 17); - Actor_Says(0, 1035, 18); - Actor_Says_With_Pause(7, 30, 0.2f, 17); - Actor_Says_With_Pause(7, 40, 0.0f, 13); - Actor_Says(7, 50, 12); - Actor_Says_With_Pause(0, 1040, 1.2f, 13); - Actor_Says(7, 60, 16); - Actor_Says_With_Pause(7, 70, 1.0f, 13); - Actor_Says_With_Pause(0, 1045, 0.6f, 14); - Actor_Says(7, 80, 18); - Game_Flag_Set(400); - } - } - AI_Movement_Track_Unpause(7); - } - return false; -} - -bool ScriptHC01::ClickedOnItem(int itemId, bool a2) { - if (itemId == 107) { - Item_Remove_From_World(107); - Item_Pickup_Spin_Effect(977, 361, 381); - Delay(1500); - Item_Pickup_Spin_Effect(984, 377, 397); - Delay(1500); - Item_Pickup_Spin_Effect(984, 330, 384); - if (Game_Flag_Query(374)) { - Actor_Clue_Acquire(0, 246, 1, 7); - } else { - Actor_Clue_Acquire(0, 247, 1, 7); - } - Actor_Clue_Acquire(0, 260, 1, 7); - return true; - } - return false; -} - -bool ScriptHC01::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, 814.0f, 0.14f, 153.0f, 0, 1, false, 0)) { - Music_Adjust(12, 0, 2); - Game_Flag_Set(323); - Set_Enter(0, 0); - Game_Flag_Reset(479); - Game_Flag_Set(180); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, 607.0f, 0.14f, 9.0f, 0, 1, false, 0)) { - Game_Flag_Set(386); - Set_Enter(8, 33); - } - return true; - } - if (exitId == 2) { - if (!Loop_Actor_Walk_To_XYZ(0, 105.0f, 0.14f, 103.0f, 0, 1, false, 0)) { - Game_Flag_Set(384); - Async_Actor_Walk_To_XYZ(0, -57.0f, 0.14f, 83.0f, 0, false); - Set_Enter(8, 32); - } - return true; - } - return false; -} - -bool ScriptHC01::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptHC01::SceneFrameAdvanced(int frame) { - Set_Fade_Color(1.0f, 1.0f, 1.0f); - if (frame >= 61 && frame < 65) { - Set_Fade_Density((frame - 61) / 4.0f); - } else if (frame >= 65 && frame < 93) { - Set_Fade_Density(1.0f); - } else if (frame >= 93 && frame < 106) { - Set_Fade_Density((105 - frame) / 13.0f); - } else { - Set_Fade_Density(0.0f); - } - if (frame == 61) { - Ambient_Sounds_Play_Sound(312, 90, 0, 0, 0); - } - if (frame == 65) { - Ambient_Sounds_Play_Sound(315, 50, 0, 100, 0); - } - if (frame == 80) { - Ambient_Sounds_Play_Sound(316, 40, 100, 100, 0); - Item_Add_To_World(121, 931, 8, 582.0f, 27.0f, -41.0f, 0, 8, 8, true, true, false, true); - } -} - -void ScriptHC01::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptHC01::PlayerWalkedIn() { - if (Game_Flag_Query(385)) { - Loop_Actor_Walk_To_XYZ(0, 105.0f, 0.14f, 103.0f, 0, 0, false, 0); - Game_Flag_Reset(385); - } - if (Game_Flag_Query(387)) { - Game_Flag_Reset(387); - } - if (Game_Flag_Query(322)) { - Game_Flag_Reset(322); - } -} - -void ScriptHC01::PlayerWalkedOut() { - Set_Fade_Density(0.0f); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); -} - -void ScriptHC01::DialogueQueueFlushed(int a1) { -} - -void ScriptHC01::sub_402384() { - if (!Game_Flag_Query(401)) { - Actor_Says(0, 1055, 13); - Actor_Says(7, 130, 13); - Actor_Says_With_Pause(0, 1060, 0.2f, 13); - Actor_Says(7, 140, 13); - Game_Flag_Set(401); - } - Dialogue_Menu_Clear_List(); - if (Actor_Clue_Query(0, 56) == 1) { - DM_Add_To_List_Never_Repeat_Once_Selected(1020, 6, 7, 3); - } else if (Actor_Clue_Query(0, 44) || Actor_Clue_Query(0, 47) || Actor_Clue_Query(0, 14)) { - DM_Add_To_List_Never_Repeat_Once_Selected(1010, 6, 7, 3); - } - if (Actor_Clue_Query(0, 58) == 1) { - DM_Add_To_List_Never_Repeat_Once_Selected(1030, 1, 5, 7); - } else if (Actor_Clue_Query(0, 5) == 1) { - DM_Add_To_List_Never_Repeat_Once_Selected(1040, 4, 4, 6); - } - if (Actor_Clue_Query(0, 181) == 1) { - DM_Add_To_List_Never_Repeat_Once_Selected(1050, -1, 3, 8); - } else if (Actor_Clue_Query(0, 180) == 1) { - DM_Add_To_List_Never_Repeat_Once_Selected(1060, -1, 3, 8); - } - if (!Dialogue_Menu_Query_List_Size()) { - Actor_Says_With_Pause(0, 1105, 1.2f, 13); - if (Actor_Query_Friendliness_To_Other(7, 0) < 50) { - Actor_Says(7, 550, 15); - } else { - Actor_Says(7, 250, 13); - Actor_Modify_Friendliness_To_Other(7, 0, -1); - if (Actor_Query_Friendliness_To_Other(7, 0) < 47 && Query_Difficulty_Level() == 0) { - sub_40346C(); - } - } - return; - } - Dialogue_Menu_Add_DONE_To_List(100); - bool end = false; - do { - Dialogue_Menu_Appear(320, 240); - int answer = Dialogue_Menu_Query_Input(); - Dialogue_Menu_Disappear(); - if (answer == 1020) { - Dialogue_Menu_Remove_From_List(1020); - Actor_Says(0, 1065, 15); - Actor_Says(7, 160, 3); - Actor_Says(0, 1110, 16); - Actor_Says(7, 170, 3); - Actor_Says(7, 180, 3); - Actor_Says(7, 190, 12); - if (Query_Difficulty_Level() < 2) { - Actor_Modify_Friendliness_To_Other(7, 0, -2); - } - } - if (answer == 1010) { - Dialogue_Menu_Remove_From_List(1010); - Actor_Clue_Acquire(0, 60, 0, 7); - Actor_Says(0, 1070, 13); - Actor_Says(7, 200, 17); - Actor_Says(7, 210, 12); - Actor_Says(0, 1115, 12); - Actor_Says(7, 220, 16); - Actor_Says(7, 230, 3); - Actor_Says(7, 240, 15); - if (Query_Difficulty_Level() < 2) { - Actor_Modify_Friendliness_To_Other(7, 0, -1); - } - } - if (answer == 1010 || answer == 1020) { - Actor_Says_With_Pause(0, 1120, 0.9f, 17); - Actor_Says(7, 250, 13); - Actor_Says(0, 1125, 14); - if (Actor_Query_Friendliness_To_Other(7, 0) < 47) { - Actor_Set_Goal_Number(7, 1); - Player_Loses_Control(); - Actor_Says(7, 90, 3); - Actor_Face_Actor(7, 0, true); - Actor_Says(7, 100, 3); - Actor_Says(7, 110, 3); - Actor_Says_With_Pause(0, 1050, 0.2f, 3); - Actor_Says(7, 120, 3); - Actor_Set_Goal_Number(7, 2); - } - end = true; - } - if (answer == 1030) { - Dialogue_Menu_Remove_From_List(1030); - Actor_Says(0, 1075, 18); - Actor_Says(7, 260, 12); - Actor_Says(7, 270, 16); - Actor_Says(0, 1130, 14); - Actor_Says(7, 280, 17); - Actor_Says(0, 1135, 15); - Actor_Says(7, 290, 15); - Actor_Says(7, 300, 12); - Actor_Says(7, 310, 17); - Actor_Says(0, 1140, 3); - if (Query_Difficulty_Level() < 2) { - Actor_Modify_Friendliness_To_Other(7, 0, -2); - } - if (Actor_Query_Friendliness_To_Other(7, 0) < 47) { - Actor_Set_Goal_Number(7, 1); - Player_Loses_Control(); - Actor_Says(7, 90, 3); - Actor_Face_Actor(7, 0, true); - Actor_Says(7, 100, 3); - Actor_Says(7, 110, 3); - Actor_Says_With_Pause(0, 1050, 0.2f, 3); - Actor_Says(7, 120, 3); - Actor_Set_Goal_Number(7, 2); - } - end = true; - } - if (answer == 1040) { - Dialogue_Menu_Remove_From_List(1040); - Actor_Says(0, 1080, 15); - Actor_Says(0, 1085, 17); - Actor_Says(7, 320, 17); - Actor_Says(0, 1145, 13); - Actor_Says(7, 330, 17); - Actor_Says(7, 340, 13); - Actor_Says(7, 350, 12); - end = true; - } - if (answer == 1050) { - Dialogue_Menu_Remove_From_List(1050); - Actor_Says(0, 1090, 18); - Actor_Says(7, 360, 14); - Actor_Says(0, 1150, 17); - Actor_Says(7, 370, 13); - Actor_Says(0, 1155, 15); - Actor_Says(7, 380, 12); - Actor_Says(0, 1160, 14); - Actor_Says(0, 1165, 18); - Actor_Says(7, 390, 16); - Actor_Says(0, 1170, 12); - Actor_Says(7, 400, 13); - Actor_Says(0, 1180, 14); - Actor_Says(7, 410, 12); - Actor_Says(7, 420, 16); - Actor_Says(7, 430, 17); - Actor_Says(7, 440, 13); - Actor_Modify_Friendliness_To_Other(7, 0, -4); - if (Actor_Query_Friendliness_To_Other(7, 0) < 47) { - Actor_Set_Goal_Number(7, 1); - Player_Loses_Control(); - Actor_Says(7, 90, 3); - Actor_Face_Actor(7, 0, true); - Actor_Says(7, 100, 3); - Actor_Says(7, 110, 3); - Actor_Says_With_Pause(0, 1050, 0.2f, 3); - Actor_Says(7, 120, 3); - Actor_Set_Goal_Number(7, 2); - } - end = true; - } - if (answer == 1060) { - Dialogue_Menu_Remove_From_List(1060); - Actor_Says(0, 1095, 15); - Actor_Says_With_Pause(0, 1100, 1.2f, 18); - Actor_Says(7, 450, 12); - Actor_Says(7, 460, 13); - Actor_Says(0, 1185, 18); - Actor_Says(7, 470, 14); - Actor_Says(0, 1190, 14); - Actor_Says(7, 480, 13); - Actor_Says(0, 1195, 16); - Actor_Says(0, 1200, 18); - Actor_Says(7, 490, 12); - Actor_Says(0, 1205, 14); - Actor_Says(7, 500, 14); - Actor_Says(7, 510, 17); - Actor_Says(7, 520, 16); - Actor_Says(7, 530, 15); - Actor_Says(0, 1210, 16); - Actor_Modify_Friendliness_To_Other(7, 0, -4); - if (Actor_Query_Friendliness_To_Other(7, 0) < 47) { - Actor_Set_Goal_Number(7, 1); - Player_Loses_Control(); - Actor_Says(7, 90, 3); - Actor_Face_Actor(7, 0, true); - Actor_Says(7, 100, 3); - Actor_Says(7, 110, 3); - Actor_Says_With_Pause(0, 1050, 0.2f, 3); - Actor_Says(7, 120, 3); - Actor_Set_Goal_Number(7, 2); - } - end = true; - } - if (answer == 100) { - end = true; - } - } while (!end); -} - -void ScriptHC01::sub_40346C() { - Actor_Set_Goal_Number(7, 1); - Player_Loses_Control(); - Actor_Says(7, 90, 3); - Actor_Face_Actor(7, 0, true); - Actor_Says(7, 100, 3); - Actor_Says(7, 110, 3); - Actor_Says_With_Pause(0, 1050, 0.2f, 3); - Actor_Says(7, 120, 3); - Actor_Set_Goal_Number(7, 2); -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/hc02.cpp b/engines/bladerunner/script/hc02.cpp deleted file mode 100644 index c676938410..0000000000 --- a/engines/bladerunner/script/hc02.cpp +++ /dev/null @@ -1,216 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptHC02::InitializeScene() { - Music_Play(4, 45, -60, 1, -1, 1, 3); - if (Game_Flag_Query(109)) { - Setup_Scene_Information(-88.0f, 0.14f, -463.0f, 540); - } else { - Setup_Scene_Information(-57.0f, 0.14f, 83.0f, 746); - } - Scene_Exit_Add_2D_Exit(0, 589, 255, 639, 479, 1); - Scene_Exit_Add_2D_Exit(1, 505, 0, 639, 170, 0); - Ambient_Sounds_Add_Looping_Sound(103, 50, 50, 0); - Ambient_Sounds_Add_Looping_Sound(280, 50, 50, 0); - Ambient_Sounds_Add_Sound(252, 3, 60, 33, 33, -60, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(254, 3, 60, 33, 33, -60, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(255, 3, 60, 33, 33, -60, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(256, 3, 60, 33, 33, -60, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(257, 3, 60, 33, 33, -60, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(258, 3, 60, 33, 33, -60, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(259, 3, 60, 33, 33, -100, 20, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(260, 3, 60, 33, 33, -100, 20, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(261, 3, 60, 33, 33, -100, 20, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(262, 3, 60, 33, 33, -100, 20, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(184, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(185, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(186, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(188, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(189, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(192, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(242, 3, 30, 14, 14, 30, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(243, 3, 30, 14, 14, 30, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(244, 3, 30, 14, 14, 30, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(245, 3, 30, 14, 14, 30, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(246, 3, 30, 14, 14, 30, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(247, 3, 30, 14, 14, 30, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(248, 3, 30, 14, 14, 30, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(249, 3, 30, 14, 14, 30, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(238, 3, 50, 20, 20, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(240, 3, 50, 25, 25, -100, 100, -101, -101, 0, 0); - if (Game_Flag_Query(384)) { - Scene_Loop_Start_Special(0, 0, 0); - Scene_Loop_Set_Default(1); - Game_Flag_Reset(384); - } else { - Scene_Loop_Set_Default(1); - } -} - -void ScriptHC02::SceneLoaded() { - Obstacle_Object("BARSTOOL01", true); -} - -bool ScriptHC02::MouseClick(int x, int y) { - return false; -} - -bool ScriptHC02::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptHC02::ClickedOnActor(int actorId) { - if (actorId == 32) { - if (!Loop_Actor_Walk_To_XYZ(0, -150.51f, 0.14f, 62.74f, 0, 1, false, 0)) { - Actor_Face_Actor(0, 32, true); - if (!Game_Flag_Query(404)) { - Actor_Says(0, 1225, 13); - Actor_Says_With_Pause(32, 0, 0.0f, 13); - Actor_Says(32, 10, 16); - Actor_Set_Goal_Number(32, 1); - Actor_Change_Animation_Mode(0, 23); - Delay(1500); - Actor_Change_Animation_Mode(0, 75); - Delay(1500); - Global_Variable_Increment(42, 1); - Game_Flag_Set(404); - } else if (Actor_Clue_Query(0, 254) && !Actor_Clue_Query(0, 257)) { - Actor_Says(0, 4545, 11); - Actor_Says(32, 120, 12); - Actor_Says(32, 180, 13); - Actor_Clue_Acquire(0, 257, 1, 32); - Item_Pickup_Spin_Effect(975, 229, 215); - } else if (Actor_Clue_Query(0, 122) && !Actor_Clue_Query(0, 131) && (Global_Variable_Query(2) > 20 || Query_Difficulty_Level() == 0)) { - Actor_Clue_Acquire(0, 131, 1, 32); - Actor_Says(0, 1230, 13); - Actor_Says(32, 20, 12); - Actor_Says(0, 1235, 13); - Actor_Says(32, 30, 15); - Actor_Says(0, 1240, 13); - Actor_Says(32, 40, 14); - Item_Pickup_Spin_Effect(945, 229, 215); - Actor_Set_Goal_Number(32, 2); - Actor_Change_Animation_Mode(0, 23); - Delay(1500); - Actor_Says_With_Pause(32, 50, 1.6f, 17); - if (Query_Difficulty_Level() != 0) { - Global_Variable_Decrement(2, 20); - } - Actor_Says(0, 1245, 13); - } else { - if (Actor_Clue_Query(0, 75) && !Game_Flag_Query(405)) { - Actor_Says(32, 80, 16); - Actor_Says(0, 1265, 13); - Actor_Says(32, 90, 13); - Game_Flag_Set(405); - } - if (Global_Variable_Query(2) > 5 || Query_Difficulty_Level() == 0) { - if (Query_Difficulty_Level() != 0) { - Global_Variable_Decrement(2, 5); - } - Global_Variable_Increment(42, 1); - Actor_Says(0, 1250, 13); - Actor_Says_With_Pause(32, 60, 0.8f, 14); - Actor_Says(0, 1255, 13); - Actor_Set_Goal_Number(32, 1); - Actor_Change_Animation_Mode(0, 23); - Delay(1500); - Actor_Change_Animation_Mode(0, 75); - Delay(1500); - } else { - Actor_Says_With_Pause(0, 1260, 0.3f, 13); - Actor_Says(32, 70, 14); - } - } - } - return true; - } - return false; -} - -bool ScriptHC02::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptHC02::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, 7.0f, 0.14f, 79.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(385); - Set_Enter(8, 31); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -76.0f, 0.14f, -339.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(110); - Async_Actor_Walk_To_XYZ(0, -88.0f, 0.14f, -463.0f, 0, false); - Set_Enter(8, 106); - } - return true; - } - return false; -} - -bool ScriptHC02::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptHC02::SceneFrameAdvanced(int frame) { - if (frame == 70) { - Sound_Play(73, 11, 50, -90, 50); - } - if (frame == 58) { - Sound_Play(73, 11, 50, -90, 50); - } - if (frame == 69 || frame == 77 || frame == 86 || frame == 95 || frame == 104 || frame == 113 || frame == 119) { - Sound_Play(60, Random_Query(6, 7), -20, 20, 50); - } -} - -void ScriptHC02::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptHC02::PlayerWalkedIn() { - if (Game_Flag_Query(109)) { - Loop_Actor_Walk_To_XYZ(0, -76.0f, 0.14f, -339.0f, 0, 0, false, 0); - Game_Flag_Reset(109); - } -} - -void ScriptHC02::PlayerWalkedOut() { -} - -void ScriptHC02::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/hc03.cpp b/engines/bladerunner/script/hc03.cpp deleted file mode 100644 index 58a822c982..0000000000 --- a/engines/bladerunner/script/hc03.cpp +++ /dev/null @@ -1,188 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptHC03::InitializeScene() { - if (Game_Flag_Query(318)) { - Setup_Scene_Information(656.0f, 1.61f, -95.0f, 497); - Game_Flag_Set(388); - Game_Flag_Reset(318); - } else { - Setup_Scene_Information(607.0f, 0.14f, 13.0f, 57); - Game_Flag_Reset(386); - } - Scene_Exit_Add_2D_Exit(0, 0, 0, 30, 479, 3); - if (Game_Flag_Query(403) || Global_Variable_Query(1) > 3) { - Item_Remove_From_World(121); - Game_Flag_Set(403); - Scene_Exit_Add_2D_Exit(1, 400, 275, 515, 375, 2); - } - Ambient_Sounds_Add_Looping_Sound(103, 50, 50, 0); - Ambient_Sounds_Add_Looping_Sound(241, 50, 50, 0); - Ambient_Sounds_Add_Sound(242, 3, 30, 16, 16, -100, -70, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(243, 3, 30, 16, 16, -100, -70, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(244, 3, 30, 16, 16, -100, -70, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(245, 3, 30, 16, 16, -100, -70, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(246, 3, 30, 16, 16, -100, -70, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(247, 3, 30, 16, 16, -100, -70, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(248, 3, 30, 16, 16, -100, -70, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(249, 3, 30, 16, 16, -100, -70, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(238, 3, 50, 25, 25, -100, -70, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(240, 3, 50, 33, 33, -100, -70, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(181, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(183, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(184, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(185, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(186, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(188, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(189, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(190, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(192, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(193, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(194, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - if (Game_Flag_Query(388)) { - Scene_Loop_Set_Default(6); - } else if (Game_Flag_Query(403) || Global_Variable_Query(1) > 3) { - Scene_Loop_Set_Default(3); - } else { - Scene_Loop_Set_Default(0); - } -} - -void ScriptHC03::SceneLoaded() { - Obstacle_Object("GUITAR01", true); - if (Game_Flag_Query(403) || Game_Flag_Query(388) || Global_Variable_Query(1) > 3) { - Unobstacle_Object("GPscisGate", true); - } else { - Obstacle_Object("GPscisGate", true); - } - Unclickable_Object("GUITAR01"); -} - -bool ScriptHC03::MouseClick(int x, int y) { - return false; -} - -bool ScriptHC03::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptHC03::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptHC03::ClickedOnItem(int itemId, bool a2) { - if (itemId == 121) { - if (a2) { - Scene_Loop_Set_Default(3); - Scene_Loop_Start_Special(2, 2, 1); - Game_Flag_Set(403); - Item_Remove_From_World(121); - Unobstacle_Object("GPscisGate", true); - } else { - Actor_Says(0, 8522, 12); - } - return true; - } - if (itemId == 107) { - Item_Remove_From_World(107); - Item_Pickup_Spin_Effect(977, 68, 435); - Delay(1500); - Item_Pickup_Spin_Effect(984, 78, 435); - Delay(1500); - Item_Pickup_Spin_Effect(984, 58, 435); - if (Game_Flag_Query(374)) { - Actor_Clue_Acquire(0, 246, 1, 7); - } else { - Actor_Clue_Acquire(0, 247, 1, 7); - } - Actor_Clue_Acquire(0, 260, 1, 7); - return true; - } - return false; -} - -bool ScriptHC03::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, 607.0f, 0.14f, 9.0f, 0, 1, false, 0)) { - Game_Flag_Set(387); - Set_Enter(8, 31); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, 628.0f, 2.04f, -123.0f, 0, 1, false, 0)) { - if (Game_Flag_Query(388)) { - Game_Flag_Set(319); - Game_Flag_Reset(479); - Game_Flag_Set(259); - Game_Flag_Set(388); - Music_Stop(2); - Set_Enter(75, 87); - } else { - Scene_Loop_Set_Default(6); - Scene_Loop_Start_Special(2, 5, 1); - Game_Flag_Set(388); - } - } - return true; - } - return false; -} - -bool ScriptHC03::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptHC03::SceneFrameAdvanced(int frame) { - if (frame == 10 || frame == 19 || frame == 29 || frame == 39 || frame == 49 || frame == 59 || frame == 71 || frame == 82 || frame == 91 || frame == 101 || frame == 111 || frame == 121 || frame == 131) { - Sound_Play(281, Random_Query(33, 50), 50, 50, 50); - } - if (!Game_Flag_Query(521) && frame == 66) { - Ambient_Sounds_Play_Sound(328, 90, 0, -40, 99); - Sound_Play(201, Random_Query(47, 47), 0, -40, 50); - Scene_Exit_Add_2D_Exit(1, 400, 275, 515, 375, 2); - Game_Flag_Set(521); - } -} - -void ScriptHC03::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptHC03::PlayerWalkedIn() { -} - -void ScriptHC03::PlayerWalkedOut() { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); -} - -void ScriptHC03::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/hc04.cpp b/engines/bladerunner/script/hc04.cpp deleted file mode 100644 index 5582a212b5..0000000000 --- a/engines/bladerunner/script/hc04.cpp +++ /dev/null @@ -1,242 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptHC04::InitializeScene() { - if (Game_Flag_Query(108)) { - Setup_Scene_Information(-112.0f, 0.14f, -655.0f, 460); - Game_Flag_Reset(108); - } else { - Setup_Scene_Information(-88.0f, 0.14f, -463.0f, 1013); - } - Music_Play(4, 14, -90, 1, -1, 1, 2); - Actor_Put_In_Set(59, 8); - Actor_Set_At_XYZ(59, -210.0f, 0.0f, -445.0f, 250); - Scene_Exit_Add_2D_Exit(0, 539, 51, 639, 309, 0); - Scene_Exit_Add_2D_Exit(1, 0, 456, 639, 479, 2); - Ambient_Sounds_Add_Looping_Sound(103, 50, 50, 0); - Ambient_Sounds_Add_Looping_Sound(329, 16, 16, 0); - Ambient_Sounds_Add_Looping_Sound(330, 40, 40, 0); - Ambient_Sounds_Add_Sound(182, 5, 70, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(184, 5, 70, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(185, 5, 70, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(186, 5, 70, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(188, 5, 70, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(189, 5, 70, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(191, 5, 70, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(192, 5, 70, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(195, 5, 70, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(252, 3, 60, 16, 16, -100, -100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(252, 3, 60, 16, 16, -100, -100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(254, 3, 60, 16, 16, -100, -100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(255, 3, 60, 16, 16, -100, -100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(256, 3, 60, 16, 16, -100, -100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(257, 3, 60, 16, 16, -100, -100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(258, 3, 60, 16, 16, -100, -100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(259, 3, 60, 16, 16, -100, -100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(260, 3, 60, 16, 16, -100, -100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(261, 3, 60, 16, 16, -100, -100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(262, 3, 60, 16, 16, -100, -100, -101, -101, 0, 0); - if (Game_Flag_Query(110)) { - Scene_Loop_Start_Special(0, 0, 0); - Scene_Loop_Set_Default(1); - Game_Flag_Reset(110); - } else { - Scene_Loop_Set_Default(1); - } -} - -void ScriptHC04::SceneLoaded() { - Obstacle_Object("CAN FIRE", true); - Unobstacle_Object("ASIANMALE01", true); - Clickable_Object("CAN FIRE"); -} - -bool ScriptHC04::MouseClick(int x, int y) { - return false; -} - -bool ScriptHC04::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptHC04::ClickedOnActor(int actorId) { - if (actorId == 59) { - if (!Loop_Actor_Walk_To_XYZ(0, -155.0f, 0.0f, -475.0f, 12, 1, false, 0)) { - Actor_Face_Actor(0, 59, true); - Actor_Face_Actor(59, 0, true); - if (Game_Flag_Query(106)) { - sub_401B90(); - return true; - } else { - Actor_Says(59, 0, 3); - Actor_Says(0, 1280, 3); - Actor_Says(59, 20, 3); - Game_Flag_Set(106); - return true; - } - } - } - return false; -} - -bool ScriptHC04::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptHC04::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -108.0f, 0.14f, -639.0f, 0, 1, false, 0)) { - Music_Stop(2); - Game_Flag_Set(107); - Game_Flag_Reset(479); - Game_Flag_Set(182); - Set_Enter(70, 80); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -72.0f, 0.14f, -399.0f, 0, 1, false, 0)) { - Game_Flag_Set(109); - Set_Enter(8, 32); - } - return true; - } - return false; -} - -bool ScriptHC04::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptHC04::SceneFrameAdvanced(int frame) { -} - -void ScriptHC04::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptHC04::PlayerWalkedIn() { -} - -void ScriptHC04::PlayerWalkedOut() { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); -} - -void ScriptHC04::DialogueQueueFlushed(int a1) { -} - -void ScriptHC04::sub_401B90() { - Dialogue_Menu_Clear_List(); - if (Actor_Clue_Query(0, 263) || Actor_Clue_Query(0, 53)) { - if (Actor_Clue_Query(0, 47)) { - DM_Add_To_List_Never_Repeat_Once_Selected(340, 5, 6, 5); - } else if (Actor_Clue_Query(0, 259)) { - DM_Add_To_List_Never_Repeat_Once_Selected(350, 5, 6, 5); - } - DM_Add_To_List_Never_Repeat_Once_Selected(360, 6, 4, 3); - } - if (Actor_Clue_Query(0, 87) && !Actor_Clue_Query(0, 101)) { - DM_Add_To_List_Never_Repeat_Once_Selected(370, 3, 4, 7); - } - if (Actor_Clue_Query(0, 101)) { - DM_Add_To_List_Never_Repeat_Once_Selected(380, -1, 5, 8); - } - DM_Add_To_List_Never_Repeat_Once_Selected(390, 7, 5, -1); - Dialogue_Menu_Add_DONE_To_List(400); - Dialogue_Menu_Appear(320, 240); - int answer = Dialogue_Menu_Query_Input(); - Dialogue_Menu_Disappear(); - switch (answer) { - case 340: - Actor_Says(0, 1285, 3); - Actor_Says(59, 50, 3); - Actor_Says(0, 1330, 3); - Actor_Says(59, 60, 3); - break; - case 350: - Actor_Says(0, 1290, 3); - Actor_Says(59, 70, 3); - Actor_Says(0, 1335, 3); - Actor_Says(59, 80, 3); - Actor_Says(0, 1340, 3); - Actor_Says(59, 90, 3); - Actor_Says(0, 1345, 3); - break; - case 360: - Actor_Says(0, 1295, 3); - Actor_Says(59, 100, 3); - Actor_Says(0, 1350, 3); - Actor_Says(59, 110, 3); - Actor_Says(0, 1355, 3); - Actor_Says(59, 130, 3); - Actor_Says(0, 1360, 3); - break; - case 370: - Actor_Says(0, 1300, 3); - Actor_Says(59, 140, 3); - Actor_Says(0, 1365, 3); - Actor_Says(59, 150, 3); - break; - case 380: - Actor_Says(0, 1305, 3); - Actor_Modify_Friendliness_To_Other(59, 0, -2); - Actor_Says(59, 160, 3); - Actor_Says(0, 1370, 3); - Actor_Says(59, 170, 3); - Actor_Says(0, 1375, 3); - Actor_Says(59, 180, 3); - Actor_Says(0, 1380, 3); - Actor_Says(59, 190, 3); - Actor_Says(59, 210, 3); - Actor_Says(59, 240, 3); - Actor_Says(0, 1385, 3); - Actor_Says(59, 260, 3); - Actor_Says(0, 1390, 3); - Actor_Says(59, 300, 3); - Actor_Says(59, 310, 3); - Actor_Says(59, 320, 3); - Actor_Says(0, 1395, 3); - Actor_Says(59, 330, 3); - Actor_Clue_Acquire(0, 102, 0, 59); - break; - case 390: - Actor_Says(0, 1310, 3); - Actor_Modify_Friendliness_To_Other(59, 0, 2); - Actor_Says(59, 340, 3); - break; - case 400: - Actor_Says(0, 1315, 3); - break; - default: - Actor_Says(0, 1320, 3); - Actor_Says(59, 30, 3); - Actor_Says(0, 1325, 3); - Actor_Says(0, 1345, 3); - break; - } -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/hf01.cpp b/engines/bladerunner/script/hf01.cpp deleted file mode 100644 index 509f472d74..0000000000 --- a/engines/bladerunner/script/hf01.cpp +++ /dev/null @@ -1,475 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptHF01::InitializeScene() { - if (Game_Flag_Query(617)) { - Setup_Scene_Information(243.94f, 8.0f, -341.9f, 342); - } else if (Game_Flag_Query(313)) { - Setup_Scene_Information(-202.0f, 0.0f, -619.0f, 407); - } else if (Game_Flag_Query(311)) { - Setup_Scene_Information(124.0f, 8.0f, -880.0f, 455); - } else if (Game_Flag_Query(309)) { - Setup_Scene_Information(406.0f, 8.0f, -813.0f, 455); - } else { - Setup_Scene_Information(100.0f, 0.0f, -260.0f, 0); - } - Scene_Exit_Add_2D_Exit(0, 81, 226, 169, 321, 0); - if (!Game_Flag_Query(663)) { - Scene_Exit_Add_2D_Exit(1, 304, 239, 492, 339, 0); - Scene_Exit_Add_2D_Exit(2, 560, 231, 639, 360, 0); - if (Game_Flag_Query(256)) { - Scene_Exit_Add_2D_Exit(3, 0, 311, 66, 417, 2); - } - } - Ambient_Sounds_Add_Looping_Sound(54, 50, 0, 1); - Ambient_Sounds_Add_Looping_Sound(340, 25, 0, 1); - Ambient_Sounds_Add_Looping_Sound(81, 60, 100, 1); - Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(184, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(185, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(186, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(188, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(189, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(192, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(68, 10, 180, 16, 25, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(69, 10, 180, 16, 25, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(375, 10, 180, 50, 100, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(376, 10, 180, 50, 100, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(377, 10, 180, 50, 100, 0, 0, -101, -101, 0, 0); - if (Game_Flag_Query(256)) { - if (!Game_Flag_Query(309) && !Game_Flag_Query(311) && !Game_Flag_Query(313)) { - Scene_Loop_Start_Special(0, 0, 0); - } - Scene_Loop_Set_Default(1); - } else if (Game_Flag_Query(663)) { - Scene_Loop_Set_Default(1); - } else { - Scene_Loop_Set_Default(5); - } -} - -void ScriptHF01::SceneLoaded() { - Obstacle_Object("LOFT41", true); - if (!Game_Flag_Query(256)) { - Unobstacle_Object("OBSTACLE BOX15", true); - } -} - -bool ScriptHF01::MouseClick(int x, int y) { - return false; -} - -bool ScriptHF01::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptHF01::ClickedOnActor(int actorId) { - int v1; - if (Global_Variable_Query(45) == 2) { - v1 = 3; - } else if (Global_Variable_Query(45) == 3) { - v1 = 6; - } else { - v1 = -1; - } - if (actorId == 22 || actorId == 31) { - if (!Loop_Actor_Walk_To_XYZ(0, 504.04f, 8.0f, -242.17f, 12, 1, false, 0)) { - ADQ_Flush(); - Actor_Face_Actor(0, 31, true); - if (Game_Flag_Query(382)) { - sub_4026B4(); - } else { - Actor_Says(0, 1455, 15); - Actor_Says(31, 40, 13); - Actor_Says(0, 1460, 13); - Actor_Says(31, 50, 12); - Item_Pickup_Spin_Effect(951, 396, 359); - Actor_Face_Heading(31, 271, false); - Actor_Says(31, 60, 12); - Actor_Says(0, 1465, 15); - Actor_Face_Actor(31, 0, true); - Actor_Says(31, 70, 13); - Actor_Says(0, 1470, 14); - Actor_Says(22, 30, 3); - Actor_Says(31, 80, 15); - Actor_Says(22, 50, 3); - Actor_Says(31, 110, 14); - Game_Flag_Set(382); - } - return true; - } - return false; - } - if (actorId == v1) { - if (!Loop_Actor_Walk_To_Actor(0, actorId, 28, 1, false)) { - if (Actor_Query_Goal_Number(v1) == 599) { - Actor_Says(0, 8630, 13); - return true; - } - if (Global_Variable_Query(1) == 5 && (Actor_Clue_Query(0, 139) || Actor_Clue_Query(0, 141)) && !Game_Flag_Query(165) && Actor_Query_Goal_Number(9) != 2 && Game_Flag_Query(653) && !Game_Flag_Query(662)) { - Game_Flag_Set(662); - Actor_Face_Actor(0, v1, true); - Actor_Face_Actor(v1, 0, true); - if (v1 == 3) { - sub_4032DC(); - } else if (v1 == 6) { - sub_403484(); - } - Async_Actor_Walk_To_XYZ(v1, -175.0f, 8.0f, -617.0f, 0, false); - Loop_Actor_Walk_To_XYZ(0, -137.0f, 8.0f, -577.0f, 0, 0, false, 1); - Game_Flag_Set(312); - Set_Enter(41, 38); - } - } - } - return false; -} - -bool ScriptHF01::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptHF01::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -202.0f, 8.0f, -619.0f, 0, 1, false, 0)) { - Game_Flag_Set(312); - Set_Enter(41, 38); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, 124.0f, 8.0f, -724.0f, 0, 1, false, 0)) { - Loop_Actor_Walk_To_XYZ(0, 124.0f, 8.0f, -880.0f, 0, 0, false, 0); - Game_Flag_Set(310); - Set_Enter(39, 36); - } - return true; - } - if (exitId == 2) { - if (!Loop_Actor_Walk_To_XYZ(0, 406.0f, 8.0f, -717.0f, 0, 1, false, 0)) { - Loop_Actor_Walk_To_XYZ(0, 406.0f, 8.0f, -813.0f, 0, 0, false, 0); - Game_Flag_Set(308); - Set_Enter(38, 35); - } - return true; - } - if (exitId == 3) { - if (!Loop_Actor_Walk_To_XYZ(0, 100.0f, 0.0f, -260.0f, 0, 1, false, 0)) { - Game_Flag_Reset(176); - Game_Flag_Reset(182); - Game_Flag_Reset(179); - Game_Flag_Reset(178); - Game_Flag_Reset(258); - Game_Flag_Reset(257); - int spinnerDest = Spinner_Interface_Choose_Dest(3, 0); - switch (spinnerDest) { - case 0: - Game_Flag_Set(178); - Game_Flag_Reset(256); - Game_Flag_Set(251); - Set_Enter(61, 65); - Scene_Loop_Start_Special(1, 4, 1); - break; - case 1: - Game_Flag_Set(179); - Game_Flag_Reset(256); - Game_Flag_Set(250); - Set_Enter(49, 48); - Scene_Loop_Start_Special(1, 4, 1); - break; - case 2: - Game_Flag_Set(182); - Game_Flag_Reset(256); - Game_Flag_Set(249); - Set_Enter(69, 78); - Scene_Loop_Start_Special(1, 4, 1); - break; - case 3: - Game_Flag_Set(176); - Game_Flag_Reset(256); - Game_Flag_Set(248); - Set_Enter(4, 13); - Scene_Loop_Start_Special(1, 4, 1); - break; - case 5: - Game_Flag_Set(261); - Game_Flag_Reset(256); - Game_Flag_Set(307); - Set_Enter(17, 82); - Scene_Loop_Start_Special(1, 4, 1); - break; - case 4: - Game_Flag_Set(180); - Game_Flag_Reset(256); - Game_Flag_Set(252); - Set_Enter(0, 0); - Scene_Loop_Start_Special(1, 4, 1); - break; - case 7: - Game_Flag_Set(258); - Game_Flag_Reset(256); - Game_Flag_Set(254); - Set_Enter(20, 2); - Scene_Loop_Start_Special(1, 4, 1); - break; - case 6: - Game_Flag_Set(177); - Game_Flag_Reset(256); - Game_Flag_Set(253); - Set_Enter(7, 25); - Scene_Loop_Start_Special(1, 4, 1); - break; - case 8: - Game_Flag_Set(181); - Game_Flag_Reset(256); - Game_Flag_Set(255); - Set_Enter(54, 54); - Scene_Loop_Start_Special(1, 4, 1); - break; - default: - Game_Flag_Set(257); - Loop_Actor_Walk_To_XYZ(0, 100.0f, 0.0f, -300.0f, 0, 1, false, 0); - break; - } - } - return true; - } - return false; -} - -bool ScriptHF01::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptHF01::SceneFrameAdvanced(int frame) { - if (frame == 10) { - Sound_Play(118, 40, 0, 0, 50); - } - if (frame == 72 || frame == 193) { - Sound_Play(116, 100, -50, -50, 50); - } - if (frame == 88 || frame == 214) { - Sound_Play(119, 100, -50, -50, 50); - } - if (frame == 242) { - Sound_Play(117, 40, -50, 80, 50); - } - if (Actor_Query_Goal_Number(31) == 1) { - Actor_Set_Goal_Number(31, 0); - } -} - -void ScriptHF01::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptHF01::PlayerWalkedIn() { - if (Game_Flag_Query(663)) { - ADQ_Flush(); - ADQ_Add(24, 280, 3); - Actor_Put_In_Set(23, 37); - Actor_Set_At_XYZ(23, 8.2f, 8.0f, -346.67f, 1021); - Actor_Put_In_Set(24, 37); - Actor_Set_At_XYZ(24, 51.21f, 8.0f, -540.78f, 796); - Non_Player_Actor_Combat_Mode_On(23, 3, 1, 0, 4, 4, 7, 8, 0, 0, 0, 100, 300, 0); - Non_Player_Actor_Combat_Mode_On(24, 3, 1, 0, 4, 4, 7, 8, 0, 0, 0, 100, 300, 0); - } - if (!Game_Flag_Query(165) && Actor_Query_Goal_Number(9) != 2) { - if (Actor_Clue_Query(0, 141) && Global_Variable_Query(45) == 3 && Actor_Query_Goal_Number(6) != 599) { - Actor_Put_In_Set(6, 37); - Actor_Set_At_XYZ(6, -5.0f, 8.0f, -622.0f, 419); - Actor_Set_Targetable(6, true); - } else if (Actor_Clue_Query(0, 139) && Global_Variable_Query(45) == 2 && Actor_Query_Goal_Number(3) != 599) { - Actor_Put_In_Set(3, 37); - Actor_Set_At_XYZ(3, -5.0f, 8.0f, -622.0f, 419); - Actor_Set_Targetable(3, true); - } - } - if (Game_Flag_Query(617)) { - Actor_Set_Goal_Number(1, 280); - Game_Flag_Reset(617); - //return true; - return; - } - if (Game_Flag_Query(652)) { - Game_Flag_Reset(652); - Actor_Voice_Over(950, 99); - Actor_Voice_Over(960, 99); - Actor_Voice_Over(970, 99); - Actor_Voice_Over(980, 99); - } else if (!Game_Flag_Query(377) && Global_Variable_Query(1) < 4) { - ADQ_Flush(); - ADQ_Add(31, 0, 14); - ADQ_Add(31, 10, 3); - ADQ_Add(22, 0, 3); - Actor_Face_Actor(31, 22, true); - ADQ_Add(31, 20, 13); - ADQ_Add(22, 10, 3); - ADQ_Add(31, 30, 3); - ADQ_Add(22, 20, 3); - Actor_Face_Heading(31, 271, false); - Game_Flag_Set(377); - } - if (Game_Flag_Query(311)) { - Loop_Actor_Walk_To_XYZ(0, 124.0f, 8.0f, -724.0f, 0, 1, false, 0); - } else if (Game_Flag_Query(309)) { - Loop_Actor_Walk_To_XYZ(0, 406.0f, 8.0f, -717.0f, 0, 1, false, 0); - } else if (!Game_Flag_Query(313)) { - Loop_Actor_Walk_To_XYZ(0, 100.0f, 0.0f, -300.0f, 0, 1, false, 0); - } - Game_Flag_Reset(311); - Game_Flag_Reset(309); - Game_Flag_Reset(313); - //return false; -} - -void ScriptHF01::PlayerWalkedOut() { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - if (!Game_Flag_Query(312) && !Game_Flag_Query(308) && !Game_Flag_Query(310) && !Game_Flag_Query(722)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Outtake_Play(35, 1, -1); - Outtake_Play(38, 1, -1); - } - Game_Flag_Reset(722); - if (Actor_Query_Goal_Number(6) == 450) { - Actor_Put_In_Set(6, 97); - Actor_Set_At_Waypoint(6, 39, 0); - Actor_Set_Goal_Number(6, 599); - } - if (Actor_Query_Goal_Number(3) == 450) { - Actor_Put_In_Set(3, 97); - Actor_Set_At_Waypoint(3, 39, 0); - Actor_Set_Goal_Number(3, 599); - } -} - -void ScriptHF01::DialogueQueueFlushed(int a1) { -} - -void ScriptHF01::sub_4026B4() { - Dialogue_Menu_Clear_List(); - if (Actor_Clue_Query(0, 13) == 1) { - DM_Add_To_List_Never_Repeat_Once_Selected(440, 8, 6, 3); - } - if (!Actor_Clue_Query(0, 13) && Actor_Clue_Query(0, 22) == 1) { - DM_Add_To_List_Never_Repeat_Once_Selected(450, 7, 6, 3); - } - if (Actor_Clue_Query(0, 87) == 1) { - DM_Add_To_List_Never_Repeat_Once_Selected(460, 3, 5, 6); - } - if (Actor_Clue_Query(0, 118) == 1) { - DM_Add_To_List_Never_Repeat_Once_Selected(470, -1, 3, 8); - } - Dialogue_Menu_Add_DONE_To_List(480); - Dialogue_Menu_Appear(320, 240); - int answer = Dialogue_Menu_Query_Input(); - Dialogue_Menu_Disappear(); - switch (answer) { - case 440: - Actor_Says(0, 1480, 15); - Actor_Says(22, 70, 3); - Actor_Says(31, 120, 3); - Actor_Says(0, 1505, 14); - Actor_Says(22, 80, 3); - Actor_Says(31, 130, 3); - Actor_Says(22, 90, 3); - Actor_Says(0, 1510, 12); - break; - case 450: - Actor_Says(0, 1485, 16); - Actor_Says(22, 100, 3); - Actor_Says(31, 140, 12); - Actor_Says(22, 110, 3); - Actor_Says(22, 120, 3); - Actor_Says(31, 150, 14); - break; - case 460: - Actor_Says(0, 1490, 13); - Actor_Says(31, 160, 15); - Actor_Says(22, 130, 13); - Actor_Says(31, 170, 12); - Actor_Says(31, 180, 13); - Actor_Says(31, 190, 14); - Actor_Says(0, 1515, 15); - Actor_Says(31, 200, 3); - Actor_Says(0, 1520, 15); - Actor_Says(31, 210, 13); - Actor_Says(31, 220, 13); - Actor_Says(22, 140, 12); - Actor_Says(31, 230, 13); - Actor_Clue_Acquire(0, 101, 0, 31); - break; - case 470: - Actor_Says(0, 1495, 14); - Actor_Face_Actor(31, 0, true); - Actor_Says(31, 240, 13); - Actor_Face_Actor(31, 22, true); - break; - case 480: - Actor_Says(0, 1500, 16); - break; - } -} - -void ScriptHF01::sub_4032DC() { - Actor_Says(3, 0, 3); - Actor_Says(0, 1400, 3); - Actor_Says(3, 10, 3); - Actor_Says(0, 1405, 3); - Actor_Says(3, 20, 3); - Actor_Says(0, 1410, 3); - Actor_Says(3, 30, 3); - Actor_Says(0, 1415, 3); - Actor_Says(3, 40, 3); - Actor_Says(3, 50, 3); - Actor_Says(3, 60, 3); - Actor_Says(3, 70, 3); - Actor_Says(0, 1420, 3); - Actor_Says(3, 80, 3); -} - -void ScriptHF01::sub_403484() { - Actor_Says(6, 0, 3); - Actor_Says(0, 1425, 3); - Actor_Says(6, 10, 3); - Actor_Says(6, 20, 3); - Actor_Says(0, 1430, 3); - Actor_Says(6, 30, 3); - Actor_Says(0, 1435, 3); - Actor_Says(6, 40, 3); - Actor_Says(6, 50, 3); - Actor_Says(0, 1440, 3); - Actor_Says(6, 60, 3); - Actor_Says(6, 70, 3); - Actor_Says(0, 1445, 3); - Actor_Says(6, 80, 3); - Actor_Says(6, 3030, 3); -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/hf02.cpp b/engines/bladerunner/script/hf02.cpp deleted file mode 100644 index 575e3f8604..0000000000 --- a/engines/bladerunner/script/hf02.cpp +++ /dev/null @@ -1,144 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptHF02::InitializeScene() { - if (Game_Flag_Query(567)) { - Setup_Scene_Information(874.0f, 47.76f, -252.0f, 775); - Game_Flag_Reset(567); - } else if (Game_Flag_Query(528)) { - Setup_Scene_Information(470.0f, 47.76f, -500.0f, 560); - } else { - Setup_Scene_Information(-18.0f, 47.76f, -288.0f, 275); - } - Scene_Exit_Add_2D_Exit(0, 0, 0, 30, 479, 3); - Scene_Exit_Add_2D_Exit(1, 207, 66, 272, 207, 3); - Ambient_Sounds_Add_Looping_Sound(340, 28, -100, 1); - Ambient_Sounds_Add_Looping_Sound(341, 33, 0, 1); - Ambient_Sounds_Add_Sound(181, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(183, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(184, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(185, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(186, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(188, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(189, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(190, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(192, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(193, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(194, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); -} - -void ScriptHF02::SceneLoaded() { - Obstacle_Object("BARD_NEON", true); - Unclickable_Object("BARD_NEON"); - if (Actor_Query_Goal_Number(1) == 234) { - if (Game_Flag_Query(593)) { - Actor_Set_Goal_Number(1, 243); - } else { - Actor_Set_Goal_Number(1, 240); - } - } -} - -bool ScriptHF02::MouseClick(int x, int y) { - return false; -} - -bool ScriptHF02::ClickedOn3DObject(const char *objectName, bool a2) { - Sound_Play(342, 47, -80, 0, 50); - return false; -} - -bool ScriptHF02::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptHF02::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptHF02::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, 42.0f, 47.76f, -296.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(309); - Set_Enter(37, 34); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, 470.0f, 47.76f, -444.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(527); - Set_Enter(39, 36); - } - return true; - } - return false; -} - -bool ScriptHF02::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptHF02::SceneFrameAdvanced(int frame) { - -} - -void ScriptHF02::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptHF02::PlayerWalkedIn() { - if (Actor_Query_Goal_Number(1) == 240) { - Actor_Set_Goal_Number(1, 241); - } - if (Game_Flag_Query(528)) { - Loop_Actor_Walk_To_XYZ(0, 470.0f, 47.76f, -444.0f, 0, 0, false, 0); - Game_Flag_Reset(528); - } else if (Game_Flag_Query(308)) { - Loop_Actor_Walk_To_XYZ(0, 42.0f, 47.76f, -296.0f, 0, 0, false, 0); - Game_Flag_Reset(308); - } - if (Actor_Query_Goal_Number(1) == 243) { - if (Actor_Query_Goal_Number(6) == 599) { - Actor_Set_Goal_Number(1, 244); - } else { - Actor_Set_Goal_Number(1, 245); - } - } -} - -void ScriptHF02::PlayerWalkedOut() { -} - -void ScriptHF02::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/hf03.cpp b/engines/bladerunner/script/hf03.cpp deleted file mode 100644 index f146b08752..0000000000 --- a/engines/bladerunner/script/hf03.cpp +++ /dev/null @@ -1,254 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptHF03::InitializeScene() { - if (Game_Flag_Query(527)) { - Setup_Scene_Information(479.0f, 47.76f, -496.0f, 600); - } else { - Setup_Scene_Information(185.62f, 47.76f, -867.42f, 300); - } - Scene_Exit_Add_2D_Exit(0, 0, 0, 30, 479, 3); - Scene_Exit_Add_2D_Exit(1, 589, 0, 639, 479, 1); - Scene_Exit_Add_2D_Exit(2, 323, 110, 380, 166, 0); - Ambient_Sounds_Add_Looping_Sound(340, 50, 0, 1); - Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(184, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(185, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(186, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(188, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(189, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(192, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); -} - -void ScriptHF03::SceneLoaded() { - Obstacle_Object("MAIN", true); - Unclickable_Object("MAIN"); -} - -bool ScriptHF03::MouseClick(int x, int y) { - return false; -} - -bool ScriptHF03::ClickedOn3DObject(const char *objectName, bool a2) { - if (Object_Query_Click(objectName, "MAIN")) { - Actor_Says(0, Random_Query(0, 3) + 8525, 18); - } - return false; -} - -void ScriptHF03::sub_401C80() { - Dialogue_Menu_Clear_List(); - DM_Add_To_List_Never_Repeat_Once_Selected(840, -1, 3, 8); - DM_Add_To_List_Never_Repeat_Once_Selected(850, 6, 5, 2); - DM_Add_To_List_Never_Repeat_Once_Selected(860, 8, -1, -1); - DM_Add_To_List_Never_Repeat_Once_Selected(870, 2, 8, 6); - Dialogue_Menu_Add_DONE_To_List(880); - Dialogue_Menu_Appear(320, 240); - int answer = Dialogue_Menu_Query_Input(); - Dialogue_Menu_Disappear(); - switch (answer) { - case 840: - Actor_Says(0, 1630, 15); - if (Global_Variable_Query(40) == 3) { - Actor_Set_Goal_Number(6, 214); - } else if (Game_Flag_Query(46)) { - Actor_Set_Goal_Number(6, 212); - } else { - Actor_Set_Goal_Number(6, 210); - Game_Flag_Set(593); - } - break; - case 850: - Actor_Says(0, 1635, 15); - Actor_Says(6, 200, 13); - Actor_Modify_Friendliness_To_Other(6, 0, 3); - break; - case 860: - Actor_Says(0, 1640, 12); - if (Global_Variable_Query(40) == 3) { - Actor_Set_Goal_Number(6, 214); - } else { - Actor_Says(6, 210, 13); - Actor_Says(0, 1655, 15); - Actor_Modify_Friendliness_To_Other(6, 0, Random_Query(9, 10)); - if (Actor_Query_Friendliness_To_Other(6, 0) > 59 && !Global_Variable_Query(45)) { - Global_Variable_Set(45, 3); - Actor_Says(6, 940, 14); - Actor_Says(0, 6780, 11); - Actor_Says(6, 950, 12); - Actor_Says(6, 960, 13); - Actor_Says(0, 6785, 15); - Actor_Says(6, 970, 16); - Actor_Says(6, 980, 17); - if (Game_Flag_Query(47)) { - Actor_Says(6, 990, 17); - } - Actor_Says(0, 6790, 15); - Actor_Says(6, 1000, 13); - Actor_Says(6, 1010, 17); - Actor_Says(6, 1020, 18); - Actor_Says(0, 6795, 14); - Actor_Says(6, 1030, 17); - Actor_Says(0, 6800, 14); - } - Actor_Says(6, 220, 13); - Actor_Says(0, 1660, 15); - Actor_Says(6, 230, 14); - Actor_Clue_Acquire(6, 219, 1, 0); - if (Game_Flag_Query(46)) { - Actor_Set_Goal_Number(6, 212); - } else { - Actor_Set_Goal_Number(6, 210); - } - } - break; - case 870: - Actor_Says(0, 1645, 18); - Actor_Says(6, 240, 14); - Actor_Says(6, 250, 12); - Actor_Says(6, 260, 13); - Actor_Says(6, 270, 19); - Actor_Says(0, 1665, 18); - Actor_Says(6, 280, 13); - Actor_Says(0, 1670, 12); - Actor_Says(6, 290, 14); - Actor_Says(6, 300, 16); - Actor_Says(0, 1675, 12); - Actor_Says(6, 310, 13); - Actor_Clue_Acquire(0, 273, 0, 6); - break; - case 880: - Actor_Says(0, 1650, 14); - break; - } -} - -bool ScriptHF03::ClickedOnActor(int actorId) { - if (actorId == 6 && Actor_Query_Goal_Number(6) == 205) { - if (Game_Flag_Query(46) ? !Loop_Actor_Walk_To_Waypoint(0, 377, 0, 1, false) : !Loop_Actor_Walk_To_Waypoint(0, 378, 0, 1, false)) { - Actor_Face_Actor(0, 6, true); - if (!Game_Flag_Query(613)) { - Game_Flag_Set(613); - if (Game_Flag_Query(46)) { - Actor_Says(0, 1605, 15); - Actor_Says(6, 100, 12); - Actor_Says(0, 1610, 14); - } else { - Actor_Says(0, 1615, 16); - Actor_Says(6, 110, 13); - } - Actor_Says(6, 120, 13); - Actor_Says(0, 1620, 14); - Actor_Says(6, 130, 17); - Actor_Says(0, 1625, 15); - if (Game_Flag_Query(46)) { - Actor_Says(6, 140, 12); - Actor_Says(6, 150, 13); - Actor_Says(6, 160, 15); - } else { - Actor_Says(6, 170, 12); - Actor_Says(6, 180, 13); - Actor_Says(6, 190, 15); - } - } - sub_401C80(); - } - } - return false; -} - -bool ScriptHF03::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptHF03::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, 179.0f, 46.76f, -824.0f, 0, 1, false, 0)) { - Game_Flag_Set(311); - Set_Enter(37, 34); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, 479.0f, 47.76f, -524.0f, 0, 1, false, 0)) { - Game_Flag_Set(528); - Set_Enter(38, 35); - } - return true; - } - if (exitId == 2) { - if (!Loop_Actor_Walk_To_XYZ(0, 942.0f, 47.76f, -847.0f, 0, 1, false, 0)) { - Game_Flag_Set(566); - Set_Enter(40, 37); - } - return true; - } - return false; -} - -bool ScriptHF03::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptHF03::SceneFrameAdvanced(int frame) { -} - -void ScriptHF03::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptHF03::PlayerWalkedIn() { - if (Game_Flag_Query(527)) { - Loop_Actor_Walk_To_XYZ(0, 479.0f, 47.76f, -524.0f, 0, 0, false, 0); - Game_Flag_Reset(527); - } else { - Loop_Actor_Walk_To_XYZ(0, 179.0f, 47.76f, -824.0f, 0, 0, false, 0); - Game_Flag_Reset(310); - } - if (Actor_Query_Goal_Number(6) == 250) { - Actor_Set_Goal_Number(6, 212); - Actor_Says(1, 210, 13); - Actor_Face_Actor(0, 1, true); - Actor_Says(0, 1680, 15); - Actor_Says(1, 220, 14); - Actor_Says(0, 1685, 13); - Actor_Says(1, 230, 16); - Actor_Says(0, 1690, 12); - Actor_Says(1, 240, 13); - Actor_Set_Goal_Number(1, 234); - } -} - -void ScriptHF03::PlayerWalkedOut() { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); -} - -void ScriptHF03::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/hf04.cpp b/engines/bladerunner/script/hf04.cpp deleted file mode 100644 index afeda9fdc3..0000000000 --- a/engines/bladerunner/script/hf04.cpp +++ /dev/null @@ -1,167 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptHF04::InitializeScene() { - Setup_Scene_Information(-33.85f, -0.31f, 395.0f, 0); - Game_Flag_Reset(566); - Scene_Exit_Add_2D_Exit(0, 602, 104, 639, 177, 1); - Ambient_Sounds_Add_Looping_Sound(70, 35, 0, 1); - Ambient_Sounds_Add_Looping_Sound(109, 40, 0, 1); - Ambient_Sounds_Add_Sound(72, 6, 70, 14, 20, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(73, 3, 70, 14, 20, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(74, 5, 70, 14, 20, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(303, 5, 70, 33, 50, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(304, 5, 70, 33, 50, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(305, 5, 70, 33, 50, -100, 100, -101, -101, 0, 0); - if (Game_Flag_Query(584)) { - Scene_Loop_Set_Default(3); - } else { - Scene_Loop_Set_Default(0); - } -} - -void ScriptHF04::SceneLoaded() { - if (Game_Flag_Query(584)) { - Unobstacle_Object("PIVOT_WALL#1", true); - Unobstacle_Object("PIVOT_WALL#02", true); - Unobstacle_Object("PIVOT_WALL#03", true); - } else { - Unobstacle_Object("HIDE_WALL_A", true); - Unobstacle_Object("HIDE_WALL_B", true); - } - if (Actor_Query_Goal_Number(6) == 213) { - if (Actor_Clue_Query(6, 219) && Global_Variable_Query(40) != 3) { - Game_Flag_Set(593); - } else { - Actor_Set_Goal_Number(6, 230); - Game_Flag_Reset(584); - } - } -} - -bool ScriptHF04::MouseClick(int x, int y) { - return false; -} - -bool ScriptHF04::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptHF04::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptHF04::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptHF04::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, 1132.27f, -0.31f, -113.46f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(567); - Set_Enter(38, 35); - } - return true; - } - return false; -} - -bool ScriptHF04::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptHF04::SceneFrameAdvanced(int frame) { - if (frame == 62) { - Sound_Play(359, Random_Query(43, 43), 0, 0, 50); - } - if (frame == 154) { - Sound_Play(360, Random_Query(43, 43), 0, 0, 50); - } - if (frame == 179 && Actor_Query_Goal_Number(6) == 235) { - Actor_Set_Goal_Number(6, 236); - } - if (Game_Flag_Query(585)) { - Game_Flag_Reset(585); - Scene_Loop_Set_Default(3); - Scene_Loop_Start_Special(2, 2, 1); - //return true; - return; - } - if (Game_Flag_Query(586)) { - Game_Flag_Reset(586); - Scene_Loop_Set_Default(0); - Scene_Loop_Start_Special(2, 5, 1); - //return true; - return; - } - if (frame == 89) { - Game_Flag_Set(584); - Obstacle_Object("HIDE_WALL_A", false); - Obstacle_Object("HIDE_WALL_B", false); - Unobstacle_Object("PIVOT_WALL#1", false); - Unobstacle_Object("PIVOT_WALL#02", false); - Unobstacle_Object("PIVOT_WALL#03", true); - //return true; - return; - } - if (frame == 180) { - Unobstacle_Object("HIDE_WALL_A", false); - Unobstacle_Object("HIDE_WALL_B", false); - Obstacle_Object("PIVOT_WALL#1", false); - Obstacle_Object("PIVOT_WALL#02", false); - Obstacle_Object("PIVOT_WALL#03", true); - Game_Flag_Reset(584); - if (Actor_Query_Goal_Number(6) == 234) { - Actor_Set_Goal_Number(6, 235); - } - //return true; - return; - } - //return false; -} - -void ScriptHF04::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptHF04::PlayerWalkedIn() { - if (Actor_Query_Goal_Number(6) == 230 || Actor_Query_Goal_Number(6) == 233) { - Player_Set_Combat_Mode(true); - Music_Play(1, 60, 0, 2, -1, 0, 0); - } - Loop_Actor_Walk_To_XYZ(0, -45.0f, -0.31f, 307.0f, 0, 0, true, 0); - Delay(2500); -} - -void ScriptHF04::PlayerWalkedOut() { - Music_Stop(5); -} - -void ScriptHF04::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/hf05.cpp b/engines/bladerunner/script/hf05.cpp deleted file mode 100644 index f569f48b7d..0000000000 --- a/engines/bladerunner/script/hf05.cpp +++ /dev/null @@ -1,673 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptHF05::InitializeScene() { - if (Game_Flag_Query(530)) { - Setup_Scene_Information(257.0f, 40.63f, 402.0f, 1000); - } else if (Game_Flag_Query(358)) { - Setup_Scene_Information(330.0f, 40.63f, -107.0f, 603); - } else { - Setup_Scene_Information(483.0f, 40.63f, -189.0f, 600); - } - Scene_Exit_Add_2D_Exit(0, 443, 270, 515, 350, 0); - if (Global_Variable_Query(1) > 3) { - Scene_Exit_Add_2D_Exit(1, 367, 298, 399, 349, 2); - } - Scene_Exit_Add_2D_Exit(2, 589, 0, 639, 479, 1); - Ambient_Sounds_Add_Looping_Sound(103, 40, 1, 1); - if (Game_Flag_Query(369)) { - Scene_Loop_Set_Default(5); - sub_404474(); - } else if (Game_Flag_Query(559)) { - Scene_Loop_Set_Default(2); - sub_404474(); - } else { - Scene_Loop_Set_Default(0); - } -} - -void ScriptHF05::SceneLoaded() { - Obstacle_Object("MAINBASE", true); - Unobstacle_Object("BTIRES02", true); - Unobstacle_Object("LFTIRE02", true); - if (Game_Flag_Query(369)) { - Unobstacle_Object("MONTE CARLO DRY", true); - } else { - Unobstacle_Object("OBSTACLE_HOLE", true); - } - Clickable_Object("TOP CON"); -} - -bool ScriptHF05::MouseClick(int x, int y) { - return false; -} - -bool ScriptHF05::ClickedOn3DObject(const char *objectName, bool a2) { - if (Object_Query_Click("TOP CON", objectName) == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, 95.0f, 40.63f, 308.0f, 0, 1, false, 0)) { - Actor_Face_Object(0, "TOP CON", true); - if (Actor_Query_In_Set(9, 41) && Actor_Query_Goal_Number(9) != 1 && Actor_Query_Goal_Number(9) != 2) { - Actor_Face_Actor(9, 0, true); - Actor_Says(9, 480, 13); - } else if (!Game_Flag_Query(662) || Game_Flag_Query(369)) { - Actor_Change_Animation_Mode(0, 23); - Sound_Play(412, 100, 0, 0, 50); - } else { - Player_Loses_Control(); - Actor_Set_Goal_Number(23, 425); - Game_Flag_Set(369); - Game_Flag_Set(368); - Obstacle_Object("OBSTACLE_HOLE", true); - Unobstacle_Object("MONTE CARLO DRY", true); - if (sub_4048C0()) { - Loop_Actor_Walk_To_XYZ(sub_4048C0(), 181.54f, 40.63f, 388.09f, 0, 0, true, 0); - Actor_Face_Actor(0, sub_4048C0(), true); - Actor_Face_Actor(sub_4048C0(), 0, true); - Actor_Says(0, 1785, 3); - Actor_Says(0, 1790, 3); - } - Actor_Face_Heading(0, 0, false); - Actor_Change_Animation_Mode(0, 23); - Scene_Loop_Set_Default(5); - Scene_Loop_Start_Special(2, 4, 1); - if (sub_4048C0()) { - if (sub_4048C0() == 3) { - Actor_Face_Heading(3, 0, false); - Ambient_Sounds_Play_Sound(147, 50, 99, 0, 0); - Delay(3000); - Actor_Face_Heading(3, 0, false); - Actor_Change_Animation_Mode(3, 23); - } else { - Actor_Face_Heading(6, 0, false); - Ambient_Sounds_Play_Sound(147, 50, 99, 0, 0); - Delay(3000); - Actor_Face_Heading(6, 0, false); - Actor_Change_Animation_Mode(6, 13); - } - Actor_Face_Actor(0, sub_4048C0(), true); - Actor_Says(0, 1805, 3); - } else { - ADQ_Flush(); - ADQ_Add(99, 940, -1); - Ambient_Sounds_Play_Sound(147, 50, 99, 0, 0); - Delay(1500); - Loop_Actor_Walk_To_XYZ(0, 181.53999f, 40.630001f, 388.09f, 0, 0, true, 0); - Actor_Face_Heading(0, 0, false); - Actor_Change_Animation_Mode(0, 23); - Actor_Clue_Lose(0, 146); - } - Player_Gains_Control(); - } - } - return true; - } - return false; -} - -bool ScriptHF05::ClickedOnActor(int actorId) { - if (actorId == 9) { - if (!Loop_Actor_Walk_To_Actor(0, 9, 60, 1, false)) { - Actor_Face_Actor(0, 9, true); - Actor_Face_Actor(9, 0, true); - sub_402AE4(); - } - } - return false; -} - -bool ScriptHF05::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptHF05::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, 483.0f, 40.63f, -189.0f, 0, 1, false, 0) && !Game_Flag_Query(684)) { - Game_Flag_Set(313); - Set_Enter(37, 34); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, 330.0f, 40.63f, -85.0f, 0, 1, false, 0) && !Game_Flag_Query(684)) { - int v2 = sub_404858(); - if (Game_Flag_Query(663) && Game_Flag_Query(368) && v2 != -1) { - Actor_Face_Actor(0, v2, true); - Actor_Says(0, 1810, 16); - } - Game_Flag_Set(359); - Set_Enter(43, 40); - } - return true; - } - if (exitId == 2) { - if (!Loop_Actor_Walk_To_XYZ(0, 277.0f, 40.631f, 410.0f, 0, 1, false, 0) && !Game_Flag_Query(684)) { - Game_Flag_Set(529); - Set_Enter(42, 39); - } - return true; - } - return false; -} - -bool ScriptHF05::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptHF05::SceneFrameAdvanced(int frame) { - switch (frame) { - case 126: - Sound_Play(352, 90, -20, 70, 50); - break; - case 152: - Sound_Play(346, 90, 0, 0, 50); - break; - case 156: - Sound_Play(348, 47, 100, 100, 50); - break; - case 161: - Sound_Play(345, 90, 0, 0, 50); - break; - case 176: - Sound_Play(350, 32, 100, 100, 50); - break; - case 178: - Sound_Play(355, 47, 100, 100, 50); - break; - case 179: - Sound_Play(490, 90, 0, 0, 50); - Music_Play(1, 50, 0, 2, -1, 0, 0); - break; - case 186: - Sound_Play(343, 32, 100, 100, 50); - break; - case 209: - Sound_Play(353, 90, 100, -20, 50); - break; - case 243: - Sound_Play(349, 40, -20, -20, 50); - break; - case 261: - Sound_Play(344, 47, -20, -20, 50); - break; - case 268: - Sound_Play(351, 58, -20, -20, 50); - break; - case 269: - Sound_Play(354, 43, -20, -20, 50); - break; - } - //return true; -} - -void ScriptHF05::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { - if (actorId == 23 && newGoal == 430) { - Game_Flag_Set(684); - sub_4042E4(); - } - //return false; -} - -void ScriptHF05::PlayerWalkedIn() { - if (Game_Flag_Query(662)) { - int v0 = sub_404858(); - if (Game_Flag_Query(662) && v0 != -1) { - Actor_Put_In_Set(v0, 41); - Actor_Force_Stop_Walking(v0); - if (Game_Flag_Query(312)) { - Actor_Set_At_XYZ(v0, 506.81f, 40.63f, -140.92f, 0); - Async_Actor_Walk_To_Waypoint(v0, 437, 36, 0); - } else if (Game_Flag_Query(530)) { - Actor_Set_At_XYZ(v0, 288.0f, 40.63f, 410.0f, 909); - } else if (Game_Flag_Query(358)) { - Actor_Set_At_XYZ(v0, 298.0f, 40.63f, -107.0f, 512); - } else { - Actor_Set_At_XYZ(v0, 284.0f, 40.63f, 286.0f, 0); - } - } - if (Game_Flag_Query(684)) { - sub_4042E4(); - } else if (Actor_Clue_Query(0, 265) || Game_Flag_Query(559)) { - if (Game_Flag_Query(559) && !Game_Flag_Query(663)) { - Game_Flag_Set(663); - Music_Play(1, 40, 0, 2, -1, 0, 0); - Actor_Says(24, 200, 3); - Actor_Says(24, 210, 3); - Actor_Set_Goal_Number(23, 420); - if (sub_4048C0() == 3) { - sub_403F0C(); - } else if (sub_4048C0() == 6) { - sub_40410C(); - } - } - } else { - sub_403A34(v0); - } - } else if (Game_Flag_Query(312) == 1) { - Loop_Actor_Walk_To_XYZ(0, 399.0f, 40.63f, -85.0f, 0, 0, false, 0); - } else if (Game_Flag_Query(358)) { - Actor_Set_At_XYZ(0, 346.0f, 4.63f, -151.0f, 603); - Loop_Actor_Travel_Stairs(0, 4, 1, 0); - } - if (Actor_Query_In_Set(9, 41)) { - if (Game_Flag_Query(562)) { - if (!Game_Flag_Query(563) && Global_Variable_Query(1) == 3) { - sub_402970(); - Game_Flag_Set(563); - } - } else { - sub_402370(); - Game_Flag_Set(562); - } - } - Game_Flag_Reset(312); - Game_Flag_Reset(530); - Game_Flag_Reset(358); - - //return false; -} - -void ScriptHF05::PlayerWalkedOut() { - if (Actor_Query_Goal_Number(9) == 210) { - Actor_Set_Goal_Number(9, 2); - } - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); -} - -void ScriptHF05::DialogueQueueFlushed(int a1) { -} - -void ScriptHF05::sub_402970() { - Loop_Actor_Walk_To_Actor(9, 0, 72, 0, false); - Actor_Face_Actor(9, 0, true); - Actor_Face_Actor(0, 9, true); - Actor_Says(9, 370, 3); - Actor_Says(0, 1855, 3); - Actor_Says(9, 380, 12); - Actor_Says(9, 390, 14); - Actor_Says(9, 400, 15); - Actor_Says(9, 410, 16); - Actor_Says(0, 1860, 3); - Actor_Says(9, 420, 3); - Actor_Says(0, 1865, 3); -} - -void ScriptHF05::sub_402AE4() { - Dialogue_Menu_Clear_List(); - if (Actor_Clue_Query(0, 99) == 1 && Global_Variable_Query(1) == 3) { - DM_Add_To_List_Never_Repeat_Once_Selected(1180, 3, 6, 7); - } - if (Actor_Clue_Query(0, 116) == 1) { - DM_Add_To_List_Never_Repeat_Once_Selected(1190, 2, 7, 4); - } - if (Actor_Clue_Query(0, 88) == 1) { - DM_Add_To_List_Never_Repeat_Once_Selected(1200, 5, 5, 3); - } - if (Actor_Clue_Query(0, 13) == 1 && Actor_Query_Goal_Number(6) != 599) { - DM_Add_To_List_Never_Repeat_Once_Selected(1210, 4, 6, 2); - } - if (Actor_Clue_Query(0, 237) == 1 || (Actor_Clue_Query(0, 99) == 1 && Global_Variable_Query(1) == 3)) { - DM_Add_To_List_Never_Repeat_Once_Selected(1220, -1, 2, 8); - } - if (Actor_Clue_Query(0, 113) == 1 || Actor_Clue_Query(0, 115) == 1) { - DM_Add_To_List_Never_Repeat_Once_Selected(1230, 4, 7, -1); - } - if (!Dialogue_Menu_Query_List_Size()) { - Actor_Says(0, 1880, 15); - Actor_Says(9, 490, 3); - Actor_Says(0, 1885, 3); - Actor_Says(9, 500, 16); - return; - } - Dialogue_Menu_Add_DONE_To_List(1240); - Dialogue_Menu_Appear(320, 240); - int answer = Dialogue_Menu_Query_Input(); - Dialogue_Menu_Disappear(); - switch (answer) { - case 1180: - Actor_Says(0, 1890, 23); - Actor_Says(9, 510, 3); - Actor_Says(0, 1920, 23); - Actor_Says(0, 1925, 3); - Actor_Says(9, 530, 12); - Actor_Says(0, 1930, 18); - Actor_Says(9, 540, 14); - Actor_Says(0, 1935, 14); - Actor_Says(9, 550, 16); - Actor_Says(0, 1940, 15); - Actor_Says(0, 1945, -1); - Actor_Says(9, 560, 15); - Actor_Says(9, 570, 16); - Actor_Says(0, 1950, 17); - sub_403738(); - break; - case 1190: - Actor_Says(0, 1895, 0); - Actor_Says(9, 620, 3); - Actor_Says(9, 630, 12); - Actor_Says(0, 2000, 13); - Actor_Says(9, 640, 14); - Actor_Says(9, 650, 15); - Actor_Says(9, 660, 16); - Actor_Says(0, 2005, 0); - Actor_Says(0, 2010, 3); - Actor_Says(9, 670, 3); - Actor_Says(9, 680, 12); - Actor_Says(9, 690, 14); - Actor_Says(0, 2015, 14); - Actor_Says(9, 700, 15); - Actor_Says(0, 2020, 18); - break; - case 1200: - Actor_Says(0, 1900, 23); - Actor_Says(9, 710, 16); - Actor_Says(0, 2025, 0); - Actor_Says(9, 720, 3); - Actor_Says(9, 730, 12); - break; - case 1210: - Actor_Says(0, 1905, 23); - Actor_Says(9, 740, 14); - Actor_Says(0, 2030, 13); - Actor_Says(9, 750, 15); - Actor_Says(0, 2035, 18); - Actor_Says(9, 760, 16); - Actor_Says(9, 770, 3); - Actor_Says(0, 2040, 0); - break; - case 1220: - Actor_Says(0, 1910, 3); - Actor_Says(9, 780, 12); - Actor_Says(0, 2045, 17); - Actor_Says(0, 2050, 3); - Actor_Says(9, 790, 14); - Actor_Says(0, 2055, 19); - Actor_Says(0, 2060, -1); - Actor_Says(9, 800, 15); - Actor_Says(0, 2065, 18); - Actor_Says(0, 2070, 14); - Actor_Says(9, 810, 16); - sub_403738(); - break; - case 1230: - Actor_Says(0, 1915, 12); - if (Actor_Clue_Query(0, 113)) { - Actor_Says(9, 820, 3); - Actor_Says(0, 2075, 13); - Actor_Says(9, 830, 12); - Actor_Says(9, 840, 14); - Actor_Says(9, 850, 15); - Actor_Says(0, 2080, 3); - Actor_Says(9, 860, 16); - Actor_Says(9, 870, 3); - } else if (Actor_Clue_Query(0, 115)) { - Actor_Says(9, 880, 12); - Actor_Says(9, 890, 14); - Actor_Says(0, 2085, 3); - Actor_Says(9, 900, 15); - Actor_Says(0, 2090, 19); - Actor_Says(9, 910, 16); - Actor_Says(0, 2095, 14); - Actor_Says(9, 920, 3); - Actor_Says(0, 2100, 15); - Actor_Says(9, 930, 12); - Actor_Says(9, 940, 14); - Actor_Says(0, 2105, 3); - Actor_Says(9, 950, 15); - Actor_Says(0, 2110, 0); - Actor_Says(9, 960, 16); - } - break; - } -} - -void ScriptHF05::sub_403738() { - Dialogue_Menu_Clear_List(); - DM_Add_To_List_Never_Repeat_Once_Selected(1250, -1, -1, 10); - DM_Add_To_List_Never_Repeat_Once_Selected(1260, 10, 5, -1); - Dialogue_Menu_Appear(320, 240); - int answer = Dialogue_Menu_Query_Input(); - Dialogue_Menu_Disappear(); - if (answer == 1250) { - Actor_Says(0, 1955, 17); - Actor_Says(0, 1960, 23); - Item_Pickup_Spin_Effect(986, 315, 327); - Delay(2000); - Actor_Says(0, 1980, 23); - Actor_Says(0, 1985, 3); - Actor_Says(9, 580, 3); - Actor_Says(9, 590, 15); - Actor_Says(0, 1990, 17); - Actor_Says(9, 600, 16); - Actor_Says(0, 1995, 3); - Game_Flag_Set(165); - Actor_Put_In_Set(9, 67); - Actor_Set_At_XYZ(9, -315.15f, 0.0f, 241.06f, 583); - Actor_Set_Goal_Number(9, 699); - Game_Flag_Set(652); - if (Game_Flag_Query(255)) { - Set_Enter(54, 54); - } else { - Game_Flag_Set(313); - Set_Enter(37, 34); - } - } else if (answer == 1260) { - Actor_Says(0, 1965, 12); - Actor_Says(0, 1970, 3); - Actor_Says(0, 1975, 3); - Actor_Says(9, 610, 16); - } -} - -int ScriptHF05::sub_404858() { - if (Global_Variable_Query(45) == 2 && Actor_Query_Goal_Number(3) != 599) { - return 3; - } - if (Global_Variable_Query(45) == 3 && Actor_Query_Goal_Number(6) != 599) { - return 6; - } - return -1; -} - -void ScriptHF05::sub_4042E4() { - Actor_Force_Stop_Walking(0); - Actor_Put_In_Set(23, 41); - Actor_Set_At_XYZ(23, 430.39999f, 40.630001f, -258.17999f, 300); - Actor_Put_In_Set(24, 41); - Actor_Set_At_XYZ(24, 526.40002f, 37.18f, -138.17999f, 300); - ADQ_Flush(); - ADQ_Add(24, 260, -1); - Player_Loses_Control(); - Non_Player_Actor_Combat_Mode_On(23, 3, 1, 0, 4, 4, 7, 8, 0, 0, 100, 100, 1200, 1); - return Non_Player_Actor_Combat_Mode_On(24, 3, 1, 0, 4, 4, 7, 8, 0, 0, 100, 100, 300, 1); -} - -void ScriptHF05::sub_403F0C() { - Actor_Face_Actor(0, 3, true); - Actor_Face_Actor(3, 0, true); - Actor_Says(3, 2660, 12); - Actor_Says(0, 8990, 3); - Actor_Says(3, 2670, 13); - Actor_Says(3, 2680, 17); - Actor_Says(0, 8995, 14); - Actor_Says(3, 2690, 15); - Actor_Says_With_Pause(0, 9000, 1.0f, 16); - Actor_Says_With_Pause(0, 9005, 1.0f, 19); - Actor_Says(0, 1765, 17); - Actor_Says(3, 160, 12); - Actor_Says(0, 1770, 15); - Actor_Says(0, 1775, 3); - Actor_Says(3, 170, 3); - Actor_Says_With_Pause(0, 1780, 1.0f, 18); -} - -void ScriptHF05::sub_40410C() { - Actor_Face_Actor(0, 6, true); - Actor_Face_Actor(6, 0, true); - Actor_Says(6, 400, 16); - Actor_Says(0, 1750, 14); - Actor_Says(6, 410, 12); - Actor_Says(6, 420, 14); - Actor_Says(0, 1755, 16); - Actor_Says(6, 430, 18); - Actor_Says_With_Pause(0, 1760, 1.0f, 15); - Actor_Says(0, 1765, 17); - Actor_Says(6, 440, 3); - Actor_Says(0, 1770, 15); - Actor_Says(0, 1775, 3); - Actor_Says(6, 450, 17); - Actor_Says_With_Pause(0, 1780, 1.0f, 18); -} - -void ScriptHF05::sub_403A34(int actorId) { - if (actorId != -1 && Actor_Query_In_Set(9, 41)) { - Async_Actor_Walk_To_Waypoint(actorId, 437, 36, 0); - Loop_Actor_Walk_To_Waypoint(0, 437, 0, 0, false); - Actor_Face_Actor(9, 0, true); - Actor_Face_Actor(0, 9, true); - Actor_Face_Actor(actorId, 9, true); - Actor_Says(9, 0, 3); - Actor_Says(9, 10, 12); - Actor_Says(0, 1715, 19); - Actor_Says(0, 1720, -1); - Actor_Says(9, 20, 14); - Actor_Says(9, 30, 15); - Actor_Says(0, 1725, 3); - Actor_Says(9, 40, 16); - Actor_Says(9, 50, 3); - Actor_Says(9, 60, 12); - Actor_Says(9, 70, 13); - Actor_Says(0, 1730, 3); - Loop_Actor_Walk_To_Actor(9, 0, 28, 0, false); - Item_Pickup_Spin_Effect(986, 315, 327); - Actor_Says(9, 80, 23); - Actor_Clue_Acquire(0, 265, 1, 9); - Actor_Says(9, 90, 15); - Actor_Says(0, 1735, 17); - Actor_Says(9, 100, 16); - Actor_Says(9, 110, 3); - Actor_Face_Actor(actorId, 0, true); - if (actorId == 3) { - Actor_Says(3, 90, 3); - } else { - Actor_Says(6, 380, 3); - } - Actor_Says(0, 1740, 14); - Actor_Says(9, 120, 12); - Actor_Set_Goal_Number(9, 2); - if (actorId == 3) { - Actor_Says(3, 100, 3); - } else { - Actor_Says(6, 390, 3); - } - Actor_Face_Actor(0, actorId, true); - Actor_Says(0, 1745, 3); - Async_Actor_Walk_To_XYZ(actorId, 309.0f, 40.63f, 402.0f, 0, false); - Loop_Actor_Walk_To_XYZ(0, 277.0f, 40.63f, 410.0f, 0, 0, false, 0); - Game_Flag_Set(529); - Set_Enter(42, 39); - } -} - -void ScriptHF05::sub_402370() { - Player_Loses_Control(); - if (Global_Variable_Query(1) == 3) { - ADQ_Flush(); - ADQ_Add(9, 130, 18); - ADQ_Add(9, 140, 18); - ADQ_Add(9, 150, 18); - ADQ_Add(9, 160, 17); - } - Loop_Actor_Walk_To_XYZ(0, 307.0f, 40.63f, 184.0f, 0, 0, false, 0); - Loop_Actor_Walk_To_Actor(9, 0, 72, 0, false); - Ambient_Sounds_Play_Sound(149, 99, 99, 0, 0); - Actor_Face_Actor(9, 0, true); - Actor_Face_Actor(0, 9, true); - Actor_Says(9, 170, 3); - Actor_Says(9, 180, 12); - Actor_Says(9, 190, 14); - Actor_Says(9, 200, 15); - Actor_Says(0, 1815, 12); - Actor_Says(9, 210, 16); - Actor_Says(0, 1820, -1); - Actor_Says(9, 220, 3); - Actor_Says(9, 230, 12); - Actor_Says(9, 240, 14); - Actor_Says(0, 1825, 0); - Actor_Says(9, 250, 15); - Actor_Face_Object(9, "MONTE CARLO DRY", true); - Actor_Says(9, 260, 16); - Actor_Face_Object(0, "MONTE CARLO DRY", true); - Actor_Says(0, 1830, 0); - Actor_Face_Actor(9, 0, true); - Actor_Face_Actor(0, 9, true); - Actor_Says(9, 270, 3); - Actor_Says(9, 280, 12); - Async_Actor_Walk_To_XYZ(9, 276.0f, 40.63f, 182.0f, 12, false); - Loop_Actor_Walk_To_XYZ(0, 335.0f, 40.63f, 131.0f, 12, 0, false, 0); - Actor_Face_Object(9, "MONTE CARLO DRY", true); - Actor_Face_Object(0, "MONTE CARLO DRY", true); - Actor_Says(9, 290, 14); - Actor_Says(9, 300, 15); - Actor_Says(9, 310, 16); - Actor_Says(0, 1835, 12); - Actor_Face_Actor(9, 0, true); - Actor_Says(9, 320, 3); - Actor_Face_Actor(0, 9, true); - Actor_Says(9, 330, 12); - Actor_Says(0, 1840, 3); - Actor_Says(9, 340, 14); - Actor_Says(0, 1845, 3); - Actor_Says(9, 350, 15); - Actor_Says(9, 360, 16); - Actor_Says(0, 1850, 3); - Player_Gains_Control(); -} - -void ScriptHF05::sub_404474() { - Ambient_Sounds_Add_Sound(87, 20, 80, 20, 100, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Speech_Sound(23, 250, 5, 70, 7, 10, -50, 50, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(23, 330, 5, 70, 7, 10, -50, 50, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(23, 340, 5, 90, 7, 10, -50, 50, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(23, 360, 5, 70, 7, 10, -50, 50, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(24, 380, 5, 70, 7, 10, -50, 50, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(24, 510, 5, 70, 7, 10, -50, 50, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(38, 80, 5, 70, 7, 10, -50, 50, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(38, 160, 5, 70, 7, 10, -50, 50, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(38, 280, 5, 70, 7, 10, -50, 50, -101, -101, 1, 1); -} - -int ScriptHF05::sub_4048C0() { - if (Actor_Query_In_Set(3, 41) == 1 && Actor_Query_Goal_Number(3) != 599) { - return 3; - } - if (Actor_Query_In_Set(6, 41) == 1 && Actor_Query_Goal_Number(6) != 599) { - return 6; - } - return 0; -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/hf06.cpp b/engines/bladerunner/script/hf06.cpp deleted file mode 100644 index d9a5b3a2fe..0000000000 --- a/engines/bladerunner/script/hf06.cpp +++ /dev/null @@ -1,286 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptHF06::InitializeScene() { - Setup_Scene_Information(150.0f, 349.93f, 502.0f, 229); - Game_Flag_Reset(529); - Scene_Exit_Add_2D_Exit(0, 195, 197, 271, 237, 2); - Ambient_Sounds_Add_Looping_Sound(54, 50, 0, 1); - Ambient_Sounds_Add_Looping_Sound(99, 40, -100, 1); - Ambient_Sounds_Add_Looping_Sound(100, 40, 100, 1); - Ambient_Sounds_Add_Sound(68, 10, 100, 25, 50, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(69, 10, 100, 25, 50, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(375, 10, 70, 50, 100, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(376, 10, 70, 50, 100, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(377, 10, 70, 50, 100, 0, 0, -101, -101, 0, 0); - if (Game_Flag_Query(559)) { - Scene_Loop_Set_Default(3); - sub_4023E0(); - } else { - Scene_Loop_Set_Default(0); - } -} - -void ScriptHF06::SceneLoaded() { - Unobstacle_Object("BOX22", true); - Unobstacle_Object("BOX34", true); - Clickable_Object("BOX19"); - Clickable_Object("BOX21"); - Clickable_Object("BOX23"); - Clickable_Object("HOOD BOX"); - Clickable_Object("BOX28"); - Clickable_Object("BOX29"); - Clickable_Object("BOX30"); -} - -bool ScriptHF06::MouseClick(int x, int y) { - return false; -} - -bool ScriptHF06::ClickedOn3DObject(const char *objectName, bool a2) { - if (Object_Query_Click("BOX28", objectName) || Object_Query_Click("BOX29", objectName) || Object_Query_Click("BOX30", objectName) || Object_Query_Click("HOOD BOX", objectName)) { - if (!Loop_Actor_Walk_To_XYZ(0, 14.33f, 367.93f, 399.0f, 0, 1, false, 0)) { - Actor_Face_Heading(0, 486, true); - if (Actor_Query_In_Set(3, 42) && Actor_Query_Goal_Number(3) != 599) { - Actor_Face_Actor(3, 0, true); - Actor_Says(3, 210, 12); - Actor_Says(0, 2125, 12); - } else if (Actor_Query_In_Set(6, 42) && Actor_Query_Goal_Number(6) != 599) { - Actor_Face_Actor(6, 0, true); - Actor_Says(6, 490, 18); - Actor_Says(0, 2125, 12); - } else { - Actor_Says(0, 8635, 12); - } - } - return false; - } - if (Object_Query_Click("BOX19", objectName) || Object_Query_Click("BOX21", objectName)) { - if (!Loop_Actor_Walk_To_XYZ(0, 290.0f, 367.93f, 318.0f, 0, 1, false, 0)) { - Actor_Face_Heading(0, 85, true); - Actor_Says(0, 8522, 0); - } - return false; - } - if (Object_Query_Click("BOX13", objectName)) { - if (!Loop_Actor_Walk_To_XYZ(0, 63.0f, 367.93f, 120.0f, 0, 1, false, 0)) { - Actor_Face_Heading(0, 568, true); - Actor_Says(0, 8522, 0); - } - return false; - } - return false; -} - -bool ScriptHF06::ClickedOnActor(int actorId) { - if (actorId == 6 && Actor_Query_Goal_Number(6) != 599) { - Actor_Face_Actor(6, 0, true); - Actor_Face_Actor(0, 6, true); - if (Game_Flag_Query(559)) { - Actor_Says(6, 390, 18); - Actor_Says(0, 2115, 17); - } - } else if (actorId == 3 && Actor_Query_Goal_Number(3) != 599) { - Actor_Face_Actor(3, 0, true); - Actor_Face_Actor(0, 3, true); - if (Game_Flag_Query(559)) { - Actor_Says(3, 100, 3); - Actor_Says(0, 2115, 17); - } - } - return false; -} - -bool ScriptHF06::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptHF06::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, 170.0f, 367.93f, 497.0f, 0, 1, false, 0)) { - Actor_Face_Heading(0, 730, false); - Loop_Actor_Travel_Stairs(0, 2, 0, 0); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(530); - Set_Enter(41, 38); - } - return true; - } - return false; -} - -bool ScriptHF06::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptHF06::SceneFrameAdvanced(int frame) { -} - -void ScriptHF06::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { - if (actorId == 1 && oldGoal != 599 && newGoal == 599) { - Loop_Actor_Walk_To_Actor(0, 1, 24, 0, false); - Actor_Says(1, 250, -1); - Actor_Says(0, 2120, 4); - Actor_Says(1, 260, -1); - Actor_Says(1, 270, -1); - int otherActorId = -1; - if (Actor_Query_In_Set(3, 42) && Actor_Query_Goal_Number(3) == 599) { - otherActorId = 3; - } else if (Actor_Query_In_Set(6, 42) && Actor_Query_Goal_Number(6) == 599) { - otherActorId = 6; - } - if (otherActorId != -1) { - Music_Play(21, 35, 0, 3, -1, 0, 0); - Player_Set_Combat_Mode(false); - Delay(1000); - Actor_Voice_Over(990, 99); - Actor_Voice_Over(1000, 99); - Actor_Voice_Over(1010, 99); - Loop_Actor_Walk_To_Actor(0, otherActorId, 24, 0, false); - Item_Pickup_Spin_Effect(932, 355, 200); - Actor_Voice_Over(1020, 99); - Actor_Voice_Over(1030, 99); - Actor_Voice_Over(1040, 99); - Actor_Voice_Over(1050, 99); - Actor_Clue_Acquire(0, 146, 1, -1); - } - if (Actor_Query_In_Set(3, 42)) { - Actor_Set_Targetable(3, false); - } - if (Actor_Query_In_Set(6, 42)) { - Actor_Set_Targetable(6, false); - } - Scene_Exits_Enable(); - } -} - -void ScriptHF06::PlayerWalkedIn() { - if (Game_Flag_Query(662)) { - int actor_id; - if (Global_Variable_Query(45) == 3 && Actor_Query_Goal_Number(6) != 599) { - actor_id = 6; - } else { - actor_id = Global_Variable_Query(45) == 2 && Actor_Query_Goal_Number(3) != 599 ? 3 : -1; - } - if (actor_id != -1) { - Actor_Put_In_Set(actor_id, 42); - if (Game_Flag_Query(559)) { - Actor_Set_At_XYZ(actor_id, 173.67f, 367.93f, 446.04001f, 229); - Async_Actor_Walk_To_XYZ(actor_id, 173.67f, 367.93f, 394.04001f, 0, false); - } else { - Actor_Set_At_XYZ(actor_id, 97.67f, 367.93f, 534.04f, 725); - Async_Actor_Walk_To_XYZ(actor_id, 24.2f, 367.93f, 537.71f, 0, false); - } - } - } - Footstep_Sound_Override_On(3); - Loop_Actor_Travel_Stairs(0, 2, 1, 0); - Footstep_Sound_Override_Off(); - if (Game_Flag_Query(662) && !Game_Flag_Query(559)) { - sub_401EF4(); - } -} - -void ScriptHF06::PlayerWalkedOut() { - Music_Stop(2); -} - -void ScriptHF06::DialogueQueueFlushed(int a1) { -} - -void ScriptHF06::sub_401EF4() { - int actorId; - - if (Actor_Query_In_Set(3, 42)) { - actorId = 3; - } else { - if (!Actor_Query_In_Set(6, 42)) { - return; - } - actorId = 6; - } - Actor_Set_Targetable(actorId, true); - Loop_Actor_Walk_To_XYZ(0, 14.33f, 367.93f, 399.0f, 0, 0, true, 0); - Actor_Face_Heading(0, 486, true); - sub_4023E0(); - Actor_Put_In_Set(1, 42); - Actor_Set_At_XYZ(1, 92.0f, 367.93f, 19.0f, 0); - Actor_Set_Targetable(1, true); - Actor_Face_Actor(actorId, 1, true); - if (actorId == 3) { - Actor_Says(3, 90, 13); - } else if (actorId == 6) { - Actor_Says(6, 380, 13); - } - Actor_Says(0, 6230, 0); - Actor_Says(1, 280, 58); - Actor_Face_Actor(0, 1, true); - Player_Set_Combat_Mode(true); - Actor_Change_Animation_Mode(0, 5); - Actor_Change_Animation_Mode(1, 7); - Loop_Actor_Walk_To_XYZ(1, 92.0f, 367.93f, 107.0f, 0, 0, false, 0); - Actor_Face_Actor(1, 0, true); - Actor_Change_Animation_Mode(1, 4); - Actor_Says(1, 290, 58); - Actor_Says(0, 2130, -1); - Actor_Says(1, 300, 59); - Actor_Says(0, 2135, -1); - Actor_Says(1, 310, 60); - Actor_Says(0, 2140, -1); - Actor_Says(1, 320, 59); - Actor_Says(0, 2145, -1); - Actor_Says(1, 330, 58); - Actor_Says(1, 340, 58); - Actor_Says(1, 350, 58); - Actor_Change_Animation_Mode(1, 4); - Game_Flag_Set(644); - Actor_Set_Goal_Number(1, 402); - Actor_Face_Actor(1, actorId, true); - Actor_Change_Animation_Mode(1, 6); - Delay(500); - Scene_Loop_Set_Default(3); - Scene_Loop_Start_Special(2, 2, 1); - Sound_Play(562, 50, 0, 0, 50); - Game_Flag_Set(559); - Scene_Exits_Disable(); - Non_Player_Actor_Combat_Mode_On(1, 3, 1, actorId, 15, 4, 7, 8, 0, 0, 100, 10, 300, 0); -} - -void ScriptHF06::sub_4023E0() { - Ambient_Sounds_Add_Sound(87, 20, 80, 20, 100, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Speech_Sound(23, 250, 5, 70, 7, 10, -50, 50, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(23, 330, 5, 70, 7, 10, -50, 50, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(23, 340, 5, 90, 7, 10, -50, 50, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(23, 360, 5, 70, 7, 10, -50, 50, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(24, 380, 5, 70, 7, 10, -50, 50, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(24, 510, 5, 70, 7, 10, -50, 50, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(38, 80, 5, 70, 7, 10, -50, 50, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(38, 160, 5, 70, 7, 10, -50, 50, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(38, 280, 5, 70, 7, 10, -50, 50, -101, -101, 1, 1); -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/hf07.cpp b/engines/bladerunner/script/hf07.cpp deleted file mode 100644 index aa096004b3..0000000000 --- a/engines/bladerunner/script/hf07.cpp +++ /dev/null @@ -1,154 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptHF07::InitializeScene() { - if (Game_Flag_Query(361) ) { - Setup_Scene_Information(-84.0f, 58.43f, -105.0f, 524); - } else { - Setup_Scene_Information(298.0f, 58.43f, -71.0f, 700); - } - Scene_Exit_Add_2D_Exit(0, 289, 136, 344, 305, 0); - Scene_Exit_Add_2D_Exit(1, 69, 264, 132, 303, 2); - Ambient_Sounds_Add_Looping_Sound(108, 100, 0, 1); - Ambient_Sounds_Add_Looping_Sound(112, 32, 0, 1); - Ambient_Sounds_Add_Sound(303, 5, 40, 20, 33, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(304, 5, 40, 20, 33, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(305, 5, 40, 20, 33, -100, 100, -101, -101, 0, 0); - if (Game_Flag_Query(368) ) { - Scene_Loop_Set_Default(2); - } else { - Scene_Loop_Set_Default(0); - } -} - -void ScriptHF07::SceneLoaded() { - Obstacle_Object("BRIMS02", true); - Unobstacle_Object("BOX50", true); - Unobstacle_Object("BOX60", true); -} - -bool ScriptHF07::MouseClick(int x, int y) { - return false; -} - -bool ScriptHF07::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptHF07::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptHF07::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptHF07::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (Actor_Query_In_Set(3, 43)) { - Async_Actor_Walk_To_XYZ(3, 235.0f, 58.43f, -100.0f, 0, false); - } else if (Actor_Query_In_Set(6, 43)) { - Async_Actor_Walk_To_XYZ(6, 235.0f, 58.43f, -100.0f, 0, false); - } - if (!Loop_Actor_Walk_To_XYZ(0, 318.0f, 71.43f, -102.0f, 0, 1, false, 0)) { - Game_Flag_Set(358); - if (!Game_Flag_Query(662)) { - Actor_Face_Heading(0, 0, false); - Footstep_Sound_Override_On(3); - Loop_Actor_Travel_Stairs(0, 30, 1, 0); - Footstep_Sound_Override_Off(); - } - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Set_Enter(41, 38); - } - return true; - } - if (exitId == 1) { - if (Actor_Query_In_Set(3, 43)) { - Async_Actor_Walk_To_XYZ(3, -73.0f, 58.43f, -7.0f, 0, false); - } else if (Actor_Query_In_Set(6, 43)) { - Async_Actor_Walk_To_XYZ(6, -73.0f, 58.43f, -7.0f, 0, false); - } - if (!Loop_Actor_Walk_To_XYZ(0, -84.0f, 58.43f, -105.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(360); - Set_Enter(78, 90); - } - return true; - } - return false; -} - -bool ScriptHF07::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptHF07::SceneFrameAdvanced(int frame) { -} - -void ScriptHF07::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptHF07::PlayerWalkedIn() { - if (Game_Flag_Query(662)) { - int actorId = sub_401864(); - if (Game_Flag_Query(662) && actorId != -1) { - Actor_Put_In_Set(actorId, 43); - if (Game_Flag_Query(361)) { - Actor_Set_At_XYZ(actorId, -73.0f, 58.43f, -7.0f, 224); - } else { - Actor_Set_At_XYZ(actorId, 235.0f, 58.43f, -100.0f, 512); - } - } - } else if (Game_Flag_Query(359)) { - Actor_Set_At_XYZ(0, 267.72f, 329.43f, -86.75f, 940); - Footstep_Sound_Override_On(3); - Loop_Actor_Travel_Stairs(0, 30, 0, 0); - Footstep_Sound_Override_Off(); - } - Game_Flag_Reset(359); - Game_Flag_Reset(361); -} - -void ScriptHF07::PlayerWalkedOut() { -} - -void ScriptHF07::DialogueQueueFlushed(int a1) { -} - -int ScriptHF07::sub_401864() { - if (Global_Variable_Query(45) == 2 && Actor_Query_Goal_Number(3) != 599) { - return 3; - } - if (Global_Variable_Query(45) == 3 && Actor_Query_Goal_Number(6) != 599) { - return 6; - } - return -1; -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/kp01.cpp b/engines/bladerunner/script/kp01.cpp deleted file mode 100644 index b4a91e79cf..0000000000 --- a/engines/bladerunner/script/kp01.cpp +++ /dev/null @@ -1,171 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptKP01::InitializeScene() { - if (Game_Flag_Query(416)) { - Setup_Scene_Information(-125.0f, -12.2f, -61.0f, 400); - } else if (Game_Flag_Query(418)) { - Setup_Scene_Information(-284.0f, -12.2f, -789.0f, 445); - } else { - Setup_Scene_Information(239.0f, -12.2f, -146.0f, 820); - Game_Flag_Reset(413); - if (!Game_Flag_Query(674) && !Game_Flag_Query(653)) { - Game_Flag_Set(674); - Actor_Set_Goal_Number(1, 420); - } - } - Scene_Exit_Add_2D_Exit(0, 0, 0, 30, 479, 3); - Scene_Exit_Add_2D_Exit(1, 150, 0, 200, 276, 0); - Scene_Exit_Add_2D_Exit(2, 589, 0, 639, 479, 1); - Ambient_Sounds_Add_Looping_Sound(464, 34, 1, 1); - Ambient_Sounds_Add_Looping_Sound(383, 27, 1, 1); - Ambient_Sounds_Add_Looping_Sound(384, 90, 1, 1); - Ambient_Sounds_Add_Sound(440, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(441, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(442, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(375, 5, 180, 50, 100, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(377, 5, 180, 50, 100, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(443, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(444, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(445, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); -} - -void ScriptKP01::SceneLoaded() { - Unobstacle_Object("TRAINCAR-1", true); - Unobstacle_Object("FORE-JUNK-02", true); - Obstacle_Object("OBSTACLE1", true); - Obstacle_Object("TUBE1", true); - Unclickable_Object("OBSTACLE1"); -} - -bool ScriptKP01::MouseClick(int x, int y) { - return false; -} - -bool ScriptKP01::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptKP01::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptKP01::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptKP01::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -125.0f, -12.2f, -61.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(415); - Set_Enter(47, 44); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -284.0f, -12.2f, -789.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(417); - Set_Enter(46, 43); - } - return true; - } - if (exitId == 2) { - if (!Loop_Actor_Walk_To_XYZ(0, 239.0f, 12.2f, -146.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(414); - Set_Enter(45, 42); - } - return true; - } - return false; -} - - -bool ScriptKP01::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptKP01::SceneFrameAdvanced(int frame) { -} - -void ScriptKP01::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { - if (actorId == 1) { - if (newGoal == 422) { - if (Game_Flag_Query(378) == 1) { - Delay(500); - Actor_Change_Animation_Mode(0, 75); - Delay(4500); - Actor_Face_Current_Camera(0, true); - Actor_Says(0, 510, 3); - } else { - Delay(3000); - } - Async_Actor_Walk_To_XYZ(0, 76.56f, -12.2f, -405.48f, 0, false); - //return true; - } else if (newGoal == 423) { - Player_Gains_Control(); - Actor_Force_Stop_Walking(0); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(417); - Set_Enter(46, 43); - //return true; - } - } - //return false; -} - -void ScriptKP01::PlayerWalkedIn() { - if (Game_Flag_Query(416)) { - Loop_Actor_Walk_To_XYZ(0, -93.0f, -12.2f, -61.0f, 0, 0, false, 0); - Game_Flag_Reset(416); - } else if (Game_Flag_Query(418)) { - Loop_Actor_Walk_To_XYZ(0, -240.0f, -12.2f, -789.0f, 0, 0, false, 0); - Game_Flag_Reset(418); - } else { - Loop_Actor_Walk_To_XYZ(0, 211.0f, -12.2f, -146.0f, 0, 0, false, 0); - if (!Game_Flag_Query(653) - && !Game_Flag_Query(714) - && Actor_Query_Goal_Number(1) == 420 - && Actor_Query_Goal_Number(1) != 599) { - Player_Loses_Control(); - Actor_Set_Goal_Number(1, 421); - } - } -} - -void ScriptKP01::PlayerWalkedOut() { -} - -void ScriptKP01::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/kp02.cpp b/engines/bladerunner/script/kp02.cpp deleted file mode 100644 index 08a2b835ac..0000000000 --- a/engines/bladerunner/script/kp02.cpp +++ /dev/null @@ -1,147 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptKP02::InitializeScene() { - if (Game_Flag_Query(414)) { - Setup_Scene_Information(-884.0f, -615.49f, 3065.0f, 20); - } else { - Setup_Scene_Information(-1040.0f, -615.49f, 2903.0f, 339); - Game_Flag_Reset(412); - } - Scene_Exit_Add_2D_Exit(1, 0, 0, 30, 479, 3); - Ambient_Sounds_Add_Looping_Sound(464, 34, 1, 1); - Ambient_Sounds_Add_Looping_Sound(383, 27, 1, 1); - Ambient_Sounds_Add_Looping_Sound(384, 90, 1, 1); - Ambient_Sounds_Add_Sound(440, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(441, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(442, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(375, 5, 180, 50, 100, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(376, 5, 180, 50, 100, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(377, 5, 180, 50, 100, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(443, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(444, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(445, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); -} - -void ScriptKP02::SceneLoaded() { - Obstacle_Object("VAN GRATE", true); - Clickable_Object("VAN GRATE"); - Unobstacle_Object("VAN GRATE", true); - Unobstacle_Object("BOX05", true); - Unobstacle_Object("BOX08", true); - Unobstacle_Object("BOX09", true); - Unobstacle_Object("BOX01", true); - Unclickable_Object("VAN GRATE"); -} - -bool ScriptKP02::MouseClick(int x, int y) { - return false; -} - -bool ScriptKP02::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptKP02::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptKP02::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptKP02::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -1040.0f, -615.49f, 2903.0f, 0, 1, false, 0)) { - if (Actor_Query_Goal_Number(65) == 406 || Actor_Query_Goal_Number(64) == 406) { - Non_Player_Actor_Combat_Mode_Off(65); - Non_Player_Actor_Combat_Mode_Off(64); - Actor_Set_Goal_Number(65, 400); - Actor_Set_Goal_Number(64, 400); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(411); - Set_Enter(84, 96); - } else { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(411); - Set_Enter(84, 96); - } - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -884.0f, -615.49f, 3065.0f, 0, 1, false, 0)) { - if (Actor_Query_Goal_Number(65) == 406 || Actor_Query_Goal_Number(64) == 406) { - Non_Player_Actor_Combat_Mode_Off(65); - Non_Player_Actor_Combat_Mode_Off(64); - Actor_Set_Goal_Number(65, 400); - Actor_Set_Goal_Number(64, 400); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(413); - Set_Enter(44, 41); - } else { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(413); - Set_Enter(44, 41); - } - } - return true; - } - return false; -} - -bool ScriptKP02::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptKP02::SceneFrameAdvanced(int frame) { -} - -void ScriptKP02::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptKP02::PlayerWalkedIn() { - if (Game_Flag_Query(414)) { - Loop_Actor_Walk_To_XYZ(0, -884.0f, -615.49f, 3035.0f, 0, 0, false, 0); - Game_Flag_Reset(414); - } - if (Game_Flag_Query(653) && Actor_Query_Goal_Number(1) != 599) { - Actor_Set_Goal_Number(1, 450); - } - //return false; -} - -void ScriptKP02::PlayerWalkedOut() { -} - -void ScriptKP02::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/kp03.cpp b/engines/bladerunner/script/kp03.cpp deleted file mode 100644 index 57a1eb521b..0000000000 --- a/engines/bladerunner/script/kp03.cpp +++ /dev/null @@ -1,262 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptKP03::InitializeScene() { - if (Game_Flag_Query(420)) { - Setup_Scene_Information(1.0f, -36.55f, 111.0f, 200); - } else { - Setup_Scene_Information(-321.0f, -36.55f, 26.0f, 350); - } - Scene_Exit_Add_2D_Exit(0, 0, 0, 30, 479, 3); - Scene_Exit_Add_2D_Exit(1, 287, 104, 367, 255, 0); - Ambient_Sounds_Add_Looping_Sound(381, 100, 1, 1); - Ambient_Sounds_Add_Sound(68, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(69, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(375, 60, 180, 50, 100, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(376, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(377, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0); - if (Game_Flag_Query(422)) { - Scene_Loop_Set_Default(5); - } else if (Game_Flag_Query(484)) { - Scene_Loop_Set_Default(7); - } else { - Scene_Loop_Set_Default(2); - Game_Flag_Set(421); - } - if ((Actor_Query_Goal_Number(1) != 599 && !Game_Flag_Query(422) && !Game_Flag_Query(484)) && ((Game_Flag_Query(653) && Game_Flag_Query(420)) || (!Game_Flag_Query(653) && Game_Flag_Query(417)))) { - Actor_Put_In_Set(1, 46); - Actor_Set_At_XYZ(1, -300.0f, -36.55f, 26.0f, 350); - } -} - -void ScriptKP03::SceneLoaded() { - Obstacle_Object("BRACK MID", true); - Unobstacle_Object("OBSTACLE_REMOVE", true); - Unobstacle_Object("BOX11", true); - Unobstacle_Object("OBSTACLE05", true); - Clickable_Object("BRACK MID"); -} - -bool ScriptKP03::MouseClick(int x, int y) { - return false; -} - -bool ScriptKP03::ClickedOn3DObject(const char *objectName, bool a2) { - Actor_Face_Object(1, "BRACK MID", true); - if (Object_Query_Click("BRACK MID", objectName) && !Game_Flag_Query(422)) { - if (a2) { - Scene_Loop_Set_Default(5); - Scene_Loop_Start_Special(2, 4, 1); - Actor_Change_Animation_Mode(0, 39); - Actor_Retired_Here(0, 72, 18, 1, -1); - Game_Flag_Set(422); - Game_Flag_Reset(421); - return false; - } - if (Actor_Query_Goal_Number(1) == 411) { - Scene_Exits_Enable(); - sub_401E54(); - } else { - if (Game_Flag_Query(417)) { - Loop_Actor_Walk_To_XYZ(0, -137.0f, -36.55f, 26.0f, 0, 0, true, 0); - } else if (Game_Flag_Query(420)) { - Loop_Actor_Walk_To_XYZ(0, -50.0f, -36.55f, 78.0f, 0, 0, true, 0); - } - if (Game_Flag_Query(421)) { - Actor_Face_Object(0, "BRACK MID", true); - Game_Flag_Set(484); - Game_Flag_Reset(421); - Scene_Loop_Set_Default(7); - Scene_Loop_Start_Special(2, 0, 0); - Actor_Voice_Over(1110, 99); - Actor_Voice_Over(1120, 99); - } else { - Actor_Face_Object(0, "BRACK MID", true); - Actor_Says(0, 8580, 13); - } - } - return true; - } - return false; -} - -bool ScriptKP03::ClickedOnActor(int actorId) { - if (actorId == 1 && Actor_Query_Goal_Number(1) == 411) { - Actor_Face_Object(1, "BRACK MID", true); - sub_401E54(); - } - return false; -} - -bool ScriptKP03::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptKP03::ClickedOnExit(int exitId) { - if (Actor_Query_Goal_Number(1) == 410) { - Actor_Set_Goal_Number(1, 418); - } else { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, 1.0f, -36.55f, 111.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Music_Stop(2); - Game_Flag_Reset(417); - Game_Flag_Reset(420); - Game_Flag_Set(419); - Set_Enter(9, 45); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -321.0f, -36.55f, 26.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Music_Stop(2); - Game_Flag_Reset(417); - Game_Flag_Reset(420); - Game_Flag_Set(418); - Set_Enter(44, 41); - } - return true; - } - } - return false; -} - -bool ScriptKP03::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptKP03::SceneFrameAdvanced(int frame) { - int v1; - float x, y, z; - - if (frame == 123) { - Ambient_Sounds_Play_Sound(491, 99, -60, 100, 99); - } - if (Game_Flag_Query(421) && !Game_Flag_Query(484)) { - v1 = -1; - if (!Game_Flag_Query(422)) { - Actor_Query_XYZ(0, &x, &y, &z); - if ((Game_Flag_Query(417) && -130.0f < x) || (Game_Flag_Query(420) && -130.0f > x)) { - v1 = 0; - } - } - if (!Game_Flag_Query(422)) { //todo ? same condition as before - Actor_Query_XYZ(1, &x, &y, &z); - if (Game_Flag_Query(653) && Actor_Query_Which_Set_In(1) == 46) { - if ((Game_Flag_Query(417) && -130.0f > x) || (Game_Flag_Query(420) && -130.0f < x)) { - v1 = 1; - } - } else if ((Game_Flag_Query(417) && -130.0f < x) || (Game_Flag_Query(420) && -130.0f > x)) { - v1 = 1; - } - } - if (v1 != -1) { - Scene_Loop_Set_Default(5); - Scene_Loop_Start_Special(2, 4, 1); - Game_Flag_Set(422); - Game_Flag_Reset(421); - Unclickable_Object("BRACK MID"); - Scene_Exits_Enable(); - if (v1 == 1) { - Actor_Set_Goal_Number(1, 415); - Music_Play(12, 25, 0, 1, -1, 0, 0); - if (Actor_Query_Inch_Distance_From_Actor(0, 1) <= 120) { - v1 = 0; - } - } - if (v1) { - Actor_Change_Animation_Mode(0, 21); - } else { - Actor_Force_Stop_Walking(0); - Actor_Change_Animation_Mode(0, 48); - Actor_Retired_Here(0, 72, 18, 1, -1); - } - } - } -} - -void ScriptKP03::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptKP03::PlayerWalkedIn() { - if (Game_Flag_Query(420)) { - Loop_Actor_Walk_To_XYZ(0, 1.0f, -36.55f, 87.0f, 0, 0, false, 0); - } - if (Actor_Query_Is_In_Current_Set(1) && Actor_Query_Goal_Number(1) != 419) { - if (Game_Flag_Query(653)) { - if (Game_Flag_Query(420)) { - Actor_Set_Goal_Number(1, 410); - } - } else if (!Game_Flag_Query(422) && !Game_Flag_Query(484) && Game_Flag_Query(417)) { - Scene_Exits_Disable(); - Delay(1000); - Actor_Set_Goal_Number(1, 411); - } - } -} - -void ScriptKP03::PlayerWalkedOut() { -} - -void ScriptKP03::DialogueQueueFlushed(int a1) { -} - -void ScriptKP03::sub_401E54() { - Player_Loses_Control(); - Actor_Says(0, 2180, 14); - Actor_Set_Goal_Number(1, 412); - Actor_Says(1, 480, 60); - Actor_Face_Object(0, "BRACK MID", true); - Actor_Says(0, 2185, 14); - Loop_Actor_Walk_To_XYZ(1, -137.0f, -36.55f, 26.0f, 0, 0, false, 0); - Actor_Face_Object(1, "BRACK MID", true); - Actor_Says(1, 490, 58); - Actor_Says(0, 2190, 14); - Actor_Says(1, 500, 58); - Actor_Says(1, 510, 59); - Actor_Says(1, 520, 60); - Game_Flag_Set(484); - Game_Flag_Reset(421); - Scene_Loop_Set_Default(7); - Scene_Loop_Start_Special(2, 7, 0); - Actor_Set_Goal_Number(1, 413); - Actor_Says(0, 2195, 14); - Ambient_Sounds_Play_Sound(151, 40, -60, -60, 0); - Loop_Actor_Walk_To_XYZ(0, 1.0f, -36.55f, 111.0f, 0, 0, false, 0); - Actor_Set_Goal_Number(1, 430); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Reset(417); - Game_Flag_Reset(420); - Game_Flag_Set(419); - Set_Enter(9, 45); - Player_Gains_Control(); -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/kp04.cpp b/engines/bladerunner/script/kp04.cpp deleted file mode 100644 index cc2ed3fe71..0000000000 --- a/engines/bladerunner/script/kp04.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptKP04::InitializeScene() { - if (Game_Flag_Query(575)) { - Setup_Scene_Information(-544.0f, 94.89f, 288.0f, 700); - } else { - Setup_Scene_Information(-905.0f, 94.89f, 1357.0f, 970); - } - Scene_Exit_Add_2D_Exit(0, 0, 455, 639, 479, 2); - Scene_Exit_Add_2D_Exit(1, 475, 247, 514, 416, 1); - Ambient_Sounds_Add_Looping_Sound(464, 34, 1, 1); - Ambient_Sounds_Add_Looping_Sound(383, 27, 1, 1); - Ambient_Sounds_Add_Looping_Sound(384, 90, 1, 1); - Ambient_Sounds_Add_Sound(440, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(441, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(442, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(375, 5, 180, 50, 100, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(376, 5, 180, 50, 100, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(377, 5, 180, 50, 100, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(443, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(444, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(445, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); -} - -void ScriptKP04::SceneLoaded() { - Obstacle_Object("BUILDING04", true); - Unobstacle_Object("BOX06", true); - Unclickable_Object("BUILDING04"); -} - -bool ScriptKP04::MouseClick(int x, int y) { - return false; -} - -bool ScriptKP04::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptKP04::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptKP04::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptKP04::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -905.0f, 94.89f, 1357.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(416); - Set_Enter(44, 41); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -544.0f, 94.89f, 288.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(574); - Set_Enter(9, 45); - } - return true; - } - return false; -} - -bool ScriptKP04::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptKP04::SceneFrameAdvanced(int frame) { -} - -void ScriptKP04::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptKP04::PlayerWalkedIn() { - if (Game_Flag_Query(575)) { - Loop_Actor_Walk_To_XYZ(0, -584.0f, 94.89f, 288.0f, 0, 0, false, 0); - Game_Flag_Reset(575); - } else { - Game_Flag_Reset(415); - } -} - -void ScriptKP04::PlayerWalkedOut() { -} - -void ScriptKP04::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/kp05.cpp b/engines/bladerunner/script/kp05.cpp deleted file mode 100644 index 2e1de932d4..0000000000 --- a/engines/bladerunner/script/kp05.cpp +++ /dev/null @@ -1,171 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptKP05::InitializeScene() { - if (Game_Flag_Query(577)) { - Setup_Scene_Information(-868.0f, 0.0f, -68.0f, 520); - } else if (Game_Flag_Query(574)) { - Setup_Scene_Information(-1142.0f, 0.0f, 932.0f, 276); - } else { - Setup_Scene_Information(-802.0f, 0.0f, 972.0f, 800); - } - Scene_Exit_Add_2D_Exit(0, 589, 0, 639, 479, 1); - Scene_Exit_Add_2D_Exit(1, 0, 0, 30, 479, 3); - Scene_Exit_Add_2D_Exit(2, 0, 0, 257, 204, 0); - Ambient_Sounds_Add_Looping_Sound(464, 34, 1, 1); - Ambient_Sounds_Add_Looping_Sound(383, 27, 1, 1); - Ambient_Sounds_Add_Looping_Sound(384, 90, 1, 1); - Ambient_Sounds_Add_Sound(440, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(441, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(442, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(375, 5, 180, 50, 100, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(376, 5, 180, 50, 100, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(377, 5, 180, 50, 100, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(443, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(444, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(445, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); -} - -void ScriptKP05::SceneLoaded() { - Unobstacle_Object("OBSTACLEBOX20", true); - Clickable_Object("BRIDGE02"); - Unclickable_Object("BRIDGE02"); - if (!Actor_Clue_Query(0, 145) && Game_Flag_Query(653)) { - Item_Add_To_World(118, 960, 9, -1095.0f, 0.0f, 770.0f, 256, 24, 24, false, true, false, true); - } -} - -bool ScriptKP05::MouseClick(int x, int y) { - return false; -} - -bool ScriptKP05::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptKP05::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptKP05::ClickedOnItem(int itemId, bool a2) { - if (itemId == 118) { - if (!Loop_Actor_Walk_To_XYZ(0, -1058.0f, 0.0f, 852.0f, 0, 1, false, 0)) { - Actor_Face_Item(0, 118, true); - Actor_Clue_Acquire(0, 145, 1, -1); - Item_Remove_From_World(118); - Item_Pickup_Spin_Effect(960, 58, 321); - } - } - return false; -} - -bool ScriptKP05::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -802.0f, 0.0f, 972.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(420); - Set_Enter(46, 43); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -1142.0f, 0.0f, 932.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(575); - Set_Enter(47, 44); - } - return true; - } - if (exitId == 2) { - if (!Loop_Actor_Walk_To_XYZ(0, -868.0f, 0.0f, -68.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(576); - Async_Actor_Walk_To_XYZ(0, -868.0f, 0.0f, -216.0f, 0, false); - Set_Enter(9, 46); - } - return true; - } - return false; -} - -bool ScriptKP05::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptKP05::SceneFrameAdvanced(int frame) { -} - -void ScriptKP05::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptKP05::PlayerWalkedIn() { - if (Game_Flag_Query(577)) { - Game_Flag_Reset(577); - } else if (Game_Flag_Query(574)) { - Loop_Actor_Walk_To_XYZ(0, -1110.0f, 0.0f, 932.0f, 0, 0, false, 0); - Game_Flag_Reset(574); - } else { - Loop_Actor_Walk_To_XYZ(0, -846.0f, 0.0f, 972.0f, 0, 0, false, 0); - Game_Flag_Query(419); - } - if (Actor_Query_Goal_Number(66) == 411) { - Actor_Set_Goal_Number(66, 412); - } - if (Actor_Query_Goal_Number(1) == 450) { - Scene_Exits_Disable(); - Actor_Face_Actor(1, 0, true); - Actor_Says(1, 530, 15); - Actor_Says(1, 540, 16); - Actor_Face_Actor(0, 1, true); - Player_Set_Combat_Mode(true); - Actor_Says(0, 2200, 3); - Actor_Says(1, 550, 17); - Actor_Says(0, 2205, 3); - Actor_Says(1, 560, 15); - Actor_Says(1, 570, 16); - Actor_Says(1, 580, 13); - Actor_Says(0, 2210, 3); - Actor_Says(1, 590, 13); - Actor_Says(0, 2215, 3); - Actor_Says(1, 600, 16); - Actor_Says(1, 610, 15); - Actor_Says(0, 2220, 3); - Actor_Says(1, 620, 15); - Actor_Says(1, 630, 17); - Non_Player_Actor_Combat_Mode_On(1, 0, 1, 0, 9, 4, 7, 8, 0, -1, -1, 20, 240, 0); - } -} - -void ScriptKP05::PlayerWalkedOut() { -} - -void ScriptKP05::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/kp06.cpp b/engines/bladerunner/script/kp06.cpp deleted file mode 100644 index 094cc257c9..0000000000 --- a/engines/bladerunner/script/kp06.cpp +++ /dev/null @@ -1,237 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptKP06::InitializeScene() { - if (Game_Flag_Query(579) ) { - Setup_Scene_Information(-755.0f, 8.26f, -665.0f, 640); - } else { - Setup_Scene_Information(-868.0f, 8.26f, -8.0f, 0); - } - Scene_Exit_Add_2D_Exit(0, 270, 445, 639, 479, 2); - Scene_Exit_Add_2D_Exit(1, 320, 158, 352, 220, 0); - Ambient_Sounds_Add_Looping_Sound(464, 34, 1, 1); - Ambient_Sounds_Add_Looping_Sound(383, 27, 1, 1); - Ambient_Sounds_Add_Looping_Sound(384, 90, 1, 1); - Ambient_Sounds_Add_Sound(440, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(441, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(442, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(375, 5, 180, 50, 100, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(376, 5, 180, 50, 100, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(377, 5, 180, 50, 100, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(443, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(444, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(445, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); - if (Game_Flag_Query(576) ) { - Scene_Loop_Start_Special(0, 0, 0); - Scene_Loop_Set_Default(1); - Game_Flag_Reset(576); - } else { - Scene_Loop_Set_Default(1); - } -} - -void ScriptKP06::SceneLoaded() { - Obstacle_Object("TRASH CAN WITH FIRE", true); - Obstacle_Object("MOONBUS", true); - Obstacle_Object("STAIR 1", true); - Obstacle_Object("COCKPIT FRONT", true); - Unobstacle_Object("OBSTACLEBOX28", true); - Unobstacle_Object("OBSTACLEBOX32", true); - Unclickable_Object("TRASH CAN WITH FIRE"); -} - -bool ScriptKP06::MouseClick(int x, int y) { - return false; -} - -bool ScriptKP06::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptKP06::ClickedOnActor(int actorId) { - if (actorId == 8 && !Game_Flag_Query(714)) { - if (Actor_Clue_Query(8, 145)) { - Actor_Face_Actor(0, 8, true); - Actor_Says(0, 8610, 15); - Actor_Says(8, 290, 3); - } else if (Actor_Clue_Query(0, 145) ) { - Actor_Says(8, 280, 3); - Actor_Says(8, 290, 3); - Actor_Clue_Acquire(8, 145, 1, 0); - } else { - Actor_Says(0, 2320, 3); - Actor_Says(0, 2325, 3); - Actor_Says(8, 300, 3); - Actor_Says(8, 310, 3); - } - } - return false; -} - -bool ScriptKP06::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptKP06::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -868.0f, 8.26f, -68.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(577); - Set_Enter(9, 45); - } - return true; - } - if (exitId == 1) { - if (Actor_Clue_Query(8, 145) || Actor_Query_Goal_Number(8) != 416) { - if (!Loop_Actor_Walk_To_XYZ(0, -731.0f, 8.26f, -657.0f, 0, 1, false, 0)) { - if (Game_Flag_Query(653)) { - if (!Game_Flag_Query(714)) { - Player_Set_Combat_Mode(false); - } - } else if (Actor_Query_Goal_Number(1) == 433) { - Actor_Set_Goal_Number(1, 499); - } else { - Actor_Set_Goal_Number(53, 499); - } - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(578); - Set_Enter(48, 47); - } - } else if (Actor_Clue_Query(0, 145) ) { - Actor_Says(8, 280, 3); - Actor_Says(8, 290, 3); - Actor_Clue_Acquire(8, 145, 1, 0); - Loop_Actor_Walk_To_XYZ(0, -731.0f, 8.26f, -657.0f, 0, 0, true, 0); - Player_Set_Combat_Mode(false); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(578); - Set_Enter(48, 47); - } else { - Actor_Set_Goal_Number(8, 417); - } - return true; - } - return false; -} - -bool ScriptKP06::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptKP06::SceneFrameAdvanced(int frame) { -} - -void ScriptKP06::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptKP06::PlayerWalkedIn() { - if (!Game_Flag_Query(653) && Game_Flag_Query(579)) { - Game_Flag_Reset(579); - if (Actor_Query_Goal_Number(1) == 499) { - Actor_Face_Actor(1, 0, true); - Actor_Says(1, 2530, 13); - Actor_Face_Actor(0, 1, true); - Actor_Says(0, 6200, 11); - Actor_Says(1, 2540, 15); - Actor_Says(1, 2550, 12); - Actor_Says(0, 6205, 14); - if (Actor_Query_Friendliness_To_Other(1, 0) < 50) { - Actor_Says(1, 2560, 12); - Actor_Says(0, 6210, 14); - Actor_Says(1, 2570, 13); - Actor_Says(0, 6215, 14); - Actor_Says(1, 2580, 15); - Actor_Says(1, 2590, 12); - } - Async_Actor_Walk_To_Waypoint(0, 551, 0, 0); - Delay(1000); - Actor_Says(0, 6220, -1); - Delay(3000); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Outtake_Play(25, 0, -1); - Game_Over(); - //return true; - return; - } else { - Actor_Set_Goal_Number(53, 499); - Actor_Face_Actor(53, 0, true); - Actor_Says(53, 220, 13); - Actor_Face_Actor(0, 53, true); - Actor_Says(0, 6245, 11); - Actor_Says(53, 230, 14); - if (Game_Flag_Query(714)) { - Actor_Says(0, 6250, 15); - Actor_Says(53, 240, 13); - Delay(1000); - Actor_Says(0, 6255, 17); - Actor_Says(53, 250, 14); - Delay(1000); - } - Actor_Says(53, 260, 12); - Actor_Says(0, 6260, 15); - Actor_Says(53, 270, 13); - Actor_Says(53, 280, 15); - Actor_Says(0, 6265, 14); - Actor_Says(53, 290, 14); - Actor_Says(53, 300, 15); - Actor_Says(0, 6270, 11); - Async_Actor_Walk_To_Waypoint(0, 550, 0, 0); - Async_Actor_Walk_To_Waypoint(53, 551, 0, 0); - Actor_Says(53, 310, -1); - Delay(3000); - Outtake_Play(26, 0, -1); - Game_Over(); - //return true; - return; - } - } else { - if (Actor_Query_Goal_Number(8) == 414) { - Loop_Actor_Walk_To_XYZ(0, -809.0f, 8.26f, -619.0f, 0, 0, false, 0); - Actor_Face_Actor(0, 8, true); - Actor_Set_Goal_Number(8, 415); - } - if (Actor_Query_Goal_Number(1) == 431) { - Actor_Set_Goal_Number(1, 432); - } - //return false; - return; - } -} - -void ScriptKP06::PlayerWalkedOut() { - if (Game_Flag_Query(578) && Actor_Query_Goal_Number(1) == 433) { - Actor_Set_Goal_Number(1, 499); - } -} - -void ScriptKP06::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/kp07.cpp b/engines/bladerunner/script/kp07.cpp deleted file mode 100644 index 1c9f6a7b3f..0000000000 --- a/engines/bladerunner/script/kp07.cpp +++ /dev/null @@ -1,178 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptKP07::InitializeScene() { - Setup_Scene_Information(-12.0f, -41.58f, 72.0f, 0); - Game_Flag_Reset(578); - Scene_Exit_Add_2D_Exit(0, 315, 185, 381, 285, 0); - if (Game_Flag_Query(653)) { - if (Game_Flag_Query(47) && Actor_Query_Goal_Number(3) < 599) { - Actor_Set_Targetable(3, true); - Global_Variable_Increment(51, 1); - Actor_Put_In_Set(3, 48); - Actor_Set_At_XYZ(3, -52.0f, -41.52f, -5.0f, 289); - } - if (Actor_Query_Goal_Number(19) < 599) { - Global_Variable_Increment(51, 1); - Actor_Set_Targetable(19, true); - Actor_Put_In_Set(19, 48); - Actor_Set_At_XYZ(19, -26.0f, -41.52f, -135.0f, 0); - } - if (Game_Flag_Query(44) && Actor_Query_Goal_Number(7) < 599) { - Global_Variable_Increment(51, 1); - Actor_Set_Targetable(7, true); - Actor_Put_In_Set(7, 48); - Actor_Set_At_XYZ(7, -38.0f, -41.52f, -175.0f, 500); - } - if (Game_Flag_Query(45) && Actor_Query_Goal_Number(2) < 599) { - Global_Variable_Increment(51, 1); - Actor_Set_Targetable(2, true); - Actor_Put_In_Set(2, 48); - Actor_Set_At_XYZ(2, 61.0f, -41.52f, -3.0f, 921); - } - if (Game_Flag_Query(46) && Actor_Query_Goal_Number(6) < 599) { - Global_Variable_Increment(51, 1); - Actor_Put_In_Set(6, 48); - Actor_Set_At_XYZ(6, 78.0f, -41.52f, -119.0f, 659); - } - if (Actor_Query_Goal_Number(10) < 599) { - Global_Variable_Increment(51, 1); - Actor_Put_In_Set(10, 48); - Actor_Set_At_XYZ(10, -47.0f, 0.0f, 151.0f, 531); - } - } - Ambient_Sounds_Add_Looping_Sound(585, 7, 1, 1); - Ambient_Sounds_Add_Looping_Sound(586, 52, 1, 1); - Ambient_Sounds_Add_Looping_Sound(109, 38, 1, 1); - if (Game_Flag_Query(582)) { - Scene_Loop_Set_Default(2); - } else { - Scene_Loop_Set_Default(0); - } -} - -void ScriptKP07::SceneLoaded() { - if (!Game_Flag_Query(653)) { - Music_Play(19, 25, 0, 0, -1, 1, 0); - } - Obstacle_Object("BUNK_TRAY01", true); - Unobstacle_Object("BUNK_TRAY01", true); - if (Game_Flag_Query(653)) { - Player_Set_Combat_Mode(false); - Scene_Exits_Disable(); - } -} - -bool ScriptKP07::MouseClick(int x, int y) { - return false; -} - -bool ScriptKP07::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptKP07::ClickedOnActor(int actorId) { - if (actorId == 5) { - if (Game_Flag_Query(697) || actorId != 5 || Actor_Query_Goal_Number(5) == 599 || Actor_Query_Goal_Number(5) == 515) { - return false; - } - if (Game_Flag_Query(653)) { - Actor_Set_Goal_Number(5, 516); - } else { - Music_Play(20, 31, 0, 0, -1, 1, 0); - Actor_Set_Goal_Number(5, 514); - } - } else { - Actor_Face_Actor(0, actorId, true); - Actor_Says(0, 8590, 14); - } - return true; -} - -bool ScriptKP07::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptKP07::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -12.0f, -41.58f, 72.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(579); - Set_Enter(9, 46); - } - return true; - } - return false; -} - -bool ScriptKP07::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptKP07::SceneFrameAdvanced(int frame) { -} - -void ScriptKP07::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptKP07::PlayerWalkedIn() { - Loop_Actor_Walk_To_XYZ(0, 9.0f, -41.88f, -81.0f, 0, 0, false, 0); - if (!Game_Flag_Query(658)) { - if (Game_Flag_Query(653)) { - Actor_Face_Actor(0, 5, true); - Actor_Says(5, 1240, 3); - Actor_Says(0, 8500, 3); - Actor_Says(5, 1250, 3); - if (Actor_Query_Goal_Number(8) == 416) { - Actor_Put_In_Set(8, 48); - Global_Variable_Increment(51, 1); - Actor_Set_At_XYZ(8, -12.0f, -41.58f, 72.0f, 0); - Actor_Face_Actor(8, 5, true); - } - } else { - Actor_Face_Actor(0, 5, true); - Actor_Says(5, 160, 3); - Actor_Retired_Here(5, 72, 60, 0, -1); - } - Game_Flag_Set(658); - } -} - -void ScriptKP07::PlayerWalkedOut() { - Music_Stop(3); -} - -void ScriptKP07::DialogueQueueFlushed(int a1) { - if (Actor_Query_Goal_Number(5) == 515) { - Actor_Set_Targetable(5, false); - Actor_Change_Animation_Mode(5, 21); - Actor_Retired_Here(5, 12, 48, 1, -1); - Actor_Set_Goal_Number(5, 599); - } -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ma01.cpp b/engines/bladerunner/script/ma01.cpp deleted file mode 100644 index 482c31ede9..0000000000 --- a/engines/bladerunner/script/ma01.cpp +++ /dev/null @@ -1,257 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptMA01::InitializeScene() { - Setup_Scene_Information(381.0f, 0.0f, 54.0f, 992); - if (Game_Flag_Query(250)) { - Setup_Scene_Information(381.0f, 0.0f, 54.0f, 992); - } - if (Game_Flag_Query(38)) { - Setup_Scene_Information(1446.0f, 0.0f, -725.0f, 660); - } - Scene_Exit_Add_2D_Exit(0, 328, 132, 426, 190, 0); - if (Game_Flag_Query(250)) { - Scene_Exit_Add_2D_Exit(1, 234, 240, 398, 328, 2); - } - Ambient_Sounds_Add_Looping_Sound(101, 90, 0, 1); - Ambient_Sounds_Add_Looping_Sound(99, 40, -100, 1); - Ambient_Sounds_Add_Looping_Sound(100, 40, 100, 1); - Ambient_Sounds_Add_Sound(68, 10, 100, 25, 50, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(69, 10, 100, 25, 50, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(375, 10, 70, 50, 100, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(376, 10, 70, 50, 100, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(377, 10, 70, 50, 100, 0, 0, -101, -101, 0, 0); - if (Game_Flag_Query(38)) { - Scene_Loop_Set_Default(1); - Game_Flag_Reset(38); - } else { - Actor_Set_Invisible(0, true); - Game_Flag_Set(273); - Scene_Loop_Start_Special(0, 0, 0); - Scene_Loop_Set_Default(1); - } - if (Game_Flag_Query(409)) { - Actor_Set_Goal_Number(53, 3); - Game_Flag_Reset(409); - } -} - -void ScriptMA01::SceneLoaded() { - Obstacle_Object("WRENCH", true); - Unobstacle_Object("OBSTICLEBOX01", true); - Clickable_Object("WRENCH"); - Unclickable_Object("Y2 PADRIM 01"); - Unclickable_Object("Y2 PADRIM 02"); - Unclickable_Object("NGON01"); -} - -bool ScriptMA01::MouseClick(int x, int y) { - return Region_Check(286, 326, 348, 384); -} - -bool ScriptMA01::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptMA01::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptMA01::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptMA01::ClickedOnExit(int exitId) { - if (Actor_Query_Goal_Number(19) == 21) { - return true; - } - if (exitId == 0) { - if (Actor_Query_Goal_Number(19) == 20) { - if (!Loop_Actor_Walk_To_XYZ(0, 1446.0f, 0.0f, -725.0f, 72, 1, false, 0)) { - Actor_Set_Goal_Number(19, 21); - Scene_Exits_Disable(); - } - } else if (!Loop_Actor_Walk_To_XYZ(0, 1446.0f, 0.0f, -725.0f, 12, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(37); - Set_Enter(52, 52); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, 381.0f, 0.0f, 54.0f, 0, 1, false, 0)) { - Player_Loses_Control(); - Actor_Face_Heading(0, 736, false); - Game_Flag_Reset(176); - Game_Flag_Reset(182); - Game_Flag_Reset(179); - Game_Flag_Reset(180); - Game_Flag_Reset(261); - Game_Flag_Reset(177); - Game_Flag_Reset(258); - Game_Flag_Reset(178); - int spinnerDest = Spinner_Interface_Choose_Dest(3, 0); - - switch (spinnerDest) { - case 0: - Game_Flag_Set(178); - Game_Flag_Reset(250); - Game_Flag_Set(251); - Set_Enter(61, 65); - Scene_Loop_Start_Special(1, 4, 1); - break; - case 2: - Game_Flag_Set(182); - Game_Flag_Reset(250); - Game_Flag_Set(249); - Set_Enter(69, 78); - Scene_Loop_Start_Special(1, 4, 1); - break; - case 3: - Game_Flag_Set(176); - Game_Flag_Reset(250); - Game_Flag_Set(248); - Set_Enter(4, 13); - Scene_Loop_Start_Special(1, 4, 1); - break; - case 5: - Game_Flag_Set(261); - Game_Flag_Reset(250); - Game_Flag_Set(307); - Set_Enter(17, 82); - Scene_Loop_Start_Special(1, 4, 1); - break; - case 4: - Game_Flag_Set(180); - Game_Flag_Reset(250); - Game_Flag_Set(252); - Set_Enter(0, 0); - Scene_Loop_Start_Special(1, 4, 1); - break; - case 6: - Game_Flag_Set(177); - Game_Flag_Reset(250); - Game_Flag_Set(253); - Set_Enter(7, 25); - Scene_Loop_Start_Special(1, 4, 1); - break; - case 7: - Game_Flag_Set(258); - Game_Flag_Reset(250); - Game_Flag_Set(254); - Set_Enter(20, 2); - Scene_Loop_Start_Special(1, 4, 1); - break; - case 8: - Game_Flag_Set(181); - Game_Flag_Reset(250); - Game_Flag_Set(255); - Set_Enter(54, 54); - Scene_Loop_Start_Special(1, 4, 1); - break; - case 9: - Game_Flag_Set(257); - Game_Flag_Reset(250); - Game_Flag_Set(256); - Set_Enter(37, 34); - Scene_Loop_Start_Special(1, 4, 1); - break; - default: - Actor_Set_Invisible(0, false); - Actor_Face_Heading(0, 736, false); - Game_Flag_Set(179); - break; - } - } - return true; - } - return false; -} - -bool ScriptMA01::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptMA01::SceneFrameAdvanced(int frame) { - if (frame == 15) { - Ambient_Sounds_Play_Sound(102, 70, -100, 100, 0); - } - if (frame == 61 || frame == 183) { - Ambient_Sounds_Play_Sound(116, 100, 40, 0, 99); - } - if (frame == 107 || frame == 227) { - Ambient_Sounds_Play_Sound(119, 100, 40, 0, 99); - } - if (frame == 1) { - Ambient_Sounds_Play_Sound(118, 40, -60, 20, 99); - } - if (frame == 241) { - Ambient_Sounds_Play_Sound(117, 40, 0, 0, 99); - } - if (frame == 58) { - Sound_Play(122, 17, 20, 20, 50); - } - if ((frame == 75 || frame == 196) && Game_Flag_Query(273)) { - Actor_Face_Heading(0, 736, false); - Actor_Change_Animation_Mode(0, 42); - Game_Flag_Reset(273); - } else { - if (frame == 196 && !Game_Flag_Query(273)) { - Actor_Change_Animation_Mode(0, 41); - //return true; - return; - } - if (frame == 240) { - Player_Gains_Control(); - } - } - //return true; -} - -void ScriptMA01::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptMA01::PlayerWalkedIn() { -} - -void ScriptMA01::PlayerWalkedOut() { - Actor_Set_Invisible(0, false); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - if (!Game_Flag_Query(37) && Global_Variable_Query(1) == 1) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Outtake_Play(37, 1, -1); - Outtake_Play(34, 1, -1); - Outtake_Play(36, 1, -1); - } -} - -void ScriptMA01::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ma02.cpp b/engines/bladerunner/script/ma02.cpp deleted file mode 100644 index 6448b93caa..0000000000 --- a/engines/bladerunner/script/ma02.cpp +++ /dev/null @@ -1,267 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptMA02::InitializeScene() { - if (Game_Flag_Query(36)) { - Setup_Scene_Information(-172.0f, -144.13f, 6.27f, 500); - } else { - Setup_Scene_Information(23.19f, -144.12f, 378.27f, 750); - if (Global_Variable_Query(1) == 4) { - Actor_Set_Goal_Number(40, 300); - } - Game_Flag_Reset(711); - } - Scene_Exit_Add_2D_Exit(0, 538, 84, 639, 327, 1); - Scene_Exit_Add_2D_Exit(1, 56, 98, 150, 260, 0); - if (Global_Variable_Query(1) >= 4 && Global_Variable_Query(1) == 5 && Game_Flag_Query(653)) { - Actor_Set_Goal_Number(66, 599); - Actor_Change_Animation_Mode(66, 88); - Actor_Put_In_Set(66, 10); - Actor_Set_At_XYZ(66, -35.51f, -144.12f, 428.0f, 0); - Actor_Retired_Here(66, 24, 24, 1, -1); - } - Ambient_Sounds_Add_Looping_Sound(104, 12, 0, 1); - Ambient_Sounds_Add_Looping_Sound(71, 25, 0, 1); - Ambient_Sounds_Add_Sound(72, 5, 30, 5, 5, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(73, 5, 30, 5, 5, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(74, 5, 30, 5, 5, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(375, 10, 60, 20, 20, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(376, 10, 60, 20, 20, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(87, 10, 60, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(68, 60, 180, 14, 14, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(69, 60, 180, 14, 14, 0, 0, -101, -101, 0, 0); - if (sub_401F7C()) { - Ambient_Sounds_Add_Sound(403, 3, 3, 27, 27, -100, -100, -100, -100, 99, 0); - } - if (Global_Variable_Query(1) == 5 && Game_Flag_Query(653) && !Actor_Clue_Query(0, 264)) { - Overlay_Play("MA02OVER", 0, 1, 0, 0); - } -} - -void ScriptMA02::SceneLoaded() { - Obstacle_Object("COUCH1", true); - Unobstacle_Object("COUCH1", true); - Clickable_Object("BAR-MAIN"); - Clickable_Object("E-ESPER"); -} - -bool ScriptMA02::MouseClick(int x, int y) { - return false; -} - -bool ScriptMA02::ClickedOn3DObject(const char *objectName, bool a2) { - if (Object_Query_Click("E-ESPER", objectName)) { - Actor_Face_Object(0, "E-ESPER", true); - Delay(1000); - ESPER_Flag_To_Activate(); - return true; - } - if (Object_Query_Click("BAR-MAIN", objectName) && !Loop_Actor_Walk_To_XYZ(0, -29.0f, -140.4f, 298.0f, 36, 1, false, 0)) { - Actor_Face_Object(0, "BAR-MAIN", true); - if (Global_Variable_Query(1) < 4) { - Actor_Set_Goal_Number(66, 3); - } else if (Global_Variable_Query(1) == 5 && Game_Flag_Query(653) && !Actor_Clue_Query(0, 264)) { - Overlay_Remove("MA02OVER"); - Item_Pickup_Spin_Effect(985, 480, 240); - Actor_Voice_Over(1150, 99); - Actor_Voice_Over(1160, 99); - Actor_Voice_Over(1170, 99); - Actor_Voice_Over(1180, 99); - Actor_Voice_Over(1190, 99); - Actor_Voice_Over(1200, 99); - Actor_Clue_Acquire(0, 264, 1, -1); - } else { - Actor_Says(0, 8526, 0); - } - return true; - } - return false; -} - -bool ScriptMA02::ClickedOnActor(int actorId) { - if (actorId == 66 && Actor_Query_Goal_Number(66) == 599) { - if (!Loop_Actor_Walk_To_Actor(0, 66, 30, 1, false)) { - Actor_Face_Actor(0, 66, true); - Actor_Voice_Over(1140, 99); - } - } - return false; -} - -bool ScriptMA02::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptMA02::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, 23.19f, -144.12f, 378.27f, 0, 1, false, 0)) { - Music_Stop(10); - Game_Flag_Set(33); - Set_Enter(52, 52); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -168.0f, -144.13f, 10.27f, 0, 1, false, 0)) { - Game_Flag_Set(35); - Set_Enter(50, 50); - } - return true; - } - return false; -} - -bool ScriptMA02::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptMA02::SceneFrameAdvanced(int frame) { -} - -void ScriptMA02::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptMA02::PlayerWalkedIn() { - if (Game_Flag_Query(34)) { - sub_402044(); - } - if (Game_Flag_Query(36)) { - Loop_Actor_Walk_To_XYZ(0, -148.12f, -144.13f, 34.27f, 0, 1, false, 0); - } - if (Global_Variable_Query(1) == 4 && !Game_Flag_Query(655)) { - Game_Flag_Set(623); - Game_Flag_Set(655); - sub_401E4C(); - Loop_Actor_Walk_To_XYZ(0, 23.19f, -144.12f, 378.27f, 0, 0, false, 0); - Game_Flag_Set(33); - Set_Enter(52, 52); - // return true; - return; - } - if (Global_Variable_Query(1) == 5 && !Game_Flag_Query(654)) { - if (Game_Flag_Query(653)) { - Actor_Says(0, 2390, 0); - Music_Play(2, 25, 0, 3, -1, 0, 0); - } else { - Actor_Says(0, 2385, 3); - } - Game_Flag_Set(654); - Autosave_Game(3); - } - if (Global_Variable_Query(1) < 4 && !Game_Flag_Query(36) && Actor_Query_Goal_Number(66) != 2) { - Actor_Set_Goal_Number(66, 1); - if (!Game_Flag_Query(60)) { - Game_Flag_Set(60); - Actor_Face_Actor(0, 66, true); - Actor_Voice_Over(1210, 99); - if (!Game_Flag_Query(378)) { - Actor_Voice_Over(1220, 99); - } - Actor_Voice_Over(1230, 99); - if (!Game_Flag_Query(378)) { - Actor_Voice_Over(1240, 99); - Actor_Voice_Over(1250, 99); - } - } - } - Game_Flag_Reset(36); - Game_Flag_Reset(34); - //return false; - return; -} - -void ScriptMA02::PlayerWalkedOut() { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); -} - -void ScriptMA02::DialogueQueueFlushed(int a1) { -} - -void ScriptMA02::sub_401E4C() { - Actor_Says(0, 2365, 13); - Actor_Says(40, 0, 13); - Actor_Says(0, 2370, 13); - Actor_Says(40, 10, 13); - Actor_Says(0, 2375, 13); - Actor_Says(40, 20, 13); - Actor_Says(0, 2380, 13); - Sound_Play(492, 100, 0, 100, 50); - Actor_Says(40, 40, 13); - Delay(3000); -} - -bool ScriptMA02::sub_401F7C() { - return Global_Variable_Query(1) == 5 - && !Actor_Clue_Query(0, 143) - && !Actor_Clue_Query(0, 144) - && !Actor_Clue_Query(0, 139) - && !Actor_Clue_Query(0, 140) - && !Actor_Clue_Query(0, 141) - && !Actor_Clue_Query(0, 142); -} - -void ScriptMA02::sub_402044() { - // int v0; - // int v1; - // int v3[7]; - - // v0 = 0; - - int i = 0; - int arr[7]; - if (Global_Variable_Query(1) < 4 && Game_Flag_Query(45)) { - // v0 = 1; - // v3[0] = 0; - arr[i++] = 0; - } - - // v1 = v0 + 1; - // v3[v0] = 1; - arr[i++] = 1; - if (Global_Variable_Query(1) >= 3) { - // v3[v1] = 2; - // v1 = v0 + 2; - arr[i++] = 2; - } - if (Global_Variable_Query(1) >= 2 && Global_Variable_Query(1) <= 4) { - // v3[v1++] = 3; - arr[i++] = 3; - } - if (Game_Flag_Query(171) && Game_Flag_Query(170)) { - // v3[v1++] = 4; - arr[i++] = 4; - } - //if (v1 <= 0) { - if (i == 0) { - Global_Variable_Set(52, -1); - } else { - // Global_Variable_Set(52, v3[Random_Query(0, v1 - 1)]); - Global_Variable_Set(52, arr[Random_Query(0, i - 1)]); - } -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ma04.cpp b/engines/bladerunner/script/ma04.cpp deleted file mode 100644 index f31c73275d..0000000000 --- a/engines/bladerunner/script/ma04.cpp +++ /dev/null @@ -1,565 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptMA04::InitializeScene() { - if (Game_Flag_Query(63)) { - Setup_Scene_Information(-7199.0f, 953.97f, 1579.0f, 502); - if (Global_Variable_Query(1) != 2 && Global_Variable_Query(1) != 3) { - Scene_Loop_Start_Special(0, 0, 0); - } - } else if (Game_Flag_Query(35)) { - Setup_Scene_Information(-7099.0f, 954.0f, 1866.0f, 502); - } else if (Game_Flag_Query(647)) { - Setup_Scene_Information(-7107.0f, 954.0f, 1742.0f, 502); - Scene_Loop_Start_Special(0, 4, 0); - } else { - Setup_Scene_Information(-7143.0f, 954.0f, 1868.0f, 733); - } - Scene_Exit_Add_2D_Exit(0, 496, 0, 639, 354, 1); - Scene_Exit_Add_2D_Exit(1, 33, 63, 113, 258, 0); - Scene_Exit_Add_2D_Exit(2, 248, 98, 314, 284, 1); - Scene_2D_Region_Add(0, 343, 97, 353, 190); - Scene_2D_Region_Add(1, 0, 340, 116, 479); - Ambient_Sounds_Add_Looping_Sound(408, 30, 0, 1); - Ambient_Sounds_Add_Looping_Sound(103, 30, -80, 1); - Ambient_Sounds_Add_Looping_Sound(104, 12, 0, 1); - Ambient_Sounds_Add_Sound(72, 5, 30, 11, 11, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(73, 5, 30, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(74, 5, 30, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(375, 10, 60, 20, 20, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(376, 10, 60, 20, 20, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(87, 10, 60, 16, 16, -100, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(68, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(69, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0); - if (sub_402758()) { - Ambient_Sounds_Add_Sound(403, 3, 3, 100, 100, 0, 0, 0, 0, 99, 0); - } - Scene_Loop_Set_Default(1); -} - -void ScriptMA04::SceneLoaded() { - Obstacle_Object("BED-DOG DISH", true); - Unobstacle_Object("BEDDog BONE", true); - Unobstacle_Object("BED-BOOK1", true); - Clickable_Object("BED-SHEETS"); - if (Game_Flag_Query(711)) { - Unclickable_Object("BED-TV-1"); - Unclickable_Object("BED-TV-2"); - } else { - Clickable_Object("BED-TV-1"); - Clickable_Object("BED-TV-2"); - } -} - -bool ScriptMA04::MouseClick(int x, int y) { - return false; -} - -bool ScriptMA04::ClickedOn3DObject(const char *objectName, bool a2) { - if (Object_Query_Click("BED-SHEETS", objectName)) { - sub_403DA8(); - return false; - } - if (Object_Query_Click("BED-TV-1", objectName) || Object_Query_Click("BED-TV-2", objectName)) { - if (!Loop_Actor_Walk_To_Scene_Object(0, "BED-TV-2", 24, 1, false)) { - Game_Flag_Set(711); - Unclickable_Object("BED-TV-1"); - Unclickable_Object("BED-TV-2"); - Sound_Play(132, 100, 0, 0, 50); - sub_403864(); - return false; - } - return true; - } - return false; -} - -bool ScriptMA04::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptMA04::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptMA04::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -7099.0f, 954.0f, 1866.0f, 0, 1, false, 0)) { - Game_Flag_Set(36); - Set_Enter(10, 49); - } - return true; - } - if (exitId == 1) { - float x, y, z; - Actor_Query_XYZ(0, &x, &y, &z); - if (z <= 1677.0f || !Loop_Actor_Walk_To_XYZ(0, -7199.0f, 955.0f, 1675.0f, 0, 1, false, 0)) { - if (sub_402888()) { - Overlay_Remove("MA04OVER"); - } - Loop_Actor_Walk_To_XYZ(0, -7199.0f, 955.0f, 1675.0f, 0, 0, false, 1); - Game_Flag_Set(62); - if (Global_Variable_Query(1) != 2 && Global_Variable_Query(1) != 3) { - Async_Actor_Walk_To_XYZ(0, -7199.0f, 956.17f, 1568.0f, 0, false); - } - Set_Enter(51, 51); - } - return true; - } - if (exitId == 2) { - if (!Loop_Actor_Walk_To_XYZ(0, -7115.0f, 954.0f, 1742.0f, 0, 1, false, 0)) { - int sounds[] = {252, 405, 404, 407, 406}; - Ambient_Sounds_Play_Sound(sounds[Random_Query(0, 4)], 50, 0, 0, 0); - Delay(3000); - Loop_Actor_Walk_To_XYZ(0, -7139.0f, 954.0f, 1746.0f, 0, 1, false, 1); - } - } - return false; -} - -bool ScriptMA04::ClickedOn2DRegion(int region) { - if (Player_Query_Combat_Mode()) { - return false; - } - if (region == 1) { - sub_403DA8(); - return true; - } - if (region == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -7176.0f, 954.0f, 1806.0f, 0, 1, false, 0)) { - Actor_Face_Heading(0, 256, false); - if (sub_402758()) { - Actor_Says(0, 2680, 0); - Ambient_Sounds_Remove_Sound(403, true); - Sound_Play(123, 100, 0, 0, 50); - Overlay_Remove("MA04OVER"); - Delay(500); - if (Game_Flag_Query(653)) { - if (Global_Variable_Query(45) == 2) { - sub_4028A8(); - } else if (Global_Variable_Query(45) == 3) { - sub_402F2C(); - } else { - sub_4034D8(); - } - } else { - sub_4032A0(); - } - Music_Play(2, 52, 0, 3, -1, 0, 0); - return false; - } - if (Actor_Clue_Query(5, 222) && !Game_Flag_Query(649)) { - Sound_Play(123, 100, 0, 0, 50); - Overlay_Remove("MA04OVER"); - Delay(500); - Actor_Says(5, 310, 3); - Actor_Says(5, 320, 3); - if (!Game_Flag_Query(378) && Global_Variable_Query(1) < 3) { - Actor_Voice_Over(1300, 99); - Actor_Voice_Over(1310, 99); - Actor_Voice_Over(1320, 99); - } - Actor_Says(0, 2445, 13); - Sound_Play(123, 100, 0, 0, 50); - Game_Flag_Set(649); - return true; - } - if (Actor_Clue_Query(6, 215) && !Game_Flag_Query(650)) { - Sound_Play(123, 100, 0, 0, 50); - Overlay_Remove("MA04OVER"); - Delay(500); - Actor_Says(6, 500, 3); - Actor_Says(6, 510, 3); - if (!Game_Flag_Query(378) && Global_Variable_Query(1) < 3) { - Actor_Voice_Over(1330, 99); - Actor_Voice_Over(1340, 99); - Actor_Voice_Over(1350, 99); - } - Actor_Says(0, 2445, 13); - Sound_Play(123, 100, 0, 0, 50); - Game_Flag_Set(650); - return true; - } - Actor_Says(0, 2670, 13); - if (!Game_Flag_Query(378)) { - Actor_Says(0, 2675, 17); - } - } - return true; - } - return false; -} - -void ScriptMA04::SceneFrameAdvanced(int frame) { - Set_Fade_Color(0, 0, 0); - if (frame >= 91 && frame < 121) { - Set_Fade_Density((frame - 91) / 30.0f); - } else if (frame >= 121 && frame < 151) { - Set_Fade_Density((151 - frame) / 30.0f); - } else { - Set_Fade_Density(0.0f); - } - if (frame == 121 && (Game_Flag_Query(40) == 1 || Game_Flag_Query(41) == 1) && !Game_Flag_Query(159)) { - Sound_Play(403, 50, 0, 0, 50); - } -} - -void ScriptMA04::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptMA04::PlayerWalkedIn() { - if (Game_Flag_Query(647)) { - Player_Gains_Control(); - } - if (sub_402820() || sub_402758()) { - Overlay_Play("MA04OVER", 0, 1, 0, 0); - } - if (Game_Flag_Query(647)) { - Loop_Actor_Walk_To_XYZ(0, -7139.0f, 954.0f, 1746.0f, 0, 1, false, 0); - } else if (Game_Flag_Query(35)) { - Loop_Actor_Walk_To_XYZ(0, -7143.0f, 954.0f, 1868.0f, 0, 1, false, 0); - } - Game_Flag_Reset(35); - Game_Flag_Reset(63); - Game_Flag_Reset(647); - if (Game_Flag_Query(61)) { - if (Global_Variable_Query(1) == 2 && !Actor_Clue_Query(0, 43)) { - Sound_Play(403, 100, 0, 0, 50); - Loop_Actor_Walk_To_XYZ(0, -7176.0f, 954.0f, 1806.0f, 0, 0, false, 0); - Actor_Face_Heading(0, 256, true); - Actor_Says(0, 2680, 0); - Sound_Play(123, 100, 0, 0, 50); - Delay(500); - Actor_Says(4, 0, 3); - Actor_Says(0, 2685, 13); - Actor_Says(4, 10, 3); - Actor_Says(0, 2690, 17); - Actor_Says(4, 30, 3); - Actor_Says(0, 2695, 12); - Actor_Says(4, 40, 3); - Actor_Says(4, 50, 3); - Actor_Says(0, 2700, 3); - Actor_Says(4, 60, 3); - Actor_Says(4, 70, 3); - Sound_Play(123, 100, 0, 0, 50); - Actor_Clue_Acquire(0, 43, 1, 4); - Spinner_Set_Selectable_Destination_Flag(5, 1); - Game_Flag_Set(186); - if (!Game_Flag_Query(163)) { - Game_Flag_Set(163); - Item_Remove_From_World(66); - } - Actor_Set_Goal_Number(23, 99); - Actor_Put_In_Set(23, 93); - Actor_Set_At_Waypoint(23, 35, 0); - Autosave_Game(0); - } - //return false; - return; - } - if ((Game_Flag_Query(40) || Game_Flag_Query(41)) && !Game_Flag_Query(146)) { - Music_Play(2, 52, 0, 2, -1, 0, 0); - Player_Loses_Control(); - Loop_Actor_Walk_To_XYZ(0, -7199.0f, 955.0f, 1677.0f, 0, 1, false, 0); - if (sub_402820() || sub_402758()) { - Overlay_Remove("MA04OVER"); - } - Loop_Actor_Walk_To_XYZ(0, -7199.0f, 955.0f, 1675.0f, 0, 1, false, 0); - Game_Flag_Set(146); - Async_Actor_Walk_To_XYZ(0, -7204.0f, 956.17f, 1568.0f, 0, false); - Set_Enter(51, 51); - } -} - -void ScriptMA04::PlayerWalkedOut() { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - if (Game_Flag_Query(678)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Outtake_Play(1, 0, -1); - Game_Flag_Reset(678); - } -} - -void ScriptMA04::DialogueQueueFlushed(int a1) { - Overlay_Remove("MA04OVR2"); -} - -bool ScriptMA04::sub_402758() { - return Global_Variable_Query(1) == 5 && !Actor_Clue_Query(0, 143) && !Actor_Clue_Query(0, 144) && !Actor_Clue_Query(0, 139) && !Actor_Clue_Query(0, 140) && !Actor_Clue_Query(0, 141) && !Actor_Clue_Query(0, 142); -} - -bool ScriptMA04::sub_402820() { - return (Actor_Clue_Query(5, 222) && !Game_Flag_Query(649)) || (Actor_Clue_Query(6, 215) && !Game_Flag_Query(650)); -} - -bool ScriptMA04::sub_402888() { - return sub_402820() || sub_402758(); -} - -void ScriptMA04::sub_4028A8() { - int answer; - Actor_Says(3, 220, 3); - Actor_Says(0, 2460, 0); - Actor_Says(3, 230, 3); - Actor_Says(3, 240, 3); - Actor_Says(0, 2465, 0); - Actor_Says(3, 250, 3); - Actor_Says_With_Pause(0, 2470, 1.5f, 17); - Actor_Says(3, 260, 3); - Actor_Says(0, 2475, 15); - Actor_Says(3, 270, 3); - Actor_Says(0, 2480, 0); - Actor_Says(3, 280, 3); - Actor_Says(3, 290, 3); - Actor_Says(0, 2485, 19); - Actor_Says(3, 300, 3); - Actor_Says(3, 310, 3); - Actor_Says(0, 2490, 0); - Actor_Says(3, 330, 3); - Actor_Says(0, 2495, 0); - Actor_Says(3, 340, 3); - Actor_Says(3, 350, 3); - if (Game_Flag_Query(165) || Actor_Query_Goal_Number(9) == 2) { - answer = 1170; - } else { - Dialogue_Menu_Clear_List(); - DM_Add_To_List_Never_Repeat_Once_Selected(1160, 1, 1, 2); - DM_Add_To_List_Never_Repeat_Once_Selected(1170, 2, 1, 1); - Dialogue_Menu_Appear(320, 240); - answer = Dialogue_Menu_Query_Input(); - Dialogue_Menu_Disappear(); - } - if (answer == 1160) { - Actor_Says(0, 2500, 19); - Actor_Says(3, 360, 3); - Actor_Says(0, 2510, 0); - Actor_Says(3, 370, 3); - Actor_Says(3, 380, 3); - Actor_Says(0, 2515, 12); - Actor_Says(3, 390, 3); - Actor_Says(0, 2520, 13); - Actor_Says(3, 400, 3); - Actor_Says(3, 410, 3); - Actor_Says(0, 2525, 15); - Actor_Says(3, 420, 3); - Sound_Play(123, 100, 0, 0, 50); - Actor_Clue_Acquire(0, 139, 1, -1); - } else { - Actor_Says_With_Pause(0, 2505, 0.5f, 19); - Actor_Says(3, 430, 3); - Actor_Says(3, 440, 3); - Actor_Says(0, 2530, 0); - Actor_Says(3, 450, 3); - Actor_Says(0, 2535, 12); - Actor_Says(3, 460, 3); - Actor_Says_With_Pause(3, 470, 1.0f, 3); - Actor_Says(3, 480, 3); - Actor_Says(3, 490, 3); - Sound_Play(123, 100, 0, 0, 50); - Actor_Says(0, 2540, 15); - Actor_Clue_Acquire(0, 140, 1, -1); - } -} - -void ScriptMA04::sub_402F2C() { - Actor_Says(6, 530, 3); - Actor_Says(0, 2545, 19); - Actor_Says(6, 540, 3); - Actor_Says(6, 550, 3); - Actor_Says(0, 2550, 13); - Actor_Says(6, 560, 3); - Actor_Says(0, 2555, 19); - Actor_Says(6, 570, 3); - Actor_Says(0, 2560, 17); - Actor_Says(6, 580, 3); - if (Game_Flag_Query(165) || Actor_Query_Goal_Number(9) == 2) { - Actor_Says(6, 630, 3); - Actor_Says_With_Pause(0, 2575, 0.0f, 15); - if (!Game_Flag_Query(378)) { - Actor_Says(6, 640, 3); - } - Actor_Clue_Acquire(0, 142, 1, -1); - } else { - Actor_Says(6, 590, 3); - Actor_Says(0, 2565, 12); - Actor_Says(6, 600, 3); - Actor_Says(6, 610, 3); - Actor_Says(6, 620, 3); - Actor_Says(0, 2570, 13); - Actor_Says_With_Pause(6, 630, 0.0f, 3); - Actor_Says_With_Pause(0, 2575, 0.0f, 15); - if (!Game_Flag_Query(378)) { - Actor_Says(6, 640, 3); - } - Actor_Clue_Acquire(0, 141, 1, -1); - } - Sound_Play(123, 100, 0, 0, 50); -} - -void ScriptMA04::sub_4032A0() { - Actor_Says(1, 680, 3); - Actor_Says(0, 2630, 17); - Actor_Says(1, 690, 3); - Actor_Says(0, 2635, 18); - Actor_Says(1, 700, 3); - Actor_Says(0, 2640, 14); - Actor_Says(1, 710, 3); - Actor_Says(1, 720, 3); - Actor_Says(0, 2645, 13); - Actor_Says(1, 740, 3); - Actor_Says(1, 750, 3); - Actor_Says(0, 2650, 12); - Actor_Says(1, 760, 3); - Actor_Says(0, 2665, 13); - Actor_Says(1, 810, 3); - Actor_Says(1, 820, 3); - Sound_Play(123, 100, 0, 0, 50); - Actor_Clue_Acquire(0, 144, 1, -1); -} - -void ScriptMA04::sub_4034D8() { - Actor_Says(5, 330, 3); - Actor_Says(0, 2580, 14); - Actor_Says(5, 340, 3); - Actor_Says(0, 2585, 19); - Actor_Says(5, 350, 3); - Actor_Says(5, 360, 3); - Actor_Says(0, 2590, 18); - Actor_Says(5, 370, 3); - Actor_Says(0, 2595, 15); - Actor_Says(5, 390, 3); - Actor_Says(5, 400, 3); - Actor_Says(5, 410, 3); - Actor_Says(0, 2600, 15); - Actor_Says_With_Pause(5, 420, 1.5f, 3); - Actor_Says(0, 2605, 17); - Actor_Says(5, 430, 3); - Actor_Says(5, 440, 3); - Actor_Says(0, 2610, 3); - Actor_Says(5, 450, 3); - Actor_Says(5, 460, 3); - Actor_Says(5, 470, 3); - Actor_Says(5, 480, 3); - Actor_Says(5, 490, 3); - Actor_Says(0, 2615, 17); - Actor_Says(5, 500, 3); - Actor_Says(5, 530, 3); - Actor_Says(5, 540, 3); - Sound_Play(123, 100, 0, 0, 50); - Actor_Clue_Acquire(0, 143, 1, -1); -} - -void ScriptMA04::sub_403864() { - Overlay_Play("MA04OVR2", 0, 1, 0, 0); - switch (Global_Variable_Query(52)) { - case 4: - ADQ_Add(61, 230, 3); - ADQ_Add(61, 240, 3); - break; - case 3: - ADQ_Add(61, 170, 3); - ADQ_Add(61, 180, 3); - ADQ_Add(61, 190, 3); - ADQ_Add(61, 200, 3); - ADQ_Add(61, 210, 3); - ADQ_Add(61, 220, 3); - ADQ_Add(41, 80, 3); - ADQ_Add(41, 90, 3); - ADQ_Add(41, 100, 3); - ADQ_Add(41, 110, 3); - ADQ_Add(41, 120, 3); - ADQ_Add(41, 130, 3); - break; - case 2: - if (Actor_Query_Friendliness_To_Other(5, 0) <= Actor_Query_Friendliness_To_Other(1, 0)) { - ADQ_Add(61, 90, 3); - ADQ_Add(61, 100, 3); - ADQ_Add(61, 110, 3); - ADQ_Add(4, 1540, 3); - ADQ_Add(4, 1550, 3); - ADQ_Add(4, 1560, 3); - } else { - ADQ_Add(61, 120, 3); - ADQ_Add(61, 130, 3); - ADQ_Add(61, 140, 3); - ADQ_Add(61, 150, 3); - ADQ_Add(4, 1570, 3); - ADQ_Add(4, 1580, 3); - ADQ_Add(4, 1590, 3); - } - break; - case 1: - ADQ_Add(61, 40, 3); - ADQ_Add(61, 50, 3); - ADQ_Add(61, 60, 3); - ADQ_Add(61, 70, 3); - ADQ_Add(61, 80, 3); - break; - case 0: - ADQ_Add(61, 0, 3); - ADQ_Add(61, 10, 3); - ADQ_Add(61, 20, 3); - ADQ_Add(61, 30, 3); - ADQ_Add(51, 430, 3); - ADQ_Add(51, 440, 3); - ADQ_Add(51, 450, 3); - ADQ_Add(51, 460, 3); - break; - } -} - -void ScriptMA04::sub_403DA8() { - if (!Loop_Actor_Walk_To_Scene_Object(0, "BED-SHEETS", 12, 1, false)) { - Actor_Says(0, 8530, 12); - Music_Stop(4); - if (sub_402820() || sub_402758()) { - Overlay_Remove("MA04OVER"); - } - Player_Loses_Control(); - Game_Flag_Set(647); - if ((Game_Flag_Query(40) || Game_Flag_Query(41)) && Global_Variable_Query(1) == 1) { - if (Actor_Query_Goal_Number(19) == 599) { - Actor_Put_In_Set(19, 91); - Actor_Set_At_Waypoint(19, 33, 0); - } - Game_Flag_Set(678); - Global_Variable_Set(1, 2); - Chapter_Enter(2, 10, 50); - if (Query_Difficulty_Level() != 0) { - if (!Game_Flag_Query(723)) { - Global_Variable_Increment(2, 200); - } - } - } else { - Set_Enter(10, 50); - } - Scene_Loop_Start_Special(1, 3, 0); - } -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ma05.cpp b/engines/bladerunner/script/ma05.cpp deleted file mode 100644 index 839d91388e..0000000000 --- a/engines/bladerunner/script/ma05.cpp +++ /dev/null @@ -1,142 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptMA05::InitializeScene() { - if (Global_Variable_Query(1) != 2 && Global_Variable_Query(1) != 3) { - Setup_Scene_Information(-7204.0f, 953.97f, 1651.0f, 0); - } else { - Setup_Scene_Information(-7207.0f, 956.17f, 1564.0f, 0); - } - Scene_Exit_Add_2D_Exit(0, 432, 21, 471, 226, 1); - Ambient_Sounds_Add_Looping_Sound(101, 90, 0, 1); - Ambient_Sounds_Add_Looping_Sound(99, 40, -100, 1); - Ambient_Sounds_Add_Looping_Sound(103, 50, 60, 1); - Ambient_Sounds_Add_Speech_Sound(60, 0, 10, 260, 27, 47, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 20, 10, 260, 27, 47, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 40, 10, 260, 27, 47, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 50, 10, 260, 27, 47, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Sound(68, 10, 100, 25, 50, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(69, 10, 100, 25, 50, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(375, 10, 70, 50, 100, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(376, 10, 70, 50, 100, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(87, 10, 70, 25, 25, -100, 0, -101, -101, 0, 0); - if (sub_401990()) { - Ambient_Sounds_Add_Sound(403, 3, 3, 32, 32, 100, 100, -101, -101, 0, 0); - } - if (Global_Variable_Query(1) != 2 && Global_Variable_Query(1) != 3) { - Scene_Loop_Start_Special(0, 0, 0); - } - Scene_Loop_Set_Default(1); -} - -void ScriptMA05::SceneLoaded() { - Obstacle_Object("Z-BOX-RAIL03", true); - Footstep_Sounds_Set(0, 0); - Footstep_Sounds_Set(1, 3); -} - -bool ScriptMA05::MouseClick(int x, int y) { - return false; -} - -bool ScriptMA05::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptMA05::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptMA05::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptMA05::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -7199.0f, 956.17f, 1579.0f, 0, 0, false, 0)) { - Loop_Actor_Walk_To_XYZ(0, -7199.0f, 956.17f, 1579.0f, 0, 0, false, 0); - Game_Flag_Set(63); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Async_Actor_Walk_To_XYZ(0, -7199.0f, 953.97f, 1685.0f, 0, false); - Set_Enter(50, 50); - } - return true; - } - return false; -} - -bool ScriptMA05::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptMA05::SceneFrameAdvanced(int frame) { - if (frame == 20) { - Sound_Play(102, 70, -100, 100, 50); - } - //return true; -} - -void ScriptMA05::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptMA05::PlayerWalkedIn() { - Music_Play(2, 52, 0, 2, -1, 0, 0); - if ((Random_Query(0, 4) == 1 || (Game_Flag_Query(146) == 1 && !Game_Flag_Query(61))) && Global_Variable_Query(1) == 1) { - Scene_Loop_Set_Default(1); - Scene_Loop_Start_Special(2, 3, 1); - Sound_Play(69, 100, 0, 0, 50); - } - if (Game_Flag_Query(146) && !Game_Flag_Query(61)) { - if (!Game_Flag_Query(378)) { - Actor_Voice_Over(1260, 99); - Actor_Voice_Over(1270, 99); - Actor_Voice_Over(1280, 99); - Actor_Voice_Over(1290, 99); - } - Game_Flag_Set(61); - Player_Gains_Control(); - } - //return false; -} - -void ScriptMA05::PlayerWalkedOut() { -} - -void ScriptMA05::DialogueQueueFlushed(int a1) { -} - -bool ScriptMA05::sub_401990() { - return Global_Variable_Query(1) == 5 - && !Actor_Clue_Query(0, 143) - && !Actor_Clue_Query(0, 144) - && !Actor_Clue_Query(0, 139) - && !Actor_Clue_Query(0, 140) - && !Actor_Clue_Query(0, 141) - && !Actor_Clue_Query(0, 142); -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ma06.cpp b/engines/bladerunner/script/ma06.cpp deleted file mode 100644 index caea6cd293..0000000000 --- a/engines/bladerunner/script/ma06.cpp +++ /dev/null @@ -1,154 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptMA06::InitializeScene() { - Setup_Scene_Information(40.0f, 1.0f, -20.0f, 400); - Ambient_Sounds_Add_Looping_Sound(210, 50, 0, 1); - Ambient_Sounds_Add_Looping_Sound(408, 33, 0, 1); - Scene_Loop_Start_Special(0, 0, 0); - Scene_Loop_Set_Default(1); - Sound_Play(209, 100, 50, 50, 100); -} - -void ScriptMA06::SceneLoaded() { - Obstacle_Object("PANEL", true); - Clickable_Object("PANEL"); - Player_Loses_Control(); -} - -bool ScriptMA06::MouseClick(int x, int y) { - return false; -} - -bool ScriptMA06::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptMA06::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptMA06::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptMA06::ClickedOnExit(int exitId) { - return false; -} - -bool ScriptMA06::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptMA06::SceneFrameAdvanced(int frame) { -} - -void ScriptMA06::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptMA06::PlayerWalkedIn() { - Loop_Actor_Walk_To_XYZ(0, 40.0f, 1.35f, 0.0f, 0, 0, false, 0); - Actor_Face_Object(0, "panel", true); - Delay(500); - sub_4014E4(); - if (sub_4012C0()) { - Sound_Play(114, 25, 0, 0, 50); - Delay(4000); - } - Game_Flag_Reset(37); - Game_Flag_Reset(33); - Game_Flag_Reset(57); - if (Game_Flag_Query(38)) { - Set_Enter(49, 48); - } else if (Game_Flag_Query(34)) { - Set_Enter(10, 49); - } else { - Set_Enter(53, 53); - } - Scene_Loop_Start_Special(1, 3, 1); - Sound_Play(208, 100, 50, 50, 50); - //return true; -} - -void ScriptMA06::PlayerWalkedOut() { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Player_Gains_Control(); -} - -void ScriptMA06::DialogueQueueFlushed(int a1) { -} - -bool ScriptMA06::sub_4012C0() { - return (Game_Flag_Query(37) && !Game_Flag_Query(38)) || (Game_Flag_Query(33) && !Game_Flag_Query(34)) || (Game_Flag_Query(57) && !Game_Flag_Query(58)); -} - -void ScriptMA06::sub_4014E4() { - Game_Flag_Reset(38); - Game_Flag_Reset(34); - Game_Flag_Reset(58); - while (true) { - if (Game_Flag_Query(34)) { - break; - } - if (Game_Flag_Query(38)) { - break; - } - if (Game_Flag_Query(58)) { - break; - } - Actor_Says(39, 80, 3); - Player_Gains_Control(); - int v1 = Elevator_Activate(1); - Player_Loses_Control(); - Scene_Loop_Start_Special(2, 1, 1); - if (v1 > 1) { - Game_Flag_Set(58); - } else if (v1 == 1) { - if (Game_Flag_Query(250)) { - Game_Flag_Set(38); - } else { - Sound_Play(412, 100, 0, 0, 50); - Delay(500); - Actor_Says(39, 610, 3); - } - } else { - Actor_Says(0, 2940, 18); - if (Global_Variable_Query(1) == 4 && Game_Flag_Query(655)) { - Sound_Play(412, 100, 0, 0, 50); - Delay(500); - Actor_Says(39, 610, 3); - Delay(500); - Actor_Says(0, 8527, 3); - } else { - Game_Flag_Set(34); - Actor_Says(39, 90, 3); - } - } - } -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ma07.cpp b/engines/bladerunner/script/ma07.cpp deleted file mode 100644 index 4222453302..0000000000 --- a/engines/bladerunner/script/ma07.cpp +++ /dev/null @@ -1,159 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptMA07::InitializeScene() { - if (Game_Flag_Query(356)) { - Setup_Scene_Information(6.75f, -172.43f, 356.0f, 997); - Game_Flag_Reset(356); - Game_Flag_Set(665); - } else if (Game_Flag_Query(673)) { - Setup_Scene_Information(-312.0f, -162.8f, 180.0f, 0); - } else { - Setup_Scene_Information(104.0f, -162.16f, 56.0f, 519); - } - Ambient_Sounds_Add_Looping_Sound(381, 100, 1, 1); - Ambient_Sounds_Add_Sound(374, 100, 300, 16, 25, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(68, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(69, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(375, 60, 180, 50, 100, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(376, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(377, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0); - if (Global_Variable_Query(1) > 1) { - Scene_Exit_Add_2D_Exit(1, 0, 200, 50, 479, 3); - } - if (Game_Flag_Query(665)) { - Scene_Exit_Add_2D_Exit(2, 176, 386, 230, 426, 2); - } - Scene_Exit_Add_2D_Exit(0, 270, 216, 382, 306, 0); -} - -void ScriptMA07::SceneLoaded() { - Obstacle_Object("BARRICADE", true); -} - -bool ScriptMA07::MouseClick(int x, int y) { - return false; -} - -bool ScriptMA07::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptMA07::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptMA07::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptMA07::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, 104.0f, -162.0f, 56.0f, 12, 1, false, 0)) { - if (Global_Variable_Query(1) == 4 && Game_Flag_Query(671)) { - Actor_Set_Goal_Number(0, 400); - } else { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(57); - Set_Enter(52, 52); - } - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -400.0f, -162.8f, 185.08f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(672); - Game_Flag_Reset(179); - Game_Flag_Set(178); - Set_Enter(68, 77); - } - return true; - } - if (exitId == 2) { - if (!Loop_Actor_Walk_To_XYZ(0, 8.0f, -172.43f, 356.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(357); - Set_Enter(90, 103); - } - return true; - } - return false; -} - -bool ScriptMA07::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptMA07::SceneFrameAdvanced(int frame) { -} - -void ScriptMA07::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { - if (actorId == 53 && newGoal == 302) { - Scene_Exits_Enable(); - } -} - -void ScriptMA07::PlayerWalkedIn() { - if (Game_Flag_Query(673)) { - Loop_Actor_Walk_To_XYZ(0, -268.0f, -162.8f, 188.0f, 0, 0, false, 0); - Game_Flag_Reset(673); - } - if (Actor_Query_Goal_Number(57) == 300) { - Actor_Set_Goal_Number(57, 305); - } - if (Game_Flag_Query(58)) { - Game_Flag_Reset(58); - } - if (!Game_Flag_Query(648) && Game_Flag_Query(671) && Global_Variable_Query(1) == 4) { - Scene_Exits_Disable(); - Actor_Set_Goal_Number(53, 300); - } - if (Game_Flag_Query(666)) { - Actor_Voice_Over(1360, 99); - Actor_Voice_Over(1370, 99); - Actor_Voice_Over(1380, 99); - Actor_Voice_Over(1390, 99); - Actor_Voice_Over(1400, 99); - Delay(1000); - Game_Flag_Reset(666); - Game_Flag_Set(34); - Set_Enter(10, 49); - } - //return false; - -} - -void ScriptMA07::PlayerWalkedOut() { -} - -void ScriptMA07::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ma08.cpp b/engines/bladerunner/script/ma08.cpp deleted file mode 100644 index d2f105af9a..0000000000 --- a/engines/bladerunner/script/ma08.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptMA08::InitializeScene() { - Setup_Scene_Information(0, 0, 0, 0); - Ambient_Sounds_Add_Looping_Sound(381, 100, 1, 1); - Ambient_Sounds_Add_Sound(68, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(69, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(375, 60, 180, 50, 100, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(376, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(377, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0); -} - -void ScriptMA08::SceneLoaded() { - Obstacle_Object("(undefined)", true); - Clickable_Object("(undefined)"); -} - -bool ScriptMA08::MouseClick(int x, int y) { - return false; -} - -bool ScriptMA08::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptMA08::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptMA08::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptMA08::ClickedOnExit(int exitId) { - return false; -} - -bool ScriptMA08::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptMA08::SceneFrameAdvanced(int frame) { -} - -void ScriptMA08::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptMA08::PlayerWalkedIn() { -} - -void ScriptMA08::PlayerWalkedOut() { -} - -void ScriptMA08::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/nr01.cpp b/engines/bladerunner/script/nr01.cpp deleted file mode 100644 index a7ff7b2e3e..0000000000 --- a/engines/bladerunner/script/nr01.cpp +++ /dev/null @@ -1,436 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptNR01::InitializeScene() { - if (Game_Flag_Query(617)) { - Setup_Scene_Information(-153.86f, 23.88f, -570.21f, 402); - } else if (Game_Flag_Query(632)) { - Setup_Scene_Information(-416.0f, 31.93f, -841.0f, 200); - Actor_Set_Invisible(0, true); - Preload(167); - } else if (Game_Flag_Query(534)) { - Setup_Scene_Information(-416.0f, 31.93f, -841.0f, 200); - } else if (Game_Flag_Query(342)) { - Setup_Scene_Information(-270.0f, 4.93f, -1096.0f, 500); - } else if (Game_Flag_Query(533)) { - Setup_Scene_Information(312.0f, 31.66f, -901.0f, 700); - } else if (Game_Flag_Query(545)) { - Setup_Scene_Information(-170.0f, 24.0f, -574.0f, 768); - } else { - Setup_Scene_Information(76.0f, 23.88f, -109.0f, 966); - } - Scene_Exit_Add_2D_Exit(0, 31, 270, 97, 373, 3); - if (Global_Variable_Query(1) > 3) { - Scene_Exit_Add_2D_Exit(1, 201, 320, 276, 357, 2); - } - Scene_Exit_Add_2D_Exit(2, 583, 262, 639, 365, 1); - if (Game_Flag_Query(255)) { - Scene_Exit_Add_2D_Exit(3, 320, 445, 639, 479, 2); - } - Ambient_Sounds_Add_Looping_Sound(54, 50, 0, 1); - Ambient_Sounds_Add_Looping_Sound(362, 22, 55, 1); - Ambient_Sounds_Add_Sound(361, 10, 10, 20, 20, -70, -70, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(184, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(185, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(186, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(188, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(189, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(192, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(68, 10, 80, 16, 25, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(69, 10, 80, 16, 25, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(375, 10, 80, 33, 33, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(376, 10, 80, 33, 33, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(377, 10, 80, 33, 33, 0, 0, -101, -101, 0, 0); - if (Game_Flag_Query(643) && Actor_Query_Goal_Number(1) == 230) { - Game_Flag_Reset(255); - Game_Flag_Reset(256); - } - if (Game_Flag_Query(255) && !Game_Flag_Query(247)) { - Scene_Loop_Start_Special(0, 0, 0); - Scene_Loop_Set_Default(1); - Game_Flag_Set(247); - } else if (Game_Flag_Query(255) && Game_Flag_Query(247)) { - Scene_Loop_Set_Default(1); - } else { - Scene_Loop_Set_Default(4); - } -} - -void ScriptNR01::SceneLoaded() { - Obstacle_Object("LAMPBASE01", true); - Unclickable_Object("LAMPBASE01"); -} - -bool ScriptNR01::MouseClick(int x, int y) { - if (Actor_Query_Goal_Number(0) == 212) { - Global_Variable_Increment(47, 4); - return true; - } - return false; -} - -bool ScriptNR01::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptNR01::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptNR01::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptNR01::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -380.0f, 31.93f, -841.0f, 0, 1, false, 0)) { - if (Global_Variable_Query(1) > 3) { - Actor_Says(0, 8522, 12); - } else { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(535); - Set_Enter(55, 56); - } - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -281.0f, 31.93f, -1061.0f, 0, 1, false, 0)) { - Actor_Face_Heading(0, 45, false); - Loop_Actor_Travel_Stairs(0, 3, 0, 0); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(343); - Set_Enter(79, 91); - } - return true; - } - if (exitId == 2) { - if (!Loop_Actor_Walk_To_XYZ(0, 312.0f, 31.66f, -901.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(532); - Set_Enter(11, 55); - } - return true; - } - if (exitId == 3) { - if (!Loop_Actor_Walk_To_XYZ(0, 108.0f, 23.88f, -93.0f, 0, 1, false, 0)) { - Game_Flag_Reset(176); - Game_Flag_Reset(182); - Game_Flag_Reset(179); - Game_Flag_Reset(178); - Game_Flag_Reset(258); - Game_Flag_Reset(257); - Game_Flag_Reset(261); - Game_Flag_Reset(181); - switch (Spinner_Interface_Choose_Dest(-1, 1)) { - case 9: - Game_Flag_Set(257); - Game_Flag_Reset(255); - Game_Flag_Set(256); - Set_Enter(37, 34); - Scene_Loop_Start_Special(1, 3, 1); - break; - case 7: - Game_Flag_Set(258); - Game_Flag_Reset(255); - Game_Flag_Reset(247); - Game_Flag_Set(254); - Set_Enter(20, 2); - Scene_Loop_Start_Special(1, 3, 1); - break; - case 6: - Game_Flag_Set(177); - Game_Flag_Reset(255); - Game_Flag_Reset(247); - Game_Flag_Set(253); - Set_Enter(7, 25); - Scene_Loop_Start_Special(1, 3, 1); - break; - case 5: - Game_Flag_Set(261); - Game_Flag_Reset(255); - Game_Flag_Reset(247); - Game_Flag_Set(307); - Set_Enter(17, 82); - Scene_Loop_Start_Special(1, 3, 1); - break; - case 4: - Game_Flag_Set(180); - Game_Flag_Reset(255); - Game_Flag_Reset(247); - Game_Flag_Set(252); - Set_Enter(0, 0); - Scene_Loop_Start_Special(1, 3, 1); - break; - case 3: - Game_Flag_Set(176); - Game_Flag_Reset(255); - Game_Flag_Reset(247); - Game_Flag_Set(248); - Set_Enter(4, 13); - Scene_Loop_Start_Special(1, 3, 1); - break; - case 2: - Game_Flag_Set(182); - Game_Flag_Reset(255); - Game_Flag_Reset(247); - Game_Flag_Set(249); - Set_Enter(69, 78); - Scene_Loop_Start_Special(1, 3, 1); - break; - case 1: - Game_Flag_Set(179); - Game_Flag_Reset(255); - Game_Flag_Reset(247); - Game_Flag_Set(250); - Set_Enter(49, 48); - Scene_Loop_Start_Special(1, 3, 1); - break; - case 0: - Game_Flag_Set(178); - Game_Flag_Reset(255); - Game_Flag_Reset(247); - Game_Flag_Set(251); - Set_Enter(61, 65); - Scene_Loop_Start_Special(1, 3, 1); - break; - default: - Player_Loses_Control(); - Game_Flag_Set(181); - Game_Flag_Set(247); - Player_Gains_Control(); - break; - } - } - return true; - } - return false; -} - -bool ScriptNR01::ClickedOn2DRegion(int region) { - if (region == 0 && Player_Query_Combat_Mode()) { - Sound_Play(517, 100, 0, 0, 50); - Actor_Set_Goal_Number(1, 260); - Scene_2D_Region_Remove(0); - } - if (region == 1 && Player_Query_Combat_Mode()) { - Sound_Play(517, 100, 0, 0, 50); - Actor_Set_Goal_Number(2, 299); - Actor_Set_Goal_Number(1, 258); - Scene_2D_Region_Remove(1); - return true; - } - return false; - -} - -void ScriptNR01::SceneFrameAdvanced(int frame) { - if (frame == 61) { - Sound_Play(118, 40, 0, 0, 50); - } - if (frame == 184) { - Sound_Play(117, 40, 80, 80, 50); - } - //return 0; -} - -void ScriptNR01::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptNR01::PlayerWalkedIn() { - if (Game_Flag_Query(617)) { - Actor_Set_Goal_Number(1, 280); - Game_Flag_Reset(617); - //return true; - return; - } - if (Actor_Query_Goal_Number(1) == 250) { - Scene_Exits_Disable(); - ADQ_Flush(); - Actor_Set_Goal_Number(1, 251); - Scene_2D_Region_Add(0, 450, 316, 464, 333); - Scene_2D_Region_Add(1, 233, 321, 240, 362); - ADQ_Add(2, 70, 81); - ADQ_Add(1, 990, 3); - ADQ_Add(2, 80, 82); - ADQ_Add(2, 90, 81); - ADQ_Add(1, 1010, 3); - ADQ_Add(2, 100, 81); - ADQ_Add(1, 1020, 3); - ADQ_Add(2, 110, 82); - ADQ_Add(1, 1030, 3); - ADQ_Add(1, 1040, 3); - ADQ_Add(2, 120, 82); - } - if (Game_Flag_Query(604)) { - if (Game_Flag_Query(622)) { - ADQ_Add(25, 150, 3); - Game_Flag_Reset(622); - } - Game_Flag_Reset(604); - Player_Gains_Control(); - //return true; - return; - } - if (Game_Flag_Query(632)) { - Delay(3500); - Set_Enter(60, 64); - //return true; - return; - } - if (Game_Flag_Query(534)) { - Loop_Actor_Walk_To_XYZ(0, -380.0f, 31.73f, -841.0f, 0, 0, false, 0); - Game_Flag_Reset(534); - } else { - if (Game_Flag_Query(342)) { - Loop_Actor_Travel_Stairs(0, 3, 1, 0); - Game_Flag_Reset(342); - if (Actor_Query_Goal_Number(1) == 230) { - Actor_Face_Actor(1, 0, true); - Actor_Says(1, 1440, 13); - Loop_Actor_Walk_To_Actor(0, 1, 48, 0, true); - Actor_Says(0, 3145, 13); - if (Global_Variable_Query(40) != 3) { - Actor_Says(1, 1450, 12); - Actor_Says(1, 1460, 13); - } - Actor_Says(0, 3150, 14); - Actor_Says(1, 1470, 12); - Actor_Says(1, 1480, 13); - Actor_Says(0, 3155, 15); - Actor_Says(1, 1500, 16); - Actor_Says(0, 3160, 12); - if (Game_Flag_Query(643)) { - Actor_Says(1, 1330, 12); - Actor_Says(1, 1340, 12); - Actor_Says(1, 1350, 12); - Actor_Says(0, 3120, 15); - Actor_Says(1, 1360, 12); - Actor_Says(1, 1370, 12); - Actor_Says(0, 3125, 15); - Actor_Says(1, 1380, 12); - Actor_Says(0, 3130, 15); - Actor_Says(1, 1390, 12); - Actor_Says(1, 1400, 12); - Actor_Says(1, 1410, 12); - Actor_Says(0, 3135, 15); - Actor_Says(1, 1420, 12); - Actor_Says(0, 3140, 15); - Actor_Says(1, 1430, 12); - Actor_Set_Goal_Number(1, 285); - } else { - int v0 = Global_Variable_Query(40) - 1; - if (!v0) { - Actor_Says(1, 1510, 15); - Actor_Says(1, 1520, 14); - Actor_Says(1, 1530, 13); - Actor_Says(0, 3170, 13); - Actor_Set_Goal_Number(1, 231); - } else if (v0 == 1) { - Actor_Says(1, 1590, 15); - Actor_Says(0, 3195, 14); - Actor_Says(1, 1600, 16); - Actor_Says(0, 3200, 13); - Actor_Says(1, 1610, 17); - Actor_Says(1, 1620, 15); - Actor_Says(1, 1630, 14); - Actor_Says(0, 3205, 12); - Actor_Set_Goal_Number(1, 232); - } else if (v0 == 2) { - Actor_Says(1, 1540, 15); - Actor_Says(0, 3175, 13); - Actor_Says(1, 1550, 13); - Actor_Says(1, 1560, 16); - Actor_Says(0, 3180, 15); - Actor_Says(1, 1570, 12); - Actor_Says(1, 1580, 14); - Actor_Says(0, 3190, 12); - Actor_Set_Goal_Number(1, 233); - } - } - } - } else if (Game_Flag_Query(533)) { - Loop_Actor_Walk_To_XYZ(0, 239.0f, 31.66f, -901.0f, 0, 0, false, 0); - Game_Flag_Reset(533); - if (Actor_Query_Goal_Number(2) == 230) { - Scene_Exits_Disable(); - Actor_Set_Goal_Number(2, 231); - Non_Player_Actor_Combat_Mode_On(2, 0, 1, 0, 3, 4, 7, 8, -1, -1, -1, 20, 300, 0); - } - } else if (Game_Flag_Query(545)) { - Game_Flag_Reset(545); - Actor_Put_In_Set(25, 54); - Actor_Set_At_XYZ(25, -202.0f, 24.0f, -574.0f, 0); - Actor_Face_Heading(25, 256, false); - Actor_Set_Goal_Number(25, 204); - Player_Gains_Control(); - } else { - Loop_Actor_Walk_To_XYZ(0, 48.0f, 23.88f, -189.0f, 0, 0, false, 0); - } - } - if (Game_Flag_Query(652)) { - Game_Flag_Reset(652); - Actor_Voice_Over(950, 99); - Actor_Voice_Over(960, 99); - Actor_Voice_Over(970, 99); - Actor_Voice_Over(980, 99); - } - if (Actor_Query_Goal_Number(2) == 240) { - Scene_Exits_Disable(); - Actor_Set_Goal_Number(2, 241); - if (!Player_Query_Combat_Mode()) { - Player_Set_Combat_Mode(true); - } - } - //return false; - return; -} - -void ScriptNR01::PlayerWalkedOut() { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - if (!Game_Flag_Query(343) && !Game_Flag_Query(532) && !Game_Flag_Query(535) && !Game_Flag_Query(632) && !Game_Flag_Query(722)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Outtake_Play(30, 1, -1); - Outtake_Play(35, 1, -1); - } - Game_Flag_Reset(722); -} - -void ScriptNR01::DialogueQueueFlushed(int a1) { - if (Actor_Query_Goal_Number(1) == 251 && Actor_Query_Goal_Number(2) != 299 && Actor_Query_Goal_Number(2) != 254 && Actor_Query_Goal_Number(2) != 255) { - Actor_Set_Goal_Number(1, 252); - } -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/nr02.cpp b/engines/bladerunner/script/nr02.cpp deleted file mode 100644 index 72903906a7..0000000000 --- a/engines/bladerunner/script/nr02.cpp +++ /dev/null @@ -1,215 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptNR02::InitializeScene() { - sub_402134(); - Setup_Scene_Information(-283.0f, -24.0f, 326.0f, 200); - Game_Flag_Reset(532); - Scene_Exit_Add_2D_Exit(0, 0, 105, 75, 291, 3); - Ambient_Sounds_Add_Looping_Sound(280, 50, 38, 0); - Ambient_Sounds_Add_Sound(252, 3, 60, 25, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(254, 3, 60, 25, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(255, 3, 60, 25, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(256, 3, 60, 25, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(257, 3, 60, 25, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(258, 3, 60, 25, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(259, 3, 60, 25, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(260, 3, 60, 25, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(261, 3, 60, 25, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(262, 3, 60, 25, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(184, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(185, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(186, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(188, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(189, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(192, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); -} - -void ScriptNR02::SceneLoaded() { - Obstacle_Object("VID PHONE 01", true); - Unobstacle_Object("VICTORIAN CHAIR", true); - Unobstacle_Object("WALL CANDLES", true); - Unobstacle_Object("STAIRS", true); - Unobstacle_Object("BOX30", true); - Unobstacle_Object("VID CAM COVER", true); - Unobstacle_Object("VID CAM COVER01", true); - Unobstacle_Object("VID OUTER GLASS", true); - Unobstacle_Object("VID OUTER GLASS01", true); - Unobstacle_Object("VID MAIN MONITOR", true); - Unobstacle_Object("VID MAIN MONITOR01", true); - Clickable_Object("VID PHONE 01"); - Clickable_Object("VID PHONE 02"); -} - -bool ScriptNR02::MouseClick(int x, int y) { - return false; -} - -bool ScriptNR02::ClickedOn3DObject(const char *objectName, bool a2) { - if (Object_Query_Click("VID PHONE 01", objectName) || Object_Query_Click("VID PHONE 02", objectName)) { - if (!Loop_Actor_Walk_To_XYZ(0, -191.9f, -24.0f, 62.15f, 0, 1, false, 0)) { - Actor_Face_Heading(0, 13, false); - if (Actor_Clue_Query(0, 125) && Actor_Clue_Query(0, 126) && !Game_Flag_Query(670)) { - Actor_Set_Goal_Number(0, 350); - Game_Flag_Set(670); - } else { - Sound_Play(123, 50, 0, 0, 50); - Delay(1000); - Sound_Play(403, 30, 0, 0, 50); - Delay(1500); - Sound_Play(403, 30, 0, 0, 50); - Delay(1500); - Sound_Play(403, 30, 0, 0, 50); - Delay(1500); - Sound_Play(123, 50, 0, 0, 50); - Delay(1000); - Actor_Says(0, 170, 14); - } - } - } - return false; -} - -bool ScriptNR02::ClickedOnActor(int actorId) { - if (actorId == 2 && Actor_Query_Goal_Number(2) == 201 && !Loop_Actor_Walk_To_XYZ(0, 67.37f, -24.0f, 389.32f, 0, 1, false, 0)) { - Actor_Set_Goal_Number(2, 215); - } - return false; -} - -bool ScriptNR02::ClickedOnItem(int itemId, bool a2) { - if ((itemId == 89 || itemId == 90) && !Loop_Actor_Walk_To_XYZ(0, 109.38f, -24.0f, 420.5f, 0, 1, false, 0)) { - Actor_Face_Heading(0, 423, false); - if (itemId == 89) { - Item_Remove_From_World(89); - Item_Pickup_Spin_Effect(953, 214, 380); - Actor_Clue_Acquire(0, 105, 1, -1); - } - if (itemId == 90) { - Item_Remove_From_World(90); - Item_Pickup_Spin_Effect(954, 214, 380); - Actor_Clue_Acquire(0, 106, 1, -1); - } - } - return false; -} - -bool ScriptNR02::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -283.0f, -24.0f, 326.0f, 0, 1, false, 0)) { - if (Actor_Query_Goal_Number(2) < 230 || Actor_Query_Goal_Number(2) > 250) { - Music_Stop(2); - } - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(533); - Set_Enter(54, 54); - } - return true; - } - return false; -} - -bool ScriptNR02::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptNR02::SceneFrameAdvanced(int frame) { - if (!Music_Is_Playing() && (Actor_Query_Goal_Number(2) < 210 || Actor_Query_Goal_Number(2) > 222)) { - sub_402134(); - } - //return false; -} - -void ScriptNR02::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptNR02::PlayerWalkedIn() { - if (Actor_Query_Goal_Number(2) == 211) { - Actor_Set_Goal_Number(2, 220); - } - if (Actor_Query_Goal_Number(2) == 204) { - Actor_Set_Goal_Number(2, 205); - } - if (Actor_Query_Goal_Number(2) == 206) { - Actor_Set_Goal_Number(2, 205); - } - Loop_Actor_Walk_To_XYZ(0, -203.0f, -24.0f, 334.0f, 0, 0, false, 0); - //return false; -} - -void ScriptNR02::PlayerWalkedOut() { - Music_Stop(2); - if (Actor_Query_Goal_Number(2) < 210 && Actor_Query_Goal_Number(2) >= 205) { - Actor_Set_Goal_Number(2, 204); - } -} - -void ScriptNR02::DialogueQueueFlushed(int a1) { - if (Player_Query_Current_Scene() == 55 && Actor_Query_Goal_Number(2) == 206) { - Sound_Play(575, 50, 0, 0, 50); - Sound_Play(321, 50, 0, 0, 50); - } - if (Player_Query_Current_Scene() == 55 && Actor_Query_Goal_Number(2) == 207) { - Sound_Play(576, 50, 0, 0, 50); - Sound_Play(323, 50, 0, 0, 50); - } - if (Player_Query_Current_Scene() == 55 && Actor_Query_Goal_Number(2) == 208) { - Sound_Play(579, 50, 0, 0, 50); - Sound_Play(324, 50, 0, 0, 50); - } - if (Player_Query_Current_Scene() == 55 && Actor_Query_Goal_Number(2) > 205 && Actor_Query_Goal_Number(2) < 210) { - Actor_Set_Goal_Number(2, 205); - //return true; - return; - } else if (Actor_Query_Goal_Number(2) > 205 && Actor_Query_Goal_Number(2) < 210) { - Actor_Set_Goal_Number(2, 204); - //return true; - return; - } - //return false; -} - -void ScriptNR02::sub_402134() { - int v0 = Global_Variable_Query(50); - if (v0 == 0) { - Music_Play(8, 41, 0, 2, -1, 0, 0); - } else if (v0 == 1) { - Music_Play(9, 41, 0, 2, -1, 0, 0); - } else if (v0 == 2) { - Music_Play(10, 41, 0, 2, -1, 0, 0); - } - v0++; - if (v0 > 2) { - v0 = 0; - } - Global_Variable_Set(50, v0); -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/nr03.cpp b/engines/bladerunner/script/nr03.cpp deleted file mode 100644 index a4afdd36ec..0000000000 --- a/engines/bladerunner/script/nr03.cpp +++ /dev/null @@ -1,351 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptNR03::InitializeScene() { - if (Game_Flag_Query(537)) { - Setup_Scene_Information(-301.98f, -70.19f, -348.58f, 0); - } else if (Game_Flag_Query(437)) { - Setup_Scene_Information(-161.0f, -70.19f, -1139.0f, 500); - Game_Flag_Reset(437); - } else { - Setup_Scene_Information(410.0f, -70.19f, -715.0f, 690); - } - Scene_Exit_Add_2D_Exit(0, 561, 0, 639, 216, 1); - Scene_Exit_Add_2D_Exit(1, 210, 85, 240, 145, 0); - Scene_Exit_Add_2D_Exit(2, 0, 135, 85, 295, 3); - Scene_2D_Region_Add(0, 331, 73, 375, 114); - Ambient_Sounds_Add_Looping_Sound(280, 50, 38, 0); - Ambient_Sounds_Add_Sound(252, 3, 60, 25, 25, 0, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(254, 3, 60, 25, 25, 0, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(255, 3, 60, 25, 25, 0, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(256, 3, 60, 25, 25, 0, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(257, 3, 60, 25, 25, 0, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(258, 3, 60, 25, 25, 0, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(259, 3, 60, 20, 20, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(260, 3, 60, 20, 20, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(261, 3, 60, 20, 20, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(262, 3, 60, 20, 20, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(184, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(185, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(186, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(188, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(189, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(192, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - if (Game_Flag_Query(573)) { - if (Game_Flag_Query(537)) { - Scene_Loop_Start_Special(0, 2, 0); - Scene_Loop_Set_Default(0); - Game_Flag_Reset(537); - } else { - Scene_Loop_Set_Default(0); - } - } else { - Actor_Set_Goal_Number(4, 201); - Scene_Loop_Start_Special(0, 2, 0); - Scene_Loop_Set_Default(0); - } - if (Actor_Query_Goal_Number(25) > 209 && Actor_Query_Goal_Number(25) < 215) { - Actor_Set_Goal_Number(25, 215); - } -} - -void ScriptNR03::SceneLoaded() { - Obstacle_Object("PG3", true); - Obstacle_Object("X2BACKBARBOTTOM01", true); - Obstacle_Object("X2BACKSTAGETOP", true); - Unclickable_Object("PG3"); - Unobstacle_Object("X2BACKBARBOTTOM02", true); - Unobstacle_Object("NM2", true); - Unobstacle_Object("MAN5", true); - Unobstacle_Object("MAN7", true); - Unobstacle_Object("X2BACKSTAGETOP", true); -} - -bool ScriptNR03::MouseClick(int x, int y) { - return false; -} - -bool ScriptNR03::ClickedOn3DObject(const char *objectName, bool a2) { - if (Object_Query_Click("PG3", objectName)) { - Actor_Face_Object(0, "PG3", true); - Actor_Voice_Over(3770, 99); - return true; - } - return false; -} - -bool ScriptNR03::ClickedOnActor(int actorId) { - if (actorId == 25 && !Loop_Actor_Walk_To_Actor(0, 25, 48, 1, false)) { - AI_Movement_Track_Pause(25); - Actor_Face_Actor(0, 25, true); - if (Game_Flag_Query(611)) { - Actor_Says(0, 3350, 16); - Actor_Says(25, 50, 17); - } else { - Game_Flag_Set(611); - Actor_Says(0, 3340, 3); - Actor_Face_Actor(25, 0, true); - Actor_Says(25, 30, 13); - Actor_Says(0, 3345, 14); - Actor_Says(25, 40, 14); - } - AI_Movement_Track_Unpause(25); - return true; - } - return false; -} - -bool ScriptNR03::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptNR03::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, 410.0f, -70.19f, -715.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(534); - Set_Enter(54, 54); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -161.0f, -70.19f, -1139.0f, 0, 1, false, 0)) { - if (Actor_Query_Which_Set_In(25) == 55) { - AI_Movement_Track_Pause(25); - Actor_Face_Actor(25, 0, true); - Actor_Face_Actor(0, 25, true); - int v3 = Global_Variable_Query(44); - if (v3 == 0) { - Actor_Says(25, 50, 13); - AI_Movement_Track_Unpause(25); - } else if (v3 == 1) { - Actor_Says(25, 210, 15); - AI_Movement_Track_Unpause(25); - } else if (v3 == 2) { - Actor_Set_Goal_Number(25, 220); - } - } - Global_Variable_Increment(44, 1); - } else { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(438); - Set_Enter(12, 57); - } - - return true; - } - if (exitId == 2) { - if (!Loop_Actor_Walk_To_XYZ(0, -151.0f, -70.19f, -476.0f, 12, 1, false, 0)) { - if (Actor_Query_Goal_Number(25) == 213 || Actor_Query_Which_Set_In(25) != 55) { - Player_Loses_Control(); - Player_Set_Combat_Mode(false); - Loop_Actor_Walk_To_XYZ(0, -229.0f, -70.19f, -469.0f, 0, 0, false, 1); - Actor_Face_Heading(0, 656, false); - Actor_Change_Animation_Mode(0, 53); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(536); - Set_Enter(13, 58); - Scene_Loop_Start_Special(1, 2, 0); - return true; - } - Actor_Face_Heading(0, 680, false); - Actor_Change_Animation_Mode(0, 12); - Delay(150); - Actor_Change_Animation_Mode(0, 0); - AI_Movement_Track_Pause(25); - Actor_Face_Actor(25, 0, true); - - int v1 = Global_Variable_Query(43); - if (v1 == 0) { - Actor_Says(25, 0, 15); - Actor_Face_Actor(0, 25, true); - Actor_Says(0, 3335, 13); - Actor_Says(25, 10, 16); - AI_Movement_Track_Unpause(25); - } else if (v1 == 1) { - Actor_Face_Actor(0, 25, true); - Actor_Says(25, 210, 12); - AI_Movement_Track_Unpause(25); - } else if (v1 == 2) { - Actor_Set_Goal_Number(25, 220); - } - Global_Variable_Increment(43, 1); - } - return true; - } - return false; -} - -bool ScriptNR03::ClickedOn2DRegion(int region) { - if (region == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, 79.2f, -70.19f, -984.0f, 12, 1, false, 0)) { - Actor_Face_Actor(0, 47, true); - int v1 = Random_Query(0, 4); - if (v1 == 0) { - Actor_Says(0, 1055, 3); - } else if (v1 == 1) { - Actor_Says(0, 8590, 3); - } else if (v1 == 2) { - Actor_Says(0, 8930, 3); - } else if (v1 == 3) { - Actor_Says(0, 7465, 3); - } - } - return true; - } - return false; -} - -void ScriptNR03::SceneFrameAdvanced(int frame) { - if (!Music_Is_Playing()) { - sub_402994(); - } - if (frame == 72) { - Sound_Play(345, 83, -70, -70, 50); - } - if (frame == 76) { - Sound_Play(353, 62, -70, -70, 50); - } - if (frame > 70 && frame < 110) { - sub_40259C(frame); - } else { - if (frame != 110) { - //return false; - return; - } - if (Actor_Query_Goal_Number(4) == 201) { - Actor_Set_Goal_Number(4, 200); - } else if (!Game_Flag_Query(536)) { - Actor_Set_Goal_Number(0, 200); - Player_Gains_Control(); - } - } - //return true; - return; -} - -void ScriptNR03::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptNR03::PlayerWalkedIn() { - Player_Set_Combat_Mode(false); - if (Game_Flag_Query(573)) { - if (Game_Flag_Query(535) ) { - Loop_Actor_Walk_To_XYZ(0, 302.0f, -70.19f, -715.0f, 0, 0, false, 0); - Game_Flag_Reset(535); - } - } else { - Game_Flag_Set(573); - Async_Actor_Walk_To_XYZ(0, 206.0f, -70.19f, -643.0f, 0, false); - Game_Flag_Reset(535); - Actor_Voice_Over(1490, 99); - Actor_Voice_Over(1510, 99); - Actor_Voice_Over(1520, 99); - } - if (Player_Query_Combat_Mode()) { - Actor_Set_Goal_Number(25, 220); - } - //return false; -} - -void ScriptNR03::PlayerWalkedOut() { - if (!Game_Flag_Query(438)) { - Music_Stop(2); - } - if (Game_Flag_Query(536)) { - Player_Gains_Control(); - } -} - -void ScriptNR03::DialogueQueueFlushed(int a1) { -} - -void ScriptNR03::sub_40259C(int frame) { - int facing; - float angle, invertedAngle; - - angle = cos((frame - 70) * (M_PI / 40.0f)) * M_PI_2; - invertedAngle = M_PI - angle; - if (!Game_Flag_Query(536) && Actor_Query_Goal_Number(4) != 201) { - angle = angle + M_PI; - invertedAngle = invertedAngle + M_PI; - } - float c = cos(invertedAngle); - float s = sin(invertedAngle); - float x = 36.49f * s - -60.21f * c + -265.49f; - float z = -60.21f * s + 36.49f * c + -408.79f; - - if (Actor_Query_Goal_Number(4) == 201) { - facing = angle * (512.0f / M_PI); - facing = facing + 144; - if (facing < 0) { - facing = facing + 1168; - } - if (facing > 1023) { - facing -= 1024; - } - Actor_Set_At_XYZ(4, x, -70.19f, z, facing); - } else { - facing = angle * (512.0f / M_PI); - facing = facing + 400; - if (facing < 0) { - facing = facing + 1424; - } - if (facing > 1023) { - facing -= 1024; - } - - Actor_Set_At_XYZ(0, x, -70.19f, z, facing); - } -} - -void ScriptNR03::sub_402994() { - if (Music_Is_Playing()) { - Music_Adjust(51, 0, 2); - } else { - int v0 = Global_Variable_Query(53); - if (v0 == 0) { - Music_Play(14, 51, 0, 2, -1, 0, 0); - } else if (v0 == 1) { - Music_Play(13, 51, 0, 2, -1, 0, 0); - } else if (v0 == 2) { - Music_Play(5, 51, 0, 2, -1, 0, 0); - } - v0++; - if (v0 > 2) { - v0 = 0; - } - Global_Variable_Set(53, v0); - } -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/nr04.cpp b/engines/bladerunner/script/nr04.cpp deleted file mode 100644 index 3af425762d..0000000000 --- a/engines/bladerunner/script/nr04.cpp +++ /dev/null @@ -1,358 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptNR04::InitializeScene() { - Music_Adjust(30, 80, 2); - Setup_Scene_Information(53.0f, 0.0f, -110.0f, 569); - Scene_Exit_Add_2D_Exit(0, 498, 126, 560, 238, 0); - Scene_2D_Region_Add(0, 0, 259, 61, 479); - Scene_2D_Region_Add(1, 62, 327, 92, 479); - Scene_2D_Region_Add(2, 93, 343, 239, 479); - Ambient_Sounds_Add_Looping_Sound(408, 16, 0, 1); - Ambient_Sounds_Add_Looping_Sound(384, 16, 0, 1); - Ambient_Sounds_Add_Sound(259, 3, 60, 9, 9, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(260, 3, 60, 9, 9, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(261, 3, 60, 9, 9, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(262, 3, 60, 9, 9, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(182, 5, 70, 8, 8, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(184, 5, 70, 8, 8, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(185, 5, 70, 8, 8, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(186, 5, 70, 8, 8, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(188, 5, 70, 8, 8, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(189, 5, 70, 8, 8, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(191, 5, 70, 8, 8, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(192, 5, 70, 8, 8, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(195, 5, 70, 8, 8, -100, 100, -101, -101, 0, 0); - Scene_Loop_Set_Default(0); -} - -void ScriptNR04::SceneLoaded() { - Clickable_Object("B.TV01"); - Clickable_Object("B.TV02"); - Clickable_Object("B.TV03"); - Clickable_Object("B.TV05"); - Clickable_Object("DESK"); - if (!Game_Flag_Query(605)) { - Clickable_Object("TORUS01"); - } - Clickable_Object("BOX12"); -} - -bool ScriptNR04::MouseClick(int x, int y) { - if (Actor_Query_Animation_Mode(0) == 85 || Actor_Query_Animation_Mode(0) == 29) { - return true; - } - if (Actor_Query_Animation_Mode(0) == 53) { - Actor_Change_Animation_Mode(0, 29); - return true; - } - return false; -} - -bool ScriptNR04::ClickedOn3DObject(const char *objectName, bool a2) { - if (Object_Query_Click("B.TV01", objectName) || Object_Query_Click("B.TV02", objectName) || Object_Query_Click("B.TV03", objectName) || Object_Query_Click("B.TV05", objectName) || Object_Query_Click("DESK", objectName)) { - if (!Loop_Actor_Walk_To_Waypoint(0, 546, 0, 1, false)) { - if (!Object_Query_Click("DESK", objectName)) { - Actor_Face_Object(0, "B.TV01", true); - Actor_Voice_Over(1530, 99); - Actor_Voice_Over(1540, 99); - Actor_Voice_Over(1550, 99); - } else { - Actor_Face_Object(0, "DESK", true); - if (!Actor_Clue_Query(0, 56)) { - Actor_Voice_Over(1600, 99); - Actor_Voice_Over(1610, 99); - } else if (Actor_Clue_Query(0, 100)) { - Actor_Says(0, 8580, 3); - } else { - Actor_Clue_Acquire(0, 100, 0, -1); - Item_Pickup_Spin_Effect(961, 247, 141); - Actor_Voice_Over(1560, 99); - Actor_Voice_Over(1570, 99); - Actor_Voice_Over(1580, 99); - Actor_Voice_Over(1590, 99); - } - - } - } - } else if (Object_Query_Click("TORUS01", objectName) - && !Loop_Actor_Walk_To_XYZ(0, 18.56f, 0.0f, 38.86f, 0, 1, false, 0) - && !Game_Flag_Query(605)) { - Unclickable_Object("TORUS01"); - Scene_Exits_Disable(); - Player_Loses_Control(); - Game_Flag_Set(605); - Actor_Face_Object(0, "TORUS01", true); - Item_Pickup_Spin_Effect(975, 358, 160); - Actor_Voice_Over(1620, 99); - Actor_Voice_Over(1630, 99); - Actor_Clue_Acquire(0, 89, 0, -1); - Actor_Set_Goal_Number(18, 201); - } - return false; -} - -bool ScriptNR04::ClickedOnActor(int actorId) { - if (actorId == 18 && Game_Flag_Query(606)) { - Actor_Voice_Over(1640, 99); - Actor_Voice_Over(1650, 99); - Actor_Voice_Over(1660, 99); - Actor_Voice_Over(1670, 99); - Actor_Voice_Over(1680, 99); - return true; - } - return false; -} - -bool ScriptNR04::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptNR04::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, 45.0f, 0.0f, -106.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(437); - Set_Enter(55, 56); - } - return true; - } - return false; -} - -bool ScriptNR04::ClickedOn2DRegion(int region) { - if ((region == 0 || region == 1 || region == 2) && Actor_Query_Which_Set_In(18) != 12 && Actor_Query_Animation_Mode(0) != 53 && !Loop_Actor_Walk_To_Waypoint(0, 445, 0, 1, false)) { - Actor_Face_Heading(0, 49, false); - Actor_Change_Animation_Mode(0, 85); - Delay(2500); - if (Game_Flag_Query(606) == 1) { - return true; - } - if (Game_Flag_Query(374)) { - Player_Loses_Control(); - Actor_Voice_Over(4180, 99); - Actor_Change_Animation_Mode(0, 48); - Ambient_Sounds_Play_Sound(555, 90, 99, 0, 0); - Delay(350); - Actor_Set_At_XYZ(0, 109.0f, 0.0f, 374.0f, 0); - Actor_Retired_Here(0, 12, 12, 1, -1); - } - return true; - } - return false; -} - -void ScriptNR04::SceneFrameAdvanced(int frame) { - if (frame == 1 && !Music_Is_Playing()) { - sub_402960(); - } - if (frame > 60 && frame < 120) { - sub_402860(frame); - } else if (frame == 120) { - Set_Fade_Color(1.0f, 1.0f, 1.0f); - Set_Fade_Density(0.0f); - } - //return false; -} - -void ScriptNR04::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { - if (actorId == 18) { - switch (newGoal) { - case 214: - Actor_Change_Animation_Mode(18, 29); - Delay(2500); - Actor_Says(18, 290, 3); - sub_401DB0(); - //return true; - break; - case 213: - Actor_Clue_Acquire(0, 88, 0, 18); - Item_Pickup_Spin_Effect(984, 200, 160); - Actor_Says(18, 200, 30); - Actor_Says(18, 210, 30); - Actor_Says(18, 220, 30); - Actor_Says_With_Pause(0, 3425, 1.5f, 23); - Actor_Says(0, 3430, 3); - Actor_Says(18, 240, 30); - Actor_Says(0, 3435, 3); - Actor_Says(18, 250, 30); - Actor_Says(0, 3440, 3); - Actor_Says(18, 280, 30); - Actor_Says(0, 3445, 3); - Actor_Set_Goal_Number(18, 214); - //return true; - break; - case 209: - Actor_Face_Actor(0, 18, true); - Delay(3000); - Actor_Says(18, 170, 30); - Actor_Says(0, 3415, 3); - Actor_Says(18, 180, 30); - Actor_Says_With_Pause(0, 3420, 1.5f, 3); - Actor_Says(18, 190, 30); - Actor_Set_Goal_Number(18, 211); - //return true; - break; - case 207: - Loop_Actor_Walk_To_Waypoint(18, 445, 0, 1, false); - Actor_Face_Heading(18, 49, false); - Actor_Change_Animation_Mode(18, 85); - Actor_Face_Actor(0, 18, true); - Actor_Set_Goal_Number(18, 208); - Actor_Clue_Acquire(0, 92, 0, 18); - //return true; - break; - case 204: - Actor_Face_Actor(0, 18, true); - Actor_Says(18, 90, 73); - Actor_Says(0, 3390, 3); - Actor_Face_Actor(18, 0, true); - Actor_Says(18, 110, 74); - Actor_Says(0, 3385, 3); - Actor_Says(18, 120, 74); - Actor_Face_Actor(18, 0, true); - Actor_Set_Goal_Number(18, 205); - //return true; - break; - case 202: - Actor_Face_Actor(18, 0, true); - Actor_Face_Actor(0, 18, true); - Actor_Says(18, 30, 3); - Actor_Says(0, 3375, 3); - Actor_Says_With_Pause(18, 50, 1.5f, 3); - Actor_Says(18, 60, 3); - Actor_Says_With_Pause(0, 3380, 1.0f, 3); - Actor_Says(18, 70, 3); - Actor_Says(0, 3415, 3); - Actor_Says(18, 80, 3); - Player_Gains_Control(); - Actor_Set_Goal_Number(18, 203); - //return true; - break; - } - } - //return false; -} - -void ScriptNR04::PlayerWalkedIn() { - Loop_Actor_Walk_To_XYZ(0, 53.0f, 0.0f, -26.0f, 0, 0, false, 0); - if (Game_Flag_Query(374)) { - Overlay_Play("nr04over", 0, 1, 0, 0); - Delay(4000); - Overlay_Remove("nr04over"); - } - //return false; -} - -void ScriptNR04::PlayerWalkedOut() { -} - -void ScriptNR04::DialogueQueueFlushed(int a1) { -} - -void ScriptNR04::sub_401DB0() { - Dialogue_Menu_Clear_List(); - DM_Add_To_List(1530, 10, 5, 3); - DM_Add_To_List(1540, 3, 5, 10); - Dialogue_Menu_Appear(320, 240); - int answer = Dialogue_Menu_Query_Input(); - Dialogue_Menu_Disappear(); - if (answer == 1530) { - Loop_Actor_Walk_To_Actor(18, 0, 36, 0, false); - Actor_Change_Animation_Mode(0, 23); - Actor_Change_Animation_Mode(18, 23); - Delay(1500); - Actor_Says(18, 300, 3); - Actor_Change_Animation_Mode(0, 0); - Actor_Change_Animation_Mode(18, 0); - Actor_Says(18, 310, 3); - ADQ_Add(0, 3450, 3); - Actor_Set_Targetable(18, false); - Actor_Set_Goal_Number(18, 217); - Actor_Clue_Lose(0, 89); - Scene_Exits_Enable(); - } else if (answer == 1540) { - Actor_Says(0, 8512, 15); - Actor_Says(18, 320, 12); - Actor_Says(0, 3455, 13); - Actor_Says(18, 330, 15); - Actor_Says(0, 3460, 12); - Actor_Says(18, 340, 12); - Actor_Says(0, 3465, 12); - Actor_Says(18, 350, 16); - Actor_Set_Targetable(18, false); - Actor_Set_Goal_Number(18, 217); - Scene_Exits_Enable(); - } -} - -void ScriptNR04::sub_402860(int frame) { - float colorMap[] = { - 1.0f, 1.0f, 1.0f, - 1.0f, 0.0f, 0.0f, - 0.8f, 0.4f, 0.0f, - 0.7f, 0.7f, 0.0f, - 0.0f, 1.0f, 0.0f, - 0.0f, 0.0f, 1.0f, - 0.5f, 0.0f, 0.8f}; - - float v3 = (frame - 60) / 10; - float v4 = (frame % 10) * 0.1f; - float coef = 1.0f; - if (frame > 100) { - coef = 1.0f - (frame - 100) / 20.0f; - } - int index = 3 * v3; - int nextIndex = 3 * v3 + 3; - float r = ((colorMap[nextIndex + 0] - colorMap[index + 0]) * v4 + colorMap[index + 0]) * coef; - float g = ((colorMap[nextIndex + 1] - colorMap[index + 1]) * v4 + colorMap[index + 1]) * coef; - float b = ((colorMap[nextIndex + 2] - colorMap[index + 2]) * v4 + colorMap[index + 2]) * coef; - Set_Fade_Color(r, g, b); - if (frame >= 90) { - Set_Fade_Density(0.75f); - } else { - Set_Fade_Density((frame - 60) / 45.0f); - } -} - -void ScriptNR04::sub_402960() { - int v0 = Global_Variable_Query(53); - if (!v0) { - Music_Play(14, 11, 80, 2, -1, 0, 0); - } else if (v0 == 1) { - Music_Play(13, 11, 80, 2, -1, 0, 0); - } else if (v0 == 2) { - Music_Play(5, 11, 80, 2, -1, 0, 0); - } - v0++; - if (v0 > 2) { - v0 = 0; - } - Global_Variable_Set(53, v0); -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/nr05.cpp b/engines/bladerunner/script/nr05.cpp deleted file mode 100644 index d686bce374..0000000000 --- a/engines/bladerunner/script/nr05.cpp +++ /dev/null @@ -1,369 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptNR05::InitializeScene() { - if (Game_Flag_Query(547)) { - Scene_Loop_Start_Special(0, 0, 0); - Scene_Loop_Set_Default(1); - Setup_Scene_Information(-777.56f, 0.0f, -166.86f, 0); - } else if (Game_Flag_Query(536)) { - Setup_Scene_Information(-456.0f, 0.0f, -611.0f, 0); - } else { - Setup_Scene_Information(-527.0f, 1.57f, -406.0f, 649); - } - Scene_Exit_Add_2D_Exit(0, 459, 147, 639, 290, 1); - if (Game_Flag_Query(620)) { - Scene_Exit_Add_2D_Exit(1, 0, 0, 30, 479, 3); - } - Ambient_Sounds_Add_Looping_Sound(280, 50, 38, 0); - Ambient_Sounds_Add_Sound(252, 3, 60, 20, 20, -30, 30, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(254, 3, 60, 20, 20, -30, 30, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(255, 3, 60, 20, 20, -30, 30, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(256, 3, 60, 20, 20, -30, 30, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(257, 3, 60, 20, 20, -30, 30, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(258, 3, 60, 20, 20, -30, 30, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(259, 3, 60, 25, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(260, 3, 60, 25, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(261, 3, 60, 25, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(262, 3, 60, 25, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(570, 5, 70, 11, 11, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(571, 5, 70, 11, 11, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(572, 5, 70, 11, 11, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(573, 5, 70, 11, 11, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(184, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(185, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(186, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(188, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(189, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(192, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - if (Game_Flag_Query(547)) { - Scene_Loop_Start_Special(0, 0, 0); - Scene_Loop_Set_Default(1); - } else if (Game_Flag_Query(536)) { - Scene_Loop_Start_Special(0, 3, 0); - Scene_Loop_Set_Default(1); - Game_Flag_Reset(536); - } else { - Scene_Loop_Set_Default(1); - } -} - -void ScriptNR05::SceneLoaded() { - Obstacle_Object("NM1-1+", true); - Clickable_Object("NM1-1+"); - Unclickable_Object("NM1-1+"); -} - -bool ScriptNR05::MouseClick(int x, int y) { - return false; -} - -bool ScriptNR05::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptNR05::ClickedOnActor(int actorId) { - if (actorId == 42) { - if (!Loop_Actor_Walk_To_Actor(0, 42, 120, 1, false)) { - sub_4020B4(); - } - return true; - } - if (actorId == 18) { - Actor_Set_Goal_Number(18, 229); - if (!Loop_Actor_Walk_To_Actor(0, 18, 36, 1, false)) { - sub_4022DC(); - } - Actor_Set_Goal_Number(18, 221); - return true; - } - return false; -} - -bool ScriptNR05::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptNR05::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -444.0f, 0.0f, -451.0f, 0, 1, false, 0)) { - Player_Loses_Control(); - Music_Stop(2); - Player_Set_Combat_Mode(false); - Actor_Face_Heading(0, 1021, false); - Actor_Change_Animation_Mode(0, 53); - Game_Flag_Set(537); - Set_Enter(55, 56); - Scene_Loop_Start_Special(1, 3, 0); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -777.56f, 0.0f, -166.86f, 0, 1, false, 0)) { - Game_Flag_Set(546); - Set_Enter(13, 61); - } - return true; - } - return false; -} - -bool ScriptNR05::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptNR05::SceneFrameAdvanced(int frame) { - if (!Music_Is_Playing()) { - sub_402B9C(); - } - if (frame == 78) { - Sound_Play(345, 83, 70, 70, 50); - } - if (frame == 86) { - Sound_Play(353, 62, 70, 70, 50); - } - sub_402A48(48); - sub_402A48(0); - if (Actor_Query_Goal_Number(18) == 224) { - Actor_Set_Goal_Number(18, 225); - if (Player_Query_Current_Scene() == 58) { - Scene_Exit_Add_2D_Exit(1, 0, 0, 30, 479, 3); - } - } - if (frame > 77 && frame <= 134) { - sub_401F74(frame - 13); - if (frame == 134 && !Game_Flag_Query(537)) { - Actor_Set_Goal_Number(0, 200); - } - //return true; - return; - } else { - //return false; - return; - } - -} - -void ScriptNR05::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptNR05::PlayerWalkedIn() { - if (Game_Flag_Query(547)) { - Music_Stop(2); - Loop_Actor_Walk_To_XYZ(0, -697.56f, 0.0f, -174.86f, 0, 1, false, 0); - Game_Flag_Reset(547); - } - // return false; -} - -void ScriptNR05::PlayerWalkedOut() { - if (Game_Flag_Query(537)) { - Music_Stop(2); - } - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); -} - -void ScriptNR05::DialogueQueueFlushed(int a1) { -} - -void ScriptNR05::sub_401F74(int frame) { - float angle = cos((frame - 65) * (M_PI / 57.0f)) * M_PI_2; - float invertedAngle = M_PI - angle; - if (!Game_Flag_Query(537)) { - angle = angle + M_PI; - invertedAngle = invertedAngle + M_PI; - } - float c = cos(invertedAngle); - float s = sin(invertedAngle); - float x = 6.0f * s - 80.0f * c + -450.0f; - float z = 80.0f * s + 6.0f * c + -531.0f; - - int facing = angle * (512.0f / M_PI); - facing = facing + 765; - if (facing < 0) { - facing = facing + 1789; - } - if (facing > 1023) { - facing -= 1024; - } - Actor_Set_At_XYZ(0, x, 0.0f, z, facing); -} - -void ScriptNR05::sub_4020B4() { - Actor_Face_Actor(0, 42, true); - Actor_Face_Actor(42, 0, true); - if (Game_Flag_Query(588)) { - if (Game_Flag_Query(589)) { - Actor_Says(0, 3480, 19); - Actor_Says(42, 30, 12); - Actor_Says(0, 3485, 3); - Actor_Says(42, 40, 13); - Actor_Change_Animation_Mode(42, 23); - Actor_Change_Animation_Mode(0, 75); - Global_Variable_Increment(42, 1); - } else { - Actor_Says(0, 3475, 17); - Actor_Says(42, 20, 23); - Game_Flag_Set(589); - Actor_Change_Animation_Mode(0, 75); - Global_Variable_Increment(42, 1); - } - } else { - Actor_Says(42, 0, 13); - Actor_Says(0, 3470, 3); - Actor_Says(42, 10, 23); - Game_Flag_Set(588); - Actor_Change_Animation_Mode(0, 75); - Global_Variable_Increment(42, 1); - } -} - -void ScriptNR05::sub_4022DC() { - if (Actor_Query_Goal_Number(18) == 220) { - Actor_Set_Goal_Number(18, 221); - } - Actor_Face_Actor(0, 18, true); - Actor_Face_Actor(18, 0, true); - if (!Game_Flag_Query(590)) { - Actor_Says(0, 8513, 3); - Actor_Says(18, 360, 3); - Actor_Says(0, 3495, 11); - Actor_Says(18, 370, 15); - Actor_Says(0, 3500, 17); - Actor_Says(18, 380, 13); - Game_Flag_Set(590); - return; - } - Dialogue_Menu_Clear_List(); - if (Actor_Query_Friendliness_To_Other(18, 0) >= 48) { - if (Actor_Clue_Query(0, 90) || Actor_Clue_Query(0, 100)) { - DM_Add_To_List_Never_Repeat_Once_Selected(890, -1, 4, 8); - } - if (Actor_Clue_Query(0, 13)) { - DM_Add_To_List_Never_Repeat_Once_Selected(900, 5, 6, 5); - } - if (Actor_Clue_Query(0, 88)) { - DM_Add_To_List_Never_Repeat_Once_Selected(910, 5, 5, 5); - } - } - if (!Dialogue_Menu_Query_List_Size()) { - Actor_Says(0, 3520, 3); - Actor_Says(18, 730, 3); - Actor_Face_Heading(18, 849, false); - return; - } - Dialogue_Menu_Add_DONE_To_List(100); - Dialogue_Menu_Appear(320, 240); - int answer = Dialogue_Menu_Query_Input(); - Dialogue_Menu_Disappear(); - if (answer == 890) { - Actor_Says(0, 3505, 3); - Actor_Modify_Friendliness_To_Other(18, 0, -1); - Actor_Says(18, 420, 12); - Actor_Says(18, 430, 13); - Actor_Says(0, 3530, 15); - Actor_Says(18, 440, 15); - Actor_Says(0, 3535, 13); - Actor_Says(18, 460, 16); - Actor_Says(0, 3540, 15); - Actor_Says(18, 490, 16); - Actor_Says(18, 500, 13); - Actor_Says(0, 3545, 15); - Actor_Says(18, 520, 12); - Actor_Face_Heading(18, 849, false); - } else if (answer == 900) { - Actor_Says(0, 3510, 15); - Actor_Modify_Friendliness_To_Other(18, 0, -1); - Actor_Says_With_Pause(18, 530, 1.2f, 3); - Actor_Says(18, 540, 15); - Actor_Says(0, 3550, 13); - Actor_Says(18, 560, 14); - Actor_Says(18, 570, 13); - Actor_Says(0, 3555, 12); - Actor_Face_Heading(18, 849, false); - } else if (answer == 910) { - Actor_Says(0, 3515, 14); - Actor_Modify_Friendliness_To_Other(18, 0, -1); - if (Actor_Clue_Query(0, 99)) { - Actor_Says(18, 580, 12); - Actor_Says(0, 3560, 13); - Actor_Says(18, 590, 16); - Actor_Says(0, 3565, 16); - Actor_Says(18, 600, 13); - Actor_Says(0, 3570, 14); - Actor_Says(18, 620, 15); - Actor_Says(0, 3575, 13); - } else { - Actor_Says(18, 640, 13); - Actor_Says(0, 3580, 15); - Actor_Says(18, 660, 12); - } - Actor_Face_Heading(18, 849, false); - } -} - -void ScriptNR05::sub_402A48(int actorId) { - int animationMode = Actor_Query_Animation_Mode(actorId); - if (animationMode == 1 || animationMode == 2 || animationMode == 7 || animationMode == 8) { - return; - } - float x, y, z; - Actor_Query_XYZ(actorId, &x, &y, &z); - if ((x - -542.0f) * (x - -542.0f) + (z - -195.0f) * (z - -195.0f) < 8464.0f) { - float s = sin(M_PI / 128.0f); - float c = cos(M_PI / 128.0f); - float newX = x * c - z * s + -542.0f; - float newZ = x * s + z * c + -195.0f; - int newFacing = (Actor_Query_Facing_1024(actorId) + 4) % 1024; - Actor_Set_At_XYZ(actorId, newX, y, newZ, newFacing); - } -} - -void ScriptNR05::sub_402B9C() { - if (Music_Is_Playing()) { - Music_Adjust(51, 0, 2); - } else { - int v0 = Global_Variable_Query(54); - if (v0 == 0) { - Music_Play(16, 61, -80, 2, -1, 0, 0); - } else if (v0 == 1) { - Music_Play(15, 41, -80, 2, -1, 0, 0); - } else if (v0 == 2) { - Music_Play(7, 41, -80, 2, -1, 0, 0); - } - v0++; - if (v0 > 2) { - v0 = 0; - } - Global_Variable_Set(54, v0); - } -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/nr06.cpp b/engines/bladerunner/script/nr06.cpp deleted file mode 100644 index e21bb49bbc..0000000000 --- a/engines/bladerunner/script/nr06.cpp +++ /dev/null @@ -1,162 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptNR06::InitializeScene() { - sub_401BAC(); - if (Game_Flag_Query(442)) { - Setup_Scene_Information(48.0f, -71.88f, -26.0f, 782); - } else { - Setup_Scene_Information(-36.0f, 0.37f, -373.0f, 592); - } - Scene_Exit_Add_2D_Exit(0, 533, 234, 592, 414, 1); - Scene_Exit_Add_2D_Exit(1, 238, 137, 337, 322, 0); - Ambient_Sounds_Add_Looping_Sound(111, 25, 0, 1); - Ambient_Sounds_Add_Sound(252, 3, 60, 8, 12, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(254, 3, 60, 8, 8, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(255, 3, 60, 8, 8, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(256, 3, 60, 8, 8, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(257, 3, 60, 8, 8, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(258, 3, 60, 8, 8, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(259, 3, 60, 8, 8, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(260, 3, 60, 8, 8, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(261, 3, 60, 8, 8, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(262, 3, 60, 8, 8, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(182, 5, 70, 8, 8, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(184, 5, 70, 8, 8, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(185, 5, 70, 8, 8, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(186, 5, 70, 8, 8, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(188, 5, 70, 8, 8, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(189, 5, 70, 8, 8, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(191, 5, 70, 8, 8, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(192, 5, 70, 8, 8, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(195, 5, 70, 8, 8, -100, 100, -101, -101, 0, 0); -} - -void ScriptNR06::SceneLoaded() { - Obstacle_Object("CHAIR01", true); - Unobstacle_Object("LOFT04", true); - Unobstacle_Object("LINE02", true); - Unobstacle_Object("WALL01", true); - Unclickable_Object("CHAIR01"); -} - -bool ScriptNR06::MouseClick(int x, int y) { - return false; -} - -bool ScriptNR06::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptNR06::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptNR06::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptNR06::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, 48.0f, -71.88f, -26.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Game_Flag_Set(441); - Set_Enter(57, 60); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -137.0f, -71.88f, -243.0f, 0, 1, false, 0)) { - Actor_Face_Heading(0, 95, false); - Loop_Actor_Travel_Stairs(0, 8, 1, 0); - Loop_Actor_Walk_To_XYZ(0, -36.0f, 0.37f, -373.0f, 0, 0, false, 0); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(439); - Set_Enter(13, 61); - } - return true; - } - return false; -} - -bool ScriptNR06::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptNR06::SceneFrameAdvanced(int frame) { - if (!Music_Is_Playing()) { - sub_401BAC(); - } - //return false; -} - -void ScriptNR06::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptNR06::PlayerWalkedIn() { - if (Game_Flag_Query(442)) { - Loop_Actor_Walk_To_XYZ(0, -3.0f, -71.88f, -26.0f, 0, 0, false, 0); - Game_Flag_Reset(442); - } else { - Loop_Actor_Walk_To_XYZ(0, -81.72f, 0.12f, -323.49f, 0, 0, false, 0); - Actor_Face_Heading(0, 600, false); - Loop_Actor_Travel_Stairs(0, 8, 0, 0); - Game_Flag_Reset(440); - } - //return false; -} - -void ScriptNR06::PlayerWalkedOut() { - if (Game_Flag_Query(441)) { - Music_Stop(2); - } -} - -void ScriptNR06::DialogueQueueFlushed(int a1) { -} - -void ScriptNR06::sub_401BAC() { - if (Music_Is_Playing()) { - Music_Adjust(31, 80, 2); - } else { - int v0 = Global_Variable_Query(54); - if (v0 == 0) { - Music_Play(16, 61, -80, 2, -1, 0, 0); - } else if (v0 == 1) { - Music_Play(15, 41, -80, 2, -1, 0, 0); - } else if (v0 == 2) { - Music_Play(7, 41, -80, 2, -1, 0, 0); - } - v0++; - if (v0 > 2) { - v0 = 0; - } - Global_Variable_Set(54, v0); - } -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/nr07.cpp b/engines/bladerunner/script/nr07.cpp deleted file mode 100644 index 99b7aff2b1..0000000000 --- a/engines/bladerunner/script/nr07.cpp +++ /dev/null @@ -1,379 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptNR07::InitializeScene() { - Setup_Scene_Information(-110.0f, -73.5f, -193.0f, 554); - Scene_Exit_Add_2D_Exit(0, 429, 137, 506, 251, 0); - Ambient_Sounds_Add_Looping_Sound(111, 25, 0, 1); -} - -void ScriptNR07::SceneLoaded() { - Obstacle_Object("VANITY", true); - Clickable_Object("VASE"); -} - -bool ScriptNR07::MouseClick(int x, int y) { - return false; -} - -bool ScriptNR07::ClickedOn3DObject(const char *objectName, bool a2) { - Actor_Set_Goal_Number(25, 201); - if (Object_Query_Click("VASE", objectName)) { - sub_401C60(); - } - Actor_Set_Goal_Number(25, 200); - return false; -} - -bool ScriptNR07::ClickedOnActor(int actorId) { - if (actorId == 3) { - if (Actor_Query_Goal_Number(33) <= 239) { - Actor_Set_Goal_Number(25, 201); - Actor_Face_Actor(0, 3, true); - Dialogue_Menu_Clear_List(); - if (Game_Flag_Query(638)) { - DM_Add_To_List_Never_Repeat_Once_Selected(1100, -1, 3, 8); - DM_Add_To_List_Never_Repeat_Once_Selected(1110, 8, -1, -1); - if (Actor_Clue_Query(0, 95)) { - DM_Add_To_List_Never_Repeat_Once_Selected(1120, 3, 6, 7); - } - if (Actor_Clue_Query(0, 113)) { - DM_Add_To_List_Never_Repeat_Once_Selected(1130, 3, 5, 7); - } - if (Game_Flag_Query(510)) { - DM_Add_To_List_Never_Repeat_Once_Selected(1140, 1, 4, 7); - } - } else { - DM_Add_To_List_Never_Repeat_Once_Selected(1080, 3, 5, 7); - DM_Add_To_List_Never_Repeat_Once_Selected(1090, 7, 5, 4); - } - Dialogue_Menu_Add_DONE_To_List(1150); - Dialogue_Menu_Appear(320, 240); - int answer = Dialogue_Menu_Query_Input(); - Dialogue_Menu_Disappear(); - switch (answer) { - case 1140: - sub_4028FC(); - break; - case 1130: - sub_402738(); - break; - case 1120: - sub_402614(); - break; - case 1110: - sub_402510(); - break; - case 1100: - sub_402284(); - break; - case 1090: - Actor_Says(0, 3650, 13); - Actor_Says(3, 630, 30); - Actor_Says(0, 3655, 16); - Actor_Says(3, 640, 31); - break; - case 1080: - sub_401EF4(); - break; - default: - break; - } - Actor_Set_Goal_Number(25, 200); - return false;; - } - return true; - } - return false; -} - -bool ScriptNR07::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptNR07::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -102.0f, -73.5f, -233.0f, 0, 1, false, 0)) { - Actor_Set_Goal_Number(25, 201); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(442); - Set_Enter(56, 59); - } - return true; - } - return false; -} - -bool ScriptNR07::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptNR07::SceneFrameAdvanced(int frame) { -} - -void ScriptNR07::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptNR07::PlayerWalkedIn() { - Loop_Actor_Walk_To_XYZ(0, -110.0f, -73.5f, -169.0f, 0, 0, false, 0); - if (Actor_Query_In_Set(3, 57)) { - if (Game_Flag_Query(508)) { - Actor_Modify_Friendliness_To_Other(3, 0, -2); - Actor_Says(3, 530, 31); - } else { - Game_Flag_Set(508); - if (!Actor_Clue_Query(3, 214)) { - Actor_Modify_Friendliness_To_Other(3, 0, 5); - } else if (Actor_Clue_Query(0, 216) || Actor_Clue_Query(0, 217)) { - Actor_Modify_Friendliness_To_Other(3, 0, 10); - } - Actor_Says(3, 500, 30); - Actor_Says(0, 3585, 14); - Actor_Says(3, 510, 30); - Actor_Start_Speech_Sample(0, 3590); - Loop_Actor_Walk_To_XYZ(0, -112.0f, -73.0f, -89.0f, 525, 0, false, 0); - Actor_Says(3, 520, 53); - } - Actor_Set_Goal_Number(25, 200); - } - //return false; -} - -void ScriptNR07::PlayerWalkedOut() { - -} - -void ScriptNR07::DialogueQueueFlushed(int a1) { -} - -void ScriptNR07::sub_4018D4() { - Actor_Set_Goal_Number(25, 201); - Player_Loses_Control(); - Actor_Set_At_XYZ(3, -136.0f, -73.0f, -18.0f, 300); - Actor_Change_Animation_Mode(3, 71); - Actor_Change_Animation_Mode(0, 21); - Loop_Actor_Walk_To_XYZ(3, -102.0f, -73.5f, -233.0f, 0, 0, true, 0); - if (Game_Flag_Query(47)) { - Actor_Set_Goal_Number(3, 245); - } else { - Actor_Set_Goal_Number(3, 295); - Game_Flag_Set(591); - Actor_Put_In_Set(3, 91); - Actor_Set_At_Waypoint(3, 33, 0); - } - Player_Gains_Control(); -} - -void ScriptNR07::sub_401A10() { - Scene_Exits_Disable(); - Actor_Set_Goal_Number(25, 201); - Actor_Says_With_Pause(3, 930, 1.0f, 30); - Actor_Says_With_Pause(3, 910, 1.0f, 30); - Actor_Face_Object(3, "VANITY", true); - Actor_Says(3, 940, 31); - Actor_Says(0, 3770, 19); - Async_Actor_Walk_To_XYZ(0, -193.0f, -73.5f, -13.0f, 0, false); - Actor_Says(3, 950, 31); - Actor_Face_Actor(3, 0, true); - Actor_Change_Animation_Mode(3, 4); - Actor_Face_Actor(0, 3, true); - Actor_Says(0, 3760, 19); - Actor_Says(3, 960, 53); - Actor_Says(3, 920, 53); - Actor_Says(0, 3780, 0); - Actor_Says(3, 970, 53); - Actor_Voice_Over(1710, 99); - Actor_Voice_Over(1720, 99); - Actor_Voice_Over(1730, 99); - Actor_Set_Goal_Number(33, 240); -} - -void ScriptNR07::sub_401C60() { - Loop_Actor_Walk_To_XYZ(0, -109.0f, -73.0f, -89.0f, 0, 0, false, 0); - Actor_Face_Object(0, "VASE", true); - if (Actor_Query_Is_In_Current_Set(3)) { - if (!Actor_Clue_Query(0, 97)) { - Actor_Clue_Acquire(0, 97, 1, -1); - int v0 = Actor_Query_Friendliness_To_Other(3, 0); - if (v0 > 50) { - Actor_Modify_Friendliness_To_Other(3, 0, 2); - } else if (v0 <= 50) { - Actor_Modify_Friendliness_To_Other(3, 0, -2); - } - Actor_Says(0, 3600, 19); - Actor_Says(3, 550, 30); - Actor_Says(0, 3605, 19); - Actor_Says(3, 560, 31); - Actor_Says(0, 3610, 19); - } - } else if (Actor_Clue_Query(0, 98)) { - Actor_Says(0, 8585, 14); - } else { - Actor_Clue_Acquire(0, 98, 1, -1); - Loop_Actor_Walk_To_Scene_Object(0, "VASE", 100, 1, false); - Actor_Change_Animation_Mode(0, 23); - Item_Pickup_Spin_Effect(935, 526, 268); - Actor_Voice_Over(1690, 99); - Actor_Voice_Over(1700, 99); - } -} - -void ScriptNR07::sub_401EF4() { - Actor_Clue_Acquire(0, 96, 1, -1); - Actor_Says(0, 3625, 19); - Actor_Says(3, 570, 30); - Actor_Says_With_Pause(3, 580, 1.0f, 31); - Actor_Says(0, 3630, 13); - Actor_Says_With_Pause(3, 590, 1.0f, 30); - Actor_Says(3, 600, 30); - Actor_Start_Speech_Sample(0, 3640); - Loop_Actor_Walk_To_XYZ(0, -109.0f, -73.0f, -89.0f, 0, 0, false, 0); - Actor_Face_Actor(0, 3, true); - Actor_Face_Actor(3, 0, true); - Game_Flag_Set(638); - Actor_Clue_Acquire(0, 91, 1, 3); - int v0 = Actor_Query_Friendliness_To_Other(3, 0); - if (!Game_Flag_Query(47) && v0 < 40) { - sub_4018D4(); - return; - } - if (v0 < 36) { - sub_401A10(); - return; - } - sub_4020F0(); -} - -void ScriptNR07::sub_4020F0() { - if (Actor_Clue_Query(3, 213) && Actor_Clue_Query(3, 214)) { - Actor_Modify_Friendliness_To_Other(3, 0, -1); - } - Actor_Says(3, 610, 31); - Actor_Says(0, 3645, 12); - Actor_Says(3, 620, 30); - int v0 = Actor_Query_Friendliness_To_Other(3, 0); - if (!Game_Flag_Query(47) && v0 < 40) { - sub_4018D4(); - return; - } - if (v0 < 36) { - sub_401A10(); - return; - } - Actor_Face_Object(3, "VANITY", true); -} - -void ScriptNR07::sub_402284() { - Actor_Clue_Acquire(0, 94, 1, -1); - Actor_Start_Speech_Sample(0, 3660); - Loop_Actor_Walk_To_XYZ(0, -109.0f, -73.0f, -89.0f, 0, 0, false, 0); - Actor_Face_Actor(0, 3, true); - Actor_Says(3, 650, 30); - Actor_Says(3, 660, 31); - Actor_Says(0, 3665, 18); - Actor_Face_Actor(3, 0, true); - Actor_Says(3, 670, 31); - Actor_Says(3, 680, 30); - Actor_Says(3, 690, 31); - Actor_Says(0, 3670, 17); - Actor_Says(3, 700, 30); - Actor_Says(0, 3675, 19); - Actor_Says(3, 710, 30); - Actor_Says(0, 3680, 19); - Actor_Says(3, 720, 30); - Actor_Says(3, 730, 30); - Actor_Says(0, 3685, 13); - Voight_Kampff_Activate(3, 40); - if (Game_Flag_Query(47)) { - sub_401A10(); - } else { - sub_4018D4(); - } -} - -void ScriptNR07::sub_402510() { - Actor_Says(0, 3690, 14); - Actor_Start_Speech_Sample(3, 750); - Loop_Actor_Walk_To_XYZ(0, -109.0f, -73.0f, -89.0f, 0, 0, false, 0); - Actor_Face_Actor(0, 3, true); - Actor_Face_Actor(3, 0, true); - Actor_Says(0, 3695, 15); - Actor_Modify_Friendliness_To_Other(3, 0, 5); - if (Game_Flag_Query(47)) { - sub_401A10(); - } else { - sub_4018D4(); - } -} - -void ScriptNR07::sub_402614() { - Actor_Says(0, 3705, 19); - Actor_Says(3, 760, 53); - if (Game_Flag_Query(47)) { - Actor_Modify_Friendliness_To_Other(3, 0, -5); - Actor_Says(0, 3710, 18); - sub_401A10(); - } else { - Actor_Modify_Friendliness_To_Other(3, 0, -3); - Actor_Start_Speech_Sample(0, 3710); - Loop_Actor_Walk_To_XYZ(0, -109.0f, -73.0f, -89.0f, 0, 0, false, 0); - Actor_Face_Actor(0, 3, true); - sub_4018D4(); - } -} - -void ScriptNR07::sub_402738() { - Actor_Modify_Friendliness_To_Other(3, 0, -3); - Actor_Says(0, 3615, 16); - Actor_Says(3, 770, 30); - Actor_Says(0, 3720, 15); - Actor_Says_With_Pause(3, 780, 2.0f, 30); - Actor_Says(3, 790, 31); - Actor_Says(0, 3725, 18); - Actor_Says(3, 800, 30); - Actor_Says_With_Pause(0, 3730, 2.0f, 13); - Actor_Says_With_Pause(3, 810, 1.0f, 53); - Actor_Says(3, 820, 30); - Actor_Says(0, 3735, 14); - Actor_Says(3, 830, 31); - Actor_Says(0, 3740, 19); -} - -void ScriptNR07::sub_4028FC() { - Actor_Says(0, 3620, 19); - Actor_Says(3, 840, 30); - Actor_Says(0, 3745, 9); - Actor_Says_With_Pause(3, 850, 1.0f, 30); - Actor_Says(3, 860, 30); - Actor_Says(3, 870, 53); - Actor_Says(0, 3750, 11); - Actor_Says(3, 880, 30); - Actor_Says(0, 3755, 16); - Actor_Says(3, 890, 31); -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/nr08.cpp b/engines/bladerunner/script/nr08.cpp deleted file mode 100644 index 62bf3c7bfd..0000000000 --- a/engines/bladerunner/script/nr08.cpp +++ /dev/null @@ -1,242 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptNR08::InitializeScene() { - if (Actor_Query_Goal_Number(1) == 231) { - Setup_Scene_Information(-1174.1f, 0.32f, 303.9f, 435); - } else if (Game_Flag_Query(546)) { - Scene_Loop_Start_Special(0, 0, 0); - Scene_Loop_Set_Default(1); - Setup_Scene_Information(-1102.88f, 0.0f, 107.43f, 0); - if (Actor_Query_Goal_Number(3) == 210) { - Music_Stop(1); - } - } else if (Game_Flag_Query(439)) { - Setup_Scene_Information(-724.7f, 0.0f, 384.24f, 1000); - Game_Flag_Reset(439); - } else if (Game_Flag_Query(615)) { - Setup_Scene_Information(-1663.33f, 0.65f, 342.84f, 330); - Game_Flag_Reset(615); - } - Scene_Exit_Add_2D_Exit(0, 610, 0, 639, 479, 1); - if (Actor_Query_Goal_Number(3) != 210) { - Scene_Exit_Add_2D_Exit(1, 0, 309, 30, 398, 3); - Scene_Exit_Add_2D_Exit(2, 520, 330, 556, 386, 0); - } - Ambient_Sounds_Add_Looping_Sound(280, 50, 38, 0); - Ambient_Sounds_Add_Sound(252, 3, 60, 14, 14, 60, 90, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(254, 3, 60, 14, 14, 60, 90, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(255, 3, 60, 14, 14, 60, 90, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(256, 3, 60, 14, 14, 60, 90, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(257, 3, 60, 14, 14, 60, 90, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(258, 3, 60, 14, 14, 60, 90, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(259, 3, 60, 16, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(260, 3, 60, 16, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(261, 3, 60, 16, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(262, 3, 60, 16, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(184, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(185, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(186, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(188, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(189, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(192, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Scene_Loop_Set_Default(1); -} - -void ScriptNR08::SceneLoaded() { - Obstacle_Object("BOX283", true); - Unobstacle_Object("BOX283", true); - if (Actor_Query_Goal_Number(3) == 210) { - Actor_Change_Animation_Mode(3, 79); - } -} - -bool ScriptNR08::MouseClick(int x, int y) { - return false; -} - -bool ScriptNR08::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptNR08::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptNR08::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptNR08::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -1102.88f, 0.0f, 107.43f, 0, 1, false, 0)) { - Game_Flag_Set(547); - Set_Enter(13, 58); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -724.7f, 0.0f, 384.24f, 0, 1, false, 0)) { - Actor_Face_Heading(0, 505, false); - Loop_Actor_Travel_Stairs(0, 4, 1, 0); - Game_Flag_Set(440); - Set_Enter(56, 59); - } - return true; - } - if (exitId == 2) { - if (!Loop_Actor_Walk_To_XYZ(0, -1663.33f, 0.65f, 342.84f, 0, 1, false, 0)) { - Actor_Face_Heading(0, 831, false); - Footstep_Sound_Override_On(2); - Loop_Actor_Travel_Stairs(0, 6, 1, 0); - Footstep_Sound_Override_Off(); - Game_Flag_Set(614); - Set_Enter(58, 62); - } - } - return false; -} - -bool ScriptNR08::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptNR08::SceneFrameAdvanced(int frame) { - if (!Music_Is_Playing()) { - sub_4021B4(); - } - Set_Fade_Color(0, 0, 0); - if (frame >= 76 && frame < 91) { - Set_Fade_Density((frame - 76) / 14.0f); - Music_Stop(3); - Ambient_Sounds_Play_Sound(566, 27, 0, 99, 0); - } else if (frame >= 91 && frame < 120) { - Actor_Set_Invisible(0, true); - Set_Fade_Density(1.0f); - } else if (frame >= 120 && frame < 135) { - Set_Fade_Density((134 - frame) / 14.0f); - Music_Play(7, 61, 0, 1, -1, 0, 0); - } else { - Actor_Set_Invisible(0, false); - Set_Fade_Density(0.0f); - } - if (Game_Flag_Query(651) && !Game_Flag_Query(636)) { - Game_Flag_Set(636); - Scene_Exits_Disable(); - Scene_Loop_Set_Default(1); - Scene_Loop_Start_Special(2, 3, 1); - } - if (frame == 95) { - Actor_Put_In_Set(3, 91); - Actor_Set_At_Waypoint(3, 33, 0); - Actor_Change_Animation_Mode(3, 0); - Actor_Set_Goal_Number(3, 200); - Scene_Exit_Add_2D_Exit(1, 0, 309, 30, 398, 3); - Scene_Exit_Add_2D_Exit(2, 520, 330, 556, 386, 0); - } - if (frame == 130) { - Scene_Exits_Enable(); - } - //return false; -} - -void ScriptNR08::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptNR08::PlayerWalkedIn() { - if (Actor_Query_Goal_Number(3) != 210 || Game_Flag_Query(729)) { - Music_Adjust(51, 0, 2); - } else { - Game_Flag_Set(729); - Ambient_Sounds_Play_Sound(566, 27, 0, 99, 0); - Outtake_Play(40, 1, -1); - } - if (Actor_Query_Goal_Number(3) == 245) { - Actor_Face_Heading(3, 790, false); - Loop_Actor_Travel_Stairs(3, 8, 1, 0); - Actor_Set_Goal_Number(3, 246); - } - if (Actor_Query_Goal_Number(1) == 231) { - Actor_Says(1, 1640, 12); - if (!Game_Flag_Query(378)) { - Actor_Says(0, 3790, 13); - Actor_Says(1, 1650, 14); - } - Actor_Says(1, 1660, 12); - Actor_Says(0, 3795, 16); - Actor_Says(1, 1670, 13); - Actor_Says(1, 1680, 14); - Actor_Says(1, 1690, 15); - Actor_Set_Goal_Number(1, 235); - //return true; - return; - } else { - if (Game_Flag_Query(546)) { - Loop_Actor_Walk_To_XYZ(0, -1090.88f, 0.0f, 147.43f, 0, 1, false, 0); - Game_Flag_Reset(546); - } - //return false; - return; - } -} - -void ScriptNR08::PlayerWalkedOut() { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - if (!Game_Flag_Query(547)) { - Music_Stop(2); - } -} - -void ScriptNR08::DialogueQueueFlushed(int a1) { -} - -void ScriptNR08::sub_4021B4() { - if (Music_Is_Playing()) { - Music_Adjust(51, 0, 2); - } else if (Actor_Query_Goal_Number(3) == 210) { - Music_Play(6, 61, 0, 1, -1, 0, 0); - } else { - int v0 = Global_Variable_Query(54); - if (v0 == 0) { - Music_Play(16, 61, -80, 2, -1, 0, 0); - } else if (v0 == 1) { - Music_Play(15, 41, -80, 2, -1, 0, 0); - } else if (v0 == 2) { - Music_Play(7, 41, -80, 2, -1, 0, 0); - } - v0++; - if (v0 > 2) { - v0 = 0; - } - Global_Variable_Set(54, v0); - } -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/nr09.cpp b/engines/bladerunner/script/nr09.cpp deleted file mode 100644 index 8453fa3420..0000000000 --- a/engines/bladerunner/script/nr09.cpp +++ /dev/null @@ -1,145 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptNR09::InitializeScene() { - if (Game_Flag_Query(476)) { - if (!Game_Flag_Query(640)) { - Ambient_Sounds_Adjust_Looping_Sound(452, 22, 100, 2); - } - Game_Flag_Reset(476); - Setup_Scene_Information(-556.07f, 0.35f, 399.04f, 440); - } else { - if (!Game_Flag_Query(640)) { - Ambient_Sounds_Add_Looping_Sound(452, 22, 100, 1); - } - Setup_Scene_Information(-704.07f, 0.35f, 663.04f, 0); - } - Scene_Exit_Add_2D_Exit(0, 400, 100, 440, 280, 1); - Scene_Exit_Add_2D_Exit(1, 0, 0, 30, 479, 3); - Ambient_Sounds_Add_Looping_Sound(205, 22, 0, 1); - Ambient_Sounds_Add_Looping_Sound(71, 33, 0, 1); - Ambient_Sounds_Add_Sound(303, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(304, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(305, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(306, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(307, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(308, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0); -} - -void ScriptNR09::SceneLoaded() { - Obstacle_Object("X2NEWSPAPER", true); - Unobstacle_Object("X2NEWSPAPER", true); - Unclickable_Object("X2NEWSPAPER"); -} - -bool ScriptNR09::MouseClick(int x, int y) { - return false; -} - -bool ScriptNR09::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptNR09::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptNR09::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptNR09::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -564.07f, 0.35f, 399.04f, 0, 1, false, 0)) { - Game_Flag_Set(475); - Set_Enter(59, 63); - return true; - } - } - if (exitId == 1) { - int v1 = Loop_Actor_Walk_To_XYZ(0, -704.07f, 0.35f, 663.04f, 0, 1, false, 0); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - if (!v1) { - Game_Flag_Set(615); - Set_Enter(13, 61); - return true; - } - } - return false; -} - -bool ScriptNR09::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptNR09::SceneFrameAdvanced(int frame) { - if (!Music_Is_Playing()) { - sub_40172C(); - } -} - -void ScriptNR09::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptNR09::PlayerWalkedIn() { - if (Game_Flag_Query(614)) { - Loop_Actor_Walk_To_XYZ(0, -704.07001f, 0.35f, 623.04f, 0, 0, false, 0); - Game_Flag_Reset(614); - } - //return false; -} - -void ScriptNR09::PlayerWalkedOut() { - if (Game_Flag_Query(475)) { - Music_Stop(2); - } -} - -void ScriptNR09::DialogueQueueFlushed(int a1) { -} - -void ScriptNR09::sub_40172C() { - if (Music_Is_Playing()) { - Music_Adjust(31, -80, 2); - } else { - int v0 = Global_Variable_Query(54); - if (v0 == 0) { - Music_Play(16, 61, -80, 2, -1, 0, 0); - } else if (v0 == 1) { - Music_Play(15, 41, -80, 2, -1, 0, 0); - } else if (v0 == 2) { - Music_Play(7, 41, -80, 2, -1, 0, 0); - } - v0++; - if (v0 > 2) { - v0 = 0; - } - Global_Variable_Set(54, v0); - } -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/nr10.cpp b/engines/bladerunner/script/nr10.cpp deleted file mode 100644 index f52d80889d..0000000000 --- a/engines/bladerunner/script/nr10.cpp +++ /dev/null @@ -1,164 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptNR10::InitializeScene() { - if (Game_Flag_Query(475)) { - Game_Flag_Reset(475); - Setup_Scene_Information(-136.78f, 2.84f, -234.43f, 320); - } else { - Game_Flag_Reset(477); - Setup_Scene_Information(19.22f, 2.84f, -250.43f, 540); - } - Scene_Exit_Add_2D_Exit(0, 144, 163, 194, 318, 3); - Scene_Exit_Add_2D_Exit(1, 475, 95, 568, 230, 0); - Ambient_Sounds_Add_Looping_Sound(205, 22, 0, 1); - Ambient_Sounds_Add_Looping_Sound(71, 33, 0, 1); - Ambient_Sounds_Add_Sound(303, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(304, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(305, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(306, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(307, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(308, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0); - if (Game_Flag_Query(640)) { - Scene_Loop_Set_Default(0); - } else { - Ambient_Sounds_Adjust_Looping_Sound(452, 31, 0, 1); - Scene_Loop_Set_Default(2); - } -} - -void ScriptNR10::SceneLoaded() { - Obstacle_Object("HOOK 01", true); - Unobstacle_Object("BOX21", true); - Unobstacle_Object("BOX23", true); - Unclickable_Object("BOX18"); -} - -bool ScriptNR10::MouseClick(int x, int y) { - return Game_Flag_Query(642); -} - -bool ScriptNR10::ClickedOn3DObject(const char *objectName, bool a2) { - if (Object_Query_Click("BOX18", objectName) && a2 && Game_Flag_Query(642)) { - Actor_Set_Goal_Number(3, 250); - Game_Flag_Set(640); - Game_Flag_Reset(642); - Actor_Set_Invisible(0, false); - Actor_Set_Invisible(3, false); - Ambient_Sounds_Remove_Looping_Sound(452, true); - Sound_Play(453, 52, 0, 0, 50); - Scene_Loop_Set_Default(0); - Scene_Loop_Start_Special(2, 0, 1); - Un_Combat_Target_Object("BOX18"); - Scene_Exits_Enable(); - return true; - } - return false; -} - -bool ScriptNR10::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptNR10::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptNR10::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -152.78f, 2.84f, -238.43f, 0, 1, false, 0)) { - Game_Flag_Set(476); - Set_Enter(58, 62); - return true; - } - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, 11.5f, 2.84f, -304.46f, 0, 1, false, 0)) { - Actor_Face_Heading(0, 55, false); - Loop_Actor_Travel_Ladder(0, 8, 1, 0); - Game_Flag_Set(641); - Set_Enter(60, 64); - return true; - } - } - return false; -} - -bool ScriptNR10::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptNR10::SceneFrameAdvanced(int frame) { - if (frame == 122) { - Game_Flag_Set(642); - Actor_Set_Invisible(0, true); - Actor_Set_Invisible(3, true); - Combat_Target_Object("BOX18"); - //return true; - return; - } - if (frame == 61 && Game_Flag_Query(642)) { - Game_Flag_Reset(642); - Player_Set_Combat_Mode(false); - Actor_Set_Invisible(0, false); - Actor_Set_Goal_Number(3, 247); - //return true; - return; - } - //return false; -} - -void ScriptNR10::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptNR10::PlayerWalkedIn() { - if (Actor_Query_Goal_Number(3) == 246) { - Player_Set_Combat_Mode(true); - //return true; - return; - } - if (Actor_Query_Goal_Number(1) == 236) { - Actor_Face_Actor(1, 0, true); - Actor_Says(1, 150, 13); - Actor_Face_Actor(0, 1, true); - Actor_Says(0, 1580, 14); - Actor_Says(1, 160, 15); - Actor_Says(0, 1585, 16); - Actor_Says(1, 1160, 16); - Delay(1000); - Actor_Says(1, 1290, 14); - Actor_Set_Goal_Number(1, 275); - } - // return false; -} - -void ScriptNR10::PlayerWalkedOut() { -} - -void ScriptNR10::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/nr11.cpp b/engines/bladerunner/script/nr11.cpp deleted file mode 100644 index 40d7478d2e..0000000000 --- a/engines/bladerunner/script/nr11.cpp +++ /dev/null @@ -1,382 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptNR11::InitializeScene() { - Setup_Scene_Information(100.0f, 1.75f, -4.0f, 0); - Scene_Exit_Add_2D_Exit(0, 450, 305, 565, 345, 2); - if (!Game_Flag_Query(640)) { - Ambient_Sounds_Adjust_Looping_Sound(452, 22, 0, 1); - } - Ambient_Sounds_Add_Looping_Sound(205, 22, 0, 1); - Ambient_Sounds_Add_Looping_Sound(71, 33, 0, 1); - Ambient_Sounds_Add_Sound(303, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(304, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(305, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(306, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(307, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(308, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0); - if (Game_Flag_Query(632)) { - Scene_Loop_Set_Default(3); - Ambient_Sounds_Add_Looping_Sound(381, 83, 0, 1); - } else if (Game_Flag_Query(634)) { - Scene_Loop_Set_Default(5); - Ambient_Sounds_Add_Looping_Sound(381, 83, 0, 1); - } else { - Scene_Loop_Set_Default(0); - Overlay_Play("NR11OVER", 0, 1, 0, 0); - } -} - -void ScriptNR11::SceneLoaded() { - Obstacle_Object("COATRACK", true); - Unobstacle_Object("BOX13", true); - Clickable_Object("LOFT04"); - Unclickable_Object("LOFT04"); - if (Actor_Query_Goal_Number(3) == 250) { - Clickable_Object("CLOTHING02"); - Clickable_Object("BOX27"); - Clickable_Object("BOX39"); - Clickable_Object("BOX44"); - Clickable_Object("DRESS"); - Clickable_Object("COATRACK"); - Clickable_Object("COLUMN3 DETS"); - Clickable_Object("COLUMN PIPE01"); - Clickable_Object("RECTANGLE02"); - Clickable_Object("COLUMN04"); - Clickable_Object("COATRACK01"); - Clickable_Object("SHIRT"); - Clickable_Object("SKIRT 02"); - Clickable_Object("CLOTHING B 03"); - Clickable_Object("BUST BUST"); - Combat_Target_Object("CLOTHING02"); - Combat_Target_Object("BOX27"); - Combat_Target_Object("BOX39"); - Combat_Target_Object("BOX44"); - Combat_Target_Object("DRESS"); - Combat_Target_Object("COATRACK"); - Combat_Target_Object("COLUMN3 DETS"); - Combat_Target_Object("COLUMN PIPE01"); - Combat_Target_Object("RECTANGLE02"); - Combat_Target_Object("COLUMN04"); - Combat_Target_Object("COATRACK01"); - Combat_Target_Object("SHIRT"); - Combat_Target_Object("SKIRT 02"); - Combat_Target_Object("CLOTHING B 03"); - Combat_Target_Object("BUST BUST"); - } else { - Unclickable_Object("CLOTHING02"); - Unclickable_Object("BOX27"); - Unclickable_Object("BOX39"); - Unclickable_Object("BOX44"); - Unclickable_Object("DRESS"); - Unclickable_Object("COATRACK"); - Unclickable_Object("COLUMN3 DETS"); - Unclickable_Object("COLUMN PIPE01"); - Unclickable_Object("RECTANGLE02"); - Unclickable_Object("COLUMN04"); - Unclickable_Object("COATRACK01"); - Unclickable_Object("SHIRT"); - Unclickable_Object("SKIRT 02"); - Unclickable_Object("CLOTHING B 03"); - Unclickable_Object("BUST BUST"); - } -} - -bool ScriptNR11::MouseClick(int x, int y) { - return false; -} - -bool ScriptNR11::ClickedOn3DObject(const char *objectName, bool a2) { - - if (Object_Query_Click("CLOTHING02", objectName) || Object_Query_Click("BOX27", objectName) || Object_Query_Click("BOX39", objectName) || Object_Query_Click("BOX44", objectName) || Object_Query_Click("DRESS", objectName) || Object_Query_Click("COATRACK", objectName) || Object_Query_Click("COLUMN3 DETS", objectName) || Object_Query_Click("COLUMN PIPE01", objectName) || Object_Query_Click("RECTANGLE02", objectName) || Object_Query_Click("COLUMN04", objectName) || Object_Query_Click("COATRACK01", objectName) || Object_Query_Click("SHIRT", objectName) || Object_Query_Click("SKIRT 02", objectName) || Object_Query_Click("CLOTHING B 03", objectName) || Object_Query_Click("BUST BUST", objectName)) { - if (a2) { - Actor_Set_Goal_Number(1, 211); - Scene_Exits_Disable(); - sub_4028EC(); - Player_Loses_Control(); - if (!Player_Query_Combat_Mode()) { - Player_Set_Combat_Mode(true); - } - Actor_Set_Goal_Number(0, 230); - Scene_Loop_Set_Default(3); - Scene_Loop_Start_Special(2, 2, 1); - } else if (Actor_Query_Goal_Number(3) == 250) { - if (!Loop_Actor_Walk_To_XYZ(0, 24.0f, 0.33f, 0.0f, 0, 1, false, 0)) { - Actor_Face_XYZ(0, -180.0f, 0.0f, -170.0f, true); - sub_4028EC(); - Actor_Set_Goal_Number(1, 211); - if (Actor_Query_Friendliness_To_Other(3, 0) < 30) { - Actor_Set_At_XYZ(3, 0.5f, 0.33f, -162.0f, 0); - Loop_Actor_Walk_To_XYZ(3, -24.0f, 0.33f, -35.4f, 0, 0, true, 0); - Actor_Face_Actor(0, 3, true); - Actor_Change_Animation_Mode(3, 71); - Delay(500); - Actor_Change_Animation_Mode(0, 48); - Delay(2000); - Actor_Set_Goal_Number(0, 231); - } else { - Actor_Says(0, 3840, 18); - Delay(1000); - if (Actor_Query_Friendliness_To_Other(3, 0) > 59 && !Global_Variable_Query(45)) { - Music_Play(21, 35, 0, 3, -1, 0, 0); - } - Loop_Actor_Walk_To_XYZ(3, -135.0f, 0.33000001f, -267.0f, 0, 0, false, 0); - Actor_Face_Actor(3, 0, true); - Actor_Face_Actor(0, 3, true); - Actor_Clue_Acquire(0, 107, 1, 3); - Actor_Says(3, 990, 13); - Actor_Says(3, 1000, 14); - Loop_Actor_Walk_To_Actor(3, 0, 108, 0, false); - Actor_Says(0, 3845, 13); - Actor_Says(0, 3850, 15); - Actor_Says(3, 1010, 14); - Actor_Says(0, 3855, 13); - Actor_Says(3, 1020, 12); - Actor_Says(0, 3860, 12); - Actor_Says_With_Pause(3, 1030, 1.0f, 14); - Actor_Says(3, 1040, 13); - Actor_Says(0, 3865, 15); - Actor_Says_With_Pause(3, 1050, 0.80000001f, 14); - Actor_Says(3, 1060, 13); - Actor_Says(0, 3870, 3); - Actor_Says(3, 1070, 14); - Actor_Modify_Friendliness_To_Other(3, 0, 5); - if (Actor_Query_Friendliness_To_Other(3, 0) > 55 && !Global_Variable_Query(45)) { - Global_Variable_Set(45, 2); - Actor_Says(3, 1130, 17); - Actor_Says(0, 6365, 12); - Actor_Says(3, 1140, 14); - Actor_Says(0, 6370, 14); - Actor_Says(3, 1150, 12); - Actor_Says(3, 1160, 16); - } - Actor_Says(3, 1080, 13); - Actor_Says(0, 3875, 14); - Actor_Says(3, 1090, 17); - Music_Stop(4); - Actor_Set_Goal_Number(3, 260); - if (Global_Variable_Query(40) == 1) { - Actor_Set_Goal_Number(1, 236); - } - Game_Flag_Set(591); - } - } else { - if (Random_Query(1, 2) == 1) { - Actor_Says(0, 8575, 14); - } else { - Actor_Says(0, 8580, 14); - } - } - } - return true; - } - return false; -} - -bool ScriptNR11::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptNR11::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptNR11::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, 100.0f, 1.75f, -8.0f, 0, 1, false, 0)) { - Game_Flag_Set(477); - Set_Enter(59, 63); - return true; - } - } - return false; -} - -bool ScriptNR11::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptNR11::SceneFrameAdvanced(int frame) { - if (frame == 62) { - Ambient_Sounds_Play_Sound(449, 40, 100, 100, 10); - } - if (frame == 67) { - Ambient_Sounds_Play_Sound(449, 30, 90, 90, 10); - } - if (frame == 74) { - Ambient_Sounds_Play_Sound(450, 50, 83, 83, 10); - } - if (frame == 80) { - Ambient_Sounds_Play_Sound(449, 60, 65, 65, 10); - } - if (frame == 92) { - Ambient_Sounds_Play_Sound(450, 30, 50, 50, 10); - } - if (frame == 97) { - Ambient_Sounds_Play_Sound(449, 50, -40, -40, 10); - } - if (frame == 103) { - Ambient_Sounds_Play_Sound(450, 40, -27, -27, 10); - } - if (frame == 109) { - Ambient_Sounds_Play_Sound(449, 60, -20, -20, 10); - } - if (frame == 62) { - Ambient_Sounds_Play_Sound(122, 80, 100, 100, 15); - } - if (Game_Flag_Query(659)) { - Game_Flag_Reset(659); - Overlay_Remove("NR11OVER"); - Overlay_Play("NR11OVER", 1, 0, 1, 0); - } - if (Game_Flag_Query(635)) { - sub_4028EC(); - Player_Loses_Control(); - if (!Player_Query_Combat_Mode()) { - Player_Set_Combat_Mode(true); - } - Actor_Set_Goal_Number(0, 230); - Scene_Loop_Set_Default(3); - Scene_Loop_Start_Special(2, 2, 1); - Game_Flag_Reset(635); - } else { - if (frame < 61 || frame > 120) { - //return false; - return; - } - sub_4027D0(0, frame); - if (Actor_Query_Goal_Number(1) == 215) { - sub_4027D0(1, frame); - } - if (frame == 120) { - Actor_Set_Goal_Number(0, 0); - Player_Gains_Control(); - if (Actor_Query_Goal_Number(1) == 215) { - Actor_Set_Goal_Number(1, 216); - } - Actor_Set_Goal_Number(3, 269); - } - } - //return true; -} - -void ScriptNR11::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptNR11::PlayerWalkedIn() { - if (Actor_Query_Goal_Number(3) == 250) { - Player_Set_Combat_Mode(true); - if (Game_Flag_Query(47)) { - Actor_Set_Goal_Number(1, 210); - } - } - if (Game_Flag_Query(632)) { - Game_Flag_Reset(632); - Game_Flag_Set(634); - Actor_Put_In_Set(3, 99); - Actor_Set_At_Waypoint(3, 41, 0); - Actor_Set_Invisible(0, false); - Player_Set_Combat_Mode(false); - Player_Gains_Control(); - if (Game_Flag_Query(47)) { - if (Actor_Query_Goal_Number(1) == 211) { - Actor_Set_At_XYZ(0, -37.41f, 0.33f, -86.0f, 26); - Delay(500); - Actor_Face_Current_Camera(0, true); - Delay(750); - Actor_Says(0, 5290, 12); - Delay(1000); - Actor_Set_Goal_Number(1, 212); - Actor_Face_Actor(0, 1, true); - } else { - Actor_Set_At_XYZ(0, -15.53f, 0.33f, 73.49f, 954); - Actor_Modify_Friendliness_To_Other(1, 0, 3); - Delay(1500); - Actor_Says(0, 3805, 12); - Actor_Face_Actor(0, 1, true); - Actor_Face_Actor(1, 0, true); - Actor_Says_With_Pause(1, 1720, 0.3f, 16); - Actor_Says(0, 3810, 16); - Actor_Says_With_Pause(1, 1730, 0.2f, 14); - Actor_Says(1, 1740, 15); - Actor_Set_Goal_Number(3, 599); - Actor_Put_In_Set(3, 99); - Actor_Set_At_Waypoint(3, 41, 0); - Actor_Set_Goal_Number(1, 275); - } - } else { - Actor_Set_Goal_Number(0, 500); - } - } - // return true; -} - -void ScriptNR11::PlayerWalkedOut() { - -} - -void ScriptNR11::DialogueQueueFlushed(int a1) { -} - -void ScriptNR11::sub_4027D0(int actorId, signed int frame) { - float x; - float y; - float z; - float coef; - - if (frame < 80) { - coef = (frame - 60) / 20.0f; - x = -106.66f * coef + 126.0f; - y = 57.79f * coef + 0.85f; - z = 42.0f * coef + -151.0f; - } else { - coef = (frame - 80) / 40.0f; - x = -97.87f * coef + -150.0f; - y = -10.8f * coef + 52.0f; - z = 57.0f * coef + -232.0f; - } - Actor_Face_XYZ(actorId, x, y, z, true); -} - -void ScriptNR11::sub_4028EC() { - Un_Combat_Target_Object("CLOTHING02"); - Un_Combat_Target_Object("BOX27"); - Un_Combat_Target_Object("BOX39"); - Un_Combat_Target_Object("BOX44"); - Un_Combat_Target_Object("DRESS"); - Un_Combat_Target_Object("COATRACK"); - Un_Combat_Target_Object("COLUMN3 DETS"); - Un_Combat_Target_Object("COLUMN PIPE01"); - Un_Combat_Target_Object("RECTANGLE02"); - Un_Combat_Target_Object("COLUMN04"); - Un_Combat_Target_Object("COATRACK01"); - Un_Combat_Target_Object("SHIRT"); - Un_Combat_Target_Object("SKIRT 02"); - Un_Combat_Target_Object("CLOTHING B 03"); - Un_Combat_Target_Object("BUST BUST"); -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ps01.cpp b/engines/bladerunner/script/ps01.cpp deleted file mode 100644 index 1af1b93ed7..0000000000 --- a/engines/bladerunner/script/ps01.cpp +++ /dev/null @@ -1,277 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptPS01::InitializeScene() { - Setup_Scene_Information(1872.0f, 16592.0f, -2975.0f, 200); - Scene_Exit_Add_2D_Exit(0, 36, 194, 138, 326, 0); - if (Game_Flag_Query(251)) { - Scene_Exit_Add_2D_Exit(1, 344, 288, 584, 384, 2); - } - Ambient_Sounds_Add_Looping_Sound(381, 100, 1, 1); - Ambient_Sounds_Add_Sound(68, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(69, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(375, 60, 180, 50, 100, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(376, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(377, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0); - if (Game_Flag_Query(130)) { - if (Game_Flag_Query(251)) { - Scene_Loop_Set_Default(1); - } else { - Scene_Loop_Set_Default(5); - } - } else { - Actor_Set_Invisible(0, true); - Game_Flag_Set(273); - Scene_Loop_Start_Special(0, 0, 0); - Scene_Loop_Set_Default(1); - Player_Loses_Control(); - } -} - -void ScriptPS01::SceneLoaded() { - Obstacle_Object("TUBE81", true); - if (Game_Flag_Query(251)) { - Unobstacle_Object("Barrier Obstacle", true); - } - Unobstacle_Object("BOX38", true); - Unobstacle_Object("TUBE81", true); -} - -bool ScriptPS01::MouseClick(int x, int y) { - return false; -} - -bool ScriptPS01::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptPS01::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptPS01::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptPS01::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, 1920.0f, 16581.0f, -2653.0f, 12, 1, false, 0)) { - Game_Flag_Set(718); - Set_Enter(62, 66); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, 1877.9f, 16592.0f, -2975.0f, 0, 1, false, 0)) { - Actor_Set_At_XYZ(0, 1872.0f, 16592.0f, -2975.0f, 870); - Game_Flag_Reset(176); - Game_Flag_Reset(182); - Game_Flag_Reset(179); - Game_Flag_Reset(178); - Game_Flag_Reset(180); - Game_Flag_Reset(261); - Game_Flag_Reset(177); - Game_Flag_Reset(258); - int spinnerDest = Spinner_Interface_Choose_Dest(3, 1); - switch (spinnerDest) { - case 2: - Game_Flag_Set(182); - Game_Flag_Reset(251); - Game_Flag_Set(249); - Set_Enter(69, 78); - Scene_Loop_Start_Special(1, 4, 1); - break; - case 1: - Game_Flag_Set(179); - Game_Flag_Reset(251); - Game_Flag_Set(250); - Set_Enter(49, 48); - Scene_Loop_Start_Special(1, 4, 1); - break; - case 3: - Game_Flag_Set(176); - Game_Flag_Reset(251); - Game_Flag_Set(248); - Set_Enter(4, 13); - Scene_Loop_Start_Special(1, 4, 1); - break; - case 5: - Game_Flag_Set(261); - Game_Flag_Reset(251); - Game_Flag_Set(307); - Set_Enter(17, 82); - Scene_Loop_Start_Special(1, 4, 1); - break; - case 4: - Game_Flag_Set(180); - Game_Flag_Reset(251); - Game_Flag_Set(252); - Set_Enter(0, 0); - Scene_Loop_Start_Special(1, 4, 1); - break; - case 6: - Game_Flag_Set(177); - Game_Flag_Reset(251); - Game_Flag_Set(253); - Set_Enter(7, 25); - Scene_Loop_Start_Special(1, 4, 1); - break; - case 7: - Game_Flag_Set(258); - Game_Flag_Reset(251); - Game_Flag_Set(254); - Set_Enter(20, 2); - Scene_Loop_Start_Special(1, 4, 1); - break; - case 8: - Game_Flag_Set(181); - Game_Flag_Reset(251); - Game_Flag_Set(255); - Set_Enter(54, 54); - Scene_Loop_Start_Special(1, 4, 1); - break; - case 9: - Game_Flag_Set(257); - Game_Flag_Reset(251); - Game_Flag_Set(256); - Set_Enter(37, 34); - Scene_Loop_Start_Special(1, 4, 1); - break; - default: - Actor_Face_Heading(0, 870, false); - Game_Flag_Set(178); - Game_Flag_Set(273); - Player_Loses_Control(); - Scene_Loop_Start_Special(2, 3, 1); - break; - } - } - return true; - } - return false; -} - -bool ScriptPS01::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptPS01::SceneFrameAdvanced(int frame) { - if (frame == 71 || frame == 188) { - Sound_Play(116, 100, 40, 0, 50); - } - if (frame == 108 || frame == 228) { - Sound_Play(119, 100, 40, 0, 50); - } - if (frame == 1) { - Sound_Play(118, 40, 0, 0, 50); - } - if (frame == 76) { - Sound_Play(121, 50, 0, 0, 50); - } - if (frame == 192) { - Sound_Play(120, 50, 0, 0, 50); - } - if (frame == 59) { - Sound_Play(122, 15, 0, 0, 50); - } - if (frame == 275) { - Sound_Play(117, 40, 0, 0, 50); - } - if (!Game_Flag_Query(273)) { - switch (frame) { - case 196: - Actor_Face_Heading(0, 870, false); - Actor_Set_Frame_Rate_FPS(0, -1); - Actor_Change_Animation_Mode(0, 41); - break; - case 220: - Actor_Set_Frame_Rate_FPS(0, 0); - break; - case 240: - Actor_Set_Frame_Rate_FPS(0, -2); - break; - } - //return true; - return; - } - if (frame == 75) { - Actor_Face_Heading(0, 870, false); - Actor_Change_Animation_Mode(0, 42); - //return true; - return; - } - if (frame == 119) { - Game_Flag_Reset(273); - Player_Gains_Control(); - //return true; - return; - } - if (frame > 195) { - if (frame == 239) { - Game_Flag_Reset(273); - Player_Gains_Control(); - } - //return true; - return; - } - if (frame == 181) { - Actor_Face_Heading(0, 870, false); - Actor_Change_Animation_Mode(0, 42); - } else if (frame == 182) { - Actor_Set_Frame_Rate_FPS(0, 0); - } else if (frame == 195) { - Actor_Set_Frame_Rate_FPS(0, -2); - } - //return true; - return; -} - -void ScriptPS01::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptPS01::PlayerWalkedIn() { - if (Game_Flag_Query(130)) { - Actor_Set_At_XYZ(0, 1920.0f, 16581.0f, -2653.0f, 150); - Game_Flag_Reset(130); - } - //return false; -} - -void ScriptPS01::PlayerWalkedOut() { - Actor_Set_Invisible(0, false); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - if (!Game_Flag_Query(718) && Global_Variable_Query(1) == 1) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Outtake_Play(38, 1, -1); - } -} - -void ScriptPS01::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ps02.cpp b/engines/bladerunner/script/ps02.cpp deleted file mode 100644 index 3ca56e1550..0000000000 --- a/engines/bladerunner/script/ps02.cpp +++ /dev/null @@ -1,177 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptPS02::InitializeScene() { - Player_Loses_Control(); - Setup_Scene_Information(-13.31f, -40.28f, -48.12f, 30); - Scene_Exit_Add_2D_Exit(0, 0, 0, 240, 479, 3); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(0); - Ambient_Sounds_Add_Looping_Sound(386, 20, 1, 1); - Ambient_Sounds_Add_Looping_Sound(210, 20, 1, 1); - Ambient_Sounds_Add_Sound(0, 3, 20, 12, 16, 0, 0, -101, -101, 0, 0); - Scene_Loop_Start_Special(0, 0, 0); - Scene_Loop_Set_Default(1); -} - -void ScriptPS02::SceneLoaded() { - Obstacle_Object("E.DOOR01", true); - Obstacle_Object("E.DOOR02", true); - Clickable_Object("E.DOOR01"); - Clickable_Object("E.DOOR02"); -} - -bool ScriptPS02::MouseClick(int x, int y) { - return false; -} - -bool ScriptPS02::ClickedOn3DObject(const char *objectName, bool a2) { - if (Object_Query_Click("E.DOOR01", objectName) || Object_Query_Click("E.D00R02", objectName)) { - if (Game_Flag_Query(130) ) { - if (!Loop_Actor_Walk_To_XYZ(0, -5.0f, -40.0f, -15.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Set_Enter(61, 65); - Scene_Loop_Start_Special(1, 3, 1); - } - } else if (Game_Flag_Query(22) ) { - if (!Loop_Actor_Walk_To_XYZ(0, -5.0f, -40.0f, -15.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Set_Enter(15, 69); - Scene_Loop_Start_Special(1, 3, 1); - } - } else if (Game_Flag_Query(131) ) { - if (!Loop_Actor_Walk_To_XYZ(0, -5.0f, -40.0f, -15.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Set_Enter(66, 71); - Scene_Loop_Start_Special(1, 3, 1); - } - } else if (Game_Flag_Query(132) ) { - if (!Loop_Actor_Walk_To_XYZ(0, -5.0f, -40.0f, -15.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Set_Enter(63, 67); - Scene_Loop_Start_Special(1, 3, 1); - } - } else if (Game_Flag_Query(133) && !Loop_Actor_Walk_To_XYZ(0, -5.0f, -40.0f, -15.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Set_Enter(67, 72); - Scene_Loop_Start_Special(1, 3, 1); - } - } - return false; -} - -bool ScriptPS02::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptPS02::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptPS02::ClickedOnExit(int exitId) { - return false; -} - -bool ScriptPS02::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptPS02::SceneFrameAdvanced(int frame) { - if (frame == 1) { - Ambient_Sounds_Play_Sound(208, 45, 0, 0, 0); - } - if (frame == 91) { - Ambient_Sounds_Play_Sound(209, 45, 0, 0, 0); - } - //return true; -} - -void ScriptPS02::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptPS02::PlayerWalkedIn() { - Game_Flag_Reset(718); - Actor_Face_XYZ(0, 0, 0, 450.0f, true); - Player_Gains_Control(); - sub_4018BC(); - Player_Loses_Control(); - if (Game_Flag_Query(130) ) { - Set_Enter(61, 65); - Scene_Loop_Start_Special(1, 3, 1); - } else if (Game_Flag_Query(22) ) { - Set_Enter(15, 69); - Scene_Loop_Start_Special(1, 3, 1); - } else if (Game_Flag_Query(131) ) { - Set_Enter(66, 71); - Scene_Loop_Start_Special(1, 3, 1); - } else if (Game_Flag_Query(132) ) { - Set_Enter(63, 67); - Scene_Loop_Start_Special(1, 3, 1); - } else if (Game_Flag_Query(133) ) { - Set_Enter(67, 72); - Scene_Loop_Start_Special(1, 3, 1); - } - //return true; -} - -void ScriptPS02::PlayerWalkedOut() { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Player_Gains_Control(); -} - -void ScriptPS02::DialogueQueueFlushed(int a1) { -} - -void ScriptPS02::sub_4018BC() { - Scene_Exits_Disable(); - switch (Elevator_Activate(2)) { - case 7: - Game_Flag_Set(133); - break; - case 6: - Game_Flag_Set(132); - break; - case 5: - Game_Flag_Set(22); - break; - case 4: - Game_Flag_Set(130); - break; - case 3: - Game_Flag_Set(131); - break; - default: - break; - } - Scene_Exits_Enable(); -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ps03.cpp b/engines/bladerunner/script/ps03.cpp deleted file mode 100644 index e3835d04db..0000000000 --- a/engines/bladerunner/script/ps03.cpp +++ /dev/null @@ -1,134 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptPS03::InitializeScene() { - if (Game_Flag_Query(39)) { - Actor_Set_At_XYZ(0, -674.0f, -354.0f, 550.0f, 900); - Setup_Scene_Information(-674.0f, -354.62f, 550.0f, 900); - Game_Flag_Reset(39); - } else if (Game_Flag_Query(135)) { - Setup_Scene_Information(-875.0f, -354.62f, -1241.0f, 450); - Game_Flag_Reset(135); - } else { - Setup_Scene_Information(-569.54f, -354.62f, -1076.15f, 475); - Game_Flag_Reset(132); - } - Scene_Exit_Add_2D_Exit(0, 0, 460, 639, 479, 2); - Scene_Exit_Add_2D_Exit(1, 449, 273, 508, 329, 0); - if (Global_Variable_Query(1) > 1) { - Scene_Exit_Add_2D_Exit(2, 358, 245, 411, 288, 0); - } - Ambient_Sounds_Remove_All_Non_Looping_Sounds(0); - Ambient_Sounds_Add_Looping_Sound(45, 35, 0, 1); - Ambient_Sounds_Add_Sound(90, 5, 50, 7, 7, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(91, 5, 50, 7, 7, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(92, 5, 60, 33, 33, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(93, 5, 60, 33, 33, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(94, 5, 60, 33, 33, -100, 100, -101, -101, 0, 0); - Scene_Loop_Set_Default(1); -} - -void ScriptPS03::SceneLoaded() { - Obstacle_Object("TABLE05", true); - Unclickable_Object("COP1PS03"); - Unclickable_Object("COP2PS03"); -} - -bool ScriptPS03::MouseClick(int x, int y) { - return false; -} - -bool ScriptPS03::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptPS03::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptPS03::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptPS03::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -674.0f, -354.0f, 550.0f, 0, 1, false, 0)) { - Game_Flag_Set(42); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Set_Enter(64, 68); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -569.54f, -354.62f, -1076.15f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Set_Enter(62, 66); - Game_Flag_Reset(478); - if (Global_Variable_Query(1) < 4) { - Actor_Set_Goal_Number(4, 100); - } - } - return true; - } - if (exitId == 2) { - if (!Loop_Actor_Walk_To_XYZ(0, -875.0f, -354.0f, -1241.0f, 0, 1, false, 0)) { - Game_Flag_Set(134); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Set_Enter(68, 77); - } - return true; - } - return false; -} - -bool ScriptPS03::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptPS03::SceneFrameAdvanced(int frame) { -} - -void ScriptPS03::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptPS03::PlayerWalkedIn() { - if (!Game_Flag_Query(478)) { - Game_Flag_Set(478); - //return true; - } - //return false; -} - -void ScriptPS03::PlayerWalkedOut() { -} - -void ScriptPS03::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ps04.cpp b/engines/bladerunner/script/ps04.cpp deleted file mode 100644 index 3718c6d513..0000000000 --- a/engines/bladerunner/script/ps04.cpp +++ /dev/null @@ -1,304 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptPS04::InitializeScene() { - AI_Movement_Track_Pause(4); - if (Game_Flag_Query(42)) { - Game_Flag_Reset(42); - } - Setup_Scene_Information(-668.0f, -354.0f, 974.0f, 475); - if (Global_Variable_Query(1) == 1) { - Actor_Put_In_Set(4, 64); - Actor_Set_At_XYZ(4, -728.0f, -354.0f, 1090.0f, 150); - Actor_Change_Animation_Mode(4, 53); - } - Scene_Exit_Add_2D_Exit(0, 347, 113, 469, 302, 0); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(0); - Ambient_Sounds_Add_Looping_Sound(45, 16, 1, 1); - Ambient_Sounds_Add_Looping_Sound(46, 50, 1, 1); - Ambient_Sounds_Add_Sound(47, 9, 40, 20, 20, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(48, 9, 40, 20, 20, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(49, 9, 40, 20, 20, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(50, 9, 40, 20, 20, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(51, 9, 40, 20, 20, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(52, 9, 40, 20, 20, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(53, 9, 40, 20, 20, 0, 0, -101, -101, 0, 0); - Scene_Loop_Start_Special(0, 0, 0); - Scene_Loop_Set_Default(1); -} - -void ScriptPS04::SceneLoaded() { - Obstacle_Object("CHAIR07", true); - Unobstacle_Object("GOOD B.WALL", true); - Unobstacle_Object("B.DOOR", true); - Unobstacle_Object("B.CHAIR01", true); - Unclickable_Object("CHAIR07"); - if (Global_Variable_Query(1) == 2 && !Actor_Clue_Query(0, 80) && !Game_Flag_Query(727)) { - Item_Add_To_World(111, 958, 64, -643.5f, -318.82f, 1148.87f, 525, 16, 12, false, true, false, true); - Game_Flag_Set(727); - } - if (Actor_Query_Is_In_Current_Set(4)) { - Actor_Change_Animation_Mode(4, 53); - } -} - -bool ScriptPS04::MouseClick(int x, int y) { - return false; -} - -bool ScriptPS04::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptPS04::ClickedOnActor(int actorId) { - if (actorId == 4) { - if (!Loop_Actor_Walk_To_Actor(0, 4, 36, 1, false)) { - Actor_Face_Actor(0, 4, true); - Actor_Face_Actor(4, 0, true); - sub_4017E4(); - return true; - } - } - return false; -} - -bool ScriptPS04::ClickedOnItem(int itemId, bool a2) { - if (itemId == 111 && Actor_Query_Is_In_Current_Set(4)) { - Actor_Says(4, 560, 30); - } else if (!Actor_Clue_Query(0, 80)) { - Item_Remove_From_World(111); - Item_Pickup_Spin_Effect(958, 464, 362); - Actor_Says(0, 4485, 3); - Actor_Clue_Acquire(0, 80, 1, 0); - } - return false; -} - -bool ScriptPS04::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -668.0f, -350.85f, 962.0f, 0, 1, false, 0)) { - Game_Flag_Set(39); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Set_Enter(63, 67); - } - return true; - } - return false; -} - -bool ScriptPS04::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptPS04::SceneFrameAdvanced(int frame) { -} - -void ScriptPS04::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptPS04::PlayerWalkedIn() { - if (Actor_Query_Which_Set_In(4) == 64) { - Actor_Face_Actor(0, 4, true); - } - //return false; -} - -void ScriptPS04::PlayerWalkedOut() { - AI_Movement_Track_Unpause(4); -} - -void ScriptPS04::DialogueQueueFlushed(int a1) { -} - -void ScriptPS04::sub_4017E4() { - Dialogue_Menu_Clear_List(); - if (Global_Variable_Query(1) > 1) { - if (Actor_Clue_Query(0, 51)) { - DM_Add_To_List_Never_Repeat_Once_Selected(110, 5, 7, 4); - } - DM_Add_To_List_Never_Repeat_Once_Selected(120, 1, -1, -1); - if (Actor_Clue_Query(0, 110)) { - DM_Add_To_List_Never_Repeat_Once_Selected(150, 7, 6, 5); - } - } - if (Game_Flag_Query(169) == 1) { - DM_Add_To_List_Never_Repeat_Once_Selected(140, 3, -1, -1); - } - DM_Add_To_List(130, 1, 1, 1); - Dialogue_Menu_Add_DONE_To_List(160); - Dialogue_Menu_Appear(320, 240); - int answer = Dialogue_Menu_Query_Input(); - Dialogue_Menu_Disappear(); - switch (answer) { - case 130: - if (Game_Flag_Query(40) && !Game_Flag_Query(159)) { - Actor_Says(0, 3920, 13); - Actor_Says(4, 140, 30); - Actor_Face_Current_Camera(4, true); - Actor_Says(4, 150, 31); - Actor_Says(4, 160, 32); - Actor_Says(0, 3925, 18); - Actor_Face_Actor(4, 0, true); - Actor_Says(4, 170, 33); - Loop_Actor_Walk_To_XYZ(0, -716.0f, -354.85f, 1042.0f, 0, 0, false, 0); - Actor_Face_Actor(0, 4, true); - Actor_Says(0, 3930, 13); - Actor_Face_Actor(4, 0, true); - Actor_Says(4, 180, 34); - Actor_Says(0, 3935, 13); - Actor_Says(4, 190, 30); - Actor_Says(0, 3940, 16); - Actor_Says(4, 200, 31); - Actor_Says(4, 210, 33); - Actor_Says(4, 220, 34); - Actor_Says(0, 3945, 17); - Actor_Says(4, 230, 32); - Actor_Says(4, 240, 31); - Actor_Says(0, 3950, 13); - Actor_Says(4, 250, 34); - Actor_Says(4, 260, 33); - Actor_Says(4, 270, 32); - Game_Flag_Set(159); - if (Query_Difficulty_Level() != 0) { - Global_Variable_Increment(2, 200); - } - Game_Flag_Set(723); - } else if (Game_Flag_Query(41) && !Game_Flag_Query(160)) { - Actor_Says(0, 3955, 13); - Actor_Says(4, 280, 30); - Actor_Says(0, 3960, 18); - Actor_Says(4, 290, 32); - Actor_Says(4, 300, 31); - Actor_Says(0, 3965, 13); - Actor_Says(4, 310, 33); - Actor_Says(4, 320, 34); - Game_Flag_Set(160); - } else if ((Actor_Clue_Query(0, 8) || Actor_Clue_Query(0, 9)) && Actor_Clue_Query(0, 22) && Actor_Query_Friendliness_To_Other(4, 0) < 50 && !Game_Flag_Query(161)) { - Actor_Says(0, 3970, 18); - Actor_Says(4, 330, 30); - Actor_Says(4, 340, 32); - Actor_Says(0, 3975, 13); - Actor_Says(4, 350, 31); - Actor_Says(4, 360, 34); - Actor_Says(0, 3980, 13); - Actor_Says(4, 370, 33); - Actor_Says(4, 380, 32); - Actor_Says(4, 390, 31); - Actor_Says(0, 3985, 18); - Actor_Says(4, 400, 34); - Actor_Says(4, 410, 31); - Game_Flag_Set(161); - } else if ((Actor_Clue_Query(0, 8) || Actor_Clue_Query(0, 9)) - && Actor_Clue_Query(0, 22) - && !Game_Flag_Query(162)) { - Actor_Says(0, 3920, 13); - Actor_Says(4, 570, 32); - Actor_Says(0, 4070, 13); - Game_Flag_Set(162); - } else if (Actor_Query_Friendliness_To_Other(4, 0) >= 50) { - Actor_Says(0, 4020, 13); - Actor_Says(4, 580, 34); - Actor_Says(0, 4075, 16); - Actor_Says(4, 590, 33); - } else { - Actor_Says(0, 4020, 18); - Actor_Says(4, 130, 30); - Actor_Face_Current_Camera(4, true); - Actor_Says(0, 3915, 13); - } - break; - case 110: - Actor_Says(0, 3990, 19); - Actor_Says(0, 3995, 17); - Actor_Says(4, 440, 31); - Actor_Says(0, 4035, 13); - Actor_Says(4, 450, 34); - Actor_Says(4, 460, 33); - Actor_Says(0, 4040, 17); - Game_Flag_Set(625); - break; - case 120: - Actor_Says(0, 4000, 18); - Actor_Clue_Acquire(0, 82, 1, 4); - Actor_Says(4, 520, 33); - Actor_Says(0, 4055, 13); - Actor_Says(4, 530, 31); - Actor_Says(0, 4060, 13); - Actor_Says(4, 540, 31); - Actor_Says(4, 550, 32); - Actor_Says(0, 4065, 18); - Actor_Says(4, 560, 34); - if (Query_Difficulty_Level() != 0) { - Global_Variable_Increment(2, 100); - } - break; - case 140: - Actor_Says(0, 4010, 12); - Actor_Says(4, 600, 31); - Actor_Says(0, 4080, 18); - Actor_Says(4, 610, 33); - Actor_Face_Heading(4, 400, false); - Actor_Says(4, 620, 32); - Actor_Face_Actor(4, 0, true); - Actor_Says(4, 700, 34); - Actor_Says(0, 4100, 13); - Actor_Says(4, 710, 31); - Actor_Says(4, 720, 34); - Actor_Says(0, 4105, 18); - Loop_Actor_Walk_To_XYZ(0, -668.0f, -350.85f, 962.0f, 0, 0, false, 0); - Actor_Says(4, 730, 32); - Actor_Face_Actor(0, 4, true); - Loop_Actor_Walk_To_XYZ(0, -716.0f, -354.85f, 1042.0f, 0, 0, false, 0); - Actor_Face_Actor(4, 0, true); - Actor_Says(4, 740, 31); - Actor_Says(4, 750, 32); - Actor_Says(4, 760, 33); - Actor_Face_Actor(0, 4, true); - Actor_Says(0, 4110, 13); - Actor_Says(4, 770, 32); - Actor_Says(4, 780, 31); - break; - case 150: - Actor_Says(0, 4015, 16); - Actor_Says(4, 630, 34); - Actor_Says(0, 4085, 19); - Actor_Says(0, 4090, 18); - Actor_Says(4, 640, 31); - Actor_Says(4, 650, 32); - Actor_Says(4, 670, 34); - Actor_Says(0, 4095, 17); - Actor_Says(4, 680, 32); - Actor_Says(4, 690, 31); - break; - default: - //TODO: what is this for? - //answer != 160; - break; - } -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ps05.cpp b/engines/bladerunner/script/ps05.cpp deleted file mode 100644 index 0636daf163..0000000000 --- a/engines/bladerunner/script/ps05.cpp +++ /dev/null @@ -1,273 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptPS05::InitializeScene() { - if (Game_Flag_Query(21)) { - Setup_Scene_Information(547.59f, 0.18f, -216.84f, 334); - } else if (Game_Flag_Query(22)) { - Setup_Scene_Information(635.0f, 0.0f, -598.0f, 475); - } else { - Setup_Scene_Information(630.72f, 0.38f, -469.26f, 400); - } - Scene_Exit_Add_2D_Exit(0, 218, 98, 280, 246, 3); - Scene_Exit_Add_2D_Exit(1, 330, 90, 436, 198, 0); - Scene_Exit_Add_2D_Exit(2, 476, 96, 524, 240, 1); - Scene_2D_Region_Add(0, 519, 107, 537, 122); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(0); - Ambient_Sounds_Add_Looping_Sound(384, 50, 1, 1); - Ambient_Sounds_Add_Looping_Sound(141, 80, 0, 1); - Ambient_Sounds_Add_Sound(385, 5, 50, 8, 8, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(156, 5, 20, 30, 30, -70, 70, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(157, 5, 20, 30, 30, -70, 70, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(158, 5, 20, 30, 30, -70, 70, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(73, 5, 20, 5, 9, -70, 70, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(74, 5, 20, 5, 9, -70, 70, -101, -101, 0, 0); -} - -void ScriptPS05::SceneLoaded() { - Obstacle_Object("WATER FOUNTAIN", true); - Clickable_Object("WATER FOUNTAIN"); - Clickable_Object("ASHTRAY"); - Clickable_Object("FIRE EXTINGISHER"); - Clickable_Object("CUP"); - Clickable_Object("WIRE BASKET"); - Clickable_Object("WANTED POSTERS"); - Unclickable_Object("WATER FOUNTAIN"); - Unclickable_Object("CUP"); -} - -bool ScriptPS05::MouseClick(int x, int y) { - return false; -} - -bool ScriptPS05::ClickedOn3DObject(const char *objectName, bool a2) { - if (Object_Query_Click("WATER FOUNTAIN", objectName) && !Loop_Actor_Walk_To_Scene_Object(0, "WATER FOUNTAIN", 12, 1, false)) { - Actor_Face_Object(0, "WATER FOUNTAIN", true); - Actor_Says(0, 3490, 18); - } - if (Object_Query_Click("ASHTRAY", objectName) && !Loop_Actor_Walk_To_XYZ(0, 662.0f, 0.37f, -180.0f, 0, 1, false, 0)) { - Actor_Face_Object(0, "ASHTRAY", true); - Actor_Voice_Over(1770, 99); - Actor_Voice_Over(1780, 99); - Actor_Voice_Over(1790, 99); - } - if (Object_Query_Click("WIRE BASKET", objectName) && !Loop_Actor_Walk_To_Scene_Object(0, "WIRE BASKET", 12, 1, false)) { - Actor_Face_Object(0, "WIRE BASKET", true); - Actor_Voice_Over(1810, 99); - Actor_Voice_Over(1820, 99); - } - if (Object_Query_Click("WANTED POSTERS", objectName) && !Loop_Actor_Walk_To_Scene_Object(0, "WANTED POSTERS", 12, 1, false)) { - Actor_Face_Object(0, "WANTED POSTERS", true); - Actor_Voice_Over(1800, 99); - } - return false; -} - -bool ScriptPS05::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptPS05::ClickedOnItem(int itemId, bool a2) { - if (Game_Flag_Query(23)) { - Actor_Set_At_XYZ(0, 718.72f, 0.37f, -461.26f, 600); - } else if (Game_Flag_Query(22)) { - sub_401B34(); - sub_401C30(); - } - Game_Flag_Reset(22); - Game_Flag_Reset(23); - Game_Flag_Reset(21); - Game_Flag_Reset(204); - return false; -} - -bool ScriptPS05::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_Waypoint(0, 2, 24, 1, false)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Set_Enter(101, 119); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, 635.0f, 0.0f, -598.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Set_Enter(62, 66); - } - return true; - } - if (exitId == 2) { - if (!Loop_Actor_Walk_To_XYZ(0, 742.52002f, 0.37f, -457.69f, 0, 1, false, 0)) { - Game_Flag_Set(136); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Set_Enter(65, 70); - } - return true; - } - return false; -} - -bool ScriptPS05::ClickedOn2DRegion(int region) { - if (region == 0 && !Loop_Actor_Walk_To_XYZ(0, 694.78f, 0.37f, -321.05f, 0, 1, false, 0)) { - Actor_Face_Heading(0, 130, false); - View_Score_Board(); - } - return false; -} - -void ScriptPS05::SceneFrameAdvanced(int frame) { - if (frame == 1 || frame == 16 || frame == 31 || frame == 46) { - Sound_Play(149, Random_Query(10, 10), 70, 70, 50); - } - //return true; -} - -void ScriptPS05::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptPS05::PlayerWalkedIn() { -} - -void ScriptPS05::PlayerWalkedOut() { -} - -void ScriptPS05::DialogueQueueFlushed(int a1) { - Overlay_Remove("PS05OVER"); -} - -void ScriptPS05::sub_401B34() { - int v0; - int v1; - int v3[7]; - - v0 = 0; - if (Global_Variable_Query(1) < 4 && Game_Flag_Query(45)) { - v0 = 1; - v3[0] = 0; - } - v1 = v0 + 1; - v3[v0] = 1; - if (Global_Variable_Query(1) >= 3) { - v3[v1] = 2; - v1 = v0 + 2; - } - if (Global_Variable_Query(1) >= 2 && Global_Variable_Query(1) <= 4) { - v3[v1++] = 3; - } - if (Game_Flag_Query(171) && Game_Flag_Query(170)) { - v3[v1++] = 4; - } - if (v1 <= 0) { - Global_Variable_Set(52, -1); - } else { - Global_Variable_Set(52, v3[Random_Query(0, v1 - 1)]); - } -} - -void ScriptPS05::sub_401C30() { - switch (Global_Variable_Query(52)) { - case 4: - if (!Game_Flag_Query(692)) { - Overlay_Play("PS05OVER", 0, 1, 0, 0); - ADQ_Add(61, 230, 3); - ADQ_Add(61, 240, 3); - Game_Flag_Set(692); - } - break; - case 3: - if (!Game_Flag_Query(691)) { - Overlay_Play("PS05OVER", 0, 1, 0, 0); - ADQ_Add(61, 170, 3); - ADQ_Add(61, 180, 3); - ADQ_Add(61, 190, 3); - ADQ_Add(61, 200, 3); - ADQ_Add(61, 210, 3); - ADQ_Add(61, 220, 3); - ADQ_Add(41, 80, 3); - ADQ_Add(41, 90, 3); - ADQ_Add(41, 100, 3); - ADQ_Add(41, 110, 3); - ADQ_Add(41, 120, 3); - ADQ_Add(41, 130, 3); - Game_Flag_Set(691); - } - break; - case 2: - if (!Game_Flag_Query(690)) { - Overlay_Play("PS05OVER", 0, 1, 0, 0); - if (Actor_Query_Friendliness_To_Other(5, 0) > Actor_Query_Friendliness_To_Other(1, 0)) { - ADQ_Add(61, 120, 3); - ADQ_Add(61, 130, 3); - ADQ_Add(61, 140, 3); - ADQ_Add(61, 150, 3); - ADQ_Add(4, 1570, 3); - ADQ_Add(4, 1580, 3); - ADQ_Add(4, 1590, 3); - } else { - ADQ_Add(61, 90, 3); - ADQ_Add(61, 100, 3); - ADQ_Add(61, 110, 3); - ADQ_Add(4, 1540, 3); - ADQ_Add(4, 1550, 3); - ADQ_Add(4, 1560, 3); - } - Game_Flag_Set(690); - } - break; - case 1: - if (!Game_Flag_Query(689)) { - Overlay_Play("PS05OVER", 0, 1, 0, 0); - ADQ_Add(61, 40, 3); - ADQ_Add(61, 50, 3); - ADQ_Add(61, 60, 3); - ADQ_Add(61, 70, 3); - ADQ_Add(61, 80, 3); - Game_Flag_Set(689); - } - break; - case 0: - if (!Game_Flag_Query(688)) { - Overlay_Play("PS05OVER", 0, 1, 0, 0); - ADQ_Add(61, 0, 3); - ADQ_Add(61, 10, 3); - ADQ_Add(61, 20, 3); - ADQ_Add(61, 30, 3); - ADQ_Add(51, 430, 3); - ADQ_Add(51, 440, 3); - ADQ_Add(51, 450, 3); - ADQ_Add(51, 460, 3); - Game_Flag_Set(688); - } - break; - default: - return; - } -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ps06.cpp b/engines/bladerunner/script/ps06.cpp deleted file mode 100644 index a3a1bdfc0a..0000000000 --- a/engines/bladerunner/script/ps06.cpp +++ /dev/null @@ -1,137 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptPS06::InitializeScene() { - Setup_Scene_Information(11257.26f, 707.3f, -4778.31f, 120); - Scene_Exit_Add_2D_Exit(0, 610, 0, 639, 479, 1); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(0); - Ambient_Sounds_Add_Looping_Sound(388, 50, 1, 1); - -} - -void ScriptPS06::SceneLoaded() { - Obstacle_Object("E.SCREEN02", true); - Clickable_Object("E.SCREEN02"); - Clickable_Object("E.MONITOR1"); - Clickable_Object("E.SCREEN03"); - Clickable_Object("E.MONITOR3"); -} - -bool ScriptPS06::MouseClick(int x, int y) { - return false; -} - -bool ScriptPS06::ClickedOn3DObject(const char *objectName, bool a2) { - if (Object_Query_Click("E.MONITOR1", objectName)) { - ESPER_Flag_To_Activate(); - return true; - } - if (Object_Query_Click("E.SCREEN03", objectName) || Object_Query_Click("E.MONITOR3", objectName)) { - Actor_Says(39, 330, 3); - if (!Actor_Clue_Query(0, 111) || Actor_Clue_Query(0, 113) || Actor_Clue_Query(0, 114) || Actor_Clue_Query(0, 115)) { - Actor_Clues_Transfer_New_To_Mainframe(0); - Ambient_Sounds_Play_Sound(587, 50, 0, 0, 99); - Delay(2000); - Actor_Says(39, 340, 3); - Actor_Clues_Transfer_New_From_Mainframe(0); - Ambient_Sounds_Play_Sound(587, 50, 0, 0, 99); - Delay(2000); - Ambient_Sounds_Play_Sound(588, 80, 0, 0, 99); - Actor_Says(39, 350, 3); - return true; - } else { - Delay(2000); - Actor_Voice_Over(3780, 99); - Actor_Voice_Over(3790, 99); - if (Game_Flag_Query(47)) { - Actor_Voice_Over(3800, 99); - Actor_Voice_Over(3810, 99); - Actor_Voice_Over(3820, 99); - Actor_Voice_Over(3830, 99); - Actor_Clue_Acquire(0, 113, 1, -1); - } else if (Game_Flag_Query(45)) { - Actor_Voice_Over(3840, 99); - Actor_Voice_Over(3850, 99); - Actor_Voice_Over(3860, 99); - Actor_Voice_Over(3870, 99); - Actor_Clue_Acquire(0, 114, 1, -1); - } else { - Actor_Voice_Over(3880, 99); - Actor_Voice_Over(3890, 99); - Actor_Voice_Over(3900, 99); - Actor_Voice_Over(3910, 99); - Actor_Clue_Acquire(0, 115, 1, -1); - } - Actor_Clues_Transfer_New_To_Mainframe(0); - Actor_Clues_Transfer_New_From_Mainframe(0); - return true; - } - } - return false; -} - -bool ScriptPS06::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptPS06::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptPS06::ClickedOnExit(int exitId) { - if (exitId == 0) { - Game_Flag_Set(23); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Set_Enter(15, 69); - return true; - } - return false; -} - -bool ScriptPS06::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptPS06::SceneFrameAdvanced(int frame) { -} - -void ScriptPS06::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptPS06::PlayerWalkedIn() { - if (Game_Flag_Query(136)) { - Game_Flag_Reset(136); - } -} - -void ScriptPS06::PlayerWalkedOut() { -} - -void ScriptPS06::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ps07.cpp b/engines/bladerunner/script/ps07.cpp deleted file mode 100644 index 8d8ade5d78..0000000000 --- a/engines/bladerunner/script/ps07.cpp +++ /dev/null @@ -1,189 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptPS07::InitializeScene() { - Setup_Scene_Information(609.07f, 0.22f, -598.67f, 768); - Scene_Exit_Add_2D_Exit(0, 610, 0, 639, 479, 1); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(0); - Ambient_Sounds_Add_Looping_Sound(141, 80, 0, 1); - Ambient_Sounds_Add_Sound(142, 5, 20, 5, 10, -70, 70, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(146, 5, 30, 5, 10, -70, 70, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(147, 2, 20, 5, 10, -70, 70, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(148, 2, 10, 10, 20, -70, 70, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(149, 2, 10, 10, 20, -70, 70, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(150, 2, 10, 10, 20, -70, 70, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(151, 2, 10, 10, 20, -70, 70, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(152, 2, 30, 10, 15, -70, 70, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(153, 2, 20, 10, 15, -70, 70, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(154, 5, 20, 10, 15, -70, 70, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(145, 5, 30, 5, 8, -100, 100, -101, -101, 0, 0); -} - -void ScriptPS07::SceneLoaded() { - Obstacle_Object("RICE BOX01", true); - Unobstacle_Object("RICE BOX01", true); -} - -bool ScriptPS07::MouseClick(int x, int y) { - return false; -} - -bool ScriptPS07::ClickedOn3DObject(const char *objectName, bool a2) { - if (Object_Query_Click("L.MOUSE", objectName)) { - Sound_Play(155, 70, 0, 0, 50); - if (Actor_Query_Goal_Number(30) < 4 && Actor_Query_Goal_Number(30) > 0) { - Actor_Face_Actor(0, 30, true); - Actor_Set_Goal_Number(30, 3); - Actor_Modify_Friendliness_To_Other(30, 0, -3); - } - return true; - } - return false; -} - -bool ScriptPS07::ClickedOnActor(int actorId) { - if (actorId == 30) { - Actor_Face_Actor(0, 30, true); - Actor_Set_Goal_Number(30, 3); - if (!Game_Flag_Query(111)) { - Actor_Says(0, 4115, 13); - } - if (!Game_Flag_Query(111) && (Game_Flag_Query(125) || Game_Flag_Query(126) || Game_Flag_Query(127) || Game_Flag_Query(128))) { - Actor_Face_Actor(30, 0, true); - Actor_Says(30, 30, 12); - Game_Flag_Set(111); - } else { - if (Game_Flag_Query(111)) { - Actor_Says(0, 4130, 18); - } - } - if (Game_Flag_Query(125) && !Game_Flag_Query(12)) { - Game_Flag_Set(12); - Actor_Clue_Acquire(0, 11, 0, 30); - Actor_Says(30, 50, 16); - Actor_Says(0, 4135, 13); - Actor_Says(30, 60, 15); - Actor_Says(30, 70, 12); - Actor_Says(0, 4140, 18); - Actor_Says(30, 80, 14); - Actor_Says(30, 90, 14); - Actor_Set_Goal_Number(30, 1); - return true; - } - if (Game_Flag_Query(126) && !Game_Flag_Query(13)) { - Game_Flag_Set(13); - Actor_Clue_Acquire(0, 10, 0, 30); - sub_401D60(); - Actor_Set_Goal_Number(30, 1); - return true; - } - if (Game_Flag_Query(127) && !Game_Flag_Query(104)) { - Game_Flag_Set(104); - Actor_Clue_Acquire(0, 39, 0, 30); - Actor_Says(30, 170, 14); - Actor_Says(0, 4180, 13); - Actor_Says(30, 180, 12); - Actor_Says(30, 190, 13); - Actor_Says(30, 200, 16); - Actor_Says(0, 4185, 18); - Actor_Says(30, 210, 12); - Actor_Modify_Friendliness_To_Other(30, 0, -12); - Actor_Set_Goal_Number(30, 1); - return true; - } - if (Game_Flag_Query(128) && !Game_Flag_Query(105)) { - Game_Flag_Set(105); - Actor_Says(30, 220, 12); - Actor_Says(0, 4190, 13); - Actor_Says(30, 230, 14); - Actor_Set_Goal_Number(30, 1); - return true; - } - Actor_Says(30, 0, 13); - Actor_Set_Goal_Number(30, 1); - return true; - } - return false; - -} - -bool ScriptPS07::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptPS07::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, 609.07f, 0.22f, -598.67f, 0, 0, false, 0)) { - Set_Enter(62, 66); - } - return true; - } - return false; -} - -bool ScriptPS07::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptPS07::SceneFrameAdvanced(int frame) { -} - -void ScriptPS07::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptPS07::PlayerWalkedIn() { - Loop_Actor_Walk_To_XYZ(0, 561.07f, 0.34f, -606.67f, 6, 0, false, 0); - Game_Flag_Reset(131); - //return false; -} - -void ScriptPS07::PlayerWalkedOut() { - if (!Game_Flag_Query(138) && Global_Variable_Query(1) == 1) { - Actor_Set_Goal_Number(30, 0); - } -} - -void ScriptPS07::DialogueQueueFlushed(int a1) { -} - -void ScriptPS07::sub_401D60() { - Actor_Says(30, 100, 13); - Actor_Says(0, 4145, 13); - Actor_Says(30, 110, 12); - Actor_Says(0, 4150, 13); - Actor_Says(30, 120, 14); - Actor_Says(0, 4155, 17); - Actor_Says(30, 130, 15); - Actor_Says(0, 4160, 13); - Actor_Says(30, 140, 16); - Actor_Says(0, 4165, 18); - Actor_Says(30, 160, 13); - Actor_Says(0, 4170, 19); - Actor_Says(0, 4175, 19); - Actor_Modify_Friendliness_To_Other(30, 0, 3); -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ps09.cpp b/engines/bladerunner/script/ps09.cpp deleted file mode 100644 index 4977056a54..0000000000 --- a/engines/bladerunner/script/ps09.cpp +++ /dev/null @@ -1,354 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptPS09::InitializeScene() { - if (Game_Flag_Query(465)) { - Setup_Scene_Information(-410.0f, 0.26f, -200.0f, 512); - } else { - Setup_Scene_Information(-559.0f, 0.0f, -85.06f, 250); - } - Scene_Exit_Add_2D_Exit(0, 0, 0, 30, 479, 3); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(0); - Ambient_Sounds_Add_Looping_Sound(138, 50, 0, 0); - Ambient_Sounds_Add_Looping_Sound(137, 30, 0, 0); - Ambient_Sounds_Add_Looping_Sound(124, 30, 0, 0); - Ambient_Sounds_Add_Sound(125, 15, 60, 7, 10, 100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(126, 25, 60, 7, 10, 100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(127, 25, 60, 7, 10, 100, 100, -101, -101, 0, 0); - if (!Game_Flag_Query(55)) { - Actor_Put_In_Set(11, 67); - Actor_Set_At_XYZ(11, -417.88f, 0.0f, -200.74f, 512); - Game_Flag_Set(55); - } - if (Game_Flag_Query(465)) { - Actor_Put_In_Set(11, 94); - Actor_Set_At_XYZ(11, 0.0f, 0.0f, 0.0f, 512); - } - if (Game_Flag_Query(164) ) { - Actor_Put_In_Set(7, 67); - Actor_Set_At_XYZ(7, -476.0f, 0.2f, -225.0f, 518); - } - if (Game_Flag_Query(165) ) { - Actor_Put_In_Set(9, 67); - Actor_Set_At_XYZ(9, -290.0f, 0.33f, -235.0f, 207); - } -} - -void ScriptPS09::SceneLoaded() { - Obstacle_Object("OFFICE DOOR", true); - Unobstacle_Object("OFFICE DOOR", true); - Unclickable_Object("OFFICE DOOR"); -} - -bool ScriptPS09::MouseClick(int x, int y) { - return false; -} - -bool ScriptPS09::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptPS09::ClickedOnActor(int actorId) { - if (actorId == 11 && !Loop_Actor_Walk_To_XYZ(0, -381.11f, 0.0f, -135.55f, 0, 1, false, 0)) { - Actor_Face_Actor(0, 11, true); - Actor_Face_Actor(11, 0, true); - if (!Game_Flag_Query(49)) { - Actor_Says(11, 0, 12); - Actor_Says(0, 4235, 18); - Actor_Says(11, 10, 13); - Game_Flag_Set(49); - return true; - } - if (Game_Flag_Query(49) && !Game_Flag_Query(54) && !Actor_Clue_Query(0, 179) && !Actor_Clue_Query(0, 180) && !Actor_Clue_Query(0, 181)) { - Actor_Says(0, 4245, 14); - Actor_Says(11, 20, 14); - Game_Flag_Set(54); - return true; - } - if ((!Game_Flag_Query(53) && Game_Flag_Query(49) && Actor_Clue_Query(0, 179) ) || Actor_Clue_Query(0, 180) || Actor_Clue_Query(0, 181) || Actor_Clue_Query(0, 99) ) { - Game_Flag_Set(53); - Actor_Says(0, 4240, 13); - Actor_Says(11, 550, 15); - Actor_Says(11, 480, 16); - sub_402090(); - return true; - } - if (Game_Flag_Query(51) ) { - Actor_Says(0, 4270, 18); - Actor_Says(11, 30, 14); - Actor_Says(11, 40, 13); - return true; - } - if (Game_Flag_Query(53) && Game_Flag_Query(49) && (Actor_Clue_Query(0, 179) || Actor_Clue_Query(0, 180) || Actor_Clue_Query(0, 99) )) { - sub_402090(); - return true; - } - Actor_Says(0, 4270, 18); - Actor_Says(11, 30, 14); - Actor_Says(11, 40, 13); - return true; - } - if (actorId == 7 && !Loop_Actor_Walk_To_XYZ(0, -473.0f, 0.2f, -133.0f, 12, 1, false, 0)) { - Actor_Face_Actor(0, 7, true); - Actor_Face_Actor(7, 0, true); - if (!Game_Flag_Query(167)) { - Actor_Says(0, 4200, 14); - Actor_Says(7, 570, 3); - Actor_Says(0, 4205, 18); - Game_Flag_Set(167); - return true; - } - if (Game_Flag_Query(167) && !Game_Flag_Query(168)) { - Actor_Says(0, 4210, 18); - Actor_Says(7, 580, 3); - Actor_Says(0, 4215, 14); - Actor_Says(7, 590, 3); - Actor_Says(7, 600, 3); - Actor_Says(0, 4220, 18); - Actor_Says(7, 610, 3); - Actor_Says(0, 4225, 19); - Actor_Says(7, 620, 3); - Actor_Says(0, 4230, 14); - Game_Flag_Set(168); - return true; - } - Actor_Says(0, 4200, 13); - } - if (actorId == 9 && !Loop_Actor_Walk_To_XYZ(0, -295.0f, 0.34f, -193.0f, 12, 1, false, 0)) { - Actor_Face_Actor(0, 9, true); - Actor_Face_Actor(9, 0, true); - //TODO: cleanup - if (Game_Flag_Query(166) || (Actor_Says(0, 4415, 18) , Actor_Says(9, 1090, 3) , Actor_Says(0, 4420, 18) , Game_Flag_Set(166) , Game_Flag_Query(166) != 1) || Game_Flag_Query(55) != 1 || Game_Flag_Query(56)) { - if (!Game_Flag_Query(166) || Game_Flag_Query(55) || Game_Flag_Query(175)) { - Actor_Says(0, 4425, 18); - Actor_Says(9, 1160, 3); - return true; - } else { - Actor_Says(0, 4425, 18); - Actor_Says(9, 1100, 3); - Actor_Says(0, 4430, 19); - Actor_Says(9, 1110, 3); - Game_Flag_Set(175); - return true; - } - } else { - Actor_Face_Actor(11, 9, true); - Actor_Says(11, 420, 14); - Actor_Face_Actor(9, 11, true); - Actor_Says(9, 1120, 3); - Actor_Face_Actor(0, 11, true); - Actor_Says(0, 4435, 14); - Actor_Says(11, 430, 16); - Actor_Says(9, 1130, 3); - Game_Flag_Set(56); - return true; - } - } - return false; -} - -bool ScriptPS09::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptPS09::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -559.15f, 0.0f, -85.06f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Set_Enter(62, 66); - Game_Flag_Reset(211); - } - return true; - } - return false; -} - -bool ScriptPS09::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptPS09::SceneFrameAdvanced(int frame) { - if (frame == 1 || frame == 15 || frame == 20 || frame == 31 || frame == 33 || frame == 35 || frame == 52 || frame == 54) { - Sound_Play(97, Random_Query(50, 33), 10, 10, 50); - } - //return true; -} - -void ScriptPS09::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptPS09::PlayerWalkedIn() { - if (Game_Flag_Query(465)) { - Player_Loses_Control(); - Delay(2000); - Actor_Retired_Here(0, 6, 6, 1, -1); - //return true; - return; - } - if (!Game_Flag_Query(211)) { - Player_Loses_Control(); - Loop_Actor_Walk_To_XYZ(0, -491.15f, 0.0f, -73.06f, 0, 0, false, 0); - Player_Gains_Control(); - Game_Flag_Set(211); - } - if (Game_Flag_Query(133) ) { - Game_Flag_Reset(133); - //return true; - return; - } - //return false; -} - -void ScriptPS09::PlayerWalkedOut() { -} - -void ScriptPS09::DialogueQueueFlushed(int a1) { -} - -void ScriptPS09::sub_402090() { - Dialogue_Menu_Clear_List(); - if (Actor_Clue_Query(0, 179) || Actor_Clue_Query(0, 180) || Actor_Clue_Query(0, 181) ) { - DM_Add_To_List_Never_Repeat_Once_Selected(170, 5, 5, 3); - DM_Add_To_List_Never_Repeat_Once_Selected(180, -1, 5, 5); - DM_Add_To_List_Never_Repeat_Once_Selected(200, -1, 3, 6); - } - if (Actor_Clue_Query(0, 99) && (Actor_Clue_Query(0, 179) || Actor_Clue_Query(0, 180) || Actor_Clue_Query(0, 181) )) { - DM_Add_To_List_Never_Repeat_Once_Selected(190, 5, 6, -1); - } - Dialogue_Menu_Add_To_List(210); - Dialogue_Menu_Appear(320, 240); - int answer = Dialogue_Menu_Query_Input(); - Dialogue_Menu_Disappear(); - switch (answer) { - case 170: - Actor_Says(0, 4270, 13); - Actor_Says(0, 4250, 18); - Actor_Says(11, 50, 13); - Actor_Says(0, 4275, 18); - Actor_Says(0, 4280, 19); - if (Game_Flag_Query(44) ) { - Actor_Says(11, 60, 14); - Actor_Says(0, 4285, 13); - Actor_Says(11, 70, 12); - Actor_Says(0, 4290, 13); - Actor_Says(11, 80, 13); - Actor_Says(11, 90, 13); - Actor_Says(0, 4295, 18); - Actor_Says(11, 110, 14); - Actor_Says(0, 4300, 17); - return; - } - if (!Game_Flag_Query(44)) { - Actor_Says(11, 130, 15); - Actor_Says(11, 140, 13); - Actor_Says(0, 4305, 13); - Actor_Says(11, 150, 14); - Actor_Says(11, 160, 12); - Actor_Says(0, 4310, 13); - Actor_Says(11, 170, 15); - Actor_Says(11, 180, 16); - Actor_Says(0, 4315, 18); - Actor_Says(11, 200, 13); - return; - } - break; - case 180: - Actor_Says(0, 4270, 18); - Actor_Says(0, 4255, 3); - Actor_Says(11, 210, 12); - Actor_Says(11, 220, 13); - Actor_Says(11, 230, 14); - Actor_Says(0, 4320, 14); - Actor_Says(11, 240, 16); - Actor_Says(11, 250, 15); - Actor_Says(0, 4330, 13); - Actor_Says(11, 260, 13); - Actor_Says(11, 270, 12); - Actor_Says(0, 4335, 18); - Actor_Says(11, 290, 15); - Actor_Says(0, 4340, 13); - Actor_Modify_Friendliness_To_Other(11, 0, -5); - if (Game_Flag_Query(165)) { - Actor_Says(11, 300, 12); - Actor_Face_Actor(9, 11, true); - Actor_Says(9, 1010, 3); - Actor_Face_Actor(11, 9, true); - Actor_Says(11, 310, 16); - Actor_Face_Actor(0, 9, true); - Actor_Says(0, 4345, 14); - Actor_Face_Actor(9, 0, true); - Actor_Says(9, 1020, 3); - Actor_Says(0, 4350, 18); - Actor_Says(9, 1030, 3); - Actor_Says(0, 4355, 19); - Actor_Says(9, 1040, 3); - Actor_Says(0, 4360, 16); - Actor_Says(0, 4365, 14); - Actor_Says(9, 1050, 3); - Actor_Says(9, 1060, 3); - Actor_Says(0, 4370, 14); - Actor_Says(9, 1070, 3); - Actor_Says(9, 1080, 3); - } - else { - Actor_Says(11, 320, 13); - Actor_Says(11, 340, 14); - Actor_Says(11, 350, 12); - Actor_Says(0, 4375, 18); - } - break; - case 190: - Actor_Says(0, 4270, 18); - Actor_Says(0, 4260, 3); - Actor_Says(11, 360, 16); - Actor_Says(0, 4380, 19); - Actor_Says(0, 4385, 19); - Actor_Says(11, 370, 13); - Actor_Says(0, 4390, 19); - Actor_Says(0, 4395, 18); - Actor_Says(11, 380, 14); - Actor_Says(11, 390, 12); - Actor_Modify_Friendliness_To_Other(11, 0, -5); - break; - case 200: - Actor_Says(0, 4265, 14); - Actor_Says(11, 400, 13); - Actor_Says(0, 4400, 13); - Actor_Says(11, 410, 16); - Actor_Says(0, 4405, 14); - Actor_Says(0, 4410, 15); - Voight_Kampff_Activate(11, 20); - Actor_Modify_Friendliness_To_Other(11, 0, -10); - break; - case 210: - Actor_Says(0, 8600, 18); - Actor_Says(11, 20, 15); - break; - } -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ps10.cpp b/engines/bladerunner/script/ps10.cpp deleted file mode 100644 index 0135bffade..0000000000 --- a/engines/bladerunner/script/ps10.cpp +++ /dev/null @@ -1,248 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptPS10::InitializeScene() { - Police_Maze_Set_Pause_State(1); - if (Game_Flag_Query(15)) { - float x = World_Waypoint_Query_X(4); - float y = World_Waypoint_Query_Y(4); - float z = World_Waypoint_Query_Z(4); - Setup_Scene_Information(x, y, z, 280); - } else { - Setup_Scene_Information(-87.08f, -9.23f, 941.9f, 0); - } - Scene_Exit_Add_2D_Exit(1, 0, 0, 20, 479, 3); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(0); - Ambient_Sounds_Add_Looping_Sound(387, 50, 1, 1); - Ambient_Sounds_Add_Looping_Sound(54, 50, 1, 1); - Ambient_Sounds_Add_Sound(1, 10, 50, 16, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(389, 5, 50, 16, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(390, 6, 50, 16, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(443, 2, 100, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(444, 2, 100, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(445, 2, 100, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(446, 2, 100, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(303, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(304, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(305, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(306, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(307, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(308, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); -} - -static int track_data_0[] = {-26, 10, 20, -18, 10, 20, -9, 0, -9, 1,-5, 989, -1, 0, -15, 0, 1, -15, 1, 1,-23, 0, -7, 3000, 5000, -8, 0, -10, 159, 100,-2, 14, -3, 1000, -6, 740, 80, -22, 0, -3,0, -6, 488, 80, -3, 1000, -24, 27, 33, -3, 0, -6, 740, 80, -11, 1, -9, 0, -8, 1, -12, 0, -1, 0, -4}; -static int track_data_1[] = {-5, 740, -1, 0, -22, 1, -2, 69, -3, 500, -9, 1, -11, 4, -12, 1, -1, 0, -4}; -static int track_data_2[] = {-26, 10, 20, -18, 10, 20, -9, 2, -5, 993, -1, 0, -7, 3000, 5000, -8, 2, -10, 159, 100, -15, 2, 1, -23, 2, -2, 5, -3, 1000, -22, 2, -6, 233, 80, -3, 0, -6, 491, 80, -3, 500, -24, 27, 33, -3, 500, -6, 233, 80, -3, 0, -6, 993, 80, -10, 34, 33, -2, 0, -9, 2, -4}; -static int track_data_3[] = {-26, 10, 20, -18, 10, 20, -9, 3, -5, 993, -1, 0, -7, 3000, 6000, -8, 3, -10, 159, 100, -15, 3, 1, -23, 3, -2, 34, -3, 500, -6, 491, 80, -2, 0, -25, -9, 3, -11, 7, -12, 3, -4}; -static int track_data_4[] = {-26, 10, 20, -18, 10, 20, -9, 4, -5, 0, -1, 0, -7, 4000, 6000, -8, 4, -10, 159, 100, -15, 4, 1, -23, 4, -2, 5, -3, 1000, -6, 512, 100, -3, 2000, -6, 0, -100, -10, 34, 33, -2, 0, -25, -9, 4, -11, 0, -12, 4, -4}; -static int track_data_5[] = {-26, 10, 20, -18, 10, 20, -9, 5, -5, 999, -1, 0, -7, 4000, 6000, -8, 5, -10, 159, 100, -15, 5, 1, -23, 5, -2, 7, -3, 500, -22, 5, -6, 750, 80, -3, 0, -6, 500, 80, -3, 1000, -24, 27, 33, -3, 0, -6, 750, 80, -3, 0, -6, 999, 80, -10, 34, 33, -2, 0, -9, 5, -11, 6, -11, 8, -12, 5, -4}; -static int track_data_6[] = {-26, 10, 20, -18, 10, 20, -9, 6, -5, 264, -1, 0, -7, 3000, 6000, -15, 6, 1, -23, 6, -8, 6, -2, 89, -7, 4000, 8000, -5, 776, -2, 0, -25, -9, 6, -12, 6, -4}; -static int track_data_7[] = {-26, 10, 20, -18, 10, 20, -9, 7, -5, 993, -1, 0, -7, 4000, 6000, -8, 7, -10, 159, 100, -15, 7, 1, -23, 7, -2, 34, -3, 500, -22, 7, -6, 491, 80, -2, 20, -3, 0, -24, 27, 33, -2, 0, -9, 7, -11, 3, -12, 7, -4}; -static int track_data_8[] = {-26, 10, 20, -18, 10, 20, -9, 8, -5, 738, -1, 0, -7, 2000, 5000, -15, 8, 1, -22, 8, -8, 8, -10, 0, 33, -2, 23, -10, 0, 33, -3, 200, -10, 32, 33, -6, 498, 100, -10, 0, 33, -3, 100, -24, 27, 33, -10, 32, 33, -2, 35, -10, 32, 33, -3, 100, -24, 27, 33, -10, 0, 33, -2, 23, -10, 32, 33, -3, 100, -24, 27, 33, -10, 32, 33, -6, 758, 100, -10, 32, 33, -2, 89, -10, 0, 33, -7, 4000, 6000, -15, 8, 1, -22, 8, -5, 216, -10, 32, 33, -2, 69, -3, 100, -10, 32, 33, -6, 498, 100, -3, 100, -24, 27, 33, -10, 0, 33, -6, 216, 100, -10, 32, 33, -2, 0, -9, 8, -12, 8, -4}; - -void ScriptPS10::SceneLoaded() { - Obstacle_Object("PARKMETR01", true); - Obstacle_Object("PARKMETR02", true); - Obstacle_Object("PARKMETR03", true); - Obstacle_Object("PARKMETR07", true); - Obstacle_Object("PARKMETR08", true); - Obstacle_Object("PARKMETR10", true); - Obstacle_Object("PARKMETR11", true); - Obstacle_Object("PARKMETR15", true); - Obstacle_Object("PARKMETR16", true); - Obstacle_Object("TUBE14", true); - Unclickable_Object("PARKMETR01"); - Unclickable_Object("PARKMETR02"); - Unclickable_Object("PARKMETR03"); - Unclickable_Object("PARKMETR07"); - Unclickable_Object("PARKMETR08"); - Unclickable_Object("PARKMETR10"); - Unclickable_Object("PARKMETR11"); - Unclickable_Object("PARKMETR15"); - Unclickable_Object("PARKMETR16"); - Unobstacle_Object("E.SM.WIRE01", true); - if (!Query_System_Currently_Loading_Game()) { - Item_Add_To_World(0, 443, 14, -240.0f, -80.74f, 145.0f, 989, 72, 36, true, false, false, true); - Item_Add_To_World(1, 443, 14, -240.0f, -8.74f, 145.0f, 740, 72, 36, true, false, false, true); - Item_Add_To_World(2, 445, 14, -165.0f, 111.53f, -10.0f, 993, 72, 36, true, false, false, true); - Item_Add_To_World(3, 447, 14, -125.0f, 160.0f, -10.0f, 993, 72, 36, true, false, false, true); - Item_Add_To_World(4, 441, 14, -246.71f, 205.51f, -20.0f, 0, 72, 36, true, false, false, true); - Item_Add_To_World(5, 445, 14, -27.69f, -86.92f, 434.0f, 999, 72, 36, true, false, false, true); - Item_Add_To_World(6, 441, 14, -347.15f, 7.68f, -20.0f, 264, 72, 36, true, false, false, true); - Item_Add_To_World(7, 449, 14, -51.0f, 160.0f, -10.0f, 993, 72, 36, true, false, false, true); - Item_Add_To_World(8, 445, 14, 39.0f, 9.16f, -20.0f, 738, 72, 36, true, false, false, true); - } - - Police_Maze_Target_Track_Add(0, -240.0f, -80.74f, 145.0f, -240.0f, -8.74f, 145.0f, 15, track_data_0, false); - Police_Maze_Target_Track_Add(1, -240.0f, -8.74f, 145.0f, -450.0f, -8.74f, 145.0f, 70, track_data_1, false); - Police_Maze_Target_Track_Add(2, -165.0f, 111.53f, -10.0f, -165.0f, 167.53f, -10.0f, 6, track_data_2, true); - Police_Maze_Target_Track_Add(3, -125.0f, 160.0f, -10.0f, -51.0f, 160.0f, -10.0f, 35, track_data_3, false); - Police_Maze_Target_Track_Add(4, -246.71f, 205.51f, -20.0f, -246.71f, 241.51f, -20.0f, 6, track_data_4, true); - Police_Maze_Target_Track_Add(5, -27.69f, -86.92f, 434.0f, -27.69f, -18.92f, 434.0f, 8, track_data_5, true); - Police_Maze_Target_Track_Add(6, -347.15f, 7.68f, -20.0f, 39.0f, 9.16f, -20.0f, 90, track_data_6, false); - Police_Maze_Target_Track_Add(7, -51.0f, 160.0f, -10.0f, -125.0f, 160.0f, -10.0f, 35, track_data_7, true); - Police_Maze_Target_Track_Add(8, 39.0f, 9.16f, -20.0f, -347.15f, 7.68f, -20.0f, 90, track_data_8, false); - Preload(441); - Preload(442); - Preload(443); - Preload(444); - Preload(445); - Preload(446); - Preload(447); - Preload(448); - Preload(449); - Preload(450); -} - -bool ScriptPS10::MouseClick(int x, int y) { - return false; -} - -bool ScriptPS10::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptPS10::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptPS10::ClickedOnItem(int itemId, bool a2) { - if (Player_Query_Combat_Mode()) { - switch (itemId) { - case 3: - Sound_Play(4, 50, 0, 0, 50); - break; - case 4: - Sound_Play(555, 50, 0, 0, 50); - break; - case 6: - Sound_Play(555, 50, 0, 0, 50); - break; - default: - Sound_Play(2, 12, 0, 0, 50); - break; - } - Item_Spin_In_World(itemId); - if (itemId == 0) { - Item_Flag_As_Non_Target(0); - Item_Flag_As_Non_Target(1); - } - if (itemId == 1) { - Item_Flag_As_Non_Target(0); - Item_Flag_As_Non_Target(1); - } - if (itemId == 2) { - Item_Flag_As_Non_Target(2); - } - if (itemId == 3) { - Item_Flag_As_Non_Target(3); - } - if (itemId == 4) { - Item_Flag_As_Non_Target(4); - } - if (itemId == 5) { - Item_Flag_As_Non_Target(5); - } - if (itemId == 6) { - Item_Flag_As_Non_Target(6); - } - if (itemId == 7) { - Item_Flag_As_Non_Target(7); - } - if (itemId == 8) { - Item_Flag_As_Non_Target(8); - } else { - Item_Flag_As_Non_Target(itemId); - } - return true; - } - - return false; -} - -bool ScriptPS10::ClickedOnExit(int exitId) { - if (exitId == 1) { - if (!Loop_Actor_Walk_To_Waypoint(0, 6, 12, 1, false)) { - Game_Flag_Set(14); - sub_402238(); - Global_Variable_Decrement(9, 20 - Global_Variable_Query(10)); - Global_Variable_Set(10, 20); - Set_Enter(14, 74); - } - return true; - } - - return false; -} - -bool ScriptPS10::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptPS10::SceneFrameAdvanced(int frame) { -} - -void ScriptPS10::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptPS10::PlayerWalkedIn() { - if (Game_Flag_Query(15)) { - Loop_Actor_Walk_To_XYZ(0, -352.09f, -9.23f, 267.95f, 0, 0, true, 0); - Police_Maze_Set_Pause_State(0); - Game_Flag_Reset(15); - //return true; - return; - } else { - Player_Set_Combat_Mode(true); - Loop_Actor_Walk_To_Waypoint(0, 5, 0, 0, true); - Actor_Says(39, 280, 3); - Actor_Says(39, 290, 3); - Actor_Says(39, 300, 3); - Police_Maze_Set_Pause_State(0); - //return true; - return; - } -} - -void ScriptPS10::PlayerWalkedOut() { -} - -void ScriptPS10::DialogueQueueFlushed(int a1) { -} - -void ScriptPS10::sub_402238() { - Item_Remove_From_World(0); - Item_Remove_From_World(1); - Item_Remove_From_World(2); - Item_Remove_From_World(3); - Item_Remove_From_World(4); - Item_Remove_From_World(5); - Item_Remove_From_World(6); - Item_Remove_From_World(7); - Item_Remove_From_World(8); -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ps11.cpp b/engines/bladerunner/script/ps11.cpp deleted file mode 100644 index d979619480..0000000000 --- a/engines/bladerunner/script/ps11.cpp +++ /dev/null @@ -1,285 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptPS11::InitializeScene() { - if (Game_Flag_Query(14)) { - Scene_Loop_Start_Special(0, 0, 0); - Scene_Loop_Set_Default(1); - Game_Flag_Reset(14); - Setup_Scene_Information(World_Waypoint_Query_X(6), World_Waypoint_Query_Y(6), World_Waypoint_Query_Z(6), 840); - } else { - Scene_Loop_Set_Default(1); - Setup_Scene_Information(World_Waypoint_Query_X(7), World_Waypoint_Query_Y(7), World_Waypoint_Query_Z(7), 132); - } - Scene_Exit_Add_2D_Exit(0, 0, 460, 639, 479, 2); - Scene_Exit_Add_2D_Exit(1, 0, 0, 20, 479, 3); -} - -static int track_data_9[] = {-26, 11, 20, -18, 11, 20, -9, 9, -5, 50, -1, 0, -7, 5000, 5000, -8, 9, -10, 31, 33, -15, 9, 1, -22, 9, -2, 7, -3, 1000, -24, 27, 33, -10, 34, 33, -2, 0, -3, 500, -9, 9, -13, 15, 10, -12, 9, -4}; -static int track_data_10[] = {-26, 11, 20, -18, 11, 20, -9, 10, -9, 11, -15, 10, 1, -15, 11, 1, -5, 860, -1, 0, -7, 3000, 6000, -23, 10, -8, 10, -10, 33, 33, -2, 14, -3, 500, -11, 11, -9, 10, -8, 11, -12, 10, -1, 0, -4}; -static int track_data_11[] = {-5, 860, -1, 0, -23, 11, -8, 11, -2, 25, -3, 500, -22, 11, -10, 32, 33, -6, 644, 80, -3, 0, -6, 388, 80, -3, 1000, -24, 12, 33, -2, 79, -9, 11, -13, 15, 9, -12, 11, -1, 0, -5, 860, -4}; -static int track_data_12[] = {-26, 11, 20, -18, 11, 20, -9, 12, -5, 725, -1, 0, -3, 2000, -15, 12, 1, -23, 12, -8, 12, -2, 82, -25, -3, 1000, -6, 570, 80, -3, 0, -6, 462, 80, -3, 0, -6, 213, 80, -3, 1000, -2, 0, -6, 725, 80, -2, 99, -9, 12, -11, 27, -12, 12, -1, 0, -4}; -static int track_data_13[] = {-26, 11, 20, -18, 11, 20, -9, 13, -5, 340, -1, 0, -7, 4000, 8000, -8, 13, -10, 33, 33, -15, 13, 1, -22, 13, -2, 4, -3, 0, -6, 435, 80, -3, 0, -6, 530, 80, -3, 100, -6, 435, 80, -3, 0, -6, 340, 80, -3, 0, -6, 260, 80, -3, 0, -6, 180, 80, -3, 100, -6, 260, 80, -3, 0, -6, 340, 80, -3, 200, -24, 27, 33, -10, 34, 33, -2, 0, -9, 13, -13, 14, 18, -12, 13, -4}; -static int track_data_14[] = {-26, 11, 20, -18, 11, 20, -9, 14, -15, 14, 1, -23, 14, -5, 900, -1, 0, -7, 3000, 6000, -8, 14, -10, 33, 33, -2, 5, -3, 500, -22, 14, -6, 644, 80, -3, 0, -6, 388, 80, -3, 1000, -24, 27, 33, -10, 34, 33, -2, 0, -9, 14, -13, 18, 13, -12, 14, -4}; -static int track_data_15[] = {-26, 11, 20, -18, 11, 20, -9, 15, -9, 16, -15, 15, 1, -15, 16, 1, -5, 860, -1, 0, -7, 3000, 7000, -8, 15, -10, 29, 33, -23, 15, -2, 14, -25, -3, 1000, -11, 16, -9, 15, -8, 16, -12, 15, -1, 0, -4}; -static int track_data_16[] = {-5, 860, -1, 0, -8, 16, -23, 16, -2, 25, -3, 500, -10, 32, 33, -6, 644, 100, -3, 0, -6, 388, 200, -3, 500, -2, 79, -25, -9, 16, -13, 10, 9, -12, 16, -1, 0, -5, 860, -4}; -static int track_data_17[] = {-26, 11, 20, -18, 11, 20, -5, 310, -1, 0, -8, 17, -15, 17, 1, -22, 17, -7, 4000, 8000, -10, 32, 33, -2, 10, -3, 0, -24, 27, 33, -2, 0, -15, 17, 1, -22, 17, -2, 24, -15, 17, 1, -22, 17, -2, 10, -3, 0, -24, 27, 33, -2, 24, -3, 1000, -9, 17, -13, 23, 22, -12, 17, -1, 0, -4}; -static int track_data_18[] = {-26, 11, 20, -18, 11, 20, -9, 18, -9, 19, -5, 900, -1, 0, -15, 18, 1, -15, 19, 1, -23, 18, -7, 4000, 6000, -8, 18, -2, 5, -10, 19, 33, -10, 3, 33, -3, 1000, -25, -6, 700, 80, -22, 18, -3, 0, -6, 512, 200, -3, 1000, -24, 12, 33, -11, 19, -9, 18, -8, 19, -12, 18, -1, 0, -4}; -static int track_data_19[] = {-5, 512, -1, 0, -22, 19, -2, 8, -3, 4000, -15, 19, 1, -22, 19, -2, 2, -10, 32, 33, -3, 1000, -24, 12, 33, -2, 19, -3, 500, -9, 19, -13, 13, 14, -12, 19, -1, 0, -4}; -static int track_data_20[] = {-26, 11, 20, -18, 11, 20, -9, 20, -5, 280, -1, 0, -7, 5000, 7000, -15, 20, 1, -22, 20, -8, 20, -2, 9, -10, 32, 33, -3, 1000, -24, 27, 33, -2, 0, -9, 20, -13, 21, 12, -12, 20, -1, 0, -4}; -static int track_data_21[] = {-26, 11, 20, -18, 11, 20, -9, 21, -5, 280, -1, 0, -7, 5000, 8000, -15, 21, 1, -23, 21, -8, 21, -2, 5, -25, -3, 1000, -2, 0, -9, 21, -13, 20, 12, -12, 21, -1, 0, -4}; -static int track_data_22[] = {-26, 11, 20, -18, 11, 20, -9, 22, -5, 255, -1, 0, -15, 22, 1, -22, 22, -7, 5000, 5000, -8, 22, -2, 7, -10, 32, 33, -3, 1000, -24, 12, 33, -2, 0, -9, 22, -13, 23, 17, -12, 22, -1, 0, -4}; -static int track_data_23[] = {-26, 11, 20, -18, 11, 20, -9, 23, -5, 310, -1, 0, -7, 3000, 6000, -15, 23, 1, -23, 23, -8, 23, -3, 1000, -2, 24, -3, 1000, -2, 0, -25, -9, 23, -13, 22, 17, -12, 23, -1, 0, -4}; -static int track_data_27[] = {-26, 11, 20, -18, 11, 20, -9, 27, -5, 346, -1, 0, -3, 0, -15, 27, 1, -22, 27, -8, 27, -2, 14, -3, 1000, -24, 12, 33, -2, 0, -9, 27, -13, 21, 20, -12, 27, -1, 0, -4}; - -void ScriptPS11::SceneLoaded() { - Obstacle_Object("PARKMETR01", true); - Obstacle_Object("PARKMETR02", true); - Obstacle_Object("PARKMETR03", true); - Obstacle_Object("PARKMETR07", true); - Obstacle_Object("PARKMETR08", true); - Obstacle_Object("PARKMETR10", true); - Obstacle_Object("PARKMETR11", true); - Obstacle_Object("PARKMETR15", true); - Obstacle_Object("PARKMETR16", true); - Unclickable_Object("PARKMETR01"); - Unclickable_Object("PARKMETR02"); - Unclickable_Object("PARKMETR03"); - Unclickable_Object("PARKMETR07"); - Unclickable_Object("PARKMETR08"); - Unclickable_Object("PARKMETR10"); - Unclickable_Object("PARKMETR11"); - Unclickable_Object("PARKMETR15"); - Unclickable_Object("PARKMETR16"); - if (!Query_System_Currently_Loading_Game()) { - Item_Add_To_World(9, 449, 14, -450.0f, -7.5f, 335.0f, 50, 72, 36, true, false, false, true); - Item_Add_To_World(10, 449, 14, -740.0f, 27.0f, -30.0f, 860, 72, 36, true, false, false, true); - Item_Add_To_World(11, 449, 14, -740.0f, 99.0f, -30.0f, 860, 72, 36, true, false, false, true); - Item_Add_To_World(12, 441, 14, -400.0f, -9.23f, -75.0f, 725, 72, 36, true, false, false, true); - Item_Add_To_World(13, 443, 14, -803.72f, -72.7f, 60.22f, 340, 72, 36, true, false, false, true); - Item_Add_To_World(14, 443, 14, -853.0f, -70.0f, 195.0f, 900, 72, 36, true, false, false, true); - Item_Add_To_World(15, 447, 14, -740.0f, 27.0f, -30.0f, 860, 72, 36, true, false, false, true); - Item_Add_To_World(16, 447, 14, -740.0f, 99.0f, -30.0f, 860, 72, 36, true, false, false, true); - Item_Add_To_World(17, 445, 14, -888.0f, 155.0f, 100.0f, 310, 72, 36, true, false, false, true); - Item_Add_To_World(18, 443, 14, -430.0f, 164.0f, 11.0f, 900, 72, 36, true, false, false, true); - Item_Add_To_World(19, 443, 14, -430.0f, -0.86f, 11.0f, 512, 72, 36, true, false, false, true); - Item_Add_To_World(20, 443, 14, -891.0f, 3.1f, 90.0f, 280, 72, 36, true, false, false, true); - Item_Add_To_World(21, 447, 14, -891.0f, 3.1f, 90.0f, 280, 72, 36, true, false, false, true); - Item_Add_To_World(22, 445, 14, -891.0f, 171.0f, 190.0f, 255, 72, 36, true, false, false, true); - Item_Add_To_World(23, 441, 14, -888.0f, 155.0f, 30.0f, 310, 72, 36, true, false, false, true); - Item_Add_To_World(27, 445, 14, -800.0f, -9.23f, -75.0f, 346, 72, 36, true, false, false, true); - } - - Police_Maze_Target_Track_Add(9, -450.0f, -7.5f, 335.0f, -450.0f, -7.5f, 295.0f, 8, track_data_9, true); - Police_Maze_Target_Track_Add(10, -740.0f, 27.0f, -30.0f, -740.0f, 99.0f, -30.0f, 15, track_data_10, false); - Police_Maze_Target_Track_Add(11, -740.0f, 99.0f, -30.0f, -200.0f, 99.0f, -30.0f, 80, track_data_11, false); - Police_Maze_Target_Track_Add(12, -400.0f, -9.23f, -75.0f, -800.0f, -9.23f, -75.0f, 100, track_data_12, false); - Police_Maze_Target_Track_Add(13, -803.72f, -72.7f, 60.22f, -803.72f, -0.7f, 60.22f, 6, track_data_13, true); - Police_Maze_Target_Track_Add(14, -853.0f, -70.0f, 195.0f, -853.0f, 2.0f, 195.0f, 6, track_data_14, false); - Police_Maze_Target_Track_Add(15, -740.0f, 27.0f, -30.0f, -740.0f, 99.0f, -30.0f, 15, track_data_15, false); - Police_Maze_Target_Track_Add(16, -740.0f, 99.0f, -30.0f, -200.0f, 99.0f, -30.0f, 80, track_data_16, false); - Police_Maze_Target_Track_Add(17, -888.0f, 155.0f, 100.0f, -888.0f, 155.0f, 30.0f, 25, track_data_17, false); - Police_Maze_Target_Track_Add(18, -430.0f, 164.0f, 11.0f, -430.0f, -0.86f, 11.0f, 6, track_data_18, false); - Police_Maze_Target_Track_Add(19, -430.0f, -0.86f, 11.0f, -300.0f, -0.86f, -80.0f, 20, track_data_19, false); - Police_Maze_Target_Track_Add(20, -891.0f, 3.1f, 90.0f, -891.0f, 3.1f, 105.0f, 10, track_data_20, true); - Police_Maze_Target_Track_Add(21, -891.0f, 3.1f, 90.0f, -891.0f, 3.1f, 105.0f, 6, track_data_21, false); - Police_Maze_Target_Track_Add(22, -891.0f, 171.0f, 190.0f, -891.0f, 171.0f, 147.0f, 8, track_data_22, false); - Police_Maze_Target_Track_Add(23, -888.0f, 155.0f, 30.0f, -888.0f, 155.0f, 100.0f, 25, track_data_23, true); - Police_Maze_Target_Track_Add(27, -800.0f, -9.23f, -75.0f, -740.0f, -9.23f, -75.0f, 15, track_data_27, false); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(0); - Ambient_Sounds_Add_Looping_Sound(387, 50, 1, 1); - Ambient_Sounds_Add_Looping_Sound(54, 50, 1, 1); - Ambient_Sounds_Add_Sound(1, 10, 50, 16, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(389, 5, 50, 16, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(390, 6, 50, 16, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(443, 2, 100, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(444, 2, 100, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(445, 2, 100, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(446, 2, 100, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(303, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(304, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(305, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(306, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(307, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(308, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); -} - -bool ScriptPS11::MouseClick(int x, int y) { - return false; -} - -bool ScriptPS11::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptPS11::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptPS11::ClickedOnItem(int itemId, bool a2) { - if (Player_Query_Combat_Mode()) { - switch (itemId) { - case 15: - Sound_Play(4, 50, 0, 0, 50); - break; - case 16: - Sound_Play(4, 50, 0, 0, 50); - break; - case 21: - Sound_Play(4, 50, 0, 0, 50); - break; - case 23: - Sound_Play(555, 50, 0, 0, 50); - break; - case 12: - Sound_Play(555, 50, 0, 0, 50); - break; - default: - Sound_Play(2, 12, 0, 0, 50); - break; - } - Item_Spin_In_World(itemId); - if (itemId == 9) { - Item_Flag_As_Non_Target(9); - } - if (itemId == 10) { - Item_Flag_As_Non_Target(10); - Item_Flag_As_Non_Target(11); - } - if (itemId == 11) { - Item_Flag_As_Non_Target(10); - Item_Flag_As_Non_Target(11); - } - if (itemId == 12) { - Item_Flag_As_Non_Target(12); - } - if (itemId == 13) { - Item_Flag_As_Non_Target(13); - } - if (itemId == 14) { - Item_Flag_As_Non_Target(14); - } - if (itemId == 15) { - Item_Flag_As_Non_Target(15); - Item_Flag_As_Non_Target(16); - } - if (itemId == 16) { - Item_Flag_As_Non_Target(15); - Item_Flag_As_Non_Target(16); - } - if (itemId == 17) { - Item_Flag_As_Non_Target(17); - } - if (itemId == 18) { - Item_Flag_As_Non_Target(18); - Item_Flag_As_Non_Target(19); - } - if (itemId == 19) { - Item_Flag_As_Non_Target(18); - Item_Flag_As_Non_Target(19); - } - if (itemId == 20) { - Item_Flag_As_Non_Target(20); - } - if (itemId == 21) { - Item_Flag_As_Non_Target(21); - } - if (itemId == 22) { - Item_Flag_As_Non_Target(22); - } - if (itemId == 23) { - Item_Flag_As_Non_Target(23); - } - if (itemId == 27) { - Item_Flag_As_Non_Target(27); - } - return true; - } - return false; -} - -bool ScriptPS11::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_Waypoint(0, 6, 12, 1, false)) { - Game_Flag_Set(15); - sub_402744(); - Set_Enter(14, 73); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_Waypoint(0, 8, 12, 1, false)) { - Game_Flag_Set(16); - sub_402744(); - Global_Variable_Decrement(9, 20 - Global_Variable_Query(11)); - Global_Variable_Set(11, 20); - Set_Enter(14, 75); - } - return true; - } - return false; -} - -bool ScriptPS11::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptPS11::SceneFrameAdvanced(int frame) { -} - -void ScriptPS11::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptPS11::PlayerWalkedIn() { - Police_Maze_Set_Pause_State(0); -} - -void ScriptPS11::PlayerWalkedOut() { -} - -void ScriptPS11::DialogueQueueFlushed(int a1) { -} - -void ScriptPS11::sub_402744() { - Item_Remove_From_World(9); - Item_Remove_From_World(10); - Item_Remove_From_World(11); - Item_Remove_From_World(12); - Item_Remove_From_World(13); - Item_Remove_From_World(14); - Item_Remove_From_World(15); - Item_Remove_From_World(16); - Item_Remove_From_World(17); - Item_Remove_From_World(18); - Item_Remove_From_World(19); - Item_Remove_From_World(20); - Item_Remove_From_World(21); - Item_Remove_From_World(22); - Item_Remove_From_World(23); - Item_Remove_From_World(27); -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ps12.cpp b/engines/bladerunner/script/ps12.cpp deleted file mode 100644 index b99eafd2fc..0000000000 --- a/engines/bladerunner/script/ps12.cpp +++ /dev/null @@ -1,302 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptPS12::InitializeScene() { - Police_Maze_Set_Pause_State(1); - if (Game_Flag_Query(16)) { - Scene_Loop_Start_Special(0, 0, 0); - Scene_Loop_Set_Default(1); - Setup_Scene_Information(World_Waypoint_Query_X(8), World_Waypoint_Query_Y(8), World_Waypoint_Query_Z(8), 512); - } else { - Scene_Loop_Set_Default(1); - Setup_Scene_Information(World_Waypoint_Query_X(9), World_Waypoint_Query_Y(9), World_Waypoint_Query_Z(9), 0); - } - Scene_Exit_Add_2D_Exit(0, 0, 460, 639, 479, 2); - Scene_Exit_Add_2D_Exit(1, 0, 5, 110, 196, 3); -} - -static int track_data_29[] = {-26, 12, 20, -18, 12, 20, -9, 29, -5, 200, -1, 0, -7, 4000, 10000, -8, 29, -10, 33, 33, -15, 29, 1, -22, 29, -2, 5, -3, 500, -24, 27, 33, -10, 34, 33, -2, 0, -9, 29, -13, 44, 42, -12, 29, -4}; -static int track_data_30[] = {-26, 12, 20, -18, 12, 20, -9, 30, -5, 67, -1, 0, -7, 3000, 9000, -8, 30, -10, 33, 33, -15, 30, 1, -22, 30, -2, 5, -3, 500, -24, 27, 33, -10, 34, 33, -2, 0, -9, 30, -13, 41, 39, -12, 30, -15, 30, 0, -4}; -static int track_data_31[] = {-26, 12, 20, -18, 12, 20, -15, 31, 1, -23, 31, -9, 31, -5, 480, -1, 0, -7, 3000, 10000, -8, 31, -2, 5, -10, 29, 33, -3, 1000, -6, 968, 100, -10, 29, 33, -3, 500, -2, 0, -10, 29, 33, -25, -9, 31, -14, 40, 32, 33, -12, 31, -4}; -static int track_data_32[] = {-26, 12, 20, -18, 12, 20, -9, 32, -5, 1010, -1, 0, -7, 3000, 10000, -8, 32, -10, 33, 33, -15, 32, 1, -22, 32, -2, 5, -3, 500, -24, 27, 33, -6, 498, 80, -10, 29, 33, -3, 500, -2, 0, -9, 32, -14, 33, 31, 40, -12, 32, -4}; -static int track_data_33[] = {-26, 12, 20, -18, 12, 20, -9, 33, -5, 540, -1, 0, -7, 4000, 10000, -8, 33, -15, 33, 1, -23, 33, -2, 5, -10, 29, 33, -3, 1000, -6, 284, 80, -3, 0, -6, 28, 80, -10, 29, 33, -3, 1000, -2, 0, -25, -9, 33, -14, 40, 31, 32, -12, 33, -4}; -static int track_data_34[] = {-26, 12, 20, -18, 12, 20, -9, 34, -9, 35, -9, 36, -5, 469, -1, 0, -15, 34, 1, -15, 35, 1, -15, 36, 1, -7, 3000, 10000, -8, 34, -22, 34, -22, 35, -22, 36, -2, 5, -10, 29, 33, -3, 1000, -6, 376, 80, -3, 0, -6, 168, 80, -10, 29, 33, -2, 9, -6, 33, 80, -3, 0, -6, 15, 80, -10, 29, 33, -3, 500, -24, 27, 33, -2, 5, -10, 29, 33, -6, 168, 80, -3, 0, -6, 376, 80, -3, 0, -6, 469, 80, -10, 29, 33, -3, 500, -15, 34, 1, -15, 35, 1, -15, 36, 1, -22, 34, -22, 35, -22, 36, -6, 376, 80, -3, 0, -6, 168, 80, -2, 9, -6, 33, 80, -3, 0, -6, 15, 80, -10, 29, 33, -3, 500, -24, 27, 33, -2, 5, -10, 29, 33, -3, 0, -6, 469, 80, -3, 500, -6, 198, 80, -10, 29, 33, -3, 0, -2, 19, -10, 29,33, -3, 0, -9, 34, -11, 35, -12, 34, -1, 0, -4}; -static int track_data_35[] = {-8, 35, -5, 198, -1, 0, -6, 469, 80, -2, 9, -3, 0, -9, 35, -11, 36, -12, 35, -5, 198, -8, 35, -1, 0, -4}; -static int track_data_36[] = {-8, 36, -5, 469, -1, 0, -8, 36, -2, 9, -10, 29, 33, -3, 1000, -9, 34, -9, 35, -9, 36, -11, 37, -12, 36, -5, 469, -8, 36, -1, 0, -4}; -static int track_data_37[] = {-26, 12, 20, -18, 12, 20, -9, 37, -7, 3000, 6000, -11, 38, -5, 1010, -1, 0, -3, 2000, -8, 37, -10, 33, 33, -15, 37, 1, -23, 37, -2, 9, -3, 3000, -10, 34, 33, -2, 0, -25, -9, 37, -12, 37, -1, 0, -4}; -static int track_data_38[] = {-9, 38, -5, 990, -1, 0, -3, 3000, -8, 38, -10, 33, 33, -15, 38, 1, -22, 38, -2, 9, -3, 1000, -24, 12, 33, -10, 34, 33, -2, 0, -9, 38, -11, 34, -12, 38, -1, 0, -4}; -static int track_data_39[] = {-26, 12, 20, -18, 12, 20, -9, 39, -5, 513, -1, 0, -7, 5000, 5000, -8, 39, -10, 33, 33, -15, 39, 1, -2, 5, -3, 1000, -22, 39, -6, 1010, 80, -10, 29, 33, -3, 500, -24, 27, 33, -10, 34, 33, -2, 0, -9, 39, -13, 41, 30, -12, 39, -4}; -static int track_data_40[] = {-26, 12, 20, -18, 12, 20, -9, 40, -5, 480, -1, 0, -7, 4000, 8000, -8, 40, -10, 29, 33, -15, 40, 1, -2, 5, -10, 29, 33, -3, 500, -22, 40, -6, 968, 80, -10, 29, 33, -3, 1000, -24, 27, 33, -2, 0, -9, 40, -14, 31, 32, 33, -12, 40, -4}; -static int track_data_41[] = {-26, 12, 20, -18, 12, 20, -9, 41, -5, 513, -1, 0, -7, 4000, 6000, -8, 41, -10, 33, 33, -15, 41, 1, -23, 41, -2, 5, -3, 500, -6, 1010, 80, -10, 29, 33, -3, 1000, -2, 0, -10, 34, 33, -25, -9, 41, -13, 39, 30, -12, 41, -4}; -static int track_data_42[] = {-9, 42, -5, 109, -1, 0, -7, 2000, 5000, -8, 42, -10, 29, 33, -15, 42, 1, -22, 42, -2, 5, -10, 29, 33, -3, 1000, -24, 27, 33, -2, 0, -9, 42, -13, 44, 29, -12, 42, -4}; -static int track_data_43[] = {-26, 12, 20, -18, 12, 20, -9, 43, -5, 540, -1, 0, -7, 5000, 7000, -8, 43, -10, 33, 33, -15, 43, 1, -23, 43, -2, 9, -3, 2000, -6, 284, 80, -3, 0, -6, 28, 80, -10, 29, 33, -3, 2000, -10, 34, 33, -2, 0, -25, -9, 43, -11, 45, -12, 43, -4}; -static int track_data_44[] = {-26, 12, 20, -18, 12, 20, -9, 44, -5, 109, -1, 0, -7, 5000, 5000, -8, 44, -10, 29, 33, -15, 44, 1, -23, 44, -2, 5, -7, 2000, 2000, -10, 29, 33, -2, 0, -25, -9, 44, -13, 42, 29, -12, 44, -4}; -static int track_data_45[] = {-26, 12, 20, -18, 12, 20, -9, 45, -5, 540, -1, 0, -7, 3000, 10000, -8, 45, -10, 33, 33, -15, 45, 1, -2, 9, -3, 1000, -22, 45, -6, 284, 80, -3, 0, -6, 28, 80, -3, 1000, -24, 27, 33, -10, 34, 33, -2, 0, -9, 45, -11, 43, -12, 45, -4}; - -void ScriptPS12::SceneLoaded() { - Obstacle_Object("PARKMETR01", true); - Obstacle_Object("PARKMETR02", true); - Obstacle_Object("PARKMETR03", true); - Obstacle_Object("PARKMETR07", true); - Obstacle_Object("PARKMETR08", true); - Obstacle_Object("PARKMETR10", true); - Obstacle_Object("PARKMETR11", true); - Obstacle_Object("PARKMETR15", true); - Obstacle_Object("PARKMETR16", true); - Unclickable_Object("PARKMETR01"); - Unclickable_Object("PARKMETR02"); - Unclickable_Object("PARKMETR03"); - Unclickable_Object("PARKMETR07"); - Unclickable_Object("PARKMETR08"); - Unclickable_Object("PARKMETR10"); - Unclickable_Object("PARKMETR11"); - Unclickable_Object("PARKMETR15"); - Unclickable_Object("PARKMETR16"); - if (!Query_System_Currently_Loading_Game()) { - Item_Add_To_World(29, 449, 14, -691.8f, -9.06f, 587.67f, 200, 72, 36, true, false, false, true); - Item_Add_To_World(30, 445, 14, -679.6f, -45.4f, 721.05f, 67, 72, 36, true, false, false, true); - Item_Add_To_World(31, 447, 14, -414.04f, -8.98f, 711.91f, 480, 72, 36, true, false, false, true); - Item_Add_To_World(32, 443, 14, -440.0f, -8.97f, 1137.0f, 1010, 72, 36, true, false, false, true); - Item_Add_To_World(33, 441, 14, -764.92f, -0.84f, 950.22f, 540, 72, 36, true, false, false, true); - Item_Add_To_World(34, 449, 14, -696.0f, -5.7f, 1185.0f, 469, 72, 36, true, false, false, true); - Item_Add_To_World(35, 449, 14, -635.0f, -5.7f, 1165.0f, 198, 72, 36, true, false, false, true); - Item_Add_To_World(36, 449, 14, -620.0f, -8.63f, 1366.0f, 469, 72, 36, true, false, false, true); - Item_Add_To_World(37, 447, 14, -584.0f, -79.4f, 775.0f, 1010, 72, 36, true, false, false, true); - Item_Add_To_World(38, 445, 14, -578.0f, -79.4f, 810.0f, 990, 72, 36, true, false, false, true); - Item_Add_To_World(39, 443, 14, -400.0f, -12.0f, 1110.0f, 513, 72, 36, true, false, false, true); - Item_Add_To_World(40, 449, 14, -414.04f, -8.98f, 711.91f, 480, 72, 36, true, false, false, true); - Item_Add_To_World(41, 447, 14, -400.0f, -12.0f, 1110.0f, 513, 72, 36, true, false, false, true); - Item_Add_To_World(42, 449, 14, -731.0f, 93.66f, 788.0f, 109, 72, 36, true, false, false, true); - Item_Add_To_World(43, 441, 14, -580.0f, -80.0f, 925.0f, 540, 72, 36, true, false, false, true); - Item_Add_To_World(44, 441, 14, -731.0f, 93.66f, 788.0f, 109, 72, 36, true, false, false, true); - Item_Add_To_World(45, 443, 14, -580.0f, -80.0f, 925.0f, 540, 72, 36, true, false, false, true); - } - Police_Maze_Target_Track_Add(29, -691.8f, -9.06f, 587.67f, -649.11f, -9.06f, 587.71f, 6, track_data_29, true); - Police_Maze_Target_Track_Add(30, -679.6f, -45.4f, 721.05f, -679.6f, -1.4f, 721.05f, 6, track_data_30, true); - Police_Maze_Target_Track_Add(31, -414.04f, -8.98f, 711.917f, -459.54f, -8.99f, 707.81f, 6, track_data_31, false); - Police_Maze_Target_Track_Add(32, -440.0f, -8.97f, 1137.0f, -430.0f, -8.97f, 921.0f, 6, track_data_32, false); - Police_Maze_Target_Track_Add(33, -764.92f, -0.84f, 950.21997f, -722.92f, -0.84f, 950.22f, 6, track_data_33, false); - Police_Maze_Target_Track_Add(34, -696.0f, -5.7f, 1185.0f, -635.0f, -5.7f, 1185.0f, 20, track_data_34, false); - Police_Maze_Target_Track_Add(35, -635.0f, -5.7f, 1165.0f, -620.0f, -8.63f, 1366.0f, 10, track_data_35, false); - Police_Maze_Target_Track_Add(36, -620.0f, -8.63f, 1366.0f, -595.0f, -8.63f, 1366.0f, 10, track_data_36, false); - Police_Maze_Target_Track_Add(37, -584.0f, -79.4f, 775.0f, -584.0f, -27.4f, 775.0f, 10, track_data_37, true); - Police_Maze_Target_Track_Add(38, -578.0f, -79.4f, 810.0f, -578.0f, -27.4f, 810.0f, 10, track_data_38, false); - Police_Maze_Target_Track_Add(39, -400.0f, -12.0f, 1110.0f, -400.0f, 60.0f, 1110.0f, 6, track_data_39, false); - Police_Maze_Target_Track_Add(40, -414.04f, -8.98f, 711.91f, -459.54f, -8.99f, 707.81f, 6, track_data_40, true); - Police_Maze_Target_Track_Add(41, -400.0f, -12.0f, 1110.0f, -400.0f, 60.0f, 1110.0f, 6, track_data_41, false); - Police_Maze_Target_Track_Add(42, -731.0f, 93.66f, 788.0f, -702.0f, 93.66f, 788.0f, 6, track_data_42, false); - Police_Maze_Target_Track_Add(43, -580.0f, -80.0f, 925.0f, -580.0f, -8.0f, 925.0f, 10, track_data_43, true); - Police_Maze_Target_Track_Add(44, -731.0f, 93.66f, 788.0f, -702.0f, 93.66f, 788.0f, 6, track_data_44, false); - Police_Maze_Target_Track_Add(45, -580.0f, -80.0f, 925.0f, -580.0f, -8.0f, 925.0f, 10, track_data_45, false); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(0); - Ambient_Sounds_Add_Looping_Sound(387, 50, 1, 1); - Ambient_Sounds_Add_Looping_Sound(54, 50, 1, 1); - Ambient_Sounds_Add_Sound(1, 10, 50, 16, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(389, 5, 50, 16, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(390, 6, 50, 16, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(443, 2, 100, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(444, 2, 100, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(445, 2, 100, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(446, 2, 100, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(303, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(304, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(305, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(306, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(307, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(308, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); -} - -bool ScriptPS12::MouseClick(int x, int y) { - return false; -} - -bool ScriptPS12::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptPS12::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptPS12::ClickedOnItem(int itemId, bool a2) { - if (Player_Query_Combat_Mode()) { - switch (itemId) { - case 31: - Sound_Play(4, 50, 0, 0, 50); - break; - case 37: - Sound_Play(4, 50, 0, 0, 50); - break; - case 41: - Sound_Play(4, 50, 0, 0, 50); - break; - case 33: - Sound_Play(555, 50, 0, 0, 50); - break; - case 43: - Sound_Play(555, 50, 0, 0, 50); - break; - case 44: - Sound_Play(555, 50, 0, 0, 50); - break; - default: - Sound_Play(2, 12, 0, 0, 50); - break; - } - Item_Spin_In_World(itemId); - Item_Flag_As_Non_Target(itemId); - if (itemId == 29) { - Item_Flag_As_Non_Target(29); - } - if (itemId == 30) { - Item_Flag_As_Non_Target(30); - } - if (itemId == 31) { - Item_Flag_As_Non_Target(31); - } - if (itemId == 32) { - Item_Flag_As_Non_Target(32); - } - if (itemId == 33) { - Item_Flag_As_Non_Target(33); - } - if (itemId == 34) { - Item_Flag_As_Non_Target(34); - Item_Flag_As_Non_Target(35); - Item_Flag_As_Non_Target(36); - } - if (itemId == 35) { - Item_Flag_As_Non_Target(34); - Item_Flag_As_Non_Target(35); - Item_Flag_As_Non_Target(36); - } - if (itemId == 36) { - Item_Flag_As_Non_Target(34); - Item_Flag_As_Non_Target(35); - Item_Flag_As_Non_Target(36); - } - if (itemId == 37) { - Item_Flag_As_Non_Target(37); - } - if (itemId == 38) { - Item_Flag_As_Non_Target(38); - } - if (itemId == 39) { - Item_Flag_As_Non_Target(39); - } - if (itemId == 40) { - Item_Flag_As_Non_Target(40); - } - if (itemId == 41) { - Item_Flag_As_Non_Target(41); - } - if (itemId == 42) { - Item_Flag_As_Non_Target(42); - } - if (itemId == 43) { - Item_Flag_As_Non_Target(43); - } - if (itemId == 44) { - Item_Flag_As_Non_Target(44); - } - if (itemId == 45) { - Item_Flag_As_Non_Target(45); - } - return true; - } - return false; -} - -bool ScriptPS12::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_Waypoint(0, 8, 12, 1, false)) { - Game_Flag_Set(17); - sub_4028C4(); - Set_Enter(14, 74); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_Waypoint(0, 9, 12, 1, false)) { - Player_Loses_Control(); - Loop_Actor_Walk_To_Waypoint(0, 10, 12, 0, false); - Player_Gains_Control(); - Game_Flag_Set(18); - sub_4028C4(); - Global_Variable_Decrement(9, 20 - Global_Variable_Query(12)); - Global_Variable_Set(12, 20); - Set_Enter(14, 76); - } - return true; - } - return false; -} - -bool ScriptPS12::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptPS12::SceneFrameAdvanced(int frame) { -} - -void ScriptPS12::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptPS12::PlayerWalkedIn() { - if (Game_Flag_Query(16)) { - Loop_Actor_Walk_To_XYZ(0, -546.0f, -9.06f, 570.0f, 0, 1, false, 0); - Game_Flag_Reset(16); - } - Police_Maze_Set_Pause_State(0); -} - -void ScriptPS12::PlayerWalkedOut() { -} - -void ScriptPS12::DialogueQueueFlushed(int a1) { -} - -void ScriptPS12::sub_4028C4() { - Item_Remove_From_World(29); - Item_Remove_From_World(30); - Item_Remove_From_World(31); - Item_Remove_From_World(32); - Item_Remove_From_World(33); - Item_Remove_From_World(34); - Item_Remove_From_World(35); - Item_Remove_From_World(36); - Item_Remove_From_World(37); - Item_Remove_From_World(38); - Item_Remove_From_World(39); - Item_Remove_From_World(40); - Item_Remove_From_World(41); - Item_Remove_From_World(42); - Item_Remove_From_World(43); - Item_Remove_From_World(44); - Item_Remove_From_World(45); -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ps13.cpp b/engines/bladerunner/script/ps13.cpp deleted file mode 100644 index 5b5ac20eb8..0000000000 --- a/engines/bladerunner/script/ps13.cpp +++ /dev/null @@ -1,285 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptPS13::InitializeScene() { - Police_Maze_Set_Pause_State(1); - if (Game_Flag_Query(18)) { - Scene_Loop_Start_Special(0, 0, 0); - Scene_Loop_Set_Default(1); - Game_Flag_Reset(18); - Setup_Scene_Information(World_Waypoint_Query_X(10), World_Waypoint_Query_Y(10), World_Waypoint_Query_Z(10), 200); - } else { - Scene_Loop_Set_Default(1); - Setup_Scene_Information(World_Waypoint_Query_X(11), World_Waypoint_Query_Y(11), World_Waypoint_Query_Z(11), 840); - } - Scene_Exit_Add_2D_Exit(0, 0, 460, 639, 479, 2); - Scene_Exit_Add_2D_Exit(1, 0, 0, 20, 479, 3); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(0); - Ambient_Sounds_Add_Looping_Sound(387, 50, 1, 1); - Ambient_Sounds_Add_Looping_Sound(54, 50, 1, 1); - Ambient_Sounds_Add_Sound(1, 10, 50, 16, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(389, 5, 50, 16, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(390, 6, 50, 16, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(443, 2, 100, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(444, 2, 100, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(445, 2, 100, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(446, 2, 100, 14, 16, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(303, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(304, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(305, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(306, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(307, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(308, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); -} - -static int track_data_46[] = {-26, 13, 20, -18, 13, 20, -9, 46, -5, 960, -1, 0, -3, 2000, -8, 46, -10, 33, 33, -15, 46, 1, -22, 46, -3, 1000, -2, 5, -3, 500, -24, 27, 33, -3, 500, -2, 0, -9, 46, -13, 62, 63, -12, 46, -4}; -static int track_data_47[] = {-26, 13, 20, -18, 13, 20, -9, 47, -5, 823, -1, 0, -7, 5000, 5000, -8, 47, -10, 33, 33, -15, 47, 1, -22, 47, -2, 9, -3, 2000, -24, 27, 33, -2, 0, -9, 47, -13, 50, 52, -12, 47, -4}; -static int track_data_48[] = {-26, 13, 20, -18, 13, 20, -9, 48, -5, 823, -1, 0, -7, 2000, 2000, -8, 48, -10, 33, 33, -15, 48, 1, -23, 48, -2, 9, -3, 2000, -25, -2, 0, -9, 48, -13, 53, 51, -12, 48, -4}; -static int track_data_49[] = {-26, 13, 20, -18, 13, 20, -9, 49, -5, 922, -1, 0, -7, 3000, 3000, -8, 49, -10, 33, 33, -15, 49, 1, -22, 49, -2, 9, -3, 1000, -24, 27, 33, -2, 0, -9, 49, -13, 54, 55, -12, 49, -1, 0, -4}; -static int track_data_50[] = {-26, 13, 20, -18, 13, 20, -9, 50, -5, 823, -1, 0, -7, 3000, 5000, -8, 50, -10, 33, 33, -15, 50, 1, -23, 50, -2, 9, -3, 2000, -2, 0, -25, -9, 50, -13, 47, 52, -12, 50, -4}; -static int track_data_51[] = {-26, 13, 20, -18, 13, 20, -9, 51, -5, 823, -1, 0, -7, 2000, 2000, -8, 51, -10, 33, 33, -15, 51, 1, -22, 51, -2, 9, -3, 1000, -24, 27, 33, -3, 500, -2, 0, -9, 51, -13, 53, 48, -12, 51, -4}; -static int track_data_52[] = {-26, 13, 20, -18, 13, 20, -9, 52, -5, 305, -1, 0, -7, 5000, 10000, -8, 52, -10, 33, 33, -15, 52, 1, -23, 52, -2, 9, -3, 500, -22, 52, -6, 555, 80, -3, 0, -6, 833, 80, -3, 1000, -24, 27, 33, -2, 0, -9, 52, -13, 47, 50, -12, 52, -4}; -static int track_data_53[] = {-26, 13, 20, -18, 13, 20, -9, 53, -5, 356, -1, 0, -7, 3000, 3000, -8, 53, -10, 33, 33, -15, 53, 1, -23, 53, -2, 5, -22, 53, -6, 868, 200, -3, 1000, -24, 27, 33, -6, 356, 60, -3, 1000, -2, 0, -9, 53, -13, 48, 51, -12, 53, -4}; -static int track_data_54[] = {-26, 13, 20, -18, 13, 20, -9, 54, -5, 512, -1, 0, -7, 10000, 20000, -8, 54, -10, 33, 33, -15, 54, 1, -23, 54, -2, 3, -3, 500, -22, 54, -6, 768, 80, -3, 1000, -24, 27, 33, -2, 0, -9, 54, -13, 58, 55, -12, 54, -4}; -static int track_data_55[] = {-26, 13, 20, -18, 13, 20, -9, 55, -9, 56, -9, 57, -15, 55, 1, -15, 56, 1, -15, 57, 1, -5, 327, -1, 0, -7, 1000, 1000, -10, 33, 33, -23, 55, -8, 55, -2, 14, -3, 1000, -11, 56, -9, 55, -8, 56, -12, 55, -1, 0, -4}; -static int track_data_56[] = {-5, 327, -1, 0, -8, 56, -23, 56, -2, 14, -3, 1000, -11, 57, -9, 56, -8, 57, -12, 56, -1, 0, -4}; -static int track_data_57[] = {-22, 57, -5, 327, -1, 0, -8, 57, -6, 516, 80, -3, 0, -6, 843, 80, -3, 1000, -24, 27, 33, -3, 500, -2, 14, -9, 57, -13, 58, 54, -12, 57, -1, 0, -4}; -static int track_data_58[] = {-26, 13, 20, -18, 13, 20, -9, 58, -5, 922, -1, 0, -7, 3000, 3000, -8, 58, -10, 33, 33, -15, 58, 1, -23, 58, -2, 9, -3, 200, -2, 0, -25, -15, 58, 1, -23, 58, -3, 200, -2, 9, -3, 200, -2, 0, -25, -9, 58, -11, 49, -12, 58, -1, 0, -4}; -static int track_data_62[] = {-26, 13, 20, -18, 13, 20, -9, 62, -5, 465, -1, 0, -7, 3000, 3000, -8, 62, -10, 33, 33, -15, 62, 1, -23, 62, -2, 14, -3, 1000, -22, 62, -6, 650, 80, -3, 0, -6, 937, 80, -3, 1000, -24, 27, 33, -3, 500, -6, 650, 80, -3, 0, -6, 465, 80, -2, 0, -9, 62, -13, 46, 63, -12, 62, -4}; -static int track_data_63[] = {-26, 13, 20, -18, 13, 20, -9, 63, -5, 465, -1, 0, -3, 3000, -8, 63, -10, 33, 33, -15, 63, 1, -23, 63, -2, 9, -3, 1000, -22, 63, -6, 710, 80, -3, 0, -6, 960, 80, -3, 1000, -24, 27, 33, -3, 500, -6, 710, 80, -3, 0, -6, 460, 80, -2, 0, -9, 63, -13, 46, 62, -12, 63, -4}; - -void ScriptPS13::SceneLoaded() { - Obstacle_Object("PARKMETR01", true); - Obstacle_Object("PARKMETR02", true); - Obstacle_Object("PARKMETR03", true); - Obstacle_Object("PARKMETR07", true); - Obstacle_Object("PARKMETR08", true); - Obstacle_Object("PARKMETR10", true); - Obstacle_Object("PARKMETR11", true); - Obstacle_Object("PARKMETR15", true); - Obstacle_Object("PARKMETR16", true); - Unclickable_Object("PARKMETR01"); - Unclickable_Object("PARKMETR02"); - Unclickable_Object("PARKMETR03"); - Unclickable_Object("PARKMETR07"); - Unclickable_Object("PARKMETR08"); - Unclickable_Object("PARKMETR10"); - Unclickable_Object("PARKMETR11"); - Unclickable_Object("PARKMETR15"); - Unclickable_Object("PARKMETR16"); - if (!Query_System_Currently_Loading_Game()) { - Item_Add_To_World(46, 443, 14, -372.0f, -9.0f, 1509.0f, 960, 72, 36, true, false, false, true); - Item_Add_To_World(47, 443, 14, 291.61f, -0.66f, 1610.3f, 823, 72, 36, true, false, false, true); - Item_Add_To_World(48, 447, 14, -25.0f, 102.0f, 1625.0f, 823, 72, 36, true, false, false, true); - Item_Add_To_World(49, 449, 14, -45.51f, -8.8f, 1676.0f, 922, 72, 36, true, false, false, true); - Item_Add_To_World(50, 447, 14, 291.61f, -0.66f, 1610.3f, 823, 72, 36, true, false, false, true); - Item_Add_To_World(51, 443, 14, -24.0f, 102.0f, 1625.0f, 823, 72, 36, true, false, false, true); - Item_Add_To_World(52, 449, 14, 180.0f, -72.7f, 1605.0f, 305, 72, 36, true, false, false, true); - Item_Add_To_World(53, 443, 14, 127.79f, 14.56f, 1703.03f, 356, 72, 36, true, false, false, true); - Item_Add_To_World(54, 443, 14, 136.37f, -6.84f, 1425.4301f, 512, 72, 36, true, false, false, true); - Item_Add_To_World(55, 441, 14, 77.83f, -79.8f, 1520.5f, 327, 72, 36, true, false, false, true); - Item_Add_To_World(56, 441, 14, 77.83f, -7.8f, 1520.5f, 327, 72, 36, true, false, false, true); - Item_Add_To_World(57, 443, 14, -88.0f, -8.8f, 1520.5f, 327, 72, 36, true, false, false, true); - Item_Add_To_World(58, 447, 14, -45.51f, -8.8f, 1676.0f, 922, 72, 36, true, false, false, true); - Item_Add_To_World(62, 445, 14, -300.0f, -79.75f, 1543.0f, 465, 72, 36, true, false, false, true); - Item_Add_To_World(63, 449, 14, -325.0f, -7.75f, 1543.0f, 465, 72, 36, true, false, false, true); - } - Police_Maze_Target_Track_Add(46, -372.0f, -9.0f, 1509.0f, -345.0f, -9.0f, 1509.0f, 6, track_data_46, true); - Police_Maze_Target_Track_Add(47, 291.61f, -0.66f, 1610.3f, 238.83f, 1.03f, 1557.03f, 10, track_data_47, true); - Police_Maze_Target_Track_Add(48, -25.0f, 102.0f, 1625.0f, -25.0f, 138.0f, 1625.0f, 10, track_data_48, true); - Police_Maze_Target_Track_Add(49, -45.51f, -8.8f, 1676.0f, 15.51f, -8.8f, 1679.0f, 10, track_data_49, false); - Police_Maze_Target_Track_Add(50, 291.61f, -0.66f, 1610.3f, 238.83f, 1.03f, 1557.03f, 10, track_data_50, false); - Police_Maze_Target_Track_Add(51, -24.0f, 102.0f, 1625.0f, -24.0f, 138.0f, 1625.0f, 10, track_data_51, false); - Police_Maze_Target_Track_Add(52, 180.0f, -72.7f, 1605.0f, 180.0f, -0.7f, 1605.0f, 10, track_data_52, false); - Police_Maze_Target_Track_Add(53, 127.79f, 14.56f, 1703.03f, -56.07f, 1.89f, 1589.04f, 6, track_data_53, false); - Police_Maze_Target_Track_Add(54, 136.37f, -6.84f, 1425.4301f, 117.55f, -6.84f, 1442.09f, 4, track_data_54, false); - Police_Maze_Target_Track_Add(55, 77.83f, -79.8f, 1520.5f, 77.83f, -7.8f, 1520.5f, 15, track_data_55, false); - Police_Maze_Target_Track_Add(56, 77.83f, -7.8f, 1520.5f, -88.0f, -8.8f, 1520.5f, 15, track_data_56, false); - Police_Maze_Target_Track_Add(57, -88.0f, -8.8f, 1520.5f, -88.0f, -80.8f, 1520.5f, 15, track_data_57, false); - Police_Maze_Target_Track_Add(58, -45.51f, -8.8f, 1676.0f, 15.51f, -8.8f, 1679.0f, 10, track_data_58, true); - Police_Maze_Target_Track_Add(62, -300.0f, -79.75f, 1543.0f, -300.0f, -14.75f, 1543.0f, 15, track_data_62, false); - Police_Maze_Target_Track_Add(63, -325.0f, -7.75f, 1543.0f, -300.0f, -7.75f, 1543.0f, 10, track_data_63, false); -} - -bool ScriptPS13::MouseClick(int x, int y) { - return false; -} - -bool ScriptPS13::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptPS13::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptPS13::ClickedOnItem(int itemId, bool a2) { - if (Player_Query_Combat_Mode()) { - switch (itemId) { - case 48: - Sound_Play(4, 50, 0, 0, 50); - break; - case 50: - Sound_Play(4, 50, 0, 0, 50); - break; - case 55: - Sound_Play(555, 50, 0, 0, 50); - break; - case 56: - Sound_Play(555, 50, 0, 0, 50); - break; - default: - Sound_Play(2, 12, 0, 0, 50); - break; - } - Item_Spin_In_World(itemId); - Item_Flag_As_Non_Target(itemId); - if (itemId == 46) { - Item_Flag_As_Non_Target(46); - } - if (itemId == 47) { - Item_Flag_As_Non_Target(47); - } - if (itemId == 48) { - Item_Flag_As_Non_Target(48); - } - if (itemId == 49) { - Item_Flag_As_Non_Target(49); - } - if (itemId == 50) { - Item_Flag_As_Non_Target(50); - } - if (itemId == 51) { - Item_Flag_As_Non_Target(51); - } - if (itemId == 52) { - Item_Flag_As_Non_Target(52); - } - if (itemId == 53) { - Item_Flag_As_Non_Target(53); - } - if (itemId == 54) { - Item_Flag_As_Non_Target(54); - } - if (itemId == 55) { - Item_Flag_As_Non_Target(55); - Item_Flag_As_Non_Target(56); - Item_Flag_As_Non_Target(57); - } - if (itemId == 56) { - Item_Flag_As_Non_Target(55); - Item_Flag_As_Non_Target(56); - Item_Flag_As_Non_Target(57); - } - if (itemId == 57) { - Item_Flag_As_Non_Target(55); - Item_Flag_As_Non_Target(56); - Item_Flag_As_Non_Target(57); - } - if (itemId == 58) { - Item_Flag_As_Non_Target(58); - } - if (itemId == 62) { - Item_Flag_As_Non_Target(62); - } - if (itemId == 63) { - Item_Flag_As_Non_Target(63); - } - return true; - } - return false; - -} - -bool ScriptPS13::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_Waypoint(0, 10, 12, 1, false)) { - Game_Flag_Set(19); - sub_40267C(); - Set_Enter(14, 75); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_Waypoint(0, 11, 12, 1, false)) { - Game_Flag_Set(21); - Player_Set_Combat_Mode(false); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - sub_40267C(); - Global_Variable_Decrement(9, 20 - Global_Variable_Query(13)); - Set_Score(0, Global_Variable_Query(9)); - Global_Variable_Reset(10); - Global_Variable_Reset(11); - Global_Variable_Reset(12); - Global_Variable_Reset(13); - Global_Variable_Reset(9); - Set_Enter(15, 69); - } - return true; - } - return false; -} - -bool ScriptPS13::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptPS13::SceneFrameAdvanced(int frame) { -} - -void ScriptPS13::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptPS13::PlayerWalkedIn() { - Police_Maze_Set_Pause_State(0); -} - -void ScriptPS13::PlayerWalkedOut() { -} - -void ScriptPS13::DialogueQueueFlushed(int a1) { -} - -void ScriptPS13::sub_40267C() { - Item_Remove_From_World(46); - Item_Remove_From_World(47); - Item_Remove_From_World(48); - Item_Remove_From_World(49); - Item_Remove_From_World(50); - Item_Remove_From_World(51); - Item_Remove_From_World(52); - Item_Remove_From_World(53); - Item_Remove_From_World(54); - Item_Remove_From_World(55); - Item_Remove_From_World(56); - Item_Remove_From_World(57); - Item_Remove_From_World(58); - Item_Remove_From_World(62); - Item_Remove_From_World(63); -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ps14.cpp b/engines/bladerunner/script/ps14.cpp deleted file mode 100644 index e68460252f..0000000000 --- a/engines/bladerunner/script/ps14.cpp +++ /dev/null @@ -1,127 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptPS14::InitializeScene() { - if (Game_Flag_Query(134)) { - Setup_Scene_Information(-1119.61f, 508.14f, -1208.22f, 315); - Game_Flag_Reset(134); - } else { - Setup_Scene_Information(-785.45f, 508.14f, -1652.0f, 315); - } - Scene_Exit_Add_2D_Exit(0, 610, 0, 639, 479, 1); - Scene_Exit_Add_2D_Exit(1, 46, 51, 125, 192, 0); - Ambient_Sounds_Add_Looping_Sound(381, 100, 1, 1); - Ambient_Sounds_Add_Sound(374, 100, 300, 16, 25, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(68, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(69, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(375, 60, 180, 50, 100, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(376, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(377, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0); -} - -void ScriptPS14::SceneLoaded() { - Obstacle_Object("CABLES UPPER RIGHT", true); - Unobstacle_Object("CYLINDER63", true); - Clickable_Object("CABLES UPPER RIGHT"); - Unclickable_Object("CABLES UPPER RIGHT"); -} - -bool ScriptPS14::MouseClick(int x, int y) { - return false; -} - -bool ScriptPS14::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptPS14::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptPS14::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptPS14::ClickedOnExit(int exitId) { - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -2101.0f, 508.14f, -1361.0f, 0, 1, false, 0)) { - Actor_Face_Heading(0, 819, false); - Loop_Actor_Travel_Stairs(0, 3, 1, 0); - if (Global_Variable_Query(1) == 4 && Game_Flag_Query(671)) { - if (Actor_Clue_Query(0, 32)) { - Game_Flag_Set(666); - Actor_Set_Goal_Number(0, 400); - } else { - Actor_Set_Goal_Number(0, 500); - } - } else if (Global_Variable_Query(1) > 3) { - Actor_Says(0, 8522, 12); - Actor_Face_Heading(0, 307, false); - Loop_Actor_Travel_Stairs(0, 3, 0, 0); - } else { - Game_Flag_Set(135); - Set_Enter(63, 67); - } - } - return true; - } - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -785.45f, 508.14f, -1652.0f, 0, 1, false, 0)) { - Game_Flag_Set(673); - Game_Flag_Reset(178); - Game_Flag_Set(179); - Set_Enter(53, 53); - } - return true; - } - return false; -} - -bool ScriptPS14::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptPS14::SceneFrameAdvanced(int frame) { -} - -void ScriptPS14::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptPS14::PlayerWalkedIn() { - if (Game_Flag_Query(672)) { - Loop_Actor_Walk_To_XYZ(0, -801.45f, 508.14f, -1596.68f, 0, 0, false, 0); - Game_Flag_Reset(672); - } - //return false; -} - -void ScriptPS14::PlayerWalkedOut() { -} - -void ScriptPS14::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ps15.cpp b/engines/bladerunner/script/ps15.cpp deleted file mode 100644 index 5200d89f7c..0000000000 --- a/engines/bladerunner/script/ps15.cpp +++ /dev/null @@ -1,173 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptPS15::InitializeScene() { - Setup_Scene_Information(-360.0f, -113.43f, 50.0f, 0); - Scene_Exit_Add_2D_Exit(0, 0, 0, 20, 479, 3); - Scene_Exit_Add_2D_Exit(1, 620, 0, 639, 479, 1); - Ambient_Sounds_Add_Looping_Sound(384, 20, 1, 1); - Ambient_Sounds_Add_Looping_Sound(141, 80, 0, 1); - Ambient_Sounds_Add_Sound(385, 5, 50, 8, 8, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(156, 5, 20, 30, 30, -70, 70, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(157, 5, 20, 30, 30, -70, 70, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(158, 5, 20, 30, 30, -70, 70, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(73, 5, 20, 5, 9, -70, 70, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(74, 5, 20, 5, 9, -70, 70, -101, -101, 0, 0); - Actor_Put_In_Set(34, 101); - Actor_Set_At_XYZ(34, -265.4f, -113.43f, -31.29f, 623); -} - -void ScriptPS15::SceneLoaded() { - Obstacle_Object("E.ARCH", true); - if (Global_Variable_Query(1) == 2) { - Item_Add_To_World(110, 983, 101, -208.0f, -113.43f, 30.28f, 750, 16, 12, false, true, false, true); - } -} - -bool ScriptPS15::MouseClick(int x, int y) { - return false; -} - -bool ScriptPS15::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptPS15::ClickedOnActor(int actorId) { - if (actorId == 34) { - if ((Actor_Clue_Query(0, 80) || Actor_Clue_Query(0, 83)) && !Actor_Clue_Query(0, 81)) { - if (!Loop_Actor_Walk_To_XYZ(0, -256.0f, -113.43f, 43.51f, 0, 1, false, 0)) { - Actor_Face_Actor(0, 34, true); - Actor_Face_Actor(34, 0, true); - Actor_Says(0, 4470, 17); - Actor_Says(34, 130, 12); - Actor_Says(0, 4475, 18); - Actor_Says(0, 4480, 13); - Actor_Says(34, 140, 16); - Item_Pickup_Spin_Effect(965, 211, 239); - Actor_Says(34, 150, 14); - Actor_Clue_Acquire(0, 81, 1, 34); - if (!Game_Flag_Query(727)) { - Item_Remove_From_World(111); - } - } - } else { - Actor_Face_Actor(0, 34, true); - Actor_Says(0, 8600, 15); - Actor_Says(34, 190, 12); - } - return true; - } - return false; -} - -bool ScriptPS15::ClickedOnItem(int itemId, bool a2) { - if (itemId == 110) { - if (Actor_Clue_Query(0, 80) && Actor_Clue_Query(0, 83)) { - Actor_Says(0, 8570, 14); - } else { - Actor_Face_Actor(0, 34, true); - Actor_Face_Actor(34, 0, true); - Actor_Says(0, 4485, 17); - Actor_Says(34, 160, 14); - Actor_Says(0, 4490, 12); - Actor_Says(34, 170, 13); - Actor_Clue_Acquire(0, 80, 1, 0); - Actor_Clue_Acquire(0, 83, 1, 0); - } - return true; - } - return false; -} - -bool ScriptPS15::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -360.0f, -113.43f, 50.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(204); - Set_Enter(15, 69); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -183.58f, -113.43f, 91.7f, 0, 1, false, 0)) { - Actor_Says(0, 4440, 18); - Actor_Says(34, 150, 17); - Sound_Play(155, 90, 0, 0, 50); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Set_Enter(14, 73); - } - return true; - } - return false; -} - -bool ScriptPS15::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptPS15::SceneFrameAdvanced(int frame) { -} - -void ScriptPS15::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptPS15::PlayerWalkedIn() { - Loop_Actor_Walk_To_XYZ(0, -326.93f, -113.43f, 101.42f, 0, 0, false, 0); - if (!Game_Flag_Query(43)) { - Actor_Face_Actor(0, 34, true); - Actor_Face_Actor(34, 0, true); - Actor_Says(34, 0, 12); - Actor_Says(0, 4445, 18); - Actor_Says(34, 10, 12); - Actor_Says(0, 4450, 18); - Actor_Says(34, 60, 13); - Actor_Says(34, 70, 12); - Actor_Says(0, 4460, 15); - Actor_Says(34, 80, 13); - Actor_Says(0, 4465, 16); - Actor_Says(34, 90, 13); - Actor_Says(34, 100, 14); - Actor_Says(34, 110, 15); - Actor_Says(34, 120, 15); - Actor_Says(0, 4555, 14); - Game_Flag_Set(43); - //return true; - return; - } else { - //return false; - return; - } -} - -void ScriptPS15::PlayerWalkedOut() { -} - -void ScriptPS15::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/rc01.cpp b/engines/bladerunner/script/rc01.cpp deleted file mode 100644 index f3a7748c57..0000000000 --- a/engines/bladerunner/script/rc01.cpp +++ /dev/null @@ -1,623 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptRC01::InitializeScene() { -#if _DEBUG - //TODO: not part of game, remove - Game_Flag_Set(24); // force skip intro - // Game_Flag_Set(9); // Force flag 9 so McCoy will be in view - - Footstep_Sound_Override_On(0); -#endif - - if (!Game_Flag_Query(24)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Outtake_Play(28, 1, -1); // WSTLGO_E.VQA - Outtake_Play(41, 1, -1); // BRLOGO_E.VQA - Outtake_Play(0, 0, -1); // INTRO_E.VQA - Outtake_Play(33, 1, -1); // DSCENT_E.VQA - } - if (Game_Flag_Query(9)) { - Setup_Scene_Information(-171.16f, 5.55f, 27.28f, 616); - } else if (Game_Flag_Query(114)) { - Setup_Scene_Information(-471.98f, -0.30f, 258.15f, 616); - } else { - Setup_Scene_Information(-10.98f, -0.30f, 318.15f, 616); - } - Scene_Exit_Add_2D_Exit(0, 314, 145, 340, 255, 0); - if (Game_Flag_Query(249)) { - Scene_Exit_Add_2D_Exit(1, 482, 226, 639, 280, 2); - } - if (Global_Variable_Query(1) > 1 && Game_Flag_Query(710)) { - Scene_Exit_Add_2D_Exit(2, 0, 0, 10, 479, 3); - } - if (!Game_Flag_Query(186)) { - Scene_2D_Region_Add(0, 0, 294, 296, 479); - } - - Ambient_Sounds_Remove_All_Non_Looping_Sounds(0); - Ambient_Sounds_Add_Looping_Sound(54, 30, 0, 1); // CTRAIN1.AUD - - if (!Game_Flag_Query(186)) { - Ambient_Sounds_Add_Sound(181, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); // 67_0470R.AUD - Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); // 67_0480R.AUD - Ambient_Sounds_Add_Sound(183, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); // 67_0500R.AUD - Ambient_Sounds_Add_Sound(184, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); // 67_0540R.AUD - Ambient_Sounds_Add_Sound(185, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); // 67_0560R.AUD - Ambient_Sounds_Add_Sound(186, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); // 67_0870R.AUD - Ambient_Sounds_Add_Sound(188, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); // 67_0900R.AUD - Ambient_Sounds_Add_Sound(189, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); // 67_0940R.AUD - Ambient_Sounds_Add_Sound(190, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); // 67_0960R.AUD - Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); // 67_1070R.AUD - Ambient_Sounds_Add_Sound(192, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); // 67_1080R.AUD - Ambient_Sounds_Add_Sound(193, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); // 67_1100R.AUD - Ambient_Sounds_Add_Sound(194, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); // 67_1140R.AUD - Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); // 67_1160R.AUD - } - - Ambient_Sounds_Add_Looping_Sound(81, 60, 100, 1); // RCAMBR1.AUD - Ambient_Sounds_Add_Sound(82, 5, 30, 30, 50, -100, 100, -101, -101, 0, 0); // RCCARBY1.AUD - Ambient_Sounds_Add_Sound(83, 5, 30, 30, 55, -100, 100, -101, -101, 0, 0); // RCCARBY2.AUD - Ambient_Sounds_Add_Sound(84, 5, 30, 30, 50, -100, 100, -101, -101, 0, 0); // RCCARBY3.AUD - Ambient_Sounds_Add_Sound(67, 10, 50, 30, 50, -100, 100, -101, -101, 0, 0); // SPIN2A.AUD - Ambient_Sounds_Add_Sound(87, 20, 80, 20, 40, -100, 100, -101, -101, 0, 0); // SIREN2.AUD - - if (Game_Flag_Query(186)) { - if (!Game_Flag_Query(9) && !Game_Flag_Query(114)) { - Scene_Loop_Start_Special(0, 5, 0); - } - if (Game_Flag_Query(249)) { - Scene_Loop_Set_Default(6); - } else { - Scene_Loop_Set_Default(10); - } - } else { - if (!Game_Flag_Query(9) && !Game_Flag_Query(114)) { - Scene_Loop_Start_Special(0, 0, 0); - } - Scene_Loop_Set_Default(1); - } - - I_Sez("Blade Runner"); - I_Sez(""); - I_Sez("From the dark recesses of David Leary's imagination comes a game unlike any"); - I_Sez("other. Blade Runner immerses you in the underbelly of future Los Angeles. Right"); - I_Sez("from the start, the story pulls you in with graphic descriptions of a"); - I_Sez("grandmother doing the shimmy in her underwear, child molestation, brutal"); - I_Sez("cold-blooded slaying of innocent animals, vomiting on desks, staring at a"); - I_Sez("woman's ass, the list goes on. And when the game starts, the real fun begins -"); - I_Sez("shoot down-on-their-luck homeless people and toss them into a dumpster. Watch"); - I_Sez("with sadistic glee as a dog gets blown into chunky, bloody, bits by an"); - I_Sez("explosive, and even murder a shy little girl who loves you. If you think David"); - I_Sez("Leary is sick, and you like sick, this is THE game for you."); - I_Sez(""); - I_Sez("JW: Don't forget the wasting of helpless mutated cripples in the underground."); - I_Sez("It's such a beautiful thing!"); - I_Sez(""); - I_Sez("DL: Go ahead. Just keep beating that snarling pit bull...ignore the foam"); - I_Sez("around his jaws. There's room on the top shelf of my fridge for at least one"); - I_Sez("more head... - Psychotic Dave"); - I_Sez(""); -} - -void ScriptRC01::SceneLoaded() { - Obstacle_Object("HYDRANT02", true); - Obstacle_Object("PARKING METER 04", true); - Obstacle_Object("CHEVY PROP", true); - Obstacle_Object("PARKING METER 01", true); - Obstacle_Object("T-CAN01", true); - Obstacle_Object("BARICADE01", true); - Obstacle_Object("BARICADE02", true); - Obstacle_Object("DOOR LEFT", true); - Unobstacle_Object("BOX06", true); - Clickable_Object("DOORWAY01"); - Clickable_Object("DOOR LEFT"); - Clickable_Object("HYDRANT02"); - Clickable_Object("T-CAN01"); - Clickable_Object("BARICADE01"); - Clickable_Object("70_1"); - Clickable_Object("70_2"); - Clickable_Object("70_3"); - Clickable_Object("70_5"); - Clickable_Object("70_6"); - Unclickable_Object("BARICADE02"); - Unclickable_Object("BARICADE05"); - Unclickable_Object("SPINNER BODY"); - Unclickable_Object("HORSE01"); - Unclickable_Object("DOORWAY01"); - Unobstacle_Object("DOORWAY01", true); - - if (Game_Flag_Query(186)) { - Unclickable_Object("70_1"); - Unclickable_Object("70_2"); - Unclickable_Object("70_3"); - Unclickable_Object("70_5"); - Unclickable_Object("70_6"); - Unclickable_Object("BARICADE01"); - Unclickable_Object("BARICADE03"); - Unclickable_Object("BARICADE04"); - Unobstacle_Object("70_1", true); - Unobstacle_Object("70_2", true); - Unobstacle_Object("70_3", true); - Unobstacle_Object("70_5", true); - Unobstacle_Object("70_6", true); - Unobstacle_Object("BARICADE01", true); - Unobstacle_Object("BARICADE02", true); - Unobstacle_Object("BARICADE03", true); - Unobstacle_Object("BARICADE04", true); - Unobstacle_Object("BARICADE05", true); - } - - if (!Game_Flag_Query(186)) { - Preload(13); - Preload(14); - Preload(19); - Preload(582); - Preload(589); - } - - if (!Game_Flag_Query(163)) { - Item_Add_To_World(66, 938, 69, -148.60f, -0.30f, 225.15f, 256, 24, 24, false, true, false, true); - } - - if (!Game_Flag_Query(24)) { - ADQ_Flush(); - Actor_Voice_Over(1830, 99); - Actor_Voice_Over(1850, 99); - if (!Game_Flag_Query(378)) { - Actor_Voice_Over(1860, 99); - I_Sez("MG: Is David Leary a self-respecting human or is he powered by rechargeable"); - I_Sez("batteries?\n"); - } - Game_Flag_Set(24); - } -} - -bool ScriptRC01::MouseClick(int x, int y) { - return y >= 430; -} - -bool ScriptRC01::ClickedOn3DObject(const char *objectName, bool a2) { - if (Object_Query_Click("BARICADE01", objectName) - || Object_Query_Click("BARICADE03", objectName) - || Object_Query_Click("BARICADE04", objectName) - || Object_Query_Click("70_1", objectName) - || Object_Query_Click("70_2", objectName) - || Object_Query_Click("70_3", objectName) - || Object_Query_Click("70_5", objectName) - || Object_Query_Click("70_6", objectName)) { - sub_403850(); - return true; - } - - if (Object_Query_Click("HYDRANT02", objectName)) { - if (!Loop_Actor_Walk_To_Scene_Object(0, "HYDRANT02", 60, true, false)) { - if (Actor_Clue_Query(0, 26)) { - Actor_Says(0, 6975, 3); - } else { - Actor_Face_Object(0, "HYDRANT02", true); - Actor_Voice_Over(1880, 99); - Actor_Voice_Over(1890, 99); - I_Sez("JM: That McCoy--he's one funny guy! Jet-black fire truck, hehehehe..."); - Actor_Clue_Acquire(0, 26, 1, -1); - } - } - return true; - } - - if (Object_Query_Click("DOOR LEFT", objectName)) { - if (!Loop_Actor_Walk_To_Scene_Object(0, "DOOR LEFT", 48, true, false)) { - Actor_Face_Object(0, "DOOR LEFT", true); - if (!Actor_Clue_Query(0, 2) && Actor_Query_In_Set(23, 69) && Global_Variable_Query(1)) { - Actor_Set_Goal_Number(23, 0); - Actor_Face_Actor(23, 0, true); - Actor_Says(23, 0, 12); - Actor_Says(0, 4495, 13); - Actor_Clue_Acquire(0, 2, 1, 23); - } else { - Actor_Says(0, 8570, 14); - } - Actor_Clue_Acquire(0, 1, 1, -1); - } - return true; - } - - if (Object_Query_Click("T-CAN01", objectName)) { - if (!Loop_Actor_Walk_To_Scene_Object(0, "T-CAN01", 24, true, false)) { - Actor_Face_Object(0, "T-CAN01", true); - Actor_Voice_Over(1810, 99); - Actor_Voice_Over(1820, 99); - } - return true; - } - - return false; -} - -bool ScriptRC01::ClickedOnActor(int actorId) { - if (actorId == 23 && Global_Variable_Query(1) == 1) { - if (!Loop_Actor_Walk_To_Actor(0, 23, 36, 1, false)) { - Actor_Face_Actor(0, 23, true); - Actor_Face_Actor(23, 0, true); - if (Actor_Query_Goal_Number(23) == 1) { - Actor_Set_Goal_Number(23, 0); - } - if (Game_Flag_Query(3)) { - Actor_Says(0, 4535, 13); - Game_Flag_Set(392); - if (Actor_Clue_Query(23, 16) && !Actor_Clue_Query(0, 16)) { - Actor_Face_Object(23, "70_1", true); - Actor_Says(23, 100, 15); - Actor_Face_Actor(23, 0, true); - Actor_Clue_Acquire(0, 16, 1, 23); - Game_Flag_Reset(392); - } else if (Actor_Clue_Query(23, 17) && !Actor_Clue_Query(0, 17)) { - Actor_Face_Object(23, "70_5", true); - Actor_Says(23, 120, 19); - Actor_Face_Actor(23, 0, true); - Actor_Says(23, 130, 14); - I_Sez("JM: Did it have a huge, ugly piece of chrome on it?"); - Actor_Clue_Acquire(0, 17, 1, 23); - Game_Flag_Reset(392); - } else { - Actor_Says(23, 90, 16); - I_Sez("JM: This officer has a talent for vivid metaphors."); - if (!Game_Flag_Query(397)) { - I_Sez("DL: What is that supposed to mean? I didn't write this line..."); - Actor_Says(0, 4540, 16); - Game_Flag_Set(397); - } - Game_Flag_Reset(392); - } - } else { - I_Sez("MG: Hey, leave that officer alone.Can't you see he's busy?"); - I_Sez("JM: (...mmm, donuts..."); - Game_Flag_Set(3); - Actor_Clue_Acquire(0, 0, 1, 23); - Actor_Says(0, 4515, 13); - Game_Flag_Set(392); - Actor_Says(23, 40, 13); - if (!Game_Flag_Query(1)) { - Actor_Says(23, 50, 14); - Actor_Says(23, 60, 15); - I_Sez("MG: It's all fun and games until someone loses a tiger cub"); - Actor_Says(0, 4520, 18); - Actor_Says(23, 70, 16); - Actor_Says(0, 4525, 14); - Actor_Says(23, 80, 18); - Actor_Says(0, 4530, 15); - } - Game_Flag_Reset(392); - } - } - return true; - } - return false; -} - -bool ScriptRC01::ClickedOnItem(int itemId, bool a2) { - if (itemId == 66) { - Actor_Set_Goal_Number(23, 0); - if (!Loop_Actor_Walk_To_Item(0, 66, 36, 1, false)) { - Actor_Face_Item(0, 66, true); - Actor_Clue_Acquire(0, 27, 1, -1); - Actor_Face_Actor(23, 0, true); - Actor_Says(23, 20, 12); - Game_Flag_Set(163); - Item_Remove_From_World(66); - Item_Pickup_Spin_Effect(938, 426, 316); - I_Sez("JM: Chrome...is that what that is?"); - Actor_Says(0, 4505, 13); - ADQ_Flush(); - ADQ_Add(23, 30, -1); - ADQ_Add(0, 4510, 13); - I_Sez("JM: It's hard to imagine that thing on either a car or a horse."); - I_Sez("MG: McCoy! What a witty chap..."); - I_Sez("JM: He keeps me chuckling non-stop!\n"); - Loop_Actor_Walk_To_Actor(23, 0, 36, 0, false); - } - return true; - } - return false; - -} - -void ScriptRC01::sub_4037AC() { - Player_Loses_Control(); - Game_Flag_Set(182); - Actor_Set_Immunity_To_Obstacles(0, true); - Loop_Actor_Walk_To_XYZ(0, -151.98f, -0.3f, 318.15f, 0, 0, false, 0); - Actor_Set_Immunity_To_Obstacles(0, false); - Player_Gains_Control(); -} - -bool ScriptRC01::ClickedOnExit(int exitId) { - - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -174.77f, 5.55f, 25.95f, 12, 1, false, 0)) { - if (Game_Flag_Query(705)) { - Actor_Says(0, 8522, 14); - } else { - switch (Global_Variable_Query(1)) { - case 1: - case 4: - Game_Flag_Set(8); - Set_Enter(16, 79); - break; - case 2: - case 3: - case 5: - Actor_Says(0, 8522, 12); - break; - default: - return true; - } - } - } - return true; - } - if (exitId == 1) { - if (Game_Flag_Query(486)) { - Spinner_Set_Selectable_Destination_Flag(6, 1); - } - I_Sez("MG: Leaving already? The fun is just beginning!"); - if (!Loop_Actor_Walk_To_XYZ(0, -151.98f, -0.3f, 318.15f, 0, 1, false, 0)) { - Player_Loses_Control(); - Actor_Set_Immunity_To_Obstacles(0, true); - Loop_Actor_Walk_To_XYZ(0, -10.98f, -0.3f, 318.15f, 0, 0, false, 0); - if (Game_Flag_Query(486) && !Game_Flag_Query(660)) { - Actor_Voice_Over(4310, 99); - Actor_Voice_Over(4320, 99); - Actor_Voice_Over(4330, 99); - Actor_Voice_Over(4340, 99); - Actor_Voice_Over(4350, 99); - Game_Flag_Set(660); - } - Actor_Set_Immunity_To_Obstacles(0, false); - Player_Gains_Control(); - Game_Flag_Reset(176); - Game_Flag_Reset(182); - Game_Flag_Reset(179); - Game_Flag_Reset(178); - int spinnerDest; - if (Game_Flag_Query(186)) { - spinnerDest = Spinner_Interface_Choose_Dest(8, 1); - } else { - spinnerDest = Spinner_Interface_Choose_Dest(3, 1); - } - if (spinnerDest) { - switch (spinnerDest) { - case 1: - Game_Flag_Set(179); - Game_Flag_Reset(249); - Game_Flag_Set(250); - Set_Enter(49, 48); - if (Game_Flag_Query(186)) { - Scene_Loop_Start_Special(1, 9, 1); - } else { - Scene_Loop_Start_Special(1, 4, 1); - } - break; - case 3: - Game_Flag_Set(176); - Game_Flag_Reset(249); - Game_Flag_Set(248); - Set_Enter(4, 13); - if (Game_Flag_Query(186)) { - Scene_Loop_Start_Special(1, 9, 1); - } else { - Scene_Loop_Start_Special(1, 4, 1); - } - break; - case 5: - Game_Flag_Set(261); - Game_Flag_Reset(249); - Game_Flag_Set(307); - Set_Enter(17, 82); - if (Game_Flag_Query(186)) { - Scene_Loop_Start_Special(1, 9, 1); - } else { - Scene_Loop_Start_Special(1, 4, 1); - } - break; - case 4: - Game_Flag_Set(180); - Game_Flag_Reset(249); - Game_Flag_Set(252); - Set_Enter(0, 0); - if (Game_Flag_Query(186)) { - Scene_Loop_Start_Special(1, 9, 1); - } else { - Scene_Loop_Start_Special(1, 4, 1); - } - break; - case 6: - Game_Flag_Set(177); - Game_Flag_Reset(249); - Game_Flag_Set(253); - Set_Enter(7, 25); - if (Game_Flag_Query(186)) { - Scene_Loop_Start_Special(1, 9, 1); - } else { - Scene_Loop_Start_Special(1, 4, 1); - } - break; - case 7: - Game_Flag_Set(258); - Game_Flag_Reset(249); - Game_Flag_Set(254); - Set_Enter(20, 2); - if (Game_Flag_Query(186)) { - Scene_Loop_Start_Special(1, 9, 1); - } else { - Scene_Loop_Start_Special(1, 4, 1); - } - break; - case 8: - Game_Flag_Set(181); - Game_Flag_Reset(249); - Game_Flag_Set(255); - Set_Enter(54, 54); - if (Game_Flag_Query(186)) { - Scene_Loop_Start_Special(1, 9, 1); - } else { - Scene_Loop_Start_Special(1, 4, 1); - } - break; - case 9: - Game_Flag_Set(257); - Game_Flag_Reset(249); - Game_Flag_Set(256); - Set_Enter(37, 34); - if (Game_Flag_Query(186)) { - Scene_Loop_Start_Special(1, 9, 1); - } else { - Scene_Loop_Start_Special(1, 4, 1); - } - break; - default: - sub_4037AC(); - break; - } - } else { - Game_Flag_Set(178); - Game_Flag_Reset(249); - Game_Flag_Set(251); - Set_Enter(61, 65); - if (Game_Flag_Query(186)) { - Scene_Loop_Start_Special(1, 9, 1); - } else { - Scene_Loop_Start_Special(1, 4, 1); - } - } - } - return true; - } - if (exitId == 2) { - if (!Loop_Actor_Walk_To_XYZ(0, -471.98f, -0.3f, 258.15f, 4, 1, false, 0)) { - Game_Flag_Set(115); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Set_Enter(70, 80); - } - return true; - } - return false; -} - -void ScriptRC01::sub_403850() { - if (!Game_Flag_Query(186) && !Loop_Actor_Walk_To_Scene_Object(0, "BARICADE03", 36, true, false)) { - Actor_Set_Goal_Number(23, 0); - Actor_Face_Object(0, "BARICADE03", true); - Loop_Actor_Walk_To_Actor(23, 0, 36, 1, false); - Actor_Face_Actor(23, 0, true); - Actor_Says(0, 4500, 14); - I_Sez("MG: We don't want any of that abstract art oozing out onto the street."); - Actor_Says(23, 10, 14); - Actor_Set_Goal_Number(23, 1); - } -} - -bool ScriptRC01::ClickedOn2DRegion(int region) { - if (region == 0) { - sub_403850(); - return true; - } - return false; -} - -void ScriptRC01::SceneFrameAdvanced(int frame) { - if (frame == 1) { - Sound_Play(118, 40, 0, 0, 50); // CARDOWN3.AUD - } - if (frame == 61 || frame == 362) { - Sound_Play(116, 100, 80, 80, 50); // SPINOPN4.AUD - } - if (frame == 108 || frame == 409) { - Sound_Play(119, 100, 80, 80, 50); // SPINCLS1.AUD - } - if (frame == 183 || frame == 484) { - Sound_Play(116, 100, 80, 80, 50); // SPINOPN4.AUD - } - if (frame == 228 || frame == 523) { - Sound_Play(119, 100, 80, 80, 50); // SPINCLS1.AUD - } - if (frame == 243 || frame == 545) { - Sound_Play(117, 40, 80, 80, 50); // CARUP3.AUD - } - if (frame == 315) { - Sound_Play(118, 40, 80, 80, 50); // CARDOWN3.AUD - } -} - -void ScriptRC01::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptRC01::PlayerWalkedIn() { - if (Game_Flag_Query(249) && !Game_Flag_Query(9) && !Game_Flag_Query(114)) { - sub_4037AC(); - } - - if (Game_Flag_Query(114)) { - Player_Loses_Control(); - Loop_Actor_Walk_To_XYZ(0, -415.98f, -0.30f, 262.15f, 0, 0, false, 0); - Player_Gains_Control(); - Game_Flag_Reset(114); - } - - if (Game_Flag_Query(9)) { - Player_Loses_Control(); - Loop_Actor_Walk_To_XYZ(0, -203.45f, 5.55f, 85.05f, 0, 0, false, 0); - Player_Gains_Control(); - Game_Flag_Reset(9); - - if (Game_Flag_Query(1) && !Game_Flag_Query(4)) { - Actor_Voice_Over(1910, 99); - Actor_Voice_Over(1920, 99); - Actor_Voice_Over(1930, 99); - Game_Flag_Set(4); - } - //return true; - } - //return false; -} - -void ScriptRC01::PlayerWalkedOut() { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - if (!Game_Flag_Query(8) && !Game_Flag_Query(115) && Global_Variable_Query(1)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Outtake_Play(31, 1, -1); - } - // return 1; -} - -void ScriptRC01::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/rc02.cpp b/engines/bladerunner/script/rc02.cpp deleted file mode 100644 index 7a387c2583..0000000000 --- a/engines/bladerunner/script/rc02.cpp +++ /dev/null @@ -1,392 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptRC02::InitializeScene() { - if (Game_Flag_Query(8)) { - Setup_Scene_Information(-103.0f, -1238.89f, 108603.04f, 1007); - } else { - Setup_Scene_Information(-20.2f, -1238.89f, 108100.73f, 539); - } - Scene_Exit_Add_2D_Exit(0, 0, 460, 639, 479, 2); - if (Game_Flag_Query(141)) { - Scene_Exit_Add_2D_Exit(1, 265, 58, 346, 154, 0); - } - Ambient_Sounds_Remove_All_Non_Looping_Sounds(0); - Ambient_Sounds_Add_Looping_Sound(71, 50, 1, 1); - Ambient_Sounds_Add_Looping_Sound(75, 75, 1, 1); - Ambient_Sounds_Add_Looping_Sound(105, 30, 100, 1); - Ambient_Sounds_Add_Sound(73, 5, 20, 10, 10, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(74, 5, 20, 10, 10, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(76, 5, 40, 6, 6, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(77, 5, 40, 6, 6, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(78, 5, 40, 6, 6, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(79, 5, 40, 6, 6, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Speech_Sound(23, 250, 10, 60, 5, 5, 100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(23, 330, 10, 60, 5, 5, 100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(24, 380, 10, 60, 5, 5, 100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(24, 510, 10, 60, 5, 5, 100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(38, 80, 10, 60, 5, 5, 100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(38, 160, 10, 60, 5, 5, 100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Sound(87, 20, 80, 10, 20, 100, 100, -101, -101, 0, 0); -} - -void ScriptRC02::SceneLoaded() { - Obstacle_Object("TABLETOP", true); - Obstacle_Object("DRAPE01", true); - Obstacle_Object("DRAPE03", true); - Obstacle_Object("DRAPE04", true); - Obstacle_Object("DRAPE05", true); - Obstacle_Object("DRAPE06", true); - Obstacle_Object("DRAPE07", true); - Obstacle_Object("OUTR_DESK", true); - Obstacle_Object("CAGE_BASE", true); - Obstacle_Object("POLE_ROP01", true); - Unobstacle_Object("LEGS", true); - Unobstacle_Object("SLATS01", true); - Unobstacle_Object("DRAPE07", true); - Clickable_Object("SCRTY CA03"); - Unclickable_Object("GRL_DSKLEG"); - Unclickable_Object("CURTAIN"); - Unclickable_Object("DRAPE01"); - Unclickable_Object("DRAPE02"); - Unclickable_Object("DRAPE03"); - Unclickable_Object("DRAPE05"); - Unclickable_Object("DRAPE06"); - Unclickable_Object("DRAPE07"); - if (Actor_Clue_Query(0, 12) || Global_Variable_Query(1) > 1) { - Unclickable_Object("SCRTY CA03"); - } - if (!Game_Flag_Query(190)) { - Item_Add_To_World(100, 966, 16, -52.88f, -1238.89f, 108467.74f, 256, 6, 6, false, true, false, true); - Item_Add_To_World(101, 966, 16, -37.16f, -1238.89f, 108456.59f, 512, 6, 6, false, true, false, true); - Item_Add_To_World(102, 966, 16, -62.86f, -1238.89f, 108437.52f, 625, 6, 6, false, true, false, true); - } -} - -bool ScriptRC02::MouseClick(int x, int y) { - return false; -} - -bool ScriptRC02::ClickedOn3DObject(const char *objectName, bool a2) { - if (Object_Query_Click("SCRTY CA03", objectName) && !Actor_Clue_Query(0, 12)) { - if (Actor_Clue_Query(0, 22) && Actor_Query_Is_In_Current_Set(15)) { - AI_Movement_Track_Pause(15); - Actor_Face_Actor(0, 15, true); - Actor_Says(0, 4545, 14); - Actor_Face_Actor(15, 0, true); - Actor_Says(15, 0, 14); - Actor_Says(15, 10, 16); - Actor_Says(0, 4550, 13); - Actor_Says(15, 20, 13); - Loop_Actor_Walk_To_Waypoint(15, 89, 0, 0, false); - Actor_Face_Actor(0, 15, true); - Loop_Actor_Walk_To_Waypoint(15, 102, 0, 0, false); - Actor_Face_Actor(0, 15, true); - Actor_Face_Heading(15, 539, false); - Delay(2000); - Loop_Actor_Walk_To_Waypoint(15, 89, 0, 0, false); - Loop_Actor_Walk_To_Actor(15, 0, 24, 0, false); - Item_Pickup_Spin_Effect(975, 357, 228); - Actor_Face_Actor(0, 15, true); - Actor_Face_Actor(15, 0, true); - Actor_Says(15, 30, 23); - Actor_Says(0, 4555, 18); - Actor_Clue_Acquire(0, 12, 1, 15); - Unclickable_Object("SCRTY CA03"); - AI_Movement_Track_Unpause(15); - return true; - } else { - Actor_Face_Object(0, "SCRTY CA03", true); - Actor_Voice_Over(2000, 99); - return true; - } - } - return false; -} - -void ScriptRC02::sub_402A7C() { - Dialogue_Menu_Clear_List(); - DM_Add_To_List_Never_Repeat_Once_Selected(0, 5, 6, 2); - DM_Add_To_List_Never_Repeat_Once_Selected(10, 5, 4, 8); - if (Actor_Clue_Query(0, 23) || (Actor_Clue_Query(0, 24))) { - DM_Add_To_List_Never_Repeat_Once_Selected(20, 6, 4, 5); - } - Dialogue_Menu_Add_DONE_To_List(30); - Dialogue_Menu_Appear(320, 240); - int answer = Dialogue_Menu_Query_Input(); - Dialogue_Menu_Disappear(); - if (answer) { - switch (answer) { - case 10: - Actor_Says(0, 4585, 13); - Actor_Face_Actor(15, 0, true); - if (Game_Flag_Query(46)) { - Actor_Says(15, 250, 13); - Actor_Says(15, 270, 13); - Actor_Clue_Acquire(0, 23, 1, 15); - } else { - Actor_Says(15, 260, 14); - Actor_Says(15, 270, 13); - Actor_Clue_Acquire(0, 24, 1, 15); - } - Actor_Says(0, 4645, 13); - Actor_Says(15, 280, 13); - Actor_Says(15, 290, 13); - Actor_Says(0, 4650, 18); - Actor_Says(15, 320, 13); - Actor_Says(0, 4665, 13); - Actor_Face_Object(15, "CURTAIN", true); - Actor_Says(15, 350, 13); - Actor_Face_Actor(15, 0, true); - Scene_Exit_Add_2D_Exit(1, 265, 58, 346, 154, 0); - Game_Flag_Set(141); - break; - case 20: - Actor_Says(0, 4590, 19); - Actor_Face_Actor(15, 0, true); - Actor_Says(15, 360, 13); - Loop_Actor_Walk_To_Waypoint(15, 89, 0, 0, false); - Loop_Actor_Walk_To_Waypoint(15, 102, 0, 0, false); - Actor_Face_Actor(0, 15, true); - Actor_Face_Heading(15, 539, false); - Delay(2000); - Loop_Actor_Walk_To_Waypoint(15, 89, 0, 0, false); - Actor_Face_Actor(0, 15, true); - Loop_Actor_Walk_To_Actor(15, 0, 24, 0, false); - Actor_Face_Actor(15, 0, true); - Actor_Face_Actor(0, 15, true); - Item_Pickup_Spin_Effect(964, 357, 228); - Actor_Says(15, 1700, 13); - Actor_Clue_Acquire(0, 15, 1, 15); - break; - case 30: - Actor_Says(0, 4595, 14); - break; - } - } else { - Actor_Says(0, 4580, 13); - Actor_Face_Actor(15, 0, true); - Actor_Says(15, 110, 18); - Actor_Says(15, 120, 17); - Actor_Says(15, 130, 19); - Actor_Says(0, 4605, 13); - Actor_Says(15, 140, 16); - Game_Flag_Set(187); - } -} - -bool ScriptRC02::ClickedOnActor(int actorId) { - if (actorId != 15) { - return false; - } - - if (Global_Variable_Query(1) == 4) { - Actor_Face_Actor(0, 15, true); - if (Actor_Query_Goal_Number(15) == 599) { - if (Random_Query(1, 2) == 1) { - Actor_Says(0, 8715, 17); - } else { - Actor_Says(0, 8720, 17); - } - } else if (Game_Flag_Query(705) || Game_Flag_Query(706)) { - Actor_Says(0, 4805, 11); - Actor_Face_Actor(15, 0, true); - if (Game_Flag_Query(706)) { - Actor_Says(15, 720, 15); - } else { - Actor_Says(15, 730, 14); - } - Actor_Face_Heading(15, 1007, false); - } else { - Actor_Says(0, 4690, 11); - Actor_Says(0, 4695, 13); - Actor_Face_Actor(15, 0, true); - Actor_Says(15, 1610, 14); - if (Actor_Clue_Query(0, 76)) { - Actor_Says(0, 4700, 12); - Actor_Says(0, 4705, 13); - Actor_Says(15, 1620, 12); - Actor_Says(0, 4710, 15); - Actor_Says(0, 4715, 11); - Delay(2000); - Actor_Says(0, 4720, 16); - Actor_Says(0, 4725, 17); - Actor_Says(15, 430, 16); - Actor_Face_Heading(15, 1007, false); - } - Game_Flag_Set(706); - } - return true; - } - AI_Movement_Track_Pause(15); - Loop_Actor_Walk_To_Actor(0, 15, 48, 1, false); - Actor_Face_Actor(0, 15, true); - if (!Game_Flag_Query(6)) { - Actor_Says(0, 4560, 13); - Actor_Face_Actor(15, 0, true); - Actor_Says(15, 40, 16); - Actor_Says(15, 50, 15); - Actor_Says(0, 4565, 13); - Actor_Says(15, 60, 14); - Actor_Says(0, 4570, 18); - Actor_Says(15, 70, 13); - Game_Flag_Set(6); - Actor_Clue_Acquire(0, 22, 1, 15); - AI_Movement_Track_Unpause(15); - return true; - } - if (Game_Flag_Query(187)) { - if (Player_Query_Agenda() == 0) { - Game_Flag_Reset(0); - sub_402A7C(); - AI_Movement_Track_Unpause(15); - return true; - } - - Actor_Says(0, 4610, 19); - Actor_Face_Actor(15, 0, true); - Actor_Says(15, 150, 15); - Actor_Says(0, 4615, 13); - Actor_Says(15, 160, 14); - Actor_Says(15, 170, 15); - Actor_Says(15, 180, 13); - - if (Player_Query_Agenda() == 2) { - Actor_Says(0, 4620, 19); - Actor_Says(15, 190, 14); - Actor_Says(0, 4625, 13); - Actor_Says(15, 210, 13); - Actor_Says(0, 4630, 18); - Actor_Says(15, 220, 14); - Actor_Says(15, 230, 13); - Actor_Says(0, 4635, 19); - Actor_Says(15, 240, 16); - Actor_Says(0, 4640, 17); - } - Game_Flag_Reset(187); - AI_Movement_Track_Unpause(15); - return true; - } - sub_402A7C(); - AI_Movement_Track_Unpause(15); - return true; -} - -bool ScriptRC02::ClickedOnItem(int itemId, bool a2) { - if (itemId == 100 || itemId == 101 || itemId == 102) { - if (!Loop_Actor_Walk_To_Item(0, 100, 24, 1, false)) { - Actor_Face_Item(0, 100, true); - Actor_Clue_Acquire(0, 5, 1, -1); - Game_Flag_Set(190); - Item_Remove_From_World(100); - Item_Remove_From_World(101); - Item_Remove_From_World(102); - Item_Pickup_Spin_Effect(966, 395, 352); - Actor_Voice_Over(1960, 99); - } - return true; - } - return false; -} - -bool ScriptRC02::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -71.51f, -1238.89f, 108587.15f, 0, 1, false, 0)) { - Game_Flag_Set(9); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_Looping_Sound(71, true); - Ambient_Sounds_Remove_Looping_Sound(75, true); - Ambient_Sounds_Adjust_Looping_Sound(85, 100, -101, 1); - Actor_Set_Goal_Number(15, 0); - Set_Enter(69, 78); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -20.2f, -1238.73f, 108152.73f, 0, 1, false, 0)) { - Async_Actor_Walk_To_XYZ(0, -8.87f, -1238.89f, 108076.27f, 0, false); - Set_Enter(16, 107); - } - return true; - } - return false; -} - -bool ScriptRC02::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptRC02::SceneFrameAdvanced(int frame) { -} - -void ScriptRC02::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptRC02::PlayerWalkedIn() { - Player_Set_Combat_Mode(false); - if (Game_Flag_Query(8)) { - Player_Loses_Control(); - Loop_Actor_Walk_To_XYZ(0, -72.2f, -1238.89f, 108496.73f, 0, 0, false, 0); - Player_Gains_Control(); - Game_Flag_Reset(8); - if (!Game_Flag_Query(1)) { - Actor_Voice_Over(1970, 99); - Actor_Voice_Over(1980, 99); - Actor_Voice_Over(1990, 99); - Actor_Clue_Acquire(0, 3, 1, -1); - Actor_Clue_Acquire(0, 4, 1, -1); - Game_Flag_Set(1); - } - if (Actor_Query_Which_Set_In(15) == 16 && Actor_Query_Goal_Number(15) < 300) { - Actor_Set_Goal_Number(15, 1); - } - if (Actor_Query_Goal_Number(15) == 300 && !Game_Flag_Query(704)) { - Actor_Face_Actor(15, 0, true); - Actor_Says(15, 370, 12); - Actor_Says(15, 380, 14); - Actor_Face_Actor(0, 15, true); - Actor_Says(0, 4670, 15); - Actor_Says(15, 390, 13); - Actor_Says(0, 4675, 14); - Actor_Face_Heading(15, 1007, false); - Actor_Says(15, 400, 13); - Actor_Says(15, 410, 12); - Game_Flag_Set(704); - } - } else { - Player_Loses_Control(); - Loop_Actor_Walk_To_XYZ(0, -20.2f, -1238.89f, 108152.73f, 0, 0, false, 0); - Player_Gains_Control(); - } -} - -void ScriptRC02::PlayerWalkedOut() { -} - -void ScriptRC02::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/rc03.cpp b/engines/bladerunner/script/rc03.cpp deleted file mode 100644 index 92074a8af9..0000000000 --- a/engines/bladerunner/script/rc03.cpp +++ /dev/null @@ -1,301 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptRC03::InitializeScene() { - if (Game_Flag_Query(115) ) { - Setup_Scene_Information(298.0f, -4.0f, 405.0f, 800); - Game_Flag_Reset(115); - } else if (Game_Flag_Query(117) ) { - Setup_Scene_Information(-469.0f, -4.0f, 279.0f, 250); - } else if (Game_Flag_Query(119) ) { - Setup_Scene_Information(147.51f, -4.0f, 166.48f, 500); - if (!Game_Flag_Query(151)) { - Game_Flag_Set(151); - } - } else if (Game_Flag_Query(107) ) { - Setup_Scene_Information(-487.0f, 1.0f, 116.0f, 400); - } else if (Game_Flag_Query(121) ) { - Setup_Scene_Information(-22.0f, 1.0f, -63.0f, 400); - } else { - Setup_Scene_Information(0.0f, 0.0f, 0.0f, 0); - } - Scene_Exit_Add_2D_Exit(0, 610, 0, 639, 479, 1); - Scene_Exit_Add_2D_Exit(1, 0, 0, 30, 479, 3); - if (Game_Flag_Query(151) ) { - Scene_Exit_Add_2D_Exit(2, 524, 350, 573, 359, 2); - } - Scene_Exit_Add_2D_Exit(3, 85, 255, 112, 315, 0); - Scene_Exit_Add_2D_Exit(4, 428, 260, 453, 324, 0); - Ambient_Sounds_Add_Looping_Sound(54, 50, 0, 1); - Ambient_Sounds_Add_Sound(82, 5, 30, 40, 70, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(83, 5, 30, 40, 75, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(84, 5, 30, 40, 70, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Speech_Sound(60, 0, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 20, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 40, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Speech_Sound(60, 50, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); - Ambient_Sounds_Add_Sound(68, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(69, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(375, 60, 180, 50, 100, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(376, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(377, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(181, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(183, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(184, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(185, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(186, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(188, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(189, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(190, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(192, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(193, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(194, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - if (Game_Flag_Query(107) && Actor_Query_Goal_Number(7) != 102) { - Scene_Loop_Start_Special(0, 0, 0); - } - Scene_Loop_Set_Default(1); -} - -void ScriptRC03::SceneLoaded() { - Obstacle_Object("Box-Streetlight01", true); - Obstacle_Object("Box-Streetlight02", true); - Obstacle_Object("Parking Meter 01", true); - Obstacle_Object("Parking Meter 02", true); - Obstacle_Object("Parking Meter 03", true); - Obstacle_Object("Trash can with fire", true); - Obstacle_Object("Baricade01", true); - Obstacle_Object("Foreground Junk01", true); - Obstacle_Object("Steam01", true); - Obstacle_Object("Steam02", true); - Obstacle_Object("Box-BBcolumn01", true); - Obstacle_Object("Box-BBcolumn02", true); - Obstacle_Object("Box-BBcolumn03", true); - Obstacle_Object("Box-BBcolumn04", true); - Obstacle_Object("Box-BBbuilding01", true); - Obstacle_Object("Box-BBbuilding02", true); - Obstacle_Object("Box-BBbuilding03", true); - Obstacle_Object("Box-BBbuilding04", true); - Unclickable_Object("BOX-BBBUILDING01"); - Unclickable_Object("BOX-BBBUILDING02"); - Unclickable_Object("BOX-BBBUILDING03"); - Unclickable_Object("BOX-BBBUILDING04"); - Unclickable_Object("BOX-STREETLIGHT01"); - Unclickable_Object("BOX-STREETLIGHT02"); - Unclickable_Object("BOX-BBCOLUMN01"); - Unclickable_Object("BOX-BBCOLUMN02"); - Unclickable_Object("BOX-BBCOLUMN03"); - Unclickable_Object("BOX-BBCOLUMN04"); - Unclickable_Object("PARKING METER 02"); - Unclickable_Object("PARKING METER 03"); - Unclickable_Object("TRASH CAN WITH FIRE"); - Unclickable_Object("BARICADE01"); - Unclickable_Object("FOREGROUND JUNK01"); -} - -bool ScriptRC03::MouseClick(int x, int y) { - return false; -} - -bool ScriptRC03::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptRC03::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptRC03::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptRC03::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, 298.0f, -4.0f, 405.0f, 0, 1, false, 0)) { - if (Game_Flag_Query(289)) { - Game_Flag_Set(702); - } - Game_Flag_Set(114); - Set_Enter(69, 78); - Actor_Set_Goal_Number(3, 100); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -469.0f, -4.0f, 279.0f, 0, 1, false, 0)) { - if (Game_Flag_Query(289)) { - Game_Flag_Set(702); - } - Game_Flag_Set(116); - Game_Flag_Reset(182); - Game_Flag_Set(180); - Set_Enter(0, 1); - } - return true; - } - if (exitId == 2) { - if (!Loop_Actor_Walk_To_XYZ(0, 147.51f, -4.0f, 166.48f, 0, 1, false, 0)) { - Game_Flag_Set(118); - Game_Flag_Reset(182); - Game_Flag_Set(259); - if (Game_Flag_Query(289)) { - Game_Flag_Set(702); - } - Set_Enter(74, 86); - Actor_Set_Goal_Number(3, 100); - } - return true; - } - if (exitId == 3) { - if (!Loop_Actor_Walk_To_XYZ(0, -487.0f, 1.0f, 116.0f, 0, 1, false, 0)) { - Game_Flag_Set(108); - Game_Flag_Reset(182); - Game_Flag_Set(479); - if (Game_Flag_Query(289)) { - Game_Flag_Set(702); - } - Set_Enter(8, 106); - Actor_Set_Goal_Number(3, 100); - } - return true; - } - if (exitId == 4) { - if (!Loop_Actor_Walk_To_XYZ(0, -22.0f, 1.0f, -63.0f, 0, 1, false, 0)) { - if (Global_Variable_Query(1) == 3 || Global_Variable_Query(1) == 5 || Game_Flag_Query(702)) { - Actor_Says(0, 8522, 14); - } else { - Game_Flag_Set(120); - Set_Enter(71, 81); - } - } - return true; - } - return false; -} - -bool ScriptRC03::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptRC03::SceneFrameAdvanced(int frame) { - if (frame == 1) { - Sound_Play(286, Random_Query(33, 33), 100, -100, 50); - } - if (frame == 15) { - Sound_Play(287, Random_Query(50, 50), -100, 100, 50); - } -} - -void ScriptRC03::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptRC03::sub_402834() { - Actor_Face_Actor(1, 0, true); - Actor_Says(1, 1820, 3); - Actor_Face_Actor(0, 1, true); - Actor_Says(0, 4815, 14); - Actor_Says(1, 1830, 3); - Actor_Says(1, 1840, 3); - Actor_Says(0, 4820, 12); - Actor_Says(1, 1850, 3); - Actor_Says(1, 1950, 3); - Actor_Says(0, 4835, 14); - Actor_Says(1, 1960, 3); - Actor_Says(1, 1980, 3); - Actor_Says(0, 4840, 15); - Actor_Says(1, 1990, 3); - Actor_Says(1, 2000, 3); -} - -void ScriptRC03::PlayerWalkedIn() { - if (Actor_Query_Goal_Number(7) == 102) { - Scene_Exits_Disable(); - if (Game_Flag_Query(119) ) { - Player_Set_Combat_Mode(false); - Player_Loses_Control(); - Actor_Set_At_XYZ(0, 147.51f, -4.0f, 166.48f, 500); - Actor_Put_In_Set(7, 70); - Actor_Set_At_XYZ(7, 196.0f, -4.0f, 184.0f, 775); - Actor_Face_Actor(7, 0, true); - Actor_Face_Actor(0, 7, true); - Actor_Change_Animation_Mode(7, 4); - Actor_Says_With_Pause(7, 630, 0, -1); - Actor_Says_With_Pause(7, 640, 0, -1); - Actor_Says_With_Pause(7, 650, 0, -1); - if (Game_Flag_Query(44) ) { - Actor_Set_Goal_Number(1, 100); - } - Actor_Change_Animation_Mode(0, 20); - Loop_Actor_Walk_To_XYZ(7, 180.0f, -4.0f, 184.0f, 0, 0, false, 0); - Actor_Change_Animation_Mode(7, 6); - if (!Game_Flag_Query(44)) { - Actor_Set_Goal_Number(1, 100); - } - Player_Gains_Control(); - } else { - Actor_Put_In_Set(7, 70); - Actor_Set_At_XYZ(7, -226.0f, 1.72f, 86.0f, 0); - Actor_Set_Targetable(7, true); - Actor_Set_Goal_Number(7, 110); - } - } - if (Actor_Query_Goal_Number(7) == 103) { - Player_Loses_Control(); - Actor_Set_Goal_Number(1, 200); - Actor_Put_In_Set(1, 70); - if (Game_Flag_Query(119) || Game_Flag_Query(121) ) { - Actor_Set_At_Waypoint(1, 175, 0); - } else { - Actor_Set_At_Waypoint(1, 203, 0); - } - sub_402834(); - Async_Actor_Walk_To_Waypoint(1, 174, 0, 0); - Actor_Set_Goal_Number(7, 200); - Player_Gains_Control(); - } - Game_Flag_Reset(119); - Game_Flag_Reset(117); - Game_Flag_Reset(107); - Game_Flag_Reset(121); - if (Global_Variable_Query(1) == 1 || Global_Variable_Query(1) == 2) { - Actor_Set_Goal_Number(3, 103); - } -} - -void ScriptRC03::PlayerWalkedOut() { - if (Actor_Query_Goal_Number(7) == 199) { - Actor_Set_Goal_Number(7, 198); - } - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); -} - -void ScriptRC03::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/rc04.cpp b/engines/bladerunner/script/rc04.cpp deleted file mode 100644 index 830b7f5893..0000000000 --- a/engines/bladerunner/script/rc04.cpp +++ /dev/null @@ -1,420 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptRC04::InitializeScene() { - Setup_Scene_Information(45.0f, 0.15f, 68.0f, 1018); - Game_Flag_Reset(120); - Scene_Exit_Add_2D_Exit(0, 225, 47, 359, 248, 0); - if (!Game_Flag_Query(289)) { - Actor_Put_In_Set(14, 71); - Actor_Set_At_XYZ(14, -60.0f, -11.0f, 62.0f, 12); - } - if (Game_Flag_Query(289)) { - Actor_Change_Animation_Mode(14, 88); - } - Ambient_Sounds_Add_Looping_Sound(381, 100, 1, 1); - Ambient_Sounds_Add_Sound(82, 5, 30, 10, 20, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(83, 5, 30, 10, 20, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(84, 5, 30, 10, 20, -100, 100, -101, -101, 0, 0); -} - -void ScriptRC04::SceneLoaded() { - Obstacle_Object("Door New 01", true); - Obstacle_Object("GRNDNEON05", true); - Obstacle_Object("GRNDNEON06", true); - Obstacle_Object("GRNDNEON07", true); - Unobstacle_Object("DisplayTrim", true); - Unobstacle_Object("Display01", true); - Actor_Set_Goal_Number(67, 200); -} - -bool ScriptRC04::MouseClick(int x, int y) { - return false; -} - -bool ScriptRC04::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -void ScriptRC04::sub_401DF4() { - Dialogue_Menu_Clear_List(); - if (Actor_Clue_Query(0, 11) && !Actor_Clue_Query(0, 62)) { - DM_Add_To_List_Never_Repeat_Once_Selected(580, -1, 4, 9); - } - if (Actor_Clue_Query(0, 5) && !Actor_Clue_Query(0, 11) && !Actor_Clue_Query(0, 62)) { - DM_Add_To_List_Never_Repeat_Once_Selected(590, 6, 5, 3); - } - if (Actor_Clue_Query(0, 57)) { - DM_Add_To_List_Never_Repeat_Once_Selected(600, -1, 3, 7); - DM_Add_To_List_Never_Repeat_Once_Selected(1310, -1, 2, 8); - } - if (Actor_Clue_Query(0, 62) && !Actor_Clue_Query(0, 63)) { - DM_Add_To_List_Never_Repeat_Once_Selected(610, 4, 5, 6); - } - if (!Game_Flag_Query(305)) { - DM_Add_To_List_Never_Repeat_Once_Selected(1280, 1, 2, 3); - } - if (Actor_Clue_Query(0, 110) && !Actor_Clue_Query(14, 110)) { - DM_Add_To_List_Never_Repeat_Once_Selected(620, 1, -1, -1); - } - Dialogue_Menu_Add_DONE_To_List(630); - Dialogue_Menu_Appear(320, 240); - int answer = Dialogue_Menu_Query_Input(); - Dialogue_Menu_Disappear(); - - switch (answer) { - case 580: - Actor_Says(0, 4955, 30); - Actor_Says(14, 210, 37); - Actor_Says(14, 220, 37); - Actor_Says(14, 230, 37); - Actor_Says(14, 240, 37); - Actor_Says(0, 4990, 16); - Actor_Says(0, 4995, 11); - Actor_Says(14, 270, 31); - Actor_Says(0, 5005, 16); - Actor_Says(14, 280, 32); - Actor_Says(14, 290, 30); - Actor_Says(14, 300, 33); - Actor_Says(14, 310, 31); - Actor_Says(0, 5010, 11); - Actor_Says(14, 320, 30); - Actor_Says(14, 330, 33); - Actor_Says(14, 340, 37); - Actor_Says(0, 5015, 11); - if (Game_Flag_Query(44)) { - Actor_Says(14, 350, 32); - Actor_Says(14, 360, 33); - Actor_Says(14, 370, 30); - Actor_Says(0, 5020, 16); - Actor_Says(14, 380, 37); - Actor_Says(14, 390, 11); - Actor_Says(14, 400, 37); - Actor_Clue_Acquire(0, 58, 1, 0); - } else { - Actor_Says(14, 410, 11); - Actor_Says(14, 420, 37); - Actor_Says(0, 5025, 16); - Actor_Says(14, 430, 30); - Actor_Says(14, 440, 31); - Actor_Says(14, 450, 32); - Actor_Says(0, 5030, 16); - Actor_Says(14, 460, 37); - Actor_Clue_Acquire(0, 59, 1, 0); - } - return; - case 590: - Actor_Says(0, 4960, 13); - Actor_Says(14, 250, 30); - Actor_Says(14, 260, 33); - Actor_Says(0, 4995, 15); - Actor_Says(14, 270, 32); - Actor_Says(0, 5005, 11); - Actor_Says(14, 280, 33); - Actor_Says(14, 290, 30); - Actor_Says(14, 300, 32); - Actor_Says(14, 310, 37); - Actor_Says(0, 5010, 13); - Actor_Says(14, 320, 37); - Actor_Says(14, 330, 33); - Actor_Says(14, 340, 11); - Actor_Says(0, 5015, 16); - Actor_Modify_Friendliness_To_Other(14, 0, 3); - if (Game_Flag_Query(44)) { - Actor_Says(14, 350, 32); - Actor_Says(14, 360, 30); - Actor_Says(14, 370, 33); - Actor_Says(0, 5020, 15); - Actor_Says(14, 380, 33); - Actor_Says(14, 390, 37); - Actor_Says(14, 400, 32); - Actor_Clue_Acquire(0, 58, 1, 0); - } else { - Actor_Says(14, 410, 32); - Actor_Says(14, 420, 30); - Actor_Says(0, 5025, 13); - Actor_Says(14, 430, 33); - Actor_Says(14, 440, 32); - Actor_Says(14, 450, 37); - Actor_Says(0, 5030, 16); - Actor_Says(14, 460, 30); - Actor_Clue_Acquire(0, 59, 1, 0); - } - break; - case 600: - Actor_Says(0, 4965, 11); - Actor_Says(14, 470, 11); - Actor_Says(0, 5035, 15); - Actor_Says(14, 480, 30); - Actor_Says(14, 490, 31); - Actor_Says(14, 500, 32); - Actor_Says(14, 510, 33); - Actor_Says(14, 520, 34); - Actor_Says(14, 530, 35); - Actor_Says(14, 540, 36); - Actor_Says(0, 5040, 16); - Actor_Says(14, 550, 11); - Actor_Modify_Friendliness_To_Other(14, 0, -6); - break; - case 610: - Actor_Says(0, 4970, 16); - if (Actor_Query_Friendliness_To_Other(14, 0) < 50) { - Actor_Says(14, 700, 11); - Actor_Says(0, 5070, 11); - Actor_Says(14, 710, 11); - Actor_Says(0, 5075, 15); - Actor_Says(14, 720, 30); - Actor_Says(0, 5080, 11); - Actor_Says(14, 730, 37); - Actor_Clue_Acquire(0, 58, 1, 0); - } else { - Actor_Says(14, 560, 37); - Actor_Says(0, 5070, 13); - Actor_Says(14, 570, 36); - Actor_Says(14, 580, 37); - Actor_Says(14, 590, 31); - Actor_Says(14, 600, 32); - Actor_Says(14, 610, 30); - Actor_Says(0, 5050, 16); - Actor_Says(14, 620, 35); - Actor_Says(14, 630, 35); - Actor_Says(0, 5055, 11); - Actor_Says(14, 640, 36); - Actor_Says(14, 650, 35); - Actor_Says(14, 660, 30); - Actor_Says(0, 5060, 13); - Actor_Clue_Acquire(0, 63, 1, 0); - } - break; - case 1280: - Actor_Says(0, 9040, 16); - if (!Game_Flag_Query(305)) { - Actor_Says(14, 2080, 30); - Actor_Says(14, 2090, 37); - Actor_Says(0, 9045, 14); - Actor_Says(14, 2100, 32); - Actor_Says(14, 2110, 37); - Game_Flag_Set(305); - } - Actor_Says(14, 2120, 31); - if (Global_Variable_Query(2) > 40 || Query_Difficulty_Level() == 0) { - Actor_Says(0, 4940, 13); - if (Query_Difficulty_Level() != 0) { - Global_Variable_Decrement(2, 40); - } - Item_Pickup_Spin_Effect(995, 405, 192); - Give_McCoy_Ammo(1, 24); - } else { - Actor_Says(0, 125, 13); - Actor_Modify_Friendliness_To_Other(14, 0, -2); - } - break; - case 1310: - Actor_Says(0, 4980, 11); - if (Actor_Query_Friendliness_To_Other(14, 0) > 49) { - Actor_Says(14, 740, 37); - Actor_Says(0, 5085, 16); - Actor_Says(14, 750, 37); - Actor_Says(14, 760, 37); - Voight_Kampff_Activate(14, 50); - Actor_Modify_Friendliness_To_Other(14, 0, 3); - Actor_Says(14, 810, 37); - Actor_Says(0, 5025, 13); - Actor_Says(14, 820, 32); - Actor_Says(0, 5100, 11); - Actor_Says(14, 830, 31); - Actor_Says(14, 840, 35); - } else { - Actor_Says(14, 770, 36); - Actor_Says(14, 780, 36); - Actor_Says(0, 5090, 16); - Actor_Says(14, 790, 36); - Actor_Says(14, 800, 35); - Voight_Kampff_Activate(14, 50); - Actor_Says(14, 810, 30); - Actor_Says(0, 5025, 13); - Actor_Says(14, 820, 31); - Actor_Says(0, 5100, 15); - Actor_Says(14, 830, 34); - Actor_Says(14, 840, 34); - } - break; - case 620: - Actor_Says(0, 4985, 11); - Actor_Says(14, 850, 35); - Actor_Says(0, 5105, 13); - Actor_Says(0, 5110, 11); - Actor_Says(14, 860, 30); - Actor_Says(0, 5115, 16); - Actor_Says(14, 870, 31); - Actor_Says(0, 5120, 15); - Actor_Says(14, 880, 34); - Actor_Clue_Acquire(14, 110, 1, 0); - Actor_Modify_Friendliness_To_Other(14, 0, 8); - if (Query_Difficulty_Level() != 0) { - Global_Variable_Increment(2, 60); - } - break; - case 630: - Actor_Says(0, 1315, 12); - break; - } -} - -bool ScriptRC04::ClickedOnActor(int actorId) { - if (Player_Query_Combat_Mode()) { - return false; - } - if (actorId == 14 && Global_Variable_Query(1) == 2 && !Game_Flag_Query(289)) { - Loop_Actor_Walk_To_Waypoint(0, 104, 0, 0, false); - Actor_Face_Actor(0, 14, true); - if (Game_Flag_Query(287) && !Game_Flag_Query(292) && Actor_Query_Friendliness_To_Other(14, 0) > 45) { - Actor_Says(14, 30, 30); - Actor_Says(0, 4875, 13); - Actor_Says(14, 80, 31); - Actor_Says(0, 4900, 15); - Actor_Says(14, 90, 33); - Actor_Says(14, 100, 34); - Actor_Says(0, 4905, 15); - Game_Flag_Set(292); - } else if (Game_Flag_Query(287) && !Game_Flag_Query(290) && Actor_Query_Friendliness_To_Other(14, 0) < 45) { - Actor_Says(14, 40, 30); - Actor_Says(0, 4880, 13); - Actor_Says(14, 50, 35); - Actor_Says(0, 4875, 16); - Actor_Says(14, 60, 36); - Actor_Says(0, 4890, 13); - Actor_Says(14, 70, 33); - Actor_Says(0, 4895, 16); - Actor_Modify_Friendliness_To_Other(14, 0, -5); - Game_Flag_Set(290); - } else if (Actor_Query_Friendliness_To_Other(14, 0) > 51 && !Game_Flag_Query(717)) { - Actor_Says(14, 1870, 30); - Actor_Says(14, 1880, 30); - Actor_Says(0, 8960, 13); - Actor_Says(14, 1890, 36); - Actor_Says(14, 1900, 35); - Actor_Says(0, 8965, 16); - Actor_Says(14, 1920, 36); - Actor_Says(14, 1930, 33); - Actor_Says(14, 1940, 36); - Actor_Says(14, 1950, 30); - Actor_Says(0, 8970, 13); - Actor_Says(14, 1960, 33); - Actor_Says(14, 1970, 30); - Actor_Says(14, 1980, 36); - Delay(1000); - Actor_Says(14, 2010, 35); - if (Global_Variable_Query(2) > 50 || Query_Difficulty_Level() == 0) { - Actor_Says(0, 8975, 16); - if (Query_Difficulty_Level() != 0) { - Global_Variable_Decrement(2, 50); - } - Delay(3000); - Item_Pickup_Spin_Effect(941, 405, 192); - Actor_Says(14, 2030, 30); - Game_Flag_Set(487); - } else { - Actor_Says(0, 8980, 16); - Actor_Says(14, 2040, 30); - Actor_Says(0, 8985, 15); - Actor_Says(14, 2050, 33); - } - Game_Flag_Set(717); - } else if (Actor_Clue_Query(0, 11) || Actor_Clue_Query(0, 5) || Actor_Clue_Query(0, 62) || Actor_Clue_Query(0, 110) || Actor_Clue_Query(0, 57) || !Game_Flag_Query(305)) { - sub_401DF4(); - } else { - Actor_Says(14, 1820, 30); - } - return true; - } - if (actorId == 14 && Game_Flag_Query(289)) { - Actor_Face_Actor(0, 14, true); - if (Actor_Clue_Query(0, 164)) { - Actor_Says(0, 8590, -1); - } else { - Actor_Voice_Over(2100, 99); - Actor_Voice_Over(2110, 99); - } - return true; - } - return false; -} - -bool ScriptRC04::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptRC04::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, 45.0f, 0.15f, 68.0f, 0, 1, false, 0)) { - Game_Flag_Set(121); - Set_Enter(70, 80); - } - return true; - } - return false; -} - -bool ScriptRC04::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptRC04::SceneFrameAdvanced(int frame) { -} - -void ScriptRC04::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptRC04::PlayerWalkedIn() { - Loop_Actor_Walk_To_Waypoint(0, 103, 0, 0, false); - if (Global_Variable_Query(1) != 2 || Game_Flag_Query(287) || Player_Query_Combat_Mode()) { - if (Global_Variable_Query(1) == 4 && !Game_Flag_Query(289) && !Game_Flag_Query(306)) { - Actor_Says(38, 40, 3); - Actor_Says(14, 890, 37); - Actor_Set_Goal_Number(14, 2); - } - Game_Flag_Set(287); - } else { - Actor_Says(14, 0, 31); - Loop_Actor_Walk_To_Waypoint(0, 104, 0, 0, false); - Actor_Face_Actor(0, 14, true); - Actor_Says(0, 4865, 13); - Actor_Says(14, 10, 32); - Actor_Says(0, 4870, 16); - Actor_Says(14, 20, 31); - Game_Flag_Set(287); - } -} - -void ScriptRC04::PlayerWalkedOut() { - Game_Flag_Reset(303); -} - -void ScriptRC04::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/rc51.cpp b/engines/bladerunner/script/rc51.cpp deleted file mode 100644 index 907ffd8ba3..0000000000 --- a/engines/bladerunner/script/rc51.cpp +++ /dev/null @@ -1,130 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptRC51::InitializeScene() { - Setup_Scene_Information(-8.87f, -1238.89f, 108164.27f, 66); - Scene_Exit_Add_2D_Exit(0, 0, 460, 639, 479, 2); - Scene_Loop_Start_Special(0, 0, 0); - Scene_Loop_Set_Default(1); -} - -void ScriptRC51::SceneLoaded() { - Obstacle_Object("POSTER_2", true); - Obstacle_Object("CURTAIN", true); - Clickable_Object("POSTER_2"); - Unclickable_Object("GRL_DSK"); - Unclickable_Object("GRL_DSKLEG"); - Unclickable_Object("CURTAIN"); - if (!Game_Flag_Query(147)) { - Item_Add_To_World(82, 937, 16, 47.56f, -1238.89f, 108048.61f, 0, 6, 18, false, true, false, true); - } - if (!Game_Flag_Query(148)) { - Item_Add_To_World(79, 933, 16, 67.28f, -1193.38f, 108011.27f, 0, 6, 6, false, true, false, true); - } - if (!Game_Flag_Query(149)) { - Item_Add_To_World(98, 971, 16, -69.65f, -1238.89f, 107995.24f, 256, 18, 18, false, true, false, true); - } -} - -bool ScriptRC51::MouseClick(int x, int y) { - return false; -} - -bool ScriptRC51::ClickedOn3DObject(const char *objectName, bool a2) { - if (Object_Query_Click("POSTER_2", objectName)) { - Actor_Face_Object(0, "POSTER_2", true); - Actor_Says(0, 8620, 3); - return true; - } - return false; -} - -bool ScriptRC51::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptRC51::ClickedOnItem(int itemId, bool a2) { - if (itemId == 82 && !Loop_Actor_Walk_To_XYZ(0, 17.97f, -1238.89f, 108053.5f, 0, 1, false, 0)) { - Actor_Face_Item(0, 82, true); - Actor_Clue_Acquire(0, 8, 1, -1); - Item_Remove_From_World(82); - Item_Pickup_Spin_Effect(937, 437, 407); - Actor_Voice_Over(2010, 99); - Game_Flag_Set(147); - return true; - } - if (itemId == 79 && !Loop_Actor_Walk_To_Item(0, 79, 36, 1, false)) { - Actor_Face_Item(0, 79, true); - Actor_Clue_Acquire(0, 6, 1, -1); - Item_Remove_From_World(79); - Item_Pickup_Spin_Effect(933, 445, 230); - Actor_Says(0, 8735, 3); - Actor_Says(0, 8529, 3); - Game_Flag_Set(148); - return true; - } - if (itemId == 98 && !Loop_Actor_Walk_To_Item(0, 98, 36, 1, false)) { - Actor_Face_Item(0, 98, true); - Actor_Clue_Acquire(0, 7, 1, -1); - Item_Remove_From_World(98); - Item_Pickup_Spin_Effect(971, 55, 376); - Actor_Says(0, 8525, 3); - Actor_Says(0, 8740, 3); - Game_Flag_Set(149); - return true; - } - return false; -} - -bool ScriptRC51::ClickedOnExit(int exitId) { - if (exitId == 0 && !Loop_Actor_Walk_To_XYZ(0, -8.87f, -1238.89f, 108173.27f, 0, 1, false, 0)) { - Set_Enter(16, 79); - return true; - } - return false; -} - -bool ScriptRC51::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptRC51::SceneFrameAdvanced(int frame) { -} - -void ScriptRC51::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptRC51::PlayerWalkedIn() { - Game_Flag_Set(709); -} - -void ScriptRC51::PlayerWalkedOut() { -} - -void ScriptRC51::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene.cpp b/engines/bladerunner/script/scene.cpp new file mode 100644 index 0000000000..1ca6408549 --- /dev/null +++ b/engines/bladerunner/script/scene.cpp @@ -0,0 +1,152 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +bool SceneScript::Open(const Common::String &name) { + delete _currentScript; + + if (name == "RC01") { _currentScript = new SceneScriptRC01(_vm); return true; } + if (name == "RC02") { _currentScript = new SceneScriptRC02(_vm); return true; } + if (name == "RC03") { _currentScript = new SceneScriptRC03(_vm); return true; } + if (name == "RC04") { _currentScript = new SceneScriptRC04(_vm); return true; } + if (name == "RC51") { _currentScript = new SceneScriptRC51(_vm); return true; } + + return false; +} + +SceneScript::~SceneScript() { + delete _currentScript; +} + +void SceneScript::InitializeScene() { + _inScriptCounter++; + _currentScript->InitializeScene(); + _inScriptCounter--; +} + +void SceneScript::SceneLoaded() { + _inScriptCounter++; + _currentScript->SceneLoaded(); + _inScriptCounter--; +} + +bool SceneScript::MouseClick(int x, int y) { + if (_inScriptCounter > 0) + return true; + + _inScriptCounter++; + //MouseX = x; + //MouseY = y; + bool result = _currentScript->MouseClick(x, y); + //SelectedEntity = -1; + _inScriptCounter--; + //MouseX = -1; + //MouseY = -1; + return result; +} + +bool SceneScript::ClickedOn3DObject(const char *objectName, bool a2) { + if (_inScriptCounter > 0) + return true; + + _inScriptCounter++; + bool result = _currentScript->ClickedOn3DObject(objectName, a2); + _inScriptCounter--; + return result; +} + +bool SceneScript::ClickedOnActor(int actorId) { + if (_inScriptCounter > 0) + return true; + + _inScriptCounter++; + bool result = _currentScript->ClickedOnActor(actorId); + _inScriptCounter--; + return result; +} + +bool SceneScript::ClickedOnItem(int itemId, bool a2) { + if (_inScriptCounter > 0) + return true; + + _inScriptCounter++; + bool result = _currentScript->ClickedOnItem(itemId, a2); + _inScriptCounter--; + return result; +} + +bool SceneScript::ClickedOnExit(int exitId) { + if (_inScriptCounter > 0) + return true; + + _inScriptCounter++; + bool result = _currentScript->ClickedOnExit(exitId); + _inScriptCounter--; + return result; +} + +bool SceneScript::ClickedOn2DRegion(int region) { + if (_inScriptCounter > 0) + return true; + + _inScriptCounter++; + bool result = _currentScript->ClickedOn2DRegion(region); + _inScriptCounter--; + return result; +} + +void SceneScript::SceneFrameAdvanced(int frame) { + _inScriptCounter++; + _currentScript->SceneFrameAdvanced(frame); + _inScriptCounter--; +} + +void SceneScript::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { + _inScriptCounter++; + //TODO remove this check + if(_currentScript) + _currentScript->ActorChangedGoal(actorId, newGoal, oldGoal, currentSet); + _inScriptCounter--; +} + +void SceneScript::PlayerWalkedIn() { + _inScriptCounter++; + _currentScript->PlayerWalkedIn(); + _inScriptCounter--; +} + +void SceneScript::PlayerWalkedOut() { + _inScriptCounter++; + _currentScript->PlayerWalkedOut(); + _inScriptCounter--; +} + +void SceneScript::DialogueQueueFlushed(int a1) { + _inScriptCounter++; + _currentScript->DialogueQueueFlushed(a1); + _inScriptCounter--; +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene.h b/engines/bladerunner/script/scene.h new file mode 100644 index 0000000000..0d4f574caa --- /dev/null +++ b/engines/bladerunner/script/scene.h @@ -0,0 +1,559 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef BLADERUNNER_SCRIPT_SCENE_H +#define BLADERUNNER_SCRIPT_SCENE_H + +#include "bladerunner/script/script.h" + +namespace BladeRunner { + +class BladeRunnerEngine; + +class SceneScriptBase : public ScriptBase { +public: + SceneScriptBase(BladeRunnerEngine *vm) : ScriptBase(vm) {} + + virtual void InitializeScene() = 0; + virtual void SceneLoaded() = 0; + virtual bool MouseClick(int x, int y) = 0; + virtual bool ClickedOn3DObject(const char *objectName, bool a2) = 0; + virtual bool ClickedOnActor(int actorId) = 0; + virtual bool ClickedOnItem(int itemId, bool a2) = 0; + virtual bool ClickedOnExit(int exitId) = 0; + virtual bool ClickedOn2DRegion(int region) = 0; + virtual void SceneFrameAdvanced(int frame) = 0; + virtual void ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) = 0; + virtual void PlayerWalkedIn() = 0; + virtual void PlayerWalkedOut() = 0; + virtual void DialogueQueueFlushed(int a1) = 0; +}; + +#define DECLARE_SCRIPT(name) \ +class SceneScript##name : public SceneScriptBase { \ +public: \ + SceneScript##name(BladeRunnerEngine *vm) \ + : SceneScriptBase(vm) \ + {} \ + void InitializeScene(); \ + void SceneLoaded(); \ + bool MouseClick(int x, int y); \ + bool ClickedOn3DObject(const char *objectName, bool a2); \ + bool ClickedOnActor(int actorId); \ + bool ClickedOnItem(int itemId, bool a2); \ + bool ClickedOnExit(int exitId); \ + bool ClickedOn2DRegion(int region); \ + void SceneFrameAdvanced(int frame); \ + void ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet); \ + void PlayerWalkedIn(); \ + void PlayerWalkedOut(); \ + void DialogueQueueFlushed(int a1); \ +private: +#define END_SCRIPT }; + +DECLARE_SCRIPT(AR01) +END_SCRIPT + +DECLARE_SCRIPT(AR02) + void sub_402694(); + void sub_402AE0(); + void sub_402CE4(); +END_SCRIPT + +DECLARE_SCRIPT(BB01) +END_SCRIPT + +DECLARE_SCRIPT(BB02) +END_SCRIPT + +DECLARE_SCRIPT(BB03) +END_SCRIPT + +DECLARE_SCRIPT(BB04) +END_SCRIPT + +DECLARE_SCRIPT(BB05) +END_SCRIPT + +DECLARE_SCRIPT(BB06) +END_SCRIPT + +DECLARE_SCRIPT(BB07) +END_SCRIPT + +DECLARE_SCRIPT(BB08) +END_SCRIPT + +DECLARE_SCRIPT(BB09) +END_SCRIPT + +DECLARE_SCRIPT(BB10) +END_SCRIPT + +DECLARE_SCRIPT(BB11) +END_SCRIPT + +DECLARE_SCRIPT(BB12) +END_SCRIPT + +DECLARE_SCRIPT(BB51) +END_SCRIPT + +DECLARE_SCRIPT(CT01) + void sub_40269C(); +END_SCRIPT + +DECLARE_SCRIPT(CT02) + void sub_401ACC(); +END_SCRIPT + +DECLARE_SCRIPT(CT03) +END_SCRIPT + +DECLARE_SCRIPT(CT04) + void sub_401D4C(); +END_SCRIPT + +DECLARE_SCRIPT(CT05) +END_SCRIPT + +DECLARE_SCRIPT(CT06) +END_SCRIPT + +DECLARE_SCRIPT(CT07) +END_SCRIPT + +DECLARE_SCRIPT(CT08) +END_SCRIPT + +DECLARE_SCRIPT(CT09) +END_SCRIPT + +DECLARE_SCRIPT(CT10) + void sub_401844(); +END_SCRIPT + +DECLARE_SCRIPT(CT11) +END_SCRIPT + +DECLARE_SCRIPT(CT12) +END_SCRIPT + +DECLARE_SCRIPT(CT51) +END_SCRIPT + +DECLARE_SCRIPT(DR01) +END_SCRIPT + +DECLARE_SCRIPT(DR02) +END_SCRIPT + +DECLARE_SCRIPT(DR03) + void sub_401B18(); +END_SCRIPT + +DECLARE_SCRIPT(DR04) + bool sub_401160(); +END_SCRIPT + +DECLARE_SCRIPT(DR05) +END_SCRIPT + +DECLARE_SCRIPT(DR06) +END_SCRIPT + +DECLARE_SCRIPT(HC01) + void sub_402384(); + void sub_40346C(); +END_SCRIPT + +DECLARE_SCRIPT(HC02) +END_SCRIPT + +DECLARE_SCRIPT(HC03) +END_SCRIPT + +DECLARE_SCRIPT(HC04) + void sub_401B90(); +END_SCRIPT + +DECLARE_SCRIPT(HF01) + void sub_4026B4(); + void sub_4032DC(); + void sub_403484(); +END_SCRIPT + +DECLARE_SCRIPT(HF02) +END_SCRIPT + +DECLARE_SCRIPT(HF03) + void sub_401C80(); +END_SCRIPT + +DECLARE_SCRIPT(HF04) +END_SCRIPT + +DECLARE_SCRIPT(HF05) + void sub_402370(); + void sub_402970(); + void sub_402AE4(); + void sub_403738(); + void sub_403A34(int actorId); + void sub_403F0C(); + void sub_40410C(); + void sub_4042E4(); + void sub_404474(); + int sub_404858(); + int sub_4048C0(); +END_SCRIPT + +DECLARE_SCRIPT(HF06) + void sub_401EF4(); + void sub_4023E0(); +END_SCRIPT + +DECLARE_SCRIPT(HF07) + int sub_401864(); +END_SCRIPT + +DECLARE_SCRIPT(KP01) +END_SCRIPT + +DECLARE_SCRIPT(KP02) +END_SCRIPT + +DECLARE_SCRIPT(KP03) + void sub_401E54(); +END_SCRIPT + +DECLARE_SCRIPT(KP04) +END_SCRIPT + +DECLARE_SCRIPT(KP05) +END_SCRIPT + +DECLARE_SCRIPT(KP06) +END_SCRIPT + +DECLARE_SCRIPT(KP07) +END_SCRIPT + +DECLARE_SCRIPT(MA01) +END_SCRIPT + +DECLARE_SCRIPT(MA02) + void sub_401E4C(); + bool sub_401F7C(); + void sub_402044(); +END_SCRIPT + +//MA03 does not exists + +DECLARE_SCRIPT(MA04) + bool sub_402758(); + bool sub_402820(); + bool sub_402888(); + void sub_4028A8(); + void sub_402F2C(); + void sub_4032A0(); + void sub_4034D8(); + void sub_403864(); + void sub_403DA8(); +END_SCRIPT + +DECLARE_SCRIPT(MA05) + bool sub_401990(); +END_SCRIPT + +DECLARE_SCRIPT(MA06) + bool sub_4012C0(); + void sub_4014E4(); +END_SCRIPT + +DECLARE_SCRIPT(MA07) +END_SCRIPT + +DECLARE_SCRIPT(MA08) +END_SCRIPT + +DECLARE_SCRIPT(NR01) +END_SCRIPT + +DECLARE_SCRIPT(NR02) + void sub_402134(); +END_SCRIPT + +DECLARE_SCRIPT(NR03) + void sub_40259C(int frame); + void sub_402994(); +END_SCRIPT + +DECLARE_SCRIPT(NR04) + void sub_401DB0(); + void sub_402860(int frame); + void sub_402960(); +END_SCRIPT + +DECLARE_SCRIPT(NR05) + void sub_401F74(int frame); + void sub_4020B4(); + void sub_4022DC(); + void sub_402A48(int actorId); + void sub_402B9C(); +END_SCRIPT + +DECLARE_SCRIPT(NR06) + void sub_401BAC(); +END_SCRIPT + +DECLARE_SCRIPT(NR07) + void sub_4018D4(); + void sub_401A10(); + void sub_401C60(); + void sub_401EF4(); + void sub_4020F0(); + void sub_402284(); + void sub_402510(); + void sub_402614(); + void sub_402738(); + void sub_4028FC(); +END_SCRIPT + +DECLARE_SCRIPT(NR08) + void sub_4021B4(); +END_SCRIPT + +DECLARE_SCRIPT(NR09) + void sub_40172C(); +END_SCRIPT + +DECLARE_SCRIPT(NR10) +END_SCRIPT + +DECLARE_SCRIPT(NR11) + void sub_4027D0(int actorId, signed int frame); + void sub_4028EC(); +END_SCRIPT + +DECLARE_SCRIPT(PS01) +END_SCRIPT + +DECLARE_SCRIPT(PS02) + void sub_4018BC(); +END_SCRIPT + +DECLARE_SCRIPT(PS03) +END_SCRIPT + +DECLARE_SCRIPT(PS04) + void sub_4017E4(); +END_SCRIPT + +DECLARE_SCRIPT(PS05) + void sub_401B34(); + void sub_401C30(); +END_SCRIPT + +DECLARE_SCRIPT(PS06) +END_SCRIPT + +DECLARE_SCRIPT(PS07) + void sub_401D60(); +END_SCRIPT + +// PS08 does not exits + +DECLARE_SCRIPT(PS09) + void sub_402090(); +END_SCRIPT + +DECLARE_SCRIPT(PS10) + void sub_402238(); +END_SCRIPT + +DECLARE_SCRIPT(PS11) + void sub_402744(); +END_SCRIPT + +DECLARE_SCRIPT(PS12) + void sub_4028C4(); +END_SCRIPT + +DECLARE_SCRIPT(PS13) + void sub_40267C(); +END_SCRIPT + +DECLARE_SCRIPT(PS14) +END_SCRIPT + +DECLARE_SCRIPT(PS15) +END_SCRIPT + +DECLARE_SCRIPT(RC01) + void sub_403850(); + void sub_4037AC(); +END_SCRIPT + +DECLARE_SCRIPT(RC02) + void sub_402A7C(); +END_SCRIPT + +DECLARE_SCRIPT(RC03) + void sub_402834(); +END_SCRIPT + +DECLARE_SCRIPT(RC04) + void sub_401DF4(); +END_SCRIPT + +DECLARE_SCRIPT(RC51) +END_SCRIPT + +DECLARE_SCRIPT(TB02) + void sub_402644(); + void sub_402B50(); +END_SCRIPT + +DECLARE_SCRIPT(TB03) +END_SCRIPT + +DECLARE_SCRIPT(TB05) +END_SCRIPT + +DECLARE_SCRIPT(TB06) +END_SCRIPT + +DECLARE_SCRIPT(TB07) + void sub_401B0C(); +END_SCRIPT + +DECLARE_SCRIPT(UG01) +END_SCRIPT + +DECLARE_SCRIPT(UG02) + bool sub_402354(); +END_SCRIPT + +DECLARE_SCRIPT(UG03) +END_SCRIPT + +DECLARE_SCRIPT(UG04) +END_SCRIPT + +DECLARE_SCRIPT(UG05) + int sub_4021B0(); + void sub_402218(); +END_SCRIPT + +DECLARE_SCRIPT(UG06) +END_SCRIPT + +DECLARE_SCRIPT(UG07) +END_SCRIPT + +DECLARE_SCRIPT(UG08) +END_SCRIPT + +DECLARE_SCRIPT(UG09) +END_SCRIPT + +DECLARE_SCRIPT(UG10) +END_SCRIPT + +// UG11 does not exists + +DECLARE_SCRIPT(UG12) +END_SCRIPT + +DECLARE_SCRIPT(UG13) + void sub_40223C(); + void sub_4023D8(); + void sub_4025E0(); + void sub_402960(); + int sub_402AD0(); + void sub_402AD4(); + void sub_402E24(); +END_SCRIPT + +DECLARE_SCRIPT(UG14) +END_SCRIPT + +DECLARE_SCRIPT(UG15) +END_SCRIPT + +DECLARE_SCRIPT(UG16) + void sub_401D78(); +END_SCRIPT + +DECLARE_SCRIPT(UG17) +END_SCRIPT + +DECLARE_SCRIPT(UG18) + void sub_402734(); + void sub_402DE8(); + void sub_402F8C(); + void sub_403114(); + void sub_403278(); + void sub_403588(); +END_SCRIPT + +DECLARE_SCRIPT(UG19) +END_SCRIPT + +#undef DECLARE_SCRIPT +#undef END_SCRIPT + +class SceneScript { +protected: + BladeRunnerEngine *_vm; + int _inScriptCounter; + SceneScriptBase *_currentScript; + +public: + SceneScript(BladeRunnerEngine *vm) + : _vm(vm), + _inScriptCounter(0), + _currentScript(nullptr) { + } + ~SceneScript(); + + bool Open(const Common::String &name); + + void InitializeScene(); + void SceneLoaded(); + bool MouseClick(int x, int y); + bool ClickedOn3DObject(const char *objectName, bool a2); + bool ClickedOnActor(int actorId); + bool ClickedOnItem(int itemId, bool a2); + bool ClickedOnExit(int exitId); + bool ClickedOn2DRegion(int region); + void SceneFrameAdvanced(int frame); + void ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet); + void PlayerWalkedIn(); + void PlayerWalkedOut(); + void DialogueQueueFlushed(int a1); + bool IsInsideScript() { return _inScriptCounter > 0; } +}; + +} // End of namespace BladeRunner + +#endif diff --git a/engines/bladerunner/script/scene/ar01.cpp b/engines/bladerunner/script/scene/ar01.cpp new file mode 100644 index 0000000000..757ec35c55 --- /dev/null +++ b/engines/bladerunner/script/scene/ar01.cpp @@ -0,0 +1,361 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptAR01::InitializeScene() { + Music_Play(0, 25, 0, 2, -1, 1, 2); + if (Game_Flag_Query(323)) { + Setup_Scene_Information(-477.0f, 0.0f, -149.0f, 333); + } else if (Game_Flag_Query(321) == 1) { + Setup_Scene_Information(-182.0f, 0.0f, -551.0f, 518); + } else { + Setup_Scene_Information(-152.0f, 0.0f, 332.0f, 545); + } + Scene_Exit_Add_2D_Exit(0, 134, 165, 177, 290, 3); + Scene_Exit_Add_2D_Exit(1, 319, 0, 639, 207, 0); + if (Game_Flag_Query(252)) { + Scene_Exit_Add_2D_Exit(2, 0, 404, 99, 479, 2); + } + Ambient_Sounds_Add_Looping_Sound(54, 50, 1, 1); + Ambient_Sounds_Add_Looping_Sound(81, 60, 100, 1); + Ambient_Sounds_Add_Looping_Sound(241, 50, 1, 1); + Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(184, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(185, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(186, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(188, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(189, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(192, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(242, 3, 30, 11, 11, 50, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(243, 3, 30, 11, 11, 50, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(244, 3, 30, 11, 11, 50, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(245, 3, 30, 11, 11, 50, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(246, 3, 30, 11, 11, 50, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(247, 3, 30, 11, 11, 50, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(248, 3, 30, 11, 11, 50, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(249, 3, 30, 11, 11, 50, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Speech_Sound(60, 0, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 20, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 40, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 50, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Sound(68, 10, 180, 16, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(69, 10, 180, 16, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(375, 10, 180, 50, 100, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(376, 10, 180, 50, 100, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(377, 10, 180, 50, 100, 0, 0, -101, -101, 0, 0); + if (Game_Flag_Query(252) && !Game_Flag_Query(321) && !Game_Flag_Query(323)) { + Actor_Set_Invisible(0, true); + Game_Flag_Set(273); + Scene_Loop_Start_Special(0, 1, 0); + Scene_Loop_Set_Default(2); + } else if (Game_Flag_Query(252) && Game_Flag_Query(321)) { + Scene_Loop_Start_Special(0, 0, 0); + Scene_Loop_Set_Default(2); + Game_Flag_Reset(321); + } else if (!Game_Flag_Query(252) && Game_Flag_Query(321)) { + Scene_Loop_Start_Special(0, 6, 0); + Scene_Loop_Set_Default(7); + Game_Flag_Reset(321); + } else if (Game_Flag_Query(252) && Game_Flag_Query(323)) { + Scene_Loop_Set_Default(2); + } else if (!Game_Flag_Query(252) && Game_Flag_Query(323)) { + Scene_Loop_Set_Default(7); + } else { + Scene_Loop_Set_Default(7); + } +} + +void SceneScriptAR01::SceneLoaded() { + Obstacle_Object("DF_BOOTH", true); + Unobstacle_Object("SPINNER BODY", true); +} + +bool SceneScriptAR01::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptAR01::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptAR01::ClickedOnActor(int actorId) { + if (actorId == 16 || actorId == 20) { + Actor_Face_Actor(0, actorId, true); + Actor_Says(0, 8910, 14); + return true; + } + if (actorId == 29) { + Actor_Set_Goal_Number(29, 2); + if (!Loop_Actor_Walk_To_XYZ(0, -120.73f, 0.0f, 219.17f, 12, 1, false, 0)) { + Actor_Face_Actor(0, 29, true); + Actor_Face_Actor(29, 0, true); + if (Game_Flag_Query(328)) { + if (Actor_Clue_Query(0, 93) && !Actor_Clue_Query(0, 64)) { + Actor_Says(0, 40, 11); + Actor_Says(29, 120, 14); + Actor_Says(0, 45, 17); + Actor_Says(29, 130, 14); + Actor_Says(29, 140, 14); + Actor_Says(0, 50, 13); + Actor_Says(29, 150, 14); + Actor_Clue_Acquire(0, 64, 1, 0); + } else { + if (Random_Query(1, 2) == 1) { + Actor_Says(0, 30, 17); + Actor_Says(29, 100, 14); + Actor_Says(29, 110, 14); + Actor_Says(0, 35, 13); + } else { + Actor_Says(0, 30, 17); + Actor_Says(29, 220, 14); + } + } + Actor_Set_Goal_Number(29, 1); + } else { + Actor_Says(0, 0, 18); + Actor_Says(29, 0, 14); + Actor_Says(29, 10, 14); + Actor_Says(29, 20, 14); + Actor_Says(29, 30, 14); + Actor_Says(0, 5, 17); + Actor_Says(29, 40, 14); + Actor_Says(0, 10, 13); + Actor_Says(29, 50, 14); + Actor_Says(0, 15, 17); + Actor_Says(29, 60, 14); + Actor_Says(29, 70, 14); + Actor_Says(29, 80, 14); + Actor_Says(29, 90, 14); + Actor_Says(0, 25, 13); + Game_Flag_Set(328); + Actor_Set_Goal_Number(29, 1); + } + return true; + } + } + return false; +} + +bool SceneScriptAR01::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptAR01::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -358.0, 0.0, -149.0, 0, 1, false, 0)) { + Loop_Actor_Walk_To_XYZ(0, -477.0, 0.0, -149.0, 0, 0, false, 0); + Game_Flag_Set(322); + Game_Flag_Set(464); + Game_Flag_Reset(180); + Game_Flag_Set(479); + Set_Enter(8, 31); + Actor_Set_Goal_Number(29, 3); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -182.0, 0.0, -551.0, 0, 1, false, 0)) { + Game_Flag_Set(320); + Async_Actor_Walk_To_XYZ(0, -222.0, 0.0, -690.0, 0, false); + Set_Enter(0, 1); + Actor_Set_Goal_Number(29, 3); + } + return true; + } + if (exitId == 2) { + if (Game_Flag_Query(486) == 1) { + Spinner_Set_Selectable_Destination_Flag(6, 1); + } + int v1 = Loop_Actor_Walk_To_XYZ(0, -164.0f, 0.0f, 332.0f, 0, 1, false, 0); + Actor_Face_Heading(0, 545, false); + if (Actor_Query_Goal_Number(7) >= 2 && Actor_Query_Goal_Number(7) <= 103) { + Player_Loses_Control(); + Actor_Put_In_Set(7, 0); + Actor_Set_At_XYZ(7, -448.0, 0.0, 130.0, 0); + Loop_Actor_Walk_To_XYZ(7, -323.0f, 0.64f, 101.74f, 48, 0, true, 0); + Loop_Actor_Walk_To_Actor(7, 0, 48, 0, true); + Actor_Face_Actor(7, 0, true); + Actor_Change_Animation_Mode(7, 6); + Actor_Says(0, 1800, 21); + Actor_Change_Animation_Mode(0, 48); + Player_Gains_Control(); + Actor_Retired_Here(0, 12, 48, 1, 7); + } else if (!v1) { + if (Game_Flag_Query(486) && !Game_Flag_Query(660)) { + Actor_Voice_Over(4310, 99); + Actor_Voice_Over(4320, 99); + Actor_Voice_Over(4330, 99); + Actor_Voice_Over(4340, 99); + Actor_Voice_Over(4350, 99); + Game_Flag_Set(660); + } + Game_Flag_Reset(176); + Game_Flag_Reset(182); + Game_Flag_Reset(179); + Game_Flag_Reset(178); + Game_Flag_Reset(258); + Game_Flag_Reset(257); + Game_Flag_Reset(180); + + int spinnerDest = Spinner_Interface_Choose_Dest(4, 0); + Actor_Face_Heading(0, 545, 0); + + switch (spinnerDest) { + case 0: + Game_Flag_Set(178); + Game_Flag_Reset(252); + Game_Flag_Set(251); + Set_Enter(61, 65); + Scene_Loop_Start_Special(1, 5, 1); + break; + case 1: + Game_Flag_Set(179); + Game_Flag_Reset(252); + Game_Flag_Set(250); + Set_Enter(49, 48); + Scene_Loop_Start_Special(1, 5, 1); + break; + case 2: + Game_Flag_Set(182); + Game_Flag_Reset(252); + Game_Flag_Set(249); + Set_Enter(69, 78); + Scene_Loop_Start_Special(1, 5, 1); + break; + case 3: + Game_Flag_Set(176); + Game_Flag_Reset(252); + Game_Flag_Set(248); + Set_Enter(4, 13); + Scene_Loop_Start_Special(1, 5, 1); + break; + case 5: + Game_Flag_Set(261); + Game_Flag_Reset(252); + Game_Flag_Set(307); + Set_Enter(17, 82); + Scene_Loop_Start_Special(1, 5, 1); + break; + case 6: + Game_Flag_Set(177); + Game_Flag_Reset(252); + Game_Flag_Set(253); + Set_Enter(7, 25); + Scene_Loop_Start_Special(1, 5, 1); + break; + case 7: + Game_Flag_Set(258); + Game_Flag_Reset(252); + Game_Flag_Set(254); + Set_Enter(20, 2); + Scene_Loop_Start_Special(1, 5, 1); + break; + case 8: + Game_Flag_Set(181); + Game_Flag_Reset(252); + Game_Flag_Set(255); + Set_Enter(54, 54); + Scene_Loop_Start_Special(1, 5, 1); + break; + case 9: + Game_Flag_Set(257); + Game_Flag_Reset(252); + Game_Flag_Set(256); + Set_Enter(37, 34); + Scene_Loop_Start_Special(1, 5, 1); + break; + default: + Game_Flag_Set(180); + Actor_Set_Invisible(0, 0); + break; + } + } + return true; + } + return false; +} + +bool SceneScriptAR01::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptAR01::SceneFrameAdvanced(int frame) { + if (frame == 16) { + Ambient_Sounds_Play_Sound(118, 40, 0, 0, 99); + } + if (frame == 78 || frame == 199) { + Ambient_Sounds_Play_Sound(116, 100, -50, -50, 99); + } + if (frame == 122 || frame == 242) { + Ambient_Sounds_Play_Sound(119, 100, -50, -50, 99); + } + if (frame == 256) { + Ambient_Sounds_Play_Sound(117, 40, -50, 80, 99); + } + if ((frame == 75 || frame == 196) && Game_Flag_Query(273)) { + Actor_Face_Heading(0, 545, false); + Actor_Change_Animation_Mode(0, 42); + Game_Flag_Reset(273); + } else if (frame == 196 && !Game_Flag_Query(273)) { + Actor_Change_Animation_Mode(0, 41); + } +} + +void SceneScriptAR01::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptAR01::PlayerWalkedIn() { + if (!Game_Flag_Query(710)) { + Game_Flag_Set(710); + } + if (Game_Flag_Query(323) == 1) { + Loop_Actor_Walk_To_XYZ(0, -358.0f, 0.0f, -149.0f, 0, 1, false, 0); + Game_Flag_Reset(323); + } + if (Actor_Query_Goal_Number(37) < 199) { + Actor_Set_Goal_Number(37, 199); + } +} + +void SceneScriptAR01::PlayerWalkedOut() { + Actor_Set_Invisible(0, 0); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + if (!Game_Flag_Query(479)) { + Music_Stop(2); + } + if (!Game_Flag_Query(322) && !Game_Flag_Query(320)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Outtake_Play(38, 1, -1); + } +} + +void SceneScriptAR01::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ar02.cpp b/engines/bladerunner/script/scene/ar02.cpp new file mode 100644 index 0000000000..0e754b3c24 --- /dev/null +++ b/engines/bladerunner/script/scene/ar02.cpp @@ -0,0 +1,388 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptAR02::InitializeScene() { + Music_Play(0, 22, 0, 2, -1, 1, 2); + if (Game_Flag_Query(116)) { + Setup_Scene_Information(-560.0f, 0.0f, -799.0f, 333); + } else { + Setup_Scene_Information(-182.0f, 0.0f, -551.0f, 973); + } + Scene_Exit_Add_2D_Exit(0, 0, 439, 212, 479, 2); + Scene_Exit_Add_2D_Exit(1, 81, 202, 215, 406, 3); + Ambient_Sounds_Add_Looping_Sound(54, 50, 1, 1); + Ambient_Sounds_Add_Looping_Sound(81, 60, 100, 1); + Ambient_Sounds_Add_Looping_Sound(241, 50, 1, 1); + Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(184, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(185, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(186, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(188, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(189, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(192, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(242, 3, 30, 16, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(243, 3, 30, 16, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(244, 3, 30, 16, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(245, 3, 30, 16, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(246, 3, 30, 16, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(247, 3, 30, 16, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(248, 3, 30, 16, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(249, 3, 30, 16, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Speech_Sound(60, 0, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 20, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 40, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 50, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Sound(68, 10, 180, 16, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(69, 10, 180, 16, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(375, 10, 180, 50, 100, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(376, 10, 180, 50, 100, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(377, 10, 180, 50, 100, 0, 0, -101, -101, 0, 0); + if (Game_Flag_Query(252) && Game_Flag_Query(320)) { + Scene_Loop_Start_Special(0, 1, 0); + Scene_Loop_Set_Default(2); + Game_Flag_Reset(320); + } else if (!Game_Flag_Query(252) && Game_Flag_Query(320)) { + Scene_Loop_Start_Special(0, 0, 0); + Scene_Loop_Set_Default(2); + Game_Flag_Reset(320); + } else { + Scene_Loop_Set_Default(2); + } +} + +void SceneScriptAR02::SceneLoaded() { + Obstacle_Object("DF_BOOTH", true); + if (!Game_Flag_Query(374)) { + Item_Add_To_World(106, 976, 0, -442.84f, 36.77f, -1144.51f, 360, 36, 36, false, true, false, true); + } + if (Global_Variable_Query(1) == 4 && !Game_Flag_Query(374)) { + Game_Flag_Set(0); + Item_Remove_From_World(106); + } +} + +bool SceneScriptAR02::MouseClick(int x, int y) { + return Region_Check(250, 215, 325, 260); +} + +bool SceneScriptAR02::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptAR02::ClickedOnActor(int actorId) { + if (actorId == 16) { + if (!Loop_Actor_Walk_To_XYZ(0, -386.96f, 0.0f, -1078.45f, 12, 1, false, 0)) { + Actor_Face_Actor(0, 16, true); + Actor_Face_Actor(16, 0, true); + if (Global_Variable_Query(1) == 2) { + if (Game_Flag_Query(329) && !Game_Flag_Query(366)) { + Game_Flag_Set(366); + Player_Loses_Control(); + ADQ_Flush(); + ADQ_Add(16, 210, 14); + Loop_Actor_Walk_To_XYZ(0, -350.66f, 0.0f, -1117.19f, 0, 0, false, 0); + Actor_Face_Actor(0, 16,true); + Actor_Says(0, 110, 18); + Actor_Says(16, 230, 14); + Actor_Says(0, 115, 18); + Actor_Says(16, 240, 14); + Item_Pickup_Spin_Effect(956, 288, 257); + Actor_Says(16, 250, 14); + Player_Gains_Control(); + sub_402AE0(); + } else if (Game_Flag_Query(329)) { + Actor_Says(0, 75, 18); + Actor_Says(16, 60, 12); + Actor_Says(16, 70, 14); + } else { + sub_402694(); + } + } else if (Global_Variable_Query(1) > 2) { + if (Actor_Clue_Query(0, 56) && !Actor_Clue_Query(0, 90)) { + Actor_Says(0, 205, 16); + Actor_Says(16, 290, 12); + Actor_Says(16, 300, 13); + Actor_Says(0, 210, 15); + Actor_Says(16, 310, 12); + Actor_Says(0, 215, 13); + if (Game_Flag_Query(374)) { + Actor_Says(0, 220, 14); + Actor_Says(16, 320, 12); + Actor_Says(0, 225, 13); + Actor_Says(16, 330, 14); + Actor_Says(0, 230, 19); + Actor_Says(16, 340, 13); + Actor_Says(16, 350, 12); + Actor_Says(0, 235, 16); + Actor_Clue_Acquire(0, 79, 0, 16); + } + Actor_Clue_Acquire(0, 90, 0, 16); + } else { + Actor_Says(0, 240, 17); + Actor_Says(16, 360, 13); + Actor_Says(16, 370, 14); + Actor_Says(0, 245, 13); + } + } + return true; + } + } + if (actorId == 20 && Global_Variable_Query(1) == 2) { + if (!Loop_Actor_Walk_To_XYZ(0, -240.79f, 0.0f, -1328.89f, 12, 1, false, 0)) { + Actor_Face_Actor(0, 20, true); + Actor_Face_Actor(20, 0, true); + if (Game_Flag_Query(330)) { + sub_402CE4(); + return false; + } + Actor_Says(20, 0, 14); + Actor_Says(0, 140, 18); + Game_Flag_Set(330); + return true; + } + } + return false; +} + +bool SceneScriptAR02::ClickedOnItem(int itemId, bool a2) { + if (itemId == 106) { + if (!Loop_Actor_Walk_To_XYZ(0, -386.96f, 0.0f, -1078.45f, 12, 1, false, 0)) { + Actor_Face_Actor(0, 16, true); + if (!Game_Flag_Query(331)) { + Actor_Says(16, 0, 14); + Actor_Says(0, 55, 18); + Actor_Says(16, 10, 14); + Actor_Says(0, 60, 18); + Actor_Says(16, 20, 14); + Game_Flag_Set(331); + } else if (Game_Flag_Query(331) && !Game_Flag_Query(367)) { + Actor_Says(0, 65, 21); + Actor_Says(16, 30, 14); + Actor_Says(16, 40, 14); + Actor_Says(0, 70, 18); + Actor_Says(16, 50, 14); + Game_Flag_Set(367); + } else { + Actor_Says(0, 8527, 14); + } + return true; + } + } + return false; +} + +bool SceneScriptAR02::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -182.0f, 0.0f, -551.0f, 0, 1, false, 0)) { + Game_Flag_Set(321); + Async_Actor_Walk_To_XYZ(0, -182.0f, 0.0f, -407.0f, 0, false); + Set_Enter(0, 0); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -465.0f, 0.0f, -799.0f, 0, 1, false, 0)) { + Loop_Actor_Walk_To_XYZ(0, -560.0f, 0.0f, -799.0f, 0, 0, false, 0); + Game_Flag_Set(117); + Game_Flag_Reset(180); + Game_Flag_Set(182); + Music_Stop(3); + Set_Enter(70, 80); + } + return true; + } + return false; +} + +bool SceneScriptAR02::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptAR02::SceneFrameAdvanced(int frame) { +} + +void SceneScriptAR02::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptAR02::PlayerWalkedIn() { + if (Game_Flag_Query(116) == 1) { + Loop_Actor_Walk_To_XYZ(0, -465.0f, 0.0f, -799.0f, 0, 0, false, 0); + Game_Flag_Reset(116); + } + Game_Flag_Set(726); +} + +void SceneScriptAR02::PlayerWalkedOut() { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); +} + +void SceneScriptAR02::DialogueQueueFlushed(int a1) { +} + +void SceneScriptAR02::sub_402694() { + Dialogue_Menu_Clear_List(); + if (Actor_Clue_Query(0, 44) || Actor_Clue_Query(0, 47)) { + DM_Add_To_List_Never_Repeat_Once_Selected(490, 3, 5, 5); + } + if (Actor_Clue_Query(0, 14) && !Actor_Clue_Query(0, 44) && !Actor_Clue_Query(0, 47)) { + DM_Add_To_List_Never_Repeat_Once_Selected(500, 3, 5, 5); + } + DM_Add_To_List_Never_Repeat_Once_Selected(510, 8, 3, -1); + Dialogue_Menu_Add_DONE_To_List(520); + Dialogue_Menu_Appear(320, 240); + int answerValue = Dialogue_Menu_Query_Input(); + Dialogue_Menu_Disappear(); + switch (answerValue) { + case 490: + case 500: + if (answerValue == 490) { + Actor_Says(0, 145, 15); + } else { + Actor_Says(0, 150, 15); + } + Actor_Says(16, 80, 14); + Actor_Says(0, 80, 16); + Actor_Says(16, 90, 12); + Actor_Says(0, 85, 17); + Actor_Says(16, 100, 14); + Actor_Says(16, 110, 12); + Actor_Says(16, 120, 12); + Actor_Says(0, 90, 13); + Actor_Says(16, 130, 12); + Actor_Says(16, 140, 14); + Actor_Says(0, 95, 15); + Actor_Says(16, 150, 12); + Actor_Says(16, 160, 13); + Actor_Says(16, 170, 14); + Actor_Says(0, 100, 16); + Actor_Says(16, 180, 13); + Game_Flag_Set(329); + Actor_Clue_Acquire(0, 56, 1, 16); + break; + case 510: + Actor_Says(0, 8475, 12); + Actor_Says(16, 190, 12); + Actor_Says(0, 105, 15); + Actor_Says(16, 200, 14); + break; + case 520: + Actor_Says(0, 215, 16); + break; + } +} + +void SceneScriptAR02::sub_402AE0() { + Dialogue_Menu_Clear_List(); + if (Global_Variable_Query(2) >= 15 || Query_Difficulty_Level() == 0) { + DM_Add_To_List_Never_Repeat_Once_Selected(530, 7, 5, 3); + } + DM_Add_To_List_Never_Repeat_Once_Selected(540, 3, 5, 7); + Dialogue_Menu_Appear(320, 240); + int answerValue = Dialogue_Menu_Query_Input(); + Dialogue_Menu_Disappear(); + if (answerValue == 530) { + Actor_Says(0, 120, 12); + if (Query_Difficulty_Level() != 0) { + Global_Variable_Decrement(2, 15); + } + Actor_Clue_Acquire(0, 75, 1, 16); + Actor_Modify_Friendliness_To_Other(16, 0, 5); + } else if (answerValue == 540) { + Actor_Says(0, 125, 13); + Actor_Says(16, 260, 3); + Actor_Says(0, 130, 15); + Actor_Says(16, 270, 3); + Actor_Says(16, 280, 3); + Actor_Says(0, 135, 11); + Actor_Modify_Friendliness_To_Other(16, 0, -5); + } +} + +void SceneScriptAR02::sub_402CE4() { + Dialogue_Menu_Clear_List(); + if (Actor_Clue_Query(0, 93)) { + DM_Add_To_List_Never_Repeat_Once_Selected(550, 8, 5, 2); + } + if (Actor_Clue_Query(0, 44)) { + DM_Add_To_List_Never_Repeat_Once_Selected(560, 6, 5, 7); + } + Dialogue_Menu_Add_DONE_To_List(570); + Dialogue_Menu_Appear(320, 240); + int answerValue = Dialogue_Menu_Query_Input(); + Dialogue_Menu_Disappear(); + switch (answerValue) { + case 550: + Actor_Says(0, 145, 11); + Actor_Says(20, 30, 11); + Actor_Says(0, 160, 11); + Actor_Says(20, 40, 11); + Actor_Says(0, 165, 11); + Actor_Says(20, 50, 11); + Actor_Says(0, 170, 11); + Actor_Says(20, 60, 11); + Actor_Says(0, 175, 11); + Game_Flag_Set(370); + break; + case 560: + Actor_Says(0, 150, 11); + Actor_Says(20, 140, 11); + Actor_Says(0, 185, 11); + Actor_Says(20, 150, 11); + Actor_Says(20, 160, 11); + Actor_Says(0, 190, 11); + Actor_Says(20, 170, 11); + Actor_Says(0, 195, 11); + Actor_Says(20, 180, 11); + Actor_Says(20, 190, 11); + Actor_Says(20, 200, 11); + Actor_Says(0, 200, 11); + Actor_Says(20, 210, 11); + Actor_Says(20, 220, 11); + Actor_Says(20, 230, 11); + Game_Flag_Set(370); + break; + case 570: + if (Actor_Clue_Query(0, 57)) { + Actor_Says(0, 1315, 11); + } else { + Actor_Says(0, 940, 13); + Actor_Says(20, 70, 12); + Actor_Says(20, 90, 12); + Actor_Says(0, 180, 15); + Actor_Says(20, 100, 14); + Actor_Says(20, 110, 12); + Actor_Says(20, 120, 13); + Actor_Modify_Friendliness_To_Other(20, 0, -1); + Actor_Clue_Acquire(0, 57, 0, 20); + } + break; + } +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/bb01.cpp b/engines/bladerunner/script/scene/bb01.cpp new file mode 100644 index 0000000000..25abb5bcda --- /dev/null +++ b/engines/bladerunner/script/scene/bb01.cpp @@ -0,0 +1,231 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptBB01::InitializeScene() { + if (Game_Flag_Query(265)) { + Setup_Scene_Information(-253.0f, 9.0f, 715.0f, 266); + } else if (Game_Flag_Query(263)) { + Setup_Scene_Information(-128.0f, 9.0f, 342.0f, 266); + } else { + Setup_Scene_Information(43.0f, 0.0f, 1058.0f, 0); + } + Scene_Exit_Add_2D_Exit(0, 0, 0, 72, 299, 3); + Scene_Exit_Add_2D_Exit(1, 151, 218, 322, 290, 3); + if (Game_Flag_Query(254)) { + Scene_Exit_Add_2D_Exit(2, 0, 311, 312, 479, 2); + } + Ambient_Sounds_Add_Looping_Sound(54, 50, 0, 1); + Ambient_Sounds_Add_Looping_Sound(105, 25, -100, 0); + Ambient_Sounds_Add_Sound(82, 5, 60, 40, 60, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(83, 5, 60, 40, 65, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(84, 5, 60, 40, 60, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(67, 5, 80, 20, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(66, 5, 80, 20, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(378, 5, 120, 25, 33, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(379, 5, 120, 25, 33, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(380, 5, 120, 25, 33, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Speech_Sound(60, 0, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 20, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 40, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 50, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + if (Game_Flag_Query(254) && !Game_Flag_Query(265) && !Game_Flag_Query(263)) { + Scene_Loop_Start_Special(0, 0, 0); + Scene_Loop_Set_Default(1); + } else if (Game_Flag_Query(254) && Game_Flag_Query(265)) { + Scene_Loop_Set_Default(1); + } else if (Game_Flag_Query(254) && Game_Flag_Query(263)) { + Scene_Loop_Set_Default(1); + } else { + Scene_Loop_Set_Default(5); + } +} + +void SceneScriptBB01::SceneLoaded() { + Obstacle_Object("COLUME", true); +} + +bool SceneScriptBB01::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptBB01::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptBB01::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptBB01::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptBB01::ClickedOnExit(int exitId) { + if (exitId == 0) { + Loop_Actor_Walk_To_XYZ(0, -140.0f, 9.0f, 818.0f, 0, 1, false, 0); + if (!Loop_Actor_Walk_To_XYZ(0, -233.0f, 9.0f, 846.0f, 0, 1, false, 0)) { + Game_Flag_Set(264); + Game_Flag_Reset(258); + Game_Flag_Set(177); + Set_Enter(7, 26); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -125.39f, 9.0f, 372.45f, 0, 1, false, 0)) { + Game_Flag_Set(262); + Set_Enter(1, 3); + } + return true; + } + if (exitId == 2) { + if (!Loop_Actor_Walk_To_XYZ(0, 43.0f, 0.0f, 1062.0f, 0, 1, false, 0)) { + Game_Flag_Reset(176); + Game_Flag_Reset(182); + Game_Flag_Reset(179); + Game_Flag_Reset(178); + Game_Flag_Reset(258); + int spinnerDest = Spinner_Interface_Choose_Dest(3, 0); + switch (spinnerDest) { + case 0: + Game_Flag_Set(178); + Game_Flag_Reset(254); + Game_Flag_Set(251); + Set_Enter(61, 65); + Scene_Loop_Start_Special(1, 4, 1); + break; + case 1: + Game_Flag_Set(179); + Game_Flag_Reset(254); + Game_Flag_Set(250); + Set_Enter(49, 48); + Scene_Loop_Start_Special(1, 4, 1); + break; + case 2: + Game_Flag_Set(182); + Game_Flag_Reset(254); + Game_Flag_Set(249); + Set_Enter(69, 78); + Scene_Loop_Start_Special(1, 4, 1); + break; + case 3: + Game_Flag_Set(176); + Game_Flag_Reset(254); + Game_Flag_Set(248); + Set_Enter(4, 13); + Scene_Loop_Start_Special(1, 4, 1); + break; + case 5: + Game_Flag_Set(261); + Game_Flag_Reset(254); + Game_Flag_Set(307); + Set_Enter(17, 82); + Scene_Loop_Start_Special(1, 4, 1); + break; + case 4: + Game_Flag_Set(180); + Game_Flag_Reset(254); + Game_Flag_Set(252); + Set_Enter(0, 0); + Scene_Loop_Start_Special(1, 4, 1); + break; + case 6: + Game_Flag_Set(177); + Game_Flag_Reset(254); + Game_Flag_Set(253); + Set_Enter(7, 25); + Scene_Loop_Start_Special(1, 4, 1); + break; + case 8: + Game_Flag_Set(181); + Game_Flag_Reset(254); + Game_Flag_Set(255); + Set_Enter(54, 54); + Scene_Loop_Start_Special(1, 4, 1); + break; + case 9: + Game_Flag_Set(257); + Game_Flag_Reset(254); + Game_Flag_Set(256); + Set_Enter(37, 34); + Scene_Loop_Start_Special(1, 4, 1); + break; + default: + Game_Flag_Set(258); + Scene_Loop_Start_Special(2, 3, 1); + break; + } + } + return true; + } + return false; +} + +bool SceneScriptBB01::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptBB01::SceneFrameAdvanced(int frame) { + if (frame == 193) { + Sound_Play(118, 40, 0, 0, 50); + } + if (frame == 241 || frame == 363) { + Sound_Play(116, 100, -50, -50, 50); + } + if (frame == 286 || frame == 407) { + Sound_Play(119, 100, -50, -50, 50); + } + if (frame == 433) { + Sound_Play(117, 40, -50, 80, 50); + } + if (frame == 120) { + Sound_Play(286, Random_Query(33, 33), 100, -100, 50); + } +} + +void SceneScriptBB01::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptBB01::PlayerWalkedIn() { + Spinner_Set_Selectable_Destination_Flag(7, 1); + if (Game_Flag_Query(265)) { + Game_Flag_Reset(265); + } else if (Game_Flag_Query(263)) { + Game_Flag_Reset(263); + } else { + Loop_Actor_Walk_To_XYZ(0, 43.0f, 0.0f, 954.0f, 0, 0, false, 0); + } +} + +void SceneScriptBB01::PlayerWalkedOut() { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); +} + +void SceneScriptBB01::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/bb02.cpp b/engines/bladerunner/script/scene/bb02.cpp new file mode 100644 index 0000000000..7b43ff4bb1 --- /dev/null +++ b/engines/bladerunner/script/scene/bb02.cpp @@ -0,0 +1,159 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptBB02::InitializeScene() { + if (Game_Flag_Query(281)) { + Setup_Scene_Information(179.0f, -415.06f, 274.0f, 904); + } else if (Game_Flag_Query(333)) { + Setup_Scene_Information(-12.0f, -415.06f, -27.0f, 264); + Scene_Loop_Start_Special(0, 0, 0); + } else { + Setup_Scene_Information(98.0f, -415.06f, -593.0f, 530); + Game_Flag_Reset(262); + } + Scene_Exit_Add_2D_Exit(0, 313, 137, 353, 173, 0); + Scene_Exit_Add_2D_Exit(1, 207, 291, 275, 443, 3); + Scene_Exit_Add_2D_Exit(2, 303, 422, 639, 479, 2); + Ambient_Sounds_Add_Looping_Sound(54, 20, 0, 1); + Ambient_Sounds_Add_Looping_Sound(103, 40, 0, 1); + Ambient_Sounds_Add_Sound(443, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(444, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(445, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(446, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(82, 5, 60, 20, 40, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(83, 5, 60, 20, 45, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(84, 5, 60, 20, 40, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(90, 5, 50, 17, 17, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(91, 5, 50, 17, 17, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(375, 5, 180, 25, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(376, 5, 180, 25, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(377, 5, 180, 25, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(72, 5, 80, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(73, 5, 80, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(74, 5, 80, 14, 16, -100, 100, -101, -101, 0, 0); + if (!Game_Flag_Query(494)) { + Game_Flag_Set(493); + Game_Flag_Set(494); + } + if (Game_Flag_Query(493)) { + Scene_Loop_Set_Default(1); + } else { + Scene_Loop_Set_Default(4); + } +} + +void SceneScriptBB02::SceneLoaded() { + Obstacle_Object("ELEVATOR01", true); + Obstacle_Object("U2 DOOR", true); +} + +bool SceneScriptBB02::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptBB02::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptBB02::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptBB02::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptBB02::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, 98.0f, -415.06f, -593.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(263); + Set_Enter(20, 2); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -12.0f, -415.06f, -27.0f, 0, 1, false, 0)) { + Player_Loses_Control(); + if (!Game_Flag_Query(493)) { + Scene_Loop_Start_Special(2, 0, 1); + } + Game_Flag_Set(332); + Game_Flag_Reset(493); + Set_Enter(1, 5); + Scene_Loop_Start_Special(1, 3, 0); + } + return true; + } + if (exitId == 2) { + if (!Loop_Actor_Walk_To_XYZ(0, 86.0f, -415.06f, 174.0f, 0, 1, false, 0)) { + Loop_Actor_Walk_To_XYZ(0, 179.0f, -415.06f, 274.0f, 0, 0, false, 0); + Game_Flag_Set(282); + Game_Flag_Reset(493); + Set_Enter(21, 4); + } + return true; + } + return false; +} + +bool SceneScriptBB02::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptBB02::SceneFrameAdvanced(int frame) { + if (frame == 1) { + Ambient_Sounds_Play_Sound(434, 40, -50, -50, 0); + } + if (frame == 124) { + Ambient_Sounds_Play_Sound(434, 40, -50, -50, 0); + } +} + +void SceneScriptBB02::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptBB02::PlayerWalkedIn() { + if (Game_Flag_Query(281)) { + Loop_Actor_Walk_To_XYZ(0, 86.0f, -415.06f, 174.0f, 0, 0, false, 0); + Game_Flag_Reset(281); + } else if (Game_Flag_Query(333)) { + Loop_Actor_Walk_To_XYZ(0, 35.0f, -415.06f, -27.0f, 0, 0, false, 0); + Player_Gains_Control(); + Game_Flag_Reset(333); + } +} + +void SceneScriptBB02::PlayerWalkedOut() { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); +} + +void SceneScriptBB02::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/bb03.cpp b/engines/bladerunner/script/scene/bb03.cpp new file mode 100644 index 0000000000..db2747fac1 --- /dev/null +++ b/engines/bladerunner/script/scene/bb03.cpp @@ -0,0 +1,161 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptBB03::InitializeScene() { + Setup_Scene_Information(20.0f, 60.16f, 0.0f, 0); + Game_Flag_Reset(282); + if (Game_Flag_Query(284)) { + Setup_Scene_Information(176.0f, 60.16f, 0.0f, 900); + } + if (Game_Flag_Query(286)) { + Setup_Scene_Information(204.0f, 60.16f, -164.0f, 740); + } + Scene_Exit_Add_2D_Exit(0, 589, 0, 639, 479, 1); + Scene_Exit_Add_2D_Exit(1, 167, 372, 439, 479, 2); + Scene_Exit_Add_2D_Exit(2, 451, 115, 547, 320, 1); + Ambient_Sounds_Add_Looping_Sound(54, 20, 0, 1); + Ambient_Sounds_Add_Looping_Sound(103, 40, 0, 1); + Ambient_Sounds_Add_Looping_Sound(105, 34, 100, 1); + Ambient_Sounds_Add_Sound(443, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(444, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(445, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(446, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(303, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(304, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(305, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(306, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(307, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(308, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(309, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(310, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(90, 5, 50, 17, 17, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(91, 5, 50, 17, 17, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(375, 5, 180, 25, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(376, 5, 180, 25, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(377, 5, 180, 25, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(72, 5, 80, 20, 20, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(73, 5, 80, 20, 20, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(74, 5, 80, 20, 20, -100, 100, -101, -101, 0, 0); +} + +void SceneScriptBB03::SceneLoaded() { + Obstacle_Object("BACKWALL", true); + Unobstacle_Object("BOX08", true); +} + +bool SceneScriptBB03::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptBB03::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptBB03::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptBB03::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptBB03::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, 176.0f, 60.16f, -64.0f, 0, 1, false, 0)) { + Loop_Actor_Walk_To_XYZ(0, 176.0f, 60.16f, 0.0f, 0, 0, false, 0); + Game_Flag_Set(283); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Set_Enter(1, 5); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, 20.0f, 60.16f, 0.0f, 0, 1, false, 0)) { + Game_Flag_Set(281); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Set_Enter(1, 3); + } + return true; + } + if (exitId == 2) { + if (!Loop_Actor_Walk_To_XYZ(0, 204.0f, 60.16f, -164.0f, 0, 1, false, 0)) { + if (Global_Variable_Query(1) < 4) { + if (Actor_Query_Goal_Number(56) == 200) { + Actor_Says(56, 70, 3); + Actor_Says(0, 7010, 13); + Actor_Says(56, 80, 3); + Actor_Says(0, 7015, 12); + Actor_Says(56, 90, 3); + Actor_Says(0, 7020, 14); + Actor_Says(56, 100, 3); + Actor_Says(0, 7025, 15); + Actor_Says(56, 110, 3); + Actor_Set_Targetable(54, false); + Actor_Set_Targetable(58, false); + } + Game_Flag_Set(285); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Set_Enter(22, 6); + } else { + Actor_Says(0, 8522, 3); + } + } + return true; + } + return false; +} + +bool SceneScriptBB03::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptBB03::SceneFrameAdvanced(int frame) { +} + +void SceneScriptBB03::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptBB03::PlayerWalkedIn() { + if (Game_Flag_Query(286)) { + Loop_Actor_Walk_To_XYZ(0, 164.0f, 60.16f, -164.0f, 0, 0, false, 0); + Game_Flag_Reset(286); + } + if (Game_Flag_Query(284)) { + Loop_Actor_Walk_To_XYZ(0, 176.0f, 60.16f, -64.0f, 0, 0, false, 0); + Game_Flag_Reset(284); + } +} + +void SceneScriptBB03::PlayerWalkedOut() { +} + +void SceneScriptBB03::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/bb04.cpp b/engines/bladerunner/script/scene/bb04.cpp new file mode 100644 index 0000000000..3d7134c72f --- /dev/null +++ b/engines/bladerunner/script/scene/bb04.cpp @@ -0,0 +1,130 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptBB04::InitializeScene() { + if (Game_Flag_Query(283)) { + Setup_Scene_Information(-107.0f, -26.6f, 397.0f, 29); + Game_Flag_Reset(283); + } else { + Setup_Scene_Information(-15.0f, -25.17f, 45.0f, 691); + } + Scene_Exit_Add_2D_Exit(0, 218, 102, 360, 254, 1); + Scene_Exit_Add_2D_Exit(1, 0, 334, 639, 479, 2); + Ambient_Sounds_Add_Looping_Sound(54, 20, 0, 1); + Ambient_Sounds_Add_Looping_Sound(103, 40, 0, 1); + Ambient_Sounds_Add_Looping_Sound(105, 44, -100, 1); + Ambient_Sounds_Add_Sound(443, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(444, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(445, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(446, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(303, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(304, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(305, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(306, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(307, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(308, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(309, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(310, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(90, 5, 50, 17, 17, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(91, 5, 50, 17, 17, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(375, 5, 180, 25, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(376, 5, 180, 25, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(377, 5, 180, 25, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(72, 5, 80, 20, 20, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(73, 5, 80, 20, 20, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(74, 5, 80, 20, 20, -100, 100, -101, -101, 0, 0); +} + +void SceneScriptBB04::SceneLoaded() { + Obstacle_Object("DH TRASH", true); +} + +bool SceneScriptBB04::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptBB04::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptBB04::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptBB04::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptBB04::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -92.0f, -26.6f, 45.0f, 0, 1, false, 0)) { + Player_Loses_Control(); + Loop_Actor_Walk_To_XYZ(0, -15.0f, -25.17f, 45.0f, 0, 0, false, 0); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(333); + Game_Flag_Set(493); + Set_Enter(1, 3); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -107.0f, -26.6f, 397.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(284); + Set_Enter(21, 4); + } + return true; + } + return false; +} + +bool SceneScriptBB04::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptBB04::SceneFrameAdvanced(int frame) { +} + +void SceneScriptBB04::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptBB04::PlayerWalkedIn() { + if (Game_Flag_Query(332)) { + Loop_Actor_Walk_To_XYZ(0, -92.0f, -26.6f, 45.0f, 0, 0, false, 0); + Player_Gains_Control(); + Game_Flag_Reset(332); + } +} + +void SceneScriptBB04::PlayerWalkedOut() { +} + +void SceneScriptBB04::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/bb05.cpp b/engines/bladerunner/script/scene/bb05.cpp new file mode 100644 index 0000000000..d01054b8d1 --- /dev/null +++ b/engines/bladerunner/script/scene/bb05.cpp @@ -0,0 +1,213 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptBB05::InitializeScene() { + if (Game_Flag_Query(298)) { + Setup_Scene_Information(95.0f, -60.31f, 331.0f, 0); + } else if (Game_Flag_Query(302)) { + Setup_Scene_Information(87.0f, -60.34f, -96.0f, 0); + } else if (Game_Flag_Query(300)) { + Setup_Scene_Information(271.0f, -60.31f, 203.0f, 0); + } else { + Setup_Scene_Information(-212.0f, -60.31f, 131.0f, 0); + } + Scene_Exit_Add_2D_Exit(0, 92, 125, 187, 317, 3); + Scene_Exit_Add_2D_Exit(1, 0, 0, 30, 479, 3); + Scene_Exit_Add_2D_Exit(2, 589, 0, 639, 479, 1); + Scene_Exit_Add_2D_Exit(3, 481, 113, 573, 307, 0); + Ambient_Sounds_Add_Looping_Sound(54, 12, 0, 1); + Ambient_Sounds_Add_Looping_Sound(103, 28, 0, 1); + Ambient_Sounds_Add_Looping_Sound(105, 14, 0, 1); + Ambient_Sounds_Add_Sound(303, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(304, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(305, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(306, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(307, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(308, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(309, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(310, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(90, 5, 50, 17, 17, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(91, 5, 50, 17, 17, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(375, 5, 180, 25, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(376, 5, 180, 25, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(377, 5, 180, 25, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(72, 5, 80, 14, 14, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(73, 5, 80, 14, 14, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(74, 5, 80, 14, 14, -100, 100, -101, -101, 0, 0); + if (!Game_Flag_Query(495)) { + Overlay_Play("BB05OVER", 0, 0, 0, 0); + Game_Flag_Set(495); + } +} + +void SceneScriptBB05::SceneLoaded() { + Obstacle_Object("PINHEAD", true); + Obstacle_Object("X2WALLS&MOLDNG05", true); + Obstacle_Object("QUADPATCH04", true); + Unobstacle_Object("BOX16", true); + Clickable_Object("PINHEAD"); + Clickable_Object("BOX06"); + Unclickable_Object("BOX06"); + Unclickable_Object("BOX14"); + if (Actor_Query_Goal_Number(56) == 200) { + Actor_Set_Goal_Number(58, 299); + Actor_Put_In_Set(58, 97); + Actor_Set_At_Waypoint(58, 39, 0); + } +} + +bool SceneScriptBB05::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptBB05::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptBB05::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptBB05::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptBB05::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -212.0f, -60.31f, 131.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(286); + Set_Enter(21, 4); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, 95.0f, -60.31f, 331.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(297); + Set_Enter(2, 7); + } + return true; + } + if (exitId == 2) { + if (!Loop_Actor_Walk_To_XYZ(0, 271.0f, -60.31f, 203.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(299); + Set_Enter(3, 8); + } + return true; + } + if (exitId == 3) { + if (!Loop_Actor_Walk_To_XYZ(0, 151.0f, -60.34f, -108.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(301); + Set_Enter(102, 120); + } + return true; + } + return false; +} + +bool SceneScriptBB05::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptBB05::SceneFrameAdvanced(int frame) { +} + +void SceneScriptBB05::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptBB05::PlayerWalkedIn() { + if (Game_Flag_Query(298)) { + Loop_Actor_Walk_To_XYZ(0, 95.0f, -60.31f, 303.0f, 0, 0, false, 0); + Game_Flag_Reset(298); + } else if (Game_Flag_Query(300)) { + Loop_Actor_Walk_To_XYZ(0, 231.0f, -60.31f, 203.0f, 0, 0, false, 0); + Game_Flag_Reset(300); + } else if (Game_Flag_Query(302)) { + Loop_Actor_Walk_To_XYZ(0, 111.0f, -60.31f, -24.0f, 0, 0, false, 0); + Game_Flag_Reset(302); + } else { + Loop_Actor_Walk_To_XYZ(0, -76.0f, -60.31f, 131.0f, 0, 0, false, 0); + Game_Flag_Reset(285); + } + if (Actor_Query_Goal_Number(56) == 200) { + Actor_Face_Actor(56, 0, true); + Actor_Face_Actor(0, 56, true); + Actor_Says(56, 120, 13); + Actor_Says(0, 7030, 15); + Actor_Says(56, 130, 17); + Actor_Says(56, 140, 16); + Actor_Says(56, 150, 14); + Actor_Says(56, 160, 15); + Actor_Says(0, 7035, 14); + Actor_Says(56, 170, 12); + Actor_Says(0, 7040, 14); + Actor_Says(56, 180, 16); + Actor_Says(0, 7045, 14); + if (Game_Flag_Query(399)) { + Actor_Says(56, 190, 15); + Actor_Says(0, 7050, 17); + Actor_Says(56, 200, 16); + Actor_Says_With_Pause(56, 210, 1.5f, 14); + Actor_Says(0, 7055, 15); + } else { + Actor_Put_In_Set(58, 22); + Actor_Set_At_Waypoint(58, 134, 0); + Loop_Actor_Walk_To_Waypoint(58, 135, 0, 0, false); + Actor_Says(58, 0, 3); + Actor_Face_Actor(0, 58, true); + Actor_Face_Actor(56, 58, true); + Actor_Says(56, 220, 13); + Loop_Actor_Walk_To_Waypoint(58, 134, 0, 0, false); + Actor_Face_Actor(56, 0, true); + Actor_Face_Actor(0, 56, true); + Actor_Says(56, 230, 15); + Actor_Says(0, 7060, 17); + Actor_Says(56, 240, 12); + } + Actor_Says(0, 7065, 16); + Actor_Says(56, 250, 16); + Actor_Says(0, 7070, 18); + Actor_Set_Goal_Number(56, 205); + Actor_Set_Goal_Number(58, 201); + Actor_Set_Goal_Number(54, 101); + Actor_Set_Goal_Number(58, 200); + } +} + +void SceneScriptBB05::PlayerWalkedOut() { +} + +void SceneScriptBB05::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/bb06.cpp b/engines/bladerunner/script/scene/bb06.cpp new file mode 100644 index 0000000000..48d983d74a --- /dev/null +++ b/engines/bladerunner/script/scene/bb06.cpp @@ -0,0 +1,177 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptBB06::InitializeScene() { + if (Game_Flag_Query(394)) { + Setup_Scene_Information(76.0f, 0.0f, 79.0f, 622); + } else if (Game_Flag_Query(395)) { + Setup_Scene_Information(55.0f, 0.0f, -96.0f, 761); + } else if (Game_Flag_Query(362)) { + Setup_Scene_Information(-115.0f, 0.0f, -103.0f, 375); + Game_Flag_Reset(362); + } else { + Setup_Scene_Information(-37.0f, 0.0f, 178.0f, 0); + } + Scene_Exit_Add_2D_Exit(0, 0, 43, 14, 478, 3); + Scene_Exit_Add_2D_Exit(1, 425, 0, 639, 361, 0); + Scene_Exit_Add_2D_Exit(3, 195, 164, 239, 280, 3); + Ambient_Sounds_Add_Looping_Sound(103, 28, 0, 1); + Ambient_Sounds_Add_Sound(303, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(304, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(443, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(444, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(445, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(446, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(305, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(306, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(307, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(308, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(309, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(310, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + if (Game_Flag_Query(394) || Game_Flag_Query(395)) { + Scene_Loop_Start_Special(0, 0, 0); + Scene_Loop_Set_Default(1); + Game_Flag_Reset(394); + Game_Flag_Reset(395); + } else { + Scene_Loop_Set_Default(1); + } + if (Game_Flag_Query(410)) { + Overlay_Play("BB06OVER", 1, 1, 0, 0); + } +} + +void SceneScriptBB06::SceneLoaded() { + Obstacle_Object("V2CHESSTBL01", true); + Clickable_Object("BOX31"); + Item_Add_To_World(77, 931, 2, -127.0f, 68.42f, 57.0f, 0, 8, 8, true, true, false, true); +} + +bool SceneScriptBB06::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptBB06::ClickedOn3DObject(const char *objectName, bool a2) { + if (Object_Query_Click("BOX31", objectName)) { + if (!Loop_Actor_Walk_To_Scene_Object(0, "BOX31", 24, 1, false)) { + Actor_Face_Object(0, "BOX31", true); + if (Game_Flag_Query(410)) { + Actor_Voice_Over(60, 99); + Actor_Voice_Over(70, 99); + } else { + Actor_Voice_Over(50, 99); + } + } + } + return false; +} + +bool SceneScriptBB06::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptBB06::ClickedOnItem(int itemId, bool a2) { + if (itemId == 77) { + if (Player_Query_Combat_Mode()) { + Overlay_Play("BB06OVER", 1, 1, 1, 0); + Game_Flag_Set(410); + Item_Remove_From_World(77); + return true; + } + } + return false; +} + +bool SceneScriptBB06::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -37.0f, 0.0f, 178.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(298); + Set_Enter(22, 6); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, 101.0f, 0.0f, -25.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(393); + Set_Enter(1, 104); + } + return true; + } + if (exitId == 3) { + if (!Loop_Actor_Walk_To_XYZ(0, -115.0f, 0.0f, -103.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(363); + Set_Enter(2, 8); + } + return true; + } + return false; +} + +bool SceneScriptBB06::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptBB06::SceneFrameAdvanced(int frame) { + if (frame == 34) { + Ambient_Sounds_Play_Sound(447, 40, -50, -50, 10); + } + if (frame == 16) { + Ambient_Sounds_Play_Sound(448, 20, -50, -50, 10); + } + if (frame == 20) { + Ambient_Sounds_Play_Sound(448, 20, -50, -50, 10); + } + if (frame == 25) { + Ambient_Sounds_Play_Sound(448, 20, -50, -50, 10); + } + if (frame == 29) { + Ambient_Sounds_Play_Sound(448, 20, -50, -50, 10); + } +} + +void SceneScriptBB06::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptBB06::PlayerWalkedIn() { + if (Game_Flag_Query(297)) { + Loop_Actor_Walk_To_XYZ(0, -36.0f, 0.0f, 145.0f, 0, 0, false, 0); + Game_Flag_Reset(297); + } +} + +void SceneScriptBB06::PlayerWalkedOut() { +} + +void SceneScriptBB06::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/bb07.cpp b/engines/bladerunner/script/scene/bb07.cpp new file mode 100644 index 0000000000..f088732675 --- /dev/null +++ b/engines/bladerunner/script/scene/bb07.cpp @@ -0,0 +1,184 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptBB07::InitializeScene() { + if (Game_Flag_Query(365)) { + Setup_Scene_Information(-655.0f, 252.59f, -1136.0f, 323); + } else if (Game_Flag_Query(363)) { + Setup_Scene_Information(-551.0f, 252.59f, -1004.0f, 29); + Game_Flag_Reset(363); + } else { + Setup_Scene_Information(-652.0f, 252.59f, -1018.0f, 268); + } + Scene_Exit_Add_2D_Exit(0, 0, 16, 51, 426, 3); + Scene_Exit_Add_2D_Exit(1, 124, 101, 172, 305, 3); + Scene_Exit_Add_2D_Exit(2, 282, 408, 476, 479, 2); + Scene_2D_Region_Add(0, 308, 283, 354, 308); + Ambient_Sounds_Add_Looping_Sound(332, 44, 0, 1); + Ambient_Sounds_Add_Looping_Sound(331, 24, 0, 1); + Ambient_Sounds_Add_Sound(443, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(444, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(445, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(446, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(303, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(304, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(305, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(306, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(307, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(308, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(309, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(310, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Overlay_Play("BB07OVER", 0, 1, 0, 0); +} + +void SceneScriptBB07::SceneLoaded() { + Obstacle_Object("COUCH", true); + Unobstacle_Object("X2MAINWALLLEFT01", true); + Clickable_Object("PRINTER"); +} + +bool SceneScriptBB07::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptBB07::ClickedOn3DObject(const char *objectName, bool a2) { + if (Object_Query_Click("PRINTER", objectName)) { + if (!Loop_Actor_Walk_To_XYZ(0, -472.63f, 252.59f, -1086.81f, 0, 0, false, 0)) { + Actor_Face_Object(0, "PRINTER", true); + if (Game_Flag_Query(396) && !Game_Flag_Query(398)) { + Actor_Voice_Over(130, 99); + Item_Pickup_Spin_Effect(941, 439, 242); + Actor_Voice_Over(140, 99); + Game_Flag_Set(398); + Actor_Clue_Acquire(0, 148, 1, -1); + } else if (Game_Flag_Query(396) && Game_Flag_Query(398)) { + Actor_Face_Object(0, "PRINTER", true); + Actor_Says(0, 8570, 13); + } else { + Actor_Face_Object(0, "PRINTER", true); + Actor_Says(0, 8575, 13); + } + } + } + return false; +} + +bool SceneScriptBB07::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptBB07::ClickedOnItem(int itemId, bool a2) { + if (itemId == 83) { + if (!Loop_Actor_Walk_To_Item(0, 83, 36, 1, false)) { + Actor_Face_Item(0, 83, true); + if (Game_Flag_Query(396) == 1) { + Actor_Voice_Over(150, 99); + Actor_Voice_Over(160, 99); + Actor_Voice_Over(170, 99); + } + } + } + return false; +} + +bool SceneScriptBB07::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -615.0f, 252.59f, -1018.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Overlay_Remove("BB07OVER"); + Game_Flag_Set(300); + Set_Enter(22, 6); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -619.0f, 252.59f, -1136.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Overlay_Remove("BB07OVER"); + Game_Flag_Set(364); + Set_Enter(102, 120); + } + return true; + } + if (exitId == 2) { + if (!Loop_Actor_Walk_To_XYZ(0, -551.0f, 252.59f, -1004.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Overlay_Remove("BB07OVER"); + Game_Flag_Set(362); + Set_Enter(2, 7); + } + return true; + } + return false; +} + +bool SceneScriptBB07::ClickedOn2DRegion(int region) { + if (region == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -568.63f, 252.59f, -1114.81f, 0, 1, false, 0)) { + Actor_Face_Heading(0, 229, false); + if (Game_Flag_Query(396)) { + Actor_Says(0, 8585, 15); + } else { + Ambient_Sounds_Play_Sound(592, 40, 20, 20, 99); + Overlay_Play("BB07OVER", 1, 0, 1, 0); + Overlay_Play("BB07OVER", 2, 1, 0, 0); + Game_Flag_Set(396); + if (!Game_Flag_Query(398)) { + Actor_Says(39, 0, 3); + } + } + } + } + return false; +} + +void SceneScriptBB07::SceneFrameAdvanced(int frame) { +} + +void SceneScriptBB07::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptBB07::PlayerWalkedIn() { + if (Game_Flag_Query(299)) { + Loop_Actor_Walk_To_XYZ(0, -594.0f, 252.59f, -1018.0f, 6, 0, false, 0); + Game_Flag_Reset(299); + } + if (Game_Flag_Query(365)) { + Loop_Actor_Walk_To_XYZ(0, -602.0f, 252.59f, -1124.0f, 6, 0, false, 0); + Game_Flag_Reset(365); + } +} + +void SceneScriptBB07::PlayerWalkedOut() { +} + +void SceneScriptBB07::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/bb08.cpp b/engines/bladerunner/script/scene/bb08.cpp new file mode 100644 index 0000000000..b88eef6e3f --- /dev/null +++ b/engines/bladerunner/script/scene/bb08.cpp @@ -0,0 +1,136 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptBB08::InitializeScene() { + if (Game_Flag_Query(219)) { + Setup_Scene_Information(204.0f, 0.0f, 92.0f, 875); + } else { + Setup_Scene_Information(247.0f, 0.0f, 27.0f, 790); + } + Scene_Exit_Add_2D_Exit(0, 307, 0, 361, 238, 0); + Scene_Exit_Add_2D_Exit(1, 117, 38, 214, 245, 0); + Ambient_Sounds_Add_Looping_Sound(105, 44, 0, 1); + Ambient_Sounds_Add_Sound(291, 1, 20, 20, 25, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(292, 1, 20, 20, 25, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(293, 1, 20, 20, 25, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(294, 1, 20, 20, 25, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(295, 1, 20, 20, 25, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(443, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(444, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(445, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(446, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(303, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(304, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(305, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(306, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(307, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(308, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(309, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(310, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + if (!Game_Flag_Query(496)) { + Overlay_Play("BB08OVER", 0, 0, 0, 0); + Game_Flag_Set(496); + } +} + +void SceneScriptBB08::SceneLoaded() { + Obstacle_Object("BATHTUB", true); + Unobstacle_Object("DOORWAY", true); + Unclickable_Object("BATHTUB"); +} + +bool SceneScriptBB08::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptBB08::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptBB08::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptBB08::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptBB08::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, 204.0f, 0.1f, 94.0f, 0, 1, false, 0)) { + Actor_Face_Heading(0, 256, false); + Footstep_Sound_Override_On(2); + Loop_Actor_Travel_Ladder(0, 8, 1, 0); + Footstep_Sound_Override_Off(); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(218); + Set_Enter(24, 10); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, 247.0f, 0.1f, 27.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(506); + Set_Enter(102, 120); + } + return true; + } + return false; +} + +bool SceneScriptBB08::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptBB08::SceneFrameAdvanced(int frame) { +} + +void SceneScriptBB08::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptBB08::PlayerWalkedIn() { + if (Game_Flag_Query(219)) { + Actor_Set_At_XYZ(0, 204.0f, 96.1f, 94.0f, 256); + Footstep_Sound_Override_On(2); + Loop_Actor_Travel_Ladder(0, 8, 0, 0); + Footstep_Sound_Override_Off(); + Actor_Face_Heading(0, 768, false); + Game_Flag_Reset(219); + } else { + Loop_Actor_Walk_To_XYZ(0, 188.0f, 0.1f, 28.0f, 0, 0, false, 0); + } +} + +void SceneScriptBB08::PlayerWalkedOut() { +} + +void SceneScriptBB08::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/bb09.cpp b/engines/bladerunner/script/scene/bb09.cpp new file mode 100644 index 0000000000..dc3356e77b --- /dev/null +++ b/engines/bladerunner/script/scene/bb09.cpp @@ -0,0 +1,124 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptBB09::InitializeScene() { + Setup_Scene_Information(111.2f, -8.96f, 134.65f, 0); + if (Game_Flag_Query(221)) { + Game_Flag_Reset(221); + Setup_Scene_Information(115.45f, -8.96f, 134.0f, 628); + } else if (Game_Flag_Query(218)) { + Game_Flag_Reset(218); + Setup_Scene_Information(107.45f, -9.14f, 166.0f, 244); + } + Scene_Exit_Add_2D_Exit(0, 224, 213, 286, 353, 1); + Scene_Exit_Add_2D_Exit(1, 75, 450, 480, 479, 2); + Ambient_Sounds_Add_Looping_Sound(54, 20, 100, 1); + Ambient_Sounds_Add_Looping_Sound(103, 40, 0, 1); + Ambient_Sounds_Add_Looping_Sound(105, 50, 55, 1); + Ambient_Sounds_Add_Sound(297, 5, 20, 20, 25, -100, -100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(298, 5, 20, 20, 25, -100, -100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(299, 5, 20, 20, 25, -100, -100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(443, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(444, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(445, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(446, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(303, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(304, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(305, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(306, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(307, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(308, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(309, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(310, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Actor_Set_Targetable(8, true); +} + +void SceneScriptBB09::SceneLoaded() { + Obstacle_Object("WICKER CHAIR ", true); + Unobstacle_Object("ROOM03 RIGHT WALL", true); + Unclickable_Object("WICKER CHAIR "); +} + +bool SceneScriptBB09::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptBB09::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptBB09::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptBB09::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptBB09::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, 454.56f, -9.0f, 190.31f, 0, 1, false, 0)) { + Loop_Actor_Walk_To_XYZ(0, 450.56f, -9.0f, 250.31f, 0, 0, false, 0); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(216); + Game_Flag_Set(220); + Set_Enter(25, 11); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, 71.0f, -9.0f, 136.0f, 72, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(219); + Set_Enter(23, 9); + } + return true; + } + return false; +} + +bool SceneScriptBB09::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptBB09::SceneFrameAdvanced(int frame) { +} + +void SceneScriptBB09::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptBB09::PlayerWalkedIn() { +} + +void SceneScriptBB09::PlayerWalkedOut() { +} + +void SceneScriptBB09::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/bb10.cpp b/engines/bladerunner/script/scene/bb10.cpp new file mode 100644 index 0000000000..f40084be2d --- /dev/null +++ b/engines/bladerunner/script/scene/bb10.cpp @@ -0,0 +1,205 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptBB10::InitializeScene() { + if (Game_Flag_Query(223)) { + Setup_Scene_Information(255.29f, 90.24f, -103.0f, 830); + } else if (Game_Flag_Query(220)) { + Game_Flag_Reset(220); + Setup_Scene_Information(151.67f, 66.84f, -313.06f, 0); + } else { + Setup_Scene_Information(199.67f, 67.4f, -169.06f, 628); + } + if (Global_Variable_Query(36) > 2) { + Scene_Exit_Add_2D_Exit(0, 281, 0, 531, 115, 0); + } + Scene_Exit_Add_2D_Exit(1, 58, 91, 193, 401, 3); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Add_Looping_Sound(382, 76, 0, 1); + Ambient_Sounds_Add_Sound(443, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(444, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(445, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(446, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(303, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(304, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(305, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(306, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(307, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(308, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(309, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(310, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + if (!Game_Flag_Query(466)) { + Scene_2D_Region_Add(0, 458, 99, 522, 133); + Overlay_Play("BB10OVR1", 0, 1, 0, 0); + } + if (!Game_Flag_Query(467)) { + Scene_2D_Region_Add(1, 459, 164, 522, 193); + Overlay_Play("BB10OVR2", 0, 1, 0, 0); + } + if (!Game_Flag_Query(468)) { + Scene_2D_Region_Add(2, 458, 194, 522, 223); + Overlay_Play("BB10OVR3", 0, 1, 0, 0); + } + if (!Game_Flag_Query(469)) { + Scene_2D_Region_Add(3, 458, 255, 522, 278); + Overlay_Play("BB10OVR4", 0, 1, 0, 0); + } + if (!Game_Flag_Query(470)) { + Scene_2D_Region_Add(4, 458, 316, 522, 335); + Overlay_Play("BB10OVR5", 0, 1, 0, 0); + } +} + +void SceneScriptBB10::SceneLoaded() { + Obstacle_Object("BARB NIGHT", true); + Unclickable_Object("BARB NIGHT"); + Unobstacle_Object("Box-Floor Hole01", true); + Unobstacle_Object("Box-Floor Hole02", true); + Unobstacle_Object("Box-Floor Hole03", true); +} + +bool SceneScriptBB10::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptBB10::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptBB10::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptBB10::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptBB10::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, 225.58f, 67.2f, -102.1f, 0, 1, false, 0)) { + Player_Set_Combat_Mode(false); + Actor_Face_Heading(0, 274, false); + Footstep_Sound_Override_On(2); + Loop_Actor_Travel_Stairs(0, 2, 1, 0); + Footstep_Sound_Override_Off(); + Footstep_Sound_Override_On(2); + Loop_Actor_Travel_Ladder(0, 3, 1, 0); + Footstep_Sound_Override_Off(); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(222); + Set_Enter(26, 12); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, 206.01f, 66.84f, -261.62f, 0, 1, false, 0) && !Loop_Actor_Walk_To_XYZ(0, 151.67f, 66.84f, -313.06f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Reset(216); + Game_Flag_Set(221); + Set_Enter(24, 10); + } + return true; + } + return false; +} + +bool SceneScriptBB10::ClickedOn2DRegion(int region) { + if (!Loop_Actor_Walk_To_XYZ(0, 225.58f, 67.2f, -102.1f, 0, 1, false, 0)) { + Actor_Face_Heading(0, 274, false); + Sound_Play(Random_Query(289, 290), 40, 70, 70, 50); + switch (region) { + case 4: + Overlay_Remove("BB10OVR5"); + Game_Flag_Set(470); + Scene_2D_Region_Remove(4); + break; + case 3: + Overlay_Remove("BB10OVR4"); + Game_Flag_Set(469); + Scene_2D_Region_Remove(3); + break; + case 2: + Overlay_Remove("BB10OVR3"); + Game_Flag_Set(468); + Scene_2D_Region_Remove(2); + break; + case 1: + Overlay_Remove("BB10OVR2"); + Game_Flag_Set(467); + Scene_2D_Region_Remove(1); + break; + case 0: + Overlay_Remove("BB10OVR1"); + Game_Flag_Set(466); + Scene_2D_Region_Remove(0); + break; + default: + break; + } + Global_Variable_Increment(36, 1); + if (Global_Variable_Query(36) > 4) { + Scene_Exit_Add_2D_Exit(0, 281, 0, 531, 115, 0); + } + return false; + } + return true; +} + +void SceneScriptBB10::SceneFrameAdvanced(int frame) { +} + +void SceneScriptBB10::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptBB10::PlayerWalkedIn() { + if (Game_Flag_Query(216)) { + Player_Loses_Control(); + Actor_Set_At_XYZ(0, 214.01f, 66.84f, -349.62f, 462); + Loop_Actor_Walk_To_XYZ(0, 206.01f, 66.84f, -261.62f, 0, 0, false, 0); + Player_Gains_Control(); + Game_Flag_Reset(216); + } else if (Game_Flag_Query(223)) { + Actor_Set_At_XYZ(0, 249.58f, 127.2f, -102.1f, 256); + Footstep_Sound_Override_On(2); + Loop_Actor_Travel_Ladder(0, 3, 0, 0); + Footstep_Sound_Override_Off(); + Actor_Face_Heading(0, 768, false); + Footstep_Sound_Override_On(2); + Loop_Actor_Travel_Stairs(0, 3, 0, 0); + Footstep_Sound_Override_Off(); + Game_Flag_Reset(223); + } +} + +void SceneScriptBB10::PlayerWalkedOut() { +} + +void SceneScriptBB10::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/bb11.cpp b/engines/bladerunner/script/scene/bb11.cpp new file mode 100644 index 0000000000..07dd2e2301 --- /dev/null +++ b/engines/bladerunner/script/scene/bb11.cpp @@ -0,0 +1,132 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptBB11::InitializeScene() { + Setup_Scene_Information(43.39f, -10.27f, -20.52f, 200); + if (!Game_Flag_Query(509)) { + Scene_Exit_Add_2D_Exit(0, 280, 154, 388, 247, 2); + } + Ambient_Sounds_Add_Looping_Sound(101, 90, 0, 1); + Ambient_Sounds_Add_Looping_Sound(99, 45, 0, 1); + Ambient_Sounds_Add_Looping_Sound(100, 76, 0, 1); + Ambient_Sounds_Add_Sound(68, 5, 180, 16, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(69, 5, 180, 16, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(375, 5, 180, 50, 100, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(376, 5, 180, 50, 100, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(377, 5, 180, 50, 100, 0, 0, -101, -101, 0, 0); + if (Game_Flag_Query(509)) { + Preload(19); + Preload(220); + Preload(227); + Preload(328); + Preload(343); + Preload(344); + Preload(17); + Preload(14); + Preload(324); + Preload(323); + Preload(18); + Preload(345); + } +} + +void SceneScriptBB11::SceneLoaded() { + Obstacle_Object("X2AIRCON01", true); + Unclickable_Object("X2AIRCON01"); + if (Game_Flag_Query(509)) { + Unobstacle_Object("X2PIPES01", true); + Unobstacle_Object("X2PIPES02", true); + Unobstacle_Object("X2PIPES03", true); + Unobstacle_Object("X2_VENTS05", true); + Unobstacle_Object("X2_VENTSCYL05", true); + } +} + +bool SceneScriptBB11::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptBB11::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptBB11::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptBB11::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptBB11::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, 43.39f, -10.27f, -68.52f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(223); + Set_Enter(25, 11); + } + return true; + } + return false; +} + +bool SceneScriptBB11::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptBB11::SceneFrameAdvanced(int frame) { + if (Actor_Query_Goal_Number(8) == 105 && !Game_Flag_Query(375)) { + Actor_Change_Animation_Mode(0, 48); + Game_Flag_Set(375); + } else { + if (frame == 1) { + Sound_Play(74, 10, -100, 100, 50); + } + } +} + +void SceneScriptBB11::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptBB11::PlayerWalkedIn() { + if (Actor_Query_Goal_Number(8) == 102 && Global_Variable_Query(1) == 2) { + Actor_Set_Invisible(0, true); + Actor_Set_Goal_Number(8, 103); + Music_Play(11, 61, 0, 1, -1, 0, 0); + Player_Loses_Control(); + } +} + +void SceneScriptBB11::PlayerWalkedOut() { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); +} + +void SceneScriptBB11::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/bb12.cpp b/engines/bladerunner/script/scene/bb12.cpp new file mode 100644 index 0000000000..0546ae0225 --- /dev/null +++ b/engines/bladerunner/script/scene/bb12.cpp @@ -0,0 +1,144 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptBB12::InitializeScene() { + if (Game_Flag_Query(364)) { + Setup_Scene_Information(138.0f, 0.0f, 104.0f, 760); + } else if (Game_Flag_Query(506)) { + Setup_Scene_Information(-129.0f, 0.0f, 64.0f, 307); + } else { + Setup_Scene_Information(54.0f, 0.0f, 200.0f, 0); + Game_Flag_Reset(301); + } + Scene_Exit_Add_2D_Exit(0, 0, 0, 30, 479, 3); + Scene_Exit_Add_2D_Exit(1, 589, 0, 639, 479, 1); + Scene_Exit_Add_2D_Exit(2, 377, 374, 533, 479, 2); + Ambient_Sounds_Add_Looping_Sound(103, 28, 0, 1); + Ambient_Sounds_Add_Sound(443, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(444, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(445, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(446, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(303, 5, 50, 27, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(304, 5, 50, 27, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(305, 5, 50, 27, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(306, 5, 50, 27, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(307, 5, 50, 27, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(308, 5, 50, 27, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(309, 5, 50, 27, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(310, 5, 50, 27, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(375, 5, 180, 25, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(376, 5, 180, 25, 25, -100, 100, -101, -101, 0, 0); + if (!Game_Flag_Query(497)) { + Overlay_Play("BB12OVER", 0, 0, 0, 0); + Game_Flag_Set(497); + } +} + +void SceneScriptBB12::SceneLoaded() { + Obstacle_Object("BALLS", true); + Unclickable_Object("BALLS"); +} + +bool SceneScriptBB12::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptBB12::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptBB12::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptBB12::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptBB12::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -129.0f, 0.0f, 64.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(507); + Set_Enter(23, 9); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, 138.0f, 0.0f, 104.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(365); + Set_Enter(3, 8); + } + return true; + } + if (exitId == 2) { + if (!Loop_Actor_Walk_To_XYZ(0, 54.0f, 0.0f, 200.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(302); + Set_Enter(22, 6); + } + return true; + } + return false; +} + +bool SceneScriptBB12::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptBB12::SceneFrameAdvanced(int frame) { + if (frame == 10 || frame == 22 || frame == 33 || frame == 41) { + Sound_Play(311, 17, -30, -30, 50); + } + if (frame == 3) { + Sound_Play(313, 16, -30, -30, 50); + } +} + +void SceneScriptBB12::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptBB12::PlayerWalkedIn() { + if (Game_Flag_Query(364)) { + Loop_Actor_Walk_To_XYZ(0, 114.0f, 0.0f, 104.0f, 0, 0, false, 0); + Game_Flag_Reset(364); + } else if (Game_Flag_Query(506)) { + Loop_Actor_Walk_To_XYZ(0, -101.0f, 0.0f, 64.0f, 0, 0, false, 0); + Game_Flag_Reset(506); + } +} + +void SceneScriptBB12::PlayerWalkedOut() { +} + +void SceneScriptBB12::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/bb51.cpp b/engines/bladerunner/script/scene/bb51.cpp new file mode 100644 index 0000000000..5ef20430fb --- /dev/null +++ b/engines/bladerunner/script/scene/bb51.cpp @@ -0,0 +1,123 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptBB51::InitializeScene() { + Setup_Scene_Information(101.0f, 0.0f, -25.0f, 152); + Game_Flag_Reset(393); + Scene_Exit_Add_2D_Exit(0, 615, 0, 639, 479, 1); + Scene_Exit_Add_2D_Exit(1, 0, 323, 241, 479, 2); + Ambient_Sounds_Add_Looping_Sound(103, 28, 0, 1); + Ambient_Sounds_Add_Sound(303, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(304, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(443, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(444, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(445, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(446, 2, 180, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(305, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(306, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(307, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(308, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(309, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(310, 5, 50, 17, 27, -100, 100, -101, -101, 0, 0); + Scene_Loop_Start_Special(0, 0, 0); + Scene_Loop_Set_Default(1); +} + +void SceneScriptBB51::SceneLoaded() { + Obstacle_Object("V2CHESSTBL01", true); + Clickable_Object("V2CHESSTBL01"); + Clickable_Object("TOP02"); +} + +bool SceneScriptBB51::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptBB51::ClickedOn3DObject(const char *objectName, bool a2) { + if (Object_Query_Click("V2CHESSTBL01", objectName)) { + Actor_Face_Object(0, "V2CHESSTBL01", true); + Actor_Voice_Over(80, 99); + Actor_Voice_Over(90, 99); + } + if (Object_Query_Click("TOP02", objectName)) { + Actor_Face_Object(0, "TOP02", true); + Actor_Voice_Over(100, 99); + Actor_Voice_Over(110, 99); + Actor_Voice_Over(120, 99); + } + return false; +} + +bool SceneScriptBB51::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptBB51::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptBB51::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, 76.0f, 0.0f, 79.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(394); + Set_Enter(1, 7); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, 55.0f, 0.0f, -96.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(395); + Set_Enter(1, 7); + } + return true; + } + return false; +} + +bool SceneScriptBB51::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptBB51::SceneFrameAdvanced(int frame) { +} + +void SceneScriptBB51::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptBB51::PlayerWalkedIn() { +} + +void SceneScriptBB51::PlayerWalkedOut() { +} + +void SceneScriptBB51::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ct01.cpp b/engines/bladerunner/script/scene/ct01.cpp new file mode 100644 index 0000000000..84878d1b94 --- /dev/null +++ b/engines/bladerunner/script/scene/ct01.cpp @@ -0,0 +1,515 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptCT01::InitializeScene() { + Music_Play(3, 28, 0, 2, -1, 1, 0); + Game_Flag_Reset(247); + if (Game_Flag_Query(68)) { + Game_Flag_Reset(68); + Setup_Scene_Information(-35.2f, -6.5f, 352.28f, 603); + } else if (Game_Flag_Query(71)) { + Game_Flag_Reset(71); + Setup_Scene_Information(-311.0f, -6.5f, 710.0f, 878); + } else if (Game_Flag_Query(88)) { + Game_Flag_Reset(88); + Setup_Scene_Information(-419.0f, -6.5f, 696.0f, 28); + if (Global_Variable_Query(1) != 2 && Global_Variable_Query(1) != 3) { + if (Game_Flag_Query(248)) { + Scene_Loop_Start_Special(0, 0, 0); + } else { + Scene_Loop_Start_Special(0, 6, 0); + } + } + } else if (Game_Flag_Query(248)) { + Setup_Scene_Information(-530.0f, -6.5f, 241.0f, 506); + Game_Flag_Set(247); + } else { + Setup_Scene_Information(-397.0f, -6.5f, 471.0f, 250); + } + Scene_Exit_Add_2D_Exit(0, 290, 256, 360, 304, 1); + if (Actor_Clue_Query(0, 18)) { + Scene_Exit_Add_2D_Exit(1, 571, 233, 639, 367, 1); + } + if (Game_Flag_Query(94)) { + Scene_Exit_Add_2D_Exit(2, 506, 400, 639, 479, 2); + } + if (Game_Flag_Query(248)) { + Scene_Exit_Add_2D_Exit(3, 0, 286, 158, 350, 2); + } + Ambient_Sounds_Add_Looping_Sound(54, 50, 1, 1); + Ambient_Sounds_Add_Looping_Sound(55, 40, -100, 1); + Ambient_Sounds_Add_Looping_Sound(56, 40, 100, 1); + Ambient_Sounds_Add_Sound(61, 10, 30, 16, 20, 0, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(62, 10, 30, 16, 20, 0, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(63, 10, 30, 16, 20, 0, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(64, 10, 30, 16, 20, 0, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Speech_Sound(60, 0, 10, 260, 27, 47, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 20, 10, 260, 27, 47, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 40, 10, 260, 27, 47, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 50, 10, 260, 27, 47, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Sound(68, 10, 40, 33, 50, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(69, 10, 40, 33, 50, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(375, 20, 40, 33, 50, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(376, 20, 40, 33, 50, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(377, 20, 40, 33, 50, -100, 100, -101, -101, 0, 0); + if (Game_Flag_Query(248)) { + Scene_Loop_Set_Default(2); + } else { + Scene_Loop_Set_Default(7); + } +} + +void SceneScriptCT01::SceneLoaded() { + Obstacle_Object("HYDRANT02", true); + Obstacle_Object("HOWWALLRT", true); + Obstacle_Object("HOW-CHAIR1", true); + Obstacle_Object("HOWWALLLFT", true); + Obstacle_Object("HOWDOOR01", true); + Unobstacle_Object("SPINNER BODY", true); + Unobstacle_Object("HOWFLOOR", true); + Unobstacle_Object("PAPER11", true); + Unobstacle_Object("PAPER16", true); + Unclickable_Object("HYDRANT02"); + Unclickable_Object("TURBINE"); + Unclickable_Object("SPINNER BODY"); + Unclickable_Object("OBJECT04"); +} + +bool SceneScriptCT01::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptCT01::ClickedOn3DObject(const char *objectName, bool a2) { +// if ("ASIANSITTINGANDEATI" == objectName) { //bug? + if (Object_Query_Click("ASIANSITTINGANDEATI", objectName)) { + Actor_Face_Object(0, "ASIANSITTINGANDEATI", true); + Actor_Says(0, 365, 13); + Actor_Says(28, 160, 13); + return true; + } + return false; +} + +bool SceneScriptCT01::ClickedOnActor(int actorId) { + if (actorId == 28) { + Actor_Set_Goal_Number(28, 50); + if (!Loop_Actor_Walk_To_XYZ(0, -335.23f, -6.5f, 578.97f, 12, 1, false, 0)) { + Actor_Face_Actor(0, 28, true); + Actor_Face_Actor(28, 0, true); + if (!Game_Flag_Query(26)) { + Actor_Says(0, 260, 18); + Actor_Says(28, 0, 14); + Game_Flag_Set(26); + Actor_Set_Goal_Number(28, 0); + } else if (!Game_Flag_Query(30) && Actor_Query_Friendliness_To_Other(28, 0) >= 40) { + sub_40269C(); + Actor_Set_Goal_Number(28, 0); + } else { + if (Game_Flag_Query(31)) { + Actor_Says(0, 330, 17); + Actor_Says(28, 130, 13); + Actor_Says(28, 140, 14); + } else if (Actor_Query_Friendliness_To_Other(28, 0) < 50) { + Actor_Says(0, 330, 13); + Actor_Says(28, 160, 15); + } else { + Actor_Says(0, 310, 11); + Actor_Says(28, 10, 16); + } + Actor_Set_Goal_Number(28, 0); + } + return true; + } + } + if (actorId == 19) { + if (!Loop_Actor_Walk_To_XYZ(0, -335.23f, -6.5f, 578.97f, 12, 1, false, 0)) { + Actor_Face_Actor(0, 19, true); + Actor_Says(0, 355, 18); + if (!Actor_Query_Goal_Number(19)) { + Actor_Says(19, 10, 16); + Actor_Face_Actor(28, 0, true); + Actor_Says(28, 150, 3); + Actor_Face_Actor(0, 28, true); + Actor_Says(0, 360, 13); + Actor_Modify_Friendliness_To_Other(28, 0, -5); + Actor_Modify_Friendliness_To_Other(19, 0, -4); + } + return true; + } + } + if (actorId == 2) { + //todo: some weird code in assembly EBP is used but may not be initialized, loc_401C78 + if (!Actor_Query_Goal_Number(2)) { + if (Loop_Actor_Walk_To_XYZ(0, -338.1f, -6.5f, 419.65f, 6, 1, false, 0)) { + return false; + } + } + + Actor_Face_Actor(0, 2, true); + if (!Game_Flag_Query(32)) { + Actor_Says(0, 335, 18); + Actor_Says(2, 20, 30); + Game_Flag_Set(32); + Actor_Clue_Acquire(2, 213, 1, 0); + Actor_Clue_Acquire(0, 214, 1, 0); + Actor_Modify_Friendliness_To_Other(2, 0, -1); + } else if (Actor_Query_Goal_Number(2)) { + Actor_Says(0, 365, 14); + } else { + Actor_Says(0, 340, 13); + Actor_Says(0, 345, 11); + Actor_Says(2, 30, 30); + Actor_Says(0, 350, 13); + Actor_Says(2, 40, 30); + Actor_Modify_Friendliness_To_Other(2, 0, -5); + Player_Loses_Control(); + } + if (Actor_Query_Is_In_Current_Set(19)) { + Actor_Modify_Friendliness_To_Other(19, 0, -2); + } + return true; + } + return false; +} + +bool SceneScriptCT01::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptCT01::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -327.5f, -6.5f, 352.28f, 0, 1, false, 0)) { + Player_Loses_Control(); + Loop_Actor_Walk_To_Waypoint(0, 106, 0, 0, false); + Player_Gains_Control(); + Game_Flag_Reset(247); + Set_Enter(27, 14); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -259.0f, -6.5f, 710.0f, 0, 1, false, 0)) { + Game_Flag_Reset(247); + Set_Enter(5, 15); + } + return true; + } + if (exitId == 2) { + if (!Loop_Actor_Walk_To_XYZ(0, -419.0f, -6.5f, 696.0f, 0, 1, false, 0)) { + Game_Flag_Set(123); + Game_Flag_Reset(247); + Set_Enter(4, 24); + } + return true; + } + if (exitId == 3) { + if (!Loop_Actor_Walk_To_XYZ(0, -314.0f, -6.5f, 326.0f, 0, 1, false, 0)) { + Loop_Actor_Walk_To_XYZ(0, -330.0f, -6.5f, 221.0f, 0, 0, true, 0); + Loop_Actor_Walk_To_XYZ(0, -530.0f, -6.5f, 241.0f, 0, 0, true, 0); + Game_Flag_Reset(176); + Game_Flag_Reset(182); + Game_Flag_Reset(179); + Game_Flag_Reset(178); + Game_Flag_Reset(180); + Game_Flag_Reset(261); + Game_Flag_Reset(177); + Game_Flag_Reset(258); + int spinnerDest = Spinner_Interface_Choose_Dest(-1, 0); + + switch (spinnerDest) { + case 0: + Game_Flag_Set(178); + Game_Flag_Reset(247); + Game_Flag_Reset(248); + Game_Flag_Set(251); + Set_Enter(61, 65); + Scene_Loop_Start_Special(1, 5, 1); + break; + case 1: + Game_Flag_Set(179); + Game_Flag_Reset(247); + Game_Flag_Reset(248); + Game_Flag_Set(250); + Set_Enter(49, 48); + Scene_Loop_Start_Special(1, 5, 1); + break; + case 2: + Game_Flag_Set(182); + Game_Flag_Reset(247); + Game_Flag_Reset(248); + Game_Flag_Set(249); + Set_Enter(69, 78); + Scene_Loop_Start_Special(1, 5, 1); + break; + case 4: + Game_Flag_Set(180); + Game_Flag_Reset(247); + Game_Flag_Reset(248); + Game_Flag_Set(252); + Set_Enter(0, 0); + Scene_Loop_Start_Special(1, 5, 1); + break; + case 5: + Game_Flag_Set(261); + Game_Flag_Reset(248); + Game_Flag_Reset(247); + Game_Flag_Set(307); + Set_Enter(17, 82); + Scene_Loop_Start_Special(1, 5, 1); + break; + case 6: + Game_Flag_Set(177); + Game_Flag_Reset(247); + Game_Flag_Reset(248); + Game_Flag_Set(253); + Set_Enter(7, 25); + Scene_Loop_Start_Special(1, 5, 1); + break; + case 7: + Game_Flag_Set(258); + Game_Flag_Reset(247); + Game_Flag_Reset(248); + Game_Flag_Set(254); + Set_Enter(20, 2); + Scene_Loop_Start_Special(1, 5, 1); + break; + case 8: + Game_Flag_Set(181); + Game_Flag_Reset(247); + Game_Flag_Reset(248); + Game_Flag_Set(255); + Set_Enter(54, 54); + Scene_Loop_Start_Special(1, 5, 1); + break; + case 9: + Game_Flag_Set(257); + Game_Flag_Reset(247); + Game_Flag_Reset(248); + Game_Flag_Set(256); + Set_Enter(37, 34); + Scene_Loop_Start_Special(1, 5, 1); + break; + default: + Game_Flag_Set(176); + Player_Loses_Control(); + Loop_Actor_Walk_To_XYZ(0, -530.0f, -6.5f, 241.0f, 0, 0, true, 0); + Loop_Actor_Walk_To_XYZ(0, -330.0f, -6.5f, 221.0f, 0, 0, true, 0); + Loop_Actor_Walk_To_XYZ(0, -314.0f, -6.5f, 326.0f, 0, 0, false, 0); + Player_Gains_Control(); + break; + } + } + return true; + } + return false; +} + +bool SceneScriptCT01::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptCT01::SceneFrameAdvanced(int frame) { + if ((frame < 316 || frame > 435) && !((frame - 1) % 10)) { + /*int v1; + int v2 = Random_Query(0, 1); + if (v2 <= 1) { + if (v2) { + v1 = 60; + } else { + v1 = 59; + } + }*/ + Ambient_Sounds_Play_Sound(/*v1*/Random_Query(59, 60), 25, 30, 30, 0); + } + if (frame == 23) { + Ambient_Sounds_Play_Sound(118, 40, 99, 0, 0); + } + if (frame == 316) { + Ambient_Sounds_Play_Sound(373, 50, -50, 100, 99); + } + if (frame == 196 || frame == 452) { + int v3 = Random_Query(0, 6); + if (v3 == 0) { + Overlay_Play("ct01spnr", 0, 0, 1, 0); + if (Random_Query(0, 1)) { + Ambient_Sounds_Play_Sound(68, Random_Query(33, 50), 0, 0, 0); + } else { + Ambient_Sounds_Play_Sound(67, Random_Query(33, 50), 0, 0, 0); + } + } else if (v3 == 1) { + Overlay_Play("ct01spnr", 1, 0, 1, 0); + if (Random_Query(0, 1)) { + Ambient_Sounds_Play_Sound(69, Random_Query(33, 50), 0, 0, 0); + } else { + Ambient_Sounds_Play_Sound(66, Random_Query(33, 50), 0, 0, 0); + } + + } + } +} + +void SceneScriptCT01::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptCT01::PlayerWalkedIn() { + if (Game_Flag_Query(234)) { + Loop_Actor_Walk_To_XYZ(0, -327.2f, -6.5f, 352.28f, 0, 0, false, 0); + Game_Flag_Reset(234); + } else { + if (!Game_Flag_Query(247)) { + Game_Flag_Reset(247); + } + Loop_Actor_Walk_To_XYZ(0, -330.0f, -6.5f, 221.0f, 0, 0, false, 0); + Loop_Actor_Walk_To_XYZ(0, -314.0f, -6.5f, 326.0f, 0, 0, false, 0); + if (!Game_Flag_Query(25)) { + Game_Flag_Set(25); + if (!Game_Flag_Query(378)) { + Actor_Voice_Over(200, 99); + Actor_Voice_Over(210, 99); + Actor_Voice_Over(220, 99); + } + } + } +} + +void SceneScriptCT01::PlayerWalkedOut() { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + if (Game_Flag_Query(123)) { + Ambient_Sounds_Remove_Looping_Sound(55, true); + Ambient_Sounds_Remove_Looping_Sound(56, true); + } else { + Ambient_Sounds_Remove_All_Looping_Sounds(1); + } + Music_Stop(5); + if (!Game_Flag_Query(176) && Global_Variable_Query(1)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Outtake_Play(38, 1, -1); + } +} + +void SceneScriptCT01::DialogueQueueFlushed(int a1) { +} + +void SceneScriptCT01::sub_40269C() { + Dialogue_Menu_Clear_List(); + if (Actor_Clue_Query(0, 13)) { + DM_Add_To_List_Never_Repeat_Once_Selected(40, 4, 5, 6); + } + if ((Actor_Clue_Query(0, 8) || Actor_Clue_Query(0, 9)) && !Game_Flag_Query(27)) { + DM_Add_To_List_Never_Repeat_Once_Selected(50, 5, 5, 4); + } + if (Actor_Clue_Query(0, 8) && Actor_Clue_Query(0, 9) && Game_Flag_Query(27) && !Game_Flag_Query(28)) { + DM_Add_To_List_Never_Repeat_Once_Selected(60, 3, 5, 5); + } + if (Game_Flag_Query(293)) { + DM_Add_To_List_Never_Repeat_Once_Selected(80, 9, 9, 9); + } else if (Game_Flag_Query(29)) { + DM_Add_To_List_Never_Repeat_Once_Selected(80, 3, 4, 8); + } + if (Actor_Clue_Query(0, 30) && Actor_Clue_Query(0, 40) == 1) { + DM_Add_To_List_Never_Repeat_Once_Selected(90, 5, 4, 5); + } + DM_Add_To_List_Never_Repeat_Once_Selected(70, 7, 3, -1); + Dialogue_Menu_Add_DONE_To_List(100); + Dialogue_Menu_Appear(320, 240); + int answer = Dialogue_Menu_Query_Input(); + Dialogue_Menu_Disappear(); + switch (answer) { + case 40: + Actor_Says(0, 265, 11); + Actor_Says(28, 20, 14); + if (Actor_Query_Is_In_Current_Set(19)) { + if (!Actor_Query_Goal_Number(19)) { + Actor_Face_Actor(28, 19, true); + Actor_Says(28, 120, 14); + Actor_Face_Actor(19, 28, true); + Actor_Says(19, 40, 18); + Actor_Face_Heading(19, 103, false); + Actor_Face_Actor(28, 0, true); + Actor_Modify_Friendliness_To_Other(19, 0, -2); + if (Actor_Query_Is_In_Current_Set(2)) { + Actor_Modify_Friendliness_To_Other(2, 0, -3); + Actor_Clue_Acquire(2, 213, 1, 0); + } + } + } + break; + case 50: + if (Actor_Clue_Query(0, 8) == 1) { + Actor_Says(0, 270, 11); + Actor_Says(28, 30, 16); + } else { + Actor_Says(0, 280, 11); + Actor_Says(28, 40, 14); + } + Game_Flag_Set(27); + break; + case 60: + if (Actor_Clue_Query(0, 9) == 1) { + Actor_Says(0, 270, 11); + Actor_Says(28, 40, 15); + } else { + Actor_Says(0, 270, 11); + Actor_Says(28, 30, 14); + } + Actor_Modify_Friendliness_To_Other(28, 0, 5); + Game_Flag_Set(28); + break; + case 70: + Actor_Says(0, 290, 13); + if (Actor_Query_Friendliness_To_Other(28, 0) > 49 && (Global_Variable_Query(2) > 10 || Query_Difficulty_Level() == 0)) { + Actor_Says(28, 50, 3); + Actor_Says(28, 60, 3); + Actor_Face_Actor(28, 0, true); + Actor_Says(28, 70, 16); + Actor_Says(0, 325, 13); + if (Query_Difficulty_Level() != 0) { + Global_Variable_Decrement(2, 10); + } + Game_Flag_Set(192); + } else { + Actor_Says(28, 130, 15); + } + break; + case 80: + Actor_Says(0, 295, 11); + Actor_Says(28, 90, 14); + Actor_Says(28, 100, 13); + Actor_Clue_Acquire(0, 25, 1, 28); + Actor_Modify_Friendliness_To_Other(28, 0, -3); + break; + case 90: + Actor_Says(0, 300, 13); + Actor_Says(28, 110, 16); + break; + case 100: + Actor_Says(0, 305, 18); + break; + } +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ct02.cpp b/engines/bladerunner/script/scene/ct02.cpp new file mode 100644 index 0000000000..111ad640d6 --- /dev/null +++ b/engines/bladerunner/script/scene/ct02.cpp @@ -0,0 +1,294 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptCT02::InitializeScene() { + if (Game_Flag_Query(70)) { + Game_Flag_Reset(70); + Setup_Scene_Information(-154.83f, -145.11f, 9.39f, 516); + } else if (Game_Flag_Query(720)) { + Setup_Scene_Information(-213.82f, -145.11f, 214.43f, 82); + } else { + Setup_Scene_Information(-119.02f, -145.11f, 240.99f, 768); + } + Scene_Exit_Add_2D_Exit(0, 590, 0, 639, 479, 1); + if (Actor_Clue_Query(0, 18)) { + Scene_Exit_Add_2D_Exit(1, 332, 163, 404, 297, 0); + } else { + Overlay_Play("ct02over", 0, 1, 0, 0); + } + Ambient_Sounds_Add_Looping_Sound(96, 25, 0, 1); + Ambient_Sounds_Add_Looping_Sound(56, 38, 100, 1); + Ambient_Sounds_Add_Looping_Sound(95, 32, 0, 1); + Ambient_Sounds_Add_Sound(61, 10, 30, 8, 8, 100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(62, 10, 30, 7, 7, 100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(63, 10, 30, 8, 8, 100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(64, 10, 30, 7, 7, 100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Speech_Sound(60, 0, 10, 260, 17, 19, 100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 20, 10, 260, 17, 19, 100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 40, 10, 260, 17, 19, 100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 50, 10, 260, 17, 19, 100, 100, -101, -101, 1, 1); + if (Game_Flag_Query(293)) { + Scene_Loop_Set_Default(3); + } else { + Scene_Loop_Set_Default(0); + } +} + +void SceneScriptCT02::SceneLoaded() { + Obstacle_Object("STOVE-1", true); + Unobstacle_Object("BACK-DOOR", true); + Unclickable_Object("STOVE-1"); + Unclickable_Object("STOVE-2"); + Unclickable_Object("STOVE-3"); + Unclickable_Object("STOVE-4"); + Unclickable_Object("BIGPOT"); + Unclickable_Object("SOUP-BOWL"); + Unclickable_Object("HOWCOUNTRM"); + Unclickable_Object("LFTSTOVE-1"); + Unclickable_Object("FRIDGE-1"); + Unclickable_Object("LEFTWALL"); + Unclickable_Object("RIGHTWALL"); + Unclickable_Object("BACKWALL"); + Unclickable_Object("TABLE-1"); + Unclickable_Object("COUNTER-2"); + Unclickable_Object("COFFEJUG IN FOREGRO"); + Unclickable_Object("BACK-DOOR"); + if (!Game_Flag_Query(293)) { + Preload(0); + Preload(3); + Preload(3); + Preload(28); + Preload(400); + Preload(419); + Preload(420); + } + if (Game_Flag_Query(720)) { + Game_Flag_Reset(720); + Actor_Change_Animation_Mode(0, 0); + Player_Set_Combat_Mode(true); + Player_Gains_Control(); + } +} + +bool SceneScriptCT02::MouseClick(int x, int y) { + if (Actor_Query_Goal_Number(19) == 8) { + Actor_Set_Goal_Number(0, 1); + return true; + } + return false; +} + +bool SceneScriptCT02::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +void SceneScriptCT02::sub_401ACC() { + Dialogue_Menu_Clear_List(); + if (Actor_Clue_Query(0, 13)) { + DM_Add_To_List_Never_Repeat_Once_Selected(270, 8, 5, 3); + } + if (Actor_Clue_Query(0, 22) && !Actor_Clue_Query(0, 13)) { + DM_Add_To_List_Never_Repeat_Once_Selected(280, 8, 5, 3); + } + int v0 = 0; + if (Actor_Clue_Query(0, 2)) { + v0 = 1; + } + if (Actor_Clue_Query(0, 10)) { + ++v0; + } + if (Actor_Clue_Query(0, 3)) { + ++v0; + } + if (Actor_Clue_Query(0, 16)) { + ++v0; + } + if (Actor_Clue_Query(0, 25)) { + ++v0; + } + if (v0 > 3) { + DM_Add_To_List_Never_Repeat_Once_Selected(290, -1, 4, 8); + } + Dialogue_Menu_Add_DONE_To_List(300); + Dialogue_Menu_Appear(320, 240); + int answerValue = Dialogue_Menu_Query_Input(); + Dialogue_Menu_Disappear(); + switch (answerValue) { + case 270: + Actor_Says(0, 380, 11); + Actor_Says(19, 30, 17); + Actor_Says(19, 40, 15); + Actor_Says(0, 410, 9); + Actor_Says(19, 50, 18); + Actor_Says(0, 415, 10); + Actor_Clue_Acquire(0, 19, 0, -1); + Actor_Modify_Friendliness_To_Other(19, 0, -5); + if (Actor_Query_Friendliness_To_Other(19, 0) < 44) { + Scene_Exits_Disable(); + Actor_Clue_Acquire(0, 18, 1, -1); + Actor_Set_Goal_Number(19, 8); + Game_Flag_Set(293); + Scene_Loop_Set_Default(3); + Scene_Loop_Start_Special(2, 2, 1); + } + break; + case 280: + Actor_Says(0, 385, 9); + Actor_Says(19, 40, 19); + Actor_Modify_Friendliness_To_Other(19, 0, -2); + if (Actor_Query_Friendliness_To_Other(19, 0) < 44) { + Scene_Exits_Disable(); + Actor_Clue_Acquire(0, 18, 1, -1); + Actor_Set_Goal_Number(19, 8); + Game_Flag_Set(293); + Scene_Loop_Set_Default(3); + Scene_Loop_Start_Special(2, 2, 1); + } + break; + case 290: + Actor_Says(0, 395, 9); + Actor_Says(0, 400, 9); + Actor_Says(19, 70, 17); + Actor_Says(0, 420, 10); + Actor_Says(19, 80, 14); + Actor_Modify_Friendliness_To_Other(19, 0, -10); + if (Actor_Query_Friendliness_To_Other(19, 0) < 44) { + Scene_Exits_Disable(); + Actor_Clue_Acquire(0, 18, 1, -1); + Actor_Set_Goal_Number(19, 8); + Game_Flag_Set(293); + Scene_Loop_Set_Default(3); + Scene_Loop_Start_Special(2, 2, 1); + } + break; + case 300: + Actor_Says(0, 405, 11); + if (Actor_Query_Friendliness_To_Other(19, 0) < 44) { + Scene_Exits_Disable(); + Actor_Clue_Acquire(0, 18, 1, -1); + Actor_Set_Goal_Number(19, 8); + Game_Flag_Set(293); + Scene_Loop_Set_Default(3); + Scene_Loop_Start_Special(2, 2, 1); + } + break; + } +} + +bool SceneScriptCT02::ClickedOnActor(int actorId) { + if (actorId == 19 && Actor_Query_Goal_Number(19) == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -255.02f, -145.11f, 212.42f, 0, 1, false, 0)) { + Actor_Face_Actor(0, 19, true); + Actor_Face_Actor(19, 0, true); + if (!Game_Flag_Query(59)) { + Actor_Says(0, 370, 10); + Actor_Says(19, 20, 19); + Actor_Says(0, 375, 9); + Game_Flag_Set(59); + } + sub_401ACC(); + return true; + } + } + return false; +} + +bool SceneScriptCT02::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptCT02::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -111.2f, -145.11f, 243.28f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(234); + Game_Flag_Set(68); + Set_Enter(4, 13); + } + return true; + } + if (exitId == 1) { + bool v1; + if (Player_Query_Combat_Mode()) { + v1 = Loop_Actor_Walk_To_XYZ(0, -154.83f, -145.11f, -82.61f, 0, 1, true, 0); + } else { + v1 = Loop_Actor_Walk_To_XYZ(0, -154.83f, -145.11f, -82.61f, 0, 1, false, 0); + } + if (!v1) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(69); + Set_Enter(5, 15); + } + return true; + } + return false; +} + +bool SceneScriptCT02::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptCT02::SceneFrameAdvanced(int frame) { + if (frame == 6 || frame == 12 || frame == 19 || frame == 25 || frame == 46 || frame == 59) { + Sound_Play(97, Random_Query(25, 33), -70, -70, 50); + } + if (frame == 72) { + Sound_Play(200, 50, 0, 0, 50); + } + if (frame == 71) { + Sound_Play(204, 40, 0, 0, 50); + } + if (frame == 72) { + Sound_Play(203, 60, -20, 40, 50); + } + if (frame == 61) { + Music_Play(1, 50, 0, 2, -1, 0, 0); + } + if (frame == 81) { + Scene_Exit_Add_2D_Exit(1, 332, 163, 404, 297, 0); + Scene_Exits_Enable(); + } +} + +void SceneScriptCT02::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptCT02::PlayerWalkedIn() { +} + +void SceneScriptCT02::PlayerWalkedOut() { + if (Actor_Clue_Query(0, 18)) { + return; + } + Overlay_Remove("ct02over"); +} + +void SceneScriptCT02::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ct03.cpp b/engines/bladerunner/script/scene/ct03.cpp new file mode 100644 index 0000000000..5b18a239b5 --- /dev/null +++ b/engines/bladerunner/script/scene/ct03.cpp @@ -0,0 +1,132 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptCT03::InitializeScene() { + if (Game_Flag_Query(719)) { + Setup_Scene_Information(-852.58f, -621.3f, 285.6f, 0); + } else if (Game_Flag_Query(69)) { + Game_Flag_Reset(69); + Setup_Scene_Information(-557.1f, -616.31f, 224.29f, 249); + } else if (Game_Flag_Query(73)) { + Game_Flag_Reset(73); + Setup_Scene_Information(-173.99f, -619.19f, 347.54f, 808); + } else { + Setup_Scene_Information(-708.58f, -619.19f, 277.6f, 239); + } + Scene_Exit_Add_2D_Exit(0, 0, 460, 639, 479, 2); + Scene_Exit_Add_2D_Exit(1, 40, 40, 134, 302, 3); + Scene_Exit_Add_2D_Exit(2, 390, 0, 539, 230, 1); + Ambient_Sounds_Add_Looping_Sound(54, 50, 1, 1); + Ambient_Sounds_Add_Looping_Sound(56, 22, -100, 1); + Ambient_Sounds_Add_Looping_Sound(105, 34, -100, 1); + Ambient_Sounds_Add_Sound(68, 10, 40, 33, 50, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(69, 10, 40, 33, 50, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(61, 3, 30, 8, 10, -100, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(62, 3, 30, 8, 10, -100, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(63, 3, 30, 8, 10, -100, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(64, 3, 30, 8, 10, -100, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Speech_Sound(60, 0, 10, 260, 27, 47, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 20, 10, 260, 27, 47, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 40, 10, 260, 27, 47, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 50, 10, 260, 27, 47, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Sound(376, 10, 60, 33, 50, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(377, 10, 60, 33, 50, -100, 100, -101, -101, 0, 0); +} + +void SceneScriptCT03::SceneLoaded() { + Obstacle_Object("TRASH CAN", true); + Unclickable_Object("TRASH CAN"); + Footstep_Sounds_Set(0, 0); + Footstep_Sounds_Set(1, 1); +} + +bool SceneScriptCT03::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptCT03::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptCT03::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptCT03::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptCT03::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -745.09f, -619.09f, 293.36f, 0, 1, false, 0)) { + Game_Flag_Set(71); + Set_Enter(4, 13); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -604.38f, -616.15f, 221.6f, 0, 1, false, 0)) { + Game_Flag_Set(70); + Set_Enter(27, 14); + } + return true; + } + if (exitId == 2) { + if (!Loop_Actor_Walk_To_XYZ(0, -150.0f, -621.3f, 357.0f, 0, 1, false, 0)) { + Game_Flag_Set(72); + Async_Actor_Walk_To_XYZ(0, -67.0f, -621.3f, 477.0f, 0, false); + Set_Enter(5, 16); + } + return true; + } + return false; +} + +bool SceneScriptCT03::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptCT03::SceneFrameAdvanced(int frame) { +} + +void SceneScriptCT03::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptCT03::PlayerWalkedIn() { + if (Actor_Query_Goal_Number(19) == 2) { + Actor_Set_Goal_Number(19, 13); + } +} + +void SceneScriptCT03::PlayerWalkedOut() { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); +} + +void SceneScriptCT03::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ct04.cpp b/engines/bladerunner/script/scene/ct04.cpp new file mode 100644 index 0000000000..a8987bdffa --- /dev/null +++ b/engines/bladerunner/script/scene/ct04.cpp @@ -0,0 +1,237 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptCT04::InitializeScene() { + if (Game_Flag_Query(72)) { + Scene_Loop_Start_Special(0, 0, 0); + Scene_Loop_Set_Default(1); + Setup_Scene_Information(-150.0f, -621.3f, 357.0f, 533); + } else { + Scene_Loop_Set_Default(1); + Setup_Scene_Information(-82.86f, -621.3f, 769.03f, 1020); + } + Scene_Exit_Add_2D_Exit(0, 590, 0, 639, 479, 1); + Scene_Exit_Add_2D_Exit(1, 194, 84, 320, 274, 0); + Ambient_Sounds_Add_Looping_Sound(54, 50, 1, 1); + Ambient_Sounds_Add_Looping_Sound(56, 15, -100, 1); + Ambient_Sounds_Add_Looping_Sound(105, 34, 100, 1); + Ambient_Sounds_Add_Sound(68, 10, 40, 33, 50, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(69, 10, 40, 33, 50, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Speech_Sound(60, 0, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 20, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 40, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 50, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Sound(376, 10, 60, 33, 50, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(377, 10, 60, 33, 50, -100, 100, -101, -101, 0, 0); +} + +void SceneScriptCT04::SceneLoaded() { + Obstacle_Object("DUMPSTER", true); + Obstacle_Object("RIGHTWALL01", true); + Obstacle_Object("BACK-BLDNG", true); + Clickable_Object("DUMPSTER"); + Footstep_Sounds_Set(0, 1); + if (Game_Flag_Query(72)) { + Game_Flag_Reset(72); + } + if (!Actor_Query_Goal_Number(12)) { + Actor_Change_Animation_Mode(12, 38); + } +} + +bool SceneScriptCT04::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptCT04::ClickedOn3DObject(const char *objectName, bool a2) { + if (objectName) { + if (!Game_Flag_Query(137) && !Game_Flag_Query(169) && !Actor_Query_Goal_Number(12)) { + Game_Flag_Set(137); + Actor_Set_Goal_Number(12, 2); + } + if (Game_Flag_Query(169) && !Game_Flag_Query(170) && !Game_Flag_Query(171) && !Game_Flag_Query(172) && Global_Variable_Query(1) == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -147.41f, -621.3f, 724.57f, 0, 1, false, 0)) { + Player_Loses_Control(); + Actor_Face_Heading(0, 792, false); + Actor_Put_In_Set(12, 99); + Actor_Set_At_XYZ(12, 0, 0, 0, 0); + Actor_Change_Animation_Mode(0, 40); + Actor_Voice_Over(320, 99); + Actor_Voice_Over(330, 99); + Actor_Voice_Over(340, 99); + Game_Flag_Set(170); + Game_Flag_Set(173); + } + return false; + } + if (Game_Flag_Query(170)) { + if (Game_Flag_Query(172)) { + Actor_Voice_Over(270, 99); + Actor_Voice_Over(280, 99); + } else if (Game_Flag_Query(171)) { + Actor_Voice_Over(250, 99); + Actor_Voice_Over(260, 99); + } else { + Actor_Voice_Over(230, 99); + Actor_Voice_Over(240, 99); + Game_Flag_Reset(173); + } + return true; + } + if (Game_Flag_Query(174)) { + if (!Loop_Actor_Walk_To_Waypoint(0, 75, 0, 1, false)) { + Actor_Face_Heading(0, 707, false); + Actor_Change_Animation_Mode(0, 38); + Ambient_Sounds_Play_Sound(553, 45, 30, 30, 0); + Actor_Voice_Over(1810, 99); + Actor_Voice_Over(1820, 99); + return true; + } + return false; + } + if (!Loop_Actor_Walk_To_Waypoint(0, 75, 0, 1, false)) { + Actor_Face_Heading(0, 707, false); + Actor_Change_Animation_Mode(0, 38); + Actor_Clue_Acquire(0, 37, 1, -1); + Item_Pickup_Spin_Effect(952, 392, 225); + Game_Flag_Set(174); + return true; + } + } + return false; +} + +void SceneScriptCT04::sub_401D4C() { + Dialogue_Menu_Clear_List(); + if (Global_Variable_Query(2) > 10 || Query_Difficulty_Level() == 0) { + DM_Add_To_List_Never_Repeat_Once_Selected(410, 8, 4, -1); + } + DM_Add_To_List_Never_Repeat_Once_Selected(420, 2, 6, 8); + Dialogue_Menu_Appear(320, 240); + int answer = Dialogue_Menu_Query_Input(); + Dialogue_Menu_Disappear(); + if (answer == 410) { + Actor_Says(12, 10, 14); + Actor_Says(12, 20, 14); + Actor_Modify_Friendliness_To_Other(12, 0, 5); + if (Query_Difficulty_Level() != 0) { + Global_Variable_Decrement(2, 10); + } + } else if (answer == 420) { + Actor_Says(0, 430, 3); + Actor_Says(12, 30, 14); + Actor_Modify_Friendliness_To_Other(12, 0, -5); + } +} + +bool SceneScriptCT04::ClickedOnActor(int actorId) { + if (actorId == 12) { + if (Game_Flag_Query(169)) { + if (!Loop_Actor_Walk_To_Actor(0, 12, 36, 1, false)) { + Actor_Voice_Over(290, 99); + Actor_Voice_Over(300, 99); + Actor_Voice_Over(310, 99); + } + } else { + Actor_Set_Targetable(12, false); + if (!Loop_Actor_Walk_To_Actor(0, 12, 36, 1, false)) { + Actor_Face_Actor(0, 12, true); + if (!Game_Flag_Query(137)) { + if (Game_Flag_Query(40)) { + Actor_Says(0, 435, 3); + Actor_Set_Goal_Number(12, 2); + } else { + Music_Stop(3); + Actor_Says(0, 425, 3); + Actor_Says(12, 0, 13); + sub_401D4C(); + Actor_Set_Goal_Number(12, 2); + } + Game_Flag_Set(137); + } else { + Actor_Face_Actor(0, 12, true); + Actor_Says(0, 435, 3); + } + } + } + return true; + } + return false; +} + +bool SceneScriptCT04::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptCT04::ClickedOnExit(int exitId) { + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -82.86f, -621.3f, 769.03f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + if (!Actor_Query_Goal_Number(12)) { + Actor_Set_Goal_Number(12, 2); + } + Game_Flag_Set(74); + Set_Enter(28, 17); + } + return true; + } + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -187.0f, -621.3f, 437.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(73); + Set_Enter(5, 15); + } + return true; + } + return false; +} + +bool SceneScriptCT04::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptCT04::SceneFrameAdvanced(int frame) { + if (Game_Flag_Query(325)) { + Game_Flag_Reset(325); + Sound_Play(180, 100, 80, 80, 50); + } +} + +void SceneScriptCT04::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptCT04::PlayerWalkedIn() { +} + +void SceneScriptCT04::PlayerWalkedOut() { +} + +void SceneScriptCT04::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ct05.cpp b/engines/bladerunner/script/scene/ct05.cpp new file mode 100644 index 0000000000..9a0c334585 --- /dev/null +++ b/engines/bladerunner/script/scene/ct05.cpp @@ -0,0 +1,241 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptCT05::InitializeScene() { + if (Game_Flag_Query(90)) { + Game_Flag_Reset(90); + Setup_Scene_Information(-128.42f, -109.91f, 112.83f, 516); + } else if (Game_Flag_Query(78)) { + Setup_Scene_Information(192.35f, 43.09f, 128.97f, 768); + } else { + Setup_Scene_Information(-375.0f, -109.91f, 750.0f, 600); + } + if (Game_Flag_Query(94)) { + Scene_Exit_Add_2D_Exit(0, 228, 205, 293, 300, 0); + } + Scene_Exit_Add_2D_Exit(1, 320, 458, 639, 479, 2); + Scene_Exit_Add_2D_Exit(2, 380, 110, 542, 300, 0); + Ambient_Sounds_Add_Looping_Sound(106, 15, -100, 1); + Ambient_Sounds_Add_Looping_Sound(107, 15, 100, 1); + Ambient_Sounds_Add_Looping_Sound(56, 13, -100, 1); + Ambient_Sounds_Add_Sound(90, 5, 20, 8, 10, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(91, 5, 20, 8, 10, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(205, 5, 30, 18, 30, -100, 100, -101, -101, 0, 0); + if (Game_Flag_Query(94)) { + Scene_Loop_Set_Default(2); + } else { + Scene_Loop_Set_Default(0); + } + if (Actor_Query_Goal_Number(53) == 1) { + Overlay_Play("ct05over", 0, 1, 0, 0); + } +} + +void SceneScriptCT05::SceneLoaded() { + Obstacle_Object("STAIR 1", true); + Obstacle_Object("STAIR 2", true); + Obstacle_Object("GRGDOOR", true); + Obstacle_Object("GRGDOOR2", true); + Obstacle_Object("TURBINE", true); + Obstacle_Object("BARREL", true); + Obstacle_Object("GRNDPIPE", true); + Clickable_Object("TURBINE"); + Clickable_Object("LFTDOOR"); + Clickable_Object("BARREL"); + Clickable_Object("GRNDPIPE"); + Unclickable_Object("GDFRAME"); + Unclickable_Object("GDFRAME2"); + Unclickable_Object("WINFRAME1"); + Unclickable_Object("WINFRAME2"); + Unclickable_Object("STAIR 1"); + Unclickable_Object("STAIR 2"); + Unclickable_Object("LFTDOOR"); + Unclickable_Object("LFTDOORFRM"); +} + +bool SceneScriptCT05::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptCT05::ClickedOn3DObject(const char *objectName, bool a2) { + if (Object_Query_Click("STAIR1", objectName)) { + Actor_Face_Object(0, objectName, true); + return true; + } + if (Object_Query_Click("STAIR2", objectName)) { + Actor_Face_Object(0, objectName, true); + return true; + } + if (Object_Query_Click("GRGDOOR", objectName)) { + Loop_Actor_Walk_To_Scene_Object(0, "GRGDOOR", 24, 1, false); + Actor_Face_Object(0, objectName, true); + Actor_Says(0, 8522, 12); + return true; + } + if (Object_Query_Click("GRGDOOR2", objectName)) { + Loop_Actor_Walk_To_Scene_Object(0, "GRGDOOR2", 24, 1, false); + Actor_Face_Object(0, objectName, true); + Actor_Says(0, 8522, 12); + return true; + } + if (Object_Query_Click("TURBINE", objectName)) { + Loop_Actor_Walk_To_Scene_Object(0, "TURBINE", 36, 1, false); + Actor_Face_Object(0, objectName, true); + Actor_Says(0, 8528, 12); + return true; + } + if (Object_Query_Click("LFTDOOR", objectName)) { + Actor_Face_Object(0, objectName, true); + Actor_Says(0, 8522, 12); + return true; + } + if (Object_Query_Click("BARREL", objectName)) { + Loop_Actor_Walk_To_Scene_Object(0, "BARREL", 36, 1, false); + Actor_Face_Object(0, objectName, true); + Actor_Says(0, 8529, 12); + return true; + } + if (Object_Query_Click("GRNDPIPE", objectName)) { + Loop_Actor_Walk_To_Scene_Object(0, "GRNDPIPE", 24, 1, false); + Actor_Face_Object(0, objectName, true); + Actor_Says(0, 8528, 12); + return true; + } + return false; +} + +bool SceneScriptCT05::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptCT05::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptCT05::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -128.42f, -109.91f, 112.83f, 0, 1, false, 0)) { + Game_Flag_Set(76); + if (Actor_Query_Goal_Number(53) == 1) { + Overlay_Remove("ct05over"); + } + Set_Enter(4, 24); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -308.18f, -109.91f, 674.77f, 0, 1, false, 0)) { + Game_Flag_Set(75); + if (Actor_Query_Goal_Number(53) == 1) { + Overlay_Remove("ct05over"); + Actor_Set_Goal_Number(53, 5); + Game_Flag_Set(409); + } + Set_Enter(5, 16); + } + return true; + } + if (exitId == 2) { + if (!Loop_Actor_Walk_To_XYZ(0, 71.99f, -109.91f, 288.79f, 0, 1, false, 0)) { + Footstep_Sound_Override_On(2); + Actor_Face_Object(0, "STAIR 2", true); + Loop_Actor_Travel_Stairs(0, 9, 1, 0); + Actor_Set_At_XYZ(0, 99.73f, -19.91f, 134.97f, 256); + Loop_Actor_Travel_Stairs(0, 5, 1, 0); + Footstep_Sound_Override_Off(); + Game_Flag_Set(77); + if (Actor_Query_Goal_Number(53) == 1) { + Overlay_Remove("ct05over"); + } + Set_Enter(29, 18); + } + return true; + } + return false; +} + +bool SceneScriptCT05::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptCT05::SceneFrameAdvanced(int frame) { + if (frame == 7 || frame == 15 || frame == 29) { + switch (Random_Query(0, 4)) { + case 4: + Sound_Play(40, Random_Query(25, 50), -70, -70, 50); + break; + case 3: + Sound_Play(44, Random_Query(25, 50), -70, -70, 50); + break; + case 2: + Sound_Play(43, Random_Query(25, 50), -70, -70, 50); + break; + case 1: + Sound_Play(42, Random_Query(25, 50), -70, -70, 50); + break; + case 0: + Sound_Play(41, Random_Query(25, 50), -70, -70, 50); + break; + } + } +} + +void SceneScriptCT05::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptCT05::PlayerWalkedIn() { + if (Game_Flag_Query(74)) { + Player_Loses_Control(); + Game_Flag_Reset(74); + if (Player_Query_Combat_Mode()) { + Loop_Actor_Walk_To_XYZ(0, -308.18f, -109.91f, 674.77f, 0, 0, true, 0); + } else { + Loop_Actor_Walk_To_XYZ(0, -308.18f, -109.91f, 674.77f, 0, 0, false, 0); + } + Player_Gains_Control(); + } + if (Game_Flag_Query(78)) { + Footstep_Sound_Override_On(2); + Loop_Actor_Travel_Stairs(0, 7, 0, 0); + Actor_Set_At_XYZ(0, 90.73f, -19.91f, 164.97f, 520); + Loop_Actor_Travel_Stairs(0, 10, 0, 0); + Game_Flag_Reset(78); + Footstep_Sound_Override_Off(); + if (Actor_Query_Goal_Number(2) == 2 && Game_Flag_Query(145)) { + Actor_Set_Goal_Number(2, 3); + } + } +} + +void SceneScriptCT05::PlayerWalkedOut() { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); +} + +void SceneScriptCT05::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ct06.cpp b/engines/bladerunner/script/scene/ct06.cpp new file mode 100644 index 0000000000..f334bd0132 --- /dev/null +++ b/engines/bladerunner/script/scene/ct06.cpp @@ -0,0 +1,180 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptCT06::InitializeScene() { + if (Game_Flag_Query(77)) { + Setup_Scene_Information(20.41f, -58.23f, 2.17f, 247); + Game_Flag_Reset(77); + } else if (Game_Flag_Query(144)) { + Setup_Scene_Information(203.91f, -58.02f, 0.47f, 768); + } else { + Setup_Scene_Information(175.91f, -58.23f, 24.47f, 768); + } + Scene_Exit_Add_2D_Exit(0, 0, 440, 639, 479, 2); + Scene_Exit_Add_2D_Exit(1, 401, 162, 536, 317, 0); + if (Game_Flag_Query(40) && Actor_Query_In_Set(19, 30)) { + Actor_Put_In_Set(19, 29); + Actor_Set_At_XYZ(19, 58.41f, -58.23f, -24.97f, 240); + Actor_Retired_Here(19, 72, 36, 1, 0); + } + Ambient_Sounds_Add_Looping_Sound(381, 100, 1, 1); + Ambient_Sounds_Add_Looping_Sound(205, 20, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 0, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 20, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 40, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 50, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Sound(67, 80, 180, 16, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(68, 50, 180, 16, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(379, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(380, 70, 180, 50, 100, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(377, 60, 180, 50, 100, 0, 0, -101, -101, 0, 0); + if (Actor_Query_Goal_Number(19) == 13) { + Ambient_Sounds_Add_Sound(196, 1, 5, 25, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(197, 1, 5, 25, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(198, 1, 5, 25, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(199, 1, 5, 25, 25, -100, 100, -101, -101, 0, 0); + } +} + +void SceneScriptCT06::SceneLoaded() { + Obstacle_Object("BOX02", true); + Obstacle_Object("CB BOX01", true); + Obstacle_Object("CB BOX02", true); + Obstacle_Object("CB BOX03", true); + Unobstacle_Object("INSULPIP01", true); + Unobstacle_Object("CB BOX04", true); + Unclickable_Object("DOOR"); + if (Actor_Query_Goal_Number(19) == 13) { + Preload(3); + Preload(4); + Preload(389); + Preload(390); + Preload(398); + Preload(421); + Preload(421); + } +} + +bool SceneScriptCT06::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptCT06::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptCT06::ClickedOnActor(int actorId) { + if (actorId == 19) { + Loop_Actor_Walk_To_Actor(0, 19, 24, 1, false); + Actor_Face_Actor(0, 19, true); + if (Game_Flag_Query(145)) { + Actor_Says(0, 8570, 13); + return false; + } + Actor_Clue_Acquire(0, 20, 1, -1); + Item_Pickup_Spin_Effect(984, 340, 369); + Actor_Voice_Over(350, 99); + Actor_Voice_Over(360, 99); + Actor_Voice_Over(370, 99); + if (!Game_Flag_Query(378)) { + Actor_Voice_Over(380, 99); + Actor_Voice_Over(390, 99); + Actor_Voice_Over(400, 99); + Actor_Voice_Over(410, 99); + } + Game_Flag_Set(145); + return true; + } + return false; +} + +bool SceneScriptCT06::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptCT06::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, 20.41f, -58.23f, -2.17f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(78); + Set_Enter(28, 17); + Game_Flag_Reset(212); + } + return true; + } + if (exitId == 1) { + if (Actor_Query_Goal_Number(19) == 13) { + if (!Loop_Actor_Walk_To_XYZ(0, 203.91f, -58.02f, 0.47f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_Sound(196, true); + Ambient_Sounds_Remove_Sound(197, true); + Ambient_Sounds_Remove_Sound(198, true); + Ambient_Sounds_Remove_Sound(199, true); + Player_Loses_Control(); + Actor_Set_Goal_Number(19, 11); + Game_Flag_Reset(212); + } + return true; + } + if (!Loop_Actor_Walk_To_XYZ(0, 203.91f, -58.02f, 0.47f, 0, 1, false, 0)) { + if (Global_Variable_Query(1) < 3) { + Actor_Face_Object(0, "DOOR", true); + Actor_Says(0, 8522, 12); + } else { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(79); + Set_Enter(6, 20); + Game_Flag_Reset(212); + } + } + } + return false; +} + +bool SceneScriptCT06::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptCT06::SceneFrameAdvanced(int frame) { +} + +void SceneScriptCT06::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptCT06::PlayerWalkedIn() { + if (Game_Flag_Query(144) == 1) { + Game_Flag_Reset(144); + } +} + +void SceneScriptCT06::PlayerWalkedOut() { +} + +void SceneScriptCT06::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ct07.cpp b/engines/bladerunner/script/scene/ct07.cpp new file mode 100644 index 0000000000..8ee2412368 --- /dev/null +++ b/engines/bladerunner/script/scene/ct07.cpp @@ -0,0 +1,104 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptCT07::InitializeScene() { + Setup_Scene_Information(202.32f, -58.23f, -12.86f, 225); + Actor_Put_In_Set(19, 30); + Actor_Set_At_XYZ(19, -9.68f, -58.23f, 11.14f, 250); + Ambient_Sounds_Add_Looping_Sound(54, 30, 90, 1); + Ambient_Sounds_Add_Looping_Sound(205, 20, 1, 1); + Ambient_Sounds_Add_Looping_Sound(56, 40, 100, 1); + Ambient_Sounds_Add_Speech_Sound(60, 0, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 20, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 40, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 50, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Sound(67, 80, 180, 16, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(68, 50, 180, 16, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(379, 10, 60, 50, 100, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(375, 6, 50, 50, 100, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(377, 10, 70, 50, 100, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(61, 10, 30, 12, 14, 100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(62, 10, 30, 12, 14, 100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(63, 10, 30, 12, 14, 100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(64, 10, 30, 12, 14, 100, 100, -101, -101, 0, 0); +} + +void SceneScriptCT07::SceneLoaded() { + Obstacle_Object("BOX01", true); + Obstacle_Object("BOX02", true); + Obstacle_Object("BOX03", true); + Obstacle_Object("BOX04", true); + Unclickable_Object("BOX01"); + Unclickable_Object("BOX02"); + Unclickable_Object("BOX03"); + Unclickable_Object("BOX04"); +} + +bool SceneScriptCT07::MouseClick(int x, int y) { + return true; +} + +bool SceneScriptCT07::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptCT07::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptCT07::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptCT07::ClickedOnExit(int exitId) { + return false; +} + +bool SceneScriptCT07::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptCT07::SceneFrameAdvanced(int frame) { +} + +void SceneScriptCT07::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptCT07::PlayerWalkedIn() { + Player_Gains_Control(); + Non_Player_Actor_Combat_Mode_On(19, 0, 0, 0, 2, 4, 7, 8, 0, 0, 100, 15, 300, 0); + Game_Flag_Set(516); + Actor_Face_Actor(0, 19, true); +} + +void SceneScriptCT07::PlayerWalkedOut() { + Music_Stop(2); +} + +void SceneScriptCT07::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ct08.cpp b/engines/bladerunner/script/scene/ct08.cpp new file mode 100644 index 0000000000..17cd8e5e61 --- /dev/null +++ b/engines/bladerunner/script/scene/ct08.cpp @@ -0,0 +1,196 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptCT08::InitializeScene() { + if (Game_Flag_Query(679)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Outtake_Play(2, 0, -1); + if (Game_Flag_Query(46)) { + Outtake_Play(3, 0, -1); + } else if (Game_Flag_Query(47)) { + Outtake_Play(4, 0, -1); + } else { + Outtake_Play(5, 0, -1); + } + Outtake_Play(6, 0, -1); + Game_Flag_Reset(679); + } + Actor_Force_Stop_Walking(0); + if (Game_Flag_Query(380)) { + Setup_Scene_Information(-11.0f, 0.0f, -156.0f, 769); + } else if (Game_Flag_Query(79)) { + Setup_Scene_Information(-143.0f, 0.0f, -92.0f, 420); + } else { + Setup_Scene_Information(-183.0f, 0.0f, 128.0f, 205); + } + Scene_Exit_Add_2D_Exit(0, 0, 0, 30, 479, 3); + Scene_Exit_Add_2D_Exit(1, 389, 0, 639, 303, 0); + Scene_Exit_Add_2D_Exit(2, 115, 87, 137, 267, 3); + if (Game_Flag_Query(550)) { + Scene_2D_Region_Add(0, 185, 185, 230, 230); + } + Ambient_Sounds_Add_Looping_Sound(381, 100, 1, 1); + Ambient_Sounds_Add_Looping_Sound(205, 20, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 0, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 20, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 40, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 50, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Sound(67, 80, 180, 16, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(68, 50, 180, 16, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(379, 5, 180, 50, 100, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(380, 5, 180, 50, 100, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(377, 5, 180, 50, 100, 0, 0, -101, -101, 0, 0); + if (Game_Flag_Query(380)) { + Scene_Loop_Start_Special(0, 0, 0); + Scene_Loop_Set_Default(1); + } else { + Scene_Loop_Set_Default(1); + } +} + +void SceneScriptCT08::SceneLoaded() { + Obstacle_Object("ASHTRAY", 1); + Unobstacle_Object("BLANKET03", 1); + if (!Actor_Clue_Query(0, 85)) { + Item_Add_To_World(85, 943, 6, 44.0f, 0.0f, -95.0f, 540, 12, 12, 0, 1, 0, 1); + } + if (!Actor_Clue_Query(0, 87)) { + Item_Add_To_World(81, 936, 6, -102.0f, 2.0f, 41.0f, 432, 6, 6, 0, 1, 0, 1); + } +} + +bool SceneScriptCT08::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptCT08::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptCT08::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptCT08::ClickedOnItem(int itemId, bool a2) { + if (itemId == 81) { + if (!Loop_Actor_Walk_To_Item(0, 81, 36, 1, 0) && !Game_Flag_Query(550)) { + Actor_Clue_Acquire(0, 87, 1, -1); + Item_Pickup_Spin_Effect(936, 266, 328); + Item_Remove_From_World(81); + Actor_Voice_Over(480, 99); + Actor_Voice_Over(490, 99); + Actor_Voice_Over(500, 99); + } + return true; + } + return false; +} + +bool SceneScriptCT08::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -183.0f, 0.0f, 128.0f, 0, 1, 0, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(81); + Set_Enter(31, 21); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -11.0f, 0.0f, -156.0f, 0, 1, 0, 0)) { + Loop_Actor_Walk_To_XYZ(0, 0.0f, 0.0f, -102.0f, 0, 0, 0, 0); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(379); + Set_Enter(6, 105); + } + return true; + } + if (exitId == 2) { + if (!Loop_Actor_Walk_To_XYZ(0, -143.0f, 0.0f, -92.0f, 0, 1, 0, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(80); + Set_Enter(29, 18); + } + return true; + } + return false; +} + +bool SceneScriptCT08::ClickedOn2DRegion(int region) { + if (region == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -108.0f, 0.0f, -178.0f, 0, 1, 0, 0)) { + Actor_Face_Heading(0, 512, 0); + Game_Flag_Reset(550); + Player_Set_Combat_Mode_Access(1); + Scene_Exits_Enable(); + Ambient_Sounds_Play_Sound(564, 40, 99, 0, 0); + Scene_2D_Region_Remove(0); + Player_Loses_Control(); + } + return true; + } + return false; +} + +void SceneScriptCT08::SceneFrameAdvanced(int frame) { +} + +void SceneScriptCT08::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptCT08::PlayerWalkedIn() { + if (Game_Flag_Query(550)) { + Actor_Change_Animation_Mode(0, 3); + Actor_Change_Animation_Mode(0, 0); + Actor_Set_At_XYZ(0, -148.0f, 0.0f, 4.0f, 256); + Player_Set_Combat_Mode_Access(0); + Scene_Exits_Disable(); + Game_Flag_Reset(380); + Game_Flag_Reset(79); + Autosave_Game(1); + } else if (Game_Flag_Query(380)) { + Game_Flag_Reset(380); + } else if (Game_Flag_Query(79)) { + Game_Flag_Reset(79); + } else { + Loop_Actor_Walk_To_XYZ(0, -156.0f, 0.0f, 128.0f, 0, 0, 0, 0); + Game_Flag_Reset(84); + } +} + +void SceneScriptCT08::PlayerWalkedOut() { + if (!Actor_Clue_Query(0, 85)) { + Item_Remove_From_World(85); + } +} + +void SceneScriptCT08::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ct09.cpp b/engines/bladerunner/script/scene/ct09.cpp new file mode 100644 index 0000000000..0d70b5f13f --- /dev/null +++ b/engines/bladerunner/script/scene/ct09.cpp @@ -0,0 +1,214 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptCT09::InitializeScene() { + if (Game_Flag_Query(85)) { + Setup_Scene_Information(160.0f, 349.0f, 587.0f, 490); + } else if (Game_Flag_Query(81)) { + Setup_Scene_Information(235.0f, 3348.52f, 599.0f, 800); + } else { + Setup_Scene_Information(107.0f, 348.52f, 927.0f, 200); + } + Scene_Exit_Add_2D_Exit(0, 321, 164, 345, 309, 1); + Scene_Exit_Add_2D_Exit(1, 0, 0, 15, 479, 3); + Scene_Exit_Add_2D_Exit(2, 198, 177, 263, 311, 0); + Ambient_Sounds_Add_Looping_Sound(336, 28, 0, 1); + Ambient_Sounds_Add_Sound(375, 6, 180, 33, 33, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(376, 5, 180, 33, 33, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(377, 5, 180, 33, 33, 0, 0, -101, -101, 0, 0); +} + +void SceneScriptCT09::SceneLoaded() { + Obstacle_Object("PHONE01", true); + Unobstacle_Object("MAINBEAM01", true); + Unobstacle_Object("MIDDLE WALL", true); + Clickable_Object("BELL"); +} + +bool SceneScriptCT09::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptCT09::ClickedOn3DObject(const char *objectName, bool a2) { + if (Object_Query_Click("BELL", objectName)) { + if (Actor_Query_Which_Set_In(62) != 31) { + if (!Loop_Actor_Walk_To_XYZ(0, 229.0f, 348.52f, 851.0f, 36, 1, false, 0)) { + Actor_Face_Object(0, "BELL", true); + Sound_Play(337, 100, 0, 0, 50); + if (!Actor_Query_Goal_Number(27)) { + Actor_Says(27, 160, 3); + } + } + } + return true; + } + return false; +} + +bool SceneScriptCT09::ClickedOnActor(int actorId) { + if (actorId == 27) { + if (!Actor_Query_Goal_Number(27) && Actor_Query_Which_Set_In(62) != 31) { + if (!Loop_Actor_Walk_To_XYZ(0, 270.0f, 348.52f, 846.0f, 12, 1, false, 0)) { + Player_Loses_Control(); + Actor_Face_Actor(0, 27, true); + if (Global_Variable_Query(1) < 3) { + Actor_Says(0, 650, 3); + Actor_Says(27, 250, 12); + Actor_Says(0, 665, 18); + } else if (Game_Flag_Query(540)) { + Actor_Says(0, 650, 18); + Actor_Says(27, 220, 15); + } else { + Game_Flag_Set(540); + Actor_Says(27, 170, 13); + Actor_Says(0, 630, 12); + Actor_Says(27, 180, 14); + Actor_Says(0, 635, 3); + Actor_Says(27, 190, 15); + Actor_Says(0, 640, 12); + Actor_Says(0, 645, 3); + Actor_Says(27, 200, 13); + Actor_Says(27, 210, 14); + } + Player_Gains_Control(); + } + } + return true; + } + return false; +} + +bool SceneScriptCT09::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptCT09::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, 206.0f, 348.52f, 599.0f, 0, 1, false, 0)) { + Loop_Actor_Walk_To_XYZ(0, 235.0f, 348.52f, 599.0f, 0, 0, false, 0); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(84); + Set_Enter(6, 20); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, 107.0f, 348.52f, 927.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(83); + Set_Enter(33, 23); + } + return true; + } + if (exitId == 2) { + if (!Loop_Actor_Walk_To_XYZ(0, 159.0f, 349.0f, 570.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(82); + Set_Enter(32, 22); + } + return true; + } + return false;; +} + +bool SceneScriptCT09::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptCT09::SceneFrameAdvanced(int frame) { + if (frame == 6 || frame == 12 || frame == 19 || frame == 25 || frame == 46 || frame == 59) { + Sound_Play(97, Random_Query(47, 47), 70, 70, 50); + } +} + +void SceneScriptCT09::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptCT09::PlayerWalkedIn() { + bool v0 = false; + if (Global_Variable_Query(1) == 3 && !Game_Flag_Query(538)) { + Game_Flag_Set(538); + Actor_Set_Goal_Number(62, 1); + v0 = true; + } + if (Game_Flag_Query(85)) { + Game_Flag_Reset(85); + } else if (Game_Flag_Query(81)) { + if (v0) { + Async_Actor_Walk_To_XYZ(0, 206.0f, 348.52f, 599.0f, 0, false); + } else { + Loop_Actor_Walk_To_XYZ(0, 206.0f, 348.52f, 599.0f, 0, 0, false, 0); + } + Game_Flag_Reset(81); + } else { + if (v0) { + Async_Actor_Walk_To_XYZ(0, 124.0f, 348.52f, 886.0f, 0, false); + } else { + Loop_Actor_Walk_To_XYZ(0, 124.0f, 348.52f, 886.0f, 0, 0, false, 0); + } + Game_Flag_Reset(304); + } + if (Actor_Query_Goal_Number(27) == 2) { + if (Game_Flag_Query(539)) { + Actor_Says(27, 70, 13); + Actor_Face_Actor(0, 27, true); + Actor_Says(0, 600, 17); + Actor_Says(27, 80, 14); + Actor_Says(0, 605, 13); + Actor_Says(27, 90, 15); + } else { + Actor_Says(27, 20, 12); + Actor_Face_Actor(0, 27, true); + Actor_Says(0, 585, 18); + Actor_Says(27, 40, 15); + Actor_Says(0, 590, 16); + Actor_Says(27, 50, 14); + Actor_Says(0, 595, 14); + Actor_Says(27, 60, 13); + Actor_Modify_Friendliness_To_Other(27, 0, -1); + } + Actor_Set_Goal_Number(27, 0); + } +} + +void SceneScriptCT09::PlayerWalkedOut() { +} + +void SceneScriptCT09::DialogueQueueFlushed(int a1) { + Actor_Force_Stop_Walking(0); + if (Actor_Query_Goal_Number(62) == 1 && !Game_Flag_Query(539)) { + Player_Loses_Control(); + Actor_Set_Goal_Number(62, 2); + //return true; + } else { + //return false; + } +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ct10.cpp b/engines/bladerunner/script/scene/ct10.cpp new file mode 100644 index 0000000000..406ea6d098 --- /dev/null +++ b/engines/bladerunner/script/scene/ct10.cpp @@ -0,0 +1,160 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptCT10::InitializeScene() { + Setup_Scene_Information(-121.0f, 0.0f, -78.0f, 446); + Game_Flag_Reset(84); + Scene_Exit_Add_2D_Exit(0, 135, 74, 238, 340, 0); + Ambient_Sounds_Add_Looping_Sound(336, 28, 0, 1); + Ambient_Sounds_Add_Sound(375, 6, 180, 33, 33, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(376, 5, 180, 33, 33, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(377, 5, 180, 33, 33, 0, 0, -101, -101, 0, 0); +} + +void SceneScriptCT10::SceneLoaded() { + Obstacle_Object("BED", true); + Unobstacle_Object("WINDOW", true); + Unobstacle_Object("LOFT01", true); + Unobstacle_Object("LOFT02", true); + Unobstacle_Object("LOFT03", true); + Unobstacle_Object("LOFT04", true); + Unobstacle_Object("LOFT05", true); + Unobstacle_Object("LOFT06", true); + Unobstacle_Object("LOFT10", true); + Unobstacle_Object("LOFT11", true); + Unobstacle_Object("LOFT12", true); + Unobstacle_Object("LINE02", true); + Unobstacle_Object("CABINETFRONT", true); + Unobstacle_Object("CABINTESIDE", true); + Unobstacle_Object("BUSTEDTAPE2", true); + Unobstacle_Object("BOX CLOSET 1", true); + Clickable_Object("BED"); + Clickable_Object("CABINETFRONT"); + Clickable_Object("CABINETTOP"); + Clickable_Object("TUB"); + Scene_2D_Region_Add(0, 379, 229, 454, 375); +} + +bool SceneScriptCT10::MouseClick(int x, int y) { + return false; +} + +void SceneScriptCT10::sub_401844() { + if (!Loop_Actor_Walk_To_XYZ(0, 10.6f, 0.0f, -50.5f, 0, 1, false, 0)) { + Player_Loses_Control(); + Actor_Face_Heading(0, 0, false); + Sound_Play(339, 100, 0, 0, 50); + Delay(1000); + if (Actor_Clue_Query(0, 110)) { + Actor_Voice_Over(3700, 99); + } else { + Item_Pickup_Spin_Effect(931, 435, 258); + Actor_Clue_Acquire(0, 110, 1, -1); + } + Player_Gains_Control(); + } +} + +bool SceneScriptCT10::ClickedOn3DObject(const char *objectName, bool a2) { + if (Object_Query_Click("TUB", objectName)) { + if (!Loop_Actor_Walk_To_XYZ(0, -41.0f, 0.0f, -106.0f, 0, 1, false, 0)) { + Player_Loses_Control(); + Actor_Face_Heading(0, 850, false); + Actor_Change_Animation_Mode(0, 38); + Delay(1000); + Sound_Play(338, 33, 0, 0, 50); + Delay(3000); + if (Actor_Clue_Query(0, 93)) { + Actor_Voice_Over(3700, 99); + } else { + Actor_Clue_Acquire(0, 93, 1, -1); + Item_Pickup_Spin_Effect(969, 364, 214); + } + Delay(1000); + Loop_Actor_Walk_To_XYZ(0, -41.0f, 0.0f, -82.0f, 0, 0, false, 1); + Player_Gains_Control(); + } + return true; + } + if (Object_Query_Click("CABINETTOP", objectName) || Object_Query_Click("CABINETFRONT", objectName)) { + sub_401844(); + return true; + } + return false; +} + +bool SceneScriptCT10::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptCT10::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptCT10::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -93.0f, 0.0f, -38.0f, 0, 1, false, 0)) { + Loop_Actor_Walk_To_XYZ(0, -121.0f, 0.0f, -78.0f, 0, 0, false, 0); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(85); + Set_Enter(31, 21); + } + } + return false; +} + +bool SceneScriptCT10::ClickedOn2DRegion(int region) { + if (region == 0) { + sub_401844(); + } + return false; +} + +void SceneScriptCT10::SceneFrameAdvanced(int frame) { +} + +void SceneScriptCT10::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptCT10::PlayerWalkedIn() { + Loop_Actor_Walk_To_XYZ(0, -93.0f, 0.0f, -38.0f, 0, 0, false, 0); + Loop_Actor_Walk_To_XYZ(0, -49.0f, 0.0f, -38.0f, 0, 0, false, 0); + if (!Game_Flag_Query(525)) { + Actor_Voice_Over(450, 99); + Actor_Voice_Over(460, 99); + Actor_Voice_Over(470, 99); + Game_Flag_Set(525); + } +} + +void SceneScriptCT10::PlayerWalkedOut() { +} + +void SceneScriptCT10::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ct11.cpp b/engines/bladerunner/script/scene/ct11.cpp new file mode 100644 index 0000000000..ee0019fb42 --- /dev/null +++ b/engines/bladerunner/script/scene/ct11.cpp @@ -0,0 +1,213 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptCT11::InitializeScene() { + if (Game_Flag_Query(91)) { + Setup_Scene_Information(-378.0f, 9.68f, -55.0f, 440); + } else if (Game_Flag_Query(558)) { + Setup_Scene_Information(315.0f, 0.0f, 628.0f, 0); + } else { + Setup_Scene_Information(152.0f, 9.68f, -8.0f, 0); + } + Scene_Exit_Add_2D_Exit(0, 257, 240, 364, 330, 1); + Scene_Exit_Add_2D_Exit(1, 97, 0, 155, 324, 0); + Scene_Exit_Add_2D_Exit(2, 0, 0, 20, 479, 3); + Ambient_Sounds_Add_Looping_Sound(54, 50, 0, 1); + Ambient_Sounds_Add_Sound(67, 5, 80, 16, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(66, 5, 80, 16, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(378, 5, 80, 50, 100, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(379, 5, 80, 50, 100, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(380, 5, 80, 50, 100, -100, 100, -101, -101, 0, 0); + if (Global_Variable_Query(1) <= 3) { + Scene_Loop_Set_Default(0); + } else { + Scene_Loop_Set_Default(2); + } +} + +void SceneScriptCT11::SceneLoaded() { + Obstacle_Object("TRASH CAN", true); + Unobstacle_Object("BOX NORTHWEST 1", true); + Unobstacle_Object("BOX SOUTH 1", true); + if (Global_Variable_Query(1) < 4) { + if (!Game_Flag_Query(645)) { + Item_Add_To_World(115, 951, 33, 640.21002f, 30.0f, 470.0f, 512, 12, 12, false, true, false, true); + Scene_2D_Region_Add(0, 505, 316, 513, 321); + Game_Flag_Set(725); + } + if (!Actor_Clue_Query(0, 111)) { + Scene_2D_Region_Add(1, 412, 258, 552, 358); + } + } else { + if (Game_Flag_Query(725)) { + Item_Remove_From_World(115); + Game_Flag_Reset(725); + Game_Flag_Set(645); + } + Unobstacle_Object("BRIDGE SUPPORT", true); + Unobstacle_Object("BODY", true); + Unobstacle_Object("HEADLIGHTS", true); + Unobstacle_Object("LICENSE PLATE-FRONT", true); + Unobstacle_Object("LICENSE PLATE-REAR", true); + Unobstacle_Object("BRAKE DISC RF", true); + Unobstacle_Object("TIRE RF", true); + Unobstacle_Object("RIM RF", true); + Unobstacle_Object("DOOR RIGHT", true); + Unobstacle_Object("BUMPER REAR", true); + } + Unclickable_Object("TRASH CAN"); +} + +bool SceneScriptCT11::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptCT11::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptCT11::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptCT11::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptCT11::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, 121.0f, 9.6800003f, -42.0f, 0, 1, false, 0)) { + Game_Flag_Set(304); + Set_Enter(31, 21); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -300.0f, 9.6800003f, 66.0f, 0, 1, false, 0)) { + Loop_Actor_Walk_To_XYZ(0, -400.0f, 9.6800003f, -70.0f, 0, 1, false, 0); + Game_Flag_Set(86); + Set_Enter(4, 24); + } + return true; + } + if (exitId == 2) { + if (!Loop_Actor_Walk_To_XYZ(0, 290.0f, 0.0f, 635.0f, 0, 1, false, 0)) { + Game_Flag_Set(531); + Game_Flag_Reset(176); + Game_Flag_Set(177); + Set_Enter(7, 25); + } + return true; + } + return false; +} + +bool SceneScriptCT11::ClickedOn2DRegion(int region) { + if (region == 0 && Game_Flag_Query(725)) { + if (!Loop_Actor_Walk_To_XYZ(0, 686.0f, 0.0f, 658.0f, 12, 1, false, 0)) { + Actor_Face_Heading(0, 47, false); + Item_Remove_From_World(115); + Actor_Clue_Acquire(0, 118, 0, -1); + Item_Pickup_Spin_Effect(951, 510, 319); + Game_Flag_Reset(725); + Game_Flag_Set(645); + Actor_Voice_Over(550, 99); + Actor_Voice_Over(560, 99); + Actor_Voice_Over(570, 99); + Actor_Voice_Over(580, 99); + } + return true; + } + if (region == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, 686.0f, 0.0f, 658.0f, 12, 1, false, 0)) { + Actor_Face_Heading(0, 47, false); + int temp = 0; + if (Actor_Clue_Query(0, 17)) { + temp = 1; + } + if (Actor_Clue_Query(0, 26)) { + ++temp; + } + if (Actor_Clue_Query(0, 39)) { + ++temp; + } + if (Actor_Clue_Query(0, 37)) { + temp += 2; + } + if (Actor_Clue_Query(0, 30)) { + temp += 2; + } + if (Actor_Clue_Query(0, 31)) { + temp += 2; + } + if (temp <= 2 || Actor_Clue_Query(0, 111)) { + Actor_Says(0, 8525, 12); + } else { + Actor_Voice_Over(510, 99); + Actor_Voice_Over(520, 99); + Actor_Voice_Over(530, 99); + Actor_Voice_Over(540, 99); + Actor_Clue_Acquire(0, 111, 0, -1); + Scene_2D_Region_Remove(1); + } + } + return true; + } + return false; +} + +void SceneScriptCT11::SceneFrameAdvanced(int frame) { +} + +void SceneScriptCT11::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptCT11::PlayerWalkedIn() { + if (Game_Flag_Query(91)) { + Loop_Actor_Walk_To_XYZ(0, -358.0f, 9.68f, 32.0f, 0, 0, false, 0); + Game_Flag_Reset(91); + } else if (Game_Flag_Query(558)) { + Loop_Actor_Walk_To_XYZ(0, 329.0f, 0.0f, 617.0f, 0, 0, false, 0); + Game_Flag_Reset(558); + } else { + Player_Loses_Control(); + Actor_Set_Immunity_To_Obstacles(0, true); + Loop_Actor_Walk_To_XYZ(0, 125.0f, 9.68f, 74.0f, 0, 0, false, 0); + Actor_Set_Immunity_To_Obstacles(0, false); + Player_Gains_Control(); + Game_Flag_Reset(83); + } +} + +void SceneScriptCT11::PlayerWalkedOut() { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); +} + +void SceneScriptCT11::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ct12.cpp b/engines/bladerunner/script/scene/ct12.cpp new file mode 100644 index 0000000000..a5f5c35dde --- /dev/null +++ b/engines/bladerunner/script/scene/ct12.cpp @@ -0,0 +1,284 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptCT12::InitializeScene() { + if (Game_Flag_Query(123)) { + Setup_Scene_Information(-419.0f, -6.5f, 696.0f, 616); + } else if (Game_Flag_Query(432)) { + Setup_Scene_Information(-292.0f, -6.5f, 990.0f, 827); + if (!Game_Flag_Query(150)) { + Game_Flag_Set(150); + } + Game_Flag_Reset(432); + } else if (Game_Flag_Query(86)) { + Setup_Scene_Information(-493.0f, -6.5f, 1174.0f, 990); + } else { + Setup_Scene_Information(-386.13f, -6.5f, 1132.72f, 783); + } + Scene_Exit_Add_2D_Exit(0, 0, 0, 40, 479, 3); + Scene_Exit_Add_2D_Exit(1, 78, 224, 162, 330, 0); + Scene_Exit_Add_2D_Exit(2, 500, 180, 619, 346, 0); + if (Global_Variable_Query(1) > 2) { + Scene_Exit_Add_2D_Exit(3, 620, 0, 639, 479, 1); + } + if (Global_Variable_Query(1) > 3) { + Scene_Exit_Add_2D_Exit(4, 324, 150, 435, 340, 0); + } + Ambient_Sounds_Add_Looping_Sound(54, 33, 1, 1); + Ambient_Sounds_Add_Looping_Sound(55, 20, -100, 1); + Ambient_Sounds_Add_Looping_Sound(56, 20, -100, 1); + Ambient_Sounds_Add_Speech_Sound(60, 0, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 20, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 40, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 50, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Sound(68, 60, 180, 20, 33, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(69, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(375, 60, 180, 50, 100, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(376, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(377, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0); + if (Global_Variable_Query(1) < 2 && Actor_Query_Goal_Number(53) == 1) { + Actor_Put_In_Set(53, 4); + Actor_Set_At_XYZ(53, -534.0f, -6.5f, 952.0f, 367); + Game_Flag_Set(294); + } + if (Game_Flag_Query(123) && Game_Flag_Query(248)) { + if (Global_Variable_Query(1) != 2 && Global_Variable_Query(1) != 3) { + Scene_Loop_Start_Special(0, 1, 0); + } + Scene_Loop_Set_Default(2); + Game_Flag_Reset(123); + } else if (Game_Flag_Query(123) && !Game_Flag_Query(248)) { + if (Global_Variable_Query(1) != 2 && Global_Variable_Query(1) != 3) { + Scene_Loop_Start_Special(0, 0, 0); + } + Scene_Loop_Set_Default(2); + Game_Flag_Reset(123); + } else if (Game_Flag_Query(76) && Game_Flag_Query(294)) { + Game_Flag_Reset(76); + Scene_Loop_Set_Default(4); + } else if (Game_Flag_Query(76) && !Game_Flag_Query(294)) { + Game_Flag_Reset(76); + Scene_Loop_Set_Default(2); + } else { + Scene_Loop_Set_Default(2); + + } +} + +void SceneScriptCT12::SceneLoaded() { + Obstacle_Object("BOX18", true); + Unobstacle_Object("SPINNER BODY", true); + Unobstacle_Object("HOWFLOOR", true); + Unclickable_Object("TURBINE"); +} + +bool SceneScriptCT12::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptCT12::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptCT12::ClickedOnActor(int actorId) { + if (actorId == 28) { + Actor_Face_Actor(0, 28, true); + Actor_Says(0, 8910, 16); + } + if (actorId == 24 && Global_Variable_Query(1) == 4 && Game_Flag_Query(671) && Game_Flag_Query(703)) { + Actor_Face_Actor(24, 0, true); + Actor_Face_Actor(0, 24, true); + Actor_Says(0, 710, 3); + Actor_Says(24, 20, 3); + Actor_Says(0, 715, 3); + Actor_Says(24, 30, 3); + Actor_Says(0, 720, 3); + Actor_Says(24, 40, 3); + Actor_Says(24, 50, 3); + Actor_Says(24, 60, 3); + Actor_Says(0, 725, 3); + Actor_Says(24, 70, 3); + Actor_Says(24, 80, 3); + Actor_Says(24, 90, 3); + Actor_Says(24, 100, 3); + Actor_Says(24, 110, 3); + Game_Flag_Set(629); + Game_Flag_Set(666); + Actor_Set_Goal_Number(0, 400); + } + return false; +} + +bool SceneScriptCT12::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptCT12::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -419.14999f, -6.5f, 696.94f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Game_Flag_Set(88); + Set_Enter(4, 13); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -182.69f, -6.5f, 696.94f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(89); + Set_Enter(5, 15); + } + return true; + } + if (exitId == 2) { + if (!Loop_Actor_Walk_To_XYZ(0, -386.13f, -6.5f, 1132.72f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(90); + Set_Enter(28, 17); + } + return true; + } + if (exitId == 3) { + if (!Loop_Actor_Walk_To_XYZ(0, -493.0f, -6.5f, 1174.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(91); + Set_Enter(33, 23); + } + return true; + } + if (exitId == 4) { + if (!Loop_Actor_Walk_To_XYZ(0, -292.0f, -6.5f, 990.0f, 0, 1, false, 0)) { + if (Global_Variable_Query(1) == 4) { + Game_Flag_Set(629); + } + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(433); + Set_Enter(82, 94); + } + return true; + } + return false; +} + +bool SceneScriptCT12::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptCT12::SceneFrameAdvanced(int frame) { + if (!((frame - 1) % 10)) { + /*int v2 = Random_Query(0, 1); + if (v2 <= 1) + { + if (v2) + { + v1 = 60; + } + else + { + v1 = 59; + } + }*/ + Sound_Play(/*v1*/Random_Query(59, 60), 10, -80, -80, 50); + } + if (frame == 160) { + Actor_Change_Animation_Mode(53, 41); + } + if (frame == 152) { + Sound_Play(116, 100, 40, 0, 50); + } + if (frame == 203) { + Sound_Play(119, 100, 40, 0, 50); + } + if (frame == 212) { + Sound_Play(117, 40, 0, 0, 50); + } + if (frame == 269) { + Player_Gains_Control(); + Player_Set_Combat_Mode(false); + Actor_Set_Invisible(53, false); + } +} + +void SceneScriptCT12::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptCT12::PlayerWalkedIn() { + if (Global_Variable_Query(1) < 2 && !Game_Flag_Query(64) && Actor_Query_Goal_Number(53) == 1) { + Player_Loses_Control(); + Loop_Actor_Walk_To_Actor(53, 0, 48, 0, false); + Actor_Face_Actor(53, 0, true); + Actor_Face_Actor(0, 53, true); + Actor_Says(53, 0, 3); + Actor_Says(0, 670, 3); + Actor_Says(53, 10, 3); + Actor_Says(0, 675, 3); + Actor_Says(53, 20, 3); + Actor_Says(0, 680, 3); + Actor_Says(53, 30, 3); + Actor_Says(0, 685, 3); + Actor_Says(53, 40, 3); + Actor_Says(0, 690, 3); + Actor_Clue_Acquire(0, 33, 1, 53); + Game_Flag_Set(64); + CDB_Set_Crime(20, 8); + if (Game_Flag_Query(64) && Game_Flag_Query(40)) { + Actor_Says(53, 50, 3); + Actor_Says(0, 695, 3); + Actor_Says(53, 60, 3); + Actor_Says(0, 700, 3); + Actor_Says(53, 70, 3); + Actor_Clue_Acquire(53, 222, 1, -1); + } else if (Game_Flag_Query(64) && Game_Flag_Query(41)) { + Actor_Says(53, 80, 3); + Actor_Says(53, 90, 3); + Actor_Says(0, 705, 3); + Actor_Says(53, 100, 3); + Actor_Clue_Acquire(53, 215, 1, -1); + } + Actor_Set_Goal_Number(53, 2); + } + if (Game_Flag_Query(86)) { + Loop_Actor_Walk_To_XYZ(0, -520.0f, -6.5f, 1103.0f, 0, 0, false, 0); + Game_Flag_Reset(86); + } +} + +void SceneScriptCT12::PlayerWalkedOut() { + Game_Flag_Reset(443); + if (Game_Flag_Query(433)) { + Game_Flag_Reset(176); + Game_Flag_Set(259); + } +} + +void SceneScriptCT12::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ct51.cpp b/engines/bladerunner/script/scene/ct51.cpp new file mode 100644 index 0000000000..8fb866c554 --- /dev/null +++ b/engines/bladerunner/script/scene/ct51.cpp @@ -0,0 +1,129 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptCT51::InitializeScene() { + Setup_Scene_Information(0.0f, 0.0f, -102.0f, 470); + Game_Flag_Reset(379); + Scene_Exit_Add_2D_Exit(1, 0, 0, 30, 479, 3); + Ambient_Sounds_Add_Looping_Sound(381, 100, 1, 1); + Ambient_Sounds_Add_Sound(68, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(69, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(375, 60, 180, 50, 100, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(376, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(377, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0); + Scene_Loop_Start_Special(0, 0, 0); + Scene_Loop_Set_Default(1); +} + +void SceneScriptCT51::SceneLoaded() { + Unobstacle_Object("BLANKET03", true); + Clickable_Object("BED02"); + if (!Actor_Clue_Query(0, 85)) { + Item_Add_To_World(85, 943, 6, 44.0f, 0.0f, -95.0f, 540, 24, 24, false, true, false, true); + } + if (!Actor_Clue_Query(0, 86)) { + Item_Add_To_World(120, 984, 6, 44.0f, 0.0f, -22.0f, 0, 12, 12, false, true, false, true); + } +} + +bool SceneScriptCT51::MouseClick(int x, int y) { + return true; +} + +bool SceneScriptCT51::ClickedOn3DObject(const char *objectName, bool a2) { + if (Object_Query_Click("BED02", objectName)) { + if (Actor_Clue_Query(0, 84)) { + Actor_Says(0, 8580, 12); + return false; + } + Item_Pickup_Spin_Effect(970, 203, 200); + Actor_Clue_Acquire(0, 84, 1, -1); + Actor_Voice_Over(420, 99); + return true; + } + return false; +} + +bool SceneScriptCT51::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptCT51::ClickedOnItem(int itemId, bool a2) { + if (itemId == 85) { + Actor_Clue_Acquire(0, 85, 1, -1); + Item_Pickup_Spin_Effect(943, 260, 200); + Ambient_Sounds_Play_Sound(563, 40, 99, 0, 0); + Item_Remove_From_World(85); + return true; + } + if (itemId == 120) { + Actor_Clue_Acquire(0, 86, 1, -1); + Item_Pickup_Spin_Effect(984, 490, 307); + Item_Remove_From_World(120); + Actor_Says(0, 8527, 3); + return true; + } + return false; +} + +bool SceneScriptCT51::ClickedOnExit(int exitId) { + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, 0.0f, 0.0f, -102.0f, 0, 1, false, 0)) { + Loop_Actor_Walk_To_XYZ(0, -11.0f, 0.0f, -156.0f, 0, 0, false, 0); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(380); + Set_Enter(6, 20); + } + return true; + } + return false; + +} + +bool SceneScriptCT51::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptCT51::SceneFrameAdvanced(int frame) { +} + +void SceneScriptCT51::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptCT51::PlayerWalkedIn() { +} + +void SceneScriptCT51::PlayerWalkedOut() { + if (!Actor_Clue_Query(0, 85)) { + Item_Remove_From_World(85); + } +} + +void SceneScriptCT51::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/dr01.cpp b/engines/bladerunner/script/scene/dr01.cpp new file mode 100644 index 0000000000..0da58d4e71 --- /dev/null +++ b/engines/bladerunner/script/scene/dr01.cpp @@ -0,0 +1,262 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptDR01::InitializeScene() { + if (Game_Flag_Query(225)) { + Setup_Scene_Information(-835.0f, -0.04f, -118.0f, 664); + } else if (Game_Flag_Query(11)) { + Setup_Scene_Information(-711.0f, -0.04f, 70.0f, 307); + } else if (Game_Flag_Query(531)) { + Setup_Scene_Information(-1765.28f, -0.04f, -23.82f, 269); + } else { + Setup_Scene_Information(-386.0f, -0.04f, -82.0f, 792); + } + Scene_Exit_Add_2D_Exit(0, 240, 60, 450, 250, 0); + Scene_Exit_Add_2D_Exit(1, 0, 0, 30, 479, 3); + if (Game_Flag_Query(253) && Global_Variable_Query(1) < 4) { + Scene_Exit_Add_2D_Exit(2, 610, 0, 639, 479, 1); + } + if (Global_Variable_Query(1) >= 3) { + Scene_Exit_Add_2D_Exit(3, 0, 45, 142, 201, 0); + } + Ambient_Sounds_Remove_All_Non_Looping_Sounds(0); + Ambient_Sounds_Add_Looping_Sound(54, 50, 0, 1); + Ambient_Sounds_Add_Looping_Sound(219, 12, 85, 1); + Ambient_Sounds_Add_Looping_Sound(98, 14, 85, 1); + Ambient_Sounds_Add_Speech_Sound(60, 0, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 20, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 40, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 50, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Sound(67, 5, 80, 16, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(66, 5, 80, 16, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(378, 5, 80, 50, 100, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(379, 5, 80, 50, 100, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(380, 5, 80, 50, 100, -100, 100, -101, -101, 0, 0); + if (Game_Flag_Query(272) && Game_Flag_Query(11)) { + Scene_Loop_Start_Special(0, 3, 0); + Scene_Loop_Set_Default(4); + } else if (!Game_Flag_Query(272) && Game_Flag_Query(11)) { + Scene_Loop_Start_Special(0, 2, 0); + Scene_Loop_Set_Default(4); + } else if (Game_Flag_Query(225)) { + Scene_Loop_Start_Special(0, 1, 0); + Scene_Loop_Set_Default(4); + } else if (Game_Flag_Query(531) == 1) { + Scene_Loop_Set_Default(4); + } else { + Scene_Loop_Start_Special(0, 0, 0); + Scene_Loop_Set_Default(4); + } +} + +void SceneScriptDR01::SceneLoaded() { + Obstacle_Object("TRASH CAN WITH FIRE", true); + Obstacle_Object("V2PYLON02", true); + Obstacle_Object("V2PYLON04", true); + Obstacle_Object("U2 CHEWDOOR", true); + Obstacle_Object("MMTRASHCAN", true); + Obstacle_Object("PARKMETR02", true); + Obstacle_Object("TRANSFORMER 01", true); + Obstacle_Object("TRANSFORMER 02", true); + Obstacle_Object("PARKMETR01", true); + Obstacle_Object("Z2TRSHCAN", true); + Obstacle_Object("Z2ENTRYDR", true); + Obstacle_Object("Z2DR2", true); + Unobstacle_Object("V2 BUILD01", true); +} + +bool SceneScriptDR01::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptDR01::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptDR01::ClickedOnActor(int actorId) { + return actorId == 50; +} + +bool SceneScriptDR01::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptDR01::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -835.0f, -0.04f, -118.0f, 0, 1, false, 0)) { + Async_Actor_Walk_To_XYZ(0, -911.0f, -0.04f, -118.0f, 0, false); + Ambient_Sounds_Adjust_Looping_Sound(112, 10, -100, 1); + Game_Flag_Set(224); + Set_Enter(7, 26); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -711.0f, -0.04f, 70.0f, 0, 1, false, 0)) { + Async_Actor_Walk_To_XYZ(0, -796.0f, -0.04f, 166.0f, 0, false); + Game_Flag_Set(10); + Set_Enter(7, 28); + } + return true; + } + if (exitId == 2) { + if (Loop_Actor_Walk_To_XYZ(0, -372.0f, -0.04f, -82.0f, 0, 1, false, 0)) { + Game_Flag_Reset(176); + Game_Flag_Reset(182); + Game_Flag_Reset(179); + Game_Flag_Reset(178); + Game_Flag_Reset(180); + Game_Flag_Reset(261); + Game_Flag_Reset(177); + Game_Flag_Reset(258); + int spinnerDest = Spinner_Interface_Choose_Dest(-1, 0); + switch (spinnerDest) { + case 2: + Game_Flag_Set(182); + Game_Flag_Reset(253); + Game_Flag_Set(249); + Set_Enter(69, 78); + break; + case 3: + Game_Flag_Set(176); + Game_Flag_Reset(253); + Game_Flag_Set(248); + Set_Enter(4, 13); + break; + case 1: + Game_Flag_Set(179); + Game_Flag_Reset(253); + Game_Flag_Set(250); + Set_Enter(49, 48); + break; + case 0: + Game_Flag_Set(178); + Game_Flag_Reset(253); + Game_Flag_Set(251); + Set_Enter(61, 65); + break; + case 5: + Game_Flag_Set(261); + Game_Flag_Reset(253); + Game_Flag_Set(307); + Set_Enter(17, 82); + break; + case 4: + Game_Flag_Set(180); + Game_Flag_Reset(253); + Game_Flag_Set(252); + Set_Enter(0, 0); + break; + case 7: + Game_Flag_Set(258); + Game_Flag_Reset(253); + Game_Flag_Set(254); + Set_Enter(20, 2); + break; + case 8: + Game_Flag_Set(181); + Game_Flag_Reset(253); + Game_Flag_Set(255); + Set_Enter(54, 54); + break; + case 9: + Game_Flag_Set(257); + Game_Flag_Reset(253); + Game_Flag_Set(256); + Set_Enter(37, 34); + break; + default: + Player_Loses_Control(); + Game_Flag_Set(177); + Loop_Actor_Walk_To_XYZ(0, -447.39f, 0.16f, -92.38f, 0, 0, true, 0); + Player_Gains_Control(); + break; + } + } + return true; + } + + if (exitId == 3) { + float x, y, z; + Actor_Query_XYZ(0, &x, &y, &z); + bool v7 = false; + if (-1200 < x) { + v7 = Loop_Actor_Walk_To_XYZ(0, -1236.4f, -0.04f, -13.91f, 0, 1, false, 0); + } + if (!v7) { + Game_Flag_Set(558); + Game_Flag_Set(176); + Game_Flag_Reset(177); + Set_Enter(33, 23); + } + return true; + } + return false; +} + +bool SceneScriptDR01::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptDR01::SceneFrameAdvanced(int frame) { + if (frame < 75) { + Actor_Set_Invisible(0, true); + } else { + Actor_Set_Invisible(0, false); + } + if (frame == 2) { + Ambient_Sounds_Play_Sound(487, 40, -40, 100, 99); + } +} + +void SceneScriptDR01::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptDR01::PlayerWalkedIn() { + if (Game_Flag_Query(531)) { + Async_Actor_Walk_To_XYZ(0, -757.15f, -0.04f, 24.64f, 0, false); + } else if (!Game_Flag_Query(225) && !Game_Flag_Query(11)) { + Player_Loses_Control(); + Loop_Actor_Walk_To_XYZ(0, -447.39f, 0.16f, -92.38f, 0, 0, false, 0); + Player_Gains_Control(); + } + Game_Flag_Reset(225); + Game_Flag_Reset(11); + Game_Flag_Reset(531); +} + +void SceneScriptDR01::PlayerWalkedOut() { + if (!Game_Flag_Query(10) && !Game_Flag_Query(224) && !Game_Flag_Query(558)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Outtake_Play(35, 1, -1); + } +} + +void SceneScriptDR01::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/dr02.cpp b/engines/bladerunner/script/scene/dr02.cpp new file mode 100644 index 0000000000..2ff8f14a0f --- /dev/null +++ b/engines/bladerunner/script/scene/dr02.cpp @@ -0,0 +1,183 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptDR02::InitializeScene() { + if (Game_Flag_Query(227)) { + Setup_Scene_Information(-1162.0f, 7.18f, -322.0f, 552); + } else if (Game_Flag_Query(224)) { + Setup_Scene_Information(-835.0f, -0.04f, -118.0f, 193); + } else if (Game_Flag_Query(264)) { + Setup_Scene_Information(-1258.0f, 7.18f, -314.0f, 400); + } else { + Setup_Scene_Information(168.78f, 0.16f, -775.71997f, 193); + } + Scene_Exit_Add_2D_Exit(0, 605, 0, 639, 479, 1); + Scene_Exit_Add_2D_Exit(1, 222, 176, 279, 314, 0); + if (Game_Flag_Query(326)) { + Scene_Exit_Add_2D_Exit(2, 95, 0, 148, 292, 0); + } + Ambient_Sounds_Remove_All_Non_Looping_Sounds(0); + Ambient_Sounds_Remove_All_Looping_Sounds(0); + Ambient_Sounds_Add_Looping_Sound(54, 50, 0, 1); + Ambient_Sounds_Add_Looping_Sound(219, 27, 85, 1); + Ambient_Sounds_Add_Looping_Sound(98, 38, 85, 1); + Ambient_Sounds_Add_Sound(378, 2, 50, 33, 100, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(379, 2, 50, 33, 100, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(380, 2, 50, 33, 100, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(67, 5, 100, 16, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(66, 5, 100, 16, 25, -100, 100, -101, -101, 0, 0); + if (Game_Flag_Query(224)) { + Scene_Loop_Start_Special(0, 0, 0); + Scene_Loop_Set_Default(1); + } else { + Scene_Loop_Set_Default(1); + } +} + +void SceneScriptDR02::SceneLoaded() { + Obstacle_Object("TRASH CAN WITH FIRE", true); + Obstacle_Object("V2PYLON02", true); + Obstacle_Object("V2PYLON04", true); + Obstacle_Object("U2 CHEWDOOR", true); + Obstacle_Object("MMTRASHCAN", true); + Obstacle_Object("PARKMETR02", true); + Obstacle_Object("TRANSFORMER 01", true); + Obstacle_Object("TRANSFORMER 02", true); + Obstacle_Object("PARKMETR01", true); + Obstacle_Object("Z2ENTRYDR", true); + Obstacle_Object("Z2DR2", true); + Clickable_Object("TRASH CAN WITH FIRE"); + Clickable_Object("U2 CHEWDOOR"); + Clickable_Object("MMTRASHCAN"); + Clickable_Object("U2 EYE"); + Clickable_Object("U2 E"); + Clickable_Object("MMNEWSP01"); + Clickable_Object("MMNEWSP01"); + Clickable_Object("MMNEWSP04"); + Clickable_Object("MMNEWSP05"); + Clickable_Object("MMNEWSP07"); + Clickable_Object("PARKMETR02"); + Clickable_Object("TRANSFORMER 01"); + Clickable_Object("TRANSFORMER 02"); + Clickable_Object("V2CANPIPE02"); + Unclickable_Object("TRASH CAN WITH FIRE"); + Unclickable_Object("U2 CHEWDOOR"); + Unclickable_Object("MMTRASHCAN"); + Unclickable_Object("U2 EYE"); + Unclickable_Object("U2 E"); + Unclickable_Object("MMNEWSP01"); + Unclickable_Object("MMNEWSP02"); + Unclickable_Object("MMNEWSP04"); + Unclickable_Object("MMNEWSP06"); + Unclickable_Object("MMNEWSP07"); + Unclickable_Object("PARKMETR02"); + Unclickable_Object("TRANSFORMER 01"); + Unclickable_Object("TRANSFORMER 02"); + Unclickable_Object("V2CANPIPE02"); +} + +bool SceneScriptDR02::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptDR02::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptDR02::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptDR02::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptDR02::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -835.0f, -0.04f, -118.0f, 0, 1, false, 0)) { + Async_Actor_Walk_To_XYZ(0, -727.0f, -0.04f, -118.0f, 0, false); + Game_Flag_Set(225); + Set_Enter(7, 25); + } + Ambient_Sounds_Adjust_Looping_Sound(219, 12, -101, 1); + Ambient_Sounds_Adjust_Looping_Sound(98, 14, -101, 1); + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -1162.0f, 7.18f, -322.0f, 0, 1, false, 0)) { + if (Global_Variable_Query(1) > 2) { + Actor_Says(0, 8522, 15); + } else { + Game_Flag_Set(226); + Set_Enter(34, 27); + } + } + return true; + } + if (exitId == 2) { + if (!Loop_Actor_Walk_To_XYZ(0, -1258.0f, 7.18f, -314.0f, 0, 1, false, 0)) { + Game_Flag_Set(265); + Game_Flag_Reset(177); + Game_Flag_Set(258); + Set_Enter(20, 2); + } + return true; + } + return false; +} + +bool SceneScriptDR02::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptDR02::SceneFrameAdvanced(int frame) { + if (frame == 1) { + Sound_Play(1, 10, 85, 85, 50); + } +} + +void SceneScriptDR02::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptDR02::PlayerWalkedIn() { + if (Game_Flag_Query(227)) { + Game_Flag_Reset(227); + } + if (Game_Flag_Query(224)) { + Game_Flag_Reset(224); + } + if (Game_Flag_Query(264)) { + Game_Flag_Reset(264); + } +} + +void SceneScriptDR02::PlayerWalkedOut() { +} + +void SceneScriptDR02::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/dr03.cpp b/engines/bladerunner/script/scene/dr03.cpp new file mode 100644 index 0000000000..f0de30deb8 --- /dev/null +++ b/engines/bladerunner/script/scene/dr03.cpp @@ -0,0 +1,288 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptDR03::InitializeScene() { + if (Game_Flag_Query(226)) { + Game_Flag_Reset(226); + Setup_Scene_Information(330.31f, 4.27f, -910.91f, 297); + } + Setup_Scene_Information(330.31f, 4.27f, -910.91f, 297); + Scene_Exit_Add_2D_Exit(0, 377, 122, 445, 266, 0); + if (Global_Variable_Query(1) == 3) { + Actor_Put_In_Set(52, 34); + Actor_Set_At_XYZ(52, 431.21f, 4.27f, -776.26f, 0); + } else { + Actor_Put_In_Set(52, 34); + Actor_Set_At_XYZ(52, 360.77f, 4.4f, -806.67f, 126); + } + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Ambient_Sounds_Add_Looping_Sound(110, 7, 0, 1); + Ambient_Sounds_Add_Looping_Sound(109, 50, 0, 1); + Ambient_Sounds_Add_Looping_Sound(95, 20, 70, 1); +} + +void SceneScriptDR03::SceneLoaded() { + Obstacle_Object("W2-CENTCASE02", 1); + Obstacle_Object("W2-CARTTOP", 1); + Obstacle_Object("W2-TANKAFLUID01", 1); +} + +bool SceneScriptDR03::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptDR03::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptDR03::ClickedOnActor(int actorId) { + if (actorId == 52) { + Actor_Face_Actor(0, 52, 1); + Actor_Face_Actor(52, 0, 1); + if (!Game_Flag_Query(267)) { + Actor_Says(0, 755, 18); + Actor_Says(52, 10, 14); + Actor_Says(0, 760, 18); + Actor_Says(52, 20, 14); + Actor_Says(0, 765, 18); + Actor_Says(52, 30, 14); + Game_Flag_Set(267); + return true; + } + if (Actor_Clue_Query(0, 67)) { + if (Game_Flag_Query(266) && Game_Flag_Query(267)) { + Actor_Says(0, 815, 18); + Actor_Says(52, 60, 14); + Actor_Says(52, 70, 14); + Actor_Says(52, 80, 14); + Actor_Says(0, 820, 18); + Actor_Says(52, 90, 14); + Actor_Says(0, 825, 18); + Actor_Says(52, 100, 14); + Game_Flag_Reset(266); + Game_Flag_Set(505); + return true; + } + if ((Actor_Clue_Query(0, 147) || Actor_Clue_Query(0, 71) || Actor_Clue_Query(0, 76) || Actor_Clue_Query(0, 67)) + && Game_Flag_Query(505)) { + sub_401B18(); + } else { + Actor_Says(0, 810, 18); + Actor_Says(52, 40, 14); + Actor_Says(52, 50, 14); + } + return true; + } + Actor_Says(0, 770, 12); + Actor_Says(52, 110, 12); + Actor_Says(52, 120, 13); + Actor_Says(0, 835, 13); + Actor_Says(52, 130, 14); + Actor_Says(0, 840, 16); + Actor_Says(52, 140, 15); + if (!Game_Flag_Query(505)) { + Actor_Says(52, 150, 13); + Actor_Says(0, 845, 17); + Actor_Says(52, 170, 18); + Actor_Says(52, 180, 16); + Actor_Says(0, 850, 15); + Actor_Says(52, 190, 14); + Actor_Says(52, 200, 13); + Actor_Says(0, 855, 18); + Actor_Says(52, 210, 12); + } + Actor_Clue_Acquire(0, 67, 1, 52); + return true; + } + return false; +} + +bool SceneScriptDR03::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptDR03::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, 330.31f, 4.27f, -910.91f, 24, 1, 0, 0)) { + Game_Flag_Set(227); + Set_Enter(7, 26); + } + return true; + } + return false; +} + +bool SceneScriptDR03::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptDR03::SceneFrameAdvanced(int frame) { + if (frame == 1 || frame == 4 || frame == 8 || frame == 10 || frame == 19 || frame == 21 || frame == 22 || frame == 23 || frame == 30 || frame == 31 || frame == 32 || frame == 33 || frame == 46 || frame == 49) { + if (Random_Query(0, 1)) { + Sound_Play(97, Random_Query(20, 33), 80, 80, 50); + } else { + Sound_Play(59, Random_Query(5, 6), 80, 80, 50); + } + } +} + +void SceneScriptDR03::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptDR03::PlayerWalkedIn() { + if (!Game_Flag_Query(226)) { + if (Random_Query(1, 2) == 1) { + Actor_Says(52, 660, 14); + Actor_Says(52, 680, 14); + } else if (Random_Query(1, 2) == 2) { + Actor_Says(52, 670, 14); + Actor_Says(52, 620, 14); + } else { + Actor_Says(52, 690, 14); + Actor_Says(52, 710, 14); + } + } +} + +void SceneScriptDR03::PlayerWalkedOut() { +} + +void SceneScriptDR03::DialogueQueueFlushed(int a1) { +} + +void SceneScriptDR03::sub_401B18() { + Dialogue_Menu_Clear_List(); + if (Actor_Clue_Query(0, 67) || Actor_Clue_Query(0, 71) || Actor_Clue_Query(0, 68)) { + DM_Add_To_List_Never_Repeat_Once_Selected(650, 5, 5, 5); + } + if (Actor_Clue_Query(0, 67)) { + DM_Add_To_List_Never_Repeat_Once_Selected(660, 5, 5, 5); + } + if (Actor_Clue_Query(0, 279)) { + DM_Add_To_List_Never_Repeat_Once_Selected(670, 6, 5, 2); + } + if (Game_Flag_Query(505)) { + if (Actor_Clue_Query(0, 71)) { + DM_Add_To_List_Never_Repeat_Once_Selected(680, 8, 8, 8); + } + if (Actor_Clue_Query(0, 76)) { + DM_Add_To_List_Never_Repeat_Once_Selected(1270, 2, 5, 7); + } + } + Dialogue_Menu_Add_DONE_To_List(690); + Dialogue_Menu_Appear(320, 240); + int answer = Dialogue_Menu_Query_Input(); + Dialogue_Menu_Disappear(); + switch (answer) { + case 640: + Actor_Says(0, 770, 12); + Actor_Says(52, 110, 12); + Actor_Says(52, 120, 13); + Actor_Says(0, 835, 13); + Actor_Says(52, 130, 14); + Actor_Says(0, 840, 16); + Actor_Says(52, 140, 15); + if (!Game_Flag_Query(505)) { + Actor_Says(52, 150, 13); + Actor_Says(0, 845, 17); + Actor_Says(52, 170, 18); + Actor_Says(52, 180, 16); + Actor_Says(0, 850, 15); + Actor_Says(52, 190, 14); + Actor_Says(52, 200, 13); + Actor_Says(0, 855, 18); + Actor_Says(52, 210, 12); + } + Actor_Clue_Acquire(0, 67, 1, 52); + break; + case 650: + Actor_Says(0, 775, 11); + Actor_Says(52, 220, 14); + Actor_Says(0, 860, 11); + Actor_Says(52, 230, 14); + Actor_Says(0, 865, 11); + Actor_Says(52, 240, 14); + Actor_Says(52, 250, 14); + break; + case 660: + Actor_Says(0, 780, 13); + if (Game_Flag_Query(505)) { + Actor_Says(52, 260, 14); + Actor_Says(52, 270, 13); + Actor_Says(52, 280, 12); + } else { + Actor_Says(52, 260, 14); + Actor_Says(52, 270, 13); + Actor_Says(52, 280, 12); + Actor_Says(0, 870, 18); + Actor_Says(52, 290, 15); + if (!Game_Flag_Query(266)) { + Actor_Says(52, 300, 12); + } + } + Actor_Clue_Acquire(0, 67, 1, 52); + break; + case 670: + Actor_Says(0, 765, 12); + Actor_Says(0, 790, 13); + Actor_Says(52, 310, 12); + Actor_Says(52, 320, 3); + break; + case 680: + Actor_Says(0, 795, 3); + if (Game_Flag_Query(505) == 1) { + Actor_Says(52, 330, 12); + Actor_Says(52, 340, 15); + Actor_Says(0, 875, 16); + Actor_Says(52, 350, 12); + Actor_Says(52, 360, 15); + Game_Flag_Set(326); + } else { + Actor_Says(52, 320, 13); + Actor_Says(52, 150, 14); + Game_Flag_Set(326); + } + break; + case 1270: + Actor_Says(0, 800, 16); + Actor_Says(52, 370, 3); + Actor_Says(0, 880, 15); + Actor_Says(52, 380, 13); + Actor_Says(52, 390, 12); + Actor_Says(0, 885, 14); + Actor_Says(52, 400, 13); + Actor_Says(52, 410, 15); + Actor_Says(0, 890, 18); + Actor_Says(52, 420, 13); + Actor_Says(52, 430, 12); + break; + case 690: + Actor_Says(0, 805, 3); + break; + } +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/dr04.cpp b/engines/bladerunner/script/scene/dr04.cpp new file mode 100644 index 0000000000..4e2a101560 --- /dev/null +++ b/engines/bladerunner/script/scene/dr04.cpp @@ -0,0 +1,269 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptDR04::InitializeScene() { + if (Game_Flag_Query(515)) { + Setup_Scene_Information(0.0f, 0.0f, 0.0f, 0); + } else if (Game_Flag_Query(10)) { + Setup_Scene_Information(-711.0f, -0.04f, 70.0f, 472); + } else if (Game_Flag_Query(229)) { + Setup_Scene_Information(-1067.0f, 7.18f, 421.0f, 125); + } else if (Game_Flag_Query(231)) { + Setup_Scene_Information(-897.75f, 134.45f, 569.75f, 512); + } else { + Setup_Scene_Information(-810.0f, -0.04f, 242.0f, 125); + } + Scene_Exit_Add_2D_Exit(0, 589, 0, 639, 479, 1); + Scene_Exit_Add_2D_Exit(1, 443, 264, 488, 353, 0); + Scene_Exit_Add_2D_Exit(2, 222, 110, 269, 207, 0); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(0); + Ambient_Sounds_Add_Looping_Sound(54, 50, 1, 1); + Ambient_Sounds_Add_Looping_Sound(288, 55, -100, 1); + Ambient_Sounds_Add_Looping_Sound(217, 28, -100, 100); + Ambient_Sounds_Add_Speech_Sound(60, 0, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 20, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 40, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 50, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Sound(67, 40, 180, 16, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(66, 40, 180, 16, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(378, 5, 80, 50, 100, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(379, 5, 80, 50, 100, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(380, 5, 80, 50, 100, 0, 0, -101, -101, 0, 0); + if (Game_Flag_Query(272)) { + Scene_Loop_Set_Default(1); + } else { + Scene_Loop_Set_Default(4); + } + if (Game_Flag_Query(10)) { + if (Game_Flag_Query(272)) { + Scene_Loop_Start_Special(0, 0, 0); + } else { + Scene_Loop_Start_Special(0, 3, 0); + } + } +} + +void SceneScriptDR04::SceneLoaded() { + Obstacle_Object("TRASH CAN WITH FIRE", true); + Obstacle_Object("V2PYLON02", true); + Obstacle_Object("V2PYLON04", true); + Obstacle_Object("U2 CHEWDOOR", true); + Obstacle_Object("MMTRASHCAN", true); + Obstacle_Object("PARKMETR02", true); + Obstacle_Object("TRANSFORMER 01", true); + Obstacle_Object("TRANSFORMER 02", true); + Obstacle_Object("PARKMETR01", true); + Obstacle_Object("Z2ENTRYDR", true); + Obstacle_Object("Z2DR2", true); + Unclickable_Object("PARKMETR01"); + Unclickable_Object("Z2ENTRYDR"); + Unclickable_Object("Z2DR2"); +} + +bool SceneScriptDR04::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptDR04::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptDR04::ClickedOnActor(int actorId) { + if (actorId == 35 && !Player_Query_Combat_Mode()) { + if (Actor_Query_Goal_Number(35) != 21) { + if (Actor_Query_Goal_Number(35) == 23) { + if (!Loop_Actor_Walk_To_Actor(0, 35, 36, 1, false)) { + Actor_Set_Goal_Number(24, 106); + return true; + } + } + return false; + } + if (!Loop_Actor_Walk_To_Waypoint(0, 109, 0, 1, true)) { + Actor_Face_Actor(0, 35, true); + Actor_Says(0, 945, 13); + Actor_Says(35, 0, 3); + Actor_Says(35, 10, 3); + Actor_Says(0, 950, 13); + Actor_Says(35, 20, 3); + Actor_Says(35, 30, 3); + Actor_Says(0, 955, 13); + Actor_Says_With_Pause(35, 40, 0, 3); + Actor_Says(35, 50, 3); + Actor_Clue_Acquire(0, 68, 1, 35); + Actor_Set_Goal_Number(35, 22); + Actor_Set_Goal_Number(24, 101); + return true; + } + return false; + } + return false; +} + +bool SceneScriptDR04::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptDR04::ClickedOnExit(int exitId) { + if (Actor_Query_Goal_Number(35) == 21) { + Actor_Force_Stop_Walking(0); + Actor_Set_Goal_Number(35, 22); + Actor_Set_Goal_Number(24, 101); + return true; + } + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -761.0f, -0.04f, 97.0f, 0, 1, false, 0)) { + Async_Actor_Walk_To_XYZ(0, -683.0f, -0.04f, 43.0f, 0, false); + Game_Flag_Set(11); + Set_Enter(7, 25); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -1067.0f, 7.18f, 421.0f, 0, 1, false, 0)) { + Game_Flag_Set(232); + Game_Flag_Set(228); + Set_Enter(35, 29); + } + return true; + } + if (exitId == 2) { + if (!Loop_Actor_Walk_To_XYZ(0, -851.0f, 6.98f, 560.0f, 0, 1, false, 0)) { + Footstep_Sound_Override_On(3); + Actor_Set_Immunity_To_Obstacles(0, true); + Actor_Face_Heading(0, 512, false); + Loop_Actor_Travel_Stairs(0, 7, 1, 0); + Loop_Actor_Walk_To_XYZ(0, -899.0f, 71.64f, 647.0f, 0, 0, false, 0); + Actor_Face_Heading(0, 0, false); + Loop_Actor_Travel_Stairs(0, 7, 1, 0); + Actor_Set_Immunity_To_Obstacles(0, false); + Footstep_Sound_Override_Off(); + Game_Flag_Set(230); + Set_Enter(36, 30); + } + return true; + } + return true; //bug? +} + +bool SceneScriptDR04::ClickedOn2DRegion(int region) { + return false; +} + +bool SceneScriptDR04::sub_401160() { + float x, y, z; + Actor_Query_XYZ(0, &x, &y, &z); + return (x + 1089.94f) * (x + 1089.94f) + (z - 443.49f) * (z - 443.49f) >= (360.0f * 360.0f); +} + +void SceneScriptDR04::SceneFrameAdvanced(int frame) { + if (Game_Flag_Query(515)) { + Game_Flag_Reset(515); + Game_Flag_Reset(271); + Scene_Loop_Set_Default(1); + Scene_Loop_Start_Special(2, 6, 1); + Music_Stop(4); + Actor_Set_Goal_Number(35, 99); + } else { + if (Game_Flag_Query(271)) { + Game_Flag_Reset(271); + Game_Flag_Set(272); + Scene_Loop_Set_Default(1); + Scene_Loop_Start_Special(2, 6, 1); + Item_Remove_From_World(78); + } + switch (frame) { + case 193: + Sound_Play(301, 100, 0, 100, 50); + Actor_Set_Goal_Number(35, 30); + Player_Loses_Control(); + Actor_Force_Stop_Walking(0); + if (sub_401160()) { + if (Player_Query_Combat_Mode()) { + Actor_Change_Animation_Mode(0, 22); + } else { + Actor_Change_Animation_Mode(0, 21); + } + } else { + Sound_Play_Speech_Line(0, 9905, 100, 0, 99); + Actor_Change_Animation_Mode(0, 48); + Actor_Retired_Here(0, 6, 6, 1, -1); + } + Player_Gains_Control(); + break; + case 235: + if (Actor_Query_Goal_Number(35) != 20 && Actor_Query_Goal_Number(35) != 21 && Actor_Query_Goal_Number(35) != 99) { + Actor_Set_Goal_Number(24, 101); + } + Scene_Exits_Enable(); + break; + case 237: + Overlay_Play("DR04OVER", 0, 1, 1, 0); + break; + } + } +} + +void SceneScriptDR04::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptDR04::PlayerWalkedIn() { + if (Game_Flag_Query(515)) { + Player_Loses_Control(); + Delay(4000); + Actor_Retired_Here(0, 6, 6, 1, -1); + } else { + if (Game_Flag_Query(269) && !Game_Flag_Query(272)) { + Scene_Exits_Disable(); + } + if (Game_Flag_Query(231)) { + Footstep_Sound_Override_On(3); + Actor_Set_Immunity_To_Obstacles(0, true); + Actor_Face_Heading(0, 512, false); + Loop_Actor_Travel_Stairs(0, 7, 0, 0); + Loop_Actor_Walk_To_XYZ(0, -851.0f, 71.64f, 647.0f, 0, 0, false, 0); + Actor_Face_Heading(0, 0, false); + Loop_Actor_Travel_Stairs(0, 7, 0, 0); + Loop_Actor_Walk_To_XYZ(0, -774.85f, 7.18f, 386.67001f, 0, 0, false, 0); + Actor_Set_Immunity_To_Obstacles(0, false); + Footstep_Sound_Override_Off(); + } + } + Game_Flag_Reset(10); + Game_Flag_Reset(229); + Game_Flag_Reset(231); +} + +void SceneScriptDR04::PlayerWalkedOut() { + Music_Stop(2); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); +} + +void SceneScriptDR04::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/dr05.cpp b/engines/bladerunner/script/scene/dr05.cpp new file mode 100644 index 0000000000..0d3908bd94 --- /dev/null +++ b/engines/bladerunner/script/scene/dr05.cpp @@ -0,0 +1,189 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptDR05::InitializeScene() { + Setup_Scene_Information(-22.0f, 0.3f, 221.0f, 0); + Game_Flag_Reset(228); + Scene_Exit_Add_2D_Exit(0, 0, 38, 80, 467, 3); + Ambient_Sounds_Add_Looping_Sound(383, 25, 0, 1); + if (!Game_Flag_Query(272)) { + Overlay_Play("DR05OVER", 0, 1, 0, 0); + } + if (Game_Flag_Query(272)) { + Scene_Loop_Set_Default(2); + } else { + Scene_Loop_Set_Default(0); + } +} + +void SceneScriptDR05::SceneLoaded() { + Obstacle_Object("MAN PROPHI", true); + Unobstacle_Object("BOX06", true); + Unobstacle_Object("BOX183", true); + Clickable_Object("T2 DOORWAY"); + if (!Game_Flag_Query(272)) { + Item_Add_To_World(78, 932, 35, -1.57f, 31.33f, 75.21f, 540, 16, 16, true, true, false, true); + if (!Actor_Query_Goal_Number(35)) { + Item_Add_To_World(122, 931, 35, 37.35f, 1.59f, 46.72f, 0, 20, 20, true, true, false, true); + } + } +} + +bool SceneScriptDR05::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptDR05::ClickedOn3DObject(const char *objectName, bool a2) { + if (Object_Query_Click("T2 DOORWAY", objectName)) { + if (Game_Flag_Query(276) || Actor_Query_Goal_Number(35)) { + if (!Loop_Actor_Walk_To_XYZ(0, 57.61f, 0.3f, 69.27f, 0, 1, false, 0)) { + Actor_Face_Object(0, "T2 DOORWAY", true); + Actor_Says(0, 8522, 13); + Actor_Says(0, 8521, 14); + } + } else { + Actor_Face_Object(0, "T2 DOORWAY", true); + Actor_Says(0, 1020, 14); + Actor_Says(35, 90, 13); + } + return true; + } + return false; +} + +bool SceneScriptDR05::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptDR05::ClickedOnItem(int itemId, bool a2) { + if (itemId == 78) { + if (Player_Query_Combat_Mode()) { + Game_Flag_Set(271); + Actor_Set_Goal_Number(35, 30); + } else if (!Game_Flag_Query(272) && !Loop_Actor_Walk_To_Item(0, 78, 24, 1, true) && Actor_Query_Goal_Number(35) != 11) { + if (!Actor_Query_Goal_Number(35)) { + Actor_Says_With_Pause(0, 1015, 0.1f, 12); + Actor_Says(35, 70, 13); + } + Actor_Set_Goal_Number(35, 30); + } + //return true; //bug? + } + if (itemId == 122 && Player_Query_Combat_Mode() && !Actor_Query_Goal_Number(35)) { + Overlay_Play("DR05OVER", 1, 0, 1, 0); + Item_Remove_From_World(122); + Game_Flag_Set(270); + Actor_Set_Goal_Number(35, 10); + Music_Play(18, 71, 0, 0, -1, 0, 2); + return true; + } + return false; +} + +bool SceneScriptDR05::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -22.0f, 0.3f, 221.0f, 0, 1, false, 0)) { + Game_Flag_Reset(232); + Game_Flag_Set(229); + Set_Enter(7, 28); + } + return true; + } + return false; +} + +bool SceneScriptDR05::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptDR05::SceneFrameAdvanced(int frame) { + if (frame == 49) { + Sound_Play(148, Random_Query(50, 50), 80, 80, 50); + } + if (Game_Flag_Query(271)) { + Item_Remove_From_World(78); + Game_Flag_Reset(271); + Game_Flag_Set(272); + Actor_Set_Goal_Number(35, 30); + } +} + +void SceneScriptDR05::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptDR05::PlayerWalkedIn() { + if (!Game_Flag_Query(511) && !Game_Flag_Query(270) && Game_Flag_Query(272)) { + Item_Remove_From_World(122); + } + if (Game_Flag_Query(272)) { + Loop_Actor_Walk_To_XYZ(0, -10.0f, 0.3f, 133.0f, 0, 0, false, 0); + if (!Game_Flag_Query(511)) { + Game_Flag_Set(511); + if (Game_Flag_Query(48)) { + Actor_Voice_Over(730, 99); + Actor_Voice_Over(740, 99); + Actor_Voice_Over(750, 99); + Actor_Voice_Over(760, 99); + Actor_Clue_Acquire(0, 269, 1, -1); + } else { + Actor_Voice_Over(670, 99); + Actor_Voice_Over(680, 99); + Actor_Voice_Over(700, 99); + Actor_Voice_Over(710, 99); + Actor_Voice_Over(720, 99); + Actor_Clue_Acquire(0, 270, 1, -1); + } + } + } else { + Loop_Actor_Walk_To_XYZ(0, -10.0f, 0.3f, 133.0f, 0, 0, true, 0); + } + if (!Game_Flag_Query(274) && !Actor_Query_Goal_Number(35)) { + Actor_Face_Actor(0, 35, true); + Actor_Says(0, 1010, 13); + Actor_Face_Item(0, 78, true); + Player_Set_Combat_Mode(true); + Actor_Says(35, 60, 12); + Actor_Change_Animation_Mode(0, 0); + Game_Flag_Set(274); + //return true; + } + //return false; +} + +void SceneScriptDR05::PlayerWalkedOut() { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + if (Actor_Query_Goal_Number(35) == 10 || Actor_Query_Goal_Number(35) == 18 || Actor_Query_Goal_Number(35) == 19) { + Actor_Set_Goal_Number(35, 11); + //return true; + } + //return false; +} + +void SceneScriptDR05::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/dr06.cpp b/engines/bladerunner/script/scene/dr06.cpp new file mode 100644 index 0000000000..9000111638 --- /dev/null +++ b/engines/bladerunner/script/scene/dr06.cpp @@ -0,0 +1,224 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptDR06::InitializeScene() { + if (Game_Flag_Query(230)) { + Setup_Scene_Information(-733.57001f, 136.60001f, -968.64001f, 0); + } else { + Setup_Scene_Information(-707.57001f, 136.60001f, -1132.64f, 472); + } + Scene_Exit_Add_2D_Exit(0, 601, 11, 639, 479, 1); + if (Global_Variable_Query(1) > 3 && Game_Flag_Query(715)) { + Scene_Exit_Add_2D_Exit(1, 0, 272, 46, 477, 2); + } + Ambient_Sounds_Add_Looping_Sound(383, 25, 0, 1); + Ambient_Sounds_Add_Sound(73, 5, 60, 20, 20, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(74, 5, 60, 20, 20, -100, 100, -101, -101, 0, 0); + if (Game_Flag_Query(268)) { + Overlay_Play("DR06over", 1, 1, 0, 0); + Ambient_Sounds_Add_Looping_Sound(300, 47, -75, 0); + } else { + Overlay_Play("DR06over", 0, 1, 0, 0); + } + if (Game_Flag_Query(548)) { + Overlay_Play("DR06ovr2", 0, 1, 0, 0); + } +} + +void SceneScriptDR06::SceneLoaded() { + Obstacle_Object("X2_ASHTRAY", true); + Clickable_Object("X2_ASHTRAY"); + Clickable_Object("X2KEYBRD02"); + Clickable_Object("X2_MON01D01"); + Clickable_Object("X2_MON01A04"); + Clickable_Object("X2_TORSO04HIRES"); + Clickable_Object("BOX16"); + if (Actor_Clue_Query(0, 76)) { + Unclickable_Object("X2_TORSO04HIRES"); + } +} + +bool SceneScriptDR06::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptDR06::ClickedOn3DObject(const char *objectName, bool a2) { + if (Object_Query_Click("BOX16", objectName)) { + Loop_Actor_Walk_To_XYZ(0, -743.0f, 136.6f, -1091.0f, 0, 1, false, 0); + Actor_Face_Object(0, "BOX16", true); + if (!Game_Flag_Query(268)) { + Overlay_Play("DR06over", 1, 1, 1, 0); + Ambient_Sounds_Add_Looping_Sound(300, 47, -75, 0); + Game_Flag_Set(268); + return true; + } + Overlay_Play("DR06over", 0, 1, 1, 0); + Ambient_Sounds_Remove_Looping_Sound(300, false); + Game_Flag_Reset(268); + return true; + } + if (Object_Query_Click("X2_MON01A04", objectName)) { + if (Actor_Clue_Query(0, 71)) { + Actor_Face_Object(0, "X2_MON01A04", true); + Actor_Says(0, 8570, 13); + } else if (!Loop_Actor_Walk_To_XYZ(0, -684.94f, 136.6f, -1136.12f, 0, 1, false, 0)) { + Actor_Face_Object(0, "X2_MON01A04", true); + Actor_Says(39, 10, 3); + Actor_Says(39, 20, 3); + Actor_Says(39, 30, 3); + Actor_Says(0, 1025, 13); + Actor_Says(56, 0, 3); + Actor_Says(56, 10, 3); + Actor_Says(56, 20, 3); + Actor_Says(56, 30, 3); + Actor_Says(56, 40, 3); + Actor_Says(56, 50, 3); + Actor_Says(39, 40, 3); + Actor_Says(0, 1030, 13); + Actor_Says(39, 50, 3); + Actor_Clue_Acquire(0, 71, 1, 39); + } + return true; + } + if (Object_Query_Click("X2_MON01D01", objectName)) { + if (!Loop_Actor_Walk_To_XYZ(0, -645.34f, 136.6f, -1047.37f, 0, 1, false, 0)) { + Actor_Face_Heading(0, 329, false); + if (Actor_Clue_Query(0, 125) && Actor_Clue_Query(0, 126) && !Game_Flag_Query(670)) { + Actor_Set_Goal_Number(0, 350); + Game_Flag_Set(670); + } else if (Game_Flag_Query(280)) { + Actor_Says(0, 8570, 13); + } else { + Actor_Voice_Over(770, 99); + Actor_Voice_Over(780, 99); + Actor_Voice_Over(790, 99); + Actor_Voice_Over(800, 99); + Game_Flag_Set(280); + } + } + return true; + } + if (Object_Query_Click("X2_KEYBRD02", objectName) && !Game_Flag_Query(278)) { + Loop_Actor_Walk_To_XYZ(0, -655.57f, 136.6f, -1092.64f, 0, 1, false, 0); + Actor_Face_Object(0, "X2_KEYBRD02", true); + Actor_Voice_Over(830, 99); + Actor_Voice_Over(840, 99); + Game_Flag_Set(278); + return true; + } + if (Object_Query_Click("X2_TORSO04HIRES", objectName)) { + if (!Loop_Actor_Walk_To_XYZ(0, -700.0f, 136.6f, -1133.0f, 4, 1, false, 0)) { + Actor_Face_Object(0, "x2_TORSO04HIRES", true); + if (Global_Variable_Query(39) > 12) { + return true; + } + if (Game_Flag_Query(548)) { + Overlay_Remove("DR06ovr2"); + Game_Flag_Reset(548); + Sound_Play(161, 100, 0, 0, 50); + } else { + Overlay_Play("DR06ovr2", 0, 1, 0, 0); + Game_Flag_Set(548); + Sound_Play(160, 100, 0, 0, 50); + if (!Actor_Clue_Query(0, 76)) { + Actor_Voice_Over(850, 99); + Item_Pickup_Spin_Effect(944, 171, 280); + Actor_Voice_Over(860, 99); + Actor_Voice_Over(870, 99); + Actor_Voice_Over(880, 99); + Actor_Clue_Acquire(0, 76, 1, 13); + if (Query_Difficulty_Level() != 0) { + Global_Variable_Increment(2, 200); + } + } + } + Global_Variable_Increment(39, 1); + if (Global_Variable_Query(39) > 12) { + Sound_Play(204, 100, 0, 0, 50); + Unclickable_Object("X2_TORSO04HIRES"); + } + } + return true; + } + Actor_Face_Object(0, "X2_MON01D01", true); + Actor_Says(0, 8525, 13); + return true; +} + +bool SceneScriptDR06::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptDR06::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptDR06::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -733.0f, 136.6f, -980.0f, 0, 1, false, 0)) { + Game_Flag_Set(231); + Set_Enter(7, 28); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -707.57f, 136.6f, -1132.64f, 0, 1, false, 0)) { + Game_Flag_Set(552); + Set_Enter(19, 100); + } + return true; + } + return false; +} + +bool SceneScriptDR06::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptDR06::SceneFrameAdvanced(int frame) { +} + +void SceneScriptDR06::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptDR06::PlayerWalkedIn() { + if (Game_Flag_Query(230)) { + Loop_Actor_Walk_To_XYZ(0, -729.57f, 136.6f, -1016.0f, 0, 0, false, 0); + } + Game_Flag_Reset(230); + Game_Flag_Reset(551); +} + +void SceneScriptDR06::PlayerWalkedOut() { + Overlay_Remove("DR06over"); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(0); + Ambient_Sounds_Remove_All_Looping_Sounds(1); +} + +void SceneScriptDR06::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/hc01.cpp b/engines/bladerunner/script/scene/hc01.cpp new file mode 100644 index 0000000000..891fa3e216 --- /dev/null +++ b/engines/bladerunner/script/scene/hc01.cpp @@ -0,0 +1,433 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptHC01::InitializeScene() { + Music_Play(0, 31, 0, 2, -1, 1, 2); + if (Game_Flag_Query(385)) { + Setup_Scene_Information(64.0f, 0.14f, 83.0f, 266); + } else if (Game_Flag_Query(387)) { + Setup_Scene_Information(607.0f, 0.14f, 9.0f, 530); + } else { + Setup_Scene_Information(780.0f, 0.14f, 153.0f, 815); + } + Scene_Exit_Add_2D_Exit(0, 0, 460, 639, 479, 2); + if (Game_Flag_Query(402)) { + Scene_Exit_Add_2D_Exit(1, 394, 229, 485, 371, 1); + } + Scene_Exit_Add_2D_Exit(2, 117, 0, 286, 319, 0); + Ambient_Sounds_Add_Looping_Sound(103, 50, 50, 0); + Ambient_Sounds_Add_Looping_Sound(241, 50, 50, 0); + Ambient_Sounds_Add_Sound(242, 3, 30, 16, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(243, 3, 30, 16, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(244, 3, 30, 16, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(245, 3, 30, 16, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(246, 3, 30, 16, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(247, 3, 30, 16, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(248, 3, 30, 16, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(249, 3, 30, 16, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(181, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(183, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(184, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(185, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(186, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(188, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(189, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(190, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(192, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(193, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(194, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Scene_Loop_Set_Default(0); +} + +void SceneScriptHC01::SceneLoaded() { + Obstacle_Object("PILLAR", true); + if (Game_Flag_Query(322)) { + Preload(19); + Preload(426); + Preload(430); + Preload(437); + Preload(427); + Preload(431); + Preload(433); + Preload(424); + Preload(428); + Preload(436); + Preload(429); + Preload(425); + Preload(432); + } +} + +bool SceneScriptHC01::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptHC01::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptHC01::ClickedOnActor(int actorId) { + if (actorId == 7 && (Actor_Query_Goal_Number(7) == 150 || Actor_Query_Goal_Number(7) == 0)) { + AI_Movement_Track_Pause(7); + if (!Loop_Actor_Walk_To_XYZ(0, 624.43f, 0.14f, 83.0f, 0, 1, false, 0)) { + if (Game_Flag_Query(400)) { + Actor_Face_Actor(0, 7, true); + Actor_Face_Actor(7, 0, true); + sub_402384(); + } else { + Actor_Face_Actor(7, 0, true); + Actor_Says_With_Pause(7, 10, 0.2f, 13); + Actor_Face_Actor(0, 7, true); + Actor_Says(7, 20, 17); + Actor_Says(0, 1035, 18); + Actor_Says_With_Pause(7, 30, 0.2f, 17); + Actor_Says_With_Pause(7, 40, 0.0f, 13); + Actor_Says(7, 50, 12); + Actor_Says_With_Pause(0, 1040, 1.2f, 13); + Actor_Says(7, 60, 16); + Actor_Says_With_Pause(7, 70, 1.0f, 13); + Actor_Says_With_Pause(0, 1045, 0.6f, 14); + Actor_Says(7, 80, 18); + Game_Flag_Set(400); + } + } + AI_Movement_Track_Unpause(7); + } + return false; +} + +bool SceneScriptHC01::ClickedOnItem(int itemId, bool a2) { + if (itemId == 107) { + Item_Remove_From_World(107); + Item_Pickup_Spin_Effect(977, 361, 381); + Delay(1500); + Item_Pickup_Spin_Effect(984, 377, 397); + Delay(1500); + Item_Pickup_Spin_Effect(984, 330, 384); + if (Game_Flag_Query(374)) { + Actor_Clue_Acquire(0, 246, 1, 7); + } else { + Actor_Clue_Acquire(0, 247, 1, 7); + } + Actor_Clue_Acquire(0, 260, 1, 7); + return true; + } + return false; +} + +bool SceneScriptHC01::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, 814.0f, 0.14f, 153.0f, 0, 1, false, 0)) { + Music_Adjust(12, 0, 2); + Game_Flag_Set(323); + Set_Enter(0, 0); + Game_Flag_Reset(479); + Game_Flag_Set(180); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, 607.0f, 0.14f, 9.0f, 0, 1, false, 0)) { + Game_Flag_Set(386); + Set_Enter(8, 33); + } + return true; + } + if (exitId == 2) { + if (!Loop_Actor_Walk_To_XYZ(0, 105.0f, 0.14f, 103.0f, 0, 1, false, 0)) { + Game_Flag_Set(384); + Async_Actor_Walk_To_XYZ(0, -57.0f, 0.14f, 83.0f, 0, false); + Set_Enter(8, 32); + } + return true; + } + return false; +} + +bool SceneScriptHC01::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptHC01::SceneFrameAdvanced(int frame) { + Set_Fade_Color(1.0f, 1.0f, 1.0f); + if (frame >= 61 && frame < 65) { + Set_Fade_Density((frame - 61) / 4.0f); + } else if (frame >= 65 && frame < 93) { + Set_Fade_Density(1.0f); + } else if (frame >= 93 && frame < 106) { + Set_Fade_Density((105 - frame) / 13.0f); + } else { + Set_Fade_Density(0.0f); + } + if (frame == 61) { + Ambient_Sounds_Play_Sound(312, 90, 0, 0, 0); + } + if (frame == 65) { + Ambient_Sounds_Play_Sound(315, 50, 0, 100, 0); + } + if (frame == 80) { + Ambient_Sounds_Play_Sound(316, 40, 100, 100, 0); + Item_Add_To_World(121, 931, 8, 582.0f, 27.0f, -41.0f, 0, 8, 8, true, true, false, true); + } +} + +void SceneScriptHC01::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptHC01::PlayerWalkedIn() { + if (Game_Flag_Query(385)) { + Loop_Actor_Walk_To_XYZ(0, 105.0f, 0.14f, 103.0f, 0, 0, false, 0); + Game_Flag_Reset(385); + } + if (Game_Flag_Query(387)) { + Game_Flag_Reset(387); + } + if (Game_Flag_Query(322)) { + Game_Flag_Reset(322); + } +} + +void SceneScriptHC01::PlayerWalkedOut() { + Set_Fade_Density(0.0f); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); +} + +void SceneScriptHC01::DialogueQueueFlushed(int a1) { +} + +void SceneScriptHC01::sub_402384() { + if (!Game_Flag_Query(401)) { + Actor_Says(0, 1055, 13); + Actor_Says(7, 130, 13); + Actor_Says_With_Pause(0, 1060, 0.2f, 13); + Actor_Says(7, 140, 13); + Game_Flag_Set(401); + } + Dialogue_Menu_Clear_List(); + if (Actor_Clue_Query(0, 56) == 1) { + DM_Add_To_List_Never_Repeat_Once_Selected(1020, 6, 7, 3); + } else if (Actor_Clue_Query(0, 44) || Actor_Clue_Query(0, 47) || Actor_Clue_Query(0, 14)) { + DM_Add_To_List_Never_Repeat_Once_Selected(1010, 6, 7, 3); + } + if (Actor_Clue_Query(0, 58) == 1) { + DM_Add_To_List_Never_Repeat_Once_Selected(1030, 1, 5, 7); + } else if (Actor_Clue_Query(0, 5) == 1) { + DM_Add_To_List_Never_Repeat_Once_Selected(1040, 4, 4, 6); + } + if (Actor_Clue_Query(0, 181) == 1) { + DM_Add_To_List_Never_Repeat_Once_Selected(1050, -1, 3, 8); + } else if (Actor_Clue_Query(0, 180) == 1) { + DM_Add_To_List_Never_Repeat_Once_Selected(1060, -1, 3, 8); + } + if (!Dialogue_Menu_Query_List_Size()) { + Actor_Says_With_Pause(0, 1105, 1.2f, 13); + if (Actor_Query_Friendliness_To_Other(7, 0) < 50) { + Actor_Says(7, 550, 15); + } else { + Actor_Says(7, 250, 13); + Actor_Modify_Friendliness_To_Other(7, 0, -1); + if (Actor_Query_Friendliness_To_Other(7, 0) < 47 && Query_Difficulty_Level() == 0) { + sub_40346C(); + } + } + return; + } + Dialogue_Menu_Add_DONE_To_List(100); + bool end = false; + do { + Dialogue_Menu_Appear(320, 240); + int answer = Dialogue_Menu_Query_Input(); + Dialogue_Menu_Disappear(); + if (answer == 1020) { + Dialogue_Menu_Remove_From_List(1020); + Actor_Says(0, 1065, 15); + Actor_Says(7, 160, 3); + Actor_Says(0, 1110, 16); + Actor_Says(7, 170, 3); + Actor_Says(7, 180, 3); + Actor_Says(7, 190, 12); + if (Query_Difficulty_Level() < 2) { + Actor_Modify_Friendliness_To_Other(7, 0, -2); + } + } + if (answer == 1010) { + Dialogue_Menu_Remove_From_List(1010); + Actor_Clue_Acquire(0, 60, 0, 7); + Actor_Says(0, 1070, 13); + Actor_Says(7, 200, 17); + Actor_Says(7, 210, 12); + Actor_Says(0, 1115, 12); + Actor_Says(7, 220, 16); + Actor_Says(7, 230, 3); + Actor_Says(7, 240, 15); + if (Query_Difficulty_Level() < 2) { + Actor_Modify_Friendliness_To_Other(7, 0, -1); + } + } + if (answer == 1010 || answer == 1020) { + Actor_Says_With_Pause(0, 1120, 0.9f, 17); + Actor_Says(7, 250, 13); + Actor_Says(0, 1125, 14); + if (Actor_Query_Friendliness_To_Other(7, 0) < 47) { + Actor_Set_Goal_Number(7, 1); + Player_Loses_Control(); + Actor_Says(7, 90, 3); + Actor_Face_Actor(7, 0, true); + Actor_Says(7, 100, 3); + Actor_Says(7, 110, 3); + Actor_Says_With_Pause(0, 1050, 0.2f, 3); + Actor_Says(7, 120, 3); + Actor_Set_Goal_Number(7, 2); + } + end = true; + } + if (answer == 1030) { + Dialogue_Menu_Remove_From_List(1030); + Actor_Says(0, 1075, 18); + Actor_Says(7, 260, 12); + Actor_Says(7, 270, 16); + Actor_Says(0, 1130, 14); + Actor_Says(7, 280, 17); + Actor_Says(0, 1135, 15); + Actor_Says(7, 290, 15); + Actor_Says(7, 300, 12); + Actor_Says(7, 310, 17); + Actor_Says(0, 1140, 3); + if (Query_Difficulty_Level() < 2) { + Actor_Modify_Friendliness_To_Other(7, 0, -2); + } + if (Actor_Query_Friendliness_To_Other(7, 0) < 47) { + Actor_Set_Goal_Number(7, 1); + Player_Loses_Control(); + Actor_Says(7, 90, 3); + Actor_Face_Actor(7, 0, true); + Actor_Says(7, 100, 3); + Actor_Says(7, 110, 3); + Actor_Says_With_Pause(0, 1050, 0.2f, 3); + Actor_Says(7, 120, 3); + Actor_Set_Goal_Number(7, 2); + } + end = true; + } + if (answer == 1040) { + Dialogue_Menu_Remove_From_List(1040); + Actor_Says(0, 1080, 15); + Actor_Says(0, 1085, 17); + Actor_Says(7, 320, 17); + Actor_Says(0, 1145, 13); + Actor_Says(7, 330, 17); + Actor_Says(7, 340, 13); + Actor_Says(7, 350, 12); + end = true; + } + if (answer == 1050) { + Dialogue_Menu_Remove_From_List(1050); + Actor_Says(0, 1090, 18); + Actor_Says(7, 360, 14); + Actor_Says(0, 1150, 17); + Actor_Says(7, 370, 13); + Actor_Says(0, 1155, 15); + Actor_Says(7, 380, 12); + Actor_Says(0, 1160, 14); + Actor_Says(0, 1165, 18); + Actor_Says(7, 390, 16); + Actor_Says(0, 1170, 12); + Actor_Says(7, 400, 13); + Actor_Says(0, 1180, 14); + Actor_Says(7, 410, 12); + Actor_Says(7, 420, 16); + Actor_Says(7, 430, 17); + Actor_Says(7, 440, 13); + Actor_Modify_Friendliness_To_Other(7, 0, -4); + if (Actor_Query_Friendliness_To_Other(7, 0) < 47) { + Actor_Set_Goal_Number(7, 1); + Player_Loses_Control(); + Actor_Says(7, 90, 3); + Actor_Face_Actor(7, 0, true); + Actor_Says(7, 100, 3); + Actor_Says(7, 110, 3); + Actor_Says_With_Pause(0, 1050, 0.2f, 3); + Actor_Says(7, 120, 3); + Actor_Set_Goal_Number(7, 2); + } + end = true; + } + if (answer == 1060) { + Dialogue_Menu_Remove_From_List(1060); + Actor_Says(0, 1095, 15); + Actor_Says_With_Pause(0, 1100, 1.2f, 18); + Actor_Says(7, 450, 12); + Actor_Says(7, 460, 13); + Actor_Says(0, 1185, 18); + Actor_Says(7, 470, 14); + Actor_Says(0, 1190, 14); + Actor_Says(7, 480, 13); + Actor_Says(0, 1195, 16); + Actor_Says(0, 1200, 18); + Actor_Says(7, 490, 12); + Actor_Says(0, 1205, 14); + Actor_Says(7, 500, 14); + Actor_Says(7, 510, 17); + Actor_Says(7, 520, 16); + Actor_Says(7, 530, 15); + Actor_Says(0, 1210, 16); + Actor_Modify_Friendliness_To_Other(7, 0, -4); + if (Actor_Query_Friendliness_To_Other(7, 0) < 47) { + Actor_Set_Goal_Number(7, 1); + Player_Loses_Control(); + Actor_Says(7, 90, 3); + Actor_Face_Actor(7, 0, true); + Actor_Says(7, 100, 3); + Actor_Says(7, 110, 3); + Actor_Says_With_Pause(0, 1050, 0.2f, 3); + Actor_Says(7, 120, 3); + Actor_Set_Goal_Number(7, 2); + } + end = true; + } + if (answer == 100) { + end = true; + } + } while (!end); +} + +void SceneScriptHC01::sub_40346C() { + Actor_Set_Goal_Number(7, 1); + Player_Loses_Control(); + Actor_Says(7, 90, 3); + Actor_Face_Actor(7, 0, true); + Actor_Says(7, 100, 3); + Actor_Says(7, 110, 3); + Actor_Says_With_Pause(0, 1050, 0.2f, 3); + Actor_Says(7, 120, 3); + Actor_Set_Goal_Number(7, 2); +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/hc02.cpp b/engines/bladerunner/script/scene/hc02.cpp new file mode 100644 index 0000000000..e4e2ee388d --- /dev/null +++ b/engines/bladerunner/script/scene/hc02.cpp @@ -0,0 +1,216 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptHC02::InitializeScene() { + Music_Play(4, 45, -60, 1, -1, 1, 3); + if (Game_Flag_Query(109)) { + Setup_Scene_Information(-88.0f, 0.14f, -463.0f, 540); + } else { + Setup_Scene_Information(-57.0f, 0.14f, 83.0f, 746); + } + Scene_Exit_Add_2D_Exit(0, 589, 255, 639, 479, 1); + Scene_Exit_Add_2D_Exit(1, 505, 0, 639, 170, 0); + Ambient_Sounds_Add_Looping_Sound(103, 50, 50, 0); + Ambient_Sounds_Add_Looping_Sound(280, 50, 50, 0); + Ambient_Sounds_Add_Sound(252, 3, 60, 33, 33, -60, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(254, 3, 60, 33, 33, -60, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(255, 3, 60, 33, 33, -60, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(256, 3, 60, 33, 33, -60, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(257, 3, 60, 33, 33, -60, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(258, 3, 60, 33, 33, -60, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(259, 3, 60, 33, 33, -100, 20, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(260, 3, 60, 33, 33, -100, 20, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(261, 3, 60, 33, 33, -100, 20, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(262, 3, 60, 33, 33, -100, 20, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(184, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(185, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(186, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(188, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(189, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(192, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(242, 3, 30, 14, 14, 30, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(243, 3, 30, 14, 14, 30, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(244, 3, 30, 14, 14, 30, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(245, 3, 30, 14, 14, 30, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(246, 3, 30, 14, 14, 30, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(247, 3, 30, 14, 14, 30, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(248, 3, 30, 14, 14, 30, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(249, 3, 30, 14, 14, 30, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(238, 3, 50, 20, 20, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(240, 3, 50, 25, 25, -100, 100, -101, -101, 0, 0); + if (Game_Flag_Query(384)) { + Scene_Loop_Start_Special(0, 0, 0); + Scene_Loop_Set_Default(1); + Game_Flag_Reset(384); + } else { + Scene_Loop_Set_Default(1); + } +} + +void SceneScriptHC02::SceneLoaded() { + Obstacle_Object("BARSTOOL01", true); +} + +bool SceneScriptHC02::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptHC02::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptHC02::ClickedOnActor(int actorId) { + if (actorId == 32) { + if (!Loop_Actor_Walk_To_XYZ(0, -150.51f, 0.14f, 62.74f, 0, 1, false, 0)) { + Actor_Face_Actor(0, 32, true); + if (!Game_Flag_Query(404)) { + Actor_Says(0, 1225, 13); + Actor_Says_With_Pause(32, 0, 0.0f, 13); + Actor_Says(32, 10, 16); + Actor_Set_Goal_Number(32, 1); + Actor_Change_Animation_Mode(0, 23); + Delay(1500); + Actor_Change_Animation_Mode(0, 75); + Delay(1500); + Global_Variable_Increment(42, 1); + Game_Flag_Set(404); + } else if (Actor_Clue_Query(0, 254) && !Actor_Clue_Query(0, 257)) { + Actor_Says(0, 4545, 11); + Actor_Says(32, 120, 12); + Actor_Says(32, 180, 13); + Actor_Clue_Acquire(0, 257, 1, 32); + Item_Pickup_Spin_Effect(975, 229, 215); + } else if (Actor_Clue_Query(0, 122) && !Actor_Clue_Query(0, 131) && (Global_Variable_Query(2) > 20 || Query_Difficulty_Level() == 0)) { + Actor_Clue_Acquire(0, 131, 1, 32); + Actor_Says(0, 1230, 13); + Actor_Says(32, 20, 12); + Actor_Says(0, 1235, 13); + Actor_Says(32, 30, 15); + Actor_Says(0, 1240, 13); + Actor_Says(32, 40, 14); + Item_Pickup_Spin_Effect(945, 229, 215); + Actor_Set_Goal_Number(32, 2); + Actor_Change_Animation_Mode(0, 23); + Delay(1500); + Actor_Says_With_Pause(32, 50, 1.6f, 17); + if (Query_Difficulty_Level() != 0) { + Global_Variable_Decrement(2, 20); + } + Actor_Says(0, 1245, 13); + } else { + if (Actor_Clue_Query(0, 75) && !Game_Flag_Query(405)) { + Actor_Says(32, 80, 16); + Actor_Says(0, 1265, 13); + Actor_Says(32, 90, 13); + Game_Flag_Set(405); + } + if (Global_Variable_Query(2) > 5 || Query_Difficulty_Level() == 0) { + if (Query_Difficulty_Level() != 0) { + Global_Variable_Decrement(2, 5); + } + Global_Variable_Increment(42, 1); + Actor_Says(0, 1250, 13); + Actor_Says_With_Pause(32, 60, 0.8f, 14); + Actor_Says(0, 1255, 13); + Actor_Set_Goal_Number(32, 1); + Actor_Change_Animation_Mode(0, 23); + Delay(1500); + Actor_Change_Animation_Mode(0, 75); + Delay(1500); + } else { + Actor_Says_With_Pause(0, 1260, 0.3f, 13); + Actor_Says(32, 70, 14); + } + } + } + return true; + } + return false; +} + +bool SceneScriptHC02::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptHC02::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, 7.0f, 0.14f, 79.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(385); + Set_Enter(8, 31); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -76.0f, 0.14f, -339.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(110); + Async_Actor_Walk_To_XYZ(0, -88.0f, 0.14f, -463.0f, 0, false); + Set_Enter(8, 106); + } + return true; + } + return false; +} + +bool SceneScriptHC02::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptHC02::SceneFrameAdvanced(int frame) { + if (frame == 70) { + Sound_Play(73, 11, 50, -90, 50); + } + if (frame == 58) { + Sound_Play(73, 11, 50, -90, 50); + } + if (frame == 69 || frame == 77 || frame == 86 || frame == 95 || frame == 104 || frame == 113 || frame == 119) { + Sound_Play(60, Random_Query(6, 7), -20, 20, 50); + } +} + +void SceneScriptHC02::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptHC02::PlayerWalkedIn() { + if (Game_Flag_Query(109)) { + Loop_Actor_Walk_To_XYZ(0, -76.0f, 0.14f, -339.0f, 0, 0, false, 0); + Game_Flag_Reset(109); + } +} + +void SceneScriptHC02::PlayerWalkedOut() { +} + +void SceneScriptHC02::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/hc03.cpp b/engines/bladerunner/script/scene/hc03.cpp new file mode 100644 index 0000000000..8758e3eff4 --- /dev/null +++ b/engines/bladerunner/script/scene/hc03.cpp @@ -0,0 +1,188 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptHC03::InitializeScene() { + if (Game_Flag_Query(318)) { + Setup_Scene_Information(656.0f, 1.61f, -95.0f, 497); + Game_Flag_Set(388); + Game_Flag_Reset(318); + } else { + Setup_Scene_Information(607.0f, 0.14f, 13.0f, 57); + Game_Flag_Reset(386); + } + Scene_Exit_Add_2D_Exit(0, 0, 0, 30, 479, 3); + if (Game_Flag_Query(403) || Global_Variable_Query(1) > 3) { + Item_Remove_From_World(121); + Game_Flag_Set(403); + Scene_Exit_Add_2D_Exit(1, 400, 275, 515, 375, 2); + } + Ambient_Sounds_Add_Looping_Sound(103, 50, 50, 0); + Ambient_Sounds_Add_Looping_Sound(241, 50, 50, 0); + Ambient_Sounds_Add_Sound(242, 3, 30, 16, 16, -100, -70, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(243, 3, 30, 16, 16, -100, -70, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(244, 3, 30, 16, 16, -100, -70, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(245, 3, 30, 16, 16, -100, -70, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(246, 3, 30, 16, 16, -100, -70, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(247, 3, 30, 16, 16, -100, -70, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(248, 3, 30, 16, 16, -100, -70, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(249, 3, 30, 16, 16, -100, -70, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(238, 3, 50, 25, 25, -100, -70, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(240, 3, 50, 33, 33, -100, -70, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(181, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(183, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(184, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(185, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(186, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(188, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(189, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(190, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(192, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(193, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(194, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + if (Game_Flag_Query(388)) { + Scene_Loop_Set_Default(6); + } else if (Game_Flag_Query(403) || Global_Variable_Query(1) > 3) { + Scene_Loop_Set_Default(3); + } else { + Scene_Loop_Set_Default(0); + } +} + +void SceneScriptHC03::SceneLoaded() { + Obstacle_Object("GUITAR01", true); + if (Game_Flag_Query(403) || Game_Flag_Query(388) || Global_Variable_Query(1) > 3) { + Unobstacle_Object("GPscisGate", true); + } else { + Obstacle_Object("GPscisGate", true); + } + Unclickable_Object("GUITAR01"); +} + +bool SceneScriptHC03::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptHC03::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptHC03::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptHC03::ClickedOnItem(int itemId, bool a2) { + if (itemId == 121) { + if (a2) { + Scene_Loop_Set_Default(3); + Scene_Loop_Start_Special(2, 2, 1); + Game_Flag_Set(403); + Item_Remove_From_World(121); + Unobstacle_Object("GPscisGate", true); + } else { + Actor_Says(0, 8522, 12); + } + return true; + } + if (itemId == 107) { + Item_Remove_From_World(107); + Item_Pickup_Spin_Effect(977, 68, 435); + Delay(1500); + Item_Pickup_Spin_Effect(984, 78, 435); + Delay(1500); + Item_Pickup_Spin_Effect(984, 58, 435); + if (Game_Flag_Query(374)) { + Actor_Clue_Acquire(0, 246, 1, 7); + } else { + Actor_Clue_Acquire(0, 247, 1, 7); + } + Actor_Clue_Acquire(0, 260, 1, 7); + return true; + } + return false; +} + +bool SceneScriptHC03::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, 607.0f, 0.14f, 9.0f, 0, 1, false, 0)) { + Game_Flag_Set(387); + Set_Enter(8, 31); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, 628.0f, 2.04f, -123.0f, 0, 1, false, 0)) { + if (Game_Flag_Query(388)) { + Game_Flag_Set(319); + Game_Flag_Reset(479); + Game_Flag_Set(259); + Game_Flag_Set(388); + Music_Stop(2); + Set_Enter(75, 87); + } else { + Scene_Loop_Set_Default(6); + Scene_Loop_Start_Special(2, 5, 1); + Game_Flag_Set(388); + } + } + return true; + } + return false; +} + +bool SceneScriptHC03::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptHC03::SceneFrameAdvanced(int frame) { + if (frame == 10 || frame == 19 || frame == 29 || frame == 39 || frame == 49 || frame == 59 || frame == 71 || frame == 82 || frame == 91 || frame == 101 || frame == 111 || frame == 121 || frame == 131) { + Sound_Play(281, Random_Query(33, 50), 50, 50, 50); + } + if (!Game_Flag_Query(521) && frame == 66) { + Ambient_Sounds_Play_Sound(328, 90, 0, -40, 99); + Sound_Play(201, Random_Query(47, 47), 0, -40, 50); + Scene_Exit_Add_2D_Exit(1, 400, 275, 515, 375, 2); + Game_Flag_Set(521); + } +} + +void SceneScriptHC03::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptHC03::PlayerWalkedIn() { +} + +void SceneScriptHC03::PlayerWalkedOut() { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); +} + +void SceneScriptHC03::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/hc04.cpp b/engines/bladerunner/script/scene/hc04.cpp new file mode 100644 index 0000000000..5f22cdd40c --- /dev/null +++ b/engines/bladerunner/script/scene/hc04.cpp @@ -0,0 +1,242 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptHC04::InitializeScene() { + if (Game_Flag_Query(108)) { + Setup_Scene_Information(-112.0f, 0.14f, -655.0f, 460); + Game_Flag_Reset(108); + } else { + Setup_Scene_Information(-88.0f, 0.14f, -463.0f, 1013); + } + Music_Play(4, 14, -90, 1, -1, 1, 2); + Actor_Put_In_Set(59, 8); + Actor_Set_At_XYZ(59, -210.0f, 0.0f, -445.0f, 250); + Scene_Exit_Add_2D_Exit(0, 539, 51, 639, 309, 0); + Scene_Exit_Add_2D_Exit(1, 0, 456, 639, 479, 2); + Ambient_Sounds_Add_Looping_Sound(103, 50, 50, 0); + Ambient_Sounds_Add_Looping_Sound(329, 16, 16, 0); + Ambient_Sounds_Add_Looping_Sound(330, 40, 40, 0); + Ambient_Sounds_Add_Sound(182, 5, 70, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(184, 5, 70, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(185, 5, 70, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(186, 5, 70, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(188, 5, 70, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(189, 5, 70, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(191, 5, 70, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(192, 5, 70, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(195, 5, 70, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(252, 3, 60, 16, 16, -100, -100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(252, 3, 60, 16, 16, -100, -100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(254, 3, 60, 16, 16, -100, -100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(255, 3, 60, 16, 16, -100, -100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(256, 3, 60, 16, 16, -100, -100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(257, 3, 60, 16, 16, -100, -100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(258, 3, 60, 16, 16, -100, -100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(259, 3, 60, 16, 16, -100, -100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(260, 3, 60, 16, 16, -100, -100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(261, 3, 60, 16, 16, -100, -100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(262, 3, 60, 16, 16, -100, -100, -101, -101, 0, 0); + if (Game_Flag_Query(110)) { + Scene_Loop_Start_Special(0, 0, 0); + Scene_Loop_Set_Default(1); + Game_Flag_Reset(110); + } else { + Scene_Loop_Set_Default(1); + } +} + +void SceneScriptHC04::SceneLoaded() { + Obstacle_Object("CAN FIRE", true); + Unobstacle_Object("ASIANMALE01", true); + Clickable_Object("CAN FIRE"); +} + +bool SceneScriptHC04::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptHC04::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptHC04::ClickedOnActor(int actorId) { + if (actorId == 59) { + if (!Loop_Actor_Walk_To_XYZ(0, -155.0f, 0.0f, -475.0f, 12, 1, false, 0)) { + Actor_Face_Actor(0, 59, true); + Actor_Face_Actor(59, 0, true); + if (Game_Flag_Query(106)) { + sub_401B90(); + return true; + } else { + Actor_Says(59, 0, 3); + Actor_Says(0, 1280, 3); + Actor_Says(59, 20, 3); + Game_Flag_Set(106); + return true; + } + } + } + return false; +} + +bool SceneScriptHC04::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptHC04::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -108.0f, 0.14f, -639.0f, 0, 1, false, 0)) { + Music_Stop(2); + Game_Flag_Set(107); + Game_Flag_Reset(479); + Game_Flag_Set(182); + Set_Enter(70, 80); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -72.0f, 0.14f, -399.0f, 0, 1, false, 0)) { + Game_Flag_Set(109); + Set_Enter(8, 32); + } + return true; + } + return false; +} + +bool SceneScriptHC04::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptHC04::SceneFrameAdvanced(int frame) { +} + +void SceneScriptHC04::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptHC04::PlayerWalkedIn() { +} + +void SceneScriptHC04::PlayerWalkedOut() { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); +} + +void SceneScriptHC04::DialogueQueueFlushed(int a1) { +} + +void SceneScriptHC04::sub_401B90() { + Dialogue_Menu_Clear_List(); + if (Actor_Clue_Query(0, 263) || Actor_Clue_Query(0, 53)) { + if (Actor_Clue_Query(0, 47)) { + DM_Add_To_List_Never_Repeat_Once_Selected(340, 5, 6, 5); + } else if (Actor_Clue_Query(0, 259)) { + DM_Add_To_List_Never_Repeat_Once_Selected(350, 5, 6, 5); + } + DM_Add_To_List_Never_Repeat_Once_Selected(360, 6, 4, 3); + } + if (Actor_Clue_Query(0, 87) && !Actor_Clue_Query(0, 101)) { + DM_Add_To_List_Never_Repeat_Once_Selected(370, 3, 4, 7); + } + if (Actor_Clue_Query(0, 101)) { + DM_Add_To_List_Never_Repeat_Once_Selected(380, -1, 5, 8); + } + DM_Add_To_List_Never_Repeat_Once_Selected(390, 7, 5, -1); + Dialogue_Menu_Add_DONE_To_List(400); + Dialogue_Menu_Appear(320, 240); + int answer = Dialogue_Menu_Query_Input(); + Dialogue_Menu_Disappear(); + switch (answer) { + case 340: + Actor_Says(0, 1285, 3); + Actor_Says(59, 50, 3); + Actor_Says(0, 1330, 3); + Actor_Says(59, 60, 3); + break; + case 350: + Actor_Says(0, 1290, 3); + Actor_Says(59, 70, 3); + Actor_Says(0, 1335, 3); + Actor_Says(59, 80, 3); + Actor_Says(0, 1340, 3); + Actor_Says(59, 90, 3); + Actor_Says(0, 1345, 3); + break; + case 360: + Actor_Says(0, 1295, 3); + Actor_Says(59, 100, 3); + Actor_Says(0, 1350, 3); + Actor_Says(59, 110, 3); + Actor_Says(0, 1355, 3); + Actor_Says(59, 130, 3); + Actor_Says(0, 1360, 3); + break; + case 370: + Actor_Says(0, 1300, 3); + Actor_Says(59, 140, 3); + Actor_Says(0, 1365, 3); + Actor_Says(59, 150, 3); + break; + case 380: + Actor_Says(0, 1305, 3); + Actor_Modify_Friendliness_To_Other(59, 0, -2); + Actor_Says(59, 160, 3); + Actor_Says(0, 1370, 3); + Actor_Says(59, 170, 3); + Actor_Says(0, 1375, 3); + Actor_Says(59, 180, 3); + Actor_Says(0, 1380, 3); + Actor_Says(59, 190, 3); + Actor_Says(59, 210, 3); + Actor_Says(59, 240, 3); + Actor_Says(0, 1385, 3); + Actor_Says(59, 260, 3); + Actor_Says(0, 1390, 3); + Actor_Says(59, 300, 3); + Actor_Says(59, 310, 3); + Actor_Says(59, 320, 3); + Actor_Says(0, 1395, 3); + Actor_Says(59, 330, 3); + Actor_Clue_Acquire(0, 102, 0, 59); + break; + case 390: + Actor_Says(0, 1310, 3); + Actor_Modify_Friendliness_To_Other(59, 0, 2); + Actor_Says(59, 340, 3); + break; + case 400: + Actor_Says(0, 1315, 3); + break; + default: + Actor_Says(0, 1320, 3); + Actor_Says(59, 30, 3); + Actor_Says(0, 1325, 3); + Actor_Says(0, 1345, 3); + break; + } +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/hf01.cpp b/engines/bladerunner/script/scene/hf01.cpp new file mode 100644 index 0000000000..9e5220ff82 --- /dev/null +++ b/engines/bladerunner/script/scene/hf01.cpp @@ -0,0 +1,475 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptHF01::InitializeScene() { + if (Game_Flag_Query(617)) { + Setup_Scene_Information(243.94f, 8.0f, -341.9f, 342); + } else if (Game_Flag_Query(313)) { + Setup_Scene_Information(-202.0f, 0.0f, -619.0f, 407); + } else if (Game_Flag_Query(311)) { + Setup_Scene_Information(124.0f, 8.0f, -880.0f, 455); + } else if (Game_Flag_Query(309)) { + Setup_Scene_Information(406.0f, 8.0f, -813.0f, 455); + } else { + Setup_Scene_Information(100.0f, 0.0f, -260.0f, 0); + } + Scene_Exit_Add_2D_Exit(0, 81, 226, 169, 321, 0); + if (!Game_Flag_Query(663)) { + Scene_Exit_Add_2D_Exit(1, 304, 239, 492, 339, 0); + Scene_Exit_Add_2D_Exit(2, 560, 231, 639, 360, 0); + if (Game_Flag_Query(256)) { + Scene_Exit_Add_2D_Exit(3, 0, 311, 66, 417, 2); + } + } + Ambient_Sounds_Add_Looping_Sound(54, 50, 0, 1); + Ambient_Sounds_Add_Looping_Sound(340, 25, 0, 1); + Ambient_Sounds_Add_Looping_Sound(81, 60, 100, 1); + Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(184, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(185, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(186, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(188, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(189, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(192, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(68, 10, 180, 16, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(69, 10, 180, 16, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(375, 10, 180, 50, 100, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(376, 10, 180, 50, 100, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(377, 10, 180, 50, 100, 0, 0, -101, -101, 0, 0); + if (Game_Flag_Query(256)) { + if (!Game_Flag_Query(309) && !Game_Flag_Query(311) && !Game_Flag_Query(313)) { + Scene_Loop_Start_Special(0, 0, 0); + } + Scene_Loop_Set_Default(1); + } else if (Game_Flag_Query(663)) { + Scene_Loop_Set_Default(1); + } else { + Scene_Loop_Set_Default(5); + } +} + +void SceneScriptHF01::SceneLoaded() { + Obstacle_Object("LOFT41", true); + if (!Game_Flag_Query(256)) { + Unobstacle_Object("OBSTACLE BOX15", true); + } +} + +bool SceneScriptHF01::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptHF01::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptHF01::ClickedOnActor(int actorId) { + int v1; + if (Global_Variable_Query(45) == 2) { + v1 = 3; + } else if (Global_Variable_Query(45) == 3) { + v1 = 6; + } else { + v1 = -1; + } + if (actorId == 22 || actorId == 31) { + if (!Loop_Actor_Walk_To_XYZ(0, 504.04f, 8.0f, -242.17f, 12, 1, false, 0)) { + ADQ_Flush(); + Actor_Face_Actor(0, 31, true); + if (Game_Flag_Query(382)) { + sub_4026B4(); + } else { + Actor_Says(0, 1455, 15); + Actor_Says(31, 40, 13); + Actor_Says(0, 1460, 13); + Actor_Says(31, 50, 12); + Item_Pickup_Spin_Effect(951, 396, 359); + Actor_Face_Heading(31, 271, false); + Actor_Says(31, 60, 12); + Actor_Says(0, 1465, 15); + Actor_Face_Actor(31, 0, true); + Actor_Says(31, 70, 13); + Actor_Says(0, 1470, 14); + Actor_Says(22, 30, 3); + Actor_Says(31, 80, 15); + Actor_Says(22, 50, 3); + Actor_Says(31, 110, 14); + Game_Flag_Set(382); + } + return true; + } + return false; + } + if (actorId == v1) { + if (!Loop_Actor_Walk_To_Actor(0, actorId, 28, 1, false)) { + if (Actor_Query_Goal_Number(v1) == 599) { + Actor_Says(0, 8630, 13); + return true; + } + if (Global_Variable_Query(1) == 5 && (Actor_Clue_Query(0, 139) || Actor_Clue_Query(0, 141)) && !Game_Flag_Query(165) && Actor_Query_Goal_Number(9) != 2 && Game_Flag_Query(653) && !Game_Flag_Query(662)) { + Game_Flag_Set(662); + Actor_Face_Actor(0, v1, true); + Actor_Face_Actor(v1, 0, true); + if (v1 == 3) { + sub_4032DC(); + } else if (v1 == 6) { + sub_403484(); + } + Async_Actor_Walk_To_XYZ(v1, -175.0f, 8.0f, -617.0f, 0, false); + Loop_Actor_Walk_To_XYZ(0, -137.0f, 8.0f, -577.0f, 0, 0, false, 1); + Game_Flag_Set(312); + Set_Enter(41, 38); + } + } + } + return false; +} + +bool SceneScriptHF01::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptHF01::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -202.0f, 8.0f, -619.0f, 0, 1, false, 0)) { + Game_Flag_Set(312); + Set_Enter(41, 38); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, 124.0f, 8.0f, -724.0f, 0, 1, false, 0)) { + Loop_Actor_Walk_To_XYZ(0, 124.0f, 8.0f, -880.0f, 0, 0, false, 0); + Game_Flag_Set(310); + Set_Enter(39, 36); + } + return true; + } + if (exitId == 2) { + if (!Loop_Actor_Walk_To_XYZ(0, 406.0f, 8.0f, -717.0f, 0, 1, false, 0)) { + Loop_Actor_Walk_To_XYZ(0, 406.0f, 8.0f, -813.0f, 0, 0, false, 0); + Game_Flag_Set(308); + Set_Enter(38, 35); + } + return true; + } + if (exitId == 3) { + if (!Loop_Actor_Walk_To_XYZ(0, 100.0f, 0.0f, -260.0f, 0, 1, false, 0)) { + Game_Flag_Reset(176); + Game_Flag_Reset(182); + Game_Flag_Reset(179); + Game_Flag_Reset(178); + Game_Flag_Reset(258); + Game_Flag_Reset(257); + int spinnerDest = Spinner_Interface_Choose_Dest(3, 0); + switch (spinnerDest) { + case 0: + Game_Flag_Set(178); + Game_Flag_Reset(256); + Game_Flag_Set(251); + Set_Enter(61, 65); + Scene_Loop_Start_Special(1, 4, 1); + break; + case 1: + Game_Flag_Set(179); + Game_Flag_Reset(256); + Game_Flag_Set(250); + Set_Enter(49, 48); + Scene_Loop_Start_Special(1, 4, 1); + break; + case 2: + Game_Flag_Set(182); + Game_Flag_Reset(256); + Game_Flag_Set(249); + Set_Enter(69, 78); + Scene_Loop_Start_Special(1, 4, 1); + break; + case 3: + Game_Flag_Set(176); + Game_Flag_Reset(256); + Game_Flag_Set(248); + Set_Enter(4, 13); + Scene_Loop_Start_Special(1, 4, 1); + break; + case 5: + Game_Flag_Set(261); + Game_Flag_Reset(256); + Game_Flag_Set(307); + Set_Enter(17, 82); + Scene_Loop_Start_Special(1, 4, 1); + break; + case 4: + Game_Flag_Set(180); + Game_Flag_Reset(256); + Game_Flag_Set(252); + Set_Enter(0, 0); + Scene_Loop_Start_Special(1, 4, 1); + break; + case 7: + Game_Flag_Set(258); + Game_Flag_Reset(256); + Game_Flag_Set(254); + Set_Enter(20, 2); + Scene_Loop_Start_Special(1, 4, 1); + break; + case 6: + Game_Flag_Set(177); + Game_Flag_Reset(256); + Game_Flag_Set(253); + Set_Enter(7, 25); + Scene_Loop_Start_Special(1, 4, 1); + break; + case 8: + Game_Flag_Set(181); + Game_Flag_Reset(256); + Game_Flag_Set(255); + Set_Enter(54, 54); + Scene_Loop_Start_Special(1, 4, 1); + break; + default: + Game_Flag_Set(257); + Loop_Actor_Walk_To_XYZ(0, 100.0f, 0.0f, -300.0f, 0, 1, false, 0); + break; + } + } + return true; + } + return false; +} + +bool SceneScriptHF01::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptHF01::SceneFrameAdvanced(int frame) { + if (frame == 10) { + Sound_Play(118, 40, 0, 0, 50); + } + if (frame == 72 || frame == 193) { + Sound_Play(116, 100, -50, -50, 50); + } + if (frame == 88 || frame == 214) { + Sound_Play(119, 100, -50, -50, 50); + } + if (frame == 242) { + Sound_Play(117, 40, -50, 80, 50); + } + if (Actor_Query_Goal_Number(31) == 1) { + Actor_Set_Goal_Number(31, 0); + } +} + +void SceneScriptHF01::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptHF01::PlayerWalkedIn() { + if (Game_Flag_Query(663)) { + ADQ_Flush(); + ADQ_Add(24, 280, 3); + Actor_Put_In_Set(23, 37); + Actor_Set_At_XYZ(23, 8.2f, 8.0f, -346.67f, 1021); + Actor_Put_In_Set(24, 37); + Actor_Set_At_XYZ(24, 51.21f, 8.0f, -540.78f, 796); + Non_Player_Actor_Combat_Mode_On(23, 3, 1, 0, 4, 4, 7, 8, 0, 0, 0, 100, 300, 0); + Non_Player_Actor_Combat_Mode_On(24, 3, 1, 0, 4, 4, 7, 8, 0, 0, 0, 100, 300, 0); + } + if (!Game_Flag_Query(165) && Actor_Query_Goal_Number(9) != 2) { + if (Actor_Clue_Query(0, 141) && Global_Variable_Query(45) == 3 && Actor_Query_Goal_Number(6) != 599) { + Actor_Put_In_Set(6, 37); + Actor_Set_At_XYZ(6, -5.0f, 8.0f, -622.0f, 419); + Actor_Set_Targetable(6, true); + } else if (Actor_Clue_Query(0, 139) && Global_Variable_Query(45) == 2 && Actor_Query_Goal_Number(3) != 599) { + Actor_Put_In_Set(3, 37); + Actor_Set_At_XYZ(3, -5.0f, 8.0f, -622.0f, 419); + Actor_Set_Targetable(3, true); + } + } + if (Game_Flag_Query(617)) { + Actor_Set_Goal_Number(1, 280); + Game_Flag_Reset(617); + //return true; + return; + } + if (Game_Flag_Query(652)) { + Game_Flag_Reset(652); + Actor_Voice_Over(950, 99); + Actor_Voice_Over(960, 99); + Actor_Voice_Over(970, 99); + Actor_Voice_Over(980, 99); + } else if (!Game_Flag_Query(377) && Global_Variable_Query(1) < 4) { + ADQ_Flush(); + ADQ_Add(31, 0, 14); + ADQ_Add(31, 10, 3); + ADQ_Add(22, 0, 3); + Actor_Face_Actor(31, 22, true); + ADQ_Add(31, 20, 13); + ADQ_Add(22, 10, 3); + ADQ_Add(31, 30, 3); + ADQ_Add(22, 20, 3); + Actor_Face_Heading(31, 271, false); + Game_Flag_Set(377); + } + if (Game_Flag_Query(311)) { + Loop_Actor_Walk_To_XYZ(0, 124.0f, 8.0f, -724.0f, 0, 1, false, 0); + } else if (Game_Flag_Query(309)) { + Loop_Actor_Walk_To_XYZ(0, 406.0f, 8.0f, -717.0f, 0, 1, false, 0); + } else if (!Game_Flag_Query(313)) { + Loop_Actor_Walk_To_XYZ(0, 100.0f, 0.0f, -300.0f, 0, 1, false, 0); + } + Game_Flag_Reset(311); + Game_Flag_Reset(309); + Game_Flag_Reset(313); + //return false; +} + +void SceneScriptHF01::PlayerWalkedOut() { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + if (!Game_Flag_Query(312) && !Game_Flag_Query(308) && !Game_Flag_Query(310) && !Game_Flag_Query(722)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Outtake_Play(35, 1, -1); + Outtake_Play(38, 1, -1); + } + Game_Flag_Reset(722); + if (Actor_Query_Goal_Number(6) == 450) { + Actor_Put_In_Set(6, 97); + Actor_Set_At_Waypoint(6, 39, 0); + Actor_Set_Goal_Number(6, 599); + } + if (Actor_Query_Goal_Number(3) == 450) { + Actor_Put_In_Set(3, 97); + Actor_Set_At_Waypoint(3, 39, 0); + Actor_Set_Goal_Number(3, 599); + } +} + +void SceneScriptHF01::DialogueQueueFlushed(int a1) { +} + +void SceneScriptHF01::sub_4026B4() { + Dialogue_Menu_Clear_List(); + if (Actor_Clue_Query(0, 13) == 1) { + DM_Add_To_List_Never_Repeat_Once_Selected(440, 8, 6, 3); + } + if (!Actor_Clue_Query(0, 13) && Actor_Clue_Query(0, 22) == 1) { + DM_Add_To_List_Never_Repeat_Once_Selected(450, 7, 6, 3); + } + if (Actor_Clue_Query(0, 87) == 1) { + DM_Add_To_List_Never_Repeat_Once_Selected(460, 3, 5, 6); + } + if (Actor_Clue_Query(0, 118) == 1) { + DM_Add_To_List_Never_Repeat_Once_Selected(470, -1, 3, 8); + } + Dialogue_Menu_Add_DONE_To_List(480); + Dialogue_Menu_Appear(320, 240); + int answer = Dialogue_Menu_Query_Input(); + Dialogue_Menu_Disappear(); + switch (answer) { + case 440: + Actor_Says(0, 1480, 15); + Actor_Says(22, 70, 3); + Actor_Says(31, 120, 3); + Actor_Says(0, 1505, 14); + Actor_Says(22, 80, 3); + Actor_Says(31, 130, 3); + Actor_Says(22, 90, 3); + Actor_Says(0, 1510, 12); + break; + case 450: + Actor_Says(0, 1485, 16); + Actor_Says(22, 100, 3); + Actor_Says(31, 140, 12); + Actor_Says(22, 110, 3); + Actor_Says(22, 120, 3); + Actor_Says(31, 150, 14); + break; + case 460: + Actor_Says(0, 1490, 13); + Actor_Says(31, 160, 15); + Actor_Says(22, 130, 13); + Actor_Says(31, 170, 12); + Actor_Says(31, 180, 13); + Actor_Says(31, 190, 14); + Actor_Says(0, 1515, 15); + Actor_Says(31, 200, 3); + Actor_Says(0, 1520, 15); + Actor_Says(31, 210, 13); + Actor_Says(31, 220, 13); + Actor_Says(22, 140, 12); + Actor_Says(31, 230, 13); + Actor_Clue_Acquire(0, 101, 0, 31); + break; + case 470: + Actor_Says(0, 1495, 14); + Actor_Face_Actor(31, 0, true); + Actor_Says(31, 240, 13); + Actor_Face_Actor(31, 22, true); + break; + case 480: + Actor_Says(0, 1500, 16); + break; + } +} + +void SceneScriptHF01::sub_4032DC() { + Actor_Says(3, 0, 3); + Actor_Says(0, 1400, 3); + Actor_Says(3, 10, 3); + Actor_Says(0, 1405, 3); + Actor_Says(3, 20, 3); + Actor_Says(0, 1410, 3); + Actor_Says(3, 30, 3); + Actor_Says(0, 1415, 3); + Actor_Says(3, 40, 3); + Actor_Says(3, 50, 3); + Actor_Says(3, 60, 3); + Actor_Says(3, 70, 3); + Actor_Says(0, 1420, 3); + Actor_Says(3, 80, 3); +} + +void SceneScriptHF01::sub_403484() { + Actor_Says(6, 0, 3); + Actor_Says(0, 1425, 3); + Actor_Says(6, 10, 3); + Actor_Says(6, 20, 3); + Actor_Says(0, 1430, 3); + Actor_Says(6, 30, 3); + Actor_Says(0, 1435, 3); + Actor_Says(6, 40, 3); + Actor_Says(6, 50, 3); + Actor_Says(0, 1440, 3); + Actor_Says(6, 60, 3); + Actor_Says(6, 70, 3); + Actor_Says(0, 1445, 3); + Actor_Says(6, 80, 3); + Actor_Says(6, 3030, 3); +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/hf02.cpp b/engines/bladerunner/script/scene/hf02.cpp new file mode 100644 index 0000000000..a301f1f6dd --- /dev/null +++ b/engines/bladerunner/script/scene/hf02.cpp @@ -0,0 +1,144 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptHF02::InitializeScene() { + if (Game_Flag_Query(567)) { + Setup_Scene_Information(874.0f, 47.76f, -252.0f, 775); + Game_Flag_Reset(567); + } else if (Game_Flag_Query(528)) { + Setup_Scene_Information(470.0f, 47.76f, -500.0f, 560); + } else { + Setup_Scene_Information(-18.0f, 47.76f, -288.0f, 275); + } + Scene_Exit_Add_2D_Exit(0, 0, 0, 30, 479, 3); + Scene_Exit_Add_2D_Exit(1, 207, 66, 272, 207, 3); + Ambient_Sounds_Add_Looping_Sound(340, 28, -100, 1); + Ambient_Sounds_Add_Looping_Sound(341, 33, 0, 1); + Ambient_Sounds_Add_Sound(181, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(183, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(184, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(185, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(186, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(188, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(189, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(190, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(192, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(193, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(194, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); +} + +void SceneScriptHF02::SceneLoaded() { + Obstacle_Object("BARD_NEON", true); + Unclickable_Object("BARD_NEON"); + if (Actor_Query_Goal_Number(1) == 234) { + if (Game_Flag_Query(593)) { + Actor_Set_Goal_Number(1, 243); + } else { + Actor_Set_Goal_Number(1, 240); + } + } +} + +bool SceneScriptHF02::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptHF02::ClickedOn3DObject(const char *objectName, bool a2) { + Sound_Play(342, 47, -80, 0, 50); + return false; +} + +bool SceneScriptHF02::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptHF02::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptHF02::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, 42.0f, 47.76f, -296.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(309); + Set_Enter(37, 34); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, 470.0f, 47.76f, -444.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(527); + Set_Enter(39, 36); + } + return true; + } + return false; +} + +bool SceneScriptHF02::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptHF02::SceneFrameAdvanced(int frame) { + +} + +void SceneScriptHF02::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptHF02::PlayerWalkedIn() { + if (Actor_Query_Goal_Number(1) == 240) { + Actor_Set_Goal_Number(1, 241); + } + if (Game_Flag_Query(528)) { + Loop_Actor_Walk_To_XYZ(0, 470.0f, 47.76f, -444.0f, 0, 0, false, 0); + Game_Flag_Reset(528); + } else if (Game_Flag_Query(308)) { + Loop_Actor_Walk_To_XYZ(0, 42.0f, 47.76f, -296.0f, 0, 0, false, 0); + Game_Flag_Reset(308); + } + if (Actor_Query_Goal_Number(1) == 243) { + if (Actor_Query_Goal_Number(6) == 599) { + Actor_Set_Goal_Number(1, 244); + } else { + Actor_Set_Goal_Number(1, 245); + } + } +} + +void SceneScriptHF02::PlayerWalkedOut() { +} + +void SceneScriptHF02::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/hf03.cpp b/engines/bladerunner/script/scene/hf03.cpp new file mode 100644 index 0000000000..b95d8a6bab --- /dev/null +++ b/engines/bladerunner/script/scene/hf03.cpp @@ -0,0 +1,254 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptHF03::InitializeScene() { + if (Game_Flag_Query(527)) { + Setup_Scene_Information(479.0f, 47.76f, -496.0f, 600); + } else { + Setup_Scene_Information(185.62f, 47.76f, -867.42f, 300); + } + Scene_Exit_Add_2D_Exit(0, 0, 0, 30, 479, 3); + Scene_Exit_Add_2D_Exit(1, 589, 0, 639, 479, 1); + Scene_Exit_Add_2D_Exit(2, 323, 110, 380, 166, 0); + Ambient_Sounds_Add_Looping_Sound(340, 50, 0, 1); + Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(184, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(185, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(186, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(188, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(189, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(192, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); +} + +void SceneScriptHF03::SceneLoaded() { + Obstacle_Object("MAIN", true); + Unclickable_Object("MAIN"); +} + +bool SceneScriptHF03::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptHF03::ClickedOn3DObject(const char *objectName, bool a2) { + if (Object_Query_Click(objectName, "MAIN")) { + Actor_Says(0, Random_Query(0, 3) + 8525, 18); + } + return false; +} + +void SceneScriptHF03::sub_401C80() { + Dialogue_Menu_Clear_List(); + DM_Add_To_List_Never_Repeat_Once_Selected(840, -1, 3, 8); + DM_Add_To_List_Never_Repeat_Once_Selected(850, 6, 5, 2); + DM_Add_To_List_Never_Repeat_Once_Selected(860, 8, -1, -1); + DM_Add_To_List_Never_Repeat_Once_Selected(870, 2, 8, 6); + Dialogue_Menu_Add_DONE_To_List(880); + Dialogue_Menu_Appear(320, 240); + int answer = Dialogue_Menu_Query_Input(); + Dialogue_Menu_Disappear(); + switch (answer) { + case 840: + Actor_Says(0, 1630, 15); + if (Global_Variable_Query(40) == 3) { + Actor_Set_Goal_Number(6, 214); + } else if (Game_Flag_Query(46)) { + Actor_Set_Goal_Number(6, 212); + } else { + Actor_Set_Goal_Number(6, 210); + Game_Flag_Set(593); + } + break; + case 850: + Actor_Says(0, 1635, 15); + Actor_Says(6, 200, 13); + Actor_Modify_Friendliness_To_Other(6, 0, 3); + break; + case 860: + Actor_Says(0, 1640, 12); + if (Global_Variable_Query(40) == 3) { + Actor_Set_Goal_Number(6, 214); + } else { + Actor_Says(6, 210, 13); + Actor_Says(0, 1655, 15); + Actor_Modify_Friendliness_To_Other(6, 0, Random_Query(9, 10)); + if (Actor_Query_Friendliness_To_Other(6, 0) > 59 && !Global_Variable_Query(45)) { + Global_Variable_Set(45, 3); + Actor_Says(6, 940, 14); + Actor_Says(0, 6780, 11); + Actor_Says(6, 950, 12); + Actor_Says(6, 960, 13); + Actor_Says(0, 6785, 15); + Actor_Says(6, 970, 16); + Actor_Says(6, 980, 17); + if (Game_Flag_Query(47)) { + Actor_Says(6, 990, 17); + } + Actor_Says(0, 6790, 15); + Actor_Says(6, 1000, 13); + Actor_Says(6, 1010, 17); + Actor_Says(6, 1020, 18); + Actor_Says(0, 6795, 14); + Actor_Says(6, 1030, 17); + Actor_Says(0, 6800, 14); + } + Actor_Says(6, 220, 13); + Actor_Says(0, 1660, 15); + Actor_Says(6, 230, 14); + Actor_Clue_Acquire(6, 219, 1, 0); + if (Game_Flag_Query(46)) { + Actor_Set_Goal_Number(6, 212); + } else { + Actor_Set_Goal_Number(6, 210); + } + } + break; + case 870: + Actor_Says(0, 1645, 18); + Actor_Says(6, 240, 14); + Actor_Says(6, 250, 12); + Actor_Says(6, 260, 13); + Actor_Says(6, 270, 19); + Actor_Says(0, 1665, 18); + Actor_Says(6, 280, 13); + Actor_Says(0, 1670, 12); + Actor_Says(6, 290, 14); + Actor_Says(6, 300, 16); + Actor_Says(0, 1675, 12); + Actor_Says(6, 310, 13); + Actor_Clue_Acquire(0, 273, 0, 6); + break; + case 880: + Actor_Says(0, 1650, 14); + break; + } +} + +bool SceneScriptHF03::ClickedOnActor(int actorId) { + if (actorId == 6 && Actor_Query_Goal_Number(6) == 205) { + if (Game_Flag_Query(46) ? !Loop_Actor_Walk_To_Waypoint(0, 377, 0, 1, false) : !Loop_Actor_Walk_To_Waypoint(0, 378, 0, 1, false)) { + Actor_Face_Actor(0, 6, true); + if (!Game_Flag_Query(613)) { + Game_Flag_Set(613); + if (Game_Flag_Query(46)) { + Actor_Says(0, 1605, 15); + Actor_Says(6, 100, 12); + Actor_Says(0, 1610, 14); + } else { + Actor_Says(0, 1615, 16); + Actor_Says(6, 110, 13); + } + Actor_Says(6, 120, 13); + Actor_Says(0, 1620, 14); + Actor_Says(6, 130, 17); + Actor_Says(0, 1625, 15); + if (Game_Flag_Query(46)) { + Actor_Says(6, 140, 12); + Actor_Says(6, 150, 13); + Actor_Says(6, 160, 15); + } else { + Actor_Says(6, 170, 12); + Actor_Says(6, 180, 13); + Actor_Says(6, 190, 15); + } + } + sub_401C80(); + } + } + return false; +} + +bool SceneScriptHF03::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptHF03::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, 179.0f, 46.76f, -824.0f, 0, 1, false, 0)) { + Game_Flag_Set(311); + Set_Enter(37, 34); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, 479.0f, 47.76f, -524.0f, 0, 1, false, 0)) { + Game_Flag_Set(528); + Set_Enter(38, 35); + } + return true; + } + if (exitId == 2) { + if (!Loop_Actor_Walk_To_XYZ(0, 942.0f, 47.76f, -847.0f, 0, 1, false, 0)) { + Game_Flag_Set(566); + Set_Enter(40, 37); + } + return true; + } + return false; +} + +bool SceneScriptHF03::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptHF03::SceneFrameAdvanced(int frame) { +} + +void SceneScriptHF03::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptHF03::PlayerWalkedIn() { + if (Game_Flag_Query(527)) { + Loop_Actor_Walk_To_XYZ(0, 479.0f, 47.76f, -524.0f, 0, 0, false, 0); + Game_Flag_Reset(527); + } else { + Loop_Actor_Walk_To_XYZ(0, 179.0f, 47.76f, -824.0f, 0, 0, false, 0); + Game_Flag_Reset(310); + } + if (Actor_Query_Goal_Number(6) == 250) { + Actor_Set_Goal_Number(6, 212); + Actor_Says(1, 210, 13); + Actor_Face_Actor(0, 1, true); + Actor_Says(0, 1680, 15); + Actor_Says(1, 220, 14); + Actor_Says(0, 1685, 13); + Actor_Says(1, 230, 16); + Actor_Says(0, 1690, 12); + Actor_Says(1, 240, 13); + Actor_Set_Goal_Number(1, 234); + } +} + +void SceneScriptHF03::PlayerWalkedOut() { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); +} + +void SceneScriptHF03::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/hf04.cpp b/engines/bladerunner/script/scene/hf04.cpp new file mode 100644 index 0000000000..3e699b7f05 --- /dev/null +++ b/engines/bladerunner/script/scene/hf04.cpp @@ -0,0 +1,167 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptHF04::InitializeScene() { + Setup_Scene_Information(-33.85f, -0.31f, 395.0f, 0); + Game_Flag_Reset(566); + Scene_Exit_Add_2D_Exit(0, 602, 104, 639, 177, 1); + Ambient_Sounds_Add_Looping_Sound(70, 35, 0, 1); + Ambient_Sounds_Add_Looping_Sound(109, 40, 0, 1); + Ambient_Sounds_Add_Sound(72, 6, 70, 14, 20, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(73, 3, 70, 14, 20, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(74, 5, 70, 14, 20, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(303, 5, 70, 33, 50, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(304, 5, 70, 33, 50, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(305, 5, 70, 33, 50, -100, 100, -101, -101, 0, 0); + if (Game_Flag_Query(584)) { + Scene_Loop_Set_Default(3); + } else { + Scene_Loop_Set_Default(0); + } +} + +void SceneScriptHF04::SceneLoaded() { + if (Game_Flag_Query(584)) { + Unobstacle_Object("PIVOT_WALL#1", true); + Unobstacle_Object("PIVOT_WALL#02", true); + Unobstacle_Object("PIVOT_WALL#03", true); + } else { + Unobstacle_Object("HIDE_WALL_A", true); + Unobstacle_Object("HIDE_WALL_B", true); + } + if (Actor_Query_Goal_Number(6) == 213) { + if (Actor_Clue_Query(6, 219) && Global_Variable_Query(40) != 3) { + Game_Flag_Set(593); + } else { + Actor_Set_Goal_Number(6, 230); + Game_Flag_Reset(584); + } + } +} + +bool SceneScriptHF04::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptHF04::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptHF04::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptHF04::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptHF04::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, 1132.27f, -0.31f, -113.46f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(567); + Set_Enter(38, 35); + } + return true; + } + return false; +} + +bool SceneScriptHF04::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptHF04::SceneFrameAdvanced(int frame) { + if (frame == 62) { + Sound_Play(359, Random_Query(43, 43), 0, 0, 50); + } + if (frame == 154) { + Sound_Play(360, Random_Query(43, 43), 0, 0, 50); + } + if (frame == 179 && Actor_Query_Goal_Number(6) == 235) { + Actor_Set_Goal_Number(6, 236); + } + if (Game_Flag_Query(585)) { + Game_Flag_Reset(585); + Scene_Loop_Set_Default(3); + Scene_Loop_Start_Special(2, 2, 1); + //return true; + return; + } + if (Game_Flag_Query(586)) { + Game_Flag_Reset(586); + Scene_Loop_Set_Default(0); + Scene_Loop_Start_Special(2, 5, 1); + //return true; + return; + } + if (frame == 89) { + Game_Flag_Set(584); + Obstacle_Object("HIDE_WALL_A", false); + Obstacle_Object("HIDE_WALL_B", false); + Unobstacle_Object("PIVOT_WALL#1", false); + Unobstacle_Object("PIVOT_WALL#02", false); + Unobstacle_Object("PIVOT_WALL#03", true); + //return true; + return; + } + if (frame == 180) { + Unobstacle_Object("HIDE_WALL_A", false); + Unobstacle_Object("HIDE_WALL_B", false); + Obstacle_Object("PIVOT_WALL#1", false); + Obstacle_Object("PIVOT_WALL#02", false); + Obstacle_Object("PIVOT_WALL#03", true); + Game_Flag_Reset(584); + if (Actor_Query_Goal_Number(6) == 234) { + Actor_Set_Goal_Number(6, 235); + } + //return true; + return; + } + //return false; +} + +void SceneScriptHF04::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptHF04::PlayerWalkedIn() { + if (Actor_Query_Goal_Number(6) == 230 || Actor_Query_Goal_Number(6) == 233) { + Player_Set_Combat_Mode(true); + Music_Play(1, 60, 0, 2, -1, 0, 0); + } + Loop_Actor_Walk_To_XYZ(0, -45.0f, -0.31f, 307.0f, 0, 0, true, 0); + Delay(2500); +} + +void SceneScriptHF04::PlayerWalkedOut() { + Music_Stop(5); +} + +void SceneScriptHF04::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/hf05.cpp b/engines/bladerunner/script/scene/hf05.cpp new file mode 100644 index 0000000000..5370cb9d56 --- /dev/null +++ b/engines/bladerunner/script/scene/hf05.cpp @@ -0,0 +1,673 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptHF05::InitializeScene() { + if (Game_Flag_Query(530)) { + Setup_Scene_Information(257.0f, 40.63f, 402.0f, 1000); + } else if (Game_Flag_Query(358)) { + Setup_Scene_Information(330.0f, 40.63f, -107.0f, 603); + } else { + Setup_Scene_Information(483.0f, 40.63f, -189.0f, 600); + } + Scene_Exit_Add_2D_Exit(0, 443, 270, 515, 350, 0); + if (Global_Variable_Query(1) > 3) { + Scene_Exit_Add_2D_Exit(1, 367, 298, 399, 349, 2); + } + Scene_Exit_Add_2D_Exit(2, 589, 0, 639, 479, 1); + Ambient_Sounds_Add_Looping_Sound(103, 40, 1, 1); + if (Game_Flag_Query(369)) { + Scene_Loop_Set_Default(5); + sub_404474(); + } else if (Game_Flag_Query(559)) { + Scene_Loop_Set_Default(2); + sub_404474(); + } else { + Scene_Loop_Set_Default(0); + } +} + +void SceneScriptHF05::SceneLoaded() { + Obstacle_Object("MAINBASE", true); + Unobstacle_Object("BTIRES02", true); + Unobstacle_Object("LFTIRE02", true); + if (Game_Flag_Query(369)) { + Unobstacle_Object("MONTE CARLO DRY", true); + } else { + Unobstacle_Object("OBSTACLE_HOLE", true); + } + Clickable_Object("TOP CON"); +} + +bool SceneScriptHF05::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptHF05::ClickedOn3DObject(const char *objectName, bool a2) { + if (Object_Query_Click("TOP CON", objectName) == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, 95.0f, 40.63f, 308.0f, 0, 1, false, 0)) { + Actor_Face_Object(0, "TOP CON", true); + if (Actor_Query_In_Set(9, 41) && Actor_Query_Goal_Number(9) != 1 && Actor_Query_Goal_Number(9) != 2) { + Actor_Face_Actor(9, 0, true); + Actor_Says(9, 480, 13); + } else if (!Game_Flag_Query(662) || Game_Flag_Query(369)) { + Actor_Change_Animation_Mode(0, 23); + Sound_Play(412, 100, 0, 0, 50); + } else { + Player_Loses_Control(); + Actor_Set_Goal_Number(23, 425); + Game_Flag_Set(369); + Game_Flag_Set(368); + Obstacle_Object("OBSTACLE_HOLE", true); + Unobstacle_Object("MONTE CARLO DRY", true); + if (sub_4048C0()) { + Loop_Actor_Walk_To_XYZ(sub_4048C0(), 181.54f, 40.63f, 388.09f, 0, 0, true, 0); + Actor_Face_Actor(0, sub_4048C0(), true); + Actor_Face_Actor(sub_4048C0(), 0, true); + Actor_Says(0, 1785, 3); + Actor_Says(0, 1790, 3); + } + Actor_Face_Heading(0, 0, false); + Actor_Change_Animation_Mode(0, 23); + Scene_Loop_Set_Default(5); + Scene_Loop_Start_Special(2, 4, 1); + if (sub_4048C0()) { + if (sub_4048C0() == 3) { + Actor_Face_Heading(3, 0, false); + Ambient_Sounds_Play_Sound(147, 50, 99, 0, 0); + Delay(3000); + Actor_Face_Heading(3, 0, false); + Actor_Change_Animation_Mode(3, 23); + } else { + Actor_Face_Heading(6, 0, false); + Ambient_Sounds_Play_Sound(147, 50, 99, 0, 0); + Delay(3000); + Actor_Face_Heading(6, 0, false); + Actor_Change_Animation_Mode(6, 13); + } + Actor_Face_Actor(0, sub_4048C0(), true); + Actor_Says(0, 1805, 3); + } else { + ADQ_Flush(); + ADQ_Add(99, 940, -1); + Ambient_Sounds_Play_Sound(147, 50, 99, 0, 0); + Delay(1500); + Loop_Actor_Walk_To_XYZ(0, 181.53999f, 40.630001f, 388.09f, 0, 0, true, 0); + Actor_Face_Heading(0, 0, false); + Actor_Change_Animation_Mode(0, 23); + Actor_Clue_Lose(0, 146); + } + Player_Gains_Control(); + } + } + return true; + } + return false; +} + +bool SceneScriptHF05::ClickedOnActor(int actorId) { + if (actorId == 9) { + if (!Loop_Actor_Walk_To_Actor(0, 9, 60, 1, false)) { + Actor_Face_Actor(0, 9, true); + Actor_Face_Actor(9, 0, true); + sub_402AE4(); + } + } + return false; +} + +bool SceneScriptHF05::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptHF05::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, 483.0f, 40.63f, -189.0f, 0, 1, false, 0) && !Game_Flag_Query(684)) { + Game_Flag_Set(313); + Set_Enter(37, 34); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, 330.0f, 40.63f, -85.0f, 0, 1, false, 0) && !Game_Flag_Query(684)) { + int v2 = sub_404858(); + if (Game_Flag_Query(663) && Game_Flag_Query(368) && v2 != -1) { + Actor_Face_Actor(0, v2, true); + Actor_Says(0, 1810, 16); + } + Game_Flag_Set(359); + Set_Enter(43, 40); + } + return true; + } + if (exitId == 2) { + if (!Loop_Actor_Walk_To_XYZ(0, 277.0f, 40.631f, 410.0f, 0, 1, false, 0) && !Game_Flag_Query(684)) { + Game_Flag_Set(529); + Set_Enter(42, 39); + } + return true; + } + return false; +} + +bool SceneScriptHF05::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptHF05::SceneFrameAdvanced(int frame) { + switch (frame) { + case 126: + Sound_Play(352, 90, -20, 70, 50); + break; + case 152: + Sound_Play(346, 90, 0, 0, 50); + break; + case 156: + Sound_Play(348, 47, 100, 100, 50); + break; + case 161: + Sound_Play(345, 90, 0, 0, 50); + break; + case 176: + Sound_Play(350, 32, 100, 100, 50); + break; + case 178: + Sound_Play(355, 47, 100, 100, 50); + break; + case 179: + Sound_Play(490, 90, 0, 0, 50); + Music_Play(1, 50, 0, 2, -1, 0, 0); + break; + case 186: + Sound_Play(343, 32, 100, 100, 50); + break; + case 209: + Sound_Play(353, 90, 100, -20, 50); + break; + case 243: + Sound_Play(349, 40, -20, -20, 50); + break; + case 261: + Sound_Play(344, 47, -20, -20, 50); + break; + case 268: + Sound_Play(351, 58, -20, -20, 50); + break; + case 269: + Sound_Play(354, 43, -20, -20, 50); + break; + } + //return true; +} + +void SceneScriptHF05::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { + if (actorId == 23 && newGoal == 430) { + Game_Flag_Set(684); + sub_4042E4(); + } + //return false; +} + +void SceneScriptHF05::PlayerWalkedIn() { + if (Game_Flag_Query(662)) { + int v0 = sub_404858(); + if (Game_Flag_Query(662) && v0 != -1) { + Actor_Put_In_Set(v0, 41); + Actor_Force_Stop_Walking(v0); + if (Game_Flag_Query(312)) { + Actor_Set_At_XYZ(v0, 506.81f, 40.63f, -140.92f, 0); + Async_Actor_Walk_To_Waypoint(v0, 437, 36, 0); + } else if (Game_Flag_Query(530)) { + Actor_Set_At_XYZ(v0, 288.0f, 40.63f, 410.0f, 909); + } else if (Game_Flag_Query(358)) { + Actor_Set_At_XYZ(v0, 298.0f, 40.63f, -107.0f, 512); + } else { + Actor_Set_At_XYZ(v0, 284.0f, 40.63f, 286.0f, 0); + } + } + if (Game_Flag_Query(684)) { + sub_4042E4(); + } else if (Actor_Clue_Query(0, 265) || Game_Flag_Query(559)) { + if (Game_Flag_Query(559) && !Game_Flag_Query(663)) { + Game_Flag_Set(663); + Music_Play(1, 40, 0, 2, -1, 0, 0); + Actor_Says(24, 200, 3); + Actor_Says(24, 210, 3); + Actor_Set_Goal_Number(23, 420); + if (sub_4048C0() == 3) { + sub_403F0C(); + } else if (sub_4048C0() == 6) { + sub_40410C(); + } + } + } else { + sub_403A34(v0); + } + } else if (Game_Flag_Query(312) == 1) { + Loop_Actor_Walk_To_XYZ(0, 399.0f, 40.63f, -85.0f, 0, 0, false, 0); + } else if (Game_Flag_Query(358)) { + Actor_Set_At_XYZ(0, 346.0f, 4.63f, -151.0f, 603); + Loop_Actor_Travel_Stairs(0, 4, 1, 0); + } + if (Actor_Query_In_Set(9, 41)) { + if (Game_Flag_Query(562)) { + if (!Game_Flag_Query(563) && Global_Variable_Query(1) == 3) { + sub_402970(); + Game_Flag_Set(563); + } + } else { + sub_402370(); + Game_Flag_Set(562); + } + } + Game_Flag_Reset(312); + Game_Flag_Reset(530); + Game_Flag_Reset(358); + + //return false; +} + +void SceneScriptHF05::PlayerWalkedOut() { + if (Actor_Query_Goal_Number(9) == 210) { + Actor_Set_Goal_Number(9, 2); + } + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); +} + +void SceneScriptHF05::DialogueQueueFlushed(int a1) { +} + +void SceneScriptHF05::sub_402970() { + Loop_Actor_Walk_To_Actor(9, 0, 72, 0, false); + Actor_Face_Actor(9, 0, true); + Actor_Face_Actor(0, 9, true); + Actor_Says(9, 370, 3); + Actor_Says(0, 1855, 3); + Actor_Says(9, 380, 12); + Actor_Says(9, 390, 14); + Actor_Says(9, 400, 15); + Actor_Says(9, 410, 16); + Actor_Says(0, 1860, 3); + Actor_Says(9, 420, 3); + Actor_Says(0, 1865, 3); +} + +void SceneScriptHF05::sub_402AE4() { + Dialogue_Menu_Clear_List(); + if (Actor_Clue_Query(0, 99) == 1 && Global_Variable_Query(1) == 3) { + DM_Add_To_List_Never_Repeat_Once_Selected(1180, 3, 6, 7); + } + if (Actor_Clue_Query(0, 116) == 1) { + DM_Add_To_List_Never_Repeat_Once_Selected(1190, 2, 7, 4); + } + if (Actor_Clue_Query(0, 88) == 1) { + DM_Add_To_List_Never_Repeat_Once_Selected(1200, 5, 5, 3); + } + if (Actor_Clue_Query(0, 13) == 1 && Actor_Query_Goal_Number(6) != 599) { + DM_Add_To_List_Never_Repeat_Once_Selected(1210, 4, 6, 2); + } + if (Actor_Clue_Query(0, 237) == 1 || (Actor_Clue_Query(0, 99) == 1 && Global_Variable_Query(1) == 3)) { + DM_Add_To_List_Never_Repeat_Once_Selected(1220, -1, 2, 8); + } + if (Actor_Clue_Query(0, 113) == 1 || Actor_Clue_Query(0, 115) == 1) { + DM_Add_To_List_Never_Repeat_Once_Selected(1230, 4, 7, -1); + } + if (!Dialogue_Menu_Query_List_Size()) { + Actor_Says(0, 1880, 15); + Actor_Says(9, 490, 3); + Actor_Says(0, 1885, 3); + Actor_Says(9, 500, 16); + return; + } + Dialogue_Menu_Add_DONE_To_List(1240); + Dialogue_Menu_Appear(320, 240); + int answer = Dialogue_Menu_Query_Input(); + Dialogue_Menu_Disappear(); + switch (answer) { + case 1180: + Actor_Says(0, 1890, 23); + Actor_Says(9, 510, 3); + Actor_Says(0, 1920, 23); + Actor_Says(0, 1925, 3); + Actor_Says(9, 530, 12); + Actor_Says(0, 1930, 18); + Actor_Says(9, 540, 14); + Actor_Says(0, 1935, 14); + Actor_Says(9, 550, 16); + Actor_Says(0, 1940, 15); + Actor_Says(0, 1945, -1); + Actor_Says(9, 560, 15); + Actor_Says(9, 570, 16); + Actor_Says(0, 1950, 17); + sub_403738(); + break; + case 1190: + Actor_Says(0, 1895, 0); + Actor_Says(9, 620, 3); + Actor_Says(9, 630, 12); + Actor_Says(0, 2000, 13); + Actor_Says(9, 640, 14); + Actor_Says(9, 650, 15); + Actor_Says(9, 660, 16); + Actor_Says(0, 2005, 0); + Actor_Says(0, 2010, 3); + Actor_Says(9, 670, 3); + Actor_Says(9, 680, 12); + Actor_Says(9, 690, 14); + Actor_Says(0, 2015, 14); + Actor_Says(9, 700, 15); + Actor_Says(0, 2020, 18); + break; + case 1200: + Actor_Says(0, 1900, 23); + Actor_Says(9, 710, 16); + Actor_Says(0, 2025, 0); + Actor_Says(9, 720, 3); + Actor_Says(9, 730, 12); + break; + case 1210: + Actor_Says(0, 1905, 23); + Actor_Says(9, 740, 14); + Actor_Says(0, 2030, 13); + Actor_Says(9, 750, 15); + Actor_Says(0, 2035, 18); + Actor_Says(9, 760, 16); + Actor_Says(9, 770, 3); + Actor_Says(0, 2040, 0); + break; + case 1220: + Actor_Says(0, 1910, 3); + Actor_Says(9, 780, 12); + Actor_Says(0, 2045, 17); + Actor_Says(0, 2050, 3); + Actor_Says(9, 790, 14); + Actor_Says(0, 2055, 19); + Actor_Says(0, 2060, -1); + Actor_Says(9, 800, 15); + Actor_Says(0, 2065, 18); + Actor_Says(0, 2070, 14); + Actor_Says(9, 810, 16); + sub_403738(); + break; + case 1230: + Actor_Says(0, 1915, 12); + if (Actor_Clue_Query(0, 113)) { + Actor_Says(9, 820, 3); + Actor_Says(0, 2075, 13); + Actor_Says(9, 830, 12); + Actor_Says(9, 840, 14); + Actor_Says(9, 850, 15); + Actor_Says(0, 2080, 3); + Actor_Says(9, 860, 16); + Actor_Says(9, 870, 3); + } else if (Actor_Clue_Query(0, 115)) { + Actor_Says(9, 880, 12); + Actor_Says(9, 890, 14); + Actor_Says(0, 2085, 3); + Actor_Says(9, 900, 15); + Actor_Says(0, 2090, 19); + Actor_Says(9, 910, 16); + Actor_Says(0, 2095, 14); + Actor_Says(9, 920, 3); + Actor_Says(0, 2100, 15); + Actor_Says(9, 930, 12); + Actor_Says(9, 940, 14); + Actor_Says(0, 2105, 3); + Actor_Says(9, 950, 15); + Actor_Says(0, 2110, 0); + Actor_Says(9, 960, 16); + } + break; + } +} + +void SceneScriptHF05::sub_403738() { + Dialogue_Menu_Clear_List(); + DM_Add_To_List_Never_Repeat_Once_Selected(1250, -1, -1, 10); + DM_Add_To_List_Never_Repeat_Once_Selected(1260, 10, 5, -1); + Dialogue_Menu_Appear(320, 240); + int answer = Dialogue_Menu_Query_Input(); + Dialogue_Menu_Disappear(); + if (answer == 1250) { + Actor_Says(0, 1955, 17); + Actor_Says(0, 1960, 23); + Item_Pickup_Spin_Effect(986, 315, 327); + Delay(2000); + Actor_Says(0, 1980, 23); + Actor_Says(0, 1985, 3); + Actor_Says(9, 580, 3); + Actor_Says(9, 590, 15); + Actor_Says(0, 1990, 17); + Actor_Says(9, 600, 16); + Actor_Says(0, 1995, 3); + Game_Flag_Set(165); + Actor_Put_In_Set(9, 67); + Actor_Set_At_XYZ(9, -315.15f, 0.0f, 241.06f, 583); + Actor_Set_Goal_Number(9, 699); + Game_Flag_Set(652); + if (Game_Flag_Query(255)) { + Set_Enter(54, 54); + } else { + Game_Flag_Set(313); + Set_Enter(37, 34); + } + } else if (answer == 1260) { + Actor_Says(0, 1965, 12); + Actor_Says(0, 1970, 3); + Actor_Says(0, 1975, 3); + Actor_Says(9, 610, 16); + } +} + +int SceneScriptHF05::sub_404858() { + if (Global_Variable_Query(45) == 2 && Actor_Query_Goal_Number(3) != 599) { + return 3; + } + if (Global_Variable_Query(45) == 3 && Actor_Query_Goal_Number(6) != 599) { + return 6; + } + return -1; +} + +void SceneScriptHF05::sub_4042E4() { + Actor_Force_Stop_Walking(0); + Actor_Put_In_Set(23, 41); + Actor_Set_At_XYZ(23, 430.39999f, 40.630001f, -258.17999f, 300); + Actor_Put_In_Set(24, 41); + Actor_Set_At_XYZ(24, 526.40002f, 37.18f, -138.17999f, 300); + ADQ_Flush(); + ADQ_Add(24, 260, -1); + Player_Loses_Control(); + Non_Player_Actor_Combat_Mode_On(23, 3, 1, 0, 4, 4, 7, 8, 0, 0, 100, 100, 1200, 1); + return Non_Player_Actor_Combat_Mode_On(24, 3, 1, 0, 4, 4, 7, 8, 0, 0, 100, 100, 300, 1); +} + +void SceneScriptHF05::sub_403F0C() { + Actor_Face_Actor(0, 3, true); + Actor_Face_Actor(3, 0, true); + Actor_Says(3, 2660, 12); + Actor_Says(0, 8990, 3); + Actor_Says(3, 2670, 13); + Actor_Says(3, 2680, 17); + Actor_Says(0, 8995, 14); + Actor_Says(3, 2690, 15); + Actor_Says_With_Pause(0, 9000, 1.0f, 16); + Actor_Says_With_Pause(0, 9005, 1.0f, 19); + Actor_Says(0, 1765, 17); + Actor_Says(3, 160, 12); + Actor_Says(0, 1770, 15); + Actor_Says(0, 1775, 3); + Actor_Says(3, 170, 3); + Actor_Says_With_Pause(0, 1780, 1.0f, 18); +} + +void SceneScriptHF05::sub_40410C() { + Actor_Face_Actor(0, 6, true); + Actor_Face_Actor(6, 0, true); + Actor_Says(6, 400, 16); + Actor_Says(0, 1750, 14); + Actor_Says(6, 410, 12); + Actor_Says(6, 420, 14); + Actor_Says(0, 1755, 16); + Actor_Says(6, 430, 18); + Actor_Says_With_Pause(0, 1760, 1.0f, 15); + Actor_Says(0, 1765, 17); + Actor_Says(6, 440, 3); + Actor_Says(0, 1770, 15); + Actor_Says(0, 1775, 3); + Actor_Says(6, 450, 17); + Actor_Says_With_Pause(0, 1780, 1.0f, 18); +} + +void SceneScriptHF05::sub_403A34(int actorId) { + if (actorId != -1 && Actor_Query_In_Set(9, 41)) { + Async_Actor_Walk_To_Waypoint(actorId, 437, 36, 0); + Loop_Actor_Walk_To_Waypoint(0, 437, 0, 0, false); + Actor_Face_Actor(9, 0, true); + Actor_Face_Actor(0, 9, true); + Actor_Face_Actor(actorId, 9, true); + Actor_Says(9, 0, 3); + Actor_Says(9, 10, 12); + Actor_Says(0, 1715, 19); + Actor_Says(0, 1720, -1); + Actor_Says(9, 20, 14); + Actor_Says(9, 30, 15); + Actor_Says(0, 1725, 3); + Actor_Says(9, 40, 16); + Actor_Says(9, 50, 3); + Actor_Says(9, 60, 12); + Actor_Says(9, 70, 13); + Actor_Says(0, 1730, 3); + Loop_Actor_Walk_To_Actor(9, 0, 28, 0, false); + Item_Pickup_Spin_Effect(986, 315, 327); + Actor_Says(9, 80, 23); + Actor_Clue_Acquire(0, 265, 1, 9); + Actor_Says(9, 90, 15); + Actor_Says(0, 1735, 17); + Actor_Says(9, 100, 16); + Actor_Says(9, 110, 3); + Actor_Face_Actor(actorId, 0, true); + if (actorId == 3) { + Actor_Says(3, 90, 3); + } else { + Actor_Says(6, 380, 3); + } + Actor_Says(0, 1740, 14); + Actor_Says(9, 120, 12); + Actor_Set_Goal_Number(9, 2); + if (actorId == 3) { + Actor_Says(3, 100, 3); + } else { + Actor_Says(6, 390, 3); + } + Actor_Face_Actor(0, actorId, true); + Actor_Says(0, 1745, 3); + Async_Actor_Walk_To_XYZ(actorId, 309.0f, 40.63f, 402.0f, 0, false); + Loop_Actor_Walk_To_XYZ(0, 277.0f, 40.63f, 410.0f, 0, 0, false, 0); + Game_Flag_Set(529); + Set_Enter(42, 39); + } +} + +void SceneScriptHF05::sub_402370() { + Player_Loses_Control(); + if (Global_Variable_Query(1) == 3) { + ADQ_Flush(); + ADQ_Add(9, 130, 18); + ADQ_Add(9, 140, 18); + ADQ_Add(9, 150, 18); + ADQ_Add(9, 160, 17); + } + Loop_Actor_Walk_To_XYZ(0, 307.0f, 40.63f, 184.0f, 0, 0, false, 0); + Loop_Actor_Walk_To_Actor(9, 0, 72, 0, false); + Ambient_Sounds_Play_Sound(149, 99, 99, 0, 0); + Actor_Face_Actor(9, 0, true); + Actor_Face_Actor(0, 9, true); + Actor_Says(9, 170, 3); + Actor_Says(9, 180, 12); + Actor_Says(9, 190, 14); + Actor_Says(9, 200, 15); + Actor_Says(0, 1815, 12); + Actor_Says(9, 210, 16); + Actor_Says(0, 1820, -1); + Actor_Says(9, 220, 3); + Actor_Says(9, 230, 12); + Actor_Says(9, 240, 14); + Actor_Says(0, 1825, 0); + Actor_Says(9, 250, 15); + Actor_Face_Object(9, "MONTE CARLO DRY", true); + Actor_Says(9, 260, 16); + Actor_Face_Object(0, "MONTE CARLO DRY", true); + Actor_Says(0, 1830, 0); + Actor_Face_Actor(9, 0, true); + Actor_Face_Actor(0, 9, true); + Actor_Says(9, 270, 3); + Actor_Says(9, 280, 12); + Async_Actor_Walk_To_XYZ(9, 276.0f, 40.63f, 182.0f, 12, false); + Loop_Actor_Walk_To_XYZ(0, 335.0f, 40.63f, 131.0f, 12, 0, false, 0); + Actor_Face_Object(9, "MONTE CARLO DRY", true); + Actor_Face_Object(0, "MONTE CARLO DRY", true); + Actor_Says(9, 290, 14); + Actor_Says(9, 300, 15); + Actor_Says(9, 310, 16); + Actor_Says(0, 1835, 12); + Actor_Face_Actor(9, 0, true); + Actor_Says(9, 320, 3); + Actor_Face_Actor(0, 9, true); + Actor_Says(9, 330, 12); + Actor_Says(0, 1840, 3); + Actor_Says(9, 340, 14); + Actor_Says(0, 1845, 3); + Actor_Says(9, 350, 15); + Actor_Says(9, 360, 16); + Actor_Says(0, 1850, 3); + Player_Gains_Control(); +} + +void SceneScriptHF05::sub_404474() { + Ambient_Sounds_Add_Sound(87, 20, 80, 20, 100, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Speech_Sound(23, 250, 5, 70, 7, 10, -50, 50, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(23, 330, 5, 70, 7, 10, -50, 50, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(23, 340, 5, 90, 7, 10, -50, 50, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(23, 360, 5, 70, 7, 10, -50, 50, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(24, 380, 5, 70, 7, 10, -50, 50, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(24, 510, 5, 70, 7, 10, -50, 50, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(38, 80, 5, 70, 7, 10, -50, 50, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(38, 160, 5, 70, 7, 10, -50, 50, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(38, 280, 5, 70, 7, 10, -50, 50, -101, -101, 1, 1); +} + +int SceneScriptHF05::sub_4048C0() { + if (Actor_Query_In_Set(3, 41) == 1 && Actor_Query_Goal_Number(3) != 599) { + return 3; + } + if (Actor_Query_In_Set(6, 41) == 1 && Actor_Query_Goal_Number(6) != 599) { + return 6; + } + return 0; +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/hf06.cpp b/engines/bladerunner/script/scene/hf06.cpp new file mode 100644 index 0000000000..2be8565551 --- /dev/null +++ b/engines/bladerunner/script/scene/hf06.cpp @@ -0,0 +1,286 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptHF06::InitializeScene() { + Setup_Scene_Information(150.0f, 349.93f, 502.0f, 229); + Game_Flag_Reset(529); + Scene_Exit_Add_2D_Exit(0, 195, 197, 271, 237, 2); + Ambient_Sounds_Add_Looping_Sound(54, 50, 0, 1); + Ambient_Sounds_Add_Looping_Sound(99, 40, -100, 1); + Ambient_Sounds_Add_Looping_Sound(100, 40, 100, 1); + Ambient_Sounds_Add_Sound(68, 10, 100, 25, 50, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(69, 10, 100, 25, 50, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(375, 10, 70, 50, 100, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(376, 10, 70, 50, 100, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(377, 10, 70, 50, 100, 0, 0, -101, -101, 0, 0); + if (Game_Flag_Query(559)) { + Scene_Loop_Set_Default(3); + sub_4023E0(); + } else { + Scene_Loop_Set_Default(0); + } +} + +void SceneScriptHF06::SceneLoaded() { + Unobstacle_Object("BOX22", true); + Unobstacle_Object("BOX34", true); + Clickable_Object("BOX19"); + Clickable_Object("BOX21"); + Clickable_Object("BOX23"); + Clickable_Object("HOOD BOX"); + Clickable_Object("BOX28"); + Clickable_Object("BOX29"); + Clickable_Object("BOX30"); +} + +bool SceneScriptHF06::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptHF06::ClickedOn3DObject(const char *objectName, bool a2) { + if (Object_Query_Click("BOX28", objectName) || Object_Query_Click("BOX29", objectName) || Object_Query_Click("BOX30", objectName) || Object_Query_Click("HOOD BOX", objectName)) { + if (!Loop_Actor_Walk_To_XYZ(0, 14.33f, 367.93f, 399.0f, 0, 1, false, 0)) { + Actor_Face_Heading(0, 486, true); + if (Actor_Query_In_Set(3, 42) && Actor_Query_Goal_Number(3) != 599) { + Actor_Face_Actor(3, 0, true); + Actor_Says(3, 210, 12); + Actor_Says(0, 2125, 12); + } else if (Actor_Query_In_Set(6, 42) && Actor_Query_Goal_Number(6) != 599) { + Actor_Face_Actor(6, 0, true); + Actor_Says(6, 490, 18); + Actor_Says(0, 2125, 12); + } else { + Actor_Says(0, 8635, 12); + } + } + return false; + } + if (Object_Query_Click("BOX19", objectName) || Object_Query_Click("BOX21", objectName)) { + if (!Loop_Actor_Walk_To_XYZ(0, 290.0f, 367.93f, 318.0f, 0, 1, false, 0)) { + Actor_Face_Heading(0, 85, true); + Actor_Says(0, 8522, 0); + } + return false; + } + if (Object_Query_Click("BOX13", objectName)) { + if (!Loop_Actor_Walk_To_XYZ(0, 63.0f, 367.93f, 120.0f, 0, 1, false, 0)) { + Actor_Face_Heading(0, 568, true); + Actor_Says(0, 8522, 0); + } + return false; + } + return false; +} + +bool SceneScriptHF06::ClickedOnActor(int actorId) { + if (actorId == 6 && Actor_Query_Goal_Number(6) != 599) { + Actor_Face_Actor(6, 0, true); + Actor_Face_Actor(0, 6, true); + if (Game_Flag_Query(559)) { + Actor_Says(6, 390, 18); + Actor_Says(0, 2115, 17); + } + } else if (actorId == 3 && Actor_Query_Goal_Number(3) != 599) { + Actor_Face_Actor(3, 0, true); + Actor_Face_Actor(0, 3, true); + if (Game_Flag_Query(559)) { + Actor_Says(3, 100, 3); + Actor_Says(0, 2115, 17); + } + } + return false; +} + +bool SceneScriptHF06::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptHF06::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, 170.0f, 367.93f, 497.0f, 0, 1, false, 0)) { + Actor_Face_Heading(0, 730, false); + Loop_Actor_Travel_Stairs(0, 2, 0, 0); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(530); + Set_Enter(41, 38); + } + return true; + } + return false; +} + +bool SceneScriptHF06::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptHF06::SceneFrameAdvanced(int frame) { +} + +void SceneScriptHF06::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { + if (actorId == 1 && oldGoal != 599 && newGoal == 599) { + Loop_Actor_Walk_To_Actor(0, 1, 24, 0, false); + Actor_Says(1, 250, -1); + Actor_Says(0, 2120, 4); + Actor_Says(1, 260, -1); + Actor_Says(1, 270, -1); + int otherActorId = -1; + if (Actor_Query_In_Set(3, 42) && Actor_Query_Goal_Number(3) == 599) { + otherActorId = 3; + } else if (Actor_Query_In_Set(6, 42) && Actor_Query_Goal_Number(6) == 599) { + otherActorId = 6; + } + if (otherActorId != -1) { + Music_Play(21, 35, 0, 3, -1, 0, 0); + Player_Set_Combat_Mode(false); + Delay(1000); + Actor_Voice_Over(990, 99); + Actor_Voice_Over(1000, 99); + Actor_Voice_Over(1010, 99); + Loop_Actor_Walk_To_Actor(0, otherActorId, 24, 0, false); + Item_Pickup_Spin_Effect(932, 355, 200); + Actor_Voice_Over(1020, 99); + Actor_Voice_Over(1030, 99); + Actor_Voice_Over(1040, 99); + Actor_Voice_Over(1050, 99); + Actor_Clue_Acquire(0, 146, 1, -1); + } + if (Actor_Query_In_Set(3, 42)) { + Actor_Set_Targetable(3, false); + } + if (Actor_Query_In_Set(6, 42)) { + Actor_Set_Targetable(6, false); + } + Scene_Exits_Enable(); + } +} + +void SceneScriptHF06::PlayerWalkedIn() { + if (Game_Flag_Query(662)) { + int actor_id; + if (Global_Variable_Query(45) == 3 && Actor_Query_Goal_Number(6) != 599) { + actor_id = 6; + } else { + actor_id = Global_Variable_Query(45) == 2 && Actor_Query_Goal_Number(3) != 599 ? 3 : -1; + } + if (actor_id != -1) { + Actor_Put_In_Set(actor_id, 42); + if (Game_Flag_Query(559)) { + Actor_Set_At_XYZ(actor_id, 173.67f, 367.93f, 446.04001f, 229); + Async_Actor_Walk_To_XYZ(actor_id, 173.67f, 367.93f, 394.04001f, 0, false); + } else { + Actor_Set_At_XYZ(actor_id, 97.67f, 367.93f, 534.04f, 725); + Async_Actor_Walk_To_XYZ(actor_id, 24.2f, 367.93f, 537.71f, 0, false); + } + } + } + Footstep_Sound_Override_On(3); + Loop_Actor_Travel_Stairs(0, 2, 1, 0); + Footstep_Sound_Override_Off(); + if (Game_Flag_Query(662) && !Game_Flag_Query(559)) { + sub_401EF4(); + } +} + +void SceneScriptHF06::PlayerWalkedOut() { + Music_Stop(2); +} + +void SceneScriptHF06::DialogueQueueFlushed(int a1) { +} + +void SceneScriptHF06::sub_401EF4() { + int actorId; + + if (Actor_Query_In_Set(3, 42)) { + actorId = 3; + } else { + if (!Actor_Query_In_Set(6, 42)) { + return; + } + actorId = 6; + } + Actor_Set_Targetable(actorId, true); + Loop_Actor_Walk_To_XYZ(0, 14.33f, 367.93f, 399.0f, 0, 0, true, 0); + Actor_Face_Heading(0, 486, true); + sub_4023E0(); + Actor_Put_In_Set(1, 42); + Actor_Set_At_XYZ(1, 92.0f, 367.93f, 19.0f, 0); + Actor_Set_Targetable(1, true); + Actor_Face_Actor(actorId, 1, true); + if (actorId == 3) { + Actor_Says(3, 90, 13); + } else if (actorId == 6) { + Actor_Says(6, 380, 13); + } + Actor_Says(0, 6230, 0); + Actor_Says(1, 280, 58); + Actor_Face_Actor(0, 1, true); + Player_Set_Combat_Mode(true); + Actor_Change_Animation_Mode(0, 5); + Actor_Change_Animation_Mode(1, 7); + Loop_Actor_Walk_To_XYZ(1, 92.0f, 367.93f, 107.0f, 0, 0, false, 0); + Actor_Face_Actor(1, 0, true); + Actor_Change_Animation_Mode(1, 4); + Actor_Says(1, 290, 58); + Actor_Says(0, 2130, -1); + Actor_Says(1, 300, 59); + Actor_Says(0, 2135, -1); + Actor_Says(1, 310, 60); + Actor_Says(0, 2140, -1); + Actor_Says(1, 320, 59); + Actor_Says(0, 2145, -1); + Actor_Says(1, 330, 58); + Actor_Says(1, 340, 58); + Actor_Says(1, 350, 58); + Actor_Change_Animation_Mode(1, 4); + Game_Flag_Set(644); + Actor_Set_Goal_Number(1, 402); + Actor_Face_Actor(1, actorId, true); + Actor_Change_Animation_Mode(1, 6); + Delay(500); + Scene_Loop_Set_Default(3); + Scene_Loop_Start_Special(2, 2, 1); + Sound_Play(562, 50, 0, 0, 50); + Game_Flag_Set(559); + Scene_Exits_Disable(); + Non_Player_Actor_Combat_Mode_On(1, 3, 1, actorId, 15, 4, 7, 8, 0, 0, 100, 10, 300, 0); +} + +void SceneScriptHF06::sub_4023E0() { + Ambient_Sounds_Add_Sound(87, 20, 80, 20, 100, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Speech_Sound(23, 250, 5, 70, 7, 10, -50, 50, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(23, 330, 5, 70, 7, 10, -50, 50, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(23, 340, 5, 90, 7, 10, -50, 50, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(23, 360, 5, 70, 7, 10, -50, 50, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(24, 380, 5, 70, 7, 10, -50, 50, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(24, 510, 5, 70, 7, 10, -50, 50, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(38, 80, 5, 70, 7, 10, -50, 50, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(38, 160, 5, 70, 7, 10, -50, 50, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(38, 280, 5, 70, 7, 10, -50, 50, -101, -101, 1, 1); +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/hf07.cpp b/engines/bladerunner/script/scene/hf07.cpp new file mode 100644 index 0000000000..1669afb104 --- /dev/null +++ b/engines/bladerunner/script/scene/hf07.cpp @@ -0,0 +1,154 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptHF07::InitializeScene() { + if (Game_Flag_Query(361) ) { + Setup_Scene_Information(-84.0f, 58.43f, -105.0f, 524); + } else { + Setup_Scene_Information(298.0f, 58.43f, -71.0f, 700); + } + Scene_Exit_Add_2D_Exit(0, 289, 136, 344, 305, 0); + Scene_Exit_Add_2D_Exit(1, 69, 264, 132, 303, 2); + Ambient_Sounds_Add_Looping_Sound(108, 100, 0, 1); + Ambient_Sounds_Add_Looping_Sound(112, 32, 0, 1); + Ambient_Sounds_Add_Sound(303, 5, 40, 20, 33, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(304, 5, 40, 20, 33, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(305, 5, 40, 20, 33, -100, 100, -101, -101, 0, 0); + if (Game_Flag_Query(368) ) { + Scene_Loop_Set_Default(2); + } else { + Scene_Loop_Set_Default(0); + } +} + +void SceneScriptHF07::SceneLoaded() { + Obstacle_Object("BRIMS02", true); + Unobstacle_Object("BOX50", true); + Unobstacle_Object("BOX60", true); +} + +bool SceneScriptHF07::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptHF07::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptHF07::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptHF07::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptHF07::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (Actor_Query_In_Set(3, 43)) { + Async_Actor_Walk_To_XYZ(3, 235.0f, 58.43f, -100.0f, 0, false); + } else if (Actor_Query_In_Set(6, 43)) { + Async_Actor_Walk_To_XYZ(6, 235.0f, 58.43f, -100.0f, 0, false); + } + if (!Loop_Actor_Walk_To_XYZ(0, 318.0f, 71.43f, -102.0f, 0, 1, false, 0)) { + Game_Flag_Set(358); + if (!Game_Flag_Query(662)) { + Actor_Face_Heading(0, 0, false); + Footstep_Sound_Override_On(3); + Loop_Actor_Travel_Stairs(0, 30, 1, 0); + Footstep_Sound_Override_Off(); + } + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Set_Enter(41, 38); + } + return true; + } + if (exitId == 1) { + if (Actor_Query_In_Set(3, 43)) { + Async_Actor_Walk_To_XYZ(3, -73.0f, 58.43f, -7.0f, 0, false); + } else if (Actor_Query_In_Set(6, 43)) { + Async_Actor_Walk_To_XYZ(6, -73.0f, 58.43f, -7.0f, 0, false); + } + if (!Loop_Actor_Walk_To_XYZ(0, -84.0f, 58.43f, -105.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(360); + Set_Enter(78, 90); + } + return true; + } + return false; +} + +bool SceneScriptHF07::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptHF07::SceneFrameAdvanced(int frame) { +} + +void SceneScriptHF07::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptHF07::PlayerWalkedIn() { + if (Game_Flag_Query(662)) { + int actorId = sub_401864(); + if (Game_Flag_Query(662) && actorId != -1) { + Actor_Put_In_Set(actorId, 43); + if (Game_Flag_Query(361)) { + Actor_Set_At_XYZ(actorId, -73.0f, 58.43f, -7.0f, 224); + } else { + Actor_Set_At_XYZ(actorId, 235.0f, 58.43f, -100.0f, 512); + } + } + } else if (Game_Flag_Query(359)) { + Actor_Set_At_XYZ(0, 267.72f, 329.43f, -86.75f, 940); + Footstep_Sound_Override_On(3); + Loop_Actor_Travel_Stairs(0, 30, 0, 0); + Footstep_Sound_Override_Off(); + } + Game_Flag_Reset(359); + Game_Flag_Reset(361); +} + +void SceneScriptHF07::PlayerWalkedOut() { +} + +void SceneScriptHF07::DialogueQueueFlushed(int a1) { +} + +int SceneScriptHF07::sub_401864() { + if (Global_Variable_Query(45) == 2 && Actor_Query_Goal_Number(3) != 599) { + return 3; + } + if (Global_Variable_Query(45) == 3 && Actor_Query_Goal_Number(6) != 599) { + return 6; + } + return -1; +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/kp01.cpp b/engines/bladerunner/script/scene/kp01.cpp new file mode 100644 index 0000000000..cdaffe91be --- /dev/null +++ b/engines/bladerunner/script/scene/kp01.cpp @@ -0,0 +1,171 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptKP01::InitializeScene() { + if (Game_Flag_Query(416)) { + Setup_Scene_Information(-125.0f, -12.2f, -61.0f, 400); + } else if (Game_Flag_Query(418)) { + Setup_Scene_Information(-284.0f, -12.2f, -789.0f, 445); + } else { + Setup_Scene_Information(239.0f, -12.2f, -146.0f, 820); + Game_Flag_Reset(413); + if (!Game_Flag_Query(674) && !Game_Flag_Query(653)) { + Game_Flag_Set(674); + Actor_Set_Goal_Number(1, 420); + } + } + Scene_Exit_Add_2D_Exit(0, 0, 0, 30, 479, 3); + Scene_Exit_Add_2D_Exit(1, 150, 0, 200, 276, 0); + Scene_Exit_Add_2D_Exit(2, 589, 0, 639, 479, 1); + Ambient_Sounds_Add_Looping_Sound(464, 34, 1, 1); + Ambient_Sounds_Add_Looping_Sound(383, 27, 1, 1); + Ambient_Sounds_Add_Looping_Sound(384, 90, 1, 1); + Ambient_Sounds_Add_Sound(440, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(441, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(442, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(375, 5, 180, 50, 100, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(377, 5, 180, 50, 100, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(443, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(444, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(445, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); +} + +void SceneScriptKP01::SceneLoaded() { + Unobstacle_Object("TRAINCAR-1", true); + Unobstacle_Object("FORE-JUNK-02", true); + Obstacle_Object("OBSTACLE1", true); + Obstacle_Object("TUBE1", true); + Unclickable_Object("OBSTACLE1"); +} + +bool SceneScriptKP01::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptKP01::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptKP01::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptKP01::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptKP01::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -125.0f, -12.2f, -61.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(415); + Set_Enter(47, 44); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -284.0f, -12.2f, -789.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(417); + Set_Enter(46, 43); + } + return true; + } + if (exitId == 2) { + if (!Loop_Actor_Walk_To_XYZ(0, 239.0f, 12.2f, -146.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(414); + Set_Enter(45, 42); + } + return true; + } + return false; +} + + +bool SceneScriptKP01::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptKP01::SceneFrameAdvanced(int frame) { +} + +void SceneScriptKP01::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { + if (actorId == 1) { + if (newGoal == 422) { + if (Game_Flag_Query(378) == 1) { + Delay(500); + Actor_Change_Animation_Mode(0, 75); + Delay(4500); + Actor_Face_Current_Camera(0, true); + Actor_Says(0, 510, 3); + } else { + Delay(3000); + } + Async_Actor_Walk_To_XYZ(0, 76.56f, -12.2f, -405.48f, 0, false); + //return true; + } else if (newGoal == 423) { + Player_Gains_Control(); + Actor_Force_Stop_Walking(0); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(417); + Set_Enter(46, 43); + //return true; + } + } + //return false; +} + +void SceneScriptKP01::PlayerWalkedIn() { + if (Game_Flag_Query(416)) { + Loop_Actor_Walk_To_XYZ(0, -93.0f, -12.2f, -61.0f, 0, 0, false, 0); + Game_Flag_Reset(416); + } else if (Game_Flag_Query(418)) { + Loop_Actor_Walk_To_XYZ(0, -240.0f, -12.2f, -789.0f, 0, 0, false, 0); + Game_Flag_Reset(418); + } else { + Loop_Actor_Walk_To_XYZ(0, 211.0f, -12.2f, -146.0f, 0, 0, false, 0); + if (!Game_Flag_Query(653) + && !Game_Flag_Query(714) + && Actor_Query_Goal_Number(1) == 420 + && Actor_Query_Goal_Number(1) != 599) { + Player_Loses_Control(); + Actor_Set_Goal_Number(1, 421); + } + } +} + +void SceneScriptKP01::PlayerWalkedOut() { +} + +void SceneScriptKP01::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/kp02.cpp b/engines/bladerunner/script/scene/kp02.cpp new file mode 100644 index 0000000000..906f80da28 --- /dev/null +++ b/engines/bladerunner/script/scene/kp02.cpp @@ -0,0 +1,147 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptKP02::InitializeScene() { + if (Game_Flag_Query(414)) { + Setup_Scene_Information(-884.0f, -615.49f, 3065.0f, 20); + } else { + Setup_Scene_Information(-1040.0f, -615.49f, 2903.0f, 339); + Game_Flag_Reset(412); + } + Scene_Exit_Add_2D_Exit(1, 0, 0, 30, 479, 3); + Ambient_Sounds_Add_Looping_Sound(464, 34, 1, 1); + Ambient_Sounds_Add_Looping_Sound(383, 27, 1, 1); + Ambient_Sounds_Add_Looping_Sound(384, 90, 1, 1); + Ambient_Sounds_Add_Sound(440, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(441, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(442, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(375, 5, 180, 50, 100, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(376, 5, 180, 50, 100, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(377, 5, 180, 50, 100, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(443, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(444, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(445, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); +} + +void SceneScriptKP02::SceneLoaded() { + Obstacle_Object("VAN GRATE", true); + Clickable_Object("VAN GRATE"); + Unobstacle_Object("VAN GRATE", true); + Unobstacle_Object("BOX05", true); + Unobstacle_Object("BOX08", true); + Unobstacle_Object("BOX09", true); + Unobstacle_Object("BOX01", true); + Unclickable_Object("VAN GRATE"); +} + +bool SceneScriptKP02::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptKP02::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptKP02::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptKP02::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptKP02::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -1040.0f, -615.49f, 2903.0f, 0, 1, false, 0)) { + if (Actor_Query_Goal_Number(65) == 406 || Actor_Query_Goal_Number(64) == 406) { + Non_Player_Actor_Combat_Mode_Off(65); + Non_Player_Actor_Combat_Mode_Off(64); + Actor_Set_Goal_Number(65, 400); + Actor_Set_Goal_Number(64, 400); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(411); + Set_Enter(84, 96); + } else { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(411); + Set_Enter(84, 96); + } + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -884.0f, -615.49f, 3065.0f, 0, 1, false, 0)) { + if (Actor_Query_Goal_Number(65) == 406 || Actor_Query_Goal_Number(64) == 406) { + Non_Player_Actor_Combat_Mode_Off(65); + Non_Player_Actor_Combat_Mode_Off(64); + Actor_Set_Goal_Number(65, 400); + Actor_Set_Goal_Number(64, 400); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(413); + Set_Enter(44, 41); + } else { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(413); + Set_Enter(44, 41); + } + } + return true; + } + return false; +} + +bool SceneScriptKP02::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptKP02::SceneFrameAdvanced(int frame) { +} + +void SceneScriptKP02::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptKP02::PlayerWalkedIn() { + if (Game_Flag_Query(414)) { + Loop_Actor_Walk_To_XYZ(0, -884.0f, -615.49f, 3035.0f, 0, 0, false, 0); + Game_Flag_Reset(414); + } + if (Game_Flag_Query(653) && Actor_Query_Goal_Number(1) != 599) { + Actor_Set_Goal_Number(1, 450); + } + //return false; +} + +void SceneScriptKP02::PlayerWalkedOut() { +} + +void SceneScriptKP02::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/kp03.cpp b/engines/bladerunner/script/scene/kp03.cpp new file mode 100644 index 0000000000..49fc01c1ec --- /dev/null +++ b/engines/bladerunner/script/scene/kp03.cpp @@ -0,0 +1,262 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptKP03::InitializeScene() { + if (Game_Flag_Query(420)) { + Setup_Scene_Information(1.0f, -36.55f, 111.0f, 200); + } else { + Setup_Scene_Information(-321.0f, -36.55f, 26.0f, 350); + } + Scene_Exit_Add_2D_Exit(0, 0, 0, 30, 479, 3); + Scene_Exit_Add_2D_Exit(1, 287, 104, 367, 255, 0); + Ambient_Sounds_Add_Looping_Sound(381, 100, 1, 1); + Ambient_Sounds_Add_Sound(68, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(69, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(375, 60, 180, 50, 100, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(376, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(377, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0); + if (Game_Flag_Query(422)) { + Scene_Loop_Set_Default(5); + } else if (Game_Flag_Query(484)) { + Scene_Loop_Set_Default(7); + } else { + Scene_Loop_Set_Default(2); + Game_Flag_Set(421); + } + if ((Actor_Query_Goal_Number(1) != 599 && !Game_Flag_Query(422) && !Game_Flag_Query(484)) && ((Game_Flag_Query(653) && Game_Flag_Query(420)) || (!Game_Flag_Query(653) && Game_Flag_Query(417)))) { + Actor_Put_In_Set(1, 46); + Actor_Set_At_XYZ(1, -300.0f, -36.55f, 26.0f, 350); + } +} + +void SceneScriptKP03::SceneLoaded() { + Obstacle_Object("BRACK MID", true); + Unobstacle_Object("OBSTACLE_REMOVE", true); + Unobstacle_Object("BOX11", true); + Unobstacle_Object("OBSTACLE05", true); + Clickable_Object("BRACK MID"); +} + +bool SceneScriptKP03::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptKP03::ClickedOn3DObject(const char *objectName, bool a2) { + Actor_Face_Object(1, "BRACK MID", true); + if (Object_Query_Click("BRACK MID", objectName) && !Game_Flag_Query(422)) { + if (a2) { + Scene_Loop_Set_Default(5); + Scene_Loop_Start_Special(2, 4, 1); + Actor_Change_Animation_Mode(0, 39); + Actor_Retired_Here(0, 72, 18, 1, -1); + Game_Flag_Set(422); + Game_Flag_Reset(421); + return false; + } + if (Actor_Query_Goal_Number(1) == 411) { + Scene_Exits_Enable(); + sub_401E54(); + } else { + if (Game_Flag_Query(417)) { + Loop_Actor_Walk_To_XYZ(0, -137.0f, -36.55f, 26.0f, 0, 0, true, 0); + } else if (Game_Flag_Query(420)) { + Loop_Actor_Walk_To_XYZ(0, -50.0f, -36.55f, 78.0f, 0, 0, true, 0); + } + if (Game_Flag_Query(421)) { + Actor_Face_Object(0, "BRACK MID", true); + Game_Flag_Set(484); + Game_Flag_Reset(421); + Scene_Loop_Set_Default(7); + Scene_Loop_Start_Special(2, 0, 0); + Actor_Voice_Over(1110, 99); + Actor_Voice_Over(1120, 99); + } else { + Actor_Face_Object(0, "BRACK MID", true); + Actor_Says(0, 8580, 13); + } + } + return true; + } + return false; +} + +bool SceneScriptKP03::ClickedOnActor(int actorId) { + if (actorId == 1 && Actor_Query_Goal_Number(1) == 411) { + Actor_Face_Object(1, "BRACK MID", true); + sub_401E54(); + } + return false; +} + +bool SceneScriptKP03::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptKP03::ClickedOnExit(int exitId) { + if (Actor_Query_Goal_Number(1) == 410) { + Actor_Set_Goal_Number(1, 418); + } else { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, 1.0f, -36.55f, 111.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Music_Stop(2); + Game_Flag_Reset(417); + Game_Flag_Reset(420); + Game_Flag_Set(419); + Set_Enter(9, 45); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -321.0f, -36.55f, 26.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Music_Stop(2); + Game_Flag_Reset(417); + Game_Flag_Reset(420); + Game_Flag_Set(418); + Set_Enter(44, 41); + } + return true; + } + } + return false; +} + +bool SceneScriptKP03::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptKP03::SceneFrameAdvanced(int frame) { + int v1; + float x, y, z; + + if (frame == 123) { + Ambient_Sounds_Play_Sound(491, 99, -60, 100, 99); + } + if (Game_Flag_Query(421) && !Game_Flag_Query(484)) { + v1 = -1; + if (!Game_Flag_Query(422)) { + Actor_Query_XYZ(0, &x, &y, &z); + if ((Game_Flag_Query(417) && -130.0f < x) || (Game_Flag_Query(420) && -130.0f > x)) { + v1 = 0; + } + } + if (!Game_Flag_Query(422)) { //todo ? same condition as before + Actor_Query_XYZ(1, &x, &y, &z); + if (Game_Flag_Query(653) && Actor_Query_Which_Set_In(1) == 46) { + if ((Game_Flag_Query(417) && -130.0f > x) || (Game_Flag_Query(420) && -130.0f < x)) { + v1 = 1; + } + } else if ((Game_Flag_Query(417) && -130.0f < x) || (Game_Flag_Query(420) && -130.0f > x)) { + v1 = 1; + } + } + if (v1 != -1) { + Scene_Loop_Set_Default(5); + Scene_Loop_Start_Special(2, 4, 1); + Game_Flag_Set(422); + Game_Flag_Reset(421); + Unclickable_Object("BRACK MID"); + Scene_Exits_Enable(); + if (v1 == 1) { + Actor_Set_Goal_Number(1, 415); + Music_Play(12, 25, 0, 1, -1, 0, 0); + if (Actor_Query_Inch_Distance_From_Actor(0, 1) <= 120) { + v1 = 0; + } + } + if (v1) { + Actor_Change_Animation_Mode(0, 21); + } else { + Actor_Force_Stop_Walking(0); + Actor_Change_Animation_Mode(0, 48); + Actor_Retired_Here(0, 72, 18, 1, -1); + } + } + } +} + +void SceneScriptKP03::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptKP03::PlayerWalkedIn() { + if (Game_Flag_Query(420)) { + Loop_Actor_Walk_To_XYZ(0, 1.0f, -36.55f, 87.0f, 0, 0, false, 0); + } + if (Actor_Query_Is_In_Current_Set(1) && Actor_Query_Goal_Number(1) != 419) { + if (Game_Flag_Query(653)) { + if (Game_Flag_Query(420)) { + Actor_Set_Goal_Number(1, 410); + } + } else if (!Game_Flag_Query(422) && !Game_Flag_Query(484) && Game_Flag_Query(417)) { + Scene_Exits_Disable(); + Delay(1000); + Actor_Set_Goal_Number(1, 411); + } + } +} + +void SceneScriptKP03::PlayerWalkedOut() { +} + +void SceneScriptKP03::DialogueQueueFlushed(int a1) { +} + +void SceneScriptKP03::sub_401E54() { + Player_Loses_Control(); + Actor_Says(0, 2180, 14); + Actor_Set_Goal_Number(1, 412); + Actor_Says(1, 480, 60); + Actor_Face_Object(0, "BRACK MID", true); + Actor_Says(0, 2185, 14); + Loop_Actor_Walk_To_XYZ(1, -137.0f, -36.55f, 26.0f, 0, 0, false, 0); + Actor_Face_Object(1, "BRACK MID", true); + Actor_Says(1, 490, 58); + Actor_Says(0, 2190, 14); + Actor_Says(1, 500, 58); + Actor_Says(1, 510, 59); + Actor_Says(1, 520, 60); + Game_Flag_Set(484); + Game_Flag_Reset(421); + Scene_Loop_Set_Default(7); + Scene_Loop_Start_Special(2, 7, 0); + Actor_Set_Goal_Number(1, 413); + Actor_Says(0, 2195, 14); + Ambient_Sounds_Play_Sound(151, 40, -60, -60, 0); + Loop_Actor_Walk_To_XYZ(0, 1.0f, -36.55f, 111.0f, 0, 0, false, 0); + Actor_Set_Goal_Number(1, 430); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Reset(417); + Game_Flag_Reset(420); + Game_Flag_Set(419); + Set_Enter(9, 45); + Player_Gains_Control(); +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/kp04.cpp b/engines/bladerunner/script/scene/kp04.cpp new file mode 100644 index 0000000000..0ace6d23f8 --- /dev/null +++ b/engines/bladerunner/script/scene/kp04.cpp @@ -0,0 +1,118 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptKP04::InitializeScene() { + if (Game_Flag_Query(575)) { + Setup_Scene_Information(-544.0f, 94.89f, 288.0f, 700); + } else { + Setup_Scene_Information(-905.0f, 94.89f, 1357.0f, 970); + } + Scene_Exit_Add_2D_Exit(0, 0, 455, 639, 479, 2); + Scene_Exit_Add_2D_Exit(1, 475, 247, 514, 416, 1); + Ambient_Sounds_Add_Looping_Sound(464, 34, 1, 1); + Ambient_Sounds_Add_Looping_Sound(383, 27, 1, 1); + Ambient_Sounds_Add_Looping_Sound(384, 90, 1, 1); + Ambient_Sounds_Add_Sound(440, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(441, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(442, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(375, 5, 180, 50, 100, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(376, 5, 180, 50, 100, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(377, 5, 180, 50, 100, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(443, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(444, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(445, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); +} + +void SceneScriptKP04::SceneLoaded() { + Obstacle_Object("BUILDING04", true); + Unobstacle_Object("BOX06", true); + Unclickable_Object("BUILDING04"); +} + +bool SceneScriptKP04::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptKP04::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptKP04::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptKP04::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptKP04::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -905.0f, 94.89f, 1357.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(416); + Set_Enter(44, 41); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -544.0f, 94.89f, 288.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(574); + Set_Enter(9, 45); + } + return true; + } + return false; +} + +bool SceneScriptKP04::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptKP04::SceneFrameAdvanced(int frame) { +} + +void SceneScriptKP04::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptKP04::PlayerWalkedIn() { + if (Game_Flag_Query(575)) { + Loop_Actor_Walk_To_XYZ(0, -584.0f, 94.89f, 288.0f, 0, 0, false, 0); + Game_Flag_Reset(575); + } else { + Game_Flag_Reset(415); + } +} + +void SceneScriptKP04::PlayerWalkedOut() { +} + +void SceneScriptKP04::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/kp05.cpp b/engines/bladerunner/script/scene/kp05.cpp new file mode 100644 index 0000000000..3fb963534d --- /dev/null +++ b/engines/bladerunner/script/scene/kp05.cpp @@ -0,0 +1,171 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptKP05::InitializeScene() { + if (Game_Flag_Query(577)) { + Setup_Scene_Information(-868.0f, 0.0f, -68.0f, 520); + } else if (Game_Flag_Query(574)) { + Setup_Scene_Information(-1142.0f, 0.0f, 932.0f, 276); + } else { + Setup_Scene_Information(-802.0f, 0.0f, 972.0f, 800); + } + Scene_Exit_Add_2D_Exit(0, 589, 0, 639, 479, 1); + Scene_Exit_Add_2D_Exit(1, 0, 0, 30, 479, 3); + Scene_Exit_Add_2D_Exit(2, 0, 0, 257, 204, 0); + Ambient_Sounds_Add_Looping_Sound(464, 34, 1, 1); + Ambient_Sounds_Add_Looping_Sound(383, 27, 1, 1); + Ambient_Sounds_Add_Looping_Sound(384, 90, 1, 1); + Ambient_Sounds_Add_Sound(440, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(441, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(442, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(375, 5, 180, 50, 100, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(376, 5, 180, 50, 100, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(377, 5, 180, 50, 100, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(443, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(444, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(445, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); +} + +void SceneScriptKP05::SceneLoaded() { + Unobstacle_Object("OBSTACLEBOX20", true); + Clickable_Object("BRIDGE02"); + Unclickable_Object("BRIDGE02"); + if (!Actor_Clue_Query(0, 145) && Game_Flag_Query(653)) { + Item_Add_To_World(118, 960, 9, -1095.0f, 0.0f, 770.0f, 256, 24, 24, false, true, false, true); + } +} + +bool SceneScriptKP05::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptKP05::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptKP05::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptKP05::ClickedOnItem(int itemId, bool a2) { + if (itemId == 118) { + if (!Loop_Actor_Walk_To_XYZ(0, -1058.0f, 0.0f, 852.0f, 0, 1, false, 0)) { + Actor_Face_Item(0, 118, true); + Actor_Clue_Acquire(0, 145, 1, -1); + Item_Remove_From_World(118); + Item_Pickup_Spin_Effect(960, 58, 321); + } + } + return false; +} + +bool SceneScriptKP05::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -802.0f, 0.0f, 972.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(420); + Set_Enter(46, 43); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -1142.0f, 0.0f, 932.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(575); + Set_Enter(47, 44); + } + return true; + } + if (exitId == 2) { + if (!Loop_Actor_Walk_To_XYZ(0, -868.0f, 0.0f, -68.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(576); + Async_Actor_Walk_To_XYZ(0, -868.0f, 0.0f, -216.0f, 0, false); + Set_Enter(9, 46); + } + return true; + } + return false; +} + +bool SceneScriptKP05::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptKP05::SceneFrameAdvanced(int frame) { +} + +void SceneScriptKP05::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptKP05::PlayerWalkedIn() { + if (Game_Flag_Query(577)) { + Game_Flag_Reset(577); + } else if (Game_Flag_Query(574)) { + Loop_Actor_Walk_To_XYZ(0, -1110.0f, 0.0f, 932.0f, 0, 0, false, 0); + Game_Flag_Reset(574); + } else { + Loop_Actor_Walk_To_XYZ(0, -846.0f, 0.0f, 972.0f, 0, 0, false, 0); + Game_Flag_Query(419); + } + if (Actor_Query_Goal_Number(66) == 411) { + Actor_Set_Goal_Number(66, 412); + } + if (Actor_Query_Goal_Number(1) == 450) { + Scene_Exits_Disable(); + Actor_Face_Actor(1, 0, true); + Actor_Says(1, 530, 15); + Actor_Says(1, 540, 16); + Actor_Face_Actor(0, 1, true); + Player_Set_Combat_Mode(true); + Actor_Says(0, 2200, 3); + Actor_Says(1, 550, 17); + Actor_Says(0, 2205, 3); + Actor_Says(1, 560, 15); + Actor_Says(1, 570, 16); + Actor_Says(1, 580, 13); + Actor_Says(0, 2210, 3); + Actor_Says(1, 590, 13); + Actor_Says(0, 2215, 3); + Actor_Says(1, 600, 16); + Actor_Says(1, 610, 15); + Actor_Says(0, 2220, 3); + Actor_Says(1, 620, 15); + Actor_Says(1, 630, 17); + Non_Player_Actor_Combat_Mode_On(1, 0, 1, 0, 9, 4, 7, 8, 0, -1, -1, 20, 240, 0); + } +} + +void SceneScriptKP05::PlayerWalkedOut() { +} + +void SceneScriptKP05::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/kp06.cpp b/engines/bladerunner/script/scene/kp06.cpp new file mode 100644 index 0000000000..a56080af23 --- /dev/null +++ b/engines/bladerunner/script/scene/kp06.cpp @@ -0,0 +1,237 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptKP06::InitializeScene() { + if (Game_Flag_Query(579) ) { + Setup_Scene_Information(-755.0f, 8.26f, -665.0f, 640); + } else { + Setup_Scene_Information(-868.0f, 8.26f, -8.0f, 0); + } + Scene_Exit_Add_2D_Exit(0, 270, 445, 639, 479, 2); + Scene_Exit_Add_2D_Exit(1, 320, 158, 352, 220, 0); + Ambient_Sounds_Add_Looping_Sound(464, 34, 1, 1); + Ambient_Sounds_Add_Looping_Sound(383, 27, 1, 1); + Ambient_Sounds_Add_Looping_Sound(384, 90, 1, 1); + Ambient_Sounds_Add_Sound(440, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(441, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(442, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(375, 5, 180, 50, 100, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(376, 5, 180, 50, 100, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(377, 5, 180, 50, 100, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(443, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(444, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(445, 2, 100, 25, 33, -100, 100, -101, -101, 0, 0); + if (Game_Flag_Query(576) ) { + Scene_Loop_Start_Special(0, 0, 0); + Scene_Loop_Set_Default(1); + Game_Flag_Reset(576); + } else { + Scene_Loop_Set_Default(1); + } +} + +void SceneScriptKP06::SceneLoaded() { + Obstacle_Object("TRASH CAN WITH FIRE", true); + Obstacle_Object("MOONBUS", true); + Obstacle_Object("STAIR 1", true); + Obstacle_Object("COCKPIT FRONT", true); + Unobstacle_Object("OBSTACLEBOX28", true); + Unobstacle_Object("OBSTACLEBOX32", true); + Unclickable_Object("TRASH CAN WITH FIRE"); +} + +bool SceneScriptKP06::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptKP06::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptKP06::ClickedOnActor(int actorId) { + if (actorId == 8 && !Game_Flag_Query(714)) { + if (Actor_Clue_Query(8, 145)) { + Actor_Face_Actor(0, 8, true); + Actor_Says(0, 8610, 15); + Actor_Says(8, 290, 3); + } else if (Actor_Clue_Query(0, 145) ) { + Actor_Says(8, 280, 3); + Actor_Says(8, 290, 3); + Actor_Clue_Acquire(8, 145, 1, 0); + } else { + Actor_Says(0, 2320, 3); + Actor_Says(0, 2325, 3); + Actor_Says(8, 300, 3); + Actor_Says(8, 310, 3); + } + } + return false; +} + +bool SceneScriptKP06::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptKP06::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -868.0f, 8.26f, -68.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(577); + Set_Enter(9, 45); + } + return true; + } + if (exitId == 1) { + if (Actor_Clue_Query(8, 145) || Actor_Query_Goal_Number(8) != 416) { + if (!Loop_Actor_Walk_To_XYZ(0, -731.0f, 8.26f, -657.0f, 0, 1, false, 0)) { + if (Game_Flag_Query(653)) { + if (!Game_Flag_Query(714)) { + Player_Set_Combat_Mode(false); + } + } else if (Actor_Query_Goal_Number(1) == 433) { + Actor_Set_Goal_Number(1, 499); + } else { + Actor_Set_Goal_Number(53, 499); + } + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(578); + Set_Enter(48, 47); + } + } else if (Actor_Clue_Query(0, 145) ) { + Actor_Says(8, 280, 3); + Actor_Says(8, 290, 3); + Actor_Clue_Acquire(8, 145, 1, 0); + Loop_Actor_Walk_To_XYZ(0, -731.0f, 8.26f, -657.0f, 0, 0, true, 0); + Player_Set_Combat_Mode(false); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(578); + Set_Enter(48, 47); + } else { + Actor_Set_Goal_Number(8, 417); + } + return true; + } + return false; +} + +bool SceneScriptKP06::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptKP06::SceneFrameAdvanced(int frame) { +} + +void SceneScriptKP06::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptKP06::PlayerWalkedIn() { + if (!Game_Flag_Query(653) && Game_Flag_Query(579)) { + Game_Flag_Reset(579); + if (Actor_Query_Goal_Number(1) == 499) { + Actor_Face_Actor(1, 0, true); + Actor_Says(1, 2530, 13); + Actor_Face_Actor(0, 1, true); + Actor_Says(0, 6200, 11); + Actor_Says(1, 2540, 15); + Actor_Says(1, 2550, 12); + Actor_Says(0, 6205, 14); + if (Actor_Query_Friendliness_To_Other(1, 0) < 50) { + Actor_Says(1, 2560, 12); + Actor_Says(0, 6210, 14); + Actor_Says(1, 2570, 13); + Actor_Says(0, 6215, 14); + Actor_Says(1, 2580, 15); + Actor_Says(1, 2590, 12); + } + Async_Actor_Walk_To_Waypoint(0, 551, 0, 0); + Delay(1000); + Actor_Says(0, 6220, -1); + Delay(3000); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Outtake_Play(25, 0, -1); + Game_Over(); + //return true; + return; + } else { + Actor_Set_Goal_Number(53, 499); + Actor_Face_Actor(53, 0, true); + Actor_Says(53, 220, 13); + Actor_Face_Actor(0, 53, true); + Actor_Says(0, 6245, 11); + Actor_Says(53, 230, 14); + if (Game_Flag_Query(714)) { + Actor_Says(0, 6250, 15); + Actor_Says(53, 240, 13); + Delay(1000); + Actor_Says(0, 6255, 17); + Actor_Says(53, 250, 14); + Delay(1000); + } + Actor_Says(53, 260, 12); + Actor_Says(0, 6260, 15); + Actor_Says(53, 270, 13); + Actor_Says(53, 280, 15); + Actor_Says(0, 6265, 14); + Actor_Says(53, 290, 14); + Actor_Says(53, 300, 15); + Actor_Says(0, 6270, 11); + Async_Actor_Walk_To_Waypoint(0, 550, 0, 0); + Async_Actor_Walk_To_Waypoint(53, 551, 0, 0); + Actor_Says(53, 310, -1); + Delay(3000); + Outtake_Play(26, 0, -1); + Game_Over(); + //return true; + return; + } + } else { + if (Actor_Query_Goal_Number(8) == 414) { + Loop_Actor_Walk_To_XYZ(0, -809.0f, 8.26f, -619.0f, 0, 0, false, 0); + Actor_Face_Actor(0, 8, true); + Actor_Set_Goal_Number(8, 415); + } + if (Actor_Query_Goal_Number(1) == 431) { + Actor_Set_Goal_Number(1, 432); + } + //return false; + return; + } +} + +void SceneScriptKP06::PlayerWalkedOut() { + if (Game_Flag_Query(578) && Actor_Query_Goal_Number(1) == 433) { + Actor_Set_Goal_Number(1, 499); + } +} + +void SceneScriptKP06::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/kp07.cpp b/engines/bladerunner/script/scene/kp07.cpp new file mode 100644 index 0000000000..8fe4bfbc04 --- /dev/null +++ b/engines/bladerunner/script/scene/kp07.cpp @@ -0,0 +1,178 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptKP07::InitializeScene() { + Setup_Scene_Information(-12.0f, -41.58f, 72.0f, 0); + Game_Flag_Reset(578); + Scene_Exit_Add_2D_Exit(0, 315, 185, 381, 285, 0); + if (Game_Flag_Query(653)) { + if (Game_Flag_Query(47) && Actor_Query_Goal_Number(3) < 599) { + Actor_Set_Targetable(3, true); + Global_Variable_Increment(51, 1); + Actor_Put_In_Set(3, 48); + Actor_Set_At_XYZ(3, -52.0f, -41.52f, -5.0f, 289); + } + if (Actor_Query_Goal_Number(19) < 599) { + Global_Variable_Increment(51, 1); + Actor_Set_Targetable(19, true); + Actor_Put_In_Set(19, 48); + Actor_Set_At_XYZ(19, -26.0f, -41.52f, -135.0f, 0); + } + if (Game_Flag_Query(44) && Actor_Query_Goal_Number(7) < 599) { + Global_Variable_Increment(51, 1); + Actor_Set_Targetable(7, true); + Actor_Put_In_Set(7, 48); + Actor_Set_At_XYZ(7, -38.0f, -41.52f, -175.0f, 500); + } + if (Game_Flag_Query(45) && Actor_Query_Goal_Number(2) < 599) { + Global_Variable_Increment(51, 1); + Actor_Set_Targetable(2, true); + Actor_Put_In_Set(2, 48); + Actor_Set_At_XYZ(2, 61.0f, -41.52f, -3.0f, 921); + } + if (Game_Flag_Query(46) && Actor_Query_Goal_Number(6) < 599) { + Global_Variable_Increment(51, 1); + Actor_Put_In_Set(6, 48); + Actor_Set_At_XYZ(6, 78.0f, -41.52f, -119.0f, 659); + } + if (Actor_Query_Goal_Number(10) < 599) { + Global_Variable_Increment(51, 1); + Actor_Put_In_Set(10, 48); + Actor_Set_At_XYZ(10, -47.0f, 0.0f, 151.0f, 531); + } + } + Ambient_Sounds_Add_Looping_Sound(585, 7, 1, 1); + Ambient_Sounds_Add_Looping_Sound(586, 52, 1, 1); + Ambient_Sounds_Add_Looping_Sound(109, 38, 1, 1); + if (Game_Flag_Query(582)) { + Scene_Loop_Set_Default(2); + } else { + Scene_Loop_Set_Default(0); + } +} + +void SceneScriptKP07::SceneLoaded() { + if (!Game_Flag_Query(653)) { + Music_Play(19, 25, 0, 0, -1, 1, 0); + } + Obstacle_Object("BUNK_TRAY01", true); + Unobstacle_Object("BUNK_TRAY01", true); + if (Game_Flag_Query(653)) { + Player_Set_Combat_Mode(false); + Scene_Exits_Disable(); + } +} + +bool SceneScriptKP07::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptKP07::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptKP07::ClickedOnActor(int actorId) { + if (actorId == 5) { + if (Game_Flag_Query(697) || actorId != 5 || Actor_Query_Goal_Number(5) == 599 || Actor_Query_Goal_Number(5) == 515) { + return false; + } + if (Game_Flag_Query(653)) { + Actor_Set_Goal_Number(5, 516); + } else { + Music_Play(20, 31, 0, 0, -1, 1, 0); + Actor_Set_Goal_Number(5, 514); + } + } else { + Actor_Face_Actor(0, actorId, true); + Actor_Says(0, 8590, 14); + } + return true; +} + +bool SceneScriptKP07::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptKP07::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -12.0f, -41.58f, 72.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(579); + Set_Enter(9, 46); + } + return true; + } + return false; +} + +bool SceneScriptKP07::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptKP07::SceneFrameAdvanced(int frame) { +} + +void SceneScriptKP07::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptKP07::PlayerWalkedIn() { + Loop_Actor_Walk_To_XYZ(0, 9.0f, -41.88f, -81.0f, 0, 0, false, 0); + if (!Game_Flag_Query(658)) { + if (Game_Flag_Query(653)) { + Actor_Face_Actor(0, 5, true); + Actor_Says(5, 1240, 3); + Actor_Says(0, 8500, 3); + Actor_Says(5, 1250, 3); + if (Actor_Query_Goal_Number(8) == 416) { + Actor_Put_In_Set(8, 48); + Global_Variable_Increment(51, 1); + Actor_Set_At_XYZ(8, -12.0f, -41.58f, 72.0f, 0); + Actor_Face_Actor(8, 5, true); + } + } else { + Actor_Face_Actor(0, 5, true); + Actor_Says(5, 160, 3); + Actor_Retired_Here(5, 72, 60, 0, -1); + } + Game_Flag_Set(658); + } +} + +void SceneScriptKP07::PlayerWalkedOut() { + Music_Stop(3); +} + +void SceneScriptKP07::DialogueQueueFlushed(int a1) { + if (Actor_Query_Goal_Number(5) == 515) { + Actor_Set_Targetable(5, false); + Actor_Change_Animation_Mode(5, 21); + Actor_Retired_Here(5, 12, 48, 1, -1); + Actor_Set_Goal_Number(5, 599); + } +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ma01.cpp b/engines/bladerunner/script/scene/ma01.cpp new file mode 100644 index 0000000000..094abc586e --- /dev/null +++ b/engines/bladerunner/script/scene/ma01.cpp @@ -0,0 +1,257 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptMA01::InitializeScene() { + Setup_Scene_Information(381.0f, 0.0f, 54.0f, 992); + if (Game_Flag_Query(250)) { + Setup_Scene_Information(381.0f, 0.0f, 54.0f, 992); + } + if (Game_Flag_Query(38)) { + Setup_Scene_Information(1446.0f, 0.0f, -725.0f, 660); + } + Scene_Exit_Add_2D_Exit(0, 328, 132, 426, 190, 0); + if (Game_Flag_Query(250)) { + Scene_Exit_Add_2D_Exit(1, 234, 240, 398, 328, 2); + } + Ambient_Sounds_Add_Looping_Sound(101, 90, 0, 1); + Ambient_Sounds_Add_Looping_Sound(99, 40, -100, 1); + Ambient_Sounds_Add_Looping_Sound(100, 40, 100, 1); + Ambient_Sounds_Add_Sound(68, 10, 100, 25, 50, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(69, 10, 100, 25, 50, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(375, 10, 70, 50, 100, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(376, 10, 70, 50, 100, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(377, 10, 70, 50, 100, 0, 0, -101, -101, 0, 0); + if (Game_Flag_Query(38)) { + Scene_Loop_Set_Default(1); + Game_Flag_Reset(38); + } else { + Actor_Set_Invisible(0, true); + Game_Flag_Set(273); + Scene_Loop_Start_Special(0, 0, 0); + Scene_Loop_Set_Default(1); + } + if (Game_Flag_Query(409)) { + Actor_Set_Goal_Number(53, 3); + Game_Flag_Reset(409); + } +} + +void SceneScriptMA01::SceneLoaded() { + Obstacle_Object("WRENCH", true); + Unobstacle_Object("OBSTICLEBOX01", true); + Clickable_Object("WRENCH"); + Unclickable_Object("Y2 PADRIM 01"); + Unclickable_Object("Y2 PADRIM 02"); + Unclickable_Object("NGON01"); +} + +bool SceneScriptMA01::MouseClick(int x, int y) { + return Region_Check(286, 326, 348, 384); +} + +bool SceneScriptMA01::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptMA01::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptMA01::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptMA01::ClickedOnExit(int exitId) { + if (Actor_Query_Goal_Number(19) == 21) { + return true; + } + if (exitId == 0) { + if (Actor_Query_Goal_Number(19) == 20) { + if (!Loop_Actor_Walk_To_XYZ(0, 1446.0f, 0.0f, -725.0f, 72, 1, false, 0)) { + Actor_Set_Goal_Number(19, 21); + Scene_Exits_Disable(); + } + } else if (!Loop_Actor_Walk_To_XYZ(0, 1446.0f, 0.0f, -725.0f, 12, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(37); + Set_Enter(52, 52); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, 381.0f, 0.0f, 54.0f, 0, 1, false, 0)) { + Player_Loses_Control(); + Actor_Face_Heading(0, 736, false); + Game_Flag_Reset(176); + Game_Flag_Reset(182); + Game_Flag_Reset(179); + Game_Flag_Reset(180); + Game_Flag_Reset(261); + Game_Flag_Reset(177); + Game_Flag_Reset(258); + Game_Flag_Reset(178); + int spinnerDest = Spinner_Interface_Choose_Dest(3, 0); + + switch (spinnerDest) { + case 0: + Game_Flag_Set(178); + Game_Flag_Reset(250); + Game_Flag_Set(251); + Set_Enter(61, 65); + Scene_Loop_Start_Special(1, 4, 1); + break; + case 2: + Game_Flag_Set(182); + Game_Flag_Reset(250); + Game_Flag_Set(249); + Set_Enter(69, 78); + Scene_Loop_Start_Special(1, 4, 1); + break; + case 3: + Game_Flag_Set(176); + Game_Flag_Reset(250); + Game_Flag_Set(248); + Set_Enter(4, 13); + Scene_Loop_Start_Special(1, 4, 1); + break; + case 5: + Game_Flag_Set(261); + Game_Flag_Reset(250); + Game_Flag_Set(307); + Set_Enter(17, 82); + Scene_Loop_Start_Special(1, 4, 1); + break; + case 4: + Game_Flag_Set(180); + Game_Flag_Reset(250); + Game_Flag_Set(252); + Set_Enter(0, 0); + Scene_Loop_Start_Special(1, 4, 1); + break; + case 6: + Game_Flag_Set(177); + Game_Flag_Reset(250); + Game_Flag_Set(253); + Set_Enter(7, 25); + Scene_Loop_Start_Special(1, 4, 1); + break; + case 7: + Game_Flag_Set(258); + Game_Flag_Reset(250); + Game_Flag_Set(254); + Set_Enter(20, 2); + Scene_Loop_Start_Special(1, 4, 1); + break; + case 8: + Game_Flag_Set(181); + Game_Flag_Reset(250); + Game_Flag_Set(255); + Set_Enter(54, 54); + Scene_Loop_Start_Special(1, 4, 1); + break; + case 9: + Game_Flag_Set(257); + Game_Flag_Reset(250); + Game_Flag_Set(256); + Set_Enter(37, 34); + Scene_Loop_Start_Special(1, 4, 1); + break; + default: + Actor_Set_Invisible(0, false); + Actor_Face_Heading(0, 736, false); + Game_Flag_Set(179); + break; + } + } + return true; + } + return false; +} + +bool SceneScriptMA01::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptMA01::SceneFrameAdvanced(int frame) { + if (frame == 15) { + Ambient_Sounds_Play_Sound(102, 70, -100, 100, 0); + } + if (frame == 61 || frame == 183) { + Ambient_Sounds_Play_Sound(116, 100, 40, 0, 99); + } + if (frame == 107 || frame == 227) { + Ambient_Sounds_Play_Sound(119, 100, 40, 0, 99); + } + if (frame == 1) { + Ambient_Sounds_Play_Sound(118, 40, -60, 20, 99); + } + if (frame == 241) { + Ambient_Sounds_Play_Sound(117, 40, 0, 0, 99); + } + if (frame == 58) { + Sound_Play(122, 17, 20, 20, 50); + } + if ((frame == 75 || frame == 196) && Game_Flag_Query(273)) { + Actor_Face_Heading(0, 736, false); + Actor_Change_Animation_Mode(0, 42); + Game_Flag_Reset(273); + } else { + if (frame == 196 && !Game_Flag_Query(273)) { + Actor_Change_Animation_Mode(0, 41); + //return true; + return; + } + if (frame == 240) { + Player_Gains_Control(); + } + } + //return true; +} + +void SceneScriptMA01::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptMA01::PlayerWalkedIn() { +} + +void SceneScriptMA01::PlayerWalkedOut() { + Actor_Set_Invisible(0, false); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + if (!Game_Flag_Query(37) && Global_Variable_Query(1) == 1) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Outtake_Play(37, 1, -1); + Outtake_Play(34, 1, -1); + Outtake_Play(36, 1, -1); + } +} + +void SceneScriptMA01::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ma02.cpp b/engines/bladerunner/script/scene/ma02.cpp new file mode 100644 index 0000000000..063fddc90b --- /dev/null +++ b/engines/bladerunner/script/scene/ma02.cpp @@ -0,0 +1,267 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptMA02::InitializeScene() { + if (Game_Flag_Query(36)) { + Setup_Scene_Information(-172.0f, -144.13f, 6.27f, 500); + } else { + Setup_Scene_Information(23.19f, -144.12f, 378.27f, 750); + if (Global_Variable_Query(1) == 4) { + Actor_Set_Goal_Number(40, 300); + } + Game_Flag_Reset(711); + } + Scene_Exit_Add_2D_Exit(0, 538, 84, 639, 327, 1); + Scene_Exit_Add_2D_Exit(1, 56, 98, 150, 260, 0); + if (Global_Variable_Query(1) >= 4 && Global_Variable_Query(1) == 5 && Game_Flag_Query(653)) { + Actor_Set_Goal_Number(66, 599); + Actor_Change_Animation_Mode(66, 88); + Actor_Put_In_Set(66, 10); + Actor_Set_At_XYZ(66, -35.51f, -144.12f, 428.0f, 0); + Actor_Retired_Here(66, 24, 24, 1, -1); + } + Ambient_Sounds_Add_Looping_Sound(104, 12, 0, 1); + Ambient_Sounds_Add_Looping_Sound(71, 25, 0, 1); + Ambient_Sounds_Add_Sound(72, 5, 30, 5, 5, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(73, 5, 30, 5, 5, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(74, 5, 30, 5, 5, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(375, 10, 60, 20, 20, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(376, 10, 60, 20, 20, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(87, 10, 60, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(68, 60, 180, 14, 14, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(69, 60, 180, 14, 14, 0, 0, -101, -101, 0, 0); + if (sub_401F7C()) { + Ambient_Sounds_Add_Sound(403, 3, 3, 27, 27, -100, -100, -100, -100, 99, 0); + } + if (Global_Variable_Query(1) == 5 && Game_Flag_Query(653) && !Actor_Clue_Query(0, 264)) { + Overlay_Play("MA02OVER", 0, 1, 0, 0); + } +} + +void SceneScriptMA02::SceneLoaded() { + Obstacle_Object("COUCH1", true); + Unobstacle_Object("COUCH1", true); + Clickable_Object("BAR-MAIN"); + Clickable_Object("E-ESPER"); +} + +bool SceneScriptMA02::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptMA02::ClickedOn3DObject(const char *objectName, bool a2) { + if (Object_Query_Click("E-ESPER", objectName)) { + Actor_Face_Object(0, "E-ESPER", true); + Delay(1000); + ESPER_Flag_To_Activate(); + return true; + } + if (Object_Query_Click("BAR-MAIN", objectName) && !Loop_Actor_Walk_To_XYZ(0, -29.0f, -140.4f, 298.0f, 36, 1, false, 0)) { + Actor_Face_Object(0, "BAR-MAIN", true); + if (Global_Variable_Query(1) < 4) { + Actor_Set_Goal_Number(66, 3); + } else if (Global_Variable_Query(1) == 5 && Game_Flag_Query(653) && !Actor_Clue_Query(0, 264)) { + Overlay_Remove("MA02OVER"); + Item_Pickup_Spin_Effect(985, 480, 240); + Actor_Voice_Over(1150, 99); + Actor_Voice_Over(1160, 99); + Actor_Voice_Over(1170, 99); + Actor_Voice_Over(1180, 99); + Actor_Voice_Over(1190, 99); + Actor_Voice_Over(1200, 99); + Actor_Clue_Acquire(0, 264, 1, -1); + } else { + Actor_Says(0, 8526, 0); + } + return true; + } + return false; +} + +bool SceneScriptMA02::ClickedOnActor(int actorId) { + if (actorId == 66 && Actor_Query_Goal_Number(66) == 599) { + if (!Loop_Actor_Walk_To_Actor(0, 66, 30, 1, false)) { + Actor_Face_Actor(0, 66, true); + Actor_Voice_Over(1140, 99); + } + } + return false; +} + +bool SceneScriptMA02::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptMA02::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, 23.19f, -144.12f, 378.27f, 0, 1, false, 0)) { + Music_Stop(10); + Game_Flag_Set(33); + Set_Enter(52, 52); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -168.0f, -144.13f, 10.27f, 0, 1, false, 0)) { + Game_Flag_Set(35); + Set_Enter(50, 50); + } + return true; + } + return false; +} + +bool SceneScriptMA02::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptMA02::SceneFrameAdvanced(int frame) { +} + +void SceneScriptMA02::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptMA02::PlayerWalkedIn() { + if (Game_Flag_Query(34)) { + sub_402044(); + } + if (Game_Flag_Query(36)) { + Loop_Actor_Walk_To_XYZ(0, -148.12f, -144.13f, 34.27f, 0, 1, false, 0); + } + if (Global_Variable_Query(1) == 4 && !Game_Flag_Query(655)) { + Game_Flag_Set(623); + Game_Flag_Set(655); + sub_401E4C(); + Loop_Actor_Walk_To_XYZ(0, 23.19f, -144.12f, 378.27f, 0, 0, false, 0); + Game_Flag_Set(33); + Set_Enter(52, 52); + // return true; + return; + } + if (Global_Variable_Query(1) == 5 && !Game_Flag_Query(654)) { + if (Game_Flag_Query(653)) { + Actor_Says(0, 2390, 0); + Music_Play(2, 25, 0, 3, -1, 0, 0); + } else { + Actor_Says(0, 2385, 3); + } + Game_Flag_Set(654); + Autosave_Game(3); + } + if (Global_Variable_Query(1) < 4 && !Game_Flag_Query(36) && Actor_Query_Goal_Number(66) != 2) { + Actor_Set_Goal_Number(66, 1); + if (!Game_Flag_Query(60)) { + Game_Flag_Set(60); + Actor_Face_Actor(0, 66, true); + Actor_Voice_Over(1210, 99); + if (!Game_Flag_Query(378)) { + Actor_Voice_Over(1220, 99); + } + Actor_Voice_Over(1230, 99); + if (!Game_Flag_Query(378)) { + Actor_Voice_Over(1240, 99); + Actor_Voice_Over(1250, 99); + } + } + } + Game_Flag_Reset(36); + Game_Flag_Reset(34); + //return false; + return; +} + +void SceneScriptMA02::PlayerWalkedOut() { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); +} + +void SceneScriptMA02::DialogueQueueFlushed(int a1) { +} + +void SceneScriptMA02::sub_401E4C() { + Actor_Says(0, 2365, 13); + Actor_Says(40, 0, 13); + Actor_Says(0, 2370, 13); + Actor_Says(40, 10, 13); + Actor_Says(0, 2375, 13); + Actor_Says(40, 20, 13); + Actor_Says(0, 2380, 13); + Sound_Play(492, 100, 0, 100, 50); + Actor_Says(40, 40, 13); + Delay(3000); +} + +bool SceneScriptMA02::sub_401F7C() { + return Global_Variable_Query(1) == 5 + && !Actor_Clue_Query(0, 143) + && !Actor_Clue_Query(0, 144) + && !Actor_Clue_Query(0, 139) + && !Actor_Clue_Query(0, 140) + && !Actor_Clue_Query(0, 141) + && !Actor_Clue_Query(0, 142); +} + +void SceneScriptMA02::sub_402044() { + // int v0; + // int v1; + // int v3[7]; + + // v0 = 0; + + int i = 0; + int arr[7]; + if (Global_Variable_Query(1) < 4 && Game_Flag_Query(45)) { + // v0 = 1; + // v3[0] = 0; + arr[i++] = 0; + } + + // v1 = v0 + 1; + // v3[v0] = 1; + arr[i++] = 1; + if (Global_Variable_Query(1) >= 3) { + // v3[v1] = 2; + // v1 = v0 + 2; + arr[i++] = 2; + } + if (Global_Variable_Query(1) >= 2 && Global_Variable_Query(1) <= 4) { + // v3[v1++] = 3; + arr[i++] = 3; + } + if (Game_Flag_Query(171) && Game_Flag_Query(170)) { + // v3[v1++] = 4; + arr[i++] = 4; + } + //if (v1 <= 0) { + if (i == 0) { + Global_Variable_Set(52, -1); + } else { + // Global_Variable_Set(52, v3[Random_Query(0, v1 - 1)]); + Global_Variable_Set(52, arr[Random_Query(0, i - 1)]); + } +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ma04.cpp b/engines/bladerunner/script/scene/ma04.cpp new file mode 100644 index 0000000000..7025319c71 --- /dev/null +++ b/engines/bladerunner/script/scene/ma04.cpp @@ -0,0 +1,565 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptMA04::InitializeScene() { + if (Game_Flag_Query(63)) { + Setup_Scene_Information(-7199.0f, 953.97f, 1579.0f, 502); + if (Global_Variable_Query(1) != 2 && Global_Variable_Query(1) != 3) { + Scene_Loop_Start_Special(0, 0, 0); + } + } else if (Game_Flag_Query(35)) { + Setup_Scene_Information(-7099.0f, 954.0f, 1866.0f, 502); + } else if (Game_Flag_Query(647)) { + Setup_Scene_Information(-7107.0f, 954.0f, 1742.0f, 502); + Scene_Loop_Start_Special(0, 4, 0); + } else { + Setup_Scene_Information(-7143.0f, 954.0f, 1868.0f, 733); + } + Scene_Exit_Add_2D_Exit(0, 496, 0, 639, 354, 1); + Scene_Exit_Add_2D_Exit(1, 33, 63, 113, 258, 0); + Scene_Exit_Add_2D_Exit(2, 248, 98, 314, 284, 1); + Scene_2D_Region_Add(0, 343, 97, 353, 190); + Scene_2D_Region_Add(1, 0, 340, 116, 479); + Ambient_Sounds_Add_Looping_Sound(408, 30, 0, 1); + Ambient_Sounds_Add_Looping_Sound(103, 30, -80, 1); + Ambient_Sounds_Add_Looping_Sound(104, 12, 0, 1); + Ambient_Sounds_Add_Sound(72, 5, 30, 11, 11, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(73, 5, 30, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(74, 5, 30, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(375, 10, 60, 20, 20, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(376, 10, 60, 20, 20, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(87, 10, 60, 16, 16, -100, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(68, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(69, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0); + if (sub_402758()) { + Ambient_Sounds_Add_Sound(403, 3, 3, 100, 100, 0, 0, 0, 0, 99, 0); + } + Scene_Loop_Set_Default(1); +} + +void SceneScriptMA04::SceneLoaded() { + Obstacle_Object("BED-DOG DISH", true); + Unobstacle_Object("BEDDog BONE", true); + Unobstacle_Object("BED-BOOK1", true); + Clickable_Object("BED-SHEETS"); + if (Game_Flag_Query(711)) { + Unclickable_Object("BED-TV-1"); + Unclickable_Object("BED-TV-2"); + } else { + Clickable_Object("BED-TV-1"); + Clickable_Object("BED-TV-2"); + } +} + +bool SceneScriptMA04::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptMA04::ClickedOn3DObject(const char *objectName, bool a2) { + if (Object_Query_Click("BED-SHEETS", objectName)) { + sub_403DA8(); + return false; + } + if (Object_Query_Click("BED-TV-1", objectName) || Object_Query_Click("BED-TV-2", objectName)) { + if (!Loop_Actor_Walk_To_Scene_Object(0, "BED-TV-2", 24, 1, false)) { + Game_Flag_Set(711); + Unclickable_Object("BED-TV-1"); + Unclickable_Object("BED-TV-2"); + Sound_Play(132, 100, 0, 0, 50); + sub_403864(); + return false; + } + return true; + } + return false; +} + +bool SceneScriptMA04::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptMA04::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptMA04::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -7099.0f, 954.0f, 1866.0f, 0, 1, false, 0)) { + Game_Flag_Set(36); + Set_Enter(10, 49); + } + return true; + } + if (exitId == 1) { + float x, y, z; + Actor_Query_XYZ(0, &x, &y, &z); + if (z <= 1677.0f || !Loop_Actor_Walk_To_XYZ(0, -7199.0f, 955.0f, 1675.0f, 0, 1, false, 0)) { + if (sub_402888()) { + Overlay_Remove("MA04OVER"); + } + Loop_Actor_Walk_To_XYZ(0, -7199.0f, 955.0f, 1675.0f, 0, 0, false, 1); + Game_Flag_Set(62); + if (Global_Variable_Query(1) != 2 && Global_Variable_Query(1) != 3) { + Async_Actor_Walk_To_XYZ(0, -7199.0f, 956.17f, 1568.0f, 0, false); + } + Set_Enter(51, 51); + } + return true; + } + if (exitId == 2) { + if (!Loop_Actor_Walk_To_XYZ(0, -7115.0f, 954.0f, 1742.0f, 0, 1, false, 0)) { + int sounds[] = {252, 405, 404, 407, 406}; + Ambient_Sounds_Play_Sound(sounds[Random_Query(0, 4)], 50, 0, 0, 0); + Delay(3000); + Loop_Actor_Walk_To_XYZ(0, -7139.0f, 954.0f, 1746.0f, 0, 1, false, 1); + } + } + return false; +} + +bool SceneScriptMA04::ClickedOn2DRegion(int region) { + if (Player_Query_Combat_Mode()) { + return false; + } + if (region == 1) { + sub_403DA8(); + return true; + } + if (region == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -7176.0f, 954.0f, 1806.0f, 0, 1, false, 0)) { + Actor_Face_Heading(0, 256, false); + if (sub_402758()) { + Actor_Says(0, 2680, 0); + Ambient_Sounds_Remove_Sound(403, true); + Sound_Play(123, 100, 0, 0, 50); + Overlay_Remove("MA04OVER"); + Delay(500); + if (Game_Flag_Query(653)) { + if (Global_Variable_Query(45) == 2) { + sub_4028A8(); + } else if (Global_Variable_Query(45) == 3) { + sub_402F2C(); + } else { + sub_4034D8(); + } + } else { + sub_4032A0(); + } + Music_Play(2, 52, 0, 3, -1, 0, 0); + return false; + } + if (Actor_Clue_Query(5, 222) && !Game_Flag_Query(649)) { + Sound_Play(123, 100, 0, 0, 50); + Overlay_Remove("MA04OVER"); + Delay(500); + Actor_Says(5, 310, 3); + Actor_Says(5, 320, 3); + if (!Game_Flag_Query(378) && Global_Variable_Query(1) < 3) { + Actor_Voice_Over(1300, 99); + Actor_Voice_Over(1310, 99); + Actor_Voice_Over(1320, 99); + } + Actor_Says(0, 2445, 13); + Sound_Play(123, 100, 0, 0, 50); + Game_Flag_Set(649); + return true; + } + if (Actor_Clue_Query(6, 215) && !Game_Flag_Query(650)) { + Sound_Play(123, 100, 0, 0, 50); + Overlay_Remove("MA04OVER"); + Delay(500); + Actor_Says(6, 500, 3); + Actor_Says(6, 510, 3); + if (!Game_Flag_Query(378) && Global_Variable_Query(1) < 3) { + Actor_Voice_Over(1330, 99); + Actor_Voice_Over(1340, 99); + Actor_Voice_Over(1350, 99); + } + Actor_Says(0, 2445, 13); + Sound_Play(123, 100, 0, 0, 50); + Game_Flag_Set(650); + return true; + } + Actor_Says(0, 2670, 13); + if (!Game_Flag_Query(378)) { + Actor_Says(0, 2675, 17); + } + } + return true; + } + return false; +} + +void SceneScriptMA04::SceneFrameAdvanced(int frame) { + Set_Fade_Color(0, 0, 0); + if (frame >= 91 && frame < 121) { + Set_Fade_Density((frame - 91) / 30.0f); + } else if (frame >= 121 && frame < 151) { + Set_Fade_Density((151 - frame) / 30.0f); + } else { + Set_Fade_Density(0.0f); + } + if (frame == 121 && (Game_Flag_Query(40) == 1 || Game_Flag_Query(41) == 1) && !Game_Flag_Query(159)) { + Sound_Play(403, 50, 0, 0, 50); + } +} + +void SceneScriptMA04::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptMA04::PlayerWalkedIn() { + if (Game_Flag_Query(647)) { + Player_Gains_Control(); + } + if (sub_402820() || sub_402758()) { + Overlay_Play("MA04OVER", 0, 1, 0, 0); + } + if (Game_Flag_Query(647)) { + Loop_Actor_Walk_To_XYZ(0, -7139.0f, 954.0f, 1746.0f, 0, 1, false, 0); + } else if (Game_Flag_Query(35)) { + Loop_Actor_Walk_To_XYZ(0, -7143.0f, 954.0f, 1868.0f, 0, 1, false, 0); + } + Game_Flag_Reset(35); + Game_Flag_Reset(63); + Game_Flag_Reset(647); + if (Game_Flag_Query(61)) { + if (Global_Variable_Query(1) == 2 && !Actor_Clue_Query(0, 43)) { + Sound_Play(403, 100, 0, 0, 50); + Loop_Actor_Walk_To_XYZ(0, -7176.0f, 954.0f, 1806.0f, 0, 0, false, 0); + Actor_Face_Heading(0, 256, true); + Actor_Says(0, 2680, 0); + Sound_Play(123, 100, 0, 0, 50); + Delay(500); + Actor_Says(4, 0, 3); + Actor_Says(0, 2685, 13); + Actor_Says(4, 10, 3); + Actor_Says(0, 2690, 17); + Actor_Says(4, 30, 3); + Actor_Says(0, 2695, 12); + Actor_Says(4, 40, 3); + Actor_Says(4, 50, 3); + Actor_Says(0, 2700, 3); + Actor_Says(4, 60, 3); + Actor_Says(4, 70, 3); + Sound_Play(123, 100, 0, 0, 50); + Actor_Clue_Acquire(0, 43, 1, 4); + Spinner_Set_Selectable_Destination_Flag(5, 1); + Game_Flag_Set(186); + if (!Game_Flag_Query(163)) { + Game_Flag_Set(163); + Item_Remove_From_World(66); + } + Actor_Set_Goal_Number(23, 99); + Actor_Put_In_Set(23, 93); + Actor_Set_At_Waypoint(23, 35, 0); + Autosave_Game(0); + } + //return false; + return; + } + if ((Game_Flag_Query(40) || Game_Flag_Query(41)) && !Game_Flag_Query(146)) { + Music_Play(2, 52, 0, 2, -1, 0, 0); + Player_Loses_Control(); + Loop_Actor_Walk_To_XYZ(0, -7199.0f, 955.0f, 1677.0f, 0, 1, false, 0); + if (sub_402820() || sub_402758()) { + Overlay_Remove("MA04OVER"); + } + Loop_Actor_Walk_To_XYZ(0, -7199.0f, 955.0f, 1675.0f, 0, 1, false, 0); + Game_Flag_Set(146); + Async_Actor_Walk_To_XYZ(0, -7204.0f, 956.17f, 1568.0f, 0, false); + Set_Enter(51, 51); + } +} + +void SceneScriptMA04::PlayerWalkedOut() { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + if (Game_Flag_Query(678)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Outtake_Play(1, 0, -1); + Game_Flag_Reset(678); + } +} + +void SceneScriptMA04::DialogueQueueFlushed(int a1) { + Overlay_Remove("MA04OVR2"); +} + +bool SceneScriptMA04::sub_402758() { + return Global_Variable_Query(1) == 5 && !Actor_Clue_Query(0, 143) && !Actor_Clue_Query(0, 144) && !Actor_Clue_Query(0, 139) && !Actor_Clue_Query(0, 140) && !Actor_Clue_Query(0, 141) && !Actor_Clue_Query(0, 142); +} + +bool SceneScriptMA04::sub_402820() { + return (Actor_Clue_Query(5, 222) && !Game_Flag_Query(649)) || (Actor_Clue_Query(6, 215) && !Game_Flag_Query(650)); +} + +bool SceneScriptMA04::sub_402888() { + return sub_402820() || sub_402758(); +} + +void SceneScriptMA04::sub_4028A8() { + int answer; + Actor_Says(3, 220, 3); + Actor_Says(0, 2460, 0); + Actor_Says(3, 230, 3); + Actor_Says(3, 240, 3); + Actor_Says(0, 2465, 0); + Actor_Says(3, 250, 3); + Actor_Says_With_Pause(0, 2470, 1.5f, 17); + Actor_Says(3, 260, 3); + Actor_Says(0, 2475, 15); + Actor_Says(3, 270, 3); + Actor_Says(0, 2480, 0); + Actor_Says(3, 280, 3); + Actor_Says(3, 290, 3); + Actor_Says(0, 2485, 19); + Actor_Says(3, 300, 3); + Actor_Says(3, 310, 3); + Actor_Says(0, 2490, 0); + Actor_Says(3, 330, 3); + Actor_Says(0, 2495, 0); + Actor_Says(3, 340, 3); + Actor_Says(3, 350, 3); + if (Game_Flag_Query(165) || Actor_Query_Goal_Number(9) == 2) { + answer = 1170; + } else { + Dialogue_Menu_Clear_List(); + DM_Add_To_List_Never_Repeat_Once_Selected(1160, 1, 1, 2); + DM_Add_To_List_Never_Repeat_Once_Selected(1170, 2, 1, 1); + Dialogue_Menu_Appear(320, 240); + answer = Dialogue_Menu_Query_Input(); + Dialogue_Menu_Disappear(); + } + if (answer == 1160) { + Actor_Says(0, 2500, 19); + Actor_Says(3, 360, 3); + Actor_Says(0, 2510, 0); + Actor_Says(3, 370, 3); + Actor_Says(3, 380, 3); + Actor_Says(0, 2515, 12); + Actor_Says(3, 390, 3); + Actor_Says(0, 2520, 13); + Actor_Says(3, 400, 3); + Actor_Says(3, 410, 3); + Actor_Says(0, 2525, 15); + Actor_Says(3, 420, 3); + Sound_Play(123, 100, 0, 0, 50); + Actor_Clue_Acquire(0, 139, 1, -1); + } else { + Actor_Says_With_Pause(0, 2505, 0.5f, 19); + Actor_Says(3, 430, 3); + Actor_Says(3, 440, 3); + Actor_Says(0, 2530, 0); + Actor_Says(3, 450, 3); + Actor_Says(0, 2535, 12); + Actor_Says(3, 460, 3); + Actor_Says_With_Pause(3, 470, 1.0f, 3); + Actor_Says(3, 480, 3); + Actor_Says(3, 490, 3); + Sound_Play(123, 100, 0, 0, 50); + Actor_Says(0, 2540, 15); + Actor_Clue_Acquire(0, 140, 1, -1); + } +} + +void SceneScriptMA04::sub_402F2C() { + Actor_Says(6, 530, 3); + Actor_Says(0, 2545, 19); + Actor_Says(6, 540, 3); + Actor_Says(6, 550, 3); + Actor_Says(0, 2550, 13); + Actor_Says(6, 560, 3); + Actor_Says(0, 2555, 19); + Actor_Says(6, 570, 3); + Actor_Says(0, 2560, 17); + Actor_Says(6, 580, 3); + if (Game_Flag_Query(165) || Actor_Query_Goal_Number(9) == 2) { + Actor_Says(6, 630, 3); + Actor_Says_With_Pause(0, 2575, 0.0f, 15); + if (!Game_Flag_Query(378)) { + Actor_Says(6, 640, 3); + } + Actor_Clue_Acquire(0, 142, 1, -1); + } else { + Actor_Says(6, 590, 3); + Actor_Says(0, 2565, 12); + Actor_Says(6, 600, 3); + Actor_Says(6, 610, 3); + Actor_Says(6, 620, 3); + Actor_Says(0, 2570, 13); + Actor_Says_With_Pause(6, 630, 0.0f, 3); + Actor_Says_With_Pause(0, 2575, 0.0f, 15); + if (!Game_Flag_Query(378)) { + Actor_Says(6, 640, 3); + } + Actor_Clue_Acquire(0, 141, 1, -1); + } + Sound_Play(123, 100, 0, 0, 50); +} + +void SceneScriptMA04::sub_4032A0() { + Actor_Says(1, 680, 3); + Actor_Says(0, 2630, 17); + Actor_Says(1, 690, 3); + Actor_Says(0, 2635, 18); + Actor_Says(1, 700, 3); + Actor_Says(0, 2640, 14); + Actor_Says(1, 710, 3); + Actor_Says(1, 720, 3); + Actor_Says(0, 2645, 13); + Actor_Says(1, 740, 3); + Actor_Says(1, 750, 3); + Actor_Says(0, 2650, 12); + Actor_Says(1, 760, 3); + Actor_Says(0, 2665, 13); + Actor_Says(1, 810, 3); + Actor_Says(1, 820, 3); + Sound_Play(123, 100, 0, 0, 50); + Actor_Clue_Acquire(0, 144, 1, -1); +} + +void SceneScriptMA04::sub_4034D8() { + Actor_Says(5, 330, 3); + Actor_Says(0, 2580, 14); + Actor_Says(5, 340, 3); + Actor_Says(0, 2585, 19); + Actor_Says(5, 350, 3); + Actor_Says(5, 360, 3); + Actor_Says(0, 2590, 18); + Actor_Says(5, 370, 3); + Actor_Says(0, 2595, 15); + Actor_Says(5, 390, 3); + Actor_Says(5, 400, 3); + Actor_Says(5, 410, 3); + Actor_Says(0, 2600, 15); + Actor_Says_With_Pause(5, 420, 1.5f, 3); + Actor_Says(0, 2605, 17); + Actor_Says(5, 430, 3); + Actor_Says(5, 440, 3); + Actor_Says(0, 2610, 3); + Actor_Says(5, 450, 3); + Actor_Says(5, 460, 3); + Actor_Says(5, 470, 3); + Actor_Says(5, 480, 3); + Actor_Says(5, 490, 3); + Actor_Says(0, 2615, 17); + Actor_Says(5, 500, 3); + Actor_Says(5, 530, 3); + Actor_Says(5, 540, 3); + Sound_Play(123, 100, 0, 0, 50); + Actor_Clue_Acquire(0, 143, 1, -1); +} + +void SceneScriptMA04::sub_403864() { + Overlay_Play("MA04OVR2", 0, 1, 0, 0); + switch (Global_Variable_Query(52)) { + case 4: + ADQ_Add(61, 230, 3); + ADQ_Add(61, 240, 3); + break; + case 3: + ADQ_Add(61, 170, 3); + ADQ_Add(61, 180, 3); + ADQ_Add(61, 190, 3); + ADQ_Add(61, 200, 3); + ADQ_Add(61, 210, 3); + ADQ_Add(61, 220, 3); + ADQ_Add(41, 80, 3); + ADQ_Add(41, 90, 3); + ADQ_Add(41, 100, 3); + ADQ_Add(41, 110, 3); + ADQ_Add(41, 120, 3); + ADQ_Add(41, 130, 3); + break; + case 2: + if (Actor_Query_Friendliness_To_Other(5, 0) <= Actor_Query_Friendliness_To_Other(1, 0)) { + ADQ_Add(61, 90, 3); + ADQ_Add(61, 100, 3); + ADQ_Add(61, 110, 3); + ADQ_Add(4, 1540, 3); + ADQ_Add(4, 1550, 3); + ADQ_Add(4, 1560, 3); + } else { + ADQ_Add(61, 120, 3); + ADQ_Add(61, 130, 3); + ADQ_Add(61, 140, 3); + ADQ_Add(61, 150, 3); + ADQ_Add(4, 1570, 3); + ADQ_Add(4, 1580, 3); + ADQ_Add(4, 1590, 3); + } + break; + case 1: + ADQ_Add(61, 40, 3); + ADQ_Add(61, 50, 3); + ADQ_Add(61, 60, 3); + ADQ_Add(61, 70, 3); + ADQ_Add(61, 80, 3); + break; + case 0: + ADQ_Add(61, 0, 3); + ADQ_Add(61, 10, 3); + ADQ_Add(61, 20, 3); + ADQ_Add(61, 30, 3); + ADQ_Add(51, 430, 3); + ADQ_Add(51, 440, 3); + ADQ_Add(51, 450, 3); + ADQ_Add(51, 460, 3); + break; + } +} + +void SceneScriptMA04::sub_403DA8() { + if (!Loop_Actor_Walk_To_Scene_Object(0, "BED-SHEETS", 12, 1, false)) { + Actor_Says(0, 8530, 12); + Music_Stop(4); + if (sub_402820() || sub_402758()) { + Overlay_Remove("MA04OVER"); + } + Player_Loses_Control(); + Game_Flag_Set(647); + if ((Game_Flag_Query(40) || Game_Flag_Query(41)) && Global_Variable_Query(1) == 1) { + if (Actor_Query_Goal_Number(19) == 599) { + Actor_Put_In_Set(19, 91); + Actor_Set_At_Waypoint(19, 33, 0); + } + Game_Flag_Set(678); + Global_Variable_Set(1, 2); + Chapter_Enter(2, 10, 50); + if (Query_Difficulty_Level() != 0) { + if (!Game_Flag_Query(723)) { + Global_Variable_Increment(2, 200); + } + } + } else { + Set_Enter(10, 50); + } + Scene_Loop_Start_Special(1, 3, 0); + } +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ma05.cpp b/engines/bladerunner/script/scene/ma05.cpp new file mode 100644 index 0000000000..39295f956a --- /dev/null +++ b/engines/bladerunner/script/scene/ma05.cpp @@ -0,0 +1,142 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptMA05::InitializeScene() { + if (Global_Variable_Query(1) != 2 && Global_Variable_Query(1) != 3) { + Setup_Scene_Information(-7204.0f, 953.97f, 1651.0f, 0); + } else { + Setup_Scene_Information(-7207.0f, 956.17f, 1564.0f, 0); + } + Scene_Exit_Add_2D_Exit(0, 432, 21, 471, 226, 1); + Ambient_Sounds_Add_Looping_Sound(101, 90, 0, 1); + Ambient_Sounds_Add_Looping_Sound(99, 40, -100, 1); + Ambient_Sounds_Add_Looping_Sound(103, 50, 60, 1); + Ambient_Sounds_Add_Speech_Sound(60, 0, 10, 260, 27, 47, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 20, 10, 260, 27, 47, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 40, 10, 260, 27, 47, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 50, 10, 260, 27, 47, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Sound(68, 10, 100, 25, 50, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(69, 10, 100, 25, 50, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(375, 10, 70, 50, 100, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(376, 10, 70, 50, 100, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(87, 10, 70, 25, 25, -100, 0, -101, -101, 0, 0); + if (sub_401990()) { + Ambient_Sounds_Add_Sound(403, 3, 3, 32, 32, 100, 100, -101, -101, 0, 0); + } + if (Global_Variable_Query(1) != 2 && Global_Variable_Query(1) != 3) { + Scene_Loop_Start_Special(0, 0, 0); + } + Scene_Loop_Set_Default(1); +} + +void SceneScriptMA05::SceneLoaded() { + Obstacle_Object("Z-BOX-RAIL03", true); + Footstep_Sounds_Set(0, 0); + Footstep_Sounds_Set(1, 3); +} + +bool SceneScriptMA05::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptMA05::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptMA05::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptMA05::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptMA05::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -7199.0f, 956.17f, 1579.0f, 0, 0, false, 0)) { + Loop_Actor_Walk_To_XYZ(0, -7199.0f, 956.17f, 1579.0f, 0, 0, false, 0); + Game_Flag_Set(63); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Async_Actor_Walk_To_XYZ(0, -7199.0f, 953.97f, 1685.0f, 0, false); + Set_Enter(50, 50); + } + return true; + } + return false; +} + +bool SceneScriptMA05::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptMA05::SceneFrameAdvanced(int frame) { + if (frame == 20) { + Sound_Play(102, 70, -100, 100, 50); + } + //return true; +} + +void SceneScriptMA05::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptMA05::PlayerWalkedIn() { + Music_Play(2, 52, 0, 2, -1, 0, 0); + if ((Random_Query(0, 4) == 1 || (Game_Flag_Query(146) == 1 && !Game_Flag_Query(61))) && Global_Variable_Query(1) == 1) { + Scene_Loop_Set_Default(1); + Scene_Loop_Start_Special(2, 3, 1); + Sound_Play(69, 100, 0, 0, 50); + } + if (Game_Flag_Query(146) && !Game_Flag_Query(61)) { + if (!Game_Flag_Query(378)) { + Actor_Voice_Over(1260, 99); + Actor_Voice_Over(1270, 99); + Actor_Voice_Over(1280, 99); + Actor_Voice_Over(1290, 99); + } + Game_Flag_Set(61); + Player_Gains_Control(); + } + //return false; +} + +void SceneScriptMA05::PlayerWalkedOut() { +} + +void SceneScriptMA05::DialogueQueueFlushed(int a1) { +} + +bool SceneScriptMA05::sub_401990() { + return Global_Variable_Query(1) == 5 + && !Actor_Clue_Query(0, 143) + && !Actor_Clue_Query(0, 144) + && !Actor_Clue_Query(0, 139) + && !Actor_Clue_Query(0, 140) + && !Actor_Clue_Query(0, 141) + && !Actor_Clue_Query(0, 142); +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ma06.cpp b/engines/bladerunner/script/scene/ma06.cpp new file mode 100644 index 0000000000..09c8637769 --- /dev/null +++ b/engines/bladerunner/script/scene/ma06.cpp @@ -0,0 +1,154 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptMA06::InitializeScene() { + Setup_Scene_Information(40.0f, 1.0f, -20.0f, 400); + Ambient_Sounds_Add_Looping_Sound(210, 50, 0, 1); + Ambient_Sounds_Add_Looping_Sound(408, 33, 0, 1); + Scene_Loop_Start_Special(0, 0, 0); + Scene_Loop_Set_Default(1); + Sound_Play(209, 100, 50, 50, 100); +} + +void SceneScriptMA06::SceneLoaded() { + Obstacle_Object("PANEL", true); + Clickable_Object("PANEL"); + Player_Loses_Control(); +} + +bool SceneScriptMA06::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptMA06::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptMA06::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptMA06::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptMA06::ClickedOnExit(int exitId) { + return false; +} + +bool SceneScriptMA06::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptMA06::SceneFrameAdvanced(int frame) { +} + +void SceneScriptMA06::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptMA06::PlayerWalkedIn() { + Loop_Actor_Walk_To_XYZ(0, 40.0f, 1.35f, 0.0f, 0, 0, false, 0); + Actor_Face_Object(0, "panel", true); + Delay(500); + sub_4014E4(); + if (sub_4012C0()) { + Sound_Play(114, 25, 0, 0, 50); + Delay(4000); + } + Game_Flag_Reset(37); + Game_Flag_Reset(33); + Game_Flag_Reset(57); + if (Game_Flag_Query(38)) { + Set_Enter(49, 48); + } else if (Game_Flag_Query(34)) { + Set_Enter(10, 49); + } else { + Set_Enter(53, 53); + } + Scene_Loop_Start_Special(1, 3, 1); + Sound_Play(208, 100, 50, 50, 50); + //return true; +} + +void SceneScriptMA06::PlayerWalkedOut() { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Player_Gains_Control(); +} + +void SceneScriptMA06::DialogueQueueFlushed(int a1) { +} + +bool SceneScriptMA06::sub_4012C0() { + return (Game_Flag_Query(37) && !Game_Flag_Query(38)) || (Game_Flag_Query(33) && !Game_Flag_Query(34)) || (Game_Flag_Query(57) && !Game_Flag_Query(58)); +} + +void SceneScriptMA06::sub_4014E4() { + Game_Flag_Reset(38); + Game_Flag_Reset(34); + Game_Flag_Reset(58); + while (true) { + if (Game_Flag_Query(34)) { + break; + } + if (Game_Flag_Query(38)) { + break; + } + if (Game_Flag_Query(58)) { + break; + } + Actor_Says(39, 80, 3); + Player_Gains_Control(); + int v1 = Elevator_Activate(1); + Player_Loses_Control(); + Scene_Loop_Start_Special(2, 1, 1); + if (v1 > 1) { + Game_Flag_Set(58); + } else if (v1 == 1) { + if (Game_Flag_Query(250)) { + Game_Flag_Set(38); + } else { + Sound_Play(412, 100, 0, 0, 50); + Delay(500); + Actor_Says(39, 610, 3); + } + } else { + Actor_Says(0, 2940, 18); + if (Global_Variable_Query(1) == 4 && Game_Flag_Query(655)) { + Sound_Play(412, 100, 0, 0, 50); + Delay(500); + Actor_Says(39, 610, 3); + Delay(500); + Actor_Says(0, 8527, 3); + } else { + Game_Flag_Set(34); + Actor_Says(39, 90, 3); + } + } + } +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ma07.cpp b/engines/bladerunner/script/scene/ma07.cpp new file mode 100644 index 0000000000..2fc19c0660 --- /dev/null +++ b/engines/bladerunner/script/scene/ma07.cpp @@ -0,0 +1,159 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptMA07::InitializeScene() { + if (Game_Flag_Query(356)) { + Setup_Scene_Information(6.75f, -172.43f, 356.0f, 997); + Game_Flag_Reset(356); + Game_Flag_Set(665); + } else if (Game_Flag_Query(673)) { + Setup_Scene_Information(-312.0f, -162.8f, 180.0f, 0); + } else { + Setup_Scene_Information(104.0f, -162.16f, 56.0f, 519); + } + Ambient_Sounds_Add_Looping_Sound(381, 100, 1, 1); + Ambient_Sounds_Add_Sound(374, 100, 300, 16, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(68, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(69, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(375, 60, 180, 50, 100, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(376, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(377, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0); + if (Global_Variable_Query(1) > 1) { + Scene_Exit_Add_2D_Exit(1, 0, 200, 50, 479, 3); + } + if (Game_Flag_Query(665)) { + Scene_Exit_Add_2D_Exit(2, 176, 386, 230, 426, 2); + } + Scene_Exit_Add_2D_Exit(0, 270, 216, 382, 306, 0); +} + +void SceneScriptMA07::SceneLoaded() { + Obstacle_Object("BARRICADE", true); +} + +bool SceneScriptMA07::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptMA07::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptMA07::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptMA07::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptMA07::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, 104.0f, -162.0f, 56.0f, 12, 1, false, 0)) { + if (Global_Variable_Query(1) == 4 && Game_Flag_Query(671)) { + Actor_Set_Goal_Number(0, 400); + } else { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(57); + Set_Enter(52, 52); + } + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -400.0f, -162.8f, 185.08f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(672); + Game_Flag_Reset(179); + Game_Flag_Set(178); + Set_Enter(68, 77); + } + return true; + } + if (exitId == 2) { + if (!Loop_Actor_Walk_To_XYZ(0, 8.0f, -172.43f, 356.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(357); + Set_Enter(90, 103); + } + return true; + } + return false; +} + +bool SceneScriptMA07::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptMA07::SceneFrameAdvanced(int frame) { +} + +void SceneScriptMA07::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { + if (actorId == 53 && newGoal == 302) { + Scene_Exits_Enable(); + } +} + +void SceneScriptMA07::PlayerWalkedIn() { + if (Game_Flag_Query(673)) { + Loop_Actor_Walk_To_XYZ(0, -268.0f, -162.8f, 188.0f, 0, 0, false, 0); + Game_Flag_Reset(673); + } + if (Actor_Query_Goal_Number(57) == 300) { + Actor_Set_Goal_Number(57, 305); + } + if (Game_Flag_Query(58)) { + Game_Flag_Reset(58); + } + if (!Game_Flag_Query(648) && Game_Flag_Query(671) && Global_Variable_Query(1) == 4) { + Scene_Exits_Disable(); + Actor_Set_Goal_Number(53, 300); + } + if (Game_Flag_Query(666)) { + Actor_Voice_Over(1360, 99); + Actor_Voice_Over(1370, 99); + Actor_Voice_Over(1380, 99); + Actor_Voice_Over(1390, 99); + Actor_Voice_Over(1400, 99); + Delay(1000); + Game_Flag_Reset(666); + Game_Flag_Set(34); + Set_Enter(10, 49); + } + //return false; + +} + +void SceneScriptMA07::PlayerWalkedOut() { +} + +void SceneScriptMA07::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ma08.cpp b/engines/bladerunner/script/scene/ma08.cpp new file mode 100644 index 0000000000..bd7d15f235 --- /dev/null +++ b/engines/bladerunner/script/scene/ma08.cpp @@ -0,0 +1,81 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptMA08::InitializeScene() { + Setup_Scene_Information(0, 0, 0, 0); + Ambient_Sounds_Add_Looping_Sound(381, 100, 1, 1); + Ambient_Sounds_Add_Sound(68, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(69, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(375, 60, 180, 50, 100, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(376, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(377, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0); +} + +void SceneScriptMA08::SceneLoaded() { + Obstacle_Object("(undefined)", true); + Clickable_Object("(undefined)"); +} + +bool SceneScriptMA08::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptMA08::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptMA08::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptMA08::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptMA08::ClickedOnExit(int exitId) { + return false; +} + +bool SceneScriptMA08::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptMA08::SceneFrameAdvanced(int frame) { +} + +void SceneScriptMA08::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptMA08::PlayerWalkedIn() { +} + +void SceneScriptMA08::PlayerWalkedOut() { +} + +void SceneScriptMA08::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/nr01.cpp b/engines/bladerunner/script/scene/nr01.cpp new file mode 100644 index 0000000000..f4ebbd01a4 --- /dev/null +++ b/engines/bladerunner/script/scene/nr01.cpp @@ -0,0 +1,436 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptNR01::InitializeScene() { + if (Game_Flag_Query(617)) { + Setup_Scene_Information(-153.86f, 23.88f, -570.21f, 402); + } else if (Game_Flag_Query(632)) { + Setup_Scene_Information(-416.0f, 31.93f, -841.0f, 200); + Actor_Set_Invisible(0, true); + Preload(167); + } else if (Game_Flag_Query(534)) { + Setup_Scene_Information(-416.0f, 31.93f, -841.0f, 200); + } else if (Game_Flag_Query(342)) { + Setup_Scene_Information(-270.0f, 4.93f, -1096.0f, 500); + } else if (Game_Flag_Query(533)) { + Setup_Scene_Information(312.0f, 31.66f, -901.0f, 700); + } else if (Game_Flag_Query(545)) { + Setup_Scene_Information(-170.0f, 24.0f, -574.0f, 768); + } else { + Setup_Scene_Information(76.0f, 23.88f, -109.0f, 966); + } + Scene_Exit_Add_2D_Exit(0, 31, 270, 97, 373, 3); + if (Global_Variable_Query(1) > 3) { + Scene_Exit_Add_2D_Exit(1, 201, 320, 276, 357, 2); + } + Scene_Exit_Add_2D_Exit(2, 583, 262, 639, 365, 1); + if (Game_Flag_Query(255)) { + Scene_Exit_Add_2D_Exit(3, 320, 445, 639, 479, 2); + } + Ambient_Sounds_Add_Looping_Sound(54, 50, 0, 1); + Ambient_Sounds_Add_Looping_Sound(362, 22, 55, 1); + Ambient_Sounds_Add_Sound(361, 10, 10, 20, 20, -70, -70, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(184, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(185, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(186, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(188, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(189, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(192, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(68, 10, 80, 16, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(69, 10, 80, 16, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(375, 10, 80, 33, 33, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(376, 10, 80, 33, 33, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(377, 10, 80, 33, 33, 0, 0, -101, -101, 0, 0); + if (Game_Flag_Query(643) && Actor_Query_Goal_Number(1) == 230) { + Game_Flag_Reset(255); + Game_Flag_Reset(256); + } + if (Game_Flag_Query(255) && !Game_Flag_Query(247)) { + Scene_Loop_Start_Special(0, 0, 0); + Scene_Loop_Set_Default(1); + Game_Flag_Set(247); + } else if (Game_Flag_Query(255) && Game_Flag_Query(247)) { + Scene_Loop_Set_Default(1); + } else { + Scene_Loop_Set_Default(4); + } +} + +void SceneScriptNR01::SceneLoaded() { + Obstacle_Object("LAMPBASE01", true); + Unclickable_Object("LAMPBASE01"); +} + +bool SceneScriptNR01::MouseClick(int x, int y) { + if (Actor_Query_Goal_Number(0) == 212) { + Global_Variable_Increment(47, 4); + return true; + } + return false; +} + +bool SceneScriptNR01::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptNR01::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptNR01::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptNR01::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -380.0f, 31.93f, -841.0f, 0, 1, false, 0)) { + if (Global_Variable_Query(1) > 3) { + Actor_Says(0, 8522, 12); + } else { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(535); + Set_Enter(55, 56); + } + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -281.0f, 31.93f, -1061.0f, 0, 1, false, 0)) { + Actor_Face_Heading(0, 45, false); + Loop_Actor_Travel_Stairs(0, 3, 0, 0); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(343); + Set_Enter(79, 91); + } + return true; + } + if (exitId == 2) { + if (!Loop_Actor_Walk_To_XYZ(0, 312.0f, 31.66f, -901.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(532); + Set_Enter(11, 55); + } + return true; + } + if (exitId == 3) { + if (!Loop_Actor_Walk_To_XYZ(0, 108.0f, 23.88f, -93.0f, 0, 1, false, 0)) { + Game_Flag_Reset(176); + Game_Flag_Reset(182); + Game_Flag_Reset(179); + Game_Flag_Reset(178); + Game_Flag_Reset(258); + Game_Flag_Reset(257); + Game_Flag_Reset(261); + Game_Flag_Reset(181); + switch (Spinner_Interface_Choose_Dest(-1, 1)) { + case 9: + Game_Flag_Set(257); + Game_Flag_Reset(255); + Game_Flag_Set(256); + Set_Enter(37, 34); + Scene_Loop_Start_Special(1, 3, 1); + break; + case 7: + Game_Flag_Set(258); + Game_Flag_Reset(255); + Game_Flag_Reset(247); + Game_Flag_Set(254); + Set_Enter(20, 2); + Scene_Loop_Start_Special(1, 3, 1); + break; + case 6: + Game_Flag_Set(177); + Game_Flag_Reset(255); + Game_Flag_Reset(247); + Game_Flag_Set(253); + Set_Enter(7, 25); + Scene_Loop_Start_Special(1, 3, 1); + break; + case 5: + Game_Flag_Set(261); + Game_Flag_Reset(255); + Game_Flag_Reset(247); + Game_Flag_Set(307); + Set_Enter(17, 82); + Scene_Loop_Start_Special(1, 3, 1); + break; + case 4: + Game_Flag_Set(180); + Game_Flag_Reset(255); + Game_Flag_Reset(247); + Game_Flag_Set(252); + Set_Enter(0, 0); + Scene_Loop_Start_Special(1, 3, 1); + break; + case 3: + Game_Flag_Set(176); + Game_Flag_Reset(255); + Game_Flag_Reset(247); + Game_Flag_Set(248); + Set_Enter(4, 13); + Scene_Loop_Start_Special(1, 3, 1); + break; + case 2: + Game_Flag_Set(182); + Game_Flag_Reset(255); + Game_Flag_Reset(247); + Game_Flag_Set(249); + Set_Enter(69, 78); + Scene_Loop_Start_Special(1, 3, 1); + break; + case 1: + Game_Flag_Set(179); + Game_Flag_Reset(255); + Game_Flag_Reset(247); + Game_Flag_Set(250); + Set_Enter(49, 48); + Scene_Loop_Start_Special(1, 3, 1); + break; + case 0: + Game_Flag_Set(178); + Game_Flag_Reset(255); + Game_Flag_Reset(247); + Game_Flag_Set(251); + Set_Enter(61, 65); + Scene_Loop_Start_Special(1, 3, 1); + break; + default: + Player_Loses_Control(); + Game_Flag_Set(181); + Game_Flag_Set(247); + Player_Gains_Control(); + break; + } + } + return true; + } + return false; +} + +bool SceneScriptNR01::ClickedOn2DRegion(int region) { + if (region == 0 && Player_Query_Combat_Mode()) { + Sound_Play(517, 100, 0, 0, 50); + Actor_Set_Goal_Number(1, 260); + Scene_2D_Region_Remove(0); + } + if (region == 1 && Player_Query_Combat_Mode()) { + Sound_Play(517, 100, 0, 0, 50); + Actor_Set_Goal_Number(2, 299); + Actor_Set_Goal_Number(1, 258); + Scene_2D_Region_Remove(1); + return true; + } + return false; + +} + +void SceneScriptNR01::SceneFrameAdvanced(int frame) { + if (frame == 61) { + Sound_Play(118, 40, 0, 0, 50); + } + if (frame == 184) { + Sound_Play(117, 40, 80, 80, 50); + } + //return 0; +} + +void SceneScriptNR01::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptNR01::PlayerWalkedIn() { + if (Game_Flag_Query(617)) { + Actor_Set_Goal_Number(1, 280); + Game_Flag_Reset(617); + //return true; + return; + } + if (Actor_Query_Goal_Number(1) == 250) { + Scene_Exits_Disable(); + ADQ_Flush(); + Actor_Set_Goal_Number(1, 251); + Scene_2D_Region_Add(0, 450, 316, 464, 333); + Scene_2D_Region_Add(1, 233, 321, 240, 362); + ADQ_Add(2, 70, 81); + ADQ_Add(1, 990, 3); + ADQ_Add(2, 80, 82); + ADQ_Add(2, 90, 81); + ADQ_Add(1, 1010, 3); + ADQ_Add(2, 100, 81); + ADQ_Add(1, 1020, 3); + ADQ_Add(2, 110, 82); + ADQ_Add(1, 1030, 3); + ADQ_Add(1, 1040, 3); + ADQ_Add(2, 120, 82); + } + if (Game_Flag_Query(604)) { + if (Game_Flag_Query(622)) { + ADQ_Add(25, 150, 3); + Game_Flag_Reset(622); + } + Game_Flag_Reset(604); + Player_Gains_Control(); + //return true; + return; + } + if (Game_Flag_Query(632)) { + Delay(3500); + Set_Enter(60, 64); + //return true; + return; + } + if (Game_Flag_Query(534)) { + Loop_Actor_Walk_To_XYZ(0, -380.0f, 31.73f, -841.0f, 0, 0, false, 0); + Game_Flag_Reset(534); + } else { + if (Game_Flag_Query(342)) { + Loop_Actor_Travel_Stairs(0, 3, 1, 0); + Game_Flag_Reset(342); + if (Actor_Query_Goal_Number(1) == 230) { + Actor_Face_Actor(1, 0, true); + Actor_Says(1, 1440, 13); + Loop_Actor_Walk_To_Actor(0, 1, 48, 0, true); + Actor_Says(0, 3145, 13); + if (Global_Variable_Query(40) != 3) { + Actor_Says(1, 1450, 12); + Actor_Says(1, 1460, 13); + } + Actor_Says(0, 3150, 14); + Actor_Says(1, 1470, 12); + Actor_Says(1, 1480, 13); + Actor_Says(0, 3155, 15); + Actor_Says(1, 1500, 16); + Actor_Says(0, 3160, 12); + if (Game_Flag_Query(643)) { + Actor_Says(1, 1330, 12); + Actor_Says(1, 1340, 12); + Actor_Says(1, 1350, 12); + Actor_Says(0, 3120, 15); + Actor_Says(1, 1360, 12); + Actor_Says(1, 1370, 12); + Actor_Says(0, 3125, 15); + Actor_Says(1, 1380, 12); + Actor_Says(0, 3130, 15); + Actor_Says(1, 1390, 12); + Actor_Says(1, 1400, 12); + Actor_Says(1, 1410, 12); + Actor_Says(0, 3135, 15); + Actor_Says(1, 1420, 12); + Actor_Says(0, 3140, 15); + Actor_Says(1, 1430, 12); + Actor_Set_Goal_Number(1, 285); + } else { + int v0 = Global_Variable_Query(40) - 1; + if (!v0) { + Actor_Says(1, 1510, 15); + Actor_Says(1, 1520, 14); + Actor_Says(1, 1530, 13); + Actor_Says(0, 3170, 13); + Actor_Set_Goal_Number(1, 231); + } else if (v0 == 1) { + Actor_Says(1, 1590, 15); + Actor_Says(0, 3195, 14); + Actor_Says(1, 1600, 16); + Actor_Says(0, 3200, 13); + Actor_Says(1, 1610, 17); + Actor_Says(1, 1620, 15); + Actor_Says(1, 1630, 14); + Actor_Says(0, 3205, 12); + Actor_Set_Goal_Number(1, 232); + } else if (v0 == 2) { + Actor_Says(1, 1540, 15); + Actor_Says(0, 3175, 13); + Actor_Says(1, 1550, 13); + Actor_Says(1, 1560, 16); + Actor_Says(0, 3180, 15); + Actor_Says(1, 1570, 12); + Actor_Says(1, 1580, 14); + Actor_Says(0, 3190, 12); + Actor_Set_Goal_Number(1, 233); + } + } + } + } else if (Game_Flag_Query(533)) { + Loop_Actor_Walk_To_XYZ(0, 239.0f, 31.66f, -901.0f, 0, 0, false, 0); + Game_Flag_Reset(533); + if (Actor_Query_Goal_Number(2) == 230) { + Scene_Exits_Disable(); + Actor_Set_Goal_Number(2, 231); + Non_Player_Actor_Combat_Mode_On(2, 0, 1, 0, 3, 4, 7, 8, -1, -1, -1, 20, 300, 0); + } + } else if (Game_Flag_Query(545)) { + Game_Flag_Reset(545); + Actor_Put_In_Set(25, 54); + Actor_Set_At_XYZ(25, -202.0f, 24.0f, -574.0f, 0); + Actor_Face_Heading(25, 256, false); + Actor_Set_Goal_Number(25, 204); + Player_Gains_Control(); + } else { + Loop_Actor_Walk_To_XYZ(0, 48.0f, 23.88f, -189.0f, 0, 0, false, 0); + } + } + if (Game_Flag_Query(652)) { + Game_Flag_Reset(652); + Actor_Voice_Over(950, 99); + Actor_Voice_Over(960, 99); + Actor_Voice_Over(970, 99); + Actor_Voice_Over(980, 99); + } + if (Actor_Query_Goal_Number(2) == 240) { + Scene_Exits_Disable(); + Actor_Set_Goal_Number(2, 241); + if (!Player_Query_Combat_Mode()) { + Player_Set_Combat_Mode(true); + } + } + //return false; + return; +} + +void SceneScriptNR01::PlayerWalkedOut() { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + if (!Game_Flag_Query(343) && !Game_Flag_Query(532) && !Game_Flag_Query(535) && !Game_Flag_Query(632) && !Game_Flag_Query(722)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Outtake_Play(30, 1, -1); + Outtake_Play(35, 1, -1); + } + Game_Flag_Reset(722); +} + +void SceneScriptNR01::DialogueQueueFlushed(int a1) { + if (Actor_Query_Goal_Number(1) == 251 && Actor_Query_Goal_Number(2) != 299 && Actor_Query_Goal_Number(2) != 254 && Actor_Query_Goal_Number(2) != 255) { + Actor_Set_Goal_Number(1, 252); + } +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/nr02.cpp b/engines/bladerunner/script/scene/nr02.cpp new file mode 100644 index 0000000000..1af8387a4b --- /dev/null +++ b/engines/bladerunner/script/scene/nr02.cpp @@ -0,0 +1,215 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptNR02::InitializeScene() { + sub_402134(); + Setup_Scene_Information(-283.0f, -24.0f, 326.0f, 200); + Game_Flag_Reset(532); + Scene_Exit_Add_2D_Exit(0, 0, 105, 75, 291, 3); + Ambient_Sounds_Add_Looping_Sound(280, 50, 38, 0); + Ambient_Sounds_Add_Sound(252, 3, 60, 25, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(254, 3, 60, 25, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(255, 3, 60, 25, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(256, 3, 60, 25, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(257, 3, 60, 25, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(258, 3, 60, 25, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(259, 3, 60, 25, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(260, 3, 60, 25, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(261, 3, 60, 25, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(262, 3, 60, 25, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(184, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(185, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(186, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(188, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(189, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(192, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); +} + +void SceneScriptNR02::SceneLoaded() { + Obstacle_Object("VID PHONE 01", true); + Unobstacle_Object("VICTORIAN CHAIR", true); + Unobstacle_Object("WALL CANDLES", true); + Unobstacle_Object("STAIRS", true); + Unobstacle_Object("BOX30", true); + Unobstacle_Object("VID CAM COVER", true); + Unobstacle_Object("VID CAM COVER01", true); + Unobstacle_Object("VID OUTER GLASS", true); + Unobstacle_Object("VID OUTER GLASS01", true); + Unobstacle_Object("VID MAIN MONITOR", true); + Unobstacle_Object("VID MAIN MONITOR01", true); + Clickable_Object("VID PHONE 01"); + Clickable_Object("VID PHONE 02"); +} + +bool SceneScriptNR02::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptNR02::ClickedOn3DObject(const char *objectName, bool a2) { + if (Object_Query_Click("VID PHONE 01", objectName) || Object_Query_Click("VID PHONE 02", objectName)) { + if (!Loop_Actor_Walk_To_XYZ(0, -191.9f, -24.0f, 62.15f, 0, 1, false, 0)) { + Actor_Face_Heading(0, 13, false); + if (Actor_Clue_Query(0, 125) && Actor_Clue_Query(0, 126) && !Game_Flag_Query(670)) { + Actor_Set_Goal_Number(0, 350); + Game_Flag_Set(670); + } else { + Sound_Play(123, 50, 0, 0, 50); + Delay(1000); + Sound_Play(403, 30, 0, 0, 50); + Delay(1500); + Sound_Play(403, 30, 0, 0, 50); + Delay(1500); + Sound_Play(403, 30, 0, 0, 50); + Delay(1500); + Sound_Play(123, 50, 0, 0, 50); + Delay(1000); + Actor_Says(0, 170, 14); + } + } + } + return false; +} + +bool SceneScriptNR02::ClickedOnActor(int actorId) { + if (actorId == 2 && Actor_Query_Goal_Number(2) == 201 && !Loop_Actor_Walk_To_XYZ(0, 67.37f, -24.0f, 389.32f, 0, 1, false, 0)) { + Actor_Set_Goal_Number(2, 215); + } + return false; +} + +bool SceneScriptNR02::ClickedOnItem(int itemId, bool a2) { + if ((itemId == 89 || itemId == 90) && !Loop_Actor_Walk_To_XYZ(0, 109.38f, -24.0f, 420.5f, 0, 1, false, 0)) { + Actor_Face_Heading(0, 423, false); + if (itemId == 89) { + Item_Remove_From_World(89); + Item_Pickup_Spin_Effect(953, 214, 380); + Actor_Clue_Acquire(0, 105, 1, -1); + } + if (itemId == 90) { + Item_Remove_From_World(90); + Item_Pickup_Spin_Effect(954, 214, 380); + Actor_Clue_Acquire(0, 106, 1, -1); + } + } + return false; +} + +bool SceneScriptNR02::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -283.0f, -24.0f, 326.0f, 0, 1, false, 0)) { + if (Actor_Query_Goal_Number(2) < 230 || Actor_Query_Goal_Number(2) > 250) { + Music_Stop(2); + } + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(533); + Set_Enter(54, 54); + } + return true; + } + return false; +} + +bool SceneScriptNR02::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptNR02::SceneFrameAdvanced(int frame) { + if (!Music_Is_Playing() && (Actor_Query_Goal_Number(2) < 210 || Actor_Query_Goal_Number(2) > 222)) { + sub_402134(); + } + //return false; +} + +void SceneScriptNR02::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptNR02::PlayerWalkedIn() { + if (Actor_Query_Goal_Number(2) == 211) { + Actor_Set_Goal_Number(2, 220); + } + if (Actor_Query_Goal_Number(2) == 204) { + Actor_Set_Goal_Number(2, 205); + } + if (Actor_Query_Goal_Number(2) == 206) { + Actor_Set_Goal_Number(2, 205); + } + Loop_Actor_Walk_To_XYZ(0, -203.0f, -24.0f, 334.0f, 0, 0, false, 0); + //return false; +} + +void SceneScriptNR02::PlayerWalkedOut() { + Music_Stop(2); + if (Actor_Query_Goal_Number(2) < 210 && Actor_Query_Goal_Number(2) >= 205) { + Actor_Set_Goal_Number(2, 204); + } +} + +void SceneScriptNR02::DialogueQueueFlushed(int a1) { + if (Player_Query_Current_Scene() == 55 && Actor_Query_Goal_Number(2) == 206) { + Sound_Play(575, 50, 0, 0, 50); + Sound_Play(321, 50, 0, 0, 50); + } + if (Player_Query_Current_Scene() == 55 && Actor_Query_Goal_Number(2) == 207) { + Sound_Play(576, 50, 0, 0, 50); + Sound_Play(323, 50, 0, 0, 50); + } + if (Player_Query_Current_Scene() == 55 && Actor_Query_Goal_Number(2) == 208) { + Sound_Play(579, 50, 0, 0, 50); + Sound_Play(324, 50, 0, 0, 50); + } + if (Player_Query_Current_Scene() == 55 && Actor_Query_Goal_Number(2) > 205 && Actor_Query_Goal_Number(2) < 210) { + Actor_Set_Goal_Number(2, 205); + //return true; + return; + } else if (Actor_Query_Goal_Number(2) > 205 && Actor_Query_Goal_Number(2) < 210) { + Actor_Set_Goal_Number(2, 204); + //return true; + return; + } + //return false; +} + +void SceneScriptNR02::sub_402134() { + int v0 = Global_Variable_Query(50); + if (v0 == 0) { + Music_Play(8, 41, 0, 2, -1, 0, 0); + } else if (v0 == 1) { + Music_Play(9, 41, 0, 2, -1, 0, 0); + } else if (v0 == 2) { + Music_Play(10, 41, 0, 2, -1, 0, 0); + } + v0++; + if (v0 > 2) { + v0 = 0; + } + Global_Variable_Set(50, v0); +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/nr03.cpp b/engines/bladerunner/script/scene/nr03.cpp new file mode 100644 index 0000000000..6052f6bb55 --- /dev/null +++ b/engines/bladerunner/script/scene/nr03.cpp @@ -0,0 +1,351 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptNR03::InitializeScene() { + if (Game_Flag_Query(537)) { + Setup_Scene_Information(-301.98f, -70.19f, -348.58f, 0); + } else if (Game_Flag_Query(437)) { + Setup_Scene_Information(-161.0f, -70.19f, -1139.0f, 500); + Game_Flag_Reset(437); + } else { + Setup_Scene_Information(410.0f, -70.19f, -715.0f, 690); + } + Scene_Exit_Add_2D_Exit(0, 561, 0, 639, 216, 1); + Scene_Exit_Add_2D_Exit(1, 210, 85, 240, 145, 0); + Scene_Exit_Add_2D_Exit(2, 0, 135, 85, 295, 3); + Scene_2D_Region_Add(0, 331, 73, 375, 114); + Ambient_Sounds_Add_Looping_Sound(280, 50, 38, 0); + Ambient_Sounds_Add_Sound(252, 3, 60, 25, 25, 0, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(254, 3, 60, 25, 25, 0, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(255, 3, 60, 25, 25, 0, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(256, 3, 60, 25, 25, 0, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(257, 3, 60, 25, 25, 0, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(258, 3, 60, 25, 25, 0, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(259, 3, 60, 20, 20, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(260, 3, 60, 20, 20, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(261, 3, 60, 20, 20, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(262, 3, 60, 20, 20, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(184, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(185, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(186, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(188, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(189, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(192, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + if (Game_Flag_Query(573)) { + if (Game_Flag_Query(537)) { + Scene_Loop_Start_Special(0, 2, 0); + Scene_Loop_Set_Default(0); + Game_Flag_Reset(537); + } else { + Scene_Loop_Set_Default(0); + } + } else { + Actor_Set_Goal_Number(4, 201); + Scene_Loop_Start_Special(0, 2, 0); + Scene_Loop_Set_Default(0); + } + if (Actor_Query_Goal_Number(25) > 209 && Actor_Query_Goal_Number(25) < 215) { + Actor_Set_Goal_Number(25, 215); + } +} + +void SceneScriptNR03::SceneLoaded() { + Obstacle_Object("PG3", true); + Obstacle_Object("X2BACKBARBOTTOM01", true); + Obstacle_Object("X2BACKSTAGETOP", true); + Unclickable_Object("PG3"); + Unobstacle_Object("X2BACKBARBOTTOM02", true); + Unobstacle_Object("NM2", true); + Unobstacle_Object("MAN5", true); + Unobstacle_Object("MAN7", true); + Unobstacle_Object("X2BACKSTAGETOP", true); +} + +bool SceneScriptNR03::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptNR03::ClickedOn3DObject(const char *objectName, bool a2) { + if (Object_Query_Click("PG3", objectName)) { + Actor_Face_Object(0, "PG3", true); + Actor_Voice_Over(3770, 99); + return true; + } + return false; +} + +bool SceneScriptNR03::ClickedOnActor(int actorId) { + if (actorId == 25 && !Loop_Actor_Walk_To_Actor(0, 25, 48, 1, false)) { + AI_Movement_Track_Pause(25); + Actor_Face_Actor(0, 25, true); + if (Game_Flag_Query(611)) { + Actor_Says(0, 3350, 16); + Actor_Says(25, 50, 17); + } else { + Game_Flag_Set(611); + Actor_Says(0, 3340, 3); + Actor_Face_Actor(25, 0, true); + Actor_Says(25, 30, 13); + Actor_Says(0, 3345, 14); + Actor_Says(25, 40, 14); + } + AI_Movement_Track_Unpause(25); + return true; + } + return false; +} + +bool SceneScriptNR03::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptNR03::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, 410.0f, -70.19f, -715.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(534); + Set_Enter(54, 54); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -161.0f, -70.19f, -1139.0f, 0, 1, false, 0)) { + if (Actor_Query_Which_Set_In(25) == 55) { + AI_Movement_Track_Pause(25); + Actor_Face_Actor(25, 0, true); + Actor_Face_Actor(0, 25, true); + int v3 = Global_Variable_Query(44); + if (v3 == 0) { + Actor_Says(25, 50, 13); + AI_Movement_Track_Unpause(25); + } else if (v3 == 1) { + Actor_Says(25, 210, 15); + AI_Movement_Track_Unpause(25); + } else if (v3 == 2) { + Actor_Set_Goal_Number(25, 220); + } + } + Global_Variable_Increment(44, 1); + } else { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(438); + Set_Enter(12, 57); + } + + return true; + } + if (exitId == 2) { + if (!Loop_Actor_Walk_To_XYZ(0, -151.0f, -70.19f, -476.0f, 12, 1, false, 0)) { + if (Actor_Query_Goal_Number(25) == 213 || Actor_Query_Which_Set_In(25) != 55) { + Player_Loses_Control(); + Player_Set_Combat_Mode(false); + Loop_Actor_Walk_To_XYZ(0, -229.0f, -70.19f, -469.0f, 0, 0, false, 1); + Actor_Face_Heading(0, 656, false); + Actor_Change_Animation_Mode(0, 53); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(536); + Set_Enter(13, 58); + Scene_Loop_Start_Special(1, 2, 0); + return true; + } + Actor_Face_Heading(0, 680, false); + Actor_Change_Animation_Mode(0, 12); + Delay(150); + Actor_Change_Animation_Mode(0, 0); + AI_Movement_Track_Pause(25); + Actor_Face_Actor(25, 0, true); + + int v1 = Global_Variable_Query(43); + if (v1 == 0) { + Actor_Says(25, 0, 15); + Actor_Face_Actor(0, 25, true); + Actor_Says(0, 3335, 13); + Actor_Says(25, 10, 16); + AI_Movement_Track_Unpause(25); + } else if (v1 == 1) { + Actor_Face_Actor(0, 25, true); + Actor_Says(25, 210, 12); + AI_Movement_Track_Unpause(25); + } else if (v1 == 2) { + Actor_Set_Goal_Number(25, 220); + } + Global_Variable_Increment(43, 1); + } + return true; + } + return false; +} + +bool SceneScriptNR03::ClickedOn2DRegion(int region) { + if (region == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, 79.2f, -70.19f, -984.0f, 12, 1, false, 0)) { + Actor_Face_Actor(0, 47, true); + int v1 = Random_Query(0, 4); + if (v1 == 0) { + Actor_Says(0, 1055, 3); + } else if (v1 == 1) { + Actor_Says(0, 8590, 3); + } else if (v1 == 2) { + Actor_Says(0, 8930, 3); + } else if (v1 == 3) { + Actor_Says(0, 7465, 3); + } + } + return true; + } + return false; +} + +void SceneScriptNR03::SceneFrameAdvanced(int frame) { + if (!Music_Is_Playing()) { + sub_402994(); + } + if (frame == 72) { + Sound_Play(345, 83, -70, -70, 50); + } + if (frame == 76) { + Sound_Play(353, 62, -70, -70, 50); + } + if (frame > 70 && frame < 110) { + sub_40259C(frame); + } else { + if (frame != 110) { + //return false; + return; + } + if (Actor_Query_Goal_Number(4) == 201) { + Actor_Set_Goal_Number(4, 200); + } else if (!Game_Flag_Query(536)) { + Actor_Set_Goal_Number(0, 200); + Player_Gains_Control(); + } + } + //return true; + return; +} + +void SceneScriptNR03::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptNR03::PlayerWalkedIn() { + Player_Set_Combat_Mode(false); + if (Game_Flag_Query(573)) { + if (Game_Flag_Query(535) ) { + Loop_Actor_Walk_To_XYZ(0, 302.0f, -70.19f, -715.0f, 0, 0, false, 0); + Game_Flag_Reset(535); + } + } else { + Game_Flag_Set(573); + Async_Actor_Walk_To_XYZ(0, 206.0f, -70.19f, -643.0f, 0, false); + Game_Flag_Reset(535); + Actor_Voice_Over(1490, 99); + Actor_Voice_Over(1510, 99); + Actor_Voice_Over(1520, 99); + } + if (Player_Query_Combat_Mode()) { + Actor_Set_Goal_Number(25, 220); + } + //return false; +} + +void SceneScriptNR03::PlayerWalkedOut() { + if (!Game_Flag_Query(438)) { + Music_Stop(2); + } + if (Game_Flag_Query(536)) { + Player_Gains_Control(); + } +} + +void SceneScriptNR03::DialogueQueueFlushed(int a1) { +} + +void SceneScriptNR03::sub_40259C(int frame) { + int facing; + float angle, invertedAngle; + + angle = cos((frame - 70) * (M_PI / 40.0f)) * M_PI_2; + invertedAngle = M_PI - angle; + if (!Game_Flag_Query(536) && Actor_Query_Goal_Number(4) != 201) { + angle = angle + M_PI; + invertedAngle = invertedAngle + M_PI; + } + float c = cos(invertedAngle); + float s = sin(invertedAngle); + float x = 36.49f * s - -60.21f * c + -265.49f; + float z = -60.21f * s + 36.49f * c + -408.79f; + + if (Actor_Query_Goal_Number(4) == 201) { + facing = angle * (512.0f / M_PI); + facing = facing + 144; + if (facing < 0) { + facing = facing + 1168; + } + if (facing > 1023) { + facing -= 1024; + } + Actor_Set_At_XYZ(4, x, -70.19f, z, facing); + } else { + facing = angle * (512.0f / M_PI); + facing = facing + 400; + if (facing < 0) { + facing = facing + 1424; + } + if (facing > 1023) { + facing -= 1024; + } + + Actor_Set_At_XYZ(0, x, -70.19f, z, facing); + } +} + +void SceneScriptNR03::sub_402994() { + if (Music_Is_Playing()) { + Music_Adjust(51, 0, 2); + } else { + int v0 = Global_Variable_Query(53); + if (v0 == 0) { + Music_Play(14, 51, 0, 2, -1, 0, 0); + } else if (v0 == 1) { + Music_Play(13, 51, 0, 2, -1, 0, 0); + } else if (v0 == 2) { + Music_Play(5, 51, 0, 2, -1, 0, 0); + } + v0++; + if (v0 > 2) { + v0 = 0; + } + Global_Variable_Set(53, v0); + } +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/nr04.cpp b/engines/bladerunner/script/scene/nr04.cpp new file mode 100644 index 0000000000..6fdf18efbe --- /dev/null +++ b/engines/bladerunner/script/scene/nr04.cpp @@ -0,0 +1,358 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptNR04::InitializeScene() { + Music_Adjust(30, 80, 2); + Setup_Scene_Information(53.0f, 0.0f, -110.0f, 569); + Scene_Exit_Add_2D_Exit(0, 498, 126, 560, 238, 0); + Scene_2D_Region_Add(0, 0, 259, 61, 479); + Scene_2D_Region_Add(1, 62, 327, 92, 479); + Scene_2D_Region_Add(2, 93, 343, 239, 479); + Ambient_Sounds_Add_Looping_Sound(408, 16, 0, 1); + Ambient_Sounds_Add_Looping_Sound(384, 16, 0, 1); + Ambient_Sounds_Add_Sound(259, 3, 60, 9, 9, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(260, 3, 60, 9, 9, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(261, 3, 60, 9, 9, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(262, 3, 60, 9, 9, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(182, 5, 70, 8, 8, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(184, 5, 70, 8, 8, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(185, 5, 70, 8, 8, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(186, 5, 70, 8, 8, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(188, 5, 70, 8, 8, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(189, 5, 70, 8, 8, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(191, 5, 70, 8, 8, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(192, 5, 70, 8, 8, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(195, 5, 70, 8, 8, -100, 100, -101, -101, 0, 0); + Scene_Loop_Set_Default(0); +} + +void SceneScriptNR04::SceneLoaded() { + Clickable_Object("B.TV01"); + Clickable_Object("B.TV02"); + Clickable_Object("B.TV03"); + Clickable_Object("B.TV05"); + Clickable_Object("DESK"); + if (!Game_Flag_Query(605)) { + Clickable_Object("TORUS01"); + } + Clickable_Object("BOX12"); +} + +bool SceneScriptNR04::MouseClick(int x, int y) { + if (Actor_Query_Animation_Mode(0) == 85 || Actor_Query_Animation_Mode(0) == 29) { + return true; + } + if (Actor_Query_Animation_Mode(0) == 53) { + Actor_Change_Animation_Mode(0, 29); + return true; + } + return false; +} + +bool SceneScriptNR04::ClickedOn3DObject(const char *objectName, bool a2) { + if (Object_Query_Click("B.TV01", objectName) || Object_Query_Click("B.TV02", objectName) || Object_Query_Click("B.TV03", objectName) || Object_Query_Click("B.TV05", objectName) || Object_Query_Click("DESK", objectName)) { + if (!Loop_Actor_Walk_To_Waypoint(0, 546, 0, 1, false)) { + if (!Object_Query_Click("DESK", objectName)) { + Actor_Face_Object(0, "B.TV01", true); + Actor_Voice_Over(1530, 99); + Actor_Voice_Over(1540, 99); + Actor_Voice_Over(1550, 99); + } else { + Actor_Face_Object(0, "DESK", true); + if (!Actor_Clue_Query(0, 56)) { + Actor_Voice_Over(1600, 99); + Actor_Voice_Over(1610, 99); + } else if (Actor_Clue_Query(0, 100)) { + Actor_Says(0, 8580, 3); + } else { + Actor_Clue_Acquire(0, 100, 0, -1); + Item_Pickup_Spin_Effect(961, 247, 141); + Actor_Voice_Over(1560, 99); + Actor_Voice_Over(1570, 99); + Actor_Voice_Over(1580, 99); + Actor_Voice_Over(1590, 99); + } + + } + } + } else if (Object_Query_Click("TORUS01", objectName) + && !Loop_Actor_Walk_To_XYZ(0, 18.56f, 0.0f, 38.86f, 0, 1, false, 0) + && !Game_Flag_Query(605)) { + Unclickable_Object("TORUS01"); + Scene_Exits_Disable(); + Player_Loses_Control(); + Game_Flag_Set(605); + Actor_Face_Object(0, "TORUS01", true); + Item_Pickup_Spin_Effect(975, 358, 160); + Actor_Voice_Over(1620, 99); + Actor_Voice_Over(1630, 99); + Actor_Clue_Acquire(0, 89, 0, -1); + Actor_Set_Goal_Number(18, 201); + } + return false; +} + +bool SceneScriptNR04::ClickedOnActor(int actorId) { + if (actorId == 18 && Game_Flag_Query(606)) { + Actor_Voice_Over(1640, 99); + Actor_Voice_Over(1650, 99); + Actor_Voice_Over(1660, 99); + Actor_Voice_Over(1670, 99); + Actor_Voice_Over(1680, 99); + return true; + } + return false; +} + +bool SceneScriptNR04::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptNR04::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, 45.0f, 0.0f, -106.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(437); + Set_Enter(55, 56); + } + return true; + } + return false; +} + +bool SceneScriptNR04::ClickedOn2DRegion(int region) { + if ((region == 0 || region == 1 || region == 2) && Actor_Query_Which_Set_In(18) != 12 && Actor_Query_Animation_Mode(0) != 53 && !Loop_Actor_Walk_To_Waypoint(0, 445, 0, 1, false)) { + Actor_Face_Heading(0, 49, false); + Actor_Change_Animation_Mode(0, 85); + Delay(2500); + if (Game_Flag_Query(606) == 1) { + return true; + } + if (Game_Flag_Query(374)) { + Player_Loses_Control(); + Actor_Voice_Over(4180, 99); + Actor_Change_Animation_Mode(0, 48); + Ambient_Sounds_Play_Sound(555, 90, 99, 0, 0); + Delay(350); + Actor_Set_At_XYZ(0, 109.0f, 0.0f, 374.0f, 0); + Actor_Retired_Here(0, 12, 12, 1, -1); + } + return true; + } + return false; +} + +void SceneScriptNR04::SceneFrameAdvanced(int frame) { + if (frame == 1 && !Music_Is_Playing()) { + sub_402960(); + } + if (frame > 60 && frame < 120) { + sub_402860(frame); + } else if (frame == 120) { + Set_Fade_Color(1.0f, 1.0f, 1.0f); + Set_Fade_Density(0.0f); + } + //return false; +} + +void SceneScriptNR04::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { + if (actorId == 18) { + switch (newGoal) { + case 214: + Actor_Change_Animation_Mode(18, 29); + Delay(2500); + Actor_Says(18, 290, 3); + sub_401DB0(); + //return true; + break; + case 213: + Actor_Clue_Acquire(0, 88, 0, 18); + Item_Pickup_Spin_Effect(984, 200, 160); + Actor_Says(18, 200, 30); + Actor_Says(18, 210, 30); + Actor_Says(18, 220, 30); + Actor_Says_With_Pause(0, 3425, 1.5f, 23); + Actor_Says(0, 3430, 3); + Actor_Says(18, 240, 30); + Actor_Says(0, 3435, 3); + Actor_Says(18, 250, 30); + Actor_Says(0, 3440, 3); + Actor_Says(18, 280, 30); + Actor_Says(0, 3445, 3); + Actor_Set_Goal_Number(18, 214); + //return true; + break; + case 209: + Actor_Face_Actor(0, 18, true); + Delay(3000); + Actor_Says(18, 170, 30); + Actor_Says(0, 3415, 3); + Actor_Says(18, 180, 30); + Actor_Says_With_Pause(0, 3420, 1.5f, 3); + Actor_Says(18, 190, 30); + Actor_Set_Goal_Number(18, 211); + //return true; + break; + case 207: + Loop_Actor_Walk_To_Waypoint(18, 445, 0, 1, false); + Actor_Face_Heading(18, 49, false); + Actor_Change_Animation_Mode(18, 85); + Actor_Face_Actor(0, 18, true); + Actor_Set_Goal_Number(18, 208); + Actor_Clue_Acquire(0, 92, 0, 18); + //return true; + break; + case 204: + Actor_Face_Actor(0, 18, true); + Actor_Says(18, 90, 73); + Actor_Says(0, 3390, 3); + Actor_Face_Actor(18, 0, true); + Actor_Says(18, 110, 74); + Actor_Says(0, 3385, 3); + Actor_Says(18, 120, 74); + Actor_Face_Actor(18, 0, true); + Actor_Set_Goal_Number(18, 205); + //return true; + break; + case 202: + Actor_Face_Actor(18, 0, true); + Actor_Face_Actor(0, 18, true); + Actor_Says(18, 30, 3); + Actor_Says(0, 3375, 3); + Actor_Says_With_Pause(18, 50, 1.5f, 3); + Actor_Says(18, 60, 3); + Actor_Says_With_Pause(0, 3380, 1.0f, 3); + Actor_Says(18, 70, 3); + Actor_Says(0, 3415, 3); + Actor_Says(18, 80, 3); + Player_Gains_Control(); + Actor_Set_Goal_Number(18, 203); + //return true; + break; + } + } + //return false; +} + +void SceneScriptNR04::PlayerWalkedIn() { + Loop_Actor_Walk_To_XYZ(0, 53.0f, 0.0f, -26.0f, 0, 0, false, 0); + if (Game_Flag_Query(374)) { + Overlay_Play("nr04over", 0, 1, 0, 0); + Delay(4000); + Overlay_Remove("nr04over"); + } + //return false; +} + +void SceneScriptNR04::PlayerWalkedOut() { +} + +void SceneScriptNR04::DialogueQueueFlushed(int a1) { +} + +void SceneScriptNR04::sub_401DB0() { + Dialogue_Menu_Clear_List(); + DM_Add_To_List(1530, 10, 5, 3); + DM_Add_To_List(1540, 3, 5, 10); + Dialogue_Menu_Appear(320, 240); + int answer = Dialogue_Menu_Query_Input(); + Dialogue_Menu_Disappear(); + if (answer == 1530) { + Loop_Actor_Walk_To_Actor(18, 0, 36, 0, false); + Actor_Change_Animation_Mode(0, 23); + Actor_Change_Animation_Mode(18, 23); + Delay(1500); + Actor_Says(18, 300, 3); + Actor_Change_Animation_Mode(0, 0); + Actor_Change_Animation_Mode(18, 0); + Actor_Says(18, 310, 3); + ADQ_Add(0, 3450, 3); + Actor_Set_Targetable(18, false); + Actor_Set_Goal_Number(18, 217); + Actor_Clue_Lose(0, 89); + Scene_Exits_Enable(); + } else if (answer == 1540) { + Actor_Says(0, 8512, 15); + Actor_Says(18, 320, 12); + Actor_Says(0, 3455, 13); + Actor_Says(18, 330, 15); + Actor_Says(0, 3460, 12); + Actor_Says(18, 340, 12); + Actor_Says(0, 3465, 12); + Actor_Says(18, 350, 16); + Actor_Set_Targetable(18, false); + Actor_Set_Goal_Number(18, 217); + Scene_Exits_Enable(); + } +} + +void SceneScriptNR04::sub_402860(int frame) { + float colorMap[] = { + 1.0f, 1.0f, 1.0f, + 1.0f, 0.0f, 0.0f, + 0.8f, 0.4f, 0.0f, + 0.7f, 0.7f, 0.0f, + 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 1.0f, + 0.5f, 0.0f, 0.8f}; + + float v3 = (frame - 60) / 10; + float v4 = (frame % 10) * 0.1f; + float coef = 1.0f; + if (frame > 100) { + coef = 1.0f - (frame - 100) / 20.0f; + } + int index = 3 * v3; + int nextIndex = 3 * v3 + 3; + float r = ((colorMap[nextIndex + 0] - colorMap[index + 0]) * v4 + colorMap[index + 0]) * coef; + float g = ((colorMap[nextIndex + 1] - colorMap[index + 1]) * v4 + colorMap[index + 1]) * coef; + float b = ((colorMap[nextIndex + 2] - colorMap[index + 2]) * v4 + colorMap[index + 2]) * coef; + Set_Fade_Color(r, g, b); + if (frame >= 90) { + Set_Fade_Density(0.75f); + } else { + Set_Fade_Density((frame - 60) / 45.0f); + } +} + +void SceneScriptNR04::sub_402960() { + int v0 = Global_Variable_Query(53); + if (!v0) { + Music_Play(14, 11, 80, 2, -1, 0, 0); + } else if (v0 == 1) { + Music_Play(13, 11, 80, 2, -1, 0, 0); + } else if (v0 == 2) { + Music_Play(5, 11, 80, 2, -1, 0, 0); + } + v0++; + if (v0 > 2) { + v0 = 0; + } + Global_Variable_Set(53, v0); +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/nr05.cpp b/engines/bladerunner/script/scene/nr05.cpp new file mode 100644 index 0000000000..1459077258 --- /dev/null +++ b/engines/bladerunner/script/scene/nr05.cpp @@ -0,0 +1,369 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptNR05::InitializeScene() { + if (Game_Flag_Query(547)) { + Scene_Loop_Start_Special(0, 0, 0); + Scene_Loop_Set_Default(1); + Setup_Scene_Information(-777.56f, 0.0f, -166.86f, 0); + } else if (Game_Flag_Query(536)) { + Setup_Scene_Information(-456.0f, 0.0f, -611.0f, 0); + } else { + Setup_Scene_Information(-527.0f, 1.57f, -406.0f, 649); + } + Scene_Exit_Add_2D_Exit(0, 459, 147, 639, 290, 1); + if (Game_Flag_Query(620)) { + Scene_Exit_Add_2D_Exit(1, 0, 0, 30, 479, 3); + } + Ambient_Sounds_Add_Looping_Sound(280, 50, 38, 0); + Ambient_Sounds_Add_Sound(252, 3, 60, 20, 20, -30, 30, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(254, 3, 60, 20, 20, -30, 30, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(255, 3, 60, 20, 20, -30, 30, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(256, 3, 60, 20, 20, -30, 30, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(257, 3, 60, 20, 20, -30, 30, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(258, 3, 60, 20, 20, -30, 30, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(259, 3, 60, 25, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(260, 3, 60, 25, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(261, 3, 60, 25, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(262, 3, 60, 25, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(570, 5, 70, 11, 11, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(571, 5, 70, 11, 11, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(572, 5, 70, 11, 11, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(573, 5, 70, 11, 11, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(184, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(185, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(186, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(188, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(189, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(192, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + if (Game_Flag_Query(547)) { + Scene_Loop_Start_Special(0, 0, 0); + Scene_Loop_Set_Default(1); + } else if (Game_Flag_Query(536)) { + Scene_Loop_Start_Special(0, 3, 0); + Scene_Loop_Set_Default(1); + Game_Flag_Reset(536); + } else { + Scene_Loop_Set_Default(1); + } +} + +void SceneScriptNR05::SceneLoaded() { + Obstacle_Object("NM1-1+", true); + Clickable_Object("NM1-1+"); + Unclickable_Object("NM1-1+"); +} + +bool SceneScriptNR05::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptNR05::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptNR05::ClickedOnActor(int actorId) { + if (actorId == 42) { + if (!Loop_Actor_Walk_To_Actor(0, 42, 120, 1, false)) { + sub_4020B4(); + } + return true; + } + if (actorId == 18) { + Actor_Set_Goal_Number(18, 229); + if (!Loop_Actor_Walk_To_Actor(0, 18, 36, 1, false)) { + sub_4022DC(); + } + Actor_Set_Goal_Number(18, 221); + return true; + } + return false; +} + +bool SceneScriptNR05::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptNR05::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -444.0f, 0.0f, -451.0f, 0, 1, false, 0)) { + Player_Loses_Control(); + Music_Stop(2); + Player_Set_Combat_Mode(false); + Actor_Face_Heading(0, 1021, false); + Actor_Change_Animation_Mode(0, 53); + Game_Flag_Set(537); + Set_Enter(55, 56); + Scene_Loop_Start_Special(1, 3, 0); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -777.56f, 0.0f, -166.86f, 0, 1, false, 0)) { + Game_Flag_Set(546); + Set_Enter(13, 61); + } + return true; + } + return false; +} + +bool SceneScriptNR05::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptNR05::SceneFrameAdvanced(int frame) { + if (!Music_Is_Playing()) { + sub_402B9C(); + } + if (frame == 78) { + Sound_Play(345, 83, 70, 70, 50); + } + if (frame == 86) { + Sound_Play(353, 62, 70, 70, 50); + } + sub_402A48(48); + sub_402A48(0); + if (Actor_Query_Goal_Number(18) == 224) { + Actor_Set_Goal_Number(18, 225); + if (Player_Query_Current_Scene() == 58) { + Scene_Exit_Add_2D_Exit(1, 0, 0, 30, 479, 3); + } + } + if (frame > 77 && frame <= 134) { + sub_401F74(frame - 13); + if (frame == 134 && !Game_Flag_Query(537)) { + Actor_Set_Goal_Number(0, 200); + } + //return true; + return; + } else { + //return false; + return; + } + +} + +void SceneScriptNR05::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptNR05::PlayerWalkedIn() { + if (Game_Flag_Query(547)) { + Music_Stop(2); + Loop_Actor_Walk_To_XYZ(0, -697.56f, 0.0f, -174.86f, 0, 1, false, 0); + Game_Flag_Reset(547); + } + // return false; +} + +void SceneScriptNR05::PlayerWalkedOut() { + if (Game_Flag_Query(537)) { + Music_Stop(2); + } + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); +} + +void SceneScriptNR05::DialogueQueueFlushed(int a1) { +} + +void SceneScriptNR05::sub_401F74(int frame) { + float angle = cos((frame - 65) * (M_PI / 57.0f)) * M_PI_2; + float invertedAngle = M_PI - angle; + if (!Game_Flag_Query(537)) { + angle = angle + M_PI; + invertedAngle = invertedAngle + M_PI; + } + float c = cos(invertedAngle); + float s = sin(invertedAngle); + float x = 6.0f * s - 80.0f * c + -450.0f; + float z = 80.0f * s + 6.0f * c + -531.0f; + + int facing = angle * (512.0f / M_PI); + facing = facing + 765; + if (facing < 0) { + facing = facing + 1789; + } + if (facing > 1023) { + facing -= 1024; + } + Actor_Set_At_XYZ(0, x, 0.0f, z, facing); +} + +void SceneScriptNR05::sub_4020B4() { + Actor_Face_Actor(0, 42, true); + Actor_Face_Actor(42, 0, true); + if (Game_Flag_Query(588)) { + if (Game_Flag_Query(589)) { + Actor_Says(0, 3480, 19); + Actor_Says(42, 30, 12); + Actor_Says(0, 3485, 3); + Actor_Says(42, 40, 13); + Actor_Change_Animation_Mode(42, 23); + Actor_Change_Animation_Mode(0, 75); + Global_Variable_Increment(42, 1); + } else { + Actor_Says(0, 3475, 17); + Actor_Says(42, 20, 23); + Game_Flag_Set(589); + Actor_Change_Animation_Mode(0, 75); + Global_Variable_Increment(42, 1); + } + } else { + Actor_Says(42, 0, 13); + Actor_Says(0, 3470, 3); + Actor_Says(42, 10, 23); + Game_Flag_Set(588); + Actor_Change_Animation_Mode(0, 75); + Global_Variable_Increment(42, 1); + } +} + +void SceneScriptNR05::sub_4022DC() { + if (Actor_Query_Goal_Number(18) == 220) { + Actor_Set_Goal_Number(18, 221); + } + Actor_Face_Actor(0, 18, true); + Actor_Face_Actor(18, 0, true); + if (!Game_Flag_Query(590)) { + Actor_Says(0, 8513, 3); + Actor_Says(18, 360, 3); + Actor_Says(0, 3495, 11); + Actor_Says(18, 370, 15); + Actor_Says(0, 3500, 17); + Actor_Says(18, 380, 13); + Game_Flag_Set(590); + return; + } + Dialogue_Menu_Clear_List(); + if (Actor_Query_Friendliness_To_Other(18, 0) >= 48) { + if (Actor_Clue_Query(0, 90) || Actor_Clue_Query(0, 100)) { + DM_Add_To_List_Never_Repeat_Once_Selected(890, -1, 4, 8); + } + if (Actor_Clue_Query(0, 13)) { + DM_Add_To_List_Never_Repeat_Once_Selected(900, 5, 6, 5); + } + if (Actor_Clue_Query(0, 88)) { + DM_Add_To_List_Never_Repeat_Once_Selected(910, 5, 5, 5); + } + } + if (!Dialogue_Menu_Query_List_Size()) { + Actor_Says(0, 3520, 3); + Actor_Says(18, 730, 3); + Actor_Face_Heading(18, 849, false); + return; + } + Dialogue_Menu_Add_DONE_To_List(100); + Dialogue_Menu_Appear(320, 240); + int answer = Dialogue_Menu_Query_Input(); + Dialogue_Menu_Disappear(); + if (answer == 890) { + Actor_Says(0, 3505, 3); + Actor_Modify_Friendliness_To_Other(18, 0, -1); + Actor_Says(18, 420, 12); + Actor_Says(18, 430, 13); + Actor_Says(0, 3530, 15); + Actor_Says(18, 440, 15); + Actor_Says(0, 3535, 13); + Actor_Says(18, 460, 16); + Actor_Says(0, 3540, 15); + Actor_Says(18, 490, 16); + Actor_Says(18, 500, 13); + Actor_Says(0, 3545, 15); + Actor_Says(18, 520, 12); + Actor_Face_Heading(18, 849, false); + } else if (answer == 900) { + Actor_Says(0, 3510, 15); + Actor_Modify_Friendliness_To_Other(18, 0, -1); + Actor_Says_With_Pause(18, 530, 1.2f, 3); + Actor_Says(18, 540, 15); + Actor_Says(0, 3550, 13); + Actor_Says(18, 560, 14); + Actor_Says(18, 570, 13); + Actor_Says(0, 3555, 12); + Actor_Face_Heading(18, 849, false); + } else if (answer == 910) { + Actor_Says(0, 3515, 14); + Actor_Modify_Friendliness_To_Other(18, 0, -1); + if (Actor_Clue_Query(0, 99)) { + Actor_Says(18, 580, 12); + Actor_Says(0, 3560, 13); + Actor_Says(18, 590, 16); + Actor_Says(0, 3565, 16); + Actor_Says(18, 600, 13); + Actor_Says(0, 3570, 14); + Actor_Says(18, 620, 15); + Actor_Says(0, 3575, 13); + } else { + Actor_Says(18, 640, 13); + Actor_Says(0, 3580, 15); + Actor_Says(18, 660, 12); + } + Actor_Face_Heading(18, 849, false); + } +} + +void SceneScriptNR05::sub_402A48(int actorId) { + int animationMode = Actor_Query_Animation_Mode(actorId); + if (animationMode == 1 || animationMode == 2 || animationMode == 7 || animationMode == 8) { + return; + } + float x, y, z; + Actor_Query_XYZ(actorId, &x, &y, &z); + if ((x - -542.0f) * (x - -542.0f) + (z - -195.0f) * (z - -195.0f) < 8464.0f) { + float s = sin(M_PI / 128.0f); + float c = cos(M_PI / 128.0f); + float newX = x * c - z * s + -542.0f; + float newZ = x * s + z * c + -195.0f; + int newFacing = (Actor_Query_Facing_1024(actorId) + 4) % 1024; + Actor_Set_At_XYZ(actorId, newX, y, newZ, newFacing); + } +} + +void SceneScriptNR05::sub_402B9C() { + if (Music_Is_Playing()) { + Music_Adjust(51, 0, 2); + } else { + int v0 = Global_Variable_Query(54); + if (v0 == 0) { + Music_Play(16, 61, -80, 2, -1, 0, 0); + } else if (v0 == 1) { + Music_Play(15, 41, -80, 2, -1, 0, 0); + } else if (v0 == 2) { + Music_Play(7, 41, -80, 2, -1, 0, 0); + } + v0++; + if (v0 > 2) { + v0 = 0; + } + Global_Variable_Set(54, v0); + } +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/nr06.cpp b/engines/bladerunner/script/scene/nr06.cpp new file mode 100644 index 0000000000..ba93ace7c3 --- /dev/null +++ b/engines/bladerunner/script/scene/nr06.cpp @@ -0,0 +1,162 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptNR06::InitializeScene() { + sub_401BAC(); + if (Game_Flag_Query(442)) { + Setup_Scene_Information(48.0f, -71.88f, -26.0f, 782); + } else { + Setup_Scene_Information(-36.0f, 0.37f, -373.0f, 592); + } + Scene_Exit_Add_2D_Exit(0, 533, 234, 592, 414, 1); + Scene_Exit_Add_2D_Exit(1, 238, 137, 337, 322, 0); + Ambient_Sounds_Add_Looping_Sound(111, 25, 0, 1); + Ambient_Sounds_Add_Sound(252, 3, 60, 8, 12, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(254, 3, 60, 8, 8, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(255, 3, 60, 8, 8, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(256, 3, 60, 8, 8, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(257, 3, 60, 8, 8, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(258, 3, 60, 8, 8, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(259, 3, 60, 8, 8, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(260, 3, 60, 8, 8, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(261, 3, 60, 8, 8, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(262, 3, 60, 8, 8, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(182, 5, 70, 8, 8, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(184, 5, 70, 8, 8, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(185, 5, 70, 8, 8, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(186, 5, 70, 8, 8, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(188, 5, 70, 8, 8, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(189, 5, 70, 8, 8, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(191, 5, 70, 8, 8, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(192, 5, 70, 8, 8, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(195, 5, 70, 8, 8, -100, 100, -101, -101, 0, 0); +} + +void SceneScriptNR06::SceneLoaded() { + Obstacle_Object("CHAIR01", true); + Unobstacle_Object("LOFT04", true); + Unobstacle_Object("LINE02", true); + Unobstacle_Object("WALL01", true); + Unclickable_Object("CHAIR01"); +} + +bool SceneScriptNR06::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptNR06::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptNR06::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptNR06::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptNR06::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, 48.0f, -71.88f, -26.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Game_Flag_Set(441); + Set_Enter(57, 60); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -137.0f, -71.88f, -243.0f, 0, 1, false, 0)) { + Actor_Face_Heading(0, 95, false); + Loop_Actor_Travel_Stairs(0, 8, 1, 0); + Loop_Actor_Walk_To_XYZ(0, -36.0f, 0.37f, -373.0f, 0, 0, false, 0); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(439); + Set_Enter(13, 61); + } + return true; + } + return false; +} + +bool SceneScriptNR06::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptNR06::SceneFrameAdvanced(int frame) { + if (!Music_Is_Playing()) { + sub_401BAC(); + } + //return false; +} + +void SceneScriptNR06::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptNR06::PlayerWalkedIn() { + if (Game_Flag_Query(442)) { + Loop_Actor_Walk_To_XYZ(0, -3.0f, -71.88f, -26.0f, 0, 0, false, 0); + Game_Flag_Reset(442); + } else { + Loop_Actor_Walk_To_XYZ(0, -81.72f, 0.12f, -323.49f, 0, 0, false, 0); + Actor_Face_Heading(0, 600, false); + Loop_Actor_Travel_Stairs(0, 8, 0, 0); + Game_Flag_Reset(440); + } + //return false; +} + +void SceneScriptNR06::PlayerWalkedOut() { + if (Game_Flag_Query(441)) { + Music_Stop(2); + } +} + +void SceneScriptNR06::DialogueQueueFlushed(int a1) { +} + +void SceneScriptNR06::sub_401BAC() { + if (Music_Is_Playing()) { + Music_Adjust(31, 80, 2); + } else { + int v0 = Global_Variable_Query(54); + if (v0 == 0) { + Music_Play(16, 61, -80, 2, -1, 0, 0); + } else if (v0 == 1) { + Music_Play(15, 41, -80, 2, -1, 0, 0); + } else if (v0 == 2) { + Music_Play(7, 41, -80, 2, -1, 0, 0); + } + v0++; + if (v0 > 2) { + v0 = 0; + } + Global_Variable_Set(54, v0); + } +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/nr07.cpp b/engines/bladerunner/script/scene/nr07.cpp new file mode 100644 index 0000000000..c1e2e2d6ff --- /dev/null +++ b/engines/bladerunner/script/scene/nr07.cpp @@ -0,0 +1,379 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptNR07::InitializeScene() { + Setup_Scene_Information(-110.0f, -73.5f, -193.0f, 554); + Scene_Exit_Add_2D_Exit(0, 429, 137, 506, 251, 0); + Ambient_Sounds_Add_Looping_Sound(111, 25, 0, 1); +} + +void SceneScriptNR07::SceneLoaded() { + Obstacle_Object("VANITY", true); + Clickable_Object("VASE"); +} + +bool SceneScriptNR07::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptNR07::ClickedOn3DObject(const char *objectName, bool a2) { + Actor_Set_Goal_Number(25, 201); + if (Object_Query_Click("VASE", objectName)) { + sub_401C60(); + } + Actor_Set_Goal_Number(25, 200); + return false; +} + +bool SceneScriptNR07::ClickedOnActor(int actorId) { + if (actorId == 3) { + if (Actor_Query_Goal_Number(33) <= 239) { + Actor_Set_Goal_Number(25, 201); + Actor_Face_Actor(0, 3, true); + Dialogue_Menu_Clear_List(); + if (Game_Flag_Query(638)) { + DM_Add_To_List_Never_Repeat_Once_Selected(1100, -1, 3, 8); + DM_Add_To_List_Never_Repeat_Once_Selected(1110, 8, -1, -1); + if (Actor_Clue_Query(0, 95)) { + DM_Add_To_List_Never_Repeat_Once_Selected(1120, 3, 6, 7); + } + if (Actor_Clue_Query(0, 113)) { + DM_Add_To_List_Never_Repeat_Once_Selected(1130, 3, 5, 7); + } + if (Game_Flag_Query(510)) { + DM_Add_To_List_Never_Repeat_Once_Selected(1140, 1, 4, 7); + } + } else { + DM_Add_To_List_Never_Repeat_Once_Selected(1080, 3, 5, 7); + DM_Add_To_List_Never_Repeat_Once_Selected(1090, 7, 5, 4); + } + Dialogue_Menu_Add_DONE_To_List(1150); + Dialogue_Menu_Appear(320, 240); + int answer = Dialogue_Menu_Query_Input(); + Dialogue_Menu_Disappear(); + switch (answer) { + case 1140: + sub_4028FC(); + break; + case 1130: + sub_402738(); + break; + case 1120: + sub_402614(); + break; + case 1110: + sub_402510(); + break; + case 1100: + sub_402284(); + break; + case 1090: + Actor_Says(0, 3650, 13); + Actor_Says(3, 630, 30); + Actor_Says(0, 3655, 16); + Actor_Says(3, 640, 31); + break; + case 1080: + sub_401EF4(); + break; + default: + break; + } + Actor_Set_Goal_Number(25, 200); + return false;; + } + return true; + } + return false; +} + +bool SceneScriptNR07::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptNR07::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -102.0f, -73.5f, -233.0f, 0, 1, false, 0)) { + Actor_Set_Goal_Number(25, 201); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(442); + Set_Enter(56, 59); + } + return true; + } + return false; +} + +bool SceneScriptNR07::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptNR07::SceneFrameAdvanced(int frame) { +} + +void SceneScriptNR07::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptNR07::PlayerWalkedIn() { + Loop_Actor_Walk_To_XYZ(0, -110.0f, -73.5f, -169.0f, 0, 0, false, 0); + if (Actor_Query_In_Set(3, 57)) { + if (Game_Flag_Query(508)) { + Actor_Modify_Friendliness_To_Other(3, 0, -2); + Actor_Says(3, 530, 31); + } else { + Game_Flag_Set(508); + if (!Actor_Clue_Query(3, 214)) { + Actor_Modify_Friendliness_To_Other(3, 0, 5); + } else if (Actor_Clue_Query(0, 216) || Actor_Clue_Query(0, 217)) { + Actor_Modify_Friendliness_To_Other(3, 0, 10); + } + Actor_Says(3, 500, 30); + Actor_Says(0, 3585, 14); + Actor_Says(3, 510, 30); + Actor_Start_Speech_Sample(0, 3590); + Loop_Actor_Walk_To_XYZ(0, -112.0f, -73.0f, -89.0f, 525, 0, false, 0); + Actor_Says(3, 520, 53); + } + Actor_Set_Goal_Number(25, 200); + } + //return false; +} + +void SceneScriptNR07::PlayerWalkedOut() { + +} + +void SceneScriptNR07::DialogueQueueFlushed(int a1) { +} + +void SceneScriptNR07::sub_4018D4() { + Actor_Set_Goal_Number(25, 201); + Player_Loses_Control(); + Actor_Set_At_XYZ(3, -136.0f, -73.0f, -18.0f, 300); + Actor_Change_Animation_Mode(3, 71); + Actor_Change_Animation_Mode(0, 21); + Loop_Actor_Walk_To_XYZ(3, -102.0f, -73.5f, -233.0f, 0, 0, true, 0); + if (Game_Flag_Query(47)) { + Actor_Set_Goal_Number(3, 245); + } else { + Actor_Set_Goal_Number(3, 295); + Game_Flag_Set(591); + Actor_Put_In_Set(3, 91); + Actor_Set_At_Waypoint(3, 33, 0); + } + Player_Gains_Control(); +} + +void SceneScriptNR07::sub_401A10() { + Scene_Exits_Disable(); + Actor_Set_Goal_Number(25, 201); + Actor_Says_With_Pause(3, 930, 1.0f, 30); + Actor_Says_With_Pause(3, 910, 1.0f, 30); + Actor_Face_Object(3, "VANITY", true); + Actor_Says(3, 940, 31); + Actor_Says(0, 3770, 19); + Async_Actor_Walk_To_XYZ(0, -193.0f, -73.5f, -13.0f, 0, false); + Actor_Says(3, 950, 31); + Actor_Face_Actor(3, 0, true); + Actor_Change_Animation_Mode(3, 4); + Actor_Face_Actor(0, 3, true); + Actor_Says(0, 3760, 19); + Actor_Says(3, 960, 53); + Actor_Says(3, 920, 53); + Actor_Says(0, 3780, 0); + Actor_Says(3, 970, 53); + Actor_Voice_Over(1710, 99); + Actor_Voice_Over(1720, 99); + Actor_Voice_Over(1730, 99); + Actor_Set_Goal_Number(33, 240); +} + +void SceneScriptNR07::sub_401C60() { + Loop_Actor_Walk_To_XYZ(0, -109.0f, -73.0f, -89.0f, 0, 0, false, 0); + Actor_Face_Object(0, "VASE", true); + if (Actor_Query_Is_In_Current_Set(3)) { + if (!Actor_Clue_Query(0, 97)) { + Actor_Clue_Acquire(0, 97, 1, -1); + int v0 = Actor_Query_Friendliness_To_Other(3, 0); + if (v0 > 50) { + Actor_Modify_Friendliness_To_Other(3, 0, 2); + } else if (v0 <= 50) { + Actor_Modify_Friendliness_To_Other(3, 0, -2); + } + Actor_Says(0, 3600, 19); + Actor_Says(3, 550, 30); + Actor_Says(0, 3605, 19); + Actor_Says(3, 560, 31); + Actor_Says(0, 3610, 19); + } + } else if (Actor_Clue_Query(0, 98)) { + Actor_Says(0, 8585, 14); + } else { + Actor_Clue_Acquire(0, 98, 1, -1); + Loop_Actor_Walk_To_Scene_Object(0, "VASE", 100, 1, false); + Actor_Change_Animation_Mode(0, 23); + Item_Pickup_Spin_Effect(935, 526, 268); + Actor_Voice_Over(1690, 99); + Actor_Voice_Over(1700, 99); + } +} + +void SceneScriptNR07::sub_401EF4() { + Actor_Clue_Acquire(0, 96, 1, -1); + Actor_Says(0, 3625, 19); + Actor_Says(3, 570, 30); + Actor_Says_With_Pause(3, 580, 1.0f, 31); + Actor_Says(0, 3630, 13); + Actor_Says_With_Pause(3, 590, 1.0f, 30); + Actor_Says(3, 600, 30); + Actor_Start_Speech_Sample(0, 3640); + Loop_Actor_Walk_To_XYZ(0, -109.0f, -73.0f, -89.0f, 0, 0, false, 0); + Actor_Face_Actor(0, 3, true); + Actor_Face_Actor(3, 0, true); + Game_Flag_Set(638); + Actor_Clue_Acquire(0, 91, 1, 3); + int v0 = Actor_Query_Friendliness_To_Other(3, 0); + if (!Game_Flag_Query(47) && v0 < 40) { + sub_4018D4(); + return; + } + if (v0 < 36) { + sub_401A10(); + return; + } + sub_4020F0(); +} + +void SceneScriptNR07::sub_4020F0() { + if (Actor_Clue_Query(3, 213) && Actor_Clue_Query(3, 214)) { + Actor_Modify_Friendliness_To_Other(3, 0, -1); + } + Actor_Says(3, 610, 31); + Actor_Says(0, 3645, 12); + Actor_Says(3, 620, 30); + int v0 = Actor_Query_Friendliness_To_Other(3, 0); + if (!Game_Flag_Query(47) && v0 < 40) { + sub_4018D4(); + return; + } + if (v0 < 36) { + sub_401A10(); + return; + } + Actor_Face_Object(3, "VANITY", true); +} + +void SceneScriptNR07::sub_402284() { + Actor_Clue_Acquire(0, 94, 1, -1); + Actor_Start_Speech_Sample(0, 3660); + Loop_Actor_Walk_To_XYZ(0, -109.0f, -73.0f, -89.0f, 0, 0, false, 0); + Actor_Face_Actor(0, 3, true); + Actor_Says(3, 650, 30); + Actor_Says(3, 660, 31); + Actor_Says(0, 3665, 18); + Actor_Face_Actor(3, 0, true); + Actor_Says(3, 670, 31); + Actor_Says(3, 680, 30); + Actor_Says(3, 690, 31); + Actor_Says(0, 3670, 17); + Actor_Says(3, 700, 30); + Actor_Says(0, 3675, 19); + Actor_Says(3, 710, 30); + Actor_Says(0, 3680, 19); + Actor_Says(3, 720, 30); + Actor_Says(3, 730, 30); + Actor_Says(0, 3685, 13); + Voight_Kampff_Activate(3, 40); + if (Game_Flag_Query(47)) { + sub_401A10(); + } else { + sub_4018D4(); + } +} + +void SceneScriptNR07::sub_402510() { + Actor_Says(0, 3690, 14); + Actor_Start_Speech_Sample(3, 750); + Loop_Actor_Walk_To_XYZ(0, -109.0f, -73.0f, -89.0f, 0, 0, false, 0); + Actor_Face_Actor(0, 3, true); + Actor_Face_Actor(3, 0, true); + Actor_Says(0, 3695, 15); + Actor_Modify_Friendliness_To_Other(3, 0, 5); + if (Game_Flag_Query(47)) { + sub_401A10(); + } else { + sub_4018D4(); + } +} + +void SceneScriptNR07::sub_402614() { + Actor_Says(0, 3705, 19); + Actor_Says(3, 760, 53); + if (Game_Flag_Query(47)) { + Actor_Modify_Friendliness_To_Other(3, 0, -5); + Actor_Says(0, 3710, 18); + sub_401A10(); + } else { + Actor_Modify_Friendliness_To_Other(3, 0, -3); + Actor_Start_Speech_Sample(0, 3710); + Loop_Actor_Walk_To_XYZ(0, -109.0f, -73.0f, -89.0f, 0, 0, false, 0); + Actor_Face_Actor(0, 3, true); + sub_4018D4(); + } +} + +void SceneScriptNR07::sub_402738() { + Actor_Modify_Friendliness_To_Other(3, 0, -3); + Actor_Says(0, 3615, 16); + Actor_Says(3, 770, 30); + Actor_Says(0, 3720, 15); + Actor_Says_With_Pause(3, 780, 2.0f, 30); + Actor_Says(3, 790, 31); + Actor_Says(0, 3725, 18); + Actor_Says(3, 800, 30); + Actor_Says_With_Pause(0, 3730, 2.0f, 13); + Actor_Says_With_Pause(3, 810, 1.0f, 53); + Actor_Says(3, 820, 30); + Actor_Says(0, 3735, 14); + Actor_Says(3, 830, 31); + Actor_Says(0, 3740, 19); +} + +void SceneScriptNR07::sub_4028FC() { + Actor_Says(0, 3620, 19); + Actor_Says(3, 840, 30); + Actor_Says(0, 3745, 9); + Actor_Says_With_Pause(3, 850, 1.0f, 30); + Actor_Says(3, 860, 30); + Actor_Says(3, 870, 53); + Actor_Says(0, 3750, 11); + Actor_Says(3, 880, 30); + Actor_Says(0, 3755, 16); + Actor_Says(3, 890, 31); +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/nr08.cpp b/engines/bladerunner/script/scene/nr08.cpp new file mode 100644 index 0000000000..3d1058901e --- /dev/null +++ b/engines/bladerunner/script/scene/nr08.cpp @@ -0,0 +1,242 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptNR08::InitializeScene() { + if (Actor_Query_Goal_Number(1) == 231) { + Setup_Scene_Information(-1174.1f, 0.32f, 303.9f, 435); + } else if (Game_Flag_Query(546)) { + Scene_Loop_Start_Special(0, 0, 0); + Scene_Loop_Set_Default(1); + Setup_Scene_Information(-1102.88f, 0.0f, 107.43f, 0); + if (Actor_Query_Goal_Number(3) == 210) { + Music_Stop(1); + } + } else if (Game_Flag_Query(439)) { + Setup_Scene_Information(-724.7f, 0.0f, 384.24f, 1000); + Game_Flag_Reset(439); + } else if (Game_Flag_Query(615)) { + Setup_Scene_Information(-1663.33f, 0.65f, 342.84f, 330); + Game_Flag_Reset(615); + } + Scene_Exit_Add_2D_Exit(0, 610, 0, 639, 479, 1); + if (Actor_Query_Goal_Number(3) != 210) { + Scene_Exit_Add_2D_Exit(1, 0, 309, 30, 398, 3); + Scene_Exit_Add_2D_Exit(2, 520, 330, 556, 386, 0); + } + Ambient_Sounds_Add_Looping_Sound(280, 50, 38, 0); + Ambient_Sounds_Add_Sound(252, 3, 60, 14, 14, 60, 90, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(254, 3, 60, 14, 14, 60, 90, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(255, 3, 60, 14, 14, 60, 90, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(256, 3, 60, 14, 14, 60, 90, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(257, 3, 60, 14, 14, 60, 90, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(258, 3, 60, 14, 14, 60, 90, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(259, 3, 60, 16, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(260, 3, 60, 16, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(261, 3, 60, 16, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(262, 3, 60, 16, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(184, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(185, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(186, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(188, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(189, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(192, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Scene_Loop_Set_Default(1); +} + +void SceneScriptNR08::SceneLoaded() { + Obstacle_Object("BOX283", true); + Unobstacle_Object("BOX283", true); + if (Actor_Query_Goal_Number(3) == 210) { + Actor_Change_Animation_Mode(3, 79); + } +} + +bool SceneScriptNR08::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptNR08::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptNR08::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptNR08::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptNR08::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -1102.88f, 0.0f, 107.43f, 0, 1, false, 0)) { + Game_Flag_Set(547); + Set_Enter(13, 58); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -724.7f, 0.0f, 384.24f, 0, 1, false, 0)) { + Actor_Face_Heading(0, 505, false); + Loop_Actor_Travel_Stairs(0, 4, 1, 0); + Game_Flag_Set(440); + Set_Enter(56, 59); + } + return true; + } + if (exitId == 2) { + if (!Loop_Actor_Walk_To_XYZ(0, -1663.33f, 0.65f, 342.84f, 0, 1, false, 0)) { + Actor_Face_Heading(0, 831, false); + Footstep_Sound_Override_On(2); + Loop_Actor_Travel_Stairs(0, 6, 1, 0); + Footstep_Sound_Override_Off(); + Game_Flag_Set(614); + Set_Enter(58, 62); + } + } + return false; +} + +bool SceneScriptNR08::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptNR08::SceneFrameAdvanced(int frame) { + if (!Music_Is_Playing()) { + sub_4021B4(); + } + Set_Fade_Color(0, 0, 0); + if (frame >= 76 && frame < 91) { + Set_Fade_Density((frame - 76) / 14.0f); + Music_Stop(3); + Ambient_Sounds_Play_Sound(566, 27, 0, 99, 0); + } else if (frame >= 91 && frame < 120) { + Actor_Set_Invisible(0, true); + Set_Fade_Density(1.0f); + } else if (frame >= 120 && frame < 135) { + Set_Fade_Density((134 - frame) / 14.0f); + Music_Play(7, 61, 0, 1, -1, 0, 0); + } else { + Actor_Set_Invisible(0, false); + Set_Fade_Density(0.0f); + } + if (Game_Flag_Query(651) && !Game_Flag_Query(636)) { + Game_Flag_Set(636); + Scene_Exits_Disable(); + Scene_Loop_Set_Default(1); + Scene_Loop_Start_Special(2, 3, 1); + } + if (frame == 95) { + Actor_Put_In_Set(3, 91); + Actor_Set_At_Waypoint(3, 33, 0); + Actor_Change_Animation_Mode(3, 0); + Actor_Set_Goal_Number(3, 200); + Scene_Exit_Add_2D_Exit(1, 0, 309, 30, 398, 3); + Scene_Exit_Add_2D_Exit(2, 520, 330, 556, 386, 0); + } + if (frame == 130) { + Scene_Exits_Enable(); + } + //return false; +} + +void SceneScriptNR08::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptNR08::PlayerWalkedIn() { + if (Actor_Query_Goal_Number(3) != 210 || Game_Flag_Query(729)) { + Music_Adjust(51, 0, 2); + } else { + Game_Flag_Set(729); + Ambient_Sounds_Play_Sound(566, 27, 0, 99, 0); + Outtake_Play(40, 1, -1); + } + if (Actor_Query_Goal_Number(3) == 245) { + Actor_Face_Heading(3, 790, false); + Loop_Actor_Travel_Stairs(3, 8, 1, 0); + Actor_Set_Goal_Number(3, 246); + } + if (Actor_Query_Goal_Number(1) == 231) { + Actor_Says(1, 1640, 12); + if (!Game_Flag_Query(378)) { + Actor_Says(0, 3790, 13); + Actor_Says(1, 1650, 14); + } + Actor_Says(1, 1660, 12); + Actor_Says(0, 3795, 16); + Actor_Says(1, 1670, 13); + Actor_Says(1, 1680, 14); + Actor_Says(1, 1690, 15); + Actor_Set_Goal_Number(1, 235); + //return true; + return; + } else { + if (Game_Flag_Query(546)) { + Loop_Actor_Walk_To_XYZ(0, -1090.88f, 0.0f, 147.43f, 0, 1, false, 0); + Game_Flag_Reset(546); + } + //return false; + return; + } +} + +void SceneScriptNR08::PlayerWalkedOut() { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + if (!Game_Flag_Query(547)) { + Music_Stop(2); + } +} + +void SceneScriptNR08::DialogueQueueFlushed(int a1) { +} + +void SceneScriptNR08::sub_4021B4() { + if (Music_Is_Playing()) { + Music_Adjust(51, 0, 2); + } else if (Actor_Query_Goal_Number(3) == 210) { + Music_Play(6, 61, 0, 1, -1, 0, 0); + } else { + int v0 = Global_Variable_Query(54); + if (v0 == 0) { + Music_Play(16, 61, -80, 2, -1, 0, 0); + } else if (v0 == 1) { + Music_Play(15, 41, -80, 2, -1, 0, 0); + } else if (v0 == 2) { + Music_Play(7, 41, -80, 2, -1, 0, 0); + } + v0++; + if (v0 > 2) { + v0 = 0; + } + Global_Variable_Set(54, v0); + } +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/nr09.cpp b/engines/bladerunner/script/scene/nr09.cpp new file mode 100644 index 0000000000..19a95e30e2 --- /dev/null +++ b/engines/bladerunner/script/scene/nr09.cpp @@ -0,0 +1,145 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptNR09::InitializeScene() { + if (Game_Flag_Query(476)) { + if (!Game_Flag_Query(640)) { + Ambient_Sounds_Adjust_Looping_Sound(452, 22, 100, 2); + } + Game_Flag_Reset(476); + Setup_Scene_Information(-556.07f, 0.35f, 399.04f, 440); + } else { + if (!Game_Flag_Query(640)) { + Ambient_Sounds_Add_Looping_Sound(452, 22, 100, 1); + } + Setup_Scene_Information(-704.07f, 0.35f, 663.04f, 0); + } + Scene_Exit_Add_2D_Exit(0, 400, 100, 440, 280, 1); + Scene_Exit_Add_2D_Exit(1, 0, 0, 30, 479, 3); + Ambient_Sounds_Add_Looping_Sound(205, 22, 0, 1); + Ambient_Sounds_Add_Looping_Sound(71, 33, 0, 1); + Ambient_Sounds_Add_Sound(303, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(304, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(305, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(306, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(307, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(308, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0); +} + +void SceneScriptNR09::SceneLoaded() { + Obstacle_Object("X2NEWSPAPER", true); + Unobstacle_Object("X2NEWSPAPER", true); + Unclickable_Object("X2NEWSPAPER"); +} + +bool SceneScriptNR09::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptNR09::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptNR09::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptNR09::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptNR09::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -564.07f, 0.35f, 399.04f, 0, 1, false, 0)) { + Game_Flag_Set(475); + Set_Enter(59, 63); + return true; + } + } + if (exitId == 1) { + int v1 = Loop_Actor_Walk_To_XYZ(0, -704.07f, 0.35f, 663.04f, 0, 1, false, 0); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + if (!v1) { + Game_Flag_Set(615); + Set_Enter(13, 61); + return true; + } + } + return false; +} + +bool SceneScriptNR09::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptNR09::SceneFrameAdvanced(int frame) { + if (!Music_Is_Playing()) { + sub_40172C(); + } +} + +void SceneScriptNR09::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptNR09::PlayerWalkedIn() { + if (Game_Flag_Query(614)) { + Loop_Actor_Walk_To_XYZ(0, -704.07001f, 0.35f, 623.04f, 0, 0, false, 0); + Game_Flag_Reset(614); + } + //return false; +} + +void SceneScriptNR09::PlayerWalkedOut() { + if (Game_Flag_Query(475)) { + Music_Stop(2); + } +} + +void SceneScriptNR09::DialogueQueueFlushed(int a1) { +} + +void SceneScriptNR09::sub_40172C() { + if (Music_Is_Playing()) { + Music_Adjust(31, -80, 2); + } else { + int v0 = Global_Variable_Query(54); + if (v0 == 0) { + Music_Play(16, 61, -80, 2, -1, 0, 0); + } else if (v0 == 1) { + Music_Play(15, 41, -80, 2, -1, 0, 0); + } else if (v0 == 2) { + Music_Play(7, 41, -80, 2, -1, 0, 0); + } + v0++; + if (v0 > 2) { + v0 = 0; + } + Global_Variable_Set(54, v0); + } +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/nr10.cpp b/engines/bladerunner/script/scene/nr10.cpp new file mode 100644 index 0000000000..708e1ccb9a --- /dev/null +++ b/engines/bladerunner/script/scene/nr10.cpp @@ -0,0 +1,164 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptNR10::InitializeScene() { + if (Game_Flag_Query(475)) { + Game_Flag_Reset(475); + Setup_Scene_Information(-136.78f, 2.84f, -234.43f, 320); + } else { + Game_Flag_Reset(477); + Setup_Scene_Information(19.22f, 2.84f, -250.43f, 540); + } + Scene_Exit_Add_2D_Exit(0, 144, 163, 194, 318, 3); + Scene_Exit_Add_2D_Exit(1, 475, 95, 568, 230, 0); + Ambient_Sounds_Add_Looping_Sound(205, 22, 0, 1); + Ambient_Sounds_Add_Looping_Sound(71, 33, 0, 1); + Ambient_Sounds_Add_Sound(303, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(304, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(305, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(306, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(307, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(308, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0); + if (Game_Flag_Query(640)) { + Scene_Loop_Set_Default(0); + } else { + Ambient_Sounds_Adjust_Looping_Sound(452, 31, 0, 1); + Scene_Loop_Set_Default(2); + } +} + +void SceneScriptNR10::SceneLoaded() { + Obstacle_Object("HOOK 01", true); + Unobstacle_Object("BOX21", true); + Unobstacle_Object("BOX23", true); + Unclickable_Object("BOX18"); +} + +bool SceneScriptNR10::MouseClick(int x, int y) { + return Game_Flag_Query(642); +} + +bool SceneScriptNR10::ClickedOn3DObject(const char *objectName, bool a2) { + if (Object_Query_Click("BOX18", objectName) && a2 && Game_Flag_Query(642)) { + Actor_Set_Goal_Number(3, 250); + Game_Flag_Set(640); + Game_Flag_Reset(642); + Actor_Set_Invisible(0, false); + Actor_Set_Invisible(3, false); + Ambient_Sounds_Remove_Looping_Sound(452, true); + Sound_Play(453, 52, 0, 0, 50); + Scene_Loop_Set_Default(0); + Scene_Loop_Start_Special(2, 0, 1); + Un_Combat_Target_Object("BOX18"); + Scene_Exits_Enable(); + return true; + } + return false; +} + +bool SceneScriptNR10::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptNR10::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptNR10::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -152.78f, 2.84f, -238.43f, 0, 1, false, 0)) { + Game_Flag_Set(476); + Set_Enter(58, 62); + return true; + } + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, 11.5f, 2.84f, -304.46f, 0, 1, false, 0)) { + Actor_Face_Heading(0, 55, false); + Loop_Actor_Travel_Ladder(0, 8, 1, 0); + Game_Flag_Set(641); + Set_Enter(60, 64); + return true; + } + } + return false; +} + +bool SceneScriptNR10::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptNR10::SceneFrameAdvanced(int frame) { + if (frame == 122) { + Game_Flag_Set(642); + Actor_Set_Invisible(0, true); + Actor_Set_Invisible(3, true); + Combat_Target_Object("BOX18"); + //return true; + return; + } + if (frame == 61 && Game_Flag_Query(642)) { + Game_Flag_Reset(642); + Player_Set_Combat_Mode(false); + Actor_Set_Invisible(0, false); + Actor_Set_Goal_Number(3, 247); + //return true; + return; + } + //return false; +} + +void SceneScriptNR10::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptNR10::PlayerWalkedIn() { + if (Actor_Query_Goal_Number(3) == 246) { + Player_Set_Combat_Mode(true); + //return true; + return; + } + if (Actor_Query_Goal_Number(1) == 236) { + Actor_Face_Actor(1, 0, true); + Actor_Says(1, 150, 13); + Actor_Face_Actor(0, 1, true); + Actor_Says(0, 1580, 14); + Actor_Says(1, 160, 15); + Actor_Says(0, 1585, 16); + Actor_Says(1, 1160, 16); + Delay(1000); + Actor_Says(1, 1290, 14); + Actor_Set_Goal_Number(1, 275); + } + // return false; +} + +void SceneScriptNR10::PlayerWalkedOut() { +} + +void SceneScriptNR10::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/nr11.cpp b/engines/bladerunner/script/scene/nr11.cpp new file mode 100644 index 0000000000..171b6fcd5d --- /dev/null +++ b/engines/bladerunner/script/scene/nr11.cpp @@ -0,0 +1,382 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptNR11::InitializeScene() { + Setup_Scene_Information(100.0f, 1.75f, -4.0f, 0); + Scene_Exit_Add_2D_Exit(0, 450, 305, 565, 345, 2); + if (!Game_Flag_Query(640)) { + Ambient_Sounds_Adjust_Looping_Sound(452, 22, 0, 1); + } + Ambient_Sounds_Add_Looping_Sound(205, 22, 0, 1); + Ambient_Sounds_Add_Looping_Sound(71, 33, 0, 1); + Ambient_Sounds_Add_Sound(303, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(304, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(305, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(306, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(307, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(308, 2, 50, 7, 17, -100, 100, -101, -101, 0, 0); + if (Game_Flag_Query(632)) { + Scene_Loop_Set_Default(3); + Ambient_Sounds_Add_Looping_Sound(381, 83, 0, 1); + } else if (Game_Flag_Query(634)) { + Scene_Loop_Set_Default(5); + Ambient_Sounds_Add_Looping_Sound(381, 83, 0, 1); + } else { + Scene_Loop_Set_Default(0); + Overlay_Play("NR11OVER", 0, 1, 0, 0); + } +} + +void SceneScriptNR11::SceneLoaded() { + Obstacle_Object("COATRACK", true); + Unobstacle_Object("BOX13", true); + Clickable_Object("LOFT04"); + Unclickable_Object("LOFT04"); + if (Actor_Query_Goal_Number(3) == 250) { + Clickable_Object("CLOTHING02"); + Clickable_Object("BOX27"); + Clickable_Object("BOX39"); + Clickable_Object("BOX44"); + Clickable_Object("DRESS"); + Clickable_Object("COATRACK"); + Clickable_Object("COLUMN3 DETS"); + Clickable_Object("COLUMN PIPE01"); + Clickable_Object("RECTANGLE02"); + Clickable_Object("COLUMN04"); + Clickable_Object("COATRACK01"); + Clickable_Object("SHIRT"); + Clickable_Object("SKIRT 02"); + Clickable_Object("CLOTHING B 03"); + Clickable_Object("BUST BUST"); + Combat_Target_Object("CLOTHING02"); + Combat_Target_Object("BOX27"); + Combat_Target_Object("BOX39"); + Combat_Target_Object("BOX44"); + Combat_Target_Object("DRESS"); + Combat_Target_Object("COATRACK"); + Combat_Target_Object("COLUMN3 DETS"); + Combat_Target_Object("COLUMN PIPE01"); + Combat_Target_Object("RECTANGLE02"); + Combat_Target_Object("COLUMN04"); + Combat_Target_Object("COATRACK01"); + Combat_Target_Object("SHIRT"); + Combat_Target_Object("SKIRT 02"); + Combat_Target_Object("CLOTHING B 03"); + Combat_Target_Object("BUST BUST"); + } else { + Unclickable_Object("CLOTHING02"); + Unclickable_Object("BOX27"); + Unclickable_Object("BOX39"); + Unclickable_Object("BOX44"); + Unclickable_Object("DRESS"); + Unclickable_Object("COATRACK"); + Unclickable_Object("COLUMN3 DETS"); + Unclickable_Object("COLUMN PIPE01"); + Unclickable_Object("RECTANGLE02"); + Unclickable_Object("COLUMN04"); + Unclickable_Object("COATRACK01"); + Unclickable_Object("SHIRT"); + Unclickable_Object("SKIRT 02"); + Unclickable_Object("CLOTHING B 03"); + Unclickable_Object("BUST BUST"); + } +} + +bool SceneScriptNR11::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptNR11::ClickedOn3DObject(const char *objectName, bool a2) { + + if (Object_Query_Click("CLOTHING02", objectName) || Object_Query_Click("BOX27", objectName) || Object_Query_Click("BOX39", objectName) || Object_Query_Click("BOX44", objectName) || Object_Query_Click("DRESS", objectName) || Object_Query_Click("COATRACK", objectName) || Object_Query_Click("COLUMN3 DETS", objectName) || Object_Query_Click("COLUMN PIPE01", objectName) || Object_Query_Click("RECTANGLE02", objectName) || Object_Query_Click("COLUMN04", objectName) || Object_Query_Click("COATRACK01", objectName) || Object_Query_Click("SHIRT", objectName) || Object_Query_Click("SKIRT 02", objectName) || Object_Query_Click("CLOTHING B 03", objectName) || Object_Query_Click("BUST BUST", objectName)) { + if (a2) { + Actor_Set_Goal_Number(1, 211); + Scene_Exits_Disable(); + sub_4028EC(); + Player_Loses_Control(); + if (!Player_Query_Combat_Mode()) { + Player_Set_Combat_Mode(true); + } + Actor_Set_Goal_Number(0, 230); + Scene_Loop_Set_Default(3); + Scene_Loop_Start_Special(2, 2, 1); + } else if (Actor_Query_Goal_Number(3) == 250) { + if (!Loop_Actor_Walk_To_XYZ(0, 24.0f, 0.33f, 0.0f, 0, 1, false, 0)) { + Actor_Face_XYZ(0, -180.0f, 0.0f, -170.0f, true); + sub_4028EC(); + Actor_Set_Goal_Number(1, 211); + if (Actor_Query_Friendliness_To_Other(3, 0) < 30) { + Actor_Set_At_XYZ(3, 0.5f, 0.33f, -162.0f, 0); + Loop_Actor_Walk_To_XYZ(3, -24.0f, 0.33f, -35.4f, 0, 0, true, 0); + Actor_Face_Actor(0, 3, true); + Actor_Change_Animation_Mode(3, 71); + Delay(500); + Actor_Change_Animation_Mode(0, 48); + Delay(2000); + Actor_Set_Goal_Number(0, 231); + } else { + Actor_Says(0, 3840, 18); + Delay(1000); + if (Actor_Query_Friendliness_To_Other(3, 0) > 59 && !Global_Variable_Query(45)) { + Music_Play(21, 35, 0, 3, -1, 0, 0); + } + Loop_Actor_Walk_To_XYZ(3, -135.0f, 0.33000001f, -267.0f, 0, 0, false, 0); + Actor_Face_Actor(3, 0, true); + Actor_Face_Actor(0, 3, true); + Actor_Clue_Acquire(0, 107, 1, 3); + Actor_Says(3, 990, 13); + Actor_Says(3, 1000, 14); + Loop_Actor_Walk_To_Actor(3, 0, 108, 0, false); + Actor_Says(0, 3845, 13); + Actor_Says(0, 3850, 15); + Actor_Says(3, 1010, 14); + Actor_Says(0, 3855, 13); + Actor_Says(3, 1020, 12); + Actor_Says(0, 3860, 12); + Actor_Says_With_Pause(3, 1030, 1.0f, 14); + Actor_Says(3, 1040, 13); + Actor_Says(0, 3865, 15); + Actor_Says_With_Pause(3, 1050, 0.80000001f, 14); + Actor_Says(3, 1060, 13); + Actor_Says(0, 3870, 3); + Actor_Says(3, 1070, 14); + Actor_Modify_Friendliness_To_Other(3, 0, 5); + if (Actor_Query_Friendliness_To_Other(3, 0) > 55 && !Global_Variable_Query(45)) { + Global_Variable_Set(45, 2); + Actor_Says(3, 1130, 17); + Actor_Says(0, 6365, 12); + Actor_Says(3, 1140, 14); + Actor_Says(0, 6370, 14); + Actor_Says(3, 1150, 12); + Actor_Says(3, 1160, 16); + } + Actor_Says(3, 1080, 13); + Actor_Says(0, 3875, 14); + Actor_Says(3, 1090, 17); + Music_Stop(4); + Actor_Set_Goal_Number(3, 260); + if (Global_Variable_Query(40) == 1) { + Actor_Set_Goal_Number(1, 236); + } + Game_Flag_Set(591); + } + } else { + if (Random_Query(1, 2) == 1) { + Actor_Says(0, 8575, 14); + } else { + Actor_Says(0, 8580, 14); + } + } + } + return true; + } + return false; +} + +bool SceneScriptNR11::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptNR11::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptNR11::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, 100.0f, 1.75f, -8.0f, 0, 1, false, 0)) { + Game_Flag_Set(477); + Set_Enter(59, 63); + return true; + } + } + return false; +} + +bool SceneScriptNR11::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptNR11::SceneFrameAdvanced(int frame) { + if (frame == 62) { + Ambient_Sounds_Play_Sound(449, 40, 100, 100, 10); + } + if (frame == 67) { + Ambient_Sounds_Play_Sound(449, 30, 90, 90, 10); + } + if (frame == 74) { + Ambient_Sounds_Play_Sound(450, 50, 83, 83, 10); + } + if (frame == 80) { + Ambient_Sounds_Play_Sound(449, 60, 65, 65, 10); + } + if (frame == 92) { + Ambient_Sounds_Play_Sound(450, 30, 50, 50, 10); + } + if (frame == 97) { + Ambient_Sounds_Play_Sound(449, 50, -40, -40, 10); + } + if (frame == 103) { + Ambient_Sounds_Play_Sound(450, 40, -27, -27, 10); + } + if (frame == 109) { + Ambient_Sounds_Play_Sound(449, 60, -20, -20, 10); + } + if (frame == 62) { + Ambient_Sounds_Play_Sound(122, 80, 100, 100, 15); + } + if (Game_Flag_Query(659)) { + Game_Flag_Reset(659); + Overlay_Remove("NR11OVER"); + Overlay_Play("NR11OVER", 1, 0, 1, 0); + } + if (Game_Flag_Query(635)) { + sub_4028EC(); + Player_Loses_Control(); + if (!Player_Query_Combat_Mode()) { + Player_Set_Combat_Mode(true); + } + Actor_Set_Goal_Number(0, 230); + Scene_Loop_Set_Default(3); + Scene_Loop_Start_Special(2, 2, 1); + Game_Flag_Reset(635); + } else { + if (frame < 61 || frame > 120) { + //return false; + return; + } + sub_4027D0(0, frame); + if (Actor_Query_Goal_Number(1) == 215) { + sub_4027D0(1, frame); + } + if (frame == 120) { + Actor_Set_Goal_Number(0, 0); + Player_Gains_Control(); + if (Actor_Query_Goal_Number(1) == 215) { + Actor_Set_Goal_Number(1, 216); + } + Actor_Set_Goal_Number(3, 269); + } + } + //return true; +} + +void SceneScriptNR11::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptNR11::PlayerWalkedIn() { + if (Actor_Query_Goal_Number(3) == 250) { + Player_Set_Combat_Mode(true); + if (Game_Flag_Query(47)) { + Actor_Set_Goal_Number(1, 210); + } + } + if (Game_Flag_Query(632)) { + Game_Flag_Reset(632); + Game_Flag_Set(634); + Actor_Put_In_Set(3, 99); + Actor_Set_At_Waypoint(3, 41, 0); + Actor_Set_Invisible(0, false); + Player_Set_Combat_Mode(false); + Player_Gains_Control(); + if (Game_Flag_Query(47)) { + if (Actor_Query_Goal_Number(1) == 211) { + Actor_Set_At_XYZ(0, -37.41f, 0.33f, -86.0f, 26); + Delay(500); + Actor_Face_Current_Camera(0, true); + Delay(750); + Actor_Says(0, 5290, 12); + Delay(1000); + Actor_Set_Goal_Number(1, 212); + Actor_Face_Actor(0, 1, true); + } else { + Actor_Set_At_XYZ(0, -15.53f, 0.33f, 73.49f, 954); + Actor_Modify_Friendliness_To_Other(1, 0, 3); + Delay(1500); + Actor_Says(0, 3805, 12); + Actor_Face_Actor(0, 1, true); + Actor_Face_Actor(1, 0, true); + Actor_Says_With_Pause(1, 1720, 0.3f, 16); + Actor_Says(0, 3810, 16); + Actor_Says_With_Pause(1, 1730, 0.2f, 14); + Actor_Says(1, 1740, 15); + Actor_Set_Goal_Number(3, 599); + Actor_Put_In_Set(3, 99); + Actor_Set_At_Waypoint(3, 41, 0); + Actor_Set_Goal_Number(1, 275); + } + } else { + Actor_Set_Goal_Number(0, 500); + } + } + // return true; +} + +void SceneScriptNR11::PlayerWalkedOut() { + +} + +void SceneScriptNR11::DialogueQueueFlushed(int a1) { +} + +void SceneScriptNR11::sub_4027D0(int actorId, signed int frame) { + float x; + float y; + float z; + float coef; + + if (frame < 80) { + coef = (frame - 60) / 20.0f; + x = -106.66f * coef + 126.0f; + y = 57.79f * coef + 0.85f; + z = 42.0f * coef + -151.0f; + } else { + coef = (frame - 80) / 40.0f; + x = -97.87f * coef + -150.0f; + y = -10.8f * coef + 52.0f; + z = 57.0f * coef + -232.0f; + } + Actor_Face_XYZ(actorId, x, y, z, true); +} + +void SceneScriptNR11::sub_4028EC() { + Un_Combat_Target_Object("CLOTHING02"); + Un_Combat_Target_Object("BOX27"); + Un_Combat_Target_Object("BOX39"); + Un_Combat_Target_Object("BOX44"); + Un_Combat_Target_Object("DRESS"); + Un_Combat_Target_Object("COATRACK"); + Un_Combat_Target_Object("COLUMN3 DETS"); + Un_Combat_Target_Object("COLUMN PIPE01"); + Un_Combat_Target_Object("RECTANGLE02"); + Un_Combat_Target_Object("COLUMN04"); + Un_Combat_Target_Object("COATRACK01"); + Un_Combat_Target_Object("SHIRT"); + Un_Combat_Target_Object("SKIRT 02"); + Un_Combat_Target_Object("CLOTHING B 03"); + Un_Combat_Target_Object("BUST BUST"); +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ps01.cpp b/engines/bladerunner/script/scene/ps01.cpp new file mode 100644 index 0000000000..e3c9e4d62f --- /dev/null +++ b/engines/bladerunner/script/scene/ps01.cpp @@ -0,0 +1,277 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptPS01::InitializeScene() { + Setup_Scene_Information(1872.0f, 16592.0f, -2975.0f, 200); + Scene_Exit_Add_2D_Exit(0, 36, 194, 138, 326, 0); + if (Game_Flag_Query(251)) { + Scene_Exit_Add_2D_Exit(1, 344, 288, 584, 384, 2); + } + Ambient_Sounds_Add_Looping_Sound(381, 100, 1, 1); + Ambient_Sounds_Add_Sound(68, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(69, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(375, 60, 180, 50, 100, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(376, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(377, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0); + if (Game_Flag_Query(130)) { + if (Game_Flag_Query(251)) { + Scene_Loop_Set_Default(1); + } else { + Scene_Loop_Set_Default(5); + } + } else { + Actor_Set_Invisible(0, true); + Game_Flag_Set(273); + Scene_Loop_Start_Special(0, 0, 0); + Scene_Loop_Set_Default(1); + Player_Loses_Control(); + } +} + +void SceneScriptPS01::SceneLoaded() { + Obstacle_Object("TUBE81", true); + if (Game_Flag_Query(251)) { + Unobstacle_Object("Barrier Obstacle", true); + } + Unobstacle_Object("BOX38", true); + Unobstacle_Object("TUBE81", true); +} + +bool SceneScriptPS01::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptPS01::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptPS01::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptPS01::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptPS01::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, 1920.0f, 16581.0f, -2653.0f, 12, 1, false, 0)) { + Game_Flag_Set(718); + Set_Enter(62, 66); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, 1877.9f, 16592.0f, -2975.0f, 0, 1, false, 0)) { + Actor_Set_At_XYZ(0, 1872.0f, 16592.0f, -2975.0f, 870); + Game_Flag_Reset(176); + Game_Flag_Reset(182); + Game_Flag_Reset(179); + Game_Flag_Reset(178); + Game_Flag_Reset(180); + Game_Flag_Reset(261); + Game_Flag_Reset(177); + Game_Flag_Reset(258); + int spinnerDest = Spinner_Interface_Choose_Dest(3, 1); + switch (spinnerDest) { + case 2: + Game_Flag_Set(182); + Game_Flag_Reset(251); + Game_Flag_Set(249); + Set_Enter(69, 78); + Scene_Loop_Start_Special(1, 4, 1); + break; + case 1: + Game_Flag_Set(179); + Game_Flag_Reset(251); + Game_Flag_Set(250); + Set_Enter(49, 48); + Scene_Loop_Start_Special(1, 4, 1); + break; + case 3: + Game_Flag_Set(176); + Game_Flag_Reset(251); + Game_Flag_Set(248); + Set_Enter(4, 13); + Scene_Loop_Start_Special(1, 4, 1); + break; + case 5: + Game_Flag_Set(261); + Game_Flag_Reset(251); + Game_Flag_Set(307); + Set_Enter(17, 82); + Scene_Loop_Start_Special(1, 4, 1); + break; + case 4: + Game_Flag_Set(180); + Game_Flag_Reset(251); + Game_Flag_Set(252); + Set_Enter(0, 0); + Scene_Loop_Start_Special(1, 4, 1); + break; + case 6: + Game_Flag_Set(177); + Game_Flag_Reset(251); + Game_Flag_Set(253); + Set_Enter(7, 25); + Scene_Loop_Start_Special(1, 4, 1); + break; + case 7: + Game_Flag_Set(258); + Game_Flag_Reset(251); + Game_Flag_Set(254); + Set_Enter(20, 2); + Scene_Loop_Start_Special(1, 4, 1); + break; + case 8: + Game_Flag_Set(181); + Game_Flag_Reset(251); + Game_Flag_Set(255); + Set_Enter(54, 54); + Scene_Loop_Start_Special(1, 4, 1); + break; + case 9: + Game_Flag_Set(257); + Game_Flag_Reset(251); + Game_Flag_Set(256); + Set_Enter(37, 34); + Scene_Loop_Start_Special(1, 4, 1); + break; + default: + Actor_Face_Heading(0, 870, false); + Game_Flag_Set(178); + Game_Flag_Set(273); + Player_Loses_Control(); + Scene_Loop_Start_Special(2, 3, 1); + break; + } + } + return true; + } + return false; +} + +bool SceneScriptPS01::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptPS01::SceneFrameAdvanced(int frame) { + if (frame == 71 || frame == 188) { + Sound_Play(116, 100, 40, 0, 50); + } + if (frame == 108 || frame == 228) { + Sound_Play(119, 100, 40, 0, 50); + } + if (frame == 1) { + Sound_Play(118, 40, 0, 0, 50); + } + if (frame == 76) { + Sound_Play(121, 50, 0, 0, 50); + } + if (frame == 192) { + Sound_Play(120, 50, 0, 0, 50); + } + if (frame == 59) { + Sound_Play(122, 15, 0, 0, 50); + } + if (frame == 275) { + Sound_Play(117, 40, 0, 0, 50); + } + if (!Game_Flag_Query(273)) { + switch (frame) { + case 196: + Actor_Face_Heading(0, 870, false); + Actor_Set_Frame_Rate_FPS(0, -1); + Actor_Change_Animation_Mode(0, 41); + break; + case 220: + Actor_Set_Frame_Rate_FPS(0, 0); + break; + case 240: + Actor_Set_Frame_Rate_FPS(0, -2); + break; + } + //return true; + return; + } + if (frame == 75) { + Actor_Face_Heading(0, 870, false); + Actor_Change_Animation_Mode(0, 42); + //return true; + return; + } + if (frame == 119) { + Game_Flag_Reset(273); + Player_Gains_Control(); + //return true; + return; + } + if (frame > 195) { + if (frame == 239) { + Game_Flag_Reset(273); + Player_Gains_Control(); + } + //return true; + return; + } + if (frame == 181) { + Actor_Face_Heading(0, 870, false); + Actor_Change_Animation_Mode(0, 42); + } else if (frame == 182) { + Actor_Set_Frame_Rate_FPS(0, 0); + } else if (frame == 195) { + Actor_Set_Frame_Rate_FPS(0, -2); + } + //return true; + return; +} + +void SceneScriptPS01::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptPS01::PlayerWalkedIn() { + if (Game_Flag_Query(130)) { + Actor_Set_At_XYZ(0, 1920.0f, 16581.0f, -2653.0f, 150); + Game_Flag_Reset(130); + } + //return false; +} + +void SceneScriptPS01::PlayerWalkedOut() { + Actor_Set_Invisible(0, false); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + if (!Game_Flag_Query(718) && Global_Variable_Query(1) == 1) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Outtake_Play(38, 1, -1); + } +} + +void SceneScriptPS01::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ps02.cpp b/engines/bladerunner/script/scene/ps02.cpp new file mode 100644 index 0000000000..84ae31d82c --- /dev/null +++ b/engines/bladerunner/script/scene/ps02.cpp @@ -0,0 +1,177 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptPS02::InitializeScene() { + Player_Loses_Control(); + Setup_Scene_Information(-13.31f, -40.28f, -48.12f, 30); + Scene_Exit_Add_2D_Exit(0, 0, 0, 240, 479, 3); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(0); + Ambient_Sounds_Add_Looping_Sound(386, 20, 1, 1); + Ambient_Sounds_Add_Looping_Sound(210, 20, 1, 1); + Ambient_Sounds_Add_Sound(0, 3, 20, 12, 16, 0, 0, -101, -101, 0, 0); + Scene_Loop_Start_Special(0, 0, 0); + Scene_Loop_Set_Default(1); +} + +void SceneScriptPS02::SceneLoaded() { + Obstacle_Object("E.DOOR01", true); + Obstacle_Object("E.DOOR02", true); + Clickable_Object("E.DOOR01"); + Clickable_Object("E.DOOR02"); +} + +bool SceneScriptPS02::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptPS02::ClickedOn3DObject(const char *objectName, bool a2) { + if (Object_Query_Click("E.DOOR01", objectName) || Object_Query_Click("E.D00R02", objectName)) { + if (Game_Flag_Query(130) ) { + if (!Loop_Actor_Walk_To_XYZ(0, -5.0f, -40.0f, -15.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Set_Enter(61, 65); + Scene_Loop_Start_Special(1, 3, 1); + } + } else if (Game_Flag_Query(22) ) { + if (!Loop_Actor_Walk_To_XYZ(0, -5.0f, -40.0f, -15.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Set_Enter(15, 69); + Scene_Loop_Start_Special(1, 3, 1); + } + } else if (Game_Flag_Query(131) ) { + if (!Loop_Actor_Walk_To_XYZ(0, -5.0f, -40.0f, -15.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Set_Enter(66, 71); + Scene_Loop_Start_Special(1, 3, 1); + } + } else if (Game_Flag_Query(132) ) { + if (!Loop_Actor_Walk_To_XYZ(0, -5.0f, -40.0f, -15.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Set_Enter(63, 67); + Scene_Loop_Start_Special(1, 3, 1); + } + } else if (Game_Flag_Query(133) && !Loop_Actor_Walk_To_XYZ(0, -5.0f, -40.0f, -15.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Set_Enter(67, 72); + Scene_Loop_Start_Special(1, 3, 1); + } + } + return false; +} + +bool SceneScriptPS02::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptPS02::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptPS02::ClickedOnExit(int exitId) { + return false; +} + +bool SceneScriptPS02::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptPS02::SceneFrameAdvanced(int frame) { + if (frame == 1) { + Ambient_Sounds_Play_Sound(208, 45, 0, 0, 0); + } + if (frame == 91) { + Ambient_Sounds_Play_Sound(209, 45, 0, 0, 0); + } + //return true; +} + +void SceneScriptPS02::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptPS02::PlayerWalkedIn() { + Game_Flag_Reset(718); + Actor_Face_XYZ(0, 0, 0, 450.0f, true); + Player_Gains_Control(); + sub_4018BC(); + Player_Loses_Control(); + if (Game_Flag_Query(130) ) { + Set_Enter(61, 65); + Scene_Loop_Start_Special(1, 3, 1); + } else if (Game_Flag_Query(22) ) { + Set_Enter(15, 69); + Scene_Loop_Start_Special(1, 3, 1); + } else if (Game_Flag_Query(131) ) { + Set_Enter(66, 71); + Scene_Loop_Start_Special(1, 3, 1); + } else if (Game_Flag_Query(132) ) { + Set_Enter(63, 67); + Scene_Loop_Start_Special(1, 3, 1); + } else if (Game_Flag_Query(133) ) { + Set_Enter(67, 72); + Scene_Loop_Start_Special(1, 3, 1); + } + //return true; +} + +void SceneScriptPS02::PlayerWalkedOut() { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Player_Gains_Control(); +} + +void SceneScriptPS02::DialogueQueueFlushed(int a1) { +} + +void SceneScriptPS02::sub_4018BC() { + Scene_Exits_Disable(); + switch (Elevator_Activate(2)) { + case 7: + Game_Flag_Set(133); + break; + case 6: + Game_Flag_Set(132); + break; + case 5: + Game_Flag_Set(22); + break; + case 4: + Game_Flag_Set(130); + break; + case 3: + Game_Flag_Set(131); + break; + default: + break; + } + Scene_Exits_Enable(); +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ps03.cpp b/engines/bladerunner/script/scene/ps03.cpp new file mode 100644 index 0000000000..347c52305b --- /dev/null +++ b/engines/bladerunner/script/scene/ps03.cpp @@ -0,0 +1,134 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptPS03::InitializeScene() { + if (Game_Flag_Query(39)) { + Actor_Set_At_XYZ(0, -674.0f, -354.0f, 550.0f, 900); + Setup_Scene_Information(-674.0f, -354.62f, 550.0f, 900); + Game_Flag_Reset(39); + } else if (Game_Flag_Query(135)) { + Setup_Scene_Information(-875.0f, -354.62f, -1241.0f, 450); + Game_Flag_Reset(135); + } else { + Setup_Scene_Information(-569.54f, -354.62f, -1076.15f, 475); + Game_Flag_Reset(132); + } + Scene_Exit_Add_2D_Exit(0, 0, 460, 639, 479, 2); + Scene_Exit_Add_2D_Exit(1, 449, 273, 508, 329, 0); + if (Global_Variable_Query(1) > 1) { + Scene_Exit_Add_2D_Exit(2, 358, 245, 411, 288, 0); + } + Ambient_Sounds_Remove_All_Non_Looping_Sounds(0); + Ambient_Sounds_Add_Looping_Sound(45, 35, 0, 1); + Ambient_Sounds_Add_Sound(90, 5, 50, 7, 7, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(91, 5, 50, 7, 7, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(92, 5, 60, 33, 33, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(93, 5, 60, 33, 33, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(94, 5, 60, 33, 33, -100, 100, -101, -101, 0, 0); + Scene_Loop_Set_Default(1); +} + +void SceneScriptPS03::SceneLoaded() { + Obstacle_Object("TABLE05", true); + Unclickable_Object("COP1PS03"); + Unclickable_Object("COP2PS03"); +} + +bool SceneScriptPS03::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptPS03::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptPS03::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptPS03::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptPS03::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -674.0f, -354.0f, 550.0f, 0, 1, false, 0)) { + Game_Flag_Set(42); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Set_Enter(64, 68); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -569.54f, -354.62f, -1076.15f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Set_Enter(62, 66); + Game_Flag_Reset(478); + if (Global_Variable_Query(1) < 4) { + Actor_Set_Goal_Number(4, 100); + } + } + return true; + } + if (exitId == 2) { + if (!Loop_Actor_Walk_To_XYZ(0, -875.0f, -354.0f, -1241.0f, 0, 1, false, 0)) { + Game_Flag_Set(134); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Set_Enter(68, 77); + } + return true; + } + return false; +} + +bool SceneScriptPS03::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptPS03::SceneFrameAdvanced(int frame) { +} + +void SceneScriptPS03::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptPS03::PlayerWalkedIn() { + if (!Game_Flag_Query(478)) { + Game_Flag_Set(478); + //return true; + } + //return false; +} + +void SceneScriptPS03::PlayerWalkedOut() { +} + +void SceneScriptPS03::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ps04.cpp b/engines/bladerunner/script/scene/ps04.cpp new file mode 100644 index 0000000000..65dea816b9 --- /dev/null +++ b/engines/bladerunner/script/scene/ps04.cpp @@ -0,0 +1,304 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptPS04::InitializeScene() { + AI_Movement_Track_Pause(4); + if (Game_Flag_Query(42)) { + Game_Flag_Reset(42); + } + Setup_Scene_Information(-668.0f, -354.0f, 974.0f, 475); + if (Global_Variable_Query(1) == 1) { + Actor_Put_In_Set(4, 64); + Actor_Set_At_XYZ(4, -728.0f, -354.0f, 1090.0f, 150); + Actor_Change_Animation_Mode(4, 53); + } + Scene_Exit_Add_2D_Exit(0, 347, 113, 469, 302, 0); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(0); + Ambient_Sounds_Add_Looping_Sound(45, 16, 1, 1); + Ambient_Sounds_Add_Looping_Sound(46, 50, 1, 1); + Ambient_Sounds_Add_Sound(47, 9, 40, 20, 20, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(48, 9, 40, 20, 20, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(49, 9, 40, 20, 20, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(50, 9, 40, 20, 20, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(51, 9, 40, 20, 20, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(52, 9, 40, 20, 20, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(53, 9, 40, 20, 20, 0, 0, -101, -101, 0, 0); + Scene_Loop_Start_Special(0, 0, 0); + Scene_Loop_Set_Default(1); +} + +void SceneScriptPS04::SceneLoaded() { + Obstacle_Object("CHAIR07", true); + Unobstacle_Object("GOOD B.WALL", true); + Unobstacle_Object("B.DOOR", true); + Unobstacle_Object("B.CHAIR01", true); + Unclickable_Object("CHAIR07"); + if (Global_Variable_Query(1) == 2 && !Actor_Clue_Query(0, 80) && !Game_Flag_Query(727)) { + Item_Add_To_World(111, 958, 64, -643.5f, -318.82f, 1148.87f, 525, 16, 12, false, true, false, true); + Game_Flag_Set(727); + } + if (Actor_Query_Is_In_Current_Set(4)) { + Actor_Change_Animation_Mode(4, 53); + } +} + +bool SceneScriptPS04::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptPS04::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptPS04::ClickedOnActor(int actorId) { + if (actorId == 4) { + if (!Loop_Actor_Walk_To_Actor(0, 4, 36, 1, false)) { + Actor_Face_Actor(0, 4, true); + Actor_Face_Actor(4, 0, true); + sub_4017E4(); + return true; + } + } + return false; +} + +bool SceneScriptPS04::ClickedOnItem(int itemId, bool a2) { + if (itemId == 111 && Actor_Query_Is_In_Current_Set(4)) { + Actor_Says(4, 560, 30); + } else if (!Actor_Clue_Query(0, 80)) { + Item_Remove_From_World(111); + Item_Pickup_Spin_Effect(958, 464, 362); + Actor_Says(0, 4485, 3); + Actor_Clue_Acquire(0, 80, 1, 0); + } + return false; +} + +bool SceneScriptPS04::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -668.0f, -350.85f, 962.0f, 0, 1, false, 0)) { + Game_Flag_Set(39); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Set_Enter(63, 67); + } + return true; + } + return false; +} + +bool SceneScriptPS04::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptPS04::SceneFrameAdvanced(int frame) { +} + +void SceneScriptPS04::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptPS04::PlayerWalkedIn() { + if (Actor_Query_Which_Set_In(4) == 64) { + Actor_Face_Actor(0, 4, true); + } + //return false; +} + +void SceneScriptPS04::PlayerWalkedOut() { + AI_Movement_Track_Unpause(4); +} + +void SceneScriptPS04::DialogueQueueFlushed(int a1) { +} + +void SceneScriptPS04::sub_4017E4() { + Dialogue_Menu_Clear_List(); + if (Global_Variable_Query(1) > 1) { + if (Actor_Clue_Query(0, 51)) { + DM_Add_To_List_Never_Repeat_Once_Selected(110, 5, 7, 4); + } + DM_Add_To_List_Never_Repeat_Once_Selected(120, 1, -1, -1); + if (Actor_Clue_Query(0, 110)) { + DM_Add_To_List_Never_Repeat_Once_Selected(150, 7, 6, 5); + } + } + if (Game_Flag_Query(169) == 1) { + DM_Add_To_List_Never_Repeat_Once_Selected(140, 3, -1, -1); + } + DM_Add_To_List(130, 1, 1, 1); + Dialogue_Menu_Add_DONE_To_List(160); + Dialogue_Menu_Appear(320, 240); + int answer = Dialogue_Menu_Query_Input(); + Dialogue_Menu_Disappear(); + switch (answer) { + case 130: + if (Game_Flag_Query(40) && !Game_Flag_Query(159)) { + Actor_Says(0, 3920, 13); + Actor_Says(4, 140, 30); + Actor_Face_Current_Camera(4, true); + Actor_Says(4, 150, 31); + Actor_Says(4, 160, 32); + Actor_Says(0, 3925, 18); + Actor_Face_Actor(4, 0, true); + Actor_Says(4, 170, 33); + Loop_Actor_Walk_To_XYZ(0, -716.0f, -354.85f, 1042.0f, 0, 0, false, 0); + Actor_Face_Actor(0, 4, true); + Actor_Says(0, 3930, 13); + Actor_Face_Actor(4, 0, true); + Actor_Says(4, 180, 34); + Actor_Says(0, 3935, 13); + Actor_Says(4, 190, 30); + Actor_Says(0, 3940, 16); + Actor_Says(4, 200, 31); + Actor_Says(4, 210, 33); + Actor_Says(4, 220, 34); + Actor_Says(0, 3945, 17); + Actor_Says(4, 230, 32); + Actor_Says(4, 240, 31); + Actor_Says(0, 3950, 13); + Actor_Says(4, 250, 34); + Actor_Says(4, 260, 33); + Actor_Says(4, 270, 32); + Game_Flag_Set(159); + if (Query_Difficulty_Level() != 0) { + Global_Variable_Increment(2, 200); + } + Game_Flag_Set(723); + } else if (Game_Flag_Query(41) && !Game_Flag_Query(160)) { + Actor_Says(0, 3955, 13); + Actor_Says(4, 280, 30); + Actor_Says(0, 3960, 18); + Actor_Says(4, 290, 32); + Actor_Says(4, 300, 31); + Actor_Says(0, 3965, 13); + Actor_Says(4, 310, 33); + Actor_Says(4, 320, 34); + Game_Flag_Set(160); + } else if ((Actor_Clue_Query(0, 8) || Actor_Clue_Query(0, 9)) && Actor_Clue_Query(0, 22) && Actor_Query_Friendliness_To_Other(4, 0) < 50 && !Game_Flag_Query(161)) { + Actor_Says(0, 3970, 18); + Actor_Says(4, 330, 30); + Actor_Says(4, 340, 32); + Actor_Says(0, 3975, 13); + Actor_Says(4, 350, 31); + Actor_Says(4, 360, 34); + Actor_Says(0, 3980, 13); + Actor_Says(4, 370, 33); + Actor_Says(4, 380, 32); + Actor_Says(4, 390, 31); + Actor_Says(0, 3985, 18); + Actor_Says(4, 400, 34); + Actor_Says(4, 410, 31); + Game_Flag_Set(161); + } else if ((Actor_Clue_Query(0, 8) || Actor_Clue_Query(0, 9)) + && Actor_Clue_Query(0, 22) + && !Game_Flag_Query(162)) { + Actor_Says(0, 3920, 13); + Actor_Says(4, 570, 32); + Actor_Says(0, 4070, 13); + Game_Flag_Set(162); + } else if (Actor_Query_Friendliness_To_Other(4, 0) >= 50) { + Actor_Says(0, 4020, 13); + Actor_Says(4, 580, 34); + Actor_Says(0, 4075, 16); + Actor_Says(4, 590, 33); + } else { + Actor_Says(0, 4020, 18); + Actor_Says(4, 130, 30); + Actor_Face_Current_Camera(4, true); + Actor_Says(0, 3915, 13); + } + break; + case 110: + Actor_Says(0, 3990, 19); + Actor_Says(0, 3995, 17); + Actor_Says(4, 440, 31); + Actor_Says(0, 4035, 13); + Actor_Says(4, 450, 34); + Actor_Says(4, 460, 33); + Actor_Says(0, 4040, 17); + Game_Flag_Set(625); + break; + case 120: + Actor_Says(0, 4000, 18); + Actor_Clue_Acquire(0, 82, 1, 4); + Actor_Says(4, 520, 33); + Actor_Says(0, 4055, 13); + Actor_Says(4, 530, 31); + Actor_Says(0, 4060, 13); + Actor_Says(4, 540, 31); + Actor_Says(4, 550, 32); + Actor_Says(0, 4065, 18); + Actor_Says(4, 560, 34); + if (Query_Difficulty_Level() != 0) { + Global_Variable_Increment(2, 100); + } + break; + case 140: + Actor_Says(0, 4010, 12); + Actor_Says(4, 600, 31); + Actor_Says(0, 4080, 18); + Actor_Says(4, 610, 33); + Actor_Face_Heading(4, 400, false); + Actor_Says(4, 620, 32); + Actor_Face_Actor(4, 0, true); + Actor_Says(4, 700, 34); + Actor_Says(0, 4100, 13); + Actor_Says(4, 710, 31); + Actor_Says(4, 720, 34); + Actor_Says(0, 4105, 18); + Loop_Actor_Walk_To_XYZ(0, -668.0f, -350.85f, 962.0f, 0, 0, false, 0); + Actor_Says(4, 730, 32); + Actor_Face_Actor(0, 4, true); + Loop_Actor_Walk_To_XYZ(0, -716.0f, -354.85f, 1042.0f, 0, 0, false, 0); + Actor_Face_Actor(4, 0, true); + Actor_Says(4, 740, 31); + Actor_Says(4, 750, 32); + Actor_Says(4, 760, 33); + Actor_Face_Actor(0, 4, true); + Actor_Says(0, 4110, 13); + Actor_Says(4, 770, 32); + Actor_Says(4, 780, 31); + break; + case 150: + Actor_Says(0, 4015, 16); + Actor_Says(4, 630, 34); + Actor_Says(0, 4085, 19); + Actor_Says(0, 4090, 18); + Actor_Says(4, 640, 31); + Actor_Says(4, 650, 32); + Actor_Says(4, 670, 34); + Actor_Says(0, 4095, 17); + Actor_Says(4, 680, 32); + Actor_Says(4, 690, 31); + break; + default: + //TODO: what is this for? + //answer != 160; + break; + } +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ps05.cpp b/engines/bladerunner/script/scene/ps05.cpp new file mode 100644 index 0000000000..97778f6f5f --- /dev/null +++ b/engines/bladerunner/script/scene/ps05.cpp @@ -0,0 +1,273 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptPS05::InitializeScene() { + if (Game_Flag_Query(21)) { + Setup_Scene_Information(547.59f, 0.18f, -216.84f, 334); + } else if (Game_Flag_Query(22)) { + Setup_Scene_Information(635.0f, 0.0f, -598.0f, 475); + } else { + Setup_Scene_Information(630.72f, 0.38f, -469.26f, 400); + } + Scene_Exit_Add_2D_Exit(0, 218, 98, 280, 246, 3); + Scene_Exit_Add_2D_Exit(1, 330, 90, 436, 198, 0); + Scene_Exit_Add_2D_Exit(2, 476, 96, 524, 240, 1); + Scene_2D_Region_Add(0, 519, 107, 537, 122); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(0); + Ambient_Sounds_Add_Looping_Sound(384, 50, 1, 1); + Ambient_Sounds_Add_Looping_Sound(141, 80, 0, 1); + Ambient_Sounds_Add_Sound(385, 5, 50, 8, 8, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(156, 5, 20, 30, 30, -70, 70, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(157, 5, 20, 30, 30, -70, 70, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(158, 5, 20, 30, 30, -70, 70, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(73, 5, 20, 5, 9, -70, 70, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(74, 5, 20, 5, 9, -70, 70, -101, -101, 0, 0); +} + +void SceneScriptPS05::SceneLoaded() { + Obstacle_Object("WATER FOUNTAIN", true); + Clickable_Object("WATER FOUNTAIN"); + Clickable_Object("ASHTRAY"); + Clickable_Object("FIRE EXTINGISHER"); + Clickable_Object("CUP"); + Clickable_Object("WIRE BASKET"); + Clickable_Object("WANTED POSTERS"); + Unclickable_Object("WATER FOUNTAIN"); + Unclickable_Object("CUP"); +} + +bool SceneScriptPS05::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptPS05::ClickedOn3DObject(const char *objectName, bool a2) { + if (Object_Query_Click("WATER FOUNTAIN", objectName) && !Loop_Actor_Walk_To_Scene_Object(0, "WATER FOUNTAIN", 12, 1, false)) { + Actor_Face_Object(0, "WATER FOUNTAIN", true); + Actor_Says(0, 3490, 18); + } + if (Object_Query_Click("ASHTRAY", objectName) && !Loop_Actor_Walk_To_XYZ(0, 662.0f, 0.37f, -180.0f, 0, 1, false, 0)) { + Actor_Face_Object(0, "ASHTRAY", true); + Actor_Voice_Over(1770, 99); + Actor_Voice_Over(1780, 99); + Actor_Voice_Over(1790, 99); + } + if (Object_Query_Click("WIRE BASKET", objectName) && !Loop_Actor_Walk_To_Scene_Object(0, "WIRE BASKET", 12, 1, false)) { + Actor_Face_Object(0, "WIRE BASKET", true); + Actor_Voice_Over(1810, 99); + Actor_Voice_Over(1820, 99); + } + if (Object_Query_Click("WANTED POSTERS", objectName) && !Loop_Actor_Walk_To_Scene_Object(0, "WANTED POSTERS", 12, 1, false)) { + Actor_Face_Object(0, "WANTED POSTERS", true); + Actor_Voice_Over(1800, 99); + } + return false; +} + +bool SceneScriptPS05::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptPS05::ClickedOnItem(int itemId, bool a2) { + if (Game_Flag_Query(23)) { + Actor_Set_At_XYZ(0, 718.72f, 0.37f, -461.26f, 600); + } else if (Game_Flag_Query(22)) { + sub_401B34(); + sub_401C30(); + } + Game_Flag_Reset(22); + Game_Flag_Reset(23); + Game_Flag_Reset(21); + Game_Flag_Reset(204); + return false; +} + +bool SceneScriptPS05::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_Waypoint(0, 2, 24, 1, false)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Set_Enter(101, 119); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, 635.0f, 0.0f, -598.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Set_Enter(62, 66); + } + return true; + } + if (exitId == 2) { + if (!Loop_Actor_Walk_To_XYZ(0, 742.52002f, 0.37f, -457.69f, 0, 1, false, 0)) { + Game_Flag_Set(136); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Set_Enter(65, 70); + } + return true; + } + return false; +} + +bool SceneScriptPS05::ClickedOn2DRegion(int region) { + if (region == 0 && !Loop_Actor_Walk_To_XYZ(0, 694.78f, 0.37f, -321.05f, 0, 1, false, 0)) { + Actor_Face_Heading(0, 130, false); + View_Score_Board(); + } + return false; +} + +void SceneScriptPS05::SceneFrameAdvanced(int frame) { + if (frame == 1 || frame == 16 || frame == 31 || frame == 46) { + Sound_Play(149, Random_Query(10, 10), 70, 70, 50); + } + //return true; +} + +void SceneScriptPS05::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptPS05::PlayerWalkedIn() { +} + +void SceneScriptPS05::PlayerWalkedOut() { +} + +void SceneScriptPS05::DialogueQueueFlushed(int a1) { + Overlay_Remove("PS05OVER"); +} + +void SceneScriptPS05::sub_401B34() { + int v0; + int v1; + int v3[7]; + + v0 = 0; + if (Global_Variable_Query(1) < 4 && Game_Flag_Query(45)) { + v0 = 1; + v3[0] = 0; + } + v1 = v0 + 1; + v3[v0] = 1; + if (Global_Variable_Query(1) >= 3) { + v3[v1] = 2; + v1 = v0 + 2; + } + if (Global_Variable_Query(1) >= 2 && Global_Variable_Query(1) <= 4) { + v3[v1++] = 3; + } + if (Game_Flag_Query(171) && Game_Flag_Query(170)) { + v3[v1++] = 4; + } + if (v1 <= 0) { + Global_Variable_Set(52, -1); + } else { + Global_Variable_Set(52, v3[Random_Query(0, v1 - 1)]); + } +} + +void SceneScriptPS05::sub_401C30() { + switch (Global_Variable_Query(52)) { + case 4: + if (!Game_Flag_Query(692)) { + Overlay_Play("PS05OVER", 0, 1, 0, 0); + ADQ_Add(61, 230, 3); + ADQ_Add(61, 240, 3); + Game_Flag_Set(692); + } + break; + case 3: + if (!Game_Flag_Query(691)) { + Overlay_Play("PS05OVER", 0, 1, 0, 0); + ADQ_Add(61, 170, 3); + ADQ_Add(61, 180, 3); + ADQ_Add(61, 190, 3); + ADQ_Add(61, 200, 3); + ADQ_Add(61, 210, 3); + ADQ_Add(61, 220, 3); + ADQ_Add(41, 80, 3); + ADQ_Add(41, 90, 3); + ADQ_Add(41, 100, 3); + ADQ_Add(41, 110, 3); + ADQ_Add(41, 120, 3); + ADQ_Add(41, 130, 3); + Game_Flag_Set(691); + } + break; + case 2: + if (!Game_Flag_Query(690)) { + Overlay_Play("PS05OVER", 0, 1, 0, 0); + if (Actor_Query_Friendliness_To_Other(5, 0) > Actor_Query_Friendliness_To_Other(1, 0)) { + ADQ_Add(61, 120, 3); + ADQ_Add(61, 130, 3); + ADQ_Add(61, 140, 3); + ADQ_Add(61, 150, 3); + ADQ_Add(4, 1570, 3); + ADQ_Add(4, 1580, 3); + ADQ_Add(4, 1590, 3); + } else { + ADQ_Add(61, 90, 3); + ADQ_Add(61, 100, 3); + ADQ_Add(61, 110, 3); + ADQ_Add(4, 1540, 3); + ADQ_Add(4, 1550, 3); + ADQ_Add(4, 1560, 3); + } + Game_Flag_Set(690); + } + break; + case 1: + if (!Game_Flag_Query(689)) { + Overlay_Play("PS05OVER", 0, 1, 0, 0); + ADQ_Add(61, 40, 3); + ADQ_Add(61, 50, 3); + ADQ_Add(61, 60, 3); + ADQ_Add(61, 70, 3); + ADQ_Add(61, 80, 3); + Game_Flag_Set(689); + } + break; + case 0: + if (!Game_Flag_Query(688)) { + Overlay_Play("PS05OVER", 0, 1, 0, 0); + ADQ_Add(61, 0, 3); + ADQ_Add(61, 10, 3); + ADQ_Add(61, 20, 3); + ADQ_Add(61, 30, 3); + ADQ_Add(51, 430, 3); + ADQ_Add(51, 440, 3); + ADQ_Add(51, 450, 3); + ADQ_Add(51, 460, 3); + Game_Flag_Set(688); + } + break; + default: + return; + } +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ps06.cpp b/engines/bladerunner/script/scene/ps06.cpp new file mode 100644 index 0000000000..fdb5e9b109 --- /dev/null +++ b/engines/bladerunner/script/scene/ps06.cpp @@ -0,0 +1,137 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptPS06::InitializeScene() { + Setup_Scene_Information(11257.26f, 707.3f, -4778.31f, 120); + Scene_Exit_Add_2D_Exit(0, 610, 0, 639, 479, 1); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(0); + Ambient_Sounds_Add_Looping_Sound(388, 50, 1, 1); + +} + +void SceneScriptPS06::SceneLoaded() { + Obstacle_Object("E.SCREEN02", true); + Clickable_Object("E.SCREEN02"); + Clickable_Object("E.MONITOR1"); + Clickable_Object("E.SCREEN03"); + Clickable_Object("E.MONITOR3"); +} + +bool SceneScriptPS06::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptPS06::ClickedOn3DObject(const char *objectName, bool a2) { + if (Object_Query_Click("E.MONITOR1", objectName)) { + ESPER_Flag_To_Activate(); + return true; + } + if (Object_Query_Click("E.SCREEN03", objectName) || Object_Query_Click("E.MONITOR3", objectName)) { + Actor_Says(39, 330, 3); + if (!Actor_Clue_Query(0, 111) || Actor_Clue_Query(0, 113) || Actor_Clue_Query(0, 114) || Actor_Clue_Query(0, 115)) { + Actor_Clues_Transfer_New_To_Mainframe(0); + Ambient_Sounds_Play_Sound(587, 50, 0, 0, 99); + Delay(2000); + Actor_Says(39, 340, 3); + Actor_Clues_Transfer_New_From_Mainframe(0); + Ambient_Sounds_Play_Sound(587, 50, 0, 0, 99); + Delay(2000); + Ambient_Sounds_Play_Sound(588, 80, 0, 0, 99); + Actor_Says(39, 350, 3); + return true; + } else { + Delay(2000); + Actor_Voice_Over(3780, 99); + Actor_Voice_Over(3790, 99); + if (Game_Flag_Query(47)) { + Actor_Voice_Over(3800, 99); + Actor_Voice_Over(3810, 99); + Actor_Voice_Over(3820, 99); + Actor_Voice_Over(3830, 99); + Actor_Clue_Acquire(0, 113, 1, -1); + } else if (Game_Flag_Query(45)) { + Actor_Voice_Over(3840, 99); + Actor_Voice_Over(3850, 99); + Actor_Voice_Over(3860, 99); + Actor_Voice_Over(3870, 99); + Actor_Clue_Acquire(0, 114, 1, -1); + } else { + Actor_Voice_Over(3880, 99); + Actor_Voice_Over(3890, 99); + Actor_Voice_Over(3900, 99); + Actor_Voice_Over(3910, 99); + Actor_Clue_Acquire(0, 115, 1, -1); + } + Actor_Clues_Transfer_New_To_Mainframe(0); + Actor_Clues_Transfer_New_From_Mainframe(0); + return true; + } + } + return false; +} + +bool SceneScriptPS06::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptPS06::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptPS06::ClickedOnExit(int exitId) { + if (exitId == 0) { + Game_Flag_Set(23); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Set_Enter(15, 69); + return true; + } + return false; +} + +bool SceneScriptPS06::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptPS06::SceneFrameAdvanced(int frame) { +} + +void SceneScriptPS06::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptPS06::PlayerWalkedIn() { + if (Game_Flag_Query(136)) { + Game_Flag_Reset(136); + } +} + +void SceneScriptPS06::PlayerWalkedOut() { +} + +void SceneScriptPS06::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ps07.cpp b/engines/bladerunner/script/scene/ps07.cpp new file mode 100644 index 0000000000..c67ccaf658 --- /dev/null +++ b/engines/bladerunner/script/scene/ps07.cpp @@ -0,0 +1,189 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptPS07::InitializeScene() { + Setup_Scene_Information(609.07f, 0.22f, -598.67f, 768); + Scene_Exit_Add_2D_Exit(0, 610, 0, 639, 479, 1); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(0); + Ambient_Sounds_Add_Looping_Sound(141, 80, 0, 1); + Ambient_Sounds_Add_Sound(142, 5, 20, 5, 10, -70, 70, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(146, 5, 30, 5, 10, -70, 70, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(147, 2, 20, 5, 10, -70, 70, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(148, 2, 10, 10, 20, -70, 70, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(149, 2, 10, 10, 20, -70, 70, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(150, 2, 10, 10, 20, -70, 70, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(151, 2, 10, 10, 20, -70, 70, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(152, 2, 30, 10, 15, -70, 70, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(153, 2, 20, 10, 15, -70, 70, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(154, 5, 20, 10, 15, -70, 70, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(145, 5, 30, 5, 8, -100, 100, -101, -101, 0, 0); +} + +void SceneScriptPS07::SceneLoaded() { + Obstacle_Object("RICE BOX01", true); + Unobstacle_Object("RICE BOX01", true); +} + +bool SceneScriptPS07::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptPS07::ClickedOn3DObject(const char *objectName, bool a2) { + if (Object_Query_Click("L.MOUSE", objectName)) { + Sound_Play(155, 70, 0, 0, 50); + if (Actor_Query_Goal_Number(30) < 4 && Actor_Query_Goal_Number(30) > 0) { + Actor_Face_Actor(0, 30, true); + Actor_Set_Goal_Number(30, 3); + Actor_Modify_Friendliness_To_Other(30, 0, -3); + } + return true; + } + return false; +} + +bool SceneScriptPS07::ClickedOnActor(int actorId) { + if (actorId == 30) { + Actor_Face_Actor(0, 30, true); + Actor_Set_Goal_Number(30, 3); + if (!Game_Flag_Query(111)) { + Actor_Says(0, 4115, 13); + } + if (!Game_Flag_Query(111) && (Game_Flag_Query(125) || Game_Flag_Query(126) || Game_Flag_Query(127) || Game_Flag_Query(128))) { + Actor_Face_Actor(30, 0, true); + Actor_Says(30, 30, 12); + Game_Flag_Set(111); + } else { + if (Game_Flag_Query(111)) { + Actor_Says(0, 4130, 18); + } + } + if (Game_Flag_Query(125) && !Game_Flag_Query(12)) { + Game_Flag_Set(12); + Actor_Clue_Acquire(0, 11, 0, 30); + Actor_Says(30, 50, 16); + Actor_Says(0, 4135, 13); + Actor_Says(30, 60, 15); + Actor_Says(30, 70, 12); + Actor_Says(0, 4140, 18); + Actor_Says(30, 80, 14); + Actor_Says(30, 90, 14); + Actor_Set_Goal_Number(30, 1); + return true; + } + if (Game_Flag_Query(126) && !Game_Flag_Query(13)) { + Game_Flag_Set(13); + Actor_Clue_Acquire(0, 10, 0, 30); + sub_401D60(); + Actor_Set_Goal_Number(30, 1); + return true; + } + if (Game_Flag_Query(127) && !Game_Flag_Query(104)) { + Game_Flag_Set(104); + Actor_Clue_Acquire(0, 39, 0, 30); + Actor_Says(30, 170, 14); + Actor_Says(0, 4180, 13); + Actor_Says(30, 180, 12); + Actor_Says(30, 190, 13); + Actor_Says(30, 200, 16); + Actor_Says(0, 4185, 18); + Actor_Says(30, 210, 12); + Actor_Modify_Friendliness_To_Other(30, 0, -12); + Actor_Set_Goal_Number(30, 1); + return true; + } + if (Game_Flag_Query(128) && !Game_Flag_Query(105)) { + Game_Flag_Set(105); + Actor_Says(30, 220, 12); + Actor_Says(0, 4190, 13); + Actor_Says(30, 230, 14); + Actor_Set_Goal_Number(30, 1); + return true; + } + Actor_Says(30, 0, 13); + Actor_Set_Goal_Number(30, 1); + return true; + } + return false; + +} + +bool SceneScriptPS07::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptPS07::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, 609.07f, 0.22f, -598.67f, 0, 0, false, 0)) { + Set_Enter(62, 66); + } + return true; + } + return false; +} + +bool SceneScriptPS07::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptPS07::SceneFrameAdvanced(int frame) { +} + +void SceneScriptPS07::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptPS07::PlayerWalkedIn() { + Loop_Actor_Walk_To_XYZ(0, 561.07f, 0.34f, -606.67f, 6, 0, false, 0); + Game_Flag_Reset(131); + //return false; +} + +void SceneScriptPS07::PlayerWalkedOut() { + if (!Game_Flag_Query(138) && Global_Variable_Query(1) == 1) { + Actor_Set_Goal_Number(30, 0); + } +} + +void SceneScriptPS07::DialogueQueueFlushed(int a1) { +} + +void SceneScriptPS07::sub_401D60() { + Actor_Says(30, 100, 13); + Actor_Says(0, 4145, 13); + Actor_Says(30, 110, 12); + Actor_Says(0, 4150, 13); + Actor_Says(30, 120, 14); + Actor_Says(0, 4155, 17); + Actor_Says(30, 130, 15); + Actor_Says(0, 4160, 13); + Actor_Says(30, 140, 16); + Actor_Says(0, 4165, 18); + Actor_Says(30, 160, 13); + Actor_Says(0, 4170, 19); + Actor_Says(0, 4175, 19); + Actor_Modify_Friendliness_To_Other(30, 0, 3); +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ps09.cpp b/engines/bladerunner/script/scene/ps09.cpp new file mode 100644 index 0000000000..fa28841a47 --- /dev/null +++ b/engines/bladerunner/script/scene/ps09.cpp @@ -0,0 +1,354 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptPS09::InitializeScene() { + if (Game_Flag_Query(465)) { + Setup_Scene_Information(-410.0f, 0.26f, -200.0f, 512); + } else { + Setup_Scene_Information(-559.0f, 0.0f, -85.06f, 250); + } + Scene_Exit_Add_2D_Exit(0, 0, 0, 30, 479, 3); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(0); + Ambient_Sounds_Add_Looping_Sound(138, 50, 0, 0); + Ambient_Sounds_Add_Looping_Sound(137, 30, 0, 0); + Ambient_Sounds_Add_Looping_Sound(124, 30, 0, 0); + Ambient_Sounds_Add_Sound(125, 15, 60, 7, 10, 100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(126, 25, 60, 7, 10, 100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(127, 25, 60, 7, 10, 100, 100, -101, -101, 0, 0); + if (!Game_Flag_Query(55)) { + Actor_Put_In_Set(11, 67); + Actor_Set_At_XYZ(11, -417.88f, 0.0f, -200.74f, 512); + Game_Flag_Set(55); + } + if (Game_Flag_Query(465)) { + Actor_Put_In_Set(11, 94); + Actor_Set_At_XYZ(11, 0.0f, 0.0f, 0.0f, 512); + } + if (Game_Flag_Query(164) ) { + Actor_Put_In_Set(7, 67); + Actor_Set_At_XYZ(7, -476.0f, 0.2f, -225.0f, 518); + } + if (Game_Flag_Query(165) ) { + Actor_Put_In_Set(9, 67); + Actor_Set_At_XYZ(9, -290.0f, 0.33f, -235.0f, 207); + } +} + +void SceneScriptPS09::SceneLoaded() { + Obstacle_Object("OFFICE DOOR", true); + Unobstacle_Object("OFFICE DOOR", true); + Unclickable_Object("OFFICE DOOR"); +} + +bool SceneScriptPS09::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptPS09::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptPS09::ClickedOnActor(int actorId) { + if (actorId == 11 && !Loop_Actor_Walk_To_XYZ(0, -381.11f, 0.0f, -135.55f, 0, 1, false, 0)) { + Actor_Face_Actor(0, 11, true); + Actor_Face_Actor(11, 0, true); + if (!Game_Flag_Query(49)) { + Actor_Says(11, 0, 12); + Actor_Says(0, 4235, 18); + Actor_Says(11, 10, 13); + Game_Flag_Set(49); + return true; + } + if (Game_Flag_Query(49) && !Game_Flag_Query(54) && !Actor_Clue_Query(0, 179) && !Actor_Clue_Query(0, 180) && !Actor_Clue_Query(0, 181)) { + Actor_Says(0, 4245, 14); + Actor_Says(11, 20, 14); + Game_Flag_Set(54); + return true; + } + if ((!Game_Flag_Query(53) && Game_Flag_Query(49) && Actor_Clue_Query(0, 179) ) || Actor_Clue_Query(0, 180) || Actor_Clue_Query(0, 181) || Actor_Clue_Query(0, 99) ) { + Game_Flag_Set(53); + Actor_Says(0, 4240, 13); + Actor_Says(11, 550, 15); + Actor_Says(11, 480, 16); + sub_402090(); + return true; + } + if (Game_Flag_Query(51) ) { + Actor_Says(0, 4270, 18); + Actor_Says(11, 30, 14); + Actor_Says(11, 40, 13); + return true; + } + if (Game_Flag_Query(53) && Game_Flag_Query(49) && (Actor_Clue_Query(0, 179) || Actor_Clue_Query(0, 180) || Actor_Clue_Query(0, 99) )) { + sub_402090(); + return true; + } + Actor_Says(0, 4270, 18); + Actor_Says(11, 30, 14); + Actor_Says(11, 40, 13); + return true; + } + if (actorId == 7 && !Loop_Actor_Walk_To_XYZ(0, -473.0f, 0.2f, -133.0f, 12, 1, false, 0)) { + Actor_Face_Actor(0, 7, true); + Actor_Face_Actor(7, 0, true); + if (!Game_Flag_Query(167)) { + Actor_Says(0, 4200, 14); + Actor_Says(7, 570, 3); + Actor_Says(0, 4205, 18); + Game_Flag_Set(167); + return true; + } + if (Game_Flag_Query(167) && !Game_Flag_Query(168)) { + Actor_Says(0, 4210, 18); + Actor_Says(7, 580, 3); + Actor_Says(0, 4215, 14); + Actor_Says(7, 590, 3); + Actor_Says(7, 600, 3); + Actor_Says(0, 4220, 18); + Actor_Says(7, 610, 3); + Actor_Says(0, 4225, 19); + Actor_Says(7, 620, 3); + Actor_Says(0, 4230, 14); + Game_Flag_Set(168); + return true; + } + Actor_Says(0, 4200, 13); + } + if (actorId == 9 && !Loop_Actor_Walk_To_XYZ(0, -295.0f, 0.34f, -193.0f, 12, 1, false, 0)) { + Actor_Face_Actor(0, 9, true); + Actor_Face_Actor(9, 0, true); + //TODO: cleanup + if (Game_Flag_Query(166) || (Actor_Says(0, 4415, 18) , Actor_Says(9, 1090, 3) , Actor_Says(0, 4420, 18) , Game_Flag_Set(166) , Game_Flag_Query(166) != 1) || Game_Flag_Query(55) != 1 || Game_Flag_Query(56)) { + if (!Game_Flag_Query(166) || Game_Flag_Query(55) || Game_Flag_Query(175)) { + Actor_Says(0, 4425, 18); + Actor_Says(9, 1160, 3); + return true; + } else { + Actor_Says(0, 4425, 18); + Actor_Says(9, 1100, 3); + Actor_Says(0, 4430, 19); + Actor_Says(9, 1110, 3); + Game_Flag_Set(175); + return true; + } + } else { + Actor_Face_Actor(11, 9, true); + Actor_Says(11, 420, 14); + Actor_Face_Actor(9, 11, true); + Actor_Says(9, 1120, 3); + Actor_Face_Actor(0, 11, true); + Actor_Says(0, 4435, 14); + Actor_Says(11, 430, 16); + Actor_Says(9, 1130, 3); + Game_Flag_Set(56); + return true; + } + } + return false; +} + +bool SceneScriptPS09::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptPS09::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -559.15f, 0.0f, -85.06f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Set_Enter(62, 66); + Game_Flag_Reset(211); + } + return true; + } + return false; +} + +bool SceneScriptPS09::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptPS09::SceneFrameAdvanced(int frame) { + if (frame == 1 || frame == 15 || frame == 20 || frame == 31 || frame == 33 || frame == 35 || frame == 52 || frame == 54) { + Sound_Play(97, Random_Query(50, 33), 10, 10, 50); + } + //return true; +} + +void SceneScriptPS09::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptPS09::PlayerWalkedIn() { + if (Game_Flag_Query(465)) { + Player_Loses_Control(); + Delay(2000); + Actor_Retired_Here(0, 6, 6, 1, -1); + //return true; + return; + } + if (!Game_Flag_Query(211)) { + Player_Loses_Control(); + Loop_Actor_Walk_To_XYZ(0, -491.15f, 0.0f, -73.06f, 0, 0, false, 0); + Player_Gains_Control(); + Game_Flag_Set(211); + } + if (Game_Flag_Query(133) ) { + Game_Flag_Reset(133); + //return true; + return; + } + //return false; +} + +void SceneScriptPS09::PlayerWalkedOut() { +} + +void SceneScriptPS09::DialogueQueueFlushed(int a1) { +} + +void SceneScriptPS09::sub_402090() { + Dialogue_Menu_Clear_List(); + if (Actor_Clue_Query(0, 179) || Actor_Clue_Query(0, 180) || Actor_Clue_Query(0, 181) ) { + DM_Add_To_List_Never_Repeat_Once_Selected(170, 5, 5, 3); + DM_Add_To_List_Never_Repeat_Once_Selected(180, -1, 5, 5); + DM_Add_To_List_Never_Repeat_Once_Selected(200, -1, 3, 6); + } + if (Actor_Clue_Query(0, 99) && (Actor_Clue_Query(0, 179) || Actor_Clue_Query(0, 180) || Actor_Clue_Query(0, 181) )) { + DM_Add_To_List_Never_Repeat_Once_Selected(190, 5, 6, -1); + } + Dialogue_Menu_Add_To_List(210); + Dialogue_Menu_Appear(320, 240); + int answer = Dialogue_Menu_Query_Input(); + Dialogue_Menu_Disappear(); + switch (answer) { + case 170: + Actor_Says(0, 4270, 13); + Actor_Says(0, 4250, 18); + Actor_Says(11, 50, 13); + Actor_Says(0, 4275, 18); + Actor_Says(0, 4280, 19); + if (Game_Flag_Query(44) ) { + Actor_Says(11, 60, 14); + Actor_Says(0, 4285, 13); + Actor_Says(11, 70, 12); + Actor_Says(0, 4290, 13); + Actor_Says(11, 80, 13); + Actor_Says(11, 90, 13); + Actor_Says(0, 4295, 18); + Actor_Says(11, 110, 14); + Actor_Says(0, 4300, 17); + return; + } + if (!Game_Flag_Query(44)) { + Actor_Says(11, 130, 15); + Actor_Says(11, 140, 13); + Actor_Says(0, 4305, 13); + Actor_Says(11, 150, 14); + Actor_Says(11, 160, 12); + Actor_Says(0, 4310, 13); + Actor_Says(11, 170, 15); + Actor_Says(11, 180, 16); + Actor_Says(0, 4315, 18); + Actor_Says(11, 200, 13); + return; + } + break; + case 180: + Actor_Says(0, 4270, 18); + Actor_Says(0, 4255, 3); + Actor_Says(11, 210, 12); + Actor_Says(11, 220, 13); + Actor_Says(11, 230, 14); + Actor_Says(0, 4320, 14); + Actor_Says(11, 240, 16); + Actor_Says(11, 250, 15); + Actor_Says(0, 4330, 13); + Actor_Says(11, 260, 13); + Actor_Says(11, 270, 12); + Actor_Says(0, 4335, 18); + Actor_Says(11, 290, 15); + Actor_Says(0, 4340, 13); + Actor_Modify_Friendliness_To_Other(11, 0, -5); + if (Game_Flag_Query(165)) { + Actor_Says(11, 300, 12); + Actor_Face_Actor(9, 11, true); + Actor_Says(9, 1010, 3); + Actor_Face_Actor(11, 9, true); + Actor_Says(11, 310, 16); + Actor_Face_Actor(0, 9, true); + Actor_Says(0, 4345, 14); + Actor_Face_Actor(9, 0, true); + Actor_Says(9, 1020, 3); + Actor_Says(0, 4350, 18); + Actor_Says(9, 1030, 3); + Actor_Says(0, 4355, 19); + Actor_Says(9, 1040, 3); + Actor_Says(0, 4360, 16); + Actor_Says(0, 4365, 14); + Actor_Says(9, 1050, 3); + Actor_Says(9, 1060, 3); + Actor_Says(0, 4370, 14); + Actor_Says(9, 1070, 3); + Actor_Says(9, 1080, 3); + } + else { + Actor_Says(11, 320, 13); + Actor_Says(11, 340, 14); + Actor_Says(11, 350, 12); + Actor_Says(0, 4375, 18); + } + break; + case 190: + Actor_Says(0, 4270, 18); + Actor_Says(0, 4260, 3); + Actor_Says(11, 360, 16); + Actor_Says(0, 4380, 19); + Actor_Says(0, 4385, 19); + Actor_Says(11, 370, 13); + Actor_Says(0, 4390, 19); + Actor_Says(0, 4395, 18); + Actor_Says(11, 380, 14); + Actor_Says(11, 390, 12); + Actor_Modify_Friendliness_To_Other(11, 0, -5); + break; + case 200: + Actor_Says(0, 4265, 14); + Actor_Says(11, 400, 13); + Actor_Says(0, 4400, 13); + Actor_Says(11, 410, 16); + Actor_Says(0, 4405, 14); + Actor_Says(0, 4410, 15); + Voight_Kampff_Activate(11, 20); + Actor_Modify_Friendliness_To_Other(11, 0, -10); + break; + case 210: + Actor_Says(0, 8600, 18); + Actor_Says(11, 20, 15); + break; + } +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ps10.cpp b/engines/bladerunner/script/scene/ps10.cpp new file mode 100644 index 0000000000..a00868cb6a --- /dev/null +++ b/engines/bladerunner/script/scene/ps10.cpp @@ -0,0 +1,248 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptPS10::InitializeScene() { + Police_Maze_Set_Pause_State(1); + if (Game_Flag_Query(15)) { + float x = World_Waypoint_Query_X(4); + float y = World_Waypoint_Query_Y(4); + float z = World_Waypoint_Query_Z(4); + Setup_Scene_Information(x, y, z, 280); + } else { + Setup_Scene_Information(-87.08f, -9.23f, 941.9f, 0); + } + Scene_Exit_Add_2D_Exit(1, 0, 0, 20, 479, 3); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(0); + Ambient_Sounds_Add_Looping_Sound(387, 50, 1, 1); + Ambient_Sounds_Add_Looping_Sound(54, 50, 1, 1); + Ambient_Sounds_Add_Sound(1, 10, 50, 16, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(389, 5, 50, 16, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(390, 6, 50, 16, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(443, 2, 100, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(444, 2, 100, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(445, 2, 100, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(446, 2, 100, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(303, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(304, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(305, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(306, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(307, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(308, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); +} + +static int track_data_0[] = {-26, 10, 20, -18, 10, 20, -9, 0, -9, 1,-5, 989, -1, 0, -15, 0, 1, -15, 1, 1,-23, 0, -7, 3000, 5000, -8, 0, -10, 159, 100,-2, 14, -3, 1000, -6, 740, 80, -22, 0, -3,0, -6, 488, 80, -3, 1000, -24, 27, 33, -3, 0, -6, 740, 80, -11, 1, -9, 0, -8, 1, -12, 0, -1, 0, -4}; +static int track_data_1[] = {-5, 740, -1, 0, -22, 1, -2, 69, -3, 500, -9, 1, -11, 4, -12, 1, -1, 0, -4}; +static int track_data_2[] = {-26, 10, 20, -18, 10, 20, -9, 2, -5, 993, -1, 0, -7, 3000, 5000, -8, 2, -10, 159, 100, -15, 2, 1, -23, 2, -2, 5, -3, 1000, -22, 2, -6, 233, 80, -3, 0, -6, 491, 80, -3, 500, -24, 27, 33, -3, 500, -6, 233, 80, -3, 0, -6, 993, 80, -10, 34, 33, -2, 0, -9, 2, -4}; +static int track_data_3[] = {-26, 10, 20, -18, 10, 20, -9, 3, -5, 993, -1, 0, -7, 3000, 6000, -8, 3, -10, 159, 100, -15, 3, 1, -23, 3, -2, 34, -3, 500, -6, 491, 80, -2, 0, -25, -9, 3, -11, 7, -12, 3, -4}; +static int track_data_4[] = {-26, 10, 20, -18, 10, 20, -9, 4, -5, 0, -1, 0, -7, 4000, 6000, -8, 4, -10, 159, 100, -15, 4, 1, -23, 4, -2, 5, -3, 1000, -6, 512, 100, -3, 2000, -6, 0, -100, -10, 34, 33, -2, 0, -25, -9, 4, -11, 0, -12, 4, -4}; +static int track_data_5[] = {-26, 10, 20, -18, 10, 20, -9, 5, -5, 999, -1, 0, -7, 4000, 6000, -8, 5, -10, 159, 100, -15, 5, 1, -23, 5, -2, 7, -3, 500, -22, 5, -6, 750, 80, -3, 0, -6, 500, 80, -3, 1000, -24, 27, 33, -3, 0, -6, 750, 80, -3, 0, -6, 999, 80, -10, 34, 33, -2, 0, -9, 5, -11, 6, -11, 8, -12, 5, -4}; +static int track_data_6[] = {-26, 10, 20, -18, 10, 20, -9, 6, -5, 264, -1, 0, -7, 3000, 6000, -15, 6, 1, -23, 6, -8, 6, -2, 89, -7, 4000, 8000, -5, 776, -2, 0, -25, -9, 6, -12, 6, -4}; +static int track_data_7[] = {-26, 10, 20, -18, 10, 20, -9, 7, -5, 993, -1, 0, -7, 4000, 6000, -8, 7, -10, 159, 100, -15, 7, 1, -23, 7, -2, 34, -3, 500, -22, 7, -6, 491, 80, -2, 20, -3, 0, -24, 27, 33, -2, 0, -9, 7, -11, 3, -12, 7, -4}; +static int track_data_8[] = {-26, 10, 20, -18, 10, 20, -9, 8, -5, 738, -1, 0, -7, 2000, 5000, -15, 8, 1, -22, 8, -8, 8, -10, 0, 33, -2, 23, -10, 0, 33, -3, 200, -10, 32, 33, -6, 498, 100, -10, 0, 33, -3, 100, -24, 27, 33, -10, 32, 33, -2, 35, -10, 32, 33, -3, 100, -24, 27, 33, -10, 0, 33, -2, 23, -10, 32, 33, -3, 100, -24, 27, 33, -10, 32, 33, -6, 758, 100, -10, 32, 33, -2, 89, -10, 0, 33, -7, 4000, 6000, -15, 8, 1, -22, 8, -5, 216, -10, 32, 33, -2, 69, -3, 100, -10, 32, 33, -6, 498, 100, -3, 100, -24, 27, 33, -10, 0, 33, -6, 216, 100, -10, 32, 33, -2, 0, -9, 8, -12, 8, -4}; + +void SceneScriptPS10::SceneLoaded() { + Obstacle_Object("PARKMETR01", true); + Obstacle_Object("PARKMETR02", true); + Obstacle_Object("PARKMETR03", true); + Obstacle_Object("PARKMETR07", true); + Obstacle_Object("PARKMETR08", true); + Obstacle_Object("PARKMETR10", true); + Obstacle_Object("PARKMETR11", true); + Obstacle_Object("PARKMETR15", true); + Obstacle_Object("PARKMETR16", true); + Obstacle_Object("TUBE14", true); + Unclickable_Object("PARKMETR01"); + Unclickable_Object("PARKMETR02"); + Unclickable_Object("PARKMETR03"); + Unclickable_Object("PARKMETR07"); + Unclickable_Object("PARKMETR08"); + Unclickable_Object("PARKMETR10"); + Unclickable_Object("PARKMETR11"); + Unclickable_Object("PARKMETR15"); + Unclickable_Object("PARKMETR16"); + Unobstacle_Object("E.SM.WIRE01", true); + if (!Query_System_Currently_Loading_Game()) { + Item_Add_To_World(0, 443, 14, -240.0f, -80.74f, 145.0f, 989, 72, 36, true, false, false, true); + Item_Add_To_World(1, 443, 14, -240.0f, -8.74f, 145.0f, 740, 72, 36, true, false, false, true); + Item_Add_To_World(2, 445, 14, -165.0f, 111.53f, -10.0f, 993, 72, 36, true, false, false, true); + Item_Add_To_World(3, 447, 14, -125.0f, 160.0f, -10.0f, 993, 72, 36, true, false, false, true); + Item_Add_To_World(4, 441, 14, -246.71f, 205.51f, -20.0f, 0, 72, 36, true, false, false, true); + Item_Add_To_World(5, 445, 14, -27.69f, -86.92f, 434.0f, 999, 72, 36, true, false, false, true); + Item_Add_To_World(6, 441, 14, -347.15f, 7.68f, -20.0f, 264, 72, 36, true, false, false, true); + Item_Add_To_World(7, 449, 14, -51.0f, 160.0f, -10.0f, 993, 72, 36, true, false, false, true); + Item_Add_To_World(8, 445, 14, 39.0f, 9.16f, -20.0f, 738, 72, 36, true, false, false, true); + } + + Police_Maze_Target_Track_Add(0, -240.0f, -80.74f, 145.0f, -240.0f, -8.74f, 145.0f, 15, track_data_0, false); + Police_Maze_Target_Track_Add(1, -240.0f, -8.74f, 145.0f, -450.0f, -8.74f, 145.0f, 70, track_data_1, false); + Police_Maze_Target_Track_Add(2, -165.0f, 111.53f, -10.0f, -165.0f, 167.53f, -10.0f, 6, track_data_2, true); + Police_Maze_Target_Track_Add(3, -125.0f, 160.0f, -10.0f, -51.0f, 160.0f, -10.0f, 35, track_data_3, false); + Police_Maze_Target_Track_Add(4, -246.71f, 205.51f, -20.0f, -246.71f, 241.51f, -20.0f, 6, track_data_4, true); + Police_Maze_Target_Track_Add(5, -27.69f, -86.92f, 434.0f, -27.69f, -18.92f, 434.0f, 8, track_data_5, true); + Police_Maze_Target_Track_Add(6, -347.15f, 7.68f, -20.0f, 39.0f, 9.16f, -20.0f, 90, track_data_6, false); + Police_Maze_Target_Track_Add(7, -51.0f, 160.0f, -10.0f, -125.0f, 160.0f, -10.0f, 35, track_data_7, true); + Police_Maze_Target_Track_Add(8, 39.0f, 9.16f, -20.0f, -347.15f, 7.68f, -20.0f, 90, track_data_8, false); + Preload(441); + Preload(442); + Preload(443); + Preload(444); + Preload(445); + Preload(446); + Preload(447); + Preload(448); + Preload(449); + Preload(450); +} + +bool SceneScriptPS10::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptPS10::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptPS10::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptPS10::ClickedOnItem(int itemId, bool a2) { + if (Player_Query_Combat_Mode()) { + switch (itemId) { + case 3: + Sound_Play(4, 50, 0, 0, 50); + break; + case 4: + Sound_Play(555, 50, 0, 0, 50); + break; + case 6: + Sound_Play(555, 50, 0, 0, 50); + break; + default: + Sound_Play(2, 12, 0, 0, 50); + break; + } + Item_Spin_In_World(itemId); + if (itemId == 0) { + Item_Flag_As_Non_Target(0); + Item_Flag_As_Non_Target(1); + } + if (itemId == 1) { + Item_Flag_As_Non_Target(0); + Item_Flag_As_Non_Target(1); + } + if (itemId == 2) { + Item_Flag_As_Non_Target(2); + } + if (itemId == 3) { + Item_Flag_As_Non_Target(3); + } + if (itemId == 4) { + Item_Flag_As_Non_Target(4); + } + if (itemId == 5) { + Item_Flag_As_Non_Target(5); + } + if (itemId == 6) { + Item_Flag_As_Non_Target(6); + } + if (itemId == 7) { + Item_Flag_As_Non_Target(7); + } + if (itemId == 8) { + Item_Flag_As_Non_Target(8); + } else { + Item_Flag_As_Non_Target(itemId); + } + return true; + } + + return false; +} + +bool SceneScriptPS10::ClickedOnExit(int exitId) { + if (exitId == 1) { + if (!Loop_Actor_Walk_To_Waypoint(0, 6, 12, 1, false)) { + Game_Flag_Set(14); + sub_402238(); + Global_Variable_Decrement(9, 20 - Global_Variable_Query(10)); + Global_Variable_Set(10, 20); + Set_Enter(14, 74); + } + return true; + } + + return false; +} + +bool SceneScriptPS10::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptPS10::SceneFrameAdvanced(int frame) { +} + +void SceneScriptPS10::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptPS10::PlayerWalkedIn() { + if (Game_Flag_Query(15)) { + Loop_Actor_Walk_To_XYZ(0, -352.09f, -9.23f, 267.95f, 0, 0, true, 0); + Police_Maze_Set_Pause_State(0); + Game_Flag_Reset(15); + //return true; + return; + } else { + Player_Set_Combat_Mode(true); + Loop_Actor_Walk_To_Waypoint(0, 5, 0, 0, true); + Actor_Says(39, 280, 3); + Actor_Says(39, 290, 3); + Actor_Says(39, 300, 3); + Police_Maze_Set_Pause_State(0); + //return true; + return; + } +} + +void SceneScriptPS10::PlayerWalkedOut() { +} + +void SceneScriptPS10::DialogueQueueFlushed(int a1) { +} + +void SceneScriptPS10::sub_402238() { + Item_Remove_From_World(0); + Item_Remove_From_World(1); + Item_Remove_From_World(2); + Item_Remove_From_World(3); + Item_Remove_From_World(4); + Item_Remove_From_World(5); + Item_Remove_From_World(6); + Item_Remove_From_World(7); + Item_Remove_From_World(8); +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ps11.cpp b/engines/bladerunner/script/scene/ps11.cpp new file mode 100644 index 0000000000..1b20781451 --- /dev/null +++ b/engines/bladerunner/script/scene/ps11.cpp @@ -0,0 +1,285 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptPS11::InitializeScene() { + if (Game_Flag_Query(14)) { + Scene_Loop_Start_Special(0, 0, 0); + Scene_Loop_Set_Default(1); + Game_Flag_Reset(14); + Setup_Scene_Information(World_Waypoint_Query_X(6), World_Waypoint_Query_Y(6), World_Waypoint_Query_Z(6), 840); + } else { + Scene_Loop_Set_Default(1); + Setup_Scene_Information(World_Waypoint_Query_X(7), World_Waypoint_Query_Y(7), World_Waypoint_Query_Z(7), 132); + } + Scene_Exit_Add_2D_Exit(0, 0, 460, 639, 479, 2); + Scene_Exit_Add_2D_Exit(1, 0, 0, 20, 479, 3); +} + +static int track_data_9[] = {-26, 11, 20, -18, 11, 20, -9, 9, -5, 50, -1, 0, -7, 5000, 5000, -8, 9, -10, 31, 33, -15, 9, 1, -22, 9, -2, 7, -3, 1000, -24, 27, 33, -10, 34, 33, -2, 0, -3, 500, -9, 9, -13, 15, 10, -12, 9, -4}; +static int track_data_10[] = {-26, 11, 20, -18, 11, 20, -9, 10, -9, 11, -15, 10, 1, -15, 11, 1, -5, 860, -1, 0, -7, 3000, 6000, -23, 10, -8, 10, -10, 33, 33, -2, 14, -3, 500, -11, 11, -9, 10, -8, 11, -12, 10, -1, 0, -4}; +static int track_data_11[] = {-5, 860, -1, 0, -23, 11, -8, 11, -2, 25, -3, 500, -22, 11, -10, 32, 33, -6, 644, 80, -3, 0, -6, 388, 80, -3, 1000, -24, 12, 33, -2, 79, -9, 11, -13, 15, 9, -12, 11, -1, 0, -5, 860, -4}; +static int track_data_12[] = {-26, 11, 20, -18, 11, 20, -9, 12, -5, 725, -1, 0, -3, 2000, -15, 12, 1, -23, 12, -8, 12, -2, 82, -25, -3, 1000, -6, 570, 80, -3, 0, -6, 462, 80, -3, 0, -6, 213, 80, -3, 1000, -2, 0, -6, 725, 80, -2, 99, -9, 12, -11, 27, -12, 12, -1, 0, -4}; +static int track_data_13[] = {-26, 11, 20, -18, 11, 20, -9, 13, -5, 340, -1, 0, -7, 4000, 8000, -8, 13, -10, 33, 33, -15, 13, 1, -22, 13, -2, 4, -3, 0, -6, 435, 80, -3, 0, -6, 530, 80, -3, 100, -6, 435, 80, -3, 0, -6, 340, 80, -3, 0, -6, 260, 80, -3, 0, -6, 180, 80, -3, 100, -6, 260, 80, -3, 0, -6, 340, 80, -3, 200, -24, 27, 33, -10, 34, 33, -2, 0, -9, 13, -13, 14, 18, -12, 13, -4}; +static int track_data_14[] = {-26, 11, 20, -18, 11, 20, -9, 14, -15, 14, 1, -23, 14, -5, 900, -1, 0, -7, 3000, 6000, -8, 14, -10, 33, 33, -2, 5, -3, 500, -22, 14, -6, 644, 80, -3, 0, -6, 388, 80, -3, 1000, -24, 27, 33, -10, 34, 33, -2, 0, -9, 14, -13, 18, 13, -12, 14, -4}; +static int track_data_15[] = {-26, 11, 20, -18, 11, 20, -9, 15, -9, 16, -15, 15, 1, -15, 16, 1, -5, 860, -1, 0, -7, 3000, 7000, -8, 15, -10, 29, 33, -23, 15, -2, 14, -25, -3, 1000, -11, 16, -9, 15, -8, 16, -12, 15, -1, 0, -4}; +static int track_data_16[] = {-5, 860, -1, 0, -8, 16, -23, 16, -2, 25, -3, 500, -10, 32, 33, -6, 644, 100, -3, 0, -6, 388, 200, -3, 500, -2, 79, -25, -9, 16, -13, 10, 9, -12, 16, -1, 0, -5, 860, -4}; +static int track_data_17[] = {-26, 11, 20, -18, 11, 20, -5, 310, -1, 0, -8, 17, -15, 17, 1, -22, 17, -7, 4000, 8000, -10, 32, 33, -2, 10, -3, 0, -24, 27, 33, -2, 0, -15, 17, 1, -22, 17, -2, 24, -15, 17, 1, -22, 17, -2, 10, -3, 0, -24, 27, 33, -2, 24, -3, 1000, -9, 17, -13, 23, 22, -12, 17, -1, 0, -4}; +static int track_data_18[] = {-26, 11, 20, -18, 11, 20, -9, 18, -9, 19, -5, 900, -1, 0, -15, 18, 1, -15, 19, 1, -23, 18, -7, 4000, 6000, -8, 18, -2, 5, -10, 19, 33, -10, 3, 33, -3, 1000, -25, -6, 700, 80, -22, 18, -3, 0, -6, 512, 200, -3, 1000, -24, 12, 33, -11, 19, -9, 18, -8, 19, -12, 18, -1, 0, -4}; +static int track_data_19[] = {-5, 512, -1, 0, -22, 19, -2, 8, -3, 4000, -15, 19, 1, -22, 19, -2, 2, -10, 32, 33, -3, 1000, -24, 12, 33, -2, 19, -3, 500, -9, 19, -13, 13, 14, -12, 19, -1, 0, -4}; +static int track_data_20[] = {-26, 11, 20, -18, 11, 20, -9, 20, -5, 280, -1, 0, -7, 5000, 7000, -15, 20, 1, -22, 20, -8, 20, -2, 9, -10, 32, 33, -3, 1000, -24, 27, 33, -2, 0, -9, 20, -13, 21, 12, -12, 20, -1, 0, -4}; +static int track_data_21[] = {-26, 11, 20, -18, 11, 20, -9, 21, -5, 280, -1, 0, -7, 5000, 8000, -15, 21, 1, -23, 21, -8, 21, -2, 5, -25, -3, 1000, -2, 0, -9, 21, -13, 20, 12, -12, 21, -1, 0, -4}; +static int track_data_22[] = {-26, 11, 20, -18, 11, 20, -9, 22, -5, 255, -1, 0, -15, 22, 1, -22, 22, -7, 5000, 5000, -8, 22, -2, 7, -10, 32, 33, -3, 1000, -24, 12, 33, -2, 0, -9, 22, -13, 23, 17, -12, 22, -1, 0, -4}; +static int track_data_23[] = {-26, 11, 20, -18, 11, 20, -9, 23, -5, 310, -1, 0, -7, 3000, 6000, -15, 23, 1, -23, 23, -8, 23, -3, 1000, -2, 24, -3, 1000, -2, 0, -25, -9, 23, -13, 22, 17, -12, 23, -1, 0, -4}; +static int track_data_27[] = {-26, 11, 20, -18, 11, 20, -9, 27, -5, 346, -1, 0, -3, 0, -15, 27, 1, -22, 27, -8, 27, -2, 14, -3, 1000, -24, 12, 33, -2, 0, -9, 27, -13, 21, 20, -12, 27, -1, 0, -4}; + +void SceneScriptPS11::SceneLoaded() { + Obstacle_Object("PARKMETR01", true); + Obstacle_Object("PARKMETR02", true); + Obstacle_Object("PARKMETR03", true); + Obstacle_Object("PARKMETR07", true); + Obstacle_Object("PARKMETR08", true); + Obstacle_Object("PARKMETR10", true); + Obstacle_Object("PARKMETR11", true); + Obstacle_Object("PARKMETR15", true); + Obstacle_Object("PARKMETR16", true); + Unclickable_Object("PARKMETR01"); + Unclickable_Object("PARKMETR02"); + Unclickable_Object("PARKMETR03"); + Unclickable_Object("PARKMETR07"); + Unclickable_Object("PARKMETR08"); + Unclickable_Object("PARKMETR10"); + Unclickable_Object("PARKMETR11"); + Unclickable_Object("PARKMETR15"); + Unclickable_Object("PARKMETR16"); + if (!Query_System_Currently_Loading_Game()) { + Item_Add_To_World(9, 449, 14, -450.0f, -7.5f, 335.0f, 50, 72, 36, true, false, false, true); + Item_Add_To_World(10, 449, 14, -740.0f, 27.0f, -30.0f, 860, 72, 36, true, false, false, true); + Item_Add_To_World(11, 449, 14, -740.0f, 99.0f, -30.0f, 860, 72, 36, true, false, false, true); + Item_Add_To_World(12, 441, 14, -400.0f, -9.23f, -75.0f, 725, 72, 36, true, false, false, true); + Item_Add_To_World(13, 443, 14, -803.72f, -72.7f, 60.22f, 340, 72, 36, true, false, false, true); + Item_Add_To_World(14, 443, 14, -853.0f, -70.0f, 195.0f, 900, 72, 36, true, false, false, true); + Item_Add_To_World(15, 447, 14, -740.0f, 27.0f, -30.0f, 860, 72, 36, true, false, false, true); + Item_Add_To_World(16, 447, 14, -740.0f, 99.0f, -30.0f, 860, 72, 36, true, false, false, true); + Item_Add_To_World(17, 445, 14, -888.0f, 155.0f, 100.0f, 310, 72, 36, true, false, false, true); + Item_Add_To_World(18, 443, 14, -430.0f, 164.0f, 11.0f, 900, 72, 36, true, false, false, true); + Item_Add_To_World(19, 443, 14, -430.0f, -0.86f, 11.0f, 512, 72, 36, true, false, false, true); + Item_Add_To_World(20, 443, 14, -891.0f, 3.1f, 90.0f, 280, 72, 36, true, false, false, true); + Item_Add_To_World(21, 447, 14, -891.0f, 3.1f, 90.0f, 280, 72, 36, true, false, false, true); + Item_Add_To_World(22, 445, 14, -891.0f, 171.0f, 190.0f, 255, 72, 36, true, false, false, true); + Item_Add_To_World(23, 441, 14, -888.0f, 155.0f, 30.0f, 310, 72, 36, true, false, false, true); + Item_Add_To_World(27, 445, 14, -800.0f, -9.23f, -75.0f, 346, 72, 36, true, false, false, true); + } + + Police_Maze_Target_Track_Add(9, -450.0f, -7.5f, 335.0f, -450.0f, -7.5f, 295.0f, 8, track_data_9, true); + Police_Maze_Target_Track_Add(10, -740.0f, 27.0f, -30.0f, -740.0f, 99.0f, -30.0f, 15, track_data_10, false); + Police_Maze_Target_Track_Add(11, -740.0f, 99.0f, -30.0f, -200.0f, 99.0f, -30.0f, 80, track_data_11, false); + Police_Maze_Target_Track_Add(12, -400.0f, -9.23f, -75.0f, -800.0f, -9.23f, -75.0f, 100, track_data_12, false); + Police_Maze_Target_Track_Add(13, -803.72f, -72.7f, 60.22f, -803.72f, -0.7f, 60.22f, 6, track_data_13, true); + Police_Maze_Target_Track_Add(14, -853.0f, -70.0f, 195.0f, -853.0f, 2.0f, 195.0f, 6, track_data_14, false); + Police_Maze_Target_Track_Add(15, -740.0f, 27.0f, -30.0f, -740.0f, 99.0f, -30.0f, 15, track_data_15, false); + Police_Maze_Target_Track_Add(16, -740.0f, 99.0f, -30.0f, -200.0f, 99.0f, -30.0f, 80, track_data_16, false); + Police_Maze_Target_Track_Add(17, -888.0f, 155.0f, 100.0f, -888.0f, 155.0f, 30.0f, 25, track_data_17, false); + Police_Maze_Target_Track_Add(18, -430.0f, 164.0f, 11.0f, -430.0f, -0.86f, 11.0f, 6, track_data_18, false); + Police_Maze_Target_Track_Add(19, -430.0f, -0.86f, 11.0f, -300.0f, -0.86f, -80.0f, 20, track_data_19, false); + Police_Maze_Target_Track_Add(20, -891.0f, 3.1f, 90.0f, -891.0f, 3.1f, 105.0f, 10, track_data_20, true); + Police_Maze_Target_Track_Add(21, -891.0f, 3.1f, 90.0f, -891.0f, 3.1f, 105.0f, 6, track_data_21, false); + Police_Maze_Target_Track_Add(22, -891.0f, 171.0f, 190.0f, -891.0f, 171.0f, 147.0f, 8, track_data_22, false); + Police_Maze_Target_Track_Add(23, -888.0f, 155.0f, 30.0f, -888.0f, 155.0f, 100.0f, 25, track_data_23, true); + Police_Maze_Target_Track_Add(27, -800.0f, -9.23f, -75.0f, -740.0f, -9.23f, -75.0f, 15, track_data_27, false); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(0); + Ambient_Sounds_Add_Looping_Sound(387, 50, 1, 1); + Ambient_Sounds_Add_Looping_Sound(54, 50, 1, 1); + Ambient_Sounds_Add_Sound(1, 10, 50, 16, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(389, 5, 50, 16, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(390, 6, 50, 16, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(443, 2, 100, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(444, 2, 100, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(445, 2, 100, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(446, 2, 100, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(303, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(304, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(305, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(306, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(307, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(308, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); +} + +bool SceneScriptPS11::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptPS11::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptPS11::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptPS11::ClickedOnItem(int itemId, bool a2) { + if (Player_Query_Combat_Mode()) { + switch (itemId) { + case 15: + Sound_Play(4, 50, 0, 0, 50); + break; + case 16: + Sound_Play(4, 50, 0, 0, 50); + break; + case 21: + Sound_Play(4, 50, 0, 0, 50); + break; + case 23: + Sound_Play(555, 50, 0, 0, 50); + break; + case 12: + Sound_Play(555, 50, 0, 0, 50); + break; + default: + Sound_Play(2, 12, 0, 0, 50); + break; + } + Item_Spin_In_World(itemId); + if (itemId == 9) { + Item_Flag_As_Non_Target(9); + } + if (itemId == 10) { + Item_Flag_As_Non_Target(10); + Item_Flag_As_Non_Target(11); + } + if (itemId == 11) { + Item_Flag_As_Non_Target(10); + Item_Flag_As_Non_Target(11); + } + if (itemId == 12) { + Item_Flag_As_Non_Target(12); + } + if (itemId == 13) { + Item_Flag_As_Non_Target(13); + } + if (itemId == 14) { + Item_Flag_As_Non_Target(14); + } + if (itemId == 15) { + Item_Flag_As_Non_Target(15); + Item_Flag_As_Non_Target(16); + } + if (itemId == 16) { + Item_Flag_As_Non_Target(15); + Item_Flag_As_Non_Target(16); + } + if (itemId == 17) { + Item_Flag_As_Non_Target(17); + } + if (itemId == 18) { + Item_Flag_As_Non_Target(18); + Item_Flag_As_Non_Target(19); + } + if (itemId == 19) { + Item_Flag_As_Non_Target(18); + Item_Flag_As_Non_Target(19); + } + if (itemId == 20) { + Item_Flag_As_Non_Target(20); + } + if (itemId == 21) { + Item_Flag_As_Non_Target(21); + } + if (itemId == 22) { + Item_Flag_As_Non_Target(22); + } + if (itemId == 23) { + Item_Flag_As_Non_Target(23); + } + if (itemId == 27) { + Item_Flag_As_Non_Target(27); + } + return true; + } + return false; +} + +bool SceneScriptPS11::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_Waypoint(0, 6, 12, 1, false)) { + Game_Flag_Set(15); + sub_402744(); + Set_Enter(14, 73); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_Waypoint(0, 8, 12, 1, false)) { + Game_Flag_Set(16); + sub_402744(); + Global_Variable_Decrement(9, 20 - Global_Variable_Query(11)); + Global_Variable_Set(11, 20); + Set_Enter(14, 75); + } + return true; + } + return false; +} + +bool SceneScriptPS11::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptPS11::SceneFrameAdvanced(int frame) { +} + +void SceneScriptPS11::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptPS11::PlayerWalkedIn() { + Police_Maze_Set_Pause_State(0); +} + +void SceneScriptPS11::PlayerWalkedOut() { +} + +void SceneScriptPS11::DialogueQueueFlushed(int a1) { +} + +void SceneScriptPS11::sub_402744() { + Item_Remove_From_World(9); + Item_Remove_From_World(10); + Item_Remove_From_World(11); + Item_Remove_From_World(12); + Item_Remove_From_World(13); + Item_Remove_From_World(14); + Item_Remove_From_World(15); + Item_Remove_From_World(16); + Item_Remove_From_World(17); + Item_Remove_From_World(18); + Item_Remove_From_World(19); + Item_Remove_From_World(20); + Item_Remove_From_World(21); + Item_Remove_From_World(22); + Item_Remove_From_World(23); + Item_Remove_From_World(27); +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ps12.cpp b/engines/bladerunner/script/scene/ps12.cpp new file mode 100644 index 0000000000..c13fd3c535 --- /dev/null +++ b/engines/bladerunner/script/scene/ps12.cpp @@ -0,0 +1,302 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptPS12::InitializeScene() { + Police_Maze_Set_Pause_State(1); + if (Game_Flag_Query(16)) { + Scene_Loop_Start_Special(0, 0, 0); + Scene_Loop_Set_Default(1); + Setup_Scene_Information(World_Waypoint_Query_X(8), World_Waypoint_Query_Y(8), World_Waypoint_Query_Z(8), 512); + } else { + Scene_Loop_Set_Default(1); + Setup_Scene_Information(World_Waypoint_Query_X(9), World_Waypoint_Query_Y(9), World_Waypoint_Query_Z(9), 0); + } + Scene_Exit_Add_2D_Exit(0, 0, 460, 639, 479, 2); + Scene_Exit_Add_2D_Exit(1, 0, 5, 110, 196, 3); +} + +static int track_data_29[] = {-26, 12, 20, -18, 12, 20, -9, 29, -5, 200, -1, 0, -7, 4000, 10000, -8, 29, -10, 33, 33, -15, 29, 1, -22, 29, -2, 5, -3, 500, -24, 27, 33, -10, 34, 33, -2, 0, -9, 29, -13, 44, 42, -12, 29, -4}; +static int track_data_30[] = {-26, 12, 20, -18, 12, 20, -9, 30, -5, 67, -1, 0, -7, 3000, 9000, -8, 30, -10, 33, 33, -15, 30, 1, -22, 30, -2, 5, -3, 500, -24, 27, 33, -10, 34, 33, -2, 0, -9, 30, -13, 41, 39, -12, 30, -15, 30, 0, -4}; +static int track_data_31[] = {-26, 12, 20, -18, 12, 20, -15, 31, 1, -23, 31, -9, 31, -5, 480, -1, 0, -7, 3000, 10000, -8, 31, -2, 5, -10, 29, 33, -3, 1000, -6, 968, 100, -10, 29, 33, -3, 500, -2, 0, -10, 29, 33, -25, -9, 31, -14, 40, 32, 33, -12, 31, -4}; +static int track_data_32[] = {-26, 12, 20, -18, 12, 20, -9, 32, -5, 1010, -1, 0, -7, 3000, 10000, -8, 32, -10, 33, 33, -15, 32, 1, -22, 32, -2, 5, -3, 500, -24, 27, 33, -6, 498, 80, -10, 29, 33, -3, 500, -2, 0, -9, 32, -14, 33, 31, 40, -12, 32, -4}; +static int track_data_33[] = {-26, 12, 20, -18, 12, 20, -9, 33, -5, 540, -1, 0, -7, 4000, 10000, -8, 33, -15, 33, 1, -23, 33, -2, 5, -10, 29, 33, -3, 1000, -6, 284, 80, -3, 0, -6, 28, 80, -10, 29, 33, -3, 1000, -2, 0, -25, -9, 33, -14, 40, 31, 32, -12, 33, -4}; +static int track_data_34[] = {-26, 12, 20, -18, 12, 20, -9, 34, -9, 35, -9, 36, -5, 469, -1, 0, -15, 34, 1, -15, 35, 1, -15, 36, 1, -7, 3000, 10000, -8, 34, -22, 34, -22, 35, -22, 36, -2, 5, -10, 29, 33, -3, 1000, -6, 376, 80, -3, 0, -6, 168, 80, -10, 29, 33, -2, 9, -6, 33, 80, -3, 0, -6, 15, 80, -10, 29, 33, -3, 500, -24, 27, 33, -2, 5, -10, 29, 33, -6, 168, 80, -3, 0, -6, 376, 80, -3, 0, -6, 469, 80, -10, 29, 33, -3, 500, -15, 34, 1, -15, 35, 1, -15, 36, 1, -22, 34, -22, 35, -22, 36, -6, 376, 80, -3, 0, -6, 168, 80, -2, 9, -6, 33, 80, -3, 0, -6, 15, 80, -10, 29, 33, -3, 500, -24, 27, 33, -2, 5, -10, 29, 33, -3, 0, -6, 469, 80, -3, 500, -6, 198, 80, -10, 29, 33, -3, 0, -2, 19, -10, 29,33, -3, 0, -9, 34, -11, 35, -12, 34, -1, 0, -4}; +static int track_data_35[] = {-8, 35, -5, 198, -1, 0, -6, 469, 80, -2, 9, -3, 0, -9, 35, -11, 36, -12, 35, -5, 198, -8, 35, -1, 0, -4}; +static int track_data_36[] = {-8, 36, -5, 469, -1, 0, -8, 36, -2, 9, -10, 29, 33, -3, 1000, -9, 34, -9, 35, -9, 36, -11, 37, -12, 36, -5, 469, -8, 36, -1, 0, -4}; +static int track_data_37[] = {-26, 12, 20, -18, 12, 20, -9, 37, -7, 3000, 6000, -11, 38, -5, 1010, -1, 0, -3, 2000, -8, 37, -10, 33, 33, -15, 37, 1, -23, 37, -2, 9, -3, 3000, -10, 34, 33, -2, 0, -25, -9, 37, -12, 37, -1, 0, -4}; +static int track_data_38[] = {-9, 38, -5, 990, -1, 0, -3, 3000, -8, 38, -10, 33, 33, -15, 38, 1, -22, 38, -2, 9, -3, 1000, -24, 12, 33, -10, 34, 33, -2, 0, -9, 38, -11, 34, -12, 38, -1, 0, -4}; +static int track_data_39[] = {-26, 12, 20, -18, 12, 20, -9, 39, -5, 513, -1, 0, -7, 5000, 5000, -8, 39, -10, 33, 33, -15, 39, 1, -2, 5, -3, 1000, -22, 39, -6, 1010, 80, -10, 29, 33, -3, 500, -24, 27, 33, -10, 34, 33, -2, 0, -9, 39, -13, 41, 30, -12, 39, -4}; +static int track_data_40[] = {-26, 12, 20, -18, 12, 20, -9, 40, -5, 480, -1, 0, -7, 4000, 8000, -8, 40, -10, 29, 33, -15, 40, 1, -2, 5, -10, 29, 33, -3, 500, -22, 40, -6, 968, 80, -10, 29, 33, -3, 1000, -24, 27, 33, -2, 0, -9, 40, -14, 31, 32, 33, -12, 40, -4}; +static int track_data_41[] = {-26, 12, 20, -18, 12, 20, -9, 41, -5, 513, -1, 0, -7, 4000, 6000, -8, 41, -10, 33, 33, -15, 41, 1, -23, 41, -2, 5, -3, 500, -6, 1010, 80, -10, 29, 33, -3, 1000, -2, 0, -10, 34, 33, -25, -9, 41, -13, 39, 30, -12, 41, -4}; +static int track_data_42[] = {-9, 42, -5, 109, -1, 0, -7, 2000, 5000, -8, 42, -10, 29, 33, -15, 42, 1, -22, 42, -2, 5, -10, 29, 33, -3, 1000, -24, 27, 33, -2, 0, -9, 42, -13, 44, 29, -12, 42, -4}; +static int track_data_43[] = {-26, 12, 20, -18, 12, 20, -9, 43, -5, 540, -1, 0, -7, 5000, 7000, -8, 43, -10, 33, 33, -15, 43, 1, -23, 43, -2, 9, -3, 2000, -6, 284, 80, -3, 0, -6, 28, 80, -10, 29, 33, -3, 2000, -10, 34, 33, -2, 0, -25, -9, 43, -11, 45, -12, 43, -4}; +static int track_data_44[] = {-26, 12, 20, -18, 12, 20, -9, 44, -5, 109, -1, 0, -7, 5000, 5000, -8, 44, -10, 29, 33, -15, 44, 1, -23, 44, -2, 5, -7, 2000, 2000, -10, 29, 33, -2, 0, -25, -9, 44, -13, 42, 29, -12, 44, -4}; +static int track_data_45[] = {-26, 12, 20, -18, 12, 20, -9, 45, -5, 540, -1, 0, -7, 3000, 10000, -8, 45, -10, 33, 33, -15, 45, 1, -2, 9, -3, 1000, -22, 45, -6, 284, 80, -3, 0, -6, 28, 80, -3, 1000, -24, 27, 33, -10, 34, 33, -2, 0, -9, 45, -11, 43, -12, 45, -4}; + +void SceneScriptPS12::SceneLoaded() { + Obstacle_Object("PARKMETR01", true); + Obstacle_Object("PARKMETR02", true); + Obstacle_Object("PARKMETR03", true); + Obstacle_Object("PARKMETR07", true); + Obstacle_Object("PARKMETR08", true); + Obstacle_Object("PARKMETR10", true); + Obstacle_Object("PARKMETR11", true); + Obstacle_Object("PARKMETR15", true); + Obstacle_Object("PARKMETR16", true); + Unclickable_Object("PARKMETR01"); + Unclickable_Object("PARKMETR02"); + Unclickable_Object("PARKMETR03"); + Unclickable_Object("PARKMETR07"); + Unclickable_Object("PARKMETR08"); + Unclickable_Object("PARKMETR10"); + Unclickable_Object("PARKMETR11"); + Unclickable_Object("PARKMETR15"); + Unclickable_Object("PARKMETR16"); + if (!Query_System_Currently_Loading_Game()) { + Item_Add_To_World(29, 449, 14, -691.8f, -9.06f, 587.67f, 200, 72, 36, true, false, false, true); + Item_Add_To_World(30, 445, 14, -679.6f, -45.4f, 721.05f, 67, 72, 36, true, false, false, true); + Item_Add_To_World(31, 447, 14, -414.04f, -8.98f, 711.91f, 480, 72, 36, true, false, false, true); + Item_Add_To_World(32, 443, 14, -440.0f, -8.97f, 1137.0f, 1010, 72, 36, true, false, false, true); + Item_Add_To_World(33, 441, 14, -764.92f, -0.84f, 950.22f, 540, 72, 36, true, false, false, true); + Item_Add_To_World(34, 449, 14, -696.0f, -5.7f, 1185.0f, 469, 72, 36, true, false, false, true); + Item_Add_To_World(35, 449, 14, -635.0f, -5.7f, 1165.0f, 198, 72, 36, true, false, false, true); + Item_Add_To_World(36, 449, 14, -620.0f, -8.63f, 1366.0f, 469, 72, 36, true, false, false, true); + Item_Add_To_World(37, 447, 14, -584.0f, -79.4f, 775.0f, 1010, 72, 36, true, false, false, true); + Item_Add_To_World(38, 445, 14, -578.0f, -79.4f, 810.0f, 990, 72, 36, true, false, false, true); + Item_Add_To_World(39, 443, 14, -400.0f, -12.0f, 1110.0f, 513, 72, 36, true, false, false, true); + Item_Add_To_World(40, 449, 14, -414.04f, -8.98f, 711.91f, 480, 72, 36, true, false, false, true); + Item_Add_To_World(41, 447, 14, -400.0f, -12.0f, 1110.0f, 513, 72, 36, true, false, false, true); + Item_Add_To_World(42, 449, 14, -731.0f, 93.66f, 788.0f, 109, 72, 36, true, false, false, true); + Item_Add_To_World(43, 441, 14, -580.0f, -80.0f, 925.0f, 540, 72, 36, true, false, false, true); + Item_Add_To_World(44, 441, 14, -731.0f, 93.66f, 788.0f, 109, 72, 36, true, false, false, true); + Item_Add_To_World(45, 443, 14, -580.0f, -80.0f, 925.0f, 540, 72, 36, true, false, false, true); + } + Police_Maze_Target_Track_Add(29, -691.8f, -9.06f, 587.67f, -649.11f, -9.06f, 587.71f, 6, track_data_29, true); + Police_Maze_Target_Track_Add(30, -679.6f, -45.4f, 721.05f, -679.6f, -1.4f, 721.05f, 6, track_data_30, true); + Police_Maze_Target_Track_Add(31, -414.04f, -8.98f, 711.917f, -459.54f, -8.99f, 707.81f, 6, track_data_31, false); + Police_Maze_Target_Track_Add(32, -440.0f, -8.97f, 1137.0f, -430.0f, -8.97f, 921.0f, 6, track_data_32, false); + Police_Maze_Target_Track_Add(33, -764.92f, -0.84f, 950.21997f, -722.92f, -0.84f, 950.22f, 6, track_data_33, false); + Police_Maze_Target_Track_Add(34, -696.0f, -5.7f, 1185.0f, -635.0f, -5.7f, 1185.0f, 20, track_data_34, false); + Police_Maze_Target_Track_Add(35, -635.0f, -5.7f, 1165.0f, -620.0f, -8.63f, 1366.0f, 10, track_data_35, false); + Police_Maze_Target_Track_Add(36, -620.0f, -8.63f, 1366.0f, -595.0f, -8.63f, 1366.0f, 10, track_data_36, false); + Police_Maze_Target_Track_Add(37, -584.0f, -79.4f, 775.0f, -584.0f, -27.4f, 775.0f, 10, track_data_37, true); + Police_Maze_Target_Track_Add(38, -578.0f, -79.4f, 810.0f, -578.0f, -27.4f, 810.0f, 10, track_data_38, false); + Police_Maze_Target_Track_Add(39, -400.0f, -12.0f, 1110.0f, -400.0f, 60.0f, 1110.0f, 6, track_data_39, false); + Police_Maze_Target_Track_Add(40, -414.04f, -8.98f, 711.91f, -459.54f, -8.99f, 707.81f, 6, track_data_40, true); + Police_Maze_Target_Track_Add(41, -400.0f, -12.0f, 1110.0f, -400.0f, 60.0f, 1110.0f, 6, track_data_41, false); + Police_Maze_Target_Track_Add(42, -731.0f, 93.66f, 788.0f, -702.0f, 93.66f, 788.0f, 6, track_data_42, false); + Police_Maze_Target_Track_Add(43, -580.0f, -80.0f, 925.0f, -580.0f, -8.0f, 925.0f, 10, track_data_43, true); + Police_Maze_Target_Track_Add(44, -731.0f, 93.66f, 788.0f, -702.0f, 93.66f, 788.0f, 6, track_data_44, false); + Police_Maze_Target_Track_Add(45, -580.0f, -80.0f, 925.0f, -580.0f, -8.0f, 925.0f, 10, track_data_45, false); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(0); + Ambient_Sounds_Add_Looping_Sound(387, 50, 1, 1); + Ambient_Sounds_Add_Looping_Sound(54, 50, 1, 1); + Ambient_Sounds_Add_Sound(1, 10, 50, 16, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(389, 5, 50, 16, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(390, 6, 50, 16, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(443, 2, 100, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(444, 2, 100, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(445, 2, 100, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(446, 2, 100, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(303, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(304, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(305, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(306, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(307, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(308, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); +} + +bool SceneScriptPS12::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptPS12::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptPS12::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptPS12::ClickedOnItem(int itemId, bool a2) { + if (Player_Query_Combat_Mode()) { + switch (itemId) { + case 31: + Sound_Play(4, 50, 0, 0, 50); + break; + case 37: + Sound_Play(4, 50, 0, 0, 50); + break; + case 41: + Sound_Play(4, 50, 0, 0, 50); + break; + case 33: + Sound_Play(555, 50, 0, 0, 50); + break; + case 43: + Sound_Play(555, 50, 0, 0, 50); + break; + case 44: + Sound_Play(555, 50, 0, 0, 50); + break; + default: + Sound_Play(2, 12, 0, 0, 50); + break; + } + Item_Spin_In_World(itemId); + Item_Flag_As_Non_Target(itemId); + if (itemId == 29) { + Item_Flag_As_Non_Target(29); + } + if (itemId == 30) { + Item_Flag_As_Non_Target(30); + } + if (itemId == 31) { + Item_Flag_As_Non_Target(31); + } + if (itemId == 32) { + Item_Flag_As_Non_Target(32); + } + if (itemId == 33) { + Item_Flag_As_Non_Target(33); + } + if (itemId == 34) { + Item_Flag_As_Non_Target(34); + Item_Flag_As_Non_Target(35); + Item_Flag_As_Non_Target(36); + } + if (itemId == 35) { + Item_Flag_As_Non_Target(34); + Item_Flag_As_Non_Target(35); + Item_Flag_As_Non_Target(36); + } + if (itemId == 36) { + Item_Flag_As_Non_Target(34); + Item_Flag_As_Non_Target(35); + Item_Flag_As_Non_Target(36); + } + if (itemId == 37) { + Item_Flag_As_Non_Target(37); + } + if (itemId == 38) { + Item_Flag_As_Non_Target(38); + } + if (itemId == 39) { + Item_Flag_As_Non_Target(39); + } + if (itemId == 40) { + Item_Flag_As_Non_Target(40); + } + if (itemId == 41) { + Item_Flag_As_Non_Target(41); + } + if (itemId == 42) { + Item_Flag_As_Non_Target(42); + } + if (itemId == 43) { + Item_Flag_As_Non_Target(43); + } + if (itemId == 44) { + Item_Flag_As_Non_Target(44); + } + if (itemId == 45) { + Item_Flag_As_Non_Target(45); + } + return true; + } + return false; +} + +bool SceneScriptPS12::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_Waypoint(0, 8, 12, 1, false)) { + Game_Flag_Set(17); + sub_4028C4(); + Set_Enter(14, 74); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_Waypoint(0, 9, 12, 1, false)) { + Player_Loses_Control(); + Loop_Actor_Walk_To_Waypoint(0, 10, 12, 0, false); + Player_Gains_Control(); + Game_Flag_Set(18); + sub_4028C4(); + Global_Variable_Decrement(9, 20 - Global_Variable_Query(12)); + Global_Variable_Set(12, 20); + Set_Enter(14, 76); + } + return true; + } + return false; +} + +bool SceneScriptPS12::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptPS12::SceneFrameAdvanced(int frame) { +} + +void SceneScriptPS12::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptPS12::PlayerWalkedIn() { + if (Game_Flag_Query(16)) { + Loop_Actor_Walk_To_XYZ(0, -546.0f, -9.06f, 570.0f, 0, 1, false, 0); + Game_Flag_Reset(16); + } + Police_Maze_Set_Pause_State(0); +} + +void SceneScriptPS12::PlayerWalkedOut() { +} + +void SceneScriptPS12::DialogueQueueFlushed(int a1) { +} + +void SceneScriptPS12::sub_4028C4() { + Item_Remove_From_World(29); + Item_Remove_From_World(30); + Item_Remove_From_World(31); + Item_Remove_From_World(32); + Item_Remove_From_World(33); + Item_Remove_From_World(34); + Item_Remove_From_World(35); + Item_Remove_From_World(36); + Item_Remove_From_World(37); + Item_Remove_From_World(38); + Item_Remove_From_World(39); + Item_Remove_From_World(40); + Item_Remove_From_World(41); + Item_Remove_From_World(42); + Item_Remove_From_World(43); + Item_Remove_From_World(44); + Item_Remove_From_World(45); +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ps13.cpp b/engines/bladerunner/script/scene/ps13.cpp new file mode 100644 index 0000000000..134376c0cb --- /dev/null +++ b/engines/bladerunner/script/scene/ps13.cpp @@ -0,0 +1,285 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptPS13::InitializeScene() { + Police_Maze_Set_Pause_State(1); + if (Game_Flag_Query(18)) { + Scene_Loop_Start_Special(0, 0, 0); + Scene_Loop_Set_Default(1); + Game_Flag_Reset(18); + Setup_Scene_Information(World_Waypoint_Query_X(10), World_Waypoint_Query_Y(10), World_Waypoint_Query_Z(10), 200); + } else { + Scene_Loop_Set_Default(1); + Setup_Scene_Information(World_Waypoint_Query_X(11), World_Waypoint_Query_Y(11), World_Waypoint_Query_Z(11), 840); + } + Scene_Exit_Add_2D_Exit(0, 0, 460, 639, 479, 2); + Scene_Exit_Add_2D_Exit(1, 0, 0, 20, 479, 3); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(0); + Ambient_Sounds_Add_Looping_Sound(387, 50, 1, 1); + Ambient_Sounds_Add_Looping_Sound(54, 50, 1, 1); + Ambient_Sounds_Add_Sound(1, 10, 50, 16, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(389, 5, 50, 16, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(390, 6, 50, 16, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(443, 2, 100, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(444, 2, 100, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(445, 2, 100, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(446, 2, 100, 14, 16, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(303, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(304, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(305, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(306, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(307, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(308, 5, 100, 17, 27, -100, 100, -101, -101, 0, 0); +} + +static int track_data_46[] = {-26, 13, 20, -18, 13, 20, -9, 46, -5, 960, -1, 0, -3, 2000, -8, 46, -10, 33, 33, -15, 46, 1, -22, 46, -3, 1000, -2, 5, -3, 500, -24, 27, 33, -3, 500, -2, 0, -9, 46, -13, 62, 63, -12, 46, -4}; +static int track_data_47[] = {-26, 13, 20, -18, 13, 20, -9, 47, -5, 823, -1, 0, -7, 5000, 5000, -8, 47, -10, 33, 33, -15, 47, 1, -22, 47, -2, 9, -3, 2000, -24, 27, 33, -2, 0, -9, 47, -13, 50, 52, -12, 47, -4}; +static int track_data_48[] = {-26, 13, 20, -18, 13, 20, -9, 48, -5, 823, -1, 0, -7, 2000, 2000, -8, 48, -10, 33, 33, -15, 48, 1, -23, 48, -2, 9, -3, 2000, -25, -2, 0, -9, 48, -13, 53, 51, -12, 48, -4}; +static int track_data_49[] = {-26, 13, 20, -18, 13, 20, -9, 49, -5, 922, -1, 0, -7, 3000, 3000, -8, 49, -10, 33, 33, -15, 49, 1, -22, 49, -2, 9, -3, 1000, -24, 27, 33, -2, 0, -9, 49, -13, 54, 55, -12, 49, -1, 0, -4}; +static int track_data_50[] = {-26, 13, 20, -18, 13, 20, -9, 50, -5, 823, -1, 0, -7, 3000, 5000, -8, 50, -10, 33, 33, -15, 50, 1, -23, 50, -2, 9, -3, 2000, -2, 0, -25, -9, 50, -13, 47, 52, -12, 50, -4}; +static int track_data_51[] = {-26, 13, 20, -18, 13, 20, -9, 51, -5, 823, -1, 0, -7, 2000, 2000, -8, 51, -10, 33, 33, -15, 51, 1, -22, 51, -2, 9, -3, 1000, -24, 27, 33, -3, 500, -2, 0, -9, 51, -13, 53, 48, -12, 51, -4}; +static int track_data_52[] = {-26, 13, 20, -18, 13, 20, -9, 52, -5, 305, -1, 0, -7, 5000, 10000, -8, 52, -10, 33, 33, -15, 52, 1, -23, 52, -2, 9, -3, 500, -22, 52, -6, 555, 80, -3, 0, -6, 833, 80, -3, 1000, -24, 27, 33, -2, 0, -9, 52, -13, 47, 50, -12, 52, -4}; +static int track_data_53[] = {-26, 13, 20, -18, 13, 20, -9, 53, -5, 356, -1, 0, -7, 3000, 3000, -8, 53, -10, 33, 33, -15, 53, 1, -23, 53, -2, 5, -22, 53, -6, 868, 200, -3, 1000, -24, 27, 33, -6, 356, 60, -3, 1000, -2, 0, -9, 53, -13, 48, 51, -12, 53, -4}; +static int track_data_54[] = {-26, 13, 20, -18, 13, 20, -9, 54, -5, 512, -1, 0, -7, 10000, 20000, -8, 54, -10, 33, 33, -15, 54, 1, -23, 54, -2, 3, -3, 500, -22, 54, -6, 768, 80, -3, 1000, -24, 27, 33, -2, 0, -9, 54, -13, 58, 55, -12, 54, -4}; +static int track_data_55[] = {-26, 13, 20, -18, 13, 20, -9, 55, -9, 56, -9, 57, -15, 55, 1, -15, 56, 1, -15, 57, 1, -5, 327, -1, 0, -7, 1000, 1000, -10, 33, 33, -23, 55, -8, 55, -2, 14, -3, 1000, -11, 56, -9, 55, -8, 56, -12, 55, -1, 0, -4}; +static int track_data_56[] = {-5, 327, -1, 0, -8, 56, -23, 56, -2, 14, -3, 1000, -11, 57, -9, 56, -8, 57, -12, 56, -1, 0, -4}; +static int track_data_57[] = {-22, 57, -5, 327, -1, 0, -8, 57, -6, 516, 80, -3, 0, -6, 843, 80, -3, 1000, -24, 27, 33, -3, 500, -2, 14, -9, 57, -13, 58, 54, -12, 57, -1, 0, -4}; +static int track_data_58[] = {-26, 13, 20, -18, 13, 20, -9, 58, -5, 922, -1, 0, -7, 3000, 3000, -8, 58, -10, 33, 33, -15, 58, 1, -23, 58, -2, 9, -3, 200, -2, 0, -25, -15, 58, 1, -23, 58, -3, 200, -2, 9, -3, 200, -2, 0, -25, -9, 58, -11, 49, -12, 58, -1, 0, -4}; +static int track_data_62[] = {-26, 13, 20, -18, 13, 20, -9, 62, -5, 465, -1, 0, -7, 3000, 3000, -8, 62, -10, 33, 33, -15, 62, 1, -23, 62, -2, 14, -3, 1000, -22, 62, -6, 650, 80, -3, 0, -6, 937, 80, -3, 1000, -24, 27, 33, -3, 500, -6, 650, 80, -3, 0, -6, 465, 80, -2, 0, -9, 62, -13, 46, 63, -12, 62, -4}; +static int track_data_63[] = {-26, 13, 20, -18, 13, 20, -9, 63, -5, 465, -1, 0, -3, 3000, -8, 63, -10, 33, 33, -15, 63, 1, -23, 63, -2, 9, -3, 1000, -22, 63, -6, 710, 80, -3, 0, -6, 960, 80, -3, 1000, -24, 27, 33, -3, 500, -6, 710, 80, -3, 0, -6, 460, 80, -2, 0, -9, 63, -13, 46, 62, -12, 63, -4}; + +void SceneScriptPS13::SceneLoaded() { + Obstacle_Object("PARKMETR01", true); + Obstacle_Object("PARKMETR02", true); + Obstacle_Object("PARKMETR03", true); + Obstacle_Object("PARKMETR07", true); + Obstacle_Object("PARKMETR08", true); + Obstacle_Object("PARKMETR10", true); + Obstacle_Object("PARKMETR11", true); + Obstacle_Object("PARKMETR15", true); + Obstacle_Object("PARKMETR16", true); + Unclickable_Object("PARKMETR01"); + Unclickable_Object("PARKMETR02"); + Unclickable_Object("PARKMETR03"); + Unclickable_Object("PARKMETR07"); + Unclickable_Object("PARKMETR08"); + Unclickable_Object("PARKMETR10"); + Unclickable_Object("PARKMETR11"); + Unclickable_Object("PARKMETR15"); + Unclickable_Object("PARKMETR16"); + if (!Query_System_Currently_Loading_Game()) { + Item_Add_To_World(46, 443, 14, -372.0f, -9.0f, 1509.0f, 960, 72, 36, true, false, false, true); + Item_Add_To_World(47, 443, 14, 291.61f, -0.66f, 1610.3f, 823, 72, 36, true, false, false, true); + Item_Add_To_World(48, 447, 14, -25.0f, 102.0f, 1625.0f, 823, 72, 36, true, false, false, true); + Item_Add_To_World(49, 449, 14, -45.51f, -8.8f, 1676.0f, 922, 72, 36, true, false, false, true); + Item_Add_To_World(50, 447, 14, 291.61f, -0.66f, 1610.3f, 823, 72, 36, true, false, false, true); + Item_Add_To_World(51, 443, 14, -24.0f, 102.0f, 1625.0f, 823, 72, 36, true, false, false, true); + Item_Add_To_World(52, 449, 14, 180.0f, -72.7f, 1605.0f, 305, 72, 36, true, false, false, true); + Item_Add_To_World(53, 443, 14, 127.79f, 14.56f, 1703.03f, 356, 72, 36, true, false, false, true); + Item_Add_To_World(54, 443, 14, 136.37f, -6.84f, 1425.4301f, 512, 72, 36, true, false, false, true); + Item_Add_To_World(55, 441, 14, 77.83f, -79.8f, 1520.5f, 327, 72, 36, true, false, false, true); + Item_Add_To_World(56, 441, 14, 77.83f, -7.8f, 1520.5f, 327, 72, 36, true, false, false, true); + Item_Add_To_World(57, 443, 14, -88.0f, -8.8f, 1520.5f, 327, 72, 36, true, false, false, true); + Item_Add_To_World(58, 447, 14, -45.51f, -8.8f, 1676.0f, 922, 72, 36, true, false, false, true); + Item_Add_To_World(62, 445, 14, -300.0f, -79.75f, 1543.0f, 465, 72, 36, true, false, false, true); + Item_Add_To_World(63, 449, 14, -325.0f, -7.75f, 1543.0f, 465, 72, 36, true, false, false, true); + } + Police_Maze_Target_Track_Add(46, -372.0f, -9.0f, 1509.0f, -345.0f, -9.0f, 1509.0f, 6, track_data_46, true); + Police_Maze_Target_Track_Add(47, 291.61f, -0.66f, 1610.3f, 238.83f, 1.03f, 1557.03f, 10, track_data_47, true); + Police_Maze_Target_Track_Add(48, -25.0f, 102.0f, 1625.0f, -25.0f, 138.0f, 1625.0f, 10, track_data_48, true); + Police_Maze_Target_Track_Add(49, -45.51f, -8.8f, 1676.0f, 15.51f, -8.8f, 1679.0f, 10, track_data_49, false); + Police_Maze_Target_Track_Add(50, 291.61f, -0.66f, 1610.3f, 238.83f, 1.03f, 1557.03f, 10, track_data_50, false); + Police_Maze_Target_Track_Add(51, -24.0f, 102.0f, 1625.0f, -24.0f, 138.0f, 1625.0f, 10, track_data_51, false); + Police_Maze_Target_Track_Add(52, 180.0f, -72.7f, 1605.0f, 180.0f, -0.7f, 1605.0f, 10, track_data_52, false); + Police_Maze_Target_Track_Add(53, 127.79f, 14.56f, 1703.03f, -56.07f, 1.89f, 1589.04f, 6, track_data_53, false); + Police_Maze_Target_Track_Add(54, 136.37f, -6.84f, 1425.4301f, 117.55f, -6.84f, 1442.09f, 4, track_data_54, false); + Police_Maze_Target_Track_Add(55, 77.83f, -79.8f, 1520.5f, 77.83f, -7.8f, 1520.5f, 15, track_data_55, false); + Police_Maze_Target_Track_Add(56, 77.83f, -7.8f, 1520.5f, -88.0f, -8.8f, 1520.5f, 15, track_data_56, false); + Police_Maze_Target_Track_Add(57, -88.0f, -8.8f, 1520.5f, -88.0f, -80.8f, 1520.5f, 15, track_data_57, false); + Police_Maze_Target_Track_Add(58, -45.51f, -8.8f, 1676.0f, 15.51f, -8.8f, 1679.0f, 10, track_data_58, true); + Police_Maze_Target_Track_Add(62, -300.0f, -79.75f, 1543.0f, -300.0f, -14.75f, 1543.0f, 15, track_data_62, false); + Police_Maze_Target_Track_Add(63, -325.0f, -7.75f, 1543.0f, -300.0f, -7.75f, 1543.0f, 10, track_data_63, false); +} + +bool SceneScriptPS13::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptPS13::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptPS13::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptPS13::ClickedOnItem(int itemId, bool a2) { + if (Player_Query_Combat_Mode()) { + switch (itemId) { + case 48: + Sound_Play(4, 50, 0, 0, 50); + break; + case 50: + Sound_Play(4, 50, 0, 0, 50); + break; + case 55: + Sound_Play(555, 50, 0, 0, 50); + break; + case 56: + Sound_Play(555, 50, 0, 0, 50); + break; + default: + Sound_Play(2, 12, 0, 0, 50); + break; + } + Item_Spin_In_World(itemId); + Item_Flag_As_Non_Target(itemId); + if (itemId == 46) { + Item_Flag_As_Non_Target(46); + } + if (itemId == 47) { + Item_Flag_As_Non_Target(47); + } + if (itemId == 48) { + Item_Flag_As_Non_Target(48); + } + if (itemId == 49) { + Item_Flag_As_Non_Target(49); + } + if (itemId == 50) { + Item_Flag_As_Non_Target(50); + } + if (itemId == 51) { + Item_Flag_As_Non_Target(51); + } + if (itemId == 52) { + Item_Flag_As_Non_Target(52); + } + if (itemId == 53) { + Item_Flag_As_Non_Target(53); + } + if (itemId == 54) { + Item_Flag_As_Non_Target(54); + } + if (itemId == 55) { + Item_Flag_As_Non_Target(55); + Item_Flag_As_Non_Target(56); + Item_Flag_As_Non_Target(57); + } + if (itemId == 56) { + Item_Flag_As_Non_Target(55); + Item_Flag_As_Non_Target(56); + Item_Flag_As_Non_Target(57); + } + if (itemId == 57) { + Item_Flag_As_Non_Target(55); + Item_Flag_As_Non_Target(56); + Item_Flag_As_Non_Target(57); + } + if (itemId == 58) { + Item_Flag_As_Non_Target(58); + } + if (itemId == 62) { + Item_Flag_As_Non_Target(62); + } + if (itemId == 63) { + Item_Flag_As_Non_Target(63); + } + return true; + } + return false; + +} + +bool SceneScriptPS13::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_Waypoint(0, 10, 12, 1, false)) { + Game_Flag_Set(19); + sub_40267C(); + Set_Enter(14, 75); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_Waypoint(0, 11, 12, 1, false)) { + Game_Flag_Set(21); + Player_Set_Combat_Mode(false); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + sub_40267C(); + Global_Variable_Decrement(9, 20 - Global_Variable_Query(13)); + Set_Score(0, Global_Variable_Query(9)); + Global_Variable_Reset(10); + Global_Variable_Reset(11); + Global_Variable_Reset(12); + Global_Variable_Reset(13); + Global_Variable_Reset(9); + Set_Enter(15, 69); + } + return true; + } + return false; +} + +bool SceneScriptPS13::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptPS13::SceneFrameAdvanced(int frame) { +} + +void SceneScriptPS13::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptPS13::PlayerWalkedIn() { + Police_Maze_Set_Pause_State(0); +} + +void SceneScriptPS13::PlayerWalkedOut() { +} + +void SceneScriptPS13::DialogueQueueFlushed(int a1) { +} + +void SceneScriptPS13::sub_40267C() { + Item_Remove_From_World(46); + Item_Remove_From_World(47); + Item_Remove_From_World(48); + Item_Remove_From_World(49); + Item_Remove_From_World(50); + Item_Remove_From_World(51); + Item_Remove_From_World(52); + Item_Remove_From_World(53); + Item_Remove_From_World(54); + Item_Remove_From_World(55); + Item_Remove_From_World(56); + Item_Remove_From_World(57); + Item_Remove_From_World(58); + Item_Remove_From_World(62); + Item_Remove_From_World(63); +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ps14.cpp b/engines/bladerunner/script/scene/ps14.cpp new file mode 100644 index 0000000000..54b5d19498 --- /dev/null +++ b/engines/bladerunner/script/scene/ps14.cpp @@ -0,0 +1,127 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptPS14::InitializeScene() { + if (Game_Flag_Query(134)) { + Setup_Scene_Information(-1119.61f, 508.14f, -1208.22f, 315); + Game_Flag_Reset(134); + } else { + Setup_Scene_Information(-785.45f, 508.14f, -1652.0f, 315); + } + Scene_Exit_Add_2D_Exit(0, 610, 0, 639, 479, 1); + Scene_Exit_Add_2D_Exit(1, 46, 51, 125, 192, 0); + Ambient_Sounds_Add_Looping_Sound(381, 100, 1, 1); + Ambient_Sounds_Add_Sound(374, 100, 300, 16, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(68, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(69, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(375, 60, 180, 50, 100, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(376, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(377, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0); +} + +void SceneScriptPS14::SceneLoaded() { + Obstacle_Object("CABLES UPPER RIGHT", true); + Unobstacle_Object("CYLINDER63", true); + Clickable_Object("CABLES UPPER RIGHT"); + Unclickable_Object("CABLES UPPER RIGHT"); +} + +bool SceneScriptPS14::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptPS14::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptPS14::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptPS14::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptPS14::ClickedOnExit(int exitId) { + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -2101.0f, 508.14f, -1361.0f, 0, 1, false, 0)) { + Actor_Face_Heading(0, 819, false); + Loop_Actor_Travel_Stairs(0, 3, 1, 0); + if (Global_Variable_Query(1) == 4 && Game_Flag_Query(671)) { + if (Actor_Clue_Query(0, 32)) { + Game_Flag_Set(666); + Actor_Set_Goal_Number(0, 400); + } else { + Actor_Set_Goal_Number(0, 500); + } + } else if (Global_Variable_Query(1) > 3) { + Actor_Says(0, 8522, 12); + Actor_Face_Heading(0, 307, false); + Loop_Actor_Travel_Stairs(0, 3, 0, 0); + } else { + Game_Flag_Set(135); + Set_Enter(63, 67); + } + } + return true; + } + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -785.45f, 508.14f, -1652.0f, 0, 1, false, 0)) { + Game_Flag_Set(673); + Game_Flag_Reset(178); + Game_Flag_Set(179); + Set_Enter(53, 53); + } + return true; + } + return false; +} + +bool SceneScriptPS14::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptPS14::SceneFrameAdvanced(int frame) { +} + +void SceneScriptPS14::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptPS14::PlayerWalkedIn() { + if (Game_Flag_Query(672)) { + Loop_Actor_Walk_To_XYZ(0, -801.45f, 508.14f, -1596.68f, 0, 0, false, 0); + Game_Flag_Reset(672); + } + //return false; +} + +void SceneScriptPS14::PlayerWalkedOut() { +} + +void SceneScriptPS14::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ps15.cpp b/engines/bladerunner/script/scene/ps15.cpp new file mode 100644 index 0000000000..a9a058d599 --- /dev/null +++ b/engines/bladerunner/script/scene/ps15.cpp @@ -0,0 +1,173 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptPS15::InitializeScene() { + Setup_Scene_Information(-360.0f, -113.43f, 50.0f, 0); + Scene_Exit_Add_2D_Exit(0, 0, 0, 20, 479, 3); + Scene_Exit_Add_2D_Exit(1, 620, 0, 639, 479, 1); + Ambient_Sounds_Add_Looping_Sound(384, 20, 1, 1); + Ambient_Sounds_Add_Looping_Sound(141, 80, 0, 1); + Ambient_Sounds_Add_Sound(385, 5, 50, 8, 8, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(156, 5, 20, 30, 30, -70, 70, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(157, 5, 20, 30, 30, -70, 70, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(158, 5, 20, 30, 30, -70, 70, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(73, 5, 20, 5, 9, -70, 70, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(74, 5, 20, 5, 9, -70, 70, -101, -101, 0, 0); + Actor_Put_In_Set(34, 101); + Actor_Set_At_XYZ(34, -265.4f, -113.43f, -31.29f, 623); +} + +void SceneScriptPS15::SceneLoaded() { + Obstacle_Object("E.ARCH", true); + if (Global_Variable_Query(1) == 2) { + Item_Add_To_World(110, 983, 101, -208.0f, -113.43f, 30.28f, 750, 16, 12, false, true, false, true); + } +} + +bool SceneScriptPS15::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptPS15::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptPS15::ClickedOnActor(int actorId) { + if (actorId == 34) { + if ((Actor_Clue_Query(0, 80) || Actor_Clue_Query(0, 83)) && !Actor_Clue_Query(0, 81)) { + if (!Loop_Actor_Walk_To_XYZ(0, -256.0f, -113.43f, 43.51f, 0, 1, false, 0)) { + Actor_Face_Actor(0, 34, true); + Actor_Face_Actor(34, 0, true); + Actor_Says(0, 4470, 17); + Actor_Says(34, 130, 12); + Actor_Says(0, 4475, 18); + Actor_Says(0, 4480, 13); + Actor_Says(34, 140, 16); + Item_Pickup_Spin_Effect(965, 211, 239); + Actor_Says(34, 150, 14); + Actor_Clue_Acquire(0, 81, 1, 34); + if (!Game_Flag_Query(727)) { + Item_Remove_From_World(111); + } + } + } else { + Actor_Face_Actor(0, 34, true); + Actor_Says(0, 8600, 15); + Actor_Says(34, 190, 12); + } + return true; + } + return false; +} + +bool SceneScriptPS15::ClickedOnItem(int itemId, bool a2) { + if (itemId == 110) { + if (Actor_Clue_Query(0, 80) && Actor_Clue_Query(0, 83)) { + Actor_Says(0, 8570, 14); + } else { + Actor_Face_Actor(0, 34, true); + Actor_Face_Actor(34, 0, true); + Actor_Says(0, 4485, 17); + Actor_Says(34, 160, 14); + Actor_Says(0, 4490, 12); + Actor_Says(34, 170, 13); + Actor_Clue_Acquire(0, 80, 1, 0); + Actor_Clue_Acquire(0, 83, 1, 0); + } + return true; + } + return false; +} + +bool SceneScriptPS15::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -360.0f, -113.43f, 50.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(204); + Set_Enter(15, 69); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -183.58f, -113.43f, 91.7f, 0, 1, false, 0)) { + Actor_Says(0, 4440, 18); + Actor_Says(34, 150, 17); + Sound_Play(155, 90, 0, 0, 50); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Set_Enter(14, 73); + } + return true; + } + return false; +} + +bool SceneScriptPS15::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptPS15::SceneFrameAdvanced(int frame) { +} + +void SceneScriptPS15::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptPS15::PlayerWalkedIn() { + Loop_Actor_Walk_To_XYZ(0, -326.93f, -113.43f, 101.42f, 0, 0, false, 0); + if (!Game_Flag_Query(43)) { + Actor_Face_Actor(0, 34, true); + Actor_Face_Actor(34, 0, true); + Actor_Says(34, 0, 12); + Actor_Says(0, 4445, 18); + Actor_Says(34, 10, 12); + Actor_Says(0, 4450, 18); + Actor_Says(34, 60, 13); + Actor_Says(34, 70, 12); + Actor_Says(0, 4460, 15); + Actor_Says(34, 80, 13); + Actor_Says(0, 4465, 16); + Actor_Says(34, 90, 13); + Actor_Says(34, 100, 14); + Actor_Says(34, 110, 15); + Actor_Says(34, 120, 15); + Actor_Says(0, 4555, 14); + Game_Flag_Set(43); + //return true; + return; + } else { + //return false; + return; + } +} + +void SceneScriptPS15::PlayerWalkedOut() { +} + +void SceneScriptPS15::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/rc01.cpp b/engines/bladerunner/script/scene/rc01.cpp new file mode 100644 index 0000000000..8d8b604a89 --- /dev/null +++ b/engines/bladerunner/script/scene/rc01.cpp @@ -0,0 +1,623 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptRC01::InitializeScene() { +#if _DEBUG + //TODO: not part of game, remove + Game_Flag_Set(24); // force skip intro + // Game_Flag_Set(9); // Force flag 9 so McCoy will be in view + + Footstep_Sound_Override_On(0); +#endif + + if (!Game_Flag_Query(24)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Outtake_Play(28, 1, -1); // WSTLGO_E.VQA + Outtake_Play(41, 1, -1); // BRLOGO_E.VQA + Outtake_Play(0, 0, -1); // INTRO_E.VQA + Outtake_Play(33, 1, -1); // DSCENT_E.VQA + } + if (Game_Flag_Query(9)) { + Setup_Scene_Information(-171.16f, 5.55f, 27.28f, 616); + } else if (Game_Flag_Query(114)) { + Setup_Scene_Information(-471.98f, -0.30f, 258.15f, 616); + } else { + Setup_Scene_Information(-10.98f, -0.30f, 318.15f, 616); + } + Scene_Exit_Add_2D_Exit(0, 314, 145, 340, 255, 0); + if (Game_Flag_Query(249)) { + Scene_Exit_Add_2D_Exit(1, 482, 226, 639, 280, 2); + } + if (Global_Variable_Query(1) > 1 && Game_Flag_Query(710)) { + Scene_Exit_Add_2D_Exit(2, 0, 0, 10, 479, 3); + } + if (!Game_Flag_Query(186)) { + Scene_2D_Region_Add(0, 0, 294, 296, 479); + } + + Ambient_Sounds_Remove_All_Non_Looping_Sounds(0); + Ambient_Sounds_Add_Looping_Sound(54, 30, 0, 1); // CTRAIN1.AUD + + if (!Game_Flag_Query(186)) { + Ambient_Sounds_Add_Sound(181, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); // 67_0470R.AUD + Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); // 67_0480R.AUD + Ambient_Sounds_Add_Sound(183, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); // 67_0500R.AUD + Ambient_Sounds_Add_Sound(184, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); // 67_0540R.AUD + Ambient_Sounds_Add_Sound(185, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); // 67_0560R.AUD + Ambient_Sounds_Add_Sound(186, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); // 67_0870R.AUD + Ambient_Sounds_Add_Sound(188, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); // 67_0900R.AUD + Ambient_Sounds_Add_Sound(189, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); // 67_0940R.AUD + Ambient_Sounds_Add_Sound(190, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); // 67_0960R.AUD + Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); // 67_1070R.AUD + Ambient_Sounds_Add_Sound(192, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); // 67_1080R.AUD + Ambient_Sounds_Add_Sound(193, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); // 67_1100R.AUD + Ambient_Sounds_Add_Sound(194, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); // 67_1140R.AUD + Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); // 67_1160R.AUD + } + + Ambient_Sounds_Add_Looping_Sound(81, 60, 100, 1); // RCAMBR1.AUD + Ambient_Sounds_Add_Sound(82, 5, 30, 30, 50, -100, 100, -101, -101, 0, 0); // RCCARBY1.AUD + Ambient_Sounds_Add_Sound(83, 5, 30, 30, 55, -100, 100, -101, -101, 0, 0); // RCCARBY2.AUD + Ambient_Sounds_Add_Sound(84, 5, 30, 30, 50, -100, 100, -101, -101, 0, 0); // RCCARBY3.AUD + Ambient_Sounds_Add_Sound(67, 10, 50, 30, 50, -100, 100, -101, -101, 0, 0); // SPIN2A.AUD + Ambient_Sounds_Add_Sound(87, 20, 80, 20, 40, -100, 100, -101, -101, 0, 0); // SIREN2.AUD + + if (Game_Flag_Query(186)) { + if (!Game_Flag_Query(9) && !Game_Flag_Query(114)) { + Scene_Loop_Start_Special(0, 5, 0); + } + if (Game_Flag_Query(249)) { + Scene_Loop_Set_Default(6); + } else { + Scene_Loop_Set_Default(10); + } + } else { + if (!Game_Flag_Query(9) && !Game_Flag_Query(114)) { + Scene_Loop_Start_Special(0, 0, 0); + } + Scene_Loop_Set_Default(1); + } + + I_Sez("Blade Runner"); + I_Sez(""); + I_Sez("From the dark recesses of David Leary's imagination comes a game unlike any"); + I_Sez("other. Blade Runner immerses you in the underbelly of future Los Angeles. Right"); + I_Sez("from the start, the story pulls you in with graphic descriptions of a"); + I_Sez("grandmother doing the shimmy in her underwear, child molestation, brutal"); + I_Sez("cold-blooded slaying of innocent animals, vomiting on desks, staring at a"); + I_Sez("woman's ass, the list goes on. And when the game starts, the real fun begins -"); + I_Sez("shoot down-on-their-luck homeless people and toss them into a dumpster. Watch"); + I_Sez("with sadistic glee as a dog gets blown into chunky, bloody, bits by an"); + I_Sez("explosive, and even murder a shy little girl who loves you. If you think David"); + I_Sez("Leary is sick, and you like sick, this is THE game for you."); + I_Sez(""); + I_Sez("JW: Don't forget the wasting of helpless mutated cripples in the underground."); + I_Sez("It's such a beautiful thing!"); + I_Sez(""); + I_Sez("DL: Go ahead. Just keep beating that snarling pit bull...ignore the foam"); + I_Sez("around his jaws. There's room on the top shelf of my fridge for at least one"); + I_Sez("more head... - Psychotic Dave"); + I_Sez(""); +} + +void SceneScriptRC01::SceneLoaded() { + Obstacle_Object("HYDRANT02", true); + Obstacle_Object("PARKING METER 04", true); + Obstacle_Object("CHEVY PROP", true); + Obstacle_Object("PARKING METER 01", true); + Obstacle_Object("T-CAN01", true); + Obstacle_Object("BARICADE01", true); + Obstacle_Object("BARICADE02", true); + Obstacle_Object("DOOR LEFT", true); + Unobstacle_Object("BOX06", true); + Clickable_Object("DOORWAY01"); + Clickable_Object("DOOR LEFT"); + Clickable_Object("HYDRANT02"); + Clickable_Object("T-CAN01"); + Clickable_Object("BARICADE01"); + Clickable_Object("70_1"); + Clickable_Object("70_2"); + Clickable_Object("70_3"); + Clickable_Object("70_5"); + Clickable_Object("70_6"); + Unclickable_Object("BARICADE02"); + Unclickable_Object("BARICADE05"); + Unclickable_Object("SPINNER BODY"); + Unclickable_Object("HORSE01"); + Unclickable_Object("DOORWAY01"); + Unobstacle_Object("DOORWAY01", true); + + if (Game_Flag_Query(186)) { + Unclickable_Object("70_1"); + Unclickable_Object("70_2"); + Unclickable_Object("70_3"); + Unclickable_Object("70_5"); + Unclickable_Object("70_6"); + Unclickable_Object("BARICADE01"); + Unclickable_Object("BARICADE03"); + Unclickable_Object("BARICADE04"); + Unobstacle_Object("70_1", true); + Unobstacle_Object("70_2", true); + Unobstacle_Object("70_3", true); + Unobstacle_Object("70_5", true); + Unobstacle_Object("70_6", true); + Unobstacle_Object("BARICADE01", true); + Unobstacle_Object("BARICADE02", true); + Unobstacle_Object("BARICADE03", true); + Unobstacle_Object("BARICADE04", true); + Unobstacle_Object("BARICADE05", true); + } + + if (!Game_Flag_Query(186)) { + Preload(13); + Preload(14); + Preload(19); + Preload(582); + Preload(589); + } + + if (!Game_Flag_Query(163)) { + Item_Add_To_World(66, 938, 69, -148.60f, -0.30f, 225.15f, 256, 24, 24, false, true, false, true); + } + + if (!Game_Flag_Query(24)) { + ADQ_Flush(); + Actor_Voice_Over(1830, 99); + Actor_Voice_Over(1850, 99); + if (!Game_Flag_Query(378)) { + Actor_Voice_Over(1860, 99); + I_Sez("MG: Is David Leary a self-respecting human or is he powered by rechargeable"); + I_Sez("batteries?\n"); + } + Game_Flag_Set(24); + } +} + +bool SceneScriptRC01::MouseClick(int x, int y) { + return y >= 430; +} + +bool SceneScriptRC01::ClickedOn3DObject(const char *objectName, bool a2) { + if (Object_Query_Click("BARICADE01", objectName) + || Object_Query_Click("BARICADE03", objectName) + || Object_Query_Click("BARICADE04", objectName) + || Object_Query_Click("70_1", objectName) + || Object_Query_Click("70_2", objectName) + || Object_Query_Click("70_3", objectName) + || Object_Query_Click("70_5", objectName) + || Object_Query_Click("70_6", objectName)) { + sub_403850(); + return true; + } + + if (Object_Query_Click("HYDRANT02", objectName)) { + if (!Loop_Actor_Walk_To_Scene_Object(0, "HYDRANT02", 60, true, false)) { + if (Actor_Clue_Query(0, 26)) { + Actor_Says(0, 6975, 3); + } else { + Actor_Face_Object(0, "HYDRANT02", true); + Actor_Voice_Over(1880, 99); + Actor_Voice_Over(1890, 99); + I_Sez("JM: That McCoy--he's one funny guy! Jet-black fire truck, hehehehe..."); + Actor_Clue_Acquire(0, 26, 1, -1); + } + } + return true; + } + + if (Object_Query_Click("DOOR LEFT", objectName)) { + if (!Loop_Actor_Walk_To_Scene_Object(0, "DOOR LEFT", 48, true, false)) { + Actor_Face_Object(0, "DOOR LEFT", true); + if (!Actor_Clue_Query(0, 2) && Actor_Query_In_Set(23, 69) && Global_Variable_Query(1)) { + Actor_Set_Goal_Number(23, 0); + Actor_Face_Actor(23, 0, true); + Actor_Says(23, 0, 12); + Actor_Says(0, 4495, 13); + Actor_Clue_Acquire(0, 2, 1, 23); + } else { + Actor_Says(0, 8570, 14); + } + Actor_Clue_Acquire(0, 1, 1, -1); + } + return true; + } + + if (Object_Query_Click("T-CAN01", objectName)) { + if (!Loop_Actor_Walk_To_Scene_Object(0, "T-CAN01", 24, true, false)) { + Actor_Face_Object(0, "T-CAN01", true); + Actor_Voice_Over(1810, 99); + Actor_Voice_Over(1820, 99); + } + return true; + } + + return false; +} + +bool SceneScriptRC01::ClickedOnActor(int actorId) { + if (actorId == 23 && Global_Variable_Query(1) == 1) { + if (!Loop_Actor_Walk_To_Actor(0, 23, 36, 1, false)) { + Actor_Face_Actor(0, 23, true); + Actor_Face_Actor(23, 0, true); + if (Actor_Query_Goal_Number(23) == 1) { + Actor_Set_Goal_Number(23, 0); + } + if (Game_Flag_Query(3)) { + Actor_Says(0, 4535, 13); + Game_Flag_Set(392); + if (Actor_Clue_Query(23, 16) && !Actor_Clue_Query(0, 16)) { + Actor_Face_Object(23, "70_1", true); + Actor_Says(23, 100, 15); + Actor_Face_Actor(23, 0, true); + Actor_Clue_Acquire(0, 16, 1, 23); + Game_Flag_Reset(392); + } else if (Actor_Clue_Query(23, 17) && !Actor_Clue_Query(0, 17)) { + Actor_Face_Object(23, "70_5", true); + Actor_Says(23, 120, 19); + Actor_Face_Actor(23, 0, true); + Actor_Says(23, 130, 14); + I_Sez("JM: Did it have a huge, ugly piece of chrome on it?"); + Actor_Clue_Acquire(0, 17, 1, 23); + Game_Flag_Reset(392); + } else { + Actor_Says(23, 90, 16); + I_Sez("JM: This officer has a talent for vivid metaphors."); + if (!Game_Flag_Query(397)) { + I_Sez("DL: What is that supposed to mean? I didn't write this line..."); + Actor_Says(0, 4540, 16); + Game_Flag_Set(397); + } + Game_Flag_Reset(392); + } + } else { + I_Sez("MG: Hey, leave that officer alone.Can't you see he's busy?"); + I_Sez("JM: (...mmm, donuts..."); + Game_Flag_Set(3); + Actor_Clue_Acquire(0, 0, 1, 23); + Actor_Says(0, 4515, 13); + Game_Flag_Set(392); + Actor_Says(23, 40, 13); + if (!Game_Flag_Query(1)) { + Actor_Says(23, 50, 14); + Actor_Says(23, 60, 15); + I_Sez("MG: It's all fun and games until someone loses a tiger cub"); + Actor_Says(0, 4520, 18); + Actor_Says(23, 70, 16); + Actor_Says(0, 4525, 14); + Actor_Says(23, 80, 18); + Actor_Says(0, 4530, 15); + } + Game_Flag_Reset(392); + } + } + return true; + } + return false; +} + +bool SceneScriptRC01::ClickedOnItem(int itemId, bool a2) { + if (itemId == 66) { + Actor_Set_Goal_Number(23, 0); + if (!Loop_Actor_Walk_To_Item(0, 66, 36, 1, false)) { + Actor_Face_Item(0, 66, true); + Actor_Clue_Acquire(0, 27, 1, -1); + Actor_Face_Actor(23, 0, true); + Actor_Says(23, 20, 12); + Game_Flag_Set(163); + Item_Remove_From_World(66); + Item_Pickup_Spin_Effect(938, 426, 316); + I_Sez("JM: Chrome...is that what that is?"); + Actor_Says(0, 4505, 13); + ADQ_Flush(); + ADQ_Add(23, 30, -1); + ADQ_Add(0, 4510, 13); + I_Sez("JM: It's hard to imagine that thing on either a car or a horse."); + I_Sez("MG: McCoy! What a witty chap..."); + I_Sez("JM: He keeps me chuckling non-stop!\n"); + Loop_Actor_Walk_To_Actor(23, 0, 36, 0, false); + } + return true; + } + return false; + +} + +void SceneScriptRC01::sub_4037AC() { + Player_Loses_Control(); + Game_Flag_Set(182); + Actor_Set_Immunity_To_Obstacles(0, true); + Loop_Actor_Walk_To_XYZ(0, -151.98f, -0.3f, 318.15f, 0, 0, false, 0); + Actor_Set_Immunity_To_Obstacles(0, false); + Player_Gains_Control(); +} + +bool SceneScriptRC01::ClickedOnExit(int exitId) { + + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -174.77f, 5.55f, 25.95f, 12, 1, false, 0)) { + if (Game_Flag_Query(705)) { + Actor_Says(0, 8522, 14); + } else { + switch (Global_Variable_Query(1)) { + case 1: + case 4: + Game_Flag_Set(8); + Set_Enter(16, 79); + break; + case 2: + case 3: + case 5: + Actor_Says(0, 8522, 12); + break; + default: + return true; + } + } + } + return true; + } + if (exitId == 1) { + if (Game_Flag_Query(486)) { + Spinner_Set_Selectable_Destination_Flag(6, 1); + } + I_Sez("MG: Leaving already? The fun is just beginning!"); + if (!Loop_Actor_Walk_To_XYZ(0, -151.98f, -0.3f, 318.15f, 0, 1, false, 0)) { + Player_Loses_Control(); + Actor_Set_Immunity_To_Obstacles(0, true); + Loop_Actor_Walk_To_XYZ(0, -10.98f, -0.3f, 318.15f, 0, 0, false, 0); + if (Game_Flag_Query(486) && !Game_Flag_Query(660)) { + Actor_Voice_Over(4310, 99); + Actor_Voice_Over(4320, 99); + Actor_Voice_Over(4330, 99); + Actor_Voice_Over(4340, 99); + Actor_Voice_Over(4350, 99); + Game_Flag_Set(660); + } + Actor_Set_Immunity_To_Obstacles(0, false); + Player_Gains_Control(); + Game_Flag_Reset(176); + Game_Flag_Reset(182); + Game_Flag_Reset(179); + Game_Flag_Reset(178); + int spinnerDest; + if (Game_Flag_Query(186)) { + spinnerDest = Spinner_Interface_Choose_Dest(8, 1); + } else { + spinnerDest = Spinner_Interface_Choose_Dest(3, 1); + } + if (spinnerDest) { + switch (spinnerDest) { + case 1: + Game_Flag_Set(179); + Game_Flag_Reset(249); + Game_Flag_Set(250); + Set_Enter(49, 48); + if (Game_Flag_Query(186)) { + Scene_Loop_Start_Special(1, 9, 1); + } else { + Scene_Loop_Start_Special(1, 4, 1); + } + break; + case 3: + Game_Flag_Set(176); + Game_Flag_Reset(249); + Game_Flag_Set(248); + Set_Enter(4, 13); + if (Game_Flag_Query(186)) { + Scene_Loop_Start_Special(1, 9, 1); + } else { + Scene_Loop_Start_Special(1, 4, 1); + } + break; + case 5: + Game_Flag_Set(261); + Game_Flag_Reset(249); + Game_Flag_Set(307); + Set_Enter(17, 82); + if (Game_Flag_Query(186)) { + Scene_Loop_Start_Special(1, 9, 1); + } else { + Scene_Loop_Start_Special(1, 4, 1); + } + break; + case 4: + Game_Flag_Set(180); + Game_Flag_Reset(249); + Game_Flag_Set(252); + Set_Enter(0, 0); + if (Game_Flag_Query(186)) { + Scene_Loop_Start_Special(1, 9, 1); + } else { + Scene_Loop_Start_Special(1, 4, 1); + } + break; + case 6: + Game_Flag_Set(177); + Game_Flag_Reset(249); + Game_Flag_Set(253); + Set_Enter(7, 25); + if (Game_Flag_Query(186)) { + Scene_Loop_Start_Special(1, 9, 1); + } else { + Scene_Loop_Start_Special(1, 4, 1); + } + break; + case 7: + Game_Flag_Set(258); + Game_Flag_Reset(249); + Game_Flag_Set(254); + Set_Enter(20, 2); + if (Game_Flag_Query(186)) { + Scene_Loop_Start_Special(1, 9, 1); + } else { + Scene_Loop_Start_Special(1, 4, 1); + } + break; + case 8: + Game_Flag_Set(181); + Game_Flag_Reset(249); + Game_Flag_Set(255); + Set_Enter(54, 54); + if (Game_Flag_Query(186)) { + Scene_Loop_Start_Special(1, 9, 1); + } else { + Scene_Loop_Start_Special(1, 4, 1); + } + break; + case 9: + Game_Flag_Set(257); + Game_Flag_Reset(249); + Game_Flag_Set(256); + Set_Enter(37, 34); + if (Game_Flag_Query(186)) { + Scene_Loop_Start_Special(1, 9, 1); + } else { + Scene_Loop_Start_Special(1, 4, 1); + } + break; + default: + sub_4037AC(); + break; + } + } else { + Game_Flag_Set(178); + Game_Flag_Reset(249); + Game_Flag_Set(251); + Set_Enter(61, 65); + if (Game_Flag_Query(186)) { + Scene_Loop_Start_Special(1, 9, 1); + } else { + Scene_Loop_Start_Special(1, 4, 1); + } + } + } + return true; + } + if (exitId == 2) { + if (!Loop_Actor_Walk_To_XYZ(0, -471.98f, -0.3f, 258.15f, 4, 1, false, 0)) { + Game_Flag_Set(115); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Set_Enter(70, 80); + } + return true; + } + return false; +} + +void SceneScriptRC01::sub_403850() { + if (!Game_Flag_Query(186) && !Loop_Actor_Walk_To_Scene_Object(0, "BARICADE03", 36, true, false)) { + Actor_Set_Goal_Number(23, 0); + Actor_Face_Object(0, "BARICADE03", true); + Loop_Actor_Walk_To_Actor(23, 0, 36, 1, false); + Actor_Face_Actor(23, 0, true); + Actor_Says(0, 4500, 14); + I_Sez("MG: We don't want any of that abstract art oozing out onto the street."); + Actor_Says(23, 10, 14); + Actor_Set_Goal_Number(23, 1); + } +} + +bool SceneScriptRC01::ClickedOn2DRegion(int region) { + if (region == 0) { + sub_403850(); + return true; + } + return false; +} + +void SceneScriptRC01::SceneFrameAdvanced(int frame) { + if (frame == 1) { + Sound_Play(118, 40, 0, 0, 50); // CARDOWN3.AUD + } + if (frame == 61 || frame == 362) { + Sound_Play(116, 100, 80, 80, 50); // SPINOPN4.AUD + } + if (frame == 108 || frame == 409) { + Sound_Play(119, 100, 80, 80, 50); // SPINCLS1.AUD + } + if (frame == 183 || frame == 484) { + Sound_Play(116, 100, 80, 80, 50); // SPINOPN4.AUD + } + if (frame == 228 || frame == 523) { + Sound_Play(119, 100, 80, 80, 50); // SPINCLS1.AUD + } + if (frame == 243 || frame == 545) { + Sound_Play(117, 40, 80, 80, 50); // CARUP3.AUD + } + if (frame == 315) { + Sound_Play(118, 40, 80, 80, 50); // CARDOWN3.AUD + } +} + +void SceneScriptRC01::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptRC01::PlayerWalkedIn() { + if (Game_Flag_Query(249) && !Game_Flag_Query(9) && !Game_Flag_Query(114)) { + sub_4037AC(); + } + + if (Game_Flag_Query(114)) { + Player_Loses_Control(); + Loop_Actor_Walk_To_XYZ(0, -415.98f, -0.30f, 262.15f, 0, 0, false, 0); + Player_Gains_Control(); + Game_Flag_Reset(114); + } + + if (Game_Flag_Query(9)) { + Player_Loses_Control(); + Loop_Actor_Walk_To_XYZ(0, -203.45f, 5.55f, 85.05f, 0, 0, false, 0); + Player_Gains_Control(); + Game_Flag_Reset(9); + + if (Game_Flag_Query(1) && !Game_Flag_Query(4)) { + Actor_Voice_Over(1910, 99); + Actor_Voice_Over(1920, 99); + Actor_Voice_Over(1930, 99); + Game_Flag_Set(4); + } + //return true; + } + //return false; +} + +void SceneScriptRC01::PlayerWalkedOut() { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + if (!Game_Flag_Query(8) && !Game_Flag_Query(115) && Global_Variable_Query(1)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Outtake_Play(31, 1, -1); + } + // return 1; +} + +void SceneScriptRC01::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/rc02.cpp b/engines/bladerunner/script/scene/rc02.cpp new file mode 100644 index 0000000000..6e6000dfa3 --- /dev/null +++ b/engines/bladerunner/script/scene/rc02.cpp @@ -0,0 +1,392 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptRC02::InitializeScene() { + if (Game_Flag_Query(8)) { + Setup_Scene_Information(-103.0f, -1238.89f, 108603.04f, 1007); + } else { + Setup_Scene_Information(-20.2f, -1238.89f, 108100.73f, 539); + } + Scene_Exit_Add_2D_Exit(0, 0, 460, 639, 479, 2); + if (Game_Flag_Query(141)) { + Scene_Exit_Add_2D_Exit(1, 265, 58, 346, 154, 0); + } + Ambient_Sounds_Remove_All_Non_Looping_Sounds(0); + Ambient_Sounds_Add_Looping_Sound(71, 50, 1, 1); + Ambient_Sounds_Add_Looping_Sound(75, 75, 1, 1); + Ambient_Sounds_Add_Looping_Sound(105, 30, 100, 1); + Ambient_Sounds_Add_Sound(73, 5, 20, 10, 10, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(74, 5, 20, 10, 10, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(76, 5, 40, 6, 6, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(77, 5, 40, 6, 6, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(78, 5, 40, 6, 6, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(79, 5, 40, 6, 6, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Speech_Sound(23, 250, 10, 60, 5, 5, 100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(23, 330, 10, 60, 5, 5, 100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(24, 380, 10, 60, 5, 5, 100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(24, 510, 10, 60, 5, 5, 100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(38, 80, 10, 60, 5, 5, 100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(38, 160, 10, 60, 5, 5, 100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Sound(87, 20, 80, 10, 20, 100, 100, -101, -101, 0, 0); +} + +void SceneScriptRC02::SceneLoaded() { + Obstacle_Object("TABLETOP", true); + Obstacle_Object("DRAPE01", true); + Obstacle_Object("DRAPE03", true); + Obstacle_Object("DRAPE04", true); + Obstacle_Object("DRAPE05", true); + Obstacle_Object("DRAPE06", true); + Obstacle_Object("DRAPE07", true); + Obstacle_Object("OUTR_DESK", true); + Obstacle_Object("CAGE_BASE", true); + Obstacle_Object("POLE_ROP01", true); + Unobstacle_Object("LEGS", true); + Unobstacle_Object("SLATS01", true); + Unobstacle_Object("DRAPE07", true); + Clickable_Object("SCRTY CA03"); + Unclickable_Object("GRL_DSKLEG"); + Unclickable_Object("CURTAIN"); + Unclickable_Object("DRAPE01"); + Unclickable_Object("DRAPE02"); + Unclickable_Object("DRAPE03"); + Unclickable_Object("DRAPE05"); + Unclickable_Object("DRAPE06"); + Unclickable_Object("DRAPE07"); + if (Actor_Clue_Query(0, 12) || Global_Variable_Query(1) > 1) { + Unclickable_Object("SCRTY CA03"); + } + if (!Game_Flag_Query(190)) { + Item_Add_To_World(100, 966, 16, -52.88f, -1238.89f, 108467.74f, 256, 6, 6, false, true, false, true); + Item_Add_To_World(101, 966, 16, -37.16f, -1238.89f, 108456.59f, 512, 6, 6, false, true, false, true); + Item_Add_To_World(102, 966, 16, -62.86f, -1238.89f, 108437.52f, 625, 6, 6, false, true, false, true); + } +} + +bool SceneScriptRC02::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptRC02::ClickedOn3DObject(const char *objectName, bool a2) { + if (Object_Query_Click("SCRTY CA03", objectName) && !Actor_Clue_Query(0, 12)) { + if (Actor_Clue_Query(0, 22) && Actor_Query_Is_In_Current_Set(15)) { + AI_Movement_Track_Pause(15); + Actor_Face_Actor(0, 15, true); + Actor_Says(0, 4545, 14); + Actor_Face_Actor(15, 0, true); + Actor_Says(15, 0, 14); + Actor_Says(15, 10, 16); + Actor_Says(0, 4550, 13); + Actor_Says(15, 20, 13); + Loop_Actor_Walk_To_Waypoint(15, 89, 0, 0, false); + Actor_Face_Actor(0, 15, true); + Loop_Actor_Walk_To_Waypoint(15, 102, 0, 0, false); + Actor_Face_Actor(0, 15, true); + Actor_Face_Heading(15, 539, false); + Delay(2000); + Loop_Actor_Walk_To_Waypoint(15, 89, 0, 0, false); + Loop_Actor_Walk_To_Actor(15, 0, 24, 0, false); + Item_Pickup_Spin_Effect(975, 357, 228); + Actor_Face_Actor(0, 15, true); + Actor_Face_Actor(15, 0, true); + Actor_Says(15, 30, 23); + Actor_Says(0, 4555, 18); + Actor_Clue_Acquire(0, 12, 1, 15); + Unclickable_Object("SCRTY CA03"); + AI_Movement_Track_Unpause(15); + return true; + } else { + Actor_Face_Object(0, "SCRTY CA03", true); + Actor_Voice_Over(2000, 99); + return true; + } + } + return false; +} + +void SceneScriptRC02::sub_402A7C() { + Dialogue_Menu_Clear_List(); + DM_Add_To_List_Never_Repeat_Once_Selected(0, 5, 6, 2); + DM_Add_To_List_Never_Repeat_Once_Selected(10, 5, 4, 8); + if (Actor_Clue_Query(0, 23) || (Actor_Clue_Query(0, 24))) { + DM_Add_To_List_Never_Repeat_Once_Selected(20, 6, 4, 5); + } + Dialogue_Menu_Add_DONE_To_List(30); + Dialogue_Menu_Appear(320, 240); + int answer = Dialogue_Menu_Query_Input(); + Dialogue_Menu_Disappear(); + if (answer) { + switch (answer) { + case 10: + Actor_Says(0, 4585, 13); + Actor_Face_Actor(15, 0, true); + if (Game_Flag_Query(46)) { + Actor_Says(15, 250, 13); + Actor_Says(15, 270, 13); + Actor_Clue_Acquire(0, 23, 1, 15); + } else { + Actor_Says(15, 260, 14); + Actor_Says(15, 270, 13); + Actor_Clue_Acquire(0, 24, 1, 15); + } + Actor_Says(0, 4645, 13); + Actor_Says(15, 280, 13); + Actor_Says(15, 290, 13); + Actor_Says(0, 4650, 18); + Actor_Says(15, 320, 13); + Actor_Says(0, 4665, 13); + Actor_Face_Object(15, "CURTAIN", true); + Actor_Says(15, 350, 13); + Actor_Face_Actor(15, 0, true); + Scene_Exit_Add_2D_Exit(1, 265, 58, 346, 154, 0); + Game_Flag_Set(141); + break; + case 20: + Actor_Says(0, 4590, 19); + Actor_Face_Actor(15, 0, true); + Actor_Says(15, 360, 13); + Loop_Actor_Walk_To_Waypoint(15, 89, 0, 0, false); + Loop_Actor_Walk_To_Waypoint(15, 102, 0, 0, false); + Actor_Face_Actor(0, 15, true); + Actor_Face_Heading(15, 539, false); + Delay(2000); + Loop_Actor_Walk_To_Waypoint(15, 89, 0, 0, false); + Actor_Face_Actor(0, 15, true); + Loop_Actor_Walk_To_Actor(15, 0, 24, 0, false); + Actor_Face_Actor(15, 0, true); + Actor_Face_Actor(0, 15, true); + Item_Pickup_Spin_Effect(964, 357, 228); + Actor_Says(15, 1700, 13); + Actor_Clue_Acquire(0, 15, 1, 15); + break; + case 30: + Actor_Says(0, 4595, 14); + break; + } + } else { + Actor_Says(0, 4580, 13); + Actor_Face_Actor(15, 0, true); + Actor_Says(15, 110, 18); + Actor_Says(15, 120, 17); + Actor_Says(15, 130, 19); + Actor_Says(0, 4605, 13); + Actor_Says(15, 140, 16); + Game_Flag_Set(187); + } +} + +bool SceneScriptRC02::ClickedOnActor(int actorId) { + if (actorId != 15) { + return false; + } + + if (Global_Variable_Query(1) == 4) { + Actor_Face_Actor(0, 15, true); + if (Actor_Query_Goal_Number(15) == 599) { + if (Random_Query(1, 2) == 1) { + Actor_Says(0, 8715, 17); + } else { + Actor_Says(0, 8720, 17); + } + } else if (Game_Flag_Query(705) || Game_Flag_Query(706)) { + Actor_Says(0, 4805, 11); + Actor_Face_Actor(15, 0, true); + if (Game_Flag_Query(706)) { + Actor_Says(15, 720, 15); + } else { + Actor_Says(15, 730, 14); + } + Actor_Face_Heading(15, 1007, false); + } else { + Actor_Says(0, 4690, 11); + Actor_Says(0, 4695, 13); + Actor_Face_Actor(15, 0, true); + Actor_Says(15, 1610, 14); + if (Actor_Clue_Query(0, 76)) { + Actor_Says(0, 4700, 12); + Actor_Says(0, 4705, 13); + Actor_Says(15, 1620, 12); + Actor_Says(0, 4710, 15); + Actor_Says(0, 4715, 11); + Delay(2000); + Actor_Says(0, 4720, 16); + Actor_Says(0, 4725, 17); + Actor_Says(15, 430, 16); + Actor_Face_Heading(15, 1007, false); + } + Game_Flag_Set(706); + } + return true; + } + AI_Movement_Track_Pause(15); + Loop_Actor_Walk_To_Actor(0, 15, 48, 1, false); + Actor_Face_Actor(0, 15, true); + if (!Game_Flag_Query(6)) { + Actor_Says(0, 4560, 13); + Actor_Face_Actor(15, 0, true); + Actor_Says(15, 40, 16); + Actor_Says(15, 50, 15); + Actor_Says(0, 4565, 13); + Actor_Says(15, 60, 14); + Actor_Says(0, 4570, 18); + Actor_Says(15, 70, 13); + Game_Flag_Set(6); + Actor_Clue_Acquire(0, 22, 1, 15); + AI_Movement_Track_Unpause(15); + return true; + } + if (Game_Flag_Query(187)) { + if (Player_Query_Agenda() == 0) { + Game_Flag_Reset(0); + sub_402A7C(); + AI_Movement_Track_Unpause(15); + return true; + } + + Actor_Says(0, 4610, 19); + Actor_Face_Actor(15, 0, true); + Actor_Says(15, 150, 15); + Actor_Says(0, 4615, 13); + Actor_Says(15, 160, 14); + Actor_Says(15, 170, 15); + Actor_Says(15, 180, 13); + + if (Player_Query_Agenda() == 2) { + Actor_Says(0, 4620, 19); + Actor_Says(15, 190, 14); + Actor_Says(0, 4625, 13); + Actor_Says(15, 210, 13); + Actor_Says(0, 4630, 18); + Actor_Says(15, 220, 14); + Actor_Says(15, 230, 13); + Actor_Says(0, 4635, 19); + Actor_Says(15, 240, 16); + Actor_Says(0, 4640, 17); + } + Game_Flag_Reset(187); + AI_Movement_Track_Unpause(15); + return true; + } + sub_402A7C(); + AI_Movement_Track_Unpause(15); + return true; +} + +bool SceneScriptRC02::ClickedOnItem(int itemId, bool a2) { + if (itemId == 100 || itemId == 101 || itemId == 102) { + if (!Loop_Actor_Walk_To_Item(0, 100, 24, 1, false)) { + Actor_Face_Item(0, 100, true); + Actor_Clue_Acquire(0, 5, 1, -1); + Game_Flag_Set(190); + Item_Remove_From_World(100); + Item_Remove_From_World(101); + Item_Remove_From_World(102); + Item_Pickup_Spin_Effect(966, 395, 352); + Actor_Voice_Over(1960, 99); + } + return true; + } + return false; +} + +bool SceneScriptRC02::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -71.51f, -1238.89f, 108587.15f, 0, 1, false, 0)) { + Game_Flag_Set(9); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_Looping_Sound(71, true); + Ambient_Sounds_Remove_Looping_Sound(75, true); + Ambient_Sounds_Adjust_Looping_Sound(85, 100, -101, 1); + Actor_Set_Goal_Number(15, 0); + Set_Enter(69, 78); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -20.2f, -1238.73f, 108152.73f, 0, 1, false, 0)) { + Async_Actor_Walk_To_XYZ(0, -8.87f, -1238.89f, 108076.27f, 0, false); + Set_Enter(16, 107); + } + return true; + } + return false; +} + +bool SceneScriptRC02::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptRC02::SceneFrameAdvanced(int frame) { +} + +void SceneScriptRC02::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptRC02::PlayerWalkedIn() { + Player_Set_Combat_Mode(false); + if (Game_Flag_Query(8)) { + Player_Loses_Control(); + Loop_Actor_Walk_To_XYZ(0, -72.2f, -1238.89f, 108496.73f, 0, 0, false, 0); + Player_Gains_Control(); + Game_Flag_Reset(8); + if (!Game_Flag_Query(1)) { + Actor_Voice_Over(1970, 99); + Actor_Voice_Over(1980, 99); + Actor_Voice_Over(1990, 99); + Actor_Clue_Acquire(0, 3, 1, -1); + Actor_Clue_Acquire(0, 4, 1, -1); + Game_Flag_Set(1); + } + if (Actor_Query_Which_Set_In(15) == 16 && Actor_Query_Goal_Number(15) < 300) { + Actor_Set_Goal_Number(15, 1); + } + if (Actor_Query_Goal_Number(15) == 300 && !Game_Flag_Query(704)) { + Actor_Face_Actor(15, 0, true); + Actor_Says(15, 370, 12); + Actor_Says(15, 380, 14); + Actor_Face_Actor(0, 15, true); + Actor_Says(0, 4670, 15); + Actor_Says(15, 390, 13); + Actor_Says(0, 4675, 14); + Actor_Face_Heading(15, 1007, false); + Actor_Says(15, 400, 13); + Actor_Says(15, 410, 12); + Game_Flag_Set(704); + } + } else { + Player_Loses_Control(); + Loop_Actor_Walk_To_XYZ(0, -20.2f, -1238.89f, 108152.73f, 0, 0, false, 0); + Player_Gains_Control(); + } +} + +void SceneScriptRC02::PlayerWalkedOut() { +} + +void SceneScriptRC02::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/rc03.cpp b/engines/bladerunner/script/scene/rc03.cpp new file mode 100644 index 0000000000..17e96f3895 --- /dev/null +++ b/engines/bladerunner/script/scene/rc03.cpp @@ -0,0 +1,301 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptRC03::InitializeScene() { + if (Game_Flag_Query(115) ) { + Setup_Scene_Information(298.0f, -4.0f, 405.0f, 800); + Game_Flag_Reset(115); + } else if (Game_Flag_Query(117) ) { + Setup_Scene_Information(-469.0f, -4.0f, 279.0f, 250); + } else if (Game_Flag_Query(119) ) { + Setup_Scene_Information(147.51f, -4.0f, 166.48f, 500); + if (!Game_Flag_Query(151)) { + Game_Flag_Set(151); + } + } else if (Game_Flag_Query(107) ) { + Setup_Scene_Information(-487.0f, 1.0f, 116.0f, 400); + } else if (Game_Flag_Query(121) ) { + Setup_Scene_Information(-22.0f, 1.0f, -63.0f, 400); + } else { + Setup_Scene_Information(0.0f, 0.0f, 0.0f, 0); + } + Scene_Exit_Add_2D_Exit(0, 610, 0, 639, 479, 1); + Scene_Exit_Add_2D_Exit(1, 0, 0, 30, 479, 3); + if (Game_Flag_Query(151) ) { + Scene_Exit_Add_2D_Exit(2, 524, 350, 573, 359, 2); + } + Scene_Exit_Add_2D_Exit(3, 85, 255, 112, 315, 0); + Scene_Exit_Add_2D_Exit(4, 428, 260, 453, 324, 0); + Ambient_Sounds_Add_Looping_Sound(54, 50, 0, 1); + Ambient_Sounds_Add_Sound(82, 5, 30, 40, 70, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(83, 5, 30, 40, 75, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(84, 5, 30, 40, 70, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Speech_Sound(60, 0, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 20, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 40, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Speech_Sound(60, 50, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1); + Ambient_Sounds_Add_Sound(68, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(69, 60, 180, 16, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(375, 60, 180, 50, 100, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(376, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(377, 50, 180, 50, 100, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(181, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(183, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(184, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(185, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(186, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(188, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(189, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(190, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(192, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(193, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(194, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + if (Game_Flag_Query(107) && Actor_Query_Goal_Number(7) != 102) { + Scene_Loop_Start_Special(0, 0, 0); + } + Scene_Loop_Set_Default(1); +} + +void SceneScriptRC03::SceneLoaded() { + Obstacle_Object("Box-Streetlight01", true); + Obstacle_Object("Box-Streetlight02", true); + Obstacle_Object("Parking Meter 01", true); + Obstacle_Object("Parking Meter 02", true); + Obstacle_Object("Parking Meter 03", true); + Obstacle_Object("Trash can with fire", true); + Obstacle_Object("Baricade01", true); + Obstacle_Object("Foreground Junk01", true); + Obstacle_Object("Steam01", true); + Obstacle_Object("Steam02", true); + Obstacle_Object("Box-BBcolumn01", true); + Obstacle_Object("Box-BBcolumn02", true); + Obstacle_Object("Box-BBcolumn03", true); + Obstacle_Object("Box-BBcolumn04", true); + Obstacle_Object("Box-BBbuilding01", true); + Obstacle_Object("Box-BBbuilding02", true); + Obstacle_Object("Box-BBbuilding03", true); + Obstacle_Object("Box-BBbuilding04", true); + Unclickable_Object("BOX-BBBUILDING01"); + Unclickable_Object("BOX-BBBUILDING02"); + Unclickable_Object("BOX-BBBUILDING03"); + Unclickable_Object("BOX-BBBUILDING04"); + Unclickable_Object("BOX-STREETLIGHT01"); + Unclickable_Object("BOX-STREETLIGHT02"); + Unclickable_Object("BOX-BBCOLUMN01"); + Unclickable_Object("BOX-BBCOLUMN02"); + Unclickable_Object("BOX-BBCOLUMN03"); + Unclickable_Object("BOX-BBCOLUMN04"); + Unclickable_Object("PARKING METER 02"); + Unclickable_Object("PARKING METER 03"); + Unclickable_Object("TRASH CAN WITH FIRE"); + Unclickable_Object("BARICADE01"); + Unclickable_Object("FOREGROUND JUNK01"); +} + +bool SceneScriptRC03::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptRC03::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptRC03::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptRC03::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptRC03::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, 298.0f, -4.0f, 405.0f, 0, 1, false, 0)) { + if (Game_Flag_Query(289)) { + Game_Flag_Set(702); + } + Game_Flag_Set(114); + Set_Enter(69, 78); + Actor_Set_Goal_Number(3, 100); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -469.0f, -4.0f, 279.0f, 0, 1, false, 0)) { + if (Game_Flag_Query(289)) { + Game_Flag_Set(702); + } + Game_Flag_Set(116); + Game_Flag_Reset(182); + Game_Flag_Set(180); + Set_Enter(0, 1); + } + return true; + } + if (exitId == 2) { + if (!Loop_Actor_Walk_To_XYZ(0, 147.51f, -4.0f, 166.48f, 0, 1, false, 0)) { + Game_Flag_Set(118); + Game_Flag_Reset(182); + Game_Flag_Set(259); + if (Game_Flag_Query(289)) { + Game_Flag_Set(702); + } + Set_Enter(74, 86); + Actor_Set_Goal_Number(3, 100); + } + return true; + } + if (exitId == 3) { + if (!Loop_Actor_Walk_To_XYZ(0, -487.0f, 1.0f, 116.0f, 0, 1, false, 0)) { + Game_Flag_Set(108); + Game_Flag_Reset(182); + Game_Flag_Set(479); + if (Game_Flag_Query(289)) { + Game_Flag_Set(702); + } + Set_Enter(8, 106); + Actor_Set_Goal_Number(3, 100); + } + return true; + } + if (exitId == 4) { + if (!Loop_Actor_Walk_To_XYZ(0, -22.0f, 1.0f, -63.0f, 0, 1, false, 0)) { + if (Global_Variable_Query(1) == 3 || Global_Variable_Query(1) == 5 || Game_Flag_Query(702)) { + Actor_Says(0, 8522, 14); + } else { + Game_Flag_Set(120); + Set_Enter(71, 81); + } + } + return true; + } + return false; +} + +bool SceneScriptRC03::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptRC03::SceneFrameAdvanced(int frame) { + if (frame == 1) { + Sound_Play(286, Random_Query(33, 33), 100, -100, 50); + } + if (frame == 15) { + Sound_Play(287, Random_Query(50, 50), -100, 100, 50); + } +} + +void SceneScriptRC03::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptRC03::sub_402834() { + Actor_Face_Actor(1, 0, true); + Actor_Says(1, 1820, 3); + Actor_Face_Actor(0, 1, true); + Actor_Says(0, 4815, 14); + Actor_Says(1, 1830, 3); + Actor_Says(1, 1840, 3); + Actor_Says(0, 4820, 12); + Actor_Says(1, 1850, 3); + Actor_Says(1, 1950, 3); + Actor_Says(0, 4835, 14); + Actor_Says(1, 1960, 3); + Actor_Says(1, 1980, 3); + Actor_Says(0, 4840, 15); + Actor_Says(1, 1990, 3); + Actor_Says(1, 2000, 3); +} + +void SceneScriptRC03::PlayerWalkedIn() { + if (Actor_Query_Goal_Number(7) == 102) { + Scene_Exits_Disable(); + if (Game_Flag_Query(119) ) { + Player_Set_Combat_Mode(false); + Player_Loses_Control(); + Actor_Set_At_XYZ(0, 147.51f, -4.0f, 166.48f, 500); + Actor_Put_In_Set(7, 70); + Actor_Set_At_XYZ(7, 196.0f, -4.0f, 184.0f, 775); + Actor_Face_Actor(7, 0, true); + Actor_Face_Actor(0, 7, true); + Actor_Change_Animation_Mode(7, 4); + Actor_Says_With_Pause(7, 630, 0, -1); + Actor_Says_With_Pause(7, 640, 0, -1); + Actor_Says_With_Pause(7, 650, 0, -1); + if (Game_Flag_Query(44) ) { + Actor_Set_Goal_Number(1, 100); + } + Actor_Change_Animation_Mode(0, 20); + Loop_Actor_Walk_To_XYZ(7, 180.0f, -4.0f, 184.0f, 0, 0, false, 0); + Actor_Change_Animation_Mode(7, 6); + if (!Game_Flag_Query(44)) { + Actor_Set_Goal_Number(1, 100); + } + Player_Gains_Control(); + } else { + Actor_Put_In_Set(7, 70); + Actor_Set_At_XYZ(7, -226.0f, 1.72f, 86.0f, 0); + Actor_Set_Targetable(7, true); + Actor_Set_Goal_Number(7, 110); + } + } + if (Actor_Query_Goal_Number(7) == 103) { + Player_Loses_Control(); + Actor_Set_Goal_Number(1, 200); + Actor_Put_In_Set(1, 70); + if (Game_Flag_Query(119) || Game_Flag_Query(121) ) { + Actor_Set_At_Waypoint(1, 175, 0); + } else { + Actor_Set_At_Waypoint(1, 203, 0); + } + sub_402834(); + Async_Actor_Walk_To_Waypoint(1, 174, 0, 0); + Actor_Set_Goal_Number(7, 200); + Player_Gains_Control(); + } + Game_Flag_Reset(119); + Game_Flag_Reset(117); + Game_Flag_Reset(107); + Game_Flag_Reset(121); + if (Global_Variable_Query(1) == 1 || Global_Variable_Query(1) == 2) { + Actor_Set_Goal_Number(3, 103); + } +} + +void SceneScriptRC03::PlayerWalkedOut() { + if (Actor_Query_Goal_Number(7) == 199) { + Actor_Set_Goal_Number(7, 198); + } + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); +} + +void SceneScriptRC03::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/rc04.cpp b/engines/bladerunner/script/scene/rc04.cpp new file mode 100644 index 0000000000..e28653058f --- /dev/null +++ b/engines/bladerunner/script/scene/rc04.cpp @@ -0,0 +1,420 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptRC04::InitializeScene() { + Setup_Scene_Information(45.0f, 0.15f, 68.0f, 1018); + Game_Flag_Reset(120); + Scene_Exit_Add_2D_Exit(0, 225, 47, 359, 248, 0); + if (!Game_Flag_Query(289)) { + Actor_Put_In_Set(14, 71); + Actor_Set_At_XYZ(14, -60.0f, -11.0f, 62.0f, 12); + } + if (Game_Flag_Query(289)) { + Actor_Change_Animation_Mode(14, 88); + } + Ambient_Sounds_Add_Looping_Sound(381, 100, 1, 1); + Ambient_Sounds_Add_Sound(82, 5, 30, 10, 20, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(83, 5, 30, 10, 20, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(84, 5, 30, 10, 20, -100, 100, -101, -101, 0, 0); +} + +void SceneScriptRC04::SceneLoaded() { + Obstacle_Object("Door New 01", true); + Obstacle_Object("GRNDNEON05", true); + Obstacle_Object("GRNDNEON06", true); + Obstacle_Object("GRNDNEON07", true); + Unobstacle_Object("DisplayTrim", true); + Unobstacle_Object("Display01", true); + Actor_Set_Goal_Number(67, 200); +} + +bool SceneScriptRC04::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptRC04::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +void SceneScriptRC04::sub_401DF4() { + Dialogue_Menu_Clear_List(); + if (Actor_Clue_Query(0, 11) && !Actor_Clue_Query(0, 62)) { + DM_Add_To_List_Never_Repeat_Once_Selected(580, -1, 4, 9); + } + if (Actor_Clue_Query(0, 5) && !Actor_Clue_Query(0, 11) && !Actor_Clue_Query(0, 62)) { + DM_Add_To_List_Never_Repeat_Once_Selected(590, 6, 5, 3); + } + if (Actor_Clue_Query(0, 57)) { + DM_Add_To_List_Never_Repeat_Once_Selected(600, -1, 3, 7); + DM_Add_To_List_Never_Repeat_Once_Selected(1310, -1, 2, 8); + } + if (Actor_Clue_Query(0, 62) && !Actor_Clue_Query(0, 63)) { + DM_Add_To_List_Never_Repeat_Once_Selected(610, 4, 5, 6); + } + if (!Game_Flag_Query(305)) { + DM_Add_To_List_Never_Repeat_Once_Selected(1280, 1, 2, 3); + } + if (Actor_Clue_Query(0, 110) && !Actor_Clue_Query(14, 110)) { + DM_Add_To_List_Never_Repeat_Once_Selected(620, 1, -1, -1); + } + Dialogue_Menu_Add_DONE_To_List(630); + Dialogue_Menu_Appear(320, 240); + int answer = Dialogue_Menu_Query_Input(); + Dialogue_Menu_Disappear(); + + switch (answer) { + case 580: + Actor_Says(0, 4955, 30); + Actor_Says(14, 210, 37); + Actor_Says(14, 220, 37); + Actor_Says(14, 230, 37); + Actor_Says(14, 240, 37); + Actor_Says(0, 4990, 16); + Actor_Says(0, 4995, 11); + Actor_Says(14, 270, 31); + Actor_Says(0, 5005, 16); + Actor_Says(14, 280, 32); + Actor_Says(14, 290, 30); + Actor_Says(14, 300, 33); + Actor_Says(14, 310, 31); + Actor_Says(0, 5010, 11); + Actor_Says(14, 320, 30); + Actor_Says(14, 330, 33); + Actor_Says(14, 340, 37); + Actor_Says(0, 5015, 11); + if (Game_Flag_Query(44)) { + Actor_Says(14, 350, 32); + Actor_Says(14, 360, 33); + Actor_Says(14, 370, 30); + Actor_Says(0, 5020, 16); + Actor_Says(14, 380, 37); + Actor_Says(14, 390, 11); + Actor_Says(14, 400, 37); + Actor_Clue_Acquire(0, 58, 1, 0); + } else { + Actor_Says(14, 410, 11); + Actor_Says(14, 420, 37); + Actor_Says(0, 5025, 16); + Actor_Says(14, 430, 30); + Actor_Says(14, 440, 31); + Actor_Says(14, 450, 32); + Actor_Says(0, 5030, 16); + Actor_Says(14, 460, 37); + Actor_Clue_Acquire(0, 59, 1, 0); + } + return; + case 590: + Actor_Says(0, 4960, 13); + Actor_Says(14, 250, 30); + Actor_Says(14, 260, 33); + Actor_Says(0, 4995, 15); + Actor_Says(14, 270, 32); + Actor_Says(0, 5005, 11); + Actor_Says(14, 280, 33); + Actor_Says(14, 290, 30); + Actor_Says(14, 300, 32); + Actor_Says(14, 310, 37); + Actor_Says(0, 5010, 13); + Actor_Says(14, 320, 37); + Actor_Says(14, 330, 33); + Actor_Says(14, 340, 11); + Actor_Says(0, 5015, 16); + Actor_Modify_Friendliness_To_Other(14, 0, 3); + if (Game_Flag_Query(44)) { + Actor_Says(14, 350, 32); + Actor_Says(14, 360, 30); + Actor_Says(14, 370, 33); + Actor_Says(0, 5020, 15); + Actor_Says(14, 380, 33); + Actor_Says(14, 390, 37); + Actor_Says(14, 400, 32); + Actor_Clue_Acquire(0, 58, 1, 0); + } else { + Actor_Says(14, 410, 32); + Actor_Says(14, 420, 30); + Actor_Says(0, 5025, 13); + Actor_Says(14, 430, 33); + Actor_Says(14, 440, 32); + Actor_Says(14, 450, 37); + Actor_Says(0, 5030, 16); + Actor_Says(14, 460, 30); + Actor_Clue_Acquire(0, 59, 1, 0); + } + break; + case 600: + Actor_Says(0, 4965, 11); + Actor_Says(14, 470, 11); + Actor_Says(0, 5035, 15); + Actor_Says(14, 480, 30); + Actor_Says(14, 490, 31); + Actor_Says(14, 500, 32); + Actor_Says(14, 510, 33); + Actor_Says(14, 520, 34); + Actor_Says(14, 530, 35); + Actor_Says(14, 540, 36); + Actor_Says(0, 5040, 16); + Actor_Says(14, 550, 11); + Actor_Modify_Friendliness_To_Other(14, 0, -6); + break; + case 610: + Actor_Says(0, 4970, 16); + if (Actor_Query_Friendliness_To_Other(14, 0) < 50) { + Actor_Says(14, 700, 11); + Actor_Says(0, 5070, 11); + Actor_Says(14, 710, 11); + Actor_Says(0, 5075, 15); + Actor_Says(14, 720, 30); + Actor_Says(0, 5080, 11); + Actor_Says(14, 730, 37); + Actor_Clue_Acquire(0, 58, 1, 0); + } else { + Actor_Says(14, 560, 37); + Actor_Says(0, 5070, 13); + Actor_Says(14, 570, 36); + Actor_Says(14, 580, 37); + Actor_Says(14, 590, 31); + Actor_Says(14, 600, 32); + Actor_Says(14, 610, 30); + Actor_Says(0, 5050, 16); + Actor_Says(14, 620, 35); + Actor_Says(14, 630, 35); + Actor_Says(0, 5055, 11); + Actor_Says(14, 640, 36); + Actor_Says(14, 650, 35); + Actor_Says(14, 660, 30); + Actor_Says(0, 5060, 13); + Actor_Clue_Acquire(0, 63, 1, 0); + } + break; + case 1280: + Actor_Says(0, 9040, 16); + if (!Game_Flag_Query(305)) { + Actor_Says(14, 2080, 30); + Actor_Says(14, 2090, 37); + Actor_Says(0, 9045, 14); + Actor_Says(14, 2100, 32); + Actor_Says(14, 2110, 37); + Game_Flag_Set(305); + } + Actor_Says(14, 2120, 31); + if (Global_Variable_Query(2) > 40 || Query_Difficulty_Level() == 0) { + Actor_Says(0, 4940, 13); + if (Query_Difficulty_Level() != 0) { + Global_Variable_Decrement(2, 40); + } + Item_Pickup_Spin_Effect(995, 405, 192); + Give_McCoy_Ammo(1, 24); + } else { + Actor_Says(0, 125, 13); + Actor_Modify_Friendliness_To_Other(14, 0, -2); + } + break; + case 1310: + Actor_Says(0, 4980, 11); + if (Actor_Query_Friendliness_To_Other(14, 0) > 49) { + Actor_Says(14, 740, 37); + Actor_Says(0, 5085, 16); + Actor_Says(14, 750, 37); + Actor_Says(14, 760, 37); + Voight_Kampff_Activate(14, 50); + Actor_Modify_Friendliness_To_Other(14, 0, 3); + Actor_Says(14, 810, 37); + Actor_Says(0, 5025, 13); + Actor_Says(14, 820, 32); + Actor_Says(0, 5100, 11); + Actor_Says(14, 830, 31); + Actor_Says(14, 840, 35); + } else { + Actor_Says(14, 770, 36); + Actor_Says(14, 780, 36); + Actor_Says(0, 5090, 16); + Actor_Says(14, 790, 36); + Actor_Says(14, 800, 35); + Voight_Kampff_Activate(14, 50); + Actor_Says(14, 810, 30); + Actor_Says(0, 5025, 13); + Actor_Says(14, 820, 31); + Actor_Says(0, 5100, 15); + Actor_Says(14, 830, 34); + Actor_Says(14, 840, 34); + } + break; + case 620: + Actor_Says(0, 4985, 11); + Actor_Says(14, 850, 35); + Actor_Says(0, 5105, 13); + Actor_Says(0, 5110, 11); + Actor_Says(14, 860, 30); + Actor_Says(0, 5115, 16); + Actor_Says(14, 870, 31); + Actor_Says(0, 5120, 15); + Actor_Says(14, 880, 34); + Actor_Clue_Acquire(14, 110, 1, 0); + Actor_Modify_Friendliness_To_Other(14, 0, 8); + if (Query_Difficulty_Level() != 0) { + Global_Variable_Increment(2, 60); + } + break; + case 630: + Actor_Says(0, 1315, 12); + break; + } +} + +bool SceneScriptRC04::ClickedOnActor(int actorId) { + if (Player_Query_Combat_Mode()) { + return false; + } + if (actorId == 14 && Global_Variable_Query(1) == 2 && !Game_Flag_Query(289)) { + Loop_Actor_Walk_To_Waypoint(0, 104, 0, 0, false); + Actor_Face_Actor(0, 14, true); + if (Game_Flag_Query(287) && !Game_Flag_Query(292) && Actor_Query_Friendliness_To_Other(14, 0) > 45) { + Actor_Says(14, 30, 30); + Actor_Says(0, 4875, 13); + Actor_Says(14, 80, 31); + Actor_Says(0, 4900, 15); + Actor_Says(14, 90, 33); + Actor_Says(14, 100, 34); + Actor_Says(0, 4905, 15); + Game_Flag_Set(292); + } else if (Game_Flag_Query(287) && !Game_Flag_Query(290) && Actor_Query_Friendliness_To_Other(14, 0) < 45) { + Actor_Says(14, 40, 30); + Actor_Says(0, 4880, 13); + Actor_Says(14, 50, 35); + Actor_Says(0, 4875, 16); + Actor_Says(14, 60, 36); + Actor_Says(0, 4890, 13); + Actor_Says(14, 70, 33); + Actor_Says(0, 4895, 16); + Actor_Modify_Friendliness_To_Other(14, 0, -5); + Game_Flag_Set(290); + } else if (Actor_Query_Friendliness_To_Other(14, 0) > 51 && !Game_Flag_Query(717)) { + Actor_Says(14, 1870, 30); + Actor_Says(14, 1880, 30); + Actor_Says(0, 8960, 13); + Actor_Says(14, 1890, 36); + Actor_Says(14, 1900, 35); + Actor_Says(0, 8965, 16); + Actor_Says(14, 1920, 36); + Actor_Says(14, 1930, 33); + Actor_Says(14, 1940, 36); + Actor_Says(14, 1950, 30); + Actor_Says(0, 8970, 13); + Actor_Says(14, 1960, 33); + Actor_Says(14, 1970, 30); + Actor_Says(14, 1980, 36); + Delay(1000); + Actor_Says(14, 2010, 35); + if (Global_Variable_Query(2) > 50 || Query_Difficulty_Level() == 0) { + Actor_Says(0, 8975, 16); + if (Query_Difficulty_Level() != 0) { + Global_Variable_Decrement(2, 50); + } + Delay(3000); + Item_Pickup_Spin_Effect(941, 405, 192); + Actor_Says(14, 2030, 30); + Game_Flag_Set(487); + } else { + Actor_Says(0, 8980, 16); + Actor_Says(14, 2040, 30); + Actor_Says(0, 8985, 15); + Actor_Says(14, 2050, 33); + } + Game_Flag_Set(717); + } else if (Actor_Clue_Query(0, 11) || Actor_Clue_Query(0, 5) || Actor_Clue_Query(0, 62) || Actor_Clue_Query(0, 110) || Actor_Clue_Query(0, 57) || !Game_Flag_Query(305)) { + sub_401DF4(); + } else { + Actor_Says(14, 1820, 30); + } + return true; + } + if (actorId == 14 && Game_Flag_Query(289)) { + Actor_Face_Actor(0, 14, true); + if (Actor_Clue_Query(0, 164)) { + Actor_Says(0, 8590, -1); + } else { + Actor_Voice_Over(2100, 99); + Actor_Voice_Over(2110, 99); + } + return true; + } + return false; +} + +bool SceneScriptRC04::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptRC04::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, 45.0f, 0.15f, 68.0f, 0, 1, false, 0)) { + Game_Flag_Set(121); + Set_Enter(70, 80); + } + return true; + } + return false; +} + +bool SceneScriptRC04::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptRC04::SceneFrameAdvanced(int frame) { +} + +void SceneScriptRC04::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptRC04::PlayerWalkedIn() { + Loop_Actor_Walk_To_Waypoint(0, 103, 0, 0, false); + if (Global_Variable_Query(1) != 2 || Game_Flag_Query(287) || Player_Query_Combat_Mode()) { + if (Global_Variable_Query(1) == 4 && !Game_Flag_Query(289) && !Game_Flag_Query(306)) { + Actor_Says(38, 40, 3); + Actor_Says(14, 890, 37); + Actor_Set_Goal_Number(14, 2); + } + Game_Flag_Set(287); + } else { + Actor_Says(14, 0, 31); + Loop_Actor_Walk_To_Waypoint(0, 104, 0, 0, false); + Actor_Face_Actor(0, 14, true); + Actor_Says(0, 4865, 13); + Actor_Says(14, 10, 32); + Actor_Says(0, 4870, 16); + Actor_Says(14, 20, 31); + Game_Flag_Set(287); + } +} + +void SceneScriptRC04::PlayerWalkedOut() { + Game_Flag_Reset(303); +} + +void SceneScriptRC04::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/rc51.cpp b/engines/bladerunner/script/scene/rc51.cpp new file mode 100644 index 0000000000..dd62c53aba --- /dev/null +++ b/engines/bladerunner/script/scene/rc51.cpp @@ -0,0 +1,130 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptRC51::InitializeScene() { + Setup_Scene_Information(-8.87f, -1238.89f, 108164.27f, 66); + Scene_Exit_Add_2D_Exit(0, 0, 460, 639, 479, 2); + Scene_Loop_Start_Special(0, 0, 0); + Scene_Loop_Set_Default(1); +} + +void SceneScriptRC51::SceneLoaded() { + Obstacle_Object("POSTER_2", true); + Obstacle_Object("CURTAIN", true); + Clickable_Object("POSTER_2"); + Unclickable_Object("GRL_DSK"); + Unclickable_Object("GRL_DSKLEG"); + Unclickable_Object("CURTAIN"); + if (!Game_Flag_Query(147)) { + Item_Add_To_World(82, 937, 16, 47.56f, -1238.89f, 108048.61f, 0, 6, 18, false, true, false, true); + } + if (!Game_Flag_Query(148)) { + Item_Add_To_World(79, 933, 16, 67.28f, -1193.38f, 108011.27f, 0, 6, 6, false, true, false, true); + } + if (!Game_Flag_Query(149)) { + Item_Add_To_World(98, 971, 16, -69.65f, -1238.89f, 107995.24f, 256, 18, 18, false, true, false, true); + } +} + +bool SceneScriptRC51::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptRC51::ClickedOn3DObject(const char *objectName, bool a2) { + if (Object_Query_Click("POSTER_2", objectName)) { + Actor_Face_Object(0, "POSTER_2", true); + Actor_Says(0, 8620, 3); + return true; + } + return false; +} + +bool SceneScriptRC51::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptRC51::ClickedOnItem(int itemId, bool a2) { + if (itemId == 82 && !Loop_Actor_Walk_To_XYZ(0, 17.97f, -1238.89f, 108053.5f, 0, 1, false, 0)) { + Actor_Face_Item(0, 82, true); + Actor_Clue_Acquire(0, 8, 1, -1); + Item_Remove_From_World(82); + Item_Pickup_Spin_Effect(937, 437, 407); + Actor_Voice_Over(2010, 99); + Game_Flag_Set(147); + return true; + } + if (itemId == 79 && !Loop_Actor_Walk_To_Item(0, 79, 36, 1, false)) { + Actor_Face_Item(0, 79, true); + Actor_Clue_Acquire(0, 6, 1, -1); + Item_Remove_From_World(79); + Item_Pickup_Spin_Effect(933, 445, 230); + Actor_Says(0, 8735, 3); + Actor_Says(0, 8529, 3); + Game_Flag_Set(148); + return true; + } + if (itemId == 98 && !Loop_Actor_Walk_To_Item(0, 98, 36, 1, false)) { + Actor_Face_Item(0, 98, true); + Actor_Clue_Acquire(0, 7, 1, -1); + Item_Remove_From_World(98); + Item_Pickup_Spin_Effect(971, 55, 376); + Actor_Says(0, 8525, 3); + Actor_Says(0, 8740, 3); + Game_Flag_Set(149); + return true; + } + return false; +} + +bool SceneScriptRC51::ClickedOnExit(int exitId) { + if (exitId == 0 && !Loop_Actor_Walk_To_XYZ(0, -8.87f, -1238.89f, 108173.27f, 0, 1, false, 0)) { + Set_Enter(16, 79); + return true; + } + return false; +} + +bool SceneScriptRC51::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptRC51::SceneFrameAdvanced(int frame) { +} + +void SceneScriptRC51::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptRC51::PlayerWalkedIn() { + Game_Flag_Set(709); +} + +void SceneScriptRC51::PlayerWalkedOut() { +} + +void SceneScriptRC51::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/tb02.cpp b/engines/bladerunner/script/scene/tb02.cpp new file mode 100644 index 0000000000..c3aa0c207d --- /dev/null +++ b/engines/bladerunner/script/scene/tb02.cpp @@ -0,0 +1,469 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptTB02::InitializeScene() { + if (Game_Flag_Query(155)) { + Setup_Scene_Information(-152.0f, 0.0f, 1774.0f, 999); + } else if (Game_Flag_Query(95)) { + Setup_Scene_Information(-32.0f, 0.0f, 1578.0f, 639); + } else if (Game_Flag_Query(608)) { + Setup_Scene_Information(-32.0f, 0.0f, 1578.0f, 639); + } else { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Outtake_Play(27, 0, -1); + Setup_Scene_Information(-304.0f, -81.46f, 1434.0f, 250); + } + if (Global_Variable_Query(1) > 3) { + Scene_Exit_Add_2D_Exit(0, 0, 455, 639, 479, 2); + } + Ambient_Sounds_Add_Looping_Sound(211, 20, 0, 1); + Ambient_Sounds_Add_Sound(212, 2, 15, 16, 20, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(213, 2, 15, 16, 20, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(214, 2, 20, 16, 20, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(215, 2, 15, 16, 20, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(216, 2, 15, 16, 20, 0, 0, -101, -101, 0, 0); + if (Global_Variable_Query(1) <= 3) { + Ambient_Sounds_Add_Looping_Sound(45, 35, 0, 1); + Ambient_Sounds_Add_Sound(181, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(183, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(184, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(185, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(186, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(188, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(189, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(190, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(192, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(193, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(194, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + } + if (Game_Flag_Query(307) && Global_Variable_Query(1) < 4) { + Scene_Exit_Add_2D_Exit(2, 67, 0, 233, 362, 3); + } + if (Game_Flag_Query(155)) { + Scene_Loop_Start_Special(0, 0, 0); + Scene_Loop_Set_Default(1); + } else { + Scene_Loop_Set_Default(1); + } + Actor_Put_In_Set(17, 17); + Actor_Set_At_XYZ(17, -38.53f, 2.93f, 1475.97f, 673); + if (Global_Variable_Query(1) == 4) { + if (Actor_Query_Goal_Number(17) < 300) { + Actor_Set_Goal_Number(17, 300); + } + Scene_Exit_Add_2D_Exit(1, 430, 235, 487, 396, 0); + } +} + +void SceneScriptTB02::SceneLoaded() { + Obstacle_Object("SPHERE02", true); + Unobstacle_Object("BOX36", true); +} + +bool SceneScriptTB02::MouseClick(int x, int y) { + return Region_Check(600, 300, 639, 479); +} + +bool SceneScriptTB02::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptTB02::ClickedOnActor(int actorId) { + if (actorId == 17) { + if (!Loop_Actor_Walk_To_XYZ(0, -76.35f, 0.15f, 1564.2f, 0, 1, false, 0)) { + Actor_Face_Actor(0, 17, true); + int v1 = Global_Variable_Query(1); + if (v1 == 2) { + if (Game_Flag_Query(450) && !Game_Flag_Query(451)) { + Actor_Says(0, 5150, 18); + Actor_Says(17, 60, 12); + Actor_Says(17, 70, 13); + Actor_Says(0, 5155, 13); + Actor_Modify_Friendliness_To_Other(17, 0, -1); + return true; + } + if (!Game_Flag_Query(450) && !Game_Flag_Query(451)) { + Game_Flag_Set(450); + Actor_Says(0, 5160, 18); + Actor_Says(17, 80, 14); + Scene_Exit_Add_2D_Exit(1, 430, 235, 487, 396, 0); + return true; + } + if (Game_Flag_Query(451)) { + sub_402644(); + } else { + Actor_Face_Actor(17, 0, true); + Actor_Says(0, 5150, 18); + Actor_Says(17, 60, 13); + Actor_Says(17, 70, 12); + Actor_Says(0, 5155, 13); + Actor_Modify_Friendliness_To_Other(17, 0, -1); + Actor_Face_Heading(17, 788, false); + } + return true; + } + if (v1 == 3) { + Actor_Says(0, 5235, 18); + Actor_Says(17, 280, 13); + Actor_Says(17, 290, 12); + Actor_Says(0, 5240, 18); + Actor_Says(17, 300, 12); + return false; + } + if (v1 == 4) { + if (Actor_Query_Goal_Number(17) == 300) { + Actor_Set_Goal_Number(17, 301); + } + } + } + } + return false; +} + +bool SceneScriptTB02::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptTB02::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -152.0f, 0.0f, 1774.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(154); + Game_Flag_Reset(450); + Set_Enter(17, 83); + Async_Actor_Walk_To_XYZ(0, -152.0f, 0.0f, 1890.0f, 0, false); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -32.0f, 0.0f, 1578.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + if (Global_Variable_Query(1) < 4) { + Game_Flag_Set(451); + Game_Flag_Set(96); + Set_Enter(72, 84); + } else { + Set_Enter(18, 108); + } + } + return true; + } + if (exitId == 2) { + if (!Loop_Actor_Walk_To_XYZ(0, -192.0f, 0.0f, 1430.0f, 0, 1, false, 0)) { + Actor_Face_Heading(0, 800, false); + Loop_Actor_Travel_Stairs(0, 9, 0, 0); + if (Actor_Query_Goal_Number(17) == 300) { + Actor_Set_Goal_Number(17, 301); + } else { + Game_Flag_Reset(176); + Game_Flag_Reset(182); + Game_Flag_Reset(179); + Game_Flag_Reset(178); + Game_Flag_Reset(258); + Game_Flag_Reset(257); + Game_Flag_Reset(261); + Game_Flag_Reset(450); + switch (Spinner_Interface_Choose_Dest(-1, 0)) { + case 9: + Game_Flag_Set(257); + Game_Flag_Reset(307); + Game_Flag_Set(256); + Set_Enter(37, 34); + break; + case 8: + Game_Flag_Set(181); + Game_Flag_Reset(307); + Game_Flag_Set(255); + Set_Enter(54, 54); + break; + case 7: + Game_Flag_Set(258); + Game_Flag_Reset(307); + Game_Flag_Set(254); + Set_Enter(20, 2); + break; + case 6: + Game_Flag_Set(177); + Game_Flag_Reset(307); + Game_Flag_Set(253); + Set_Enter(7, 25); + break; + case 4: + Game_Flag_Set(180); + Game_Flag_Reset(307); + Game_Flag_Set(252); + Set_Enter(0, 0); + break; + case 3: + Game_Flag_Set(176); + Game_Flag_Reset(307); + Game_Flag_Set(248); + Set_Enter(4, 13); + break; + case 2: + Game_Flag_Set(182); + Game_Flag_Reset(307); + Game_Flag_Set(249); + Set_Enter(69, 78); + break; + case 1: + Game_Flag_Set(179); + Game_Flag_Reset(307); + Game_Flag_Set(250); + Set_Enter(49, 48); + break; + case 0: + Game_Flag_Set(178); + Game_Flag_Reset(307); + Game_Flag_Set(251); + Set_Enter(61, 65); + break; + default: + Game_Flag_Set(261); + break; + } + } + } + return true; + } + return false; +} + +bool SceneScriptTB02::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptTB02::SceneFrameAdvanced(int frame) { +} + +void SceneScriptTB02::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptTB02::PlayerWalkedIn() { + if (Game_Flag_Query(625) && ((Game_Flag_Reset(625) , Global_Variable_Query(1) == 2) || Global_Variable_Query(1) == 3)) { + Set_Enter(18, 108); + //return true; + return; + } + if (Game_Flag_Query(155)) { + Async_Actor_Walk_To_XYZ(0, -152.0f, 0.0f, 1702.0f, 0, false); + Game_Flag_Reset(155); + } else if (Game_Flag_Query(95)) { + Game_Flag_Reset(95); + } else if (Game_Flag_Query(608)) { + Game_Flag_Reset(608); + if (Actor_Query_Goal_Number(17) == 300) { + Actor_Set_Goal_Number(17, 302); + } + Music_Play(1, 50, 0, 2, -1, 0, 0); + } else { + Loop_Actor_Travel_Stairs(0, 9, 1, 0); + Loop_Actor_Walk_To_XYZ(0, -140.0f, 0.79f, 1470.0f, 0, 0, false, 0); + } + int v0 = Global_Variable_Query(1); + if (v0 > 4) { + //return false; + return; + } + if (v0 == 2) { + if (!Game_Flag_Query(453)) { + Player_Loses_Control(); + Actor_Says(0, 5125, 18); + Actor_Says(17, 0, 50); + Actor_Says(0, 5130, 13); + Actor_Says(17, 10, 15); + Item_Pickup_Spin_Effect(975, 351, 315); + Actor_Says(17, 20, 23); + Actor_Says(0, 5140, 17); + Actor_Says(17, 30, 14); + Actor_Says(17, 40, 13); + Loop_Actor_Walk_To_XYZ(0, -140.0f, 0.0f, 1586.0f, 12, 0, false, 0); + Loop_Actor_Walk_To_XYZ(0, -112.0f, 0.0f, 1586.0f, 12, 0, false, 0); + Actor_Face_Actor(0, 17, true); + Actor_Face_Actor(17, 0, true); + Actor_Says(0, 5145, 13); + Actor_Says(17, 50, 15); + Actor_Face_Heading(17, 788, false); + Actor_Clue_Acquire(0, 45, 1, -1); + Game_Flag_Set(453); + Game_Flag_Set(450); + Player_Gains_Control(); + Loop_Actor_Walk_To_XYZ(0, -138.17f, 0.15f, 1578.32f, 0, 1, false, 0); + } + if (Game_Flag_Query(450)) { + Scene_Exit_Add_2D_Exit(1, 430, 235, 487, 396, 0); + } + if (Game_Flag_Query(451) && !Game_Flag_Query(450)) { + Actor_Says(17, 90, 18); + Game_Flag_Set(450); + Scene_Exit_Add_2D_Exit(1, 430, 235, 487, 396, 0); + } + if (Game_Flag_Query(451) && !Game_Flag_Query(456)) { + Loop_Actor_Walk_To_Actor(1, 0, 36, 1, false); + Actor_Says(1, 2220, 14); + Actor_Says(0, 5245, 13); + Actor_Says(1, 2230, 12); + Actor_Says(1, 2240, 13); + sub_402B50(); + //return true; + } + //return false; + return; + } + if (v0 == 3 && !Game_Flag_Query(455)) { + Loop_Actor_Walk_To_XYZ(0, -131.28f, 0.79f, 1448.25f, 12, 1, false, 0); + Actor_Says(17, 260, 15); + Actor_Says(0, 5225, 16); + Actor_Says(17, 270, 14); + Game_Flag_Set(455); + Actor_Modify_Friendliness_To_Other(17, 0, -1); + } + //return false; +} + +void SceneScriptTB02::PlayerWalkedOut() { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); +} + +void SceneScriptTB02::DialogueQueueFlushed(int a1) { +} + +void SceneScriptTB02::sub_402644() { + Dialogue_Menu_Clear_List(); + DM_Add_To_List_Never_Repeat_Once_Selected(700, 4, 5, 6); + if (Actor_Clue_Query(0, 44)) { + DM_Add_To_List_Never_Repeat_Once_Selected(710, 5, 5, 4); + } + if (Actor_Clue_Query(0, 50) || Actor_Clue_Query(0, 51)) { + DM_Add_To_List_Never_Repeat_Once_Selected(720, 3, 5, 5); + } + if (Actor_Clue_Query(0, 51)) { + DM_Add_To_List_Never_Repeat_Once_Selected(730, 3, 4, 8); + } + Dialogue_Menu_Add_DONE_To_List(100); + Dialogue_Menu_Appear(320, 240); + int answer = Dialogue_Menu_Query_Input(); + Dialogue_Menu_Disappear(); + switch (answer) { + case 100: + Actor_Says(0, 5145, 13); + Actor_Says(17, 50, 15); + break; + case 730: + Actor_Says(0, 5180, 16); + Actor_Says(17, 240, 12); + Actor_Says(0, 5215, 18); + Actor_Says(17, 250, 13); + Actor_Says(0, 5220, 16); + break; + case 720: + Actor_Says(0, 5175, 12); + Actor_Says(17, 210, 14); + Actor_Says(0, 5200, 13); + Actor_Says(17, 220, 13); + Actor_Says(0, 5205, 15); + Actor_Says(17, 230, 12); + Actor_Says(0, 5210, 12); + break; + case 710: + Actor_Says(0, 5170, 12); + Actor_Says(17, 180, 12); + Actor_Says(17, 190, 14); + if (Game_Flag_Query(102)) { + Actor_Says(0, 5195, 13); + Actor_Says(17, 200, 13); + } + break; + case 700: + Actor_Says(0, 5165, 11); + Actor_Says(17, 100, 13); + Actor_Says(17, 110, 12); + Actor_Says(0, 5185, 15); + Actor_Says(17, 120, 12); + Actor_Says(17, 130, 14); + Actor_Says(0, 5190, 16); + Actor_Says(17, 140, 13); + Actor_Says(17, 150, 14); + Actor_Says(17, 170, 12); + Actor_Clue_Acquire(0, 50, 1, 17); + break; + } +} + +void SceneScriptTB02::sub_402B50() { + Dialogue_Menu_Clear_List(); + DM_Add_To_List_Never_Repeat_Once_Selected(740, 4, 5, 6); + DM_Add_To_List_Never_Repeat_Once_Selected(750, 3, 5, 5); + Dialogue_Menu_Add_DONE_To_List(100); + Dialogue_Menu_Appear(320, 240); + int answer = Dialogue_Menu_Query_Input(); + Dialogue_Menu_Disappear(); + switch (answer) { + case 740: + Actor_Says(0, 5250, 15); + if (Game_Flag_Query(48)) { + Actor_Says(1, 2250, 12); + Actor_Says(1, 2260, 13); + Actor_Says(0, 5265, 12); + Actor_Says(1, 2270, 16); + Actor_Says(1, 2280, 13); + Actor_Says(0, 5270, 16); + Actor_Says(1, 2290, 14); + Actor_Clue_Acquire(0, 52, 1, 1); + Actor_Modify_Friendliness_To_Other(1, 0, 1); + Game_Flag_Set(456); + } else { + Actor_Says(1, 2300, 12); + Actor_Says(1, 2310, 15); + Actor_Says(0, 5275, 14); + Actor_Says(1, 2320, 12); + Actor_Says(0, 5280, 13); + Actor_Modify_Friendliness_To_Other(1, 0, 1); + Game_Flag_Set(456); + } + break; + case 750: + Actor_Says(0, 5255, 11); + Actor_Says(1, 2330, 13); + Actor_Says(1, 2340, 14); + Game_Flag_Set(456); + break; + case 100: + Actor_Says(1, 2350, 13); + Actor_Modify_Friendliness_To_Other(1, 0, -5); + Game_Flag_Set(456); + break; + } +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/tb03.cpp b/engines/bladerunner/script/scene/tb03.cpp new file mode 100644 index 0000000000..ec5128346f --- /dev/null +++ b/engines/bladerunner/script/scene/tb03.cpp @@ -0,0 +1,155 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptTB03::InitializeScene() { + if (Game_Flag_Query(448)) { + Setup_Scene_Information(-260.0f, 0.15f, 2014.0f, 276); + } else { + Setup_Scene_Information(-152.0f, 0.0f, 1890.0f, 500); + } + Scene_Exit_Add_2D_Exit(0, 25, 227, 81, 300, 0); + Scene_Exit_Add_2D_Exit(1, 298, 0, 639, 305, 0); + Ambient_Sounds_Add_Looping_Sound(211, 16, 0, 1); + Ambient_Sounds_Add_Sound(212, 2, 15, 16, 20, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(213, 2, 15, 16, 20, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(214, 2, 20, 16, 20, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(215, 2, 15, 16, 20, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(216, 2, 15, 16, 20, 0, 0, -101, -101, 0, 0); + if (Global_Variable_Query(1) <= 3) { + Ambient_Sounds_Add_Looping_Sound(45, 25, 0, 1); + Ambient_Sounds_Add_Sound(181, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(183, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(184, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(185, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(186, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(188, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(189, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(190, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(192, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(193, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(194, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); + } + Actor_Put_In_Set(17, 17); + Actor_Set_At_XYZ(17, -38.53f, 2.93f, 1475.97f, 673); + if (Global_Variable_Query(1) == 4) { + int goal = Actor_Query_Goal_Number(17); + if (goal == 304) { + Actor_Change_Animation_Mode(17, 0); + Actor_Set_Goal_Number(24, 399); + } else if (goal != 302) { + Actor_Set_Goal_Number(17, 300); + } + } + if (Game_Flag_Query(448)) { + if (Game_Flag_Query(549)) { + Scene_Loop_Set_Default(1); + } else { + Scene_Loop_Start_Special(0, 0, 0); + Scene_Loop_Set_Default(1); + Game_Flag_Set(549); + } + Game_Flag_Reset(448); + } else { + Scene_Loop_Start_Special(0, 0, 0); + Scene_Loop_Set_Default(1); + } +} + +void SceneScriptTB03::SceneLoaded() { + Obstacle_Object("SPHERE02", true); +} + +bool SceneScriptTB03::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptTB03::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptTB03::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptTB03::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptTB03::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -260.0f, 0.15f, 2014.0f, 0, 1, false, 0)) { + Actor_Set_Goal_Number(17, 304); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(447); + Set_Enter(88, 101); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -152.0f, 0.0f, 1774.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(155); + Set_Enter(17, 82); + Async_Actor_Walk_To_XYZ(0, -152.0f, 0.0f, 1702.0f, 0, false); + } + return true; + } + return false; +} + +bool SceneScriptTB03::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptTB03::SceneFrameAdvanced(int frame) { +} + +void SceneScriptTB03::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptTB03::PlayerWalkedIn() { + if (Actor_Query_Goal_Number(17) == 304) { + Player_Set_Combat_Mode(false); + Actor_Says(24, 260, -1); + Actor_Says(0, 170, 14); + Delay(1000); + Actor_Set_Goal_Number(0, 500); + } +} + +void SceneScriptTB03::PlayerWalkedOut() { + Music_Stop(2); +} + +void SceneScriptTB03::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/tb05.cpp b/engines/bladerunner/script/scene/tb05.cpp new file mode 100644 index 0000000000..4bd417a7ae --- /dev/null +++ b/engines/bladerunner/script/scene/tb05.cpp @@ -0,0 +1,197 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptTB05::InitializeScene() { + if (Game_Flag_Query(98)) { + Setup_Scene_Information(23.0f, 151.53f, -205.0f, 450); + Game_Flag_Set(102); + Game_Flag_Reset(98); + } else { + Setup_Scene_Information(14.0f, 151.53f, -77.0f, 6); + } + Scene_Exit_Add_2D_Exit(0, 62, 193, 206, 419, 0); + Scene_Exit_Add_2D_Exit(1, 0, 455, 639, 479, 2); + Ambient_Sounds_Add_Looping_Sound(236, 100, 0, 1); + Ambient_Sounds_Add_Looping_Sound(237, 100, 0, 1); + Ambient_Sounds_Add_Sound(217, 5, 30, 25, 33, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(218, 5, 30, 25, 33, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(219, 5, 30, 25, 33, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(220, 5, 30, 25, 33, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(146, 2, 30, 20, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(147, 2, 30, 20, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(148, 2, 30, 20, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(149, 2, 30, 20, 25, 0, 0, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(151, 2, 30, 20, 25, 0, 0, -101, -101, 0, 0); + Scene_Loop_Set_Default(0); +} + +void SceneScriptTB05::SceneLoaded() { + Clickable_Object("MONITOR05"); + Unclickable_Object("SMUDGE_GLASS01"); + if (!Actor_Clue_Query(0, 44)) { + Item_Add_To_World(76, 940, 72, 76.160004f, 147.36f, -235.14999f, 0, 6, 6, false, true, false, true); + } + if (!Actor_Clue_Query(0, 54) && !Actor_Clue_Query(0, 55) && (Game_Flag_Query(45) || Game_Flag_Query(46))) { + Item_Add_To_World(119, 972, 72, 129.00999f, 147.12f, -162.98f, 0, 8, 8, false, true, false, true); + } +} + +bool SceneScriptTB05::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptTB05::ClickedOn3DObject(const char *objectName, bool a2) { + if (Object_Query_Click("MONITOR05", objectName) && !Loop_Actor_Walk_To_XYZ(0, 122.54f, 147.12f, -197.17f, 0, 1, false, 0)) { + Actor_Face_Heading(0, 38, false); + if (!Actor_Clue_Query(0, 152) && !Game_Flag_Query(99)) { + Actor_Clue_Acquire(0, 51, 1, -1); + Actor_Voice_Over(2170, 99); + Actor_Voice_Over(2180, 99); + Actor_Voice_Over(2190, 99); + Actor_Voice_Over(2200, 99); + Game_Flag_Set(99); + return true; + } + if (Game_Flag_Query(99) && !Game_Flag_Query(100) && !Actor_Clue_Query(0, 152)) { + if (Actor_Clue_Query(0, 65) || Actor_Clue_Query(0, 262)) { + Actor_Clue_Acquire(0, 152, 1, -1); + Actor_Voice_Over(2230, 99); + Item_Pickup_Spin_Effect(941, 352, 333); + Actor_Voice_Over(2240, 99); + Actor_Voice_Over(2250, 99); + Actor_Voice_Over(2260, 99); + Game_Flag_Set(100); + Game_Flag_Set(101); + } else { + Actor_Voice_Over(2270, 99); + Game_Flag_Set(100); + } + return true; + } + if (Game_Flag_Query(100) && !Game_Flag_Query(101)) { + if (Actor_Clue_Query(0, 65) || Actor_Clue_Query(0, 262)) { + Actor_Clue_Acquire(0, 152, 1, -1); + Actor_Voice_Over(2230, 99); + Item_Pickup_Spin_Effect(941, 352, 333); + Actor_Voice_Over(2240, 99); + Actor_Voice_Over(2250, 99); + Actor_Voice_Over(2260, 99); + Game_Flag_Set(101); + } else { + Actor_Voice_Over(2280, 99); + Actor_Voice_Over(2290, 99); + Game_Flag_Set(101); + } + return true; + } + if (Game_Flag_Query(101)) { + Actor_Voice_Over(3700, 99); + return true; + } + return false; + } + return false; +} + +bool SceneScriptTB05::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptTB05::ClickedOnItem(int itemId, bool a2) { + if (itemId == 76 && !Loop_Actor_Walk_To_XYZ(0, 54.0f, 147.12f, -209.0f, 0, 1, false, 0)) { + Actor_Face_Heading(0, 126, false); + Item_Remove_From_World(76); + Item_Pickup_Spin_Effect(940, 295, 408); + Actor_Voice_Over(2140, 99); + Actor_Voice_Over(2150, 99); + Actor_Voice_Over(2160, 99); + Actor_Clue_Acquire(0, 44, 1, -1); + return true; + } + if (itemId == 119 && !Loop_Actor_Walk_To_XYZ(0, 107.89f, 147.12f, -156.26f, 0, 1, false, 0)) { + Actor_Face_Heading(0, 126, false); + Item_Remove_From_World(119); + Item_Pickup_Spin_Effect(972, 449, 431); + Actor_Voice_Over(4280, 99); + if (Game_Flag_Query(45)) { + Actor_Voice_Over(4290, 99); + Actor_Clue_Acquire(0, 54, 1, -1); + } else { + Actor_Voice_Over(4300, 99); + Actor_Clue_Acquire(0, 55, 1, -1); + } + } + return false; +} + +bool SceneScriptTB05::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, 23.0f, 151.53f, -205.0f, 12, 1, false, 0)) { + Game_Flag_Set(97); + Set_Enter(73, 85); + Scene_Loop_Start_Special(1, 2, 1); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, 14.0f, 147.12f, 123.0f, 0, 1, false, 0)) { + Game_Flag_Set(95); + Set_Enter(17, 82); + } + return true; + } + return false; +} + +bool SceneScriptTB05::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptTB05::SceneFrameAdvanced(int frame) { + if (frame == 61) { + Sound_Play(150, Random_Query(52, 52), 0, 0, 50); + } + if (frame == 63) { + Sound_Play(283, Random_Query(55, 55), 0, 0, 50); + } + //return true; +} + +void SceneScriptTB05::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptTB05::PlayerWalkedIn() { +} + +void SceneScriptTB05::PlayerWalkedOut() { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); +} + +void SceneScriptTB05::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/tb06.cpp b/engines/bladerunner/script/scene/tb06.cpp new file mode 100644 index 0000000000..08975274a8 --- /dev/null +++ b/engines/bladerunner/script/scene/tb06.cpp @@ -0,0 +1,192 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptTB06::InitializeScene() { + Setup_Scene_Information(-16.0f, 149.0f, -466.0f, 990); + Scene_Exit_Add_2D_Exit(0, 330, 195, 417, 334, 0); + Ambient_Sounds_Add_Looping_Sound(236, 50, 0, 1); + Ambient_Sounds_Add_Looping_Sound(237, 50, 0, 1); + Ambient_Sounds_Add_Looping_Sound(285, 66, 0, 1); + if (Game_Flag_Query(103)) { + Scene_Loop_Set_Default(0); + //return false; + return; + } else { + Actor_Put_In_Set(21, 73); + Actor_Set_At_XYZ(21, 135.0f, 151.0f, -671.0f, 800); + Actor_Retired_Here(21, 60, 32, 1, -1); + //return true; + return; + } +} + +void SceneScriptTB06::SceneLoaded() { + Obstacle_Object("DOOR", true); + Unobstacle_Object("GLASS01", true); + Clickable_Object("DOOR"); + Unclickable_Object("SMUDGE_GLASS01"); + if (!Game_Flag_Query(519) && Actor_Query_Goal_Number(37) != 199) { + Item_Add_To_World(84, 942, 73, 36.54f, 149.48f, -565.67f, 0, 6, 6, false, true, false, true); + } + if (!Game_Flag_Query(520)) { + Item_Add_To_World(108, 955, 73, 18.0f, 149.65f, -599.0f, 0, 6, 6, false, true, false, true); + } + if (Actor_Query_Goal_Number(37) != 199) { + Item_Add_To_World(103, 978, 73, -46.82f, 149.6f, -666.88f, 0, 12, 12, false, true, false, true); + Item_Add_To_World(104, 979, 73, -30.27f, 149.6f, -610.7f, 0, 15, 45, false, true, false, true); + Item_Add_To_World(105, 980, 73, 9.87f, 149.6f, -683.5f, 0, 12, 12, false, true, false, true); + } +} + +bool SceneScriptTB06::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptTB06::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptTB06::ClickedOnActor(int actorId) { + if (actorId == 21 && !Loop_Actor_Walk_To_Actor(0, 21, 24, 1, false)) { + if (Actor_Clue_Query(0, 49)) { + Actor_Says(0, 8665, 13); + return false; + } + Actor_Voice_Over(2300, 99); + Actor_Voice_Over(2310, 99); + Item_Pickup_Spin_Effect(974, 66, 397); + Actor_Voice_Over(2320, 99); + if (Game_Flag_Query(48)) { + Actor_Voice_Over(2330, 99); + Actor_Voice_Over(2340, 99); + } + Actor_Voice_Over(2350, 99); + Actor_Clue_Acquire(0, 49, 1, -1); + return true; + } + return false; +} + +bool SceneScriptTB06::ClickedOnItem(int itemId, bool a2) { + if (itemId == 84 && !Loop_Actor_Walk_To_Item(0, 84, 12, 1, false)) { + Actor_Face_Item(0, 84, true); + Actor_Clue_Acquire(0, 65, 1, -1); + Item_Pickup_Spin_Effect(942, 341, 368); + Item_Remove_From_World(84); + Actor_Voice_Over(4160, 99); + Game_Flag_Set(519); + return true; + } + if (itemId == 108 && !Loop_Actor_Walk_To_Item(0, 108, 12, 1, false)) { + Actor_Face_Item(0, 108, true); + Actor_Clue_Acquire(0, 53, 1, -1); + Item_Remove_From_World(108); + Item_Pickup_Spin_Effect(955, 390, 368); + Actor_Says(0, 8775, 3); + Game_Flag_Set(520); + return true; + } + if (itemId == 82 && !Loop_Actor_Walk_To_Item(0, 82, 12, 1, false)) { + Actor_Face_Item(0, 82, true); + Actor_Says(0, 5285, 3); + return true; + } + if ((itemId == 103 || itemId == 104 || itemId == 105) && !Loop_Actor_Walk_To_Item(0, 103, 24, 1, false)) { + Actor_Face_Item(0, 103, true); + Actor_Voice_Over(2380, 99); + Actor_Voice_Over(2390, 99); + Actor_Voice_Over(2400, 99); + return true; + } + return false; +} + +bool SceneScriptTB06::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -16.0f, 149.0f, -427.0f, 12, 1, false, 0)) { + Game_Flag_Set(98); + Set_Enter(72, 84); + Scene_Loop_Start_Special(1, 2, 1); + } + return true; + } + return false; +} + +bool SceneScriptTB06::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptTB06::SceneFrameAdvanced(int frame) { + if (frame == 61) { + Sound_Play(150, Random_Query(52, 52), 0, 0, 50); + } + if (frame == 63) { + Sound_Play(283, Random_Query(55, 55), 0, 0, 50); + } + //return true; +} + +void SceneScriptTB06::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptTB06::PlayerWalkedIn() { + if (!Game_Flag_Query(102) && !Game_Flag_Query(483)) { + Actor_Face_Actor(0, 21, true); + Actor_Says(0, 5290, 3); + Loop_Actor_Walk_To_XYZ(0, -10.0f, 149.0f, -631.0f, 0, 0, false, 0); + AI_Movement_Track_Pause(37); + Actor_Face_Actor(0, 37, true); + Actor_Face_Actor(37, 0, true); + Actor_Says(37, 0, 3); + Actor_Says(0, 5295, 3); + Actor_Face_Actor(37, 21, true); + Actor_Says(37, 10, 3); + AI_Movement_Track_Unpause(37); + Game_Flag_Set(483); + //return true; + return; + } + if (Game_Flag_Query(103)) { + Item_Remove_From_World(84); + Item_Remove_From_World(82); + Item_Remove_From_World(98); + //return true; + return; + } + //return false; + return; +} + +void SceneScriptTB06::PlayerWalkedOut() { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); +} + +void SceneScriptTB06::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/tb07.cpp b/engines/bladerunner/script/scene/tb07.cpp new file mode 100644 index 0000000000..31c19423e9 --- /dev/null +++ b/engines/bladerunner/script/scene/tb07.cpp @@ -0,0 +1,290 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptTB07::InitializeScene() { + Setup_Scene_Information(68.0f, 12.0f, 288.0f, 0); + Scene_Exit_Add_2D_Exit(0, 383, 445, 639, 479, 2); + Ambient_Sounds_Add_Looping_Sound(109, 20, 0, 1); + Ambient_Sounds_Add_Sound(363, 2, 55, 14, 14, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(364, 2, 55, 14, 14, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(365, 2, 55, 14, 14, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(366, 2, 55, 14, 14, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(212, 1, 15, 20, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(213, 1, 15, 20, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(214, 1, 20, 20, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(215, 1, 15, 20, 25, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(216, 1, 15, 20, 25, -100, 100, -101, -101, 0, 0); + if (Global_Variable_Query(1) == 4 && !Actor_Clue_Query(0, 147)) { + Item_Add_To_World(83, 941, 18, 9.7f, 48.7f, -174.22f, 0, 12, 12, false, true, false, true); + } + if (Game_Flag_Query(661)) { + Scene_Loop_Set_Default(3); + } else { + Scene_Loop_Set_Default(0); + } +} + +void SceneScriptTB07::SceneLoaded() { + Obstacle_Object("EAGLE01", true); + Clickable_Object("EAGLE01"); +} + +bool SceneScriptTB07::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptTB07::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptTB07::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptTB07::ClickedOnItem(int itemId, bool a2) { + if (!Loop_Actor_Walk_To_Item(0, itemId, 36, 1, false)) { + Actor_Face_Item(0, itemId, true); + if (itemId == 83) { + Item_Pickup_Spin_Effect(941, 331, 296); + Actor_Clue_Acquire(0, 147, 0, -1); + } + Item_Remove_From_World(itemId); + } + return false; +} + +bool SceneScriptTB07::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, 68.0f, 12.0f, 288.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + if (Global_Variable_Query(1) == 4) { + Game_Flag_Set(608); + Set_Enter(17, 82); + } else { + Game_Flag_Reset(176); + Game_Flag_Reset(182); + Game_Flag_Reset(179); + Game_Flag_Reset(178); + Game_Flag_Reset(258); + Game_Flag_Reset(257); + Game_Flag_Reset(261); + Game_Flag_Reset(450); + switch (Spinner_Interface_Choose_Dest(-1, 0)) { + case 9: + Game_Flag_Set(257); + Game_Flag_Reset(307); + Game_Flag_Set(256); + Set_Enter(37, 34); + break; + case 8: + Game_Flag_Set(181); + Game_Flag_Reset(307); + Game_Flag_Set(255); + Set_Enter(54, 54); + break; + case 7: + Game_Flag_Set(258); + Game_Flag_Reset(307); + Game_Flag_Set(254); + Set_Enter(20, 2); + break; + case 6: + Game_Flag_Set(177); + Game_Flag_Reset(307); + Game_Flag_Set(253); + Set_Enter(7, 25); + break; + case 4: + Game_Flag_Set(180); + Game_Flag_Reset(307); + Game_Flag_Set(252); + Set_Enter(0, 0); + break; + case 3: + Game_Flag_Set(176); + Game_Flag_Reset(307); + Game_Flag_Set(248); + Set_Enter(4, 13); + break; + case 2: + Game_Flag_Set(182); + Game_Flag_Reset(307); + Game_Flag_Set(249); + Set_Enter(69, 78); + break; + case 1: + Game_Flag_Set(179); + Game_Flag_Reset(307); + Game_Flag_Set(250); + Set_Enter(49, 48); + break; + case 0: + Game_Flag_Set(178); + Game_Flag_Reset(307); + Game_Flag_Set(251); + Set_Enter(61, 65); + break; + default: + Game_Flag_Set(261); + Loop_Actor_Walk_To_XYZ(0, 44.0f, 12.0f, 176.0f, 0, 0, false, 0); + break; + } + } + } + return true; + } + return false; +} + +bool SceneScriptTB07::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptTB07::SceneFrameAdvanced(int frame) { + if (frame == 66) { + Ambient_Sounds_Play_Sound(591, 20, 99, 0, 0); + } + //return false; +} + +void SceneScriptTB07::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptTB07::PlayerWalkedIn() { + int v0 = Global_Variable_Query(1); + Loop_Actor_Walk_To_XYZ(0, 44.0f, 12.0f, 176.0f, 0, 0, false, 0); + if ((v0 == 2 || v0 == 3) && !Game_Flag_Query(612)) { + Player_Set_Combat_Mode(false); + sub_401B0C(); + } +} + +void SceneScriptTB07::PlayerWalkedOut() { +} + +void SceneScriptTB07::DialogueQueueFlushed(int a1) { +} + +void SceneScriptTB07::sub_401B0C() { + Game_Flag_Set(612); + Delay(1500); + Loop_Actor_Walk_To_XYZ(0, 44.98f, 12.0f, 49.79f, 0, 0, false, 0); + Actor_Face_Heading(0, 178, true); + Delay(3000); + Actor_Put_In_Set(57, 18); + Actor_Set_At_XYZ(57, -260.15f, 12.0f, -19.16f, 256); + Actor_Change_Animation_Mode(57, 0); + Outtake_Play(39, 1, -1); + Loop_Actor_Walk_To_XYZ(57, -146.15f, 12.0f, -5.84f, 0, 0, false, 0); + Actor_Face_Actor(57, 0, true); + Actor_Says(57, 480, 14); + Actor_Face_Actor(0, 57, true); + Actor_Says(0, 5315, 9); + Actor_Says(57, 490, 3); + Actor_Face_Heading(0, 178, true); + Actor_Says(0, 5320, 15); + Actor_Says_With_Pause(0, 5325, 1.0f, 19); + Actor_Start_Speech_Sample(57, 500); + Loop_Actor_Walk_To_XYZ(57, -60.15f, 12.0f, 60.84f, 0, 0, false, 0); + Actor_Face_Actor(57, 0, true); + Actor_Face_Actor(0, 57, true); + Actor_Says(0, 5330, 14); + Actor_Says(57, 510, 12); + Actor_Says(0, 5335, 16); + Actor_Says(57, 520, 17); + Actor_Says(0, 5340, 3); + Actor_Start_Speech_Sample(57, 530); + Loop_Actor_Walk_To_XYZ(57, -4.15f, 12.0f, 54.73f, 0, 0, false, 0); + Actor_Says(57, 540, 16); + Actor_Says(0, 5345, 18); + Actor_Says(57, 550, 13); + Actor_Says(57, 570, 18); + Actor_Says_With_Pause(0, 5350, 0.0f, 18); + Actor_Says(57, 580, 16); + Actor_Says(0, 5355, 16); + Actor_Says(57, 590, 17); + Actor_Says(0, 5360, 17); + Actor_Says(0, 5365, 13); + Actor_Says_With_Pause(57, 600, 1.0f, 12); + Actor_Says(0, 5370, 3); + Loop_Actor_Walk_To_XYZ(57, -24.15f, 12.0f, -10.84f, 0, 0, false, 0); + Actor_Says(57, 610, 13); + Actor_Face_Actor(0, 57, true); + Actor_Says(0, 5375, 18); + Actor_Says(0, 5380, 19); + Actor_Face_Actor(57, 0, true); + Actor_Says(57, 620, 18); + Actor_Says_With_Pause(0, 5385, 2.0f, 12); + Actor_Says_With_Pause(0, 5390, 2.0f, 14); + Actor_Says(0, 5395, 15); + Actor_Says_With_Pause(57, 630, 0.0f, 14); + Actor_Says(0, 5400, 18); + Actor_Says(0, 5405, 3); + Actor_Says(57, 640, 12); + Actor_Says(0, 5410, 16); + Actor_Says(57, 650, 15); + Actor_Says_With_Pause(0, 5415, 1.0f, 17); + Actor_Says(0, 5420, 14); + Actor_Says(57, 660, 15); + Actor_Put_In_Set(51, 18); + Actor_Set_At_XYZ(51, 68.0f, 12.0f, 288.0f, 0); + Actor_Change_Animation_Mode(51, 0); + Scene_Loop_Set_Default(3); + Scene_Loop_Start_Special(2, 2, 0); + Actor_Start_Speech_Sample(51, 0); + Loop_Actor_Walk_To_XYZ(51, 44.0f, 12.0f, 176.0f, 0, 0, false, 0); + Actor_Face_Actor(51, 0, true); + Actor_Face_Actor(0, 51, true); + Actor_Face_Actor(57, 51, true); + Actor_Says(51, 10, 12); + Actor_Says(51, 20, 3); + Actor_Says(51, 30, 12); + Actor_Says(0, 5425, 18); + Actor_Set_Goal_Number(57, 200); + Actor_Says(51, 40, 15); + Actor_Start_Speech_Sample(51, 50); + Loop_Actor_Walk_To_XYZ(51, -10.0f, 12.0f, 100.0f, 0, 0, false, 0); + Actor_Face_Actor(51, 0, true); + Actor_Face_Actor(0, 51, true); + Actor_Says(0, 5430, 17); + Actor_Says(0, 5435, 16); + Actor_Says(51, 60, 14); + Actor_Face_Actor(0, 51, true); + Actor_Says(0, 5440, 14); + Actor_Says(51, 70, 13); + Actor_Says(0, 5445, 15); + Actor_Says_With_Pause(51, 80, 1.0f, 12); + Actor_Says(51, 90, 15); + Actor_Says_With_Pause(0, 5450, 1.0f, 15); + Actor_Says(0, 5455, 12); + Actor_Says(51, 100, 14); + Actor_Clue_Acquire(0, 278, 0, 57); + Actor_Clue_Acquire(0, 279, 0, 51); + Loop_Actor_Walk_To_XYZ(51, -260.15f, 12.0f, -19.16f, 0, 0, false, 0); +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ug01.cpp b/engines/bladerunner/script/scene/ug01.cpp new file mode 100644 index 0000000000..6be3fe67ef --- /dev/null +++ b/engines/bladerunner/script/scene/ug01.cpp @@ -0,0 +1,179 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptUG01::InitializeScene() { + if (Game_Flag_Query(317)) { + Setup_Scene_Information(34.47f, -50.13f, -924.11f, 500); + Game_Flag_Reset(317); + } else if (Game_Flag_Query(118)) { + Setup_Scene_Information(-68.0f, -50.13f, -504.0f, 377); + } else { + Setup_Scene_Information(-126.0f, -50.13f, -286.0f, 0); + } + Scene_Exit_Add_2D_Exit(0, 280, 204, 330, 265, 0); + Scene_Exit_Add_2D_Exit(1, 144, 0, 210, 104, 0); + Scene_Exit_Add_2D_Exit(2, 0, 173, 139, 402, 3); + Ambient_Sounds_Add_Looping_Sound(331, 28, 0, 1); + Ambient_Sounds_Add_Looping_Sound(332, 40, 0, 1); + Ambient_Sounds_Add_Looping_Sound(333, 40, 0, 1); + Ambient_Sounds_Add_Sound(291, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(293, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(402, 2, 120, 10, 11, 20, 100, 0, 100, 0, 0); + Ambient_Sounds_Add_Sound(370, 2, 120, 10, 11, 20, 100, 0, 100, 0, 0); + Ambient_Sounds_Add_Sound(397, 2, 120, 10, 11, 20, 100, 0, 100, 0, 0); + Ambient_Sounds_Add_Sound(396, 2, 120, 10, 11, 20, 100, 0, 100, 0, 0); + Ambient_Sounds_Add_Sound(294, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(295, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(234, 2, 190, 12, 16, 0, 100, 0, 100, 0, 0); + Ambient_Sounds_Add_Sound(391, 2, 190, 12, 16, 0, 100, 0, 100, 0, 0); + Ambient_Sounds_Add_Sound(394, 2, 190, 12, 16, 0, 100, 0, 100, 0, 0); + Ambient_Sounds_Add_Sound(224, 2, 190, 12, 16, 0, 100, 0, 100, 0, 0); + Ambient_Sounds_Add_Sound(227, 2, 190, 12, 16, 0, 100, 0, 100, 0, 0); + Ambient_Sounds_Add_Sound(228, 2, 190, 12, 16, 0, 100, 0, 100, 0, 0); + Ambient_Sounds_Add_Sound(229, 2, 190, 12, 16, 0, 100, 0, 100, 0, 0); + Ambient_Sounds_Add_Sound(303, 5, 50, 17, 37, 0, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(304, 5, 50, 17, 37, 0, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(305, 5, 50, 17, 37, 0, 100, -101, -101, 0, 0); + if (Game_Flag_Query(324)) { + Scene_Loop_Set_Default(3); + } else { + Scene_Loop_Set_Default(0); + } +} + +void SceneScriptUG01::SceneLoaded() { + Unobstacle_Object("BEAM02", true); + Unobstacle_Object("BEAM03", true); + Unobstacle_Object("BEAM04", true); + Clickable_Object("PIPES_FG_LFT"); +} + +bool SceneScriptUG01::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptUG01::ClickedOn3DObject(const char *objectName, bool a2) { + if (Object_Query_Click("PIPES_FG_LFT", objectName)) { + if (!Loop_Actor_Walk_To_XYZ(0, -9.0f, -50.13f, -148.0f, 0, 1, false, 0) && !Game_Flag_Query(324)) { + Actor_Says(0, 8525, 13); + Scene_Loop_Set_Default(3); + Scene_Loop_Start_Special(2, 2, 1); + Game_Flag_Set(324); + } else { + Actor_Says(0, 8525, 13); + } + } + return false; +} + +bool SceneScriptUG01::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptUG01::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptUG01::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -32.0f, -50.13f, -1350.0f, 12, 1, false, 0)) { + Game_Flag_Set(316); + Set_Enter(83, 95); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -70.0f, -50.13f, -500.0f, 0, 1, false, 0)) { + Actor_Face_Heading(0, 768, false); + Loop_Actor_Travel_Ladder(0, 12, 1, 0); + Game_Flag_Set(119); + Game_Flag_Reset(259); + Game_Flag_Set(182); + Set_Enter(70, 80); + } + return true; + } + if (exitId == 2) { + if (!Loop_Actor_Walk_To_XYZ(0, -126.0f, -50.13f, -286.0f, 0, 1, false, 0)) { + Game_Flag_Set(314); + Set_Enter(75, 87); + } + return true; + } + return false; +} + +bool SceneScriptUG01::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptUG01::SceneFrameAdvanced(int frame) { + if (frame >= 61 && frame <= 120) { + float v1 = (120 - frame) / 29500.0f; + Set_Fog_Density("BoxFog01", v1); + Set_Fog_Density("BoxFog02", v1); + Set_Fog_Density("BoxFog03", v1); + Set_Fog_Density("BoxFog04", v1); + } else if (frame > 120) { + Set_Fog_Density("BoxFog01", 0.0f); + Set_Fog_Density("BoxFog02", 0.0f); + Set_Fog_Density("BoxFog03", 0.0f); + Set_Fog_Density("BoxFog04", 0.0f); + } + //return false; +} + +void SceneScriptUG01::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptUG01::PlayerWalkedIn() { + if (Game_Flag_Query(315)) { + Loop_Actor_Walk_To_XYZ(0, -55.0f, -50.13f, -288.0f, 12, 0, false, 0); + Game_Flag_Reset(315); + } + if (Game_Flag_Query(118)) { + Actor_Set_At_XYZ(0, -70.0f, 93.87f, -500.0f, 768); + Loop_Actor_Travel_Ladder(0, 12, 0, 0); + Loop_Actor_Walk_To_XYZ(0, -58.0f, -50.13f, -488.0f, 0, 0, false, 0); + Game_Flag_Reset(118); + } + if (Actor_Query_Goal_Number(6) == 310) { + Music_Play(21, 35, 0, 3, -1, 0, 0); + Actor_Set_Goal_Number(6, 311); + } + //return false; +} + +void SceneScriptUG01::PlayerWalkedOut() { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); +} + +void SceneScriptUG01::DialogueQueueFlushed(int a1) { +} + + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ug02.cpp b/engines/bladerunner/script/scene/ug02.cpp new file mode 100644 index 0000000000..ce09c871b6 --- /dev/null +++ b/engines/bladerunner/script/scene/ug02.cpp @@ -0,0 +1,256 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptUG02::InitializeScene() { + if (Game_Flag_Query(319)) { + Setup_Scene_Information(-313.0f, 155.73f, -128.0f, 556); + } else { + Setup_Scene_Information(-95.0f, 74.78f, -503.0f, 556); + } + Scene_Exit_Add_2D_Exit(0, 529, 130, 607, 277, 0); + Scene_Exit_Add_2D_Exit(1, 305, 36, 335, 192, 0); + Ambient_Sounds_Add_Looping_Sound(332, 43, 0, 1); + Ambient_Sounds_Add_Looping_Sound(333, 43, 0, 1); + Ambient_Sounds_Add_Sound(303, 5, 50, 17, 37, 100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(304, 5, 50, 17, 37, 100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(123, 2, 50, 17, 37, -50, -20, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(130, 2, 50, 17, 37, -50, -20, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(131, 2, 50, 17, 37, -50, -20, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(132, 2, 50, 17, 37, -50, -20, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(133, 2, 50, 17, 37, -50, -20, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(134, 2, 50, 17, 37, -50, -20, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(135, 2, 50, 17, 37, -50, -20, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(136, 2, 50, 17, 37, -50, -20, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(47, 2, 50, 27, 27, 10, 30, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(48, 2, 50, 27, 27, 10, 30, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(49, 2, 50, 27, 27, 10, 30, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(50, 2, 50, 27, 27, 10, 30, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(51, 2, 50, 27, 27, 10, 30, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(52, 2, 50, 27, 27, 10, 30, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(53, 2, 50, 27, 27, 10, 30, -101, -101, 0, 0); +} + +void SceneScriptUG02::SceneLoaded() { + Unobstacle_Object("BOX BACKROOM 2", true); + Unobstacle_Object("BACK_ROOM HALFWALL_", true); + Unobstacle_Object("GUN_4", true); + Obstacle_Object("GUN_1", true); + Unobstacle_Object("WALL_LEFT", true); + Unobstacle_Object("BOX BY STAIRS 1", true); + Unobstacle_Object("TANK", true); + Unobstacle_Object("DESK_DRUM", true); + Clickable_Object("GUN_1"); + Clickable_Object("GUN_2"); + Clickable_Object("CRATE_3"); + Footstep_Sounds_Set(0, 0); + Footstep_Sounds_Set(8, 2); + if (!Game_Flag_Query(656) && Game_Flag_Query(44)) { + Item_Add_To_World(88, 963, 75, -300.37f, 120.16f, -81.31f, 0, 8, 8, false, true, false, true); + } +} + +bool SceneScriptUG02::MouseClick(int x, int y) { + if (Game_Flag_Query(499)) { + return false; + } + if (Region_Check(0, 0, 245, 285) || Region_Check(0, 0, 350, 257)) { + return true; + } + if (Region_Check(81, 224, 639, 479) && !Game_Flag_Query(498)) { + Game_Flag_Set(499); + sub_402354(); + Game_Flag_Reset(499); + return true; + } + return false; +} + +bool SceneScriptUG02::ClickedOn3DObject(const char *objectName, bool a2) { + if (Object_Query_Click("GUN_1", objectName) || Object_Query_Click("GUN_2", objectName) || Object_Query_Click("CRATE_3", objectName)) { + Actor_Face_Object(0, "GUN_1", true); + if (!Game_Flag_Query(449) && Global_Variable_Query(1) < 4) { + Actor_Voice_Over(2430, 99); + Actor_Voice_Over(2440, 99); + Actor_Voice_Over(2450, 99); + Actor_Voice_Over(2460, 99); + Game_Flag_Set(449); + Actor_Clue_Acquire(0, 66, 1, -1); + return true; + } + if (Global_Variable_Query(1) <= 3) { + Actor_Says(0, 8580, 14); + return false; + } + if (Actor_Clue_Query(0, 66) && !Actor_Clue_Query(0, 121)) { + Actor_Voice_Over(2470, 99); + Actor_Voice_Over(2480, 99); + Actor_Voice_Over(2490, 99); + Actor_Voice_Over(2500, 99); + Actor_Clue_Acquire(0, 121, 1, -1); + } else if (!Actor_Clue_Query(0, 66)) { + Actor_Voice_Over(2510, 99); + Actor_Voice_Over(2520, 99); + Actor_Voice_Over(2530, 99); + } else if (Game_Flag_Query(708)) { + Actor_Says(0, 8580, 14); + } else { + Item_Pickup_Spin_Effect(996, 360, 440); + Actor_Says(0, 8525, 14); + Give_McCoy_Ammo(2, 18); + Game_Flag_Set(708); + } + return true; + } + return false; +} + +bool SceneScriptUG02::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptUG02::ClickedOnItem(int itemId, bool a2) { + if (itemId == 88) { + Actor_Face_Item(0, 88, true); + Actor_Clue_Acquire(0, 62, 1, -1); + Game_Flag_Set(656); + Item_Remove_From_World(88); + Item_Pickup_Spin_Effect(963, 426, 316); + return true; + } + return false; +} + +bool SceneScriptUG02::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (Game_Flag_Query(498) || !sub_402354()) { + int v2 = Player_Query_Combat_Mode(); + if (!Loop_Actor_Walk_To_XYZ(0, -202.0f, 120.16f, -74.0f, 0, 1, v2, 0)) { + Actor_Face_Heading(0, 270, false); + Footstep_Sound_Override_On(2); + Loop_Actor_Travel_Stairs(0, 4, 0, 0); + Footstep_Sound_Override_Off(); + int v3 = Player_Query_Combat_Mode(); + Loop_Actor_Walk_To_XYZ(0, -96.57f, 74.870003f, -271.28f, 0, 0, v3, 0); + int v4 = Player_Query_Combat_Mode(); + Loop_Actor_Walk_To_XYZ(0, -95.0f, 74.870003f, -503.0f, 0, 0, v4, 0); + Game_Flag_Set(315); + Set_Enter(74, 86); + } + } + return true; + } + if (exitId == 1) { + if (Game_Flag_Query(498)) { + if (sub_402354()) { + return true; + } + Loop_Actor_Walk_To_XYZ(0, -368.75f, 155.75f, -63.0f, 0, 0, false, 0); + Loop_Actor_Walk_To_XYZ(0, -340.75f, 155.75f, -119.0f, 0, 0, false, 0); + } + Loop_Actor_Walk_To_XYZ(0, -304.75f, 155.75f, -171.0f, 0, 0, false, 0); + Actor_Face_Heading(0, 14, false); + Loop_Actor_Travel_Ladder(0, 9, 1, 0); + Game_Flag_Set(318); + Game_Flag_Reset(259); + Game_Flag_Set(479); + if (!Game_Flag_Query(403)) { + Game_Flag_Set(388); + Game_Flag_Set(403); + Item_Remove_From_World(121); + } + Set_Enter(8, 33); + return true; + } + return false; +} + +bool SceneScriptUG02::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptUG02::SceneFrameAdvanced(int frame) { + //return true; +} + +void SceneScriptUG02::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptUG02::PlayerWalkedIn() { + if (Game_Flag_Query(314)) { + Actor_Set_At_XYZ(0, -106.01f, 84.13f, -228.62f, 575); + Loop_Actor_Walk_To_XYZ(0, -148.0f, 84.13f, -67.0f, 0, 0, false, 0); + Actor_Face_Heading(0, 761, false); + Footstep_Sound_Override_On(2); + Loop_Actor_Travel_Stairs(0, 4, 1, 0); + Footstep_Sound_Override_Off(); + Game_Flag_Reset(314); + Game_Flag_Set(498); + } else if (Game_Flag_Query(319)) { + Actor_Set_At_XYZ(0, -304.75f, 265.0f, -171.0f, 0); + Loop_Actor_Travel_Ladder(0, 9, 0, 0); + Game_Flag_Reset(319); + Game_Flag_Reset(498); + } else { + Actor_Set_At_XYZ(0, -269.24f, 120.16f, -9.94f, 477); + Game_Flag_Set(498); + } + Game_Flag_Reset(499); + //return false; +} + +void SceneScriptUG02::PlayerWalkedOut() { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); +} + +void SceneScriptUG02::DialogueQueueFlushed(int a1) { +} + +bool SceneScriptUG02::sub_402354() { + if (!Game_Flag_Query(498)) { + int v0 = Player_Query_Combat_Mode(); + Loop_Actor_Walk_To_XYZ(0, -340.75f, 155.75f, -119.0f, 0, 0, v0, 0); + Loop_Actor_Walk_To_XYZ(0, -368.75f, 155.75f, -63.0f, 0, 0, v0, 0); + Loop_Actor_Walk_To_XYZ(0, -365.0f, 155.65f, -19.0f, 0, 0, v0, 0); + Actor_Face_Heading(0, 318, false); + Footstep_Sound_Override_On(2); + Loop_Actor_Travel_Stairs(0, 4, 0, 0); + Footstep_Sound_Override_Off(); + Game_Flag_Set(498); + return false; + } + if (!Loop_Actor_Walk_To_XYZ(0, -312.75f, 120.16f, 1.01f, 0, 1, false, 0)) { + Actor_Face_Heading(0, 830, false); + Footstep_Sound_Override_On(2); + Loop_Actor_Travel_Stairs(0, 4, 1, 0); + Footstep_Sound_Override_Off(); + Game_Flag_Reset(498); + return false; + } + return true; +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ug03.cpp b/engines/bladerunner/script/scene/ug03.cpp new file mode 100644 index 0000000000..aae97e34e6 --- /dev/null +++ b/engines/bladerunner/script/scene/ug03.cpp @@ -0,0 +1,145 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptUG03::InitializeScene() { + if (Game_Flag_Query(335)) { + Setup_Scene_Information(-51.0f, 0.03f, 255.0f, 780); + Game_Flag_Reset(335); + } else if (Game_Flag_Query(337)) { + Setup_Scene_Information(-139.0f, 0.03f, -13.0f, 540); + Game_Flag_Reset(337); + } else { + Setup_Scene_Information(-121.88f, 0.03f, 213.35f, 540); + } + Scene_Exit_Add_2D_Exit(0, 46, 137, 131, 296, 0); + Scene_Exit_Add_2D_Exit(1, 559, 141, 639, 380, 1); + Ambient_Sounds_Add_Looping_Sound(331, 15, 0, 1); + Ambient_Sounds_Add_Looping_Sound(332, 40, 0, 1); + Ambient_Sounds_Add_Looping_Sound(333, 40, 0, 1); + Ambient_Sounds_Add_Sound(402, 2, 120, 10, 11, 0, 100, 0, 100, 0, 0); + Ambient_Sounds_Add_Sound(370, 2, 120, 10, 11, 0, 100, 0, 100, 0, 0); + Ambient_Sounds_Add_Sound(396, 2, 120, 10, 11, 0, 100, 0, 100, 0, 0); + Ambient_Sounds_Add_Sound(395, 2, 120, 10, 11, 0, 100, 0, 100, 0, 0); + Ambient_Sounds_Add_Sound(234, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(235, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(391, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(392, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(393, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(394, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(224, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(225, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(226, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(227, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(228, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(229, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(303, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(304, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(305, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); +} + +void SceneScriptUG03::SceneLoaded() { + Obstacle_Object("=WALL_RIGHT_HOLE", true); + Unobstacle_Object("=HOLERUBBLE1", true); + Clickable_Object("CHAIR_HEADZAPPER"); + Clickable_Object("CHAIR_BACK"); + Clickable_Object("CHAIR_SEAT"); + Clickable_Object("CHAIR_STRAPLEGLEFT"); + Clickable_Object("CHAIR_STRAPLEGRIGHT"); +} + +bool SceneScriptUG03::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptUG03::ClickedOn3DObject(const char *objectName, bool a2) { + if ((Object_Query_Click("CHAIR_BACK", objectName) || Object_Query_Click("CHAIR_SEAT", objectName) || Object_Query_Click("CHAIR_HEADZAPPER", objectName)) && !Loop_Actor_Walk_To_Scene_Object(0, "CHAIR_BACK", 36, 1, false)) { + Actor_Face_Object(0, "CHAIR_BACK", true); + if (!Actor_Clue_Query(0, 120)) { + Actor_Voice_Over(2550, 99); + Actor_Voice_Over(2560, 99); + Actor_Voice_Over(2570, 99); + Actor_Voice_Over(2580, 99); + Actor_Voice_Over(2590, 99); + Actor_Clue_Acquire(0, 120, 1, -1); + } + } + return false; +} + +bool SceneScriptUG03::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptUG03::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptUG03::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -139.0f, 0.0f, -13.0f, 0, 1, false, 0)) { + if (Global_Variable_Query(1) < 4) { + Actor_Says(0, 8522, 14); + } else { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(336); + Set_Enter(83, 95); + } + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -51.0f, 0.0f, 255.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(334); + Set_Enter(77, 89); + } + return true; + } + return false; +} + +bool SceneScriptUG03::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptUG03::SceneFrameAdvanced(int frame) { +} + +void SceneScriptUG03::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptUG03::PlayerWalkedIn() { +} + +void SceneScriptUG03::PlayerWalkedOut() { +} + +void SceneScriptUG03::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ug04.cpp b/engines/bladerunner/script/scene/ug04.cpp new file mode 100644 index 0000000000..3a1370fec6 --- /dev/null +++ b/engines/bladerunner/script/scene/ug04.cpp @@ -0,0 +1,140 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptUG04::InitializeScene() { + if (Game_Flag_Query(339)) { + Setup_Scene_Information(0.0f, -1.74f, -2400.0f, 496); + Game_Flag_Reset(339); + } else if (Game_Flag_Query(341)) { + Setup_Scene_Information(164.0f, 11.87f, -1013.0f, 83); + } else { + Setup_Scene_Information(-172.0f, 16.29f, -735.0f, 380); + Game_Flag_Reset(334); + } + Scene_Exit_Add_2D_Exit(0, 123, 308, 159, 413, 3); + if (Global_Variable_Query(1) > 3) { + Scene_Exit_Add_2D_Exit(1, 256, 333, 290, 373, 0); + } + Scene_Exit_Add_2D_Exit(2, 344, 298, 451, 390, 1); + Ambient_Sounds_Add_Looping_Sound(331, 25, 0, 1); + Ambient_Sounds_Add_Looping_Sound(332, 40, 0, 1); + Ambient_Sounds_Add_Looping_Sound(333, 40, 0, 1); + Ambient_Sounds_Add_Sound(234, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(224, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(225, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(227, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(229, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(368, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(369, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(370, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(235, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(392, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(394, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(303, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(304, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(305, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); + Scene_Loop_Start_Special(0, 0, 0); + Scene_Loop_Set_Default(1); +} + +void SceneScriptUG04::SceneLoaded() { + Obstacle_Object("NAV", true); + Unobstacle_Object("RUBBLE", true); + Unobstacle_Object("FLOOR DEBRIS WADS", true); + Unobstacle_Object("FLOOR DEBRIS WADS01", true); + Unobstacle_Object("FLOOR DEBRIS WADS02", true); +} + +bool SceneScriptUG04::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptUG04::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptUG04::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptUG04::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptUG04::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -172.0f, 16.29f, -735.0f, 0, 1, false, 0)) { + Game_Flag_Set(335); + Set_Enter(76, 88); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, 0.0f, -1.74f, -2400.0f, 0, 1, false, 0)) { + Game_Flag_Set(338); + Set_Enter(78, 90); + } + return true; + } + if (exitId == 2) { + if (!Loop_Actor_Walk_To_XYZ(0, 164.0f, 11.87f, -1013.0f, 0, 1, false, 0)) { + Game_Flag_Set(340); + Set_Enter(79, 91); + } + return true; + } + return false; +} + +bool SceneScriptUG04::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptUG04::SceneFrameAdvanced(int frame) { + if (frame == 1) { + Ambient_Sounds_Play_Sound(367, 90, -100, 100, 100); + } +} + +void SceneScriptUG04::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptUG04::PlayerWalkedIn() { + if (Game_Flag_Query(341)) { + Loop_Actor_Walk_To_XYZ(0, 60.0f, -1.74f, -976.0f, 6, 0, false, 0); + Game_Flag_Reset(341); + } +} + +void SceneScriptUG04::PlayerWalkedOut() { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); +} + +void SceneScriptUG04::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ug05.cpp b/engines/bladerunner/script/scene/ug05.cpp new file mode 100644 index 0000000000..fed485906d --- /dev/null +++ b/engines/bladerunner/script/scene/ug05.cpp @@ -0,0 +1,275 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptUG05::InitializeScene() { + if (Game_Flag_Query(360)) { + if (Game_Flag_Query(663) && !Game_Flag_Query(368)) { + Setup_Scene_Information(-356.35f, 132.77f, -1092.36f, 389); + } else { + Setup_Scene_Information(-180.0f, 37.28f, -1124.0f, 296); + } + } else { + Setup_Scene_Information(0.0f, -1.37f, 0.0f, 0); + Game_Flag_Reset(338); + } + Scene_Exit_Add_2D_Exit(0, 215, 240, 254, 331, 3); + if (!Game_Flag_Query(663)) { + Scene_Exit_Add_2D_Exit(1, 303, 422, 639, 479, 2); + } + if (!Game_Flag_Query(663) || Game_Flag_Query(368)) { + Scene_Exit_Add_2D_Exit(2, 352, 256, 393, 344, 0); + } + Ambient_Sounds_Add_Looping_Sound(105, 28, 0, 1); + Ambient_Sounds_Add_Looping_Sound(332, 40, 0, 1); + Ambient_Sounds_Add_Looping_Sound(333, 40, 0, 1); + Ambient_Sounds_Add_Sound(234, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(225, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(226, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(227, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(235, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(391, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(368, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(402, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(395, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(398, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(224, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(228, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(392, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(229, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(303, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(304, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(305, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); + if (Game_Flag_Query(368)) { + Scene_Loop_Set_Default(2); + } else { + Scene_Loop_Set_Default(0); + } +} + +void SceneScriptUG05::SceneLoaded() { + if (!Game_Flag_Query(368)) { + Unobstacle_Object("DROPPED CAR OBSTACL", true); + } + Obstacle_Object("VANBODY", true); +} + +bool SceneScriptUG05::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptUG05::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptUG05::ClickedOnActor(int actorId) { + if (!Loop_Actor_Walk_To_Actor(0, actorId, 30, 1, false)) { + Actor_Face_Actor(0, actorId, true); + int v1 = sub_4021B0(); + if (actorId == 24 && Game_Flag_Query(368) && !Game_Flag_Query(683)) { + Actor_Says(24, 220, -1); + Actor_Says(0, 5540, 14); + Actor_Says(24, 230, -1); + Actor_Says(0, 5545, 17); + Actor_Says(24, 240, -1); + Actor_Says(0, 5550, 3); + Game_Flag_Set(683); + return false; + } + if (actorId == v1) { + sub_402218(); + return true; + } + return false; + } + return false; +} + +bool SceneScriptUG05::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptUG05::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (Game_Flag_Query(663) && !Game_Flag_Query(368)) { + Loop_Actor_Walk_To_XYZ(0, -356.35f, 132.77f, -1092.36f, 0, 0, false, 0); + Game_Flag_Set(361); + Set_Enter(43, 40); + } else if (!Loop_Actor_Walk_To_XYZ(0, -156.72f, 3.03f, -1118.17f, 0, 1, false, 0)) { + Actor_Face_Heading(0, 760, false); + Loop_Actor_Travel_Stairs(0, 3, 1, 0); + Game_Flag_Set(361); + Set_Enter(43, 40); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, 4.0f, -11.67f, -4.0f, 0, 1, false, 0)) { + Game_Flag_Set(339); + Set_Enter(77, 89); + } + return true; + } + if (exitId == 2) { + if (!Game_Flag_Query(662)) { + if (!Loop_Actor_Walk_To_XYZ(0, 0.0f, -1.37f, -1500.0f, 0, 1, false, 0)) { + if (!Game_Flag_Query(522)) { + Actor_Voice_Over(2600, 99); + Actor_Voice_Over(2610, 99); + Game_Flag_Set(522); + } + return true; + } + } else { + int v1 = sub_4021B0(); + bool v2; + if (v1 == -1) { + v2 = Loop_Actor_Walk_To_XYZ(0, 0.0f, -1.37f, -1500.0f, 0, 1, false, 0) != 0; + } else { + v2 = Loop_Actor_Walk_To_Actor(0, v1, 30, 1, false) != 0; + } + if (!v2) { + sub_402218(); + return true; + } + } + } + return false; +} + +bool SceneScriptUG05::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptUG05::SceneFrameAdvanced(int frame) { +} + +void SceneScriptUG05::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptUG05::PlayerWalkedIn() { + if (Game_Flag_Query(663)) { + if (Game_Flag_Query(368)) { + Music_Stop(2); + Actor_Put_In_Set(24, 78); + Actor_Set_At_XYZ(24, 4.22f, -1.37f, -925.0f, 750); + Actor_Set_Goal_Number(24, 599); + Actor_Retired_Here(24, 70, 36, 1, -1); + int v0 = sub_4021B0(); + if (v0 == 3) { + Actor_Put_In_Set(3, 78); + Actor_Set_At_XYZ(3, -100.0f, -10.31f, -906.0f, 866); + Actor_Force_Stop_Walking(3); + } else if (v0 == 6) { + Actor_Put_In_Set(6, 78); + Actor_Set_At_XYZ(6, -100.0f, -10.31f, -906.0f, 866); + Actor_Force_Stop_Walking(6); + } + } else { + if (!Actor_Query_In_Set(23, 78)) { + Actor_Put_In_Set(23, 78); + Actor_Set_At_XYZ(23, 0.0f, -1.37f, -1400.0f, 768); + } + if (!Actor_Query_In_Set(24, 78)) { + ADQ_Flush(); + ADQ_Add(24, 280, 3); + Actor_Put_In_Set(24, 78); + Actor_Set_At_XYZ(24, -16.0f, -1.37f, -960.0f, 768); + } + } + } + if (Game_Flag_Query(360)) { + if (Game_Flag_Query(663) && !Game_Flag_Query(368)) { + Loop_Actor_Walk_To_XYZ(0, -288.35f, 132.77f, -1092.36f, 0, 1, false, 0); + } else { + Loop_Actor_Travel_Stairs(0, 2, 0, 0); + } + } + if (Game_Flag_Query(663)) { + Game_Flag_Query(368); + } + Game_Flag_Reset(360); +} + +void SceneScriptUG05::PlayerWalkedOut() { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); +} + +void SceneScriptUG05::DialogueQueueFlushed(int a1) { +} + +int SceneScriptUG05::sub_4021B0() { + if (Global_Variable_Query(45) == 2 && Actor_Query_Goal_Number(3) != 599) { + return 3; + } + if (Global_Variable_Query(45) == 3 && Actor_Query_Goal_Number(6) != 599) { + return 6; + } + return -1; +} + +void SceneScriptUG05::sub_402218() { + int v0 = sub_4021B0(); + if (v0 != -1) { + Actor_Face_Actor(0, v0, true); + Actor_Face_Actor(v0, 0, true); + Actor_Says(0, 5535, 13); + if (v0 == 3) { + Actor_Says(3, 1110, 15); + } else { + Actor_Says(6, 670, 17); + } + } + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + if (v0 == 6) { + if (Game_Flag_Query(46)) { + if (Global_Variable_Query(48) > 3) { + Outtake_Play(13, 0, -1); + } else { + Outtake_Play(14, 0, -1); + } + } else { + Outtake_Play(12, 0, -1); + } + } else if (v0 == 3) { + if (Game_Flag_Query(47)) { + if (Global_Variable_Query(48) > 3) { + Outtake_Play(16, 0, -1); + } else { + Outtake_Play(17, 0, -1); + } + } else { + Outtake_Play(15, 0, -1); + } + } else { + Outtake_Play(19, 0, -1); + } + Outtake_Play(18, 0, -1); + Game_Over(); +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ug06.cpp b/engines/bladerunner/script/scene/ug06.cpp new file mode 100644 index 0000000000..7765a6089a --- /dev/null +++ b/engines/bladerunner/script/scene/ug06.cpp @@ -0,0 +1,161 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptUG06::InitializeScene() { + if (Game_Flag_Query(680)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Outtake_Play(7, 0, -1); + if (Game_Flag_Query(560)) { + Outtake_Play(9, 0, -1); + } else { + Outtake_Play(8, 0, -1); + } + Game_Flag_Reset(680); + } + if (Game_Flag_Query(340)) { + Setup_Scene_Information(23.0f, 0.0f, 321.0f, 0); + } else if (Game_Flag_Query(343)) { + Setup_Scene_Information(66.0f, 153.0f, -301.4f, 512); + } else { + Setup_Scene_Information(-165.0f, 1.0f, 89.0f, 990); + } + Scene_Exit_Add_2D_Exit(0, 0, 0, 30, 479, 3); + Scene_Exit_Add_2D_Exit(1, 294, 68, 544, 236, 0); + Ambient_Sounds_Add_Looping_Sound(288, 18, 0, 1); + Ambient_Sounds_Add_Looping_Sound(332, 40, 0, 1); + Ambient_Sounds_Add_Looping_Sound(333, 40, 0, 1); + Ambient_Sounds_Add_Sound(234, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(235, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(401, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(402, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(369, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(398, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(392, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(394, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(225, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(227, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(228, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(229, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(303, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(304, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(305, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); +} + +void SceneScriptUG06::SceneLoaded() { + Obstacle_Object("BOX06", true); + Unobstacle_Object("BOX06", true); + Unobstacle_Object("BOX07", true); + Unobstacle_Object("BOX16", true); + Unobstacle_Object("BOX05", true); +} + +bool SceneScriptUG06::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptUG06::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptUG06::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptUG06::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptUG06::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, 23.0f, 0.0f, 321.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(341); + Set_Enter(77, 89); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, 66.0f, 0.0f, -90.0f, 0, 1, false, 0)) { + Actor_Face_Heading(0, 0, false); + Loop_Actor_Travel_Stairs(0, 17, 1, 0); + Loop_Actor_Walk_To_XYZ(0, 66.0f, 153.0f, -446.0f, 0, 0, false, 0); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(342); + Set_Enter(54, 54); + } + return true; + } + return false; +} + +bool SceneScriptUG06::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptUG06::SceneFrameAdvanced(int frame) { +} + +void SceneScriptUG06::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptUG06::PlayerWalkedIn() { + if (Game_Flag_Query(340)) { + Loop_Actor_Walk_To_XYZ(0, 23.0f, 0.0f, 273.0f, 0, 0, false, 0); + Game_Flag_Reset(340); + } + if (Game_Flag_Query(343)) { + Loop_Actor_Travel_Stairs(0, 17, 0, 0); + Loop_Actor_Walk_To_XYZ(0, 66.0f, 0.0f, -36.91f, 0, 0, false, 0); + Game_Flag_Reset(343); + } + if (Global_Variable_Query(1) == 4 && !Game_Flag_Query(524)) { + Player_Loses_Control(); + Actor_Voice_Over(2620, 99); + Actor_Voice_Over(2630, 99); + Actor_Voice_Over(2640, 99); + Actor_Voice_Over(2650, 99); + Actor_Voice_Over(2660, 99); + Actor_Voice_Over(2670, 99); + Actor_Voice_Over(2680, 99); + Actor_Voice_Over(2690, 99); + Actor_Voice_Over(2700, 99); + Player_Gains_Control(); + Game_Flag_Set(524); + Autosave_Game(2); + } + //return false; +} + +void SceneScriptUG06::PlayerWalkedOut() { +} + +void SceneScriptUG06::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ug07.cpp b/engines/bladerunner/script/scene/ug07.cpp new file mode 100644 index 0000000000..e276c8e8e0 --- /dev/null +++ b/engines/bladerunner/script/scene/ug07.cpp @@ -0,0 +1,193 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptUG07::InitializeScene() { + if (Game_Flag_Query(428)) { + Setup_Scene_Information(-76.0f, -12.21f, -738.0f, 505); + Game_Flag_Reset(428); + } else if (Game_Flag_Query(426)) { + Setup_Scene_Information(110.0f, -12.21f, -276.0f, 605); + } else { + Setup_Scene_Information(-10.0f, -12.21f, -58.0f, 0); + Game_Flag_Reset(424); + } + if (Game_Flag_Query(623)) { + Scene_Exit_Add_2D_Exit(0, 0, 192, 51, 334, 0); + Scene_Exit_Add_2D_Exit(1, 226, 224, 314, 396, 1); + } + Scene_Exit_Add_2D_Exit(2, 60, 440, 460, 479, 2); + Ambient_Sounds_Add_Looping_Sound(105, 90, -45, 1); + Ambient_Sounds_Add_Looping_Sound(332, 40, 0, 1); + Ambient_Sounds_Add_Looping_Sound(333, 40, 0, 1); + Ambient_Sounds_Add_Sound(368, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(402, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(369, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(395, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(398, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(291, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(292, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(293, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(294, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(295, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(303, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(304, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(305, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); +} + +void SceneScriptUG07::SceneLoaded() { + Obstacle_Object("BOX RIGHT WALL 01", true); + Obstacle_Object("BOX RIGHT WALL 09", true); + Obstacle_Object("SLIDING DOOR", true); + Unobstacle_Object("BOX LEFT WALL 01", true); + Unclickable_Object("BOX RIGHT WALL 09"); + Unclickable_Object("BOX RIGHT WALL 01"); + Unclickable_Object("SLIDING DOOR"); + Unobstacle_Object("BOX FOR WALL LEFT02", true); + Unobstacle_Object("BOX FOR WALL LEFT03", true); + Unobstacle_Object("BOX FOR WALL LEFT05", true); + Unobstacle_Object("BOX FOR WALL LEFT07", true); + Unobstacle_Object("BOX FOR WALL LEFT09", true); + Unobstacle_Object("BOX FOR WALL LEFT10", true); + Unobstacle_Object("BOX FOR WALL LEFT11", true); + Unobstacle_Object("BOX FOR WALL LEFT12", true); + Unobstacle_Object("BOX FOR WALL LEFT13", true); +} + +bool SceneScriptUG07::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptUG07::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptUG07::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptUG07::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptUG07::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -94.0f, -12.21f, -710.0f, 0, 1, false, 0) && Actor_Query_Goal_Number(5) != 402) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(427); + Set_Enter(82, 94); + return true; + } + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, 110.0f, -12.21f, -274.0f, 0, 1, false, 0) && Actor_Query_Goal_Number(5) != 402) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(425); + Set_Enter(81, 93); + return true; + } + } + if (exitId == 2) { + if (!Game_Flag_Query(607) && Game_Flag_Query(671) && Global_Variable_Query(1) == 4 && !Game_Flag_Query(598)) { + if (!Loop_Actor_Walk_To_XYZ(0, 49.0f, -12.21f, -130.0f, 0, 1, false, 0)) { + Game_Flag_Set(598); + Actor_Put_In_Set(5, 80); + Actor_Set_At_XYZ(5, 118.02f, -12.21f, -154.0f, 768); + Player_Set_Combat_Mode(true); + Actor_Face_Actor(0, 5, true); + Loop_Actor_Walk_To_XYZ(5, 98.019997f, -12.21f, -154.0f, 0, 0, false, 0); + Actor_Face_Actor(5, 0, true); + Actor_Set_Goal_Number(0, 301); + Actor_Face_Heading(0, 0, true); + Delay(1500); + Actor_Says_With_Pause(5, 550, 1.0f, 3); + if (Actor_Clue_Query(5, 224)) { + Actor_Says(5, 560, 3); + Actor_Set_Goal_Number(0, 302); + Sound_Play(561, 100, 0, 0, 50); + Delay(2000); + } + if (Actor_Clue_Query(5, 223)) { + Actor_Says(5, 570, 3); + Actor_Set_Goal_Number(0, 302); + Sound_Play(561, 100, 0, 0, 50); + Delay(2000); + } + Actor_Set_Goal_Number(0, 303); + Delay(1000); + Actor_Set_Goal_Number(5, 401); + } + } else { + if (!Loop_Actor_Walk_To_XYZ(0, -10.0f, -21.47f, -58.0f, 0, 1, false, 0) && Actor_Query_Goal_Number(5) != 402) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(423); + Set_Enter(83, 95); + return true; + } + } + } + return false; +} + +bool SceneScriptUG07::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptUG07::SceneFrameAdvanced(int frame) { +} + +void SceneScriptUG07::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptUG07::PlayerWalkedIn() { + if (Global_Variable_Query(1) == 4 && !Game_Flag_Query(623)) { + Actor_Set_Goal_Number(23, 307); + Actor_Set_Goal_Number(24, 307); + } + if (Game_Flag_Query(426)) { + Loop_Actor_Walk_To_XYZ(0, 62.0f, -12.21f, -274.0f, 0, 0, false, 0); + Game_Flag_Reset(426); + } +} + +void SceneScriptUG07::PlayerWalkedOut() { + if (Global_Variable_Query(1) == 4 && (Actor_Query_Goal_Number(23) == 307 || Actor_Query_Goal_Number(24) == 307)) { + Non_Player_Actor_Combat_Mode_Off(23); + Non_Player_Actor_Combat_Mode_Off(24); + Actor_Set_Goal_Number(23, 306); + Actor_Set_Goal_Number(24, 306); + } + if (Actor_Query_In_Set(5, 80)) { + Actor_Set_Goal_Number(5, 400); + } +} + +void SceneScriptUG07::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ug08.cpp b/engines/bladerunner/script/scene/ug08.cpp new file mode 100644 index 0000000000..5681926725 --- /dev/null +++ b/engines/bladerunner/script/scene/ug08.cpp @@ -0,0 +1,145 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptUG08::InitializeScene() { + if (Game_Flag_Query(430)) { + Setup_Scene_Information(-124.0f, 93.18f, 71.0f, 745); + } else { + Setup_Scene_Information(-432.0f, 0.0f, -152.0f, 370); + } + Scene_Exit_Add_2D_Exit(0, 125, 220, 157, 303, 3); + Scene_Exit_Add_2D_Exit(1, 353, 145, 552, 309, 1); + Ambient_Sounds_Add_Looping_Sound(331, 28, 0, 1); + Ambient_Sounds_Add_Looping_Sound(332, 40, 0, 1); + Ambient_Sounds_Add_Looping_Sound(333, 40, 0, 1); + Ambient_Sounds_Add_Sound(368, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(401, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(369, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(398, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(291, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(292, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(293, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(294, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(295, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(303, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(304, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(305, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); + if (!Game_Flag_Query(610)) { + Game_Flag_Set(431); + Game_Flag_Set(610); + } + if (Game_Flag_Query(430)) { + Scene_Loop_Start_Special(0, 0, 0); + Scene_Loop_Set_Default(1); + } else if (Game_Flag_Query(431)) { + Scene_Loop_Set_Default(1); + } else { + Scene_Loop_Set_Default(4); + } +} + +void SceneScriptUG08::SceneLoaded() { + Obstacle_Object("ELEV LEGS", true); + Unobstacle_Object("ELEV LEGS", true); + Unobstacle_Object("BOX RIGHT WALL ", true); +} + +bool SceneScriptUG08::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptUG08::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptUG08::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptUG08::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptUG08::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -432.0f, 0.0f, -152.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(426); + Set_Enter(80, 92); + } + } else if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -312.0f, -2.0f, 152.0f, 0, 1, false, 0)) { + Actor_Face_Heading(0, 240, false); + Footstep_Sound_Override_On(2); + Loop_Actor_Travel_Stairs(0, 11, 1, 0); + Footstep_Sound_Override_Off(); + Loop_Actor_Walk_To_XYZ(0, -118.02f, 93.02f, 52.76f, 0, 0, false, 0); + Player_Loses_Control(); + Actor_Set_Invisible(0, true); + Game_Flag_Set(429); + Game_Flag_Reset(431); + Set_Enter(85, 97); + Scene_Loop_Start_Special(1, 3, 0); + } + } + return false; +} + +bool SceneScriptUG08::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptUG08::SceneFrameAdvanced(int frame) { + if (frame == 91) { + Ambient_Sounds_Play_Sound(372, 90, 0, 0, 100); + } +} + +void SceneScriptUG08::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptUG08::PlayerWalkedIn() { + if (Game_Flag_Query(430)) { + Loop_Actor_Walk_To_XYZ(0, -167.0f, 93.18f, 71.0f, 0, 0, false, 0); + Loop_Actor_Walk_To_XYZ(0, -180.0f, 93.18f, 134.0f, 0, 0, false, 0); + Actor_Face_Heading(0, 745, false); + Footstep_Sound_Override_On(2); + Loop_Actor_Travel_Stairs(0, 11, 0, 0); + Footstep_Sound_Override_Off(); + Player_Gains_Control(); + } + Game_Flag_Reset(425); + Game_Flag_Reset(430); +} + +void SceneScriptUG08::PlayerWalkedOut() { +} + +void SceneScriptUG08::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ug09.cpp b/engines/bladerunner/script/scene/ug09.cpp new file mode 100644 index 0000000000..92476fbe3d --- /dev/null +++ b/engines/bladerunner/script/scene/ug09.cpp @@ -0,0 +1,153 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptUG09::InitializeScene() { + if (Game_Flag_Query(433)) { + Setup_Scene_Information(-67.0f, 156.94f, -425.0f, 500); + Game_Flag_Reset(433); + } else { + Setup_Scene_Information(-53.0f, 156.94f, 174.0f, 1000); + Game_Flag_Reset(427); + } + Scene_Exit_Add_2D_Exit(0, 204, 159, 392, 360, 0); + Scene_Exit_Add_2D_Exit(1, 0, 455, 639, 479, 2); + Ambient_Sounds_Add_Looping_Sound(105, 71, 0, 1); + Ambient_Sounds_Add_Looping_Sound(95, 45, 0, 1); + Ambient_Sounds_Add_Looping_Sound(332, 76, 0, 1); + Ambient_Sounds_Add_Sound(291, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(292, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(294, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(401, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(402, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(369, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(397, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(398, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(295, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(303, 5, 50, 47, 57, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(304, 5, 50, 47, 57, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(305, 5, 50, 47, 57, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(1, 5, 50, 47, 57, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(57, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(58, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(307, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(308, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(198, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(199, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); +} + +void SceneScriptUG09::SceneLoaded() { + Obstacle_Object("FACADE_CANOPY", true); + Obstacle_Object("VW PROP SLAB", true); + Obstacle_Object("WALL_LEFT FRONT", true); + Unobstacle_Object("PATH_FRAGMENT 1", true); + Unobstacle_Object("BOXS FOR ARCHWAY 02", true); + Unobstacle_Object("BOXS FOR ARCHWAY 04", true); + Unobstacle_Object("BOXS FOR ARCHWAY 05", true); + Unobstacle_Object("BOX45", true); + Unobstacle_Object("BOX44", true); + Unobstacle_Object("BOX43", true); + Unobstacle_Object("BOX42", true); + Unobstacle_Object("BOX41", true); + Unobstacle_Object("BOX40", true); + Unobstacle_Object("BOX39", true); + Unobstacle_Object("BOX38", true); + Unobstacle_Object("BOX37", true); + Unobstacle_Object("BOX36", true); + Unobstacle_Object("BOX35", true); + Unobstacle_Object("BOX34", true); + Unobstacle_Object("BOX32", true); + Clickable_Object("FACADE_CANOPY"); +} + +bool SceneScriptUG09::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptUG09::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptUG09::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptUG09::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptUG09::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -67.0f, 156.94f, -425.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(432); + Set_Enter(4, 24); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -53.0f, 156.94f, 206.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(428); + Set_Enter(80, 92); + } + return true; + } + return false; +} + +bool SceneScriptUG09::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptUG09::SceneFrameAdvanced(int frame) { + //return false; +} + +void SceneScriptUG09::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptUG09::PlayerWalkedIn() { + if (Global_Variable_Query(1) == 4 && Game_Flag_Query(623)) { + Game_Flag_Set(630); + } +} + +void SceneScriptUG09::PlayerWalkedOut() { + if (Global_Variable_Query(1) == 4 && Global_Variable_Query(1) != 5) { + Game_Flag_Reset(630); + } + if (Game_Flag_Query(432)) { + Game_Flag_Set(176); + Game_Flag_Reset(259); + } +} + +void SceneScriptUG09::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ug10.cpp b/engines/bladerunner/script/scene/ug10.cpp new file mode 100644 index 0000000000..ba153ff36f --- /dev/null +++ b/engines/bladerunner/script/scene/ug10.cpp @@ -0,0 +1,234 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptUG10::InitializeScene() { + if (Game_Flag_Query(336)) { + Setup_Scene_Information(-92.0f, 81.33f, -652.0f, 520); + } else if (Game_Flag_Query(423)) { + Game_Flag_Reset(423); + Setup_Scene_Information(-385.12f, 1.15f, 57.44f, 400); + } else if (Game_Flag_Query(346)) { + Setup_Scene_Information(2.5f, 1.15f, 405.0f, 200); + } else { + Setup_Scene_Information(235.0f, 1.15f, 29.0f, 0); + } + Scene_Exit_Add_2D_Exit(0, 589, 300, 639, 479, 1); + Scene_Exit_Add_2D_Exit(1, 460, 70, 632, 171, 0); + Scene_Exit_Add_2D_Exit(2, 38, 78, 83, 264, 3); + Scene_Exit_Add_2D_Exit(3, 0, 0, 30, 479, 3); + Scene_2D_Region_Add(0, 349, 311, 382, 364); + Ambient_Sounds_Add_Looping_Sound(105, 71, 0, 1); + Ambient_Sounds_Add_Looping_Sound(95, 45, 0, 1); + Ambient_Sounds_Add_Looping_Sound(332, 76, 0, 1); + Ambient_Sounds_Add_Sound(291, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(293, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(295, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(368, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(401, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(402, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(369, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(397, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(398, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(303, 5, 50, 47, 57, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(304, 5, 50, 47, 57, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(1, 5, 150, 47, 57, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(58, 5, 150, 17, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(230, 2, 20, 25, 32, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(233, 2, 20, 25, 32, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(235, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(394, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(224, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(228, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(229, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); + if (Game_Flag_Query(474)) { + Scene_Loop_Set_Default(4); + } else { + Scene_Loop_Set_Default(1); + } +} + +void SceneScriptUG10::SceneLoaded() { + Obstacle_Object("SLUICEGATE_LEVER", true); + if (Global_Variable_Query(1) == 4 && !Game_Flag_Query(474) && Game_Flag_Query(172) && !Game_Flag_Query(693)) { + Scene_Loop_Set_Default(1); + Scene_Loop_Start_Special(2, 6, 1); + Game_Flag_Set(693); + //return true; + } + //return false; +} + +bool SceneScriptUG10::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptUG10::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptUG10::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptUG10::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptUG10::ClickedOnExit(int exitId) { + float x, y, z; + Actor_Query_XYZ(0, &x, &y, &z); + if (exitId == 0) { + if ((!Game_Flag_Query(474) && x > 125.0f) || Game_Flag_Query(474)) { + if (!Loop_Actor_Walk_To_XYZ(0, 235.0f, 1.15f, 29.0f, 0, 1, false, 0)) { + Game_Flag_Set(317); + Set_Enter(74, 86); + return true; + } + } else if (!Game_Flag_Query(474)) { + Actor_Says(0, 8521, 3); + } + } else if (exitId == 1) { + if ((!Game_Flag_Query(474) && x < 120.0f) || Game_Flag_Query(474)) { + if (!Loop_Actor_Walk_To_XYZ(0, -1.83f, 1.15f, -410.8f, 0, 1, false, 0)) { + Actor_Face_Heading(0, 0, false); + Loop_Actor_Travel_Stairs(0, 9, 1, 0); + Loop_Actor_Walk_To_XYZ(0, -92.0f, 81.83f, -652.0f, 0, 0, false, 0); + Game_Flag_Set(337); + Set_Enter(76, 88); + return true; + } + } else if (!Game_Flag_Query(474)) { + Actor_Says(0, 6165, 3); + } + } else if (exitId == 2) { + if ((!Game_Flag_Query(474) && x < 120.0f) || Game_Flag_Query(474)) { + if (!Loop_Actor_Walk_To_XYZ(0, -385.0f, 1.15f, 57.44f, 0, 1, false, 0)) { + Actor_Face_Heading(0, 1001, false); + Loop_Actor_Travel_Ladder(0, 1, 1, 0); + Game_Flag_Set(424); + Set_Enter(80, 92); + return true; + } + } else if (!Game_Flag_Query(474)) { + Actor_Says(0, 6165, 3); + } + } else if (exitId == 3) { + if ((!Game_Flag_Query(474) && x < 120.0f) || Game_Flag_Query(474)) { + if (!Loop_Actor_Walk_To_XYZ(0, 2.5f, 1.15f, 405.0f, 0, 1, false, 0)) { + Game_Flag_Set(347); + Set_Enter(86, 98); + return true; + } + } else if (!Game_Flag_Query(474)) { + Actor_Says(0, 6165, 3); + } + } + return false; +} + +bool SceneScriptUG10::ClickedOn2DRegion(int region) { + float x, y, z; + Actor_Query_XYZ(0, &x, &y, &z); + if (region == 0 && !Player_Query_Combat_Mode()) { + if (x >= 120.0f) { + Actor_Says(0, 8525, 3); + } else if (!Loop_Actor_Walk_To_XYZ(0, 4.98f, 0.38f, 83.15f, 0, 1, false, 0)) { + if (Game_Flag_Query(474)) { + Scene_Loop_Set_Default(1); + Scene_Loop_Start_Special(2, 0, 0); + Game_Flag_Reset(474); + Obstacle_Object("BOX01 BRIDGE", true); + Player_Loses_Control(); + } else { + Scene_Loop_Set_Default(4); + Scene_Loop_Start_Special(2, 3, 0); + Game_Flag_Set(474); + Unobstacle_Object("BOX01 BRIDGE", true); + Player_Loses_Control(); + } + } + return true; + } + return false; +} + +void SceneScriptUG10::SceneFrameAdvanced(int frame) { + if (frame == 121) { + Ambient_Sounds_Play_Sound(558, 90, 0, 0, 99); + } + if (frame == 127) { + Ambient_Sounds_Play_Sound(353, 90, 0, 0, 99); + } + if (frame == 147) { + Ambient_Sounds_Play_Sound(353, 90, 0, 0, 99); + } + if (frame == 1) { + Ambient_Sounds_Play_Sound(558, 90, 0, 0, 99); + } + if (frame == 3) { + Ambient_Sounds_Play_Sound(353, 90, 0, 0, 99); + } + if (frame == 23) { + Ambient_Sounds_Play_Sound(353, 90, 0, 0, 99); + } + if (frame == 58 || frame == 179) { + Player_Gains_Control(); + } + //return false; +} + +void SceneScriptUG10::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptUG10::PlayerWalkedIn() { + if (Game_Flag_Query(346)) { + Game_Flag_Reset(346); + Loop_Actor_Walk_To_XYZ(0, 2.5f, 1.15f, 377.0f, 0, 0, false, 0); + } else if (Game_Flag_Query(316)) { + Game_Flag_Reset(316); + Loop_Actor_Walk_To_XYZ(0, 207.0f, 1.15f, 29.0f, 0, 0, false, 0); + } else if (Game_Flag_Query(336)) { + Game_Flag_Reset(336); + Loop_Actor_Walk_To_XYZ(0, -1.83f, 81.33f, -518.8f, 0, 0, false, 0); + Actor_Face_Heading(0, 506, false); + Loop_Actor_Travel_Stairs(0, 9, 0, 0); + } + if (Game_Flag_Query(474)) { + Unobstacle_Object("BOX01 BRIDGE", true); + } else { + Obstacle_Object("BOX01 BRIDGE", true); + } +} + +void SceneScriptUG10::PlayerWalkedOut() { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); +} + +void SceneScriptUG10::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ug12.cpp b/engines/bladerunner/script/scene/ug12.cpp new file mode 100644 index 0000000000..948d05604f --- /dev/null +++ b/engines/bladerunner/script/scene/ug12.cpp @@ -0,0 +1,122 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptUG12::InitializeScene() { + if (Game_Flag_Query(411)) { + Setup_Scene_Information(207.0f, -126.21f, -364.0f, 561); + Game_Flag_Reset(411); + } else { + Setup_Scene_Information(375.0f, -126.21f, 180.0f, 730); + Game_Flag_Reset(345); + } + Scene_Exit_Add_2D_Exit(0, 538, 222, 615, 346, 1); + if (Game_Flag_Query(373)) { + Scene_Exit_Add_2D_Exit(1, 334, 176, 426, 266, 0); + } + Ambient_Sounds_Add_Looping_Sound(105, 47, 60, 1); + Ambient_Sounds_Add_Looping_Sound(332, 40, 0, 1); + Ambient_Sounds_Add_Looping_Sound(333, 40, 0, 1); + Ambient_Sounds_Add_Sound(291, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(292, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(368, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(369, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(370, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(293, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(294, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(295, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(303, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(304, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(305, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); + if (Game_Flag_Query(373)) { + Scene_Loop_Set_Default(2); + } else { + Scene_Loop_Set_Default(0); + } +} + +void SceneScriptUG12::SceneLoaded() { + Unobstacle_Object("GATE1", true); + Obstacle_Object("TRAIN WRECK", true); +} + +bool SceneScriptUG12::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptUG12::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptUG12::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptUG12::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptUG12::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, 375.0f, -126.21f, 180.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(344); + Set_Enter(86, 98); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, 207.0f, -126.21f, -364.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(412); + Set_Enter(45, 42); + } + return true; + } + return false; +} + +bool SceneScriptUG12::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptUG12::SceneFrameAdvanced(int frame) { +} + +void SceneScriptUG12::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptUG12::PlayerWalkedIn() { +} + +void SceneScriptUG12::PlayerWalkedOut() { +} + +void SceneScriptUG12::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ug13.cpp b/engines/bladerunner/script/scene/ug13.cpp new file mode 100644 index 0000000000..bd5614275a --- /dev/null +++ b/engines/bladerunner/script/scene/ug13.cpp @@ -0,0 +1,410 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptUG13::InitializeScene() { + if (Game_Flag_Query(435)) { + Setup_Scene_Information(-477.0f, 141.9f, -870.0f, 378); + } else if (Game_Flag_Query(350)) { + Setup_Scene_Information(39.0f, 52.94f, -528.0f, 600); + } else { + Setup_Scene_Information(-22.0f, 54.63f, -883.0f, 578); + Actor_Set_Invisible(0, false); + } + if (!Game_Flag_Query(431)) { + Scene_Exit_Add_2D_Exit(0, 394, 205, 464, 281, 0); + } + Scene_Exit_Add_2D_Exit(1, 560, 90, 639, 368, 1); + Scene_Exit_Add_2D_Exit(2, 108, 85, 175, 210, 3); + Ambient_Sounds_Add_Looping_Sound(331, 15, 0, 1); + Ambient_Sounds_Add_Looping_Sound(332, 40, 0, 1); + Ambient_Sounds_Add_Looping_Sound(333, 40, 0, 1); + Ambient_Sounds_Add_Sound(401, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(402, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(369, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(397, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(398, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + if (Global_Variable_Query(1) == 4 && !Game_Flag_Query(169)) { + Actor_Set_Goal_Number(12, 390); + } + if (Actor_Query_Goal_Number(12) == 599) { + Actor_Change_Animation_Mode(12, 89); + } + if (Game_Flag_Query(429)) { + Scene_Loop_Start_Special(0, 0, 0); + Scene_Loop_Set_Default(1); + } else if (Game_Flag_Query(431)) { + Scene_Loop_Set_Default(4); + } else { + Scene_Loop_Set_Default(1); + } +} + +void SceneScriptUG13::SceneLoaded() { + Obstacle_Object("BASKET", true); + Obstacle_Object("BOLLARD", true); + Unobstacle_Object("STAIR", true); + Unobstacle_Object("BOX FOR ARCHWAY 02", true); + Unobstacle_Object("STAIR_RAIL", true); + Unobstacle_Object("DISC_LEFT", true); + Clickable_Object("BASKET"); + Clickable_Object("BOLLARD"); + Unclickable_Object("BASKET"); + if (Global_Variable_Query(1) >= 3 && !Actor_Clue_Query(0, 128) && Game_Flag_Query(169) && (Actor_Clue_Query(0, 81) || Actor_Clue_Query(0, 80))) { + Item_Add_To_World(111, 958, 85, -209.01f, 70.76f, -351.79f, 0, 16, 12, false, true, false, true); + } +} + +bool SceneScriptUG13::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptUG13::ClickedOn3DObject(const char *objectName, bool a2) { + + if (Object_Query_Click("BOLLARD", objectName) && !Loop_Actor_Walk_To_XYZ(0, 7.0f, 44.0f, -695.0f, 0, 1, false, 0)) { + Actor_Face_Object(0, "BOLLARD", true); + if (Game_Flag_Query(431)) { + Scene_Loop_Set_Default(1); + Scene_Loop_Start_Special(2, 0, 0); + Game_Flag_Reset(431); + Game_Flag_Set(436); + return true; + } else { + Scene_Loop_Set_Default(4); + Scene_Loop_Start_Special(2, 3, 0); + Game_Flag_Set(431); + Scene_Exit_Remove(0); + return true; + } + } + return false; +} + +bool SceneScriptUG13::ClickedOnActor(int actorId) { + if (actorId == 12 && Global_Variable_Query(1) == 4 && !Loop_Actor_Walk_To_XYZ(0, -248.0f, 44.0f, -390.0f, 12, 1, false, 0)) { + Actor_Face_Actor(0, 12, true); + if (Actor_Query_Goal_Number(12) != 6 && Actor_Query_Goal_Number(12) != 599) { + if (!Game_Flag_Query(554)) { + sub_40223C(); + } else if (!Actor_Clue_Query(0, 122) || !Actor_Clue_Query(0, 123)) { + sub_402AD4(); + } else { + Actor_Set_Goal_Number(12, 391); + if (Actor_Clue_Query(0, 131)) { + sub_402AD4(); + } else { + Actor_Face_Actor(0, 12, true); + Actor_Says(0, 5600, 14); + Actor_Says(12, 100, 53); + Actor_Says(0, 5605, 18); + Actor_Start_Speech_Sample(12, 110); + Actor_Set_Goal_Number(12, 395); + } + } + } else if (Random_Query(0, 1) == 1) { + Actor_Says(0, 8590, 16); + } else { + Actor_Says(0, 8655, 15); + } + } + return false; +} + +bool SceneScriptUG13::ClickedOnItem(int itemId, bool a2) { + if (itemId == 111 && !Loop_Actor_Walk_To_Item(0, 111, 36, 1, false)) { + Actor_Face_Item(0, 111, true); + Actor_Clue_Acquire(0, 128, 1, -1); + Item_Remove_From_World(111); + Item_Pickup_Spin_Effect(958, 426, 316); + Actor_Voice_Over(3950, 99); + Actor_Voice_Over(3960, 99); + Actor_Voice_Over(3970, 99); + Actor_Voice_Over(3980, 99); + Actor_Voice_Over(3990, 99); + Actor_Voice_Over(4000, 99); + return true; + } + return false; +} + +bool SceneScriptUG13::ClickedOnExit(int exitId) { + + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -32.0f, 54.63f, -883.0f, 0, 1, false, 0)) { + Player_Loses_Control(); + Game_Flag_Set(430); + Game_Flag_Set(431); + Set_Enter(81, 93); + Scene_Loop_Start_Special(1, 3, 0); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, 39.0f, 52.94f, -528.0f, 0, 1, false, 0)) { + Game_Flag_Set(351); + Set_Enter(87, 99); + } + return true; + } + if (exitId == 2) { + if (!Loop_Actor_Walk_To_XYZ(0, -267.0f, 44.0f, -795.0f, 0, 1, false, 0)) { + Actor_Face_Heading(0, 830, false); + Footstep_Sound_Override_On(3); + Loop_Actor_Travel_Stairs(0, 11, 1, 0); + Footstep_Sound_Override_Off(); + if (!sub_402AD0()) { + Loop_Actor_Walk_To_XYZ(0, -477.0f, 141.9f, -870.0f, 0, 0, false, 0); + Game_Flag_Set(434); + Set_Enter(89, 102); + return true; + } + Actor_Face_Heading(0, 325, false); + Loop_Actor_Travel_Stairs(0, 11, 0, 0); + } else { + return true; + } + } + + return false; +} + +bool SceneScriptUG13::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptUG13::SceneFrameAdvanced(int frame) { + if (frame == 94) { + Ambient_Sounds_Play_Sound(372, 90, 0, 0, 100); + } + if (Game_Flag_Query(436) && frame > 29 && frame < 91) { + Scene_Exit_Add_2D_Exit(0, 394, 205, 464, 281, 0); + Game_Flag_Reset(436); + //return true; + return; + } + if (Game_Flag_Query(429) && frame < 25) { + Actor_Set_Invisible(0, true); + } else if (Game_Flag_Query(430) && frame >= 94 && frame <= 120) { + Actor_Set_Invisible(0, true); + } else { + Actor_Set_Invisible(0, false); + } + //return false; + return; +} + +void SceneScriptUG13::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptUG13::PlayerWalkedIn() { + if (Game_Flag_Query(435)) { + Loop_Actor_Walk_To_XYZ(0, -389.0f, 143.0f, -844.0f, 0, 0, false, 0); + Actor_Face_Heading(0, 325, false); + Footstep_Sound_Override_On(3); + Loop_Actor_Travel_Stairs(0, 11, 0, 0); + Footstep_Sound_Override_Off(); + Game_Flag_Reset(435); + } else if (Game_Flag_Query(350)) { + Loop_Actor_Walk_To_XYZ(0, -12.0f, 44.0f, -528.0f, 0, 0, false, 0); + Game_Flag_Reset(350); + } else { + Loop_Actor_Walk_To_XYZ(0, -60.0f, 55.24f, -816.0f, 0, 0, false, 0); + Game_Flag_Reset(429); + Player_Gains_Control(); + } + if (Actor_Query_Goal_Number(12) >= 390 && !Game_Flag_Query(169)) { + if (Game_Flag_Query(553)) { + if (Random_Query(1, 3) == 1) { + Actor_Set_Goal_Number(12, 395); + } + } else { + Game_Flag_Set(553); + Actor_Says(12, 50, 3); + } + } + //return false; +} + +void SceneScriptUG13::PlayerWalkedOut() { + Actor_Set_Invisible(0, false); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + if (Game_Flag_Query(430)) { + Ambient_Sounds_Remove_Sound(401, false); + Ambient_Sounds_Remove_Sound(402, false); + Ambient_Sounds_Remove_Sound(369, false); + Ambient_Sounds_Remove_Sound(397, false); + Ambient_Sounds_Remove_Sound(398, false); + } else { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + } +} + +void SceneScriptUG13::DialogueQueueFlushed(int a1) { +} + +void SceneScriptUG13::sub_40223C() { + Actor_Face_Actor(0, 12, true); + Game_Flag_Set(554); + Actor_Says(0, 5560, 13); + Actor_Says_With_Pause(0, 5565, 3.0f, 18); + Actor_Says(12, 70, 31); + Actor_Says(12, 80, 32); + Actor_Says(0, 5570, 3); + Actor_Says(12, 90, 32); +} + +void SceneScriptUG13::sub_4023D8() { + Actor_Face_Actor(0, 12, true); + Actor_Clue_Acquire(0, 122, 0, 12); + Actor_Modify_Friendliness_To_Other(12, 0, -5); + Actor_Says(0, 5575, 16); + Actor_Says(12, 120, 31); + Actor_Says(0, 5610, 15); + Actor_Says(12, 140, 32); + Actor_Says(0, 5615, 18); + Actor_Says(12, 160, 33); + Actor_Says(0, 5620, 9); + Actor_Says(12, 170, 30); + Actor_Says(0, 5625, 12); + Actor_Says(12, 180, 32); + Actor_Says(0, 5630, 18); + Actor_Says(12, 190, 32); + Actor_Says(0, 5635, 15); + Actor_Says(12, 200, 31); +} + +void SceneScriptUG13::sub_4025E0() { + Actor_Clue_Acquire(0, 123, 0, 12); + Actor_Modify_Friendliness_To_Other(12, 0, -10); + Actor_Says(12, 220, 30); + Actor_Says(0, 5640, 19); + Actor_Says(12, 230, 33); + Actor_Says(0, 5645, 16); + Actor_Says(12, 240, 30); + Actor_Says(12, 250, 33); + Actor_Says(0, 5650, 14); + Actor_Says(12, 260, 32); +} + +void SceneScriptUG13::sub_402960() { + Actor_Says(0, 5670, 9); + Actor_Says(12, 340, 31); + Actor_Says(0, 5690, 19); + Actor_Says(12, 350, 32); + Actor_Says(0, 5695, 14); + Actor_Says(12, 360, 33); + Actor_Voice_Over(2710, 99); + Actor_Voice_Over(2730, 99); + Actor_Clue_Acquire(0, 124, 0, 12); +} + +int SceneScriptUG13::sub_402AD0() { + return 0; +} + +void SceneScriptUG13::sub_402AD4() { + Dialogue_Menu_Clear_List(); + DM_Add_To_List_Never_Repeat_Once_Selected(1320, 6, 3, 1); + if (Actor_Clue_Query(0, 122)) { + DM_Add_To_List_Never_Repeat_Once_Selected(1330, 5, 8, 5); + } + DM_Add_To_List_Never_Repeat_Once_Selected(1340, 2, 4, 6); + if (Actor_Clue_Query(0, 131)) { + DM_Add_To_List_Never_Repeat_Once_Selected(1350, 1, 3, 7); + } + Dialogue_Menu_Add_DONE_To_List(1360); + Dialogue_Menu_Appear(320, 240); + int answer = Dialogue_Menu_Query_Input(); + Dialogue_Menu_Disappear(); + switch (answer) { + case 1360: + return; + case 1350: + Actor_Clue_Acquire(12, 131, 0, 0); + Actor_Says_With_Pause(0, 5595, 1.0f, 23); + Item_Pickup_Spin_Effect(945, 193, 325); + Actor_Says(12, 290, 33); + Actor_Says(0, 5660, 13); + Actor_Clue_Lose(0, 131); + sub_402E24(); + break; + case 1340: + Actor_Modify_Friendliness_To_Other(12, 0, -10); + Actor_Says(0, 5590, 15); + Actor_Says(12, 270, 31); + Actor_Says(0, 5655, 16); + Actor_Says(12, 280, 32); + break; + case 1330: + Actor_Says(0, 5585, 16); + sub_4025E0(); + break; + case 1320: + sub_4023D8(); + break; + default: + Actor_Face_Actor(0, 12, true); + Actor_Says(0, 5600, 14); + Actor_Says(12, 100, 53); + Actor_Says(0, 5605, 18); + Actor_Start_Speech_Sample(12, 110); + Actor_Set_Goal_Number(12, 395); + break; + } +} + +void SceneScriptUG13::sub_402E24() { + Actor_Set_Friendliness_To_Other(12, 0, 40); + Dialogue_Menu_Clear_List(); + DM_Add_To_List_Never_Repeat_Once_Selected(1370, 1, 1, 8); + DM_Add_To_List_Never_Repeat_Once_Selected(1380, 1, 8, 1); + DM_Add_To_List_Never_Repeat_Once_Selected(1390, 8, 1, 1); + Dialogue_Menu_Appear(320, 240); + int answer = Dialogue_Menu_Query_Input(); + Dialogue_Menu_Disappear(); + if (answer == 1370) { + Actor_Says(0, 5665, 16); + Actor_Says(12, 300, 32); + Actor_Says(0, 5680, 19); + Actor_Says(12, 310, 33); + Actor_Says(12, 330, 30); + Actor_Start_Speech_Sample(12, 110); + Actor_Set_Goal_Number(12, 395); + Actor_Says(0, 5685, 18); + } else if (answer == 1380) { + if (Actor_Clue_Query(0, 123)) { + sub_402960(); + } else { + Actor_Says(0, 5700, 15); + sub_4025E0(); + } + } else if (answer == 1390) { + Actor_Says(0, 5675, 9); + Actor_Says(12, 370, 32); + Actor_Says(0, 5705, 10); + } +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ug14.cpp b/engines/bladerunner/script/scene/ug14.cpp new file mode 100644 index 0000000000..26d0060476 --- /dev/null +++ b/engines/bladerunner/script/scene/ug14.cpp @@ -0,0 +1,193 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptUG14::InitializeScene() { + if (Game_Flag_Query(349)) { + Setup_Scene_Information(-278.0f, 12.97f, -152.0f, 200); + } else if (Game_Flag_Query(344)) { + Setup_Scene_Information(-50.0f, 129.0f, -814.0f, 533); + } else { + Setup_Scene_Information(233.0f, 186.04f, -32.0f, 865); + } + Scene_Exit_Add_2D_Exit(0, 0, 232, 45, 427, 3); + Scene_Exit_Add_2D_Exit(1, 175, 44, 228, 115, 0); + Scene_Exit_Add_2D_Exit(2, 537, 0, 639, 190, 1); + Ambient_Sounds_Add_Looping_Sound(331, 28, 0, 1); + Ambient_Sounds_Add_Looping_Sound(332, 40, 0, 1); + Ambient_Sounds_Add_Looping_Sound(333, 40, 0, 1); + Ambient_Sounds_Add_Sound(291, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(292, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(401, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(402, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(369, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(397, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(398, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(293, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(294, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(295, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(303, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(304, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(305, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); +} + +void SceneScriptUG14::SceneLoaded() { + Obstacle_Object("OBSTACLE02", true); + Unobstacle_Object("WALL_E_01", true); + Unclickable_Object("OBSTACLE02"); +} + +bool SceneScriptUG14::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptUG14::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptUG14::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptUG14::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptUG14::ClickedOnExit(int exitId) { + float x, y, z; + Actor_Query_XYZ(0, &x, &y, &z); + bool v1 = y > 57.0f; + if (exitId > 2) { + return false; + } + if (!exitId) { + if (v1) { + if (Loop_Actor_Walk_To_XYZ(0, 141.47f, 128.92f, -150.16f, 0, 1, false, 0)) { + return false; + } + Actor_Face_XYZ(0, -14.53f, 12.12f, -150.16f, true); + Footstep_Sound_Override_On(3); + Loop_Actor_Travel_Stairs(0, 13, 0, 0); + Footstep_Sound_Override_Off(); + } + if (!Loop_Actor_Walk_To_XYZ(0, -278.0f, 12.97f, -152.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(348); + Set_Enter(90, 103); + } + return true; + } + if (exitId == 1) { + if (!v1) { + if (Loop_Actor_Walk_To_XYZ(0, -14.53f, 12.12f, -150.16f, 0, 1, false, 0)) { + return false; + } + Actor_Face_XYZ(0, 141.47f, 128.92f, -150.16f, true); + Footstep_Sound_Override_On(3); + Loop_Actor_Travel_Stairs(0, 13, 1, 0); + Footstep_Sound_Override_Off(); + } + if (!Loop_Actor_Walk_To_XYZ(0, -50.0f, 129.0f, -814.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(345); + Set_Enter(6, 96); + } + return true; + } + + if (exitId == 2) { + if (!v1) { + if (Loop_Actor_Walk_To_XYZ(0, -14.53f, 12.12f, -150.16f, 0, 1, false, 0)) { + return false; + } + Actor_Face_XYZ(0, 141.47f, 128.92f, -150.16f, true); + Footstep_Sound_Override_On(3); + Loop_Actor_Travel_Stairs(0, 13, 1, 0); + Footstep_Sound_Override_Off(); + } + if (!Loop_Actor_Walk_To_XYZ(0, 157.0f, 128.92f, -108.01f, 0, 1, false, 0)) { + Footstep_Sound_Override_On(3); + Loop_Actor_Travel_Stairs(0, 6, 1, 0); + Footstep_Sound_Override_Off(); + Loop_Actor_Walk_To_XYZ(0, 233.0f, 186.04f, -32.0f, 0, 0, false, 0); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(346); + Set_Enter(83, 95); + } + return true; + } + return false; +} + +bool SceneScriptUG14::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptUG14::SceneFrameAdvanced(int frame) { +} + +void SceneScriptUG14::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptUG14::PlayerWalkedIn() { + if (Game_Flag_Query(349)) { + Loop_Actor_Walk_To_XYZ(0, -250.0f, 12.97f, -152.0f, 0, 0, false, 0); + Game_Flag_Reset(349); + } else if (Game_Flag_Query(344)) { + Loop_Actor_Walk_To_XYZ(0, -50.0f, 129.0f, -604.0f, 0, 0, false, 0); + Game_Flag_Reset(344); + } else { + Loop_Actor_Walk_To_XYZ(0, 157.0f, 186.04f, -44.01f, 0, 0, false, 0); + Actor_Face_Heading(0, 10, false); + Footstep_Sound_Override_On(3); + Loop_Actor_Travel_Stairs(0, 6, 0, 0); + Footstep_Sound_Override_Off(); + Loop_Actor_Walk_To_XYZ(0, 157.0f, 128.92f, -148.01f, 0, 0, false, 0); + Actor_Face_Heading(0, 807, false); + Game_Flag_Reset(347); + } + if (Global_Variable_Query(1) == 4 && Game_Flag_Query(172) && !Game_Flag_Query(694)) { + Overlay_Play("UG14OVER", 0, 0, 1, 0); + Delay(1000); + Actor_Face_Heading(0, 609, false); + Delay(3000); + Actor_Voice_Over(270, 99); + Delay(2150); + Actor_Voice_Over(300, 99); + Game_Flag_Set(694); + } + //return false; +} + +void SceneScriptUG14::PlayerWalkedOut() { +} + +void SceneScriptUG14::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ug15.cpp b/engines/bladerunner/script/scene/ug15.cpp new file mode 100644 index 0000000000..5403cbac40 --- /dev/null +++ b/engines/bladerunner/script/scene/ug15.cpp @@ -0,0 +1,203 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptUG15::InitializeScene() { + if (Game_Flag_Query(353)) { + Setup_Scene_Information(-25.0f, 26.309999f, -434.0f, 520); + } else if (Game_Flag_Query(153)) { + Setup_Scene_Information(-17.0f, 26.309999f, -346.0f, 711); + } else if (Game_Flag_Query(355)) { + Setup_Scene_Information(-18.0f, 48.07f, 62.0f, 650); + } else { + Setup_Scene_Information(-238.0f, 48.07f, 222.0f, 180); + if (Game_Flag_Query(676) && Random_Query(1, 10) == 10) { + Game_Flag_Reset(676); + } + } + if (Game_Flag_Query(682)) { + Scene_Loop_Set_Default(3); + } + if (Game_Flag_Query(353) || Game_Flag_Query(153)) { + Scene_Exit_Add_2D_Exit(0, 260, 0, 307, 298, 0); + Scene_Exit_Add_2D_Exit(1, 301, 147, 337, 304, 1); + Game_Flag_Reset(353); + Game_Flag_Reset(153); + } else { + Scene_Exit_Add_2D_Exit(2, 406, 128, 480, 316, 1); + Scene_Exit_Add_2D_Exit(3, 0, 0, 30, 479, 3); + } + Ambient_Sounds_Add_Looping_Sound(105, 71, 0, 1); + Ambient_Sounds_Add_Looping_Sound(95, 45, 0, 1); + Ambient_Sounds_Add_Looping_Sound(332, 76, 0, 1); + Ambient_Sounds_Add_Sound(291, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(292, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(293, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(294, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(295, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(401, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(402, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(369, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(397, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(398, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(303, 5, 50, 47, 57, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(304, 5, 50, 47, 57, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(305, 5, 50, 47, 57, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(1, 5, 50, 47, 57, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(57, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(58, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(306, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(307, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(308, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(196, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(197, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(198, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(199, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); + +} + +void SceneScriptUG15::SceneLoaded() { + Unobstacle_Object("CATWALK_01_RAIL02", true); + Unobstacle_Object("LOFT01", true); + Obstacle_Object("NUT1", true); + Clickable_Object("NUT1"); +} + +bool SceneScriptUG15::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptUG15::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptUG15::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptUG15::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptUG15::ClickedOnExit(int exitId) { + + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -25.0f, 26.31f, -434.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(352); + Set_Enter(88, 101); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -17.0f, 26.31f, -346.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(152); + Set_Enter(19, 100); + } + return true; + } + if (exitId == 2) { + int v1 = Actor_Query_Goal_Number(64); + if (v1 >= 300 && v1 <= 303) { + Loop_Actor_Walk_To_XYZ(0, -137.61f, 48.07f, 147.12f, 0, 1, false, 0); + } else if (!Loop_Actor_Walk_To_XYZ(0, 18.0f, 52.28f, 46.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(354); + Set_Enter(19, 100); + } + return true; + } + if (exitId == 3) { + if (!Loop_Actor_Walk_To_XYZ(0, -238.0f, 52.46f, 222.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(350); + Set_Enter(85, 97); + } + return true; + } + return false; + +} + +bool SceneScriptUG15::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptUG15::SceneFrameAdvanced(int frame) { + if (Actor_Query_Goal_Number(64) == 300) { + float x, y, z; + Actor_Query_XYZ(0, &x, &y, &z); + if (-160.0f <= x && z < 220.0f) { + Actor_Set_Goal_Number(64, 301); + } + } + if (frame == 61) { + Ambient_Sounds_Play_Sound(583, 80, 0, 0, 99); + } + if (Game_Flag_Query(677) && !Game_Flag_Query(682)) { + float x, y, z; + Actor_Query_XYZ(0, &x, &y, &z); + if (-180.0f <= x && (z < 220.0f && !Game_Flag_Query(724))) { + Game_Flag_Set(724); + Game_Flag_Set(682); + Scene_Loop_Set_Default(3); + Scene_Loop_Start_Special(2, 2, 1); + Actor_Set_Goal_Number(0, 390); + Actor_Query_XYZ(64, &x, &y, &z); + if (-200.0f < x && -62.0f > x) { + Actor_Set_Goal_Number(64, 309); + } + } + } + // return false; +} + +void SceneScriptUG15::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptUG15::PlayerWalkedIn() { + if (Game_Flag_Query(355)) { + Loop_Actor_Walk_To_XYZ(0, -62.0f, 48.07f, 102.0f, 0, 0, false, 0); + Game_Flag_Reset(355); + } else if (Game_Flag_Query(351)) { + Game_Flag_Reset(351); + if (!Game_Flag_Query(676)) { + Actor_Set_Goal_Number(64, 310); + } + } +} + +void SceneScriptUG15::PlayerWalkedOut() { +} + +void SceneScriptUG15::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ug16.cpp b/engines/bladerunner/script/scene/ug16.cpp new file mode 100644 index 0000000000..422647473c --- /dev/null +++ b/engines/bladerunner/script/scene/ug16.cpp @@ -0,0 +1,369 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptUG16::InitializeScene() { + if (Game_Flag_Query(552)) { + Setup_Scene_Information(-270.76f, -34.88f, -504.02f, 404); + Game_Flag_Reset(552); + } else if (Game_Flag_Query(152)) { + Setup_Scene_Information(-322.0f, -34.0f, -404.0f, 345); + Game_Flag_Reset(152); + } else { + Setup_Scene_Information(-318.0f, -34.0f, -216.0f, 340); + Game_Flag_Reset(354); + } + Scene_Exit_Add_2D_Exit(0, 242, 169, 282, 262, 3); + Scene_Exit_Add_2D_Exit(1, 375, 166, 407, 251, 3); + Scene_Exit_Add_2D_Exit(2, 461, 148, 523, 248, 0); + Ambient_Sounds_Add_Looping_Sound(516, 33, 81, 0); + Ambient_Sounds_Add_Looping_Sound(332, 40, 0, 1); + Ambient_Sounds_Add_Looping_Sound(333, 40, 0, 1); + if (Game_Flag_Query(568)) { + Scene_Loop_Set_Default(5); + } else { + Scene_Loop_Set_Default(0); + } +} + +void SceneScriptUG16::SceneLoaded() { + Obstacle_Object("BED", true); + Obstacle_Object("QUADPATCH07", true); + Obstacle_Object("QUADPATCH05", true); + Obstacle_Object("SCREEN 01", true); + Obstacle_Object("BOX49", true); + Obstacle_Object("CYLINDER07", true); + Unobstacle_Object("SEAT 1", true); + Unobstacle_Object("SEAT 2", true); + Unclickable_Object("BED"); + Unclickable_Object("QUADPATCH07"); + Clickable_Object("QUADPATCH05"); + Clickable_Object("SCREEN 01"); + Unclickable_Object("BOX49"); + Unclickable_Object("CYLINDER07"); + Unobstacle_Object("BOX67", true); + Footstep_Sounds_Set(0, 3); + Footstep_Sounds_Set(1, 2); + Footstep_Sounds_Set(2, 3); + Footstep_Sounds_Set(6, 3); +} + +bool SceneScriptUG16::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptUG16::ClickedOn3DObject(const char *objectName, bool a2) { + if (Object_Query_Click("QUADPATCH05", objectName) && !Loop_Actor_Walk_To_XYZ(0, 194.0f, -35.0f, 160.8f, 0, 1, false, 0)) { + Actor_Face_Heading(0, 870, false); + if (!Game_Flag_Query(597) && Game_Flag_Query(595)) { + Game_Flag_Set(597); + Delay(1000); + Actor_Voice_Over(3480, 99); + Actor_Change_Animation_Mode(0, 38); + Sound_Play(339, 100, 0, 0, 50); + Delay(1000); + Item_Pickup_Spin_Effect(948, 460, 287); + Actor_Voice_Over(2740, 99); + Actor_Voice_Over(2750, 99); + Actor_Voice_Over(2760, 99); + Actor_Voice_Over(2770, 99); + Actor_Clue_Acquire(0, 125, 1, -1); + } else { + Actor_Says(0, 8523, 12); + Actor_Says(0, 8635, 12); + } + return true; + } + if (Object_Query_Click("SCREEN 01", objectName) && !Loop_Actor_Walk_To_XYZ(0, 194.0f, -35.0f, 160.8f, 0, 1, false, 0)) { + Actor_Face_Heading(0, 870, false); + if ((!Game_Flag_Query(595) && Actor_Query_Is_In_Current_Set(10)) || Actor_Clue_Query(0, 151) || Game_Flag_Query(568)) { + Actor_Says(0, 8525, 12); + Actor_Says(0, 8526, 12); + return false; + } + Delay(2000); + Actor_Face_Heading(0, 1016, false); + Delay(2000); + Actor_Says(0, 5725, 14); + Delay(1000); + Item_Pickup_Spin_Effect(941, 418, 305); + Actor_Clue_Acquire(0, 151, 1, -1); + return true; + } + return false; +} + +bool SceneScriptUG16::ClickedOnActor(int actorId) { + if (Actor_Query_Goal_Number(10) < 490) { + sub_401D78(); + return true; + } + return false; +} + +bool SceneScriptUG16::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptUG16::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -322.0f, -34.0f, -216.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(355); + Set_Enter(87, 99); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, -322.0f, -34.0f, -404.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(153); + Set_Enter(87, 99); + } + return true; + } + if (exitId == 2) { + if (!Loop_Actor_Walk_To_XYZ(0, -316.78f, -34.88f, -533.27f, 0, 1, false, 0)) { + Actor_Face_Heading(0, 0, false); + Loop_Actor_Travel_Stairs(0, 13, 1, 0); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(551); + Set_Enter(36, 30); + } + return true; + } + return false; +} + +bool SceneScriptUG16::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptUG16::SceneFrameAdvanced(int frame) { + if (frame == 132) { + Ambient_Sounds_Remove_Looping_Sound(516, true); + } +} + +void SceneScriptUG16::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptUG16::PlayerWalkedIn() { + Game_Flag_Set(715); + if (!Game_Flag_Query(595)) { + Actor_Set_Goal_Number(10, 403); + } + if (!Game_Flag_Query(556) && Actor_Query_Is_In_Current_Set(10)) { + Player_Loses_Control(); + Loop_Actor_Walk_To_XYZ(0, 120.29f, -35.67f, 214.8f, 310, 0, false, 0); + Actor_Face_Actor(0, 10, true); + Actor_Says(10, 0, 6); + Actor_Says(10, 30, 13); + Actor_Change_Animation_Mode(10, 17); + Actor_Says(13, 0, 17); + Actor_Says(0, 5710, 14); + Actor_Says(10, 40, 13); + Actor_Says(10, 50, 15); + Actor_Says(13, 20, 12); + Actor_Says(10, 60, 23); + Actor_Says(0, 5715, 14); + Actor_Says(13, 30, 16); + Actor_Says(10, 70, 6); + Player_Gains_Control(); + Game_Flag_Set(556); + } +} + +void SceneScriptUG16::PlayerWalkedOut() { + if (!Game_Flag_Query(595)) { + Actor_Set_Goal_Number(10, 401); + //return true; + } + //return false; +} + +void SceneScriptUG16::DialogueQueueFlushed(int a1) { +} + +void SceneScriptUG16::sub_401D78() { + Dialogue_Menu_Clear_List(); + DM_Add_To_List_Never_Repeat_Once_Selected(1400, 5, 6, 2); + DM_Add_To_List_Never_Repeat_Once_Selected(1410, 5, 4, 8); + if (Game_Flag_Query(600) || Game_Flag_Query(601)) { + DM_Add_To_List_Never_Repeat_Once_Selected(1420, 6, 4, 5); + DM_Add_To_List_Never_Repeat_Once_Selected(1430, 6, 4, 5); + DM_Add_To_List_Never_Repeat_Once_Selected(1440, 6, 4, 5); + } + if (Global_Variable_Query(49) > 1 && !Actor_Clue_Query(0, 125)) { + DM_Add_To_List_Never_Repeat_Once_Selected(1450, 6, 4, 5); + } + if (Actor_Clue_Query(0, 76)) { + DM_Add_To_List_Never_Repeat_Once_Selected(1460, 6, 4, 5); + } + if (Actor_Clue_Query(0, 147) && !Actor_Clue_Query(0, 125) && Game_Flag_Query(698)) { + DM_Add_To_List_Never_Repeat_Once_Selected(1470, 6, 4, 5); + } + Dialogue_Menu_Add_DONE_To_List(1480); + Dialogue_Menu_Appear(320, 240); + int answer = Dialogue_Menu_Query_Input(); + Dialogue_Menu_Disappear(); + switch (answer) { + case 1400: + Actor_Says(0, 5730, 13); + Actor_Face_Actor(0, 10, true); + Actor_Says(10, 100, 18); + Actor_Says(0, 5775, 13); + Actor_Says(13, 70, 17); + Actor_Says(10, 110, 16); + Actor_Says(13, 80, 6); + Actor_Says(0, 5780, 13); + Actor_Says(10, 120, 16); + Actor_Says(13, 120, 13); + Actor_Says(0, 5785, 13); + Actor_Says(10, 130, 6); + Actor_Says(0, 5825, 13); + Actor_Modify_Friendliness_To_Other(10, 0, -5); + if (Game_Flag_Query(560)) { + Actor_Says(10, 140, 13); + Actor_Says(10, 150, 14); + Actor_Says(10, 160, 13); + Actor_Says(13, 140, 16); + Actor_Says(0, 5790, 13); + Actor_Says(10, 170, 14); + Game_Flag_Set(600); + Actor_Modify_Friendliness_To_Other(10, 0, 5); + } else { + Actor_Says(10, 180, 14); + Actor_Says(0, 5795, 13); + Actor_Says(13, 150, 17); + Actor_Says(0, 5800, 13); + Actor_Says(10, 190, 15); + Game_Flag_Set(601); + Actor_Modify_Friendliness_To_Other(10, 0, -10); + } + break; + case 1410: + Actor_Says(0, 5735, 13); + Actor_Face_Actor(0, 10, true); + Actor_Says(13, 160, 17); + Actor_Says(10, 200, 14); + break; + case 1420: + Actor_Says(0, 5740, 13); + Actor_Face_Actor(0, 10, true); + Actor_Says(13, 180, 15); + Actor_Says(10, 220, 13); + Actor_Says(13, 190, 17); + Actor_Says(0, 5805, 13); + Actor_Says(10, 230, 14); + Actor_Says(10, 240, 13); + Actor_Says(13, 200, 17); + Actor_Says(10, 260, 13); + Actor_Says(10, 270, 15); + Actor_Says(13, 210, 14); + Actor_Says(0, 5810, 13); + Actor_Says(13, 220, 14); + Actor_Says(13, 230, 17); + Actor_Clue_Acquire(0, 136, 1, 10); + break; + case 1430: + Actor_Says(0, 5745, 13); + Actor_Face_Actor(0, 10, true); + Actor_Says(13, 240, 15); + Actor_Says(0, 5815, 13); + Actor_Says(13, 250, 16); + Actor_Says(10, 290, 15); + Actor_Says(13, 260, 15); + break; + case 1440: + Actor_Says(0, 5750, 13); + Actor_Face_Actor(0, 10, true); + Actor_Says(13, 280, 6); + Actor_Says(10, 300, 14); + Actor_Says(10, 310, 15); + Actor_Modify_Friendliness_To_Other(10, 0, -5); + break; + case 1450: + Actor_Says(0, 5755, 13); + Actor_Face_Actor(0, 10, true); + Actor_Says(13, 290, 17); + Actor_Says(10, 320, 16); + Actor_Says(0, 5820, 13); + Actor_Says(13, 300, 17); + Actor_Says(10, 330, 14); + Actor_Says(0, 5825, 13); + Actor_Says(10, 340, 13); + Actor_Says(13, 310, 13); + Actor_Says(10, 350, 13); + Actor_Says(10, 360, 15); + Actor_Says(0, 5830, 13); + Actor_Says(13, 320, 16); + Actor_Says(13, 330, 15); + Game_Flag_Set(698); + break; + case 1460: + Actor_Says(0, 5760, 13); + Actor_Face_Actor(0, 10, true); + Actor_Says(10, 370, 15); + Actor_Says(13, 340, 14); + Actor_Says(0, 5835, 13); + Actor_Says(10, 380, 15); + Actor_Says(13, 370, 6); + Actor_Says(0, 5840, 13); + Actor_Says(13, 380, 13); + break; + case 1470: + Actor_Says(0, 5765, 13); + Actor_Face_Actor(0, 10, true); + Actor_Says(13, 400, 15); + Actor_Says(0, 5845, 13); + Actor_Says(10, 390, 23); + Actor_Says(13, 410, 14); + Actor_Says(13, 420, 17); + Actor_Says(0, 5835, 13); + Delay(1000); + Item_Pickup_Spin_Effect(948, 239, 454); + Actor_Voice_Over(2740, 99); + Actor_Voice_Over(2750, 99); + Actor_Voice_Over(2760, 99); + Actor_Voice_Over(2770, 99); + Actor_Says(0, 5850, 13); + Actor_Says(10, 400, 15); + Actor_Says(13, 430, 6); + Actor_Says(0, 5855, 13); + Actor_Says(10, 410, 14); + Game_Flag_Set(597); + Actor_Clue_Acquire(0, 125, 1, 10); + break; + case 1480: + Actor_Says(0, 4595, 14); + break; + } +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ug17.cpp b/engines/bladerunner/script/scene/ug17.cpp new file mode 100644 index 0000000000..b8eca81b3c --- /dev/null +++ b/engines/bladerunner/script/scene/ug17.cpp @@ -0,0 +1,117 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptUG17::InitializeScene() { + if (Game_Flag_Query(447)) { + Setup_Scene_Information(1013.0f, 67.96f, -1892.0f, 525); + Game_Flag_Reset(447); + } else { + Setup_Scene_Information(1000.0f, 67.96f, -1539.0f, 0); + } + Scene_Exit_Add_2D_Exit(0, 610, 0, 639, 479, 1); + Scene_Exit_Add_2D_Exit(1, 551, 347, 594, 386, 0); + Ambient_Sounds_Add_Looping_Sound(589, 100, 1, 1); + Ambient_Sounds_Add_Looping_Sound(384, 50, 1, 1); + Ambient_Sounds_Add_Sound(72, 5, 80, 10, 11, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(73, 5, 80, 10, 11, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(74, 5, 80, 10, 11, -100, 100, -101, -101, 0, 0); + Overlay_Play("UG17OVER", 0, 1, 0, 0); +} + +void SceneScriptUG17::SceneLoaded() { + Obstacle_Object("BOX FOR BIG VENT13", true); + Unclickable_Object("BOX FOR BIG VENT13"); +} + +bool SceneScriptUG17::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptUG17::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptUG17::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptUG17::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptUG17::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, 1000.0f, 67.96f, -1539.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(353); + Set_Enter(87, 99); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, 1013.0f, 67.96f, -1892.0f, 0, 1, false, 0)) { + Actor_Face_Heading(0, 89, false); + if (Global_Variable_Query(1) == 5) { + Actor_Says(0, 8522, 14); + } else { + Loop_Actor_Travel_Ladder(0, 10, 1, 0); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(448); + Set_Enter(17, 83); + } + } + return true; + } + return false; +} + +bool SceneScriptUG17::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptUG17::SceneFrameAdvanced(int frame) { +} + +void SceneScriptUG17::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptUG17::PlayerWalkedIn() { + if (Game_Flag_Query(352)) { + Loop_Actor_Walk_To_XYZ(0, 961.0f, 67.96f, -1539.0f, 0, 0, false, 0); + Game_Flag_Reset(352); + } + //return false; +} + +void SceneScriptUG17::PlayerWalkedOut() { +} + +void SceneScriptUG17::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ug18.cpp b/engines/bladerunner/script/scene/ug18.cpp new file mode 100644 index 0000000000..74c81bd518 --- /dev/null +++ b/engines/bladerunner/script/scene/ug18.cpp @@ -0,0 +1,407 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptUG18::InitializeScene() { + Setup_Scene_Information(-684.71f, 0.0f, 171.59f, 0); + Game_Flag_Reset(434); + Scene_Exit_Add_2D_Exit(0, 0, 158, 100, 340, 3); + Ambient_Sounds_Add_Looping_Sound(105, 71, 0, 1); + Ambient_Sounds_Add_Looping_Sound(95, 45, 0, 1); + Ambient_Sounds_Add_Looping_Sound(332, 76, 0, 1); + Ambient_Sounds_Add_Sound(291, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(292, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(293, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(294, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(402, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(368, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(369, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(397, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(398, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(295, 2, 20, 25, 25, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(303, 5, 50, 47, 57, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(304, 5, 50, 47, 57, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(305, 5, 50, 47, 57, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(1, 5, 50, 47, 57, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(57, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(58, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(306, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(307, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(308, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(196, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(197, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(198, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(199, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); + Scene_Loop_Set_Default(4); + if (Game_Flag_Query(670) && !Game_Flag_Query(671) && Global_Variable_Query(1) == 4) { + Actor_Set_Goal_Number(4, 300); + Actor_Set_Goal_Number(5, 300); + Actor_Set_Goal_Number(8, 300); + } +} + +void SceneScriptUG18::SceneLoaded() { + Obstacle_Object("MACHINE_01", true); + Unobstacle_Object("PLATFM_RAIL 01", true); + Unobstacle_Object("PLATFM_RAIL 02", true); + Unobstacle_Object("OBSTACLE1", true); + Clickable_Object("MACHINE_01"); + Unclickable_Object("MACHINE_01"); + if (Game_Flag_Query(671)) { + Actor_Put_In_Set(4, 99); + Actor_Set_At_Waypoint(4, 41, 0); + if (Actor_Query_Which_Set_In(8) == 89) { + Actor_Put_In_Set(8, 91); + Actor_Set_At_Waypoint(8, 33, 0); + } + } + if (Game_Flag_Query(670) && !Game_Flag_Query(671) && Global_Variable_Query(1) == 4) { + Item_Add_To_World(91, 987, 89, -55.21f, 0.0f, -302.17f, 0, 12, 12, false, true, false, true); + } + +} + +bool SceneScriptUG18::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptUG18::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptUG18::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptUG18::ClickedOnItem(int itemId, bool a2) { + if (itemId == 91) { + if (a2) { + Item_Remove_From_World(91); + } else if (!Loop_Actor_Walk_To_Item(0, 91, 12, 1, false)) { + Item_Pickup_Spin_Effect(987, 368, 243); + Item_Remove_From_World(itemId); + Game_Flag_Set(703); + Actor_Clue_Acquire(0, 32, 1, 4); + } + } + return false; +} + +bool SceneScriptUG18::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, -684.712f, 0.0f, 171.59f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(435); + Set_Enter(85, 97); + } + return true; + } + return false; +} + +bool SceneScriptUG18::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptUG18::SceneFrameAdvanced(int frame) { +} + +void SceneScriptUG18::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { + if (actorId == 4) { + if (newGoal == 303) { + Game_Flag_Set(607); + ADQ_Flush(); + Actor_Modify_Friendliness_To_Other(5, 0, 7); + Actor_Modify_Friendliness_To_Other(8, 0, 10); + Player_Loses_Control(); + Actor_Face_Actor(4, 0, true); + ADQ_Add(4, 1220, 58); + Scene_Exits_Enable(); + Actor_Set_Goal_Number(4, 305); + } else if (newGoal == 304) { + ADQ_Flush(); + Actor_Modify_Friendliness_To_Other(5, 0, 7); + Actor_Modify_Friendliness_To_Other(8, 0, 10); + Player_Loses_Control(); + Actor_Face_Actor(4, 0, true); + ADQ_Add(4, 1220, 58); + Scene_Exits_Enable(); + Actor_Set_Goal_Number(4, 306); + } + } else if (actorId == 8) { + if (newGoal == 302) { + if (Actor_Query_Friendliness_To_Other(5, 0) > 55 && Game_Flag_Query(607)) { + sub_403588(); + } else { + Actor_Set_Goal_Number(8, 307); + Actor_Set_Goal_Number(5, 310); + } + } else if (newGoal == 304) { + Actor_Modify_Friendliness_To_Other(5, 0, -3); + ADQ_Add(8, 380, -1); + Actor_Set_Goal_Number(8, 306); + } else if (newGoal == 305) { + Actor_Change_Animation_Mode(8, 6); + Sound_Play(12, 100, 0, 0, 50); + Actor_Force_Stop_Walking(0); + Actor_Change_Animation_Mode(0, 48); + Player_Loses_Control(); + Actor_Retired_Here(0, 6, 6, 1, 8); + } + } +} + +void SceneScriptUG18::PlayerWalkedIn() { + Loop_Actor_Walk_To_XYZ(0, -488.71f, 0.0f, 123.59f, 0, 0, false, 0); + if (Game_Flag_Query(670) && !Game_Flag_Query(671) && Actor_Query_Is_In_Current_Set(4)) { + Scene_Exits_Disable(); + sub_402734(); + sub_403278(); + Game_Flag_Set(671); + } +} + +void SceneScriptUG18::PlayerWalkedOut() { +} + +void SceneScriptUG18::DialogueQueueFlushed(int a1) { + int v0 = Actor_Query_Goal_Number(4); + if (v0 == 301) { + Actor_Set_Goal_Number(4, 302); + Actor_Change_Animation_Mode(8, 6); + Sound_Play(14, 100, 0, 0, 50); + Actor_Change_Animation_Mode(4, 22); + ADQ_Add(5, 630, 13); + Actor_Set_Goal_Number(5, 301); + } else if (v0 == 305) { + Actor_Change_Animation_Mode(0, 6); + Sound_Play(13, 100, 0, 0, 50); + Actor_Change_Animation_Mode(4, 22); + Delay(900); + Actor_Change_Animation_Mode(0, 6); + Sound_Play(14, 100, 0, 0, 50); + Actor_Change_Animation_Mode(4, 22); + Delay(1100); + Actor_Change_Animation_Mode(0, 6); + Sound_Play(12, 100, 0, 0, 50); + Actor_Change_Animation_Mode(4, 22); + Delay(900); + Actor_Change_Animation_Mode(0, 6); + Sound_Play(14, 100, 0, 0, 50); + Actor_Change_Animation_Mode(4, 61); + Overlay_Play("UG18over", 1, 0, 1, 0); + Actor_Set_Goal_Number(4, 307); + Player_Gains_Control(); + ADQ_Add_Pause(2000); + ADQ_Add(8, 360, -1); + ADQ_Add_Pause(2000); + ADQ_Add(5, 650, 14); + ADQ_Add(8, 370, 14); + ADQ_Add(5, 1320, 14); + Actor_Set_Goal_Number(5, 303); + } else if (v0 == 306) { + Actor_Change_Animation_Mode(4, 6); + Sound_Play(13, 100, 0, 0, 50); + Actor_Force_Stop_Walking(0); + Actor_Change_Animation_Mode(0, 48); + Player_Loses_Control(); + Actor_Retired_Here(0, 6, 6, 1, 4); + Actor_Set_Goal_Number(4, 307); + } + + int v1 = Actor_Query_Goal_Number(5); + if (v1 == 301) { + Actor_Change_Animation_Mode(8, 6); + Sound_Play(14, 100, 0, 0, 50); + Actor_Change_Animation_Mode(4, 22); + ADQ_Add(5, 640, 13); + ADQ_Add(4, 1210, 13); + Actor_Set_Goal_Number(5, 302); + } else if (v1 == 302) { + Actor_Change_Animation_Mode(8, 6); + Sound_Play(14, 100, 0, 0, 50); + Actor_Change_Animation_Mode(4, 61); + ADQ_Add_Pause(2000); + ADQ_Add(5, 650, 14); + ADQ_Add(8, 370, 14); + ADQ_Add(5, 1320, 14); + Actor_Set_Goal_Number(4, 390); + Actor_Retired_Here(4, 72, 32, 1, 8); + Actor_Set_Goal_Number(5, 303); + Scene_Exits_Enable(); + } else if (v1 == 303) { + Actor_Set_Goal_Number(8, 301); + } + if (Actor_Query_Goal_Number(8) == 306) { + Actor_Change_Animation_Mode(8, 48); + Actor_Set_Goal_Number(8, 307); + Actor_Set_Goal_Number(5, 310); + } +} + +void SceneScriptUG18::sub_402734() { + Actor_Face_Actor(0, 4, true); + Actor_Says(0, 5860, 9); + Delay(500); + Actor_Face_Actor(4, 0, true); + Delay(500); + Actor_Says(4, 790, 3); + Actor_Says(0, 5865, 12); + Actor_Says(4, 800, 3); + Loop_Actor_Walk_To_XYZ(0, -357.13f, 0.0f, -44.47f, 0, 0, false, 0); + Actor_Face_Actor(0, 4, true); + Actor_Says(0, 5870, 14); + Actor_Face_Actor(4, 0, true); + Actor_Start_Speech_Sample(4, 810); + Loop_Actor_Walk_To_XYZ(4, -57.21f, 0.0f, -334.17f, 0, 0, false, 0); + Actor_Says(0, 5875, 13); + Actor_Says(4, 830, 3); + Actor_Says(4, 840, 12); + Actor_Says(4, 850, 14); + Actor_Says(4, 860, 13); + Actor_Says(0, 5880, 15); + Actor_Says(0, 5885, 9); + Actor_Says(0, 5890, 13); + Actor_Says(4, 870, 15); + Loop_Actor_Walk_To_XYZ(0, -205.13f, 0.0f, -184.47f, 0, 0, false, 0); + Actor_Face_Actor(0, 4, true); + Actor_Says(0, 5900, 15); + Actor_Says(4, 880, 13); + Actor_Says(0, 5905, 9); + Actor_Says(0, 5910, 12); + Actor_Says(0, 5915, 13); + Actor_Says(4, 890, 16); + Actor_Says(0, 5920, 14); + Loop_Actor_Walk_To_XYZ(4, -57.21f, 0.0f, -334.17f, 0, 0, false, 0); + Actor_Face_Actor(4, 0, true); + Actor_Says(4, 900, 15); + Actor_Says(4, 910, 12); + Actor_Says(4, 920, 16); + Actor_Says(0, 5925, 14); + Actor_Says(4, 940, 14); + Actor_Says(0, 5930, 18); + Actor_Says(4, 950, 14); + Actor_Says(4, 960, 13); + Actor_Says(4, 970, 3); + if (Game_Flag_Query(607)) { + Actor_Modify_Friendliness_To_Other(5, 0, 3); + Actor_Modify_Friendliness_To_Other(8, 0, 5); + Loop_Actor_Walk_To_XYZ(0, -117.13f, 0.0f, -284.47f, 0, 0, false, 0); + Actor_Face_Actor(0, 4, true); + Actor_Says(0, 5960, 9); + Actor_Says(0, 5965, 14); + Actor_Says(4, 980, 15); + Actor_Says(4, 990, 13); + Actor_Says(0, 5970, 14); + Actor_Says(4, 1000, 3); + Actor_Says(0, 5975, 15); + } else { + sub_402DE8(); + } +} + +void SceneScriptUG18::sub_402DE8() { + + if (Player_Query_Agenda()) { + if (Global_Variable_Query(45) > 1 || Player_Query_Agenda() == 2) { + sub_403114(); + } else { + sub_402F8C(); + } + } else { + Actor_Modify_Friendliness_To_Other(5, 0, -1); + Actor_Modify_Friendliness_To_Other(8, 0, -1); + Actor_Says(0, 5935, 14); + Actor_Says(0, 5940, 18); + Actor_Says(4, 1020, 13); + Actor_Says(4, 1030, 14); + } +} + +void SceneScriptUG18::sub_402F8C() { + Loop_Actor_Walk_To_XYZ(0, -117.13f, 0.0f, -284.47f, 0, 0, false, 0); + Actor_Face_Actor(0, 4, true); + Actor_Says(0, 5945, 12); + Actor_Says(4, 1040, 15); + Actor_Says(0, 5980, 15); + Actor_Says(4, 1050, 12); + Actor_Says(4, 1060, 13); + Actor_Says(4, 1070, 14); + Actor_Says(0, 5985, 18); + Actor_Says(4, 1080, 3); + Actor_Says(4, 1090, 14); + Actor_Says(4, 1100, 13); +} + +void SceneScriptUG18::sub_403114() { + Actor_Modify_Friendliness_To_Other(5, 0, 20); + Actor_Modify_Friendliness_To_Other(8, 0, 10); + Loop_Actor_Walk_To_XYZ(0, -117.13f, 0.0f, -284.47f, 0, 0, false, 0); + Actor_Face_Actor(0, 4, true); + Actor_Says(0, 5950, 16); + Actor_Says(0, 5955, 14); + Actor_Says(4, 1110, 13); + Actor_Says(4, 1120, 15); + Actor_Says(0, 5990, 3); + Actor_Says(4, 1130, 15); + Actor_Says(4, 1140, 16); +} + +void SceneScriptUG18::sub_403278() { + ADQ_Flush(); + Actor_Start_Speech_Sample(5, 590); + Delay(500); + Loop_Actor_Walk_To_XYZ(4, 126.79f, 0.0f, -362.17f, 0, 0, false, 0); + Actor_Face_Heading(4, 729, false); + Actor_Set_Goal_Number(4, 301); + ADQ_Add(8, 350, 13); + ADQ_Add_Pause(1500); + ADQ_Add(4, 1150, 58); + ADQ_Add(5, 600, 13); + ADQ_Add_Pause(1000); + ADQ_Add(4, 1160, 60); + ADQ_Add_Pause(500); + ADQ_Add(4, 1170, 59); + ADQ_Add(4, 1180, 58); + ADQ_Add(5, 610, 13); + ADQ_Add(4, 1190, 60); + ADQ_Add(5, 620, 13); + ADQ_Add(4, 1200, 59); +} + +void SceneScriptUG18::sub_403588() { + Actor_Says(5, 660, 13); + Actor_Says(0, 5995, 13); + Actor_Says(5, 670, 13); + Actor_Says(0, 6000, 13); + Actor_Says_With_Pause(5, 680, 2.0f, 13); + Actor_Says(5, 690, 13); + Actor_Says(5, 700, 13); + Actor_Set_Goal_Number(8, 310); + Actor_Set_Goal_Number(5, 310); +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/ug19.cpp b/engines/bladerunner/script/scene/ug19.cpp new file mode 100644 index 0000000000..e7e963d520 --- /dev/null +++ b/engines/bladerunner/script/scene/ug19.cpp @@ -0,0 +1,139 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "bladerunner/script/scene.h" + +namespace BladeRunner { + +void SceneScriptUG19::InitializeScene() { + if (Game_Flag_Query(357)) { + Setup_Scene_Information(67.03f, 105.0f, -74.97f, 256); + } else { + Setup_Scene_Information(181.0f, 11.52f, -18.0f, 777); + } + Scene_Exit_Add_2D_Exit(0, 351, 0, 491, 347, 0); + Scene_Exit_Add_2D_Exit(1, 548, 124, 639, 369, 1); + Ambient_Sounds_Add_Looping_Sound(95, 45, 0, 1); + Ambient_Sounds_Add_Looping_Sound(332, 76, 0, 1); + Ambient_Sounds_Add_Sound(291, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(292, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(293, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(294, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(295, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(401, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(369, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(396, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(397, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); + Ambient_Sounds_Add_Sound(303, 5, 50, 47, 57, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(304, 5, 50, 47, 57, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(305, 5, 50, 47, 57, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(1, 5, 50, 47, 57, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(57, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(58, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(306, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(307, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(308, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(196, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(197, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(198, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); + Ambient_Sounds_Add_Sound(199, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); + +} + +void SceneScriptUG19::SceneLoaded() { + Obstacle_Object("LADDER", true); + Unclickable_Object("LADDER"); + Footstep_Sounds_Set(1, 0); + Footstep_Sounds_Set(0, 3); +} + +bool SceneScriptUG19::MouseClick(int x, int y) { + return false; +} + +bool SceneScriptUG19::ClickedOn3DObject(const char *objectName, bool a2) { + return false; +} + +bool SceneScriptUG19::ClickedOnActor(int actorId) { + return false; +} + +bool SceneScriptUG19::ClickedOnItem(int itemId, bool a2) { + return false; +} + +bool SceneScriptUG19::ClickedOnExit(int exitId) { + if (exitId == 0) { + if (!Loop_Actor_Walk_To_XYZ(0, 67.03f, 7.29f, -74.97f, 0, 1, false, 0)) { + Actor_Face_Heading(0, 256, false); + Footstep_Sound_Override_On(3); + Loop_Actor_Travel_Ladder(0, 8, 1, 0); + Footstep_Sound_Override_Off(); + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(356); + Set_Enter(53, 53); + } + return true; + } + if (exitId == 1) { + if (!Loop_Actor_Walk_To_XYZ(0, 181.0f, 11.52f, -18.0f, 0, 1, false, 0)) { + Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); + Ambient_Sounds_Remove_All_Looping_Sounds(1); + Game_Flag_Set(349); + Set_Enter(86, 98); + } + return true; + } + return false; +} + +bool SceneScriptUG19::ClickedOn2DRegion(int region) { + return false; +} + +void SceneScriptUG19::SceneFrameAdvanced(int frame) { +} + +void SceneScriptUG19::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { +} + +void SceneScriptUG19::PlayerWalkedIn() { + if (Game_Flag_Query(348)) { + Game_Flag_Reset(348); + Loop_Actor_Walk_To_XYZ(0, 129.0f, 11.52f, -18.0f, 0, 0, false, 0); + } else { + Game_Flag_Reset(357); + Footstep_Sound_Override_On(3); + Loop_Actor_Travel_Ladder(0, 8, 0, 0); + Footstep_Sound_Override_Off(); + } +} + +void SceneScriptUG19::PlayerWalkedOut() { +} + +void SceneScriptUG19::DialogueQueueFlushed(int a1) { +} + +} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/script.cpp b/engines/bladerunner/script/script.cpp index bc6679051c..846d33617b 100644 --- a/engines/bladerunner/script/script.cpp +++ b/engines/bladerunner/script/script.cpp @@ -47,137 +47,8 @@ #include "bladerunner/vector.h" #include "bladerunner/waypoints.h" -#include "bladerunner/script/ai_00_mccoy.h" -#include "bladerunner/script/ai_15_runciter.h" -#include "bladerunner/script/ai_23_officer_leroy.h" - namespace BladeRunner { -bool Script::open(const Common::String &name) { - delete _currentScript; - - if (name == "RC01") { _currentScript = new ScriptRC01(_vm); return true; } - if (name == "RC02") { _currentScript = new ScriptRC02(_vm); return true; } - if (name == "RC03") { _currentScript = new ScriptRC03(_vm); return true; } - if (name == "RC04") { _currentScript = new ScriptRC04(_vm); return true; } - if (name == "RC51") { _currentScript = new ScriptRC51(_vm); return true; } - - return false; -} - -Script::~Script() { - delete _currentScript; -} - -void Script::InitializeScene() { - _inScriptCounter++; - _currentScript->InitializeScene(); - _inScriptCounter--; -} - -void Script::SceneLoaded() { - _inScriptCounter++; - _currentScript->SceneLoaded(); - _inScriptCounter--; -} - -bool Script::MouseClick(int x, int y) { - if (_inScriptCounter > 0) - return true; - - _inScriptCounter++; - //MouseX = x; - //MouseY = y; - bool result = _currentScript->MouseClick(x, y); - //SelectedEntity = -1; - _inScriptCounter--; - //MouseX = -1; - //MouseY = -1; - return result; -} - -bool Script::ClickedOn3DObject(const char *objectName, bool a2) { - if (_inScriptCounter > 0) - return true; - - _inScriptCounter++; - bool result = _currentScript->ClickedOn3DObject(objectName, a2); - _inScriptCounter--; - return result; -} - -bool Script::ClickedOnActor(int actorId) { - if (_inScriptCounter > 0) - return true; - - _inScriptCounter++; - bool result = _currentScript->ClickedOnActor(actorId); - _inScriptCounter--; - return result; -} - -bool Script::ClickedOnItem(int itemId, bool a2) { - if (_inScriptCounter > 0) - return true; - - _inScriptCounter++; - bool result = _currentScript->ClickedOnItem(itemId, a2); - _inScriptCounter--; - return result; -} - -bool Script::ClickedOnExit(int exitId) { - if (_inScriptCounter > 0) - return true; - - _inScriptCounter++; - bool result = _currentScript->ClickedOnExit(exitId); - _inScriptCounter--; - return result; -} - -bool Script::ClickedOn2DRegion(int region) { - if (_inScriptCounter > 0) - return true; - - _inScriptCounter++; - bool result = _currentScript->ClickedOn2DRegion(region); - _inScriptCounter--; - return result; -} - -void Script::SceneFrameAdvanced(int frame) { - _inScriptCounter++; - _currentScript->SceneFrameAdvanced(frame); - _inScriptCounter--; -} - -void Script::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { - _inScriptCounter++; - //TODO remove this check - if(_currentScript) - _currentScript->ActorChangedGoal(actorId, newGoal, oldGoal, currentSet); - _inScriptCounter--; -} - -void Script::PlayerWalkedIn() { - _inScriptCounter++; - _currentScript->PlayerWalkedIn(); - _inScriptCounter--; -} - -void Script::PlayerWalkedOut() { - _inScriptCounter++; - _currentScript->PlayerWalkedOut(); - _inScriptCounter--; -} - -void Script::DialogueQueueFlushed(int a1) { - _inScriptCounter++; - _currentScript->DialogueQueueFlushed(a1); - _inScriptCounter--; -} - void ScriptBase::Preload(int animationId) { _vm->_sliceRenderer->preload(animationId); } @@ -1454,132 +1325,4 @@ void ScriptBase::VK_Play_Speech_Line(int actorIndex, int a2, float a3) { warning("VK_Play_Speech_Line(%d, %d, %g)", actorIndex, a2, a3); } -AIScripts::AIScripts(BladeRunnerEngine *vm, int actorsCount) : _vm(vm), _inScriptCounter(0) { - _actorsCount = actorsCount; - _actorUpdating = new bool[actorsCount]; - _AIScripts = new AIScriptBase*[actorsCount]; - for (int i = 0; i < actorsCount; ++i) { - _AIScripts[i] = nullptr; - _actorUpdating[i] = false; - } - - _AIScripts[0] = new AIScript_McCoy(_vm); - _AIScripts[15] = new AIScript_Runciter(_vm); - _AIScripts[23] = new AIScript_Officer_Leroy(_vm); -} - -AIScripts::~AIScripts() { - for (int i = 0; i < _actorsCount; ++i) { - delete _AIScripts[i]; - _AIScripts[i] = nullptr; - } - delete[] _AIScripts; - delete[] _actorUpdating; -} - -void AIScripts::Initialize(int actor) { - assert(actor < _actorsCount); - if (_AIScripts[actor]) - _AIScripts[actor]->Initialize(); -} - -void AIScripts::Update(int actor) { - assert(actor < _actorsCount); - if (this->_actorUpdating[actor] != 1) { - this->_actorUpdating[actor] = true; - ++this->_inScriptCounter; - if (_AIScripts[actor]) - _AIScripts[actor]->Update(); - --this->_inScriptCounter; - this->_actorUpdating[actor] = false; - } -} - -void AIScripts::TimerExpired(int actor, int timer) { - assert(actor < _actorsCount); - _inScriptCounter++; - if (_AIScripts[actor]) { - _AIScripts[actor]->TimerExpired(timer); - } - _inScriptCounter--; -} - -void AIScripts::CompletedMovementTrack(int actor) { - assert(actor < _actorsCount); - if (!_vm->_actors[actor]->inCombat()) { - _inScriptCounter++; - if (_AIScripts[actor]) { - _AIScripts[actor]->CompletedMovementTrack(); - } - _inScriptCounter--; - } -} - -void AIScripts::EnteredScene(int actor, int setId) { - assert(actor < _actorsCount); - _inScriptCounter++; - if (_AIScripts[actor]) { - _AIScripts[actor]->EnteredScene(setId); - } - _inScriptCounter--; -} - -void AIScripts::OtherAgentEnteredThisScene(int actor, int otherActorId) { - assert(actor < _actorsCount); - _inScriptCounter++; - if (_AIScripts[actor]) { - _AIScripts[actor]->OtherAgentEnteredThisScene(otherActorId); - } - _inScriptCounter--; -} - -void AIScripts::OtherAgentExitedThisScene(int actor, int otherActorId) { - assert(actor < _actorsCount); - _inScriptCounter++; - if (_AIScripts[actor]) { - _AIScripts[actor]->OtherAgentExitedThisScene(otherActorId); - } - _inScriptCounter--; -} - -void AIScripts::GoalChanged(int actor, int currentGoalNumber, int newGoalNumber) { - assert(actor < _actorsCount); - _inScriptCounter++; - if (_AIScripts[actor]) { - _AIScripts[actor]->GoalChanged(currentGoalNumber, newGoalNumber); - } - _inScriptCounter--; -} - -bool AIScripts::ReachedMovementTrackWaypoint(int actor, int waypointId) { - assert(actor < _actorsCount); - bool result = false; - if (!_vm->_actors[actor]->inCombat()) { - _inScriptCounter++; - if (_AIScripts[actor]) { - result = _AIScripts[actor]->ReachedMovementTrackWaypoint(waypointId); - } - _inScriptCounter--; - } - return result; -} - -void AIScripts::UpdateAnimation(int actor, int *animation, int *frame) { - assert(actor < _actorsCount); - _inScriptCounter++; - if (_AIScripts[actor]) { - _AIScripts[actor]->UpdateAnimation(animation, frame); - } - _inScriptCounter--; -} - -void AIScripts::ChangeAnimationMode(int actor, int mode) { - assert(actor < _actorsCount); - _inScriptCounter++; - if (_AIScripts[actor]) { - _AIScripts[actor]->ChangeAnimationMode(mode); - } - _inScriptCounter--; -} - } // End of namespace BladeRunner diff --git a/engines/bladerunner/script/script.h b/engines/bladerunner/script/script.h index 8577078c0d..f90fbc92de 100644 --- a/engines/bladerunner/script/script.h +++ b/engines/bladerunner/script/script.h @@ -280,591 +280,6 @@ protected: void VK_Eye_Animates(int a1); }; -class SceneScriptBase : public ScriptBase { -public: - SceneScriptBase(BladeRunnerEngine *vm) : ScriptBase(vm) {} - - virtual void InitializeScene() = 0; - virtual void SceneLoaded() = 0; - virtual bool MouseClick(int x, int y) = 0; - virtual bool ClickedOn3DObject(const char *objectName, bool a2) = 0; - virtual bool ClickedOnActor(int actorId) = 0; - virtual bool ClickedOnItem(int itemId, bool a2) = 0; - virtual bool ClickedOnExit(int exitId) = 0; - virtual bool ClickedOn2DRegion(int region) = 0; - virtual void SceneFrameAdvanced(int frame) = 0; - virtual void ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) = 0; - virtual void PlayerWalkedIn() = 0; - virtual void PlayerWalkedOut() = 0; - virtual void DialogueQueueFlushed(int a1) = 0; -}; - -/* - * Scene Scripts - */ - -class Script { -protected: - BladeRunnerEngine *_vm; - int _inScriptCounter; - SceneScriptBase *_currentScript; - -public: - Script(BladeRunnerEngine *vm) - : _vm(vm), - _inScriptCounter(0), - _currentScript(nullptr) { - } - ~Script(); - - bool open(const Common::String &name); - - void InitializeScene(); - void SceneLoaded(); - bool MouseClick(int x, int y); - bool ClickedOn3DObject(const char *objectName, bool a2); - bool ClickedOnActor(int actorId); - bool ClickedOnItem(int itemId, bool a2); - bool ClickedOnExit(int exitId); - bool ClickedOn2DRegion(int region); - void SceneFrameAdvanced(int frame); - void ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet); - void PlayerWalkedIn(); - void PlayerWalkedOut(); - void DialogueQueueFlushed(int a1); - bool IsInsideScript() { return _inScriptCounter > 0; } -}; - -#define DECLARE_SCRIPT(name) \ -class Script##name : public SceneScriptBase { \ -public: \ - Script##name(BladeRunnerEngine *vm) \ - : SceneScriptBase(vm) \ - {} \ - void InitializeScene(); \ - void SceneLoaded(); \ - bool MouseClick(int x, int y); \ - bool ClickedOn3DObject(const char *objectName, bool a2); \ - bool ClickedOnActor(int actorId); \ - bool ClickedOnItem(int itemId, bool a2); \ - bool ClickedOnExit(int exitId); \ - bool ClickedOn2DRegion(int region); \ - void SceneFrameAdvanced(int frame); \ - void ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet); \ - void PlayerWalkedIn(); \ - void PlayerWalkedOut(); \ - void DialogueQueueFlushed(int a1); \ -private: -#define END_SCRIPT }; - -DECLARE_SCRIPT(AR01) -END_SCRIPT - -DECLARE_SCRIPT(AR02) - void sub_402694(); - void sub_402AE0(); - void sub_402CE4(); -END_SCRIPT - -DECLARE_SCRIPT(BB01) -END_SCRIPT - -DECLARE_SCRIPT(BB02) -END_SCRIPT - -DECLARE_SCRIPT(BB03) -END_SCRIPT - -DECLARE_SCRIPT(BB04) -END_SCRIPT - -DECLARE_SCRIPT(BB05) -END_SCRIPT - -DECLARE_SCRIPT(BB06) -END_SCRIPT - -DECLARE_SCRIPT(BB07) -END_SCRIPT - -DECLARE_SCRIPT(BB08) -END_SCRIPT - -DECLARE_SCRIPT(BB09) -END_SCRIPT - -DECLARE_SCRIPT(BB10) -END_SCRIPT - -DECLARE_SCRIPT(BB11) -END_SCRIPT - -DECLARE_SCRIPT(BB12) -END_SCRIPT - -DECLARE_SCRIPT(BB51) -END_SCRIPT - -DECLARE_SCRIPT(CT01) - void sub_40269C(); -END_SCRIPT - -DECLARE_SCRIPT(CT02) - void sub_401ACC(); -END_SCRIPT - -DECLARE_SCRIPT(CT03) -END_SCRIPT - -DECLARE_SCRIPT(CT04) - void sub_401D4C(); -END_SCRIPT - -DECLARE_SCRIPT(CT05) -END_SCRIPT - -DECLARE_SCRIPT(CT06) -END_SCRIPT - -DECLARE_SCRIPT(CT07) -END_SCRIPT - -DECLARE_SCRIPT(CT08) -END_SCRIPT - -DECLARE_SCRIPT(CT09) -END_SCRIPT - -DECLARE_SCRIPT(CT10) - void sub_401844(); -END_SCRIPT - -DECLARE_SCRIPT(CT11) -END_SCRIPT - -DECLARE_SCRIPT(CT12) -END_SCRIPT - -DECLARE_SCRIPT(CT51) -END_SCRIPT - -DECLARE_SCRIPT(DR01) -END_SCRIPT - -DECLARE_SCRIPT(DR02) -END_SCRIPT - -DECLARE_SCRIPT(DR03) - void sub_401B18(); -END_SCRIPT - -DECLARE_SCRIPT(DR04) - bool sub_401160(); -END_SCRIPT - -DECLARE_SCRIPT(DR05) -END_SCRIPT - -DECLARE_SCRIPT(DR06) -END_SCRIPT - -DECLARE_SCRIPT(HC01) - void sub_402384(); - void sub_40346C(); -END_SCRIPT - -DECLARE_SCRIPT(HC02) -END_SCRIPT - -DECLARE_SCRIPT(HC03) -END_SCRIPT - -DECLARE_SCRIPT(HC04) - void sub_401B90(); -END_SCRIPT - -DECLARE_SCRIPT(HF01) - void sub_4026B4(); - void sub_4032DC(); - void sub_403484(); -END_SCRIPT - -DECLARE_SCRIPT(HF02) -END_SCRIPT - -DECLARE_SCRIPT(HF03) - void sub_401C80(); -END_SCRIPT - -DECLARE_SCRIPT(HF04) -END_SCRIPT - -DECLARE_SCRIPT(HF05) - void sub_402370(); - void sub_402970(); - void sub_402AE4(); - void sub_403738(); - void sub_403A34(int actorId); - void sub_403F0C(); - void sub_40410C(); - void sub_4042E4(); - void sub_404474(); - int sub_404858(); - int sub_4048C0(); -END_SCRIPT - -DECLARE_SCRIPT(HF06) - void sub_401EF4(); - void sub_4023E0(); -END_SCRIPT - -DECLARE_SCRIPT(HF07) - int sub_401864(); -END_SCRIPT - -DECLARE_SCRIPT(KP01) -END_SCRIPT - -DECLARE_SCRIPT(KP02) -END_SCRIPT - -DECLARE_SCRIPT(KP03) - void sub_401E54(); -END_SCRIPT - -DECLARE_SCRIPT(KP04) -END_SCRIPT - -DECLARE_SCRIPT(KP05) -END_SCRIPT - -DECLARE_SCRIPT(KP06) -END_SCRIPT - -DECLARE_SCRIPT(KP07) -END_SCRIPT - -DECLARE_SCRIPT(MA01) -END_SCRIPT - -DECLARE_SCRIPT(MA02) - void sub_401E4C(); - bool sub_401F7C(); - void sub_402044(); -END_SCRIPT - -//MA03 does not exists - -DECLARE_SCRIPT(MA04) - bool sub_402758(); - bool sub_402820(); - bool sub_402888(); - void sub_4028A8(); - void sub_402F2C(); - void sub_4032A0(); - void sub_4034D8(); - void sub_403864(); - void sub_403DA8(); -END_SCRIPT - -DECLARE_SCRIPT(MA05) - bool sub_401990(); -END_SCRIPT - -DECLARE_SCRIPT(MA06) - bool sub_4012C0(); - void sub_4014E4(); -END_SCRIPT - -DECLARE_SCRIPT(MA07) -END_SCRIPT - -DECLARE_SCRIPT(MA08) -END_SCRIPT - -DECLARE_SCRIPT(NR01) -END_SCRIPT - -DECLARE_SCRIPT(NR02) - void sub_402134(); -END_SCRIPT - -DECLARE_SCRIPT(NR03) - void sub_40259C(int frame); - void sub_402994(); -END_SCRIPT - -DECLARE_SCRIPT(NR04) - void sub_401DB0(); - void sub_402860(int frame); - void sub_402960(); -END_SCRIPT - -DECLARE_SCRIPT(NR05) - void sub_401F74(int frame); - void sub_4020B4(); - void sub_4022DC(); - void sub_402A48(int actorId); - void sub_402B9C(); -END_SCRIPT - -DECLARE_SCRIPT(NR06) - void sub_401BAC(); -END_SCRIPT - -DECLARE_SCRIPT(NR07) - void sub_4018D4(); - void sub_401A10(); - void sub_401C60(); - void sub_401EF4(); - void sub_4020F0(); - void sub_402284(); - void sub_402510(); - void sub_402614(); - void sub_402738(); - void sub_4028FC(); -END_SCRIPT - -DECLARE_SCRIPT(NR08) - void sub_4021B4(); -END_SCRIPT - -DECLARE_SCRIPT(NR09) - void sub_40172C(); -END_SCRIPT - -DECLARE_SCRIPT(NR10) -END_SCRIPT - -DECLARE_SCRIPT(NR11) - void sub_4027D0(int actorId, signed int frame); - void sub_4028EC(); -END_SCRIPT - -DECLARE_SCRIPT(PS01) -END_SCRIPT - -DECLARE_SCRIPT(PS02) - void sub_4018BC(); -END_SCRIPT - -DECLARE_SCRIPT(PS03) -END_SCRIPT - -DECLARE_SCRIPT(PS04) - void sub_4017E4(); -END_SCRIPT - -DECLARE_SCRIPT(PS05) - void sub_401B34(); - void sub_401C30(); -END_SCRIPT - -DECLARE_SCRIPT(PS06) -END_SCRIPT - -DECLARE_SCRIPT(PS07) - void sub_401D60(); -END_SCRIPT - -// PS08 does not exits - -DECLARE_SCRIPT(PS09) - void sub_402090(); -END_SCRIPT - -DECLARE_SCRIPT(PS10) - void sub_402238(); -END_SCRIPT - -DECLARE_SCRIPT(PS11) - void sub_402744(); -END_SCRIPT - -DECLARE_SCRIPT(PS12) - void sub_4028C4(); -END_SCRIPT - -DECLARE_SCRIPT(PS13) - void sub_40267C(); -END_SCRIPT - -DECLARE_SCRIPT(PS14) -END_SCRIPT - -DECLARE_SCRIPT(PS15) -END_SCRIPT - -DECLARE_SCRIPT(RC01) - void sub_403850(); - void sub_4037AC(); -END_SCRIPT - -DECLARE_SCRIPT(RC02) - void sub_402A7C(); -END_SCRIPT - -DECLARE_SCRIPT(RC03) - void sub_402834(); -END_SCRIPT - -DECLARE_SCRIPT(RC04) - void sub_401DF4(); -END_SCRIPT - -DECLARE_SCRIPT(RC51) -END_SCRIPT - -DECLARE_SCRIPT(TB02) - void sub_402644(); - void sub_402B50(); -END_SCRIPT - -DECLARE_SCRIPT(TB03) -END_SCRIPT - -DECLARE_SCRIPT(TB05) -END_SCRIPT - -DECLARE_SCRIPT(TB06) -END_SCRIPT - -DECLARE_SCRIPT(TB07) - void sub_401B0C(); -END_SCRIPT - -DECLARE_SCRIPT(UG01) -END_SCRIPT - -DECLARE_SCRIPT(UG02) - bool sub_402354(); -END_SCRIPT - -DECLARE_SCRIPT(UG03) -END_SCRIPT - -DECLARE_SCRIPT(UG04) -END_SCRIPT - -DECLARE_SCRIPT(UG05) - int sub_4021B0(); - void sub_402218(); -END_SCRIPT - -DECLARE_SCRIPT(UG06) -END_SCRIPT - -DECLARE_SCRIPT(UG07) -END_SCRIPT - -DECLARE_SCRIPT(UG08) -END_SCRIPT - -DECLARE_SCRIPT(UG09) -END_SCRIPT - -DECLARE_SCRIPT(UG10) -END_SCRIPT - -// UG11 does not exists - -DECLARE_SCRIPT(UG12) -END_SCRIPT - -DECLARE_SCRIPT(UG13) - void sub_40223C(); - void sub_4023D8(); - void sub_4025E0(); - void sub_402960(); - int sub_402AD0(); - void sub_402AD4(); - void sub_402E24(); -END_SCRIPT - -DECLARE_SCRIPT(UG14) -END_SCRIPT - -DECLARE_SCRIPT(UG15) -END_SCRIPT - -DECLARE_SCRIPT(UG16) - void sub_401D78(); -END_SCRIPT - -DECLARE_SCRIPT(UG17) -END_SCRIPT - -DECLARE_SCRIPT(UG18) - void sub_402734(); - void sub_402DE8(); - void sub_402F8C(); - void sub_403114(); - void sub_403278(); - void sub_403588(); -END_SCRIPT - -DECLARE_SCRIPT(UG19) -END_SCRIPT - -#undef DECLARE_SCRIPT - -/* - * Actor Scripts - */ - -class AIScriptBase : public ScriptBase { -public: - AIScriptBase(BladeRunnerEngine *vm) : ScriptBase(vm) {} - - virtual void Initialize() = 0; - virtual bool Update() = 0; - virtual void TimerExpired(int timer) = 0; - virtual void CompletedMovementTrack() = 0; - virtual void ReceivedClue(int clueId, int fromActorId) = 0; - virtual void ClickedByPlayer() = 0; - virtual void EnteredScene(int setId) = 0; - virtual void OtherAgentEnteredThisScene(int otherActorId) = 0; - virtual void OtherAgentExitedThisScene(int otherActorId) = 0; - virtual void OtherAgentEnteredCombatMode(int otherActorId, int combatMode) = 0; - virtual void ShotAtAndMissed() = 0; - virtual void ShotAtAndHit() = 0; - virtual void Retired(int byActorId) = 0; - virtual int GetFriendlinessModifierIfGetsClue(int otherActorId, int clueId) = 0; - virtual bool GoalChanged(int currentGoalNumber, int newGoalNumber) = 0; - virtual bool UpdateAnimation(int *animation, int *frame) = 0; - virtual bool ChangeAnimationMode(int mode) = 0; - virtual void QueryAnimationState(int *animationState, int *a2, int *a3, int *a4) = 0; - virtual void SetAnimationState(int animationState, int a2, int a3, int a4) = 0; - virtual bool ReachedMovementTrackWaypoint(int waypointId) = 0; - virtual void FledCombat() = 0; -}; - -class AIScripts { -private: - BladeRunnerEngine *_vm; - int _inScriptCounter; - int _actorsCount; - AIScriptBase **_AIScripts; - bool *_actorUpdating; -public: - AIScripts(BladeRunnerEngine *vm, int actorsCount); - ~AIScripts(); - - void Initialize(int actor); - void Update(int actor); - void TimerExpired(int actor, int timer); - void CompletedMovementTrack(int actor); - void EnteredScene(int actor, int setId); - void OtherAgentEnteredThisScene(int actor, int otherActorId); - void OtherAgentExitedThisScene(int actor, int otherActorId); - void GoalChanged(int actor, int currentGoalNumber, int newGoalNumber); - bool ReachedMovementTrackWaypoint(int actor, int waypointId); - void UpdateAnimation(int actor, int *animation, int *frame); - void ChangeAnimationMode(int actor, int mode); - - bool IsInsideScript() { return _inScriptCounter > 0; } -}; - } // End of namespace BladeRunner #endif diff --git a/engines/bladerunner/script/tb02.cpp b/engines/bladerunner/script/tb02.cpp deleted file mode 100644 index 50f3b9728e..0000000000 --- a/engines/bladerunner/script/tb02.cpp +++ /dev/null @@ -1,469 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptTB02::InitializeScene() { - if (Game_Flag_Query(155)) { - Setup_Scene_Information(-152.0f, 0.0f, 1774.0f, 999); - } else if (Game_Flag_Query(95)) { - Setup_Scene_Information(-32.0f, 0.0f, 1578.0f, 639); - } else if (Game_Flag_Query(608)) { - Setup_Scene_Information(-32.0f, 0.0f, 1578.0f, 639); - } else { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Outtake_Play(27, 0, -1); - Setup_Scene_Information(-304.0f, -81.46f, 1434.0f, 250); - } - if (Global_Variable_Query(1) > 3) { - Scene_Exit_Add_2D_Exit(0, 0, 455, 639, 479, 2); - } - Ambient_Sounds_Add_Looping_Sound(211, 20, 0, 1); - Ambient_Sounds_Add_Sound(212, 2, 15, 16, 20, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(213, 2, 15, 16, 20, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(214, 2, 20, 16, 20, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(215, 2, 15, 16, 20, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(216, 2, 15, 16, 20, 0, 0, -101, -101, 0, 0); - if (Global_Variable_Query(1) <= 3) { - Ambient_Sounds_Add_Looping_Sound(45, 35, 0, 1); - Ambient_Sounds_Add_Sound(181, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(183, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(184, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(185, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(186, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(188, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(189, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(190, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(192, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(193, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(194, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - } - if (Game_Flag_Query(307) && Global_Variable_Query(1) < 4) { - Scene_Exit_Add_2D_Exit(2, 67, 0, 233, 362, 3); - } - if (Game_Flag_Query(155)) { - Scene_Loop_Start_Special(0, 0, 0); - Scene_Loop_Set_Default(1); - } else { - Scene_Loop_Set_Default(1); - } - Actor_Put_In_Set(17, 17); - Actor_Set_At_XYZ(17, -38.53f, 2.93f, 1475.97f, 673); - if (Global_Variable_Query(1) == 4) { - if (Actor_Query_Goal_Number(17) < 300) { - Actor_Set_Goal_Number(17, 300); - } - Scene_Exit_Add_2D_Exit(1, 430, 235, 487, 396, 0); - } -} - -void ScriptTB02::SceneLoaded() { - Obstacle_Object("SPHERE02", true); - Unobstacle_Object("BOX36", true); -} - -bool ScriptTB02::MouseClick(int x, int y) { - return Region_Check(600, 300, 639, 479); -} - -bool ScriptTB02::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptTB02::ClickedOnActor(int actorId) { - if (actorId == 17) { - if (!Loop_Actor_Walk_To_XYZ(0, -76.35f, 0.15f, 1564.2f, 0, 1, false, 0)) { - Actor_Face_Actor(0, 17, true); - int v1 = Global_Variable_Query(1); - if (v1 == 2) { - if (Game_Flag_Query(450) && !Game_Flag_Query(451)) { - Actor_Says(0, 5150, 18); - Actor_Says(17, 60, 12); - Actor_Says(17, 70, 13); - Actor_Says(0, 5155, 13); - Actor_Modify_Friendliness_To_Other(17, 0, -1); - return true; - } - if (!Game_Flag_Query(450) && !Game_Flag_Query(451)) { - Game_Flag_Set(450); - Actor_Says(0, 5160, 18); - Actor_Says(17, 80, 14); - Scene_Exit_Add_2D_Exit(1, 430, 235, 487, 396, 0); - return true; - } - if (Game_Flag_Query(451)) { - sub_402644(); - } else { - Actor_Face_Actor(17, 0, true); - Actor_Says(0, 5150, 18); - Actor_Says(17, 60, 13); - Actor_Says(17, 70, 12); - Actor_Says(0, 5155, 13); - Actor_Modify_Friendliness_To_Other(17, 0, -1); - Actor_Face_Heading(17, 788, false); - } - return true; - } - if (v1 == 3) { - Actor_Says(0, 5235, 18); - Actor_Says(17, 280, 13); - Actor_Says(17, 290, 12); - Actor_Says(0, 5240, 18); - Actor_Says(17, 300, 12); - return false; - } - if (v1 == 4) { - if (Actor_Query_Goal_Number(17) == 300) { - Actor_Set_Goal_Number(17, 301); - } - } - } - } - return false; -} - -bool ScriptTB02::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptTB02::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -152.0f, 0.0f, 1774.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(154); - Game_Flag_Reset(450); - Set_Enter(17, 83); - Async_Actor_Walk_To_XYZ(0, -152.0f, 0.0f, 1890.0f, 0, false); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -32.0f, 0.0f, 1578.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - if (Global_Variable_Query(1) < 4) { - Game_Flag_Set(451); - Game_Flag_Set(96); - Set_Enter(72, 84); - } else { - Set_Enter(18, 108); - } - } - return true; - } - if (exitId == 2) { - if (!Loop_Actor_Walk_To_XYZ(0, -192.0f, 0.0f, 1430.0f, 0, 1, false, 0)) { - Actor_Face_Heading(0, 800, false); - Loop_Actor_Travel_Stairs(0, 9, 0, 0); - if (Actor_Query_Goal_Number(17) == 300) { - Actor_Set_Goal_Number(17, 301); - } else { - Game_Flag_Reset(176); - Game_Flag_Reset(182); - Game_Flag_Reset(179); - Game_Flag_Reset(178); - Game_Flag_Reset(258); - Game_Flag_Reset(257); - Game_Flag_Reset(261); - Game_Flag_Reset(450); - switch (Spinner_Interface_Choose_Dest(-1, 0)) { - case 9: - Game_Flag_Set(257); - Game_Flag_Reset(307); - Game_Flag_Set(256); - Set_Enter(37, 34); - break; - case 8: - Game_Flag_Set(181); - Game_Flag_Reset(307); - Game_Flag_Set(255); - Set_Enter(54, 54); - break; - case 7: - Game_Flag_Set(258); - Game_Flag_Reset(307); - Game_Flag_Set(254); - Set_Enter(20, 2); - break; - case 6: - Game_Flag_Set(177); - Game_Flag_Reset(307); - Game_Flag_Set(253); - Set_Enter(7, 25); - break; - case 4: - Game_Flag_Set(180); - Game_Flag_Reset(307); - Game_Flag_Set(252); - Set_Enter(0, 0); - break; - case 3: - Game_Flag_Set(176); - Game_Flag_Reset(307); - Game_Flag_Set(248); - Set_Enter(4, 13); - break; - case 2: - Game_Flag_Set(182); - Game_Flag_Reset(307); - Game_Flag_Set(249); - Set_Enter(69, 78); - break; - case 1: - Game_Flag_Set(179); - Game_Flag_Reset(307); - Game_Flag_Set(250); - Set_Enter(49, 48); - break; - case 0: - Game_Flag_Set(178); - Game_Flag_Reset(307); - Game_Flag_Set(251); - Set_Enter(61, 65); - break; - default: - Game_Flag_Set(261); - break; - } - } - } - return true; - } - return false; -} - -bool ScriptTB02::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptTB02::SceneFrameAdvanced(int frame) { -} - -void ScriptTB02::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptTB02::PlayerWalkedIn() { - if (Game_Flag_Query(625) && ((Game_Flag_Reset(625) , Global_Variable_Query(1) == 2) || Global_Variable_Query(1) == 3)) { - Set_Enter(18, 108); - //return true; - return; - } - if (Game_Flag_Query(155)) { - Async_Actor_Walk_To_XYZ(0, -152.0f, 0.0f, 1702.0f, 0, false); - Game_Flag_Reset(155); - } else if (Game_Flag_Query(95)) { - Game_Flag_Reset(95); - } else if (Game_Flag_Query(608)) { - Game_Flag_Reset(608); - if (Actor_Query_Goal_Number(17) == 300) { - Actor_Set_Goal_Number(17, 302); - } - Music_Play(1, 50, 0, 2, -1, 0, 0); - } else { - Loop_Actor_Travel_Stairs(0, 9, 1, 0); - Loop_Actor_Walk_To_XYZ(0, -140.0f, 0.79f, 1470.0f, 0, 0, false, 0); - } - int v0 = Global_Variable_Query(1); - if (v0 > 4) { - //return false; - return; - } - if (v0 == 2) { - if (!Game_Flag_Query(453)) { - Player_Loses_Control(); - Actor_Says(0, 5125, 18); - Actor_Says(17, 0, 50); - Actor_Says(0, 5130, 13); - Actor_Says(17, 10, 15); - Item_Pickup_Spin_Effect(975, 351, 315); - Actor_Says(17, 20, 23); - Actor_Says(0, 5140, 17); - Actor_Says(17, 30, 14); - Actor_Says(17, 40, 13); - Loop_Actor_Walk_To_XYZ(0, -140.0f, 0.0f, 1586.0f, 12, 0, false, 0); - Loop_Actor_Walk_To_XYZ(0, -112.0f, 0.0f, 1586.0f, 12, 0, false, 0); - Actor_Face_Actor(0, 17, true); - Actor_Face_Actor(17, 0, true); - Actor_Says(0, 5145, 13); - Actor_Says(17, 50, 15); - Actor_Face_Heading(17, 788, false); - Actor_Clue_Acquire(0, 45, 1, -1); - Game_Flag_Set(453); - Game_Flag_Set(450); - Player_Gains_Control(); - Loop_Actor_Walk_To_XYZ(0, -138.17f, 0.15f, 1578.32f, 0, 1, false, 0); - } - if (Game_Flag_Query(450)) { - Scene_Exit_Add_2D_Exit(1, 430, 235, 487, 396, 0); - } - if (Game_Flag_Query(451) && !Game_Flag_Query(450)) { - Actor_Says(17, 90, 18); - Game_Flag_Set(450); - Scene_Exit_Add_2D_Exit(1, 430, 235, 487, 396, 0); - } - if (Game_Flag_Query(451) && !Game_Flag_Query(456)) { - Loop_Actor_Walk_To_Actor(1, 0, 36, 1, false); - Actor_Says(1, 2220, 14); - Actor_Says(0, 5245, 13); - Actor_Says(1, 2230, 12); - Actor_Says(1, 2240, 13); - sub_402B50(); - //return true; - } - //return false; - return; - } - if (v0 == 3 && !Game_Flag_Query(455)) { - Loop_Actor_Walk_To_XYZ(0, -131.28f, 0.79f, 1448.25f, 12, 1, false, 0); - Actor_Says(17, 260, 15); - Actor_Says(0, 5225, 16); - Actor_Says(17, 270, 14); - Game_Flag_Set(455); - Actor_Modify_Friendliness_To_Other(17, 0, -1); - } - //return false; -} - -void ScriptTB02::PlayerWalkedOut() { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); -} - -void ScriptTB02::DialogueQueueFlushed(int a1) { -} - -void ScriptTB02::sub_402644() { - Dialogue_Menu_Clear_List(); - DM_Add_To_List_Never_Repeat_Once_Selected(700, 4, 5, 6); - if (Actor_Clue_Query(0, 44)) { - DM_Add_To_List_Never_Repeat_Once_Selected(710, 5, 5, 4); - } - if (Actor_Clue_Query(0, 50) || Actor_Clue_Query(0, 51)) { - DM_Add_To_List_Never_Repeat_Once_Selected(720, 3, 5, 5); - } - if (Actor_Clue_Query(0, 51)) { - DM_Add_To_List_Never_Repeat_Once_Selected(730, 3, 4, 8); - } - Dialogue_Menu_Add_DONE_To_List(100); - Dialogue_Menu_Appear(320, 240); - int answer = Dialogue_Menu_Query_Input(); - Dialogue_Menu_Disappear(); - switch (answer) { - case 100: - Actor_Says(0, 5145, 13); - Actor_Says(17, 50, 15); - break; - case 730: - Actor_Says(0, 5180, 16); - Actor_Says(17, 240, 12); - Actor_Says(0, 5215, 18); - Actor_Says(17, 250, 13); - Actor_Says(0, 5220, 16); - break; - case 720: - Actor_Says(0, 5175, 12); - Actor_Says(17, 210, 14); - Actor_Says(0, 5200, 13); - Actor_Says(17, 220, 13); - Actor_Says(0, 5205, 15); - Actor_Says(17, 230, 12); - Actor_Says(0, 5210, 12); - break; - case 710: - Actor_Says(0, 5170, 12); - Actor_Says(17, 180, 12); - Actor_Says(17, 190, 14); - if (Game_Flag_Query(102)) { - Actor_Says(0, 5195, 13); - Actor_Says(17, 200, 13); - } - break; - case 700: - Actor_Says(0, 5165, 11); - Actor_Says(17, 100, 13); - Actor_Says(17, 110, 12); - Actor_Says(0, 5185, 15); - Actor_Says(17, 120, 12); - Actor_Says(17, 130, 14); - Actor_Says(0, 5190, 16); - Actor_Says(17, 140, 13); - Actor_Says(17, 150, 14); - Actor_Says(17, 170, 12); - Actor_Clue_Acquire(0, 50, 1, 17); - break; - } -} - -void ScriptTB02::sub_402B50() { - Dialogue_Menu_Clear_List(); - DM_Add_To_List_Never_Repeat_Once_Selected(740, 4, 5, 6); - DM_Add_To_List_Never_Repeat_Once_Selected(750, 3, 5, 5); - Dialogue_Menu_Add_DONE_To_List(100); - Dialogue_Menu_Appear(320, 240); - int answer = Dialogue_Menu_Query_Input(); - Dialogue_Menu_Disappear(); - switch (answer) { - case 740: - Actor_Says(0, 5250, 15); - if (Game_Flag_Query(48)) { - Actor_Says(1, 2250, 12); - Actor_Says(1, 2260, 13); - Actor_Says(0, 5265, 12); - Actor_Says(1, 2270, 16); - Actor_Says(1, 2280, 13); - Actor_Says(0, 5270, 16); - Actor_Says(1, 2290, 14); - Actor_Clue_Acquire(0, 52, 1, 1); - Actor_Modify_Friendliness_To_Other(1, 0, 1); - Game_Flag_Set(456); - } else { - Actor_Says(1, 2300, 12); - Actor_Says(1, 2310, 15); - Actor_Says(0, 5275, 14); - Actor_Says(1, 2320, 12); - Actor_Says(0, 5280, 13); - Actor_Modify_Friendliness_To_Other(1, 0, 1); - Game_Flag_Set(456); - } - break; - case 750: - Actor_Says(0, 5255, 11); - Actor_Says(1, 2330, 13); - Actor_Says(1, 2340, 14); - Game_Flag_Set(456); - break; - case 100: - Actor_Says(1, 2350, 13); - Actor_Modify_Friendliness_To_Other(1, 0, -5); - Game_Flag_Set(456); - break; - } -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/tb03.cpp b/engines/bladerunner/script/tb03.cpp deleted file mode 100644 index 5a2996f6d9..0000000000 --- a/engines/bladerunner/script/tb03.cpp +++ /dev/null @@ -1,155 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptTB03::InitializeScene() { - if (Game_Flag_Query(448)) { - Setup_Scene_Information(-260.0f, 0.15f, 2014.0f, 276); - } else { - Setup_Scene_Information(-152.0f, 0.0f, 1890.0f, 500); - } - Scene_Exit_Add_2D_Exit(0, 25, 227, 81, 300, 0); - Scene_Exit_Add_2D_Exit(1, 298, 0, 639, 305, 0); - Ambient_Sounds_Add_Looping_Sound(211, 16, 0, 1); - Ambient_Sounds_Add_Sound(212, 2, 15, 16, 20, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(213, 2, 15, 16, 20, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(214, 2, 20, 16, 20, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(215, 2, 15, 16, 20, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(216, 2, 15, 16, 20, 0, 0, -101, -101, 0, 0); - if (Global_Variable_Query(1) <= 3) { - Ambient_Sounds_Add_Looping_Sound(45, 25, 0, 1); - Ambient_Sounds_Add_Sound(181, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(182, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(183, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(184, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(185, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(186, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(188, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(189, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(190, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(191, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(192, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(193, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(194, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(195, 5, 70, 12, 12, -100, 100, -101, -101, 0, 0); - } - Actor_Put_In_Set(17, 17); - Actor_Set_At_XYZ(17, -38.53f, 2.93f, 1475.97f, 673); - if (Global_Variable_Query(1) == 4) { - int goal = Actor_Query_Goal_Number(17); - if (goal == 304) { - Actor_Change_Animation_Mode(17, 0); - Actor_Set_Goal_Number(24, 399); - } else if (goal != 302) { - Actor_Set_Goal_Number(17, 300); - } - } - if (Game_Flag_Query(448)) { - if (Game_Flag_Query(549)) { - Scene_Loop_Set_Default(1); - } else { - Scene_Loop_Start_Special(0, 0, 0); - Scene_Loop_Set_Default(1); - Game_Flag_Set(549); - } - Game_Flag_Reset(448); - } else { - Scene_Loop_Start_Special(0, 0, 0); - Scene_Loop_Set_Default(1); - } -} - -void ScriptTB03::SceneLoaded() { - Obstacle_Object("SPHERE02", true); -} - -bool ScriptTB03::MouseClick(int x, int y) { - return false; -} - -bool ScriptTB03::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptTB03::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptTB03::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptTB03::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -260.0f, 0.15f, 2014.0f, 0, 1, false, 0)) { - Actor_Set_Goal_Number(17, 304); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(447); - Set_Enter(88, 101); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -152.0f, 0.0f, 1774.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(155); - Set_Enter(17, 82); - Async_Actor_Walk_To_XYZ(0, -152.0f, 0.0f, 1702.0f, 0, false); - } - return true; - } - return false; -} - -bool ScriptTB03::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptTB03::SceneFrameAdvanced(int frame) { -} - -void ScriptTB03::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptTB03::PlayerWalkedIn() { - if (Actor_Query_Goal_Number(17) == 304) { - Player_Set_Combat_Mode(false); - Actor_Says(24, 260, -1); - Actor_Says(0, 170, 14); - Delay(1000); - Actor_Set_Goal_Number(0, 500); - } -} - -void ScriptTB03::PlayerWalkedOut() { - Music_Stop(2); -} - -void ScriptTB03::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/tb05.cpp b/engines/bladerunner/script/tb05.cpp deleted file mode 100644 index e61fec4a2d..0000000000 --- a/engines/bladerunner/script/tb05.cpp +++ /dev/null @@ -1,197 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptTB05::InitializeScene() { - if (Game_Flag_Query(98)) { - Setup_Scene_Information(23.0f, 151.53f, -205.0f, 450); - Game_Flag_Set(102); - Game_Flag_Reset(98); - } else { - Setup_Scene_Information(14.0f, 151.53f, -77.0f, 6); - } - Scene_Exit_Add_2D_Exit(0, 62, 193, 206, 419, 0); - Scene_Exit_Add_2D_Exit(1, 0, 455, 639, 479, 2); - Ambient_Sounds_Add_Looping_Sound(236, 100, 0, 1); - Ambient_Sounds_Add_Looping_Sound(237, 100, 0, 1); - Ambient_Sounds_Add_Sound(217, 5, 30, 25, 33, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(218, 5, 30, 25, 33, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(219, 5, 30, 25, 33, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(220, 5, 30, 25, 33, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(146, 2, 30, 20, 25, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(147, 2, 30, 20, 25, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(148, 2, 30, 20, 25, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(149, 2, 30, 20, 25, 0, 0, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(151, 2, 30, 20, 25, 0, 0, -101, -101, 0, 0); - Scene_Loop_Set_Default(0); -} - -void ScriptTB05::SceneLoaded() { - Clickable_Object("MONITOR05"); - Unclickable_Object("SMUDGE_GLASS01"); - if (!Actor_Clue_Query(0, 44)) { - Item_Add_To_World(76, 940, 72, 76.160004f, 147.36f, -235.14999f, 0, 6, 6, false, true, false, true); - } - if (!Actor_Clue_Query(0, 54) && !Actor_Clue_Query(0, 55) && (Game_Flag_Query(45) || Game_Flag_Query(46))) { - Item_Add_To_World(119, 972, 72, 129.00999f, 147.12f, -162.98f, 0, 8, 8, false, true, false, true); - } -} - -bool ScriptTB05::MouseClick(int x, int y) { - return false; -} - -bool ScriptTB05::ClickedOn3DObject(const char *objectName, bool a2) { - if (Object_Query_Click("MONITOR05", objectName) && !Loop_Actor_Walk_To_XYZ(0, 122.54f, 147.12f, -197.17f, 0, 1, false, 0)) { - Actor_Face_Heading(0, 38, false); - if (!Actor_Clue_Query(0, 152) && !Game_Flag_Query(99)) { - Actor_Clue_Acquire(0, 51, 1, -1); - Actor_Voice_Over(2170, 99); - Actor_Voice_Over(2180, 99); - Actor_Voice_Over(2190, 99); - Actor_Voice_Over(2200, 99); - Game_Flag_Set(99); - return true; - } - if (Game_Flag_Query(99) && !Game_Flag_Query(100) && !Actor_Clue_Query(0, 152)) { - if (Actor_Clue_Query(0, 65) || Actor_Clue_Query(0, 262)) { - Actor_Clue_Acquire(0, 152, 1, -1); - Actor_Voice_Over(2230, 99); - Item_Pickup_Spin_Effect(941, 352, 333); - Actor_Voice_Over(2240, 99); - Actor_Voice_Over(2250, 99); - Actor_Voice_Over(2260, 99); - Game_Flag_Set(100); - Game_Flag_Set(101); - } else { - Actor_Voice_Over(2270, 99); - Game_Flag_Set(100); - } - return true; - } - if (Game_Flag_Query(100) && !Game_Flag_Query(101)) { - if (Actor_Clue_Query(0, 65) || Actor_Clue_Query(0, 262)) { - Actor_Clue_Acquire(0, 152, 1, -1); - Actor_Voice_Over(2230, 99); - Item_Pickup_Spin_Effect(941, 352, 333); - Actor_Voice_Over(2240, 99); - Actor_Voice_Over(2250, 99); - Actor_Voice_Over(2260, 99); - Game_Flag_Set(101); - } else { - Actor_Voice_Over(2280, 99); - Actor_Voice_Over(2290, 99); - Game_Flag_Set(101); - } - return true; - } - if (Game_Flag_Query(101)) { - Actor_Voice_Over(3700, 99); - return true; - } - return false; - } - return false; -} - -bool ScriptTB05::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptTB05::ClickedOnItem(int itemId, bool a2) { - if (itemId == 76 && !Loop_Actor_Walk_To_XYZ(0, 54.0f, 147.12f, -209.0f, 0, 1, false, 0)) { - Actor_Face_Heading(0, 126, false); - Item_Remove_From_World(76); - Item_Pickup_Spin_Effect(940, 295, 408); - Actor_Voice_Over(2140, 99); - Actor_Voice_Over(2150, 99); - Actor_Voice_Over(2160, 99); - Actor_Clue_Acquire(0, 44, 1, -1); - return true; - } - if (itemId == 119 && !Loop_Actor_Walk_To_XYZ(0, 107.89f, 147.12f, -156.26f, 0, 1, false, 0)) { - Actor_Face_Heading(0, 126, false); - Item_Remove_From_World(119); - Item_Pickup_Spin_Effect(972, 449, 431); - Actor_Voice_Over(4280, 99); - if (Game_Flag_Query(45)) { - Actor_Voice_Over(4290, 99); - Actor_Clue_Acquire(0, 54, 1, -1); - } else { - Actor_Voice_Over(4300, 99); - Actor_Clue_Acquire(0, 55, 1, -1); - } - } - return false; -} - -bool ScriptTB05::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, 23.0f, 151.53f, -205.0f, 12, 1, false, 0)) { - Game_Flag_Set(97); - Set_Enter(73, 85); - Scene_Loop_Start_Special(1, 2, 1); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, 14.0f, 147.12f, 123.0f, 0, 1, false, 0)) { - Game_Flag_Set(95); - Set_Enter(17, 82); - } - return true; - } - return false; -} - -bool ScriptTB05::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptTB05::SceneFrameAdvanced(int frame) { - if (frame == 61) { - Sound_Play(150, Random_Query(52, 52), 0, 0, 50); - } - if (frame == 63) { - Sound_Play(283, Random_Query(55, 55), 0, 0, 50); - } - //return true; -} - -void ScriptTB05::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptTB05::PlayerWalkedIn() { -} - -void ScriptTB05::PlayerWalkedOut() { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); -} - -void ScriptTB05::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/tb06.cpp b/engines/bladerunner/script/tb06.cpp deleted file mode 100644 index d266e52b28..0000000000 --- a/engines/bladerunner/script/tb06.cpp +++ /dev/null @@ -1,192 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptTB06::InitializeScene() { - Setup_Scene_Information(-16.0f, 149.0f, -466.0f, 990); - Scene_Exit_Add_2D_Exit(0, 330, 195, 417, 334, 0); - Ambient_Sounds_Add_Looping_Sound(236, 50, 0, 1); - Ambient_Sounds_Add_Looping_Sound(237, 50, 0, 1); - Ambient_Sounds_Add_Looping_Sound(285, 66, 0, 1); - if (Game_Flag_Query(103)) { - Scene_Loop_Set_Default(0); - //return false; - return; - } else { - Actor_Put_In_Set(21, 73); - Actor_Set_At_XYZ(21, 135.0f, 151.0f, -671.0f, 800); - Actor_Retired_Here(21, 60, 32, 1, -1); - //return true; - return; - } -} - -void ScriptTB06::SceneLoaded() { - Obstacle_Object("DOOR", true); - Unobstacle_Object("GLASS01", true); - Clickable_Object("DOOR"); - Unclickable_Object("SMUDGE_GLASS01"); - if (!Game_Flag_Query(519) && Actor_Query_Goal_Number(37) != 199) { - Item_Add_To_World(84, 942, 73, 36.54f, 149.48f, -565.67f, 0, 6, 6, false, true, false, true); - } - if (!Game_Flag_Query(520)) { - Item_Add_To_World(108, 955, 73, 18.0f, 149.65f, -599.0f, 0, 6, 6, false, true, false, true); - } - if (Actor_Query_Goal_Number(37) != 199) { - Item_Add_To_World(103, 978, 73, -46.82f, 149.6f, -666.88f, 0, 12, 12, false, true, false, true); - Item_Add_To_World(104, 979, 73, -30.27f, 149.6f, -610.7f, 0, 15, 45, false, true, false, true); - Item_Add_To_World(105, 980, 73, 9.87f, 149.6f, -683.5f, 0, 12, 12, false, true, false, true); - } -} - -bool ScriptTB06::MouseClick(int x, int y) { - return false; -} - -bool ScriptTB06::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptTB06::ClickedOnActor(int actorId) { - if (actorId == 21 && !Loop_Actor_Walk_To_Actor(0, 21, 24, 1, false)) { - if (Actor_Clue_Query(0, 49)) { - Actor_Says(0, 8665, 13); - return false; - } - Actor_Voice_Over(2300, 99); - Actor_Voice_Over(2310, 99); - Item_Pickup_Spin_Effect(974, 66, 397); - Actor_Voice_Over(2320, 99); - if (Game_Flag_Query(48)) { - Actor_Voice_Over(2330, 99); - Actor_Voice_Over(2340, 99); - } - Actor_Voice_Over(2350, 99); - Actor_Clue_Acquire(0, 49, 1, -1); - return true; - } - return false; -} - -bool ScriptTB06::ClickedOnItem(int itemId, bool a2) { - if (itemId == 84 && !Loop_Actor_Walk_To_Item(0, 84, 12, 1, false)) { - Actor_Face_Item(0, 84, true); - Actor_Clue_Acquire(0, 65, 1, -1); - Item_Pickup_Spin_Effect(942, 341, 368); - Item_Remove_From_World(84); - Actor_Voice_Over(4160, 99); - Game_Flag_Set(519); - return true; - } - if (itemId == 108 && !Loop_Actor_Walk_To_Item(0, 108, 12, 1, false)) { - Actor_Face_Item(0, 108, true); - Actor_Clue_Acquire(0, 53, 1, -1); - Item_Remove_From_World(108); - Item_Pickup_Spin_Effect(955, 390, 368); - Actor_Says(0, 8775, 3); - Game_Flag_Set(520); - return true; - } - if (itemId == 82 && !Loop_Actor_Walk_To_Item(0, 82, 12, 1, false)) { - Actor_Face_Item(0, 82, true); - Actor_Says(0, 5285, 3); - return true; - } - if ((itemId == 103 || itemId == 104 || itemId == 105) && !Loop_Actor_Walk_To_Item(0, 103, 24, 1, false)) { - Actor_Face_Item(0, 103, true); - Actor_Voice_Over(2380, 99); - Actor_Voice_Over(2390, 99); - Actor_Voice_Over(2400, 99); - return true; - } - return false; -} - -bool ScriptTB06::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -16.0f, 149.0f, -427.0f, 12, 1, false, 0)) { - Game_Flag_Set(98); - Set_Enter(72, 84); - Scene_Loop_Start_Special(1, 2, 1); - } - return true; - } - return false; -} - -bool ScriptTB06::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptTB06::SceneFrameAdvanced(int frame) { - if (frame == 61) { - Sound_Play(150, Random_Query(52, 52), 0, 0, 50); - } - if (frame == 63) { - Sound_Play(283, Random_Query(55, 55), 0, 0, 50); - } - //return true; -} - -void ScriptTB06::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptTB06::PlayerWalkedIn() { - if (!Game_Flag_Query(102) && !Game_Flag_Query(483)) { - Actor_Face_Actor(0, 21, true); - Actor_Says(0, 5290, 3); - Loop_Actor_Walk_To_XYZ(0, -10.0f, 149.0f, -631.0f, 0, 0, false, 0); - AI_Movement_Track_Pause(37); - Actor_Face_Actor(0, 37, true); - Actor_Face_Actor(37, 0, true); - Actor_Says(37, 0, 3); - Actor_Says(0, 5295, 3); - Actor_Face_Actor(37, 21, true); - Actor_Says(37, 10, 3); - AI_Movement_Track_Unpause(37); - Game_Flag_Set(483); - //return true; - return; - } - if (Game_Flag_Query(103)) { - Item_Remove_From_World(84); - Item_Remove_From_World(82); - Item_Remove_From_World(98); - //return true; - return; - } - //return false; - return; -} - -void ScriptTB06::PlayerWalkedOut() { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); -} - -void ScriptTB06::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/tb07.cpp b/engines/bladerunner/script/tb07.cpp deleted file mode 100644 index ca42ebbcd5..0000000000 --- a/engines/bladerunner/script/tb07.cpp +++ /dev/null @@ -1,290 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptTB07::InitializeScene() { - Setup_Scene_Information(68.0f, 12.0f, 288.0f, 0); - Scene_Exit_Add_2D_Exit(0, 383, 445, 639, 479, 2); - Ambient_Sounds_Add_Looping_Sound(109, 20, 0, 1); - Ambient_Sounds_Add_Sound(363, 2, 55, 14, 14, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(364, 2, 55, 14, 14, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(365, 2, 55, 14, 14, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(366, 2, 55, 14, 14, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(212, 1, 15, 20, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(213, 1, 15, 20, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(214, 1, 20, 20, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(215, 1, 15, 20, 25, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(216, 1, 15, 20, 25, -100, 100, -101, -101, 0, 0); - if (Global_Variable_Query(1) == 4 && !Actor_Clue_Query(0, 147)) { - Item_Add_To_World(83, 941, 18, 9.7f, 48.7f, -174.22f, 0, 12, 12, false, true, false, true); - } - if (Game_Flag_Query(661)) { - Scene_Loop_Set_Default(3); - } else { - Scene_Loop_Set_Default(0); - } -} - -void ScriptTB07::SceneLoaded() { - Obstacle_Object("EAGLE01", true); - Clickable_Object("EAGLE01"); -} - -bool ScriptTB07::MouseClick(int x, int y) { - return false; -} - -bool ScriptTB07::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptTB07::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptTB07::ClickedOnItem(int itemId, bool a2) { - if (!Loop_Actor_Walk_To_Item(0, itemId, 36, 1, false)) { - Actor_Face_Item(0, itemId, true); - if (itemId == 83) { - Item_Pickup_Spin_Effect(941, 331, 296); - Actor_Clue_Acquire(0, 147, 0, -1); - } - Item_Remove_From_World(itemId); - } - return false; -} - -bool ScriptTB07::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, 68.0f, 12.0f, 288.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - if (Global_Variable_Query(1) == 4) { - Game_Flag_Set(608); - Set_Enter(17, 82); - } else { - Game_Flag_Reset(176); - Game_Flag_Reset(182); - Game_Flag_Reset(179); - Game_Flag_Reset(178); - Game_Flag_Reset(258); - Game_Flag_Reset(257); - Game_Flag_Reset(261); - Game_Flag_Reset(450); - switch (Spinner_Interface_Choose_Dest(-1, 0)) { - case 9: - Game_Flag_Set(257); - Game_Flag_Reset(307); - Game_Flag_Set(256); - Set_Enter(37, 34); - break; - case 8: - Game_Flag_Set(181); - Game_Flag_Reset(307); - Game_Flag_Set(255); - Set_Enter(54, 54); - break; - case 7: - Game_Flag_Set(258); - Game_Flag_Reset(307); - Game_Flag_Set(254); - Set_Enter(20, 2); - break; - case 6: - Game_Flag_Set(177); - Game_Flag_Reset(307); - Game_Flag_Set(253); - Set_Enter(7, 25); - break; - case 4: - Game_Flag_Set(180); - Game_Flag_Reset(307); - Game_Flag_Set(252); - Set_Enter(0, 0); - break; - case 3: - Game_Flag_Set(176); - Game_Flag_Reset(307); - Game_Flag_Set(248); - Set_Enter(4, 13); - break; - case 2: - Game_Flag_Set(182); - Game_Flag_Reset(307); - Game_Flag_Set(249); - Set_Enter(69, 78); - break; - case 1: - Game_Flag_Set(179); - Game_Flag_Reset(307); - Game_Flag_Set(250); - Set_Enter(49, 48); - break; - case 0: - Game_Flag_Set(178); - Game_Flag_Reset(307); - Game_Flag_Set(251); - Set_Enter(61, 65); - break; - default: - Game_Flag_Set(261); - Loop_Actor_Walk_To_XYZ(0, 44.0f, 12.0f, 176.0f, 0, 0, false, 0); - break; - } - } - } - return true; - } - return false; -} - -bool ScriptTB07::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptTB07::SceneFrameAdvanced(int frame) { - if (frame == 66) { - Ambient_Sounds_Play_Sound(591, 20, 99, 0, 0); - } - //return false; -} - -void ScriptTB07::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptTB07::PlayerWalkedIn() { - int v0 = Global_Variable_Query(1); - Loop_Actor_Walk_To_XYZ(0, 44.0f, 12.0f, 176.0f, 0, 0, false, 0); - if ((v0 == 2 || v0 == 3) && !Game_Flag_Query(612)) { - Player_Set_Combat_Mode(false); - sub_401B0C(); - } -} - -void ScriptTB07::PlayerWalkedOut() { -} - -void ScriptTB07::DialogueQueueFlushed(int a1) { -} - -void ScriptTB07::sub_401B0C() { - Game_Flag_Set(612); - Delay(1500); - Loop_Actor_Walk_To_XYZ(0, 44.98f, 12.0f, 49.79f, 0, 0, false, 0); - Actor_Face_Heading(0, 178, true); - Delay(3000); - Actor_Put_In_Set(57, 18); - Actor_Set_At_XYZ(57, -260.15f, 12.0f, -19.16f, 256); - Actor_Change_Animation_Mode(57, 0); - Outtake_Play(39, 1, -1); - Loop_Actor_Walk_To_XYZ(57, -146.15f, 12.0f, -5.84f, 0, 0, false, 0); - Actor_Face_Actor(57, 0, true); - Actor_Says(57, 480, 14); - Actor_Face_Actor(0, 57, true); - Actor_Says(0, 5315, 9); - Actor_Says(57, 490, 3); - Actor_Face_Heading(0, 178, true); - Actor_Says(0, 5320, 15); - Actor_Says_With_Pause(0, 5325, 1.0f, 19); - Actor_Start_Speech_Sample(57, 500); - Loop_Actor_Walk_To_XYZ(57, -60.15f, 12.0f, 60.84f, 0, 0, false, 0); - Actor_Face_Actor(57, 0, true); - Actor_Face_Actor(0, 57, true); - Actor_Says(0, 5330, 14); - Actor_Says(57, 510, 12); - Actor_Says(0, 5335, 16); - Actor_Says(57, 520, 17); - Actor_Says(0, 5340, 3); - Actor_Start_Speech_Sample(57, 530); - Loop_Actor_Walk_To_XYZ(57, -4.15f, 12.0f, 54.73f, 0, 0, false, 0); - Actor_Says(57, 540, 16); - Actor_Says(0, 5345, 18); - Actor_Says(57, 550, 13); - Actor_Says(57, 570, 18); - Actor_Says_With_Pause(0, 5350, 0.0f, 18); - Actor_Says(57, 580, 16); - Actor_Says(0, 5355, 16); - Actor_Says(57, 590, 17); - Actor_Says(0, 5360, 17); - Actor_Says(0, 5365, 13); - Actor_Says_With_Pause(57, 600, 1.0f, 12); - Actor_Says(0, 5370, 3); - Loop_Actor_Walk_To_XYZ(57, -24.15f, 12.0f, -10.84f, 0, 0, false, 0); - Actor_Says(57, 610, 13); - Actor_Face_Actor(0, 57, true); - Actor_Says(0, 5375, 18); - Actor_Says(0, 5380, 19); - Actor_Face_Actor(57, 0, true); - Actor_Says(57, 620, 18); - Actor_Says_With_Pause(0, 5385, 2.0f, 12); - Actor_Says_With_Pause(0, 5390, 2.0f, 14); - Actor_Says(0, 5395, 15); - Actor_Says_With_Pause(57, 630, 0.0f, 14); - Actor_Says(0, 5400, 18); - Actor_Says(0, 5405, 3); - Actor_Says(57, 640, 12); - Actor_Says(0, 5410, 16); - Actor_Says(57, 650, 15); - Actor_Says_With_Pause(0, 5415, 1.0f, 17); - Actor_Says(0, 5420, 14); - Actor_Says(57, 660, 15); - Actor_Put_In_Set(51, 18); - Actor_Set_At_XYZ(51, 68.0f, 12.0f, 288.0f, 0); - Actor_Change_Animation_Mode(51, 0); - Scene_Loop_Set_Default(3); - Scene_Loop_Start_Special(2, 2, 0); - Actor_Start_Speech_Sample(51, 0); - Loop_Actor_Walk_To_XYZ(51, 44.0f, 12.0f, 176.0f, 0, 0, false, 0); - Actor_Face_Actor(51, 0, true); - Actor_Face_Actor(0, 51, true); - Actor_Face_Actor(57, 51, true); - Actor_Says(51, 10, 12); - Actor_Says(51, 20, 3); - Actor_Says(51, 30, 12); - Actor_Says(0, 5425, 18); - Actor_Set_Goal_Number(57, 200); - Actor_Says(51, 40, 15); - Actor_Start_Speech_Sample(51, 50); - Loop_Actor_Walk_To_XYZ(51, -10.0f, 12.0f, 100.0f, 0, 0, false, 0); - Actor_Face_Actor(51, 0, true); - Actor_Face_Actor(0, 51, true); - Actor_Says(0, 5430, 17); - Actor_Says(0, 5435, 16); - Actor_Says(51, 60, 14); - Actor_Face_Actor(0, 51, true); - Actor_Says(0, 5440, 14); - Actor_Says(51, 70, 13); - Actor_Says(0, 5445, 15); - Actor_Says_With_Pause(51, 80, 1.0f, 12); - Actor_Says(51, 90, 15); - Actor_Says_With_Pause(0, 5450, 1.0f, 15); - Actor_Says(0, 5455, 12); - Actor_Says(51, 100, 14); - Actor_Clue_Acquire(0, 278, 0, 57); - Actor_Clue_Acquire(0, 279, 0, 51); - Loop_Actor_Walk_To_XYZ(51, -260.15f, 12.0f, -19.16f, 0, 0, false, 0); -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ug01.cpp b/engines/bladerunner/script/ug01.cpp deleted file mode 100644 index 1d39e9553e..0000000000 --- a/engines/bladerunner/script/ug01.cpp +++ /dev/null @@ -1,179 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptUG01::InitializeScene() { - if (Game_Flag_Query(317)) { - Setup_Scene_Information(34.47f, -50.13f, -924.11f, 500); - Game_Flag_Reset(317); - } else if (Game_Flag_Query(118)) { - Setup_Scene_Information(-68.0f, -50.13f, -504.0f, 377); - } else { - Setup_Scene_Information(-126.0f, -50.13f, -286.0f, 0); - } - Scene_Exit_Add_2D_Exit(0, 280, 204, 330, 265, 0); - Scene_Exit_Add_2D_Exit(1, 144, 0, 210, 104, 0); - Scene_Exit_Add_2D_Exit(2, 0, 173, 139, 402, 3); - Ambient_Sounds_Add_Looping_Sound(331, 28, 0, 1); - Ambient_Sounds_Add_Looping_Sound(332, 40, 0, 1); - Ambient_Sounds_Add_Looping_Sound(333, 40, 0, 1); - Ambient_Sounds_Add_Sound(291, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(293, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(402, 2, 120, 10, 11, 20, 100, 0, 100, 0, 0); - Ambient_Sounds_Add_Sound(370, 2, 120, 10, 11, 20, 100, 0, 100, 0, 0); - Ambient_Sounds_Add_Sound(397, 2, 120, 10, 11, 20, 100, 0, 100, 0, 0); - Ambient_Sounds_Add_Sound(396, 2, 120, 10, 11, 20, 100, 0, 100, 0, 0); - Ambient_Sounds_Add_Sound(294, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(295, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(234, 2, 190, 12, 16, 0, 100, 0, 100, 0, 0); - Ambient_Sounds_Add_Sound(391, 2, 190, 12, 16, 0, 100, 0, 100, 0, 0); - Ambient_Sounds_Add_Sound(394, 2, 190, 12, 16, 0, 100, 0, 100, 0, 0); - Ambient_Sounds_Add_Sound(224, 2, 190, 12, 16, 0, 100, 0, 100, 0, 0); - Ambient_Sounds_Add_Sound(227, 2, 190, 12, 16, 0, 100, 0, 100, 0, 0); - Ambient_Sounds_Add_Sound(228, 2, 190, 12, 16, 0, 100, 0, 100, 0, 0); - Ambient_Sounds_Add_Sound(229, 2, 190, 12, 16, 0, 100, 0, 100, 0, 0); - Ambient_Sounds_Add_Sound(303, 5, 50, 17, 37, 0, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(304, 5, 50, 17, 37, 0, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(305, 5, 50, 17, 37, 0, 100, -101, -101, 0, 0); - if (Game_Flag_Query(324)) { - Scene_Loop_Set_Default(3); - } else { - Scene_Loop_Set_Default(0); - } -} - -void ScriptUG01::SceneLoaded() { - Unobstacle_Object("BEAM02", true); - Unobstacle_Object("BEAM03", true); - Unobstacle_Object("BEAM04", true); - Clickable_Object("PIPES_FG_LFT"); -} - -bool ScriptUG01::MouseClick(int x, int y) { - return false; -} - -bool ScriptUG01::ClickedOn3DObject(const char *objectName, bool a2) { - if (Object_Query_Click("PIPES_FG_LFT", objectName)) { - if (!Loop_Actor_Walk_To_XYZ(0, -9.0f, -50.13f, -148.0f, 0, 1, false, 0) && !Game_Flag_Query(324)) { - Actor_Says(0, 8525, 13); - Scene_Loop_Set_Default(3); - Scene_Loop_Start_Special(2, 2, 1); - Game_Flag_Set(324); - } else { - Actor_Says(0, 8525, 13); - } - } - return false; -} - -bool ScriptUG01::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptUG01::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptUG01::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -32.0f, -50.13f, -1350.0f, 12, 1, false, 0)) { - Game_Flag_Set(316); - Set_Enter(83, 95); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -70.0f, -50.13f, -500.0f, 0, 1, false, 0)) { - Actor_Face_Heading(0, 768, false); - Loop_Actor_Travel_Ladder(0, 12, 1, 0); - Game_Flag_Set(119); - Game_Flag_Reset(259); - Game_Flag_Set(182); - Set_Enter(70, 80); - } - return true; - } - if (exitId == 2) { - if (!Loop_Actor_Walk_To_XYZ(0, -126.0f, -50.13f, -286.0f, 0, 1, false, 0)) { - Game_Flag_Set(314); - Set_Enter(75, 87); - } - return true; - } - return false; -} - -bool ScriptUG01::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptUG01::SceneFrameAdvanced(int frame) { - if (frame >= 61 && frame <= 120) { - float v1 = (120 - frame) / 29500.0f; - Set_Fog_Density("BoxFog01", v1); - Set_Fog_Density("BoxFog02", v1); - Set_Fog_Density("BoxFog03", v1); - Set_Fog_Density("BoxFog04", v1); - } else if (frame > 120) { - Set_Fog_Density("BoxFog01", 0.0f); - Set_Fog_Density("BoxFog02", 0.0f); - Set_Fog_Density("BoxFog03", 0.0f); - Set_Fog_Density("BoxFog04", 0.0f); - } - //return false; -} - -void ScriptUG01::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptUG01::PlayerWalkedIn() { - if (Game_Flag_Query(315)) { - Loop_Actor_Walk_To_XYZ(0, -55.0f, -50.13f, -288.0f, 12, 0, false, 0); - Game_Flag_Reset(315); - } - if (Game_Flag_Query(118)) { - Actor_Set_At_XYZ(0, -70.0f, 93.87f, -500.0f, 768); - Loop_Actor_Travel_Ladder(0, 12, 0, 0); - Loop_Actor_Walk_To_XYZ(0, -58.0f, -50.13f, -488.0f, 0, 0, false, 0); - Game_Flag_Reset(118); - } - if (Actor_Query_Goal_Number(6) == 310) { - Music_Play(21, 35, 0, 3, -1, 0, 0); - Actor_Set_Goal_Number(6, 311); - } - //return false; -} - -void ScriptUG01::PlayerWalkedOut() { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); -} - -void ScriptUG01::DialogueQueueFlushed(int a1) { -} - - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ug02.cpp b/engines/bladerunner/script/ug02.cpp deleted file mode 100644 index d58806c335..0000000000 --- a/engines/bladerunner/script/ug02.cpp +++ /dev/null @@ -1,256 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptUG02::InitializeScene() { - if (Game_Flag_Query(319)) { - Setup_Scene_Information(-313.0f, 155.73f, -128.0f, 556); - } else { - Setup_Scene_Information(-95.0f, 74.78f, -503.0f, 556); - } - Scene_Exit_Add_2D_Exit(0, 529, 130, 607, 277, 0); - Scene_Exit_Add_2D_Exit(1, 305, 36, 335, 192, 0); - Ambient_Sounds_Add_Looping_Sound(332, 43, 0, 1); - Ambient_Sounds_Add_Looping_Sound(333, 43, 0, 1); - Ambient_Sounds_Add_Sound(303, 5, 50, 17, 37, 100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(304, 5, 50, 17, 37, 100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(123, 2, 50, 17, 37, -50, -20, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(130, 2, 50, 17, 37, -50, -20, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(131, 2, 50, 17, 37, -50, -20, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(132, 2, 50, 17, 37, -50, -20, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(133, 2, 50, 17, 37, -50, -20, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(134, 2, 50, 17, 37, -50, -20, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(135, 2, 50, 17, 37, -50, -20, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(136, 2, 50, 17, 37, -50, -20, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(47, 2, 50, 27, 27, 10, 30, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(48, 2, 50, 27, 27, 10, 30, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(49, 2, 50, 27, 27, 10, 30, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(50, 2, 50, 27, 27, 10, 30, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(51, 2, 50, 27, 27, 10, 30, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(52, 2, 50, 27, 27, 10, 30, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(53, 2, 50, 27, 27, 10, 30, -101, -101, 0, 0); -} - -void ScriptUG02::SceneLoaded() { - Unobstacle_Object("BOX BACKROOM 2", true); - Unobstacle_Object("BACK_ROOM HALFWALL_", true); - Unobstacle_Object("GUN_4", true); - Obstacle_Object("GUN_1", true); - Unobstacle_Object("WALL_LEFT", true); - Unobstacle_Object("BOX BY STAIRS 1", true); - Unobstacle_Object("TANK", true); - Unobstacle_Object("DESK_DRUM", true); - Clickable_Object("GUN_1"); - Clickable_Object("GUN_2"); - Clickable_Object("CRATE_3"); - Footstep_Sounds_Set(0, 0); - Footstep_Sounds_Set(8, 2); - if (!Game_Flag_Query(656) && Game_Flag_Query(44)) { - Item_Add_To_World(88, 963, 75, -300.37f, 120.16f, -81.31f, 0, 8, 8, false, true, false, true); - } -} - -bool ScriptUG02::MouseClick(int x, int y) { - if (Game_Flag_Query(499)) { - return false; - } - if (Region_Check(0, 0, 245, 285) || Region_Check(0, 0, 350, 257)) { - return true; - } - if (Region_Check(81, 224, 639, 479) && !Game_Flag_Query(498)) { - Game_Flag_Set(499); - sub_402354(); - Game_Flag_Reset(499); - return true; - } - return false; -} - -bool ScriptUG02::ClickedOn3DObject(const char *objectName, bool a2) { - if (Object_Query_Click("GUN_1", objectName) || Object_Query_Click("GUN_2", objectName) || Object_Query_Click("CRATE_3", objectName)) { - Actor_Face_Object(0, "GUN_1", true); - if (!Game_Flag_Query(449) && Global_Variable_Query(1) < 4) { - Actor_Voice_Over(2430, 99); - Actor_Voice_Over(2440, 99); - Actor_Voice_Over(2450, 99); - Actor_Voice_Over(2460, 99); - Game_Flag_Set(449); - Actor_Clue_Acquire(0, 66, 1, -1); - return true; - } - if (Global_Variable_Query(1) <= 3) { - Actor_Says(0, 8580, 14); - return false; - } - if (Actor_Clue_Query(0, 66) && !Actor_Clue_Query(0, 121)) { - Actor_Voice_Over(2470, 99); - Actor_Voice_Over(2480, 99); - Actor_Voice_Over(2490, 99); - Actor_Voice_Over(2500, 99); - Actor_Clue_Acquire(0, 121, 1, -1); - } else if (!Actor_Clue_Query(0, 66)) { - Actor_Voice_Over(2510, 99); - Actor_Voice_Over(2520, 99); - Actor_Voice_Over(2530, 99); - } else if (Game_Flag_Query(708)) { - Actor_Says(0, 8580, 14); - } else { - Item_Pickup_Spin_Effect(996, 360, 440); - Actor_Says(0, 8525, 14); - Give_McCoy_Ammo(2, 18); - Game_Flag_Set(708); - } - return true; - } - return false; -} - -bool ScriptUG02::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptUG02::ClickedOnItem(int itemId, bool a2) { - if (itemId == 88) { - Actor_Face_Item(0, 88, true); - Actor_Clue_Acquire(0, 62, 1, -1); - Game_Flag_Set(656); - Item_Remove_From_World(88); - Item_Pickup_Spin_Effect(963, 426, 316); - return true; - } - return false; -} - -bool ScriptUG02::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (Game_Flag_Query(498) || !sub_402354()) { - int v2 = Player_Query_Combat_Mode(); - if (!Loop_Actor_Walk_To_XYZ(0, -202.0f, 120.16f, -74.0f, 0, 1, v2, 0)) { - Actor_Face_Heading(0, 270, false); - Footstep_Sound_Override_On(2); - Loop_Actor_Travel_Stairs(0, 4, 0, 0); - Footstep_Sound_Override_Off(); - int v3 = Player_Query_Combat_Mode(); - Loop_Actor_Walk_To_XYZ(0, -96.57f, 74.870003f, -271.28f, 0, 0, v3, 0); - int v4 = Player_Query_Combat_Mode(); - Loop_Actor_Walk_To_XYZ(0, -95.0f, 74.870003f, -503.0f, 0, 0, v4, 0); - Game_Flag_Set(315); - Set_Enter(74, 86); - } - } - return true; - } - if (exitId == 1) { - if (Game_Flag_Query(498)) { - if (sub_402354()) { - return true; - } - Loop_Actor_Walk_To_XYZ(0, -368.75f, 155.75f, -63.0f, 0, 0, false, 0); - Loop_Actor_Walk_To_XYZ(0, -340.75f, 155.75f, -119.0f, 0, 0, false, 0); - } - Loop_Actor_Walk_To_XYZ(0, -304.75f, 155.75f, -171.0f, 0, 0, false, 0); - Actor_Face_Heading(0, 14, false); - Loop_Actor_Travel_Ladder(0, 9, 1, 0); - Game_Flag_Set(318); - Game_Flag_Reset(259); - Game_Flag_Set(479); - if (!Game_Flag_Query(403)) { - Game_Flag_Set(388); - Game_Flag_Set(403); - Item_Remove_From_World(121); - } - Set_Enter(8, 33); - return true; - } - return false; -} - -bool ScriptUG02::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptUG02::SceneFrameAdvanced(int frame) { - //return true; -} - -void ScriptUG02::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptUG02::PlayerWalkedIn() { - if (Game_Flag_Query(314)) { - Actor_Set_At_XYZ(0, -106.01f, 84.13f, -228.62f, 575); - Loop_Actor_Walk_To_XYZ(0, -148.0f, 84.13f, -67.0f, 0, 0, false, 0); - Actor_Face_Heading(0, 761, false); - Footstep_Sound_Override_On(2); - Loop_Actor_Travel_Stairs(0, 4, 1, 0); - Footstep_Sound_Override_Off(); - Game_Flag_Reset(314); - Game_Flag_Set(498); - } else if (Game_Flag_Query(319)) { - Actor_Set_At_XYZ(0, -304.75f, 265.0f, -171.0f, 0); - Loop_Actor_Travel_Ladder(0, 9, 0, 0); - Game_Flag_Reset(319); - Game_Flag_Reset(498); - } else { - Actor_Set_At_XYZ(0, -269.24f, 120.16f, -9.94f, 477); - Game_Flag_Set(498); - } - Game_Flag_Reset(499); - //return false; -} - -void ScriptUG02::PlayerWalkedOut() { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); -} - -void ScriptUG02::DialogueQueueFlushed(int a1) { -} - -bool ScriptUG02::sub_402354() { - if (!Game_Flag_Query(498)) { - int v0 = Player_Query_Combat_Mode(); - Loop_Actor_Walk_To_XYZ(0, -340.75f, 155.75f, -119.0f, 0, 0, v0, 0); - Loop_Actor_Walk_To_XYZ(0, -368.75f, 155.75f, -63.0f, 0, 0, v0, 0); - Loop_Actor_Walk_To_XYZ(0, -365.0f, 155.65f, -19.0f, 0, 0, v0, 0); - Actor_Face_Heading(0, 318, false); - Footstep_Sound_Override_On(2); - Loop_Actor_Travel_Stairs(0, 4, 0, 0); - Footstep_Sound_Override_Off(); - Game_Flag_Set(498); - return false; - } - if (!Loop_Actor_Walk_To_XYZ(0, -312.75f, 120.16f, 1.01f, 0, 1, false, 0)) { - Actor_Face_Heading(0, 830, false); - Footstep_Sound_Override_On(2); - Loop_Actor_Travel_Stairs(0, 4, 1, 0); - Footstep_Sound_Override_Off(); - Game_Flag_Reset(498); - return false; - } - return true; -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ug03.cpp b/engines/bladerunner/script/ug03.cpp deleted file mode 100644 index 89c142dcb5..0000000000 --- a/engines/bladerunner/script/ug03.cpp +++ /dev/null @@ -1,145 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptUG03::InitializeScene() { - if (Game_Flag_Query(335)) { - Setup_Scene_Information(-51.0f, 0.03f, 255.0f, 780); - Game_Flag_Reset(335); - } else if (Game_Flag_Query(337)) { - Setup_Scene_Information(-139.0f, 0.03f, -13.0f, 540); - Game_Flag_Reset(337); - } else { - Setup_Scene_Information(-121.88f, 0.03f, 213.35f, 540); - } - Scene_Exit_Add_2D_Exit(0, 46, 137, 131, 296, 0); - Scene_Exit_Add_2D_Exit(1, 559, 141, 639, 380, 1); - Ambient_Sounds_Add_Looping_Sound(331, 15, 0, 1); - Ambient_Sounds_Add_Looping_Sound(332, 40, 0, 1); - Ambient_Sounds_Add_Looping_Sound(333, 40, 0, 1); - Ambient_Sounds_Add_Sound(402, 2, 120, 10, 11, 0, 100, 0, 100, 0, 0); - Ambient_Sounds_Add_Sound(370, 2, 120, 10, 11, 0, 100, 0, 100, 0, 0); - Ambient_Sounds_Add_Sound(396, 2, 120, 10, 11, 0, 100, 0, 100, 0, 0); - Ambient_Sounds_Add_Sound(395, 2, 120, 10, 11, 0, 100, 0, 100, 0, 0); - Ambient_Sounds_Add_Sound(234, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(235, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(391, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(392, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(393, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(394, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(224, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(225, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(226, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(227, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(228, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(229, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(303, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(304, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(305, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); -} - -void ScriptUG03::SceneLoaded() { - Obstacle_Object("=WALL_RIGHT_HOLE", true); - Unobstacle_Object("=HOLERUBBLE1", true); - Clickable_Object("CHAIR_HEADZAPPER"); - Clickable_Object("CHAIR_BACK"); - Clickable_Object("CHAIR_SEAT"); - Clickable_Object("CHAIR_STRAPLEGLEFT"); - Clickable_Object("CHAIR_STRAPLEGRIGHT"); -} - -bool ScriptUG03::MouseClick(int x, int y) { - return false; -} - -bool ScriptUG03::ClickedOn3DObject(const char *objectName, bool a2) { - if ((Object_Query_Click("CHAIR_BACK", objectName) || Object_Query_Click("CHAIR_SEAT", objectName) || Object_Query_Click("CHAIR_HEADZAPPER", objectName)) && !Loop_Actor_Walk_To_Scene_Object(0, "CHAIR_BACK", 36, 1, false)) { - Actor_Face_Object(0, "CHAIR_BACK", true); - if (!Actor_Clue_Query(0, 120)) { - Actor_Voice_Over(2550, 99); - Actor_Voice_Over(2560, 99); - Actor_Voice_Over(2570, 99); - Actor_Voice_Over(2580, 99); - Actor_Voice_Over(2590, 99); - Actor_Clue_Acquire(0, 120, 1, -1); - } - } - return false; -} - -bool ScriptUG03::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptUG03::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptUG03::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -139.0f, 0.0f, -13.0f, 0, 1, false, 0)) { - if (Global_Variable_Query(1) < 4) { - Actor_Says(0, 8522, 14); - } else { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(336); - Set_Enter(83, 95); - } - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -51.0f, 0.0f, 255.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(334); - Set_Enter(77, 89); - } - return true; - } - return false; -} - -bool ScriptUG03::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptUG03::SceneFrameAdvanced(int frame) { -} - -void ScriptUG03::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptUG03::PlayerWalkedIn() { -} - -void ScriptUG03::PlayerWalkedOut() { -} - -void ScriptUG03::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ug04.cpp b/engines/bladerunner/script/ug04.cpp deleted file mode 100644 index c65d74fdf5..0000000000 --- a/engines/bladerunner/script/ug04.cpp +++ /dev/null @@ -1,140 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptUG04::InitializeScene() { - if (Game_Flag_Query(339)) { - Setup_Scene_Information(0.0f, -1.74f, -2400.0f, 496); - Game_Flag_Reset(339); - } else if (Game_Flag_Query(341)) { - Setup_Scene_Information(164.0f, 11.87f, -1013.0f, 83); - } else { - Setup_Scene_Information(-172.0f, 16.29f, -735.0f, 380); - Game_Flag_Reset(334); - } - Scene_Exit_Add_2D_Exit(0, 123, 308, 159, 413, 3); - if (Global_Variable_Query(1) > 3) { - Scene_Exit_Add_2D_Exit(1, 256, 333, 290, 373, 0); - } - Scene_Exit_Add_2D_Exit(2, 344, 298, 451, 390, 1); - Ambient_Sounds_Add_Looping_Sound(331, 25, 0, 1); - Ambient_Sounds_Add_Looping_Sound(332, 40, 0, 1); - Ambient_Sounds_Add_Looping_Sound(333, 40, 0, 1); - Ambient_Sounds_Add_Sound(234, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(224, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(225, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(227, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(229, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(368, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(369, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(370, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(235, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(392, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(394, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(303, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(304, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(305, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); - Scene_Loop_Start_Special(0, 0, 0); - Scene_Loop_Set_Default(1); -} - -void ScriptUG04::SceneLoaded() { - Obstacle_Object("NAV", true); - Unobstacle_Object("RUBBLE", true); - Unobstacle_Object("FLOOR DEBRIS WADS", true); - Unobstacle_Object("FLOOR DEBRIS WADS01", true); - Unobstacle_Object("FLOOR DEBRIS WADS02", true); -} - -bool ScriptUG04::MouseClick(int x, int y) { - return false; -} - -bool ScriptUG04::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptUG04::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptUG04::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptUG04::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -172.0f, 16.29f, -735.0f, 0, 1, false, 0)) { - Game_Flag_Set(335); - Set_Enter(76, 88); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, 0.0f, -1.74f, -2400.0f, 0, 1, false, 0)) { - Game_Flag_Set(338); - Set_Enter(78, 90); - } - return true; - } - if (exitId == 2) { - if (!Loop_Actor_Walk_To_XYZ(0, 164.0f, 11.87f, -1013.0f, 0, 1, false, 0)) { - Game_Flag_Set(340); - Set_Enter(79, 91); - } - return true; - } - return false; -} - -bool ScriptUG04::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptUG04::SceneFrameAdvanced(int frame) { - if (frame == 1) { - Ambient_Sounds_Play_Sound(367, 90, -100, 100, 100); - } -} - -void ScriptUG04::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptUG04::PlayerWalkedIn() { - if (Game_Flag_Query(341)) { - Loop_Actor_Walk_To_XYZ(0, 60.0f, -1.74f, -976.0f, 6, 0, false, 0); - Game_Flag_Reset(341); - } -} - -void ScriptUG04::PlayerWalkedOut() { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); -} - -void ScriptUG04::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ug05.cpp b/engines/bladerunner/script/ug05.cpp deleted file mode 100644 index e087cacf92..0000000000 --- a/engines/bladerunner/script/ug05.cpp +++ /dev/null @@ -1,275 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptUG05::InitializeScene() { - if (Game_Flag_Query(360)) { - if (Game_Flag_Query(663) && !Game_Flag_Query(368)) { - Setup_Scene_Information(-356.35f, 132.77f, -1092.36f, 389); - } else { - Setup_Scene_Information(-180.0f, 37.28f, -1124.0f, 296); - } - } else { - Setup_Scene_Information(0.0f, -1.37f, 0.0f, 0); - Game_Flag_Reset(338); - } - Scene_Exit_Add_2D_Exit(0, 215, 240, 254, 331, 3); - if (!Game_Flag_Query(663)) { - Scene_Exit_Add_2D_Exit(1, 303, 422, 639, 479, 2); - } - if (!Game_Flag_Query(663) || Game_Flag_Query(368)) { - Scene_Exit_Add_2D_Exit(2, 352, 256, 393, 344, 0); - } - Ambient_Sounds_Add_Looping_Sound(105, 28, 0, 1); - Ambient_Sounds_Add_Looping_Sound(332, 40, 0, 1); - Ambient_Sounds_Add_Looping_Sound(333, 40, 0, 1); - Ambient_Sounds_Add_Sound(234, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(225, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(226, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(227, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(235, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(391, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(368, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(402, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(395, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(398, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(224, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(228, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(392, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(229, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(303, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(304, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(305, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); - if (Game_Flag_Query(368)) { - Scene_Loop_Set_Default(2); - } else { - Scene_Loop_Set_Default(0); - } -} - -void ScriptUG05::SceneLoaded() { - if (!Game_Flag_Query(368)) { - Unobstacle_Object("DROPPED CAR OBSTACL", true); - } - Obstacle_Object("VANBODY", true); -} - -bool ScriptUG05::MouseClick(int x, int y) { - return false; -} - -bool ScriptUG05::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptUG05::ClickedOnActor(int actorId) { - if (!Loop_Actor_Walk_To_Actor(0, actorId, 30, 1, false)) { - Actor_Face_Actor(0, actorId, true); - int v1 = sub_4021B0(); - if (actorId == 24 && Game_Flag_Query(368) && !Game_Flag_Query(683)) { - Actor_Says(24, 220, -1); - Actor_Says(0, 5540, 14); - Actor_Says(24, 230, -1); - Actor_Says(0, 5545, 17); - Actor_Says(24, 240, -1); - Actor_Says(0, 5550, 3); - Game_Flag_Set(683); - return false; - } - if (actorId == v1) { - sub_402218(); - return true; - } - return false; - } - return false; -} - -bool ScriptUG05::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptUG05::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (Game_Flag_Query(663) && !Game_Flag_Query(368)) { - Loop_Actor_Walk_To_XYZ(0, -356.35f, 132.77f, -1092.36f, 0, 0, false, 0); - Game_Flag_Set(361); - Set_Enter(43, 40); - } else if (!Loop_Actor_Walk_To_XYZ(0, -156.72f, 3.03f, -1118.17f, 0, 1, false, 0)) { - Actor_Face_Heading(0, 760, false); - Loop_Actor_Travel_Stairs(0, 3, 1, 0); - Game_Flag_Set(361); - Set_Enter(43, 40); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, 4.0f, -11.67f, -4.0f, 0, 1, false, 0)) { - Game_Flag_Set(339); - Set_Enter(77, 89); - } - return true; - } - if (exitId == 2) { - if (!Game_Flag_Query(662)) { - if (!Loop_Actor_Walk_To_XYZ(0, 0.0f, -1.37f, -1500.0f, 0, 1, false, 0)) { - if (!Game_Flag_Query(522)) { - Actor_Voice_Over(2600, 99); - Actor_Voice_Over(2610, 99); - Game_Flag_Set(522); - } - return true; - } - } else { - int v1 = sub_4021B0(); - bool v2; - if (v1 == -1) { - v2 = Loop_Actor_Walk_To_XYZ(0, 0.0f, -1.37f, -1500.0f, 0, 1, false, 0) != 0; - } else { - v2 = Loop_Actor_Walk_To_Actor(0, v1, 30, 1, false) != 0; - } - if (!v2) { - sub_402218(); - return true; - } - } - } - return false; -} - -bool ScriptUG05::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptUG05::SceneFrameAdvanced(int frame) { -} - -void ScriptUG05::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptUG05::PlayerWalkedIn() { - if (Game_Flag_Query(663)) { - if (Game_Flag_Query(368)) { - Music_Stop(2); - Actor_Put_In_Set(24, 78); - Actor_Set_At_XYZ(24, 4.22f, -1.37f, -925.0f, 750); - Actor_Set_Goal_Number(24, 599); - Actor_Retired_Here(24, 70, 36, 1, -1); - int v0 = sub_4021B0(); - if (v0 == 3) { - Actor_Put_In_Set(3, 78); - Actor_Set_At_XYZ(3, -100.0f, -10.31f, -906.0f, 866); - Actor_Force_Stop_Walking(3); - } else if (v0 == 6) { - Actor_Put_In_Set(6, 78); - Actor_Set_At_XYZ(6, -100.0f, -10.31f, -906.0f, 866); - Actor_Force_Stop_Walking(6); - } - } else { - if (!Actor_Query_In_Set(23, 78)) { - Actor_Put_In_Set(23, 78); - Actor_Set_At_XYZ(23, 0.0f, -1.37f, -1400.0f, 768); - } - if (!Actor_Query_In_Set(24, 78)) { - ADQ_Flush(); - ADQ_Add(24, 280, 3); - Actor_Put_In_Set(24, 78); - Actor_Set_At_XYZ(24, -16.0f, -1.37f, -960.0f, 768); - } - } - } - if (Game_Flag_Query(360)) { - if (Game_Flag_Query(663) && !Game_Flag_Query(368)) { - Loop_Actor_Walk_To_XYZ(0, -288.35f, 132.77f, -1092.36f, 0, 1, false, 0); - } else { - Loop_Actor_Travel_Stairs(0, 2, 0, 0); - } - } - if (Game_Flag_Query(663)) { - Game_Flag_Query(368); - } - Game_Flag_Reset(360); -} - -void ScriptUG05::PlayerWalkedOut() { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); -} - -void ScriptUG05::DialogueQueueFlushed(int a1) { -} - -int ScriptUG05::sub_4021B0() { - if (Global_Variable_Query(45) == 2 && Actor_Query_Goal_Number(3) != 599) { - return 3; - } - if (Global_Variable_Query(45) == 3 && Actor_Query_Goal_Number(6) != 599) { - return 6; - } - return -1; -} - -void ScriptUG05::sub_402218() { - int v0 = sub_4021B0(); - if (v0 != -1) { - Actor_Face_Actor(0, v0, true); - Actor_Face_Actor(v0, 0, true); - Actor_Says(0, 5535, 13); - if (v0 == 3) { - Actor_Says(3, 1110, 15); - } else { - Actor_Says(6, 670, 17); - } - } - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - if (v0 == 6) { - if (Game_Flag_Query(46)) { - if (Global_Variable_Query(48) > 3) { - Outtake_Play(13, 0, -1); - } else { - Outtake_Play(14, 0, -1); - } - } else { - Outtake_Play(12, 0, -1); - } - } else if (v0 == 3) { - if (Game_Flag_Query(47)) { - if (Global_Variable_Query(48) > 3) { - Outtake_Play(16, 0, -1); - } else { - Outtake_Play(17, 0, -1); - } - } else { - Outtake_Play(15, 0, -1); - } - } else { - Outtake_Play(19, 0, -1); - } - Outtake_Play(18, 0, -1); - Game_Over(); -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ug06.cpp b/engines/bladerunner/script/ug06.cpp deleted file mode 100644 index b3198c79ea..0000000000 --- a/engines/bladerunner/script/ug06.cpp +++ /dev/null @@ -1,161 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptUG06::InitializeScene() { - if (Game_Flag_Query(680)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Outtake_Play(7, 0, -1); - if (Game_Flag_Query(560)) { - Outtake_Play(9, 0, -1); - } else { - Outtake_Play(8, 0, -1); - } - Game_Flag_Reset(680); - } - if (Game_Flag_Query(340)) { - Setup_Scene_Information(23.0f, 0.0f, 321.0f, 0); - } else if (Game_Flag_Query(343)) { - Setup_Scene_Information(66.0f, 153.0f, -301.4f, 512); - } else { - Setup_Scene_Information(-165.0f, 1.0f, 89.0f, 990); - } - Scene_Exit_Add_2D_Exit(0, 0, 0, 30, 479, 3); - Scene_Exit_Add_2D_Exit(1, 294, 68, 544, 236, 0); - Ambient_Sounds_Add_Looping_Sound(288, 18, 0, 1); - Ambient_Sounds_Add_Looping_Sound(332, 40, 0, 1); - Ambient_Sounds_Add_Looping_Sound(333, 40, 0, 1); - Ambient_Sounds_Add_Sound(234, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(235, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(401, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(402, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(369, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(398, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(392, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(394, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(225, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(227, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(228, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(229, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(303, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(304, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(305, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); -} - -void ScriptUG06::SceneLoaded() { - Obstacle_Object("BOX06", true); - Unobstacle_Object("BOX06", true); - Unobstacle_Object("BOX07", true); - Unobstacle_Object("BOX16", true); - Unobstacle_Object("BOX05", true); -} - -bool ScriptUG06::MouseClick(int x, int y) { - return false; -} - -bool ScriptUG06::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptUG06::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptUG06::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptUG06::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, 23.0f, 0.0f, 321.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(341); - Set_Enter(77, 89); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, 66.0f, 0.0f, -90.0f, 0, 1, false, 0)) { - Actor_Face_Heading(0, 0, false); - Loop_Actor_Travel_Stairs(0, 17, 1, 0); - Loop_Actor_Walk_To_XYZ(0, 66.0f, 153.0f, -446.0f, 0, 0, false, 0); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(342); - Set_Enter(54, 54); - } - return true; - } - return false; -} - -bool ScriptUG06::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptUG06::SceneFrameAdvanced(int frame) { -} - -void ScriptUG06::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptUG06::PlayerWalkedIn() { - if (Game_Flag_Query(340)) { - Loop_Actor_Walk_To_XYZ(0, 23.0f, 0.0f, 273.0f, 0, 0, false, 0); - Game_Flag_Reset(340); - } - if (Game_Flag_Query(343)) { - Loop_Actor_Travel_Stairs(0, 17, 0, 0); - Loop_Actor_Walk_To_XYZ(0, 66.0f, 0.0f, -36.91f, 0, 0, false, 0); - Game_Flag_Reset(343); - } - if (Global_Variable_Query(1) == 4 && !Game_Flag_Query(524)) { - Player_Loses_Control(); - Actor_Voice_Over(2620, 99); - Actor_Voice_Over(2630, 99); - Actor_Voice_Over(2640, 99); - Actor_Voice_Over(2650, 99); - Actor_Voice_Over(2660, 99); - Actor_Voice_Over(2670, 99); - Actor_Voice_Over(2680, 99); - Actor_Voice_Over(2690, 99); - Actor_Voice_Over(2700, 99); - Player_Gains_Control(); - Game_Flag_Set(524); - Autosave_Game(2); - } - //return false; -} - -void ScriptUG06::PlayerWalkedOut() { -} - -void ScriptUG06::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ug07.cpp b/engines/bladerunner/script/ug07.cpp deleted file mode 100644 index b27063b8ce..0000000000 --- a/engines/bladerunner/script/ug07.cpp +++ /dev/null @@ -1,193 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptUG07::InitializeScene() { - if (Game_Flag_Query(428)) { - Setup_Scene_Information(-76.0f, -12.21f, -738.0f, 505); - Game_Flag_Reset(428); - } else if (Game_Flag_Query(426)) { - Setup_Scene_Information(110.0f, -12.21f, -276.0f, 605); - } else { - Setup_Scene_Information(-10.0f, -12.21f, -58.0f, 0); - Game_Flag_Reset(424); - } - if (Game_Flag_Query(623)) { - Scene_Exit_Add_2D_Exit(0, 0, 192, 51, 334, 0); - Scene_Exit_Add_2D_Exit(1, 226, 224, 314, 396, 1); - } - Scene_Exit_Add_2D_Exit(2, 60, 440, 460, 479, 2); - Ambient_Sounds_Add_Looping_Sound(105, 90, -45, 1); - Ambient_Sounds_Add_Looping_Sound(332, 40, 0, 1); - Ambient_Sounds_Add_Looping_Sound(333, 40, 0, 1); - Ambient_Sounds_Add_Sound(368, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(402, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(369, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(395, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(398, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(291, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(292, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(293, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(294, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(295, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(303, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(304, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(305, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); -} - -void ScriptUG07::SceneLoaded() { - Obstacle_Object("BOX RIGHT WALL 01", true); - Obstacle_Object("BOX RIGHT WALL 09", true); - Obstacle_Object("SLIDING DOOR", true); - Unobstacle_Object("BOX LEFT WALL 01", true); - Unclickable_Object("BOX RIGHT WALL 09"); - Unclickable_Object("BOX RIGHT WALL 01"); - Unclickable_Object("SLIDING DOOR"); - Unobstacle_Object("BOX FOR WALL LEFT02", true); - Unobstacle_Object("BOX FOR WALL LEFT03", true); - Unobstacle_Object("BOX FOR WALL LEFT05", true); - Unobstacle_Object("BOX FOR WALL LEFT07", true); - Unobstacle_Object("BOX FOR WALL LEFT09", true); - Unobstacle_Object("BOX FOR WALL LEFT10", true); - Unobstacle_Object("BOX FOR WALL LEFT11", true); - Unobstacle_Object("BOX FOR WALL LEFT12", true); - Unobstacle_Object("BOX FOR WALL LEFT13", true); -} - -bool ScriptUG07::MouseClick(int x, int y) { - return false; -} - -bool ScriptUG07::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptUG07::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptUG07::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptUG07::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -94.0f, -12.21f, -710.0f, 0, 1, false, 0) && Actor_Query_Goal_Number(5) != 402) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(427); - Set_Enter(82, 94); - return true; - } - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, 110.0f, -12.21f, -274.0f, 0, 1, false, 0) && Actor_Query_Goal_Number(5) != 402) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(425); - Set_Enter(81, 93); - return true; - } - } - if (exitId == 2) { - if (!Game_Flag_Query(607) && Game_Flag_Query(671) && Global_Variable_Query(1) == 4 && !Game_Flag_Query(598)) { - if (!Loop_Actor_Walk_To_XYZ(0, 49.0f, -12.21f, -130.0f, 0, 1, false, 0)) { - Game_Flag_Set(598); - Actor_Put_In_Set(5, 80); - Actor_Set_At_XYZ(5, 118.02f, -12.21f, -154.0f, 768); - Player_Set_Combat_Mode(true); - Actor_Face_Actor(0, 5, true); - Loop_Actor_Walk_To_XYZ(5, 98.019997f, -12.21f, -154.0f, 0, 0, false, 0); - Actor_Face_Actor(5, 0, true); - Actor_Set_Goal_Number(0, 301); - Actor_Face_Heading(0, 0, true); - Delay(1500); - Actor_Says_With_Pause(5, 550, 1.0f, 3); - if (Actor_Clue_Query(5, 224)) { - Actor_Says(5, 560, 3); - Actor_Set_Goal_Number(0, 302); - Sound_Play(561, 100, 0, 0, 50); - Delay(2000); - } - if (Actor_Clue_Query(5, 223)) { - Actor_Says(5, 570, 3); - Actor_Set_Goal_Number(0, 302); - Sound_Play(561, 100, 0, 0, 50); - Delay(2000); - } - Actor_Set_Goal_Number(0, 303); - Delay(1000); - Actor_Set_Goal_Number(5, 401); - } - } else { - if (!Loop_Actor_Walk_To_XYZ(0, -10.0f, -21.47f, -58.0f, 0, 1, false, 0) && Actor_Query_Goal_Number(5) != 402) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(423); - Set_Enter(83, 95); - return true; - } - } - } - return false; -} - -bool ScriptUG07::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptUG07::SceneFrameAdvanced(int frame) { -} - -void ScriptUG07::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptUG07::PlayerWalkedIn() { - if (Global_Variable_Query(1) == 4 && !Game_Flag_Query(623)) { - Actor_Set_Goal_Number(23, 307); - Actor_Set_Goal_Number(24, 307); - } - if (Game_Flag_Query(426)) { - Loop_Actor_Walk_To_XYZ(0, 62.0f, -12.21f, -274.0f, 0, 0, false, 0); - Game_Flag_Reset(426); - } -} - -void ScriptUG07::PlayerWalkedOut() { - if (Global_Variable_Query(1) == 4 && (Actor_Query_Goal_Number(23) == 307 || Actor_Query_Goal_Number(24) == 307)) { - Non_Player_Actor_Combat_Mode_Off(23); - Non_Player_Actor_Combat_Mode_Off(24); - Actor_Set_Goal_Number(23, 306); - Actor_Set_Goal_Number(24, 306); - } - if (Actor_Query_In_Set(5, 80)) { - Actor_Set_Goal_Number(5, 400); - } -} - -void ScriptUG07::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ug08.cpp b/engines/bladerunner/script/ug08.cpp deleted file mode 100644 index 34c1943cd7..0000000000 --- a/engines/bladerunner/script/ug08.cpp +++ /dev/null @@ -1,145 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptUG08::InitializeScene() { - if (Game_Flag_Query(430)) { - Setup_Scene_Information(-124.0f, 93.18f, 71.0f, 745); - } else { - Setup_Scene_Information(-432.0f, 0.0f, -152.0f, 370); - } - Scene_Exit_Add_2D_Exit(0, 125, 220, 157, 303, 3); - Scene_Exit_Add_2D_Exit(1, 353, 145, 552, 309, 1); - Ambient_Sounds_Add_Looping_Sound(331, 28, 0, 1); - Ambient_Sounds_Add_Looping_Sound(332, 40, 0, 1); - Ambient_Sounds_Add_Looping_Sound(333, 40, 0, 1); - Ambient_Sounds_Add_Sound(368, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(401, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(369, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(398, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(291, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(292, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(293, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(294, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(295, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(303, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(304, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(305, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); - if (!Game_Flag_Query(610)) { - Game_Flag_Set(431); - Game_Flag_Set(610); - } - if (Game_Flag_Query(430)) { - Scene_Loop_Start_Special(0, 0, 0); - Scene_Loop_Set_Default(1); - } else if (Game_Flag_Query(431)) { - Scene_Loop_Set_Default(1); - } else { - Scene_Loop_Set_Default(4); - } -} - -void ScriptUG08::SceneLoaded() { - Obstacle_Object("ELEV LEGS", true); - Unobstacle_Object("ELEV LEGS", true); - Unobstacle_Object("BOX RIGHT WALL ", true); -} - -bool ScriptUG08::MouseClick(int x, int y) { - return false; -} - -bool ScriptUG08::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptUG08::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptUG08::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptUG08::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -432.0f, 0.0f, -152.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(426); - Set_Enter(80, 92); - } - } else if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -312.0f, -2.0f, 152.0f, 0, 1, false, 0)) { - Actor_Face_Heading(0, 240, false); - Footstep_Sound_Override_On(2); - Loop_Actor_Travel_Stairs(0, 11, 1, 0); - Footstep_Sound_Override_Off(); - Loop_Actor_Walk_To_XYZ(0, -118.02f, 93.02f, 52.76f, 0, 0, false, 0); - Player_Loses_Control(); - Actor_Set_Invisible(0, true); - Game_Flag_Set(429); - Game_Flag_Reset(431); - Set_Enter(85, 97); - Scene_Loop_Start_Special(1, 3, 0); - } - } - return false; -} - -bool ScriptUG08::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptUG08::SceneFrameAdvanced(int frame) { - if (frame == 91) { - Ambient_Sounds_Play_Sound(372, 90, 0, 0, 100); - } -} - -void ScriptUG08::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptUG08::PlayerWalkedIn() { - if (Game_Flag_Query(430)) { - Loop_Actor_Walk_To_XYZ(0, -167.0f, 93.18f, 71.0f, 0, 0, false, 0); - Loop_Actor_Walk_To_XYZ(0, -180.0f, 93.18f, 134.0f, 0, 0, false, 0); - Actor_Face_Heading(0, 745, false); - Footstep_Sound_Override_On(2); - Loop_Actor_Travel_Stairs(0, 11, 0, 0); - Footstep_Sound_Override_Off(); - Player_Gains_Control(); - } - Game_Flag_Reset(425); - Game_Flag_Reset(430); -} - -void ScriptUG08::PlayerWalkedOut() { -} - -void ScriptUG08::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ug09.cpp b/engines/bladerunner/script/ug09.cpp deleted file mode 100644 index e76f9870b7..0000000000 --- a/engines/bladerunner/script/ug09.cpp +++ /dev/null @@ -1,153 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptUG09::InitializeScene() { - if (Game_Flag_Query(433)) { - Setup_Scene_Information(-67.0f, 156.94f, -425.0f, 500); - Game_Flag_Reset(433); - } else { - Setup_Scene_Information(-53.0f, 156.94f, 174.0f, 1000); - Game_Flag_Reset(427); - } - Scene_Exit_Add_2D_Exit(0, 204, 159, 392, 360, 0); - Scene_Exit_Add_2D_Exit(1, 0, 455, 639, 479, 2); - Ambient_Sounds_Add_Looping_Sound(105, 71, 0, 1); - Ambient_Sounds_Add_Looping_Sound(95, 45, 0, 1); - Ambient_Sounds_Add_Looping_Sound(332, 76, 0, 1); - Ambient_Sounds_Add_Sound(291, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(292, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(294, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(401, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(402, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(369, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(397, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(398, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(295, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(303, 5, 50, 47, 57, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(304, 5, 50, 47, 57, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(305, 5, 50, 47, 57, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(1, 5, 50, 47, 57, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(57, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(58, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(307, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(308, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(198, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(199, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); -} - -void ScriptUG09::SceneLoaded() { - Obstacle_Object("FACADE_CANOPY", true); - Obstacle_Object("VW PROP SLAB", true); - Obstacle_Object("WALL_LEFT FRONT", true); - Unobstacle_Object("PATH_FRAGMENT 1", true); - Unobstacle_Object("BOXS FOR ARCHWAY 02", true); - Unobstacle_Object("BOXS FOR ARCHWAY 04", true); - Unobstacle_Object("BOXS FOR ARCHWAY 05", true); - Unobstacle_Object("BOX45", true); - Unobstacle_Object("BOX44", true); - Unobstacle_Object("BOX43", true); - Unobstacle_Object("BOX42", true); - Unobstacle_Object("BOX41", true); - Unobstacle_Object("BOX40", true); - Unobstacle_Object("BOX39", true); - Unobstacle_Object("BOX38", true); - Unobstacle_Object("BOX37", true); - Unobstacle_Object("BOX36", true); - Unobstacle_Object("BOX35", true); - Unobstacle_Object("BOX34", true); - Unobstacle_Object("BOX32", true); - Clickable_Object("FACADE_CANOPY"); -} - -bool ScriptUG09::MouseClick(int x, int y) { - return false; -} - -bool ScriptUG09::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptUG09::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptUG09::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptUG09::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -67.0f, 156.94f, -425.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(432); - Set_Enter(4, 24); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -53.0f, 156.94f, 206.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(428); - Set_Enter(80, 92); - } - return true; - } - return false; -} - -bool ScriptUG09::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptUG09::SceneFrameAdvanced(int frame) { - //return false; -} - -void ScriptUG09::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptUG09::PlayerWalkedIn() { - if (Global_Variable_Query(1) == 4 && Game_Flag_Query(623)) { - Game_Flag_Set(630); - } -} - -void ScriptUG09::PlayerWalkedOut() { - if (Global_Variable_Query(1) == 4 && Global_Variable_Query(1) != 5) { - Game_Flag_Reset(630); - } - if (Game_Flag_Query(432)) { - Game_Flag_Set(176); - Game_Flag_Reset(259); - } -} - -void ScriptUG09::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ug10.cpp b/engines/bladerunner/script/ug10.cpp deleted file mode 100644 index 9879b6e204..0000000000 --- a/engines/bladerunner/script/ug10.cpp +++ /dev/null @@ -1,234 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptUG10::InitializeScene() { - if (Game_Flag_Query(336)) { - Setup_Scene_Information(-92.0f, 81.33f, -652.0f, 520); - } else if (Game_Flag_Query(423)) { - Game_Flag_Reset(423); - Setup_Scene_Information(-385.12f, 1.15f, 57.44f, 400); - } else if (Game_Flag_Query(346)) { - Setup_Scene_Information(2.5f, 1.15f, 405.0f, 200); - } else { - Setup_Scene_Information(235.0f, 1.15f, 29.0f, 0); - } - Scene_Exit_Add_2D_Exit(0, 589, 300, 639, 479, 1); - Scene_Exit_Add_2D_Exit(1, 460, 70, 632, 171, 0); - Scene_Exit_Add_2D_Exit(2, 38, 78, 83, 264, 3); - Scene_Exit_Add_2D_Exit(3, 0, 0, 30, 479, 3); - Scene_2D_Region_Add(0, 349, 311, 382, 364); - Ambient_Sounds_Add_Looping_Sound(105, 71, 0, 1); - Ambient_Sounds_Add_Looping_Sound(95, 45, 0, 1); - Ambient_Sounds_Add_Looping_Sound(332, 76, 0, 1); - Ambient_Sounds_Add_Sound(291, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(293, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(295, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(368, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(401, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(402, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(369, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(397, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(398, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(303, 5, 50, 47, 57, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(304, 5, 50, 47, 57, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(1, 5, 150, 47, 57, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(58, 5, 150, 17, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(230, 2, 20, 25, 32, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(233, 2, 20, 25, 32, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(235, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(394, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(224, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(228, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(229, 2, 190, 12, 16, -100, 100, -100, 100, 0, 0); - if (Game_Flag_Query(474)) { - Scene_Loop_Set_Default(4); - } else { - Scene_Loop_Set_Default(1); - } -} - -void ScriptUG10::SceneLoaded() { - Obstacle_Object("SLUICEGATE_LEVER", true); - if (Global_Variable_Query(1) == 4 && !Game_Flag_Query(474) && Game_Flag_Query(172) && !Game_Flag_Query(693)) { - Scene_Loop_Set_Default(1); - Scene_Loop_Start_Special(2, 6, 1); - Game_Flag_Set(693); - //return true; - } - //return false; -} - -bool ScriptUG10::MouseClick(int x, int y) { - return false; -} - -bool ScriptUG10::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptUG10::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptUG10::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptUG10::ClickedOnExit(int exitId) { - float x, y, z; - Actor_Query_XYZ(0, &x, &y, &z); - if (exitId == 0) { - if ((!Game_Flag_Query(474) && x > 125.0f) || Game_Flag_Query(474)) { - if (!Loop_Actor_Walk_To_XYZ(0, 235.0f, 1.15f, 29.0f, 0, 1, false, 0)) { - Game_Flag_Set(317); - Set_Enter(74, 86); - return true; - } - } else if (!Game_Flag_Query(474)) { - Actor_Says(0, 8521, 3); - } - } else if (exitId == 1) { - if ((!Game_Flag_Query(474) && x < 120.0f) || Game_Flag_Query(474)) { - if (!Loop_Actor_Walk_To_XYZ(0, -1.83f, 1.15f, -410.8f, 0, 1, false, 0)) { - Actor_Face_Heading(0, 0, false); - Loop_Actor_Travel_Stairs(0, 9, 1, 0); - Loop_Actor_Walk_To_XYZ(0, -92.0f, 81.83f, -652.0f, 0, 0, false, 0); - Game_Flag_Set(337); - Set_Enter(76, 88); - return true; - } - } else if (!Game_Flag_Query(474)) { - Actor_Says(0, 6165, 3); - } - } else if (exitId == 2) { - if ((!Game_Flag_Query(474) && x < 120.0f) || Game_Flag_Query(474)) { - if (!Loop_Actor_Walk_To_XYZ(0, -385.0f, 1.15f, 57.44f, 0, 1, false, 0)) { - Actor_Face_Heading(0, 1001, false); - Loop_Actor_Travel_Ladder(0, 1, 1, 0); - Game_Flag_Set(424); - Set_Enter(80, 92); - return true; - } - } else if (!Game_Flag_Query(474)) { - Actor_Says(0, 6165, 3); - } - } else if (exitId == 3) { - if ((!Game_Flag_Query(474) && x < 120.0f) || Game_Flag_Query(474)) { - if (!Loop_Actor_Walk_To_XYZ(0, 2.5f, 1.15f, 405.0f, 0, 1, false, 0)) { - Game_Flag_Set(347); - Set_Enter(86, 98); - return true; - } - } else if (!Game_Flag_Query(474)) { - Actor_Says(0, 6165, 3); - } - } - return false; -} - -bool ScriptUG10::ClickedOn2DRegion(int region) { - float x, y, z; - Actor_Query_XYZ(0, &x, &y, &z); - if (region == 0 && !Player_Query_Combat_Mode()) { - if (x >= 120.0f) { - Actor_Says(0, 8525, 3); - } else if (!Loop_Actor_Walk_To_XYZ(0, 4.98f, 0.38f, 83.15f, 0, 1, false, 0)) { - if (Game_Flag_Query(474)) { - Scene_Loop_Set_Default(1); - Scene_Loop_Start_Special(2, 0, 0); - Game_Flag_Reset(474); - Obstacle_Object("BOX01 BRIDGE", true); - Player_Loses_Control(); - } else { - Scene_Loop_Set_Default(4); - Scene_Loop_Start_Special(2, 3, 0); - Game_Flag_Set(474); - Unobstacle_Object("BOX01 BRIDGE", true); - Player_Loses_Control(); - } - } - return true; - } - return false; -} - -void ScriptUG10::SceneFrameAdvanced(int frame) { - if (frame == 121) { - Ambient_Sounds_Play_Sound(558, 90, 0, 0, 99); - } - if (frame == 127) { - Ambient_Sounds_Play_Sound(353, 90, 0, 0, 99); - } - if (frame == 147) { - Ambient_Sounds_Play_Sound(353, 90, 0, 0, 99); - } - if (frame == 1) { - Ambient_Sounds_Play_Sound(558, 90, 0, 0, 99); - } - if (frame == 3) { - Ambient_Sounds_Play_Sound(353, 90, 0, 0, 99); - } - if (frame == 23) { - Ambient_Sounds_Play_Sound(353, 90, 0, 0, 99); - } - if (frame == 58 || frame == 179) { - Player_Gains_Control(); - } - //return false; -} - -void ScriptUG10::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptUG10::PlayerWalkedIn() { - if (Game_Flag_Query(346)) { - Game_Flag_Reset(346); - Loop_Actor_Walk_To_XYZ(0, 2.5f, 1.15f, 377.0f, 0, 0, false, 0); - } else if (Game_Flag_Query(316)) { - Game_Flag_Reset(316); - Loop_Actor_Walk_To_XYZ(0, 207.0f, 1.15f, 29.0f, 0, 0, false, 0); - } else if (Game_Flag_Query(336)) { - Game_Flag_Reset(336); - Loop_Actor_Walk_To_XYZ(0, -1.83f, 81.33f, -518.8f, 0, 0, false, 0); - Actor_Face_Heading(0, 506, false); - Loop_Actor_Travel_Stairs(0, 9, 0, 0); - } - if (Game_Flag_Query(474)) { - Unobstacle_Object("BOX01 BRIDGE", true); - } else { - Obstacle_Object("BOX01 BRIDGE", true); - } -} - -void ScriptUG10::PlayerWalkedOut() { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); -} - -void ScriptUG10::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ug12.cpp b/engines/bladerunner/script/ug12.cpp deleted file mode 100644 index 695d3093ca..0000000000 --- a/engines/bladerunner/script/ug12.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptUG12::InitializeScene() { - if (Game_Flag_Query(411)) { - Setup_Scene_Information(207.0f, -126.21f, -364.0f, 561); - Game_Flag_Reset(411); - } else { - Setup_Scene_Information(375.0f, -126.21f, 180.0f, 730); - Game_Flag_Reset(345); - } - Scene_Exit_Add_2D_Exit(0, 538, 222, 615, 346, 1); - if (Game_Flag_Query(373)) { - Scene_Exit_Add_2D_Exit(1, 334, 176, 426, 266, 0); - } - Ambient_Sounds_Add_Looping_Sound(105, 47, 60, 1); - Ambient_Sounds_Add_Looping_Sound(332, 40, 0, 1); - Ambient_Sounds_Add_Looping_Sound(333, 40, 0, 1); - Ambient_Sounds_Add_Sound(291, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(292, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(368, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(369, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(370, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(293, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(294, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(295, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(303, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(304, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(305, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); - if (Game_Flag_Query(373)) { - Scene_Loop_Set_Default(2); - } else { - Scene_Loop_Set_Default(0); - } -} - -void ScriptUG12::SceneLoaded() { - Unobstacle_Object("GATE1", true); - Obstacle_Object("TRAIN WRECK", true); -} - -bool ScriptUG12::MouseClick(int x, int y) { - return false; -} - -bool ScriptUG12::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptUG12::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptUG12::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptUG12::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, 375.0f, -126.21f, 180.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(344); - Set_Enter(86, 98); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, 207.0f, -126.21f, -364.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(412); - Set_Enter(45, 42); - } - return true; - } - return false; -} - -bool ScriptUG12::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptUG12::SceneFrameAdvanced(int frame) { -} - -void ScriptUG12::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptUG12::PlayerWalkedIn() { -} - -void ScriptUG12::PlayerWalkedOut() { -} - -void ScriptUG12::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ug13.cpp b/engines/bladerunner/script/ug13.cpp deleted file mode 100644 index 6391b8b97f..0000000000 --- a/engines/bladerunner/script/ug13.cpp +++ /dev/null @@ -1,410 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptUG13::InitializeScene() { - if (Game_Flag_Query(435)) { - Setup_Scene_Information(-477.0f, 141.9f, -870.0f, 378); - } else if (Game_Flag_Query(350)) { - Setup_Scene_Information(39.0f, 52.94f, -528.0f, 600); - } else { - Setup_Scene_Information(-22.0f, 54.63f, -883.0f, 578); - Actor_Set_Invisible(0, false); - } - if (!Game_Flag_Query(431)) { - Scene_Exit_Add_2D_Exit(0, 394, 205, 464, 281, 0); - } - Scene_Exit_Add_2D_Exit(1, 560, 90, 639, 368, 1); - Scene_Exit_Add_2D_Exit(2, 108, 85, 175, 210, 3); - Ambient_Sounds_Add_Looping_Sound(331, 15, 0, 1); - Ambient_Sounds_Add_Looping_Sound(332, 40, 0, 1); - Ambient_Sounds_Add_Looping_Sound(333, 40, 0, 1); - Ambient_Sounds_Add_Sound(401, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(402, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(369, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(397, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(398, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - if (Global_Variable_Query(1) == 4 && !Game_Flag_Query(169)) { - Actor_Set_Goal_Number(12, 390); - } - if (Actor_Query_Goal_Number(12) == 599) { - Actor_Change_Animation_Mode(12, 89); - } - if (Game_Flag_Query(429)) { - Scene_Loop_Start_Special(0, 0, 0); - Scene_Loop_Set_Default(1); - } else if (Game_Flag_Query(431)) { - Scene_Loop_Set_Default(4); - } else { - Scene_Loop_Set_Default(1); - } -} - -void ScriptUG13::SceneLoaded() { - Obstacle_Object("BASKET", true); - Obstacle_Object("BOLLARD", true); - Unobstacle_Object("STAIR", true); - Unobstacle_Object("BOX FOR ARCHWAY 02", true); - Unobstacle_Object("STAIR_RAIL", true); - Unobstacle_Object("DISC_LEFT", true); - Clickable_Object("BASKET"); - Clickable_Object("BOLLARD"); - Unclickable_Object("BASKET"); - if (Global_Variable_Query(1) >= 3 && !Actor_Clue_Query(0, 128) && Game_Flag_Query(169) && (Actor_Clue_Query(0, 81) || Actor_Clue_Query(0, 80))) { - Item_Add_To_World(111, 958, 85, -209.01f, 70.76f, -351.79f, 0, 16, 12, false, true, false, true); - } -} - -bool ScriptUG13::MouseClick(int x, int y) { - return false; -} - -bool ScriptUG13::ClickedOn3DObject(const char *objectName, bool a2) { - - if (Object_Query_Click("BOLLARD", objectName) && !Loop_Actor_Walk_To_XYZ(0, 7.0f, 44.0f, -695.0f, 0, 1, false, 0)) { - Actor_Face_Object(0, "BOLLARD", true); - if (Game_Flag_Query(431)) { - Scene_Loop_Set_Default(1); - Scene_Loop_Start_Special(2, 0, 0); - Game_Flag_Reset(431); - Game_Flag_Set(436); - return true; - } else { - Scene_Loop_Set_Default(4); - Scene_Loop_Start_Special(2, 3, 0); - Game_Flag_Set(431); - Scene_Exit_Remove(0); - return true; - } - } - return false; -} - -bool ScriptUG13::ClickedOnActor(int actorId) { - if (actorId == 12 && Global_Variable_Query(1) == 4 && !Loop_Actor_Walk_To_XYZ(0, -248.0f, 44.0f, -390.0f, 12, 1, false, 0)) { - Actor_Face_Actor(0, 12, true); - if (Actor_Query_Goal_Number(12) != 6 && Actor_Query_Goal_Number(12) != 599) { - if (!Game_Flag_Query(554)) { - sub_40223C(); - } else if (!Actor_Clue_Query(0, 122) || !Actor_Clue_Query(0, 123)) { - sub_402AD4(); - } else { - Actor_Set_Goal_Number(12, 391); - if (Actor_Clue_Query(0, 131)) { - sub_402AD4(); - } else { - Actor_Face_Actor(0, 12, true); - Actor_Says(0, 5600, 14); - Actor_Says(12, 100, 53); - Actor_Says(0, 5605, 18); - Actor_Start_Speech_Sample(12, 110); - Actor_Set_Goal_Number(12, 395); - } - } - } else if (Random_Query(0, 1) == 1) { - Actor_Says(0, 8590, 16); - } else { - Actor_Says(0, 8655, 15); - } - } - return false; -} - -bool ScriptUG13::ClickedOnItem(int itemId, bool a2) { - if (itemId == 111 && !Loop_Actor_Walk_To_Item(0, 111, 36, 1, false)) { - Actor_Face_Item(0, 111, true); - Actor_Clue_Acquire(0, 128, 1, -1); - Item_Remove_From_World(111); - Item_Pickup_Spin_Effect(958, 426, 316); - Actor_Voice_Over(3950, 99); - Actor_Voice_Over(3960, 99); - Actor_Voice_Over(3970, 99); - Actor_Voice_Over(3980, 99); - Actor_Voice_Over(3990, 99); - Actor_Voice_Over(4000, 99); - return true; - } - return false; -} - -bool ScriptUG13::ClickedOnExit(int exitId) { - - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -32.0f, 54.63f, -883.0f, 0, 1, false, 0)) { - Player_Loses_Control(); - Game_Flag_Set(430); - Game_Flag_Set(431); - Set_Enter(81, 93); - Scene_Loop_Start_Special(1, 3, 0); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, 39.0f, 52.94f, -528.0f, 0, 1, false, 0)) { - Game_Flag_Set(351); - Set_Enter(87, 99); - } - return true; - } - if (exitId == 2) { - if (!Loop_Actor_Walk_To_XYZ(0, -267.0f, 44.0f, -795.0f, 0, 1, false, 0)) { - Actor_Face_Heading(0, 830, false); - Footstep_Sound_Override_On(3); - Loop_Actor_Travel_Stairs(0, 11, 1, 0); - Footstep_Sound_Override_Off(); - if (!sub_402AD0()) { - Loop_Actor_Walk_To_XYZ(0, -477.0f, 141.9f, -870.0f, 0, 0, false, 0); - Game_Flag_Set(434); - Set_Enter(89, 102); - return true; - } - Actor_Face_Heading(0, 325, false); - Loop_Actor_Travel_Stairs(0, 11, 0, 0); - } else { - return true; - } - } - - return false; -} - -bool ScriptUG13::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptUG13::SceneFrameAdvanced(int frame) { - if (frame == 94) { - Ambient_Sounds_Play_Sound(372, 90, 0, 0, 100); - } - if (Game_Flag_Query(436) && frame > 29 && frame < 91) { - Scene_Exit_Add_2D_Exit(0, 394, 205, 464, 281, 0); - Game_Flag_Reset(436); - //return true; - return; - } - if (Game_Flag_Query(429) && frame < 25) { - Actor_Set_Invisible(0, true); - } else if (Game_Flag_Query(430) && frame >= 94 && frame <= 120) { - Actor_Set_Invisible(0, true); - } else { - Actor_Set_Invisible(0, false); - } - //return false; - return; -} - -void ScriptUG13::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptUG13::PlayerWalkedIn() { - if (Game_Flag_Query(435)) { - Loop_Actor_Walk_To_XYZ(0, -389.0f, 143.0f, -844.0f, 0, 0, false, 0); - Actor_Face_Heading(0, 325, false); - Footstep_Sound_Override_On(3); - Loop_Actor_Travel_Stairs(0, 11, 0, 0); - Footstep_Sound_Override_Off(); - Game_Flag_Reset(435); - } else if (Game_Flag_Query(350)) { - Loop_Actor_Walk_To_XYZ(0, -12.0f, 44.0f, -528.0f, 0, 0, false, 0); - Game_Flag_Reset(350); - } else { - Loop_Actor_Walk_To_XYZ(0, -60.0f, 55.24f, -816.0f, 0, 0, false, 0); - Game_Flag_Reset(429); - Player_Gains_Control(); - } - if (Actor_Query_Goal_Number(12) >= 390 && !Game_Flag_Query(169)) { - if (Game_Flag_Query(553)) { - if (Random_Query(1, 3) == 1) { - Actor_Set_Goal_Number(12, 395); - } - } else { - Game_Flag_Set(553); - Actor_Says(12, 50, 3); - } - } - //return false; -} - -void ScriptUG13::PlayerWalkedOut() { - Actor_Set_Invisible(0, false); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - if (Game_Flag_Query(430)) { - Ambient_Sounds_Remove_Sound(401, false); - Ambient_Sounds_Remove_Sound(402, false); - Ambient_Sounds_Remove_Sound(369, false); - Ambient_Sounds_Remove_Sound(397, false); - Ambient_Sounds_Remove_Sound(398, false); - } else { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - } -} - -void ScriptUG13::DialogueQueueFlushed(int a1) { -} - -void ScriptUG13::sub_40223C() { - Actor_Face_Actor(0, 12, true); - Game_Flag_Set(554); - Actor_Says(0, 5560, 13); - Actor_Says_With_Pause(0, 5565, 3.0f, 18); - Actor_Says(12, 70, 31); - Actor_Says(12, 80, 32); - Actor_Says(0, 5570, 3); - Actor_Says(12, 90, 32); -} - -void ScriptUG13::sub_4023D8() { - Actor_Face_Actor(0, 12, true); - Actor_Clue_Acquire(0, 122, 0, 12); - Actor_Modify_Friendliness_To_Other(12, 0, -5); - Actor_Says(0, 5575, 16); - Actor_Says(12, 120, 31); - Actor_Says(0, 5610, 15); - Actor_Says(12, 140, 32); - Actor_Says(0, 5615, 18); - Actor_Says(12, 160, 33); - Actor_Says(0, 5620, 9); - Actor_Says(12, 170, 30); - Actor_Says(0, 5625, 12); - Actor_Says(12, 180, 32); - Actor_Says(0, 5630, 18); - Actor_Says(12, 190, 32); - Actor_Says(0, 5635, 15); - Actor_Says(12, 200, 31); -} - -void ScriptUG13::sub_4025E0() { - Actor_Clue_Acquire(0, 123, 0, 12); - Actor_Modify_Friendliness_To_Other(12, 0, -10); - Actor_Says(12, 220, 30); - Actor_Says(0, 5640, 19); - Actor_Says(12, 230, 33); - Actor_Says(0, 5645, 16); - Actor_Says(12, 240, 30); - Actor_Says(12, 250, 33); - Actor_Says(0, 5650, 14); - Actor_Says(12, 260, 32); -} - -void ScriptUG13::sub_402960() { - Actor_Says(0, 5670, 9); - Actor_Says(12, 340, 31); - Actor_Says(0, 5690, 19); - Actor_Says(12, 350, 32); - Actor_Says(0, 5695, 14); - Actor_Says(12, 360, 33); - Actor_Voice_Over(2710, 99); - Actor_Voice_Over(2730, 99); - Actor_Clue_Acquire(0, 124, 0, 12); -} - -int ScriptUG13::sub_402AD0() { - return 0; -} - -void ScriptUG13::sub_402AD4() { - Dialogue_Menu_Clear_List(); - DM_Add_To_List_Never_Repeat_Once_Selected(1320, 6, 3, 1); - if (Actor_Clue_Query(0, 122)) { - DM_Add_To_List_Never_Repeat_Once_Selected(1330, 5, 8, 5); - } - DM_Add_To_List_Never_Repeat_Once_Selected(1340, 2, 4, 6); - if (Actor_Clue_Query(0, 131)) { - DM_Add_To_List_Never_Repeat_Once_Selected(1350, 1, 3, 7); - } - Dialogue_Menu_Add_DONE_To_List(1360); - Dialogue_Menu_Appear(320, 240); - int answer = Dialogue_Menu_Query_Input(); - Dialogue_Menu_Disappear(); - switch (answer) { - case 1360: - return; - case 1350: - Actor_Clue_Acquire(12, 131, 0, 0); - Actor_Says_With_Pause(0, 5595, 1.0f, 23); - Item_Pickup_Spin_Effect(945, 193, 325); - Actor_Says(12, 290, 33); - Actor_Says(0, 5660, 13); - Actor_Clue_Lose(0, 131); - sub_402E24(); - break; - case 1340: - Actor_Modify_Friendliness_To_Other(12, 0, -10); - Actor_Says(0, 5590, 15); - Actor_Says(12, 270, 31); - Actor_Says(0, 5655, 16); - Actor_Says(12, 280, 32); - break; - case 1330: - Actor_Says(0, 5585, 16); - sub_4025E0(); - break; - case 1320: - sub_4023D8(); - break; - default: - Actor_Face_Actor(0, 12, true); - Actor_Says(0, 5600, 14); - Actor_Says(12, 100, 53); - Actor_Says(0, 5605, 18); - Actor_Start_Speech_Sample(12, 110); - Actor_Set_Goal_Number(12, 395); - break; - } -} - -void ScriptUG13::sub_402E24() { - Actor_Set_Friendliness_To_Other(12, 0, 40); - Dialogue_Menu_Clear_List(); - DM_Add_To_List_Never_Repeat_Once_Selected(1370, 1, 1, 8); - DM_Add_To_List_Never_Repeat_Once_Selected(1380, 1, 8, 1); - DM_Add_To_List_Never_Repeat_Once_Selected(1390, 8, 1, 1); - Dialogue_Menu_Appear(320, 240); - int answer = Dialogue_Menu_Query_Input(); - Dialogue_Menu_Disappear(); - if (answer == 1370) { - Actor_Says(0, 5665, 16); - Actor_Says(12, 300, 32); - Actor_Says(0, 5680, 19); - Actor_Says(12, 310, 33); - Actor_Says(12, 330, 30); - Actor_Start_Speech_Sample(12, 110); - Actor_Set_Goal_Number(12, 395); - Actor_Says(0, 5685, 18); - } else if (answer == 1380) { - if (Actor_Clue_Query(0, 123)) { - sub_402960(); - } else { - Actor_Says(0, 5700, 15); - sub_4025E0(); - } - } else if (answer == 1390) { - Actor_Says(0, 5675, 9); - Actor_Says(12, 370, 32); - Actor_Says(0, 5705, 10); - } -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ug14.cpp b/engines/bladerunner/script/ug14.cpp deleted file mode 100644 index 156f405b0b..0000000000 --- a/engines/bladerunner/script/ug14.cpp +++ /dev/null @@ -1,193 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptUG14::InitializeScene() { - if (Game_Flag_Query(349)) { - Setup_Scene_Information(-278.0f, 12.97f, -152.0f, 200); - } else if (Game_Flag_Query(344)) { - Setup_Scene_Information(-50.0f, 129.0f, -814.0f, 533); - } else { - Setup_Scene_Information(233.0f, 186.04f, -32.0f, 865); - } - Scene_Exit_Add_2D_Exit(0, 0, 232, 45, 427, 3); - Scene_Exit_Add_2D_Exit(1, 175, 44, 228, 115, 0); - Scene_Exit_Add_2D_Exit(2, 537, 0, 639, 190, 1); - Ambient_Sounds_Add_Looping_Sound(331, 28, 0, 1); - Ambient_Sounds_Add_Looping_Sound(332, 40, 0, 1); - Ambient_Sounds_Add_Looping_Sound(333, 40, 0, 1); - Ambient_Sounds_Add_Sound(291, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(292, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(401, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(402, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(369, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(397, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(398, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(293, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(294, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(295, 2, 20, 20, 25, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(303, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(304, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(305, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); -} - -void ScriptUG14::SceneLoaded() { - Obstacle_Object("OBSTACLE02", true); - Unobstacle_Object("WALL_E_01", true); - Unclickable_Object("OBSTACLE02"); -} - -bool ScriptUG14::MouseClick(int x, int y) { - return false; -} - -bool ScriptUG14::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptUG14::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptUG14::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptUG14::ClickedOnExit(int exitId) { - float x, y, z; - Actor_Query_XYZ(0, &x, &y, &z); - bool v1 = y > 57.0f; - if (exitId > 2) { - return false; - } - if (!exitId) { - if (v1) { - if (Loop_Actor_Walk_To_XYZ(0, 141.47f, 128.92f, -150.16f, 0, 1, false, 0)) { - return false; - } - Actor_Face_XYZ(0, -14.53f, 12.12f, -150.16f, true); - Footstep_Sound_Override_On(3); - Loop_Actor_Travel_Stairs(0, 13, 0, 0); - Footstep_Sound_Override_Off(); - } - if (!Loop_Actor_Walk_To_XYZ(0, -278.0f, 12.97f, -152.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(348); - Set_Enter(90, 103); - } - return true; - } - if (exitId == 1) { - if (!v1) { - if (Loop_Actor_Walk_To_XYZ(0, -14.53f, 12.12f, -150.16f, 0, 1, false, 0)) { - return false; - } - Actor_Face_XYZ(0, 141.47f, 128.92f, -150.16f, true); - Footstep_Sound_Override_On(3); - Loop_Actor_Travel_Stairs(0, 13, 1, 0); - Footstep_Sound_Override_Off(); - } - if (!Loop_Actor_Walk_To_XYZ(0, -50.0f, 129.0f, -814.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(345); - Set_Enter(6, 96); - } - return true; - } - - if (exitId == 2) { - if (!v1) { - if (Loop_Actor_Walk_To_XYZ(0, -14.53f, 12.12f, -150.16f, 0, 1, false, 0)) { - return false; - } - Actor_Face_XYZ(0, 141.47f, 128.92f, -150.16f, true); - Footstep_Sound_Override_On(3); - Loop_Actor_Travel_Stairs(0, 13, 1, 0); - Footstep_Sound_Override_Off(); - } - if (!Loop_Actor_Walk_To_XYZ(0, 157.0f, 128.92f, -108.01f, 0, 1, false, 0)) { - Footstep_Sound_Override_On(3); - Loop_Actor_Travel_Stairs(0, 6, 1, 0); - Footstep_Sound_Override_Off(); - Loop_Actor_Walk_To_XYZ(0, 233.0f, 186.04f, -32.0f, 0, 0, false, 0); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(346); - Set_Enter(83, 95); - } - return true; - } - return false; -} - -bool ScriptUG14::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptUG14::SceneFrameAdvanced(int frame) { -} - -void ScriptUG14::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptUG14::PlayerWalkedIn() { - if (Game_Flag_Query(349)) { - Loop_Actor_Walk_To_XYZ(0, -250.0f, 12.97f, -152.0f, 0, 0, false, 0); - Game_Flag_Reset(349); - } else if (Game_Flag_Query(344)) { - Loop_Actor_Walk_To_XYZ(0, -50.0f, 129.0f, -604.0f, 0, 0, false, 0); - Game_Flag_Reset(344); - } else { - Loop_Actor_Walk_To_XYZ(0, 157.0f, 186.04f, -44.01f, 0, 0, false, 0); - Actor_Face_Heading(0, 10, false); - Footstep_Sound_Override_On(3); - Loop_Actor_Travel_Stairs(0, 6, 0, 0); - Footstep_Sound_Override_Off(); - Loop_Actor_Walk_To_XYZ(0, 157.0f, 128.92f, -148.01f, 0, 0, false, 0); - Actor_Face_Heading(0, 807, false); - Game_Flag_Reset(347); - } - if (Global_Variable_Query(1) == 4 && Game_Flag_Query(172) && !Game_Flag_Query(694)) { - Overlay_Play("UG14OVER", 0, 0, 1, 0); - Delay(1000); - Actor_Face_Heading(0, 609, false); - Delay(3000); - Actor_Voice_Over(270, 99); - Delay(2150); - Actor_Voice_Over(300, 99); - Game_Flag_Set(694); - } - //return false; -} - -void ScriptUG14::PlayerWalkedOut() { -} - -void ScriptUG14::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ug15.cpp b/engines/bladerunner/script/ug15.cpp deleted file mode 100644 index c43288241d..0000000000 --- a/engines/bladerunner/script/ug15.cpp +++ /dev/null @@ -1,203 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptUG15::InitializeScene() { - if (Game_Flag_Query(353)) { - Setup_Scene_Information(-25.0f, 26.309999f, -434.0f, 520); - } else if (Game_Flag_Query(153)) { - Setup_Scene_Information(-17.0f, 26.309999f, -346.0f, 711); - } else if (Game_Flag_Query(355)) { - Setup_Scene_Information(-18.0f, 48.07f, 62.0f, 650); - } else { - Setup_Scene_Information(-238.0f, 48.07f, 222.0f, 180); - if (Game_Flag_Query(676) && Random_Query(1, 10) == 10) { - Game_Flag_Reset(676); - } - } - if (Game_Flag_Query(682)) { - Scene_Loop_Set_Default(3); - } - if (Game_Flag_Query(353) || Game_Flag_Query(153)) { - Scene_Exit_Add_2D_Exit(0, 260, 0, 307, 298, 0); - Scene_Exit_Add_2D_Exit(1, 301, 147, 337, 304, 1); - Game_Flag_Reset(353); - Game_Flag_Reset(153); - } else { - Scene_Exit_Add_2D_Exit(2, 406, 128, 480, 316, 1); - Scene_Exit_Add_2D_Exit(3, 0, 0, 30, 479, 3); - } - Ambient_Sounds_Add_Looping_Sound(105, 71, 0, 1); - Ambient_Sounds_Add_Looping_Sound(95, 45, 0, 1); - Ambient_Sounds_Add_Looping_Sound(332, 76, 0, 1); - Ambient_Sounds_Add_Sound(291, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(292, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(293, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(294, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(295, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(401, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(402, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(369, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(397, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(398, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(303, 5, 50, 47, 57, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(304, 5, 50, 47, 57, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(305, 5, 50, 47, 57, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(1, 5, 50, 47, 57, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(57, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(58, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(306, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(307, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(308, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(196, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(197, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(198, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(199, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); - -} - -void ScriptUG15::SceneLoaded() { - Unobstacle_Object("CATWALK_01_RAIL02", true); - Unobstacle_Object("LOFT01", true); - Obstacle_Object("NUT1", true); - Clickable_Object("NUT1"); -} - -bool ScriptUG15::MouseClick(int x, int y) { - return false; -} - -bool ScriptUG15::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptUG15::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptUG15::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptUG15::ClickedOnExit(int exitId) { - - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -25.0f, 26.31f, -434.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(352); - Set_Enter(88, 101); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -17.0f, 26.31f, -346.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(152); - Set_Enter(19, 100); - } - return true; - } - if (exitId == 2) { - int v1 = Actor_Query_Goal_Number(64); - if (v1 >= 300 && v1 <= 303) { - Loop_Actor_Walk_To_XYZ(0, -137.61f, 48.07f, 147.12f, 0, 1, false, 0); - } else if (!Loop_Actor_Walk_To_XYZ(0, 18.0f, 52.28f, 46.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(354); - Set_Enter(19, 100); - } - return true; - } - if (exitId == 3) { - if (!Loop_Actor_Walk_To_XYZ(0, -238.0f, 52.46f, 222.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(350); - Set_Enter(85, 97); - } - return true; - } - return false; - -} - -bool ScriptUG15::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptUG15::SceneFrameAdvanced(int frame) { - if (Actor_Query_Goal_Number(64) == 300) { - float x, y, z; - Actor_Query_XYZ(0, &x, &y, &z); - if (-160.0f <= x && z < 220.0f) { - Actor_Set_Goal_Number(64, 301); - } - } - if (frame == 61) { - Ambient_Sounds_Play_Sound(583, 80, 0, 0, 99); - } - if (Game_Flag_Query(677) && !Game_Flag_Query(682)) { - float x, y, z; - Actor_Query_XYZ(0, &x, &y, &z); - if (-180.0f <= x && (z < 220.0f && !Game_Flag_Query(724))) { - Game_Flag_Set(724); - Game_Flag_Set(682); - Scene_Loop_Set_Default(3); - Scene_Loop_Start_Special(2, 2, 1); - Actor_Set_Goal_Number(0, 390); - Actor_Query_XYZ(64, &x, &y, &z); - if (-200.0f < x && -62.0f > x) { - Actor_Set_Goal_Number(64, 309); - } - } - } - // return false; -} - -void ScriptUG15::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptUG15::PlayerWalkedIn() { - if (Game_Flag_Query(355)) { - Loop_Actor_Walk_To_XYZ(0, -62.0f, 48.07f, 102.0f, 0, 0, false, 0); - Game_Flag_Reset(355); - } else if (Game_Flag_Query(351)) { - Game_Flag_Reset(351); - if (!Game_Flag_Query(676)) { - Actor_Set_Goal_Number(64, 310); - } - } -} - -void ScriptUG15::PlayerWalkedOut() { -} - -void ScriptUG15::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ug16.cpp b/engines/bladerunner/script/ug16.cpp deleted file mode 100644 index 2a4a028c3d..0000000000 --- a/engines/bladerunner/script/ug16.cpp +++ /dev/null @@ -1,369 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptUG16::InitializeScene() { - if (Game_Flag_Query(552)) { - Setup_Scene_Information(-270.76f, -34.88f, -504.02f, 404); - Game_Flag_Reset(552); - } else if (Game_Flag_Query(152)) { - Setup_Scene_Information(-322.0f, -34.0f, -404.0f, 345); - Game_Flag_Reset(152); - } else { - Setup_Scene_Information(-318.0f, -34.0f, -216.0f, 340); - Game_Flag_Reset(354); - } - Scene_Exit_Add_2D_Exit(0, 242, 169, 282, 262, 3); - Scene_Exit_Add_2D_Exit(1, 375, 166, 407, 251, 3); - Scene_Exit_Add_2D_Exit(2, 461, 148, 523, 248, 0); - Ambient_Sounds_Add_Looping_Sound(516, 33, 81, 0); - Ambient_Sounds_Add_Looping_Sound(332, 40, 0, 1); - Ambient_Sounds_Add_Looping_Sound(333, 40, 0, 1); - if (Game_Flag_Query(568)) { - Scene_Loop_Set_Default(5); - } else { - Scene_Loop_Set_Default(0); - } -} - -void ScriptUG16::SceneLoaded() { - Obstacle_Object("BED", true); - Obstacle_Object("QUADPATCH07", true); - Obstacle_Object("QUADPATCH05", true); - Obstacle_Object("SCREEN 01", true); - Obstacle_Object("BOX49", true); - Obstacle_Object("CYLINDER07", true); - Unobstacle_Object("SEAT 1", true); - Unobstacle_Object("SEAT 2", true); - Unclickable_Object("BED"); - Unclickable_Object("QUADPATCH07"); - Clickable_Object("QUADPATCH05"); - Clickable_Object("SCREEN 01"); - Unclickable_Object("BOX49"); - Unclickable_Object("CYLINDER07"); - Unobstacle_Object("BOX67", true); - Footstep_Sounds_Set(0, 3); - Footstep_Sounds_Set(1, 2); - Footstep_Sounds_Set(2, 3); - Footstep_Sounds_Set(6, 3); -} - -bool ScriptUG16::MouseClick(int x, int y) { - return false; -} - -bool ScriptUG16::ClickedOn3DObject(const char *objectName, bool a2) { - if (Object_Query_Click("QUADPATCH05", objectName) && !Loop_Actor_Walk_To_XYZ(0, 194.0f, -35.0f, 160.8f, 0, 1, false, 0)) { - Actor_Face_Heading(0, 870, false); - if (!Game_Flag_Query(597) && Game_Flag_Query(595)) { - Game_Flag_Set(597); - Delay(1000); - Actor_Voice_Over(3480, 99); - Actor_Change_Animation_Mode(0, 38); - Sound_Play(339, 100, 0, 0, 50); - Delay(1000); - Item_Pickup_Spin_Effect(948, 460, 287); - Actor_Voice_Over(2740, 99); - Actor_Voice_Over(2750, 99); - Actor_Voice_Over(2760, 99); - Actor_Voice_Over(2770, 99); - Actor_Clue_Acquire(0, 125, 1, -1); - } else { - Actor_Says(0, 8523, 12); - Actor_Says(0, 8635, 12); - } - return true; - } - if (Object_Query_Click("SCREEN 01", objectName) && !Loop_Actor_Walk_To_XYZ(0, 194.0f, -35.0f, 160.8f, 0, 1, false, 0)) { - Actor_Face_Heading(0, 870, false); - if ((!Game_Flag_Query(595) && Actor_Query_Is_In_Current_Set(10)) || Actor_Clue_Query(0, 151) || Game_Flag_Query(568)) { - Actor_Says(0, 8525, 12); - Actor_Says(0, 8526, 12); - return false; - } - Delay(2000); - Actor_Face_Heading(0, 1016, false); - Delay(2000); - Actor_Says(0, 5725, 14); - Delay(1000); - Item_Pickup_Spin_Effect(941, 418, 305); - Actor_Clue_Acquire(0, 151, 1, -1); - return true; - } - return false; -} - -bool ScriptUG16::ClickedOnActor(int actorId) { - if (Actor_Query_Goal_Number(10) < 490) { - sub_401D78(); - return true; - } - return false; -} - -bool ScriptUG16::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptUG16::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -322.0f, -34.0f, -216.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(355); - Set_Enter(87, 99); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, -322.0f, -34.0f, -404.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(153); - Set_Enter(87, 99); - } - return true; - } - if (exitId == 2) { - if (!Loop_Actor_Walk_To_XYZ(0, -316.78f, -34.88f, -533.27f, 0, 1, false, 0)) { - Actor_Face_Heading(0, 0, false); - Loop_Actor_Travel_Stairs(0, 13, 1, 0); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(551); - Set_Enter(36, 30); - } - return true; - } - return false; -} - -bool ScriptUG16::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptUG16::SceneFrameAdvanced(int frame) { - if (frame == 132) { - Ambient_Sounds_Remove_Looping_Sound(516, true); - } -} - -void ScriptUG16::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptUG16::PlayerWalkedIn() { - Game_Flag_Set(715); - if (!Game_Flag_Query(595)) { - Actor_Set_Goal_Number(10, 403); - } - if (!Game_Flag_Query(556) && Actor_Query_Is_In_Current_Set(10)) { - Player_Loses_Control(); - Loop_Actor_Walk_To_XYZ(0, 120.29f, -35.67f, 214.8f, 310, 0, false, 0); - Actor_Face_Actor(0, 10, true); - Actor_Says(10, 0, 6); - Actor_Says(10, 30, 13); - Actor_Change_Animation_Mode(10, 17); - Actor_Says(13, 0, 17); - Actor_Says(0, 5710, 14); - Actor_Says(10, 40, 13); - Actor_Says(10, 50, 15); - Actor_Says(13, 20, 12); - Actor_Says(10, 60, 23); - Actor_Says(0, 5715, 14); - Actor_Says(13, 30, 16); - Actor_Says(10, 70, 6); - Player_Gains_Control(); - Game_Flag_Set(556); - } -} - -void ScriptUG16::PlayerWalkedOut() { - if (!Game_Flag_Query(595)) { - Actor_Set_Goal_Number(10, 401); - //return true; - } - //return false; -} - -void ScriptUG16::DialogueQueueFlushed(int a1) { -} - -void ScriptUG16::sub_401D78() { - Dialogue_Menu_Clear_List(); - DM_Add_To_List_Never_Repeat_Once_Selected(1400, 5, 6, 2); - DM_Add_To_List_Never_Repeat_Once_Selected(1410, 5, 4, 8); - if (Game_Flag_Query(600) || Game_Flag_Query(601)) { - DM_Add_To_List_Never_Repeat_Once_Selected(1420, 6, 4, 5); - DM_Add_To_List_Never_Repeat_Once_Selected(1430, 6, 4, 5); - DM_Add_To_List_Never_Repeat_Once_Selected(1440, 6, 4, 5); - } - if (Global_Variable_Query(49) > 1 && !Actor_Clue_Query(0, 125)) { - DM_Add_To_List_Never_Repeat_Once_Selected(1450, 6, 4, 5); - } - if (Actor_Clue_Query(0, 76)) { - DM_Add_To_List_Never_Repeat_Once_Selected(1460, 6, 4, 5); - } - if (Actor_Clue_Query(0, 147) && !Actor_Clue_Query(0, 125) && Game_Flag_Query(698)) { - DM_Add_To_List_Never_Repeat_Once_Selected(1470, 6, 4, 5); - } - Dialogue_Menu_Add_DONE_To_List(1480); - Dialogue_Menu_Appear(320, 240); - int answer = Dialogue_Menu_Query_Input(); - Dialogue_Menu_Disappear(); - switch (answer) { - case 1400: - Actor_Says(0, 5730, 13); - Actor_Face_Actor(0, 10, true); - Actor_Says(10, 100, 18); - Actor_Says(0, 5775, 13); - Actor_Says(13, 70, 17); - Actor_Says(10, 110, 16); - Actor_Says(13, 80, 6); - Actor_Says(0, 5780, 13); - Actor_Says(10, 120, 16); - Actor_Says(13, 120, 13); - Actor_Says(0, 5785, 13); - Actor_Says(10, 130, 6); - Actor_Says(0, 5825, 13); - Actor_Modify_Friendliness_To_Other(10, 0, -5); - if (Game_Flag_Query(560)) { - Actor_Says(10, 140, 13); - Actor_Says(10, 150, 14); - Actor_Says(10, 160, 13); - Actor_Says(13, 140, 16); - Actor_Says(0, 5790, 13); - Actor_Says(10, 170, 14); - Game_Flag_Set(600); - Actor_Modify_Friendliness_To_Other(10, 0, 5); - } else { - Actor_Says(10, 180, 14); - Actor_Says(0, 5795, 13); - Actor_Says(13, 150, 17); - Actor_Says(0, 5800, 13); - Actor_Says(10, 190, 15); - Game_Flag_Set(601); - Actor_Modify_Friendliness_To_Other(10, 0, -10); - } - break; - case 1410: - Actor_Says(0, 5735, 13); - Actor_Face_Actor(0, 10, true); - Actor_Says(13, 160, 17); - Actor_Says(10, 200, 14); - break; - case 1420: - Actor_Says(0, 5740, 13); - Actor_Face_Actor(0, 10, true); - Actor_Says(13, 180, 15); - Actor_Says(10, 220, 13); - Actor_Says(13, 190, 17); - Actor_Says(0, 5805, 13); - Actor_Says(10, 230, 14); - Actor_Says(10, 240, 13); - Actor_Says(13, 200, 17); - Actor_Says(10, 260, 13); - Actor_Says(10, 270, 15); - Actor_Says(13, 210, 14); - Actor_Says(0, 5810, 13); - Actor_Says(13, 220, 14); - Actor_Says(13, 230, 17); - Actor_Clue_Acquire(0, 136, 1, 10); - break; - case 1430: - Actor_Says(0, 5745, 13); - Actor_Face_Actor(0, 10, true); - Actor_Says(13, 240, 15); - Actor_Says(0, 5815, 13); - Actor_Says(13, 250, 16); - Actor_Says(10, 290, 15); - Actor_Says(13, 260, 15); - break; - case 1440: - Actor_Says(0, 5750, 13); - Actor_Face_Actor(0, 10, true); - Actor_Says(13, 280, 6); - Actor_Says(10, 300, 14); - Actor_Says(10, 310, 15); - Actor_Modify_Friendliness_To_Other(10, 0, -5); - break; - case 1450: - Actor_Says(0, 5755, 13); - Actor_Face_Actor(0, 10, true); - Actor_Says(13, 290, 17); - Actor_Says(10, 320, 16); - Actor_Says(0, 5820, 13); - Actor_Says(13, 300, 17); - Actor_Says(10, 330, 14); - Actor_Says(0, 5825, 13); - Actor_Says(10, 340, 13); - Actor_Says(13, 310, 13); - Actor_Says(10, 350, 13); - Actor_Says(10, 360, 15); - Actor_Says(0, 5830, 13); - Actor_Says(13, 320, 16); - Actor_Says(13, 330, 15); - Game_Flag_Set(698); - break; - case 1460: - Actor_Says(0, 5760, 13); - Actor_Face_Actor(0, 10, true); - Actor_Says(10, 370, 15); - Actor_Says(13, 340, 14); - Actor_Says(0, 5835, 13); - Actor_Says(10, 380, 15); - Actor_Says(13, 370, 6); - Actor_Says(0, 5840, 13); - Actor_Says(13, 380, 13); - break; - case 1470: - Actor_Says(0, 5765, 13); - Actor_Face_Actor(0, 10, true); - Actor_Says(13, 400, 15); - Actor_Says(0, 5845, 13); - Actor_Says(10, 390, 23); - Actor_Says(13, 410, 14); - Actor_Says(13, 420, 17); - Actor_Says(0, 5835, 13); - Delay(1000); - Item_Pickup_Spin_Effect(948, 239, 454); - Actor_Voice_Over(2740, 99); - Actor_Voice_Over(2750, 99); - Actor_Voice_Over(2760, 99); - Actor_Voice_Over(2770, 99); - Actor_Says(0, 5850, 13); - Actor_Says(10, 400, 15); - Actor_Says(13, 430, 6); - Actor_Says(0, 5855, 13); - Actor_Says(10, 410, 14); - Game_Flag_Set(597); - Actor_Clue_Acquire(0, 125, 1, 10); - break; - case 1480: - Actor_Says(0, 4595, 14); - break; - } -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ug17.cpp b/engines/bladerunner/script/ug17.cpp deleted file mode 100644 index d438a62ae4..0000000000 --- a/engines/bladerunner/script/ug17.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptUG17::InitializeScene() { - if (Game_Flag_Query(447)) { - Setup_Scene_Information(1013.0f, 67.96f, -1892.0f, 525); - Game_Flag_Reset(447); - } else { - Setup_Scene_Information(1000.0f, 67.96f, -1539.0f, 0); - } - Scene_Exit_Add_2D_Exit(0, 610, 0, 639, 479, 1); - Scene_Exit_Add_2D_Exit(1, 551, 347, 594, 386, 0); - Ambient_Sounds_Add_Looping_Sound(589, 100, 1, 1); - Ambient_Sounds_Add_Looping_Sound(384, 50, 1, 1); - Ambient_Sounds_Add_Sound(72, 5, 80, 10, 11, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(73, 5, 80, 10, 11, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(74, 5, 80, 10, 11, -100, 100, -101, -101, 0, 0); - Overlay_Play("UG17OVER", 0, 1, 0, 0); -} - -void ScriptUG17::SceneLoaded() { - Obstacle_Object("BOX FOR BIG VENT13", true); - Unclickable_Object("BOX FOR BIG VENT13"); -} - -bool ScriptUG17::MouseClick(int x, int y) { - return false; -} - -bool ScriptUG17::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptUG17::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptUG17::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptUG17::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, 1000.0f, 67.96f, -1539.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(353); - Set_Enter(87, 99); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, 1013.0f, 67.96f, -1892.0f, 0, 1, false, 0)) { - Actor_Face_Heading(0, 89, false); - if (Global_Variable_Query(1) == 5) { - Actor_Says(0, 8522, 14); - } else { - Loop_Actor_Travel_Ladder(0, 10, 1, 0); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(448); - Set_Enter(17, 83); - } - } - return true; - } - return false; -} - -bool ScriptUG17::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptUG17::SceneFrameAdvanced(int frame) { -} - -void ScriptUG17::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptUG17::PlayerWalkedIn() { - if (Game_Flag_Query(352)) { - Loop_Actor_Walk_To_XYZ(0, 961.0f, 67.96f, -1539.0f, 0, 0, false, 0); - Game_Flag_Reset(352); - } - //return false; -} - -void ScriptUG17::PlayerWalkedOut() { -} - -void ScriptUG17::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ug18.cpp b/engines/bladerunner/script/ug18.cpp deleted file mode 100644 index 215d447a85..0000000000 --- a/engines/bladerunner/script/ug18.cpp +++ /dev/null @@ -1,407 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptUG18::InitializeScene() { - Setup_Scene_Information(-684.71f, 0.0f, 171.59f, 0); - Game_Flag_Reset(434); - Scene_Exit_Add_2D_Exit(0, 0, 158, 100, 340, 3); - Ambient_Sounds_Add_Looping_Sound(105, 71, 0, 1); - Ambient_Sounds_Add_Looping_Sound(95, 45, 0, 1); - Ambient_Sounds_Add_Looping_Sound(332, 76, 0, 1); - Ambient_Sounds_Add_Sound(291, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(292, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(293, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(294, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(402, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(368, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(369, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(397, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(398, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(295, 2, 20, 25, 25, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(303, 5, 50, 47, 57, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(304, 5, 50, 47, 57, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(305, 5, 50, 47, 57, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(1, 5, 50, 47, 57, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(57, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(58, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(306, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(307, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(308, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(196, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(197, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(198, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(199, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); - Scene_Loop_Set_Default(4); - if (Game_Flag_Query(670) && !Game_Flag_Query(671) && Global_Variable_Query(1) == 4) { - Actor_Set_Goal_Number(4, 300); - Actor_Set_Goal_Number(5, 300); - Actor_Set_Goal_Number(8, 300); - } -} - -void ScriptUG18::SceneLoaded() { - Obstacle_Object("MACHINE_01", true); - Unobstacle_Object("PLATFM_RAIL 01", true); - Unobstacle_Object("PLATFM_RAIL 02", true); - Unobstacle_Object("OBSTACLE1", true); - Clickable_Object("MACHINE_01"); - Unclickable_Object("MACHINE_01"); - if (Game_Flag_Query(671)) { - Actor_Put_In_Set(4, 99); - Actor_Set_At_Waypoint(4, 41, 0); - if (Actor_Query_Which_Set_In(8) == 89) { - Actor_Put_In_Set(8, 91); - Actor_Set_At_Waypoint(8, 33, 0); - } - } - if (Game_Flag_Query(670) && !Game_Flag_Query(671) && Global_Variable_Query(1) == 4) { - Item_Add_To_World(91, 987, 89, -55.21f, 0.0f, -302.17f, 0, 12, 12, false, true, false, true); - } - -} - -bool ScriptUG18::MouseClick(int x, int y) { - return false; -} - -bool ScriptUG18::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptUG18::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptUG18::ClickedOnItem(int itemId, bool a2) { - if (itemId == 91) { - if (a2) { - Item_Remove_From_World(91); - } else if (!Loop_Actor_Walk_To_Item(0, 91, 12, 1, false)) { - Item_Pickup_Spin_Effect(987, 368, 243); - Item_Remove_From_World(itemId); - Game_Flag_Set(703); - Actor_Clue_Acquire(0, 32, 1, 4); - } - } - return false; -} - -bool ScriptUG18::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, -684.712f, 0.0f, 171.59f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(435); - Set_Enter(85, 97); - } - return true; - } - return false; -} - -bool ScriptUG18::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptUG18::SceneFrameAdvanced(int frame) { -} - -void ScriptUG18::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { - if (actorId == 4) { - if (newGoal == 303) { - Game_Flag_Set(607); - ADQ_Flush(); - Actor_Modify_Friendliness_To_Other(5, 0, 7); - Actor_Modify_Friendliness_To_Other(8, 0, 10); - Player_Loses_Control(); - Actor_Face_Actor(4, 0, true); - ADQ_Add(4, 1220, 58); - Scene_Exits_Enable(); - Actor_Set_Goal_Number(4, 305); - } else if (newGoal == 304) { - ADQ_Flush(); - Actor_Modify_Friendliness_To_Other(5, 0, 7); - Actor_Modify_Friendliness_To_Other(8, 0, 10); - Player_Loses_Control(); - Actor_Face_Actor(4, 0, true); - ADQ_Add(4, 1220, 58); - Scene_Exits_Enable(); - Actor_Set_Goal_Number(4, 306); - } - } else if (actorId == 8) { - if (newGoal == 302) { - if (Actor_Query_Friendliness_To_Other(5, 0) > 55 && Game_Flag_Query(607)) { - sub_403588(); - } else { - Actor_Set_Goal_Number(8, 307); - Actor_Set_Goal_Number(5, 310); - } - } else if (newGoal == 304) { - Actor_Modify_Friendliness_To_Other(5, 0, -3); - ADQ_Add(8, 380, -1); - Actor_Set_Goal_Number(8, 306); - } else if (newGoal == 305) { - Actor_Change_Animation_Mode(8, 6); - Sound_Play(12, 100, 0, 0, 50); - Actor_Force_Stop_Walking(0); - Actor_Change_Animation_Mode(0, 48); - Player_Loses_Control(); - Actor_Retired_Here(0, 6, 6, 1, 8); - } - } -} - -void ScriptUG18::PlayerWalkedIn() { - Loop_Actor_Walk_To_XYZ(0, -488.71f, 0.0f, 123.59f, 0, 0, false, 0); - if (Game_Flag_Query(670) && !Game_Flag_Query(671) && Actor_Query_Is_In_Current_Set(4)) { - Scene_Exits_Disable(); - sub_402734(); - sub_403278(); - Game_Flag_Set(671); - } -} - -void ScriptUG18::PlayerWalkedOut() { -} - -void ScriptUG18::DialogueQueueFlushed(int a1) { - int v0 = Actor_Query_Goal_Number(4); - if (v0 == 301) { - Actor_Set_Goal_Number(4, 302); - Actor_Change_Animation_Mode(8, 6); - Sound_Play(14, 100, 0, 0, 50); - Actor_Change_Animation_Mode(4, 22); - ADQ_Add(5, 630, 13); - Actor_Set_Goal_Number(5, 301); - } else if (v0 == 305) { - Actor_Change_Animation_Mode(0, 6); - Sound_Play(13, 100, 0, 0, 50); - Actor_Change_Animation_Mode(4, 22); - Delay(900); - Actor_Change_Animation_Mode(0, 6); - Sound_Play(14, 100, 0, 0, 50); - Actor_Change_Animation_Mode(4, 22); - Delay(1100); - Actor_Change_Animation_Mode(0, 6); - Sound_Play(12, 100, 0, 0, 50); - Actor_Change_Animation_Mode(4, 22); - Delay(900); - Actor_Change_Animation_Mode(0, 6); - Sound_Play(14, 100, 0, 0, 50); - Actor_Change_Animation_Mode(4, 61); - Overlay_Play("UG18over", 1, 0, 1, 0); - Actor_Set_Goal_Number(4, 307); - Player_Gains_Control(); - ADQ_Add_Pause(2000); - ADQ_Add(8, 360, -1); - ADQ_Add_Pause(2000); - ADQ_Add(5, 650, 14); - ADQ_Add(8, 370, 14); - ADQ_Add(5, 1320, 14); - Actor_Set_Goal_Number(5, 303); - } else if (v0 == 306) { - Actor_Change_Animation_Mode(4, 6); - Sound_Play(13, 100, 0, 0, 50); - Actor_Force_Stop_Walking(0); - Actor_Change_Animation_Mode(0, 48); - Player_Loses_Control(); - Actor_Retired_Here(0, 6, 6, 1, 4); - Actor_Set_Goal_Number(4, 307); - } - - int v1 = Actor_Query_Goal_Number(5); - if (v1 == 301) { - Actor_Change_Animation_Mode(8, 6); - Sound_Play(14, 100, 0, 0, 50); - Actor_Change_Animation_Mode(4, 22); - ADQ_Add(5, 640, 13); - ADQ_Add(4, 1210, 13); - Actor_Set_Goal_Number(5, 302); - } else if (v1 == 302) { - Actor_Change_Animation_Mode(8, 6); - Sound_Play(14, 100, 0, 0, 50); - Actor_Change_Animation_Mode(4, 61); - ADQ_Add_Pause(2000); - ADQ_Add(5, 650, 14); - ADQ_Add(8, 370, 14); - ADQ_Add(5, 1320, 14); - Actor_Set_Goal_Number(4, 390); - Actor_Retired_Here(4, 72, 32, 1, 8); - Actor_Set_Goal_Number(5, 303); - Scene_Exits_Enable(); - } else if (v1 == 303) { - Actor_Set_Goal_Number(8, 301); - } - if (Actor_Query_Goal_Number(8) == 306) { - Actor_Change_Animation_Mode(8, 48); - Actor_Set_Goal_Number(8, 307); - Actor_Set_Goal_Number(5, 310); - } -} - -void ScriptUG18::sub_402734() { - Actor_Face_Actor(0, 4, true); - Actor_Says(0, 5860, 9); - Delay(500); - Actor_Face_Actor(4, 0, true); - Delay(500); - Actor_Says(4, 790, 3); - Actor_Says(0, 5865, 12); - Actor_Says(4, 800, 3); - Loop_Actor_Walk_To_XYZ(0, -357.13f, 0.0f, -44.47f, 0, 0, false, 0); - Actor_Face_Actor(0, 4, true); - Actor_Says(0, 5870, 14); - Actor_Face_Actor(4, 0, true); - Actor_Start_Speech_Sample(4, 810); - Loop_Actor_Walk_To_XYZ(4, -57.21f, 0.0f, -334.17f, 0, 0, false, 0); - Actor_Says(0, 5875, 13); - Actor_Says(4, 830, 3); - Actor_Says(4, 840, 12); - Actor_Says(4, 850, 14); - Actor_Says(4, 860, 13); - Actor_Says(0, 5880, 15); - Actor_Says(0, 5885, 9); - Actor_Says(0, 5890, 13); - Actor_Says(4, 870, 15); - Loop_Actor_Walk_To_XYZ(0, -205.13f, 0.0f, -184.47f, 0, 0, false, 0); - Actor_Face_Actor(0, 4, true); - Actor_Says(0, 5900, 15); - Actor_Says(4, 880, 13); - Actor_Says(0, 5905, 9); - Actor_Says(0, 5910, 12); - Actor_Says(0, 5915, 13); - Actor_Says(4, 890, 16); - Actor_Says(0, 5920, 14); - Loop_Actor_Walk_To_XYZ(4, -57.21f, 0.0f, -334.17f, 0, 0, false, 0); - Actor_Face_Actor(4, 0, true); - Actor_Says(4, 900, 15); - Actor_Says(4, 910, 12); - Actor_Says(4, 920, 16); - Actor_Says(0, 5925, 14); - Actor_Says(4, 940, 14); - Actor_Says(0, 5930, 18); - Actor_Says(4, 950, 14); - Actor_Says(4, 960, 13); - Actor_Says(4, 970, 3); - if (Game_Flag_Query(607)) { - Actor_Modify_Friendliness_To_Other(5, 0, 3); - Actor_Modify_Friendliness_To_Other(8, 0, 5); - Loop_Actor_Walk_To_XYZ(0, -117.13f, 0.0f, -284.47f, 0, 0, false, 0); - Actor_Face_Actor(0, 4, true); - Actor_Says(0, 5960, 9); - Actor_Says(0, 5965, 14); - Actor_Says(4, 980, 15); - Actor_Says(4, 990, 13); - Actor_Says(0, 5970, 14); - Actor_Says(4, 1000, 3); - Actor_Says(0, 5975, 15); - } else { - sub_402DE8(); - } -} - -void ScriptUG18::sub_402DE8() { - - if (Player_Query_Agenda()) { - if (Global_Variable_Query(45) > 1 || Player_Query_Agenda() == 2) { - sub_403114(); - } else { - sub_402F8C(); - } - } else { - Actor_Modify_Friendliness_To_Other(5, 0, -1); - Actor_Modify_Friendliness_To_Other(8, 0, -1); - Actor_Says(0, 5935, 14); - Actor_Says(0, 5940, 18); - Actor_Says(4, 1020, 13); - Actor_Says(4, 1030, 14); - } -} - -void ScriptUG18::sub_402F8C() { - Loop_Actor_Walk_To_XYZ(0, -117.13f, 0.0f, -284.47f, 0, 0, false, 0); - Actor_Face_Actor(0, 4, true); - Actor_Says(0, 5945, 12); - Actor_Says(4, 1040, 15); - Actor_Says(0, 5980, 15); - Actor_Says(4, 1050, 12); - Actor_Says(4, 1060, 13); - Actor_Says(4, 1070, 14); - Actor_Says(0, 5985, 18); - Actor_Says(4, 1080, 3); - Actor_Says(4, 1090, 14); - Actor_Says(4, 1100, 13); -} - -void ScriptUG18::sub_403114() { - Actor_Modify_Friendliness_To_Other(5, 0, 20); - Actor_Modify_Friendliness_To_Other(8, 0, 10); - Loop_Actor_Walk_To_XYZ(0, -117.13f, 0.0f, -284.47f, 0, 0, false, 0); - Actor_Face_Actor(0, 4, true); - Actor_Says(0, 5950, 16); - Actor_Says(0, 5955, 14); - Actor_Says(4, 1110, 13); - Actor_Says(4, 1120, 15); - Actor_Says(0, 5990, 3); - Actor_Says(4, 1130, 15); - Actor_Says(4, 1140, 16); -} - -void ScriptUG18::sub_403278() { - ADQ_Flush(); - Actor_Start_Speech_Sample(5, 590); - Delay(500); - Loop_Actor_Walk_To_XYZ(4, 126.79f, 0.0f, -362.17f, 0, 0, false, 0); - Actor_Face_Heading(4, 729, false); - Actor_Set_Goal_Number(4, 301); - ADQ_Add(8, 350, 13); - ADQ_Add_Pause(1500); - ADQ_Add(4, 1150, 58); - ADQ_Add(5, 600, 13); - ADQ_Add_Pause(1000); - ADQ_Add(4, 1160, 60); - ADQ_Add_Pause(500); - ADQ_Add(4, 1170, 59); - ADQ_Add(4, 1180, 58); - ADQ_Add(5, 610, 13); - ADQ_Add(4, 1190, 60); - ADQ_Add(5, 620, 13); - ADQ_Add(4, 1200, 59); -} - -void ScriptUG18::sub_403588() { - Actor_Says(5, 660, 13); - Actor_Says(0, 5995, 13); - Actor_Says(5, 670, 13); - Actor_Says(0, 6000, 13); - Actor_Says_With_Pause(5, 680, 2.0f, 13); - Actor_Says(5, 690, 13); - Actor_Says(5, 700, 13); - Actor_Set_Goal_Number(8, 310); - Actor_Set_Goal_Number(5, 310); -} - -} // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ug19.cpp b/engines/bladerunner/script/ug19.cpp deleted file mode 100644 index 9a6000d363..0000000000 --- a/engines/bladerunner/script/ug19.cpp +++ /dev/null @@ -1,139 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "bladerunner/script/script.h" - -namespace BladeRunner { - -void ScriptUG19::InitializeScene() { - if (Game_Flag_Query(357)) { - Setup_Scene_Information(67.03f, 105.0f, -74.97f, 256); - } else { - Setup_Scene_Information(181.0f, 11.52f, -18.0f, 777); - } - Scene_Exit_Add_2D_Exit(0, 351, 0, 491, 347, 0); - Scene_Exit_Add_2D_Exit(1, 548, 124, 639, 369, 1); - Ambient_Sounds_Add_Looping_Sound(95, 45, 0, 1); - Ambient_Sounds_Add_Looping_Sound(332, 76, 0, 1); - Ambient_Sounds_Add_Sound(291, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(292, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(293, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(294, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(295, 2, 20, 25, 33, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(401, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(369, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(396, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(397, 2, 120, 11, 12, -100, 100, -100, 100, 0, 0); - Ambient_Sounds_Add_Sound(303, 5, 50, 47, 57, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(304, 5, 50, 47, 57, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(305, 5, 50, 47, 57, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(1, 5, 50, 47, 57, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(57, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(58, 5, 50, 17, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(306, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(307, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(308, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(196, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(197, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(198, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); - Ambient_Sounds_Add_Sound(199, 5, 50, 27, 37, -100, 100, -101, -101, 0, 0); - -} - -void ScriptUG19::SceneLoaded() { - Obstacle_Object("LADDER", true); - Unclickable_Object("LADDER"); - Footstep_Sounds_Set(1, 0); - Footstep_Sounds_Set(0, 3); -} - -bool ScriptUG19::MouseClick(int x, int y) { - return false; -} - -bool ScriptUG19::ClickedOn3DObject(const char *objectName, bool a2) { - return false; -} - -bool ScriptUG19::ClickedOnActor(int actorId) { - return false; -} - -bool ScriptUG19::ClickedOnItem(int itemId, bool a2) { - return false; -} - -bool ScriptUG19::ClickedOnExit(int exitId) { - if (exitId == 0) { - if (!Loop_Actor_Walk_To_XYZ(0, 67.03f, 7.29f, -74.97f, 0, 1, false, 0)) { - Actor_Face_Heading(0, 256, false); - Footstep_Sound_Override_On(3); - Loop_Actor_Travel_Ladder(0, 8, 1, 0); - Footstep_Sound_Override_Off(); - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(356); - Set_Enter(53, 53); - } - return true; - } - if (exitId == 1) { - if (!Loop_Actor_Walk_To_XYZ(0, 181.0f, 11.52f, -18.0f, 0, 1, false, 0)) { - Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); - Ambient_Sounds_Remove_All_Looping_Sounds(1); - Game_Flag_Set(349); - Set_Enter(86, 98); - } - return true; - } - return false; -} - -bool ScriptUG19::ClickedOn2DRegion(int region) { - return false; -} - -void ScriptUG19::SceneFrameAdvanced(int frame) { -} - -void ScriptUG19::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) { -} - -void ScriptUG19::PlayerWalkedIn() { - if (Game_Flag_Query(348)) { - Game_Flag_Reset(348); - Loop_Actor_Walk_To_XYZ(0, 129.0f, 11.52f, -18.0f, 0, 0, false, 0); - } else { - Game_Flag_Reset(357); - Footstep_Sound_Override_On(3); - Loop_Actor_Travel_Ladder(0, 8, 0, 0); - Footstep_Sound_Override_Off(); - } -} - -void ScriptUG19::PlayerWalkedOut() { -} - -void ScriptUG19::DialogueQueueFlushed(int a1) { -} - -} // End of namespace BladeRunner -- cgit v1.2.3