Add music, beach fishing, catching, and selectable creature partners
This commit is contained in:
1 parent
3469f2e6dd
commit
cb77683a87
24 files changed
+1307
-104
No files matched your search
+68
-1
@@ -15,7 +15,7 @@ void check_buffered_walking(void)
|
||||
mark_dirty(240, 160, 4, 4);
|
||||
assert(pending_pixels() == 0);
|
||||
|
||||
for (int room = OUTSIDE; room <= MELLON_HOUSE; ++room) {
|
||||
for (int room = OUTSIDE; room <= BEACH; ++room) {
|
||||
current_room = (enum Room)room;
|
||||
player_facing = FACING_DOWN;
|
||||
int x, y;
|
||||
@@ -219,3 +219,70 @@ void check_mellon_visit(void)
|
||||
current_room = OUTSIDE;
|
||||
player_facing = FACING_DOWN;
|
||||
}
|
||||
|
||||
void check_beach_travel(void)
|
||||
{
|
||||
static u16 expected[WIDTH * HEIGHT], visible[WIDTH * HEIGHT];
|
||||
current_room = MELLON_GARDEN;
|
||||
partner_owned = 1;
|
||||
assert(reachable(31, 113, 108, 131));
|
||||
int x = 80, y = 131;
|
||||
assert(!use_map_exit(&x, &y, DOWN));
|
||||
x = 108;
|
||||
assert(!use_map_exit(&x, &y, UP));
|
||||
for (int trip = 0; trip < 5; ++trip) {
|
||||
x = 108;
|
||||
y = 129;
|
||||
assert(walk_movement(DOWN, &x, &y, 1) == WALK_MAP_CHANGED);
|
||||
assert(current_room == BEACH && x == 108 && y == 60);
|
||||
assert(can_walk(x, y) && player_facing == FACING_DOWN);
|
||||
assert(follower_x == x && follower_y == y);
|
||||
assert(!use_map_exit(&x, &y, DOWN));
|
||||
assert(!near_npc(RANGER_X, RANGER_Y) && !near_door(177, 83));
|
||||
assert(!in_tall_grass(48, 70));
|
||||
assert(!check_grass_encounter(80, 80, 81, 80));
|
||||
assert(!can_walk(55, 85)); /* Umbrella. */
|
||||
assert(!can_walk(28, 60) && !can_walk(210, 60)); /* Palms. */
|
||||
assert(reachable(x, y, 178, 97));
|
||||
assert(reachable(x, y, 30, 99));
|
||||
assert(reachable(x, y, 108, 47));
|
||||
for (int col = 17; col <= 222; ++col)
|
||||
assert(!can_walk(col, beach_shoreline(col) - 4));
|
||||
assert(!can_walk(108, 115) && !can_walk(108, 140));
|
||||
render_scene(x, y);
|
||||
copy_pending_rows(visible);
|
||||
assert(memcmp(visible, SCREEN, sizeof(visible)) == 0);
|
||||
write_preview("build/beach-preview.ppm");
|
||||
|
||||
const int positions[][2] = {{108, 47}, {178, 97}, {30, 99}, {90, 82}};
|
||||
for (unsigned i = 0; i < sizeof(positions) / sizeof(positions[0]); ++i) {
|
||||
int nx = positions[i][0], ny = positions[i][1];
|
||||
assert(can_walk(nx, ny));
|
||||
render_scene(nx, ny);
|
||||
memcpy(expected, SCREEN, sizeof(expected));
|
||||
render_scene(x, y);
|
||||
restore(x - 8, y - 20, 17, 24);
|
||||
actors(nx, ny, 0);
|
||||
location_status(nx, ny);
|
||||
assert(memcmp(expected, SCREEN, sizeof(expected)) == 0);
|
||||
}
|
||||
x = 108;
|
||||
y = beach_shoreline(x) - 6;
|
||||
assert(walk_movement(DOWN, &x, &y, MAX_MOVEMENT_TICKS) == WALK_NORMAL);
|
||||
assert(y == beach_shoreline(x) - 5); /* Even catch-up frames cannot enter the sea. */
|
||||
reset_position(&x, &y);
|
||||
assert(current_room == BEACH && x == 108 && y == 60);
|
||||
assert(follower_x == x && follower_y == y);
|
||||
y = 48;
|
||||
assert(walk_movement(UP, &x, &y, 1) == WALK_MAP_CHANGED);
|
||||
assert(current_room == MELLON_GARDEN && x == 108 && y == 125);
|
||||
assert(player_facing == FACING_UP && follower_x == x && follower_y == y);
|
||||
assert(!use_map_exit(&x, &y, UP));
|
||||
assert(reachable(x, y, 177, 83)); /* Professor's door remains accessible. */
|
||||
assert(reachable(x, y, 17, 113)); /* Town exit remains accessible. */
|
||||
}
|
||||
current_room = OUTSIDE;
|
||||
partner_owned = follower_ready = 0;
|
||||
player_facing = FACING_DOWN;
|
||||
puts("Beach: garden connection, return path, shore collisions, following, and redraw checks passed");
|
||||
}
|
||||
Reference in new issue
Block a user