latch verb

This commit is contained in:
BlackMajor
2022-04-27 23:05:22 +12:00
parent 10d12de3bb
commit b38db9e72e
3 changed files with 52 additions and 3 deletions
@@ -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)
@@ -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("<span class='danger'>[caller] latched onto [target]!</span>", "<span class='danger'>You latch yourself onto [target]!</span>")
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
@@ -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,