A Explode: Difference between revisions

From ZDoom Wiki
Jump to navigation Jump to search
m (r3860 changes)
m (→‎Example: Slight Example Edit)
Line 28: Line 28:
{
{
Death:
Death:
QEX1 A 0 [[A_PlaySoundEx]]("Weapon/GenericExplode","Weapon")
QEX1 A 0 [[A_PlaySound]]("Weapon/GenericExplode", Chan_Weapon)
QEX1 A 0 '''A_Explode'''(100,128)
QEX1 A 5 '''A_Explode'''(100, 128)
QEX1 A 5
QEX1 BCDE 5
QEX1 B 5
QEX1 CDE 5
Stop
Stop
}
}

Revision as of 00:55, 18 November 2012

A_Explode [(int explosiondamage [, int explosionradius [, bool hurtshooter [, bool alert[, int fulldamageradius[, int nails[, int naildamage]]]]]])]
A_Explode [(int explosiondamage [, int explosionradius [, int flags [, bool alert[, int fulldamageradius[, int nails[, int naildamage]]]]]])] (development version r3860+ only)

Performs an explosive (radius) attack. The amount of damage and the attack's radius are specified with explosiondamage and explosionradius, respectively. If the actor is a missile, you can set hurtshooter to 0 so that its originator will not be harmed by the attack. If the hurtshooter parameter is omitted, the shot will assume normal behavior and damage the shooter. The parameters are:

  • explosiondamage: How much damage are inflicted at the center of the explosion. (Default: 128)
  • explosionradius: The area covered by the damage (damage inflicted drop linearly with distance). (Default: 128)
  • hurtshooter: Whether the shooter can be damaged by the explosions from his or her own projectiles. (Default: true) (deprecated in development version 3860, but still valid in official version 4.14.3.)
  • flags: The following flags can be combined by using the | character between the constant names: (development version r3860+ only)
    • XF_HURTSOURCE — Hurts the source: if set, the source can be damaged by the explosion. Note that the source is not necessarily the calling actor. This flag is set by default. (development version r3860+ only)
    • XF_NOTMISSILE — Not a missile: if set, the calling actor is considered to be the source. By default, the calling actor is assumed to be a projectile, and the source is therefore considered to be the calling actor's target. (development version r3860+ only)
  • alert: Whether the explosion rings the alarm? (Default: true)
  • fulldamageradius: The area within which full damage is inflicted. (Default: 0)
  • nails: The number of horizontal hitscan attacks performed in a ring. (Default: 0) A value of 30 emulates the A_NailBomb codepointer from SMMU, while still allowing to modify all other parameters from A_Explode.
  • naildamage: The amount of damage inflicted by nails, if any. (Default: 10)

Do not use the old actor property method of passing the parameters. Only use the parameters of A_Explode directly.

Example

Actor MyGrenade : Grenade
{
	Speed 17
	BounceFactor 0.4
	BounceCount 6
	States
	{
	Death:
		QEX1 A 0 A_PlaySound("Weapon/GenericExplode", Chan_Weapon)
		QEX1 A 5 A_Explode(100, 128)
		QEX1 BCDE 5
		Stop
	}
}