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 ..()
@@ -189,7 +189,7 @@
var/obj/machinery/power/circuit_io/IO = null // Dummy power machine to move energy in/out without a bunch of code duplication.
var/throughput = 10000 // Give/take up to 10kW.
/obj/item/integrated_circuit/passive/power/powernet/initialize()
/obj/item/integrated_circuit/passive/power/powernet/Initialize()
IO = new(src)
return ..()
@@ -265,7 +265,7 @@
pull_data()
var/incoming = get_pin_data(IC_INPUT, 1)
if(!isnull(incoming))
result = ToDegrees(incoming)
result = TODEGREES(incoming)
set_pin_data(IC_OUTPUT, 1, result)
push_data()
@@ -283,7 +283,7 @@
pull_data()
var/incoming = get_pin_data(IC_INPUT, 1)
if(!isnull(incoming))
result = ToRadians(incoming)
result = TORADIANS(incoming)
set_pin_data(IC_OUTPUT, 1, result)
push_data()
@@ -125,7 +125,7 @@
/obj/item/integrated_circuit/transfer/pulsedemultiplexer/do_work()
var/output_index = get_pin_data(IC_INPUT, 1)
if(output_index == Clamp(output_index, 1, number_of_outputs))
if(output_index == CLAMP(output_index, 1, number_of_outputs))
activate_pin(round(output_index + 1 ,1))
/obj/item/integrated_circuit/transfer/pulsedemultiplexer/medium
@@ -296,7 +296,7 @@
/obj/item/integrated_circuit/input/advanced_locator/on_data_written()
var/rad = get_pin_data(IC_INPUT, 2)
if(isnum(rad))
rad = Clamp(rad, 0, 7)
rad = CLAMP(rad, 0, 7)
radius = rad
/obj/item/integrated_circuit/input/advanced_locator/do_work()
@@ -353,7 +353,7 @@
var/code = 30
var/datum/radio_frequency/radio_connection
/obj/item/integrated_circuit/input/signaler/initialize()
/obj/item/integrated_circuit/input/signaler/Initialize()
. = ..()
set_frequency(frequency)
// Set the pins so when someone sees them, they won't show as null
@@ -188,14 +188,14 @@
// These procs do not relocate the grenade, that's the callers responsibility
/obj/item/integrated_circuit/manipulation/grenade/proc/attach_grenade(var/obj/item/weapon/grenade/G)
attached_grenade = G
destroyed_event.register(attached_grenade, src, /obj/item/integrated_circuit/manipulation/grenade/proc/detach_grenade)
GLOB.destroyed_event.register(attached_grenade, src, /obj/item/integrated_circuit/manipulation/grenade/proc/detach_grenade)
size += G.w_class
desc += " \An [attached_grenade] is attached to it!"
/obj/item/integrated_circuit/manipulation/grenade/proc/detach_grenade()
if(!attached_grenade)
return
destroyed_event.unregister(attached_grenade, src, /obj/item/integrated_circuit/manipulation/grenade/proc/detach_grenade)
GLOB.destroyed_event.unregister(attached_grenade, src, /obj/item/integrated_circuit/manipulation/grenade/proc/detach_grenade)
attached_grenade = null
size = initial(size)
desc = initial(desc)
@@ -108,7 +108,7 @@
var/brightness = get_pin_data(IC_INPUT, 2)
if(new_color && isnum(brightness))
brightness = Clamp(brightness, 0, 6)
brightness = CLAMP(brightness, 0, 6)
light_rgb = new_color
light_brightness = brightness
@@ -305,7 +305,7 @@
text_output += "\an [name]"
else
text_output += "\an ["\improper[initial_name]"] labeled '[name]'"
text_output += " which is currently [get_pin_data(IC_INPUT, 1) ? "lit <font color=[led_color]>¤</font>" : "unlit."]"
text_output += " which is currently [get_pin_data(IC_INPUT, 1) ? "lit <font color=[led_color]>¤</font>" : "unlit."]"
to_chat(user,jointext(text_output,null))
/obj/item/integrated_circuit/output/led/red
@@ -467,8 +467,7 @@
/obj/item/integrated_circuit/output/holographic_projector/proc/destroy_hologram()
hologram.forceMove(src)
qdel(hologram)
QDEL_NULL(hologram)
// holo_beam.End()
// QDEL_NULL(holo_beam)
@@ -83,7 +83,7 @@
else
direc = 1
if(isnum(new_amount))
new_amount = Clamp(new_amount, 0, volume)
new_amount = CLAMP(new_amount, 0, volume)
transfer_amount = new_amount
@@ -132,7 +132,7 @@
if(!TS.Adjacent(TT))
activate_pin(3)
return
var/tramount = Clamp(min(transfer_amount, reagents.maximum_volume - reagents.total_volume), 0, reagents.maximum_volume)
var/tramount = CLAMP(min(transfer_amount, reagents.maximum_volume - reagents.total_volume), 0, reagents.maximum_volume)
if(ismob(target))//Blood!
if(istype(target, /mob/living/carbon))
var/mob/living/carbon/T = target
@@ -207,7 +207,7 @@
else
direc = 1
if(isnum(new_amount))
new_amount = Clamp(new_amount, 0, 50)
new_amount = CLAMP(new_amount, 0, 50)
transfer_amount = new_amount
/obj/item/integrated_circuit/reagent/pump/do_work()
@@ -329,7 +329,7 @@
else
direc = 1
if(isnum(new_amount))
new_amount = Clamp(new_amount, 0, 50)
new_amount = CLAMP(new_amount, 0, 50)
transfer_amount = new_amount
/obj/item/integrated_circuit/reagent/filter/do_work()
@@ -38,15 +38,6 @@
complexity = 10
inputs = list("enable ticking" = IC_PINTYPE_BOOLEAN, "delay time" = IC_PINTYPE_NUMBER)
activators = list("outgoing pulse" = IC_PINTYPE_PULSE_OUT)
<<<<<<< HEAD
spawn_flags = IC_SPAWN_RESEARCH
power_draw_per_use = 4
/obj/item/integrated_circuit/time/ticker/Destroy()
if(is_running)
processing_objects -= src
. = ..()
=======
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
power_draw_per_use = 5
var/delay = 2 SECONDS
@@ -56,7 +47,6 @@
// This, plus the fact it ticks more often will increase consumption non-linearly,
// and the circuit cooldown and will hopefully discourage stupidly fast ticking machines.
var/max_power_draw = 500
>>>>>>> dcc6cad... Fixes some circuit bugs. (#5897)
/obj/item/integrated_circuit/time/ticker/on_data_written()
var/delay_input = get_pin_data(IC_INPUT, 2)
@@ -68,27 +58,10 @@
var/do_tick = get_pin_data(IC_INPUT, 1)
if(do_tick && !is_running)
is_running = TRUE
<<<<<<< HEAD
processing_objects |= src
else if(is_running)
is_running = FALSE
processing_objects -= src
ticks_completed = 0
/obj/item/integrated_circuit/time/ticker/process()
var/process_ticks = process_schedule_interval("obj")
ticks_completed += process_ticks
if(ticks_completed >= ticks_to_pulse)
if(ticks_to_pulse >= process_ticks)
ticks_completed -= ticks_to_pulse
else
ticks_completed = 0
activate_pin(1)
=======
START_PROCESSING(SSobj, src)
tick()
else if(!do_tick && is_running)
is_running = FALSE
>>>>>>> dcc6cad... Fixes some circuit bugs. (#5897)
/obj/item/integrated_circuit/time/ticker/proc/tick()
@@ -71,7 +71,7 @@
var/result = null
var/A = get_pin_data(IC_INPUT, 1)
if(!isnull(A))
result = Tan(A)
result = TAN(A)
set_pin_data(IC_OUTPUT, 1, result)
push_data()
@@ -91,7 +91,7 @@
var/result = null
var/A = get_pin_data(IC_INPUT, 1)
if(!isnull(A))
result = Csc(A)
result = CSC(A)
set_pin_data(IC_OUTPUT, 1, result)
push_data()
@@ -112,7 +112,7 @@
var/result = null
var/A = get_pin_data(IC_INPUT, 1)
if(!isnull(A))
result = Sec(A)
result = SEC(A)
set_pin_data(IC_OUTPUT, 1, result)
push_data()
@@ -133,7 +133,7 @@
var/result = null
var/A = get_pin_data(IC_INPUT, 1)
if(!isnull(A))
result = Cot(A)
result = COT(A)
set_pin_data(IC_OUTPUT, 1, result)
push_data()