mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +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
|
||||
@@ -106,7 +106,7 @@ Data storage vars:
|
||||
while(state)
|
||||
sleep(1)
|
||||
if(++lag>10)
|
||||
CRASH("The global_iterator loop \ref[src] failed to terminate in designated timeframe. Last exec - [get_last_exec_time_as_text()].")
|
||||
CRASH("The global_iterator loop \ref[src] failed to terminate in designated timeframe. This may be caused by server lagging.")
|
||||
return 1
|
||||
|
||||
proc/process()
|
||||
@@ -123,7 +123,7 @@ Data storage vars:
|
||||
|
||||
proc/set_delay(new_delay)
|
||||
if(isnum(new_delay))
|
||||
delay = new_delay>0?(new_delay):1
|
||||
delay = max(1, round(new_delay))
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
return 0
|
||||
setEffects(aeffectin,aeffectout)
|
||||
setForceTeleport(afteleport)
|
||||
setSounds(asoundin)
|
||||
setSounds(asoundin,asoundout)
|
||||
return 1
|
||||
|
||||
//must succeed
|
||||
@@ -108,9 +108,7 @@
|
||||
playSpecials(curturf,effectin,soundin)
|
||||
|
||||
if(force_teleport)
|
||||
teleatom.loc.Exited(teleatom)
|
||||
teleatom.loc = destturf
|
||||
teleatom.loc.Entered(teleatom)
|
||||
teleatom.forceMove(destturf)
|
||||
playSpecials(destturf,effectout,soundout)
|
||||
else
|
||||
if(teleatom.Move(destturf))
|
||||
|
||||
Reference in New Issue
Block a user