mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-11 15:14:27 +01:00
Merge pull request #839 from tigercat2000/MassDriveVG
Code rework of placing things on walls.
This commit is contained in:
@@ -14,10 +14,10 @@
|
||||
/obj/item/weapon/airlock_electronics,
|
||||
/obj/item/weapon/module/power_control,
|
||||
/obj/item/weapon/stock_parts,
|
||||
/obj/item/light_fixture_frame,
|
||||
/obj/item/apc_frame,
|
||||
/obj/item/alarm_frame,
|
||||
/obj/item/firealarm_frame,
|
||||
/obj/item/mounted/frame/light_fixture,
|
||||
/obj/item/mounted/frame/apc_frame,
|
||||
/obj/item/mounted/frame/alarm_frame,
|
||||
/obj/item/mounted/frame/firealarm,
|
||||
/obj/item/weapon/table_parts,
|
||||
/obj/item/weapon/rack_parts,
|
||||
/obj/item/weapon/camera_assembly,
|
||||
|
||||
@@ -525,14 +525,14 @@
|
||||
"You disassembled the broken APC frame.",\
|
||||
"\red You hear welding.")
|
||||
else
|
||||
new /obj/item/apc_frame(loc)
|
||||
new /obj/item/mounted/frame/apc_frame(loc)
|
||||
user.visible_message(\
|
||||
"\red [src] has been cut from the wall by [user.name] with the weldingtool.",\
|
||||
"You cut the APC frame from the wall.",\
|
||||
"\red You hear welding.")
|
||||
del(src)
|
||||
return
|
||||
else if (istype(W, /obj/item/apc_frame) && opened && emagged)
|
||||
else if (istype(W, /obj/item/mounted/frame/apc_frame) && opened && emagged)
|
||||
emagged = 0
|
||||
if (opened==2)
|
||||
opened = 1
|
||||
@@ -541,7 +541,7 @@
|
||||
"You replace the damaged APC frontal panel with a new one.")
|
||||
del(W)
|
||||
update_icon()
|
||||
else if (istype(W, /obj/item/apc_frame) && opened && ((stat & BROKEN) || malfhack))
|
||||
else if (istype(W, /obj/item/mounted/frame/apc_frame) && opened && ((stat & BROKEN) || malfhack))
|
||||
if (has_electronics)
|
||||
user << "You cannot repair this APC until you remove the electronics still inside."
|
||||
return
|
||||
|
||||
@@ -9,64 +9,6 @@
|
||||
#define LIGHT_BROKEN 2
|
||||
#define LIGHT_BURNED 3
|
||||
|
||||
|
||||
|
||||
/obj/item/light_fixture_frame
|
||||
name = "light fixture frame"
|
||||
desc = "Used for building lights."
|
||||
icon = 'icons/obj/lighting.dmi'
|
||||
icon_state = "tube-construct-item"
|
||||
flags = CONDUCT
|
||||
var/fixture_type = "tube"
|
||||
var/obj/machinery/light/newlight = null
|
||||
var/sheets_refunded = 2
|
||||
|
||||
/obj/item/light_fixture_frame/attackby(obj/item/weapon/W as obj, mob/living/user as mob, params)
|
||||
if (istype(W, /obj/item/weapon/wrench))
|
||||
new /obj/item/stack/sheet/metal( get_turf(src.loc), sheets_refunded )
|
||||
del(src)
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/light_fixture_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_loc(usr)
|
||||
if (!istype(loc, /turf/simulated/floor))
|
||||
usr << "\red [src.name] cannot be placed on this spot."
|
||||
return
|
||||
usr << "Attaching [src] to the wall."
|
||||
playsound(src.loc, 'sound/machines/click.ogg', 75, 1)
|
||||
var/constrdir = usr.dir
|
||||
var/constrloc = usr.loc
|
||||
if (!do_after(usr, 30))
|
||||
return
|
||||
switch(fixture_type)
|
||||
if("bulb")
|
||||
newlight = new /obj/machinery/light_construct/small(constrloc)
|
||||
if("tube")
|
||||
newlight = new /obj/machinery/light_construct(constrloc)
|
||||
newlight.dir = constrdir
|
||||
newlight.fingerprints = src.fingerprints
|
||||
newlight.fingerprintshidden = src.fingerprintshidden
|
||||
newlight.fingerprintslast = src.fingerprintslast
|
||||
|
||||
usr.visible_message("[usr.name] attaches [src] to the wall.", \
|
||||
"You attach [src] to the wall.")
|
||||
del(src)
|
||||
|
||||
/obj/item/light_fixture_frame/small
|
||||
name = "small light fixture frame"
|
||||
desc = "Used for building small lights."
|
||||
icon = 'icons/obj/lighting.dmi'
|
||||
icon_state = "bulb-construct-item"
|
||||
flags = CONDUCT
|
||||
fixture_type = "bulb"
|
||||
sheets_refunded = 1
|
||||
|
||||
/obj/machinery/light_construct
|
||||
name = "light fixture frame"
|
||||
desc = "A light fixture under construction."
|
||||
|
||||
@@ -255,7 +255,7 @@
|
||||
id = "newscaster_frame"
|
||||
build_type = AUTOLATHE
|
||||
materials = list("$metal" = 14000, "$glass" = 8000)
|
||||
build_path = /obj/item/newscaster_frame
|
||||
build_path = /obj/item/mounted/frame/newscaster_frame
|
||||
category = list("initial", "Construction")
|
||||
|
||||
/datum/design/rcd_ammo
|
||||
|
||||
Reference in New Issue
Block a user