Files
Bubberstation/code/game/objects/items/apc_frame.dm
T
Cyberboss 9e1ef0ffe2 Global variable wrappers (#25325)
* Add the system for managed global variables

* Travis ban old globals

* So you CAN inline proccall, that's neat

* Fix that

* master.dm

* Remove the hack procs

* Move InitGlobals to the proper spot

* configuration.dm

* Fix the missing pre-slash

* clockcult.dm

* This is probably for the best

* Doy

* Fix shit

* Rest of the DEFINES tree

* Fix

* Use global. for access

* Update find_references_in_globals

Always hated that proc

Whoever made it must've bee a r e a l idiot...

* __HELPERS tree

* Move global initialization to master.

Fix the declaration

* database.dm

* Dat newline

* I said DECLARATIVE order!

* Here's something you can chew on @Iamgoofball

* game_modes.dm

* Fix this

* genetics.dm

* flavor_misc.dm

* More stuff

* Do it mso's way. Keep the controllers as global

* Make master actually see it

* Fix

* Finish _globalvars/lists

* Finish the rest of the _globalvars tree

* This is weird

* Migrate the controllers

* SLOTH -> GLOB

* Lighting globals

* round_start_time -> ticker

* PAI card list -> pai SS

* record_id_num -> static

* Diseases list -> SSdisease

* More disease globals to the SS

* More disease stuff

* Emote list

* Better and better

* Bluh

* So much stuff

* Ahh

* Wires

* dview

* station_areas

* Teleportlocs

* blood_splatter_icons

* Stuff and such

* More stuff

* RAD IO

* More stuff and such

* Blob shit

* Changeling stuff

* Add "Balance" to changelogs

* Balance for changelog compiler + Auto Tagging

* Update the PR template

* hivemind_bank

* Bip

* sacrificed

* Good shit

* Better define

* More cult shit

* Devil shit

* Gang shit

* > borers

Fix shit

* Rename the define

* Nuke

* Objectives

* Sandbox

* Multiverse sword

* Announce systems

* Stuff and such

* TC con

* Airlock

* doppllllerrrrrr

* holopads

* Shut up byond you inconsistent fuck

* Sneaky fuck

* Burp

* Bip

* Fixnshit

* Port without regard

* askdlfjs;

* asdfjasoidojfi

* Protected globals and more

* SO MANY

* ajsimkvahsaoisd

* akfdsiaopwimfeoiwafaw

* gsdfigjosidjfgiosdg

* AHHHHHHHHHHHHHHHHHHHHHHH!!!!!

* facerolll

* ASDFASDFASDF

* Removes the unused parts of dmm_suite

* WIP

* Fix quote

* asdfjauwfnkjs

* afwlunhskjfda

* asfjlaiwuefhaf

* SO CLOSE

* wwwweeeeeewwwww

* agdgmoewranwg

* HOLY MOTHER OF FUCK AND THATS JUST HALF THE JOB?!?

* Fix syntax errors

* 100 errors

* Another 100

* So many...

* Ugh

* More shit

* kilme

* Stuuuuuufffff

* ajrgmrlshio;djfa;sdkl

* jkbhkhjbmjvjmh

* soi soi soi

* butt

* TODAY WE LEARNED THAT GLOBAL AND STATIC ARE THE EXACT SAME FUCKING THING

* lllllllllllllllllllllllllllllllllllllllllll

* afsdijfiawhnflnjhnwsdfs

* yugykihlugk,kj

* time to go

* STUFFF!!!

* AAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHHHH!!!!!!!!!!!!!!!!!!!!!!!

* ngoaijdjlfkamsdlkf

* Break time

* aufjsdklfalsjfi

* CONTROL KAY AND PRAY

* IT COMPILEELEELELAKLJFKLDAFJLKFDJLADKJHFLJKAJGAHIEJALDFJ!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

* Goteem

* Fix testing mode

* This does not belong in this PR

* Convert it to a controller

* Eh, fuck this option

* Revert controllerization Ill do it some other time

* Fix

* Working controllerization

* FOR THE LOVE OF CHRIST PROTECT THE LOGS

* Protect admins and deadmins

* Use the inbuilt proc
2017-04-06 23:26:13 -06:00

111 lines
3.4 KiB
Plaintext

/obj/item/wallframe
materials = list(MAT_METAL=MINERAL_MATERIAL_AMOUNT*2)
flags = CONDUCT
origin_tech = "materials=1;engineering=1"
item_state = "syringe_kit"
w_class = WEIGHT_CLASS_SMALL
var/result_path
var/inverse = 0
// For inverse dir frames like light fixtures.
/obj/item/wallframe/proc/try_build(turf/on_wall, mob/user)
if(get_dist(on_wall,user)>1)
return
var/ndir = get_dir(on_wall, user)
if(!(ndir in GLOB.cardinal))
return
var/turf/T = get_turf(user)
var/area/A = get_area(T)
if(!isfloorturf(T))
to_chat(user, "<span class='warning'>You cannot place [src] on this spot!</span>")
return
if(A.always_unpowered)
to_chat(user, "<span class='warning'>You cannot place [src] in this area!</span>")
return
if(gotwallitem(T, ndir, inverse*2))
to_chat(user, "<span class='warning'>There's already an item on this wall!</span>")
return
return TRUE
/obj/item/wallframe/proc/attach(turf/on_wall, mob/user)
if(result_path)
playsound(src.loc, 'sound/machines/click.ogg', 75, 1)
user.visible_message("[user.name] attaches [src] to the wall.",
"<span class='notice'>You attach [src] to the wall.</span>",
"<span class='italics'>You hear clicking.</span>")
var/ndir = get_dir(on_wall,user)
if(inverse)
ndir = turn(ndir, 180)
var/obj/O = new result_path(get_turf(user), ndir, 1)
after_attach(O)
qdel(src)
/obj/item/wallframe/proc/after_attach(var/obj/O)
transfer_fingerprints_to(O)
/obj/item/wallframe/attackby(obj/item/weapon/W, mob/user, params)
..()
if(istype(W, /obj/item/weapon/screwdriver))
// For camera-building borgs
var/turf/T = get_step(get_turf(user), user.dir)
if(iswallturf(T))
T.attackby(src, user, params)
var/metal_amt = round(materials[MAT_METAL]/MINERAL_MATERIAL_AMOUNT)
var/glass_amt = round(materials[MAT_GLASS]/MINERAL_MATERIAL_AMOUNT)
if(istype(W, /obj/item/weapon/wrench) && (metal_amt || glass_amt))
to_chat(user, "<span class='notice'>You dismantle [src].</span>")
if(metal_amt)
new /obj/item/stack/sheet/metal(get_turf(src), metal_amt)
if(glass_amt)
new /obj/item/stack/sheet/glass(get_turf(src), glass_amt)
qdel(src)
// APC HULL
/obj/item/wallframe/apc
name = "\improper APC frame"
desc = "Used for repairing or building APCs"
icon = 'icons/obj/apc_repair.dmi'
icon_state = "apc_frame"
result_path = /obj/machinery/power/apc
inverse = 1
/obj/item/wallframe/apc/try_build(turf/on_wall, user)
if(!..())
return
var/turf/T = get_turf(user)
var/area/A = get_area(T)
if(A.get_apc())
to_chat(user, "<span class='warning'>This area already has an APC!</span>")
return //only one APC per area
if(!A.requires_power)
to_chat(user, "<span class='warning'>You cannot place [src] in this area!</span>")
return //can't place apcs in areas with no power requirement
for(var/obj/machinery/power/terminal/E in T)
if(E.master)
to_chat(user, "<span class='warning'>There is another network terminal here!</span>")
return
else
var/obj/item/stack/cable_coil/C = new /obj/item/stack/cable_coil(T)
C.amount = 10
to_chat(user, "<span class='notice'>You cut the cables and disassemble the unused power terminal.</span>")
qdel(E)
return TRUE
/obj/item/weapon/electronics
desc = "Looks like a circuit. Probably is."
icon = 'icons/obj/module.dmi'
icon_state = "door_electronics"
item_state = "electronic"
flags = CONDUCT
w_class = WEIGHT_CLASS_SMALL
origin_tech = "engineering=2;programming=1"
materials = list(MAT_METAL=50, MAT_GLASS=50)