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

Method MoveCorner

src/SB/Game/zNPCGoalRobo.cpp:2037–2071  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2035}
2036
2037void zNPCGoalAlertMonsoon::MoveCorner(F32 dt)
2038{
2039 zNPCRobot* npc = (zNPCRobot*)(psyche->clt_owner);
2040 F32 ds2_corn;
2041 xVec3 dir_corn;
2042 if (*(U8*)(&npc->npcset.allowChase) && npc->arena.IsReady() && (npc->arena.Radius(1.0f) > 2.0f))
2043 {
2044 ds2_corn = npc->XYZDstSqToPos(&pos_corner, 0);
2045 if (ds2_corn < SQ(0.5f))
2046 {
2047 npc->CornerOfArena(&pos_corner, -1.0f);
2048 ds2_corn = npc->XYZDstSqToPos(&pos_corner, NULL);
2049 }
2050 if (npc->DBG_IsNormLog(eNPCDCAT_Ten, 2))
2051 {
2052 xDrawSetColor(g_BLUE);
2053 xDrawSphere2(&pos_corner, 0.1f, 12);
2054 }
2055 if ((tmr_reload >= 0.0f) && (tmr_reload < 1.0f))
2056 {
2057 npc->ThrottleAdjust(dt, 1.5, -1.0);
2058 }
2059 else if (ds2_corn < 2.0f)
2060 {
2061 npc->ThrottleAdjust(dt, 1.5f, -1.0f);
2062 }
2063 else
2064 {
2065 npc->ThrottleAdjust(dt, 3.5f, -1.0f);
2066 }
2067 npc->XYZVecToPos(&dir_corn, &pos_corner);
2068 xVec3Normalize(&dir_corn, &dir_corn);
2069 npc->ThrottleApply(dt, &dir_corn, 0);
2070 }
2071}
2072
2073S32 zNPCGoalAlertSleepy::Enter(F32 dt, void* updCtxt)
2074{

Callers

nothing calls this directly

Calls 9

xDrawSetColorFunction · 0.85
RadiusMethod · 0.80
XYZDstSqToPosMethod · 0.80
ThrottleAdjustMethod · 0.80
XYZVecToPosMethod · 0.80
ThrottleApplyMethod · 0.80
xDrawSphere2Function · 0.70
xVec3NormalizeFunction · 0.50
IsReadyMethod · 0.45

Tested by

no test coverage detected