//stairs.txt - Stairs. When used, switches the party to the other layer.

//Cell 0,1 - Coords in the new layer to place the party at. If these values 
//  are left at 0, places the party at the location of this object.
// Cell 2 - If 1, stairway is one way. Give a warning before they use it.
// Cell 3 - Direction to place party in
	// direction - 0,1 - north 2,3 - west 4,5 - south 6,7 - east

beginobjectscript; 

variables;

short got_warning = 0;

body;

beginstate INIT_STATE;
	break;

beginstate DEAD_STATE;
	break;

beginstate START_STATE; 
	break;

beginstate USE_STATE;
	if (is_combat()) {
		print_str_color("Climb: You can't change levels when in combat.",1);
		end();
		}
	if ((get_memory_cell(2) != 0) && (got_warning == 0)) {
		print_str_color("You suspect that this passage is one-way. If you proceed, you won't",2);
		print_str_color("  be able to return. (Click again to go through.)",2);
		got_warning = 1;
		end();
		}
		
	if (get_memory_cell(0) != 0)
		change_level(get_memory_cell(0),get_memory_cell(1),get_memory_cell(3));
		else change_level(my_loc_x(),my_loc_y(),get_memory_cell(3));
break;
