Merge pull request #7870 from Fox-McCloud/tweaks/fixes/organ/stuff

Various little fixes/refactors
This commit is contained in:
Crazy Lemon
2017-08-01 21:41:13 -07:00
committed by GitHub
11 changed files with 97 additions and 126 deletions
@@ -940,57 +940,6 @@
if(hud_used)
hud_used.lingchemdisplay.invisibility = 101
/mob/living/carbon/human/handle_shock()
..()
if(status_flags & GODMODE)
return 0 //godmode
if(NO_PAIN in species.species_traits)
return
if(health <= config.health_threshold_softcrit)// health 0 makes you immediately collapse
shock_stage = max(shock_stage, 61)
if(traumatic_shock >= 100)
shock_stage += 1
else
shock_stage = min(shock_stage, 160)
shock_stage = max(shock_stage-1, 0)
return
if(shock_stage == 10)
to_chat(src, "<font color='red'><b>"+pick("It hurts so much!", "You really need some painkillers..", "Dear god, the pain!"))
if(shock_stage >= 30)
if(shock_stage == 30) custom_emote(1,"is having trouble keeping their eyes open.")
EyeBlurry(2)
Stuttering(5)
if(shock_stage == 40)
to_chat(src, "<font color='red'><b>"+pick("The pain is excrutiating!", "Please, just end the pain!", "Your whole body is going numb!"))
if(shock_stage >=60)
if(shock_stage == 60) custom_emote(1,"falls limp.")
if(prob(2))
to_chat(src, "<font color='red'><b>"+pick("The pain is excrutiating!", "Please, just end the pain!", "Your whole body is going numb!"))
Weaken(20)
if(shock_stage >= 80)
if(prob(5))
to_chat(src, "<font color='red'><b>"+pick("The pain is excrutiating!", "Please, just end the pain!", "Your whole body is going numb!"))
Weaken(20)
if(shock_stage >= 120)
if(prob(2))
to_chat(src, "<font color='red'><b>"+pick("You black out!", "You feel like you could die any moment now.", "You're about to lose consciousness."))
Paralyse(5)
if(shock_stage == 150)
custom_emote(1,"can no longer stand, collapsing!")
Weaken(20)
if(shock_stage >= 150)
Weaken(20)
/mob/living/carbon/human/proc/handle_pulse()
@@ -0,0 +1,75 @@
/mob/living/carbon/human/var/traumatic_shock = 0
/mob/living/carbon/human/var/shock_stage = 0
// proc to find out in how much pain the mob is at the moment
/mob/living/carbon/human/proc/updateshock()
traumatic_shock = getOxyLoss() + getToxLoss() + getFireLoss() + getBruteLoss() + getCloneLoss()
// broken or ripped off organs will add quite a bit of pain
for(var/thing in bodyparts)
var/obj/item/organ/external/BP = thing
if(BP.status & ORGAN_BROKEN && !(BP.status & ORGAN_SPLINTED) || BP.open)
traumatic_shock += 15
if(reagents)
for(var/datum/reagent/R in reagents.reagent_list)
if(R.shock_reduction)
traumatic_shock = max(0, traumatic_shock - R.shock_reduction) // now you too can varedit cyanide to reduce shock by 1000 - Iamgoofball
if(drunk)
traumatic_shock = max(0, traumatic_shock - 10)
return traumatic_shock
/mob/living/carbon/human/proc/handle_shock()
if(status_flags & GODMODE) //godmode
return
if(NO_PAIN in species.species_traits)
return
updateshock()
if(health <= config.health_threshold_softcrit)// health 0 makes you immediately collapse
shock_stage = max(shock_stage, 61)
if(traumatic_shock >= 100)
shock_stage += 1
else
shock_stage = min(shock_stage, 160)
shock_stage = max(shock_stage-1, 0)
return
if(shock_stage == 10)
to_chat(src, "<font color='red'><b>"+pick("It hurts so much!", "You really need some painkillers..", "Dear god, the pain!"))
if(shock_stage >= 30)
if(shock_stage == 30)
custom_emote(1,"is having trouble keeping their eyes open.")
EyeBlurry(2)
Stuttering(5)
if(shock_stage == 40)
to_chat(src, "<font color='red'><b>"+pick("The pain is excrutiating!", "Please, just end the pain!", "Your whole body is going numb!"))
if(shock_stage >=60)
if(shock_stage == 60)
custom_emote(1,"falls limp.")
if(prob(2))
to_chat(src, "<font color='red'><b>"+pick("The pain is excrutiating!", "Please, just end the pain!", "Your whole body is going numb!"))
Weaken(20)
if(shock_stage >= 80)
if(prob(5))
to_chat(src, "<font color='red'><b>"+pick("The pain is excrutiating!", "Please, just end the pain!", "Your whole body is going numb!"))
Weaken(20)
if(shock_stage >= 120)
if(prob(2))
to_chat(src, "<font color='red'><b>"+pick("You black out!", "You feel like you could die any moment now.", "You're about to lose consciousness."))
Paralyse(5)
if(shock_stage == 150)
custom_emote(1,"can no longer stand, collapsing!")
Weaken(20)
if(shock_stage >= 150)
Weaken(20)
@@ -866,7 +866,6 @@
var/turf/T = H.loc
light_amount = min(T.get_lumcount() * 10, 5) //hardcapped so it's not abused by having a ton of flashlights
H.nutrition = min(H.nutrition+light_amount, NUTRITION_LEVEL_WELL_FED+10)
H.traumatic_shock -= light_amount
if(light_amount > 0)
H.clear_alert("nolight")
@@ -879,7 +878,6 @@
H.adjustFireLoss(-(light_amount/4))
if(H.nutrition < NUTRITION_LEVEL_STARVING+50)
H.take_overall_damage(10,0)
H.traumatic_shock++
/datum/species/machine
name = "Machine"
-38
View File
@@ -1,38 +0,0 @@
/mob/living/var/traumatic_shock = 0
/mob/living/carbon/var/shock_stage = 0
// proc to find out in how much pain the mob is at the moment
/mob/living/carbon/proc/updateshock()
src.traumatic_shock = \
1 * src.getOxyLoss() + \
1 * src.getToxLoss() + \
1 * src.getFireLoss() + \
1 * src.getBruteLoss() + \
1 * src.getCloneLoss()
if(reagents)
for(var/datum/reagent/R in reagents.reagent_list)
if(R.shock_reduction)
src.traumatic_shock -= R.shock_reduction // now you too can varedit cyanide to reduce shock by 1000 - Iamgoofball
if(src.slurring)
src.traumatic_shock -= 10
// broken or ripped off organs will add quite a bit of pain
if(istype(src,/mob/living/carbon/human))
var/mob/living/carbon/human/M = src
for(var/obj/item/organ/external/organ in M.bodyparts)
if(!organ)
continue
else if(organ.status & ORGAN_BROKEN || organ.open)
src.traumatic_shock += 15
if(organ.status & ORGAN_SPLINTED)
src.traumatic_shock -= 15
if(src.traumatic_shock < 0)
src.traumatic_shock = 0
return src.traumatic_shock
/mob/living/carbon/proc/handle_shock()
updateshock()
@@ -6,8 +6,8 @@
status = ORGAN_ROBOT
var/implant_color = "#FFFFFF"
var/implant_overlay
tough = 1 //not easyly broken by combat damage
sterile = 1 //not very germy
tough = TRUE // Immune to damage
sterile = TRUE // Doesn't accumulate germs
robotic = 2 // these are cybernetic after all
/obj/item/organ/internal/cyberimp/New(var/mob/M = null)
+3 -3
View File
@@ -29,8 +29,8 @@ var/list/organ_cache = list()
var/freezer_update_period = 100
var/is_in_freezer = 0
var/sterile = 0 //can the organ be infected by germs?
var/tough = 0 //can organ be easily damaged?
var/sterile = FALSE //can the organ be infected by germs?
var/tough = TRUE //can organ be easily damaged?
/obj/item/organ/Destroy()
@@ -95,7 +95,7 @@ var/list/organ_cache = list()
return
//Process infections
if((status & ORGAN_ROBOT) || sterile ||(owner && (IS_PLANT in owner.species.species_traits)))
if((status & ORGAN_ROBOT) || sterile || (owner && (IS_PLANT in owner.species.species_traits)))
germ_level = 0
return
@@ -97,25 +97,24 @@
switch(open)
if(0)
if(istype(W,/obj/item/weapon/scalpel))
spread_germs_to_organ(src,user, W)
spread_germs_to_organ(src, user, W)
user.visible_message("<span class='danger'><b>[user]</b> cuts [src] open with [W]!</span>")
open++
return
if(1)
if(istype(W,/obj/item/weapon/retractor))
spread_germs_to_organ(src,user, W)
spread_germs_to_organ(src, user, W)
user.visible_message("<span class='danger'><b>[user]</b> cracks [src] open like an egg with [W]!</span>")
open++
return
if(2)
if(istype(W,/obj/item/weapon/hemostat))
spread_germs_to_organ(src,user, W)
spread_germs_to_organ(src, user, W)
if(contents.len)
var/obj/item/removing = pick(contents)
var/obj/item/organ/internal/O = removing
if(istype(O))
if(!O.sterile)
spread_germs_to_organ(O,user, W) // This wouldn't be any cleaner than the actual surgery
spread_germs_to_organ(O, user, W) // This wouldn't be any cleaner than the actual surgery
user.put_in_hands(removing)
user.visible_message("<span class='danger'><b>[user]</b> extracts [removing] from [src] with [W]!</span>")
else
@@ -192,9 +191,8 @@
// Damage an internal organ
if(internal_organs && internal_organs.len)
var/obj/item/organ/internal/I = pick(internal_organs)
if(!I.tough)//mostly for cybernetic organs
I.take_damage(brute / 2)
brute -= brute / 2
I.take_damage(brute * 0.5)
brute -= brute * 0.5
if(status & ORGAN_BROKEN && prob(40) && brute)
owner.emote("scream") //getting hit on broken hand hurts
@@ -591,7 +589,7 @@ Note that amputating the affected organ does in fact remove the infection from t
burn_mod = 0.66
dismember_at_max_damage = TRUE
else
tough = 1
tough = TRUE
// Robot parts also lack bones
// This is so surgery isn't kaput, let's see how this does
encased = null
+2 -12
View File
@@ -2,28 +2,18 @@
origin_tech = "biotech=5"
icon_state = "xgibmid2"
var/list/alien_powers = list()
tough = 1
sterile = 1
///obj/item/organ/internal/xenos/New()
// for(var/A in alien_powers)
// if(ispath(A))
// alien_powers -= A
// alien_powers += new A(src)
// ..()
tough = TRUE
sterile = TRUE
///can be changed if xenos get an update..
/obj/item/organ/internal/xenos/insert(mob/living/carbon/M, special = 0)
..()
for(var/P in alien_powers)
M.verbs |= P
//M.verbs |= alien_powers.Copy()
/obj/item/organ/internal/xenos/remove(mob/living/carbon/M, special = 0)
for(var/P in alien_powers)
M.verbs -= P
//M.verbs -= alien_powers.Copy()
. = ..()
/obj/item/organ/internal/xenos/prepare_eat()
+6 -7
View File
@@ -181,7 +181,7 @@
return null
/proc/spread_germs_to_organ(obj/item/organ/E, mob/living/carbon/human/user, obj/item/tool)
if(!istype(user) || !istype(E))
if(!istype(user) || !istype(E) || !(E.status & ORGAN_ROBOT) || E.sterile)
return
var/germ_level = user.germ_level
@@ -189,12 +189,11 @@
//germ spread from surgeon touching the patient
if(user.gloves)
germ_level = user.gloves.germ_level
if(!(E.status & ORGAN_ROBOT)) //Germs on robotic limbs bad
E.germ_level = max(germ_level,E.germ_level) //as funny as scrubbing microbes out with clean gloves is - no.
spread_germs_by_incision(E,tool)//germ spread from environement to patient
E.germ_level += germ_level
spread_germs_by_incision(E, tool) //germ spread from environement to patient
/proc/spread_germs_by_incision(obj/item/organ/external/E,obj/item/tool)
if(!istype(E,/obj/item/organ/external))
if(!istype(E, /obj/item/organ/external))
return
var/germs = 0
@@ -202,7 +201,7 @@
for(var/mob/living/carbon/human/H in view(2, E.loc))//germs from people
if(AStar(E.loc, H.loc, /turf/proc/Distance, 2, simulated_only = 0))
if((!(NO_BREATH in H.mutations) || !(NO_BREATH in H.species.species_traits)) && !H.wear_mask) //wearing a mask helps preventing people from breathing cooties into open incisions
germs+=H.germ_level/4
germs += H.germ_level * 0.25
for(var/obj/effect/decal/cleanable/M in view(2, E.loc))//germs from messes
if(AStar(E.loc, M.loc, /turf/proc/Distance, 2, simulated_only = 0))
@@ -213,7 +212,7 @@
germs += 30
if(E.internal_organs.len)
germs = germs / E.internal_organs.len
germs = germs / (E.internal_organs.len + 1) // +1 for the external limb this eventually applies to; let's not multiply germs now.
for(var/obj/item/organ/internal/O in E.internal_organs)
if(!(O.status & ORGAN_ROBOT))
O.germ_level += germs