EVENT CHECKTOUCHDAMAGE

From EDukeWiki
Jump to navigation Jump to search
Event ID player# THISACTOR RETURN
EVENT_CHECKTOUCHDAMAGE player touching wall/sprite player->i 1 value

EVENT_CHECKTOUCHDAMAGE is a Game Event.

This event is triggered in P_CheckTouchDamage() whenever the player collides with walls and sprites.

The value of RETURN is set to the result provided by clipmove and so can be decoded in the same way:

  • If player touched a sprite, RETURN = spriteNum + 49152
  • If player touched a wall, RETURN = wallNum + 32768

Set RETURN to -1 to prevent hardcoded touch damage effects from occurring.

You can also set RETURN to that of a different spriteNum / wallNum, to trigger hardcoded effects of that sprite.

The following picnums have hardcoded touch effects:

  • 230 (BIGFORCE overwall): Create a forcefield effect and sets hurt_delay to 26, no damage.
  • 663 (W_FORCEFIELD overwall): Deal 5 damage, push player back, create forcefield effect, set hurt_delay to 16.
  • 911 (CACTUS sprite): Subtracts 5 HP on touch and sets hurt_delay to 16.