#include "2s2h/GameInteractor/GameInteractor.h"
#include "2s2h/ShipInit.hpp"

#include "2s2h/Rando/Logic/Logic.h"

using namespace Rando::Logic;

// clang-format off
static RegisterShipInitFunc initFunc([]() {
    Regions[RR_TERMINA_FIELD_BEFORE_GREAT_BAY_COAST] = RandoRegion{ .name = "Before Great Bay Coast", .sceneId = SCENE_00KEIKOKU,
        .exits = { //     TO                                         FROM
            EXIT(ENTRANCE(GREAT_BAY_COAST, 0),              ENTRANCE(TERMINA_FIELD, 2), true),
        },
        .connections = {
            CONNECTION(RR_TERMINA_FIELD, CAN_PLAY_SONG(EPONA)),
        },
    };
    Regions[RR_TERMINA_FIELD_BEFORE_PATH_TO_MOUNTAIN_VILLAGE] = RandoRegion{ .sceneId = SCENE_00KEIKOKU,
        .exits = { //     TO                                         FROM
            EXIT(ENTRANCE(PATH_TO_MOUNTAIN_VILLAGE, 0),     ENTRANCE(TERMINA_FIELD, 3), true),
        },
        .connections = {
            CONNECTION(RR_TERMINA_FIELD, HAS_ITEM(ITEM_BOW)),
        },
    };
    Regions[RR_TERMINA_FIELD_BIO_BABA_GROTTO] = RandoRegion{ .name = "Termina Field Bio Baba", .sceneId = SCENE_KAKUSIANA,
        .checks = {
            CHECK(RC_TERMINA_FIELD_BIO_BABA_GROTTO, CAN_BE_ZORA && CAN_USE_ABILITY(SWIM)),
            CHECK(RC_TERMINA_FIELD_BIO_BABA_GROTTO_GRASS_01, true),
            CHECK(RC_TERMINA_FIELD_BIO_BABA_GROTTO_GRASS_02, true),
            CHECK(RC_ENEMY_DROP_BIO_DEKU_BABA, CanKillEnemy(ACTOR_BOSS_05)),
        },
        .exits = { //     TO                                         FROM
            EXIT(ENTRANCE(TERMINA_FIELD, 0),                ENTRANCE(GROTTOS, 11), true),
        },
    };
    Regions[RR_TERMINA_FIELD_COW_GROTTO] = RandoRegion{ .name = "Termina Field Cow", .sceneId = SCENE_KAKUSIANA,
        .checks = {
            CHECK(RC_TERMINA_FIELD_COW_BACK, CAN_PLAY_SONG(EPONA)),
            CHECK(RC_TERMINA_FIELD_COW_FRONT, CAN_PLAY_SONG(EPONA)),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_01, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_02, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_03, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_04, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_05, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_06, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_07, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_08, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_09, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_10, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_11, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_12, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_13, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_14, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_15, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_16, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_17, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_18, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_19, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_20, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_21, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_22, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_23, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_24, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_25, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_26, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_27, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_28, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_29, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_30, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_31, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_32, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_33, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_34, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_35, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_36, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_37, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_38, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_39, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_40, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_41, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_42, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_43, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_44, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_45, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_46, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_47, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_48, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_49, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_50, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_51, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_52, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_53, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_54, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_55, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_56, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_57, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_58, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_59, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_60, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_61, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_62, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_63, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_64, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_65, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_66, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_67, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_68, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_69, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_70, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_71, true),
            CHECK(RC_TERMINA_FIELD_COW_GROTTO_GRASS_72, true),
            CHECK(RC_ENEMY_DROP_GIANT_BEE, CAN_USE_PROJECTILE && CanKillEnemy(ACTOR_EN_BEE)), // In a beehive
        },
        .exits = { //     TO                                         FROM
            EXIT(ENTRANCE(TERMINA_FIELD, 0),                ENTRANCE(GROTTOS, 17), true),
        },
    };
    Regions[RR_TERMINA_FIELD_DODONGO_GROTTO] = RandoRegion{ .name = "Termina Field Dodongo", .sceneId = SCENE_KAKUSIANA,
        .checks = {
            CHECK(RC_TERMINA_FIELD_DODONGO_GROTTO_CHEST, CanKillEnemy(ACTOR_EN_DODONGO)),
            CHECK(RC_ENEMY_DROP_DODONGO, CanKillEnemy(ACTOR_EN_DODONGO)),
        },
        .exits = { //     TO                                         FROM
            EXIT(ENTRANCE(TERMINA_FIELD, 0),                ENTRANCE(GROTTOS, 7), true),
        },
    };
    Regions[RR_TERMINA_FIELD_GOSSIP_STONE_GROTTO_1] = RandoRegion{ .name = "Termina Field Gossip Stone #1", .sceneId = SCENE_KAKUSIANA,
        .checks = {
            CHECK(RC_ENEMY_DROP_SKULLTULA, CanKillEnemy(ACTOR_EN_ST)),
            CHECK(RC_ENEMY_DROP_SKULLWALLTULA, CanKillEnemy(ACTOR_EN_SW)),
        },
        .exits = { //     TO                                         FROM
            EXIT(ENTRANCE(TERMINA_FIELD, 0),                ENTRANCE(GROTTOS, 1), true),
        },
        .events = {
            // TODO: gSaveContext.save.saveInfo.unk_EA0 for gossip stone check
        },
    };
    Regions[RR_TERMINA_FIELD_GOSSIP_STONE_GROTTO_2] = RandoRegion{ .name = "Termina Field Gossip Stone #2", .sceneId = SCENE_KAKUSIANA,
        .exits = { //     TO                                         FROM
            EXIT(ENTRANCE(TERMINA_FIELD, 0),                ENTRANCE(GROTTOS, 3), true),
        },
        .events = {
            // TODO: gSaveContext.save.saveInfo.unk_EA0 for gossip stone check
        },
    };
    Regions[RR_TERMINA_FIELD_GOSSIP_STONE_GROTTO_3] = RandoRegion{ .name = "Termina Field Gossip Stone #3", .sceneId = SCENE_KAKUSIANA,
        .checks = {
            CHECK(RC_TERMINA_FIELD_GOSSIP_STONE_GROTTO, (CAN_BE_DEKU && CAN_PLAY_SONG(SONATA)) || (CAN_BE_GORON && CAN_PLAY_SONG(LULLABY)) || (CAN_BE_ZORA && CAN_PLAY_SONG(BOSSA_NOVA))),
            CHECK(RC_TERMINA_FIELD_GOSSIP_STONE_GROTTO_3_GRASS_01, true),
            CHECK(RC_TERMINA_FIELD_GOSSIP_STONE_GROTTO_3_GRASS_02, true),
            CHECK(RC_TERMINA_FIELD_GOSSIP_STONE_GROTTO_3_GRASS_03, true),
            CHECK(RC_TERMINA_FIELD_GOSSIP_STONE_GROTTO_3_GRASS_04, true),
            CHECK(RC_TERMINA_FIELD_GOSSIP_STONE_GROTTO_3_GRASS_05, true),
            CHECK(RC_ENEMY_DROP_GIANT_BEE, CAN_USE_PROJECTILE && CanKillEnemy(ACTOR_EN_BEE)), // In a beehive
        },
        .exits = { //     TO                                         FROM
            EXIT(ENTRANCE(TERMINA_FIELD, 0),                ENTRANCE(GROTTOS, 0), true),
        },
        .events = {
            // TODO: gSaveContext.save.saveInfo.unk_EA0 for gossip stone check
        },
    };
    Regions[RR_TERMINA_FIELD_GOSSIP_STONE_GROTTO_4] = RandoRegion{ .name = "Termina Field Gossip Stone #4", .sceneId = SCENE_KAKUSIANA,
        .checks = {
            CHECK(RC_TERMINA_FIELD_GOSSIP_STONE_GROTTO_4_GRASS_01, true),
            CHECK(RC_TERMINA_FIELD_GOSSIP_STONE_GROTTO_4_GRASS_02, true),
            CHECK(RC_TERMINA_FIELD_GOSSIP_STONE_GROTTO_4_GRASS_03, true),
            CHECK(RC_TERMINA_FIELD_GOSSIP_STONE_GROTTO_4_GRASS_04, true),
            CHECK(RC_TERMINA_FIELD_GOSSIP_STONE_GROTTO_4_GRASS_05, true),
        },
        .exits = { //     TO                                         FROM
            EXIT(ENTRANCE(TERMINA_FIELD, 0),                ENTRANCE(GROTTOS, 2), true),
        },
        .events = {
            // TODO: gSaveContext.save.saveInfo.unk_EA0 for gossip stone check
        },
    };
    Regions[RR_TERMINA_FIELD_PEAHAT_GROTTO] = RandoRegion{ .name = "Termina Field Peahat", .sceneId = SCENE_KAKUSIANA,
        .checks = {
            CHECK(RC_TERMINA_FIELD_PEAHAT_GROTTO_CHEST, CanKillEnemy(ACTOR_EN_PEEHAT)),
            CHECK(RC_TERMINA_FIELD_PEAHAT_GROTTO_GRASS_01, true),
            CHECK(RC_TERMINA_FIELD_PEAHAT_GROTTO_GRASS_02, true),
            CHECK(RC_TERMINA_FIELD_PEAHAT_GROTTO_GRASS_03, true),
            CHECK(RC_TERMINA_FIELD_PEAHAT_GROTTO_GRASS_04, true),
            CHECK(RC_TERMINA_FIELD_PEAHAT_GROTTO_GRASS_05, true),
            CHECK(RC_TERMINA_FIELD_PEAHAT_GROTTO_GRASS_06, true),
            CHECK(RC_TERMINA_FIELD_PEAHAT_GROTTO_GRASS_07, true),
            CHECK(RC_TERMINA_FIELD_PEAHAT_GROTTO_GRASS_08, true),
            CHECK(RC_TERMINA_FIELD_PEAHAT_GROTTO_GRASS_09, true),
            CHECK(RC_TERMINA_FIELD_PEAHAT_GROTTO_GRASS_10, true),
            CHECK(RC_TERMINA_FIELD_PEAHAT_GROTTO_GRASS_11, true),
            CHECK(RC_TERMINA_FIELD_PEAHAT_GROTTO_GRASS_12, true),
            CHECK(RC_ENEMY_DROP_PEAHAT, CanKillEnemy(ACTOR_EN_PEEHAT)),
        },
        .exits = { //     TO                                         FROM
            EXIT(ENTRANCE(TERMINA_FIELD, 0),                ENTRANCE(GROTTOS, 13), true),
        },
    };
    Regions[RR_TERMINA_FIELD_PILLAR_GROTTO] = RandoRegion{ .name = "Termina Field Pillar", .sceneId = SCENE_KAKUSIANA,
        .checks = {
            CHECK(RC_TERMINA_FIELD_PILLAR_GROTTO_CHEST, true),
            CHECK(RC_TERMINA_FIELD_PILLAR_GROTTO_GRASS_01, true),
            CHECK(RC_TERMINA_FIELD_PILLAR_GROTTO_GRASS_02, true),
            CHECK(RC_TERMINA_FIELD_PILLAR_GROTTO_GRASS_03, true),
            CHECK(RC_TERMINA_FIELD_PILLAR_GROTTO_GRASS_04, true),
            CHECK(RC_TERMINA_FIELD_PILLAR_GROTTO_GRASS_05, true),
            CHECK(RC_TERMINA_FIELD_PILLAR_GROTTO_GRASS_06, true),
            CHECK(RC_TERMINA_FIELD_PILLAR_GROTTO_GRASS_07, true),
            CHECK(RC_TERMINA_FIELD_PILLAR_GROTTO_GRASS_08, true),
            CHECK(RC_TERMINA_FIELD_PILLAR_GROTTO_GRASS_09, true),
            CHECK(RC_TERMINA_FIELD_PILLAR_GROTTO_GRASS_10, true),
            CHECK(RC_TERMINA_FIELD_PILLAR_GROTTO_GRASS_11, true),
            CHECK(RC_TERMINA_FIELD_PILLAR_GROTTO_GRASS_12, true),
            CHECK(RC_TERMINA_FIELD_PILLAR_GROTTO_GRASS_13, true),
            CHECK(RC_TERMINA_FIELD_PILLAR_GROTTO_GRASS_14, true),
            CHECK(RC_ENEMY_DROP_MINI_BABA, CanKillEnemy(ACTOR_EN_KAREBABA)),
        },
        .exits = { //     TO                                         FROM
            EXIT(ENTRANCE(TERMINA_FIELD, 0),                ENTRANCE(GROTTOS, 18), true),
        },
    };
    Regions[RR_TERMINA_FIELD_SCRUB_GROTTO] = RandoRegion{ .name = "Termina Field Scrub", .sceneId = SCENE_KAKUSIANA,
        .checks = {
            CHECK(RC_TERMINA_FIELD_GROTTO_SCRUB, CUR_UPG_VALUE(UPG_WALLET) >= 1 && RANDO_EVENTS[RE_TERMINA_FIELD_SCRUB_ENTERED_GROTTO]),
            CHECK(RC_TERMINA_FIELD_SCRUB_LARGE_CRATE, true),
            CHECK(RC_TERMINA_FIELD_SCRUB_POT,         true),
        },
        .exits = { //     TO                                         FROM
            EXIT(ENTRANCE(TERMINA_FIELD, 0),                ENTRANCE(GROTTOS, 9), true),
        },
    };
    Regions[RR_TERMINA_FIELD_TALL_GRASS_GROTTO] = RandoRegion{ .name = "Termina Field Tall Grass", .sceneId = SCENE_KAKUSIANA,
        .checks = {
            CHECK(RC_TERMINA_FIELD_TALL_GRASS_GROTTO_CHEST, true),
            CHECK(RC_TERMINA_FIELD_TALL_GRASS_GROTTO_GRASS_01, true),
            CHECK(RC_TERMINA_FIELD_TALL_GRASS_GROTTO_GRASS_02, true),
            CHECK(RC_TERMINA_FIELD_TALL_GRASS_GROTTO_GRASS_03, true),
            CHECK(RC_TERMINA_FIELD_TALL_GRASS_GROTTO_GRASS_04, true),
            CHECK(RC_TERMINA_FIELD_TALL_GRASS_GROTTO_GRASS_05, true),
            CHECK(RC_TERMINA_FIELD_TALL_GRASS_GROTTO_GRASS_06, true),
            CHECK(RC_TERMINA_FIELD_TALL_GRASS_GROTTO_GRASS_07, true),
            CHECK(RC_TERMINA_FIELD_TALL_GRASS_GROTTO_GRASS_08, true),
            CHECK(RC_TERMINA_FIELD_TALL_GRASS_GROTTO_GRASS_09, true),
            CHECK(RC_TERMINA_FIELD_TALL_GRASS_GROTTO_GRASS_10, true),
            CHECK(RC_TERMINA_FIELD_TALL_GRASS_GROTTO_GRASS_11, true),
            CHECK(RC_TERMINA_FIELD_TALL_GRASS_GROTTO_GRASS_12, true),
            CHECK(RC_TERMINA_FIELD_TALL_GRASS_GROTTO_GRASS_13, true),
            CHECK(RC_TERMINA_FIELD_TALL_GRASS_GROTTO_GRASS_14, true),
            CHECK(RC_ENEMY_DROP_MINI_BABA, CanKillEnemy(ACTOR_EN_KAREBABA)),
        },
        .exits = { //     TO                                         FROM
            EXIT(ENTRANCE(TERMINA_FIELD, 0),                ENTRANCE(GROTTOS, 19), true),
        },
    };
    Regions[RR_TERMINA_FIELD] = RandoRegion{ .sceneId = SCENE_00KEIKOKU,
        .checks = {
            CHECK(RC_TERMINA_FIELD_KAMARO_MASK, CAN_PLAY_SONG(HEALING) && MIDNIGHT()),
            CHECK(RC_TERMINA_FIELD_POT, CAN_GROW_BEAN_PLANT),
            CHECK(RC_TERMINA_FIELD_TALL_GRASS_CHEST, true),
            CHECK(RC_TERMINA_FIELD_TREE_STUMP_CHEST, CAN_GROW_BEAN_PLANT || HAS_ITEM(ITEM_HOOKSHOT)),
            CHECK(RC_TERMINA_FIELD_WATER_CHEST, CAN_BE_ZORA && CAN_USE_ABILITY(SWIM)),
            CHECK(RC_TERMINA_FIELD_FREESTANDING_RUPEE_01, true), // TODO: Fix duplicate item get...
            CHECK(RC_TERMINA_FIELD_GUAY_RUPEE_DROP_01, CAN_PLAY_SONG(SONATA) || CAN_PLAY_SONG(LULLABY) || CAN_PLAY_SONG(BOSSA_NOVA)),
            CHECK(RC_TERMINA_FIELD_GUAY_RUPEE_DROP_02, CAN_PLAY_SONG(SONATA) || CAN_PLAY_SONG(LULLABY) || CAN_PLAY_SONG(BOSSA_NOVA)),
            CHECK(RC_TERMINA_FIELD_GUAY_RUPEE_DROP_03, CAN_PLAY_SONG(SONATA) || CAN_PLAY_SONG(LULLABY) || CAN_PLAY_SONG(BOSSA_NOVA)),
            CHECK(RC_TERMINA_FIELD_GUAY_RUPEE_DROP_04, CAN_PLAY_SONG(SONATA) || CAN_PLAY_SONG(LULLABY) || CAN_PLAY_SONG(BOSSA_NOVA)),
            CHECK(RC_TERMINA_FIELD_GUAY_RUPEE_DROP_05, CAN_PLAY_SONG(SONATA) || CAN_PLAY_SONG(LULLABY) || CAN_PLAY_SONG(BOSSA_NOVA)),
            CHECK(RC_TERMINA_FIELD_GUAY_RUPEE_DROP_06, CAN_PLAY_SONG(SONATA) || CAN_PLAY_SONG(LULLABY) || CAN_PLAY_SONG(BOSSA_NOVA)),
            CHECK(RC_TERMINA_FIELD_GUAY_RUPEE_DROP_07, CAN_PLAY_SONG(SONATA) || CAN_PLAY_SONG(LULLABY) || CAN_PLAY_SONG(BOSSA_NOVA)),
            CHECK(RC_TERMINA_FIELD_GUAY_RUPEE_DROP_08, CAN_PLAY_SONG(SONATA) || CAN_PLAY_SONG(LULLABY) || CAN_PLAY_SONG(BOSSA_NOVA)),
            CHECK(RC_TERMINA_FIELD_GUAY_RUPEE_DROP_09, CAN_PLAY_SONG(SONATA) || CAN_PLAY_SONG(LULLABY) || CAN_PLAY_SONG(BOSSA_NOVA)),
            CHECK(RC_TERMINA_FIELD_GUAY_RUPEE_DROP_10, CAN_PLAY_SONG(SONATA) || CAN_PLAY_SONG(LULLABY) || CAN_PLAY_SONG(BOSSA_NOVA)),
            CHECK(RC_TERMINA_FIELD_GUAY_RUPEE_DROP_11, CAN_PLAY_SONG(SONATA) || CAN_PLAY_SONG(LULLABY) || CAN_PLAY_SONG(BOSSA_NOVA)),
            CHECK(RC_TERMINA_FIELD_GUAY_RUPEE_DROP_12, CAN_PLAY_SONG(SONATA) || CAN_PLAY_SONG(LULLABY) || CAN_PLAY_SONG(BOSSA_NOVA)),
            CHECK(RC_TERMINA_FIELD_GUAY_RUPEE_DROP_13, CAN_PLAY_SONG(SONATA) || CAN_PLAY_SONG(LULLABY) || CAN_PLAY_SONG(BOSSA_NOVA)),
            CHECK(RC_TERMINA_FIELD_GUAY_RUPEE_DROP_14, CAN_PLAY_SONG(SONATA) || CAN_PLAY_SONG(LULLABY) || CAN_PLAY_SONG(BOSSA_NOVA)),
            CHECK(RC_TERMINA_FIELD_GUAY_RUPEE_DROP_15, CAN_PLAY_SONG(SONATA) || CAN_PLAY_SONG(LULLABY) || CAN_PLAY_SONG(BOSSA_NOVA)),
            CHECK(RC_TERMINA_FIELD_GUAY_RUPEE_DROP_16, CAN_PLAY_SONG(SONATA) || CAN_PLAY_SONG(LULLABY) || CAN_PLAY_SONG(BOSSA_NOVA)),
            CHECK(RC_TERMINA_FIELD_GUAY_RUPEE_DROP_17, CAN_PLAY_SONG(SONATA) || CAN_PLAY_SONG(LULLABY) || CAN_PLAY_SONG(BOSSA_NOVA)),
            CHECK(RC_TERMINA_FIELD_GUAY_RUPEE_DROP_18, CAN_PLAY_SONG(SONATA) || CAN_PLAY_SONG(LULLABY) || CAN_PLAY_SONG(BOSSA_NOVA)),
            CHECK(RC_TERMINA_FIELD_GUAY_RUPEE_DROP_19, CAN_PLAY_SONG(SONATA) || CAN_PLAY_SONG(LULLABY) || CAN_PLAY_SONG(BOSSA_NOVA)),
            CHECK(RC_TERMINA_FIELD_GUAY_RUPEE_DROP_20, CAN_PLAY_SONG(SONATA) || CAN_PLAY_SONG(LULLABY) || CAN_PLAY_SONG(BOSSA_NOVA)),
            CHECK(RC_TERMINA_FIELD_GRASS_01, true),
            CHECK(RC_TERMINA_FIELD_GRASS_02, true),
            CHECK(RC_TERMINA_FIELD_GRASS_03, true),
            CHECK(RC_TERMINA_FIELD_GRASS_04, true),
            CHECK(RC_TERMINA_FIELD_GRASS_05, true),
            CHECK(RC_TERMINA_FIELD_GRASS_06, true),
            CHECK(RC_TERMINA_FIELD_GRASS_07, true),
            CHECK(RC_TERMINA_FIELD_GRASS_08, true),
            CHECK(RC_TERMINA_FIELD_GRASS_09, true),
            CHECK(RC_TERMINA_FIELD_GRASS_10, true),
            CHECK(RC_TERMINA_FIELD_GRASS_11, true),
            CHECK(RC_TERMINA_FIELD_GRASS_12, true),
            CHECK(RC_TERMINA_FIELD_GRASS_13, true),
            CHECK(RC_TERMINA_FIELD_GRASS_14, true),
            CHECK(RC_TERMINA_FIELD_GRASS_15, true),
            CHECK(RC_TERMINA_FIELD_GRASS_16, true),
            CHECK(RC_TERMINA_FIELD_GRASS_17, true),
            CHECK(RC_TERMINA_FIELD_GRASS_18, true),
            CHECK(RC_TERMINA_FIELD_GRASS_19, true),
            CHECK(RC_TERMINA_FIELD_GRASS_20, true),
            CHECK(RC_TERMINA_FIELD_GRASS_21, true),
            CHECK(RC_TERMINA_FIELD_GRASS_22, true),
            CHECK(RC_TERMINA_FIELD_GRASS_23, true),
            CHECK(RC_TERMINA_FIELD_GRASS_24, true),
            CHECK(RC_TERMINA_FIELD_GRASS_25, true),
            CHECK(RC_TERMINA_FIELD_GRASS_26, true),
            CHECK(RC_TERMINA_FIELD_GRASS_27, true),
            CHECK(RC_TERMINA_FIELD_GRASS_28, true),
            CHECK(RC_TERMINA_FIELD_GRASS_29, true),
            CHECK(RC_TERMINA_FIELD_GRASS_30, true),
            CHECK(RC_TERMINA_FIELD_GRASS_31, true),
            CHECK(RC_TERMINA_FIELD_GRASS_32, true),
            CHECK(RC_TERMINA_FIELD_GRASS_33, true),
            CHECK(RC_TERMINA_FIELD_GRASS_34, true),
            CHECK(RC_TERMINA_FIELD_GRASS_35, true),
            CHECK(RC_TERMINA_FIELD_GRASS_36, true),
            CHECK(RC_TERMINA_FIELD_GRASS_37, true),
            CHECK(RC_TERMINA_FIELD_GRASS_38, true),
            CHECK(RC_TERMINA_FIELD_GRASS_39, true),
            CHECK(RC_TERMINA_FIELD_GRASS_40, true),
            CHECK(RC_TERMINA_FIELD_GRASS_41, true),
            CHECK(RC_TERMINA_FIELD_GRASS_42, true),
            CHECK(RC_TERMINA_FIELD_GRASS_43, true),
            CHECK(RC_TERMINA_FIELD_GRASS_44, true),
            CHECK(RC_TERMINA_FIELD_GRASS_45, true),
            CHECK(RC_TERMINA_FIELD_GRASS_46, true),
            CHECK(RC_TERMINA_FIELD_GRASS_47, true),
            CHECK(RC_TERMINA_FIELD_GRASS_48, true),
            CHECK(RC_TERMINA_FIELD_GRASS_49, true),
            CHECK(RC_TERMINA_FIELD_GRASS_50, true),
            CHECK(RC_TERMINA_FIELD_GRASS_51, true),
            CHECK(RC_TERMINA_FIELD_GRASS_52, true),
            CHECK(RC_TERMINA_FIELD_GRASS_53, true),
            CHECK(RC_TERMINA_FIELD_GRASS_54, true),
            CHECK(RC_TERMINA_FIELD_GRASS_55, true),
            CHECK(RC_TERMINA_FIELD_GRASS_56, true),
            CHECK(RC_TERMINA_FIELD_GRASS_57, true),
            CHECK(RC_TERMINA_FIELD_GRASS_58, true),
            CHECK(RC_TERMINA_FIELD_GRASS_59, true),
            CHECK(RC_TERMINA_FIELD_GRASS_60, true),
            CHECK(RC_TERMINA_FIELD_GRASS_61, true),
            CHECK(RC_TERMINA_FIELD_GRASS_62, true),
            CHECK(RC_TERMINA_FIELD_GRASS_63, true),
            CHECK(RC_TERMINA_FIELD_GRASS_64, true),
            CHECK(RC_TERMINA_FIELD_GRASS_65, true),
            CHECK(RC_TERMINA_FIELD_GRASS_66, true),
            CHECK(RC_TERMINA_FIELD_GRASS_67, true),
            CHECK(RC_TERMINA_FIELD_GRASS_68, true),
            CHECK(RC_TERMINA_FIELD_GRASS_69, true),
            CHECK(RC_TERMINA_FIELD_GRASS_70, true),
            CHECK(RC_TERMINA_FIELD_GRASS_71, true),
            CHECK(RC_TERMINA_FIELD_GRASS_72, true),
            CHECK(RC_TERMINA_FIELD_GRASS_73, true),
            CHECK(RC_TERMINA_FIELD_GRASS_74, true),
            CHECK(RC_TERMINA_FIELD_GRASS_75, true),
            CHECK(RC_TERMINA_FIELD_GRASS_76, true),
            CHECK(RC_TERMINA_FIELD_GRASS_77, true),
            CHECK(RC_TERMINA_FIELD_GRASS_78, true),
            CHECK(RC_TERMINA_FIELD_GRASS_79, true),
            CHECK(RC_TERMINA_FIELD_GRASS_80, true),
            CHECK(RC_TERMINA_FIELD_GRASS_81, true),
            CHECK(RC_TERMINA_FIELD_GRASS_82, true),
            CHECK(RC_TERMINA_FIELD_GRASS_83, true),
            CHECK(RC_TERMINA_FIELD_GRASS_84, true),
            CHECK(RC_TERMINA_FIELD_GRASS_85, true),
            CHECK(RC_TERMINA_FIELD_GRASS_86, true),
            CHECK(RC_TERMINA_FIELD_GRASS_87, true),
            CHECK(RC_TERMINA_FIELD_GRASS_88, true),
            CHECK(RC_TERMINA_FIELD_GRASS_89, true),
            CHECK(RC_TERMINA_FIELD_GRASS_90, true),
            CHECK(RC_TERMINA_FIELD_GRASS_91, true),
            CHECK(RC_TERMINA_FIELD_GRASS_92, true),
            CHECK(RC_TERMINA_FIELD_GRASS_93, true),
            CHECK(RC_TERMINA_FIELD_GRASS_94, true),
            CHECK(RC_TERMINA_FIELD_GRASS_95, true),
            CHECK(RC_TERMINA_FIELD_GRASS_96, true),
            CHECK(RC_TERMINA_FIELD_GRASS_97, true),
            CHECK(RC_TERMINA_FIELD_GRASS_98, true),
            CHECK(RC_TERMINA_FIELD_GRASS_99, true),
            CHECK(RC_TERMINA_FIELD_GRASS_100, true),
            CHECK(RC_TERMINA_FIELD_GRASS_101, true),
            CHECK(RC_TERMINA_FIELD_GRASS_102, true),
            CHECK(RC_TERMINA_FIELD_GRASS_103, true),
            CHECK(RC_TERMINA_FIELD_GRASS_104, true),
            CHECK(RC_TERMINA_FIELD_GRASS_105, true),
            CHECK(RC_TERMINA_FIELD_GRASS_106, true),
            CHECK(RC_TERMINA_FIELD_GRASS_107, true),
            CHECK(RC_TERMINA_FIELD_GRASS_108, true),
            CHECK(RC_TERMINA_FIELD_GRASS_109, true),
            CHECK(RC_TERMINA_FIELD_GRASS_110, true),
            CHECK(RC_TERMINA_FIELD_GRASS_111, true),
            CHECK(RC_TERMINA_FIELD_GRASS_112, true),
            CHECK(RC_TERMINA_FIELD_GRASS_113, true),
            CHECK(RC_TERMINA_FIELD_GRASS_114, true),
            CHECK(RC_TERMINA_FIELD_GRASS_115, true),
            CHECK(RC_TERMINA_FIELD_GRASS_116, true),
            CHECK(RC_TERMINA_FIELD_GRASS_117, true),
            CHECK(RC_TERMINA_FIELD_GRASS_118, true),
            CHECK(RC_TERMINA_FIELD_GRASS_119, true),
            CHECK(RC_TERMINA_FIELD_GRASS_120, true),
            CHECK(RC_TERMINA_FIELD_GRASS_121, true),
            CHECK(RC_TERMINA_FIELD_GRASS_122, true),
            CHECK(RC_TERMINA_FIELD_GRASS_123, true),
            CHECK(RC_TERMINA_FIELD_GRASS_124, true),
            CHECK(RC_TERMINA_FIELD_GRASS_125, true),
            CHECK(RC_TERMINA_FIELD_GRASS_126, true),
            CHECK(RC_TERMINA_FIELD_GRASS_127, true),
            CHECK(RC_TERMINA_FIELD_GRASS_128, true),
            CHECK(RC_TERMINA_FIELD_GRASS_129, true),
            CHECK(RC_TERMINA_FIELD_GRASS_130, true),
            CHECK(RC_TERMINA_FIELD_GRASS_131, true),
            CHECK(RC_TERMINA_FIELD_GRASS_132, true),
            CHECK(RC_TERMINA_FIELD_GRASS_133, true),
            CHECK(RC_TERMINA_FIELD_GRASS_134, true),
            CHECK(RC_TERMINA_FIELD_GRASS_135, true),
            CHECK(RC_TERMINA_FIELD_GRASS_136, true),
            CHECK(RC_TERMINA_FIELD_GRASS_137, true),
            CHECK(RC_TERMINA_FIELD_GRASS_138, true),
            CHECK(RC_TERMINA_FIELD_GRASS_139, true),
            CHECK(RC_TERMINA_FIELD_GRASS_140, true),
            CHECK(RC_TERMINA_FIELD_GRASS_141, true),
            CHECK(RC_TERMINA_FIELD_GRASS_142, true),
            CHECK(RC_TERMINA_FIELD_GRASS_143, true),
            CHECK(RC_TERMINA_FIELD_GRASS_144, true),
            CHECK(RC_TERMINA_FIELD_GRASS_145, true),
            CHECK(RC_TERMINA_FIELD_GRASS_146, true),
            CHECK(RC_TERMINA_FIELD_GRASS_147, true),
            CHECK(RC_TERMINA_FIELD_GRASS_148, true),
            CHECK(RC_TERMINA_FIELD_GRASS_149, true),
            CHECK(RC_TERMINA_FIELD_GRASS_150, true),
            CHECK(RC_TERMINA_FIELD_GRASS_151, true),
            CHECK(RC_TERMINA_FIELD_GRASS_152, true),
            CHECK(RC_TERMINA_FIELD_GRASS_153, true),
            CHECK(RC_TERMINA_FIELD_GRASS_154, true),
            CHECK(RC_TERMINA_FIELD_GRASS_155, true),
            CHECK(RC_TERMINA_FIELD_GRASS_156, true),
            CHECK(RC_TERMINA_FIELD_GRASS_157, true),
            CHECK(RC_TERMINA_FIELD_GRASS_158, true),
            CHECK(RC_TERMINA_FIELD_GRASS_159, true),
            CHECK(RC_TERMINA_FIELD_GRASS_160, true),
            CHECK(RC_TERMINA_FIELD_GRASS_161, true),
            CHECK(RC_TERMINA_FIELD_GRASS_162, true),
            CHECK(RC_TERMINA_FIELD_GRASS_163, true),
            CHECK(RC_TERMINA_FIELD_GRASS_164, true),
            CHECK(RC_TERMINA_FIELD_GRASS_165, true),
            CHECK(RC_TERMINA_FIELD_GRASS_166, true),
            CHECK(RC_TERMINA_FIELD_GRASS_167, true),
            CHECK(RC_TERMINA_FIELD_GRASS_168, true),
            CHECK(RC_TERMINA_FIELD_GRASS_169, true),
            CHECK(RC_TERMINA_FIELD_GRASS_170, true),
            CHECK(RC_TERMINA_FIELD_GRASS_171, true),
            CHECK(RC_TERMINA_FIELD_GRASS_172, true),
            CHECK(RC_TERMINA_FIELD_GRASS_173, true),
            CHECK(RC_TERMINA_FIELD_GRASS_174, true),
            CHECK(RC_TERMINA_FIELD_GRASS_175, true),
            CHECK(RC_TERMINA_FIELD_GRASS_176, true),
            CHECK(RC_TERMINA_FIELD_GRASS_177, true),
            CHECK(RC_TERMINA_FIELD_GRASS_178, true),
            CHECK(RC_TERMINA_FIELD_GRASS_179, true),
            CHECK(RC_TERMINA_FIELD_GRASS_180, true),
            CHECK(RC_TERMINA_FIELD_GRASS_181, true),
            CHECK(RC_TERMINA_FIELD_GRASS_182, true),
            CHECK(RC_TERMINA_FIELD_GRASS_183, true),
            CHECK(RC_TERMINA_FIELD_GRASS_184, true),
            CHECK(RC_TERMINA_FIELD_GRASS_185, true),
            CHECK(RC_TERMINA_FIELD_GRASS_186, true),
            CHECK(RC_TERMINA_FIELD_GRASS_187, true),
            CHECK(RC_TERMINA_FIELD_GRASS_188, true),
            CHECK(RC_TERMINA_FIELD_GRASS_189, true),
            CHECK(RC_TERMINA_FIELD_GRASS_190, true),
            CHECK(RC_TERMINA_FIELD_GRASS_191, true),
            CHECK(RC_TERMINA_FIELD_GRASS_192, true),
            CHECK(RC_TERMINA_FIELD_GRASS_193, true),
            CHECK(RC_TERMINA_FIELD_GRASS_194, true),
            CHECK(RC_TERMINA_FIELD_GRASS_195, true),
            CHECK(RC_TERMINA_FIELD_GRASS_196, true),
            CHECK(RC_TERMINA_FIELD_GRASS_197, true),
            CHECK(RC_TERMINA_FIELD_GRASS_198, true),
            CHECK(RC_TERMINA_FIELD_GRASS_199, true),
            CHECK(RC_TERMINA_FIELD_GRASS_200, true),
            CHECK(RC_TERMINA_FIELD_GRASS_201, true),
            CHECK(RC_TERMINA_FIELD_GRASS_202, true),
            CHECK(RC_TERMINA_FIELD_GRASS_203, true),
            CHECK(RC_TERMINA_FIELD_GRASS_204, true),
            CHECK(RC_TERMINA_FIELD_GRASS_205, true),
            CHECK(RC_TERMINA_FIELD_GRASS_206, true),
            CHECK(RC_TERMINA_FIELD_GRASS_207, true),
            CHECK(RC_TERMINA_FIELD_GRASS_208, true),
            CHECK(RC_TERMINA_FIELD_GRASS_209, true),
            CHECK(RC_TERMINA_FIELD_GRASS_210, true),
            CHECK(RC_TERMINA_FIELD_GRASS_211, true),
            CHECK(RC_TERMINA_FIELD_GRASS_212, true),
            CHECK(RC_TERMINA_FIELD_GRASS_213, true),
            CHECK(RC_TERMINA_FIELD_GRASS_214, true),
            CHECK(RC_TERMINA_FIELD_GRASS_215, true),
            CHECK(RC_TERMINA_FIELD_GRASS_216, true),
            CHECK(RC_TERMINA_FIELD_MAN_IN_THE_TREE_RUPEE_01, true),
            CHECK(RC_TERMINA_FIELD_MAN_IN_THE_TREE_RUPEE_02, true),
            CHECK(RC_TERMINA_FIELD_TREE_01, true),
            CHECK(RC_TERMINA_FIELD_TREE_02, true),
            CHECK(RC_ENEMY_DROP_BLUE_BUBBLE, CanKillEnemy(ACTOR_EN_BB) && IS_NIGHT()), // Night only
            CHECK(RC_ENEMY_DROP_DEKU_BABA, CanKillEnemy(ACTOR_EN_DEKUBABA)),
            CHECK(RC_ENEMY_DROP_CHUCHU, CanKillEnemy(ACTOR_EN_SLIME) && IS_DAY()), // Day only
            CHECK(RC_ENEMY_DROP_REAL_BOMBCHU, CanKillEnemy(ACTOR_EN_RAT) && IS_DAY()), // Day only
            CHECK(RC_ENEMY_DROP_LEEVER, CanKillEnemy(ACTOR_EN_NEO_REEBA)),
            CHECK(RC_ENEMY_DROP_DODONGO, CanKillEnemy(ACTOR_EN_DODONGO) && IS_DAY()), // Day only
            CHECK(RC_ENEMY_DROP_EENO, CanKillEnemy(ACTOR_EN_SNOWMAN) && IS_NIGHT()), // Night only
            CHECK(RC_ENEMY_DROP_BAD_BAT, CanKillEnemy(ACTOR_EN_BAT)),
            CHECK(RC_ENEMY_DROP_TAKKURI, CanKillEnemy(ACTOR_EN_THIEFBIRD)),
        },
        .exits = { //     TO                                         FROM
            EXIT(ENTRANCE(GROTTOS, 0),                      ENTRANCE(TERMINA_FIELD, 0), CAN_USE_EXPLOSIVE || CAN_BE_GORON), // Gossip Stone #3
            EXIT(ENTRANCE(GROTTOS, 1),                      ENTRANCE(TERMINA_FIELD, 0), true), // Gossip Stone #1
            EXIT(ENTRANCE(GROTTOS, 2),                      ENTRANCE(TERMINA_FIELD, 0), true), // Gossip Stone #4
            EXIT(ENTRANCE(GROTTOS, 3),                      ENTRANCE(TERMINA_FIELD, 0), true), // Gossip Stone #2
            EXIT(ENTRANCE(GROTTOS, 7),                      ENTRANCE(TERMINA_FIELD, 0), true), // Dodongo
            EXIT(ENTRANCE(GROTTOS, 9),                      ENTRANCE(TERMINA_FIELD, 0), true), // Scrub
            EXIT(ENTRANCE(GROTTOS, 11),                     ENTRANCE(TERMINA_FIELD, 0), CAN_USE_EXPLOSIVE || CAN_BE_GORON), // bio baba grotto
            EXIT(ENTRANCE(GROTTOS, 13),                     ENTRANCE(TERMINA_FIELD, 0), true), // peahat grotto
            EXIT(ENTRANCE(GROTTOS, 17),                     ENTRANCE(TERMINA_FIELD, 0), CAN_USE_EXPLOSIVE), // Cow grotto
            EXIT(ENTRANCE(GROTTOS, 18),                     ENTRANCE(TERMINA_FIELD, 0), true), // Pillar grotto
            EXIT(ENTRANCE(GROTTOS, 19),                     ENTRANCE(TERMINA_FIELD, 0), true), // Tall Grass grotto
            EXIT(ENTRANCE(WEST_CLOCK_TOWN, 0),              ENTRANCE(TERMINA_FIELD, 0), true),
            EXIT(ENTRANCE(ROAD_TO_SOUTHERN_SWAMP, 0),       ENTRANCE(TERMINA_FIELD, 1), true),
            EXIT(ENTRANCE(ROAD_TO_IKANA, 0),                ENTRANCE(TERMINA_FIELD, 4), true),
            EXIT(ENTRANCE(MILK_ROAD, 0),                    ENTRANCE(TERMINA_FIELD, 5), true),
            EXIT(ENTRANCE(SOUTH_CLOCK_TOWN, 1),             ENTRANCE(TERMINA_FIELD, 6), true),
            EXIT(ENTRANCE(EAST_CLOCK_TOWN, 0),              ENTRANCE(TERMINA_FIELD, 7), true),
            EXIT(ENTRANCE(NORTH_CLOCK_TOWN, 0),             ENTRANCE(TERMINA_FIELD, 8), true),
        },
        .connections = {
            CONNECTION(RR_TERMINA_FIELD_BEFORE_PATH_TO_MOUNTAIN_VILLAGE, HAS_ITEM(ITEM_BOW)),
            CONNECTION(RR_TERMINA_FIELD_BEFORE_GREAT_BAY_COAST, CAN_PLAY_SONG(EPONA)),
            CONNECTION(RR_ASTRAL_OBSERVATORY_OUTSIDE, CAN_BE_DEKU),
        },
    };
}, {});
// clang-format on
