Slither's Feature Object #62557
Aliases: Slither's Feature Object, sfo
9 verbs · 10 properties · 0 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
weights | none none none | rxd | #62557 | 16 |
weights_help | this none this | | #62557 | 18 |
weigh load | any none none | rxd | #62557 | 32 |
calc_weight_num | this none this | | #62557 | 8 |
calc_weight_str | this none this | | #62557 | 9 |
@trainable | any none none | rxd | #62557 | 38 |
get_att | this none this | | #62557 | 4 |
ms loc ml | any none none | rxd | #62557 | 17 |
@rak @rrak | none none none | rxd | #62557 | 9 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
rakshasa | #62557 | r | — | #60388 |
usage | #62557 | | — | not 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 | #62557 | | — | 1 |
key | #62557 | | — | not 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
Source
weights
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
Referenced by
- #62557:weights line 9:
this:weights_help - #62557:weights_help line 8:
this:weights_help
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
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
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
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
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
Referenced by
- #62557:@trainable line 26:
this:get_att - #62557:@trainable line 30:
this:get_att
Source
1if (caller != this) 2 return E_PERM; 3endif 4return args[2]:get_unmod_att(args[1]);
ms loc ml
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
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