1534 float left_distance;
1535 float right_distance;
1555 int system_event_no;
1580 static sceVu0FVECTOR reference = {0.0f, 0.0f, 0.0f, 0.0f};
1584 time = EdMoveCharaInfo.
time;
1585 camera = EdMoveCharaInfo.
camera;
1587 key_lock = EdMoveCharaInfo.
key_lock;
1589 interior = EdMoveCharaInfo.
interior;
1590 ground = EdMoveCharaInfo.
ground;
1592 if (key_lock != 0) {
1602 sceVu0FVECTOR velocity = {0.0f, 0.0f, 0.0f, 0.0f};
1609 if (key_lock != 0 || chara_fishing > ED_FISHING_STAND) {
1613 if (PadOn(0x80) != 0 && EdDebugMoveFlag > 0) {
1614 if (EdDebugMoveFlag > 0) {
1624 motion_speed = -1.0f;
1626 if (viewMode == 0) {
1627 move_x = lx * cosf(angle) + ly * sinf(angle);
1628 move_z = ly * cosf(angle) - lx * sinf(angle);
1630 if (interior != 0) {
1631 velocity[0] = move_x;
1632 velocity[2] = move_z;
1634 velocity[0] = 1.6f * move_x;
1635 velocity[2] = 1.6f * move_z;
1640 sceVu0FVECTOR normal;
1642 normal[1] = normal[1] < 0.0f ? -normal[1] : normal[1];
1643 velocity[0] *= normal[1];
1644 velocity[2] *= normal[1];
1647 if (lx != 0.0f || ly != 0.0f) {
1648 stick = sqrtf(lx * lx + ly * ly);
1650 if (stick > 0.85f && EdMoveCharaInfo.
fishing == 0) {
1654 motion_speed = 0.8f * (0.2f + stick);
1656 if (motion_speed > 0.85f) {
1657 motion_speed = 0.85f;
1664 if (move_x != 0.0f || move_z != 0.0f) {
1667 }
else if (interior != 0) {
1672 sceVu0FVECTOR eye_rot;
1674 eye_rot[1] -= 0.04f * lx;
1676 if (eye_rot[1] > PI) {
1677 eye_rot[1] -= TWO_PI;
1680 if (eye_rot[1] < -PI) {
1681 eye_rot[1] += TWO_PI;
1687 move_x = ly * sinf(angle);
1688 move_z = ly * cosf(angle);
1689 velocity[0] = 0.6f * -move_x;
1690 velocity[2] = 0.6f * -move_z;
1693 sceVu0FVECTOR normal;
1695 normal[1] = normal[1] < 0.0f ? -normal[1] : normal[1];
1696 velocity[0] *= normal[1];
1697 velocity[2] *= normal[1];
1701 if ((chara_mode & 6) == 0 && chara_fishing < ED_FISHING_CAST_START) {
1706 if (PadDown(0x20) != 0 && EdDebugMoveFlag != 0 && key_lock == 0 && chara_fishing < ED_FISHING_CAST_START) {
1719 if (interior == 0) {
1720 poly_count = ground->
PickUpPoly(polys, pos[0], pos[1], pos[2]);
1723 box.
max[0] = 20.0f + pos[0];
1724 box.
min[0] = pos[0] - 20.0f;
1725 box.
max[2] = 20.0f + pos[2];
1726 box.
min[2] = pos[2] - 20.0f;
1727 box.
max[1] = 1000.0f + pos[1];
1728 box.
min[1] = pos[1] - 1000.0f;
1730 for (i = 0; i < EdMoveCharaInfo.
parts_count; i++) {
1733 if (frame != NULL) {
1734 poly_count += frame->PickUpNearPoly(&polys[poly_count], box);
1739 poly_count += EdEventPointCpPoly(pos, EdMoveCharaInfo.
points, EdMoveCharaInfo.
point_count, &polys[poly_count], time);
1741 if (EdMoveCharaInfo.
fishing != 0) {
1742 poly_count += FishingPickUpPoly(&polys[poly_count]);
1745 for (i = 0; i < 10; i++) {
1746 if (IsVillagerActive(&EdVillager[i])) {
1747 poly_count += EdVillager[i].
PickUpPoly(pos, &polys[poly_count]);
1751 if (poly_count > 200) {
1752 printf(
"cpoly over!!!! %d\n", poly_count);
1757 velocity[1] = fall.
y;
1758 MoveCheck(pos, velocity, next, &chara->
move_info, polys, poly_count, 0);
1760 if (EdDebugMoveFlag >= 2) {
1761 next[0] = pos[0] + velocity[0];
1762 next[2] = pos[2] + velocity[2];
1766 sceVu0FVECTOR ahead;
1767 sceVu0FVECTOR event_hit;
1769 int event_index = -1;
1770 sceVu0CopyVector(eye, pos);
1772 ahead[0] = 7.5f * sinf(rot[1]);
1774 ahead[2] = 7.5f * cosf(rot[1]);
1775 poly_event = GetEventPoly(eye, ahead, &event_poly, &event_index, event_hit, polys, poly_count, 0);
1776 sceVu0SubVector(move, next, pos);
1778 if (next[1] < -1000.0f) {
1782 if (interior != 0 && next[1] < 0.0f) {
1790 if (fall.
y < -4.0f) {
1796 if ((chara_mode & 2) != 0 && (chara->
motion_state == 3 || viewMode != 0)) {
1801 if (fall.
y < -1.0f) {
1811 if (fall.
y < -0.5f) {
1816 if (viewMode == 0 && interior == 0) {
1818 sceVu0FVECTOR target;
1819 sceVu0CopyVector(target, next);
1820 target[0] += 7.0f * move[0];
1821 target[1] += 14.0f + (2.0f * move[1] + reference[1]);
1822 target[2] += 7.0f * move[2];
1823 camera->
SetFollow(target[0], target[1], target[2]);
1825 EyeCamera(view_camera, chara, interior);
1828 if (EdMoveCharaInfo.
fishing == 0 && PadDown(2) != 0) {
1829 if (viewMode == 0) {
1830 sceVu0FVECTOR eye_pos;
1831 sceVu0FVECTOR eye_ref;
1834 view_camera->
SetPos(eye_pos);
1835 view_camera->
SetRef(eye_ref);
1836 viewMode = !viewMode;
1837 InitEyeCamera(chara);
1839 viewMode = !viewMode;
1849 right_clear = left_clear = keep_distance = 1;
1851 if (viewMode == 0 && interior == 0 && EdDebugMoveFlag < 2) {
1852 sceVu0FVECTOR last_hit;
1853 sceVu0FVECTOR eye_pos;
1856 sceVu0FVECTOR behind;
1857 sceVu0FVECTOR forward;
1858 sceVu0FVECTOR towards;
1859 sceVu0FVECTOR left_end;
1860 sceVu0FVECTOR right_end;
1862 sceVu0FVECTOR right;
1863 sceVu0FVECTOR reach;
1864 sceVu0FVECTOR direction;
1867 sceVu0FVECTOR to_eye;
1868 sceVu0FVECTOR to_wall;
1869 sceVu0FVECTOR cross;
1871 float hit_point[32][4];
1872 sceVu0FVECTOR origin;
1873 sceVu0FVECTOR facing;
1874 sceVu0FVECTOR facing_first;
1875 sceVu0FVECTOR floor_normal;
1877 right_distance = left_distance = 1000000;
1880 sceVu0SubVector(forward, look, eye_pos);
1881 sceVu0SubVector(behind, eye_pos, forward);
1882 sceVu0Normalize(direction, forward);
1885 span = DistVector(behind, look);
1886 box.
max[0] = eye_pos[0] + span;
1887 box.
min[0] = eye_pos[0] - span;
1888 box.
max[2] = eye_pos[2] + span;
1889 box.
min[2] = eye_pos[2] - span;
1890 box.
max[1] = 100.0f + eye_pos[1];
1891 box.
min[1] = eye_pos[1] - 100.0f;
1893 if (EdMoveCharaInfo.
fishing != 0) {
1900 if (CheckCameraWidth(walls, wall_count, eye_pos, 10.0f, wall, 0) != 0) {
1901 sceVu0SubVector(to_eye, look, eye_pos);
1902 sceVu0SubVector(to_wall, look, wall);
1903 to_eye[1] = to_wall[1] = 0.0f;
1904 sceVu0Normalize(to_eye, to_eye);
1905 sceVu0Normalize(to_wall, to_wall);
1906 sceVu0OuterProduct(cross, to_eye, to_wall);
1908 camera->
SetAngleSoon(atan2f(-to_wall[0], -to_wall[2]));
1910 if (cross[1] > 0.0f) {
1914 if (cross[1] < -0.0f) {
1919 hits = CheckHits(walls, wall_count, look, behind, 32, hit_poly, hit_point, 1, 0);
1920 sceVu0CopyVector(origin, eye_pos);
1921 left[0] = forward[2];
1923 left[2] = -forward[0];
1924 sceVu0Normalize(left, left);
1925 sceVu0ScaleVector(reach, left, 100.0f);
1926 sceVu0AddVector(left_end, origin, reach);
1927 wall_hit = CheckHit(walls, wall_count, origin, left_end, hit, 1, 0);
1929 if (wall_hit >= 0) {
1930 normal = walls[wall_hit].
normal;
1931 sceVu0Normalize(normal, normal);
1933 if (sceVu0InnerProduct(left, normal) > 0.001f) {
1934 left_distance = DistVector(origin, hit);
1935 }
else if (DistVector(origin, hit) < 5.0f) {
1940 right[0] = -forward[2];
1942 right[2] = forward[0];
1943 sceVu0Normalize(right, right);
1944 sceVu0ScaleVector(reach, right, 100.0f);
1945 sceVu0AddVector(right_end, origin, reach);
1946 wall_hit = CheckHit(walls, wall_count, origin, right_end, hit, 1, 0);
1948 if (wall_hit >= 0) {
1949 normal = walls[wall_hit].
normal;
1950 sceVu0Normalize(normal, normal);
1952 if (sceVu0InnerProduct(right, normal) > 0.001f) {
1953 right_distance = DistVector(origin, hit);
1954 }
else if (DistVector(origin, hit) < 5.0f) {
1960 camera_far_dist = 80.0f;
1963 for (i = 0; i < hits; i++) {
1964 sceVu0SubVector(towards, hit_point[i], eye_pos);
1966 if (sceVu0InnerProduct(forward, towards) < 0.0f) {
1975 sceVu0CopyVector(facing, walls[hit_poly[last]].normal);
1977 if (sceVu0InnerProduct(direction, facing) > 0.0f) {
1978 if (last + 1 < hits) {
1979 away = DistVector(eye_pos, hit_point[last + 1]);
1981 if (away - DistVector(eye_pos, hit_point[last]) < 0.0f) {
1982 CameraAutoMove(camera, &walls[hit_poly[last + 1]], hit_point[last + 1], left_distance, right_distance);
1984 CameraAutoMove(camera, &walls[hit_poly[last]], hit_point[last], left_distance, right_distance);
1987 CameraAutoMove(camera, &walls[hit_poly[last]], hit_point[last], left_distance, right_distance);
1988 sceVu0CopyVector(last_hit, hit_point[last]);
1992 sceVu0CopyVector(facing_first, walls[hit_poly[0]].normal);
1994 if (sceVu0InnerProduct(forward, facing_first) < 0.0f) {
1995 CameraAutoMove(camera, &walls[hit_poly[0]], hit_point[0], left_distance, right_distance);
2002 sceVu0CopyVector(behind, eye_pos);
2004 floor_poly = CheckHitVertical(walls, wall_count, behind, -100.0f, hit, 0);
2006 if (floor_poly >= 0) {
2007 sceVu0Normalize(floor_normal, walls[floor_poly].normal);
2009 if (eye_pos[1] - hit[1] < 18.0f) {
2010 if ((floor_normal[1] < 0.0f ? -floor_normal[1] : floor_normal[1]) > 0.5f) {
2011 eye_pos[1] = 18.0f + hit[1];
2012 camera->
SetHeight(eye_pos[1] - look[1] - 0.01f);
2019 if ((camera->
GetDistance() < camera_near_dist * half || camera->
GetHeight() > 60.0f) && shallow == 0 && hits > 0) {
2025 if (MapNo == 35 && eye_pos[2] > 200.0f) {
2033 if (viewMode == 0 && interior == 0) {
2038 if (EdDebugCameraFlag == 0) {
2046 if (rx > 0.0f && left_clear != 0) {
2050 if (rx < 0.0f && right_clear != 0) {
2055 if (left_clear != 0 && PadOn(8) != 0) {
2057 }
else if (right_clear != 0 && PadOn(4) != 0) {
2077 if (!(lx < 0.0f) && lx < 0.5f) {
2081 if (lx <= 0.0f && lx > -0.5f) {
2085 if (left_clear == 0) {
2089 if (right_clear == 0) {
2094 lx *= DistVector(move) / 1.6f / 2.0f;
2096 if (lx > 0.1f && left_clear != 0) {
2105 camera->
AddAngle(2.0f * (-DEG_TO_RAD * turn));
2108 if (lx < -0.1f && right_clear != 0) {
2117 camera->
AddAngle(2.0f * (-DEG_TO_RAD * turn));
2121 if (keep_distance != 0) {
2125 if (EdDebugCameraFlag == 0) {
2155 if (PadOn(0x1000) != 0) {
2156 reference[1] += 2.0f;
2159 if (PadOn(0x4000) != 0) {
2160 reference[1] -= 2.0f;
2165 static int rot_count = 0;
2167 if (PadOn(0x20) != 0 && EdDebugMoveFlag == 0) {
2171 if (rot_count > 0) {
2173 turn_side = AngleCmp(behind_angle, camera->
GetAngle(), 0.1f);
2175 if (turn_side < 0) {
2176 if (left_clear != 0) {
2183 if (turn_side > 0) {
2184 if (right_clear != 0) {
2191 if (turn_side == 0) {
2198 if (rot_count < 0) {
2203 near_villager = EdSearchNearNPC(chara, EdVillager, 10);
2205 if (near_villager >= 0) {
2209 if (EdMoveCharaInfo.
fishing == 0) {
2212 sceVu0FVECTOR heading;
2215 system_event_no = event_no = -1;
2216 points = EdMoveCharaInfo.
points;
2219 param = &EdMoveCharaInfo.
param;
2221 if (EdGetEvent(points, point_count, param, here, heading, time) != 0) {
2222 if (param->
kind == ED_EVENT_POINT_ITEM_BOX && PadDown(0x40) != 0 && (viewMode == 0 || interior != 0)) {
2224 refused = EdCheckGetItem(item);
2230 if (GetAddAttachItem(param->
point->
side) != 0) {
2231 attach = rand() % 3 + 1;
2237 SndSePlay(SE_BOX_OPEN, -1, 0);
2239 DontGetItemMes(refused);
2240 SndSePlay(SE_BOX_OPEN, -1, 0);
2244 if (param->
kind == ED_EVENT_POINT_EVENT && param->
point->
side > 0) {
2248 if (param->
kind == ED_EVENT_POINT_LADDER_BOTTOM || param->
kind == ED_EVENT_POINT_LADDER_TOP) {
2251 if (PadDown(0x40) != 0 && (interior != 0 || viewMode == 0)) {
2252 EdInitHashigo(&EdEventInfo, param);
2253 system_event_no = 1;
2260 if (near_villager >= 10) {
2264 if (acted == 0 && (viewMode == 0 || interior != 0) && near_villager >= 0) {
2265 if (EdVillagerInfo[near_villager].talk_event_no > 0 && EdVillagerInfo[near_villager].talk_event_level != 0 && EdTalkModeInit(&EdVillager[near_villager], -1) != 0) {
2271 if (acted == 0 && PadDown(0x40) != 0 && (viewMode == 0 || interior != 0) && key_lock == 0) {
2272 if (near_villager >= 0) {
2273 if (EdTalkModeInit(&EdVillager[near_villager], -1) != 0) {
2277 }
else if (poly_event > 0) {
2278 event_no = poly_event;
2283 EdMoveCharaInfo.
event_no = event_no;
2285 EdMoveCharaInfo.
acted = acted;
2288 hook_weight = float_weight = -1.0f;
2290 static int bgm_vol = 0;
2291 static int load_file = 0;
2293 if (EdMoveCharaInfo.
fishing != 0) {
2296 if (EdDebugMoveFlag == 0) {
2300 sceVu0FVECTOR stand;
2301 sceVu0FVECTOR facing;
2302 sceVu0FVECTOR float_pos;
2305 FishLineGetUki(float_pos);
2307 fish_status = FishingFishStatus(&fish_no);
2308 static int st_cnt = 0;
2309 static int wait_cnt = 0;
2311 switch (chara_fishing) {
2312 case ED_FISHING_INIT:
2313 chara_fishing = ED_FISHING_STAND;
2314 FishingInitFishStatus();
2315 FishingAngleFish(-1);
2319 case ED_FISHING_STAND:
2321 EdFishingWalkHelpMes(FishingGetEsaItemNo());
2324 FishingAngleFish(-1);
2326 if (EdPadDown(0x40, 0xFFFF) != 0) {
2327 chara_fishing = ED_FISHING_CAST_START;
2331 if (EdPadDown(0x20, 0xFFFF) != 0) {
2334 EdMoveCharaInfo.
acted =
true;
2338 if (EdPadDown(0x80, 0xFFFF) != 0) {
2341 EdMoveCharaInfo.
acted =
true;
2345 float_weight = 1.0f;
2347 case ED_FISHING_CAST_START:
2349 chara_fishing = ED_FISHING_CASTING;
2352 case ED_FISHING_CASTING:
2356 SndSePlay(SE_FISHING_CAST, pos, -1.0f, -1.0f);
2361 chara_fishing = ED_FISHING_WAIT_BITE;
2367 case ED_FISHING_WAIT_BITE: {
2368 EdFishingAngleHelpMEs(FishingGetEsaItemNo());
2371 if (wait_cnt < 600) {
2373 }
else if (wait_cnt < 1200) {
2376 if (wait_cnt == 1200) {
2386 reel_turn = -GamePad.
GetLXf();
2387 facing[1] = AngleInterpolate(facing[1], facing[1] + 0.1f * reel_turn, 0.01f,
INTERPOLATE_STEP);
2390 if (reel_turn != 0.0f) {
2395 if (EdPadDown(0x40, 0xFFFF) != 0 || (st_cnt > 30 && FishingCheckUkiHook() != 0)) {
2396 chara_fishing = ED_FISHING_REEL_IN;
2400 if (fish_status == 7) {
2401 chara_fishing = ED_FISHING_BITE_CHECK;
2404 if (fish_status == 8) {
2405 chara_fishing = ED_FISHING_HOOKED;
2413 case ED_FISHING_REEL_IN:
2416 FishLineGetHook(hook);
2418 if (hook[1] < 5.0f + FishingGetWaterLevel()) {
2419 SndSePlay(SE_FISHING_SINK, float_pos, -1.0f, -1.0f);
2425 chara_fishing = ED_FISHING_STAND;
2430 float_weight = 0.02f * (float) (st_cnt - 30);
2433 if (float_weight > 1.0f) {
2434 float_weight = 1.0f;
2438 case ED_FISHING_BITE_CHECK: {
2439 EdFishingAngleHelpMEs(FishingGetEsaItemNo());
2441 if (fish_status == 8) {
2442 chara_fishing = ED_FISHING_HOOKED;
2443 }
else if (fish_status != 7) {
2444 chara_fishing = ED_FISHING_WAIT_BITE;
2449 if (EdPadDown(0x40, 0xFFFF) != 0) {
2450 chara_fishing = ED_FISHING_SINK;
2453 SndSePlay(SE_FISHING_SINK, float_pos, -1.0f, -1.0f);
2455 if (rand() % 100 < 20) {
2456 EdFishingLostEsaMes();
2461 pull = -0.15f * (float) rand() / 2.1474836e9f;
2464 sceVu0FVECTOR ripple;
2465 FishLineGetUki(ripple);
2466 ripple[1] = FishingGetWaterLevel();
2468 EffectHamon(&EdEffectGroup, ripple, 10.0f);
2475 case ED_FISHING_HOOKED:
2476 EdFishingAngleHelpMEs(FishingGetEsaItemNo());
2478 if (FishingFishStatus(NULL) != 8) {
2479 chara_fishing = ED_FISHING_WAIT_BITE;
2482 if (rand() % 100 < 30) {
2483 EdFishingLostEsaMes();
2490 if (EdPadDown(0x40, 0xFFFF) != 0 || DebugMode) {
2492 if (EdPadDown(0x40, 0xFFFF) != 0) {
2494 SndSePlay(SE_FISHING_CAST, pos, -1.0f, -1.0f);
2495 chara_fishing = ED_FISHING_BATTLE;
2497 FishingBattleFish(fish_no);
2498 fish_file = GetFishFileName(FishingFishKind(fish_no));
2500 if (fish_file != NULL) {
2502 LoadFileBG(fish_file, (u_long128 *) read_buffer, NULL);
2508 tug = -(0.1f + 0.05f * (float) rand() / 2.1474836e9f);
2519 case ED_FISHING_BATTLE:
2522 if (st_cnt > 120 && ReadBGSync() == 0) {
2523 read_info = GetReadBGFile(0);
2527 if (read_info != NULL) {
2528 fish_data = (u_int *) read_info->
buffer;
2529 free_blocks = EdVillagerBuffer.
limit - EdVillagerBuffer.
used;
2530 arena.
base = EdVillagerBuffer.
base + EdVillagerBuffer.
used * 16;
2531 arena.
limit = free_blocks;
2535 chara_fishing = ED_FISHING_LANDED;
2537 FishingBattleToAngleFish(fish_data, &arena);
2538 SndSePlay(SE_FISHING_BITE, -1, 0);
2544 case ED_FISHING_LANDED:
2545 chara_fishing = ED_FISHING_RESULT;
2547 fishing_mes = ED_FISHING_MES_EVALUATE;
2549 bgm_vol = SndGetBgmVol();
2550 SndBgmFadeOut(60, 0);
2552 case ED_FISHING_SINK:
2554 chara_fishing = ED_FISHING_STAND;
2556 FishingAngleFish(fish_no);
2557 FishingInitFishStatus();
2562 float_weight = 0.02f * (float) (st_cnt - 40);
2565 if (float_weight > 1.0f) {
2566 float_weight = 1.0f;
2570 case ED_FISHING_RESULT:
2571 camera->
SetAngle(AngleLimit(facing[1]));
2579 SndSPSePlay(0x2F, -1);
2582 switch (fishing_mes) {
2583 case ED_FISHING_MES_EVALUATE: {
2586 fish_kind = FishingGetAngleFishSize(&size, &fish_points);
2588 if (fish_kind < 0) {
2589 fishing_mes = ED_FISHING_MES_DONE;
2591 if (fish_kind == 5 || fish_kind == 17) {
2594 SetFishMardanGarayanNum(1);
2600 EditMes1.
mes_no[0] = GetFishMsgNo(fish_kind);
2601 EditMes1.
values[0] = size;
2602 EditMes1.
values[1] = fish_points;
2605 EditMes1.
auto_pos = MES_POS_TOP_LEFT;
2607 EditMes1.
auto_pos = MES_POS_TOP_LEFT;
2614 case ED_FISHING_MES_WAIT:
2615 if (EdMenuLoop(&EditMes1) != 0) {
2616 EditMes1.
auto_pos = MES_POS_TOP_LEFT;
2621 case ED_FISHING_MES_DONE:
2622 SndBgmFadeIn(60, bgm_vol, 0);
2624 chara_fishing = ED_FISHING_FINISH;
2633 case ED_FISHING_FINISH:
2634 camera->
SetAngle(AngleLimit(facing[1]));
2639 if (st_cnt == 120) {
2640 FishingDeleteAngleFish();
2641 SndSePlay(SE_FISHING_LANDED, -1, 0);
2646 chara_fishing = ED_FISHING_INIT;
2647 FishingDeleteAngleFish();
2648 FishingAngleFish(-1);
2649 FishingInitFishStatus();
2652 hook_weight = float_weight = 1.0f;
2657 if (follow_line != 0) {
2658 sceVu0FVECTOR centre;
2659 FishLineGetUki(centre);
2660 sceVu0AddVector(centre, centre, pos);
2661 sceVu0ScaleVector(centre, centre, 0.5f);
2662 camera->
SetFollow(centre[0], centre[1], centre[2]);
2667 chara_fishing = ED_FISHING_INIT;
2672 if (viewMode == 0) {
2676 if (viewMode == 0) {
2680 if (viewMode != 0) {
2684 if (EdMoveCharaInfo.
fishing != 0) {
2688 if (chara->
frame != NULL) {
2689 sceVu0FVECTOR origin = {0.0f, 0.0f, 0.0f, 1.0f};
2690 sceVu0FVECTOR hook_pos;
2691 sceVu0FVECTOR float_pos;
2692 frame = chara->
frame->SearchFrame(
"sao");
2694 if (frame != NULL) {
2695 frame->GetWorldPosition(rod, origin);
2698 frame = chara->
frame->SearchFrame(
"uki");
2700 if (frame != NULL) {
2701 frame->GetWorldPosition(float_pos, origin);
2704 frame = chara->
frame->SearchFrame(
"hari");
2706 if (frame != NULL) {
2707 frame->GetWorldPosition(hook_pos, origin);
2710 frame = chara->
frame->SearchFrame(
"maru_uki");
2712 if (frame != NULL) {
2716 frame = chara->
frame->SearchFrame(
"turibari");
2718 if (frame != NULL) {
2722 FishLineSetUki(float_pos, float_weight);
2723 FishLineSetHook(hook_pos, hook_weight);
2726 fish = FishingGetBattleFish();
2729 sceVu0FVECTOR fish_pos;
2731 FishLineSetHook(fish_pos, 1.0f);
2734 sceVu0FVECTOR before;
2735 sceVu0FVECTOR after;
2736 FishLineGetUki(before);
2737 FishLineStep(rod, rod);
2739 FishLineGetUki(after);
2741 water_level = FishingGetWaterLevel();
2743 if (after[1] < water_level && !(before[1] < water_level)) {
2744 fall_height = after[1] - before[1];
2746 if ((fall_height < 0.0f ? -fall_height : fall_height) > 0.8f) {
2747 SndSePlay(SE_FISHING_SPLASH, after, -1.0f, -1.0f);
2748 after[1] = FishingGetWaterLevel();
2749 EffectHamon(&EdEffectGroup, after, 15.0f);
2750 EffectHamon(&EdEffectGroup, after, 20.0f);
2751 EffectHamon(&EdEffectGroup, after, 25.0f);
2752 EffectHamon(&EdEffectGroup, after, 30.0f);
2756 if (after[1] > water_level && before[1] <= water_level) {
2757 rise = after[1] - before[1];
2759 if ((rise < 0.0f ? -rise : rise) > 0.1f) {
2760 after[1] = FishingGetWaterLevel();
2761 EffectHamon(&EdEffectGroup, after, 10.0f);
2762 EffectHamon(&EdEffectGroup, after, 15.0f);
2763 EffectHamon(&EdEffectGroup, after, 20.0f);
2768 EdStepOpenItemBox();
2775 static float cnt = 0.0f;
2778 cnt += DistVector(velocity);
2780 if (cnt > 10.0f && walked <= 10.0f) {
2784 if (cnt > 20.0f && walked <= 20.0f) {
2797 sceVu0FVECTOR unused = {0.0f, 0.0f, 0.0f, 0.0f};
2802 switch (floor_kind) {
2803 case AREA_KIND_FADE_OUT:
2806 case AREA_KIND_AMBIENT_0:
2807 case AREA_KIND_AMBIENT_1: