Patrollers

version 12 by Michael Callaghan

  • Home page
  • Beginning
  • Previous
  • Next



  • Section 3.3 - Carry out moving the Patroller
    For Patrolling something (called the Bod) (this is the move patrollers rule):
        if the Bod is a Patroller and RouteAvailable is true:
            unless the NextRoom is off-limits to the Bod:
                try the Bod going the Way;
            if the location of the Bod is not the CurrentRoom:
                if the location of the Bod is the location of the Player:
                    if Reporting is Collective:
                        add the Bod to the Arrival List;
                    if Reporting is Individual:
                        if the Way is up:
                            say "[The Bod] [come] up from [the CurrentRoom]." (A);
                        otherwise:
                            if the Way is down:
                                say "[The Bod] [come] down from [the CurrentRoom]." (B);
                            otherwise:
                                say "[The Bod] [arrive] [opposite of way] from [the CurrentRoom]." (C);
                if the location of the Player is the CurrentRoom:
                    if Reporting is Collective:
                        add the Bod to the Departure List;
                    if Reporting is Individual:
                        say "[The Bod] [go] [way] to [the NextRoom]." (D).