From 20ff97d77287b7ae6bc18d7bf4cf5c61728fc882 Mon Sep 17 00:00:00 2001
From: SkyratBot <59378654+SkyratBot@users.noreply.github.com>
Date: Sun, 6 Sep 2020 05:09:42 +0200
Subject: [PATCH] [MIRROR] Janiborgs can now repair damaged hull platings
(#640)
* Janiborgs can now repair damaged hull platings (#53183)
The "plating repair tool" has been added to the game in the form of a
printable upgrade for janiborgs. It's a subtype of the cautery that can
repair burnt or damaged hull platings, allowing floor tiles to be
placed over them once again.
The upgrade that adds it to a janiborg's list of tools can be printed
once the Cyborg Upgrades: Utility tech node is researched.
Janiborgs get floor tiles (and a crowbar), but have no way of dealing
with burnt platings. Thus, what ends up happening is that, after fixing
some flooring after a minor explosion, you'll often be left with one or
two ugly, OCD-triggering untiled spots on the floor that you can't put
a floor tile over because you don't have a welder. What makes these
spots even more infuriating is that it would actually be BETTER if they
had been broken down to just being space-exposed rods, because then you
COULD place a floor tile on their tile.
* Janiborgs can now repair damaged hull platings
Co-authored-by: ATH1909 <42606352+ATH1909@users.noreply.github.com>
---
code/game/objects/items/robot/robot_items.dm | 12 +++++++++++
.../objects/items/robot/robot_upgrades.dm | 21 +++++++++++++++++++
code/game/turfs/open/floor/plating.dm | 17 +++++++++++++--
.../designs/mechfabricator_designs.dm | 9 ++++++++
code/modules/research/techweb/all_nodes.dm | 2 +-
5 files changed, 58 insertions(+), 3 deletions(-)
diff --git a/code/game/objects/items/robot/robot_items.dm b/code/game/objects/items/robot/robot_items.dm
index 5092da4f73e..592c6385002 100644
--- a/code/game/objects/items/robot/robot_items.dm
+++ b/code/game/objects/items/robot/robot_items.dm
@@ -560,6 +560,18 @@
S.change_head_color(color2)
dropped = TRUE
+/obj/item/cautery/prt //it's a subtype of cauteries so that it inherits the cautery sprites and behavior and stuff, because I'm too lazy to make sprites for this thing
+ name = "plating repair tool"
+ desc = "A tiny heating device that's powered by a cyborg's excess heat. Its intended purpose is to repair burnt or damaged hull platings, but it can also be used as a crude lighter or cautery."
+ toolspeed = 1.5 //it's not designed to be used as a cautery (although it's close enough to one to be considered to be a proper cautery instead of just a hot object for the purposes of surgery)
+ heat = 3800 //this thing is intended for metal-shaping, so it's the same temperature as a lit welder
+ resistance_flags = FIRE_PROOF //if it's channeling a cyborg's excess heat, it's probably fireproof
+ force = 5
+ damtype = BURN
+ usesound = list('sound/items/welder.ogg', 'sound/items/welder2.ogg') //the usesounds of a lit welder
+ hitsound = 'sound/items/welder.ogg' //the hitsound of a lit welder
+
+
#define PKBORG_DAMPEN_CYCLE_DELAY 20
//Peacekeeper Cyborg Projectile Dampenening Field
diff --git a/code/game/objects/items/robot/robot_upgrades.dm b/code/game/objects/items/robot/robot_upgrades.dm
index 6b8e1369fca..00654738aba 100644
--- a/code/game/objects/items/robot/robot_upgrades.dm
+++ b/code/game/objects/items/robot/robot_upgrades.dm
@@ -237,6 +237,27 @@
R.module.basic_modules += M
R.module.add_module(M, FALSE, TRUE)
+/obj/item/borg/upgrade/prt
+ name = "janitor cyborg plating repair tool"
+ desc = "A tiny heating device to repair burnt and damaged hull platings with."
+ icon_state = "cyborg_upgrade3"
+ require_module = 1
+ module_type = list(/obj/item/robot_module/janitor)
+ module_flags = BORG_MODULE_JANITOR
+
+/obj/item/borg/upgrade/prt/action(mob/living/silicon/robot/R)
+ . = ..()
+ if(.)
+ var/obj/item/cautery/prt/P = new (R.module)
+ R.module.basic_modules += P
+ R.module.add_module(P, FALSE, TRUE)
+
+/obj/item/borg/upgrade/prt/deactivate(mob/living/silicon/robot/R, user = usr)
+ . = ..()
+ if(.)
+ for(var/obj/item/cautery/prt/P in R.module.modules)
+ R.module.remove_module(P, TRUE)
+
/obj/item/borg/upgrade/syndicate
name = "illegal equipment module"
desc = "Unlocks the hidden, deadlier functions of a cyborg."
diff --git a/code/game/turfs/open/floor/plating.dm b/code/game/turfs/open/floor/plating.dm
index 775ed4c89ea..9072207c242 100644
--- a/code/game/turfs/open/floor/plating.dm
+++ b/code/game/turfs/open/floor/plating.dm
@@ -51,7 +51,10 @@
return
if(istype(C, /obj/item/stack/rods) && attachment_holes)
if(broken || burnt)
- to_chat(user, "Repair the plating first!")
+ if(!iscyborg(user))
+ to_chat(user, "Repair the plating first! Use a welding tool to fix the damage.")
+ else
+ to_chat(user, "Repair the plating first! Use a welding tool or a plating repair tool to fix the damage.") //we don't need to confuse humans by giving them a message about plating repair tools, since only janiborgs should have access to them outside of Christmas presents or admin intervention
return
var/obj/item/stack/rods/R = C
if (R.get_amount() < 2)
@@ -87,7 +90,17 @@
playsound(src, 'sound/weapons/genhit.ogg', 50, TRUE)
else
- to_chat(user, "This section is too damaged to support a tile! Use a welder to fix the damage.")
+ if(!iscyborg(user))
+ to_chat(user, "This section is too damaged to support a tile! Use a welding tool to fix the damage.")
+ else
+ to_chat(user, "This section is too damaged to support a tile! Use a welding tool or a plating repair tool to fix the damage.")
+ else if(istype(C, /obj/item/cautery/prt)) //plating repair tool
+ if((broken || burnt) && C.use_tool(src, user, 0, volume=80))
+ to_chat(user, "You fix some dents on the broken plating.")
+ icon_state = icon_plating
+ burnt = FALSE
+ broken = FALSE
+
/turf/open/floor/plating/welder_act(mob/living/user, obj/item/I)
..()
diff --git a/code/modules/research/designs/mechfabricator_designs.dm b/code/modules/research/designs/mechfabricator_designs.dm
index e7d8364cad0..0cb5dc796bf 100644
--- a/code/modules/research/designs/mechfabricator_designs.dm
+++ b/code/modules/research/designs/mechfabricator_designs.dm
@@ -750,6 +750,15 @@
construction_time = 40
category = list("Cyborg Upgrade Modules")
+/datum/design/borg_upgrade_prt
+ name = "Cyborg Upgrade (Plating Repair Tool)"
+ id = "borg_upgrade_prt"
+ build_type = MECHFAB
+ build_path = /obj/item/borg/upgrade/prt
+ materials = list(/datum/material/iron = 2500, /datum/material/glass = 750) //same price as a cautery
+ construction_time = 40
+ category = list("Cyborg Upgrade Modules")
+
/datum/design/borg_upgrade_expand
name = "Cyborg Upgrade (Expand)"
id = "borg_upgrade_expand"
diff --git a/code/modules/research/techweb/all_nodes.dm b/code/modules/research/techweb/all_nodes.dm
index 2709183d363..5bb8f1eb873 100644
--- a/code/modules/research/techweb/all_nodes.dm
+++ b/code/modules/research/techweb/all_nodes.dm
@@ -287,7 +287,7 @@
display_name = "Cyborg Upgrades: Utility"
description = "Utility upgrades for cyborgs."
prereq_ids = list("adv_robotics")
- design_ids = list("borg_upgrade_thrusters", "borg_upgrade_selfrepair", "borg_upgrade_expand", "borg_upgrade_disablercooler", "borg_upgrade_trashofholding", "borg_upgrade_advancedmop", "borg_upgrade_broomer")
+ design_ids = list("borg_upgrade_thrusters", "borg_upgrade_selfrepair", "borg_upgrade_expand", "borg_upgrade_disablercooler", "borg_upgrade_trashofholding", "borg_upgrade_advancedmop", "borg_upgrade_broomer", "borg_upgrade_prt")
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2000)
/datum/techweb_node/cyborg_upg_engiminer