Exit Class #13

Parent #11Owner #10Flags fertileSource MurpgCore-0.4/MurpgCore-0.4.db

6 verbs · 39 properties · 2 children

Verbs

VerbSpecFlagsDefinerLines
invokethis none thisrwxd#1330
_openthis none thisrwxd#133
_closethis none thisrwxd#133
invoke_msgsthis none thisrwxd#1347
_lockthis none thisrwxd#133
_unlockthis none thisrwxd#133

Properties

PropertyDefinerFlagsOwnerValue
source#13rw#10#-1
dest#13rw#10#-1
direction#13rw#10""
size#13rw#105
door#13rw#100
open#13rw#101
leave_msg#13rw#10""
leave_announce#13rw#10""
partner#13rw#10#13
arrive_msg#13rw#10""
arrive_announce#13rw#10""
functional#13rw#101
func_msg#13rw#10""
locked#13rw#100
locked_msg#13rw#10""
open_msg#13rw#10""
open_announce#13rw#10""
close_msg#13rw#10""
close_announce#13rw#10""
lockable#13rw#100
key#13rw#100
lock_msg#13rw#10""
lock_announce#13rw#10""
unlock_msg#13rw#100
unlock_announce#13rw#10""
description#1rw#10<clear>
aliases#1rw#10<clear>
home#1rw#10<clear>
short_desc#1rw#10<clear>
core#1rw#101
handedness#1rw#10<clear>
base_enc#1rw#10<clear>
base_weight#1rw#10<clear>
capacity#1rw#10<clear>
max_fit#1rw#10<clear>
pprep#1rw#10<clear>
gprep#1rw#10<clear>
generic_name#1rw#10<clear>
age#1rw#10<clear>

Ancestry

Ancestors (nearest first): #11 Game Class#1 Root Class

Children: #26 north, #35 south

Call graph

calls n13_0 #13:invoke n13_3 #13:invoke_msgs n13_0->n13_3

Source

invoke

Spec this none thisFlags rwxdOwner #10Definer #13

Referenced by

none

Source

1"$exit:invoke this none this";
2who = args[1];
3if (this.door && (!this.open))
4who:tell("%cThe door is closed.%w");
5return 0;
6else
7"Size check.  Zero always denies entrance.";
8if (this.size == 0)
9who:tell("%cThis exit is too small for anything to fit through.%w");
10return 0;
11else
12"Size 10 always allows entrance.";
13if (this.size != 10)
14whoenc = who:encumbrance();
15ok = $exit_size_enc[this.size];
16if (whoenc > ok)
17who:tell("%cYou are too large to fit through this exit.%w");
18return 0;
19endif
20endif
21endif
22endif
23oldloc = who.location;
24x = who:move_to(this.dest);
25if (x[1] == 0)
26who:tell(x[2]);
27else
28newloc = who.location;
29this:invoke_msgs(who, oldloc, newloc);
30endif

_open

Spec this none thisFlags rwxdOwner #10Definer #13

Referenced by

none

Source

1"$exit:_open this none this";
2this.open = 1;
3this.partner.open = 1;

_close

Spec this none thisFlags rwxdOwner #10Definer #13

Referenced by

none

Source

1"$exit:_close this none this";
2this.open = 0;
3this.partner.open = 0;

invoke_msgs

Spec this none thisFlags rwxdOwner #10Definer #13

Referenced by

Source

1"$exit:invoke_msgs this none this";
2exit = this;
3who = args[1];
4oldroom = args[2];
5newroom = args[3];
6"LEAVE messages.";
7if (who:is_a($animate))
8"Decide on appropriate message (if any) to send to invoker.";
9if (x = exit.leave_msg)
10who:tell(x);
11endif
12"Decide what to announce to the room.";
13"if WHO is flying, etc.";
14"  msg = WHO flies exit.direction, blah blah";
15"else";
16group = oldroom:get_animates();
17for each in (group)
18codes = {"%name", "%pro", "%dir"};
19values = {who:known_to(each)[2], #0.(who.gender)[2], exit.direction};
20what = (exit.leave_announce != "") ? exit.leave_announce | who.species.leave_announce;
21for y in [1..length(codes)]
22new = strsub(what, codes[y], values[y], 1);
23what = new;
24endfor
25each:tell(what);
26endfor
27"ENTER messages.";
28"Decide on appropriate message (if any) to send to invoker.";
29if (x = exit.arrive_msg)
30who:tell(x);
31endif
32"Decide what to announce to the room.";
33"if WHO is flying, etc.";
34"  msg = WHO flies exit.direction, blah blah";
35"else";
36group = setremove(newroom:get_animates(), who);
37for each in (group)
38codes = {"%name", "%pro", "%dir"};
39values = {who:known_to(each)[2], #0.(who.gender)[2], exit.partner.direction};
40what = (exit.arrive_announce != "") ? exit.arrive_announce | who.species.arrive_announce;
41for y in [1..length(codes)]
42new = strsub(what, codes[y], values[y], 1);
43what = new;
44endfor
45each:tell(what);
46endfor
47endif

_lock

Spec this none thisFlags rwxdOwner #10Definer #13

Referenced by

none

Source

1"$exit:_lock this none this";
2this.locked = 1;
3this.partner.locked = 1;

_unlock

Spec this none thisFlags rwxdOwner #10Definer #13

Referenced by

none

Source

1"$exit:_unlock this none this";
2this.locked = 0;
3this.partner.locked = 0;