EVENT USESTEROIDS: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
Mblackwell (talk | contribs)
mNo edit summary
Clarify description of return value and add example
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
EVENT_USESTEROIDS is a [http://www.eduke32.com/wiki/index.php?title=EDuke32_event_list Game Event].
{{EventTable|1=EVENT_USESTEROIDS|2=player that executed the input|3=[[i|player->i]]|4=1 value}}
EVENT_USESTEROIDS is a [[EDuke32_event_list|Game Event]].


This [[event]] is called when the player presses the button assigned to Use Steroids (''R'' key by default).
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
[[Category:Events]]

Latest revision as of 12:31, 6 April 2024

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