Skip to content

Commit

Permalink
Merge pull request HearthOfHestia#229 from MarinaGryphon/update/devme…
Browse files Browse the repository at this point in the history
…rge-01-29-2022

January 29, 2022 Devmerge
  • Loading branch information
noelle-lavenza authored Jan 29, 2022
2 parents 6ee9397 + 337ef2e commit de6699d
Show file tree
Hide file tree
Showing 170 changed files with 1,483 additions and 1,138 deletions.
11 changes: 6 additions & 5 deletions code/_helpers/medical_scans.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
scan["time"] = stationtime2text()
var/brain_result
if(H.should_have_organ(BP_BRAIN))
var/obj/item/organ/internal/brain/brain = H.get_internal_organ(BP_BRAIN)
var/obj/item/organ/internal/brain/brain = H.get_organ(BP_BRAIN)
if(!brain || H.stat == DEAD || (H.status_flags & FAKEDEATH))
brain_result = 0
else if(H.stat != DEAD)
Expand All @@ -17,7 +17,7 @@

var/pulse_result
if(H.should_have_organ(BP_HEART))
var/obj/item/organ/internal/heart/heart = H.get_internal_organ(BP_HEART)
var/obj/item/organ/internal/heart/heart = H.get_organ(BP_HEART)
if(!heart)
pulse_result = 0
else if(BP_IS_PROSTHETIC(heart))
Expand Down Expand Up @@ -58,7 +58,7 @@
scan["reagents"] += list(reagent)

scan["external_organs"] = list()
for(var/obj/item/organ/external/E in H.organs)
for(var/obj/item/organ/external/E in H.get_external_organs())
var/list/O = list()
O["name"] = E.name
O["is_stump"] = E.is_stump()
Expand All @@ -73,7 +73,8 @@
scan["external_organs"] += list(O)

scan["internal_organs"] = list()
for(var/obj/item/organ/internal/I in H.internal_organs)
var/list/internal_organs = H.get_internal_organs()
for(var/obj/item/organ/internal/I in internal_organs)
var/list/O = list()
O["name"] = I.name
O["is_broken"] = I.is_broken()
Expand All @@ -86,7 +87,7 @@
scan["missing_organs"] = list()

for(var/organ_name in H.species.has_organ)
if(!locate(H.species.has_organ[organ_name]) in H.internal_organs)
if(!locate(H.species.has_organ[organ_name]) in internal_organs)
scan["missing_organs"] += organ_name
if(H.sdisabilities & BLINDED)
scan["blind"] = TRUE
Expand Down
4 changes: 2 additions & 2 deletions code/datums/ai/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
if(!H.restrained() && H.shock_stage < 40 && prob(3))
var/maxdam = 0
var/obj/item/organ/external/damaged_organ = null
for(var/obj/item/organ/external/E in H.organs)
for(var/obj/item/organ/external/E in H.get_external_organs())
if(!E.can_feel_pain()) continue
var/dam = E.get_damage()
// make the choice of the organ depend on damage,
Expand All @@ -41,7 +41,7 @@
else
H.custom_emote("rubs [G.his] [damaged_organ.name] carefully.")

for(var/obj/item/organ/I in H.internal_organs)
for(var/obj/item/organ/I in H.get_internal_organs())
if((I.status & ORGAN_DEAD) || BP_IS_PROSTHETIC(I)) continue
if(I.damage > 2) if(prob(2))
var/obj/item/organ/external/parent = H.get_organ(I.parent_organ)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/mind/mind.dm
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@
switch(href_list["implant"])
if("remove")
for(var/obj/item/implant/loyalty/I in H.contents)
for(var/obj/item/organ/external/organs in H.organs)
for(var/obj/item/organ/external/organs in H.get_external_organs())
if(I in organs.implants)
qdel(I)
break
Expand Down
4 changes: 2 additions & 2 deletions code/datums/repositories/crew/binary.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
/crew_sensor_modifier/binary/process_crew_data(var/mob/living/carbon/human/H, var/obj/item/clothing/under/C, var/turf/pos, var/list/crew_data)
crew_data["alert"] = FALSE
if(!H.isSynthetic() && H.should_have_organ(BP_HEART))
var/obj/item/organ/internal/heart/O = H.get_internal_organ(BP_HEART)
var/obj/item/organ/internal/heart/O = H.get_organ(BP_HEART)
if (!O || !BP_IS_PROSTHETIC(O)) // Don't make medical freak out over prosthetic hearts
var/pulse = H.pulse()
if(pulse == PULSE_NONE || pulse == PULSE_THREADY)
crew_data["alert"] = TRUE
if(H.get_blood_oxygenation() < BLOOD_VOLUME_SAFE)
crew_data["alert"] = TRUE
if(H.isSynthetic())
var/obj/item/organ/internal/cell/cell = H.get_internal_organ(BP_CELL)
var/obj/item/organ/internal/cell/cell = H.get_organ(BP_CELL)
if(!cell || cell.percent() < 10)
crew_data["alert"] = TRUE
return ..()
Expand Down
4 changes: 2 additions & 2 deletions code/datums/repositories/crew/vital.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
crew_data["pulse"] = "N/A"
crew_data["pulse_span"] = "neutral"
if(!H.isSynthetic() && H.should_have_organ(BP_HEART))
var/obj/item/organ/internal/heart/O = H.get_internal_organ(BP_HEART)
var/obj/item/organ/internal/heart/O = H.get_organ(BP_HEART)
if (!O || !BP_IS_PROSTHETIC(O)) // Don't make medical freak out over prosthetic hearts
crew_data["true_pulse"] = H.pulse()
crew_data["pulse"] = H.get_pulse(GETPULSE_TOOL)
Expand All @@ -24,7 +24,7 @@
crew_data["charge"] = "N/A"
crew_data["charge_span"] = "N/A"
if(H.isSynthetic())
var/obj/item/organ/internal/cell/cell = H.get_internal_organ(BP_CELL)
var/obj/item/organ/internal/cell/cell = H.get_organ(BP_CELL)
if(cell)
crew_data["charge"] = cell.percent()
if(cell.percent() <= 10)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/uplink/uplink_sources.dm
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ var/global/list/default_uplink_source_priority = list(
if(!istype(H))
return SETUP_FAILED

var/obj/item/organ/external/head = H.organs_by_name[BP_HEAD]
var/obj/item/organ/external/head = H.get_organ(BP_HEAD)
if(!head)
return SETUP_FAILED

Expand Down
12 changes: 5 additions & 7 deletions code/game/antagonist/antagonist_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,18 @@
if(player.current.faction != MOB_FACTION_NEUTRAL)
return FALSE

if(!player.assigned_job || is_type_in_list(player.assigned_job, blacklisted_jobs))
return FALSE

if(!ignore_role)
if(player.current && player.current.client)
var/client/C = player.current.client
// Limits antag status to clients above player age, if the age system is being used.
if(C && config.use_age_restriction_for_jobs && isnum(C.player_age) && isnum(min_player_age) && (C.player_age < min_player_age))
return FALSE
if(is_type_in_list(player.assigned_job, restricted_jobs))
return FALSE
for(var/event_tag in blocked_job_event_categories)
if(event_tag in player.assigned_job.event_categories)
if(player.assigned_job)
if(is_type_in_list(player.assigned_job, blacklisted_jobs) || is_type_in_list(player.assigned_job, restricted_jobs))
return FALSE
for(var/event_tag in blocked_job_event_categories)
if(event_tag in player.assigned_job.event_categories)
return FALSE
if(player.current && (player.current.status_flags & NO_ANTAG))
return FALSE
return TRUE
Expand Down
4 changes: 2 additions & 2 deletions code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ its easier to just keep the beam vertical.
blood_color = COLOR_BLOOD_HUMAN
if(istype(M))
if (!istype(M.dna, /datum/dna))
M.dna = new /datum/dna(null)
M.dna = new /datum/dna()
M.dna.real_name = M.real_name
M.check_dna()
blood_color = M.species.get_blood_color(M)
Expand Down Expand Up @@ -521,7 +521,7 @@ its easier to just keep the beam vertical.
M.adjustBruteLoss(damage)
return

var/obj/item/organ/external/affecting = pick(H.organs)
var/obj/item/organ/external/affecting = pick(H.get_external_organs())
if(affecting)
to_chat(M, "<span class='danger'>You land heavily on your [affecting.name]!</span>")
affecting.take_external_damage(damage, 0)
Expand Down
5 changes: 4 additions & 1 deletion code/game/dna/dna2.dm
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ var/global/list/datum/dna/gene/dna_genes[0]
var/species
var/list/body_markings = list()
var/lineage
//#TODO: Keep track of bodytype!!!!!

// Make a copy of this strand.
// USE THIS WHEN COPYING STUFF OR YOU'LL GET CORRUPTION!
Expand Down Expand Up @@ -153,7 +154,7 @@ var/global/list/datum/dna/gene/dna_genes[0]
SetUIValueRange(DNA_UI_BEARD_STYLE, beard_types.Find(character.f_style), length(beard_types), 1)

body_markings.Cut()
for(var/obj/item/organ/external/E in character.organs)
for(var/obj/item/organ/external/E in character.get_external_organs())
if(LAZYLEN(E.markings))
body_markings[E.organ_tag] = E.markings.Copy()

Expand Down Expand Up @@ -358,6 +359,8 @@ var/global/list/datum/dna/gene/dna_genes[0]
if(length(unique_enzymes) != 32)
unique_enzymes = md5(character.real_name)
else
if(!species)
species = global.using_map.default_species
if(length(uni_identity) != 3*DNA_UI_LENGTH)
uni_identity = "00600200A00E0110148FC01300B0095BD7FD3F4"
if(length(struc_enzymes)!= 3*DNA_SE_LENGTH)
Expand Down
4 changes: 2 additions & 2 deletions code/game/dna/dna2_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@

//Body markings
for(var/tag in dna.body_markings)
var/obj/item/organ/external/E = H.organs_by_name[tag]
var/obj/item/organ/external/E = H.get_organ(tag)
if(E)
var/list/marklist = dna.body_markings[tag]
if(length(marklist))
Expand All @@ -166,7 +166,7 @@
LAZYCLEARLIST(E.markings)

//Base skin and blend
for(var/obj/item/organ/external/E in H.organs)
for(var/obj/item/organ/external/E in H.get_external_organs())
E.set_dna(E.dna)

//Hair
Expand Down
3 changes: 2 additions & 1 deletion code/game/gamemodes/changeling/changeling_powers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,8 @@ var/global/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","E
if(ishuman(src))
var/mob/living/carbon/human/H = src
var/newSpecies = chosen_dna.speciesName
H.set_species(newSpecies,1)
H.set_species(newSpecies)
H.apply_species_appearance()
H.b_type = chosen_dna.dna.b_type
H.sync_organ_dna()

Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/cult/runes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@
if(!charges)
return statuses
if(charges >= 15)
for(var/obj/item/organ/external/e in user.organs)
for(var/obj/item/organ/external/e in user.get_external_organs())
if(e && e.status & ORGAN_BROKEN)
e.status &= ~ORGAN_BROKEN
statuses += "bones in your [e.name] snap into place"
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/events.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var/global/hadevent = 0
/proc/appendicitis()
for(var/mob/living/carbon/human/H in shuffle(global.living_mob_list_))
if(H.client && H.stat != DEAD)
var/obj/item/organ/internal/appendix/A = H.get_internal_organ(BP_APPENDIX)
var/obj/item/organ/internal/appendix/A = H.get_organ(BP_APPENDIX)
if(!istype(A) || (A && A.inflamed))
continue
A.inflamed = 1
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/flasher.dm
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
flash_time = round(H.getFlashMod() * flash_time)
if(flash_time <= 0)
return
var/obj/item/organ/internal/eyes/E = H.get_internal_organ(H.species.vision_organ)
var/obj/item/organ/internal/eyes/E = H.get_organ(H.species.vision_organ)
if(!E)
return
if(E.is_bruised() && prob(E.damage + 50))
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/oxygen_pump.dm
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
if(!user)
user = target
// Check target validity
if(!target.organs_by_name[BP_HEAD])
if(!target.get_organ(BP_HEAD))
to_chat(user, "<span class='warning'>\The [target] doesn't have a head.</span>")
return
if(!target.check_has_mouth())
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/rechargestation.dm
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@

if(ishuman(occupant))
var/mob/living/carbon/human/H = occupant
var/obj/item/organ/internal/cell/potato = H.get_internal_organ(BP_CELL)
var/obj/item/organ/internal/cell/potato = H.get_organ(BP_CELL)
if(potato)
target = potato.cell
if((!target || target.percent() > 95) && istype(H.back,/obj/item/rig))
Expand Down Expand Up @@ -202,7 +202,7 @@
if(istype(H.back,/obj/item/rig))
var/obj/item/rig/R = H.back
return R.cell
return H.get_internal_organ(BP_CELL)
return H.get_organ(BP_CELL)
return 0

/obj/machinery/recharge_station/proc/go_out()
Expand Down
8 changes: 4 additions & 4 deletions code/game/machinery/vitals_monitor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
to_chat(user, SPAN_NOTICE("Pulse: [victim.get_pulse(GETPULSE_TOOL)]"))

var/brain_activity = "none"
var/obj/item/organ/internal/brain/brain = victim.get_internal_organ(BP_BRAIN)
var/obj/item/organ/internal/brain/brain = victim.get_organ(BP_BRAIN)
if(istype(brain) && victim.stat != DEAD && !(victim.status_flags & FAKEDEATH))
if(user.skill_check(SKILL_MEDICAL, SKILL_BASIC))
switch(brain.get_current_damage_threshold())
Expand All @@ -44,7 +44,7 @@
to_chat(user, SPAN_NOTICE("Brain activity: [brain_activity]"))

var/breathing = "none"
var/obj/item/organ/internal/lungs/lungs = victim.get_internal_organ(BP_LUNGS)
var/obj/item/organ/internal/lungs/lungs = victim.get_organ(BP_LUNGS)
if(istype(lungs) && !(victim.status_flags & FAKEDEATH))
if(lungs.breath_fail_ratio < 0.3)
breathing = "normal"
Expand Down Expand Up @@ -96,7 +96,7 @@
overlays += image(icon, icon_state = "pulse_thready")
overlays += image(icon, icon_state = "pulse_warning")

var/obj/item/organ/internal/brain/brain = victim.get_internal_organ(BP_BRAIN)
var/obj/item/organ/internal/brain/brain = victim.get_organ(BP_BRAIN)
if(istype(brain) && victim.stat != DEAD && !(victim.status_flags & FAKEDEATH))
switch(brain.get_current_damage_threshold())
if(0 to 2)
Expand All @@ -109,7 +109,7 @@
else
overlays += image(icon, icon_state = "brain_warning")

var/obj/item/organ/internal/lungs/lungs = victim.get_internal_organ(BP_LUNGS)
var/obj/item/organ/internal/lungs/lungs = victim.get_organ(BP_LUNGS)
if(istype(lungs) && !(victim.status_flags & FAKEDEATH))
if(lungs.breath_fail_ratio < 0.3)
overlays += image(icon, icon_state = "breathing_normal")
Expand Down
14 changes: 7 additions & 7 deletions code/game/objects/auras/regenerating_aura.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,17 @@
return 1
if(organ_mult)
if(prob(10) && H.nutrition >= 150 && !H.getBruteLoss() && !H.getFireLoss())
var/obj/item/organ/external/head/D = H.organs_by_name["head"]
var/obj/item/organ/external/head/D = H.get_organ(BP_HEAD)
if (D.status & ORGAN_DISFIGURED)
if (H.nutrition >= 20)
D.status &= ~ORGAN_DISFIGURED
H.adjust_nutrition(-20)
else
low_nut_warning("head")
low_nut_warning(BP_HEAD)

for(var/bpart in shuffle(H.internal_organs_by_name - BP_BRAIN))
var/obj/item/organ/internal/regen_organ = H.get_internal_organ(bpart)
if(BP_IS_PROSTHETIC(regen_organ))
var/list/organs = H.get_internal_organs()
for(var/obj/item/organ/internal/regen_organ in shuffle(organs.Copy()))
if(BP_IS_PROSTHETIC(regen_organ) || regen_organ.organ_tag == BP_BRAIN)
continue
if(istype(regen_organ))
if(regen_organ.damage > 0 && !(regen_organ.status & ORGAN_DEAD))
Expand All @@ -73,10 +73,10 @@

if(prob(grow_chance))
for(var/limb_type in H.species.has_limbs)
var/obj/item/organ/external/E = H.organs_by_name[limb_type]
var/obj/item/organ/external/E = H.get_organ(limb_type)
if(E && E.organ_tag != BP_HEAD && !E.vital && !E.is_usable()) //Skips heads and vital bits...
if (H.nutrition > grow_threshold)
E.removed() //...because no one wants their head to explode to make way for a new one.
H.remove_organ(E) //...because no one wants their head to explode to make way for a new one.
qdel(E)
E= null
else
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/effects/decals/Cleanable/humans.dm
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ var/global/list/image/splatter_cache=list()
if(l_foot)
l_foot.add_coating(chemical, amount, transferred_data)
if(r_foot)
l_foot.add_coating(chemical, amount, transferred_data)
r_foot.add_coating(chemical, amount, transferred_data)
else if (perp.buckled && istype(perp.buckled, /obj/structure/bed/chair/wheelchair))
var/obj/structure/bed/chair/wheelchair/W = perp.buckled
W.bloodiness = 4
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/item.dm
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
//is probabilistic so we can't do that and it would be unfair to just check one.
if(ishuman(M))
var/mob/living/carbon/human/H = M
var/obj/item/organ/external/hand = H.organs_by_name[M.get_empty_hand_slot()]
var/obj/item/organ/external/hand = H.get_organ(M.get_empty_hand_slot())
if(istype(hand) && hand.is_usable())
return TRUE
return FALSE
Expand Down Expand Up @@ -657,7 +657,7 @@ var/global/list/slot_flags_enumeration = list(

if(istype(H))

var/obj/item/organ/internal/eyes/eyes = H.get_internal_organ(BP_EYES)
var/obj/item/organ/internal/eyes/eyes = H.get_organ(BP_EYES)

if(H != user)

Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/items/devices/auto_cpr.dm
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@
if(!skilled_setup && prob(20))
var/obj/item/organ/external/E = H.get_organ(BP_CHEST)
E.add_pain(15)
to_chat(H, "<span class='danger'>Your [E] is compressed painfully!</span>")
to_chat(H, "<span class='danger'>Your [E] is compressed painfully!</span>")
if(prob(5))
E.fracture()
else
var/obj/item/organ/internal/heart/heart = H.get_internal_organ(BP_HEART)
var/obj/item/organ/internal/heart/heart = H.get_organ(BP_HEART)
if(heart)
heart.external_pump = list(world.time, 0.6)

2 changes: 1 addition & 1 deletion code/game/objects/items/devices/flashlight.dm
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
to_chat(user, "<span class='warning'>You can't find anything on [H] to direct [src] into!</span>")
return

vision = H.get_internal_organ(H.species.vision_organ)
vision = H.get_organ(H.species.vision_organ)
if(!vision)
vision = H.species.has_organ[H.species.vision_organ]
var/decl/pronouns/G = H.get_pronouns()
Expand Down
Loading

0 comments on commit de6699d

Please sign in to comment.