Animate Class #3

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

105 verbs · 66 properties · 3 children

Verbs

VerbSpecFlagsDefinerLines
will_acceptthis none thisrwxd#30
i*nventorynone none nonerwd#37
tellthis none thisrwxd#31
outputthis none thisrwxd#328
seesthis none thisrwxd#333
hearsthis none thisrwxd#335
smellsthis none thisrwxd#323
output_rawthis none thisrwxd#317
tell_rawthis none thisrwxd#31
colorany any anyrwd#311
promptany any anyrwd#39
max_hpthis none thisrwxd#31
sa*yany any anyrwxd#39
mes*sage msgany any anyrwd#363
feelsthis none thisrwxd#323
tastesthis none thisrwxd#323
disconnectthis none thisrwxd#32
quitnone none nonerwd#311
store_messagethis none thisrwxd#311
whoany any anyrwd#361
helpany none nonerwd#356
uptimenone none nonerwd#32
view_messagesthis none thisrwxd#315
clear_messagesthis none thisrwxd#33
dropany none nonerwd#311
_dropthis none thisrwxd#312
describe_tothis none thisrwxd#351
getany any anyrwd#344
putany any anyrwd#345
adm*inistratorany any anyrwd#315
can_wearthis none thisrwxd#326
_wearthis none thisrwxd#336
_removethis none thisrwxd#326
eq*uipmentnone none nonerwd#37
wearany none nonerwd#322
rem*oveany none nonerwd#321
can_holdthis none thisrwxd#38
wieldany none nonerwd#323
_wieldthis none thisrwxd#328
_unwieldthis none thisrwxd#320
unwieldany none nonerwd#328
carried_weightthis none thisrwxd#310
strthis none thisrwxd#33
dexthis none thisrwxd#33
cncthis none thisrwxd#33
intthis none thisrwxd#33
conthis none thisrwxd#33
chan*nelsany any anyrwd#3103
mobilitythis none thisrwxd#318
acthis none thisrwxd#324
silentany any anyrwd#37
sc*ore st*atistics statsnone none nonerwd#388
_saythis none thisrwxd#321
afk awayany any anyrwd#315
skill_valuethis none thisrwxd#310
att*ackany none nonerwxd#334
set_combat_stancethis none thisrwxd#321
def*endnone none nonerwd#36
fleeany none nonerwd#311
passivenone none nonerwd#36
info*rmationany any anyrwd#361
raise_hpthis none thisrwxd#311
lower_hpthis none thisrwxd#345
hitthis none thisrwxd#371
emoteany any anyrwd#35
get_targetthis none thisrwxd#38
spdthis none thisrwxd#33
init_rollthis none thisrwxd#333
_attackthis none thisrwxd#319
show_eq*uipmentthis none thisrwxd#311
show_inv*entorythis none thisrwxd#317
max_endurancethis none thisrwxd#34
max_focusthis none thisrwxd#31
damagethis none thisrwxd#33
lower_endurancethis none thisrwxd#35
castany any anyrwd#391
set_disconnect_infothis none thisrwxd#39
path_valuethis none thisrwxd#310
lower_focusthis none thisrwxd#35
known_tothis none thisrwxd#327
adminsany any anyrwd#347
_emotethis none thisrwxd#312
raise_endurancethis none thisrwxd#311
raise_focusthis none thisrwxd#311
sp*eakany any anyrwd#317
_speakthis none thisrwxd#322
matchthis none thisrwxd#338
get_weaponthis none thisrwxd#314
gothis none thisrwxd#333
_getthis none thisrwxd#39
_putthis none thisrwxd#311
height_strthis none thisrwxd#33
formany any anyrwd#360
tell_ambiguousthis none thisrwxd#310
_unformthis none thisrwxd#321
unformany none nonerwd#327
_formthis none thisrwxd#312
openany any anyrwd#36
_openthis none thisrwxd#357
closeany any anyrwd#36
_closethis none thisrwxd#351
lockany any anyrwd#36
_lockthis none thisrwxd#367
unlockany any anyrwd#36
_unlockthis none thisrwxd#367

Properties

PropertyDefinerFlagsOwnerValue
color#3rw#101
base_hear#3rw#103
base_see#3rw#103
base_smell#3rw#103
prompt_string#3rw#10"%W<Murpg>%w "
base_hp#3rw#1012
cur_hp#3rw#1012
password#3rw#10"RFMs4aT6VPx96"
messages#3rw#10{}
base_feel#3rw#103
base_taste#3rw#103
known_languages#3rw#10{#63}
current_language#3rw#10#63
gender#3rw#10"neither"
afk#3rw#100
base_str#3rw#1010
base_int#3rw#1010
base_hea#3rw#1010
base_spd#3rw#1010
base_cnc#3rw#1010
held#3rw#10{}
help_db#3rw#10#54
wielded#3rw#10{}
worn#3rw#10{}
species#3rw#10#67
height#3rw#1068
current_channels#3rw#10{}
position#3rw#10"standing"
consciousness#3rw#10"awake"
base_ac#3rw#1010
skills#3rw#10{}
base_dex#3rw#1010
base_con#3rw#1010
combat_stance#3rw#10"attack"
known_players#3rw#10{}
targets#3rw#10{}
last_connected#3rw#10"never"
combat_init#3rw#100
combat_weapon#3rw#100
base_endurance#3rw#10100
cur_endurance#3rw#1095
base_focus#3rw#10100
cur_focus#3rw#10100
current_spell#3rw#100
paths#3rw#10{}
prompt_colors#3rw#10
list of 15{"%c", "%C", "%y", "%R", "%r", "%c", "%C", "%y", "%R", "%r", "%c", "%C", "%y", "%R", "%r"}
finished#3rw#100
full_name#3rw#10""
total_points#3rw#100
form_members#3rw#10{}
leader#3rw#100
start_location#3rw#10#33
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#1010
base_weight#1rw#100
capacity#1rw#10100
max_fit#1rw#10100
pprep#1rw#10<clear>
gprep#1rw#10<clear>
generic_name#1rw#10<clear>
age#1rw#109932

Ancestry

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

Children: #6 Player Class, #7 NPC Class, #66 Species Template

Call graph

calls n3_1 #3:i*nventory n3_2 #3:tell n3_1->n3_2 n3_3 #3:output n3_2->n3_3 n3_4 #3:sees n3_4->n3_3 n3_5 #3:hears n3_5->n3_3 n3_6 #3:smells n3_6->n3_3 n3_8 #3:tell_raw n3_7 #3:output_raw n3_8->n3_7 n3_9 #3:color n3_9->n3_2 n3_10 #3:prompt n3_10->n3_8 n3_12 #3:sa*y n3_12->n3_2 n3_52 #3:_say n3_12->n3_52 n3_52->n3_2 n3_79 #3:known_to n3_52->n3_79 n3_13 #3:mes*sage n3_13->n3_2 n3_22 #3:view_messages n3_13->n3_22 n3_23 #3:clear_messages n3_13->n3_23 n1_7 #1:is_a n3_13->n1_7 n20_7 #20:match n3_13->n20_7 n3_22->n3_2 n3_23->n3_2 n3_14 #3:feels n3_14->n3_3 n3_15 #3:tastes n3_15->n3_3 n3_17 #3:quit n3_17->n3_2 n3_16 #3:disconnect n3_17->n3_16 n3_19 #3:who n3_19->n3_2 n20_13 #20:ftime n3_19->n20_13 n20_12 #20:_uptime n3_19->n20_12 n3_20 #3:help n3_20->n3_2 n43_0 #43:add_entry n3_20->n43_0 n3_21 #3:uptime n3_21->n3_2 n3_21->n20_12 n3_24 #3:drop n3_24->n3_2 n3_86 #3:match n3_24->n3_86 n3_25 #3:_drop n3_24->n3_25 n3_39 #3:_unwield n3_25->n3_39 n3_39->n3_2 n3_26 #3:describe_to n3_26->n3_79 n3_27 #3:get n3_27->n3_2 n3_27->n3_86 n3_89 #3:_get n3_27->n3_89 n3_89->n3_2 n3_28 #3:put n3_28->n3_2 n3_28->n3_86 n3_90 #3:_put n3_28->n3_90 n3_90->n3_2 n3_90->n3_39 n3_29 #3:adm*inistrator n3_29->n3_2 n3_31 #3:_wear n3_31->n3_2 n3_31->n3_39 n3_30 #3:can_wear n3_31->n3_30 n3_32 #3:_remove n3_32->n3_2 n3_36 #3:can_hold n3_32->n3_36 n3_33 #3:eq*uipment n3_33->n3_2 n3_34 #3:wear n3_34->n3_2 n3_34->n3_86 n3_34->n3_31 n3_35 #3:rem*ove n3_35->n3_2 n3_35->n3_86 n3_35->n3_32 n3_37 #3:wield n3_37->n3_2 n3_37->n3_86 n3_38 #3:_wield n3_37->n3_38 n3_38->n3_2 n3_40 #3:unwield n3_40->n3_2 n3_40->n3_86 n3_40->n3_39

Showing 48 of 110 verbs; 62 not shown.

Source

will_accept

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

none

Source

No program (verb defined but unprogrammed).

i*nventory

Spec none none noneFlags rwdOwner #10Definer #3

Referenced by

none

Source

1"#3:inventory none none none";
2if (player.held)
3player:tell("%y  You are holding:");
4player:show_inv();
5else
6player:tell("%yYou aren't holding anything.");
7endif

tell

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1this:output(@args);

output

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"convert everything to a list";
2line = {""};
3if (length(args) > 1)
4line = {tostr(@args)};
5else
6{?line = {}} = args;
7endif
8if (typeof(line) != LIST)
9line = {line};
10endif
11if (this.color)
12for each in (line)
13for x in [1..16]
14each = strsub(each, $color_codes[x], $raw_colors[x], 1);
15endfor
16each = strsub(each, "%^", "%", 1);
17notify(this, each);
18endfor
19else
20for each in (line)
21for x in [1..16]
22each = strsub(each, $color_codes[x], "", 1);
23endfor
24each = strsub(each, "%^", "%", 1);
25notify(this, each);
26endfor
27endif
28return 1;

sees

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

none

Source

1"will do effects checking";
2"takes four args: sensitivity level, list of messages, language, and lang msgs";
3"0 - 5: 0 blind, 5 super sight perception (eyes in the back o me head ya bastard)";
4"{arg1_sens_message, arg1+1_sens_message, arg1+2_sens_message, ...}";
5{sense_level, message_list, ?language = 0, ?lang_msg_list = {}} = args;
6if (lang_msg_list == {})
7lang_msg_list = {"You can't quite make out the words.", "", "", "", ""};
8endif
9num_messages = length(message_list);
10"calculate which message to tell";
11can_see = sense_level - this.base_see;
12"if greater than or equal to sense_level, use first message";
13if (can_see <= 0)
14can_see = 1;
15"if less than sense_level, increment by one to get proper list indexing";
16else
17can_see = can_see + 1;
18endif
19"make sure you have that message";
20if (can_see <= num_messages)
21"check if message is written, i.e. has a language specified";
22"check for language ability";
23if ((language == 0) || (language in this.known_languages))
24this:output(message_list[can_see]);
25return 1;
26else
27this:output(lang_msg_list[can_see]);
28return 1;
29endif
30else
31"no message to display";
32return 0;
33endif

hears

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

none

Source

1"will do effects checking";
2"takes four args: sensitivity level, and list of messages, language";
3"spoken, and language unknown message list";
4"can build in lang proficiencies later.";
5"0 - 5: 0 deaf, 5 super hearing";
6"{arg1_sens_message, arg1+1_sens_message, arg1+2_sens_message, ...}";
7"any item in $languages, or $default_language if not specified.";
8{sense_level, message_list, ?language = $default_language, ?lang_msg_list = {}} = args;
9if (lang_msg_list == {})
10lang_msg_list = {"You can't quite make out the words.", "", "", "", ""};
11endif
12num_messages = length(message_list);
13"calculate which message to tell";
14can_hear = sense_level - this.base_hear;
15"if greater than or equal to sense_level, use first message";
16if (can_hear <= 0)
17can_hear = 1;
18"if less than sense_level, increment by one to get proper list indexing";
19else
20can_hear = can_hear + 1;
21endif
22"make sure you have that message";
23if (can_hear <= num_messages)
24"check for language ability";
25if (language in this.known_languages)
26this:output(message_list[can_hear]);
27return 1;
28else
29this:output(lang_msg_list[can_hear]);
30return 1;
31endif
32else
33"no message to display";
34return 0;
35endif

smells

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

none

Source

1"will do effects checking";
2"takes two args: sensitivity level, and list of messages";
3"0 - 5: 0 no smell sense, 5 super sniffer perception (like a dog ya bastard)";
4"{arg1_sens_message, arg1+1_sens_message, arg1+2_sens_message, ...}";
5{sense_level, message_list} = args;
6num_messages = length(message_list);
7"calculate which message to tell";
8can_smell = sense_level - this.base_smell;
9"if greater than or equal to sense_level, use first message";
10if (can_smell <= 0)
11can_smell = 1;
12"if less than sense_level, increment by one to get proper list indexing";
13else
14can_smell = can_smell + 1;
15endif
16"make sure you have that message";
17if (can_smell <= num_messages)
18this:output(message_list[can_smell]);
19return 1;
20else
21"no message to display";
22return 0;
23endif

output_raw

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1if (length(args) > 1)
2line = {tostr(@args)};
3else
4{?line = {}} = args;
5endif
6if (typeof(line) != LIST)
7line = {line};
8endif
9if (line == {})
10notify(this, "");
11else
12for each in (line)
13each = tostr(each);
14notify(this, each);
15endfor
16endif
17return 1;

tell_raw

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1this:output_raw(@args);

color

Spec any any anyFlags rwdOwner #10Definer #3

Referenced by

none

Source

1if (length(args) == 0)
2player.color = abs(player.color - 1);
3elseif (args[1] == "on")
4player.color = 1;
5elseif (args[1] == "off")
6player.color = 0;
7else
8player:tell("Syntax:  color [on | off]");
9endif
10player:tell("Color is now ", player.color ? "on" | "off", ".");
11return player.color;

prompt

Spec any any anyFlags rwdOwner #10Definer #3

Referenced by

none

Source

1"$animate:prompt any any any";
2targ = this;
3if (length(args) < 1)
4targ:tell_raw((("Current prompt string --> " + "\"") + targ.prompt_string) + "\"");
5elseif (args[1] == "default")
6targ.prompt_string = $default_prompt;
7else
8targ.prompt_string = tostr(args[1]);
9endif

max_hp

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1return this.base_hp;

sa*y

Spec any any anyFlags rwxdOwner #10Definer #3

Referenced by

Source

1"$animate:say any any any";
2if (player.consciousness != "awake")
3player:tell("You need to be awake to talk.");
4elseif (!args)
5player:tell("Say what?");
6return 0;
7else
8player:_say(argstr);
9endif

mes*sage msg

Spec any any anyFlags rwdOwner #10Definer #3

Referenced by

none

Source

1"$animate:msg any any any";
2if (!args)
3player:tell("%BMessage whom?%w");
4else
5target_str = args[1];
6"Decide if the target is actually a command argument";
7"View messages";
8if (target_str in {"view", "show"})
9player:view_messages();
10"Clear messages";
11elseif (target_str in {"clear", "delete"})
12player:clear_messages();
13"DM-only option for sending a global message";
14elseif ((target_str in {"all", "global"}) && player:is_a($dm))
15player:msg_all(argstr);
16else
17{?target = #-1} = $utils:match(target_str, players(), 1, 1);
18"msg commands";
19message_raw = argstr[length(args[1]) + 1..$];
20"Players can only send messages to admins";
21if ((!(player in $admins)) && (!(target in $admins)))
22player:tell("%BNo such administrator exists.%w");
23return;
24"Target is not a valid player OBJ";
25elseif (!valid(target))
26player:tell("%BNo such player exists.%w");
27return;
28"There was no message to send";
29elseif (message_raw == "")
30player:tell(("%BSend what message to " + target.name) + "?%w");
31return;
32"Target player is not connected so message will be logged.";
33elseif (!(target in connected_players()))
34player:tell(("%B" + target.name) + " is not connected.");
35"Truncate message if necessary";
36if (length(message_raw) > $max_msg_length)
37message_trunc = message_raw[1..$max_msg_length] + " %w[message truncated]";
38message_raw = message_trunc;
39endif
40if (target:store_message(player, message_raw))
41player:tell(((("%BThe following message has been logged for " + target.name) + ":%G ") + message_raw) + "%w");
42return;
43else
44"Message box full.  Hopefully this won't happen often!";
45player:tell(("%B" + target.name) + "'s message box is full.  Message not stored.%w");
46endif
47else
48if (length(message_raw) > $max_msg_length)
49message_trunc = message_raw[1..$max_msg_length] + " %w[message truncated]";
50message_raw = message_trunc;
51endif
52if (target:is_a($dm))
53"Let Dungeon Masters see the sender's OBJ number";
54message = ((((("%GMessage from " + player.name) + "[") + tostr(player)) + "]: ") + message_raw) + "%w";
55else
56message = ((("%GMessage from " + player.name) + ": ") + message_raw) + "%w";
57endif
58target:tell(message);
59message_echo = ((("%GYou message " + target.name) + " with: ") + message_raw) + "%w";
60player:tell(message_echo);
61endif
62endif
63endif

feels

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

none

Source

1"will do effects checking";
2"takes two args: sensitivity level, and list of messages";
3"0 - 5: 0 numb, 5 super touch perception ";
4"{arg1_sens_message, arg1+1_sens_message, arg1+2_sens_message, ...}";
5{sense_level, message_list} = args;
6num_messages = length(message_list);
7"calculate which message to tell";
8can_feel = sense_level - this.base_feel;
9"if greater than or equal to sense_level, use first message";
10if (can_feel <= 0)
11can_feel = 1;
12"if less than sense_level, increment by one to get proper list indexing";
13else
14can_feel = can_feel + 1;
15endif
16"make sure you have that message";
17if (can_feel <= num_messages)
18this:output(message_list[can_feel]);
19return 1;
20else
21"no message to display";
22return 0;
23endif

tastes

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

none

Source

1"will do effects checking";
2"takes two args: sensitivity level, and list of messages";
3"0 - 5: 0 no tongue, 5 can taste farts ";
4"{arg1_sens_message, arg1+1_sens_message, arg1+2_sens_message, ...}";
5{sense_level, message_list} = args;
6num_messages = length(message_list);
7"calculate which message to tell";
8can_taste = sense_level - this.base_taste;
9"if greater than or equal to sense_level, use first message";
10if (can_taste <= 0)
11can_taste = 1;
12"if less than sense_level, increment by one to get proper list indexing";
13else
14can_taste = can_taste + 1;
15endif
16"make sure you have that message";
17if (can_taste <= num_messages)
18this:output(message_list[can_taste]);
19return 1;
20else
21"no message to display";
22return 0;
23endif

disconnect

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"$animate:disconnect this none this";
2boot_player(this);

quit

Spec none none noneFlags rwdOwner #10Definer #3

Referenced by

none

Source

1"$animate:quit none none none";
2cost = random(4000) + 10000;
3player:tell("~It will cost you ", cost, " coins to rent.  Continue? ");
4answer = read(player, 0);
5yesno = answer ? answer | "no";
6if (yesno[1] == "y")
7player:tell("");
8player:tell("~Would you like your possessions identified? ");
9answertwo = read(player, 0);
10player:disconnect();
11endif

store_message

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

none

Source

1time_stamp = time();
2sent_by = args[1];
3message = args[2];
4"test for full message box";
5if (length(toliteral(this.messages)) > $max_msg_box_size)
6return 0;
7else
8msg = {time_stamp, sent_by, message};
9this.messages = listappend(this.messages, msg);
10return 1;
11endif

who

Spec any any anyFlags rwdOwner #10Definer #3

Referenced by

none

Source

1"$animate:who() any any any";
2"Create your lists";
3dms = archs = coders = known_players = unknown_players = {};
4for x in (connected_players())
5isknown = x:known_to(player)[1];
6if (x:is_a($dm))
7dms = {@dms, x};
8elseif (x:is_a($coder))
9coders = {@coders, x};
10elseif (x:is_a($architect))
11archs = {@archs, x};
12elseif (isknown)
13known_players = {@known_players, x};
14else
15unknown_players = {@unknown_players, x};
16endif
17endfor
18"Header";
19player:tell();
20player:tell($who.header);
21if ((dms || archs) || coders)
22player:tell($who.divider);
23"DMs, Architects, Coders";
24for dm in (dms)
25player:tell(dm:who_string(player));
26endfor
27for arch in (archs)
28player:tell(arch:who_string(player));
29endfor
30for coder in (coders)
31player:tell(coder:who_string(player));
32endfor
33endif
34"divider test";
35if (known_players || unknown_players)
36player:tell($who.divider);
37"Known players";
38for known in (known_players)
39player:tell(known:who_string(player));
40endfor
41for unknown in (unknown_players)
42player:tell(unknown:who_string(player));
43endfor
44endif
45"divider for globals is now necessary";
46player:tell($who.divider);
47"Global statistics;  may wish to make this a separate function";
48curplayers = length(connected_players());
49curtime = $utils:ftime(ctime());
50maxplayers = $max_connected[1];
51maxtime = $utils:ftime(ctime($max_connected[2]));
52pstr = (curplayers == 1) ? " player" | " players";
53mpstr = (maxplayers == 1) ? " player" | " players";
54totalstr = (((tostr(curplayers) + pstr) + " currently logged in on ") + curtime) + ".";
55player:tell("%C  Total: " + totalstr);
56if (maxplayers == curplayers)
57player:tell("    Max: Currently at maximum connected players.");
58else
59player:tell((((("    Max: " + tostr(maxplayers)) + mpstr) + " on ") + maxtime) + ".");
60endif
61player:tell((" Uptime: " + $utils:_uptime()) + "%w");

help

Spec any none noneFlags rwdOwner #10Definer #3

Referenced by

none

Source

1"#3:help any none none";
2{?topic = "help"} = args;
3"create list of help dbs by traversing parents, and storing their .help_db prop";
4dude = parent(player);
5dbs = {};
6while (valid(dude))
7if (dude:has_prop("help_db"))
8dbs = {@dbs, dude.help_db};
9endif
10dude = parent(dude);
11endwhile
12if (!dbs)
13player:tell("No help databases defined for your player type.");
14else
15found = {};
16for db in (dbs)
17results = db:find_topics(topic);
18for each in (results)
19found = {@found, {db, @each}};
20endfor
21endfor
22exact_match = {};
23if (found)
24"check for exact match";
25for each in (found)
26if (topic == each[2])
27exact_match = each;
28endif
29endfor
30if (exact_match != {})
31found = {exact_match};
32endif
33if (length(found) > 1)
34player:tell("There are multiple topics that match your query:");
35for each in (found)
36player:tell("  %W", each[2]);
37endfor
38return 0;
39else
40"display results";
41"topic_ref-1 = db object.  -2 = topic string.  -3 article num.";
42topic_ref = found[1];
43if (topic_ref[1]:has_prop(topic_ref[3]))
44player:tell("Showing help on topic %W", topic_ref[2], "%w article %W", topic_ref[3], "%w:");
45player:tell(topic_ref[1].(topic_ref[3]));
46return;
47else
48player:tell("Topic %W", topic_ref[2], "%w points to Article %W", topic_ref[3], "%w, but the article appears to be missing.  This error has been logged, and an Administrator will be fixing it shortly.");
49$log:add_entry("help", $log.log_levels[1], (((("Article missing: " + topic_ref[2]) + "  ") + topic_ref[3]) + "  ") + topic_ref[1].name);
50return;
51endif
52endif
53endif
54player:tell("No help topics matched your query.");
55return 0;
56endif

uptime

Spec none none noneFlags rwdOwner #10Definer #3

Referenced by

none

Source

1"$animate:uptime() none none none";
2player:tell(("%CUptime: " + $utils:_uptime()) + "%w");

view_messages

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1if (this.messages == {})
2this:tell("%BYou have no messages to view.%w");
3else
4this:tell(("%BYou have " + tostr(length(this.messages))) + " messages saved:");
5for x in (this.messages)
6msg_time = ctime(x[1]);
7msg_sender = x[2].name;
8msg_text = x[3];
9this:tell((((("%C" + msg_time) + " %B") + msg_sender) + ":%G ") + msg_text);
10endfor
11this:tell("%BEnd of saved messages.%w");
12if (length(toliteral(this.messages)) > $max_msg_box_size)
13this:tell("%YYour message box is currently full.%w");
14endif
15endif

clear_messages

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1player.messages = {};
2player:tell("%BMessages cleared.%w");
3return;

drop

Spec any none noneFlags rwdOwner #10Definer #3

Referenced by

none

Source

1"$animate:drop any none none";
2"will drop any item that is currently in your 'held' list";
3target = dobjstr;
4items = player.held;
5matches = player:match(target, items);
6if (matches == {})
7player:tell("You are not holding anything called %W", target, "%w.");
8else
9results = player:_drop(matches[1]);
10player:tell(results[2]);
11endif

_drop

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"$animate:_drop this none this";
2{what} = args;
3if (what in this.held)
4if (what:move_to(this.location)[1] == 1)
5this:_unwield(what);
6return {1, ("You drop %W" + what.name) + "%w."};
7else
8return {0, ("You cannot drop %W" + what.name) + "%w."};
9endif
10else
11return {0, ("You are not holding %W" + what.name) + "%w."};
12endif

describe_to

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

none

Source

1"$animate:describe_to(target, [0|1|2]) this none this";
2"returns 0 if target isn't a valid animate objidnum";
3"0 sends a one line (short) description, typically a name or handle";
4"  in the form of a sentence, possibly incorporating their state.";
5"1 sends a name, handle, and description property.  multi line.";
6"2 sends all of the above, plus what the person is wearing, more detail.";
7{target, ?msglen = 0} = args;
8if (!target:is_a($animate))
9return 0;
10else
11shownum = "";
12if (target:is_a($architect))
13shownum = (" (" + tostr(this)) + ")";
14endif
15known = this:known_to(target);
16spec = " the " + this.species.generic_name;
17if (known[1])
18name = known[2] + spec;
19else
20name = $utils:capitalize(known[2]);
21endif
22pos = this.position;
23con = this.consciousness;
24if (con == "awake")
25where = " here.";
26else
27where = (" here, " + con) + ".";
28endif
29end = (" is " + pos) + where;
30target:sees(3, {(name + shownum) + end});
31if (msglen in {1, 2})
32for x in (this.description)
33target:sees(3, {x});
34endfor
35if (msglen == 2)
36prep = $utils:capitalize(#0.(this.gender)[2]);
37target:tell("");
38if (this.worn)
39target:tell(("%y  " + prep) + " is wearing:");
40this:show_eq(target);
41else
42target:tell(("%y" + prep) + " is not wearing any equipment.%w");
43endif
44if (this.held)
45target:tell("");
46target:tell(("%y  " + prep) + " is holding:");
47this:show_inv(target);
48endif
49endif
50endif
51endif

get

Spec any any anyFlags rwdOwner #10Definer #3

Referenced by

none

Source

1"#3:get any any any";
2"get item [from item2]";
3"picks up item from ground, from a container in room, or from a container in inventory.";
4"puts item in held slot.";
5"match and validate the target location (from what)";
6if (prepstr == "from")
7target_locs = {@player.contents, @player.location.contents};
8target_loc = player:match(iobjstr, target_locs);
9if (target_loc == {})
10player:tell(("There is no %W" + iobjstr) + "%w here.");
11return;
12elseif (length(target_loc) > 1)
13x = 1;
14player:tell(("Which %W" + iobjstr) + "%w do you mean?");
15for each in (target_loc)
16player:tell((tostr(x) + ":  ") + target_loc[x].name);
17x = x + 1;
18endfor
19return;
20elseif (!target_loc[1]:is_a($container))
21player:tell(target_loc[1].name + " is not a container.");
22return;
23else
24target_loc = target_loc[1];
25endif
26else
27target_loc = player.location;
28endif
29"match and validate the target (what are you getting)";
30target = player:match(dobjstr, target_loc.contents);
31if (target == {})
32player:tell(((("There is no %W" + dobjstr) + "%w in %W") + target_loc.name) + "%w.");
33elseif (length(target) > 1)
34x = 1;
35player:tell(("Which %W" + dobjstr) + "%w do you mean?");
36for each in (target)
37player:tell((tostr(x) + ":  ") + target[x].name);
38x = x + 1;
39endfor
40"dobjstr and iobjstr are both matched uniquely";
41"try to move the item";
42else
43player:_get(target[1], target_loc);
44endif

put

Spec any any anyFlags rwdOwner #10Definer #3

Referenced by

none

Source

1"#3:put any any any";
2"put item in item2";
3"picks up item from ground, or uses held item.";
4"puts item in specified container.";
5"match and validate the target location (put into what)";
6if (prepstr in {"in", "into", "inside"})
7target_dests = {@player.contents, @player.location.contents};
8target_dest = player:match(iobjstr, target_dests);
9if (target_dest == {})
10player:tell(("There is no %W" + iobjstr) + "%w here.");
11return;
12elseif (length(target_dest) > 1)
13x = 1;
14player:tell(("Which %W" + iobjstr) + "%w do you mean?");
15for each in (target_dest)
16player:tell((tostr(x) + ":  ") + target_dest[x].name);
17x = x + 1;
18endfor
19return;
20elseif (!target_dest[1]:is_a($container))
21player:tell(target_dest[1].name + " is not a container.");
22return;
23else
24target_dest = target_dest[1];
25endif
26else
27player:tell("Syntax: put object1 in/into/inside object2");
28return;
29endif
30"match and validate the target (what are you putting)";
31target = player:match(dobjstr, {@player.held, @player.location.contents});
32if (target == {})
33player:tell(("There is no %W" + dobjstr) + "%w here.");
34elseif (length(target) > 1)
35x = 1;
36player:tell(("Which %W" + dobjstr) + "%w do you mean?");
37for each in (target)
38player:tell((tostr(x) + ":  ") + target[x].name);
39x = x + 1;
40endfor
41"dobjstr and iobjstr are both matched uniquely";
42"try to move the item";
43else
44this:_put(target[1], target_dest);
45endif

adm*inistrator

Spec any any anyFlags rwdOwner #10Definer #3

Referenced by

none

Source

1"$animate:admin any any any";
2if (player in $admins)
3if (!("admin" in player.current_channels))
4player:tell("%WYour channel has been turned on.%w");
5player.current_channels = setadd(player.current_channels, "admin");
6endif
7for admin in ($channels.admin_channel)
8if ("admin" in admin.current_channels)
9admin:tell();
10admin:tell((((($channels.admin_prefix + " ") + player.name) + ": ") + argstr) + "%w");
11endif
12endfor
13else
14player:tell($bad_command);
15endif

can_wear

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"#3:can_wear() this none this";
2"takes OBJ wearable...returns {1|0, message}";
3wearable = args[1];
4if (!wearable:is_a($wearable))
5return {0, "That item is not wearable."};
6elseif (!(this.species.body_type in wearable.body_type))
7return {0, "That item does not fit your body properly."};
8else
9x = wearable:fits(this);
10if (x[1] == 0)
11return x;
12else
13slots_used = 0;
14for each in (this.worn)
15if (each.where == wearable.where)
16slots_used = slots_used + wearable.quantity;
17endif
18endfor
19max_worn = this.species.max_worn[(wearable.where in this.species.max_worn) + 1];
20if ((wearable.quantity + slots_used) > max_worn)
21return {0, ("You cannot wear that many items on your " + wearable.where) + "."};
22else
23return {1, ""};
24endif
25endif
26endif

_wear

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"#3:_wear() this none this";
2"OBJ wearable, returns {0|1, message}";
3wearable = args[1];
4if (wearable in this.worn)
5return {0, "You are already wearing that item."};
6else
7x = this:can_wear(wearable);
8if (x[1] == 0)
9return x;
10"check to see if can hold item, if not already";
11else
12if (wearable.location != this)
13retval = wearable:move_to(this);
14if (retval[1] != 1)
15return retval;
16endif
17endif
18if (wearable in this.wielded)
19this:_unwield(wearable);
20endif
21this.worn = {@this.worn, wearable};
22this.held = setremove(this.held, wearable);
23this:tell(("You wear " + wearable.name) + ".");
24room = setremove(player.location.contents, player);
25audience = {};
26for x in (room)
27if (x:is_a($animate))
28audience = {@audience, x};
29endif
30endfor
31for y in (audience)
32y:sees(3, {((this.name + " wears ") + wearable.name) + "."});
33endfor
34return {1, ""};
35endif
36endif

_remove

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"#3:_remove() this none this";
2"OBJ wearable, returns {0|1, message}";
3wearable = args[1];
4if (!(wearable in this.worn))
5return {0, "You are not wearing that item."};
6else
7retval = this:can_hold(wearable);
8if (retval[1] == 0)
9return {0, "You cannot hold any more items."};
10else
11this.held = {@this.held, wearable};
12this.worn = setremove(this.worn, wearable);
13this:tell(("You remove " + wearable.name) + ".");
14room = setremove(player.location.contents, player);
15audience = {};
16for x in (room)
17if (x:is_a($animate))
18audience = {@audience, x};
19endif
20endfor
21for y in (audience)
22y:sees(3, {((this.name + " removes ") + wearable.name) + "."});
23endfor
24return {1, ""};
25endif
26endif

eq*uipment

Spec none none noneFlags rwdOwner #10Definer #3

Referenced by

none

Source

1"$animate:eq*uipment() none none none";
2if (this.worn)
3this:tell("%y  You are wearing:");
4this:show_eq();
5else
6this:tell("%yYou are not wearing any equipment.");
7endif

wear

Spec any none noneFlags rwdOwner #10Definer #3

Referenced by

none

Source

1"#3:wear any none none";
2"wear item";
3"can wear either from inventory, or from on ground";
4"matches to inventory first";
5target = player:match(dobjstr, {@this.held, @this.location.contents});
6if (target == {})
7player:tell(("There is no %W" + dobjstr) + "%w here.");
8elseif (length(target) > 1)
9x = 1;
10player:tell(("Which %W" + dobjstr) + "%w do you mean?");
11for each in (target)
12player:tell((tostr(x) + ":  ") + target[x].name);
13x = x + 1;
14endfor
15"dobjstr matched uniquely";
16"try to move the item";
17else
18retval = this:_wear(target[1]);
19if (retval[1] == 0)
20this:tell(retval[2]);
21endif
22endif

rem*ove

Spec any none noneFlags rwdOwner #10Definer #3

Referenced by

none

Source

1"#3:remove any none none";
2"remove item";
3"match to items in worn list";
4target = player:match(dobjstr, this.worn);
5if (target == {})
6player:tell(("You are not wearing any %W" + dobjstr) + "%w.");
7elseif (length(target) > 1)
8x = 1;
9player:tell(("Which %W" + dobjstr) + "%w do you mean?");
10for each in (target)
11player:tell((tostr(x) + ":  ") + target[x].name);
12x = x + 1;
13endfor
14"dobjstr matched uniquely";
15"try to move the item";
16else
17retval = this:_remove(target[1]);
18if (retval[1] == 0)
19this:tell(retval[2]);
20endif
21endif

can_hold

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"#3:can_hold() this none this";
2"takes OBJ item...returns {1|0, message}";
3item = args[1];
4if (length(this.held) >= this.species.max_held)
5return {0, "You cannot hold any more items."};
6else
7return {1, ""};
8endif

wield

Spec any none noneFlags rwdOwner #10Definer #3

Referenced by

none

Source

1"#3:wield any none none";
2if (player.consciousness != "awake")
3player:tell("You need to be awake to wield.");
4else
5target = player:match(dobjstr, this.held);
6if (target == {})
7player:tell(("You are not holding any %W" + dobjstr) + "%w.");
8elseif (length(target) > 1)
9x = 1;
10player:tell(("Which %W" + dobjstr) + "%w do you mean?");
11for each in (target)
12player:tell((tostr(x) + ":  ") + target[x].name);
13x = x + 1;
14endfor
15"dobjstr matched uniquely";
16"try to wield item";
17else
18retval = this:_wield(target[1]);
19if (retval[1] == 0)
20this:tell(retval[2]);
21endif
22endif
23endif

_wield

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"#3:_wield() this none this";
2"OBJ item, returns {0|1, message}";
3item = args[1];
4hands_used = 0;
5for each in (this.wielded)
6hands_used = hands_used + each.handedness;
7endfor
8if (item in this.wielded)
9return {0, "You are already wielding that item!"};
10elseif (hands_used == this.species.hands)
11return {0, "You cannot wield any more items."};
12elseif ((hands_used + item.handedness) > this.species.hands)
13return {0, "You do not have enough hands free to wield that item."};
14else
15this.wielded = {@this.wielded, item};
16this:tell(("You wield " + item.name) + ".");
17room = setremove(player.location.contents, player);
18audience = {};
19for x in (room)
20if (x:is_a($animate))
21audience = {@audience, x};
22endif
23endfor
24for y in (audience)
25y:sees(3, {((this.name + " wields ") + item.name) + "."});
26endfor
27return {1, ""};
28endif

_unwield

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"#3:_unwield() this none this";
2"OBJ item, returns {0|1, message}";
3item = args[1];
4if (!(item in this.wielded))
5return {0, "You are not wielding that item!"};
6else
7this.wielded = setremove(this.wielded, item);
8this:tell(("You unwield " + item.name) + ".");
9room = setremove(player.location.contents, player);
10audience = {};
11for x in (room)
12if (x:is_a($animate))
13audience = {@audience, x};
14endif
15endfor
16for y in (audience)
17y:sees(3, {((this.name + " unwields ") + item.name) + "."});
18endfor
19return {1, ""};
20endif

unwield

Spec any none noneFlags rwdOwner #10Definer #3

Referenced by

none

Source

1"#3:unwield any none none";
2if (player.consciousness != "awake")
3player:tell("You need to be awake to unwield.");
4elseif (dobjstr == "")
5player:tell("What do you want to unwield?");
6for each in (player.wielded)
7player:tell("  ", each:known_to(player)[2]);
8endfor
9else
10target = player:match(dobjstr, this.held);
11if (target == {})
12player:tell(("You are not holding any %W" + dobjstr) + "%w.");
13elseif (length(target) > 1)
14x = 1;
15player:tell(("Which %W" + dobjstr) + "%w do you mean?");
16for each in (target)
17player:tell((tostr(x) + ":  ") + target[x].name);
18x = x + 1;
19endfor
20"dobjstr matched uniquely";
21"try to wield item";
22else
23retval = this:_unwield(target[1]);
24if (retval[1] == 0)
25this:tell(retval[2]);
26endif
27endif
28endif

carried_weight

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"$animate:carried_weight()";
2if (this.contents == {})
3return 0;
4else
5weight = 0;
6for each in (this.contents)
7weight = weight + each:weight();
8endfor
9return weight;
10endif

str

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"$animate:str() this none this";
2"returns the total str, which includes base plus any modifiers";
3return this.base_str;

dex

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"$animate:dex() this none this";
2"returns the total dex, which includes base plus any modifiers";
3return this.base_dex;

cnc

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"$animate:cnc() this none this";
2"returns the total cnc, which includes base plus any modifiers";
3return this.base_cnc;

int

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"$animate:int() this none this";
2"returns the total int, which includes base plus any modifiers";
3return this.base_int;

con

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"$animate:con() this none this";
2"returns the total con, which includes base plus any modifiers";
3return this.base_con;

chan*nels

Spec any any anyFlags rwdOwner #10Definer #3

Referenced by

none

Source

1"$animate:channel any any any";
2admin = player in $admins;
3designer = player in $architect:descendants();
4dm = player in $dm:descendants();
5if (admin || designer)
6if (!args)
7player:tell("");
8player:tell("%WCurrent channel status:%w");
9player:tell("%b--%B--%c---%C---%W---%C---%c---%B--%b--%w");
10player:tell("");
11if (admin)
12status = ("admin" in player.current_channels) ? " %WON" | " %rOFF";
13admin_l = {};
14for x in ($channels.admin_channel)
15if (("admin" in x.current_channels) && (x in connected_players()))
16admin_l = {@admin_l, x.name};
17endif
18endfor
19player:tell(("%cAdmin channel: " + status) + "%w");
20player:tell("%yListeners: %C" + $utils:list_to_string(admin_l, ", "));
21player:tell("");
22endif
23if (designer)
24status = ("design" in player.current_channels) ? "%WON" | "%rOFF";
25design_l = {};
26for x in ($channels.design_channel)
27if (("design" in x.current_channels) && (x in connected_players()))
28design_l = {@design_l, x.name};
29endif
30endfor
31player:tell(("%cDesign channel: " + status) + "%w");
32player:tell("%yListeners: %C" + $utils:list_to_string(design_l, ", "));
33player:tell("");
34endif
35if (dm)
36status = ("dm" in player.current_channels) ? "    %WON" | "    %rOFF";
37dm_l = {};
38for x in ($channels.dm_channel)
39if (("dm" in x.current_channels) && (x in connected_players()))
40dm_l = {@dm_l, x.name};
41endif
42endfor
43player:tell(("%cDM channel: " + status) + "%w");
44player:tell("%yListeners: %C" + $utils:list_to_string(dm_l, ", "));
45player:tell("");
46endif
47player:tell("%b--%B--%c---%C---%W---%C---%c---%B--%b--%w");
48else
49chan = args[1];
50if (chan in {"adm", "admi", "admin"})
51if (admin)
52if ("admin" in player.current_channels)
53player.current_channels = setremove(player.current_channels, "admin");
54player:tell($channels.admin_prefix + " channel now %rOFF.%w");
55else
56player.current_channels = setadd(player.current_channels, "admin");
57player:tell($channels.admin_prefix + " channel now %WON.%w");
58endif
59else
60player:tell("%WYou must be an Administrator to access the admin channel.%w");
61endif
62elseif (chan in {"des", "desi", "desig", "design"})
63if (designer)
64if ("design" in player.current_channels)
65player.current_channels = setremove(player.current_channels, "design");
66player:tell($channels.design_prefix + " channel now %rOFF.%w");
67else
68player.current_channels = setadd(player.current_channels, "design");
69player:tell($channels.design_prefix + " channel now %WON.%w");
70endif
71else
72player:tell("%WYou must be a Game Designer to access the design channel.%w");
73endif
74elseif (chan == "dm")
75if (dm)
76if ("dm" in player.current_channels)
77player.current_channels = setremove(player.current_channels, "dm");
78player:tell($channels.dm_prefix + " channel now %rOFF.%w");
79else
80player.current_channels = setadd(player.current_channels, "dm");
81player:tell($channels.dm_prefix + " channel now %WON.%w");
82endif
83else
84player:tell("%WYou must be a Dungeon Master to access the DM channel.%w");
85endif
86elseif (chan == "force")
87if (dm)
88target = argstr[length(args[1]) + 2..$];
89if (target)
90player:force_channel(target);
91else
92player:tell("%WForce which channel?  %GAdmin, design, or DM?%w");
93endif
94else
95player:tell("%WOnly DM's can force channels.%w");
96endif
97else
98player:tell("%WNo such channel.%w");
99endif
100endif
101else
102player:tell($bad_command);
103endif

mobility

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"$animate:mobility() this none this";
2"returns the mobility status (str) of animate: mobile, encumbered, burdened, immobile";
3if (this.consciousness == "dead")
4return "immobile";
5else
6cweight = this:carried_weight();
7max_weight = $str_weight_table[this:str()];
8limit = (max_weight * 3) / 2;
9if (cweight < (max_weight / 2))
10return "mobile";
11elseif (cweight < max_weight)
12return "encumbered";
13elseif (cweight < ((limit * 10) / 9))
14return "burdened";
15else
16return "immobile";
17endif
18endif

ac

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"$animate:ac() this none this";
2"calculate base ac";
3bac = this.base_ac;
4for each in (this.worn)
5if (each.base_ac < bac)
6bac = each.base_ac;
7endif
8endfor
9ac = bac + $dex_ac_table[this:dex()];
10"add all the ac modifiers from worn items";
11for each in (this.worn)
12ac = ac + each.ac_mod;
13endfor
14for each in (this.wielded)
15if (each:is_a($shield))
16ac = ac + each.ac_mod;
17endif
18endfor
19if (this.combat_stance == "defend")
20ac = ac - 3;
21elseif (this.combat_stance == "passive")
22ac = ac + 5;
23endif
24return ac;

silent

Spec any any anyFlags rwdOwner #10Definer #3

Referenced by

none

Source

1"$animate:silent any any any";
2if ((player in $admins) || (player in $architect:descendants()))
3player.current_channels = {};
4player:tell("%WAll channels have been toggled %rOFF.%w");
5else
6player:tell($bad_command);
7endif

sc*ore st*atistics stats

Spec none none noneFlags rwdOwner #10Definer #3

Referenced by

none

Source

1"$animate:stats none none none";
2cur_int = player:int();
3base_int = player.base_int;
4cur_str = player:str();
5base_str = player.base_str;
6cur_dex = player:dex();
7base_dex = player.base_dex;
8cur_con = player:con();
9base_con = player.base_con;
10cur_cnc = player:cnc();
11base_cnc = player.base_cnc;
12cur_spd = player:spd();
13base_spd = player.base_spd;
14"calculate weight carried bar";
15cweight = player:carried_weight();
16max_weight = $str_weight_table[cur_str];
17unit = max_weight / 10;
18units_carried = cweight / unit;
19if (units_carried > 10)
20meter = (("%B" + $utils:padr("", 10, "*")) + "%R") + $utils:padr("", units_carried - 10, "*");
21else
22meter = "%B" + $utils:padr("", units_carried, "*");
23endif
24weight_bar = (("%c[" + meter) + $utils:padr("", 15 - units_carried, " ")) + "%c]";
25"calculate strength meter bar";
26str_str = ((((($utils:padl(tostr(cur_str), 2, " ") + " %c[%B") + $utils:padr("", base_str, "*")) + "%g") + $utils:padr("", cur_str - base_str, "*")) + $utils:padr("", 20 - cur_str, " ")) + "%c]";
27"calculate intelligence meter bar";
28int_str = ((((($utils:padl(tostr(cur_int), 2, " ") + " %c[%B") + $utils:padr("", base_int, "*")) + "%g") + $utils:padr("", cur_int - base_int, "*")) + $utils:padr("", 20 - cur_int, " ")) + "%c]";
29"calculate dexterity meter bar";
30dex_str = ((((($utils:padl(tostr(cur_dex), 2, " ") + " %c[%B") + $utils:padr("", base_dex, "*")) + "%g") + $utils:padr("", cur_dex - base_dex, "*")) + $utils:padr("", 20 - cur_dex, " ")) + "%c]";
31"calculate constitution meter bar";
32con_str = ((((($utils:padl(tostr(cur_con), 2, " ") + " %c[%B") + $utils:padr("", base_con, "*")) + "%g") + $utils:padr("", cur_con - base_con, "*")) + $utils:padr("", 20 - cur_con, " ")) + "%c]";
33"calculate concentration meter bar";
34cnc_str = ((((($utils:padl(tostr(cur_cnc), 2, " ") + " %c[%B") + $utils:padr("", base_cnc, "*")) + "%g") + $utils:padr("", cur_cnc - base_cnc, "*")) + $utils:padr("", 20 - cur_cnc, " ")) + "%c]";
35"calculate speed meter bar";
36spd_str = ((((($utils:padl(tostr(cur_spd), 2, " ") + " %c[%B") + $utils:padr("", base_spd, "*")) + "%g") + $utils:padr("", cur_spd - base_spd, "*")) + $utils:padr("", 20 - cur_spd, " ")) + "%c]";
37player:tell("");
38"name, gender, age";
39player:tell(((((((((("%W     " + player.name) + " the ") + player.species.generic_name) + ".   %cGender: %W") + player.gender) + "%c      You are %W") + tostr(player.age / 365)) + "%c years and %W") + tostr(player.age % 365)) + "%c days old.");
40"status: position, mobility, consciousness, combat stance";
41player:tell((((((("%W      You are " + player.position) + " ") + player.consciousness) + ", ") + player:mobility()) + ".    %cCombat Stance: %W") + player.combat_stance);
42weight_str = $utils:padr(tostr(player.base_weight) + " lbs.", 28, " ");
43player:tell((("%c      Weight: %W" + weight_str) + "%cStrength: %W") + str_str);
44height_str = $utils:padr(((tostr(player.height / 12) + "' ") + tostr(player.height % 12)) + "\"", 24, " ");
45player:tell((("%c      Height: %W" + height_str) + "%cIntelligence: %W") + int_str);
46"weight carried meter";
47player:tell(((((("%c    Carrying: %W" + tostr(cweight)) + "%c lbs.") + weight_bar) + $utils:padr("", 5 - length(tostr(cweight)), " ")) + "%cDexterity: %W") + dex_str);
48"hit points and Armor class";
49hp_str = "%c  Hit Points: %W" + $utils:padr((tostr(player.cur_hp) + "%c/%W") + tostr(player:max_hp()), 28, " ");
50ac_str = "%c Armor Class: %W" + $utils:padr(tostr(player:ac()), 23, " ");
51end_foc_str = "%c   Endurance: %W" + $utils:padr((((((tostr(player.cur_endurance) + "%c/%W") + tostr(player:max_endurance())) + "%c  Focus: %W") + tostr(player.cur_focus)) + "%c/%W") + tostr(player:max_focus()), 43, " ");
52player:tell((hp_str + "%cConstitution: %W") + con_str);
53player:tell((ac_str + "%cConcentration: %W") + cnc_str);
54player:tell((end_foc_str + "%cSpeed: %W") + spd_str);
55"thaco, damage modifiers";
56"effects";
57player:tell("");
58"create path strings";
59path_names = {};
60path_strs = {};
61num_paths = length(this.paths) / 2;
62for x in [1..length(this.paths)]
63if (typeof(this.paths[x]) == OBJ)
64path_names = {@path_names, this.paths[x]};
65endif
66endfor
67path_names = $utils:sort(path_names);
68for path in (path_names)
69path_val = this:path_value(path);
70path_str = (((((("%c" + $utils:padl(path.name, 20, " ")) + ": %W") + $utils:padl(tostr(path_val), 2, " ")) + "%c [%Y") + $utils:padl("", path_val, "*")) + $utils:padr("", 10 - path_val, " ")) + "%c]";
71path_strs = {@path_strs, path_str};
72endfor
73"skills and stuff";
74skill_names = {};
75num_skills = length(this.skills) / 2;
76for x in [1..length(this.skills)]
77if (typeof(this.skills[x]) == STR)
78skill_names = {@skill_names, this.skills[x]};
79endif
80endfor
81x = 1;
82skill_names = $utils:sort(skill_names);
83for skill in (skill_names)
84skill_val = this:skill_value(skill);
85skillstr = (((((("%c" + $utils:padl(strsub(skill, "_", " "), 20, " ")) + ": %W") + $utils:padl(tostr(skill_val), 2, " ")) + "%c [%Y") + $utils:padl("", skill_val, "*")) + $utils:padr("", 10 - skill_val, " ")) + "%c]";
86player:tell(skillstr + ((x > length(path_strs)) ? "" | path_strs[x]));
87x = x + 1;
88endfor

_say

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"$animate:_say this none this";
2speech = args[1];
3lang = this.current_language;
4audience = setremove(this.location:get_animates(), this);
5for y in (audience)
6name = this:known_to(y)[2];
7cname = $utils:capitalize(name);
8heard = ((("%C" + cname) + " says, \"") + speech) + "%C\"%w";
9partial = ("You hear " + name) + " speak but you can't make out the words.";
10deaf = ("You see " + name) + "'s lips move, but you hear nothing.";
11l_heard = ((("%C" + cname) + " says something in ") + lang.name) + ".%w";
12first = {heard, partial, deaf};
13second = {l_heard, partial, deaf};
14"Deaf players have a 25% chance of noticing that someone spoke.";
15chance = (y.base_hear < 2) ? random(4) | 1;
16if (chance == 1)
17y:hears(3, first, lang, second);
18endif
19endfor
20speech_echo = ("%CYou say, \"" + speech) + "%C\"%w";
21this:tell(speech_echo);

afk away

Spec any any anyFlags rwdOwner #10Definer #3

Referenced by

none

Source

1"$animate:afk any any any";
2group = setremove(player.location.contents, player);
3if (player.afk)
4player.afk = 0;
5player:tell("%yYou are no longer %W[Away From Keyboard]%w");
6for x in (group)
7x:tell(("%y" + player.name) + " is no longer %W[Away From Keyboard]%w");
8endfor
9else
10player.afk = 1;
11player:tell("%GYou are now %W[Away From Keyboard]%w");
12for x in (group)
13x:tell(("%G" + player.name) + " is now %W[Away From Keyboard]%w");
14endfor
15endif

skill_value

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"$animate:skill_value( STR ) this none this";
2"returns the skill value for skill named STR";
3{skill_name} = args;
4loc = skill_name in this.skills;
5if (loc == 0)
6return 0;
7else
8value = this.skills[loc + 1];
9return value;
10endif

att*ack

Spec any none noneFlags rwxdOwner #10Definer #3

Referenced by

none

Source

1"$animate:attack any none none";
2"sets combat stance to attack, optionally initiates combat with target";
3targstr = argstr;
4if (player.consciousness != "awake")
5player:tell("You must be awake to attack!");
6elseif (targstr == "")
7if (this.combat_stance == "attack")
8this:tell("You are already in an attack posture.");
9else
10this:set_combat_stance("attack");
11endif
12else
13this:set_combat_stance("attack");
14"match the target";
15target = dobjstr;
16"build list of candidates to which to match";
17items = player.location.contents;
18matches = player:match(target, items);
19if (matches == {})
20player:tell(("There is no %W" + dobjstr) + "%w here.");
21else
22targobj = matches[1];
23if (targobj:is_a($animate))
24"is target dead already?";
25if (targobj.consciousness == "dead")
26player:tell("That target is already dead!");
27else
28player:_attack(targobj);
29endif
30else
31player:tell(((("You cannot attack " + targobj.gprep) + " ") + targobj.generic_name) + "!");
32endif
33endif
34endif

set_combat_stance

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"$animate:set_combat_stance() this none this";
2{posture} = args;
3if (posture == "attack")
4this.combat_stance = "attack";
5this:tell("You assume an attack posture, ready for combat.");
6return 1;
7elseif (posture == "defend")
8this.combat_stance = "defend";
9this:tell("You shift to a defensive posture, and are less vulnerable to attacks.");
10return 1;
11elseif (posture == "flee")
12this.combat_stance = "flee";
13this:tell("You shift to a fleeing posture, and will run at the first sign of battle.");
14return 1;
15elseif (posture == "passive")
16this.combat_stance = "passive";
17this:tell("You assume a passive combat stance, and are more vulnerable to attacks.");
18return 1;
19else
20return 0;
21endif

def*end

Spec none none noneFlags rwdOwner #10Definer #3

Referenced by

none

Source

1"$animate:defend none none none";
2if (this.combat_stance == "defend")
3this:tell("You are already in a defensive posture.");
4else
5this:set_combat_stance("defend");
6endif

flee

Spec any none noneFlags rwdOwner #10Definer #3

Referenced by

none

Source

1"$animate:flee any none none";
2targstr = argstr;
3if (targstr == "")
4if (this.combat_stance == "flee")
5this:tell("You are already set to flee from combat.");
6else
7this:set_combat_stance("flee");
8endif
9else
10this:tell("You are currently not in combat with anyone.");
11endif

passive

Spec none none noneFlags rwdOwner #10Definer #3

Referenced by

none

Source

1"$animate:passive none none none";
2if (this.combat_stance == "passive")
3this:tell("You are already in a passive combat stance.");
4else
5this:set_combat_stance("passive");
6endif

info*rmation

Spec any any anyFlags rwdOwner #10Definer #3

Referenced by

none

Source

1"$animate:info any any any";
2"Only known players are available for info.";
3player:tell("");
4targ = 0;
5if (argstr)
6known = argstr in player.known_players;
7if (known)
8targ = player.known_players[known - 1];
9if (player in $admins)
10"Give admins the raw name.";
11name = targ.name;
12else
13name = player.known_players[known];
14endif
15else
16"Check to see if target is a special case.";
17"Or if player is an Admin and therefore gets info on anyone.";
18match = $utils:match(argstr, players(), 1, 1);
19if (match != {})
20matchobj = match[1];
21if ((matchobj in {@$architect:descendants(), @$admins, player}) || (player in $admins))
22targ = matchobj;
23name = matchobj.name;
24endif
25endif
26endif
27else
28player:tell("%WGet information on which player?%w");
29return;
30endif
31if (targ != 0)
32pronoun = $utils:capitalize(#0.(targ.gender)[2]);
33player:tell("%WAvailable Information:");
34player:tell("----------------------");
35player:tell("%gName    : %G" + name);
36player:tell("%gSpecies : %G" + $utils:capitalize(targ.species.generic_name));
37player:tell("%gGender  : %G" + targ.gender);
38design = parent(targ) in {$dm, $coder, $architect};
39if (design)
40title = {"a Dungeon Master", "a Coder", "an Architect"}[design];
41player:tell(((("%W" + pronoun) + " is ") + title) + ".");
42endif
43if (targ in $admins)
44player:tell(("%Y" + pronoun) + " is an Administrator.");
45endif
46if (targ in connected_players())
47"Connected;  show idle time.";
48player:tell((("%y" + pronoun) + " has been idle for ") + $utils:dhms_str($utils:dhms(idle_seconds(targ))));
49if (targ.afk)
50"AFK.";
51player:tell(("%B" + pronoun) + " is currently Away From Keyboard.");
52endif
53else
54"Not connected.";
55time = (targ.last_connected == "never") ? " has never been connected." | ((" was last connected on " + targ.last_connected) + ".");
56player:tell(("%c" + pronoun) + time);
57endif
58player:tell("%W----------------------%w");
59else
60player:tell("%WYou know of no such player.%w");
61endif

raise_hp

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

none

Source

1"$animate:raise_hp( int ) this none this";
2"raises $animates hit points by int, no higher than :max_hp()";
3{hps} = args;
4if (this.consciousness == "dead")
5return 0;
6else
7newhp = this.cur_hp + hps;
8maxhp = this:max_hp();
9this.cur_hp = (newhp > maxhp) ? maxhp | newhp;
10return this.cur_hp;
11endif

lower_hp

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"$animate:lower_hp( int ) this none this";
2"lowers $animates hit points by int, no lower than -10";
3{hps} = args;
4"this animate is already dead...";
5if (this.cur_hp == -10)
6this:tell("You enemies continue to attack your dead corpse!");
7else
8newhp = this.cur_hp - hps;
9this.cur_hp = (newhp < -10) ? -10 | newhp;
10if ((this.cur_hp < 1) && (this.cur_hp > -10))
11viewers = this.location:get_animates();
12viewers = setremove(viewers, this);
13for each in (viewers)
14each:sees(3, {this:known_to(each)[2] + " falls to the ground, unconscious."});
15endfor
16this:tell("You fall to the ground, unconscious.");
17this.consciousness = "unconscious";
18this.combat_stance = "passive";
19this.position = "lying";
20"stop people from auto attacking";
21for each in (this.targets)
22each.targets = setremove(each.targets, this);
23endfor
24this.targets = {};
25"stop unconscious guy from attempting to attack anymore";
26this.location.combatants = setremove(this.location.combatants, this);
27elseif (this.cur_hp == -10)
28viewers = this.location:get_animates();
29viewers = setremove(viewers, this);
30for each in (viewers)
31each:sees(3, {this:known_to(each)[2] + " has BEEN KILLED!!!"});
32endfor
33this:tell("You have BEEN KILLED!!!");
34this.consciousness = "dead";
35this.combat_stance = "passive";
36this.position = "lying";
37"stop people from auto attacking";
38for each in (this.targets)
39each.targets = setremove(each.targets, this);
40endfor
41this.targets = {};
42"stop dead guy from attempting to attack anymore";
43this.location.combatants = setremove(this.location.combatants, this);
44endif
45endif

hit

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

none

Source

1"$animate:hit() this none this";
2"selects a wielded weapon, makes hit roll,";
3" if success, makes dam roll, sends messages.";
4{target} = args;
5hit_success = 0;
6critical_hit = 0;
7critical_hit_str = $combat.hit_color;
8skill_thac0_bonus = 0;
9skill_dam_bonus = 0;
10"set up weapon info";
11weapon = this:get_weapon();
12if (weapon == 0)
13weapon_max_dam = this.species.max_dam;
14weapon_min_dam = this.species.min_dam;
15weapon_skill_type = "none";
16weapon_generic_name = "fist";
17weapon_thac0 = 0;
18else
19weapon_max_dam = weapon.max_dam;
20weapon_min_dam = weapon.min_dam;
21weapon_skill_type = weapon.skill_type;
22weapon_generic_name = weapon.generic_name;
23weapon_thac0 = weapon.thac0;
24endif
25hit_roll = random(20);
26"a roll of 1 always misses";
27if (hit_roll == 1)
28hit_success = 0;
29elseif (hit_roll == 20)
30hit_success = 1;
31critical_hit = 1;
32else
33mod_roll = (((hit_roll + target:ac()) + weapon_thac0) + skill_thac0_bonus) + $dex_thac0_table[this:dex()];
34if (mod_roll >= $combat.base_thac0)
35hit_success = 1;
36endif
37endif
38if (loc = weapon_skill_type in this.skills)
39skill_thac0_bonus = this.skills[loc + 1] / 2;
40skill_dam_bonus = this.skills[loc + 1];
41endif
42if (hit_success)
43"you hit!";
44"calc damage";
45dam_var = (weapon_max_dam - weapon_min_dam) + 1;
46dam = (((random(dam_var) + weapon_min_dam) - 1) + skill_dam_bonus) + $str_dam_table[this:str()];
47if (critical_hit)
48dam = (dam * 3) / 2;
49critical_hit_str = $combat.crit_color + "Critical Hit!  ";
50endif
51this:tell(((((critical_hit_str + "You hit ") + target:known_to(this)[2]) + " (") + tostr(dam)) + ").%w");
52target:tell((((((((critical_hit_str + this:known_to(target)[2]) + " hits you with ") + #0.(this.gender)[5]) + " ") + weapon_generic_name) + " (") + tostr(dam)) + ").%w");
53viewers = this.location:get_animates();
54viewers = setremove(viewers, target);
55viewers = setremove(viewers, this);
56for each in (viewers)
57each:sees(3, {((((((this:known_to(each)[2] + " hits ") + target:known_to(each)[2]) + " with ") + #0.(this.gender)[5]) + " ") + weapon_generic_name) + ".%w"});
58endfor
59"dish out the damage";
60target:damage("dorking", dam);
61else
62"you missed :(";
63this:tell((($combat.miss_color + "You miss ") + target:known_to(this)[2]) + ".%w");
64target:tell(((((($combat.miss_color + this:known_to(target)[2]) + " misses you with ") + #0.(this.gender)[5]) + " ") + weapon_generic_name) + ".%w");
65viewers = this.location:get_animates();
66viewers = setremove(viewers, target);
67viewers = setremove(viewers, this);
68for each in (viewers)
69each:sees(3, {((((((this:known_to(each)[2] + " misses ") + target:known_to(each)[2]) + " with ") + #0.(this.gender)[5]) + " ") + weapon_generic_name) + ".%w"});
70endfor
71endif

emote

Spec any any anyFlags rwdOwner #10Definer #3

Referenced by

none

Source

1if (argstr)
2this:_emote(argstr);
3else
4this:tell("Emote what?");
5endif

get_target

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

none

Source

1"$animate:get_target() this none this";
2"returns a random target from targets list";
3num_targs = length(this.targets);
4if (num_targs)
5return this.targets[random(num_targs)];
6else
7return 0;
8endif

spd

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"$animate:spd() this none this";
2"returns the total spd, which includes base plus any modifiers";
3return this.base_spd;

init_roll

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

none

Source

1"$animate:init_roll( weapon ) this none this";
2"to make this unconfusing, we will ADD everything";
3"1-6 plus dex_init, plus position, effects (sneak, etc.)";
4"plus spd_init, endurance, mobility, PLUS weapon speed factor";
5{weapon} = args;
6spd_init = $spd_init_table[this:spd()];
7dex_init = $dex_init_table[this:dex()];
8if (weapon == 0)
9weapon_spd = 0;
10else
11weapon_spd = weapon.speed_factor;
12endif
13if (this.position == "standing")
14pos = 0;
15elseif (this.position == "kneeling")
16pos = 1;
17elseif (this.position == "sitting")
18pos = 2;
19elseif (this.position == "lying")
20pos = 4;
21endif
22mobility = this:mobility();
23if (mobility == "mobile")
24mob = 0;
25elseif (mobility == "encumbered")
26mob = 2;
27elseif (mobility == "burdened")
28mob = 4;
29elseif (mobility == "immobile")
30mob = 6;
31endif
32init_roll = ((((random(6) + spd_init) + dex_init) + pos) + mob) + weapon_spd;
33return init_roll;

_attack

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"$animate:_attack( target ) this none this";
2{target} = args;
3if (target == this)
4this:tell("Suicide option not enabled.");
5elseif (target in this.targets)
6this:tell(("You are already fighting with " + target:known_to(this)[2]) + ".");
7else
8this.targets = setadd(this.targets, target);
9target.targets = setadd(target.targets, this);
10this.location.combatants = setadd(this.location.combatants, this);
11this.location.combatants = setadd(this.location.combatants, target);
12"start the fight";
13if (!this.location.combat_pid)
14fork pid (2)
15$combat:battle(this.location);
16endfork
17this.location.combat_pid = pid;
18endif
19endif

show_eq*uipment

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

none

Source

1"$animate:show_eq*uipment() this none this";
2{?target = this} = args;
3for x in (this.species.max_worn)
4if (typeof(x) == STR)
5for item in (this.worn)
6if (item.where == x)
7target:tell($utils:padr(("  %C<" + x) + ">%W", 20, " ") + item.name);
8endif
9endfor
10endif
11endfor

show_inv*entory

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

none

Source

1"$animate:show_inv*entory() this none this";
2{?target = this} = args;
3weapons = {};
4items = {};
5for xobj in (this.held)
6if (xobj in this.wielded)
7weapons = {@weapons, xobj};
8else
9items = {@items, xobj};
10endif
11endfor
12for weapon in (weapons)
13target:tell(("%W  " + weapon.name) + "%R  <wielded>%w");
14endfor
15for item in (items)
16target:tell("%W  " + item.name);
17endfor

max_endurance

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"#3:max_endurance() this none this";
2base = this.base_endurance;
3max_end = (base + ((base * $str_end_table[this:str()]) / 100)) + ((base * $con_end_table[this:con()]) / 100);
4return max_end;

max_focus

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1return this.base_focus;

damage

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

none

Source

1"$animate:damage() this none this";
2{type, quantity} = args;
3this:lower_hp(quantity);

lower_endurance

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"$animate:lower_endurance( int ) this none this";
2"lowers $animates endurance points by int, no lower than 0";
3{points} = args;
4newend = this.cur_endurance - points;
5this.cur_endurance = (newend < 0) ? 0 | newend;

cast

Spec any any anyFlags rwdOwner #10Definer #3

Referenced by

none

Source

1"$animate:cast() any any any";
2spellname = dobjstr;
3prep = prepstr;
4targetname = iobjstr;
5can_cast = 0;
6highest_path = "";
7path_val = 0;
8high_path_val = 0;
9if (player.consciousness != "awake")
10player:tell("You must be awake to cast!");
11return 0;
12elseif (spellname == "")
13this:tell("Cast what spell?");
14return 0;
15elseif (prep != "")
16if ((targetname == "") || (!is_member(prep, {"on", "at"})))
17this:tell("Syntax:  cast <spellname> [at | on <target>]");
18return 0;
19endif
20endif
21"match spell name";
22spell = $utils:match(spellname, children($spell));
23"match target in room";
24if (targetname != "")
25target = this:match(targetname, this.location.contents);
26else
27target = {#-1};
28endif
29"spell uniquely matched";
30if (length(spell) == 1)
31"target uniquely matched or no target specified";
32if (length(target) == 1)
33"can this cast the spell?";
34for each in (this.paths)
35if (typeof(each) == OBJ)
36path_val = this:path_value(each);
37if ((spell[1] in each.common_spells) && (path_val > 0))
38can_cast = 1;
39path_val = this:path_value(each);
40if (path_val > high_path_val)
41high_path_val = path_val;
42highest_path = each;
43endif
44endif
45endif
46endfor
47"cast the spell, subtract costs";
48if (can_cast)
49end_cost = spell[1].endurance_cost;
50net_end_cost = end_cost - ((end_cost * (high_path_val * 8)) / 100);
51if (this.cur_endurance < net_end_cost)
52this:tell("You do not have enough endurance to cast that spell.");
53else
54foc_cost = spell[1].focus_cost;
55net_foc_cost = foc_cost - ((foc_cost * (high_path_val * 8)) / 100);
56if (this.cur_focus < net_foc_cost)
57this:tell("You do not have enough focus to cast that spell.");
58else
59"lower endurance";
60this:lower_endurance(net_end_cost);
61"lower focus";
62this:lower_focus(net_foc_cost);
63result = spell[1]:invoke(this, target[1]);
64if (result != 0)
65if (result[1] == 0)
66this:tell(result[2]);
67endif
68endif
69endif
70endif
71else
72this:tell("You cannot cast that spell.");
73endif
74"ambiguous target";
75elseif (length(target) > 1)
76this:tell(((("Cast " + spell[1].generic_name) + " ") + prep) + " which?");
77for each in (target)
78this:tell("  " + each.name);
79endfor
80"no target matched";
81elseif (length(target) == 0)
82this:tell(("There is no %W" + targetname) + "%w here.");
83endif
84elseif (length(spell) > 1)
85this:tell("Cast which spell?");
86for each in (spell)
87this:tell("  " + each.generic_name);
88endfor
89elseif (length(spell) == 0)
90this:tell("You cannot cast that SPELL.");
91endif

set_disconnect_info

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"$animate:set_disconnect_info this none this";
2"set $max_connected if applicable";
3curlen = length(connected_players());
4if (curlen >= $max_connected[1])
5$max_connected = {curlen, time()};
6endif
7"set player's last connect time and set afk to 0.";
8this.last_connected = $utils:ftime(ctime());
9this.afk = 0;

path_value

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"$animate:path_value( OBJ ) this none this";
2"returns the path value for path OBJ";
3{path_name} = args;
4loc = path_name in this.paths;
5if (loc == 0)
6return 0;
7else
8value = this.paths[loc + 1];
9return value;
10endif

lower_focus

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"$animate:lower_focus( int ) this none this";
2"lowers $animates focus points by int, no lower than 0";
3{points} = args;
4newfoc = this.cur_focus - points;
5this.cur_focus = (newfoc < 0) ? 0 | newfoc;

known_to

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"$animate:known_to this none this";
2"Dungeon Masters, Game Designers (archs, coders), Admins, and self are known to everyone.";
3"Everyone is known to Admins.";
4targ = args[1];
5bool = 0;
6always = {@$architect:descendants(), @$admins};
7if (valid(targ))
8if (((this in always) || (targ in $admins)) || (targ == this))
9bool = 1;
10name = this.name;
11else
12"Check known_players.";
13x = this in targ.known_players;
14if (x)
15bool = 1;
16name = targ.known_players[x + 1];
17endif
18endif
19endif
20if (bool == 0)
21prep = this.species.gprep;
22spec = " " + this.species.adj;
23gend = " " + #0.(this.gender)[1];
24name = (prep + spec) + gend;
25endif
26answer = {bool, name};
27return answer;

admins

Spec any any anyFlags rwdOwner #10Definer #3

Referenced by

none

Source

1"$animate:admins any any any";
2cp = connected_players();
3conn = {};
4ncon = {};
5cnames = {};
6nnames = {};
7for x in ($admins)
8if (x in cp)
9conn = {@conn, x};
10cnames = {@cnames, x.name};
11else
12ncon = {@ncon, x};
13nnames = {@nnames, x.name};
14endif
15endfor
16names = {@cnames, @nnames};
17idle = {};
18for y in (conn)
19idle = {@idle, idle_seconds(y)};
20endfor
21oidle = $utils:sort(idle);
22pairs = {};
23for z in (oidle)
24pairs = {@pairs, {cnames[z in idle], z}};
25endfor
26pad = $utils:longest(names);
27player:tell("");
28if (!conn)
29player:tell("%YThere are no administrators currently connected.");
30else
31player:tell("%YCurrently Connected Administrators");
32player:tell("----------------------------------%y");
33for x in (pairs)
34name = $utils:padr(x[1], pad, " ");
35itime = $utils:dhms_str($utils:dhms(x[2]));
36player:tell((name + "  %W=>%y  idle ") + itime);
37endfor
38endif
39if (ncon)
40player:tell("");
41player:tell("%YNot Connected");
42player:tell("-------------%c");
43for y in (ncon)
44player:tell(y.name);
45endfor
46endif
47player:tell("%w");

_emote

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"$animate:_emote this none this";
2text = args[1];
3if (text[1] in {" ", "'", ":", "!", "?", ",", "."})
4space = "";
5else
6space = " ";
7endif
8viewers = this.location:get_animates();
9for each in (viewers)
10name = $utils:capitalize(this:known_to(each)[2]);
11each:sees(3, {(name + space) + text});
12endfor

raise_endurance

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

none

Source

1"$animate:raise_endurance( int ) this none this";
2"raises $animates endurance points by int, no higher than :max_end()";
3{end} = args;
4if (this.consciousness == "dead")
5return 0;
6else
7newend = this.cur_endurance + end;
8maxend = this:max_endurance();
9this.cur_endurance = (newend > maxend) ? maxend | newend;
10return this.cur_endurance;
11endif

raise_focus

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

none

Source

1"$animate:raise_focus( int ) this none this";
2"raises $animates focus points by int, no higher than :max_focus()";
3{foc} = args;
4if (this.consciousness == "dead")
5return 0;
6else
7newfoc = this.cur_focus + foc;
8maxfoc = this:max_focus();
9this.cur_focus = (newfoc > maxfoc) ? maxfoc | newfoc;
10return this.cur_focus;
11endif

sp*eak

Spec any any anyFlags rwdOwner #10Definer #3

Referenced by

none

Source

1"$animate:sp*eak any any any";
2known = this.known_languages;
3cur = this.current_language;
4others = setremove(known, cur);
5if (!args)
6this:tell(("%WYou are currently speaking " + cur.name) + ".");
7if (others)
8names = {};
9for x in (others)
10names = {@names, x.name};
11endfor
12this:tell(("%yYou also know " + $utils:list_to_string(names, ", ", "and")) + ".%w");
13endif
14else
15outcome = this:_speak(args[1]);
16this:tell(outcome[2]);
17endif

_speak

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"$animate:_speak this none this";
2langstr = args[1];
3known = this.known_languages;
4matchlist = $utils:match(langstr, known);
5if (!matchlist)
6msg = "%WYou know no such language.%w";
7result = 0;
8else
9if (length(matchlist) > 1)
10names = {};
11for x in (matchlist)
12names = {@names, x.name};
13endfor
14msg = ("Which language are you referring to?  " + $utils:list_to_string(names, ", ", "or")) + "?";
15result = 0;
16else
17this.current_language = matchlist[1];
18msg = ("%GYou are now speaking " + this.current_language.name) + ".%w";
19result = 1;
20endif
21endif
22return {result, msg};

match

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"#3:match(str, objlist) - returns a list of objs from args[2] that";
2"are known to this or aliased to args[1]. if no match, returns empty list.";
3{token, objlist} = args;
4"here and me";
5if (token == "here")
6return {this.location};
7elseif (token == "me")
8return {this};
9else
10count = 0;
11count_and_item = $utils:parse_dot_ref(token);
12if (count_and_item)
13{count, item} = count_and_item;
14endif
15if (count > 0)
16token = item;
17endif
18matchlist = {};
19for each in (objlist)
20if (!(each in matchlist))
21doesmatch = 0;
22names = {each:known_to(this)[2], @each.aliases};
23for name in (names)
24doesmatch = doesmatch || (index(name, token) == 1);
25endfor
26if (doesmatch)
27matchlist = {@matchlist, each};
28endif
29endif
30endfor
31if (count == 0)
32return matchlist;
33elseif (count <= length(matchlist))
34return {matchlist[count]};
35else
36return {};
37endif
38endif

get_weapon

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"#3:get_weapon() this none this - returns a random wield weapon on this";
2"if no wielded weapon, then returns 0";
3weapons = {};
4for each in (this.wielded)
5if (each:is_a($weapon))
6weapons = {@weapons, each};
7endif
8endfor
9num_weapons = length(weapons);
10if (num_weapons == 0)
11return 0;
12else
13return weapons[random(num_weapons)];
14endif

go

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"$animate:go ( list ) this none this";
2"list of strs matching direction to move in";
3{dirlist} = args;
4if (this.consciousness != "awake")
5this:tell("You cannot move...you are ", this.consciousness, "!");
6else
7dir = this.location:match_exit(dirlist[1]);
8if (valid(dir))
9if (this in this.location.combatants)
10this:tell("You are engaged in battle!  Use the %Wflee%w command to escape.");
11elseif (this.cur_endurance == 0)
12this:tell("You are too exhausted to move any further!");
13else
14cur_loc = this.location;
15dir:invoke(this);
16for each in (this.form_members)
17if (each.location == cur_loc)
18dir:invoke(each);
19endif
20endfor
21if (length(dirlist) > 1)
22dirlist = dirlist[2..$];
23fork (1)
24this:go(dirlist);
25endfork
26endif
27endif
28elseif (dir == $failed_match)
29this:tell("You can't go that way.");
30else
31this:tell("I don't know which direction `", dir, "' you mean.");
32endif
33endif

_get

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"$animate:_get(dobj, iobj)";
2" e.g. first arg is object that you are getting, second arg is where you are getting it from.";
3{target, targ_loc} = args;
4retval = target:move_to(this);
5if (retval[1] == 1)
6this:tell(((("You get " + target.name) + " from ") + targ_loc.name) + ".");
7else
8this:tell(retval[2]);
9endif

_put

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"$animate:_put(dobj, iobj)";
2" e.g. first arg is object that you are putting, second arg is where you are putting it";
3{target, targ_dest} = args;
4retval = target:move_to(targ_dest);
5if (retval[1] == 1)
6this.held = setremove(this.held, target);
7this:_unwield(target);
8this:tell(((("You put " + target.name) + " into ") + targ_dest.name) + ".");
9else
10this:tell(retval[2]);
11endif

height_str

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

none

Source

1"$animate_class:height_str this none this";
2height_str = ((tostr(this.height / 12) + "' ") + tostr(this.height % 12)) + "\"";
3return height_str;

form

Spec any any anyFlags rwdOwner #10Definer #3

Referenced by

none

Source

1"$animate:form any any any";
2"form <charname> [<position>] - puts char in a formation with animate.";
3"form - lists form members.";
4{?target = "", ?position = "1"} = args;
5if (target == "")
6if (player.leader == 0)
7player:tell("You are not currently a member of a formation.");
8else
9player:tell("%YMembers of your formation:");
10player:tell("  %W", player.leader:known_to(player)[2], " %W(leader)");
11for each in (player.leader.form_members)
12player:tell("  ", each:known_to(player)[2]);
13endfor
14endif
15"check to see if your leader is yourself, or if you have no leader.";
16"if you have no leader, then you are not a member of a form, and can add members.";
17"if you are your own leader, then you are the leader of a form, and can add members.";
18elseif ((player.leader != player) && (player.leader != 0))
19player:tell("You are not the leader of your formation, and can't add new members.");
20else
21"target is specified, you are the leader or formless";
22"max form size is six";
23if (length(player.form_members) == 5)
24player:tell("Your formation already has six members.  You can't add any more.");
25else
26targslist = player:match(target, player.location:get_animates());
27if (length(targslist) > 1)
28player:tell_ambiguous(target, targslist);
29elseif (length(targslist) == 0)
30player:tell("There is no player named ", target, " here.");
31elseif (is_player(targslist[1]))
32"target is a valid player in this room known by player";
33new_member = targslist[1];
34"if you are trying to form yourself";
35if (new_member == player)
36player:tell("You can't add yourself to your formation!  You are already in it!");
37"new_member is already in a formation";
38elseif (new_member.leader != 0)
39player:tell("That player is already a member of a formation.");
40"any more objections?";
41"if new member is not currently connected, they cant join.";
42elseif (!(new_member in connected_players()))
43player:tell("That player is currently disconnected, and can't join your formation.");
44else
45"ask the new member if they want to join.";
46new_member:tell(player:known_to(new_member)[2], " has asked you to join ", #0.(player.gender)[5], " formation.  Would you like to join? (yes/NO)");
47player:tell("You ask ", new_member:known_to(player)[2], " to join your formation.");
48answer = read(new_member);
49if ((length(answer) > 0) && ((answer[1] == "y") || (answer == "yes")))
50"add to formation";
51player:_form(new_member);
52else
53player:tell(new_member:known_to(player)[2], " refused your offer to join your formation.");
54endif
55endif
56else
57player:tell("That item is not a player!  You can't add it to your formation.");
58endif
59endif
60endif

tell_ambiguous

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"$animate:tell ambiguous this none this";
2"takes a str and a list of objects, prints out the known_to strings for each obj";
3"with numbers for dot matching";
4{objstr, objlist} = args;
5x = 1;
6this:tell(("Which %W" + objstr) + "%w do you mean?");
7for each in (objlist)
8this:tell((tostr(x) + ":  ") + objlist[x]:known_to(this)[2]);
9x = x + 1;
10endfor

_unform

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"$animate:_unform() this none this";
2"allows you to unform a player programmatically, like during a disconnect or whatever.";
3if (this != this.leader)
4this.leader.form_members = setremove(this.leader.form_members, this);
5"check to see if this is the last guy out of the party";
6if (length(this.leader.form_members) == 0)
7this.leader.leader = 0;
8endif
9this:tell("You are no longer a member of ", this.leader:known_to(this)[2], "'s formation.");
10this.leader:tell(this:known_to(this.leader)[2], " has left your formation!  Traitor!");
11for each in (this.leader.form_members)
12each:tell(this:known_to(each)[2], " has left the formation!");
13endfor
14this.leader = 0;
15elseif (this == this.leader)
16"disband the formation";
17for each in (this.form_members)
18each:_unform();
19endfor
20this.leader = 0;
21endif

unform

Spec any none noneFlags rwdOwner #10Definer #3

Referenced by

none

Source

1"$animate:unform any any any";
2"unform <charname> - if leader, removes <charname> from form.";
3"unform - removes you from current formation.";
4"unform all - if leader, disbands the group.";
5{?target = ""} = args;
6if (target == "")
7"you have no leader";
8if (player.leader == 0)
9player:tell("You are not a member of a formation.");
10elseif (player.leader == player)
11player:tell("Unform who?");
12elseif (player.leader != player)
13player:_unform();
14endif
15elseif (target == "all")
16player:_unform();
17player:tell("You disband the entire party!");
18else
19who = player:match(target, player.form_members);
20if (length(who) > 1)
21player:tell_ambiguous("target", who);
22elseif (length(who) == 0)
23player:tell("There is no ", target, " in your formation.");
24else
25who[1]:_unform();
26endif
27endif

_form

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"$animate:_form this none this";
2"allows you to programmatically add members to someone's formation";
3"leader:form(new_member)";
4{new_member} = args;
5this.form_members = {@this.form_members, new_member};
6this.leader = this;
7new_member.leader = this;
8new_member:tell("You are now a member of ", this:known_to(new_member)[2], "'s formation.");
9this:tell(new_member:known_to(this)[2], " is now a member of your formation.");
10for each in (this.form_members)
11each:tell(new_member:known_to(each)[2], " has joined the formation!");
12endfor

open

Spec any any anyFlags rwdOwner #10Definer #3

Referenced by

none

Source

1"$animate:open any any any";
2if (!args)
3this:tell("%cOpen what?%w");
4else
5this:_open(@args);
6endif

_open

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"$animate:_open this none this";
2"Use animate's match function so that known_to works.";
3stuff = {@this.location.exits, @this.location.contents, @this.contents};
4targ = this:match(args[1], stuff);
5if (targ == {})
6this:tell("%cThere is no such item here.%w");
7elseif (length(targ) > 1)
8this:tell_ambiguous(tostr(args[1]), targ);
9else
10"Ok, single match.  Now find out if it's an exit or door.";
11"Containers will be in here too.";
12what = targ[1];
13if (what:is_a($container))
14this:tell("%cContainers can't be opened yet.%w");
15elseif (!what:is_a($exit))
16this:tell("%cYou cannot open that.%w");
17else
18if (!what.door)
19this:tell("%cThis exit has no door.%w");
20else
21"Ok, it's a door.";
22door = what;
23if (door.open)
24this:tell("%cThe door is already open.%w");
25else
26"Is it functional?";
27if (!door.functional)
28msg = door.func_msg ? door.func_msg | "This door is not functional.";
29this:tell(("%c" + msg) + "%w");
30else
31"Is it locked?";
32if (door.locked)
33msg = door.locked_msg ? door.locked_msg | "It's locked.";
34this:tell(("%c" + msg) + "%w");
35else
36"Ok, send messages and open the door.";
37msg = door.open_msg ? door.open_msg | "You open the door.";
38this:tell(("%c" + msg) + "%w");
39group = setremove(this.location:get_animates(), this);
40for x in (group)
41name = this:known_to(x)[2];
42codes = {"%name", "%pro"};
43values = {name, #0.(this.gender)[2]};
44gmsg = door.open_announce ? door.open_announce | (name + " opens the door.");
45for y in [1..length(codes)]
46new = strsub(gmsg, codes[y], values[y], 1);
47gmsg = new;
48endfor
49x:tell(("%c" + gmsg) + "%w");
50endfor
51door:_open();
52endif
53endif
54endif
55endif
56endif
57endif

close

Spec any any anyFlags rwdOwner #10Definer #3

Referenced by

none

Source

1"$animate:close any any any";
2if (!args)
3this:tell("%cClose what?%w");
4else
5this:_close(@args);
6endif

_close

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"$animate:_close this none this";
2"Use animate's match function so that known_to works.";
3stuff = {@this.location.exits, @this.location.contents, @this.contents};
4targ = this:match(args[1], stuff);
5if (targ == {})
6this:tell("%cThere is no such item here.%w");
7elseif (length(targ) > 1)
8this:tell_ambiguous(tostr(args[1]), targ);
9else
10"Ok, single match.  Now find out if it's an exit or door.";
11"Containers will be in here too.";
12what = targ[1];
13if (what:is_a($container))
14this:tell("%cContainers can't be closed yet.%w");
15elseif (!what:is_a($exit))
16this:tell("%cYou cannot close that.%w");
17else
18if (!what.door)
19this:tell("%cThis exit has no door.%w");
20else
21"Ok, it's a door.";
22door = what;
23if (!door.open)
24this:tell("%cThe door is already closed.%w");
25else
26"Is it functional?";
27if (!door.functional)
28msg = door.func_msg ? door.func_msg | "This door is not functional.";
29this:tell(("%c" + msg) + "%w");
30else
31"Ok, send messages and close the door.";
32msg = door.close_msg ? door.close_msg | "You close the door.";
33this:tell(("%c" + msg) + "%w");
34group = setremove(this.location:get_animates(), this);
35for x in (group)
36name = this:known_to(x)[2];
37codes = {"%name", "%pro"};
38values = {name, #0.(this.gender)[2]};
39gmsg = door.close_announce ? door.close_announce | (name + " closes the door.");
40for y in [1..length(codes)]
41new = strsub(gmsg, codes[y], values[y], 1);
42gmsg = new;
43endfor
44x:tell(("%c" + gmsg) + "%w");
45endfor
46door:_close();
47endif
48endif
49endif
50endif
51endif

lock

Spec any any anyFlags rwdOwner #10Definer #3

Referenced by

none

Source

1"$animate:lock any any any";
2if (!args)
3this:tell("%cLock what?%w");
4else
5this:_lock(@args);
6endif

_lock

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"$animate:_lock this none this";
2"Use animate's match function so that known_to works.";
3stuff = {@this.location.exits, @this.location.contents, @this.contents};
4targ = this:match(args[1], stuff);
5if (targ == {})
6this:tell("%cThere is no such item here.%w");
7elseif (length(targ) > 1)
8this:tell_ambiguous(tostr(args[1]), targ);
9else
10"Ok, single match.  Now find out if it's an exit or door.";
11"Containers will be in here too.";
12what = targ[1];
13if (what:is_a($container))
14this:tell("%cContainers can't be locked yet.%w");
15elseif (!what:is_a($exit))
16this:tell("%cYou cannot lock that.%w");
17else
18if (!what.door)
19this:tell("%cThis exit has no door.%w");
20else
21"Ok, it's a door.";
22door = what;
23"Is it functional?";
24if (!door.functional)
25msg = door.func_msg ? door.func_msg | "This door is not functional.";
26this:tell(("%c" + msg) + "%w");
27else
28"Is it open?";
29if (door.open)
30this:tell("%cYou have to close it first.%w");
31else
32"Can it be locked at all?";
33if (!door.lockable)
34this:tell("This door has no lock.");
35else
36"Is it already locked?";
37if (door.locked)
38this:tell("%cIt's already locked.%w");
39else
40"Does the animate have the right key?";
41if (!(door.key in this.contents))
42this:tell("You don't have the right key.");
43else
44"Ok, send messages and lock the door.";
45msg = door.lock_msg ? door.lock_msg | "You lock the door.";
46this:tell(("%c" + msg) + "%w");
47group = setremove(this.location:get_animates(), this);
48for x in (group)
49name = this:known_to(x)[2];
50codes = {"%name", "%pro"};
51values = {name, #0.(this.gender)[2]};
52gmsg = door.lock_announce ? door.lock_announce | (name + " locks the door.");
53for y in [1..length(codes)]
54new = strsub(gmsg, codes[y], values[y], 1);
55gmsg = new;
56endfor
57x:tell(("%c" + gmsg) + "%w");
58endfor
59door:_lock();
60endif
61endif
62endif
63endif
64endif
65endif
66endif
67endif

unlock

Spec any any anyFlags rwdOwner #10Definer #3

Referenced by

none

Source

1"$animate:unlock any any any";
2if (!args)
3this:tell("%cUnlock what?%w");
4else
5this:_unlock(@args);
6endif

_unlock

Spec this none thisFlags rwxdOwner #10Definer #3

Referenced by

Source

1"$animate:_unlock this none this";
2"Use animate's match function so that known_to works.";
3stuff = {@this.location.exits, @this.location.contents, @this.contents};
4targ = this:match(args[1], stuff);
5if (targ == {})
6this:tell("%cThere is no such item here.%w");
7elseif (length(targ) > 1)
8this:tell_ambiguous(tostr(args[1]), targ);
9else
10"Ok, single match.  Now find out if it's an exit or door.";
11"Containers will be in here too.";
12what = targ[1];
13if (what:is_a($container))
14this:tell("%cContainers can't be unlocked yet.%w");
15elseif (!what:is_a($exit))
16this:tell("%cYou cannot unlock that.%w");
17else
18if (!what.door)
19this:tell("%cThis exit has no door.%w");
20else
21"Ok, it's a door.";
22door = what;
23"Is it functional?";
24if (!door.functional)
25msg = door.func_msg ? door.func_msg | "This door is not functional.";
26this:tell(("%c" + msg) + "%w");
27else
28"Is it open?";
29if (door.open)
30this:tell("%cThe door is already open.%w");
31else
32"Can it be locked at all?";
33if (!door.lockable)
34this:tell("This door has no lock.");
35else
36"Is it already unlocked?";
37if (!door.locked)
38this:tell("%cIt's not locked.%w");
39else
40"Does the animate have the right key?";
41if (!(door.key in this.contents))
42this:tell("You don't have the right key.");
43else
44"Ok, send messages and unlock the door.";
45msg = door.unlock_msg ? door.unlock_msg | "You unlock the door.";
46this:tell(("%c" + msg) + "%w");
47group = setremove(this.location:get_animates(), this);
48for x in (group)
49name = this:known_to(x)[2];
50codes = {"%name", "%pro"};
51values = {name, #0.(this.gender)[2]};
52gmsg = door.unlock_announce ? door.unlock_announce | (name + " unlocks the door.");
53for y in [1..length(codes)]
54new = strsub(gmsg, codes[y], values[y], 1);
55gmsg = new;
56endfor
57x:tell(("%c" + gmsg) + "%w");
58endfor
59door:_unlock();
60endif
61endif
62endif
63endif
64endif
65endif
66endif
67endif