Skip to content

Commit

Permalink
Merge pull request #4188 from MistakeNot4892/devupdate
Browse files Browse the repository at this point in the history
Dev update from staging
  • Loading branch information
MistakeNot4892 authored Jul 12, 2024
2 parents 8106884 + 6d402b4 commit a18e840
Show file tree
Hide file tree
Showing 19 changed files with 163 additions and 96 deletions.
1 change: 1 addition & 0 deletions code/__defines/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@

// Prosthetic helpers.
#define BP_IS_PROSTHETIC(org) (!QDELETED(org) && (org.organ_properties & ORGAN_PROP_PROSTHETIC))
#define BP_IS_ROBOTIC(org) (!QDELETED(org) && (org.bodytype?.is_robotic))
#define BP_IS_BRITTLE(org) (!QDELETED(org) && (org.status & ORGAN_BRITTLE))
#define BP_IS_CRYSTAL(org) (!QDELETED(org) && (org.organ_properties & ORGAN_PROP_CRYSTAL))

Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/kitchen/microwave.dm
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@
SSnano.update_uis(src)
var/obj/item/chems/food/badrecipe/ffuu = new(src)
ffuu.add_to_reagents(/decl/material/solid/carbon, amount)
ffuu.add_to_reagents(/decl/material/liquid/bromide, amount/10)
ffuu.add_to_reagents(/decl/material/liquid/acrylamide, amount/10)
return ffuu

/obj/machinery/microwave/OnTopic(href, href_list)
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/requests_console.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ var/global/req_console_information = list()
uncreated_component_parts = null
construct_state = /decl/machine_construction/wall_frame/panel_closed
frame_type = /obj/item/frame/stock_offset/request_console
directional_offset = @'{"NORTH":{"y":-32}, "SOUTH":{"y":32}, "EAST":{"x":32}, "WEST":{"x":-32}}'
directional_offset = @'{"NORTH":{"y":32}, "SOUTH":{"y":-32}, "EAST":{"x":32}, "WEST":{"x":-32}}'

/obj/machinery/network/requests_console/on_update_icon()
if(stat & NOPOWER)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,15 @@
else if (prob(10))
to_chat(H, "<span class='warning'>You feel terribly ill!</span>")

/decl/material/liquid/acrylamide
name = "acrylamide"
uid = "liquid_acrylamide"
lore_text = "A colourless substance formed when food is burned. Rumoured to cause cancer, but mostly just nasty to eat."
taste_description = "bitter char"
color = "#a39894"
toxicity = 2
taste_mult = 2

/decl/material/liquid/bromide
name = "bromide"
codex_name = "elemental bromide"
Expand Down
79 changes: 44 additions & 35 deletions code/modules/mob/living/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -278,51 +278,60 @@
if(!.) // If we're under or inside shelter, use the z-level rain (for ambience)
. = SSweather.weather_by_z[my_turf.z]

/mob/living/proc/handle_environment(var/datum/gas_mixture/environment)

SHOULD_CALL_PARENT(TRUE)

/mob/living/proc/handle_contact_reagent_dripping()
// TODO: process dripping outside of Life() so corpses don't become sponges.
// TODO: factor temperature and vapor into this so warmer locations dry you off.
// TODO: apply a dripping overlay a la fire to show someone is saturated.
if(loc)
var/datum/reagents/touching_reagents = get_contact_reagents()
if(touching_reagents?.total_volume)
var/drip_amount = max(1, round(touching_reagents.total_volume * 0.1))
if(drip_amount)
touching_reagents.trans_to(loc, drip_amount)
if(!loc)
return
var/datum/reagents/touching_reagents = get_contact_reagents()
if(!touching_reagents?.total_volume)
return
var/drip_amount = max(1, round(touching_reagents.total_volume * 0.1))
if(drip_amount)
touching_reagents.trans_to(loc, drip_amount)

/mob/living/proc/handle_weather_effects(obj/abstract/weather_system/weather)
// Handle physical effects of weather.
var/decl/state/weather/weather_state
var/obj/abstract/weather_system/weather = get_affecting_weather()
if(weather)
weather_state = weather.weather_system.current_state
if(istype(weather_state))
weather_state.handle_exposure(src, get_weather_exposure(weather), weather)
if(!istype(weather))
return
var/decl/state/weather/weather_state = weather.weather_system.current_state
if(istype(weather_state))
weather_state.handle_exposure(src, get_weather_exposure(weather), weather)

/mob/living/proc/handle_weather_ambience(obj/abstract/weather_system/weather)
// Refresh weather ambience.
// Show messages and play ambience.
if(client && get_preference_value(/datum/client_preference/play_ambiance) == PREF_YES)

// Work out if we need to change or cancel the current ambience sound.
var/send_sound
var/mob_ref = weakref(src)
if(istype(weather_state))
var/ambient_sounds = !is_outside() ? weather_state.ambient_indoors_sounds : weather_state.ambient_sounds
var/ambient_sound = length(ambient_sounds) && pick(ambient_sounds)
if(global.current_mob_ambience[mob_ref] == ambient_sound)
return
send_sound = ambient_sound
global.current_mob_ambience[mob_ref] = send_sound
else if(mob_ref in global.current_mob_ambience)
global.current_mob_ambience -= mob_ref
else
if(!istype(weather) || !client || get_preference_value(/datum/client_preference/play_ambiance) != PREF_YES)
return

// Work out if we need to change or cancel the current ambience sound.
var/send_sound
var/mob_ref = weakref(src)
var/decl/state/weather/weather_state = weather.weather_system.current_state
if(istype(weather_state))
var/ambient_sounds = !is_outside() ? weather_state.ambient_indoors_sounds : weather_state.ambient_sounds
var/ambient_sound = length(ambient_sounds) && pick(ambient_sounds)
if(global.current_mob_ambience[mob_ref] == ambient_sound)
return
send_sound = ambient_sound
global.current_mob_ambience[mob_ref] = send_sound
else if(mob_ref in global.current_mob_ambience)
global.current_mob_ambience -= mob_ref
else
return

// Push sound to client. Pipe dream TODO: crossfade between the new and old weather ambience.
sound_to(src, sound(null, repeat = 0, wait = 0, volume = 0, channel = sound_channels.weather_channel))
if(send_sound)
sound_to(src, sound(send_sound, repeat = TRUE, wait = 0, volume = 30, channel = sound_channels.weather_channel))

// Push sound to client. Pipe dream TODO: crossfade between the new and old weather ambience.
sound_to(src, sound(null, repeat = 0, wait = 0, volume = 0, channel = sound_channels.weather_channel))
if(send_sound)
sound_to(src, sound(send_sound, repeat = TRUE, wait = 0, volume = 30, channel = sound_channels.weather_channel))
/mob/living/proc/handle_environment(var/datum/gas_mixture/environment)
SHOULD_CALL_PARENT(TRUE)
handle_contact_reagent_dripping() // See comment on proc definition
var/weather = get_affecting_weather()
handle_weather_effects(weather)
handle_weather_ambience(weather)

//This updates the health and status of the mob (conscious, unconscious, dead)
/mob/living/proc/handle_regular_status_updates()
Expand Down
4 changes: 4 additions & 0 deletions code/modules/mob/living/simple_animal/_simple_animal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,10 @@ var/global/list/simplemob_icon_bitflag_cache = list()
/mob/living/simple_animal/can_buckle_mob(var/mob/living/dropping)
. = ..() && can_have_rider && (dropping.mob_size <= max_rider_size)

// Simplemobs have to hang out in the rain so make them immune to weather effects (like hail).
/mob/living/simple_animal/handle_weather_effects()
SHOULD_CALL_PARENT(FALSE)

/mob/living/simple_animal/get_available_postures()
var/static/list/available_postures = list(
/decl/posture/standing,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var/global/list/all_warrants
/datum/nano_module/program/proc/get_warrants(list/accesses, mob/user)
var/datum/computer_network/network = program?.computer?.get_network()
if(network)
return network.get_all_files_of_type(/datum/computer_file/report/warrant, accesses, user)
return network.get_all_files_of_type(/datum/computer_file/report/warrant, accesses = accesses)

/datum/nano_module/program/proc/remove_warrant(datum/computer_file/report/warrant/W, list/accesses, mob/user)
var/datum/computer_network/network = program?.computer?.get_network()
Expand Down Expand Up @@ -84,17 +84,17 @@ var/global/list/all_warrants
. = 1
var/datum/computer_file/report/warrant/W
if(href_list["addwarrant"] == "arrest")
W = new /datum/computer_file/report/warrant/arrest()
W = new /datum/computer_file/report/warrant/arrest
else
W = new /datum/computer_file/report/warrant/search()
W = new /datum/computer_file/report/warrant/search
active = W

if(href_list["savewarrant"])
. = 1
if(!active)
return
broadcast_security_hud_message("[active.get_broadcast_summary()] has been [(active in global.all_warrants) ? "edited" : "uploaded"].", nano_host())

var/success = save_warrant(active, accesses, usr)
if(success != OS_FILE_SUCCESS)
to_chat(usr, SPAN_WARNING("Could not save warrant. You may lack access to the file servers."))
Expand Down
12 changes: 9 additions & 3 deletions code/modules/organs/ailments/_ailment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
var/obj/item/organ/organ // Organ associated with the ailment (ailment is in organ.ailments list).

// Requirements before applying to a target.
var/list/applies_to_organ // What organ tags (BP_HEAD, etc) is the ailment valid for?
var/affects_robotics = FALSE // Does the ailment affect prosthetics specifically or flesh?
var/list/applies_to_organ // What organ tags (BP_HEAD, etc) is the ailment valid for?
var/applies_to_prosthetics = FALSE // Does the ailment affect prosthetic or non-prosthetic limbs?
var/applies_to_robotics = FALSE // Does the ailment affect robotic limbs?
var/applies_to_crystalline = FALSE // Does the ailment affect crystalline limbs?
var/specific_organ_subtype = /obj/item/organ/external // What organ subtype, if any, does the ailment apply to?

// Treatment types
Expand Down Expand Up @@ -41,7 +43,11 @@
/datum/ailment/proc/can_apply_to(var/obj/item/organ/_organ)
if(specific_organ_subtype && !istype(_organ, specific_organ_subtype))
return FALSE
if(affects_robotics != !!(BP_IS_PROSTHETIC(_organ)))
if(!isnull(applies_to_prosthetics) && (applies_to_prosthetics != !!BP_IS_PROSTHETIC(_organ)))
return FALSE
if(!isnull(applies_to_robotics) && (applies_to_robotics != !!BP_IS_ROBOTIC(_organ)))
return FALSE
if(!isnull(applies_to_crystalline) && (applies_to_crystalline != !!BP_IS_CRYSTAL(_organ)))
return FALSE
if(length(applies_to_organ) && !(_organ?.organ_tag in applies_to_organ))
return FALSE
Expand Down
2 changes: 1 addition & 1 deletion code/modules/organs/ailments/ailment_codex.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
ailment_table += "<tr><td><b>[name_column]</b></td><td><b>[treatment_column]</b></td></tr>"
for(var/atype in subtypesof(/datum/ailment))
var/datum/ailment/ailment = get_ailment_reference(atype)
if(!ailment.name || show_robotics_recipes != ailment.affects_robotics || ailment.hidden_from_codex)
if(!ailment.name || show_robotics_recipes != ailment.applies_to_prosthetics || ailment.hidden_from_codex)
continue
ailment_table += "<tr><td>[ailment.name]</td><td>"
var/list/ailment_cures = list()
Expand Down
3 changes: 2 additions & 1 deletion code/modules/organs/ailments/faults/_fault.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/datum/ailment/fault
affects_robotics = TRUE
applies_to_robotics = TRUE
applies_to_prosthetics = TRUE
category = /datum/ailment/fault
treated_by_item_type = list(
/obj/item/stack/nanopaste,
Expand Down
2 changes: 1 addition & 1 deletion code/modules/paperwork/paper_sticky.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
var/papers = 50
var/tmp/max_papers = 50
var/paper_type = /obj/item/paper/sticky
var/obj/item/paper/top //The instanciated paper on the top of the pad, if there's one
var/obj/item/paper/top //The instantiated paper on the top of the pad, if there's one

/obj/item/sticky_pad/Initialize(ml, material_key)
. = ..()
Expand Down
4 changes: 2 additions & 2 deletions code/modules/reagents/reagent_containers/food/meat/meat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@

/obj/item/chems/food/organ
name = "organ"
desc = "It's good for you."
desc = "It's good for you, probably."
icon = 'icons/obj/surgery.dmi'
icon_state = "appendix"
filling_color = "#e00d34"
Expand All @@ -195,7 +195,7 @@
/obj/item/chems/food/organ/populate_reagents()
. = ..()
add_to_reagents(/decl/material/solid/organic/meat, rand(3,5))
add_to_reagents(/decl/material/liquid/bromide, rand(1,3)) //lolwat?
add_to_reagents(/decl/material/gas/ammonia, rand(1,3)) // you probably should not be eating raw organ meat

/obj/item/chems/food/meatkabob
name = "meat-kabob"
Expand Down
4 changes: 2 additions & 2 deletions code/modules/reagents/reagent_containers/food/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@

/obj/item/chems/food/badrecipe/populate_reagents()
. = ..()
add_to_reagents(/decl/material/solid/organic/meat, 1)
add_to_reagents(/decl/material/solid/carbon, 3)
add_to_reagents(/decl/material/liquid/acrylamide, 1)
add_to_reagents(/decl/material/solid/carbon, 3)

/obj/item/chems/food/stuffing
name = "stuffing"
Expand Down
2 changes: 1 addition & 1 deletion code/modules/reagents/reagent_containers/food/soup.dm
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
),
list(
/decl/material/solid/carbon = 10,
/decl/material/liquid/bromide = 10
/decl/material/liquid/acrylamide = 10
),
list(
/decl/material/liquid/nutriment = 5,
Expand Down
3 changes: 2 additions & 1 deletion maps/away/bearcat/bearcat-2.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@
announcementConsole = 1;
department = "Captain";
pixel_x = 32;
initial_network_id = "freightnet_0451"
initial_network_id = "freightnet_0451";
dir = 4;
},
/obj/structure/bed/chair{
dir = 1
Expand Down
3 changes: 2 additions & 1 deletion maps/away/mining/mining-signal.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -1729,7 +1729,8 @@
/obj/machinery/network/requests_console{
icon_state = "req_comp_rewired";
pixel_y = -32;
stat = 1
stat = 1;
dir = 2;
},
/turf/floor/tiled/airless,
/area/outpost/abandoned)
Expand Down
3 changes: 2 additions & 1 deletion maps/exodus/exodus-1.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -3495,7 +3495,8 @@
/obj/machinery/network/requests_console{
department = "Atmospherics";
name = "Atmos RC";
pixel_y = 28
pixel_y = 32;
dir = 1;
},
/obj/structure/table/steel,
/turf/floor/tiled/steel_grid,
Expand Down
Loading

0 comments on commit a18e840

Please sign in to comment.