damage extensions
From Wiki
Line 33: | Line 33: | ||
====hit_outcome_quantifier==== | ====hit_outcome_quantifier==== | ||
{{Ex/inival|1.1.2.2|positive real numbers|quantifies the damage done by a single damage rating. It accepts three input parameters. The first comes from [[#hit_point_quantifier]]. The second comes from [[#hit_offset_quantifier]]. And the third is the affinity index of the damage rating. Refer to hit_point_quantifier for details. | {{Ex/inival|1.1.2.2|positive real numbers|quantifies the damage done by a single damage rating. It accepts three input parameters. The first comes from [[#hit_point_quantifier]]. The second comes from [[#hit_offset_quantifier]]. And the third is the affinity index of the damage rating. Refer to hit_point_quantifier for details. | ||
+ | |||
+ | The default behavior depends on [[#do_fix_damage_calculus]]. Refer to the opening remarks of [[#Damage]] for details. | ||
The outputs are clamped to the range of [0,65535]] and converted to integers before being summed together per each damage rating. This sum is then inputted into [[#hit_handicap_quantifier]] in order to arrive at the ultimate "hit point" damage to the defending character|number}} | The outputs are clamped to the range of [0,65535]] and converted to integers before being summed together per each damage rating. This sum is then inputted into [[#hit_handicap_quantifier]] in order to arrive at the ultimate "hit point" damage to the defending character|number}} |
Revision as of 08:13, 31 July 2013
! |
Transcluded by Sword of Moonlight Extension Library / list of extensions. |
This section is available since 1.1.2.2.
Extensions in this section govern "damage". Which boils down to a kind of sport, often a virtual blood sport in violent video games. You basically have a tit-for-tat until one side falls or loses.
In a classical game of Sword of Moonlight the player wields weapons with different damage ratings, and monsters have built in "attacks" that are analogous to these weapons which may be mitigated by various pieces of armor worn by the player. Monsters have built in defenses. Blows are exchanged. Each time so-called hit points are rewarded until one side runs out of points and loses the game.
Where P is hit-points, and Q is the hit-point offset, or defense. The classical formula for calculating damage is equal to max(0,P-Q)+inf(P*P/(Q*2),0) and the new formula per #do_fix_damage_calculus is P-max(0,Q-P*P/(Q*2)). In both cases the result is clamped to the range [0,infinity]. The inf is a bug in the classical formula based on undefined behavior. The value of infinity arises when Q is 0. Becoming 0 when converted to an integer representation.
In the example above, in the case of the player, P and Q are subject to bonuses that are a function of the player's "stats" or characteristics such as Strength that accumulate over the course of a game as the player repeatedly performs certain actions. The classical bonus formula is Strength/5. However if P is 0 the bonus is 0. For Q the bonus is not zeroed out. The new bonus formula per do_fix_damage_calculus is P or Q*(Strength/#player_character_weight).
Finally do_fix_damage_calculus also factors in the scale of the player and monster. For monsters this scale is set when placing the monster onto its game map. For players the extension #player_character_scale is consulted. So when computing P where S is the scale, and weight is 50, P becomes P*(1+Strength/50)*S.
Contents
do_not_harm_defenseless_characters
Introduced around 1.1.2.2, this extension in the affirmative protects passive non-player characters from the assaults of aggressive non-player characters aimed at a player character. It does not protect the character from player character borne assaults. Values are limited to binary statements.[#]
hit_handicap_quantifier
Introduced around 1.1.2.2, this extension quantifies the final "hit point" loss. It accepts one input parameter: the aggregated sum of #hit_outcome_quantifier per each exchange. The default behavior is to round 0 up to 1 not changing anything otherwise, or not(_[0],1). Values are limited to positive real numbers.[#]
Note: that if the output is 0 the stun animation is not triggered. In other words a 0 output exchange appears to miss its mark.
hit_offset_quantifier...
Introduced around 1.1.2.2, this extension quantifies the second input parameter of #hit_outcome_quantifier. It has three input parameters of its own: the damage rating of a character's defenses, a modifier associated with evasive maneuvers, and the affinity index of the damage rating; this number is 0 for the first rating, 1 for the second, and so on. Up to 7.
The default behavior depends on #do_fix_damage_calculus. Refer to the opening remarks of #Damage for details.
The default behavior of hit_offset_quantifier2 is to defer to hit_offset_quantifier. Its function is dependent upon #hit_point_mode. However by default it is used for secondary ratings. By default these are ratings 4 through 8; traditionally associated with "magical" elemental forces: fire, water, and so on. Values are limited to positive real numbers.[#]
hit_outcome_quantifier
Introduced around 1.1.2.2, this extension quantifies the damage done by a single damage rating. It accepts three input parameters. The first comes from #hit_point_quantifier. The second comes from #hit_offset_quantifier. And the third is the affinity index of the damage rating. Refer to hit_point_quantifier for details.
The default behavior depends on #do_fix_damage_calculus. Refer to the opening remarks of #Damage for details.
The outputs are clamped to the range of [0,65535]] and converted to integers before being summed together per each damage rating. This sum is then inputted into #hit_handicap_quantifier in order to arrive at the ultimate "hit point" damage to the defending character. Values are limited to positive real numbers.[#]
hit_penalty_quantifier
This extension did not make it into 1.1.2.2. It is to govern damage borne of residual factors; poisons for example.
hit_point_mode
Introduced around 1.1.2.2, this extension augments the behavior of #hit_point_quantifier and #hit_offset_quantifier. The default is 0. The default behavior is unspecified. Historically the default behavior is identical to 1. The behavior of 1 is to use #hit_point_quantifier2 and #hit_offset_quantifier2 for ratings 4 through 8. Classical Sword of Moonlight aligns these with "magical" elemental forces.
The behavior of 2 is to use hit_point_quantifier2 and hit_offset_quantifier2 for indirect exchanges. Values are limited to numerical codes.[#]
hit_point_model
This extension did not make it into 1.1.2.2. It is to be used to select from a menu of alternative damage models. The simplest kind of model is +1, which says to shift the the dividing line between primary and secondary, aka. physical and magical, damage ratings up by 1 so that the fourth rating goes from secondary to primary.
hit_point_quantifier...
Introduced around 1.1.2.2, this extension quantifies the first input parameter of #hit_outcome_quantifier. It has three input parameters of its own: the damage rating of an instrument of attack, a reserved modifier that is 0, and the affinity index of the damage rating; this number is 0 for the first rating, 1 for the second, and so on. Up to 7.
The default behavior depends on #do_fix_damage_calculus. Refer to the opening remarks of #Damage for details.
The default behavior of hit_point_quantifier2 is to defer to hit_point_quantifier. Its function is dependent upon #hit_point_mode. However by default it is used for secondary ratings. By default these are ratings 4 through 8; traditionally associated with "magical" elemental forces: fire, water, and so on. Values are limited to positive real numbers.[#]