Merge branch 'master' of https://github.com/Citadel-Station-13/Citadel-Station-13 into ninjasarecum
# Conflicts: # icons/mob/clothing/suit.dmi # icons/obj/clothing/suits.dmi
This commit is contained in:
@@ -48,13 +48,14 @@
|
||||
)
|
||||
|
||||
/obj/machinery/autolathe/Initialize()
|
||||
AddComponent(/datum/component/material_container, SSmaterials.materialtypes_by_category[MAT_CATEGORY_RIGID], 0, TRUE, null, null, CALLBACK(src, .proc/AfterMaterialInsert))
|
||||
. = ..()
|
||||
|
||||
wires = new /datum/wires/autolathe(src)
|
||||
stored_research = new /datum/techweb/specialized/autounlocking/autolathe
|
||||
matching_designs = list()
|
||||
|
||||
/obj/machinery/autolathe/ComponentInitialize()
|
||||
AddComponent(/datum/component/material_container, SSmaterials.materialtypes_by_category[MAT_CATEGORY_RIGID], 0, TRUE, null, null, CALLBACK(src, .proc/AfterMaterialInsert))
|
||||
|
||||
/obj/machinery/autolathe/Destroy()
|
||||
QDEL_NULL(wires)
|
||||
return ..()
|
||||
@@ -439,6 +440,9 @@
|
||||
|
||||
/obj/machinery/autolathe/secure/Initialize()
|
||||
. = ..()
|
||||
// let's not leave the parent datum floating, right?
|
||||
if(stored_research)
|
||||
QDEL_NULL(stored_research)
|
||||
stored_research = new /datum/techweb/specialized/autounlocking/autolathe/public
|
||||
|
||||
/obj/machinery/autolathe/toy
|
||||
@@ -457,8 +461,18 @@
|
||||
"Misc",
|
||||
"Imported"
|
||||
)
|
||||
/obj/machinery/autolathe/toy/Initialize()
|
||||
. = ..()
|
||||
// let's not leave the parent datum floating, right?
|
||||
if(stored_research)
|
||||
QDEL_NULL(stored_research)
|
||||
stored_research = new /datum/techweb/specialized/autounlocking/autolathe/toy
|
||||
|
||||
/obj/machinery/autolathe/toy/hacked/Initialize()
|
||||
. = ..()
|
||||
adjust_hacked(TRUE)
|
||||
stored_research = new /datum/techweb/specialized/autounlocking/autolathe/toy
|
||||
|
||||
// override the base to allow plastics
|
||||
/obj/machinery/autolathe/ComponentInitialize()
|
||||
var/list/extra_mats = list(/datum/material/plastic)
|
||||
AddComponent(/datum/component/material_container, SSmaterials.materialtypes_by_category[MAT_CATEGORY_RIGID] + extra_mats, 0, TRUE, null, null, CALLBACK(src, .proc/AfterMaterialInsert))
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
/obj/structure/frame/machine/examine(user)
|
||||
. = ..()
|
||||
if(state == 3 && req_components && req_component_names)
|
||||
var/hasContent = 0
|
||||
var/hasContent = FALSE
|
||||
var/requires = "It requires"
|
||||
|
||||
for(var/i = 1 to req_components.len)
|
||||
@@ -46,10 +46,10 @@
|
||||
continue
|
||||
var/use_and = i == req_components.len
|
||||
requires += "[(hasContent ? (use_and ? ", and" : ",") : "")] [amt] [amt == 1 ? req_component_names[tname] : "[req_component_names[tname]]\s"]"
|
||||
hasContent = 1
|
||||
hasContent = TRUE
|
||||
|
||||
if(hasContent)
|
||||
. += requires + "."
|
||||
. += "[requires]."
|
||||
else
|
||||
. += "It does not require any more components."
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
amt += req_components[path]
|
||||
return amt
|
||||
|
||||
/obj/structure/frame/machine/attackby(obj/item/P, mob/user, params)
|
||||
/obj/structure/frame/machine/attackby(obj/item/P, mob/living/user, params)
|
||||
switch(state)
|
||||
if(1)
|
||||
if(istype(P, /obj/item/circuitboard/machine))
|
||||
@@ -88,6 +88,7 @@
|
||||
if(istype(P, /obj/item/stack/cable_coil))
|
||||
if(!P.tool_start_check(user, amount=5))
|
||||
return
|
||||
|
||||
to_chat(user, "<span class='notice'>You start to add cables to the frame...</span>")
|
||||
if(P.use_tool(src, user, 20, volume=50, amount=5, extra_checks = CALLBACK(src, .proc/check_state, 1)))
|
||||
to_chat(user, "<span class='notice'>You add cables to the frame.</span>")
|
||||
@@ -97,39 +98,41 @@
|
||||
return
|
||||
if(P.tool_behaviour == TOOL_SCREWDRIVER && !anchored)
|
||||
user.visible_message("<span class='warning'>[user] disassembles the frame.</span>", \
|
||||
"<span class='notice'>You start to disassemble the frame...</span>", "You hear banging and clanking.")
|
||||
"<span class='notice'>You start to disassemble the frame...</span>", "<span class='hear'>You hear banging and clanking.</span>")
|
||||
if(P.use_tool(src, user, 40, volume=50, extra_checks = CALLBACK(src, .proc/check_state, 1)))
|
||||
to_chat(user, "<span class='notice'>You disassemble the frame.</span>")
|
||||
var/obj/item/stack/sheet/metal/M = new (loc, 5)
|
||||
M.add_fingerprint(user)
|
||||
qdel(src)
|
||||
if(state == 1)
|
||||
to_chat(user, "<span class='notice'>You disassemble the frame.</span>")
|
||||
var/obj/item/stack/sheet/metal/M = new (loc, 5)
|
||||
M.add_fingerprint(user)
|
||||
qdel(src)
|
||||
return
|
||||
if(P.tool_behaviour == TOOL_WRENCH)
|
||||
to_chat(user, "<span class='notice'>You start [anchored ? "un" : ""]securing [name]...</span>")
|
||||
to_chat(user, "<span class='notice'>You start [anchored ? "un" : ""]securing [src]...</span>")
|
||||
if(P.use_tool(src, user, 40, volume=75, extra_checks = CALLBACK(src, .proc/check_state, 1)))
|
||||
to_chat(user, "<span class='notice'>You [anchored ? "un" : ""]secure [name].</span>")
|
||||
setAnchored(!anchored)
|
||||
if(state == 1)
|
||||
to_chat(user, "<span class='notice'>You [anchored ? "un" : ""]secure [src].</span>")
|
||||
set_anchored(!anchored)
|
||||
return
|
||||
|
||||
if(2)
|
||||
if(P.tool_behaviour == TOOL_WRENCH)
|
||||
to_chat(user, "<span class='notice'>You start [anchored ? "un" : ""]securing [name]...</span>")
|
||||
to_chat(user, "<span class='notice'>You start [anchored ? "un" : ""]securing [src]...</span>")
|
||||
if(P.use_tool(src, user, 40, volume=75, extra_checks = CALLBACK(src, .proc/check_state, 2)))
|
||||
to_chat(user, "<span class='notice'>You [anchored ? "un" : ""]secure [name].</span>")
|
||||
setAnchored(!anchored)
|
||||
to_chat(user, "<span class='notice'>You [anchored ? "un" : ""]secure [src].</span>")
|
||||
set_anchored(!anchored)
|
||||
return
|
||||
|
||||
if(istype(P, /obj/item/circuitboard/machine))
|
||||
var/obj/item/circuitboard/machine/B = P
|
||||
if(!B.build_path)
|
||||
to_chat(user, "<span class'warning'>This circuitboard seems to be broken.</span>")
|
||||
to_chat(user, "<span class='warning'>This circuitboard seems to be broken.</span>")
|
||||
return
|
||||
if(!anchored && B.needs_anchored)
|
||||
to_chat(user, "<span class='warning'>The frame needs to be secured first!</span>")
|
||||
return
|
||||
if(!user.transferItemToLoc(B, src))
|
||||
return
|
||||
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
|
||||
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, TRUE)
|
||||
to_chat(user, "<span class='notice'>You add the circuit board to the frame.</span>")
|
||||
circuit = B
|
||||
icon_state = "box_2"
|
||||
@@ -171,34 +174,49 @@
|
||||
return
|
||||
|
||||
if(P.tool_behaviour == TOOL_WRENCH && !circuit.needs_anchored)
|
||||
to_chat(user, "<span class='notice'>You start [anchored ? "un" : ""]securing [name]...</span>")
|
||||
to_chat(user, "<span class='notice'>You start [anchored ? "un" : ""]securing [src]...</span>")
|
||||
if(P.use_tool(src, user, 40, volume=75, extra_checks = CALLBACK(src, .proc/check_state, 3)))
|
||||
to_chat(user, "<span class='notice'>You [anchored ? "un" : ""]secure [name].</span>")
|
||||
setAnchored(!anchored)
|
||||
to_chat(user, "<span class='notice'>You [anchored ? "un" : ""]secure [src].</span>")
|
||||
set_anchored(!anchored)
|
||||
return
|
||||
|
||||
if(P.tool_behaviour == TOOL_SCREWDRIVER)
|
||||
var/component_check = 1
|
||||
var/component_check = TRUE
|
||||
for(var/R in req_components)
|
||||
if(req_components[R] > 0)
|
||||
component_check = 0
|
||||
component_check = FALSE
|
||||
break
|
||||
if(component_check)
|
||||
P.play_tool_sound(src)
|
||||
var/obj/machinery/new_machine = new circuit.build_path(loc)
|
||||
if(new_machine.circuit)
|
||||
QDEL_NULL(new_machine.circuit)
|
||||
new_machine.circuit = circuit
|
||||
new_machine.setAnchored(anchored)
|
||||
new_machine.on_construction()
|
||||
for(var/obj/O in new_machine.component_parts)
|
||||
qdel(O)
|
||||
new_machine.component_parts = list()
|
||||
for(var/obj/O in src)
|
||||
O.moveToNullspace()
|
||||
new_machine.component_parts += O
|
||||
circuit.moveToNullspace()
|
||||
new_machine.RefreshParts()
|
||||
if(istype(new_machine))
|
||||
// Machines will init with a set of default components. Move to nullspace so we don't trigger handle_atom_del, then qdel.
|
||||
// Finally, replace with this frame's parts.
|
||||
if(new_machine.circuit)
|
||||
// Move to nullspace and delete.
|
||||
new_machine.circuit.moveToNullspace()
|
||||
QDEL_NULL(new_machine.circuit)
|
||||
for(var/obj/old_part in new_machine.component_parts)
|
||||
// Move to nullspace and delete.
|
||||
old_part.moveToNullspace()
|
||||
qdel(old_part)
|
||||
|
||||
// Set anchor state and move the frame's parts over to the new machine.
|
||||
// Then refresh parts and call on_construction().
|
||||
|
||||
new_machine.set_anchored(anchored)
|
||||
new_machine.component_parts = list()
|
||||
|
||||
circuit.forceMove(new_machine)
|
||||
new_machine.component_parts += circuit
|
||||
new_machine.circuit = circuit
|
||||
|
||||
for(var/obj/new_part in src)
|
||||
new_part.forceMove(new_machine)
|
||||
new_machine.component_parts += new_part
|
||||
new_machine.RefreshParts()
|
||||
|
||||
new_machine.on_construction()
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
@@ -232,12 +250,15 @@
|
||||
|
||||
for(var/obj/item/part in added_components)
|
||||
if(istype(part,/obj/item/stack))
|
||||
var/obj/item/stack/S = part
|
||||
var/obj/item/stack/NS = locate(S.merge_type) in components //find a stack to merge with
|
||||
if(NS)
|
||||
S.merge(NS)
|
||||
var/obj/item/stack/incoming_stack = part
|
||||
for(var/obj/item/stack/merge_stack in components)
|
||||
if(incoming_stack.can_merge(merge_stack))
|
||||
incoming_stack.merge(merge_stack)
|
||||
if(QDELETED(incoming_stack))
|
||||
break
|
||||
if(!QDELETED(part)) //If we're a stack and we merged we might not exist anymore
|
||||
components += part
|
||||
part.forceMove(src)
|
||||
to_chat(user, "<span class='notice'>[part.name] applied.</span>")
|
||||
if(added_components.len)
|
||||
replacer.play_rped_sound()
|
||||
@@ -267,9 +288,9 @@
|
||||
to_chat(user, "<span class='notice'>You add [P] to [src].</span>")
|
||||
components += P
|
||||
req_components[I]--
|
||||
return 1
|
||||
return TRUE
|
||||
to_chat(user, "<span class='warning'>You cannot add that to the machine!</span>")
|
||||
return 0
|
||||
return FALSE
|
||||
if(user.a_intent == INTENT_HARM)
|
||||
return ..()
|
||||
|
||||
@@ -280,5 +301,4 @@
|
||||
for(var/X in components)
|
||||
var/obj/item/I = X
|
||||
I.forceMove(loc)
|
||||
|
||||
..()
|
||||
|
||||
@@ -79,7 +79,7 @@ GLOBAL_LIST_EMPTY(network_holopads)
|
||||
var/secure = FALSE
|
||||
/// If we are currently calling another holopad
|
||||
var/calling = FALSE
|
||||
/*
|
||||
|
||||
/obj/machinery/holopad/secure
|
||||
name = "secure holopad"
|
||||
desc = "It's a floor-mounted device for projecting holographic images. This one will refuse to auto-connect incoming calls."
|
||||
@@ -90,7 +90,7 @@ GLOBAL_LIST_EMPTY(network_holopads)
|
||||
var/obj/item/circuitboard/machine/holopad/board = circuit
|
||||
board.secure = TRUE
|
||||
board.build_path = /obj/machinery/holopad/secure
|
||||
*/
|
||||
|
||||
/obj/machinery/holopad/tutorial
|
||||
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
|
||||
flags_1 = NODECONSTRUCT_1
|
||||
@@ -372,7 +372,7 @@ GLOBAL_LIST_EMPTY(network_holopads)
|
||||
if(force_answer_call && world.time > (HC.call_start_time + (HOLOPAD_MAX_DIAL_TIME / 2)))
|
||||
HC.Answer(src)
|
||||
break
|
||||
if(!secure) //HC.head_call &&
|
||||
if(HC.head_call && !secure)
|
||||
HC.Answer(src)
|
||||
break
|
||||
if(outgoing_call)
|
||||
|
||||
Reference in New Issue
Block a user