forked from zeldaret/tp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathd_a_npc_jagar.cpp
More file actions
1583 lines (1482 loc) · 53.8 KB
/
d_a_npc_jagar.cpp
File metadata and controls
1583 lines (1482 loc) · 53.8 KB
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
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* d_a_npc_jagar.cpp
* NPC - Jaggle
*/
#include "d/actor/d_a_npc_jagar.h"
#include "Z2AudioLib/Z2Instances.h"
#include "d/actor/d_a_npc_bou.h"
#include "dol2asm.h"
#include "d/d_meter2_info.h"
#include "d/actor/d_a_tag_push.h"
//
// Declarations:
//
/* ############################################################################################## */
/* 80A1A548-80A1A554 000000 000C+00 2/2 0/0 0/0 .data cNullVec__6Z2Calc */
SECTION_DATA static u8 cNullVec__6Z2Calc[12] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
/* 80A1A554-80A1A568 00000C 0004+10 0/0 0/0 0/0 .data @1787 */
#pragma push
#pragma force_active on
SECTION_DATA static u32 lit_1787[1 + 4 /* padding */] = {
0x02000201,
/* padding */
0x40080000,
0x00000000,
0x3FE00000,
0x00000000,
};
#pragma pop
/* 80A1A568-80A1A570 000020 0008+00 1/1 0/0 0/0 .data l_bmdData */
static int l_bmdData[1][2] = {
{13, 1},
};
/* 80A1A570-80A1A5B8 -00001 0048+00 0/1 0/0 0/0 .data l_evtList */
SECTION_DATA static daNpcT_evtData_c l_evtList[9] = {
{"", 0},
{"NO_RESPONSE", 0},
{"CLIMBUP", 2},
{"NEED_YOUR_HELP", 2},
{"ANGER", 2},
{"CONVERSATION_WITH_BOU", 3},
{"CONFIDENTIAL_CONVERSATION", 3},
{"FIND_WOLF", 3},
{"FIND_WOLF_VER2", 3},
};
/* 80A1A5B8-80A1A5CC -00001 0014+00 2/3 0/0 0/0 .data l_resNameList */
static char* l_resNameList[5] = {
"",
"Jagar",
"Jagar1",
"Jagar2",
"Jagar3",
};
/* 80A1A5CC-80A1A5D0 000084 0004+00 1/0 0/0 0/0 .data l_loadResPtrn0 */
// SECTION_DATA static u32 l_loadResPtrn0 = 0x010204FF;
static s8 l_loadResPtrn0[4] = {
1, 2, 4, -1,
};
/* 80A1A5D0-80A1A5D4 000088 0003+01 1/0 0/0 0/0 .data l_loadResPtrn1 */
static s8 l_loadResPtrn1[3] = {
1, 3, -1
};
/* 80A1A5D4-80A1A5DC 00008C 0005+03 1/0 0/0 0/0 .data l_loadResPtrn9 */
static s8 l_loadResPtrn9[5] = {
1, 2, 3, 4, -1
};
/* 80A1A5DC-80A1A5EC -00001 0010+00 1/2 0/0 0/0 .data l_loadResPtrnList */
static s8* l_loadResPtrnList[4] = {
l_loadResPtrn0,
l_loadResPtrn1,
l_loadResPtrn9,
l_loadResPtrn9,
};
/* 80A1A5EC-80A1A704 0000A4 0118+00 0/1 0/0 0/0 .data l_faceMotionAnmData */
static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[10] = {
{-1, 0, 0, 19, 2, 1, 1},
{6, 0, 1, 20, 0, 1, 0},
{6, 0, 2, 19, 2, 1, 1},
{4, 0, 4, 9, 0, 4, 0},
{7, 0, 3, 20, 0, 3, 0},
{5, 2, 4, 10, 2, 4, 0},
{-1, 0, 0, -1, 0, 0, 0},
{7, 2, 1, 21, 2, 1, 0},
{5, 0, 3, 18, 0, 3, 0},
{6, 2, 3, 19, 2, 3, 0},
};
/* 80A1A704-80A1A8FC 0001BC 01F8+00 0/1 0/0 0/0 .data l_motionAnmData */
daNpcT_motionAnmData_c l_motionAnmData[18] = {
{10, 2, 1, 16, 0, 1, 1, 0},
{4, 2, 2, 16, 0, 1, 1, 0},
{7, 2, 2, 16, 0, 1, 1, 0},
{10, 2, 2, 16, 0, 1, 1, 0},
{8, 0, 2, 16, 0, 1, 1, 0},
{9, 0, 2, 16, 0, 1, 1, 0},
{5, 0, 2, 16, 0, 1, 1, 0},
{11, 0, 2, 16, 0, 1, 1, 0},
{6, 0, 4, 16, 0, 1, 1, 0},
{9, 0, 1, 16, 0, 1, 1, 0},
{8, 0, 1, 16, 0, 1, 1, 0},
{8, 2, 3, 16, 0, 1, 1, 0},
{13, 2, 3, 16, 0, 1, 1, 0},
{12, 0, 3, 16, 0, 1, 1, 0},
{14, 2, 3, 16, 0, 1, 1, 0},
{9, 0, 3, 16, 0, 1, 1, 0},
{11, 0, 3, 16, 0, 1, 1, 0},
{10, 2, 3, 16, 0, 1, 1, 0},
};
/* 80A1A8FC-80A1A98C 0003B4 0090+00 0/1 0/0 0/0 .data l_faceMotionSequenceData */
static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[36] = {
{1, -1, 1}, {7, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {8, -1, 1}, {9, 0, 0}, {-1, 0, 0}, {-1, 0, 0},
{2, -1, 1}, {6, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {3, -1, 1}, {5, 0, 0}, {-1, 0, 0}, {-1, 0, 0},
{4, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {5, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0},
{7, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {6, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0},
{0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0},
};
/* 80A1A98C-80A1AABC 000444 0130+00 0/1 0/0 0/0 .data l_motionSequenceData */
static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[76] = {
{0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {8, -1, 1}, {0, 0, 0}, {-1, 0, 0}, {-1, 0, 0},
{1, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0},
{9, -1, 1}, {3, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {12, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0},
{13, -1, 1}, {12, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {15, -1, 1}, {17, 0, 0}, {-1, 0, 0}, {-1, 0, 0},
{16, -1, 1}, {12, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {17, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0},
{4, -1, 1}, {0, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {5, -1, 1}, {1, 0, 0}, {-1, 0, 0}, {-1, 0, 0},
{6, -1, 1}, {2, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {7, -1, 1}, {2, 0, 0}, {-1, 0, 0}, {-1, 0, 0},
{10, 4, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {11, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0},
{14, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {3, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0},
{13, -1, 1}, {12, 0, 0}, {-1, 0, 0}, {-1, 0, 0},
};
/* 80A1AABC-80A1AAD8 -00001 001C+00 1/1 0/0 0/0 .data mCutNameList__13daNpc_Jagar_c */
SECTION_DATA char* daNpc_Jagar_c::mCutNameList[7] = {
"",
"CLIMBUP",
"NEED_YOUR_HELP",
"ANGER",
"CONVERSATION_WITH_BOU",
"CONFIDENTIAL_CONVERSATION",
"FIND_WOLF",
};
/* 80A1AB20-80A1AB74 0005D8 0054+00 1/2 0/0 0/0 .data mCutList__13daNpc_Jagar_c */
daNpc_Jagar_c::cutFunc daNpc_Jagar_c::mCutList[7] = {
NULL,
&daNpc_Jagar_c::cutClimbUp,
&daNpc_Jagar_c::cutNeedYourHelp,
&daNpc_Jagar_c::cutAnger,
&daNpc_Jagar_c::cutConversationWithBou,
&daNpc_Jagar_c::cutConfidentialConversation,
&daNpc_Jagar_c::cutFindWolf,
};
/* 80A1470C-80A14858 0000EC 014C+00 1/0 0/0 0/0 .text __dt__13daNpc_Jagar_cFv */
daNpc_Jagar_c::~daNpc_Jagar_c() {
if (mpMorf[0] != 0) {
mpMorf[0]->stopZelAnime();
}
deleteRes(l_loadResPtrnList[mType], (char const**)l_resNameList);
}
/* ############################################################################################## */
/* 80A1A330-80A1A3D0 000000 00A0+00 13/13 0/0 1/1 .rodata m__19daNpc_Jagar_Param_c */
daNpc_Jagar_Param_c::Data const daNpc_Jagar_Param_c::m = {
170.0f, -3.0f, 1.0f, 400.0f, 255.0f, 160.0f,
35.0f, 30.0f, 0.0f, 0.0f, 10.0f, -10.0f,
30.0f, -10.0f, 45.0f, -45.0f, 0.6f, 12.0f,
3, 6, 5, 6, 110.0f, 500.0f, 300.0f, -300.0f,
60, 8, 0.0f, 0.0f, 4.0f, 0.0f, 0.0f,
0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1400.0f,
200.0f, -800.0f, 16.0f, 1800.0f,
};
/* 80A14858-80A14B20 000238 02C8+00 1/1 0/0 0/0 .text create__13daNpc_Jagar_cFv */
int daNpc_Jagar_c::create() {
static int const heapSize[4] = {14416, 14448, 14448, 0};
fopAcM_SetupActor2(this, daNpc_Jagar_c, l_faceMotionAnmData,
(const daNpcT_motionAnmData_c *)l_motionAnmData, (const daNpcT_MotionSeqMngr_c::sequenceStepData_c *) l_faceMotionSequenceData, 4,
(const daNpcT_MotionSeqMngr_c::sequenceStepData_c *)l_motionSequenceData, 4, (const daNpcT_evtData_c *)l_evtList, (char **)l_resNameList
);
mType = getType();
mFlowNodeNo = getFlowNodeNo();
mTwilight = 0;
int rv = loadRes(l_loadResPtrnList[mType], (const char**)l_resNameList);
if (rv == cPhs_COMPLEATE_e) {
if (isDelete()) {
return cPhs_ERROR_e;
}
if (!fopAcM_entrySolidHeap(this, createHeapCallBack, heapSize[mType])) {
return cPhs_ERROR_e;
}
J3DModelData* modelData = mpMorf[0]->getModel()->getModelData();
fopAcM_SetMtx(this, mpMorf[0]->getModel()->getBaseTRMtx());
fopAcM_setCullSizeBox(this, -200.0f, -100.0f, -200.0f, 200.0f, 300.0f, 200.0f);
mSound.init(¤t.pos, &eyePos, 3, 1);
field_0x9c0.init(&mAcch, 0.0f, 0.0f);
reset();
mAcch.Set(fopAcM_GetPosition_p(this), fopAcM_GetOldPosition_p(this), this, 1,
&mAcchCir, fopAcM_GetSpeed_p(this), fopAcM_GetAngle_p(this),
fopAcM_GetShapeAngle_p(this));
mCcStts.Init(daNpc_Jagar_Param_c::m.field_0x10, 0, this);
mCyl1.Set(mCcDCyl);
mCyl1.SetStts(&mCcStts);
mCyl1.SetTgHitCallback(tgHitCallBack);
mAcch.CrrPos(dComIfG_Bgsp());
mGndChk = mAcch.m_gnd;
mGroundH = mAcch.GetGroundH();
if (mGroundH != -1000000000.0f) {
setEnvTevColor();
setRoomNo();
}
mCreating = 1;
Execute();
mCreating = 0;
}
return rv;
}
/* 80A14B20-80A14D90 000500 0270+00 1/1 0/0 0/0 .text CreateHeap__13daNpc_Jagar_cFv */
int daNpc_Jagar_c::CreateHeap() {
J3DModelData* modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes(
l_resNameList[l_bmdData[0][1]], l_bmdData[0][0]));
if (modelData == NULL) {
return 0;
}
mpMorf[0] = new mDoExt_McaMorfSO(modelData, NULL, NULL, NULL, -1, 1.0f, 0, -1, &mSound,
0x80000, 0x11020284);
if (mpMorf[0] == NULL || mpMorf[0]->getModel() == NULL) {
return 0;
}
J3DModel* model = mpMorf[0]->getModel();
for (u16 i = 0; i < modelData->getJointNum(); i++) {
modelData->getJointNodePointer(i)->setCallBack(ctrlJointCallBack);
}
model->setUserArea((u32)this);
mpMatAnm = new daNpcT_MatAnm_c();
if (mpMatAnm == NULL) {
return 0;
}
if (setFaceMotionAnm(1, false) && setMotionAnm(0, 0.0f, 0))
{
return 1;
}
return 0;
}
/* 80A14F4C-80A14F80 00092C 0034+00 1/1 0/0 0/0 .text Delete__13daNpc_Jagar_cFv */
int daNpc_Jagar_c::Delete() {
fopAcM_GetID(this);
this->~daNpc_Jagar_c();
return 1;
}
/* 80A14F80-80A14FA0 000960 0020+00 2/2 0/0 0/0 .text Execute__13daNpc_Jagar_cFv */
int daNpc_Jagar_c::Execute() {
return daNpcT_c::execute();
}
/* 80A14FA0-80A15034 000980 0094+00 1/1 0/0 0/0 .text Draw__13daNpc_Jagar_cFv */
int daNpc_Jagar_c::Draw() {
if (mpMatAnm != NULL) {
J3DModelData* modelData = mpMorf[0]->getModel()->getModelData();
modelData->getMaterialNodePointer(getEyeballMaterialNo())->setMaterialAnm(mpMatAnm);
}
return daNpcT_c::draw(0, 0, field_0xde8, NULL, 100.0f, 0, 0, 0);
}
/* 80A15034-80A15054 000A14 0020+00 1/1 0/0 0/0 .text
* createHeapCallBack__13daNpc_Jagar_cFP10fopAc_ac_c */
int daNpc_Jagar_c::createHeapCallBack(fopAc_ac_c* i_this) {
return static_cast<daNpc_Jagar_c*>(i_this)->CreateHeap();
}
/* 80A15054-80A150AC 000A34 0058+00 1/1 0/0 0/0 .text
* ctrlJointCallBack__13daNpc_Jagar_cFP8J3DJointi */
int daNpc_Jagar_c::ctrlJointCallBack(J3DJoint* param_0, int param_1) {
if (param_1 == 0) {
J3DModel* model = j3dSys.getModel();
daNpc_Jagar_c* i_this = reinterpret_cast<daNpc_Jagar_c*>(model->getUserArea());
if (i_this != 0) {
i_this->ctrlJoint(param_0, model);
}
}
return 1;
}
/* 80A150AC-80A150F8 000A8C 004C+00 1/1 0/0 2/2 .text getType__13daNpc_Jagar_cFv */
u8 daNpc_Jagar_c::getType() {
switch ((u8)fopAcM_GetParam(this)) {
case 0:
return TYPE_0;
case 1:
return TYPE_1;
case 2:
return TYPE_2;
default:
return TYPE_3;
}
}
/* 80A150F8-80A15198 000AD8 00A0+00 1/1 0/0 0/0 .text isDelete__13daNpc_Jagar_cFv */
int daNpc_Jagar_c::isDelete() {
switch (mType) {
case TYPE_0:
return FALSE;
case TYPE_1: {
bool rv = true;
if (!daNpcT_chkEvtBit(0xd3) && !dComIfGs_isCollectShield(0)) {
rv = false;
}
return rv;
}
case TYPE_2:
return FALSE;
default:
return FALSE;
}
}
/* 80A15198-80A15364 000B78 01CC+00 1/1 0/0 0/0 .text reset__13daNpc_Jagar_cFv */
void daNpc_Jagar_c::reset() {
csXyz acStack_20;
int iVar1 = (u8*)&field_0x1008 - (u8*)&field_0xfd4;
if (mpMatAnm != NULL) {
mpMatAnm->initialize();
}
initialize();
for (int i = 0; i < 5; i++) {
mActorMngr[i].initialize();
}
memset(&field_0xfd4, 0, iVar1);
acStack_20.setall(0);
acStack_20.y = home.angle.y;
switch (mType) {
case TYPE_0:
if (daNpcT_chkEvtBit(0x1c) != 0) {
if (daNpcT_chkEvtBit(0x86) == 0) {
daNpcT_onEvtBit(0x86);
}
field_0x1001 = 1;
}
case TYPE_1:
case TYPE_2:
default:
daNpcT_offTmpBit(0x1b);
daNpcT_offTmpBit(0x10);
setAngle(acStack_20);
}
}
/* 80A15364-80A153E8 000D44 0084+00 1/0 0/0 0/0 .text afterJntAnm__13daNpc_Jagar_cFi */
void daNpc_Jagar_c::afterJntAnm(int param_1) {
if (param_1 == 1) {
mDoMtx_stack_c::YrotM(mStagger.getAngleZ(1));
mDoMtx_stack_c::ZrotM(-mStagger.getAngleX(1));
} else if (param_1 == 4) {
mDoMtx_stack_c::YrotM(mStagger.getAngleZ(0));
mDoMtx_stack_c::ZrotM(mStagger.getAngleX(0));
}
}
/* 80A153E8-80A155E4 000DC8 01FC+00 1/0 0/0 0/0 .text setParam__13daNpc_Jagar_cFv */
void daNpc_Jagar_c::setParam() {
selectAction();
srchActors();
u32 uVar7 = 10;
s16 sVar10 = daNpc_Jagar_Param_c::m.field_0x48;
s16 sVar9 = daNpc_Jagar_Param_c::m.field_0x4a;
s16 sVar8 = daNpc_Jagar_Param_c::m.field_0x4c;
s16 sVar7 = daNpc_Jagar_Param_c::m.field_0x4e;
switch (mType) {
case TYPE_0:
sVar10 = 4;
sVar9 = 6;
sVar8 = 5;
sVar7 = 6;
break;
case TYPE_1:
field_0xff0 = 3;
field_0xff4 = 6;
sVar10 = 19;
sVar9 = 6;
sVar8 = 19;
sVar7 = 6;
break;
case TYPE_2:
sVar10 = 3;
sVar9 = 6;
sVar8 = 5;
sVar7 = 6;
break;
}
attention_info.distances[0] = daNpcT_getDistTableIdx(sVar8, sVar7);
attention_info.distances[1] = attention_info.distances[0];
attention_info.distances[3] = daNpcT_getDistTableIdx(sVar10, sVar9);
if (mType == TYPE_1) {
uVar7 |= (0x80 << 16);
field_0xfec = getActorDistance(daPy_getPlayerActorClass(),
daNpcT_getDistTableIdx(field_0xff0, field_0xff4),
attention_info.distances[1]);
if (field_0xfec < 4) {
g_meter2_info.mBlinkButton |= 1;
}
} else {
if (chkChuMotion() != 0) {
attention_info.distances[0] = 20;
attention_info.distances[1] = 20;
attention_info.distances[3] = 20;
uVar7 = 2;
}
}
attention_info.flags = uVar7;
scale.set(daNpc_Jagar_Param_c::m.field_0x08, daNpc_Jagar_Param_c::m.field_0x08,
daNpc_Jagar_Param_c::m.field_0x08);
mCcStts.SetWeight(daNpc_Jagar_Param_c::m.field_0x10);
mCylH = daNpc_Jagar_Param_c::m.field_0x14;
mWallR = daNpc_Jagar_Param_c::m.field_0x1c;
mAttnFovY = daNpc_Jagar_Param_c::m.field_0x50;
mAcchCir.SetWallR(mWallR);
mAcchCir.SetWallH(daNpc_Jagar_Param_c::m.field_0x18);
field_0xde8 = daNpc_Jagar_Param_c::m.field_0x0c;
field_0xa80 = daNpc_Jagar_Param_c::m.field_0x6c;
mMorfFrames = daNpc_Jagar_Param_c::m.field_0x44;
gravity = daNpc_Jagar_Param_c::m.field_0x04;
}
/* 80A155E4-80A15714 000FC4 0130+00 1/0 0/0 0/0 .text checkChangeEvt__13daNpc_Jagar_cFv */
int daNpc_Jagar_c::checkChangeEvt() {
if (!chkAction(&daNpc_Jagar_c::talk)) {
mPreItemNo = 0;
if (dComIfGp_event_chkTalkXY()) {
if (dComIfGp_evmng_ChkPresentEnd()) {
mEvtNo = 1;
evtChange();
}
return true;
}
switch (mType) {
case TYPE_0:
if (daNpcT_chkEvtBit(0x1c) && chkChuMotion()) {
mEvtNo = 2;
evtChange();
return true;
}
break;
case TYPE_1:
if (field_0xfec < 4) {
mEvtNo = 6;
evtChange();
return true;
}
case TYPE_2:
break;
}
}
return false;
}
/* 80A15714-80A157B4 0010F4 00A0+00 1/0 0/0 0/0 .text setAfterTalkMotion__13daNpc_Jagar_cFv */
void daNpc_Jagar_c::setAfterTalkMotion() {
int iVar2 = 8;
switch(mFaceMotionSeqMngr.getNo()) {
case 0:
iVar2 = 6;
break;
case 1:
break;
case 2:
iVar2 = 7;
break;
case 3:
iVar2 = 5;
break;
}
mFaceMotionSeqMngr.setNo(iVar2, -1.0f, 0, 0);
}
/* 80A157B4-80A158A0 001194 00EC+00 1/1 0/0 0/0 .text srchActors__13daNpc_Jagar_cFv */
void daNpc_Jagar_c::srchActors() {
switch(mType) {
case TYPE_0:
if (!mActorMngr[1].getActorP()) {
mActorMngr[1].entry(getNearestActorP(0x15a));
}
if (!mActorMngr[0].getActorP()) {
mActorMngr[0].entry(getNearestActorP(0x10d));
}
break;
case TYPE_1:
if (!mActorMngr[1].getActorP()) {
mActorMngr[1].entry(getNearestActorP(0x15a));
}
if (!mActorMngr[2].getActorP()) {
mActorMngr[2].entry(getNearestActorP(0x246));
}
case TYPE_2:
break;
}
}
/* 80A158A0-80A15940 001280 00A0+00 1/0 0/0 0/0 .text evtTalk__13daNpc_Jagar_cFv */
BOOL daNpc_Jagar_c::evtTalk() {
if (chkAction(&daNpc_Jagar_c::talk)) {
(this->*field_0xfe0)(NULL);
} else {
setAction(&daNpc_Jagar_c::talk);
}
return 1;
}
/* 80A15940-80A15A08 001320 00C8+00 1/0 0/0 0/0 .text evtCutProc__13daNpc_Jagar_cFv */
BOOL daNpc_Jagar_c::evtCutProc() {
int staffId = dComIfGp_getEventManager().getMyStaffId("Jagar", this, -1);
if (staffId != -1) {
mStaffId = staffId;
int actIdx = dComIfGp_getEventManager().getMyActIdx(mStaffId, (char**)mCutNameList, 7, 0, 0);
if ((this->*(mCutList[actIdx]))(mStaffId) != 0) {
dComIfGp_getEventManager().cutEnd(mStaffId);
}
return true;
}
return false;
}
/* 80A15A08-80A15CA4 0013E8 029C+00 1/0 0/0 0/0 .text action__13daNpc_Jagar_cFv */
void daNpc_Jagar_c::action() {
fopAc_ac_c* hitActor = hitChk(&mCyl1, 0xffffffff);
if (hitActor && mCyl1.GetTgHitObj()->ChkAtType(AT_TYPE_THROW_OBJ)) {
if (mType == TYPE_1) {
daNpc_Bou_c *bo = (daNpc_Bou_c *)mActorMngr[2].getActorP();
if (bo && bo->getType() == TYPE_1) {
if (bo->mStagger.checkStagger() ? 0 : 1) {
bo->mFaceMotionSeqMngr.setNo(1, -1, 0, 0);
bo->mMotionSeqMngr.setNo(3, -1, 0, 0);
field_0xff8 = 0;
field_0x1000 = 1;
}
}
}
if (field_0x1003 != 2 && field_0x1004 != 2) {
mStagger.setParam(this, hitActor, mCurAngle.y);
setDamage(0, 8, 0);
mDamageTimerStart = 0;
mJntAnm.setMode(0, 0);
mJntAnm.setDirect(1);
}
}
if (mStagger.checkRebirth()) {
mStagger.initialize();
field_0x1003 = 0;
mMode = 1;
}
if (field_0xfd4) {
if (field_0xfe0 == field_0xfd4) {
(this->*field_0xfe0)(NULL);
} else {
setAction(field_0xfd4);
}
}
daTag_Push_c *uVar4 = (daTag_Push_c *)field_0xba0.getActorP();
if (uVar4) {
switch ((int)uVar4->getId()) {
case 2:
mEvtNo = 5;
break;
default:
break;
}
}
}
/* 80A15CA4-80A15D68 001684 00C4+00 1/0 0/0 0/0 .text beforeMove__13daNpc_Jagar_cFv */
void daNpc_Jagar_c::beforeMove() {
fopAcM_OffStatus(this, 0x8000000);
if (checkHide()) {
fopAcM_OnStatus(this, 0x8000000);
}
if (checkHide() || mNoDraw != 0) {
attention_info.flags = 0;
}
}
UNK_REL_BSS;
/* 80A1AE2C-80A1AE30 000054 0004+00 1/1 0/0 0/0 .bss l_HIO */
static daNpc_Jagar_Param_c l_HIO;
/* 80A15D68-80A1607C 001748 0314+00 1/0 0/0 0/0 .text setAttnPos__13daNpc_Jagar_cFv */
void daNpc_Jagar_c::setAttnPos() {
cXyz cStack_3c(-10.0f, 10.0f, 0.0f);
mStagger.calc(0);
f32 dVar8 = cM_s2rad(mCurAngle.y - field_0xd7e.y);
J3DModel* model = mpMorf[0]->getModel();
mJntAnm.setParam(this, model, &cStack_3c, getBackboneJointNo(), getNeckJointNo(),
getHeadJointNo(), daNpc_Jagar_Param_c::m.field_0x24, daNpc_Jagar_Param_c::m.field_0x20,
daNpc_Jagar_Param_c::m.field_0x2c, daNpc_Jagar_Param_c::m.field_0x28,
daNpc_Jagar_Param_c::m.field_0x34, daNpc_Jagar_Param_c::m.field_0x30,
daNpc_Jagar_Param_c::m.field_0x3c, daNpc_Jagar_Param_c::m.field_0x38,
daNpc_Jagar_Param_c::m.field_0x40, dVar8, NULL);
mJntAnm.calcJntRad(0.2f, 1.0f, dVar8);
setMtx();
mDoMtx_stack_c::copy(mpMorf[0]->getModel()->getAnmMtx(getHeadJointNo()));
mDoMtx_stack_c::multVec(&cStack_3c, &eyePos);
mJntAnm.setEyeAngleX(eyePos, 1.0f, -0x2800);
mJntAnm.setEyeAngleY(eyePos, mCurAngle.y, 1, 1.0f, 0);
cStack_3c.set(0.0f, 0.0f, 10.0f);
cStack_3c.y = daNpc_Jagar_Param_c::m.field_0x00;
if (field_0x1004 == 2) {
cStack_3c.set(0.0f, 100.0f, -60.0f);
}
mDoMtx_stack_c::YrotS(mCurAngle.y);
mDoMtx_stack_c::multVec(&cStack_3c, &cStack_3c);
attention_info.position = current.pos + cStack_3c;
static cXyz prtclScl(1.0f, 1.0f, 1.0f);
setFootPos();
if (3.0f < speedF) {
setFootPrtcl(&prtclScl, 11.0f, 0);
}
}
/* 80A1607C-80A161EC 001A5C 0170+00 1/0 0/0 0/0 .text setCollision__13daNpc_Jagar_cFv */
void daNpc_Jagar_c::setCollision() {
cXyz cStack_48;
if (mHide == 0) {
u32 tgType = -0x27040201;
u32 tgSPrm = 0x1f;
if (mTwilight) {
tgType = 0;
tgSPrm = 0;
} else {
if (mStagger.checkStagger()) {
tgType = 0;
tgSPrm = 0;
}
}
mCyl1.SetCoSPrm(0x79);
mCyl1.SetTgType(tgType);
mCyl1.SetTgSPrm(tgSPrm);
mCyl1.OnTgNoHitMark();
cStack_48.set(0.0f, 0.0f, 0.0f);
f32 cylHeight = mCylH;
f32 cylRadius = mWallR;
if (field_0x1004 == 2) {
cylHeight = 70.0f;
cylRadius = 90.0f;
}
mDoMtx_stack_c::YrotS(mCurAngle.y);
mDoMtx_stack_c::multVec(&cStack_48, &cStack_48);
cStack_48 += current.pos;
mCyl1.SetH(cylHeight);
mCyl1.SetR(cylRadius);
mCyl1.SetC(cStack_48);
dComIfG_Ccsp()->Set(&mCyl1);
}
mCyl1.ClrCoHit();
mCyl1.ClrTgHit();
}
/* 80A161EC-80A161F4 001BCC 0008+00 1/0 0/0 0/0 .text drawDbgInfo__13daNpc_Jagar_cFv */
int daNpc_Jagar_c::drawDbgInfo() {
return 0;
}
/* 80A161F4-80A16234 001BD4 0040+00 1/0 0/0 0/0 .text changeBtp__13daNpc_Jagar_cFPiPi */
void daNpc_Jagar_c::changeBtp(int* param_0, int* param_1) {
if (((mType == TYPE_1 || mType == TYPE_2) && *param_0 == 19) && *param_1 == 1) {
*param_0 = 17;
*param_1 = 3;
}
return;
}
/* 80A16234-80A162B0 001C14 007C+00 1/1 0/0 0/0 .text selectAction__13daNpc_Jagar_cFv */
int daNpc_Jagar_c::selectAction() {
field_0xfd4 = NULL;
switch (mType) {
case TYPE_1:
field_0xfd4 = &daNpc_Jagar_c::talkwithBou;
break;
default:
field_0xfd4 = &daNpc_Jagar_c::wait;
break;
}
return 1;
}
/* 80A162B0-80A162DC 001C90 002C+00 2/2 0/0 0/0 .text
* chkAction__13daNpc_Jagar_cFM13daNpc_Jagar_cFPCvPvPv_i */
int daNpc_Jagar_c::chkAction(int (daNpc_Jagar_c::*action)(void*)) {
return field_0xfe0 == action;
}
/* 80A162DC-80A16384 001CBC 00A8+00 2/2 0/0 0/0 .text
* setAction__13daNpc_Jagar_cFM13daNpc_Jagar_cFPCvPvPv_i */
int daNpc_Jagar_c::setAction(int (daNpc_Jagar_c::*action)(void*)) {
mMode = 3;
if (field_0xfe0 != NULL) {
(this->*field_0xfe0)(NULL);
}
mMode = 0;
field_0xfe0 = action;
if (field_0xfe0 != NULL) {
(this->*field_0xfe0)(NULL);
}
return 1;
}
/* 80A16384-80A16544 001D64 01C0+00 1/0 0/0 0/0 .text cutClimbUp__13daNpc_Jagar_cFi */
int daNpc_Jagar_c::cutClimbUp(int param_0) {
int rv = 0;
int iVar4 = -1;
int* piVar1 = dComIfGp_evmng_getMyIntegerP(param_0, "prm");
if (piVar1) {
iVar4 = *piVar1;
}
if (dComIfGp_getEventManager().getIsAddvance(param_0)) {
switch (iVar4) {
case 0:
mFaceMotionSeqMngr.setNo(8, 0.0f, 0, 0);
mMotionSeqMngr.setNo(2, 0.0f, 0, 0);
mJntAnm.lookNone(1);
field_0x1003 = 1;
setAngle(home.angle.y);
initTalk(mFlowNodeNo, NULL);
break;
case 2:
break;
}
}
switch (iVar4) {
case 0:
if (talkProc(NULL, 0, NULL, 0) && mFlow.checkEndFlow()) {
rv = 1;
}
break;
case 2:
rv = 1;
break;
}
return rv;
}
/* 80A16544-80A16CD8 001F24 0794+00 1/0 0/0 0/0 .text cutNeedYourHelp__13daNpc_Jagar_cFi */
int daNpc_Jagar_c::cutNeedYourHelp(int param_1) {
int rv = 0;
int iVar12 = -1;
int local_30 = 0;
int local_34 = 0;
int local_38 = 0;
fopAc_ac_c* actor_p;
int* piVar5 = dComIfGp_evmng_getMyIntegerP(param_1, "prm");
if (piVar5) {
iVar12 = *piVar5;
}
piVar5 = dComIfGp_evmng_getMyIntegerP(param_1, "msgNo");
if (piVar5) {
local_30 = *piVar5;
}
piVar5 = dComIfGp_evmng_getMyIntegerP(param_1, "msgNo2");
if (piVar5) {
local_34 = *piVar5;
}
piVar5 = dComIfGp_evmng_getMyIntegerP(param_1, "send");
if (piVar5) {
local_38 = *piVar5;
}
if (dComIfGp_getEventManager().getIsAddvance(param_1)) {
switch(iVar12) {
case 0:
dComIfGp_getEvent().setPt2(mActorMngr[0].getActorP());
break;
case 1:
initTalk(mFlowNodeNo, NULL);
break;
case 7: {
fopAc_ac_c* iVar6 = mActorMngr[1].getActorP();
if (iVar6) {
dComIfGp_getEvent().setPt2(iVar6);
}
break;
}
case 8:
field_0x1002 = 0;
field_0x1003 = 0;
}
}
int local_2c[3] = {-1, -1, -1};
switch (iVar12) {
case 0:
mJntAnm.lookNone(0);
if (mMotionSeqMngr.getNo() == 10) {
if (mMotionSeqMngr.getStepNo() <= 0) {
break;
}
mFaceMotionSeqMngr.setNo(8, -1.0f, 0, 0);
mMotionSeqMngr.setNo(0, -1.0f, 0, 0);
rv = 1;
break;
}
if (!mMotionSeqMngr.getNo()) {
rv = 1;
break;
}
break;
case 1:
mJntAnm.lookPlayer(0);
if (mPlayerAngle == mCurAngle.y) {
rv = 1;
break;
}
step(mPlayerAngle,8,0xe,0xf,0);
break;
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
switch (iVar12) {
case 3:
case 4:
case 5:
actor_p = mActorMngr[0].getActorP();
if (actor_p) {
field_0xd6c.setall(0.0f);
field_0xd6c.z = current.pos.absXZ(actor_p->current.pos);
mDoMtx_stack_c::YrotS(mCurAngle.y + 0x4000);
mDoMtx_stack_c::multVec(&field_0xd6c, &field_0xd6c);
field_0xd6c += current.pos;
mJntAnm.lookPos(&field_0xd6c, 0);
}
break;
case 7: {
fopAc_ac_c* actor_p = mActorMngr[1].getActorP();
if (actor_p) {
field_0xd6c.setall(0.0f);
field_0xd6c.z = current.pos.absXZ(actor_p->current.pos);
mDoMtx_stack_c::YrotS(mCurAngle.y + -0x4000);
mDoMtx_stack_c::multVec(&field_0xd6c, &field_0xd6c);
field_0xd6c += current.pos;
mJntAnm.lookPos(&field_0xd6c, 0);
}
break;
}
default:
mJntAnm.lookPlayer(0);
}
local_2c[0] = local_30;
local_2c[1] = local_34;
if (talkProc(local_2c, local_38, NULL, 0)) {
if (!local_30 && !local_34) {
if (mFlow.checkEndFlow() == 1) {
rv = 1;
}
} else {
rv = 1;
}
}
if (iVar12 == 4) {
rv = 1;
}
break;
case 8:
rv = 1;
}
return rv;
}
/* 80A16CD8-80A16EFC 0026B8 0224+00 1/0 0/0 0/0 .text cutAnger__13daNpc_Jagar_cFi */
int daNpc_Jagar_c::cutAnger(int param_0) {
int rv = 0;
int local_b4 = -1;
s16 sVar3;
int* piVar1 = dComIfGp_evmng_getMyIntegerP(param_0, "prm");
if (piVar1 != NULL) {
local_b4 = *piVar1;
}
if (dComIfGp_getEventManager().getIsAddvance(param_0)) {
switch (local_b4) {
case 0:
mFaceMotionSeqMngr.setNo(8, 0.0f, 0, 0);
mMotionSeqMngr.setNo(0, 0.0, 0, 0);
field_0x1003 = 0;
sVar3 = fopAcM_searchActorAngleY(this, dComIfGp_getPlayer(0));
setAngle(sVar3);
initTalk(mFlowNodeNo, NULL);
case 1:
break;
}
}
switch (local_b4) {
case 0:
mJntAnm.lookPlayer(0);
if (talkProc(NULL, 0, NULL, 0) && mFlow.checkEndFlow() == 1) {
rv = 1;
}
break;
case 1:
mJntAnm.lookNone(0);
if (home.angle.y == mCurAngle.y) {
rv = 1;
} else {
step(home.angle.y, 8, 14, 15, 0);
}
break;
default:
break;
}
return rv;
}
/* 80A16EFC-80A1705C 0028DC 0160+00 1/0 0/0 0/0 .text cutConversationWithBou__13daNpc_Jagar_cFi */
int daNpc_Jagar_c::cutConversationWithBou(int param_0) {
daTag_Push_c* this_00 = (daTag_Push_c*)field_0xba0.getActorP();
int rv = 0;
int iVar5 = -1;
int* piVar2 = (int*)dComIfGp_evmng_getMyIntegerP(param_0, "prm");
if (piVar2) {
iVar5 = *piVar2;
}
fopAc_ac_c* actors[2] = {(fopAc_ac_c *) this, mActorMngr[2].getActorP()};
dComIfGp_setMesgCameraInfoActor(actors[0], actors[1], 0, 0, 0, 0, 0, 0, 0, 0);
if (dComIfGp_getEventManager().getIsAddvance(param_0)) {
switch (iVar5) {
case 0:
initTalk(this_00->getFlowNodeNo(), &actors[0]);
}
}
switch (iVar5) {
case 0:
iVar5 = talkProc(NULL, 0, &actors[0], 0);
if (iVar5 && mFlow.checkEndFlow() == 1) {
rv = 1;
}
}
return rv;
}
/* 80A1705C-80A173D8 002A3C 037C+00 1/0 0/0 0/0 .text
* cutConfidentialConversation__13daNpc_Jagar_cFi */
int daNpc_Jagar_c::cutConfidentialConversation(int param_0) {
int rv = 0;
int iVar8 = -1;
int iVar7 = 0;
int* piVar2 = dComIfGp_evmng_getMyIntegerP(param_0, "prm");
if(piVar2) {
iVar8 = *piVar2;
}
piVar2 = dComIfGp_evmng_getMyIntegerP(param_0, "msgNo");
if(piVar2) {
iVar7 = *piVar2;
}
fopAc_ac_c* actors[2] = {(fopAc_ac_c *) this, mActorMngr[2].getActorP()};
dComIfGp_setMesgCameraInfoActor(actors[0], actors[1], 0, 0, 0, 0, 0, 0, 0, 0);
if (dComIfGp_getEventManager().getIsAddvance(param_0)) {
switch (iVar8) {
case 0:
mFaceMotionSeqMngr.setNo(8, -1.0f, 0, 0);
mMotionSeqMngr.setNo(5, -1.0f, 0, 0);
initTalk(0xd7, &actors[0]);
break;
case 1:
dComIfGp_getEvent().setPt2(mActorMngr[1].getActorP());
case 2:
break;
}
}
int local_30[3] = {-1, -1, -1};
switch (iVar8) {
case 0:
case 1:
case 2: