1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
|
//
// Generated by dtk
// Translation Unit: d_event.cpp
//
#include "d/dolzel.h" // IWYU pragma: keep
#include "d/d_event.h"
#include "d/d_com_inf_game.h"
#include "d/actor/d_a_itembase.h"
#include "f_op/f_op_actor.h" // dEvt_info_c
#include "f_op/f_op_actor_mng.h"
#include "f_pc/f_pc_manager.h"
/* 8006FE04-8006FE54 .text __ct__14dEvt_control_cFv */
dEvt_control_c::dEvt_control_c() {
remove();
}
/* 8006FE54-8006FE58 .text __ct__12dEvt_order_cFv */
dEvt_order_c::dEvt_order_c() {}
/* 8006FE58-8006FEE8 .text orderOld__14dEvt_control_cFUsUsUsUsPvPvPCv */
s32 dEvt_control_c::orderOld(u16 eventType, u16 priority, u16 flag, u16 hindFlag, void* ac1, void* ac2, const void* eventName) {
return order(
eventType,
priority,
flag,
hindFlag,
ac1,
ac2,
(s32)dComIfGp_evmng_getEventIdx((const char*)eventName),
0xFF
);
}
/* 8006FEE8-8007002C .text order__14dEvt_control_cFUsUsUsUsPvPvsUc */
s32 dEvt_control_c::order(u16 eventType, u16 priority, u16 flag, u16 hindFlag, void* ac1, void* ac2, s16 eventIdx, u8 eventInfoIdx) {
if (mOrderCount >= 8)
return FALSE;
dEvt_order_c* pNewOrder = &mOrder[mOrderCount];
pNewOrder->mEventType = eventType;
pNewOrder->mPriority = priority;
pNewOrder->mFlag = flag;
pNewOrder->mActor1 = (fopAc_ac_c*)ac1;
pNewOrder->mActor2 = (fopAc_ac_c*)ac2;
pNewOrder->mEventId = eventIdx;
pNewOrder->mHindFlag = hindFlag;
pNewOrder->mEventInfoIdx = eventInfoIdx;
if (pNewOrder->mPriority == 0)
JUT_ASSERT(147, FALSE);
if (mOrderCount == 0) {
mFirstOrderIdx = 0;
pNewOrder->mNextOrderIdx = -1;
} else {
dEvt_order_c* pQueue;
s32 queueIdx = mFirstOrderIdx;
pQueue = &mOrder[queueIdx];
if (pNewOrder->mPriority < pQueue->mPriority) {
mFirstOrderIdx = mOrderCount;
pNewOrder->mNextOrderIdx = queueIdx;
} else {
s8 nextQueueIdx;
while ((nextQueueIdx = pQueue->mNextOrderIdx) >= 0) {
dEvt_order_c* r6 = &mOrder[pQueue->mNextOrderIdx];
if (pNewOrder->mPriority < r6->mPriority)
break;
pQueue = &mOrder[nextQueueIdx];
}
pNewOrder->mNextOrderIdx = nextQueueIdx;
pQueue->mNextOrderIdx = mOrderCount;
}
}
mOrderCount++;
return TRUE;
}
/* 8007002C-8007015C .text setParam__14dEvt_control_cFP12dEvt_order_c */
void dEvt_control_c::setParam(dEvt_order_c* order) {
dStage_EventInfo_c* stageEventInfo = dComIfGp_getStage().getEventInfo();
setPt1(order->mActor1);
setPt2(order->mActor2);
mEventId = order->mEventId;
mHindFlag = order->mHindFlag;
if (dComIfGp_getPlayer(0) != order->mActor1) {
setPtT(order->mActor1);
setPtI(order->mActor1);
} else {
setPtT(order->mActor2);
setPtI(order->mActor2);
}
mEventInfoIdx = order->mEventInfoIdx;
if (order->mEventInfoIdx == 0xFF || stageEventInfo == NULL || order->mEventInfoIdx >= stageEventInfo->num)
field_0xde = 0xFF;
else
field_0xde = stageEventInfo->events[order->mEventInfoIdx].field_0x10;
mCullFarClipRatio = 1.0f;
mEventFlag = 0;
}
/* 8007015C-8007018C .text beforeFlagProc__14dEvt_control_cFP12dEvt_order_c */
BOOL dEvt_control_c::beforeFlagProc(dEvt_order_c* order) {
fopAc_ac_c* actor2 = order->mActor2;
if ((order->mFlag & dEvtFlag_TALK_e) && actor2->eventInfo.chkCondition(dEvtCnd_CANTALK_e) == FALSE)
return false;
return true;
}
/* 8007018C-80070218 .text afterFlagProc__14dEvt_control_cFP12dEvt_order_c */
void dEvt_control_c::afterFlagProc(dEvt_order_c* order) {
if ((order->mFlag & dEvtFlag_NOPARTNER_e))
mPt2 = getPId(NULL);
if ((order->mFlag & dEvtFlag_STAFF_ALL_e))
dComIfGp_getPEvtManager()->issueStaff("ALL");
if ((order->mFlag & dEvtFlag_UNK8_e))
onEventFlag(0x20);
}
/* 80070218-80070290 .text commonCheck__14dEvt_control_cFP12dEvt_order_cUsUs */
BOOL dEvt_control_c::commonCheck(dEvt_order_c* order, u16 cond, u16 cmd) {
fopAc_ac_c* actor1 = order->mActor1;
fopAc_ac_c* actor2 = order->mActor2;
if (actor1 != NULL && actor1->eventInfo.chkCondition(cond) && actor2 != NULL && actor2->eventInfo.chkCondition(cond)) {
actor1->eventInfo.setCommand(cmd);
actor2->eventInfo.setCommand(cmd);
setParam(order);
return TRUE;
} else {
return FALSE;
}
}
/* 80070290-80070390 .text talkCheck__14dEvt_control_cFP12dEvt_order_c */
BOOL dEvt_control_c::talkCheck(dEvt_order_c* order) {
const char* defaultEventName = "DEFAULT_TALK";
fopAc_ac_c* actor2 = order->mActor2;
if (commonCheck(order, dEvtCnd_CANTALK_e, dEvtCmd_INTALK_e)) {
mMode = dEvtMode_TALK_e;
if (mEventId == -1) {
if (actor2 != NULL && actor2->eventInfo.getEventName() != NULL) {
mEventId = actor2->eventInfo.getEventId();
} else {
mEventId = dComIfGp_evmng_getEventIdx(defaultEventName);
}
}
if (!dComIfGp_evmng_order(mEventId))
JUT_ASSERT(325, FALSE);
return TRUE;
} else {
return FALSE;
}
}
/* 80070390-8007055C .text talkXyCheck__14dEvt_control_cFP12dEvt_order_c */
BOOL dEvt_control_c::talkXyCheck(dEvt_order_c* order) {
const char* defaultEventName = "DEFAULT_TALK_XY";
fopAc_ac_c* actor2 = order->mActor2;
int itemBtn;
switch (order->mEventType) {
case dEvtType_SHOWITEM_X_e:
itemBtn = dItemBtn_X_e;
break;
case dEvtType_SHOWITEM_Y_e:
itemBtn = dItemBtn_Y_e;
break;
default:
itemBtn = dItemBtn_Z_e;
break;
}
if (dComIfGp_getSelectItem(itemBtn) == dItemNo_NONE_e) {
return FALSE;
}
if (actor2 == NULL || actor2->eventInfo.chkCondition(dEvtCnd_CANTALKITEM_e) == FALSE) {
return FALSE;
}
if (commonCheck(order, dEvtCnd_CANTALK_e, dEvtCmd_INTALK_e)) {
mMode = dEvtMode_TALK_e;
mItemNo = dComIfGp_getSelectItem(itemBtn);
switch (order->mEventType) {
case dEvtType_SHOWITEM_X_e:
mTalkButton = dTalkBtn_X_e;
break;
case dEvtType_SHOWITEM_Y_e:
mTalkButton = dTalkBtn_Y_e;
break;
default:
mTalkButton = dTalkBtn_Z_e;
break;
}
// Fakematch
s16 r3;
if (actor2 != NULL && (r3 = actor2->eventInfo.runXyEventCB(actor2, itemBtn), r3 != -1)) {
mEventId = r3;
} else {
mEventId = dComIfGp_evmng_getEventIdx(defaultEventName);
}
if (!dComIfGp_evmng_order(mEventId)) {
JUT_ASSERT(401, FALSE);
}
return TRUE;
}
return FALSE;
}
/* 8007055C-800706D8 .text photoCheck__14dEvt_control_cFP12dEvt_order_c */
BOOL dEvt_control_c::photoCheck(dEvt_order_c* order) {
fopAc_ac_c* actor2 = order->mActor2;
const char* defaultEventName = "DEFAULT_TALK";
mbInPhoto = 0;
if (dComIfGp_getPictureStatus() == 1) {
JUT_ASSERT(421, actor2);
if (!commonCheck(order, dEvtCnd_CANTALK_e, dEvtCmd_INTALK_e))
return FALSE;
s16 eventId = actor2->eventInfo.runPhotoEventCB(actor2, 0);
if (eventId != -1) {
mEventId = eventId;
} else {
mEventId = dComIfGp_evmng_getEventIdx(defaultEventName);
}
if (!dComIfGp_evmng_order(mEventId))
JUT_ASSERT(437, FALSE);
mbInPhoto = 1;
mMode = dEvtMode_TALK_e;
return TRUE;
} else if (dComIfGp_getPictureStatus() == 0) {
return FALSE;
}
return FALSE;
}
/* 800706D8-800707C0 .text catchCheck__14dEvt_control_cFP12dEvt_order_c */
BOOL dEvt_control_c::catchCheck(dEvt_order_c* order) {
fopAc_ac_c* actor2 = order->mActor2;
fopAc_ac_c* actor1 = order->mActor1;
if (actor1 == NULL || (actor2 != NULL && actor2->eventInfo.chkCondition(dEvtCnd_CANCATCH_e) == FALSE))
return FALSE;
actor1->eventInfo.setCommand(dEvtCmd_INCATCH_e);
if (actor2 != NULL)
actor2->eventInfo.setCommand(dEvtCmd_INCATCH_e);
setParam(order);
mItemNo = dComIfGp_att_getCatchChgItem();
mMode = dEvtMode_DEMO_e;
if (mEventId != -1 && !dComIfGp_evmng_order(mEventId))
JUT_ASSERT(483, FALSE);
#if VERSION > VERSION_DEMO
onEventFlag(0x80);
#endif
return TRUE;
}
/* 800707C0-80070870 .text talkEnd__14dEvt_control_cFv */
BOOL dEvt_control_c::talkEnd() {
fopAc_ac_c* actor1 = getPt1();
if (actor1 != NULL)
actor1->eventInfo.setCommand(dEvtCmd_NONE_e);
fopAc_ac_c* actor2 = getPt2();
if (actor2 != NULL)
actor2->eventInfo.setCommand(dEvtCmd_NONE_e);
if (mEventId != -1) {
dComIfGp_getPEvtManager()->endProc(mEventId, 1);
mEventId = -1;
}
fopAc_ac_c* itemPartner = fopAcM_getItemEventPartner(NULL);
if (itemPartner != NULL && (fopAcM_GetName(itemPartner) == fpcNm_ITEM_e || fopAcM_GetName(itemPartner) == fpcNm_Demo_Item_e))
((daItemBase_c*)itemPartner)->dead();
return TRUE;
}
/* 80070870-800709C0 .text demoCheck__14dEvt_control_cFP12dEvt_order_c */
BOOL dEvt_control_c::demoCheck(dEvt_order_c* order) {
fopAc_ac_c* actor1 = order->mActor1;
fopAc_ac_c* actor2 = order->mActor2;
s16 eventId = order->mEventId;
if (actor2 == NULL) {
JUT_ASSERT(DEMO_SELECT(541, 543), FALSE);
return FALSE;
}
if (!beforeFlagProc(order))
return FALSE;
if (!dComIfGp_evmng_order(eventId))
return FALSE;
if (actor1 != NULL)
actor1->eventInfo.setCommand(dEvtCmd_INDEMO_e);
if (actor2 != NULL)
actor2->eventInfo.setCommand(dEvtCmd_INDEMO_e);
mMode = dEvtMode_DEMO_e;
setParam(order);
afterFlagProc(order);
u8 eventEndSound = dComIfGp_evmng_getEventEndSound(eventId);
if (eventEndSound != 0 && mEventEndSound == 0) {
mEventEndSound = eventEndSound;
mDoAud_seStart(JA_SE_READ_RIDDLE_1);
}
return TRUE;
}
/* 800709C0-80070A64 .text demoEnd__14dEvt_control_cFv */
BOOL dEvt_control_c::demoEnd() {
fopAc_ac_c* actor1 = getPt1();
if (actor1 != NULL)
actor1->eventInfo.setCommand(dEvtCmd_NONE_e);
fopAc_ac_c* actor2 = getPt2();
if (actor2 != NULL)
actor2->eventInfo.setCommand(dEvtCmd_NONE_e);
if (mEventId != -1) {
dComIfGp_getPEvtManager()->endProc(mEventId, 1);
mEventId = -1;
}
dComIfGp_getPEvtManager()->cancelStaff("ALL");
return TRUE;
}
/* 80070A64-80070B24 .text potentialCheck__14dEvt_control_cFP12dEvt_order_c */
BOOL dEvt_control_c::potentialCheck(dEvt_order_c* order) {
fopAc_ac_c* actor1 = order->mActor1;
fopAc_ac_c* actor2 = order->mActor2;
if (actor1 == NULL || actor2 == NULL)
JUT_ASSERT(DEMO_SELECT(638, 640), FALSE);
if (!beforeFlagProc(order))
return FALSE;
actor1->eventInfo.setCommand(dEvtCmd_INDEMO_e);
mMode = dEvtMode_DEMO_e;
setParam(order);
afterFlagProc(order);
return TRUE;
}
/* 80070B24-80070C54 .text doorCheck__14dEvt_control_cFP12dEvt_order_c */
BOOL dEvt_control_c::doorCheck(dEvt_order_c* order) {
if (commonCheck(order, dEvtCnd_CANDOOR_e, dEvtCmd_INDOOR_e)) {
mMode = dEvtMode_DEMO_e;
fopAc_ac_c* actor2 = getPt2();
if (mEventId == -1 && actor2 != NULL && actor2->eventInfo.getEventId() != -1)
mEventId = actor2->eventInfo.getEventId();
if (mEventId != -1 && dComIfGp_getPEvtManager()->getEventData(mEventId) != NULL) {
if (!dComIfGp_evmng_order(mEventId))
JUT_ASSERT(DEMO_SELECT(702, 704), FALSE);
} else {
mEventId = -1;
reset();
}
if (order->mEventType == dEvtType_TREASURE_e)
dComIfGp_event_onEventFlag(4);
return TRUE;
} else {
return FALSE;
}
}
/* 80070C54-80070D1C .text itemCheck__14dEvt_control_cFP12dEvt_order_c */
BOOL dEvt_control_c::itemCheck(dEvt_order_c* order) {
const char* defaultEventName = "DEFAULT_GETITEM";
if (commonCheck(order, dEvtCnd_CANGETITEM_e, dEvtCmd_INGETITEM_e)) {
mMode = dEvtMode_DEMO_e;
mEventId = dComIfGp_evmng_getEventIdx(defaultEventName);
if (!dComIfGp_evmng_order(mEventId))
JUT_ASSERT(DEMO_SELECT(744, 746), FALSE);
return TRUE;
} else {
return FALSE;
}
}
/* 80070D1C-80070DD4 .text endProc__14dEvt_control_cFv */
BOOL dEvt_control_c::endProc() {
switch (getMode()) {
case dEvtMode_TALK_e:
talkEnd();
break;
case dEvtMode_DEMO_e:
demoEnd();
break;
case dEvtMode_COMPULSORY_e:
break;
default:
JUT_ASSERT(DEMO_SELECT(787, 789), FALSE);
break;
}
mMode = dEvtMode_NONE_e;
field_0xde = 0xFF;
mEventInfoIdx = 0xFF;
mTalkButton = dTalkBtn_NONE_e;
mbInPhoto = 0;
mItemNo = 0xFF;
mEventFlag = 0;
return TRUE;
}
/* 80070DD4-80070E1C .text checkChange__14dEvt_control_cFv */
BOOL dEvt_control_c::checkChange() {
if (mOrderCount != 0) {
dEvt_order_c* order;
s8 nextIdx = mFirstOrderIdx;
while (true) {
order = &mOrder[nextIdx];
nextIdx = order->mNextOrderIdx;
if ((s32)order->mEventType != dEvtType_CHANGE_e) {
// Fakematch, assigning a float member to itself tricks the compiler into creating a beq then a b.
mCullFarClipRatio = mCullFarClipRatio;
} else {
return TRUE;
}
if (nextIdx < 0)
break;
}
}
return FALSE;
}
/* 80070E1C-80070EA8 .text changeProc__14dEvt_control_cFv */
BOOL dEvt_control_c::changeProc() {
if (mOrderCount != 0) {
mOrderCount = 0;
s8 nextIdx = mFirstOrderIdx;
while (true) {
dEvt_order_c* order = &mOrder[nextIdx];
nextIdx = order->mNextOrderIdx;
if ((s32)order->mEventType != dEvtType_CHANGE_e) {
// Fakematch, assigning a float member to itself tricks the compiler into creating a beq then a b.
mCullFarClipRatio = mCullFarClipRatio;
} else if (demoCheck(order)) {
return TRUE;
}
if (nextIdx < 0)
break;
}
}
return FALSE;
}
/* 80070EA8-80071020 .text checkStart__14dEvt_control_cFv */
BOOL dEvt_control_c::checkStart() {
if (mOrderCount != 0) {
s8 idx = mFirstOrderIdx;
mOrderCount = 0;
while (true) {
dEvt_order_c* pOrder = &mOrder[idx];
idx = pOrder->mNextOrderIdx;
switch (pOrder->mEventType) {
case dEvtType_TALK_e:
if (talkCheck(pOrder))
return TRUE;
break;
case dEvtType_OTHER_e:
if (demoCheck(pOrder))
return TRUE;
break;
case dEvtType_DOOR_e:
case dEvtType_TREASURE_e:
if (doorCheck(pOrder))
return TRUE;
break;
case dEvtType_COMPULSORY_e:
mMode = dEvtMode_COMPULSORY_e;
setParam(pOrder);
return TRUE;
case dEvtType_POTENTIAL_e:
return potentialCheck(pOrder);
case dEvtType_ITEM_e:
return itemCheck(pOrder);
case dEvtType_SHOWITEM_X_e:
case dEvtType_SHOWITEM_Y_e:
case dEvtType_SHOWITEM_Z_e:
if (talkXyCheck(pOrder))
return TRUE;
break;
case dEvtType_PHOTO_e:
if (photoCheck(pOrder))
return TRUE;
break;
case dEvtType_CATCH_e:
if (catchCheck(pOrder))
return TRUE;
break;
case dEvtType_CHANGE_e:
break;
default:
JUT_ASSERT(DEMO_SELECT(922, 924), FALSE);
break;
}
if (idx < 0)
break;
}
}
return FALSE;
}
/* 80071020-80071048 .text soundProc__14dEvt_control_cFv */
BOOL dEvt_control_c::soundProc() {
if (mEventEndSound != 0 && getMode() != dEvtMode_DEMO_e)
mEventEndSound = 0;
return TRUE;
}
/* 80071048-80071140 .text check__14dEvt_control_cFv */
BOOL dEvt_control_c::check() {
field_0xdb = 0;
field_0xdc = mOrderCount;
if (chkEventFlag(8)) {
mbEndProc = 1;
offEventFlag(8);
}
if (runCheck() && mbEndProc == 1) {
mbEndProc = 0;
endProc();
}
if (checkChange()) {
if (runCheck()) {
mbEndProc = 0;
endProc();
}
changeProc();
}
if (!runCheck() && checkStart())
dComIfGp_getVibration().StopQuake(-1);
soundProc();
mOrderCount = 0;
return FALSE;
}
/* 80071140-80071270 .text photoCheck__14dEvt_control_cFv */
BOOL dEvt_control_c::photoCheck() {
fopAc_ac_c* actor1;
fopAc_ac_c* actor2;
s8 orderIdx = mFirstOrderIdx;
if (mOrderCount != 0) {
dEvt_order_c* order = &mOrder[orderIdx];
int itemBtn = -1;
switch (order->mEventType) {
case dEvtType_SHOWITEM_X_e:
itemBtn = dItemBtn_X_e;
break;
case dEvtType_SHOWITEM_Y_e:
itemBtn = dItemBtn_Y_e;
break;
case dEvtType_SHOWITEM_Z_e:
itemBtn = dItemBtn_Z_e;
break;
}
if (itemBtn != -1 &&
(dComIfGp_getSelectItem(itemBtn) == dItemNo_PICTO_BOX_e || dComIfGp_getSelectItem(itemBtn) == dItemNo_DELUXE_PICTO_BOX_e) &&
dComIfGs_getPictureNum() != 0
) {
actor2 = order->mActor2;
if (actor2 == NULL) {
return FALSE;
}
if (!(actor2->attention_info.flags & fopAc_Attn_UNK1000000_e)) {
return FALSE;
}
if (dComIfGp_getPictureStatus() == 2) {
return FALSE;
}
actor1 = order->mActor1;
if (actor1 == NULL) {
return FALSE;
}
if (actor1->eventInfo.chkCondition(dEvtCnd_CANTALK_e) == FALSE ||
actor2->eventInfo.chkCondition(dEvtCnd_CANTALK_e) == FALSE
) {
return FALSE;
}
order->mEventType = dEvtType_PHOTO_e;
dComIfGp_setPictureStatusOn();
return TRUE;
}
}
return FALSE;
}
/* 80071270-80071418 .text moveApproval__14dEvt_control_cFPv */
s32 dEvt_control_c::moveApproval(void* actor) {
fopAc_ac_c* i_ac = (fopAc_ac_c*)actor;
if (runCheck() == FALSE)
return dEvtMove_MOVE_e;
switch (getMode()) {
case dEvtMode_TALK_e:
if (convPId(mPt1) == i_ac || convPId(mPt2) == i_ac)
return dEvtMove_FORCE_e;
break;
case dEvtMode_DEMO_e:
if (convPId(mPt1) == i_ac || convPId(mPt2) == i_ac)
return dEvtMove_FORCE_e;
if (i_ac->demoActorID != 0)
return dEvtMove_FORCE_e;
break;
case dEvtMode_COMPULSORY_e:
if (convPId(mPt1) == i_ac)
return dEvtMove_FORCE_e;
break;
}
if (fopAcM_CheckStatus(i_ac, fopAcStts_FORCEMOVE_e))
return dEvtMove_FORCE_e;
if (getMode() == dEvtMode_TALK_e && fopAcM_CheckStatus(i_ac, fopAcStts_UNK40_e))
return dEvtMove_MOVE_e;
if (dComIfGp_demo_mode() == 1)
return dEvtMove_MOVE_e;
if (fopAcM_CheckStatus(i_ac, fopAcStts_UNK800_e))
return dEvtMove_MOVE_e;
#if VERSION == VERSION_DEMO
if (dComIfGp_event_getMode() == dEvtMode_COMPULSORY_e && fopAcM_CheckStatus(i_ac, fopAcStts_BOSS_e))
return dEvtMove_NOMOVE_e;
#else
if ((dComIfGp_event_getMode() == dEvtMode_COMPULSORY_e || dComIfGp_event_getMode() == dEvtMode_TALK_e) && fopAcM_CheckStatus(i_ac, fopAcStts_BOSS_e))
return dEvtMove_NOMOVE_e;
if (chkEventFlag(0x80) && fopAcM_CheckStatus(i_ac, fopAcStts_BOSS_e))
return dEvtMove_NOMOVE_e;
#endif
if (fopAcM_CheckStatus(i_ac, fopAcStts_UNK4000_e))
return dEvtMove_MOVE_e;
if (fopAcM_CheckStatus(i_ac, fopAcStts_CARRY_e))
return dEvtMove_MOVE_e;
return dEvtMove_NOMOVE_e;
}
/* 80071418-80071468 .text compulsory__14dEvt_control_cFPvPCcUs */
BOOL dEvt_control_c::compulsory(void* actor, const char* eventName, u16 p3) {
if (getMode() != dEvtMode_NONE_e)
return FALSE;
return orderOld(dEvtType_COMPULSORY_e, 1, 0, p3, actor, NULL, eventName);
}
/* 80071468-800714AC .text remove__14dEvt_control_cFv */
void dEvt_control_c::remove() {
mMode = dEvtMode_NONE_e;
mbEndProc = 0;
mOrderCount = 0;
field_0xdd = 0;
mEventEndSound = 0;
field_0xdb = 0;
mCullFarClipRatio = 0.0f;
field_0xde = 0xff;
mEventInfoIdx = 0xff;
mTalkButton = dTalkBtn_NONE_e;
mbInPhoto = 0;
mItemNo = 0xff;
mEventFlag = 0;
}
/* 800714AC-80071534 .text getStageEventDt__14dEvt_control_cFv */
dStage_Event_dt_c* dEvt_control_c::getStageEventDt() {
dStage_EventInfo_c* stageEventInfo = dComIfGp_getStage().getEventInfo();
if (getMode() == dEvtMode_NONE_e)
return NULL;
if (stageEventInfo == NULL || mEventInfoIdx == 0xFF || mEventInfoIdx >= stageEventInfo->num)
return NULL;
return &stageEventInfo->events[mEventInfoIdx];
}
/* 80071534-800715B8 .text nextStageEventDt__14dEvt_control_cFPv */
dStage_Event_dt_c* dEvt_control_c::nextStageEventDt(void* idxp) {
dStage_EventInfo_c* stageEventInfo = dComIfGp_getStage().getEventInfo();
if (idxp == NULL)
return NULL;
if (stageEventInfo == NULL || *(u8*)idxp == 0xFF || *(u8*)idxp >= stageEventInfo->num)
return NULL;
return &stageEventInfo->events[*(u8*)idxp];
}
/* 800715B8-800715DC .text getPId__14dEvt_control_cFPv */
fpc_ProcID dEvt_control_c::getPId(void* ac) {
if (ac == NULL)
return fpcM_ERROR_PROCESS_ID_e;
return fopAcM_GetID(ac);
}
/* 800715DC-8007160C .text convPId__14dEvt_control_cFUi */
fopAc_ac_c* dEvt_control_c::convPId(fpc_ProcID pid) {
return fopAcM_SearchByID(pid);
}
/* 8007160C-80071618 .text getTactFreeMStick__14dEvt_control_cFi */
u8 dEvt_control_c::getTactFreeMStick(int which) {
return mTactFreeMStick[which];
}
/* 80071618-80071624 .text getTactFreeCStick__14dEvt_control_cFi */
u8 dEvt_control_c::getTactFreeCStick(int which) {
return mTactFreeCStick[which];
}
/* 80071624-80071658 .text __ct__11dEvt_info_cFv */
dEvt_info_c::dEvt_info_c() {
mCommand = dEvtCmd_NONE_e;
mCondition = dEvtCnd_NONE_e;
mEventId = -1;
mMapToolId = -1;
mpEventCB = NULL;
mpCheckCB = NULL;
}
/* 80071658-800716AC .text setEventName__11dEvt_info_cFPc */
void dEvt_info_c::setEventName(char* evtName) {
if (evtName == NULL) {
mEventId = -1;
} else {
mEventId = dComIfGp_evmng_getEventIdx(evtName);
}
}
/* 800716AC-800716F8 .text getEventName__11dEvt_info_cFv */
char* dEvt_info_c::getEventName() {
if (mEventId == -1) {
return NULL;
} else {
dEvDtEvent_c* evtData = dComIfGp_getPEvtManager()->getEventData(mEventId);
if (evtData == NULL)
return NULL;
return evtData->getName();
}
}
/* 800716F8-80071778 .text giveItemCut__14dEvt_control_cFUc */
int dEvt_control_c::giveItemCut(u8 item) {
s32 staffIdx = dComIfGp_evmng_getMyStaffId("GIVEMAN");
if (staffIdx == -1)
return false;
dComIfGp_evmng_cutEnd(staffIdx);
mGetItemNo = item;
return 1;
}
|