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

Method FolkHandleMail

src/SB/Game/zNPCTypeVillager.cpp:729–774  ·  view source on GitHub ↗

non-matching: register shenanigans

Source from the content-addressed store, hash-verified

727
728// non-matching: register shenanigans
729S32 zNPCVillager::FolkHandleMail(NPCMsg* mail)
730{
731 S32 handled = 1;
732
733 xPsyche* psy = this->psy_instinct; // not in dwarf
734
735 switch (mail->msgid)
736 {
737 case 3:
738 {
739 if (psy && !psy->GIDInStack(NPC_GOAL_CHEER))
740 {
741 if (!psy->GIDInStack(NPC_GOAL_HURT))
742 {
743 psy->GoalPush(NPC_GOAL_HURT, 0);
744 }
745 }
746 break;
747 }
748
749 case 1:
750 if (mail->sysevent.toEvent == 0x20e)
751 {
752 psy->GoalSet(NPC_GOAL_TALK, 0);
753 }
754 else if (mail->sysevent.toEvent == 0x1d9)
755 {
756 handled = zNPCCommon::NPCMessage(mail);
757 }
758 else if (mail->sysevent.toEvent == 0x1d8)
759 {
760 handled = zNPCCommon::NPCMessage(mail);
761 }
762 else
763 {
764 handled = zNPCCommon::NPCMessage(mail);
765 }
766 break;
767
768 default:
769 handled = 0;
770 break;
771 }
772
773 return handled;
774}
775
776void zNPCVillager::SpeakBegin()
777{

Callers 1

NPCMessageMethod · 0.95

Calls 12

ParseSysEventMethod · 0.95
IAmBallooningMethod · 0.95
FolkHandleMailFunction · 0.85
GIDInStackMethod · 0.80
GoalPushMethod · 0.80
GoalSetMethod · 0.80
GIDOfPendingMethod · 0.80
SelfTypeMethod · 0.80
GIDOfActiveMethod · 0.80
FindGoalMethod · 0.80
LoopCountSetMethod · 0.80
NPCMessageFunction · 0.50

Tested by

no test coverage detected