http://wiki.lostsouls.org/w/index.php?title=Man_special_attack&limit=250&action=history&feed=atomMan special attack - Revision history2024-03-28T09:21:48ZRevision history for this page on the wikiMediaWiki 1.8.2http://wiki.lostsouls.org/w/index.php?title=Man_special_attack&diff=3977&oldid=prevLaine at 21:03, 11 June 20072007-06-11T21:03:03Z<p></p>
<p><b>New page</b></p><div>==Files==<br />
<br />
/def/descriptor/special_attack.c<br />
/lib/descriptors/special_attack.h<br />
/std/autonomon.c<br />
<br />
==Description==<br />
<br />
Special attack descriptors are used by the /std/autonomon special attack<br />
mechanism; they describe a simplistic special combat maneuver that the<br />
character can perform. This document explains the significance of each<br />
of the fields in the descriptor; for information on how to specify the<br />
descriptor and so on, see the general information in 'man descriptors'.<br />
<br />
Fields below which can be given as closures receive either standard<br />
arguments or damage arguments. Standard arguments are 1) the opponent,<br />
2) the special attack descriptor, and 3) the character. Damage arguments<br />
are 1) the opponent, 2) the resolved limb target in use, which will be<br />
either integer limb target, possibly -1 (Null) for the entire body, or an<br />
array of integer limb targets, 3) the special attack descriptor, and<br />
4) the character. All closures are expected to return a value that could<br />
be specified as a static value for the field.<br />
<br />
===Public Fields===<br />
<br />
Special_Attack_Name: A descriptive name for the special attack, used when<br />
it's necessary to address the special attack by name. Presently, this is<br />
mainly relevant to things like 'show attacks', 'perform <special attack>',<br />
and 'stop/start attacking with <special attack>', and is mainly used on<br />
special attacks defined at the race level.<br />
<br />
Special_Attack_Actuation: An actuation, as defined in /lib/combat.h and<br />
/def/actuation, or an array of actuations. If supplied, these will be<br />
used for automatically determining the conditions necessary for the special<br />
attack to take place and constructing a message for it.<br />
<br />
Special_Attack_Vector: An attack vector, as defined in /lib/combat.h and<br />
/def/vector. If supplied, this will be used as part of determining the<br />
message for the special attack and whether it can be defended against.<br />
If not supplied, the default vector for the damage type or damage combo<br />
lappropriate to Special_Attack_Type will be used.<br />
<br />
Special_Attack_Skill: A single skill, an array of skills, or a mapping of<br />
skill to int/float weights. If supplied, this specifies the main skills<br />
which are used to determine whether the attack hits its target. If not<br />
supplied, the attack always hits and cannot be defended against. This<br />
should always be supplied!<br />
<br />
Special_Attack_Speak: Text which the autonomon must speak in order for the<br />
special attack to take place.<br />
<br />
Special_Attack_Language: The language in which the Special_Attack_Speak<br />
text must be spoken.<br />
<br />
Special_Attack_Power: Used to specify the power level of the special attack<br />
in an abstract fashion. See /lib/descriptors/special_attack.h for the list<br />
of possible values for this field. ALWAYS USE THE MACROS! When this<br />
field is specified, damage and other effects will be apportioned based on<br />
the power level of the attack, adjusted according to the autonomon's<br />
special attack damage rating if a Special_Attack_Skill was specified,<br />
and so on. NOTE: All damage amounts (whether from Special_Attack_Power,<br />
Special_Attack_Damage, or Special_Attack_Modifier) are apportioned into<br />
special effects (pain, stunning, slowing, etc.) according to the tendency<br />
of the attack's damage types to cause each; for example, photonic damage<br />
tends to cause blinding, while sonic damage tends to cause stunning.<br />
<br />
Special_Attack_Damage: A randomizable amount of damage caused by the<br />
special attack. This damage, along with any damage calculated for the<br />
the attack based on Special_Attack_Power, will be subject to normal<br />
attack-damage randomization, meaning it will vary between 10% and 100%<br />
of its capacity. May be a closure, which receives damage arguments. It<br />
is preferable to avoid using this field and rely on Special_Attack_Power.<br />
<br />
Special_Attack_Modifier: A constant amount of damage caused by the special<br />
attack. Will not be subject to normal attack-damage randomization. May<br />
be a closure, which receives damage arguments. It is preferable to avoid<br />
using this field and rely on Special_Attack_Power.<br />
<br />
Special_Attack_Type: The damage type caused by special attack. Defaults<br />
to ({ "magical" }). Basic values may be string or array; may also be a<br />
closure, which receives damage arguments.<br />
<br />
Special_Attack_Target: The limb or limbs targeted by the special attack.<br />
Defaults to Special_Attack_Target_Hit_Limb; it is almost always appropriate<br />
to avoid using this field and rely on the default. The meaning of<br />
different possible values are:<br />
<br />
-1: Divide damage proportionally among all the target's limbs.<br />
-2: Hit one of the target's non-amputated limbs using random selection<br />
weighted by relative limb size. This may also be given as the<br />
macro Special_Attack_Target_Hit_Limb.<br />
other integer: Assumed to be a limb type from limbs.h. Targets the<br />
first non-amputated limb of the specified type, or the entire body<br />
if none are available. Special_Attack_Flag_Limb_Target_Preset,<br />
below, causes this to be interpreted as a limb index instead.<br />
string: Interpreted as a limb name. Targets the first non-amputated<br />
limb with the specified name, or the entire body if none is<br />
available.<br />
int array: Interpreted as an array of limb types. Each element will<br />
result in a lookup of the first non-amputated limb of the given<br />
type, and damage will be divided proportionally among those limbs<br />
present. If none of the limb types in the array are available,<br />
the entire body will be targeted.<br />
string array: As int array, but interpreting the elements as limb names<br />
rather than limb types.<br />
closure: Will be called with standard arguments, and is expected to<br />
return one of the values above.<br />
<br />
Special_Attack_Chance: The percentage chance that the special attack will<br />
be in the character's usable attack list in a given combat round. Must be<br />
a non-negative integer. See /lib/descriptors/special_attack.h for various<br />
sample value macros for this, such as Special_Attack_Chance_Occasional<br />
and Special_Attack_Chance_Somewhat_Frequent; it is strongly preferable to use<br />
one of these macros if one appropriate to your application is available,<br />
but using a literal integer value is acceptable if none of the macros do<br />
what you need.<br />
<br />
Special_Attack_Message: The message associated with the special attack.<br />
It is usually appropriate to avoid using this field and rely on the message<br />
that will be automatically generated by the _Vector, _Actuation, and _Type<br />
fields. Should be specified as a message array (as per 'man message'), in<br />
which any occurrence of the exact and entire string "%e" will be replaced<br />
with the opponent and "%l" will be replaced with the string name of the<br />
limb or limbs targeted. A degenerate form specified only using a string is<br />
supported for compatibility purposes, but is deprecated for use in new<br />
code. May be a closure, which will be called with damage arguments.<br />
to override, the actuation, vector, and damage type information will be<br />
used to automatically construct a message.<br />
<br />
Special_Attack_Stun: A randomizable amount of stunning that can be<br />
inflicted by the special attack. The actual amount of stun calculated from<br />
this setting, if specified, will be 10% to 100% of the value given. Is<br />
handled as a stun specification to do_damage() and is subject to the rules<br />
applicable per that function (notably, that the secondary effects are<br />
aborted if the main damage portion of the attack has no effect). May be<br />
a closure, which will be called with damage arguments. It is usually<br />
appropriate to avoid using this field and rely on stunning calculated from<br />
the _Power field's interaction with the _Type field.<br />
<br />
Special_Attack_Blind: A randomizable amount of blinding that can be<br />
inflicted by the special attack. The actual amount of blinding calculated<br />
from this setting, if specified, will be 10% to 100% of the value given.<br />
Is handled as a blinding specification to do_damage() and is subject to the<br />
rules applicable per that function. May be a closure, which will be called<br />
with damage arguments. It is usually appropriate to avoid using this field<br />
and rely on blinding calculated from the _Power field's interaction with<br />
the _Type field.<br />
<br />
Special_Attack_Deafen: A randomizable amount of deafening that can be<br />
inflicted by the special attack. The actual amount of deafening calculated<br />
from this setting, if specified, will be 10% to 100% of the value given.<br />
Is handled as a deafening specification to do_damage() and is subject to<br />
the rules applicable per that function. May be a closure, which will be<br />
called with damage arguments. It is usually appropriate to avoid using<br />
this field and rely on deafening calculated from the _Power field's<br />
interaction with the _Type field.<br />
<br />
Special_Attack_Numb: A randomizable amount of numbing that can be inflicted<br />
by the special attack. The actual amount of numbing calculated from this<br />
setting, if specified, will be 10% to 100% of the value given. Is handled<br />
as a numbing specification to do_damage() and is subject to the rules<br />
applicable per that function. May be a closure, which will be called with<br />
damage arguments. It is usually appropriate to avoid using this field and<br />
rely on numbing calculated from the _Power field's interaction with the<br />
_Type field.<br />
<br />
Special_Attack_Slow: A randomizable amount of slowing that can be inflicted<br />
by the special attack. The actual amount of slowing calculated from this<br />
setting, if specified, will be 10% to 100% of the value given. Is handled<br />
as a slowing specification to do_damage() and is subject to the rules<br />
applicable per that function. May be a closure, which will be called with<br />
damage arguments. It is usually appropriate to avoid using this field and<br />
rely on slowing calculated from the _Power field's interaction with the<br />
_Type field.<br />
<br />
Special_Attack_Poison: A randomizable amount of poisoning that can be<br />
inflicted by the special attack. The actual amount of poisoning calculated<br />
from this setting, if specified, will be 10% to 100% of the value given.<br />
Is handled as a poisoning specification to do_damage() and is subject to<br />
the rules applicable per that function. May be a closure, which will be<br />
called with damage arguments. It is usually appropriate to avoid using<br />
this field and rely on poisoning calculated from the _Power field's<br />
interaction with the _Type field.<br />
<br />
Special_Attack_Caust: A caust specification (c.f. 'man caust') associated<br />
with the special attack. If present, when the special attack occurs, the<br />
caust descriptor will be copied with deep_copy() and modified as follows:<br />
1) the Caust_Damage will be set to half the damage calculated for the<br />
special attack (from Special_Attack_Damage and Special_Attack_Modifier),<br />
2) the Caust_Type will be set the same as the Special_Attack_Type, 3) the<br />
Caust_Aggressor will be set to the character, and 3) the Caust_Target will<br />
be set to the limbs being hit by the special attack, with the flag<br />
Caust_Flag_Target_Preset turned on unless the entire body is being<br />
targeted. The modified copy of the caust descriptor will then be added<br />
to the opponent.<br />
<br />
Special_Attack_Condition: A condition descriptor which will be evaluated<br />
on the character performing the special attack, or a closure which, if<br />
specified, will be called with standard arguments. If the condition<br />
descriptor evaluation or closure returns False, the special attack will<br />
not be used at that time. Generally, common condition macros from<br />
/lib/conditions.h are used for this setting.<br />
<br />
Special_Attack_From: A field specifying where the special attack comes<br />
from, used by the code that automatically constructs special attack<br />
messages based on _Actuation, _Vector, _Type, and so on. Can be anything<br />
that would be valid as an element of a message array, such as this_object()<br />
in a character for a special attack originating from the character in<br />
general, "nowhere" for a special attack coming from nowhere, or<br />
({ 'r', 0, "eyes" }) for a special attack coming from a character's eyes<br />
(please note: test your special attack and use ({ 's', 0, "eyes" }) if<br />
needed to make the character's name show up). If an appropriate object<br />
or limb can be found in the specification, the Attack_Weapon field of<br />
attack descriptors generated by the special attack will be set accordingly.<br />
<br />
Special_Attack_Appearance: A descriptive field usable to override the<br />
appearance of the special attack calculated based on _Vector and _Type.<br />
<br />
Special_Attack_Energy_Costs: An array of specifications for energy cost<br />
descriptors defining the energy costs to use the special attack. The<br />
default is as if ({({ Energy_Spiritual, 10 })}) were given.<br />
<br />
Special_Attack_Placeholder: A presently unused field.<br />
<br />
Special_Attack_Strike: A field accepting an int or float value affecting<br />
the accuracy of the special attack. See /lib/descriptors/special_attack.h<br />
for a list of sample values for this field. It is preferable to use one<br />
of these if any appropriate to your application is available, but it is<br />
acceptable to specify a literal value if none of the macros does what you<br />
want.<br />
<br />
Special_Attack_Activity: The cost in activity points to perform the special<br />
attack. Defaults to 15 if the attack is being defined from an autonomon<br />
object, 0 otherwise. Must be a positive integer.<br />
<br />
Special_Attack_Size: A field accepting an int value specifying the size of<br />
the special attack. It is more often than not appropriate to avoid using<br />
this field and rely on the default value for the vector used. See<br />
/lib/descriptors/special_attack.h for a list of sample values for this<br />
field; it is preferable to use one of these if any appropriate to your<br />
application is available, but it is acceptable to specify a literal value<br />
if none of the macros does what you want.<br />
<br />
Special_Attack_Speech: The speech command (designated using one of the<br />
Speech_Command_X macros from the speech descriptor) using which the<br />
Special_Attack_Speak text is spoken; defaults to Speech_Command_Say.<br />
<br />
Special_Attack_Flags: Specifies flag values from among these:<br />
<br />
Special_Attack_Flag_Appearance_Plurality: When using the _Appearance<br />
field, specifies that your given _Appearance is plural. Specifying<br />
this flag then allows grammar related to the appearance of the special<br />
attack to be constructed correctly. Will cause attack descriptors<br />
generated by the special attack to have Attack_Flag_Pluralize_Vector<br />
turned on.<br />
<br />
Special_Attack_Flag_Bypass_Armour: Causes the special attack to ignore<br />
armour and related defenses. Will cause attack descriptors generated<br />
by the special attack to have Attack_Flag_Bypass_Armour turned on.<br />
<br />
Special_Attack_Flag_Untreatable: Causes wounds from the special attack<br />
to not flag affected limbs as treatable. Will cause attack descriptors<br />
generated by the special attack to have Attack_Flag_Untreatable turned<br />
on.<br />
<br />
Special_Attack_Flag_Inflict_Mental_Disorder: Causes the special attack,<br />
if successful, to cause a randomly selected mental disorder to the<br />
target. Will cause attack descriptors generated by the special attack<br />
to have Attack_Flag_Inflict_Mental_Disorder turned on.<br />
<br />
Special_Attack_Flag_Accidental: Causes the special attack to be treated<br />
as accidental. Will cause attack descriptors generated by the special<br />
attack to have Attack_Flag_Accidental turned on.<br />
<br />
Special_Attack_Flag_Definite_Article: Causes the appearance of the<br />
special attack to be described using the definite article rather than<br />
the indefinite ("the" rather than "a" or "an") if an article is used.<br />
<br />
Special_Attack_Flag_From_Separate: In the case where the _Actuation<br />
in use is a direct manipulation of the vector (e.g. Vector_Spit,<br />
Vector_Release; anything with set_actuation_vector_manipulating(True)),<br />
the default behavior in the presence of a _From field is to have the<br />
_From as the subject of the actuation, i.e. the _From is doing the<br />
spitting or releasing or what-have-you. This flag suppresses this<br />
behavior, causing the character to still be performing the vector,<br />
described as being from the _From field.<br />
<br />
Special_Attack_Flag_Pluralize_Vector: Causes the appearance of the<br />
special attack to be calculated using the plural case of the vector,<br />
e.g. "beams" rather than "beam", "arcs" rather than "arc". Will cause<br />
attack descriptors generated by the special attack to have<br />
Attack_Flag_Pluralize_Vector turned on.<br />
<br />
Special_Attack_Flag_Limb_Target_Preset: Causes an integer _Target<br />
value to be interpreted as an already-determined limb index on the<br />
target, rather than a limb type to be found.<br />
<br />
Special_Attack_Flag_Disjoint_Limb_Selection: Causes the special attack<br />
to be able to hit non-adjacent limbs when striking multiple limbs on a<br />
target. Will cause attack descriptors generated by the special attack<br />
to have Attack_Flag_Disjoint_Limb_Selection turned on.<br />
<br />
Special_Attack_Flag_Combine_Message: If specified, the _Message field<br />
is combined with the message content generated automatically rather<br />
than replacing it.<br />
<br />
Special_Attack_Flag_Message_Elide_From: If specified, the _From field<br />
does not affect generated messages, meaning it is only used to find<br />
the Attack_Weapon value to use.<br />
<br />
Special_Attack_Flag_Suppress_Result_Description: If specified, causes<br />
the special attack to not have an attack result description ("connects<br />
solidly", "barely connects" and so on) in its message content. Will<br />
cause attack descriptors generated by the special attack to have<br />
Attack_Flag_Suppress_Result_Description turned on.<br />
<br />
==See Also==<br />
<br />
[[man descriptors|descriptors(mechanisms)]], [[man add special attack|add_special_attack(lfun)]],<br />
[[man set special attacks|set_special_attacks(lfun)]], [[man query special attacks|query_special_attacks(lfun)]],<br />
[[man remove special attack|remove_special_attack(lfun)]], [[man message|message(lfun)]], [[man caust|caust(descriptors)]], [[man damage types|damage_types(build)]]</div>Laine