EVENT POSTDAMAGESPRITE: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
Fox (talk | contribs)
Created page with "'''EVENT_POSTDAMAGESPRITE''' is a Game Event. This event is triggered whenever a sprite is hit by a weapon, however it is executed after the damage. T..."
 
mNo edit summary
 
Line 1: Line 1:
{{EventTable|1=EVENT_POSTDAMAGESPRITE|2=-1|3=Damage Source|4=2-6 values}}
'''EVENT_POSTDAMAGESPRITE''' is a [[EDuke32_event_list|Game Event]].
'''EVENT_POSTDAMAGESPRITE''' is a [[EDuke32_event_list|Game Event]].


This event is triggered whenever a sprite is hit by a weapon, however it is executed after the damage.
This event is triggered whenever a sprite is hit by a weapon. It is executed after the damage is added to the sprite's [[htextra]] member.


This event is only executed if the tilenum was set with [[damageeventtile]] and [[damageeventtilerange]].
This event is only executed if the tilenum was set with [[damageeventtile]] and [[damageeventtilerange]].


[[THISACTOR]] equals the ID of the projectile or source of damage.
[[THISACTOR]] equals the spriteNum of the projectile or source of damage.


[[RETURN]] or the userdef [[return (userdef)|return]] 0 equals the ID of what is being damaged.
The [[RETURN]] gamevar is set to the spriteNum of the target that is being damaged.


The userdef return 1 through 5 equals the [[hitradius]] parameters. If there's no radius damage, return 1 equals -1.
The userdef return 1 through 5 equals the [[hitradius]] parameters. If there's no radius damage, return 1 equals -1.


See also [[EVENT_DAMAGEFLOOR]], [[EVENT_DAMAGECEILING]], [[EVENT_DAMAGEWALL]] and [[EVENT_DAMAGESPRITE]].
See also [[EVENT_DAMAGEFLOOR]], [[EVENT_DAMAGECEILING]], [[EVENT_DAMAGEWALL]] and [[EVENT_DAMAGESPRITE]].
== Return Values ==
The additional return values of this event are only set if the damage type is RADIUSDAMAGE, i.e. explosive damage. If the damage was not caused by an explosion, only `userdef.return 0` is set, and `userdef.return 1` will be set to -1.
Note that radius damage is hard-coded to override all previously accumulated damage in a single tic.
:; userdef.return 0 (alias RETURN)
:: Is set to the spritenum of the target sprite that is being damaged. Read-only.
:; userdef.return 1
:: Contains the blast radius if the damage type was radius damage. This value is set to -1 if no radius damage occurred.
:; userdef.return 2
:: Contains the damage dealt in the outermost blast radius area. (usually defined to be the lowest)
:; userdef.return 3
:: Contains the damage dealt in the second to outermost blast radius area.
:; userdef.return 4
:: Contains the damage dealt in the second to innermost blast radius area.
:; userdef.return 5
:: Contains the damage dealt in the innermost blast radius area. (usually defined to be the highest)


[[Category:Events]]
[[Category:Events]]

Latest revision as of 07:17, 5 February 2022

Event ID player# THISACTOR RETURN
EVENT_POSTDAMAGESPRITE -1 Damage Source 2-6 values

EVENT_POSTDAMAGESPRITE is a Game Event.

This event is triggered whenever a sprite is hit by a weapon. It is executed after the damage is added to the sprite's htextra member.

This event is only executed if the tilenum was set with damageeventtile and damageeventtilerange.

THISACTOR equals the spriteNum of the projectile or source of damage.

The RETURN gamevar is set to the spriteNum of the target that is being damaged.

The userdef return 1 through 5 equals the hitradius parameters. If there's no radius damage, return 1 equals -1.

See also EVENT_DAMAGEFLOOR, EVENT_DAMAGECEILING, EVENT_DAMAGEWALL and EVENT_DAMAGESPRITE.

Return Values

The additional return values of this event are only set if the damage type is RADIUSDAMAGE, i.e. explosive damage. If the damage was not caused by an explosion, only `userdef.return 0` is set, and `userdef.return 1` will be set to -1.

Note that radius damage is hard-coded to override all previously accumulated damage in a single tic.

userdef.return 0 (alias RETURN)
Is set to the spritenum of the target sprite that is being damaged. Read-only.
userdef.return 1
Contains the blast radius if the damage type was radius damage. This value is set to -1 if no radius damage occurred.
userdef.return 2
Contains the damage dealt in the outermost blast radius area. (usually defined to be the lowest)
userdef.return 3
Contains the damage dealt in the second to outermost blast radius area.
userdef.return 4
Contains the damage dealt in the second to innermost blast radius area.
userdef.return 5
Contains the damage dealt in the innermost blast radius area. (usually defined to be the highest)