! SearchScope domain1 domain2 context ! ! Works out what objects are in scope (possibly asking an outside routine), ! but does not look at anything the player has typed. ! ---------------------------------------------------------------------------- [ SearchScope domain1 domain2 context i; i=0; ! Everything is in scope to the debugging commands #ifdef DEBUG; if (scope_reason==PARSING_REASON && verb_word == 'purloin' or 'tree' or 'abstract' or 'gonear' or 'scope' or 'showobj') { for (i=selfobj:i<=top_object:i++) if (i ofclass Object && (parent(i)==0 || parent(i) ofclass Object)) PlaceInScope(i); rtrue; } #endif; ! First, a scope token gets priority here: if (scope_token ~= 0) { scope_stage=2; if (indirect(scope_token)~=0) rtrue; } ! Next, call any user-supplied routine adding things to the scope, ! which may circumvent the usual routines altogether if they return true: if (actor==domain1 or domain2 && InScope(actor)~=0) rtrue; ! Pick up everything in the location except the actor's possessions; ! then go through those. (This ensures the actor's possessions are in ! scope even in Darkness.) if (context==MULTIINSIDE_TOKEN && advance_warning ~= -1) { if (IsSeeThrough(advance_warning)==1) ScopeWithin(advance_warning, 0, context); } else { if (domain1~=0 && domain1 has supporter or container) ScopeWithin_O(domain1, domain1, context); ScopeWithin(domain1, domain2, context); if (domain2~=0 && domain2 has supporter or container) ScopeWithin_O(domain2, domain2, context); ScopeWithin(domain2, 0, context); } ! A special rule applies: ! in Darkness as in light, the actor is always in scope to himself. if (thedark == domain1 or domain2) { ScopeWithin_O(actor, actor, context); if (parent(actor) has supporter or container) ScopeWithin_O(parent(actor), parent(actor), context); } ];