A_CustomMeleeAttack

From ZDoom Wiki
Jump to: navigation, search

A_CustomMeleeAttack (int damage[, str meleesound[, str misssound[, str damagetype[, bool bleed]]]])


Causes the actor to execute a melee attack with the specified parameters.


  • damage: The amount of damage to perform. This can be an exact value or an expression.
  • meleesound: The sound to make when the melee successfully hits.
  • misssound: The sound to make when the melee attack misses. If this is not provided, meleesound will always be played.
  • damagetype: The type of damage to do.
  • bleed: If true, targets will bleed when hit.


Examples

This is the Revenant's melee sequence:

 Melee:
   SKEL G 0 A_FaceTarget
   SKEL G 6 A_SkelWhoosh
   SKEL H 6 A_FaceTarget
   SKEL I 6 A_SkelFist
   goto See

The same sequence could be simulated this way:

 Melee:
   SKEL G 0 A_FaceTarget
   SKEL G 6 A_SkelWhoosh
   SKEL H 6 A_FaceTarget
   SKEL I 6 A_CustomMeleeAttack(random(1,10)*6,"skeleton/melee","none") // Does not make any sound when missing