The RCD code is less ugly now.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4793 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
rockdtben@gmail.com
2012-10-02 00:35:00 +00:00
parent 5d6203c8ff
commit a39705d4d4
3 changed files with 117 additions and 222 deletions

View File

@@ -77,137 +77,4 @@
New()
..()
hud = new /obj/item/clothing/glasses/hud/security(src)
return
/**********************************************************************
Chemical things
***********************************************************************/
//Moved to modules/chemistry
/**********************************************************************
RCD
***********************************************************************/
/obj/item/borg/rcd
name = "robotic rapid-construction-device"
desc = "A device used to rapidly build walls/floor."
icon = 'icons/obj/items.dmi'
icon_state = "rcd"
flags = FPRINT | TABLEPASS| CONDUCT
force = 5.0
w_class = 3.0
// datum/effect/effect/system/spark_spread/spark_system
var/working = 0
var/mode = 1
var/disabled = 0
/*
New()
src.spark_system = new /datum/effect/effect/system/spark_spread
spark_system.set_up(5, 0, src)
spark_system.attach(src)
return
*/
proc/activate()
// spark_system.set_up(5, 0, src)
// src.spark_system.start()
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
attack_self(mob/user as mob)
//Change the mode
playsound(src.loc, 'sound/effects/pop.ogg', 50, 0)
if(mode == 1)
mode = 2
user << "Changed mode to 'Airlock'"
// src.spark_system.start()
return
if(mode == 2)
mode = 3
user << "Changed mode to 'Deconstruct'"
// src.spark_system.start()
return
if(mode == 3)
mode = 1
user << "Changed mode to 'Floor & Walls'"
// src.spark_system.start()
return
afterattack(atom/A, mob/user as mob)
if(istype(A,/area/shuttle)||istype(A,/turf/space/transit))//No RCDs on the shuttles -Sieve
disabled = 1
else
disabled = 0
if(!isrobot(user)|| disabled == 1) return
var/mob/living/silicon/robot/R = user
var/obj/item/weapon/cell/cell = R.cell
if(!cell) return
if((istype(A, /turf) || istype(A, /obj/machinery/door/airlock)))
switch(mode)
if(1)
if(istype(A, /turf/space))
if(!cell.use(30)) return
user << "Building Floor..."
activate()
A:ReplaceWithPlating()
return
if(istype(A, /turf/simulated/floor))
if(!cell.use(90)) return
user << "Building Wall ..."
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
if(do_after(user, 20))
activate()
A:ReplaceWithWall()
return
if(2)
if(istype(A, /turf/simulated/floor))
if(!cell.use(300)) return
user << "Building Airlock..."
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
if(do_after(user, 50))
activate()
var/obj/machinery/door/airlock/T = new /obj/machinery/door/airlock( A )
T.autoclose = 1
return
if(3)
if(istype(A, /turf/simulated/wall))
if(!cell.use(150)) return
user << "Deconstructing Wall..."
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
if(do_after(user, 40))
activate()
A:ReplaceWithPlating()
return
if(istype(A, /turf/simulated/floor))
user << "Deconstructing Floor..."
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
if(do_after(user, 50))
activate()
A:ReplaceWithSpace()
return
if(istype(A, /obj/machinery/door/airlock))
user << "Deconstructing Airlock..."
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
if(do_after(user, 50))
activate()
del(A)
return
return
return