generic messages #121
Aliases: generic messages
2 verbs · 20 properties · 1 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
compile | this none none | rxd | #121 | 18 |
select | this none this | rxd | #121 | 34 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
misses | #121 | rc | #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 | #121 | rc | #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 | #121 | rc | #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 | #121 | rc | #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 | #121 | rc | #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 | #121 | rc | #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 | #121 | rc | #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 | #121 | rc | #361 | {"misses", "hits", "swings", "absorb"} |
absorb | #121 | rc | #361 | {} |
_absorb | #121 | rc | #361 | {} |
aliases | #1 | rc | #361 | {"generic messages"} |
description | #1 | rc | #361 | <clear> |
object_size | #1 | r | #29 | {6391, 1298433815} |
hidden_verbs | #1 | rc | #361 | <clear> |
phelp_msg | #1 | rc | #361 | <clear> |
weight | #1 | rc | #361 | <clear> |
owner_verbs | #1 | rc | #361 | <clear> |
plural_name | #1 | rc | #361 | <clear> |
client_image | #1 | rc | #361 | <clear> |
listening | #1 | rc | #361 | <clear> |
Ancestry
Ancestors (nearest first): #1 root
Children: #249 fist messages
Call graph
Source
compile
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
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