EVENT USESTEROIDS

From EDukeWiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Event ID player# THISACTOR RETURN
EVENT_USESTEROIDS player that executed the input player->i 1 value

EVENT_USESTEROIDS is a Game Event.

This event is called when the player presses the button assigned to Use Steroids (R key by default).

Set gamevar RETURN to any non-zero value to skip the hardcoded effects of the steroids activation. However, note that you can still define your own behavior for the Steroids item within the event.

The following CON code would replicate the hardcoded Steroids behavior:

 var temp_steroids 0 0
 
 onevent EVENT_USESTEROIDS
     ife player[].steroids_amount 400
     {
         getp[].steroids_amount temp_steroids
         sub temp_steroids 1
         setp[].steroids_amount temp_steroids
         sound DUKE_TAKEPILLS
         quote 12
     }
 
     ifg player[].steroids_amount 0
         setp[].inven_icon 2
 
     set RETURN 1
 endevent