Skip to content

Commit

Permalink
what if we coded the things we intended to happen
Browse files Browse the repository at this point in the history
  • Loading branch information
timothyteakettle committed Jun 23, 2023
1 parent 32f00eb commit 820367f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
4 changes: 2 additions & 2 deletions code/modules/mob/living/carbon/human/health.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// This is because the logic for being unconscious from damage is, for some reason, in UI. //
handle_regular_UI_updates()

/mob/living/carbon/human/rejuvenate(fix_missing, reset_to_slot)
/mob/living/carbon/human/rejuvenate(fix_missing, reset_to_slot, var/delete_nif = FALSE)
. = ..()
if(!.)
return
Expand All @@ -16,7 +16,7 @@

// todo: this obviously doesn't respect reset_to_slot.
if(fix_missing || reset_to_slot)
species.create_organs(src)
species.create_organs(src, delete_nif)
restore_all_organs()
client?.prefs?.copy_to(src)
if(dna)
Expand Down
21 changes: 12 additions & 9 deletions code/modules/species/species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -622,9 +622,14 @@ GLOBAL_LIST_INIT(species_oxygen_tank_by_gas, list(
* called to ensure organs are consistent with our species's
* this is a destructive operation and will erase old organs!
*/
/datum/species/proc/create_organs(var/mob/living/carbon/human/H) //Handles creation of mob organs.
/datum/species/proc/create_organs(var/mob/living/carbon/human/H, var/delete_nif = FALSE) //Handles creation of mob organs.
H.mob_size = mob_size

// if we have a NIF, unimplant it before it gets wiped
var/obj/item/nif/our_nif = H.nif
if(H.nif)
H.nif.unimplant(H)

// store the markings for each limb we have so we can apply them to our new limbs
var/list/temporary_marking_store = list()
for(var/limb_type in has_limbs)
Expand Down Expand Up @@ -669,14 +674,12 @@ GLOBAL_LIST_INIT(species_oxygen_tank_by_gas, list(
O.organ_tag = organ_tag
H.internal_organs_by_name[organ_tag] = O

if(H.nif)
var/type = H.nif.type
var/durability = H.nif.durability
var/list/nifsofts = H.nif.nifsofts
var/list/nif_savedata = H.nif.save_data.Copy()

var/obj/item/nif/nif = new type(H,durability,nif_savedata)
nif.nifsofts = nifsofts
// if we had a NIF, decide if we want to delete it, or put it back
if(our_nif)
if(delete_nif)
QDEL_NULL(our_nif)
else
our_nif.quick_implant(H)

if(base_color)
H.r_skin = hex2num(copytext(base_color,2,4))
Expand Down
2 changes: 1 addition & 1 deletion code/modules/species/station/xenochimera.dm
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@
return
var/mob/living/carbon/human/H = owner
H.restore_blood()
H.species.create_organs(H)
H.species.create_organs(H, TRUE)
H.restore_all_organs()
H.adjustBruteLoss(-healing_amount)
H.adjustFireLoss(-healing_amount)
Expand Down

0 comments on commit 820367f

Please sign in to comment.