mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
- Added Exosuit Nuclear Reactor - Added Ripley construction steps sprites (courtesy of WJohnston) - Exosuit Sleeper can now inject occupant with reagents taken from Syringe Gun - Exosuit Cable Layer will now auto-dismantle floors - Exosuit Heavy Lazer cooldown increased, Scattershot now fires medium calibre ammo (less damage) - EMP now drains half of current exosuit cell charge, not half of maximum charge. - Exosuit wreckage can be pulled - Fixed several possible exosuit equipment runtimes - Moved all mecha-related icons to icons/mecha - Mecha equipment messages will show equipment icons in chat window - Fixed mecha creation reports being sent at wrong construction step - Played with changelog markup. For some reason javascript is extremely slow in byond browser, I'll look into it. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3057 316c924e-a436-60f5-8080-3fe189b3f50e
67 lines
1.6 KiB
Plaintext
67 lines
1.6 KiB
Plaintext
/*
|
|
* WARRANTY VOID IF CODE USED
|
|
*/
|
|
|
|
|
|
/datum/events
|
|
var/list/events
|
|
|
|
New()
|
|
..()
|
|
events = new
|
|
|
|
proc/addEventType(event_type as text)
|
|
if(!(event_type in events) || !islist(events[event_type]))
|
|
events[event_type] = list()
|
|
return 1
|
|
return
|
|
|
|
|
|
// Arguments: event_type as text, proc_holder as datum, proc_name as text
|
|
// Returns: New event, null on error.
|
|
proc/addEvent(event_type as text, proc_holder, proc_name as text)
|
|
if(!event_type || !proc_holder || !proc_name)
|
|
return
|
|
addEventType(event_type)
|
|
var/list/event = events[event_type]
|
|
var/datum/event/E = new /datum/event(proc_holder,proc_name)
|
|
event += E
|
|
return E
|
|
|
|
// Arguments: event_type as text, any number of additional arguments to pass to event handler
|
|
// Returns: null
|
|
proc/fireEvent()
|
|
//world << "Events in [args[1]] called"
|
|
var/list/event = listgetindex(events,args[1])
|
|
if(istype(event))
|
|
spawn(-1)
|
|
for(var/datum/event/E in event)
|
|
if(!E.Fire(arglist(args.Copy(2))))
|
|
clearEvent(args[1],E)
|
|
return
|
|
|
|
// Arguments: event_type as text, E as /datum/event
|
|
// Returns: 1 if event cleared, null on error
|
|
proc/clearEvent(event_type as text, datum/event/E)
|
|
if(!event_type || !E)
|
|
return
|
|
var/list/event = listgetindex(events,event_type)
|
|
event -= E
|
|
return 1
|
|
|
|
|
|
/datum/event
|
|
var/listener
|
|
var/proc_name
|
|
|
|
New(tlistener,tprocname)
|
|
listener = tlistener
|
|
proc_name = tprocname
|
|
return ..()
|
|
|
|
proc/Fire()
|
|
//world << "Event fired"
|
|
if(listener)
|
|
call(listener,proc_name)(arglist(args))
|
|
return 1
|
|
return |