From a67e6c6410f8a942dec41930e3d92798d0bd7b53 Mon Sep 17 00:00:00 2001 From: Geeves Date: Wed, 18 Mar 2020 15:47:40 +0200 Subject: [PATCH] Circuitboard Improvements (#8432) --- aurorastation.dme | 1 + .../items/weapons/circuitboards/_defines.dm | 2 ++ .../weapons/circuitboards/circuitboard.dm | 28 +++++++++++++------ .../geeves-circuitboard_improvements.yml | 6 ++++ 4 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 code/game/objects/items/weapons/circuitboards/_defines.dm create mode 100644 html/changelogs/geeves-circuitboard_improvements.yml diff --git a/aurorastation.dme b/aurorastation.dme index 83f9ee65c0d..456080e5533 100644 --- a/aurorastation.dme +++ b/aurorastation.dme @@ -913,6 +913,7 @@ #include "code\game\objects\items\weapons\vaurca_items.dm" #include "code\game\objects\items\weapons\weaponry.dm" #include "code\game\objects\items\weapons\weldbackpack.dm" +#include "code\game\objects\items\weapons\circuitboards\_defines.dm" #include "code\game\objects\items\weapons\circuitboards\broken.dm" #include "code\game\objects\items\weapons\circuitboards\circuitboard.dm" #include "code\game\objects\items\weapons\circuitboards\mecha.dm" diff --git a/code/game/objects/items/weapons/circuitboards/_defines.dm b/code/game/objects/items/weapons/circuitboards/_defines.dm new file mode 100644 index 00000000000..156e30c1fd7 --- /dev/null +++ b/code/game/objects/items/weapons/circuitboards/_defines.dm @@ -0,0 +1,2 @@ +#define BOARD_MACHINE "machine" +#define BOARD_COMPUTER "computer" \ No newline at end of file diff --git a/code/game/objects/items/weapons/circuitboards/circuitboard.dm b/code/game/objects/items/weapons/circuitboards/circuitboard.dm index 64241e829de..689d2cd4902 100644 --- a/code/game/objects/items/weapons/circuitboards/circuitboard.dm +++ b/code/game/objects/items/weapons/circuitboards/circuitboard.dm @@ -6,24 +6,36 @@ /obj/item/circuitboard name = "circuit board" - desc = "Looks like a circuit. Probably is." + desc = "A circuitboard, an electronic device which forms the backbone of most modern machinery." icon = 'icons/obj/module.dmi' icon_state = "id_mod" item_state = "electronic" origin_tech = list(TECH_DATA = 2) - density = 0 - anchored = 0 - w_class = 2.0 + w_class = ITEMSIZE_SMALL flags = CONDUCT - force = 5.0 - throwforce = 5.0 + force = 5 + throwforce = 5 throw_speed = 3 throw_range = 15 - var/build_path = null + var/build_path var/board_type = "computer" - var/list/req_components = null + var/list/req_components var/contain_parts = 1 +/obj/item/circuitboard/examine(mob/user) + ..() + if(build_path) + var/obj/machine = new build_path // instantiate to get the name and desc + to_chat(user, FONT_SMALL(SPAN_NOTICE("This circuitboard will build a [capitalize_first_letters(machine.name)]: [machine.desc]"))) + if(board_type == BOARD_COMPUTER) // does not have build components, only goes into a frame + to_chat(user, SPAN_NOTICE("This board is used inside a computer frame.")) + else if(req_components) + to_chat(user, SPAN_NOTICE("To build this machine, you will require:")) + for(var/I in req_components) + if(req_components[I] > 0) + var/obj/component = new I // instantiate to get the name + to_chat(user, SPAN_NOTICE("- [num2text(req_components[I])] [capitalize_first_letters(component.name)]")) + //Called when the circuitboard is used to contruct a new machine. /obj/item/circuitboard/proc/construct(var/obj/machinery/M) if (istype(M, build_path)) diff --git a/html/changelogs/geeves-circuitboard_improvements.yml b/html/changelogs/geeves-circuitboard_improvements.yml new file mode 100644 index 00000000000..1c749a2a997 --- /dev/null +++ b/html/changelogs/geeves-circuitboard_improvements.yml @@ -0,0 +1,6 @@ +author: Geeves + +delete-after: True + +changes: + - rscadd: "Added extended descriptions to circuitboards which makes it easier to understand what the hell they do." \ No newline at end of file