Merge branch 'master' into upstream-merge-5897

This commit is contained in:
Novacat
2019-03-28 14:39:41 -04:00
committed by GitHub
1471 changed files with 49032 additions and 48743 deletions
@@ -20,14 +20,14 @@
var/detail_color = COLOR_ASSEMBLY_BLACK
/obj/item/device/electronic_assembly/initialize()
/obj/item/device/electronic_assembly/Initialize()
battery = new(src)
processing_objects |= src
START_PROCESSING(SSobj, src)
return ..()
/obj/item/device/electronic_assembly/Destroy()
battery = null // It will be qdel'd by ..() if still in our contents
processing_objects -= src
STOP_PROCESSING(SSobj, src)
return ..()
/obj/item/device/electronic_assembly/process()
@@ -108,7 +108,7 @@
icon_state = "circuitry"
worn_state = "circuitry"
/obj/item/clothing/under/circuitry/initialize()
/obj/item/clothing/under/circuitry/Initialize()
setup_integrated_circuit(/obj/item/device/electronic_assembly/clothing)
return ..()
@@ -121,7 +121,7 @@
icon_state = "circuitry"
item_state = "circuitry"
/obj/item/clothing/gloves/circuitry/initialize()
/obj/item/clothing/gloves/circuitry/Initialize()
setup_integrated_circuit(/obj/item/device/electronic_assembly/clothing/small)
return ..()
@@ -134,7 +134,7 @@
icon_state = "circuitry"
item_state = "night" // The on-mob sprite would be identical anyways.
/obj/item/clothing/glasses/circuitry/initialize()
/obj/item/clothing/glasses/circuitry/Initialize()
setup_integrated_circuit(/obj/item/device/electronic_assembly/clothing/small)
return ..()
@@ -146,7 +146,7 @@
icon_state = "circuitry"
item_state = "circuitry"
/obj/item/clothing/shoes/circuitry/initialize()
/obj/item/clothing/shoes/circuitry/Initialize()
setup_integrated_circuit(/obj/item/device/electronic_assembly/clothing/small)
return ..()
@@ -158,7 +158,7 @@
icon_state = "circuitry"
item_state = "circuitry"
/obj/item/clothing/head/circuitry/initialize()
/obj/item/clothing/head/circuitry/Initialize()
setup_integrated_circuit(/obj/item/device/electronic_assembly/clothing/small)
return ..()
@@ -170,7 +170,7 @@
icon_state = "circuitry"
item_state = "circuitry"
/obj/item/clothing/ears/circuitry/initialize()
/obj/item/clothing/ears/circuitry/Initialize()
setup_integrated_circuit(/obj/item/device/electronic_assembly/clothing/small)
return ..()
@@ -182,6 +182,6 @@
icon_state = "circuitry"
item_state = "circuitry"
/obj/item/clothing/suit/circuitry/initialize()
/obj/item/clothing/suit/circuitry/Initialize()
setup_integrated_circuit(/obj/item/device/electronic_assembly/clothing/large)
return ..()
@@ -1,84 +1,84 @@
/obj/item/device/assembly/electronic_assembly
name = "electronic device"
desc = "It's a case for building electronics with. It can be attached to other small devices."
icon_state = "setup_device"
var/opened = 0
var/obj/item/device/electronic_assembly/device/EA
/obj/item/device/assembly/electronic_assembly/New()
EA = new(src)
EA.holder = src
..()
/obj/item/device/assembly/electronic_assembly/attackby(obj/item/I as obj, mob/user as mob)
if (I.is_crowbar())
toggle_open(user)
else if (opened)
EA.attackby(I, user)
else
..()
/obj/item/device/assembly/electronic_assembly/proc/toggle_open(mob/user)
playsound(get_turf(src), 'sound/items/Crowbar.ogg', 50, 1)
opened = !opened
EA.opened = opened
to_chat(user, "<span class='notice'>You [opened ? "opened" : "closed"] \the [src].</span>")
secured = 1
update_icon()
/obj/item/device/assembly/electronic_assembly/update_icon()
if(EA)
icon_state = initial(icon_state)
else
icon_state = initial(icon_state)+"0"
if(opened)
icon_state = icon_state + "-open"
/obj/item/device/assembly/electronic_assembly/attack_self(mob/user as mob)
if(EA)
EA.attack_self(user)
/obj/item/device/assembly/electronic_assembly/pulsed(var/radio = 0) //Called when another assembly acts on this one, var/radio will determine where it came from for wire calcs
if(EA)
for(var/obj/item/integrated_circuit/built_in/device_input/I in EA.contents)
I.do_work()
return
/obj/item/device/assembly/electronic_assembly/examine(mob/user)
.=..(user, 1)
if(EA)
for(var/obj/item/integrated_circuit/IC in EA.contents)
IC.external_examine(user)
/obj/item/device/assembly/electronic_assembly/verb/toggle()
set src in usr
set category = "Object"
set name = "Open/Close Device Assembly"
set desc = "Open or close device assembly!"
toggle_open(usr)
/obj/item/device/electronic_assembly/device
name = "electronic device"
icon_state = "setup_device"
desc = "It's a tiny electronic device with specific use for attaching to other devices."
var/obj/item/device/assembly/electronic_assembly/holder
w_class = ITEMSIZE_TINY
max_components = IC_COMPONENTS_BASE * 3/4
max_complexity = IC_COMPLEXITY_BASE * 3/4
/obj/item/device/electronic_assembly/device/New()
..()
var/obj/item/integrated_circuit/built_in/device_input/input = new(src)
var/obj/item/integrated_circuit/built_in/device_output/output = new(src)
input.assembly = src
output.assembly = src
/obj/item/device/electronic_assembly/device/check_interactivity(mob/user)
if(!CanInteract(user, state = deep_inventory_state))
return 0
return 1
/obj/item/device/assembly/electronic_assembly
name = "electronic device"
desc = "It's a case for building electronics with. It can be attached to other small devices."
icon_state = "setup_device"
var/opened = 0
var/obj/item/device/electronic_assembly/device/EA
/obj/item/device/assembly/electronic_assembly/New()
EA = new(src)
EA.holder = src
..()
/obj/item/device/assembly/electronic_assembly/attackby(obj/item/I as obj, mob/user as mob)
if (I.is_crowbar())
toggle_open(user)
else if (opened)
EA.attackby(I, user)
else
..()
/obj/item/device/assembly/electronic_assembly/proc/toggle_open(mob/user)
playsound(get_turf(src), 'sound/items/Crowbar.ogg', 50, 1)
opened = !opened
EA.opened = opened
to_chat(user, "<span class='notice'>You [opened ? "opened" : "closed"] \the [src].</span>")
secured = 1
update_icon()
/obj/item/device/assembly/electronic_assembly/update_icon()
if(EA)
icon_state = initial(icon_state)
else
icon_state = initial(icon_state)+"0"
if(opened)
icon_state = icon_state + "-open"
/obj/item/device/assembly/electronic_assembly/attack_self(mob/user as mob)
if(EA)
EA.attack_self(user)
/obj/item/device/assembly/electronic_assembly/pulsed(var/radio = 0) //Called when another assembly acts on this one, var/radio will determine where it came from for wire calcs
if(EA)
for(var/obj/item/integrated_circuit/built_in/device_input/I in EA.contents)
I.do_work()
return
/obj/item/device/assembly/electronic_assembly/examine(mob/user)
.=..(user, 1)
if(EA)
for(var/obj/item/integrated_circuit/IC in EA.contents)
IC.external_examine(user)
/obj/item/device/assembly/electronic_assembly/verb/toggle()
set src in usr
set category = "Object"
set name = "Open/Close Device Assembly"
set desc = "Open or close device assembly!"
toggle_open(usr)
/obj/item/device/electronic_assembly/device
name = "electronic device"
icon_state = "setup_device"
desc = "It's a tiny electronic device with specific use for attaching to other devices."
var/obj/item/device/assembly/electronic_assembly/holder
w_class = ITEMSIZE_TINY
max_components = IC_COMPONENTS_BASE * 3/4
max_complexity = IC_COMPLEXITY_BASE * 3/4
/obj/item/device/electronic_assembly/device/New()
..()
var/obj/item/integrated_circuit/built_in/device_input/input = new(src)
var/obj/item/integrated_circuit/built_in/device_output/output = new(src)
input.assembly = src
output.assembly = src
/obj/item/device/electronic_assembly/device/check_interactivity(mob/user)
if(!CanInteract(user, state = deep_inventory_state))
return 0
return 1
@@ -25,7 +25,7 @@
"hot pink" = COLOR_ASSEMBLY_HOT_PINK
)
/obj/item/device/integrated_electronics/detailer/initialize()
/obj/item/device/integrated_electronics/detailer/Initialize()
update_icon()
return ..()