Skip to content

Commit

Permalink
shrapnel is no longer rng + u can pick what to grab (#6712)
Browse files Browse the repository at this point in the history
## About The Pull Request

shrapnel is no longer rng + u can pick what to grab. theres also now a
proper proc for removing something surgically.

## Why It's Good For The Game

no reason for rng in ideal circumstances. u already get penalized for
improper tools so like why have more rng. also a needed proc for
slightly less shitcodedness.

## Changelog

:cl:
add: shrapnel / etc removal now goes through a surgically_remove proc.
qol: shrapnel removal is no longer rng
qol: shrapnel removal now lets u pick what item to remove
/:cl:
  • Loading branch information
Niezann committed Sep 2, 2024
1 parent 2533cae commit f1e48e0
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 42 deletions.
4 changes: 4 additions & 0 deletions code/game/objects/items/weapons/implants/implant.dm
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@
else
..()

/obj/item/implant/surgically_remove(mob/living/carbon/human/target, obj/item/organ/external/chest/removing_from)
. = ..()
imp_in = null
implanted = 0
//////////////////////////////
// Tracking Implant
//////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
var/roundstart = FALSE // If true, spawning won't try to pull a ghost.
var/used_dominate // world.time when the dominate power was last used.


/mob/living/simple_mob/animal/borer/roundstart
roundstart = TRUE

Expand Down Expand Up @@ -267,3 +266,9 @@
continue
else if(M.stat == DEAD && M.get_preference_toggle(/datum/game_preference_toggle/observer/ghost_ears))
to_chat(M, "[src.true_name] whispers to [host], \"[message]\"")

/mob/living/simple_mob/animal/borer/proc/surgically_remove(mob/living/carbon/human/target, obj/item/organ/external/chest/removing_from)
if(controlling)
target.release_control()
detatch()
leave_host()
4 changes: 4 additions & 0 deletions code/modules/resleeving/mirror.dm
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@
forceMove(MT)
MT.imp = src

/obj/item/implant/mirror/surgically_remove(mob/living/carbon/human/target, obj/item/organ/external/chest/removing_from)
. = ..()
target.mirror = null

/obj/item/implant/mirror/positronic
name = "Synthetic Mirror"
desc = "An altered form of the common mirror designed to work with synthetic brains."
Expand Down
61 changes: 20 additions & 41 deletions code/modules/surgery/implant.dm
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,15 @@
// IMPLANT/ITEM REMOVAL SURGERY
//////////////////////////////////////////////////////////////////

/obj/item/proc/surgically_remove(mob/living/carbon/human/target, obj/item/organ/external/chest/removing_from)
removing_from.implants -= src

target.update_hud_sec_implants()

loc = get_turf(target)
add_blood(target)
update_icon()

/datum/surgery_step/cavity/implant_removal
allowed_tools = list(
/obj/item/surgical/hemostat = 100, \
Expand Down Expand Up @@ -190,49 +199,19 @@
/datum/surgery_step/cavity/implant_removal/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/chest/affected = target.get_organ(target_zone)

var/find_prob = 0

if (affected.implants.len)

var/obj/item/obj = pick(affected.implants)

if(istype(obj,/obj/item/implant))
var/obj/item/implant/imp = obj
if (imp.islegal())
find_prob +=60
else
find_prob +=40
else
find_prob +=50

if (prob(find_prob))
user.visible_message("<font color=#4F49AF>[user] takes something out of incision on [target]'s [affected.name] with \the [tool]!</font>", \
"<font color=#4F49AF>You take [obj] out of incision on [target]'s [affected.name]s with \the [tool]!</font>" )
affected.implants -= obj

target.update_hud_sec_implants()

//Handle possessive brain borers.
if(istype(obj,/mob/living/simple_mob/animal/borer))
var/mob/living/simple_mob/animal/borer/worm = obj
if(worm.controlling)
target.release_control()
worm.detatch()
worm.leave_host()
else
obj.loc = get_turf(target)
obj.add_blood(target)
obj.update_icon()
if(istype(obj,/obj/item/implant))
var/obj/item/implant/imp = obj
imp.imp_in = null
imp.implanted = 0
if(istype(obj, /obj/item/implant/mirror))
target.mirror = null
else if(istype(tool,/obj/item/nif)){var/obj/item/nif/N = tool;N.unimplant(target)}
else
user.visible_message("<font color=#4F49AF>[user] removes \the [tool] from [target]'s [affected.name].</font>", \
"<font color=#4F49AF>There's something inside [target]'s [affected.name], but you just missed it this time.</font>" )
var/obj/item/obj = input("What do you want to extract?") in affected.implants

user.visible_message("<font color=#4F49AF>[user] takes something out of incision on [target]'s [affected.name] with \the [tool]!</font>", \
"<font color=#4F49AF>You take [obj] out of incision on [target]'s [affected.name]s with \the [tool]!</font>" )

obj.surgically_remove(target, affected)

if(istype(tool, /obj/item/nif))
var/obj/item/nif/N = tool
N.unimplant(target)

else
user.visible_message("<font color=#4F49AF>[user] could not find anything inside [target]'s [affected.name], and pulls \the [tool] out.</font>", \
"<font color=#4F49AF>You could not find anything inside [target]'s [affected.name].</font>" )
Expand Down

0 comments on commit f1e48e0

Please sign in to comment.