1231 {
1234 s32 surfaceType;
1235 f32 moveHistoryX, moveHistoryY, moveHistoryZ;
1236 f32 x, y, z;
1237 f32 distance;
1238 f32 yaw;
1239 f32 temp_a3;
1240 f32 angle;
1241 s32 var_a1;
1243
1245 case 0:
1247 moveHistoryX = currentSnapshot->
pos.
x;
1248 moveHistoryZ = currentSnapshot->
pos.
z;
1253
1255 if (distance >= 50.0) {
1257 }
1260 }
1264 }
1265 while (TRUE) {
1266 distance =
dist2D(x, z, moveHistoryX, moveHistoryZ);
1267 yaw =
atan2(x, z, moveHistoryX, moveHistoryZ);
1269 distance =
dist2D(x, z, playerStatus->
pos.
x, playerStatus->
pos.
z);
1270 if (distance >= 50.0) {
1271 break;
1272 }
1279 }
1280 } else {
1282 }
1283 break;
1284 } else {
1287 }
1288 }
1295 break;
1296 } else {
1300 }
1302 moveHistoryX = currentSnapshot->
pos.
x;
1303 moveHistoryZ = currentSnapshot->
pos.
z;
1304
1307 break;
1308 }
1309
1312 break;
1313 }
1314 }
1315 }
1316
1319 }
1327 ) {
1332 }
1334 moveHistoryX = currentSnapshot->
pos.
x;
1335 moveHistoryZ = currentSnapshot->
pos.
z;
1338 return;
1339 }
1340 } else {
1342 return;
1343 }
1344 }
1345 break;
1346 case 1:
1350 moveHistoryX = partner->
pos.
x;
1351 moveHistoryY = playerStatus->
pos.
y;
1352 moveHistoryZ = partner->
pos.
z;
1354 } else {
1355 break;
1356 }
1357 } else {
1361 }
1363 moveHistoryX = currentSnapshot->
pos.
x;
1364 moveHistoryY = currentSnapshot->
pos.
y;
1365 moveHistoryZ = currentSnapshot->
pos.
z;
1366 }
1377 }
1384 return;
1385 }
1389 }
1392 if (partner->
jumpVel > 20.0) {
1394 }
1397 }
1400 } else {
1402 }
1403
1409
1410 case 2:
1413 if (partner->
jumpVel <= 0.0f) {
1415 }
1416 if (partner->
pos.
y < -2000.0f) {
1418 partner->
flags &= ~NPC_FLAG_JUMPING;
1421 partner->
pos.
x = playerStatus->
pos.
x;
1422 partner->
pos.
y = playerStatus->
pos.
y;
1423 partner->
pos.
z = playerStatus->
pos.
z;
1425 return;
1426 }
1427 if (partner->
jumpVel <= 0.0f) {
1430 y = partner->
pos.
y + distance;
1435 partner->
flags &= ~NPC_FLAG_JUMPING;
1442 if (distance < 5.0) {
1443 partner->
pos.
x = playerStatus->
pos.
x;
1444 partner->
pos.
y = playerStatus->
pos.
y;
1445 partner->
pos.
z = playerStatus->
pos.
z;
1448 }
1449 break;
1450 }
1451 }
1452 }
1454 break;
1455 case 5:
1457 moveHistoryX = currentSnapshot->
pos.
x;
1458 moveHistoryZ = currentSnapshot->
pos.
z;
1470 }
1474 return;
1475 }
1476 } else {
1485 if (distance > 2.0f) {
1490 } else {
1500 }
1501 }
1502 }
1503 } else {
1511 }
1512 }
1516 distance = 1000.0f;
1532 }
1535 }
1536 }
1537 break;
1538 }
1539 }
1544 }
1545 } else {
1546 while (TRUE) {
1548 break;
1549 }
1550 yaw =
atan2(partner->
pos.
x, partner->
pos.
z, moveHistoryX, moveHistoryZ);
1552 break;
1553 }
1555 break;
1556 }
1560 }
1562 moveHistoryX = currentSnapshot->
pos.
x;
1563 moveHistoryZ = currentSnapshot->
pos.
z;
1564 }
1567 return;
1568 }
1569 while (TRUE) {
1571 break;
1572 }
1573 yaw =
atan2(partner->
pos.
x, partner->
pos.
z, moveHistoryX, moveHistoryZ);
1575 break;
1576 }
1578 break;
1579 }
1583 }
1585 moveHistoryX = currentSnapshot->
pos.
x;
1586 moveHistoryZ = currentSnapshot->
pos.
z;
1587 }
1589 return;
1590 }
1591 break;
1592 case 15:
1594 case 0:
1607
1608 case 1:
1614 if (partner->
jumpVel <= 0.0f) {
1616 }
1617 if (partner->
jumpVel <= 0.0f) {
1620 y = partner->
pos.
y + distance;
1627 partner->
flags &= ~NPC_FLAG_JUMPING;
1628 }
1629 }
1630 }
1635 } else {
1643 }
1644 return;
1645 case 2:
1648 return;
1649 }
1653 }
1654 break;
1655 case 20:
1657 break;
1658 case 40:
1663 } else {
1665 }
1666 break;
1667 }
1671 if (partner->
jumpVel <= 0.0f) {
1673 }
1674 if (partner->
pos.
y < -2000.0f) {
1676 partner->
flags &= ~NPC_FLAG_JUMPING;
1679 partner->
pos.
x = playerStatus->
pos.
x;
1680 partner->
pos.
y = playerStatus->
pos.
y;
1681 partner->
pos.
z = playerStatus->
pos.
z;
1683 return;
1684 }
1687 y = partner->
pos.
y + distance;
1691 partner->
flags &= ~NPC_FLAG_JUMPING;
1697 }
1698 break;
1699 case 50:
1700 break;
1701 }
1702}
@ PARTNER_ANIM_INDEX_WALK
@ ACTION_STATE_TALK
Reading signs doesn't count.
@ NPC_FLAG_COLLDING_FORWARD_WITH_WORLD
f32 player_get_side_angle(void)
f32 get_clamped_angle_diff(f32, f32)
BSS PlayerPathElement gPlayerMoveHistory[40]
BSS s32 gPlayerMoveHistoryIndex
s32 func_800EA4B0(s32 collisionID)
BSS f32 wPartnerTetherDistance
void partner_move_to_goal(Npc *, s32)