mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 19:52:40 +00:00
- Simple event dispatch system.
- atom.forceMove() proc. Ignores density and other Move() restrictions, but calls Exited() and Entered() - var/emagged moved to /obj/machinery class - anyprob() helper proc. - Mecha internal damage vars encapsulated. - Mech Fabricators now require robotics ID to operate. Emag removes this restriction. - Added Odysseus Medical Exosuit and it's parts. Has integrated Medical Hud and ability to mount medical modules. - Added Sleeper Medical module for medical exosuits. Similar to common sleepers, but no ability to inject reagents. - Added Cable Layer module for exosuits. Load with cable (attack cable with it), activate, walk over dismantled floor. - Added another exosuit internal damage type - short circuit. Short-circuited exosuits will drain powercell charge and power relay won't work. - You should be able to send messages to exosuit operators using Exosuit Control Console - Gygax armour and module capacity nerfed. - Exosuit weapon recharge time raised. - Bugfix: EMP actually drains exosuit cell and damages it git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2780 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
60
code/datums/helper_datums/events.dm
Normal file
60
code/datums/helper_datums/events.dm
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* WARRANTY VOID IF CODE USED
|
||||
*/
|
||||
|
||||
|
||||
/datum/events
|
||||
var/list/events
|
||||
|
||||
New()
|
||||
..()
|
||||
events = new
|
||||
|
||||
proc/addEventType(event_type)
|
||||
if(!(event_type in events) || !islist(events[event_type]))
|
||||
events[event_type] = list()
|
||||
return 1
|
||||
return
|
||||
|
||||
proc/addEvent(event_type,proc_holder,proc_name)
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
proc/clearEvent(event_type,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
|
||||
Reference in New Issue
Block a user