[crossfire] Discrete damage type

Nicolas Weeger nicolas.weeger at laposte.net
Sat Apr 21 06:13:17 CDT 2007


Hello.

I just committed to SVN trunk changes that enable weapons to have discrete 
damage for each attack type.

It works quite simply:
* new object fields 'damage_<attacktype>', so 'damage_fire' and so, like 
the 'dam' field in living structure
* if at least one field is set, 'dam' is ignored for attack, and the discrete 
values are used instead


Implementation details, issues to check/fix:
* the discrete damage are stored in a 'discrete_damage' array allocated only 
if one value is set in archetype definition
* i only changed hit_player_attacktype to handle this discrete damage. It is 
used by many things, including spells attacks, i think.
* i know some parts (specially spell attacks) alter dam based on casting spell 
level. Thus that code should be changed to modify discrete_damage instead - 
shouldn't be too hard

Feel free to flame/comment/..., as usual.

Nicolas
-- 
http://nicolas.weeger.free.fr [Petit site d'images, de textes, de code, bref 
de l'aléatoire !]



More information about the crossfire mailing list