Well, that was surely an interesting thing to code.

This commit is contained in:
Useroth
2019-05-17 16:22:17 +02:00
parent 06681790cd
commit 4d75eca582
2 changed files with 64 additions and 18 deletions
+57 -17
View File
@@ -1,6 +1,6 @@
/obj/item/nutcracker /obj/item/nutcracker
name = "nutcracker" name = "nutcracker"
desc = "It seems oversized... quite much... you could fit a head in it." desc = "It seems quite oversized. You could probably even crush a watermelon with it."
icon = 'icons/obj/surgery.dmi' icon = 'icons/obj/surgery.dmi'
icon_state = "nutcracker" icon_state = "nutcracker"
force = 10 force = 10
@@ -8,22 +8,62 @@
w_class = WEIGHT_CLASS_NORMAL w_class = WEIGHT_CLASS_NORMAL
attack_verb = list("smashed", "beaten", "crushed") attack_verb = list("smashed", "beaten", "crushed")
/obj/item/nutcracker/attack(mob/living/carbon/M, mob/user) /obj/item/nutcracker/proc/gib_head(mob/living/carbon/M)
var/obj/item/bodypart/head = M.get_bodypart("head")
if(!head)
return
var/turf/T = get_turf(M)
var/list/organs = M.getorganszone("head") + M.getorganszone("eyes") + M.getorganszone("mouth")
for(var/internal_organ in organs)
var/obj/item/organ/I = internal_organ
I.Remove(M)
I.forceMove(T)
head.drop_limb()
qdel(head)
new M.gib_type(T,1,M.get_static_viruses())
M.add_splatter_floor(T)
playsound(M, 'sound/effects/splat.ogg', 50, 1)
//It's a bit of a clusterfuck, but if someone wants, it can be easily repurposed to work on other limbs too.
/obj/item/nutcracker/attack(mob/living/carbon/M, mob/living/carbon/user)
. = ..()
if(!get_turf(M))
return
if(!istype(M)) if(!istype(M))
return return
if(user && imp) if(M == user) //just use the suicide verb instead
if(M != user) return
M.visible_message("<span class='warning'>[user] is attempting to implant [M].</span>") if(user.zone_selected != "head")
return
if(!target_limb)
to_chat(user, "<span class='notice'>[M] has no [parse_zone(target_zone)]!</span>")
return
if(!get_location_accessible(M, target_zone))
to_chat(user, "<span class='notice'>Expose [M]\s head before trying to crush it!</span>")
return
var/turf/T = get_turf(M) var/target_zone = "head"
if(T && (M == user || do_mob(user, M, 50))) var/obj/item/bodypart/target_limb = M.get_bodypart(target_zone)
if(src && imp) var/crush_time = max(0, 400 - target_limb.brute_dam*2)
if(imp.implant(M, user))
if (M == user) M.visible_message("<span class='warning'>[user] is trying to crush [M]\s head with \the [src]!</span>")
to_chat(user, "<span class='notice'>You implant yourself.</span>")
else
M.visible_message("[user] has implanted [M].", "<span class='notice'>[user] implants you.</span>") if(do_mob(user, M, crush_time))
imp = null if(get_location_accessible(M, target_zone) && target_limb) //Yes, two checks, before and after the timer. What if someone puts a helmet on the guy while you're crushing his head?
update_icon() M.visible_message("<span class='warning'>[M]\s head cracks like a watermelon, spilling everything inside, as it becomes an unrecognizable mess!</span>")
else gib_head(M)
to_chat(user, "<span class='warning'>[src] fails to implant [M].</span>") else
to_chat(user, "<span class='notice'>Expose [M]\s head before trying to crush it!</span>")
/obj/item/nutcracker/suicide_act(mob/living/carbon/user)
var/obj/item/bodypart/target_limb = user.get_bodypart("head")
if(target_limb) //I mean like... for example lings can be still alive without heads.
user.visible_message("<span class='suicide'>[user] is crushing [user.p_their()] own head with \the [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
if(do_after(user, 30))
gib_head(user)
else
return
return (BRUTELOSS)
+7 -1
View File
@@ -988,6 +988,12 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
item = /obj/item/storage/backpack/duffelbag/syndie/surgery item = /obj/item/storage/backpack/duffelbag/syndie/surgery
cost = 3 cost = 3
/datum/uplink_item/device_tools/nutcracker
name = "Nutcracker"
desc = "An oversized version of what you'd initially expect here. Big enough to crush skulls."
item = /obj/item/nutcracker
cost = 1
/datum/uplink_item/device_tools/surgerybag_adv /datum/uplink_item/device_tools/surgerybag_adv
name = "Syndicate Surgery Duffel Bag" name = "Syndicate Surgery Duffel Bag"
desc = "The Syndicate surgery duffel bag is a toolkit containing all newest surgery tools, surgical drapes, \ desc = "The Syndicate surgery duffel bag is a toolkit containing all newest surgery tools, surgical drapes, \
@@ -1511,7 +1517,7 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
cost = 15 cost = 15
restricted_roles = list("Clown") restricted_roles = list("Clown")
/datum/uplink_item/device_tools/honkpins //Idealy so they can place it into their own guns without needing cargo /datum/uplink_item/device_tools/honkpins //Idealy so they can place it into their own guns without needing cargo
name = "Hilarious firing pin" name = "Hilarious firing pin"
desc = "A single firing pin made for Clown agents, this firing pin makes any gun honk when fired if not a true clown! \ desc = "A single firing pin made for Clown agents, this firing pin makes any gun honk when fired if not a true clown! \
This firing pin also helps you fire the gun correctly. May the HonkMother HONK you agent." This firing pin also helps you fire the gun correctly. May the HonkMother HONK you agent."