| 774 | } |
| 775 | |
| 776 | void zNPCGoalAlertFodder::MoveEvade(F32 dt) |
| 777 | { |
| 778 | // TODO: Variable names. |
| 779 | zNPCRobot* npc = (zNPCRobot*)this->psyche->clt_owner; |
| 780 | xVec3 r1_0x2C; |
| 781 | xVec3 r1_0x20; |
| 782 | xVec3 dir_dest; |
| 783 | xVec3 dir; |
| 784 | F32 length; |
| 785 | |
| 786 | xVec3Sub(&r1_0x2C, npc->arena.Pos(), npc->Pos()); |
| 787 | length = xVec3Length(&r1_0x2C); |
| 788 | if (length < 1.0f) |
| 789 | { |
| 790 | xVec3Copy(&r1_0x2C, NPCC_rightDir(npc)); |
| 791 | } |
| 792 | else |
| 793 | { |
| 794 | xVec3SMulBy(&r1_0x2C, 1.0f / length); |
| 795 | } |
| 796 | |
| 797 | xVec3Sub(&r1_0x20, xEntGetPos(&globals.player.ent), npc->Pos()); |
| 798 | length = xVec3Length(&r1_0x20); |
| 799 | if (length < 1.0f) |
| 800 | { |
| 801 | xVec3Copy(&r1_0x20, NPCC_rightDir(&globals.player.ent)); |
| 802 | } |
| 803 | else |
| 804 | { |
| 805 | xVec3SMulBy(&r1_0x20, 1.0f / length); |
| 806 | } |
| 807 | |
| 808 | xVec3SMul(&dir_dest, &r1_0x20, -1.0f); |
| 809 | npc->ThrottleAdjust(dt, 6.0f, -1.0f); |
| 810 | NPCC_ang_toXZDir(npc->frame->rot.angle + (npc->TurnToFace(dt, &dir_dest, PI * 4)), &dir); |
| 811 | npc->ThrottleApply(dt, &dir, 0); |
| 812 | } |
| 813 | |
| 814 | S32 zNPCGoalAlertFodBomb::Enter(F32 dt, void* updCtxt) |
| 815 | { |
no test coverage detected