Fixes singleletter vars in mobs.dm and blood.dm (#90284)

## About The Pull Request

Just found this whilst working on something else downstream, why not fix
it

## Why It's Good For The Game

Something something readable bleeding.

## Changelog
🆑
code: The mobs subsystem and blood.dm file for living mobs no longer use
single letter vars
/🆑
This commit is contained in:
Waterpig
2025-03-28 18:31:09 +01:00
committed by GitHub
parent 6563807b7d
commit 92bf2aa63e
2 changed files with 53 additions and 58 deletions
+4 -4
View File
@@ -35,11 +35,11 @@ SUBSYSTEM_DEF(mobs)
var/times_fired = src.times_fired
var/seconds_per_tick = wait / (1 SECONDS)
while(currentrun.len)
var/mob/living/L = currentrun[currentrun.len]
var/mob/living/processing_mob = currentrun[currentrun.len]
currentrun.len--
if(L)
L.Life(seconds_per_tick, times_fired)
if(processing_mob)
processing_mob.Life(seconds_per_tick, times_fired)
else
GLOB.mob_living_list.Remove(L)
GLOB.mob_living_list.Remove(processing_mob)
if (MC_TICK_CHECK)
return
+49 -54
View File
@@ -193,8 +193,7 @@
rate_of_change = ", but it's clotting up quickly!"
else
// flick through our wounds to see if there are any bleeding ones getting worse or holding flow (maybe move this to handle_blood and cache it so we don't need to cycle through the wounds so much)
for(var/i in all_wounds)
var/datum/wound/iter_wound = i
for(var/datum/wound/iter_wound as anything in all_wounds)
if(!iter_wound.blood_flow)
continue
var/iter_wound_roc = iter_wound.get_bleed_rate_of_change()
@@ -219,17 +218,16 @@
/mob/living/carbon/restore_blood()
blood_volume = BLOOD_VOLUME_NORMAL
for(var/i in bodyparts)
var/obj/item/bodypart/BP = i
BP.setBleedStacks(0)
for(var/obj/item/bodypart/bodypart_to_restore as anything in bodyparts)
bodypart_to_restore.setBleedStacks(0)
/****************************************************
BLOOD TRANSFERS
****************************************************/
//Gets blood from mob to a container or other mob, preserving all data in it.
/mob/living/proc/transfer_blood_to(atom/movable/AM, amount, forced, ignore_incompatibility)
if(!blood_volume || !AM.reagents)
/mob/living/proc/transfer_blood_to(atom/movable/receiver, amount, forced, ignore_incompatibility)
if(!blood_volume || !receiver.reagents)
return FALSE
if(blood_volume < BLOOD_VOLUME_BAD && !forced)
return FALSE
@@ -245,24 +243,23 @@
var/list/blood_data = get_blood_data(blood_id)
if(iscarbon(AM))
var/mob/living/carbon/C = AM
if(blood_id == C.get_blood_id())//both mobs have the same blood substance
if(iscarbon(receiver))
var/mob/living/carbon/carbon_receiver = receiver
if(blood_id == carbon_receiver.get_blood_id()) //both mobs have the same blood substance
if(blood_id == /datum/reagent/blood) //normal blood
if(blood_data["viruses"])
for(var/thing in blood_data["viruses"])
var/datum/disease/D = thing
if((D.spread_flags & DISEASE_SPREAD_SPECIAL) || (D.spread_flags & DISEASE_SPREAD_NON_CONTAGIOUS))
for(var/datum/disease/blood_disease as anything in blood_data["viruses"])
if((blood_disease.spread_flags & DISEASE_SPREAD_SPECIAL) || (blood_disease.spread_flags & DISEASE_SPREAD_NON_CONTAGIOUS))
continue
C.ForceContractDisease(D)
if(!(blood_data["blood_type"] in get_safe_blood(C.dna.blood_type)) && !(ignore_incompatibility))
C.reagents.add_reagent(/datum/reagent/toxin, amount * 0.5)
carbon_receiver.ForceContractDisease(blood_disease)
if(!(blood_data["blood_type"] in get_safe_blood(carbon_receiver.dna.blood_type)) && !(ignore_incompatibility))
carbon_receiver.reagents.add_reagent(/datum/reagent/toxin, amount * 0.5)
return TRUE
C.blood_volume = min(C.blood_volume + round(amount, 0.1), BLOOD_VOLUME_MAX_LETHAL)
carbon_receiver.blood_volume = min(carbon_receiver.blood_volume + round(amount, 0.1), BLOOD_VOLUME_MAX_LETHAL)
return TRUE
AM.reagents.add_reagent(blood_id, amount, blood_data, bodytemperature)
receiver.reagents.add_reagent(blood_id, amount, blood_data, bodytemperature)
return TRUE
@@ -275,16 +272,15 @@
//set the blood data
blood_data["viruses"] = list()
for(var/thing in diseases)
var/datum/disease/D = thing
blood_data["viruses"] += D.Copy()
for(var/datum/disease/disease as anything in diseases)
blood_data["viruses"] += disease.Copy()
blood_data["blood_DNA"] = dna.unique_enzymes
if(LAZYLEN(disease_resistances))
blood_data["resistances"] = disease_resistances.Copy()
var/list/temp_chem = list()
for(var/datum/reagent/R in reagents.reagent_list)
temp_chem[R.type] = R.volume
for(var/datum/reagent/blood_reagent in reagents.reagent_list)
temp_chem[blood_reagent.type] = blood_reagent.volume
blood_data["trace_chem"] = list2params(temp_chem)
if(mind)
blood_data["mind"] = mind
@@ -303,9 +299,8 @@
blood_data["features"] = dna.features
blood_data["factions"] = faction
blood_data["quirks"] = list()
for(var/V in quirks)
var/datum/quirk/T = V
blood_data["quirks"] += T.type
for(var/datum/quirk/quirk as anything in quirks)
blood_data["quirks"] += quirk.type
return blood_data
//get the id of the substance this mob use as blood.
@@ -360,18 +355,18 @@
return donor_blood_data["blood_type"] in get_safe_blood(patient_blood_data["blood_type"])
//to add a splatter of blood or other mob liquid.
/mob/living/proc/add_splatter_floor(turf/T, small_drip)
/mob/living/proc/add_splatter_floor(turf/splatter_turf, small_drip)
if(get_blood_id() != /datum/reagent/blood)
return
if(!T)
T = get_turf(src)
if(isclosedturf(T) || (isgroundlessturf(T) && !GET_TURF_BELOW(T)))
if(!splatter_turf)
splatter_turf = get_turf(src)
if(isclosedturf(splatter_turf) || (isgroundlessturf(splatter_turf) && !GET_TURF_BELOW(splatter_turf)))
return
var/list/temp_blood_DNA
if(small_drip)
// Only a certain number of drips (or one large splatter) can be on a given turf.
var/obj/effect/decal/cleanable/blood/drip/drop = locate() in T
var/obj/effect/decal/cleanable/blood/drip/drop = locate() in splatter_turf
if(drop)
if(drop.drips < 5)
drop.drips++
@@ -382,39 +377,39 @@
temp_blood_DNA = GET_ATOM_BLOOD_DNA(drop) //we transfer the dna from the drip to the splatter
qdel(drop)//the drip is replaced by a bigger splatter
else
drop = new(T, get_static_viruses())
drop = new(splatter_turf, get_static_viruses())
drop.transfer_mob_blood_dna(src)
return
// Find a blood decal or create a new one.
var/obj/effect/decal/cleanable/blood/B = locate() in T
if(!B)
B = new /obj/effect/decal/cleanable/blood/splatter(T, get_static_viruses())
if(QDELETED(B)) //Give it up
var/obj/effect/decal/cleanable/blood/blood_spew = locate() in splatter_turf
if(!blood_spew)
blood_spew = new /obj/effect/decal/cleanable/blood/splatter(splatter_turf, get_static_viruses())
if(QDELETED(blood_spew)) //Give it up
return
B.bloodiness = min((B.bloodiness + BLOOD_AMOUNT_PER_DECAL), BLOOD_POOL_MAX)
B.transfer_mob_blood_dna(src) //give blood info to the blood decal.
blood_spew.bloodiness = min((blood_spew.bloodiness + BLOOD_AMOUNT_PER_DECAL), BLOOD_POOL_MAX)
blood_spew.transfer_mob_blood_dna(src) //give blood info to the blood decal.
if(temp_blood_DNA)
B.add_blood_DNA(temp_blood_DNA)
blood_spew.add_blood_DNA(temp_blood_DNA)
/mob/living/carbon/human/add_splatter_floor(turf/T, small_drip)
/mob/living/carbon/human/add_splatter_floor(turf/splatter_turf, small_drip)
if(!HAS_TRAIT(src, TRAIT_NOBLOOD))
..()
. = ..()
/mob/living/carbon/alien/add_splatter_floor(turf/T, small_drip)
if(!T)
T = get_turf(src)
var/obj/effect/decal/cleanable/xenoblood/B = locate() in T.contents
if(!B)
B = new(T)
B.add_blood_DNA(list("UNKNOWN DNA" = "X*"))
/mob/living/carbon/alien/add_splatter_floor(turf/splatter_turf, small_drip)
if(!splatter_turf)
splatter_turf = get_turf(src)
var/obj/effect/decal/cleanable/xenoblood/xeno_blood_splatter = locate() in splatter_turf.contents
if(!xeno_blood_splatter)
xeno_blood_splatter = new(splatter_turf)
xeno_blood_splatter.add_blood_DNA(list("UNKNOWN DNA" = "X*"))
/mob/living/silicon/robot/add_splatter_floor(turf/T, small_drip)
if(!T)
T = get_turf(src)
var/obj/effect/decal/cleanable/oil/B = locate() in T.contents
if(!B)
B = new(T)
/mob/living/silicon/robot/add_splatter_floor(turf/splatter_turf, small_drip)
if(!splatter_turf)
splatter_turf = get_turf(src)
var/obj/effect/decal/cleanable/oil/oil_splatter = locate() in splatter_turf.contents
if(!oil_splatter)
oil_splatter = new(splatter_turf)
/mob/living/proc/get_blood_alcohol_content()
var/blood_alcohol_content = 0