SetBleedRules
How cuts bleed on this server - the rate, how long, and how much armour holds.
A stab or a slash that lands opens a wound that bleeds perDamage health a second per point of the blow’s damage for
seconds, then stops by itself; a later cut opens a wound of its own (it does not restart the others), and together they
bleed at most maxRate a second. Armour: a cut bleeds only when the armour on the struck part let at least
minThrough of it through (0 .. 1) - plate, or mail over a gambeson, holds more than half - else the armouredCuts-th
cut the armour held since the last wound opens one all the same (a gap found; 0 = never through the armour). A smash
never bleeds. Shots: ranged = false keeps arrows, bolts and bullets from ever opening a wound (players’ and actors’
alike); by default they bleed as any stab. A key left out keeps the server’s own: perDamage, maxRate and seconds are
[combat] bleed_per_damage, max_bleed and bleed_seconds, minThrough is 0.5, armouredCuts 3, ranged true;
SetBleedRules(nil) goes back to them all.
The rules cover players and actors alike; open wounds keep their rate and time. A single blow’s bleeding is the hit
callback’s to decide (OnPlayerDamage’s second return value).
Syntax
Section titled “Syntax”SetBleedRules(rules)| Parameter | Type | |
|---|---|---|
rules |
table | {perDamage=, maxRate=, seconds=, minThrough=, armouredCuts=, ranged=}; nil = the server’s own |
Returns
Section titled “Returns”nothing
Example
Section titled “Example”-- a roleplay server: plate never bleeds from a cut, others bleed for a minute at most half a point a secondSetBleedRules({ minThrough = 0.5, armouredCuts = 0, seconds = 60, maxRate = 0.5 })
-- only blades bleed: arrows, bolts and bullets do their damage and no moreSetBleedRules({ ranged = false })See also
Section titled “See also”GetBleedRules · GetPlayerBleeding · SetPlayerBleeding · OnPlayerDamage · the Vitals group of the index
