Files

26 lines
15 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><base href="../"><link rel="stylesheet" href="dmdoc.css"><title>/datum/event - Space Station 13</title></head><body><header><a href="index.html">Space Station 13</a> - <a href="index.html#modules">Modules</a> - <a href="index.html#types">Types</a><a href="datum/event.html#var">Var Details</a> - <a href="datum/event.html#proc">Proc Details</a></header><main><h1>event <aside>/<a href="datum.html">datum</a>/<a href="datum/event.html">event</a></aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/modules/events/event.dm#L55"><img src="git.png" width="16" height="16" title="code/modules/events/event.dm 55"></a></h1><p>NOTE: Times are measured in master controller ticks!</p><table class="summary" cellspacing="0"><tr><td colspan="2"><h2>Vars</h2></td></tr><tr><th><a href="datum/event.html#var/activeFor">activeFor</a></th><td>How long the event has existed. You don't need to change this.</td></tr><tr><th><a href="datum/event.html#var/announceWhen">announceWhen</a></th><td>When in the lifetime to call announce().</td></tr><tr><th><a href="datum/event.html#var/endWhen">endWhen</a></th><td>When in the lifetime the event should end.</td></tr><tr><th><a href="datum/event.html#var/endedAt">endedAt</a></th><td>When this event ended.</td></tr><tr><th><a href="datum/event.html#var/impact_area">impact_area</a></th><td>The area the event will hit</td></tr><tr><th><a href="datum/event.html#var/isRunning">isRunning</a></th><td>If this event is currently running. You should not change this.</td></tr><tr><th><a href="datum/event.html#var/name">name</a></th><td>The human-readable name of the event</td></tr><tr><th><a href="datum/event.html#var/noAutoEnd">noAutoEnd</a></th><td>Does the event end automatically after endWhen passes?</td></tr><tr><th><a href="datum/event.html#var/nominal_severity">nominal_severity</a></th><td>The severity the event has normally</td></tr><tr><th><a href="datum/event.html#var/role_requirements">role_requirements</a></th><td>A baseline requirement of different roles the event has at it's nominal severity</td></tr><tr><th><a href="datum/event.html#var/role_weights">role_weights</a></th><td>The base weight of each role on the event for the purpose of calculating event weight and resource cost</td></tr><tr><th><a href="datum/event.html#var/severity">severity</a></th><td>Severity. Lower means less severe, higher means more severe. Does not have to be supported. Is set on New().</td></tr><tr><th><a href="datum/event.html#var/startWhen">startWhen</a></th><td>When in the lifetime to call start().</td></tr><tr><th><a href="datum/event.html#var/startedAt">startedAt</a></th><td>When this event started.</td></tr><tr><td colspan="2"><h2>Procs</h2></td></tr><tr><th><a href="datum/event.html#proc/announce">announce</a></th><td>Called when the tick is equal to the announceWhen variable.</td></tr><tr><th><a href="datum/event.html#proc/end">end</a></th><td>Called on or after the tick is equal or more than endWhen</td></tr><tr><th><a href="datum/event.html#proc/event_resource_cost">event_resource_cost</a></th><td>The amount of people in different roles needed to handle an ongoing event.</td></tr><tr><th><a href="datum/event.html#proc/fake_announce">fake_announce</a></th><td>Override this to make a custom fake announcement that differs from the normal announcement.
Used for false alarms.
If this proc returns TRUE, the regular Announce() won't be called.</td></tr><tr><th><a href="datum/event.html#proc/get_weight">get_weight</a></th><td>Calculate the weight for rolling the event based on round circumstances.</td></tr><tr><th><a href="datum/event.html#proc/kill">kill</a></th><td>Called when start(), announce() and end() has all been called.</td></tr><tr><th><a href="datum/event.html#proc/lastProcessAt">lastProcessAt</a></th><td>Returns the latest point of event processing.</td></tr><tr><th><a href="datum/event.html#proc/process">process</a></th><td>Do not override this proc, instead use the appropiate procs.</td></tr><tr><th><a href="datum/event.html#proc/setup">setup</a></th><td>Called first before processing.</td></tr><tr><th><a href="datum/event.html#proc/start">start</a></th><td>Called when the tick is equal to the startWhen variable.</td></tr><tr><th><a href="datum/event.html#proc/tick">tick</a></th><td>Called on or after the tick counter is equal to startWhen.</td></tr></table><h2 id="var">Var Details</h2><h3 id="var/activeFor"><aside class="declaration">var </aside>activeFor <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/modules/events/event.dm#L69"><img src="git.png" width="16" height="16" title="code/modules/events/event.dm 69"></a></h3><p>How long the event has existed. You don't need to change this.</p><h3 id="var/announceWhen"><aside class="declaration">var </aside>announceWhen <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/modules/events/event.dm#L61"><img src="git.png" width="16" height="16" title="code/modules/events/event.dm 61"></a></h3><p>When in the lifetime to call announce().</p><h3 id="var/endWhen"><aside class="declaration">var </aside>endWhen <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/modules/events/event.dm#L63"><img src="git.png" width="16" height="16" title="code/modules/events/event.dm 63"></a></h3><p>When in the lifetime the event should end.</p><h3 id="var/endedAt"><aside class="declaration">var </aside>endedAt <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/modules/events/event.dm#L75"><img src="git.png" width="16" height="16" title="code/modules/events/event.dm 75"></a></h3><p>When this event ended.</p><h3 id="var/impact_area"><aside class="declaration">var </aside>impact_area <aside> /<a href="area.html">area</a></aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/modules/events/event.dm#L79"><img src="git.png" width="16" height="16" title="code/modules/events/event.dm 79"></a></h3><p>The area the event will hit</p><h3 id="var/isRunning"><aside class="declaration">var </aside>isRunning <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/modules/events/event.dm#L71"><img src="git.png" width="16" height="16" title="code/modules/events/event.dm 71"></a></h3><p>If this event is currently running. You should not change this.</p><h3 id="var/name"><aside class="declaration">var </aside>name <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/modules/events/event.dm#L57"><img src="git.png" width="16" height="16" title="code/modules/events/event.dm 57"></a></h3><p>The human-readable name of the event</p><h3 id="var/noAutoEnd"><aside class="declaration">var </aside>noAutoEnd <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/modules/events/event.dm#L77"><img src="git.png" width="16" height="16" title="code/modules/events/event.dm 77"></a></h3><p>Does the event end automatically after endWhen passes?</p><h3 id="var/nominal_severity"><aside class="declaration">var </aside>nominal_severity <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/modules/events/event.dm#L67"><img src="git.png" width="16" height="16" title="code/modules/events/event.dm 67"></a></h3><p>The severity the event has normally</p><h3 id="var/role_requirements"><aside class="declaration">var </aside>role_requirements <aside> /list</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/modules/events/event.dm#L84"><img src="git.png" width="16" height="16" title="code/modules/events/event.dm 84"></a></h3><p>A baseline requirement of different roles the event has at it's nominal severity</p><h3 id="var/role_weights"><aside class="declaration">var </aside>role_weights <aside> /list</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/modules/events/event.dm#L82"><img src="git.png" width="16" height="16" title="code/modules/events/event.dm 82"></a></h3><p>The base weight of each role on the event for the purpose of calculating event weight and resource cost</p><h3 id="var/severity"><aside class="declaration">var </aside>severity <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/modules/events/event.dm#L65"><img src="git.png" width="16" height="16" title="code/modules/events/event.dm 65"></a></h3><p>Severity. Lower means less severe, higher means more severe. Does not have to be supported. Is set on New().</p><h3 id="var/startWhen"><aside class="declaration">var </aside>startWhen <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/modules/events/event.dm#L59"><img src="git.png" width="16" height="16" title="code/modules/events/event.dm 59"></a></h3><p>When in the lifetime to call start().</p><h3 id="var/startedAt"><aside class="declaration">var </aside>startedAt <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/modules/events/event.dm#L73"><img src="git.png" width="16" height="16" title="code/modules/events/event.dm 73"></a></h3><p>When this event started.</p><h2 id="proc">Proc Details</h2><h3 id="proc/announce"><aside class="declaration">proc </aside>announce<aside>(false_alarm) <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/modules/events/event.dm#L133"><img src="git.png" width="16" height="16" title="code/modules/events/event.dm 133"></a></aside></h3><p>Called when the tick is equal to the announceWhen variable.</p>
<p>Allows you to announce before starting or vice versa.
Only called once.
Ensure no sleep is called. Use INVOKE_ASYNC to call procs which do.</p><h3 id="proc/end"><aside class="declaration">proc </aside>end<aside>() <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/modules/events/event.dm#L159"><img src="git.png" width="16" height="16" title="code/modules/events/event.dm 159"></a></aside></h3><p>Called on or after the tick is equal or more than endWhen</p>
<p>You can include code related to the event ending.
Do not place spawn() in here, instead use tick() to check for
the activeFor variable.
For example: if(activeFor == myOwnVariable + 30) doStuff()
Only called once.
Ensure no sleep is called. Use INVOKE_ASYNC to call procs which do.</p><h3 id="proc/event_resource_cost"><aside class="declaration">proc </aside>event_resource_cost<aside>() <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/modules/events/event.dm#L251"><img src="git.png" width="16" height="16" title="code/modules/events/event.dm 251"></a></aside></h3><p>The amount of people in different roles needed to handle an ongoing event.</p><h3 id="proc/fake_announce"><aside class="declaration">proc </aside>fake_announce<aside>() <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/modules/events/event.dm#L247"><img src="git.png" width="16" height="16" title="code/modules/events/event.dm 247"></a></aside></h3><p>Override this to make a custom fake announcement that differs from the normal announcement.
Used for false alarms.
If this proc returns TRUE, the regular Announce() won't be called.</p><h3 id="proc/get_weight"><aside class="declaration">proc </aside>get_weight<aside>(/list/total_resources) <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/modules/events/event.dm#L96"><img src="git.png" width="16" height="16" title="code/modules/events/event.dm 96"></a></aside></h3><p>Calculate the weight for rolling the event based on round circumstances.</p><h3 id="proc/kill"><aside class="declaration">proc </aside>kill<aside>() <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/modules/events/event.dm#L199"><img src="git.png" width="16" height="16" title="code/modules/events/event.dm 199"></a></aside></h3><p>Called when start(), announce() and end() has all been called.</p><h3 id="proc/lastProcessAt"><aside class="declaration">proc </aside>lastProcessAt<aside>() <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/modules/events/event.dm#L166"><img src="git.png" width="16" height="16" title="code/modules/events/event.dm 166"></a></aside></h3><p>Returns the latest point of event processing.</p><h3 id="proc/process">process<aside>() <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/modules/events/event.dm#L175"><img src="git.png" width="16" height="16" title="code/modules/events/event.dm 175"></a></aside></h3><p>Do not override this proc, instead use the appropiate procs.</p>
<p>This proc will handle the calls to the appropiate procs.
Ensure none of the code paths have a sleep in them. Use INVOKE_ASYNC to call procs which do.</p><h3 id="proc/setup"><aside class="declaration">proc </aside>setup<aside>() <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/modules/events/event.dm#L112"><img src="git.png" width="16" height="16" title="code/modules/events/event.dm 112"></a></aside></h3><p>Called first before processing.</p>
<p>Allows you to setup your event, such as randomly
setting the startWhen and or announceWhen variables.
Only called once.</p><h3 id="proc/start"><aside class="declaration">proc </aside>start<aside>() <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/modules/events/event.dm#L122"><img src="git.png" width="16" height="16" title="code/modules/events/event.dm 122"></a></aside></h3><p>Called when the tick is equal to the startWhen variable.</p>
<p>Allows you to start before announcing or vice versa.
Only called once.
Ensure no sleep is called. Use INVOKE_ASYNC to call procs which do.</p><h3 id="proc/tick"><aside class="declaration">proc </aside>tick<aside>() <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/modules/events/event.dm#L145"><img src="git.png" width="16" height="16" title="code/modules/events/event.dm 145"></a></aside></h3><p>Called on or after the tick counter is equal to startWhen.</p>
<p>You can include code related to your event or add your own
time stamped events.
Called more than once.
Ensure no sleep is called. Use INVOKE_ASYNC to call procs which do.</p></main><footer>paradise.dme <a href="https://github.com/ParadiseSS13/Paradise/tree/edee60476d21ee840643bd1abe7f6003a8c65773">edee604</a> (master) — <a href="https://github.com/SpaceManiac/SpacemanDMM/blob/master/crates/dmdoc/README.md">dmdoc 1.11.0</a></footer></body></html>