MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / AnimPick

Method AnimPick

src/SB/Game/zNPCTypeVillager.cpp:573–691  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

571}
572
573U32 zNPCVillager::AnimPick(S32 gid, en_NPC_GOAL_SPOT gspot, xGoal* goal)
574{
575 S32 idx;
576 U32 da_anim = 0;
577
578 switch (gid)
579 {
580 case NPC_GOAL_IDLE:
581 case NPC_GOAL_WAITING:
582 case NPC_GOAL_NOMANLAND:
583 case NPC_GOAL_LIMBO:
584 {
585 S32 superfolk = !strcmp("zNPCSuperFriend", this->model->Anim->Table->Name);
586 static S32 choices[4] = { 1, 0x11, 0x12, 0x13 };
587
588 if (!superfolk)
589 {
590 idx = 1;
591 }
592 else
593 {
594 idx = xUtil_choose(choices, 4, 0);
595 }
596 break;
597 }
598
599 case NPC_GOAL_WANDER:
600 case NPC_GOAL_PATROL:
601 if (gspot == 0x26)
602 idx = 4;
603 else
604 idx = 2;
605 break;
606
607 case NPC_GOAL_FIDGET:
608 {
609 S32 superfolk = !strcmp("zNPCSuperFriend", this->model->Anim->Table->Name);
610 S32 choices[4] = { 4, 0x14, 0x15, 0x16 };
611
612 if (!superfolk)
613 {
614 idx = 4;
615 }
616 else
617 {
618 idx = xUtil_choose(choices, 4, 0);
619 }
620 break;
621 }
622
623 case NPC_GOAL_PLAYERNEAR:
624 {
625 if (gspot == 0x23)
626 {
627 S32 superfolk = !strcmp("zNPCSuperFriend", this->model->Anim->Table->Name);
628 S32 choices[4] = { 4, 0x14, 0x15, 0x16 };
629
630 if (!superfolk)

Callers

nothing calls this directly

Calls 4

strcmpFunction · 0.85
xUtil_chooseFunction · 0.85
xrandFunction · 0.85
AnimPickFunction · 0.50

Tested by

no test coverage detected