//flaglever.txt - Lever which, when pulled, flips a flag from 0 to 1 and back. No locks
// or other trickery.
//Cell 0,1 - The sdf which is set to 1 or 0 when lever is pulled.
// Cell 2 - skill needed, if 0 none
// Cell 3 - If 1, can't flip back
beginobjectscript; 

variables;

short range = 0;

body;

beginstate INIT_STATE;

	break;

beginstate DEAD_STATE;

break;

beginstate START_STATE; // door closed, waiting
break;

beginstate USE_STATE;

	print_str("Pull Lever: You pull the lever.");
	play_sound(21);
	
	if (get_memory_cell(0) == 0) {
		sf(13,17,0);
		sf(13,18,0);
		sf(13,19,0);
		}
	
	if (get_memory_cell(0) == 1) {
		sf(13,19,1 - gf(13,19));

		}
	if (get_memory_cell(0) == 2) {
		sf(13,17,1 - gf(13,17));

		}
	if (get_memory_cell(0) == 3) {
		sf(13,17,1 - gf(13,17));
		sf(13,19,1 - gf(13,19));

		}
	
	if (get_memory_cell(0) == 4) {
		sf(13,17,1 - gf(13,17));
		sf(13,18,1 - gf(13,18));
		sf(13,19,1 - gf(13,19));

		}
	
break;
