Merge branch 'master' into upstream-merge-32311
This commit is contained in:
@@ -20,8 +20,6 @@
|
||||
var/charge_tick = FALSE
|
||||
var/charge_delay = 4
|
||||
var/use_cyborg_cell = TRUE
|
||||
max_integrity = 50
|
||||
armor = list(melee = 50, bullet = 70, laser = 70, energy = 100, bomb = 10, bio = 100, rad = 100, fire = 0, acid = 0)
|
||||
|
||||
/obj/item/device/electronic_assembly/proc/check_interactivity(mob/user)
|
||||
return user.canUseTopic(src,be_close = TRUE)
|
||||
@@ -32,6 +30,8 @@
|
||||
START_PROCESSING(SScircuit, src)
|
||||
materials[MAT_METAL] = round((max_complexity + max_components) / 4) * SScircuit.cost_multiplier
|
||||
|
||||
|
||||
|
||||
/obj/item/device/electronic_assembly/Destroy()
|
||||
STOP_PROCESSING(SScircuit, src)
|
||||
return ..()
|
||||
@@ -273,9 +273,22 @@
|
||||
|
||||
|
||||
/obj/item/device/electronic_assembly/afterattack(atom/target, mob/user, proximity)
|
||||
for(var/obj/item/integrated_circuit/input/S in assembly_components)
|
||||
if(S.sense(target,user,proximity))
|
||||
visible_message("<span class='notice'> [user] waves [src] around [target].</span>")
|
||||
for(var/obj/item/integrated_circuit/input/sensor/S in assembly_components)
|
||||
if(!proximity)
|
||||
if(istype(S,/obj/item/integrated_circuit/input/sensor/ranged)||(!user))
|
||||
if(user.client)
|
||||
if(!(target in view(user.client)))
|
||||
continue
|
||||
else
|
||||
if(!(target in view(user)))
|
||||
continue
|
||||
else
|
||||
continue
|
||||
S.set_pin_data(IC_OUTPUT, 1, WEAKREF(target))
|
||||
S.check_then_do_work()
|
||||
S.scan(target)
|
||||
|
||||
visible_message("<span class='notice'> [user] waves [src] around [target].</span>")
|
||||
|
||||
|
||||
/obj/item/device/electronic_assembly/screwdriver_act(mob/living/user, obj/item/S)
|
||||
@@ -313,11 +326,8 @@
|
||||
interact(user)
|
||||
return TRUE
|
||||
else
|
||||
for(var/obj/item/integrated_circuit/input/S in assembly_components)
|
||||
S.attackby_react(I,user,user.a_intent)
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/item/device/electronic_assembly/attack_self(mob/user)
|
||||
if(!check_interactivity(user))
|
||||
return
|
||||
@@ -381,6 +391,7 @@
|
||||
/obj/item/device/electronic_assembly/proc/get_object()
|
||||
return src
|
||||
|
||||
|
||||
// Returns the location to be used for dropping items.
|
||||
// Same as the regular drop_location(), but with checks being run on acting_object if necessary.
|
||||
/obj/item/integrated_circuit/drop_location()
|
||||
@@ -395,7 +406,6 @@
|
||||
/obj/item/device/electronic_assembly/default //The /default electronic_assemblys are to allow the introduction of the new naming scheme without breaking old saves.
|
||||
name = "type-a electronic assembly"
|
||||
|
||||
|
||||
/obj/item/device/electronic_assembly/calc
|
||||
name = "type-b electronic assembly"
|
||||
icon_state = "setup_small_calc"
|
||||
@@ -497,4 +507,4 @@
|
||||
/obj/item/device/electronic_assembly/drone/arms
|
||||
name = "type-b electronic drone"
|
||||
icon_state = "setup_drone_arms"
|
||||
desc = "It's a case, for building mobile electronics with. This one is armed and dangerous."
|
||||
desc = "It's a case, for building mobile electronics with. This one is armed and dangerous."
|
||||
@@ -56,7 +56,7 @@
|
||||
data_to_show = A.name
|
||||
to_chat(user, "<span class='notice'>You write '[data_to_write ? data_to_show : "NULL"]' to the '[io]' pin of \the [io.holder].</span>")
|
||||
else if(io.io_type == PULSE_CHANNEL)
|
||||
io.holder.check_then_do_work(io.ord,ignore_power = TRUE)
|
||||
io.holder.check_then_do_work(ignore_power = TRUE)
|
||||
to_chat(user, "<span class='notice'>You pulse \the [io.holder]'s [io].</span>")
|
||||
|
||||
io.holder.interact(user) // This is to update the UI.
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
io_type_override = io_list_copy[io_entry]
|
||||
|
||||
if(io_type_override)
|
||||
io_list.Add(new io_type_override(src, io_entry, default_data, pin_type,i))
|
||||
io_list.Add(new io_type_override(src, io_entry, default_data, pin_type))
|
||||
else
|
||||
io_list.Add(new io_type(src, io_entry, default_data, pin_type,i))
|
||||
io_list.Add(new io_type(src, io_entry, default_data, pin_type))
|
||||
|
||||
|
||||
/obj/item/integrated_circuit/proc/set_pin_data(pin_type, pin_number, datum/new_data)
|
||||
|
||||
@@ -58,12 +58,6 @@ a creative player the means to solve many problems. Circuits are held inside an
|
||||
/obj/item/integrated_circuit/proc/any_examine(mob/user)
|
||||
return
|
||||
|
||||
/obj/item/integrated_circuit/proc/attackby_react(var/atom/movable/A,mob/user)
|
||||
return
|
||||
|
||||
/obj/item/integrated_circuit/proc/sense(var/atom/movable/A,mob/user,prox)
|
||||
return
|
||||
|
||||
/obj/item/integrated_circuit/proc/check_interactivity(mob/user)
|
||||
if(assembly)
|
||||
return assembly.check_interactivity(user)
|
||||
@@ -297,18 +291,17 @@ a creative player the means to solve many problems. Circuits are held inside an
|
||||
return TRUE // Battery has enough.
|
||||
return FALSE // Not enough power.
|
||||
|
||||
/obj/item/integrated_circuit/proc/check_then_do_work(ord,var/ignore_power = FALSE)
|
||||
/obj/item/integrated_circuit/proc/check_then_do_work(var/ignore_power = FALSE)
|
||||
if(world.time < next_use) // All intergrated circuits have an internal cooldown, to protect from spam.
|
||||
return FALSE
|
||||
return
|
||||
if(power_draw_per_use && !ignore_power)
|
||||
if(!check_power())
|
||||
power_fail()
|
||||
return FALSE
|
||||
return
|
||||
next_use = world.time + cooldown_per_use
|
||||
do_work(ord)
|
||||
return TRUE
|
||||
do_work()
|
||||
|
||||
/obj/item/integrated_circuit/proc/do_work(ord)
|
||||
/obj/item/integrated_circuit/proc/do_work()
|
||||
return
|
||||
|
||||
/obj/item/integrated_circuit/proc/disconnect_all()
|
||||
@@ -376,3 +369,4 @@ a creative player the means to solve many problems. Circuits are held inside an
|
||||
return TRUE
|
||||
|
||||
return FALSE
|
||||
|
||||
|
||||
@@ -25,16 +25,14 @@ D [1]/ ||
|
||||
var/list/linked = list()
|
||||
var/io_type = DATA_CHANNEL
|
||||
var/pin_type // IC_INPUT, IC_OUTPUT, IC_ACTIVATOR - used in saving assembly wiring
|
||||
var/ord
|
||||
|
||||
/datum/integrated_io/New(loc, _name, _data, _pin_type,_ord)
|
||||
|
||||
/datum/integrated_io/New(loc, _name, _data, _pin_type)
|
||||
name = _name
|
||||
if(_data)
|
||||
data = _data
|
||||
if(_pin_type)
|
||||
pin_type = _pin_type
|
||||
if(_ord)
|
||||
ord = _ord
|
||||
|
||||
holder = loc
|
||||
|
||||
@@ -150,7 +148,7 @@ D [1]/ ||
|
||||
/datum/integrated_io/activate/push_data()
|
||||
for(var/k in 1 to linked.len)
|
||||
var/datum/integrated_io/io = linked[k]
|
||||
io.holder.check_then_do_work(io.ord)
|
||||
io.holder.check_then_do_work()
|
||||
|
||||
/datum/integrated_io/proc/pull_data()
|
||||
for(var/k in 1 to linked.len)
|
||||
@@ -209,7 +207,7 @@ D [1]/ ||
|
||||
write_data_to_pin(new_data)
|
||||
|
||||
/datum/integrated_io/activate/ask_for_pin_data(mob/user) // This just pulses the pin.
|
||||
holder.check_then_do_work(ord,ignore_power = TRUE)
|
||||
holder.check_then_do_work(ignore_power = TRUE)
|
||||
to_chat(user, "<span class='notice'>You pulse \the [holder]'s [src] pin.</span>")
|
||||
|
||||
/datum/integrated_io/activate
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// These pins can only contain integer numbers between 0 and IC_MAX_LIST_LENGTH. Null is allowed.
|
||||
// These pins can only contain integer numbers between 1 and IC_MAX_LIST_LENGTH. Null is not allowed.
|
||||
/datum/integrated_io/index
|
||||
name = "index pin"
|
||||
data = 1
|
||||
@@ -11,10 +11,10 @@
|
||||
|
||||
/datum/integrated_io/index/write_data_to_pin(new_data)
|
||||
if(isnull(new_data))
|
||||
new_data = 0
|
||||
new_data = 1
|
||||
|
||||
if(isnum(new_data))
|
||||
data = CLAMP(round(new_data), 0, IC_MAX_LIST_LENGTH)
|
||||
data = CLAMP(round(new_data), 1, IC_MAX_LIST_LENGTH)
|
||||
holder.on_data_written()
|
||||
|
||||
/datum/integrated_io/index/display_pin_type()
|
||||
|
||||
Reference in New Issue
Block a user