| 2411 | } |
| 2412 | |
| 2413 | S32 zNPCGoalAlertTubelet::MoveToHome(F32 dt) |
| 2414 | { |
| 2415 | S32 arrived; |
| 2416 | zNPCRobot* npc = (zNPCRobot*)(psyche->clt_owner); |
| 2417 | NPCArena* arena = &npc->arena; |
| 2418 | F32 rad; |
| 2419 | F32 dst_surplus; |
| 2420 | xVec3 dir_home; |
| 2421 | |
| 2422 | rad = arena->Radius(1.0f) - 15.0f; |
| 2423 | if (rad < 0.0f) |
| 2424 | { |
| 2425 | rad = 0.0f; |
| 2426 | } |
| 2427 | |
| 2428 | dst_surplus = xsqrt(npc->XZDstSqToPos(arena->Pos(), &dir_home, 0)); |
| 2429 | if (dst_surplus < (rad + 1.0f)) |
| 2430 | { |
| 2431 | arrived = 1; |
| 2432 | npc->VelStop(); |
| 2433 | } |
| 2434 | else |
| 2435 | { |
| 2436 | if (dst_surplus > (rad + 2.0f)) |
| 2437 | { |
| 2438 | npc->ThrottleAdjust(dt, 7.2f, 5.5f); |
| 2439 | } |
| 2440 | else |
| 2441 | { |
| 2442 | npc->ThrottleAdjust(dt, 0.25f, 0.5f); |
| 2443 | } |
| 2444 | dir_home *= (1.0f / dst_surplus); |
| 2445 | npc->ThrottleApply(dt, &dir_home, 0); |
| 2446 | arrived = 0; |
| 2447 | } |
| 2448 | return arrived; |
| 2449 | } |
| 2450 | |
| 2451 | void zNPCGoalAlertTubelet::PeteAttackBegin() |
| 2452 | { |
nothing calls this directly
no test coverage detected