// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
// Logic 108 : Advanced Dream World Map
//
//   After the Cauldron is shattered, VG gets to use this map to navigate the Dream World
//
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

#include "defines.txt"

if (new_room) {
    universe = 58;
    load.pic(universe);
    draw.pic(universe);
    discard.pic(universe);

    animate.obj(o1);
    load.view(131);
    set.view(o1,131);
    if (prev_room_no == 204) {
        position(o1,12,163);
        }
    if (prev_room_no == 40) {
        position(o1, 36, 122);
        }
    if (prev_room_no == 44) {
        position(o1, 63, 77);
        }
    if (prev_room_no == 64) {
        position(o1, 97, 144);
        }
    if (prev_room_no == 67) {
        position(o1, 126, 57);
        }
    draw(o1);

    show.pic();

}

display(1,1,m1);
get.posn(o1,temp_x,temp_y);

if (ego_dir == 3) {
    ego_dir = 0;
    if (temp_x == 12 &&
        temp_y == 163) {
            reposition.to(o1, 36, 122);
            force.update(o1);
            return();
            }

    if (temp_x == 36 &&
        temp_y == 122) {
            reposition.to(o1, 63, 77);
            force.update(o1);
            return();
            }

    if (temp_x == 63 &&
        temp_y == 77) {
            reposition.to(o1, 97, 144);
            force.update(o1);
            return();
            }

    if (temp_x == 97 &&
        temp_y == 144) {
            reposition.to(o1, 126, 57);
            force.update(o1);
            return();
            }
    }

if (ego_dir == 7) {
    ego_dir = 0;
    if (temp_x == 126 &&
        temp_y == 57) {
            reposition.to(o1, 97, 144);
            force.update(o1);
            return();
            }

    if (temp_x == 36 &&
        temp_y == 122) {
            reposition.to(o1, 12, 163);
            force.update(o1);
            return();
            }

    if (temp_x == 63 &&
        temp_y == 77) {
            reposition.to(o1, 36, 122);
            force.update(o1);
            return();
            }

    if (temp_x == 97 &&
        temp_y == 144) {
            reposition.to(o1, 63, 77);
            force.update(o1);
            return();
            }
    }

if (controller(left_click)) {
    if (temp_x == 12 &&
        temp_y == 163) {
           new.room(204);
           }

    if (temp_x == 36 &&
        temp_y == 122) {
            new.room(40);
            }

    if (temp_x == 63 &&
        temp_y == 77) {
            new.room(44);
            }

    if (temp_x == 97 &&
        temp_y == 144) {
            new.room(63);
            }

    if (temp_x == 126 &&
        temp_y == 57) {
            new.room(67);
            }

    }


return();

#message 1 "Press F10 to Enter Area"