Room & Dimension
version 1 by Sebastian Rahn
Section 3.4 - Checking goal sector
Freespace is a thing that varies.
Tmp_Width is a number that varies.
To check sector:
calculate coordinates;
Change NoGo to false;
If Tmp_Direction is north [North]
begin;
Change tmp to (X-Axis of Compass - 1);
If tmp is 0
begin;
If Uncommented is false, say "No way from here. (N)";
Change NoGo to true;
stop the action;
end if;
pick sector Y-Axis of Compass and tmp in location of Compass;
Change Freespace to tmp_Picked;
end if;
If Tmp_Direction is northwest [Northwest]
begin;
Change tmp to (X-Axis of Compass - 1);
If tmp is 0
begin;
If Uncommented is false, say "No way from here. (NW)";
Change NoGo to true;
stop the action;
end if;
If Y-Axis of Compass is "LE"
begin;
If Uncommented is false, say "[conditional paragraph break]No way from here. (NW)[line break]";
Change NoGo to true;
stop the action;
end if;
If Y-Axis of Compass is not "RE"
begin;
choose row with Letters28 of Y-Axis of Compass in Table 200;
Change tmp_Y_Number to Number Entry;
decrease tmp_Y_Number by 1;
pick sector tmp_Y_Number and tmp in location of Compass;
otherwise;
Change tmp_Y_Number to tmp_Width;
decrease tmp_Y_Number by 1;
pick sector tmp_Y_Number and tmp in location of Compass;
end if;
Change Freespace to tmp_Picked;
end if;
If Tmp_Direction is northeast [Northeast]
begin;
Change tmp to (X-Axis of Compass - 1);
If tmp is 0
begin;
If Uncommented is false, say "No way from here. (NE)";
Change NoGo to true;
stop the action;
end if;
If Tmp_Width > 1
begin;
If Y-Axis of Compass is "RE"
begin;
If Uncommented is false, say "[conditional paragraph break]No way from here. (NE)[line break]";
Change NoGo to true;
stop the action;
end if;
otherwise;
If Y-Axis of Compass is "LE"
begin;
If Uncommented is false, say "[conditional paragraph break]No way from here. (NE)[line break]";
Change NoGo to true;
stop the action;
end if;
end if;
choose row with Letters28 of Y-Axis of Compass in Table 200;
Change tmp_Y_Number to Number Entry;
increase tmp_Y_Number by 1;
pick sector tmp_Y_Number and tmp in location of Compass;
Change Freespace to tmp_Picked;
end if;
If Tmp_Direction is south [South]
begin;
Change tmp to (X-Axis of Compass + 1);;
choose row 1 in Table_location;
If tmp > Height Entry
begin;
If Uncommented is false, say "No way from here. (S)";
Change NoGo to true;
stop the action;
end if;
pick sector Y-Axis of Compass and tmp in location of Compass;
Change Freespace to tmp_Picked;
end if;
If Tmp_Direction is southwest [Southwest]
begin;
Change tmp to (X-Axis of Compass + 1);
Choose row 1 in Table_Location;
If tmp > Height Entry
begin;
If Uncommented is false, say "No way from here. (SW)";
Change NoGo to true;
stop the action;
end if;
If Y-Axis of Compass is "LE"
begin;
If Uncommented is false, say "[conditional paragraph break]No way from here. (SW)[line break]";
Change NoGo to true;
stop the action;
end if;
If Y-Axis of Compass is not "RE"
begin;
choose row with Letters28 of Y-Axis of Compass in Table 200;
Change tmp_Y_Number to Number Entry;
decrease tmp_Y_Number by 1;
pick sector tmp_Y_Number and tmp in location of Compass;
otherwise;
Change tmp_Y_Number to tmp_Width;
decrease tmp_Y_Number by 1;
pick sector tmp_Y_Number and tmp in location of Compass;
end if;
Change Freespace to tmp_Picked;
end if;
If Tmp_Direction is southeast [Southeast]
begin;
Change tmp to (X-Axis of Compass + 1);
Choose row 1 in Table_Location;
If tmp > Height Entry
begin;
If Uncommented is false, say "No way from here. (SE)";
Change NoGo to true;
stop the action;
end if;
If Tmp_Width > 1
begin;
If Y-Axis of Compass is "RE"
begin;
If Uncommented is false, say "[conditional paragraph break]No way from here. (SE)[line break]";
Change NoGo to true;
stop the action;
end if;
otherwise;
If Y-Axis of Compass is "LE"
begin;
If Uncommented is false, say "[conditional paragraph break]No way from here. (SE)[line break]";
Change NoGo to true;
stop the action;
end if;
end if;
choose row with Letters28 of Y-Axis of Compass in Table 200;
Change tmp_Y_Number to Number Entry;
increase tmp_Y_Number by 1;
pick sector tmp_Y_Number and tmp in location of Compass;
Change Freespace to tmp_Picked;
end if;
If Tmp_Direction is west [West]
begin;
Change tmp to X-Axis of Compass;
If Y-Axis of Compass is "LE"
begin;
If Uncommented is false, say "[conditional paragraph break]No way from here. (W)[line break]";
Change NoGo to true;
stop the action;
end if;
If Y-Axis of Compass is not "RE"
begin;
choose row with Letters28 of Y-Axis of Compass in Table 200;
Change tmp_Y_Number to Number Entry;
decrease tmp_Y_Number by 1;
pick sector tmp_Y_Number and tmp in location of Compass;
otherwise;
Change tmp_Y_Number to tmp_Width;
decrease tmp_Y_Number by 1;
pick sector tmp_Y_Number and tmp in location of Compass;
end if;
Change Freespace to tmp_Picked;
end if;
If Tmp_Direction is east [East]
begin;
Change tmp to X-Axis of Compass;
If Tmp_Width > 1
begin;
If Y-Axis of Compass is "RE"
begin;
If Uncommented is false, say "[conditional paragraph break]No way from here. (E)[line break]";
Change NoGo to true;
stop the action;
end if;
otherwise;
If Y-Axis of Compass is "LE"
begin;
If Uncommented is false, say "[conditional paragraph break]No way from here. (E)[line break]";
Change NoGo to true;
stop the action;
end if;
end if;
choose row with Letters28 of Y-Axis of Compass in Table 200;
Change tmp_Y_Number to Number Entry;
increase tmp_Y_Number by 1;
pick sector tmp_Y_Number and tmp in location of Compass;
Change Freespace to tmp_Picked;
end if.