Slither's Feature Object #62557

Parent #18181Owner Flags Source rpg_march_2006/Features/Slither's Feature Objec.txt

Aliases: Slither's Feature Object, sfo

9 verbs · 10 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
weightsnone none nonerxd#6255716
weights_helpthis none this#6255718
weigh loadany none nonerxd#6255732
calc_weight_numthis none this#625578
calc_weight_strthis none this#625579
@trainableany none nonerxd#6255738
get_attthis none this#625574
ms loc mlany none nonerxd#6255717
@rak @rraknone none nonerxd#625579

Properties

PropertyDefinerFlagsOwnerValue
rakshasa#62557r#60388
usage#62557not readable (E_PERM)
users#62557
value (322 chars){#121188, #121865, #109911, #121895, #106468, #121918, #121816, #121931, #121976, #121965, #121852, #115805, #116276, #122047, #121386, #48961, #114701, #114072, #106189, #120045, #122104, #122359, #119265, #122354, #122410, #110582, #122428, #122423, #118977, #42395, #122453, #122460, #122491, #122525, #122614, #122644}
help_msg#62557
value (651 chars){"This feature object contains a couple of commands to tell you the", "weight of things in the RPG. More commands might be added to it in", "the future. Any comments and suggestions are welcome, and should be sent", "to Slither.", "Two notes about weights are probably appropriate. Firstly, there are", "objects in the game that weigh different amounts depending on who is carrying", "them. This commands give you the weights that apply to YOU. Secondly,", "the RPG calculates weights slightly differently than these commands -- this", "is because the RPG's calculation is more expensive, and (I think) buggy,", "but be warned.", " -- Slither"}
feature_verbs#62557{"weigh", "weights", "@trainable", "@read-scrolls", "loc", "@rak"}
guest_ok#625571
key#62557not readable (E_PERM)
aliases#62557{"Slither's Feature Object", "sfo"}
description#62557"This feature currently contains a couple verbs to show the weights of things in the RPG game (so you can tell WHY you are overloaded). Send comments and suggestions to Slither."
object_size#62557{10543, 1141286888}

Ancestry

Ancestors (nearest first): none

Children: none

Call graph

calls n62557_0 #62557:weights n62557_1 #62557:weights_help n62557_0->n62557_1 n62557_1->n62557_1 n62557_5 #62557:@trainable n62557_6 #62557:get_att n62557_5->n62557_6

Source

weights

Spec none none noneFlags rxdDefiner #62557

Referenced by

none

Source

1"`weights` prints out a list of all your items, and how much they weigh.";
2"If one of your objects contains others, the contents will also be";
3"printed, indented.";
4this:update_usage(verb, player);
5if (!valid(doll = $local.rpg:get_doll(player)))
6  player:tell("Sorry, you aren't in the RPG, so this command can't work.");
7endif
8if (player.contents)
9  output = this:weights_help(player, 0, doll);
10  player:tell("Inventory, with weights:");
11  player:tell_lines(output[2]);
12  player:tell("");
13  player:tell("Total weight: " + tostr(output[1]));
14else
15  player:tell("You have no inventory");
16endif

weights_help

Spec this none thisDefiner #62557

Referenced by

Source

1total = 0;
2item = args[1];
3indent = args[2];
4doll = args[3];
5output = {};
6for i in (item.contents)
7  if (i.contents)
8    subitemresults = this:weights_help(i, indent + 2, doll);
9  else
10    subitemresults = {0, {}};
11  endif
12  if ($object_utils:isa(i, #517))
13    subitemresults[1] = subitemresults[1] + i:encumbrance(doll);
14  endif
15  total = total + subitemresults[1];
16  output = {@output, ($string_utils:space(indent) + $string_utils:left(subitemresults[1] ? tostr(subitemresults[1]) | "  ", 4)) + i.name, @subitemresults[2]};
17endfor
18return {total, output};

weigh load

Spec any none noneFlags rxdDefiner #62557

Referenced by

none

Source

1"This command returns either the weight of a RPG object, or the weights";
2"of all the objects that the player is carrying.";
3"`weigh <item>` returns the weight of that item.";
4"`weigh` or `weigh me` returns the weights of all carried objects";
5"This command also goes by the name `load`, to avoid conflict with another";
6"feature object.";
7this:update_usage(verb, player);
8doll = $local.rpg:get_doll(player);
9if (!valid(doll))
10  player:tell("Sorry, you aren't in the RPG, and so weights can't be calculated.");
11  return;
12endif
13if ((dobj == player) || (dobj == $nothing))
14  "do player inventory";
15  player:tell("Weights of your objects:");
16  player:tell_lines($list_utils:map_arg(this, "calc_weight_str", player.contents, doll));
17elseif (dobj == $ambiguous_match)
18  player:tell(("Sorry, there are several things named '" + dobjstr) + "' around.");
19elseif (dobj == $failed_match)
20  player:tell(("Sorry, there is no object named '" + dobjstr) + "' around.");
21else
22  if ($object_utils:isa(dobj, #517))
23    "do object inventory";
24    total = 0;
25    for i in ($list_utils:map_arg(this, "calc_weight_num", {dobj, @$object_utils:all_contents(dobj)}, doll))
26      total = total + i;
27    endfor
28    player:tell(((("The " + dobj.name) + " weighs ") + tostr(total)) + " units.");
29  else
30    player:tell("Sorry, that is not an RPG item.");
31  endif
32endif

calc_weight_num

Spec this none thisDefiner #62557

Referenced by

none

Source

1"This is a helping function.  It returns the weight of args[1] using the doll";
2"which should be passed as args[2]";
3item = args[1];
4if ($object_utils:isa(item, #517))
5  return item:encumbrance(args[2]);
6else
7  return 0;
8endif

calc_weight_str

Spec this none thisDefiner #62557

Referenced by

none

Source

1"This is a helping function.  It returns a string with the weight and the";
2"name of the object args[1], using the doll which should be args[2]";
3item = args[1];
4doll = args[2];
5if ($object_utils:isa(item, #517))
6  return ($string_utils:right(tostr(item:encumbrance(doll)), 3) + " ") + item.name;
7else
8  return " -- " + item.name;
9endif

@trainable

Spec any none noneFlags rxdDefiner #62557

Referenced by

none

Source

1"Usage:  @trainable [player]";
2"This command returns the list of RPG stats that the given player";
3"(or you, if no player is given) is able to successfully train at";
4"the academy.  You may only see this information for another player";
5"if you are a GM.";
6this:update_usage(verb, player);
7if (!$local.rpg:trusted(player))
8  player:tell("Mirror, mirror, in the hall, what stats are trainable... if any at all?");
9  return;
10endif
11person = (valid(dobj) && is_player(dobj)) ? dobj | (dobjstr ? $string_utils:match_player(dobjstr) | player);
12if (!valid(person))
13  player:tell("Sorry, can't find anyone with that name.");
14  return;
15endif
16if ((player != person) && (!$local.rpg:trusted(player)))
17  player:tell("Sorry, only GMs can get info about other people.");
18  return;
19endif
20doll = $local.rpg:get_doll(person);
21if (!valid(doll))
22  player:tell("Sorry, that person isn't in the RPG.");
23  return;
24endif
25"Finally, we get to do something!";
26pot = this:get_att("pot", doll);
27trainable = {};
28allskills = {{"Str", "Strength"}, {"End", "Endurance"}, {"Dex", "Dexterity"}, {"Agl", "Agility"}, {"Int", "Intelligence"}, {"Emp", "Empathy"}, {"Wil", "Willpower"}, {"Pcn", "Perception"}, {"App", "Appearance"}};
29for skill in (allskills)
30  if ($local.rpg.costs[min(this:get_att(skill[1], doll), 25) + 1] <= pot)
31    trainable = {@trainable, skill[2]};
32  endif
33endfor
34if (trainable)
35  player:tell($string_utils:pronoun_sub(("%N is currently able to train the stats " + $string_utils:english_list(trainable, "", " or ")) + ".", person));
36else
37  player:tell($string_utils:pronoun_sub("%N is not able to train any stats at the moment.", person));
38endif

get_att

Spec this none thisDefiner #62557

Referenced by

Source

1if (caller != this)
2  return E_PERM;
3endif
4return args[2]:get_unmod_att(args[1]);

ms loc ml

Spec any none noneFlags rxdDefiner #62557

Referenced by

none

Source

1"This verb returns information on the location and health of a particular monster.";
2critters = $match_utils:match_list(dobjstr, $local.rpg.vacuum.monsters);
3if ((dobjstr && ((theobj = toobj(dobjstr)) != #0)) && (theobj in $local.rpg.vacuum.monsters))
4  critters = setadd(critters, theobj);
5endif
6if (!critters)
7  player:tell("No RPG monster found matching \"", dobjstr, "\".");
8  return;
9elseif (length(critters) > 1)
10  player:tell("There is more than one RPG monster matching \"", dobjstr, "\": ", $string_utils:nn(critters), ".");
11else
12  player:tell($string_utils:nn(c = critters[1], ""));
13  c:look_health();
14  $local.rpg:look_gear(c);
15  $local.rpg:look_encumbrance(c);
16  player:tell(c.psc, " is ", c.alive ? "currently at " + $string_utils:nn(c.location) | "** DEAD **");
17endif

@rak @rrak

Spec none none noneFlags rxdDefiner #62557

Referenced by

none

Source

1"This verb shows the location and current disguise of the rakshasas.";
2"I'm really against this verb, but it is still on Krystia's mostly broken FO";
3"and people have their own copies anyway, so here it is in the interest";
4"of getting the bad FO out of circulation.";
5for target in (children(this.rakshasa))
6  for subtarg in (children(target))
7    player:tell(#20:left(target.name, 6), " is disguised as ", subtarg.name, " (", subtarg, ") at ", valid(subtarg.location) ? subtarg.location.name | "Nowhere", " (", subtarg.location, ").");
8  endfor
9endfor