forked from Baystation12/Baystation12
-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug and folder machinery (#2427)
- Loading branch information
1 parent
a76a134
commit 4e63374
Showing
16 changed files
with
331 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/obj/item/clothing/accessory/bs_silk | ||
name = "bluespace snare" | ||
desc = "A bluespace snare. Looking at the edges of this thing, you see a faint blue ripple and spatial distortion." | ||
icon = 'icons/obj/rig_modules.dmi' | ||
icon_state = "teleporter" | ||
w_class = ITEM_SIZE_SMALL | ||
origin_tech = list(TECH_BLUESPACE = 6) | ||
var/id_tag = "" | ||
|
||
/obj/item/clothing/accessory/bs_silk/New() | ||
. = ..() | ||
matter = list(MATERIAL_STEEL = 8, MATERIAL_GLASS = 5, MATERIAL_SILVER = 10) | ||
|
||
/obj/item/clothing/accessory/bs_silk/use_tool(obj/item/I, mob/user) | ||
.=..() | ||
if(isMultitool(I)) | ||
var/input_id = input("Enter new BS Snare ID", "Snare ID", id_tag) | ||
id_tag = input_id | ||
return | ||
|
||
/obj/item/clothing/accessory/bs_silk/examine() | ||
..() | ||
to_chat(usr, "<br>On small display you can notice label that mean: \"DEVICE ID: <b>[id_tag ? id_tag : "NOT SETTED"]</b>\".") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/obj/item/stock_parts/circuitboard/bs_snare_control | ||
name = "circuit board (bluespace snare manager console)" | ||
origin_tech = list(TECH_DATA = 4, TECH_BLUESPACE = 6) | ||
build_path = /obj/machinery/computer/bs_snare_control | ||
|
||
/obj/item/stock_parts/circuitboard/bs_snare_hub | ||
name = "circuit board (bluespace snare hub)" | ||
origin_tech = list(TECH_DATA = 4, TECH_BLUESPACE = 6) | ||
build_path = /obj/machinery/bs_snare_hub | ||
req_components = list( | ||
/obj/item/bluespace_crystal = 2, | ||
/obj/item/stock_parts/capacitor/super = 2, | ||
/obj/item/stack/cable_coil = 1, | ||
/obj/item/stock_parts/subspace/crystal = 1 | ||
) | ||
board_type = "machine" | ||
additional_spawn_components = list( | ||
/obj/item/stock_parts/console_screen = 1, | ||
/obj/item/stock_parts/power/apc/buildable = 1 | ||
) | ||
|
||
/datum/design/circuit/bs_silk/bs_snare_control | ||
name = "circuit board (bluespace snare manager console)" | ||
id = "bs_snare_control" | ||
req_tech = list(TECH_DATA = 5, TECH_BLUESPACE = 6) | ||
build_path = /obj/item/stock_parts/circuitboard/bs_snare_control | ||
sort_string = "VAZOR" | ||
|
||
/datum/design/circuit/bs_silk/bs_snare_hub | ||
name = "circuit board (bluespace snare hub)" | ||
id = "bs_snare_hub" | ||
req_tech = list(TECH_DATA = 5, TECH_BLUESPACE = 6) | ||
build_path = /obj/item/stock_parts/circuitboard/bs_snare_hub | ||
sort_string = "BSSNH" | ||
|
||
/datum/design/item/clothing/accessory/bs_silk | ||
name = "bluespace snare control" | ||
id = "bs_silk" | ||
req_tech = list(TECH_BLUESPACE = 6) | ||
materials = list(MATERIAL_STEEL = 1000) | ||
build_path = /obj/item/clothing/accessory/bs_silk | ||
sort_string = "BSSIL" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
GLOBAL_LIST_EMPTY(hubs_id) | ||
/obj/machinery/bs_snare_hub | ||
name = "bluespace snare hub" | ||
icon = 'mods/machinery/icons/stationobjs.dmi' | ||
icon_state = "silk_hub" | ||
density = FALSE | ||
|
||
var/snare_id = "" | ||
id_tag = "" | ||
//animations | ||
var/animation_icon = 'mods/machinery/icons/bs_silk.dmi' | ||
var/back_animation = "silc_teleport_back" | ||
var/onhub_animation = "silc_get_hub" | ||
|
||
construct_state = /singleton/machine_construction/default/panel_closed | ||
uncreated_component_parts = null | ||
|
||
/obj/machinery/bs_snare_hub/proc/set_id_tag(nId) | ||
if(nId in GLOB.hubs_id) | ||
audible_message(SPAN_WARNING("ERROR, unable to set on this bluespace highway another hub use \"[nId]\" highway.")) | ||
return | ||
else | ||
GLOB.hubs_id.Remove(id_tag) | ||
id_tag = nId | ||
GLOB.hubs_id.Add(nId) | ||
|
||
/obj/machinery/bs_snare_hub/use_tool(obj/item/I, mob/user) | ||
. = ..() | ||
if (isMultitool(I)) | ||
set_id_tag(input("Enter HUB id", "HUB ID", id_tag)) | ||
|
||
/obj/machinery/bs_snare_hub/proc/get_snaring() | ||
. = list() | ||
for(var/mob/living/carbon/human/M in SSmobs.mob_list) | ||
var/obj/item/clothing/U = M?.w_uniform | ||
if(length(U?.accessories)) | ||
for(var/obj/item/clothing/accessory/bs_silk/snare in U.accessories) | ||
if(snare?.id_tag == snare_id) | ||
. += M | ||
|
||
/obj/machinery/bs_snare_hub/proc/teleport_mobs() | ||
if(!(stat & (is_powered()))) | ||
var/list/mobs = get_snaring() | ||
for(var/mob/living/carbon/human/M in mobs) | ||
spawn | ||
animated_teleportation(M, get_turf(src)) | ||
return mobs | ||
|
||
/obj/machinery/computer/bs_snare_control | ||
name = "bluespace snare control" | ||
icon = 'mods/machinery/icons/computer.dmi' | ||
icon_state = "computer" | ||
|
||
icon_keyboard = "tech_key" | ||
icon_screen = "ascent_screen" | ||
|
||
var/list/hubs = list() | ||
|
||
/obj/machinery/computer/bs_snare_control/physical_attack_hand(mob/user) | ||
ui_interact(user) | ||
|
||
/obj/machinery/computer/bs_snare_control/proc/ui_data4hubs() | ||
var/list/L = hubs | ||
var/list/dot [LAZYLEN(L)] | ||
if(LAZYLEN(L)) for(var/i = 1; i <= LAZYLEN(L); i++) | ||
dot[i] = list("myId" = L[i], "sId" = "") | ||
var/obj/machinery/bs_snare_hub/h = find_hub_by_ID(L[i]) | ||
if(istype(h)) dot[i]["sId"] = h.snare_id | ||
return dot | ||
|
||
/obj/machinery/computer/bs_snare_control/proc/find_hub_by_ID(id) | ||
for(var/obj/machinery/bs_snare_hub/h in SSmachines.machinery) if(id == h.id_tag) | ||
return h | ||
|
||
/obj/machinery/computer/bs_snare_control/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1) | ||
var/list/data = list() | ||
data["hubs"] = ui_data4hubs() | ||
ui = SSnano.try_update_ui(user, src, ui_key, ui, data, force_open) | ||
if(!ui) | ||
ui = new(user, src, ui_key, "_inf.bs_snare_controller.tmpl", "BS Snare Control", 440, 600) | ||
ui.set_initial_data(data) | ||
ui.open() | ||
/* | ||
/obj/machinery/computer/bs_snare_control/proc/find_hubs_ID() | ||
. = list() | ||
for(var/obj/machinery/bs_snare_hub/HUB in SSmachines.machinery) if(HUB.id_tag in hubs) | ||
. += HUB.id_tag | ||
*/ | ||
/obj/machinery/computer/bs_snare_control/proc/find_hubs() | ||
. = list() | ||
for(var/id in hubs) | ||
. += find_hub_by_ID(id) | ||
/obj/machinery/computer/bs_snare_control/OnTopic(mob/user, list/href_list, state) | ||
. = ..() | ||
if(href_list["catch_snaring"]) | ||
var/obj/machinery/bs_snare_hub/hub = find_hub_by_ID(href_list["catch_snaring"]) | ||
if(!hub || !length(hub.teleport_mobs())) | ||
playsound(loc, 'sound/machines/buzz-sigh.ogg', 50, 1, -1) | ||
audible_message(SPAN_WARNING("The [src.name] buzzes and state \"SNARE EITHER DISABLED OR NOT AVAILABLE, TRY TO PROBE IT AGAIN, IF YOU ARE SURE THAT THE SNARE IN A GOOD CONDITION OR CONNECTED TO USER.\""), | ||
SPAN_WARNING("The [src.name] buzzes and state something."), | ||
hearing_distance = 5 | ||
) | ||
|
||
if(href_list["add_id"]) | ||
var/new_id = input(user, "Enter HUB id.", "HUB ID") | ||
if(length(new_id)) Adjacent(user) ? (hubs += new_id) : to_chat(user, "You are too far from [src].") | ||
|
||
if(href_list["remove_id"]) | ||
hubs.Remove(href_list["remove_id"]) | ||
|
||
if(href_list["set_id"]) | ||
var/obj/machinery/bs_snare_hub/h = find_hub_by_ID(href_list["set_id"]) | ||
if(h) | ||
var/i = input(user, "Enter new BS Snare ID", "Snare ID", h.snare_id) | ||
Adjacent(user) ? (h.snare_id = i) : to_chat(user, "You are too far from [src].") | ||
return TOPIC_REFRESH |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/obj/item/organ/internal/augment/active/simple/circuit | ||
name = "integrated circuit frame" | ||
action_button_name = "Activate Circuit" | ||
icon_state = "circuit" | ||
augment_slots = AUGMENT_ARM | ||
holding_type = null //We must get the holding item externally | ||
//Limited to robolimbs | ||
augment_flags = AUGMENT_MECHANICAL | ||
desc = "A DIY modular assembly, courtesy of Xion Industrial. Circuitry not included" | ||
|
||
|
||
/obj/item/organ/internal/augment/active/simple/circuit/use_tool(obj/item/W as obj, mob/user as mob) | ||
if(isCrowbar(W)) | ||
//Remove internal circuit | ||
if(holding) | ||
holding.canremove = 1 | ||
holding.dropInto(loc) | ||
to_chat(user, SPAN_WARNING("You take out \the [holding].")) | ||
holding = null | ||
playsound(loc, 'sound/items/Crowbar.ogg', 50, 1) | ||
else to_chat(user, SPAN_WARNING("The augment is empty!")) | ||
return | ||
if(istype(W, /obj/item/device/electronic_assembly/augment)) | ||
if(holding) | ||
to_chat(user, SPAN_WARNING("There's already an assembly in there.")) | ||
else if(user.unEquip(W, src)) | ||
holding = W | ||
holding.canremove = 0 | ||
playsound(loc, 'sound/items/Crowbar.ogg', 50, 1) | ||
return | ||
|
||
..() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
//Simple toggleabse module. Just put holding in hands or get it back | ||
/obj/item/organ/internal/augment/active/simple | ||
var/obj/item/holding = null | ||
var/holding_type = null | ||
var/deploy_sound | ||
var/retract_sound | ||
|
||
/obj/item/organ/internal/augment/active/simple/Initialize() | ||
. = ..() | ||
if(holding_type) | ||
holding = new holding_type(src) | ||
holding.canremove = 0 | ||
|
||
/obj/item/organ/internal/augment/active/simple/Destroy() | ||
if(holding) | ||
GLOB.item_unequipped_event.unregister(holding, src) | ||
if(holding.loc == src) | ||
qdel(holding) | ||
holding = null | ||
return ..() | ||
|
||
/obj/item/organ/internal/augment/active/simple/proc/holding_dropped() | ||
|
||
//Stop caring | ||
GLOB.item_unequipped_event.unregister(holding, src) | ||
|
||
if(holding.loc != src) //something went wrong and is no longer attached/ it broke | ||
holding.canremove = 1 | ||
holding = null //We no longer hold this, you will have to get a replacement module or fix it somehow | ||
|
||
/obj/item/organ/internal/augment/active/simple/proc/deploy() | ||
|
||
var/slot = null | ||
if(limb.organ_tag in list(BP_L_ARM, BP_L_HAND)) | ||
slot = slot_l_hand | ||
else if(limb.organ_tag in list(BP_R_ARM, BP_R_HAND)) | ||
slot = slot_r_hand | ||
if(owner.equip_to_slot_if_possible(holding, slot)) | ||
GLOB.item_unequipped_event.register(holding, src, /obj/item/organ/internal/augment/active/simple/proc/holding_dropped ) | ||
owner.visible_message( | ||
SPAN_WARNING("\The [owner] extends \his [holding.name] from \his [limb.name]."), | ||
SPAN_NOTICE("You extend your [holding.name] from your [limb.name].") | ||
) | ||
if (deploy_sound) | ||
playsound(owner, deploy_sound, 30) | ||
return TRUE | ||
|
||
/obj/item/organ/internal/augment/active/simple/proc/retract() | ||
if(holding.loc == src) | ||
return | ||
|
||
if(ismob(holding.loc) && holding.loc == owner) | ||
var/mob/M = holding.loc | ||
if(!M.drop_from_inventory(holding, src)) | ||
to_chat(owner, "\The [holding.name] fails to retract.") | ||
return | ||
M.visible_message( | ||
SPAN_WARNING("\The [M] retracts \his [holding.name] into \his [limb.name]."), | ||
SPAN_NOTICE("You retract your [holding.name] into your [limb.name].") | ||
) | ||
if (retract_sound) | ||
playsound(owner, retract_sound, 30) | ||
return TRUE | ||
|
||
|
||
|
||
/obj/item/organ/internal/augment/active/simple/activate() | ||
if(!can_activate()) | ||
return | ||
|
||
if(holding.loc == src) //item not in hands | ||
deploy() | ||
else //retract item | ||
retract() | ||
owner.update_action_buttons() | ||
|
||
/obj/item/organ/internal/augment/active/simple/can_activate() | ||
if(..()) | ||
if(!holding) | ||
to_chat(owner, SPAN_WARNING("The device is damaged and fails to deploy")) | ||
return FALSE | ||
return TRUE | ||
return FALSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{{:helper.link('Add Hub ID', null, {'add_id' : 1}, null)}}<br><br> | ||
|
||
<table border='1'> | ||
<tr> | ||
<th>Hub ID | ||
<th>Snare ID | ||
<th>Activate | ||
<th>Remove | ||
<th>Snare Setup | ||
{{for data.hubs}} | ||
<tr> | ||
<td>{{:value.myId}} | ||
<td>{{:value.sId}} | ||
<td>{{:helper.link('Catch', null, {'catch_snaring' : value.myId}, null)}} | ||
<td>{{:helper.link('Remove', null, {'remove_id' : value.myId}, null)}} | ||
<td>{{:helper.link('Set Snare', null, {'set_id' : value.myId}, null)}} | ||
{{empty}} | ||
<tr> | ||
<td>NOT FOUND | ||
<td>NOT FOUND | ||
<td>NOT FOUND | ||
<td>NOT FOUND | ||
<td>NOT FOUND | ||
{{/for}} | ||
</table> |