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

Mortem: synthesized humans from RnD #7795

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
89 changes: 89 additions & 0 deletions code/modules/organs/external/subtypes/robotic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@
spawn_tags = SPAWN_TAG_PROSTHETIC
bad_type = /obj/item/organ/external/robotic
var/min_malfunction_damage = 20 // Any more damage than that and you start getting nasty random malfunctions
var/list/constructs_body = list(
BP_CHEST = null,
BP_HEAD = null,
BP_GROIN = null,
BP_L_ARM = null,
BP_R_ARM = null,
BP_L_LEG = null,
BP_R_LEG = null,
)

/obj/item/organ/external/robotic/New()
..()
if(organ_tag == BP_CHEST)
constructs_body[BP_CHEST] = src

/obj/item/organ/external/robotic/get_cache_key()
return "Robotic[model]"
Expand All @@ -20,8 +34,83 @@
icon_state = "[organ_tag]_[gender]"
mob_icon = icon(force_icon, icon_state)
icon = mob_icon

overlays.Cut()
for(var/tag in constructs_body)
if(constructs_body[tag])
overlays += constructs_body[tag]

return mob_icon

/obj/item/organ/external/robotic/attackby(obj/item/I, mob/user)
..()
// Check if organ havent tag or not be chest
if(!organ_tag || organ_tag != BP_CHEST)
return

// Check if organ not part
if(!istype(I, bad_type))
return to_chat(user, SPAN_NOTICE("Assemble parts of the same set."))

// Check if parts already installed
var/obj/item/organ/external/robotic/part = I
if(!part.organ_tag || constructs_body[part.organ_tag])
return to_chat(user, SPAN_NOTICE("You've already put that part in."))

// Insert part into phantom holder
constructs_body[part.organ_tag] = part
user.drop_from_inventory(part)
part.forceMove(src)
update_icon()

// Increase body size
w_class += part.w_class

// Check body pargs, if not fully done - return from proc
for(var/tag in constructs_body)
if(!constructs_body[tag])
return

// Prompt human name
var/name = sanitizeSafe(input(user, "Set a name for the new prosthetic."), MAX_NAME_LEN)
if(!name)
name = "prosthetic ([random_id("prosthetic_id", 1, 999)])"

// Prompt human sex
var/sex = input(user, "Choose your character's sex:", CHARACTER_PREFERENCE_INPUT_TITLE) as null|anything in list(FEMALE, MALE, NEUTER)
if(!sex)
sex = NEUTER

// Create human and rename
var/mob/living/carbon/human/H = new /mob/living/carbon/human(get_turf(loc))
H.fully_replace_character_name(name, name)
H.death(0)

// Replace human organs
for(var/tag in constructs_body)
if(H.organs_by_name[tag])
qdel(H.organs_by_name[tag])

// Create new robo-organ
var/obj/item/organ/external/organ = constructs_body[tag]
new organ.type(H)

// Create and prothesis organs, without brain and appendix
for(var/tag in H.species.has_process - list(BP_BRAIN, OP_APPENDIX))
var/organ_type = H.species.has_process[tag]

// Create natural organ and change their nature type
var/obj/item/organ/internal/O = new organ_type(H)
O.nature = MODIFICATION_SILICON

// Setup human sex and update body
H.gender = sex
H.update_body()
H.regenerate_icons()

// Delete chest with phantom holder
qdel(src)

/obj/item/organ/external/robotic/is_malfunctioning()
return prob(brute_dam + burn_dam - min_malfunction_damage)

Expand Down
3 changes: 3 additions & 0 deletions code/modules/surgery/robotic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
inflict_agony = 0 // Robotic organs can't feel pain anyway

/datum/surgery_step/robotic/can_use(mob/living/user, obj/item/organ/external/organ, obj/item/tool)
if(organ.organ_tag == BP_BRAIN)
return TRUE

return BP_IS_ROBOTIC(organ)

// Robotic organs are intended to be assembled and disassembled, making them far easier to work with.
Expand Down
Binary file modified rust_g.dll
Binary file not shown.