Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shrapnel is no longer rng + u can pick what to grab #6712

Merged
merged 2 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading