Generic Integrating Description Room #6792

Parent #3879Owner Flags Source rpg_march_2006/Dependencies/6792.txt

Aliases: Generic Integrating Description Room

4 verbs · 8 properties · 1 children

Verbs

VerbSpecFlagsDefinerLines
look_selfthis none this#679219
descriptionthis none this#679218
okthis none this#679214
description(old)this none thisrd#679218

Properties

PropertyDefinerFlagsOwnerValue
enabled#6792rc-1
look_sep_msg#6792rc" "
entrances#6792not readable (E_PERM)
exits#6792not readable (E_PERM)
key#6792not readable (E_PERM)
aliases#6792{"Generic Integrating Description Room"}
description#6792
value (236 chars)"Integrates some objects in its .contents or .exits into its description. .enabled >0 all objects with :look_msg() verbs or .look_msg property, <0 not players, 0 none of them. Inspired by a similar room on alphamoo that Woodlock wrote."
object_size#6792{3706, 1141286549}

Ancestry

Ancestors (nearest first): #3879 Matching Room#27777 Self-Cleaning Room

Children: #364 outside room

Call graph

calls n6792_0 #6792:look_self n6792_2 #6792:ok n6792_0->n6792_2 n6792_1 #6792:description n6792_0->n6792_1

Source

look_self

Spec this none thisDefiner #6792

Referenced by

Source

1if ((!this.enabled) || (args && args[1]))
2  return pass(@args);
3endif
4player:tell(this:title());
5c = i = {};
6for k in (this:exits())
7  if (valid(k) && (this:ok(k) > 0))
8    i = listappend(i, k);
9  endif
10endfor
11for k in (setremove(this:contents(), player))
12  if ((y = this:ok(k)) > 0)
13    i = setadd(i, k);
14  elseif (y == 0)
15    c = listappend(c, k);
16  endif
17endfor
18player:tell_lines(this:description(@i));
19this:tell_contents(c, this.ctype);

description

Spec this none thisDefiner #6792

Referenced by

Source

1d = pass();
2if ((args == {}) || (!this.enabled))
3  return d;
4else
5  s = ex = "";
6  for k in (args)
7    lookmsg = $object_utils:has_verb(k, "look_msg") ? k:look_msg() | k.look_msg;
8    s = tostr(s, ex, $string_utils:pronoun_sub(lookmsg, k, k));
9    ex = this.look_sep_msg;
10  endfor
11endif
12if (typeof(d) == LIST)
13  return listappend(d, s);
14elseif (typeof(d) == STR)
15  return (d + this.look_sep_msg) + s;
16else
17  return s;
18endif

ok

Spec this none thisDefiner #6792

Referenced by

Source

1"An object is 'OK' for inclusion in the room's desc if it has some sort of look_msg";
2"If the message is a string it gets included.";
3"If it's a non-string the object is invisible (must be owned by the room's owner, or a resident).";
4".enabled<0 suppresses players being included.";
5k = args[1];
6if (($object_utils:has_callable_verb(k, "look_msg") && (y = k:look_msg())) || ($object_utils:has_property(k, "look_msg") && (y = k.look_msg)))
7  if (is_player(k) && (this.enabled <= 0))
8    return 0;
9  elseif ((k.owner == this.owner) || (k in this.residents))
10    return (typeof(y) == STR) ? 1 | ((typeof(y) == OBJ) ? -1 | 0);
11  else
12    return (typeof(y) == STR) && 1;
13  endif
14endif

description(old)

Spec this none thisFlags rdDefiner #6792

Referenced by

none

Source

1"Copied from Generic Integrating Description Room (#6792):description by Gary_Severn (#15) Wed Sep  1 01:52:23 1993 PDT";
2d = pass();
3if ((args == {}) || (!this.enabled))
4  return d;
5else
6  s = ex = "";
7  for k in (args)
8    s = (s + ex) + $string_utils:pronoun_sub($object_utils:has_verb(k, "look_msg") ? k:look_msg() | k.look_msg, k);
9    ex = this.look_sep_msg;
10  endfor
11endif
12if (typeof(d) == LIST)
13  return listappend(d, s);
14elseif (typeof(d) == STR)
15  return (d + this.look_sep_msg) + s;
16else
17  return s;
18endif