[MIRROR] Adds sticking metallic kitchenware into APCs (#4383)

* Adds sticking metallic kitchenware into APCs (#57910)

Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com>

* Adds sticking metallic kitchenware into APCs

Co-authored-by: ArcaneDefence <51932756+ArcaneDefence@users.noreply.github.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com>
This commit is contained in:
SkyratBot
2021-03-25 03:49:36 +00:00
committed by GitHub
co-authored by Mothblocks ArcaneDefence
parent 8f92a141f5
commit c21aab1997
4 changed files with 26 additions and 1 deletions
+2
View File
@@ -342,6 +342,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define TRAIT_FISH_CASE_COMPATIBILE "fish_case_compatibile" //Stuff that can go inside fish cases
/// Plants that were mutated as a result of passive instability, not a mutation threshold.
#define TRAIT_PLANT_WILDMUTATE "wildmutation"
/// If you hit an APC with exposed internals with this item it will try to shock you
#define TRAIT_APC_SHOCKING "apc_shocking"
//quirk traits
#define TRAIT_ALCOHOL_TOLERANCE "alcohol_tolerance"
+2 -1
View File
@@ -170,7 +170,8 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_NODROP" = TRAIT_NODROP,
"TRAIT_NO_STORAGE_INSERT" = TRAIT_NO_STORAGE_INSERT,
"TRAIT_T_RAY_VISIBLE" = TRAIT_T_RAY_VISIBLE,
"TRAIT_NO_TELEPORT" = TRAIT_NO_TELEPORT
"TRAIT_NO_TELEPORT" = TRAIT_NO_TELEPORT,
"TRAIT_APC_SHOCKING" = TRAIT_APC_SHOCKING
),
/atom = list(
"TRAIT_KEEP_TOGETHER" = TRAIT_KEEP_TOGETHER
+4
View File
@@ -15,6 +15,10 @@
lefthand_file = 'icons/mob/inhands/equipment/kitchen_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/kitchen_righthand.dmi'
/obj/item/kitchen/Initialize()
. = ..()
ADD_TRAIT(src, TRAIT_APC_SHOCKING, INNATE_TRAIT)
/obj/item/kitchen/fork
name = "fork"
desc = "Pointy."
+18
View File
@@ -583,6 +583,24 @@
return TRUE
/obj/machinery/power/apc/attackby(obj/item/W, mob/living/user, params)
if(HAS_TRAIT(W, TRAIT_APC_SHOCKING))
var/metal = 0
var/shock_source = null
metal += LAZYACCESS(W.custom_materials, GET_MATERIAL_REF(/datum/material/iron))//This prevents wooden rolling pins from shocking the user
if(cell || terminal) //The mob gets shocked by whichever powersource has the most electricity
if(cell && terminal)
shock_source = cell.charge > terminal.powernet.avail ? cell : terminal.powernet
else
shock_source = terminal?.powernet || cell
if(shock_source && metal && (panel_open || opened)) //Now you're cooking with electricity
if(electrocute_mob(user, shock_source, src, siemens_coeff = 1, dist_check = TRUE))//People with insulated gloves just attack the APC normally. They're just short of magical anyway
do_sparks(5, TRUE, src)
user.visible_message("<span class='notice'>[user.name] shoves [W] into the internal components of [src], erupting into a cascade of sparks!</span>")
if(shock_source == cell)//If the shock is coming from the cell just fully discharge it, because it's funny
cell.use(cell.charge)
return
if(issilicon(user) && get_dist(src,user)>1)
return attack_hand(user)