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

Method NPCMessage

src/SB/Game/zNPCGoalRobo.cpp:1786–1818  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1784}
1785
1786S32 zNPCGoalAlertTarTar::NPCMessage(NPCMsg* mail)
1787{
1788 S32 snarfed = 1;
1789 zNPCRobot* npc = (zNPCRobot*)(psyche->clt_owner);
1790 xPsyche* psy = GetPsyche();
1791 switch (mail->msgid)
1792 {
1793 case NPC_MID_DAMAGE:
1794 if ((psy->GIDInStack(NPC_GOAL_WOUND) != NULL) || (psy->GIDOfPending() == NPC_GOAL_WOUND))
1795 {
1796 break;
1797 }
1798
1799 if ((npc->hitpoints > 1) && (mail->infotype == NPC_MDAT_DAMAGE))
1800 {
1801 if ((mail->dmgdata.dmg_type == DMGTYP_SIDE) ||
1802 (mail->dmgdata.dmg_type == DMGTYP_HITBYTOSS))
1803 {
1804 alerttart = TARTAR_ALERT_READY;
1805 flg_info |= 2;
1806 psy->GoalPush(NPC_GOAL_WOUND, 0);
1807 break;
1808 }
1809 }
1810
1811 snarfed = 0;
1812 break;
1813 default:
1814 snarfed = 0;
1815 break;
1816 }
1817 return snarfed;
1818}
1819
1820void zNPCGoalAlertTarTar::GetInArena(F32 dt)
1821{

Callers

nothing calls this directly

Calls 9

xurandFunction · 0.85
GIDInStackMethod · 0.80
GIDOfPendingMethod · 0.80
GoalPushMethod · 0.80
GIDOfActiveMethod · 0.80
GoalSwapMethod · 0.80
GoalSetMethod · 0.80
FindGoalMethod · 0.80
InputInfoMethod · 0.80

Tested by

no test coverage detected