1 /* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 *
21 */
22
23 #include "lastexpress/entities/coudert.h"
24
25 #include "lastexpress/game/action.h"
26 #include "lastexpress/game/entities.h"
27 #include "lastexpress/game/inventory.h"
28 #include "lastexpress/game/logic.h"
29 #include "lastexpress/game/object.h"
30 #include "lastexpress/game/savepoint.h"
31 #include "lastexpress/game/scenes.h"
32 #include "lastexpress/game/state.h"
33
34 #include "lastexpress/sound/queue.h"
35
36 #include "lastexpress/lastexpress.h"
37
38 namespace LastExpress {
39
Coudert(LastExpressEngine * engine)40 Coudert::Coudert(LastExpressEngine *engine) : Entity(engine, kEntityCoudert) {
41 ADD_CALLBACK_FUNCTION(Coudert, reset);
42 ADD_CALLBACK_FUNCTION_S(Coudert, bloodJacket);
43 ADD_CALLBACK_FUNCTION_SI(Coudert, enterExitCompartment);
44 ADD_CALLBACK_FUNCTION(Coudert, callbackActionOnDirection);
45 ADD_CALLBACK_FUNCTION_SIII(Coudert, enterExitCompartment2);
46 ADD_CALLBACK_FUNCTION_S(Coudert, playSound);
47 ADD_CALLBACK_FUNCTION_S(Coudert, playSound16);
48 ADD_CALLBACK_FUNCTION_II(Coudert, savegame);
49 ADD_CALLBACK_FUNCTION_II(Coudert, updateEntity);
50 ADD_CALLBACK_FUNCTION_I(Coudert, updateFromTime);
51 ADD_CALLBACK_FUNCTION_I(Coudert, updateFromTicks);
52 ADD_CALLBACK_FUNCTION_I(Coudert, excuseMe);
53 ADD_CALLBACK_FUNCTION_II(Coudert, function13);
54 ADD_CALLBACK_FUNCTION_I(Coudert, function14);
55 ADD_CALLBACK_FUNCTION_I(Coudert, function15);
56 ADD_CALLBACK_FUNCTION(Coudert, function16);
57 ADD_CALLBACK_FUNCTION_I(Coudert, function17);
58 ADD_CALLBACK_FUNCTION(Coudert, function18);
59 ADD_CALLBACK_FUNCTION_I(Coudert, function19);
60 ADD_CALLBACK_FUNCTION_II(Coudert, function20);
61 ADD_CALLBACK_FUNCTION(Coudert, function21);
62 ADD_CALLBACK_FUNCTION(Coudert, function22);
63 ADD_CALLBACK_FUNCTION(Coudert, function23);
64 ADD_CALLBACK_FUNCTION(Coudert, visitCompartmentF);
65 ADD_CALLBACK_FUNCTION(Coudert, function25);
66 ADD_CALLBACK_FUNCTION(Coudert, function26);
67 ADD_CALLBACK_FUNCTION(Coudert, function27);
68 ADD_CALLBACK_FUNCTION(Coudert, visitCompartmentB);
69 ADD_CALLBACK_FUNCTION(Coudert, visitCompartmentA);
70 ADD_CALLBACK_FUNCTION_TYPE2(Coudert, function30, EntityParametersI5S, EntityParametersSIIS);
71 ADD_CALLBACK_FUNCTION_I(Coudert, function31);
72 ADD_CALLBACK_FUNCTION(Coudert, function32);
73 ADD_CALLBACK_FUNCTION(Coudert, function33);
74 ADD_CALLBACK_FUNCTION_I(Coudert, function34);
75 ADD_CALLBACK_FUNCTION_I(Coudert, function35);
76 ADD_CALLBACK_FUNCTION(Coudert, chapter1);
77 ADD_CALLBACK_FUNCTION(Coudert, function37);
78 ADD_CALLBACK_FUNCTION(Coudert, function38);
79 ADD_CALLBACK_FUNCTION(Coudert, function39);
80 ADD_CALLBACK_FUNCTION(Coudert, chapter1Handler);
81 ADD_CALLBACK_FUNCTION(Coudert, function41);
82 ADD_CALLBACK_FUNCTION(Coudert, chapter2);
83 ADD_CALLBACK_FUNCTION(Coudert, function43);
84 ADD_CALLBACK_FUNCTION(Coudert, chapter3);
85 ADD_CALLBACK_FUNCTION(Coudert, function45);
86 ADD_CALLBACK_FUNCTION(Coudert, function46);
87 ADD_CALLBACK_FUNCTION_I(Coudert, function47);
88 ADD_CALLBACK_FUNCTION(Coudert, function48);
89 ADD_CALLBACK_FUNCTION(Coudert, function49);
90 ADD_CALLBACK_FUNCTION(Coudert, function50);
91 ADD_CALLBACK_FUNCTION(Coudert, function51);
92 ADD_CALLBACK_FUNCTION(Coudert, chapter4);
93 ADD_CALLBACK_FUNCTION(Coudert, function53);
94 ADD_CALLBACK_FUNCTION(Coudert, function54);
95 ADD_CALLBACK_FUNCTION(Coudert, function55);
96 ADD_CALLBACK_FUNCTION(Coudert, function56);
97 ADD_CALLBACK_FUNCTION(Coudert, chapter5);
98 ADD_CALLBACK_FUNCTION(Coudert, chapter5Handler);
99 ADD_CALLBACK_FUNCTION(Coudert, function59);
100 ADD_CALLBACK_FUNCTION(Coudert, function60);
101 ADD_CALLBACK_FUNCTION(Coudert, function61);
102 ADD_CALLBACK_FUNCTION(Coudert, function62);
103 ADD_NULL_FUNCTION();
104 }
105
106 //////////////////////////////////////////////////////////////////////////
107 IMPLEMENT_FUNCTION(1, Coudert, reset)
108 Entity::reset(savepoint, kClothes1, true);
109 IMPLEMENT_FUNCTION_END
110
111 //////////////////////////////////////////////////////////////////////////
112 IMPLEMENT_FUNCTION_S(2, Coudert, bloodJacket)
113 switch (savepoint.action) {
114 default:
115 break;
116
117 case kActionNone:
118 Entity::savegameBloodJacket(1);
119 break;
120
121 case kActionExitCompartment:
122 callbackAction();
123 break;
124
125 case kActionDefault:
126 getEntities()->drawSequenceRight(kEntityCoudert, (char *)¶ms->seq1);
127 break;
128
129 case kActionCallback:
130 if (getCallback() == 1) {
131 getAction()->playAnimation(kEventCoudertBloodJacket);
132 getLogic()->gameOver(kSavegameTypeIndex, 1, kSceneGameOverBloodJacket, true);
133 }
134 break;
135 }
136 IMPLEMENT_FUNCTION_END
137
138 //////////////////////////////////////////////////////////////////////////
139 IMPLEMENT_FUNCTION_SI(3, Coudert, enterExitCompartment, ObjectIndex)
140 switch (savepoint.action) {
141 default:
142 break;
143
144 case kActionNone:
145 Entity::savegameBloodJacket(1);
146 return;
147
148 case kActionCallback:
149 if (getCallback() == 1) {
150 getAction()->playAnimation(kEventCoudertBloodJacket);
151 getLogic()->gameOver(kSavegameTypeIndex, 1, kSceneGameOverBloodJacket, true);
152 }
153 return;
154 }
155
156 Entity::enterExitCompartment(savepoint);
157 IMPLEMENT_FUNCTION_END
158
159 //////////////////////////////////////////////////////////////////////////
160 IMPLEMENT_FUNCTION(4, Coudert, callbackActionOnDirection)
161 switch (savepoint.action) {
162 default:
163 break;
164
165 case kActionNone:
166 if (getData()->direction != kDirectionRight) {
167 callbackAction();
168 break;
169 }
170
171 Entity::savegameBloodJacket(1);
172 break;
173
174 case kActionExitCompartment:
175 callbackAction();
176 break;
177
178 case kActionCallback:
179 if (getCallback() == 1) {
180 getAction()->playAnimation(kEventCoudertBloodJacket);
181 getLogic()->gameOver(kSavegameTypeIndex, 1, kSceneGameOverBloodJacket, true);
182 }
183 break;
184 }
185 IMPLEMENT_FUNCTION_END
186
187 //////////////////////////////////////////////////////////////////////////
188 IMPLEMENT_FUNCTION_SIII(5, Coudert, enterExitCompartment2, ObjectIndex, EntityPosition, EntityPosition)
189 switch (savepoint.action) {
190 default:
191 break;
192
193 case kActionNone:
194 Entity::savegameBloodJacket(1);
195 return;
196
197 case kActionCallback:
198 if (getCallback() == 1) {
199 getAction()->playAnimation(kEventCoudertBloodJacket);
200 getLogic()->gameOver(kSavegameTypeIndex, 1, kSceneGameOverBloodJacket, true);
201 }
202 return;
203 }
204
205 Entity::enterExitCompartment(savepoint, (EntityPosition)params->param5, (EntityPosition)params->param6, kCarRedSleeping, (ObjectIndex)params->param4, false);
206 IMPLEMENT_FUNCTION_END
207
208 //////////////////////////////////////////////////////////////////////////
209 IMPLEMENT_FUNCTION_S(6, Coudert, playSound)
210 switch (savepoint.action) {
211 default:
212 break;
213
214 case kActionNone:
215 Entity::savegameBloodJacket(1);
216 break;
217
218 case kActionEndSound:
219 callbackAction();
220 break;
221
222 case kActionDefault:
223 getSound()->playSound(kEntityCoudert, (char *)¶ms->seq1);
224 break;
225
226 case kActionCallback:
227 if (getCallback() == 1) {
228 getAction()->playAnimation(kEventCoudertBloodJacket);
229 getLogic()->gameOver(kSavegameTypeIndex, 1, kSceneGameOverBloodJacket, true);
230 }
231 break;
232 }
233 IMPLEMENT_FUNCTION_END
234
235 //////////////////////////////////////////////////////////////////////////
236 IMPLEMENT_FUNCTION_NOSETUP(7, Coudert, playSound16)
237 EXPOSE_PARAMS(EntityData::EntityParametersSIIS);
238
239 switch (savepoint.action) {
240 default:
241 break;
242
243 case kActionNone:
244 Entity::savegameBloodJacket(1);
245 break;
246
247 case kActionEndSound:
248 callbackAction();
249 break;
250
251 case kActionDefault:
252 getSound()->playSound(kEntityCoudert, (char *)¶ms->seq1, kVolumeFull);
253 break;
254
255 case kActionCallback:
256 if (getCallback() == 1) {
257 getAction()->playAnimation(kEventCoudertBloodJacket);
258 getLogic()->gameOver(kSavegameTypeIndex, 1, kSceneGameOverBloodJacket, true);
259 }
260 break;
261 }
262 IMPLEMENT_FUNCTION_END
263
264 //////////////////////////////////////////////////////////////////////////
265 IMPLEMENT_FUNCTION_II(8, Coudert, savegame, SavegameType, uint32)
266 Entity::savegame(savepoint);
267 IMPLEMENT_FUNCTION_END
268
269 //////////////////////////////////////////////////////////////////////////
270 IMPLEMENT_FUNCTION_II(9, Coudert, updateEntity, CarIndex, EntityPosition)
271 switch (savepoint.action) {
272 default:
273 break;
274
275 case kActionNone:
276 if (params->param3 && getEntities()->isDistanceBetweenEntities(kEntityCoudert, kEntityPlayer, 2000))
277 getData()->inventoryItem = kItemInvalid;
278 else
279 getData()->inventoryItem = kItemNone;
280
281 if (getProgress().jacket != kJacketBlood
282 || !getEntities()->isDistanceBetweenEntities(kEntityCoudert, kEntityPlayer, 1000)
283 || getEntities()->isInsideCompartments(kEntityPlayer)
284 || getEntities()->checkFields10(kEntityPlayer)) {
285 if (getEntities()->updateEntity(kEntityCoudert, (CarIndex)params->param1, (EntityPosition)params->param2)) {
286 getData()->inventoryItem = kItemNone;
287
288 callbackAction();
289 }
290 break;
291 }
292
293 setCallback(1);
294 setup_savegame(kSavegameTypeEvent, kEventMertensBloodJacket);
295 break;
296
297 case kAction1:
298 params->param3 = 0;
299 getData()->inventoryItem = kItemNone;
300
301 setCallback(2);
302 setup_savegame(kSavegameTypeEvent, kEventCoudertAskTylerCompartment);
303 break;
304
305 case kActionExcuseMeCath:
306 if (getData()->clothes == kClothes1)
307 getSound()->playSound(kEntityPlayer, "ZFX1003", getSound()->getSoundFlag(kEntityCoudert));
308 else if (!getSoundQueue()->isBuffered(kEntityCoudert))
309 getSound()->playSound(kEntityPlayer, "JAC1112", getSound()->getSoundFlag(kEntityCoudert));
310 break;
311
312 case kActionExcuseMe:
313 if (getData()->clothes == kClothes1)
314 getSound()->playSound(kEntityPlayer, "ZFX1003", getSound()->getSoundFlag(kEntityCoudert));
315 else
316 getSound()->excuseMe(kEntityCoudert);
317 break;
318
319 case kActionDefault:
320 if (!getProgress().eventCorpseFound && !getEvent(kEventCoudertAskTylerCompartment))
321 params->param3 = kItemInvalid;
322
323 if (getEntities()->updateEntity(kEntityCoudert, (CarIndex)params->param1, (EntityPosition)params->param2))
324 callbackAction();
325 break;
326
327 case kActionCallback:
328 switch (getCallback()) {
329 default:
330 break;
331
332 case 1:
333 getAction()->playAnimation(kEventCoudertBloodJacket);
334 getLogic()->gameOver(kSavegameTypeIndex, 1, kSceneGameOverBloodJacket, true);
335 break;
336
337 case 2:
338 getAction()->playAnimation(kEventCoudertAskTylerCompartment);
339
340 if (getData()->direction != kDirectionUp)
341 getEntities()->loadSceneFromEntityPosition(getData()->car, (EntityPosition)(getData()->entityPosition + 750));
342 else
343 getEntities()->loadSceneFromEntityPosition(getData()->car, (EntityPosition)(getData()->entityPosition - 750), true);
344 break;
345 }
346 break;
347 }
348 IMPLEMENT_FUNCTION_END
349
350 //////////////////////////////////////////////////////////////////////////
351 IMPLEMENT_FUNCTION_I(10, Coudert, updateFromTime, uint32)
352 switch (savepoint.action) {
353 default:
354 break;
355
356 case kActionNone:
357 if (Entity::savegameBloodJacket(1))
358 break;
359
360 if (!Entity::updateParameter(params->param2, getState()->time, params->param1))
361 break;
362
363 callbackAction();
364 break;
365
366 case kActionCallback:
367 if (getCallback() == 1) {
368 getAction()->playAnimation(kEventCoudertBloodJacket);
369 getLogic()->gameOver(kSavegameTypeIndex, 1, kSceneGameOverBloodJacket, true);
370 }
371 break;
372 }
373 IMPLEMENT_FUNCTION_END
374
375 //////////////////////////////////////////////////////////////////////////
376 IMPLEMENT_FUNCTION_I(11, Coudert, updateFromTicks, uint32)
377 switch (savepoint.action) {
378 default:
379 break;
380
381 case kActionNone:
382 if (Entity::savegameBloodJacket(1))
383 break;
384
385 if (!Entity::updateParameter(params->param2, getState()->timeTicks, params->param1))
386 break;
387
388 callbackAction();
389 break;
390
391 case kActionCallback:
392 if (getCallback() == 1) {
393 getAction()->playAnimation(kEventCoudertBloodJacket);
394 getLogic()->gameOver(kSavegameTypeIndex, 1, kSceneGameOverBloodJacket, true);
395 }
396 break;
397 }
398 IMPLEMENT_FUNCTION_END
399
400 //////////////////////////////////////////////////////////////////////////
401 // Parameters
402 // - EntityIndex
403 IMPLEMENT_FUNCTION_I(12, Coudert, excuseMe, EntityIndex)
404 if (savepoint.action != kActionDefault)
405 return;
406
407 if (getSoundQueue()->isBuffered(kEntityCoudert)) {
408 callbackAction();
409 return;
410 }
411
412 if (isNight()) {
413 if (Entities::isFemale((EntityIndex)params->param1)) {
414 getSound()->playSound(kEntityCoudert, Entities::isMarried((EntityIndex)params->param1) ? "JAC1112C" : "JAC1112F");
415 } else {
416 if (!params->param1 && getProgress().field_18 == 2) {
417 switch (rnd(4)) {
418 default:
419 break;
420
421 case 0:
422 getSound()->playSound(kEntityCoudert, "JAC1013");
423 break;
424
425 case 1:
426 getSound()->playSound(kEntityCoudert, "JAC1013A");
427 break;
428
429 case 2:
430 getSound()->playSound(kEntityCoudert, "JAC1113");
431 break;
432
433 case 3:
434 getSound()->playSound(kEntityCoudert, "JAC1113A");
435 break;
436 }
437 } else {
438 getSound()->playSound(kEntityCoudert, "JAC1112D");
439 }
440 }
441 } else {
442 if (Entities::isFemale((EntityIndex)params->param1))
443 getSound()->playSound(kEntityCoudert, Entities::isMarried((EntityIndex)params->param1) ? "JAC1112B" : "JAC1112G");
444 else
445 getSound()->playSound(kEntityCoudert, "JAC1112E");
446 }
447
448 callbackAction();
449 IMPLEMENT_FUNCTION_END
450
451 //////////////////////////////////////////////////////////////////////////
452 IMPLEMENT_FUNCTION_II(13, Coudert, function13, bool, EntityIndex)
453 switch (savepoint.action) {
454 default:
455 break;
456
457 case kActionNone:
458 if (Entity::savegameBloodJacket(3))
459 break;
460
461 if (!params->param2 && !params->param3) {
462
463 if (!params->param4) {
464 params->param4 = getState()->timeTicks + 75;
465
466 if (!params->param4) {
467 getData()->inventoryItem = kItemNone;
468 setCallback(4);
469 setup_function19(true);
470 break;
471 }
472 }
473
474 if (params->param4 < getState()->timeTicks) {
475 params->param4 = kTimeInvalid;
476
477 getData()->inventoryItem = kItemNone;
478 setCallback(4);
479 setup_function19(true);
480 break;
481 }
482 }
483
484 if (!Entity::updateParameter(params->param5, getState()->timeTicks, 225))
485 break;
486
487 getData()->inventoryItem = kItemNone;
488 setCallback(5);
489 setup_function19(true);
490 break;
491
492 case kAction1:
493 getData()->inventoryItem = kItemNone;
494
495 setCallback(9);
496 setup_savegame(kSavegameTypeEvent, kEventCoudertAskTylerCompartment);
497 break;
498
499 case kAction11:
500 ++params->param3;
501
502 setCallback(8);
503 setup_excuseMe(savepoint.entity2);
504 break;
505
506 case kActionDefault:
507 if (params->param2)
508 params->param3 = 1;
509
510 setCallback(1);
511 setup_excuseMe((EntityIndex)params->param2);
512 break;
513
514 case kAction16:
515 --params->param3;
516
517 if (params->param2 && !params->param3) {
518 getData()->inventoryItem = kItemNone;
519 setCallback(7);
520 setup_function19(true);
521 }
522 break;
523
524 case kActionDrawScene:
525 if (!params->param3) {
526 getData()->inventoryItem = kItemNone;
527 setCallback(6);
528 setup_function19(true);
529 }
530 break;
531
532 case kActionCallback:
533 switch (getCallback()) {
534 default:
535 break;
536
537 case 1:
538 setCallback(2);
539 setup_function17(true);
540 break;
541
542 case 2:
543 if (getProgress().chapter == kChapter1 && !getProgress().eventCorpseFound && !getEvent(kEventCoudertAskTylerCompartment))
544 getData()->inventoryItem = kItemInvalid;
545
546 getEntities()->drawSequenceLeft(kEntityCoudert, params->param1 ? "667I" : "667H");
547 break;
548
549 case 3:
550 getAction()->playAnimation(kEventCoudertBloodJacket);
551 getLogic()->gameOver(kSavegameTypeIndex, 1, kSceneGameOverBloodJacket, true);
552 // BUG: the original game continues executing code here
553 break;
554
555 case 4:
556 case 5:
557 case 6:
558 case 7:
559 callbackAction();
560 break;
561
562 case 9:
563 getAction()->playAnimation(kEventCoudertAskTylerCompartment);
564 getScenes()->loadSceneFromPosition(kCarRedSleeping, 25);
565 break;
566 }
567 break;
568
569 case kAction201439712:
570 getEntities()->drawSequenceLeft(kEntityCoudert, "627K");
571 break;
572 }
573 IMPLEMENT_FUNCTION_END
574
575 //////////////////////////////////////////////////////////////////////////
576 IMPLEMENT_FUNCTION_I(14, Coudert, function14, EntityIndex)
577 switch (savepoint.action) {
578 default:
579 break;
580
581 case kActionNone:
582 Entity::savegameBloodJacket(4);
583 break;
584
585 case kActionDefault:
586 if (ENTITY_PARAM(2, 1)) {
587 ENTITY_PARAM(2, 1) = 0;
588
589 setCallback(3);
590 setup_updateEntity(kCarRedSleeping, kPosition_1500);
591 } else {
592 setCallback(1);
593 setup_updateFromTime(15);
594 }
595 break;
596
597 case kActionCallback:
598 switch (getCallback()) {
599 default:
600 break;
601
602 case 1:
603 getSavePoints()->push(kEntityCoudert, (EntityIndex)params->param1, kAction202558662);
604
605 setCallback(2);
606 setup_function17(false);
607 break;
608
609 case 2:
610 getSavePoints()->push(kEntityCoudert, (EntityIndex)params->param1, kAction155853632);
611 getEntities()->drawSequenceLeft(kEntityCoudert, "627K");
612 break;
613
614 case 3:
615 getSavePoints()->push(kEntityCoudert, (EntityIndex)params->param1, kAction202558662);
616 getSavePoints()->push(kEntityCoudert, (EntityIndex)params->param1, kAction155853632);
617 getEntities()->drawSequenceLeft(kEntityCoudert, "627K");
618 getScenes()->loadSceneFromItemPosition(kItem5);
619 break;
620
621 case 4:
622 getAction()->playAnimation(kEventCoudertBloodJacket);
623 getLogic()->gameOver(kSavegameTypeIndex, 1, kSceneGameOverBloodJacket, true);
624 break;
625
626 case 5:
627 callbackAction();
628 break;
629 }
630 break;
631
632 case kAction125499160:
633 switch (params->param1) {
634 default:
635 break;
636
637 case kEntityVerges:
638 ENTITY_PARAM(0, 3) = 0;
639 break;
640
641 case kEntityMmeBoutarel:
642 ENTITY_PARAM(0, 4) = 0;
643 break;
644
645 case kEntityMertens:
646 ENTITY_PARAM(0, 5) = 0;
647 break;
648 }
649
650 setCallback(5);
651 setup_function19(false);
652 break;
653 }
654 IMPLEMENT_FUNCTION_END
655
656 //////////////////////////////////////////////////////////////////////////
657 IMPLEMENT_FUNCTION_I(15, Coudert, function15, bool)
658 switch (savepoint.action) {
659 default:
660 break;
661
662 case kActionDefault:
663 ENTITY_PARAM(0, 8) = 0;
664 ENTITY_PARAM(1, 1) = 0;
665
666 setCallback(1);
667 setup_function16();
668 break;
669
670 case kActionCallback:
671 switch (getCallback()) {
672 default:
673 break;
674
675 case 1:
676 setCallback(2);
677 setup_updateEntity(kCarRedSleeping, kPosition_7500);
678 break;
679
680 case 2:
681 if (params->param1)
682 getSound()->playSound(kEntityCoudert, "Tat3163");
683 else
684 getSound()->playSound(kEntityCoudert, (getProgress().chapter != kChapter3 || getState()->time >= kTime1449000) ? "Tat3162A" : "Tat3161A");
685
686 setCallback(3);
687 setup_enterExitCompartment("627Xb", kObjectCompartmentB);
688 break;
689
690 case 3:
691 getSavePoints()->push(kEntityCoudert, kEntityTatiana, kAction69239528);
692 getData()->entityPosition = kPosition_7250;
693
694 setCallback(4);
695 setup_updateEntity(kCarRedSleeping, kPosition_2000);
696 break;
697
698 case 4:
699 setCallback(5);
700 setup_function18();
701 break;
702
703 case 5:
704 callbackAction();
705 break;
706 }
707 break;
708 }
709 IMPLEMENT_FUNCTION_END
710
711 //////////////////////////////////////////////////////////////////////////
712 IMPLEMENT_FUNCTION(16, Coudert, function16)
713 switch (savepoint.action) {
714 default:
715 break;
716
717 case kActionDefault:
718 if (ENTITY_PARAM(2, 1)) {
719 ENTITY_PARAM(2, 1) = 0;
720 getInventory()->setLocationAndProcess(kItem5, kObjectLocation1);
721
722 callbackAction();
723 break;
724 }
725
726 setCallback(ENTITY_PARAM(0, 2) ? 1 : 2);
727 setup_bloodJacket(ENTITY_PARAM(0, 2) ? "627C" : "627F");
728 break;
729
730 case kActionCallback:
731 switch (getCallback()) {
732 default:
733 break;
734
735 case 1:
736 case 2:
737 getInventory()->setLocationAndProcess(kItem5, kObjectLocation1);
738 if (!getEntities()->isPlayerPosition(kCarRedSleeping, 2))
739 getData()->entityPosition = kPosition_2088;
740
741 callbackAction();
742 break;
743 }
744 break;
745 }
746 IMPLEMENT_FUNCTION_END
747
748 //////////////////////////////////////////////////////////////////////////
749 IMPLEMENT_FUNCTION_I(17, Coudert, function17, bool)
750 switch (savepoint.action) {
751 default:
752 break;
753
754 case kActionDefault:
755 getScenes()->loadSceneFromItemPosition(kItem5);
756
757 if (ENTITY_PARAM(2, 1)) {
758 ENTITY_PARAM(2, 1) = 0;
759 callbackAction();
760 break;
761 }
762
763 if (params->param1) {
764 setCallback(1);
765 setup_bloodJacket("627H");
766 break;
767 }
768
769 if (ENTITY_PARAM(0, 2)) {
770 setCallback(2);
771 setup_bloodJacket("627C");
772 break;
773 }
774
775 setCallback(3);
776 setup_bloodJacket("627F");
777 break;
778
779 case kActionCallback:
780 switch (getCallback()) {
781 default:
782 break;
783
784 case 1:
785 case 2:
786 case 3:
787 callbackAction();
788 break;
789 }
790 break;
791 }
792 IMPLEMENT_FUNCTION_END
793
794 //////////////////////////////////////////////////////////////////////////
795 IMPLEMENT_FUNCTION(18, Coudert, function18)
796 switch (savepoint.action) {
797 default:
798 break;
799
800 case kActionDefault:
801 if (ENTITY_PARAM(0, 6) || ENTITY_PARAM(0, 8)
802 || ENTITY_PARAM(1, 1) || ENTITY_PARAM(1, 2) || ENTITY_PARAM(1, 3) || ENTITY_PARAM(1, 5) || ENTITY_PARAM(1, 6) || ENTITY_PARAM(1, 7) || ENTITY_PARAM(1, 8)
803 || ENTITY_PARAM(2, 4) || ENTITY_PARAM(2, 6)) {
804 getInventory()->setLocationAndProcess(kItem5, kObjectLocation1);
805
806 setCallback(1);
807 setup_updateEntity(kCarRedSleeping, kPosition_540);
808 break;
809 }
810
811 if (ENTITY_PARAM(0, 3) || ENTITY_PARAM(0, 5) || ENTITY_PARAM(0, 4)) {
812 getEntities()->drawSequenceLeft(kEntityCoudert, "627K");
813 getScenes()->loadSceneFromItemPosition(kItem5);
814 ENTITY_PARAM(2, 1) = 1;
815
816 callbackAction();
817 break;
818 }
819
820 getEntities()->drawSequenceRight(kEntityCoudert, ENTITY_PARAM(0, 2) ? "627A" : "627D");
821 getScenes()->loadSceneFromItemPosition(kItem5);
822
823 if (getEntities()->isPlayerPosition(kCarRedSleeping, 68)) {
824 if (!getSoundQueue()->isBuffered(kEntityCoudert))
825 getSound()->playSound(kEntityCoudert, "JAC1111");
826
827 getScenes()->loadSceneFromPosition(kCarRedSleeping, 25);
828 }
829
830 setCallback(3);
831 setup_callbackActionOnDirection();
832 break;
833
834 case kActionCallback:
835 switch (getCallback()) {
836 default:
837 break;
838
839 case 1:
840 getEntities()->clearSequences(kEntityCoudert);
841 ENTITY_PARAM(2, 1) = 1;
842
843 setCallback(2);
844 setup_updateFromTime(75);
845 break;
846
847 case 2:
848 callbackAction();
849 break;
850
851 case 3:
852 getEntities()->drawSequenceLeft(kEntityCoudert, ENTITY_PARAM(0, 2) ? "627B" : "627E");
853 ENTITY_PARAM(0, 1) = 0;
854 getSavePoints()->push(kEntityCoudert, kEntityCoudert, kActionDrawScene);
855
856 callbackAction();
857 break;
858 }
859 break;
860 }
861 IMPLEMENT_FUNCTION_END
862
863 //////////////////////////////////////////////////////////////////////////
864 IMPLEMENT_FUNCTION_I(19, Coudert, function19, bool)
865 switch (savepoint.action) {
866 default:
867 break;
868
869 case kActionDefault:
870 if (ENTITY_PARAM(0, 6) || ENTITY_PARAM(0, 8)
871 || ENTITY_PARAM(1, 1) || ENTITY_PARAM(1, 2) || ENTITY_PARAM(1, 3) || ENTITY_PARAM(1, 5) || ENTITY_PARAM(1, 6) || ENTITY_PARAM(1, 7) || ENTITY_PARAM(1, 8)
872 || ENTITY_PARAM(2, 4) || ENTITY_PARAM(2, 6)) {
873 getInventory()->setLocationAndProcess(kItem5, kObjectLocation1);
874 ENTITY_PARAM(2, 1) = 1;
875 callbackAction();
876 break;
877 }
878
879 if (ENTITY_PARAM(0, 3) || ENTITY_PARAM(0, 5) || ENTITY_PARAM(0, 4)) {
880 getScenes()->loadSceneFromItemPosition(kItem5);
881 ENTITY_PARAM(2, 1) = 1;
882 callbackAction();
883 break;
884 }
885
886 if (params->param1)
887 getEntities()->drawSequenceRight(kEntityCoudert, "697H");
888 else
889 getEntities()->drawSequenceRight(kEntityCoudert, ENTITY_PARAM(0, 2) ? "627A" : "627D");
890
891 getScenes()->loadSceneFromItemPosition(kItem5);
892
893 setCallback(1);
894 setup_callbackActionOnDirection();
895 break;
896
897 case kActionCallback:
898 if (getCallback() == 1) {
899 getEntities()->drawSequenceLeft(kEntityCoudert, ENTITY_PARAM(0, 2) ? "627B" : "627E");
900 ENTITY_PARAM(0, 1) = 0;
901
902 callbackAction();
903 }
904 break;
905 }
906 IMPLEMENT_FUNCTION_END
907
908 //////////////////////////////////////////////////////////////////////////
909 IMPLEMENT_FUNCTION_II(20, Coudert, function20, ObjectIndex, ObjectIndex)
910 switch (savepoint.action) {
911 default:
912 break;
913
914 case kActionNone:
915 if (Entity::updateParameter(CURRENT_PARAM(1, 3), getState()->time, 300)) {
916 getSound()->playSound(kEntityPlayer, "ZFX1004", getSound()->getSoundFlag(kEntityCoudert));
917 }
918
919 if (!Entity::updateParameter(CURRENT_PARAM(1, 4), getState()->time, 900))
920 break;
921
922 getObjects()->updateModel((ObjectIndex) params->param1, kObjectModel1);
923
924 if (params->param4 != kObjectLocation2)
925 getObjects()->update((ObjectIndex)params->param1, (EntityIndex)params->param3, (ObjectLocation)params->param4, (CursorStyle)params->param5, (CursorStyle)params->param6);
926
927 if (params->param2)
928 getObjects()->update((ObjectIndex)params->param2, (EntityIndex)params->param7, (ObjectLocation)params->param8, (CursorStyle)CURRENT_PARAM(1, 1), (CursorStyle)CURRENT_PARAM(1, 2));
929
930 callbackAction();
931 break;
932
933 case kActionKnock:
934 case kActionOpenDoor:
935 getObjects()->update((ObjectIndex)params->param1, kEntityCoudert, kObjectLocation1, kCursorNormal, kCursorNormal);
936 if (params->param2)
937 getObjects()->update((ObjectIndex)params->param2, kEntityCoudert, kObjectLocation1, kCursorNormal, kCursorNormal);
938
939 setCallback(savepoint.action == kActionKnock ? 1 : 2);
940 setup_playSound(savepoint.action == kActionKnock ? "LIB012" : "LIB013");
941 break;
942
943 case kActionDefault:
944 params->param3 = getObjects()->get((ObjectIndex)params->param1).entity;
945 params->param4 = getObjects()->get((ObjectIndex)params->param1).status;
946 params->param5 = getObjects()->get((ObjectIndex)params->param1).windowCursor;
947 params->param6 = getObjects()->get((ObjectIndex)params->param1).handleCursor;
948
949 if (params->param2) {
950 params->param7 = getObjects()->get((ObjectIndex)params->param2).entity;
951 params->param8 = getObjects()->get((ObjectIndex)params->param2).status;
952 CURRENT_PARAM(1, 1) = getObjects()->get((ObjectIndex)params->param2).windowCursor;
953 CURRENT_PARAM(1, 2) = getObjects()->get((ObjectIndex)params->param2).handleCursor;
954
955 getObjects()->update((ObjectIndex)params->param2, kEntityCoudert, kObjectLocation1, kCursorHandKnock, kCursorHand);
956 }
957
958 if (params->param4 != kObjectLocation2)
959 getObjects()->update((ObjectIndex)params->param1, kEntityCoudert, kObjectLocation1, kCursorHandKnock, kCursorHand);
960 break;
961
962 case kActionCallback:
963 switch (getCallback()) {
964 default:
965 break;
966
967 case 1:
968 case 2:
969 if (params->param1 == kObjectCompartmentA || params->param1 == kObjectCompartmentC
970 || params->param1 == kObjectCompartmentG || params->param1 == kObjectCompartmentH) {
971 setCallback(3);
972 setup_playSound("Jac1001B");
973 } else {
974 setCallback(4);
975 setup_playSound("Jac1001A");
976 }
977 break;
978
979 case 3:
980 case 4:
981 getObjects()->update((ObjectIndex)params->param1, kEntityCoudert, kObjectLocation1, kCursorHandKnock, kCursorHand);
982
983 if (params->param2)
984 getObjects()->update((ObjectIndex)params->param2, kEntityCoudert, kObjectLocation1, kCursorHandKnock, kCursorHand);
985 break;
986 }
987 break;
988 }
989 IMPLEMENT_FUNCTION_END
990
991 //////////////////////////////////////////////////////////////////////////
992 IMPLEMENT_FUNCTION(21, Coudert, function21)
993 switch (savepoint.action) {
994 default:
995 break;
996
997 case kActionNone:
998 if (!params->param1) {
999 if (!Entity::updateParameter(params->param2, getState()->timeTicks, 75))
1000 break;
1001
1002 setCallback(3);
1003 setup_enterExitCompartment("627Zh", kObjectCompartmentH);
1004 }
1005 break;
1006
1007 case kActionDefault:
1008 setCallback(1);
1009 setup_updateEntity(kCarRedSleeping, kPosition_2740);
1010 break;
1011
1012 case kActionCallback:
1013 switch (getCallback()) {
1014 default:
1015 break;
1016
1017 case 1:
1018 setCallback(2);
1019 setup_enterExitCompartment("627Vh", kObjectCompartmentH);
1020 break;
1021
1022 case 2:
1023 getSavePoints()->push(kEntityCoudert, kEntityIvo, kAction221683008);
1024 getEntities()->drawSequenceLeft(kEntityCoudert, "627Wh");
1025 getEntities()->enterCompartment(kEntityCoudert, kObjectCompartmentH, true);
1026 break;
1027
1028 case 3:
1029 getEntities()->exitCompartment(kEntityCoudert, kObjectCompartmentH, true);
1030 getData()->location = kLocationInsideCompartment;
1031 getEntities()->clearSequences(kEntityCoudert);
1032
1033 setCallback(4);
1034 setup_function20(kObjectCompartmentH, kObjectNone);
1035 break;
1036
1037 case 4:
1038 setCallback(5);
1039 setup_enterExitCompartment("697Ah", kObjectCompartmentH);
1040 break;
1041
1042 case 5:
1043 getData()->location = kLocationOutsideCompartment;
1044
1045 callbackAction();
1046 break;
1047
1048 case 6:
1049 getSavePoints()->push(kEntityCoudert, kEntityIvo, kAction122865568);
1050 break;
1051
1052 case 7:
1053 getEntities()->exitCompartment(kEntityCoudert, kObjectCompartmentH, true);
1054 getObjects()->update(kObjectCompartmentH, kEntityPlayer, kObjectLocation2, kCursorKeepValue, kCursorKeepValue);
1055 getData()->location = kLocationInsideCompartment;
1056 getEntities()->clearSequences(kEntityCoudert);
1057
1058 setCallback(8);
1059 setup_function20(kObjectCompartmentH, kObjectNone);
1060 break;
1061
1062 case 8:
1063 getSound()->playSound(kEntityCoudert, "JAC1013A");
1064 getObjects()->update(kObjectCompartmentH, kEntityPlayer, kObjectLocation1, kCursorKeepValue, kCursorKeepValue);
1065
1066 setCallback(9);
1067 setup_enterExitCompartment("667Uh", kObjectCompartmentH);
1068 break;
1069
1070 case 9:
1071 getData()->location = kLocationOutsideCompartment;
1072 getSavePoints()->push(kEntityCoudert, kEntityIvo, kAction123852928);
1073
1074 callbackAction();
1075 break;
1076 }
1077 break;
1078
1079 case kAction88652208:
1080 setCallback(7);
1081 setup_enterExitCompartment("667Th", kObjectCompartmentH);
1082 break;
1083
1084 case kAction123199584:
1085 params->param1 = 1;
1086
1087 setCallback(6);
1088 setup_playSound("JAC1012");
1089 break;
1090 }
1091 IMPLEMENT_FUNCTION_END
1092
1093 //////////////////////////////////////////////////////////////////////////
1094 IMPLEMENT_FUNCTION(22, Coudert, function22)
1095 switch (savepoint.action) {
1096 default:
1097 break;
1098
1099 case kActionNone:
1100 if (!params->param1) {
1101 if (!Entity::updateParameter(params->param2, getState()->timeTicks, 75))
1102 break;
1103
1104 setCallback(3);
1105 setup_enterExitCompartment("627Rg", kObjectCompartmentG);
1106 }
1107 break;
1108
1109 case kActionDefault:
1110 setCallback(1);
1111 setup_updateEntity(kCarRedSleeping, kPosition_3050);
1112 break;
1113
1114 case kActionCallback:
1115 switch (getCallback()) {
1116 default:
1117 break;
1118
1119 case 1:
1120 setCallback(2);
1121 setup_enterExitCompartment("627Mg", kObjectCompartmentG);
1122 break;
1123
1124 case 2:
1125 getSavePoints()->push(kEntityCoudert, kEntityMilos, kAction221683008);
1126 getEntities()->drawSequenceLeft(kEntityCoudert, "627Ng");
1127 getEntities()->enterCompartment(kEntityCoudert, kObjectCompartmentG, true);
1128 break;
1129
1130 case 3:
1131 getEntities()->exitCompartment(kEntityCoudert, kObjectCompartmentG, true);
1132 getData()->location = kLocationInsideCompartment;
1133 getEntities()->clearSequences(kEntityCoudert);
1134
1135 setCallback(4);
1136 setup_function20(kObjectCompartmentG, kObjectNone);
1137 break;
1138
1139 case 4:
1140 setCallback(5);
1141 setup_enterExitCompartment("627Sg", kObjectCompartmentG);
1142 break;
1143
1144 case 5:
1145 getData()->location = kLocationOutsideCompartment;
1146
1147 callbackAction();
1148 break;
1149
1150 case 6:
1151 getSavePoints()->push(kEntityCoudert, kEntityMilos, kAction122865568);
1152 break;
1153
1154 case 7:
1155 getEntities()->exitCompartment(kEntityCoudert, kObjectCompartmentG, true);
1156 getObjects()->update(kObjectCompartmentG, kEntityPlayer, kObjectLocation2, kCursorKeepValue, kCursorKeepValue);
1157 getData()->location = kLocationInsideCompartment;
1158 getEntities()->clearSequences(kEntityCoudert);
1159
1160 setCallback(8);
1161 setup_function20(kObjectCompartmentG, kObjectNone);
1162 break;
1163
1164 case 8:
1165 getSound()->playSound(kEntityCoudert, "JAC1030A");
1166 getObjects()->update(kObjectCompartmentG, kEntityPlayer, kObjectLocation1, kCursorKeepValue, kCursorKeepValue);
1167
1168 setCallback(9);
1169 setup_enterExitCompartment("627Ug", kObjectCompartmentG);
1170 break;
1171
1172 case 9:
1173 getData()->location = kLocationOutsideCompartment;
1174 getSavePoints()->push(kEntityCoudert, kEntityMilos, kAction123852928);
1175
1176 callbackAction();
1177 break;
1178 }
1179 break;
1180
1181 case kAction88652208:
1182 setCallback(7);
1183 setup_enterExitCompartment("627Tg", kObjectCompartmentG);
1184 break;
1185
1186 case kAction123199584:
1187 params->param1 = 1;
1188
1189 setCallback(6);
1190 setup_playSound("JAC1030");
1191 break;
1192 }
1193 IMPLEMENT_FUNCTION_END
1194
1195 //////////////////////////////////////////////////////////////////////////
1196 IMPLEMENT_FUNCTION(23, Coudert, function23)
1197 switch (savepoint.action) {
1198 default:
1199 break;
1200
1201 case kActionDefault:
1202 setCallback(1);
1203 setup_updateEntity(kCarRedSleeping, kPosition_4070);
1204 break;
1205
1206 case kActionCallback:
1207 switch (getCallback()) {
1208 default:
1209 break;
1210
1211 case 1:
1212 setCallback(2);
1213 setup_enterExitCompartment("627Vf", kObjectCompartmentF);
1214 break;
1215
1216 case 2:
1217 getEntities()->drawSequenceLeft(kEntityCoudert, "627Wf");
1218 getEntities()->enterCompartment(kEntityCoudert, kObjectCompartmentF, true);
1219 getSavePoints()->push(kEntityCoudert, kEntityMax, kAction158007856);
1220
1221 setCallback(3);
1222 setup_updateFromTime(150);
1223 break;
1224
1225 case 3:
1226 getEntities()->exitCompartment(kEntityCoudert, kObjectCompartmentF, true);
1227 callbackAction();
1228 break;
1229 }
1230 break;
1231 }
1232 IMPLEMENT_FUNCTION_END
1233
1234 //////////////////////////////////////////////////////////////////////////
1235 IMPLEMENT_FUNCTION(24, Coudert, visitCompartmentF)
1236 visitCompartment(savepoint, kPosition_4070, "627Vf", kObjectCompartmentF, "627Wf", "627Zf", kPosition_4455, kObject53, "697Af");
1237 IMPLEMENT_FUNCTION_END
1238
1239 //////////////////////////////////////////////////////////////////////////
1240 IMPLEMENT_FUNCTION(25, Coudert, function25)
1241 switch (savepoint.action) {
1242 default:
1243 break;
1244
1245 case kActionDefault:
1246 setCallback(1);
1247 setup_updateEntity(kCarRedSleeping, kPosition_4840);
1248 break;
1249
1250 case kActionCallback:
1251 switch (getCallback()) {
1252 default:
1253 break;
1254
1255 case 1:
1256 setCallback(2);
1257 setup_enterExitCompartment("627Me", kObjectCompartmentE);
1258 break;
1259
1260 case 2:
1261 getEntities()->drawSequenceLeft(kEntityCoudert, "627Ne");
1262 getEntities()->enterCompartment(kEntityCoudert, kObjectCompartmentE, true);
1263
1264 setCallback(3);
1265 setup_updateFromTime(45);
1266 break;
1267
1268 case 3:
1269 getSavePoints()->push(kEntityCoudert, kEntityRebecca, kAction254915200);
1270
1271 setCallback(4);
1272 setup_updateFromTime(450);
1273 break;
1274
1275 case 4:
1276 setCallback(5);
1277 setup_enterExitCompartment2("627Re", kObjectCompartmentE, kPosition_4840, kPosition_4455);
1278 break;
1279
1280 case 5:
1281 getEntities()->exitCompartment(kEntityCoudert, kObjectCompartmentE, true);
1282 getData()->location = kLocationInsideCompartment;
1283 getEntities()->clearSequences(kEntityCoudert);
1284
1285 setCallback(6);
1286 setup_function20(kObjectCompartmentE, kObject52);
1287 break;
1288
1289 case 6:
1290 setCallback(7);
1291 setup_enterExitCompartment("627Se", kObjectCompartmentE);
1292 break;
1293
1294 case 7:
1295 getData()->location = kLocationOutsideCompartment;
1296 getSavePoints()->push(kEntityCoudert, kEntityRebecca, kAction123852928);
1297
1298 callbackAction();
1299 break;
1300 }
1301 break;
1302 }
1303 IMPLEMENT_FUNCTION_END
1304
1305 //////////////////////////////////////////////////////////////////////////
1306 IMPLEMENT_FUNCTION(26, Coudert, function26)
1307 switch (savepoint.action) {
1308 default:
1309 break;
1310
1311 case kActionNone:
1312 if (!params->param1) {
1313 if (!Entity::updateParameter(params->param2, getState()->timeTicks, 75))
1314 break;
1315
1316 setCallback(3);
1317 setup_enterExitCompartment2("627Zd", kObjectCompartmentD, kPosition_5790, kPosition_6130);
1318 }
1319 break;
1320
1321 case kActionDefault:
1322 setCallback(1);
1323 setup_updateEntity(kCarRedSleeping, kPosition_5790);
1324 break;
1325
1326 case kActionCallback:
1327 switch (getCallback()) {
1328 default:
1329 break;
1330
1331 case 1:
1332 setCallback(2);
1333 setup_enterExitCompartment("627Vd", kObjectCompartmentD);
1334 break;
1335
1336 case 2:
1337 getSavePoints()->push(kEntityCoudert, kEntityMmeBoutarel, kAction221683008);
1338 getEntities()->drawSequenceLeft(kEntityCoudert, "627Wd");
1339 getEntities()->enterCompartment(kEntityCoudert, kObjectCompartmentD, true);
1340 break;
1341
1342 case 3:
1343 case 7:
1344 getEntities()->exitCompartment(kEntityCoudert, kObjectCompartmentD, true);
1345 getData()->location = kLocationInsideCompartment;
1346 getEntities()->clearSequences(kEntityCoudert);
1347
1348 setCallback(getCallback() + 1);
1349 setup_function20(kObjectCompartmentD, kObject51);
1350 break;
1351
1352 case 4:
1353 setCallback(5);
1354 setup_enterExitCompartment("697Ad", kObjectCompartmentD);
1355 break;
1356
1357 case 5:
1358 getData()->location = kLocationOutsideCompartment;
1359
1360 callbackAction();
1361 break;
1362
1363 case 6:
1364 getSavePoints()->push(kEntityCoudert, kEntityMmeBoutarel, kAction122865568);
1365 break;
1366
1367 case 8:
1368 getSound()->playSound(kEntityCoudert, "JAC1013");
1369
1370 setCallback(9);
1371 setup_enterExitCompartment("697Ad", kObjectCompartmentD);
1372 break;
1373
1374 case 9:
1375 getData()->location = kLocationOutsideCompartment;
1376 getSavePoints()->push(kEntityCoudert, kEntityMmeBoutarel, kAction123852928);
1377
1378 callbackAction();
1379 break;
1380 }
1381 break;
1382
1383 case kAction88652208:
1384 setCallback(7);
1385 setup_enterExitCompartment2("627Zd", kObjectCompartmentD, kPosition_5790, kPosition_6130);
1386 break;
1387
1388 case kAction123199584:
1389 params->param1 = 1;
1390
1391 setCallback(6);
1392 setup_playSound("JAC1012");
1393 break;
1394 }
1395 IMPLEMENT_FUNCTION_END
1396
1397 //////////////////////////////////////////////////////////////////////////
1398 IMPLEMENT_FUNCTION(27, Coudert, function27)
1399 switch (savepoint.action) {
1400 default:
1401 break;
1402
1403 case kActionNone:
1404 if (!params->param1) {
1405 if (!Entity::updateParameter(params->param2, getState()->timeTicks, 75))
1406 break;
1407
1408 setCallback(3);
1409 setup_enterExitCompartment2("627Rc", kObjectCompartmentC, kPosition_6470, kPosition_6130);
1410 }
1411 break;
1412
1413 case kActionDefault:
1414 setCallback(1);
1415 setup_updateEntity(kCarRedSleeping, kPosition_6470);
1416 break;
1417
1418 case kActionCallback:
1419 switch (getCallback()) {
1420 default:
1421 break;
1422
1423 case 1:
1424 setCallback(2);
1425 setup_enterExitCompartment("627Mc", kObjectCompartmentC);
1426 break;
1427
1428 case 2:
1429 getSavePoints()->push(kEntityCoudert, kEntityBoutarel, kAction221683008);
1430 getEntities()->drawSequenceLeft(kEntityCoudert, "627Nc");
1431 getEntities()->enterCompartment(kEntityCoudert, kObjectCompartmentC, true);
1432 break;
1433
1434 case 3:
1435 getEntities()->exitCompartment(kEntityCoudert, kObjectCompartmentC, true);
1436 getData()->location = kLocationInsideCompartment;
1437 getEntities()->clearSequences(kEntityCoudert);
1438
1439 setCallback(4);
1440 setup_function20(kObjectCompartmentC, kObject50);
1441 break;
1442
1443 case 4:
1444 setCallback(5);
1445 setup_enterExitCompartment("627Sc", kObjectCompartmentC);
1446 break;
1447
1448 case 5:
1449 getData()->location = kLocationOutsideCompartment;
1450 callbackAction();
1451 break;
1452
1453 case 6:
1454 getSavePoints()->push(kEntityCoudert, kEntityBoutarel, kAction122865568);
1455 break;
1456
1457 case 7:
1458 getEntities()->exitCompartment(kEntityCoudert, kObjectCompartmentC, true);
1459 getData()->location = kLocationInsideCompartment;
1460 getEntities()->clearSequences(kEntityCoudert);
1461
1462 setCallback(8);
1463 setup_function20(kObjectCompartmentC, kObject50);
1464 break;
1465
1466 case 8:
1467 getSound()->playSound(kEntityCoudert, "JAC1013");
1468
1469 setCallback(9);
1470 setup_enterExitCompartment("627Uc", kObjectCompartmentC);
1471 break;
1472
1473 case 9:
1474 getData()->location = kLocationOutsideCompartment;
1475 getSavePoints()->push(kEntityCoudert, kEntityBoutarel, kAction123852928);
1476
1477 callbackAction();
1478 break;
1479 }
1480 break;
1481
1482 case kAction88652208:
1483 setCallback(7);
1484 setup_enterExitCompartment2("627Rc", kObjectCompartmentC, kPosition_6470, kPosition_6130);
1485 break;
1486
1487 case kAction123199584:
1488 params->param1 = 1;
1489
1490 setCallback(6);
1491 setup_playSound("JAC1012");
1492 break;
1493 }
1494 IMPLEMENT_FUNCTION_END
1495
1496 //////////////////////////////////////////////////////////////////////////
1497 IMPLEMENT_FUNCTION(28, Coudert, visitCompartmentB)
1498 visitCompartment(savepoint, kPosition_7500, "627Vb", kObjectCompartmentB, "627Wb", "627Zb", kPosition_7850, kObject49, "697Ab");
1499 IMPLEMENT_FUNCTION_END
1500
1501 //////////////////////////////////////////////////////////////////////////
1502 IMPLEMENT_FUNCTION(29, Coudert, visitCompartmentA)
1503 visitCompartment(savepoint, kPosition_8200, "627Ma", kObjectCompartmentA, "627Na", "627Ra", kPosition_7850, kObject48, "627Sa");
1504 IMPLEMENT_FUNCTION_END
1505
1506 //////////////////////////////////////////////////////////////////////////
1507 IMPLEMENT_FUNCTION_I(30, Coudert, function30, ObjectIndex)
1508 // Expose parameters as IIIIIS and ignore the default exposed parameters
1509 EntityData::EntityParametersI5S *parameters = (EntityData::EntityParametersI5S*)_data->getCurrentParameters();
1510 EntityData::EntityParametersSIIS *parameters1 = (EntityData::EntityParametersSIIS*)_data->getCurrentParameters(1);
1511
1512 switch (savepoint.action) {
1513 default:
1514 break;
1515
1516 case kActionDefault:
1517 switch (parameters->param1) {
1518 default:
1519 callbackAction();
1520 // Stop processing here
1521 return;
1522
1523 case kObjectCompartmentA:
1524 parameters->param2 = kPosition_8200;
1525 parameters->param3 = kPosition_7850;
1526 strcpy((char *)¶meters->seq, "627Ma");
1527 strcpy((char *)¶meters1->seq1, "627Na");
1528 break;
1529
1530 case kObjectCompartmentB:
1531 parameters->param2 = kPosition_7500;
1532 parameters->param3 = kPosition_7850;
1533 parameters->param4 = true;
1534 strcpy((char *)¶meters->seq, "627Vb");
1535 strcpy((char *)¶meters1->seq1, "627Wb");
1536 break;
1537
1538 case kObjectCompartmentC:
1539 parameters->param2 = kPosition_6470;
1540 parameters->param3 = kPosition_6130;
1541 strcpy((char *)¶meters->seq, "627Mc");
1542 strcpy((char *)¶meters1->seq1, "627Nc");
1543 break;
1544
1545 case kObjectCompartmentD:
1546 parameters->param2 = kPosition_5790;
1547 parameters->param3 = kPosition_6130;
1548 parameters->param4 = true;
1549 strcpy((char *)¶meters->seq, "627Vd");
1550 strcpy((char *)¶meters1->seq1, "627Wd");
1551 break;
1552
1553 case kObjectCompartmentE:
1554 parameters->param2 = kPosition_4840;
1555 parameters->param3 = kPosition_4455;
1556 parameters->param4 = true;
1557 strcpy((char *)¶meters->seq, "627Me");
1558 strcpy((char *)¶meters1->seq1, "627Ne");
1559 break;
1560
1561 case kObjectCompartmentF:
1562 parameters->param2 = kPosition_4070;
1563 parameters->param3 = kPosition_4455;
1564 parameters->param4 = true;
1565 strcpy((char *)¶meters->seq, "627Vf");
1566 strcpy((char *)¶meters1->seq1, "627Wf");
1567 break;
1568 }
1569
1570 setCallback(1);
1571 setup_function16();
1572 break;
1573
1574 case kActionCallback:
1575 switch (getCallback()) {
1576 default:
1577 break;
1578
1579 case 1:
1580 setCallback(2);
1581 setup_updateEntity(kCarRedSleeping, (EntityPosition)parameters->param2);
1582 break;
1583
1584 case 2:
1585 if (getEntities()->checkFields19(kEntityPlayer, kCarRedSleeping, (EntityPosition)parameters->param3)
1586 || ((parameters->param1 == kObjectCompartmentE || parameters->param1 == kObjectCompartmentF) && getEntities()->isOutsideAnnaWindow())) {
1587 getObjects()->update((ObjectIndex)parameters->param1, kEntityPlayer, getObjects()->get((ObjectIndex)parameters->param1).status, kCursorNormal, kCursorNormal);
1588 parameters->param5 = true;
1589 }
1590
1591 setCallback(3);
1592 setup_enterExitCompartment((char *)¶meters->seq, (ObjectIndex)parameters->param1);
1593 break;
1594
1595 case 3:
1596 getEntities()->drawSequenceLeft(kEntityCoudert, (char *)¶meters1->seq1);
1597 getEntities()->enterCompartment(kEntityCoudert, (ObjectIndex)parameters->param1, true);
1598
1599 setCallback(4);
1600 setup_playSound(parameters->param4 ? "JAC3020" : "JAC3021");
1601 break;
1602
1603 case 4:
1604 if (parameters->param5)
1605 getObjects()->update((ObjectIndex)parameters->param1, kEntityPlayer, getObjects()->get((ObjectIndex)parameters->param1).status, kCursorHandKnock, kCursorHand);
1606
1607 getEntities()->exitCompartment(kEntityCoudert, (ObjectIndex)parameters->param1, true);
1608
1609 setCallback(5);
1610 setup_updateEntity(kCarRedSleeping, kPosition_2000);
1611 break;
1612
1613 case 5:
1614 setCallback(6);
1615 setup_function18();
1616 break;
1617
1618 case 6:
1619 callbackAction();
1620 break;
1621 }
1622 break;
1623 }
1624 IMPLEMENT_FUNCTION_END
1625
1626 //////////////////////////////////////////////////////////////////////////
1627 IMPLEMENT_FUNCTION_I(31, Coudert, function31, uint32)
1628 switch (savepoint.action) {
1629 default:
1630 break;
1631
1632 case kActionEndSound:
1633 setCallback(3);
1634 setup_function19(true);
1635 break;
1636
1637 case kActionDefault:
1638 setCallback(1);
1639 setup_bloodJacket("627G");
1640 break;
1641
1642 case kActionCallback:
1643 switch (getCallback()) {
1644 default:
1645 break;
1646
1647 case 1:
1648 if (getSoundQueue()->isBuffered(kEntityCoudert)) {
1649 getEntities()->drawSequenceLeft(kEntityCoudert, "627K");
1650 } else {
1651 setCallback(2);
1652 setup_function19(true);
1653 }
1654 break;
1655
1656 case 2:
1657 case 3:
1658 callbackAction();
1659 break;
1660 }
1661 break;
1662 }
1663 IMPLEMENT_FUNCTION_END
1664
1665 //////////////////////////////////////////////////////////////////////////
1666 IMPLEMENT_FUNCTION(32, Coudert, function32)
1667 switch (savepoint.action) {
1668 default:
1669 break;
1670
1671 case kActionDefault:
1672 setCallback(1);
1673 setup_function16();
1674 break;
1675
1676 case kActionCallback:
1677 switch (getCallback()) {
1678 default:
1679 break;
1680
1681 case 1:
1682 setCallback(2);
1683 setup_updateEntity(kCarRedSleeping, kPosition_9460);
1684 break;
1685
1686 case 2:
1687 getEntities()->clearSequences(kEntityCoudert);
1688 setCallback(3);
1689 setup_updateFromTime(900);
1690 break;
1691
1692 case 3:
1693 setCallback(4);
1694 setup_updateEntity(kCarRedSleeping, kPosition_2000);
1695 break;
1696
1697 case 4:
1698 setCallback(5);
1699 setup_function18();
1700 break;
1701
1702 case 5:
1703 callbackAction();
1704 break;
1705 }
1706 break;
1707 }
1708 IMPLEMENT_FUNCTION_END
1709
1710 //////////////////////////////////////////////////////////////////////////
1711 IMPLEMENT_FUNCTION(33, Coudert, function33)
1712 switch (savepoint.action) {
1713 default:
1714 break;
1715
1716 case kActionDefault:
1717 if (ENTITY_PARAM(0, 3) || ENTITY_PARAM(0, 4) || ENTITY_PARAM(0, 5) || ENTITY_PARAM(0, 6) || ENTITY_PARAM(0, 7)
1718 || ENTITY_PARAM(1, 2) || ENTITY_PARAM(1, 7)
1719 || ENTITY_PARAM(2, 2)) {
1720 ENTITY_PARAM(2, 6) = 1;
1721
1722 if (ENTITY_PARAM(0, 3) || ENTITY_PARAM(0, 4) || ENTITY_PARAM(0, 5)) {
1723 setCallback(1);
1724 setup_updateEntity(kCarRedSleeping, kPosition_1500);
1725 } else {
1726 setCallback(5);
1727 setup_updateEntity(kCarRedSleeping, kPosition_540);
1728 }
1729 } else {
1730 callbackAction();
1731 }
1732 break;
1733
1734 case kActionCallback:
1735 switch (getCallback()) {
1736 default:
1737 break;
1738
1739 case 1:
1740 ENTITY_PARAM(2, 1) = 1;
1741 if (ENTITY_PARAM(0, 3)) {
1742 setCallback(2);
1743 setup_function14(kEntityVerges);
1744 break;
1745 }
1746 // fall through
1747
1748 case 2:
1749 if (ENTITY_PARAM(0, 5)) {
1750 setCallback(3);
1751 setup_function14(kEntityMertens);
1752 break;
1753 }
1754 // fall through
1755
1756 case 3:
1757 if (ENTITY_PARAM(0, 4)) {
1758 setCallback(4);
1759 setup_function14(kEntityMmeBoutarel);
1760 break;
1761 }
1762 // fall through
1763
1764 case 4:
1765 ENTITY_PARAM(2, 6) = 0;
1766
1767 callbackAction();
1768 break;
1769
1770 case 5:
1771 getEntities()->clearSequences(kEntityCoudert);
1772
1773 setCallback(6);
1774 setup_updateFromTime(75);
1775 break;
1776
1777 case 6:
1778 if (ENTITY_PARAM(0, 6) || ENTITY_PARAM(0, 7)) {
1779 setCallback(7);
1780 setup_function37();
1781 break;
1782 }
1783 // fall through
1784
1785 case 7:
1786 if (ENTITY_PARAM(2, 2)) {
1787 setCallback(8);
1788 setup_function39();
1789 break;
1790 }
1791 // fall through
1792
1793 case 8:
1794 if (ENTITY_PARAM(1, 2)) {
1795 setCallback(9);
1796 setup_function55();
1797 break;
1798 }
1799 // fall through
1800
1801 case 9:
1802 if (ENTITY_PARAM(1, 7)) {
1803 setCallback(10);
1804 setup_function34(false);
1805 break;
1806 }
1807 // fall through
1808
1809 case 10:
1810 ENTITY_PARAM(2, 6) = 0;
1811
1812 callbackAction();
1813 break;
1814 }
1815 break;
1816 }
1817 IMPLEMENT_FUNCTION_END
1818
1819 //////////////////////////////////////////////////////////////////////////
1820 IMPLEMENT_FUNCTION_I(34, Coudert, function34, bool)
1821 switch (savepoint.action) {
1822 default:
1823 break;
1824
1825 case kActionDefault:
1826 setCallback(1);
1827 setup_function16();
1828 break;
1829
1830 case kActionCallback:
1831 switch (getCallback()) {
1832 default:
1833 break;
1834
1835 case 1:
1836 setCallback(2);
1837 setup_updateEntity(kCarRedSleeping, kPosition_4070);
1838 break;
1839
1840 case 2:
1841 if (!params->param1) {
1842 getSound()->playSound(kEntityCoudert, "Ann3124");
1843
1844 ENTITY_PARAM(1, 7) = 0;
1845 ENTITY_PARAM(1, 4) = 0;
1846
1847 setCallback(7);
1848 setup_function35((bool)params->param1);
1849 } else {
1850 getEntities()->drawSequenceLeft(kEntityCoudert, "627Vf");
1851 getEntities()->enterCompartment(kEntityCoudert, kObjectCompartmentF, true);
1852
1853 setCallback(3);
1854 setup_playSound("LIB012");
1855 }
1856 break;
1857
1858 case 3:
1859 setCallback(4);
1860 setup_playSound("Jac1001");
1861 break;
1862
1863 case 4:
1864 getSound()->playSound(kEntityCoudert, "Ann3125");
1865
1866 setCallback(5);
1867 setup_enterExitCompartment("629Bf", kObjectCompartmentF);
1868 break;
1869
1870 case 5:
1871 setCallback(6);
1872 setup_enterExitCompartment("629Ff", kObjectCompartmentF);
1873 break;
1874
1875 case 6:
1876 getEntities()->exitCompartment(kEntityCoudert, kObjectCompartmentF, true);
1877
1878 ENTITY_PARAM(1, 7) = 0;
1879 ENTITY_PARAM(1, 4) = 0;
1880
1881 setCallback(7);
1882 setup_function35((bool)params->param1);
1883 break;
1884
1885 case 7:
1886 callbackAction();
1887 break;
1888 }
1889 break;
1890 }
1891 IMPLEMENT_FUNCTION_END
1892
1893 //////////////////////////////////////////////////////////////////////////
1894 IMPLEMENT_FUNCTION_I(35, Coudert, function35, bool)
1895 switch (savepoint.action) {
1896 default:
1897 break;
1898
1899 case kActionNone:
1900 if (getEntities()->isInsideTrainCar(kEntityPlayer, kCarBaggage)) {
1901 getAction()->playAnimation(kEventCoudertBaggageCar);
1902 getSound()->playSound(kEntityPlayer, "BUMP");
1903 getScenes()->loadSceneFromPosition(kCarRestaurant, 65);
1904 }
1905
1906 if (!Entity::updateParameter(params->param2, getState()->time, 2700))
1907 break;
1908
1909 getSavePoints()->push(kEntityCoudert, kEntityMax, kActionMaxFreeFromCage);
1910
1911 getData()->clothes = kClothesDefault;
1912
1913 setCallback(3);
1914 setup_updateEntity(kCarRedSleeping, kPosition_2000);
1915 break;
1916
1917 case kActionDefault:
1918 if (params->param1)
1919 getSavePoints()->push(kEntityCoudert, kEntityAnna, kAction156049968);
1920
1921 getSavePoints()->push(kEntityCoudert, kEntityMax, kAction122358304);
1922
1923 getData()->clothes = kClothes1;
1924 getData()->entityPosition = kPosition_4370;
1925
1926 setCallback(1);
1927 setup_updateEntity(kCarRedSleeping, kPosition_8200);
1928 break;
1929
1930 case kActionCallback:
1931 switch (getCallback()) {
1932 default:
1933 break;
1934
1935 case 1:
1936 if (!getSoundQueue()->isBuffered(kEntityCoudert))
1937 getSound()->playSound(kEntityCoudert, "Ann3124");
1938
1939 if (params->param1)
1940 getSavePoints()->push(kEntityCoudert, kEntityAnna, kAction123733488);
1941
1942 setCallback(2);
1943 setup_updateEntity(kCarRedSleeping, kPosition_9460);
1944 break;
1945
1946 case 2:
1947 getEntities()->clearSequences(kEntityCoudert);
1948 break;
1949
1950 case 3:
1951 setCallback(4);
1952 setup_function18();
1953 break;
1954
1955 case 4:
1956 callbackAction();
1957 break;
1958 }
1959 break;
1960 }
1961 IMPLEMENT_FUNCTION_END
1962
1963 //////////////////////////////////////////////////////////////////////////
1964 IMPLEMENT_FUNCTION(36, Coudert, chapter1)
1965 switch (savepoint.action) {
1966 default:
1967 break;
1968
1969 case kActionNone:
1970 Entity::timeCheckCallback(kTimeChapter1, params->param1, 1, WRAP_SETUP_FUNCTION(Coudert, setup_function18));
1971 break;
1972
1973 case kActionDefault:
1974 getSavePoints()->addData(kEntityCoudert, kAction292048641, 7);
1975 getSavePoints()->addData(kEntityCoudert, kAction326348944, 8);
1976 getSavePoints()->addData(kEntityCoudert, kAction171394341, 2);
1977 getSavePoints()->addData(kEntityCoudert, kAction154005632, 4);
1978 getSavePoints()->addData(kEntityCoudert, kAction169557824, 3);
1979 getSavePoints()->addData(kEntityCoudert, kAction226031488, 5);
1980 getSavePoints()->addData(kEntityCoudert, kAction339669520, 6);
1981 getSavePoints()->addData(kEntityCoudert, kAction189750912, 10);
1982 getSavePoints()->addData(kEntityCoudert, kAction185737168, 12);
1983 getSavePoints()->addData(kEntityCoudert, kAction185671840, 13);
1984 getSavePoints()->addData(kEntityCoudert, kAction205033696, 15);
1985 getSavePoints()->addData(kEntityCoudert, kAction157026693, 14);
1986 getSavePoints()->addData(kEntityCoudert, kAction189026624, 11);
1987 getSavePoints()->addData(kEntityCoudert, kAction168254872, 17);
1988 getSavePoints()->addData(kEntityCoudert, kAction201431954, 18);
1989 getSavePoints()->addData(kEntityCoudert, kAction188570113, 19);
1990
1991 ENTITY_PARAM(0, 1) = 0;
1992 ENTITY_PARAM(0, 2) = 1;
1993
1994 getData()->entityPosition = kPosition_1500;
1995 getData()->location = kLocationOutsideCompartment;
1996 getData()->car = kCarRedSleeping;
1997
1998 getObjects()->updateModel(kObject111, kObjectModel1);
1999 break;
2000
2001 case kActionCallback:
2002 if (getCallback() == 1)
2003 setup_chapter1Handler();
2004 break;
2005 }
2006 IMPLEMENT_FUNCTION_END
2007
2008 //////////////////////////////////////////////////////////////////////////
2009 IMPLEMENT_FUNCTION(37, Coudert, function37)
2010 switch (savepoint.action) {
2011 default:
2012 break;
2013
2014 case kActionDefault:
2015 if (getSoundQueue()->isBuffered(kEntityCoudert))
2016 getSoundQueue()->fade(kEntityCoudert);
2017
2018 if (ENTITY_PARAM(0, 7)) {
2019 getData()->entityPosition = kPosition_8200;
2020
2021 setCallback(4);
2022 setup_enterExitCompartment2("698Ha", kObjectCompartmentA, kPosition_8200, kPosition_7850);
2023 } else {
2024 setCallback(1);
2025 setup_function16();
2026 }
2027 break;
2028
2029 case kActionCallback:
2030 switch (getCallback()) {
2031 default:
2032 break;
2033
2034 case 1:
2035 setCallback(2);
2036 setup_updateEntity(kCarRedSleeping, kPosition_5790);
2037 break;
2038
2039 case 2:
2040 getSavePoints()->push(kEntityCoudert, kEntityAnna, kAction238358920);
2041 setCallback(3);
2042 setup_updateEntity(kCarRedSleeping, kPosition_8200);
2043 break;
2044
2045 case 3:
2046 setCallback(4);
2047 setup_enterExitCompartment2("698Ha", kObjectCompartmentA, kPosition_8200, kPosition_7850);
2048 break;
2049
2050 case 4:
2051 getObjects()->update(kObjectCompartmentA, kEntityPlayer, kObjectLocation2, kCursorKeepValue, kCursorKeepValue);
2052 getData()->location = kLocationInsideCompartment;
2053 getEntities()->clearSequences(kEntityCoudert);
2054 setup_function38();
2055 break;
2056 }
2057 break;
2058 }
2059 IMPLEMENT_FUNCTION_END
2060
2061 //////////////////////////////////////////////////////////////////////////
2062 IMPLEMENT_FUNCTION(38, Coudert, function38)
2063 switch (savepoint.action) {
2064 default:
2065 break;
2066
2067 case kActionDefault:
2068 getData()->car = kCarRedSleeping;
2069 getData()->entityPosition = kPosition_8200;
2070 getData()->location = kLocationInsideCompartment;
2071 break;
2072
2073 case kActionCallback:
2074 switch (getCallback()) {
2075 default:
2076 break;
2077
2078 case 1:
2079 ENTITY_PARAM(0, 6) = 0;
2080 ENTITY_PARAM(0, 7) = 0;
2081
2082 setCallback(2);
2083 setup_function18();
2084 break;
2085
2086 case 2:
2087 setup_chapter1Handler();
2088 break;
2089 }
2090 break;
2091
2092 case kAction191477936:
2093 getData()->entityPosition = kPosition_4070;
2094 getData()->location = kLocationOutsideCompartment;
2095 getObjects()->update(kObjectCompartmentA, kEntityPlayer, kObjectLocationNone, kCursorHandKnock, kCursorHand);
2096
2097 setCallback(1);
2098 setup_updateEntity(kCarRedSleeping, kPosition_2000);
2099 break;
2100 }
2101 IMPLEMENT_FUNCTION_END
2102
2103 //////////////////////////////////////////////////////////////////////////
2104 IMPLEMENT_FUNCTION(39, Coudert, function39)
2105 switch (savepoint.action) {
2106 default:
2107 break;
2108
2109 case kActionDefault:
2110 setCallback(1);
2111 setup_playSound("LIB070");
2112 break;
2113
2114 case kActionCallback:
2115 switch (getCallback()) {
2116 default:
2117 break;
2118
2119 case 1:
2120 setCallback(2);
2121 setup_function16();
2122 break;
2123
2124 case 2:
2125 setCallback(3);
2126 setup_updateEntity(kCarRedSleeping, kPosition_5790);
2127 break;
2128
2129 case 3:
2130 setCallback(4);
2131 setup_enterExitCompartment("627Vd", kObjectCompartmentD);
2132 break;
2133
2134 case 4:
2135 getEntities()->drawSequenceLeft(kEntityCoudert, "627Wd");
2136 getEntities()->enterCompartment(kEntityCoudert, kObjectCompartmentD, true);
2137
2138 setCallback(5);
2139 setup_playSound("MME1151A");
2140 break;
2141
2142 case 5:
2143 getEntities()->exitCompartment(kEntityCoudert, kObjectCompartmentD, true);
2144
2145 setCallback(6);
2146 setup_enterExitCompartment("627Zd", kObjectCompartmentD);
2147 break;
2148
2149 case 6:
2150 getData()->location = kLocationInsideCompartment;
2151 getEntities()->clearSequences(kEntityCoudert);
2152
2153 setCallback(7);
2154 setup_playSound("MME1151");
2155 break;
2156
2157 case 7:
2158 setCallback(8);
2159 setup_enterExitCompartment("697Ad", kObjectCompartmentD);
2160 break;
2161
2162 case 8:
2163 getSavePoints()->push(kEntityCoudert, kEntityMmeBoutarel, kAction223068211);
2164 getData()->location = kLocationOutsideCompartment;
2165
2166 setCallback(9);
2167 setup_updateEntity(kCarRedSleeping, kPosition_2000);
2168 break;
2169
2170 case 9:
2171 setCallback(10);
2172 setup_function18();
2173 break;
2174
2175 case 10:
2176 getSavePoints()->push(kEntityCoudert, kEntityVerges, kAction167854368);
2177 ENTITY_PARAM(2, 2) = 0;
2178
2179 callbackAction();
2180 break;
2181 }
2182 break;
2183 }
2184 IMPLEMENT_FUNCTION_END
2185
2186 //////////////////////////////////////////////////////////////////////////
2187 IMPLEMENT_FUNCTION(40, Coudert, chapter1Handler)
2188 switch (savepoint.action) {
2189 default:
2190 break;
2191
2192 case kActionNone:
2193 if (ENTITY_PARAM(2, 3)) {
2194 ENTITY_PARAM(0, 1) = 1;
2195 ENTITY_PARAM(0, 3) = 0;
2196 ENTITY_PARAM(0, 4) = 0;
2197 ENTITY_PARAM(0, 5) = 0;
2198 ENTITY_PARAM(0, 8) = 0;
2199
2200 ENTITY_PARAM(1, 1) = 0;
2201
2202 ENTITY_PARAM(2, 1) = 0;
2203 ENTITY_PARAM(2, 2) = 0;
2204
2205 getEntities()->drawSequenceLeft(kEntityCoudert, "697F");
2206
2207 params->param1 = 1;
2208 params->param2 = 1;
2209
2210 ENTITY_PARAM(2, 3) = 0;
2211 }
2212
2213 getData()->inventoryItem = (getProgress().eventCorpseFound || getEvent(kEventCoudertAskTylerCompartment)) ? kItemNone : kItemInvalid;
2214
2215 if (ENTITY_PARAM(0, 8)) {
2216 getData()->inventoryItem = kItemNone;
2217
2218 setCallback(4);
2219 setup_function15(true);
2220 break;
2221 }
2222
2223 label_callback_4:
2224 if (ENTITY_PARAM(1, 1)) {
2225 getData()->inventoryItem = kItemNone;
2226
2227 setCallback(5);
2228 setup_function15(false);
2229 break;
2230 }
2231
2232 label_callback_5:
2233 if (ENTITY_PARAM(0, 6) || ENTITY_PARAM(0, 7)) {
2234 getData()->inventoryItem = kItemNone;
2235 setup_function37();
2236 break;
2237 }
2238
2239 if (ENTITY_PARAM(0, 3)) {
2240 getData()->inventoryItem = kItemNone;
2241
2242 setCallback(6);
2243 setup_function14(kEntityVerges);
2244 break;
2245 }
2246
2247 label_callback_6:
2248 if (ENTITY_PARAM(0, 5)) {
2249 getData()->inventoryItem = kItemNone;
2250
2251 setCallback(7);
2252 setup_function14(kEntityMertens);
2253 break;
2254 }
2255
2256 label_callback_7:
2257 if (ENTITY_PARAM(0, 4)) {
2258 getData()->inventoryItem = kItemNone;
2259
2260 setCallback(8);
2261 setup_function14(kEntityMmeBoutarel);
2262 break;
2263 }
2264
2265 label_callback_8:
2266 if (ENTITY_PARAM(2, 2)) {
2267 getData()->inventoryItem = kItemNone;
2268
2269 setCallback(9);
2270 setup_function39();
2271 break;
2272 }
2273
2274 label_callback_9:
2275 if (ENTITY_PARAM(0, 1) && !getSoundQueue()->isBuffered(kEntityCoudert))
2276 getSound()->playSound(kEntityCoudert, rnd(2) ? "JAC1065" : "JAC1065A");
2277
2278 if (getState()->time > kTime1107000 && !params->param1 && !getEvent(kEventVassiliSeizure)) {
2279 getData()->inventoryItem = kItemNone;
2280
2281 setCallback(10);
2282 setup_function41();
2283 break;
2284 }
2285
2286 label_callback_10:
2287 if (getState()->time > kTime1189800 && !ENTITY_PARAM(0, 1) && !ENTITY_PARAM(2, 1)) {
2288 if (Entity::updateParameter(params->param3, getState()->time, 2700)) {
2289 ENTITY_PARAM(0, 2) = 0;
2290 ENTITY_PARAM(0, 1) = 1;
2291
2292 getEntities()->drawSequenceLeft(kEntityCoudert, "697F");
2293
2294 params->param3 = 0;
2295 }
2296 }
2297
2298 if (!ENTITY_PARAM(0, 2))
2299 break;
2300
2301 timeCheckObject(kTime1107000, params->param4, kObject111, kObjectModel2);
2302 timeCheckObject(kTime1161000, params->param5, kObject111, kObjectModel3);
2303 timeCheckObject(kTime1206000, params->param6, kObject111, kObjectModel4);
2304 break;
2305
2306 case kAction1:
2307 getData()->inventoryItem = kItemNone;
2308
2309 setCallback(11);
2310 setup_savegame(kSavegameTypeEvent, kEventCoudertAskTylerCompartment);
2311 break;
2312
2313 case kAction11:
2314 if (!ENTITY_PARAM(0, 1) && !ENTITY_PARAM(2, 1)) {
2315 getData()->inventoryItem = kItemNone;
2316
2317 setCallback(13);
2318 setup_function13((bool)savepoint.param.intValue, savepoint.entity2);
2319 }
2320 break;
2321
2322 case kActionDefault:
2323 getData()->car = kCarRedSleeping;
2324 getData()->entityPosition = kPosition_1500;
2325 getData()->location = kLocationOutsideCompartment;
2326
2327 getScenes()->loadSceneFromItemPosition(kItem5);
2328 break;
2329
2330 case kActionDrawScene:
2331 if (!ENTITY_PARAM(2, 1) && !ENTITY_PARAM(0, 1)) {
2332
2333 if (!getEntities()->isPlayerPosition(kCarRedSleeping, 1) && !getEntities()->isPlayerPosition(kCarRedSleeping, 23))
2334 break;
2335
2336 if (getProgress().jacket == kJacketBlood) {
2337 setCallback(1);
2338 setup_savegame(kSavegameTypeEvent, kEventCoudertBloodJacket);
2339 } else {
2340 setCallback(getEntities()->isPlayerPosition(kCarRedSleeping, 1) ? 2 : 3);
2341 setup_function13(true, kEntityPlayer);
2342 }
2343 }
2344 break;
2345
2346 case kActionCallback:
2347 switch (getCallback()) {
2348 default:
2349 break;
2350
2351 case 1:
2352 getAction()->playAnimation(kEventCoudertBloodJacket);
2353 getLogic()->gameOver(kSavegameTypeIndex, 1, kSceneGameOverBloodJacket, true);
2354 break;
2355
2356 case 4:
2357 goto label_callback_4;
2358
2359 case 5:
2360 goto label_callback_5;
2361
2362 case 6:
2363 goto label_callback_6;
2364
2365 case 7:
2366 goto label_callback_7;
2367
2368 case 8:
2369 goto label_callback_8;
2370
2371 case 9:
2372 goto label_callback_9;
2373
2374 case 10:
2375 params->param1 = 1;
2376 goto label_callback_10;
2377
2378 case 11:
2379 getAction()->playAnimation(kEventCoudertAskTylerCompartment);
2380 getEntities()->drawSequenceRight(kEntityCoudert, ENTITY_PARAM(0, 2) ? "627A" : "627D");
2381 getScenes()->loadSceneFromItemPosition(kItem5);
2382
2383 ENTITY_PARAM(0, 1) = 0;
2384
2385 getScenes()->loadSceneFromPosition(kCarRedSleeping, 25);
2386
2387 setCallback(12);
2388 setup_callbackActionOnDirection();
2389 break;
2390
2391 case 12:
2392 getEntities()->drawSequenceLeft(kEntityCoudert, ENTITY_PARAM(0, 2) ? "627B" : "627E");
2393 break;
2394
2395 case 14:
2396 setCallback(15);
2397 setup_function18();
2398 break;
2399 }
2400 break;
2401
2402 case kAction168253822:
2403 if (!ENTITY_PARAM(2, 1) && !ENTITY_PARAM(0, 1)) {
2404 getData()->inventoryItem = kItemNone;
2405 getSound()->playSound(kEntityCoudert, "JAC1120");
2406
2407 setCallback(14);
2408 setup_bloodJacket("697D");
2409 }
2410 break;
2411
2412 case kAction225358684:
2413 if (!ENTITY_PARAM(0, 1)) {
2414 getData()->inventoryItem = kItemNone;
2415 setCallback(16);
2416 setup_function30((ObjectIndex)savepoint.param.intValue);
2417 }
2418 break;
2419
2420 case kAction225932896:
2421 if (!ENTITY_PARAM(2, 1) && !ENTITY_PARAM(0, 1))
2422 getSavePoints()->push(kEntityCoudert, kEntityFrancois, kAction205346192);
2423 break;
2424
2425 case kAction305159806:
2426 if (!ENTITY_PARAM(2, 1) && !ENTITY_PARAM(0, 1)) {
2427 getData()->inventoryItem = kItemNone;
2428 setCallback(17);
2429 setup_function31(savepoint.param.intValue);
2430 }
2431 break;
2432 }
2433 IMPLEMENT_FUNCTION_END
2434
2435 //////////////////////////////////////////////////////////////////////////
2436 IMPLEMENT_FUNCTION(41, Coudert, function41)
2437 switch (savepoint.action) {
2438 default:
2439 break;
2440
2441 case kActionDefault:
2442 setCallback(1);
2443 setup_function16();
2444 break;
2445
2446 case kActionCallback:
2447 switch (getCallback()) {
2448 default:
2449 break;
2450
2451 case 1:
2452 setCallback(2);
2453 setup_visitCompartmentA();
2454 break;
2455
2456 case 2:
2457 setCallback(3);
2458 setup_function33();
2459 break;
2460
2461 case 3:
2462 setCallback(4);
2463 setup_visitCompartmentB();
2464 break;
2465
2466 case 4:
2467 setCallback(5);
2468 setup_function33();
2469 break;
2470
2471 case 5:
2472 setCallback(6);
2473 setup_function27();
2474 break;
2475
2476 case 6:
2477 getSavePoints()->push(kEntityCoudert, kEntityRebecca, kAction285528346);
2478
2479 setCallback(7);
2480 setup_function33();
2481 break;
2482
2483 case 7:
2484 setCallback(8);
2485 setup_function26();
2486 break;
2487
2488 case 8:
2489 setCallback(9);
2490 setup_function33();
2491 break;
2492
2493 case 9:
2494 setCallback(10);
2495 setup_function25();
2496 break;
2497
2498 case 10:
2499 setCallback(11);
2500 setup_function33();
2501 break;
2502
2503 case 11:
2504 setCallback(12);
2505 setup_function23();
2506 break;
2507
2508 case 12:
2509 setCallback(13);
2510 setup_function33();
2511 break;
2512
2513 case 13:
2514 setCallback(14);
2515 setup_function22();
2516 break;
2517
2518 case 14:
2519 setCallback(15);
2520 setup_function33();
2521 break;
2522
2523 case 15:
2524 setCallback(16);
2525 setup_function21();
2526 break;
2527
2528 case 16:
2529 setCallback(17);
2530 setup_updateEntity(kCarRedSleeping, kPosition_2000);
2531 break;
2532
2533 case 17:
2534 setCallback(18);
2535 setup_function18();
2536 break;
2537
2538 case 18:
2539 getSavePoints()->push(kEntityCoudert, kEntityMilos, kAction208228224);
2540
2541 callbackAction();
2542 break;
2543 }
2544 break;
2545 }
2546 IMPLEMENT_FUNCTION_END
2547
2548 //////////////////////////////////////////////////////////////////////////
2549 IMPLEMENT_FUNCTION(42, Coudert, chapter2)
2550 switch (savepoint.action) {
2551 default:
2552 break;
2553
2554 case kActionNone:
2555 setCallback(1);
2556 setup_function18();
2557 break;
2558
2559 case kActionDefault:
2560 getEntities()->clearSequences(kEntityCoudert);
2561
2562 getData()->entityPosition = kPosition_1500;
2563 getData()->location = kLocationOutsideCompartment;
2564 getData()->car = kCarRedSleeping;
2565 getData()->inventoryItem = kItemNone;
2566
2567 ENTITY_PARAM(0, 2) = 0;
2568 ENTITY_PARAM(0, 3) = 0;
2569 ENTITY_PARAM(0, 4) = 0;
2570 ENTITY_PARAM(0, 5) = 0;
2571 ENTITY_PARAM(0, 6) = 0;
2572 ENTITY_PARAM(0, 8) = 0;
2573
2574 ENTITY_PARAM(1, 1) = 0;
2575 ENTITY_PARAM(1, 2) = 0;
2576 ENTITY_PARAM(1, 3) = 0;
2577 ENTITY_PARAM(1, 5) = 0;
2578 ENTITY_PARAM(1, 6) = 0;
2579 ENTITY_PARAM(1, 7) = 0;
2580 ENTITY_PARAM(1, 8) = 0;
2581
2582 ENTITY_PARAM(2, 4) = 0;
2583
2584 getObjects()->updateModel(kObject111, kObjectModel5);
2585 break;
2586
2587 case kActionCallback:
2588 if (getCallback() == 1)
2589 setup_function43();
2590 break;
2591 }
2592 IMPLEMENT_FUNCTION_END
2593
2594 //////////////////////////////////////////////////////////////////////////
2595 IMPLEMENT_FUNCTION(43, Coudert, function43)
2596 switch (savepoint.action) {
2597 default:
2598 break;
2599
2600 case kActionNone:
2601 if (ENTITY_PARAM(0, 8)) {
2602 setCallback(1);
2603 setup_function15(true);
2604 break;
2605 }
2606
2607 label_callback1:
2608 if (ENTITY_PARAM(1, 1)) {
2609 setCallback(2);
2610 setup_function15(false);
2611 break;
2612 }
2613
2614 label_callback2:
2615 if (ENTITY_PARAM(0, 3)) {
2616 setCallback(3);
2617 setup_function14(kEntityVerges);
2618 }
2619 break;
2620
2621 case kAction11:
2622 if (!ENTITY_PARAM(2, 1)) {
2623 setCallback(4);
2624 setup_function13((bool)savepoint.param.intValue, savepoint.entity2);
2625 }
2626 break;
2627
2628 case kActionDrawScene:
2629 if (ENTITY_PARAM(2, 1))
2630 break;
2631
2632 if (getEntities()->isPlayerPosition(kCarRedSleeping, 1)) {
2633 setCallback(5);
2634 setup_function13(true, kEntityPlayer);
2635
2636 } else if (getEntities()->isPlayerPosition(kCarRedSleeping, 23)) {
2637 setCallback(6);
2638 setup_function13(false, kEntityPlayer);
2639 }
2640 break;
2641
2642 case kActionCallback:
2643 switch (getCallback()) {
2644 default:
2645 break;
2646
2647 case 1:
2648 goto label_callback1;
2649
2650 case 2:
2651 goto label_callback2;
2652
2653 case 7:
2654 setCallback(8);
2655 setup_function18();
2656 break;
2657 }
2658 break;
2659
2660 case kAction225358684:
2661 if (!ENTITY_PARAM(0, 1)) {
2662 setCallback(9);
2663 setup_function30((ObjectIndex)savepoint.param.intValue);
2664 }
2665 break;
2666
2667 case kAction226078300:
2668 if (!ENTITY_PARAM(2, 1) && !ENTITY_PARAM(0, 1)) {
2669 getSound()->playSound(kEntityCoudert, "JAC2020");
2670
2671 setCallback(7);
2672 setup_bloodJacket("697D");
2673 }
2674 break;
2675
2676 case kAction305159806:
2677 if (!ENTITY_PARAM(2, 1) && !ENTITY_PARAM(0, 1)) {
2678 setCallback(10);
2679 setup_function31(savepoint.param.intValue);
2680 }
2681 break;
2682 }
2683 IMPLEMENT_FUNCTION_END
2684
2685 //////////////////////////////////////////////////////////////////////////
2686 IMPLEMENT_FUNCTION(44, Coudert, chapter3)
2687 switch (savepoint.action) {
2688 default:
2689 break;
2690
2691 case kActionNone:
2692 setCallback(1);
2693 setup_function18();
2694 break;
2695
2696 case kActionDefault:
2697 getEntities()->clearSequences(kEntityCoudert);
2698
2699 getData()->entityPosition = kPosition_1500;
2700 getData()->location = kLocationOutsideCompartment;
2701 getData()->car = kCarRedSleeping;
2702 getData()->clothes = kClothesDefault;
2703 getData()->inventoryItem = kItemNone;
2704
2705 ENTITY_PARAM(0, 2) = 1;
2706 ENTITY_PARAM(0, 3) = 0;
2707 ENTITY_PARAM(0, 4) = 0;
2708 ENTITY_PARAM(0, 5) = 0;
2709 ENTITY_PARAM(0, 8) = 0;
2710
2711 ENTITY_PARAM(1, 1) = 0;
2712 ENTITY_PARAM(1, 2) = 0;
2713 ENTITY_PARAM(1, 3) = 0;
2714 ENTITY_PARAM(1, 4) = 0;
2715 ENTITY_PARAM(1, 5) = 0;
2716 ENTITY_PARAM(1, 6) = 0;
2717 ENTITY_PARAM(1, 7) = 0;
2718 ENTITY_PARAM(1, 8) = 0;
2719
2720 ENTITY_PARAM(2, 4) = 0;
2721 ENTITY_PARAM(2, 5) = 0;
2722
2723 getObjects()->updateModel(kObject111, kObjectModel6);
2724 break;
2725
2726 case kActionCallback:
2727 if (getCallback() == 1)
2728 setup_function45();
2729 break;
2730 }
2731 IMPLEMENT_FUNCTION_END
2732
2733 //////////////////////////////////////////////////////////////////////////
2734 IMPLEMENT_FUNCTION(45, Coudert, function45)
2735 switch (savepoint.action) {
2736 default:
2737 break;
2738
2739 case kActionNone:
2740 if (ENTITY_PARAM(0, 8)) {
2741 setCallback(1);
2742 setup_function15(true);
2743 break;
2744 }
2745
2746 label_callback_1:
2747 if (ENTITY_PARAM(1, 1)) {
2748 setCallback(2);
2749 setup_function15(false);
2750 break;
2751 }
2752
2753 label_callback_2:
2754 if (ENTITY_PARAM(0, 3)) {
2755 setCallback(3);
2756 setup_function14(kEntityVerges);
2757 break;
2758 }
2759
2760 label_callback_3:
2761 if (ENTITY_PARAM(0, 5)) {
2762 setCallback(4);
2763 setup_function14(kEntityMertens);
2764 break;
2765 }
2766
2767 label_callback_4:
2768 if (ENTITY_PARAM(1, 3)) {
2769 setCallback(5);
2770 setup_function46();
2771 break;
2772 }
2773
2774 label_callback_5:
2775 if (ENTITY_PARAM(1, 5)) {
2776 setCallback(6);
2777 setup_function47(true);
2778 break;
2779 }
2780
2781 label_callback_6:
2782 if (ENTITY_PARAM(1, 6)) {
2783 setCallback(7);
2784 setup_function47(false);
2785 break;
2786 }
2787
2788 label_callback_7:
2789 if (ENTITY_PARAM(1, 8)) {
2790 setCallback(8);
2791 setup_function48();
2792 break;
2793 }
2794
2795 label_callback_8:
2796 if (ENTITY_PARAM(2, 4)) {
2797 setCallback(9);
2798 setup_function49();
2799 break;
2800 }
2801
2802 label_callback_9:
2803 if (ENTITY_PARAM(1, 4)) {
2804 setCallback(10);
2805 setup_function34(true);
2806 break;
2807 }
2808
2809 label_callback_10:
2810 if (ENTITY_PARAM(1, 7)) {
2811 setCallback(11);
2812 setup_function34(false);
2813 break;
2814 }
2815
2816 label_callback_11:
2817 if (ENTITY_PARAM(0, 4)) {
2818 setCallback(12);
2819 setup_function14(kEntityMmeBoutarel);
2820 break;
2821 }
2822
2823 label_callback_12:
2824 // BUG: Can never be called... FAIL!
2825 if (ENTITY_PARAM(2, 5) && getState()->time > kTime2056500 && getState()->time < kTime1417500) {
2826 setCallback(13);
2827 setup_function50();
2828 break;
2829 }
2830
2831 label_callback_13:
2832 if (Entity::timeCheckCallback(kTime2088900, params->param1, 14, WRAP_SETUP_FUNCTION(Coudert, setup_function32)))
2833 break;
2834
2835 label_callback_14:
2836 if (Entity::timeCheckCallback(kTime2119500, params->param2, 15, WRAP_SETUP_FUNCTION(Coudert, setup_function32)))
2837 break;
2838
2839 label_callback_15:
2840 if (Entity::timeCheckCallback(kTime2138400, params->param3, 16, WRAP_SETUP_FUNCTION(Coudert, setup_function32)))
2841 break;
2842
2843 label_callback_16:
2844 if (Entity::timeCheckCallback(kTime2147400, params->param4, 17, WRAP_SETUP_FUNCTION(Coudert, setup_function32)))
2845 break;
2846
2847 label_callback_17:
2848 if (Entity::timeCheckCallback(kTime2160000, params->param5, 18, WRAP_SETUP_FUNCTION(Coudert, setup_function32)))
2849 break;
2850
2851 label_callback_18:
2852 if (Entity::timeCheckCallback(kTime2205000, params->param6, 19, WRAP_SETUP_FUNCTION(Coudert, setup_function32)))
2853 break;
2854
2855 label_callback_19:
2856 if (ENTITY_PARAM(0, 2)) {
2857 timeCheckObject(kTime2025000, params->param7, kObject111, kObjectModel7);
2858 timeCheckObject(kTime2133000, params->param8, kObject111, kObjectModel8);
2859 timeCheckObject(kTime2173500, CURRENT_PARAM(1, 1), kObject111, kObjectModel9);
2860 }
2861 break;
2862
2863 case kAction11:
2864 if (!ENTITY_PARAM(2, 1)) {
2865 setCallback(20);
2866 setup_function13((bool)savepoint.param.intValue, savepoint.entity2);
2867 }
2868 break;
2869
2870 case kActionDrawScene:
2871 if (!ENTITY_PARAM(2, 1)) {
2872 if (getEntities()->isPlayerPosition(kCarRedSleeping, 1)) {
2873 setCallback(21);
2874 setup_function13(true, kEntityPlayer);
2875 } else if (getEntities()->isPlayerPosition(kCarRedSleeping, 23)) {
2876 setCallback(22);
2877 setup_function13(false, kEntityPlayer);
2878 }
2879 }
2880 break;
2881
2882 case kActionCallback:
2883 switch (getCallback()) {
2884 default:
2885 break;
2886
2887 case 1:
2888 goto label_callback_1;
2889
2890 case 2:
2891 goto label_callback_2;
2892
2893 case 3:
2894 goto label_callback_3;
2895
2896 case 4:
2897 goto label_callback_4;
2898
2899 case 5:
2900 goto label_callback_5;
2901
2902 case 6:
2903 goto label_callback_6;
2904
2905 case 7:
2906 goto label_callback_7;
2907
2908 case 8:
2909 goto label_callback_8;
2910
2911 case 9:
2912 goto label_callback_9;
2913
2914 case 10:
2915 goto label_callback_10;
2916
2917 case 11:
2918 goto label_callback_11;
2919
2920 case 12:
2921 getSavePoints()->push(kEntityCoudert, kEntityVerges, kAction168255788);
2922 goto label_callback_12;
2923
2924 case 13:
2925 goto label_callback_13;
2926
2927 case 14:
2928 goto label_callback_14;
2929
2930 case 15:
2931 goto label_callback_15;
2932
2933 case 16:
2934 goto label_callback_16;
2935
2936 case 17:
2937 goto label_callback_17;
2938
2939 case 18:
2940 goto label_callback_18;
2941
2942 case 19:
2943 goto label_callback_19;
2944
2945 case 23:
2946 setCallback(24);
2947 setup_function18();
2948 break;
2949 }
2950 break;
2951
2952 case kAction225358684:
2953 if (!ENTITY_PARAM(0, 1)) {
2954 setCallback(25);
2955 setup_function30((ObjectIndex)savepoint.param.intValue);
2956 }
2957 break;
2958
2959 case kAction226078300:
2960 if (!ENTITY_PARAM(2, 1) && !ENTITY_PARAM(0, 1)) {
2961 getSound()->playSound(kEntityCoudert, "JAC2020");
2962
2963 setCallback(23);
2964 setup_bloodJacket("697D");
2965 }
2966 break;
2967
2968 case kAction305159806:
2969 if (!ENTITY_PARAM(2, 1) && !ENTITY_PARAM(0, 1)) {
2970 setCallback(26);
2971 setup_function31(savepoint.param.intValue);
2972 }
2973 break;
2974 }
2975 IMPLEMENT_FUNCTION_END
2976
2977 //////////////////////////////////////////////////////////////////////////
2978 IMPLEMENT_FUNCTION(46, Coudert, function46)
2979 switch (savepoint.action) {
2980 default:
2981 break;
2982
2983 case kActionDefault:
2984 setCallback(1);
2985 setup_function16();
2986 break;
2987
2988 case kActionCallback:
2989 switch (getCallback()) {
2990 default:
2991 break;
2992
2993 case 1:
2994 setCallback(2);
2995 setup_updateEntity(kCarRedSleeping, kPosition_4070);
2996 break;
2997
2998 case 2:
2999 getEntities()->drawSequenceLeft(kEntityCoudert, "627Vf");
3000 getEntities()->enterCompartment(kEntityCoudert, kObjectCompartmentF, true);
3001 getSavePoints()->push(kEntityCoudert, kEntityAnna, kAction253868128);
3002
3003 setCallback(3);
3004 setup_playSound("LIB012");
3005 break;
3006
3007 case 3:
3008 getEntities()->drawSequenceLeft(kEntityCoudert, "627Wf");
3009
3010 setCallback(4);
3011 setup_playSound("Ann1016A");
3012 break;
3013
3014 case 4:
3015 setCallback(5);
3016 setup_playSound("Ann4150");
3017 break;
3018
3019 case 5:
3020 getSound()->playSound(kEntityCoudert, "Ann3121");
3021
3022 setCallback(6);
3023 setup_enterExitCompartment("629Bf", kObjectCompartmentF);
3024 break;
3025
3026 case 6:
3027 getEntities()->drawSequenceLeft(kEntityCoudert, "629Cf");
3028 getEntities()->enterCompartment(kEntityCoudert, kObjectCompartmentF, true);
3029 // fall through
3030
3031 case 7:
3032 if (getSoundQueue()->isBuffered(kEntityCoudert)) {
3033 setCallback(7);
3034 setup_updateFromTime(75);
3035 } else {
3036 setCallback(8);
3037 setup_playSound("Ann3122");
3038 }
3039 break;
3040
3041 case 8:
3042 getSound()->playSound(kEntityCoudert, "Ann3123");
3043
3044 setCallback(9);
3045 setup_updateFromTicks(75);
3046 break;
3047
3048 case 9:
3049 setCallback(10);
3050 setup_enterExitCompartment("629Ff", kObjectCompartmentF);
3051 break;
3052
3053 case 10:
3054 getEntities()->exitCompartment(kEntityCoudert, kObjectCompartmentF, true);
3055 ENTITY_PARAM(1, 3) = 0;
3056
3057 setCallback(11);
3058 setup_function35(true);
3059 break;
3060
3061 case 11:
3062 callbackAction();
3063 break;
3064 }
3065 break;
3066 }
3067 IMPLEMENT_FUNCTION_END
3068
3069 //////////////////////////////////////////////////////////////////////////
3070 IMPLEMENT_FUNCTION_I(47, Coudert, function47, bool)
3071 switch (savepoint.action) {
3072 default:
3073 break;
3074
3075 case kActionDefault:
3076 setCallback(1);
3077 setup_function16();
3078 break;
3079
3080 case kActionCallback:
3081 switch (getCallback()) {
3082 default:
3083 break;
3084
3085 case 1:
3086 setCallback(2);
3087 setup_updateEntity(kCarRedSleeping, kPosition_4070);
3088 break;
3089
3090 case 2:
3091 setCallback(3);
3092 setup_enterExitCompartment("627Xf", kObjectCompartmentF);
3093 break;
3094
3095 case 3:
3096 getEntities()->drawSequenceLeft(kEntityCoudert, "627Wf");
3097 getEntities()->enterCompartment(kEntityCoudert, kObjectCompartmentF, true);
3098 // fall through
3099
3100 case 4:
3101 if (getSoundQueue()->isBuffered(kEntityCoudert)) {
3102 setCallback(4);
3103 setup_updateFromTime(225);
3104 } else {
3105 setCallback(5);
3106 setup_playSound(params->param1 ? "Ann3149" : "Ann3147a");
3107 }
3108 break;
3109
3110 case 5:
3111 getEntities()->exitCompartment(kEntityCoudert, kObjectCompartmentF, true);
3112 getSavePoints()->push(kEntityCoudert, kEntityAnna, kAction157894320);
3113
3114 setCallback(6);
3115 setup_updateEntity(kCarRedSleeping, kPosition_2000);
3116 break;
3117
3118 case 6:
3119 ENTITY_PARAM(1, 5) = 0;
3120 ENTITY_PARAM(1, 6) = 0;
3121
3122 setCallback(7);
3123 setup_function18();
3124 break;
3125
3126 case 7:
3127 callbackAction();
3128 break;
3129 }
3130 break;
3131 }
3132 IMPLEMENT_FUNCTION_END
3133
3134 //////////////////////////////////////////////////////////////////////////
3135 IMPLEMENT_FUNCTION(48, Coudert, function48)
3136 switch (savepoint.action) {
3137 default:
3138 break;
3139
3140 case kActionDefault:
3141 setCallback(1);
3142 setup_function16();
3143 break;
3144
3145 case kActionCallback:
3146 switch (getCallback()) {
3147 default:
3148 break;
3149
3150 case 1:
3151 getSound()->playSound(kEntityCoudert, "Ann3148A");
3152 setCallback(2);
3153 setup_updateEntity(kCarRedSleeping, kPosition_4070);
3154 break;
3155
3156 case 2:
3157 getSound()->playSound(kEntityCoudert, rnd(2) ? "Ann3148B" : "Ann3148");
3158 setCallback(3);
3159 setup_enterExitCompartment("627Xf", kObjectCompartmentF);
3160 break;
3161
3162 case 3:
3163 getSavePoints()->push(kEntityCoudert, kEntityAnna, kAction192063264);
3164 setCallback(4);
3165 setup_updateEntity(kCarRedSleeping, kPosition_2000);
3166 break;
3167
3168 case 4:
3169 ENTITY_PARAM(1, 8) = 0;
3170 setCallback(5);
3171 setup_function18();
3172 break;
3173
3174 case 5:
3175 callbackAction();
3176 break;
3177 }
3178 break;
3179 }
3180 IMPLEMENT_FUNCTION_END
3181
3182 //////////////////////////////////////////////////////////////////////////
3183 IMPLEMENT_FUNCTION(49, Coudert, function49)
3184 switch (savepoint.action) {
3185 default:
3186 break;
3187
3188 case kActionDefault:
3189 setCallback(1);
3190 setup_function16();
3191 break;
3192
3193 case kActionCallback:
3194 switch (getCallback()) {
3195 default:
3196 break;
3197
3198 case 1:
3199 setCallback(2);
3200 setup_updateEntity(kCarRedSleeping, kPosition_7500);
3201 break;
3202
3203 case 2:
3204 setCallback(3);
3205 setup_enterExitCompartment("627Vb", kObjectCompartmentB);
3206 break;
3207
3208 case 3:
3209 if (getEntities()->isInsideCompartment(kEntityTatiana, kCarRedSleeping, kPosition_7500)) {
3210 getEntities()->drawSequenceLeft(kEntityCoudert, "627Wb");
3211
3212 setCallback(4);
3213 setup_playSound("Jac3006");
3214 } else {
3215 getEntities()->drawSequenceLeft(kEntityCoudert, "627Wb");
3216 getEntities()->enterCompartment(kEntityCoudert, kObjectCompartmentB, true);
3217
3218 setCallback(8);
3219 setup_playSound("LIB012");
3220 }
3221 break;
3222
3223 case 4:
3224 getEntities()->exitCompartment(kEntityCoudert, kObjectCompartmentB, true);
3225
3226 setCallback(5);
3227 setup_enterExitCompartment("627Zb", kObjectCompartmentB);
3228 break;
3229
3230 case 5:
3231 getData()->location = kLocationInsideCompartment;
3232 getEntities()->clearSequences(kEntityCoudert);
3233
3234 setCallback(6);
3235 setup_playSound("Jac3006A");
3236 break;
3237
3238 case 6:
3239 setCallback(7);
3240 setup_enterExitCompartment("697Ab", kObjectCompartmentB);
3241 break;
3242
3243 case 7:
3244 getData()->location = kLocationOutsideCompartment;
3245
3246 setCallback(10);
3247 setup_updateEntity(kCarRedSleeping, kPosition_2000);
3248 break;
3249
3250 case 8:
3251 setCallback(9);
3252 setup_updateFromTime(150);
3253 break;
3254
3255 case 9:
3256 getEntities()->exitCompartment(kEntityCoudert, kObjectCompartmentB, true);
3257
3258 setCallback(10);
3259 setup_updateEntity(kCarRedSleeping, kPosition_2000);
3260 break;
3261
3262 case 10:
3263 getSavePoints()->push(kEntityCoudert, kEntityMmeBoutarel, kAction242526416);
3264 ENTITY_PARAM(2, 4) = 0;
3265 ENTITY_PARAM(2, 5) = 1;
3266
3267 setCallback(11);
3268 setup_function18();
3269 break;
3270
3271 case 11:
3272 callbackAction();
3273 break;
3274 }
3275 break;
3276 }
3277 IMPLEMENT_FUNCTION_END
3278
3279 //////////////////////////////////////////////////////////////////////////
3280 IMPLEMENT_FUNCTION(50, Coudert, function50)
3281 switch (savepoint.action) {
3282 default:
3283 break;
3284
3285 case kActionDefault:
3286 setCallback(1);
3287 setup_function16();
3288 break;
3289
3290 case kActionCallback:
3291 switch (getCallback()) {
3292 default:
3293 break;
3294
3295 case 1:
3296 setCallback(2);
3297 setup_updateEntity(kCarRedSleeping, kPosition_4840);
3298 break;
3299
3300 case 2:
3301 getEntities()->drawSequenceLeft(kEntityCoudert, "627Me");
3302 getEntities()->enterCompartment(kEntityCoudert, kObjectCompartmentE, true);
3303
3304 setCallback(3);
3305 setup_playSound("LIB012");
3306 break;
3307
3308 case 3:
3309 if (!getEntities()->isInsideCompartment(kEntityRebecca, kCarRedSleeping, kPosition_4840)) {
3310 getEntities()->exitCompartment(kEntityCoudert, kObjectCompartmentE, true);
3311
3312 setCallback(8);
3313 setup_updateEntity(kCarRedSleeping, kPosition_2000);
3314 } else {
3315 getEntities()->drawSequenceLeft(kEntityCoudert, "627Ne");
3316
3317 setCallback(4);
3318 setup_playSound("Jac3005");
3319 }
3320 break;
3321
3322 case 4:
3323 setCallback(5);
3324 setup_enterExitCompartment("627Re", kObjectCompartmentE);
3325 break;
3326
3327 case 5:
3328 getEntities()->exitCompartment(kEntityCoudert, kObjectCompartmentE, true);
3329
3330 getData()->location = kLocationInsideCompartment;
3331
3332 getEntities()->clearSequences(kEntityCoudert);
3333
3334 setCallback(6);
3335 setup_playSound("Jac3005A");
3336 break;
3337
3338 case 6:
3339 setCallback(7);
3340 setup_enterExitCompartment("627Se", kObjectCompartmentE);
3341 break;
3342
3343 case 7:
3344 getData()->location = kLocationOutsideCompartment;
3345
3346 setCallback(8);
3347 setup_updateEntity(kCarRedSleeping, kPosition_2000);
3348 break;
3349
3350 case 8:
3351 ENTITY_PARAM(2, 5) = 0;
3352
3353 setCallback(9);
3354 setup_function18();
3355 break;
3356
3357 case 9:
3358 callbackAction();
3359 break;
3360 }
3361 break;
3362 }
3363 IMPLEMENT_FUNCTION_END
3364
3365 //////////////////////////////////////////////////////////////////////////
3366 IMPLEMENT_FUNCTION(51, Coudert, function51)
3367 switch (savepoint.action) {
3368 default:
3369 break;
3370
3371 case kActionNone:
3372 if (getState()->time > kTime2133000 && !getProgress().field_40) {
3373 getEntities()->exitCompartment(kEntityCoudert, kObjectCompartmentB, true);
3374 getObjects()->update(kObjectCompartmentA, kEntityPlayer, kObjectLocationNone, kCursorHandKnock, kCursorHand);
3375 getObjects()->update(kObjectCompartmentB, kEntityPlayer, kObjectLocation1, kCursorHandKnock, kCursorHand);
3376
3377 setCallback(1);
3378 setup_updateEntity(kCarRedSleeping, kPosition_2000);
3379 }
3380 break;
3381
3382 case kActionOpenDoor:
3383 if (savepoint.param.intValue == kObjectCompartmentB)
3384 getData()->entityPosition = kPosition_7500;
3385
3386 getSound()->playSound(kEntityPlayer, "LIB014");
3387 getAction()->playAnimation(kEventCoudertGoingOutOfVassiliCompartment);
3388 getEntities()->updateEntity(kEntityCoudert, kCarRedSleeping, kPosition_2000);
3389 getScenes()->loadSceneFromObject(savepoint.param.intValue == kObjectCompartmentB ? kObjectCompartmentB : kObjectCompartmentA);
3390 getEntities()->exitCompartment(kEntityCoudert, kObjectCompartmentB, true);
3391 getObjects()->update(kObjectCompartmentA, kEntityPlayer, kObjectLocationNone, kCursorHandKnock, kCursorHand);
3392 getObjects()->update(kObjectCompartmentB, kEntityPlayer, kObjectLocation1, kCursorHandKnock, kCursorHand);
3393
3394 setCallback(3);
3395 setup_updateEntity(kCarRedSleeping, kPosition_2000);
3396 break;
3397
3398 case kActionDefault:
3399 getData()->car = kCarRedSleeping;
3400 getData()->entityPosition = kPosition_7500;
3401 getData()->location = kLocationOutsideCompartment;
3402
3403 getSavePoints()->push(kEntityCoudert, kEntityMax, kActionMaxFreeFromCage);
3404
3405 if (ENTITY_PARAM(0, 5)) {
3406 ENTITY_PARAM(0, 5) = 0;
3407
3408 getSavePoints()->push(kEntityCoudert, kEntityMertens, kAction155853632);
3409 getSavePoints()->push(kEntityCoudert, kEntityMertens, kActionEndSound);
3410 }
3411
3412 if (ENTITY_PARAM(0, 3)) {
3413 ENTITY_PARAM(0, 3) = 0;
3414
3415 getSavePoints()->push(kEntityCoudert, kEntityVerges, kAction155853632);
3416 getSavePoints()->push(kEntityCoudert, kEntityVerges, kActionEndSound);
3417 }
3418
3419 getEntities()->drawSequenceLeft(kEntityCoudert, "627Wb");
3420 getEntities()->enterCompartment(kEntityCoudert, kObjectCompartmentB, true);
3421 getSavePoints()->push(kEntityCoudert, kEntityTatiana, kAction154071333);
3422 break;
3423
3424 case kActionCallback:
3425 switch (getCallback()) {
3426 default:
3427 break;
3428
3429 case 1:
3430 setCallback(2);
3431 setup_function18();
3432 break;
3433
3434 case 2:
3435 case 4:
3436 case 6:
3437 setup_function45();
3438 break;
3439
3440 case 3:
3441 setCallback(4);
3442 setup_function18();
3443 break;
3444
3445 case 5:
3446 setCallback(6);
3447 setup_function18();
3448 break;
3449 }
3450 break;
3451
3452 case kAction168316032:
3453 getObjects()->update(kObjectCompartmentA, kEntityCoudert, kObjectLocationNone, kCursorNormal, kCursorHand);
3454 getObjects()->update(kObjectCompartmentB, kEntityCoudert, kObjectLocation1, kCursorNormal, kCursorHand);
3455 break;
3456
3457 case kAction235061888:
3458 getEntities()->exitCompartment(kEntityCoudert, kObjectCompartmentB, true);
3459 getObjects()->update(kObjectCompartmentA, kEntityPlayer, kObjectLocationNone, kCursorHandKnock, kCursorHand);
3460 getObjects()->update(kObjectCompartmentB, kEntityPlayer, kObjectLocation1, kCursorHandKnock, kCursorHand);
3461
3462 setCallback(5);
3463 setup_updateEntity(kCarRedSleeping, kPosition_2000);
3464 break;
3465 }
3466 IMPLEMENT_FUNCTION_END
3467
3468 //////////////////////////////////////////////////////////////////////////
3469 IMPLEMENT_FUNCTION(52, Coudert, chapter4)
3470 switch (savepoint.action) {
3471 default:
3472 break;
3473
3474 case kActionNone:
3475 setCallback(1);
3476 setup_function18();
3477 break;
3478
3479 case kActionDefault:
3480 getEntities()->clearSequences(kEntityCoudert);
3481
3482 getData()->entityPosition = kPosition_1500;
3483 getData()->location = kLocationOutsideCompartment;
3484 getData()->car = kCarRedSleeping;
3485 getData()->clothes = kClothesDefault;
3486 getData()->inventoryItem = kItemNone; // not in the original version, but it does no harm, I suppose?
3487
3488 ENTITY_PARAM(0, 2) = 1;
3489 ENTITY_PARAM(0, 3) = 0;
3490 ENTITY_PARAM(0, 4) = 0;
3491 ENTITY_PARAM(0, 5) = 0;
3492 ENTITY_PARAM(0, 6) = 0;
3493 ENTITY_PARAM(0, 8) = 0;
3494
3495 ENTITY_PARAM(1, 1) = 0;
3496 ENTITY_PARAM(1, 3) = 0;
3497 ENTITY_PARAM(1, 5) = 0;
3498 ENTITY_PARAM(1, 6) = 0;
3499 ENTITY_PARAM(1, 7) = 0;
3500 ENTITY_PARAM(1, 8) = 0;
3501
3502 ENTITY_PARAM(2, 3) = 0;
3503 ENTITY_PARAM(2, 4) = 0;
3504
3505 getObjects()->updateModel(kObject111, kObjectModel10);
3506 break;
3507
3508 case kActionCallback:
3509 if (getCallback() == 1) {
3510 ENTITY_PARAM(1, 2) = 1;
3511 setup_function53();
3512 }
3513 break;
3514 }
3515 IMPLEMENT_FUNCTION_END
3516
3517 //////////////////////////////////////////////////////////////////////////
3518 IMPLEMENT_FUNCTION(53, Coudert, function53)
3519 switch (savepoint.action) {
3520 default:
3521 break;
3522
3523 case kActionNone:
3524 if (ENTITY_PARAM(2, 3)) {
3525 ENTITY_PARAM(1, 2) = 0;
3526 ENTITY_PARAM(1, 7) = 0;
3527
3528 params->param1 = 1;
3529
3530 getObjects()->updateModel(kObjectCompartmentA, kObjectModel1);
3531 getObjects()->updateModel(kObjectCompartmentB, kObjectModel1);
3532 getObjects()->updateModel(kObjectCompartmentC, kObjectModel1);
3533 getObjects()->updateModel(kObjectCompartmentD, kObjectModel1);
3534 getObjects()->updateModel(kObjectCompartmentE, kObjectModel1);
3535 getObjects()->updateModel(kObjectCompartmentF, kObjectModel1);
3536 getObjects()->updateModel(kObjectCompartmentG, kObjectModel1);
3537 getObjects()->updateModel(kObjectCompartmentH, kObjectModel1);
3538
3539 ENTITY_PARAM(2, 3) = 0;
3540
3541 setCallback(1);
3542 setup_function54();
3543 break;
3544 }
3545
3546 label_callback_1:
3547 if (ENTITY_PARAM(1, 2)) {
3548 if (!params->param2)
3549 params->param2 = (uint)(getState()->time + 4500);
3550
3551 if (params->param3 != kTimeInvalid) {
3552 if (Entity::updateParameterTime((TimeValue)params->param2, !getEntities()->isPlayerInCar(kCarRedSleeping), params->param3, 0)) {
3553 setCallback(2);
3554 setup_function55();
3555 break;
3556 }
3557 }
3558 }
3559
3560 label_callback_2:
3561 if (ENTITY_PARAM(1, 7)) {
3562 setCallback(3);
3563 setup_function34(false);
3564 break;
3565 }
3566
3567 label_callback_3:
3568 if (!params->param1) {
3569 if (Entity::timeCheckCallback(kTime2394000, params->param4, 4, WRAP_SETUP_FUNCTION(Coudert, setup_function56)))
3570 break;
3571
3572 label_callback_4:
3573 if (Entity::timeCheckCallback(kTime2434500, params->param5, 5, WRAP_SETUP_FUNCTION(Coudert, setup_function32)))
3574 break;
3575
3576 label_callback_5:
3577 if (Entity::timeCheckCallback(kTime2448000, params->param6, 6, WRAP_SETUP_FUNCTION(Coudert, setup_function32)))
3578 break;
3579 }
3580
3581 label_callback_6:
3582 if (getState()->time > kTime2538000 && !ENTITY_PARAM(0, 1) && !ENTITY_PARAM(2, 1)) {
3583 if (!Entity::updateParameter(params->param7, getState()->time, 2700))
3584 break;
3585
3586 ENTITY_PARAM(0, 2) = 0;
3587 ENTITY_PARAM(0, 1) = 1;
3588
3589 getEntities()->drawSequenceLeft(kEntityCoudert, "697F");
3590
3591 params->param7 = 0;
3592 }
3593 break;
3594
3595 case kAction11:
3596 if (!ENTITY_PARAM(2, 1) && !ENTITY_PARAM(0, 1)) {
3597 setCallback(7);
3598 setup_function13((bool)savepoint.param.intValue, savepoint.entity2);
3599 }
3600 break;
3601
3602 case kActionDefault:
3603 getData()->car = kCarRedSleeping;
3604 getData()->entityPosition = kPosition_1500;
3605 getData()->location = kLocationOutsideCompartment;
3606
3607 getScenes()->loadSceneFromItemPosition(kItem5);
3608 break;
3609
3610 case kActionDrawScene:
3611 if (!ENTITY_PARAM(2, 1) && !ENTITY_PARAM(0, 1)) {
3612 if (getEntities()->isPlayerPosition(kCarRedSleeping, 1)) {
3613 setCallback(8);
3614 setup_function13(true, kEntityPlayer);
3615 } else if (getEntities()->isPlayerPosition(kCarRedSleeping, 23)) {
3616 setCallback(9);
3617 setup_function13(false, kEntityPlayer);
3618 }
3619 }
3620 break;
3621
3622 case kActionCallback:
3623 switch (getCallback()) {
3624 default:
3625 break;
3626
3627 case 1:
3628 goto label_callback_1;
3629
3630 case 2:
3631 goto label_callback_2;
3632
3633 case 3:
3634 goto label_callback_3;
3635
3636 case 4:
3637 goto label_callback_4;
3638
3639 case 5:
3640 goto label_callback_5;
3641
3642 case 6:
3643 goto label_callback_6;
3644
3645 case 10:
3646 setCallback(11);
3647 setup_function18();
3648 break;
3649 }
3650 break;
3651
3652 case kAction225358684:
3653 if (!ENTITY_PARAM(0, 1)) {
3654 setCallback(12);
3655 setup_function30((ObjectIndex)savepoint.param.intValue);
3656 }
3657 break;
3658
3659 case kAction226078300:
3660 if (!ENTITY_PARAM(2, 1) && !ENTITY_PARAM(0, 1)) {
3661 getSound()->playSound(kEntityCoudert, "JAC2020");
3662
3663 setCallback(10);
3664 setup_bloodJacket("697D");
3665 }
3666 break;
3667
3668 case kAction305159806:
3669 if (!ENTITY_PARAM(2, 1) && !ENTITY_PARAM(0, 1)) {
3670 setCallback(13);
3671 setup_function31(savepoint.param.intValue);
3672 }
3673 break;
3674 }
3675 IMPLEMENT_FUNCTION_END
3676
3677 //////////////////////////////////////////////////////////////////////////
3678 IMPLEMENT_FUNCTION(54, Coudert, function54)
3679 switch (savepoint.action) {
3680 default:
3681 break;
3682
3683 case kActionDefault:
3684 if (getEntities()->hasValidFrame(kEntityCoudert)) {
3685 getData()->location = kLocationOutsideCompartment;
3686
3687 setCallback(1);
3688 setup_updateEntity(kCarRedSleeping, kPosition_540);
3689 } else {
3690 getData()->car = kCarLocomotive;
3691 getData()->entityPosition = kPosition_540;
3692 }
3693 break;
3694
3695 case kActionCallback:
3696 switch (getCallback()) {
3697 default:
3698 break;
3699
3700 case 1:
3701 getEntities()->clearSequences(kEntityCoudert);
3702 getData()->car = kCarLocomotive;
3703 break;
3704
3705 case 2:
3706 setCallback(3);
3707 setup_function18();
3708 break;
3709
3710 case 3:
3711 callbackAction();
3712 break;
3713 }
3714 break;
3715
3716 case kAction191001984:
3717 getData()->car = kCarRedSleeping;
3718 setCallback(2);
3719 setup_updateEntity(kCarRedSleeping, kPosition_1500);
3720 }
3721 IMPLEMENT_FUNCTION_END
3722
3723 //////////////////////////////////////////////////////////////////////////
3724 IMPLEMENT_FUNCTION(55, Coudert, function55)
3725 switch (savepoint.action) {
3726 default:
3727 break;
3728
3729 case kActionDefault:
3730 setCallback(1);
3731 setup_playSound("LIB070");
3732 break;
3733
3734 case kActionCallback:
3735 switch (getCallback()) {
3736 default:
3737 break;
3738
3739 case 1:
3740 setCallback(2);
3741 setup_function16();
3742 break;
3743
3744 case 2:
3745 setCallback(3);
3746 setup_updateEntity(kCarRedSleeping, kPosition_4070);
3747 break;
3748
3749 case 3:
3750 getEntities()->drawSequenceLeft(kEntityCoudert, "627Wf");
3751 getEntities()->enterCompartment(kEntityCoudert, kObjectCompartmentF, true);
3752
3753 setCallback(4);
3754 setup_playSound("Ann4150A");
3755 break;
3756
3757 case 4:
3758 getEntities()->exitCompartment(kEntityCoudert, kObjectCompartmentF, true);
3759 getSavePoints()->push(kEntityCoudert, kEntityAnna, kAction219971920);
3760 getSavePoints()->push(kEntityCoudert, kEntityPascale, kAction101824388);
3761
3762 setCallback(5);
3763 setup_updateEntity(kCarRedSleeping, kPosition_9460);
3764 break;
3765
3766 case 5:
3767 getEntities()->clearSequences(kEntityCoudert);
3768 getSavePoints()->push(kEntityCoudert, kEntityPascale, kAction136059947);
3769 break;
3770
3771 case 6:
3772 ENTITY_PARAM(1, 2) = 0;
3773
3774 setCallback(7);
3775 setup_function18();
3776 break;
3777
3778 case 7:
3779 callbackAction();
3780 break;
3781 }
3782 break;
3783
3784 case kAction123712592:
3785 setCallback(6);
3786 setup_updateEntity(kCarRedSleeping, kPosition_2000);
3787 break;
3788 }
3789 IMPLEMENT_FUNCTION_END
3790
3791 //////////////////////////////////////////////////////////////////////////
3792 IMPLEMENT_FUNCTION(56, Coudert, function56)
3793 switch (savepoint.action) {
3794 default:
3795 break;
3796
3797 case kActionDefault:
3798 setCallback(1);
3799 setup_function16();
3800 break;
3801
3802 case kActionCallback:
3803 switch (getCallback()) {
3804 default:
3805 break;
3806
3807 case 1:
3808 setCallback(2);
3809 setup_function21();
3810 break;
3811
3812 case 2:
3813 setCallback(3);
3814 setup_function33();
3815 break;
3816
3817 case 3:
3818 setCallback(4);
3819 setup_function22();
3820 break;
3821
3822 case 4:
3823 setCallback(5);
3824 setup_function33();
3825 break;
3826
3827 case 5:
3828 setCallback(6);
3829 setup_visitCompartmentF();
3830 break;
3831
3832 case 6:
3833 setCallback(7);
3834 setup_function33();
3835 break;
3836
3837 case 7:
3838 setCallback(8);
3839 setup_function25();
3840 break;
3841
3842 case 8:
3843 setCallback(9);
3844 setup_function33();
3845 break;
3846
3847 case 9:
3848 setCallback(10);
3849 setup_function26();
3850 break;
3851
3852 case 10:
3853 setCallback(11);
3854 setup_function33();
3855 break;
3856
3857 case 11:
3858 setCallback(12);
3859 setup_function27();
3860 break;
3861
3862 case 12:
3863 setCallback(13);
3864 setup_function33();
3865 break;
3866
3867 case 13:
3868 setCallback(14);
3869 setup_visitCompartmentB();
3870 break;
3871
3872 case 14:
3873 setCallback(15);
3874 setup_updateEntity(kCarRedSleeping, kPosition_2000);
3875 break;
3876
3877 case 15:
3878 setCallback(16);
3879 setup_function18();
3880 break;
3881
3882 case 16:
3883 callbackAction();
3884 break;
3885 }
3886 break;
3887 }
3888 IMPLEMENT_FUNCTION_END
3889
3890 //////////////////////////////////////////////////////////////////////////
3891 IMPLEMENT_FUNCTION(57, Coudert, chapter5)
3892 switch (savepoint.action) {
3893 default:
3894 break;
3895
3896 case kActionNone:
3897 setup_chapter5Handler();
3898 break;
3899
3900 case kActionDefault:
3901 getEntities()->clearSequences(kEntityCoudert);
3902
3903 getData()->entityPosition = kPosition_3969;
3904 getData()->location = kLocationInsideCompartment;
3905 getData()->car = kCarRestaurant;
3906 getData()->inventoryItem = kItemNone;
3907 break;
3908 }
3909 IMPLEMENT_FUNCTION_END
3910
3911 //////////////////////////////////////////////////////////////////////////
3912 IMPLEMENT_FUNCTION(58, Coudert, chapter5Handler)
3913 if (savepoint.action == kActionProceedChapter5)
3914 setup_function59();
3915 IMPLEMENT_FUNCTION_END
3916
3917 //////////////////////////////////////////////////////////////////////////
3918 IMPLEMENT_FUNCTION(59, Coudert, function59)
3919 switch (savepoint.action) {
3920 default:
3921 break;
3922
3923 case kActionDefault:
3924 getData()->entityPosition = kPosition_7500;
3925 getData()->location = kLocationOutsideCompartment;
3926 getData()->car = kCarRedSleeping;
3927
3928 getSound()->playSound(kEntityCoudert, "Jac5010"); // Situation is under control, please remain in your compartment
3929
3930 setCallback(1);
3931 setup_updateEntity(kCarRedSleeping, kPosition_2000);
3932 break;
3933
3934 case kActionCallback:
3935 if (getCallback() == 1) {
3936 getEntities()->drawSequenceLeft(kEntityCoudert, "627K");
3937 setup_function60();
3938 }
3939 break;
3940 }
3941 IMPLEMENT_FUNCTION_END
3942
3943 //////////////////////////////////////////////////////////////////////////
3944 IMPLEMENT_FUNCTION(60, Coudert, function60)
3945 switch (savepoint.action) {
3946 default:
3947 break;
3948
3949 case kActionCallback:
3950 if (getCallback() == 1)
3951 setup_function61();
3952 break;
3953
3954 case kAction155991520:
3955 setCallback(1);
3956 setup_updateFromTime(225);
3957 break;
3958 }
3959 IMPLEMENT_FUNCTION_END
3960
3961 //////////////////////////////////////////////////////////////////////////
3962 IMPLEMENT_FUNCTION(61, Coudert, function61)
3963 switch (savepoint.action) {
3964 default:
3965 break;
3966
3967 case kActionDefault:
3968 getData()->entityPosition = kPosition_2088;
3969
3970 setCallback(1);
3971 setup_updateEntity(kCarRedSleeping, kPosition_4840);
3972 break;
3973
3974 case kActionCallback:
3975 switch (getCallback()) {
3976 default:
3977 break;
3978
3979 case 1:
3980 setCallback(2);
3981 setup_enterExitCompartment("627Me", kObjectCompartmentE);
3982 break;
3983
3984 case 2:
3985 getEntities()->drawSequenceLeft(kEntityCoudert, "627Ne");
3986 getEntities()->enterCompartment(kEntityCoudert, kObjectCompartmentE, true);
3987
3988 setCallback(3);
3989 setup_updateFromTime(75);
3990 break;
3991
3992 case 3:
3993 getEntities()->exitCompartment(kEntityCoudert, kObjectCompartmentE, true);
3994
3995 setCallback(4);
3996 setup_enterExitCompartment("627Re", kObjectCompartmentE);
3997 break;
3998
3999 case 4:
4000 getData()->location = kLocationInsideCompartment;
4001
4002 getEntities()->clearSequences(kEntityCoudert);
4003 getObjects()->update(kObjectCompartmentE, kEntityPlayer, kObjectLocation3, kCursorHandKnock, kCursorHand);
4004
4005 setCallback(5);
4006 setup_playSound("Reb5010");
4007 break;
4008
4009 case 5:
4010 setCallback(6);
4011 setup_enterExitCompartment("627Se", kObjectCompartmentE);
4012 break;
4013
4014 case 6:
4015 getSavePoints()->push(kEntityCoudert, kEntityRebecca, kAction155604840);
4016
4017 getData()->location = kLocationOutsideCompartment;
4018
4019 setCallback(7);
4020 setup_updateEntity(kCarRedSleeping, kPosition_2740);
4021 break;
4022
4023 case 7:
4024 setCallback(8);
4025 setup_enterExitCompartment("627Zh", kObjectCompartmentH);
4026 break;
4027
4028 case 8:
4029 getData()->location = kLocationInsideCompartment;
4030
4031 getEntities()->clearSequences(kEntityCoudert);
4032 getSavePoints()->push(kEntityCoudert, kEntityPascale, kAction169750080);
4033
4034 setup_function62();
4035 break;
4036 }
4037 break;
4038 }
4039 IMPLEMENT_FUNCTION_END
4040
4041 //////////////////////////////////////////////////////////////////////////
4042 IMPLEMENT_FUNCTION(62, Coudert, function62)
4043 switch (savepoint.action) {
4044 default:
4045 break;
4046
4047 case kActionNone:
4048 if (params->param1) {
4049 if (!Entity::updateParameter(params->param4, getState()->timeTicks, 75))
4050 break;
4051
4052 params->param1 = 0;
4053 params->param2 = 1;
4054
4055 getObjects()->update(kObjectCompartmentH, kEntityCoudert, kObjectLocation1, kCursorNormal, kCursorNormal);
4056 }
4057
4058 params->param4 = 0;
4059 break;
4060
4061 case kActionKnock:
4062 case kActionOpenDoor:
4063 if (params->param1) {
4064 getObjects()->update(kObjectCompartmentH, kEntityCoudert, kObjectLocation1, kCursorNormal, kCursorNormal);
4065 params->param1 = 0;
4066
4067 setCallback(1);
4068 setup_playSound(getSound()->justCheckingCath());
4069 } else {
4070 setCallback(savepoint.action == kActionKnock ? 2 : 3);
4071 setup_playSound(savepoint.action == kActionKnock ? "LIB012" : "LIB013");
4072 }
4073 break;
4074
4075 case kActionDefault:
4076 getObjects()->update(kObjectCompartmentH, kEntityCoudert, kObjectLocation1, kCursorHandKnock, kCursorHand);
4077 break;
4078
4079 case kActionDrawScene:
4080 if (params->param1 || params->param2) {
4081 params->param1 = 0;
4082 params->param2 = 0;
4083 params->param3 = 0;
4084
4085 getObjects()->update(kObjectCompartmentH, kEntityCoudert, kObjectLocation1, kCursorHandKnock, kCursorHand);
4086 }
4087 break;
4088
4089 case kActionCallback:
4090 switch (getCallback()) {
4091 default:
4092 break;
4093
4094 case 1:
4095 getObjects()->update(kObjectCompartmentH, kEntityCoudert, kObjectLocation1, kCursorHandKnock, kCursorHand);
4096 break;
4097
4098 case 2:
4099 case 3:
4100 ++params->param3;
4101
4102 if (params->param3 == 1 || params->param3 == 2) {
4103 getObjects()->update(kObjectCompartmentH, kEntityCoudert, kObjectLocation1, kCursorNormal, kCursorNormal);
4104 setCallback(params->param3 == 1 ? 4 : 5);
4105 setup_playSound(params->param3 == 1 ? "Jac5002" : "Jac5002A");
4106 }
4107 break;
4108
4109 case 4:
4110 params->param1 = 1;
4111 getObjects()->update(kObjectCompartmentH, kEntityCoudert, kObjectLocation1, kCursorTalk, kCursorNormal);
4112 break;
4113
4114 case 5:
4115 params->param2 = 1;
4116 break;
4117 }
4118 break;
4119
4120 case kAction135800432:
4121 setup_nullfunction();
4122 break;
4123 }
4124 IMPLEMENT_FUNCTION_END
4125
4126 //////////////////////////////////////////////////////////////////////////
4127 IMPLEMENT_NULL_FUNCTION(63, Coudert)
4128
4129
4130 //////////////////////////////////////////////////////////////////////////
4131 // Private functions
4132 //////////////////////////////////////////////////////////////////////////
visitCompartment(const SavePoint & savepoint,EntityPosition position,const char * seq1,ObjectIndex compartment,const char * seq2,const char * seq3,EntityPosition sittingPosition,ObjectIndex object,const char * seq4)4133 void Coudert::visitCompartment(const SavePoint &savepoint, EntityPosition position, const char *seq1, ObjectIndex compartment, const char *seq2, const char *seq3, EntityPosition sittingPosition, ObjectIndex object, const char *seq4) {
4134 EXPOSE_PARAMS(EntityData::EntityParametersIIII)
4135
4136 switch (savepoint.action) {
4137 default:
4138 break;
4139
4140 case kActionDefault:
4141 setCallback(1);
4142 setup_updateEntity(kCarRedSleeping, position);
4143 break;
4144
4145 case kActionCallback:
4146 switch (getCallback()) {
4147 default:
4148 break;
4149
4150 case 1:
4151 setCallback(2);
4152 setup_enterExitCompartment(seq1, compartment);
4153 break;
4154
4155 case 2:
4156 getEntities()->drawSequenceLeft(kEntityCoudert, seq2);
4157 getEntities()->enterCompartment(kEntityCoudert, compartment, true);
4158
4159 setCallback(3);
4160 setup_updateFromTime(150);
4161 break;
4162
4163 case 3:
4164 setCallback(4);
4165 setup_enterExitCompartment2(seq3, compartment, position, sittingPosition);
4166 break;
4167
4168 case 4:
4169 getEntities()->exitCompartment(kEntityCoudert, compartment, true);
4170 getData()->location = kLocationInsideCompartment;
4171 getEntities()->clearSequences(kEntityCoudert);
4172
4173 setCallback(5);
4174 setup_function20(compartment, object);
4175 break;
4176
4177 case 5:
4178 setCallback(6);
4179 setup_enterExitCompartment(seq4, compartment);
4180 break;
4181
4182 case 6:
4183 getData()->location = kLocationOutsideCompartment;
4184 callbackAction();
4185 break;
4186 }
4187 break;
4188 }
4189 }
4190
4191 } // End of namespace LastExpress
4192