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

Function idleCB

src/SB/Game/zNPCTypeBossSandy.cpp:1094–1138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1092}
1093
1094static S32 idleCB(xGoal* rawgoal, void*, en_trantype* trantype, F32, void*)
1095{
1096 zNPCGoalBossSandyIdle* idle = (zNPCGoalBossSandyIdle*)rawgoal;
1097 zNPCBSandy* sandy = (zNPCBSandy*)idle->psyche->clt_owner;
1098 S32 nextgoal = 0;
1099 xVec3 tempVector;
1100
1101 if (sandy->bossFlags & 0x400)
1102 {
1103 return 0;
1104 }
1105
1106 if (globals.player.ControlOff)
1107 {
1108 return 0;
1109 }
1110
1111 if (sandy->hitPoints == 0)
1112 {
1113 return 0;
1114 }
1115
1116 xVec3Sub(&tempVector, (xVec3*)&globals.player.ent.model->Mat->pos,
1117 (xVec3*)&sandy->model->Mat->pos);
1118
1119 tempVector.y = 0.0f; // 0.0
1120
1121 F32 length = xVec3Length2(&tempVector);
1122
1123 if (idle->timeInGoal > 0.30000001192092896f) // 0.3
1124 {
1125 if (length > 12.0f) // 12.0
1126 {
1127 *trantype = GOAL_TRAN_SET;
1128 nextgoal = 'NGB3';
1129 }
1130 else
1131 {
1132 *trantype = GOAL_TRAN_SET;
1133 nextgoal = 'NGB4';
1134 }
1135 }
1136
1137 return nextgoal;
1138}
1139
1140static S32 tauntCB(xGoal* rawgoal, void*, en_trantype* trantype, F32 dt, void*)
1141{

Callers

nothing calls this directly

Calls 2

xVec3SubFunction · 0.85
xVec3Length2Function · 0.85

Tested by

no test coverage detected