Skip to content

Commit

Permalink
Merge pull request #3742 from MistakeNot4892/devupdate
Browse files Browse the repository at this point in the history
Dev update from stable
  • Loading branch information
MistakeNot4892 authored Feb 25, 2024
2 parents eee4bbd + dd0289f commit 432b993
Show file tree
Hide file tree
Showing 20 changed files with 41 additions and 20 deletions.
1 change: 1 addition & 0 deletions code/controllers/subsystems/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ SUBSYSTEM_DEF(atoms)
for(var/I in late_loaders)
var/atom/A = I
A.LateInitialize(arglist(late_loaders[A]))
CHECK_TICK
report_progress("Late initialized [late_loaders.len] atom\s")
late_loaders.Cut()

Expand Down
1 change: 1 addition & 0 deletions code/controllers/subsystems/initialization/fabrication.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ SUBSYSTEM_DEF(fabrication)
LAZYADD(locked_recipes[fab_type], recipe)
else
LAZYADD(initial_recipes[fab_type], recipe)
CHECK_TICK

// Slapcrafting trees.
var/list/all_crafting_handlers = decls_repository.get_decls_of_subtype(/decl/crafting_stage)
Expand Down
1 change: 1 addition & 0 deletions code/controllers/subsystems/supply.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ SUBSYSTEM_DEF(supply)
for(var/decl/hierarchy/supply_pack/spc in sp.get_descendents())
spc.setup()
master_supply_list += spc
CHECK_TICK

// Just add points over time.
/datum/controller/subsystem/supply/fire()
Expand Down
2 changes: 1 addition & 1 deletion code/datums/repositories/atom_info.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var/global/repository/atom_info/atom_info_repository = new()
var/atom/instance
if(!matter_cache[key])
instance = get_instance_of(path, material, amount)
matter_cache[key] = instance.get_contained_matter()
matter_cache[key] = instance.get_contained_matter() || list()
if(!combined_worth_cache[key])
instance = instance || get_instance_of(path, material, amount)
combined_worth_cache[key] = instance.get_combined_monetary_worth()
Expand Down
2 changes: 1 addition & 1 deletion code/modules/aspects/aspects_prosthetic_limbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
if(!species_name)
return /decl/bodytype/prosthetic/basic_human
var/decl/species/species = species_name ? get_species_by_key(species_name) : global.using_map.default_species
return species?.base_prosthetics_model
return species?.base_external_prosthetics_model

/decl/aspect/prosthetic_limb/Initialize()
. = ..()
Expand Down
2 changes: 1 addition & 1 deletion code/modules/aspects/aspects_prosthetic_organs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
if(.)
var/obj/item/organ/internal/I = GET_INTERNAL_ORGAN(holder, apply_to_organ)
if(I)
I.set_bodytype(holder.species.base_prosthetics_model)
I.set_bodytype(holder.species.base_internal_prosthetics_model)

/decl/aspect/prosthetic_organ/eyes
name = "Prosthetic Eyes"
Expand Down
1 change: 1 addition & 0 deletions code/modules/client/asset_cache.dm
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ var/global/template_file_name = "all_templates.json"
for(var/type in subtypesof(/datum/asset) - /datum/asset/simple)
var/datum/asset/A = new type()
A.register()
CHECK_TICK

for(var/client/C in global.clients) // This is also called in client/New, but as we haven't initialized the cache until now, and it's possible the client is already connected, we risk doing it twice.
// Doing this to a client too soon after they've connected can cause issues, also the proc we call sleeps.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
var/decl/species/species = get_species_by_key(order.get_data("species", global.using_map.default_species))
for(var/obj/item/organ/internal/I in .)
I.set_species(species)
I.set_bodytype(species.base_prosthetics_model)
I.set_bodytype(species.base_internal_prosthetics_model)
I.status |= ORGAN_CUT_AWAY

/datum/fabricator_recipe/robotics/organ/heart
Expand Down
5 changes: 5 additions & 0 deletions code/modules/mob/living/living_organs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
/mob/living/proc/has_internal_organs()
return LAZYLEN(get_internal_organs()) > 0

/mob/living/get_contained_matter()
. = ..()
for(var/obj/item/organ in get_organs())
. = MERGE_ASSOCS_WITH_NUM_VALUES(., organ.get_contained_matter())

//Can be called when we want to add an organ in a detached state or an attached state.
/mob/living/proc/add_organ(var/obj/item/organ/O, var/obj/item/organ/external/affected = null, var/in_place = FALSE, var/update_icon = TRUE, var/detached = FALSE, var/skip_health_update = FALSE)
. = O.do_install(src, affected, in_place, update_icon, detached)
Expand Down
4 changes: 4 additions & 0 deletions code/modules/organs/internal/heart.dm
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@
return is_usable() && (pulse > PULSE_NONE || BP_IS_PROSTHETIC(src) || (owner.status_flags & FAKEDEATH))

/obj/item/organ/internal/heart/listen()

if(!owner || (status & (ORGAN_DEAD|ORGAN_CUT_AWAY)))
return "no pulse"

if(BP_IS_PROSTHETIC(src) && is_working())
if(is_bruised())
return "sputtering pump"
Expand Down
3 changes: 2 additions & 1 deletion code/modules/organs/internal/lungs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,8 @@
root_bodytype.get_environment_discomfort(owner,"cold")

/obj/item/organ/internal/lungs/listen()
if(owner.failed_last_breath || !active_breathing)

if((status & (ORGAN_DEAD|ORGAN_CUT_AWAY)) || !owner || owner.failed_last_breath || !active_breathing)
return "no respiration"

if(BP_IS_PROSTHETIC(src))
Expand Down
17 changes: 10 additions & 7 deletions code/modules/reagents/reagent_containers/drinks/bottle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -103,18 +103,20 @@
insert_rag(W, user)
return TRUE
else if(W.isflamesource())
rag.attackby(W, user)
return TRUE
return rag.attackby(W, user)
return ..()

/obj/item/chems/drinks/bottle/attack_self(mob/user)
if(rag)
remove_rag(user)
else
..()
return rag ? remove_rag(user) : ..()

/obj/item/chems/drinks/bottle/proc/insert_rag(obj/item/chems/glass/rag/R, mob/user)
if(!material?.type != /decl/material/solid/glass || rag) return
if(material?.type != /decl/material/solid/glass)
to_chat(user, SPAN_WARNING("\The [src] isn't made of glass, you can't make a good Molotov with it."))
return TRUE

if(rag)
to_chat(user, SPAN_WARNING("\The [src] already has \a [rag] stuffed into it."))
return TRUE

if(user.try_unequip(R))
to_chat(user, SPAN_NOTICE("You stuff [R] into [src]."))
Expand All @@ -133,6 +135,7 @@

atom_flags &= ~ATOM_FLAG_OPEN_CONTAINER
update_icon()
return TRUE

/obj/item/chems/drinks/bottle/proc/remove_rag(mob/user)
if(!rag) return
Expand Down
6 changes: 5 additions & 1 deletion code/modules/species/species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ var/global/const/DEFAULT_SPECIES_HEALTH = 200
var/holder_icon
var/list/available_bodytypes = list()
var/decl/bodytype/default_bodytype
var/base_prosthetics_model = /decl/bodytype/prosthetic/basic_human
var/base_external_prosthetics_model = /decl/bodytype/prosthetic/basic_human
var/base_internal_prosthetics_model

// Lists of accessory types for modpack modification of accessory restrictions.
// These lists are pretty broad and indiscriminate in application, don't use
Expand Down Expand Up @@ -283,6 +284,9 @@ var/global/const/DEFAULT_SPECIES_HEALTH = 200

. = ..()

if(!base_internal_prosthetics_model && base_external_prosthetics_model)
base_internal_prosthetics_model = base_external_prosthetics_model

// Populate blood type table.
for(var/blood_type in blood_types)
var/decl/blood_type/blood_decl = GET_DECL(blood_type)
Expand Down
2 changes: 1 addition & 1 deletion mods/species/ascent/datum/species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
name_plural = "Kharmaan Alates"
show_ssd = "quiescent"

base_prosthetics_model = null
base_external_prosthetics_model = null
available_bodytypes = list(/decl/bodytype/crystalline/mantid/alate)

description = "When human surveyors finally arrived at the outer reaches of explored space, they hoped to find \
Expand Down
2 changes: 1 addition & 1 deletion mods/species/bayliens/adherent/datum/species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/decl/species/adherent
name = SPECIES_ADHERENT
name_plural = "Adherents"
base_prosthetics_model = null
base_external_prosthetics_model = null

description = "The Vigil is a loose collection of floating squid-like machines made of a crystalline composite. \
They once served their creators faithfully, but were left orphaned by a stellar apocalypse."
Expand Down
2 changes: 1 addition & 1 deletion mods/species/bayliens/tajaran/datum/species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/decl/species/tajaran
name = SPECIES_TAJARA
name_plural = "Tajaran"
base_prosthetics_model = null
base_external_prosthetics_model = null

description = "A small mammalian carnivore. If you are reading this, you are probably a Tajaran."
hidden_from_codex = FALSE
Expand Down
2 changes: 1 addition & 1 deletion mods/species/neoavians/datum/species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
description = "Avian species, largely crows, magpies and other corvids, were among the first sophonts uplifted to aid in colonizing Mars. \
These days they are more commonly found pursuing their own careers and goals on the fringes of human space or around their adopted homeworld \
of Hyperion. Neo-avian naming conventions tend to be a chosen name followed by the species of the person, followed by the location they were hatched."
base_prosthetics_model = null
base_external_prosthetics_model = null

snow_slowdown_mod = -1

Expand Down
2 changes: 1 addition & 1 deletion mods/species/utility_frames/species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
name_plural = "Utility Frames"
description = "Simple AI-driven robots are used for many menial or repetitive tasks in human space."
cyborg_noun = null
base_prosthetics_model = null
base_external_prosthetics_model = null
blood_types = list(/decl/blood_type/coolant)

available_bodytypes = list(/decl/bodytype/prosthetic/utility_frame)
Expand Down
2 changes: 1 addition & 1 deletion mods/species/vox/datum/species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/decl/species/vox
name = SPECIES_VOX
name_plural = SPECIES_VOX
base_prosthetics_model = /decl/bodytype/prosthetic/vox/crap
base_external_prosthetics_model = /decl/bodytype/prosthetic/vox/crap

default_emotes = list(
/decl/emote/audible/vox_shriek
Expand Down
2 changes: 1 addition & 1 deletion mods/species/vox/organs_vox.dm
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@

/obj/item/organ/internal/voxstack/Initialize(mapload, material_key, datum/dna/given_dna, decl/bodytype/new_bodytype)
var/decl/species/dna_species = given_dna && get_species_by_key(given_dna.species)
. = ..(mapload, material_key, given_dna, dna_species?.base_prosthetics_model)
. = ..(mapload, material_key, given_dna, dna_species?.base_internal_prosthetics_model)
do_backup()

/obj/item/organ/internal/voxstack/examine(mob/user)
Expand Down

0 comments on commit 432b993

Please sign in to comment.