Merge remote-tracking branch 'upstream/master' into purges-assisted-organs

This commit is contained in:
Fox McCloud
2018-07-09 01:26:42 -04:00
13 changed files with 344 additions and 232 deletions
@@ -446,3 +446,55 @@
materials = list(MAT_METAL = 500, MAT_GLASS = 500)
build_path = /obj/item/implantcase/track
category = list("Medical")
//Cybernetic organs
/datum/design/cybernetic_liver
name = "Cybernetic Liver"
desc = "A cybernetic liver"
id = "cybernetic_liver"
req_tech = list("biotech" = 4, "materials" = 4)
build_type = PROTOLATHE | MECHFAB
materials = list(MAT_METAL = 500, MAT_GLASS = 500)
build_path = /obj/item/organ/internal/liver/cybernetic
category = list("Medical")
/datum/design/cybernetic_kidneys
name = "Cybernetic Kidneys"
desc = "A cybernetic pair of kidneys"
id = "cybernetic_kidneys"
req_tech = list("biotech" = 4, "materials" = 4)
build_type = PROTOLATHE | MECHFAB
materials = list(MAT_METAL = 500, MAT_GLASS = 500)
build_path = /obj/item/organ/internal/kidneys/cybernetic
category = list("Medical")
/datum/design/cybernetic_heart
name = "Cybernetic Heart"
desc = "A cybernetic heart"
id = "cybernetic_heart"
req_tech = list("biotech" = 4, "materials" = 4)
build_type = PROTOLATHE | MECHFAB
materials = list(MAT_METAL = 500, MAT_GLASS = 500)
build_path = /obj/item/organ/internal/heart/cybernetic
category = list("Medical")
/datum/design/cybernetic_lungs
name = "Cybernetic Lungs"
desc = "A pair of cybernetic lungs."
id = "cybernetic_lungs"
req_tech = list("biotech" = 4, "materials" = 4)
build_type = PROTOLATHE | MECHFAB
materials = list(MAT_METAL = 500, MAT_GLASS = 500)
build_path = /obj/item/organ/internal/lungs/cybernetic
category = list("Medical")
/datum/design/cybernetic_lungs_u
name = "Upgraded Cybernetic Lungs"
desc = "A pair of upgraded cybernetic lungs."
id = "cybernetic_lungs_u"
req_tech = list("biotech" = 5, "materials" = 5, "engineering" = 5)
build_type = PROTOLATHE | MECHFAB
materials = list(MAT_METAL = 500, MAT_GLASS = 500, MAT_SILVER = 500)
build_path = /obj/item/organ/internal/lungs/cybernetic/upgraded
category = list("Medical")
+1 -1
View File
@@ -1,7 +1,7 @@
/datum/surgery/limb_augmentation
name = "Augment Limb"
steps = list(/datum/surgery_step/generic/cut_open, /datum/surgery_step/generic/clamp_bleeders, /datum/surgery_step/generic/retract_skin, /datum/surgery_step/augment)
possible_locs = list("chest","l_arm","r_arm","r_leg","l_leg")
possible_locs = list("head", "chest","l_arm","r_arm","r_leg","l_leg")
/datum/surgery/limb_augmentation/can_start(mob/user, mob/living/carbon/target)
if(ishuman(target))
+150
View File
@@ -0,0 +1,150 @@
/obj/item/organ/internal/heart
name = "heart"
icon_state = "heart-on"
organ_tag = "heart"
parent_organ = "chest"
slot = "heart"
origin_tech = "biotech=5"
var/beating = TRUE
dead_icon = "heart-off"
var/icon_base = "heart"
/obj/item/organ/internal/heart/update_icon()
if(beating)
icon_state = "[icon_base]-on"
else
icon_state = "[icon_base]-off"
/obj/item/organ/internal/heart/remove(mob/living/carbon/M, special = 0)
. = ..()
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(H.stat == DEAD)
Stop()
return
spawn(120)
if(!owner)
Stop()
/obj/item/organ/internal/heart/emp_act(intensity)
if(emp_proof)
return
if(owner && is_robotic())
Stop() // In the name of looooove~!
owner.visible_message("<span class='danger'>[owner] clutches [owner.p_their()] chest and gasps!</span>","<span class='userdanger'>You clutch your chest in pain!</span>")
/obj/item/organ/internal/heart/attack_self(mob/user)
..()
if(!beating)
Restart()
spawn(80)
if(!owner)
Stop()
/obj/item/organ/internal/heart/safe_replace(mob/living/carbon/human/target)
Restart()
..()
/obj/item/organ/internal/heart/proc/Stop()
beating = FALSE
update_icon()
return 1
/obj/item/organ/internal/heart/proc/Restart()
beating = TRUE
update_icon()
return TRUE
/obj/item/organ/internal/heart/prepare_eat()
var/obj/S = ..()
S.icon_state = dead_icon
return S
/obj/item/organ/internal/heart/cursed
name = "cursed heart"
desc = "it needs to be pumped..."
icon_state = "cursedheart-off"
icon_base = "cursedheart"
origin_tech = "biotech=6"
actions_types = list(/datum/action/item_action/organ_action/cursed_heart)
var/last_pump = 0
var/pump_delay = 30 //you can pump 1 second early, for lag, but no more (otherwise you could spam heal)
var/blood_loss = 100 //600 blood is human default, so 5 failures (below 122 blood is where humans die because reasons?)
//How much to heal per pump, negative numbers would HURT the player
var/heal_brute = 0
var/heal_burn = 0
var/heal_oxy = 0
/obj/item/organ/internal/heart/cursed/attack(mob/living/carbon/human/H, mob/living/carbon/human/user, obj/target)
if(H == user && istype(H))
if(NO_BLOOD in H.species.species_traits)
to_chat(H, "<span class = 'userdanger'>\The [src] is not compatible with your form!</span>")
return
playsound(user,'sound/effects/singlebeat.ogg', 40, 1)
user.drop_item()
insert(user)
else
return ..()
/obj/item/organ/internal/heart/cursed/on_life()
if(world.time > (last_pump + pump_delay))
if(ishuman(owner) && owner.client) //While this entire item exists to make people suffer, they can't control disconnects.
var/mob/living/carbon/human/H = owner
if(!(NO_BLOOD in H.species.species_traits))
H.blood_volume = max(H.blood_volume - blood_loss, 0)
to_chat(H, "<span class='userdanger'>You have to keep pumping your blood!</span>")
if(H.client)
H.client.color = "red" //bloody screen so real
else
last_pump = world.time //lets be extra fair *sigh*
/obj/item/organ/internal/heart/cursed/insert(mob/living/carbon/M, special = 0)
..()
if(owner)
to_chat(owner, "<span class='userdanger'>Your heart has been replaced with a cursed one, you have to pump this one manually otherwise you'll die!</span>")
/datum/action/item_action/organ_action/cursed_heart
name = "pump your blood"
//You are now brea- pumping blood manually
/datum/action/item_action/organ_action/cursed_heart/Trigger()
. = ..()
if(. && istype(target,/obj/item/organ/internal/heart/cursed))
var/obj/item/organ/internal/heart/cursed/cursed_heart = target
if(world.time < (cursed_heart.last_pump + (cursed_heart.pump_delay-10))) //no spam
to_chat(owner, "<span class='userdanger'>Too soon!</span>")
return
cursed_heart.last_pump = world.time
playsound(owner,'sound/effects/singlebeat.ogg',40,1)
to_chat(owner, "<span class = 'notice'>Your heart beats.</span>")
var/mob/living/carbon/human/H = owner
if(istype(H))
if(!(NO_BLOOD in H.species.species_traits))
H.blood_volume = min(H.blood_volume + cursed_heart.blood_loss*0.5, BLOOD_VOLUME_NORMAL)
if(owner.client)
owner.client.color = ""
H.adjustBruteLoss(-cursed_heart.heal_brute)
H.adjustFireLoss(-cursed_heart.heal_burn)
H.adjustOxyLoss(-cursed_heart.heal_oxy)
/obj/item/organ/internal/heart/cybernetic
name = "cybernetic heart"
desc = "An electronic device designed to mimic the functions of an organic human heart. Offers no benefit over an organic heart other than being easy to make."
icon_state = "heart-c-on"
icon_base = "heart-c"
dead_icon = "heart-c-off"
origin_tech = "biotech=5"
status = ORGAN_ROBOT
/obj/item/organ/internal/heart/cybernetic/emp_act()
if(emp_proof)
return
Stop()
+25
View File
@@ -0,0 +1,25 @@
/obj/item/organ/internal/kidneys
name = "kidneys"
icon_state = "kidneys"
gender = PLURAL
organ_tag = "kidneys"
parent_organ = "groin"
slot = "kidneys"
/obj/item/organ/internal/kidneys/on_life()
// Coffee is really bad for you with busted kidneys.
// This should probably be expanded in some way, but fucked if I know
// what else kidneys can process in our reagent list.
var/datum/reagent/coffee = locate(/datum/reagent/consumable/drink/coffee) in owner.reagents.reagent_list
if(coffee)
if(is_bruised())
owner.adjustToxLoss(0.1 * PROCESS_ACCURACY)
else if(is_broken())
owner.adjustToxLoss(0.3 * PROCESS_ACCURACY)
/obj/item/organ/internal/kidneys/cybernetic
name = "cybernetic kidneys"
icon_state = "kidneys-c"
desc = "An electronic device designed to mimic the functions of human kidneys. It has no benefits over a pair of organic kidneys, but is easy to produce."
origin_tech = "biotech=4"
status = ORGAN_ROBOT
+58
View File
@@ -0,0 +1,58 @@
/obj/item/organ/internal/liver
name = "liver"
icon_state = "liver"
organ_tag = "liver"
parent_organ = "groin"
slot = "liver"
var/alcohol_intensity = 1
/obj/item/organ/internal/liver/on_life()
if(germ_level > INFECTION_LEVEL_ONE)
if(prob(1))
to_chat(owner, "<span class='warning'> Your skin itches.</span>")
if(germ_level > INFECTION_LEVEL_TWO)
if(prob(1))
owner.vomit()
if(owner.life_tick % PROCESS_ACCURACY == 0)
//High toxins levels are dangerous
if(owner.getToxLoss() >= 60 && !owner.reagents.has_reagent("charcoal"))
//Healthy liver suffers on its own
if(damage < min_broken_damage)
receive_damage(0.2 * PROCESS_ACCURACY)
//Damaged one shares the fun
else
var/obj/item/organ/internal/O = pick(owner.internal_organs)
if(O)
O.receive_damage(0.2 * PROCESS_ACCURACY)
//Detox can heal small amounts of damage
if(damage && damage < min_bruised_damage && owner.reagents.has_reagent("charcoal"))
receive_damage(-0.2 * PROCESS_ACCURACY)
// Get the effectiveness of the liver.
var/filter_effect = 3
if(is_bruised())
filter_effect -= 1
if(is_broken())
filter_effect -= 2
// Damaged liver means some chemicals are very dangerous
if(damage >= min_bruised_damage)
for(var/datum/reagent/R in owner.reagents.reagent_list)
// Ethanol and all drinks are bad
if(istype(R, /datum/reagent/consumable/ethanol))
owner.adjustToxLoss(0.1 * PROCESS_ACCURACY)
// Can't cope with toxins at all
for(var/toxin in list("toxin", "plasma", "sacid", "facid", "cyanide", "amanitin", "carpotoxin"))
if(owner.reagents.has_reagent(toxin))
owner.adjustToxLoss(0.3 * PROCESS_ACCURACY)
/obj/item/organ/internal/liver/cybernetic
name = "cybernetic liver"
icon_state = "liver-c"
desc = "An electronic device designed to mimic the functions of a human liver. It has no benefits over an organic liver, but is easy to produce."
origin_tech = "biotech=4"
status = ORGAN_ROBOT
+28 -1
View File
@@ -334,4 +334,31 @@
cold_level_1_damage = -COLD_GAS_DAMAGE_LEVEL_1 //They heal when the air is cold
cold_level_2_damage = -COLD_GAS_DAMAGE_LEVEL_2
cold_level_3_damage = -COLD_GAS_DAMAGE_LEVEL_3
cold_damage_types = list(BRUTE = 1, BURN = 0.5)
cold_damage_types = list(BRUTE = 1, BURN = 0.5)
/obj/item/organ/internal/lungs/cybernetic
name = "cybernetic lungs"
desc = "A cybernetic version of the lungs found in traditional humanoid entities. It functions the same as an organic lung and is merely meant as a replacement."
icon_state = "lungs-c"
origin_tech = "biotech=4"
status = ORGAN_ROBOT
/obj/item/organ/internal/lungs/cybernetic/emp_act()
if(emp_proof)
return
if(owner)
owner.losebreath = 20
/obj/item/organ/internal/lungs/cybernetic/upgraded
name = "upgraded cybernetic lungs"
desc = "A more advanced version of the stock cybernetic lungs. They are capable of filtering out lower levels of toxins and carbon dioxide."
icon_state = "lungs-c-u"
origin_tech = "biotech=5"
safe_toxins_max = 20
safe_co2_max = 20
cold_level_1_threshold = 200
cold_level_2_threshold = 140
cold_level_3_threshold = 100
-7
View File
@@ -271,13 +271,6 @@
if(2)
receive_damage(7, 1)
/obj/item/organ/internal/heart/emp_act(intensity)
if(emp_proof)
return
if(owner && is_robotic())
Stop() // In the name of looooove~!
owner.visible_message("<span class='danger'>[owner] clutches [owner.p_their()] chest and gasps!</span>","<span class='userdanger'>You clutch your chest in pain!</span>")
/obj/item/organ/proc/remove(var/mob/living/user,special = 0)
if(!istype(owner))
return
@@ -1,5 +1,3 @@
#define PROCESS_ACCURACY 10
/obj/item/organ/internal
origin_tech = "biotech=3"
force = 1
@@ -137,156 +135,6 @@
// Brain is defined in brain_item.dm.
/obj/item/organ/internal/heart
name = "heart"
icon_state = "heart-on"
organ_tag = "heart"
parent_organ = "chest"
slot = "heart"
origin_tech = "biotech=5"
var/beating = 1
dead_icon = "heart-off"
var/icon_base = "heart"
/obj/item/organ/internal/heart/update_icon()
if(beating)
icon_state = "[icon_base]-on"
else
icon_state = "[icon_base]-off"
/obj/item/organ/internal/heart/remove(mob/living/carbon/M, special = 0)
. = ..()
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(H.stat == DEAD)
Stop()
return
spawn(120)
if(!owner)
Stop()
/obj/item/organ/internal/heart/attack_self(mob/user)
..()
if(!beating)
Restart()
spawn(80)
if(!owner)
Stop()
/obj/item/organ/internal/heart/safe_replace(mob/living/carbon/human/target)
Restart()
..()
/obj/item/organ/internal/heart/proc/Stop()
beating = 0
update_icon()
return 1
/obj/item/organ/internal/heart/proc/Restart()
beating = 1
update_icon()
return 1
/obj/item/organ/internal/heart/prepare_eat()
var/obj/S = ..()
S.icon_state = dead_icon
return S
/obj/item/organ/internal/heart/cursed
name = "cursed heart"
desc = "it needs to be pumped..."
icon_state = "cursedheart-off"
icon_base = "cursedheart"
origin_tech = "biotech=6"
actions_types = list(/datum/action/item_action/organ_action/cursed_heart)
var/last_pump = 0
var/pump_delay = 30 //you can pump 1 second early, for lag, but no more (otherwise you could spam heal)
var/blood_loss = 100 //600 blood is human default, so 5 failures (below 122 blood is where humans die because reasons?)
//How much to heal per pump, negative numbers would HURT the player
var/heal_brute = 0
var/heal_burn = 0
var/heal_oxy = 0
/obj/item/organ/internal/heart/cursed/attack(mob/living/carbon/human/H, mob/living/carbon/human/user, obj/target)
if(H == user && istype(H))
if(NO_BLOOD in H.species.species_traits)
to_chat(H, "<span class = 'userdanger'>\The [src] is not compatible with your form!</span>")
return
playsound(user,'sound/effects/singlebeat.ogg', 40, 1)
user.drop_item()
insert(user)
else
return ..()
/obj/item/organ/internal/heart/cursed/on_life()
if(world.time > (last_pump + pump_delay))
if(ishuman(owner) && owner.client) //While this entire item exists to make people suffer, they can't control disconnects.
var/mob/living/carbon/human/H = owner
if(!(NO_BLOOD in H.species.species_traits))
H.blood_volume = max(H.blood_volume - blood_loss, 0)
to_chat(H, "<span class='userdanger'>You have to keep pumping your blood!</span>")
if(H.client)
H.client.color = "red" //bloody screen so real
else
last_pump = world.time //lets be extra fair *sigh*
/obj/item/organ/internal/heart/cursed/insert(mob/living/carbon/M, special = 0)
..()
if(owner)
to_chat(owner, "<span class='userdanger'>Your heart has been replaced with a cursed one, you have to pump this one manually otherwise you'll die!</span>")
/datum/action/item_action/organ_action/cursed_heart
name = "pump your blood"
//You are now brea- pumping blood manually
/datum/action/item_action/organ_action/cursed_heart/Trigger()
. = ..()
if(. && istype(target,/obj/item/organ/internal/heart/cursed))
var/obj/item/organ/internal/heart/cursed/cursed_heart = target
if(world.time < (cursed_heart.last_pump + (cursed_heart.pump_delay-10))) //no spam
to_chat(owner, "<span class='userdanger'>Too soon!</span>")
return
cursed_heart.last_pump = world.time
playsound(owner,'sound/effects/singlebeat.ogg',40,1)
to_chat(owner, "<span class = 'notice'>Your heart beats.</span>")
var/mob/living/carbon/human/H = owner
if(istype(H))
if(!(NO_BLOOD in H.species.species_traits))
H.blood_volume = min(H.blood_volume + cursed_heart.blood_loss*0.5, BLOOD_VOLUME_NORMAL)
if(owner.client)
owner.client.color = ""
H.adjustBruteLoss(-cursed_heart.heal_brute)
H.adjustFireLoss(-cursed_heart.heal_burn)
H.adjustOxyLoss(-cursed_heart.heal_oxy)
/obj/item/organ/internal/kidneys
name = "kidneys"
icon_state = "kidneys"
gender = PLURAL
organ_tag = "kidneys"
parent_organ = "groin"
slot = "kidneys"
/obj/item/organ/internal/kidneys/on_life()
// Coffee is really bad for you with busted kidneys.
// This should probably be expanded in some way, but fucked if I know
// what else kidneys can process in our reagent list.
var/datum/reagent/coffee = locate(/datum/reagent/consumable/drink/coffee) in owner.reagents.reagent_list
if(coffee)
if(is_bruised())
owner.adjustToxLoss(0.1 * PROCESS_ACCURACY)
else if(is_broken())
owner.adjustToxLoss(0.3 * PROCESS_ACCURACY)
/obj/item/organ/internal/eyes
name = "eyeballs"
icon_state = "eyes"
@@ -377,58 +225,6 @@
if(owner)
owner.update_client_colour(0) //Since mechanical eyes give dark_view of 2 and full colour vision atm, just having this here is fine.
/obj/item/organ/internal/liver
name = "liver"
icon_state = "liver"
organ_tag = "liver"
parent_organ = "groin"
slot = "liver"
var/alcohol_intensity = 1
/obj/item/organ/internal/liver/on_life()
if(germ_level > INFECTION_LEVEL_ONE)
if(prob(1))
to_chat(owner, "<span class='warning'> Your skin itches.</span>")
if(germ_level > INFECTION_LEVEL_TWO)
if(prob(1))
spawn owner.vomit()
if(owner.life_tick % PROCESS_ACCURACY == 0)
//High toxins levels are dangerous
if(owner.getToxLoss() >= 60 && !owner.reagents.has_reagent("charcoal"))
//Healthy liver suffers on its own
if(damage < min_broken_damage)
receive_damage(0.2 * PROCESS_ACCURACY)
//Damaged one shares the fun
else
var/obj/item/organ/internal/O = pick(owner.internal_organs)
if(O)
O.receive_damage(0.2 * PROCESS_ACCURACY)
//Detox can heal small amounts of damage
if(damage && damage < min_bruised_damage && owner.reagents.has_reagent("charcoal"))
receive_damage(-0.2 * PROCESS_ACCURACY)
// Get the effectiveness of the liver.
var/filter_effect = 3
if(is_bruised())
filter_effect -= 1
if(is_broken())
filter_effect -= 2
// Damaged liver means some chemicals are very dangerous
if(damage >= min_bruised_damage)
for(var/datum/reagent/R in owner.reagents.reagent_list)
// Ethanol and all drinks are bad
if(istype(R, /datum/reagent/consumable/ethanol))
owner.adjustToxLoss(0.1 * PROCESS_ACCURACY)
// Can't cope with toxins at all
for(var/toxin in list("toxin", "plasma", "sacid", "facid", "cyanide", "amanitin", "carpotoxin"))
if(owner.reagents.has_reagent(toxin))
owner.adjustToxLoss(0.3 * PROCESS_ACCURACY)
/obj/item/organ/internal/appendix
name = "appendix"
icon_state = "appendix"