diff --git a/code/__defines/research/techweb_nodes.dm b/code/__defines/research/techweb_nodes.dm index 58e008d07d..4c79946979 100644 --- a/code/__defines/research/techweb_nodes.dm +++ b/code/__defines/research/techweb_nodes.dm @@ -5,6 +5,7 @@ #define TECHWEB_NODE_ALIENTECH "alientech" #define TECHWEB_NODE_ANOMALY_RESEARCH "anomaly_research" #define TECHWEB_NODE_ANOMALY_SHELLS "anomaly_shells" +#define TECHWEB_NODE_TELEKINETIC_RESEARCH "telekinetic_research" #define TECHWEB_NODE_APPLIED_BLUESPACE "applied_bluespace" #define TECHWEB_NODE_ATMOS "atmos" #define TECHWEB_NODE_AUGMENTATION "augmentation" diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index a1df8e0930..37f3df50ce 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -219,7 +219,7 @@ if(!mutations.len) return if((LASER in mutations) && a_intent == I_HURT) LaserEyes(A) // moved into a proc below - else if(TK in mutations) + else if(has_telegrip()) if(get_dist(src, A) > tk_maxrange) return A.attack_tk(src) diff --git a/code/_onclick/other_mobs.dm b/code/_onclick/other_mobs.dm index 5351139540..5b77af2f18 100644 --- a/code/_onclick/other_mobs.dm +++ b/code/_onclick/other_mobs.dm @@ -33,6 +33,16 @@ /mob/living/carbon/human/RestrainedClickOn(var/atom/A) return +/mob/proc/has_telegrip() + return TK in mutations + +/mob/living/carbon/human/has_telegrip() + if(istype(gloves,/obj/item/clothing/gloves/telekinetic)) + var/obj/item/clothing/gloves/telekinetic/G = gloves + if(G.has_grip_power()) + return TRUE + return ..() + /mob/living/carbon/human/RangedAttack(var/atom/A) if(!gloves && !mutations.len && !spitting) return @@ -43,7 +53,10 @@ else if(istype(G) && G.Touch(A,0)) // for magic gloves return - else if(TK in mutations) + else if(has_telegrip()) + if(istype(gloves,/obj/item/clothing/gloves/telekinetic)) + var/obj/item/clothing/gloves/telekinetic/TKG = gloves + TKG.use_grip_power(src,TRUE) A.attack_tk(src) else if(spitting) //Only used by xenos right now, can be expanded. diff --git a/code/_onclick/telekinesis.dm b/code/_onclick/telekinesis.dm index 4d7a65d81e..cdcea216c6 100644 --- a/code/_onclick/telekinesis.dm +++ b/code/_onclick/telekinesis.dm @@ -39,13 +39,13 @@ var/const/tk_maxrange = 15 /obj/item/attack_tk(mob/user) if(user.stat || !isturf(loc)) return - if((TK in user.mutations) && !user.get_active_hand()) // both should already be true to get here + if(user.has_telegrip() && !user.get_active_hand()) // both should already be true to get here var/obj/item/tk_grab/O = new(src) user.put_in_active_hand(O) O.host = user O.focus_object(src) else - warning("Strange attack_tk(): TK([TK in user.mutations]) empty hand([!user.get_active_hand()])") + warning("Strange attack_tk(): TK([user.has_telegrip()]) empty hand([!user.get_active_hand()])") return @@ -101,7 +101,7 @@ var/const/tk_maxrange = 15 if(!host || host != user) qdel(src) return - if(!(TK in host.mutations)) + if(!host.has_telegrip()) qdel(src) return if(isobj(target) && !isturf(target.loc)) @@ -132,6 +132,13 @@ var/const/tk_maxrange = 15 apply_focus_overlay() focus.throw_at(target, 10, 1, user) last_throw = world.time + if(ishuman(user)) + var/mob/living/carbon/human/H_user = user + if(istype(H_user.gloves,/obj/item/clothing/gloves/telekinetic)) + var/obj/item/clothing/gloves/telekinetic/TKG = H_user.gloves + TKG.use_grip_power(user,TRUE) + if(!TKG.has_grip_power()) + qdel(src) // Drop TK return /obj/item/tk_grab/attack(mob/living/M as mob, mob/living/user as mob, def_zone) diff --git a/code/modules/clothing/gloves/telekinetic.dm b/code/modules/clothing/gloves/telekinetic.dm new file mode 100644 index 0000000000..2601099ea4 --- /dev/null +++ b/code/modules/clothing/gloves/telekinetic.dm @@ -0,0 +1,71 @@ +/obj/item/clothing/gloves/telekinetic + desc = "Gloves with a built in telekinesis module, allows for remote interaction with small objects." + name = "kinesis assistance module" + icon_state = "regen" + item_state = "graygloves" + var/use_power_amount = 12 + + origin_tech = list(TECH_ENGINEERING = 4, TECH_BLUESPACE = 4) + +/obj/item/clothing/gloves/telekinetic/Initialize(mapload) + . = ..() + cell = new /obj/item/cell/device(src) + +/obj/item/clothing/gloves/telekinetic/proc/has_grip_power() + if(cell && cell.charge >= use_power_amount) + return TRUE + return FALSE + +/obj/item/clothing/gloves/telekinetic/proc/use_grip_power(var/mob/user,var/play_sound) + if(cell) + cell.checked_use(use_power_amount) + if(play_sound) + if(cell.charge < use_power_amount) + to_chat(user,span_danger("\The [src] bwoop as it runs out of power.")) + playsound(src,'sound/machines/synth_no.ogg') + else + playsound(src,'sound/machines/generator/generator_end.ogg',70,1) + +/obj/item/clothing/gloves/telekinetic/attack_hand(mob/user as mob) + if(user.get_inactive_hand() == src) + if(cell) + cell.update_icon() + user.put_in_hands(cell) + cell = null + to_chat(user, span_notice("You remove the cell from the [src].")) + playsound(src, 'sound/machines/button.ogg', 30, 1, 0) + return + ..() + else + return ..() + +/obj/item/clothing/gloves/telekinetic/attackby(obj/item/W, mob/user as mob) + if(istype(W, /obj/item/cell)) + if(istype(W, /obj/item/cell/device)) + if(!cell) + user.drop_item() + W.loc = src + cell = W + to_chat(user, span_notice("You install a cell in \the [src].")) + playsound(src, 'sound/machines/button.ogg', 30, 1, 0) + else + to_chat(user, span_warning("\The [src] already has a cell.")) + else + to_chat(user, span_warning("\The [src] cannot use that type of cell.")) + else + ..() + +/obj/item/clothing/gloves/telekinetic/examine(mob/user) + . = ..() + if(cell) + . += span_info("\The [src] has a \the [cell] attached.") + if(cell.charge <= cell.maxcharge*0.25) + . += span_warning("It appears to have a low amount of power remaining.") + else if(cell.charge > cell.maxcharge*0.25 && cell.charge <= cell.maxcharge*0.5) + . += span_notice("It appears to have an average amount of power remaining.") + else if(cell.charge > cell.maxcharge*0.5 && cell.charge <= cell.maxcharge*0.75) + . += span_info("It appears to have an above average amount of power remaining.") + else if(cell.charge > cell.maxcharge*0.75 && cell.charge <= cell.maxcharge) + . += span_info("It appears to have a high amount of power remaining.") + else + . += span_warning("\The [src] has an empty powercell slot.") diff --git a/code/modules/research/tg/designs/tool_designs.dm b/code/modules/research/tg/designs/tool_designs.dm index b8352dcf51..acb4524734 100644 --- a/code/modules/research/tg/designs/tool_designs.dm +++ b/code/modules/research/tg/designs/tool_designs.dm @@ -874,3 +874,15 @@ RND_CATEGORY_CYBERNETICS + RND_SUBCATEGORY_CYBERNETICS_ORGANS_MISC ) departmental_flags = DEPARTMENT_BITFLAG_SCIENCE + +/datum/design_techweb/telekinetic_gloves + name = "Kinesis Assistance Module" + id = "tk_gloves" + // req_tech = list(TECH_MATERIAL = 4, TECH_ENGINEERING = 3, TECH_BLUESPACE = 4) + build_type = PROTOLATHE + materials = list(MAT_VERDANTIUM = 1000, MAT_SILVER = 300, MAT_PLASTEEL = 1000) + build_path = /obj/item/clothing/gloves/telekinetic + category = list( + RND_CATEGORY_TOOLS + RND_SUBCATEGORY_TOOLS_ENGINEERING_ADVANCED + ) + departmental_flags = DEPARTMENT_BITFLAG_SCIENCE | DEPARTMENT_BITFLAG_ENGINEERING diff --git a/code/modules/research/tg/techwebs/nodes/research_nodes.dm b/code/modules/research/tg/techwebs/nodes/research_nodes.dm index 50b0a181e7..0a367736d3 100644 --- a/code/modules/research/tg/techwebs/nodes/research_nodes.dm +++ b/code/modules/research/tg/techwebs/nodes/research_nodes.dm @@ -103,3 +103,14 @@ ) research_costs = list(TECHWEB_POINT_TYPE_GENERIC = TECHWEB_TIER_3_POINTS) announce_channels = list(CHANNEL_SCIENCE) + +/datum/techweb_node/telekinetics + id = TECHWEB_NODE_TELEKINETIC_RESEARCH + display_name = "Applied Telekinetics Research" + description = "Altering the physical behavior of objects to allow remote interaction and movement." + prereq_ids = list(TECHWEB_NODE_APPLIED_BLUESPACE,TECHWEB_NODE_CYBER_IMPLANTS) + design_ids = list( + "tk_gloves", + ) + research_costs = list(TECHWEB_POINT_TYPE_GENERIC = TECHWEB_TIER_4_POINTS) + announce_channels = list(CHANNEL_SCIENCE) diff --git a/vorestation.dme b/vorestation.dme index 0253c8fdcc..78dc5604ea 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -2450,6 +2450,7 @@ #include "code\modules\clothing\gloves\gauntlets.dm" #include "code\modules\clothing\gloves\miscellaneous.dm" #include "code\modules\clothing\gloves\miscellaneous_vr.dm" +#include "code\modules\clothing\gloves\telekinetic.dm" #include "code\modules\clothing\head\collectable.dm" #include "code\modules\clothing\head\fishing.dm" #include "code\modules\clothing\head\flowercrowns.dm"