RPG info FO #55248

Parent #18181Owner Flags Source rpg_march_2006/Features/RPG Info FO.txt

Aliases: RPG info FO

9 verbs · 17 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
@info*rmation @stat @data @whatever @irinany none nonerxd#5524838
display_armourthis none this#5524836
ratethis none this#5524821
weapon_briefthis none this#5524813
display_creaturethis none this#5524845
display_weaponthis none this#5524829
healththis none this#552486
tell_contentsthis none this#5524825
@rpg-info @rpginfo @riany none nonerxd#5524894

Properties

PropertyDefinerFlagsOwnerValue
other_people#55248rc{#109723, #101111, #106308, #101711}
words#55248r
value (310 chars){{"minimal", "very low", "low", "moderate", "high", "very high", "incredible"}, {"none", "poor", "moderate", "good", "excellent", "complete"}, {"none", "low", "moderate", "high", "very high"}, {"very fast", "fast", "medium", "slow", "very slow"}, {"complete", "excellent", "good", "moderate", "poor", "lousy"}}
armour_data#55248r
value (233 chars){{"protection", "Protection", 0, {3, 0, 4, 10, 20}}, {"absorption", "Absorption", 0, {2, 1, 2, 3, 4, 6}}, {"leather", "Type", "Leather/Metallic", "Leather/Metallic"}, {"condition", "Condition", 0, 0}, {"encumbrance", "Weight", 0, 0}}
weapon_data#55248rc
value (814 chars){{"encumbrance", "Weight", 0, 0}, {"condition", "Condition", 0, 0}, {"length", "Length", 0, 0}, {"slowness", "Slowness", 0, {4, 5, 9, 13, 18}}, {"hands", "Hands", 0, 0}, {"dam", "Damage", 0, {1, 7, 12, 17, 22, 26, 32}}, {"max_str_bonus", "Strength Bonus", 0, {1, 4, 8, 15, 23, 30, 40}}, {"pen", "Penetration", 0, {5, 4, 8, 14, 22, 28}}, {"con", "Concussion", 0, {5, 1, 2, 3, 5, 8}}, {"pierce", "Pierce", 0, {3, -5, -2, 2, 5}}, {"attack", "Attack", 0, {1, -30, -15, -5, 5, 15, 25}}, {"parry", "Parry", 0, {1, -50, -20, -5, 10, 30, 70}}, {"dodgable", "Dodgable", 0, {1, -50, -20, -5, 5, 15, 40}}, {"parryable", "Parryable", 0, {1, -50, -20, -5, 5, 15, 40}}, {"special_damage", "Special Damage", 0, "Yes/No"}, {"wooden", "Wooden", "Yes/No", "Yes/No"}, {"blunt", "Blunt", "Yes/No", "Yes/No"}, {"skill", "Skill", 0, 0}}
bracers#55248rc#58725
squat#55248rc#8185
fo#55248rc#88922
usage#55248not readable (E_PERM)
users#55248
value (2998 chars){#2693, #21077, #31829, #37972, #38441, #47818, #50290, #58026, #58091, #59447, #62713, #63625, #69513, #71111, #71781, #78041, #82267, #85077, #85431, #86275, #87010, #88076, #89391, #90323, #90331, #91098, #93228, #94368, #94456, #96788, #97170, #97613, #98263, #98325, #99949, #100314, #100674, #100806, #102292, #103158, #103523, #103615, #103911, #103920, #104202, #104417, #104762, #105159, #105941, #106308, #106469, #106487, #106488, #106854, #106938, #107509, #107629, #107682, #107730, #108140, #108147, #108294, #108850, #109048, #109567, #109600, #109723, #110199, #110215, #110565, #112651, #112743, #112823, #112968, #100173, #108263, #72264, #109030, #112997, #113549, #101594, #113588, #112527, #64729, #59254, #113803, #113862, #106541, #113391, #81934, #113937, #109506, #87951, #98232, #113841, #111023, #89395, #114382, #101651, #101504, #112837, #103689, #110586, #114019, #103703, #114702, #114518, #56568, #113418, #112478, #113800, #108108, #110805, #115109, #105473, #113235, #106273, #98705, #114874, #113955, #91113, #115359, #114928, #115342, #105539, #112190, #113956, #92475, #114774, #107610, #87340, #107413, #115124, #107807, #80422, #108590, #114859, #116200, #64985, #110077, #113686, #57658, #116385, #115381, #87593, #116358, #116342, #116339, #116031, #116369, #107998, #91798, #107189, #107985, #114652, #116694, #115432, #116729, #115595, #116473, #88395, #115937, #116886, #115200, #115922, #64299, #117236, #117139, #116305, #117283, #109546, #117389, #117381, #112886, #117470, #117004, #117552, #117048, #109271, #58806, #77500, #43860, #116601, #114430, #116883, #12399, #87146, #90731, #96778, #118143, #117486, #50367, #92476, #118362, #90723, #116875, #118526, #115397, #118248, #94965, #109395, #118720, #118328, #89455, #35076, #117766, #118487, #118672, #118864, #118890, #118654, #117345, #118973, #118740, #117038, #118034, #112529, #114413, #119269, #59424, #119177, #86050, #103685, #118018, #118153, #119429, #109615, #119469, #112473, #30788, #117837, #88098, #118948, #115729, #86197, #119554, #116580, #65101, #115366, #112971, #118985, #115390, #87760, #119257, #119116, #111890, #119884, #111987, #119940, #119957, #107618, #119958, #119492, #120046, #114174, #118360, #115834, #119594, #120227, #118730, #118861, #120260, #120144, #120239, #120283, #114206, #119899, #117100, #120420, #118824, #116376, #120376, #120546, #109288, #120070, #120749, #119906, #105408, #57402, #78837, #120783, #114670, #120997, #121000, #121077, #121095, #121070, #120201, #121104, #121149, #121164, #121241, #121383, #121332, #114539, #120791, #121456, #121464, #113754, #120804, #121358, #121648, #121651, #87625, #121758, #121188, #121865, #109911, #121895, #106468, #121918, #121816, #121976, #121965, #121852, #115805, #122047, #122205, #121386, #48961, #114072, #122104, #122359, #119265, #122354, #122379, #122410, #110582, #122428, #106189, #122423, #118977, #42395, #122453, #122460, #122491, #102427, #100752, #122485, #121946, #122525, #122644}
users_last_updated#55248938327628
help_msg#55248"A feature object that can help LRPG players analyze and compare RPG equipment or opponents. @irin was originally written by Irin and @ri was added by Hannibal."
feature_verbs#55248{"@irin", "@ri"}
guest_ok#552481
key#55248not readable (E_PERM)
aliases#55248{"RPG info FO"}
description#55248"A FO that helps analyze RPG objects."
object_size#55248{19030, 1141286957}

Ancestry

Ancestors (nearest first): none

Children: none

Call graph

calls n55248_0 #55248:@info*rmation n55248_1 #55248:display_armour n55248_0->n55248_1 n55248_5 #55248:display_weapon n55248_0->n55248_5 n55248_4 #55248:display_creature n55248_0->n55248_4 n55248_7 #55248:tell_contents n55248_0->n55248_7 n55248_2 #55248:rate n55248_1->n55248_2 n55248_5->n55248_2 n55248_3 #55248:weapon_brief n55248_5->n55248_3 n55248_4->n55248_2 n55248_4->n55248_3 n55248_3->n55248_2 n55248_8 #55248:@rpg-info n55248_8->n55248_1 n55248_8->n55248_5 n55248_8->n55248_4 n55248_8->n55248_7 n55248_6 #55248:health n55248_8->n55248_6

Source

@info*rmation @stat @data @whatever @irin

Spec any none noneFlags rxdDefiner #55248

Referenced by

none

Source

1"@info/@stat/@data/@whatever <weapon/armour/creature>   Returns verbal ratings of equipment.";
2if (caller != player)
3  return E_PERM;
4elseif (!argstr)
5  return player:tell("Usage:  @info/@stat/@data/@whatever  <weapon/armour/creature>");
6endif
7this:update_usage(verb, player);
8su = $string_utils;
9rpg = $local.rpg;
10thing = dobj;
11if (!valid(thing))
12  thing = $match_utils:match(dobjstr, {@player.contents, @player.location.contents});
13endif
14if (!valid(thing))
15  thing = $match_utils:match(dobjstr, rpg.dispenser.dispenses);
16endif
17if (!valid(thing))
18  thing = $string_utils:match_player(dobjstr);
19endif
20if ($command_utils:object_match_failed(thing, dobjstr))
21  return;
22endif
23permed = rpg:trusted(caller_perms()) || (player in this.other_people);
24player:tell(su:space(60, "-"));
25player:tell(("Displaying information on " + su:nn(thing)) + ".");
26if ((ou = $object_utils):isa(thing, rpg.armour))
27  this:display_armour(thing, permed);
28elseif (ou:isa(thing, rpg.weapon))
29  this:display_weapon(thing, permed);
30elseif (valid(doll = rpg:get_doll(thing)))
31  this:display_creature(thing, doll, permed);
32elseif (ou:isa(thing, $local.puppet))
33  player:tell("This is a type of puppet.  Parent: ", su:nn(parent(thing)), "  Owner: ", su:nn(thing.owner));
34  this:tell_contents(thing);
35else
36  player:tell(("No information available.  Please contact " + su:nn(this.owner)) + " if you think there should be.");
37endif
38player:tell(su:space(60, "-"));

display_armour

Spec this none thisDefiner #55248

Referenced by

Source

1":display_armour(OBJ thing, FLAG permed) => Displays information about the specified armour.";
2(rpg = $local.rpg):secure();
3{armour, permed} = args;
4{msg, display_type, extra_data} = {"", "full", {}};
5data = {};
6stuff = {@this.armour_data, @extra_data};
7if ((display_type == "full") || (display_type == "partial"))
8  for item in (stuff)
9    {verb_name, display_name, permed_rate, unpermed_rate} = item;
10    try
11      value = armour:(verb_name)(player, player, rpg.weapon, 6, 0, 0);
12    except (E_ARGS)
13      value = armour:(verb_name)();
14    except (E_VERBNF)
15      value = armour.(verb_name);
16    except (ANY)
17      value = "unknown";
18    endtry
19    data = {@data, (display_name + ": ") + this:rate(value, permed ? permed_rate | unpermed_rate)};
20  endfor
21endif
22data = $string_utils:columnize(data, 2);
23data2 = {};
24if (display_type == "full")
25  for area in (armour.body_areas)
26    data2 = {@data2, (area.name + ": ") + this:rate(armour:cover(area), permed ? 0 | {2, 0, 25, 50, 75, 99})};
27  endfor
28endif
29data2 = $string_utils:columnize(data2, 2);
30data = {@data, "", "Coverage:", @data2};
31for line in (data)
32  player:tell(line);
33endfor
34if (msg)
35  player:tell(msg);
36endif

rate

Spec this none thisDefiner #55248

Referenced by

Source

1":rate(value, specifier) => Converts value to a string, modified by appropriate specifier.";
2"If specifier is a string, treat value as a boolean, with first value being true, second false, with a '/' separator.  I.e. \"yes/no\".";
3"If specifier is a list, it is of the form {<word list to use>, <1 or more values to compare the given value, in order to find out which word on the list to use.>}.";
4"Otherwise, return tostr(value)";
5{value, specifier} = args;
6if ((typeof(specifier) == LIST) && (typeof(value) == NUM))
7  {x, @numbers} = specifier;
8  for n in [1..length(numbers)]
9    if (value <= numbers[n])
10      return this.words[x][n];
11    endif
12  endfor
13  return this.words[x][n + 1];
14elseif (typeof(specifier) == STR)
15  i = index(specifier, "/");
16  return value ? specifier[1..i - 1] | specifier[i + 1..$];
17elseif (typeof(value) == OBJ)
18  return $string_utils:nn(value);
19else
20  return tostr(value);
21endif

weapon_brief

Spec this none thisDefiner #55248

Referenced by

Source

1":weapon_brief(weapon, permed) => returns a string with basics on the weapon.";
2$local.rpg:secure();
3{weapon, permed, ?dude = player} = args;
4p = {dude, dude};
5dam = weapon:dam(@p);
6strength = weapon:max_str_bonus(@p);
7pen = weapon:pen(@p);
8con = weapon:con(@p);
9drlow = (4 * dam) + ((strength * 16) / 10);
10drhi = (8 * dam) + (4 * strength);
11wrate = {1, 5, 10, 15, 21, 28, 40};
12maxpen = (pen > 0) ? drhi / pen | "Unlimited";
13return (((("damage range: " + this:rate(drlow / 10, permed ? 0 | wrate)) + "-") + this:rate(drhi / 10, permed ? 0 | wrate)) + "  max armour penetration: ") + this:rate(maxpen, permed ? 0 | {3, 0, 7, 15, 25});

display_creature

Spec this none thisDefiner #55248

Referenced by

Source

1":display_creature(OBJ creature, OBJ doll, FLAG permed) => Display information on critter.";
2$local.rpg:secure();
3{critter, doll, permed} = args;
4su = $string_utils;
5stuff = {su:nn(critter) + (is_player(critter) ? " is a player character." | " is a living RPG monster."), ""};
6weapons = doll:wielding();
7nat_weapons = (typeof(doll.natural_weapons) == LIST) ? doll.natural_weapons | {};
8if (weapons && (weapons == nat_weapons))
9  stuff = {@stuff, "Armed with natural weapons:"};
10  for weapon in (weapons)
11    stuff = {@stuff, (su:nn(weapon) + " ") + this:weapon_brief(weapon, permed, critter)};
12  endfor
13else
14  stuff = {@stuff, "Wielding:"};
15  for weapon in (weapons)
16    stuff = {@stuff, (su:nn(weapon) + " ") + this:weapon_brief(weapon, permed, critter)};
17  endfor
18  stuff = {@stuff, "Natural Weapons:"};
19  for weapon in (nat_weapons)
20    stuff = {@stuff, (su:nn(weapon) + " ") + this:weapon_brief(weapon, permed, critter)};
21  endfor
22endif
23stuff = {@stuff, "", "Armour analysis:"};
24armours = doll:wearing();
25stuff = {@stuff, "Natural protection: " + tostr(`critter.nat_prot ! ANY => 0'), "Magic resistance: " + tostr(`critter.magic_resist ! ANY => 0')};
26stuff2 = stuff3 = {};
27areas = doll.body_areas;
28for armour in (armours)
29  stuff2 = {@stuff2, su:nn(armour)};
30endfor
31ad = this.armour_data;
32for area in (areas)
33  bc = bp = ba = 0;
34  for armour in (armours)
35    bc = $object_utils:isa(armour, #28148) ? 98 | max(bc, armour:cover(area));
36    a = {player, critter, $local.rpg.weapon, area, 10, 20};
37    bp = max(bp, armour:protection(@a));
38    ba = max(ba, armour:absorption(@a));
39  endfor
40  stuff3 = {@stuff3, (((((area.name + ": ") + this:rate(bc, ad[2][3 + (permed ? 0 | 1)])) + "/") + this:rate(bp, ad[1][3 + (permed ? 0 | 1)])) + "/") + this:rate(ba, ad[2][3 + (permed ? 0 | 1)])};
41endfor
42stuff = {@stuff, "Wearing:", @su:columnize(stuff2, 2), "Maximum coverage/protection/absorption:", @su:columnize(stuff3, 2)};
43for line in (stuff)
44  player:tell(line);
45endfor

display_weapon

Spec this none thisDefiner #55248

Referenced by

Source

1":display_weapon(OBJ thing, FLAG permed) => Displays information about the specified weapon.";
2$local.rpg:secure();
3{weapon, permed, ?dude = player} = args;
4{msg, display_type, extra_data} = {"", "full", {}};
5data = {};
6stuff = {@this.weapon_data, @extra_data};
7if (display_type == "full")
8  for item in (stuff)
9    {verb_name, display_name, permed_rate, unpermed_rate} = item;
10    try
11      value = weapon:(verb_name)(dude, dude);
12    except (E_ARGS)
13      value = `weapon:(verb_name)(dude, dude, weapon) ! E_ARGS => "unknown"';
14    except (E_VERBNF)
15      value = weapon.(verb_name);
16    except (ANY)
17      value = "unknown";
18    endtry
19    data = {@data, (display_name + ":  ") + this:rate(value, permed ? permed_rate | unpermed_rate)};
20  endfor
21endif
22data = $string_utils:columnize(data, 2);
23data = {@data, this:weapon_brief(weapon, permed)};
24for line in (data)
25  player:tell(line);
26endfor
27if (msg)
28  player:tell(msg);
29endif

health

Spec this none thisDefiner #55248

Referenced by

Source

1rpg = $local.rpg;
2player:tell();
3rpg:look_health(dobj);
4rpg:look_gear(dobj);
5rpg:look_encumbrance(dobj);
6return;

tell_contents

Spec this none thisDefiner #55248

Referenced by

Source

1{thing} = args;
2player:tell();
3player:tell("*** Contents ***");
4su = $string_utils;
5if (!thing.contents)
6  return player:tell("empty");
7endif
8unclaimed = 0;
9claimed = 0;
10nonrpg = 0;
11for object in ($object_utils:all_contents(thing))
12  if ($object_utils:isa(object, $local.rpg.thing))
13    if (valid(claim = object.claimed_by))
14      player:tell(su:nn(object), " is claimed by ", su:nn(claim));
15      claimed = claimed + 1;
16    else
17      player:tell(su:nn(object));
18      unclaimed = unclaimed + 1;
19    endif
20  else
21    nonrpg = nonrpg + 1;
22    player:tell(su:nn(object));
23  endif
24endfor
25return player:tell("Total claimed: ", claimed, "   Total unclaimed: ", unclaimed, "   Total non-RPG items: ", nonrpg);

@rpg-info @rpginfo @ri

Spec any none noneFlags rxdDefiner #55248

Referenced by

none

Source

1"Usage: @ri <thing> Returns extensive numeric info on RPG items, players, monsters, and also handles containers.";
2if (!(caller in {player, this.fo}))
3  return E_PERM;
4endif
5if (!argstr)
6  return player:tell_lines($code_utils:verb_documentation());
7endif
8thing = dobj;
9{su, ou, mu, rpg} = {$string_utils, $object_utils, $match_utils, $local.rpg};
10if (!valid(thing))
11  thing = mu:match(dobjstr, {@player.contents, @player.location.contents});
12endif
13if (!valid(thing))
14  thing = mu:match(dobjstr, rpg.dispenser.dispenses);
15endif
16if (!valid(thing))
17  thing = su:match_player(dobjstr);
18endif
19if ($command_utils:object_match_failed(thing, dobjstr))
20  return;
21endif
22this:update_usage(verb, player);
23player:tell("*** ", su:nn(thing), " ***");
24player:tell("Owned by: ", su:nn(thing.owner));
25player:tell("Child of: ", su:nn(x = parent(thing)), " owned by ", su:nn(x.owner));
26player:tell("Location: ", su:nn(thing.location));
27if (`thing.unique ! ANY => 0')
28  player:tell("This item is unique.");
29endif
30if (is_player(thing))
31  if (valid(doll = rpg:get_doll(thing)))
32    this:display_creature(thing, doll, 1);
33    this:health();
34    this:tell_contents(thing);
35    player:tell("Total RPG encumbrance ", rpg:weight(thing), " units.");
36    return;
37  else
38    player:tell("This player does not have an RPG doll.");
39    this:tell_contents(thing);
40    return;
41  endif
42elseif (ou:isa(thing, rpg.monster))
43  if (valid(doll = rpg:get_doll(thing)))
44    this:display_creature(thing, doll, 1);
45    this:health();
46    this:tell_contents(thing);
47  elseif (ou:isa(thing, this.squat))
48    player:tell("This is an RPG squat.");
49    this:tell_contents(thing);
50    return;
51  else
52    player:tell("This monster does not appear to have a doll.");
53    return;
54  endif
55  return;
56elseif (ou:isa(thing, $local.puppet))
57  player:tell("This is a type of puppet.");
58  this:tell_contents(thing);
59  return;
60elseif (ou:isa(thing, $container) || ou:isa(thing, rpg.container))
61  player:tell("This is a type of container.");
62  this:tell_contents(thing);
63  return;
64elseif (ou:isa(thing, rpg.thing))
65  if (valid(claim = thing.claimed_by))
66    player:tell("This object is currently claimed by ", su:nn(claim));
67  else
68    player:tell("This object is not claimed.");
69  endif
70else
71  player:tell("This verb has no further information about this object.");
72  return;
73endif
74if (ou:isa(thing, rpg.weapon))
75  player:tell("*** Weapon Stats ***");
76  this:display_weapon(thing, 1);
77  if (ou:isa(thing, rpg.weapon_spell_focus))
78    player:tell("*** This object also has magical properties, try examine <object> to see which spells. ***");
79  endif
80  return;
81elseif (ou:isa(thing, rpg.armour))
82  if (ou:isa(thing, this.bracers))
83    player:tell("These are magical focii used by members of the Arcanum Magus, they provide full body protection dependant on the wearers rank in the guild.  You can see the current rankings by typing ->look #98608<-.  The bracers also can deflect lightning from an attackers storm back at the attacker, the higher circles have a better chance of doing this.");
84    player:tell();
85    player:tell("*** Force sphere levels ***");
86    player:tell("5th circle: 22,  6th circle: 26,  7th circle: 29,  8th circle:  33,  Archmage: 36");
87    player:tell("Type @ri <player> to see the players actual protection.");
88  endif
89  player:tell("*** Armour Stats ***");
90  this:display_armour(thing, 1);
91  if (ou:isa(thing, rpg.armour_spell_focus))
92    player:tell("*** This armour has magical properties, try examine <object> to see which spells. ***");
93  endif
94endif