A_MeleeAttack

From ZDoom Wiki
Jump to navigation Jump to search


Nuvolabomb.png Warning: The feature described on this page has been deprecated, and will no longer be supported or updated by the GZDoom developers. While some functionality may be retained for the purposes of backwards-compatibility, authors are strongly discouraged from utilizing this feature in future projects and to instead use A_CustomMeleeAttack. Compatibility with future GZDoom versions is not guaranteed.

A_MeleeAttack

(no parameters)


Performs a melee attack.

Properties used:

  • meleedamage value
Amount of damage, The formula is random(1,8)*value.
  • meleerange value
Maximum distance at which the attack can still hit something.
  • meleesound soundname
Sound being played if the actual attack happens.

Examples

This is a stronger version of the Demon which uses A_MeleeAttack for its bite:

 actor UltraDemon : Demon
 {
    health 800
    speed 15
    meleedamage 10
    meleerange 64
    meleesound "ultdemon/bite"
    states
    {
      Melee:
        SRG2 EF 6 A_FaceTarget
        SRG2 G 6 A_MeleeAttack
    }
 }