Files
Bubberstation/code/game/objects/items/apc_frame.dm
carnie b84d12d949 *Small tidy-up of various helper procs*
-Turns out there was already a Gaussian PRNG proc already, used by mechs and turrets. I've replaced it with my one as mine has almost half the cost. (currently broken! still waiting for fixes to be pulled!)
-replaced between(min, val, max) with Clamp(val, min, max)
-get_turf(thing) now uses var/list/locs to locate its turf, rather than iterating up through loc of its loc of its loc...etc
-sign(num) moved to maths.dm
-InRange(val, min, max) replaced with IsInRange(val, min, max) (they were identical)
-Removed ismultitool() iswrench() iscoil() iswire() iswelder() iscrowbar() etc
-removed modulus(num) as abs() performs the same task! *roll-eyes*
-removed get_mob_with_client_list() as it is no longer needed (we have var/list/player_list now)
-removed get_turf_or_move() as it simply called get_turf
-removed get_turf_loc() as it was identical to get_turf()

*Additions:*
-The "Declare Ready" link in the lobby will automatically become "Join Game" if the round starts before you declare ready, so you don't have to click it twice
2013-05-27 12:21:43 +01:00

44 lines
1.3 KiB
Plaintext

// APC HULL
/obj/item/apc_frame
name = "APC frame"
desc = "Used for repairing or building APCs"
icon = 'icons/obj/apc_repair.dmi'
icon_state = "apc_frame"
flags = FPRINT | TABLEPASS| CONDUCT
/obj/item/apc_frame/attackby(obj/item/weapon/W as obj, mob/user as mob)
..()
if (istype(W, /obj/item/weapon/wrench))
new /obj/item/stack/sheet/metal( get_turf(src.loc), 2 )
del(src)
/obj/item/apc_frame/proc/try_build(turf/on_wall)
if (get_dist(on_wall,usr)>1)
return
var/ndir = get_dir(usr,on_wall)
if (!(ndir in cardinal))
return
var/turf/loc = get_turf(usr)
var/area/A = loc.loc
if (!istype(loc, /turf/simulated/floor))
usr << "\red APC cannot be placed on this spot."
return
if (A.requires_power == 0 || A.name == "Space")
usr << "\red APC cannot be placed in this area."
return
if (A.get_apc())
usr << "\red This area already has APC."
return //only one APC per area
for(var/obj/machinery/power/terminal/T in loc)
if (T.master)
usr << "\red There is another network terminal here."
return
else
var/obj/item/weapon/cable_coil/C = new /obj/item/weapon/cable_coil(loc)
C.amount = 10
usr << "You cut the cables and disassemble the unused power terminal."
del(T)
new /obj/machinery/power/apc(loc, ndir, 1)
del(src)