Skip to content

Commit 5616b49

Browse files
committed
I swear this is the last func
1 parent 0d22982 commit 5616b49

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

src/SB/Game/zNPCGoalRobo.cpp

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2315,6 +2315,47 @@ void zNPCGoalAlertChuck::GetInArena(F32 dt)
23152315
npc->ThrottleApply(dt, &dir, 0);
23162316
}
23172317

2318+
S32 zNPCGoalAlertChuck::ZoomMove(F32 dt)
2319+
{
2320+
S32 donemoving = 0;
2321+
zNPCRobot* npc = (zNPCRobot*)(psyche->clt_owner);
2322+
F32 dist;
2323+
xVec3 dir;
2324+
if (dst_zoom < 0.5f)
2325+
{
2326+
npc->ThrottleAdjust(dt, 0.5f, -1.0f);
2327+
}
2328+
else
2329+
{
2330+
npc->ThrottleAdjust(dt, 6.0f, -1.0f);
2331+
}
2332+
npc->XYZVecToPos(&dir, npc->arena.Pos() );
2333+
dir.x = dir_zoom.x;
2334+
dir.z = dir_zoom.z;
2335+
dist = xVec3Length(&dir);
2336+
if (dist > dst_zoom)
2337+
{
2338+
dst_zoom = -1.0f;
2339+
}
2340+
else if (dist < 1e-5f)
2341+
{
2342+
dst_zoom = -1.0f;
2343+
}
2344+
else
2345+
{
2346+
xVec3SMulBy(&dir, (1.0f / dist));
2347+
npc->ThrottleApply(dt, &dir, 0);
2348+
dst_zoom = -((dt * npc->spd_throttle) *
2349+
((F32)__fabs(dir.x) + (F32)__fabs(dir.z)) -
2350+
dst_zoom);
2351+
}
2352+
if (dst_zoom < 0.0f)
2353+
{
2354+
donemoving = 1;
2355+
}
2356+
return donemoving;
2357+
}
2358+
23182359
S32 zNPCGoalAlertTubelet::Enter(F32 dt, void* updCtxt)
23192360
{
23202361
zNPCTubeSlave* npc = ((zNPCTubeSlave*)(psyche->clt_owner));

0 commit comments

Comments
 (0)