Life improvements: Part 1 (#13912)

This commit is contained in:
mikomyazaki
2022-05-18 14:22:43 +02:00
committed by GitHub
parent c854cd149c
commit dae76e0558
34 changed files with 109 additions and 115 deletions
@@ -398,7 +398,7 @@
apply_effect(5, WEAKEN)
forceMove(GetAbove(z_eye)) //We use GetAbove so people can't cheese it by turning their sprite.
return
if(randn <= 25)
if(H.gloves && istype(H.gloves,/obj/item/clothing/gloves/force))
apply_effect(6, WEAKEN)
@@ -566,7 +566,7 @@
if(!target_zone)
return 0
var/obj/item/organ/external/organ = get_organ(check_zone(target_zone))
if(!organ || organ.is_dislocated() || organ.dislocated == -1)
if(!organ || ORGAN_IS_DISLOCATED(organ) || organ.dislocated == -1)
return 0
user.visible_message("<span class='warning'>[user] begins to dislocate [src]'s [organ.joint]!</span>")
@@ -435,7 +435,7 @@ This function restores all organs.
if(!damage)
return FALSE
if(damage > 15 && prob(damage*4) && organ.can_feel_pain())
if(damage > 15 && prob(damage*4) && ORGAN_CAN_FEEL_PAIN(organ))
if(REAGENT_VOLUME(reagents, /decl/reagent/adrenaline) < 15)
make_adrenaline(round(damage/10))
@@ -17,9 +17,9 @@
if(health_deficiency >= 40)
tally += (health_deficiency / 25)
if(can_feel_pain())
if(get_shock() >= 10)
tally += (get_shock() / 30) //pain shouldn't slow you down if you can't even feel it
var/shock = get_shock()
if(shock >= 10)
tally += (shock / 30) //get_shock checks if we can feel pain
tally += ClothesSlowdown()
@@ -127,7 +127,7 @@
if(!E || !(E.limb_flags & ORGAN_CAN_GRASP) || (E.status & ORGAN_SPLINTED))
continue
if(E.is_broken() || E.is_dislocated())
if(E.is_broken() || ORGAN_IS_DISLOCATED(E))
switch(E.body_part)
if(HAND_LEFT, ARM_LEFT)
if(!l_hand)
@@ -65,7 +65,7 @@ INITIALIZE_IMMEDIATE(/mob/living/carbon/human/dummy/mannequin)
// Equip mask to allow the drone to breathe
equip_to_slot_or_del(new /obj/item/clothing/mask/breath/vaurca/filter(src), slot_wear_mask)
// Set internals
var/obj/item/organ/vaurca/preserve/P = internal_organs_by_name[BP_PHORON_RESERVE]
var/obj/item/organ/internal/vaurca/preserve/P = internal_organs_by_name[BP_PHORON_RESERVE]
internal = P
// Set colour, default is grey, no biggie
var/list/hive = splittext(name, " ")
+7 -7
View File
@@ -277,7 +277,7 @@
adjustCloneLoss(5 * RADIATION_SPEED_COEFFICIENT)
emote("gasp")
hallucination = max(hallucination, 20) //At this level, you're in a constant state of low-level hallucinations. As if you didn't have enough problems.
if(damage)
adjustToxLoss(damage * RADIATION_SPEED_COEFFICIENT)
@@ -921,8 +921,7 @@
var/no_damage = 1
var/trauma_val = 0 // Used in calculating softcrit/hardcrit indicators.
if(can_feel_pain())
trauma_val = max(shock_stage,get_shock())/(species.total_health-100)
trauma_val = max(shock_stage,get_shock())/(species.total_health-100)
// Collect and apply the images all at once to avoid appearance churn.
var/list/health_images = list()
for(var/obj/item/organ/external/E in organs)
@@ -1392,7 +1391,8 @@
if (!exhaust_threshold) // Also quit if there's no exhaust threshold specified, because division by 0 is amazing.
return
if (failed_last_breath || (getOxyLoss() + get_shock()) > exhaust_threshold)//Can't catch our breath if we're suffocating
var/shock = get_shock() // used again later for stamina regeneration
if (failed_last_breath || (getOxyLoss() + shock) > exhaust_threshold)//Can't catch our breath if we're suffocating
flash_pain(getOxyLoss()/2)
return
@@ -1409,7 +1409,7 @@
if (stamina != max_stamina)
//Any suffocation damage slows stamina regen.
//This includes oxyloss from low blood levels
var/regen = stamina_recovery * (1 - min(((getOxyLoss()) / exhaust_threshold) + ((get_shock()) / exhaust_threshold), 1))
var/regen = stamina_recovery * (1 - min(((getOxyLoss()) / exhaust_threshold) + (shock / exhaust_threshold), 1))
if(is_drowsy())
regen *= 0.85
if (regen > 0)
@@ -1463,11 +1463,11 @@
bodytemperature = min(bodytemperature + fever, normal_temp)
else if(bodytemperature <= normal_temp + 10) //If we're hotter than max due to like, being on fire, don't keep increasing.
bodytemperature = normal_temp + min(fever, 10) //We use normal_temp here to maintain a steady temperature, otherwise even a small infection steadily increases bodytemp to max. This way it's easier to diagnose the intensity of an infection based on how bad the fever is.
//Apply side effects for having a fever. Separate from body temp changes.
//Apply side effects for having a fever. Separate from body temp changes.
if(fever >= 2)
do_fever_effects(fever)
//Getting the total germ level for all infected organs, affects fever
/mob/living/carbon/human/proc/get_infection_germ_level()
var/germs
@@ -612,17 +612,18 @@
H.adjustHalLoss(remainder*0.25)
H.adjustOxyLoss(remainder * 0.2) //Keeping oxyloss small when out of stamina to prevent old issue where running until exhausted sometimes gave you brain damage.
var/shock = H.get_shock()
if(!pre_move)
H.adjustHalLoss(remainder*0.3)
H.updatehealth()
if((H.get_shock() >= 10) && prob(H.get_shock() *2))
H.flash_pain(H.get_shock())
if((shock >= 10) && prob(shock *2))
H.flash_pain(shock)
if((H.get_shock() + H.getOxyLoss()*2) >= (exhaust_threshold * 0.8))
if((shock + H.getOxyLoss()*2) >= (exhaust_threshold * 0.8))
H.m_intent = M_WALK
H.hud_used.move_intent.update_move_icon(H)
to_chat(H, SPAN_DANGER("You're too exhausted to run anymore!"))
H.flash_pain(H.get_shock())
H.flash_pain(shock)
return 0
if(!pre_move)
@@ -805,7 +806,7 @@
spark(H, 5)
else if (E.is_broken() || !E.is_usable())
stance_damage += 1
else if (E.is_dislocated())
else if (ORGAN_IS_DISLOCATED(E))
stance_damage += 0.5
// Canes and crutches help you stand (if the latter is ever added)
@@ -75,7 +75,7 @@
var/maxdam = 0
var/obj/item/organ/external/damaged_organ = null
for(var/obj/item/organ/external/E in H.organs)
if(!E.can_feel_pain())
if(!ORGAN_CAN_FEEL_PAIN(E))
continue
var/dam = E.get_damage()
// make the choice of the organ depend on damage,
@@ -97,11 +97,11 @@
stamina_recovery = 2 //slow recovery
has_organ = list(
BP_NEURAL_SOCKET = /obj/item/organ/vaurca/neuralsocket,
BP_NEURAL_SOCKET = /obj/item/organ/internal/vaurca/neuralsocket,
BP_LUNGS = /obj/item/organ/internal/lungs/vaurca,
BP_FILTRATION_BIT = /obj/item/organ/vaurca/filtrationbit,
BP_FILTRATION_BIT = /obj/item/organ/internal/vaurca/filtrationbit,
BP_HEART = /obj/item/organ/internal/heart/vaurca,
BP_PHORON_RESERVE = /obj/item/organ/vaurca/preserve,
BP_PHORON_RESERVE = /obj/item/organ/internal/vaurca/preserve,
BP_LIVER = /obj/item/organ/internal/liver/vaurca,
BP_KIDNEYS = /obj/item/organ/internal/kidneys/vaurca,
BP_STOMACH = /obj/item/organ/internal/stomach/vaurca,
@@ -156,11 +156,11 @@
/datum/species/bug/has_psi_potential()
return FALSE
/datum/species/bug/is_naturally_insulated()
return TRUE
/datum/species/bug/can_hold_s_store(obj/item/I)
if(I.w_class <= ITEMSIZE_SMALL)
return TRUE
return FALSE
return FALSE
@@ -169,16 +169,16 @@
)
has_organ = list(
BP_NEURAL_SOCKET = /obj/item/organ/vaurca/neuralsocket,
BP_NEURAL_SOCKET = /obj/item/organ/internal/vaurca/neuralsocket,
BP_LUNGS = /obj/item/organ/internal/lungs/vaurca,
BP_HEART = /obj/item/organ/internal/heart/vaurca,
BP_PHORON_RESERVOIR = /obj/item/organ/vaurca/reservoir,
BP_PHORON_RESERVOIR = /obj/item/organ/internal/vaurca/reservoir,
BP_VAURCA_LIVER = /obj/item/organ/internal/liver/vaurca/robo,
BP_VAURCA_KIDNEYS = /obj/item/organ/internal/kidneys/vaurca/robo,
BP_STOMACH = /obj/item/organ/internal/stomach,
BP_BRAIN = /obj/item/organ/internal/brain/vaurca,
BP_EYES = /obj/item/organ/internal/eyes/night/vaurca,
BP_FILTRATION_BIT = /obj/item/organ/vaurca/filtrationbit
BP_FILTRATION_BIT = /obj/item/organ/internal/vaurca/filtrationbit
)
default_h_style = "Bald"
+1 -1
View File
@@ -121,7 +121,7 @@
if(violent_removal)
var/obj/item/organ/external/E = H.get_organ(pick(BP_L_ARM,BP_R_ARM))
var/dislocate_message = ""
if(E && !E.is_dislocated())
if(E && !ORGAN_IS_DISLOCATED(E))
E.dislocate(1)
dislocate_message = ", but dislocate your [E] in the process"
visible_message(
+1 -4
View File
@@ -211,10 +211,7 @@ default behaviour is:
health = maxHealth
stat = CONSCIOUS
else
health = maxHealth - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss() - getCloneLoss() - getHalLoss()
//Removed Halloss from here. Halloss isn't supposed to count towards death
health = maxHealth - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss() - getCloneLoss()
//This proc is used for mobs which are affected by pressure to calculate the amount of pressure that actually
//affects them once clothing is factored in. ~Errorage