Player Class #6

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

8 verbs · 67 properties · 2 children

Verbs

VerbSpecFlagsDefinerLines
north south east west up down n s e w u dany any anyrwd#618
passwd passwordany none nonerwd#650
l*ookany any anyrwd#655
who_stringthis none thisrwxd#645
kn*ownany any anyrwd#634
ren*ameany any anyrwd#649
intro*duceany any anyrwd#655
name callany any anyrwd#662

Properties

PropertyDefinerFlagsOwnerValue
prompt_on#6rw#101
color#3rw#10<clear>
base_hear#3rw#10<clear>
base_see#3rw#10<clear>
base_smell#3rw#10<clear>
prompt_string#3rw#10"%g%n: %B[%dhp%hp%B/%c%HP%B][%df%f%B/%c%F%B][%de%e%B/%c%E%B]%w "
base_hp#3rw#10<clear>
cur_hp#3rw#10<clear>
password#3rw#10<clear>
messages#3rw#10<clear>
base_feel#3rw#10<clear>
base_taste#3rw#10<clear>
known_languages#3rw#10<clear>
current_language#3rw#10<clear>
gender#3rw#10<clear>
afk#3rw#10<clear>
base_str#3rw#10<clear>
base_int#3rw#10<clear>
base_hea#3rw#10<clear>
base_spd#3rw#10<clear>
base_cnc#3rw#10<clear>
held#3rw#10<clear>
help_db#3rw#10#28
wielded#3rw#10<clear>
worn#3rw#10<clear>
species#3rw#10<clear>
height#3rw#10<clear>
current_channels#3rw#10<clear>
position#3rw#10<clear>
consciousness#3rw#10<clear>
base_ac#3rw#10<clear>
skills#3rw#10<clear>
base_dex#3rw#10<clear>
base_con#3rw#10<clear>
combat_stance#3rw#10<clear>
known_players#3rw#10<clear>
targets#3rw#10<clear>
last_connected#3rw#10<clear>
combat_init#3rw#10<clear>
combat_weapon#3rw#10<clear>
base_endurance#3rw#10<clear>
cur_endurance#3rw#10<clear>
base_focus#3rw#10<clear>
cur_focus#3rw#10<clear>
current_spell#3rw#10<clear>
paths#3rw#10<clear>
prompt_colors#3rw#10<clear>
finished#3rw#10<clear>
full_name#3rw#10<clear>
total_points#3rw#10<clear>
form_members#3rw#10<clear>
leader#3rw#10<clear>
start_location#3rw#10<clear>
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): #3 Animate Class#11 Game Class#1 Root Class

Children: #8 Architect Class, #25 Anonymous

Call graph

calls n6_0 #6:north n3_2 #3:tell n6_0->n3_2 n3_88 #3:go n6_0->n3_88 n6_1 #6:passwd n6_1->n3_2 n1_7 #1:is_a n6_1->n1_7 n20_7 #20:match n6_1->n20_7 n6_2 #6:l*ook n6_2->n3_2 n3_86 #3:match n6_2->n3_86 n3_93 #3:tell_ambiguous n6_2->n3_93 n6_3 #6:who_string n3_79 #3:known_to n6_3->n3_79 n6_4 #6:kn*own n6_4->n3_2 n6_5 #6:ren*ame n6_5->n3_2 n6_6 #6:intro*duce n6_6->n3_2 n6_6->n20_7 n6_6->n3_79 n6_7 #6:name n6_7->n3_2 n6_7->n3_86 n1_6 #1:descendants n6_7->n1_6

Source

north south east west up down n s e w u d

Spec any any anyFlags rwdOwner #10Definer #6

Referenced by

none

Source

1"$player:north south east west up down";
2exit = this.location:match_exit(verb);
3if (length(args) > 0)
4dirs = {verb, @args};
5else
6dirs = {verb};
7endif
8if (this.consciousness != "awake")
9this:tell("You cannot move...you are ", this.consciousness, "!");
10else
11if (valid(exit))
12this:go(dirs);
13elseif (exit == $failed_match)
14player:tell("You can't go that way.");
15else
16player:tell("I don't know which direction `", verb, "' you mean.");
17endif
18endif

passwd password

Spec any none noneFlags rwdOwner #10Definer #6

Referenced by

none

Source

1"#6:passwd any none none";
2targetstr = argstr;
3if (targetstr != "")
4if (player:is_a($dm) && (player.wizard == 1))
5targetnum = $utils:match(targetstr, players(), 1, 1);
6if (targetnum != {})
7target = targetnum[1];
8player:tell("~New password:");
9newpwd = read(player, 0);
10player:tell("~Retype new password:");
11renewpwd = read(player, 0);
12if (newpwd == renewpwd)
13if (length(newpwd) >= 7)
14target.password = crypt(newpwd);
15player:tell(("Password for %W" + target.name) + "%w changed.");
16else
17player:tell("Password too short.  Not changed.");
18endif
19else
20player:tell("Passwords do not match.");
21endif
22else
23player:tell(("Player %W" + targetstr) + "%w does not exist.");
24endif
25else
26player:tell("Syntax: passwd <cr>");
27endif
28else
29this:tell("~Old password:");
30oldpwd = read(player, 0);
31auth = crypt(oldpwd, player.password[1..2]) == player.password;
32if (auth)
33player:tell("~New password:");
34newpwd = read(player, 0);
35player:tell("~Retype new password:");
36renewpwd = read(player, 0);
37if (newpwd == renewpwd)
38if (length(newpwd) >= 7)
39player.password = crypt(newpwd);
40player:tell(("Password for %W" + player.name) + "%w changed.");
41else
42player:tell("Password too short.  Not changed.");
43endif
44else
45player:tell("Passwords do not match.");
46endif
47else
48player:tell("Password change failed.  Failures are logged for security.");
49endif
50endif

l*ook

Spec any any anyFlags rwdOwner #10Definer #6

Referenced by

none

Source

1"$player:look(any any any)";
2"$player:north south east west up down";
3if (this.consciousness == "unconscious")
4this:tell("You see nothing but a dull red glow.  You are unconscious.");
5elseif (this.consciousness == "dead")
6this:tell("You see a bright white light glowing at the end of a long, dark tunnel.");
7elseif (this.consciousness == "asleep")
8this:tell("You see crazy stuff that we can generate with a dream generator.  That would be fun. And we can pull it from random text strings pulled from stuff that the player saw that day.");
9elseif (length(args) == 0)
10player.location:describe_to(player);
11elseif (prepstr == "")
12"parse dobjstr, do a describe to on it";
13target = dobjstr;
14"build list of candidates to which to match";
15items = player.location.contents;
16matches = player:match(target, items);
17if (matches == {})
18player:tell(("There is no %W" + dobjstr) + "%w here.");
19"multiple matches";
20elseif (length(matches) > 1)
21player:tell_ambiguous(dobjstr, matches);
22"unique match";
23else
24targobj = matches[1];
25targobj:describe_to(player, 2);
26endif
27elseif (prepstr == "on")
28"parse dobjstr and iobjstr, do a describe on it";
29target = dobjstr;
30loc = iobjstr;
31elseif (prepstr == "in")
32"parse dobjstr and iobjstr, do a describe on it";
33target = dobjstr;
34loc = iobjstr;
35items = {@player.contents, @player.location.contents};
36locobj = player:match(loc, items);
37if (locobj == {})
38player:tell(("There is no %W" + loc) + "%w here.");
39elseif (target == "")
40locobj[1]:describe_to(player, 2);
41else
42items = locobj[1].contents;
43matches = player:match(target, items);
44if (matches == {})
45player:tell(((("There is no %W" + target) + "%w in ") + locobj[1].name) + ".");
46else
47targobj = matches[1];
48targobj:describe_to(player, 1);
49endif
50endif
51else
52player:tell("Syntax:  look [in | on] object");
53player:tell("Example:  look in sack");
54"syntax message";
55endif

who_string

Spec this none thisFlags rwxdOwner #10Definer #6

Referenced by

none

Source

1"$player:who_string() this none this";
2viewer = args[1];
3gender = {"N", "B", "F", "M"}[this.gender in {"neither", "both", "female", "male"}];
4species = this.species.who_str;
5"Check if this player is known to viewer.";
6known = this:known_to(viewer);
7if (known[1])
8name = known[2];
9pad = 16;
10else
11name = $who.unknown;
12pad = 18;
13endif
14"afk";
15if (this.afk)
16afk = $who.afk + "  ";
17else
18afk = "       ";
19endif
20"editing";
21if (this.location:is_a($editor))
22edit = $who.editing + "  ";
23else
24edit = "           ";
25endif
26"idle";
27idle = idle_seconds(this);
28if (idle > 3600)
29idle = $who.dormant + "  ";
30elseif (idle > 1800)
31idle = $who.vegetating + "  ";
32elseif (idle >= 600)
33idle = $who.idle + "  ";
34else
35idle = "        ";
36endif
37"admin";
38if (this in $admins)
39admin = $who.admin;
40else
41admin = "";
42endif
43name_string = $utils:padr(name, pad, " ");
44who_string = (((((((((("%G[" + "%g") + species) + "  ") + gender) + "%G] ") + name_string) + afk) + edit) + idle) + admin) + "%w";
45return who_string;

kn*own

Spec any any anyFlags rwdOwner #10Definer #6

Referenced by

none

Source

1"$player:kn*own() any any any";
2if (player in $admins)
3player:tell("%WAll players are already known to you.  But here's the output anyway:%w");
4endif
5if (player.known_players)
6names = {};
7objs = {};
8for x in (player.known_players)
9if (typeof(x) == 2)
10names = {@names, x};
11else
12objs = {@objs, x};
13endif
14endfor
15pad = $utils:longest(names) + 4;
16player:tell("");
17player:tell("%yKnown Players:");
18player:tell("%W--------------");
19for x in [1..length(objs)]
20name = "%y" + names[x];
21namestr = $utils:padr(name, pad, " ");
22spec = objs[x].species.adj + " ";
23gend = #0.(objs[x].gender)[1];
24if (spec[1] == "e")
25prep = "%yAn ";
26else
27prep = "%yA ";
28endif
29player:tell(((((namestr + "%W=>   ") + prep) + spec) + gend) + ".%w");
30endfor
31player:tell("");
32else
33player:tell("%WYou do not know any players.%w");
34endif

ren*ame

Spec any any anyFlags rwdOwner #10Definer #6

Referenced by

none

Source

1"$player:ren*ame any any any";
2newname = 0;
3if (!args)
4player:tell("%WRename which player?%w");
5else
6target = $utils:capitalize(args[1]);
7known = player.known_players;
8inlist = target in known;
9if (!inlist)
10player:tell("%WYou don't know any player by that name.%w");
11else
12alen = length(target);
13newstr = argstr[alen + 2..$];
14if (!newstr)
15player:tell(("%WRename " + target) + " to what?%w");
16else
17if (argstr[alen + 2..alen + 3] == "to")
18if (length(argstr) == (alen + 3))
19player:tell(("%WRename " + target) + " to what?%w");
20else
21newname = newstr[4..$];
22endif
23else
24newname = newstr;
25endif
26endif
27endif
28endif
29if (newname)
30newname = $utils:capitalize(newname);
31"Determine if there are disallowed spaces or characters in the name.";
32if ((index(newname, " ") || index(newname, "#")) || index(newname, "%"))
33player:tell("%WNames cannot contain spaces, pound signs, or percent signs.%w");
34else
35"Determine if the new name is too long.";
36if (length(newname) > 20)
37player:tell("%WThat name is too long.%w");
38else
39"Determine if there is already a player with that name.";
40if (newname in known)
41player:tell(("%WYou already know a player with the name " + newname) + ".%w");
42else
43oldname = known[inlist];
44player.known_players[inlist] = newname;
45player:tell(((("%c" + oldname) + " is now known as ") + newname) + ".%w");
46endif
47endif
48endif
49endif

intro*duce

Spec any any anyFlags rwdOwner #10Definer #6

Referenced by

none

Source

1"$player:intro*duce any any any";
2name = player.name;
3group = setremove(player.location.contents, player);
4gend = #0.(player.gender)[6];
5lang = player.current_language;
6if (args)
7targmatch = $utils:match(args[1], player.location.contents);
8if (!targmatch)
9player:tell("%WThere is no such player here.%w");
10else
11if (length(targmatch) > 1)
12player:tell("%WMultiple matches, please be more specific.%w");
13else
14target = targmatch[1];
15subgroup = setremove(group, target);
16if (target == player)
17for x in (group)
18pname = $utils:capitalize(player:known_to(x)[2]);
19okmsg = ((((pname + " introduces ") + gend) + "... to ") + gend) + ".";
20nomsg = ((((pname + " is talking to ") + gend) + " in ") + lang.name) + " again...";
21x:hears(3, {okmsg}, lang, {nomsg});
22endfor
23player:tell("You introduce yourself.. to yourself.");
24else
25"Send messages to audience in room.";
26for x in (subgroup)
27pname = $utils:capitalize(player:known_to(x)[2]);
28tname = target:known_to(x)[2];
29okmsg = ((((pname + " introduces ") + gend) + " to ") + tname) + ".";
30nomsg = ((((pname + " says something to ") + tname) + " in ") + lang.name) + ".";
31x:hears(3, {okmsg}, lang, {nomsg});
32endfor
33"Send message to designated target.";
34pname = $utils:capitalize(player:known_to(target)[2]);
35targokmsg = ((((pname + " introduces ") + gend) + " to you as '") + name) + "'.";
36targnomsg = ((pname + " says something to you in ") + lang.name) + ".";
37target:hears(3, {targokmsg}, lang, {targnomsg});
38"Send message to player.";
39tname = target:known_to(player)[2];
40pmsg = ((("You introduce yourself as '" + name) + "' to ") + tname) + ".";
41player:tell(pmsg);
42endif
43endif
44endif
45else
46for x in (group)
47pname = $utils:capitalize(player:known_to(x)[2]);
48okmsg = ((((pname + " introduces ") + gend) + " to the room as '") + name) + "'.";
49nomsg = ((pname + " says something in ") + lang.name) + ".";
50x:hears(3, {okmsg}, lang, {nomsg});
51endfor
52"Send message to player.";
53pmsg = ("You introduce yourself to the room as '" + name) + "'.";
54player:tell(pmsg);
55endif

name call

Spec any any anyFlags rwdOwner #10Definer #6

Referenced by

none

Source

1"$player:call/name any any any";
2if (player in $admins)
3player:tell("%WAdmins see all players' real names.  But here's the output anyway:%w");
4player:tell("");
5endif
6verbstr = $utils:capitalize(verb);
7if (!args)
8player:tell(("%W" + verbstr) + " who what?%w");
9else
10targmatch = this:match(args[1], player.location.contents);
11if (!targmatch)
12player:tell("%WThere is no such player here.%w");
13else
14if (length(targmatch) > 1)
15player:tell("%WMultiple matches, please be more specific.%w");
16else
17target = targmatch[1];
18"Game designers and admins are not included in known_players.";
19nope = {@$architect:descendants(), @$admins};
20if (target in nope)
21player:tell("%WGame designers and administrators are always known by their real names.%w");
22elseif (target == player)
23player:tell("%WHaving an identity crisis?%w");
24else
25gend = #0.(target.gender)[3];
26if (length(argstr) == length(args[1]))
27player:tell(((("%W" + verbstr) + " ") + gend) + " what?%w");
28else
29"Now we have TARGET and NAME.";
30name = tostr(args[2]);
31oldname = $utils:capitalize(target:known_to(player)[2]);
32known = player.known_players;
33"Determine if NAME is already in known_players.";
34nref = name in known;
35if (nref)
36if (name == known[nref])
37player:tell(("%WYou already know " + gend) + " by that name.%w");
38else
39len = length(name);
40inc = 1;
41inuse = name;
42while (name in known)
43name = name[1..len] + tostr(inc);
44inc = inc + 1;
45endwhile
46name = $utils:capitalize(name);
47player.known_players[nref] = name;
48player:tell(((("%WThe name " + inuse) + " was already in use, so ") + name) + " has been used instead.");
49player:tell("To change this value, use the rename command.");
50player:tell(((oldname + " is now known as ") + name) + ".%w");
51endif
52else
53name = $utils:capitalize(name);
54player.known_players = listappend(player.known_players, target);
55player.known_players = listappend(player.known_players, name);
56player:tell(((("%W" + oldname) + " is now known as ") + name) + ".");
57endif
58endif
59endif
60endif
61endif
62endif