Life improvements: Part 1 (#13912)

This commit is contained in:
mikomyazaki
2022-05-18 13:22:43 +01:00
committed by GitHub
parent c854cd149c
commit dae76e0558
34 changed files with 109 additions and 115 deletions
+1 -1
View File
@@ -108,7 +108,7 @@
damage = between(0, src.damage + amount, max_damage)
//only show this if the organ is not robotic
if(owner && can_feel_pain() && parent_organ && (amount > 5 || prob(10)))
if(owner && ORGAN_CAN_FEEL_PAIN(src) && parent_organ && (amount > 5 || prob(10)))
var/obj/item/organ/external/parent = owner.get_organ(parent_organ)
if(parent && !silent)
var/degree = ""
+6 -5
View File
@@ -14,10 +14,11 @@
/obj/item/organ/internal/appendix/process()
..()
if(inflamed && owner && !(status & ORGAN_ROBOT))
if(inflamed && owner && !BP_IS_ROBOTIC(src))
var/can_feel_pain = ORGAN_CAN_FEEL_PAIN(src)
inflamed++
if(prob(5))
if(owner.can_feel_pain())
if(can_feel_pain)
owner.custom_pain("You feel a stinging pain in your abdomen!")
owner.visible_message("<B>\The [owner]</B> winces slightly.")
var/obj/item/organ/external/O = owner.get_organ(parent_organ)
@@ -26,7 +27,7 @@
if(inflamed > 200)
if(prob(3))
take_internal_damage(0.1)
if(owner.can_feel_pain())
if(can_feel_pain)
owner.visible_message("<B>\The [owner]</B> winces painfully.")
var/obj/item/organ/external/O = owner.get_organ(parent_organ)
if(O)
@@ -38,7 +39,7 @@
owner.vomit()
if(inflamed > 600)
if(prob(1))
if(owner.can_feel_pain())
if(can_feel_pain)
owner.custom_pain("You feel a stinging pain in your abdomen!")
owner.Weaken(10)
@@ -47,4 +48,4 @@
E.germ_level = max(INFECTION_LEVEL_TWO, E.germ_level)
owner.adjustToxLoss(25)
removed()
qdel(src)
qdel(src)
-3
View File
@@ -141,9 +141,6 @@
/obj/item/organ/proc/bruise()
damage = max(damage, min_bruised_damage)
/obj/item/organ/proc/can_feel_pain()
return (!BP_IS_ROBOTIC(src) && (!species || !(species.flags & NO_PAIN)))
#define ORGAN_RECOVERY_THRESHOLD (5 MINUTES)
/obj/item/organ/proc/can_recover()
return (max_damage > 0) && !(status & ORGAN_DEAD) || death_time >= world.time - ORGAN_RECOVERY_THRESHOLD
+12 -21
View File
@@ -186,13 +186,6 @@
return
..()
/obj/item/organ/external/proc/is_dislocated()
if(dislocated > 0)
return 1
if(parent)
return parent.is_dislocated()
return 0
/obj/item/organ/external/proc/dislocate(var/primary)
if(dislocated != -1)
if(primary)
@@ -1188,13 +1181,13 @@ Note that amputating the affected organ does in fact remove the infection from t
/obj/item/organ/external/is_usable()
if(is_stump())
return FALSE
if(is_dislocated())
if(ORGAN_IS_DISLOCATED(src))
return FALSE
if(tendon_status() & TENDON_CUT)
return FALSE
if(parent && (parent.tendon_status() & TENDON_CUT))
return FALSE
if(can_feel_pain() && get_pain() > pain_disability_threshold)
if(get_pain() > pain_disability_threshold)
return FALSE
if(brute_ratio > 1)
return FALSE
@@ -1444,20 +1437,18 @@ Note that amputating the affected organ does in fact remove the infection from t
// Pain/halloss
/obj/item/organ/external/proc/get_pain()
if(!can_feel_pain() || BP_IS_ROBOTIC(src))
if(!ORGAN_CAN_FEEL_PAIN(src) || BP_IS_ROBOTIC(src))
return 0
var/lasting_pain = 0
. = pain + 0.7 * brute_dam + 0.8 * burn_dam + 0.5 * get_genetic_damage()
if(is_broken())
lasting_pain += 10
else if(is_dislocated())
lasting_pain += 5
var/tox_dam = 0
for(var/obj/item/organ/internal/I in internal_organs)
tox_dam += I.getToxLoss()
return pain + lasting_pain + 0.7 * brute_dam + 0.8 * burn_dam + 0.3 * tox_dam + 0.5 * get_genetic_damage()
. += 10
else if(ORGAN_IS_DISLOCATED(src))
. += 5
for(var/obj/item/organ/internal/I as anything in internal_organs)
. += 0.3 * I.getToxLoss()
/obj/item/organ/external/proc/remove_pain(var/amount)
if(!can_feel_pain())
if(!ORGAN_CAN_FEEL_PAIN(src))
pain = 0
return
var/last_pain = pain
@@ -1465,7 +1456,7 @@ Note that amputating the affected organ does in fact remove the infection from t
return -(pain-last_pain)
/obj/item/organ/external/proc/add_pain(var/amount)
if(!can_feel_pain())
if(!ORGAN_CAN_FEEL_PAIN(src))
pain = 0
return
var/last_pain = pain
@@ -1492,4 +1483,4 @@ Note that amputating the affected organ does in fact remove the infection from t
to_chat(src, SPAN_DANGER("Your Srom pull is disturbed by a sudden shock!"))
var/mob/living/carbon/human/victim = srom_pulling.resolve()
victim.srom_pulled_by = null
srom_pulling = null
srom_pulling = null
+2 -4
View File
@@ -48,8 +48,6 @@ mob/var/next_pain_time = 0
next_pain_time = world.time + 5 SECONDS
/mob/living/carbon/human/proc/handle_pain()
if(!can_feel_pain())
return
if(stat >= DEAD)
return
if(!can_feel_pain())
@@ -60,7 +58,7 @@ mob/var/next_pain_time = 0
var/maxdam = 0
var/obj/item/organ/external/damaged_organ = null
for(var/obj/item/organ/external/E in organs)
if(E.status & (ORGAN_DEAD|ORGAN_ROBOT))
if(E.status & (ORGAN_DEAD|ORGAN_ROBOT))
continue
var/dam = E.get_damage()
// make the choice of the organ depend on damage,
@@ -111,4 +109,4 @@ mob/var/next_pain_time = 0
if(60 to 100)
custom_pain("Your whole body hurts badly!", getToxLoss())
if(100 to INFINITY)
custom_pain("Your body aches all over, it's driving you mad!", getToxLoss())
custom_pain("Your body aches all over, it's driving you mad!", getToxLoss())
+19 -19
View File
@@ -44,7 +44,7 @@
icon = 'icons/obj/organs/vaurca_organs.dmi'
can_prepare = FALSE
/obj/item/organ/vaurca/reservoir
/obj/item/organ/internal/vaurca/reservoir
icon = 'icons/obj/organs/vaurca_organs.dmi'
name = BP_PHORON_RESERVOIR
organ_tag = BP_PHORON_RESERVOIR
@@ -52,7 +52,7 @@
icon_state = "phoron_reservoir"
robotic = ROBOTIC_ASSISTED
/obj/item/organ/vaurca/filtrationbit
/obj/item/organ/internal/vaurca/filtrationbit
icon = 'icons/obj/organs/vaurca_organs.dmi'
name = BP_FILTRATION_BIT
organ_tag = BP_FILTRATION_BIT
@@ -60,7 +60,7 @@
icon_state = "filter"
robotic = ROBOTIC_MECHANICAL
/obj/item/organ/vaurca/neuralsocket
/obj/item/organ/internal/vaurca/neuralsocket
icon = 'icons/obj/organs/vaurca_organs.dmi'
name = BP_NEURAL_SOCKET
organ_tag = BP_NEURAL_SOCKET
@@ -80,19 +80,19 @@ obj/item/organ/vaurca/neuralsocket/process()
to_chat(owner, "<span class='notice'> Your mind expands, and your thoughts join the unity of the Hivenet.</span>")
..()
/obj/item/organ/vaurca/neuralsocket/replaced(var/mob/living/carbon/human/target)
/obj/item/organ/internal/vaurca/neuralsocket/replaced(var/mob/living/carbon/human/target)
if (!(all_languages[LANGUAGE_VAURCA] in owner.languages))
owner.add_language(LANGUAGE_VAURCA)
to_chat(owner, "<span class='notice'> Your mind expands, and your thoughts join the unity of the Hivenet.</span>")
..()
/obj/item/organ/vaurca/neuralsocket/removed(var/mob/living/carbon/human/target)
/obj/item/organ/internal/vaurca/neuralsocket/removed(var/mob/living/carbon/human/target)
if(all_languages[LANGUAGE_VAURCA] in target.languages)
target.remove_language(LANGUAGE_VAURCA)
to_chat(target, "<span class='warning'>Your mind suddenly grows dark as the unity of the Hive is torn from you.</span>")
..()
/obj/item/organ/vaurca/preserve
/obj/item/organ/internal/vaurca/preserve
icon = 'icons/obj/organs/vaurca_organs.dmi'
name = BP_PHORON_RESERVE
organ_tag = BP_PHORON_RESERVE
@@ -105,7 +105,7 @@ obj/item/organ/vaurca/neuralsocket/process()
var/volume = 50
var/manipulated_by = null
/obj/item/organ/vaurca/preserve/Initialize()
/obj/item/organ/internal/vaurca/preserve/Initialize()
. = ..()
air_contents = new /datum/gas_mixture()
@@ -122,13 +122,13 @@ obj/item/organ/vaurca/neuralsocket/process()
return
/obj/item/organ/vaurca/preserve/Destroy()
/obj/item/organ/internal/vaurca/preserve/Destroy()
if(air_contents)
QDEL_NULL(air_contents)
return ..()
/obj/item/organ/vaurca/preserve/examine(mob/user)
/obj/item/organ/internal/vaurca/preserve/examine(mob/user)
. = ..(user, 0)
if(.)
var/celsius_temperature = air_contents.temperature - T0C
@@ -148,7 +148,7 @@ obj/item/organ/vaurca/neuralsocket/process()
descriptive = "cold"
to_chat(user, "<span class='notice'>\The [src] feels [descriptive].</span>")
/obj/item/organ/vaurca/preserve/attackby(obj/item/W as obj, mob/user as mob)
/obj/item/organ/internal/vaurca/preserve/attackby(obj/item/W as obj, mob/user as mob)
..()
var/obj/icon = src
@@ -173,13 +173,13 @@ obj/item/organ/vaurca/neuralsocket/process()
B.blow(src)
src.add_fingerprint(user)
/obj/item/organ/vaurca/preserve/attack_self(mob/user as mob)
/obj/item/organ/internal/vaurca/preserve/attack_self(mob/user as mob)
if (!(src.air_contents))
return
ui_interact(user)
/obj/item/organ/vaurca/preserve/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
/obj/item/organ/internal/vaurca/preserve/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
var/mob/living/carbon/location = null
var/using_internal
@@ -230,7 +230,7 @@ obj/item/organ/vaurca/neuralsocket/process()
// auto update every Master Controller tick
ui.set_auto_update(1)
/obj/item/organ/vaurca/preserve/Topic(href, href_list)
/obj/item/organ/internal/vaurca/preserve/Topic(href, href_list)
..()
if (usr.stat|| usr.restrained())
return 0
@@ -277,19 +277,19 @@ obj/item/organ/vaurca/neuralsocket/process()
return 1
/obj/item/organ/vaurca/preserve/remove_air(amount)
/obj/item/organ/internal/vaurca/preserve/remove_air(amount)
return air_contents.remove(amount)
/obj/item/organ/vaurca/preserve/return_air()
/obj/item/organ/internal/vaurca/preserve/return_air()
return air_contents
/obj/item/organ/vaurca/preserve/assume_air(datum/gas_mixture/giver)
/obj/item/organ/internal/vaurca/preserve/assume_air(datum/gas_mixture/giver)
air_contents.merge(giver)
check_status()
return 1
/obj/item/organ/vaurca/preserve/proc/remove_air_volume(volume_to_return)
/obj/item/organ/internal/vaurca/preserve/proc/remove_air_volume(volume_to_return)
if(!air_contents)
return null
@@ -301,14 +301,14 @@ obj/item/organ/vaurca/neuralsocket/process()
return remove_air(moles_needed)
/obj/item/organ/vaurca/preserve/process()
/obj/item/organ/internal/vaurca/preserve/process()
//Allow for reactions
air_contents.react() //cooking up air tanks - add phoron and oxygen, then heat above PHORON_MINIMUM_BURN_TEMPERATURE
check_status()
..()
/obj/item/organ/vaurca/preserve/proc/check_status()
/obj/item/organ/internal/vaurca/preserve/proc/check_status()
//Handle exploding, leaking, and rupturing of the tank
if(!air_contents)