generic messages #121

Parent #1Owner #361Flags read, fertileSource hellcore/hellcore.db

Aliases: generic messages

2 verbs · 20 properties · 1 children

Verbs

VerbSpecFlagsDefinerLines
compilethis none nonerxd#12118
selectthis none thisrxd#12134

Properties

PropertyDefinerFlagsOwnerValue
misses#121rc#361
list of 5{"(0,1)(all)%dn's %t misses by mere inches.", "(2,4)(all)%dn's %t goes wide and high.", "(5,9)(all)%dn's wild %t strike swishes through empty air.", "(10,999)(all)%dn throws an embarassing wild swing of %p %t.", "(0,3)(head)%DN's vicious %t swipe."}
_misses#121rc#361
list of 5{{0, 1, #110, "%dn's %t misses by mere inches."}, {2, 4, #110, "%dn's %t goes wide and high."}, {5, 9, #110, "%dn's wild %t strike swishes through empty air."}, {10, 999, #110, "%dn throws an embarassing wild swing of %p %t."}, {0, 3, #348, "%DN's vicious %t swipe."}}
hits#121rc#361
list of 5{"(0,5)(all)%dn's %t %<glances> off %dd's %l, leaving a bruise.", "(6,15)(all)%dn's %t %<smacks> into %dd's %l.", "(16,30)(all)%dn's %t %<smashes> into %dd's %l.", "(31,60)(all)%dn's %t smashes viciously into %dd's %l with a sickening crunch.", "(61,999)(all)blood gushes from %dd's %l at the savage impact of %dn's %t!"}
_hits#121rc#361
list of 5{{0, 5, #110, "%dn's %t %<glances> off %dd's %l, leaving a bruise."}, {6, 15, #110, "%dn's %t %<smacks> into %dd's %l."}, {16, 30, #110, "%dn's %t %<smashes> into %dd's %l."}, {31, 60, #110, "%dn's %t smashes viciously into %dd's %l with a sickening crunch."}, {61, 999, #110, "blood gushes from %dd's %l at the savage impact of %dn's %t!"}}
help_msg#121rc#361
list of 18{"A $combat_messages holds message sets for a particular weapon/attack style. These objects are pointed to by $weapon.messages and are used for most of the things weapons do in combat.", "", "Hits and Misses:", "", "hits, .misses and .swings are lists of messages, formatted as follows:", "", "(x-y)(bodypart)The message.", "", "where x and y are a range of result numbers, and 'bodypart' is either 'all' or the name of a particular body part for which that message applies. For misses, the result being compared to the ranges is the amount by which the attacker missed his skill roll. For hits, the result is the damage done by the attack, expressed as a percentage of the target's maximum health. For swings, it's the amount by which the attacker made his roll (positive or negative).", "", "Most of your messages will probably have 'all' as the bodypart, meaning they apply to hits on any body part. You can also include messages for specific body parts (head and groin are popular), which will take precedence if their ranges overlap the ranges in the 'all' messages.", "", "Note that if you specify messages whose ranges and bodypart overlap, one of them will be chosen at random when the actual result falls into the overlap. You can use this to specify two or three messages for each result range you create, or make several messages whose ranges all partially overlap -- you don't have to stick to \"one result == one message\".", "", "All the usual pronoun subs apply -- %N is the attacker, %t the weapon, %d the target, and %l the body part.", "", "IMPORTANT: After you edit these messages for any reason, you MUST do a 'compile <this>'. This takes apart your formatted messages and stores the raw data in a more MOO-friendly format.", ""}
swings#121rc#361
list of 4{"(-6,-2)(all)%DN swings %p %t wildly in %dd's direction.", "(-1,2)(all)%DN takes a swing at %dd with %p %t.", "(3,8)(all)%DN aims a careful swing at %dd with %p %t.", "(9,999)(all)%DN flashes a deadly %t strike at %dd!"}
_swings#121rc#361
list of 4{{-6, -2, #110, "%DN swings %p %t wildly in %dd's direction."}, {-1, 2, #110, "%DN takes a swing at %dd with %p %t."}, {3, 8, #110, "%DN aims a careful swing at %dd with %p %t."}, {9, 999, #110, "%DN flashes a deadly %t strike at %dd!"}}
types#121rc#361{"misses", "hits", "swings", "absorb"}
absorb#121rc#361{}
_absorb#121rc#361{}
aliases#1rc#361{"generic messages"}
description#1rc#361<clear>
object_size#1r#29{6391, 1298433815}
hidden_verbs#1rc#361<clear>
phelp_msg#1rc#361<clear>
weight#1rc#361<clear>
owner_verbs#1rc#361<clear>
plural_name#1rc#361<clear>
client_image#1rc#361<clear>
listening#1rc#361<clear>

Ancestry

Ancestors (nearest first): #1 root

Children: #249 fist messages

Call graph

calls n121_0 #121:compile n44_0 #44:match n121_0->n44_0 n107_43 #107:tell n121_0->n107_43 n20_59 #20:name_and_number n121_0->n20_59 n121_1 #121:select n121_1->n20_59 n45_0 #45:has_property n121_1->n45_0

Source

compile

Spec this none noneFlags rxdOwner #361Definer #121

Referenced by

none

Source

1for type in (this.types)
2compiled = {};
3for m in (this.(type))
4r = match(m, "(%([-0123456789]+%),%([-0123456789]+%))(%(%w+%))");
5d1 = toint(m[r[3][1][1]..r[3][1][2]]);
6d2 = toint(m[r[3][2][1]..r[3][2][2]]);
7b = m[r[3][3][1]..r[3][3][2]];
8msg = m[r[2] + 1..$];
9if (b == "all")
10bo = $bodypart;
11else
12bo = $match_utils:match(b, children($bodypart));
13endif
14player:tell("for ", d1, " to ", d2, " bodypart ", $su:nn(bo), " got: ", msg);
15compiled = {@compiled, {d1, d2, bo, msg}};
16endfor
17this.("_" + type) = compiled;
18endfor

select

Spec this none thisFlags rxdOwner #361Definer #121

Referenced by

none

Source

1{set, result, ?bodypart = #-1} = args;
2m = {};
3em = {};
4pname = "_" + set;
5if (!$ou:has_prop(this, pname))
6$nets.prognet:announce(this, ("I don't have a " + pname) + " prop!");
7endif
8for x in (this.(pname))
9min = x[1];
10max = x[2];
11part = x[3];
12msg = x[4];
13if (max == 999)
14max = 9999999;
15endif
16if (min == -999)
17min = -9999999;
18endif
19if ((result >= min) && (result <= max))
20if (bodypart == part)
21bmatch = bodypart;
22em = {@em, msg};
23m = {@m, msg};
24elseif (part == $bodypart)
25m = {@m, msg};
26endif
27endif
28endfor
29m = em ? em | m;
30if (m)
31return m[random(length(m))];
32else
33return ((($su:nn(this) + " didn't return a ") + set) + " message for ") + tostr(result);
34endif