beginterrainscript;
variables;
short choice;
body;
beginstate INIT_STATE;
break;
beginstate START_STATE;
break;
beginstate SEARCH_STATE;
reset_dialog_preset_options(8);
choice = run_dialog(0);
if (choice == 1)
end();
flip_terrain(my_loc_x(),my_loc_y());
play_sound(99);
play_sound(79);
if ((get_memory_cell(0) > 0) || (get_memory_cell(1) > 0)){
if(get_memory_cell(6) == 0){
if ((get_memory_cell(2) > 0) || (get_memory_cell(3) > 0))
print_str_color("One beam projector rotates counterclockwise.",2);
else
print_str_color("The beam projector rotates counterclockwise.",2);
if(get_terrain(get_memory_cell(0), get_memory_cell(1)) == 380)
set_terrain(get_memory_cell(0), get_memory_cell(1), 381);
else if(get_terrain(get_memory_cell(0), get_memory_cell(1)) == 381)
set_terrain(get_memory_cell(0), get_memory_cell(1), 382);
else if(get_terrain(get_memory_cell(0), get_memory_cell(1)) == 382)
set_terrain(get_memory_cell(0), get_memory_cell(1), 383);
else if(get_terrain(get_memory_cell(0), get_memory_cell(1)) == 383)
set_terrain(get_memory_cell(0), get_memory_cell(1), 380);
}
else{
if ((get_memory_cell(2) > 0) || (get_memory_cell(3) > 0))
print_str_color("One beam projector rotates clockwise.",2);
else
print_str_color("The beam projector rotates clockwise.",2);
if(get_terrain(get_memory_cell(0), get_memory_cell(1)) == 381)
set_terrain(get_memory_cell(0), get_memory_cell(1), 380);
else if(get_terrain(get_memory_cell(0), get_memory_cell(1)) == 382)
set_terrain(get_memory_cell(0), get_memory_cell(1), 381);
else if(get_terrain(get_memory_cell(0), get_memory_cell(1)) == 383)
set_terrain(get_memory_cell(0), get_memory_cell(1), 382);
else if(get_terrain(get_memory_cell(0), get_memory_cell(1)) == 380)
set_terrain(get_memory_cell(0), get_memory_cell(1), 383);
}
}
if ((get_memory_cell(2) > 0) || (get_memory_cell(3) > 0)){
if(get_memory_cell(7) == 0){
if ((get_memory_cell(0) > 0) || (get_memory_cell(1) > 0))
print_str_color("The other beam projector rotates counterclockwise.",2);
else
print_str_color("The beam projector rotates counterclockwise.",2);
if(get_terrain(get_memory_cell(2), get_memory_cell(3)) == 380)
set_terrain(get_memory_cell(2), get_memory_cell(3), 381);
else if(get_terrain(get_memory_cell(2), get_memory_cell(3)) == 381)
set_terrain(get_memory_cell(2), get_memory_cell(3), 382);
else if(get_terrain(get_memory_cell(2), get_memory_cell(3)) == 382)
set_terrain(get_memory_cell(2), get_memory_cell(3), 383);
else if(get_terrain(get_memory_cell(2), get_memory_cell(3)) == 383)
set_terrain(get_memory_cell(2), get_memory_cell(3), 380);
}
else{
if ((get_memory_cell(0) > 0) || (get_memory_cell(1) > 0))
print_str_color("The other beam projector rotates clockwise.",2);
else
print_str_color("The beam projector rotates clockwise.",2);
if(get_terrain(get_memory_cell(2), get_memory_cell(3)) == 381)
set_terrain(get_memory_cell(2), get_memory_cell(3), 380);
else if(get_terrain(get_memory_cell(2), get_memory_cell(3)) == 382)
set_terrain(get_memory_cell(2), get_memory_cell(3), 381);
else if(get_terrain(get_memory_cell(2), get_memory_cell(3)) == 383)
set_terrain(get_memory_cell(2), get_memory_cell(3), 382);
else if(get_terrain(get_memory_cell(2), get_memory_cell(3)) == 380)
set_terrain(get_memory_cell(2), get_memory_cell(3), 383);
}
}
if ((get_memory_cell(4) > 0) || (get_memory_cell(5) > 0)) {
if (get_flag(get_memory_cell(4),get_memory_cell(5)) == 0)
set_flag(get_memory_cell(4),get_memory_cell(5),1);
else
set_flag(get_memory_cell(4),get_memory_cell(5),0);
}
break;
beginstate BLOCK_MOVE_STATE;
reset_dialog_preset_options(8);
choice = run_dialog(0);
if (choice == 1)
end();
flip_terrain(my_loc_x(),my_loc_y());
play_sound(99);
play_sound(79);
if ((get_memory_cell(0) > 0) || (get_memory_cell(1) > 0)){
if(get_memory_cell(6) == 0){
if ((get_memory_cell(2) > 0) || (get_memory_cell(3) > 0))
print_str_color("One beam projector rotates counterclockwise.",2);
else
print_str_color("The beam projector rotates counterclockwise.",2);
if(get_terrain(get_memory_cell(0), get_memory_cell(1)) == 380)
set_terrain(get_memory_cell(0), get_memory_cell(1), 381);
else if(get_terrain(get_memory_cell(0), get_memory_cell(1)) == 381)
set_terrain(get_memory_cell(0), get_memory_cell(1), 382);
else if(get_terrain(get_memory_cell(0), get_memory_cell(1)) == 382)
set_terrain(get_memory_cell(0), get_memory_cell(1), 383);
else if(get_terrain(get_memory_cell(0), get_memory_cell(1)) == 383)
set_terrain(get_memory_cell(0), get_memory_cell(1), 380);
}
else{
if ((get_memory_cell(2) > 0) || (get_memory_cell(3) > 0))
print_str_color("One beam projector rotates clockwise.",2);
else
print_str_color("The beam projector rotates clockwise.",2);
if(get_terrain(get_memory_cell(0), get_memory_cell(1)) == 381)
set_terrain(get_memory_cell(0), get_memory_cell(1), 380);
else if(get_terrain(get_memory_cell(0), get_memory_cell(1)) == 382)
set_terrain(get_memory_cell(0), get_memory_cell(1), 381);
else if(get_terrain(get_memory_cell(0), get_memory_cell(1)) == 383)
set_terrain(get_memory_cell(0), get_memory_cell(1), 382);
else if(get_terrain(get_memory_cell(0), get_memory_cell(1)) == 380)
set_terrain(get_memory_cell(0), get_memory_cell(1), 383);
}
}
if ((get_memory_cell(2) > 0) || (get_memory_cell(3) > 0)){
if(get_memory_cell(7) == 0){
if ((get_memory_cell(0) > 0) || (get_memory_cell(1) > 0))
print_str_color("The other beam projector rotates counterclockwise.",2);
else
print_str_color("The beam projector rotates counterclockwise.",2);
if(get_terrain(get_memory_cell(2), get_memory_cell(3)) == 380)
set_terrain(get_memory_cell(2), get_memory_cell(3), 381);
else if(get_terrain(get_memory_cell(2), get_memory_cell(3)) == 381)
set_terrain(get_memory_cell(2), get_memory_cell(3), 382);
else if(get_terrain(get_memory_cell(2), get_memory_cell(3)) == 382)
set_terrain(get_memory_cell(2), get_memory_cell(3), 383);
else if(get_terrain(get_memory_cell(2), get_memory_cell(3)) == 383)
set_terrain(get_memory_cell(2), get_memory_cell(3), 380);
}
else{
if ((get_memory_cell(0) > 0) || (get_memory_cell(1) > 0))
print_str_color("The other beam projector rotates clockwise.",2);
else
print_str_color("The beam projector rotates clockwise.",2);
if(get_terrain(get_memory_cell(2), get_memory_cell(3)) == 381)
set_terrain(get_memory_cell(2), get_memory_cell(3), 380);
else if(get_terrain(get_memory_cell(2), get_memory_cell(3)) == 382)
set_terrain(get_memory_cell(2), get_memory_cell(3), 381);
else if(get_terrain(get_memory_cell(2), get_memory_cell(3)) == 383)
set_terrain(get_memory_cell(2), get_memory_cell(3), 382);
else if(get_terrain(get_memory_cell(2), get_memory_cell(3)) == 380)
set_terrain(get_memory_cell(2), get_memory_cell(3), 383);
}
}
if ((get_memory_cell(4) > 0) || (get_memory_cell(5) > 0)) {
if (get_flag(get_memory_cell(4),get_memory_cell(5)) == 0)
set_flag(get_memory_cell(4),get_memory_cell(5),1);
else
set_flag(get_memory_cell(4),get_memory_cell(5),0);
}
break