From 3b2258ce38d111cc831ff1ecc00b5fa0500aedda Mon Sep 17 00:00:00 2001 From: Zap-zapper Date: Thu, 6 Dec 2018 00:17:41 +0700 Subject: [PATCH] size control implant --- .../objects/items/weapons/implants/implant.dm | 84 +++++++++++++++++++ .../items/weapons/implants/implanter.dm | 16 ++++ code/game/objects/structures/trash_pile.dm | 1 + code/modules/research/designs_vr.dm | 8 ++ 4 files changed, 109 insertions(+) diff --git a/code/game/objects/items/weapons/implants/implant.dm b/code/game/objects/items/weapons/implants/implant.dm index f5bd38dcc1..3f30c13d8a 100644 --- a/code/game/objects/items/weapons/implants/implant.dm +++ b/code/game/objects/items/weapons/implants/implant.dm @@ -337,6 +337,90 @@ Implant Specifics:
"} explosion(get_turf(imp_in), -1, -1, 1, 3) qdel(src) + +////////////////////////////// +// Size Control Implant +////////////////////////////// +/obj/item/weapon/implant/sizecontrol + name = "size control implant" + desc = "Implant which allows to control host size via voice commands." + icon_state = "implant_evil" + var/owner + var/active = TRUE + +/obj/item/weapon/implant/sizecontrol/get_data() + var/dat = {" +Implant Specifications:
+Name:L3-WD Size Controlling Implant
+Life:1-2 weeks after implanting
+
+Function: Resizes the host whenever specific verbal command is received
"} + return dat + +/obj/item/weapon/implant/sizecontrol/hear_talk(mob/M, msg) + if(M == imp_in) + return + if(owner) + if(M != owner) + return + if(findtext(msg,"ignore")) + return + var/list/replacechars = list("'" = "",">" = "","<" = "","(" = "",")" = "", "~" = "") + msg = replace_characters(msg, replacechars) + hear(msg) + return + +/obj/item/weapon/implant/sizecontrol/see_emote(mob/living/M, message, m_type) + if(M == imp_in) + return + if(owner) + if(M != owner) + return + var/list/replacechars = list("'" = "",">" = "","<" = "","(" = "",")" = "", "~" = "") + message = replace_characters(message, replacechars) + var/static/regex/say_in_me = new/regex("(")(.*?)(&#)", "g") + while(say_in_me.Find(message)) + if(findtext(say_in_me.match,"ignore")) + return + hear(say_in_me.group[2]) + + +/obj/item/weapon/implant/sizecontrol/hear(var/msg) + if (malfunction) + return + + if(istype(imp_in, /mob/living)) + var/mob/living/H = imp_in + if(findtext(msg,"implant-toggle")) + active = !active + if(active) + if(findtext(msg,"grow")) + H.resize(min(H.size_multiplier*1.5, 2)) + else if(findtext(msg,"shrink")) + H.resize(max(H.size_multiplier*0.5, 0.25)) + else if(findtext(msg, "resize")) + var/static/regex/size_mult = new/regex("\\d+") + if(size_mult.Find(msg)) + var/resizing_value = text2num(size_mult.match) + if(findtext(msg, "centimeter")) //Because metric system rules + H.resize(Clamp(resizing_value/170 , 0.25, 2)) //170 cm is average crewmember, I think + else + H.resize(Clamp(resizing_value , 0.25, 2)) + + + +/obj/item/weapon/implant/sizecontrol/post_implant(mob/source, mob/living/user = usr) + if(source != user) + owner = user + + +/obj/item/weapon/implant/sizecontrol/emp_act(severity) + if(istype(imp_in, /mob/living)) + var/newsize = pick(RESIZE_HUGE,RESIZE_BIG,RESIZE_NORMAL,RESIZE_SMALL,RESIZE_TINY,RESIZE_A_HUGEBIG,RESIZE_A_BIGNORMAL,RESIZE_A_NORMALSMALL,RESIZE_A_SMALLTINY) + var/mob/living/H = imp_in + H.resize(newsize) + + ////////////////////////////// // Chemical Implant ////////////////////////////// diff --git a/code/game/objects/items/weapons/implants/implanter.dm b/code/game/objects/items/weapons/implants/implanter.dm index c1b0d5db8d..2ae0597366 100644 --- a/code/game/objects/items/weapons/implants/implanter.dm +++ b/code/game/objects/items/weapons/implants/implanter.dm @@ -88,6 +88,22 @@ update() return +/obj/item/weapon/implanter/sizecontrol + name = "size control implant" + desc = "Implant which allows to control host size via voice commands." + description_info = {"Only accessable by those who implanted the victim. Self-implanting allows everyone to change host size. The following special commands are available: +'Shrink' - host size decreases. +'Grow' - host size increases. +'Resize (NUMBER)' or 'Resize (NUMBER) centimeter(s)' - for accurate size control. +'Ignore' - keywords in the speech won't have any effect. +'Implant-toggle' - toggles implant."} + +/obj/item/weapon/implanter/sizecontrol/New() + src.imp = new /obj/item/weapon/implant/sizecontrol( src ) + ..() + update() + return + /obj/item/weapon/implanter/adrenalin name = "implanter-adrenalin" diff --git a/code/game/objects/structures/trash_pile.dm b/code/game/objects/structures/trash_pile.dm index 727dcbb9f4..cfce81e866 100644 --- a/code/game/objects/structures/trash_pile.dm +++ b/code/game/objects/structures/trash_pile.dm @@ -221,6 +221,7 @@ prob(4);/obj/item/weapon/storage/pill_bottle/happy, prob(4);/obj/item/weapon/storage/pill_bottle/zoom, prob(4);/obj/item/weapon/gun/energy/sizegun, + prob(3);/obj/item/weapon/implanter/sizecontrol, prob(3);/obj/item/weapon/material/butterfly, prob(3);/obj/item/weapon/material/butterfly/switchblade, prob(3);/obj/item/clothing/gloves/knuckledusters, diff --git a/code/modules/research/designs_vr.dm b/code/modules/research/designs_vr.dm index cc9b649b75..94fbb9ce09 100644 --- a/code/modules/research/designs_vr.dm +++ b/code/modules/research/designs_vr.dm @@ -13,6 +13,14 @@ materials = list(DEFAULT_WALL_MATERIAL = 2000, "glass" = 2000) build_path = /obj/item/weapon/implantcase/backup +/datum/design/item/implant/sizecontrol + name = "Size control implant" + id = "implant_size" + req_tech = list(TECH_MATERIAL = 3, TECH_BIO = 4, TECH_DATA = 4, TECH_ENGINEERING = 3) + materials = list(DEFAULT_WALL_MATERIAL = 2000, "glass" = 2000, "silver" = 3000) + build_path = /obj/item/weapon/implanter/sizecontrol + sort_string = "TAAAA" + /datum/design/item/weapon/sizegun name = "Size gun" id = "sizegun"