From b38db9e72e026391d36e3ea8971f21666a5a423e Mon Sep 17 00:00:00 2001 From: BlackMajor Date: Wed, 27 Apr 2022 23:05:22 +1200 Subject: [PATCH] latch verb --- .../species/station/protean/protean_blob.dm | 8 ++++ .../species/station/protean/protean_powers.dm | 46 +++++++++++++++++-- .../station/protean/protean_species.dm | 1 + 3 files changed, 52 insertions(+), 3 deletions(-) diff --git a/modular_chomp/code/modules/mob/living/carbon/human/species/station/protean/protean_blob.dm b/modular_chomp/code/modules/mob/living/carbon/human/species/station/protean/protean_blob.dm index b84bec95e5..77991e1006 100644 --- a/modular_chomp/code/modules/mob/living/carbon/human/species/station/protean/protean_blob.dm +++ b/modular_chomp/code/modules/mob/living/carbon/human/species/station/protean/protean_blob.dm @@ -74,6 +74,7 @@ verbs |= /mob/living/simple_mob/protean_blob/proc/nano_blobform verbs |= /mob/living/simple_mob/protean_blob/proc/nano_rig_transform verbs |= /mob/living/simple_mob/protean_blob/proc/appearance_switch + verbs |= /mob/living/simple_mob/protean_blob/proc/nano_latch verbs -= /mob/living/simple_mob/proc/nutrition_heal else update_icon() @@ -117,6 +118,13 @@ set hidden = 1 humanform.appearance_switch() +/mob/living/simple_mob/protean_blob/proc/nano_latch() + set name = "Latch/Unlatch host" + set desc = "Allows a protean to forcibly latch or unlatch from a host." + set category = "Abilities" + set hidden = 1 + humanform.nano_latch() + /mob/living/simple_mob/protean_blob/Login() ..() plane_holder.set_vis(VIS_AUGMENTED, 1) diff --git a/modular_chomp/code/modules/mob/living/carbon/human/species/station/protean/protean_powers.dm b/modular_chomp/code/modules/mob/living/carbon/human/species/station/protean/protean_powers.dm index 507fe07f34..0794b5ade6 100644 --- a/modular_chomp/code/modules/mob/living/carbon/human/species/station/protean/protean_powers.dm +++ b/modular_chomp/code/modules/mob/living/carbon/human/species/station/protean/protean_powers.dm @@ -341,10 +341,10 @@ set category = "Abilities" set hidden = 1 var/datum/species/protean/S = src.species - var/mob/M = src + var/mob/living/caller = src if(temporary_form) - M = temporary_form - var/blobstyle = input(M, "Which blob style would you like?") in list("Red and Blue Stars", "Blue Star", "Plain") + caller = temporary_form + var/blobstyle = input(caller, "Which blob style would you like?") in list("Red and Blue Stars", "Blue Star", "Plain") switch(blobstyle) if("Red and Blue Stars") S.blob_appearance = "puddle2" @@ -361,6 +361,40 @@ var/obj/item/weapon/holder/protoblob/PB = temporary_form.loc PB.item_state = S.blob_appearance +/mob/living/carbon/human/proc/nano_latch() + set name = "Latch/Unlatch host" + set desc = "Allows a protean to forcibly latch or unlatch from a host." + set category = "Abilities" + set hidden = 1 + var/mob/living/caller = src + var/mob/living/carbon/human/target + var/datum/species/protean/S = src.species + if(temporary_form) + caller = temporary_form + if(caller.loc == S.OurRig) + target = S.OurRig.wearer + if(target) + target.drop_from_inventory(S.OurRig) + else + to_chat(caller, "You aren't being worn, dummy.") + return + var/obj/held_item = caller.get_active_hand() + if(istype(held_item,/obj/item/weapon/grab)) + var/obj/item/weapon/grab/G = held_item + if(istype(G.affecting, target)) + if(G.loc == caller && G.state >= GRAB_AGGRESSIVE) + if(do_after(caller, 30, target)) + if(G.loc == caller && G.state >= GRAB_AGGRESSIVE) + caller.visible_message("[caller] latched onto [target]!", "You latch yourself onto [target]!") + target.Weaken(3) + nano_rig_transform() + target.drop_from_inventory(back) + target.equip_to_slot_if_possible(S.OurRig, slot_back) + else + to_chat(caller, "You can only latch onto humanoid mobs!") + else + to_chat(caller, "You need to be grabbing a humanoid mob aggressively to latch onto them.") + /// /// /// A helper to reuse /mob/living/proc/nano_get_refactory(obj/item/organ/internal/nano/refactory/R) if(istype(R)) @@ -453,4 +487,10 @@ icon_state = "rig" to_call = /mob/living/carbon/human/proc/appearance_switch +/obj/effect/protean_ability/latch_host + ability_name = "Latch Host" + desc = "Forcibly latch or unlatch your RIG from a host mob." + icon_state = "rig" + to_call = /mob/living/carbon/human/proc/nano_latch + #undef PER_LIMB_STEEL_COST diff --git a/modular_chomp/code/modules/mob/living/carbon/human/species/station/protean/protean_species.dm b/modular_chomp/code/modules/mob/living/carbon/human/species/station/protean/protean_species.dm index 796db01e43..72bd99a3c4 100644 --- a/modular_chomp/code/modules/mob/living/carbon/human/species/station/protean/protean_species.dm +++ b/modular_chomp/code/modules/mob/living/carbon/human/species/station/protean/protean_species.dm @@ -90,6 +90,7 @@ /mob/living/carbon/human/proc/nano_blobform, /mob/living/carbon/human/proc/nano_rig_transform, /mob/living/carbon/human/proc/appearance_switch, + /mob/living/carbon/human/proc/nano_latch, /mob/living/proc/set_size, /mob/living/carbon/human/proc/nano_change_fitting, //These verbs are displayed normally, /mob/living/carbon/human/proc/shapeshifter_select_hair,